Merge branch 'master' of https://github.com/grpc/grpc into tracing++

Lot's of manual work to make this merge work
diff --git a/.clang-format b/.clang-format
index 4b3f13f..3b24519 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,5 +1,7 @@
 ---
 Language:        Cpp
 BasedOnStyle:  Google
+DerivePointerAlignment: false
+PointerAlignment: Left
 ...
 
diff --git a/BUILD b/BUILD
index 99411f9..bcb75af 100644
--- a/BUILD
+++ b/BUILD
@@ -409,41 +409,7 @@
 grpc_cc_library(
     name = "census",
     srcs = [
-        "src/core/ext/census/base_resources.cc",
-        "src/core/ext/census/context.cc",
-        "src/core/ext/census/gen/census.pb.c",
-        "src/core/ext/census/gen/trace_context.pb.c",
         "src/core/ext/census/grpc_context.cc",
-        "src/core/ext/census/grpc_filter.cc",
-        "src/core/ext/census/grpc_plugin.cc",
-        "src/core/ext/census/initialize.cc",
-        "src/core/ext/census/intrusive_hash_map.cc",
-        "src/core/ext/census/mlog.cc",
-        "src/core/ext/census/operation.cc",
-        "src/core/ext/census/placeholders.cc",
-        "src/core/ext/census/resource.cc",
-        "src/core/ext/census/trace_context.cc",
-        "src/core/ext/census/tracing.cc",
-    ],
-    hdrs = [
-        "src/core/ext/census/aggregation.h",
-        "src/core/ext/census/base_resources.h",
-        "src/core/ext/census/census_interface.h",
-        "src/core/ext/census/census_rpc_stats.h",
-        "src/core/ext/census/gen/census.pb.h",
-        "src/core/ext/census/gen/trace_context.pb.h",
-        "src/core/ext/census/grpc_filter.h",
-        "src/core/ext/census/intrusive_hash_map.h",
-        "src/core/ext/census/intrusive_hash_map_internal.h",
-        "src/core/ext/census/mlog.h",
-        "src/core/ext/census/resource.h",
-        "src/core/ext/census/rpc_metric_id.h",
-        "src/core/ext/census/trace_context.h",
-        "src/core/ext/census/trace_label.h",
-        "src/core/ext/census/trace_propagation.h",
-        "src/core/ext/census/trace_status.h",
-        "src/core/ext/census/trace_string.h",
-        "src/core/ext/census/tracing.h",
     ],
     external_deps = [
         "nanopb",
@@ -872,6 +838,7 @@
 grpc_cc_library(
     name = "grpc_client_channel",
     srcs = [
+        "src/core/ext/filters/client_channel/backup_poller.cc",
         "src/core/ext/filters/client_channel/channel_connectivity.cc",
         "src/core/ext/filters/client_channel/client_channel.cc",
         "src/core/ext/filters/client_channel/client_channel_factory.cc",
@@ -894,6 +861,7 @@
         "src/core/ext/filters/client_channel/uri_parser.cc",
     ],
     hdrs = [
+        "src/core/ext/filters/client_channel/backup_poller.h",
         "src/core/ext/filters/client_channel/client_channel.h",
         "src/core/ext/filters/client_channel/client_channel_factory.h",
         "src/core/ext/filters/client_channel/connector.h",
@@ -1075,6 +1043,21 @@
 )
 
 grpc_cc_library(
+    name = "grpc_lb_subchannel_list",
+    srcs = [
+        "src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc",
+    ],
+    hdrs = [
+        "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h",
+    ],
+    language = "c++",
+    deps = [
+        "grpc_base",
+        "grpc_client_channel",
+    ],
+)
+
+grpc_cc_library(
     name = "grpc_lb_policy_pick_first",
     srcs = [
         "src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc",
@@ -1083,6 +1066,7 @@
     deps = [
         "grpc_base",
         "grpc_client_channel",
+        "grpc_lb_subchannel_list",
     ],
 )
 
@@ -1095,6 +1079,7 @@
     deps = [
         "grpc_base",
         "grpc_client_channel",
+        "grpc_lb_subchannel_list",
     ],
 )
 
@@ -1560,7 +1545,7 @@
 grpc_cc_library(
     name = "grpc++_config_proto",
     external_deps = [
-        "protobuf",
+        "protobuf_headers",
     ],
     language = "c++",
     public_hdrs = [
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 579621b..4daff95 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -384,10 +384,6 @@
 add_dependencies(buildtests_c bin_decoder_test)
 add_dependencies(buildtests_c bin_encoder_test)
 add_dependencies(buildtests_c byte_stream_test)
-add_dependencies(buildtests_c census_context_test)
-add_dependencies(buildtests_c census_intrusive_hash_map_test)
-add_dependencies(buildtests_c census_resource_test)
-add_dependencies(buildtests_c census_trace_context_test)
 add_dependencies(buildtests_c channel_create_test)
 add_dependencies(buildtests_c chttp2_hpack_encoder_test)
 add_dependencies(buildtests_c chttp2_stream_map_test)
@@ -459,6 +455,7 @@
 endif()
 add_dependencies(buildtests_c grpc_jwt_verifier_test)
 add_dependencies(buildtests_c grpc_security_connector_test)
+add_dependencies(buildtests_c grpc_ssl_credentials_test)
 if(_gRPC_PLATFORM_LINUX)
 add_dependencies(buildtests_c handshake_client)
 endif()
@@ -491,7 +488,6 @@
 endif()
 add_dependencies(buildtests_c message_compress_test)
 add_dependencies(buildtests_c minimal_stack_is_minimal_test)
-add_dependencies(buildtests_c mlog_test)
 add_dependencies(buildtests_c multiple_server_queues_test)
 add_dependencies(buildtests_c murmur_hash_test)
 add_dependencies(buildtests_c no_server_test)
@@ -920,7 +916,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_library(gpr_test_util
-  test/core/util/test_config.c
+  test/core/util/test_config.cc
 )
 
 if(WIN32 AND MSVC)
@@ -1152,6 +1148,7 @@
   src/core/tsi/transport_security_adapter.cc
   src/core/ext/transport/chttp2/server/chttp2_server.cc
   src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
+  src/core/ext/filters/client_channel/backup_poller.cc
   src/core/ext/filters/client_channel/channel_connectivity.cc
   src/core/ext/filters/client_channel/client_channel.cc
   src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -1191,6 +1188,7 @@
   third_party/nanopb/pb_encode.c
   src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
   src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
+  src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc
   src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
   src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
   src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
@@ -1200,21 +1198,7 @@
   src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
   src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
   src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
-  src/core/ext/census/base_resources.cc
-  src/core/ext/census/context.cc
-  src/core/ext/census/gen/census.pb.c
-  src/core/ext/census/gen/trace_context.pb.c
   src/core/ext/census/grpc_context.cc
-  src/core/ext/census/grpc_filter.cc
-  src/core/ext/census/grpc_plugin.cc
-  src/core/ext/census/initialize.cc
-  src/core/ext/census/intrusive_hash_map.cc
-  src/core/ext/census/mlog.cc
-  src/core/ext/census/operation.cc
-  src/core/ext/census/placeholders.cc
-  src/core/ext/census/resource.cc
-  src/core/ext/census/trace_context.cc
-  src/core/ext/census/tracing.cc
   src/core/ext/filters/max_age/max_age_filter.cc
   src/core/ext/filters/message_size/message_size_filter.cc
   src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
@@ -1476,6 +1460,7 @@
   src/core/ext/filters/http/http_filters_plugin.cc
   src/core/ext/filters/http/message_compress/message_compress_filter.cc
   src/core/ext/filters/http/server/http_server_filter.cc
+  src/core/ext/filters/client_channel/backup_poller.cc
   src/core/ext/filters/client_channel/channel_connectivity.cc
   src/core/ext/filters/client_channel/client_channel.cc
   src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -1613,26 +1598,26 @@
 if (gRPC_BUILD_TESTS)
 
 add_library(grpc_test_util
-  test/core/end2end/data/client_certs.c
-  test/core/end2end/data/server1_cert.c
-  test/core/end2end/data/server1_key.c
-  test/core/end2end/data/test_root_cert.c
-  test/core/security/oauth2_utils.c
+  test/core/end2end/data/client_certs.cc
+  test/core/end2end/data/server1_cert.cc
+  test/core/end2end/data/server1_key.cc
+  test/core/end2end/data/test_root_cert.cc
+  test/core/security/oauth2_utils.cc
   src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
-  test/core/end2end/cq_verifier.c
-  test/core/end2end/fixtures/http_proxy_fixture.c
-  test/core/end2end/fixtures/proxy.c
-  test/core/iomgr/endpoint_tests.c
+  test/core/end2end/cq_verifier.cc
+  test/core/end2end/fixtures/http_proxy_fixture.cc
+  test/core/end2end/fixtures/proxy.cc
+  test/core/iomgr/endpoint_tests.cc
   test/core/util/debugger_macros.cc
-  test/core/util/grpc_profiler.c
-  test/core/util/memory_counters.c
-  test/core/util/mock_endpoint.c
-  test/core/util/parse_hexstring.c
-  test/core/util/passthru_endpoint.c
-  test/core/util/port.c
-  test/core/util/port_server_client.c
-  test/core/util/slice_splitter.c
-  test/core/util/trickle_endpoint.c
+  test/core/util/grpc_profiler.cc
+  test/core/util/memory_counters.cc
+  test/core/util/mock_endpoint.cc
+  test/core/util/parse_hexstring.cc
+  test/core/util/passthru_endpoint.cc
+  test/core/util/port.cc
+  test/core/util/port_server_client.cc
+  test/core/util/slice_splitter.cc
+  test/core/util/trickle_endpoint.cc
   src/core/lib/backoff/backoff.cc
   src/core/lib/channel/channel_args.cc
   src/core/lib/channel/channel_stack.cc
@@ -1766,6 +1751,7 @@
   src/core/lib/transport/transport.cc
   src/core/lib/transport/transport_op_string.cc
   src/core/lib/debug/trace.cc
+  src/core/ext/filters/client_channel/backup_poller.cc
   src/core/ext/filters/client_channel/channel_connectivity.cc
   src/core/ext/filters/client_channel/client_channel.cc
   src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -1884,20 +1870,20 @@
 
 add_library(grpc_test_util_unsecure
   src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
-  test/core/end2end/cq_verifier.c
-  test/core/end2end/fixtures/http_proxy_fixture.c
-  test/core/end2end/fixtures/proxy.c
-  test/core/iomgr/endpoint_tests.c
+  test/core/end2end/cq_verifier.cc
+  test/core/end2end/fixtures/http_proxy_fixture.cc
+  test/core/end2end/fixtures/proxy.cc
+  test/core/iomgr/endpoint_tests.cc
   test/core/util/debugger_macros.cc
-  test/core/util/grpc_profiler.c
-  test/core/util/memory_counters.c
-  test/core/util/mock_endpoint.c
-  test/core/util/parse_hexstring.c
-  test/core/util/passthru_endpoint.c
-  test/core/util/port.c
-  test/core/util/port_server_client.c
-  test/core/util/slice_splitter.c
-  test/core/util/trickle_endpoint.c
+  test/core/util/grpc_profiler.cc
+  test/core/util/memory_counters.cc
+  test/core/util/mock_endpoint.cc
+  test/core/util/parse_hexstring.cc
+  test/core/util/passthru_endpoint.cc
+  test/core/util/port.cc
+  test/core/util/port_server_client.cc
+  test/core/util/slice_splitter.cc
+  test/core/util/trickle_endpoint.cc
   src/core/lib/backoff/backoff.cc
   src/core/lib/channel/channel_args.cc
   src/core/lib/channel/channel_stack.cc
@@ -2031,6 +2017,7 @@
   src/core/lib/transport/transport.cc
   src/core/lib/transport/transport_op_string.cc
   src/core/lib/debug/trace.cc
+  src/core/ext/filters/client_channel/backup_poller.cc
   src/core/ext/filters/client_channel/channel_connectivity.cc
   src/core/ext/filters/client_channel/client_channel.cc
   src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -2315,6 +2302,7 @@
   src/core/ext/transport/chttp2/client/insecure/channel_create.cc
   src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
   src/core/ext/transport/chttp2/client/chttp2_connector.cc
+  src/core/ext/filters/client_channel/backup_poller.cc
   src/core/ext/filters/client_channel/channel_connectivity.cc
   src/core/ext/filters/client_channel/client_channel.cc
   src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -2357,22 +2345,9 @@
   third_party/nanopb/pb_decode.c
   third_party/nanopb/pb_encode.c
   src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
+  src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc
   src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
-  src/core/ext/census/base_resources.cc
-  src/core/ext/census/context.cc
-  src/core/ext/census/gen/census.pb.c
-  src/core/ext/census/gen/trace_context.pb.c
   src/core/ext/census/grpc_context.cc
-  src/core/ext/census/grpc_filter.cc
-  src/core/ext/census/grpc_plugin.cc
-  src/core/ext/census/initialize.cc
-  src/core/ext/census/intrusive_hash_map.cc
-  src/core/ext/census/mlog.cc
-  src/core/ext/census/operation.cc
-  src/core/ext/census/placeholders.cc
-  src/core/ext/census/resource.cc
-  src/core/ext/census/trace_context.cc
-  src/core/ext/census/tracing.cc
   src/core/ext/filters/max_age/max_age_filter.cc
   src/core/ext/filters/message_size/message_size_filter.cc
   src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
@@ -2468,7 +2443,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_library(reconnect_server
-  test/core/util/reconnect_server.c
+  test/core/util/reconnect_server.cc
 )
 
 if(WIN32 AND MSVC)
@@ -2511,7 +2486,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_library(test_tcp_server
-  test/core/util/test_tcp_server.c
+  test/core/util/test_tcp_server.cc
 )
 
 if(WIN32 AND MSVC)
@@ -3050,6 +3025,7 @@
   src/core/ext/filters/http/http_filters_plugin.cc
   src/core/ext/filters/http/message_compress/message_compress_filter.cc
   src/core/ext/filters/http/server/http_server_filter.cc
+  src/core/ext/filters/client_channel/backup_poller.cc
   src/core/ext/filters/client_channel/channel_connectivity.cc
   src/core/ext/filters/client_channel/client_channel.cc
   src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -3074,21 +3050,7 @@
   src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
   src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
   src/core/ext/transport/chttp2/server/chttp2_server.cc
-  src/core/ext/census/base_resources.cc
-  src/core/ext/census/context.cc
-  src/core/ext/census/gen/census.pb.c
-  src/core/ext/census/gen/trace_context.pb.c
   src/core/ext/census/grpc_context.cc
-  src/core/ext/census/grpc_filter.cc
-  src/core/ext/census/grpc_plugin.cc
-  src/core/ext/census/initialize.cc
-  src/core/ext/census/intrusive_hash_map.cc
-  src/core/ext/census/mlog.cc
-  src/core/ext/census/operation.cc
-  src/core/ext/census/placeholders.cc
-  src/core/ext/census/resource.cc
-  src/core/ext/census/trace_context.cc
-  src/core/ext/census/tracing.cc
   third_party/nanopb/pb_common.c
   third_party/nanopb/pb_decode.c
   third_party/nanopb/pb_encode.c
@@ -4809,7 +4771,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_library(bad_client_test
-  test/core/bad_client/bad_client.c
+  test/core/bad_client/bad_client.cc
 )
 
 if(WIN32 AND MSVC)
@@ -4851,7 +4813,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_library(bad_ssl_test_server
-  test/core/bad_ssl/server_common.c
+  test/core/bad_ssl/server_common.cc
 )
 
 if(WIN32 AND MSVC)
@@ -4893,67 +4855,67 @@
 if (gRPC_BUILD_TESTS)
 
 add_library(end2end_tests
-  test/core/end2end/end2end_tests.c
-  test/core/end2end/end2end_test_utils.c
-  test/core/end2end/tests/authority_not_supported.c
-  test/core/end2end/tests/bad_hostname.c
-  test/core/end2end/tests/bad_ping.c
-  test/core/end2end/tests/binary_metadata.c
-  test/core/end2end/tests/call_creds.c
-  test/core/end2end/tests/cancel_after_accept.c
-  test/core/end2end/tests/cancel_after_client_done.c
-  test/core/end2end/tests/cancel_after_invoke.c
-  test/core/end2end/tests/cancel_after_round_trip.c
-  test/core/end2end/tests/cancel_before_invoke.c
-  test/core/end2end/tests/cancel_in_a_vacuum.c
-  test/core/end2end/tests/cancel_with_status.c
-  test/core/end2end/tests/compressed_payload.c
-  test/core/end2end/tests/connectivity.c
-  test/core/end2end/tests/default_host.c
-  test/core/end2end/tests/disappearing_server.c
-  test/core/end2end/tests/empty_batch.c
-  test/core/end2end/tests/filter_call_init_fails.c
-  test/core/end2end/tests/filter_causes_close.c
-  test/core/end2end/tests/filter_latency.c
-  test/core/end2end/tests/graceful_server_shutdown.c
-  test/core/end2end/tests/high_initial_seqno.c
-  test/core/end2end/tests/hpack_size.c
-  test/core/end2end/tests/idempotent_request.c
-  test/core/end2end/tests/invoke_large_request.c
-  test/core/end2end/tests/keepalive_timeout.c
-  test/core/end2end/tests/large_metadata.c
-  test/core/end2end/tests/load_reporting_hook.c
-  test/core/end2end/tests/max_concurrent_streams.c
-  test/core/end2end/tests/max_connection_age.c
-  test/core/end2end/tests/max_connection_idle.c
-  test/core/end2end/tests/max_message_length.c
-  test/core/end2end/tests/negative_deadline.c
-  test/core/end2end/tests/network_status_change.c
-  test/core/end2end/tests/no_logging.c
-  test/core/end2end/tests/no_op.c
-  test/core/end2end/tests/payload.c
-  test/core/end2end/tests/ping.c
-  test/core/end2end/tests/ping_pong_streaming.c
-  test/core/end2end/tests/proxy_auth.c
-  test/core/end2end/tests/registered_call.c
-  test/core/end2end/tests/request_with_flags.c
-  test/core/end2end/tests/request_with_payload.c
-  test/core/end2end/tests/resource_quota_server.c
-  test/core/end2end/tests/server_finishes_request.c
-  test/core/end2end/tests/shutdown_finishes_calls.c
-  test/core/end2end/tests/shutdown_finishes_tags.c
-  test/core/end2end/tests/simple_cacheable_request.c
-  test/core/end2end/tests/simple_delayed_request.c
-  test/core/end2end/tests/simple_metadata.c
-  test/core/end2end/tests/simple_request.c
-  test/core/end2end/tests/stream_compression_compressed_payload.c
-  test/core/end2end/tests/stream_compression_payload.c
-  test/core/end2end/tests/stream_compression_ping_pong_streaming.c
-  test/core/end2end/tests/streaming_error_response.c
-  test/core/end2end/tests/trailing_metadata.c
-  test/core/end2end/tests/workaround_cronet_compression.c
-  test/core/end2end/tests/write_buffering.c
-  test/core/end2end/tests/write_buffering_at_end.c
+  test/core/end2end/end2end_tests.cc
+  test/core/end2end/end2end_test_utils.cc
+  test/core/end2end/tests/authority_not_supported.cc
+  test/core/end2end/tests/bad_hostname.cc
+  test/core/end2end/tests/bad_ping.cc
+  test/core/end2end/tests/binary_metadata.cc
+  test/core/end2end/tests/call_creds.cc
+  test/core/end2end/tests/cancel_after_accept.cc
+  test/core/end2end/tests/cancel_after_client_done.cc
+  test/core/end2end/tests/cancel_after_invoke.cc
+  test/core/end2end/tests/cancel_after_round_trip.cc
+  test/core/end2end/tests/cancel_before_invoke.cc
+  test/core/end2end/tests/cancel_in_a_vacuum.cc
+  test/core/end2end/tests/cancel_with_status.cc
+  test/core/end2end/tests/compressed_payload.cc
+  test/core/end2end/tests/connectivity.cc
+  test/core/end2end/tests/default_host.cc
+  test/core/end2end/tests/disappearing_server.cc
+  test/core/end2end/tests/empty_batch.cc
+  test/core/end2end/tests/filter_call_init_fails.cc
+  test/core/end2end/tests/filter_causes_close.cc
+  test/core/end2end/tests/filter_latency.cc
+  test/core/end2end/tests/graceful_server_shutdown.cc
+  test/core/end2end/tests/high_initial_seqno.cc
+  test/core/end2end/tests/hpack_size.cc
+  test/core/end2end/tests/idempotent_request.cc
+  test/core/end2end/tests/invoke_large_request.cc
+  test/core/end2end/tests/keepalive_timeout.cc
+  test/core/end2end/tests/large_metadata.cc
+  test/core/end2end/tests/load_reporting_hook.cc
+  test/core/end2end/tests/max_concurrent_streams.cc
+  test/core/end2end/tests/max_connection_age.cc
+  test/core/end2end/tests/max_connection_idle.cc
+  test/core/end2end/tests/max_message_length.cc
+  test/core/end2end/tests/negative_deadline.cc
+  test/core/end2end/tests/network_status_change.cc
+  test/core/end2end/tests/no_logging.cc
+  test/core/end2end/tests/no_op.cc
+  test/core/end2end/tests/payload.cc
+  test/core/end2end/tests/ping.cc
+  test/core/end2end/tests/ping_pong_streaming.cc
+  test/core/end2end/tests/proxy_auth.cc
+  test/core/end2end/tests/registered_call.cc
+  test/core/end2end/tests/request_with_flags.cc
+  test/core/end2end/tests/request_with_payload.cc
+  test/core/end2end/tests/resource_quota_server.cc
+  test/core/end2end/tests/server_finishes_request.cc
+  test/core/end2end/tests/shutdown_finishes_calls.cc
+  test/core/end2end/tests/shutdown_finishes_tags.cc
+  test/core/end2end/tests/simple_cacheable_request.cc
+  test/core/end2end/tests/simple_delayed_request.cc
+  test/core/end2end/tests/simple_metadata.cc
+  test/core/end2end/tests/simple_request.cc
+  test/core/end2end/tests/stream_compression_compressed_payload.cc
+  test/core/end2end/tests/stream_compression_payload.cc
+  test/core/end2end/tests/stream_compression_ping_pong_streaming.cc
+  test/core/end2end/tests/streaming_error_response.cc
+  test/core/end2end/tests/trailing_metadata.cc
+  test/core/end2end/tests/workaround_cronet_compression.cc
+  test/core/end2end/tests/write_buffering.cc
+  test/core/end2end/tests/write_buffering_at_end.cc
 )
 
 if(WIN32 AND MSVC)
@@ -4996,66 +4958,66 @@
 if (gRPC_BUILD_TESTS)
 
 add_library(end2end_nosec_tests
-  test/core/end2end/end2end_nosec_tests.c
-  test/core/end2end/end2end_test_utils.c
-  test/core/end2end/tests/authority_not_supported.c
-  test/core/end2end/tests/bad_hostname.c
-  test/core/end2end/tests/bad_ping.c
-  test/core/end2end/tests/binary_metadata.c
-  test/core/end2end/tests/cancel_after_accept.c
-  test/core/end2end/tests/cancel_after_client_done.c
-  test/core/end2end/tests/cancel_after_invoke.c
-  test/core/end2end/tests/cancel_after_round_trip.c
-  test/core/end2end/tests/cancel_before_invoke.c
-  test/core/end2end/tests/cancel_in_a_vacuum.c
-  test/core/end2end/tests/cancel_with_status.c
-  test/core/end2end/tests/compressed_payload.c
-  test/core/end2end/tests/connectivity.c
-  test/core/end2end/tests/default_host.c
-  test/core/end2end/tests/disappearing_server.c
-  test/core/end2end/tests/empty_batch.c
-  test/core/end2end/tests/filter_call_init_fails.c
-  test/core/end2end/tests/filter_causes_close.c
-  test/core/end2end/tests/filter_latency.c
-  test/core/end2end/tests/graceful_server_shutdown.c
-  test/core/end2end/tests/high_initial_seqno.c
-  test/core/end2end/tests/hpack_size.c
-  test/core/end2end/tests/idempotent_request.c
-  test/core/end2end/tests/invoke_large_request.c
-  test/core/end2end/tests/keepalive_timeout.c
-  test/core/end2end/tests/large_metadata.c
-  test/core/end2end/tests/load_reporting_hook.c
-  test/core/end2end/tests/max_concurrent_streams.c
-  test/core/end2end/tests/max_connection_age.c
-  test/core/end2end/tests/max_connection_idle.c
-  test/core/end2end/tests/max_message_length.c
-  test/core/end2end/tests/negative_deadline.c
-  test/core/end2end/tests/network_status_change.c
-  test/core/end2end/tests/no_logging.c
-  test/core/end2end/tests/no_op.c
-  test/core/end2end/tests/payload.c
-  test/core/end2end/tests/ping.c
-  test/core/end2end/tests/ping_pong_streaming.c
-  test/core/end2end/tests/proxy_auth.c
-  test/core/end2end/tests/registered_call.c
-  test/core/end2end/tests/request_with_flags.c
-  test/core/end2end/tests/request_with_payload.c
-  test/core/end2end/tests/resource_quota_server.c
-  test/core/end2end/tests/server_finishes_request.c
-  test/core/end2end/tests/shutdown_finishes_calls.c
-  test/core/end2end/tests/shutdown_finishes_tags.c
-  test/core/end2end/tests/simple_cacheable_request.c
-  test/core/end2end/tests/simple_delayed_request.c
-  test/core/end2end/tests/simple_metadata.c
-  test/core/end2end/tests/simple_request.c
-  test/core/end2end/tests/stream_compression_compressed_payload.c
-  test/core/end2end/tests/stream_compression_payload.c
-  test/core/end2end/tests/stream_compression_ping_pong_streaming.c
-  test/core/end2end/tests/streaming_error_response.c
-  test/core/end2end/tests/trailing_metadata.c
-  test/core/end2end/tests/workaround_cronet_compression.c
-  test/core/end2end/tests/write_buffering.c
-  test/core/end2end/tests/write_buffering_at_end.c
+  test/core/end2end/end2end_nosec_tests.cc
+  test/core/end2end/end2end_test_utils.cc
+  test/core/end2end/tests/authority_not_supported.cc
+  test/core/end2end/tests/bad_hostname.cc
+  test/core/end2end/tests/bad_ping.cc
+  test/core/end2end/tests/binary_metadata.cc
+  test/core/end2end/tests/cancel_after_accept.cc
+  test/core/end2end/tests/cancel_after_client_done.cc
+  test/core/end2end/tests/cancel_after_invoke.cc
+  test/core/end2end/tests/cancel_after_round_trip.cc
+  test/core/end2end/tests/cancel_before_invoke.cc
+  test/core/end2end/tests/cancel_in_a_vacuum.cc
+  test/core/end2end/tests/cancel_with_status.cc
+  test/core/end2end/tests/compressed_payload.cc
+  test/core/end2end/tests/connectivity.cc
+  test/core/end2end/tests/default_host.cc
+  test/core/end2end/tests/disappearing_server.cc
+  test/core/end2end/tests/empty_batch.cc
+  test/core/end2end/tests/filter_call_init_fails.cc
+  test/core/end2end/tests/filter_causes_close.cc
+  test/core/end2end/tests/filter_latency.cc
+  test/core/end2end/tests/graceful_server_shutdown.cc
+  test/core/end2end/tests/high_initial_seqno.cc
+  test/core/end2end/tests/hpack_size.cc
+  test/core/end2end/tests/idempotent_request.cc
+  test/core/end2end/tests/invoke_large_request.cc
+  test/core/end2end/tests/keepalive_timeout.cc
+  test/core/end2end/tests/large_metadata.cc
+  test/core/end2end/tests/load_reporting_hook.cc
+  test/core/end2end/tests/max_concurrent_streams.cc
+  test/core/end2end/tests/max_connection_age.cc
+  test/core/end2end/tests/max_connection_idle.cc
+  test/core/end2end/tests/max_message_length.cc
+  test/core/end2end/tests/negative_deadline.cc
+  test/core/end2end/tests/network_status_change.cc
+  test/core/end2end/tests/no_logging.cc
+  test/core/end2end/tests/no_op.cc
+  test/core/end2end/tests/payload.cc
+  test/core/end2end/tests/ping.cc
+  test/core/end2end/tests/ping_pong_streaming.cc
+  test/core/end2end/tests/proxy_auth.cc
+  test/core/end2end/tests/registered_call.cc
+  test/core/end2end/tests/request_with_flags.cc
+  test/core/end2end/tests/request_with_payload.cc
+  test/core/end2end/tests/resource_quota_server.cc
+  test/core/end2end/tests/server_finishes_request.cc
+  test/core/end2end/tests/shutdown_finishes_calls.cc
+  test/core/end2end/tests/shutdown_finishes_tags.cc
+  test/core/end2end/tests/simple_cacheable_request.cc
+  test/core/end2end/tests/simple_delayed_request.cc
+  test/core/end2end/tests/simple_metadata.cc
+  test/core/end2end/tests/simple_request.cc
+  test/core/end2end/tests/stream_compression_compressed_payload.cc
+  test/core/end2end/tests/stream_compression_payload.cc
+  test/core/end2end/tests/stream_compression_ping_pong_streaming.cc
+  test/core/end2end/tests/streaming_error_response.cc
+  test/core/end2end/tests/trailing_metadata.cc
+  test/core/end2end/tests/workaround_cronet_compression.cc
+  test/core/end2end/tests/write_buffering.cc
+  test/core/end2end/tests/write_buffering_at_end.cc
 )
 
 if(WIN32 AND MSVC)
@@ -5098,7 +5060,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(alarm_test
-  test/core/surface/alarm_test.c
+  test/core/surface/alarm_test.cc
 )
 
 
@@ -5128,7 +5090,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(algorithm_test
-  test/core/compression/algorithm_test.c
+  test/core/compression/algorithm_test.cc
 )
 
 
@@ -5158,7 +5120,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(alloc_test
-  test/core/support/alloc_test.c
+  test/core/support/alloc_test.cc
 )
 
 
@@ -5186,7 +5148,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(alpn_test
-  test/core/transport/chttp2/alpn_test.c
+  test/core/transport/chttp2/alpn_test.cc
 )
 
 
@@ -5216,7 +5178,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(arena_test
-  test/core/support/arena_test.c
+  test/core/support/arena_test.cc
 )
 
 
@@ -5244,7 +5206,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(backoff_test
-  test/core/backoff/backoff_test.c
+  test/core/backoff/backoff_test.cc
 )
 
 
@@ -5274,7 +5236,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(bad_server_response_test
-  test/core/end2end/bad_server_response_test.c
+  test/core/end2end/bad_server_response_test.cc
 )
 
 
@@ -5305,7 +5267,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(bin_decoder_test
-  test/core/transport/chttp2/bin_decoder_test.c
+  test/core/transport/chttp2/bin_decoder_test.cc
 )
 
 
@@ -5333,7 +5295,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(bin_encoder_test
-  test/core/transport/chttp2/bin_encoder_test.c
+  test/core/transport/chttp2/bin_encoder_test.cc
 )
 
 
@@ -5361,7 +5323,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(byte_stream_test
-  test/core/transport/byte_stream_test.c
+  test/core/transport/byte_stream_test.cc
 )
 
 
@@ -5390,128 +5352,8 @@
 endif (gRPC_BUILD_TESTS)
 if (gRPC_BUILD_TESTS)
 
-add_executable(census_context_test
-  test/core/census/context_test.c
-)
-
-
-target_include_directories(census_context_test
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
-  PRIVATE ${BORINGSSL_ROOT_DIR}/include
-  PRIVATE ${PROTOBUF_ROOT_DIR}/src
-  PRIVATE ${BENCHMARK_ROOT_DIR}/include
-  PRIVATE ${ZLIB_ROOT_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
-  PRIVATE ${CARES_INCLUDE_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp
-)
-
-target_link_libraries(census_context_test
-  ${_gRPC_ALLTARGETS_LIBRARIES}
-  grpc_test_util
-  grpc
-  gpr_test_util
-  gpr
-)
-
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
-add_executable(census_intrusive_hash_map_test
-  test/core/census/intrusive_hash_map_test.c
-)
-
-
-target_include_directories(census_intrusive_hash_map_test
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
-  PRIVATE ${BORINGSSL_ROOT_DIR}/include
-  PRIVATE ${PROTOBUF_ROOT_DIR}/src
-  PRIVATE ${BENCHMARK_ROOT_DIR}/include
-  PRIVATE ${ZLIB_ROOT_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
-  PRIVATE ${CARES_INCLUDE_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp
-)
-
-target_link_libraries(census_intrusive_hash_map_test
-  ${_gRPC_ALLTARGETS_LIBRARIES}
-  grpc_test_util
-  grpc
-  gpr_test_util
-  gpr
-)
-
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
-add_executable(census_resource_test
-  test/core/census/resource_test.c
-)
-
-
-target_include_directories(census_resource_test
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
-  PRIVATE ${BORINGSSL_ROOT_DIR}/include
-  PRIVATE ${PROTOBUF_ROOT_DIR}/src
-  PRIVATE ${BENCHMARK_ROOT_DIR}/include
-  PRIVATE ${ZLIB_ROOT_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
-  PRIVATE ${CARES_INCLUDE_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp
-)
-
-target_link_libraries(census_resource_test
-  ${_gRPC_ALLTARGETS_LIBRARIES}
-  grpc_test_util
-  grpc
-  gpr_test_util
-  gpr
-)
-
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
-add_executable(census_trace_context_test
-  test/core/census/trace_context_test.c
-)
-
-
-target_include_directories(census_trace_context_test
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
-  PRIVATE ${BORINGSSL_ROOT_DIR}/include
-  PRIVATE ${PROTOBUF_ROOT_DIR}/src
-  PRIVATE ${BENCHMARK_ROOT_DIR}/include
-  PRIVATE ${ZLIB_ROOT_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
-  PRIVATE ${CARES_INCLUDE_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp
-)
-
-target_link_libraries(census_trace_context_test
-  ${_gRPC_ALLTARGETS_LIBRARIES}
-  grpc_test_util
-  grpc
-  gpr_test_util
-  gpr
-)
-
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
 add_executable(channel_create_test
-  test/core/surface/channel_create_test.c
+  test/core/surface/channel_create_test.cc
 )
 
 
@@ -5576,7 +5418,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(chttp2_hpack_encoder_test
-  test/core/transport/chttp2/hpack_encoder_test.c
+  test/core/transport/chttp2/hpack_encoder_test.cc
 )
 
 
@@ -5606,7 +5448,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(chttp2_stream_map_test
-  test/core/transport/chttp2/stream_map_test.c
+  test/core/transport/chttp2/stream_map_test.cc
 )
 
 
@@ -5636,7 +5478,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(chttp2_varint_test
-  test/core/transport/chttp2/varint_test.c
+  test/core/transport/chttp2/varint_test.cc
 )
 
 
@@ -5666,7 +5508,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(combiner_test
-  test/core/iomgr/combiner_test.c
+  test/core/iomgr/combiner_test.cc
 )
 
 
@@ -5696,7 +5538,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(compression_test
-  test/core/compression/compression_test.c
+  test/core/compression/compression_test.cc
 )
 
 
@@ -5726,7 +5568,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(concurrent_connectivity_test
-  test/core/surface/concurrent_connectivity_test.c
+  test/core/surface/concurrent_connectivity_test.cc
 )
 
 
@@ -5756,7 +5598,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(connection_refused_test
-  test/core/end2end/connection_refused_test.c
+  test/core/end2end/connection_refused_test.cc
 )
 
 
@@ -5786,7 +5628,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(dns_resolver_connectivity_test
-  test/core/client_channel/resolvers/dns_resolver_connectivity_test.c
+  test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
 )
 
 
@@ -5816,7 +5658,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(dns_resolver_test
-  test/core/client_channel/resolvers/dns_resolver_test.c
+  test/core/client_channel/resolvers/dns_resolver_test.cc
 )
 
 
@@ -5847,7 +5689,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(dualstack_socket_test
-  test/core/end2end/dualstack_socket_test.c
+  test/core/end2end/dualstack_socket_test.cc
 )
 
 
@@ -5878,7 +5720,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(endpoint_pair_test
-  test/core/iomgr/endpoint_pair_test.c
+  test/core/iomgr/endpoint_pair_test.cc
 )
 
 
@@ -5908,7 +5750,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(error_test
-  test/core/iomgr/error_test.c
+  test/core/iomgr/error_test.cc
 )
 
 
@@ -5939,7 +5781,7 @@
 if(_gRPC_PLATFORM_LINUX)
 
 add_executable(ev_epollsig_linux_test
-  test/core/iomgr/ev_epollsig_linux_test.c
+  test/core/iomgr/ev_epollsig_linux_test.cc
 )
 
 
@@ -5970,7 +5812,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(fake_resolver_test
-  test/core/client_channel/resolvers/fake_resolver_test.c
+  test/core/client_channel/resolvers/fake_resolver_test.cc
 )
 
 
@@ -6001,8 +5843,8 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(fake_transport_security_test
-  test/core/tsi/fake_transport_security_test.c
-  test/core/tsi/transport_security_test_lib.c
+  test/core/tsi/fake_transport_security_test.cc
+  test/core/tsi/transport_security_test_lib.cc
 )
 
 
@@ -6033,7 +5875,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(fd_conservation_posix_test
-  test/core/iomgr/fd_conservation_posix_test.c
+  test/core/iomgr/fd_conservation_posix_test.cc
 )
 
 
@@ -6065,7 +5907,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(fd_posix_test
-  test/core/iomgr/fd_posix_test.c
+  test/core/iomgr/fd_posix_test.cc
 )
 
 
@@ -6096,7 +5938,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(fling_client
-  test/core/fling/client.c
+  test/core/fling/client.cc
 )
 
 
@@ -6126,7 +5968,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(fling_server
-  test/core/fling/server.c
+  test/core/fling/server.cc
 )
 
 
@@ -6157,7 +5999,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(fling_stream_test
-  test/core/fling/fling_stream_test.c
+  test/core/fling/fling_stream_test.cc
 )
 
 
@@ -6189,7 +6031,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(fling_test
-  test/core/fling/fling_test.c
+  test/core/fling/fling_test.cc
 )
 
 
@@ -6322,7 +6164,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(goaway_server_test
-  test/core/end2end/goaway_server_test.c
+  test/core/end2end/goaway_server_test.cc
 )
 
 
@@ -6353,7 +6195,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_avl_test
-  test/core/support/avl_test.c
+  test/core/support/avl_test.cc
 )
 
 
@@ -6381,7 +6223,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_cmdline_test
-  test/core/support/cmdline_test.c
+  test/core/support/cmdline_test.cc
 )
 
 
@@ -6409,7 +6251,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_cpu_test
-  test/core/support/cpu_test.c
+  test/core/support/cpu_test.cc
 )
 
 
@@ -6437,7 +6279,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_env_test
-  test/core/support/env_test.c
+  test/core/support/env_test.cc
 )
 
 
@@ -6465,7 +6307,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_histogram_test
-  test/core/support/histogram_test.c
+  test/core/support/histogram_test.cc
 )
 
 
@@ -6493,7 +6335,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_host_port_test
-  test/core/support/host_port_test.c
+  test/core/support/host_port_test.cc
 )
 
 
@@ -6521,7 +6363,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_log_test
-  test/core/support/log_test.c
+  test/core/support/log_test.cc
 )
 
 
@@ -6549,7 +6391,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_mpscq_test
-  test/core/support/mpscq_test.c
+  test/core/support/mpscq_test.cc
 )
 
 
@@ -6577,7 +6419,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_spinlock_test
-  test/core/support/spinlock_test.c
+  test/core/support/spinlock_test.cc
 )
 
 
@@ -6605,7 +6447,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_stack_lockfree_test
-  test/core/support/stack_lockfree_test.c
+  test/core/support/stack_lockfree_test.cc
 )
 
 
@@ -6633,7 +6475,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_string_test
-  test/core/support/string_test.c
+  test/core/support/string_test.cc
 )
 
 
@@ -6661,7 +6503,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_sync_test
-  test/core/support/sync_test.c
+  test/core/support/sync_test.cc
 )
 
 
@@ -6689,7 +6531,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_thd_test
-  test/core/support/thd_test.c
+  test/core/support/thd_test.cc
 )
 
 
@@ -6717,7 +6559,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_time_test
-  test/core/support/time_test.c
+  test/core/support/time_test.cc
 )
 
 
@@ -6745,7 +6587,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_tls_test
-  test/core/support/tls_test.c
+  test/core/support/tls_test.cc
 )
 
 
@@ -6773,7 +6615,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(gpr_useful_test
-  test/core/support/useful_test.c
+  test/core/support/useful_test.cc
 )
 
 
@@ -6801,7 +6643,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_auth_context_test
-  test/core/security/auth_context_test.c
+  test/core/security/auth_context_test.cc
 )
 
 
@@ -6831,7 +6673,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_b64_test
-  test/core/slice/b64_test.c
+  test/core/slice/b64_test.cc
 )
 
 
@@ -6861,7 +6703,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_byte_buffer_reader_test
-  test/core/surface/byte_buffer_reader_test.c
+  test/core/surface/byte_buffer_reader_test.cc
 )
 
 
@@ -6891,7 +6733,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_channel_args_test
-  test/core/channel/channel_args_test.c
+  test/core/channel/channel_args_test.cc
 )
 
 
@@ -6921,7 +6763,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_channel_stack_builder_test
-  test/core/channel/channel_stack_builder_test.c
+  test/core/channel/channel_stack_builder_test.cc
 )
 
 
@@ -6951,7 +6793,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_channel_stack_test
-  test/core/channel/channel_stack_test.c
+  test/core/channel/channel_stack_test.cc
 )
 
 
@@ -6981,7 +6823,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_completion_queue_test
-  test/core/surface/completion_queue_test.c
+  test/core/surface/completion_queue_test.cc
 )
 
 
@@ -7011,7 +6853,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_completion_queue_threading_test
-  test/core/surface/completion_queue_threading_test.c
+  test/core/surface/completion_queue_threading_test.cc
 )
 
 
@@ -7040,7 +6882,7 @@
 endif (gRPC_BUILD_TESTS)
 
 add_executable(grpc_create_jwt
-  test/core/security/create_jwt.c
+  test/core/security/create_jwt.cc
 )
 
 
@@ -7077,7 +6919,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_credentials_test
-  test/core/security/credentials_test.c
+  test/core/security/credentials_test.cc
 )
 
 
@@ -7107,7 +6949,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_fetch_oauth2
-  test/core/security/fetch_oauth2.c
+  test/core/security/fetch_oauth2.cc
 )
 
 
@@ -7137,7 +6979,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_invalid_channel_args_test
-  test/core/surface/invalid_channel_args_test.c
+  test/core/surface/invalid_channel_args_test.cc
 )
 
 
@@ -7168,7 +7010,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(grpc_json_token_test
-  test/core/security/json_token_test.c
+  test/core/security/json_token_test.cc
 )
 
 
@@ -7199,7 +7041,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_jwt_verifier_test
-  test/core/security/jwt_verifier_test.c
+  test/core/security/jwt_verifier_test.cc
 )
 
 
@@ -7228,7 +7070,7 @@
 endif (gRPC_BUILD_TESTS)
 
 add_executable(grpc_print_google_default_creds_token
-  test/core/security/print_google_default_creds_token.c
+  test/core/security/print_google_default_creds_token.cc
 )
 
 
@@ -7264,7 +7106,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(grpc_security_connector_test
-  test/core/security/security_connector_test.c
+  test/core/security/security_connector_test.cc
 )
 
 
@@ -7291,9 +7133,39 @@
 )
 
 endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
+
+add_executable(grpc_ssl_credentials_test
+  test/core/security/ssl_credentials_test.cc
+)
+
+
+target_include_directories(grpc_ssl_credentials_test
+  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
+  PRIVATE ${BORINGSSL_ROOT_DIR}/include
+  PRIVATE ${PROTOBUF_ROOT_DIR}/src
+  PRIVATE ${BENCHMARK_ROOT_DIR}/include
+  PRIVATE ${ZLIB_ROOT_DIR}
+  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
+  PRIVATE ${CARES_INCLUDE_DIR}
+  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
+  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
+  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp
+)
+
+target_link_libraries(grpc_ssl_credentials_test
+  ${_gRPC_ALLTARGETS_LIBRARIES}
+  grpc_test_util
+  grpc
+  gpr_test_util
+  gpr
+)
+
+endif (gRPC_BUILD_TESTS)
 
 add_executable(grpc_verify_jwt
-  test/core/security/verify_jwt.c
+  test/core/security/verify_jwt.cc
 )
 
 
@@ -7330,7 +7202,7 @@
 if(_gRPC_PLATFORM_LINUX)
 
 add_executable(handshake_client
-  test/core/handshake/client_ssl.c
+  test/core/handshake/client_ssl.cc
 )
 
 
@@ -7363,7 +7235,7 @@
 if(_gRPC_PLATFORM_LINUX)
 
 add_executable(handshake_server
-  test/core/handshake/server_ssl.c
+  test/core/handshake/server_ssl.cc
 )
 
 
@@ -7395,7 +7267,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(hpack_parser_test
-  test/core/transport/chttp2/hpack_parser_test.c
+  test/core/transport/chttp2/hpack_parser_test.cc
 )
 
 
@@ -7425,7 +7297,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(hpack_table_test
-  test/core/transport/chttp2/hpack_table_test.c
+  test/core/transport/chttp2/hpack_table_test.cc
 )
 
 
@@ -7455,7 +7327,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(http_parser_test
-  test/core/http/parser_test.c
+  test/core/http/parser_test.cc
 )
 
 
@@ -7485,7 +7357,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(httpcli_format_request_test
-  test/core/http/format_request_test.c
+  test/core/http/format_request_test.cc
 )
 
 
@@ -7516,7 +7388,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(httpcli_test
-  test/core/http/httpcli_test.c
+  test/core/http/httpcli_test.cc
 )
 
 
@@ -7548,7 +7420,7 @@
 if(_gRPC_PLATFORM_LINUX)
 
 add_executable(httpscli_test
-  test/core/http/httpscli_test.c
+  test/core/http/httpscli_test.cc
 )
 
 
@@ -7579,7 +7451,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(init_test
-  test/core/surface/init_test.c
+  test/core/surface/init_test.cc
 )
 
 
@@ -7609,7 +7481,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(invalid_call_argument_test
-  test/core/end2end/invalid_call_argument_test.c
+  test/core/end2end/invalid_call_argument_test.cc
 )
 
 
@@ -7639,7 +7511,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(json_rewrite
-  test/core/json/json_rewrite.c
+  test/core/json/json_rewrite.cc
 )
 
 
@@ -7667,7 +7539,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(json_rewrite_test
-  test/core/json/json_rewrite_test.c
+  test/core/json/json_rewrite_test.cc
 )
 
 
@@ -7697,7 +7569,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(json_stream_error_test
-  test/core/json/json_stream_error_test.c
+  test/core/json/json_stream_error_test.cc
 )
 
 
@@ -7727,7 +7599,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(json_test
-  test/core/json/json_test.c
+  test/core/json/json_test.cc
 )
 
 
@@ -7757,7 +7629,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(lame_client_test
-  test/core/surface/lame_client_test.c
+  test/core/surface/lame_client_test.cc
 )
 
 
@@ -7787,7 +7659,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(lb_policies_test
-  test/core/client_channel/lb_policies_test.c
+  test/core/client_channel/lb_policies_test.cc
 )
 
 
@@ -7817,7 +7689,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(load_file_test
-  test/core/iomgr/load_file_test.c
+  test/core/iomgr/load_file_test.cc
 )
 
 
@@ -7847,7 +7719,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(memory_profile_client
-  test/core/memory_usage/client.c
+  test/core/memory_usage/client.cc
 )
 
 
@@ -7877,7 +7749,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(memory_profile_server
-  test/core/memory_usage/server.c
+  test/core/memory_usage/server.cc
 )
 
 
@@ -7908,7 +7780,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(memory_profile_test
-  test/core/memory_usage/memory_usage_test.c
+  test/core/memory_usage/memory_usage_test.cc
 )
 
 
@@ -7939,7 +7811,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(message_compress_test
-  test/core/compression/message_compress_test.c
+  test/core/compression/message_compress_test.cc
 )
 
 
@@ -7969,7 +7841,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(minimal_stack_is_minimal_test
-  test/core/channel/minimal_stack_is_minimal_test.c
+  test/core/channel/minimal_stack_is_minimal_test.cc
 )
 
 
@@ -7998,38 +7870,8 @@
 endif (gRPC_BUILD_TESTS)
 if (gRPC_BUILD_TESTS)
 
-add_executable(mlog_test
-  test/core/census/mlog_test.c
-)
-
-
-target_include_directories(mlog_test
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
-  PRIVATE ${BORINGSSL_ROOT_DIR}/include
-  PRIVATE ${PROTOBUF_ROOT_DIR}/src
-  PRIVATE ${BENCHMARK_ROOT_DIR}/include
-  PRIVATE ${ZLIB_ROOT_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
-  PRIVATE ${CARES_INCLUDE_DIR}
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
-  PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
-  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp
-)
-
-target_link_libraries(mlog_test
-  ${_gRPC_ALLTARGETS_LIBRARIES}
-  grpc_test_util
-  grpc
-  gpr_test_util
-  gpr
-)
-
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
 add_executable(multiple_server_queues_test
-  test/core/end2end/multiple_server_queues_test.c
+  test/core/end2end/multiple_server_queues_test.cc
 )
 
 
@@ -8059,7 +7901,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(murmur_hash_test
-  test/core/support/murmur_hash_test.c
+  test/core/support/murmur_hash_test.cc
 )
 
 
@@ -8087,7 +7929,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(no_server_test
-  test/core/end2end/no_server_test.c
+  test/core/end2end/no_server_test.cc
 )
 
 
@@ -8117,7 +7959,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(num_external_connectivity_watchers_test
-  test/core/surface/num_external_connectivity_watchers_test.c
+  test/core/surface/num_external_connectivity_watchers_test.cc
 )
 
 
@@ -8147,7 +7989,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(parse_address_test
-  test/core/client_channel/parse_address_test.c
+  test/core/client_channel/parse_address_test.cc
 )
 
 
@@ -8177,7 +8019,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(percent_encoding_test
-  test/core/slice/percent_encoding_test.c
+  test/core/slice/percent_encoding_test.cc
 )
 
 
@@ -8208,7 +8050,7 @@
 if(_gRPC_PLATFORM_LINUX)
 
 add_executable(pollset_set_test
-  test/core/iomgr/pollset_set_test.c
+  test/core/iomgr/pollset_set_test.cc
 )
 
 
@@ -8240,7 +8082,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(resolve_address_posix_test
-  test/core/iomgr/resolve_address_posix_test.c
+  test/core/iomgr/resolve_address_posix_test.cc
 )
 
 
@@ -8271,7 +8113,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(resolve_address_test
-  test/core/iomgr/resolve_address_test.c
+  test/core/iomgr/resolve_address_test.cc
 )
 
 
@@ -8301,7 +8143,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(resource_quota_test
-  test/core/iomgr/resource_quota_test.c
+  test/core/iomgr/resource_quota_test.cc
 )
 
 
@@ -8331,7 +8173,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(secure_channel_create_test
-  test/core/surface/secure_channel_create_test.c
+  test/core/surface/secure_channel_create_test.cc
 )
 
 
@@ -8361,7 +8203,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(secure_endpoint_test
-  test/core/security/secure_endpoint_test.c
+  test/core/security/secure_endpoint_test.cc
 )
 
 
@@ -8391,7 +8233,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(sequential_connectivity_test
-  test/core/surface/sequential_connectivity_test.c
+  test/core/surface/sequential_connectivity_test.cc
 )
 
 
@@ -8421,7 +8263,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(server_chttp2_test
-  test/core/surface/server_chttp2_test.c
+  test/core/surface/server_chttp2_test.cc
 )
 
 
@@ -8451,7 +8293,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(server_test
-  test/core/surface/server_test.c
+  test/core/surface/server_test.cc
 )
 
 
@@ -8481,7 +8323,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(slice_buffer_test
-  test/core/slice/slice_buffer_test.c
+  test/core/slice/slice_buffer_test.cc
 )
 
 
@@ -8511,7 +8353,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(slice_hash_table_test
-  test/core/slice/slice_hash_table_test.c
+  test/core/slice/slice_hash_table_test.cc
 )
 
 
@@ -8541,7 +8383,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(slice_string_helpers_test
-  test/core/slice/slice_string_helpers_test.c
+  test/core/slice/slice_string_helpers_test.cc
 )
 
 
@@ -8571,7 +8413,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(slice_test
-  test/core/slice/slice_test.c
+  test/core/slice/slice_test.cc
 )
 
 
@@ -8601,7 +8443,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(sockaddr_resolver_test
-  test/core/client_channel/resolvers/sockaddr_resolver_test.c
+  test/core/client_channel/resolvers/sockaddr_resolver_test.cc
 )
 
 
@@ -8631,7 +8473,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(sockaddr_utils_test
-  test/core/iomgr/sockaddr_utils_test.c
+  test/core/iomgr/sockaddr_utils_test.cc
 )
 
 
@@ -8662,7 +8504,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(socket_utils_test
-  test/core/iomgr/socket_utils_test.c
+  test/core/iomgr/socket_utils_test.cc
 )
 
 
@@ -8694,8 +8536,8 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(ssl_transport_security_test
-  test/core/tsi/ssl_transport_security_test.c
-  test/core/tsi/transport_security_test_lib.c
+  test/core/tsi/ssl_transport_security_test.cc
+  test/core/tsi/transport_security_test_lib.cc
 )
 
 
@@ -8725,7 +8567,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(status_conversion_test
-  test/core/transport/status_conversion_test.c
+  test/core/transport/status_conversion_test.cc
 )
 
 
@@ -8755,7 +8597,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(stream_compression_test
-  test/core/compression/stream_compression_test.c
+  test/core/compression/stream_compression_test.cc
 )
 
 
@@ -8785,7 +8627,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(stream_owned_slice_test
-  test/core/transport/stream_owned_slice_test.c
+  test/core/transport/stream_owned_slice_test.cc
 )
 
 
@@ -8816,7 +8658,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(tcp_client_posix_test
-  test/core/iomgr/tcp_client_posix_test.c
+  test/core/iomgr/tcp_client_posix_test.cc
 )
 
 
@@ -8847,7 +8689,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(tcp_client_uv_test
-  test/core/iomgr/tcp_client_uv_test.c
+  test/core/iomgr/tcp_client_uv_test.cc
 )
 
 
@@ -8878,7 +8720,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(tcp_posix_test
-  test/core/iomgr/tcp_posix_test.c
+  test/core/iomgr/tcp_posix_test.cc
 )
 
 
@@ -8910,7 +8752,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(tcp_server_posix_test
-  test/core/iomgr/tcp_server_posix_test.c
+  test/core/iomgr/tcp_server_posix_test.cc
 )
 
 
@@ -8941,7 +8783,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(tcp_server_uv_test
-  test/core/iomgr/tcp_server_uv_test.c
+  test/core/iomgr/tcp_server_uv_test.cc
 )
 
 
@@ -8971,7 +8813,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(time_averaged_stats_test
-  test/core/iomgr/time_averaged_stats_test.c
+  test/core/iomgr/time_averaged_stats_test.cc
 )
 
 
@@ -9001,7 +8843,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(timeout_encoding_test
-  test/core/transport/timeout_encoding_test.c
+  test/core/transport/timeout_encoding_test.cc
 )
 
 
@@ -9031,7 +8873,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(timer_heap_test
-  test/core/iomgr/timer_heap_test.c
+  test/core/iomgr/timer_heap_test.cc
 )
 
 
@@ -9061,7 +8903,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(timer_list_test
-  test/core/iomgr/timer_list_test.c
+  test/core/iomgr/timer_list_test.cc
 )
 
 
@@ -9091,7 +8933,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(transport_connectivity_state_test
-  test/core/transport/connectivity_state_test.c
+  test/core/transport/connectivity_state_test.cc
 )
 
 
@@ -9121,7 +8963,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(transport_metadata_test
-  test/core/transport/metadata_test.c
+  test/core/transport/metadata_test.cc
 )
 
 
@@ -9152,7 +8994,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(transport_security_test
-  test/core/tsi/transport_security_test.c
+  test/core/tsi/transport_security_test.cc
 )
 
 
@@ -9184,7 +9026,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(udp_server_test
-  test/core/iomgr/udp_server_test.c
+  test/core/iomgr/udp_server_test.cc
 )
 
 
@@ -9215,7 +9057,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(uri_parser_test
-  test/core/client_channel/uri_parser_test.c
+  test/core/client_channel/uri_parser_test.cc
 )
 
 
@@ -9246,7 +9088,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(wakeup_fd_cv_test
-  test/core/iomgr/wakeup_fd_cv_test.c
+  test/core/iomgr/wakeup_fd_cv_test.cc
 )
 
 
@@ -13138,7 +12980,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(badreq_bad_client_test
-  test/core/bad_client/tests/badreq.c
+  test/core/bad_client/tests/badreq.cc
 )
 
 
@@ -13170,7 +13012,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(connection_prefix_bad_client_test
-  test/core/bad_client/tests/connection_prefix.c
+  test/core/bad_client/tests/connection_prefix.cc
 )
 
 
@@ -13202,7 +13044,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(head_of_line_blocking_bad_client_test
-  test/core/bad_client/tests/head_of_line_blocking.c
+  test/core/bad_client/tests/head_of_line_blocking.cc
 )
 
 
@@ -13234,7 +13076,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(headers_bad_client_test
-  test/core/bad_client/tests/headers.c
+  test/core/bad_client/tests/headers.cc
 )
 
 
@@ -13266,7 +13108,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(initial_settings_frame_bad_client_test
-  test/core/bad_client/tests/initial_settings_frame.c
+  test/core/bad_client/tests/initial_settings_frame.cc
 )
 
 
@@ -13298,7 +13140,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(server_registered_method_bad_client_test
-  test/core/bad_client/tests/server_registered_method.c
+  test/core/bad_client/tests/server_registered_method.cc
 )
 
 
@@ -13330,7 +13172,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(simple_request_bad_client_test
-  test/core/bad_client/tests/simple_request.c
+  test/core/bad_client/tests/simple_request.cc
 )
 
 
@@ -13362,7 +13204,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(unknown_frame_bad_client_test
-  test/core/bad_client/tests/unknown_frame.c
+  test/core/bad_client/tests/unknown_frame.cc
 )
 
 
@@ -13394,7 +13236,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(window_overflow_bad_client_test
-  test/core/bad_client/tests/window_overflow.c
+  test/core/bad_client/tests/window_overflow.cc
 )
 
 
@@ -13427,7 +13269,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(bad_ssl_cert_server
-  test/core/bad_ssl/servers/cert.c
+  test/core/bad_ssl/servers/cert.cc
 )
 
 
@@ -13460,7 +13302,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(bad_ssl_cert_test
-  test/core/bad_ssl/bad_ssl_test.c
+  test/core/bad_ssl/bad_ssl_test.cc
 )
 
 
@@ -13491,7 +13333,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_census_test
-  test/core/end2end/fixtures/h2_census.c
+  test/core/end2end/fixtures/h2_census.cc
 )
 
 
@@ -13522,7 +13364,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_compress_test
-  test/core/end2end/fixtures/h2_compress.c
+  test/core/end2end/fixtures/h2_compress.cc
 )
 
 
@@ -13553,7 +13395,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_fakesec_test
-  test/core/end2end/fixtures/h2_fakesec.c
+  test/core/end2end/fixtures/h2_fakesec.cc
 )
 
 
@@ -13585,7 +13427,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(h2_fd_test
-  test/core/end2end/fixtures/h2_fd.c
+  test/core/end2end/fixtures/h2_fd.cc
 )
 
 
@@ -13617,7 +13459,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_full_test
-  test/core/end2end/fixtures/h2_full.c
+  test/core/end2end/fixtures/h2_full.cc
 )
 
 
@@ -13649,7 +13491,7 @@
 if(_gRPC_PLATFORM_LINUX)
 
 add_executable(h2_full+pipe_test
-  test/core/end2end/fixtures/h2_full+pipe.c
+  test/core/end2end/fixtures/h2_full+pipe.cc
 )
 
 
@@ -13681,7 +13523,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_full+trace_test
-  test/core/end2end/fixtures/h2_full+trace.c
+  test/core/end2end/fixtures/h2_full+trace.cc
 )
 
 
@@ -13712,7 +13554,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_full+workarounds_test
-  test/core/end2end/fixtures/h2_full+workarounds.c
+  test/core/end2end/fixtures/h2_full+workarounds.cc
 )
 
 
@@ -13743,7 +13585,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_http_proxy_test
-  test/core/end2end/fixtures/h2_http_proxy.c
+  test/core/end2end/fixtures/h2_http_proxy.cc
 )
 
 
@@ -13774,7 +13616,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_load_reporting_test
-  test/core/end2end/fixtures/h2_load_reporting.c
+  test/core/end2end/fixtures/h2_load_reporting.cc
 )
 
 
@@ -13805,7 +13647,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_oauth2_test
-  test/core/end2end/fixtures/h2_oauth2.c
+  test/core/end2end/fixtures/h2_oauth2.cc
 )
 
 
@@ -13836,7 +13678,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_proxy_test
-  test/core/end2end/fixtures/h2_proxy.c
+  test/core/end2end/fixtures/h2_proxy.cc
 )
 
 
@@ -13867,7 +13709,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_sockpair_test
-  test/core/end2end/fixtures/h2_sockpair.c
+  test/core/end2end/fixtures/h2_sockpair.cc
 )
 
 
@@ -13898,7 +13740,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_sockpair+trace_test
-  test/core/end2end/fixtures/h2_sockpair+trace.c
+  test/core/end2end/fixtures/h2_sockpair+trace.cc
 )
 
 
@@ -13929,7 +13771,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_sockpair_1byte_test
-  test/core/end2end/fixtures/h2_sockpair_1byte.c
+  test/core/end2end/fixtures/h2_sockpair_1byte.cc
 )
 
 
@@ -13960,7 +13802,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_ssl_test
-  test/core/end2end/fixtures/h2_ssl.c
+  test/core/end2end/fixtures/h2_ssl.cc
 )
 
 
@@ -13991,7 +13833,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_ssl_proxy_test
-  test/core/end2end/fixtures/h2_ssl_proxy.c
+  test/core/end2end/fixtures/h2_ssl_proxy.cc
 )
 
 
@@ -14023,7 +13865,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(h2_uds_test
-  test/core/end2end/fixtures/h2_uds.c
+  test/core/end2end/fixtures/h2_uds.cc
 )
 
 
@@ -14055,7 +13897,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(inproc_test
-  test/core/end2end/fixtures/inproc.c
+  test/core/end2end/fixtures/inproc.cc
 )
 
 
@@ -14086,7 +13928,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_census_nosec_test
-  test/core/end2end/fixtures/h2_census.c
+  test/core/end2end/fixtures/h2_census.cc
 )
 
 
@@ -14117,7 +13959,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_compress_nosec_test
-  test/core/end2end/fixtures/h2_compress.c
+  test/core/end2end/fixtures/h2_compress.cc
 )
 
 
@@ -14149,7 +13991,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(h2_fd_nosec_test
-  test/core/end2end/fixtures/h2_fd.c
+  test/core/end2end/fixtures/h2_fd.cc
 )
 
 
@@ -14181,7 +14023,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_full_nosec_test
-  test/core/end2end/fixtures/h2_full.c
+  test/core/end2end/fixtures/h2_full.cc
 )
 
 
@@ -14213,7 +14055,7 @@
 if(_gRPC_PLATFORM_LINUX)
 
 add_executable(h2_full+pipe_nosec_test
-  test/core/end2end/fixtures/h2_full+pipe.c
+  test/core/end2end/fixtures/h2_full+pipe.cc
 )
 
 
@@ -14245,7 +14087,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_full+trace_nosec_test
-  test/core/end2end/fixtures/h2_full+trace.c
+  test/core/end2end/fixtures/h2_full+trace.cc
 )
 
 
@@ -14276,7 +14118,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_full+workarounds_nosec_test
-  test/core/end2end/fixtures/h2_full+workarounds.c
+  test/core/end2end/fixtures/h2_full+workarounds.cc
 )
 
 
@@ -14307,7 +14149,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_http_proxy_nosec_test
-  test/core/end2end/fixtures/h2_http_proxy.c
+  test/core/end2end/fixtures/h2_http_proxy.cc
 )
 
 
@@ -14338,7 +14180,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_load_reporting_nosec_test
-  test/core/end2end/fixtures/h2_load_reporting.c
+  test/core/end2end/fixtures/h2_load_reporting.cc
 )
 
 
@@ -14369,7 +14211,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_proxy_nosec_test
-  test/core/end2end/fixtures/h2_proxy.c
+  test/core/end2end/fixtures/h2_proxy.cc
 )
 
 
@@ -14400,7 +14242,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_sockpair_nosec_test
-  test/core/end2end/fixtures/h2_sockpair.c
+  test/core/end2end/fixtures/h2_sockpair.cc
 )
 
 
@@ -14431,7 +14273,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_sockpair+trace_nosec_test
-  test/core/end2end/fixtures/h2_sockpair+trace.c
+  test/core/end2end/fixtures/h2_sockpair+trace.cc
 )
 
 
@@ -14462,7 +14304,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(h2_sockpair_1byte_nosec_test
-  test/core/end2end/fixtures/h2_sockpair_1byte.c
+  test/core/end2end/fixtures/h2_sockpair_1byte.cc
 )
 
 
@@ -14494,7 +14336,7 @@
 if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
 
 add_executable(h2_uds_nosec_test
-  test/core/end2end/fixtures/h2_uds.c
+  test/core/end2end/fixtures/h2_uds.cc
 )
 
 
@@ -14526,7 +14368,7 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(inproc_nosec_test
-  test/core/end2end/fixtures/inproc.c
+  test/core/end2end/fixtures/inproc.cc
 )
 
 
@@ -14733,8 +14575,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(api_fuzzer_one_entry
-  test/core/end2end/fuzzers/api_fuzzer.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/end2end/fuzzers/api_fuzzer.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -14764,8 +14606,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(client_fuzzer_one_entry
-  test/core/end2end/fuzzers/client_fuzzer.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/end2end/fuzzers/client_fuzzer.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -14795,8 +14637,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(hpack_parser_fuzzer_test_one_entry
-  test/core/transport/chttp2/hpack_parser_fuzzer_test.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -14826,8 +14668,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(http_request_fuzzer_test_one_entry
-  test/core/http/request_fuzzer.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/http/request_fuzzer.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -14857,8 +14699,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(http_response_fuzzer_test_one_entry
-  test/core/http/response_fuzzer.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/http/response_fuzzer.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -14888,8 +14730,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(json_fuzzer_test_one_entry
-  test/core/json/fuzzer.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/json/fuzzer.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -14919,8 +14761,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(nanopb_fuzzer_response_test_one_entry
-  test/core/nanopb/fuzzer_response.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/nanopb/fuzzer_response.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -14950,8 +14792,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(nanopb_fuzzer_serverlist_test_one_entry
-  test/core/nanopb/fuzzer_serverlist.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/nanopb/fuzzer_serverlist.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -14981,8 +14823,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(percent_decode_fuzzer_one_entry
-  test/core/slice/percent_decode_fuzzer.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/slice/percent_decode_fuzzer.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -15012,8 +14854,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(percent_encode_fuzzer_one_entry
-  test/core/slice/percent_encode_fuzzer.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/slice/percent_encode_fuzzer.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -15043,8 +14885,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(server_fuzzer_one_entry
-  test/core/end2end/fuzzers/server_fuzzer.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/end2end/fuzzers/server_fuzzer.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -15074,8 +14916,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(ssl_server_fuzzer_one_entry
-  test/core/security/ssl_server_fuzzer.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/security/ssl_server_fuzzer.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
@@ -15105,8 +14947,8 @@
 if (gRPC_BUILD_TESTS)
 
 add_executable(uri_fuzzer_test_one_entry
-  test/core/client_channel/uri_fuzzer_test.c
-  test/core/util/one_corpus_entry_fuzzer.c
+  test/core/client_channel/uri_fuzzer_test.cc
+  test/core/util/one_corpus_entry_fuzzer.cc
 )
 
 
diff --git a/Makefile b/Makefile
index bb02c9b..1e3418e 100644
--- a/Makefile
+++ b/Makefile
@@ -955,10 +955,6 @@
 bin_decoder_test: $(BINDIR)/$(CONFIG)/bin_decoder_test
 bin_encoder_test: $(BINDIR)/$(CONFIG)/bin_encoder_test
 byte_stream_test: $(BINDIR)/$(CONFIG)/byte_stream_test
-census_context_test: $(BINDIR)/$(CONFIG)/census_context_test
-census_intrusive_hash_map_test: $(BINDIR)/$(CONFIG)/census_intrusive_hash_map_test
-census_resource_test: $(BINDIR)/$(CONFIG)/census_resource_test
-census_trace_context_test: $(BINDIR)/$(CONFIG)/census_trace_context_test
 channel_create_test: $(BINDIR)/$(CONFIG)/channel_create_test
 check_epollexclusive: $(BINDIR)/$(CONFIG)/check_epollexclusive
 chttp2_hpack_encoder_test: $(BINDIR)/$(CONFIG)/chttp2_hpack_encoder_test
@@ -1019,6 +1015,7 @@
 grpc_jwt_verifier_test: $(BINDIR)/$(CONFIG)/grpc_jwt_verifier_test
 grpc_print_google_default_creds_token: $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token
 grpc_security_connector_test: $(BINDIR)/$(CONFIG)/grpc_security_connector_test
+grpc_ssl_credentials_test: $(BINDIR)/$(CONFIG)/grpc_ssl_credentials_test
 grpc_verify_jwt: $(BINDIR)/$(CONFIG)/grpc_verify_jwt
 handshake_client: $(BINDIR)/$(CONFIG)/handshake_client
 handshake_server: $(BINDIR)/$(CONFIG)/handshake_server
@@ -1047,7 +1044,6 @@
 memory_profile_test: $(BINDIR)/$(CONFIG)/memory_profile_test
 message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test
 minimal_stack_is_minimal_test: $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test
-mlog_test: $(BINDIR)/$(CONFIG)/mlog_test
 multiple_server_queues_test: $(BINDIR)/$(CONFIG)/multiple_server_queues_test
 murmur_hash_test: $(BINDIR)/$(CONFIG)/murmur_hash_test
 nanopb_fuzzer_response_test: $(BINDIR)/$(CONFIG)/nanopb_fuzzer_response_test
@@ -1356,10 +1352,6 @@
   $(BINDIR)/$(CONFIG)/bin_decoder_test \
   $(BINDIR)/$(CONFIG)/bin_encoder_test \
   $(BINDIR)/$(CONFIG)/byte_stream_test \
-  $(BINDIR)/$(CONFIG)/census_context_test \
-  $(BINDIR)/$(CONFIG)/census_intrusive_hash_map_test \
-  $(BINDIR)/$(CONFIG)/census_resource_test \
-  $(BINDIR)/$(CONFIG)/census_trace_context_test \
   $(BINDIR)/$(CONFIG)/channel_create_test \
   $(BINDIR)/$(CONFIG)/chttp2_hpack_encoder_test \
   $(BINDIR)/$(CONFIG)/chttp2_stream_map_test \
@@ -1413,6 +1405,7 @@
   $(BINDIR)/$(CONFIG)/grpc_json_token_test \
   $(BINDIR)/$(CONFIG)/grpc_jwt_verifier_test \
   $(BINDIR)/$(CONFIG)/grpc_security_connector_test \
+  $(BINDIR)/$(CONFIG)/grpc_ssl_credentials_test \
   $(BINDIR)/$(CONFIG)/handshake_client \
   $(BINDIR)/$(CONFIG)/handshake_server \
   $(BINDIR)/$(CONFIG)/hpack_parser_test \
@@ -1435,7 +1428,6 @@
   $(BINDIR)/$(CONFIG)/memory_profile_test \
   $(BINDIR)/$(CONFIG)/message_compress_test \
   $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test \
-  $(BINDIR)/$(CONFIG)/mlog_test \
   $(BINDIR)/$(CONFIG)/multiple_server_queues_test \
   $(BINDIR)/$(CONFIG)/murmur_hash_test \
   $(BINDIR)/$(CONFIG)/no_server_test \
@@ -1778,14 +1770,6 @@
 	$(Q) $(BINDIR)/$(CONFIG)/bin_encoder_test || ( echo test bin_encoder_test failed ; exit 1 )
 	$(E) "[RUN]     Testing byte_stream_test"
 	$(Q) $(BINDIR)/$(CONFIG)/byte_stream_test || ( echo test byte_stream_test failed ; exit 1 )
-	$(E) "[RUN]     Testing census_context_test"
-	$(Q) $(BINDIR)/$(CONFIG)/census_context_test || ( echo test census_context_test failed ; exit 1 )
-	$(E) "[RUN]     Testing census_intrusive_hash_map_test"
-	$(Q) $(BINDIR)/$(CONFIG)/census_intrusive_hash_map_test || ( echo test census_intrusive_hash_map_test failed ; exit 1 )
-	$(E) "[RUN]     Testing census_resource_test"
-	$(Q) $(BINDIR)/$(CONFIG)/census_resource_test || ( echo test census_resource_test failed ; exit 1 )
-	$(E) "[RUN]     Testing census_trace_context_test"
-	$(Q) $(BINDIR)/$(CONFIG)/census_trace_context_test || ( echo test census_trace_context_test failed ; exit 1 )
 	$(E) "[RUN]     Testing channel_create_test"
 	$(Q) $(BINDIR)/$(CONFIG)/channel_create_test || ( echo test channel_create_test failed ; exit 1 )
 	$(E) "[RUN]     Testing chttp2_hpack_encoder_test"
@@ -1886,6 +1870,8 @@
 	$(Q) $(BINDIR)/$(CONFIG)/grpc_jwt_verifier_test || ( echo test grpc_jwt_verifier_test failed ; exit 1 )
 	$(E) "[RUN]     Testing grpc_security_connector_test"
 	$(Q) $(BINDIR)/$(CONFIG)/grpc_security_connector_test || ( echo test grpc_security_connector_test failed ; exit 1 )
+	$(E) "[RUN]     Testing grpc_ssl_credentials_test"
+	$(Q) $(BINDIR)/$(CONFIG)/grpc_ssl_credentials_test || ( echo test grpc_ssl_credentials_test failed ; exit 1 )
 	$(E) "[RUN]     Testing handshake_client"
 	$(Q) $(BINDIR)/$(CONFIG)/handshake_client || ( echo test handshake_client failed ; exit 1 )
 	$(E) "[RUN]     Testing handshake_server"
@@ -2029,8 +2015,6 @@
 
 
 flaky_test_c: buildtests_c
-	$(E) "[RUN]     Testing mlog_test"
-	$(Q) $(BINDIR)/$(CONFIG)/mlog_test || ( echo test mlog_test failed ; exit 1 )
 
 
 test_cxx: buildtests_cxx
@@ -2930,7 +2914,7 @@
 
 
 LIBGPR_TEST_UTIL_SRC = \
-    test/core/util/test_config.c \
+    test/core/util/test_config.cc \
 
 PUBLIC_HEADERS_C += \
 
@@ -3149,6 +3133,7 @@
     src/core/tsi/transport_security_adapter.cc \
     src/core/ext/transport/chttp2/server/chttp2_server.cc \
     src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc \
+    src/core/ext/filters/client_channel/backup_poller.cc \
     src/core/ext/filters/client_channel/channel_connectivity.cc \
     src/core/ext/filters/client_channel/client_channel.cc \
     src/core/ext/filters/client_channel/client_channel_factory.cc \
@@ -3188,6 +3173,7 @@
     third_party/nanopb/pb_encode.c \
     src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
     src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
+    src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc \
     src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
     src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
     src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \
@@ -3197,21 +3183,7 @@
     src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
     src/core/ext/filters/load_reporting/server_load_reporting_filter.cc \
     src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc \
-    src/core/ext/census/base_resources.cc \
-    src/core/ext/census/context.cc \
-    src/core/ext/census/gen/census.pb.c \
-    src/core/ext/census/gen/trace_context.pb.c \
     src/core/ext/census/grpc_context.cc \
-    src/core/ext/census/grpc_filter.cc \
-    src/core/ext/census/grpc_plugin.cc \
-    src/core/ext/census/initialize.cc \
-    src/core/ext/census/intrusive_hash_map.cc \
-    src/core/ext/census/mlog.cc \
-    src/core/ext/census/operation.cc \
-    src/core/ext/census/placeholders.cc \
-    src/core/ext/census/resource.cc \
-    src/core/ext/census/trace_context.cc \
-    src/core/ext/census/tracing.cc \
     src/core/ext/filters/max_age/max_age_filter.cc \
     src/core/ext/filters/message_size/message_size_filter.cc \
     src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
@@ -3472,6 +3444,7 @@
     src/core/ext/filters/http/http_filters_plugin.cc \
     src/core/ext/filters/http/message_compress/message_compress_filter.cc \
     src/core/ext/filters/http/server/http_server_filter.cc \
+    src/core/ext/filters/client_channel/backup_poller.cc \
     src/core/ext/filters/client_channel/channel_connectivity.cc \
     src/core/ext/filters/client_channel/client_channel.cc \
     src/core/ext/filters/client_channel/client_channel_factory.cc \
@@ -3607,26 +3580,26 @@
 
 
 LIBGRPC_TEST_UTIL_SRC = \
-    test/core/end2end/data/client_certs.c \
-    test/core/end2end/data/server1_cert.c \
-    test/core/end2end/data/server1_key.c \
-    test/core/end2end/data/test_root_cert.c \
-    test/core/security/oauth2_utils.c \
+    test/core/end2end/data/client_certs.cc \
+    test/core/end2end/data/server1_cert.cc \
+    test/core/end2end/data/server1_key.cc \
+    test/core/end2end/data/test_root_cert.cc \
+    test/core/security/oauth2_utils.cc \
     src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
-    test/core/end2end/cq_verifier.c \
-    test/core/end2end/fixtures/http_proxy_fixture.c \
-    test/core/end2end/fixtures/proxy.c \
-    test/core/iomgr/endpoint_tests.c \
+    test/core/end2end/cq_verifier.cc \
+    test/core/end2end/fixtures/http_proxy_fixture.cc \
+    test/core/end2end/fixtures/proxy.cc \
+    test/core/iomgr/endpoint_tests.cc \
     test/core/util/debugger_macros.cc \
-    test/core/util/grpc_profiler.c \
-    test/core/util/memory_counters.c \
-    test/core/util/mock_endpoint.c \
-    test/core/util/parse_hexstring.c \
-    test/core/util/passthru_endpoint.c \
-    test/core/util/port.c \
-    test/core/util/port_server_client.c \
-    test/core/util/slice_splitter.c \
-    test/core/util/trickle_endpoint.c \
+    test/core/util/grpc_profiler.cc \
+    test/core/util/memory_counters.cc \
+    test/core/util/mock_endpoint.cc \
+    test/core/util/parse_hexstring.cc \
+    test/core/util/passthru_endpoint.cc \
+    test/core/util/port.cc \
+    test/core/util/port_server_client.cc \
+    test/core/util/slice_splitter.cc \
+    test/core/util/trickle_endpoint.cc \
     src/core/lib/backoff/backoff.cc \
     src/core/lib/channel/channel_args.cc \
     src/core/lib/channel/channel_stack.cc \
@@ -3760,6 +3733,7 @@
     src/core/lib/transport/transport.cc \
     src/core/lib/transport/transport_op_string.cc \
     src/core/lib/debug/trace.cc \
+    src/core/ext/filters/client_channel/backup_poller.cc \
     src/core/ext/filters/client_channel/channel_connectivity.cc \
     src/core/ext/filters/client_channel/client_channel.cc \
     src/core/ext/filters/client_channel/client_channel_factory.cc \
@@ -3868,20 +3842,20 @@
 
 LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
     src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
-    test/core/end2end/cq_verifier.c \
-    test/core/end2end/fixtures/http_proxy_fixture.c \
-    test/core/end2end/fixtures/proxy.c \
-    test/core/iomgr/endpoint_tests.c \
+    test/core/end2end/cq_verifier.cc \
+    test/core/end2end/fixtures/http_proxy_fixture.cc \
+    test/core/end2end/fixtures/proxy.cc \
+    test/core/iomgr/endpoint_tests.cc \
     test/core/util/debugger_macros.cc \
-    test/core/util/grpc_profiler.c \
-    test/core/util/memory_counters.c \
-    test/core/util/mock_endpoint.c \
-    test/core/util/parse_hexstring.c \
-    test/core/util/passthru_endpoint.c \
-    test/core/util/port.c \
-    test/core/util/port_server_client.c \
-    test/core/util/slice_splitter.c \
-    test/core/util/trickle_endpoint.c \
+    test/core/util/grpc_profiler.cc \
+    test/core/util/memory_counters.cc \
+    test/core/util/mock_endpoint.cc \
+    test/core/util/parse_hexstring.cc \
+    test/core/util/passthru_endpoint.cc \
+    test/core/util/port.cc \
+    test/core/util/port_server_client.cc \
+    test/core/util/slice_splitter.cc \
+    test/core/util/trickle_endpoint.cc \
     src/core/lib/backoff/backoff.cc \
     src/core/lib/channel/channel_args.cc \
     src/core/lib/channel/channel_stack.cc \
@@ -4015,6 +3989,7 @@
     src/core/lib/transport/transport.cc \
     src/core/lib/transport/transport_op_string.cc \
     src/core/lib/debug/trace.cc \
+    src/core/ext/filters/client_channel/backup_poller.cc \
     src/core/ext/filters/client_channel/channel_connectivity.cc \
     src/core/ext/filters/client_channel/client_channel.cc \
     src/core/ext/filters/client_channel/client_channel_factory.cc \
@@ -4276,6 +4251,7 @@
     src/core/ext/transport/chttp2/client/insecure/channel_create.cc \
     src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
     src/core/ext/transport/chttp2/client/chttp2_connector.cc \
+    src/core/ext/filters/client_channel/backup_poller.cc \
     src/core/ext/filters/client_channel/channel_connectivity.cc \
     src/core/ext/filters/client_channel/client_channel.cc \
     src/core/ext/filters/client_channel/client_channel_factory.cc \
@@ -4318,22 +4294,9 @@
     third_party/nanopb/pb_decode.c \
     third_party/nanopb/pb_encode.c \
     src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
+    src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc \
     src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
-    src/core/ext/census/base_resources.cc \
-    src/core/ext/census/context.cc \
-    src/core/ext/census/gen/census.pb.c \
-    src/core/ext/census/gen/trace_context.pb.c \
     src/core/ext/census/grpc_context.cc \
-    src/core/ext/census/grpc_filter.cc \
-    src/core/ext/census/grpc_plugin.cc \
-    src/core/ext/census/initialize.cc \
-    src/core/ext/census/intrusive_hash_map.cc \
-    src/core/ext/census/mlog.cc \
-    src/core/ext/census/operation.cc \
-    src/core/ext/census/placeholders.cc \
-    src/core/ext/census/resource.cc \
-    src/core/ext/census/trace_context.cc \
-    src/core/ext/census/tracing.cc \
     src/core/ext/filters/max_age/max_age_filter.cc \
     src/core/ext/filters/message_size/message_size_filter.cc \
     src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
@@ -4413,7 +4376,7 @@
 
 
 LIBRECONNECT_SERVER_SRC = \
-    test/core/util/reconnect_server.c \
+    test/core/util/reconnect_server.cc \
 
 PUBLIC_HEADERS_C += \
 
@@ -4452,7 +4415,7 @@
 
 
 LIBTEST_TCP_SERVER_SRC = \
-    test/core/util/test_tcp_server.c \
+    test/core/util/test_tcp_server.cc \
 
 PUBLIC_HEADERS_C += \
 
@@ -4989,6 +4952,7 @@
     src/core/ext/filters/http/http_filters_plugin.cc \
     src/core/ext/filters/http/message_compress/message_compress_filter.cc \
     src/core/ext/filters/http/server/http_server_filter.cc \
+    src/core/ext/filters/client_channel/backup_poller.cc \
     src/core/ext/filters/client_channel/channel_connectivity.cc \
     src/core/ext/filters/client_channel/client_channel.cc \
     src/core/ext/filters/client_channel/client_channel_factory.cc \
@@ -5013,21 +4977,7 @@
     src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc \
     src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc \
     src/core/ext/transport/chttp2/server/chttp2_server.cc \
-    src/core/ext/census/base_resources.cc \
-    src/core/ext/census/context.cc \
-    src/core/ext/census/gen/census.pb.c \
-    src/core/ext/census/gen/trace_context.pb.c \
     src/core/ext/census/grpc_context.cc \
-    src/core/ext/census/grpc_filter.cc \
-    src/core/ext/census/grpc_plugin.cc \
-    src/core/ext/census/initialize.cc \
-    src/core/ext/census/intrusive_hash_map.cc \
-    src/core/ext/census/mlog.cc \
-    src/core/ext/census/operation.cc \
-    src/core/ext/census/placeholders.cc \
-    src/core/ext/census/resource.cc \
-    src/core/ext/census/trace_context.cc \
-    src/core/ext/census/tracing.cc \
     third_party/nanopb/pb_common.c \
     third_party/nanopb/pb_decode.c \
     third_party/nanopb/pb_encode.c \
@@ -8294,6 +8244,7 @@
     third_party/benchmark/src/commandlineflags.cc \
     third_party/benchmark/src/complexity.cc \
     third_party/benchmark/src/console_reporter.cc \
+    third_party/benchmark/src/counter.cc \
     third_party/benchmark/src/csv_reporter.cc \
     third_party/benchmark/src/json_reporter.cc \
     third_party/benchmark/src/reporter.cc \
@@ -8452,7 +8403,7 @@
 
 
 LIBBAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/bad_client.c \
+    test/core/bad_client/bad_client.cc \
 
 PUBLIC_HEADERS_C += \
 
@@ -8491,7 +8442,7 @@
 
 
 LIBBAD_SSL_TEST_SERVER_SRC = \
-    test/core/bad_ssl/server_common.c \
+    test/core/bad_ssl/server_common.cc \
 
 PUBLIC_HEADERS_C += \
 
@@ -8530,67 +8481,67 @@
 
 
 LIBEND2END_TESTS_SRC = \
-    test/core/end2end/end2end_tests.c \
-    test/core/end2end/end2end_test_utils.c \
-    test/core/end2end/tests/authority_not_supported.c \
-    test/core/end2end/tests/bad_hostname.c \
-    test/core/end2end/tests/bad_ping.c \
-    test/core/end2end/tests/binary_metadata.c \
-    test/core/end2end/tests/call_creds.c \
-    test/core/end2end/tests/cancel_after_accept.c \
-    test/core/end2end/tests/cancel_after_client_done.c \
-    test/core/end2end/tests/cancel_after_invoke.c \
-    test/core/end2end/tests/cancel_after_round_trip.c \
-    test/core/end2end/tests/cancel_before_invoke.c \
-    test/core/end2end/tests/cancel_in_a_vacuum.c \
-    test/core/end2end/tests/cancel_with_status.c \
-    test/core/end2end/tests/compressed_payload.c \
-    test/core/end2end/tests/connectivity.c \
-    test/core/end2end/tests/default_host.c \
-    test/core/end2end/tests/disappearing_server.c \
-    test/core/end2end/tests/empty_batch.c \
-    test/core/end2end/tests/filter_call_init_fails.c \
-    test/core/end2end/tests/filter_causes_close.c \
-    test/core/end2end/tests/filter_latency.c \
-    test/core/end2end/tests/graceful_server_shutdown.c \
-    test/core/end2end/tests/high_initial_seqno.c \
-    test/core/end2end/tests/hpack_size.c \
-    test/core/end2end/tests/idempotent_request.c \
-    test/core/end2end/tests/invoke_large_request.c \
-    test/core/end2end/tests/keepalive_timeout.c \
-    test/core/end2end/tests/large_metadata.c \
-    test/core/end2end/tests/load_reporting_hook.c \
-    test/core/end2end/tests/max_concurrent_streams.c \
-    test/core/end2end/tests/max_connection_age.c \
-    test/core/end2end/tests/max_connection_idle.c \
-    test/core/end2end/tests/max_message_length.c \
-    test/core/end2end/tests/negative_deadline.c \
-    test/core/end2end/tests/network_status_change.c \
-    test/core/end2end/tests/no_logging.c \
-    test/core/end2end/tests/no_op.c \
-    test/core/end2end/tests/payload.c \
-    test/core/end2end/tests/ping.c \
-    test/core/end2end/tests/ping_pong_streaming.c \
-    test/core/end2end/tests/proxy_auth.c \
-    test/core/end2end/tests/registered_call.c \
-    test/core/end2end/tests/request_with_flags.c \
-    test/core/end2end/tests/request_with_payload.c \
-    test/core/end2end/tests/resource_quota_server.c \
-    test/core/end2end/tests/server_finishes_request.c \
-    test/core/end2end/tests/shutdown_finishes_calls.c \
-    test/core/end2end/tests/shutdown_finishes_tags.c \
-    test/core/end2end/tests/simple_cacheable_request.c \
-    test/core/end2end/tests/simple_delayed_request.c \
-    test/core/end2end/tests/simple_metadata.c \
-    test/core/end2end/tests/simple_request.c \
-    test/core/end2end/tests/stream_compression_compressed_payload.c \
-    test/core/end2end/tests/stream_compression_payload.c \
-    test/core/end2end/tests/stream_compression_ping_pong_streaming.c \
-    test/core/end2end/tests/streaming_error_response.c \
-    test/core/end2end/tests/trailing_metadata.c \
-    test/core/end2end/tests/workaround_cronet_compression.c \
-    test/core/end2end/tests/write_buffering.c \
-    test/core/end2end/tests/write_buffering_at_end.c \
+    test/core/end2end/end2end_tests.cc \
+    test/core/end2end/end2end_test_utils.cc \
+    test/core/end2end/tests/authority_not_supported.cc \
+    test/core/end2end/tests/bad_hostname.cc \
+    test/core/end2end/tests/bad_ping.cc \
+    test/core/end2end/tests/binary_metadata.cc \
+    test/core/end2end/tests/call_creds.cc \
+    test/core/end2end/tests/cancel_after_accept.cc \
+    test/core/end2end/tests/cancel_after_client_done.cc \
+    test/core/end2end/tests/cancel_after_invoke.cc \
+    test/core/end2end/tests/cancel_after_round_trip.cc \
+    test/core/end2end/tests/cancel_before_invoke.cc \
+    test/core/end2end/tests/cancel_in_a_vacuum.cc \
+    test/core/end2end/tests/cancel_with_status.cc \
+    test/core/end2end/tests/compressed_payload.cc \
+    test/core/end2end/tests/connectivity.cc \
+    test/core/end2end/tests/default_host.cc \
+    test/core/end2end/tests/disappearing_server.cc \
+    test/core/end2end/tests/empty_batch.cc \
+    test/core/end2end/tests/filter_call_init_fails.cc \
+    test/core/end2end/tests/filter_causes_close.cc \
+    test/core/end2end/tests/filter_latency.cc \
+    test/core/end2end/tests/graceful_server_shutdown.cc \
+    test/core/end2end/tests/high_initial_seqno.cc \
+    test/core/end2end/tests/hpack_size.cc \
+    test/core/end2end/tests/idempotent_request.cc \
+    test/core/end2end/tests/invoke_large_request.cc \
+    test/core/end2end/tests/keepalive_timeout.cc \
+    test/core/end2end/tests/large_metadata.cc \
+    test/core/end2end/tests/load_reporting_hook.cc \
+    test/core/end2end/tests/max_concurrent_streams.cc \
+    test/core/end2end/tests/max_connection_age.cc \
+    test/core/end2end/tests/max_connection_idle.cc \
+    test/core/end2end/tests/max_message_length.cc \
+    test/core/end2end/tests/negative_deadline.cc \
+    test/core/end2end/tests/network_status_change.cc \
+    test/core/end2end/tests/no_logging.cc \
+    test/core/end2end/tests/no_op.cc \
+    test/core/end2end/tests/payload.cc \
+    test/core/end2end/tests/ping.cc \
+    test/core/end2end/tests/ping_pong_streaming.cc \
+    test/core/end2end/tests/proxy_auth.cc \
+    test/core/end2end/tests/registered_call.cc \
+    test/core/end2end/tests/request_with_flags.cc \
+    test/core/end2end/tests/request_with_payload.cc \
+    test/core/end2end/tests/resource_quota_server.cc \
+    test/core/end2end/tests/server_finishes_request.cc \
+    test/core/end2end/tests/shutdown_finishes_calls.cc \
+    test/core/end2end/tests/shutdown_finishes_tags.cc \
+    test/core/end2end/tests/simple_cacheable_request.cc \
+    test/core/end2end/tests/simple_delayed_request.cc \
+    test/core/end2end/tests/simple_metadata.cc \
+    test/core/end2end/tests/simple_request.cc \
+    test/core/end2end/tests/stream_compression_compressed_payload.cc \
+    test/core/end2end/tests/stream_compression_payload.cc \
+    test/core/end2end/tests/stream_compression_ping_pong_streaming.cc \
+    test/core/end2end/tests/streaming_error_response.cc \
+    test/core/end2end/tests/trailing_metadata.cc \
+    test/core/end2end/tests/workaround_cronet_compression.cc \
+    test/core/end2end/tests/write_buffering.cc \
+    test/core/end2end/tests/write_buffering_at_end.cc \
 
 PUBLIC_HEADERS_C += \
 
@@ -8629,66 +8580,66 @@
 
 
 LIBEND2END_NOSEC_TESTS_SRC = \
-    test/core/end2end/end2end_nosec_tests.c \
-    test/core/end2end/end2end_test_utils.c \
-    test/core/end2end/tests/authority_not_supported.c \
-    test/core/end2end/tests/bad_hostname.c \
-    test/core/end2end/tests/bad_ping.c \
-    test/core/end2end/tests/binary_metadata.c \
-    test/core/end2end/tests/cancel_after_accept.c \
-    test/core/end2end/tests/cancel_after_client_done.c \
-    test/core/end2end/tests/cancel_after_invoke.c \
-    test/core/end2end/tests/cancel_after_round_trip.c \
-    test/core/end2end/tests/cancel_before_invoke.c \
-    test/core/end2end/tests/cancel_in_a_vacuum.c \
-    test/core/end2end/tests/cancel_with_status.c \
-    test/core/end2end/tests/compressed_payload.c \
-    test/core/end2end/tests/connectivity.c \
-    test/core/end2end/tests/default_host.c \
-    test/core/end2end/tests/disappearing_server.c \
-    test/core/end2end/tests/empty_batch.c \
-    test/core/end2end/tests/filter_call_init_fails.c \
-    test/core/end2end/tests/filter_causes_close.c \
-    test/core/end2end/tests/filter_latency.c \
-    test/core/end2end/tests/graceful_server_shutdown.c \
-    test/core/end2end/tests/high_initial_seqno.c \
-    test/core/end2end/tests/hpack_size.c \
-    test/core/end2end/tests/idempotent_request.c \
-    test/core/end2end/tests/invoke_large_request.c \
-    test/core/end2end/tests/keepalive_timeout.c \
-    test/core/end2end/tests/large_metadata.c \
-    test/core/end2end/tests/load_reporting_hook.c \
-    test/core/end2end/tests/max_concurrent_streams.c \
-    test/core/end2end/tests/max_connection_age.c \
-    test/core/end2end/tests/max_connection_idle.c \
-    test/core/end2end/tests/max_message_length.c \
-    test/core/end2end/tests/negative_deadline.c \
-    test/core/end2end/tests/network_status_change.c \
-    test/core/end2end/tests/no_logging.c \
-    test/core/end2end/tests/no_op.c \
-    test/core/end2end/tests/payload.c \
-    test/core/end2end/tests/ping.c \
-    test/core/end2end/tests/ping_pong_streaming.c \
-    test/core/end2end/tests/proxy_auth.c \
-    test/core/end2end/tests/registered_call.c \
-    test/core/end2end/tests/request_with_flags.c \
-    test/core/end2end/tests/request_with_payload.c \
-    test/core/end2end/tests/resource_quota_server.c \
-    test/core/end2end/tests/server_finishes_request.c \
-    test/core/end2end/tests/shutdown_finishes_calls.c \
-    test/core/end2end/tests/shutdown_finishes_tags.c \
-    test/core/end2end/tests/simple_cacheable_request.c \
-    test/core/end2end/tests/simple_delayed_request.c \
-    test/core/end2end/tests/simple_metadata.c \
-    test/core/end2end/tests/simple_request.c \
-    test/core/end2end/tests/stream_compression_compressed_payload.c \
-    test/core/end2end/tests/stream_compression_payload.c \
-    test/core/end2end/tests/stream_compression_ping_pong_streaming.c \
-    test/core/end2end/tests/streaming_error_response.c \
-    test/core/end2end/tests/trailing_metadata.c \
-    test/core/end2end/tests/workaround_cronet_compression.c \
-    test/core/end2end/tests/write_buffering.c \
-    test/core/end2end/tests/write_buffering_at_end.c \
+    test/core/end2end/end2end_nosec_tests.cc \
+    test/core/end2end/end2end_test_utils.cc \
+    test/core/end2end/tests/authority_not_supported.cc \
+    test/core/end2end/tests/bad_hostname.cc \
+    test/core/end2end/tests/bad_ping.cc \
+    test/core/end2end/tests/binary_metadata.cc \
+    test/core/end2end/tests/cancel_after_accept.cc \
+    test/core/end2end/tests/cancel_after_client_done.cc \
+    test/core/end2end/tests/cancel_after_invoke.cc \
+    test/core/end2end/tests/cancel_after_round_trip.cc \
+    test/core/end2end/tests/cancel_before_invoke.cc \
+    test/core/end2end/tests/cancel_in_a_vacuum.cc \
+    test/core/end2end/tests/cancel_with_status.cc \
+    test/core/end2end/tests/compressed_payload.cc \
+    test/core/end2end/tests/connectivity.cc \
+    test/core/end2end/tests/default_host.cc \
+    test/core/end2end/tests/disappearing_server.cc \
+    test/core/end2end/tests/empty_batch.cc \
+    test/core/end2end/tests/filter_call_init_fails.cc \
+    test/core/end2end/tests/filter_causes_close.cc \
+    test/core/end2end/tests/filter_latency.cc \
+    test/core/end2end/tests/graceful_server_shutdown.cc \
+    test/core/end2end/tests/high_initial_seqno.cc \
+    test/core/end2end/tests/hpack_size.cc \
+    test/core/end2end/tests/idempotent_request.cc \
+    test/core/end2end/tests/invoke_large_request.cc \
+    test/core/end2end/tests/keepalive_timeout.cc \
+    test/core/end2end/tests/large_metadata.cc \
+    test/core/end2end/tests/load_reporting_hook.cc \
+    test/core/end2end/tests/max_concurrent_streams.cc \
+    test/core/end2end/tests/max_connection_age.cc \
+    test/core/end2end/tests/max_connection_idle.cc \
+    test/core/end2end/tests/max_message_length.cc \
+    test/core/end2end/tests/negative_deadline.cc \
+    test/core/end2end/tests/network_status_change.cc \
+    test/core/end2end/tests/no_logging.cc \
+    test/core/end2end/tests/no_op.cc \
+    test/core/end2end/tests/payload.cc \
+    test/core/end2end/tests/ping.cc \
+    test/core/end2end/tests/ping_pong_streaming.cc \
+    test/core/end2end/tests/proxy_auth.cc \
+    test/core/end2end/tests/registered_call.cc \
+    test/core/end2end/tests/request_with_flags.cc \
+    test/core/end2end/tests/request_with_payload.cc \
+    test/core/end2end/tests/resource_quota_server.cc \
+    test/core/end2end/tests/server_finishes_request.cc \
+    test/core/end2end/tests/shutdown_finishes_calls.cc \
+    test/core/end2end/tests/shutdown_finishes_tags.cc \
+    test/core/end2end/tests/simple_cacheable_request.cc \
+    test/core/end2end/tests/simple_delayed_request.cc \
+    test/core/end2end/tests/simple_metadata.cc \
+    test/core/end2end/tests/simple_request.cc \
+    test/core/end2end/tests/stream_compression_compressed_payload.cc \
+    test/core/end2end/tests/stream_compression_payload.cc \
+    test/core/end2end/tests/stream_compression_ping_pong_streaming.cc \
+    test/core/end2end/tests/streaming_error_response.cc \
+    test/core/end2end/tests/trailing_metadata.cc \
+    test/core/end2end/tests/workaround_cronet_compression.cc \
+    test/core/end2end/tests/write_buffering.cc \
+    test/core/end2end/tests/write_buffering_at_end.cc \
 
 PUBLIC_HEADERS_C += \
 
@@ -8717,7 +8668,7 @@
 
 
 ALARM_TEST_SRC = \
-    test/core/surface/alarm_test.c \
+    test/core/surface/alarm_test.cc \
 
 ALARM_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ALARM_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -8749,7 +8700,7 @@
 
 
 ALGORITHM_TEST_SRC = \
-    test/core/compression/algorithm_test.c \
+    test/core/compression/algorithm_test.cc \
 
 ALGORITHM_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ALGORITHM_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -8781,7 +8732,7 @@
 
 
 ALLOC_TEST_SRC = \
-    test/core/support/alloc_test.c \
+    test/core/support/alloc_test.cc \
 
 ALLOC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ALLOC_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -8813,7 +8764,7 @@
 
 
 ALPN_TEST_SRC = \
-    test/core/transport/chttp2/alpn_test.c \
+    test/core/transport/chttp2/alpn_test.cc \
 
 ALPN_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ALPN_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -8845,7 +8796,7 @@
 
 
 API_FUZZER_SRC = \
-    test/core/end2end/fuzzers/api_fuzzer.c \
+    test/core/end2end/fuzzers/api_fuzzer.cc \
 
 API_FUZZER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(API_FUZZER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -8877,7 +8828,7 @@
 
 
 ARENA_TEST_SRC = \
-    test/core/support/arena_test.c \
+    test/core/support/arena_test.cc \
 
 ARENA_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ARENA_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -8909,7 +8860,7 @@
 
 
 BACKOFF_TEST_SRC = \
-    test/core/backoff/backoff_test.c \
+    test/core/backoff/backoff_test.cc \
 
 BACKOFF_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BACKOFF_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -8941,7 +8892,7 @@
 
 
 BAD_SERVER_RESPONSE_TEST_SRC = \
-    test/core/end2end/bad_server_response_test.c \
+    test/core/end2end/bad_server_response_test.cc \
 
 BAD_SERVER_RESPONSE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BAD_SERVER_RESPONSE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -8973,7 +8924,7 @@
 
 
 BIN_DECODER_TEST_SRC = \
-    test/core/transport/chttp2/bin_decoder_test.c \
+    test/core/transport/chttp2/bin_decoder_test.cc \
 
 BIN_DECODER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BIN_DECODER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9005,7 +8956,7 @@
 
 
 BIN_ENCODER_TEST_SRC = \
-    test/core/transport/chttp2/bin_encoder_test.c \
+    test/core/transport/chttp2/bin_encoder_test.cc \
 
 BIN_ENCODER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BIN_ENCODER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9037,7 +8988,7 @@
 
 
 BYTE_STREAM_TEST_SRC = \
-    test/core/transport/byte_stream_test.c \
+    test/core/transport/byte_stream_test.cc \
 
 BYTE_STREAM_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BYTE_STREAM_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9068,136 +9019,8 @@
 endif
 
 
-CENSUS_CONTEXT_TEST_SRC = \
-    test/core/census/context_test.c \
-
-CENSUS_CONTEXT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CENSUS_CONTEXT_TEST_SRC))))
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure targets if you don't have OpenSSL.
-
-$(BINDIR)/$(CONFIG)/census_context_test: openssl_dep_error
-
-else
-
-
-
-$(BINDIR)/$(CONFIG)/census_context_test: $(CENSUS_CONTEXT_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-	$(E) "[LD]      Linking $@"
-	$(Q) mkdir -p `dirname $@`
-	$(Q) $(LD) $(LDFLAGS) $(CENSUS_CONTEXT_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/census_context_test
-
-endif
-
-$(OBJDIR)/$(CONFIG)/test/core/census/context_test.o:  $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-
-deps_census_context_test: $(CENSUS_CONTEXT_TEST_OBJS:.o=.dep)
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(CENSUS_CONTEXT_TEST_OBJS:.o=.dep)
-endif
-endif
-
-
-CENSUS_INTRUSIVE_HASH_MAP_TEST_SRC = \
-    test/core/census/intrusive_hash_map_test.c \
-
-CENSUS_INTRUSIVE_HASH_MAP_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CENSUS_INTRUSIVE_HASH_MAP_TEST_SRC))))
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure targets if you don't have OpenSSL.
-
-$(BINDIR)/$(CONFIG)/census_intrusive_hash_map_test: openssl_dep_error
-
-else
-
-
-
-$(BINDIR)/$(CONFIG)/census_intrusive_hash_map_test: $(CENSUS_INTRUSIVE_HASH_MAP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-	$(E) "[LD]      Linking $@"
-	$(Q) mkdir -p `dirname $@`
-	$(Q) $(LD) $(LDFLAGS) $(CENSUS_INTRUSIVE_HASH_MAP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/census_intrusive_hash_map_test
-
-endif
-
-$(OBJDIR)/$(CONFIG)/test/core/census/intrusive_hash_map_test.o:  $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-
-deps_census_intrusive_hash_map_test: $(CENSUS_INTRUSIVE_HASH_MAP_TEST_OBJS:.o=.dep)
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(CENSUS_INTRUSIVE_HASH_MAP_TEST_OBJS:.o=.dep)
-endif
-endif
-
-
-CENSUS_RESOURCE_TEST_SRC = \
-    test/core/census/resource_test.c \
-
-CENSUS_RESOURCE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CENSUS_RESOURCE_TEST_SRC))))
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure targets if you don't have OpenSSL.
-
-$(BINDIR)/$(CONFIG)/census_resource_test: openssl_dep_error
-
-else
-
-
-
-$(BINDIR)/$(CONFIG)/census_resource_test: $(CENSUS_RESOURCE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-	$(E) "[LD]      Linking $@"
-	$(Q) mkdir -p `dirname $@`
-	$(Q) $(LD) $(LDFLAGS) $(CENSUS_RESOURCE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/census_resource_test
-
-endif
-
-$(OBJDIR)/$(CONFIG)/test/core/census/resource_test.o:  $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-
-deps_census_resource_test: $(CENSUS_RESOURCE_TEST_OBJS:.o=.dep)
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(CENSUS_RESOURCE_TEST_OBJS:.o=.dep)
-endif
-endif
-
-
-CENSUS_TRACE_CONTEXT_TEST_SRC = \
-    test/core/census/trace_context_test.c \
-
-CENSUS_TRACE_CONTEXT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CENSUS_TRACE_CONTEXT_TEST_SRC))))
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure targets if you don't have OpenSSL.
-
-$(BINDIR)/$(CONFIG)/census_trace_context_test: openssl_dep_error
-
-else
-
-
-
-$(BINDIR)/$(CONFIG)/census_trace_context_test: $(CENSUS_TRACE_CONTEXT_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-	$(E) "[LD]      Linking $@"
-	$(Q) mkdir -p `dirname $@`
-	$(Q) $(LD) $(LDFLAGS) $(CENSUS_TRACE_CONTEXT_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/census_trace_context_test
-
-endif
-
-$(OBJDIR)/$(CONFIG)/test/core/census/trace_context_test.o:  $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-
-deps_census_trace_context_test: $(CENSUS_TRACE_CONTEXT_TEST_OBJS:.o=.dep)
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(CENSUS_TRACE_CONTEXT_TEST_OBJS:.o=.dep)
-endif
-endif
-
-
 CHANNEL_CREATE_TEST_SRC = \
-    test/core/surface/channel_create_test.c \
+    test/core/surface/channel_create_test.cc \
 
 CHANNEL_CREATE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CHANNEL_CREATE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9261,7 +9084,7 @@
 
 
 CHTTP2_HPACK_ENCODER_TEST_SRC = \
-    test/core/transport/chttp2/hpack_encoder_test.c \
+    test/core/transport/chttp2/hpack_encoder_test.cc \
 
 CHTTP2_HPACK_ENCODER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CHTTP2_HPACK_ENCODER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9293,7 +9116,7 @@
 
 
 CHTTP2_STREAM_MAP_TEST_SRC = \
-    test/core/transport/chttp2/stream_map_test.c \
+    test/core/transport/chttp2/stream_map_test.cc \
 
 CHTTP2_STREAM_MAP_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CHTTP2_STREAM_MAP_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9325,7 +9148,7 @@
 
 
 CHTTP2_VARINT_TEST_SRC = \
-    test/core/transport/chttp2/varint_test.c \
+    test/core/transport/chttp2/varint_test.cc \
 
 CHTTP2_VARINT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CHTTP2_VARINT_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9357,7 +9180,7 @@
 
 
 CLIENT_FUZZER_SRC = \
-    test/core/end2end/fuzzers/client_fuzzer.c \
+    test/core/end2end/fuzzers/client_fuzzer.cc \
 
 CLIENT_FUZZER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CLIENT_FUZZER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9389,7 +9212,7 @@
 
 
 COMBINER_TEST_SRC = \
-    test/core/iomgr/combiner_test.c \
+    test/core/iomgr/combiner_test.cc \
 
 COMBINER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(COMBINER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9421,7 +9244,7 @@
 
 
 COMPRESSION_TEST_SRC = \
-    test/core/compression/compression_test.c \
+    test/core/compression/compression_test.cc \
 
 COMPRESSION_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(COMPRESSION_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9453,7 +9276,7 @@
 
 
 CONCURRENT_CONNECTIVITY_TEST_SRC = \
-    test/core/surface/concurrent_connectivity_test.c \
+    test/core/surface/concurrent_connectivity_test.cc \
 
 CONCURRENT_CONNECTIVITY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CONCURRENT_CONNECTIVITY_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9485,7 +9308,7 @@
 
 
 CONNECTION_REFUSED_TEST_SRC = \
-    test/core/end2end/connection_refused_test.c \
+    test/core/end2end/connection_refused_test.cc \
 
 CONNECTION_REFUSED_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CONNECTION_REFUSED_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9517,7 +9340,7 @@
 
 
 DNS_RESOLVER_CONNECTIVITY_TEST_SRC = \
-    test/core/client_channel/resolvers/dns_resolver_connectivity_test.c \
+    test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc \
 
 DNS_RESOLVER_CONNECTIVITY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DNS_RESOLVER_CONNECTIVITY_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9549,7 +9372,7 @@
 
 
 DNS_RESOLVER_TEST_SRC = \
-    test/core/client_channel/resolvers/dns_resolver_test.c \
+    test/core/client_channel/resolvers/dns_resolver_test.cc \
 
 DNS_RESOLVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DNS_RESOLVER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9581,7 +9404,7 @@
 
 
 DUALSTACK_SOCKET_TEST_SRC = \
-    test/core/end2end/dualstack_socket_test.c \
+    test/core/end2end/dualstack_socket_test.cc \
 
 DUALSTACK_SOCKET_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DUALSTACK_SOCKET_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9613,7 +9436,7 @@
 
 
 ENDPOINT_PAIR_TEST_SRC = \
-    test/core/iomgr/endpoint_pair_test.c \
+    test/core/iomgr/endpoint_pair_test.cc \
 
 ENDPOINT_PAIR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ENDPOINT_PAIR_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9645,7 +9468,7 @@
 
 
 ERROR_TEST_SRC = \
-    test/core/iomgr/error_test.c \
+    test/core/iomgr/error_test.cc \
 
 ERROR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ERROR_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9677,7 +9500,7 @@
 
 
 EV_EPOLLSIG_LINUX_TEST_SRC = \
-    test/core/iomgr/ev_epollsig_linux_test.c \
+    test/core/iomgr/ev_epollsig_linux_test.cc \
 
 EV_EPOLLSIG_LINUX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(EV_EPOLLSIG_LINUX_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9709,7 +9532,7 @@
 
 
 FAKE_RESOLVER_TEST_SRC = \
-    test/core/client_channel/resolvers/fake_resolver_test.c \
+    test/core/client_channel/resolvers/fake_resolver_test.cc \
 
 FAKE_RESOLVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FAKE_RESOLVER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9741,8 +9564,8 @@
 
 
 FAKE_TRANSPORT_SECURITY_TEST_SRC = \
-    test/core/tsi/fake_transport_security_test.c \
-    test/core/tsi/transport_security_test_lib.c \
+    test/core/tsi/fake_transport_security_test.cc \
+    test/core/tsi/transport_security_test_lib.cc \
 
 FAKE_TRANSPORT_SECURITY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FAKE_TRANSPORT_SECURITY_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9776,7 +9599,7 @@
 
 
 FD_CONSERVATION_POSIX_TEST_SRC = \
-    test/core/iomgr/fd_conservation_posix_test.c \
+    test/core/iomgr/fd_conservation_posix_test.cc \
 
 FD_CONSERVATION_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FD_CONSERVATION_POSIX_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9808,7 +9631,7 @@
 
 
 FD_POSIX_TEST_SRC = \
-    test/core/iomgr/fd_posix_test.c \
+    test/core/iomgr/fd_posix_test.cc \
 
 FD_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FD_POSIX_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9840,7 +9663,7 @@
 
 
 FLING_CLIENT_SRC = \
-    test/core/fling/client.c \
+    test/core/fling/client.cc \
 
 FLING_CLIENT_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FLING_CLIENT_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9872,7 +9695,7 @@
 
 
 FLING_SERVER_SRC = \
-    test/core/fling/server.c \
+    test/core/fling/server.cc \
 
 FLING_SERVER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FLING_SERVER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9904,7 +9727,7 @@
 
 
 FLING_STREAM_TEST_SRC = \
-    test/core/fling/fling_stream_test.c \
+    test/core/fling/fling_stream_test.cc \
 
 FLING_STREAM_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FLING_STREAM_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -9936,7 +9759,7 @@
 
 
 FLING_TEST_SRC = \
-    test/core/fling/fling_test.c \
+    test/core/fling/fling_test.cc \
 
 FLING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FLING_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10064,7 +9887,7 @@
 
 
 GOAWAY_SERVER_TEST_SRC = \
-    test/core/end2end/goaway_server_test.c \
+    test/core/end2end/goaway_server_test.cc \
 
 GOAWAY_SERVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GOAWAY_SERVER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10096,7 +9919,7 @@
 
 
 GPR_AVL_TEST_SRC = \
-    test/core/support/avl_test.c \
+    test/core/support/avl_test.cc \
 
 GPR_AVL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_AVL_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10128,7 +9951,7 @@
 
 
 GPR_CMDLINE_TEST_SRC = \
-    test/core/support/cmdline_test.c \
+    test/core/support/cmdline_test.cc \
 
 GPR_CMDLINE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_CMDLINE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10160,7 +9983,7 @@
 
 
 GPR_CPU_TEST_SRC = \
-    test/core/support/cpu_test.c \
+    test/core/support/cpu_test.cc \
 
 GPR_CPU_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_CPU_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10192,7 +10015,7 @@
 
 
 GPR_ENV_TEST_SRC = \
-    test/core/support/env_test.c \
+    test/core/support/env_test.cc \
 
 GPR_ENV_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_ENV_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10224,7 +10047,7 @@
 
 
 GPR_HISTOGRAM_TEST_SRC = \
-    test/core/support/histogram_test.c \
+    test/core/support/histogram_test.cc \
 
 GPR_HISTOGRAM_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_HISTOGRAM_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10256,7 +10079,7 @@
 
 
 GPR_HOST_PORT_TEST_SRC = \
-    test/core/support/host_port_test.c \
+    test/core/support/host_port_test.cc \
 
 GPR_HOST_PORT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_HOST_PORT_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10288,7 +10111,7 @@
 
 
 GPR_LOG_TEST_SRC = \
-    test/core/support/log_test.c \
+    test/core/support/log_test.cc \
 
 GPR_LOG_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_LOG_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10320,7 +10143,7 @@
 
 
 GPR_MPSCQ_TEST_SRC = \
-    test/core/support/mpscq_test.c \
+    test/core/support/mpscq_test.cc \
 
 GPR_MPSCQ_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_MPSCQ_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10352,7 +10175,7 @@
 
 
 GPR_SPINLOCK_TEST_SRC = \
-    test/core/support/spinlock_test.c \
+    test/core/support/spinlock_test.cc \
 
 GPR_SPINLOCK_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_SPINLOCK_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10384,7 +10207,7 @@
 
 
 GPR_STACK_LOCKFREE_TEST_SRC = \
-    test/core/support/stack_lockfree_test.c \
+    test/core/support/stack_lockfree_test.cc \
 
 GPR_STACK_LOCKFREE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_STACK_LOCKFREE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10416,7 +10239,7 @@
 
 
 GPR_STRING_TEST_SRC = \
-    test/core/support/string_test.c \
+    test/core/support/string_test.cc \
 
 GPR_STRING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_STRING_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10448,7 +10271,7 @@
 
 
 GPR_SYNC_TEST_SRC = \
-    test/core/support/sync_test.c \
+    test/core/support/sync_test.cc \
 
 GPR_SYNC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_SYNC_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10480,7 +10303,7 @@
 
 
 GPR_THD_TEST_SRC = \
-    test/core/support/thd_test.c \
+    test/core/support/thd_test.cc \
 
 GPR_THD_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_THD_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10512,7 +10335,7 @@
 
 
 GPR_TIME_TEST_SRC = \
-    test/core/support/time_test.c \
+    test/core/support/time_test.cc \
 
 GPR_TIME_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_TIME_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10544,7 +10367,7 @@
 
 
 GPR_TLS_TEST_SRC = \
-    test/core/support/tls_test.c \
+    test/core/support/tls_test.cc \
 
 GPR_TLS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_TLS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10576,7 +10399,7 @@
 
 
 GPR_USEFUL_TEST_SRC = \
-    test/core/support/useful_test.c \
+    test/core/support/useful_test.cc \
 
 GPR_USEFUL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_USEFUL_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10608,7 +10431,7 @@
 
 
 GRPC_AUTH_CONTEXT_TEST_SRC = \
-    test/core/security/auth_context_test.c \
+    test/core/security/auth_context_test.cc \
 
 GRPC_AUTH_CONTEXT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_AUTH_CONTEXT_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10640,7 +10463,7 @@
 
 
 GRPC_B64_TEST_SRC = \
-    test/core/slice/b64_test.c \
+    test/core/slice/b64_test.cc \
 
 GRPC_B64_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_B64_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10672,7 +10495,7 @@
 
 
 GRPC_BYTE_BUFFER_READER_TEST_SRC = \
-    test/core/surface/byte_buffer_reader_test.c \
+    test/core/surface/byte_buffer_reader_test.cc \
 
 GRPC_BYTE_BUFFER_READER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_BYTE_BUFFER_READER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10704,7 +10527,7 @@
 
 
 GRPC_CHANNEL_ARGS_TEST_SRC = \
-    test/core/channel/channel_args_test.c \
+    test/core/channel/channel_args_test.cc \
 
 GRPC_CHANNEL_ARGS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_CHANNEL_ARGS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10736,7 +10559,7 @@
 
 
 GRPC_CHANNEL_STACK_BUILDER_TEST_SRC = \
-    test/core/channel/channel_stack_builder_test.c \
+    test/core/channel/channel_stack_builder_test.cc \
 
 GRPC_CHANNEL_STACK_BUILDER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_CHANNEL_STACK_BUILDER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10768,7 +10591,7 @@
 
 
 GRPC_CHANNEL_STACK_TEST_SRC = \
-    test/core/channel/channel_stack_test.c \
+    test/core/channel/channel_stack_test.cc \
 
 GRPC_CHANNEL_STACK_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_CHANNEL_STACK_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10800,7 +10623,7 @@
 
 
 GRPC_COMPLETION_QUEUE_TEST_SRC = \
-    test/core/surface/completion_queue_test.c \
+    test/core/surface/completion_queue_test.cc \
 
 GRPC_COMPLETION_QUEUE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_COMPLETION_QUEUE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10832,7 +10655,7 @@
 
 
 GRPC_COMPLETION_QUEUE_THREADING_TEST_SRC = \
-    test/core/surface/completion_queue_threading_test.c \
+    test/core/surface/completion_queue_threading_test.cc \
 
 GRPC_COMPLETION_QUEUE_THREADING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_COMPLETION_QUEUE_THREADING_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10864,7 +10687,7 @@
 
 
 GRPC_CREATE_JWT_SRC = \
-    test/core/security/create_jwt.c \
+    test/core/security/create_jwt.cc \
 
 GRPC_CREATE_JWT_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_CREATE_JWT_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10896,7 +10719,7 @@
 
 
 GRPC_CREDENTIALS_TEST_SRC = \
-    test/core/security/credentials_test.c \
+    test/core/security/credentials_test.cc \
 
 GRPC_CREDENTIALS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_CREDENTIALS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10928,7 +10751,7 @@
 
 
 GRPC_FETCH_OAUTH2_SRC = \
-    test/core/security/fetch_oauth2.c \
+    test/core/security/fetch_oauth2.cc \
 
 GRPC_FETCH_OAUTH2_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_FETCH_OAUTH2_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10960,7 +10783,7 @@
 
 
 GRPC_INVALID_CHANNEL_ARGS_TEST_SRC = \
-    test/core/surface/invalid_channel_args_test.c \
+    test/core/surface/invalid_channel_args_test.cc \
 
 GRPC_INVALID_CHANNEL_ARGS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_INVALID_CHANNEL_ARGS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -10992,7 +10815,7 @@
 
 
 GRPC_JSON_TOKEN_TEST_SRC = \
-    test/core/security/json_token_test.c \
+    test/core/security/json_token_test.cc \
 
 GRPC_JSON_TOKEN_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_JSON_TOKEN_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11024,7 +10847,7 @@
 
 
 GRPC_JWT_VERIFIER_TEST_SRC = \
-    test/core/security/jwt_verifier_test.c \
+    test/core/security/jwt_verifier_test.cc \
 
 GRPC_JWT_VERIFIER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_JWT_VERIFIER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11056,7 +10879,7 @@
 
 
 GRPC_PRINT_GOOGLE_DEFAULT_CREDS_TOKEN_SRC = \
-    test/core/security/print_google_default_creds_token.c \
+    test/core/security/print_google_default_creds_token.cc \
 
 GRPC_PRINT_GOOGLE_DEFAULT_CREDS_TOKEN_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_PRINT_GOOGLE_DEFAULT_CREDS_TOKEN_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11088,7 +10911,7 @@
 
 
 GRPC_SECURITY_CONNECTOR_TEST_SRC = \
-    test/core/security/security_connector_test.c \
+    test/core/security/security_connector_test.cc \
 
 GRPC_SECURITY_CONNECTOR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_SECURITY_CONNECTOR_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11119,8 +10942,40 @@
 endif
 
 
+GRPC_SSL_CREDENTIALS_TEST_SRC = \
+    test/core/security/ssl_credentials_test.cc \
+
+GRPC_SSL_CREDENTIALS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_SSL_CREDENTIALS_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/grpc_ssl_credentials_test: openssl_dep_error
+
+else
+
+
+
+$(BINDIR)/$(CONFIG)/grpc_ssl_credentials_test: $(GRPC_SSL_CREDENTIALS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+	$(E) "[LD]      Linking $@"
+	$(Q) mkdir -p `dirname $@`
+	$(Q) $(LD) $(LDFLAGS) $(GRPC_SSL_CREDENTIALS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/grpc_ssl_credentials_test
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/security/ssl_credentials_test.o:  $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+
+deps_grpc_ssl_credentials_test: $(GRPC_SSL_CREDENTIALS_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(GRPC_SSL_CREDENTIALS_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
 GRPC_VERIFY_JWT_SRC = \
-    test/core/security/verify_jwt.c \
+    test/core/security/verify_jwt.cc \
 
 GRPC_VERIFY_JWT_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_VERIFY_JWT_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11152,7 +11007,7 @@
 
 
 HANDSHAKE_CLIENT_SRC = \
-    test/core/handshake/client_ssl.c \
+    test/core/handshake/client_ssl.cc \
 
 HANDSHAKE_CLIENT_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HANDSHAKE_CLIENT_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11184,7 +11039,7 @@
 
 
 HANDSHAKE_SERVER_SRC = \
-    test/core/handshake/server_ssl.c \
+    test/core/handshake/server_ssl.cc \
 
 HANDSHAKE_SERVER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HANDSHAKE_SERVER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11216,7 +11071,7 @@
 
 
 HPACK_PARSER_FUZZER_TEST_SRC = \
-    test/core/transport/chttp2/hpack_parser_fuzzer_test.c \
+    test/core/transport/chttp2/hpack_parser_fuzzer_test.cc \
 
 HPACK_PARSER_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HPACK_PARSER_FUZZER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11248,7 +11103,7 @@
 
 
 HPACK_PARSER_TEST_SRC = \
-    test/core/transport/chttp2/hpack_parser_test.c \
+    test/core/transport/chttp2/hpack_parser_test.cc \
 
 HPACK_PARSER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HPACK_PARSER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11280,7 +11135,7 @@
 
 
 HPACK_TABLE_TEST_SRC = \
-    test/core/transport/chttp2/hpack_table_test.c \
+    test/core/transport/chttp2/hpack_table_test.cc \
 
 HPACK_TABLE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HPACK_TABLE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11312,7 +11167,7 @@
 
 
 HTTP_PARSER_TEST_SRC = \
-    test/core/http/parser_test.c \
+    test/core/http/parser_test.cc \
 
 HTTP_PARSER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTP_PARSER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11344,7 +11199,7 @@
 
 
 HTTP_REQUEST_FUZZER_TEST_SRC = \
-    test/core/http/request_fuzzer.c \
+    test/core/http/request_fuzzer.cc \
 
 HTTP_REQUEST_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTP_REQUEST_FUZZER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11376,7 +11231,7 @@
 
 
 HTTP_RESPONSE_FUZZER_TEST_SRC = \
-    test/core/http/response_fuzzer.c \
+    test/core/http/response_fuzzer.cc \
 
 HTTP_RESPONSE_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTP_RESPONSE_FUZZER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11408,7 +11263,7 @@
 
 
 HTTPCLI_FORMAT_REQUEST_TEST_SRC = \
-    test/core/http/format_request_test.c \
+    test/core/http/format_request_test.cc \
 
 HTTPCLI_FORMAT_REQUEST_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPCLI_FORMAT_REQUEST_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11440,7 +11295,7 @@
 
 
 HTTPCLI_TEST_SRC = \
-    test/core/http/httpcli_test.c \
+    test/core/http/httpcli_test.cc \
 
 HTTPCLI_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPCLI_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11472,7 +11327,7 @@
 
 
 HTTPSCLI_TEST_SRC = \
-    test/core/http/httpscli_test.c \
+    test/core/http/httpscli_test.cc \
 
 HTTPSCLI_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPSCLI_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11504,7 +11359,7 @@
 
 
 INIT_TEST_SRC = \
-    test/core/surface/init_test.c \
+    test/core/surface/init_test.cc \
 
 INIT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(INIT_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11536,7 +11391,7 @@
 
 
 INVALID_CALL_ARGUMENT_TEST_SRC = \
-    test/core/end2end/invalid_call_argument_test.c \
+    test/core/end2end/invalid_call_argument_test.cc \
 
 INVALID_CALL_ARGUMENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(INVALID_CALL_ARGUMENT_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11568,7 +11423,7 @@
 
 
 JSON_FUZZER_TEST_SRC = \
-    test/core/json/fuzzer.c \
+    test/core/json/fuzzer.cc \
 
 JSON_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_FUZZER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11600,7 +11455,7 @@
 
 
 JSON_REWRITE_SRC = \
-    test/core/json/json_rewrite.c \
+    test/core/json/json_rewrite.cc \
 
 JSON_REWRITE_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_REWRITE_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11632,7 +11487,7 @@
 
 
 JSON_REWRITE_TEST_SRC = \
-    test/core/json/json_rewrite_test.c \
+    test/core/json/json_rewrite_test.cc \
 
 JSON_REWRITE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_REWRITE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11664,7 +11519,7 @@
 
 
 JSON_STREAM_ERROR_TEST_SRC = \
-    test/core/json/json_stream_error_test.c \
+    test/core/json/json_stream_error_test.cc \
 
 JSON_STREAM_ERROR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_STREAM_ERROR_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11696,7 +11551,7 @@
 
 
 JSON_TEST_SRC = \
-    test/core/json/json_test.c \
+    test/core/json/json_test.cc \
 
 JSON_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11728,7 +11583,7 @@
 
 
 LAME_CLIENT_TEST_SRC = \
-    test/core/surface/lame_client_test.c \
+    test/core/surface/lame_client_test.cc \
 
 LAME_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LAME_CLIENT_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11760,7 +11615,7 @@
 
 
 LB_POLICIES_TEST_SRC = \
-    test/core/client_channel/lb_policies_test.c \
+    test/core/client_channel/lb_policies_test.cc \
 
 LB_POLICIES_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LB_POLICIES_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11792,7 +11647,7 @@
 
 
 LOAD_FILE_TEST_SRC = \
-    test/core/iomgr/load_file_test.c \
+    test/core/iomgr/load_file_test.cc \
 
 LOAD_FILE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LOAD_FILE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11824,7 +11679,7 @@
 
 
 LOW_LEVEL_PING_PONG_BENCHMARK_SRC = \
-    test/core/network_benchmarks/low_level_ping_pong.c \
+    test/core/network_benchmarks/low_level_ping_pong.cc \
 
 LOW_LEVEL_PING_PONG_BENCHMARK_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LOW_LEVEL_PING_PONG_BENCHMARK_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11856,7 +11711,7 @@
 
 
 MEMORY_PROFILE_CLIENT_SRC = \
-    test/core/memory_usage/client.c \
+    test/core/memory_usage/client.cc \
 
 MEMORY_PROFILE_CLIENT_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MEMORY_PROFILE_CLIENT_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11888,7 +11743,7 @@
 
 
 MEMORY_PROFILE_SERVER_SRC = \
-    test/core/memory_usage/server.c \
+    test/core/memory_usage/server.cc \
 
 MEMORY_PROFILE_SERVER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MEMORY_PROFILE_SERVER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11920,7 +11775,7 @@
 
 
 MEMORY_PROFILE_TEST_SRC = \
-    test/core/memory_usage/memory_usage_test.c \
+    test/core/memory_usage/memory_usage_test.cc \
 
 MEMORY_PROFILE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MEMORY_PROFILE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11952,7 +11807,7 @@
 
 
 MESSAGE_COMPRESS_TEST_SRC = \
-    test/core/compression/message_compress_test.c \
+    test/core/compression/message_compress_test.cc \
 
 MESSAGE_COMPRESS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MESSAGE_COMPRESS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -11984,7 +11839,7 @@
 
 
 MINIMAL_STACK_IS_MINIMAL_TEST_SRC = \
-    test/core/channel/minimal_stack_is_minimal_test.c \
+    test/core/channel/minimal_stack_is_minimal_test.cc \
 
 MINIMAL_STACK_IS_MINIMAL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MINIMAL_STACK_IS_MINIMAL_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12015,40 +11870,8 @@
 endif
 
 
-MLOG_TEST_SRC = \
-    test/core/census/mlog_test.c \
-
-MLOG_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MLOG_TEST_SRC))))
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure targets if you don't have OpenSSL.
-
-$(BINDIR)/$(CONFIG)/mlog_test: openssl_dep_error
-
-else
-
-
-
-$(BINDIR)/$(CONFIG)/mlog_test: $(MLOG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-	$(E) "[LD]      Linking $@"
-	$(Q) mkdir -p `dirname $@`
-	$(Q) $(LD) $(LDFLAGS) $(MLOG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/mlog_test
-
-endif
-
-$(OBJDIR)/$(CONFIG)/test/core/census/mlog_test.o:  $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
-
-deps_mlog_test: $(MLOG_TEST_OBJS:.o=.dep)
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(MLOG_TEST_OBJS:.o=.dep)
-endif
-endif
-
-
 MULTIPLE_SERVER_QUEUES_TEST_SRC = \
-    test/core/end2end/multiple_server_queues_test.c \
+    test/core/end2end/multiple_server_queues_test.cc \
 
 MULTIPLE_SERVER_QUEUES_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MULTIPLE_SERVER_QUEUES_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12080,7 +11903,7 @@
 
 
 MURMUR_HASH_TEST_SRC = \
-    test/core/support/murmur_hash_test.c \
+    test/core/support/murmur_hash_test.cc \
 
 MURMUR_HASH_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MURMUR_HASH_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12112,7 +11935,7 @@
 
 
 NANOPB_FUZZER_RESPONSE_TEST_SRC = \
-    test/core/nanopb/fuzzer_response.c \
+    test/core/nanopb/fuzzer_response.cc \
 
 NANOPB_FUZZER_RESPONSE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(NANOPB_FUZZER_RESPONSE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12144,7 +11967,7 @@
 
 
 NANOPB_FUZZER_SERVERLIST_TEST_SRC = \
-    test/core/nanopb/fuzzer_serverlist.c \
+    test/core/nanopb/fuzzer_serverlist.cc \
 
 NANOPB_FUZZER_SERVERLIST_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(NANOPB_FUZZER_SERVERLIST_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12176,7 +11999,7 @@
 
 
 NO_SERVER_TEST_SRC = \
-    test/core/end2end/no_server_test.c \
+    test/core/end2end/no_server_test.cc \
 
 NO_SERVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(NO_SERVER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12208,7 +12031,7 @@
 
 
 NUM_EXTERNAL_CONNECTIVITY_WATCHERS_TEST_SRC = \
-    test/core/surface/num_external_connectivity_watchers_test.c \
+    test/core/surface/num_external_connectivity_watchers_test.cc \
 
 NUM_EXTERNAL_CONNECTIVITY_WATCHERS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(NUM_EXTERNAL_CONNECTIVITY_WATCHERS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12240,7 +12063,7 @@
 
 
 PARSE_ADDRESS_TEST_SRC = \
-    test/core/client_channel/parse_address_test.c \
+    test/core/client_channel/parse_address_test.cc \
 
 PARSE_ADDRESS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PARSE_ADDRESS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12272,7 +12095,7 @@
 
 
 PERCENT_DECODE_FUZZER_SRC = \
-    test/core/slice/percent_decode_fuzzer.c \
+    test/core/slice/percent_decode_fuzzer.cc \
 
 PERCENT_DECODE_FUZZER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PERCENT_DECODE_FUZZER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12304,7 +12127,7 @@
 
 
 PERCENT_ENCODE_FUZZER_SRC = \
-    test/core/slice/percent_encode_fuzzer.c \
+    test/core/slice/percent_encode_fuzzer.cc \
 
 PERCENT_ENCODE_FUZZER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PERCENT_ENCODE_FUZZER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12336,7 +12159,7 @@
 
 
 PERCENT_ENCODING_TEST_SRC = \
-    test/core/slice/percent_encoding_test.c \
+    test/core/slice/percent_encoding_test.cc \
 
 PERCENT_ENCODING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PERCENT_ENCODING_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12368,7 +12191,7 @@
 
 
 POLLSET_SET_TEST_SRC = \
-    test/core/iomgr/pollset_set_test.c \
+    test/core/iomgr/pollset_set_test.cc \
 
 POLLSET_SET_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(POLLSET_SET_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12400,7 +12223,7 @@
 
 
 RESOLVE_ADDRESS_POSIX_TEST_SRC = \
-    test/core/iomgr/resolve_address_posix_test.c \
+    test/core/iomgr/resolve_address_posix_test.cc \
 
 RESOLVE_ADDRESS_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(RESOLVE_ADDRESS_POSIX_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12432,7 +12255,7 @@
 
 
 RESOLVE_ADDRESS_TEST_SRC = \
-    test/core/iomgr/resolve_address_test.c \
+    test/core/iomgr/resolve_address_test.cc \
 
 RESOLVE_ADDRESS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(RESOLVE_ADDRESS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12464,7 +12287,7 @@
 
 
 RESOURCE_QUOTA_TEST_SRC = \
-    test/core/iomgr/resource_quota_test.c \
+    test/core/iomgr/resource_quota_test.cc \
 
 RESOURCE_QUOTA_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(RESOURCE_QUOTA_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12496,7 +12319,7 @@
 
 
 SECURE_CHANNEL_CREATE_TEST_SRC = \
-    test/core/surface/secure_channel_create_test.c \
+    test/core/surface/secure_channel_create_test.cc \
 
 SECURE_CHANNEL_CREATE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SECURE_CHANNEL_CREATE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12528,7 +12351,7 @@
 
 
 SECURE_ENDPOINT_TEST_SRC = \
-    test/core/security/secure_endpoint_test.c \
+    test/core/security/secure_endpoint_test.cc \
 
 SECURE_ENDPOINT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SECURE_ENDPOINT_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12560,7 +12383,7 @@
 
 
 SEQUENTIAL_CONNECTIVITY_TEST_SRC = \
-    test/core/surface/sequential_connectivity_test.c \
+    test/core/surface/sequential_connectivity_test.cc \
 
 SEQUENTIAL_CONNECTIVITY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SEQUENTIAL_CONNECTIVITY_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12592,7 +12415,7 @@
 
 
 SERVER_CHTTP2_TEST_SRC = \
-    test/core/surface/server_chttp2_test.c \
+    test/core/surface/server_chttp2_test.cc \
 
 SERVER_CHTTP2_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_CHTTP2_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12624,7 +12447,7 @@
 
 
 SERVER_FUZZER_SRC = \
-    test/core/end2end/fuzzers/server_fuzzer.c \
+    test/core/end2end/fuzzers/server_fuzzer.cc \
 
 SERVER_FUZZER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_FUZZER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12656,7 +12479,7 @@
 
 
 SERVER_TEST_SRC = \
-    test/core/surface/server_test.c \
+    test/core/surface/server_test.cc \
 
 SERVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12688,7 +12511,7 @@
 
 
 SLICE_BUFFER_TEST_SRC = \
-    test/core/slice/slice_buffer_test.c \
+    test/core/slice/slice_buffer_test.cc \
 
 SLICE_BUFFER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SLICE_BUFFER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12720,7 +12543,7 @@
 
 
 SLICE_HASH_TABLE_TEST_SRC = \
-    test/core/slice/slice_hash_table_test.c \
+    test/core/slice/slice_hash_table_test.cc \
 
 SLICE_HASH_TABLE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SLICE_HASH_TABLE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12752,7 +12575,7 @@
 
 
 SLICE_STRING_HELPERS_TEST_SRC = \
-    test/core/slice/slice_string_helpers_test.c \
+    test/core/slice/slice_string_helpers_test.cc \
 
 SLICE_STRING_HELPERS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SLICE_STRING_HELPERS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12784,7 +12607,7 @@
 
 
 SLICE_TEST_SRC = \
-    test/core/slice/slice_test.c \
+    test/core/slice/slice_test.cc \
 
 SLICE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SLICE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12816,7 +12639,7 @@
 
 
 SOCKADDR_RESOLVER_TEST_SRC = \
-    test/core/client_channel/resolvers/sockaddr_resolver_test.c \
+    test/core/client_channel/resolvers/sockaddr_resolver_test.cc \
 
 SOCKADDR_RESOLVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SOCKADDR_RESOLVER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12848,7 +12671,7 @@
 
 
 SOCKADDR_UTILS_TEST_SRC = \
-    test/core/iomgr/sockaddr_utils_test.c \
+    test/core/iomgr/sockaddr_utils_test.cc \
 
 SOCKADDR_UTILS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SOCKADDR_UTILS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12880,7 +12703,7 @@
 
 
 SOCKET_UTILS_TEST_SRC = \
-    test/core/iomgr/socket_utils_test.c \
+    test/core/iomgr/socket_utils_test.cc \
 
 SOCKET_UTILS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SOCKET_UTILS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12912,7 +12735,7 @@
 
 
 SSL_SERVER_FUZZER_SRC = \
-    test/core/security/ssl_server_fuzzer.c \
+    test/core/security/ssl_server_fuzzer.cc \
 
 SSL_SERVER_FUZZER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SSL_SERVER_FUZZER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12944,8 +12767,8 @@
 
 
 SSL_TRANSPORT_SECURITY_TEST_SRC = \
-    test/core/tsi/ssl_transport_security_test.c \
-    test/core/tsi/transport_security_test_lib.c \
+    test/core/tsi/ssl_transport_security_test.cc \
+    test/core/tsi/transport_security_test_lib.cc \
 
 SSL_TRANSPORT_SECURITY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SSL_TRANSPORT_SECURITY_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -12979,7 +12802,7 @@
 
 
 STATUS_CONVERSION_TEST_SRC = \
-    test/core/transport/status_conversion_test.c \
+    test/core/transport/status_conversion_test.cc \
 
 STATUS_CONVERSION_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(STATUS_CONVERSION_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13011,7 +12834,7 @@
 
 
 STREAM_COMPRESSION_TEST_SRC = \
-    test/core/compression/stream_compression_test.c \
+    test/core/compression/stream_compression_test.cc \
 
 STREAM_COMPRESSION_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(STREAM_COMPRESSION_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13043,7 +12866,7 @@
 
 
 STREAM_OWNED_SLICE_TEST_SRC = \
-    test/core/transport/stream_owned_slice_test.c \
+    test/core/transport/stream_owned_slice_test.cc \
 
 STREAM_OWNED_SLICE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(STREAM_OWNED_SLICE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13075,7 +12898,7 @@
 
 
 TCP_CLIENT_POSIX_TEST_SRC = \
-    test/core/iomgr/tcp_client_posix_test.c \
+    test/core/iomgr/tcp_client_posix_test.cc \
 
 TCP_CLIENT_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TCP_CLIENT_POSIX_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13107,7 +12930,7 @@
 
 
 TCP_CLIENT_UV_TEST_SRC = \
-    test/core/iomgr/tcp_client_uv_test.c \
+    test/core/iomgr/tcp_client_uv_test.cc \
 
 TCP_CLIENT_UV_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TCP_CLIENT_UV_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13139,7 +12962,7 @@
 
 
 TCP_POSIX_TEST_SRC = \
-    test/core/iomgr/tcp_posix_test.c \
+    test/core/iomgr/tcp_posix_test.cc \
 
 TCP_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TCP_POSIX_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13171,7 +12994,7 @@
 
 
 TCP_SERVER_POSIX_TEST_SRC = \
-    test/core/iomgr/tcp_server_posix_test.c \
+    test/core/iomgr/tcp_server_posix_test.cc \
 
 TCP_SERVER_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TCP_SERVER_POSIX_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13203,7 +13026,7 @@
 
 
 TCP_SERVER_UV_TEST_SRC = \
-    test/core/iomgr/tcp_server_uv_test.c \
+    test/core/iomgr/tcp_server_uv_test.cc \
 
 TCP_SERVER_UV_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TCP_SERVER_UV_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13235,7 +13058,7 @@
 
 
 TIME_AVERAGED_STATS_TEST_SRC = \
-    test/core/iomgr/time_averaged_stats_test.c \
+    test/core/iomgr/time_averaged_stats_test.cc \
 
 TIME_AVERAGED_STATS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TIME_AVERAGED_STATS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13267,7 +13090,7 @@
 
 
 TIMEOUT_ENCODING_TEST_SRC = \
-    test/core/transport/timeout_encoding_test.c \
+    test/core/transport/timeout_encoding_test.cc \
 
 TIMEOUT_ENCODING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TIMEOUT_ENCODING_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13299,7 +13122,7 @@
 
 
 TIMER_HEAP_TEST_SRC = \
-    test/core/iomgr/timer_heap_test.c \
+    test/core/iomgr/timer_heap_test.cc \
 
 TIMER_HEAP_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TIMER_HEAP_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13331,7 +13154,7 @@
 
 
 TIMER_LIST_TEST_SRC = \
-    test/core/iomgr/timer_list_test.c \
+    test/core/iomgr/timer_list_test.cc \
 
 TIMER_LIST_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TIMER_LIST_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13363,7 +13186,7 @@
 
 
 TRANSPORT_CONNECTIVITY_STATE_TEST_SRC = \
-    test/core/transport/connectivity_state_test.c \
+    test/core/transport/connectivity_state_test.cc \
 
 TRANSPORT_CONNECTIVITY_STATE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TRANSPORT_CONNECTIVITY_STATE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13395,7 +13218,7 @@
 
 
 TRANSPORT_METADATA_TEST_SRC = \
-    test/core/transport/metadata_test.c \
+    test/core/transport/metadata_test.cc \
 
 TRANSPORT_METADATA_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TRANSPORT_METADATA_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13427,7 +13250,7 @@
 
 
 TRANSPORT_SECURITY_TEST_SRC = \
-    test/core/tsi/transport_security_test.c \
+    test/core/tsi/transport_security_test.cc \
 
 TRANSPORT_SECURITY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TRANSPORT_SECURITY_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13459,7 +13282,7 @@
 
 
 UDP_SERVER_TEST_SRC = \
-    test/core/iomgr/udp_server_test.c \
+    test/core/iomgr/udp_server_test.cc \
 
 UDP_SERVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(UDP_SERVER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13491,7 +13314,7 @@
 
 
 URI_FUZZER_TEST_SRC = \
-    test/core/client_channel/uri_fuzzer_test.c \
+    test/core/client_channel/uri_fuzzer_test.cc \
 
 URI_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_FUZZER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13523,7 +13346,7 @@
 
 
 URI_PARSER_TEST_SRC = \
-    test/core/client_channel/uri_parser_test.c \
+    test/core/client_channel/uri_parser_test.cc \
 
 URI_PARSER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_PARSER_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -13555,7 +13378,7 @@
 
 
 WAKEUP_FD_CV_TEST_SRC = \
-    test/core/iomgr/wakeup_fd_cv_test.c \
+    test/core/iomgr/wakeup_fd_cv_test.cc \
 
 WAKEUP_FD_CV_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(WAKEUP_FD_CV_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18487,7 +18310,7 @@
 
 
 BADREQ_BAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/tests/badreq.c \
+    test/core/bad_client/tests/badreq.cc \
 
 BADREQ_BAD_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BADREQ_BAD_CLIENT_TEST_SRC))))
 
@@ -18507,7 +18330,7 @@
 
 
 CONNECTION_PREFIX_BAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/tests/connection_prefix.c \
+    test/core/bad_client/tests/connection_prefix.cc \
 
 CONNECTION_PREFIX_BAD_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CONNECTION_PREFIX_BAD_CLIENT_TEST_SRC))))
 
@@ -18527,7 +18350,7 @@
 
 
 HEAD_OF_LINE_BLOCKING_BAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/tests/head_of_line_blocking.c \
+    test/core/bad_client/tests/head_of_line_blocking.cc \
 
 HEAD_OF_LINE_BLOCKING_BAD_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HEAD_OF_LINE_BLOCKING_BAD_CLIENT_TEST_SRC))))
 
@@ -18547,7 +18370,7 @@
 
 
 HEADERS_BAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/tests/headers.c \
+    test/core/bad_client/tests/headers.cc \
 
 HEADERS_BAD_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HEADERS_BAD_CLIENT_TEST_SRC))))
 
@@ -18567,7 +18390,7 @@
 
 
 INITIAL_SETTINGS_FRAME_BAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/tests/initial_settings_frame.c \
+    test/core/bad_client/tests/initial_settings_frame.cc \
 
 INITIAL_SETTINGS_FRAME_BAD_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(INITIAL_SETTINGS_FRAME_BAD_CLIENT_TEST_SRC))))
 
@@ -18587,7 +18410,7 @@
 
 
 SERVER_REGISTERED_METHOD_BAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/tests/server_registered_method.c \
+    test/core/bad_client/tests/server_registered_method.cc \
 
 SERVER_REGISTERED_METHOD_BAD_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_REGISTERED_METHOD_BAD_CLIENT_TEST_SRC))))
 
@@ -18607,7 +18430,7 @@
 
 
 SIMPLE_REQUEST_BAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/tests/simple_request.c \
+    test/core/bad_client/tests/simple_request.cc \
 
 SIMPLE_REQUEST_BAD_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SIMPLE_REQUEST_BAD_CLIENT_TEST_SRC))))
 
@@ -18627,7 +18450,7 @@
 
 
 UNKNOWN_FRAME_BAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/tests/unknown_frame.c \
+    test/core/bad_client/tests/unknown_frame.cc \
 
 UNKNOWN_FRAME_BAD_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(UNKNOWN_FRAME_BAD_CLIENT_TEST_SRC))))
 
@@ -18647,7 +18470,7 @@
 
 
 WINDOW_OVERFLOW_BAD_CLIENT_TEST_SRC = \
-    test/core/bad_client/tests/window_overflow.c \
+    test/core/bad_client/tests/window_overflow.cc \
 
 WINDOW_OVERFLOW_BAD_CLIENT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(WINDOW_OVERFLOW_BAD_CLIENT_TEST_SRC))))
 
@@ -18667,7 +18490,7 @@
 
 
 BAD_SSL_CERT_SERVER_SRC = \
-    test/core/bad_ssl/servers/cert.c \
+    test/core/bad_ssl/servers/cert.cc \
 
 BAD_SSL_CERT_SERVER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BAD_SSL_CERT_SERVER_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18699,7 +18522,7 @@
 
 
 BAD_SSL_CERT_TEST_SRC = \
-    test/core/bad_ssl/bad_ssl_test.c \
+    test/core/bad_ssl/bad_ssl_test.cc \
 
 BAD_SSL_CERT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BAD_SSL_CERT_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18731,7 +18554,7 @@
 
 
 H2_CENSUS_TEST_SRC = \
-    test/core/end2end/fixtures/h2_census.c \
+    test/core/end2end/fixtures/h2_census.cc \
 
 H2_CENSUS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_CENSUS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18763,7 +18586,7 @@
 
 
 H2_COMPRESS_TEST_SRC = \
-    test/core/end2end/fixtures/h2_compress.c \
+    test/core/end2end/fixtures/h2_compress.cc \
 
 H2_COMPRESS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_COMPRESS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18795,7 +18618,7 @@
 
 
 H2_FAKESEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_fakesec.c \
+    test/core/end2end/fixtures/h2_fakesec.cc \
 
 H2_FAKESEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FAKESEC_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18827,7 +18650,7 @@
 
 
 H2_FD_TEST_SRC = \
-    test/core/end2end/fixtures/h2_fd.c \
+    test/core/end2end/fixtures/h2_fd.cc \
 
 H2_FD_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FD_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18859,7 +18682,7 @@
 
 
 H2_FULL_TEST_SRC = \
-    test/core/end2end/fixtures/h2_full.c \
+    test/core/end2end/fixtures/h2_full.cc \
 
 H2_FULL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18891,7 +18714,7 @@
 
 
 H2_FULL+PIPE_TEST_SRC = \
-    test/core/end2end/fixtures/h2_full+pipe.c \
+    test/core/end2end/fixtures/h2_full+pipe.cc \
 
 H2_FULL+PIPE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+PIPE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18923,7 +18746,7 @@
 
 
 H2_FULL+TRACE_TEST_SRC = \
-    test/core/end2end/fixtures/h2_full+trace.c \
+    test/core/end2end/fixtures/h2_full+trace.cc \
 
 H2_FULL+TRACE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+TRACE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18955,7 +18778,7 @@
 
 
 H2_FULL+WORKAROUNDS_TEST_SRC = \
-    test/core/end2end/fixtures/h2_full+workarounds.c \
+    test/core/end2end/fixtures/h2_full+workarounds.cc \
 
 H2_FULL+WORKAROUNDS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+WORKAROUNDS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -18987,7 +18810,7 @@
 
 
 H2_HTTP_PROXY_TEST_SRC = \
-    test/core/end2end/fixtures/h2_http_proxy.c \
+    test/core/end2end/fixtures/h2_http_proxy.cc \
 
 H2_HTTP_PROXY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_HTTP_PROXY_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19019,7 +18842,7 @@
 
 
 H2_LOAD_REPORTING_TEST_SRC = \
-    test/core/end2end/fixtures/h2_load_reporting.c \
+    test/core/end2end/fixtures/h2_load_reporting.cc \
 
 H2_LOAD_REPORTING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOAD_REPORTING_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19051,7 +18874,7 @@
 
 
 H2_OAUTH2_TEST_SRC = \
-    test/core/end2end/fixtures/h2_oauth2.c \
+    test/core/end2end/fixtures/h2_oauth2.cc \
 
 H2_OAUTH2_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_OAUTH2_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19083,7 +18906,7 @@
 
 
 H2_PROXY_TEST_SRC = \
-    test/core/end2end/fixtures/h2_proxy.c \
+    test/core/end2end/fixtures/h2_proxy.cc \
 
 H2_PROXY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_PROXY_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19115,7 +18938,7 @@
 
 
 H2_SOCKPAIR_TEST_SRC = \
-    test/core/end2end/fixtures/h2_sockpair.c \
+    test/core/end2end/fixtures/h2_sockpair.cc \
 
 H2_SOCKPAIR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_SOCKPAIR_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19147,7 +18970,7 @@
 
 
 H2_SOCKPAIR+TRACE_TEST_SRC = \
-    test/core/end2end/fixtures/h2_sockpair+trace.c \
+    test/core/end2end/fixtures/h2_sockpair+trace.cc \
 
 H2_SOCKPAIR+TRACE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_SOCKPAIR+TRACE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19179,7 +19002,7 @@
 
 
 H2_SOCKPAIR_1BYTE_TEST_SRC = \
-    test/core/end2end/fixtures/h2_sockpair_1byte.c \
+    test/core/end2end/fixtures/h2_sockpair_1byte.cc \
 
 H2_SOCKPAIR_1BYTE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_SOCKPAIR_1BYTE_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19211,7 +19034,7 @@
 
 
 H2_SSL_TEST_SRC = \
-    test/core/end2end/fixtures/h2_ssl.c \
+    test/core/end2end/fixtures/h2_ssl.cc \
 
 H2_SSL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_SSL_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19243,7 +19066,7 @@
 
 
 H2_SSL_PROXY_TEST_SRC = \
-    test/core/end2end/fixtures/h2_ssl_proxy.c \
+    test/core/end2end/fixtures/h2_ssl_proxy.cc \
 
 H2_SSL_PROXY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_SSL_PROXY_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19275,7 +19098,7 @@
 
 
 H2_UDS_TEST_SRC = \
-    test/core/end2end/fixtures/h2_uds.c \
+    test/core/end2end/fixtures/h2_uds.cc \
 
 H2_UDS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_UDS_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19307,7 +19130,7 @@
 
 
 INPROC_TEST_SRC = \
-    test/core/end2end/fixtures/inproc.c \
+    test/core/end2end/fixtures/inproc.cc \
 
 INPROC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(INPROC_TEST_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19339,7 +19162,7 @@
 
 
 H2_CENSUS_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_census.c \
+    test/core/end2end/fixtures/h2_census.cc \
 
 H2_CENSUS_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_CENSUS_NOSEC_TEST_SRC))))
 
@@ -19359,7 +19182,7 @@
 
 
 H2_COMPRESS_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_compress.c \
+    test/core/end2end/fixtures/h2_compress.cc \
 
 H2_COMPRESS_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_COMPRESS_NOSEC_TEST_SRC))))
 
@@ -19379,7 +19202,7 @@
 
 
 H2_FD_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_fd.c \
+    test/core/end2end/fixtures/h2_fd.cc \
 
 H2_FD_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FD_NOSEC_TEST_SRC))))
 
@@ -19399,7 +19222,7 @@
 
 
 H2_FULL_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_full.c \
+    test/core/end2end/fixtures/h2_full.cc \
 
 H2_FULL_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL_NOSEC_TEST_SRC))))
 
@@ -19419,7 +19242,7 @@
 
 
 H2_FULL+PIPE_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_full+pipe.c \
+    test/core/end2end/fixtures/h2_full+pipe.cc \
 
 H2_FULL+PIPE_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+PIPE_NOSEC_TEST_SRC))))
 
@@ -19439,7 +19262,7 @@
 
 
 H2_FULL+TRACE_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_full+trace.c \
+    test/core/end2end/fixtures/h2_full+trace.cc \
 
 H2_FULL+TRACE_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+TRACE_NOSEC_TEST_SRC))))
 
@@ -19459,7 +19282,7 @@
 
 
 H2_FULL+WORKAROUNDS_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_full+workarounds.c \
+    test/core/end2end/fixtures/h2_full+workarounds.cc \
 
 H2_FULL+WORKAROUNDS_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_FULL+WORKAROUNDS_NOSEC_TEST_SRC))))
 
@@ -19479,7 +19302,7 @@
 
 
 H2_HTTP_PROXY_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_http_proxy.c \
+    test/core/end2end/fixtures/h2_http_proxy.cc \
 
 H2_HTTP_PROXY_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_HTTP_PROXY_NOSEC_TEST_SRC))))
 
@@ -19499,7 +19322,7 @@
 
 
 H2_LOAD_REPORTING_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_load_reporting.c \
+    test/core/end2end/fixtures/h2_load_reporting.cc \
 
 H2_LOAD_REPORTING_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOAD_REPORTING_NOSEC_TEST_SRC))))
 
@@ -19519,7 +19342,7 @@
 
 
 H2_PROXY_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_proxy.c \
+    test/core/end2end/fixtures/h2_proxy.cc \
 
 H2_PROXY_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_PROXY_NOSEC_TEST_SRC))))
 
@@ -19539,7 +19362,7 @@
 
 
 H2_SOCKPAIR_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_sockpair.c \
+    test/core/end2end/fixtures/h2_sockpair.cc \
 
 H2_SOCKPAIR_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_SOCKPAIR_NOSEC_TEST_SRC))))
 
@@ -19559,7 +19382,7 @@
 
 
 H2_SOCKPAIR+TRACE_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_sockpair+trace.c \
+    test/core/end2end/fixtures/h2_sockpair+trace.cc \
 
 H2_SOCKPAIR+TRACE_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_SOCKPAIR+TRACE_NOSEC_TEST_SRC))))
 
@@ -19579,7 +19402,7 @@
 
 
 H2_SOCKPAIR_1BYTE_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_sockpair_1byte.c \
+    test/core/end2end/fixtures/h2_sockpair_1byte.cc \
 
 H2_SOCKPAIR_1BYTE_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_SOCKPAIR_1BYTE_NOSEC_TEST_SRC))))
 
@@ -19599,7 +19422,7 @@
 
 
 H2_UDS_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/h2_uds.c \
+    test/core/end2end/fixtures/h2_uds.cc \
 
 H2_UDS_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_UDS_NOSEC_TEST_SRC))))
 
@@ -19619,7 +19442,7 @@
 
 
 INPROC_NOSEC_TEST_SRC = \
-    test/core/end2end/fixtures/inproc.c \
+    test/core/end2end/fixtures/inproc.cc \
 
 INPROC_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(INPROC_NOSEC_TEST_SRC))))
 
@@ -19811,8 +19634,8 @@
 
 
 API_FUZZER_ONE_ENTRY_SRC = \
-    test/core/end2end/fuzzers/api_fuzzer.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/end2end/fuzzers/api_fuzzer.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 API_FUZZER_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(API_FUZZER_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19846,8 +19669,8 @@
 
 
 CLIENT_FUZZER_ONE_ENTRY_SRC = \
-    test/core/end2end/fuzzers/client_fuzzer.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/end2end/fuzzers/client_fuzzer.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 CLIENT_FUZZER_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CLIENT_FUZZER_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19881,8 +19704,8 @@
 
 
 HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_SRC = \
-    test/core/transport/chttp2/hpack_parser_fuzzer_test.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/transport/chttp2/hpack_parser_fuzzer_test.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19916,8 +19739,8 @@
 
 
 HTTP_REQUEST_FUZZER_TEST_ONE_ENTRY_SRC = \
-    test/core/http/request_fuzzer.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/http/request_fuzzer.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 HTTP_REQUEST_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTP_REQUEST_FUZZER_TEST_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19951,8 +19774,8 @@
 
 
 HTTP_RESPONSE_FUZZER_TEST_ONE_ENTRY_SRC = \
-    test/core/http/response_fuzzer.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/http/response_fuzzer.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 HTTP_RESPONSE_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTP_RESPONSE_FUZZER_TEST_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -19986,8 +19809,8 @@
 
 
 JSON_FUZZER_TEST_ONE_ENTRY_SRC = \
-    test/core/json/fuzzer.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/json/fuzzer.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 JSON_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_FUZZER_TEST_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -20021,8 +19844,8 @@
 
 
 NANOPB_FUZZER_RESPONSE_TEST_ONE_ENTRY_SRC = \
-    test/core/nanopb/fuzzer_response.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/nanopb/fuzzer_response.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 NANOPB_FUZZER_RESPONSE_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(NANOPB_FUZZER_RESPONSE_TEST_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -20056,8 +19879,8 @@
 
 
 NANOPB_FUZZER_SERVERLIST_TEST_ONE_ENTRY_SRC = \
-    test/core/nanopb/fuzzer_serverlist.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/nanopb/fuzzer_serverlist.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 NANOPB_FUZZER_SERVERLIST_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(NANOPB_FUZZER_SERVERLIST_TEST_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -20091,8 +19914,8 @@
 
 
 PERCENT_DECODE_FUZZER_ONE_ENTRY_SRC = \
-    test/core/slice/percent_decode_fuzzer.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/slice/percent_decode_fuzzer.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 PERCENT_DECODE_FUZZER_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PERCENT_DECODE_FUZZER_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -20126,8 +19949,8 @@
 
 
 PERCENT_ENCODE_FUZZER_ONE_ENTRY_SRC = \
-    test/core/slice/percent_encode_fuzzer.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/slice/percent_encode_fuzzer.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 PERCENT_ENCODE_FUZZER_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PERCENT_ENCODE_FUZZER_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -20161,8 +19984,8 @@
 
 
 SERVER_FUZZER_ONE_ENTRY_SRC = \
-    test/core/end2end/fuzzers/server_fuzzer.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/end2end/fuzzers/server_fuzzer.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 SERVER_FUZZER_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_FUZZER_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -20196,8 +20019,8 @@
 
 
 SSL_SERVER_FUZZER_ONE_ENTRY_SRC = \
-    test/core/security/ssl_server_fuzzer.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/security/ssl_server_fuzzer.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 SSL_SERVER_FUZZER_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SSL_SERVER_FUZZER_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -20231,8 +20054,8 @@
 
 
 URI_FUZZER_TEST_ONE_ENTRY_SRC = \
-    test/core/client_channel/uri_fuzzer_test.c \
-    test/core/util/one_corpus_entry_fuzzer.c \
+    test/core/client_channel/uri_fuzzer_test.cc \
+    test/core/util/one_corpus_entry_fuzzer.cc \
 
 URI_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_FUZZER_TEST_ONE_ENTRY_SRC))))
 ifeq ($(NO_SECURE),true)
@@ -20323,17 +20146,17 @@
 src/cpp/util/core_stats.cc: $(OPENSSL_DEP)
 src/cpp/util/error_details.cc: $(OPENSSL_DEP)
 src/csharp/ext/grpc_csharp_ext.c: $(OPENSSL_DEP)
-test/core/bad_client/bad_client.c: $(OPENSSL_DEP)
-test/core/bad_ssl/server_common.c: $(OPENSSL_DEP)
-test/core/end2end/data/client_certs.c: $(OPENSSL_DEP)
-test/core/end2end/data/server1_cert.c: $(OPENSSL_DEP)
-test/core/end2end/data/server1_key.c: $(OPENSSL_DEP)
-test/core/end2end/data/test_root_cert.c: $(OPENSSL_DEP)
-test/core/end2end/end2end_tests.c: $(OPENSSL_DEP)
-test/core/end2end/tests/call_creds.c: $(OPENSSL_DEP)
-test/core/security/oauth2_utils.c: $(OPENSSL_DEP)
-test/core/util/reconnect_server.c: $(OPENSSL_DEP)
-test/core/util/test_tcp_server.c: $(OPENSSL_DEP)
+test/core/bad_client/bad_client.cc: $(OPENSSL_DEP)
+test/core/bad_ssl/server_common.cc: $(OPENSSL_DEP)
+test/core/end2end/data/client_certs.cc: $(OPENSSL_DEP)
+test/core/end2end/data/server1_cert.cc: $(OPENSSL_DEP)
+test/core/end2end/data/server1_key.cc: $(OPENSSL_DEP)
+test/core/end2end/data/test_root_cert.cc: $(OPENSSL_DEP)
+test/core/end2end/end2end_tests.cc: $(OPENSSL_DEP)
+test/core/end2end/tests/call_creds.cc: $(OPENSSL_DEP)
+test/core/security/oauth2_utils.cc: $(OPENSSL_DEP)
+test/core/util/reconnect_server.cc: $(OPENSSL_DEP)
+test/core/util/test_tcp_server.cc: $(OPENSSL_DEP)
 test/cpp/end2end/test_service_impl.cc: $(OPENSSL_DEP)
 test/cpp/interop/client.cc: $(OPENSSL_DEP)
 test/cpp/interop/client_helper.cc: $(OPENSSL_DEP)
diff --git a/WORKSPACE b/WORKSPACE
index 907cef1..5f87d68 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -24,6 +24,11 @@
 )
 
 bind(
+    name = "protobuf_headers",
+    actual = "@com_google_protobuf//:protobuf_headers",
+)
+
+bind(
     name = "protocol_compiler",
     actual = "@com_google_protobuf//:protoc",
 )
diff --git a/binding.gyp b/binding.gyp
deleted file mode 100644
index e004b0f..0000000
--- a/binding.gyp
+++ /dev/null
@@ -1,995 +0,0 @@
-# GRPC Node gyp file
-# This currently builds the Node extension and dependencies
-# This file has been automatically generated from a template file.
-# Please look at the templates directory instead.
-# This file can be regenerated from the template by running
-# tools/buildgen/generate_projects.sh
-
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Some of this file is built with the help of
-# https://n8.io/converting-a-c-library-to-gyp/
-{
-  'variables': {
-    'runtime%': 'node',
-    # Some Node installations use the system installation of OpenSSL, and on
-    # some systems, the system OpenSSL still does not have ALPN support. This
-    # will let users recompile gRPC to work without ALPN.
-    'grpc_alpn%': 'true',
-    # Indicates that the library should be built with gcov.
-    'grpc_gcov%': 'false',
-    # Indicates that the library should be built with compatibility for musl
-    # libc, so that it can run on Alpine Linux. This is only necessary if not
-    # building on Alpine Linux
-    'grpc_alpine%': 'false'
-  },
-  'target_defaults': {
-    'configurations': {
-      'Release': {
-        'cflags': [
-            '-O2',
-        ],
-        'defines': [
-            'NDEBUG',
-        ],
-      },
-      'Debug': {
-        'cflags': [
-            '-O0',
-        ],
-        'defines': [
-            '_DEBUG',
-            'DEBUG',
-        ],
-      },
-    },
-    'cflags': [
-        '-g',
-        '-Wall',
-        '-Wextra',
-        '-Werror',
-        '-Wno-long-long',
-        '-Wno-unused-parameter',
-        '-DOSATOMIC_USE_INLINED=1',
-        '-Ithird_party/abseil-cpp',
-    ],
-    'ldflags': [
-        '-g',
-    ],
-    'cflags_c': [
-      '-Werror',
-      '-std=c99'
-    ],
-    'cflags_cc': [
-      '-Werror',
-      '-std=c++11'
-    ],
-    'include_dirs': [
-      '.',
-      'include'
-    ],
-    'defines': [
-      'GPR_BACKWARDS_COMPATIBILITY_MODE',
-      'GRPC_ARES=0',
-      'GRPC_UV'
-    ],
-    'conditions': [
-      ['grpc_gcov=="true"', {
-        'cflags': [
-            '-O0',
-            '-fprofile-arcs',
-            '-ftest-coverage',
-            '-Wno-return-type',
-        ],
-        'defines': [
-            '_DEBUG',
-            'DEBUG',
-            'GPR_GCOV',
-        ],
-        'ldflags': [
-            '-fprofile-arcs',
-            '-ftest-coverage',
-            '-rdynamic',
-            '-lstdc++',
-        ],
-      }],
-      ['grpc_alpine=="true"', {
-        'defines': [
-          'GPR_MUSL_LIBC_COMPAT'
-        ]
-      }],
-      ['OS!="win" and runtime=="electron"', {
-        "defines": [
-          'OPENSSL_NO_THREADS'
-        ]
-      }],
-      # This is the condition for using boringssl
-      ['OS=="win" or runtime=="electron"', {
-        "include_dirs": [
-          "third_party/boringssl/include"
-        ],
-        "defines": [
-          'OPENSSL_NO_ASM'
-        ]
-      }, {
-        'conditions': [
-          ["target_arch=='ia32'", {
-             "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
-          }],
-          ["target_arch=='x64'", {
-             "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
-          }],
-          ["target_arch=='arm'", {
-             "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
-          }],
-          ['grpc_alpn=="true"', {
-            'defines': [
-              'TSI_OPENSSL_ALPN_SUPPORT=1'
-            ],
-          }, {
-            'defines': [
-              'TSI_OPENSSL_ALPN_SUPPORT=0'
-            ],
-          }]
-        ],
-        'include_dirs': [
-          '<(node_root_dir)/deps/openssl/openssl/include',
-        ]
-      }],
-      ['OS == "win"', {
-        "include_dirs": [
-          "third_party/zlib",
-          "third_party/cares/cares"
-        ],
-        "defines": [
-          '_WIN32_WINNT=0x0600',
-          'WIN32_LEAN_AND_MEAN',
-          '_HAS_EXCEPTIONS=0',
-          'UNICODE',
-          '_UNICODE',
-          'NOMINMAX',
-        ],
-        "msvs_settings": {
-          'VCCLCompilerTool': {
-            'RuntimeLibrary': 1, # static debug
-          }
-        },
-        "libraries": [
-          "ws2_32"
-        ]
-      }, { # OS != "win"
-        'include_dirs': [
-          '<(node_root_dir)/deps/zlib',
-          '<(node_root_dir)/deps/cares/include'
-        ]
-      }],
-      ['OS == "mac"', {
-        'xcode_settings': {
-          'OTHER_CFLAGS': [
-              '-g',
-              '-Wall',
-              '-Wextra',
-              '-Werror',
-              '-Wno-long-long',
-              '-Wno-unused-parameter',
-              '-DOSATOMIC_USE_INLINED=1',
-              '-Ithird_party/abseil-cpp',
-          ],
-          'OTHER_CPLUSPLUSFLAGS': [
-              '-g',
-              '-Wall',
-              '-Wextra',
-              '-Werror',
-              '-Wno-long-long',
-              '-Wno-unused-parameter',
-              '-DOSATOMIC_USE_INLINED=1',
-              '-Ithird_party/abseil-cpp',
-            '-stdlib=libc++',
-            '-std=c++11',
-            '-Wno-error=deprecated-declarations'
-          ],
-        },
-      }]
-    ]
-  },
-  'conditions': [
-    ['OS=="win" or runtime=="electron"', {
-      'targets': [
-        {
-          'target_name': 'boringssl',
-          'product_prefix': 'lib',
-          'type': 'static_library',
-          'dependencies': [
-          ],
-          'sources': [
-            'src/boringssl/err_data.c',
-            'third_party/boringssl/crypto/aes/aes.c',
-            'third_party/boringssl/crypto/aes/key_wrap.c',
-            'third_party/boringssl/crypto/aes/mode_wrappers.c',
-            'third_party/boringssl/crypto/asn1/a_bitstr.c',
-            'third_party/boringssl/crypto/asn1/a_bool.c',
-            'third_party/boringssl/crypto/asn1/a_d2i_fp.c',
-            'third_party/boringssl/crypto/asn1/a_dup.c',
-            'third_party/boringssl/crypto/asn1/a_enum.c',
-            'third_party/boringssl/crypto/asn1/a_gentm.c',
-            'third_party/boringssl/crypto/asn1/a_i2d_fp.c',
-            'third_party/boringssl/crypto/asn1/a_int.c',
-            'third_party/boringssl/crypto/asn1/a_mbstr.c',
-            'third_party/boringssl/crypto/asn1/a_object.c',
-            'third_party/boringssl/crypto/asn1/a_octet.c',
-            'third_party/boringssl/crypto/asn1/a_print.c',
-            'third_party/boringssl/crypto/asn1/a_strnid.c',
-            'third_party/boringssl/crypto/asn1/a_time.c',
-            'third_party/boringssl/crypto/asn1/a_type.c',
-            'third_party/boringssl/crypto/asn1/a_utctm.c',
-            'third_party/boringssl/crypto/asn1/a_utf8.c',
-            'third_party/boringssl/crypto/asn1/asn1_lib.c',
-            'third_party/boringssl/crypto/asn1/asn1_par.c',
-            'third_party/boringssl/crypto/asn1/asn_pack.c',
-            'third_party/boringssl/crypto/asn1/f_enum.c',
-            'third_party/boringssl/crypto/asn1/f_int.c',
-            'third_party/boringssl/crypto/asn1/f_string.c',
-            'third_party/boringssl/crypto/asn1/t_bitst.c',
-            'third_party/boringssl/crypto/asn1/tasn_dec.c',
-            'third_party/boringssl/crypto/asn1/tasn_enc.c',
-            'third_party/boringssl/crypto/asn1/tasn_fre.c',
-            'third_party/boringssl/crypto/asn1/tasn_new.c',
-            'third_party/boringssl/crypto/asn1/tasn_typ.c',
-            'third_party/boringssl/crypto/asn1/tasn_utl.c',
-            'third_party/boringssl/crypto/asn1/time_support.c',
-            'third_party/boringssl/crypto/asn1/x_bignum.c',
-            'third_party/boringssl/crypto/asn1/x_long.c',
-            'third_party/boringssl/crypto/base64/base64.c',
-            'third_party/boringssl/crypto/bio/bio.c',
-            'third_party/boringssl/crypto/bio/bio_mem.c',
-            'third_party/boringssl/crypto/bio/connect.c',
-            'third_party/boringssl/crypto/bio/fd.c',
-            'third_party/boringssl/crypto/bio/file.c',
-            'third_party/boringssl/crypto/bio/hexdump.c',
-            'third_party/boringssl/crypto/bio/pair.c',
-            'third_party/boringssl/crypto/bio/printf.c',
-            'third_party/boringssl/crypto/bio/socket.c',
-            'third_party/boringssl/crypto/bio/socket_helper.c',
-            'third_party/boringssl/crypto/bn/add.c',
-            'third_party/boringssl/crypto/bn/asm/x86_64-gcc.c',
-            'third_party/boringssl/crypto/bn/bn.c',
-            'third_party/boringssl/crypto/bn/bn_asn1.c',
-            'third_party/boringssl/crypto/bn/cmp.c',
-            'third_party/boringssl/crypto/bn/convert.c',
-            'third_party/boringssl/crypto/bn/ctx.c',
-            'third_party/boringssl/crypto/bn/div.c',
-            'third_party/boringssl/crypto/bn/exponentiation.c',
-            'third_party/boringssl/crypto/bn/gcd.c',
-            'third_party/boringssl/crypto/bn/generic.c',
-            'third_party/boringssl/crypto/bn/kronecker.c',
-            'third_party/boringssl/crypto/bn/montgomery.c',
-            'third_party/boringssl/crypto/bn/montgomery_inv.c',
-            'third_party/boringssl/crypto/bn/mul.c',
-            'third_party/boringssl/crypto/bn/prime.c',
-            'third_party/boringssl/crypto/bn/random.c',
-            'third_party/boringssl/crypto/bn/rsaz_exp.c',
-            'third_party/boringssl/crypto/bn/shift.c',
-            'third_party/boringssl/crypto/bn/sqrt.c',
-            'third_party/boringssl/crypto/buf/buf.c',
-            'third_party/boringssl/crypto/bytestring/asn1_compat.c',
-            'third_party/boringssl/crypto/bytestring/ber.c',
-            'third_party/boringssl/crypto/bytestring/cbb.c',
-            'third_party/boringssl/crypto/bytestring/cbs.c',
-            'third_party/boringssl/crypto/chacha/chacha.c',
-            'third_party/boringssl/crypto/cipher/aead.c',
-            'third_party/boringssl/crypto/cipher/cipher.c',
-            'third_party/boringssl/crypto/cipher/derive_key.c',
-            'third_party/boringssl/crypto/cipher/e_aes.c',
-            'third_party/boringssl/crypto/cipher/e_chacha20poly1305.c',
-            'third_party/boringssl/crypto/cipher/e_des.c',
-            'third_party/boringssl/crypto/cipher/e_null.c',
-            'third_party/boringssl/crypto/cipher/e_rc2.c',
-            'third_party/boringssl/crypto/cipher/e_rc4.c',
-            'third_party/boringssl/crypto/cipher/e_ssl3.c',
-            'third_party/boringssl/crypto/cipher/e_tls.c',
-            'third_party/boringssl/crypto/cipher/tls_cbc.c',
-            'third_party/boringssl/crypto/cmac/cmac.c',
-            'third_party/boringssl/crypto/conf/conf.c',
-            'third_party/boringssl/crypto/cpu-aarch64-linux.c',
-            'third_party/boringssl/crypto/cpu-arm-linux.c',
-            'third_party/boringssl/crypto/cpu-arm.c',
-            'third_party/boringssl/crypto/cpu-intel.c',
-            'third_party/boringssl/crypto/cpu-ppc64le.c',
-            'third_party/boringssl/crypto/crypto.c',
-            'third_party/boringssl/crypto/curve25519/curve25519.c',
-            'third_party/boringssl/crypto/curve25519/spake25519.c',
-            'third_party/boringssl/crypto/curve25519/x25519-x86_64.c',
-            'third_party/boringssl/crypto/des/des.c',
-            'third_party/boringssl/crypto/dh/check.c',
-            'third_party/boringssl/crypto/dh/dh.c',
-            'third_party/boringssl/crypto/dh/dh_asn1.c',
-            'third_party/boringssl/crypto/dh/params.c',
-            'third_party/boringssl/crypto/digest/digest.c',
-            'third_party/boringssl/crypto/digest/digests.c',
-            'third_party/boringssl/crypto/dsa/dsa.c',
-            'third_party/boringssl/crypto/dsa/dsa_asn1.c',
-            'third_party/boringssl/crypto/ec/ec.c',
-            'third_party/boringssl/crypto/ec/ec_asn1.c',
-            'third_party/boringssl/crypto/ec/ec_key.c',
-            'third_party/boringssl/crypto/ec/ec_montgomery.c',
-            'third_party/boringssl/crypto/ec/oct.c',
-            'third_party/boringssl/crypto/ec/p224-64.c',
-            'third_party/boringssl/crypto/ec/p256-64.c',
-            'third_party/boringssl/crypto/ec/p256-x86_64.c',
-            'third_party/boringssl/crypto/ec/simple.c',
-            'third_party/boringssl/crypto/ec/util-64.c',
-            'third_party/boringssl/crypto/ec/wnaf.c',
-            'third_party/boringssl/crypto/ecdh/ecdh.c',
-            'third_party/boringssl/crypto/ecdsa/ecdsa.c',
-            'third_party/boringssl/crypto/ecdsa/ecdsa_asn1.c',
-            'third_party/boringssl/crypto/engine/engine.c',
-            'third_party/boringssl/crypto/err/err.c',
-            'third_party/boringssl/crypto/evp/digestsign.c',
-            'third_party/boringssl/crypto/evp/evp.c',
-            'third_party/boringssl/crypto/evp/evp_asn1.c',
-            'third_party/boringssl/crypto/evp/evp_ctx.c',
-            'third_party/boringssl/crypto/evp/p_dsa_asn1.c',
-            'third_party/boringssl/crypto/evp/p_ec.c',
-            'third_party/boringssl/crypto/evp/p_ec_asn1.c',
-            'third_party/boringssl/crypto/evp/p_rsa.c',
-            'third_party/boringssl/crypto/evp/p_rsa_asn1.c',
-            'third_party/boringssl/crypto/evp/pbkdf.c',
-            'third_party/boringssl/crypto/evp/print.c',
-            'third_party/boringssl/crypto/evp/sign.c',
-            'third_party/boringssl/crypto/ex_data.c',
-            'third_party/boringssl/crypto/hkdf/hkdf.c',
-            'third_party/boringssl/crypto/hmac/hmac.c',
-            'third_party/boringssl/crypto/lhash/lhash.c',
-            'third_party/boringssl/crypto/md4/md4.c',
-            'third_party/boringssl/crypto/md5/md5.c',
-            'third_party/boringssl/crypto/mem.c',
-            'third_party/boringssl/crypto/modes/cbc.c',
-            'third_party/boringssl/crypto/modes/cfb.c',
-            'third_party/boringssl/crypto/modes/ctr.c',
-            'third_party/boringssl/crypto/modes/gcm.c',
-            'third_party/boringssl/crypto/modes/ofb.c',
-            'third_party/boringssl/crypto/modes/polyval.c',
-            'third_party/boringssl/crypto/obj/obj.c',
-            'third_party/boringssl/crypto/obj/obj_xref.c',
-            'third_party/boringssl/crypto/pem/pem_all.c',
-            'third_party/boringssl/crypto/pem/pem_info.c',
-            'third_party/boringssl/crypto/pem/pem_lib.c',
-            'third_party/boringssl/crypto/pem/pem_oth.c',
-            'third_party/boringssl/crypto/pem/pem_pk8.c',
-            'third_party/boringssl/crypto/pem/pem_pkey.c',
-            'third_party/boringssl/crypto/pem/pem_x509.c',
-            'third_party/boringssl/crypto/pem/pem_xaux.c',
-            'third_party/boringssl/crypto/pkcs8/p5_pbev2.c',
-            'third_party/boringssl/crypto/pkcs8/p8_pkey.c',
-            'third_party/boringssl/crypto/pkcs8/pkcs8.c',
-            'third_party/boringssl/crypto/poly1305/poly1305.c',
-            'third_party/boringssl/crypto/poly1305/poly1305_arm.c',
-            'third_party/boringssl/crypto/poly1305/poly1305_vec.c',
-            'third_party/boringssl/crypto/pool/pool.c',
-            'third_party/boringssl/crypto/rand/deterministic.c',
-            'third_party/boringssl/crypto/rand/fuchsia.c',
-            'third_party/boringssl/crypto/rand/rand.c',
-            'third_party/boringssl/crypto/rand/urandom.c',
-            'third_party/boringssl/crypto/rand/windows.c',
-            'third_party/boringssl/crypto/rc4/rc4.c',
-            'third_party/boringssl/crypto/refcount_c11.c',
-            'third_party/boringssl/crypto/refcount_lock.c',
-            'third_party/boringssl/crypto/rsa/blinding.c',
-            'third_party/boringssl/crypto/rsa/padding.c',
-            'third_party/boringssl/crypto/rsa/rsa.c',
-            'third_party/boringssl/crypto/rsa/rsa_asn1.c',
-            'third_party/boringssl/crypto/rsa/rsa_impl.c',
-            'third_party/boringssl/crypto/sha/sha1-altivec.c',
-            'third_party/boringssl/crypto/sha/sha1.c',
-            'third_party/boringssl/crypto/sha/sha256.c',
-            'third_party/boringssl/crypto/sha/sha512.c',
-            'third_party/boringssl/crypto/stack/stack.c',
-            'third_party/boringssl/crypto/thread.c',
-            'third_party/boringssl/crypto/thread_none.c',
-            'third_party/boringssl/crypto/thread_pthread.c',
-            'third_party/boringssl/crypto/thread_win.c',
-            'third_party/boringssl/crypto/x509/a_digest.c',
-            'third_party/boringssl/crypto/x509/a_sign.c',
-            'third_party/boringssl/crypto/x509/a_strex.c',
-            'third_party/boringssl/crypto/x509/a_verify.c',
-            'third_party/boringssl/crypto/x509/algorithm.c',
-            'third_party/boringssl/crypto/x509/asn1_gen.c',
-            'third_party/boringssl/crypto/x509/by_dir.c',
-            'third_party/boringssl/crypto/x509/by_file.c',
-            'third_party/boringssl/crypto/x509/i2d_pr.c',
-            'third_party/boringssl/crypto/x509/pkcs7.c',
-            'third_party/boringssl/crypto/x509/rsa_pss.c',
-            'third_party/boringssl/crypto/x509/t_crl.c',
-            'third_party/boringssl/crypto/x509/t_req.c',
-            'third_party/boringssl/crypto/x509/t_x509.c',
-            'third_party/boringssl/crypto/x509/t_x509a.c',
-            'third_party/boringssl/crypto/x509/x509.c',
-            'third_party/boringssl/crypto/x509/x509_att.c',
-            'third_party/boringssl/crypto/x509/x509_cmp.c',
-            'third_party/boringssl/crypto/x509/x509_d2.c',
-            'third_party/boringssl/crypto/x509/x509_def.c',
-            'third_party/boringssl/crypto/x509/x509_ext.c',
-            'third_party/boringssl/crypto/x509/x509_lu.c',
-            'third_party/boringssl/crypto/x509/x509_obj.c',
-            'third_party/boringssl/crypto/x509/x509_r2x.c',
-            'third_party/boringssl/crypto/x509/x509_req.c',
-            'third_party/boringssl/crypto/x509/x509_set.c',
-            'third_party/boringssl/crypto/x509/x509_trs.c',
-            'third_party/boringssl/crypto/x509/x509_txt.c',
-            'third_party/boringssl/crypto/x509/x509_v3.c',
-            'third_party/boringssl/crypto/x509/x509_vfy.c',
-            'third_party/boringssl/crypto/x509/x509_vpm.c',
-            'third_party/boringssl/crypto/x509/x509cset.c',
-            'third_party/boringssl/crypto/x509/x509name.c',
-            'third_party/boringssl/crypto/x509/x509rset.c',
-            'third_party/boringssl/crypto/x509/x509spki.c',
-            'third_party/boringssl/crypto/x509/x509type.c',
-            'third_party/boringssl/crypto/x509/x_algor.c',
-            'third_party/boringssl/crypto/x509/x_all.c',
-            'third_party/boringssl/crypto/x509/x_attrib.c',
-            'third_party/boringssl/crypto/x509/x_crl.c',
-            'third_party/boringssl/crypto/x509/x_exten.c',
-            'third_party/boringssl/crypto/x509/x_info.c',
-            'third_party/boringssl/crypto/x509/x_name.c',
-            'third_party/boringssl/crypto/x509/x_pkey.c',
-            'third_party/boringssl/crypto/x509/x_pubkey.c',
-            'third_party/boringssl/crypto/x509/x_req.c',
-            'third_party/boringssl/crypto/x509/x_sig.c',
-            'third_party/boringssl/crypto/x509/x_spki.c',
-            'third_party/boringssl/crypto/x509/x_val.c',
-            'third_party/boringssl/crypto/x509/x_x509.c',
-            'third_party/boringssl/crypto/x509/x_x509a.c',
-            'third_party/boringssl/crypto/x509v3/pcy_cache.c',
-            'third_party/boringssl/crypto/x509v3/pcy_data.c',
-            'third_party/boringssl/crypto/x509v3/pcy_lib.c',
-            'third_party/boringssl/crypto/x509v3/pcy_map.c',
-            'third_party/boringssl/crypto/x509v3/pcy_node.c',
-            'third_party/boringssl/crypto/x509v3/pcy_tree.c',
-            'third_party/boringssl/crypto/x509v3/v3_akey.c',
-            'third_party/boringssl/crypto/x509v3/v3_akeya.c',
-            'third_party/boringssl/crypto/x509v3/v3_alt.c',
-            'third_party/boringssl/crypto/x509v3/v3_bcons.c',
-            'third_party/boringssl/crypto/x509v3/v3_bitst.c',
-            'third_party/boringssl/crypto/x509v3/v3_conf.c',
-            'third_party/boringssl/crypto/x509v3/v3_cpols.c',
-            'third_party/boringssl/crypto/x509v3/v3_crld.c',
-            'third_party/boringssl/crypto/x509v3/v3_enum.c',
-            'third_party/boringssl/crypto/x509v3/v3_extku.c',
-            'third_party/boringssl/crypto/x509v3/v3_genn.c',
-            'third_party/boringssl/crypto/x509v3/v3_ia5.c',
-            'third_party/boringssl/crypto/x509v3/v3_info.c',
-            'third_party/boringssl/crypto/x509v3/v3_int.c',
-            'third_party/boringssl/crypto/x509v3/v3_lib.c',
-            'third_party/boringssl/crypto/x509v3/v3_ncons.c',
-            'third_party/boringssl/crypto/x509v3/v3_pci.c',
-            'third_party/boringssl/crypto/x509v3/v3_pcia.c',
-            'third_party/boringssl/crypto/x509v3/v3_pcons.c',
-            'third_party/boringssl/crypto/x509v3/v3_pku.c',
-            'third_party/boringssl/crypto/x509v3/v3_pmaps.c',
-            'third_party/boringssl/crypto/x509v3/v3_prn.c',
-            'third_party/boringssl/crypto/x509v3/v3_purp.c',
-            'third_party/boringssl/crypto/x509v3/v3_skey.c',
-            'third_party/boringssl/crypto/x509v3/v3_sxnet.c',
-            'third_party/boringssl/crypto/x509v3/v3_utl.c',
-            'third_party/boringssl/ssl/bio_ssl.c',
-            'third_party/boringssl/ssl/custom_extensions.c',
-            'third_party/boringssl/ssl/d1_both.c',
-            'third_party/boringssl/ssl/d1_lib.c',
-            'third_party/boringssl/ssl/d1_pkt.c',
-            'third_party/boringssl/ssl/d1_srtp.c',
-            'third_party/boringssl/ssl/dtls_method.c',
-            'third_party/boringssl/ssl/dtls_record.c',
-            'third_party/boringssl/ssl/handshake_client.c',
-            'third_party/boringssl/ssl/handshake_server.c',
-            'third_party/boringssl/ssl/s3_both.c',
-            'third_party/boringssl/ssl/s3_lib.c',
-            'third_party/boringssl/ssl/s3_pkt.c',
-            'third_party/boringssl/ssl/ssl_aead_ctx.c',
-            'third_party/boringssl/ssl/ssl_asn1.c',
-            'third_party/boringssl/ssl/ssl_buffer.c',
-            'third_party/boringssl/ssl/ssl_cert.c',
-            'third_party/boringssl/ssl/ssl_cipher.c',
-            'third_party/boringssl/ssl/ssl_ecdh.c',
-            'third_party/boringssl/ssl/ssl_file.c',
-            'third_party/boringssl/ssl/ssl_lib.c',
-            'third_party/boringssl/ssl/ssl_privkey.c',
-            'third_party/boringssl/ssl/ssl_privkey_cc.cc',
-            'third_party/boringssl/ssl/ssl_session.c',
-            'third_party/boringssl/ssl/ssl_stat.c',
-            'third_party/boringssl/ssl/ssl_transcript.c',
-            'third_party/boringssl/ssl/ssl_x509.c',
-            'third_party/boringssl/ssl/t1_enc.c',
-            'third_party/boringssl/ssl/t1_lib.c',
-            'third_party/boringssl/ssl/tls13_both.c',
-            'third_party/boringssl/ssl/tls13_client.c',
-            'third_party/boringssl/ssl/tls13_enc.c',
-            'third_party/boringssl/ssl/tls13_server.c',
-            'third_party/boringssl/ssl/tls_method.c',
-            'third_party/boringssl/ssl/tls_record.c',
-          ],
-          'conditions': [
-            ['OS == "mac"', {
-              'xcode_settings': {
-                'MACOSX_DEPLOYMENT_TARGET': '10.9'
-              }
-            }]
-          ]
-        },
-      ],
-    }],
-    ['OS == "win" and runtime!="electron"', {
-      'targets': [
-        {
-          # IMPORTANT WINDOWS BUILD INFORMATION
-          # This library does not build on Windows without modifying the Node
-          # development packages that node-gyp downloads in order to build.
-          # Due to https://github.com/nodejs/node/issues/4932, the headers for
-          # BoringSSL conflict with the OpenSSL headers included by default
-          # when including the Node headers. The remedy for this is to remove
-          # the OpenSSL headers, from the downloaded Node development package,
-          # which is typically located in `.node-gyp` in your home directory.
-          #
-          # This is not true of Electron, which does not have OpenSSL headers.
-          'target_name': 'WINDOWS_BUILD_WARNING',
-          'rules': [
-            {
-              'rule_name': 'WINDOWS_BUILD_WARNING',
-              'extension': 'S',
-              'inputs': [
-                'package.json'
-              ],
-              'outputs': [
-                'ignore_this_part'
-              ],
-              'action': ['echo', 'IMPORTANT: Due to https://github.com/nodejs/node/issues/4932, to build this library on Windows, you must first remove <(node_root_dir)/include/node/openssl/']
-            }
-          ]
-        },
-      ]
-    }],
-    ['OS == "win"', {
-      'targets': [
-        # Only want to compile zlib under Windows
-        {
-          'target_name': 'z',
-          'product_prefix': 'lib',
-          'type': 'static_library',
-          'dependencies': [
-          ],
-          'sources': [
-            'third_party/zlib/adler32.c',
-            'third_party/zlib/compress.c',
-            'third_party/zlib/crc32.c',
-            'third_party/zlib/deflate.c',
-            'third_party/zlib/gzclose.c',
-            'third_party/zlib/gzlib.c',
-            'third_party/zlib/gzread.c',
-            'third_party/zlib/gzwrite.c',
-            'third_party/zlib/infback.c',
-            'third_party/zlib/inffast.c',
-            'third_party/zlib/inflate.c',
-            'third_party/zlib/inftrees.c',
-            'third_party/zlib/trees.c',
-            'third_party/zlib/uncompr.c',
-            'third_party/zlib/zutil.c',
-          ]
-        },
-      ]
-    }]
-  ],
-  'targets': [
-    {
-      'target_name': 'gpr',
-      'product_prefix': 'lib',
-      'type': 'static_library',
-      'dependencies': [
-      ],
-      'sources': [
-        'src/core/lib/profiling/basic_timers.cc',
-        'src/core/lib/profiling/stap_timers.cc',
-        'src/core/lib/support/alloc.cc',
-        'src/core/lib/support/arena.cc',
-        'src/core/lib/support/atm.cc',
-        'src/core/lib/support/avl.cc',
-        'src/core/lib/support/cmdline.cc',
-        'src/core/lib/support/cpu_iphone.cc',
-        'src/core/lib/support/cpu_linux.cc',
-        'src/core/lib/support/cpu_posix.cc',
-        'src/core/lib/support/cpu_windows.cc',
-        'src/core/lib/support/env_linux.cc',
-        'src/core/lib/support/env_posix.cc',
-        'src/core/lib/support/env_windows.cc',
-        'src/core/lib/support/histogram.cc',
-        'src/core/lib/support/host_port.cc',
-        'src/core/lib/support/log.cc',
-        'src/core/lib/support/log_android.cc',
-        'src/core/lib/support/log_linux.cc',
-        'src/core/lib/support/log_posix.cc',
-        'src/core/lib/support/log_windows.cc',
-        'src/core/lib/support/mpscq.cc',
-        'src/core/lib/support/murmur_hash.cc',
-        'src/core/lib/support/stack_lockfree.cc',
-        'src/core/lib/support/string.cc',
-        'src/core/lib/support/string_posix.cc',
-        'src/core/lib/support/string_util_windows.cc',
-        'src/core/lib/support/string_windows.cc',
-        'src/core/lib/support/subprocess_posix.cc',
-        'src/core/lib/support/subprocess_windows.cc',
-        'src/core/lib/support/sync.cc',
-        'src/core/lib/support/sync_posix.cc',
-        'src/core/lib/support/sync_windows.cc',
-        'src/core/lib/support/thd.cc',
-        'src/core/lib/support/thd_posix.cc',
-        'src/core/lib/support/thd_windows.cc',
-        'src/core/lib/support/time.cc',
-        'src/core/lib/support/time_posix.cc',
-        'src/core/lib/support/time_precise.cc',
-        'src/core/lib/support/time_windows.cc',
-        'src/core/lib/support/tls_pthread.cc',
-        'src/core/lib/support/tmpfile_msys.cc',
-        'src/core/lib/support/tmpfile_posix.cc',
-        'src/core/lib/support/tmpfile_windows.cc',
-        'src/core/lib/support/wrap_memcpy.cc',
-      ],
-      'conditions': [
-        ['OS == "mac"', {
-          'xcode_settings': {
-            'MACOSX_DEPLOYMENT_TARGET': '10.9'
-          }
-        }]
-      ]
-    },
-    {
-      'target_name': 'grpc',
-      'product_prefix': 'lib',
-      'type': 'static_library',
-      'dependencies': [
-        'gpr',
-      ],
-      'sources': [
-        'src/core/lib/surface/init.cc',
-        'src/core/lib/backoff/backoff.cc',
-        'src/core/lib/channel/channel_args.cc',
-        'src/core/lib/channel/channel_stack.cc',
-        'src/core/lib/channel/channel_stack_builder.cc',
-        'src/core/lib/channel/connected_channel.cc',
-        'src/core/lib/channel/handshaker.cc',
-        'src/core/lib/channel/handshaker_factory.cc',
-        'src/core/lib/channel/handshaker_registry.cc',
-        'src/core/lib/compression/compression.cc',
-        'src/core/lib/compression/message_compress.cc',
-        'src/core/lib/compression/stream_compression.cc',
-        'src/core/lib/compression/stream_compression_gzip.cc',
-        'src/core/lib/compression/stream_compression_identity.cc',
-        'src/core/lib/debug/stats.cc',
-        'src/core/lib/debug/stats_data.cc',
-        'src/core/lib/http/format_request.cc',
-        'src/core/lib/http/httpcli.cc',
-        'src/core/lib/http/parser.cc',
-        'src/core/lib/iomgr/call_combiner.cc',
-        'src/core/lib/iomgr/closure.cc',
-        'src/core/lib/iomgr/combiner.cc',
-        'src/core/lib/iomgr/endpoint.cc',
-        'src/core/lib/iomgr/endpoint_pair_posix.cc',
-        'src/core/lib/iomgr/endpoint_pair_uv.cc',
-        'src/core/lib/iomgr/endpoint_pair_windows.cc',
-        'src/core/lib/iomgr/error.cc',
-        'src/core/lib/iomgr/ev_epoll1_linux.cc',
-        'src/core/lib/iomgr/ev_epollex_linux.cc',
-        'src/core/lib/iomgr/ev_epollsig_linux.cc',
-        'src/core/lib/iomgr/ev_poll_posix.cc',
-        'src/core/lib/iomgr/ev_posix.cc',
-        'src/core/lib/iomgr/ev_windows.cc',
-        'src/core/lib/iomgr/exec_ctx.cc',
-        'src/core/lib/iomgr/executor.cc',
-        'src/core/lib/iomgr/gethostname_fallback.cc',
-        'src/core/lib/iomgr/gethostname_host_name_max.cc',
-        'src/core/lib/iomgr/gethostname_sysconf.cc',
-        'src/core/lib/iomgr/iocp_windows.cc',
-        'src/core/lib/iomgr/iomgr.cc',
-        'src/core/lib/iomgr/iomgr_posix.cc',
-        'src/core/lib/iomgr/iomgr_uv.cc',
-        'src/core/lib/iomgr/iomgr_windows.cc',
-        'src/core/lib/iomgr/is_epollexclusive_available.cc',
-        'src/core/lib/iomgr/load_file.cc',
-        'src/core/lib/iomgr/lockfree_event.cc',
-        'src/core/lib/iomgr/network_status_tracker.cc',
-        'src/core/lib/iomgr/polling_entity.cc',
-        'src/core/lib/iomgr/pollset_set_uv.cc',
-        'src/core/lib/iomgr/pollset_set_windows.cc',
-        'src/core/lib/iomgr/pollset_uv.cc',
-        'src/core/lib/iomgr/pollset_windows.cc',
-        'src/core/lib/iomgr/resolve_address_posix.cc',
-        'src/core/lib/iomgr/resolve_address_uv.cc',
-        'src/core/lib/iomgr/resolve_address_windows.cc',
-        'src/core/lib/iomgr/resource_quota.cc',
-        'src/core/lib/iomgr/sockaddr_utils.cc',
-        'src/core/lib/iomgr/socket_factory_posix.cc',
-        'src/core/lib/iomgr/socket_mutator.cc',
-        'src/core/lib/iomgr/socket_utils_common_posix.cc',
-        'src/core/lib/iomgr/socket_utils_linux.cc',
-        'src/core/lib/iomgr/socket_utils_posix.cc',
-        'src/core/lib/iomgr/socket_utils_uv.cc',
-        'src/core/lib/iomgr/socket_utils_windows.cc',
-        'src/core/lib/iomgr/socket_windows.cc',
-        'src/core/lib/iomgr/tcp_client_posix.cc',
-        'src/core/lib/iomgr/tcp_client_uv.cc',
-        'src/core/lib/iomgr/tcp_client_windows.cc',
-        'src/core/lib/iomgr/tcp_posix.cc',
-        'src/core/lib/iomgr/tcp_server_posix.cc',
-        'src/core/lib/iomgr/tcp_server_utils_posix_common.cc',
-        'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc',
-        'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc',
-        'src/core/lib/iomgr/tcp_server_uv.cc',
-        'src/core/lib/iomgr/tcp_server_windows.cc',
-        'src/core/lib/iomgr/tcp_uv.cc',
-        'src/core/lib/iomgr/tcp_windows.cc',
-        'src/core/lib/iomgr/time_averaged_stats.cc',
-        'src/core/lib/iomgr/timer_generic.cc',
-        'src/core/lib/iomgr/timer_heap.cc',
-        'src/core/lib/iomgr/timer_manager.cc',
-        'src/core/lib/iomgr/timer_uv.cc',
-        'src/core/lib/iomgr/udp_server.cc',
-        'src/core/lib/iomgr/unix_sockets_posix.cc',
-        'src/core/lib/iomgr/unix_sockets_posix_noop.cc',
-        'src/core/lib/iomgr/wakeup_fd_cv.cc',
-        'src/core/lib/iomgr/wakeup_fd_eventfd.cc',
-        'src/core/lib/iomgr/wakeup_fd_nospecial.cc',
-        'src/core/lib/iomgr/wakeup_fd_pipe.cc',
-        'src/core/lib/iomgr/wakeup_fd_posix.cc',
-        'src/core/lib/json/json.cc',
-        'src/core/lib/json/json_reader.cc',
-        'src/core/lib/json/json_string.cc',
-        'src/core/lib/json/json_writer.cc',
-        'src/core/lib/slice/b64.cc',
-        'src/core/lib/slice/percent_encoding.cc',
-        'src/core/lib/slice/slice.cc',
-        'src/core/lib/slice/slice_buffer.cc',
-        'src/core/lib/slice/slice_hash_table.cc',
-        'src/core/lib/slice/slice_intern.cc',
-        'src/core/lib/slice/slice_string_helpers.cc',
-        'src/core/lib/surface/alarm.cc',
-        'src/core/lib/surface/api_trace.cc',
-        'src/core/lib/surface/byte_buffer.cc',
-        'src/core/lib/surface/byte_buffer_reader.cc',
-        'src/core/lib/surface/call.cc',
-        'src/core/lib/surface/call_details.cc',
-        'src/core/lib/surface/call_log_batch.cc',
-        'src/core/lib/surface/channel.cc',
-        'src/core/lib/surface/channel_init.cc',
-        'src/core/lib/surface/channel_ping.cc',
-        'src/core/lib/surface/channel_stack_type.cc',
-        'src/core/lib/surface/completion_queue.cc',
-        'src/core/lib/surface/completion_queue_factory.cc',
-        'src/core/lib/surface/event_string.cc',
-        'src/core/lib/surface/lame_client.cc',
-        'src/core/lib/surface/metadata_array.cc',
-        'src/core/lib/surface/server.cc',
-        'src/core/lib/surface/validate_metadata.cc',
-        'src/core/lib/surface/version.cc',
-        'src/core/lib/transport/bdp_estimator.cc',
-        'src/core/lib/transport/byte_stream.cc',
-        'src/core/lib/transport/connectivity_state.cc',
-        'src/core/lib/transport/error_utils.cc',
-        'src/core/lib/transport/metadata.cc',
-        'src/core/lib/transport/metadata_batch.cc',
-        'src/core/lib/transport/pid_controller.cc',
-        'src/core/lib/transport/service_config.cc',
-        'src/core/lib/transport/static_metadata.cc',
-        'src/core/lib/transport/status_conversion.cc',
-        'src/core/lib/transport/timeout_encoding.cc',
-        'src/core/lib/transport/transport.cc',
-        'src/core/lib/transport/transport_op_string.cc',
-        'src/core/lib/debug/trace.cc',
-        'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc',
-        'src/core/ext/transport/chttp2/transport/bin_decoder.cc',
-        'src/core/ext/transport/chttp2/transport/bin_encoder.cc',
-        'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc',
-        'src/core/ext/transport/chttp2/transport/chttp2_transport.cc',
-        'src/core/ext/transport/chttp2/transport/flow_control.cc',
-        'src/core/ext/transport/chttp2/transport/frame_data.cc',
-        'src/core/ext/transport/chttp2/transport/frame_goaway.cc',
-        'src/core/ext/transport/chttp2/transport/frame_ping.cc',
-        'src/core/ext/transport/chttp2/transport/frame_rst_stream.cc',
-        'src/core/ext/transport/chttp2/transport/frame_settings.cc',
-        'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
-        'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
-        'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
-        'src/core/ext/transport/chttp2/transport/hpack_table.cc',
-        'src/core/ext/transport/chttp2/transport/http2_settings.cc',
-        'src/core/ext/transport/chttp2/transport/huffsyms.cc',
-        'src/core/ext/transport/chttp2/transport/incoming_metadata.cc',
-        'src/core/ext/transport/chttp2/transport/parsing.cc',
-        'src/core/ext/transport/chttp2/transport/stream_lists.cc',
-        'src/core/ext/transport/chttp2/transport/stream_map.cc',
-        'src/core/ext/transport/chttp2/transport/varint.cc',
-        'src/core/ext/transport/chttp2/transport/writing.cc',
-        'src/core/ext/transport/chttp2/alpn/alpn.cc',
-        'src/core/ext/filters/http/client/http_client_filter.cc',
-        'src/core/ext/filters/http/http_filters_plugin.cc',
-        'src/core/ext/filters/http/message_compress/message_compress_filter.cc',
-        'src/core/ext/filters/http/server/http_server_filter.cc',
-        'src/core/lib/http/httpcli_security_connector.cc',
-        'src/core/lib/security/context/security_context.cc',
-        'src/core/lib/security/credentials/composite/composite_credentials.cc',
-        'src/core/lib/security/credentials/credentials.cc',
-        'src/core/lib/security/credentials/credentials_metadata.cc',
-        'src/core/lib/security/credentials/fake/fake_credentials.cc',
-        'src/core/lib/security/credentials/google_default/credentials_generic.cc',
-        'src/core/lib/security/credentials/google_default/google_default_credentials.cc',
-        'src/core/lib/security/credentials/iam/iam_credentials.cc',
-        'src/core/lib/security/credentials/jwt/json_token.cc',
-        'src/core/lib/security/credentials/jwt/jwt_credentials.cc',
-        'src/core/lib/security/credentials/jwt/jwt_verifier.cc',
-        'src/core/lib/security/credentials/oauth2/oauth2_credentials.cc',
-        'src/core/lib/security/credentials/plugin/plugin_credentials.cc',
-        'src/core/lib/security/credentials/ssl/ssl_credentials.cc',
-        'src/core/lib/security/transport/client_auth_filter.cc',
-        'src/core/lib/security/transport/lb_targets_info.cc',
-        'src/core/lib/security/transport/secure_endpoint.cc',
-        'src/core/lib/security/transport/security_connector.cc',
-        'src/core/lib/security/transport/security_handshaker.cc',
-        'src/core/lib/security/transport/server_auth_filter.cc',
-        'src/core/lib/security/transport/tsi_error.cc',
-        'src/core/lib/security/util/json_util.cc',
-        'src/core/lib/surface/init_secure.cc',
-        'src/core/tsi/fake_transport_security.cc',
-        'src/core/tsi/gts_transport_security.cc',
-        'src/core/tsi/ssl_transport_security.cc',
-        'src/core/tsi/transport_security_grpc.cc',
-        'src/core/tsi/transport_security.cc',
-        'src/core/tsi/transport_security_adapter.cc',
-        'src/core/ext/transport/chttp2/server/chttp2_server.cc',
-        'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc',
-        'src/core/ext/filters/client_channel/channel_connectivity.cc',
-        'src/core/ext/filters/client_channel/client_channel.cc',
-        'src/core/ext/filters/client_channel/client_channel_factory.cc',
-        'src/core/ext/filters/client_channel/client_channel_plugin.cc',
-        'src/core/ext/filters/client_channel/connector.cc',
-        'src/core/ext/filters/client_channel/http_connect_handshaker.cc',
-        'src/core/ext/filters/client_channel/http_proxy.cc',
-        'src/core/ext/filters/client_channel/lb_policy.cc',
-        'src/core/ext/filters/client_channel/lb_policy_factory.cc',
-        'src/core/ext/filters/client_channel/lb_policy_registry.cc',
-        'src/core/ext/filters/client_channel/parse_address.cc',
-        'src/core/ext/filters/client_channel/proxy_mapper.cc',
-        'src/core/ext/filters/client_channel/proxy_mapper_registry.cc',
-        'src/core/ext/filters/client_channel/resolver.cc',
-        'src/core/ext/filters/client_channel/resolver_factory.cc',
-        'src/core/ext/filters/client_channel/resolver_registry.cc',
-        'src/core/ext/filters/client_channel/retry_throttle.cc',
-        'src/core/ext/filters/client_channel/subchannel.cc',
-        'src/core/ext/filters/client_channel/subchannel_index.cc',
-        'src/core/ext/filters/client_channel/uri_parser.cc',
-        'src/core/ext/filters/deadline/deadline_filter.cc',
-        'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
-        'src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc',
-        'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc',
-        'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
-        'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
-        'src/core/ext/transport/inproc/inproc_plugin.cc',
-        'src/core/ext/transport/inproc/inproc_transport.cc',
-        'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc',
-        'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc',
-        'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc',
-        'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
-        'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
-        'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
-        'third_party/nanopb/pb_common.c',
-        'third_party/nanopb/pb_decode.c',
-        'third_party/nanopb/pb_encode.c',
-        'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
-        'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
-        'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
-        'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
-        'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
-        'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
-        'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc',
-        'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
-        'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
-        'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc',
-        'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc',
-        'src/core/ext/census/base_resources.cc',
-        'src/core/ext/census/context.cc',
-        'src/core/ext/census/gen/census.pb.c',
-        'src/core/ext/census/gen/trace_context.pb.c',
-        'src/core/ext/census/grpc_context.cc',
-        'src/core/ext/census/grpc_filter.cc',
-        'src/core/ext/census/grpc_plugin.cc',
-        'src/core/ext/census/initialize.cc',
-        'src/core/ext/census/intrusive_hash_map.cc',
-        'src/core/ext/census/mlog.cc',
-        'src/core/ext/census/operation.cc',
-        'src/core/ext/census/placeholders.cc',
-        'src/core/ext/census/resource.cc',
-        'src/core/ext/census/trace_context.cc',
-        'src/core/ext/census/tracing.cc',
-        'src/core/ext/filters/max_age/max_age_filter.cc',
-        'src/core/ext/filters/message_size/message_size_filter.cc',
-        'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
-        'src/core/ext/filters/workarounds/workaround_utils.cc',
-        'src/core/plugin_registry/grpc_plugin_registry.cc',
-      ],
-      'conditions': [
-        ['OS == "mac"', {
-          'xcode_settings': {
-            'MACOSX_DEPLOYMENT_TARGET': '10.9'
-          }
-        }]
-      ]
-    },
-    {
-      'include_dirs': [
-        "<!(node -e \"require('nan')\")"
-      ],
-      'cflags': [
-        '-pthread',
-        '-zdefs',
-        '-Wno-error=deprecated-declarations'
-      ],
-      "conditions": [
-        ['OS=="win" or runtime=="electron"', {
-          'dependencies': [
-            "boringssl",
-          ]
-        }],
-        ['OS=="win"', {
-          'dependencies': [
-            "z",
-          ]
-        }],
-        ['OS=="linux"', {
-          'ldflags': [
-            '-Wl,-wrap,memcpy'
-          ]
-        }],
-        ['OS == "mac"', {
-          'xcode_settings': {
-            'MACOSX_DEPLOYMENT_TARGET': '10.9'
-          }
-        }]
-      ],
-      "target_name": "grpc_node",
-      "sources": [
-        "src/node/ext/byte_buffer.cc",
-        "src/node/ext/call.cc",
-        "src/node/ext/call_credentials.cc",
-        "src/node/ext/channel.cc",
-        "src/node/ext/channel_credentials.cc",
-        "src/node/ext/completion_queue.cc",
-        "src/node/ext/node_grpc.cc",
-        "src/node/ext/server.cc",
-        "src/node/ext/server_credentials.cc",
-        "src/node/ext/slice.cc",
-        "src/node/ext/timeval.cc",
-      ],
-      "dependencies": [
-        "grpc",
-        "gpr",
-      ]
-    },
-    {
-      "target_name": "action_after_build",
-      "type": "none",
-      "dependencies": [ "<(module_name)" ],
-      "copies": [
-        {
-          "files": [ "<(PRODUCT_DIR)/<(module_name).node"],
-          "destination": "<(module_path)"
-        }
-      ]
-    }
-  ]
-}
diff --git a/build.yaml b/build.yaml
index e2faa43..cd6486e 100644
--- a/build.yaml
+++ b/build.yaml
@@ -19,42 +19,8 @@
 - name: census
   public_headers:
   - include/grpc/census.h
-  headers:
-  - src/core/ext/census/aggregation.h
-  - src/core/ext/census/base_resources.h
-  - src/core/ext/census/census_interface.h
-  - src/core/ext/census/census_rpc_stats.h
-  - src/core/ext/census/gen/census.pb.h
-  - src/core/ext/census/gen/trace_context.pb.h
-  - src/core/ext/census/grpc_filter.h
-  - src/core/ext/census/intrusive_hash_map.h
-  - src/core/ext/census/intrusive_hash_map_internal.h
-  - src/core/ext/census/mlog.h
-  - src/core/ext/census/resource.h
-  - src/core/ext/census/rpc_metric_id.h
-  - src/core/ext/census/trace_context.h
-  - src/core/ext/census/trace_label.h
-  - src/core/ext/census/trace_propagation.h
-  - src/core/ext/census/trace_status.h
-  - src/core/ext/census/trace_string.h
-  - src/core/ext/census/tracing.h
   src:
-  - src/core/ext/census/base_resources.cc
-  - src/core/ext/census/context.cc
-  - src/core/ext/census/gen/census.pb.c
-  - src/core/ext/census/gen/trace_context.pb.c
   - src/core/ext/census/grpc_context.cc
-  - src/core/ext/census/grpc_filter.cc
-  - src/core/ext/census/grpc_plugin.cc
-  - src/core/ext/census/initialize.cc
-  - src/core/ext/census/intrusive_hash_map.cc
-  - src/core/ext/census/mlog.cc
-  - src/core/ext/census/operation.cc
-  - src/core/ext/census/placeholders.cc
-  - src/core/ext/census/resource.cc
-  - src/core/ext/census/trace_context.cc
-  - src/core/ext/census/tracing.cc
-  plugin: census_grpc_plugin
   uses:
   - grpc_base
   - nanopb
@@ -463,6 +429,7 @@
   - grpc_trace_headers
 - name: grpc_client_channel
   headers:
+  - src/core/ext/filters/client_channel/backup_poller.h
   - src/core/ext/filters/client_channel/client_channel.h
   - src/core/ext/filters/client_channel/client_channel_factory.h
   - src/core/ext/filters/client_channel/connector.h
@@ -482,6 +449,7 @@
   - src/core/ext/filters/client_channel/subchannel_index.h
   - src/core/ext/filters/client_channel/uri_parser.h
   src:
+  - src/core/ext/filters/client_channel/backup_poller.cc
   - src/core/ext/filters/client_channel/channel_connectivity.cc
   - src/core/ext/filters/client_channel/client_channel.cc
   - src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -590,6 +558,7 @@
   uses:
   - grpc_base
   - grpc_client_channel
+  - grpc_lb_subchannel_list
 - name: grpc_lb_policy_round_robin
   src:
   - src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
@@ -597,6 +566,15 @@
   uses:
   - grpc_base
   - grpc_client_channel
+  - grpc_lb_subchannel_list
+- name: grpc_lb_subchannel_list
+  headers:
+  - src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+  src:
+  - src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc
+  uses:
+  - grpc_base
+  - grpc_client_channel
 - name: grpc_max_age_filter
   headers:
   - src/core/ext/filters/max_age/max_age_filter.h
@@ -739,20 +717,20 @@
   - test/core/util/trickle_endpoint.h
   src:
   - src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
-  - test/core/end2end/cq_verifier.c
-  - test/core/end2end/fixtures/http_proxy_fixture.c
-  - test/core/end2end/fixtures/proxy.c
-  - test/core/iomgr/endpoint_tests.c
+  - test/core/end2end/cq_verifier.cc
+  - test/core/end2end/fixtures/http_proxy_fixture.cc
+  - test/core/end2end/fixtures/proxy.cc
+  - test/core/iomgr/endpoint_tests.cc
   - test/core/util/debugger_macros.cc
-  - test/core/util/grpc_profiler.c
-  - test/core/util/memory_counters.c
-  - test/core/util/mock_endpoint.c
-  - test/core/util/parse_hexstring.c
-  - test/core/util/passthru_endpoint.c
-  - test/core/util/port.c
-  - test/core/util/port_server_client.c
-  - test/core/util/slice_splitter.c
-  - test/core/util/trickle_endpoint.c
+  - test/core/util/grpc_profiler.cc
+  - test/core/util/memory_counters.cc
+  - test/core/util/mock_endpoint.cc
+  - test/core/util/parse_hexstring.cc
+  - test/core/util/passthru_endpoint.cc
+  - test/core/util/port.cc
+  - test/core/util/port_server_client.cc
+  - test/core/util/slice_splitter.cc
+  - test/core/util/trickle_endpoint.cc
   deps:
   - gpr_test_util
   - gpr
@@ -937,7 +915,7 @@
   headers:
   - test/core/tsi/transport_security_test_lib.h
   src:
-  - test/core/tsi/transport_security_test_lib.c
+  - test/core/tsi/transport_security_test_lib.cc
   deps:
   - grpc
 - name: tsi
@@ -1147,7 +1125,7 @@
   headers:
   - test/core/util/test_config.h
   src:
-  - test/core/util/test_config.c
+  - test/core/util/test_config.cc
   deps:
   - gpr
   secure: false
@@ -1233,11 +1211,11 @@
   - test/core/end2end/data/ssl_test_data.h
   - test/core/security/oauth2_utils.h
   src:
-  - test/core/end2end/data/client_certs.c
-  - test/core/end2end/data/server1_cert.c
-  - test/core/end2end/data/server1_key.c
-  - test/core/end2end/data/test_root_cert.c
-  - test/core/security/oauth2_utils.c
+  - test/core/end2end/data/client_certs.cc
+  - test/core/end2end/data/server1_cert.cc
+  - test/core/end2end/data/server1_key.cc
+  - test/core/end2end/data/test_root_cert.cc
+  - test/core/security/oauth2_utils.cc
   deps:
   - gpr_test_util
   - gpr
@@ -1293,7 +1271,7 @@
   headers:
   - test/core/util/reconnect_server.h
   src:
-  - test/core/util/reconnect_server.c
+  - test/core/util/reconnect_server.cc
   deps:
   - test_tcp_server
   - grpc_test_util
@@ -1306,7 +1284,7 @@
   headers:
   - test/core/util/test_tcp_server.h
   src:
-  - test/core/util/test_tcp_server.c
+  - test/core/util/test_tcp_server.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1722,7 +1700,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/alarm_test.c
+  - test/core/surface/alarm_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1732,7 +1710,7 @@
   build: test
   language: c
   src:
-  - test/core/compression/algorithm_test.c
+  - test/core/compression/algorithm_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1743,7 +1721,7 @@
   build: test
   language: c
   src:
-  - test/core/support/alloc_test.c
+  - test/core/support/alloc_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -1752,7 +1730,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/chttp2/alpn_test.c
+  - test/core/transport/chttp2/alpn_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1762,7 +1740,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/end2end/fuzzers/api_fuzzer.c
+  - test/core/end2end/fuzzers/api_fuzzer.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1776,7 +1754,7 @@
   build: test
   language: c
   src:
-  - test/core/support/arena_test.c
+  - test/core/support/arena_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -1785,7 +1763,7 @@
   build: test
   language: c
   src:
-  - test/core/backoff/backoff_test.c
+  - test/core/backoff/backoff_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1796,7 +1774,7 @@
   build: test
   language: c
   src:
-  - test/core/end2end/bad_server_response_test.c
+  - test/core/end2end/bad_server_response_test.cc
   deps:
   - test_tcp_server
   - grpc_test_util
@@ -1809,7 +1787,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/chttp2/bin_decoder_test.c
+  - test/core/transport/chttp2/bin_decoder_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1818,7 +1796,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/chttp2/bin_encoder_test.c
+  - test/core/transport/chttp2/bin_encoder_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1827,51 +1805,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/byte_stream_test.c
-  deps:
-  - grpc_test_util
-  - grpc
-  - gpr_test_util
-  - gpr
-  uses_polling: false
-- name: census_context_test
-  build: test
-  language: c
-  src:
-  - test/core/census/context_test.c
-  deps:
-  - grpc_test_util
-  - grpc
-  - gpr_test_util
-  - gpr
-  uses_polling: false
-- name: census_intrusive_hash_map_test
-  build: test
-  language: c
-  src:
-  - test/core/census/intrusive_hash_map_test.c
-  deps:
-  - grpc_test_util
-  - grpc
-  - gpr_test_util
-  - gpr
-  uses_polling: false
-- name: census_resource_test
-  build: test
-  language: c
-  src:
-  - test/core/census/resource_test.c
-  deps:
-  - grpc_test_util
-  - grpc
-  - gpr_test_util
-  - gpr
-  uses_polling: false
-- name: census_trace_context_test
-  build: test
-  language: c
-  src:
-  - test/core/census/trace_context_test.c
+  - test/core/transport/byte_stream_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1882,7 +1816,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/channel_create_test.c
+  - test/core/surface/channel_create_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1900,7 +1834,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/chttp2/hpack_encoder_test.c
+  - test/core/transport/chttp2/hpack_encoder_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1911,7 +1845,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/chttp2/stream_map_test.c
+  - test/core/transport/chttp2/stream_map_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1922,7 +1856,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/chttp2/varint_test.c
+  - test/core/transport/chttp2/varint_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1933,7 +1867,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/end2end/fuzzers/client_fuzzer.c
+  - test/core/end2end/fuzzers/client_fuzzer.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1948,7 +1882,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/combiner_test.c
+  - test/core/iomgr/combiner_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1958,7 +1892,7 @@
   build: test
   language: c
   src:
-  - test/core/compression/compression_test.c
+  - test/core/compression/compression_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1970,7 +1904,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/concurrent_connectivity_test.c
+  - test/core/surface/concurrent_connectivity_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1983,7 +1917,7 @@
   build: test
   language: c
   src:
-  - test/core/end2end/connection_refused_test.c
+  - test/core/end2end/connection_refused_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -1994,7 +1928,7 @@
   build: test
   language: c
   src:
-  - test/core/client_channel/resolvers/dns_resolver_connectivity_test.c
+  - test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2006,7 +1940,7 @@
   build: test
   language: c
   src:
-  - test/core/client_channel/resolvers/dns_resolver_test.c
+  - test/core/client_channel/resolvers/dns_resolver_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2017,7 +1951,7 @@
   build: test
   language: c
   src:
-  - test/core/end2end/dualstack_socket_test.c
+  - test/core/end2end/dualstack_socket_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2033,7 +1967,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/endpoint_pair_test.c
+  - test/core/iomgr/endpoint_pair_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2046,7 +1980,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/error_test.c
+  - test/core/iomgr/error_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2058,7 +1992,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/ev_epollsig_linux_test.c
+  - test/core/iomgr/ev_epollsig_linux_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2072,7 +2006,7 @@
   build: test
   language: c
   src:
-  - test/core/client_channel/resolvers/fake_resolver_test.c
+  - test/core/client_channel/resolvers/fake_resolver_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2082,7 +2016,7 @@
   build: test
   language: c
   src:
-  - test/core/tsi/fake_transport_security_test.c
+  - test/core/tsi/fake_transport_security_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2097,7 +2031,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/fd_conservation_posix_test.c
+  - test/core/iomgr/fd_conservation_posix_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2113,7 +2047,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/fd_posix_test.c
+  - test/core/iomgr/fd_posix_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2130,7 +2064,7 @@
   run: false
   language: c
   src:
-  - test/core/fling/client.c
+  - test/core/fling/client.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2141,7 +2075,7 @@
   run: false
   language: c
   src:
-  - test/core/fling/server.c
+  - test/core/fling/server.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2152,7 +2086,7 @@
   build: test
   language: c
   src:
-  - test/core/fling/fling_stream_test.c
+  - test/core/fling/fling_stream_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2167,7 +2101,7 @@
   build: test
   language: c
   src:
-  - test/core/fling/fling_test.c
+  - test/core/fling/fling_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2204,7 +2138,7 @@
   build: test
   language: c
   src:
-  - test/core/end2end/goaway_server_test.c
+  - test/core/end2end/goaway_server_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2220,7 +2154,7 @@
   build: test
   language: c
   src:
-  - test/core/support/avl_test.c
+  - test/core/support/avl_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2229,7 +2163,7 @@
   build: test
   language: c
   src:
-  - test/core/support/cmdline_test.c
+  - test/core/support/cmdline_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2239,7 +2173,7 @@
   build: test
   language: c
   src:
-  - test/core/support/cpu_test.c
+  - test/core/support/cpu_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2248,7 +2182,7 @@
   build: test
   language: c
   src:
-  - test/core/support/env_test.c
+  - test/core/support/env_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2257,7 +2191,7 @@
   build: test
   language: c
   src:
-  - test/core/support/histogram_test.c
+  - test/core/support/histogram_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2266,7 +2200,7 @@
   build: test
   language: c
   src:
-  - test/core/support/host_port_test.c
+  - test/core/support/host_port_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2275,7 +2209,7 @@
   build: test
   language: c
   src:
-  - test/core/support/log_test.c
+  - test/core/support/log_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2285,7 +2219,7 @@
   build: test
   language: c
   src:
-  - test/core/support/mpscq_test.c
+  - test/core/support/mpscq_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2295,7 +2229,7 @@
   build: test
   language: c
   src:
-  - test/core/support/spinlock_test.c
+  - test/core/support/spinlock_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2305,7 +2239,7 @@
   build: test
   language: c
   src:
-  - test/core/support/stack_lockfree_test.c
+  - test/core/support/stack_lockfree_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2314,7 +2248,7 @@
   build: test
   language: c
   src:
-  - test/core/support/string_test.c
+  - test/core/support/string_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2324,7 +2258,7 @@
   build: test
   language: c
   src:
-  - test/core/support/sync_test.c
+  - test/core/support/sync_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2334,7 +2268,7 @@
   build: test
   language: c
   src:
-  - test/core/support/thd_test.c
+  - test/core/support/thd_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2343,7 +2277,7 @@
   build: test
   language: c
   src:
-  - test/core/support/time_test.c
+  - test/core/support/time_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2352,7 +2286,7 @@
   build: test
   language: c
   src:
-  - test/core/support/tls_test.c
+  - test/core/support/tls_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2361,7 +2295,7 @@
   build: test
   language: c
   src:
-  - test/core/support/useful_test.c
+  - test/core/support/useful_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2370,7 +2304,7 @@
   build: test
   language: c
   src:
-  - test/core/security/auth_context_test.c
+  - test/core/security/auth_context_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2381,7 +2315,7 @@
   build: test
   language: c
   src:
-  - test/core/slice/b64_test.c
+  - test/core/slice/b64_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2392,7 +2326,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/byte_buffer_reader_test.c
+  - test/core/surface/byte_buffer_reader_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2403,7 +2337,7 @@
   build: test
   language: c
   src:
-  - test/core/channel/channel_args_test.c
+  - test/core/channel/channel_args_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2414,7 +2348,7 @@
   build: test
   language: c
   src:
-  - test/core/channel/channel_stack_builder_test.c
+  - test/core/channel/channel_stack_builder_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2424,7 +2358,7 @@
   build: test
   language: c
   src:
-  - test/core/channel/channel_stack_test.c
+  - test/core/channel/channel_stack_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2435,7 +2369,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/completion_queue_test.c
+  - test/core/surface/completion_queue_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2445,7 +2379,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/completion_queue_threading_test.c
+  - test/core/surface/completion_queue_threading_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2457,7 +2391,7 @@
   build: tool
   language: c
   src:
-  - test/core/security/create_jwt.c
+  - test/core/security/create_jwt.cc
   deps:
   - grpc
   - gpr
@@ -2467,7 +2401,7 @@
   build: test
   language: c
   src:
-  - test/core/security/credentials_test.c
+  - test/core/security/credentials_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2478,7 +2412,7 @@
   run: false
   language: c
   src:
-  - test/core/security/fetch_oauth2.c
+  - test/core/security/fetch_oauth2.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2488,7 +2422,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/invalid_channel_args_test.c
+  - test/core/surface/invalid_channel_args_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2499,7 +2433,7 @@
   build: test
   language: c
   src:
-  - test/core/security/json_token_test.c
+  - test/core/security/json_token_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2514,7 +2448,7 @@
   build: test
   language: c
   src:
-  - test/core/security/jwt_verifier_test.c
+  - test/core/security/jwt_verifier_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2525,7 +2459,7 @@
   build: tool
   language: c
   src:
-  - test/core/security/print_google_default_creds_token.c
+  - test/core/security/print_google_default_creds_token.cc
   deps:
   - grpc
   - gpr
@@ -2534,7 +2468,17 @@
   build: test
   language: c
   src:
-  - test/core/security/security_connector_test.c
+  - test/core/security/security_connector_test.cc
+  deps:
+  - grpc_test_util
+  - grpc
+  - gpr_test_util
+  - gpr
+- name: grpc_ssl_credentials_test
+  build: test
+  language: c
+  src:
+  - test/core/security/ssl_credentials_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2544,7 +2488,7 @@
   build: tool
   language: c
   src:
-  - test/core/security/verify_jwt.c
+  - test/core/security/verify_jwt.cc
   deps:
   - grpc
   - gpr
@@ -2553,7 +2497,7 @@
   build: test
   language: c
   src:
-  - test/core/handshake/client_ssl.c
+  - test/core/handshake/client_ssl.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2568,7 +2512,7 @@
   build: test
   language: c
   src:
-  - test/core/handshake/server_ssl.c
+  - test/core/handshake/server_ssl.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2583,7 +2527,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/transport/chttp2/hpack_parser_fuzzer_test.c
+  - test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2597,7 +2541,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/chttp2/hpack_parser_test.c
+  - test/core/transport/chttp2/hpack_parser_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2608,7 +2552,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/chttp2/hpack_table_test.c
+  - test/core/transport/chttp2/hpack_table_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2619,7 +2563,7 @@
   build: test
   language: c
   src:
-  - test/core/http/parser_test.c
+  - test/core/http/parser_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2630,7 +2574,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/http/request_fuzzer.c
+  - test/core/http/request_fuzzer.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2643,7 +2587,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/http/response_fuzzer.c
+  - test/core/http/response_fuzzer.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2656,7 +2600,7 @@
   build: test
   language: c
   src:
-  - test/core/http/format_request_test.c
+  - test/core/http/format_request_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2667,7 +2611,7 @@
   build: test
   language: c
   src:
-  - test/core/http/httpcli_test.c
+  - test/core/http/httpcli_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2682,7 +2626,7 @@
   build: test
   language: c
   src:
-  - test/core/http/httpscli_test.c
+  - test/core/http/httpscli_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2694,7 +2638,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/init_test.c
+  - test/core/surface/init_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2706,7 +2650,7 @@
   build: test
   language: c
   src:
-  - test/core/end2end/invalid_call_argument_test.c
+  - test/core/end2end/invalid_call_argument_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2716,7 +2660,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/json/fuzzer.c
+  - test/core/json/fuzzer.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2730,7 +2674,7 @@
   run: false
   language: c
   src:
-  - test/core/json/json_rewrite.c
+  - test/core/json/json_rewrite.cc
   deps:
   - grpc
   - gpr
@@ -2739,7 +2683,7 @@
   build: test
   language: c
   src:
-  - test/core/json/json_rewrite_test.c
+  - test/core/json/json_rewrite_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2750,7 +2694,7 @@
   build: test
   language: c
   src:
-  - test/core/json/json_stream_error_test.c
+  - test/core/json/json_stream_error_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2761,7 +2705,7 @@
   build: test
   language: c
   src:
-  - test/core/json/json_test.c
+  - test/core/json/json_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2772,7 +2716,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/lame_client_test.c
+  - test/core/surface/lame_client_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2784,7 +2728,7 @@
   run: false
   language: c
   src:
-  - test/core/client_channel/lb_policies_test.c
+  - test/core/client_channel/lb_policies_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2795,7 +2739,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/load_file_test.c
+  - test/core/iomgr/load_file_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2806,7 +2750,7 @@
   build: benchmark
   language: c
   src:
-  - test/core/network_benchmarks/low_level_ping_pong.c
+  - test/core/network_benchmarks/low_level_ping_pong.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2821,7 +2765,7 @@
   run: false
   language: c
   src:
-  - test/core/memory_usage/client.c
+  - test/core/memory_usage/client.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2833,7 +2777,7 @@
   run: false
   language: c
   src:
-  - test/core/memory_usage/server.c
+  - test/core/memory_usage/server.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2844,7 +2788,7 @@
   build: test
   language: c
   src:
-  - test/core/memory_usage/memory_usage_test.c
+  - test/core/memory_usage/memory_usage_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2858,7 +2802,7 @@
   build: test
   language: c
   src:
-  - test/core/compression/message_compress_test.c
+  - test/core/compression/message_compress_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2869,19 +2813,7 @@
   build: test
   language: c
   src:
-  - test/core/channel/minimal_stack_is_minimal_test.c
-  deps:
-  - grpc_test_util
-  - grpc
-  - gpr_test_util
-  - gpr
-  uses_polling: false
-- name: mlog_test
-  flaky: true
-  build: test
-  language: c
-  src:
-  - test/core/census/mlog_test.c
+  - test/core/channel/minimal_stack_is_minimal_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2892,7 +2824,7 @@
   build: test
   language: c
   src:
-  - test/core/end2end/multiple_server_queues_test.c
+  - test/core/end2end/multiple_server_queues_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2902,7 +2834,7 @@
   build: test
   language: c
   src:
-  - test/core/support/murmur_hash_test.c
+  - test/core/support/murmur_hash_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -2911,7 +2843,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/nanopb/fuzzer_response.c
+  - test/core/nanopb/fuzzer_response.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2924,7 +2856,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/nanopb/fuzzer_serverlist.c
+  - test/core/nanopb/fuzzer_serverlist.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2938,7 +2870,7 @@
   build: test
   language: c
   src:
-  - test/core/end2end/no_server_test.c
+  - test/core/end2end/no_server_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2948,7 +2880,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/num_external_connectivity_watchers_test.c
+  - test/core/surface/num_external_connectivity_watchers_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2960,7 +2892,7 @@
   build: test
   language: c
   src:
-  - test/core/client_channel/parse_address_test.c
+  - test/core/client_channel/parse_address_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2971,7 +2903,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/slice/percent_decode_fuzzer.c
+  - test/core/slice/percent_decode_fuzzer.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2984,7 +2916,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/slice/percent_encode_fuzzer.c
+  - test/core/slice/percent_encode_fuzzer.cc
   deps:
   - grpc_test_util
   - grpc
@@ -2997,7 +2929,7 @@
   build: test
   language: c
   src:
-  - test/core/slice/percent_encoding_test.c
+  - test/core/slice/percent_encoding_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3008,7 +2940,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/pollset_set_test.c
+  - test/core/iomgr/pollset_set_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3022,7 +2954,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/resolve_address_posix_test.c
+  - test/core/iomgr/resolve_address_posix_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3038,7 +2970,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/resolve_address_test.c
+  - test/core/iomgr/resolve_address_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3049,7 +2981,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/resource_quota_test.c
+  - test/core/iomgr/resource_quota_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3059,7 +2991,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/secure_channel_create_test.c
+  - test/core/surface/secure_channel_create_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3069,7 +3001,7 @@
   build: test
   language: c
   src:
-  - test/core/security/secure_endpoint_test.c
+  - test/core/security/secure_endpoint_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3081,7 +3013,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/sequential_connectivity_test.c
+  - test/core/surface/sequential_connectivity_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3093,7 +3025,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/server_chttp2_test.c
+  - test/core/surface/server_chttp2_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3103,7 +3035,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/end2end/fuzzers/server_fuzzer.c
+  - test/core/end2end/fuzzers/server_fuzzer.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3117,7 +3049,7 @@
   build: test
   language: c
   src:
-  - test/core/surface/server_test.c
+  - test/core/surface/server_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3127,7 +3059,7 @@
   build: test
   language: c
   src:
-  - test/core/slice/slice_buffer_test.c
+  - test/core/slice/slice_buffer_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3138,7 +3070,7 @@
   build: test
   language: c
   src:
-  - test/core/slice/slice_hash_table_test.c
+  - test/core/slice/slice_hash_table_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3149,7 +3081,7 @@
   build: test
   language: c
   src:
-  - test/core/slice/slice_string_helpers_test.c
+  - test/core/slice/slice_string_helpers_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3160,7 +3092,7 @@
   build: test
   language: c
   src:
-  - test/core/slice/slice_test.c
+  - test/core/slice/slice_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3171,7 +3103,7 @@
   build: test
   language: c
   src:
-  - test/core/client_channel/resolvers/sockaddr_resolver_test.c
+  - test/core/client_channel/resolvers/sockaddr_resolver_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3181,7 +3113,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/sockaddr_utils_test.c
+  - test/core/iomgr/sockaddr_utils_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3191,7 +3123,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/socket_utils_test.c
+  - test/core/iomgr/socket_utils_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3207,7 +3139,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/security/ssl_server_fuzzer.c
+  - test/core/security/ssl_server_fuzzer.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3220,7 +3152,7 @@
   build: test
   language: c
   src:
-  - test/core/tsi/ssl_transport_security_test.c
+  - test/core/tsi/ssl_transport_security_test.cc
   deps:
   - gpr_test_util
   - gpr
@@ -3235,7 +3167,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/status_conversion_test.c
+  - test/core/transport/status_conversion_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3246,7 +3178,7 @@
   build: test
   language: c
   src:
-  - test/core/compression/stream_compression_test.c
+  - test/core/compression/stream_compression_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3257,7 +3189,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/stream_owned_slice_test.c
+  - test/core/transport/stream_owned_slice_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3269,7 +3201,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/tcp_client_posix_test.c
+  - test/core/iomgr/tcp_client_posix_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3286,7 +3218,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/tcp_client_uv_test.c
+  - test/core/iomgr/tcp_client_uv_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3299,7 +3231,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/tcp_posix_test.c
+  - test/core/iomgr/tcp_posix_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3315,7 +3247,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/tcp_server_posix_test.c
+  - test/core/iomgr/tcp_server_posix_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3331,7 +3263,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/tcp_server_uv_test.c
+  - test/core/iomgr/tcp_server_uv_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3343,7 +3275,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/time_averaged_stats_test.c
+  - test/core/iomgr/time_averaged_stats_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3354,7 +3286,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/timeout_encoding_test.c
+  - test/core/transport/timeout_encoding_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3365,7 +3297,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/timer_heap_test.c
+  - test/core/iomgr/timer_heap_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3378,7 +3310,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/timer_list_test.c
+  - test/core/iomgr/timer_list_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3391,7 +3323,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/connectivity_state_test.c
+  - test/core/transport/connectivity_state_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3401,7 +3333,7 @@
   build: test
   language: c
   src:
-  - test/core/transport/metadata_test.c
+  - test/core/transport/metadata_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3411,7 +3343,7 @@
   build: test
   language: c
   src:
-  - test/core/tsi/transport_security_test.c
+  - test/core/tsi/transport_security_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3425,7 +3357,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/udp_server_test.c
+  - test/core/iomgr/udp_server_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3441,7 +3373,7 @@
   build: fuzzer
   language: c
   src:
-  - test/core/client_channel/uri_fuzzer_test.c
+  - test/core/client_channel/uri_fuzzer_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3454,7 +3386,7 @@
   build: test
   language: c
   src:
-  - test/core/client_channel/uri_parser_test.c
+  - test/core/client_channel/uri_parser_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3464,7 +3396,7 @@
   build: test
   language: c
   src:
-  - test/core/iomgr/wakeup_fd_cv_test.c
+  - test/core/iomgr/wakeup_fd_cv_test.cc
   deps:
   - grpc_test_util
   - grpc
@@ -3543,8 +3475,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3566,8 +3496,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3589,8 +3517,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3612,8 +3538,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3634,8 +3558,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3656,8 +3578,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3678,8 +3598,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=4
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3700,8 +3618,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3725,8 +3641,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   excluded_poll_engines:
@@ -3753,8 +3667,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   excluded_poll_engines:
@@ -3780,10 +3692,10 @@
   - gpr_test_util
   - gpr
   - grpc++_test_config
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
+  exclude_configs:
+  - tsan
   excluded_poll_engines:
   - poll
   - poll-cv
@@ -3808,8 +3720,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   excluded_poll_engines:
@@ -3834,8 +3744,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3857,8 +3765,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  args:
-  - --benchmark_min_time=0
   benchmark: true
   defaults: benchmark
   platforms:
@@ -3945,9 +3851,6 @@
   - grpc
   - gpr_test_util
   - gpr
-  excluded_poll_engines:
-  - poll
-  - poll-cv
 - name: codegen_test_full
   gtest: true
   build: test
@@ -4236,9 +4139,6 @@
   - grpc
   - gpr_test_util
   - gpr
-  excluded_poll_engines:
-  - poll
-  - poll-cv
 - name: grpclb_test
   gtest: false
   build: test
@@ -4253,9 +4153,6 @@
   - grpc
   - gpr_test_util
   - gpr
-  excluded_poll_engines:
-  - poll
-  - poll-cv
 - name: h2_ssl_cert_test
   gtest: true
   build: test
@@ -4826,7 +4723,6 @@
   - grpc_unsecure
   - gpr_test_util
   - gpr
-  timeout_seconds: 1200
 - name: transport_pid_controller_test
   build: test
   language: c++
@@ -5039,45 +4935,6 @@
   zlib:
     CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration
       $(W_NO_SHIFT_NEGATIVE_VALUE) -fvisibility=hidden
-node_modules:
-- deps:
-  - grpc
-  - gpr
-  - boringssl
-  - z
-  headers:
-  - src/node/ext/byte_buffer.h
-  - src/node/ext/call.h
-  - src/node/ext/call_credentials.h
-  - src/node/ext/channel.h
-  - src/node/ext/channel_credentials.h
-  - src/node/ext/completion_queue.h
-  - src/node/ext/server.h
-  - src/node/ext/server_credentials.h
-  - src/node/ext/slice.h
-  - src/node/ext/timeval.h
-  js:
-  - src/node/index.js
-  - src/node/src/client.js
-  - src/node/src/common.js
-  - src/node/src/credentials.js
-  - src/node/src/constants.js
-  - src/node/src/grpc_extension.js
-  - src/node/src/metadata.js
-  - src/node/src/server.js
-  name: grpc_node
-  src:
-  - src/node/ext/byte_buffer.cc
-  - src/node/ext/call.cc
-  - src/node/ext/call_credentials.cc
-  - src/node/ext/channel.cc
-  - src/node/ext/channel_credentials.cc
-  - src/node/ext/completion_queue.cc
-  - src/node/ext/node_grpc.cc
-  - src/node/ext/server.cc
-  - src/node/ext/server_credentials.cc
-  - src/node/ext/slice.cc
-  - src/node/ext/timeval.cc
 openssl_fallback:
   base_uri: https://openssl.org/source/old/1.0.2/
   extraction_dir: openssl-1.0.2f
diff --git a/config.m4 b/config.m4
index 5d92a2a..5cb46cf 100644
--- a/config.m4
+++ b/config.m4
@@ -278,6 +278,7 @@
     src/core/tsi/transport_security_adapter.cc \
     src/core/ext/transport/chttp2/server/chttp2_server.cc \
     src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc \
+    src/core/ext/filters/client_channel/backup_poller.cc \
     src/core/ext/filters/client_channel/channel_connectivity.cc \
     src/core/ext/filters/client_channel/client_channel.cc \
     src/core/ext/filters/client_channel/client_channel_factory.cc \
@@ -317,6 +318,7 @@
     third_party/nanopb/pb_encode.c \
     src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
     src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
+    src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc \
     src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
     src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
     src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \
@@ -326,21 +328,7 @@
     src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
     src/core/ext/filters/load_reporting/server_load_reporting_filter.cc \
     src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc \
-    src/core/ext/census/base_resources.cc \
-    src/core/ext/census/context.cc \
-    src/core/ext/census/gen/census.pb.c \
-    src/core/ext/census/gen/trace_context.pb.c \
     src/core/ext/census/grpc_context.cc \
-    src/core/ext/census/grpc_filter.cc \
-    src/core/ext/census/grpc_plugin.cc \
-    src/core/ext/census/initialize.cc \
-    src/core/ext/census/intrusive_hash_map.cc \
-    src/core/ext/census/mlog.cc \
-    src/core/ext/census/operation.cc \
-    src/core/ext/census/placeholders.cc \
-    src/core/ext/census/resource.cc \
-    src/core/ext/census/trace_context.cc \
-    src/core/ext/census/tracing.cc \
     src/core/ext/filters/max_age/max_age_filter.cc \
     src/core/ext/filters/message_size/message_size_filter.cc \
     src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
@@ -658,8 +646,8 @@
 
   PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl)
   PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census)
-  PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census/gen)
   PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy)
   PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb)
   PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1)
   PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/pick_first)
diff --git a/config.w32 b/config.w32
index 67b5e2f..0fc5066 100644
--- a/config.w32
+++ b/config.w32
@@ -255,6 +255,7 @@
     "src\\core\\tsi\\transport_security_adapter.cc " +
     "src\\core\\ext\\transport\\chttp2\\server\\chttp2_server.cc " +
     "src\\core\\ext\\transport\\chttp2\\client\\secure\\secure_channel_create.cc " +
+    "src\\core\\ext\\filters\\client_channel\\backup_poller.cc " +
     "src\\core\\ext\\filters\\client_channel\\channel_connectivity.cc " +
     "src\\core\\ext\\filters\\client_channel\\client_channel.cc " +
     "src\\core\\ext\\filters\\client_channel\\client_channel_factory.cc " +
@@ -294,6 +295,7 @@
     "third_party\\nanopb\\pb_encode.c " +
     "src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " +
     "src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first\\pick_first.cc " +
+    "src\\core\\ext\\filters\\client_channel\\lb_policy\\subchannel_list.cc " +
     "src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin\\round_robin.cc " +
     "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\dns_resolver_ares.cc " +
     "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_ev_driver_posix.cc " +
@@ -303,21 +305,7 @@
     "src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr\\sockaddr_resolver.cc " +
     "src\\core\\ext\\filters\\load_reporting\\server_load_reporting_filter.cc " +
     "src\\core\\ext\\filters\\load_reporting\\server_load_reporting_plugin.cc " +
-    "src\\core\\ext\\census\\base_resources.cc " +
-    "src\\core\\ext\\census\\context.cc " +
-    "src\\core\\ext\\census\\gen\\census.pb.c " +
-    "src\\core\\ext\\census\\gen\\trace_context.pb.c " +
     "src\\core\\ext\\census\\grpc_context.cc " +
-    "src\\core\\ext\\census\\grpc_filter.cc " +
-    "src\\core\\ext\\census\\grpc_plugin.cc " +
-    "src\\core\\ext\\census\\initialize.cc " +
-    "src\\core\\ext\\census\\intrusive_hash_map.cc " +
-    "src\\core\\ext\\census\\mlog.cc " +
-    "src\\core\\ext\\census\\operation.cc " +
-    "src\\core\\ext\\census\\placeholders.cc " +
-    "src\\core\\ext\\census\\resource.cc " +
-    "src\\core\\ext\\census\\trace_context.cc " +
-    "src\\core\\ext\\census\\tracing.cc " +
     "src\\core\\ext\\filters\\max_age\\max_age_filter.cc " +
     "src\\core\\ext\\filters\\message_size\\message_size_filter.cc " +
     "src\\core\\ext\\filters\\workarounds\\workaround_cronet_compression_filter.cc " +
@@ -661,7 +649,6 @@
   FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core");
   FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext");
   FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\census");
-  FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\census\\gen");
   FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters");
   FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel");
   FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy");
diff --git a/doc/connectivity-semantics-and-api.md b/doc/connectivity-semantics-and-api.md
index 6d39619..dc30fe5 100644
--- a/doc/connectivity-semantics-and-api.md
+++ b/doc/connectivity-semantics-and-api.md
@@ -115,8 +115,14 @@
 -----------------
 
 All gRPC libraries will expose a channel-level API method to poll the current
-state of a channel. In C++, this method is called GetCurrentState and returns
-an enum for one of the five legal states.
+state of a channel. In C++, this method is called GetState and returns an enum
+for one of the five legal states. It also accepts a boolean `try_to_connect` to
+transition to CONNECTING if the channel is currently IDLE. The boolean should
+act as if an RPC occurred, so it should also reset IDLE_TIMEOUT.
+
+```cpp
+grpc_connectivity_state GetState(bool try_to_connect);
+```
 
 All libraries should also expose an API that enables the application (user of
 the gRPC API) to be notified when the channel state changes. Since state
@@ -127,11 +133,11 @@
 The synchronous version of this API is:
 
 ```cpp
-bool WaitForStateChange(gpr_timespec deadline, ChannelState source_state);
+bool WaitForStateChange(grpc_connectivity_state source_state, gpr_timespec deadline);
 ```
 
-which returns true when the state changes to something other than the
-source_state and false if the deadline expires. Asynchronous and futures based
+which returns `true` when the state is something other than the
+`source_state` and `false` if the deadline expires. Asynchronous- and futures-based
 APIs should have a corresponding method that allows the application to be
 notified when the state of a channel changes.
 
diff --git a/doc/environment_variables.md b/doc/environment_variables.md
index c5fb266..40af758 100644
--- a/doc/environment_variables.md
+++ b/doc/environment_variables.md
@@ -120,10 +120,10 @@
     perform name resolution
   - ares - a DNS resolver based around the c-ares library
 
-* GRPC_DISABLE_CHANNEL_CONNECTIVITY_WATCHER
-  The channel connectivity watcher uses one extra thread to check the channel
-  state every 500 ms on the client side. It can help reconnect disconnected
-  client channels (mostly due to idleness), so that the next RPC on this channel
-  won't fail. Set to 1 to turn off this watcher and save a thread. Please note
-  this is a temporary work-around, it will be removed in the future once we have
-  support for automatically reestablishing failed connections.
+* GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS
+  Default: 5000
+  Declares the interval between two backup polls on client channels. These polls
+  are run in the timer thread so that gRPC can process connection failures while
+  there is no active polling thread. They help reconnect disconnected client
+  channels (mostly due to idleness), so that the next RPC on this channel won't
+  fail. Set to 0 to turn off the backup polls.
diff --git a/examples/php/README.md b/examples/php/README.md
index d30cbda..49703ce 100644
--- a/examples/php/README.md
+++ b/examples/php/README.md
@@ -41,10 +41,11 @@
    $ node greeter_server.js
    ```
 
- - Run the client
+ - Generate proto files and run the client
 
    ```
    $ cd examples/php
+   $ ./greeter_proto_gen.sh
    $ ./run_greeter_client.sh
    ```
 
diff --git a/examples/php/greeter_client.php b/examples/php/greeter_client.php
index 981319a..bb94a08 100644
--- a/examples/php/greeter_client.php
+++ b/examples/php/greeter_client.php
@@ -17,12 +17,14 @@
  *
  */
 
+// php:generate protoc --proto_path=./../protos   --php_out=./   --grpc_out=./ --plugin=protoc-gen-grpc=./../../bins/opt/grpc_php_plugin ./../protos/helloworld.proto
+
 require dirname(__FILE__).'/vendor/autoload.php';
 
-// The following includes are needed when using protobuf 3.1.0
-// and will suppress warnings when using protobuf 3.2.0+
-@include_once dirname(__FILE__).'/helloworld.pb.php';
-@include_once dirname(__FILE__).'/helloworld_grpc_pb.php';
+@include_once dirname(__FILE__).'/Helloworld/GreeterClient.php';
+@include_once dirname(__FILE__).'/Helloworld/HelloReply.php';
+@include_once dirname(__FILE__).'/Helloworld/HelloRequest.php';
+@include_once dirname(__FILE__).'/GPBMetadata/Helloworld.php';
 
 function greet($name)
 {
diff --git a/examples/php/greeter_proto_gen.sh b/examples/php/greeter_proto_gen.sh
new file mode 100755
index 0000000..a0d7b29
--- /dev/null
+++ b/examples/php/greeter_proto_gen.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+protoc --proto_path=./../protos   --php_out=./   --grpc_out=./   --plugin=protoc-gen-grpc=./../../bins/opt/grpc_php_plugin   ./../protos/helloworld.proto
+
diff --git a/examples/php/helloworld.pb.php b/examples/php/helloworld.pb.php
deleted file mode 100644
index 757a4a5..0000000
--- a/examples/php/helloworld.pb.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: helloworld.proto
-
-namespace Helloworld;
-
-use Google\Protobuf\Internal\DescriptorPool;
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-class HelloRequest extends \Google\Protobuf\Internal\Message
-{
-    private $name = '';
-
-    public function getName()
-    {
-        return $this->name;
-    }
-
-    public function setName($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->name = $var;
-    }
-
-}
-
-class HelloReply extends \Google\Protobuf\Internal\Message
-{
-    private $message = '';
-
-    public function getMessage()
-    {
-        return $this->message;
-    }
-
-    public function setMessage($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->message = $var;
-    }
-
-}
-
-$pool = DescriptorPool::getGeneratedPool();
-
-$pool->internalAddGeneratedFile(hex2bin(
-    "0ae6010a1068656c6c6f776f726c642e70726f746f120a68656c6c6f776f" .
-    "726c64221c0a0c48656c6c6f52657175657374120c0a046e616d65180120" .
-    "012809221d0a0a48656c6c6f5265706c79120f0a076d6573736167651801" .
-    "2001280932490a0747726565746572123e0a0853617948656c6c6f12182e" .
-    "68656c6c6f776f726c642e48656c6c6f526571756573741a162e68656c6c" .
-    "6f776f726c642e48656c6c6f5265706c79220042360a1b696f2e67727063" .
-    "2e6578616d706c65732e68656c6c6f776f726c64420f48656c6c6f576f72" .
-    "6c6450726f746f5001a20203484c57620670726f746f33"
-));
-
diff --git a/examples/php/helloworld_grpc_pb.php b/examples/php/helloworld_grpc_pb.php
deleted file mode 100644
index ba83ed2..0000000
--- a/examples/php/helloworld_grpc_pb.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-// GENERATED CODE -- DO NOT EDIT!
-
-// Original file comments:
-// Copyright 2015 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-namespace Helloworld {
-
-  // The greeting service definition.
-  class GreeterClient extends \Grpc\BaseStub {
-
-    /**
-     * @param string $hostname hostname
-     * @param array $opts channel options
-     * @param Grpc\Channel $channel (optional) re-use channel object
-     */
-    public function __construct($hostname, $opts, $channel = null) {
-      parent::__construct($hostname, $opts, $channel);
-    }
-
-    /**
-     * Sends a greeting
-     * @param \Helloworld\HelloRequest $argument input argument
-     * @param array $metadata metadata
-     * @param array $options call options
-     */
-    public function SayHello(\Helloworld\HelloRequest $argument,
-      $metadata = [], $options = []) {
-      return $this->_simpleRequest('/helloworld.Greeter/SayHello',
-      $argument,
-      ['\Helloworld\HelloReply', 'decode'],
-      $metadata, $options);
-    }
-
-  }
-
-}
diff --git a/examples/php/route_guide/route_guide.pb.php b/examples/php/route_guide/route_guide.pb.php
deleted file mode 100644
index 78f3ea6..0000000
--- a/examples/php/route_guide/route_guide.pb.php
+++ /dev/null
@@ -1,209 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: route_guide.proto
-
-namespace Routeguide;
-
-use Google\Protobuf\Internal\DescriptorPool;
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-class Point extends \Google\Protobuf\Internal\Message
-{
-    private $latitude = 0;
-    private $longitude = 0;
-
-    public function getLatitude()
-    {
-        return $this->latitude;
-    }
-
-    public function setLatitude($var)
-    {
-        GPBUtil::checkInt32($var);
-        $this->latitude = $var;
-    }
-
-    public function getLongitude()
-    {
-        return $this->longitude;
-    }
-
-    public function setLongitude($var)
-    {
-        GPBUtil::checkInt32($var);
-        $this->longitude = $var;
-    }
-
-}
-
-class Rectangle extends \Google\Protobuf\Internal\Message
-{
-    private $lo = null;
-    private $hi = null;
-
-    public function getLo()
-    {
-        return $this->lo;
-    }
-
-    public function setLo(&$var)
-    {
-        GPBUtil::checkMessage($var, \Routeguide\Point::class);
-        $this->lo = $var;
-    }
-
-    public function getHi()
-    {
-        return $this->hi;
-    }
-
-    public function setHi(&$var)
-    {
-        GPBUtil::checkMessage($var, \Routeguide\Point::class);
-        $this->hi = $var;
-    }
-
-}
-
-class Feature extends \Google\Protobuf\Internal\Message
-{
-    private $name = '';
-    private $location = null;
-
-    public function getName()
-    {
-        return $this->name;
-    }
-
-    public function setName($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->name = $var;
-    }
-
-    public function getLocation()
-    {
-        return $this->location;
-    }
-
-    public function setLocation(&$var)
-    {
-        GPBUtil::checkMessage($var, \Routeguide\Point::class);
-        $this->location = $var;
-    }
-
-}
-
-class RouteNote extends \Google\Protobuf\Internal\Message
-{
-    private $location = null;
-    private $message = '';
-
-    public function getLocation()
-    {
-        return $this->location;
-    }
-
-    public function setLocation(&$var)
-    {
-        GPBUtil::checkMessage($var, \Routeguide\Point::class);
-        $this->location = $var;
-    }
-
-    public function getMessage()
-    {
-        return $this->message;
-    }
-
-    public function setMessage($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->message = $var;
-    }
-
-}
-
-class RouteSummary extends \Google\Protobuf\Internal\Message
-{
-    private $point_count = 0;
-    private $feature_count = 0;
-    private $distance = 0;
-    private $elapsed_time = 0;
-
-    public function getPointCount()
-    {
-        return $this->point_count;
-    }
-
-    public function setPointCount($var)
-    {
-        GPBUtil::checkInt32($var);
-        $this->point_count = $var;
-    }
-
-    public function getFeatureCount()
-    {
-        return $this->feature_count;
-    }
-
-    public function setFeatureCount($var)
-    {
-        GPBUtil::checkInt32($var);
-        $this->feature_count = $var;
-    }
-
-    public function getDistance()
-    {
-        return $this->distance;
-    }
-
-    public function setDistance($var)
-    {
-        GPBUtil::checkInt32($var);
-        $this->distance = $var;
-    }
-
-    public function getElapsedTime()
-    {
-        return $this->elapsed_time;
-    }
-
-    public function setElapsedTime($var)
-    {
-        GPBUtil::checkInt32($var);
-        $this->elapsed_time = $var;
-    }
-
-}
-
-$pool = DescriptorPool::getGeneratedPool();
-
-$pool->internalAddGeneratedFile(hex2bin(
-    "0ac5050a11726f7574655f67756964652e70726f746f120a726f75746567" .
-    "75696465222c0a05506f696e7412100a086c617469747564651801200128" .
-    "0512110a096c6f6e67697475646518022001280522490a0952656374616e" .
-    "676c65121d0a026c6f18012001280b32112e726f75746567756964652e50" .
-    "6f696e74121d0a02686918022001280b32112e726f75746567756964652e" .
-    "506f696e74223c0a0746656174757265120c0a046e616d65180120012809" .
-    "12230a086c6f636174696f6e18022001280b32112e726f75746567756964" .
-    "652e506f696e7422410a09526f7574654e6f746512230a086c6f63617469" .
-    "6f6e18012001280b32112e726f75746567756964652e506f696e74120f0a" .
-    "076d65737361676518022001280922620a0c526f75746553756d6d617279" .
-    "12130a0b706f696e745f636f756e7418012001280512150a0d6665617475" .
-    "72655f636f756e7418022001280512100a0864697374616e636518032001" .
-    "280512140a0c656c61707365645f74696d651804200128053285020a0a52" .
-    "6f757465477569646512360a0a4765744665617475726512112e726f7574" .
-    "6567756964652e506f696e741a132e726f75746567756964652e46656174" .
-    "7572652200123e0a0c4c697374466561747572657312152e726f75746567" .
-    "756964652e52656374616e676c651a132e726f75746567756964652e4665" .
-    "617475726522003001123e0a0b5265636f7264526f75746512112e726f75" .
-    "746567756964652e506f696e741a182e726f75746567756964652e526f75" .
-    "746553756d6d61727922002801123f0a09526f7574654368617412152e72" .
-    "6f75746567756964652e526f7574654e6f74651a152e726f757465677569" .
-    "64652e526f7574654e6f746522002801300142360a1b696f2e677270632e" .
-    "6578616d706c65732e726f7574656775696465420f526f75746547756964" .
-    "6550726f746f5001a20203525447620670726f746f33"
-));
-
diff --git a/examples/php/route_guide/route_guide_client.php b/examples/php/route_guide/route_guide_client.php
index 8ac7977..92b2bac 100644
--- a/examples/php/route_guide/route_guide_client.php
+++ b/examples/php/route_guide/route_guide_client.php
@@ -17,12 +17,9 @@
  *
  */
 
-require dirname(__FILE__).'/../vendor/autoload.php';
+// php:generate protoc --proto_path=./../../protos  --php_out=./  --grpc_out=./ --plugin=protoc-gen-grpc=./../../../bins/opt/grpc_php_plugin ./../../protos/route_guide.proto
 
-// The following includes are needed when using protobuf 3.1.0
-// and will suppress warnings when using protobuf 3.2.0+
-@include_once dirname(__FILE__).'/route_guide.pb.php';
-@include_once dirname(__FILE__).'/route_guide_grpc_pb.php';
+require dirname(__FILE__).'/../vendor/autoload.php';
 
 define('COORD_FACTOR', 1e7);
 
@@ -38,9 +35,12 @@
     } else {
         $name_str = "feature called $name";
     }
-    echo sprintf("Found %s \n  at %f, %f\n", $name_str,
+    echo sprintf(
+        "Found %s \n  at %f, %f\n",
+        $name_str,
                  $feature->getLocation()->getLatitude() / COORD_FACTOR,
-                 $feature->getLocation()->getLongitude() / COORD_FACTOR);
+                 $feature->getLocation()->getLongitude() / COORD_FACTOR
+    );
 }
 
 /**
@@ -122,19 +122,24 @@
         $feature_name = $db[$index]['name'];
         $point->setLatitude($lat);
         $point->setLongitude($long);
-        echo sprintf("Visiting point %f, %f,\n  with feature name: %s\n",
-                     $lat / COORD_FACTOR, $long / COORD_FACTOR,
-                     $feature_name ? $feature_name : '<empty>');
+        echo sprintf(
+            "Visiting point %f, %f,\n  with feature name: %s\n",
+                     $lat / COORD_FACTOR,
+            $long / COORD_FACTOR,
+                     $feature_name ? $feature_name : '<empty>'
+        );
         usleep(rand(300000, 800000));
         $call->write($point);
     }
     list($route_summary, $status) = $call->wait();
-    echo sprintf("Finished trip with %d points\nPassed %d features\n".
+    echo sprintf(
+        "Finished trip with %d points\nPassed %d features\n".
                  "Travelled %d meters\nIt took %d seconds\n",
                  $route_summary->getPointCount(),
                  $route_summary->getFeatureCount(),
                  $route_summary->getDistance(),
-                 $route_summary->getElapsedTime());
+                 $route_summary->getElapsedTime()
+    );
 }
 
 /**
@@ -166,8 +171,12 @@
         $route_note->setLocation($point);
         $route_note->setMessage($message = $n[2]);
 
-        echo sprintf("Sending message: '%s' at (%d, %d)\n",
-                     $message, $lat, $long);
+        echo sprintf(
+            "Sending message: '%s' at (%d, %d)\n",
+                     $message,
+            $lat,
+            $long
+        );
         // send a bunch of messages to the server
         $call->write($route_note);
     }
@@ -175,10 +184,12 @@
 
     // read from the server until there's no more
     while ($route_note_reply = $call->read()) {
-        echo sprintf("Previous left message at (%d, %d): '%s'\n",
+        echo sprintf(
+            "Previous left message at (%d, %d): '%s'\n",
                      $route_note_reply->getLocation()->getLatitude(),
                      $route_note_reply->getLocation()->getLongitude(),
-                     $route_note_reply->getMessage());
+                     $route_note_reply->getMessage()
+        );
     }
 }
 
diff --git a/examples/php/route_guide/route_guide_grpc_pb.php b/examples/php/route_guide/route_guide_grpc_pb.php
deleted file mode 100644
index e7a9cd3..0000000
--- a/examples/php/route_guide/route_guide_grpc_pb.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-// GENERATED CODE -- DO NOT EDIT!
-
-// Original file comments:
-// Copyright 2015 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-namespace Routeguide {
-
-  // Interface exported by the server.
-  class RouteGuideClient extends \Grpc\BaseStub {
-
-    /**
-     * @param string $hostname hostname
-     * @param array $opts channel options
-     * @param Grpc\Channel $channel (optional) re-use channel object
-     */
-    public function __construct($hostname, $opts, $channel = null) {
-      parent::__construct($hostname, $opts, $channel);
-    }
-
-    /**
-     * A simple RPC.
-     *
-     * Obtains the feature at a given position.
-     *
-     * A feature with an empty name is returned if there's no feature at the given
-     * position.
-     * @param \Routeguide\Point $argument input argument
-     * @param array $metadata metadata
-     * @param array $options call options
-     */
-    public function GetFeature(\Routeguide\Point $argument,
-      $metadata = [], $options = []) {
-      return $this->_simpleRequest('/routeguide.RouteGuide/GetFeature',
-      $argument,
-      ['\Routeguide\Feature', 'decode'],
-      $metadata, $options);
-    }
-
-    /**
-     * A server-to-client streaming RPC.
-     *
-     * Obtains the Features available within the given Rectangle.  Results are
-     * streamed rather than returned at once (e.g. in a response message with a
-     * repeated field), as the rectangle may cover a large area and contain a
-     * huge number of features.
-     * @param \Routeguide\Rectangle $argument input argument
-     * @param array $metadata metadata
-     * @param array $options call options
-     */
-    public function ListFeatures(\Routeguide\Rectangle $argument,
-      $metadata = [], $options = []) {
-      return $this->_serverStreamRequest('/routeguide.RouteGuide/ListFeatures',
-      $argument,
-      ['\Routeguide\Feature', 'decode'],
-      $metadata, $options);
-    }
-
-    /**
-     * A client-to-server streaming RPC.
-     *
-     * Accepts a stream of Points on a route being traversed, returning a
-     * RouteSummary when traversal is completed.
-     * @param array $metadata metadata
-     * @param array $options call options
-     */
-    public function RecordRoute($metadata = [], $options = []) {
-      return $this->_clientStreamRequest('/routeguide.RouteGuide/RecordRoute',
-      ['\Routeguide\RouteSummary','decode'],
-      $metadata, $options);
-    }
-
-    /**
-     * A Bidirectional streaming RPC.
-     *
-     * Accepts a stream of RouteNotes sent while a route is being traversed,
-     * while receiving other RouteNotes (e.g. from other users).
-     * @param array $metadata metadata
-     * @param array $options call options
-     */
-    public function RouteChat($metadata = [], $options = []) {
-      return $this->_bidiRequest('/routeguide.RouteGuide/RouteChat',
-      ['\Routeguide\RouteNote','decode'],
-      $metadata, $options);
-    }
-
-  }
-
-}
diff --git a/examples/php/route_guide/route_guide_proto_gen.sh b/examples/php/route_guide/route_guide_proto_gen.sh
new file mode 100755
index 0000000..bfd7cdb
--- /dev/null
+++ b/examples/php/route_guide/route_guide_proto_gen.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# Copyright 2015 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+protoc --proto_path=./../../protos  --php_out=./  --grpc_out=./ --plugin=protoc-gen-grpc=./../../../bins/opt/grpc_php_plugin ./../../protos/route_guide.proto
diff --git a/examples/python/helloworld/helloworld_pb2.py b/examples/python/helloworld/helloworld_pb2.py
index 6665b1f..e18ab9a 100644
--- a/examples/python/helloworld/helloworld_pb2.py
+++ b/examples/python/helloworld/helloworld_pb2.py
@@ -21,7 +21,6 @@
   syntax='proto3',
   serialized_pb=_b('\n\x10helloworld.proto\x12\nhelloworld\"\x1c\n\x0cHelloRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\x1d\n\nHelloReply\x12\x0f\n\x07message\x18\x01 \x01(\t2I\n\x07Greeter\x12>\n\x08SayHello\x12\x18.helloworld.HelloRequest\x1a\x16.helloworld.HelloReply\"\x00\x42\x36\n\x1bio.grpc.examples.helloworldB\x0fHelloWorldProtoP\x01\xa2\x02\x03HLWb\x06proto3')
 )
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
 
 
 
@@ -89,6 +88,7 @@
 
 DESCRIPTOR.message_types_by_name['HelloRequest'] = _HELLOREQUEST
 DESCRIPTOR.message_types_by_name['HelloReply'] = _HELLOREPLY
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
 
 HelloRequest = _reflection.GeneratedProtocolMessageType('HelloRequest', (_message.Message,), dict(
   DESCRIPTOR = _HELLOREQUEST,
@@ -107,123 +107,28 @@
 
 DESCRIPTOR.has_options = True
 DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\033io.grpc.examples.helloworldB\017HelloWorldProtoP\001\242\002\003HLW'))
-try:
-  # THESE ELEMENTS WILL BE DEPRECATED.
-  # Please use the generated *_pb2_grpc.py files instead.
-  import grpc
-  from grpc.framework.common import cardinality
-  from grpc.framework.interfaces.face import utilities as face_utilities
-  from grpc.beta import implementations as beta_implementations
-  from grpc.beta import interfaces as beta_interfaces
 
+_GREETER = _descriptor.ServiceDescriptor(
+  name='Greeter',
+  full_name='helloworld.Greeter',
+  file=DESCRIPTOR,
+  index=0,
+  options=None,
+  serialized_start=93,
+  serialized_end=166,
+  methods=[
+  _descriptor.MethodDescriptor(
+    name='SayHello',
+    full_name='helloworld.Greeter.SayHello',
+    index=0,
+    containing_service=None,
+    input_type=_HELLOREQUEST,
+    output_type=_HELLOREPLY,
+    options=None,
+  ),
+])
+_sym_db.RegisterServiceDescriptor(_GREETER)
 
-  class GreeterStub(object):
-    """The greeting service definition.
-    """
+DESCRIPTOR.services_by_name['Greeter'] = _GREETER
 
-    def __init__(self, channel):
-      """Constructor.
-
-      Args:
-        channel: A grpc.Channel.
-      """
-      self.SayHello = channel.unary_unary(
-          '/helloworld.Greeter/SayHello',
-          request_serializer=HelloRequest.SerializeToString,
-          response_deserializer=HelloReply.FromString,
-          )
-
-
-  class GreeterServicer(object):
-    """The greeting service definition.
-    """
-
-    def SayHello(self, request, context):
-      """Sends a greeting
-      """
-      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
-      context.set_details('Method not implemented!')
-      raise NotImplementedError('Method not implemented!')
-
-
-  def add_GreeterServicer_to_server(servicer, server):
-    rpc_method_handlers = {
-        'SayHello': grpc.unary_unary_rpc_method_handler(
-            servicer.SayHello,
-            request_deserializer=HelloRequest.FromString,
-            response_serializer=HelloReply.SerializeToString,
-        ),
-    }
-    generic_handler = grpc.method_handlers_generic_handler(
-        'helloworld.Greeter', rpc_method_handlers)
-    server.add_generic_rpc_handlers((generic_handler,))
-
-
-  class BetaGreeterServicer(object):
-    """The Beta API is deprecated for 0.15.0 and later.
-
-    It is recommended to use the GA API (classes and functions in this
-    file not marked beta) for all further purposes. This class was generated
-    only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
-    """The greeting service definition.
-    """
-    def SayHello(self, request, context):
-      """Sends a greeting
-      """
-      context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
-
-
-  class BetaGreeterStub(object):
-    """The Beta API is deprecated for 0.15.0 and later.
-
-    It is recommended to use the GA API (classes and functions in this
-    file not marked beta) for all further purposes. This class was generated
-    only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
-    """The greeting service definition.
-    """
-    def SayHello(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
-      """Sends a greeting
-      """
-      raise NotImplementedError()
-    SayHello.future = None
-
-
-  def beta_create_Greeter_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
-    """The Beta API is deprecated for 0.15.0 and later.
-
-    It is recommended to use the GA API (classes and functions in this
-    file not marked beta) for all further purposes. This function was
-    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
-    request_deserializers = {
-      ('helloworld.Greeter', 'SayHello'): HelloRequest.FromString,
-    }
-    response_serializers = {
-      ('helloworld.Greeter', 'SayHello'): HelloReply.SerializeToString,
-    }
-    method_implementations = {
-      ('helloworld.Greeter', 'SayHello'): face_utilities.unary_unary_inline(servicer.SayHello),
-    }
-    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
-    return beta_implementations.server(method_implementations, options=server_options)
-
-
-  def beta_create_Greeter_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None):
-    """The Beta API is deprecated for 0.15.0 and later.
-
-    It is recommended to use the GA API (classes and functions in this
-    file not marked beta) for all further purposes. This function was
-    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
-    request_serializers = {
-      ('helloworld.Greeter', 'SayHello'): HelloRequest.SerializeToString,
-    }
-    response_deserializers = {
-      ('helloworld.Greeter', 'SayHello'): HelloReply.FromString,
-    }
-    cardinalities = {
-      'SayHello': cardinality.Cardinality.UNARY_UNARY,
-    }
-    stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size)
-    return beta_implementations.dynamic_stub(channel, 'helloworld.Greeter', cardinalities, options=stub_options)
-except ImportError:
-  pass
 # @@protoc_insertion_point(module_scope)
diff --git a/examples/python/helloworld/helloworld_pb2_grpc.py b/examples/python/helloworld/helloworld_pb2_grpc.py
index 682dc36..18e07d1 100644
--- a/examples/python/helloworld/helloworld_pb2_grpc.py
+++ b/examples/python/helloworld/helloworld_pb2_grpc.py
@@ -1,6 +1,5 @@
+# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
 import grpc
-from grpc.framework.common import cardinality
-from grpc.framework.interfaces.face import utilities as face_utilities
 
 import helloworld_pb2 as helloworld__pb2
 
diff --git a/examples/python/route_guide/route_guide_pb2.py b/examples/python/route_guide/route_guide_pb2.py
index e6775eb..fbbc194 100644
--- a/examples/python/route_guide/route_guide_pb2.py
+++ b/examples/python/route_guide/route_guide_pb2.py
@@ -21,7 +21,6 @@
   syntax='proto3',
   serialized_pb=_b('\n\x11route_guide.proto\x12\nrouteguide\",\n\x05Point\x12\x10\n\x08latitude\x18\x01 \x01(\x05\x12\x11\n\tlongitude\x18\x02 \x01(\x05\"I\n\tRectangle\x12\x1d\n\x02lo\x18\x01 \x01(\x0b\x32\x11.routeguide.Point\x12\x1d\n\x02hi\x18\x02 \x01(\x0b\x32\x11.routeguide.Point\"<\n\x07\x46\x65\x61ture\x12\x0c\n\x04name\x18\x01 \x01(\t\x12#\n\x08location\x18\x02 \x01(\x0b\x32\x11.routeguide.Point\"A\n\tRouteNote\x12#\n\x08location\x18\x01 \x01(\x0b\x32\x11.routeguide.Point\x12\x0f\n\x07message\x18\x02 \x01(\t\"b\n\x0cRouteSummary\x12\x13\n\x0bpoint_count\x18\x01 \x01(\x05\x12\x15\n\rfeature_count\x18\x02 \x01(\x05\x12\x10\n\x08\x64istance\x18\x03 \x01(\x05\x12\x14\n\x0c\x65lapsed_time\x18\x04 \x01(\x05\x32\x85\x02\n\nRouteGuide\x12\x36\n\nGetFeature\x12\x11.routeguide.Point\x1a\x13.routeguide.Feature\"\x00\x12>\n\x0cListFeatures\x12\x15.routeguide.Rectangle\x1a\x13.routeguide.Feature\"\x00\x30\x01\x12>\n\x0bRecordRoute\x12\x11.routeguide.Point\x1a\x18.routeguide.RouteSummary\"\x00(\x01\x12?\n\tRouteChat\x12\x15.routeguide.RouteNote\x1a\x15.routeguide.RouteNote\"\x00(\x01\x30\x01\x42\x36\n\x1bio.grpc.examples.routeguideB\x0fRouteGuideProtoP\x01\xa2\x02\x03RTGb\x06proto3')
 )
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
 
 
 
@@ -238,6 +237,7 @@
 DESCRIPTOR.message_types_by_name['Feature'] = _FEATURE
 DESCRIPTOR.message_types_by_name['RouteNote'] = _ROUTENOTE
 DESCRIPTOR.message_types_by_name['RouteSummary'] = _ROUTESUMMARY
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
 
 Point = _reflection.GeneratedProtocolMessageType('Point', (_message.Message,), dict(
   DESCRIPTOR = _POINT,
@@ -277,265 +277,55 @@
 
 DESCRIPTOR.has_options = True
 DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\033io.grpc.examples.routeguideB\017RouteGuideProtoP\001\242\002\003RTG'))
-try:
-  # THESE ELEMENTS WILL BE DEPRECATED.
-  # Please use the generated *_pb2_grpc.py files instead.
-  import grpc
-  from grpc.framework.common import cardinality
-  from grpc.framework.interfaces.face import utilities as face_utilities
-  from grpc.beta import implementations as beta_implementations
-  from grpc.beta import interfaces as beta_interfaces
 
+_ROUTEGUIDE = _descriptor.ServiceDescriptor(
+  name='RouteGuide',
+  full_name='routeguide.RouteGuide',
+  file=DESCRIPTOR,
+  index=0,
+  options=None,
+  serialized_start=384,
+  serialized_end=645,
+  methods=[
+  _descriptor.MethodDescriptor(
+    name='GetFeature',
+    full_name='routeguide.RouteGuide.GetFeature',
+    index=0,
+    containing_service=None,
+    input_type=_POINT,
+    output_type=_FEATURE,
+    options=None,
+  ),
+  _descriptor.MethodDescriptor(
+    name='ListFeatures',
+    full_name='routeguide.RouteGuide.ListFeatures',
+    index=1,
+    containing_service=None,
+    input_type=_RECTANGLE,
+    output_type=_FEATURE,
+    options=None,
+  ),
+  _descriptor.MethodDescriptor(
+    name='RecordRoute',
+    full_name='routeguide.RouteGuide.RecordRoute',
+    index=2,
+    containing_service=None,
+    input_type=_POINT,
+    output_type=_ROUTESUMMARY,
+    options=None,
+  ),
+  _descriptor.MethodDescriptor(
+    name='RouteChat',
+    full_name='routeguide.RouteGuide.RouteChat',
+    index=3,
+    containing_service=None,
+    input_type=_ROUTENOTE,
+    output_type=_ROUTENOTE,
+    options=None,
+  ),
+])
+_sym_db.RegisterServiceDescriptor(_ROUTEGUIDE)
 
-  class RouteGuideStub(object):
-    """Interface exported by the server.
-    """
+DESCRIPTOR.services_by_name['RouteGuide'] = _ROUTEGUIDE
 
-    def __init__(self, channel):
-      """Constructor.
-
-      Args:
-        channel: A grpc.Channel.
-      """
-      self.GetFeature = channel.unary_unary(
-          '/routeguide.RouteGuide/GetFeature',
-          request_serializer=Point.SerializeToString,
-          response_deserializer=Feature.FromString,
-          )
-      self.ListFeatures = channel.unary_stream(
-          '/routeguide.RouteGuide/ListFeatures',
-          request_serializer=Rectangle.SerializeToString,
-          response_deserializer=Feature.FromString,
-          )
-      self.RecordRoute = channel.stream_unary(
-          '/routeguide.RouteGuide/RecordRoute',
-          request_serializer=Point.SerializeToString,
-          response_deserializer=RouteSummary.FromString,
-          )
-      self.RouteChat = channel.stream_stream(
-          '/routeguide.RouteGuide/RouteChat',
-          request_serializer=RouteNote.SerializeToString,
-          response_deserializer=RouteNote.FromString,
-          )
-
-
-  class RouteGuideServicer(object):
-    """Interface exported by the server.
-    """
-
-    def GetFeature(self, request, context):
-      """A simple RPC.
-
-      Obtains the feature at a given position.
-
-      A feature with an empty name is returned if there's no feature at the given
-      position.
-      """
-      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
-      context.set_details('Method not implemented!')
-      raise NotImplementedError('Method not implemented!')
-
-    def ListFeatures(self, request, context):
-      """A server-to-client streaming RPC.
-
-      Obtains the Features available within the given Rectangle.  Results are
-      streamed rather than returned at once (e.g. in a response message with a
-      repeated field), as the rectangle may cover a large area and contain a
-      huge number of features.
-      """
-      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
-      context.set_details('Method not implemented!')
-      raise NotImplementedError('Method not implemented!')
-
-    def RecordRoute(self, request_iterator, context):
-      """A client-to-server streaming RPC.
-
-      Accepts a stream of Points on a route being traversed, returning a
-      RouteSummary when traversal is completed.
-      """
-      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
-      context.set_details('Method not implemented!')
-      raise NotImplementedError('Method not implemented!')
-
-    def RouteChat(self, request_iterator, context):
-      """A Bidirectional streaming RPC.
-
-      Accepts a stream of RouteNotes sent while a route is being traversed,
-      while receiving other RouteNotes (e.g. from other users).
-      """
-      context.set_code(grpc.StatusCode.UNIMPLEMENTED)
-      context.set_details('Method not implemented!')
-      raise NotImplementedError('Method not implemented!')
-
-
-  def add_RouteGuideServicer_to_server(servicer, server):
-    rpc_method_handlers = {
-        'GetFeature': grpc.unary_unary_rpc_method_handler(
-            servicer.GetFeature,
-            request_deserializer=Point.FromString,
-            response_serializer=Feature.SerializeToString,
-        ),
-        'ListFeatures': grpc.unary_stream_rpc_method_handler(
-            servicer.ListFeatures,
-            request_deserializer=Rectangle.FromString,
-            response_serializer=Feature.SerializeToString,
-        ),
-        'RecordRoute': grpc.stream_unary_rpc_method_handler(
-            servicer.RecordRoute,
-            request_deserializer=Point.FromString,
-            response_serializer=RouteSummary.SerializeToString,
-        ),
-        'RouteChat': grpc.stream_stream_rpc_method_handler(
-            servicer.RouteChat,
-            request_deserializer=RouteNote.FromString,
-            response_serializer=RouteNote.SerializeToString,
-        ),
-    }
-    generic_handler = grpc.method_handlers_generic_handler(
-        'routeguide.RouteGuide', rpc_method_handlers)
-    server.add_generic_rpc_handlers((generic_handler,))
-
-
-  class BetaRouteGuideServicer(object):
-    """The Beta API is deprecated for 0.15.0 and later.
-
-    It is recommended to use the GA API (classes and functions in this
-    file not marked beta) for all further purposes. This class was generated
-    only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
-    """Interface exported by the server.
-    """
-    def GetFeature(self, request, context):
-      """A simple RPC.
-
-      Obtains the feature at a given position.
-
-      A feature with an empty name is returned if there's no feature at the given
-      position.
-      """
-      context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
-    def ListFeatures(self, request, context):
-      """A server-to-client streaming RPC.
-
-      Obtains the Features available within the given Rectangle.  Results are
-      streamed rather than returned at once (e.g. in a response message with a
-      repeated field), as the rectangle may cover a large area and contain a
-      huge number of features.
-      """
-      context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
-    def RecordRoute(self, request_iterator, context):
-      """A client-to-server streaming RPC.
-
-      Accepts a stream of Points on a route being traversed, returning a
-      RouteSummary when traversal is completed.
-      """
-      context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
-    def RouteChat(self, request_iterator, context):
-      """A Bidirectional streaming RPC.
-
-      Accepts a stream of RouteNotes sent while a route is being traversed,
-      while receiving other RouteNotes (e.g. from other users).
-      """
-      context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
-
-
-  class BetaRouteGuideStub(object):
-    """The Beta API is deprecated for 0.15.0 and later.
-
-    It is recommended to use the GA API (classes and functions in this
-    file not marked beta) for all further purposes. This class was generated
-    only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
-    """Interface exported by the server.
-    """
-    def GetFeature(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
-      """A simple RPC.
-
-      Obtains the feature at a given position.
-
-      A feature with an empty name is returned if there's no feature at the given
-      position.
-      """
-      raise NotImplementedError()
-    GetFeature.future = None
-    def ListFeatures(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
-      """A server-to-client streaming RPC.
-
-      Obtains the Features available within the given Rectangle.  Results are
-      streamed rather than returned at once (e.g. in a response message with a
-      repeated field), as the rectangle may cover a large area and contain a
-      huge number of features.
-      """
-      raise NotImplementedError()
-    def RecordRoute(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None):
-      """A client-to-server streaming RPC.
-
-      Accepts a stream of Points on a route being traversed, returning a
-      RouteSummary when traversal is completed.
-      """
-      raise NotImplementedError()
-    RecordRoute.future = None
-    def RouteChat(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None):
-      """A Bidirectional streaming RPC.
-
-      Accepts a stream of RouteNotes sent while a route is being traversed,
-      while receiving other RouteNotes (e.g. from other users).
-      """
-      raise NotImplementedError()
-
-
-  def beta_create_RouteGuide_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
-    """The Beta API is deprecated for 0.15.0 and later.
-
-    It is recommended to use the GA API (classes and functions in this
-    file not marked beta) for all further purposes. This function was
-    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
-    request_deserializers = {
-      ('routeguide.RouteGuide', 'GetFeature'): Point.FromString,
-      ('routeguide.RouteGuide', 'ListFeatures'): Rectangle.FromString,
-      ('routeguide.RouteGuide', 'RecordRoute'): Point.FromString,
-      ('routeguide.RouteGuide', 'RouteChat'): RouteNote.FromString,
-    }
-    response_serializers = {
-      ('routeguide.RouteGuide', 'GetFeature'): Feature.SerializeToString,
-      ('routeguide.RouteGuide', 'ListFeatures'): Feature.SerializeToString,
-      ('routeguide.RouteGuide', 'RecordRoute'): RouteSummary.SerializeToString,
-      ('routeguide.RouteGuide', 'RouteChat'): RouteNote.SerializeToString,
-    }
-    method_implementations = {
-      ('routeguide.RouteGuide', 'GetFeature'): face_utilities.unary_unary_inline(servicer.GetFeature),
-      ('routeguide.RouteGuide', 'ListFeatures'): face_utilities.unary_stream_inline(servicer.ListFeatures),
-      ('routeguide.RouteGuide', 'RecordRoute'): face_utilities.stream_unary_inline(servicer.RecordRoute),
-      ('routeguide.RouteGuide', 'RouteChat'): face_utilities.stream_stream_inline(servicer.RouteChat),
-    }
-    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
-    return beta_implementations.server(method_implementations, options=server_options)
-
-
-  def beta_create_RouteGuide_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None):
-    """The Beta API is deprecated for 0.15.0 and later.
-
-    It is recommended to use the GA API (classes and functions in this
-    file not marked beta) for all further purposes. This function was
-    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
-    request_serializers = {
-      ('routeguide.RouteGuide', 'GetFeature'): Point.SerializeToString,
-      ('routeguide.RouteGuide', 'ListFeatures'): Rectangle.SerializeToString,
-      ('routeguide.RouteGuide', 'RecordRoute'): Point.SerializeToString,
-      ('routeguide.RouteGuide', 'RouteChat'): RouteNote.SerializeToString,
-    }
-    response_deserializers = {
-      ('routeguide.RouteGuide', 'GetFeature'): Feature.FromString,
-      ('routeguide.RouteGuide', 'ListFeatures'): Feature.FromString,
-      ('routeguide.RouteGuide', 'RecordRoute'): RouteSummary.FromString,
-      ('routeguide.RouteGuide', 'RouteChat'): RouteNote.FromString,
-    }
-    cardinalities = {
-      'GetFeature': cardinality.Cardinality.UNARY_UNARY,
-      'ListFeatures': cardinality.Cardinality.UNARY_STREAM,
-      'RecordRoute': cardinality.Cardinality.STREAM_UNARY,
-      'RouteChat': cardinality.Cardinality.STREAM_STREAM,
-    }
-    stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size)
-    return beta_implementations.dynamic_stub(channel, 'routeguide.RouteGuide', cardinalities, options=stub_options)
-except ImportError:
-  pass
 # @@protoc_insertion_point(module_scope)
diff --git a/examples/python/route_guide/route_guide_pb2_grpc.py b/examples/python/route_guide/route_guide_pb2_grpc.py
index 27b24c7..05c1b79 100644
--- a/examples/python/route_guide/route_guide_pb2_grpc.py
+++ b/examples/python/route_guide/route_guide_pb2_grpc.py
@@ -1,6 +1,5 @@
+# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
 import grpc
-from grpc.framework.common import cardinality
-from grpc.framework.interfaces.face import utilities as face_utilities
 
 import route_guide_pb2 as route__guide__pb2
 
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index a9b451e..01b8d65 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -89,6 +89,7 @@
 
   s.default_subspecs = 'Interface', 'Implementation'
   s.compiler_flags = '-DGRPC_ARES=0'
+  s.libraries = 'c++'
 
   # Like many other C libraries, gRPC-Core has its public headers under `include/<libname>/` and its
   # sources and private headers in other directories outside `include/`. Cocoapods' linter doesn't
@@ -298,6 +299,7 @@
                       'src/core/tsi/transport_security_adapter.h',
                       'src/core/tsi/transport_security_interface.h',
                       'src/core/ext/transport/chttp2/server/chttp2_server.h',
+                      'src/core/ext/filters/client_channel/backup_poller.h',
                       'src/core/ext/filters/client_channel/client_channel.h',
                       'src/core/ext/filters/client_channel/client_channel_factory.h',
                       'src/core/ext/filters/client_channel/connector.h',
@@ -447,28 +449,11 @@
                       'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h',
                       'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h',
                       'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
+                      'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h',
                       'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
                       'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
                       'src/core/ext/filters/load_reporting/server_load_reporting_filter.h',
                       'src/core/ext/filters/load_reporting/server_load_reporting_plugin.h',
-                      'src/core/ext/census/aggregation.h',
-                      'src/core/ext/census/base_resources.h',
-                      'src/core/ext/census/census_interface.h',
-                      'src/core/ext/census/census_rpc_stats.h',
-                      'src/core/ext/census/gen/census.pb.h',
-                      'src/core/ext/census/gen/trace_context.pb.h',
-                      'src/core/ext/census/grpc_filter.h',
-                      'src/core/ext/census/intrusive_hash_map.h',
-                      'src/core/ext/census/intrusive_hash_map_internal.h',
-                      'src/core/ext/census/mlog.h',
-                      'src/core/ext/census/resource.h',
-                      'src/core/ext/census/rpc_metric_id.h',
-                      'src/core/ext/census/trace_context.h',
-                      'src/core/ext/census/trace_label.h',
-                      'src/core/ext/census/trace_propagation.h',
-                      'src/core/ext/census/trace_status.h',
-                      'src/core/ext/census/trace_string.h',
-                      'src/core/ext/census/tracing.h',
                       'src/core/ext/filters/max_age/max_age_filter.h',
                       'src/core/ext/filters/message_size/message_size_filter.h',
                       'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
@@ -667,6 +652,7 @@
                       'src/core/tsi/transport_security_adapter.cc',
                       'src/core/ext/transport/chttp2/server/chttp2_server.cc',
                       'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc',
+                      'src/core/ext/filters/client_channel/backup_poller.cc',
                       'src/core/ext/filters/client_channel/channel_connectivity.cc',
                       'src/core/ext/filters/client_channel/client_channel.cc',
                       'src/core/ext/filters/client_channel/client_channel_factory.cc',
@@ -703,6 +689,7 @@
                       'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
                       'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
                       'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
+                      'src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc',
                       'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
                       'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
                       'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
@@ -712,21 +699,7 @@
                       'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
                       'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc',
                       'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc',
-                      'src/core/ext/census/base_resources.cc',
-                      'src/core/ext/census/context.cc',
-                      'src/core/ext/census/gen/census.pb.c',
-                      'src/core/ext/census/gen/trace_context.pb.c',
                       'src/core/ext/census/grpc_context.cc',
-                      'src/core/ext/census/grpc_filter.cc',
-                      'src/core/ext/census/grpc_plugin.cc',
-                      'src/core/ext/census/initialize.cc',
-                      'src/core/ext/census/intrusive_hash_map.cc',
-                      'src/core/ext/census/mlog.cc',
-                      'src/core/ext/census/operation.cc',
-                      'src/core/ext/census/placeholders.cc',
-                      'src/core/ext/census/resource.cc',
-                      'src/core/ext/census/trace_context.cc',
-                      'src/core/ext/census/tracing.cc',
                       'src/core/ext/filters/max_age/max_age_filter.cc',
                       'src/core/ext/filters/message_size/message_size_filter.cc',
                       'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
@@ -801,6 +774,7 @@
                               'src/core/tsi/transport_security_adapter.h',
                               'src/core/tsi/transport_security_interface.h',
                               'src/core/ext/transport/chttp2/server/chttp2_server.h',
+                              'src/core/ext/filters/client_channel/backup_poller.h',
                               'src/core/ext/filters/client_channel/client_channel.h',
                               'src/core/ext/filters/client_channel/client_channel_factory.h',
                               'src/core/ext/filters/client_channel/connector.h',
@@ -950,28 +924,11 @@
                               'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h',
                               'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h',
                               'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
+                              'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h',
                               'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
                               'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
                               'src/core/ext/filters/load_reporting/server_load_reporting_filter.h',
                               'src/core/ext/filters/load_reporting/server_load_reporting_plugin.h',
-                              'src/core/ext/census/aggregation.h',
-                              'src/core/ext/census/base_resources.h',
-                              'src/core/ext/census/census_interface.h',
-                              'src/core/ext/census/census_rpc_stats.h',
-                              'src/core/ext/census/gen/census.pb.h',
-                              'src/core/ext/census/gen/trace_context.pb.h',
-                              'src/core/ext/census/grpc_filter.h',
-                              'src/core/ext/census/intrusive_hash_map.h',
-                              'src/core/ext/census/intrusive_hash_map_internal.h',
-                              'src/core/ext/census/mlog.h',
-                              'src/core/ext/census/resource.h',
-                              'src/core/ext/census/rpc_metric_id.h',
-                              'src/core/ext/census/trace_context.h',
-                              'src/core/ext/census/trace_label.h',
-                              'src/core/ext/census/trace_propagation.h',
-                              'src/core/ext/census/trace_status.h',
-                              'src/core/ext/census/trace_string.h',
-                              'src/core/ext/census/tracing.h',
                               'src/core/ext/filters/max_age/max_age_filter.h',
                               'src/core/ext/filters/message_size/message_size_filter.h',
                               'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
@@ -1001,17 +958,17 @@
     ss.dependency "#{s.name}/Interface", version
     ss.dependency "#{s.name}/Implementation", version
 
-    ss.source_files = 'test/core/end2end/cq_verifier.{c,h}',
-                      'test/core/end2end/end2end_tests.{c,h}',
-                      'test/core/end2end/end2end_test_utils.c',
-                      'test/core/end2end/tests/*.{c,h}',
+    ss.source_files = 'test/core/end2end/cq_verifier.{cc,h}',
+                      'test/core/end2end/end2end_tests.{cc,h}',
+                      'test/core/end2end/end2end_test_utils.cc',
+                      'test/core/end2end/tests/*.{cc,h}',
                       'test/core/end2end/fixtures/*.h',
-                      'test/core/end2end/data/*.{c,h}',
-                      'test/core/util/debugger_macros.{c,h}',
-                      'test/core/util/test_config.{c,h}',
+                      'test/core/end2end/data/*.{cc,h}',
+                      'test/core/util/debugger_macros.{cc,h}',
+                      'test/core/util/test_config.{cc,h}',
                       'test/core/util/port.h',
-                      'test/core/util/port.c',
-                      'test/core/util/port_server_client.{c,h}'
+                      'test/core/util/port.cc',
+                      'test/core/util/port_server_client.{cc,h}'
   end
 
   # TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
diff --git a/grpc.def b/grpc.def
index 558be60..07c0b3e 100644
--- a/grpc.def
+++ b/grpc.def
@@ -1,32 +1,4 @@
 EXPORTS
-    census_initialize
-    census_shutdown
-    census_supported
-    census_enabled
-    census_context_create
-    census_context_destroy
-    census_context_get_status
-    census_context_initialize_iterator
-    census_context_next_tag
-    census_context_get_tag
-    census_context_encode
-    census_context_decode
-    census_trace_mask
-    census_set_trace_mask
-    census_start_rpc_op_timestamp
-    census_start_client_rpc_op
-    census_set_rpc_client_peer
-    census_start_server_rpc_op
-    census_start_op
-    census_end_op
-    census_trace_print
-    census_trace_scan_start
-    census_get_trace_record
-    census_trace_scan_end
-    census_define_resource
-    census_delete_resource
-    census_resource_id
-    census_record_values
     grpc_compression_algorithm_parse
     grpc_compression_algorithm_name
     grpc_stream_compression_algorithm_name
@@ -54,6 +26,8 @@
     grpc_completion_queue_pluck
     grpc_completion_queue_shutdown
     grpc_completion_queue_destroy
+    grpc_completion_queue_thread_local_cache_init
+    grpc_completion_queue_thread_local_cache_flush
     grpc_alarm_create
     grpc_alarm_set
     grpc_alarm_cancel
@@ -130,8 +104,14 @@
     grpc_metadata_credentials_create_from_plugin
     grpc_secure_channel_create
     grpc_server_credentials_release
+    grpc_ssl_server_certificate_config_create
+    grpc_ssl_server_certificate_config_destroy
     grpc_ssl_server_credentials_create
     grpc_ssl_server_credentials_create_ex
+    grpc_ssl_server_credentials_create_options_using_config
+    grpc_ssl_server_credentials_create_options_using_config_fetcher
+    grpc_ssl_server_credentials_options_destroy
+    grpc_ssl_server_credentials_create_with_options
     grpc_server_add_secure_http2_port
     grpc_call_set_credentials
     grpc_server_credentials_set_auth_metadata_processor
@@ -169,7 +149,6 @@
     grpc_slice_eq
     grpc_slice_cmp
     grpc_slice_str_cmp
-    grpc_slice_buf_cmp
     grpc_slice_buf_start_eq
     grpc_slice_rchr
     grpc_slice_chr
diff --git a/grpc.gemspec b/grpc.gemspec
index 4567058..2fe2536 100644
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -28,7 +28,7 @@
   s.platform      = Gem::Platform::RUBY
 
   s.add_dependency 'google-protobuf', '~> 3.1'
-  s.add_dependency 'googleauth',      '~> 0.5.1'
+  s.add_dependency 'googleauth',      '>= 0.5.1', '< 0.7'
   s.add_dependency 'googleapis-common-protos-types', '~> 1.0.0'
 
   s.add_development_dependency 'bundler',            '~> 1.9'
@@ -230,6 +230,7 @@
   s.files += %w( src/core/tsi/transport_security_adapter.h )
   s.files += %w( src/core/tsi/transport_security_interface.h )
   s.files += %w( src/core/ext/transport/chttp2/server/chttp2_server.h )
+  s.files += %w( src/core/ext/filters/client_channel/backup_poller.h )
   s.files += %w( src/core/ext/filters/client_channel/client_channel.h )
   s.files += %w( src/core/ext/filters/client_channel/client_channel_factory.h )
   s.files += %w( src/core/ext/filters/client_channel/connector.h )
@@ -383,28 +384,11 @@
   s.files += %w( third_party/nanopb/pb_decode.h )
   s.files += %w( third_party/nanopb/pb_encode.h )
   s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h )
+  s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.h )
   s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h )
   s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h )
   s.files += %w( src/core/ext/filters/load_reporting/server_load_reporting_filter.h )
   s.files += %w( src/core/ext/filters/load_reporting/server_load_reporting_plugin.h )
-  s.files += %w( src/core/ext/census/aggregation.h )
-  s.files += %w( src/core/ext/census/base_resources.h )
-  s.files += %w( src/core/ext/census/census_interface.h )
-  s.files += %w( src/core/ext/census/census_rpc_stats.h )
-  s.files += %w( src/core/ext/census/gen/census.pb.h )
-  s.files += %w( src/core/ext/census/gen/trace_context.pb.h )
-  s.files += %w( src/core/ext/census/grpc_filter.h )
-  s.files += %w( src/core/ext/census/intrusive_hash_map.h )
-  s.files += %w( src/core/ext/census/intrusive_hash_map_internal.h )
-  s.files += %w( src/core/ext/census/mlog.h )
-  s.files += %w( src/core/ext/census/resource.h )
-  s.files += %w( src/core/ext/census/rpc_metric_id.h )
-  s.files += %w( src/core/ext/census/trace_context.h )
-  s.files += %w( src/core/ext/census/trace_label.h )
-  s.files += %w( src/core/ext/census/trace_propagation.h )
-  s.files += %w( src/core/ext/census/trace_status.h )
-  s.files += %w( src/core/ext/census/trace_string.h )
-  s.files += %w( src/core/ext/census/tracing.h )
   s.files += %w( src/core/ext/filters/max_age/max_age_filter.h )
   s.files += %w( src/core/ext/filters/message_size/message_size_filter.h )
   s.files += %w( src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h )
@@ -603,6 +587,7 @@
   s.files += %w( src/core/tsi/transport_security_adapter.cc )
   s.files += %w( src/core/ext/transport/chttp2/server/chttp2_server.cc )
   s.files += %w( src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc )
+  s.files += %w( src/core/ext/filters/client_channel/backup_poller.cc )
   s.files += %w( src/core/ext/filters/client_channel/channel_connectivity.cc )
   s.files += %w( src/core/ext/filters/client_channel/client_channel.cc )
   s.files += %w( src/core/ext/filters/client_channel/client_channel_factory.cc )
@@ -642,6 +627,7 @@
   s.files += %w( third_party/nanopb/pb_encode.c )
   s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc )
   s.files += %w( src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc )
+  s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc )
   s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc )
   s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc )
   s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc )
@@ -651,21 +637,7 @@
   s.files += %w( src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc )
   s.files += %w( src/core/ext/filters/load_reporting/server_load_reporting_filter.cc )
   s.files += %w( src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc )
-  s.files += %w( src/core/ext/census/base_resources.cc )
-  s.files += %w( src/core/ext/census/context.cc )
-  s.files += %w( src/core/ext/census/gen/census.pb.c )
-  s.files += %w( src/core/ext/census/gen/trace_context.pb.c )
   s.files += %w( src/core/ext/census/grpc_context.cc )
-  s.files += %w( src/core/ext/census/grpc_filter.cc )
-  s.files += %w( src/core/ext/census/grpc_plugin.cc )
-  s.files += %w( src/core/ext/census/initialize.cc )
-  s.files += %w( src/core/ext/census/intrusive_hash_map.cc )
-  s.files += %w( src/core/ext/census/mlog.cc )
-  s.files += %w( src/core/ext/census/operation.cc )
-  s.files += %w( src/core/ext/census/placeholders.cc )
-  s.files += %w( src/core/ext/census/resource.cc )
-  s.files += %w( src/core/ext/census/trace_context.cc )
-  s.files += %w( src/core/ext/census/tracing.cc )
   s.files += %w( src/core/ext/filters/max_age/max_age_filter.cc )
   s.files += %w( src/core/ext/filters/message_size/message_size_filter.cc )
   s.files += %w( src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc )
diff --git a/grpc.gyp b/grpc.gyp
index 487d529..7075aa9 100644
--- a/grpc.gyp
+++ b/grpc.gyp
@@ -215,7 +215,7 @@
         'gpr',
       ],
       'sources': [
-        'test/core/util/test_config.c',
+        'test/core/util/test_config.cc',
       ],
     },
     {
@@ -419,6 +419,7 @@
         'src/core/tsi/transport_security_adapter.cc',
         'src/core/ext/transport/chttp2/server/chttp2_server.cc',
         'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc',
+        'src/core/ext/filters/client_channel/backup_poller.cc',
         'src/core/ext/filters/client_channel/channel_connectivity.cc',
         'src/core/ext/filters/client_channel/client_channel.cc',
         'src/core/ext/filters/client_channel/client_channel_factory.cc',
@@ -458,6 +459,7 @@
         'third_party/nanopb/pb_encode.c',
         'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
         'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
+        'src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc',
         'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
         'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
         'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
@@ -467,21 +469,7 @@
         'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
         'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc',
         'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc',
-        'src/core/ext/census/base_resources.cc',
-        'src/core/ext/census/context.cc',
-        'src/core/ext/census/gen/census.pb.c',
-        'src/core/ext/census/gen/trace_context.pb.c',
         'src/core/ext/census/grpc_context.cc',
-        'src/core/ext/census/grpc_filter.cc',
-        'src/core/ext/census/grpc_plugin.cc',
-        'src/core/ext/census/initialize.cc',
-        'src/core/ext/census/intrusive_hash_map.cc',
-        'src/core/ext/census/mlog.cc',
-        'src/core/ext/census/operation.cc',
-        'src/core/ext/census/placeholders.cc',
-        'src/core/ext/census/resource.cc',
-        'src/core/ext/census/trace_context.cc',
-        'src/core/ext/census/tracing.cc',
         'src/core/ext/filters/max_age/max_age_filter.cc',
         'src/core/ext/filters/message_size/message_size_filter.cc',
         'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
@@ -508,26 +496,26 @@
         'grpc',
       ],
       'sources': [
-        'test/core/end2end/data/client_certs.c',
-        'test/core/end2end/data/server1_cert.c',
-        'test/core/end2end/data/server1_key.c',
-        'test/core/end2end/data/test_root_cert.c',
-        'test/core/security/oauth2_utils.c',
+        'test/core/end2end/data/client_certs.cc',
+        'test/core/end2end/data/server1_cert.cc',
+        'test/core/end2end/data/server1_key.cc',
+        'test/core/end2end/data/test_root_cert.cc',
+        'test/core/security/oauth2_utils.cc',
         'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
-        'test/core/end2end/cq_verifier.c',
-        'test/core/end2end/fixtures/http_proxy_fixture.c',
-        'test/core/end2end/fixtures/proxy.c',
-        'test/core/iomgr/endpoint_tests.c',
+        'test/core/end2end/cq_verifier.cc',
+        'test/core/end2end/fixtures/http_proxy_fixture.cc',
+        'test/core/end2end/fixtures/proxy.cc',
+        'test/core/iomgr/endpoint_tests.cc',
         'test/core/util/debugger_macros.cc',
-        'test/core/util/grpc_profiler.c',
-        'test/core/util/memory_counters.c',
-        'test/core/util/mock_endpoint.c',
-        'test/core/util/parse_hexstring.c',
-        'test/core/util/passthru_endpoint.c',
-        'test/core/util/port.c',
-        'test/core/util/port_server_client.c',
-        'test/core/util/slice_splitter.c',
-        'test/core/util/trickle_endpoint.c',
+        'test/core/util/grpc_profiler.cc',
+        'test/core/util/memory_counters.cc',
+        'test/core/util/mock_endpoint.cc',
+        'test/core/util/parse_hexstring.cc',
+        'test/core/util/passthru_endpoint.cc',
+        'test/core/util/port.cc',
+        'test/core/util/port_server_client.cc',
+        'test/core/util/slice_splitter.cc',
+        'test/core/util/trickle_endpoint.cc',
         'src/core/lib/backoff/backoff.cc',
         'src/core/lib/channel/channel_args.cc',
         'src/core/lib/channel/channel_stack.cc',
@@ -661,6 +649,7 @@
         'src/core/lib/transport/transport.cc',
         'src/core/lib/transport/transport_op_string.cc',
         'src/core/lib/debug/trace.cc',
+        'src/core/ext/filters/client_channel/backup_poller.cc',
         'src/core/ext/filters/client_channel/channel_connectivity.cc',
         'src/core/ext/filters/client_channel/client_channel.cc',
         'src/core/ext/filters/client_channel/client_channel_factory.cc',
@@ -721,20 +710,20 @@
       ],
       'sources': [
         'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
-        'test/core/end2end/cq_verifier.c',
-        'test/core/end2end/fixtures/http_proxy_fixture.c',
-        'test/core/end2end/fixtures/proxy.c',
-        'test/core/iomgr/endpoint_tests.c',
+        'test/core/end2end/cq_verifier.cc',
+        'test/core/end2end/fixtures/http_proxy_fixture.cc',
+        'test/core/end2end/fixtures/proxy.cc',
+        'test/core/iomgr/endpoint_tests.cc',
         'test/core/util/debugger_macros.cc',
-        'test/core/util/grpc_profiler.c',
-        'test/core/util/memory_counters.c',
-        'test/core/util/mock_endpoint.c',
-        'test/core/util/parse_hexstring.c',
-        'test/core/util/passthru_endpoint.c',
-        'test/core/util/port.c',
-        'test/core/util/port_server_client.c',
-        'test/core/util/slice_splitter.c',
-        'test/core/util/trickle_endpoint.c',
+        'test/core/util/grpc_profiler.cc',
+        'test/core/util/memory_counters.cc',
+        'test/core/util/mock_endpoint.cc',
+        'test/core/util/parse_hexstring.cc',
+        'test/core/util/passthru_endpoint.cc',
+        'test/core/util/port.cc',
+        'test/core/util/port_server_client.cc',
+        'test/core/util/slice_splitter.cc',
+        'test/core/util/trickle_endpoint.cc',
         'src/core/lib/backoff/backoff.cc',
         'src/core/lib/channel/channel_args.cc',
         'src/core/lib/channel/channel_stack.cc',
@@ -868,6 +857,7 @@
         'src/core/lib/transport/transport.cc',
         'src/core/lib/transport/transport_op_string.cc',
         'src/core/lib/debug/trace.cc',
+        'src/core/ext/filters/client_channel/backup_poller.cc',
         'src/core/ext/filters/client_channel/channel_connectivity.cc',
         'src/core/ext/filters/client_channel/client_channel.cc',
         'src/core/ext/filters/client_channel/client_channel_factory.cc',
@@ -1093,6 +1083,7 @@
         'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
         'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
         'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
+        'src/core/ext/filters/client_channel/backup_poller.cc',
         'src/core/ext/filters/client_channel/channel_connectivity.cc',
         'src/core/ext/filters/client_channel/client_channel.cc',
         'src/core/ext/filters/client_channel/client_channel_factory.cc',
@@ -1135,22 +1126,9 @@
         'third_party/nanopb/pb_decode.c',
         'third_party/nanopb/pb_encode.c',
         'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
+        'src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc',
         'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
-        'src/core/ext/census/base_resources.cc',
-        'src/core/ext/census/context.cc',
-        'src/core/ext/census/gen/census.pb.c',
-        'src/core/ext/census/gen/trace_context.pb.c',
         'src/core/ext/census/grpc_context.cc',
-        'src/core/ext/census/grpc_filter.cc',
-        'src/core/ext/census/grpc_plugin.cc',
-        'src/core/ext/census/initialize.cc',
-        'src/core/ext/census/intrusive_hash_map.cc',
-        'src/core/ext/census/mlog.cc',
-        'src/core/ext/census/operation.cc',
-        'src/core/ext/census/placeholders.cc',
-        'src/core/ext/census/resource.cc',
-        'src/core/ext/census/trace_context.cc',
-        'src/core/ext/census/tracing.cc',
         'src/core/ext/filters/max_age/max_age_filter.cc',
         'src/core/ext/filters/message_size/message_size_filter.cc',
         'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
@@ -1169,7 +1147,7 @@
         'gpr',
       ],
       'sources': [
-        'test/core/util/reconnect_server.c',
+        'test/core/util/reconnect_server.cc',
       ],
     },
     {
@@ -1182,7 +1160,7 @@
         'gpr',
       ],
       'sources': [
-        'test/core/util/test_tcp_server.c',
+        'test/core/util/test_tcp_server.cc',
       ],
     },
     {
@@ -2316,6 +2294,7 @@
         'third_party/benchmark/src/commandlineflags.cc',
         'third_party/benchmark/src/complexity.cc',
         'third_party/benchmark/src/console_reporter.cc',
+        'third_party/benchmark/src/counter.cc',
         'third_party/benchmark/src/csv_reporter.cc',
         'third_party/benchmark/src/json_reporter.cc',
         'third_party/benchmark/src/reporter.cc',
@@ -2358,7 +2337,7 @@
         'gpr',
       ],
       'sources': [
-        'test/core/bad_client/bad_client.c',
+        'test/core/bad_client/bad_client.cc',
       ],
     },
     {
@@ -2371,67 +2350,67 @@
         'gpr',
       ],
       'sources': [
-        'test/core/end2end/end2end_tests.c',
-        'test/core/end2end/end2end_test_utils.c',
-        'test/core/end2end/tests/authority_not_supported.c',
-        'test/core/end2end/tests/bad_hostname.c',
-        'test/core/end2end/tests/bad_ping.c',
-        'test/core/end2end/tests/binary_metadata.c',
-        'test/core/end2end/tests/call_creds.c',
-        'test/core/end2end/tests/cancel_after_accept.c',
-        'test/core/end2end/tests/cancel_after_client_done.c',
-        'test/core/end2end/tests/cancel_after_invoke.c',
-        'test/core/end2end/tests/cancel_after_round_trip.c',
-        'test/core/end2end/tests/cancel_before_invoke.c',
-        'test/core/end2end/tests/cancel_in_a_vacuum.c',
-        'test/core/end2end/tests/cancel_with_status.c',
-        'test/core/end2end/tests/compressed_payload.c',
-        'test/core/end2end/tests/connectivity.c',
-        'test/core/end2end/tests/default_host.c',
-        'test/core/end2end/tests/disappearing_server.c',
-        'test/core/end2end/tests/empty_batch.c',
-        'test/core/end2end/tests/filter_call_init_fails.c',
-        'test/core/end2end/tests/filter_causes_close.c',
-        'test/core/end2end/tests/filter_latency.c',
-        'test/core/end2end/tests/graceful_server_shutdown.c',
-        'test/core/end2end/tests/high_initial_seqno.c',
-        'test/core/end2end/tests/hpack_size.c',
-        'test/core/end2end/tests/idempotent_request.c',
-        'test/core/end2end/tests/invoke_large_request.c',
-        'test/core/end2end/tests/keepalive_timeout.c',
-        'test/core/end2end/tests/large_metadata.c',
-        'test/core/end2end/tests/load_reporting_hook.c',
-        'test/core/end2end/tests/max_concurrent_streams.c',
-        'test/core/end2end/tests/max_connection_age.c',
-        'test/core/end2end/tests/max_connection_idle.c',
-        'test/core/end2end/tests/max_message_length.c',
-        'test/core/end2end/tests/negative_deadline.c',
-        'test/core/end2end/tests/network_status_change.c',
-        'test/core/end2end/tests/no_logging.c',
-        'test/core/end2end/tests/no_op.c',
-        'test/core/end2end/tests/payload.c',
-        'test/core/end2end/tests/ping.c',
-        'test/core/end2end/tests/ping_pong_streaming.c',
-        'test/core/end2end/tests/proxy_auth.c',
-        'test/core/end2end/tests/registered_call.c',
-        'test/core/end2end/tests/request_with_flags.c',
-        'test/core/end2end/tests/request_with_payload.c',
-        'test/core/end2end/tests/resource_quota_server.c',
-        'test/core/end2end/tests/server_finishes_request.c',
-        'test/core/end2end/tests/shutdown_finishes_calls.c',
-        'test/core/end2end/tests/shutdown_finishes_tags.c',
-        'test/core/end2end/tests/simple_cacheable_request.c',
-        'test/core/end2end/tests/simple_delayed_request.c',
-        'test/core/end2end/tests/simple_metadata.c',
-        'test/core/end2end/tests/simple_request.c',
-        'test/core/end2end/tests/stream_compression_compressed_payload.c',
-        'test/core/end2end/tests/stream_compression_payload.c',
-        'test/core/end2end/tests/stream_compression_ping_pong_streaming.c',
-        'test/core/end2end/tests/streaming_error_response.c',
-        'test/core/end2end/tests/trailing_metadata.c',
-        'test/core/end2end/tests/workaround_cronet_compression.c',
-        'test/core/end2end/tests/write_buffering.c',
-        'test/core/end2end/tests/write_buffering_at_end.c',
+        'test/core/end2end/end2end_tests.cc',
+        'test/core/end2end/end2end_test_utils.cc',
+        'test/core/end2end/tests/authority_not_supported.cc',
+        'test/core/end2end/tests/bad_hostname.cc',
+        'test/core/end2end/tests/bad_ping.cc',
+        'test/core/end2end/tests/binary_metadata.cc',
+        'test/core/end2end/tests/call_creds.cc',
+        'test/core/end2end/tests/cancel_after_accept.cc',
+        'test/core/end2end/tests/cancel_after_client_done.cc',
+        'test/core/end2end/tests/cancel_after_invoke.cc',
+        'test/core/end2end/tests/cancel_after_round_trip.cc',
+        'test/core/end2end/tests/cancel_before_invoke.cc',
+        'test/core/end2end/tests/cancel_in_a_vacuum.cc',
+        'test/core/end2end/tests/cancel_with_status.cc',
+        'test/core/end2end/tests/compressed_payload.cc',
+        'test/core/end2end/tests/connectivity.cc',
+        'test/core/end2end/tests/default_host.cc',
+        'test/core/end2end/tests/disappearing_server.cc',
+        'test/core/end2end/tests/empty_batch.cc',
+        'test/core/end2end/tests/filter_call_init_fails.cc',
+        'test/core/end2end/tests/filter_causes_close.cc',
+        'test/core/end2end/tests/filter_latency.cc',
+        'test/core/end2end/tests/graceful_server_shutdown.cc',
+        'test/core/end2end/tests/high_initial_seqno.cc',
+        'test/core/end2end/tests/hpack_size.cc',
+        'test/core/end2end/tests/idempotent_request.cc',
+        'test/core/end2end/tests/invoke_large_request.cc',
+        'test/core/end2end/tests/keepalive_timeout.cc',
+        'test/core/end2end/tests/large_metadata.cc',
+        'test/core/end2end/tests/load_reporting_hook.cc',
+        'test/core/end2end/tests/max_concurrent_streams.cc',
+        'test/core/end2end/tests/max_connection_age.cc',
+        'test/core/end2end/tests/max_connection_idle.cc',
+        'test/core/end2end/tests/max_message_length.cc',
+        'test/core/end2end/tests/negative_deadline.cc',
+        'test/core/end2end/tests/network_status_change.cc',
+        'test/core/end2end/tests/no_logging.cc',
+        'test/core/end2end/tests/no_op.cc',
+        'test/core/end2end/tests/payload.cc',
+        'test/core/end2end/tests/ping.cc',
+        'test/core/end2end/tests/ping_pong_streaming.cc',
+        'test/core/end2end/tests/proxy_auth.cc',
+        'test/core/end2end/tests/registered_call.cc',
+        'test/core/end2end/tests/request_with_flags.cc',
+        'test/core/end2end/tests/request_with_payload.cc',
+        'test/core/end2end/tests/resource_quota_server.cc',
+        'test/core/end2end/tests/server_finishes_request.cc',
+        'test/core/end2end/tests/shutdown_finishes_calls.cc',
+        'test/core/end2end/tests/shutdown_finishes_tags.cc',
+        'test/core/end2end/tests/simple_cacheable_request.cc',
+        'test/core/end2end/tests/simple_delayed_request.cc',
+        'test/core/end2end/tests/simple_metadata.cc',
+        'test/core/end2end/tests/simple_request.cc',
+        'test/core/end2end/tests/stream_compression_compressed_payload.cc',
+        'test/core/end2end/tests/stream_compression_payload.cc',
+        'test/core/end2end/tests/stream_compression_ping_pong_streaming.cc',
+        'test/core/end2end/tests/streaming_error_response.cc',
+        'test/core/end2end/tests/trailing_metadata.cc',
+        'test/core/end2end/tests/workaround_cronet_compression.cc',
+        'test/core/end2end/tests/write_buffering.cc',
+        'test/core/end2end/tests/write_buffering_at_end.cc',
       ],
     },
     {
@@ -2444,66 +2423,66 @@
         'gpr',
       ],
       'sources': [
-        'test/core/end2end/end2end_nosec_tests.c',
-        'test/core/end2end/end2end_test_utils.c',
-        'test/core/end2end/tests/authority_not_supported.c',
-        'test/core/end2end/tests/bad_hostname.c',
-        'test/core/end2end/tests/bad_ping.c',
-        'test/core/end2end/tests/binary_metadata.c',
-        'test/core/end2end/tests/cancel_after_accept.c',
-        'test/core/end2end/tests/cancel_after_client_done.c',
-        'test/core/end2end/tests/cancel_after_invoke.c',
-        'test/core/end2end/tests/cancel_after_round_trip.c',
-        'test/core/end2end/tests/cancel_before_invoke.c',
-        'test/core/end2end/tests/cancel_in_a_vacuum.c',
-        'test/core/end2end/tests/cancel_with_status.c',
-        'test/core/end2end/tests/compressed_payload.c',
-        'test/core/end2end/tests/connectivity.c',
-        'test/core/end2end/tests/default_host.c',
-        'test/core/end2end/tests/disappearing_server.c',
-        'test/core/end2end/tests/empty_batch.c',
-        'test/core/end2end/tests/filter_call_init_fails.c',
-        'test/core/end2end/tests/filter_causes_close.c',
-        'test/core/end2end/tests/filter_latency.c',
-        'test/core/end2end/tests/graceful_server_shutdown.c',
-        'test/core/end2end/tests/high_initial_seqno.c',
-        'test/core/end2end/tests/hpack_size.c',
-        'test/core/end2end/tests/idempotent_request.c',
-        'test/core/end2end/tests/invoke_large_request.c',
-        'test/core/end2end/tests/keepalive_timeout.c',
-        'test/core/end2end/tests/large_metadata.c',
-        'test/core/end2end/tests/load_reporting_hook.c',
-        'test/core/end2end/tests/max_concurrent_streams.c',
-        'test/core/end2end/tests/max_connection_age.c',
-        'test/core/end2end/tests/max_connection_idle.c',
-        'test/core/end2end/tests/max_message_length.c',
-        'test/core/end2end/tests/negative_deadline.c',
-        'test/core/end2end/tests/network_status_change.c',
-        'test/core/end2end/tests/no_logging.c',
-        'test/core/end2end/tests/no_op.c',
-        'test/core/end2end/tests/payload.c',
-        'test/core/end2end/tests/ping.c',
-        'test/core/end2end/tests/ping_pong_streaming.c',
-        'test/core/end2end/tests/proxy_auth.c',
-        'test/core/end2end/tests/registered_call.c',
-        'test/core/end2end/tests/request_with_flags.c',
-        'test/core/end2end/tests/request_with_payload.c',
-        'test/core/end2end/tests/resource_quota_server.c',
-        'test/core/end2end/tests/server_finishes_request.c',
-        'test/core/end2end/tests/shutdown_finishes_calls.c',
-        'test/core/end2end/tests/shutdown_finishes_tags.c',
-        'test/core/end2end/tests/simple_cacheable_request.c',
-        'test/core/end2end/tests/simple_delayed_request.c',
-        'test/core/end2end/tests/simple_metadata.c',
-        'test/core/end2end/tests/simple_request.c',
-        'test/core/end2end/tests/stream_compression_compressed_payload.c',
-        'test/core/end2end/tests/stream_compression_payload.c',
-        'test/core/end2end/tests/stream_compression_ping_pong_streaming.c',
-        'test/core/end2end/tests/streaming_error_response.c',
-        'test/core/end2end/tests/trailing_metadata.c',
-        'test/core/end2end/tests/workaround_cronet_compression.c',
-        'test/core/end2end/tests/write_buffering.c',
-        'test/core/end2end/tests/write_buffering_at_end.c',
+        'test/core/end2end/end2end_nosec_tests.cc',
+        'test/core/end2end/end2end_test_utils.cc',
+        'test/core/end2end/tests/authority_not_supported.cc',
+        'test/core/end2end/tests/bad_hostname.cc',
+        'test/core/end2end/tests/bad_ping.cc',
+        'test/core/end2end/tests/binary_metadata.cc',
+        'test/core/end2end/tests/cancel_after_accept.cc',
+        'test/core/end2end/tests/cancel_after_client_done.cc',
+        'test/core/end2end/tests/cancel_after_invoke.cc',
+        'test/core/end2end/tests/cancel_after_round_trip.cc',
+        'test/core/end2end/tests/cancel_before_invoke.cc',
+        'test/core/end2end/tests/cancel_in_a_vacuum.cc',
+        'test/core/end2end/tests/cancel_with_status.cc',
+        'test/core/end2end/tests/compressed_payload.cc',
+        'test/core/end2end/tests/connectivity.cc',
+        'test/core/end2end/tests/default_host.cc',
+        'test/core/end2end/tests/disappearing_server.cc',
+        'test/core/end2end/tests/empty_batch.cc',
+        'test/core/end2end/tests/filter_call_init_fails.cc',
+        'test/core/end2end/tests/filter_causes_close.cc',
+        'test/core/end2end/tests/filter_latency.cc',
+        'test/core/end2end/tests/graceful_server_shutdown.cc',
+        'test/core/end2end/tests/high_initial_seqno.cc',
+        'test/core/end2end/tests/hpack_size.cc',
+        'test/core/end2end/tests/idempotent_request.cc',
+        'test/core/end2end/tests/invoke_large_request.cc',
+        'test/core/end2end/tests/keepalive_timeout.cc',
+        'test/core/end2end/tests/large_metadata.cc',
+        'test/core/end2end/tests/load_reporting_hook.cc',
+        'test/core/end2end/tests/max_concurrent_streams.cc',
+        'test/core/end2end/tests/max_connection_age.cc',
+        'test/core/end2end/tests/max_connection_idle.cc',
+        'test/core/end2end/tests/max_message_length.cc',
+        'test/core/end2end/tests/negative_deadline.cc',
+        'test/core/end2end/tests/network_status_change.cc',
+        'test/core/end2end/tests/no_logging.cc',
+        'test/core/end2end/tests/no_op.cc',
+        'test/core/end2end/tests/payload.cc',
+        'test/core/end2end/tests/ping.cc',
+        'test/core/end2end/tests/ping_pong_streaming.cc',
+        'test/core/end2end/tests/proxy_auth.cc',
+        'test/core/end2end/tests/registered_call.cc',
+        'test/core/end2end/tests/request_with_flags.cc',
+        'test/core/end2end/tests/request_with_payload.cc',
+        'test/core/end2end/tests/resource_quota_server.cc',
+        'test/core/end2end/tests/server_finishes_request.cc',
+        'test/core/end2end/tests/shutdown_finishes_calls.cc',
+        'test/core/end2end/tests/shutdown_finishes_tags.cc',
+        'test/core/end2end/tests/simple_cacheable_request.cc',
+        'test/core/end2end/tests/simple_delayed_request.cc',
+        'test/core/end2end/tests/simple_metadata.cc',
+        'test/core/end2end/tests/simple_request.cc',
+        'test/core/end2end/tests/stream_compression_compressed_payload.cc',
+        'test/core/end2end/tests/stream_compression_payload.cc',
+        'test/core/end2end/tests/stream_compression_ping_pong_streaming.cc',
+        'test/core/end2end/tests/streaming_error_response.cc',
+        'test/core/end2end/tests/trailing_metadata.cc',
+        'test/core/end2end/tests/workaround_cronet_compression.cc',
+        'test/core/end2end/tests/write_buffering.cc',
+        'test/core/end2end/tests/write_buffering_at_end.cc',
       ],
     },
   ]
diff --git a/include/grpc++/alarm.h b/include/grpc++/alarm.h
index 2d88d86..b43425e 100644
--- a/include/grpc++/alarm.h
+++ b/include/grpc++/alarm.h
@@ -92,7 +92,7 @@
   }
 
  private:
-  class AlarmEntry : public CompletionQueueTag {
+  class AlarmEntry : public internal::CompletionQueueTag {
    public:
     AlarmEntry(void* tag) : tag_(tag) {}
     void Set(void* tag) { tag_ = tag; }
diff --git a/include/grpc++/channel.h b/include/grpc++/channel.h
index c50091d..e9fb5a5 100644
--- a/include/grpc++/channel.h
+++ b/include/grpc++/channel.h
@@ -32,7 +32,7 @@
 namespace grpc {
 /// Channels represent a connection to an endpoint. Created by \a CreateChannel.
 class Channel final : public ChannelInterface,
-                      public CallHook,
+                      public internal::CallHook,
                       public std::enable_shared_from_this<Channel>,
                       private GrpcLibraryCodegen {
  public:
@@ -51,18 +51,16 @@
 
  private:
   template <class InputMessage, class OutputMessage>
-  friend Status BlockingUnaryCall(ChannelInterface* channel,
-                                  const RpcMethod& method,
-                                  ClientContext* context,
-                                  const InputMessage& request,
-                                  OutputMessage* result);
+  friend class internal::BlockingUnaryCallImpl;
   friend std::shared_ptr<Channel> CreateChannelInternal(
       const grpc::string& host, grpc_channel* c_channel);
   Channel(const grpc::string& host, grpc_channel* c_channel);
 
-  Call CreateCall(const RpcMethod& method, ClientContext* context,
-                  CompletionQueue* cq) override;
-  void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) override;
+  internal::Call CreateCall(const internal::RpcMethod& method,
+                            ClientContext* context,
+                            CompletionQueue* cq) override;
+  void PerformOpsOnCall(internal::CallOpSetInterface* ops,
+                        internal::Call* call) override;
   void* RegisterMethod(const char* method) override;
 
   void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
diff --git a/include/grpc++/impl/channel_argument_option.h b/include/grpc++/impl/channel_argument_option.h
index e918f57..f157ec1 100644
--- a/include/grpc++/impl/channel_argument_option.h
+++ b/include/grpc++/impl/channel_argument_option.h
@@ -28,9 +28,9 @@
 namespace grpc {
 
 std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
-    const grpc::string &name, const grpc::string &value);
+    const grpc::string& name, const grpc::string& value);
 std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
-    const grpc::string &name, int value);
+    const grpc::string& name, int value);
 
 }  // namespace grpc
 
diff --git a/include/grpc++/impl/codegen/async_stream.h b/include/grpc++/impl/codegen/async_stream.h
index e60572f..4476033 100644
--- a/include/grpc++/impl/codegen/async_stream.h
+++ b/include/grpc++/impl/codegen/async_stream.h
@@ -30,6 +30,7 @@
 
 class CompletionQueue;
 
+namespace internal {
 /// Common interface for all client side asynchronous streaming.
 class ClientAsyncStreamingInterface {
  public:
@@ -151,15 +152,16 @@
   }
 };
 
-template <class R>
-class ClientAsyncReaderInterface : public ClientAsyncStreamingInterface,
-                                   public AsyncReaderInterface<R> {};
+}  // namespace internal
 
-/// Async client-side API for doing server-streaming RPCs,
-/// where the incoming message stream coming from the server has
-/// messages of type \a R.
 template <class R>
-class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
+class ClientAsyncReaderInterface
+    : public internal::ClientAsyncStreamingInterface,
+      public internal::AsyncReaderInterface<R> {};
+
+namespace internal {
+template <class R>
+class ClientAsyncReaderFactory {
  public:
   /// Create a stream object.
   /// Write the first request out if \a start is set.
@@ -169,16 +171,25 @@
   /// Note that \a context will be used to fill in custom initial metadata
   /// used to send to the server when starting the call.
   template <class W>
-  static ClientAsyncReader* Create(ChannelInterface* channel,
-                                   CompletionQueue* cq, const RpcMethod& method,
-                                   ClientContext* context, const W& request,
-                                   bool start, void* tag) {
-    Call call = channel->CreateCall(method, context, cq);
+  static ClientAsyncReader<R>* Create(ChannelInterface* channel,
+                                      CompletionQueue* cq,
+                                      const ::grpc::internal::RpcMethod& method,
+                                      ClientContext* context, const W& request,
+                                      bool start, void* tag) {
+    ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
     return new (g_core_codegen_interface->grpc_call_arena_alloc(
-        call.call(), sizeof(ClientAsyncReader)))
-        ClientAsyncReader(call, context, request, start, tag);
+        call.call(), sizeof(ClientAsyncReader<R>)))
+        ClientAsyncReader<R>(call, context, request, start, tag);
   }
+};
+}  // namespace internal
 
+/// Async client-side API for doing server-streaming RPCs,
+/// where the incoming message stream coming from the server has
+/// messages of type \a R.
+template <class R>
+class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
+ public:
   // always allocated against a call arena, no memory free required
   static void operator delete(void* ptr, std::size_t size) {
     assert(size == sizeof(ClientAsyncReader));
@@ -233,9 +244,10 @@
   }
 
  private:
+  friend class internal::ClientAsyncReaderFactory<R>;
   template <class W>
-  ClientAsyncReader(Call call, ClientContext* context, const W& request,
-                    bool start, void* tag)
+  ClientAsyncReader(::grpc::internal::Call call, ClientContext* context,
+                    const W& request, bool start, void* tag)
       : context_(context), call_(call), started_(start) {
     // TODO(ctiller): don't assert
     GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok());
@@ -255,19 +267,27 @@
   }
 
   ClientContext* context_;
-  Call call_;
+  ::grpc::internal::Call call_;
   bool started_;
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpClientSendClose>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                              ::grpc::internal::CallOpSendMessage,
+                              ::grpc::internal::CallOpClientSendClose>
       init_ops_;
-  CallOpSet<CallOpRecvInitialMetadata> meta_ops_;
-  CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> read_ops_;
-  CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> finish_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+      meta_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                              ::grpc::internal::CallOpRecvMessage<R>>
+      read_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                              ::grpc::internal::CallOpClientRecvStatus>
+      finish_ops_;
 };
 
 /// Common interface for client side asynchronous writing.
 template <class W>
-class ClientAsyncWriterInterface : public ClientAsyncStreamingInterface,
-                                   public AsyncWriterInterface<W> {
+class ClientAsyncWriterInterface
+    : public internal::ClientAsyncStreamingInterface,
+      public internal::AsyncWriterInterface<W> {
  public:
   /// Signal the client is done with the writes (half-close the client stream).
   /// Thread-safe with respect to \a AsyncReaderInterface::Read
@@ -276,11 +296,9 @@
   virtual void WritesDone(void* tag) = 0;
 };
 
-/// Async API on the client side for doing client-streaming RPCs,
-/// where the outgoing message stream going to the server contains
-/// messages of type \a W.
+namespace internal {
 template <class W>
-class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
+class ClientAsyncWriterFactory {
  public:
   /// Create a stream object.
   /// Start the RPC if \a start is set
@@ -294,16 +312,25 @@
   /// message from the server upon a successful call to the \a Finish
   /// method of this instance.
   template <class R>
-  static ClientAsyncWriter* Create(ChannelInterface* channel,
-                                   CompletionQueue* cq, const RpcMethod& method,
-                                   ClientContext* context, R* response,
-                                   bool start, void* tag) {
-    Call call = channel->CreateCall(method, context, cq);
+  static ClientAsyncWriter<W>* Create(ChannelInterface* channel,
+                                      CompletionQueue* cq,
+                                      const ::grpc::internal::RpcMethod& method,
+                                      ClientContext* context, R* response,
+                                      bool start, void* tag) {
+    ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
     return new (g_core_codegen_interface->grpc_call_arena_alloc(
-        call.call(), sizeof(ClientAsyncWriter)))
-        ClientAsyncWriter(call, context, response, start, tag);
+        call.call(), sizeof(ClientAsyncWriter<W>)))
+        ClientAsyncWriter<W>(call, context, response, start, tag);
   }
+};
+}  // namespace internal
 
+/// Async API on the client side for doing client-streaming RPCs,
+/// where the outgoing message stream going to the server contains
+/// messages of type \a W.
+template <class W>
+class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
+ public:
   // always allocated against a call arena, no memory free required
   static void operator delete(void* ptr, std::size_t size) {
     assert(size == sizeof(ClientAsyncWriter));
@@ -376,9 +403,10 @@
   }
 
  private:
+  friend class internal::ClientAsyncWriterFactory<W>;
   template <class R>
-  ClientAsyncWriter(Call call, ClientContext* context, R* response, bool start,
-                    void* tag)
+  ClientAsyncWriter(::grpc::internal::Call call, ClientContext* context,
+                    R* response, bool start, void* tag)
       : context_(context), call_(call), started_(start) {
     finish_ops_.RecvMessage(response);
     finish_ops_.AllowNoMessage();
@@ -401,13 +429,17 @@
   }
 
   ClientContext* context_;
-  Call call_;
+  ::grpc::internal::Call call_;
   bool started_;
-  CallOpSet<CallOpRecvInitialMetadata> meta_ops_;
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpClientSendClose>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+      meta_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                              ::grpc::internal::CallOpSendMessage,
+                              ::grpc::internal::CallOpClientSendClose>
       write_ops_;
-  CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
-            CallOpClientRecvStatus>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                              ::grpc::internal::CallOpGenericRecvMessage,
+                              ::grpc::internal::CallOpClientRecvStatus>
       finish_ops_;
 };
 
@@ -415,9 +447,10 @@
 /// where the client-to-server message stream has messages of type \a W,
 /// and the server-to-client message stream has messages of type \a R.
 template <class W, class R>
-class ClientAsyncReaderWriterInterface : public ClientAsyncStreamingInterface,
-                                         public AsyncWriterInterface<W>,
-                                         public AsyncReaderInterface<R> {
+class ClientAsyncReaderWriterInterface
+    : public internal::ClientAsyncStreamingInterface,
+      public internal::AsyncWriterInterface<W>,
+      public internal::AsyncReaderInterface<R> {
  public:
   /// Signal the client is done with the writes (half-close the client stream).
   /// Thread-safe with respect to \a AsyncReaderInterface::Read
@@ -426,6 +459,30 @@
   virtual void WritesDone(void* tag) = 0;
 };
 
+namespace internal {
+template <class W, class R>
+class ClientAsyncReaderWriterFactory {
+ public:
+  /// Create a stream object.
+  /// Start the RPC request if \a start is set.
+  /// \a tag will be notified on \a cq when the call has been started (i.e.
+  /// intitial metadata sent). If \a start is not set, \a tag must be
+  /// nullptr and the actual call must be initiated by StartCall
+  /// Note that \a context will be used to fill in custom initial metadata
+  /// used to send to the server when starting the call.
+  static ClientAsyncReaderWriter<W, R>* Create(
+      ChannelInterface* channel, CompletionQueue* cq,
+      const ::grpc::internal::RpcMethod& method, ClientContext* context,
+      bool start, void* tag) {
+    ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
+
+    return new (g_core_codegen_interface->grpc_call_arena_alloc(
+        call.call(), sizeof(ClientAsyncReaderWriter<W, R>)))
+        ClientAsyncReaderWriter<W, R>(call, context, start, tag);
+  }
+};
+}  // namespace internal
+
 /// Async client-side interface for bi-directional streaming,
 /// where the outgoing message stream going to the server
 /// has messages of type \a W,  and the incoming message stream coming
@@ -434,25 +491,6 @@
 class ClientAsyncReaderWriter final
     : public ClientAsyncReaderWriterInterface<W, R> {
  public:
-  /// Create a stream object.
-  /// Start the RPC request if \a start is set.
-  /// \a tag will be notified on \a cq when the call has been started (i.e.
-  /// intitial metadata sent). If \a start is not set, \a tag must be
-  /// nullptr and the actual call must be initiated by StartCall
-  /// Note that \a context will be used to fill in custom initial metadata
-  /// used to send to the server when starting the call.
-  static ClientAsyncReaderWriter* Create(ChannelInterface* channel,
-                                         CompletionQueue* cq,
-                                         const RpcMethod& method,
-                                         ClientContext* context, bool start,
-                                         void* tag) {
-    Call call = channel->CreateCall(method, context, cq);
-
-    return new (g_core_codegen_interface->grpc_call_arena_alloc(
-        call.call(), sizeof(ClientAsyncReaderWriter)))
-        ClientAsyncReaderWriter(call, context, start, tag);
-  }
-
   // always allocated against a call arena, no memory free required
   static void operator delete(void* ptr, std::size_t size) {
     assert(size == sizeof(ClientAsyncReaderWriter));
@@ -532,8 +570,9 @@
   }
 
  private:
-  ClientAsyncReaderWriter(Call call, ClientContext* context, bool start,
-                          void* tag)
+  friend class internal::ClientAsyncReaderWriterFactory<W, R>;
+  ClientAsyncReaderWriter(::grpc::internal::Call call, ClientContext* context,
+                          bool start, void* tag)
       : context_(context), call_(call), started_(start) {
     if (start) {
       StartCallInternal(tag);
@@ -554,18 +593,26 @@
   }
 
   ClientContext* context_;
-  Call call_;
+  ::grpc::internal::Call call_;
   bool started_;
-  CallOpSet<CallOpRecvInitialMetadata> meta_ops_;
-  CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> read_ops_;
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpClientSendClose>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+      meta_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                              ::grpc::internal::CallOpRecvMessage<R>>
+      read_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                              ::grpc::internal::CallOpSendMessage,
+                              ::grpc::internal::CallOpClientSendClose>
       write_ops_;
-  CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> finish_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                              ::grpc::internal::CallOpClientRecvStatus>
+      finish_ops_;
 };
 
 template <class W, class R>
-class ServerAsyncReaderInterface : public ServerAsyncStreamingInterface,
-                                   public AsyncReaderInterface<R> {
+class ServerAsyncReaderInterface
+    : public internal::ServerAsyncStreamingInterface,
+      public internal::AsyncReaderInterface<R> {
  public:
   /// Indicate that the stream is to be finished with a certain status code
   /// and also send out \a msg response to the client.
@@ -692,20 +739,23 @@
   }
 
  private:
-  void BindCall(Call* call) override { call_ = *call; }
+  void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
 
-  Call call_;
+  ::grpc::internal::Call call_;
   ServerContext* ctx_;
-  CallOpSet<CallOpSendInitialMetadata> meta_ops_;
-  CallOpSet<CallOpRecvMessage<R>> read_ops_;
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
-            CallOpServerSendStatus>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+      meta_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> read_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                              ::grpc::internal::CallOpSendMessage,
+                              ::grpc::internal::CallOpServerSendStatus>
       finish_ops_;
 };
 
 template <class W>
-class ServerAsyncWriterInterface : public ServerAsyncStreamingInterface,
-                                   public AsyncWriterInterface<W> {
+class ServerAsyncWriterInterface
+    : public internal::ServerAsyncStreamingInterface,
+      public internal::AsyncWriterInterface<W> {
  public:
   /// Indicate that the stream is to be finished with a certain status code.
   /// Request notification for when the server has sent the appropriate
@@ -823,7 +873,7 @@
   }
 
  private:
-  void BindCall(Call* call) override { call_ = *call; }
+  void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
 
   template <class T>
   void EnsureInitialMetadataSent(T* ops) {
@@ -837,20 +887,25 @@
     }
   }
 
-  Call call_;
+  ::grpc::internal::Call call_;
   ServerContext* ctx_;
-  CallOpSet<CallOpSendInitialMetadata> meta_ops_;
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
-            CallOpServerSendStatus>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+      meta_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                              ::grpc::internal::CallOpSendMessage,
+                              ::grpc::internal::CallOpServerSendStatus>
       write_ops_;
-  CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                              ::grpc::internal::CallOpServerSendStatus>
+      finish_ops_;
 };
 
 /// Server-side interface for asynchronous bi-directional streaming.
 template <class W, class R>
-class ServerAsyncReaderWriterInterface : public ServerAsyncStreamingInterface,
-                                         public AsyncWriterInterface<W>,
-                                         public AsyncReaderInterface<R> {
+class ServerAsyncReaderWriterInterface
+    : public internal::ServerAsyncStreamingInterface,
+      public internal::AsyncWriterInterface<W>,
+      public internal::AsyncReaderInterface<R> {
  public:
   /// Indicate that the stream is to be finished with a certain status code.
   /// Request notification for when the server has sent the appropriate
@@ -980,7 +1035,7 @@
  private:
   friend class ::grpc::Server;
 
-  void BindCall(Call* call) override { call_ = *call; }
+  void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
 
   template <class T>
   void EnsureInitialMetadataSent(T* ops) {
@@ -994,14 +1049,18 @@
     }
   }
 
-  Call call_;
+  ::grpc::internal::Call call_;
   ServerContext* ctx_;
-  CallOpSet<CallOpSendInitialMetadata> meta_ops_;
-  CallOpSet<CallOpRecvMessage<R>> read_ops_;
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
-            CallOpServerSendStatus>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+      meta_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> read_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                              ::grpc::internal::CallOpSendMessage,
+                              ::grpc::internal::CallOpServerSendStatus>
       write_ops_;
-  CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                              ::grpc::internal::CallOpServerSendStatus>
+      finish_ops_;
 };
 
 }  // namespace grpc
diff --git a/include/grpc++/impl/codegen/async_unary_call.h b/include/grpc++/impl/codegen/async_unary_call.h
index e472f04..b9ea5fd 100644
--- a/include/grpc++/impl/codegen/async_unary_call.h
+++ b/include/grpc++/impl/codegen/async_unary_call.h
@@ -69,11 +69,9 @@
   virtual void Finish(R* msg, Status* status, void* tag) = 0;
 };
 
-/// Async API for client-side unary RPCs, where the message response
-/// received from the server is of type \a R.
+namespace internal {
 template <class R>
-class ClientAsyncResponseReader final
-    : public ClientAsyncResponseReaderInterface<R> {
+class ClientAsyncResponseReaderFactory {
  public:
   /// Start a call and write the request out if \a start is set.
   /// \a tag will be notified on \a cq when the call has been started (i.e.
@@ -82,17 +80,24 @@
   /// Note that \a context will be used to fill in custom initial metadata
   /// used to send to the server when starting the call.
   template <class W>
-  static ClientAsyncResponseReader* Create(ChannelInterface* channel,
-                                           CompletionQueue* cq,
-                                           const RpcMethod& method,
-                                           ClientContext* context,
-                                           const W& request, bool start) {
-    Call call = channel->CreateCall(method, context, cq);
+  static ClientAsyncResponseReader<R>* Create(
+      ChannelInterface* channel, CompletionQueue* cq,
+      const ::grpc::internal::RpcMethod& method, ClientContext* context,
+      const W& request, bool start) {
+    ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
     return new (g_core_codegen_interface->grpc_call_arena_alloc(
-        call.call(), sizeof(ClientAsyncResponseReader)))
-        ClientAsyncResponseReader(call, context, request, start);
+        call.call(), sizeof(ClientAsyncResponseReader<R>)))
+        ClientAsyncResponseReader<R>(call, context, request, start);
   }
+};
+}  // namespace internal
 
+/// Async API for client-side unary RPCs, where the message response
+/// received from the server is of type \a R.
+template <class R>
+class ClientAsyncResponseReader final
+    : public ClientAsyncResponseReaderInterface<R> {
+ public:
   // always allocated against a call arena, no memory free required
   static void operator delete(void* ptr, std::size_t size) {
     assert(size == sizeof(ClientAsyncResponseReader));
@@ -137,13 +142,14 @@
   }
 
  private:
+  friend class internal::ClientAsyncResponseReaderFactory<R>;
   ClientContext* const context_;
-  Call call_;
+  ::grpc::internal::Call call_;
   bool started_;
 
   template <class W>
-  ClientAsyncResponseReader(Call call, ClientContext* context, const W& request,
-                            bool start)
+  ClientAsyncResponseReader(::grpc::internal::Call call, ClientContext* context,
+                            const W& request, bool start)
       : context_(context), call_(call), started_(start) {
     // Bind the metadata at time of StartCallInternal but set up the rest here
     // TODO(ctiller): don't assert
@@ -162,19 +168,23 @@
   static void* operator new(std::size_t size);
   static void* operator new(std::size_t size, void* p) { return p; }
 
-  SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
-                  CallOpClientSendClose>
+  ::grpc::internal::SneakyCallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                                    ::grpc::internal::CallOpSendMessage,
+                                    ::grpc::internal::CallOpClientSendClose>
       init_buf;
-  CallOpSet<CallOpRecvInitialMetadata> meta_buf;
-  CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>,
-            CallOpClientRecvStatus>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+      meta_buf;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                              ::grpc::internal::CallOpRecvMessage<R>,
+                              ::grpc::internal::CallOpClientRecvStatus>
       finish_buf;
 };
 
 /// Async server-side API for handling unary calls, where the single
 /// response message sent to the client is of type \a W.
 template <class W>
-class ServerAsyncResponseWriter final : public ServerAsyncStreamingInterface {
+class ServerAsyncResponseWriter final
+    : public internal::ServerAsyncStreamingInterface {
  public:
   explicit ServerAsyncResponseWriter(ServerContext* ctx)
       : call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
@@ -262,13 +272,15 @@
   }
 
  private:
-  void BindCall(Call* call) override { call_ = *call; }
+  void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
 
-  Call call_;
+  ::grpc::internal::Call call_;
   ServerContext* ctx_;
-  CallOpSet<CallOpSendInitialMetadata> meta_buf_;
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
-            CallOpServerSendStatus>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+      meta_buf_;
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                              ::grpc::internal::CallOpSendMessage,
+                              ::grpc::internal::CallOpServerSendStatus>
       finish_buf_;
 };
 
@@ -285,6 +297,6 @@
  public:
   void operator()(void* p) {}
 };
-}
+}  // namespace std
 
 #endif  // GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H
diff --git a/include/grpc++/impl/codegen/byte_buffer.h b/include/grpc++/impl/codegen/byte_buffer.h
index 57d731b..fe73ce7 100644
--- a/include/grpc++/impl/codegen/byte_buffer.h
+++ b/include/grpc++/impl/codegen/byte_buffer.h
@@ -31,18 +31,19 @@
 
 namespace grpc {
 
+namespace internal {
+class CallOpSendMessage;
 template <class R>
 class CallOpRecvMessage;
+class CallOpGenericRecvMessage;
 class MethodHandler;
 template <class ServiceType, class RequestType, class ResponseType>
 class RpcMethodHandler;
 template <class ServiceType, class RequestType, class ResponseType>
 class ServerStreamingHandler;
-namespace CallOpGenericRecvMessageHelper {
 template <class R>
 class DeserializeFuncType;
-}  // namespace CallOpGenericRecvMessageHelper
-
+}  // namespace internal
 /// A sequence of bytes.
 class ByteBuffer final {
  public:
@@ -97,17 +98,17 @@
 
  private:
   friend class SerializationTraits<ByteBuffer, void>;
-  friend class CallOpSendMessage;
+  friend class internal::CallOpSendMessage;
   template <class R>
-  friend class CallOpRecvMessage;
-  friend class CallOpGenericRecvMessage;
-  friend class MethodHandler;
+  friend class internal::CallOpRecvMessage;
+  friend class internal::CallOpGenericRecvMessage;
+  friend class internal::MethodHandler;
   template <class ServiceType, class RequestType, class ResponseType>
-  friend class RpcMethodHandler;
+  friend class internal::RpcMethodHandler;
   template <class ServiceType, class RequestType, class ResponseType>
-  friend class ServerStreamingHandler;
+  friend class internal::ServerStreamingHandler;
   template <class R>
-  friend class CallOpGenericRecvMessageHelper::DeserializeFuncType;
+  friend class internal::DeserializeFuncType;
 
   grpc_byte_buffer* buffer_;
 
diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h
index 06f107f..1a98829 100644
--- a/include/grpc++/impl/codegen/call.h
+++ b/include/grpc++/impl/codegen/call.h
@@ -43,11 +43,13 @@
 namespace grpc {
 
 class ByteBuffer;
-class Call;
-class CallHook;
 class CompletionQueue;
 extern CoreCodegenInterface* g_core_codegen_interface;
 
+namespace internal {
+class Call;
+class CallHook;
+
 const char kBinaryErrorDetailsKey[] = "grpc-status-details-bin";
 
 // TODO(yangg) if the map is changed before we send, the pointers will be a
@@ -75,6 +77,7 @@
   }
   return metadata_array;
 }
+}  // namespace internal
 
 /// Per-message write options.
 class WriteOptions {
@@ -199,6 +202,7 @@
   bool last_message_;
 };
 
+namespace internal {
 /// Default argument for CallOpSet. I is unused by the class, but can be
 /// used for generating multiple names for the same thing.
 template <int I>
@@ -387,7 +391,6 @@
   bool allow_not_getting_message_;
 };
 
-namespace CallOpGenericRecvMessageHelper {
 class DeserializeFunc {
  public:
   virtual Status Deserialize(ByteBuffer* buf) = 0;
@@ -407,7 +410,6 @@
  private:
   R* message_;  // Not a managed pointer because management is external to this
 };
-}  // namespace CallOpGenericRecvMessageHelper
 
 class CallOpGenericRecvMessage {
  public:
@@ -418,8 +420,7 @@
   void RecvMessage(R* message) {
     // Use an explicit base class pointer to avoid resolution error in the
     // following unique_ptr::reset for some old implementations.
-    CallOpGenericRecvMessageHelper::DeserializeFunc* func =
-        new CallOpGenericRecvMessageHelper::DeserializeFuncType<R>(message);
+    DeserializeFunc* func = new DeserializeFuncType<R>(message);
     deserialize_.reset(func);
   }
 
@@ -459,7 +460,7 @@
   }
 
  private:
-  std::unique_ptr<CallOpGenericRecvMessageHelper::DeserializeFunc> deserialize_;
+  std::unique_ptr<DeserializeFunc> deserialize_;
   ByteBuffer recv_buf_;
   bool allow_not_getting_message_;
 };
@@ -714,7 +715,7 @@
   grpc_call* call_;
   int max_receive_message_size_;
 };
-
+}  // namespace internal
 }  // namespace grpc
 
 #endif  // GRPCXX_IMPL_CODEGEN_CALL_H
diff --git a/include/grpc++/impl/codegen/call_hook.h b/include/grpc++/impl/codegen/call_hook.h
index d026cc8..44e9de2 100644
--- a/include/grpc++/impl/codegen/call_hook.h
+++ b/include/grpc++/impl/codegen/call_hook.h
@@ -21,6 +21,7 @@
 
 namespace grpc {
 
+namespace internal {
 class CallOpSetInterface;
 class Call;
 
@@ -31,6 +32,7 @@
   virtual ~CallHook() {}
   virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0;
 };
+}  // namespace internal
 
 }  // namespace grpc
 
diff --git a/include/grpc++/impl/codegen/channel_interface.h b/include/grpc++/impl/codegen/channel_interface.h
index 1b7590b..769f853 100644
--- a/include/grpc++/impl/codegen/channel_interface.h
+++ b/include/grpc++/impl/codegen/channel_interface.h
@@ -24,10 +24,8 @@
 #include <grpc/impl/codegen/connectivity_state.h>
 
 namespace grpc {
-class Call;
+class ChannelInterface;
 class ClientContext;
-class RpcMethod;
-class CallOpSetInterface;
 class CompletionQueue;
 
 template <class R>
@@ -36,14 +34,22 @@
 class ClientWriter;
 template <class W, class R>
 class ClientReaderWriter;
+
+namespace internal {
+class Call;
+class CallOpSetInterface;
+class RpcMethod;
+template <class InputMessage, class OutputMessage>
+class BlockingUnaryCallImpl;
 template <class R>
-class ClientAsyncReader;
+class ClientAsyncReaderFactory;
 template <class W>
-class ClientAsyncWriter;
+class ClientAsyncWriterFactory;
 template <class W, class R>
-class ClientAsyncReaderWriter;
+class ClientAsyncReaderWriterFactory;
 template <class R>
-class ClientAsyncResponseReader;
+class ClientAsyncResponseReaderFactory;
+}  // namespace internal
 
 /// Codegen interface for \a grpc::Channel.
 class ChannelInterface {
@@ -88,23 +94,21 @@
   template <class W, class R>
   friend class ::grpc::ClientReaderWriter;
   template <class R>
-  friend class ::grpc::ClientAsyncReader;
+  friend class ::grpc::internal::ClientAsyncReaderFactory;
   template <class W>
-  friend class ::grpc::ClientAsyncWriter;
+  friend class ::grpc::internal::ClientAsyncWriterFactory;
   template <class W, class R>
-  friend class ::grpc::ClientAsyncReaderWriter;
+  friend class ::grpc::internal::ClientAsyncReaderWriterFactory;
   template <class R>
-  friend class ::grpc::ClientAsyncResponseReader;
+  friend class ::grpc::internal::ClientAsyncResponseReaderFactory;
   template <class InputMessage, class OutputMessage>
-  friend Status BlockingUnaryCall(ChannelInterface* channel,
-                                  const RpcMethod& method,
-                                  ClientContext* context,
-                                  const InputMessage& request,
-                                  OutputMessage* result);
-  friend class ::grpc::RpcMethod;
-  virtual Call CreateCall(const RpcMethod& method, ClientContext* context,
-                          CompletionQueue* cq) = 0;
-  virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0;
+  friend class ::grpc::internal::BlockingUnaryCallImpl;
+  friend class ::grpc::internal::RpcMethod;
+  virtual internal::Call CreateCall(const internal::RpcMethod& method,
+                                    ClientContext* context,
+                                    CompletionQueue* cq) = 0;
+  virtual void PerformOpsOnCall(internal::CallOpSetInterface* ops,
+                                internal::Call* call) = 0;
   virtual void* RegisterMethod(const char* method) = 0;
   virtual void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
                                        gpr_timespec deadline,
@@ -112,7 +116,6 @@
   virtual bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
                                       gpr_timespec deadline) = 0;
 };
-
 }  // namespace grpc
 
 #endif  // GRPCXX_IMPL_CODEGEN_CHANNEL_INTERFACE_H
diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h
index 6d7e13b..22b581c 100644
--- a/include/grpc++/impl/codegen/client_context.h
+++ b/include/grpc++/impl/codegen/client_context.h
@@ -60,7 +60,16 @@
 class ChannelInterface;
 class CompletionQueue;
 class CallCredentials;
+class ClientContext;
+
+namespace internal {
 class RpcMethod;
+class CallOpClientRecvStatus;
+class CallOpRecvInitialMetadata;
+template <class InputMessage, class OutputMessage>
+class BlockingUnaryCallImpl;
+}  // namespace internal
+
 template <class R>
 class ClientReader;
 template <class W>
@@ -345,8 +354,8 @@
   ClientContext& operator=(const ClientContext&);
 
   friend class ::grpc::testing::InteropClientContextInspector;
-  friend class CallOpClientRecvStatus;
-  friend class CallOpRecvInitialMetadata;
+  friend class ::grpc::internal::CallOpClientRecvStatus;
+  friend class ::grpc::internal::CallOpRecvInitialMetadata;
   friend class Channel;
   template <class R>
   friend class ::grpc::ClientReader;
@@ -363,11 +372,7 @@
   template <class R>
   friend class ::grpc::ClientAsyncResponseReader;
   template <class InputMessage, class OutputMessage>
-  friend Status BlockingUnaryCall(ChannelInterface* channel,
-                                  const RpcMethod& method,
-                                  ClientContext* context,
-                                  const InputMessage& request,
-                                  OutputMessage* result);
+  friend class ::grpc::internal::BlockingUnaryCallImpl;
 
   grpc_call* call() const { return call_; }
   void set_call(grpc_call* call, const std::shared_ptr<Channel>& channel);
@@ -399,8 +404,8 @@
   mutable std::shared_ptr<const AuthContext> auth_context_;
   struct census_context* census_context_;
   std::multimap<grpc::string, grpc::string> send_initial_metadata_;
-  MetadataMap recv_initial_metadata_;
-  MetadataMap trailing_metadata_;
+  internal::MetadataMap recv_initial_metadata_;
+  internal::MetadataMap trailing_metadata_;
 
   grpc_call* propagate_from_call_;
   PropagationOptions propagation_options_;
diff --git a/include/grpc++/impl/codegen/client_unary_call.h b/include/grpc++/impl/codegen/client_unary_call.h
index 7c540fa..256dd85 100644
--- a/include/grpc++/impl/codegen/client_unary_call.h
+++ b/include/grpc++/impl/codegen/client_unary_call.h
@@ -30,43 +30,60 @@
 class Channel;
 class ClientContext;
 class CompletionQueue;
-class RpcMethod;
 
+namespace internal {
+class RpcMethod;
 /// Wrapper that performs a blocking unary call
 template <class InputMessage, class OutputMessage>
 Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
                          ClientContext* context, const InputMessage& request,
                          OutputMessage* result) {
-  CompletionQueue cq(grpc_completion_queue_attributes{
-      GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
-      GRPC_CQ_DEFAULT_POLLING});  // Pluckable completion queue
-  Call call(channel->CreateCall(method, context, &cq));
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
-            CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
-            CallOpClientSendClose, CallOpClientRecvStatus>
-      ops;
-  Status status = ops.SendMessage(request);
-  if (!status.ok()) {
-    return status;
-  }
-  ops.SendInitialMetadata(context->send_initial_metadata_,
-                          context->initial_metadata_flags());
-  ops.RecvInitialMetadata(context);
-  ops.RecvMessage(result);
-  ops.ClientSendClose();
-  ops.ClientRecvStatus(context, &status);
-  call.PerformOps(&ops);
-  if (cq.Pluck(&ops)) {
-    if (!ops.got_message && status.ok()) {
-      return Status(StatusCode::UNIMPLEMENTED,
-                    "No message returned for unary request");
-    }
-  } else {
-    GPR_CODEGEN_ASSERT(!status.ok());
-  }
-  return status;
+  return BlockingUnaryCallImpl<InputMessage, OutputMessage>(
+             channel, method, context, request, result)
+      .status();
 }
 
+template <class InputMessage, class OutputMessage>
+class BlockingUnaryCallImpl {
+ public:
+  BlockingUnaryCallImpl(ChannelInterface* channel, const RpcMethod& method,
+                        ClientContext* context, const InputMessage& request,
+                        OutputMessage* result) {
+    CompletionQueue cq(grpc_completion_queue_attributes{
+        GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
+        GRPC_CQ_DEFAULT_POLLING});  // Pluckable completion queue
+    Call call(channel->CreateCall(method, context, &cq));
+    CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
+              CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
+              CallOpClientSendClose, CallOpClientRecvStatus>
+        ops;
+    status_ = ops.SendMessage(request);
+    if (!status_.ok()) {
+      return;
+    }
+    ops.SendInitialMetadata(context->send_initial_metadata_,
+                            context->initial_metadata_flags());
+    ops.RecvInitialMetadata(context);
+    ops.RecvMessage(result);
+    ops.ClientSendClose();
+    ops.ClientRecvStatus(context, &status_);
+    call.PerformOps(&ops);
+    if (cq.Pluck(&ops)) {
+      if (!ops.got_message && status_.ok()) {
+        status_ = Status(StatusCode::UNIMPLEMENTED,
+                         "No message returned for unary request");
+      }
+    } else {
+      GPR_CODEGEN_ASSERT(!status_.ok());
+    }
+  }
+  Status status() { return status_; }
+
+ private:
+  Status status_;
+};
+
+}  // namespace internal
 }  // namespace grpc
 
 #endif  // GRPCXX_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h
index ca757e2..11cc588 100644
--- a/include/grpc++/impl/codegen/completion_queue.h
+++ b/include/grpc++/impl/codegen/completion_queue.h
@@ -56,7 +56,19 @@
 namespace internal {
 template <class W, class R>
 class ServerReaderWriterBody;
-}
+}  // namespace internal
+
+class Channel;
+class ChannelInterface;
+class ClientContext;
+class CompletionQueue;
+class Server;
+class ServerBuilder;
+class ServerContext;
+
+namespace internal {
+class CompletionQueueTag;
+class RpcMethod;
 template <class ServiceType, class RequestType, class ResponseType>
 class RpcMethodHandler;
 template <class ServiceType, class RequestType, class ResponseType>
@@ -66,16 +78,11 @@
 template <class ServiceType, class RequestType, class ResponseType>
 class BidiStreamingHandler;
 class UnknownMethodHandler;
-
-class Channel;
-class ChannelInterface;
-class ClientContext;
-class CompletionQueueTag;
-class CompletionQueue;
-class RpcMethod;
-class Server;
-class ServerBuilder;
-class ServerContext;
+template <class Streamer, bool WriteNeeded>
+class TemplatedBidiStreamingHandler;
+template <class InputMessage, class OutputMessage>
+class BlockingUnaryCallImpl;
+}  // namespace internal
 
 extern CoreCodegenInterface* g_core_codegen_interface;
 
@@ -109,6 +116,30 @@
     TIMEOUT     ///< deadline was reached.
   };
 
+  /// EXPERIMENTAL
+  /// First executes \a F, then reads from the queue, blocking up to
+  /// \a deadline (or the queue's shutdown).
+  /// Both \a tag and \a ok are updated upon success (if an event is available
+  /// within the \a deadline).  A \a tag points to an arbitrary location usually
+  /// employed to uniquely identify an event.
+  ///
+  /// \param F[in] Function to execute before calling AsyncNext on this queue.
+  /// \param tag[out] Upon sucess, updated to point to the event's tag.
+  /// \param ok[out] Upon sucess, true if read a regular event, false otherwise.
+  /// \param deadline[in] How long to block in wait for an event.
+  ///
+  /// \return The type of event read.
+  template <typename T, typename F>
+  NextStatus DoThenAsyncNext(F&& f, void** tag, bool* ok, const T& deadline) {
+    CompletionQueueTLSCache cache = CompletionQueueTLSCache(this);
+    f();
+    if (cache.Flush(tag, ok)) {
+      return GOT_EVENT;
+    } else {
+      return AsyncNext(tag, ok, deadline);
+    }
+  }
+
   /// Read from the queue, blocking up to \a deadline (or the queue's shutdown).
   /// Both \a tag and \a ok are updated upon success (if an event is available
   /// within the \a deadline).  A \a tag points to an arbitrary location usually
@@ -133,8 +164,9 @@
   ///
   /// \return true if read a regular event, false if the queue is shutting down.
   bool Next(void** tag, bool* ok) {
-    return (AsyncNextInternal(tag, ok, g_core_codegen_interface->gpr_inf_future(
-                                           GPR_CLOCK_REALTIME)) != SHUTDOWN);
+    return (AsyncNextInternal(tag, ok,
+                              g_core_codegen_interface->gpr_inf_future(
+                                  GPR_CLOCK_REALTIME)) != SHUTDOWN);
   }
 
   /// Request the shutdown of the queue.
@@ -196,28 +228,39 @@
   template <class W, class R>
   friend class ::grpc::internal::ServerReaderWriterBody;
   template <class ServiceType, class RequestType, class ResponseType>
-  friend class RpcMethodHandler;
+  friend class ::grpc::internal::RpcMethodHandler;
   template <class ServiceType, class RequestType, class ResponseType>
-  friend class ClientStreamingHandler;
+  friend class ::grpc::internal::ClientStreamingHandler;
   template <class ServiceType, class RequestType, class ResponseType>
-  friend class ServerStreamingHandler;
+  friend class ::grpc::internal::ServerStreamingHandler;
   template <class Streamer, bool WriteNeeded>
-  friend class TemplatedBidiStreamingHandler;
-  friend class UnknownMethodHandler;
+  friend class ::grpc::internal::TemplatedBidiStreamingHandler;
+  friend class ::grpc::internal::UnknownMethodHandler;
   friend class ::grpc::Server;
   friend class ::grpc::ServerContext;
   template <class InputMessage, class OutputMessage>
-  friend Status BlockingUnaryCall(ChannelInterface* channel,
-                                  const RpcMethod& method,
-                                  ClientContext* context,
-                                  const InputMessage& request,
-                                  OutputMessage* result);
+  friend class ::grpc::internal::BlockingUnaryCallImpl;
+
+  /// EXPERIMENTAL
+  /// Creates a Thread Local cache to store the first event
+  /// On this completion queue queued from this thread.  Once
+  /// initialized, it must be flushed on the same thread.
+  class CompletionQueueTLSCache {
+   public:
+    CompletionQueueTLSCache(CompletionQueue* cq);
+    ~CompletionQueueTLSCache();
+    bool Flush(void** tag, bool* ok);
+
+   private:
+    CompletionQueue* cq_;
+    bool flushed_;
+  };
 
   NextStatus AsyncNextInternal(void** tag, bool* ok, gpr_timespec deadline);
 
   /// Wraps \a grpc_completion_queue_pluck.
   /// \warning Must not be mixed with calls to \a Next.
-  bool Pluck(CompletionQueueTag* tag) {
+  bool Pluck(internal::CompletionQueueTag* tag) {
     auto deadline =
         g_core_codegen_interface->gpr_inf_future(GPR_CLOCK_REALTIME);
     auto ev = g_core_codegen_interface->grpc_completion_queue_pluck(
@@ -238,7 +281,7 @@
   /// implementation to simple call the other TryPluck function with a zero
   /// timeout. i.e:
   ///      TryPluck(tag, gpr_time_0(GPR_CLOCK_REALTIME))
-  void TryPluck(CompletionQueueTag* tag) {
+  void TryPluck(internal::CompletionQueueTag* tag) {
     auto deadline = g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME);
     auto ev = g_core_codegen_interface->grpc_completion_queue_pluck(
         cq_, tag, deadline, nullptr);
@@ -254,7 +297,7 @@
   ///
   /// This exects tag->FinalizeResult (if called) to return 'false' i.e expects
   /// that the tag is internal not something that is returned to the user.
-  void TryPluck(CompletionQueueTag* tag, gpr_timespec deadline) {
+  void TryPluck(internal::CompletionQueueTag* tag, gpr_timespec deadline) {
     auto ev = g_core_codegen_interface->grpc_completion_queue_pluck(
         cq_, tag, deadline, nullptr);
     if (ev.type == GRPC_QUEUE_TIMEOUT || ev.type == GRPC_QUEUE_SHUTDOWN) {
diff --git a/include/grpc++/impl/codegen/completion_queue_tag.h b/include/grpc++/impl/codegen/completion_queue_tag.h
index 4d7d3a9..cb16bcf 100644
--- a/include/grpc++/impl/codegen/completion_queue_tag.h
+++ b/include/grpc++/impl/codegen/completion_queue_tag.h
@@ -21,6 +21,7 @@
 
 namespace grpc {
 
+namespace internal {
 /// An interface allowing implementors to process and filter event tags.
 class CompletionQueueTag {
  public:
@@ -31,6 +32,7 @@
   /// queue
   virtual bool FinalizeResult(void** tag, bool* status) = 0;
 };
+}  // namespace internal
 
 }  // namespace grpc
 
diff --git a/include/grpc++/impl/codegen/config_protobuf.h b/include/grpc++/impl/codegen/config_protobuf.h
index c5e5bdf..7387fa2 100644
--- a/include/grpc++/impl/codegen/config_protobuf.h
+++ b/include/grpc++/impl/codegen/config_protobuf.h
@@ -19,6 +19,8 @@
 #ifndef GRPCXX_IMPL_CODEGEN_CONFIG_PROTOBUF_H
 #define GRPCXX_IMPL_CODEGEN_CONFIG_PROTOBUF_H
 
+#define GRPC_OPEN_SOURCE_PROTO
+
 #ifndef GRPC_CUSTOM_PROTOBUF_INT64
 #include <google/protobuf/stubs/common.h>
 #define GRPC_CUSTOM_PROTOBUF_INT64 ::google::protobuf::int64
diff --git a/include/grpc++/impl/codegen/core_codegen.h b/include/grpc++/impl/codegen/core_codegen.h
index c751c1e..d7c57be 100644
--- a/include/grpc++/impl/codegen/core_codegen.h
+++ b/include/grpc++/impl/codegen/core_codegen.h
@@ -50,6 +50,9 @@
   void* gpr_malloc(size_t size) override;
   void gpr_free(void* p) override;
 
+  void grpc_init() override;
+  void grpc_shutdown() override;
+
   void gpr_mu_init(gpr_mu* mu) override;
   void gpr_mu_destroy(gpr_mu* mu) override;
   void gpr_mu_lock(gpr_mu* mu) override;
@@ -89,6 +92,7 @@
   grpc_slice grpc_slice_ref(grpc_slice slice) override;
   grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) override;
   grpc_slice grpc_slice_split_head(grpc_slice* s, size_t split) override;
+  grpc_slice grpc_slice_sub(grpc_slice s, size_t begin, size_t end) override;
   void grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice slice) override;
   void grpc_slice_buffer_pop(grpc_slice_buffer* sb) override;
   grpc_slice grpc_slice_from_static_buffer(const void* buffer,
diff --git a/include/grpc++/impl/codegen/core_codegen_interface.h b/include/grpc++/impl/codegen/core_codegen_interface.h
index a4c50da..1949cda 100644
--- a/include/grpc++/impl/codegen/core_codegen_interface.h
+++ b/include/grpc++/impl/codegen/core_codegen_interface.h
@@ -63,6 +63,13 @@
   virtual void* gpr_malloc(size_t size) = 0;
   virtual void gpr_free(void* p) = 0;
 
+  // These are only to be used to fix edge cases involving grpc_init and
+  // grpc_shutdown. Calling grpc_init from the codegen interface before
+  // the real grpc_init is called will cause a crash, so if you use this
+  // function, ensure that it is not the first call to grpc_init.
+  virtual void grpc_init() = 0;
+  virtual void grpc_shutdown() = 0;
+
   virtual void gpr_mu_init(gpr_mu* mu) = 0;
   virtual void gpr_mu_destroy(gpr_mu* mu) = 0;
   virtual void gpr_mu_lock(gpr_mu* mu) = 0;
@@ -103,6 +110,7 @@
   virtual grpc_slice grpc_slice_ref(grpc_slice slice) = 0;
   virtual grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) = 0;
   virtual grpc_slice grpc_slice_split_head(grpc_slice* s, size_t split) = 0;
+  virtual grpc_slice grpc_slice_sub(grpc_slice s, size_t begin, size_t end) = 0;
   virtual void grpc_slice_buffer_add(grpc_slice_buffer* sb,
                                      grpc_slice slice) = 0;
   virtual void grpc_slice_buffer_pop(grpc_slice_buffer* sb) = 0;
diff --git a/include/grpc++/impl/codegen/metadata_map.h b/include/grpc++/impl/codegen/metadata_map.h
index b739859..8dc7211 100644
--- a/include/grpc++/impl/codegen/metadata_map.h
+++ b/include/grpc++/impl/codegen/metadata_map.h
@@ -1,20 +1,20 @@
 /*
-*
-* Copyright 2015 gRPC authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #ifndef GRPCXX_IMPL_CODEGEN_METADATA_MAP_H
 #define GRPCXX_IMPL_CODEGEN_METADATA_MAP_H
@@ -23,6 +23,7 @@
 
 namespace grpc {
 
+namespace internal {
 class MetadataMap {
  public:
   MetadataMap() { memset(&arr_, 0, sizeof(arr_)); }
@@ -40,16 +41,17 @@
     }
   }
 
-  std::multimap<grpc::string_ref, grpc::string_ref> *map() { return &map_; }
-  const std::multimap<grpc::string_ref, grpc::string_ref> *map() const {
+  std::multimap<grpc::string_ref, grpc::string_ref>* map() { return &map_; }
+  const std::multimap<grpc::string_ref, grpc::string_ref>* map() const {
     return &map_;
   }
-  grpc_metadata_array *arr() { return &arr_; }
+  grpc_metadata_array* arr() { return &arr_; }
 
  private:
   grpc_metadata_array arr_;
   std::multimap<grpc::string_ref, grpc::string_ref> map_;
 };
+}  // namespace internal
 
 }  // namespace grpc
 
diff --git a/include/grpc++/impl/codegen/method_handler_impl.h b/include/grpc++/impl/codegen/method_handler_impl.h
index e14cb0e..c0af4ca 100644
--- a/include/grpc++/impl/codegen/method_handler_impl.h
+++ b/include/grpc++/impl/codegen/method_handler_impl.h
@@ -26,6 +26,7 @@
 
 namespace grpc {
 
+namespace internal {
 /// A wrapper class of an application provided rpc method handler.
 template <class ServiceType, class RequestType, class ResponseType>
 class RpcMethodHandler : public MethodHandler {
@@ -266,6 +267,7 @@
   }
 };
 
+}  // namespace internal
 }  // namespace grpc
 
 #endif  // GRPCXX_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
diff --git a/include/grpc++/impl/codegen/proto_utils.h b/include/grpc++/impl/codegen/proto_utils.h
index 67e8f71..0f7e115 100644
--- a/include/grpc++/impl/codegen/proto_utils.h
+++ b/include/grpc++/impl/codegen/proto_utils.h
@@ -39,8 +39,7 @@
 
 const int kGrpcBufferWriterMaxBufferLength = 1024 * 1024;
 
-class GrpcBufferWriter final
-    : public ::grpc::protobuf::io::ZeroCopyOutputStream {
+class GrpcBufferWriter : public ::grpc::protobuf::io::ZeroCopyOutputStream {
  public:
   explicit GrpcBufferWriter(grpc_byte_buffer** bp, int block_size)
       : block_size_(block_size), byte_count_(0), have_backup_(false) {
@@ -88,7 +87,7 @@
 
   grpc::protobuf::int64 ByteCount() const override { return byte_count_; }
 
- private:
+ protected:
   friend class GrpcBufferWriterPeer;
   const int block_size_;
   int64_t byte_count_;
@@ -98,8 +97,7 @@
   grpc_slice slice_;
 };
 
-class GrpcBufferReader final
-    : public ::grpc::protobuf::io::ZeroCopyInputStream {
+class GrpcBufferReader : public ::grpc::protobuf::io::ZeroCopyInputStream {
  public:
   explicit GrpcBufferReader(grpc_byte_buffer* buffer)
       : byte_count_(0), backup_count_(0), status_() {
@@ -160,7 +158,7 @@
     return byte_count_ - backup_count_;
   }
 
- private:
+ protected:
   int64_t byte_count_;
   int64_t backup_count_;
   grpc_byte_buffer_reader reader_;
@@ -168,57 +166,85 @@
   Status status_;
 };
 
+// BufferWriter must be a subclass of io::ZeroCopyOutputStream.
+template <class BufferWriter, class T>
+Status GenericSerialize(const grpc::protobuf::Message& msg,
+                        grpc_byte_buffer** bp, bool* own_buffer) {
+  static_assert(
+      std::is_base_of<protobuf::io::ZeroCopyOutputStream, BufferWriter>::value,
+      "BufferWriter must be a subclass of io::ZeroCopyOutputStream");
+  *own_buffer = true;
+  int byte_size = msg.ByteSize();
+  if (byte_size <= kGrpcBufferWriterMaxBufferLength) {
+    grpc_slice slice = g_core_codegen_interface->grpc_slice_malloc(byte_size);
+    GPR_CODEGEN_ASSERT(
+        GRPC_SLICE_END_PTR(slice) ==
+        msg.SerializeWithCachedSizesToArray(GRPC_SLICE_START_PTR(slice)));
+    *bp = g_core_codegen_interface->grpc_raw_byte_buffer_create(&slice, 1);
+    g_core_codegen_interface->grpc_slice_unref(slice);
+    return g_core_codegen_interface->ok();
+  } else {
+    BufferWriter writer(bp, kGrpcBufferWriterMaxBufferLength);
+    return msg.SerializeToZeroCopyStream(&writer)
+               ? g_core_codegen_interface->ok()
+               : Status(StatusCode::INTERNAL, "Failed to serialize message");
+  }
+}
+
+// BufferReader must be a subclass of io::ZeroCopyInputStream.
+template <class BufferReader, class T>
+Status GenericDeserialize(grpc_byte_buffer* buffer,
+                          grpc::protobuf::Message* msg) {
+  static_assert(
+      std::is_base_of<protobuf::io::ZeroCopyInputStream, BufferReader>::value,
+      "BufferReader must be a subclass of io::ZeroCopyInputStream");
+  if (buffer == nullptr) {
+    return Status(StatusCode::INTERNAL, "No payload");
+  }
+  Status result = g_core_codegen_interface->ok();
+  {
+    BufferReader reader(buffer);
+    if (!reader.status().ok()) {
+      return reader.status();
+    }
+    ::grpc::protobuf::io::CodedInputStream decoder(&reader);
+    decoder.SetTotalBytesLimit(INT_MAX, INT_MAX);
+    if (!msg->ParseFromCodedStream(&decoder)) {
+      result = Status(StatusCode::INTERNAL, msg->InitializationErrorString());
+    }
+    if (!decoder.ConsumedEntireMessage()) {
+      result = Status(StatusCode::INTERNAL, "Did not read entire message");
+    }
+  }
+  g_core_codegen_interface->grpc_byte_buffer_destroy(buffer);
+  return result;
+}
+
 }  // namespace internal
 
+// this is needed so the following class does not conflict with protobuf
+// serializers that utilize internal-only tools.
+#ifdef GRPC_OPEN_SOURCE_PROTO
+// This class provides a protobuf serializer. It translates between protobuf
+// objects and grpc_byte_buffers. More information about SerializationTraits can
+// be found in include/grpc++/impl/codegen/serialization_traits.h.
 template <class T>
 class SerializationTraits<T, typename std::enable_if<std::is_base_of<
                                  grpc::protobuf::Message, T>::value>::type> {
  public:
   static Status Serialize(const grpc::protobuf::Message& msg,
                           grpc_byte_buffer** bp, bool* own_buffer) {
-    *own_buffer = true;
-    int byte_size = msg.ByteSize();
-    if (byte_size <= internal::kGrpcBufferWriterMaxBufferLength) {
-      grpc_slice slice = g_core_codegen_interface->grpc_slice_malloc(byte_size);
-      GPR_CODEGEN_ASSERT(
-          GRPC_SLICE_END_PTR(slice) ==
-          msg.SerializeWithCachedSizesToArray(GRPC_SLICE_START_PTR(slice)));
-      *bp = g_core_codegen_interface->grpc_raw_byte_buffer_create(&slice, 1);
-      g_core_codegen_interface->grpc_slice_unref(slice);
-      return g_core_codegen_interface->ok();
-    } else {
-      internal::GrpcBufferWriter writer(
-          bp, internal::kGrpcBufferWriterMaxBufferLength);
-      return msg.SerializeToZeroCopyStream(&writer)
-                 ? g_core_codegen_interface->ok()
-                 : Status(StatusCode::INTERNAL, "Failed to serialize message");
-    }
+    return internal::GenericSerialize<internal::GrpcBufferWriter, T>(
+        msg, bp, own_buffer);
   }
 
   static Status Deserialize(grpc_byte_buffer* buffer,
                             grpc::protobuf::Message* msg) {
-    if (buffer == nullptr) {
-      return Status(StatusCode::INTERNAL, "No payload");
-    }
-    Status result = g_core_codegen_interface->ok();
-    {
-      internal::GrpcBufferReader reader(buffer);
-      if (!reader.status().ok()) {
-        return reader.status();
-      }
-      ::grpc::protobuf::io::CodedInputStream decoder(&reader);
-      decoder.SetTotalBytesLimit(INT_MAX, INT_MAX);
-      if (!msg->ParseFromCodedStream(&decoder)) {
-        result = Status(StatusCode::INTERNAL, msg->InitializationErrorString());
-      }
-      if (!decoder.ConsumedEntireMessage()) {
-        result = Status(StatusCode::INTERNAL, "Did not read entire message");
-      }
-    }
-    g_core_codegen_interface->grpc_byte_buffer_destroy(buffer);
-    return result;
+    return internal::GenericDeserialize<internal::GrpcBufferReader, T>(buffer,
+                                                                       msg);
   }
 };
+#endif
 
 }  // namespace grpc
 
diff --git a/include/grpc++/impl/codegen/rpc_method.h b/include/grpc++/impl/codegen/rpc_method.h
index ac13ac5..54e5236 100644
--- a/include/grpc++/impl/codegen/rpc_method.h
+++ b/include/grpc++/impl/codegen/rpc_method.h
@@ -24,7 +24,7 @@
 #include <grpc++/impl/codegen/channel_interface.h>
 
 namespace grpc {
-
+namespace internal {
 /// Descriptor of an RPC method
 class RpcMethod {
  public:
@@ -55,6 +55,7 @@
   void* const channel_tag_;
 };
 
+}  // namespace internal
 }  // namespace grpc
 
 #endif  // GRPCXX_IMPL_CODEGEN_RPC_METHOD_H
diff --git a/include/grpc++/impl/codegen/rpc_service_method.h b/include/grpc++/impl/codegen/rpc_service_method.h
index d356012..5ba11e8 100644
--- a/include/grpc++/impl/codegen/rpc_service_method.h
+++ b/include/grpc++/impl/codegen/rpc_service_method.h
@@ -32,8 +32,8 @@
 
 namespace grpc {
 class ServerContext;
-class StreamContextInterface;
 
+namespace internal {
 /// Base class for running an RPC handler.
 class MethodHandler {
  public:
@@ -71,6 +71,7 @@
   void* server_tag_;
   std::unique_ptr<MethodHandler> handler_;
 };
+}  // namespace internal
 
 }  // namespace grpc
 
diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h
index b5e37fd..a2d6967 100644
--- a/include/grpc++/impl/codegen/server_context.h
+++ b/include/grpc++/impl/codegen/server_context.h
@@ -55,7 +55,6 @@
 namespace internal {
 template <class W, class R>
 class ServerReaderWriterBody;
-}
 template <class ServiceType, class RequestType, class ResponseType>
 class RpcMethodHandler;
 template <class ServiceType, class RequestType, class ResponseType>
@@ -65,9 +64,11 @@
 template <class ServiceType, class RequestType, class ResponseType>
 class BidiStreamingHandler;
 class UnknownMethodHandler;
-
+template <class Streamer, bool WriteNeeded>
+class TemplatedBidiStreamingHandler;
 class Call;
-class CallOpBuffer;
+}  // namespace internal
+
 class CompletionQueue;
 class Server;
 class ServerInterface;
@@ -247,14 +248,14 @@
   template <class W, class R>
   friend class ::grpc::internal::ServerReaderWriterBody;
   template <class ServiceType, class RequestType, class ResponseType>
-  friend class RpcMethodHandler;
+  friend class ::grpc::internal::RpcMethodHandler;
   template <class ServiceType, class RequestType, class ResponseType>
-  friend class ClientStreamingHandler;
+  friend class ::grpc::internal::ClientStreamingHandler;
   template <class ServiceType, class RequestType, class ResponseType>
-  friend class ServerStreamingHandler;
+  friend class ::grpc::internal::ServerStreamingHandler;
   template <class Streamer, bool WriteNeeded>
-  friend class TemplatedBidiStreamingHandler;
-  friend class UnknownMethodHandler;
+  friend class ::grpc::internal::TemplatedBidiStreamingHandler;
+  friend class ::grpc::internal::UnknownMethodHandler;
   friend class ::grpc::ClientContext;
 
   /// Prevent copying.
@@ -263,9 +264,9 @@
 
   class CompletionOp;
 
-  void BeginCompletionOp(Call* call);
+  void BeginCompletionOp(internal::Call* call);
   /// Return the tag queued by BeginCompletionOp()
-  CompletionQueueTag* GetCompletionOpTag();
+  internal::CompletionQueueTag* GetCompletionOpTag();
 
   ServerContext(gpr_timespec deadline, grpc_metadata_array* arr);
 
@@ -282,7 +283,7 @@
   CompletionQueue* cq_;
   bool sent_initial_metadata_;
   mutable std::shared_ptr<const AuthContext> auth_context_;
-  MetadataMap client_metadata_;
+  internal::MetadataMap client_metadata_;
   std::multimap<grpc::string, grpc::string> initial_metadata_;
   std::multimap<grpc::string, grpc::string> trailing_metadata_;
 
@@ -290,7 +291,9 @@
   grpc_compression_level compression_level_;
   grpc_compression_algorithm compression_algorithm_;
 
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> pending_ops_;
+  internal::CallOpSet<internal::CallOpSendInitialMetadata,
+                      internal::CallOpSendMessage>
+      pending_ops_;
   bool has_pending_ops_;
 };
 
diff --git a/include/grpc++/impl/codegen/server_interface.h b/include/grpc++/impl/codegen/server_interface.h
index 55937f1..3bcf4c8 100644
--- a/include/grpc++/impl/codegen/server_interface.h
+++ b/include/grpc++/impl/codegen/server_interface.h
@@ -30,20 +30,21 @@
 class AsyncGenericService;
 class Channel;
 class GenericServerContext;
-class RpcService;
-class ServerAsyncStreamingInterface;
 class ServerCompletionQueue;
 class ServerContext;
 class ServerCredentials;
 class Service;
-class ThreadPoolInterface;
 
 extern CoreCodegenInterface* g_core_codegen_interface;
 
 /// Models a gRPC server.
 ///
 /// Servers are configured and started via \a grpc::ServerBuilder.
-class ServerInterface : public CallHook {
+namespace internal {
+class ServerAsyncStreamingInterface;
+}  // namespace internal
+
+class ServerInterface : public internal::CallHook {
  public:
   virtual ~ServerInterface() {}
 
@@ -78,7 +79,7 @@
   virtual void Wait() = 0;
 
  protected:
-  friend class Service;
+  friend class ::grpc::Service;
 
   /// Register a service. This call does not take ownership of the service.
   /// The service must exist for the lifetime of the Server instance.
@@ -116,12 +117,13 @@
 
   virtual grpc_server* server() = 0;
 
-  virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0;
+  virtual void PerformOpsOnCall(internal::CallOpSetInterface* ops,
+                                internal::Call* call) = 0;
 
-  class BaseAsyncRequest : public CompletionQueueTag {
+  class BaseAsyncRequest : public internal::CompletionQueueTag {
    public:
     BaseAsyncRequest(ServerInterface* server, ServerContext* context,
-                     ServerAsyncStreamingInterface* stream,
+                     internal::ServerAsyncStreamingInterface* stream,
                      CompletionQueue* call_cq, void* tag,
                      bool delete_on_finalize);
     virtual ~BaseAsyncRequest();
@@ -131,7 +133,7 @@
    protected:
     ServerInterface* const server_;
     ServerContext* const context_;
-    ServerAsyncStreamingInterface* const stream_;
+    internal::ServerAsyncStreamingInterface* const stream_;
     CompletionQueue* const call_cq_;
     void* const tag_;
     const bool delete_on_finalize_;
@@ -141,7 +143,7 @@
   class RegisteredAsyncRequest : public BaseAsyncRequest {
    public:
     RegisteredAsyncRequest(ServerInterface* server, ServerContext* context,
-                           ServerAsyncStreamingInterface* stream,
+                           internal::ServerAsyncStreamingInterface* stream,
                            CompletionQueue* call_cq, void* tag);
 
     // uses BaseAsyncRequest::FinalizeResult
@@ -155,7 +157,7 @@
    public:
     NoPayloadAsyncRequest(void* registered_method, ServerInterface* server,
                           ServerContext* context,
-                          ServerAsyncStreamingInterface* stream,
+                          internal::ServerAsyncStreamingInterface* stream,
                           CompletionQueue* call_cq,
                           ServerCompletionQueue* notification_cq, void* tag)
         : RegisteredAsyncRequest(server, context, stream, call_cq, tag) {
@@ -170,7 +172,7 @@
    public:
     PayloadAsyncRequest(void* registered_method, ServerInterface* server,
                         ServerContext* context,
-                        ServerAsyncStreamingInterface* stream,
+                        internal::ServerAsyncStreamingInterface* stream,
                         CompletionQueue* call_cq,
                         ServerCompletionQueue* notification_cq, void* tag,
                         Message* request)
@@ -212,7 +214,7 @@
     void* const registered_method_;
     ServerInterface* const server_;
     ServerContext* const context_;
-    ServerAsyncStreamingInterface* const stream_;
+    internal::ServerAsyncStreamingInterface* const stream_;
     CompletionQueue* const call_cq_;
     ServerCompletionQueue* const notification_cq_;
     void* const tag_;
@@ -223,7 +225,7 @@
   class GenericAsyncRequest : public BaseAsyncRequest {
    public:
     GenericAsyncRequest(ServerInterface* server, GenericServerContext* context,
-                        ServerAsyncStreamingInterface* stream,
+                        internal::ServerAsyncStreamingInterface* stream,
                         CompletionQueue* call_cq,
                         ServerCompletionQueue* notification_cq, void* tag,
                         bool delete_on_finalize);
@@ -235,8 +237,9 @@
   };
 
   template <class Message>
-  void RequestAsyncCall(RpcServiceMethod* method, ServerContext* context,
-                        ServerAsyncStreamingInterface* stream,
+  void RequestAsyncCall(internal::RpcServiceMethod* method,
+                        ServerContext* context,
+                        internal::ServerAsyncStreamingInterface* stream,
                         CompletionQueue* call_cq,
                         ServerCompletionQueue* notification_cq, void* tag,
                         Message* message) {
@@ -246,8 +249,9 @@
                                      message);
   }
 
-  void RequestAsyncCall(RpcServiceMethod* method, ServerContext* context,
-                        ServerAsyncStreamingInterface* stream,
+  void RequestAsyncCall(internal::RpcServiceMethod* method,
+                        ServerContext* context,
+                        internal::ServerAsyncStreamingInterface* stream,
                         CompletionQueue* call_cq,
                         ServerCompletionQueue* notification_cq, void* tag) {
     GPR_CODEGEN_ASSERT(method);
@@ -256,7 +260,7 @@
   }
 
   void RequestAsyncGenericCall(GenericServerContext* context,
-                               ServerAsyncStreamingInterface* stream,
+                               internal::ServerAsyncStreamingInterface* stream,
                                CompletionQueue* call_cq,
                                ServerCompletionQueue* notification_cq,
                                void* tag) {
diff --git a/include/grpc++/impl/codegen/service_type.h b/include/grpc++/impl/codegen/service_type.h
index 2dc4ea0..71c3d99 100644
--- a/include/grpc++/impl/codegen/service_type.h
+++ b/include/grpc++/impl/codegen/service_type.h
@@ -28,13 +28,14 @@
 
 namespace grpc {
 
-class Call;
 class CompletionQueue;
 class Server;
 class ServerInterface;
 class ServerCompletionQueue;
 class ServerContext;
 
+namespace internal {
+class Call;
 class ServerAsyncStreamingInterface {
  public:
   virtual ~ServerAsyncStreamingInterface() {}
@@ -48,9 +49,10 @@
   virtual void SendInitialMetadata(void* tag) = 0;
 
  private:
-  friend class ServerInterface;
+  friend class ::grpc::ServerInterface;
   virtual void BindCall(Call* call) = 0;
 };
+}  // namespace internal
 
 /// Desriptor of an RPC service and its various RPC methods
 class Service {
@@ -88,40 +90,38 @@
  protected:
   template <class Message>
   void RequestAsyncUnary(int index, ServerContext* context, Message* request,
-                         ServerAsyncStreamingInterface* stream,
+                         internal::ServerAsyncStreamingInterface* stream,
                          CompletionQueue* call_cq,
                          ServerCompletionQueue* notification_cq, void* tag) {
     server_->RequestAsyncCall(methods_[index].get(), context, stream, call_cq,
                               notification_cq, tag, request);
   }
-  void RequestAsyncClientStreaming(int index, ServerContext* context,
-                                   ServerAsyncStreamingInterface* stream,
-                                   CompletionQueue* call_cq,
-                                   ServerCompletionQueue* notification_cq,
-                                   void* tag) {
+  void RequestAsyncClientStreaming(
+      int index, ServerContext* context,
+      internal::ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
+      ServerCompletionQueue* notification_cq, void* tag) {
     server_->RequestAsyncCall(methods_[index].get(), context, stream, call_cq,
                               notification_cq, tag);
   }
   template <class Message>
-  void RequestAsyncServerStreaming(int index, ServerContext* context,
-                                   Message* request,
-                                   ServerAsyncStreamingInterface* stream,
-                                   CompletionQueue* call_cq,
-                                   ServerCompletionQueue* notification_cq,
-                                   void* tag) {
+  void RequestAsyncServerStreaming(
+      int index, ServerContext* context, Message* request,
+      internal::ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
+      ServerCompletionQueue* notification_cq, void* tag) {
     server_->RequestAsyncCall(methods_[index].get(), context, stream, call_cq,
                               notification_cq, tag, request);
   }
-  void RequestAsyncBidiStreaming(int index, ServerContext* context,
-                                 ServerAsyncStreamingInterface* stream,
-                                 CompletionQueue* call_cq,
-                                 ServerCompletionQueue* notification_cq,
-                                 void* tag) {
+  void RequestAsyncBidiStreaming(
+      int index, ServerContext* context,
+      internal::ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
+      ServerCompletionQueue* notification_cq, void* tag) {
     server_->RequestAsyncCall(methods_[index].get(), context, stream, call_cq,
                               notification_cq, tag);
   }
 
-  void AddMethod(RpcServiceMethod* method) { methods_.emplace_back(method); }
+  void AddMethod(internal::RpcServiceMethod* method) {
+    methods_.emplace_back(method);
+  }
 
   void MarkMethodAsync(int index) {
     GPR_CODEGEN_ASSERT(
@@ -139,7 +139,7 @@
     methods_[index].reset();
   }
 
-  void MarkMethodStreamed(int index, MethodHandler* streamed_method) {
+  void MarkMethodStreamed(int index, internal::MethodHandler* streamed_method) {
     GPR_CODEGEN_ASSERT(methods_[index] && methods_[index]->handler() &&
                        "Cannot mark an async or generic method Streamed");
     methods_[index]->SetHandler(streamed_method);
@@ -148,14 +148,14 @@
     // case of BIDI_STREAMING that has 1 read and 1 write, in that order,
     // and split server-side streaming is BIDI_STREAMING with 1 read and
     // any number of writes, in that order.
-    methods_[index]->SetMethodType(::grpc::RpcMethod::BIDI_STREAMING);
+    methods_[index]->SetMethodType(internal::RpcMethod::BIDI_STREAMING);
   }
 
  private:
   friend class Server;
   friend class ServerInterface;
   ServerInterface* server_;
-  std::vector<std::unique_ptr<RpcServiceMethod>> methods_;
+  std::vector<std::unique_ptr<internal::RpcServiceMethod>> methods_;
 };
 
 }  // namespace grpc
diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h
index c1784f1..a6dd26f 100644
--- a/include/grpc++/impl/codegen/sync_stream.h
+++ b/include/grpc++/impl/codegen/sync_stream.h
@@ -30,6 +30,7 @@
 
 namespace grpc {
 
+namespace internal {
 /// Common interface for all synchronous client side streaming.
 class ClientStreamingInterface {
  public:
@@ -141,10 +142,12 @@
   }
 };
 
+}  // namespace internal
+
 /// Client-side interface for streaming reads of message of type \a R.
 template <class R>
-class ClientReaderInterface : public ClientStreamingInterface,
-                              public ReaderInterface<R> {
+class ClientReaderInterface : public internal::ClientStreamingInterface,
+                              public internal::ReaderInterface<R> {
  public:
   /// Block to wait for initial metadata from server. The received metadata
   /// can only be accessed after this call returns. Should only be called before
@@ -153,35 +156,25 @@
   virtual void WaitForInitialMetadata() = 0;
 };
 
+namespace internal {
+template <class R>
+class ClientReaderFactory {
+ public:
+  template <class W>
+  static ClientReader<R>* Create(ChannelInterface* channel,
+                                 const ::grpc::internal::RpcMethod& method,
+                                 ClientContext* context, const W& request) {
+    return new ClientReader<R>(channel, method, context, request);
+  }
+};
+}  // namespace internal
+
 /// Synchronous (blocking) client-side API for doing server-streaming RPCs,
 /// where the stream of messages coming from the server has messages
 /// of type \a R.
 template <class R>
 class ClientReader final : public ClientReaderInterface<R> {
  public:
-  /// Block to create a stream and write the initial metadata and \a request
-  /// out. Note that \a context will be used to fill in custom initial
-  /// metadata used to send to the server when starting the call.
-  template <class W>
-  ClientReader(ChannelInterface* channel, const RpcMethod& method,
-               ClientContext* context, const W& request)
-      : context_(context),
-        cq_(grpc_completion_queue_attributes{
-            GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
-            GRPC_CQ_DEFAULT_POLLING}),  // Pluckable cq
-        call_(channel->CreateCall(method, context, &cq_)) {
-    CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
-              CallOpClientSendClose>
-        ops;
-    ops.SendInitialMetadata(context->send_initial_metadata_,
-                            context->initial_metadata_flags());
-    // TODO(ctiller): don't assert
-    GPR_CODEGEN_ASSERT(ops.SendMessage(request).ok());
-    ops.ClientSendClose();
-    call_.PerformOps(&ops);
-    cq_.Pluck(&ops);
-  }
-
   /// See the \a ClientStreamingInterface.WaitForInitialMetadata method for
   /// semantics.
   ///
@@ -192,7 +185,8 @@
   void WaitForInitialMetadata() override {
     GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
 
-    CallOpSet<CallOpRecvInitialMetadata> ops;
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+        ops;
     ops.RecvInitialMetadata(context_);
     call_.PerformOps(&ops);
     cq_.Pluck(&ops);  /// status ignored
@@ -209,7 +203,9 @@
   ///   already received (if initial metadata is received, it can be then
   ///   accessed through the \a ClientContext associated with this call).
   bool Read(R* msg) override {
-    CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> ops;
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                                ::grpc::internal::CallOpRecvMessage<R>>
+        ops;
     if (!context_->initial_metadata_received_) {
       ops.RecvInitialMetadata(context_);
     }
@@ -224,7 +220,7 @@
   ///   The \a ClientContext associated with this call is updated with
   ///   possible metadata received from the server.
   Status Finish() override {
-    CallOpSet<CallOpClientRecvStatus> ops;
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientRecvStatus> ops;
     Status status;
     ops.ClientRecvStatus(context_, &status);
     call_.PerformOps(&ops);
@@ -233,15 +229,41 @@
   }
 
  private:
+  friend class internal::ClientReaderFactory<R>;
   ClientContext* context_;
   CompletionQueue cq_;
-  Call call_;
+  ::grpc::internal::Call call_;
+
+  /// Block to create a stream and write the initial metadata and \a request
+  /// out. Note that \a context will be used to fill in custom initial
+  /// metadata used to send to the server when starting the call.
+  template <class W>
+  ClientReader(::grpc::ChannelInterface* channel,
+               const ::grpc::internal::RpcMethod& method,
+               ClientContext* context, const W& request)
+      : context_(context),
+        cq_(grpc_completion_queue_attributes{
+            GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
+            GRPC_CQ_DEFAULT_POLLING}),  // Pluckable cq
+        call_(channel->CreateCall(method, context, &cq_)) {
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                                ::grpc::internal::CallOpSendMessage,
+                                ::grpc::internal::CallOpClientSendClose>
+        ops;
+    ops.SendInitialMetadata(context->send_initial_metadata_,
+                            context->initial_metadata_flags());
+    // TODO(ctiller): don't assert
+    GPR_CODEGEN_ASSERT(ops.SendMessage(request).ok());
+    ops.ClientSendClose();
+    call_.PerformOps(&ops);
+    cq_.Pluck(&ops);
+  }
 };
 
 /// Client-side interface for streaming writes of message type \a W.
 template <class W>
-class ClientWriterInterface : public ClientStreamingInterface,
-                              public WriterInterface<W> {
+class ClientWriterInterface : public internal::ClientStreamingInterface,
+                              public internal::WriterInterface<W> {
  public:
   /// Half close writing from the client. (signal that the stream of messages
   /// coming from the client is complete).
@@ -252,37 +274,25 @@
   virtual bool WritesDone() = 0;
 };
 
+namespace internal {
+template <class W>
+class ClientWriterFactory {
+ public:
+  template <class R>
+  static ClientWriter<W>* Create(::grpc::ChannelInterface* channel,
+                                 const ::grpc::internal::RpcMethod& method,
+                                 ClientContext* context, R* response) {
+    return new ClientWriter<W>(channel, method, context, response);
+  }
+};
+}  // namespace internal
+
 /// Synchronous (blocking) client-side API for doing client-streaming RPCs,
 /// where the outgoing message stream coming from the client has messages of
 /// type \a W.
 template <class W>
 class ClientWriter : public ClientWriterInterface<W> {
  public:
-  /// Block to create a stream (i.e. send request headers and other initial
-  /// metadata to the server). Note that \a context will be used to fill
-  /// in custom initial metadata. \a response will be filled in with the
-  /// single expected response message from the server upon a successful
-  /// call to the \a Finish method of this instance.
-  template <class R>
-  ClientWriter(ChannelInterface* channel, const RpcMethod& method,
-               ClientContext* context, R* response)
-      : context_(context),
-        cq_(grpc_completion_queue_attributes{
-            GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
-            GRPC_CQ_DEFAULT_POLLING}),  // Pluckable cq
-        call_(channel->CreateCall(method, context, &cq_)) {
-    finish_ops_.RecvMessage(response);
-    finish_ops_.AllowNoMessage();
-
-    if (!context_->initial_metadata_corked_) {
-      CallOpSet<CallOpSendInitialMetadata> ops;
-      ops.SendInitialMetadata(context->send_initial_metadata_,
-                              context->initial_metadata_flags());
-      call_.PerformOps(&ops);
-      cq_.Pluck(&ops);
-    }
-  }
-
   /// See the \a ClientStreamingInterface.WaitForInitialMetadata method for
   /// semantics.
   ///
@@ -292,7 +302,8 @@
   void WaitForInitialMetadata() {
     GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
 
-    CallOpSet<CallOpRecvInitialMetadata> ops;
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+        ops;
     ops.RecvInitialMetadata(context_);
     call_.PerformOps(&ops);
     cq_.Pluck(&ops);  // status ignored
@@ -304,10 +315,11 @@
   /// Side effect:
   ///   Also sends initial metadata if not already sent (using the
   ///   \a ClientContext associated with this call).
-  using WriterInterface<W>::Write;
+  using ::grpc::internal::WriterInterface<W>::Write;
   bool Write(const W& msg, WriteOptions options) override {
-    CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
-              CallOpClientSendClose>
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                                ::grpc::internal::CallOpSendMessage,
+                                ::grpc::internal::CallOpClientSendClose>
         ops;
 
     if (options.is_last_message()) {
@@ -328,7 +340,7 @@
   }
 
   bool WritesDone() override {
-    CallOpSet<CallOpClientSendClose> ops;
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientSendClose> ops;
     ops.ClientSendClose();
     call_.PerformOps(&ops);
     return cq_.Pluck(&ops);
@@ -352,21 +364,51 @@
   }
 
  private:
+  friend class internal::ClientWriterFactory<W>;
+
+  /// Block to create a stream (i.e. send request headers and other initial
+  /// metadata to the server). Note that \a context will be used to fill
+  /// in custom initial metadata. \a response will be filled in with the
+  /// single expected response message from the server upon a successful
+  /// call to the \a Finish method of this instance.
+  template <class R>
+  ClientWriter(ChannelInterface* channel,
+               const ::grpc::internal::RpcMethod& method,
+               ClientContext* context, R* response)
+      : context_(context),
+        cq_(grpc_completion_queue_attributes{
+            GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
+            GRPC_CQ_DEFAULT_POLLING}),  // Pluckable cq
+        call_(channel->CreateCall(method, context, &cq_)) {
+    finish_ops_.RecvMessage(response);
+    finish_ops_.AllowNoMessage();
+
+    if (!context_->initial_metadata_corked_) {
+      ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+          ops;
+      ops.SendInitialMetadata(context->send_initial_metadata_,
+                              context->initial_metadata_flags());
+      call_.PerformOps(&ops);
+      cq_.Pluck(&ops);
+    }
+  }
+
   ClientContext* context_;
-  CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
-            CallOpClientRecvStatus>
+  ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                              ::grpc::internal::CallOpGenericRecvMessage,
+                              ::grpc::internal::CallOpClientRecvStatus>
       finish_ops_;
   CompletionQueue cq_;
-  Call call_;
+  ::grpc::internal::Call call_;
 };
 
 /// Client-side interface for bi-directional streaming with
 /// client-to-server stream messages of type \a W and
 /// server-to-client stream messages of type \a R.
 template <class W, class R>
-class ClientReaderWriterInterface : public ClientStreamingInterface,
-                                    public WriterInterface<W>,
-                                    public ReaderInterface<R> {
+class ClientReaderWriterInterface : public internal::ClientStreamingInterface,
+                                    public internal::WriterInterface<W>,
+                                    public internal::ReaderInterface<R> {
  public:
   /// Block to wait for initial metadata from server. The received metadata
   /// can only be accessed after this call returns. Should only be called before
@@ -375,7 +417,7 @@
   virtual void WaitForInitialMetadata() = 0;
 
   /// Half close writing from the client. (signal that the stream of messages
-  /// coming from the client is complete).
+  /// coming from the clinet is complete).
   /// Blocks until currently-pending writes are completed.
   /// Thread-safe with respect to \a ReaderInterface::Read
   ///
@@ -383,6 +425,18 @@
   virtual bool WritesDone() = 0;
 };
 
+namespace internal {
+template <class W, class R>
+class ClientReaderWriterFactory {
+ public:
+  static ClientReaderWriter<W, R>* Create(
+      ::grpc::ChannelInterface* channel,
+      const ::grpc::internal::RpcMethod& method, ClientContext* context) {
+    return new ClientReaderWriter<W, R>(channel, method, context);
+  }
+};
+}  // namespace internal
+
 /// Synchronous (blocking) client-side API for bi-directional streaming RPCs,
 /// where the outgoing message stream coming from the client has messages of
 /// type \a W, and the incoming messages stream coming from the server has
@@ -390,25 +444,6 @@
 template <class W, class R>
 class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
  public:
-  /// Block to create a stream and write the initial metadata and \a request
-  /// out. Note that \a context will be used to fill in custom initial metadata
-  /// used to send to the server when starting the call.
-  ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method,
-                     ClientContext* context)
-      : context_(context),
-        cq_(grpc_completion_queue_attributes{
-            GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
-            GRPC_CQ_DEFAULT_POLLING}),  // Pluckable cq
-        call_(channel->CreateCall(method, context, &cq_)) {
-    if (!context_->initial_metadata_corked_) {
-      CallOpSet<CallOpSendInitialMetadata> ops;
-      ops.SendInitialMetadata(context->send_initial_metadata_,
-                              context->initial_metadata_flags());
-      call_.PerformOps(&ops);
-      cq_.Pluck(&ops);
-    }
-  }
-
   /// Block waiting to read initial metadata from the server.
   /// This call is optional, but if it is used, it cannot be used concurrently
   /// with or after the \a Finish method.
@@ -418,7 +453,8 @@
   void WaitForInitialMetadata() override {
     GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
 
-    CallOpSet<CallOpRecvInitialMetadata> ops;
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+        ops;
     ops.RecvInitialMetadata(context_);
     call_.PerformOps(&ops);
     cq_.Pluck(&ops);  // status ignored
@@ -434,7 +470,9 @@
   ///   Also receives initial metadata if not already received (updates the \a
   ///   ClientContext associated with this call in that case).
   bool Read(R* msg) override {
-    CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> ops;
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                                ::grpc::internal::CallOpRecvMessage<R>>
+        ops;
     if (!context_->initial_metadata_received_) {
       ops.RecvInitialMetadata(context_);
     }
@@ -448,10 +486,11 @@
   /// Side effect:
   ///   Also sends initial metadata if not already sent (using the
   ///   \a ClientContext associated with this call to fill in values).
-  using WriterInterface<W>::Write;
+  using ::grpc::internal::WriterInterface<W>::Write;
   bool Write(const W& msg, WriteOptions options) override {
-    CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
-              CallOpClientSendClose>
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
+                                ::grpc::internal::CallOpSendMessage,
+                                ::grpc::internal::CallOpClientSendClose>
         ops;
 
     if (options.is_last_message()) {
@@ -472,7 +511,7 @@
   }
 
   bool WritesDone() override {
-    CallOpSet<CallOpClientSendClose> ops;
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientSendClose> ops;
     ops.ClientSendClose();
     call_.PerformOps(&ops);
     return cq_.Pluck(&ops);
@@ -484,7 +523,9 @@
   ///   - the \a ClientContext associated with this call is updated with
   ///     possible trailing metadata sent from the server.
   Status Finish() override {
-    CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> ops;
+    ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
+                                ::grpc::internal::CallOpClientRecvStatus>
+        ops;
     if (!context_->initial_metadata_received_) {
       ops.RecvInitialMetadata(context_);
     }
@@ -496,15 +537,38 @@
   }
 
  private:
+  friend class internal::ClientReaderWriterFactory<W, R>;
+
   ClientContext* context_;
   CompletionQueue cq_;
-  Call call_;
+  ::grpc::internal::Call call_;
+
+  /// Block to create a stream and write the initial metadata and \a request
+  /// out. Note that \a context will be used to fill in custom initial metadata
+  /// used to send to the server when starting the call.
+  ClientReaderWriter(::grpc::ChannelInterface* channel,
+                     const ::grpc::internal::RpcMethod& method,
+                     ClientContext* context)
+      : context_(context),
+        cq_(grpc_completion_queue_attributes{
+            GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
+            GRPC_CQ_DEFAULT_POLLING}),  // Pluckable cq
+        call_(channel->CreateCall(method, context, &cq_)) {
+    if (!context_->initial_metadata_corked_) {
+      ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+          ops;
+      ops.SendInitialMetadata(context->send_initial_metadata_,
+                              context->initial_metadata_flags());
+      call_.PerformOps(&ops);
+      cq_.Pluck(&ops);
+    }
+  }
 };
 
 /// Server-side interface for streaming reads of message of type \a R.
 template <class R>
-class ServerReaderInterface : public ServerStreamingInterface,
-                              public ReaderInterface<R> {};
+class ServerReaderInterface : public internal::ServerStreamingInterface,
+                              public internal::ReaderInterface<R> {};
 
 /// Synchronous (blocking) server-side API for doing client-streaming RPCs,
 /// where the incoming message stream coming from the client has messages of
@@ -512,15 +576,13 @@
 template <class R>
 class ServerReader final : public ServerReaderInterface<R> {
  public:
-  ServerReader(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {}
-
   /// See the \a ServerStreamingInterface.SendInitialMetadata method
   /// for semantics. Note that initial metadata will be affected by the
   /// \a ServerContext associated with this call.
   void SendInitialMetadata() override {
     GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
 
-    CallOpSet<CallOpSendInitialMetadata> ops;
+    internal::CallOpSet<internal::CallOpSendInitialMetadata> ops;
     ops.SendInitialMetadata(ctx_->initial_metadata_,
                             ctx_->initial_metadata_flags());
     if (ctx_->compression_level_set()) {
@@ -537,21 +599,27 @@
   }
 
   bool Read(R* msg) override {
-    CallOpSet<CallOpRecvMessage<R>> ops;
+    internal::CallOpSet<internal::CallOpRecvMessage<R>> ops;
     ops.RecvMessage(msg);
     call_->PerformOps(&ops);
     return call_->cq()->Pluck(&ops) && ops.got_message;
   }
 
  private:
-  Call* const call_;
+  internal::Call* const call_;
   ServerContext* const ctx_;
+
+  template <class ServiceType, class RequestType, class ResponseType>
+  friend class internal::ClientStreamingHandler;
+
+  ServerReader(internal::Call* call, ServerContext* ctx)
+      : call_(call), ctx_(ctx) {}
 };
 
 /// Server-side interface for streaming writes of message of type \a W.
 template <class W>
-class ServerWriterInterface : public ServerStreamingInterface,
-                              public WriterInterface<W> {};
+class ServerWriterInterface : public internal::ServerStreamingInterface,
+                              public internal::WriterInterface<W> {};
 
 /// Synchronous (blocking) server-side API for doing for doing a
 /// server-streaming RPCs, where the outgoing message stream coming from the
@@ -559,8 +627,6 @@
 template <class W>
 class ServerWriter final : public ServerWriterInterface<W> {
  public:
-  ServerWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {}
-
   /// See the \a ServerStreamingInterface.SendInitialMetadata method
   /// for semantics.
   /// Note that initial metadata will be affected by the
@@ -568,7 +634,7 @@
   void SendInitialMetadata() override {
     GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
 
-    CallOpSet<CallOpSendInitialMetadata> ops;
+    internal::CallOpSet<internal::CallOpSendInitialMetadata> ops;
     ops.SendInitialMetadata(ctx_->initial_metadata_,
                             ctx_->initial_metadata_flags());
     if (ctx_->compression_level_set()) {
@@ -584,11 +650,12 @@
   /// Side effect:
   ///   Also sends initial metadata if not already sent (using the
   ///   \a ClientContext associated with this call to fill in values).
-  using WriterInterface<W>::Write;
+  using internal::WriterInterface<W>::Write;
   bool Write(const W& msg, WriteOptions options) override {
     if (options.is_last_message()) {
       options.set_buffer_hint();
     }
+
     if (!ctx_->pending_ops_.SendMessage(msg, options).ok()) {
       return false;
     }
@@ -613,15 +680,21 @@
   }
 
  private:
-  Call* const call_;
+  internal::Call* const call_;
   ServerContext* const ctx_;
+
+  template <class ServiceType, class RequestType, class ResponseType>
+  friend class internal::ServerStreamingHandler;
+
+  ServerWriter(internal::Call* call, ServerContext* ctx)
+      : call_(call), ctx_(ctx) {}
 };
 
 /// Server-side interface for bi-directional streaming.
 template <class W, class R>
-class ServerReaderWriterInterface : public ServerStreamingInterface,
-                                    public WriterInterface<W>,
-                                    public ReaderInterface<R> {};
+class ServerReaderWriterInterface : public internal::ServerStreamingInterface,
+                                    public internal::WriterInterface<W>,
+                                    public internal::ReaderInterface<R> {};
 
 /// Actual implementation of bi-directional streaming
 namespace internal {
@@ -688,6 +761,7 @@
   Call* const call_;
   ServerContext* const ctx_;
 };
+
 }  // namespace internal
 
 /// Synchronous (blocking) server-side API for a bidirectional
@@ -697,8 +771,6 @@
 template <class W, class R>
 class ServerReaderWriter final : public ServerReaderWriterInterface<W, R> {
  public:
-  ServerReaderWriter(Call* call, ServerContext* ctx) : body_(call, ctx) {}
-
   /// See the \a ServerStreamingInterface.SendInitialMetadata method
   /// for semantics. Note that initial metadata will be affected by the
   /// \a ServerContext associated with this call.
@@ -715,13 +787,18 @@
   /// Side effect:
   ///   Also sends initial metadata if not already sent (using the \a
   ///   ServerContext associated with this call).
-  using WriterInterface<W>::Write;
+  using internal::WriterInterface<W>::Write;
   bool Write(const W& msg, WriteOptions options) override {
     return body_.Write(msg, options);
   }
 
  private:
   internal::ServerReaderWriterBody<W, R> body_;
+
+  friend class internal::TemplatedBidiStreamingHandler<ServerReaderWriter<W, R>,
+                                                       false>;
+  ServerReaderWriter(internal::Call* call, ServerContext* ctx)
+      : body_(call, ctx) {}
 };
 
 /// A class to represent a flow-controlled unary call. This is something
@@ -736,9 +813,6 @@
 class ServerUnaryStreamer final
     : public ServerReaderWriterInterface<ResponseType, RequestType> {
  public:
-  ServerUnaryStreamer(Call* call, ServerContext* ctx)
-      : body_(call, ctx), read_done_(false), write_done_(false) {}
-
   /// Block to send initial metadata to client.
   /// Implicit input parameter:
   ///    - the \a ServerContext associated with this call will be used for
@@ -775,7 +849,7 @@
   /// \param options The WriteOptions affecting the write operation.
   ///
   /// \return \a true on success, \a false when the stream has been closed.
-  using WriterInterface<ResponseType>::Write;
+  using internal::WriterInterface<ResponseType>::Write;
   bool Write(const ResponseType& response, WriteOptions options) override {
     if (write_done_ || !read_done_) {
       return false;
@@ -788,6 +862,11 @@
   internal::ServerReaderWriterBody<ResponseType, RequestType> body_;
   bool read_done_;
   bool write_done_;
+
+  friend class internal::TemplatedBidiStreamingHandler<
+      ServerUnaryStreamer<RequestType, ResponseType>, true>;
+  ServerUnaryStreamer(internal::Call* call, ServerContext* ctx)
+      : body_(call, ctx), read_done_(false), write_done_(false) {}
 };
 
 /// A class to represent a flow-controlled server-side streaming call.
@@ -799,9 +878,6 @@
 class ServerSplitStreamer final
     : public ServerReaderWriterInterface<ResponseType, RequestType> {
  public:
-  ServerSplitStreamer(Call* call, ServerContext* ctx)
-      : body_(call, ctx), read_done_(false) {}
-
   /// Block to send initial metadata to client.
   /// Implicit input parameter:
   ///    - the \a ServerContext associated with this call will be used for
@@ -838,7 +914,7 @@
   /// \param options The WriteOptions affecting the write operation.
   ///
   /// \return \a true on success, \a false when the stream has been closed.
-  using WriterInterface<ResponseType>::Write;
+  using internal::WriterInterface<ResponseType>::Write;
   bool Write(const ResponseType& response, WriteOptions options) override {
     return read_done_ && body_.Write(response, options);
   }
@@ -846,6 +922,11 @@
  private:
   internal::ServerReaderWriterBody<ResponseType, RequestType> body_;
   bool read_done_;
+
+  friend class internal::TemplatedBidiStreamingHandler<
+      ServerSplitStreamer<RequestType, ResponseType>, false>;
+  ServerSplitStreamer(internal::Call* call, ServerContext* ctx)
+      : body_(call, ctx), read_done_(false) {}
 };
 
 }  // namespace grpc
diff --git a/include/grpc++/impl/codegen/time.h b/include/grpc++/impl/codegen/time.h
index 589deb4..d464d6e 100644
--- a/include/grpc++/impl/codegen/time.h
+++ b/include/grpc++/impl/codegen/time.h
@@ -19,6 +19,8 @@
 #ifndef GRPCXX_IMPL_CODEGEN_TIME_H
 #define GRPCXX_IMPL_CODEGEN_TIME_H
 
+#include <chrono>
+
 #include <grpc++/impl/codegen/config.h>
 #include <grpc/impl/codegen/grpc_types.h>
 
@@ -59,10 +61,6 @@
 
 }  // namespace grpc
 
-#include <chrono>
-
-#include <grpc/impl/codegen/grpc_types.h>
-
 namespace grpc {
 
 // from and to should be absolute time.
diff --git a/include/grpc++/server.h b/include/grpc++/server.h
index 0a3aae8..01c4a60 100644
--- a/include/grpc++/server.h
+++ b/include/grpc++/server.h
@@ -175,7 +175,8 @@
   /// \param num_cqs How many completion queues does \a cqs hold.
   void Start(ServerCompletionQueue** cqs, size_t num_cqs) override;
 
-  void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) override;
+  void PerformOpsOnCall(internal::CallOpSetInterface* ops,
+                        internal::Call* call) override;
 
   void ShutdownInternal(gpr_timespec deadline) override;
 
diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h
index a948abe..bf842ba 100644
--- a/include/grpc++/server_builder.h
+++ b/include/grpc++/server_builder.h
@@ -40,7 +40,6 @@
 class AsyncGenericService;
 class ResourceQuota;
 class CompletionQueue;
-class RpcService;
 class Server;
 class ServerCompletionQueue;
 class ServerCredentials;
@@ -203,7 +202,10 @@
 
   struct SyncServerSettings {
     SyncServerSettings()
-        : num_cqs(1), min_pollers(1), max_pollers(2), cq_timeout_msec(10000) {}
+        : num_cqs(GPR_MAX(1, gpr_cpu_num_cores())),
+          min_pollers(1),
+          max_pollers(2),
+          cq_timeout_msec(10000) {}
 
     /// Number of server completion queues to create to listen to incoming RPCs.
     int num_cqs;
diff --git a/include/grpc/census.h b/include/grpc/census.h
index de8e7a6..2258af8 100644
--- a/include/grpc/census.h
+++ b/include/grpc/census.h
@@ -16,10 +16,6 @@
  *
  */
 
-/** RPC-internal Census API's. These are designed to be generic enough that
- * they can (ultimately) be used in many different RPC systems (with differing
- * implementations). */
-
 #ifndef GRPC_CENSUS_H
 #define GRPC_CENSUS_H
 
@@ -29,439 +25,12 @@
 extern "C" {
 #endif
 
-/** Identify census features that can be enabled via census_initialize(). */
-enum census_features {
-  CENSUS_FEATURE_NONE = 0,    /** Do not enable census. */
-  CENSUS_FEATURE_TRACING = 1, /** Enable census tracing. */
-  CENSUS_FEATURE_STATS = 2,   /** Enable Census stats collection. */
-  CENSUS_FEATURE_CPU = 4,     /** Enable Census CPU usage collection. */
-  CENSUS_FEATURE_ALL =
-      CENSUS_FEATURE_TRACING | CENSUS_FEATURE_STATS | CENSUS_FEATURE_CPU
-};
-
-/** Shutdown and startup census subsystem. The 'features' argument should be
- * the OR (|) of census_features values. If census fails to initialize, then
- * census_initialize() will return -1, otherwise the set of enabled features
- * (which may be smaller than that provided in the `features` argument, see
- * census_supported()) is returned. It is an error to call census_initialize()
- * more than once (without an intervening census_shutdown()). These functions
- * are not thread-safe. */
-CENSUSAPI int census_initialize(int features);
-CENSUSAPI void census_shutdown(void);
-
-/** Return the features supported by the current census implementation (not all
- * features will be available on all platforms). */
-CENSUSAPI int census_supported(void);
-
-/** Return the census features currently enabled. */
-CENSUSAPI int census_enabled(void);
-
 /**
   A Census Context is a handle used by Census to represent the current tracing
   and stats collection information. Contexts should be propagated across RPC's
-  (this is the responsibility of the local RPC system). A context is typically
-  used as the first argument to most census functions. Conceptually, they
-  should be thought of as specific to a single RPC/thread. The user visible
-  context representation is that of a collection of key:value string pairs,
-  each of which is termed a 'tag'; these form the basis against which Census
-  metrics will be recorded. Keys are unique within a context. */
+  (this is the responsibility of the local RPC system). */
 typedef struct census_context census_context;
 
-/** A tag is a key:value pair. Both keys and values are nil-terminated strings,
-   containing printable ASCII characters (decimal 32-126). Keys must be at
-   least one character in length. Both keys and values can have at most
-   CENSUS_MAX_TAG_KB_LEN characters (including the terminating nil). The
-   maximum number of tags that can be propagated is
-   CENSUS_MAX_PROPAGATED_TAGS. Users should also remember that some systems
-   may have limits on, e.g., the number of bytes that can be transmitted as
-   metadata, and that larger tags means more memory consumed and time in
-   processing. */
-typedef struct {
-  const char *key;
-  const char *value;
-  uint8_t flags;
-} census_tag;
-
-/** Maximum length of a tag's key or value. */
-#define CENSUS_MAX_TAG_KV_LEN 255
-/** Maximum number of propagatable tags. */
-#define CENSUS_MAX_PROPAGATED_TAGS 255
-
-/** Tag flags. */
-#define CENSUS_TAG_PROPAGATE 1 /** Tag should be propagated over RPC */
-#define CENSUS_TAG_STATS 2    /** Tag will be used for statistics aggregation */
-#define CENSUS_TAG_RESERVED 4 /** Reserved for internal use. */
-/** Flag values 4,8,16,32,64,128 are reserved for future/internal use. Clients
-   should not use or rely on their values. */
-
-#define CENSUS_TAG_IS_PROPAGATED(flags) (flags & CENSUS_TAG_PROPAGATE)
-#define CENSUS_TAG_IS_STATS(flags) (flags & CENSUS_TAG_STATS)
-
-/** An instance of this structure is kept by every context, and records the
-   basic information associated with the creation of that context. */
-typedef struct {
-  int n_propagated_tags; /** number of propagated tags */
-  int n_local_tags;      /** number of non-propagated (local) tags */
-  int n_deleted_tags;    /** number of tags that were deleted */
-  int n_added_tags;      /** number of tags that were added */
-  int n_modified_tags;   /** number of tags that were modified */
-  int n_invalid_tags;    /** number of tags with bad keys or values (e.g.
-                            longer than CENSUS_MAX_TAG_KV_LEN) */
-  int n_ignored_tags;    /** number of tags ignored because of
-                            CENSUS_MAX_PROPAGATED_TAGS limit. */
-} census_context_status;
-
-/** Create a new context, adding and removing tags from an existing context.
-   This will copy all tags from the 'tags' input, so it is recommended
-   to add as many tags in a single operation as is practical for the client.
-   @param base Base context to build upon. Can be NULL.
-   @param tags A set of tags to be added/changed/deleted. Tags with keys that
-   are in 'tags', but not 'base', are added to the context. Keys that are in
-   both 'tags' and 'base' will have their value/flags modified. Tags with keys
-   in both, but with NULL values, will be deleted from the context. Tags with
-   invalid (too long or short) keys or values will be ignored.
-   If adding a tag will result in more than CENSUS_MAX_PROPAGATED_TAGS in either
-   binary or non-binary tags, they will be ignored, as will deletions of
-   tags that don't exist.
-   @param ntags number of tags in 'tags'
-   @param status If not NULL, will return a pointer to a census_context_status
-   structure containing information about the new context and status of the
-   tags used in its creation.
-   @return A new, valid census_context.
-*/
-CENSUSAPI census_context *census_context_create(
-    const census_context *base, const census_tag *tags, int ntags,
-    census_context_status const **status);
-
-/** Destroy a context. Once this function has been called, the context cannot
-   be reused. */
-CENSUSAPI void census_context_destroy(census_context *context);
-
-/** Get a pointer to the original status from the context creation. */
-CENSUSAPI const census_context_status *census_context_get_status(
-    const census_context *context);
-
-/** Structure used for iterating over the tags in a context. API clients should
-   not use or reference internal fields - neither their contents or
-   presence/absence are guaranteed. */
-typedef struct {
-  const census_context *context;
-  int base;
-  int index;
-  char *kvm;
-} census_context_iterator;
-
-/** Initialize a census_tag_iterator. Must be called before first use. */
-CENSUSAPI void census_context_initialize_iterator(
-    const census_context *context, census_context_iterator *iterator);
-
-/** Get the contents of the "next" tag in the context. If there are no more
-   tags, returns 0 (and 'tag' contents will be unchanged), otherwise returns 1.
-   */
-CENSUSAPI int census_context_next_tag(census_context_iterator *iterator,
-                                      census_tag *tag);
-
-/** Get a context tag by key. Returns 0 if the key is not present. */
-CENSUSAPI int census_context_get_tag(const census_context *context,
-                                     const char *key, census_tag *tag);
-
-/** Tag set encode/decode functionality. These functions are intended
-   for use by RPC systems only, for purposes of transmitting/receiving contexts.
-   */
-
-/** Encode a context into a buffer.
-   @param context context to be encoded
-   @param buffer buffer into which the context will be encoded.
-   @param buf_size number of available bytes in buffer.
-   @return The number of buffer bytes consumed for the encoded context, or
-           zero if the buffer was of insufficient size. */
-CENSUSAPI size_t census_context_encode(const census_context *context,
-                                       char *buffer, size_t buf_size);
-
-/** Decode context buffer encoded with census_context_encode(). Returns NULL
-   if there is an error in parsing either buffer. */
-CENSUSAPI census_context *census_context_decode(const char *buffer,
-                                                size_t size);
-
-/** Distributed traces can have a number of options. */
-enum census_trace_mask_values {
-  CENSUS_TRACE_MASK_NONE = 0,      /** Default, empty flags */
-  CENSUS_TRACE_MASK_IS_SAMPLED = 1 /** RPC tracing enabled for this context. */
-};
-
-/** Get the current trace mask associated with this context. The value returned
-    will be the logical OR of census_trace_mask_values values. */
-CENSUSAPI int census_trace_mask(const census_context *context);
-
-/** Set the trace mask associated with a context. */
-CENSUSAPI void census_set_trace_mask(int trace_mask);
-
-/** The concept of "operation" is a fundamental concept for Census. In an RPC
-   system, an operation typically represents a single RPC, or a significant
-   sub-part thereof (e.g. a single logical "read" RPC to a distributed storage
-   system might do several other actions in parallel, from looking up metadata
-   indices to making requests of other services - each of these could be a
-   sub-operation with the larger RPC operation). Census uses operations for the
-   following:
-
-   CPU accounting: If enabled, census will measure the thread CPU time
-   consumed between operation start and end times.
-
-   Active operations: Census will maintain information on all currently
-   active operations.
-
-   Distributed tracing: Each operation serves as a logical trace span.
-
-   Stats collection: Stats are broken down by operation (e.g. latency
-   breakdown for each unique RPC path).
-
-   The following functions serve to delineate the start and stop points for
-   each logical operation. */
-
-/**
-  This structure represents a timestamp as used by census to record the time
-  at which an operation begins.
-*/
-typedef struct {
-  /** Use gpr_timespec for default implementation. High performance
-   * implementations should use a cycle-counter based timestamp. */
-  gpr_timespec ts;
-} census_timestamp;
-
-/**
-  Mark the beginning of an RPC operation. The information required to call the
-  functions to record the start of RPC operations (both client and server) may
-  not be callable at the true start time of the operation, due to information
-  not being available (e.g. the census context data will not be available in a
-  server RPC until at least initial metadata has been processed). To ensure
-  correct CPU accounting and latency recording, RPC systems can call this
-  function to get the timestamp of operation beginning. This can later be used
-  as an argument to census_start_{client,server}_rpc_op(). NB: for correct
-  CPU accounting, the system must guarantee that the same thread is used
-  for all request processing after this function is called.
-
-  @return A timestamp representing the operation start time.
-*/
-CENSUSAPI census_timestamp census_start_rpc_op_timestamp(void);
-
-/**
-  Represent functions to map RPC name ID to service/method names. Census
-  breaks down all RPC stats by service and method names. We leave the
-  definition and format of these to the RPC system. For efficiency purposes,
-  we encode these as a single 64 bit identifier, and allow the RPC system to
-  provide a structure for functions that can convert these to service and
-  method strings.
-
-  TODO(aveitch): Instead of providing this as an argument to the rpc_start_op()
-  functions, maybe it should be set once at census initialization.
-*/
-typedef struct {
-  const char *(*get_rpc_service_name)(int64_t id);
-  const char *(*get_rpc_method_name)(int64_t id);
-} census_rpc_name_info;
-
-/**
-   Start a client rpc operation. This function should be called as early in the
-   client RPC path as possible. This function will create a new context. If
-   the context argument is non-null, then the new context will inherit all
-   its properties, with the following changes:
-   - create a new operation ID for the new context, marking it as a child of
-     the previous operation.
-   - use the new RPC path and peer information for tracing and stats
-     collection purposes, rather than those from the original context
-
-   If the context argument is NULL, then a new root context is created. This
-   is particularly important for tracing purposes (the trace spans generated
-   will be unassociated with any other trace spans, except those
-   downstream). The trace_mask will be used for tracing operations associated
-   with the new context.
-
-   In some RPC systems (e.g. where load balancing is used), peer information
-   may not be available at the time the operation starts. In this case, use a
-   NULL value for peer, and set it later using the
-   census_set_rpc_client_peer() function.
-
-   @param context The parent context. Can be NULL.
-   @param rpc_name_id The rpc name identifier to be associated with this RPC.
-   @param rpc_name_info Used to decode rpc_name_id.
-   @param peer RPC peer. If not available at the time, NULL can be used,
-               and a later census_set_rpc_client_peer() call made.
-   @param trace_mask An OR of census_trace_mask_values values. Only used in
-                     the creation of a new root context (context == NULL).
-   @param start_time A timestamp returned from census_start_rpc_op_timestamp().
-                     Can be NULL. Used to set the true time the operation
-                     begins.
-
-   @return A new census context.
- */
-CENSUSAPI census_context *census_start_client_rpc_op(
-    const census_context *context, int64_t rpc_name_id,
-    const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask,
-    const census_timestamp *start_time);
-
-/**
-  Add peer information to a context representing a client RPC operation.
-*/
-CENSUSAPI void census_set_rpc_client_peer(census_context *context,
-                                          const char *peer);
-
-/**
-   Start a server RPC operation. Returns a new context to be used in future
-   census calls. If buffer is non-NULL, then the buffer contents should
-   represent the client context, as generated by census_context_serialize().
-   If buffer is NULL, a new root context is created.
-
-   @param buffer Buffer containing bytes output from census_context_serialize().
-   @param rpc_name_id The rpc name identifier to be associated with this RPC.
-   @param rpc_name_info Used to decode rpc_name_id.
-   @param peer RPC peer.
-   @param trace_mask An OR of census_trace_mask_values values. Only used in
-                     the creation of a new root context (buffer == NULL).
-   @param start_time A timestamp returned from census_start_rpc_op_timestamp().
-                     Can be NULL. Used to set the true time the operation
-                     begins.
-
-   @return A new census context.
- */
-CENSUSAPI census_context *census_start_server_rpc_op(
-    const char *buffer, int64_t rpc_name_id,
-    const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask,
-    census_timestamp *start_time);
-
-/**
-   Start a new, non-RPC operation. In general, this function works very
-   similarly to census_start_client_rpc_op, with the primary difference being
-   the replacement of host/path information with the more generic family/name
-   tags. If the context argument is non-null, then the new context will
-   inherit all its properties, with the following changes:
-   - create a new operation ID for the new context, marking it as a child of
-     the previous operation.
-   - use the family and name information for tracing and stats collection
-     purposes, rather than those from the original context
-
-   If the context argument is NULL, then a new root context is created. This
-   is particularly important for tracing purposes (the trace spans generated
-   will be unassociated with any other trace spans, except those
-   downstream). The trace_mask will be used for tracing
-   operations associated with the new context.
-
-   @param context The base context. Can be NULL.
-   @param family Family name to associate with the trace
-   @param name Name within family to associate with traces/stats
-   @param trace_mask An OR of census_trace_mask_values values. Only used if
-                     context is NULL.
-
-   @return A new census context.
- */
-CENSUSAPI census_context *census_start_op(census_context *context,
-                                          const char *family, const char *name,
-                                          int trace_mask);
-
-/**
-  End an operation started by any of the census_start_*_op*() calls. The
-  context used in this call will no longer be valid once this function
-  completes.
-
-  @param context Context associated with operation which is ending.
-  @param status status associated with the operation. Not interpreted by
-                census.
-*/
-CENSUSAPI void census_end_op(census_context *context, int status);
-
-#define CENSUS_TRACE_RECORD_START_OP ((uint32_t)0)
-#define CENSUS_TRACE_RECORD_END_OP ((uint32_t)1)
-
-/** Insert a trace record into the trace stream. The record consists of an
-    arbitrary size buffer, the size of which is provided in 'n'.
-    @param context Trace context
-    @param type User-defined type to associate with trace entry.
-    @param buffer Pointer to buffer to use
-    @param n Number of bytes in buffer
-*/
-CENSUSAPI void census_trace_print(census_context *context, uint32_t type,
-                                  const char *buffer, size_t n);
-
-/** Trace record. */
-typedef struct {
-  census_timestamp timestamp; /** Time of record creation */
-  uint64_t trace_id;          /** Trace ID associated with record */
-  uint64_t op_id;             /** Operation ID associated with record */
-  uint32_t type;              /** Type (as used in census_trace_print() */
-  const char *buffer;         /** Buffer (from census_trace_print() */
-  size_t buf_size;            /** Number of bytes inside buffer */
-} census_trace_record;
-
-/** Start a scan of existing trace records. While a scan is ongoing, addition
-    of new trace records will be blocked if the underlying trace buffers
-    fill up, so trace processing systems should endeavor to complete
-    reading as soon as possible.
-  @param consume if non-zero, indicates that reading records also "consumes"
-         the previously read record - i.e. releases space in the trace log
-         while scanning is ongoing.
-  @returns 0 on success, non-zero on failure (e.g. if a scan is already ongoing)
-*/
-CENSUSAPI int census_trace_scan_start(int consume);
-
-/** Get a trace record. The data pointed to by the trace buffer is guaranteed
-    stable until the next census_get_trace_record() call (if the consume
-    argument to census_trace_scan_start was non-zero) or census_trace_scan_end()
-    is called (otherwise).
-  @param trace_record structure that will be filled in with oldest trace record.
-  @returns -1 if an error occurred (e.g. no previous call to
-           census_trace_scan_start()), 0 if there is no more trace data (and
-           trace_record will not be modified) or 1 otherwise.
-*/
-CENSUSAPI int census_get_trace_record(census_trace_record *trace_record);
-
-/** End a scan previously started by census_trace_scan_start() */
-CENSUSAPI void census_trace_scan_end();
-
-/** Core stats collection API's. The following concepts are used:
-   * Resource: Users record measurements for a single resource. Examples
-     include RPC latency, CPU seconds consumed, and bytes transmitted.
-   * Aggregation: An aggregation of a set of measurements. Census supports the
-       following aggregation types:
-       * Distribution - statistical distribution information, used for
-         recording average, standard deviation etc. Can include a histogram.
-       * Interval - a count of events that happen in a rolling time window.
-   * View: A view is a combination of a Resource, a set of tag keys and an
-     Aggregation. When a measurement for a Resource matches the View tags, it is
-     recorded (for each unique set of tag values) using the Aggregation type.
-     Each resource can have an arbitrary number of views by which it will be
-     broken down.
-
-  Census uses protos to define each of the above, and output results. This
-  ensures unification across the different language and runtime
-  implementations. The proto definitions can be found in src/proto/census.
-*/
-
-/** Define a new resource. `resource_pb` should contain an encoded Resource
-   protobuf, `resource_pb_size` being the size of the buffer. Returns a -ve
-   value on error, or a positive (>= 0) resource id (for use in
-   census_delete_resource() and census_record_values()). In order to be valid, a
-   resource must have a name, and at least one numerator in its unit type. The
-   resource name must be unique, and an error will be returned if it is not. */
-CENSUSAPI int32_t census_define_resource(const uint8_t *resource_pb,
-                                         size_t resource_pb_size);
-
-/** Delete a resource created by census_define_resource(). */
-CENSUSAPI void census_delete_resource(int32_t resource_id);
-
-/** Determine the id of a resource, given its name. returns -1 if the resource
-   does not exist. */
-CENSUSAPI int32_t census_resource_id(const char *name);
-
-/** A single value to be recorded comprises two parts: an ID for the particular
- * resource and the value to be recorded against it. */
-typedef struct {
-  int32_t resource_id;
-  double value;
-} census_value;
-
-/** Record new usage values against the given context. */
-CENSUSAPI void census_record_values(census_context *context,
-                                    census_value *values, size_t nvalues);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/grpc/compression.h b/include/grpc/compression.h
index 13a8dd6..b42f428 100644
--- a/include/grpc/compression.h
+++ b/include/grpc/compression.h
@@ -33,24 +33,24 @@
 /** Parses the \a slice as a grpc_compression_algorithm instance and updating \a
  * algorithm. Returns 1 upon success, 0 otherwise. */
 GRPCAPI int grpc_compression_algorithm_parse(
-    grpc_slice value, grpc_compression_algorithm *algorithm);
+    grpc_slice value, grpc_compression_algorithm* algorithm);
 
 /** Parses the \a slice as a grpc_stream_compression_algorithm instance and
  * updating \a algorithm. Returns 1 upon success, 0 otherwise. */
 int grpc_stream_compression_algorithm_parse(
-    grpc_slice name, grpc_stream_compression_algorithm *algorithm);
+    grpc_slice name, grpc_stream_compression_algorithm* algorithm);
 
 /** Updates \a name with the encoding name corresponding to a valid \a
  * algorithm. Note that \a name is statically allocated and must *not* be freed.
  * Returns 1 upon success, 0 otherwise. */
 GRPCAPI int grpc_compression_algorithm_name(
-    grpc_compression_algorithm algorithm, const char **name);
+    grpc_compression_algorithm algorithm, const char** name);
 
 /** Updates \a name with the encoding name corresponding to a valid \a
  * algorithm. Note that \a name is statically allocated and must *not* be freed.
  * Returns 1 upon success, 0 otherwise. */
 GRPCAPI int grpc_stream_compression_algorithm_name(
-    grpc_stream_compression_algorithm algorithm, const char **name);
+    grpc_stream_compression_algorithm algorithm, const char** name);
 
 /** Returns the compression algorithm corresponding to \a level for the
  * compression algorithms encoded in the \a accepted_encodings bitset.
@@ -66,23 +66,23 @@
 grpc_stream_compression_algorithm_for_level(grpc_stream_compression_level level,
                                             uint32_t accepted_stream_encodings);
 
-GRPCAPI void grpc_compression_options_init(grpc_compression_options *opts);
+GRPCAPI void grpc_compression_options_init(grpc_compression_options* opts);
 
 /** Mark \a algorithm as enabled in \a opts. */
 GRPCAPI void grpc_compression_options_enable_algorithm(
-    grpc_compression_options *opts, grpc_compression_algorithm algorithm);
+    grpc_compression_options* opts, grpc_compression_algorithm algorithm);
 
 /** Mark \a algorithm as disabled in \a opts. */
 GRPCAPI void grpc_compression_options_disable_algorithm(
-    grpc_compression_options *opts, grpc_compression_algorithm algorithm);
+    grpc_compression_options* opts, grpc_compression_algorithm algorithm);
 
 /** Returns true if \a algorithm is marked as enabled in \a opts. */
 GRPCAPI int grpc_compression_options_is_algorithm_enabled(
-    const grpc_compression_options *opts, grpc_compression_algorithm algorithm);
+    const grpc_compression_options* opts, grpc_compression_algorithm algorithm);
 
 /** Returns true if \a algorithm is marked as enabled in \a opts. */
 GRPCAPI int grpc_compression_options_is_stream_compression_algorithm_enabled(
-    const grpc_compression_options *opts,
+    const grpc_compression_options* opts,
     grpc_stream_compression_algorithm algorithm);
 
 #ifdef __cplusplus
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index bc8d95f..72e971d 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -40,11 +40,11 @@
  * functionality lives in grpc_security.h.
  */
 
-GRPCAPI void grpc_metadata_array_init(grpc_metadata_array *array);
-GRPCAPI void grpc_metadata_array_destroy(grpc_metadata_array *array);
+GRPCAPI void grpc_metadata_array_init(grpc_metadata_array* array);
+GRPCAPI void grpc_metadata_array_destroy(grpc_metadata_array* array);
 
-GRPCAPI void grpc_call_details_init(grpc_call_details *details);
-GRPCAPI void grpc_call_details_destroy(grpc_call_details *details);
+GRPCAPI void grpc_call_details_init(grpc_call_details* details);
+GRPCAPI void grpc_call_details_destroy(grpc_call_details* details);
 
 /** Registers a plugin to be initialized and destroyed with the library.
 
@@ -73,31 +73,31 @@
 GRPCAPI void grpc_shutdown(void);
 
 /** Return a string representing the current version of grpc */
-GRPCAPI const char *grpc_version_string(void);
+GRPCAPI const char* grpc_version_string(void);
 
 /** Return a string specifying what the 'g' in gRPC stands for */
-GRPCAPI const char *grpc_g_stands_for(void);
+GRPCAPI const char* grpc_g_stands_for(void);
 
 /** Returns the completion queue factory based on the attributes. MAY return a
     NULL if no factory can be found */
-GRPCAPI const grpc_completion_queue_factory *
+GRPCAPI const grpc_completion_queue_factory*
 grpc_completion_queue_factory_lookup(
-    const grpc_completion_queue_attributes *attributes);
+    const grpc_completion_queue_attributes* attributes);
 
 /** Helper function to create a completion queue with grpc_cq_completion_type
     of GRPC_CQ_NEXT and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING */
-GRPCAPI grpc_completion_queue *grpc_completion_queue_create_for_next(
-    void *reserved);
+GRPCAPI grpc_completion_queue* grpc_completion_queue_create_for_next(
+    void* reserved);
 
 /** Helper function to create a completion queue with grpc_cq_completion_type
     of GRPC_CQ_PLUCK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING */
-GRPCAPI grpc_completion_queue *grpc_completion_queue_create_for_pluck(
-    void *reserved);
+GRPCAPI grpc_completion_queue* grpc_completion_queue_create_for_pluck(
+    void* reserved);
 
 /** Create a completion queue */
-GRPCAPI grpc_completion_queue *grpc_completion_queue_create(
-    const grpc_completion_queue_factory *factory,
-    const grpc_completion_queue_attributes *attributes, void *reserved);
+GRPCAPI grpc_completion_queue* grpc_completion_queue_create(
+    const grpc_completion_queue_factory* factory,
+    const grpc_completion_queue_attributes* attributes, void* reserved);
 
 /** Blocks until an event is available, the completion queue is being shut down,
     or deadline is reached.
@@ -107,9 +107,9 @@
 
     Callers must not call grpc_completion_queue_next and
     grpc_completion_queue_pluck simultaneously on the same completion queue. */
-GRPCAPI grpc_event grpc_completion_queue_next(grpc_completion_queue *cq,
+GRPCAPI grpc_event grpc_completion_queue_next(grpc_completion_queue* cq,
                                               gpr_timespec deadline,
-                                              void *reserved);
+                                              void* reserved);
 
 /** Blocks until an event with tag 'tag' is available, the completion queue is
     being shutdown or deadline is reached.
@@ -122,9 +122,9 @@
 
     Completion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS
     concurrently executing plucks at any time. */
-GRPCAPI grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq,
-                                               void *tag, gpr_timespec deadline,
-                                               void *reserved);
+GRPCAPI grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq,
+                                               void* tag, gpr_timespec deadline,
+                                               void* reserved);
 
 /** Maximum number of outstanding grpc_completion_queue_pluck executions per
     completion queue */
@@ -137,14 +137,31 @@
 
     After calling this function applications should ensure that no
     NEW work is added to be published on this completion queue. */
-GRPCAPI void grpc_completion_queue_shutdown(grpc_completion_queue *cq);
+GRPCAPI void grpc_completion_queue_shutdown(grpc_completion_queue* cq);
 
 /** Destroy a completion queue. The caller must ensure that the queue is
     drained and no threads are executing grpc_completion_queue_next */
-GRPCAPI void grpc_completion_queue_destroy(grpc_completion_queue *cq);
+GRPCAPI void grpc_completion_queue_destroy(grpc_completion_queue* cq);
+
+/*********** EXPERIMENTAL API ************/
+/** Initializes a thread local cache for \a cq.
+ * grpc_flush_cq_tls_cache() MUST be called on the same thread,
+ * with the same cq.
+ */
+GRPCAPI void grpc_completion_queue_thread_local_cache_init(
+    grpc_completion_queue* cq);
+
+/*********** EXPERIMENTAL API ************/
+/** Flushes the thread local cache for \a cq.
+ * Returns 1 if there was contents in the cache.  If there was an event
+ * in \a cq tls cache, its tag is placed in tag, and ok is set to the
+ * event success.
+ */
+GRPCAPI int grpc_completion_queue_thread_local_cache_flush(
+    grpc_completion_queue* cq, void** tag, int* ok);
 
 /** Create a completion queue alarm instance */
-GRPCAPI grpc_alarm *grpc_alarm_create(void *reserved);
+GRPCAPI grpc_alarm* grpc_alarm_create(void* reserved);
 
 /** Set a completion queue alarm instance associated to \a cq.
  *
@@ -152,25 +169,25 @@
  * grpc_alarm_cancel), an event with tag \a tag will be added to \a cq. If the
  * alarm expired, the event's success bit will be true, false otherwise (ie,
  * upon cancellation). */
-GRPCAPI void grpc_alarm_set(grpc_alarm *alarm, grpc_completion_queue *cq,
-                            gpr_timespec deadline, void *tag, void *reserved);
+GRPCAPI void grpc_alarm_set(grpc_alarm* alarm, grpc_completion_queue* cq,
+                            gpr_timespec deadline, void* tag, void* reserved);
 
 /** Cancel a completion queue alarm. Calling this function over an alarm that
  * has already fired has no effect. */
-GRPCAPI void grpc_alarm_cancel(grpc_alarm *alarm, void *reserved);
+GRPCAPI void grpc_alarm_cancel(grpc_alarm* alarm, void* reserved);
 
 /** Destroy the given completion queue alarm, cancelling it in the process. */
-GRPCAPI void grpc_alarm_destroy(grpc_alarm *alarm, void *reserved);
+GRPCAPI void grpc_alarm_destroy(grpc_alarm* alarm, void* reserved);
 
 /** Check the connectivity state of a channel. */
 GRPCAPI grpc_connectivity_state grpc_channel_check_connectivity_state(
-    grpc_channel *channel, int try_to_connect);
+    grpc_channel* channel, int try_to_connect);
 
 /** Number of active "external connectivity state watchers" attached to a
  * channel.
  * Useful for testing. **/
 GRPCAPI int grpc_channel_num_external_connectivity_watchers(
-    grpc_channel *channel);
+    grpc_channel* channel);
 
 /** Watch for a change in connectivity state.
     Once the channel connectivity state is different from last_observed_state,
@@ -178,11 +195,11 @@
     If deadline expires BEFORE the state is changed, tag will be enqueued on cq
     with success=0. */
 GRPCAPI void grpc_channel_watch_connectivity_state(
-    grpc_channel *channel, grpc_connectivity_state last_observed_state,
-    gpr_timespec deadline, grpc_completion_queue *cq, void *tag);
+    grpc_channel* channel, grpc_connectivity_state last_observed_state,
+    gpr_timespec deadline, grpc_completion_queue* cq, void* tag);
 
 /** Check whether a grpc channel supports connectivity watcher */
-GRPCAPI int grpc_channel_support_connectivity_watcher(grpc_channel *channel);
+GRPCAPI int grpc_channel_support_connectivity_watcher(grpc_channel* channel);
 
 /** Create a call given a grpc_channel, in order to call 'method'. All
     completions are sent to 'completion_queue'. 'method' and 'host' need only
@@ -191,31 +208,31 @@
     to propagate properties from the server call to this new client call,
     depending on the value of \a propagation_mask (see propagation_bits.h for
     possible values). */
-GRPCAPI grpc_call *grpc_channel_create_call(
-    grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
-    grpc_completion_queue *completion_queue, grpc_slice method,
-    const grpc_slice *host, gpr_timespec deadline, void *reserved);
+GRPCAPI grpc_call* grpc_channel_create_call(
+    grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
+    grpc_completion_queue* completion_queue, grpc_slice method,
+    const grpc_slice* host, gpr_timespec deadline, void* reserved);
 
 /** Ping the channels peer (load balanced channels will select one sub-channel
     to ping); if the channel is not connected, posts a failed. */
-GRPCAPI void grpc_channel_ping(grpc_channel *channel, grpc_completion_queue *cq,
-                               void *tag, void *reserved);
+GRPCAPI void grpc_channel_ping(grpc_channel* channel, grpc_completion_queue* cq,
+                               void* tag, void* reserved);
 
 /** Pre-register a method/host pair on a channel. */
-GRPCAPI void *grpc_channel_register_call(grpc_channel *channel,
-                                         const char *method, const char *host,
-                                         void *reserved);
+GRPCAPI void* grpc_channel_register_call(grpc_channel* channel,
+                                         const char* method, const char* host,
+                                         void* reserved);
 
 /** Create a call given a handle returned from grpc_channel_register_call.
     \sa grpc_channel_create_call. */
-GRPCAPI grpc_call *grpc_channel_create_registered_call(
-    grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
-    grpc_completion_queue *completion_queue, void *registered_call_handle,
-    gpr_timespec deadline, void *reserved);
+GRPCAPI grpc_call* grpc_channel_create_registered_call(
+    grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
+    grpc_completion_queue* completion_queue, void* registered_call_handle,
+    gpr_timespec deadline, void* reserved);
 
 /** Allocate memory in the grpc_call arena: this memory is automatically
     discarded at call completion */
-GRPCAPI void *grpc_call_arena_alloc(grpc_call *call, size_t size);
+GRPCAPI void* grpc_call_arena_alloc(grpc_call* call, size_t size);
 
 /** Start a batch of operations defined in the array ops; when complete, post a
     completion of type 'tag' to the completion queue bound to the call.
@@ -234,9 +251,9 @@
     needs to be synchronized. As an optimization, you may synchronize batches
     containing just send operations independently from batches containing just
     receive operations. */
-GRPCAPI grpc_call_error grpc_call_start_batch(grpc_call *call,
-                                              const grpc_op *ops, size_t nops,
-                                              void *tag, void *reserved);
+GRPCAPI grpc_call_error grpc_call_start_batch(grpc_call* call,
+                                              const grpc_op* ops, size_t nops,
+                                              void* tag, void* reserved);
 
 /** Returns a newly allocated string representing the endpoint to which this
     call is communicating with. The string is in the uri format accepted by
@@ -246,43 +263,43 @@
     WARNING: this value is never authenticated or subject to any security
     related code. It must not be used for any authentication related
     functionality. Instead, use grpc_auth_context. */
-GRPCAPI char *grpc_call_get_peer(grpc_call *call);
+GRPCAPI char* grpc_call_get_peer(grpc_call* call);
 
 struct census_context;
 
 /** Set census context for a call; Must be called before first call to
    grpc_call_start_batch(). */
-GRPCAPI void grpc_census_call_set_context(grpc_call *call,
-                                          struct census_context *context);
+GRPCAPI void grpc_census_call_set_context(grpc_call* call,
+                                          struct census_context* context);
 
 /** Retrieve the calls current census context. */
-GRPCAPI struct census_context *grpc_census_call_get_context(grpc_call *call);
+GRPCAPI struct census_context* grpc_census_call_get_context(grpc_call* call);
 
 /** Return a newly allocated string representing the target a channel was
     created for. */
-GRPCAPI char *grpc_channel_get_target(grpc_channel *channel);
+GRPCAPI char* grpc_channel_get_target(grpc_channel* channel);
 
 /** Request info about the channel.
     \a channel_info indicates what information is being requested and
     how that information will be returned.
     \a channel_info is owned by the caller. */
-GRPCAPI void grpc_channel_get_info(grpc_channel *channel,
-                                   const grpc_channel_info *channel_info);
+GRPCAPI void grpc_channel_get_info(grpc_channel* channel,
+                                   const grpc_channel_info* channel_info);
 
 /** Create a client channel to 'target'. Additional channel level configuration
     MAY be provided by grpc_channel_args, though the expectation is that most
     clients will want to simply pass NULL. See grpc_channel_args definition for
     more on this. The data in 'args' need only live through the invocation of
     this function. */
-GRPCAPI grpc_channel *grpc_insecure_channel_create(
-    const char *target, const grpc_channel_args *args, void *reserved);
+GRPCAPI grpc_channel* grpc_insecure_channel_create(
+    const char* target, const grpc_channel_args* args, void* reserved);
 
 /** Create a lame client: this client fails every operation attempted on it. */
-GRPCAPI grpc_channel *grpc_lame_client_channel_create(
-    const char *target, grpc_status_code error_code, const char *error_message);
+GRPCAPI grpc_channel* grpc_lame_client_channel_create(
+    const char* target, grpc_status_code error_code, const char* error_message);
 
 /** Close and destroy a grpc channel */
-GRPCAPI void grpc_channel_destroy(grpc_channel *channel);
+GRPCAPI void grpc_channel_destroy(grpc_channel* channel);
 
 /** Error handling for grpc_call
    Most grpc_call functions return a grpc_error. If the error is not GRPC_OK
@@ -295,7 +312,7 @@
     THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status
     are thread-safe, and can be called at any point before grpc_call_unref
     is called.*/
-GRPCAPI grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved);
+GRPCAPI grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved);
 
 /** Called by clients to cancel an RPC on the server.
     Can be called multiple times, from any thread.
@@ -307,18 +324,18 @@
     It doesn't need to be alive after the call to
     grpc_call_cancel_with_status completes.
     */
-GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call *call,
+GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call* call,
                                                      grpc_status_code status,
-                                                     const char *description,
-                                                     void *reserved);
+                                                     const char* description,
+                                                     void* reserved);
 
 /** Ref a call.
     THREAD SAFETY: grpc_call_ref is thread-compatible */
-GRPCAPI void grpc_call_ref(grpc_call *call);
+GRPCAPI void grpc_call_ref(grpc_call* call);
 
 /** Unref a call.
     THREAD SAFETY: grpc_call_unref is thread-compatible */
-GRPCAPI void grpc_call_unref(grpc_call *call);
+GRPCAPI void grpc_call_unref(grpc_call* call);
 
 /** Request notification of a new call.
     Once a call is received, a notification tagged with \a tag_new is added to
@@ -329,10 +346,10 @@
     Note that \a cq_for_notification must have been registered to the server via
     \a grpc_server_register_completion_queue. */
 GRPCAPI grpc_call_error grpc_server_request_call(
-    grpc_server *server, grpc_call **call, grpc_call_details *details,
-    grpc_metadata_array *request_metadata,
-    grpc_completion_queue *cq_bound_to_call,
-    grpc_completion_queue *cq_for_notification, void *tag_new);
+    grpc_server* server, grpc_call** call, grpc_call_details* details,
+    grpc_metadata_array* request_metadata,
+    grpc_completion_queue* cq_bound_to_call,
+    grpc_completion_queue* cq_for_notification, void* tag_new);
 
 /** How to handle payloads for a registered method */
 typedef enum {
@@ -349,8 +366,8 @@
     registered_method (as returned by this function).
     Must be called before grpc_server_start.
     Returns NULL on failure. */
-GRPCAPI void *grpc_server_register_method(
-    grpc_server *server, const char *method, const char *host,
+GRPCAPI void* grpc_server_register_method(
+    grpc_server* server, const char* method, const char* host,
     grpc_server_register_method_payload_handling payload_handling,
     uint32_t flags);
 
@@ -358,35 +375,35 @@
     must have been registered to the server via
     grpc_server_register_completion_queue. */
 GRPCAPI grpc_call_error grpc_server_request_registered_call(
-    grpc_server *server, void *registered_method, grpc_call **call,
-    gpr_timespec *deadline, grpc_metadata_array *request_metadata,
-    grpc_byte_buffer **optional_payload,
-    grpc_completion_queue *cq_bound_to_call,
-    grpc_completion_queue *cq_for_notification, void *tag_new);
+    grpc_server* server, void* registered_method, grpc_call** call,
+    gpr_timespec* deadline, grpc_metadata_array* request_metadata,
+    grpc_byte_buffer** optional_payload,
+    grpc_completion_queue* cq_bound_to_call,
+    grpc_completion_queue* cq_for_notification, void* tag_new);
 
 /** Create a server. Additional configuration for each incoming channel can
     be specified with args. If no additional configuration is needed, args can
     be NULL. See grpc_channel_args for more. The data in 'args' need only live
     through the invocation of this function. */
-GRPCAPI grpc_server *grpc_server_create(const grpc_channel_args *args,
-                                        void *reserved);
+GRPCAPI grpc_server* grpc_server_create(const grpc_channel_args* args,
+                                        void* reserved);
 
 /** Register a completion queue with the server. Must be done for any
     notification completion queue that is passed to grpc_server_request_*_call
     and to grpc_server_shutdown_and_notify. Must be performed prior to
     grpc_server_start. */
-GRPCAPI void grpc_server_register_completion_queue(grpc_server *server,
-                                                   grpc_completion_queue *cq,
-                                                   void *reserved);
+GRPCAPI void grpc_server_register_completion_queue(grpc_server* server,
+                                                   grpc_completion_queue* cq,
+                                                   void* reserved);
 
 /** Add a HTTP2 over plaintext over tcp listener.
     Returns bound port number on success, 0 on failure.
     REQUIRES: server not started */
-GRPCAPI int grpc_server_add_insecure_http2_port(grpc_server *server,
-                                                const char *addr);
+GRPCAPI int grpc_server_add_insecure_http2_port(grpc_server* server,
+                                                const char* addr);
 
 /** Start a server - tells all listeners to start listening */
-GRPCAPI void grpc_server_start(grpc_server *server);
+GRPCAPI void grpc_server_start(grpc_server* server);
 
 /** Begin shutting down a server.
     After completion, no new calls or connections will be admitted.
@@ -395,19 +412,19 @@
     Shutdown is idempotent, and all tags will be notified at once if multiple
     grpc_server_shutdown_and_notify calls are made. 'cq' must have been
     registered to this server via grpc_server_register_completion_queue. */
-GRPCAPI void grpc_server_shutdown_and_notify(grpc_server *server,
-                                             grpc_completion_queue *cq,
-                                             void *tag);
+GRPCAPI void grpc_server_shutdown_and_notify(grpc_server* server,
+                                             grpc_completion_queue* cq,
+                                             void* tag);
 
 /** Cancel all in-progress calls.
     Only usable after shutdown. */
-GRPCAPI void grpc_server_cancel_all_calls(grpc_server *server);
+GRPCAPI void grpc_server_cancel_all_calls(grpc_server* server);
 
 /** Destroy a server.
     Shutdown must have completed beforehand (i.e. all tags generated by
     grpc_server_shutdown_and_notify must have been received, and at least
     one call to grpc_server_shutdown_and_notify must have been made). */
-GRPCAPI void grpc_server_destroy(grpc_server *server);
+GRPCAPI void grpc_server_destroy(grpc_server* server);
 
 /** Enable or disable a tracer.
 
@@ -417,7 +434,7 @@
 
     Use of this function is not strictly thread-safe, but the
     thread-safety issues raised by it should not be of concern. */
-GRPCAPI int grpc_tracer_set_enabled(const char *name, int enabled);
+GRPCAPI int grpc_tracer_set_enabled(const char* name, int enabled);
 
 /** Check whether a metadata key is legal (will be accepted by core) */
 GRPCAPI int grpc_header_key_is_legal(grpc_slice slice);
@@ -430,24 +447,24 @@
 GRPCAPI int grpc_is_binary_header(grpc_slice slice);
 
 /** Convert grpc_call_error values to a string */
-GRPCAPI const char *grpc_call_error_to_string(grpc_call_error error);
+GRPCAPI const char* grpc_call_error_to_string(grpc_call_error error);
 
 /** Create a buffer pool */
-GRPCAPI grpc_resource_quota *grpc_resource_quota_create(const char *trace_name);
+GRPCAPI grpc_resource_quota* grpc_resource_quota_create(const char* trace_name);
 
 /** Add a reference to a buffer pool */
-GRPCAPI void grpc_resource_quota_ref(grpc_resource_quota *resource_quota);
+GRPCAPI void grpc_resource_quota_ref(grpc_resource_quota* resource_quota);
 
 /** Drop a reference to a buffer pool */
-GRPCAPI void grpc_resource_quota_unref(grpc_resource_quota *resource_quota);
+GRPCAPI void grpc_resource_quota_unref(grpc_resource_quota* resource_quota);
 
 /** Update the size of a buffer pool */
-GRPCAPI void grpc_resource_quota_resize(grpc_resource_quota *resource_quota,
+GRPCAPI void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
                                         size_t new_size);
 
 /** Fetch a vtable for a grpc_channel_arg that points to a grpc_resource_quota
  */
-GRPCAPI const grpc_arg_pointer_vtable *grpc_resource_quota_arg_vtable(void);
+GRPCAPI const grpc_arg_pointer_vtable* grpc_resource_quota_arg_vtable(void);
 
 #ifdef __cplusplus
 }
diff --git a/include/grpc/grpc_cronet.h b/include/grpc/grpc_cronet.h
index 44330c6..127d5d0 100644
--- a/include/grpc/grpc_cronet.h
+++ b/include/grpc/grpc_cronet.h
@@ -25,9 +25,9 @@
 extern "C" {
 #endif
 
-GRPCAPI grpc_channel *grpc_cronet_secure_channel_create(
-    void *engine, const char *target, const grpc_channel_args *args,
-    void *reserved);
+GRPCAPI grpc_channel* grpc_cronet_secure_channel_create(
+    void* engine, const char* target, const grpc_channel_args* args,
+    void* reserved);
 
 #ifdef __cplusplus
 }
diff --git a/include/grpc/grpc_posix.h b/include/grpc/grpc_posix.h
index c7429ea..fa7ebce 100644
--- a/include/grpc/grpc_posix.h
+++ b/include/grpc/grpc_posix.h
@@ -37,8 +37,8 @@
 /** Create a client channel to 'target' using file descriptor 'fd'. The 'target'
     argument will be used to indicate the name for this channel. See the comment
     for grpc_insecure_channel_create for description of 'args' argument. */
-GRPCAPI grpc_channel *grpc_insecure_channel_create_from_fd(
-    const char *target, int fd, const grpc_channel_args *args);
+GRPCAPI grpc_channel* grpc_insecure_channel_create_from_fd(
+    const char* target, int fd, const grpc_channel_args* args);
 
 /** Add the connected communication channel based on file descriptor 'fd' to the
     'server'. The 'fd' must be an open file descriptor corresponding to a
@@ -48,8 +48,8 @@
 
     The 'reserved' pointer MUST be NULL.
     */
-GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
-                                                      void *reserved, int fd);
+GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
+                                                      void* reserved, int fd);
 
 /** GRPC Core POSIX library may internally use signals to optimize some work.
    The library uses (SIGRTMIN + 6) signal by default. Use this API to instruct
diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h
index 95b1447..7e87217 100644
--- a/include/grpc/grpc_security.h
+++ b/include/grpc/grpc_security.h
@@ -32,51 +32,51 @@
 typedef struct grpc_auth_context grpc_auth_context;
 
 typedef struct grpc_auth_property_iterator {
-  const grpc_auth_context *ctx;
+  const grpc_auth_context* ctx;
   size_t index;
-  const char *name;
+  const char* name;
 } grpc_auth_property_iterator;
 
 /** value, if not NULL, is guaranteed to be NULL terminated. */
 typedef struct grpc_auth_property {
-  char *name;
-  char *value;
+  char* name;
+  char* value;
   size_t value_length;
 } grpc_auth_property;
 
 /** Returns NULL when the iterator is at the end. */
-GRPCAPI const grpc_auth_property *grpc_auth_property_iterator_next(
-    grpc_auth_property_iterator *it);
+GRPCAPI const grpc_auth_property* grpc_auth_property_iterator_next(
+    grpc_auth_property_iterator* it);
 
 /** Iterates over the auth context. */
 GRPCAPI grpc_auth_property_iterator
-grpc_auth_context_property_iterator(const grpc_auth_context *ctx);
+grpc_auth_context_property_iterator(const grpc_auth_context* ctx);
 
 /** Gets the peer identity. Returns an empty iterator (first _next will return
    NULL) if the peer is not authenticated. */
 GRPCAPI grpc_auth_property_iterator
-grpc_auth_context_peer_identity(const grpc_auth_context *ctx);
+grpc_auth_context_peer_identity(const grpc_auth_context* ctx);
 
 /** Finds a property in the context. May return an empty iterator (first _next
    will return NULL) if no property with this name was found in the context. */
 GRPCAPI grpc_auth_property_iterator grpc_auth_context_find_properties_by_name(
-    const grpc_auth_context *ctx, const char *name);
+    const grpc_auth_context* ctx, const char* name);
 
 /** Gets the name of the property that indicates the peer identity. Will return
    NULL if the peer is not authenticated. */
-GRPCAPI const char *grpc_auth_context_peer_identity_property_name(
-    const grpc_auth_context *ctx);
+GRPCAPI const char* grpc_auth_context_peer_identity_property_name(
+    const grpc_auth_context* ctx);
 
 /** Returns 1 if the peer is authenticated, 0 otherwise. */
 GRPCAPI int grpc_auth_context_peer_is_authenticated(
-    const grpc_auth_context *ctx);
+    const grpc_auth_context* ctx);
 
 /** Gets the auth context from the call. Caller needs to call
    grpc_auth_context_release on the returned context. */
-GRPCAPI grpc_auth_context *grpc_call_auth_context(grpc_call *call);
+GRPCAPI grpc_auth_context* grpc_call_auth_context(grpc_call* call);
 
 /** Releases the auth context returned from grpc_call_auth_context. */
-GRPCAPI void grpc_auth_context_release(grpc_auth_context *context);
+GRPCAPI void grpc_auth_context_release(grpc_auth_context* context);
 
 /** --
    The following auth context methods should only be called by a server metadata
@@ -84,19 +84,19 @@
    -- */
 
 /** Add a property. */
-GRPCAPI void grpc_auth_context_add_property(grpc_auth_context *ctx,
-                                            const char *name, const char *value,
+GRPCAPI void grpc_auth_context_add_property(grpc_auth_context* ctx,
+                                            const char* name, const char* value,
                                             size_t value_length);
 
 /** Add a C string property. */
-GRPCAPI void grpc_auth_context_add_cstring_property(grpc_auth_context *ctx,
-                                                    const char *name,
-                                                    const char *value);
+GRPCAPI void grpc_auth_context_add_cstring_property(grpc_auth_context* ctx,
+                                                    const char* name,
+                                                    const char* value);
 
 /** Sets the property name. Returns 1 if successful or 0 in case of failure
    (which means that no property with this name exists). */
 GRPCAPI int grpc_auth_context_set_peer_identity_property_name(
-    grpc_auth_context *ctx, const char *name);
+    grpc_auth_context* ctx, const char* name);
 
 /** --- grpc_channel_credentials object. ---
 
@@ -107,12 +107,12 @@
 
 /** Releases a channel credentials object.
    The creator of the credentials object is responsible for its release. */
-GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials *creds);
+GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials* creds);
 
 /** Creates default credentials to connect to a google gRPC service.
    WARNING: Do NOT use this credentials to connect to a non-google service as
    this could result in an oauth2 token leak. */
-GRPCAPI grpc_channel_credentials *grpc_google_default_credentials_create(void);
+GRPCAPI grpc_channel_credentials* grpc_google_default_credentials_create(void);
 
 /** Callback for getting the SSL roots override from the application.
    In case of success, *pem_roots_certs must be set to a NULL terminated string
@@ -121,7 +121,7 @@
    If this function fails and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is
    set to a valid path, it will override the roots specified this func */
 typedef grpc_ssl_roots_override_result (*grpc_ssl_roots_override_callback)(
-    char **pem_root_certs);
+    char** pem_root_certs);
 
 /** Setup a callback to override the default TLS/SSL roots.
    This function is not thread-safe and must be called at initialization time
@@ -135,11 +135,11 @@
 typedef struct {
   /** private_key is the NULL-terminated string containing the PEM encoding of
      the client's private key. */
-  const char *private_key;
+  const char* private_key;
 
   /** cert_chain is the NULL-terminated string containing the PEM encoding of
      the client's certificate chain. */
-  const char *cert_chain;
+  const char* cert_chain;
 } grpc_ssl_pem_key_cert_pair;
 
 /** Creates an SSL credentials object.
@@ -153,9 +153,9 @@
    - pem_key_cert_pair is a pointer on the object containing client's private
      key and certificate chain. This parameter can be NULL if the client does
      not have such a key/cert pair. */
-GRPCAPI grpc_channel_credentials *grpc_ssl_credentials_create(
-    const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,
-    void *reserved);
+GRPCAPI grpc_channel_credentials* grpc_ssl_credentials_create(
+    const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
+    void* reserved);
 
 /** --- grpc_call_credentials object.
 
@@ -167,23 +167,23 @@
 
 /** Releases a call credentials object.
    The creator of the credentials object is responsible for its release. */
-GRPCAPI void grpc_call_credentials_release(grpc_call_credentials *creds);
+GRPCAPI void grpc_call_credentials_release(grpc_call_credentials* creds);
 
 /** Creates a composite channel credentials object. */
-GRPCAPI grpc_channel_credentials *grpc_composite_channel_credentials_create(
-    grpc_channel_credentials *channel_creds, grpc_call_credentials *call_creds,
-    void *reserved);
+GRPCAPI grpc_channel_credentials* grpc_composite_channel_credentials_create(
+    grpc_channel_credentials* channel_creds, grpc_call_credentials* call_creds,
+    void* reserved);
 
 /** Creates a composite call credentials object. */
-GRPCAPI grpc_call_credentials *grpc_composite_call_credentials_create(
-    grpc_call_credentials *creds1, grpc_call_credentials *creds2,
-    void *reserved);
+GRPCAPI grpc_call_credentials* grpc_composite_call_credentials_create(
+    grpc_call_credentials* creds1, grpc_call_credentials* creds2,
+    void* reserved);
 
 /** Creates a compute engine credentials object for connecting to Google.
    WARNING: Do NOT use this credentials to connect to a non-google service as
    this could result in an oauth2 token leak. */
-GRPCAPI grpc_call_credentials *grpc_google_compute_engine_credentials_create(
-    void *reserved);
+GRPCAPI grpc_call_credentials* grpc_google_compute_engine_credentials_create(
+    void* reserved);
 
 GRPCAPI gpr_timespec grpc_max_auth_token_lifetime();
 
@@ -192,10 +192,10 @@
    - token_lifetime is the lifetime of each Json Web Token (JWT) created with
      this credentials.  It should not exceed grpc_max_auth_token_lifetime or
      will be cropped to this value.  */
-GRPCAPI grpc_call_credentials *
-grpc_service_account_jwt_access_credentials_create(const char *json_key,
+GRPCAPI grpc_call_credentials*
+grpc_service_account_jwt_access_credentials_create(const char* json_key,
                                                    gpr_timespec token_lifetime,
-                                                   void *reserved);
+                                                   void* reserved);
 
 /** Creates an Oauth2 Refresh Token credentials object for connecting to Google.
    May return NULL if the input is invalid.
@@ -203,18 +203,18 @@
    this could result in an oauth2 token leak.
    - json_refresh_token is the JSON string containing the refresh token itself
      along with a client_id and client_secret. */
-GRPCAPI grpc_call_credentials *grpc_google_refresh_token_credentials_create(
-    const char *json_refresh_token, void *reserved);
+GRPCAPI grpc_call_credentials* grpc_google_refresh_token_credentials_create(
+    const char* json_refresh_token, void* reserved);
 
 /** Creates an Oauth2 Access Token credentials with an access token that was
    aquired by an out of band mechanism. */
-GRPCAPI grpc_call_credentials *grpc_access_token_credentials_create(
-    const char *access_token, void *reserved);
+GRPCAPI grpc_call_credentials* grpc_access_token_credentials_create(
+    const char* access_token, void* reserved);
 
 /** Creates an IAM credentials object for connecting to Google. */
-GRPCAPI grpc_call_credentials *grpc_google_iam_credentials_create(
-    const char *authorization_token, const char *authority_selector,
-    void *reserved);
+GRPCAPI grpc_call_credentials* grpc_google_iam_credentials_create(
+    const char* authorization_token, const char* authority_selector,
+    void* reserved);
 
 /** Callback function to be called by the metadata credentials plugin
    implementation when the metadata is ready.
@@ -228,25 +228,25 @@
    - error_details contains details about the error if any. In case of success
      it should be NULL and will be otherwise ignored. */
 typedef void (*grpc_credentials_plugin_metadata_cb)(
-    void *user_data, const grpc_metadata *creds_md, size_t num_creds_md,
-    grpc_status_code status, const char *error_details);
+    void* user_data, const grpc_metadata* creds_md, size_t num_creds_md,
+    grpc_status_code status, const char* error_details);
 
 /** Context that can be used by metadata credentials plugin in order to create
    auth related metadata. */
 typedef struct {
   /** The fully qualifed service url. */
-  const char *service_url;
+  const char* service_url;
 
   /** The method name of the RPC being called (not fully qualified).
      The fully qualified method name can be built from the service_url:
      full_qualified_method_name = ctx->service_url + '/' + ctx->method_name. */
-  const char *method_name;
+  const char* method_name;
 
   /** The auth_context of the channel which gives the server's identity. */
-  const grpc_auth_context *channel_auth_context;
+  const grpc_auth_context* channel_auth_context;
 
   /** Reserved for future use. */
-  void *reserved;
+  void* reserved;
 } grpc_auth_metadata_context;
 
 /** Maximum number of metadata entries returnable by a credentials plugin via
@@ -278,32 +278,32 @@
      \a context is the information that can be used by the plugin to create
      auth metadata. */
   int (*get_metadata)(
-      void *state, grpc_auth_metadata_context context,
-      grpc_credentials_plugin_metadata_cb cb, void *user_data,
+      void* state, grpc_auth_metadata_context context,
+      grpc_credentials_plugin_metadata_cb cb, void* user_data,
       grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
-      size_t *num_creds_md, grpc_status_code *status,
-      const char **error_details);
+      size_t* num_creds_md, grpc_status_code* status,
+      const char** error_details);
 
   /** Destroys the plugin state. */
-  void (*destroy)(void *state);
+  void (*destroy)(void* state);
 
   /** State that will be set as the first parameter of the methods above. */
-  void *state;
+  void* state;
 
   /** Type of credentials that this plugin is implementing. */
-  const char *type;
+  const char* type;
 } grpc_metadata_credentials_plugin;
 
 /** Creates a credentials object from a plugin. */
-GRPCAPI grpc_call_credentials *grpc_metadata_credentials_create_from_plugin(
-    grpc_metadata_credentials_plugin plugin, void *reserved);
+GRPCAPI grpc_call_credentials* grpc_metadata_credentials_create_from_plugin(
+    grpc_metadata_credentials_plugin plugin, void* reserved);
 
 /** --- Secure channel creation. --- */
 
 /** Creates a secure channel using the passed-in credentials. */
-GRPCAPI grpc_channel *grpc_secure_channel_create(
-    grpc_channel_credentials *creds, const char *target,
-    const grpc_channel_args *args, void *reserved);
+GRPCAPI grpc_channel* grpc_secure_channel_create(
+    grpc_channel_credentials* creds, const char* target,
+    const grpc_channel_args* args, void* reserved);
 
 /** --- grpc_server_credentials object. ---
 
@@ -314,7 +314,44 @@
 /** Releases a server_credentials object.
    The creator of the server_credentials object is responsible for its release.
    */
-GRPCAPI void grpc_server_credentials_release(grpc_server_credentials *creds);
+GRPCAPI void grpc_server_credentials_release(grpc_server_credentials* creds);
+
+/** Server certificate config object holds the server's public certificates and
+   associated private keys, as well as any CA certificates needed for client
+   certificate validation (if applicable). Create using
+   grpc_ssl_server_certificate_config_create(). */
+typedef struct grpc_ssl_server_certificate_config
+    grpc_ssl_server_certificate_config;
+
+/** Creates a grpc_ssl_server_certificate_config object.
+   - pem_roots_cert is the NULL-terminated string containing the PEM encoding of
+     the client root certificates. This parameter may be NULL if the server does
+     not want the client to be authenticated with SSL.
+   - pem_key_cert_pairs is an array private key / certificate chains of the
+     server. This parameter cannot be NULL.
+   - num_key_cert_pairs indicates the number of items in the private_key_files
+     and cert_chain_files parameters. It must be at least 1.
+   - It is the caller's responsibility to free this object via
+     grpc_ssl_server_certificate_config_destroy(). */
+GRPCAPI grpc_ssl_server_certificate_config*
+grpc_ssl_server_certificate_config_create(
+    const char* pem_root_certs,
+    const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs);
+
+/** Destroys a grpc_ssl_server_certificate_config object. */
+GRPCAPI void grpc_ssl_server_certificate_config_destroy(
+    grpc_ssl_server_certificate_config* config);
+
+/** Callback to retrieve updated SSL server certificates, private keys, and
+   trusted CAs (for client authentication).
+    - user_data parameter, if not NULL, contains opaque data to be used by the
+      callback.
+    - Use grpc_ssl_server_certificate_config_create to create the config.
+    - The caller assumes ownership of the config. */
+typedef grpc_ssl_certificate_config_reload_status (
+    *grpc_ssl_server_certificate_config_callback)(
+    void* user_data, grpc_ssl_server_certificate_config** config);
 
 /** Deprecated in favor of grpc_ssl_server_credentials_create_ex.
    Creates an SSL server_credentials object.
@@ -328,34 +365,69 @@
    - force_client_auth, if set to non-zero will force the client to authenticate
      with an SSL cert. Note that this option is ignored if pem_root_certs is
      NULL. */
-GRPCAPI grpc_server_credentials *grpc_ssl_server_credentials_create(
-    const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs,
-    size_t num_key_cert_pairs, int force_client_auth, void *reserved);
+GRPCAPI grpc_server_credentials* grpc_ssl_server_credentials_create(
+    const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs, int force_client_auth, void* reserved);
 
-/** Same as grpc_ssl_server_credentials_create method except uses
+/** Deprecated in favor of grpc_ssl_server_credentials_create_with_options.
+   Same as grpc_ssl_server_credentials_create method except uses
    grpc_ssl_client_certificate_request_type enum to support more ways to
    authenticate client cerificates.*/
-GRPCAPI grpc_server_credentials *grpc_ssl_server_credentials_create_ex(
-    const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs,
+GRPCAPI grpc_server_credentials* grpc_ssl_server_credentials_create_ex(
+    const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
     size_t num_key_cert_pairs,
     grpc_ssl_client_certificate_request_type client_certificate_request,
-    void *reserved);
+    void* reserved);
+
+typedef struct grpc_ssl_server_credentials_options
+    grpc_ssl_server_credentials_options;
+
+/** Creates an options object using a certificate config. Use this method when
+   the certificates and keys of the SSL server will not change during the
+   server's lifetime.
+   - Takes ownership of the certificate_config parameter. */
+GRPCAPI grpc_ssl_server_credentials_options*
+grpc_ssl_server_credentials_create_options_using_config(
+    grpc_ssl_client_certificate_request_type client_certificate_request,
+    grpc_ssl_server_certificate_config* certificate_config);
+
+/** Creates an options object using a certificate config fetcher. Use this
+   method to reload the certificates and keys of the SSL server without
+   interrupting the operation of the server. Initial certificate config will be
+   fetched during server initialization.
+   - user_data parameter, if not NULL, contains opaque data which will be passed
+     to the fetcher (see definition of
+     grpc_ssl_server_certificate_config_callback). */
+GRPCAPI grpc_ssl_server_credentials_options*
+grpc_ssl_server_credentials_create_options_using_config_fetcher(
+    grpc_ssl_client_certificate_request_type client_certificate_request,
+    grpc_ssl_server_certificate_config_callback cb, void* user_data);
+
+/** Destroys a grpc_ssl_server_credentials_options object. */
+GRPCAPI void grpc_ssl_server_credentials_options_destroy(
+    grpc_ssl_server_credentials_options* options);
+
+/** Creates an SSL server_credentials object using the provided options struct.
+    - Takes ownership of the options parameter. */
+GRPCAPI grpc_server_credentials*
+grpc_ssl_server_credentials_create_with_options(
+    grpc_ssl_server_credentials_options* options);
 
 /** --- Server-side secure ports. --- */
 
 /** Add a HTTP2 over an encrypted link over tcp listener.
    Returns bound port number on success, 0 on failure.
    REQUIRES: server not started */
-GRPCAPI int grpc_server_add_secure_http2_port(grpc_server *server,
-                                              const char *addr,
-                                              grpc_server_credentials *creds);
+GRPCAPI int grpc_server_add_secure_http2_port(grpc_server* server,
+                                              const char* addr,
+                                              grpc_server_credentials* creds);
 
 /** --- Call specific credentials. --- */
 
 /** Sets a credentials to a call. Can only be called on the client side before
    grpc_call_start_batch. */
-GRPCAPI grpc_call_error grpc_call_set_credentials(grpc_call *call,
-                                                  grpc_call_credentials *creds);
+GRPCAPI grpc_call_error grpc_call_set_credentials(grpc_call* call,
+                                                  grpc_call_credentials* creds);
 
 /** --- Auth Metadata Processing --- */
 
@@ -369,9 +441,9 @@
      GRPC_STATUS PERMISSION_DENIED in case of an authorization failure.
    - error_details gives details about the error. May be NULL. */
 typedef void (*grpc_process_auth_metadata_done_cb)(
-    void *user_data, const grpc_metadata *consumed_md, size_t num_consumed_md,
-    const grpc_metadata *response_md, size_t num_response_md,
-    grpc_status_code status, const char *error_details);
+    void* user_data, const grpc_metadata* consumed_md, size_t num_consumed_md,
+    const grpc_metadata* response_md, size_t num_response_md,
+    grpc_status_code status, const char* error_details);
 
 /** Pluggable server-side metadata processor object. */
 typedef struct {
@@ -379,15 +451,15 @@
      channel peer and it is the job of the process function to augment it with
      properties derived from the passed-in metadata.
      The lifetime of these objects is guaranteed until cb is invoked. */
-  void (*process)(void *state, grpc_auth_context *context,
-                  const grpc_metadata *md, size_t num_md,
-                  grpc_process_auth_metadata_done_cb cb, void *user_data);
-  void (*destroy)(void *state);
-  void *state;
+  void (*process)(void* state, grpc_auth_context* context,
+                  const grpc_metadata* md, size_t num_md,
+                  grpc_process_auth_metadata_done_cb cb, void* user_data);
+  void (*destroy)(void* state);
+  void* state;
 } grpc_auth_metadata_processor;
 
 GRPCAPI void grpc_server_credentials_set_auth_metadata_processor(
-    grpc_server_credentials *creds, grpc_auth_metadata_processor processor);
+    grpc_server_credentials* creds, grpc_auth_metadata_processor processor);
 
 #ifdef __cplusplus
 }
diff --git a/include/grpc/grpc_security_constants.h b/include/grpc/grpc_security_constants.h
index fde300d..60e167e 100644
--- a/include/grpc/grpc_security_constants.h
+++ b/include/grpc/grpc_security_constants.h
@@ -48,6 +48,13 @@
   GRPC_SSL_ROOTS_OVERRIDE_FAIL
 } grpc_ssl_roots_override_result;
 
+/** Callback results for dynamically loading a SSL certificate config. */
+typedef enum {
+  GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED,
+  GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW,
+  GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL
+} grpc_ssl_certificate_config_reload_status;
+
 typedef enum {
   /** Server does not request client certificate. A client can present a self
      signed or signed certificates if it wishes to do so and they would be
diff --git a/include/grpc/impl/codegen/atm.h b/include/grpc/impl/codegen/atm.h
index 764bee5..00d83f0 100644
--- a/include/grpc/impl/codegen/atm.h
+++ b/include/grpc/impl/codegen/atm.h
@@ -79,9 +79,17 @@
 #error could not determine platform for atm
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** Adds \a delta to \a *value, clamping the result to the range specified
     by \a min and \a max.  Returns the new value. */
-gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm *value, gpr_atm delta,
+gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm* value, gpr_atm delta,
                                        gpr_atm min, gpr_atm max);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GRPC_IMPL_CODEGEN_ATM_H */
diff --git a/include/grpc/impl/codegen/atm_gcc_atomic.h b/include/grpc/impl/codegen/atm_gcc_atomic.h
index 76ce863..5879708 100644
--- a/include/grpc/impl/codegen/atm_gcc_atomic.h
+++ b/include/grpc/impl/codegen/atm_gcc_atomic.h
@@ -23,6 +23,10 @@
    __atomic_* interface.  */
 #include <grpc/impl/codegen/port_platform.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef intptr_t gpr_atm;
 #define GPR_ATM_MAX INTPTR_MAX
 #define GPR_ATM_MIN INTPTR_MIN
@@ -57,22 +61,22 @@
   GPR_ATM_INC_ADD_THEN(                  \
       __atomic_fetch_add((p), (intptr_t)(delta), __ATOMIC_ACQ_REL))
 
-static __inline int gpr_atm_no_barrier_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
+static __inline int gpr_atm_no_barrier_cas(gpr_atm* p, gpr_atm o, gpr_atm n) {
   return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n(
       p, &o, n, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED));
 }
 
-static __inline int gpr_atm_acq_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
+static __inline int gpr_atm_acq_cas(gpr_atm* p, gpr_atm o, gpr_atm n) {
   return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n(
       p, &o, n, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED));
 }
 
-static __inline int gpr_atm_rel_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
+static __inline int gpr_atm_rel_cas(gpr_atm* p, gpr_atm o, gpr_atm n) {
   return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n(
       p, &o, n, 0, __ATOMIC_RELEASE, __ATOMIC_RELAXED));
 }
 
-static __inline int gpr_atm_full_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
+static __inline int gpr_atm_full_cas(gpr_atm* p, gpr_atm o, gpr_atm n) {
   return GPR_ATM_INC_CAS_THEN(__atomic_compare_exchange_n(
       p, &o, n, 0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED));
 }
@@ -80,4 +84,8 @@
 #define gpr_atm_full_xchg(p, n) \
   GPR_ATM_INC_CAS_THEN(__atomic_exchange_n((p), (n), __ATOMIC_ACQ_REL))
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H */
diff --git a/include/grpc/impl/codegen/atm_gcc_sync.h b/include/grpc/impl/codegen/atm_gcc_sync.h
index a9e4da3..c0010a3 100644
--- a/include/grpc/impl/codegen/atm_gcc_sync.h
+++ b/include/grpc/impl/codegen/atm_gcc_sync.h
@@ -38,24 +38,24 @@
 
 #define gpr_atm_full_barrier() (__sync_synchronize())
 
-static __inline gpr_atm gpr_atm_acq_load(const gpr_atm *p) {
+static __inline gpr_atm gpr_atm_acq_load(const gpr_atm* p) {
   gpr_atm value = *p;
   GPR_ATM_LS_BARRIER_();
   return value;
 }
 
-static __inline gpr_atm gpr_atm_no_barrier_load(const gpr_atm *p) {
+static __inline gpr_atm gpr_atm_no_barrier_load(const gpr_atm* p) {
   gpr_atm value = *p;
   GPR_ATM_COMPILE_BARRIER_();
   return value;
 }
 
-static __inline void gpr_atm_rel_store(gpr_atm *p, gpr_atm value) {
+static __inline void gpr_atm_rel_store(gpr_atm* p, gpr_atm value) {
   GPR_ATM_LS_BARRIER_();
   *p = value;
 }
 
-static __inline void gpr_atm_no_barrier_store(gpr_atm *p, gpr_atm value) {
+static __inline void gpr_atm_no_barrier_store(gpr_atm* p, gpr_atm value) {
   GPR_ATM_COMPILE_BARRIER_();
   *p = value;
 }
@@ -72,7 +72,7 @@
 #define gpr_atm_rel_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
 #define gpr_atm_full_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n))
 
-static __inline gpr_atm gpr_atm_full_xchg(gpr_atm *p, gpr_atm n) {
+static __inline gpr_atm gpr_atm_full_xchg(gpr_atm* p, gpr_atm n) {
   gpr_atm cur;
   do {
     cur = gpr_atm_acq_load(p);
diff --git a/include/grpc/impl/codegen/atm_windows.h b/include/grpc/impl/codegen/atm_windows.h
index b868d79..f6b27e5 100644
--- a/include/grpc/impl/codegen/atm_windows.h
+++ b/include/grpc/impl/codegen/atm_windows.h
@@ -28,70 +28,70 @@
 
 #define gpr_atm_full_barrier MemoryBarrier
 
-static __inline gpr_atm gpr_atm_acq_load(const gpr_atm *p) {
+static __inline gpr_atm gpr_atm_acq_load(const gpr_atm* p) {
   gpr_atm result = *p;
   gpr_atm_full_barrier();
   return result;
 }
 
-static __inline gpr_atm gpr_atm_no_barrier_load(const gpr_atm *p) {
+static __inline gpr_atm gpr_atm_no_barrier_load(const gpr_atm* p) {
   /* TODO(dklempner): Can we implement something better here? */
   return gpr_atm_acq_load(p);
 }
 
-static __inline void gpr_atm_rel_store(gpr_atm *p, gpr_atm value) {
+static __inline void gpr_atm_rel_store(gpr_atm* p, gpr_atm value) {
   gpr_atm_full_barrier();
   *p = value;
 }
 
-static __inline void gpr_atm_no_barrier_store(gpr_atm *p, gpr_atm value) {
+static __inline void gpr_atm_no_barrier_store(gpr_atm* p, gpr_atm value) {
   /* TODO(ctiller): Can we implement something better here? */
   gpr_atm_rel_store(p, value);
 }
 
-static __inline int gpr_atm_no_barrier_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
+static __inline int gpr_atm_no_barrier_cas(gpr_atm* p, gpr_atm o, gpr_atm n) {
 /** InterlockedCompareExchangePointerNoFence() not available on vista or
    windows7 */
 #ifdef GPR_ARCH_64
   return o == (gpr_atm)InterlockedCompareExchangeAcquire64(
-                  (volatile LONGLONG *)p, (LONGLONG)n, (LONGLONG)o);
+                  (volatile LONGLONG*)p, (LONGLONG)n, (LONGLONG)o);
 #else
-  return o == (gpr_atm)InterlockedCompareExchangeAcquire((volatile LONG *)p,
+  return o == (gpr_atm)InterlockedCompareExchangeAcquire((volatile LONG*)p,
                                                          (LONG)n, (LONG)o);
 #endif
 }
 
-static __inline int gpr_atm_acq_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
+static __inline int gpr_atm_acq_cas(gpr_atm* p, gpr_atm o, gpr_atm n) {
 #ifdef GPR_ARCH_64
   return o == (gpr_atm)InterlockedCompareExchangeAcquire64(
-                  (volatile LONGLONG *)p, (LONGLONG)n, (LONGLONG)o);
+                  (volatile LONGLONG*)p, (LONGLONG)n, (LONGLONG)o);
 #else
-  return o == (gpr_atm)InterlockedCompareExchangeAcquire((volatile LONG *)p,
+  return o == (gpr_atm)InterlockedCompareExchangeAcquire((volatile LONG*)p,
                                                          (LONG)n, (LONG)o);
 #endif
 }
 
-static __inline int gpr_atm_rel_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
+static __inline int gpr_atm_rel_cas(gpr_atm* p, gpr_atm o, gpr_atm n) {
 #ifdef GPR_ARCH_64
   return o == (gpr_atm)InterlockedCompareExchangeRelease64(
-                  (volatile LONGLONG *)p, (LONGLONG)n, (LONGLONG)o);
+                  (volatile LONGLONG*)p, (LONGLONG)n, (LONGLONG)o);
 #else
-  return o == (gpr_atm)InterlockedCompareExchangeRelease((volatile LONG *)p,
+  return o == (gpr_atm)InterlockedCompareExchangeRelease((volatile LONG*)p,
                                                          (LONG)n, (LONG)o);
 #endif
 }
 
-static __inline int gpr_atm_full_cas(gpr_atm *p, gpr_atm o, gpr_atm n) {
+static __inline int gpr_atm_full_cas(gpr_atm* p, gpr_atm o, gpr_atm n) {
 #ifdef GPR_ARCH_64
-  return o == (gpr_atm)InterlockedCompareExchange64((volatile LONGLONG *)p,
+  return o == (gpr_atm)InterlockedCompareExchange64((volatile LONGLONG*)p,
                                                     (LONGLONG)n, (LONGLONG)o);
 #else
-  return o == (gpr_atm)InterlockedCompareExchange((volatile LONG *)p, (LONG)n,
+  return o == (gpr_atm)InterlockedCompareExchange((volatile LONG*)p, (LONG)n,
                                                   (LONG)o);
 #endif
 }
 
-static __inline gpr_atm gpr_atm_no_barrier_fetch_add(gpr_atm *p,
+static __inline gpr_atm gpr_atm_no_barrier_fetch_add(gpr_atm* p,
                                                      gpr_atm delta) {
   /** Use the CAS operation to get pointer-sized fetch and add */
   gpr_atm old;
@@ -101,26 +101,26 @@
   return old;
 }
 
-static __inline gpr_atm gpr_atm_full_fetch_add(gpr_atm *p, gpr_atm delta) {
+static __inline gpr_atm gpr_atm_full_fetch_add(gpr_atm* p, gpr_atm delta) {
   /** Use a CAS operation to get pointer-sized fetch and add */
   gpr_atm old;
 #ifdef GPR_ARCH_64
   do {
     old = *p;
-  } while (old != (gpr_atm)InterlockedCompareExchange64((volatile LONGLONG *)p,
+  } while (old != (gpr_atm)InterlockedCompareExchange64((volatile LONGLONG*)p,
                                                         (LONGLONG)old + delta,
                                                         (LONGLONG)old));
 #else
   do {
     old = *p;
   } while (old != (gpr_atm)InterlockedCompareExchange(
-                      (volatile LONG *)p, (LONG)old + delta, (LONG)old));
+                      (volatile LONG*)p, (LONG)old + delta, (LONG)old));
 #endif
   return old;
 }
 
-static __inline gpr_atm gpr_atm_full_xchg(gpr_atm *p, gpr_atm n) {
-  return (gpr_atm)InterlockedExchangePointer((PVOID *)p, (PVOID)n);
+static __inline gpr_atm gpr_atm_full_xchg(gpr_atm* p, gpr_atm n) {
+  return (gpr_atm)InterlockedExchangePointer((PVOID*)p, (PVOID)n);
 }
 
 #endif /* GRPC_IMPL_CODEGEN_ATM_WINDOWS_H */
diff --git a/include/grpc/impl/codegen/byte_buffer.h b/include/grpc/impl/codegen/byte_buffer.h
index fc33305..f8dfbd1 100644
--- a/include/grpc/impl/codegen/byte_buffer.h
+++ b/include/grpc/impl/codegen/byte_buffer.h
@@ -29,7 +29,7 @@
  *
  * Increases the reference count for all \a slices processed. The user is
  * responsible for invoking grpc_byte_buffer_destroy on the returned instance.*/
-GRPCAPI grpc_byte_buffer *grpc_raw_byte_buffer_create(grpc_slice *slices,
+GRPCAPI grpc_byte_buffer* grpc_raw_byte_buffer_create(grpc_slice* slices,
                                                       size_t nslices);
 
 /** Returns a *compressed* RAW byte buffer instance over the given slices (up to
@@ -38,20 +38,20 @@
  *
  * Increases the reference count for all \a slices processed. The user is
  * responsible for invoking grpc_byte_buffer_destroy on the returned instance.*/
-GRPCAPI grpc_byte_buffer *grpc_raw_compressed_byte_buffer_create(
-    grpc_slice *slices, size_t nslices, grpc_compression_algorithm compression);
+GRPCAPI grpc_byte_buffer* grpc_raw_compressed_byte_buffer_create(
+    grpc_slice* slices, size_t nslices, grpc_compression_algorithm compression);
 
 /** Copies input byte buffer \a bb.
  *
  * Increases the reference count of all the source slices. The user is
  * responsible for calling grpc_byte_buffer_destroy over the returned copy. */
-GRPCAPI grpc_byte_buffer *grpc_byte_buffer_copy(grpc_byte_buffer *bb);
+GRPCAPI grpc_byte_buffer* grpc_byte_buffer_copy(grpc_byte_buffer* bb);
 
 /** Returns the size of the given byte buffer, in bytes. */
-GRPCAPI size_t grpc_byte_buffer_length(grpc_byte_buffer *bb);
+GRPCAPI size_t grpc_byte_buffer_length(grpc_byte_buffer* bb);
 
 /** Destroys \a byte_buffer deallocating all its memory. */
-GRPCAPI void grpc_byte_buffer_destroy(grpc_byte_buffer *byte_buffer);
+GRPCAPI void grpc_byte_buffer_destroy(grpc_byte_buffer* byte_buffer);
 
 /** Reader for byte buffers. Iterates over slices in the byte buffer */
 struct grpc_byte_buffer_reader;
@@ -59,25 +59,25 @@
 
 /** Initialize \a reader to read over \a buffer.
  * Returns 1 upon success, 0 otherwise. */
-GRPCAPI int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
-                                         grpc_byte_buffer *buffer);
+GRPCAPI int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
+                                         grpc_byte_buffer* buffer);
 
 /** Cleanup and destroy \a reader */
-GRPCAPI void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader);
+GRPCAPI void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader* reader);
 
 /** Updates \a slice with the next piece of data from from \a reader and returns
  * 1. Returns 0 at the end of the stream. Caller is responsible for calling
  * grpc_slice_unref on the result. */
-GRPCAPI int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
-                                         grpc_slice *slice);
+GRPCAPI int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader* reader,
+                                         grpc_slice* slice);
 
 /** Merge all data from \a reader into single slice */
 GRPCAPI grpc_slice
-grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader *reader);
+grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader* reader);
 
 /** Returns a RAW byte buffer instance from the output of \a reader. */
-GRPCAPI grpc_byte_buffer *grpc_raw_byte_buffer_from_reader(
-    grpc_byte_buffer_reader *reader);
+GRPCAPI grpc_byte_buffer* grpc_raw_byte_buffer_from_reader(
+    grpc_byte_buffer_reader* reader);
 
 #ifdef __cplusplus
 }
diff --git a/include/grpc/impl/codegen/byte_buffer_reader.h b/include/grpc/impl/codegen/byte_buffer_reader.h
index dc0f154..e06e195 100644
--- a/include/grpc/impl/codegen/byte_buffer_reader.h
+++ b/include/grpc/impl/codegen/byte_buffer_reader.h
@@ -26,8 +26,8 @@
 struct grpc_byte_buffer;
 
 struct grpc_byte_buffer_reader {
-  struct grpc_byte_buffer *buffer_in;
-  struct grpc_byte_buffer *buffer_out;
+  struct grpc_byte_buffer* buffer_in;
+  struct grpc_byte_buffer* buffer_out;
   /** Different current objects correspond to different types of byte buffers */
   union grpc_byte_buffer_reader_current {
     /** Index into a slice buffer's array of slices */
diff --git a/include/grpc/impl/codegen/connectivity_state.h b/include/grpc/impl/codegen/connectivity_state.h
index 545b4fd..b70dbef 100644
--- a/include/grpc/impl/codegen/connectivity_state.h
+++ b/include/grpc/impl/codegen/connectivity_state.h
@@ -25,8 +25,6 @@
 
 /** Connectivity state of a channel. */
 typedef enum {
-  /** channel has just been initialized */
-  GRPC_CHANNEL_INIT = -1,
   /** channel is idle */
   GRPC_CHANNEL_IDLE,
   /** channel is connecting */
diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h
index 65463bb..03be610 100644
--- a/include/grpc/impl/codegen/grpc_types.h
+++ b/include/grpc/impl/codegen/grpc_types.h
@@ -39,11 +39,11 @@
 } grpc_byte_buffer_type;
 
 typedef struct grpc_byte_buffer {
-  void *reserved;
+  void* reserved;
   grpc_byte_buffer_type type;
   union grpc_byte_buffer_data {
     struct /* internal */ {
-      void *reserved[8];
+      void* reserved[8];
     } reserved;
     struct grpc_compressed_buffer {
       grpc_compression_algorithm compression;
@@ -84,9 +84,9 @@
 } grpc_arg_type;
 
 typedef struct grpc_arg_pointer_vtable {
-  void *(*copy)(void *p);
-  void (*destroy)(grpc_exec_ctx *exec_ctx, void *p);
-  int (*cmp)(void *p, void *q);
+  void* (*copy)(void* p);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, void* p);
+  int (*cmp)(void* p, void* q);
 } grpc_arg_pointer_vtable;
 
 /** A single argument... each argument has a key and a value
@@ -103,13 +103,13 @@
     their keys so that it's possible to change them in the future. */
 typedef struct {
   grpc_arg_type type;
-  char *key;
+  char* key;
   union grpc_arg_value {
-    char *string;
+    char* string;
     int integer;
     struct grpc_arg_pointer {
-      void *p;
-      const grpc_arg_pointer_vtable *vtable;
+      void* p;
+      const grpc_arg_pointer_vtable* vtable;
     } pointer;
   } value;
 } grpc_arg;
@@ -127,7 +127,7 @@
     details. */
 typedef struct {
   size_t num_args;
-  grpc_arg *args;
+  grpc_arg* args;
 } grpc_channel_args;
 
 /** \defgroup grpc_arg_keys
@@ -400,7 +400,7 @@
       There is no need to initialize them, and they will be set to garbage
       during calls to grpc. */
   struct /* internal */ {
-    void *obfuscated[4];
+    void* obfuscated[4];
   } internal_data;
 } grpc_metadata;
 
@@ -428,13 +428,13 @@
   int success;
   /** The tag passed to grpc_call_start_batch etc to start this operation.
       Only GRPC_OP_COMPLETE has a tag. */
-  void *tag;
+  void* tag;
 } grpc_event;
 
 typedef struct {
   size_t count;
   size_t capacity;
-  grpc_metadata *metadata;
+  grpc_metadata* metadata;
 } grpc_metadata_array;
 
 typedef struct {
@@ -442,7 +442,7 @@
   grpc_slice host;
   gpr_timespec deadline;
   uint32_t flags;
-  void *reserved;
+  void* reserved;
 } grpc_call_details;
 
 typedef enum {
@@ -498,15 +498,15 @@
   /** Write flags bitset for grpc_begin_messages */
   uint32_t flags;
   /** Reserved for future usage */
-  void *reserved;
+  void* reserved;
   union grpc_op_data {
     /** Reserved for future usage */
     struct /* internal */ {
-      void *reserved[8];
+      void* reserved[8];
     } reserved;
     struct grpc_op_send_initial_metadata {
       size_t count;
-      grpc_metadata *metadata;
+      grpc_metadata* metadata;
       /** If \a is_set, \a compression_level will be used for the call.
        * Otherwise, \a compression_level won't be considered */
       struct grpc_op_send_initial_metadata_maybe_compression_level {
@@ -524,16 +524,16 @@
        * and likely empty.  The original owner should still call
        * grpc_byte_buffer_destroy() on this object however.
        */
-      struct grpc_byte_buffer *send_message;
+      struct grpc_byte_buffer* send_message;
     } send_message;
     struct grpc_op_send_status_from_server {
       size_t trailing_metadata_count;
-      grpc_metadata *trailing_metadata;
+      grpc_metadata* trailing_metadata;
       grpc_status_code status;
       /** optional: set to NULL if no details need sending, non-NULL if they do
        * pointer will not be retained past the start_batch call
        */
-      grpc_slice *status_details;
+      grpc_slice* status_details;
     } send_status_from_server;
     /** ownership of the array is with the caller, but ownership of the elements
         stays with the call object (ie key, value members are owned by the call
@@ -541,13 +541,13 @@
         After the operation completes, call grpc_metadata_array_destroy on this
         value, or reuse it in a future op. */
     struct grpc_op_recv_initial_metadata {
-      grpc_metadata_array *recv_initial_metadata;
+      grpc_metadata_array* recv_initial_metadata;
     } recv_initial_metadata;
     /** ownership of the byte buffer is moved to the caller; the caller must
         call grpc_byte_buffer_destroy on this value, or reuse it in a future op.
        */
     struct grpc_op_recv_message {
-      struct grpc_byte_buffer **recv_message;
+      struct grpc_byte_buffer** recv_message;
     } recv_message;
     struct grpc_op_recv_status_on_client {
       /** ownership of the array is with the caller, but ownership of the
@@ -555,14 +555,14 @@
           by the call object, trailing_metadata->array is owned by the caller).
           After the operation completes, call grpc_metadata_array_destroy on
           this value, or reuse it in a future op. */
-      grpc_metadata_array *trailing_metadata;
-      grpc_status_code *status;
-      grpc_slice *status_details;
+      grpc_metadata_array* trailing_metadata;
+      grpc_status_code* status;
+      grpc_slice* status_details;
     } recv_status_on_client;
     struct grpc_op_recv_close_on_server {
       /** out argument, set to 1 if the call failed in any way (seen as a
           cancellation on the server), or 0 if the call succeeded */
-      int *cancelled;
+      int* cancelled;
     } recv_close_on_server;
   } data;
 } grpc_op;
@@ -571,10 +571,10 @@
 typedef struct {
   /** If non-NULL, will be set to point to a string indicating the LB
    * policy name.  Caller takes ownership. */
-  char **lb_policy_name;
+  char** lb_policy_name;
   /** If non-NULL, will be set to point to a string containing the
    * service config used by the channel in JSON form. */
-  char **service_config_json;
+  char** service_config_json;
 } grpc_channel_info;
 
 typedef struct grpc_resource_quota grpc_resource_quota;
diff --git a/include/grpc/impl/codegen/slice.h b/include/grpc/impl/codegen/slice.h
index 128fa8e..11997fc 100644
--- a/include/grpc/impl/codegen/slice.h
+++ b/include/grpc/impl/codegen/slice.h
@@ -42,8 +42,8 @@
    constraints (is the callee allowed to modify the slice?) */
 
 typedef struct grpc_slice_refcount_vtable {
-  void (*ref)(void *);
-  void (*unref)(grpc_exec_ctx *exec_ctx, void *);
+  void (*ref)(void*);
+  void (*unref)(grpc_exec_ctx* exec_ctx, void*);
   int (*eq)(grpc_slice a, grpc_slice b);
   uint32_t (*hash)(grpc_slice slice);
 } grpc_slice_refcount_vtable;
@@ -54,20 +54,20 @@
    Typically client code should not touch this, and use grpc_slice_malloc,
    grpc_slice_new, or grpc_slice_new_with_len instead. */
 typedef struct grpc_slice_refcount {
-  const grpc_slice_refcount_vtable *vtable;
+  const grpc_slice_refcount_vtable* vtable;
   /** If a subset of this slice is taken, use this pointer for the refcount.
      Typically points back to the refcount itself, however iterning
      implementations can use this to avoid a verification step on each hash
      or equality check */
-  struct grpc_slice_refcount *sub_refcount;
+  struct grpc_slice_refcount* sub_refcount;
 } grpc_slice_refcount;
 
 /* Inlined half of grpc_slice is allowed to expand the size of the overall type
    by this many bytes */
-#define GRPC_SLICE_INLINE_EXTRA_SIZE sizeof(void *)
+#define GRPC_SLICE_INLINE_EXTRA_SIZE sizeof(void*)
 
 #define GRPC_SLICE_INLINED_SIZE \
-  (sizeof(size_t) + sizeof(uint8_t *) - 1 + GRPC_SLICE_INLINE_EXTRA_SIZE)
+  (sizeof(size_t) + sizeof(uint8_t*) - 1 + GRPC_SLICE_INLINE_EXTRA_SIZE)
 
 /** A grpc_slice s, if initialized, represents the byte range
    s.bytes[0..s.length-1].
@@ -79,10 +79,10 @@
    If the slice does not have a refcount, it represents an inlined small piece
    of data that is copied by value. */
 struct grpc_slice {
-  struct grpc_slice_refcount *refcount;
+  struct grpc_slice_refcount* refcount;
   union grpc_slice_data {
     struct grpc_slice_refcounted {
-      uint8_t *bytes;
+      uint8_t* bytes;
       size_t length;
     } refcounted;
     struct grpc_slice_inlined {
@@ -99,10 +99,10 @@
 typedef struct {
   /** This is for internal use only. External users (i.e any code outside grpc
    * core) MUST NOT use this field */
-  grpc_slice *base_slices;
+  grpc_slice* base_slices;
 
   /** slices in the array (Points to the first valid grpc_slice in the array) */
-  grpc_slice *slices;
+  grpc_slice* slices;
   /** the number of slices in the array */
   size_t count;
   /** the number of slices allocated in the array. External users (i.e any code
diff --git a/include/grpc/impl/codegen/sync_generic.h b/include/grpc/impl/codegen/sync_generic.h
index e1eea54..83f905e 100644
--- a/include/grpc/impl/codegen/sync_generic.h
+++ b/include/grpc/impl/codegen/sync_generic.h
@@ -23,16 +23,22 @@
 #include <grpc/impl/codegen/atm.h>
 
 /* gpr_event */
-typedef struct { gpr_atm state; } gpr_event;
+typedef struct {
+  gpr_atm state;
+} gpr_event;
 
 #define GPR_EVENT_INIT \
   { 0 }
 
 /* gpr_refcount */
-typedef struct { gpr_atm count; } gpr_refcount;
+typedef struct {
+  gpr_atm count;
+} gpr_refcount;
 
 /* gpr_stats_counter */
-typedef struct { gpr_atm value; } gpr_stats_counter;
+typedef struct {
+  gpr_atm value;
+} gpr_stats_counter;
 
 #define GPR_STATS_INIT \
   { 0 }
diff --git a/include/grpc/slice.h b/include/grpc/slice.h
index 3f3cff1..10b6a62 100644
--- a/include/grpc/slice.h
+++ b/include/grpc/slice.h
@@ -44,20 +44,20 @@
 /** Create a slice pointing at some data. Calls malloc to allocate a refcount
    for the object, and arranges that destroy will be called with the pointer
    passed in at destruction. */
-GPRAPI grpc_slice grpc_slice_new(void *p, size_t len, void (*destroy)(void *));
+GPRAPI grpc_slice grpc_slice_new(void* p, size_t len, void (*destroy)(void*));
 
 /** Equivalent to grpc_slice_new, but with a separate pointer that is
    passed to the destroy function.  This function can be useful when
    the data is part of a larger structure that must be destroyed when
    the data is no longer needed. */
-GPRAPI grpc_slice grpc_slice_new_with_user_data(void *p, size_t len,
-                                                void (*destroy)(void *),
-                                                void *user_data);
+GPRAPI grpc_slice grpc_slice_new_with_user_data(void* p, size_t len,
+                                                void (*destroy)(void*),
+                                                void* user_data);
 
 /** Equivalent to grpc_slice_new, but with a two argument destroy function that
    also takes the slice length. */
-GPRAPI grpc_slice grpc_slice_new_with_len(void *p, size_t len,
-                                          void (*destroy)(void *, size_t));
+GPRAPI grpc_slice grpc_slice_new_with_len(void* p, size_t len,
+                                          void (*destroy)(void*, size_t));
 
 /** Equivalent to grpc_slice_new(malloc(len), len, free), but saves one malloc()
    call.
@@ -79,19 +79,19 @@
      size_t len = strlen(source);
      grpc_slice slice = grpc_slice_malloc(len);
      memcpy(slice->data, source, len); */
-GPRAPI grpc_slice grpc_slice_from_copied_string(const char *source);
+GPRAPI grpc_slice grpc_slice_from_copied_string(const char* source);
 
 /** Create a slice by copying a buffer.
    Equivalent to:
      grpc_slice slice = grpc_slice_malloc(len);
      memcpy(slice->data, source, len); */
-GPRAPI grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t len);
+GPRAPI grpc_slice grpc_slice_from_copied_buffer(const char* source, size_t len);
 
 /** Create a slice pointing to constant memory */
-GPRAPI grpc_slice grpc_slice_from_static_string(const char *source);
+GPRAPI grpc_slice grpc_slice_from_static_string(const char* source);
 
 /** Create a slice pointing to constant memory */
-GPRAPI grpc_slice grpc_slice_from_static_buffer(const void *source, size_t len);
+GPRAPI grpc_slice grpc_slice_from_static_buffer(const void* source, size_t len);
 
 /** Return a result slice derived from s, which shares a ref count with \a s,
    where result.data==s.data+begin, and result.length==end-begin. The ref count
@@ -106,7 +106,7 @@
 /** Splits s into two: modifies s to be s[0:split], and returns a new slice,
    sharing a refcount with s, that contains s[split:s.length].
    Requires s intialized, split <= s.length */
-GPRAPI grpc_slice grpc_slice_split_tail(grpc_slice *s, size_t split);
+GPRAPI grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split);
 
 typedef enum {
   GRPC_SLICE_REF_TAIL = 1,
@@ -117,13 +117,13 @@
 /** The same as grpc_slice_split_tail, but with an option to skip altering
  * refcounts (grpc_slice_split_tail_maybe_ref(..., true) is equivalent to
  * grpc_slice_split_tail(...)) */
-GPRAPI grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice *s, size_t split,
+GPRAPI grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice* s, size_t split,
                                                   grpc_slice_ref_whom ref_whom);
 
 /** Splits s into two: modifies s to be s[split:s.length], and returns a new
    slice, sharing a refcount with s, that contains s[0:split].
    Requires s intialized, split <= s.length */
-GPRAPI grpc_slice grpc_slice_split_head(grpc_slice *s, size_t split);
+GPRAPI grpc_slice grpc_slice_split_head(grpc_slice* s, size_t split);
 
 GPRAPI grpc_slice grpc_empty_slice(void);
 
@@ -136,11 +136,10 @@
    The order is arbitrary, and is not guaranteed to be stable across different
    versions of the API. */
 GPRAPI int grpc_slice_cmp(grpc_slice a, grpc_slice b);
-GPRAPI int grpc_slice_str_cmp(grpc_slice a, const char *b);
-GPRAPI int grpc_slice_buf_cmp(grpc_slice a, const void *b, size_t blen);
+GPRAPI int grpc_slice_str_cmp(grpc_slice a, const char* b);
 
 /** return non-zero if the first blen bytes of a are equal to b */
-GPRAPI int grpc_slice_buf_start_eq(grpc_slice a, const void *b, size_t blen);
+GPRAPI int grpc_slice_buf_start_eq(grpc_slice a, const void* b, size_t blen);
 
 /** return the index of the last instance of \a c in \a s, or -1 if not found */
 GPRAPI int grpc_slice_rchr(grpc_slice s, char c);
@@ -162,7 +161,7 @@
 
 /** Return a copy of slice as a C string. Offers no protection against embedded
    NULL's. Returned string must be freed with gpr_free. */
-GPRAPI char *grpc_slice_to_c_string(grpc_slice s);
+GPRAPI char* grpc_slice_to_c_string(grpc_slice s);
 
 #ifdef __cplusplus
 }
diff --git a/include/grpc/slice_buffer.h b/include/grpc/slice_buffer.h
index de4b86f..6510c15 100644
--- a/include/grpc/slice_buffer.h
+++ b/include/grpc/slice_buffer.h
@@ -26,13 +26,13 @@
 #endif
 
 /** initialize a slice buffer */
-GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer *sb);
+GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer* sb);
 /** destroy a slice buffer - unrefs any held elements */
-GPRAPI void grpc_slice_buffer_destroy(grpc_slice_buffer *sb);
+GPRAPI void grpc_slice_buffer_destroy(grpc_slice_buffer* sb);
 /** Add an element to a slice buffer - takes ownership of the slice.
    This function is allowed to concatenate the passed in slice to the end of
    some other slice if desired by the slice buffer. */
-GPRAPI void grpc_slice_buffer_add(grpc_slice_buffer *sb, grpc_slice slice);
+GPRAPI void grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice slice);
 /** add an element to a slice buffer - takes ownership of the slice and returns
    the index of the slice.
    Guarantees that the slice will not be concatenated at the end of another
@@ -40,40 +40,40 @@
    slice at the returned index in sb->slices)
    The implementation MAY decide to concatenate data at the end of a small
    slice added in this fashion. */
-GPRAPI size_t grpc_slice_buffer_add_indexed(grpc_slice_buffer *sb,
+GPRAPI size_t grpc_slice_buffer_add_indexed(grpc_slice_buffer* sb,
                                             grpc_slice slice);
-GPRAPI void grpc_slice_buffer_addn(grpc_slice_buffer *sb, grpc_slice *slices,
+GPRAPI void grpc_slice_buffer_addn(grpc_slice_buffer* sb, grpc_slice* slices,
                                    size_t n);
 /** add a very small (less than 8 bytes) amount of data to the end of a slice
    buffer: returns a pointer into which to add the data */
-GPRAPI uint8_t *grpc_slice_buffer_tiny_add(grpc_slice_buffer *sb, size_t len);
+GPRAPI uint8_t* grpc_slice_buffer_tiny_add(grpc_slice_buffer* sb, size_t len);
 /** pop the last buffer, but don't unref it */
-GPRAPI void grpc_slice_buffer_pop(grpc_slice_buffer *sb);
+GPRAPI void grpc_slice_buffer_pop(grpc_slice_buffer* sb);
 /** clear a slice buffer, unref all elements */
-GPRAPI void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer *sb);
+GPRAPI void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer* sb);
 /** swap the contents of two slice buffers */
-GPRAPI void grpc_slice_buffer_swap(grpc_slice_buffer *a, grpc_slice_buffer *b);
+GPRAPI void grpc_slice_buffer_swap(grpc_slice_buffer* a, grpc_slice_buffer* b);
 /** move all of the elements of src into dst */
-GPRAPI void grpc_slice_buffer_move_into(grpc_slice_buffer *src,
-                                        grpc_slice_buffer *dst);
+GPRAPI void grpc_slice_buffer_move_into(grpc_slice_buffer* src,
+                                        grpc_slice_buffer* dst);
 /** remove n bytes from the end of a slice buffer */
-GPRAPI void grpc_slice_buffer_trim_end(grpc_slice_buffer *src, size_t n,
-                                       grpc_slice_buffer *garbage);
+GPRAPI void grpc_slice_buffer_trim_end(grpc_slice_buffer* src, size_t n,
+                                       grpc_slice_buffer* garbage);
 /** move the first n bytes of src into dst */
-GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
-                                         grpc_slice_buffer *dst);
+GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer* src, size_t n,
+                                         grpc_slice_buffer* dst);
 /** move the first n bytes of src into dst without adding references */
-GPRAPI void grpc_slice_buffer_move_first_no_ref(grpc_slice_buffer *src,
+GPRAPI void grpc_slice_buffer_move_first_no_ref(grpc_slice_buffer* src,
                                                 size_t n,
-                                                grpc_slice_buffer *dst);
+                                                grpc_slice_buffer* dst);
 /** move the first n bytes of src into dst (copying them) */
-GPRAPI void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx *exec_ctx,
-                                                     grpc_slice_buffer *src,
-                                                     size_t n, void *dst);
+GPRAPI void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx* exec_ctx,
+                                                     grpc_slice_buffer* src,
+                                                     size_t n, void* dst);
 /** take the first slice in the slice buffer */
-GPRAPI grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *src);
+GPRAPI grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer* src);
 /** undo the above with (a possibly different) \a slice */
-GPRAPI void grpc_slice_buffer_undo_take_first(grpc_slice_buffer *src,
+GPRAPI void grpc_slice_buffer_undo_take_first(grpc_slice_buffer* src,
                                               grpc_slice slice);
 
 #ifdef __cplusplus
diff --git a/include/grpc/support/alloc.h b/include/grpc/support/alloc.h
index 4b59e13..31cb225 100644
--- a/include/grpc/support/alloc.h
+++ b/include/grpc/support/alloc.h
@@ -28,10 +28,10 @@
 #endif
 
 typedef struct gpr_allocation_functions {
-  void *(*malloc_fn)(size_t size);
-  void *(*zalloc_fn)(size_t size); /** if NULL, uses malloc_fn then memset */
-  void *(*realloc_fn)(void *ptr, size_t size);
-  void (*free_fn)(void *ptr);
+  void* (*malloc_fn)(size_t size);
+  void* (*zalloc_fn)(size_t size); /** if NULL, uses malloc_fn then memset */
+  void* (*realloc_fn)(void* ptr, size_t size);
+  void (*free_fn)(void* ptr);
 } gpr_allocation_functions;
 
 /** malloc.
@@ -39,17 +39,17 @@
  * The pointer returned is suitably aligned for any kind of variable it could
  * contain.
  */
-GPRAPI void *gpr_malloc(size_t size);
+GPRAPI void* gpr_malloc(size_t size);
 /** like malloc, but zero all bytes before returning them */
-GPRAPI void *gpr_zalloc(size_t size);
+GPRAPI void* gpr_zalloc(size_t size);
 /** free */
-GPRAPI void gpr_free(void *ptr);
+GPRAPI void gpr_free(void* ptr);
 /** realloc, never returns NULL */
-GPRAPI void *gpr_realloc(void *p, size_t size);
+GPRAPI void* gpr_realloc(void* p, size_t size);
 /** aligned malloc, never returns NULL, will align to 1 << alignment_log */
-GPRAPI void *gpr_malloc_aligned(size_t size, size_t alignment_log);
+GPRAPI void* gpr_malloc_aligned(size_t size, size_t alignment_log);
 /** free memory allocated by gpr_malloc_aligned */
-GPRAPI void gpr_free_aligned(void *ptr);
+GPRAPI void gpr_free_aligned(void* ptr);
 
 /** Request the family of allocation functions in \a functions be used. NOTE
  * that this request will be honored in a *best effort* basis and that no
diff --git a/include/grpc/support/avl.h b/include/grpc/support/avl.h
index d8a5efd..b5a8c0f 100644
--- a/include/grpc/support/avl.h
+++ b/include/grpc/support/avl.h
@@ -28,10 +28,10 @@
 /** internal node of an AVL tree */
 typedef struct gpr_avl_node {
   gpr_refcount refs;
-  void *key;
-  void *value;
-  struct gpr_avl_node *left;
-  struct gpr_avl_node *right;
+  void* key;
+  void* value;
+  struct gpr_avl_node* left;
+  struct gpr_avl_node* right;
   long height;
 } gpr_avl_node;
 
@@ -42,56 +42,56 @@
  */
 typedef struct gpr_avl_vtable {
   /** destroy a key */
-  void (*destroy_key)(void *key, void *user_data);
+  void (*destroy_key)(void* key, void* user_data);
   /** copy a key, returning new value */
-  void *(*copy_key)(void *key, void *user_data);
+  void* (*copy_key)(void* key, void* user_data);
   /** compare key1, key2; return <0 if key1 < key2,
       >0 if key1 > key2, 0 if key1 == key2 */
-  long (*compare_keys)(void *key1, void *key2, void *user_data);
+  long (*compare_keys)(void* key1, void* key2, void* user_data);
   /** destroy a value */
-  void (*destroy_value)(void *value, void *user_data);
+  void (*destroy_value)(void* value, void* user_data);
   /** copy a value */
-  void *(*copy_value)(void *value, void *user_data);
+  void* (*copy_value)(void* value, void* user_data);
 } gpr_avl_vtable;
 
 /** "pointer" to an AVL tree - this is a reference
     counted object - use gpr_avl_ref to add a reference,
     gpr_avl_unref when done with a reference */
 typedef struct gpr_avl {
-  const gpr_avl_vtable *vtable;
-  gpr_avl_node *root;
+  const gpr_avl_vtable* vtable;
+  gpr_avl_node* root;
 } gpr_avl;
 
 /** Create an immutable AVL tree. */
-GPRAPI gpr_avl gpr_avl_create(const gpr_avl_vtable *vtable);
+GPRAPI gpr_avl gpr_avl_create(const gpr_avl_vtable* vtable);
 /** Add a reference to an existing tree - returns
     the tree as a convenience. The optional user_data will be passed to vtable
     functions. */
-GPRAPI gpr_avl gpr_avl_ref(gpr_avl avl, void *user_data);
+GPRAPI gpr_avl gpr_avl_ref(gpr_avl avl, void* user_data);
 /** Remove a reference to a tree - destroying it if there
     are no references left. The optional user_data will be passed to vtable
     functions. */
-GPRAPI void gpr_avl_unref(gpr_avl avl, void *user_data);
+GPRAPI void gpr_avl_unref(gpr_avl avl, void* user_data);
 /** Return a new tree with (key, value) added to avl.
     implicitly unrefs avl to allow easy chaining.
     if key exists in avl, the new tree's key entry updated
     (i.e. a duplicate is not created). The optional user_data will be passed to
     vtable functions. */
-GPRAPI gpr_avl gpr_avl_add(gpr_avl avl, void *key, void *value,
-                           void *user_data);
+GPRAPI gpr_avl gpr_avl_add(gpr_avl avl, void* key, void* value,
+                           void* user_data);
 /** Return a new tree with key deleted
     implicitly unrefs avl to allow easy chaining. The optional user_data will be
     passed to vtable functions. */
-GPRAPI gpr_avl gpr_avl_remove(gpr_avl avl, void *key, void *user_data);
+GPRAPI gpr_avl gpr_avl_remove(gpr_avl avl, void* key, void* user_data);
 /** Lookup key, and return the associated value.
     Does not mutate avl.
     Returns NULL if key is not found. The optional user_data will be passed to
     vtable functions.*/
-GPRAPI void *gpr_avl_get(gpr_avl avl, void *key, void *user_data);
+GPRAPI void* gpr_avl_get(gpr_avl avl, void* key, void* user_data);
 /** Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to
     its value. THe optional user_data will be passed to vtable functions. */
-GPRAPI int gpr_avl_maybe_get(gpr_avl avl, void *key, void **value,
-                             void *user_data);
+GPRAPI int gpr_avl_maybe_get(gpr_avl avl, void* key, void** value,
+                             void* user_data);
 /** Return 1 if avl is empty, 0 otherwise */
 GPRAPI int gpr_avl_is_empty(gpr_avl avl);
 
diff --git a/include/grpc/support/cmdline.h b/include/grpc/support/cmdline.h
index 9f46491..c34a109 100644
--- a/include/grpc/support/cmdline.h
+++ b/include/grpc/support/cmdline.h
@@ -55,31 +55,31 @@
 
 /** Construct a command line parser: takes a short description of the tool
    doing the parsing */
-GPRAPI gpr_cmdline *gpr_cmdline_create(const char *description);
+GPRAPI gpr_cmdline* gpr_cmdline_create(const char* description);
 /** Add an integer parameter, with a name (used on the command line) and some
    helpful text (used in the command usage) */
-GPRAPI void gpr_cmdline_add_int(gpr_cmdline *cl, const char *name,
-                                const char *help, int *value);
+GPRAPI void gpr_cmdline_add_int(gpr_cmdline* cl, const char* name,
+                                const char* help, int* value);
 /** The same, for a boolean flag */
-GPRAPI void gpr_cmdline_add_flag(gpr_cmdline *cl, const char *name,
-                                 const char *help, int *value);
+GPRAPI void gpr_cmdline_add_flag(gpr_cmdline* cl, const char* name,
+                                 const char* help, int* value);
 /** And for a string */
-GPRAPI void gpr_cmdline_add_string(gpr_cmdline *cl, const char *name,
-                                   const char *help, char **value);
+GPRAPI void gpr_cmdline_add_string(gpr_cmdline* cl, const char* name,
+                                   const char* help, const char** value);
 /** Set a callback for non-named arguments */
 GPRAPI void gpr_cmdline_on_extra_arg(
-    gpr_cmdline *cl, const char *name, const char *help,
-    void (*on_extra_arg)(void *user_data, const char *arg), void *user_data);
+    gpr_cmdline* cl, const char* name, const char* help,
+    void (*on_extra_arg)(void* user_data, const char* arg), void* user_data);
 /** Enable surviving failure: default behavior is to exit the process */
-GPRAPI void gpr_cmdline_set_survive_failure(gpr_cmdline *cl);
+GPRAPI void gpr_cmdline_set_survive_failure(gpr_cmdline* cl);
 /** Parse the command line; returns 1 on success, on failure either dies
    (by default) or returns 0 if gpr_cmdline_set_survive_failure() has been
    called */
-GPRAPI int gpr_cmdline_parse(gpr_cmdline *cl, int argc, char **argv);
+GPRAPI int gpr_cmdline_parse(gpr_cmdline* cl, int argc, char** argv);
 /** Destroy the parser */
-GPRAPI void gpr_cmdline_destroy(gpr_cmdline *cl);
+GPRAPI void gpr_cmdline_destroy(gpr_cmdline* cl);
 /** Get a string describing usage */
-GPRAPI char *gpr_cmdline_usage_string(gpr_cmdline *cl, const char *argv0);
+GPRAPI char* gpr_cmdline_usage_string(gpr_cmdline* cl, const char* argv0);
 
 #ifdef __cplusplus
 }
diff --git a/include/grpc/support/histogram.h b/include/grpc/support/histogram.h
index 8489daa..d2794d8 100644
--- a/include/grpc/support/histogram.h
+++ b/include/grpc/support/histogram.h
@@ -28,31 +28,31 @@
 
 typedef struct gpr_histogram gpr_histogram;
 
-GPRAPI gpr_histogram *gpr_histogram_create(double resolution,
+GPRAPI gpr_histogram* gpr_histogram_create(double resolution,
                                            double max_bucket_start);
-GPRAPI void gpr_histogram_destroy(gpr_histogram *h);
-GPRAPI void gpr_histogram_add(gpr_histogram *h, double x);
+GPRAPI void gpr_histogram_destroy(gpr_histogram* h);
+GPRAPI void gpr_histogram_add(gpr_histogram* h, double x);
 
 /** The following merges the second histogram into the first. It only works
    if they have the same buckets and resolution. Returns 0 on failure, 1
    on success */
-GPRAPI int gpr_histogram_merge(gpr_histogram *dst, const gpr_histogram *src);
+GPRAPI int gpr_histogram_merge(gpr_histogram* dst, const gpr_histogram* src);
 
-GPRAPI double gpr_histogram_percentile(gpr_histogram *histogram,
+GPRAPI double gpr_histogram_percentile(gpr_histogram* histogram,
                                        double percentile);
-GPRAPI double gpr_histogram_mean(gpr_histogram *histogram);
-GPRAPI double gpr_histogram_stddev(gpr_histogram *histogram);
-GPRAPI double gpr_histogram_variance(gpr_histogram *histogram);
-GPRAPI double gpr_histogram_maximum(gpr_histogram *histogram);
-GPRAPI double gpr_histogram_minimum(gpr_histogram *histogram);
-GPRAPI double gpr_histogram_count(gpr_histogram *histogram);
-GPRAPI double gpr_histogram_sum(gpr_histogram *histogram);
-GPRAPI double gpr_histogram_sum_of_squares(gpr_histogram *histogram);
+GPRAPI double gpr_histogram_mean(gpr_histogram* histogram);
+GPRAPI double gpr_histogram_stddev(gpr_histogram* histogram);
+GPRAPI double gpr_histogram_variance(gpr_histogram* histogram);
+GPRAPI double gpr_histogram_maximum(gpr_histogram* histogram);
+GPRAPI double gpr_histogram_minimum(gpr_histogram* histogram);
+GPRAPI double gpr_histogram_count(gpr_histogram* histogram);
+GPRAPI double gpr_histogram_sum(gpr_histogram* histogram);
+GPRAPI double gpr_histogram_sum_of_squares(gpr_histogram* histogram);
 
-GPRAPI const uint32_t *gpr_histogram_get_contents(gpr_histogram *histogram,
-                                                  size_t *count);
-GPRAPI void gpr_histogram_merge_contents(gpr_histogram *histogram,
-                                         const uint32_t *data,
+GPRAPI const uint32_t* gpr_histogram_get_contents(gpr_histogram* histogram,
+                                                  size_t* count);
+GPRAPI void gpr_histogram_merge_contents(gpr_histogram* histogram,
+                                         const uint32_t* data,
                                          size_t data_count, double min_seen,
                                          double max_seen, double sum,
                                          double sum_of_squares, double count);
diff --git a/include/grpc/support/host_port.h b/include/grpc/support/host_port.h
index 41592df..9805811 100644
--- a/include/grpc/support/host_port.h
+++ b/include/grpc/support/host_port.h
@@ -35,14 +35,14 @@
    destroyed using gpr_free().
 
    In the unlikely event of an error, returns -1 and sets *out to NULL. */
-GPRAPI int gpr_join_host_port(char **out, const char *host, int port);
+GPRAPI int gpr_join_host_port(char** out, const char* host, int port);
 
 /** Given a name in the form "host:port" or "[ho:st]:port", split into hostname
    and port number, into newly allocated strings, which must later be
    destroyed using gpr_free().
    Return 1 on success, 0 on failure. Guarantees *host and *port == NULL on
    failure. */
-GPRAPI int gpr_split_host_port(const char *name, char **host, char **port);
+GPRAPI int gpr_split_host_port(const char* name, char** host, char** port);
 
 #ifdef __cplusplus
 }
diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h
index a22fb6a..497cca9 100644
--- a/include/grpc/support/log.h
+++ b/include/grpc/support/log.h
@@ -50,7 +50,7 @@
 #define GPR_LOG_VERBOSITY_UNSET -1
 
 /** Returns a string representation of the log severity */
-GPRAPI const char *gpr_log_severity_string(gpr_log_severity severity);
+GPRAPI const char* gpr_log_severity_string(gpr_log_severity severity);
 
 /** Macros to build log contexts at various severity levels */
 #define GPR_DEBUG __FILE__, __LINE__, GPR_LOG_SEVERITY_DEBUG
@@ -59,11 +59,11 @@
 
 /** Log a message. It's advised to use GPR_xxx above to generate the context
  * for each message */
-GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity,
-                    const char *format, ...) GPR_PRINT_FORMAT_CHECK(4, 5);
+GPRAPI void gpr_log(const char* file, int line, gpr_log_severity severity,
+                    const char* format, ...) GPR_PRINT_FORMAT_CHECK(4, 5);
 
-GPRAPI void gpr_log_message(const char *file, int line,
-                            gpr_log_severity severity, const char *message);
+GPRAPI void gpr_log_message(const char* file, int line,
+                            gpr_log_severity severity, const char* message);
 
 /** Set global log verbosity */
 GPRAPI void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print);
@@ -74,13 +74,13 @@
    and use their own implementations */
 
 typedef struct {
-  const char *file;
+  const char* file;
   int line;
   gpr_log_severity severity;
-  const char *message;
+  const char* message;
 } gpr_log_func_args;
 
-typedef void (*gpr_log_func)(gpr_log_func_args *args);
+typedef void (*gpr_log_func)(gpr_log_func_args* args);
 GPRAPI void gpr_set_log_function(gpr_log_func func);
 
 /** abort() the process if x is zero, having written a line to the log.
diff --git a/include/grpc/support/log_windows.h b/include/grpc/support/log_windows.h
index b530fd5..e833f9d 100644
--- a/include/grpc/support/log_windows.h
+++ b/include/grpc/support/log_windows.h
@@ -29,7 +29,7 @@
  * formatted error message, corresponding to the error messageid.
  * Use in conjunction with GetLastError() et al.
  */
-GPRAPI char *gpr_format_message(int messageid);
+GPRAPI char* gpr_format_message(int messageid);
 
 #ifdef __cplusplus
 }
diff --git a/include/grpc/support/string_util.h b/include/grpc/support/string_util.h
index c4fc159..2c7460f 100644
--- a/include/grpc/support/string_util.h
+++ b/include/grpc/support/string_util.h
@@ -29,7 +29,7 @@
 
 /** Returns a copy of src that can be passed to gpr_free().
    If allocation fails or if src is NULL, returns NULL. */
-GPRAPI char *gpr_strdup(const char *src);
+GPRAPI char* gpr_strdup(const char* src);
 
 /** printf to a newly-allocated string.  The set of supported formats may vary
    between platforms.
@@ -39,7 +39,7 @@
 
    On error, returns -1 and sets *strp to NULL. If the format string is bad,
    the result is undefined. */
-GPRAPI int gpr_asprintf(char **strp, const char *format, ...)
+GPRAPI int gpr_asprintf(char** strp, const char* format, ...)
     GPR_PRINT_FORMAT_CHECK(2, 3);
 
 #ifdef __cplusplus
diff --git a/include/grpc/support/subprocess.h b/include/grpc/support/subprocess.h
index c06e629..175f7b5 100644
--- a/include/grpc/support/subprocess.h
+++ b/include/grpc/support/subprocess.h
@@ -28,14 +28,14 @@
 typedef struct gpr_subprocess gpr_subprocess;
 
 /** .exe on windows, empty on unices */
-GPRAPI const char *gpr_subprocess_binary_extension();
+GPRAPI const char* gpr_subprocess_binary_extension();
 
-GPRAPI gpr_subprocess *gpr_subprocess_create(int argc, const char **argv);
+GPRAPI gpr_subprocess* gpr_subprocess_create(int argc, const char** argv);
 /** if subprocess has not been joined, kill it */
-GPRAPI void gpr_subprocess_destroy(gpr_subprocess *p);
+GPRAPI void gpr_subprocess_destroy(gpr_subprocess* p);
 /** returns exit status; can be called at most once */
-GPRAPI int gpr_subprocess_join(gpr_subprocess *p);
-GPRAPI void gpr_subprocess_interrupt(gpr_subprocess *p);
+GPRAPI int gpr_subprocess_join(gpr_subprocess* p);
+GPRAPI void gpr_subprocess_interrupt(gpr_subprocess* p);
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/include/grpc/support/sync.h b/include/grpc/support/sync.h
index ddb8580..7519267 100644
--- a/include/grpc/support/sync.h
+++ b/include/grpc/support/sync.h
@@ -34,26 +34,26 @@
    gpr_mu are uninitialized when first declared.  */
 
 /** Initialize *mu.  Requires:  *mu uninitialized.  */
-GPRAPI void gpr_mu_init(gpr_mu *mu);
+GPRAPI void gpr_mu_init(gpr_mu* mu);
 
 /** Cause *mu no longer to be initialized, freeing any memory in use.  Requires:
-   *mu initialized; no other concurrent operation on *mu.  */
-GPRAPI void gpr_mu_destroy(gpr_mu *mu);
+ *mu initialized; no other concurrent operation on *mu.  */
+GPRAPI void gpr_mu_destroy(gpr_mu* mu);
 
 /** Wait until no thread has a lock on *mu, cause the calling thread to own an
    exclusive lock on *mu, then return.  May block indefinitely or crash if the
    calling thread has a lock on *mu.  Requires:  *mu initialized.  */
-GPRAPI void gpr_mu_lock(gpr_mu *mu);
+GPRAPI void gpr_mu_lock(gpr_mu* mu);
 
 /** Release an exclusive lock on *mu held by the calling thread.  Requires:  *mu
    initialized; the calling thread holds an exclusive lock on *mu.  */
-GPRAPI void gpr_mu_unlock(gpr_mu *mu);
+GPRAPI void gpr_mu_unlock(gpr_mu* mu);
 
 /** Without blocking, attempt to acquire an exclusive lock on *mu for the
    calling thread, then return non-zero iff success.  Fail, if any thread holds
    the lock; succeeds with high probability if no thread holds the lock.
    Requires:  *mu initialized.  */
-GPRAPI int gpr_mu_trylock(gpr_mu *mu);
+GPRAPI int gpr_mu_trylock(gpr_mu* mu);
 
 /** --- Condition variable interface ---
 
@@ -62,11 +62,11 @@
    uninitialized when first declared.  */
 
 /** Initialize *cv.  Requires:  *cv uninitialized.  */
-GPRAPI void gpr_cv_init(gpr_cv *cv);
+GPRAPI void gpr_cv_init(gpr_cv* cv);
 
 /** Cause *cv no longer to be initialized, freeing any memory in use.  Requires:
-   *cv initialized; no other concurrent operation on *cv.*/
-GPRAPI void gpr_cv_destroy(gpr_cv *cv);
+ *cv initialized; no other concurrent operation on *cv.*/
+GPRAPI void gpr_cv_destroy(gpr_cv* cv);
 
 /** Atomically release *mu and wait on *cv.  When the calling thread is woken
    from *cv or the deadline abs_deadline is exceeded, execute gpr_mu_lock(mu)
@@ -75,16 +75,16 @@
    an absolute deadline, or a GPR_TIMESPAN.  May return even when not
    woken explicitly.  Requires:  *mu and *cv initialized; the calling thread
    holds an exclusive lock on *mu.  */
-GPRAPI int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline);
+GPRAPI int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline);
 
 /** If any threads are waiting on *cv, wake at least one.
    Clients may treat this as an optimization of gpr_cv_broadcast()
    for use in the case where waking more than one waiter is not useful.
    Requires:  *cv initialized.  */
-GPRAPI void gpr_cv_signal(gpr_cv *cv);
+GPRAPI void gpr_cv_signal(gpr_cv* cv);
 
 /** Wake all threads waiting on *cv.  Requires:  *cv initialized.  */
-GPRAPI void gpr_cv_broadcast(gpr_cv *cv);
+GPRAPI void gpr_cv_broadcast(gpr_cv* cv);
 
 /** --- One-time initialization ---
 
@@ -97,7 +97,7 @@
    If multiple threads call gpr_once() on the same gpr_once instance, one of
    them will call (*init_routine)(), and the others will block until that call
    finishes.*/
-GPRAPI void gpr_once_init(gpr_once *once, void (*init_routine)(void));
+GPRAPI void gpr_once_init(gpr_once* once, void (*init_routine)(void));
 
 /** --- One-time event notification ---
 
@@ -107,51 +107,51 @@
   It requires no destruction.  */
 
 /** Initialize *ev. */
-GPRAPI void gpr_event_init(gpr_event *ev);
+GPRAPI void gpr_event_init(gpr_event* ev);
 
 /** Set *ev so that gpr_event_get() and gpr_event_wait() will return value.
    Requires:  *ev initialized; value != NULL; no prior or concurrent calls to
    gpr_event_set(ev, ...) since initialization.  */
-GPRAPI void gpr_event_set(gpr_event *ev, void *value);
+GPRAPI void gpr_event_set(gpr_event* ev, void* value);
 
 /** Return the value set by gpr_event_set(ev, ...), or NULL if no such call has
    completed.  If the result is non-NULL, all operations that occurred prior to
    the gpr_event_set(ev, ...) set will be visible after this call returns.
    Requires:  *ev initialized.  This operation is faster than acquiring a mutex
    on most platforms.  */
-GPRAPI void *gpr_event_get(gpr_event *ev);
+GPRAPI void* gpr_event_get(gpr_event* ev);
 
 /** Wait until *ev is set by gpr_event_set(ev, ...), or abs_deadline is
    exceeded, then return gpr_event_get(ev).  Requires:  *ev initialized.  Use
    abs_deadline==gpr_inf_future for no deadline.  When the event has been
    signalled before the call, this operation is faster than acquiring a mutex
    on most platforms.  */
-GPRAPI void *gpr_event_wait(gpr_event *ev, gpr_timespec abs_deadline);
+GPRAPI void* gpr_event_wait(gpr_event* ev, gpr_timespec abs_deadline);
 
 /** --- Reference counting ---
 
    These calls act on the type gpr_refcount.  It requires no destruction.  */
 
 /** Initialize *r to value n.  */
-GPRAPI void gpr_ref_init(gpr_refcount *r, int n);
+GPRAPI void gpr_ref_init(gpr_refcount* r, int n);
 
 /** Increment the reference count *r.  Requires *r initialized. */
-GPRAPI void gpr_ref(gpr_refcount *r);
+GPRAPI void gpr_ref(gpr_refcount* r);
 
 /** Increment the reference count *r.  Requires *r initialized.
    Crashes if refcount is zero */
-GPRAPI void gpr_ref_non_zero(gpr_refcount *r);
+GPRAPI void gpr_ref_non_zero(gpr_refcount* r);
 
 /** Increment the reference count *r by n.  Requires *r initialized, n > 0. */
-GPRAPI void gpr_refn(gpr_refcount *r, int n);
+GPRAPI void gpr_refn(gpr_refcount* r, int n);
 
 /** Decrement the reference count *r and return non-zero iff it has reached
    zero. .  Requires *r initialized. */
-GPRAPI int gpr_unref(gpr_refcount *r);
+GPRAPI int gpr_unref(gpr_refcount* r);
 
 /** Return non-zero iff the reference count of *r is one, and thus is owned
    by exactly one object. */
-GPRAPI int gpr_ref_is_unique(gpr_refcount *r);
+GPRAPI int gpr_ref_is_unique(gpr_refcount* r);
 
 /** --- Stats counters ---
 
@@ -162,13 +162,13 @@
    synchronize other events.  */
 
 /** Initialize *c to the value n. */
-GPRAPI void gpr_stats_init(gpr_stats_counter *c, intptr_t n);
+GPRAPI void gpr_stats_init(gpr_stats_counter* c, intptr_t n);
 
 /** *c += inc.  Requires: *c initialized. */
-GPRAPI void gpr_stats_inc(gpr_stats_counter *c, intptr_t inc);
+GPRAPI void gpr_stats_inc(gpr_stats_counter* c, intptr_t inc);
 
 /** Return *c.  Requires: *c initialized. */
-GPRAPI intptr_t gpr_stats_read(const gpr_stats_counter *c);
+GPRAPI intptr_t gpr_stats_read(const gpr_stats_counter* c);
 
 /** ==================Example use of interface===================
    A producer-consumer queue of up to N integers,
@@ -280,14 +280,14 @@
 
 class mu_guard {
  public:
-  mu_guard(gpr_mu *mu) : mu_(mu) { gpr_mu_lock(mu); }
+  mu_guard(gpr_mu* mu) : mu_(mu) { gpr_mu_lock(mu); }
   ~mu_guard() { gpr_mu_unlock(mu_); }
 
-  mu_guard(const mu_guard &) = delete;
-  mu_guard &operator=(const mu_guard &) = delete;
+  mu_guard(const mu_guard&) = delete;
+  mu_guard& operator=(const mu_guard&) = delete;
 
  private:
-  gpr_mu *const mu_;
+  gpr_mu* const mu_;
 };
 
 }  // namespace grpc_core
diff --git a/include/grpc/support/thd.h b/include/grpc/support/thd.h
index 25bd8f1..225d9d6 100644
--- a/include/grpc/support/thd.h
+++ b/include/grpc/support/thd.h
@@ -44,23 +44,23 @@
    in *t, and return true.  If there are insufficient resources, return false.
    If options==NULL, default options are used.
    The thread is immediately runnable, and exits when (*thd_body)() returns.  */
-GPRAPI int gpr_thd_new(gpr_thd_id *t, void (*thd_body)(void *arg), void *arg,
-                       const gpr_thd_options *options);
+GPRAPI int gpr_thd_new(gpr_thd_id* t, void (*thd_body)(void* arg), void* arg,
+                       const gpr_thd_options* options);
 
 /** Return a gpr_thd_options struct with all fields set to defaults. */
 GPRAPI gpr_thd_options gpr_thd_options_default(void);
 
 /** Set the thread to become detached on startup - this is the default. */
-GPRAPI void gpr_thd_options_set_detached(gpr_thd_options *options);
+GPRAPI void gpr_thd_options_set_detached(gpr_thd_options* options);
 
 /** Set the thread to become joinable - mutually exclusive with detached. */
-GPRAPI void gpr_thd_options_set_joinable(gpr_thd_options *options);
+GPRAPI void gpr_thd_options_set_joinable(gpr_thd_options* options);
 
 /** Returns non-zero if the option detached is set. */
-GPRAPI int gpr_thd_options_is_detached(const gpr_thd_options *options);
+GPRAPI int gpr_thd_options_is_detached(const gpr_thd_options* options);
 
 /** Returns non-zero if the option joinable is set. */
-GPRAPI int gpr_thd_options_is_joinable(const gpr_thd_options *options);
+GPRAPI int gpr_thd_options_is_joinable(const gpr_thd_options* options);
 
 /** Returns the identifier of the current thread. */
 GPRAPI gpr_thd_id gpr_thd_currentid(void);
diff --git a/include/grpc/support/tls_gcc.h b/include/grpc/support/tls_gcc.h
index e6d8c01..019acdf 100644
--- a/include/grpc/support/tls_gcc.h
+++ b/include/grpc/support/tls_gcc.h
@@ -30,7 +30,7 @@
 
 struct gpr_gcc_thread_local {
   intptr_t value;
-  bool *inited;
+  bool* inited;
 };
 
 #define GPR_TLS_DECL(name)           \
diff --git a/include/grpc/support/tls_pthread.h b/include/grpc/support/tls_pthread.h
index a68b455..fb0edd8 100644
--- a/include/grpc/support/tls_pthread.h
+++ b/include/grpc/support/tls_pthread.h
@@ -37,7 +37,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-intptr_t gpr_tls_set(struct gpr_pthread_thread_local *tls, intptr_t value);
+intptr_t gpr_tls_set(struct gpr_pthread_thread_local* tls, intptr_t value);
 #ifdef __cplusplus
 }
 #endif
diff --git a/package.json b/package.json
deleted file mode 100644
index a0f0ff1..0000000
--- a/package.json
+++ /dev/null
@@ -1,103 +0,0 @@
-{
-  "name": "grpc",
-  "version": "1.8.0-dev",
-  "author": "Google Inc.",
-  "description": "gRPC Library for Node",
-  "homepage": "https://grpc.io/",
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/grpc/grpc.git"
-  },
-  "bugs": "https://github.com/grpc/grpc/issues",
-  "contributors": [
-    {
-      "name": "Michael Lumish",
-      "email": "mlumish@google.com"
-    }
-  ],
-  "directories": {
-    "lib": "src/node/src"
-  },
-  "scripts": {
-    "lint": "node ./node_modules/jshint/bin/jshint src/node/src src/node/test src/node/interop src/node/index.js --exclude-path=src/node/.jshintignore",
-    "test": "./node_modules/.bin/mocha src/node/test && npm run-script lint",
-    "electron-build": "./node_modules/.bin/node-pre-gyp configure build --runtime=electron --disturl=https://atom.io/download/atom-shell",
-    "gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json",
-    "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test",
-    "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library"
-  },
-  "bundledDependencies": [
-    "node-pre-gyp"
-  ],
-  "dependencies": {
-    "arguejs": "^0.2.3",
-    "lodash": "^4.15.0",
-    "nan": "^2.0.0",
-    "node-pre-gyp": "^0.6.35",
-    "protobufjs": "^5.0.0"
-  },
-  "devDependencies": {
-    "async": "^2.0.1",
-    "body-parser": "^1.15.2",
-    "electron-mocha": "^3.1.1",
-    "express": "^4.14.0",
-    "google-auth-library": "^0.9.2",
-    "google-protobuf": "^3.0.0",
-    "istanbul": "^0.4.4",
-    "jsdoc": "^3.3.2",
-    "jshint": "^2.5.0",
-    "minimist": "^1.1.0",
-    "mocha": "^3.0.2",
-    "mocha-jenkins-reporter": "^0.2.3",
-    "poisson-process": "^0.2.1"
-  },
-  "engines": {
-    "node": ">=4"
-  },
-  "binary": {
-    "module_name": "grpc_node",
-    "module_path": "src/node/extension_binary/{node_abi}-{platform}-{arch}",
-    "host": "https://storage.googleapis.com/",
-    "remote_path": "grpc-precompiled-binaries/node/{name}/v{version}",
-    "package_name": "{node_abi}-{platform}-{arch}.tar.gz"
-  },
-  "files": [
-    "LICENSE",
-    "src/node/README.md",
-    "src/proto",
-    "etc",
-    "src/node/index.js",
-    "src/node/src",
-    "src/node/ext",
-    "include/grpc",
-    "src/core",
-    "src/boringssl",
-    "src/zlib",
-    "third_party/nanopb",
-    "third_party/zlib",
-    "third_party/boringssl",
-    "binding.gyp"
-  ],
-  "main": "src/node/index.js",
-  "license": "Apache-2.0",
-  "jshintConfig": {
-    "bitwise": true,
-    "curly": true,
-    "eqeqeq": true,
-    "esnext": true,
-    "freeze": true,
-    "immed": true,
-    "indent": 2,
-    "latedef": "nofunc",
-    "maxlen": 80,
-    "mocha": true,
-    "newcap": true,
-    "node": true,
-    "noarg": true,
-    "quotmark": "single",
-    "strict": true,
-    "trailing": true,
-    "undef": true,
-    "unused": "vars"
-  }
-}
diff --git a/package.xml b/package.xml
index d08b803..9dee62f 100644
--- a/package.xml
+++ b/package.xml
@@ -242,6 +242,7 @@
     <file baseinstalldir="/" name="src/core/tsi/transport_security_adapter.h" role="src" />
     <file baseinstalldir="/" name="src/core/tsi/transport_security_interface.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/chttp2_server.h" role="src" />
+    <file baseinstalldir="/" name="src/core/ext/filters/client_channel/backup_poller.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_factory.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/connector.h" role="src" />
@@ -395,28 +396,11 @@
     <file baseinstalldir="/" name="third_party/nanopb/pb_decode.h" role="src" />
     <file baseinstalldir="/" name="third_party/nanopb/pb_encode.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" role="src" />
+    <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/subchannel_list.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/load_reporting/server_load_reporting_filter.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/load_reporting/server_load_reporting_plugin.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/aggregation.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/base_resources.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/census_interface.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/census_rpc_stats.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/gen/census.pb.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/gen/trace_context.pb.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/grpc_filter.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/intrusive_hash_map.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/intrusive_hash_map_internal.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/mlog.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/resource.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/rpc_metric_id.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/trace_context.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/trace_label.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/trace_propagation.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/trace_status.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/trace_string.h" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/tracing.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.h" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h" role="src" />
@@ -615,6 +599,7 @@
     <file baseinstalldir="/" name="src/core/tsi/transport_security_adapter.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/chttp2_server.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc" role="src" />
+    <file baseinstalldir="/" name="src/core/ext/filters/client_channel/backup_poller.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/channel_connectivity.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_factory.cc" role="src" />
@@ -654,6 +639,7 @@
     <file baseinstalldir="/" name="third_party/nanopb/pb_encode.c" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc" role="src" />
+    <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc" role="src" />
@@ -663,21 +649,7 @@
     <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/load_reporting/server_load_reporting_filter.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/base_resources.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/context.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/gen/census.pb.c" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/gen/trace_context.pb.c" role="src" />
     <file baseinstalldir="/" name="src/core/ext/census/grpc_context.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/grpc_filter.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/grpc_plugin.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/initialize.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/intrusive_hash_map.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/mlog.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/operation.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/placeholders.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/resource.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/trace_context.cc" role="src" />
-    <file baseinstalldir="/" name="src/core/ext/census/tracing.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.cc" role="src" />
     <file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc" role="src" />
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index c2db8ef..3adf0fa 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -32,15 +32,15 @@
   return out.str();
 }
 
-inline bool ClientOnlyStreaming(const grpc_generator::Method *method) {
+inline bool ClientOnlyStreaming(const grpc_generator::Method* method) {
   return method->ClientStreaming() && !method->ServerStreaming();
 }
 
-inline bool ServerOnlyStreaming(const grpc_generator::Method *method) {
+inline bool ServerOnlyStreaming(const grpc_generator::Method* method) {
   return !method->ClientStreaming() && method->ServerStreaming();
 }
 
-grpc::string FilenameIdentifier(const grpc::string &filename) {
+grpc::string FilenameIdentifier(const grpc::string& filename) {
   grpc::string result;
   for (unsigned i = 0; i < filename.size(); i++) {
     char c = filename[i];
@@ -58,19 +58,19 @@
 }  // namespace
 
 template <class T, size_t N>
-T *array_end(T (&array)[N]) {
+T* array_end(T (&array)[N]) {
   return array + N;
 }
 
-void PrintIncludes(grpc_generator::Printer *printer,
-                   const std::vector<grpc::string> &headers,
-                   const Parameters &params) {
+void PrintIncludes(grpc_generator::Printer* printer,
+                   const std::vector<grpc::string>& headers,
+                   const Parameters& params) {
   std::map<grpc::string, grpc::string> vars;
 
   vars["l"] = params.use_system_headers ? '<' : '"';
   vars["r"] = params.use_system_headers ? '>' : '"';
 
-  auto &s = params.grpc_search_path;
+  auto& s = params.grpc_search_path;
   if (!s.empty()) {
     vars["l"] += s;
     if (s[s.size() - 1] != '/') {
@@ -84,8 +84,8 @@
   }
 }
 
-grpc::string GetHeaderPrologue(grpc_generator::File *file,
-                               const Parameters & /*params*/) {
+grpc::string GetHeaderPrologue(grpc_generator::File* file,
+                               const Parameters& /*params*/) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
@@ -116,15 +116,15 @@
   return output;
 }
 
-grpc::string GetHeaderIncludes(grpc_generator::File *file,
-                               const Parameters &params) {
+grpc::string GetHeaderIncludes(grpc_generator::File* file,
+                               const Parameters& params) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
     auto printer = file->CreatePrinter(&output);
     std::map<grpc::string, grpc::string> vars;
 
-    static const char *headers_strs[] = {
+    static const char* headers_strs[] = {
         "grpc++/impl/codegen/async_stream.h",
         "grpc++/impl/codegen/async_unary_call.h",
         "grpc++/impl/codegen/method_handler_impl.h",
@@ -140,7 +140,6 @@
     printer->Print(vars, "namespace grpc {\n");
     printer->Print(vars, "class CompletionQueue;\n");
     printer->Print(vars, "class Channel;\n");
-    printer->Print(vars, "class RpcService;\n");
     printer->Print(vars, "class ServerCompletionQueue;\n");
     printer->Print(vars, "class ServerContext;\n");
     printer->Print(vars, "}  // namespace grpc\n\n");
@@ -159,8 +158,8 @@
 }
 
 void PrintHeaderClientMethodInterfaces(
-    grpc_generator::Printer *printer, const grpc_generator::Method *method,
-    std::map<grpc::string, grpc::string> *vars, bool is_public) {
+    grpc_generator::Printer* printer, const grpc_generator::Method* method,
+    std::map<grpc::string, grpc::string>* vars, bool is_public) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
   (*vars)["Response"] = method->output_type_name();
@@ -324,7 +323,8 @@
     } else if (ServerOnlyStreaming(method)) {
       printer->Print(
           *vars,
-          "virtual ::grpc::ClientReaderInterface< $Response$>* $Method$Raw("
+          "virtual ::grpc::ClientReaderInterface< $Response$>* "
+          "$Method$Raw("
           "::grpc::ClientContext* context, const $Request$& request) = 0;\n");
       for (auto async_prefix : async_prefixes) {
         (*vars)["AsyncPrefix"] = async_prefix.prefix;
@@ -355,9 +355,9 @@
   }
 }
 
-void PrintHeaderClientMethod(grpc_generator::Printer *printer,
-                             const grpc_generator::Method *method,
-                             std::map<grpc::string, grpc::string> *vars,
+void PrintHeaderClientMethod(grpc_generator::Printer* printer,
+                             const grpc_generator::Method* method,
+                             std::map<grpc::string, grpc::string>* vars,
                              bool is_public) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
@@ -542,16 +542,17 @@
   }
 }
 
-void PrintHeaderClientMethodData(grpc_generator::Printer *printer,
-                                 const grpc_generator::Method *method,
-                                 std::map<grpc::string, grpc::string> *vars) {
+void PrintHeaderClientMethodData(grpc_generator::Printer* printer,
+                                 const grpc_generator::Method* method,
+                                 std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Method"] = method->name();
-  printer->Print(*vars, "const ::grpc::RpcMethod rpcmethod_$Method$_;\n");
+  printer->Print(*vars,
+                 "const ::grpc::internal::RpcMethod rpcmethod_$Method$_;\n");
 }
 
-void PrintHeaderServerMethodSync(grpc_generator::Printer *printer,
-                                 const grpc_generator::Method *method,
-                                 std::map<grpc::string, grpc::string> *vars) {
+void PrintHeaderServerMethodSync(grpc_generator::Printer* printer,
+                                 const grpc_generator::Method* method,
+                                 std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
   (*vars)["Response"] = method->output_type_name();
@@ -583,9 +584,9 @@
   printer->Print(method->GetTrailingComments("//").c_str());
 }
 
-void PrintHeaderServerMethodAsync(grpc_generator::Printer *printer,
-                                  const grpc_generator::Method *method,
-                                  std::map<grpc::string, grpc::string> *vars) {
+void PrintHeaderServerMethodAsync(grpc_generator::Printer* printer,
+                                  const grpc_generator::Method* method,
+                                  std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
   (*vars)["Response"] = method->output_type_name();
@@ -699,8 +700,8 @@
 }
 
 void PrintHeaderServerMethodStreamedUnary(
-    grpc_generator::Printer *printer, const grpc_generator::Method *method,
-    std::map<grpc::string, grpc::string> *vars) {
+    grpc_generator::Printer* printer, const grpc_generator::Method* method,
+    std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
   (*vars)["Response"] = method->output_type_name();
@@ -718,7 +719,7 @@
     printer->Print(*vars,
                    "WithStreamedUnaryMethod_$Method$() {\n"
                    "  ::grpc::Service::MarkMethodStreamed($Idx$,\n"
-                   "    new ::grpc::StreamedUnaryHandler< $Request$, "
+                   "    new ::grpc::internal::StreamedUnaryHandler< $Request$, "
                    "$Response$>(std::bind"
                    "(&WithStreamedUnaryMethod_$Method$<BaseClass>::"
                    "Streamed$Method$, this, std::placeholders::_1, "
@@ -750,8 +751,8 @@
 }
 
 void PrintHeaderServerMethodSplitStreaming(
-    grpc_generator::Printer *printer, const grpc_generator::Method *method,
-    std::map<grpc::string, grpc::string> *vars) {
+    grpc_generator::Printer* printer, const grpc_generator::Method* method,
+    std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
   (*vars)["Response"] = method->output_type_name();
@@ -766,15 +767,16 @@
         "{}\n");
     printer->Print(" public:\n");
     printer->Indent();
-    printer->Print(*vars,
-                   "WithSplitStreamingMethod_$Method$() {\n"
-                   "  ::grpc::Service::MarkMethodStreamed($Idx$,\n"
-                   "    new ::grpc::SplitServerStreamingHandler< $Request$, "
-                   "$Response$>(std::bind"
-                   "(&WithSplitStreamingMethod_$Method$<BaseClass>::"
-                   "Streamed$Method$, this, std::placeholders::_1, "
-                   "std::placeholders::_2)));\n"
-                   "}\n");
+    printer->Print(
+        *vars,
+        "WithSplitStreamingMethod_$Method$() {\n"
+        "  ::grpc::Service::MarkMethodStreamed($Idx$,\n"
+        "    new ::grpc::internal::SplitServerStreamingHandler< $Request$, "
+        "$Response$>(std::bind"
+        "(&WithSplitStreamingMethod_$Method$<BaseClass>::"
+        "Streamed$Method$, this, std::placeholders::_1, "
+        "std::placeholders::_2)));\n"
+        "}\n");
     printer->Print(*vars,
                    "~WithSplitStreamingMethod_$Method$() override {\n"
                    "  BaseClassMustBeDerivedFromService(this);\n"
@@ -802,8 +804,8 @@
 }
 
 void PrintHeaderServerMethodGeneric(
-    grpc_generator::Printer *printer, const grpc_generator::Method *method,
-    std::map<grpc::string, grpc::string> *vars) {
+    grpc_generator::Printer* printer, const grpc_generator::Method* method,
+    std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
   (*vars)["Response"] = method->output_type_name();
@@ -871,9 +873,9 @@
   printer->Print(*vars, "};\n");
 }
 
-void PrintHeaderService(grpc_generator::Printer *printer,
-                        const grpc_generator::Service *service,
-                        std::map<grpc::string, grpc::string> *vars) {
+void PrintHeaderService(grpc_generator::Printer* printer,
+                        const grpc_generator::Service* service,
+                        std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Service"] = service->name();
 
   printer->Print(service->GetLeadingComments("//").c_str());
@@ -914,7 +916,8 @@
       " {\n public:\n");
   printer->Indent();
   printer->Print(
-      "Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel);\n");
+      "Stub(const std::shared_ptr< ::grpc::ChannelInterface>& "
+      "channel);\n");
   for (int i = 0; i < service->method_count(); ++i) {
     PrintHeaderClientMethod(printer, service->method(i).get(), vars, true);
   }
@@ -1047,8 +1050,8 @@
   printer->Print(service->GetTrailingComments("//").c_str());
 }
 
-grpc::string GetHeaderServices(grpc_generator::File *file,
-                               const Parameters &params) {
+grpc::string GetHeaderServices(grpc_generator::File* file,
+                               const Parameters& params) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
@@ -1078,8 +1081,8 @@
   return output;
 }
 
-grpc::string GetHeaderEpilogue(grpc_generator::File *file,
-                               const Parameters & /*params*/) {
+grpc::string GetHeaderEpilogue(grpc_generator::File* file,
+                               const Parameters& /*params*/) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
@@ -1107,8 +1110,8 @@
   return output;
 }
 
-grpc::string GetSourcePrologue(grpc_generator::File *file,
-                               const Parameters & /*params*/) {
+grpc::string GetSourcePrologue(grpc_generator::File* file,
+                               const Parameters& /*params*/) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
@@ -1132,15 +1135,15 @@
   return output;
 }
 
-grpc::string GetSourceIncludes(grpc_generator::File *file,
-                               const Parameters &params) {
+grpc::string GetSourceIncludes(grpc_generator::File* file,
+                               const Parameters& params) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
     auto printer = file->CreatePrinter(&output);
     std::map<grpc::string, grpc::string> vars;
 
-    static const char *headers_strs[] = {
+    static const char* headers_strs[] = {
         "grpc++/impl/codegen/async_stream.h",
         "grpc++/impl/codegen/async_unary_call.h",
         "grpc++/impl/codegen/channel_interface.h",
@@ -1166,9 +1169,9 @@
   return output;
 }
 
-void PrintSourceClientMethod(grpc_generator::Printer *printer,
-                             const grpc_generator::Method *method,
-                             std::map<grpc::string, grpc::string> *vars) {
+void PrintSourceClientMethod(grpc_generator::Printer* printer,
+                             const grpc_generator::Method* method,
+                             std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
   (*vars)["Response"] = method->output_type_name();
@@ -1185,10 +1188,9 @@
                    "::grpc::ClientContext* context, "
                    "const $Request$& request, $Response$* response) {\n");
     printer->Print(*vars,
-                   "  return ::grpc::BlockingUnaryCall(channel_.get(), "
-                   "rpcmethod_$Method$_, "
-                   "context, request, response);\n"
-                   "}\n\n");
+                   "  return ::grpc::internal::BlockingUnaryCall"
+                   "(channel_.get(), rpcmethod_$Method$_, "
+                   "context, request, response);\n}\n\n");
     for (auto async_prefix : async_prefixes) {
       (*vars)["AsyncPrefix"] = async_prefix.prefix;
       (*vars)["AsyncStart"] = async_prefix.start;
@@ -1198,25 +1200,27 @@
                      "ClientContext* context, "
                      "const $Request$& request, "
                      "::grpc::CompletionQueue* cq) {\n");
-      printer->Print(*vars,
-                     "  return "
-                     "::grpc::ClientAsyncResponseReader< $Response$>::Create("
-                     "channel_.get(), cq, "
-                     "rpcmethod_$Method$_, "
-                     "context, request, $AsyncStart$);\n"
-                     "}\n\n");
+      printer->Print(
+          *vars,
+          "  return "
+          "::grpc::internal::ClientAsyncResponseReaderFactory< $Response$>"
+          "::Create(channel_.get(), cq, "
+          "rpcmethod_$Method$_, "
+          "context, request, $AsyncStart$);\n"
+          "}\n\n");
     }
   } else if (ClientOnlyStreaming(method)) {
     printer->Print(*vars,
                    "::grpc::ClientWriter< $Request$>* "
                    "$ns$$Service$::Stub::$Method$Raw("
                    "::grpc::ClientContext* context, $Response$* response) {\n");
-    printer->Print(*vars,
-                   "  return new ::grpc::ClientWriter< $Request$>("
-                   "channel_.get(), "
-                   "rpcmethod_$Method$_, "
-                   "context, response);\n"
-                   "}\n\n");
+    printer->Print(
+        *vars,
+        "  return ::grpc::internal::ClientWriterFactory< $Request$>::Create("
+        "channel_.get(), "
+        "rpcmethod_$Method$_, "
+        "context, response);\n"
+        "}\n\n");
     for (auto async_prefix : async_prefixes) {
       (*vars)["AsyncPrefix"] = async_prefix.prefix;
       (*vars)["AsyncStart"] = async_prefix.start;
@@ -1227,12 +1231,13 @@
                      "$ns$$Service$::Stub::$AsyncPrefix$$Method$Raw("
                      "::grpc::ClientContext* context, $Response$* response, "
                      "::grpc::CompletionQueue* cq$AsyncMethodParams$) {\n");
-      printer->Print(*vars,
-                     "  return ::grpc::ClientAsyncWriter< $Request$>::Create("
-                     "channel_.get(), cq, "
-                     "rpcmethod_$Method$_, "
-                     "context, response, $AsyncStart$$AsyncCreateArgs$);\n"
-                     "}\n\n");
+      printer->Print(
+          *vars,
+          "  return ::grpc::internal::ClientAsyncWriterFactory< $Request$>"
+          "::Create(channel_.get(), cq, "
+          "rpcmethod_$Method$_, "
+          "context, response, $AsyncStart$$AsyncCreateArgs$);\n"
+          "}\n\n");
     }
   } else if (ServerOnlyStreaming(method)) {
     printer->Print(
@@ -1240,12 +1245,13 @@
         "::grpc::ClientReader< $Response$>* "
         "$ns$$Service$::Stub::$Method$Raw("
         "::grpc::ClientContext* context, const $Request$& request) {\n");
-    printer->Print(*vars,
-                   "  return new ::grpc::ClientReader< $Response$>("
-                   "channel_.get(), "
-                   "rpcmethod_$Method$_, "
-                   "context, request);\n"
-                   "}\n\n");
+    printer->Print(
+        *vars,
+        "  return ::grpc::internal::ClientReaderFactory< $Response$>::Create("
+        "channel_.get(), "
+        "rpcmethod_$Method$_, "
+        "context, request);\n"
+        "}\n\n");
     for (auto async_prefix : async_prefixes) {
       (*vars)["AsyncPrefix"] = async_prefix.prefix;
       (*vars)["AsyncStart"] = async_prefix.start;
@@ -1257,12 +1263,13 @@
           "$ns$$Service$::Stub::$AsyncPrefix$$Method$Raw("
           "::grpc::ClientContext* context, const $Request$& request, "
           "::grpc::CompletionQueue* cq$AsyncMethodParams$) {\n");
-      printer->Print(*vars,
-                     "  return ::grpc::ClientAsyncReader< $Response$>::Create("
-                     "channel_.get(), cq, "
-                     "rpcmethod_$Method$_, "
-                     "context, request, $AsyncStart$$AsyncCreateArgs$);\n"
-                     "}\n\n");
+      printer->Print(
+          *vars,
+          "  return ::grpc::internal::ClientAsyncReaderFactory< $Response$>"
+          "::Create(channel_.get(), cq, "
+          "rpcmethod_$Method$_, "
+          "context, request, $AsyncStart$$AsyncCreateArgs$);\n"
+          "}\n\n");
     }
   } else if (method->BidiStreaming()) {
     printer->Print(
@@ -1270,8 +1277,8 @@
         "::grpc::ClientReaderWriter< $Request$, $Response$>* "
         "$ns$$Service$::Stub::$Method$Raw(::grpc::ClientContext* context) {\n");
     printer->Print(*vars,
-                   "  return new ::grpc::ClientReaderWriter< "
-                   "$Request$, $Response$>("
+                   "  return ::grpc::internal::ClientReaderWriterFactory< "
+                   "$Request$, $Response$>::Create("
                    "channel_.get(), "
                    "rpcmethod_$Method$_, "
                    "context);\n"
@@ -1286,21 +1293,21 @@
                      "$ns$$Service$::Stub::$AsyncPrefix$$Method$Raw(::grpc::"
                      "ClientContext* context, "
                      "::grpc::CompletionQueue* cq$AsyncMethodParams$) {\n");
-      printer->Print(
-          *vars,
-          "  return "
-          "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>::Create("
-          "channel_.get(), cq, "
-          "rpcmethod_$Method$_, "
-          "context, $AsyncStart$$AsyncCreateArgs$);\n"
-          "}\n\n");
+      printer->Print(*vars,
+                     "  return "
+                     "::grpc::internal::ClientAsyncReaderWriterFactory< "
+                     "$Request$, $Response$>::Create("
+                     "channel_.get(), cq, "
+                     "rpcmethod_$Method$_, "
+                     "context, $AsyncStart$$AsyncCreateArgs$);\n"
+                     "}\n\n");
     }
   }
 }
 
-void PrintSourceServerMethod(grpc_generator::Printer *printer,
-                             const grpc_generator::Method *method,
-                             std::map<grpc::string, grpc::string> *vars) {
+void PrintSourceServerMethod(grpc_generator::Printer* printer,
+                             const grpc_generator::Method* method,
+                             std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
   (*vars)["Response"] = method->output_type_name();
@@ -1357,9 +1364,9 @@
   }
 }
 
-void PrintSourceService(grpc_generator::Printer *printer,
-                        const grpc_generator::Service *service,
-                        std::map<grpc::string, grpc::string> *vars) {
+void PrintSourceService(grpc_generator::Printer* printer,
+                        const grpc_generator::Service* service,
+                        std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Service"] = service->name();
 
   if (service->method_count() > 0) {
@@ -1404,7 +1411,7 @@
     printer->Print(*vars,
                    ", rpcmethod_$Method$_("
                    "$prefix$$Service$_method_names[$Idx$], "
-                   "::grpc::RpcMethod::$StreamingType$, "
+                   "::grpc::internal::RpcMethod::$StreamingType$, "
                    "channel"
                    ")\n");
   }
@@ -1427,38 +1434,38 @@
     if (method->NoStreaming()) {
       printer->Print(
           *vars,
-          "AddMethod(new ::grpc::RpcServiceMethod(\n"
+          "AddMethod(new ::grpc::internal::RpcServiceMethod(\n"
           "    $prefix$$Service$_method_names[$Idx$],\n"
-          "    ::grpc::RpcMethod::NORMAL_RPC,\n"
-          "    new ::grpc::RpcMethodHandler< $ns$$Service$::Service, "
+          "    ::grpc::internal::RpcMethod::NORMAL_RPC,\n"
+          "    new ::grpc::internal::RpcMethodHandler< $ns$$Service$::Service, "
           "$Request$, "
           "$Response$>(\n"
           "        std::mem_fn(&$ns$$Service$::Service::$Method$), this)));\n");
     } else if (ClientOnlyStreaming(method.get())) {
       printer->Print(
           *vars,
-          "AddMethod(new ::grpc::RpcServiceMethod(\n"
+          "AddMethod(new ::grpc::internal::RpcServiceMethod(\n"
           "    $prefix$$Service$_method_names[$Idx$],\n"
-          "    ::grpc::RpcMethod::CLIENT_STREAMING,\n"
-          "    new ::grpc::ClientStreamingHandler< "
+          "    ::grpc::internal::RpcMethod::CLIENT_STREAMING,\n"
+          "    new ::grpc::internal::ClientStreamingHandler< "
           "$ns$$Service$::Service, $Request$, $Response$>(\n"
           "        std::mem_fn(&$ns$$Service$::Service::$Method$), this)));\n");
     } else if (ServerOnlyStreaming(method.get())) {
       printer->Print(
           *vars,
-          "AddMethod(new ::grpc::RpcServiceMethod(\n"
+          "AddMethod(new ::grpc::internal::RpcServiceMethod(\n"
           "    $prefix$$Service$_method_names[$Idx$],\n"
-          "    ::grpc::RpcMethod::SERVER_STREAMING,\n"
-          "    new ::grpc::ServerStreamingHandler< "
+          "    ::grpc::internal::RpcMethod::SERVER_STREAMING,\n"
+          "    new ::grpc::internal::ServerStreamingHandler< "
           "$ns$$Service$::Service, $Request$, $Response$>(\n"
           "        std::mem_fn(&$ns$$Service$::Service::$Method$), this)));\n");
     } else if (method->BidiStreaming()) {
       printer->Print(
           *vars,
-          "AddMethod(new ::grpc::RpcServiceMethod(\n"
+          "AddMethod(new ::grpc::internal::RpcServiceMethod(\n"
           "    $prefix$$Service$_method_names[$Idx$],\n"
-          "    ::grpc::RpcMethod::BIDI_STREAMING,\n"
-          "    new ::grpc::BidiStreamingHandler< "
+          "    ::grpc::internal::RpcMethod::BIDI_STREAMING,\n"
+          "    new ::grpc::internal::BidiStreamingHandler< "
           "$ns$$Service$::Service, $Request$, $Response$>(\n"
           "        std::mem_fn(&$ns$$Service$::Service::$Method$), this)));\n");
     }
@@ -1474,8 +1481,8 @@
   }
 }
 
-grpc::string GetSourceServices(grpc_generator::File *file,
-                               const Parameters &params) {
+grpc::string GetSourceServices(grpc_generator::File* file,
+                               const Parameters& params) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
@@ -1503,8 +1510,8 @@
   return output;
 }
 
-grpc::string GetSourceEpilogue(grpc_generator::File *file,
-                               const Parameters & /*params*/) {
+grpc::string GetSourceEpilogue(grpc_generator::File* file,
+                               const Parameters& /*params*/) {
   grpc::string temp;
 
   if (!file->package().empty()) {
@@ -1522,8 +1529,8 @@
 }
 
 // TODO(mmukhi): Make sure we need parameters or not.
-grpc::string GetMockPrologue(grpc_generator::File *file,
-                             const Parameters & /*params*/) {
+grpc::string GetMockPrologue(grpc_generator::File* file,
+                             const Parameters& /*params*/) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
@@ -1549,17 +1556,18 @@
 }
 
 // TODO(mmukhi): Add client-stream and completion-queue headers.
-grpc::string GetMockIncludes(grpc_generator::File *file,
-                             const Parameters &params) {
+grpc::string GetMockIncludes(grpc_generator::File* file,
+                             const Parameters& params) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
     auto printer = file->CreatePrinter(&output);
     std::map<grpc::string, grpc::string> vars;
 
-    static const char *headers_strs[] = {
+    static const char* headers_strs[] = {
         "grpc++/impl/codegen/async_stream.h",
-        "grpc++/impl/codegen/sync_stream.h", "gmock/gmock.h",
+        "grpc++/impl/codegen/sync_stream.h",
+        "gmock/gmock.h",
     };
     std::vector<grpc::string> headers(headers_strs, array_end(headers_strs));
     PrintIncludes(printer.get(), headers, params);
@@ -1578,9 +1586,9 @@
   return output;
 }
 
-void PrintMockClientMethods(grpc_generator::Printer *printer,
-                            const grpc_generator::Method *method,
-                            std::map<grpc::string, grpc::string> *vars) {
+void PrintMockClientMethods(grpc_generator::Printer* printer,
+                            const grpc_generator::Method* method,
+                            std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] = method->input_type_name();
   (*vars)["Response"] = method->output_type_name();
@@ -1661,9 +1669,9 @@
   }
 }
 
-void PrintMockService(grpc_generator::Printer *printer,
-                      const grpc_generator::Service *service,
-                      std::map<grpc::string, grpc::string> *vars) {
+void PrintMockService(grpc_generator::Printer* printer,
+                      const grpc_generator::Service* service,
+                      std::map<grpc::string, grpc::string>* vars) {
   (*vars)["Service"] = service->name();
 
   printer->Print(*vars,
@@ -1677,8 +1685,8 @@
   printer->Print("};\n");
 }
 
-grpc::string GetMockServices(grpc_generator::File *file,
-                             const Parameters &params) {
+grpc::string GetMockServices(grpc_generator::File* file,
+                             const Parameters& params) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
@@ -1708,8 +1716,8 @@
   return output;
 }
 
-grpc::string GetMockEpilogue(grpc_generator::File *file,
-                             const Parameters & /*params*/) {
+grpc::string GetMockEpilogue(grpc_generator::File* file,
+                             const Parameters& /*params*/) {
   grpc::string temp;
 
   if (!file->package().empty()) {
diff --git a/src/compiler/cpp_generator.h b/src/compiler/cpp_generator.h
index 73f9fc6..a93376a 100644
--- a/src/compiler/cpp_generator.h
+++ b/src/compiler/cpp_generator.h
@@ -55,68 +55,68 @@
 };
 
 // Return the prologue of the generated header file.
-grpc::string GetHeaderPrologue(grpc_generator::File *file,
-                               const Parameters &params);
+grpc::string GetHeaderPrologue(grpc_generator::File* file,
+                               const Parameters& params);
 
 // Return the includes needed for generated header file.
-grpc::string GetHeaderIncludes(grpc_generator::File *file,
-                               const Parameters &params);
+grpc::string GetHeaderIncludes(grpc_generator::File* file,
+                               const Parameters& params);
 
 // Return the includes needed for generated source file.
-grpc::string GetSourceIncludes(grpc_generator::File *file,
-                               const Parameters &params);
+grpc::string GetSourceIncludes(grpc_generator::File* file,
+                               const Parameters& params);
 
 // Return the epilogue of the generated header file.
-grpc::string GetHeaderEpilogue(grpc_generator::File *file,
-                               const Parameters &params);
+grpc::string GetHeaderEpilogue(grpc_generator::File* file,
+                               const Parameters& params);
 
 // Return the prologue of the generated source file.
-grpc::string GetSourcePrologue(grpc_generator::File *file,
-                               const Parameters &params);
+grpc::string GetSourcePrologue(grpc_generator::File* file,
+                               const Parameters& params);
 
 // Return the services for generated header file.
-grpc::string GetHeaderServices(grpc_generator::File *file,
-                               const Parameters &params);
+grpc::string GetHeaderServices(grpc_generator::File* file,
+                               const Parameters& params);
 
 // Return the services for generated source file.
-grpc::string GetSourceServices(grpc_generator::File *file,
-                               const Parameters &params);
+grpc::string GetSourceServices(grpc_generator::File* file,
+                               const Parameters& params);
 
 // Return the epilogue of the generated source file.
-grpc::string GetSourceEpilogue(grpc_generator::File *file,
-                               const Parameters &params);
+grpc::string GetSourceEpilogue(grpc_generator::File* file,
+                               const Parameters& params);
 
 // Return the prologue of the generated mock file.
-grpc::string GetMockPrologue(grpc_generator::File *file,
-                             const Parameters &params);
+grpc::string GetMockPrologue(grpc_generator::File* file,
+                             const Parameters& params);
 
 // Return the includes needed for generated mock file.
-grpc::string GetMockIncludes(grpc_generator::File *file,
-                             const Parameters &params);
+grpc::string GetMockIncludes(grpc_generator::File* file,
+                             const Parameters& params);
 
 // Return the services for generated mock file.
-grpc::string GetMockServices(grpc_generator::File *file,
-                             const Parameters &params);
+grpc::string GetMockServices(grpc_generator::File* file,
+                             const Parameters& params);
 
 // Return the epilogue of generated mock file.
-grpc::string GetMockEpilogue(grpc_generator::File *file,
-                             const Parameters &params);
+grpc::string GetMockEpilogue(grpc_generator::File* file,
+                             const Parameters& params);
 
 // Return the prologue of the generated mock file.
-grpc::string GetMockPrologue(grpc_generator::File *file,
-                             const Parameters &params);
+grpc::string GetMockPrologue(grpc_generator::File* file,
+                             const Parameters& params);
 
 // Return the includes needed for generated mock file.
-grpc::string GetMockIncludes(grpc_generator::File *file,
-                             const Parameters &params);
+grpc::string GetMockIncludes(grpc_generator::File* file,
+                             const Parameters& params);
 
 // Return the services for generated mock file.
-grpc::string GetMockServices(grpc_generator::File *file,
-                             const Parameters &params);
+grpc::string GetMockServices(grpc_generator::File* file,
+                             const Parameters& params);
 
 // Return the epilogue of generated mock file.
-grpc::string GetMockEpilogue(grpc_generator::File *file,
-                             const Parameters &params);
+grpc::string GetMockEpilogue(grpc_generator::File* file,
+                             const Parameters& params);
 
 }  // namespace grpc_cpp_generator
 
diff --git a/src/compiler/cpp_generator_helpers.h b/src/compiler/cpp_generator_helpers.h
index 28606d4..b8efcbd 100644
--- a/src/compiler/cpp_generator_helpers.h
+++ b/src/compiler/cpp_generator_helpers.h
@@ -26,22 +26,22 @@
 
 namespace grpc_cpp_generator {
 
-inline grpc::string DotsToColons(const grpc::string &name) {
+inline grpc::string DotsToColons(const grpc::string& name) {
   return grpc_generator::StringReplace(name, ".", "::");
 }
 
-inline grpc::string DotsToUnderscores(const grpc::string &name) {
+inline grpc::string DotsToUnderscores(const grpc::string& name) {
   return grpc_generator::StringReplace(name, ".", "_");
 }
 
-inline grpc::string ClassName(const grpc::protobuf::Descriptor *descriptor,
+inline grpc::string ClassName(const grpc::protobuf::Descriptor* descriptor,
                               bool qualified) {
   // Find "outer", the descriptor of the top-level message in which
   // "descriptor" is embedded.
-  const grpc::protobuf::Descriptor *outer = descriptor;
+  const grpc::protobuf::Descriptor* outer = descriptor;
   while (outer->containing_type() != NULL) outer = outer->containing_type();
 
-  const grpc::string &outer_name = outer->full_name();
+  const grpc::string& outer_name = outer->full_name();
   grpc::string inner_name = descriptor->full_name().substr(outer_name.size());
 
   if (qualified) {
@@ -54,7 +54,7 @@
 // Get leading or trailing comments in a string. Comment lines start with "// ".
 // Leading detached comments are put in in front of leading comments.
 template <typename DescriptorType>
-inline grpc::string GetCppComments(const DescriptorType *desc, bool leading) {
+inline grpc::string GetCppComments(const DescriptorType* desc, bool leading) {
   return grpc_generator::GetPrefixedComments(desc, leading, "//");
 }
 
diff --git a/src/compiler/cpp_plugin.cc b/src/compiler/cpp_plugin.cc
index ebe3aa3..adac0e2 100644
--- a/src/compiler/cpp_plugin.cc
+++ b/src/compiler/cpp_plugin.cc
@@ -33,10 +33,10 @@
   CppGrpcGenerator() {}
   virtual ~CppGrpcGenerator() {}
 
-  virtual bool Generate(const grpc::protobuf::FileDescriptor *file,
-                        const grpc::string &parameter,
-                        grpc::protobuf::compiler::GeneratorContext *context,
-                        grpc::string *error) const {
+  virtual bool Generate(const grpc::protobuf::FileDescriptor* file,
+                        const grpc::string& parameter,
+                        grpc::protobuf::compiler::GeneratorContext* context,
+                        grpc::string* error) const {
     if (file->options().cc_generic_services()) {
       *error =
           "cpp grpc proto compiler plugin does not work with generic "
@@ -125,9 +125,9 @@
 
  private:
   // Insert the given code into the given file at the given insertion point.
-  void Insert(grpc::protobuf::compiler::GeneratorContext *context,
-              const grpc::string &filename, const grpc::string &insertion_point,
-              const grpc::string &code) const {
+  void Insert(grpc::protobuf::compiler::GeneratorContext* context,
+              const grpc::string& filename, const grpc::string& insertion_point,
+              const grpc::string& code) const {
     std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> output(
         context->OpenForInsert(filename, insertion_point));
     grpc::protobuf::io::CodedOutputStream coded_out(output.get());
@@ -135,7 +135,7 @@
   }
 };
 
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
   CppGrpcGenerator generator;
   return grpc::protobuf::compiler::PluginMain(argc, argv, &generator);
 }
diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc
index bc3b0f2..e0957bf 100644
--- a/src/compiler/csharp_generator.cc
+++ b/src/compiler/csharp_generator.cc
@@ -23,24 +23,23 @@
 
 #include "src/compiler/config.h"
 #include "src/compiler/csharp_generator.h"
-#include "src/compiler/csharp_generator.h"
 #include "src/compiler/csharp_generator_helpers.h"
 
-using google::protobuf::compiler::csharp::GetFileNamespace;
 using google::protobuf::compiler::csharp::GetClassName;
+using google::protobuf::compiler::csharp::GetFileNamespace;
 using google::protobuf::compiler::csharp::GetReflectionClassName;
-using grpc::protobuf::FileDescriptor;
 using grpc::protobuf::Descriptor;
-using grpc::protobuf::ServiceDescriptor;
+using grpc::protobuf::FileDescriptor;
 using grpc::protobuf::MethodDescriptor;
+using grpc::protobuf::ServiceDescriptor;
 using grpc::protobuf::io::Printer;
 using grpc::protobuf::io::StringOutputStream;
-using grpc_generator::MethodType;
 using grpc_generator::GetMethodType;
-using grpc_generator::METHODTYPE_NO_STREAMING;
-using grpc_generator::METHODTYPE_CLIENT_STREAMING;
-using grpc_generator::METHODTYPE_SERVER_STREAMING;
 using grpc_generator::METHODTYPE_BIDI_STREAMING;
+using grpc_generator::METHODTYPE_CLIENT_STREAMING;
+using grpc_generator::METHODTYPE_NO_STREAMING;
+using grpc_generator::METHODTYPE_SERVER_STREAMING;
+using grpc_generator::MethodType;
 using grpc_generator::StringReplace;
 using std::map;
 using std::vector;
@@ -53,7 +52,7 @@
 // Currently, we cannot easily reuse the functionality as
 // google/protobuf/compiler/csharp/csharp_doc_comment.h is not a public header.
 // TODO(jtattermusch): reuse the functionality from google/protobuf.
-bool GenerateDocCommentBodyImpl(grpc::protobuf::io::Printer *printer,
+bool GenerateDocCommentBodyImpl(grpc::protobuf::io::Printer* printer,
                                 grpc::protobuf::SourceLocation location) {
   grpc::string comments = location.leading_comments.empty()
                               ? location.trailing_comments
@@ -100,8 +99,8 @@
 }
 
 template <typename DescriptorType>
-bool GenerateDocCommentBody(grpc::protobuf::io::Printer *printer,
-                            const DescriptorType *descriptor) {
+bool GenerateDocCommentBody(grpc::protobuf::io::Printer* printer,
+                            const DescriptorType* descriptor) {
   grpc::protobuf::SourceLocation location;
   if (!descriptor->GetSourceLocation(&location)) {
     return false;
@@ -109,8 +108,8 @@
   return GenerateDocCommentBodyImpl(printer, location);
 }
 
-void GenerateDocCommentServerMethod(grpc::protobuf::io::Printer *printer,
-                                    const MethodDescriptor *method) {
+void GenerateDocCommentServerMethod(grpc::protobuf::io::Printer* printer,
+                                    const MethodDescriptor* method) {
   if (GenerateDocCommentBody(printer, method)) {
     if (method->client_streaming()) {
       printer->Print(
@@ -141,8 +140,8 @@
   }
 }
 
-void GenerateDocCommentClientMethod(grpc::protobuf::io::Printer *printer,
-                                    const MethodDescriptor *method,
+void GenerateDocCommentClientMethod(grpc::protobuf::io::Printer* printer,
+                                    const MethodDescriptor* method,
                                     bool is_sync, bool use_call_options) {
   if (GenerateDocCommentBody(printer, method)) {
     if (!method->client_streaming()) {
@@ -173,15 +172,15 @@
   }
 }
 
-std::string GetServiceClassName(const ServiceDescriptor *service) {
+std::string GetServiceClassName(const ServiceDescriptor* service) {
   return service->name();
 }
 
-std::string GetClientClassName(const ServiceDescriptor *service) {
+std::string GetClientClassName(const ServiceDescriptor* service) {
   return service->name() + "Client";
 }
 
-std::string GetServerClassName(const ServiceDescriptor *service) {
+std::string GetServerClassName(const ServiceDescriptor* service) {
   return service->name() + "Base";
 }
 
@@ -202,15 +201,15 @@
 
 std::string GetServiceNameFieldName() { return "__ServiceName"; }
 
-std::string GetMarshallerFieldName(const Descriptor *message) {
+std::string GetMarshallerFieldName(const Descriptor* message) {
   return "__Marshaller_" + message->name();
 }
 
-std::string GetMethodFieldName(const MethodDescriptor *method) {
+std::string GetMethodFieldName(const MethodDescriptor* method) {
   return "__Method_" + method->name();
 }
 
-std::string GetMethodRequestParamMaybe(const MethodDescriptor *method,
+std::string GetMethodRequestParamMaybe(const MethodDescriptor* method,
                                        bool invocation_param = false) {
   if (method->client_streaming()) {
     return "";
@@ -225,7 +224,7 @@
   return internal_access ? "internal" : "public";
 }
 
-std::string GetMethodReturnTypeClient(const MethodDescriptor *method) {
+std::string GetMethodReturnTypeClient(const MethodDescriptor* method) {
   switch (GetMethodType(method)) {
     case METHODTYPE_NO_STREAMING:
       return "grpc::AsyncUnaryCall<" + GetClassName(method->output_type()) +
@@ -246,7 +245,7 @@
   return "";
 }
 
-std::string GetMethodRequestParamServer(const MethodDescriptor *method) {
+std::string GetMethodRequestParamServer(const MethodDescriptor* method) {
   switch (GetMethodType(method)) {
     case METHODTYPE_NO_STREAMING:
     case METHODTYPE_SERVER_STREAMING:
@@ -260,7 +259,7 @@
   return "";
 }
 
-std::string GetMethodReturnTypeServer(const MethodDescriptor *method) {
+std::string GetMethodReturnTypeServer(const MethodDescriptor* method) {
   switch (GetMethodType(method)) {
     case METHODTYPE_NO_STREAMING:
     case METHODTYPE_CLIENT_STREAMING:
@@ -274,7 +273,7 @@
   return "";
 }
 
-std::string GetMethodResponseStreamMaybe(const MethodDescriptor *method) {
+std::string GetMethodResponseStreamMaybe(const MethodDescriptor* method) {
   switch (GetMethodType(method)) {
     case METHODTYPE_NO_STREAMING:
     case METHODTYPE_CLIENT_STREAMING:
@@ -289,13 +288,13 @@
 }
 
 // Gets vector of all messages used as input or output types.
-std::vector<const Descriptor *> GetUsedMessages(
-    const ServiceDescriptor *service) {
-  std::set<const Descriptor *> descriptor_set;
-  std::vector<const Descriptor *>
+std::vector<const Descriptor*> GetUsedMessages(
+    const ServiceDescriptor* service) {
+  std::set<const Descriptor*> descriptor_set;
+  std::vector<const Descriptor*>
       result;  // vector is to maintain stable ordering
   for (int i = 0; i < service->method_count(); i++) {
-    const MethodDescriptor *method = service->method(i);
+    const MethodDescriptor* method = service->method(i);
     if (descriptor_set.find(method->input_type()) == descriptor_set.end()) {
       descriptor_set.insert(method->input_type());
       result.push_back(method->input_type());
@@ -308,10 +307,10 @@
   return result;
 }
 
-void GenerateMarshallerFields(Printer *out, const ServiceDescriptor *service) {
-  std::vector<const Descriptor *> used_messages = GetUsedMessages(service);
+void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
+  std::vector<const Descriptor*> used_messages = GetUsedMessages(service);
   for (size_t i = 0; i < used_messages.size(); i++) {
-    const Descriptor *message = used_messages[i];
+    const Descriptor* message = used_messages[i];
     out->Print(
         "static readonly grpc::Marshaller<$type$> $fieldname$ = "
         "grpc::Marshallers.Create((arg) => "
@@ -323,7 +322,7 @@
   out->Print("\n");
 }
 
-void GenerateStaticMethodField(Printer *out, const MethodDescriptor *method) {
+void GenerateStaticMethodField(Printer* out, const MethodDescriptor* method) {
   out->Print(
       "static readonly grpc::Method<$request$, $response$> $fieldname$ = new "
       "grpc::Method<$request$, $response$>(\n",
@@ -346,8 +345,8 @@
   out->Outdent();
 }
 
-void GenerateServiceDescriptorProperty(Printer *out,
-                                       const ServiceDescriptor *service) {
+void GenerateServiceDescriptorProperty(Printer* out,
+                                       const ServiceDescriptor* service) {
   std::ostringstream index;
   index << service->index();
   out->Print("/// <summary>Service descriptor</summary>\n");
@@ -362,7 +361,7 @@
   out->Print("\n");
 }
 
-void GenerateServerClass(Printer *out, const ServiceDescriptor *service) {
+void GenerateServerClass(Printer* out, const ServiceDescriptor* service) {
   out->Print(
       "/// <summary>Base class for server-side implementations of "
       "$servicename$</summary>\n",
@@ -372,7 +371,7 @@
   out->Print("{\n");
   out->Indent();
   for (int i = 0; i < service->method_count(); i++) {
-    const MethodDescriptor *method = service->method(i);
+    const MethodDescriptor* method = service->method(i);
     GenerateDocCommentServerMethod(out, method);
     out->Print(
         "public virtual $returntype$ "
@@ -395,7 +394,7 @@
   out->Print("\n");
 }
 
-void GenerateClientStub(Printer *out, const ServiceDescriptor *service) {
+void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
   out->Print("/// <summary>Client for $servicename$</summary>\n", "servicename",
              GetServiceClassName(service));
   out->Print("public partial class $name$ : grpc::ClientBase<$name$>\n", "name",
@@ -443,7 +442,7 @@
   out->Print("}\n\n");
 
   for (int i = 0; i < service->method_count(); i++) {
-    const MethodDescriptor *method = service->method(i);
+    const MethodDescriptor* method = service->method(i);
     MethodType method_type = GetMethodType(method);
 
     if (method_type == METHODTYPE_NO_STREAMING) {
@@ -573,7 +572,7 @@
   out->Print("\n");
 }
 
-void GenerateBindServiceMethod(Printer *out, const ServiceDescriptor *service) {
+void GenerateBindServiceMethod(Printer* out, const ServiceDescriptor* service) {
   out->Print(
       "/// <summary>Creates service definition that can be registered with a "
       "server</summary>\n");
@@ -591,7 +590,7 @@
   out->Indent();
   out->Indent();
   for (int i = 0; i < service->method_count(); i++) {
-    const MethodDescriptor *method = service->method(i);
+    const MethodDescriptor* method = service->method(i);
     out->Print(".AddMethod($methodfield$, serviceImpl.$methodname$)",
                "methodfield", GetMethodFieldName(method), "methodname",
                method->name());
@@ -608,7 +607,7 @@
   out->Print("\n");
 }
 
-void GenerateService(Printer *out, const ServiceDescriptor *service,
+void GenerateService(Printer* out, const ServiceDescriptor* service,
                      bool generate_client, bool generate_server,
                      bool internal_access) {
   GenerateDocCommentBody(out, service);
@@ -644,7 +643,7 @@
 
 }  // anonymous namespace
 
-grpc::string GetServices(const FileDescriptor *file, bool generate_client,
+grpc::string GetServices(const FileDescriptor* file, bool generate_client,
                          bool generate_server, bool internal_access) {
   grpc::string output;
   {
diff --git a/src/compiler/csharp_generator.h b/src/compiler/csharp_generator.h
index 0eca292..fd36e11 100644
--- a/src/compiler/csharp_generator.h
+++ b/src/compiler/csharp_generator.h
@@ -25,7 +25,7 @@
 
 namespace grpc_csharp_generator {
 
-grpc::string GetServices(const grpc::protobuf::FileDescriptor *file,
+grpc::string GetServices(const grpc::protobuf::FileDescriptor* file,
                          bool generate_client, bool generate_server,
                          bool internal_access);
 
diff --git a/src/compiler/csharp_generator_helpers.h b/src/compiler/csharp_generator_helpers.h
index bdf10df..8c89925 100644
--- a/src/compiler/csharp_generator_helpers.h
+++ b/src/compiler/csharp_generator_helpers.h
@@ -24,8 +24,8 @@
 
 namespace grpc_csharp_generator {
 
-inline bool ServicesFilename(const grpc::protobuf::FileDescriptor *file,
-                             grpc::string *file_name_or_error) {
+inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file,
+                             grpc::string* file_name_or_error) {
   *file_name_or_error =
       grpc_generator::FileNameInUpperCamel(file, false) + "Grpc.cs";
   return true;
@@ -34,7 +34,7 @@
 // Get leading or trailing comments in a string. Comment lines start with "// ".
 // Leading detached comments are put in in front of leading comments.
 template <typename DescriptorType>
-inline grpc::string GetCsharpComments(const DescriptorType *desc,
+inline grpc::string GetCsharpComments(const DescriptorType* desc,
                                       bool leading) {
   return grpc_generator::GetPrefixedComments(desc, leading, "//");
 }
diff --git a/src/compiler/csharp_plugin.cc b/src/compiler/csharp_plugin.cc
index 224a89c..5f13aa6 100644
--- a/src/compiler/csharp_plugin.cc
+++ b/src/compiler/csharp_plugin.cc
@@ -29,10 +29,10 @@
   CSharpGrpcGenerator() {}
   ~CSharpGrpcGenerator() {}
 
-  bool Generate(const grpc::protobuf::FileDescriptor *file,
-                const grpc::string &parameter,
-                grpc::protobuf::compiler::GeneratorContext *context,
-                grpc::string *error) const {
+  bool Generate(const grpc::protobuf::FileDescriptor* file,
+                const grpc::string& parameter,
+                grpc::protobuf::compiler::GeneratorContext* context,
+                grpc::string* error) const {
     std::vector<std::pair<grpc::string, grpc::string> > options;
     grpc::protobuf::compiler::ParseGeneratorParameter(parameter, &options);
 
@@ -71,7 +71,7 @@
   }
 };
 
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
   CSharpGrpcGenerator generator;
   return grpc::protobuf::compiler::PluginMain(argc, argv, &generator);
 }
diff --git a/src/compiler/generator_helpers.h b/src/compiler/generator_helpers.h
index e7005d8..747096f 100644
--- a/src/compiler/generator_helpers.h
+++ b/src/compiler/generator_helpers.h
@@ -29,7 +29,7 @@
 
 namespace grpc_generator {
 
-inline bool StripSuffix(grpc::string *filename, const grpc::string &suffix) {
+inline bool StripSuffix(grpc::string* filename, const grpc::string& suffix) {
   if (filename->length() >= suffix.length()) {
     size_t suffix_pos = filename->length() - suffix.length();
     if (filename->compare(suffix_pos, grpc::string::npos, suffix) == 0) {
@@ -41,7 +41,7 @@
   return false;
 }
 
-inline bool StripPrefix(grpc::string *name, const grpc::string &prefix) {
+inline bool StripPrefix(grpc::string* name, const grpc::string& prefix) {
   if (name->length() >= prefix.length()) {
     if (name->substr(0, prefix.size()) == prefix) {
       *name = name->substr(prefix.size());
@@ -58,8 +58,8 @@
   return filename;
 }
 
-inline grpc::string StringReplace(grpc::string str, const grpc::string &from,
-                                  const grpc::string &to, bool replace_all) {
+inline grpc::string StringReplace(grpc::string str, const grpc::string& from,
+                                  const grpc::string& to, bool replace_all) {
   size_t pos = 0;
 
   do {
@@ -74,13 +74,13 @@
   return str;
 }
 
-inline grpc::string StringReplace(grpc::string str, const grpc::string &from,
-                                  const grpc::string &to) {
+inline grpc::string StringReplace(grpc::string str, const grpc::string& from,
+                                  const grpc::string& to) {
   return StringReplace(str, from, to, true);
 }
 
-inline std::vector<grpc::string> tokenize(const grpc::string &input,
-                                          const grpc::string &delimiters) {
+inline std::vector<grpc::string> tokenize(const grpc::string& input,
+                                          const grpc::string& delimiters) {
   std::vector<grpc::string> tokens;
   size_t pos, last_pos = 0;
 
@@ -125,7 +125,7 @@
 }
 
 inline grpc::string FileNameInUpperCamel(
-    const grpc::protobuf::FileDescriptor *file, bool include_package_path) {
+    const grpc::protobuf::FileDescriptor* file, bool include_package_path) {
   std::vector<grpc::string> tokens = tokenize(StripProto(file->name()), "/");
   grpc::string result = "";
   if (include_package_path) {
@@ -138,7 +138,7 @@
 }
 
 inline grpc::string FileNameInUpperCamel(
-    const grpc::protobuf::FileDescriptor *file) {
+    const grpc::protobuf::FileDescriptor* file) {
   return FileNameInUpperCamel(file, true);
 }
 
@@ -150,7 +150,7 @@
 };
 
 inline MethodType GetMethodType(
-    const grpc::protobuf::MethodDescriptor *method) {
+    const grpc::protobuf::MethodDescriptor* method) {
   if (method->client_streaming()) {
     if (method->server_streaming()) {
       return METHODTYPE_BIDI_STREAMING;
@@ -166,8 +166,8 @@
   }
 }
 
-inline void Split(const grpc::string &s, char delim,
-                  std::vector<grpc::string> *append_to) {
+inline void Split(const grpc::string& s, char delim,
+                  std::vector<grpc::string>* append_to) {
   std::istringstream iss(s);
   grpc::string piece;
   while (std::getline(iss, piece)) {
@@ -183,14 +183,14 @@
 
 // Get all the raw comments and append each line without newline to out.
 template <typename DescriptorType>
-inline void GetComment(const DescriptorType *desc, CommentType type,
-                       std::vector<grpc::string> *out) {
+inline void GetComment(const DescriptorType* desc, CommentType type,
+                       std::vector<grpc::string>* out) {
   grpc::protobuf::SourceLocation location;
   if (!desc->GetSourceLocation(&location)) {
     return;
   }
   if (type == COMMENTTYPE_LEADING || type == COMMENTTYPE_TRAILING) {
-    const grpc::string &comments = type == COMMENTTYPE_LEADING
+    const grpc::string& comments = type == COMMENTTYPE_LEADING
                                        ? location.leading_comments
                                        : location.trailing_comments;
     Split(comments, '\n', out);
@@ -210,8 +210,8 @@
 // For file level leading and detached leading comments, we return comments
 // above syntax line. Return nothing for trailing comments.
 template <>
-inline void GetComment(const grpc::protobuf::FileDescriptor *desc,
-                       CommentType type, std::vector<grpc::string> *out) {
+inline void GetComment(const grpc::protobuf::FileDescriptor* desc,
+                       CommentType type, std::vector<grpc::string>* out) {
   if (type == COMMENTTYPE_TRAILING) {
     return;
   }
@@ -238,10 +238,10 @@
 // Add prefix and newline to each comment line and concatenate them together.
 // Make sure there is a space after the prefix unless the line is empty.
 inline grpc::string GenerateCommentsWithPrefix(
-    const std::vector<grpc::string> &in, const grpc::string &prefix) {
+    const std::vector<grpc::string>& in, const grpc::string& prefix) {
   std::ostringstream oss;
   for (auto it = in.begin(); it != in.end(); it++) {
-    const grpc::string &elem = *it;
+    const grpc::string& elem = *it;
     if (elem.empty()) {
       oss << prefix << "\n";
     } else if (elem[0] == ' ') {
@@ -254,9 +254,9 @@
 }
 
 template <typename DescriptorType>
-inline grpc::string GetPrefixedComments(const DescriptorType *desc,
+inline grpc::string GetPrefixedComments(const DescriptorType* desc,
                                         bool leading,
-                                        const grpc::string &prefix) {
+                                        const grpc::string& prefix) {
   std::vector<grpc::string> out;
   if (leading) {
     grpc_generator::GetComment(
diff --git a/src/compiler/node_generator.cc b/src/compiler/node_generator.cc
index c0fef91..ed835b4 100644
--- a/src/compiler/node_generator.cc
+++ b/src/compiler/node_generator.cc
@@ -22,10 +22,10 @@
 #include "src/compiler/generator_helpers.h"
 #include "src/compiler/node_generator_helpers.h"
 
-using grpc::protobuf::FileDescriptor;
-using grpc::protobuf::ServiceDescriptor;
-using grpc::protobuf::MethodDescriptor;
 using grpc::protobuf::Descriptor;
+using grpc::protobuf::FileDescriptor;
+using grpc::protobuf::MethodDescriptor;
+using grpc::protobuf::ServiceDescriptor;
 using grpc::protobuf::io::Printer;
 using grpc::protobuf::io::StringOutputStream;
 using std::map;
@@ -53,15 +53,15 @@
 
 // Given a filename like foo/bar/baz.proto, returns the corresponding JavaScript
 // message file foo/bar/baz.js
-grpc::string GetJSMessageFilename(const grpc::string &filename) {
+grpc::string GetJSMessageFilename(const grpc::string& filename) {
   grpc::string name = filename;
   return grpc_generator::StripProto(name) + "_pb.js";
 }
 
 // Given a filename like foo/bar/baz.proto, returns the root directory
 // path ../../
-grpc::string GetRootPath(const grpc::string &from_filename,
-                         const grpc::string &to_filename) {
+grpc::string GetRootPath(const grpc::string& from_filename,
+                         const grpc::string& to_filename) {
   if (to_filename.find("google/protobuf") == 0) {
     // Well-known types (.proto files in the google/protobuf directory) are
     // assumed to come from the 'google-protobuf' npm package.  We may want to
@@ -82,24 +82,24 @@
 
 // Return the relative path to load to_file from the directory containing
 // from_file, assuming that both paths are relative to the same directory
-grpc::string GetRelativePath(const grpc::string &from_file,
-                             const grpc::string &to_file) {
+grpc::string GetRelativePath(const grpc::string& from_file,
+                             const grpc::string& to_file) {
   return GetRootPath(from_file, to_file) + to_file;
 }
 
 /* Finds all message types used in all services in the file, and returns them
  * as a map of fully qualified message type name to message descriptor */
-map<grpc::string, const Descriptor *> GetAllMessages(
-    const FileDescriptor *file) {
-  map<grpc::string, const Descriptor *> message_types;
+map<grpc::string, const Descriptor*> GetAllMessages(
+    const FileDescriptor* file) {
+  map<grpc::string, const Descriptor*> message_types;
   for (int service_num = 0; service_num < file->service_count();
        service_num++) {
-    const ServiceDescriptor *service = file->service(service_num);
+    const ServiceDescriptor* service = file->service(service_num);
     for (int method_num = 0; method_num < service->method_count();
          method_num++) {
-      const MethodDescriptor *method = service->method(method_num);
-      const Descriptor *input_type = method->input_type();
-      const Descriptor *output_type = method->output_type();
+      const MethodDescriptor* method = service->method(method_num);
+      const Descriptor* input_type = method->input_type();
+      const Descriptor* output_type = method->output_type();
       message_types[input_type->full_name()] = input_type;
       message_types[output_type->full_name()] = output_type;
     }
@@ -107,11 +107,11 @@
   return message_types;
 }
 
-grpc::string MessageIdentifierName(const grpc::string &name) {
+grpc::string MessageIdentifierName(const grpc::string& name) {
   return grpc_generator::StringReplace(name, ".", "_");
 }
 
-grpc::string NodeObjectPath(const Descriptor *descriptor) {
+grpc::string NodeObjectPath(const Descriptor* descriptor) {
   grpc::string module_alias = ModuleAlias(descriptor->file()->name());
   grpc::string name = descriptor->full_name();
   grpc_generator::StripPrefix(&name, descriptor->file()->package() + ".");
@@ -119,7 +119,7 @@
 }
 
 // Prints out the message serializer and deserializer functions
-void PrintMessageTransformer(const Descriptor *descriptor, Printer *out) {
+void PrintMessageTransformer(const Descriptor* descriptor, Printer* out) {
   map<grpc::string, grpc::string> template_vars;
   grpc::string full_name = descriptor->full_name();
   template_vars["identifier_name"] = MessageIdentifierName(full_name);
@@ -149,9 +149,9 @@
   out->Print("}\n\n");
 }
 
-void PrintMethod(const MethodDescriptor *method, Printer *out) {
-  const Descriptor *input_type = method->input_type();
-  const Descriptor *output_type = method->output_type();
+void PrintMethod(const MethodDescriptor* method, Printer* out) {
+  const Descriptor* input_type = method->input_type();
+  const Descriptor* output_type = method->output_type();
   map<grpc::string, grpc::string> vars;
   vars["service_name"] = method->service()->full_name();
   vars["name"] = method->name();
@@ -177,7 +177,7 @@
 }
 
 // Prints out the service descriptor object
-void PrintService(const ServiceDescriptor *service, Printer *out) {
+void PrintService(const ServiceDescriptor* service, Printer* out) {
   map<grpc::string, grpc::string> template_vars;
   out->Print(GetNodeComments(service, true).c_str());
   template_vars["name"] = service->name();
@@ -200,7 +200,7 @@
   out->Print(GetNodeComments(service, false).c_str());
 }
 
-void PrintImports(const FileDescriptor *file, Printer *out) {
+void PrintImports(const FileDescriptor* file, Printer* out) {
   out->Print("var grpc = require('grpc');\n");
   if (file->message_type_count() > 0) {
     grpc::string file_path =
@@ -219,9 +219,9 @@
   out->Print("\n");
 }
 
-void PrintTransformers(const FileDescriptor *file, Printer *out) {
-  map<grpc::string, const Descriptor *> messages = GetAllMessages(file);
-  for (std::map<grpc::string, const Descriptor *>::iterator it =
+void PrintTransformers(const FileDescriptor* file, Printer* out) {
+  map<grpc::string, const Descriptor*> messages = GetAllMessages(file);
+  for (std::map<grpc::string, const Descriptor*>::iterator it =
            messages.begin();
        it != messages.end(); it++) {
     PrintMessageTransformer(it->second, out);
@@ -229,14 +229,14 @@
   out->Print("\n");
 }
 
-void PrintServices(const FileDescriptor *file, Printer *out) {
+void PrintServices(const FileDescriptor* file, Printer* out) {
   for (int i = 0; i < file->service_count(); i++) {
     PrintService(file->service(i), out);
   }
 }
-}
+}  // namespace
 
-grpc::string GenerateFile(const FileDescriptor *file) {
+grpc::string GenerateFile(const FileDescriptor* file) {
   grpc::string output;
   {
     StringOutputStream output_stream(&output);
diff --git a/src/compiler/node_generator.h b/src/compiler/node_generator.h
index 7b0335b..a9ffe75 100644
--- a/src/compiler/node_generator.h
+++ b/src/compiler/node_generator.h
@@ -23,7 +23,7 @@
 
 namespace grpc_node_generator {
 
-grpc::string GenerateFile(const grpc::protobuf::FileDescriptor *file);
+grpc::string GenerateFile(const grpc::protobuf::FileDescriptor* file);
 
 }  // namespace grpc_node_generator
 
diff --git a/src/compiler/node_plugin.cc b/src/compiler/node_plugin.cc
index f4334c9..bc38e90 100644
--- a/src/compiler/node_plugin.cc
+++ b/src/compiler/node_plugin.cc
@@ -32,10 +32,10 @@
   NodeGrpcGenerator() {}
   ~NodeGrpcGenerator() {}
 
-  bool Generate(const grpc::protobuf::FileDescriptor *file,
-                const grpc::string &parameter,
-                grpc::protobuf::compiler::GeneratorContext *context,
-                grpc::string *error) const {
+  bool Generate(const grpc::protobuf::FileDescriptor* file,
+                const grpc::string& parameter,
+                grpc::protobuf::compiler::GeneratorContext* context,
+                grpc::string* error) const {
     grpc::string code = GenerateFile(file);
     if (code.size() == 0) {
       return true;
@@ -52,7 +52,7 @@
   }
 };
 
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
   NodeGrpcGenerator generator;
   return grpc::protobuf::compiler::PluginMain(argc, argv, &generator);
 }
diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc
index 33b5fed..349f1dc 100644
--- a/src/compiler/objective_c_generator.cc
+++ b/src/compiler/objective_c_generator.cc
@@ -27,10 +27,10 @@
 #include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
 
 using ::google::protobuf::compiler::objectivec::ClassName;
-using ::grpc::protobuf::io::Printer;
+using ::grpc::protobuf::FileDescriptor;
 using ::grpc::protobuf::MethodDescriptor;
 using ::grpc::protobuf::ServiceDescriptor;
-using ::grpc::protobuf::FileDescriptor;
+using ::grpc::protobuf::io::Printer;
 using ::std::map;
 using ::std::set;
 
@@ -38,7 +38,7 @@
 namespace {
 
 void PrintProtoRpcDeclarationAsPragma(
-    Printer *printer, const MethodDescriptor *method,
+    Printer* printer, const MethodDescriptor* method,
     map< ::grpc::string, ::grpc::string> vars) {
   vars["client_stream"] = method->client_streaming() ? "stream " : "";
   vars["server_stream"] = method->server_streaming() ? "stream " : "";
@@ -49,7 +49,7 @@
 }
 
 template <typename DescriptorType>
-static void PrintAllComments(const DescriptorType *desc, Printer *printer) {
+static void PrintAllComments(const DescriptorType* desc, Printer* printer) {
   std::vector<grpc::string> comments;
   grpc_generator::GetComment(desc, grpc_generator::COMMENTTYPE_LEADING_DETACHED,
                              &comments);
@@ -72,8 +72,8 @@
   printer->Print(" */\n");
 }
 
-void PrintMethodSignature(Printer *printer, const MethodDescriptor *method,
-                          const map< ::grpc::string, ::grpc::string> &vars) {
+void PrintMethodSignature(Printer* printer, const MethodDescriptor* method,
+                          const map< ::grpc::string, ::grpc::string>& vars) {
   // Print comment
   PrintAllComments(method, printer);
 
@@ -97,7 +97,7 @@
   }
 }
 
-void PrintSimpleSignature(Printer *printer, const MethodDescriptor *method,
+void PrintSimpleSignature(Printer* printer, const MethodDescriptor* method,
                           map< ::grpc::string, ::grpc::string> vars) {
   vars["method_name"] =
       grpc_generator::LowercaseFirstLetter(vars["method_name"]);
@@ -105,7 +105,7 @@
   PrintMethodSignature(printer, method, vars);
 }
 
-void PrintAdvancedSignature(Printer *printer, const MethodDescriptor *method,
+void PrintAdvancedSignature(Printer* printer, const MethodDescriptor* method,
                             map< ::grpc::string, ::grpc::string> vars) {
   vars["method_name"] = "RPCTo" + vars["method_name"];
   vars["return_type"] = "GRPCProtoCall *";
@@ -113,7 +113,7 @@
 }
 
 inline map< ::grpc::string, ::grpc::string> GetMethodVars(
-    const MethodDescriptor *method) {
+    const MethodDescriptor* method) {
   map< ::grpc::string, ::grpc::string> res;
   res["method_name"] = method->name();
   res["request_type"] = method->input_type()->name();
@@ -123,7 +123,7 @@
   return res;
 }
 
-void PrintMethodDeclarations(Printer *printer, const MethodDescriptor *method) {
+void PrintMethodDeclarations(Printer* printer, const MethodDescriptor* method) {
   map< ::grpc::string, ::grpc::string> vars = GetMethodVars(method);
 
   PrintProtoRpcDeclarationAsPragma(printer, method, vars);
@@ -134,7 +134,7 @@
   printer->Print(";\n\n\n");
 }
 
-void PrintSimpleImplementation(Printer *printer, const MethodDescriptor *method,
+void PrintSimpleImplementation(Printer* printer, const MethodDescriptor* method,
                                map< ::grpc::string, ::grpc::string> vars) {
   printer->Print("{\n");
   printer->Print(vars, "  [[self RPCTo$method_name$With");
@@ -151,8 +151,8 @@
   printer->Print("}\n");
 }
 
-void PrintAdvancedImplementation(Printer *printer,
-                                 const MethodDescriptor *method,
+void PrintAdvancedImplementation(Printer* printer,
+                                 const MethodDescriptor* method,
                                  map< ::grpc::string, ::grpc::string> vars) {
   printer->Print("{\n");
   printer->Print(vars, "  return [self RPCToMethod:@\"$method_name$\"\n");
@@ -176,8 +176,8 @@
   printer->Print("}\n");
 }
 
-void PrintMethodImplementations(Printer *printer,
-                                const MethodDescriptor *method) {
+void PrintMethodImplementations(Printer* printer,
+                                const MethodDescriptor* method) {
   map< ::grpc::string, ::grpc::string> vars = GetMethodVars(method);
 
   PrintProtoRpcDeclarationAsPragma(printer, method, vars);
@@ -193,7 +193,7 @@
 
 }  // namespace
 
-::grpc::string GetAllMessageClasses(const FileDescriptor *file) {
+::grpc::string GetAllMessageClasses(const FileDescriptor* file) {
   ::grpc::string output;
   set< ::grpc::string> classes;
   for (int i = 0; i < file->service_count(); i++) {
@@ -211,7 +211,7 @@
   return output;
 }
 
-::grpc::string GetHeader(const ServiceDescriptor *service) {
+::grpc::string GetHeader(const ServiceDescriptor* service) {
   ::grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
@@ -245,7 +245,7 @@
   return output;
 }
 
-::grpc::string GetSource(const ServiceDescriptor *service) {
+::grpc::string GetSource(const ServiceDescriptor* service) {
   ::grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
diff --git a/src/compiler/objective_c_generator.h b/src/compiler/objective_c_generator.h
index e912a52..2337aba 100644
--- a/src/compiler/objective_c_generator.h
+++ b/src/compiler/objective_c_generator.h
@@ -23,20 +23,20 @@
 
 namespace grpc_objective_c_generator {
 
-using ::grpc::protobuf::ServiceDescriptor;
 using ::grpc::protobuf::FileDescriptor;
+using ::grpc::protobuf::ServiceDescriptor;
 using ::grpc::string;
 
 // Returns forward declaration of classes in the generated header file.
-string GetAllMessageClasses(const FileDescriptor *file);
+string GetAllMessageClasses(const FileDescriptor* file);
 
 // Returns the content to be included in the "global_scope" insertion point of
 // the generated header file.
-string GetHeader(const ServiceDescriptor *service);
+string GetHeader(const ServiceDescriptor* service);
 
 // Returns the content to be included in the "global_scope" insertion point of
 // the generated implementation file.
-string GetSource(const ServiceDescriptor *service);
+string GetSource(const ServiceDescriptor* service);
 
 }  // namespace grpc_objective_c_generator
 
diff --git a/src/compiler/objective_c_generator_helpers.h b/src/compiler/objective_c_generator_helpers.h
index 9c9589e..4004e6a 100644
--- a/src/compiler/objective_c_generator_helpers.h
+++ b/src/compiler/objective_c_generator_helpers.h
@@ -31,14 +31,14 @@
 using ::grpc::protobuf::ServiceDescriptor;
 using ::grpc::string;
 
-inline string MessageHeaderName(const FileDescriptor *file) {
+inline string MessageHeaderName(const FileDescriptor* file) {
   return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h";
 }
 
-inline string ServiceClassName(const ServiceDescriptor *service) {
-  const FileDescriptor *file = service->file();
+inline string ServiceClassName(const ServiceDescriptor* service) {
+  const FileDescriptor* file = service->file();
   string prefix = file->options().objc_class_prefix();
   return prefix + service->name();
 }
-}
+}  // namespace grpc_objective_c_generator
 #endif  // GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H
diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc
index e751d05..53ff81f 100644
--- a/src/compiler/objective_c_plugin.cc
+++ b/src/compiler/objective_c_plugin.cc
@@ -26,19 +26,19 @@
 
 #include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
 
-using ::google::protobuf::compiler::objectivec::ProtobufLibraryFrameworkName;
 using ::google::protobuf::compiler::objectivec::
     IsProtobufLibraryBundledProtoFile;
+using ::google::protobuf::compiler::objectivec::ProtobufLibraryFrameworkName;
 
 class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
  public:
   ObjectiveCGrpcGenerator() {}
   virtual ~ObjectiveCGrpcGenerator() {}
 
-  virtual bool Generate(const grpc::protobuf::FileDescriptor *file,
-                        const ::grpc::string &parameter,
-                        grpc::protobuf::compiler::GeneratorContext *context,
-                        ::grpc::string *error) const {
+  virtual bool Generate(const grpc::protobuf::FileDescriptor* file,
+                        const ::grpc::string& parameter,
+                        grpc::protobuf::compiler::GeneratorContext* context,
+                        ::grpc::string* error) const {
     if (file->service_count() == 0) {
       // No services.  Do nothing.
       return true;
@@ -65,7 +65,7 @@
       for (int i = 0; i < file->dependency_count(); i++) {
         ::grpc::string header =
             grpc_objective_c_generator::MessageHeaderName(file->dependency(i));
-        const grpc::protobuf::FileDescriptor *dependency = file->dependency(i);
+        const grpc::protobuf::FileDescriptor* dependency = file->dependency(i);
         if (IsProtobufLibraryBundledProtoFile(dependency)) {
           ::grpc::string base_name = header;
           grpc_generator::StripPrefix(&base_name, "google/protobuf/");
@@ -88,7 +88,7 @@
 
       ::grpc::string declarations;
       for (int i = 0; i < file->service_count(); i++) {
-        const grpc::protobuf::ServiceDescriptor *service = file->service(i);
+        const grpc::protobuf::ServiceDescriptor* service = file->service(i);
         declarations += grpc_objective_c_generator::GetHeader(service);
       }
 
@@ -96,9 +96,9 @@
           "\nNS_ASSUME_NONNULL_BEGIN\n\n";
       static const ::grpc::string kNonNullEnd = "\nNS_ASSUME_NONNULL_END\n";
 
-      Write(context, file_name + ".pbrpc.h", imports + '\n' + proto_imports +
-                                                 '\n' + kNonNullBegin +
-                                                 declarations + kNonNullEnd);
+      Write(context, file_name + ".pbrpc.h",
+            imports + '\n' + proto_imports + '\n' + kNonNullBegin +
+                declarations + kNonNullEnd);
     }
 
     {
@@ -111,7 +111,7 @@
       for (int i = 0; i < file->dependency_count(); i++) {
         ::grpc::string header =
             grpc_objective_c_generator::MessageHeaderName(file->dependency(i));
-        const grpc::protobuf::FileDescriptor *dependency = file->dependency(i);
+        const grpc::protobuf::FileDescriptor* dependency = file->dependency(i);
         if (IsProtobufLibraryBundledProtoFile(dependency)) {
           ::grpc::string base_name = header;
           grpc_generator::StripPrefix(&base_name, "google/protobuf/");
@@ -133,7 +133,7 @@
 
       ::grpc::string definitions;
       for (int i = 0; i < file->service_count(); i++) {
-        const grpc::protobuf::ServiceDescriptor *service = file->service(i);
+        const grpc::protobuf::ServiceDescriptor* service = file->service(i);
         definitions += grpc_objective_c_generator::GetSource(service);
       }
 
@@ -145,8 +145,8 @@
 
  private:
   // Write the given code into the given file.
-  void Write(grpc::protobuf::compiler::GeneratorContext *context,
-             const ::grpc::string &filename, const ::grpc::string &code) const {
+  void Write(grpc::protobuf::compiler::GeneratorContext* context,
+             const ::grpc::string& filename, const ::grpc::string& code) const {
     std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> output(
         context->Open(filename));
     grpc::protobuf::io::CodedOutputStream coded_out(output.get());
@@ -154,7 +154,7 @@
   }
 };
 
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
   ObjectiveCGrpcGenerator generator;
   return grpc::protobuf::compiler::PluginMain(argc, argv, &generator);
 }
diff --git a/src/compiler/php_generator.cc b/src/compiler/php_generator.cc
index 6d9ff3a..1ff9520 100644
--- a/src/compiler/php_generator.cc
+++ b/src/compiler/php_generator.cc
@@ -22,10 +22,10 @@
 #include "src/compiler/generator_helpers.h"
 #include "src/compiler/php_generator_helpers.h"
 
-using grpc::protobuf::FileDescriptor;
-using grpc::protobuf::ServiceDescriptor;
-using grpc::protobuf::MethodDescriptor;
 using grpc::protobuf::Descriptor;
+using grpc::protobuf::FileDescriptor;
+using grpc::protobuf::MethodDescriptor;
+using grpc::protobuf::ServiceDescriptor;
 using grpc::protobuf::io::Printer;
 using grpc::protobuf::io::StringOutputStream;
 using std::map;
@@ -33,7 +33,7 @@
 namespace grpc_php_generator {
 namespace {
 
-grpc::string ConvertToPhpNamespace(const grpc::string &name) {
+grpc::string ConvertToPhpNamespace(const grpc::string& name) {
   std::vector<grpc::string> tokens = grpc_generator::tokenize(name, ".");
   std::ostringstream oss;
   for (unsigned int i = 0; i < tokens.size(); i++) {
@@ -43,7 +43,7 @@
   return oss.str();
 }
 
-grpc::string PackageName(const FileDescriptor *file) {
+grpc::string PackageName(const FileDescriptor* file) {
   if (file->options().has_php_namespace()) {
     return file->options().php_namespace();
   } else {
@@ -51,8 +51,8 @@
   }
 }
 
-grpc::string MessageIdentifierName(const grpc::string &name,
-                                   const FileDescriptor *file) {
+grpc::string MessageIdentifierName(const grpc::string& name,
+                                   const FileDescriptor* file) {
   std::vector<grpc::string> tokens = grpc_generator::tokenize(name, ".");
   std::ostringstream oss;
   oss << PackageName(file) << "\\"
@@ -60,9 +60,9 @@
   return oss.str();
 }
 
-void PrintMethod(const MethodDescriptor *method, Printer *out) {
-  const Descriptor *input_type = method->input_type();
-  const Descriptor *output_type = method->output_type();
+void PrintMethod(const MethodDescriptor* method, Printer* out) {
+  const Descriptor* input_type = method->input_type();
+  const Descriptor* output_type = method->output_type();
   map<grpc::string, grpc::string> vars;
   vars["service_name"] = method->service()->full_name();
   vars["name"] = method->name();
@@ -116,8 +116,8 @@
 }
 
 // Prints out the service descriptor object
-void PrintService(const ServiceDescriptor *service,
-                  const grpc::string &class_suffix, Printer *out) {
+void PrintService(const ServiceDescriptor* service,
+                  const grpc::string& class_suffix, Printer* out) {
   map<grpc::string, grpc::string> vars;
   out->Print("/**\n");
   out->Print(GetPHPComments(service, " *").c_str());
@@ -148,11 +148,11 @@
   out->Outdent();
   out->Print("}\n");
 }
-}
+}  // namespace
 
-grpc::string GenerateFile(const FileDescriptor *file,
-                          const ServiceDescriptor *service,
-                          const grpc::string &class_suffix) {
+grpc::string GenerateFile(const FileDescriptor* file,
+                          const ServiceDescriptor* service,
+                          const grpc::string& class_suffix) {
   grpc::string output;
   {
     StringOutputStream output_stream(&output);
diff --git a/src/compiler/php_generator.h b/src/compiler/php_generator.h
index 5412d77..46222b3 100644
--- a/src/compiler/php_generator.h
+++ b/src/compiler/php_generator.h
@@ -23,9 +23,9 @@
 
 namespace grpc_php_generator {
 
-grpc::string GenerateFile(const grpc::protobuf::FileDescriptor *file,
-                          const grpc::protobuf::ServiceDescriptor *service,
-                          const grpc::string &class_suffix);
+grpc::string GenerateFile(const grpc::protobuf::FileDescriptor* file,
+                          const grpc::protobuf::ServiceDescriptor* service,
+                          const grpc::string& class_suffix);
 
 }  // namespace grpc_php_generator
 
diff --git a/src/compiler/php_generator_helpers.h b/src/compiler/php_generator_helpers.h
index 3c88679..3ad1997 100644
--- a/src/compiler/php_generator_helpers.h
+++ b/src/compiler/php_generator_helpers.h
@@ -27,14 +27,14 @@
 namespace grpc_php_generator {
 
 inline grpc::string GetPHPServiceClassname(
-    const grpc::protobuf::ServiceDescriptor *service,
-    const grpc::string &class_suffix) {
+    const grpc::protobuf::ServiceDescriptor* service,
+    const grpc::string& class_suffix) {
   return service->name() + (class_suffix == "" ? "Client" : class_suffix);
 }
 
 // ReplaceAll replaces all instances of search with replace in s.
-inline grpc::string ReplaceAll(grpc::string s, const grpc::string &search,
-                               const grpc::string &replace) {
+inline grpc::string ReplaceAll(grpc::string s, const grpc::string& search,
+                               const grpc::string& replace) {
   size_t pos = 0;
   while ((pos = s.find(search, pos)) != grpc::string::npos) {
     s.replace(pos, search.length(), replace);
@@ -44,9 +44,9 @@
 }
 
 inline grpc::string GetPHPServiceFilename(
-    const grpc::protobuf::FileDescriptor *file,
-    const grpc::protobuf::ServiceDescriptor *service,
-    const grpc::string &class_suffix) {
+    const grpc::protobuf::FileDescriptor* file,
+    const grpc::protobuf::ServiceDescriptor* service,
+    const grpc::string& class_suffix) {
   std::ostringstream oss;
   if (file->options().has_php_namespace()) {
     oss << ReplaceAll(file->options().php_namespace(), "\\", "/");
@@ -65,7 +65,7 @@
 // Get leading or trailing comments in a string. Comment lines start with "// ".
 // Leading detached comments are put in in front of leading comments.
 template <typename DescriptorType>
-inline grpc::string GetPHPComments(const DescriptorType *desc,
+inline grpc::string GetPHPComments(const DescriptorType* desc,
                                    grpc::string prefix) {
   return ReplaceAll(grpc_generator::GetPrefixedComments(desc, true, prefix),
                     "*/", "&#42;/");
diff --git a/src/compiler/php_plugin.cc b/src/compiler/php_plugin.cc
index 7b0da87..d01cbf8 100644
--- a/src/compiler/php_plugin.cc
+++ b/src/compiler/php_plugin.cc
@@ -24,19 +24,19 @@
 #include "src/compiler/php_generator.h"
 #include "src/compiler/php_generator_helpers.h"
 
+using google::protobuf::compiler::ParseGeneratorParameter;
 using grpc_php_generator::GenerateFile;
 using grpc_php_generator::GetPHPServiceFilename;
-using google::protobuf::compiler::ParseGeneratorParameter;
 
 class PHPGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
  public:
   PHPGrpcGenerator() {}
   ~PHPGrpcGenerator() {}
 
-  bool Generate(const grpc::protobuf::FileDescriptor *file,
-                const grpc::string &parameter,
-                grpc::protobuf::compiler::GeneratorContext *context,
-                grpc::string *error) const {
+  bool Generate(const grpc::protobuf::FileDescriptor* file,
+                const grpc::string& parameter,
+                grpc::protobuf::compiler::GeneratorContext* context,
+                grpc::string* error) const {
     if (file->service_count() == 0) {
       return true;
     }
@@ -71,7 +71,7 @@
   }
 };
 
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
   PHPGrpcGenerator generator;
   return grpc::protobuf::compiler::PluginMain(argc, argv, &generator);
 }
diff --git a/src/compiler/protobuf_plugin.h b/src/compiler/protobuf_plugin.h
index e14740c..1551908 100644
--- a/src/compiler/protobuf_plugin.h
+++ b/src/compiler/protobuf_plugin.h
@@ -29,14 +29,14 @@
 
 // Get leading or trailing comments in a string.
 template <typename DescriptorType>
-inline grpc::string GetCommentsHelper(const DescriptorType *desc, bool leading,
-                                      const grpc::string &prefix) {
+inline grpc::string GetCommentsHelper(const DescriptorType* desc, bool leading,
+                                      const grpc::string& prefix) {
   return grpc_generator::GetPrefixedComments(desc, leading, prefix);
 }
 
 class ProtoBufMethod : public grpc_generator::Method {
  public:
-  ProtoBufMethod(const grpc::protobuf::MethodDescriptor *method)
+  ProtoBufMethod(const grpc::protobuf::MethodDescriptor* method)
       : method_(method) {}
 
   grpc::string name() const { return method_->name(); }
@@ -55,7 +55,7 @@
     return method_->output_type()->file()->name();
   }
 
-  bool get_module_and_message_path_input(grpc::string *str,
+  bool get_module_and_message_path_input(grpc::string* str,
                                          grpc::string generator_file_name,
                                          bool generate_in_pb2_grpc,
                                          grpc::string import_prefix) const {
@@ -64,7 +64,7 @@
         import_prefix);
   }
 
-  bool get_module_and_message_path_output(grpc::string *str,
+  bool get_module_and_message_path_output(grpc::string* str,
                                           grpc::string generator_file_name,
                                           bool generate_in_pb2_grpc,
                                           grpc::string import_prefix) const {
@@ -98,12 +98,12 @@
   }
 
  private:
-  const grpc::protobuf::MethodDescriptor *method_;
+  const grpc::protobuf::MethodDescriptor* method_;
 };
 
 class ProtoBufService : public grpc_generator::Service {
  public:
-  ProtoBufService(const grpc::protobuf::ServiceDescriptor *service)
+  ProtoBufService(const grpc::protobuf::ServiceDescriptor* service)
       : service_(service) {}
 
   grpc::string name() const { return service_->name(); }
@@ -127,20 +127,20 @@
   }
 
  private:
-  const grpc::protobuf::ServiceDescriptor *service_;
+  const grpc::protobuf::ServiceDescriptor* service_;
 };
 
 class ProtoBufPrinter : public grpc_generator::Printer {
  public:
-  ProtoBufPrinter(grpc::string *str)
+  ProtoBufPrinter(grpc::string* str)
       : output_stream_(str), printer_(&output_stream_, '$') {}
 
-  void Print(const std::map<grpc::string, grpc::string> &vars,
-             const char *string_template) {
+  void Print(const std::map<grpc::string, grpc::string>& vars,
+             const char* string_template) {
     printer_.Print(vars, string_template);
   }
 
-  void Print(const char *string) { printer_.Print(string); }
+  void Print(const char* string) { printer_.Print(string); }
   void Indent() { printer_.Indent(); }
   void Outdent() { printer_.Outdent(); }
 
@@ -151,7 +151,7 @@
 
 class ProtoBufFile : public grpc_generator::File {
  public:
-  ProtoBufFile(const grpc::protobuf::FileDescriptor *file) : file_(file) {}
+  ProtoBufFile(const grpc::protobuf::FileDescriptor* file) : file_(file) {}
 
   grpc::string filename() const { return file_->name(); }
   grpc::string filename_without_ext() const {
@@ -172,7 +172,7 @@
   }
 
   std::unique_ptr<grpc_generator::Printer> CreatePrinter(
-      grpc::string *str) const {
+      grpc::string* str) const {
     return std::unique_ptr<grpc_generator::Printer>(new ProtoBufPrinter(str));
   }
 
@@ -189,7 +189,7 @@
   }
 
  private:
-  const grpc::protobuf::FileDescriptor *file_;
+  const grpc::protobuf::FileDescriptor* file_;
 };
 
 #endif  // GRPC_INTERNAL_COMPILER_PROTOBUF_PLUGIN_H
diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc
index ef2d90d..c1ae7d3 100644
--- a/src/compiler/python_generator.cc
+++ b/src/compiler/python_generator.cc
@@ -45,9 +45,9 @@
 using std::map;
 using std::pair;
 using std::replace;
+using std::set;
 using std::tuple;
 using std::vector;
-using std::set;
 
 namespace grpc_python_generator {
 
diff --git a/src/compiler/python_generator_helpers.h b/src/compiler/python_generator_helpers.h
index fb3e860..b1b58be 100644
--- a/src/compiler/python_generator_helpers.h
+++ b/src/compiler/python_generator_helpers.h
@@ -29,9 +29,6 @@
 #include "src/compiler/python_generator.h"
 #include "src/compiler/python_private_generator.h"
 
-using std::vector;
-using grpc_generator::StringReplace;
-using grpc_generator::StripProto;
 using grpc::protobuf::Descriptor;
 using grpc::protobuf::FileDescriptor;
 using grpc::protobuf::MethodDescriptor;
@@ -41,6 +38,9 @@
 using grpc::protobuf::io::Printer;
 using grpc::protobuf::io::StringOutputStream;
 using grpc::protobuf::io::ZeroCopyOutputStream;
+using grpc_generator::StringReplace;
+using grpc_generator::StripProto;
+using std::vector;
 
 namespace grpc_python_generator {
 
diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc
index 54d8a42..ed7e074 100644
--- a/src/compiler/ruby_generator.cc
+++ b/src/compiler/ruby_generator.cc
@@ -27,8 +27,8 @@
 #include "src/compiler/ruby_generator_string-inl.h"
 
 using grpc::protobuf::FileDescriptor;
-using grpc::protobuf::ServiceDescriptor;
 using grpc::protobuf::MethodDescriptor;
+using grpc::protobuf::ServiceDescriptor;
 using grpc::protobuf::io::Printer;
 using grpc::protobuf::io::StringOutputStream;
 using std::map;
@@ -38,8 +38,8 @@
 namespace {
 
 // Prints out the method using the ruby gRPC DSL.
-void PrintMethod(const MethodDescriptor *method, const grpc::string &package,
-                 Printer *out) {
+void PrintMethod(const MethodDescriptor* method, const grpc::string& package,
+                 Printer* out) {
   grpc::string input_type =
       RubyTypeOf(method->input_type()->full_name(), package);
   if (method->client_streaming()) {
@@ -51,7 +51,11 @@
     output_type = "stream(" + output_type + ")";
   }
   std::map<grpc::string, grpc::string> method_vars = ListToDict({
-      "mth.name", method->name(), "input.type", input_type, "output.type",
+      "mth.name",
+      method->name(),
+      "input.type",
+      input_type,
+      "output.type",
       output_type,
   });
   out->Print(GetRubyComments(method, true).c_str());
@@ -60,15 +64,16 @@
 }
 
 // Prints out the service using the ruby gRPC DSL.
-void PrintService(const ServiceDescriptor *service, const grpc::string &package,
-                  Printer *out) {
+void PrintService(const ServiceDescriptor* service, const grpc::string& package,
+                  Printer* out) {
   if (service->method_count() == 0) {
     return;
   }
 
   // Begin the service module
   std::map<grpc::string, grpc::string> module_vars = ListToDict({
-      "module.name", CapitalizeFirst(service->name()),
+      "module.name",
+      CapitalizeFirst(service->name()),
   });
   out->Print(module_vars, "module $module.name$\n");
   out->Indent();
@@ -119,7 +124,7 @@
 // names must be PascalCased.
 //
 //   foo_bar_baz -> FooBarBaz
-grpc::string PackageToModule(const grpc::string &name) {
+grpc::string PackageToModule(const grpc::string& name) {
   bool next_upper = true;
   grpc::string result;
   result.reserve(name.size());
@@ -141,7 +146,7 @@
 }
 // end copying of protoc generator for ruby code
 
-grpc::string GetServices(const FileDescriptor *file) {
+grpc::string GetServices(const FileDescriptor* file) {
   grpc::string output;
   {
     // Scope the output stream so it closes and finalizes output to the string.
@@ -157,7 +162,10 @@
 
     // Write out a file header.
     std::map<grpc::string, grpc::string> header_comment_vars = ListToDict({
-        "file.name", file->name(), "file.package", file->package(),
+        "file.name",
+        file->name(),
+        "file.package",
+        file->package(),
     });
     out.Print("# Generated by the protocol buffer compiler.  DO NOT EDIT!\n");
     out.Print(header_comment_vars,
@@ -175,7 +183,8 @@
     // that defines the messages used by the service. This is generated by the
     // main ruby plugin.
     std::map<grpc::string, grpc::string> dep_vars = ListToDict({
-        "dep.name", MessagesRequireName(file),
+        "dep.name",
+        MessagesRequireName(file),
     });
     out.Print(dep_vars, "require '$dep.name$'\n");
 
@@ -184,7 +193,8 @@
     std::vector<grpc::string> modules = Split(file->package(), '.');
     for (size_t i = 0; i < modules.size(); ++i) {
       std::map<grpc::string, grpc::string> module_vars = ListToDict({
-          "module.name", PackageToModule(modules[i]),
+          "module.name",
+          PackageToModule(modules[i]),
       });
       out.Print(module_vars, "module $module.name$\n");
       out.Indent();
diff --git a/src/compiler/ruby_generator.h b/src/compiler/ruby_generator.h
index cdc03aa..9a03e0d 100644
--- a/src/compiler/ruby_generator.h
+++ b/src/compiler/ruby_generator.h
@@ -23,7 +23,7 @@
 
 namespace grpc_ruby_generator {
 
-grpc::string GetServices(const grpc::protobuf::FileDescriptor *file);
+grpc::string GetServices(const grpc::protobuf::FileDescriptor* file);
 
 }  // namespace grpc_ruby_generator
 
diff --git a/src/compiler/ruby_generator_helpers-inl.h b/src/compiler/ruby_generator_helpers-inl.h
index ac09f8d..2323770 100644
--- a/src/compiler/ruby_generator_helpers-inl.h
+++ b/src/compiler/ruby_generator_helpers-inl.h
@@ -25,8 +25,8 @@
 
 namespace grpc_ruby_generator {
 
-inline bool ServicesFilename(const grpc::protobuf::FileDescriptor *file,
-                             grpc::string *file_name_or_error) {
+inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file,
+                             grpc::string* file_name_or_error) {
   // Get output file name.
   static const unsigned proto_suffix_length = 6;  // length of ".proto"
   if (file->name().size() > proto_suffix_length &&
@@ -42,14 +42,14 @@
 }
 
 inline grpc::string MessagesRequireName(
-    const grpc::protobuf::FileDescriptor *file) {
+    const grpc::protobuf::FileDescriptor* file) {
   return Replace(file->name(), ".proto", "_pb");
 }
 
 // Get leading or trailing comments in a string. Comment lines start with "# ".
 // Leading detached comments are put in in front of leading comments.
 template <typename DescriptorType>
-inline grpc::string GetRubyComments(const DescriptorType *desc, bool leading) {
+inline grpc::string GetRubyComments(const DescriptorType* desc, bool leading) {
   return grpc_generator::GetPrefixedComments(desc, leading, "#");
 }
 
diff --git a/src/compiler/ruby_generator_map-inl.h b/src/compiler/ruby_generator_map-inl.h
index 12973e4..89a74b1 100644
--- a/src/compiler/ruby_generator_map-inl.h
+++ b/src/compiler/ruby_generator_map-inl.h
@@ -36,7 +36,7 @@
 // Converts an initializer list of the form { key0, value0, key1, value1, ... }
 // into a map of key* to value*. Is merely a readability helper for later code.
 inline std::map<grpc::string, grpc::string> ListToDict(
-    const initializer_list<grpc::string> &values) {
+    const initializer_list<grpc::string>& values) {
   if (values.size() % 2 != 0) {
     std::cerr << "Not every 'key' has a value in `values`." << std::endl;
   }
diff --git a/src/compiler/ruby_generator_string-inl.h b/src/compiler/ruby_generator_string-inl.h
index def92ed..fb42978 100644
--- a/src/compiler/ruby_generator_string-inl.h
+++ b/src/compiler/ruby_generator_string-inl.h
@@ -31,8 +31,8 @@
 namespace grpc_ruby_generator {
 
 // Split splits a string using char into elems.
-inline std::vector<grpc::string> &Split(const grpc::string &s, char delim,
-                                        std::vector<grpc::string> *elems) {
+inline std::vector<grpc::string>& Split(const grpc::string& s, char delim,
+                                        std::vector<grpc::string>* elems) {
   std::stringstream ss(s);
   grpc::string item;
   while (getline(ss, item, delim)) {
@@ -42,15 +42,15 @@
 }
 
 // Split splits a string using char, returning the result in a vector.
-inline std::vector<grpc::string> Split(const grpc::string &s, char delim) {
+inline std::vector<grpc::string> Split(const grpc::string& s, char delim) {
   std::vector<grpc::string> elems;
   Split(s, delim, &elems);
   return elems;
 }
 
 // Replace replaces from with to in s.
-inline grpc::string Replace(grpc::string s, const grpc::string &from,
-                            const grpc::string &to) {
+inline grpc::string Replace(grpc::string s, const grpc::string& from,
+                            const grpc::string& to) {
   size_t start_pos = s.find(from);
   if (start_pos == grpc::string::npos) {
     return s;
@@ -60,8 +60,8 @@
 }
 
 // ReplaceAll replaces all instances of search with replace in s.
-inline grpc::string ReplaceAll(grpc::string s, const grpc::string &search,
-                               const grpc::string &replace) {
+inline grpc::string ReplaceAll(grpc::string s, const grpc::string& search,
+                               const grpc::string& replace) {
   size_t pos = 0;
   while ((pos = s.find(search, pos)) != grpc::string::npos) {
     s.replace(pos, search.length(), replace);
@@ -71,8 +71,8 @@
 }
 
 // ReplacePrefix replaces from with to in s if search is a prefix of s.
-inline bool ReplacePrefix(grpc::string *s, const grpc::string &from,
-                          const grpc::string &to) {
+inline bool ReplacePrefix(grpc::string* s, const grpc::string& from,
+                          const grpc::string& to) {
   size_t start_pos = s->find(from);
   if (start_pos == grpc::string::npos || start_pos != 0) {
     return false;
@@ -91,8 +91,8 @@
 }
 
 // RubyTypeOf updates a proto type to the required ruby equivalent.
-inline grpc::string RubyTypeOf(const grpc::string &a_type,
-                               const grpc::string &package) {
+inline grpc::string RubyTypeOf(const grpc::string& a_type,
+                               const grpc::string& package) {
   grpc::string res(a_type);
   ReplacePrefix(&res, package, "");  // remove the leading package if present
   ReplacePrefix(&res, ".", "");      // remove the leading . (no package)
diff --git a/src/compiler/ruby_plugin.cc b/src/compiler/ruby_plugin.cc
index f1b1d01..9c234bd 100644
--- a/src/compiler/ruby_plugin.cc
+++ b/src/compiler/ruby_plugin.cc
@@ -29,10 +29,10 @@
   RubyGrpcGenerator() {}
   ~RubyGrpcGenerator() {}
 
-  bool Generate(const grpc::protobuf::FileDescriptor *file,
-                const grpc::string &parameter,
-                grpc::protobuf::compiler::GeneratorContext *context,
-                grpc::string *error) const {
+  bool Generate(const grpc::protobuf::FileDescriptor* file,
+                const grpc::string& parameter,
+                grpc::protobuf::compiler::GeneratorContext* context,
+                grpc::string* error) const {
     grpc::string code = grpc_ruby_generator::GetServices(file);
     if (code.size() == 0) {
       return true;  // don't generate a file if there are no services
@@ -51,7 +51,7 @@
   }
 };
 
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
   RubyGrpcGenerator generator;
   return grpc::protobuf::compiler::PluginMain(argc, argv, &generator);
 }
diff --git a/src/compiler/schema_interface.h b/src/compiler/schema_interface.h
index 828c775..b2021f2 100644
--- a/src/compiler/schema_interface.h
+++ b/src/compiler/schema_interface.h
@@ -56,10 +56,10 @@
   virtual grpc::string output_type_name() const = 0;
 
   virtual bool get_module_and_message_path_input(
-      grpc::string *str, grpc::string generator_file_name,
+      grpc::string* str, grpc::string generator_file_name,
       bool generate_in_pb2_grpc, grpc::string import_prefix) const = 0;
   virtual bool get_module_and_message_path_output(
-      grpc::string *str, grpc::string generator_file_name,
+      grpc::string* str, grpc::string generator_file_name,
       bool generate_in_pb2_grpc, grpc::string import_prefix) const = 0;
 
   virtual grpc::string get_input_type_name() const = 0;
@@ -83,9 +83,9 @@
 struct Printer {
   virtual ~Printer() {}
 
-  virtual void Print(const std::map<grpc::string, grpc::string> &vars,
-                     const char *template_string) = 0;
-  virtual void Print(const char *string) = 0;
+  virtual void Print(const std::map<grpc::string, grpc::string>& vars,
+                     const char* template_string) = 0;
+  virtual void Print(const char* string) = 0;
   virtual void Indent() = 0;
   virtual void Outdent() = 0;
 };
@@ -104,7 +104,7 @@
   virtual int service_count() const = 0;
   virtual std::unique_ptr<const Service> service(int i) const = 0;
 
-  virtual std::unique_ptr<Printer> CreatePrinter(grpc::string *str) const = 0;
+  virtual std::unique_ptr<Printer> CreatePrinter(grpc::string* str) const = 0;
 };
 }  // namespace grpc_generator
 
diff --git a/src/core/ext/census/README.md b/src/core/ext/census/README.md
deleted file mode 100644
index a9826fe..0000000
--- a/src/core/ext/census/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-<!---
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-
-# Census - a resource measurement and tracing system
-
-This directory contains code for Census, which will ultimately provide the
-following features for any gRPC-using system:
-* A [dapper](http://research.google.com/pubs/pub36356.html)-like tracing
-  system, enabling tracing across a distributed infrastructure.
-* RPC statistics and measurements for key metrics, such as latency, bytes
-  transferred, number of errors etc.
-* Resource measurement framework which can be used for measuring custom
-  metrics. Through the use of [tags](#Tags), these can be broken down across
-  the entire distributed stack.
-* Easy integration of the above with
-  [Google Cloud Trace](https://cloud.google.com/tools/cloud-trace) and
-  [Google Cloud Monitoring](https://cloud.google.com/monitoring/).
-
-## Concepts
-
-### Context
-
-### Operations
-
-### Tags
-
-### Metrics
-
-## API
-
-### Internal/RPC API
-
-### External/Client API
-
-### RPC API
-
-## Files in this directory
-
-Note that files and functions in this directory can be split into two
-categories:
-* Files that define core census library functions. Functions etc. in these
-  files are named census\_\*, and constitute the core census library
-  functionality. At some time in the future, these will become a standalone
-  library.
-* Files that define functions etc. that provide a convenient interface between
-  grpc and the core census functionality. These files are all named
-  grpc\_\*.{c,h}, and define function names beginning with grpc\_census\_\*.
-
diff --git a/src/core/ext/census/aggregation.h b/src/core/ext/census/aggregation.h
deleted file mode 100644
index 1ba7953..0000000
--- a/src/core/ext/census/aggregation.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stddef.h>
-
-#ifndef GRPC_CORE_EXT_CENSUS_AGGREGATION_H
-#define GRPC_CORE_EXT_CENSUS_AGGREGATION_H
-
-/** Structure used to describe an aggregation type. */
-struct census_aggregation_ops {
-  /* Create a new aggregation. The pointer returned can be used in future calls
-     to clone(), free(), record(), data() and reset(). */
-  void *(*create)(const void *create_arg);
-  /* Make a copy of an aggregation created by create() */
-  void *(*clone)(const void *aggregation);
-  /* Destroy an aggregation created by create() */
-  void (*free)(void *aggregation);
-  /* Record a new value against aggregation. */
-  void (*record)(void *aggregation, double value);
-  /* Return current aggregation data. The caller must cast this object into
-     the correct type for the aggregation result. The object returned can be
-     freed by using free_data(). */
-  void *(*data)(const void *aggregation);
-  /* free data returned by data() */
-  void (*free_data)(void *data);
-  /* Reset an aggregation to default (zero) values. */
-  void (*reset)(void *aggregation);
-  /* Merge 'from' aggregation into 'to'. Both aggregations must be compatible */
-  void (*merge)(void *to, const void *from);
-  /* Fill buffer with printable string version of aggregation contents. For
-     debugging only. Returns the number of bytes added to buffer (a value == n
-     implies the buffer was of insufficient size). */
-  size_t (*print)(const void *aggregation, char *buffer, size_t n);
-};
-
-#endif /* GRPC_CORE_EXT_CENSUS_AGGREGATION_H */
diff --git a/src/core/ext/census/base_resources.cc b/src/core/ext/census/base_resources.cc
deleted file mode 100644
index 3697c6f..0000000
--- a/src/core/ext/census/base_resources.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/base_resources.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/census.h>
-#include <grpc/support/log.h>
-
-#include "src/core/ext/census/resource.h"
-
-// Add base RPC resource definitions for use by RPC runtime.
-//
-// TODO(aveitch): All of these are currently hardwired definitions encoded in
-// the code in this file. These should be converted to use an external
-// configuration mechanism, in which these resources are defined in a text
-// file, which is compiled to .pb format and read by still-to-be-written
-// configuration functions.
-
-// Define all base resources. This should be called by census initialization.
-void define_base_resources() {
-  google_census_Resource_BasicUnit numerator =
-      google_census_Resource_BasicUnit_SECS;
-  resource r = {(char *)"client_rpc_latency",             // name
-                (char *)"Client RPC latency in seconds",  // description
-                0,                                        // prefix
-                1,                                        // n_numerators
-                &numerator,                               // numerators
-                0,                                        // n_denominators
-                NULL};                                    // denominators
-  define_resource(&r);
-  r = {(char *)"server_rpc_latency",             // name
-       (char *)"Server RPC latency in seconds",  // description
-       0,                                        // prefix
-       1,                                        // n_numerators
-       &numerator,                               // numerators
-       0,                                        // n_denominators
-       NULL};                                    // denominators
-  define_resource(&r);
-}
diff --git a/src/core/ext/census/base_resources.h b/src/core/ext/census/base_resources.h
deleted file mode 100644
index d24923b..0000000
--- a/src/core/ext/census/base_resources.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H
-#define GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Define all base resources. This should be called by census initialization. */
-void define_base_resources();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H */
diff --git a/src/core/ext/census/census_init.cc b/src/core/ext/census/census_init.cc
deleted file mode 100644
index d7f719f..0000000
--- a/src/core/ext/census/census_init.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/census_interface.h"
-
-#include <grpc/support/log.h>
-#include "src/core/ext/census/census_rpc_stats.h"
-#include "src/core/ext/census/census_tracing.h"
-
-void census_init(void) {
-  census_tracing_init();
-  census_stats_store_init();
-}
-
-void census_shutdown(void) {
-  census_stats_store_shutdown();
-  census_tracing_shutdown();
-}
diff --git a/src/core/ext/census/census_interface.h b/src/core/ext/census/census_interface.h
deleted file mode 100644
index 113c2b1..0000000
--- a/src/core/ext/census/census_interface.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H
-#define GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H
-
-#include <grpc/support/port_platform.h>
-
-/* Maximum length of an individual census trace annotation. */
-#define CENSUS_MAX_ANNOTATION_LENGTH 200
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Structure of a census op id. Define as structure because 64bit integer is not
-   available on every platform for C89. */
-typedef struct census_op_id {
-  uint32_t upper;
-  uint32_t lower;
-} census_op_id;
-
-typedef struct census_rpc_stats census_rpc_stats;
-
-/* Initializes Census library. No-op if Census is already initialized. */
-void census_init(void);
-
-/* Shutdown Census Library. */
-void census_shutdown(void);
-
-/* Annotates grpc method name on a census_op_id. The method name has the format
-   of <full quantified rpc service name>/<rpc function name>. Returns 0 iff
-   op_id and method_name are all valid. op_id is valid after its creation and
-   before calling census_tracing_end_op().
-
-   TODO(hongyu): Figure out valid characters set for service name and command
-   name and document requirements here.*/
-int census_add_method_tag(census_op_id op_id, const char *method_name);
-
-/* Annotates tracing information to a specific op_id.
-   Up to CENSUS_MAX_ANNOTATION_LENGTH bytes are recorded. */
-void census_tracing_print(census_op_id op_id, const char *annotation);
-
-/* Starts tracing for an RPC. Returns a locally unique census_op_id */
-census_op_id census_tracing_start_op(void);
-
-/* Ends tracing. Calling this function will invalidate the input op_id. */
-void census_tracing_end_op(census_op_id op_id);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H */
diff --git a/src/core/ext/census/census_log.cc b/src/core/ext/census/census_log.cc
deleted file mode 100644
index 100047f..0000000
--- a/src/core/ext/census/census_log.cc
+++ /dev/null
@@ -1,588 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* Available log space is divided up in blocks of
-   CENSUS_LOG_2_MAX_RECORD_SIZE bytes. A block can be in one of the
-   following three data structures:
-   - Free blocks (free_block_list)
-   - Blocks with unread data (dirty_block_list)
-   - Blocks currently attached to cores (core_local_blocks[])
-
-   census_log_start_write() moves a block from core_local_blocks[] to the
-   end of dirty_block_list when block:
-   - is out-of-space OR
-   - has an incomplete record (an incomplete record occurs when a thread calls
-     census_log_start_write() and is context-switched before calling
-     census_log_end_write()
-   So, blocks in dirty_block_list are ordered, from oldest to newest, by time
-   when block is detached from the core.
-
-   census_log_read_next() first iterates over dirty_block_list and then
-   core_local_blocks[]. It moves completely read blocks from dirty_block_list
-   to free_block_list. Blocks in core_local_blocks[] are not freed, even when
-   completely read.
-
-   If log is configured to discard old records and free_block_list is empty,
-   census_log_start_write() iterates over dirty_block_list to allocate a
-   new block. It moves the oldest available block (no pending read/write) to
-   core_local_blocks[].
-
-   core_local_block_struct is used to implement a map from core id to the block
-   associated with that core. This mapping is advisory. It is possible that the
-   block returned by this mapping is no longer associated with that core. This
-   mapping is updated, lazily, by census_log_start_write().
-
-   Locking in block struct:
-
-   Exclusive g_log.lock must be held before calling any functions operatong on
-   block structs except census_log_start_write() and
-   census_log_end_write().
-
-   Writes to a block are serialized via writer_lock.
-   census_log_start_write() acquires this lock and
-   census_log_end_write() releases it. On failure to acquire the lock,
-   writer allocates a new block for the current core and updates
-   core_local_block accordingly.
-
-   Simultaneous read and write access is allowed. Reader can safely read up to
-   committed bytes (bytes_committed).
-
-   reader_lock protects the block, currently being read, from getting recycled.
-   start_read() acquires reader_lock and end_read() releases the lock.
-
-   Read/write access to a block is disabled via try_disable_access(). It returns
-   with both writer_lock and reader_lock held. These locks are subsequently
-   released by enable_access() to enable access to the block.
-
-   A note on naming: Most function/struct names are prepended by cl_
-   (shorthand for census_log). Further, functions that manipulate structures
-   include the name of the structure, which will be passed as the first
-   argument. E.g. cl_block_initialize() will initialize a cl_block.
-*/
-#include "src/core/ext/census/census_log.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/atm.h>
-#include <grpc/support/cpu.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/useful.h>
-#include <string.h>
-
-/* End of platform specific code */
-
-typedef struct census_log_block_list_struct {
-  struct census_log_block_list_struct *next;
-  struct census_log_block_list_struct *prev;
-  struct census_log_block *block;
-} cl_block_list_struct;
-
-typedef struct census_log_block {
-  /* Pointer to underlying buffer */
-  char *buffer;
-  gpr_atm writer_lock;
-  gpr_atm reader_lock;
-  /* Keeps completely written bytes. Declared atomic because accessed
-     simultaneously by reader and writer. */
-  gpr_atm bytes_committed;
-  /* Bytes already read */
-  int32_t bytes_read;
-  /* Links for list */
-  cl_block_list_struct link;
-/* We want this structure to be cacheline aligned. We assume the following
-   sizes for the various parts on 32/64bit systems:
-   type                 32b size    64b size
-   char*                   4           8
-   3x gpr_atm             12          24
-   int32_t               4           8 (assumes padding)
-   cl_block_list_struct   12          24
-   TOTAL                  32          64
-
-   Depending on the size of our cacheline and the architecture, we
-   selectively add char buffering to this structure. The size is checked
-   via assert in census_log_initialize(). */
-#if defined(GPR_ARCH_64)
-#define CL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 64)
-#else
-#if defined(GPR_ARCH_32)
-#define CL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 32)
-#else
-#error "Unknown architecture"
-#endif
-#endif
-#if CL_BLOCK_PAD_SIZE > 0
-  char padding[CL_BLOCK_PAD_SIZE];
-#endif
-} cl_block;
-
-/* A list of cl_blocks, doubly-linked through cl_block::link. */
-typedef struct census_log_block_list {
-  int32_t count;           /* Number of items in list. */
-  cl_block_list_struct ht; /* head/tail of linked list. */
-} cl_block_list;
-
-/* Cacheline aligned block pointers to avoid false sharing. Block pointer must
-   be initialized via set_block(), before calling other functions */
-typedef struct census_log_core_local_block {
-  gpr_atm block;
-/* Ensure cachline alignment: we assume sizeof(gpr_atm) == 4 or 8 */
-#if defined(GPR_ARCH_64)
-#define CL_CORE_LOCAL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 8)
-#else
-#if defined(GPR_ARCH_32)
-#define CL_CORE_LOCAL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 4)
-#else
-#error "Unknown architecture"
-#endif
-#endif
-#if CL_CORE_LOCAL_BLOCK_PAD_SIZE > 0
-  char padding[CL_CORE_LOCAL_BLOCK_PAD_SIZE];
-#endif
-} cl_core_local_block;
-
-struct census_log {
-  int discard_old_records;
-  /* Number of cores (aka hardware-contexts) */
-  unsigned num_cores;
-  /* number of CENSUS_LOG_2_MAX_RECORD_SIZE blocks in log */
-  int32_t num_blocks;
-  cl_block *blocks;                       /* Block metadata. */
-  cl_core_local_block *core_local_blocks; /* Keeps core to block mappings. */
-  gpr_mu lock;
-  int initialized; /* has log been initialized? */
-  /* Keeps the state of the reader iterator. A value of 0 indicates that
-     iterator has reached the end. census_log_init_reader() resets the
-     value to num_core to restart iteration. */
-  uint32_t read_iterator_state;
-  /* Points to the block being read. If non-NULL, the block is locked for
-     reading (block_being_read_->reader_lock is held). */
-  cl_block *block_being_read;
-  /* A non-zero value indicates that log is full. */
-  gpr_atm is_full;
-  char *buffer;
-  cl_block_list free_block_list;
-  cl_block_list dirty_block_list;
-  gpr_atm out_of_space_count;
-};
-
-/* Single internal log */
-static struct census_log g_log;
-
-/* Functions that operate on an atomic memory location used as a lock */
-
-/* Returns non-zero if lock is acquired */
-static int cl_try_lock(gpr_atm *lock) { return gpr_atm_acq_cas(lock, 0, 1); }
-
-static void cl_unlock(gpr_atm *lock) { gpr_atm_rel_store(lock, 0); }
-
-/* Functions that operate on cl_core_local_block's */
-
-static void cl_core_local_block_set_block(cl_core_local_block *clb,
-                                          cl_block *block) {
-  gpr_atm_rel_store(&clb->block, (gpr_atm)block);
-}
-
-static cl_block *cl_core_local_block_get_block(cl_core_local_block *clb) {
-  return (cl_block *)gpr_atm_acq_load(&clb->block);
-}
-
-/* Functions that operate on cl_block_list_struct's */
-
-static void cl_block_list_struct_initialize(cl_block_list_struct *bls,
-                                            cl_block *block) {
-  bls->next = bls->prev = bls;
-  bls->block = block;
-}
-
-/* Functions that operate on cl_block_list's */
-
-static void cl_block_list_initialize(cl_block_list *list) {
-  list->count = 0;
-  cl_block_list_struct_initialize(&list->ht, NULL);
-}
-
-/* Returns head of *this, or NULL if empty. */
-static cl_block *cl_block_list_head(cl_block_list *list) {
-  return list->ht.next->block;
-}
-
-/* Insert element *e after *pos. */
-static void cl_block_list_insert(cl_block_list *list, cl_block_list_struct *pos,
-                                 cl_block_list_struct *e) {
-  list->count++;
-  e->next = pos->next;
-  e->prev = pos;
-  e->next->prev = e;
-  e->prev->next = e;
-}
-
-/* Insert block at the head of the list */
-static void cl_block_list_insert_at_head(cl_block_list *list, cl_block *block) {
-  cl_block_list_insert(list, &list->ht, &block->link);
-}
-
-/* Insert block at the tail of the list */
-static void cl_block_list_insert_at_tail(cl_block_list *list, cl_block *block) {
-  cl_block_list_insert(list, list->ht.prev, &block->link);
-}
-
-/* Removes block *b. Requires *b be in the list. */
-static void cl_block_list_remove(cl_block_list *list, cl_block *b) {
-  list->count--;
-  b->link.next->prev = b->link.prev;
-  b->link.prev->next = b->link.next;
-}
-
-/* Functions that operate on cl_block's */
-
-static void cl_block_initialize(cl_block *block, char *buffer) {
-  block->buffer = buffer;
-  gpr_atm_rel_store(&block->writer_lock, 0);
-  gpr_atm_rel_store(&block->reader_lock, 0);
-  gpr_atm_rel_store(&block->bytes_committed, 0);
-  block->bytes_read = 0;
-  cl_block_list_struct_initialize(&block->link, block);
-}
-
-/* Guards against exposing partially written buffer to the reader. */
-static void cl_block_set_bytes_committed(cl_block *block,
-                                         int32_t bytes_committed) {
-  gpr_atm_rel_store(&block->bytes_committed, bytes_committed);
-}
-
-static int32_t cl_block_get_bytes_committed(cl_block *block) {
-  return gpr_atm_acq_load(&block->bytes_committed);
-}
-
-/* Tries to disable future read/write access to this block. Succeeds if:
-   - no in-progress write AND
-   - no in-progress read AND
-   - 'discard_data' set to true OR no unread data
-   On success, clears the block state and returns with writer_lock_ and
-   reader_lock_ held. These locks are released by a subsequent
-   cl_block_access_enable() call. */
-static int cl_block_try_disable_access(cl_block *block, int discard_data) {
-  if (!cl_try_lock(&block->writer_lock)) {
-    return 0;
-  }
-  if (!cl_try_lock(&block->reader_lock)) {
-    cl_unlock(&block->writer_lock);
-    return 0;
-  }
-  if (!discard_data &&
-      (block->bytes_read != cl_block_get_bytes_committed(block))) {
-    cl_unlock(&block->reader_lock);
-    cl_unlock(&block->writer_lock);
-    return 0;
-  }
-  cl_block_set_bytes_committed(block, 0);
-  block->bytes_read = 0;
-  return 1;
-}
-
-static void cl_block_enable_access(cl_block *block) {
-  cl_unlock(&block->reader_lock);
-  cl_unlock(&block->writer_lock);
-}
-
-/* Returns with writer_lock held. */
-static void *cl_block_start_write(cl_block *block, size_t size) {
-  int32_t bytes_committed;
-  if (!cl_try_lock(&block->writer_lock)) {
-    return NULL;
-  }
-  bytes_committed = cl_block_get_bytes_committed(block);
-  if (bytes_committed + size > CENSUS_LOG_MAX_RECORD_SIZE) {
-    cl_unlock(&block->writer_lock);
-    return NULL;
-  }
-  return block->buffer + bytes_committed;
-}
-
-/* Releases writer_lock and increments committed bytes by 'bytes_written'.
-  'bytes_written' must be <= 'size' specified in the corresponding
-  StartWrite() call. This function is thread-safe. */
-static void cl_block_end_write(cl_block *block, size_t bytes_written) {
-  cl_block_set_bytes_committed(
-      block, cl_block_get_bytes_committed(block) + bytes_written);
-  cl_unlock(&block->writer_lock);
-}
-
-/* Returns a pointer to the first unread byte in buffer. The number of bytes
-   available are returned in 'bytes_available'. Acquires reader lock that is
-   released by a subsequent cl_block_end_read() call. Returns NULL if:
-   - read in progress
-   - no data available */
-static void *cl_block_start_read(cl_block *block, size_t *bytes_available) {
-  void *record;
-  if (!cl_try_lock(&block->reader_lock)) {
-    return NULL;
-  }
-  /* bytes_committed may change from under us. Use bytes_available to update
-     bytes_read below. */
-  *bytes_available = cl_block_get_bytes_committed(block) - block->bytes_read;
-  if (*bytes_available == 0) {
-    cl_unlock(&block->reader_lock);
-    return NULL;
-  }
-  record = block->buffer + block->bytes_read;
-  block->bytes_read += *bytes_available;
-  return record;
-}
-
-static void cl_block_end_read(cl_block *block) {
-  cl_unlock(&block->reader_lock);
-}
-
-/* Internal functions operating on g_log */
-
-/* Allocates a new free block (or recycles an available dirty block if log is
-   configured to discard old records). Returns NULL if out-of-space. */
-static cl_block *cl_allocate_block(void) {
-  cl_block *block = cl_block_list_head(&g_log.free_block_list);
-  if (block != NULL) {
-    cl_block_list_remove(&g_log.free_block_list, block);
-    return block;
-  }
-  if (!g_log.discard_old_records) {
-    /* No free block and log is configured to keep old records. */
-    return NULL;
-  }
-  /* Recycle dirty block. Start from the oldest. */
-  for (block = cl_block_list_head(&g_log.dirty_block_list); block != NULL;
-       block = block->link.next->block) {
-    if (cl_block_try_disable_access(block, 1 /* discard data */)) {
-      cl_block_list_remove(&g_log.dirty_block_list, block);
-      return block;
-    }
-  }
-  return NULL;
-}
-
-/* Allocates a new block and updates core id => block mapping. 'old_block'
-   points to the block that the caller thinks is attached to
-   'core_id'. 'old_block' may be NULL. Returns non-zero if:
-   - allocated a new block OR
-   - 'core_id' => 'old_block' mapping changed (another thread allocated a
-     block before lock was acquired). */
-static int cl_allocate_core_local_block(int32_t core_id, cl_block *old_block) {
-  /* Now that we have the lock, check if core-local mapping has changed. */
-  cl_core_local_block *core_local_block = &g_log.core_local_blocks[core_id];
-  cl_block *block = cl_core_local_block_get_block(core_local_block);
-  if ((block != NULL) && (block != old_block)) {
-    return 1;
-  }
-  if (block != NULL) {
-    cl_core_local_block_set_block(core_local_block, NULL);
-    cl_block_list_insert_at_tail(&g_log.dirty_block_list, block);
-  }
-  block = cl_allocate_block();
-  if (block == NULL) {
-    gpr_atm_rel_store(&g_log.is_full, 1);
-    return 0;
-  }
-  cl_core_local_block_set_block(core_local_block, block);
-  cl_block_enable_access(block);
-  return 1;
-}
-
-static cl_block *cl_get_block(void *record) {
-  uintptr_t p = (uintptr_t)((char *)record - g_log.buffer);
-  uintptr_t index = p >> CENSUS_LOG_2_MAX_RECORD_SIZE;
-  return &g_log.blocks[index];
-}
-
-/* Gets the next block to read and tries to free 'prev' block (if not NULL).
-   Returns NULL if reached the end. */
-static cl_block *cl_next_block_to_read(cl_block *prev) {
-  cl_block *block = NULL;
-  if (g_log.read_iterator_state == g_log.num_cores) {
-    /* We are traversing dirty list; find the next dirty block. */
-    if (prev != NULL) {
-      /* Try to free the previous block if there is no unread data. This block
-         may have unread data if previously incomplete record completed between
-         read_next() calls. */
-      block = prev->link.next->block;
-      if (cl_block_try_disable_access(prev, 0 /* do not discard data */)) {
-        cl_block_list_remove(&g_log.dirty_block_list, prev);
-        cl_block_list_insert_at_head(&g_log.free_block_list, prev);
-        gpr_atm_rel_store(&g_log.is_full, 0);
-      }
-    } else {
-      block = cl_block_list_head(&g_log.dirty_block_list);
-    }
-    if (block != NULL) {
-      return block;
-    }
-    /* We are done with the dirty list; moving on to core-local blocks. */
-  }
-  while (g_log.read_iterator_state > 0) {
-    g_log.read_iterator_state--;
-    block = cl_core_local_block_get_block(
-        &g_log.core_local_blocks[g_log.read_iterator_state]);
-    if (block != NULL) {
-      return block;
-    }
-  }
-  return NULL;
-}
-
-/* External functions: primary stats_log interface */
-void census_log_initialize(size_t size_in_mb, int discard_old_records) {
-  int32_t ix;
-  /* Check cacheline alignment. */
-  GPR_ASSERT(sizeof(cl_block) % GPR_CACHELINE_SIZE == 0);
-  GPR_ASSERT(sizeof(cl_core_local_block) % GPR_CACHELINE_SIZE == 0);
-  GPR_ASSERT(!g_log.initialized);
-  g_log.discard_old_records = discard_old_records;
-  g_log.num_cores = gpr_cpu_num_cores();
-  /* Ensure at least as many blocks as there are cores. */
-  g_log.num_blocks = GPR_MAX(
-      g_log.num_cores, (size_in_mb << 20) >> CENSUS_LOG_2_MAX_RECORD_SIZE);
-  gpr_mu_init(&g_log.lock);
-  g_log.read_iterator_state = 0;
-  g_log.block_being_read = NULL;
-  gpr_atm_rel_store(&g_log.is_full, 0);
-  g_log.core_local_blocks = (cl_core_local_block *)gpr_malloc_aligned(
-      g_log.num_cores * sizeof(cl_core_local_block), GPR_CACHELINE_SIZE_LOG);
-  memset(g_log.core_local_blocks, 0,
-         g_log.num_cores * sizeof(cl_core_local_block));
-  g_log.blocks = (cl_block *)gpr_malloc_aligned(
-      g_log.num_blocks * sizeof(cl_block), GPR_CACHELINE_SIZE_LOG);
-  memset(g_log.blocks, 0, g_log.num_blocks * sizeof(cl_block));
-  g_log.buffer = gpr_malloc(g_log.num_blocks * CENSUS_LOG_MAX_RECORD_SIZE);
-  memset(g_log.buffer, 0, g_log.num_blocks * CENSUS_LOG_MAX_RECORD_SIZE);
-  cl_block_list_initialize(&g_log.free_block_list);
-  cl_block_list_initialize(&g_log.dirty_block_list);
-  for (ix = 0; ix < g_log.num_blocks; ++ix) {
-    cl_block *block = g_log.blocks + ix;
-    cl_block_initialize(block,
-                        g_log.buffer + (CENSUS_LOG_MAX_RECORD_SIZE * ix));
-    cl_block_try_disable_access(block, 1 /* discard data */);
-    cl_block_list_insert_at_tail(&g_log.free_block_list, block);
-  }
-  gpr_atm_rel_store(&g_log.out_of_space_count, 0);
-  g_log.initialized = 1;
-}
-
-void census_log_shutdown(void) {
-  GPR_ASSERT(g_log.initialized);
-  gpr_mu_destroy(&g_log.lock);
-  gpr_free_aligned(g_log.core_local_blocks);
-  g_log.core_local_blocks = NULL;
-  gpr_free_aligned(g_log.blocks);
-  g_log.blocks = NULL;
-  gpr_free(g_log.buffer);
-  g_log.buffer = NULL;
-  g_log.initialized = 0;
-}
-
-void *census_log_start_write(size_t size) {
-  /* Used to bound number of times block allocation is attempted. */
-  int32_t attempts_remaining = g_log.num_blocks;
-  /* TODO(aveitch): move this inside the do loop when current_cpu is fixed */
-  int32_t core_id = gpr_cpu_current_cpu();
-  GPR_ASSERT(g_log.initialized);
-  if (size > CENSUS_LOG_MAX_RECORD_SIZE) {
-    return NULL;
-  }
-  do {
-    int allocated;
-    void *record = NULL;
-    cl_block *block =
-        cl_core_local_block_get_block(&g_log.core_local_blocks[core_id]);
-    if (block && (record = cl_block_start_write(block, size))) {
-      return record;
-    }
-    /* Need to allocate a new block. We are here if:
-       - No block associated with the core OR
-       - Write in-progress on the block OR
-       - block is out of space */
-    if (gpr_atm_acq_load(&g_log.is_full)) {
-      gpr_atm_no_barrier_fetch_add(&g_log.out_of_space_count, 1);
-      return NULL;
-    }
-    gpr_mu_lock(&g_log.lock);
-    allocated = cl_allocate_core_local_block(core_id, block);
-    gpr_mu_unlock(&g_log.lock);
-    if (!allocated) {
-      gpr_atm_no_barrier_fetch_add(&g_log.out_of_space_count, 1);
-      return NULL;
-    }
-  } while (attempts_remaining--);
-  /* Give up. */
-  gpr_atm_no_barrier_fetch_add(&g_log.out_of_space_count, 1);
-  return NULL;
-}
-
-void census_log_end_write(void *record, size_t bytes_written) {
-  GPR_ASSERT(g_log.initialized);
-  cl_block_end_write(cl_get_block(record), bytes_written);
-}
-
-void census_log_init_reader(void) {
-  GPR_ASSERT(g_log.initialized);
-  gpr_mu_lock(&g_log.lock);
-  /* If a block is locked for reading unlock it. */
-  if (g_log.block_being_read != NULL) {
-    cl_block_end_read(g_log.block_being_read);
-    g_log.block_being_read = NULL;
-  }
-  g_log.read_iterator_state = g_log.num_cores;
-  gpr_mu_unlock(&g_log.lock);
-}
-
-const void *census_log_read_next(size_t *bytes_available) {
-  GPR_ASSERT(g_log.initialized);
-  gpr_mu_lock(&g_log.lock);
-  if (g_log.block_being_read != NULL) {
-    cl_block_end_read(g_log.block_being_read);
-  }
-  do {
-    g_log.block_being_read = cl_next_block_to_read(g_log.block_being_read);
-    if (g_log.block_being_read != NULL) {
-      void *record =
-          cl_block_start_read(g_log.block_being_read, bytes_available);
-      if (record != NULL) {
-        gpr_mu_unlock(&g_log.lock);
-        return record;
-      }
-    }
-  } while (g_log.block_being_read != NULL);
-  gpr_mu_unlock(&g_log.lock);
-  return NULL;
-}
-
-size_t census_log_remaining_space(void) {
-  size_t space;
-  GPR_ASSERT(g_log.initialized);
-  gpr_mu_lock(&g_log.lock);
-  if (g_log.discard_old_records) {
-    /* Remaining space is not meaningful; just return the entire log space. */
-    space = g_log.num_blocks << CENSUS_LOG_2_MAX_RECORD_SIZE;
-  } else {
-    space = g_log.free_block_list.count * CENSUS_LOG_MAX_RECORD_SIZE;
-  }
-  gpr_mu_unlock(&g_log.lock);
-  return space;
-}
-
-int census_log_out_of_space_count(void) {
-  GPR_ASSERT(g_log.initialized);
-  return gpr_atm_acq_load(&g_log.out_of_space_count);
-}
diff --git a/src/core/ext/census/census_log.h b/src/core/ext/census/census_log.h
deleted file mode 100644
index ee336ae..0000000
--- a/src/core/ext/census/census_log.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H
-#define GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H
-
-#include <stddef.h>
-
-/* Maximum record size, in bytes. */
-#define CENSUS_LOG_2_MAX_RECORD_SIZE 14 /* 2^14 = 16KB */
-#define CENSUS_LOG_MAX_RECORD_SIZE (1 << CENSUS_LOG_2_MAX_RECORD_SIZE)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Initialize the statistics logging subsystem with the given log size. A log
-   size of 0 will result in the smallest possible log for the platform
-   (approximately CENSUS_LOG_MAX_RECORD_SIZE * gpr_cpu_num_cores()). If
-   discard_old_records is non-zero, then new records will displace older ones
-   when the log is full. This function must be called before any other
-   census_log functions.
-*/
-void census_log_initialize(size_t size_in_mb, int discard_old_records);
-
-/* Shutdown the logging subsystem. Caller must ensure that:
-   - no in progress or future call to any census_log functions
-   - no incomplete records
-*/
-void census_log_shutdown(void);
-
-/* Allocates and returns a 'size' bytes record and marks it in use. A
-   subsequent census_log_end_write() marks the record complete. The
-   'bytes_written' census_log_end_write() argument must be <=
-   'size'. Returns NULL if out-of-space AND:
-       - log is configured to keep old records OR
-       - all blocks are pinned by incomplete records.
-*/
-void *census_log_start_write(size_t size);
-
-void census_log_end_write(void *record, size_t bytes_written);
-
-/* census_log_read_next() iterates over blocks with data and for each block
-   returns a pointer to the first unread byte. The number of bytes that can be
-   read are returned in 'bytes_available'. Reader is expected to read all
-   available data. Reading the data consumes it i.e. it cannot be read again.
-   census_log_read_next() returns NULL if the end is reached i.e last block
-   is read. census_log_init_reader() starts the iteration or aborts the
-   current iteration.
-*/
-void census_log_init_reader(void);
-const void *census_log_read_next(size_t *bytes_available);
-
-/* Returns estimated remaining space across all blocks, in bytes. If log is
-   configured to discard old records, returns total log space. Otherwise,
-   returns space available in empty blocks (partially filled blocks are
-   treated as full).
-*/
-size_t census_log_remaining_space(void);
-
-/* Returns the number of times grpc_stats_log_start_write() failed due to
-   out-of-space. */
-int census_log_out_of_space_count(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H */
diff --git a/src/core/ext/census/census_rpc_stats.cc b/src/core/ext/census/census_rpc_stats.cc
deleted file mode 100644
index 0aca1f1..0000000
--- a/src/core/ext/census/census_rpc_stats.cc
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include "src/core/ext/census/census_interface.h"
-#include "src/core/ext/census/census_rpc_stats.h"
-#include "src/core/ext/census/census_tracing.h"
-#include "src/core/ext/census/hash_table.h"
-#include "src/core/ext/census/window_stats.h"
-#include "src/core/lib/support/murmur_hash.h"
-#include "src/core/lib/support/string.h"
-
-#define NUM_INTERVALS 3
-#define MINUTE_INTERVAL 0
-#define HOUR_INTERVAL 1
-#define TOTAL_INTERVAL 2
-
-/* for easier typing */
-typedef census_per_method_rpc_stats per_method_stats;
-
-/* Ensure mu is only initialized once. */
-static gpr_once g_stats_store_mu_init = GPR_ONCE_INIT;
-/* Guards two stats stores. */
-static gpr_mu g_mu;
-static census_ht *g_client_stats_store = NULL;
-static census_ht *g_server_stats_store = NULL;
-
-static void init_mutex(void) { gpr_mu_init(&g_mu); }
-
-static void init_mutex_once(void) {
-  gpr_once_init(&g_stats_store_mu_init, init_mutex);
-}
-
-static int cmp_str_keys(const void *k1, const void *k2) {
-  return strcmp((const char *)k1, (const char *)k2);
-}
-
-/* TODO(hongyu): replace it with cityhash64 */
-static uint64_t simple_hash(const void *k) {
-  size_t len = strlen(k);
-  uint64_t higher = gpr_murmur_hash3((const char *)k, len / 2, 0);
-  return higher << 32 |
-         gpr_murmur_hash3((const char *)k + len / 2, len - len / 2, 0);
-}
-
-static void delete_stats(void *stats) {
-  census_window_stats_destroy((struct census_window_stats *)stats);
-}
-
-static void delete_key(void *key) { gpr_free(key); }
-
-static const census_ht_option ht_opt = {
-    CENSUS_HT_POINTER /* key type */, 1999 /* n_of_buckets */,
-    simple_hash /* hash function */,  cmp_str_keys /* key comparator */,
-    delete_stats /* data deleter */,  delete_key /* key deleter */
-};
-
-static void init_rpc_stats(void *stats) {
-  memset(stats, 0, sizeof(census_rpc_stats));
-}
-
-static void stat_add_proportion(double p, void *base, const void *addme) {
-  census_rpc_stats *b = (census_rpc_stats *)base;
-  census_rpc_stats *a = (census_rpc_stats *)addme;
-  b->cnt += p * a->cnt;
-  b->rpc_error_cnt += p * a->rpc_error_cnt;
-  b->app_error_cnt += p * a->app_error_cnt;
-  b->elapsed_time_ms += p * a->elapsed_time_ms;
-  b->api_request_bytes += p * a->api_request_bytes;
-  b->wire_request_bytes += p * a->wire_request_bytes;
-  b->api_response_bytes += p * a->api_response_bytes;
-  b->wire_response_bytes += p * a->wire_response_bytes;
-}
-
-static void stat_add(void *base, const void *addme) {
-  stat_add_proportion(1.0, base, addme);
-}
-
-static gpr_timespec min_hour_total_intervals[3] = {
-    {60, 0}, {3600, 0}, {36000000, 0}};
-
-static const census_window_stats_stat_info window_stats_settings = {
-    sizeof(census_rpc_stats), init_rpc_stats, stat_add, stat_add_proportion};
-
-census_rpc_stats *census_rpc_stats_create_empty(void) {
-  census_rpc_stats *ret =
-      (census_rpc_stats *)gpr_malloc(sizeof(census_rpc_stats));
-  memset(ret, 0, sizeof(census_rpc_stats));
-  return ret;
-}
-
-void census_aggregated_rpc_stats_set_empty(census_aggregated_rpc_stats *data) {
-  int i = 0;
-  for (i = 0; i < data->num_entries; i++) {
-    if (data->stats[i].method != NULL) {
-      gpr_free((void *)data->stats[i].method);
-    }
-  }
-  if (data->stats != NULL) {
-    gpr_free(data->stats);
-  }
-  data->num_entries = 0;
-  data->stats = NULL;
-}
-
-static void record_stats(census_ht *store, census_op_id op_id,
-                         const census_rpc_stats *stats) {
-  gpr_mu_lock(&g_mu);
-  if (store != NULL) {
-    census_trace_obj *trace = NULL;
-    census_internal_lock_trace_store();
-    trace = census_get_trace_obj_locked(op_id);
-    if (trace != NULL) {
-      const char *method_name = census_get_trace_method_name(trace);
-      struct census_window_stats *window_stats = NULL;
-      census_ht_key key;
-      key.ptr = (void *)method_name;
-      window_stats = census_ht_find(store, key);
-      census_internal_unlock_trace_store();
-      if (window_stats == NULL) {
-        window_stats = census_window_stats_create(3, min_hour_total_intervals,
-                                                  30, &window_stats_settings);
-        key.ptr = gpr_strdup(key.ptr);
-        census_ht_insert(store, key, (void *)window_stats);
-      }
-      census_window_stats_add(window_stats, gpr_now(GPR_CLOCK_REALTIME), stats);
-    } else {
-      census_internal_unlock_trace_store();
-    }
-  }
-  gpr_mu_unlock(&g_mu);
-}
-
-void census_record_rpc_client_stats(census_op_id op_id,
-                                    const census_rpc_stats *stats) {
-  record_stats(g_client_stats_store, op_id, stats);
-}
-
-void census_record_rpc_server_stats(census_op_id op_id,
-                                    const census_rpc_stats *stats) {
-  record_stats(g_server_stats_store, op_id, stats);
-}
-
-/* Get stats from input stats store */
-static void get_stats(census_ht *store, census_aggregated_rpc_stats *data) {
-  GPR_ASSERT(data != NULL);
-  if (data->num_entries != 0) {
-    census_aggregated_rpc_stats_set_empty(data);
-  }
-  gpr_mu_lock(&g_mu);
-  if (store != NULL) {
-    size_t n;
-    unsigned i, j;
-    gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
-    census_ht_kv *kv = census_ht_get_all_elements(store, &n);
-    if (kv != NULL) {
-      data->num_entries = n;
-      data->stats =
-          (per_method_stats *)gpr_malloc(sizeof(per_method_stats) * n);
-      for (i = 0; i < n; i++) {
-        census_window_stats_sums sums[NUM_INTERVALS];
-        for (j = 0; j < NUM_INTERVALS; j++) {
-          sums[j].statistic = (void *)census_rpc_stats_create_empty();
-        }
-        data->stats[i].method = gpr_strdup(kv[i].k.ptr);
-        census_window_stats_get_sums(kv[i].v, now, sums);
-        data->stats[i].minute_stats =
-            *(census_rpc_stats *)sums[MINUTE_INTERVAL].statistic;
-        data->stats[i].hour_stats =
-            *(census_rpc_stats *)sums[HOUR_INTERVAL].statistic;
-        data->stats[i].total_stats =
-            *(census_rpc_stats *)sums[TOTAL_INTERVAL].statistic;
-        for (j = 0; j < NUM_INTERVALS; j++) {
-          gpr_free(sums[j].statistic);
-        }
-      }
-      gpr_free(kv);
-    }
-  }
-  gpr_mu_unlock(&g_mu);
-}
-
-void census_get_client_stats(census_aggregated_rpc_stats *data) {
-  get_stats(g_client_stats_store, data);
-}
-
-void census_get_server_stats(census_aggregated_rpc_stats *data) {
-  get_stats(g_server_stats_store, data);
-}
-
-void census_stats_store_init(void) {
-  init_mutex_once();
-  gpr_mu_lock(&g_mu);
-  if (g_client_stats_store == NULL && g_server_stats_store == NULL) {
-    g_client_stats_store = census_ht_create(&ht_opt);
-    g_server_stats_store = census_ht_create(&ht_opt);
-  } else {
-    gpr_log(GPR_ERROR, "Census stats store already initialized.");
-  }
-  gpr_mu_unlock(&g_mu);
-}
-
-void census_stats_store_shutdown(void) {
-  init_mutex_once();
-  gpr_mu_lock(&g_mu);
-  if (g_client_stats_store != NULL) {
-    census_ht_destroy(g_client_stats_store);
-    g_client_stats_store = NULL;
-  } else {
-    gpr_log(GPR_ERROR, "Census server stats store not initialized.");
-  }
-  if (g_server_stats_store != NULL) {
-    census_ht_destroy(g_server_stats_store);
-    g_server_stats_store = NULL;
-  } else {
-    gpr_log(GPR_ERROR, "Census client stats store not initialized.");
-  }
-  gpr_mu_unlock(&g_mu);
-}
diff --git a/src/core/ext/census/census_rpc_stats.h b/src/core/ext/census/census_rpc_stats.h
deleted file mode 100644
index 8004ade..0000000
--- a/src/core/ext/census/census_rpc_stats.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_CENSUS_RPC_STATS_H
-#define GRPC_CORE_EXT_CENSUS_CENSUS_RPC_STATS_H
-
-#include <grpc/support/port_platform.h>
-#include "src/core/ext/census/census_interface.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct census_rpc_stats {
-  uint64_t cnt;
-  uint64_t rpc_error_cnt;
-  uint64_t app_error_cnt;
-  double elapsed_time_ms;
-  double api_request_bytes;
-  double wire_request_bytes;
-  double api_response_bytes;
-  double wire_response_bytes;
-};
-
-/* Creates an empty rpc stats object on heap. */
-census_rpc_stats *census_rpc_stats_create_empty(void);
-
-typedef struct census_per_method_rpc_stats {
-  const char *method;
-  census_rpc_stats minute_stats; /* cumulative stats in the past minute */
-  census_rpc_stats hour_stats;   /* cumulative stats in the past hour */
-  census_rpc_stats total_stats;  /* cumulative stats from last gc */
-} census_per_method_rpc_stats;
-
-typedef struct census_aggregated_rpc_stats {
-  int num_entries;
-  census_per_method_rpc_stats *stats;
-} census_aggregated_rpc_stats;
-
-/* Initializes an aggregated rpc stats object to an empty state. */
-void census_aggregated_rpc_stats_set_empty(census_aggregated_rpc_stats *data);
-
-/* Records client side stats of a rpc. */
-void census_record_rpc_client_stats(census_op_id op_id,
-                                    const census_rpc_stats *stats);
-
-/* Records server side stats of a rpc. */
-void census_record_rpc_server_stats(census_op_id op_id,
-                                    const census_rpc_stats *stats);
-
-/* The following two functions are intended for inprocess query of
-   per-service per-method stats from grpc implementations. */
-
-/* Populates *data_map with server side aggregated per-service per-method
-   stats.
-   DO NOT CALL from outside of grpc code. */
-void census_get_server_stats(census_aggregated_rpc_stats *data_map);
-
-/* Populates *data_map with client side aggregated per-service per-method
-   stats.
-   DO NOT CALL from outside of grpc code. */
-void census_get_client_stats(census_aggregated_rpc_stats *data_map);
-
-void census_stats_store_init(void);
-void census_stats_store_shutdown(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_RPC_STATS_H */
diff --git a/src/core/ext/census/census_tracing.cc b/src/core/ext/census/census_tracing.cc
deleted file mode 100644
index 199b260..0000000
--- a/src/core/ext/census/census_tracing.cc
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/census_tracing.h"
-#include "src/core/ext/census/census_interface.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/sync.h>
-#include "src/core/ext/census/hash_table.h"
-#include "src/core/lib/support/string.h"
-
-void census_trace_obj_destroy(census_trace_obj *obj) {
-  census_trace_annotation *p = obj->annotations;
-  while (p != NULL) {
-    census_trace_annotation *next = p->next;
-    gpr_free(p);
-    p = next;
-  }
-  gpr_free(obj->method);
-  gpr_free(obj);
-}
-
-static void delete_trace_obj(void *obj) {
-  census_trace_obj_destroy((census_trace_obj *)obj);
-}
-
-static const census_ht_option ht_opt = {
-    CENSUS_HT_UINT64 /* key type */,
-    571 /* n_of_buckets */,
-    NULL /* hash */,
-    NULL /* compare_keys */,
-    delete_trace_obj /* delete data */,
-    NULL /* delete key */
-};
-
-static gpr_once g_init_mutex_once = GPR_ONCE_INIT;
-static gpr_mu g_mu; /* Guards following two static variables. */
-static census_ht *g_trace_store = NULL;
-static uint64_t g_id = 0;
-
-static census_ht_key op_id_as_key(census_op_id *id) {
-  return *(census_ht_key *)id;
-}
-
-static uint64_t op_id_2_uint64(census_op_id *id) {
-  uint64_t ret;
-  memcpy(&ret, id, sizeof(census_op_id));
-  return ret;
-}
-
-static void init_mutex(void) { gpr_mu_init(&g_mu); }
-
-static void init_mutex_once(void) {
-  gpr_once_init(&g_init_mutex_once, init_mutex);
-}
-
-census_op_id census_tracing_start_op(void) {
-  gpr_mu_lock(&g_mu);
-  {
-    census_trace_obj *ret = gpr_malloc(sizeof(census_trace_obj));
-    memset(ret, 0, sizeof(census_trace_obj));
-    g_id++;
-    memcpy(&ret->id, &g_id, sizeof(census_op_id));
-    ret->rpc_stats.cnt = 1;
-    ret->ts = gpr_now(GPR_CLOCK_REALTIME);
-    census_ht_insert(g_trace_store, op_id_as_key(&ret->id), (void *)ret);
-    gpr_log(GPR_DEBUG, "Start tracing for id %lu", g_id);
-    gpr_mu_unlock(&g_mu);
-    return ret->id;
-  }
-}
-
-int census_add_method_tag(census_op_id op_id, const char *method) {
-  int ret = 0;
-  census_trace_obj *trace = NULL;
-  gpr_mu_lock(&g_mu);
-  trace = census_ht_find(g_trace_store, op_id_as_key(&op_id));
-  if (trace == NULL) {
-    ret = 1;
-  } else {
-    trace->method = gpr_strdup(method);
-  }
-  gpr_mu_unlock(&g_mu);
-  return ret;
-}
-
-void census_tracing_print(census_op_id op_id, const char *anno_txt) {
-  census_trace_obj *trace = NULL;
-  gpr_mu_lock(&g_mu);
-  trace = census_ht_find(g_trace_store, op_id_as_key(&op_id));
-  if (trace != NULL) {
-    census_trace_annotation *anno = gpr_malloc(sizeof(census_trace_annotation));
-    anno->ts = gpr_now(GPR_CLOCK_REALTIME);
-    {
-      char *d = anno->txt;
-      const char *s = anno_txt;
-      int n = 0;
-      for (; n < CENSUS_MAX_ANNOTATION_LENGTH && *s != '\0'; ++n) {
-        *d++ = *s++;
-      }
-      *d = '\0';
-    }
-    anno->next = trace->annotations;
-    trace->annotations = anno;
-  }
-  gpr_mu_unlock(&g_mu);
-}
-
-void census_tracing_end_op(census_op_id op_id) {
-  census_trace_obj *trace = NULL;
-  gpr_mu_lock(&g_mu);
-  trace = census_ht_find(g_trace_store, op_id_as_key(&op_id));
-  if (trace != NULL) {
-    trace->rpc_stats.elapsed_time_ms = gpr_timespec_to_micros(
-        gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), trace->ts));
-    gpr_log(GPR_DEBUG, "End tracing for id %lu, method %s, latency %f us",
-            op_id_2_uint64(&op_id), trace->method,
-            trace->rpc_stats.elapsed_time_ms);
-    census_ht_erase(g_trace_store, op_id_as_key(&op_id));
-  }
-  gpr_mu_unlock(&g_mu);
-}
-
-void census_tracing_init(void) {
-  init_mutex_once();
-  gpr_mu_lock(&g_mu);
-  if (g_trace_store == NULL) {
-    g_id = 1;
-    g_trace_store = census_ht_create(&ht_opt);
-  } else {
-    gpr_log(GPR_ERROR, "Census trace store already initialized.");
-  }
-  gpr_mu_unlock(&g_mu);
-}
-
-void census_tracing_shutdown(void) {
-  gpr_mu_lock(&g_mu);
-  if (g_trace_store != NULL) {
-    census_ht_destroy(g_trace_store);
-    g_trace_store = NULL;
-  } else {
-    gpr_log(GPR_ERROR, "Census trace store is not initialized.");
-  }
-  gpr_mu_unlock(&g_mu);
-}
-
-void census_internal_lock_trace_store(void) { gpr_mu_lock(&g_mu); }
-
-void census_internal_unlock_trace_store(void) { gpr_mu_unlock(&g_mu); }
-
-census_trace_obj *census_get_trace_obj_locked(census_op_id op_id) {
-  if (g_trace_store == NULL) {
-    gpr_log(GPR_ERROR, "Census trace store is not initialized.");
-    return NULL;
-  }
-  return (census_trace_obj *)census_ht_find(g_trace_store,
-                                            op_id_as_key(&op_id));
-}
-
-const char *census_get_trace_method_name(const census_trace_obj *trace) {
-  return trace->method;
-}
-
-static census_trace_annotation *dup_annotation_chain(
-    census_trace_annotation *from) {
-  census_trace_annotation *ret = NULL;
-  census_trace_annotation **to = &ret;
-  for (; from != NULL; from = from->next) {
-    *to = gpr_malloc(sizeof(census_trace_annotation));
-    memcpy(*to, from, sizeof(census_trace_annotation));
-    to = &(*to)->next;
-  }
-  return ret;
-}
-
-static census_trace_obj *trace_obj_dup(census_trace_obj *from) {
-  census_trace_obj *to = NULL;
-  GPR_ASSERT(from != NULL);
-  to = gpr_malloc(sizeof(census_trace_obj));
-  to->id = from->id;
-  to->ts = from->ts;
-  to->rpc_stats = from->rpc_stats;
-  to->method = gpr_strdup(from->method);
-  to->annotations = dup_annotation_chain(from->annotations);
-  return to;
-}
-
-census_trace_obj **census_get_active_ops(int *num_active_ops) {
-  census_trace_obj **ret = NULL;
-  gpr_mu_lock(&g_mu);
-  if (g_trace_store != NULL) {
-    size_t n = 0;
-    census_ht_kv *all_kvs = census_ht_get_all_elements(g_trace_store, &n);
-    *num_active_ops = (int)n;
-    if (n != 0) {
-      size_t i = 0;
-      ret = gpr_malloc(sizeof(census_trace_obj *) * n);
-      for (i = 0; i < n; i++) {
-        ret[i] = trace_obj_dup((census_trace_obj *)all_kvs[i].v);
-      }
-    }
-    gpr_free(all_kvs);
-  }
-  gpr_mu_unlock(&g_mu);
-  return ret;
-}
diff --git a/src/core/ext/census/census_tracing.h b/src/core/ext/census/census_tracing.h
deleted file mode 100644
index ccb767f..0000000
--- a/src/core/ext/census/census_tracing.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_CENSUS_TRACING_H
-#define GRPC_CORE_EXT_CENSUS_CENSUS_TRACING_H
-
-#include <grpc/support/time.h>
-#include "src/core/ext/census/census_rpc_stats.h"
-
-/* WARNING: The data structures and APIs provided by this file are for GRPC
-   library's internal use ONLY. They might be changed in backward-incompatible
-   ways and are not subject to any deprecation policy.
-   They are not recommended for external use.
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Struct for a trace annotation. */
-typedef struct census_trace_annotation {
-  gpr_timespec ts;                            /* timestamp of the annotation */
-  char txt[CENSUS_MAX_ANNOTATION_LENGTH + 1]; /* actual txt annotation */
-  struct census_trace_annotation *next;
-} census_trace_annotation;
-
-typedef struct census_trace_obj {
-  census_op_id id;
-  gpr_timespec ts;
-  census_rpc_stats rpc_stats;
-  char *method;
-  census_trace_annotation *annotations;
-} census_trace_obj;
-
-/* Deletes trace object. */
-void census_trace_obj_destroy(census_trace_obj *obj);
-
-/* Initializes trace store. This function is thread safe. */
-void census_tracing_init(void);
-
-/* Shutsdown trace store. This function is thread safe. */
-void census_tracing_shutdown(void);
-
-/* Gets trace obj corresponding to the input op_id. Returns NULL if trace store
-   is not initialized or trace obj is not found. Requires trace store being
-   locked before calling this function. */
-census_trace_obj *census_get_trace_obj_locked(census_op_id op_id);
-
-/* The following two functions acquire and release the trace store global lock.
-   They are for census internal use only. */
-void census_internal_lock_trace_store(void);
-void census_internal_unlock_trace_store(void);
-
-/* Gets method name associated with the input trace object. */
-const char *census_get_trace_method_name(const census_trace_obj *trace);
-
-/* Returns an array of pointers to trace objects of currently active operations
-   and fills in number of active operations. Returns NULL if there are no active
-   operations.
-   Caller owns the returned objects. */
-census_trace_obj **census_get_active_ops(int *num_active_ops);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_TRACING_H */
diff --git a/src/core/ext/census/context.cc b/src/core/ext/census/context.cc
deleted file mode 100644
index 9b25a32..0000000
--- a/src/core/ext/census/context.cc
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/census.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/useful.h>
-#include <stdbool.h>
-#include <string.h>
-#include "src/core/lib/support/string.h"
-
-// Functions in this file support the public context API, including
-// encoding/decoding as part of context propagation across RPC's. The overall
-// requirements (in approximate priority order) for the
-// context representation:
-// 1. Efficient conversion to/from wire format
-// 2. Minimal bytes used on-wire
-// 3. Efficient context creation
-// 4. Efficient lookup of tag value for a key
-// 5. Efficient iteration over tags
-// 6. Minimal memory footprint
-//
-// Notes on tradeoffs/decisions:
-// * tag includes 1 byte length of key, as well as nil-terminating byte. These
-//   are to aid in efficient parsing and the ability to directly return key
-//   strings. This is more important than saving a single byte/tag on the wire.
-// * The wire encoding uses only single byte values. This eliminates the need
-//   to handle endian-ness conversions. It also means there is a hard upper
-//   limit of 255 for both CENSUS_MAX_TAG_KV_LEN and CENSUS_MAX_PROPAGATED_TAGS.
-// * Keep all tag information (keys/values/flags) in a single memory buffer,
-//   that can be directly copied to the wire.
-
-// min and max valid chars in tag keys and values. All printable ASCII is OK.
-#define MIN_VALID_TAG_CHAR 32   // ' '
-#define MAX_VALID_TAG_CHAR 126  // '~'
-
-// Structure representing a set of tags. Essentially a count of number of tags
-// present, and pointer to a chunk of memory that contains the per-tag details.
-struct tag_set {
-  int ntags;        // number of tags.
-  int ntags_alloc;  // ntags + number of deleted tags (total number of tags
-  // in all of kvm). This will always be == ntags, except during the process
-  // of building a new tag set.
-  size_t kvm_size;  // number of bytes allocated for key/value storage.
-  size_t kvm_used;  // number of bytes of used key/value memory
-  char *kvm;        // key/value memory. Consists of repeated entries of:
-  //   Offset  Size  Description
-  //     0      1    Key length, including trailing 0. (K)
-  //     1      1    Value length, including trailing 0 (V)
-  //     2      1    Flags
-  //     3      K    Key bytes
-  //     3 + K  V    Value bytes
-  //
-  // We refer to the first 3 entries as the 'tag header'. If extra values are
-  // introduced in the header, you will need to modify the TAG_HEADER_SIZE
-  // constant, the raw_tag structure (and everything that uses it) and the
-  // encode/decode functions appropriately.
-};
-
-// Number of bytes in tag header.
-#define TAG_HEADER_SIZE 3  // key length (1) + value length (1) + flags (1)
-// Offsets to tag header entries.
-#define KEY_LEN_OFFSET 0
-#define VALUE_LEN_OFFSET 1
-#define FLAG_OFFSET 2
-
-// raw_tag represents the raw-storage form of a tag in the kvm of a tag_set.
-struct raw_tag {
-  uint8_t key_len;
-  uint8_t value_len;
-  uint8_t flags;
-  char *key;
-  char *value;
-};
-
-// Use a reserved flag bit for indication of deleted tag.
-#define CENSUS_TAG_DELETED CENSUS_TAG_RESERVED
-#define CENSUS_TAG_IS_DELETED(flags) (flags & CENSUS_TAG_DELETED)
-
-// Primary representation of a context. Composed of 2 underlying tag_set
-// structs, one each for propagated and local (non-propagated) tags. This is
-// to efficiently support tag encoding/decoding.
-// TODO(aveitch): need to add tracing id's/structure.
-struct census_context {
-  struct tag_set tags[2];
-  census_context_status status;
-};
-
-// Indices into the tags member of census_context
-#define PROPAGATED_TAGS 0
-#define LOCAL_TAGS 1
-
-// Validate (check all characters are in range and size is less than limit) a
-// key or value string. Returns 0 if the string is invalid, or the length
-// (including terminator) if valid.
-static size_t validate_tag(const char *kv) {
-  size_t len = 1;
-  char ch;
-  while ((ch = *kv++) != 0) {
-    if (ch < MIN_VALID_TAG_CHAR || ch > MAX_VALID_TAG_CHAR) {
-      return 0;
-    }
-    len++;
-  }
-  if (len > CENSUS_MAX_TAG_KV_LEN) {
-    return 0;
-  }
-  return len;
-}
-
-// Extract a raw tag given a pointer (raw) to the tag header. Allow for some
-// extra bytes in the tag header (see encode/decode functions for usage: this
-// allows for future expansion of the tag header).
-static char *decode_tag(struct raw_tag *tag, char *header, int offset) {
-  tag->key_len = (uint8_t)(*header++);
-  tag->value_len = (uint8_t)(*header++);
-  tag->flags = (uint8_t)(*header++);
-  header += offset;
-  tag->key = header;
-  header += tag->key_len;
-  tag->value = header;
-  return header + tag->value_len;
-}
-
-// Make a copy (in 'to') of an existing tag_set.
-static void tag_set_copy(struct tag_set *to, const struct tag_set *from) {
-  memcpy(to, from, sizeof(struct tag_set));
-  to->kvm = (char *)gpr_malloc(to->kvm_size);
-  memcpy(to->kvm, from->kvm, from->kvm_used);
-}
-
-// Delete a tag from a tag_set, if it exists (returns true if it did).
-static bool tag_set_delete_tag(struct tag_set *tags, const char *key,
-                               size_t key_len) {
-  char *kvp = tags->kvm;
-  for (int i = 0; i < tags->ntags_alloc; i++) {
-    uint8_t *flags = (uint8_t *)(kvp + FLAG_OFFSET);
-    struct raw_tag tag;
-    kvp = decode_tag(&tag, kvp, 0);
-    if (CENSUS_TAG_IS_DELETED(tag.flags)) continue;
-    if ((key_len == tag.key_len) && (memcmp(key, tag.key, key_len) == 0)) {
-      *flags |= CENSUS_TAG_DELETED;
-      tags->ntags--;
-      return true;
-    }
-  }
-  return false;
-}
-
-// Delete a tag from a context, return true if it existed.
-static bool context_delete_tag(census_context *context, const census_tag *tag,
-                               size_t key_len) {
-  return (
-      tag_set_delete_tag(&context->tags[LOCAL_TAGS], tag->key, key_len) ||
-      tag_set_delete_tag(&context->tags[PROPAGATED_TAGS], tag->key, key_len));
-}
-
-// Add a tag to a tag_set. Return true on success, false if the tag could
-// not be added because of constraints on tag set size. This function should
-// not be called if the tag may already exist (in a non-deleted state) in
-// the tag_set, as that would result in two tags with the same key.
-static bool tag_set_add_tag(struct tag_set *tags, const census_tag *tag,
-                            size_t key_len, size_t value_len) {
-  if (tags->ntags == CENSUS_MAX_PROPAGATED_TAGS) {
-    return false;
-  }
-  const size_t tag_size = key_len + value_len + TAG_HEADER_SIZE;
-  if (tags->kvm_used + tag_size > tags->kvm_size) {
-    // allocate new memory if needed
-    tags->kvm_size += 2 * CENSUS_MAX_TAG_KV_LEN + TAG_HEADER_SIZE;
-    char *new_kvm = (char *)gpr_malloc(tags->kvm_size);
-    if (tags->kvm_used > 0) memcpy(new_kvm, tags->kvm, tags->kvm_used);
-    gpr_free(tags->kvm);
-    tags->kvm = new_kvm;
-  }
-  char *kvp = tags->kvm + tags->kvm_used;
-  *kvp++ = (char)key_len;
-  *kvp++ = (char)value_len;
-  // ensure reserved flags are not used.
-  *kvp++ = (char)(tag->flags & (CENSUS_TAG_PROPAGATE | CENSUS_TAG_STATS));
-  memcpy(kvp, tag->key, key_len);
-  kvp += key_len;
-  memcpy(kvp, tag->value, value_len);
-  tags->kvm_used += tag_size;
-  tags->ntags++;
-  tags->ntags_alloc++;
-  return true;
-}
-
-// Add/modify/delete a tag to/in a context. Caller must validate that tag key
-// etc. are valid.
-static void context_modify_tag(census_context *context, const census_tag *tag,
-                               size_t key_len, size_t value_len) {
-  // First delete the tag if it is already present.
-  bool deleted = context_delete_tag(context, tag, key_len);
-  bool added = false;
-  if (CENSUS_TAG_IS_PROPAGATED(tag->flags)) {
-    added = tag_set_add_tag(&context->tags[PROPAGATED_TAGS], tag, key_len,
-                            value_len);
-  } else {
-    added =
-        tag_set_add_tag(&context->tags[LOCAL_TAGS], tag, key_len, value_len);
-  }
-
-  if (deleted) {
-    context->status.n_modified_tags++;
-  } else {
-    if (added) {
-      context->status.n_added_tags++;
-    } else {
-      context->status.n_ignored_tags++;
-    }
-  }
-}
-
-// Remove memory used for deleted tags from a tag set. Basic algorithm:
-// 1) Walk through tag set to find first deleted tag. Record where it is.
-// 2) Find the next not-deleted tag. Copy all of kvm from there to the end
-//    "over" the deleted tags
-// 3) repeat #1 and #2 until we have seen all tags
-// 4) if we are still looking for a not-deleted tag, then all the end portion
-//    of the kvm is deleted. Just reduce the used amount of memory by the
-//    appropriate amount.
-static void tag_set_flatten(struct tag_set *tags) {
-  if (tags->ntags == tags->ntags_alloc) return;
-  bool found_deleted = false;  // found a deleted tag.
-  char *kvp = tags->kvm;
-  char *dbase = NULL;  // record location of deleted tag
-  for (int i = 0; i < tags->ntags_alloc; i++) {
-    struct raw_tag tag;
-    char *next_kvp = decode_tag(&tag, kvp, 0);
-    if (found_deleted) {
-      if (!CENSUS_TAG_IS_DELETED(tag.flags)) {
-        ptrdiff_t reduce = kvp - dbase;  // #bytes in deleted tags
-        GPR_ASSERT(reduce > 0);
-        ptrdiff_t copy_size = tags->kvm + tags->kvm_used - kvp;
-        GPR_ASSERT(copy_size > 0);
-        memmove(dbase, kvp, (size_t)copy_size);
-        tags->kvm_used -= (size_t)reduce;
-        next_kvp -= reduce;
-        found_deleted = false;
-      }
-    } else {
-      if (CENSUS_TAG_IS_DELETED(tag.flags)) {
-        dbase = kvp;
-        found_deleted = true;
-      }
-    }
-    kvp = next_kvp;
-  }
-  if (found_deleted) {
-    GPR_ASSERT(dbase > tags->kvm);
-    tags->kvm_used = (size_t)(dbase - tags->kvm);
-  }
-  tags->ntags_alloc = tags->ntags;
-}
-
-census_context *census_context_create(const census_context *base,
-                                      const census_tag *tags, int ntags,
-                                      census_context_status const **status) {
-  census_context *context =
-      (census_context *)gpr_malloc(sizeof(census_context));
-  // If we are given a base, copy it into our new tag set. Otherwise set it
-  // to zero/NULL everything.
-  if (base == NULL) {
-    memset(context, 0, sizeof(census_context));
-  } else {
-    tag_set_copy(&context->tags[PROPAGATED_TAGS], &base->tags[PROPAGATED_TAGS]);
-    tag_set_copy(&context->tags[LOCAL_TAGS], &base->tags[LOCAL_TAGS]);
-    memset(&context->status, 0, sizeof(context->status));
-  }
-  // Walk over the additional tags and, for those that aren't invalid, modify
-  // the context to add/replace/delete as required.
-  for (int i = 0; i < ntags; i++) {
-    const census_tag *tag = &tags[i];
-    size_t key_len = validate_tag(tag->key);
-    // ignore the tag if it is invalid or too short.
-    if (key_len <= 1) {
-      context->status.n_invalid_tags++;
-    } else {
-      if (tag->value != NULL) {
-        size_t value_len = validate_tag(tag->value);
-        if (value_len != 0) {
-          context_modify_tag(context, tag, key_len, value_len);
-        } else {
-          context->status.n_invalid_tags++;
-        }
-      } else {
-        if (context_delete_tag(context, tag, key_len)) {
-          context->status.n_deleted_tags++;
-        }
-      }
-    }
-  }
-  // Remove any deleted tags, update status if needed, and return.
-  tag_set_flatten(&context->tags[PROPAGATED_TAGS]);
-  tag_set_flatten(&context->tags[LOCAL_TAGS]);
-  context->status.n_propagated_tags = context->tags[PROPAGATED_TAGS].ntags;
-  context->status.n_local_tags = context->tags[LOCAL_TAGS].ntags;
-  if (status) {
-    *status = &context->status;
-  }
-  return context;
-}
-
-const census_context_status *census_context_get_status(
-    const census_context *context) {
-  return &context->status;
-}
-
-void census_context_destroy(census_context *context) {
-  gpr_free(context->tags[PROPAGATED_TAGS].kvm);
-  gpr_free(context->tags[LOCAL_TAGS].kvm);
-  gpr_free(context);
-}
-
-void census_context_initialize_iterator(const census_context *context,
-                                        census_context_iterator *iterator) {
-  iterator->context = context;
-  iterator->index = 0;
-  if (context->tags[PROPAGATED_TAGS].ntags != 0) {
-    iterator->base = PROPAGATED_TAGS;
-    iterator->kvm = context->tags[PROPAGATED_TAGS].kvm;
-  } else if (context->tags[LOCAL_TAGS].ntags != 0) {
-    iterator->base = LOCAL_TAGS;
-    iterator->kvm = context->tags[LOCAL_TAGS].kvm;
-  } else {
-    iterator->base = -1;
-  }
-}
-
-int census_context_next_tag(census_context_iterator *iterator,
-                            census_tag *tag) {
-  if (iterator->base < 0) {
-    return 0;
-  }
-  struct raw_tag raw;
-  iterator->kvm = decode_tag(&raw, iterator->kvm, 0);
-  tag->key = raw.key;
-  tag->value = raw.value;
-  tag->flags = raw.flags;
-  if (++iterator->index == iterator->context->tags[iterator->base].ntags) {
-    do {
-      if (iterator->base == LOCAL_TAGS) {
-        iterator->base = -1;
-        return 1;
-      }
-    } while (iterator->context->tags[++iterator->base].ntags == 0);
-    iterator->index = 0;
-    iterator->kvm = iterator->context->tags[iterator->base].kvm;
-  }
-  return 1;
-}
-
-// Find a tag in a tag_set by key. Return true if found, false otherwise.
-static bool tag_set_get_tag(const struct tag_set *tags, const char *key,
-                            size_t key_len, census_tag *tag) {
-  char *kvp = tags->kvm;
-  for (int i = 0; i < tags->ntags; i++) {
-    struct raw_tag raw;
-    kvp = decode_tag(&raw, kvp, 0);
-    if (key_len == raw.key_len && memcmp(raw.key, key, key_len) == 0) {
-      tag->key = raw.key;
-      tag->value = raw.value;
-      tag->flags = raw.flags;
-      return true;
-    }
-  }
-  return false;
-}
-
-int census_context_get_tag(const census_context *context, const char *key,
-                           census_tag *tag) {
-  size_t key_len = strlen(key) + 1;
-  if (key_len == 1) {
-    return 0;
-  }
-  if (tag_set_get_tag(&context->tags[PROPAGATED_TAGS], key, key_len, tag) ||
-      tag_set_get_tag(&context->tags[LOCAL_TAGS], key, key_len, tag)) {
-    return 1;
-  }
-  return 0;
-}
-
-// Context encoding and decoding functions.
-//
-// Wire format for tag_set's on the wire:
-//
-// First, a tag set header:
-//
-// offset   bytes  description
-//   0        1    version number
-//   1        1    number of bytes in this header. This allows for future
-//                 expansion.
-//   2        1    number of bytes in each tag header.
-//   3        1    ntags value from tag set.
-//
-//   This is followed by the key/value memory from struct tag_set.
-
-#define ENCODED_VERSION 0      // Version number
-#define ENCODED_HEADER_SIZE 4  // size of tag set header
-
-// Encode a tag set. Returns 0 if buffer is too small.
-static size_t tag_set_encode(const struct tag_set *tags, char *buffer,
-                             size_t buf_size) {
-  if (buf_size < ENCODED_HEADER_SIZE + tags->kvm_used) {
-    return 0;
-  }
-  buf_size -= ENCODED_HEADER_SIZE;
-  *buffer++ = (char)ENCODED_VERSION;
-  *buffer++ = (char)ENCODED_HEADER_SIZE;
-  *buffer++ = (char)TAG_HEADER_SIZE;
-  *buffer++ = (char)tags->ntags;
-  if (tags->ntags == 0) {
-    return ENCODED_HEADER_SIZE;
-  }
-  memcpy(buffer, tags->kvm, tags->kvm_used);
-  return ENCODED_HEADER_SIZE + tags->kvm_used;
-}
-
-size_t census_context_encode(const census_context *context, char *buffer,
-                             size_t buf_size) {
-  return tag_set_encode(&context->tags[PROPAGATED_TAGS], buffer, buf_size);
-}
-
-// Decode a tag set.
-static void tag_set_decode(struct tag_set *tags, const char *buffer,
-                           size_t size) {
-  uint8_t version = (uint8_t)(*buffer++);
-  uint8_t header_size = (uint8_t)(*buffer++);
-  uint8_t tag_header_size = (uint8_t)(*buffer++);
-  tags->ntags = tags->ntags_alloc = (int)(*buffer++);
-  if (tags->ntags == 0) {
-    tags->ntags_alloc = 0;
-    tags->kvm_size = 0;
-    tags->kvm_used = 0;
-    tags->kvm = NULL;
-    return;
-  }
-  if (header_size != ENCODED_HEADER_SIZE) {
-    GPR_ASSERT(version != ENCODED_VERSION);
-    GPR_ASSERT(ENCODED_HEADER_SIZE < header_size);
-    buffer += (header_size - ENCODED_HEADER_SIZE);
-  }
-  tags->kvm_used = size - header_size;
-  tags->kvm_size = tags->kvm_used + CENSUS_MAX_TAG_KV_LEN;
-  tags->kvm = (char *)gpr_malloc(tags->kvm_size);
-  if (tag_header_size != TAG_HEADER_SIZE) {
-    // something new in the tag information. I don't understand it, so
-    // don't copy it over.
-    GPR_ASSERT(version != ENCODED_VERSION);
-    GPR_ASSERT(tag_header_size > TAG_HEADER_SIZE);
-    char *kvp = tags->kvm;
-    for (int i = 0; i < tags->ntags; i++) {
-      memcpy(kvp, buffer, TAG_HEADER_SIZE);
-      kvp += header_size;
-      struct raw_tag raw;
-      buffer =
-          decode_tag(&raw, (char *)buffer, tag_header_size - TAG_HEADER_SIZE);
-      memcpy(kvp, raw.key, (size_t)raw.key_len + raw.value_len);
-      kvp += raw.key_len + raw.value_len;
-    }
-  } else {
-    memcpy(tags->kvm, buffer, tags->kvm_used);
-  }
-}
-
-census_context *census_context_decode(const char *buffer, size_t size) {
-  census_context *context =
-      (census_context *)gpr_malloc(sizeof(census_context));
-  memset(&context->tags[LOCAL_TAGS], 0, sizeof(struct tag_set));
-  if (buffer == NULL) {
-    memset(&context->tags[PROPAGATED_TAGS], 0, sizeof(struct tag_set));
-  } else {
-    tag_set_decode(&context->tags[PROPAGATED_TAGS], buffer, size);
-  }
-  memset(&context->status, 0, sizeof(context->status));
-  context->status.n_propagated_tags = context->tags[PROPAGATED_TAGS].ntags;
-  return context;
-}
diff --git a/src/core/ext/census/gen/README.md b/src/core/ext/census/gen/README.md
deleted file mode 100644
index d4612bc..0000000
--- a/src/core/ext/census/gen/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-Files generated for use by Census stats and trace recording subsystem.
-
-# Files
-* census.pb.{h,c} - Generated from src/core/ext/census/census.proto, using the
-  script `tools/codegen/core/gen_nano_proto.sh src/proto/census/census.proto
-  $PWD/src/core/ext/census/gen src/core/ext/census/gen`
-* trace_context.pb.{h,c} - Generated from
-  src/core/ext/census/trace_context.proto, using the script
-  `tools/codegen/core/gen_nano_proto.sh src/proto/census/trace_context.proto
-  $PWD/src/core/ext/census/gen src/core/ext/census/gen`
diff --git a/src/core/ext/census/gen/census.pb.c b/src/core/ext/census/gen/census.pb.c
deleted file mode 100644
index 88efa73..0000000
--- a/src/core/ext/census/gen/census.pb.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-/* Automatically generated nanopb constant definitions */
-/* Generated by nanopb-0.3.5-dev */
-
-#include "src/core/ext/census/gen/census.pb.h"
-
-#if PB_PROTO_HEADER_VERSION != 30
-#error Regenerate this file with the current version of nanopb generator.
-#endif
-
-
-
-const pb_field_t google_census_Duration_fields[3] = {
-    PB_FIELD(  1, INT64   , OPTIONAL, STATIC  , FIRST, google_census_Duration, seconds, seconds, 0),
-    PB_FIELD(  2, INT32   , OPTIONAL, STATIC  , OTHER, google_census_Duration, nanos, seconds, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_Timestamp_fields[3] = {
-    PB_FIELD(  1, INT64   , OPTIONAL, STATIC  , FIRST, google_census_Timestamp, seconds, seconds, 0),
-    PB_FIELD(  2, INT32   , OPTIONAL, STATIC  , OTHER, google_census_Timestamp, nanos, seconds, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_Resource_fields[4] = {
-    PB_FIELD(  1, STRING  , OPTIONAL, CALLBACK, FIRST, google_census_Resource, name, name, 0),
-    PB_FIELD(  2, STRING  , OPTIONAL, CALLBACK, OTHER, google_census_Resource, description, name, 0),
-    PB_FIELD(  3, MESSAGE , OPTIONAL, STATIC  , OTHER, google_census_Resource, unit, description, &google_census_Resource_MeasurementUnit_fields),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_Resource_MeasurementUnit_fields[4] = {
-    PB_FIELD(  1, INT32   , OPTIONAL, STATIC  , FIRST, google_census_Resource_MeasurementUnit, prefix, prefix, 0),
-    PB_FIELD(  2, UENUM   , REPEATED, CALLBACK, OTHER, google_census_Resource_MeasurementUnit, numerator, prefix, 0),
-    PB_FIELD(  3, UENUM   , REPEATED, CALLBACK, OTHER, google_census_Resource_MeasurementUnit, denominator, numerator, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_AggregationDescriptor_fields[4] = {
-    PB_FIELD(  1, UENUM   , OPTIONAL, STATIC  , FIRST, google_census_AggregationDescriptor, type, type, 0),
-    PB_ONEOF_FIELD(options,   2, MESSAGE , ONEOF, STATIC  , OTHER, google_census_AggregationDescriptor, bucket_boundaries, type, &google_census_AggregationDescriptor_BucketBoundaries_fields),
-    PB_ONEOF_FIELD(options,   3, MESSAGE , ONEOF, STATIC  , OTHER, google_census_AggregationDescriptor, interval_boundaries, type, &google_census_AggregationDescriptor_IntervalBoundaries_fields),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_AggregationDescriptor_BucketBoundaries_fields[2] = {
-    PB_FIELD(  1, DOUBLE  , REPEATED, CALLBACK, FIRST, google_census_AggregationDescriptor_BucketBoundaries, bounds, bounds, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_AggregationDescriptor_IntervalBoundaries_fields[2] = {
-    PB_FIELD(  1, DOUBLE  , REPEATED, CALLBACK, FIRST, google_census_AggregationDescriptor_IntervalBoundaries, window_size, window_size, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_Distribution_fields[5] = {
-    PB_FIELD(  1, INT64   , OPTIONAL, STATIC  , FIRST, google_census_Distribution, count, count, 0),
-    PB_FIELD(  2, DOUBLE  , OPTIONAL, STATIC  , OTHER, google_census_Distribution, mean, count, 0),
-    PB_FIELD(  3, MESSAGE , OPTIONAL, STATIC  , OTHER, google_census_Distribution, range, mean, &google_census_Distribution_Range_fields),
-    PB_FIELD(  4, INT64   , REPEATED, CALLBACK, OTHER, google_census_Distribution, bucket_count, range, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_Distribution_Range_fields[3] = {
-    PB_FIELD(  1, DOUBLE  , OPTIONAL, STATIC  , FIRST, google_census_Distribution_Range, min, min, 0),
-    PB_FIELD(  2, DOUBLE  , OPTIONAL, STATIC  , OTHER, google_census_Distribution_Range, max, min, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_IntervalStats_fields[2] = {
-    PB_FIELD(  1, MESSAGE , REPEATED, CALLBACK, FIRST, google_census_IntervalStats, window, window, &google_census_IntervalStats_Window_fields),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_IntervalStats_Window_fields[4] = {
-    PB_FIELD(  1, MESSAGE , OPTIONAL, STATIC  , FIRST, google_census_IntervalStats_Window, window_size, window_size, &google_census_Duration_fields),
-    PB_FIELD(  2, INT64   , OPTIONAL, STATIC  , OTHER, google_census_IntervalStats_Window, count, window_size, 0),
-    PB_FIELD(  3, DOUBLE  , OPTIONAL, STATIC  , OTHER, google_census_IntervalStats_Window, mean, count, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_Tag_fields[3] = {
-    PB_FIELD(  1, STRING  , OPTIONAL, STATIC  , FIRST, google_census_Tag, key, key, 0),
-    PB_FIELD(  2, STRING  , OPTIONAL, STATIC  , OTHER, google_census_Tag, value, key, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_View_fields[6] = {
-    PB_FIELD(  1, STRING  , OPTIONAL, CALLBACK, FIRST, google_census_View, name, name, 0),
-    PB_FIELD(  2, STRING  , OPTIONAL, CALLBACK, OTHER, google_census_View, description, name, 0),
-    PB_FIELD(  3, STRING  , OPTIONAL, CALLBACK, OTHER, google_census_View, resource_name, description, 0),
-    PB_FIELD(  4, MESSAGE , OPTIONAL, STATIC  , OTHER, google_census_View, aggregation, resource_name, &google_census_AggregationDescriptor_fields),
-    PB_FIELD(  5, STRING  , REPEATED, CALLBACK, OTHER, google_census_View, tag_key, aggregation, 0),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_Aggregation_fields[7] = {
-    PB_FIELD(  1, STRING  , OPTIONAL, CALLBACK, FIRST, google_census_Aggregation, name, name, 0),
-    PB_FIELD(  2, STRING  , OPTIONAL, CALLBACK, OTHER, google_census_Aggregation, description, name, 0),
-    PB_ONEOF_FIELD(data,   3, UINT64  , ONEOF, STATIC  , OTHER, google_census_Aggregation, count, description, 0),
-    PB_ONEOF_FIELD(data,   4, MESSAGE , ONEOF, STATIC  , OTHER, google_census_Aggregation, distribution, description, &google_census_Distribution_fields),
-    PB_ONEOF_FIELD(data,   5, MESSAGE , ONEOF, STATIC  , OTHER, google_census_Aggregation, interval_stats, description, &google_census_IntervalStats_fields),
-    PB_FIELD(  6, MESSAGE , REPEATED, CALLBACK, OTHER, google_census_Aggregation, tag, data.interval_stats, &google_census_Tag_fields),
-    PB_LAST_FIELD
-};
-
-const pb_field_t google_census_Metric_fields[5] = {
-    PB_FIELD(  1, STRING  , OPTIONAL, CALLBACK, FIRST, google_census_Metric, view_name, view_name, 0),
-    PB_FIELD(  2, MESSAGE , REPEATED, CALLBACK, OTHER, google_census_Metric, aggregation, view_name, &google_census_Aggregation_fields),
-    PB_FIELD(  3, MESSAGE , OPTIONAL, STATIC  , OTHER, google_census_Metric, start, aggregation, &google_census_Timestamp_fields),
-    PB_FIELD(  4, MESSAGE , OPTIONAL, STATIC  , OTHER, google_census_Metric, end, start, &google_census_Timestamp_fields),
-    PB_LAST_FIELD
-};
-
-
-/* Check that field information fits in pb_field_t */
-#if !defined(PB_FIELD_32BIT)
-/* If you get an error here, it means that you need to define PB_FIELD_32BIT
- * compile-time option. You can do that in pb.h or on compiler command line.
- * 
- * The reason you need to do this is that some of your messages contain tag
- * numbers or field sizes that are larger than what can fit in 8 or 16 bit
- * field descriptors.
- */
-PB_STATIC_ASSERT((pb_membersize(google_census_Resource, unit) < 65536 && pb_membersize(google_census_AggregationDescriptor, options.bucket_boundaries) < 65536 && pb_membersize(google_census_AggregationDescriptor, options.interval_boundaries) < 65536 && pb_membersize(google_census_Resource, unit) < 65536 && pb_membersize(google_census_AggregationDescriptor, options.bucket_boundaries) < 65536 && pb_membersize(google_census_AggregationDescriptor, options.interval_boundaries) < 65536 && pb_membersize(google_census_Distribution, range) < 65536 && pb_membersize(google_census_IntervalStats, window) < 65536 && pb_membersize(google_census_IntervalStats_Window, window_size) < 65536 && pb_membersize(google_census_View, aggregation) < 65536 && pb_membersize(google_census_Aggregation, data.distribution) < 65536 && pb_membersize(google_census_Aggregation, data.interval_stats) < 65536 && pb_membersize(google_census_Resource, unit) < 65536 && pb_membersize(google_census_AggregationDescriptor, options.bucket_boundaries) < 65536 && pb_membersize(google_census_AggregationDescriptor, options.interval_boundaries) < 65536 && pb_membersize(google_census_Resource, unit) < 65536 && pb_membersize(google_census_AggregationDescriptor, options.bucket_boundaries) < 65536 && pb_membersize(google_census_AggregationDescriptor, options.interval_boundaries) < 65536 && pb_membersize(google_census_Distribution, range) < 65536 && pb_membersize(google_census_IntervalStats, window) < 65536 && pb_membersize(google_census_IntervalStats_Window, window_size) < 65536 && pb_membersize(google_census_View, aggregation) < 65536 && pb_membersize(google_census_Aggregation, data.distribution) < 65536 && pb_membersize(google_census_Aggregation, data.interval_stats) < 65536 && pb_membersize(google_census_Aggregation, tag) < 65536 && pb_membersize(google_census_Metric, aggregation) < 65536 && pb_membersize(google_census_Metric, start) < 65536 && pb_membersize(google_census_Metric, end) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_census_Duration_google_census_Timestamp_google_census_Resource_google_census_Resource_MeasurementUnit_google_census_AggregationDescriptor_google_census_AggregationDescriptor_BucketBoundaries_google_census_AggregationDescriptor_IntervalBoundaries_google_census_Distribution_google_census_Distribution_Range_google_census_IntervalStats_google_census_IntervalStats_Window_google_census_Tag_google_census_View_google_census_Aggregation_google_census_Metric)
-#endif
-
-#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
-/* If you get an error here, it means that you need to define PB_FIELD_16BIT
- * compile-time option. You can do that in pb.h or on compiler command line.
- * 
- * The reason you need to do this is that some of your messages contain tag
- * numbers or field sizes that are larger than what can fit in the default
- * 8 bit descriptors.
- */
-PB_STATIC_ASSERT((pb_membersize(google_census_Resource, unit) < 256 && pb_membersize(google_census_AggregationDescriptor, options.bucket_boundaries) < 256 && pb_membersize(google_census_AggregationDescriptor, options.interval_boundaries) < 256 && pb_membersize(google_census_Resource, unit) < 256 && pb_membersize(google_census_AggregationDescriptor, options.bucket_boundaries) < 256 && pb_membersize(google_census_AggregationDescriptor, options.interval_boundaries) < 256 && pb_membersize(google_census_Distribution, range) < 256 && pb_membersize(google_census_IntervalStats, window) < 256 && pb_membersize(google_census_IntervalStats_Window, window_size) < 256 && pb_membersize(google_census_View, aggregation) < 256 && pb_membersize(google_census_Aggregation, data.distribution) < 256 && pb_membersize(google_census_Aggregation, data.interval_stats) < 256 && pb_membersize(google_census_Resource, unit) < 256 && pb_membersize(google_census_AggregationDescriptor, options.bucket_boundaries) < 256 && pb_membersize(google_census_AggregationDescriptor, options.interval_boundaries) < 256 && pb_membersize(google_census_Resource, unit) < 256 && pb_membersize(google_census_AggregationDescriptor, options.bucket_boundaries) < 256 && pb_membersize(google_census_AggregationDescriptor, options.interval_boundaries) < 256 && pb_membersize(google_census_Distribution, range) < 256 && pb_membersize(google_census_IntervalStats, window) < 256 && pb_membersize(google_census_IntervalStats_Window, window_size) < 256 && pb_membersize(google_census_View, aggregation) < 256 && pb_membersize(google_census_Aggregation, data.distribution) < 256 && pb_membersize(google_census_Aggregation, data.interval_stats) < 256 && pb_membersize(google_census_Aggregation, tag) < 256 && pb_membersize(google_census_Metric, aggregation) < 256 && pb_membersize(google_census_Metric, start) < 256 && pb_membersize(google_census_Metric, end) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_census_Duration_google_census_Timestamp_google_census_Resource_google_census_Resource_MeasurementUnit_google_census_AggregationDescriptor_google_census_AggregationDescriptor_BucketBoundaries_google_census_AggregationDescriptor_IntervalBoundaries_google_census_Distribution_google_census_Distribution_Range_google_census_IntervalStats_google_census_IntervalStats_Window_google_census_Tag_google_census_View_google_census_Aggregation_google_census_Metric)
-#endif
-
-
-/* On some platforms (such as AVR), double is really float.
- * These are not directly supported by nanopb, but see example_avr_double.
- * To get rid of this error, remove any double fields from your .proto.
- */
-PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
-
diff --git a/src/core/ext/census/gen/census.pb.h b/src/core/ext/census/gen/census.pb.h
deleted file mode 100644
index 5f28335..0000000
--- a/src/core/ext/census/gen/census.pb.h
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-/* Automatically generated nanopb header */
-/* Generated by nanopb-0.3.5-dev */
-
-#ifndef GRPC_CORE_EXT_CENSUS_GEN_CENSUS_PB_H
-#define GRPC_CORE_EXT_CENSUS_GEN_CENSUS_PB_H
-#include "third_party/nanopb/pb.h"
-#if PB_PROTO_HEADER_VERSION != 30
-#error Regenerate this file with the current version of nanopb generator.
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Enum definitions */
-typedef enum _google_census_Resource_BasicUnit {
-    google_census_Resource_BasicUnit_UNKNOWN = 0,
-    google_census_Resource_BasicUnit_BITS = 1,
-    google_census_Resource_BasicUnit_BYTES = 2,
-    google_census_Resource_BasicUnit_SECS = 3,
-    google_census_Resource_BasicUnit_CORES = 4,
-    google_census_Resource_BasicUnit_MAX_UNITS = 5
-} google_census_Resource_BasicUnit;
-
-typedef enum _google_census_AggregationDescriptor_AggregationType {
-    google_census_AggregationDescriptor_AggregationType_UNKNOWN = 0,
-    google_census_AggregationDescriptor_AggregationType_COUNT = 1,
-    google_census_AggregationDescriptor_AggregationType_DISTRIBUTION = 2,
-    google_census_AggregationDescriptor_AggregationType_INTERVAL = 3
-} google_census_AggregationDescriptor_AggregationType;
-
-/* Struct definitions */
-typedef struct _google_census_AggregationDescriptor_BucketBoundaries {
-    pb_callback_t bounds;
-} google_census_AggregationDescriptor_BucketBoundaries;
-
-typedef struct _google_census_AggregationDescriptor_IntervalBoundaries {
-    pb_callback_t window_size;
-} google_census_AggregationDescriptor_IntervalBoundaries;
-
-typedef struct _google_census_IntervalStats {
-    pb_callback_t window;
-} google_census_IntervalStats;
-
-typedef struct _google_census_AggregationDescriptor {
-    bool has_type;
-    google_census_AggregationDescriptor_AggregationType type;
-    pb_size_t which_options;
-    union {
-        google_census_AggregationDescriptor_BucketBoundaries bucket_boundaries;
-        google_census_AggregationDescriptor_IntervalBoundaries interval_boundaries;
-    } options;
-} google_census_AggregationDescriptor;
-
-typedef struct _google_census_Distribution_Range {
-    bool has_min;
-    double min;
-    bool has_max;
-    double max;
-} google_census_Distribution_Range;
-
-typedef struct _google_census_Duration {
-    bool has_seconds;
-    int64_t seconds;
-    bool has_nanos;
-    int32_t nanos;
-} google_census_Duration;
-
-typedef struct _google_census_Resource_MeasurementUnit {
-    bool has_prefix;
-    int32_t prefix;
-    pb_callback_t numerator;
-    pb_callback_t denominator;
-} google_census_Resource_MeasurementUnit;
-
-typedef struct _google_census_Tag {
-    bool has_key;
-    char key[255];
-    bool has_value;
-    char value[255];
-} google_census_Tag;
-
-typedef struct _google_census_Timestamp {
-    bool has_seconds;
-    int64_t seconds;
-    bool has_nanos;
-    int32_t nanos;
-} google_census_Timestamp;
-
-typedef struct _google_census_Distribution {
-    bool has_count;
-    int64_t count;
-    bool has_mean;
-    double mean;
-    bool has_range;
-    google_census_Distribution_Range range;
-    pb_callback_t bucket_count;
-} google_census_Distribution;
-
-typedef struct _google_census_IntervalStats_Window {
-    bool has_window_size;
-    google_census_Duration window_size;
-    bool has_count;
-    int64_t count;
-    bool has_mean;
-    double mean;
-} google_census_IntervalStats_Window;
-
-typedef struct _google_census_Metric {
-    pb_callback_t view_name;
-    pb_callback_t aggregation;
-    bool has_start;
-    google_census_Timestamp start;
-    bool has_end;
-    google_census_Timestamp end;
-} google_census_Metric;
-
-typedef struct _google_census_Resource {
-    pb_callback_t name;
-    pb_callback_t description;
-    bool has_unit;
-    google_census_Resource_MeasurementUnit unit;
-} google_census_Resource;
-
-typedef struct _google_census_View {
-    pb_callback_t name;
-    pb_callback_t description;
-    pb_callback_t resource_name;
-    bool has_aggregation;
-    google_census_AggregationDescriptor aggregation;
-    pb_callback_t tag_key;
-} google_census_View;
-
-typedef struct _google_census_Aggregation {
-    pb_callback_t name;
-    pb_callback_t description;
-    pb_size_t which_data;
-    union {
-        uint64_t count;
-        google_census_Distribution distribution;
-        google_census_IntervalStats interval_stats;
-    } data;
-    pb_callback_t tag;
-} google_census_Aggregation;
-
-/* Default values for struct fields */
-
-/* Initializer values for message structs */
-#define google_census_Duration_init_default      {false, 0, false, 0}
-#define google_census_Timestamp_init_default     {false, 0, false, 0}
-#define google_census_Resource_init_default      {{{NULL}, NULL}, {{NULL}, NULL}, false, google_census_Resource_MeasurementUnit_init_default}
-#define google_census_Resource_MeasurementUnit_init_default {false, 0, {{NULL}, NULL}, {{NULL}, NULL}}
-#define google_census_AggregationDescriptor_init_default {false, (google_census_AggregationDescriptor_AggregationType)0, 0, {google_census_AggregationDescriptor_BucketBoundaries_init_default}}
-#define google_census_AggregationDescriptor_BucketBoundaries_init_default {{{NULL}, NULL}}
-#define google_census_AggregationDescriptor_IntervalBoundaries_init_default {{{NULL}, NULL}}
-#define google_census_Distribution_init_default  {false, 0, false, 0, false, google_census_Distribution_Range_init_default, {{NULL}, NULL}}
-#define google_census_Distribution_Range_init_default {false, 0, false, 0}
-#define google_census_IntervalStats_init_default {{{NULL}, NULL}}
-#define google_census_IntervalStats_Window_init_default {false, google_census_Duration_init_default, false, 0, false, 0}
-#define google_census_Tag_init_default           {false, "", false, ""}
-#define google_census_View_init_default          {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, google_census_AggregationDescriptor_init_default, {{NULL}, NULL}}
-#define google_census_Aggregation_init_default   {{{NULL}, NULL}, {{NULL}, NULL}, 0, {0}, {{NULL}, NULL}}
-#define google_census_Metric_init_default        {{{NULL}, NULL}, {{NULL}, NULL}, false, google_census_Timestamp_init_default, false, google_census_Timestamp_init_default}
-#define google_census_Duration_init_zero         {false, 0, false, 0}
-#define google_census_Timestamp_init_zero        {false, 0, false, 0}
-#define google_census_Resource_init_zero         {{{NULL}, NULL}, {{NULL}, NULL}, false, google_census_Resource_MeasurementUnit_init_zero}
-#define google_census_Resource_MeasurementUnit_init_zero {false, 0, {{NULL}, NULL}, {{NULL}, NULL}}
-#define google_census_AggregationDescriptor_init_zero {false, (google_census_AggregationDescriptor_AggregationType)0, 0, {google_census_AggregationDescriptor_BucketBoundaries_init_zero}}
-#define google_census_AggregationDescriptor_BucketBoundaries_init_zero {{{NULL}, NULL}}
-#define google_census_AggregationDescriptor_IntervalBoundaries_init_zero {{{NULL}, NULL}}
-#define google_census_Distribution_init_zero     {false, 0, false, 0, false, google_census_Distribution_Range_init_zero, {{NULL}, NULL}}
-#define google_census_Distribution_Range_init_zero {false, 0, false, 0}
-#define google_census_IntervalStats_init_zero    {{{NULL}, NULL}}
-#define google_census_IntervalStats_Window_init_zero {false, google_census_Duration_init_zero, false, 0, false, 0}
-#define google_census_Tag_init_zero              {false, "", false, ""}
-#define google_census_View_init_zero             {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, google_census_AggregationDescriptor_init_zero, {{NULL}, NULL}}
-#define google_census_Aggregation_init_zero      {{{NULL}, NULL}, {{NULL}, NULL}, 0, {0}, {{NULL}, NULL}}
-#define google_census_Metric_init_zero           {{{NULL}, NULL}, {{NULL}, NULL}, false, google_census_Timestamp_init_zero, false, google_census_Timestamp_init_zero}
-
-/* Field tags (for use in manual encoding/decoding) */
-#define google_census_AggregationDescriptor_BucketBoundaries_bounds_tag 1
-#define google_census_AggregationDescriptor_IntervalBoundaries_window_size_tag 1
-#define google_census_IntervalStats_window_tag   1
-#define google_census_AggregationDescriptor_bucket_boundaries_tag 2
-
-#define google_census_AggregationDescriptor_interval_boundaries_tag 3
-#define google_census_AggregationDescriptor_type_tag 1
-#define google_census_Distribution_Range_min_tag 1
-#define google_census_Distribution_Range_max_tag 2
-#define google_census_Duration_seconds_tag       1
-#define google_census_Duration_nanos_tag         2
-#define google_census_Resource_MeasurementUnit_prefix_tag 1
-#define google_census_Resource_MeasurementUnit_numerator_tag 2
-#define google_census_Resource_MeasurementUnit_denominator_tag 3
-#define google_census_Tag_key_tag                1
-#define google_census_Tag_value_tag              2
-#define google_census_Timestamp_seconds_tag      1
-#define google_census_Timestamp_nanos_tag        2
-#define google_census_Distribution_count_tag     1
-#define google_census_Distribution_mean_tag      2
-#define google_census_Distribution_range_tag     3
-#define google_census_Distribution_bucket_count_tag 4
-#define google_census_IntervalStats_Window_window_size_tag 1
-#define google_census_IntervalStats_Window_count_tag 2
-#define google_census_IntervalStats_Window_mean_tag 3
-#define google_census_Metric_view_name_tag       1
-#define google_census_Metric_aggregation_tag     2
-#define google_census_Metric_start_tag           3
-#define google_census_Metric_end_tag             4
-#define google_census_Resource_name_tag          1
-#define google_census_Resource_description_tag   2
-#define google_census_Resource_unit_tag          3
-#define google_census_View_name_tag              1
-#define google_census_View_description_tag       2
-#define google_census_View_resource_name_tag     3
-#define google_census_View_aggregation_tag       4
-#define google_census_View_tag_key_tag           5
-#define google_census_Aggregation_count_tag      3
-
-#define google_census_Aggregation_distribution_tag 4
-
-#define google_census_Aggregation_interval_stats_tag 5
-#define google_census_Aggregation_name_tag       1
-#define google_census_Aggregation_description_tag 2
-#define google_census_Aggregation_tag_tag        6
-
-/* Struct field encoding specification for nanopb */
-extern const pb_field_t google_census_Duration_fields[3];
-extern const pb_field_t google_census_Timestamp_fields[3];
-extern const pb_field_t google_census_Resource_fields[4];
-extern const pb_field_t google_census_Resource_MeasurementUnit_fields[4];
-extern const pb_field_t google_census_AggregationDescriptor_fields[4];
-extern const pb_field_t google_census_AggregationDescriptor_BucketBoundaries_fields[2];
-extern const pb_field_t google_census_AggregationDescriptor_IntervalBoundaries_fields[2];
-extern const pb_field_t google_census_Distribution_fields[5];
-extern const pb_field_t google_census_Distribution_Range_fields[3];
-extern const pb_field_t google_census_IntervalStats_fields[2];
-extern const pb_field_t google_census_IntervalStats_Window_fields[4];
-extern const pb_field_t google_census_Tag_fields[3];
-extern const pb_field_t google_census_View_fields[6];
-extern const pb_field_t google_census_Aggregation_fields[7];
-extern const pb_field_t google_census_Metric_fields[5];
-
-/* Maximum encoded size of messages (where known) */
-#define google_census_Duration_size              22
-#define google_census_Timestamp_size             22
-#define google_census_Distribution_Range_size    18
-#define google_census_IntervalStats_Window_size  44
-#define google_census_Tag_size                   516
-
-/* Message IDs (where set with "msgid" option) */
-#ifdef PB_MSGID
-
-#define CENSUS_MESSAGES \
-
-
-#endif
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_GEN_CENSUS_PB_H */
diff --git a/src/core/ext/census/gen/trace_context.pb.c b/src/core/ext/census/gen/trace_context.pb.c
deleted file mode 100644
index b5c3d52..0000000
--- a/src/core/ext/census/gen/trace_context.pb.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-/* Automatically generated nanopb constant definitions */
-/* Generated by nanopb-0.3.7-dev at Fri Jan 20 16:14:22 2017. */
-
-#include "src/core/ext/census/gen/trace_context.pb.h"
-
-/* @@protoc_insertion_point(includes) */
-#if PB_PROTO_HEADER_VERSION != 30
-#error Regenerate this file with the current version of nanopb generator.
-#endif
-
-
-
-const pb_field_t google_trace_TraceContext_fields[5] = {
-    PB_FIELD(  1, FIXED64 , OPTIONAL, STATIC  , FIRST, google_trace_TraceContext, trace_id_hi, trace_id_hi, 0),
-    PB_FIELD(  2, FIXED64 , OPTIONAL, STATIC  , OTHER, google_trace_TraceContext, trace_id_lo, trace_id_hi, 0),
-    PB_FIELD(  3, FIXED64 , OPTIONAL, STATIC  , OTHER, google_trace_TraceContext, span_id, trace_id_lo, 0),
-    PB_FIELD(  4, FIXED32 , OPTIONAL, STATIC  , OTHER, google_trace_TraceContext, span_options, span_id, 0),
-    PB_LAST_FIELD
-};
-
-
-/* @@protoc_insertion_point(eof) */
diff --git a/src/core/ext/census/gen/trace_context.pb.h b/src/core/ext/census/gen/trace_context.pb.h
deleted file mode 100644
index 181925d..0000000
--- a/src/core/ext/census/gen/trace_context.pb.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-/* Automatically generated nanopb header */
-/* Generated by nanopb-0.3.7-dev at Fri Jan 20 16:14:22 2017. */
-
-#ifndef GRPC_CORE_EXT_CENSUS_GEN_TRACE_CONTEXT_PB_H
-#define GRPC_CORE_EXT_CENSUS_GEN_TRACE_CONTEXT_PB_H
-#include "third_party/nanopb/pb.h"
-
-/* @@protoc_insertion_point(includes) */
-#if PB_PROTO_HEADER_VERSION != 30
-#error Regenerate this file with the current version of nanopb generator.
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Struct definitions */
-typedef struct _google_trace_TraceContext {
-    bool has_trace_id_hi;
-    uint64_t trace_id_hi;
-    bool has_trace_id_lo;
-    uint64_t trace_id_lo;
-    bool has_span_id;
-    uint64_t span_id;
-    bool has_span_options;
-    uint32_t span_options;
-/* @@protoc_insertion_point(struct:google_trace_TraceContext) */
-} google_trace_TraceContext;
-
-/* Default values for struct fields */
-
-/* Initializer values for message structs */
-#define google_trace_TraceContext_init_default   {false, 0, false, 0, false, 0, false, 0}
-#define google_trace_TraceContext_init_zero      {false, 0, false, 0, false, 0, false, 0}
-
-/* Field tags (for use in manual encoding/decoding) */
-#define google_trace_TraceContext_trace_id_hi_tag 1
-#define google_trace_TraceContext_trace_id_lo_tag 2
-#define google_trace_TraceContext_span_id_tag    3
-#define google_trace_TraceContext_span_options_tag 4
-
-/* Struct field encoding specification for nanopb */
-extern const pb_field_t google_trace_TraceContext_fields[5];
-
-/* Maximum encoded size of messages (where known) */
-#define google_trace_TraceContext_size           32
-
-/* Message IDs (where set with "msgid" option) */
-#ifdef PB_MSGID
-
-#define TRACE_CONTEXT_MESSAGES \
-
-
-#endif
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-/* @@protoc_insertion_point(eof) */
-
-#endif /* GRPC_CORE_EXT_CENSUS_GEN_TRACE_CONTEXT_PB_H */
diff --git a/src/core/ext/census/grpc_context.cc b/src/core/ext/census/grpc_context.cc
index 0bfba63..fb4fcb3 100644
--- a/src/core/ext/census/grpc_context.cc
+++ b/src/core/ext/census/grpc_context.cc
@@ -21,18 +21,15 @@
 #include "src/core/lib/surface/api_trace.h"
 #include "src/core/lib/surface/call.h"
 
-void grpc_census_call_set_context(grpc_call *call, census_context *context) {
+void grpc_census_call_set_context(grpc_call* call, census_context* context) {
   GRPC_API_TRACE("grpc_census_call_set_context(call=%p, census_context=%p)", 2,
                  (call, context));
-  if (census_enabled() == CENSUS_FEATURE_NONE) {
-    return;
-  }
   if (context != NULL) {
     grpc_call_context_set(call, GRPC_CONTEXT_TRACING, context, NULL);
   }
 }
 
-census_context *grpc_census_call_get_context(grpc_call *call) {
+census_context* grpc_census_call_get_context(grpc_call* call) {
   GRPC_API_TRACE("grpc_census_call_get_context(call=%p)", 1, (call));
-  return (census_context *)grpc_call_context_get(call, GRPC_CONTEXT_TRACING);
+  return (census_context*)grpc_call_context_get(call, GRPC_CONTEXT_TRACING);
 }
diff --git a/src/core/ext/census/grpc_filter.cc b/src/core/ext/census/grpc_filter.cc
deleted file mode 100644
index b37ab90..0000000
--- a/src/core/ext/census/grpc_filter.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/grpc_filter.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/census.h>
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-
-#include "src/core/ext/census/census_interface.h"
-#include "src/core/ext/census/census_rpc_stats.h"
-#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/profiling/timers.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-typedef struct call_data {
-  census_op_id op_id;
-  census_context *ctxt;
-  gpr_timespec start_ts;
-  int error;
-
-  /* recv callback */
-  grpc_metadata_batch *recv_initial_metadata;
-  grpc_closure *on_done_recv;
-  grpc_closure finish_recv;
-} call_data;
-
-typedef struct channel_data { uint8_t unused; } channel_data;
-
-static void extract_and_annotate_method_tag(grpc_metadata_batch *md,
-                                            call_data *calld,
-                                            channel_data *chand) {
-  grpc_linked_mdelem *m;
-  for (m = md->list.head; m != NULL; m = m->next) {
-    if (grpc_slice_eq(GRPC_MDKEY(m->md), GRPC_MDSTR_PATH)) {
-      /* Add method tag here */
-    }
-  }
-}
-
-static void client_mutate_op(grpc_call_element *elem,
-                             grpc_transport_stream_op_batch *op) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
-  if (op->send_initial_metadata) {
-    extract_and_annotate_method_tag(
-        op->payload->send_initial_metadata.send_initial_metadata, calld, chand);
-  }
-}
-
-static void client_start_transport_op(grpc_exec_ctx *exec_ctx,
-                                      grpc_call_element *elem,
-                                      grpc_transport_stream_op_batch *op) {
-  client_mutate_op(elem, op);
-  grpc_call_next_op(exec_ctx, elem, op);
-}
-
-static void server_on_done_recv(grpc_exec_ctx *exec_ctx, void *ptr,
-                                grpc_error *error) {
-  GPR_TIMER_BEGIN("census-server:server_on_done_recv", 0);
-  grpc_call_element *elem = (grpc_call_element *)ptr;
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
-  if (error == GRPC_ERROR_NONE) {
-    extract_and_annotate_method_tag(calld->recv_initial_metadata, calld, chand);
-  }
-  calld->on_done_recv->cb(exec_ctx, calld->on_done_recv->cb_arg, error);
-  GPR_TIMER_END("census-server:server_on_done_recv", 0);
-}
-
-static void server_mutate_op(grpc_call_element *elem,
-                             grpc_transport_stream_op_batch *op) {
-  call_data *calld = (call_data *)elem->call_data;
-  if (op->recv_initial_metadata) {
-    /* substitute our callback for the op callback */
-    calld->recv_initial_metadata =
-        op->payload->recv_initial_metadata.recv_initial_metadata;
-    calld->on_done_recv =
-        op->payload->recv_initial_metadata.recv_initial_metadata_ready;
-    op->payload->recv_initial_metadata.recv_initial_metadata_ready =
-        &calld->finish_recv;
-  }
-}
-
-static void server_start_transport_op(grpc_exec_ctx *exec_ctx,
-                                      grpc_call_element *elem,
-                                      grpc_transport_stream_op_batch *op) {
-  /* TODO(ctiller): this code fails. I don't know why. I expect it's
-                    incomplete, and someone should look at it soon.
-
-  call_data *calld = elem->call_data;
-  GPR_ASSERT((calld->op_id.upper != 0) || (calld->op_id.lower != 0)); */
-  server_mutate_op(elem, op);
-  grpc_call_next_op(exec_ctx, elem, op);
-}
-
-static grpc_error *client_init_call_elem(grpc_exec_ctx *exec_ctx,
-                                         grpc_call_element *elem,
-                                         const grpc_call_element_args *args) {
-  call_data *d = (call_data *)elem->call_data;
-  GPR_ASSERT(d != NULL);
-  memset(d, 0, sizeof(*d));
-  d->start_ts = args->start_time;
-  return GRPC_ERROR_NONE;
-}
-
-static void client_destroy_call_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_element *elem,
-                                     const grpc_call_final_info *final_info,
-                                     grpc_closure *ignored) {
-  call_data *d = (call_data *)elem->call_data;
-  GPR_ASSERT(d != NULL);
-  /* TODO(hongyu): record rpc client stats and census_rpc_end_op here */
-}
-
-static grpc_error *server_init_call_elem(grpc_exec_ctx *exec_ctx,
-                                         grpc_call_element *elem,
-                                         const grpc_call_element_args *args) {
-  call_data *d = (call_data *)elem->call_data;
-  GPR_ASSERT(d != NULL);
-  memset(d, 0, sizeof(*d));
-  d->start_ts = args->start_time;
-  /* TODO(hongyu): call census_tracing_start_op here. */
-  GRPC_CLOSURE_INIT(&d->finish_recv, server_on_done_recv, elem,
-                    grpc_schedule_on_exec_ctx);
-  return GRPC_ERROR_NONE;
-}
-
-static void server_destroy_call_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_element *elem,
-                                     const grpc_call_final_info *final_info,
-                                     grpc_closure *ignored) {
-  call_data *d = (call_data *)elem->call_data;
-  GPR_ASSERT(d != NULL);
-  /* TODO(hongyu): record rpc server stats and census_tracing_end_op here */
-}
-
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  GPR_ASSERT(chand != NULL);
-  return GRPC_ERROR_NONE;
-}
-
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  GPR_ASSERT(chand != NULL);
-}
-
-const grpc_channel_filter grpc_client_census_filter = {
-    client_start_transport_op,
-    grpc_channel_next_op,
-    sizeof(call_data),
-    client_init_call_elem,
-    grpc_call_stack_ignore_set_pollset_or_pollset_set,
-    client_destroy_call_elem,
-    sizeof(channel_data),
-    init_channel_elem,
-    destroy_channel_elem,
-    grpc_channel_next_get_info,
-    "census-client"};
-
-const grpc_channel_filter grpc_server_census_filter = {
-    server_start_transport_op,
-    grpc_channel_next_op,
-    sizeof(call_data),
-    server_init_call_elem,
-    grpc_call_stack_ignore_set_pollset_or_pollset_set,
-    server_destroy_call_elem,
-    sizeof(channel_data),
-    init_channel_elem,
-    destroy_channel_elem,
-    grpc_channel_next_get_info,
-    "census-server"};
diff --git a/src/core/ext/census/grpc_filter.h b/src/core/ext/census/grpc_filter.h
deleted file mode 100644
index 7940363..0000000
--- a/src/core/ext/census/grpc_filter.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_GRPC_FILTER_H
-#define GRPC_CORE_EXT_CENSUS_GRPC_FILTER_H
-
-#include "src/core/lib/channel/channel_stack.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Census filters: provides tracing and stats collection functionalities. It
-   needs to reside right below the surface filter in the channel stack. */
-extern const grpc_channel_filter grpc_client_census_filter;
-extern const grpc_channel_filter grpc_server_census_filter;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_GRPC_FILTER_H */
diff --git a/src/core/ext/census/grpc_plugin.cc b/src/core/ext/census/grpc_plugin.cc
deleted file mode 100644
index 22b16c6..0000000
--- a/src/core/ext/census/grpc_plugin.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include <limits.h>
-#include <string.h>
-
-#include <grpc/census.h>
-
-#include "src/core/ext/census/grpc_filter.h"
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/surface/channel_init.h"
-
-static bool is_census_enabled(const grpc_channel_args *a) {
-  size_t i;
-  if (a == NULL) return 0;
-  for (i = 0; i < a->num_args; i++) {
-    if (0 == strcmp(a->args[i].key, GRPC_ARG_ENABLE_CENSUS)) {
-      return a->args[i].value.integer != 0 && census_enabled();
-    }
-  }
-  return census_enabled() && !grpc_channel_args_want_minimal_stack(a);
-}
-
-static bool maybe_add_census_filter(grpc_exec_ctx *exec_ctx,
-                                    grpc_channel_stack_builder *builder,
-                                    void *arg) {
-  const grpc_channel_args *args =
-      grpc_channel_stack_builder_get_channel_arguments(builder);
-  if (is_census_enabled(args)) {
-    return grpc_channel_stack_builder_prepend_filter(
-        builder, (const grpc_channel_filter *)arg, NULL, NULL);
-  }
-  return true;
-}
-
-extern "C" void census_grpc_plugin_init(void) {
-  /* Only initialize census if no one else has and some features are
-   * available. */
-  if (census_enabled() == CENSUS_FEATURE_NONE &&
-      census_supported() != CENSUS_FEATURE_NONE) {
-    if (census_initialize(census_supported())) { /* enable all features. */
-      gpr_log(GPR_ERROR, "Could not initialize census.");
-    }
-  }
-  grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX,
-                                   maybe_add_census_filter,
-                                   (void *)&grpc_client_census_filter);
-  grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
-                                   maybe_add_census_filter,
-                                   (void *)&grpc_server_census_filter);
-}
-
-extern "C" void census_grpc_plugin_shutdown(void) { census_shutdown(); }
diff --git a/src/core/ext/census/hash_table.cc b/src/core/ext/census/hash_table.cc
deleted file mode 100644
index 545b085..0000000
--- a/src/core/ext/census/hash_table.cc
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/hash_table.h"
-
-#include <stddef.h>
-#include <stdio.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-
-#define CENSUS_HT_NUM_BUCKETS 1999
-
-/* A single hash table data entry */
-typedef struct ht_entry {
-  census_ht_key key;
-  void *data;
-  struct ht_entry *next;
-} ht_entry;
-
-/* hash table bucket */
-typedef struct bucket {
-  /* NULL if bucket is empty */
-  ht_entry *next;
-  /* -1 if all buckets are empty. */
-  int32_t prev_non_empty_bucket;
-  /* -1 if all buckets are empty. */
-  int32_t next_non_empty_bucket;
-} bucket;
-
-struct unresizable_hash_table {
-  /* Number of entries in the table */
-  size_t size;
-  /* Number of buckets */
-  uint32_t num_buckets;
-  /* Array of buckets initialized at creation time. Memory consumption is
-     16 bytes per bucket on a 64-bit platform. */
-  bucket *buckets;
-  /* Index of the first non-empty bucket. -1 iff size == 0. */
-  int32_t first_non_empty_bucket;
-  /* Index of the last non_empty bucket. -1 iff size == 0. */
-  int32_t last_non_empty_bucket;
-  /* Immutable options of this hash table, initialized at creation time. */
-  census_ht_option options;
-};
-
-typedef struct entry_locator {
-  int32_t bucket_idx;
-  int is_first_in_chain;
-  int found;
-  ht_entry *prev_entry;
-} entry_locator;
-
-/* Asserts if option is not valid. */
-void check_options(const census_ht_option *option) {
-  GPR_ASSERT(option != NULL);
-  GPR_ASSERT(option->num_buckets > 0);
-  GPR_ASSERT(option->key_type == CENSUS_HT_UINT64 ||
-             option->key_type == CENSUS_HT_POINTER);
-  if (option->key_type == CENSUS_HT_UINT64) {
-    GPR_ASSERT(option->hash == NULL);
-  } else if (option->key_type == CENSUS_HT_POINTER) {
-    GPR_ASSERT(option->hash != NULL);
-    GPR_ASSERT(option->compare_keys != NULL);
-  }
-}
-
-#define REMOVE_NEXT(options, ptr) \
-  do {                            \
-    ht_entry *tmp = (ptr)->next;  \
-    (ptr)->next = tmp->next;      \
-    delete_entry(options, tmp);   \
-  } while (0)
-
-static void delete_entry(const census_ht_option *opt, ht_entry *p) {
-  if (opt->delete_data != NULL) {
-    opt->delete_data(p->data);
-  }
-  if (opt->delete_key != NULL) {
-    opt->delete_key(p->key.ptr);
-  }
-  gpr_free(p);
-}
-
-static uint64_t hash(const census_ht_option *opt, census_ht_key key) {
-  return opt->key_type == CENSUS_HT_UINT64 ? key.val : opt->hash(key.ptr);
-}
-
-census_ht *census_ht_create(const census_ht_option *option) {
-  int i;
-  census_ht *ret = NULL;
-  check_options(option);
-  ret = (census_ht *)gpr_malloc(sizeof(census_ht));
-  ret->size = 0;
-  ret->num_buckets = option->num_buckets;
-  ret->buckets = (bucket *)gpr_malloc(sizeof(bucket) * ret->num_buckets);
-  ret->options = *option;
-  /* initialize each bucket */
-  for (i = 0; i < ret->options.num_buckets; i++) {
-    ret->buckets[i].prev_non_empty_bucket = -1;
-    ret->buckets[i].next_non_empty_bucket = -1;
-    ret->buckets[i].next = NULL;
-  }
-  return ret;
-}
-
-static int32_t find_bucket_idx(const census_ht *ht, census_ht_key key) {
-  return hash(&ht->options, key) % ht->num_buckets;
-}
-
-static int keys_match(const census_ht_option *opt, const ht_entry *p,
-                      const census_ht_key key) {
-  GPR_ASSERT(opt->key_type == CENSUS_HT_UINT64 ||
-             opt->key_type == CENSUS_HT_POINTER);
-  if (opt->key_type == CENSUS_HT_UINT64) return p->key.val == key.val;
-  return !opt->compare_keys((p->key).ptr, key.ptr);
-}
-
-static entry_locator ht_find(const census_ht *ht, census_ht_key key) {
-  entry_locator loc = {0, 0, 0, NULL};
-  int32_t idx = 0;
-  ht_entry *ptr = NULL;
-  GPR_ASSERT(ht != NULL);
-  idx = find_bucket_idx(ht, key);
-  ptr = ht->buckets[idx].next;
-  if (ptr == NULL) {
-    /* bucket is empty */
-    return loc;
-  }
-  if (keys_match(&ht->options, ptr, key)) {
-    loc.bucket_idx = idx;
-    loc.is_first_in_chain = 1;
-    loc.found = 1;
-    return loc;
-  } else {
-    for (; ptr->next != NULL; ptr = ptr->next) {
-      if (keys_match(&ht->options, ptr->next, key)) {
-        loc.bucket_idx = idx;
-        loc.is_first_in_chain = 0;
-        loc.found = 1;
-        loc.prev_entry = ptr;
-        return loc;
-      }
-    }
-  }
-  /* Could not find the key */
-  return loc;
-}
-
-void *census_ht_find(const census_ht *ht, census_ht_key key) {
-  entry_locator loc = ht_find(ht, key);
-  if (loc.found == 0) {
-    return NULL;
-  }
-  return loc.is_first_in_chain ? ht->buckets[loc.bucket_idx].next->data
-                               : loc.prev_entry->next->data;
-}
-
-void census_ht_insert(census_ht *ht, census_ht_key key, void *data) {
-  int32_t idx = find_bucket_idx(ht, key);
-  ht_entry *ptr = NULL;
-  entry_locator loc = ht_find(ht, key);
-  if (loc.found) {
-    /* Replace old value with new value. */
-    ptr = loc.is_first_in_chain ? ht->buckets[loc.bucket_idx].next
-                                : loc.prev_entry->next;
-    if (ht->options.delete_data != NULL) {
-      ht->options.delete_data(ptr->data);
-    }
-    ptr->data = data;
-    return;
-  }
-
-  /* first entry in the table. */
-  if (ht->size == 0) {
-    ht->buckets[idx].next_non_empty_bucket = -1;
-    ht->buckets[idx].prev_non_empty_bucket = -1;
-    ht->first_non_empty_bucket = idx;
-    ht->last_non_empty_bucket = idx;
-  } else if (ht->buckets[idx].next == NULL) {
-    /* first entry in the bucket. */
-    ht->buckets[ht->last_non_empty_bucket].next_non_empty_bucket = idx;
-    ht->buckets[idx].prev_non_empty_bucket = ht->last_non_empty_bucket;
-    ht->buckets[idx].next_non_empty_bucket = -1;
-    ht->last_non_empty_bucket = idx;
-  }
-  ptr = (ht_entry *)gpr_malloc(sizeof(ht_entry));
-  ptr->key = key;
-  ptr->data = data;
-  ptr->next = ht->buckets[idx].next;
-  ht->buckets[idx].next = ptr;
-  ht->size++;
-}
-
-void census_ht_erase(census_ht *ht, census_ht_key key) {
-  entry_locator loc = ht_find(ht, key);
-  if (loc.found == 0) {
-    /* noop if not found */
-    return;
-  }
-  ht->size--;
-  if (loc.is_first_in_chain) {
-    bucket *b = &ht->buckets[loc.bucket_idx];
-    GPR_ASSERT(b->next != NULL);
-    /* The only entry in the bucket */
-    if (b->next->next == NULL) {
-      int prev = b->prev_non_empty_bucket;
-      int next = b->next_non_empty_bucket;
-      if (prev != -1) {
-        ht->buckets[prev].next_non_empty_bucket = next;
-      } else {
-        ht->first_non_empty_bucket = next;
-      }
-      if (next != -1) {
-        ht->buckets[next].prev_non_empty_bucket = prev;
-      } else {
-        ht->last_non_empty_bucket = prev;
-      }
-    }
-    REMOVE_NEXT(&ht->options, b);
-  } else {
-    GPR_ASSERT(loc.prev_entry->next != NULL);
-    REMOVE_NEXT(&ht->options, loc.prev_entry);
-  }
-}
-
-/* Returns NULL if input table is empty. */
-census_ht_kv *census_ht_get_all_elements(const census_ht *ht, size_t *num) {
-  census_ht_kv *ret = NULL;
-  int i = 0;
-  int32_t idx = -1;
-  GPR_ASSERT(ht != NULL && num != NULL);
-  *num = ht->size;
-  if (*num == 0) {
-    return NULL;
-  }
-
-  ret = (census_ht_kv *)gpr_malloc(sizeof(census_ht_kv) * ht->size);
-  idx = ht->first_non_empty_bucket;
-  while (idx >= 0) {
-    ht_entry *ptr = ht->buckets[idx].next;
-    for (; ptr != NULL; ptr = ptr->next) {
-      ret[i].k = ptr->key;
-      ret[i].v = ptr->data;
-      i++;
-    }
-    idx = ht->buckets[idx].next_non_empty_bucket;
-  }
-  return ret;
-}
-
-static void ht_delete_entry_chain(const census_ht_option *options,
-                                  ht_entry *first) {
-  if (first == NULL) {
-    return;
-  }
-  if (first->next != NULL) {
-    ht_delete_entry_chain(options, first->next);
-  }
-  delete_entry(options, first);
-}
-
-void census_ht_destroy(census_ht *ht) {
-  unsigned i;
-  for (i = 0; i < ht->num_buckets; ++i) {
-    ht_delete_entry_chain(&ht->options, ht->buckets[i].next);
-  }
-  gpr_free(ht->buckets);
-  gpr_free(ht);
-}
-
-size_t census_ht_get_size(const census_ht *ht) { return ht->size; }
diff --git a/src/core/ext/census/hash_table.h b/src/core/ext/census/hash_table.h
deleted file mode 100644
index c3ed94e..0000000
--- a/src/core/ext/census/hash_table.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_HASH_TABLE_H
-#define GRPC_CORE_EXT_CENSUS_HASH_TABLE_H
-
-#include <stddef.h>
-
-#include <grpc/support/port_platform.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* A chain based hash table with fixed number of buckets.
-   Your probably shouldn't use this code directly. It is implemented for the
-   use case in census trace store and stats store, where number of entries in
-   the table is in the scale of upto several thousands, entries are added and
-   removed from the table very frequently (~100k/s), the frequency of find()
-   operations is roughly several times of the frequency of insert() and erase()
-   Comparing to find(), the insert(), erase() and get_all_entries() operations
-   are much less freqent (<1/s).
-
-   Per bucket memory overhead is about (8 + sizeof(intptr_t) bytes.
-   Per entry memory overhead is about (8 + 2 * sizeof(intptr_t) bytes.
-
-   All functions are not thread-safe. Synchronization will be provided in the
-   upper layer (in trace store and stats store).
-*/
-
-/* Opaque hash table struct */
-typedef struct unresizable_hash_table census_ht;
-
-/* Currently, the hash_table can take two types of keys. (uint64 for trace
-   store and const char* for stats store). */
-typedef union {
-  uint64_t val;
-  void *ptr;
-} census_ht_key;
-
-typedef enum census_ht_key_type {
-  CENSUS_HT_UINT64 = 0,
-  CENSUS_HT_POINTER = 1
-} census_ht_key_type;
-
-typedef struct census_ht_option {
-  /* Type of hash key */
-  census_ht_key_type key_type;
-  /* Desired number of buckets, preferably a prime number */
-  int32_t num_buckets;
-  /* Fucntion to calculate uint64 hash value of the key. Only takes effect if
-     key_type is POINTER. */
-  uint64_t (*hash)(const void *);
-  /* Function to compare two keys, returns 0 iff equal. Only takes effect if
-     key_type is POINTER */
-  int (*compare_keys)(const void *k1, const void *k2);
-  /* Value deleter. NULL if no specialized delete function is needed. */
-  void (*delete_data)(void *);
-  /* Key deleter. NULL if table does not own the key. (e.g. key is part of the
-     value or key is not owned by the table.) */
-  void (*delete_key)(void *);
-} census_ht_option;
-
-/* Creates a hashtable with fixed number of buckets according to the settings
-   specified in 'options' arg. Function pointers "hash" and "compare_keys" must
-   be provided if key_type is POINTER. Asserts if fail to create. */
-census_ht *census_ht_create(const census_ht_option *options);
-
-/* Deletes hash table instance. Frees all dynamic memory owned by ht.*/
-void census_ht_destroy(census_ht *ht);
-
-/* Inserts the input key-val pair into hash_table. If an entry with the same key
-   exists in the table, the corresponding value will be overwritten by the input
-   val. */
-void census_ht_insert(census_ht *ht, census_ht_key key, void *val);
-
-/* Returns pointer to data, returns NULL if not found. */
-void *census_ht_find(const census_ht *ht, census_ht_key key);
-
-/* Erase hash table entry with input key. Noop if key is not found. */
-void census_ht_erase(census_ht *ht, census_ht_key key);
-
-typedef struct census_ht_kv {
-  census_ht_key k;
-  void *v;
-} census_ht_kv;
-
-/* Returns an array of pointers to all values in the hash table. Order of the
-   elements can be arbitrary. Sets 'num' to the size of returned array. Caller
-   owns returned array. */
-census_ht_kv *census_ht_get_all_elements(const census_ht *ht, size_t *num);
-
-/* Returns number of elements kept. */
-size_t census_ht_get_size(const census_ht *ht);
-
-/* Functor applied on each key-value pair while iterating through entries in the
-   table. The functor should not mutate data. */
-typedef void (*census_ht_itr_cb)(census_ht_key key, const void *val_ptr,
-                                 void *state);
-
-/* Iterates through all key-value pairs in the hash_table. The callback function
-   should not invalidate data entries. */
-uint64_t census_ht_for_all(const census_ht *ht, census_ht_itr_cb);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_HASH_TABLE_H */
diff --git a/src/core/ext/census/initialize.cc b/src/core/ext/census/initialize.cc
deleted file mode 100644
index 165a122..0000000
--- a/src/core/ext/census/initialize.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/census.h>
-#include "src/core/ext/census/base_resources.h"
-#include "src/core/ext/census/resource.h"
-
-static int features_enabled = CENSUS_FEATURE_NONE;
-
-int census_initialize(int features) {
-  if (features_enabled != CENSUS_FEATURE_NONE) {
-    // Must have been a previous call to census_initialize; return error
-    return -1;
-  }
-  features_enabled = features & CENSUS_FEATURE_ALL;
-  if (features & CENSUS_FEATURE_STATS) {
-    initialize_resources();
-    define_base_resources();
-  }
-
-  return features_enabled;
-}
-
-void census_shutdown(void) {
-  if (features_enabled & CENSUS_FEATURE_STATS) {
-    shutdown_resources();
-  }
-  features_enabled = CENSUS_FEATURE_NONE;
-}
-
-int census_supported(void) {
-  /* TODO(aveitch): improve this as we implement features... */
-  return CENSUS_FEATURE_NONE;
-}
-
-int census_enabled(void) { return features_enabled; }
diff --git a/src/core/ext/census/intrusive_hash_map.cc b/src/core/ext/census/intrusive_hash_map.cc
deleted file mode 100644
index 7930486..0000000
--- a/src/core/ext/census/intrusive_hash_map.cc
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/intrusive_hash_map.h"
-#include <string.h>
-
-extern bool hm_index_compare(const hm_index *A, const hm_index *B);
-
-/* Simple hashing function that takes lower 32 bits. */
-static __inline uint32_t chunked_vector_hasher(uint64_t key) {
-  return (uint32_t)key;
-}
-
-/* Vector chunks are 1MiB divided by pointer size. */
-static const size_t VECTOR_CHUNK_SIZE = (1 << 20) / sizeof(void *);
-
-/* Helper functions which return buckets from the chunked vector. */
-static __inline void **get_mutable_bucket(const chunked_vector *buckets,
-                                          uint32_t index) {
-  if (index < VECTOR_CHUNK_SIZE) {
-    return &buckets->first_[index];
-  }
-  size_t rest_index = (index - VECTOR_CHUNK_SIZE) / VECTOR_CHUNK_SIZE;
-  return &buckets->rest_[rest_index][index % VECTOR_CHUNK_SIZE];
-}
-
-static __inline void *get_bucket(const chunked_vector *buckets,
-                                 uint32_t index) {
-  if (index < VECTOR_CHUNK_SIZE) {
-    return buckets->first_[index];
-  }
-  size_t rest_index = (index - VECTOR_CHUNK_SIZE) / VECTOR_CHUNK_SIZE;
-  return buckets->rest_[rest_index][index % VECTOR_CHUNK_SIZE];
-}
-
-/* Helper function. */
-static __inline size_t RestSize(const chunked_vector *vec) {
-  return (vec->size_ <= VECTOR_CHUNK_SIZE)
-             ? 0
-             : (vec->size_ - VECTOR_CHUNK_SIZE - 1) / VECTOR_CHUNK_SIZE + 1;
-}
-
-/* Initialize chunked vector to size of 0. */
-static void chunked_vector_init(chunked_vector *vec) {
-  vec->size_ = 0;
-  vec->first_ = NULL;
-  vec->rest_ = NULL;
-}
-
-/* Clear chunked vector and free all memory that has been allocated then
-   initialize chunked vector. */
-static void chunked_vector_clear(chunked_vector *vec) {
-  if (vec->first_ != NULL) {
-    gpr_free(vec->first_);
-  }
-  if (vec->rest_ != NULL) {
-    size_t rest_size = RestSize(vec);
-    for (size_t i = 0; i < rest_size; ++i) {
-      if (vec->rest_[i] != NULL) {
-        gpr_free(vec->rest_[i]);
-      }
-    }
-    gpr_free(vec->rest_);
-  }
-  chunked_vector_init(vec);
-}
-
-/* Clear chunked vector and then resize it to n entries. Allow the first 1MB to
-   be read w/o an extra cache miss. The rest of the elements are stored in an
-   array of arrays to avoid large mallocs. */
-static void chunked_vector_reset(chunked_vector *vec, size_t n) {
-  chunked_vector_clear(vec);
-  vec->size_ = n;
-  if (n <= VECTOR_CHUNK_SIZE) {
-    vec->first_ = (void **)gpr_malloc(sizeof(void *) * n);
-    memset(vec->first_, 0, sizeof(void *) * n);
-  } else {
-    vec->first_ = (void **)gpr_malloc(sizeof(void *) * VECTOR_CHUNK_SIZE);
-    memset(vec->first_, 0, sizeof(void *) * VECTOR_CHUNK_SIZE);
-    size_t rest_size = RestSize(vec);
-    vec->rest_ = (void ***)gpr_malloc(sizeof(void **) * rest_size);
-    memset(vec->rest_, 0, sizeof(void **) * rest_size);
-    int i = 0;
-    n -= VECTOR_CHUNK_SIZE;
-    while (n > 0) {
-      size_t this_size = GPR_MIN(n, VECTOR_CHUNK_SIZE);
-      vec->rest_[i] = (void **)gpr_malloc(sizeof(void *) * this_size);
-      memset(vec->rest_[i], 0, sizeof(void *) * this_size);
-      n -= this_size;
-      ++i;
-    }
-  }
-}
-
-void intrusive_hash_map_init(intrusive_hash_map *hash_map,
-                             uint32_t initial_log2_table_size) {
-  hash_map->log2_num_buckets = initial_log2_table_size;
-  hash_map->num_items = 0;
-  uint32_t num_buckets = (uint32_t)1 << hash_map->log2_num_buckets;
-  hash_map->extend_threshold = num_buckets >> 1;
-  chunked_vector_init(&hash_map->buckets);
-  chunked_vector_reset(&hash_map->buckets, num_buckets);
-  hash_map->hash_mask = num_buckets - 1;
-}
-
-bool intrusive_hash_map_empty(const intrusive_hash_map *hash_map) {
-  return hash_map->num_items == 0;
-}
-
-size_t intrusive_hash_map_size(const intrusive_hash_map *hash_map) {
-  return hash_map->num_items;
-}
-
-void intrusive_hash_map_end(const intrusive_hash_map *hash_map, hm_index *idx) {
-  idx->bucket_index = (uint32_t)hash_map->buckets.size_;
-  GPR_ASSERT(idx->bucket_index <= UINT32_MAX);
-  idx->item = NULL;
-}
-
-void intrusive_hash_map_next(const intrusive_hash_map *hash_map,
-                             hm_index *idx) {
-  idx->item = idx->item->hash_link;
-  while (idx->item == NULL) {
-    idx->bucket_index++;
-    if (idx->bucket_index >= hash_map->buckets.size_) {
-      /* Reached end of table. */
-      idx->item = NULL;
-      return;
-    }
-    idx->item = (hm_item *)get_bucket(&hash_map->buckets, idx->bucket_index);
-  }
-}
-
-void intrusive_hash_map_begin(const intrusive_hash_map *hash_map,
-                              hm_index *idx) {
-  for (uint32_t i = 0; i < hash_map->buckets.size_; ++i) {
-    if (get_bucket(&hash_map->buckets, i) != NULL) {
-      idx->bucket_index = i;
-      idx->item = (hm_item *)get_bucket(&hash_map->buckets, i);
-      return;
-    }
-  }
-  intrusive_hash_map_end(hash_map, idx);
-}
-
-hm_item *intrusive_hash_map_find(const intrusive_hash_map *hash_map,
-                                 uint64_t key) {
-  uint32_t index = chunked_vector_hasher(key) & hash_map->hash_mask;
-
-  hm_item *p = (hm_item *)get_bucket(&hash_map->buckets, index);
-  while (p != NULL) {
-    if (key == p->key) {
-      return p;
-    }
-    p = p->hash_link;
-  }
-  return NULL;
-}
-
-hm_item *intrusive_hash_map_erase(intrusive_hash_map *hash_map, uint64_t key) {
-  uint32_t index = chunked_vector_hasher(key) & hash_map->hash_mask;
-
-  hm_item **slot = (hm_item **)get_mutable_bucket(&hash_map->buckets, index);
-  hm_item *p = *slot;
-  if (p == NULL) {
-    return NULL;
-  }
-
-  if (key == p->key) {
-    *slot = p->hash_link;
-    p->hash_link = NULL;
-    hash_map->num_items--;
-    return p;
-  }
-
-  hm_item *prev = p;
-  p = p->hash_link;
-
-  while (p) {
-    if (key == p->key) {
-      prev->hash_link = p->hash_link;
-      p->hash_link = NULL;
-      hash_map->num_items--;
-      return p;
-    }
-    prev = p;
-    p = p->hash_link;
-  }
-  return NULL;
-}
-
-/* Insert an hm_item* into the underlying chunked vector. hash_mask is
- * array_size-1. Returns true if it is a new hm_item and false if the hm_item
- * already existed.
- */
-static __inline bool intrusive_hash_map_internal_insert(chunked_vector *buckets,
-                                                        uint32_t hash_mask,
-                                                        hm_item *item) {
-  const uint64_t key = item->key;
-  uint32_t index = chunked_vector_hasher(key) & hash_mask;
-  hm_item **slot = (hm_item **)get_mutable_bucket(buckets, index);
-  hm_item *p = *slot;
-  item->hash_link = p;
-
-  /* Check to see if key already exists. */
-  while (p) {
-    if (p->key == key) {
-      return false;
-    }
-    p = p->hash_link;
-  }
-
-  /* Otherwise add new entry. */
-  *slot = item;
-  return true;
-}
-
-/* Extend the allocated number of elements in the hash map by a factor of 2. */
-void intrusive_hash_map_extend(intrusive_hash_map *hash_map) {
-  uint32_t new_log2_num_buckets = 1 + hash_map->log2_num_buckets;
-  uint32_t new_num_buckets = (uint32_t)1 << new_log2_num_buckets;
-  GPR_ASSERT(new_num_buckets <= UINT32_MAX && new_num_buckets > 0);
-  chunked_vector new_buckets;
-  chunked_vector_init(&new_buckets);
-  chunked_vector_reset(&new_buckets, new_num_buckets);
-  uint32_t new_hash_mask = new_num_buckets - 1;
-
-  hm_index cur_idx;
-  hm_index end_idx;
-  intrusive_hash_map_end(hash_map, &end_idx);
-  intrusive_hash_map_begin(hash_map, &cur_idx);
-  while (!hm_index_compare(&cur_idx, &end_idx)) {
-    hm_item *new_item = cur_idx.item;
-    intrusive_hash_map_next(hash_map, &cur_idx);
-    intrusive_hash_map_internal_insert(&new_buckets, new_hash_mask, new_item);
-  }
-
-  /* Set values for new chunked_vector. extend_threshold is set to half of
-   * new_num_buckets. */
-  hash_map->log2_num_buckets = new_log2_num_buckets;
-  chunked_vector_clear(&hash_map->buckets);
-  hash_map->buckets = new_buckets;
-  hash_map->hash_mask = new_hash_mask;
-  hash_map->extend_threshold = new_num_buckets >> 1;
-}
-
-/* Insert a hm_item. The hm_item must remain live until it is removed from the
-   table. This object does not take the ownership of hm_item. The caller must
-   remove this hm_item from the table and delete it before this table is
-   deleted. If hm_item exists already num_items is not changed. */
-bool intrusive_hash_map_insert(intrusive_hash_map *hash_map, hm_item *item) {
-  if (hash_map->num_items >= hash_map->extend_threshold) {
-    intrusive_hash_map_extend(hash_map);
-  }
-  if (intrusive_hash_map_internal_insert(&hash_map->buckets,
-                                         hash_map->hash_mask, item)) {
-    hash_map->num_items++;
-    return true;
-  }
-  return false;
-}
-
-void intrusive_hash_map_clear(intrusive_hash_map *hash_map,
-                              void (*free_object)(void *)) {
-  hm_index cur;
-  hm_index end;
-  intrusive_hash_map_end(hash_map, &end);
-  intrusive_hash_map_begin(hash_map, &cur);
-
-  while (!hm_index_compare(&cur, &end)) {
-    hm_index next = cur;
-    intrusive_hash_map_next(hash_map, &next);
-    if (cur.item != NULL) {
-      hm_item *item = intrusive_hash_map_erase(hash_map, cur.item->key);
-      (*free_object)((void *)item);
-      gpr_free(item);
-    }
-    cur = next;
-  }
-}
-
-void intrusive_hash_map_free(intrusive_hash_map *hash_map,
-                             void (*free_object)(void *)) {
-  intrusive_hash_map_clear(hash_map, (*free_object));
-  hash_map->num_items = 0;
-  hash_map->extend_threshold = 0;
-  hash_map->log2_num_buckets = 0;
-  hash_map->hash_mask = 0;
-  chunked_vector_clear(&hash_map->buckets);
-}
diff --git a/src/core/ext/census/intrusive_hash_map.h b/src/core/ext/census/intrusive_hash_map.h
deleted file mode 100644
index 2c7baa3..0000000
--- a/src/core/ext/census/intrusive_hash_map.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_INTRUSIVE_HASH_MAP_H
-#define GRPC_CORE_EXT_CENSUS_INTRUSIVE_HASH_MAP_H
-
-#include "src/core/ext/census/intrusive_hash_map_internal.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* intrusive_hash_map is a fast chained hash table. This hash map is faster than
- * a dense hash map when the application calls insert and erase more often than
- * find. When the workload is dominated by find() a dense hash map may be
- * faster.
- *
- * intrusive_hash_map uses an intrusive header placed within a user defined
- * struct. The header field IHM_key MUST be set to a valid value before
- * insertion into the hash map or undefined behavior may occur. The header field
- * IHM_hash_link MUST to be set to NULL initially.
- *
- * EXAMPLE USAGE:
- *
- *  typedef struct string_item {
- *    INTRUSIVE_HASH_MAP_HEADER;
- *    // User data.
- *    char *str_buf;
- *    uint16_t len;
- *  } string_item;
- *
- *  static string_item *make_string_item(uint64_t key, const char *buf,
- *                                       uint16_t len) {
- *    string_item *item = (string_item *)gpr_malloc(sizeof(string_item));
- *    item->IHM_key = key;
- *    item->IHM_hash_link = NULL;
- *    item->len = len;
- *    item->str_buf = (char *)malloc(len);
- *    memcpy(item->str_buf, buf, len);
- *    return item;
- *  }
- *
- *  intrusive_hash_map hash_map;
- *  intrusive_hash_map_init(&hash_map, 4);
- *  string_item *new_item1 = make_string_item(10, "test1", 5);
- *  bool ok = intrusive_hash_map_insert(&hash_map, (hm_item *)new_item1);
- *
- *  string_item *item1 =
- *    (string_item *)intrusive_hash_map_find(&hash_map, 10);
- */
-
-/* Hash map item. Stores key and a pointer to the actual object. A user defined
- * version of this can be passed in provided the first 2 entries (key and
- * hash_link) are the same. These entries must be first in the user defined
- * struct. Pointer to struct will need to be cast as (hm_item *) when passed to
- * hash map. This allows it to be intrusive. */
-typedef struct hm_item {
-  uint64_t key;
-  struct hm_item *hash_link;
-  /* Optional user defined data after this. */
-} hm_item;
-
-/* Macro provided for ease of use.  This must be first in the user defined
- * struct (i.e. uint64_t key and hm_item * must be the first two elements in
- * that order). */
-#define INTRUSIVE_HASH_MAP_HEADER \
-  uint64_t IHM_key;               \
-  struct hm_item *IHM_hash_link
-
-/* Index struct which acts as a pseudo-iterator within the hash map. */
-typedef struct hm_index {
-  uint32_t bucket_index;  // hash map bucket index.
-  hm_item *item;          // Pointer to hm_item within the hash map.
-} hm_index;
-
-/* Returns true if two hm_indices point to the same object within the hash map
- * and false otherwise. */
-__inline bool hm_index_compare(const hm_index *A, const hm_index *B) {
-  return (A->item == B->item && A->bucket_index == B->bucket_index);
-}
-
-/*
- * Helper functions for iterating over the hash map.
- */
-
-/* On return idx will contain an invalid index which is always equal to
- * hash_map->buckets.size_ */
-void intrusive_hash_map_end(const intrusive_hash_map *hash_map, hm_index *idx);
-
-/* Iterates index to the next valid entry in the hash map and stores the
- * index within idx. If end of table is reached, idx will contain the same
- * values as if intrusive_hash_map_end() was called. */
-void intrusive_hash_map_next(const intrusive_hash_map *hash_map, hm_index *idx);
-
-/* On return, idx will contain the index of the first non-null entry in the hash
- * map. If the hash map is empty, idx will contain the same values as if
- * intrusive_hash_map_end() was called. */
-void intrusive_hash_map_begin(const intrusive_hash_map *hash_map,
-                              hm_index *idx);
-
-/* Initialize intrusive hash map data structure. This must be called before
- * the hash map can be used. The initial size of an intrusive hash map will be
- * 2^initial_log2_map_size (valid range is [0, 31]). */
-void intrusive_hash_map_init(intrusive_hash_map *hash_map,
-                             uint32_t initial_log2_map_size);
-
-/* Returns true if the hash map is empty and false otherwise. */
-bool intrusive_hash_map_empty(const intrusive_hash_map *hash_map);
-
-/* Returns the number of elements currently in the hash map. */
-size_t intrusive_hash_map_size(const intrusive_hash_map *hash_map);
-
-/* Find a hm_item within the hash map by key. Returns NULL if item was not
- * found. */
-hm_item *intrusive_hash_map_find(const intrusive_hash_map *hash_map,
-                                 uint64_t key);
-
-/* Erase the hm_item that corresponds with key. If the hm_item is found, return
- * the pointer to the hm_item. Else returns NULL. */
-hm_item *intrusive_hash_map_erase(intrusive_hash_map *hash_map, uint64_t key);
-
-/* Attempts to insert a new hm_item into the hash map.  If an element with the
- * same key already exists, it will not insert the new item and return false.
- * Otherwise, it will insert the new item and return true. */
-bool intrusive_hash_map_insert(intrusive_hash_map *hash_map, hm_item *item);
-
-/* Clears entire contents of the hash map, but leaves internal data structure
- * untouched. Second argument takes a function pointer to a function that will
- * free the object designated by the user and pointed to by hash_map->value. */
-void intrusive_hash_map_clear(intrusive_hash_map *hash_map,
-                              void (*free_object)(void *));
-
-/* Erase all contents of hash map and free the memory. Hash map is invalid
- * after calling this function and cannot be used until it has been
- * reinitialized (intrusive_hash_map_init()). This function takes a function
- * pointer to a function that will free the object designated by the user and
- * pointed to by hash_map->value. */
-void intrusive_hash_map_free(intrusive_hash_map *hash_map,
-                             void (*free_object)(void *));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_INTRUSIVE_HASH_MAP_H */
diff --git a/src/core/ext/census/intrusive_hash_map_internal.h b/src/core/ext/census/intrusive_hash_map_internal.h
deleted file mode 100644
index e9c81fc..0000000
--- a/src/core/ext/census/intrusive_hash_map_internal.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_INTRUSIVE_HASH_MAP_INTERNAL_H
-#define GRPC_CORE_EXT_CENSUS_INTRUSIVE_HASH_MAP_INTERNAL_H
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-#include <stdbool.h>
-
-/* The chunked vector is a data structure that allocates buckets for use in the
- * hash map. ChunkedVector is logically equivalent to T*[N] (cast void* as
- * T*). It's internally implemented as an array of 1MB arrays to avoid
- * allocating large consecutive memory chunks. This is an internal data
- * structure that should never be accessed directly. */
-typedef struct chunked_vector {
-  size_t size_;
-  void **first_;
-  void ***rest_;
-} chunked_vector;
-
-/* Core intrusive hash map data structure. All internal elements are managed by
- * functions and should not be altered manually. */
-typedef struct intrusive_hash_map {
-  uint32_t num_items;
-  uint32_t extend_threshold;
-  uint32_t log2_num_buckets;
-  uint32_t hash_mask;
-  chunked_vector buckets;
-} intrusive_hash_map;
-
-#endif /* GRPC_CORE_EXT_CENSUS_INTRUSIVE_HASH_MAP_INTERNAL_H */
diff --git a/src/core/ext/census/mlog.cc b/src/core/ext/census/mlog.cc
deleted file mode 100644
index 4b8c846..0000000
--- a/src/core/ext/census/mlog.cc
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// Implements an efficient in-memory log, optimized for multiple writers and
-// a single reader. Available log space is divided up in blocks of
-// CENSUS_LOG_2_MAX_RECORD_SIZE bytes. A block can be in one of the following
-// three data structures:
-// - Free blocks (free_block_list)
-// - Blocks with unread data (dirty_block_list)
-// - Blocks currently attached to cores (core_local_blocks[])
-//
-// census_log_start_write() moves a block from core_local_blocks[] to the end of
-// dirty_block_list when block:
-// - is out-of-space OR
-// - has an incomplete record (an incomplete record occurs when a thread calls
-//   census_log_start_write() and is context-switched before calling
-//   census_log_end_write()
-// So, blocks in dirty_block_list are ordered, from oldest to newest, by the
-// time when block is detached from the core.
-//
-// census_log_read_next() first iterates over dirty_block_list and then
-// core_local_blocks[]. It moves completely read blocks from dirty_block_list
-// to free_block_list. Blocks in core_local_blocks[] are not freed, even when
-// completely read.
-//
-// If the log is configured to discard old records and free_block_list is empty,
-// census_log_start_write() iterates over dirty_block_list to allocate a
-// new block. It moves the oldest available block (no pending read/write) to
-// core_local_blocks[].
-//
-// core_local_block_struct is used to implement a map from core id to the block
-// associated with that core. This mapping is advisory. It is possible that the
-// block returned by this mapping is no longer associated with that core. This
-// mapping is updated, lazily, by census_log_start_write().
-//
-// Locking in block struct:
-//
-// Exclusive g_log.lock must be held before calling any functions operating on
-// block structs except census_log_start_write() and census_log_end_write().
-//
-// Writes to a block are serialized via writer_lock. census_log_start_write()
-// acquires this lock and census_log_end_write() releases it. On failure to
-// acquire the lock, writer allocates a new block for the current core and
-// updates core_local_block accordingly.
-//
-// Simultaneous read and write access is allowed. Readers can safely read up to
-// committed bytes (bytes_committed).
-//
-// reader_lock protects the block, currently being read, from getting recycled.
-// start_read() acquires reader_lock and end_read() releases the lock.
-//
-// Read/write access to a block is disabled via try_disable_access(). It returns
-// with both writer_lock and reader_lock held. These locks are subsequently
-// released by enable_access() to enable access to the block.
-//
-// A note on naming: Most function/struct names are prepended by cl_
-// (shorthand for census_log). Further, functions that manipulate structures
-// include the name of the structure, which will be passed as the first
-// argument. E.g. cl_block_initialize() will initialize a cl_block.
-
-#include "src/core/ext/census/mlog.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/atm.h>
-#include <grpc/support/cpu.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/useful.h>
-#include <stdbool.h>
-#include <string.h>
-
-// End of platform specific code
-
-typedef struct census_log_block_list_struct {
-  struct census_log_block_list_struct* next;
-  struct census_log_block_list_struct* prev;
-  struct census_log_block* block;
-} cl_block_list_struct;
-
-typedef struct census_log_block {
-  // Pointer to underlying buffer.
-  char* buffer;
-  gpr_atm writer_lock;
-  gpr_atm reader_lock;
-  // Keeps completely written bytes. Declared atomic because accessed
-  // simultaneously by reader and writer.
-  gpr_atm bytes_committed;
-  // Bytes already read.
-  size_t bytes_read;
-  // Links for list.
-  cl_block_list_struct link;
-// We want this structure to be cacheline aligned. We assume the following
-// sizes for the various parts on 32/64bit systems:
-// type                 32b size    64b size
-// char*                   4           8
-// 3x gpr_atm             12          24
-// size_t                  4           8
-// cl_block_list_struct   12          24
-// TOTAL                  32          64
-//
-// Depending on the size of our cacheline and the architecture, we
-// selectively add char buffering to this structure. The size is checked
-// via assert in census_log_initialize().
-#if defined(GPR_ARCH_64)
-#define CL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 64)
-#else
-#if defined(GPR_ARCH_32)
-#define CL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 32)
-#else
-#error "Unknown architecture"
-#endif
-#endif
-#if CL_BLOCK_PAD_SIZE > 0
-  char padding[CL_BLOCK_PAD_SIZE];
-#endif
-} cl_block;
-
-// A list of cl_blocks, doubly-linked through cl_block::link.
-typedef struct census_log_block_list {
-  int32_t count;            // Number of items in list.
-  cl_block_list_struct ht;  // head/tail of linked list.
-} cl_block_list;
-
-// Cacheline aligned block pointers to avoid false sharing. Block pointer must
-// be initialized via set_block(), before calling other functions
-typedef struct census_log_core_local_block {
-  gpr_atm block;
-// Ensure cachline alignment: we assume sizeof(gpr_atm) == 4 or 8
-#if defined(GPR_ARCH_64)
-#define CL_CORE_LOCAL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 8)
-#else
-#if defined(GPR_ARCH_32)
-#define CL_CORE_LOCAL_BLOCK_PAD_SIZE (GPR_CACHELINE_SIZE - 4)
-#else
-#error "Unknown architecture"
-#endif
-#endif
-#if CL_CORE_LOCAL_BLOCK_PAD_SIZE > 0
-  char padding[CL_CORE_LOCAL_BLOCK_PAD_SIZE];
-#endif
-} cl_core_local_block;
-
-struct census_log {
-  int discard_old_records;
-  // Number of cores (aka hardware-contexts)
-  unsigned num_cores;
-  // number of CENSUS_LOG_2_MAX_RECORD_SIZE blocks in log
-  uint32_t num_blocks;
-  cl_block* blocks;                        // Block metadata.
-  cl_core_local_block* core_local_blocks;  // Keeps core to block mappings.
-  gpr_mu lock;
-  int initialized;  // has log been initialized?
-  // Keeps the state of the reader iterator. A value of 0 indicates that
-  // iterator has reached the end. census_log_init_reader() resets the value
-  // to num_core to restart iteration.
-  uint32_t read_iterator_state;
-  // Points to the block being read. If non-NULL, the block is locked for
-  // reading(block_being_read_->reader_lock is held).
-  cl_block* block_being_read;
-  char* buffer;
-  cl_block_list free_block_list;
-  cl_block_list dirty_block_list;
-  gpr_atm out_of_space_count;
-};
-
-// Single internal log.
-static struct census_log g_log;
-
-// Functions that operate on an atomic memory location used as a lock.
-
-// Returns non-zero if lock is acquired.
-static int cl_try_lock(gpr_atm* lock) { return gpr_atm_acq_cas(lock, 0, 1); }
-
-static void cl_unlock(gpr_atm* lock) { gpr_atm_rel_store(lock, 0); }
-
-// Functions that operate on cl_core_local_block's.
-
-static void cl_core_local_block_set_block(cl_core_local_block* clb,
-                                          cl_block* block) {
-  gpr_atm_rel_store(&clb->block, (gpr_atm)block);
-}
-
-static cl_block* cl_core_local_block_get_block(cl_core_local_block* clb) {
-  return (cl_block*)gpr_atm_acq_load(&clb->block);
-}
-
-// Functions that operate on cl_block_list_struct's.
-
-static void cl_block_list_struct_initialize(cl_block_list_struct* bls,
-                                            cl_block* block) {
-  bls->next = bls->prev = bls;
-  bls->block = block;
-}
-
-// Functions that operate on cl_block_list's.
-
-static void cl_block_list_initialize(cl_block_list* list) {
-  list->count = 0;
-  cl_block_list_struct_initialize(&list->ht, NULL);
-}
-
-// Returns head of *this, or NULL if empty.
-static cl_block* cl_block_list_head(cl_block_list* list) {
-  return list->ht.next->block;
-}
-
-// Insert element *e after *pos.
-static void cl_block_list_insert(cl_block_list* list, cl_block_list_struct* pos,
-                                 cl_block_list_struct* e) {
-  list->count++;
-  e->next = pos->next;
-  e->prev = pos;
-  e->next->prev = e;
-  e->prev->next = e;
-}
-
-// Insert block at the head of the list
-static void cl_block_list_insert_at_head(cl_block_list* list, cl_block* block) {
-  cl_block_list_insert(list, &list->ht, &block->link);
-}
-
-// Insert block at the tail of the list.
-static void cl_block_list_insert_at_tail(cl_block_list* list, cl_block* block) {
-  cl_block_list_insert(list, list->ht.prev, &block->link);
-}
-
-// Removes block *b. Requires *b be in the list.
-static void cl_block_list_remove(cl_block_list* list, cl_block* b) {
-  list->count--;
-  b->link.next->prev = b->link.prev;
-  b->link.prev->next = b->link.next;
-}
-
-// Functions that operate on cl_block's
-
-static void cl_block_initialize(cl_block* block, char* buffer) {
-  block->buffer = buffer;
-  gpr_atm_rel_store(&block->writer_lock, 0);
-  gpr_atm_rel_store(&block->reader_lock, 0);
-  gpr_atm_rel_store(&block->bytes_committed, 0);
-  block->bytes_read = 0;
-  cl_block_list_struct_initialize(&block->link, block);
-}
-
-// Guards against exposing partially written buffer to the reader.
-static void cl_block_set_bytes_committed(cl_block* block,
-                                         size_t bytes_committed) {
-  gpr_atm_rel_store(&block->bytes_committed, (gpr_atm)bytes_committed);
-}
-
-static size_t cl_block_get_bytes_committed(cl_block* block) {
-  return (size_t)gpr_atm_acq_load(&block->bytes_committed);
-}
-
-// Tries to disable future read/write access to this block. Succeeds if:
-// - no in-progress write AND
-// - no in-progress read AND
-// - 'discard_data' set to true OR no unread data
-// On success, clears the block state and returns with writer_lock_ and
-// reader_lock_ held. These locks are released by a subsequent
-// cl_block_access_enable() call.
-static bool cl_block_try_disable_access(cl_block* block, int discard_data) {
-  if (!cl_try_lock(&block->writer_lock)) {
-    return false;
-  }
-  if (!cl_try_lock(&block->reader_lock)) {
-    cl_unlock(&block->writer_lock);
-    return false;
-  }
-  if (!discard_data &&
-      (block->bytes_read != cl_block_get_bytes_committed(block))) {
-    cl_unlock(&block->reader_lock);
-    cl_unlock(&block->writer_lock);
-    return false;
-  }
-  cl_block_set_bytes_committed(block, 0);
-  block->bytes_read = 0;
-  return true;
-}
-
-static void cl_block_enable_access(cl_block* block) {
-  cl_unlock(&block->reader_lock);
-  cl_unlock(&block->writer_lock);
-}
-
-// Returns with writer_lock held.
-static void* cl_block_start_write(cl_block* block, size_t size) {
-  if (!cl_try_lock(&block->writer_lock)) {
-    return NULL;
-  }
-  size_t bytes_committed = cl_block_get_bytes_committed(block);
-  if (bytes_committed + size > CENSUS_LOG_MAX_RECORD_SIZE) {
-    cl_unlock(&block->writer_lock);
-    return NULL;
-  }
-  return block->buffer + bytes_committed;
-}
-
-// Releases writer_lock and increments committed bytes by 'bytes_written'.
-// 'bytes_written' must be <= 'size' specified in the corresponding
-// StartWrite() call. This function is thread-safe.
-static void cl_block_end_write(cl_block* block, size_t bytes_written) {
-  cl_block_set_bytes_committed(
-      block, cl_block_get_bytes_committed(block) + bytes_written);
-  cl_unlock(&block->writer_lock);
-}
-
-// Returns a pointer to the first unread byte in buffer. The number of bytes
-// available are returned in 'bytes_available'. Acquires reader lock that is
-// released by a subsequent cl_block_end_read() call. Returns NULL if:
-// - read in progress
-// - no data available
-static void* cl_block_start_read(cl_block* block, size_t* bytes_available) {
-  if (!cl_try_lock(&block->reader_lock)) {
-    return NULL;
-  }
-  // bytes_committed may change from under us. Use bytes_available to update
-  // bytes_read below.
-  size_t bytes_committed = cl_block_get_bytes_committed(block);
-  GPR_ASSERT(bytes_committed >= block->bytes_read);
-  *bytes_available = bytes_committed - block->bytes_read;
-  if (*bytes_available == 0) {
-    cl_unlock(&block->reader_lock);
-    return NULL;
-  }
-  void* record = block->buffer + block->bytes_read;
-  block->bytes_read += *bytes_available;
-  return record;
-}
-
-static void cl_block_end_read(cl_block* block) {
-  cl_unlock(&block->reader_lock);
-}
-
-// Internal functions operating on g_log
-
-// Allocates a new free block (or recycles an available dirty block if log is
-// configured to discard old records). Returns NULL if out-of-space.
-static cl_block* cl_allocate_block(void) {
-  cl_block* block = cl_block_list_head(&g_log.free_block_list);
-  if (block != NULL) {
-    cl_block_list_remove(&g_log.free_block_list, block);
-    return block;
-  }
-  if (!g_log.discard_old_records) {
-    // No free block and log is configured to keep old records.
-    return NULL;
-  }
-  // Recycle dirty block. Start from the oldest.
-  for (block = cl_block_list_head(&g_log.dirty_block_list); block != NULL;
-       block = block->link.next->block) {
-    if (cl_block_try_disable_access(block, 1 /* discard data */)) {
-      cl_block_list_remove(&g_log.dirty_block_list, block);
-      return block;
-    }
-  }
-  return NULL;
-}
-
-// Allocates a new block and updates core id => block mapping. 'old_block'
-// points to the block that the caller thinks is attached to
-// 'core_id'. 'old_block' may be NULL. Returns true if:
-// - allocated a new block OR
-// - 'core_id' => 'old_block' mapping changed (another thread allocated a
-//   block before lock was acquired).
-static bool cl_allocate_core_local_block(uint32_t core_id,
-                                         cl_block* old_block) {
-  // Now that we have the lock, check if core-local mapping has changed.
-  cl_core_local_block* core_local_block = &g_log.core_local_blocks[core_id];
-  cl_block* block = cl_core_local_block_get_block(core_local_block);
-  if ((block != NULL) && (block != old_block)) {
-    return true;
-  }
-  if (block != NULL) {
-    cl_core_local_block_set_block(core_local_block, NULL);
-    cl_block_list_insert_at_tail(&g_log.dirty_block_list, block);
-  }
-  block = cl_allocate_block();
-  if (block == NULL) {
-    return false;
-  }
-  cl_core_local_block_set_block(core_local_block, block);
-  cl_block_enable_access(block);
-  return true;
-}
-
-static cl_block* cl_get_block(void* record) {
-  uintptr_t p = (uintptr_t)((char*)record - g_log.buffer);
-  uintptr_t index = p >> CENSUS_LOG_2_MAX_RECORD_SIZE;
-  return &g_log.blocks[index];
-}
-
-// Gets the next block to read and tries to free 'prev' block (if not NULL).
-// Returns NULL if reached the end.
-static cl_block* cl_next_block_to_read(cl_block* prev) {
-  cl_block* block = NULL;
-  if (g_log.read_iterator_state == g_log.num_cores) {
-    // We are traversing dirty list; find the next dirty block.
-    if (prev != NULL) {
-      // Try to free the previous block if there is no unread data. This
-      // block
-      // may have unread data if previously incomplete record completed
-      // between
-      // read_next() calls.
-      block = prev->link.next->block;
-      if (cl_block_try_disable_access(prev, 0 /* do not discard data */)) {
-        cl_block_list_remove(&g_log.dirty_block_list, prev);
-        cl_block_list_insert_at_head(&g_log.free_block_list, prev);
-      }
-    } else {
-      block = cl_block_list_head(&g_log.dirty_block_list);
-    }
-    if (block != NULL) {
-      return block;
-    }
-    // We are done with the dirty list; moving on to core-local blocks.
-  }
-  while (g_log.read_iterator_state > 0) {
-    g_log.read_iterator_state--;
-    block = cl_core_local_block_get_block(
-        &g_log.core_local_blocks[g_log.read_iterator_state]);
-    if (block != NULL) {
-      return block;
-    }
-  }
-  return NULL;
-}
-
-#define CL_LOG_2_MB 20  // 2^20 = 1MB
-
-// External functions: primary stats_log interface
-void census_log_initialize(size_t size_in_mb, int discard_old_records) {
-  // Check cacheline alignment.
-  GPR_ASSERT(sizeof(cl_block) % GPR_CACHELINE_SIZE == 0);
-  GPR_ASSERT(sizeof(cl_core_local_block) % GPR_CACHELINE_SIZE == 0);
-  GPR_ASSERT(!g_log.initialized);
-  g_log.discard_old_records = discard_old_records;
-  g_log.num_cores = gpr_cpu_num_cores();
-  // Ensure that we will not get any overflow in calaculating num_blocks
-  GPR_ASSERT(CL_LOG_2_MB >= CENSUS_LOG_2_MAX_RECORD_SIZE);
-  GPR_ASSERT(size_in_mb < 1000);
-  // Ensure at least 2x as many blocks as there are cores.
-  g_log.num_blocks =
-      (uint32_t)GPR_MAX(2 * g_log.num_cores, (size_in_mb << CL_LOG_2_MB) >>
-                                                 CENSUS_LOG_2_MAX_RECORD_SIZE);
-  gpr_mu_init(&g_log.lock);
-  g_log.read_iterator_state = 0;
-  g_log.block_being_read = NULL;
-  g_log.core_local_blocks = (cl_core_local_block*)gpr_malloc_aligned(
-      g_log.num_cores * sizeof(cl_core_local_block), GPR_CACHELINE_SIZE_LOG);
-  memset(g_log.core_local_blocks, 0,
-         g_log.num_cores * sizeof(cl_core_local_block));
-  g_log.blocks = (cl_block*)gpr_malloc_aligned(
-      g_log.num_blocks * sizeof(cl_block), GPR_CACHELINE_SIZE_LOG);
-  memset(g_log.blocks, 0, g_log.num_blocks * sizeof(cl_block));
-  g_log.buffer =
-      (char*)gpr_malloc(g_log.num_blocks * CENSUS_LOG_MAX_RECORD_SIZE);
-  memset(g_log.buffer, 0, g_log.num_blocks * CENSUS_LOG_MAX_RECORD_SIZE);
-  cl_block_list_initialize(&g_log.free_block_list);
-  cl_block_list_initialize(&g_log.dirty_block_list);
-  for (uint32_t i = 0; i < g_log.num_blocks; ++i) {
-    cl_block* block = g_log.blocks + i;
-    cl_block_initialize(block, g_log.buffer + (CENSUS_LOG_MAX_RECORD_SIZE * i));
-    cl_block_try_disable_access(block, 1 /* discard data */);
-    cl_block_list_insert_at_tail(&g_log.free_block_list, block);
-  }
-  gpr_atm_rel_store(&g_log.out_of_space_count, 0);
-  g_log.initialized = 1;
-}
-
-void census_log_shutdown(void) {
-  GPR_ASSERT(g_log.initialized);
-  gpr_mu_destroy(&g_log.lock);
-  gpr_free_aligned(g_log.core_local_blocks);
-  g_log.core_local_blocks = NULL;
-  gpr_free_aligned(g_log.blocks);
-  g_log.blocks = NULL;
-  gpr_free(g_log.buffer);
-  g_log.buffer = NULL;
-  g_log.initialized = 0;
-}
-
-void* census_log_start_write(size_t size) {
-  // Used to bound number of times block allocation is attempted.
-  GPR_ASSERT(size > 0);
-  GPR_ASSERT(g_log.initialized);
-  if (size > CENSUS_LOG_MAX_RECORD_SIZE) {
-    return NULL;
-  }
-  uint32_t attempts_remaining = g_log.num_blocks;
-  uint32_t core_id = gpr_cpu_current_cpu();
-  do {
-    void* record = NULL;
-    cl_block* block =
-        cl_core_local_block_get_block(&g_log.core_local_blocks[core_id]);
-    if (block && (record = cl_block_start_write(block, size))) {
-      return record;
-    }
-    // Need to allocate a new block. We are here if:
-    // - No block associated with the core OR
-    // - Write in-progress on the block OR
-    // - block is out of space
-    gpr_mu_lock(&g_log.lock);
-    bool allocated = cl_allocate_core_local_block(core_id, block);
-    gpr_mu_unlock(&g_log.lock);
-    if (!allocated) {
-      gpr_atm_no_barrier_fetch_add(&g_log.out_of_space_count, 1);
-      return NULL;
-    }
-  } while (attempts_remaining--);
-  // Give up.
-  gpr_atm_no_barrier_fetch_add(&g_log.out_of_space_count, 1);
-  return NULL;
-}
-
-void census_log_end_write(void* record, size_t bytes_written) {
-  GPR_ASSERT(g_log.initialized);
-  cl_block_end_write(cl_get_block(record), bytes_written);
-}
-
-void census_log_init_reader(void) {
-  GPR_ASSERT(g_log.initialized);
-  gpr_mu_lock(&g_log.lock);
-  // If a block is locked for reading unlock it.
-  if (g_log.block_being_read != NULL) {
-    cl_block_end_read(g_log.block_being_read);
-    g_log.block_being_read = NULL;
-  }
-  g_log.read_iterator_state = g_log.num_cores;
-  gpr_mu_unlock(&g_log.lock);
-}
-
-const void* census_log_read_next(size_t* bytes_available) {
-  GPR_ASSERT(g_log.initialized);
-  gpr_mu_lock(&g_log.lock);
-  if (g_log.block_being_read != NULL) {
-    cl_block_end_read(g_log.block_being_read);
-  }
-  do {
-    g_log.block_being_read = cl_next_block_to_read(g_log.block_being_read);
-    if (g_log.block_being_read != NULL) {
-      void* record =
-          cl_block_start_read(g_log.block_being_read, bytes_available);
-      if (record != NULL) {
-        gpr_mu_unlock(&g_log.lock);
-        return record;
-      }
-    }
-  } while (g_log.block_being_read != NULL);
-  gpr_mu_unlock(&g_log.lock);
-  return NULL;
-}
-
-size_t census_log_remaining_space(void) {
-  GPR_ASSERT(g_log.initialized);
-  size_t space = 0;
-  gpr_mu_lock(&g_log.lock);
-  if (g_log.discard_old_records) {
-    // Remaining space is not meaningful; just return the entire log space.
-    space = g_log.num_blocks << CENSUS_LOG_2_MAX_RECORD_SIZE;
-  } else {
-    GPR_ASSERT(g_log.free_block_list.count >= 0);
-    space = (size_t)g_log.free_block_list.count * CENSUS_LOG_MAX_RECORD_SIZE;
-  }
-  gpr_mu_unlock(&g_log.lock);
-  return space;
-}
-
-int64_t census_log_out_of_space_count(void) {
-  GPR_ASSERT(g_log.initialized);
-  return gpr_atm_acq_load(&g_log.out_of_space_count);
-}
diff --git a/src/core/ext/census/mlog.h b/src/core/ext/census/mlog.h
deleted file mode 100644
index 8f74ba2..0000000
--- a/src/core/ext/census/mlog.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* A very fast in-memory log, optimized for multiple writers. */
-
-#ifndef GRPC_CORE_EXT_CENSUS_MLOG_H
-#define GRPC_CORE_EXT_CENSUS_MLOG_H
-
-#include <grpc/support/port_platform.h>
-#include <stddef.h>
-
-/* Maximum record size, in bytes. */
-#define CENSUS_LOG_2_MAX_RECORD_SIZE 14 /* 2^14 = 16KB */
-#define CENSUS_LOG_MAX_RECORD_SIZE (1 << CENSUS_LOG_2_MAX_RECORD_SIZE)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Initialize the statistics logging subsystem with the given log size. A log
-   size of 0 will result in the smallest possible log for the platform
-   (approximately CENSUS_LOG_MAX_RECORD_SIZE * gpr_cpu_num_cores()). If
-   discard_old_records is non-zero, then new records will displace older ones
-   when the log is full. This function must be called before any other
-   census_log functions.
-*/
-void census_log_initialize(size_t size_in_mb, int discard_old_records);
-
-/* Shutdown the logging subsystem. Caller must ensure that:
-   - no in progress or future call to any census_log functions
-   - no incomplete records
-*/
-void census_log_shutdown(void);
-
-/* Allocates and returns a 'size' bytes record and marks it in use. A
-   subsequent census_log_end_write() marks the record complete. The
-   'bytes_written' census_log_end_write() argument must be <=
-   'size'. Returns NULL if out-of-space AND:
-       - log is configured to keep old records OR
-       - all blocks are pinned by incomplete records.
-*/
-void* census_log_start_write(size_t size);
-
-void census_log_end_write(void* record, size_t bytes_written);
-
-void census_log_init_reader(void);
-
-/* census_log_read_next() iterates over blocks with data and for each block
-   returns a pointer to the first unread byte. The number of bytes that can be
-   read are returned in 'bytes_available'. Reader is expected to read all
-   available data. Reading the data consumes it i.e. it cannot be read again.
-   census_log_read_next() returns NULL if the end is reached i.e last block
-   is read. census_log_init_reader() starts the iteration or aborts the
-   current iteration.
-*/
-const void* census_log_read_next(size_t* bytes_available);
-
-/* Returns estimated remaining space across all blocks, in bytes. If log is
-   configured to discard old records, returns total log space. Otherwise,
-   returns space available in empty blocks (partially filled blocks are
-   treated as full).
-*/
-size_t census_log_remaining_space(void);
-
-/* Returns the number of times grpc_stats_log_start_write() failed due to
-   out-of-space. */
-int64_t census_log_out_of_space_count(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_MLOG_H */
diff --git a/src/core/ext/census/operation.cc b/src/core/ext/census/operation.cc
deleted file mode 100644
index be88ac7..0000000
--- a/src/core/ext/census/operation.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/census.h>
-
-/* TODO(aveitch): These are all placeholder implementations. */
-
-census_timestamp census_start_rpc_op_timestamp(void) {
-  census_timestamp ct;
-  /* TODO(aveitch): assumes gpr_timespec implementation of census_timestamp. */
-  ct.ts = gpr_now(GPR_CLOCK_MONOTONIC);
-  return ct;
-}
-
-census_context *census_start_client_rpc_op(
-    const census_context *context, int64_t rpc_name_id,
-    const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask,
-    const census_timestamp *start_time) {
-  return NULL;
-}
-
-census_context *census_start_server_rpc_op(
-    const char *buffer, int64_t rpc_name_id,
-    const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask,
-    census_timestamp *start_time) {
-  return NULL;
-}
-
-census_context *census_start_op(census_context *context, const char *family,
-                                const char *name, int trace_mask) {
-  return NULL;
-}
-
-void census_end_op(census_context *context, int status) {}
diff --git a/src/core/ext/census/placeholders.cc b/src/core/ext/census/placeholders.cc
deleted file mode 100644
index bed9837..0000000
--- a/src/core/ext/census/placeholders.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/census.h>
-
-#include <grpc/support/log.h>
-
-/* Placeholders for the pending APIs */
-
-int census_get_trace_record(census_trace_record *trace_record) {
-  (void)trace_record;
-  abort();
-}
-
-void census_record_values(census_context *context, census_value *values,
-                          size_t nvalues) {
-  (void)context;
-  (void)values;
-  (void)nvalues;
-  abort();
-}
-
-void census_set_rpc_client_peer(census_context *context, const char *peer) {
-  (void)context;
-  (void)peer;
-  abort();
-}
-
-void census_trace_scan_end() { abort(); }
-
-int census_trace_scan_start(int consume) {
-  (void)consume;
-  abort();
-}
diff --git a/src/core/ext/census/resource.cc b/src/core/ext/census/resource.cc
deleted file mode 100644
index 44a8872..0000000
--- a/src/core/ext/census/resource.cc
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/resource.h"
-#include "third_party/nanopb/pb_decode.h"
-
-#include <grpc/census.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#include <stdbool.h>
-#include <string.h>
-
-// Protect local resource data structures.
-static gpr_mu resource_lock;
-
-// Deleteing and creating resources are relatively rare events, and should not
-// be done in the critical path of performance sensitive code. We record
-// current resource id's used in a simple array, and just search it each time
-// we need to assign a new id, or look up a resource.
-static resource **resources = NULL;
-
-// Number of entries in *resources
-static size_t n_resources = 0;
-
-// Number of defined resources
-static size_t n_defined_resources = 0;
-
-void initialize_resources(void) {
-  gpr_mu_init(&resource_lock);
-  gpr_mu_lock(&resource_lock);
-  GPR_ASSERT(resources == NULL && n_resources == 0 && n_defined_resources == 0);
-  gpr_mu_unlock(&resource_lock);
-}
-
-// Delete a resource given it's ID. The ID must be a valid resource ID. Must be
-// called with resource_lock held.
-static void delete_resource_locked(size_t rid) {
-  GPR_ASSERT(resources[rid] != NULL);
-  gpr_free(resources[rid]->name);
-  gpr_free(resources[rid]->description);
-  gpr_free(resources[rid]->numerators);
-  gpr_free(resources[rid]->denominators);
-  gpr_free(resources[rid]);
-  resources[rid] = NULL;
-  n_defined_resources--;
-}
-
-void shutdown_resources(void) {
-  gpr_mu_lock(&resource_lock);
-  for (size_t i = 0; i < n_resources; i++) {
-    if (resources[i] != NULL) {
-      delete_resource_locked(i);
-    }
-  }
-  GPR_ASSERT(n_defined_resources == 0);
-  gpr_free(resources);
-  resources = NULL;
-  n_resources = 0;
-  gpr_mu_unlock(&resource_lock);
-}
-
-// Check the contents of string fields in a resource proto.
-static bool validate_string(pb_istream_t *stream, const pb_field_t *field,
-                            void **arg) {
-  resource *vresource = (resource *)*arg;
-  switch (field->tag) {
-    case google_census_Resource_name_tag:
-      // Name must have at least one character
-      if (stream->bytes_left == 0) {
-        gpr_log(GPR_INFO, "Zero-length Resource name.");
-        return false;
-      }
-      vresource->name = (char *)gpr_malloc(stream->bytes_left + 1);
-      vresource->name[stream->bytes_left] = '\0';
-      if (!pb_read(stream, (uint8_t *)vresource->name, stream->bytes_left)) {
-        return false;
-      }
-      // Can't have same name as an existing resource.
-      for (size_t i = 0; i < n_resources; i++) {
-        resource *compare = resources[i];
-        if (compare == vresource || compare == NULL) continue;
-        if (strcmp(compare->name, vresource->name) == 0) {
-          gpr_log(GPR_INFO, "Duplicate Resource name %s.", vresource->name);
-          return false;
-        }
-      }
-      break;
-    case google_census_Resource_description_tag:
-      if (stream->bytes_left == 0) {
-        return true;
-      }
-      vresource->description = (char *)gpr_malloc(stream->bytes_left + 1);
-      vresource->description[stream->bytes_left] = '\0';
-      if (!pb_read(stream, (uint8_t *)vresource->description,
-                   stream->bytes_left)) {
-        return false;
-      }
-      break;
-    default:
-      // No other string fields in Resource. Print warning and skip.
-      gpr_log(GPR_INFO, "Unknown string field type in Resource protobuf.");
-      if (!pb_read(stream, NULL, stream->bytes_left)) {
-        return false;
-      }
-      break;
-  }
-  return true;
-}
-
-// Decode numerators/denominators in a stream. The `count` and `bup`
-// (BasicUnit pointer) are pointers to the approriate fields in a resource
-// struct.
-static bool validate_units_helper(pb_istream_t *stream, int *count,
-                                  google_census_Resource_BasicUnit **bup) {
-  while (stream->bytes_left) {
-    (*count)++;
-    // Have to allocate a new array of values. Normal case is 0 or 1, so
-    // this should normally not be an issue.
-    google_census_Resource_BasicUnit *new_bup =
-        (google_census_Resource_BasicUnit *)gpr_malloc(
-            (size_t)*count * sizeof(google_census_Resource_BasicUnit));
-    if (*count != 1) {
-      memcpy(new_bup, *bup,
-             (size_t)(*count - 1) * sizeof(google_census_Resource_BasicUnit));
-      gpr_free(*bup);
-    }
-    *bup = new_bup;
-    uint64_t value;
-    if (!pb_decode_varint(stream, &value)) {
-      return false;
-    }
-    *(*bup + *count - 1) = (google_census_Resource_BasicUnit)value;
-  }
-  return true;
-}
-
-// Validate units field of a Resource proto.
-static bool validate_units(pb_istream_t *stream, const pb_field_t *field,
-                           void **arg) {
-  resource *vresource = (resource *)(*arg);
-  switch (field->tag) {
-    case google_census_Resource_MeasurementUnit_numerator_tag:
-      return validate_units_helper(stream, &vresource->n_numerators,
-                                   &vresource->numerators);
-      break;
-    case google_census_Resource_MeasurementUnit_denominator_tag:
-      return validate_units_helper(stream, &vresource->n_denominators,
-                                   &vresource->denominators);
-      break;
-    default:
-      gpr_log(GPR_ERROR, "Unknown field type.");
-      return false;
-      break;
-  }
-  return true;
-}
-
-// Validate the contents of a Resource proto. `id` is the intended resource id.
-static bool validate_resource_pb(const uint8_t *resource_pb,
-                                 size_t resource_pb_size, size_t id) {
-  GPR_ASSERT(id < n_resources);
-  if (resource_pb == NULL) {
-    return false;
-  }
-  google_census_Resource vresource;
-  vresource.name.funcs.decode = &validate_string;
-  vresource.name.arg = resources[id];
-  vresource.description.funcs.decode = &validate_string;
-  vresource.description.arg = resources[id];
-  vresource.unit.numerator.funcs.decode = &validate_units;
-  vresource.unit.numerator.arg = resources[id];
-  vresource.unit.denominator.funcs.decode = &validate_units;
-  vresource.unit.denominator.arg = resources[id];
-
-  pb_istream_t stream =
-      pb_istream_from_buffer((uint8_t *)resource_pb, resource_pb_size);
-  if (!pb_decode(&stream, google_census_Resource_fields, &vresource)) {
-    return false;
-  }
-  // A Resource must have a name, a unit, with at least one numerator.
-  return (resources[id]->name != NULL && vresource.has_unit &&
-          resources[id]->n_numerators > 0);
-}
-
-// Allocate a blank resource, and return associated ID. Must be called with
-// resource_lock held.
-size_t allocate_resource(void) {
-  // use next_id to optimize expected placement of next new resource.
-  static size_t next_id = 0;
-  size_t id = n_resources;  // resource ID - initialize to invalid value.
-  // Expand resources if needed.
-  if (n_resources == n_defined_resources) {
-    size_t new_n_resources = n_resources ? n_resources * 2 : 2;
-    resource **new_resources =
-        (resource **)gpr_malloc(new_n_resources * sizeof(resource *));
-    if (n_resources != 0) {
-      memcpy(new_resources, resources, n_resources * sizeof(resource *));
-    }
-    memset(new_resources + n_resources, 0,
-           (new_n_resources - n_resources) * sizeof(resource *));
-    gpr_free(resources);
-    resources = new_resources;
-    n_resources = new_n_resources;
-    id = n_defined_resources;
-  } else {
-    GPR_ASSERT(n_defined_resources < n_resources);
-    // Find a free id.
-    for (size_t base = 0; base < n_resources; base++) {
-      id = (next_id + base) % n_resources;
-      if (resources[id] == NULL) break;
-    }
-  }
-  GPR_ASSERT(id < n_resources && resources[id] == NULL);
-  resources[id] = (resource *)gpr_malloc(sizeof(resource));
-  memset(resources[id], 0, sizeof(resource));
-  n_defined_resources++;
-  next_id = (id + 1) % n_resources;
-  return id;
-}
-
-int32_t census_define_resource(const uint8_t *resource_pb,
-                               size_t resource_pb_size) {
-  if (resource_pb == NULL) {
-    return -1;
-  }
-  gpr_mu_lock(&resource_lock);
-  size_t id = allocate_resource();
-  // Validate pb, extract name.
-  if (!validate_resource_pb(resource_pb, resource_pb_size, id)) {
-    delete_resource_locked(id);
-    gpr_mu_unlock(&resource_lock);
-    return -1;
-  }
-  gpr_mu_unlock(&resource_lock);
-  return (int32_t)id;
-}
-
-void census_delete_resource(int32_t rid) {
-  gpr_mu_lock(&resource_lock);
-  if (rid >= 0 && (size_t)rid < n_resources && resources[rid] != NULL) {
-    delete_resource_locked((size_t)rid);
-  }
-  gpr_mu_unlock(&resource_lock);
-}
-
-int32_t census_resource_id(const char *name) {
-  gpr_mu_lock(&resource_lock);
-  for (int32_t id = 0; (size_t)id < n_resources; id++) {
-    if (resources[id] != NULL && strcmp(resources[id]->name, name) == 0) {
-      gpr_mu_unlock(&resource_lock);
-      return id;
-    }
-  }
-  gpr_mu_unlock(&resource_lock);
-  return -1;
-}
-
-int32_t define_resource(const resource *base) {
-  GPR_ASSERT(base != NULL && base->name != NULL && base->n_numerators > 0 &&
-             base->numerators != NULL);
-  gpr_mu_lock(&resource_lock);
-  size_t id = allocate_resource();
-  size_t len = strlen(base->name) + 1;
-  resources[id]->name = (char *)gpr_malloc(len);
-  memcpy(resources[id]->name, base->name, len);
-  if (base->description) {
-    len = strlen(base->description) + 1;
-    resources[id]->description = (char *)gpr_malloc(len);
-    memcpy(resources[id]->description, base->description, len);
-  }
-  resources[id]->prefix = base->prefix;
-  resources[id]->n_numerators = base->n_numerators;
-  len = (size_t)base->n_numerators * sizeof(*base->numerators);
-  resources[id]->numerators =
-      (google_census_Resource_BasicUnit *)gpr_malloc(len);
-  memcpy(resources[id]->numerators, base->numerators, len);
-  resources[id]->n_denominators = base->n_denominators;
-  if (base->n_denominators != 0) {
-    len = (size_t)base->n_denominators * sizeof(*base->denominators);
-    resources[id]->denominators =
-        (google_census_Resource_BasicUnit *)gpr_malloc(len);
-    memcpy(resources[id]->denominators, base->denominators, len);
-  }
-  gpr_mu_unlock(&resource_lock);
-  return (int32_t)id;
-}
diff --git a/src/core/ext/census/resource.h b/src/core/ext/census/resource.h
deleted file mode 100644
index 56aaaaf..0000000
--- a/src/core/ext/census/resource.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* Census-internal resource definition and manipluation functions. */
-#ifndef GRPC_CORE_EXT_CENSUS_RESOURCE_H
-#define GRPC_CORE_EXT_CENSUS_RESOURCE_H
-
-#include <grpc/grpc.h>
-#include "src/core/ext/census/gen/census.pb.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Internal representation of a resource. */
-typedef struct {
-  char *name;
-  char *description;
-  int32_t prefix;
-  int n_numerators;
-  google_census_Resource_BasicUnit *numerators;
-  int n_denominators;
-  google_census_Resource_BasicUnit *denominators;
-} resource;
-
-/* Initialize and shutdown the resources subsystem. */
-void initialize_resources(void);
-void shutdown_resources(void);
-
-/* Add a new resource, given a proposed resource structure. Returns the
-   resource ID, or -ve on failure.
-   TODO(aveitch): this function exists to support addition of the base
-   resources. It should be removed when we have the ability to add resources
-   from configuration files. */
-int32_t define_resource(const resource *base);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_RESOURCE_H */
diff --git a/src/core/ext/census/rpc_metric_id.h b/src/core/ext/census/rpc_metric_id.h
deleted file mode 100644
index ea493d7..0000000
--- a/src/core/ext/census/rpc_metric_id.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_RPC_METRIC_ID_H
-#define GRPC_CORE_EXT_CENSUS_RPC_METRIC_ID_H
-
-/* Metric ID's used for RPC measurements. */
-/* Count of client requests sent. */
-#define CENSUS_METRIC_RPC_CLIENT_REQUESTS ((uint32_t)0)
-/* Count of server requests sent. */
-#define CENSUS_METRIC_RPC_SERVER_REQUESTS ((uint32_t)1)
-/* Client error counts. */
-#define CENSUS_METRIC_RPC_CLIENT_ERRORS ((uint32_t)2)
-/* Server error counts. */
-#define CENSUS_METRIC_RPC_SERVER_ERRORS ((uint32_t)3)
-/* Client side request latency. */
-#define CENSUS_METRIC_RPC_CLIENT_LATENCY ((uint32_t)4)
-/* Server side request latency. */
-#define CENSUS_METRIC_RPC_SERVER_LATENCY ((uint32_t)5)
-
-#endif /* GRPC_CORE_EXT_CENSUS_RPC_METRIC_ID_H */
diff --git a/src/core/ext/census/trace_context.cc b/src/core/ext/census/trace_context.cc
deleted file mode 100644
index af92ae6..0000000
--- a/src/core/ext/census/trace_context.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/trace_context.h"
-
-#include <grpc/census.h>
-#include <grpc/support/log.h>
-#include <stdbool.h>
-
-#include "third_party/nanopb/pb_decode.h"
-#include "third_party/nanopb/pb_encode.h"
-
-// This function assumes the TraceContext is valid.
-size_t encode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
-                            const size_t buf_size) {
-  // Create a stream that will write to our buffer.
-  pb_ostream_t stream = pb_ostream_from_buffer(buffer, buf_size);
-
-  // encode message
-  bool status = pb_encode(&stream, google_trace_TraceContext_fields, ctxt);
-
-  if (!status) {
-    gpr_log(GPR_DEBUG, "TraceContext encoding failed: %s",
-            PB_GET_ERROR(&stream));
-    return 0;
-  }
-
-  return stream.bytes_written;
-}
-
-bool decode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
-                          const size_t nbytes) {
-  // Create a stream that reads nbytes from the buffer.
-  pb_istream_t stream = pb_istream_from_buffer(buffer, nbytes);
-
-  // decode message
-  bool status = pb_decode(&stream, google_trace_TraceContext_fields, ctxt);
-
-  if (!status) {
-    gpr_log(GPR_DEBUG, "TraceContext decoding failed: %s",
-            PB_GET_ERROR(&stream));
-    return false;
-  }
-
-  // check fields
-  if (!ctxt->has_trace_id_hi || !ctxt->has_trace_id_lo) {
-    gpr_log(GPR_DEBUG, "Invalid TraceContext: missing trace_id");
-    return false;
-  }
-  if (!ctxt->has_span_id) {
-    gpr_log(GPR_DEBUG, "Invalid TraceContext: missing span_id");
-    return false;
-  }
-
-  return true;
-}
diff --git a/src/core/ext/census/trace_context.h b/src/core/ext/census/trace_context.h
deleted file mode 100644
index 2b828ba..0000000
--- a/src/core/ext/census/trace_context.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* Functions for manipulating trace contexts as defined in
-   src/proto/census/trace.proto */
-#ifndef GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H
-#define GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H
-
-#include "src/core/ext/census/gen/trace_context.pb.h"
-
-/* Span option flags. */
-#define SPAN_OPTIONS_IS_SAMPLED 0x01
-
-/* Maximum number of bytes required to encode a TraceContext (31)
-1 byte for trace_id field
-1 byte for trace_id length
-1 byte for trace_id.hi field
-8 bytes for trace_id.hi (uint64_t)
-1 byte for trace_id.lo field
-8 bytes for trace_id.lo (uint64_t)
-1 byte for span_id field
-8 bytes for span_id (uint64_t)
-1 byte for is_sampled field
-1 byte for is_sampled (bool) */
-#define TRACE_MAX_CONTEXT_SIZE 31
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Encode a trace context (ctxt) into proto format to the buffer provided.  The
-size of buffer must be at least TRACE_MAX_CONTEXT_SIZE.  On success, returns the
-number of bytes successfully encoded into buffer.  On failure, returns 0. */
-size_t encode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
-                            const size_t buf_size);
-
-/* Decode a proto-encoded TraceContext from the provided buffer into the
-TraceContext structure (ctxt).  The function expects to be supplied the number
-of bytes to be read from buffer (nbytes).  This function will also validate that
-the TraceContext has a span_id and a trace_id, and will return false if either
-of these do not exist. On success, returns true and false otherwise. */
-bool decode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
-                          const size_t nbytes);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H */
diff --git a/src/core/ext/census/trace_label.h b/src/core/ext/census/trace_label.h
deleted file mode 100644
index 97ce399..0000000
--- a/src/core/ext/census/trace_label.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_TRACE_LABEL_H
-#define GRPC_CORE_EXT_CENSUS_TRACE_LABEL_H
-
-#include "src/core/ext/census/trace_string.h"
-
-/* Trace label (key/value pair) stores a label name and the label value. The
-   value can be one of trace_string/int64_t/bool. */
-typedef struct trace_label {
-  trace_string key;
-  enum label_type {
-    /* Unknown value for debugging/error purposes */
-    LABEL_UNKNOWN = 0,
-    /* A string value */
-    LABEL_STRING = 1,
-    /* An integer value. */
-    LABEL_INT = 2,
-    /* A boolean value. */
-    LABEL_BOOL = 3,
-  } value_type;
-
-  union value {
-    trace_string label_str;
-    int64_t label_int;
-    bool label_bool;
-  } value;
-} trace_label;
-
-#endif /* GRPC_CORE_EXT_CENSUS_TRACE_LABEL_H */
diff --git a/src/core/ext/census/trace_propagation.h b/src/core/ext/census/trace_propagation.h
deleted file mode 100644
index e05fd23..0000000
--- a/src/core/ext/census/trace_propagation.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_TRACE_PROPAGATION_H
-#define GRPC_CORE_EXT_CENSUS_TRACE_PROPAGATION_H
-
-#include "src/core/ext/census/tracing.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Encoding and decoding functions for receiving and sending trace contexts
-   over the wire.  Only RPC libraries should be calling these
-   functions.  These functions return the number of bytes encoded/decoded
-   (0 if a failure has occurred). buf_size indicates the size of the
-   input/output buffer. trace_span_context is a struct that includes the
-   trace ID, span ID, and a set of option flags (is_sampled, etc.). */
-
-/* Converts a span context to a binary byte buffer. */
-size_t trace_span_context_to_binary(const trace_span_context *ctxt,
-                                    uint8_t *buf, size_t buf_size);
-
-/* Reads a binary byte buffer and populates a span context structure. */
-size_t binary_to_trace_span_context(const uint8_t *buf, size_t buf_size,
-                                    trace_span_context *ctxt);
-
-/* Converts a span context to an http metadata compatible string. */
-size_t trace_span_context_to_http_format(const trace_span_context *ctxt,
-                                         char *buf, size_t buf_size);
-
-/* Reads an http metadata compatible string and populates a span context
-   structure. */
-size_t http_format_to_trace_span_context(const char *buf, size_t buf_size,
-                                         trace_span_context *ctxt);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_TRACE_PROPAGATION_H */
diff --git a/src/core/ext/census/trace_status.h b/src/core/ext/census/trace_status.h
deleted file mode 100644
index dd83d3f..0000000
--- a/src/core/ext/census/trace_status.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_TRACE_STATUS_H
-#define GRPC_CORE_EXT_CENSUS_TRACE_STATUS_H
-
-#include "src/core/ext/census/trace_string.h"
-
-/* Stores a status code and status message for a trace. */
-typedef struct trace_status {
-  int64_t errorCode;
-  trace_string errorMessage;
-} trace_status;
-
-#endif /* GRPC_CORE_EXT_CENSUS_TRACE_STATUS_H */
diff --git a/src/core/ext/census/trace_string.h b/src/core/ext/census/trace_string.h
deleted file mode 100644
index e4da3f5..0000000
--- a/src/core/ext/census/trace_string.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_TRACE_STRING_H
-#define GRPC_CORE_EXT_CENSUS_TRACE_STRING_H
-
-#include <grpc/slice.h>
-
-/* String struct for tracing messages. Since this is a C API, we do not have
-   access to a string class.  This is intended for use by higher level
-   languages which wrap around the C API, as most of them have a string class.
-   This will also be more efficient when copying, as we have an explicitly
-   specified length.  Also, grpc_slice has reference counting which allows for
-   interning. */
-typedef struct trace_string {
-  char *string;
-  size_t length;
-} trace_string;
-
-#endif /* GRPC_CORE_EXT_CENSUS_TRACE_STRING_H */
diff --git a/src/core/ext/census/tracing.cc b/src/core/ext/census/tracing.cc
deleted file mode 100644
index 823c681..0000000
--- a/src/core/ext/census/tracing.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/tracing.h"
-
-#include <grpc/census.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/ext/census/mlog.h"
-
-void trace_start_span(const trace_span_context *span_ctxt,
-                      const trace_string name, const start_span_options *opts,
-                      trace_span_context *new_span_ctxt,
-                      bool has_remote_parent) {
-  // Noop implementation.
-}
-
-void trace_add_span_annotation(const trace_string description,
-                               const trace_label *labels, const size_t n_labels,
-                               trace_span_context *span_ctxt) {
-  // Noop implementation.
-}
-
-void trace_add_span_network_event_annotation(const trace_string description,
-                                             const trace_label *labels,
-                                             const size_t n_labels,
-                                             const gpr_timespec timestamp,
-                                             bool sent, uint64_t id,
-                                             trace_span_context *span_ctxt) {
-  // Noop implementation.
-}
-
-void trace_add_span_labels(const trace_label *labels, const size_t n_labels,
-                           trace_span_context *span_ctxt) {
-  // Noop implementation.
-}
-
-void trace_end_span(const trace_status *status, trace_span_context *span_ctxt) {
-  // Noop implementation.
-}
diff --git a/src/core/ext/census/tracing.h b/src/core/ext/census/tracing.h
deleted file mode 100644
index 0690de8..0000000
--- a/src/core/ext/census/tracing.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_TRACING_H
-#define GRPC_CORE_EXT_CENSUS_TRACING_H
-
-#include <grpc/support/time.h>
-#include <stdbool.h>
-#include "src/core/ext/census/trace_context.h"
-#include "src/core/ext/census/trace_label.h"
-#include "src/core/ext/census/trace_status.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* This is the low level tracing API that other languages will interface with.
-   This is not intended to be accessed by the end-user, therefore it has been
-   designed with performance in mind rather than ease of use. */
-
-/* The tracing level. */
-enum TraceLevel {
-  /* Annotations on this context will be silently discarded. */
-  NO_TRACING = 0,
-  /* Annotations will not be saved to a persistent store. They will be
-     available via local APIs only. This setting is not propagated to child
-     spans. */
-  TRANSIENT_TRACING = 1,
-  /* Annotations are recorded for the entire distributed trace and they are
-     saved to a persistent store. This setting is propagated to child spans. */
-  PERSISTENT_TRACING = 2,
-};
-
-typedef struct trace_span_context {
-  /* Trace span context stores Span ID, Trace ID, and option flags. */
-  /* Trace ID is 128 bits split into 2 64-bit chunks (hi and lo). */
-  uint64_t trace_id_hi;
-  uint64_t trace_id_lo;
-  /* Span ID is 64 bits. */
-  uint64_t span_id;
-  /* Span-options is 32-bit value which contains flag options. */
-  uint32_t span_options;
-} trace_span_context;
-
-typedef struct start_span_options {
-  /* If set, this will override the Span.local_start_time for the Span. */
-  gpr_timespec local_start_timestamp;
-
-  /* Linked spans can be used to identify spans that are linked to this span in
-     a different trace.  This can be used (for example) in batching operations,
-     where a single batch handler processes multiple requests from different
-     traces. If set, points to a list of Spans are linked to the created Span.*/
-  trace_span_context *linked_spans;
-  /* The number of linked spans. */
-  size_t n_linked_spans;
-} start_span_options;
-
-/* Create a new child Span (or root if parent is NULL), with parent being the
-   designated Span. The child span will have the provided name and starting
-   span options (optional). The bool has_remote_parent marks whether the
-   context refers to a remote parent span or not. */
-void trace_start_span(const trace_span_context *span_ctxt,
-                      const trace_string name, const start_span_options *opts,
-                      trace_span_context *new_span_ctxt,
-                      bool has_remote_parent);
-
-/* Add a new Annotation to the Span. Annotations consist of a description
-   (trace_string) and a set of n labels (trace_label).  This can be populated
-   with arbitrary user data. */
-void trace_add_span_annotation(const trace_string description,
-                               const trace_label *labels, const size_t n_labels,
-                               trace_span_context *span_ctxt);
-
-/* Add a new NetworkEvent annotation to a Span. This function is only intended
-  to be used by RPC systems (either client or server), not by higher level
-  applications. The timestamp type will be system-defined, the sent argument
-  designates whether this is a network send event (client request, server
-  reply)or receive (server request, client reply). The id argument corresponds
-  to Span.Annotation.NetworkEvent.id from the data model, and serves to uniquely
-  identify each network message. */
-void trace_add_span_network_event(const trace_string description,
-                                  const trace_label *labels,
-                                  const size_t n_labels,
-                                  const gpr_timespec timestamp, bool sent,
-                                  uint64_t id, trace_span_context *span_ctxt);
-
-/* Add a set of labels to the Span. These will correspond to the field
-Span.labels in the data model. */
-void trace_add_span_labels(const trace_label *labels, const size_t n_labels,
-                           trace_span_context *span_ctxt);
-
-/* Mark the end of Span Execution with the given status. Only the timing of the
-first EndSpan call for a given Span will be recorded, and implementations are
-free to ignore all further calls using the Span. EndSpanOptions can
-optionally be NULL. */
-void trace_end_span(const trace_status *status, trace_span_context *span_ctxt);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_TRACING_H */
diff --git a/src/core/ext/census/window_stats.cc b/src/core/ext/census/window_stats.cc
deleted file mode 100644
index 0058e4b..0000000
--- a/src/core/ext/census/window_stats.cc
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/window_stats.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include <math.h>
-#include <stddef.h>
-#include <string.h>
-
-/* typedefs make typing long names easier. Use cws (for census_window_stats) */
-typedef census_window_stats_stat_info cws_stat_info;
-typedef struct census_window_stats_sum cws_sum;
-
-/* Each interval is composed of a number of buckets, which hold a count of
-   entries and a single statistic */
-typedef struct census_window_stats_bucket {
-  int64_t count;
-  void *statistic;
-} cws_bucket;
-
-/* Each interval has a set of buckets, and the variables needed to keep
-   track of their current state */
-typedef struct census_window_stats_interval_stats {
-  /* The buckets. There will be 'granularity' + 1 of these. */
-  cws_bucket *buckets;
-  /* Index of the bucket containing the smallest time interval. */
-  int bottom_bucket;
-  /* The smallest time storable in the current window. */
-  int64_t bottom;
-  /* The largest time storable in the current window + 1ns */
-  int64_t top;
-  /* The width of each bucket in ns. */
-  int64_t width;
-} cws_interval_stats;
-
-typedef struct census_window_stats {
-  /* Number of intervals. */
-  int nintervals;
-  /* Number of buckets in each interval. 'granularity' + 1. */
-  int nbuckets;
-  /* Record of stat_info. */
-  cws_stat_info stat_info;
-  /* Stats for each interval. */
-  cws_interval_stats *interval_stats;
-  /* The time the newset stat was recorded. */
-  int64_t newest_time;
-} window_stats;
-
-/* Calculate an actual bucket index from a logical index 'IDX'. Other
-   parameters supply information on the interval struct and overall stats. */
-#define BUCKET_IDX(IS, IDX, WSTATS) \
-  ((IS->bottom_bucket + (IDX)) % WSTATS->nbuckets)
-
-/* The maximum seconds value we can have in a valid timespec. More than this
-   will result in overflow in timespec_to_ns(). This works out to ~292 years.
-   TODO: consider using doubles instead of int64. */
-static int64_t max_seconds = (GPR_INT64_MAX - GPR_NS_PER_SEC) / GPR_NS_PER_SEC;
-
-static int64_t timespec_to_ns(const gpr_timespec ts) {
-  if (ts.tv_sec > max_seconds) {
-    return GPR_INT64_MAX - 1;
-  }
-  return ts.tv_sec * GPR_NS_PER_SEC + ts.tv_nsec;
-}
-
-static void cws_initialize_statistic(void *statistic,
-                                     const cws_stat_info *stat_info) {
-  if (stat_info->stat_initialize == NULL) {
-    memset(statistic, 0, stat_info->stat_size);
-  } else {
-    stat_info->stat_initialize(statistic);
-  }
-}
-
-/* Create and initialize a statistic */
-static void *cws_create_statistic(const cws_stat_info *stat_info) {
-  void *stat = gpr_malloc(stat_info->stat_size);
-  cws_initialize_statistic(stat, stat_info);
-  return stat;
-}
-
-window_stats *census_window_stats_create(int nintervals,
-                                         const gpr_timespec intervals[],
-                                         int granularity,
-                                         const cws_stat_info *stat_info) {
-  window_stats *ret;
-  int i;
-  /* validate inputs */
-  GPR_ASSERT(nintervals > 0 && granularity > 2 && intervals != NULL &&
-             stat_info != NULL);
-  for (i = 0; i < nintervals; i++) {
-    int64_t ns = timespec_to_ns(intervals[i]);
-    GPR_ASSERT(intervals[i].tv_sec >= 0 && intervals[i].tv_nsec >= 0 &&
-               intervals[i].tv_nsec < GPR_NS_PER_SEC && ns >= 100 &&
-               granularity * 10 <= ns);
-  }
-  /* Allocate and initialize relevant data structures */
-  ret = (window_stats *)gpr_malloc(sizeof(window_stats));
-  ret->nintervals = nintervals;
-  ret->nbuckets = granularity + 1;
-  ret->stat_info = *stat_info;
-  ret->interval_stats =
-      (cws_interval_stats *)gpr_malloc(nintervals * sizeof(cws_interval_stats));
-  for (i = 0; i < nintervals; i++) {
-    int64_t size_ns = timespec_to_ns(intervals[i]);
-    cws_interval_stats *is = ret->interval_stats + i;
-    cws_bucket *buckets = is->buckets =
-        (cws_bucket *)gpr_malloc(ret->nbuckets * sizeof(cws_bucket));
-    int b;
-    for (b = 0; b < ret->nbuckets; b++) {
-      buckets[b].statistic = cws_create_statistic(stat_info);
-      buckets[b].count = 0;
-    }
-    is->bottom_bucket = 0;
-    is->bottom = 0;
-    is->width = size_ns / granularity;
-    /* Check for possible overflow issues, and maximize interval size if the
-       user requested something large enough. */
-    if ((GPR_INT64_MAX - is->width) > size_ns) {
-      is->top = size_ns + is->width;
-    } else {
-      is->top = GPR_INT64_MAX;
-      is->width = GPR_INT64_MAX / (granularity + 1);
-    }
-    /* If size doesn't divide evenly, we can have a width slightly too small;
-       better to have it slightly large. */
-    if ((size_ns - (granularity + 1) * is->width) > 0) {
-      is->width += 1;
-    }
-  }
-  ret->newest_time = 0;
-  return ret;
-}
-
-/* When we try adding a measurement above the current interval range, we
-   need to "shift" the buckets sufficiently to cover the new range. */
-static void cws_shift_buckets(const window_stats *wstats,
-                              cws_interval_stats *is, int64_t when_ns) {
-  int i;
-  /* number of bucket time widths to "shift" */
-  int shift;
-  /* number of buckets to clear */
-  int nclear;
-  GPR_ASSERT(when_ns >= is->top);
-  /* number of bucket time widths to "shift" */
-  shift = ((when_ns - is->top) / is->width) + 1;
-  /* number of buckets to clear - limited by actual number of buckets */
-  nclear = GPR_MIN(shift, wstats->nbuckets);
-  for (i = 0; i < nclear; i++) {
-    int b = BUCKET_IDX(is, i, wstats);
-    is->buckets[b].count = 0;
-    cws_initialize_statistic(is->buckets[b].statistic, &wstats->stat_info);
-  }
-  /* adjust top/bottom times and current bottom bucket */
-  is->bottom_bucket = BUCKET_IDX(is, shift, wstats);
-  is->top += shift * is->width;
-  is->bottom += shift * is->width;
-}
-
-void census_window_stats_add(window_stats *wstats, const gpr_timespec when,
-                             const void *stat_value) {
-  int i;
-  int64_t when_ns = timespec_to_ns(when);
-  GPR_ASSERT(wstats->interval_stats != NULL);
-  for (i = 0; i < wstats->nintervals; i++) {
-    cws_interval_stats *is = wstats->interval_stats + i;
-    cws_bucket *bucket;
-    if (when_ns < is->bottom) { /* Below smallest time in interval: drop */
-      continue;
-    }
-    if (when_ns >= is->top) { /* above limit: shift buckets */
-      cws_shift_buckets(wstats, is, when_ns);
-    }
-    /* Add the stat. */
-    GPR_ASSERT(is->bottom <= when_ns && when_ns < is->top);
-    bucket = is->buckets +
-             BUCKET_IDX(is, (when_ns - is->bottom) / is->width, wstats);
-    bucket->count++;
-    wstats->stat_info.stat_add(bucket->statistic, stat_value);
-  }
-  if (when_ns > wstats->newest_time) {
-    wstats->newest_time = when_ns;
-  }
-}
-
-/* Add a specific bucket contents to an accumulating total. */
-static void cws_add_bucket_to_sum(cws_sum *sum, const cws_bucket *bucket,
-                                  const cws_stat_info *stat_info) {
-  sum->count += bucket->count;
-  stat_info->stat_add(sum->statistic, bucket->statistic);
-}
-
-/* Add a proportion to an accumulating sum. */
-static void cws_add_proportion_to_sum(double p, cws_sum *sum,
-                                      const cws_bucket *bucket,
-                                      const cws_stat_info *stat_info) {
-  sum->count += p * bucket->count;
-  stat_info->stat_add_proportion(p, sum->statistic, bucket->statistic);
-}
-
-void census_window_stats_get_sums(const window_stats *wstats,
-                                  const gpr_timespec when, cws_sum sums[]) {
-  int i;
-  int64_t when_ns = timespec_to_ns(when);
-  GPR_ASSERT(wstats->interval_stats != NULL);
-  for (i = 0; i < wstats->nintervals; i++) {
-    int when_bucket;
-    int new_bucket;
-    double last_proportion = 1.0;
-    double bottom_proportion;
-    cws_interval_stats *is = wstats->interval_stats + i;
-    cws_sum *sum = sums + i;
-    sum->count = 0;
-    cws_initialize_statistic(sum->statistic, &wstats->stat_info);
-    if (when_ns < is->bottom) {
-      continue;
-    }
-    if (when_ns >= is->top) {
-      cws_shift_buckets(wstats, is, when_ns);
-    }
-    /* Calculating the appropriate amount of which buckets to use can get
-       complicated. Essentially there are two cases:
-       1) if the "top" bucket (new_bucket, where the newest additions to the
-       stats recorded are entered) corresponds to 'when', then we need
-       to take a proportion of it - (if when < newest_time) or the full
-       thing. We also (possibly) need to take a corresponding
-       proportion of the bottom bucket.
-       2) Other cases, we just take a straight proportion.
-     */
-    when_bucket = (when_ns - is->bottom) / is->width;
-    new_bucket = (wstats->newest_time - is->bottom) / is->width;
-    if (new_bucket == when_bucket) {
-      int64_t bottom_bucket_time = is->bottom + when_bucket * is->width;
-      if (when_ns < wstats->newest_time) {
-        last_proportion = (double)(when_ns - bottom_bucket_time) /
-                          (double)(wstats->newest_time - bottom_bucket_time);
-        bottom_proportion =
-            (double)(is->width - (when_ns - bottom_bucket_time)) / is->width;
-      } else {
-        bottom_proportion =
-            (double)(is->width - (wstats->newest_time - bottom_bucket_time)) /
-            is->width;
-      }
-    } else {
-      last_proportion =
-          (double)(when_ns + 1 - is->bottom - when_bucket * is->width) /
-          is->width;
-      bottom_proportion = 1.0 - last_proportion;
-    }
-    cws_add_proportion_to_sum(last_proportion, sum,
-                              is->buckets + BUCKET_IDX(is, when_bucket, wstats),
-                              &wstats->stat_info);
-    if (when_bucket != 0) { /* last bucket isn't also bottom bucket */
-      int b;
-      /* Add all of "bottom" bucket if we are looking at a subset of the
-         full interval, or a proportion if we are adding full interval. */
-      cws_add_proportion_to_sum(
-          (when_bucket == wstats->nbuckets - 1 ? bottom_proportion : 1.0), sum,
-          is->buckets + is->bottom_bucket, &wstats->stat_info);
-      /* Add all the remaining buckets (everything but top and bottom). */
-      for (b = 1; b < when_bucket; b++) {
-        cws_add_bucket_to_sum(sum, is->buckets + BUCKET_IDX(is, b, wstats),
-                              &wstats->stat_info);
-      }
-    }
-  }
-}
-
-void census_window_stats_destroy(window_stats *wstats) {
-  int i;
-  GPR_ASSERT(wstats->interval_stats != NULL);
-  for (i = 0; i < wstats->nintervals; i++) {
-    int b;
-    for (b = 0; b < wstats->nbuckets; b++) {
-      gpr_free(wstats->interval_stats[i].buckets[b].statistic);
-    }
-    gpr_free(wstats->interval_stats[i].buckets);
-  }
-  gpr_free(wstats->interval_stats);
-  /* Ensure any use-after free triggers assert. */
-  wstats->interval_stats = NULL;
-  gpr_free(wstats);
-}
diff --git a/src/core/ext/census/window_stats.h b/src/core/ext/census/window_stats.h
deleted file mode 100644
index 2a1d6d0..0000000
--- a/src/core/ext/census/window_stats.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H
-#define GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H
-
-#include <grpc/support/time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Keep rolling sums of a user-defined statistic (containing a number of
-   measurements) over a a number of time intervals ("windows"). For example,
-   you can use a window_stats object to answer questions such as
-   "Approximately how many RPCs/s did I receive over the past minute, and
-   approximately how many bytes did I send out over that period?".
-
-   The type of data to record, and the time intervals to keep are specified
-   when creating the object via a call to census_window_stats_create().
-
-   A window's interval is divided into one or more "buckets"; the interval
-   must be divisible by the number of buckets. Internally, these buckets
-   control the granularity of window_stats' measurements. Increasing the
-   number of buckets lets the object respond more quickly to changes in the
-   overall rate of data added into the object, at the cost of additional
-   memory usage.
-
-   Here's some code which keeps one minute/hour measurements for two values
-   (latency in seconds and bytes transferred), with each interval divided into
-   4 buckets.
-
-    typedef struct my_stat {
-      double latency;
-      int bytes;
-    } my_stat;
-
-    void add_my_stat(void* base, const void* addme) {
-      my_stat* b = (my_stat*)base;
-      const my_stat* a = (const my_stat*)addme;
-      b->latency += a->latency;
-      b->bytes += a->bytes;
-    }
-
-    void add_proportion_my_stat(double p, void* base, const void* addme) {
-      (my_stat*)result->latency += p * (const my_stat*)base->latency;
-      (my_stat*)result->bytes += p * (const my_stat*)base->bytes;
-    }
-
-    #define kNumIntervals 2
-    #define kMinInterval 0
-    #define kHourInterval 1
-    #define kNumBuckets 4
-
-    const struct census_window_stats_stat_info kMyStatInfo
-        = { sizeof(my_stat), NULL, add_my_stat, add_proportion_my_stat };
-    gpr_timespec intervals[kNumIntervals] = {{60, 0}, {3600, 0}};
-    my_stat stat;
-    my_stat sums[kNumIntervals];
-    census_window_stats_sums result[kNumIntervals];
-    struct census_window_stats* stats
-        = census_window_stats_create(kNumIntervals, intervals, kNumBuckets,
-                                     &kMyStatInfo);
-    // Record a new event, taking 15.3ms, transferring 1784 bytes.
-    stat.latency = 0.153;
-    stat.bytes = 1784;
-    census_window_stats_add(stats, gpr_now(GPR_CLOCK_REALTIME), &stat);
-    // Get sums and print them out
-    result[kMinInterval].statistic = &sums[kMinInterval];
-    result[kHourInterval].statistic = &sums[kHourInterval];
-    census_window_stats_get_sums(stats, gpr_now(GPR_CLOCK_REALTIME), result);
-    printf("%d events/min, average time %gs, average bytes %g\n",
-           result[kMinInterval].count,
-           (my_stat*)result[kMinInterval].statistic->latency /
-             result[kMinInterval].count,
-           (my_stat*)result[kMinInterval].statistic->bytes /
-             result[kMinInterval].count
-          );
-    printf("%d events/hr, average time %gs, average bytes %g\n",
-           result[kHourInterval].count,
-           (my_stat*)result[kHourInterval].statistic->latency /
-             result[kHourInterval].count,
-           (my_stat*)result[kHourInterval].statistic->bytes /
-             result[kHourInterval].count
-          );
-*/
-
-/* Opaque structure for representing window_stats object */
-struct census_window_stats;
-
-/* Information provided by API user on the information they want to record */
-typedef struct census_window_stats_stat_info {
-  /* Number of bytes in user-defined object. */
-  size_t stat_size;
-  /* Function to initialize a user-defined statistics object. If this is set
-   * to NULL, then the object will be zero-initialized. */
-  void (*stat_initialize)(void *stat);
-  /* Function to add one user-defined statistics object ('addme') to 'base' */
-  void (*stat_add)(void *base, const void *addme);
-  /* As for previous function, but only add a proportion 'p'. This API will
-     currently only use 'p' values in the range [0,1], but other values are
-     possible in the future, and should be supported. */
-  void (*stat_add_proportion)(double p, void *base, const void *addme);
-} census_window_stats_stat_info;
-
-/* Create a new window_stats object. 'nintervals' is the number of
-   'intervals', and must be >=1. 'granularity' is the number of buckets, with
-   a larger number using more memory, but providing greater accuracy of
-   results. 'granularity should be > 2. We also require that each interval be
-   at least 10 * 'granularity' nanoseconds in size. 'stat_info' contains
-   information about the statistic to be gathered. Intervals greater than ~192
-   years will be treated as essentially infinite in size. This function will
-   GPR_ASSERT() if the object cannot be created or any of the parameters have
-   invalid values. This function is thread-safe. */
-struct census_window_stats *census_window_stats_create(
-    int nintervals, const gpr_timespec intervals[], int granularity,
-    const census_window_stats_stat_info *stat_info);
-
-/* Add a new measurement (in 'stat_value'), as of a given time ('when').
-   This function is thread-compatible. */
-void census_window_stats_add(struct census_window_stats *wstats,
-                             const gpr_timespec when, const void *stat_value);
-
-/* Structure used to record a single intervals sum for a given statistic */
-typedef struct census_window_stats_sum {
-  /* Total count of samples. Note that because some internal interpolation
-     is performed, the count of samples returned for each interval may not be an
-     integral value. */
-  double count;
-  /* Sum for statistic */
-  void *statistic;
-} census_window_stats_sums;
-
-/* Retrieve a set of all values stored in a window_stats object 'wstats'. The
-   number of 'sums' MUST be the same as the number 'nintervals' used in
-   census_window_stats_create(). This function is thread-compatible. */
-void census_window_stats_get_sums(const struct census_window_stats *wstats,
-                                  const gpr_timespec when,
-                                  struct census_window_stats_sum sums[]);
-
-/* Destroy a window_stats object. Once this function has been called, the
-   object will no longer be usable from any of the above functions (and
-   calling them will most likely result in a NULL-pointer dereference or
-   assertion failure). This function is thread-compatible. */
-void census_window_stats_destroy(struct census_window_stats *wstats);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H */
diff --git a/src/core/ext/filters/client_channel/backup_poller.cc b/src/core/ext/filters/client_channel/backup_poller.cc
new file mode 100644
index 0000000..c3795c3
--- /dev/null
+++ b/src/core/ext/filters/client_channel/backup_poller.cc
@@ -0,0 +1,165 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/filters/client_channel/backup_poller.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/completion_queue.h"
+
+#define DEFAULT_POLL_INTERVAL_MS 5000
+
+typedef struct backup_poller {
+  grpc_timer polling_timer;
+  grpc_closure run_poller_closure;
+  grpc_closure shutdown_closure;
+  gpr_mu* pollset_mu;
+  grpc_pollset* pollset;  // guarded by pollset_mu
+  bool shutting_down;     // guarded by pollset_mu
+  gpr_refcount refs;
+  gpr_refcount shutdown_refs;
+} backup_poller;
+
+static gpr_once g_once = GPR_ONCE_INIT;
+static gpr_mu g_poller_mu;
+static backup_poller* g_poller = NULL;  // guarded by g_poller_mu
+// g_poll_interval_ms is set only once at the first time
+// grpc_client_channel_start_backup_polling() is called, after that it is
+// treated as const.
+static int g_poll_interval_ms = DEFAULT_POLL_INTERVAL_MS;
+
+static void init_globals() {
+  gpr_mu_init(&g_poller_mu);
+  char* env = gpr_getenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS");
+  if (env != NULL) {
+    int poll_interval_ms = gpr_parse_nonnegative_int(env);
+    if (poll_interval_ms == -1) {
+      gpr_log(GPR_ERROR,
+              "Invalid GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS: %s, "
+              "default value %d will be used.",
+              env, g_poll_interval_ms);
+    } else {
+      g_poll_interval_ms = poll_interval_ms;
+    }
+  }
+  gpr_free(env);
+}
+
+static void backup_poller_shutdown_unref(grpc_exec_ctx* exec_ctx,
+                                         backup_poller* p) {
+  if (gpr_unref(&p->shutdown_refs)) {
+    grpc_pollset_destroy(exec_ctx, p->pollset);
+    gpr_free(p->pollset);
+    gpr_free(p);
+  }
+}
+
+static void done_poller(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  backup_poller_shutdown_unref(exec_ctx, (backup_poller*)arg);
+}
+
+static void g_poller_unref(grpc_exec_ctx* exec_ctx) {
+  if (gpr_unref(&g_poller->refs)) {
+    gpr_mu_lock(&g_poller_mu);
+    backup_poller* p = g_poller;
+    g_poller = NULL;
+    gpr_mu_unlock(&g_poller_mu);
+    gpr_mu_lock(p->pollset_mu);
+    p->shutting_down = true;
+    grpc_pollset_shutdown(exec_ctx, p->pollset,
+                          GRPC_CLOSURE_INIT(&p->shutdown_closure, done_poller,
+                                            p, grpc_schedule_on_exec_ctx));
+    gpr_mu_unlock(p->pollset_mu);
+    grpc_timer_cancel(exec_ctx, &p->polling_timer);
+  }
+}
+
+static void run_poller(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  backup_poller* p = (backup_poller*)arg;
+  if (error != GRPC_ERROR_NONE) {
+    if (error != GRPC_ERROR_CANCELLED) {
+      GRPC_LOG_IF_ERROR("run_poller", GRPC_ERROR_REF(error));
+    }
+    backup_poller_shutdown_unref(exec_ctx, p);
+    return;
+  }
+  gpr_mu_lock(p->pollset_mu);
+  if (p->shutting_down) {
+    gpr_mu_unlock(p->pollset_mu);
+    backup_poller_shutdown_unref(exec_ctx, p);
+    return;
+  }
+  grpc_error* err = grpc_pollset_work(exec_ctx, p->pollset, NULL,
+                                      grpc_exec_ctx_now(exec_ctx));
+  gpr_mu_unlock(p->pollset_mu);
+  GRPC_LOG_IF_ERROR("Run client channel backup poller", err);
+  grpc_timer_init(exec_ctx, &p->polling_timer,
+                  grpc_exec_ctx_now(exec_ctx) + g_poll_interval_ms,
+                  &p->run_poller_closure);
+}
+
+void grpc_client_channel_start_backup_polling(
+    grpc_exec_ctx* exec_ctx, grpc_pollset_set* interested_parties) {
+  gpr_once_init(&g_once, init_globals);
+  if (g_poll_interval_ms == 0) {
+    return;
+  }
+  gpr_mu_lock(&g_poller_mu);
+  if (g_poller == NULL) {
+    g_poller = (backup_poller*)gpr_zalloc(sizeof(backup_poller));
+    g_poller->pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+    g_poller->shutting_down = false;
+    grpc_pollset_init(g_poller->pollset, &g_poller->pollset_mu);
+    gpr_ref_init(&g_poller->refs, 0);
+    // one for timer cancellation, one for pollset shutdown
+    gpr_ref_init(&g_poller->shutdown_refs, 2);
+    GRPC_CLOSURE_INIT(&g_poller->run_poller_closure, run_poller, g_poller,
+                      grpc_schedule_on_exec_ctx);
+    grpc_timer_init(exec_ctx, &g_poller->polling_timer,
+                    grpc_exec_ctx_now(exec_ctx) + g_poll_interval_ms,
+                    &g_poller->run_poller_closure);
+  }
+
+  gpr_ref(&g_poller->refs);
+  /* Get a reference to g_poller->pollset before releasing g_poller_mu to make
+   * TSAN happy. Otherwise, reading from g_poller (i.e g_poller->pollset) after
+   * releasing the lock and setting g_poller to NULL in g_poller_unref() is
+   * being flagged as a data-race by TSAN */
+  grpc_pollset* pollset = g_poller->pollset;
+  gpr_mu_unlock(&g_poller_mu);
+
+  grpc_pollset_set_add_pollset(exec_ctx, interested_parties, pollset);
+}
+
+void grpc_client_channel_stop_backup_polling(
+    grpc_exec_ctx* exec_ctx, grpc_pollset_set* interested_parties) {
+  if (g_poll_interval_ms == 0) {
+    return;
+  }
+  grpc_pollset_set_del_pollset(exec_ctx, interested_parties, g_poller->pollset);
+  g_poller_unref(exec_ctx);
+}
diff --git a/src/core/ext/filters/client_channel/backup_poller.h b/src/core/ext/filters/client_channel/backup_poller.h
new file mode 100644
index 0000000..e993d50
--- /dev/null
+++ b/src/core/ext/filters/client_channel/backup_poller.h
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H
+
+#include <grpc/grpc.h>
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+
+/* Start polling \a interested_parties periodically in the timer thread  */
+void grpc_client_channel_start_backup_polling(
+    grpc_exec_ctx* exec_ctx, grpc_pollset_set* interested_parties);
+
+/* Stop polling \a interested_parties */
+void grpc_client_channel_stop_backup_polling(
+    grpc_exec_ctx* exec_ctx, grpc_pollset_set* interested_parties);
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H */
diff --git a/src/core/ext/filters/client_channel/channel_connectivity.cc b/src/core/ext/filters/client_channel/channel_connectivity.cc
index d5c8f12..71f86d6 100644
--- a/src/core/ext/filters/client_channel/channel_connectivity.cc
+++ b/src/core/ext/filters/client_channel/channel_connectivity.cc
@@ -29,9 +29,9 @@
 #include "src/core/lib/surface/completion_queue.h"
 
 grpc_connectivity_state grpc_channel_check_connectivity_state(
-    grpc_channel *channel, int try_to_connect) {
+    grpc_channel* channel, int try_to_connect) {
   /* forward through to the underlying client channel */
-  grpc_channel_element *client_channel_elem =
+  grpc_channel_element* client_channel_elem =
       grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_connectivity_state state;
@@ -66,15 +66,15 @@
   grpc_closure watcher_timer_init;
   grpc_timer alarm;
   grpc_connectivity_state state;
-  grpc_completion_queue *cq;
+  grpc_completion_queue* cq;
   grpc_cq_completion completion_storage;
-  grpc_channel *channel;
-  grpc_error *error;
-  void *tag;
+  grpc_channel* channel;
+  grpc_error* error;
+  void* tag;
 } state_watcher;
 
-static void delete_state_watcher(grpc_exec_ctx *exec_ctx, state_watcher *w) {
-  grpc_channel_element *client_channel_elem = grpc_channel_stack_last_element(
+static void delete_state_watcher(grpc_exec_ctx* exec_ctx, state_watcher* w) {
+  grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(
       grpc_channel_get_channel_stack(w->channel));
   if (client_channel_elem->filter == &grpc_client_channel_filter) {
     GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, w->channel,
@@ -86,10 +86,10 @@
   gpr_free(w);
 }
 
-static void finished_completion(grpc_exec_ctx *exec_ctx, void *pw,
-                                grpc_cq_completion *ignored) {
+static void finished_completion(grpc_exec_ctx* exec_ctx, void* pw,
+                                grpc_cq_completion* ignored) {
   bool should_delete = false;
-  state_watcher *w = (state_watcher *)pw;
+  state_watcher* w = (state_watcher*)pw;
   gpr_mu_lock(&w->mu);
   switch (w->phase) {
     case WAITING:
@@ -106,12 +106,12 @@
   }
 }
 
-static void partly_done(grpc_exec_ctx *exec_ctx, state_watcher *w,
-                        bool due_to_completion, grpc_error *error) {
+static void partly_done(grpc_exec_ctx* exec_ctx, state_watcher* w,
+                        bool due_to_completion, grpc_error* error) {
   if (due_to_completion) {
     grpc_timer_cancel(exec_ctx, &w->alarm);
   } else {
-    grpc_channel_element *client_channel_elem = grpc_channel_stack_last_element(
+    grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(
         grpc_channel_get_channel_stack(w->channel));
     grpc_client_channel_watch_connectivity_state(
         exec_ctx, client_channel_elem,
@@ -161,31 +161,31 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void watch_complete(grpc_exec_ctx *exec_ctx, void *pw,
-                           grpc_error *error) {
-  partly_done(exec_ctx, (state_watcher *)pw, true, GRPC_ERROR_REF(error));
+static void watch_complete(grpc_exec_ctx* exec_ctx, void* pw,
+                           grpc_error* error) {
+  partly_done(exec_ctx, (state_watcher*)pw, true, GRPC_ERROR_REF(error));
 }
 
-static void timeout_complete(grpc_exec_ctx *exec_ctx, void *pw,
-                             grpc_error *error) {
-  partly_done(exec_ctx, (state_watcher *)pw, false, GRPC_ERROR_REF(error));
+static void timeout_complete(grpc_exec_ctx* exec_ctx, void* pw,
+                             grpc_error* error) {
+  partly_done(exec_ctx, (state_watcher*)pw, false, GRPC_ERROR_REF(error));
 }
 
-int grpc_channel_num_external_connectivity_watchers(grpc_channel *channel) {
-  grpc_channel_element *client_channel_elem =
+int grpc_channel_num_external_connectivity_watchers(grpc_channel* channel) {
+  grpc_channel_element* client_channel_elem =
       grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
   return grpc_client_channel_num_external_connectivity_watchers(
       client_channel_elem);
 }
 
 typedef struct watcher_timer_init_arg {
-  state_watcher *w;
+  state_watcher* w;
   gpr_timespec deadline;
 } watcher_timer_init_arg;
 
-static void watcher_timer_init(grpc_exec_ctx *exec_ctx, void *arg,
-                               grpc_error *error_ignored) {
-  watcher_timer_init_arg *wa = (watcher_timer_init_arg *)arg;
+static void watcher_timer_init(grpc_exec_ctx* exec_ctx, void* arg,
+                               grpc_error* error_ignored) {
+  watcher_timer_init_arg* wa = (watcher_timer_init_arg*)arg;
 
   grpc_timer_init(exec_ctx, &wa->w->alarm,
                   grpc_timespec_to_millis_round_up(wa->deadline),
@@ -193,19 +193,19 @@
   gpr_free(wa);
 }
 
-int grpc_channel_support_connectivity_watcher(grpc_channel *channel) {
-  grpc_channel_element *client_channel_elem =
+int grpc_channel_support_connectivity_watcher(grpc_channel* channel) {
+  grpc_channel_element* client_channel_elem =
       grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
   return client_channel_elem->filter != &grpc_client_channel_filter ? 0 : 1;
 }
 
 void grpc_channel_watch_connectivity_state(
-    grpc_channel *channel, grpc_connectivity_state last_observed_state,
-    gpr_timespec deadline, grpc_completion_queue *cq, void *tag) {
-  grpc_channel_element *client_channel_elem =
+    grpc_channel* channel, grpc_connectivity_state last_observed_state,
+    gpr_timespec deadline, grpc_completion_queue* cq, void* tag) {
+  grpc_channel_element* client_channel_elem =
       grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  state_watcher *w = (state_watcher *)gpr_malloc(sizeof(*w));
+  state_watcher* w = (state_watcher*)gpr_malloc(sizeof(*w));
 
   GRPC_API_TRACE(
       "grpc_channel_watch_connectivity_state("
@@ -213,8 +213,9 @@
       "deadline=gpr_timespec { tv_sec: %" PRId64
       ", tv_nsec: %d, clock_type: %d }, "
       "cq=%p, tag=%p)",
-      7, (channel, (int)last_observed_state, deadline.tv_sec, deadline.tv_nsec,
-          (int)deadline.clock_type, cq, tag));
+      7,
+      (channel, (int)last_observed_state, deadline.tv_sec, deadline.tv_nsec,
+       (int)deadline.clock_type, cq, tag));
 
   GPR_ASSERT(grpc_cq_begin_op(cq, tag));
 
@@ -230,8 +231,8 @@
   w->channel = channel;
   w->error = NULL;
 
-  watcher_timer_init_arg *wa =
-      (watcher_timer_init_arg *)gpr_malloc(sizeof(watcher_timer_init_arg));
+  watcher_timer_init_arg* wa =
+      (watcher_timer_init_arg*)gpr_malloc(sizeof(watcher_timer_init_arg));
   wa->w = w;
   wa->deadline = deadline;
   GRPC_CLOSURE_INIT(&w->watcher_timer_init, watcher_timer_init, wa,
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc
index ba2d8c9..a493612 100644
--- a/src/core/ext/filters/client_channel/client_channel.cc
+++ b/src/core/ext/filters/client_channel/client_channel.cc
@@ -31,6 +31,7 @@
 #include <grpc/support/sync.h>
 #include <grpc/support/useful.h>
 
+#include "src/core/ext/filters/client_channel/backup_poller.h"
 #include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
 #include "src/core/ext/filters/client_channel/lb_policy_registry.h"
 #include "src/core/ext/filters/client_channel/proxy_mapper_registry.h"
@@ -74,24 +75,29 @@
   wait_for_ready_value wait_for_ready;
 } method_parameters;
 
-static method_parameters *method_parameters_ref(
-    method_parameters *method_params) {
+static method_parameters* method_parameters_ref(
+    method_parameters* method_params) {
   gpr_ref(&method_params->refs);
   return method_params;
 }
 
-static void method_parameters_unref(method_parameters *method_params) {
+static void method_parameters_unref(method_parameters* method_params) {
   if (gpr_unref(&method_params->refs)) {
     gpr_free(method_params);
   }
 }
 
-static void method_parameters_free(grpc_exec_ctx *exec_ctx, void *value) {
-  method_parameters_unref((method_parameters *)value);
+// Wrappers to pass to grpc_service_config_create_method_config_table().
+static void* method_parameters_ref_wrapper(void* value) {
+  return method_parameters_ref((method_parameters*)value);
+}
+static void method_parameters_unref_wrapper(grpc_exec_ctx* exec_ctx,
+                                            void* value) {
+  method_parameters_unref((method_parameters*)value);
 }
 
-static bool parse_wait_for_ready(grpc_json *field,
-                                 wait_for_ready_value *wait_for_ready) {
+static bool parse_wait_for_ready(grpc_json* field,
+                                 wait_for_ready_value* wait_for_ready) {
   if (field->type != GRPC_JSON_TRUE && field->type != GRPC_JSON_FALSE) {
     return false;
   }
@@ -100,13 +106,13 @@
   return true;
 }
 
-static bool parse_timeout(grpc_json *field, grpc_millis *timeout) {
+static bool parse_timeout(grpc_json* field, grpc_millis* timeout) {
   if (field->type != GRPC_JSON_STRING) return false;
   size_t len = strlen(field->value);
   if (field->value[len - 1] != 's') return false;
-  char *buf = gpr_strdup(field->value);
+  char* buf = gpr_strdup(field->value);
   buf[len - 1] = '\0';  // Remove trailing 's'.
-  char *decimal_point = strchr(buf, '.');
+  char* decimal_point = strchr(buf, '.');
   int nanos = 0;
   if (decimal_point != NULL) {
     *decimal_point = '\0';
@@ -115,34 +121,26 @@
       gpr_free(buf);
       return false;
     }
-    // There should always be exactly 3, 6, or 9 fractional digits.
-    int multiplier = 1;
-    switch (strlen(decimal_point + 1)) {
-      case 9:
-        break;
-      case 6:
-        multiplier *= 1000;
-        break;
-      case 3:
-        multiplier *= 1000000;
-        break;
-      default:  // Unsupported number of digits.
-        gpr_free(buf);
-        return false;
+    int num_digits = (int)strlen(decimal_point + 1);
+    if (num_digits > 9) {  // We don't accept greater precision than nanos.
+      gpr_free(buf);
+      return false;
     }
-    nanos *= multiplier;
+    for (int i = 0; i < (9 - num_digits); ++i) {
+      nanos *= 10;
+    }
   }
-  int seconds = gpr_parse_nonnegative_int(buf);
+  int seconds = decimal_point == buf ? 0 : gpr_parse_nonnegative_int(buf);
   gpr_free(buf);
   if (seconds == -1) return false;
   *timeout = seconds * GPR_MS_PER_SEC + nanos / GPR_NS_PER_MS;
   return true;
 }
 
-static void *method_parameters_create_from_json(const grpc_json *json) {
+static void* method_parameters_create_from_json(const grpc_json* json) {
   wait_for_ready_value wait_for_ready = WAIT_FOR_READY_UNSET;
   grpc_millis timeout = 0;
-  for (grpc_json *field = json->child; field != NULL; field = field->next) {
+  for (grpc_json* field = json->child; field != NULL; field = field->next) {
     if (field->key == NULL) continue;
     if (strcmp(field->key, "waitForReady") == 0) {
       if (wait_for_ready != WAIT_FOR_READY_UNSET) return NULL;  // Duplicate.
@@ -152,8 +150,8 @@
       if (!parse_timeout(field, &timeout)) return NULL;
     }
   }
-  method_parameters *value =
-      (method_parameters *)gpr_malloc(sizeof(method_parameters));
+  method_parameters* value =
+      (method_parameters*)gpr_malloc(sizeof(method_parameters));
   gpr_ref_init(&value->refs, 1);
   value->timeout = timeout;
   value->wait_for_ready = wait_for_ready;
@@ -168,24 +166,24 @@
 
 typedef struct client_channel_channel_data {
   /** resolver for this channel */
-  grpc_resolver *resolver;
+  grpc_resolver* resolver;
   /** have we started resolving this channel */
   bool started_resolving;
   /** is deadline checking enabled? */
   bool deadline_checking_enabled;
   /** client channel factory */
-  grpc_client_channel_factory *client_channel_factory;
+  grpc_client_channel_factory* client_channel_factory;
 
   /** combiner protecting all variables below in this data structure */
-  grpc_combiner *combiner;
+  grpc_combiner* combiner;
   /** currently active load balancer */
-  grpc_lb_policy *lb_policy;
+  grpc_lb_policy* lb_policy;
   /** retry throttle data */
-  grpc_server_retry_throttle_data *retry_throttle_data;
+  grpc_server_retry_throttle_data* retry_throttle_data;
   /** maps method names to method_parameters structs */
-  grpc_slice_hash_table *method_params_table;
+  grpc_slice_hash_table* method_params_table;
   /** incoming resolver result - set by resolver.next() */
-  grpc_channel_args *resolver_result;
+  grpc_channel_args* resolver_result;
   /** a list of closures that are all waiting for resolver result to come in */
   grpc_closure_list waiting_for_resolver_result_closures;
   /** resolver callback */
@@ -195,42 +193,42 @@
   /** when an lb_policy arrives, should we try to exit idle */
   bool exit_idle_when_lb_policy_arrives;
   /** owning stack */
-  grpc_channel_stack *owning_stack;
+  grpc_channel_stack* owning_stack;
   /** interested parties (owned) */
-  grpc_pollset_set *interested_parties;
+  grpc_pollset_set* interested_parties;
 
   /* external_connectivity_watcher_list head is guarded by its own mutex, since
    * counts need to be grabbed immediately without polling on a cq */
   gpr_mu external_connectivity_watcher_list_mu;
-  struct external_connectivity_watcher *external_connectivity_watcher_list_head;
+  struct external_connectivity_watcher* external_connectivity_watcher_list_head;
 
   /* the following properties are guarded by a mutex since API's require them
      to be instantaneously available */
   gpr_mu info_mu;
-  char *info_lb_policy_name;
+  char* info_lb_policy_name;
   /** service config in JSON form */
-  char *info_service_config_json;
+  char* info_service_config_json;
 } channel_data;
 
 /** We create one watcher for each new lb_policy that is returned from a
     resolver, to watch for state changes from the lb_policy. When a state
     change is seen, we update the channel, and create a new watcher. */
 typedef struct {
-  channel_data *chand;
+  channel_data* chand;
   grpc_closure on_changed;
   grpc_connectivity_state state;
-  grpc_lb_policy *lb_policy;
+  grpc_lb_policy* lb_policy;
 } lb_policy_connectivity_watcher;
 
-static void watch_lb_policy_locked(grpc_exec_ctx *exec_ctx, channel_data *chand,
-                                   grpc_lb_policy *lb_policy,
+static void watch_lb_policy_locked(grpc_exec_ctx* exec_ctx, channel_data* chand,
+                                   grpc_lb_policy* lb_policy,
                                    grpc_connectivity_state current_state);
 
-static void set_channel_connectivity_state_locked(grpc_exec_ctx *exec_ctx,
-                                                  channel_data *chand,
+static void set_channel_connectivity_state_locked(grpc_exec_ctx* exec_ctx,
+                                                  channel_data* chand,
                                                   grpc_connectivity_state state,
-                                                  grpc_error *error,
-                                                  const char *reason) {
+                                                  grpc_error* error,
+                                                  const char* reason) {
   /* TODO: Improve failure handling:
    * - Make it possible for policies to return GRPC_CHANNEL_TRANSIENT_FAILURE.
    * - Hand over pending picks from old policies during the switch that happens
@@ -257,9 +255,9 @@
                               reason);
 }
 
-static void on_lb_policy_state_changed_locked(grpc_exec_ctx *exec_ctx,
-                                              void *arg, grpc_error *error) {
-  lb_policy_connectivity_watcher *w = (lb_policy_connectivity_watcher *)arg;
+static void on_lb_policy_state_changed_locked(grpc_exec_ctx* exec_ctx,
+                                              void* arg, grpc_error* error) {
+  lb_policy_connectivity_watcher* w = (lb_policy_connectivity_watcher*)arg;
   grpc_connectivity_state publish_state = w->state;
   /* check if the notification is for the latest policy */
   if (w->lb_policy == w->chand->lb_policy) {
@@ -283,11 +281,11 @@
   gpr_free(w);
 }
 
-static void watch_lb_policy_locked(grpc_exec_ctx *exec_ctx, channel_data *chand,
-                                   grpc_lb_policy *lb_policy,
+static void watch_lb_policy_locked(grpc_exec_ctx* exec_ctx, channel_data* chand,
+                                   grpc_lb_policy* lb_policy,
                                    grpc_connectivity_state current_state) {
-  lb_policy_connectivity_watcher *w =
-      (lb_policy_connectivity_watcher *)gpr_malloc(sizeof(*w));
+  lb_policy_connectivity_watcher* w =
+      (lb_policy_connectivity_watcher*)gpr_malloc(sizeof(*w));
   GRPC_CHANNEL_STACK_REF(chand->owning_stack, "watch_lb_policy");
   w->chand = chand;
   GRPC_CLOSURE_INIT(&w->on_changed, on_lb_policy_state_changed_locked, w,
@@ -298,8 +296,8 @@
                                                &w->on_changed);
 }
 
-static void start_resolving_locked(grpc_exec_ctx *exec_ctx,
-                                   channel_data *chand) {
+static void start_resolving_locked(grpc_exec_ctx* exec_ctx,
+                                   channel_data* chand) {
   if (grpc_client_channel_trace.enabled()) {
     gpr_log(GPR_DEBUG, "chand=%p: starting name resolution", chand);
   }
@@ -311,19 +309,19 @@
 }
 
 typedef struct {
-  char *server_name;
-  grpc_server_retry_throttle_data *retry_throttle_data;
+  char* server_name;
+  grpc_server_retry_throttle_data* retry_throttle_data;
 } service_config_parsing_state;
 
-static void parse_retry_throttle_params(const grpc_json *field, void *arg) {
-  service_config_parsing_state *parsing_state =
-      (service_config_parsing_state *)arg;
+static void parse_retry_throttle_params(const grpc_json* field, void* arg) {
+  service_config_parsing_state* parsing_state =
+      (service_config_parsing_state*)arg;
   if (strcmp(field->key, "retryThrottling") == 0) {
     if (parsing_state->retry_throttle_data != NULL) return;  // Duplicate.
     if (field->type != GRPC_JSON_OBJECT) return;
     int max_milli_tokens = 0;
     int milli_token_ratio = 0;
-    for (grpc_json *sub_field = field->child; sub_field != NULL;
+    for (grpc_json* sub_field = field->child; sub_field != NULL;
          sub_field = sub_field->next) {
       if (sub_field->key == NULL) return;
       if (strcmp(sub_field->key, "maxTokens") == 0) {
@@ -339,7 +337,7 @@
         size_t whole_len = strlen(sub_field->value);
         uint32_t multiplier = 1;
         uint32_t decimal_value = 0;
-        const char *decimal_point = strchr(sub_field->value, '.');
+        const char* decimal_point = strchr(sub_field->value, '.');
         if (decimal_point != NULL) {
           whole_len = (size_t)(decimal_point - sub_field->value);
           multiplier = 1000;
@@ -370,25 +368,25 @@
   }
 }
 
-static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx,
-                                              void *arg, grpc_error *error) {
-  channel_data *chand = (channel_data *)arg;
+static void on_resolver_result_changed_locked(grpc_exec_ctx* exec_ctx,
+                                              void* arg, grpc_error* error) {
+  channel_data* chand = (channel_data*)arg;
   if (grpc_client_channel_trace.enabled()) {
     gpr_log(GPR_DEBUG, "chand=%p: got resolver result: error=%s", chand,
             grpc_error_string(error));
   }
   // Extract the following fields from the resolver result, if non-NULL.
   bool lb_policy_updated = false;
-  char *lb_policy_name_dup = NULL;
+  char* lb_policy_name_dup = NULL;
   bool lb_policy_name_changed = false;
-  grpc_lb_policy *new_lb_policy = NULL;
-  char *service_config_json = NULL;
-  grpc_server_retry_throttle_data *retry_throttle_data = NULL;
-  grpc_slice_hash_table *method_params_table = NULL;
+  grpc_lb_policy* new_lb_policy = NULL;
+  char* service_config_json = NULL;
+  grpc_server_retry_throttle_data* retry_throttle_data = NULL;
+  grpc_slice_hash_table* method_params_table = NULL;
   if (chand->resolver_result != NULL) {
     // Find LB policy name.
-    const char *lb_policy_name = NULL;
-    const grpc_arg *channel_arg =
+    const char* lb_policy_name = NULL;
+    const grpc_arg* channel_arg =
         grpc_channel_args_find(chand->resolver_result, GRPC_ARG_LB_POLICY_NAME);
     if (channel_arg != NULL) {
       GPR_ASSERT(channel_arg->type == GRPC_ARG_STRING);
@@ -399,8 +397,8 @@
     channel_arg =
         grpc_channel_args_find(chand->resolver_result, GRPC_ARG_LB_ADDRESSES);
     if (channel_arg != NULL && channel_arg->type == GRPC_ARG_POINTER) {
-      grpc_lb_addresses *addresses =
-          (grpc_lb_addresses *)channel_arg->value.pointer.p;
+      grpc_lb_addresses* addresses =
+          (grpc_lb_addresses*)channel_arg->value.pointer.p;
       bool found_balancer_address = false;
       for (size_t i = 0; i < addresses->num_addresses; ++i) {
         if (addresses->addresses[i].is_balancer) {
@@ -451,14 +449,14 @@
     if (channel_arg != NULL) {
       GPR_ASSERT(channel_arg->type == GRPC_ARG_STRING);
       service_config_json = gpr_strdup(channel_arg->value.string);
-      grpc_service_config *service_config =
+      grpc_service_config* service_config =
           grpc_service_config_create(service_config_json);
       if (service_config != NULL) {
         channel_arg =
             grpc_channel_args_find(chand->resolver_result, GRPC_ARG_SERVER_URI);
         GPR_ASSERT(channel_arg != NULL);
         GPR_ASSERT(channel_arg->type == GRPC_ARG_STRING);
-        grpc_uri *uri =
+        grpc_uri* uri =
             grpc_uri_parse(exec_ctx, channel_arg->value.string, true);
         GPR_ASSERT(uri->path[0] != '\0');
         service_config_parsing_state parsing_state;
@@ -471,7 +469,7 @@
         retry_throttle_data = parsing_state.retry_throttle_data;
         method_params_table = grpc_service_config_create_method_config_table(
             exec_ctx, service_config, method_parameters_create_from_json,
-            method_parameters_free);
+            method_parameters_ref_wrapper, method_parameters_unref_wrapper);
         grpc_service_config_destroy(service_config);
       }
     }
@@ -561,7 +559,7 @@
                             &chand->waiting_for_resolver_result_closures);
   } else {  // Not shutting down.
     grpc_connectivity_state state = GRPC_CHANNEL_TRANSIENT_FAILURE;
-    grpc_error *state_error =
+    grpc_error* state_error =
         GRPC_ERROR_CREATE_FROM_STATIC_STRING("No load balancing policy");
     if (new_lb_policy != NULL) {
       if (grpc_client_channel_trace.enabled()) {
@@ -593,12 +591,12 @@
   }
 }
 
-static void start_transport_op_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                      grpc_error *error_ignored) {
-  grpc_transport_op *op = (grpc_transport_op *)arg;
-  grpc_channel_element *elem =
-      (grpc_channel_element *)op->handler_private.extra_arg;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void start_transport_op_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                      grpc_error* error_ignored) {
+  grpc_transport_op* op = (grpc_transport_op*)arg;
+  grpc_channel_element* elem =
+      (grpc_channel_element*)op->handler_private.extra_arg;
+  channel_data* chand = (channel_data*)elem->channel_data;
 
   if (op->on_connectivity_state_change != NULL) {
     grpc_connectivity_state_notify_on_state_change(
@@ -649,10 +647,10 @@
   GRPC_CLOSURE_SCHED(exec_ctx, op->on_consumed, GRPC_ERROR_NONE);
 }
 
-static void cc_start_transport_op(grpc_exec_ctx *exec_ctx,
-                                  grpc_channel_element *elem,
-                                  grpc_transport_op *op) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void cc_start_transport_op(grpc_exec_ctx* exec_ctx,
+                                  grpc_channel_element* elem,
+                                  grpc_transport_op* op) {
+  channel_data* chand = (channel_data*)elem->channel_data;
 
   GPR_ASSERT(op->set_accept_stream == false);
   if (op->bind_pollset != NULL) {
@@ -669,10 +667,10 @@
       GRPC_ERROR_NONE);
 }
 
-static void cc_get_channel_info(grpc_exec_ctx *exec_ctx,
-                                grpc_channel_element *elem,
-                                const grpc_channel_info *info) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void cc_get_channel_info(grpc_exec_ctx* exec_ctx,
+                                grpc_channel_element* elem,
+                                const grpc_channel_info* info) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   gpr_mu_lock(&chand->info_mu);
   if (info->lb_policy_name != NULL) {
     *info->lb_policy_name = chand->info_lb_policy_name == NULL
@@ -689,10 +687,10 @@
 }
 
 /* Constructor for channel_data */
-static grpc_error *cc_init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                        grpc_channel_element *elem,
-                                        grpc_channel_element_args *args) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+static grpc_error* cc_init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                        grpc_channel_element* elem,
+                                        grpc_channel_element_args* args) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   GPR_ASSERT(args->is_last);
   GPR_ASSERT(elem->filter == &grpc_client_channel_filter);
   // Initialize data members.
@@ -711,8 +709,9 @@
   chand->interested_parties = grpc_pollset_set_create();
   grpc_connectivity_state_init(&chand->state_tracker, GRPC_CHANNEL_IDLE,
                                "client_channel");
+  grpc_client_channel_start_backup_polling(exec_ctx, chand->interested_parties);
   // Record client channel factory.
-  const grpc_arg *arg = grpc_channel_args_find(args->channel_args,
+  const grpc_arg* arg = grpc_channel_args_find(args->channel_args,
                                                GRPC_ARG_CLIENT_CHANNEL_FACTORY);
   if (arg == NULL) {
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -723,9 +722,9 @@
         "client channel factory arg must be a pointer");
   }
   grpc_client_channel_factory_ref(
-      (grpc_client_channel_factory *)arg->value.pointer.p);
+      (grpc_client_channel_factory*)arg->value.pointer.p);
   chand->client_channel_factory =
-      (grpc_client_channel_factory *)arg->value.pointer.p;
+      (grpc_client_channel_factory*)arg->value.pointer.p;
   // Get server name to resolve, using proxy mapper if needed.
   arg = grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVER_URI);
   if (arg == NULL) {
@@ -736,8 +735,8 @@
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
         "server uri arg must be a string");
   }
-  char *proxy_name = NULL;
-  grpc_channel_args *new_args = NULL;
+  char* proxy_name = NULL;
+  grpc_channel_args* new_args = NULL;
   grpc_proxy_mappers_map_name(exec_ctx, arg->value.string, args->channel_args,
                               &proxy_name, &new_args);
   // Instantiate resolver.
@@ -755,21 +754,22 @@
   return GRPC_ERROR_NONE;
 }
 
-static void shutdown_resolver_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                     grpc_error *error) {
-  grpc_resolver *resolver = (grpc_resolver *)arg;
+static void shutdown_resolver_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                     grpc_error* error) {
+  grpc_resolver* resolver = (grpc_resolver*)arg;
   grpc_resolver_shutdown_locked(exec_ctx, resolver);
   GRPC_RESOLVER_UNREF(exec_ctx, resolver, "channel");
 }
 
 /* Destructor for channel_data */
-static void cc_destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                    grpc_channel_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void cc_destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                    grpc_channel_element* elem) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   if (chand->resolver != NULL) {
     GRPC_CLOSURE_SCHED(
-        exec_ctx, GRPC_CLOSURE_CREATE(shutdown_resolver_locked, chand->resolver,
-                                      grpc_combiner_scheduler(chand->combiner)),
+        exec_ctx,
+        GRPC_CLOSURE_CREATE(shutdown_resolver_locked, chand->resolver,
+                            grpc_combiner_scheduler(chand->combiner)),
         GRPC_ERROR_NONE);
   }
   if (chand->client_channel_factory != NULL) {
@@ -789,6 +789,7 @@
   if (chand->method_params_table != NULL) {
     grpc_slice_hash_table_unref(exec_ctx, chand->method_params_table);
   }
+  grpc_client_channel_stop_backup_polling(exec_ctx, chand->interested_parties);
   grpc_connectivity_state_destroy(exec_ctx, &chand->state_tracker);
   grpc_pollset_set_destroy(exec_ctx, chand->interested_parties);
   GRPC_COMBINER_UNREF(exec_ctx, chand->combiner, "client_channel");
@@ -828,45 +829,45 @@
   grpc_slice path;  // Request path.
   gpr_timespec call_start_time;
   grpc_millis deadline;
-  gpr_arena *arena;
-  grpc_call_stack *owning_call;
-  grpc_call_combiner *call_combiner;
+  gpr_arena* arena;
+  grpc_call_stack* owning_call;
+  grpc_call_combiner* call_combiner;
 
-  grpc_server_retry_throttle_data *retry_throttle_data;
-  method_parameters *method_params;
+  grpc_server_retry_throttle_data* retry_throttle_data;
+  method_parameters* method_params;
 
-  grpc_subchannel_call *subchannel_call;
-  grpc_error *error;
+  grpc_subchannel_call* subchannel_call;
+  grpc_error* error;
 
-  grpc_lb_policy *lb_policy;  // Holds ref while LB pick is pending.
+  grpc_lb_policy* lb_policy;  // Holds ref while LB pick is pending.
   grpc_closure lb_pick_closure;
   grpc_closure lb_pick_cancel_closure;
 
-  grpc_connected_subchannel *connected_subchannel;
+  grpc_connected_subchannel* connected_subchannel;
   grpc_call_context_element subchannel_call_context[GRPC_CONTEXT_COUNT];
-  grpc_polling_entity *pollent;
+  grpc_polling_entity* pollent;
 
-  grpc_transport_stream_op_batch *waiting_for_pick_batches[MAX_WAITING_BATCHES];
+  grpc_transport_stream_op_batch* waiting_for_pick_batches[MAX_WAITING_BATCHES];
   size_t waiting_for_pick_batches_count;
   grpc_closure handle_pending_batch_in_call_combiner[MAX_WAITING_BATCHES];
 
-  grpc_transport_stream_op_batch *initial_metadata_batch;
+  grpc_transport_stream_op_batch* initial_metadata_batch;
 
   grpc_linked_mdelem lb_token_mdelem;
 
   grpc_closure on_complete;
-  grpc_closure *original_on_complete;
+  grpc_closure* original_on_complete;
 } call_data;
 
-grpc_subchannel_call *grpc_client_channel_get_subchannel_call(
-    grpc_call_element *elem) {
-  call_data *calld = (call_data *)elem->call_data;
+grpc_subchannel_call* grpc_client_channel_get_subchannel_call(
+    grpc_call_element* elem) {
+  call_data* calld = (call_data*)elem->call_data;
   return calld->subchannel_call;
 }
 
 // This is called via the call combiner, so access to calld is synchronized.
 static void waiting_for_pick_batches_add(
-    call_data *calld, grpc_transport_stream_op_batch *batch) {
+    call_data* calld, grpc_transport_stream_op_batch* batch) {
   if (batch->send_initial_metadata) {
     GPR_ASSERT(calld->initial_metadata_batch == NULL);
     calld->initial_metadata_batch = batch;
@@ -878,9 +879,9 @@
 }
 
 // This is called via the call combiner, so access to calld is synchronized.
-static void fail_pending_batch_in_call_combiner(grpc_exec_ctx *exec_ctx,
-                                                void *arg, grpc_error *error) {
-  call_data *calld = (call_data *)arg;
+static void fail_pending_batch_in_call_combiner(grpc_exec_ctx* exec_ctx,
+                                                void* arg, grpc_error* error) {
+  call_data* calld = (call_data*)arg;
   if (calld->waiting_for_pick_batches_count > 0) {
     --calld->waiting_for_pick_batches_count;
     grpc_transport_stream_op_batch_finish_with_failure(
@@ -891,13 +892,13 @@
 }
 
 // This is called via the call combiner, so access to calld is synchronized.
-static void waiting_for_pick_batches_fail(grpc_exec_ctx *exec_ctx,
-                                          grpc_call_element *elem,
-                                          grpc_error *error) {
-  call_data *calld = (call_data *)elem->call_data;
+static void waiting_for_pick_batches_fail(grpc_exec_ctx* exec_ctx,
+                                          grpc_call_element* elem,
+                                          grpc_error* error) {
+  call_data* calld = (call_data*)elem->call_data;
   if (grpc_client_channel_trace.enabled()) {
     gpr_log(GPR_DEBUG,
-            "chand=%p calld=%p: failing %" PRIdPTR " pending batches: %s",
+            "chand=%p calld=%p: failing %" PRIuPTR " pending batches: %s",
             elem->channel_data, calld, calld->waiting_for_pick_batches_count,
             grpc_error_string(error));
   }
@@ -922,9 +923,9 @@
 }
 
 // This is called via the call combiner, so access to calld is synchronized.
-static void run_pending_batch_in_call_combiner(grpc_exec_ctx *exec_ctx,
-                                               void *arg, grpc_error *ignored) {
-  call_data *calld = (call_data *)arg;
+static void run_pending_batch_in_call_combiner(grpc_exec_ctx* exec_ctx,
+                                               void* arg, grpc_error* ignored) {
+  call_data* calld = (call_data*)arg;
   if (calld->waiting_for_pick_batches_count > 0) {
     --calld->waiting_for_pick_batches_count;
     grpc_subchannel_call_process_op(
@@ -934,13 +935,14 @@
 }
 
 // This is called via the call combiner, so access to calld is synchronized.
-static void waiting_for_pick_batches_resume(grpc_exec_ctx *exec_ctx,
-                                            grpc_call_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void waiting_for_pick_batches_resume(grpc_exec_ctx* exec_ctx,
+                                            grpc_call_element* elem) {
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (grpc_client_channel_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "chand=%p calld=%p: sending %" PRIdPTR
-                       " pending batches to subchannel_call=%p",
+    gpr_log(GPR_DEBUG,
+            "chand=%p calld=%p: sending %" PRIuPTR
+            " pending batches to subchannel_call=%p",
             chand, calld, calld->waiting_for_pick_batches_count,
             calld->subchannel_call);
   }
@@ -960,10 +962,10 @@
 
 // Applies service config to the call.  Must be invoked once we know
 // that the resolver has returned results to the channel.
-static void apply_service_config_to_call_locked(grpc_exec_ctx *exec_ctx,
-                                                grpc_call_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void apply_service_config_to_call_locked(grpc_exec_ctx* exec_ctx,
+                                                grpc_call_element* elem) {
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (grpc_client_channel_trace.enabled()) {
     gpr_log(GPR_DEBUG, "chand=%p calld=%p: applying service config to call",
             chand, calld);
@@ -973,7 +975,7 @@
         grpc_server_retry_throttle_data_ref(chand->retry_throttle_data);
   }
   if (chand->method_params_table != NULL) {
-    calld->method_params = (method_parameters *)grpc_method_config_table_get(
+    calld->method_params = (method_parameters*)grpc_method_config_table_get(
         exec_ctx, chand->method_params_table, calld->path);
     if (calld->method_params != NULL) {
       method_parameters_ref(calld->method_params);
@@ -993,11 +995,11 @@
   }
 }
 
-static void create_subchannel_call_locked(grpc_exec_ctx *exec_ctx,
-                                          grpc_call_element *elem,
-                                          grpc_error *error) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void create_subchannel_call_locked(grpc_exec_ctx* exec_ctx,
+                                          grpc_call_element* elem,
+                                          grpc_error* error) {
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   const grpc_connected_subchannel_call_args call_args = {
       calld->pollent,                  // pollent
       calld->path,                     // path
@@ -1007,7 +1009,7 @@
       calld->subchannel_call_context,  // context
       calld->call_combiner             // call_combiner
   };
-  grpc_error *new_error = grpc_connected_subchannel_create_call(
+  grpc_error* new_error = grpc_connected_subchannel_create_call(
       exec_ctx, calld->connected_subchannel, &call_args,
       &calld->subchannel_call);
   if (grpc_client_channel_trace.enabled()) {
@@ -1024,10 +1026,10 @@
 }
 
 // Invoked when a pick is completed, on both success or failure.
-static void pick_done_locked(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                             grpc_error *error) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void pick_done_locked(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                             grpc_error* error) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   if (calld->connected_subchannel == NULL) {
     // Failed to create subchannel.
     GRPC_ERROR_UNREF(calld->error);
@@ -1053,10 +1055,10 @@
 // either (a) the pick was deferred pending a resolver result or (b) the
 // pick was done asynchronously.  Removes the call's polling entity from
 // chand->interested_parties before invoking pick_done_locked().
-static void async_pick_done_locked(grpc_exec_ctx *exec_ctx,
-                                   grpc_call_element *elem, grpc_error *error) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void async_pick_done_locked(grpc_exec_ctx* exec_ctx,
+                                   grpc_call_element* elem, grpc_error* error) {
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   grpc_polling_entity_del_from_pollset_set(exec_ctx, calld->pollent,
                                            chand->interested_parties);
   pick_done_locked(exec_ctx, elem, error);
@@ -1064,11 +1066,11 @@
 
 // Note: This runs under the client_channel combiner, but will NOT be
 // holding the call combiner.
-static void pick_callback_cancel_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void pick_callback_cancel_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (calld->lb_policy != NULL) {
     if (grpc_client_channel_trace.enabled()) {
       gpr_log(GPR_DEBUG, "chand=%p calld=%p: cancelling pick from LB policy %p",
@@ -1083,11 +1085,11 @@
 
 // Callback invoked by grpc_lb_policy_pick_locked() for async picks.
 // Unrefs the LB policy and invokes async_pick_done_locked().
-static void pick_callback_done_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                      grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void pick_callback_done_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                      grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (grpc_client_channel_trace.enabled()) {
     gpr_log(GPR_DEBUG, "chand=%p calld=%p: pick completed asynchronously",
             chand, calld);
@@ -1101,10 +1103,10 @@
 // Takes a ref to chand->lb_policy and calls grpc_lb_policy_pick_locked().
 // If the pick was completed synchronously, unrefs the LB policy and
 // returns true.
-static bool pick_callback_start_locked(grpc_exec_ctx *exec_ctx,
-                                       grpc_call_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+static bool pick_callback_start_locked(grpc_exec_ctx* exec_ctx,
+                                       grpc_call_element* elem) {
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (grpc_client_channel_trace.enabled()) {
     gpr_log(GPR_DEBUG, "chand=%p calld=%p: starting pick on lb_policy=%p",
             chand, calld, chand->lb_policy);
@@ -1161,7 +1163,7 @@
 }
 
 typedef struct {
-  grpc_call_element *elem;
+  grpc_call_element* elem;
   bool finished;
   grpc_closure closure;
   grpc_closure cancel_closure;
@@ -1169,11 +1171,10 @@
 
 // Note: This runs under the client_channel combiner, but will NOT be
 // holding the call combiner.
-static void pick_after_resolver_result_cancel_locked(grpc_exec_ctx *exec_ctx,
-                                                     void *arg,
-                                                     grpc_error *error) {
-  pick_after_resolver_result_args *args =
-      (pick_after_resolver_result_args *)arg;
+static void pick_after_resolver_result_cancel_locked(grpc_exec_ctx* exec_ctx,
+                                                     void* arg,
+                                                     grpc_error* error) {
+  pick_after_resolver_result_args* args = (pick_after_resolver_result_args*)arg;
   if (args->finished) {
     gpr_free(args);
     return;
@@ -1186,9 +1187,9 @@
   // is called, it will be a no-op.  We also immediately invoke
   // async_pick_done_locked() to propagate the error back to the caller.
   args->finished = true;
-  grpc_call_element *elem = args->elem;
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+  grpc_call_element* elem = args->elem;
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (grpc_client_channel_trace.enabled()) {
     gpr_log(GPR_DEBUG,
             "chand=%p calld=%p: cancelling pick waiting for resolver result",
@@ -1204,11 +1205,13 @@
                              "Pick cancelled", &error, 1));
 }
 
-static void pick_after_resolver_result_done_locked(grpc_exec_ctx *exec_ctx,
-                                                   void *arg,
-                                                   grpc_error *error) {
-  pick_after_resolver_result_args *args =
-      (pick_after_resolver_result_args *)arg;
+static void pick_after_resolver_result_start_locked(grpc_exec_ctx* exec_ctx,
+                                                    grpc_call_element* elem);
+
+static void pick_after_resolver_result_done_locked(grpc_exec_ctx* exec_ctx,
+                                                   void* arg,
+                                                   grpc_error* error) {
+  pick_after_resolver_result_args* args = (pick_after_resolver_result_args*)arg;
   if (args->finished) {
     /* cancelled, do nothing */
     if (grpc_client_channel_trace.enabled()) {
@@ -1218,16 +1221,16 @@
     return;
   }
   args->finished = true;
-  grpc_call_element *elem = args->elem;
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+  grpc_call_element* elem = args->elem;
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (error != GRPC_ERROR_NONE) {
     if (grpc_client_channel_trace.enabled()) {
       gpr_log(GPR_DEBUG, "chand=%p calld=%p: resolver failed to return data",
               chand, calld);
     }
     async_pick_done_locked(exec_ctx, elem, GRPC_ERROR_REF(error));
-  } else {
+  } else if (chand->lb_policy != NULL) {
     if (grpc_client_channel_trace.enabled()) {
       gpr_log(GPR_DEBUG, "chand=%p calld=%p: resolver returned, doing pick",
               chand, calld);
@@ -1241,19 +1244,43 @@
       async_pick_done_locked(exec_ctx, elem, GRPC_ERROR_NONE);
     }
   }
+  // TODO(roth): It should be impossible for chand->lb_policy to be NULL
+  // here, so the rest of this code should never actually be executed.
+  // However, we have reports of a crash on iOS that triggers this case,
+  // so we are temporarily adding this to restore branches that were
+  // removed in https://github.com/grpc/grpc/pull/12297.  Need to figure
+  // out what is actually causing this to occur and then figure out the
+  // right way to deal with it.
+  else if (chand->resolver != NULL) {
+    // No LB policy, so try again.
+    if (grpc_client_channel_trace.enabled()) {
+      gpr_log(GPR_DEBUG,
+              "chand=%p calld=%p: resolver returned but no LB policy, "
+              "trying again",
+              chand, calld);
+    }
+    pick_after_resolver_result_start_locked(exec_ctx, elem);
+  } else {
+    if (grpc_client_channel_trace.enabled()) {
+      gpr_log(GPR_DEBUG, "chand=%p calld=%p: resolver disconnected", chand,
+              calld);
+    }
+    async_pick_done_locked(
+        exec_ctx, elem, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Disconnected"));
+  }
 }
 
-static void pick_after_resolver_result_start_locked(grpc_exec_ctx *exec_ctx,
-                                                    grpc_call_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void pick_after_resolver_result_start_locked(grpc_exec_ctx* exec_ctx,
+                                                    grpc_call_element* elem) {
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (grpc_client_channel_trace.enabled()) {
     gpr_log(GPR_DEBUG,
             "chand=%p calld=%p: deferring pick pending resolver result", chand,
             calld);
   }
-  pick_after_resolver_result_args *args =
-      (pick_after_resolver_result_args *)gpr_zalloc(sizeof(*args));
+  pick_after_resolver_result_args* args =
+      (pick_after_resolver_result_args*)gpr_zalloc(sizeof(*args));
   args->elem = elem;
   GRPC_CLOSURE_INIT(&args->closure, pick_after_resolver_result_done_locked,
                     args, grpc_combiner_scheduler(chand->combiner));
@@ -1266,11 +1293,11 @@
                         grpc_combiner_scheduler(chand->combiner)));
 }
 
-static void start_pick_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                              grpc_error *ignored) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void start_pick_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                              grpc_error* ignored) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   GPR_ASSERT(calld->connected_subchannel == NULL);
   if (chand->lb_policy != NULL) {
     // We already have an LB policy, so ask it for a pick.
@@ -1300,9 +1327,9 @@
                                          chand->interested_parties);
 }
 
-static void on_complete(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
+static void on_complete(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
   if (calld->retry_throttle_data != NULL) {
     if (error == GRPC_ERROR_NONE) {
       grpc_server_retry_throttle_data_record_success(
@@ -1321,10 +1348,10 @@
 }
 
 static void cc_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *batch) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* batch) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   if (chand->deadline_checking_enabled) {
     grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem,
                                                                batch);
@@ -1415,11 +1442,11 @@
 }
 
 /* Constructor for call_data */
-static grpc_error *cc_init_call_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_element *elem,
-                                     const grpc_call_element_args *args) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static grpc_error* cc_init_call_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_call_element* elem,
+                                     const grpc_call_element_args* args) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   // Initialize data members.
   calld->path = grpc_slice_ref_internal(args->path);
   calld->call_start_time = args->start_time;
@@ -1435,12 +1462,12 @@
 }
 
 /* Destructor for call_data */
-static void cc_destroy_call_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_call_element *elem,
-                                 const grpc_call_final_info *final_info,
-                                 grpc_closure *then_schedule_closure) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void cc_destroy_call_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_call_element* elem,
+                                 const grpc_call_final_info* final_info,
+                                 grpc_closure* then_schedule_closure) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   if (chand->deadline_checking_enabled) {
     grpc_deadline_state_destroy(exec_ctx, elem);
   }
@@ -1471,10 +1498,10 @@
   GRPC_CLOSURE_SCHED(exec_ctx, then_schedule_closure, GRPC_ERROR_NONE);
 }
 
-static void cc_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
-                                          grpc_call_element *elem,
-                                          grpc_polling_entity *pollent) {
-  call_data *calld = (call_data *)elem->call_data;
+static void cc_set_pollset_or_pollset_set(grpc_exec_ctx* exec_ctx,
+                                          grpc_call_element* elem,
+                                          grpc_polling_entity* pollent) {
+  call_data* calld = (call_data*)elem->call_data;
   calld->pollent = pollent;
 }
 
@@ -1496,9 +1523,9 @@
     "client-channel",
 };
 
-static void try_to_connect_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                  grpc_error *error_ignored) {
-  channel_data *chand = (channel_data *)arg;
+static void try_to_connect_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                  grpc_error* error_ignored) {
+  channel_data* chand = (channel_data*)arg;
   if (chand->lb_policy != NULL) {
     grpc_lb_policy_exit_idle_locked(exec_ctx, chand->lb_policy);
   } else {
@@ -1511,34 +1538,35 @@
 }
 
 grpc_connectivity_state grpc_client_channel_check_connectivity_state(
-    grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, int try_to_connect) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+    grpc_exec_ctx* exec_ctx, grpc_channel_element* elem, int try_to_connect) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   grpc_connectivity_state out =
       grpc_connectivity_state_check(&chand->state_tracker);
   if (out == GRPC_CHANNEL_IDLE && try_to_connect) {
     GRPC_CHANNEL_STACK_REF(chand->owning_stack, "try_to_connect");
     GRPC_CLOSURE_SCHED(
-        exec_ctx, GRPC_CLOSURE_CREATE(try_to_connect_locked, chand,
-                                      grpc_combiner_scheduler(chand->combiner)),
+        exec_ctx,
+        GRPC_CLOSURE_CREATE(try_to_connect_locked, chand,
+                            grpc_combiner_scheduler(chand->combiner)),
         GRPC_ERROR_NONE);
   }
   return out;
 }
 
 typedef struct external_connectivity_watcher {
-  channel_data *chand;
+  channel_data* chand;
   grpc_polling_entity pollent;
-  grpc_closure *on_complete;
-  grpc_closure *watcher_timer_init;
-  grpc_connectivity_state *state;
+  grpc_closure* on_complete;
+  grpc_closure* watcher_timer_init;
+  grpc_connectivity_state* state;
   grpc_closure my_closure;
-  struct external_connectivity_watcher *next;
+  struct external_connectivity_watcher* next;
 } external_connectivity_watcher;
 
-static external_connectivity_watcher *lookup_external_connectivity_watcher(
-    channel_data *chand, grpc_closure *on_complete) {
+static external_connectivity_watcher* lookup_external_connectivity_watcher(
+    channel_data* chand, grpc_closure* on_complete) {
   gpr_mu_lock(&chand->external_connectivity_watcher_list_mu);
-  external_connectivity_watcher *w =
+  external_connectivity_watcher* w =
       chand->external_connectivity_watcher_list_head;
   while (w != NULL && w->on_complete != on_complete) {
     w = w->next;
@@ -1548,7 +1576,7 @@
 }
 
 static void external_connectivity_watcher_list_append(
-    channel_data *chand, external_connectivity_watcher *w) {
+    channel_data* chand, external_connectivity_watcher* w) {
   GPR_ASSERT(!lookup_external_connectivity_watcher(chand, w->on_complete));
 
   gpr_mu_lock(&w->chand->external_connectivity_watcher_list_mu);
@@ -1559,7 +1587,7 @@
 }
 
 static void external_connectivity_watcher_list_remove(
-    channel_data *chand, external_connectivity_watcher *too_remove) {
+    channel_data* chand, external_connectivity_watcher* too_remove) {
   GPR_ASSERT(
       lookup_external_connectivity_watcher(chand, too_remove->on_complete));
   gpr_mu_lock(&chand->external_connectivity_watcher_list_mu);
@@ -1568,7 +1596,7 @@
     gpr_mu_unlock(&chand->external_connectivity_watcher_list_mu);
     return;
   }
-  external_connectivity_watcher *w =
+  external_connectivity_watcher* w =
       chand->external_connectivity_watcher_list_head;
   while (w != NULL) {
     if (w->next == too_remove) {
@@ -1582,12 +1610,12 @@
 }
 
 int grpc_client_channel_num_external_connectivity_watchers(
-    grpc_channel_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+    grpc_channel_element* elem) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   int count = 0;
 
   gpr_mu_lock(&chand->external_connectivity_watcher_list_mu);
-  external_connectivity_watcher *w =
+  external_connectivity_watcher* w =
       chand->external_connectivity_watcher_list_head;
   while (w != NULL) {
     count++;
@@ -1598,10 +1626,10 @@
   return count;
 }
 
-static void on_external_watch_complete_locked(grpc_exec_ctx *exec_ctx,
-                                              void *arg, grpc_error *error) {
-  external_connectivity_watcher *w = (external_connectivity_watcher *)arg;
-  grpc_closure *follow_up = w->on_complete;
+static void on_external_watch_complete_locked(grpc_exec_ctx* exec_ctx,
+                                              void* arg, grpc_error* error) {
+  external_connectivity_watcher* w = (external_connectivity_watcher*)arg;
+  grpc_closure* follow_up = w->on_complete;
   grpc_polling_entity_del_from_pollset_set(exec_ctx, &w->pollent,
                                            w->chand->interested_parties);
   GRPC_CHANNEL_STACK_UNREF(exec_ctx, w->chand->owning_stack,
@@ -1611,10 +1639,10 @@
   GRPC_CLOSURE_RUN(exec_ctx, follow_up, GRPC_ERROR_REF(error));
 }
 
-static void watch_connectivity_state_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                            grpc_error *error_ignored) {
-  external_connectivity_watcher *w = (external_connectivity_watcher *)arg;
-  external_connectivity_watcher *found = NULL;
+static void watch_connectivity_state_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                            grpc_error* error_ignored) {
+  external_connectivity_watcher* w = (external_connectivity_watcher*)arg;
+  external_connectivity_watcher* found = NULL;
   if (w->state != NULL) {
     external_connectivity_watcher_list_append(w->chand, w);
     GRPC_CLOSURE_RUN(exec_ctx, w->watcher_timer_init, GRPC_ERROR_NONE);
@@ -1639,12 +1667,12 @@
 }
 
 void grpc_client_channel_watch_connectivity_state(
-    grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-    grpc_polling_entity pollent, grpc_connectivity_state *state,
-    grpc_closure *closure, grpc_closure *watcher_timer_init) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  external_connectivity_watcher *w =
-      (external_connectivity_watcher *)gpr_zalloc(sizeof(*w));
+    grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+    grpc_polling_entity pollent, grpc_connectivity_state* state,
+    grpc_closure* closure, grpc_closure* watcher_timer_init) {
+  channel_data* chand = (channel_data*)elem->channel_data;
+  external_connectivity_watcher* w =
+      (external_connectivity_watcher*)gpr_zalloc(sizeof(*w));
   w->chand = chand;
   w->pollent = pollent;
   w->on_complete = closure;
diff --git a/src/core/ext/filters/client_channel/client_channel.h b/src/core/ext/filters/client_channel/client_channel.h
index d78e7a7..f58a8c1 100644
--- a/src/core/ext/filters/client_channel/client_channel.h
+++ b/src/core/ext/filters/client_channel/client_channel.h
@@ -42,19 +42,19 @@
 extern const grpc_channel_filter grpc_client_channel_filter;
 
 grpc_connectivity_state grpc_client_channel_check_connectivity_state(
-    grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, int try_to_connect);
+    grpc_exec_ctx* exec_ctx, grpc_channel_element* elem, int try_to_connect);
 
 int grpc_client_channel_num_external_connectivity_watchers(
-    grpc_channel_element *elem);
+    grpc_channel_element* elem);
 
 void grpc_client_channel_watch_connectivity_state(
-    grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-    grpc_polling_entity pollent, grpc_connectivity_state *state,
-    grpc_closure *on_complete, grpc_closure *watcher_timer_init);
+    grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+    grpc_polling_entity pollent, grpc_connectivity_state* state,
+    grpc_closure* on_complete, grpc_closure* watcher_timer_init);
 
 /* Debug helper: pull the subchannel call from a call stack element */
-grpc_subchannel_call *grpc_client_channel_get_subchannel_call(
-    grpc_call_element *elem);
+grpc_subchannel_call* grpc_client_channel_get_subchannel_call(
+    grpc_call_element* elem);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/client_channel_factory.h b/src/core/ext/filters/client_channel/client_channel_factory.h
index 4273c90..db8645c 100644
--- a/src/core/ext/filters/client_channel/client_channel_factory.h
+++ b/src/core/ext/filters/client_channel/client_channel_factory.h
@@ -44,39 +44,39 @@
 /** Constructor for new configured channels.
     Creating decorators around this type is encouraged to adapt behavior. */
 struct grpc_client_channel_factory {
-  const grpc_client_channel_factory_vtable *vtable;
+  const grpc_client_channel_factory_vtable* vtable;
 };
 
 struct grpc_client_channel_factory_vtable {
-  void (*ref)(grpc_client_channel_factory *factory);
-  void (*unref)(grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory);
-  grpc_subchannel *(*create_subchannel)(grpc_exec_ctx *exec_ctx,
-                                        grpc_client_channel_factory *factory,
-                                        const grpc_subchannel_args *args);
-  grpc_channel *(*create_client_channel)(grpc_exec_ctx *exec_ctx,
-                                         grpc_client_channel_factory *factory,
-                                         const char *target,
+  void (*ref)(grpc_client_channel_factory* factory);
+  void (*unref)(grpc_exec_ctx* exec_ctx, grpc_client_channel_factory* factory);
+  grpc_subchannel* (*create_subchannel)(grpc_exec_ctx* exec_ctx,
+                                        grpc_client_channel_factory* factory,
+                                        const grpc_subchannel_args* args);
+  grpc_channel* (*create_client_channel)(grpc_exec_ctx* exec_ctx,
+                                         grpc_client_channel_factory* factory,
+                                         const char* target,
                                          grpc_client_channel_type type,
-                                         const grpc_channel_args *args);
+                                         const grpc_channel_args* args);
 };
 
-void grpc_client_channel_factory_ref(grpc_client_channel_factory *factory);
-void grpc_client_channel_factory_unref(grpc_exec_ctx *exec_ctx,
-                                       grpc_client_channel_factory *factory);
+void grpc_client_channel_factory_ref(grpc_client_channel_factory* factory);
+void grpc_client_channel_factory_unref(grpc_exec_ctx* exec_ctx,
+                                       grpc_client_channel_factory* factory);
 
 /** Create a new grpc_subchannel */
-grpc_subchannel *grpc_client_channel_factory_create_subchannel(
-    grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory,
-    const grpc_subchannel_args *args);
+grpc_subchannel* grpc_client_channel_factory_create_subchannel(
+    grpc_exec_ctx* exec_ctx, grpc_client_channel_factory* factory,
+    const grpc_subchannel_args* args);
 
 /** Create a new grpc_channel */
-grpc_channel *grpc_client_channel_factory_create_channel(
-    grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory,
-    const char *target, grpc_client_channel_type type,
-    const grpc_channel_args *args);
+grpc_channel* grpc_client_channel_factory_create_channel(
+    grpc_exec_ctx* exec_ctx, grpc_client_channel_factory* factory,
+    const char* target, grpc_client_channel_type type,
+    const grpc_channel_args* args);
 
 grpc_arg grpc_client_channel_factory_create_channel_arg(
-    grpc_client_channel_factory *factory);
+    grpc_client_channel_factory* factory);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/client_channel_plugin.cc b/src/core/ext/filters/client_channel/client_channel_plugin.cc
index 407b834..198ef75 100644
--- a/src/core/ext/filters/client_channel/client_channel_plugin.cc
+++ b/src/core/ext/filters/client_channel/client_channel_plugin.cc
@@ -34,16 +34,16 @@
 #include "src/core/ext/filters/client_channel/subchannel_index.h"
 #include "src/core/lib/surface/channel_init.h"
 
-static bool append_filter(grpc_exec_ctx *exec_ctx,
-                          grpc_channel_stack_builder *builder, void *arg) {
+static bool append_filter(grpc_exec_ctx* exec_ctx,
+                          grpc_channel_stack_builder* builder, void* arg) {
   return grpc_channel_stack_builder_append_filter(
-      builder, (const grpc_channel_filter *)arg, NULL, NULL);
+      builder, (const grpc_channel_filter*)arg, NULL, NULL);
 }
 
-static bool set_default_host_if_unset(grpc_exec_ctx *exec_ctx,
-                                      grpc_channel_stack_builder *builder,
-                                      void *unused) {
-  const grpc_channel_args *args =
+static bool set_default_host_if_unset(grpc_exec_ctx* exec_ctx,
+                                      grpc_channel_stack_builder* builder,
+                                      void* unused) {
+  const grpc_channel_args* args =
       grpc_channel_stack_builder_get_channel_arguments(builder);
   for (size_t i = 0; i < args->num_args; i++) {
     if (0 == strcmp(args->args[i].key, GRPC_ARG_DEFAULT_AUTHORITY) ||
@@ -51,12 +51,12 @@
       return true;
     }
   }
-  char *default_authority = grpc_get_default_authority(
+  char* default_authority = grpc_get_default_authority(
       exec_ctx, grpc_channel_stack_builder_get_target(builder));
   if (default_authority != NULL) {
     grpc_arg arg = grpc_channel_arg_string_create(
-        (char *)GRPC_ARG_DEFAULT_AUTHORITY, default_authority);
-    grpc_channel_args *new_args = grpc_channel_args_copy_and_add(args, &arg, 1);
+        (char*)GRPC_ARG_DEFAULT_AUTHORITY, default_authority);
+    grpc_channel_args* new_args = grpc_channel_args_copy_and_add(args, &arg, 1);
     grpc_channel_stack_builder_set_channel_arguments(exec_ctx, builder,
                                                      new_args);
     gpr_free(default_authority);
@@ -76,7 +76,7 @@
                                    set_default_host_if_unset, NULL);
   grpc_channel_init_register_stage(
       GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, append_filter,
-      (void *)&grpc_client_channel_filter);
+      (void*)&grpc_client_channel_filter);
   grpc_http_connect_register_handshaker_factory();
 
 #ifndef NDEBUG
diff --git a/src/core/ext/filters/client_channel/connector.h b/src/core/ext/filters/client_channel/connector.h
index b71e0aa..12dc59b 100644
--- a/src/core/ext/filters/client_channel/connector.h
+++ b/src/core/ext/filters/client_channel/connector.h
@@ -31,48 +31,48 @@
 typedef struct grpc_connector_vtable grpc_connector_vtable;
 
 struct grpc_connector {
-  const grpc_connector_vtable *vtable;
+  const grpc_connector_vtable* vtable;
 };
 
 typedef struct {
   /** set of pollsets interested in this connection */
-  grpc_pollset_set *interested_parties;
+  grpc_pollset_set* interested_parties;
   /** deadline for connection */
   grpc_millis deadline;
   /** channel arguments (to be passed to transport) */
-  const grpc_channel_args *channel_args;
+  const grpc_channel_args* channel_args;
 } grpc_connect_in_args;
 
 typedef struct {
   /** the connected transport */
-  grpc_transport *transport;
+  grpc_transport* transport;
 
   /** channel arguments (to be passed to the filters) */
-  grpc_channel_args *channel_args;
+  grpc_channel_args* channel_args;
 } grpc_connect_out_args;
 
 struct grpc_connector_vtable {
-  void (*ref)(grpc_connector *connector);
-  void (*unref)(grpc_exec_ctx *exec_ctx, grpc_connector *connector);
+  void (*ref)(grpc_connector* connector);
+  void (*unref)(grpc_exec_ctx* exec_ctx, grpc_connector* connector);
   /** Implementation of grpc_connector_shutdown */
-  void (*shutdown)(grpc_exec_ctx *exec_ctx, grpc_connector *connector,
-                   grpc_error *why);
+  void (*shutdown)(grpc_exec_ctx* exec_ctx, grpc_connector* connector,
+                   grpc_error* why);
   /** Implementation of grpc_connector_connect */
-  void (*connect)(grpc_exec_ctx *exec_ctx, grpc_connector *connector,
-                  const grpc_connect_in_args *in_args,
-                  grpc_connect_out_args *out_args, grpc_closure *notify);
+  void (*connect)(grpc_exec_ctx* exec_ctx, grpc_connector* connector,
+                  const grpc_connect_in_args* in_args,
+                  grpc_connect_out_args* out_args, grpc_closure* notify);
 };
 
-grpc_connector *grpc_connector_ref(grpc_connector *connector);
-void grpc_connector_unref(grpc_exec_ctx *exec_ctx, grpc_connector *connector);
+grpc_connector* grpc_connector_ref(grpc_connector* connector);
+void grpc_connector_unref(grpc_exec_ctx* exec_ctx, grpc_connector* connector);
 /** Connect using the connector: max one outstanding call at a time */
-void grpc_connector_connect(grpc_exec_ctx *exec_ctx, grpc_connector *connector,
-                            const grpc_connect_in_args *in_args,
-                            grpc_connect_out_args *out_args,
-                            grpc_closure *notify);
+void grpc_connector_connect(grpc_exec_ctx* exec_ctx, grpc_connector* connector,
+                            const grpc_connect_in_args* in_args,
+                            grpc_connect_out_args* out_args,
+                            grpc_closure* notify);
 /** Cancel any pending connection */
-void grpc_connector_shutdown(grpc_exec_ctx *exec_ctx, grpc_connector *connector,
-                             grpc_error *why);
+void grpc_connector_shutdown(grpc_exec_ctx* exec_ctx, grpc_connector* connector,
+                             grpc_error* why);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/lb_policy.cc b/src/core/ext/filters/client_channel/lb_policy.cc
index 8bffd48..6276c3e 100644
--- a/src/core/ext/filters/client_channel/lb_policy.cc
+++ b/src/core/ext/filters/client_channel/lb_policy.cc
@@ -24,9 +24,9 @@
 grpc_core::DebugOnlyTraceFlag grpc_trace_lb_policy_refcount(
     false, "lb_policy_refcount");
 
-void grpc_lb_policy_init(grpc_lb_policy *policy,
-                         const grpc_lb_policy_vtable *vtable,
-                         grpc_combiner *combiner) {
+void grpc_lb_policy_init(grpc_lb_policy* policy,
+                         const grpc_lb_policy_vtable* vtable,
+                         grpc_combiner* combiner) {
   policy->vtable = vtable;
   gpr_atm_no_barrier_store(&policy->ref_pair, 1 << WEAK_REF_BITS);
   policy->interested_parties = grpc_pollset_set_create();
@@ -35,7 +35,7 @@
 
 #ifndef NDEBUG
 #define REF_FUNC_EXTRA_ARGS , const char *file, int line, const char *reason
-#define REF_MUTATE_EXTRA_ARGS REF_FUNC_EXTRA_ARGS, const char *purpose
+#define REF_MUTATE_EXTRA_ARGS REF_FUNC_EXTRA_ARGS, const char* purpose
 #define REF_FUNC_PASS_ARGS(new_reason) , file, line, new_reason
 #define REF_MUTATE_PASS_ARGS(purpose) , file, line, reason, purpose
 #else
@@ -45,7 +45,7 @@
 #define REF_MUTATE_PASS_ARGS(x)
 #endif
 
-static gpr_atm ref_mutate(grpc_lb_policy *c, gpr_atm delta,
+static gpr_atm ref_mutate(grpc_lb_policy* c, gpr_atm delta,
                           int barrier REF_MUTATE_EXTRA_ARGS) {
   gpr_atm old_val = barrier ? gpr_atm_full_fetch_add(&c->ref_pair, delta)
                             : gpr_atm_no_barrier_fetch_add(&c->ref_pair, delta);
@@ -59,104 +59,105 @@
   return old_val;
 }
 
-void grpc_lb_policy_ref(grpc_lb_policy *policy REF_FUNC_EXTRA_ARGS) {
+void grpc_lb_policy_ref(grpc_lb_policy* policy REF_FUNC_EXTRA_ARGS) {
   ref_mutate(policy, 1 << WEAK_REF_BITS, 0 REF_MUTATE_PASS_ARGS("STRONG_REF"));
 }
 
-static void shutdown_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_error *error) {
-  grpc_lb_policy *policy = (grpc_lb_policy *)arg;
+static void shutdown_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_error* error) {
+  grpc_lb_policy* policy = (grpc_lb_policy*)arg;
   policy->vtable->shutdown_locked(exec_ctx, policy);
   GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, policy, "strong-unref");
 }
 
-void grpc_lb_policy_unref(grpc_exec_ctx *exec_ctx,
-                          grpc_lb_policy *policy REF_FUNC_EXTRA_ARGS) {
+void grpc_lb_policy_unref(grpc_exec_ctx* exec_ctx,
+                          grpc_lb_policy* policy REF_FUNC_EXTRA_ARGS) {
   gpr_atm old_val =
       ref_mutate(policy, (gpr_atm)1 - (gpr_atm)(1 << WEAK_REF_BITS),
                  1 REF_MUTATE_PASS_ARGS("STRONG_UNREF"));
   gpr_atm mask = ~(gpr_atm)((1 << WEAK_REF_BITS) - 1);
   gpr_atm check = 1 << WEAK_REF_BITS;
   if ((old_val & mask) == check) {
-    GRPC_CLOSURE_SCHED(exec_ctx, GRPC_CLOSURE_CREATE(
-                                     shutdown_locked, policy,
-                                     grpc_combiner_scheduler(policy->combiner)),
-                       GRPC_ERROR_NONE);
+    GRPC_CLOSURE_SCHED(
+        exec_ctx,
+        GRPC_CLOSURE_CREATE(shutdown_locked, policy,
+                            grpc_combiner_scheduler(policy->combiner)),
+        GRPC_ERROR_NONE);
   } else {
     grpc_lb_policy_weak_unref(exec_ctx,
                               policy REF_FUNC_PASS_ARGS("strong-unref"));
   }
 }
 
-void grpc_lb_policy_weak_ref(grpc_lb_policy *policy REF_FUNC_EXTRA_ARGS) {
+void grpc_lb_policy_weak_ref(grpc_lb_policy* policy REF_FUNC_EXTRA_ARGS) {
   ref_mutate(policy, 1, 0 REF_MUTATE_PASS_ARGS("WEAK_REF"));
 }
 
-void grpc_lb_policy_weak_unref(grpc_exec_ctx *exec_ctx,
-                               grpc_lb_policy *policy REF_FUNC_EXTRA_ARGS) {
+void grpc_lb_policy_weak_unref(grpc_exec_ctx* exec_ctx,
+                               grpc_lb_policy* policy REF_FUNC_EXTRA_ARGS) {
   gpr_atm old_val =
       ref_mutate(policy, -(gpr_atm)1, 1 REF_MUTATE_PASS_ARGS("WEAK_UNREF"));
   if (old_val == 1) {
     grpc_pollset_set_destroy(exec_ctx, policy->interested_parties);
-    grpc_combiner *combiner = policy->combiner;
+    grpc_combiner* combiner = policy->combiner;
     policy->vtable->destroy(exec_ctx, policy);
     GRPC_COMBINER_UNREF(exec_ctx, combiner, "lb_policy");
   }
 }
 
-int grpc_lb_policy_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                               const grpc_lb_policy_pick_args *pick_args,
-                               grpc_connected_subchannel **target,
-                               grpc_call_context_element *context,
-                               void **user_data, grpc_closure *on_complete) {
+int grpc_lb_policy_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                               const grpc_lb_policy_pick_args* pick_args,
+                               grpc_connected_subchannel** target,
+                               grpc_call_context_element* context,
+                               void** user_data, grpc_closure* on_complete) {
   return policy->vtable->pick_locked(exec_ctx, policy, pick_args, target,
                                      context, user_data, on_complete);
 }
 
-void grpc_lb_policy_cancel_pick_locked(grpc_exec_ctx *exec_ctx,
-                                       grpc_lb_policy *policy,
-                                       grpc_connected_subchannel **target,
-                                       grpc_error *error) {
+void grpc_lb_policy_cancel_pick_locked(grpc_exec_ctx* exec_ctx,
+                                       grpc_lb_policy* policy,
+                                       grpc_connected_subchannel** target,
+                                       grpc_error* error) {
   policy->vtable->cancel_pick_locked(exec_ctx, policy, target, error);
 }
 
-void grpc_lb_policy_cancel_picks_locked(grpc_exec_ctx *exec_ctx,
-                                        grpc_lb_policy *policy,
+void grpc_lb_policy_cancel_picks_locked(grpc_exec_ctx* exec_ctx,
+                                        grpc_lb_policy* policy,
                                         uint32_t initial_metadata_flags_mask,
                                         uint32_t initial_metadata_flags_eq,
-                                        grpc_error *error) {
+                                        grpc_error* error) {
   policy->vtable->cancel_picks_locked(exec_ctx, policy,
                                       initial_metadata_flags_mask,
                                       initial_metadata_flags_eq, error);
 }
 
-void grpc_lb_policy_exit_idle_locked(grpc_exec_ctx *exec_ctx,
-                                     grpc_lb_policy *policy) {
+void grpc_lb_policy_exit_idle_locked(grpc_exec_ctx* exec_ctx,
+                                     grpc_lb_policy* policy) {
   policy->vtable->exit_idle_locked(exec_ctx, policy);
 }
 
-void grpc_lb_policy_ping_one_locked(grpc_exec_ctx *exec_ctx,
-                                    grpc_lb_policy *policy,
-                                    grpc_closure *closure) {
+void grpc_lb_policy_ping_one_locked(grpc_exec_ctx* exec_ctx,
+                                    grpc_lb_policy* policy,
+                                    grpc_closure* closure) {
   policy->vtable->ping_one_locked(exec_ctx, policy, closure);
 }
 
 void grpc_lb_policy_notify_on_state_change_locked(
-    grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-    grpc_connectivity_state *state, grpc_closure *closure) {
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+    grpc_connectivity_state* state, grpc_closure* closure) {
   policy->vtable->notify_on_state_change_locked(exec_ctx, policy, state,
                                                 closure);
 }
 
 grpc_connectivity_state grpc_lb_policy_check_connectivity_locked(
-    grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-    grpc_error **connectivity_error) {
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+    grpc_error** connectivity_error) {
   return policy->vtable->check_connectivity_locked(exec_ctx, policy,
                                                    connectivity_error);
 }
 
-void grpc_lb_policy_update_locked(grpc_exec_ctx *exec_ctx,
-                                  grpc_lb_policy *policy,
-                                  const grpc_lb_policy_args *lb_policy_args) {
+void grpc_lb_policy_update_locked(grpc_exec_ctx* exec_ctx,
+                                  grpc_lb_policy* policy,
+                                  const grpc_lb_policy_args* lb_policy_args) {
   policy->vtable->update_locked(exec_ctx, policy, lb_policy_args);
 }
diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h
index 710c9d9..00ac0b1 100644
--- a/src/core/ext/filters/client_channel/lb_policy.h
+++ b/src/core/ext/filters/client_channel/lb_policy.h
@@ -38,70 +38,70 @@
 #endif
 
 struct grpc_lb_policy {
-  const grpc_lb_policy_vtable *vtable;
+  const grpc_lb_policy_vtable* vtable;
   gpr_atm ref_pair;
   /* owned pointer to interested parties in load balancing decisions */
-  grpc_pollset_set *interested_parties;
+  grpc_pollset_set* interested_parties;
   /* combiner under which lb_policy actions take place */
-  grpc_combiner *combiner;
+  grpc_combiner* combiner;
 };
 
 /** Extra arguments for an LB pick */
 typedef struct grpc_lb_policy_pick_args {
   /** Initial metadata associated with the picking call. */
-  grpc_metadata_batch *initial_metadata;
+  grpc_metadata_batch* initial_metadata;
   /** Bitmask used for selective cancelling. See \a
    * grpc_lb_policy_cancel_picks() and \a GRPC_INITIAL_METADATA_* in
    * grpc_types.h */
   uint32_t initial_metadata_flags;
   /** Storage for LB token in \a initial_metadata, or NULL if not used */
-  grpc_linked_mdelem *lb_token_mdelem_storage;
+  grpc_linked_mdelem* lb_token_mdelem_storage;
 } grpc_lb_policy_pick_args;
 
 struct grpc_lb_policy_vtable {
-  void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy);
-  void (*shutdown_locked)(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy);
+  void (*shutdown_locked)(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy);
 
   /** \see grpc_lb_policy_pick */
-  int (*pick_locked)(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                     const grpc_lb_policy_pick_args *pick_args,
-                     grpc_connected_subchannel **target,
-                     grpc_call_context_element *context, void **user_data,
-                     grpc_closure *on_complete);
+  int (*pick_locked)(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                     const grpc_lb_policy_pick_args* pick_args,
+                     grpc_connected_subchannel** target,
+                     grpc_call_context_element* context, void** user_data,
+                     grpc_closure* on_complete);
 
   /** \see grpc_lb_policy_cancel_pick */
-  void (*cancel_pick_locked)(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                             grpc_connected_subchannel **target,
-                             grpc_error *error);
+  void (*cancel_pick_locked)(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                             grpc_connected_subchannel** target,
+                             grpc_error* error);
 
   /** \see grpc_lb_policy_cancel_picks */
-  void (*cancel_picks_locked)(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
+  void (*cancel_picks_locked)(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
                               uint32_t initial_metadata_flags_mask,
                               uint32_t initial_metadata_flags_eq,
-                              grpc_error *error);
+                              grpc_error* error);
 
   /** \see grpc_lb_policy_ping_one */
-  void (*ping_one_locked)(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                          grpc_closure *closure);
+  void (*ping_one_locked)(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                          grpc_closure* closure);
 
   /** Try to enter a READY connectivity state */
-  void (*exit_idle_locked)(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy);
+  void (*exit_idle_locked)(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy);
 
   /** check the current connectivity of the lb_policy */
   grpc_connectivity_state (*check_connectivity_locked)(
-      grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-      grpc_error **connectivity_error);
+      grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+      grpc_error** connectivity_error);
 
   /** call notify when the connectivity state of a channel changes from *state.
       Updates *state with the new state of the policy. Calling with a NULL \a
       state cancels the subscription.  */
-  void (*notify_on_state_change_locked)(grpc_exec_ctx *exec_ctx,
-                                        grpc_lb_policy *policy,
-                                        grpc_connectivity_state *state,
-                                        grpc_closure *closure);
+  void (*notify_on_state_change_locked)(grpc_exec_ctx* exec_ctx,
+                                        grpc_lb_policy* policy,
+                                        grpc_connectivity_state* state,
+                                        grpc_closure* closure);
 
-  void (*update_locked)(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                        const grpc_lb_policy_args *args);
+  void (*update_locked)(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                        const grpc_lb_policy_args* args);
 };
 
 #ifndef NDEBUG
@@ -119,29 +119,29 @@
   grpc_lb_policy_weak_ref((p), __FILE__, __LINE__, (r))
 #define GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, p, r) \
   grpc_lb_policy_weak_unref((exec_ctx), (p), __FILE__, __LINE__, (r))
-void grpc_lb_policy_ref(grpc_lb_policy *policy, const char *file, int line,
-                        const char *reason);
-void grpc_lb_policy_unref(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                          const char *file, int line, const char *reason);
-void grpc_lb_policy_weak_ref(grpc_lb_policy *policy, const char *file, int line,
-                             const char *reason);
-void grpc_lb_policy_weak_unref(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                               const char *file, int line, const char *reason);
+void grpc_lb_policy_ref(grpc_lb_policy* policy, const char* file, int line,
+                        const char* reason);
+void grpc_lb_policy_unref(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                          const char* file, int line, const char* reason);
+void grpc_lb_policy_weak_ref(grpc_lb_policy* policy, const char* file, int line,
+                             const char* reason);
+void grpc_lb_policy_weak_unref(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                               const char* file, int line, const char* reason);
 #else
 #define GRPC_LB_POLICY_REF(p, r) grpc_lb_policy_ref((p))
 #define GRPC_LB_POLICY_UNREF(cl, p, r) grpc_lb_policy_unref((cl), (p))
 #define GRPC_LB_POLICY_WEAK_REF(p, r) grpc_lb_policy_weak_ref((p))
 #define GRPC_LB_POLICY_WEAK_UNREF(cl, p, r) grpc_lb_policy_weak_unref((cl), (p))
-void grpc_lb_policy_ref(grpc_lb_policy *policy);
-void grpc_lb_policy_unref(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy);
-void grpc_lb_policy_weak_ref(grpc_lb_policy *policy);
-void grpc_lb_policy_weak_unref(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy);
+void grpc_lb_policy_ref(grpc_lb_policy* policy);
+void grpc_lb_policy_unref(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy);
+void grpc_lb_policy_weak_ref(grpc_lb_policy* policy);
+void grpc_lb_policy_weak_unref(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy);
 #endif
 
 /** called by concrete implementations to initialize the base struct */
-void grpc_lb_policy_init(grpc_lb_policy *policy,
-                         const grpc_lb_policy_vtable *vtable,
-                         grpc_combiner *combiner);
+void grpc_lb_policy_init(grpc_lb_policy* policy,
+                         const grpc_lb_policy_vtable* vtable,
+                         grpc_combiner* combiner);
 
 /** Finds an appropriate subchannel for a call, based on \a pick_args.
 
@@ -160,53 +160,53 @@
 
     Any IO should be done under the \a interested_parties \a grpc_pollset_set
     in the \a grpc_lb_policy struct. */
-int grpc_lb_policy_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                               const grpc_lb_policy_pick_args *pick_args,
-                               grpc_connected_subchannel **target,
-                               grpc_call_context_element *context,
-                               void **user_data, grpc_closure *on_complete);
+int grpc_lb_policy_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                               const grpc_lb_policy_pick_args* pick_args,
+                               grpc_connected_subchannel** target,
+                               grpc_call_context_element* context,
+                               void** user_data, grpc_closure* on_complete);
 
 /** Perform a connected subchannel ping (see \a grpc_connected_subchannel_ping)
     against one of the connected subchannels managed by \a policy. */
-void grpc_lb_policy_ping_one_locked(grpc_exec_ctx *exec_ctx,
-                                    grpc_lb_policy *policy,
-                                    grpc_closure *closure);
+void grpc_lb_policy_ping_one_locked(grpc_exec_ctx* exec_ctx,
+                                    grpc_lb_policy* policy,
+                                    grpc_closure* closure);
 
 /** Cancel picks for \a target.
     The \a on_complete callback of the pending picks will be invoked with \a
     *target set to NULL. */
-void grpc_lb_policy_cancel_pick_locked(grpc_exec_ctx *exec_ctx,
-                                       grpc_lb_policy *policy,
-                                       grpc_connected_subchannel **target,
-                                       grpc_error *error);
+void grpc_lb_policy_cancel_pick_locked(grpc_exec_ctx* exec_ctx,
+                                       grpc_lb_policy* policy,
+                                       grpc_connected_subchannel** target,
+                                       grpc_error* error);
 
 /** Cancel all pending picks for which their \a initial_metadata_flags (as given
     in the call to \a grpc_lb_policy_pick) matches \a initial_metadata_flags_eq
     when AND'd with \a initial_metadata_flags_mask */
-void grpc_lb_policy_cancel_picks_locked(grpc_exec_ctx *exec_ctx,
-                                        grpc_lb_policy *policy,
+void grpc_lb_policy_cancel_picks_locked(grpc_exec_ctx* exec_ctx,
+                                        grpc_lb_policy* policy,
                                         uint32_t initial_metadata_flags_mask,
                                         uint32_t initial_metadata_flags_eq,
-                                        grpc_error *error);
+                                        grpc_error* error);
 
 /** Try to enter a READY connectivity state */
-void grpc_lb_policy_exit_idle_locked(grpc_exec_ctx *exec_ctx,
-                                     grpc_lb_policy *policy);
+void grpc_lb_policy_exit_idle_locked(grpc_exec_ctx* exec_ctx,
+                                     grpc_lb_policy* policy);
 
 /* Call notify when the connectivity state of a channel changes from \a *state.
  * Updates \a *state with the new state of the policy */
 void grpc_lb_policy_notify_on_state_change_locked(
-    grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-    grpc_connectivity_state *state, grpc_closure *closure);
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+    grpc_connectivity_state* state, grpc_closure* closure);
 
 grpc_connectivity_state grpc_lb_policy_check_connectivity_locked(
-    grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-    grpc_error **connectivity_error);
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+    grpc_error** connectivity_error);
 
 /** Update \a policy with \a lb_policy_args. */
-void grpc_lb_policy_update_locked(grpc_exec_ctx *exec_ctx,
-                                  grpc_lb_policy *policy,
-                                  const grpc_lb_policy_args *lb_policy_args);
+void grpc_lb_policy_update_locked(grpc_exec_ctx* exec_ctx,
+                                  grpc_lb_policy* policy,
+                                  const grpc_lb_policy_args* lb_policy_args);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
index 7ad3229..d93a9c3 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
@@ -25,31 +25,31 @@
 #include "src/core/lib/iomgr/error.h"
 #include "src/core/lib/profiling/timers.h"
 
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
   return GRPC_ERROR_NONE;
 }
 
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {}
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {}
 
 typedef struct {
   // Stats object to update.
-  grpc_grpclb_client_stats *client_stats;
+  grpc_grpclb_client_stats* client_stats;
   // State for intercepting send_initial_metadata.
   grpc_closure on_complete_for_send;
-  grpc_closure *original_on_complete_for_send;
+  grpc_closure* original_on_complete_for_send;
   bool send_initial_metadata_succeeded;
   // State for intercepting recv_initial_metadata.
   grpc_closure recv_initial_metadata_ready;
-  grpc_closure *original_recv_initial_metadata_ready;
+  grpc_closure* original_recv_initial_metadata_ready;
   bool recv_initial_metadata_succeeded;
 } call_data;
 
-static void on_complete_for_send(grpc_exec_ctx *exec_ctx, void *arg,
-                                 grpc_error *error) {
-  call_data *calld = (call_data *)arg;
+static void on_complete_for_send(grpc_exec_ctx* exec_ctx, void* arg,
+                                 grpc_error* error) {
+  call_data* calld = (call_data*)arg;
   if (error == GRPC_ERROR_NONE) {
     calld->send_initial_metadata_succeeded = true;
   }
@@ -57,9 +57,9 @@
                    GRPC_ERROR_REF(error));
 }
 
-static void recv_initial_metadata_ready(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error) {
-  call_data *calld = (call_data *)arg;
+static void recv_initial_metadata_ready(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error) {
+  call_data* calld = (call_data*)arg;
   if (error == GRPC_ERROR_NONE) {
     calld->recv_initial_metadata_succeeded = true;
   }
@@ -67,25 +67,24 @@
                    GRPC_ERROR_REF(error));
 }
 
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  call_data *calld = (call_data *)elem->call_data;
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  call_data* calld = (call_data*)elem->call_data;
   // Get stats object from context and take a ref.
   GPR_ASSERT(args->context != NULL);
   GPR_ASSERT(args->context[GRPC_GRPCLB_CLIENT_STATS].value != NULL);
   calld->client_stats = grpc_grpclb_client_stats_ref(
-      (grpc_grpclb_client_stats *)args->context[GRPC_GRPCLB_CLIENT_STATS]
-          .value);
+      (grpc_grpclb_client_stats*)args->context[GRPC_GRPCLB_CLIENT_STATS].value);
   // Record call started.
   grpc_grpclb_client_stats_add_call_started(calld->client_stats);
   return GRPC_ERROR_NONE;
 }
 
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {
-  call_data *calld = (call_data *)elem->call_data;
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {
+  call_data* calld = (call_data*)elem->call_data;
   // Record call finished, optionally setting client_failed_to_send and
   // received.
   grpc_grpclb_client_stats_add_call_finished(
@@ -97,9 +96,9 @@
 }
 
 static void start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *batch) {
-  call_data *calld = (call_data *)elem->call_data;
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* batch) {
+  call_data* calld = (call_data*)elem->call_data;
   GPR_TIMER_BEGIN("clr_start_transport_stream_op_batch", 0);
   // Intercept send_initial_metadata.
   if (batch->send_initial_metadata) {
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
index c6a0d69..abf613a 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
@@ -32,4 +32,4 @@
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H \
-          */
+        */
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
index eb699af..64f7cf9 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -130,17 +130,17 @@
 
 /* add lb_token of selected subchannel (address) to the call's initial
  * metadata */
-static grpc_error *initial_metadata_add_lb_token(
-    grpc_exec_ctx *exec_ctx, grpc_metadata_batch *initial_metadata,
-    grpc_linked_mdelem *lb_token_mdelem_storage, grpc_mdelem lb_token) {
+static grpc_error* initial_metadata_add_lb_token(
+    grpc_exec_ctx* exec_ctx, grpc_metadata_batch* initial_metadata,
+    grpc_linked_mdelem* lb_token_mdelem_storage, grpc_mdelem lb_token) {
   GPR_ASSERT(lb_token_mdelem_storage != NULL);
   GPR_ASSERT(!GRPC_MDISNULL(lb_token));
   return grpc_metadata_batch_add_tail(exec_ctx, initial_metadata,
                                       lb_token_mdelem_storage, lb_token);
 }
 
-static void destroy_client_stats(void *arg) {
-  grpc_grpclb_client_stats_unref((grpc_grpclb_client_stats *)arg);
+static void destroy_client_stats(void* arg) {
+  grpc_grpclb_client_stats_unref((grpc_grpclb_client_stats*)arg);
 }
 
 typedef struct wrapped_rr_closure_arg {
@@ -149,42 +149,42 @@
 
   /* the original closure. Usually a on_complete/notify cb for pick() and ping()
    * calls against the internal RR instance, respectively. */
-  grpc_closure *wrapped_closure;
+  grpc_closure* wrapped_closure;
 
   /* the pick's initial metadata, kept in order to append the LB token for the
    * pick */
-  grpc_metadata_batch *initial_metadata;
+  grpc_metadata_batch* initial_metadata;
 
   /* the picked target, used to determine which LB token to add to the pick's
    * initial metadata */
-  grpc_connected_subchannel **target;
+  grpc_connected_subchannel** target;
 
   /* the context to be populated for the subchannel call */
-  grpc_call_context_element *context;
+  grpc_call_context_element* context;
 
   /* Stats for client-side load reporting. Note that this holds a
    * reference, which must be either passed on via context or unreffed. */
-  grpc_grpclb_client_stats *client_stats;
+  grpc_grpclb_client_stats* client_stats;
 
   /* the LB token associated with the pick */
   grpc_mdelem lb_token;
 
   /* storage for the lb token initial metadata mdelem */
-  grpc_linked_mdelem *lb_token_mdelem_storage;
+  grpc_linked_mdelem* lb_token_mdelem_storage;
 
   /* The RR instance related to the closure */
-  grpc_lb_policy *rr_policy;
+  grpc_lb_policy* rr_policy;
 
   /* heap memory to be freed upon closure execution. */
-  void *free_when_done;
+  void* free_when_done;
 } wrapped_rr_closure_arg;
 
 /* The \a on_complete closure passed as part of the pick requires keeping a
  * reference to its associated round robin instance. We wrap this closure in
  * order to unref the round robin instance upon its invocation */
-static void wrapped_rr_closure(grpc_exec_ctx *exec_ctx, void *arg,
-                               grpc_error *error) {
-  wrapped_rr_closure_arg *wc_arg = (wrapped_rr_closure_arg *)arg;
+static void wrapped_rr_closure(grpc_exec_ctx* exec_ctx, void* arg,
+                               grpc_error* error) {
+  wrapped_rr_closure_arg* wc_arg = (wrapped_rr_closure_arg*)arg;
 
   GPR_ASSERT(wc_arg->wrapped_closure != NULL);
   GRPC_CLOSURE_SCHED(exec_ctx, wc_arg->wrapped_closure, GRPC_ERROR_REF(error));
@@ -202,7 +202,7 @@
         gpr_log(GPR_ERROR,
                 "No LB token for connected subchannel pick %p (from RR "
                 "instance %p).",
-                (void *)*wc_arg->target, (void *)wc_arg->rr_policy);
+                (void*)*wc_arg->target, (void*)wc_arg->rr_policy);
         abort();
       }
       // Pass on client stats via context. Passes ownership of the reference.
@@ -213,7 +213,7 @@
       grpc_grpclb_client_stats_unref(wc_arg->client_stats);
     }
     if (grpc_lb_glb_trace.enabled()) {
-      gpr_log(GPR_INFO, "Unreffing RR %p", (void *)wc_arg->rr_policy);
+      gpr_log(GPR_INFO, "Unreffing RR %p", (void*)wc_arg->rr_policy);
     }
     GRPC_LB_POLICY_UNREF(exec_ctx, wc_arg->rr_policy, "wrapped_rr_closure");
   }
@@ -230,25 +230,25 @@
  * order to correctly unref the RR policy instance upon completion of the pick.
  * See \a wrapped_rr_closure for details. */
 typedef struct pending_pick {
-  struct pending_pick *next;
+  struct pending_pick* next;
 
   /* original pick()'s arguments */
   grpc_lb_policy_pick_args pick_args;
 
   /* output argument where to store the pick()ed connected subchannel, or NULL
    * upon error. */
-  grpc_connected_subchannel **target;
+  grpc_connected_subchannel** target;
 
   /* args for wrapped_on_complete */
   wrapped_rr_closure_arg wrapped_on_complete_arg;
 } pending_pick;
 
-static void add_pending_pick(pending_pick **root,
-                             const grpc_lb_policy_pick_args *pick_args,
-                             grpc_connected_subchannel **target,
-                             grpc_call_context_element *context,
-                             grpc_closure *on_complete) {
-  pending_pick *pp = (pending_pick *)gpr_zalloc(sizeof(*pp));
+static void add_pending_pick(pending_pick** root,
+                             const grpc_lb_policy_pick_args* pick_args,
+                             grpc_connected_subchannel** target,
+                             grpc_call_context_element* context,
+                             grpc_closure* on_complete) {
+  pending_pick* pp = (pending_pick*)gpr_zalloc(sizeof(*pp));
   pp->next = *root;
   pp->pick_args = *pick_args;
   pp->target = target;
@@ -267,14 +267,14 @@
 
 /* Same as the \a pending_pick struct but for ping operations */
 typedef struct pending_ping {
-  struct pending_ping *next;
+  struct pending_ping* next;
 
   /* args for wrapped_notify */
   wrapped_rr_closure_arg wrapped_notify_arg;
 } pending_ping;
 
-static void add_pending_ping(pending_ping **root, grpc_closure *notify) {
-  pending_ping *pping = (pending_ping *)gpr_zalloc(sizeof(*pping));
+static void add_pending_ping(pending_ping** root, grpc_closure* notify) {
+  pending_ping* pping = (pending_ping*)gpr_zalloc(sizeof(*pping));
   pping->wrapped_notify_arg.wrapped_closure = notify;
   pping->wrapped_notify_arg.free_when_done = pping;
   pping->next = *root;
@@ -294,9 +294,9 @@
   grpc_lb_policy base;
 
   /** who the client is trying to communicate with */
-  const char *server_name;
-  grpc_client_channel_factory *cc_factory;
-  grpc_channel_args *args;
+  const char* server_name;
+  grpc_client_channel_factory* cc_factory;
+  grpc_channel_args* args;
 
   /** timeout in milliseconds for the LB call. 0 means no deadline. */
   int lb_call_timeout_ms;
@@ -306,13 +306,13 @@
   int lb_fallback_timeout_ms;
 
   /** for communicating with the LB server */
-  grpc_channel *lb_channel;
+  grpc_channel* lb_channel;
 
   /** response generator to inject address updates into \a lb_channel */
-  grpc_fake_resolver_response_generator *response_generator;
+  grpc_fake_resolver_response_generator* response_generator;
 
   /** the RR policy to use of the backend servers returned by the LB server */
-  grpc_lb_policy *rr_policy;
+  grpc_lb_policy* rr_policy;
 
   bool started_picking;
 
@@ -324,7 +324,7 @@
 
   /** stores the deserialized response from the LB. May be NULL until one such
    * response has arrived. */
-  grpc_grpclb_serverlist *serverlist;
+  grpc_grpclb_serverlist* serverlist;
 
   /** Index into serverlist for next pick.
    * If the server at this index is a drop, we return a drop.
@@ -332,13 +332,13 @@
   size_t serverlist_index;
 
   /** stores the backend addresses from the resolver */
-  grpc_lb_addresses *fallback_backend_addresses;
+  grpc_lb_addresses* fallback_backend_addresses;
 
   /** list of picks that are waiting on RR's policy connectivity */
-  pending_pick *pending_picks;
+  pending_pick* pending_picks;
 
   /** list of pings that are waiting on RR's policy connectivity */
-  pending_ping *pending_pings;
+  pending_ping* pending_pings;
 
   bool shutting_down;
 
@@ -373,7 +373,7 @@
   /* LB fallback timer callback. */
   grpc_closure lb_on_fallback;
 
-  grpc_call *lb_call; /* streaming call to the LB server, */
+  grpc_call* lb_call; /* streaming call to the LB server, */
 
   grpc_metadata_array lb_initial_metadata_recv; /* initial MD from LB server */
   grpc_metadata_array
@@ -381,10 +381,10 @@
 
   /* what's being sent to the LB server. Note that its value may vary if the LB
    * server indicates a redirect. */
-  grpc_byte_buffer *lb_request_payload;
+  grpc_byte_buffer* lb_request_payload;
 
   /* response the LB server, if any. Processed in lb_on_response_received() */
-  grpc_byte_buffer *lb_response_payload;
+  grpc_byte_buffer* lb_response_payload;
 
   /* call status code and details, set in lb_on_server_status_received() */
   grpc_status_code lb_call_status;
@@ -403,7 +403,7 @@
 
   /* Stats for client-side load reporting. Should be unreffed and
    * recreated whenever lb_call is replaced. */
-  grpc_grpclb_client_stats *client_stats;
+  grpc_grpclb_client_stats* client_stats;
   /* Interval and timer for next client load report. */
   grpc_millis client_stats_report_interval;
   grpc_timer client_load_report_timer;
@@ -413,20 +413,20 @@
    * completion of sending the load report. */
   grpc_closure client_load_report_closure;
   /* Client load report message payload. */
-  grpc_byte_buffer *client_load_report_payload;
+  grpc_byte_buffer* client_load_report_payload;
 } glb_lb_policy;
 
 /* Keeps track and reacts to changes in connectivity of the RR instance */
 struct rr_connectivity_data {
   grpc_closure on_change;
   grpc_connectivity_state state;
-  glb_lb_policy *glb_policy;
+  glb_lb_policy* glb_policy;
 };
 
-static bool is_server_valid(const grpc_grpclb_server *server, size_t idx,
+static bool is_server_valid(const grpc_grpclb_server* server, size_t idx,
                             bool log) {
   if (server->drop) return false;
-  const grpc_grpclb_ip_address *ip = &server->ip_address;
+  const grpc_grpclb_ip_address* ip = &server->ip_address;
   if (server->port >> 16 != 0) {
     if (log) {
       gpr_log(GPR_ERROR,
@@ -448,17 +448,17 @@
 }
 
 /* vtable for LB tokens in grpc_lb_addresses. */
-static void *lb_token_copy(void *token) {
+static void* lb_token_copy(void* token) {
   return token == NULL
              ? NULL
-             : (void *)GRPC_MDELEM_REF(grpc_mdelem{(uintptr_t)token}).payload;
+             : (void*)GRPC_MDELEM_REF(grpc_mdelem{(uintptr_t)token}).payload;
 }
-static void lb_token_destroy(grpc_exec_ctx *exec_ctx, void *token) {
+static void lb_token_destroy(grpc_exec_ctx* exec_ctx, void* token) {
   if (token != NULL) {
     GRPC_MDELEM_UNREF(exec_ctx, grpc_mdelem{(uintptr_t)token});
   }
 }
-static int lb_token_cmp(void *token1, void *token2) {
+static int lb_token_cmp(void* token1, void* token2) {
   if (token1 > token2) return 1;
   if (token1 < token2) return -1;
   return 0;
@@ -466,23 +466,23 @@
 static const grpc_lb_user_data_vtable lb_token_vtable = {
     lb_token_copy, lb_token_destroy, lb_token_cmp};
 
-static void parse_server(const grpc_grpclb_server *server,
-                         grpc_resolved_address *addr) {
+static void parse_server(const grpc_grpclb_server* server,
+                         grpc_resolved_address* addr) {
   memset(addr, 0, sizeof(*addr));
   if (server->drop) return;
   const uint16_t netorder_port = htons((uint16_t)server->port);
   /* the addresses are given in binary format (a in(6)_addr struct) in
    * server->ip_address.bytes. */
-  const grpc_grpclb_ip_address *ip = &server->ip_address;
+  const grpc_grpclb_ip_address* ip = &server->ip_address;
   if (ip->size == 4) {
     addr->len = sizeof(struct sockaddr_in);
-    struct sockaddr_in *addr4 = (struct sockaddr_in *)&addr->addr;
+    struct sockaddr_in* addr4 = (struct sockaddr_in*)&addr->addr;
     addr4->sin_family = AF_INET;
     memcpy(&addr4->sin_addr, ip->bytes, ip->size);
     addr4->sin_port = netorder_port;
   } else if (ip->size == 16) {
     addr->len = sizeof(struct sockaddr_in6);
-    struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&addr->addr;
+    struct sockaddr_in6* addr6 = (struct sockaddr_in6*)&addr->addr;
     addr6->sin6_family = AF_INET6;
     memcpy(&addr6->sin6_addr, ip->bytes, ip->size);
     addr6->sin6_port = netorder_port;
@@ -490,15 +490,15 @@
 }
 
 /* Returns addresses extracted from \a serverlist. */
-static grpc_lb_addresses *process_serverlist_locked(
-    grpc_exec_ctx *exec_ctx, const grpc_grpclb_serverlist *serverlist) {
+static grpc_lb_addresses* process_serverlist_locked(
+    grpc_exec_ctx* exec_ctx, const grpc_grpclb_serverlist* serverlist) {
   size_t num_valid = 0;
   /* first pass: count how many are valid in order to allocate the necessary
    * memory in a single block */
   for (size_t i = 0; i < serverlist->num_servers; ++i) {
     if (is_server_valid(serverlist->servers[i], i, true)) ++num_valid;
   }
-  grpc_lb_addresses *lb_addresses =
+  grpc_lb_addresses* lb_addresses =
       grpc_lb_addresses_create(num_valid, &lb_token_vtable);
   /* second pass: actually populate the addresses and LB tokens (aka user data
    * to the outside world) to be read by the RR policy during its creation.
@@ -507,14 +507,14 @@
    * incurr in an allocation due to the arbitrary number of server */
   size_t addr_idx = 0;
   for (size_t sl_idx = 0; sl_idx < serverlist->num_servers; ++sl_idx) {
-    const grpc_grpclb_server *server = serverlist->servers[sl_idx];
+    const grpc_grpclb_server* server = serverlist->servers[sl_idx];
     if (!is_server_valid(serverlist->servers[sl_idx], sl_idx, false)) continue;
     GPR_ASSERT(addr_idx < num_valid);
     /* address processing */
     grpc_resolved_address addr;
     parse_server(server, &addr);
     /* lb token processing */
-    void *user_data;
+    void* user_data;
     if (server->has_load_balance_token) {
       const size_t lb_token_max_length =
           GPR_ARRAY_SIZE(server->load_balance_token);
@@ -522,17 +522,17 @@
           strnlen(server->load_balance_token, lb_token_max_length);
       grpc_slice lb_token_mdstr = grpc_slice_from_copied_buffer(
           server->load_balance_token, lb_token_length);
-      user_data = (void *)grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_LB_TOKEN,
-                                                  lb_token_mdstr)
+      user_data = (void*)grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_LB_TOKEN,
+                                                 lb_token_mdstr)
                       .payload;
     } else {
-      char *uri = grpc_sockaddr_to_uri(&addr);
+      char* uri = grpc_sockaddr_to_uri(&addr);
       gpr_log(GPR_INFO,
               "Missing LB token for backend address '%s'. The empty token will "
               "be used instead",
               uri);
       gpr_free(uri);
-      user_data = (void *)GRPC_MDELEM_LB_TOKEN_EMPTY.payload;
+      user_data = (void*)GRPC_MDELEM_LB_TOKEN_EMPTY.payload;
     }
 
     grpc_lb_addresses_set_address(lb_addresses, addr_idx, &addr.addr, addr.len,
@@ -545,8 +545,8 @@
 }
 
 /* Returns the backend addresses extracted from the given addresses */
-static grpc_lb_addresses *extract_backend_addresses_locked(
-    grpc_exec_ctx *exec_ctx, const grpc_lb_addresses *addresses) {
+static grpc_lb_addresses* extract_backend_addresses_locked(
+    grpc_exec_ctx* exec_ctx, const grpc_lb_addresses* addresses) {
   /* first pass: count the number of backend addresses */
   size_t num_backends = 0;
   for (size_t i = 0; i < addresses->num_addresses; ++i) {
@@ -555,24 +555,24 @@
     }
   }
   /* second pass: actually populate the addresses and (empty) LB tokens */
-  grpc_lb_addresses *backend_addresses =
+  grpc_lb_addresses* backend_addresses =
       grpc_lb_addresses_create(num_backends, &lb_token_vtable);
   size_t num_copied = 0;
   for (size_t i = 0; i < addresses->num_addresses; ++i) {
     if (addresses->addresses[i].is_balancer) continue;
-    const grpc_resolved_address *addr = &addresses->addresses[i].address;
+    const grpc_resolved_address* addr = &addresses->addresses[i].address;
     grpc_lb_addresses_set_address(backend_addresses, num_copied, &addr->addr,
                                   addr->len, false /* is_balancer */,
                                   NULL /* balancer_name */,
-                                  (void *)GRPC_MDELEM_LB_TOKEN_EMPTY.payload);
+                                  (void*)GRPC_MDELEM_LB_TOKEN_EMPTY.payload);
     ++num_copied;
   }
   return backend_addresses;
 }
 
 static void update_lb_connectivity_status_locked(
-    grpc_exec_ctx *exec_ctx, glb_lb_policy *glb_policy,
-    grpc_connectivity_state rr_state, grpc_error *rr_state_error) {
+    grpc_exec_ctx* exec_ctx, glb_lb_policy* glb_policy,
+    grpc_connectivity_state rr_state, grpc_error* rr_state_error) {
   const grpc_connectivity_state curr_glb_state =
       grpc_connectivity_state_check(&glb_policy->state_tracker);
 
@@ -611,7 +611,6 @@
     case GRPC_CHANNEL_SHUTDOWN:
       GPR_ASSERT(rr_state_error != GRPC_ERROR_NONE);
       break;
-    case GRPC_CHANNEL_INIT:
     case GRPC_CHANNEL_IDLE:
     case GRPC_CHANNEL_CONNECTING:
     case GRPC_CHANNEL_READY:
@@ -621,7 +620,7 @@
   if (grpc_lb_glb_trace.enabled()) {
     gpr_log(
         GPR_INFO, "Setting grpclb's state to %s from new RR policy %p state.",
-        grpc_connectivity_state_name(rr_state), (void *)glb_policy->rr_policy);
+        grpc_connectivity_state_name(rr_state), (void*)glb_policy->rr_policy);
   }
   grpc_connectivity_state_set(exec_ctx, &glb_policy->state_tracker, rr_state,
                               rr_state_error,
@@ -634,13 +633,13 @@
  * If \a force_async is true, then we will manually schedule the
  * completion callback even if the pick is available immediately. */
 static bool pick_from_internal_rr_locked(
-    grpc_exec_ctx *exec_ctx, glb_lb_policy *glb_policy,
-    const grpc_lb_policy_pick_args *pick_args, bool force_async,
-    grpc_connected_subchannel **target, wrapped_rr_closure_arg *wc_arg) {
+    grpc_exec_ctx* exec_ctx, glb_lb_policy* glb_policy,
+    const grpc_lb_policy_pick_args* pick_args, bool force_async,
+    grpc_connected_subchannel** target, wrapped_rr_closure_arg* wc_arg) {
   // Check for drops if we are not using fallback backend addresses.
   if (glb_policy->serverlist != NULL) {
     // Look at the index into the serverlist to see if we should drop this call.
-    grpc_grpclb_server *server =
+    grpc_grpclb_server* server =
         glb_policy->serverlist->servers[glb_policy->serverlist_index++];
     if (glb_policy->serverlist_index == glb_policy->serverlist->num_servers) {
       glb_policy->serverlist_index = 0;  // Wrap-around.
@@ -673,7 +672,7 @@
   // Pick via the RR policy.
   const bool pick_done = grpc_lb_policy_pick_locked(
       exec_ctx, wc_arg->rr_policy, pick_args, target, wc_arg->context,
-      (void **)&wc_arg->lb_token, &wc_arg->wrapper_closure);
+      (void**)&wc_arg->lb_token, &wc_arg->wrapper_closure);
   if (pick_done) {
     /* synchronous grpc_lb_policy_pick call. Unref the RR policy. */
     if (grpc_lb_glb_trace.enabled()) {
@@ -704,9 +703,9 @@
   return pick_done;
 }
 
-static grpc_lb_policy_args *lb_policy_args_create(grpc_exec_ctx *exec_ctx,
-                                                  glb_lb_policy *glb_policy) {
-  grpc_lb_addresses *addresses;
+static grpc_lb_policy_args* lb_policy_args_create(grpc_exec_ctx* exec_ctx,
+                                                  glb_lb_policy* glb_policy) {
+  grpc_lb_addresses* addresses;
   if (glb_policy->serverlist != NULL) {
     GPR_ASSERT(glb_policy->serverlist->num_servers > 0);
     addresses = process_serverlist_locked(exec_ctx, glb_policy->serverlist);
@@ -719,12 +718,12 @@
     addresses = grpc_lb_addresses_copy(glb_policy->fallback_backend_addresses);
   }
   GPR_ASSERT(addresses != NULL);
-  grpc_lb_policy_args *args = (grpc_lb_policy_args *)gpr_zalloc(sizeof(*args));
+  grpc_lb_policy_args* args = (grpc_lb_policy_args*)gpr_zalloc(sizeof(*args));
   args->client_channel_factory = glb_policy->cc_factory;
   args->combiner = glb_policy->base.combiner;
   // Replace the LB addresses in the channel args that we pass down to
   // the subchannel.
-  static const char *keys_to_remove[] = {GRPC_ARG_LB_ADDRESSES};
+  static const char* keys_to_remove[] = {GRPC_ARG_LB_ADDRESSES};
   const grpc_arg arg = grpc_lb_addresses_create_channel_arg(addresses);
   args->args = grpc_channel_args_copy_and_add_and_remove(
       glb_policy->args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), &arg,
@@ -733,19 +732,19 @@
   return args;
 }
 
-static void lb_policy_args_destroy(grpc_exec_ctx *exec_ctx,
-                                   grpc_lb_policy_args *args) {
+static void lb_policy_args_destroy(grpc_exec_ctx* exec_ctx,
+                                   grpc_lb_policy_args* args) {
   grpc_channel_args_destroy(exec_ctx, args->args);
   gpr_free(args);
 }
 
-static void glb_rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx,
-                                               void *arg, grpc_error *error);
-static void create_rr_locked(grpc_exec_ctx *exec_ctx, glb_lb_policy *glb_policy,
-                             grpc_lb_policy_args *args) {
+static void glb_rr_connectivity_changed_locked(grpc_exec_ctx* exec_ctx,
+                                               void* arg, grpc_error* error);
+static void create_rr_locked(grpc_exec_ctx* exec_ctx, glb_lb_policy* glb_policy,
+                             grpc_lb_policy_args* args) {
   GPR_ASSERT(glb_policy->rr_policy == NULL);
 
-  grpc_lb_policy *new_rr_policy =
+  grpc_lb_policy* new_rr_policy =
       grpc_lb_policy_create(exec_ctx, "round_robin", args);
   if (new_rr_policy == NULL) {
     gpr_log(GPR_ERROR,
@@ -754,11 +753,11 @@
             "to be used. Future updates from the LB will attempt to create new "
             "instances.",
             (unsigned long)glb_policy->serverlist->num_servers,
-            (void *)glb_policy->rr_policy);
+            (void*)glb_policy->rr_policy);
     return;
   }
   glb_policy->rr_policy = new_rr_policy;
-  grpc_error *rr_state_error = NULL;
+  grpc_error* rr_state_error = NULL;
   const grpc_connectivity_state rr_state =
       grpc_lb_policy_check_connectivity_locked(exec_ctx, glb_policy->rr_policy,
                                                &rr_state_error);
@@ -774,8 +773,8 @@
 
   /* Allocate the data for the tracking of the new RR policy's connectivity.
    * It'll be deallocated in glb_rr_connectivity_changed() */
-  rr_connectivity_data *rr_connectivity =
-      (rr_connectivity_data *)gpr_zalloc(sizeof(rr_connectivity_data));
+  rr_connectivity_data* rr_connectivity =
+      (rr_connectivity_data*)gpr_zalloc(sizeof(rr_connectivity_data));
   GRPC_CLOSURE_INIT(&rr_connectivity->on_change,
                     glb_rr_connectivity_changed_locked, rr_connectivity,
                     grpc_combiner_scheduler(glb_policy->base.combiner));
@@ -790,7 +789,7 @@
   grpc_lb_policy_exit_idle_locked(exec_ctx, glb_policy->rr_policy);
 
   /* Update picks and pings in wait */
-  pending_pick *pp;
+  pending_pick* pp;
   while ((pp = glb_policy->pending_picks)) {
     glb_policy->pending_picks = pp->next;
     GRPC_LB_POLICY_REF(glb_policy->rr_policy, "rr_handover_pending_pick");
@@ -799,14 +798,14 @@
         grpc_grpclb_client_stats_ref(glb_policy->client_stats);
     if (grpc_lb_glb_trace.enabled()) {
       gpr_log(GPR_INFO, "Pending pick about to (async) PICK from %p",
-              (void *)glb_policy->rr_policy);
+              (void*)glb_policy->rr_policy);
     }
     pick_from_internal_rr_locked(exec_ctx, glb_policy, &pp->pick_args,
                                  true /* force_async */, pp->target,
                                  &pp->wrapped_on_complete_arg);
   }
 
-  pending_ping *pping;
+  pending_ping* pping;
   while ((pping = glb_policy->pending_pings)) {
     glb_policy->pending_pings = pping->next;
     GRPC_LB_POLICY_REF(glb_policy->rr_policy, "rr_handover_pending_ping");
@@ -821,31 +820,31 @@
 }
 
 /* glb_policy->rr_policy may be NULL (initial handover) */
-static void rr_handover_locked(grpc_exec_ctx *exec_ctx,
-                               glb_lb_policy *glb_policy) {
+static void rr_handover_locked(grpc_exec_ctx* exec_ctx,
+                               glb_lb_policy* glb_policy) {
   if (glb_policy->shutting_down) return;
-  grpc_lb_policy_args *args = lb_policy_args_create(exec_ctx, glb_policy);
+  grpc_lb_policy_args* args = lb_policy_args_create(exec_ctx, glb_policy);
   GPR_ASSERT(args != NULL);
   if (glb_policy->rr_policy != NULL) {
     if (grpc_lb_glb_trace.enabled()) {
       gpr_log(GPR_DEBUG, "Updating Round Robin policy (%p)",
-              (void *)glb_policy->rr_policy);
+              (void*)glb_policy->rr_policy);
     }
     grpc_lb_policy_update_locked(exec_ctx, glb_policy->rr_policy, args);
   } else {
     create_rr_locked(exec_ctx, glb_policy, args);
     if (grpc_lb_glb_trace.enabled()) {
       gpr_log(GPR_DEBUG, "Created new Round Robin policy (%p)",
-              (void *)glb_policy->rr_policy);
+              (void*)glb_policy->rr_policy);
     }
   }
   lb_policy_args_destroy(exec_ctx, args);
 }
 
-static void glb_rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx,
-                                               void *arg, grpc_error *error) {
-  rr_connectivity_data *rr_connectivity = (rr_connectivity_data *)arg;
-  glb_lb_policy *glb_policy = rr_connectivity->glb_policy;
+static void glb_rr_connectivity_changed_locked(grpc_exec_ctx* exec_ctx,
+                                               void* arg, grpc_error* error) {
+  rr_connectivity_data* rr_connectivity = (rr_connectivity_data*)arg;
+  glb_lb_policy* glb_policy = rr_connectivity->glb_policy;
   if (glb_policy->shutting_down) {
     GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &glb_policy->base,
                               "glb_rr_connectivity_cb");
@@ -873,22 +872,22 @@
                                                &rr_connectivity->on_change);
 }
 
-static void destroy_balancer_name(grpc_exec_ctx *exec_ctx,
-                                  void *balancer_name) {
+static void destroy_balancer_name(grpc_exec_ctx* exec_ctx,
+                                  void* balancer_name) {
   gpr_free(balancer_name);
 }
 
 static grpc_slice_hash_table_entry targets_info_entry_create(
-    const char *address, const char *balancer_name) {
+    const char* address, const char* balancer_name) {
   grpc_slice_hash_table_entry entry;
   entry.key = grpc_slice_from_copied_string(address);
   entry.value = gpr_strdup(balancer_name);
   return entry;
 }
 
-static int balancer_name_cmp_fn(void *a, void *b) {
-  const char *a_str = (const char *)a;
-  const char *b_str = (const char *)b;
+static int balancer_name_cmp_fn(void* a, void* b) {
+  const char* a_str = (const char*)a;
+  const char* b_str = (const char*)b;
   return strcmp(a_str, b_str);
 }
 
@@ -900,10 +899,10 @@
  *   - \a response_generator: in order to propagate updates from the resolver
  *   above the grpclb policy.
  *   - \a args: other args inherited from the grpclb policy. */
-static grpc_channel_args *build_lb_channel_args(
-    grpc_exec_ctx *exec_ctx, const grpc_lb_addresses *addresses,
-    grpc_fake_resolver_response_generator *response_generator,
-    const grpc_channel_args *args) {
+static grpc_channel_args* build_lb_channel_args(
+    grpc_exec_ctx* exec_ctx, const grpc_lb_addresses* addresses,
+    grpc_fake_resolver_response_generator* response_generator,
+    const grpc_channel_args* args) {
   size_t num_grpclb_addrs = 0;
   for (size_t i = 0; i < addresses->num_addresses; ++i) {
     if (addresses->addresses[i].is_balancer) ++num_grpclb_addrs;
@@ -912,11 +911,11 @@
    * It's the resolver's responsibility to make sure this policy is only
    * instantiated and used in that case. Otherwise, something has gone wrong. */
   GPR_ASSERT(num_grpclb_addrs > 0);
-  grpc_lb_addresses *lb_addresses =
+  grpc_lb_addresses* lb_addresses =
       grpc_lb_addresses_create(num_grpclb_addrs, NULL);
-  grpc_slice_hash_table_entry *targets_info_entries =
-      (grpc_slice_hash_table_entry *)gpr_zalloc(sizeof(*targets_info_entries) *
-                                                num_grpclb_addrs);
+  grpc_slice_hash_table_entry* targets_info_entries =
+      (grpc_slice_hash_table_entry*)gpr_zalloc(sizeof(*targets_info_entries) *
+                                               num_grpclb_addrs);
 
   size_t lb_addresses_idx = 0;
   for (size_t i = 0; i < addresses->num_addresses; ++i) {
@@ -925,7 +924,7 @@
       gpr_log(GPR_ERROR,
               "This LB policy doesn't support user data. It will be ignored");
     }
-    char *addr_str;
+    char* addr_str;
     GPR_ASSERT(grpc_sockaddr_to_string(
                    &addr_str, &addresses->addresses[i].address, true) > 0);
     targets_info_entries[lb_addresses_idx] = targets_info_entry_create(
@@ -938,19 +937,19 @@
         addresses->addresses[i].balancer_name, NULL /* user data */);
   }
   GPR_ASSERT(num_grpclb_addrs == lb_addresses_idx);
-  grpc_slice_hash_table *targets_info =
+  grpc_slice_hash_table* targets_info =
       grpc_slice_hash_table_create(num_grpclb_addrs, targets_info_entries,
                                    destroy_balancer_name, balancer_name_cmp_fn);
   gpr_free(targets_info_entries);
 
-  grpc_channel_args *lb_channel_args =
+  grpc_channel_args* lb_channel_args =
       grpc_lb_policy_grpclb_build_lb_channel_args(exec_ctx, targets_info,
                                                   response_generator, args);
 
   grpc_arg lb_channel_addresses_arg =
       grpc_lb_addresses_create_channel_arg(lb_addresses);
 
-  grpc_channel_args *result = grpc_channel_args_copy_and_add(
+  grpc_channel_args* result = grpc_channel_args_copy_and_add(
       lb_channel_args, &lb_channel_addresses_arg, 1);
   grpc_slice_hash_table_unref(exec_ctx, targets_info);
   grpc_channel_args_destroy(exec_ctx, lb_channel_args);
@@ -958,11 +957,11 @@
   return result;
 }
 
-static void glb_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
+static void glb_destroy(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)pol;
   GPR_ASSERT(glb_policy->pending_picks == NULL);
   GPR_ASSERT(glb_policy->pending_pings == NULL);
-  gpr_free((void *)glb_policy->server_name);
+  gpr_free((void*)glb_policy->server_name);
   grpc_channel_args_destroy(exec_ctx, glb_policy->args);
   if (glb_policy->client_stats != NULL) {
     grpc_grpclb_client_stats_unref(glb_policy->client_stats);
@@ -979,14 +978,14 @@
   gpr_free(glb_policy);
 }
 
-static void glb_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
+static void glb_shutdown_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)pol;
   glb_policy->shutting_down = true;
 
   /* We need a copy of the lb_call pointer because we can't cancell the call
    * while holding glb_policy->mu: lb_on_server_status_received, invoked due to
    * the cancel, needs to acquire that same lock */
-  grpc_call *lb_call = glb_policy->lb_call;
+  grpc_call* lb_call = glb_policy->lb_call;
 
   /* glb_policy->lb_call and this local lb_call must be consistent at this point
    * because glb_policy->lb_call is only assigned in lb_call_init_locked as part
@@ -1005,9 +1004,9 @@
     glb_policy->fallback_timer_active = false;
   }
 
-  pending_pick *pp = glb_policy->pending_picks;
+  pending_pick* pp = glb_policy->pending_picks;
   glb_policy->pending_picks = NULL;
-  pending_ping *pping = glb_policy->pending_pings;
+  pending_ping* pping = glb_policy->pending_pings;
   glb_policy->pending_pings = NULL;
   if (glb_policy->rr_policy != NULL) {
     GRPC_LB_POLICY_UNREF(exec_ctx, glb_policy->rr_policy, "glb_shutdown");
@@ -1025,17 +1024,21 @@
       GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel Shutdown"), "glb_shutdown");
 
   while (pp != NULL) {
-    pending_pick *next = pp->next;
+    pending_pick* next = pp->next;
     *pp->target = NULL;
-    GRPC_CLOSURE_SCHED(exec_ctx, &pp->wrapped_on_complete_arg.wrapper_closure,
-                       GRPC_ERROR_NONE);
+    GRPC_CLOSURE_SCHED(
+        exec_ctx, &pp->wrapped_on_complete_arg.wrapper_closure,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel Shutdown"));
+    gpr_free(pp);
     pp = next;
   }
 
   while (pping != NULL) {
-    pending_ping *next = pping->next;
-    GRPC_CLOSURE_SCHED(exec_ctx, &pping->wrapped_notify_arg.wrapper_closure,
-                       GRPC_ERROR_NONE);
+    pending_ping* next = pping->next;
+    GRPC_CLOSURE_SCHED(
+        exec_ctx, &pping->wrapped_notify_arg.wrapper_closure,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel Shutdown"));
+    gpr_free(pping);
     pping = next;
   }
 }
@@ -1050,14 +1053,14 @@
 // - Otherwise, without an RR instance, picks stay pending at this policy's
 //   level (grpclb), inside the glb_policy->pending_picks list. To cancel these,
 //   we invoke the completion closure and set *target to NULL right here.
-static void glb_cancel_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-                                   grpc_connected_subchannel **target,
-                                   grpc_error *error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
-  pending_pick *pp = glb_policy->pending_picks;
+static void glb_cancel_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+                                   grpc_connected_subchannel** target,
+                                   grpc_error* error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)pol;
+  pending_pick* pp = glb_policy->pending_picks;
   glb_policy->pending_picks = NULL;
   while (pp != NULL) {
-    pending_pick *next = pp->next;
+    pending_pick* next = pp->next;
     if (pp->target == target) {
       *target = NULL;
       GRPC_CLOSURE_SCHED(exec_ctx, &pp->wrapped_on_complete_arg.wrapper_closure,
@@ -1086,16 +1089,16 @@
 // - Otherwise, without an RR instance, picks stay pending at this policy's
 //   level (grpclb), inside the glb_policy->pending_picks list. To cancel these,
 //   we invoke the completion closure and set *target to NULL right here.
-static void glb_cancel_picks_locked(grpc_exec_ctx *exec_ctx,
-                                    grpc_lb_policy *pol,
+static void glb_cancel_picks_locked(grpc_exec_ctx* exec_ctx,
+                                    grpc_lb_policy* pol,
                                     uint32_t initial_metadata_flags_mask,
                                     uint32_t initial_metadata_flags_eq,
-                                    grpc_error *error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
-  pending_pick *pp = glb_policy->pending_picks;
+                                    grpc_error* error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)pol;
+  pending_pick* pp = glb_policy->pending_picks;
   glb_policy->pending_picks = NULL;
   while (pp != NULL) {
-    pending_pick *next = pp->next;
+    pending_pick* next = pp->next;
     if ((pp->pick_args.initial_metadata_flags & initial_metadata_flags_mask) ==
         initial_metadata_flags_eq) {
       GRPC_CLOSURE_SCHED(exec_ctx, &pp->wrapped_on_complete_arg.wrapper_closure,
@@ -1115,12 +1118,12 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void lb_on_fallback_timer_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error);
-static void query_for_backends_locked(grpc_exec_ctx *exec_ctx,
-                                      glb_lb_policy *glb_policy);
-static void start_picking_locked(grpc_exec_ctx *exec_ctx,
-                                 glb_lb_policy *glb_policy) {
+static void lb_on_fallback_timer_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error);
+static void query_for_backends_locked(grpc_exec_ctx* exec_ctx,
+                                      glb_lb_policy* glb_policy);
+static void start_picking_locked(grpc_exec_ctx* exec_ctx,
+                                 glb_lb_policy* glb_policy) {
   /* start a timer to fall back */
   if (glb_policy->lb_fallback_timeout_ms > 0 &&
       glb_policy->serverlist == NULL && !glb_policy->fallback_timer_active) {
@@ -1140,18 +1143,18 @@
   query_for_backends_locked(exec_ctx, glb_policy);
 }
 
-static void glb_exit_idle_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
+static void glb_exit_idle_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)pol;
   if (!glb_policy->started_picking) {
     start_picking_locked(exec_ctx, glb_policy);
   }
 }
 
-static int glb_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-                           const grpc_lb_policy_pick_args *pick_args,
-                           grpc_connected_subchannel **target,
-                           grpc_call_context_element *context, void **user_data,
-                           grpc_closure *on_complete) {
+static int glb_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+                           const grpc_lb_policy_pick_args* pick_args,
+                           grpc_connected_subchannel** target,
+                           grpc_call_context_element* context, void** user_data,
+                           grpc_closure* on_complete) {
   if (pick_args->lb_token_mdelem_storage == NULL) {
     *target = NULL;
     GRPC_CLOSURE_SCHED(exec_ctx, on_complete,
@@ -1160,45 +1163,60 @@
                            "won't work without it. Failing"));
     return 0;
   }
-
-  glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
-  bool pick_done;
-
+  glb_lb_policy* glb_policy = (glb_lb_policy*)pol;
+  bool pick_done = false;
   if (glb_policy->rr_policy != NULL) {
-    if (grpc_lb_glb_trace.enabled()) {
-      gpr_log(GPR_INFO, "grpclb %p about to PICK from RR %p",
-              (void *)glb_policy, (void *)glb_policy->rr_policy);
+    const grpc_connectivity_state rr_connectivity_state =
+        grpc_lb_policy_check_connectivity_locked(exec_ctx,
+                                                 glb_policy->rr_policy, NULL);
+    // The glb_policy->rr_policy may have transitioned to SHUTDOWN but the
+    // callback registered to capture this event
+    // (glb_rr_connectivity_changed_locked) may not have been invoked yet. We
+    // need to make sure we aren't trying to pick from a RR policy instance
+    // that's in shutdown.
+    if (rr_connectivity_state == GRPC_CHANNEL_SHUTDOWN) {
+      if (grpc_lb_glb_trace.enabled()) {
+        gpr_log(GPR_INFO,
+                "grpclb %p NOT picking from from RR %p: RR conn state=%s",
+                (void*)glb_policy, (void*)glb_policy->rr_policy,
+                grpc_connectivity_state_name(rr_connectivity_state));
+      }
+      add_pending_pick(&glb_policy->pending_picks, pick_args, target, context,
+                       on_complete);
+      pick_done = false;
+    } else {  // RR not in shutdown
+      if (grpc_lb_glb_trace.enabled()) {
+        gpr_log(GPR_INFO, "grpclb %p about to PICK from RR %p",
+                (void*)glb_policy, (void*)glb_policy->rr_policy);
+      }
+      GRPC_LB_POLICY_REF(glb_policy->rr_policy, "glb_pick");
+      wrapped_rr_closure_arg* wc_arg =
+          (wrapped_rr_closure_arg*)gpr_zalloc(sizeof(wrapped_rr_closure_arg));
+      GRPC_CLOSURE_INIT(&wc_arg->wrapper_closure, wrapped_rr_closure, wc_arg,
+                        grpc_schedule_on_exec_ctx);
+      wc_arg->rr_policy = glb_policy->rr_policy;
+      wc_arg->target = target;
+      wc_arg->context = context;
+      GPR_ASSERT(glb_policy->client_stats != NULL);
+      wc_arg->client_stats =
+          grpc_grpclb_client_stats_ref(glb_policy->client_stats);
+      wc_arg->wrapped_closure = on_complete;
+      wc_arg->lb_token_mdelem_storage = pick_args->lb_token_mdelem_storage;
+      wc_arg->initial_metadata = pick_args->initial_metadata;
+      wc_arg->free_when_done = wc_arg;
+      pick_done =
+          pick_from_internal_rr_locked(exec_ctx, glb_policy, pick_args,
+                                       false /* force_async */, target, wc_arg);
     }
-    GRPC_LB_POLICY_REF(glb_policy->rr_policy, "glb_pick");
-
-    wrapped_rr_closure_arg *wc_arg =
-        (wrapped_rr_closure_arg *)gpr_zalloc(sizeof(wrapped_rr_closure_arg));
-
-    GRPC_CLOSURE_INIT(&wc_arg->wrapper_closure, wrapped_rr_closure, wc_arg,
-                      grpc_schedule_on_exec_ctx);
-    wc_arg->rr_policy = glb_policy->rr_policy;
-    wc_arg->target = target;
-    wc_arg->context = context;
-    GPR_ASSERT(glb_policy->client_stats != NULL);
-    wc_arg->client_stats =
-        grpc_grpclb_client_stats_ref(glb_policy->client_stats);
-    wc_arg->wrapped_closure = on_complete;
-    wc_arg->lb_token_mdelem_storage = pick_args->lb_token_mdelem_storage;
-    wc_arg->initial_metadata = pick_args->initial_metadata;
-    wc_arg->free_when_done = wc_arg;
-    pick_done =
-        pick_from_internal_rr_locked(exec_ctx, glb_policy, pick_args,
-                                     false /* force_async */, target, wc_arg);
-  } else {
+  } else {  // glb_policy->rr_policy == NULL
     if (grpc_lb_glb_trace.enabled()) {
       gpr_log(GPR_DEBUG,
               "No RR policy in grpclb instance %p. Adding to grpclb's pending "
               "picks",
-              (void *)(glb_policy));
+              (void*)(glb_policy));
     }
     add_pending_pick(&glb_policy->pending_picks, pick_args, target, context,
                      on_complete);
-
     if (!glb_policy->started_picking) {
       start_picking_locked(exec_ctx, glb_policy);
     }
@@ -1208,16 +1226,16 @@
 }
 
 static grpc_connectivity_state glb_check_connectivity_locked(
-    grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-    grpc_error **connectivity_error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+    grpc_error** connectivity_error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)pol;
   return grpc_connectivity_state_get(&glb_policy->state_tracker,
                                      connectivity_error);
 }
 
-static void glb_ping_one_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-                                grpc_closure *closure) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
+static void glb_ping_one_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+                                grpc_closure* closure) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)pol;
   if (glb_policy->rr_policy) {
     grpc_lb_policy_ping_one_locked(exec_ctx, glb_policy->rr_policy, closure);
   } else {
@@ -1228,23 +1246,23 @@
   }
 }
 
-static void glb_notify_on_state_change_locked(grpc_exec_ctx *exec_ctx,
-                                              grpc_lb_policy *pol,
-                                              grpc_connectivity_state *current,
-                                              grpc_closure *notify) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)pol;
+static void glb_notify_on_state_change_locked(grpc_exec_ctx* exec_ctx,
+                                              grpc_lb_policy* pol,
+                                              grpc_connectivity_state* current,
+                                              grpc_closure* notify) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)pol;
   grpc_connectivity_state_notify_on_state_change(
       exec_ctx, &glb_policy->state_tracker, current, notify);
 }
 
-static void lb_call_on_retry_timer_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                          grpc_error *error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)arg;
+static void lb_call_on_retry_timer_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                          grpc_error* error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)arg;
   glb_policy->retry_timer_active = false;
   if (!glb_policy->shutting_down && error == GRPC_ERROR_NONE) {
     if (grpc_lb_glb_trace.enabled()) {
       gpr_log(GPR_INFO, "Restaring call to LB server (grpclb %p)",
-              (void *)glb_policy);
+              (void*)glb_policy);
     }
     GPR_ASSERT(glb_policy->lb_call == NULL);
     query_for_backends_locked(exec_ctx, glb_policy);
@@ -1252,8 +1270,8 @@
   GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &glb_policy->base, "grpclb_retry_timer");
 }
 
-static void maybe_restart_lb_call(grpc_exec_ctx *exec_ctx,
-                                  glb_lb_policy *glb_policy) {
+static void maybe_restart_lb_call(grpc_exec_ctx* exec_ctx,
+                                  glb_lb_policy* glb_policy) {
   if (glb_policy->started_picking && glb_policy->updating_lb_call) {
     if (glb_policy->retry_timer_active) {
       grpc_timer_cancel(exec_ctx, &glb_policy->lb_call_retry_timer);
@@ -1263,10 +1281,11 @@
   } else if (!glb_policy->shutting_down) {
     /* if we aren't shutting down, restart the LB client call after some time */
     grpc_millis next_try =
-        grpc_backoff_step(exec_ctx, &glb_policy->lb_call_backoff_state);
+        grpc_backoff_step(exec_ctx, &glb_policy->lb_call_backoff_state)
+            .next_attempt_start_time;
     if (grpc_lb_glb_trace.enabled()) {
       gpr_log(GPR_DEBUG, "Connection to LB server lost (grpclb: %p)...",
-              (void *)glb_policy);
+              (void*)glb_policy);
       grpc_millis timeout = next_try - grpc_exec_ctx_now(exec_ctx);
       if (timeout > 0) {
         gpr_log(GPR_DEBUG, "... retry_timer_active in %" PRIdPTR "ms.",
@@ -1287,11 +1306,11 @@
                             "lb_on_server_status_received_locked");
 }
 
-static void send_client_load_report_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error);
+static void send_client_load_report_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error);
 
-static void schedule_next_client_load_report(grpc_exec_ctx *exec_ctx,
-                                             glb_lb_policy *glb_policy) {
+static void schedule_next_client_load_report(grpc_exec_ctx* exec_ctx,
+                                             glb_lb_policy* glb_policy) {
   const grpc_millis next_client_load_report_time =
       grpc_exec_ctx_now(exec_ctx) + glb_policy->client_stats_report_interval;
   GRPC_CLOSURE_INIT(&glb_policy->client_load_report_closure,
@@ -1302,9 +1321,9 @@
                   &glb_policy->client_load_report_closure);
 }
 
-static void client_load_report_done_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)arg;
+static void client_load_report_done_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)arg;
   grpc_byte_buffer_destroy(glb_policy->client_load_report_payload);
   glb_policy->client_load_report_payload = NULL;
   if (error != GRPC_ERROR_NONE || glb_policy->lb_call == NULL) {
@@ -1316,9 +1335,9 @@
   schedule_next_client_load_report(exec_ctx, glb_policy);
 }
 
-static bool load_report_counters_are_zero(grpc_grpclb_request *request) {
-  grpc_grpclb_dropped_call_counts *drop_entries =
-      (grpc_grpclb_dropped_call_counts *)
+static bool load_report_counters_are_zero(grpc_grpclb_request* request) {
+  grpc_grpclb_dropped_call_counts* drop_entries =
+      (grpc_grpclb_dropped_call_counts*)
           request->client_stats.calls_finished_with_drop.arg;
   return request->client_stats.num_calls_started == 0 &&
          request->client_stats.num_calls_finished == 0 &&
@@ -1328,9 +1347,9 @@
          (drop_entries == NULL || drop_entries->num_entries == 0);
 }
 
-static void send_client_load_report_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)arg;
+static void send_client_load_report_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)arg;
   if (error == GRPC_ERROR_CANCELLED || glb_policy->lb_call == NULL) {
     glb_policy->client_load_report_timer_pending = false;
     GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &glb_policy->base,
@@ -1342,7 +1361,7 @@
   }
   // Construct message payload.
   GPR_ASSERT(glb_policy->client_load_report_payload == NULL);
-  grpc_grpclb_request *request =
+  grpc_grpclb_request* request =
       grpc_grpclb_load_report_request_create_locked(glb_policy->client_stats);
   // Skip client load report if the counters were all zero in the last
   // report and they are still zero in this one.
@@ -1378,12 +1397,12 @@
   }
 }
 
-static void lb_on_server_status_received_locked(grpc_exec_ctx *exec_ctx,
-                                                void *arg, grpc_error *error);
-static void lb_on_response_received_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error);
-static void lb_call_init_locked(grpc_exec_ctx *exec_ctx,
-                                glb_lb_policy *glb_policy) {
+static void lb_on_server_status_received_locked(grpc_exec_ctx* exec_ctx,
+                                                void* arg, grpc_error* error);
+static void lb_on_response_received_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error);
+static void lb_call_init_locked(grpc_exec_ctx* exec_ctx,
+                                glb_lb_policy* glb_policy) {
   GPR_ASSERT(glb_policy->server_name != NULL);
   GPR_ASSERT(glb_policy->server_name[0] != '\0');
   GPR_ASSERT(glb_policy->lb_call == NULL);
@@ -1412,7 +1431,7 @@
   grpc_metadata_array_init(&glb_policy->lb_initial_metadata_recv);
   grpc_metadata_array_init(&glb_policy->lb_trailing_metadata_recv);
 
-  grpc_grpclb_request *request =
+  grpc_grpclb_request* request =
       grpc_grpclb_request_create(glb_policy->server_name);
   grpc_slice request_payload_slice = grpc_grpclb_request_encode(request);
   glb_policy->lb_request_payload =
@@ -1428,7 +1447,7 @@
                     grpc_combiner_scheduler(glb_policy->base.combiner));
 
   grpc_backoff_init(&glb_policy->lb_call_backoff_state,
-                    GRPC_GRPCLB_INITIAL_CONNECT_BACKOFF_SECONDS,
+                    GRPC_GRPCLB_INITIAL_CONNECT_BACKOFF_SECONDS * 1000,
                     GRPC_GRPCLB_RECONNECT_BACKOFF_MULTIPLIER,
                     GRPC_GRPCLB_RECONNECT_JITTER,
                     GRPC_GRPCLB_MIN_CONNECT_TIMEOUT_SECONDS * 1000,
@@ -1438,8 +1457,8 @@
   glb_policy->last_client_load_report_counters_were_zero = false;
 }
 
-static void lb_call_destroy_locked(grpc_exec_ctx *exec_ctx,
-                                   glb_lb_policy *glb_policy) {
+static void lb_call_destroy_locked(grpc_exec_ctx* exec_ctx,
+                                   glb_lb_policy* glb_policy) {
   GPR_ASSERT(glb_policy->lb_call != NULL);
   grpc_call_unref(glb_policy->lb_call);
   glb_policy->lb_call = NULL;
@@ -1458,8 +1477,8 @@
 /*
  * Auxiliary functions and LB client callbacks.
  */
-static void query_for_backends_locked(grpc_exec_ctx *exec_ctx,
-                                      glb_lb_policy *glb_policy) {
+static void query_for_backends_locked(grpc_exec_ctx* exec_ctx,
+                                      glb_lb_policy* glb_policy) {
   GPR_ASSERT(glb_policy->lb_channel != NULL);
   if (glb_policy->shutting_down) return;
 
@@ -1468,8 +1487,8 @@
   if (grpc_lb_glb_trace.enabled()) {
     gpr_log(GPR_INFO,
             "Query for backends (grpclb: %p, lb_channel: %p, lb_call: %p)",
-            (void *)glb_policy, (void *)glb_policy->lb_channel,
-            (void *)glb_policy->lb_call);
+            (void*)glb_policy, (void*)glb_policy->lb_channel,
+            (void*)glb_policy->lb_call);
   }
   GPR_ASSERT(glb_policy->lb_call != NULL);
 
@@ -1477,7 +1496,7 @@
   grpc_op ops[3];
   memset(ops, 0, sizeof(ops));
 
-  grpc_op *op = ops;
+  grpc_op* op = ops;
   op->op = GRPC_OP_SEND_INITIAL_METADATA;
   op->data.send_initial_metadata.count = 0;
   op->flags = 0;
@@ -1533,12 +1552,12 @@
   GPR_ASSERT(GRPC_CALL_OK == call_error);
 }
 
-static void lb_on_response_received_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)arg;
+static void lb_on_response_received_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)arg;
   grpc_op ops[2];
   memset(ops, 0, sizeof(ops));
-  grpc_op *op = ops;
+  grpc_op* op = ops;
   if (glb_policy->lb_response_payload != NULL) {
     grpc_backoff_reset(&glb_policy->lb_call_backoff_state);
     /* Received data from the LB server. Look inside
@@ -1549,7 +1568,7 @@
     grpc_byte_buffer_reader_destroy(&bbr);
     grpc_byte_buffer_destroy(glb_policy->lb_response_payload);
 
-    grpc_grpclb_initial_response *response = NULL;
+    grpc_grpclb_initial_response* response = NULL;
     if (!glb_policy->seen_initial_response &&
         (response = grpc_grpclb_initial_response_parse(response_slice)) !=
             NULL) {
@@ -1577,7 +1596,7 @@
       grpc_grpclb_initial_response_destroy(response);
       glb_policy->seen_initial_response = true;
     } else {
-      grpc_grpclb_serverlist *serverlist =
+      grpc_grpclb_serverlist* serverlist =
           grpc_grpclb_response_parse_serverlist(response_slice);
       if (serverlist != NULL) {
         GPR_ASSERT(glb_policy->lb_call != NULL);
@@ -1587,7 +1606,7 @@
           for (size_t i = 0; i < serverlist->num_servers; ++i) {
             grpc_resolved_address addr;
             parse_server(serverlist->servers[i], &addr);
-            char *ipport;
+            char* ipport;
             grpc_sockaddr_to_string(&ipport, &addr, false);
             gpr_log(GPR_INFO, "Serverlist[%lu]: %s", (unsigned long)i, ipport);
             gpr_free(ipport);
@@ -1660,9 +1679,9 @@
   }
 }
 
-static void lb_on_fallback_timer_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)arg;
+static void lb_on_fallback_timer_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)arg;
   glb_policy->fallback_timer_active = false;
   /* If we receive a serverlist after the timer fires but before this callback
    * actually runs, don't fall back. */
@@ -1671,7 +1690,7 @@
       if (grpc_lb_glb_trace.enabled()) {
         gpr_log(GPR_INFO,
                 "Falling back to use backends from resolver (grpclb %p)",
-                (void *)glb_policy);
+                (void*)glb_policy);
       }
       GPR_ASSERT(glb_policy->fallback_backend_addresses != NULL);
       rr_handover_locked(exec_ctx, glb_policy);
@@ -1681,18 +1700,18 @@
                             "grpclb_fallback_timer");
 }
 
-static void lb_on_server_status_received_locked(grpc_exec_ctx *exec_ctx,
-                                                void *arg, grpc_error *error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)arg;
+static void lb_on_server_status_received_locked(grpc_exec_ctx* exec_ctx,
+                                                void* arg, grpc_error* error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)arg;
   GPR_ASSERT(glb_policy->lb_call != NULL);
   if (grpc_lb_glb_trace.enabled()) {
-    char *status_details =
+    char* status_details =
         grpc_slice_to_c_string(glb_policy->lb_call_status_details);
     gpr_log(GPR_INFO,
             "Status from LB server received. Status = %d, Details = '%s', "
             "(call: %p), error %p",
             glb_policy->lb_call_status, status_details,
-            (void *)glb_policy->lb_call, (void *)error);
+            (void*)glb_policy->lb_call, (void*)error);
     gpr_free(status_details);
   }
   /* We need to perform cleanups no matter what. */
@@ -1705,9 +1724,9 @@
   }
 }
 
-static void fallback_update_locked(grpc_exec_ctx *exec_ctx,
-                                   glb_lb_policy *glb_policy,
-                                   const grpc_lb_addresses *addresses) {
+static void fallback_update_locked(grpc_exec_ctx* exec_ctx,
+                                   glb_lb_policy* glb_policy,
+                                   const grpc_lb_addresses* addresses) {
   GPR_ASSERT(glb_policy->fallback_backend_addresses != NULL);
   grpc_lb_addresses_destroy(exec_ctx, glb_policy->fallback_backend_addresses);
   glb_policy->fallback_backend_addresses =
@@ -1718,10 +1737,10 @@
   }
 }
 
-static void glb_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                              const grpc_lb_policy_args *args) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)policy;
-  const grpc_arg *arg =
+static void glb_update_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                              const grpc_lb_policy_args* args) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)policy;
+  const grpc_arg* arg =
       grpc_channel_args_find(args->args, GRPC_ARG_LB_ADDRESSES);
   if (arg == NULL || arg->type != GRPC_ARG_POINTER) {
     if (glb_policy->lb_channel == NULL) {
@@ -1736,12 +1755,12 @@
       gpr_log(GPR_ERROR,
               "No valid LB addresses channel arg for grpclb %p update, "
               "ignoring.",
-              (void *)glb_policy);
+              (void*)glb_policy);
     }
     return;
   }
-  const grpc_lb_addresses *addresses =
-      (const grpc_lb_addresses *)arg->value.pointer.p;
+  const grpc_lb_addresses* addresses =
+      (const grpc_lb_addresses*)arg->value.pointer.p;
   // If a non-empty serverlist hasn't been received from the balancer,
   // propagate the update to fallback_backend_addresses.
   if (glb_policy->serverlist == NULL) {
@@ -1750,7 +1769,7 @@
   GPR_ASSERT(glb_policy->lb_channel != NULL);
   // Propagate updates to the LB channel (pick_first) through the fake
   // resolver.
-  grpc_channel_args *lb_channel_args = build_lb_channel_args(
+  grpc_channel_args* lb_channel_args = build_lb_channel_args(
       exec_ctx, addresses, glb_policy->response_generator, args->args);
   grpc_fake_resolver_response_generator_set_response(
       exec_ctx, glb_policy->response_generator, lb_channel_args);
@@ -1760,7 +1779,7 @@
   if (!glb_policy->watching_lb_channel) {
     glb_policy->lb_channel_connectivity = grpc_channel_check_connectivity_state(
         glb_policy->lb_channel, true /* try to connect */);
-    grpc_channel_element *client_channel_elem = grpc_channel_stack_last_element(
+    grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(
         grpc_channel_get_channel_stack(glb_policy->lb_channel));
     GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
     glb_policy->watching_lb_channel = true;
@@ -1777,20 +1796,19 @@
 // Invoked as part of the update process. It continues watching the LB channel
 // until it shuts down or becomes READY. It's invoked even if the LB channel
 // stayed READY throughout the update (for example if the update is identical).
-static void glb_lb_channel_on_connectivity_changed_cb(grpc_exec_ctx *exec_ctx,
-                                                      void *arg,
-                                                      grpc_error *error) {
-  glb_lb_policy *glb_policy = (glb_lb_policy *)arg;
+static void glb_lb_channel_on_connectivity_changed_cb(grpc_exec_ctx* exec_ctx,
+                                                      void* arg,
+                                                      grpc_error* error) {
+  glb_lb_policy* glb_policy = (glb_lb_policy*)arg;
   if (glb_policy->shutting_down) goto done;
   // Re-initialize the lb_call. This should also take care of updating the
   // embedded RR policy. Note that the current RR policy, if any, will stay in
   // effect until an update from the new lb_call is received.
   switch (glb_policy->lb_channel_connectivity) {
-    case GRPC_CHANNEL_INIT:
     case GRPC_CHANNEL_CONNECTING:
     case GRPC_CHANNEL_TRANSIENT_FAILURE: {
       /* resub. */
-      grpc_channel_element *client_channel_elem =
+      grpc_channel_element* client_channel_elem =
           grpc_channel_stack_last_element(
               grpc_channel_get_channel_stack(glb_policy->lb_channel));
       GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
@@ -1803,9 +1821,8 @@
       break;
     }
     case GRPC_CHANNEL_IDLE:
-      // lb channel inactive (probably shutdown prior to update). Restart lb
-      // call to kick the lb channel into gear.
-      GPR_ASSERT(glb_policy->lb_call == NULL);
+    // lb channel inactive (probably shutdown prior to update). Restart lb
+    // call to kick the lb channel into gear.
     /* fallthrough */
     case GRPC_CHANNEL_READY:
       if (glb_policy->lb_call != NULL) {
@@ -1843,29 +1860,29 @@
     glb_notify_on_state_change_locked,
     glb_update_locked};
 
-static grpc_lb_policy *glb_create(grpc_exec_ctx *exec_ctx,
-                                  grpc_lb_policy_factory *factory,
-                                  grpc_lb_policy_args *args) {
+static grpc_lb_policy* glb_create(grpc_exec_ctx* exec_ctx,
+                                  grpc_lb_policy_factory* factory,
+                                  grpc_lb_policy_args* args) {
   /* Count the number of gRPC-LB addresses. There must be at least one. */
-  const grpc_arg *arg =
+  const grpc_arg* arg =
       grpc_channel_args_find(args->args, GRPC_ARG_LB_ADDRESSES);
   if (arg == NULL || arg->type != GRPC_ARG_POINTER) {
     return NULL;
   }
-  grpc_lb_addresses *addresses = (grpc_lb_addresses *)arg->value.pointer.p;
+  grpc_lb_addresses* addresses = (grpc_lb_addresses*)arg->value.pointer.p;
   size_t num_grpclb_addrs = 0;
   for (size_t i = 0; i < addresses->num_addresses; ++i) {
     if (addresses->addresses[i].is_balancer) ++num_grpclb_addrs;
   }
   if (num_grpclb_addrs == 0) return NULL;
 
-  glb_lb_policy *glb_policy = (glb_lb_policy *)gpr_zalloc(sizeof(*glb_policy));
+  glb_lb_policy* glb_policy = (glb_lb_policy*)gpr_zalloc(sizeof(*glb_policy));
 
   /* Get server name. */
   arg = grpc_channel_args_find(args->args, GRPC_ARG_SERVER_URI);
   GPR_ASSERT(arg != NULL);
   GPR_ASSERT(arg->type == GRPC_ARG_STRING);
-  grpc_uri *uri = grpc_uri_parse(exec_ctx, arg->value.string, true);
+  grpc_uri* uri = grpc_uri_parse(exec_ctx, arg->value.string, true);
   GPR_ASSERT(uri->path[0] != '\0');
   glb_policy->server_name =
       gpr_strdup(uri->path[0] == '/' ? uri->path + 1 : uri->path);
@@ -1889,8 +1906,8 @@
   // Make sure that GRPC_ARG_LB_POLICY_NAME is set in channel args,
   // since we use this to trigger the client_load_reporting filter.
   grpc_arg new_arg = grpc_channel_arg_string_create(
-      (char *)GRPC_ARG_LB_POLICY_NAME, (char *)"grpclb");
-  static const char *args_to_remove[] = {GRPC_ARG_LB_POLICY_NAME};
+      (char*)GRPC_ARG_LB_POLICY_NAME, (char*)"grpclb");
+  static const char* args_to_remove[] = {GRPC_ARG_LB_POLICY_NAME};
   glb_policy->args = grpc_channel_args_copy_and_add_and_remove(
       args->args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), &new_arg, 1);
 
@@ -1902,9 +1919,9 @@
   /* Create a client channel over them to communicate with a LB service */
   glb_policy->response_generator =
       grpc_fake_resolver_response_generator_create();
-  grpc_channel_args *lb_channel_args = build_lb_channel_args(
+  grpc_channel_args* lb_channel_args = build_lb_channel_args(
       exec_ctx, addresses, glb_policy->response_generator, args->args);
-  char *uri_str;
+  char* uri_str;
   gpr_asprintf(&uri_str, "fake:///%s", glb_policy->server_name);
   glb_policy->lb_channel = grpc_lb_policy_grpclb_create_lb_channel(
       exec_ctx, uri_str, args->client_channel_factory, lb_channel_args);
@@ -1915,7 +1932,7 @@
   grpc_channel_args_destroy(exec_ctx, lb_channel_args);
   gpr_free(uri_str);
   if (glb_policy->lb_channel == NULL) {
-    gpr_free((void *)glb_policy->server_name);
+    gpr_free((void*)glb_policy->server_name);
     grpc_channel_args_destroy(exec_ctx, glb_policy->args);
     gpr_free(glb_policy);
     return NULL;
@@ -1930,16 +1947,16 @@
   return &glb_policy->base;
 }
 
-static void glb_factory_ref(grpc_lb_policy_factory *factory) {}
+static void glb_factory_ref(grpc_lb_policy_factory* factory) {}
 
-static void glb_factory_unref(grpc_lb_policy_factory *factory) {}
+static void glb_factory_unref(grpc_lb_policy_factory* factory) {}
 
 static const grpc_lb_policy_factory_vtable glb_factory_vtable = {
     glb_factory_ref, glb_factory_unref, glb_create, "grpclb"};
 
 static grpc_lb_policy_factory glb_lb_policy_factory = {&glb_factory_vtable};
 
-grpc_lb_policy_factory *grpc_glb_lb_factory_create() {
+grpc_lb_policy_factory* grpc_glb_lb_factory_create() {
   return &glb_lb_policy_factory;
 }
 
@@ -1947,29 +1964,25 @@
 
 // Only add client_load_reporting filter if the grpclb LB policy is used.
 static bool maybe_add_client_load_reporting_filter(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder, void *arg) {
-  const grpc_channel_args *args =
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder, void* arg) {
+  const grpc_channel_args* args =
       grpc_channel_stack_builder_get_channel_arguments(builder);
-  const grpc_arg *channel_arg =
+  const grpc_arg* channel_arg =
       grpc_channel_args_find(args, GRPC_ARG_LB_POLICY_NAME);
   if (channel_arg != NULL && channel_arg->type == GRPC_ARG_STRING &&
       strcmp(channel_arg->value.string, "grpclb") == 0) {
     return grpc_channel_stack_builder_append_filter(
-        builder, (const grpc_channel_filter *)arg, NULL, NULL);
+        builder, (const grpc_channel_filter*)arg, NULL, NULL);
   }
   return true;
 }
 
 extern "C" void grpc_lb_policy_grpclb_init() {
   grpc_register_lb_policy(grpc_glb_lb_factory_create());
-
-#ifndef NDEBUG
-
-#endif
   grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
                                    GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
                                    maybe_add_client_load_reporting_filter,
-                                   (void *)&grpc_client_load_reporting_filter);
+                                   (void*)&grpc_client_load_reporting_filter);
 }
 
 extern "C" void grpc_lb_policy_grpclb_shutdown() {}
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
index 15c8a68..b6135a4 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
@@ -28,7 +28,7 @@
 /** Returns a load balancing factory for the glb policy, which tries to connect
  * to a load balancing server to decide the next successfully connected
  * subchannel to pick. */
-grpc_lb_policy_factory *grpc_glb_lb_factory_create();
+grpc_lb_policy_factory* grpc_glb_lb_factory_create();
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
index f296718..aacaec1 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
@@ -25,20 +25,20 @@
 #include "src/core/lib/iomgr/sockaddr_utils.h"
 #include "src/core/lib/support/string.h"
 
-grpc_channel *grpc_lb_policy_grpclb_create_lb_channel(
-    grpc_exec_ctx *exec_ctx, const char *lb_service_target_addresses,
-    grpc_client_channel_factory *client_channel_factory,
-    grpc_channel_args *args) {
-  grpc_channel *lb_channel = grpc_client_channel_factory_create_channel(
+grpc_channel* grpc_lb_policy_grpclb_create_lb_channel(
+    grpc_exec_ctx* exec_ctx, const char* lb_service_target_addresses,
+    grpc_client_channel_factory* client_channel_factory,
+    grpc_channel_args* args) {
+  grpc_channel* lb_channel = grpc_client_channel_factory_create_channel(
       exec_ctx, client_channel_factory, lb_service_target_addresses,
       GRPC_CLIENT_CHANNEL_TYPE_LOAD_BALANCING, args);
   return lb_channel;
 }
 
-grpc_channel_args *grpc_lb_policy_grpclb_build_lb_channel_args(
-    grpc_exec_ctx *exec_ctx, grpc_slice_hash_table *targets_info,
-    grpc_fake_resolver_response_generator *response_generator,
-    const grpc_channel_args *args) {
+grpc_channel_args* grpc_lb_policy_grpclb_build_lb_channel_args(
+    grpc_exec_ctx* exec_ctx, grpc_slice_hash_table* targets_info,
+    grpc_fake_resolver_response_generator* response_generator,
+    const grpc_channel_args* args) {
   const grpc_arg to_add[] = {
       grpc_fake_resolver_response_generator_arg(response_generator)};
   /* We remove:
@@ -62,7 +62,7 @@
    *
    * - The fake resolver generator, because we are replacing it with the one
    *   from the grpclb policy, used to propagate updates to the LB channel. */
-  static const char *keys_to_remove[] = {
+  static const char* keys_to_remove[] = {
       GRPC_ARG_LB_POLICY_NAME, GRPC_ARG_LB_ADDRESSES, GRPC_ARG_SERVER_URI,
       GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR};
   return grpc_channel_args_copy_and_add_and_remove(
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
index e8599d1..39cbf53 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
@@ -34,19 +34,19 @@
  * from resolving the LB service's name (eg, ipv4:10.0.0.1:1234,10.2.3.4:9876).
  * \a client_channel_factory will be used for the creation of the LB channel,
  * alongside the channel args passed in \a args. */
-grpc_channel *grpc_lb_policy_grpclb_create_lb_channel(
-    grpc_exec_ctx *exec_ctx, const char *lb_service_target_addresses,
-    grpc_client_channel_factory *client_channel_factory,
-    grpc_channel_args *args);
+grpc_channel* grpc_lb_policy_grpclb_create_lb_channel(
+    grpc_exec_ctx* exec_ctx, const char* lb_service_target_addresses,
+    grpc_client_channel_factory* client_channel_factory,
+    grpc_channel_args* args);
 
-grpc_channel_args *grpc_lb_policy_grpclb_build_lb_channel_args(
-    grpc_exec_ctx *exec_ctx, grpc_slice_hash_table *targets_info,
-    grpc_fake_resolver_response_generator *response_generator,
-    const grpc_channel_args *args);
+grpc_channel_args* grpc_lb_policy_grpclb_build_lb_channel_args(
+    grpc_exec_ctx* exec_ctx, grpc_slice_hash_table* targets_info,
+    grpc_fake_resolver_response_generator* response_generator,
+    const grpc_channel_args* args);
 
 #ifdef __cplusplus
 }
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CHANNEL_H \
-          */
+        */
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
index 2681b2a..2dcf29f 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
@@ -28,19 +28,19 @@
 #include "src/core/lib/slice/slice_internal.h"
 #include "src/core/lib/support/string.h"
 
-grpc_channel *grpc_lb_policy_grpclb_create_lb_channel(
-    grpc_exec_ctx *exec_ctx, const char *lb_service_target_addresses,
-    grpc_client_channel_factory *client_channel_factory,
-    grpc_channel_args *args) {
-  grpc_channel_args *new_args = args;
-  grpc_channel_credentials *channel_credentials =
+grpc_channel* grpc_lb_policy_grpclb_create_lb_channel(
+    grpc_exec_ctx* exec_ctx, const char* lb_service_target_addresses,
+    grpc_client_channel_factory* client_channel_factory,
+    grpc_channel_args* args) {
+  grpc_channel_args* new_args = args;
+  grpc_channel_credentials* channel_credentials =
       grpc_channel_credentials_find_in_args(args);
   if (channel_credentials != NULL) {
     /* Substitute the channel credentials with a version without call
      * credentials: the load balancer is not necessarily trusted to handle
      * bearer token credentials */
-    static const char *keys_to_remove[] = {GRPC_ARG_CHANNEL_CREDENTIALS};
-    grpc_channel_credentials *creds_sans_call_creds =
+    static const char* keys_to_remove[] = {GRPC_ARG_CHANNEL_CREDENTIALS};
+    grpc_channel_credentials* creds_sans_call_creds =
         grpc_channel_credentials_duplicate_without_call_credentials(
             channel_credentials);
     GPR_ASSERT(creds_sans_call_creds != NULL);
@@ -52,7 +52,7 @@
         GPR_ARRAY_SIZE(args_to_add));
     grpc_channel_credentials_unref(exec_ctx, creds_sans_call_creds);
   }
-  grpc_channel *lb_channel = grpc_client_channel_factory_create_channel(
+  grpc_channel* lb_channel = grpc_client_channel_factory_create_channel(
       exec_ctx, client_channel_factory, lb_service_target_addresses,
       GRPC_CLIENT_CHANNEL_TYPE_LOAD_BALANCING, new_args);
   if (channel_credentials != NULL) {
@@ -61,10 +61,10 @@
   return lb_channel;
 }
 
-grpc_channel_args *grpc_lb_policy_grpclb_build_lb_channel_args(
-    grpc_exec_ctx *exec_ctx, grpc_slice_hash_table *targets_info,
-    grpc_fake_resolver_response_generator *response_generator,
-    const grpc_channel_args *args) {
+grpc_channel_args* grpc_lb_policy_grpclb_build_lb_channel_args(
+    grpc_exec_ctx* exec_ctx, grpc_slice_hash_table* targets_info,
+    grpc_fake_resolver_response_generator* response_generator,
+    const grpc_channel_args* args) {
   const grpc_arg to_add[] = {
       grpc_lb_targets_info_create_channel_arg(targets_info),
       grpc_fake_resolver_response_generator_arg(response_generator)};
@@ -89,7 +89,7 @@
    *
    * - The fake resolver generator, because we are replacing it with the one
    *   from the grpclb policy, used to propagate updates to the LB channel. */
-  static const char *keys_to_remove[] = {
+  static const char* keys_to_remove[] = {
       GRPC_ARG_LB_POLICY_NAME, GRPC_ARG_LB_ADDRESSES, GRPC_ARG_SERVER_URI,
       GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR};
   /* Add the targets info table to be used for secure naming */
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
index b38c076..ce88cf9 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
@@ -70,4 +70,4 @@
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H \
-          */
+        */
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
index 4d5fb20..87d7336 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
@@ -23,9 +23,9 @@
 #include <grpc/support/alloc.h>
 
 /* invoked once for every Server in ServerList */
-static bool count_serverlist(pb_istream_t *stream, const pb_field_t *field,
-                             void **arg) {
-  grpc_grpclb_serverlist *sl = (grpc_grpclb_serverlist *)*arg;
+static bool count_serverlist(pb_istream_t* stream, const pb_field_t* field,
+                             void** arg) {
+  grpc_grpclb_serverlist* sl = (grpc_grpclb_serverlist*)*arg;
   grpc_grpclb_server server;
   if (!pb_decode(stream, grpc_lb_v1_Server_fields, &server)) {
     gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(stream));
@@ -40,16 +40,16 @@
    * which index of the serverlist are we currently decoding */
   size_t decoding_idx;
   /* The decoded serverlist */
-  grpc_grpclb_serverlist *serverlist;
+  grpc_grpclb_serverlist* serverlist;
 } decode_serverlist_arg;
 
 /* invoked once for every Server in ServerList */
-static bool decode_serverlist(pb_istream_t *stream, const pb_field_t *field,
-                              void **arg) {
-  decode_serverlist_arg *dec_arg = (decode_serverlist_arg *)*arg;
+static bool decode_serverlist(pb_istream_t* stream, const pb_field_t* field,
+                              void** arg) {
+  decode_serverlist_arg* dec_arg = (decode_serverlist_arg*)*arg;
   GPR_ASSERT(dec_arg->serverlist->num_servers >= dec_arg->decoding_idx);
-  grpc_grpclb_server *server =
-      (grpc_grpclb_server *)gpr_zalloc(sizeof(grpc_grpclb_server));
+  grpc_grpclb_server* server =
+      (grpc_grpclb_server*)gpr_zalloc(sizeof(grpc_grpclb_server));
   if (!pb_decode(stream, grpc_lb_v1_Server_fields, server)) {
     gpr_free(server);
     gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(stream));
@@ -59,9 +59,9 @@
   return true;
 }
 
-grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name) {
-  grpc_grpclb_request *req =
-      (grpc_grpclb_request *)gpr_malloc(sizeof(grpc_grpclb_request));
+grpc_grpclb_request* grpc_grpclb_request_create(const char* lb_service_name) {
+  grpc_grpclb_request* req =
+      (grpc_grpclb_request*)gpr_malloc(sizeof(grpc_grpclb_request));
   req->has_client_stats = false;
   req->has_initial_request = true;
   req->initial_request.has_name = true;
@@ -71,24 +71,24 @@
 }
 
 static void populate_timestamp(gpr_timespec timestamp,
-                               struct _grpc_lb_v1_Timestamp *timestamp_pb) {
+                               struct _grpc_lb_v1_Timestamp* timestamp_pb) {
   timestamp_pb->has_seconds = true;
   timestamp_pb->seconds = timestamp.tv_sec;
   timestamp_pb->has_nanos = true;
   timestamp_pb->nanos = timestamp.tv_nsec;
 }
 
-static bool encode_string(pb_ostream_t *stream, const pb_field_t *field,
-                          void *const *arg) {
-  char *str = (char *)*arg;
+static bool encode_string(pb_ostream_t* stream, const pb_field_t* field,
+                          void* const* arg) {
+  char* str = (char*)*arg;
   if (!pb_encode_tag_for_field(stream, field)) return false;
-  return pb_encode_string(stream, (uint8_t *)str, strlen(str));
+  return pb_encode_string(stream, (uint8_t*)str, strlen(str));
 }
 
-static bool encode_drops(pb_ostream_t *stream, const pb_field_t *field,
-                         void *const *arg) {
-  grpc_grpclb_dropped_call_counts *drop_entries =
-      (grpc_grpclb_dropped_call_counts *)*arg;
+static bool encode_drops(pb_ostream_t* stream, const pb_field_t* field,
+                         void* const* arg) {
+  grpc_grpclb_dropped_call_counts* drop_entries =
+      (grpc_grpclb_dropped_call_counts*)*arg;
   if (drop_entries == NULL) return true;
   for (size_t i = 0; i < drop_entries->num_entries; ++i) {
     if (!pb_encode_tag_for_field(stream, field)) return false;
@@ -105,10 +105,10 @@
   return true;
 }
 
-grpc_grpclb_request *grpc_grpclb_load_report_request_create_locked(
-    grpc_grpclb_client_stats *client_stats) {
-  grpc_grpclb_request *req =
-      (grpc_grpclb_request *)gpr_zalloc(sizeof(grpc_grpclb_request));
+grpc_grpclb_request* grpc_grpclb_load_report_request_create_locked(
+    grpc_grpclb_client_stats* client_stats) {
+  grpc_grpclb_request* req =
+      (grpc_grpclb_request*)gpr_zalloc(sizeof(grpc_grpclb_request));
   req->has_client_stats = true;
   req->client_stats.has_timestamp = true;
   populate_timestamp(gpr_now(GPR_CLOCK_REALTIME), &req->client_stats.timestamp);
@@ -123,12 +123,12 @@
       &req->client_stats.num_calls_finished,
       &req->client_stats.num_calls_finished_with_client_failed_to_send,
       &req->client_stats.num_calls_finished_known_received,
-      (grpc_grpclb_dropped_call_counts **)&req->client_stats
+      (grpc_grpclb_dropped_call_counts**)&req->client_stats
           .calls_finished_with_drop.arg);
   return req;
 }
 
-grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request) {
+grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request* request) {
   size_t encoded_length;
   pb_ostream_t sizestream;
   pb_ostream_t outputstream;
@@ -145,10 +145,10 @@
   return slice;
 }
 
-void grpc_grpclb_request_destroy(grpc_grpclb_request *request) {
+void grpc_grpclb_request_destroy(grpc_grpclb_request* request) {
   if (request->has_client_stats) {
-    grpc_grpclb_dropped_call_counts *drop_entries =
-        (grpc_grpclb_dropped_call_counts *)
+    grpc_grpclb_dropped_call_counts* drop_entries =
+        (grpc_grpclb_dropped_call_counts*)
             request->client_stats.calls_finished_with_drop.arg;
     grpc_grpclb_dropped_call_counts_destroy(drop_entries);
   }
@@ -156,7 +156,7 @@
 }
 
 typedef grpc_lb_v1_LoadBalanceResponse grpc_grpclb_response;
-grpc_grpclb_initial_response *grpc_grpclb_initial_response_parse(
+grpc_grpclb_initial_response* grpc_grpclb_initial_response_parse(
     grpc_slice encoded_grpc_grpclb_response) {
   pb_istream_t stream =
       pb_istream_from_buffer(GRPC_SLICE_START_PTR(encoded_grpc_grpclb_response),
@@ -170,8 +170,8 @@
 
   if (!res.has_initial_response) return NULL;
 
-  grpc_grpclb_initial_response *initial_res =
-      (grpc_grpclb_initial_response *)gpr_malloc(
+  grpc_grpclb_initial_response* initial_res =
+      (grpc_grpclb_initial_response*)gpr_malloc(
           sizeof(grpc_grpclb_initial_response));
   memcpy(initial_res, &res.initial_response,
          sizeof(grpc_grpclb_initial_response));
@@ -179,14 +179,14 @@
   return initial_res;
 }
 
-grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist(
+grpc_grpclb_serverlist* grpc_grpclb_response_parse_serverlist(
     grpc_slice encoded_grpc_grpclb_response) {
   pb_istream_t stream =
       pb_istream_from_buffer(GRPC_SLICE_START_PTR(encoded_grpc_grpclb_response),
                              GRPC_SLICE_LENGTH(encoded_grpc_grpclb_response));
   pb_istream_t stream_at_start = stream;
-  grpc_grpclb_serverlist *sl =
-      (grpc_grpclb_serverlist *)gpr_zalloc(sizeof(grpc_grpclb_serverlist));
+  grpc_grpclb_serverlist* sl =
+      (grpc_grpclb_serverlist*)gpr_zalloc(sizeof(grpc_grpclb_serverlist));
   grpc_grpclb_response res;
   memset(&res, 0, sizeof(grpc_grpclb_response));
   // First pass: count number of servers.
@@ -200,8 +200,8 @@
   }
   // Second pass: populate servers.
   if (sl->num_servers > 0) {
-    sl->servers = (grpc_grpclb_server **)gpr_zalloc(
-        sizeof(grpc_grpclb_server *) * sl->num_servers);
+    sl->servers = (grpc_grpclb_server**)gpr_zalloc(sizeof(grpc_grpclb_server*) *
+                                                   sl->num_servers);
     decode_serverlist_arg decode_arg;
     memset(&decode_arg, 0, sizeof(decode_arg));
     decode_arg.serverlist = sl;
@@ -221,7 +221,7 @@
   return sl;
 }
 
-void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist *serverlist) {
+void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist* serverlist) {
   if (serverlist == NULL) {
     return;
   }
@@ -232,25 +232,25 @@
   gpr_free(serverlist);
 }
 
-grpc_grpclb_serverlist *grpc_grpclb_serverlist_copy(
-    const grpc_grpclb_serverlist *sl) {
-  grpc_grpclb_serverlist *copy =
-      (grpc_grpclb_serverlist *)gpr_zalloc(sizeof(grpc_grpclb_serverlist));
+grpc_grpclb_serverlist* grpc_grpclb_serverlist_copy(
+    const grpc_grpclb_serverlist* sl) {
+  grpc_grpclb_serverlist* copy =
+      (grpc_grpclb_serverlist*)gpr_zalloc(sizeof(grpc_grpclb_serverlist));
   copy->num_servers = sl->num_servers;
   memcpy(&copy->expiration_interval, &sl->expiration_interval,
          sizeof(grpc_grpclb_duration));
-  copy->servers = (grpc_grpclb_server **)gpr_malloc(
-      sizeof(grpc_grpclb_server *) * sl->num_servers);
+  copy->servers = (grpc_grpclb_server**)gpr_malloc(sizeof(grpc_grpclb_server*) *
+                                                   sl->num_servers);
   for (size_t i = 0; i < sl->num_servers; i++) {
     copy->servers[i] =
-        (grpc_grpclb_server *)gpr_malloc(sizeof(grpc_grpclb_server));
+        (grpc_grpclb_server*)gpr_malloc(sizeof(grpc_grpclb_server));
     memcpy(copy->servers[i], sl->servers[i], sizeof(grpc_grpclb_server));
   }
   return copy;
 }
 
-bool grpc_grpclb_serverlist_equals(const grpc_grpclb_serverlist *lhs,
-                                   const grpc_grpclb_serverlist *rhs) {
+bool grpc_grpclb_serverlist_equals(const grpc_grpclb_serverlist* lhs,
+                                   const grpc_grpclb_serverlist* rhs) {
   if (lhs == NULL || rhs == NULL) {
     return false;
   }
@@ -269,13 +269,13 @@
   return true;
 }
 
-bool grpc_grpclb_server_equals(const grpc_grpclb_server *lhs,
-                               const grpc_grpclb_server *rhs) {
+bool grpc_grpclb_server_equals(const grpc_grpclb_server* lhs,
+                               const grpc_grpclb_server* rhs) {
   return memcmp(lhs, rhs, sizeof(grpc_grpclb_server)) == 0;
 }
 
-int grpc_grpclb_duration_compare(const grpc_grpclb_duration *lhs,
-                                 const grpc_grpclb_duration *rhs) {
+int grpc_grpclb_duration_compare(const grpc_grpclb_duration* lhs,
+                                 const grpc_grpclb_duration* rhs) {
   GPR_ASSERT(lhs && rhs);
   if (lhs->has_seconds && rhs->has_seconds) {
     if (lhs->seconds < rhs->seconds) return -1;
@@ -299,13 +299,13 @@
   return 0;
 }
 
-grpc_millis grpc_grpclb_duration_to_millis(grpc_grpclb_duration *duration_pb) {
+grpc_millis grpc_grpclb_duration_to_millis(grpc_grpclb_duration* duration_pb) {
   return (grpc_millis)(
       (duration_pb->has_seconds ? duration_pb->seconds : 0) * GPR_MS_PER_SEC +
       (duration_pb->has_nanos ? duration_pb->nanos : 0) / GPR_NS_PER_MS);
 }
 
 void grpc_grpclb_initial_response_destroy(
-    grpc_grpclb_initial_response *response) {
+    grpc_grpclb_initial_response* response) {
   gpr_free(response);
 }
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
index 56b9c09..138012c 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
@@ -37,59 +37,59 @@
 typedef grpc_lb_v1_Server grpc_grpclb_server;
 typedef grpc_lb_v1_Duration grpc_grpclb_duration;
 typedef struct {
-  grpc_grpclb_server **servers;
+  grpc_grpclb_server** servers;
   size_t num_servers;
   grpc_grpclb_duration expiration_interval;
 } grpc_grpclb_serverlist;
 
 /** Create a request for a gRPC LB service under \a lb_service_name */
-grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name);
-grpc_grpclb_request *grpc_grpclb_load_report_request_create_locked(
-    grpc_grpclb_client_stats *client_stats);
+grpc_grpclb_request* grpc_grpclb_request_create(const char* lb_service_name);
+grpc_grpclb_request* grpc_grpclb_load_report_request_create_locked(
+    grpc_grpclb_client_stats* client_stats);
 
 /** Protocol Buffers v3-encode \a request */
-grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request);
+grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request* request);
 
 /** Destroy \a request */
-void grpc_grpclb_request_destroy(grpc_grpclb_request *request);
+void grpc_grpclb_request_destroy(grpc_grpclb_request* request);
 
 /** Parse (ie, decode) the bytes in \a encoded_grpc_grpclb_response as a \a
  * grpc_grpclb_initial_response */
-grpc_grpclb_initial_response *grpc_grpclb_initial_response_parse(
+grpc_grpclb_initial_response* grpc_grpclb_initial_response_parse(
     grpc_slice encoded_grpc_grpclb_response);
 
 /** Parse the list of servers from an encoded \a grpc_grpclb_response */
-grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist(
+grpc_grpclb_serverlist* grpc_grpclb_response_parse_serverlist(
     grpc_slice encoded_grpc_grpclb_response);
 
 /** Return a copy of \a sl. The caller is responsible for calling \a
  * grpc_grpclb_destroy_serverlist on the returned copy. */
-grpc_grpclb_serverlist *grpc_grpclb_serverlist_copy(
-    const grpc_grpclb_serverlist *sl);
+grpc_grpclb_serverlist* grpc_grpclb_serverlist_copy(
+    const grpc_grpclb_serverlist* sl);
 
-bool grpc_grpclb_serverlist_equals(const grpc_grpclb_serverlist *lhs,
-                                   const grpc_grpclb_serverlist *rhs);
+bool grpc_grpclb_serverlist_equals(const grpc_grpclb_serverlist* lhs,
+                                   const grpc_grpclb_serverlist* rhs);
 
-bool grpc_grpclb_server_equals(const grpc_grpclb_server *lhs,
-                               const grpc_grpclb_server *rhs);
+bool grpc_grpclb_server_equals(const grpc_grpclb_server* lhs,
+                               const grpc_grpclb_server* rhs);
 
 /** Destroy \a serverlist */
-void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist *serverlist);
+void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist* serverlist);
 
 /** Compare \a lhs against \a rhs and return 0 if \a lhs and \a rhs are equal,
  * < 0 if \a lhs represents a duration shorter than \a rhs and > 0 otherwise */
-int grpc_grpclb_duration_compare(const grpc_grpclb_duration *lhs,
-                                 const grpc_grpclb_duration *rhs);
+int grpc_grpclb_duration_compare(const grpc_grpclb_duration* lhs,
+                                 const grpc_grpclb_duration* rhs);
 
-grpc_millis grpc_grpclb_duration_to_millis(grpc_grpclb_duration *duration_pb);
+grpc_millis grpc_grpclb_duration_to_millis(grpc_grpclb_duration* duration_pb);
 
 /** Destroy \a initial_response */
 void grpc_grpclb_initial_response_destroy(
-    grpc_grpclb_initial_response *response);
+    grpc_grpclb_initial_response* response);
 
 #ifdef __cplusplus
 }
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H \
-          */
+        */
diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
index 831b78f..d564560 100644
--- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
@@ -20,6 +20,7 @@
 
 #include <grpc/support/alloc.h>
 
+#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
 #include "src/core/ext/filters/client_channel/lb_policy_registry.h"
 #include "src/core/ext/filters/client_channel/subchannel.h"
 #include "src/core/ext/filters/client_channel/subchannel_index.h"
@@ -31,112 +32,86 @@
 grpc_core::TraceFlag grpc_lb_pick_first_trace(false, "pick_first");
 
 typedef struct pending_pick {
-  struct pending_pick *next;
+  struct pending_pick* next;
   uint32_t initial_metadata_flags;
-  grpc_connected_subchannel **target;
-  grpc_closure *on_complete;
+  grpc_connected_subchannel** target;
+  grpc_closure* on_complete;
 } pending_pick;
 
 typedef struct {
   /** base policy: must be first */
   grpc_lb_policy base;
   /** all our subchannels */
-  grpc_subchannel **subchannels;
-  grpc_subchannel **new_subchannels;
-  size_t num_subchannels;
-  size_t num_new_subchannels;
-
-  grpc_closure connectivity_changed;
-
-  /** remaining members are protected by the combiner */
-
-  /** the selected channel */
-  grpc_connected_subchannel *selected;
-
-  /** the subchannel key for \a selected, or NULL if \a selected not set */
-  const grpc_subchannel_key *selected_key;
-
+  grpc_lb_subchannel_list* subchannel_list;
+  /** latest pending subchannel list */
+  grpc_lb_subchannel_list* latest_pending_subchannel_list;
+  /** selected subchannel in \a subchannel_list */
+  grpc_lb_subchannel_data* selected;
   /** have we started picking? */
   bool started_picking;
   /** are we shut down? */
   bool shutdown;
-  /** are we updating the selected subchannel? */
-  bool updating_selected;
-  /** are we updating the subchannel candidates? */
-  bool updating_subchannels;
-  /** args from the latest update received while already updating, or NULL */
-  grpc_lb_policy_args *pending_update_args;
-  /** which subchannel are we watching? */
-  size_t checking_subchannel;
-  /** what is the connectivity of that channel? */
-  grpc_connectivity_state checking_connectivity;
   /** list of picks that are waiting on connectivity */
-  pending_pick *pending_picks;
-
+  pending_pick* pending_picks;
   /** our connectivity state tracker */
   grpc_connectivity_state_tracker state_tracker;
 } pick_first_lb_policy;
 
-static void pf_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)pol;
+static void pf_destroy(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol) {
+  pick_first_lb_policy* p = (pick_first_lb_policy*)pol;
+  GPR_ASSERT(p->subchannel_list == NULL);
+  GPR_ASSERT(p->latest_pending_subchannel_list == NULL);
   GPR_ASSERT(p->pending_picks == NULL);
-  for (size_t i = 0; i < p->num_subchannels; i++) {
-    GRPC_SUBCHANNEL_UNREF(exec_ctx, p->subchannels[i], "pick_first_destroy");
-  }
-  if (p->selected != NULL) {
-    GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, p->selected,
-                                    "picked_first_destroy");
-  }
   grpc_connectivity_state_destroy(exec_ctx, &p->state_tracker);
-  grpc_subchannel_index_unref();
-  if (p->pending_update_args != NULL) {
-    grpc_channel_args_destroy(exec_ctx, p->pending_update_args->args);
-    gpr_free(p->pending_update_args);
-  }
-  gpr_free(p->subchannels);
-  gpr_free(p->new_subchannels);
   gpr_free(p);
+  grpc_subchannel_index_unref();
   if (grpc_lb_pick_first_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "Pick First %p destroyed.", (void *)p);
+    gpr_log(GPR_DEBUG, "Pick First %p destroyed.", (void*)p);
   }
 }
 
-static void pf_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)pol;
-  pending_pick *pp;
+static void shutdown_locked(grpc_exec_ctx* exec_ctx, pick_first_lb_policy* p,
+                            grpc_error* error) {
+  if (grpc_lb_pick_first_trace.enabled()) {
+    gpr_log(GPR_DEBUG, "Pick First %p Shutting down", p);
+  }
   p->shutdown = true;
-  pp = p->pending_picks;
-  p->pending_picks = NULL;
-  grpc_connectivity_state_set(
-      exec_ctx, &p->state_tracker, GRPC_CHANNEL_SHUTDOWN,
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel shutdown"), "shutdown");
-  /* cancel subscription */
-  if (p->selected != NULL) {
-    grpc_connected_subchannel_notify_on_state_change(
-        exec_ctx, p->selected, NULL, NULL, &p->connectivity_changed);
-  } else if (p->num_subchannels > 0 && p->started_picking) {
-    grpc_subchannel_notify_on_state_change(
-        exec_ctx, p->subchannels[p->checking_subchannel], NULL, NULL,
-        &p->connectivity_changed);
-  }
-  while (pp != NULL) {
-    pending_pick *next = pp->next;
+  pending_pick* pp;
+  while ((pp = p->pending_picks) != NULL) {
+    p->pending_picks = pp->next;
     *pp->target = NULL;
-    GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete, GRPC_ERROR_NONE);
+    GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete, GRPC_ERROR_REF(error));
     gpr_free(pp);
-    pp = next;
   }
+  grpc_connectivity_state_set(exec_ctx, &p->state_tracker,
+                              GRPC_CHANNEL_SHUTDOWN, GRPC_ERROR_REF(error),
+                              "shutdown");
+  if (p->subchannel_list != NULL) {
+    grpc_lb_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list,
+                                               "pf_shutdown");
+    p->subchannel_list = NULL;
+  }
+  if (p->latest_pending_subchannel_list != NULL) {
+    grpc_lb_subchannel_list_shutdown_and_unref(
+        exec_ctx, p->latest_pending_subchannel_list, "pf_shutdown");
+    p->latest_pending_subchannel_list = NULL;
+  }
+  GRPC_ERROR_UNREF(error);
 }
 
-static void pf_cancel_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-                                  grpc_connected_subchannel **target,
-                                  grpc_error *error) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)pol;
-  pending_pick *pp;
-  pp = p->pending_picks;
+static void pf_shutdown_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol) {
+  shutdown_locked(exec_ctx, (pick_first_lb_policy*)pol,
+                  GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel shutdown"));
+}
+
+static void pf_cancel_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+                                  grpc_connected_subchannel** target,
+                                  grpc_error* error) {
+  pick_first_lb_policy* p = (pick_first_lb_policy*)pol;
+  pending_pick* pp = p->pending_picks;
   p->pending_picks = NULL;
   while (pp != NULL) {
-    pending_pick *next = pp->next;
+    pending_pick* next = pp->next;
     if (pp->target == target) {
       *target = NULL;
       GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete,
@@ -152,16 +127,15 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void pf_cancel_picks_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
+static void pf_cancel_picks_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
                                    uint32_t initial_metadata_flags_mask,
                                    uint32_t initial_metadata_flags_eq,
-                                   grpc_error *error) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)pol;
-  pending_pick *pp;
-  pp = p->pending_picks;
+                                   grpc_error* error) {
+  pick_first_lb_policy* p = (pick_first_lb_policy*)pol;
+  pending_pick* pp = p->pending_picks;
   p->pending_picks = NULL;
   while (pp != NULL) {
-    pending_pick *next = pp->next;
+    pending_pick* next = pp->next;
     if ((pp->initial_metadata_flags & initial_metadata_flags_mask) ==
         initial_metadata_flags_eq) {
       GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete,
@@ -177,47 +151,42 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void start_picking_locked(grpc_exec_ctx *exec_ctx,
-                                 pick_first_lb_policy *p) {
+static void start_picking_locked(grpc_exec_ctx* exec_ctx,
+                                 pick_first_lb_policy* p) {
   p->started_picking = true;
-  if (p->subchannels != NULL) {
-    GPR_ASSERT(p->num_subchannels > 0);
-    p->checking_subchannel = 0;
-    p->checking_connectivity = GRPC_CHANNEL_IDLE;
-    GRPC_LB_POLICY_WEAK_REF(&p->base, "pick_first_connectivity");
-    grpc_subchannel_notify_on_state_change(
-        exec_ctx, p->subchannels[p->checking_subchannel],
-        p->base.interested_parties, &p->checking_connectivity,
-        &p->connectivity_changed);
+  if (p->subchannel_list != NULL && p->subchannel_list->num_subchannels > 0) {
+    p->subchannel_list->checking_subchannel = 0;
+    grpc_lb_subchannel_list_ref_for_connectivity_watch(
+        p->subchannel_list, "connectivity_watch+start_picking");
+    grpc_lb_subchannel_data_start_connectivity_watch(
+        exec_ctx, &p->subchannel_list->subchannels[0]);
   }
 }
 
-static void pf_exit_idle_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)pol;
+static void pf_exit_idle_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol) {
+  pick_first_lb_policy* p = (pick_first_lb_policy*)pol;
   if (!p->started_picking) {
     start_picking_locked(exec_ctx, p);
   }
 }
 
-static int pf_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-                          const grpc_lb_policy_pick_args *pick_args,
-                          grpc_connected_subchannel **target,
-                          grpc_call_context_element *context, void **user_data,
-                          grpc_closure *on_complete) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)pol;
-  pending_pick *pp;
-
-  /* Check atomically for a selected channel */
+static int pf_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+                          const grpc_lb_policy_pick_args* pick_args,
+                          grpc_connected_subchannel** target,
+                          grpc_call_context_element* context, void** user_data,
+                          grpc_closure* on_complete) {
+  pick_first_lb_policy* p = (pick_first_lb_policy*)pol;
+  // If we have a selected subchannel already, return synchronously.
   if (p->selected != NULL) {
-    *target = GRPC_CONNECTED_SUBCHANNEL_REF(p->selected, "picked");
+    *target = GRPC_CONNECTED_SUBCHANNEL_REF(p->selected->connected_subchannel,
+                                            "picked");
     return 1;
   }
-
-  /* No subchannel selected yet, so try again */
+  // No subchannel selected yet, so handle asynchronously.
   if (!p->started_picking) {
     start_picking_locked(exec_ctx, p);
   }
-  pp = (pending_pick *)gpr_malloc(sizeof(*pp));
+  pending_pick* pp = (pending_pick*)gpr_malloc(sizeof(*pp));
   pp->next = p->pending_picks;
   pp->target = target;
   pp->initial_metadata_flags = pick_args->initial_metadata_flags;
@@ -226,80 +195,54 @@
   return 0;
 }
 
-static void destroy_subchannels_locked(grpc_exec_ctx *exec_ctx,
-                                       pick_first_lb_policy *p) {
-  size_t num_subchannels = p->num_subchannels;
-  grpc_subchannel **subchannels = p->subchannels;
-
-  p->num_subchannels = 0;
-  p->subchannels = NULL;
-  GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "destroy_subchannels");
-
-  for (size_t i = 0; i < num_subchannels; i++) {
-    GRPC_SUBCHANNEL_UNREF(exec_ctx, subchannels[i], "pick_first");
+static void destroy_unselected_subchannels_locked(grpc_exec_ctx* exec_ctx,
+                                                  pick_first_lb_policy* p) {
+  for (size_t i = 0; i < p->subchannel_list->num_subchannels; ++i) {
+    grpc_lb_subchannel_data* sd = &p->subchannel_list->subchannels[i];
+    if (p->selected != sd) {
+      grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd,
+                                               "selected_different_subchannel");
+    }
   }
-  gpr_free(subchannels);
 }
 
 static grpc_connectivity_state pf_check_connectivity_locked(
-    grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_error **error) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)pol;
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol, grpc_error** error) {
+  pick_first_lb_policy* p = (pick_first_lb_policy*)pol;
   return grpc_connectivity_state_get(&p->state_tracker, error);
 }
 
-static void pf_notify_on_state_change_locked(grpc_exec_ctx *exec_ctx,
-                                             grpc_lb_policy *pol,
-                                             grpc_connectivity_state *current,
-                                             grpc_closure *notify) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)pol;
+static void pf_notify_on_state_change_locked(grpc_exec_ctx* exec_ctx,
+                                             grpc_lb_policy* pol,
+                                             grpc_connectivity_state* current,
+                                             grpc_closure* notify) {
+  pick_first_lb_policy* p = (pick_first_lb_policy*)pol;
   grpc_connectivity_state_notify_on_state_change(exec_ctx, &p->state_tracker,
                                                  current, notify);
 }
 
-static void pf_ping_one_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-                               grpc_closure *closure) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)pol;
+static void pf_ping_one_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+                               grpc_closure* closure) {
+  pick_first_lb_policy* p = (pick_first_lb_policy*)pol;
   if (p->selected) {
-    grpc_connected_subchannel_ping(exec_ctx, p->selected, closure);
+    grpc_connected_subchannel_ping(exec_ctx, p->selected->connected_subchannel,
+                                   closure);
   } else {
     GRPC_CLOSURE_SCHED(exec_ctx, closure,
                        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Not connected"));
   }
 }
 
-/* unsubscribe all subchannels */
-static void stop_connectivity_watchers(grpc_exec_ctx *exec_ctx,
-                                       pick_first_lb_policy *p) {
-  if (p->num_subchannels > 0) {
-    GPR_ASSERT(p->selected == NULL);
-    if (grpc_lb_pick_first_trace.enabled()) {
-      gpr_log(GPR_DEBUG, "Pick First %p unsubscribing from subchannel %p",
-              (void *)p, (void *)p->subchannels[p->checking_subchannel]);
-    }
-    grpc_subchannel_notify_on_state_change(
-        exec_ctx, p->subchannels[p->checking_subchannel], NULL, NULL,
-        &p->connectivity_changed);
-    p->updating_subchannels = true;
-  } else if (p->selected != NULL) {
-    if (grpc_lb_pick_first_trace.enabled()) {
-      gpr_log(GPR_DEBUG,
-              "Pick First %p unsubscribing from selected subchannel %p",
-              (void *)p, (void *)p->selected);
-    }
-    grpc_connected_subchannel_notify_on_state_change(
-        exec_ctx, p->selected, NULL, NULL, &p->connectivity_changed);
-    p->updating_selected = true;
-  }
-}
+static void pf_connectivity_changed_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error);
 
-/* true upon success */
-static void pf_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                             const grpc_lb_policy_args *args) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)policy;
-  const grpc_arg *arg =
+static void pf_update_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                             const grpc_lb_policy_args* args) {
+  pick_first_lb_policy* p = (pick_first_lb_policy*)policy;
+  const grpc_arg* arg =
       grpc_channel_args_find(args->args, GRPC_ARG_LB_ADDRESSES);
   if (arg == NULL || arg->type != GRPC_ARG_POINTER) {
-    if (p->subchannels == NULL) {
+    if (p->subchannel_list == NULL) {
       // If we don't have a current subchannel list, go into TRANSIENT FAILURE.
       grpc_connectivity_state_set(
           exec_ctx, &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
@@ -310,354 +253,316 @@
       gpr_log(GPR_ERROR,
               "No valid LB addresses channel arg for Pick First %p update, "
               "ignoring.",
-              (void *)p);
+              (void*)p);
     }
     return;
   }
-  const grpc_lb_addresses *addresses =
-      (const grpc_lb_addresses *)arg->value.pointer.p;
-  if (addresses->num_addresses == 0) {
-    // Empty update. Unsubscribe from all current subchannels and put the
-    // channel in TRANSIENT_FAILURE.
+  const grpc_lb_addresses* addresses =
+      (const grpc_lb_addresses*)arg->value.pointer.p;
+  if (grpc_lb_pick_first_trace.enabled()) {
+    gpr_log(GPR_INFO, "Pick First %p received update with %lu addresses",
+            (void*)p, (unsigned long)addresses->num_addresses);
+  }
+  grpc_lb_subchannel_list* subchannel_list = grpc_lb_subchannel_list_create(
+      exec_ctx, &p->base, &grpc_lb_pick_first_trace, addresses, args,
+      pf_connectivity_changed_locked);
+  if (subchannel_list->num_subchannels == 0) {
+    // Empty update or no valid subchannels. Unsubscribe from all current
+    // subchannels and put the channel in TRANSIENT_FAILURE.
     grpc_connectivity_state_set(
         exec_ctx, &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"),
         "pf_update_empty");
-    stop_connectivity_watchers(exec_ctx, p);
+    if (p->subchannel_list != NULL) {
+      grpc_lb_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list,
+                                                 "sl_shutdown_empty_update");
+    }
+    p->subchannel_list = subchannel_list;  // Empty list.
+    p->selected = NULL;
     return;
   }
-  if (grpc_lb_pick_first_trace.enabled()) {
-    gpr_log(GPR_INFO, "Pick First %p received update with %lu addresses",
-            (void *)p, (unsigned long)addresses->num_addresses);
-  }
-  grpc_subchannel_args *sc_args = (grpc_subchannel_args *)gpr_zalloc(
-      sizeof(*sc_args) * addresses->num_addresses);
-  /* We remove the following keys in order for subchannel keys belonging to
-   * subchannels point to the same address to match. */
-  static const char *keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS,
-                                         GRPC_ARG_LB_ADDRESSES};
-  size_t sc_args_count = 0;
-
-  /* Create list of subchannel args for new addresses in \a args. */
-  for (size_t i = 0; i < addresses->num_addresses; i++) {
-    // If there were any balancer, we would have chosen grpclb policy instead.
-    GPR_ASSERT(!addresses->addresses[i].is_balancer);
-    if (addresses->addresses[i].user_data != NULL) {
-      gpr_log(GPR_ERROR,
-              "This LB policy doesn't support user data. It will be ignored");
+  if (p->selected == NULL) {
+    // We don't yet have a selected subchannel, so replace the current
+    // subchannel list immediately.
+    if (p->subchannel_list != NULL) {
+      grpc_lb_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list,
+                                                 "pf_update_before_selected");
     }
-    grpc_arg addr_arg =
-        grpc_create_subchannel_address_arg(&addresses->addresses[i].address);
-    grpc_channel_args *new_args = grpc_channel_args_copy_and_add_and_remove(
-        args->args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), &addr_arg,
-        1);
-    gpr_free(addr_arg.value.string);
-    sc_args[sc_args_count++].args = new_args;
-  }
-
-  /* Check if p->selected is amongst them. If so, we are done. */
-  if (p->selected != NULL) {
-    GPR_ASSERT(p->selected_key != NULL);
-    for (size_t i = 0; i < sc_args_count; i++) {
-      grpc_subchannel_key *ith_sc_key = grpc_subchannel_key_create(&sc_args[i]);
-      const bool found_selected =
-          grpc_subchannel_key_compare(p->selected_key, ith_sc_key) == 0;
-      grpc_subchannel_key_destroy(exec_ctx, ith_sc_key);
-      if (found_selected) {
+    p->subchannel_list = subchannel_list;
+  } else {
+    // We do have a selected subchannel.
+    // Check if it's present in the new list.  If so, we're done.
+    for (size_t i = 0; i < subchannel_list->num_subchannels; ++i) {
+      grpc_lb_subchannel_data* sd = &subchannel_list->subchannels[i];
+      if (sd->subchannel == p->selected->subchannel) {
         // The currently selected subchannel is in the update: we are done.
         if (grpc_lb_pick_first_trace.enabled()) {
           gpr_log(GPR_INFO,
-                  "Pick First %p found already selected subchannel %p amongst "
-                  "updates. Update done.",
-                  (void *)p, (void *)p->selected);
+                  "Pick First %p found already selected subchannel %p "
+                  "at update index %" PRIuPTR " of %" PRIuPTR "; update done",
+                  p, p->selected->subchannel, i,
+                  subchannel_list->num_subchannels);
         }
-        for (size_t j = 0; j < sc_args_count; j++) {
-          grpc_channel_args_destroy(exec_ctx,
-                                    (grpc_channel_args *)sc_args[j].args);
+        grpc_lb_subchannel_list_ref_for_connectivity_watch(
+            subchannel_list, "connectivity_watch+replace_selected");
+        grpc_lb_subchannel_data_start_connectivity_watch(exec_ctx, sd);
+        if (p->subchannel_list != NULL) {
+          grpc_lb_subchannel_list_shutdown_and_unref(
+              exec_ctx, p->subchannel_list, "pf_update_includes_selected");
         }
-        gpr_free(sc_args);
+        p->subchannel_list = subchannel_list;
+        if (p->selected->connected_subchannel != NULL) {
+          sd->connected_subchannel = GRPC_CONNECTED_SUBCHANNEL_REF(
+              p->selected->connected_subchannel, "pf_update_includes_selected");
+        }
+        p->selected = sd;
+        destroy_unselected_subchannels_locked(exec_ctx, p);
+        // If there was a previously pending update (which may or may
+        // not have contained the currently selected subchannel), drop
+        // it, so that it doesn't override what we've done here.
+        if (p->latest_pending_subchannel_list != NULL) {
+          grpc_lb_subchannel_list_shutdown_and_unref(
+              exec_ctx, p->latest_pending_subchannel_list,
+              "pf_update_includes_selected+outdated");
+          p->latest_pending_subchannel_list = NULL;
+        }
         return;
       }
     }
-  }
-  // We only check for already running updates here because if the previous
-  // steps were successful, the update can be considered done without any
-  // interference (ie, no callbacks were scheduled).
-  if (p->updating_selected || p->updating_subchannels) {
-    if (grpc_lb_pick_first_trace.enabled()) {
-      gpr_log(GPR_INFO,
-              "Update already in progress for pick first %p. Deferring update.",
-              (void *)p);
+    // Not keeping the previous selected subchannel, so set the latest
+    // pending subchannel list to the new subchannel list.  We will wait
+    // for it to report READY before swapping it into the current
+    // subchannel list.
+    if (p->latest_pending_subchannel_list != NULL) {
+      if (grpc_lb_pick_first_trace.enabled()) {
+        gpr_log(GPR_DEBUG,
+                "Pick First %p Shutting down latest pending subchannel list "
+                "%p, about to be replaced by newer latest %p",
+                (void*)p, (void*)p->latest_pending_subchannel_list,
+                (void*)subchannel_list);
+      }
+      grpc_lb_subchannel_list_shutdown_and_unref(
+          exec_ctx, p->latest_pending_subchannel_list,
+          "sl_outdated_dont_smash");
     }
-    if (p->pending_update_args != NULL) {
-      grpc_channel_args_destroy(exec_ctx, p->pending_update_args->args);
-      gpr_free(p->pending_update_args);
-    }
-    p->pending_update_args =
-        (grpc_lb_policy_args *)gpr_zalloc(sizeof(*p->pending_update_args));
-    p->pending_update_args->client_channel_factory =
-        args->client_channel_factory;
-    p->pending_update_args->args = grpc_channel_args_copy(args->args);
-    p->pending_update_args->combiner = args->combiner;
-    return;
+    p->latest_pending_subchannel_list = subchannel_list;
   }
-  /* Create the subchannels for the new subchannel args/addresses. */
-  grpc_subchannel **new_subchannels =
-      (grpc_subchannel **)gpr_zalloc(sizeof(*new_subchannels) * sc_args_count);
-  size_t num_new_subchannels = 0;
-  for (size_t i = 0; i < sc_args_count; i++) {
-    grpc_subchannel *subchannel = grpc_client_channel_factory_create_subchannel(
-        exec_ctx, args->client_channel_factory, &sc_args[i]);
-    if (grpc_lb_pick_first_trace.enabled()) {
-      char *address_uri =
-          grpc_sockaddr_to_uri(&addresses->addresses[i].address);
-      gpr_log(GPR_INFO,
-              "Pick First %p created subchannel %p for address uri %s",
-              (void *)p, (void *)subchannel, address_uri);
-      gpr_free(address_uri);
-    }
-    grpc_channel_args_destroy(exec_ctx, (grpc_channel_args *)sc_args[i].args);
-    if (subchannel != NULL) new_subchannels[num_new_subchannels++] = subchannel;
-  }
-  gpr_free(sc_args);
-  if (num_new_subchannels == 0) {
-    gpr_free(new_subchannels);
-    // Empty update. Unsubscribe from all current subchannels and put the
-    // channel in TRANSIENT_FAILURE.
-    grpc_connectivity_state_set(
-        exec_ctx, &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
-        GRPC_ERROR_CREATE_FROM_STATIC_STRING("No valid addresses in update"),
-        "pf_update_no_valid_addresses");
-    stop_connectivity_watchers(exec_ctx, p);
-    return;
-  }
-
-  /* Destroy the current subchannels. Repurpose pf_shutdown/destroy. */
-  stop_connectivity_watchers(exec_ctx, p);
-
-  /* Save new subchannels. The switch over will happen in
-   * pf_connectivity_changed_locked */
-  if (p->updating_selected || p->updating_subchannels) {
-    p->num_new_subchannels = num_new_subchannels;
-    p->new_subchannels = new_subchannels;
-  } else { /* nothing is updating. Get things moving from here */
-    p->num_subchannels = num_new_subchannels;
-    p->subchannels = new_subchannels;
-    p->new_subchannels = NULL;
-    p->num_new_subchannels = 0;
-    if (p->started_picking) {
-      p->checking_subchannel = 0;
-      p->checking_connectivity = GRPC_CHANNEL_IDLE;
-      grpc_subchannel_notify_on_state_change(
-          exec_ctx, p->subchannels[p->checking_subchannel],
-          p->base.interested_parties, &p->checking_connectivity,
-          &p->connectivity_changed);
-    }
+  // If we've started picking, start trying to connect to the first
+  // subchannel in the new list.
+  if (p->started_picking) {
+    grpc_lb_subchannel_list_ref_for_connectivity_watch(
+        subchannel_list, "connectivity_watch+update");
+    grpc_lb_subchannel_data_start_connectivity_watch(
+        exec_ctx, &subchannel_list->subchannels[0]);
   }
 }
 
-static void pf_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error) {
-  pick_first_lb_policy *p = (pick_first_lb_policy *)arg;
-  grpc_subchannel *selected_subchannel;
-  pending_pick *pp;
-
+static void pf_connectivity_changed_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error) {
+  grpc_lb_subchannel_data* sd = (grpc_lb_subchannel_data*)arg;
+  pick_first_lb_policy* p = (pick_first_lb_policy*)sd->subchannel_list->policy;
   if (grpc_lb_pick_first_trace.enabled()) {
-    gpr_log(
-        GPR_DEBUG,
-        "Pick First %p connectivity changed. Updating selected: %d; Updating "
-        "subchannels: %d; Checking %lu index (%lu total); State: %d; ",
-        (void *)p, p->updating_selected, p->updating_subchannels,
-        (unsigned long)p->checking_subchannel,
-        (unsigned long)p->num_subchannels, p->checking_connectivity);
+    gpr_log(GPR_DEBUG,
+            "Pick First %p connectivity changed for subchannel %p (%" PRIuPTR
+            " of %" PRIuPTR
+            "), subchannel_list %p: state=%s p->shutdown=%d "
+            "sd->subchannel_list->shutting_down=%d error=%s",
+            (void*)p, (void*)sd->subchannel,
+            sd->subchannel_list->checking_subchannel,
+            sd->subchannel_list->num_subchannels, (void*)sd->subchannel_list,
+            grpc_connectivity_state_name(sd->pending_connectivity_state_unsafe),
+            p->shutdown, sd->subchannel_list->shutting_down,
+            grpc_error_string(error));
   }
-  bool restart = false;
-  if (p->updating_selected && error != GRPC_ERROR_NONE) {
-    /* Captured the unsubscription for p->selected */
-    GPR_ASSERT(p->selected != NULL);
-    GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, p->selected,
-                                    "pf_update_connectivity");
-    if (grpc_lb_pick_first_trace.enabled()) {
-      gpr_log(GPR_DEBUG, "Pick First %p unreffing selected subchannel %p",
-              (void *)p, (void *)p->selected);
-    }
-    p->updating_selected = false;
-    if (p->num_new_subchannels == 0) {
+  // If the policy is shutting down, unref and return.
+  if (p->shutdown) {
+    grpc_lb_subchannel_data_stop_connectivity_watch(exec_ctx, sd);
+    grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd, "pf_shutdown");
+    grpc_lb_subchannel_list_unref_for_connectivity_watch(
+        exec_ctx, sd->subchannel_list, "pf_shutdown");
+    return;
+  }
+  // If the subchannel list is shutting down, stop watching.
+  if (sd->subchannel_list->shutting_down || error == GRPC_ERROR_CANCELLED) {
+    grpc_lb_subchannel_data_stop_connectivity_watch(exec_ctx, sd);
+    grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd, "pf_sl_shutdown");
+    grpc_lb_subchannel_list_unref_for_connectivity_watch(
+        exec_ctx, sd->subchannel_list, "pf_sl_shutdown");
+    return;
+  }
+  // If we're still here, the notification must be for a subchannel in
+  // either the current or latest pending subchannel lists.
+  GPR_ASSERT(sd->subchannel_list == p->subchannel_list ||
+             sd->subchannel_list == p->latest_pending_subchannel_list);
+  // Update state.
+  sd->curr_connectivity_state = sd->pending_connectivity_state_unsafe;
+  // Handle updates for the currently selected subchannel.
+  if (p->selected == sd) {
+    // If the new state is anything other than READY and there is a
+    // pending update, switch to the pending update.
+    if (sd->curr_connectivity_state != GRPC_CHANNEL_READY &&
+        p->latest_pending_subchannel_list != NULL) {
       p->selected = NULL;
-      return;
-    }
-    restart = true;
-  }
-  if (p->updating_subchannels && error != GRPC_ERROR_NONE) {
-    /* Captured the unsubscription for the checking subchannel */
-    GPR_ASSERT(p->selected == NULL);
-    for (size_t i = 0; i < p->num_subchannels; i++) {
-      GRPC_SUBCHANNEL_UNREF(exec_ctx, p->subchannels[i],
-                            "pf_update_connectivity");
-      if (grpc_lb_pick_first_trace.enabled()) {
-        gpr_log(GPR_DEBUG, "Pick First %p unreffing subchannel %p", (void *)p,
-                (void *)p->subchannels[i]);
+      grpc_lb_subchannel_list_shutdown_and_unref(
+          exec_ctx, p->subchannel_list, "selected_not_ready+switch_to_update");
+      p->subchannel_list = p->latest_pending_subchannel_list;
+      p->latest_pending_subchannel_list = NULL;
+      grpc_connectivity_state_set(
+          exec_ctx, &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
+          GRPC_ERROR_REF(error), "selected_not_ready+switch_to_update");
+    } else {
+      if (sd->curr_connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+        /* if the selected channel goes bad, we're done */
+        sd->curr_connectivity_state = GRPC_CHANNEL_SHUTDOWN;
+      }
+      grpc_connectivity_state_set(exec_ctx, &p->state_tracker,
+                                  sd->curr_connectivity_state,
+                                  GRPC_ERROR_REF(error), "selected_changed");
+      if (sd->curr_connectivity_state != GRPC_CHANNEL_SHUTDOWN) {
+        // Renew notification.
+        grpc_lb_subchannel_data_start_connectivity_watch(exec_ctx, sd);
+      } else {
+        grpc_lb_subchannel_data_stop_connectivity_watch(exec_ctx, sd);
+        grpc_lb_subchannel_list_unref_for_connectivity_watch(
+            exec_ctx, sd->subchannel_list, "pf_selected_shutdown");
+        shutdown_locked(exec_ctx, p, GRPC_ERROR_REF(error));
       }
     }
-    gpr_free(p->subchannels);
-    p->subchannels = NULL;
-    p->num_subchannels = 0;
-    p->updating_subchannels = false;
-    if (p->num_new_subchannels == 0) return;
-    restart = true;
-  }
-  if (restart) {
-    p->selected = NULL;
-    p->selected_key = NULL;
-    GPR_ASSERT(p->new_subchannels != NULL);
-    GPR_ASSERT(p->num_new_subchannels > 0);
-    p->num_subchannels = p->num_new_subchannels;
-    p->subchannels = p->new_subchannels;
-    p->num_new_subchannels = 0;
-    p->new_subchannels = NULL;
-    if (p->started_picking) {
-      /* If we were picking, continue to do so over the new subchannels,
-       * starting from the 0th index. */
-      p->checking_subchannel = 0;
-      p->checking_connectivity = GRPC_CHANNEL_IDLE;
-      /* reuses the weak ref from start_picking_locked */
-      grpc_subchannel_notify_on_state_change(
-          exec_ctx, p->subchannels[p->checking_subchannel],
-          p->base.interested_parties, &p->checking_connectivity,
-          &p->connectivity_changed);
-    }
-    if (p->pending_update_args != NULL) {
-      const grpc_lb_policy_args *args = p->pending_update_args;
-      p->pending_update_args = NULL;
-      pf_update_locked(exec_ctx, &p->base, args);
-    }
     return;
   }
-  GRPC_ERROR_REF(error);
-  if (p->shutdown) {
-    GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "pick_first_connectivity");
-    GRPC_ERROR_UNREF(error);
-    return;
-  } else if (p->selected != NULL) {
-    if (p->checking_connectivity == GRPC_CHANNEL_TRANSIENT_FAILURE) {
-      /* if the selected channel goes bad, we're done */
-      p->checking_connectivity = GRPC_CHANNEL_SHUTDOWN;
-    }
-    grpc_connectivity_state_set(exec_ctx, &p->state_tracker,
-                                p->checking_connectivity, GRPC_ERROR_REF(error),
-                                "selected_changed");
-    if (p->checking_connectivity != GRPC_CHANNEL_SHUTDOWN) {
-      grpc_connected_subchannel_notify_on_state_change(
-          exec_ctx, p->selected, p->base.interested_parties,
-          &p->checking_connectivity, &p->connectivity_changed);
-    } else {
-      GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "pick_first_connectivity");
-    }
-  } else {
-  loop:
-    switch (p->checking_connectivity) {
-      case GRPC_CHANNEL_INIT:
-        GPR_UNREACHABLE_CODE(return );
-      case GRPC_CHANNEL_READY:
+  // If we get here, there are two possible cases:
+  // 1. We do not currently have a selected subchannel, and the update is
+  //    for a subchannel in p->subchannel_list that we're trying to
+  //    connect to.  The goal here is to find a subchannel that we can
+  //    select.
+  // 2. We do currently have a selected subchannel, and the update is
+  //    for a subchannel in p->latest_pending_subchannel_list.  The
+  //    goal here is to find a subchannel from the update that we can
+  //    select in place of the current one.
+  if (sd->curr_connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
+      sd->curr_connectivity_state == GRPC_CHANNEL_SHUTDOWN) {
+    grpc_lb_subchannel_data_stop_connectivity_watch(exec_ctx, sd);
+  }
+  while (true) {
+    switch (sd->curr_connectivity_state) {
+      case GRPC_CHANNEL_READY: {
+        // Case 2.  Promote p->latest_pending_subchannel_list to
+        // p->subchannel_list.
+        if (sd->subchannel_list == p->latest_pending_subchannel_list) {
+          GPR_ASSERT(p->subchannel_list != NULL);
+          grpc_lb_subchannel_list_shutdown_and_unref(
+              exec_ctx, p->subchannel_list, "finish_update");
+          p->subchannel_list = p->latest_pending_subchannel_list;
+          p->latest_pending_subchannel_list = NULL;
+        }
+        // Cases 1 and 2.
         grpc_connectivity_state_set(exec_ctx, &p->state_tracker,
                                     GRPC_CHANNEL_READY, GRPC_ERROR_NONE,
                                     "connecting_ready");
-        selected_subchannel = p->subchannels[p->checking_subchannel];
-        p->selected = GRPC_CONNECTED_SUBCHANNEL_REF(
-            grpc_subchannel_get_connected_subchannel(selected_subchannel),
-            "picked_first");
-
+        sd->connected_subchannel = GRPC_CONNECTED_SUBCHANNEL_REF(
+            grpc_subchannel_get_connected_subchannel(sd->subchannel),
+            "connected");
+        p->selected = sd;
         if (grpc_lb_pick_first_trace.enabled()) {
-          gpr_log(GPR_INFO,
-                  "Pick First %p selected subchannel %p (connected %p)",
-                  (void *)p, (void *)selected_subchannel, (void *)p->selected);
+          gpr_log(GPR_INFO, "Pick First %p selected subchannel %p", (void*)p,
+                  (void*)sd->subchannel);
         }
-        p->selected_key = grpc_subchannel_get_key(selected_subchannel);
-        /* drop the pick list: we are connected now */
-        GRPC_LB_POLICY_WEAK_REF(&p->base, "destroy_subchannels");
-        destroy_subchannels_locked(exec_ctx, p);
-        /* update any calls that were waiting for a pick */
+        // Drop all other subchannels, since we are now connected.
+        destroy_unselected_subchannels_locked(exec_ctx, p);
+        // Update any calls that were waiting for a pick.
+        pending_pick* pp;
         while ((pp = p->pending_picks)) {
           p->pending_picks = pp->next;
-          *pp->target = GRPC_CONNECTED_SUBCHANNEL_REF(p->selected, "picked");
+          *pp->target = GRPC_CONNECTED_SUBCHANNEL_REF(
+              p->selected->connected_subchannel, "picked");
           if (grpc_lb_pick_first_trace.enabled()) {
             gpr_log(GPR_INFO,
                     "Servicing pending pick with selected subchannel %p",
-                    (void *)p->selected);
+                    (void*)p->selected);
           }
           GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete, GRPC_ERROR_NONE);
           gpr_free(pp);
         }
-        grpc_connected_subchannel_notify_on_state_change(
-            exec_ctx, p->selected, p->base.interested_parties,
-            &p->checking_connectivity, &p->connectivity_changed);
-        break;
-      case GRPC_CHANNEL_TRANSIENT_FAILURE:
-        p->checking_subchannel =
-            (p->checking_subchannel + 1) % p->num_subchannels;
-        if (p->checking_subchannel == 0) {
-          /* only trigger transient failure when we've tried all alternatives
-           */
+        // Renew notification.
+        grpc_lb_subchannel_data_start_connectivity_watch(exec_ctx, sd);
+        return;
+      }
+      case GRPC_CHANNEL_TRANSIENT_FAILURE: {
+        do {
+          sd->subchannel_list->checking_subchannel =
+              (sd->subchannel_list->checking_subchannel + 1) %
+              sd->subchannel_list->num_subchannels;
+          sd = &sd->subchannel_list
+                    ->subchannels[sd->subchannel_list->checking_subchannel];
+        } while (sd->subchannel == NULL);
+        // Case 1: Only set state to TRANSIENT_FAILURE if we've tried
+        // all subchannels.
+        if (sd->subchannel_list->checking_subchannel == 0 &&
+            sd->subchannel_list == p->subchannel_list) {
           grpc_connectivity_state_set(
               exec_ctx, &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
               GRPC_ERROR_REF(error), "connecting_transient_failure");
         }
+        sd->curr_connectivity_state =
+            grpc_subchannel_check_connectivity(sd->subchannel, &error);
         GRPC_ERROR_UNREF(error);
-        p->checking_connectivity = grpc_subchannel_check_connectivity(
-            p->subchannels[p->checking_subchannel], &error);
-        if (p->checking_connectivity == GRPC_CHANNEL_TRANSIENT_FAILURE) {
-          grpc_subchannel_notify_on_state_change(
-              exec_ctx, p->subchannels[p->checking_subchannel],
-              p->base.interested_parties, &p->checking_connectivity,
-              &p->connectivity_changed);
-        } else {
-          goto loop;
+        if (sd->curr_connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+          // Reuses the connectivity refs from the previous watch.
+          grpc_lb_subchannel_data_start_connectivity_watch(exec_ctx, sd);
+          return;
         }
-        break;
+        break;  // Go back to top of loop.
+      }
       case GRPC_CHANNEL_CONNECTING:
-      case GRPC_CHANNEL_IDLE:
-        grpc_connectivity_state_set(
-            exec_ctx, &p->state_tracker, GRPC_CHANNEL_CONNECTING,
-            GRPC_ERROR_REF(error), "connecting_changed");
-        grpc_subchannel_notify_on_state_change(
-            exec_ctx, p->subchannels[p->checking_subchannel],
-            p->base.interested_parties, &p->checking_connectivity,
-            &p->connectivity_changed);
-        break;
-      case GRPC_CHANNEL_SHUTDOWN:
-        p->num_subchannels--;
-        GPR_SWAP(grpc_subchannel *, p->subchannels[p->checking_subchannel],
-                 p->subchannels[p->num_subchannels]);
-        GRPC_SUBCHANNEL_UNREF(exec_ctx, p->subchannels[p->num_subchannels],
-                              "pick_first");
-        if (p->num_subchannels == 0) {
+      case GRPC_CHANNEL_IDLE: {
+        // Only update connectivity state in case 1.
+        if (sd->subchannel_list == p->subchannel_list) {
           grpc_connectivity_state_set(
-              exec_ctx, &p->state_tracker, GRPC_CHANNEL_SHUTDOWN,
-              GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
-                  "Pick first exhausted channels", &error, 1),
-              "no_more_channels");
-          while ((pp = p->pending_picks)) {
-            p->pending_picks = pp->next;
-            *pp->target = NULL;
-            GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete, GRPC_ERROR_NONE);
-            gpr_free(pp);
-          }
-          GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base,
-                                    "pick_first_connectivity");
-        } else {
+              exec_ctx, &p->state_tracker, GRPC_CHANNEL_CONNECTING,
+              GRPC_ERROR_REF(error), "connecting_changed");
+        }
+        // Renew notification.
+        grpc_lb_subchannel_data_start_connectivity_watch(exec_ctx, sd);
+        return;
+      }
+      case GRPC_CHANNEL_SHUTDOWN: {
+        grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd,
+                                                 "pf_candidate_shutdown");
+        // Advance to next subchannel and check its state.
+        grpc_lb_subchannel_data* original_sd = sd;
+        do {
+          sd->subchannel_list->checking_subchannel =
+              (sd->subchannel_list->checking_subchannel + 1) %
+              sd->subchannel_list->num_subchannels;
+          sd = &sd->subchannel_list
+                    ->subchannels[sd->subchannel_list->checking_subchannel];
+        } while (sd->subchannel == NULL && sd != original_sd);
+        if (sd == original_sd) {
+          grpc_lb_subchannel_list_unref_for_connectivity_watch(
+              exec_ctx, sd->subchannel_list, "pf_candidate_shutdown");
+          shutdown_locked(exec_ctx, p,
+                          GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+                              "Pick first exhausted channels", &error, 1));
+          return;
+        }
+        if (sd->subchannel_list == p->subchannel_list) {
           grpc_connectivity_state_set(
               exec_ctx, &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
               GRPC_ERROR_REF(error), "subchannel_failed");
-          p->checking_subchannel %= p->num_subchannels;
-          GRPC_ERROR_UNREF(error);
-          p->checking_connectivity = grpc_subchannel_check_connectivity(
-              p->subchannels[p->checking_subchannel], &error);
-          goto loop;
         }
+        sd->curr_connectivity_state =
+            grpc_subchannel_check_connectivity(sd->subchannel, &error);
+        GRPC_ERROR_UNREF(error);
+        if (sd->curr_connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+          // Reuses the connectivity refs from the previous watch.
+          grpc_lb_subchannel_data_start_connectivity_watch(exec_ctx, sd);
+          return;
+        }
+        // For any other state, go back to top of loop.
+        // We will reuse the connectivity refs from the previous watch.
+      }
     }
   }
-
-  GRPC_ERROR_UNREF(error);
 }
 
 static const grpc_lb_policy_vtable pick_first_lb_policy_vtable = {
@@ -672,23 +577,21 @@
     pf_notify_on_state_change_locked,
     pf_update_locked};
 
-static void pick_first_factory_ref(grpc_lb_policy_factory *factory) {}
+static void pick_first_factory_ref(grpc_lb_policy_factory* factory) {}
 
-static void pick_first_factory_unref(grpc_lb_policy_factory *factory) {}
+static void pick_first_factory_unref(grpc_lb_policy_factory* factory) {}
 
-static grpc_lb_policy *create_pick_first(grpc_exec_ctx *exec_ctx,
-                                         grpc_lb_policy_factory *factory,
-                                         grpc_lb_policy_args *args) {
+static grpc_lb_policy* create_pick_first(grpc_exec_ctx* exec_ctx,
+                                         grpc_lb_policy_factory* factory,
+                                         grpc_lb_policy_args* args) {
   GPR_ASSERT(args->client_channel_factory != NULL);
-  pick_first_lb_policy *p = (pick_first_lb_policy *)gpr_zalloc(sizeof(*p));
+  pick_first_lb_policy* p = (pick_first_lb_policy*)gpr_zalloc(sizeof(*p));
   if (grpc_lb_pick_first_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "Pick First %p created.", (void *)p);
+    gpr_log(GPR_DEBUG, "Pick First %p created.", (void*)p);
   }
   pf_update_locked(exec_ctx, &p->base, args);
   grpc_lb_policy_init(&p->base, &pick_first_lb_policy_vtable, args->combiner);
   grpc_subchannel_index_ref();
-  GRPC_CLOSURE_INIT(&p->connectivity_changed, pf_connectivity_changed_locked, p,
-                    grpc_combiner_scheduler(args->combiner));
   return &p->base;
 }
 
@@ -699,7 +602,7 @@
 static grpc_lb_policy_factory pick_first_lb_policy_factory = {
     &pick_first_factory_vtable};
 
-static grpc_lb_policy_factory *pick_first_lb_factory_create() {
+static grpc_lb_policy_factory* pick_first_lb_factory_create() {
   return &pick_first_lb_policy_factory;
 }
 
diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
index 911df13..f4ad746 100644
--- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
@@ -28,6 +28,7 @@
 
 #include <grpc/support/alloc.h>
 
+#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
 #include "src/core/ext/filters/client_channel/lb_policy_registry.h"
 #include "src/core/ext/filters/client_channel/subchannel.h"
 #include "src/core/ext/filters/client_channel/subchannel_index.h"
@@ -44,12 +45,12 @@
  *
  * Once a pick is available, \a target is updated and \a on_complete called. */
 typedef struct pending_pick {
-  struct pending_pick *next;
+  struct pending_pick* next;
 
   /* output argument where to store the pick()ed user_data. It'll be NULL if no
    * such data is present or there's an error (the definite test for errors is
    * \a target being NULL). */
-  void **user_data;
+  void** user_data;
 
   /* bitmask passed to pick() and used for selective cancelling. See
    * grpc_lb_policy_cancel_picks() */
@@ -57,25 +58,24 @@
 
   /* output argument where to store the pick()ed connected subchannel, or NULL
    * upon error. */
-  grpc_connected_subchannel **target;
+  grpc_connected_subchannel** target;
 
   /* to be invoked once the pick() has completed (regardless of success) */
-  grpc_closure *on_complete;
+  grpc_closure* on_complete;
 } pending_pick;
 
-typedef struct rr_subchannel_list rr_subchannel_list;
 typedef struct round_robin_lb_policy {
   /** base policy: must be first */
   grpc_lb_policy base;
 
-  rr_subchannel_list *subchannel_list;
+  grpc_lb_subchannel_list* subchannel_list;
 
   /** have we started picking? */
   bool started_picking;
   /** are we shutting down? */
   bool shutdown;
   /** List of picks that are waiting on connectivity */
-  pending_pick *pending_picks;
+  pending_pick* pending_picks;
 
   /** our connectivity state tracker */
   grpc_connectivity_state_tracker state_tracker;
@@ -88,157 +88,9 @@
    * lists if they equal \a latest_pending_subchannel_list. In other words,
    * racing callbacks that reference outdated subchannel lists won't perform any
    * update. */
-  rr_subchannel_list *latest_pending_subchannel_list;
+  grpc_lb_subchannel_list* latest_pending_subchannel_list;
 } round_robin_lb_policy;
 
-typedef struct {
-  /** backpointer to owning subchannel list */
-  rr_subchannel_list *subchannel_list;
-  /** subchannel itself */
-  grpc_subchannel *subchannel;
-  /** notification that connectivity has changed on subchannel */
-  grpc_closure connectivity_changed_closure;
-  /** last observed connectivity. Not updated by
-   * \a grpc_subchannel_notify_on_state_change. Used to determine the previous
-   * state while processing the new state in \a rr_connectivity_changed */
-  grpc_connectivity_state prev_connectivity_state;
-  /** current connectivity state. Updated by \a
-   * grpc_subchannel_notify_on_state_change */
-  grpc_connectivity_state curr_connectivity_state;
-  /** connectivity state to be updated by the watcher, not guarded by
-   * the combiner.  Will be moved to curr_connectivity_state inside of
-   * the combiner by rr_connectivity_changed_locked(). */
-  grpc_connectivity_state pending_connectivity_state_unsafe;
-  /** the subchannel's target user data */
-  void *user_data;
-  /** vtable to operate over \a user_data */
-  const grpc_lb_user_data_vtable *user_data_vtable;
-} subchannel_data;
-
-struct rr_subchannel_list {
-  /** backpointer to owning policy */
-  round_robin_lb_policy *policy;
-
-  /** all our subchannels */
-  size_t num_subchannels;
-  subchannel_data *subchannels;
-
-  /** how many subchannels are in state READY */
-  size_t num_ready;
-  /** how many subchannels are in state TRANSIENT_FAILURE */
-  size_t num_transient_failures;
-  /** how many subchannels are in state SHUTDOWN */
-  size_t num_shutdown;
-  /** how many subchannels are in state IDLE */
-  size_t num_idle;
-
-  /** There will be one ref for each entry in subchannels for which there is a
-   * pending connectivity state watcher callback. */
-  gpr_refcount refcount;
-
-  /** Is this list shutting down? This may be true due to the shutdown of the
-   * policy itself or because a newer update has arrived while this one hadn't
-   * finished processing. */
-  bool shutting_down;
-};
-
-static rr_subchannel_list *rr_subchannel_list_create(round_robin_lb_policy *p,
-                                                     size_t num_subchannels) {
-  rr_subchannel_list *subchannel_list =
-      (rr_subchannel_list *)gpr_zalloc(sizeof(*subchannel_list));
-  subchannel_list->policy = p;
-  subchannel_list->subchannels =
-      (subchannel_data *)gpr_zalloc(sizeof(subchannel_data) * num_subchannels);
-  subchannel_list->num_subchannels = num_subchannels;
-  gpr_ref_init(&subchannel_list->refcount, 1);
-  if (grpc_lb_round_robin_trace.enabled()) {
-    gpr_log(GPR_INFO, "[RR %p] Created subchannel list %p for %lu subchannels",
-            (void *)p, (void *)subchannel_list, (unsigned long)num_subchannels);
-  }
-  return subchannel_list;
-}
-
-static void rr_subchannel_list_destroy(grpc_exec_ctx *exec_ctx,
-                                       rr_subchannel_list *subchannel_list) {
-  GPR_ASSERT(subchannel_list->shutting_down);
-  if (grpc_lb_round_robin_trace.enabled()) {
-    gpr_log(GPR_INFO, "[RR %p] Destroying subchannel_list %p",
-            (void *)subchannel_list->policy, (void *)subchannel_list);
-  }
-  for (size_t i = 0; i < subchannel_list->num_subchannels; i++) {
-    subchannel_data *sd = &subchannel_list->subchannels[i];
-    if (sd->subchannel != NULL) {
-      GRPC_SUBCHANNEL_UNREF(exec_ctx, sd->subchannel,
-                            "rr_subchannel_list_destroy");
-    }
-    sd->subchannel = NULL;
-    if (sd->user_data != NULL) {
-      GPR_ASSERT(sd->user_data_vtable != NULL);
-      sd->user_data_vtable->destroy(exec_ctx, sd->user_data);
-      sd->user_data = NULL;
-    }
-  }
-  gpr_free(subchannel_list->subchannels);
-  gpr_free(subchannel_list);
-}
-
-static void rr_subchannel_list_ref(rr_subchannel_list *subchannel_list,
-                                   const char *reason) {
-  gpr_ref_non_zero(&subchannel_list->refcount);
-  if (grpc_lb_round_robin_trace.enabled()) {
-    const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count);
-    gpr_log(GPR_INFO, "[RR %p] subchannel_list %p REF %lu->%lu (%s)",
-            (void *)subchannel_list->policy, (void *)subchannel_list,
-            (unsigned long)(count - 1), (unsigned long)count, reason);
-  }
-}
-
-static void rr_subchannel_list_unref(grpc_exec_ctx *exec_ctx,
-                                     rr_subchannel_list *subchannel_list,
-                                     const char *reason) {
-  const bool done = gpr_unref(&subchannel_list->refcount);
-  if (grpc_lb_round_robin_trace.enabled()) {
-    const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count);
-    gpr_log(GPR_INFO, "[RR %p] subchannel_list %p UNREF %lu->%lu (%s)",
-            (void *)subchannel_list->policy, (void *)subchannel_list,
-            (unsigned long)(count + 1), (unsigned long)count, reason);
-  }
-  if (done) {
-    rr_subchannel_list_destroy(exec_ctx, subchannel_list);
-  }
-}
-
-/** Mark \a subchannel_list as discarded. Unsubscribes all its subchannels. The
- * watcher's callback will ultimately unref \a subchannel_list.  */
-static void rr_subchannel_list_shutdown_and_unref(
-    grpc_exec_ctx *exec_ctx, rr_subchannel_list *subchannel_list,
-    const char *reason) {
-  GPR_ASSERT(!subchannel_list->shutting_down);
-  if (grpc_lb_round_robin_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "[RR %p] Shutting down subchannel_list %p (%s)",
-            (void *)subchannel_list->policy, (void *)subchannel_list, reason);
-  }
-  GPR_ASSERT(!subchannel_list->shutting_down);
-  subchannel_list->shutting_down = true;
-  for (size_t i = 0; i < subchannel_list->num_subchannels; i++) {
-    subchannel_data *sd = &subchannel_list->subchannels[i];
-    if (sd->subchannel != NULL) {  // if subchannel isn't shutdown, unsubscribe.
-      if (grpc_lb_round_robin_trace.enabled()) {
-        gpr_log(
-            GPR_DEBUG,
-            "[RR %p] Unsubscribing from subchannel %p as part of shutting down "
-            "subchannel_list %p",
-            (void *)subchannel_list->policy, (void *)sd->subchannel,
-            (void *)subchannel_list);
-      }
-      grpc_subchannel_notify_on_state_change(exec_ctx, sd->subchannel, NULL,
-                                             NULL,
-                                             &sd->connectivity_changed_closure);
-    }
-  }
-  rr_subchannel_list_unref(exec_ctx, subchannel_list, reason);
-}
-
 /** Returns the index into p->subchannel_list->subchannels of the next
  * subchannel in READY state, or p->subchannel_list->num_subchannels if no
  * subchannel is READY.
@@ -246,13 +98,13 @@
  * Note that this function does *not* update p->last_ready_subchannel_index.
  * The caller must do that if it returns a pick. */
 static size_t get_next_ready_subchannel_index_locked(
-    const round_robin_lb_policy *p) {
+    const round_robin_lb_policy* p) {
   GPR_ASSERT(p->subchannel_list != NULL);
   if (grpc_lb_round_robin_trace.enabled()) {
     gpr_log(GPR_INFO,
             "[RR %p] getting next ready subchannel (out of %lu), "
             "last_ready_subchannel_index=%lu",
-            (void *)p, (unsigned long)p->subchannel_list->num_subchannels,
+            (void*)p, (unsigned long)p->subchannel_list->num_subchannels,
             (unsigned long)p->last_ready_subchannel_index);
   }
   for (size_t i = 0; i < p->subchannel_list->num_subchannels; ++i) {
@@ -263,8 +115,8 @@
           GPR_DEBUG,
           "[RR %p] checking subchannel %p, subchannel_list %p, index %lu: "
           "state=%s",
-          (void *)p, (void *)p->subchannel_list->subchannels[index].subchannel,
-          (void *)p->subchannel_list, (unsigned long)index,
+          (void*)p, (void*)p->subchannel_list->subchannels[index].subchannel,
+          (void*)p->subchannel_list, (unsigned long)index,
           grpc_connectivity_state_name(
               p->subchannel_list->subchannels[index].curr_connectivity_state));
     }
@@ -274,87 +126,91 @@
         gpr_log(GPR_DEBUG,
                 "[RR %p] found next ready subchannel (%p) at index %lu of "
                 "subchannel_list %p",
-                (void *)p,
-                (void *)p->subchannel_list->subchannels[index].subchannel,
-                (unsigned long)index, (void *)p->subchannel_list);
+                (void*)p,
+                (void*)p->subchannel_list->subchannels[index].subchannel,
+                (unsigned long)index, (void*)p->subchannel_list);
       }
       return index;
     }
   }
   if (grpc_lb_round_robin_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "[RR %p] no subchannels in ready state", (void *)p);
+    gpr_log(GPR_DEBUG, "[RR %p] no subchannels in ready state", (void*)p);
   }
   return p->subchannel_list->num_subchannels;
 }
 
 // Sets p->last_ready_subchannel_index to last_ready_index.
-static void update_last_ready_subchannel_index_locked(round_robin_lb_policy *p,
+static void update_last_ready_subchannel_index_locked(round_robin_lb_policy* p,
                                                       size_t last_ready_index) {
   GPR_ASSERT(last_ready_index < p->subchannel_list->num_subchannels);
   p->last_ready_subchannel_index = last_ready_index;
   if (grpc_lb_round_robin_trace.enabled()) {
-    gpr_log(
-        GPR_DEBUG,
-        "[RR %p] setting last_ready_subchannel_index=%lu (SC %p, CSC %p)",
-        (void *)p, (unsigned long)last_ready_index,
-        (void *)p->subchannel_list->subchannels[last_ready_index].subchannel,
-        (void *)grpc_subchannel_get_connected_subchannel(
-            p->subchannel_list->subchannels[last_ready_index].subchannel));
+    gpr_log(GPR_DEBUG,
+            "[RR %p] setting last_ready_subchannel_index=%lu (SC %p, CSC %p)",
+            (void*)p, (unsigned long)last_ready_index,
+            (void*)p->subchannel_list->subchannels[last_ready_index].subchannel,
+            (void*)p->subchannel_list->subchannels[last_ready_index]
+                .connected_subchannel);
   }
 }
 
-static void rr_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
+static void rr_destroy(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
   if (grpc_lb_round_robin_trace.enabled()) {
     gpr_log(GPR_DEBUG, "[RR %p] Destroying Round Robin policy at %p",
-            (void *)pol, (void *)pol);
+            (void*)pol, (void*)pol);
   }
+  GPR_ASSERT(p->subchannel_list == NULL);
+  GPR_ASSERT(p->latest_pending_subchannel_list == NULL);
   grpc_connectivity_state_destroy(exec_ctx, &p->state_tracker);
   grpc_subchannel_index_unref();
   gpr_free(p);
 }
 
-static void rr_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
+static void shutdown_locked(grpc_exec_ctx* exec_ctx, round_robin_lb_policy* p,
+                            grpc_error* error) {
   if (grpc_lb_round_robin_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "[RR %p] Shutting down Round Robin policy at %p",
-            (void *)pol, (void *)pol);
+    gpr_log(GPR_DEBUG, "[RR %p] Shutting down", p);
   }
   p->shutdown = true;
-  pending_pick *pp;
-  while ((pp = p->pending_picks)) {
+  pending_pick* pp;
+  while ((pp = p->pending_picks) != NULL) {
     p->pending_picks = pp->next;
     *pp->target = NULL;
-    GRPC_CLOSURE_SCHED(
-        exec_ctx, pp->on_complete,
-        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel Shutdown"));
+    GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete, GRPC_ERROR_REF(error));
     gpr_free(pp);
   }
-  grpc_connectivity_state_set(
-      exec_ctx, &p->state_tracker, GRPC_CHANNEL_SHUTDOWN,
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel Shutdown"), "rr_shutdown");
-  const bool latest_is_current =
-      p->subchannel_list == p->latest_pending_subchannel_list;
-  rr_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list,
-                                        "sl_shutdown_rr_shutdown");
-  p->subchannel_list = NULL;
-  if (!latest_is_current && p->latest_pending_subchannel_list != NULL &&
-      !p->latest_pending_subchannel_list->shutting_down) {
-    rr_subchannel_list_shutdown_and_unref(exec_ctx,
-                                          p->latest_pending_subchannel_list,
-                                          "sl_shutdown_pending_rr_shutdown");
+  grpc_connectivity_state_set(exec_ctx, &p->state_tracker,
+                              GRPC_CHANNEL_SHUTDOWN, GRPC_ERROR_REF(error),
+                              "rr_shutdown");
+  if (p->subchannel_list != NULL) {
+    grpc_lb_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list,
+                                               "sl_shutdown_rr_shutdown");
+    p->subchannel_list = NULL;
+  }
+  if (p->latest_pending_subchannel_list != NULL) {
+    grpc_lb_subchannel_list_shutdown_and_unref(
+        exec_ctx, p->latest_pending_subchannel_list,
+        "sl_shutdown_pending_rr_shutdown");
     p->latest_pending_subchannel_list = NULL;
   }
+  GRPC_ERROR_UNREF(error);
 }
 
-static void rr_cancel_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-                                  grpc_connected_subchannel **target,
-                                  grpc_error *error) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
-  pending_pick *pp = p->pending_picks;
+static void rr_shutdown_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
+  shutdown_locked(exec_ctx, p,
+                  GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel Shutdown"));
+}
+
+static void rr_cancel_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+                                  grpc_connected_subchannel** target,
+                                  grpc_error* error) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
+  pending_pick* pp = p->pending_picks;
   p->pending_picks = NULL;
   while (pp != NULL) {
-    pending_pick *next = pp->next;
+    pending_pick* next = pp->next;
     if (pp->target == target) {
       *target = NULL;
       GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete,
@@ -370,15 +226,15 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void rr_cancel_picks_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
+static void rr_cancel_picks_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
                                    uint32_t initial_metadata_flags_mask,
                                    uint32_t initial_metadata_flags_eq,
-                                   grpc_error *error) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
-  pending_pick *pp = p->pending_picks;
+                                   grpc_error* error) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
+  pending_pick* pp = p->pending_picks;
   p->pending_picks = NULL;
   while (pp != NULL) {
-    pending_pick *next = pp->next;
+    pending_pick* next = pp->next;
     if ((pp->initial_metadata_flags & initial_metadata_flags_mask) ==
         initial_metadata_flags_eq) {
       *pp->target = NULL;
@@ -395,45 +251,43 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void start_picking_locked(grpc_exec_ctx *exec_ctx,
-                                 round_robin_lb_policy *p) {
+static void start_picking_locked(grpc_exec_ctx* exec_ctx,
+                                 round_robin_lb_policy* p) {
   p->started_picking = true;
   for (size_t i = 0; i < p->subchannel_list->num_subchannels; i++) {
-    subchannel_data *sd = &p->subchannel_list->subchannels[i];
-    GRPC_LB_POLICY_WEAK_REF(&p->base, "start_picking_locked");
-    rr_subchannel_list_ref(sd->subchannel_list, "started_picking");
-    grpc_subchannel_notify_on_state_change(
-        exec_ctx, sd->subchannel, p->base.interested_parties,
-        &sd->pending_connectivity_state_unsafe,
-        &sd->connectivity_changed_closure);
+    grpc_lb_subchannel_list_ref_for_connectivity_watch(p->subchannel_list,
+                                                       "connectivity_watch");
+    grpc_lb_subchannel_data_start_connectivity_watch(
+        exec_ctx, &p->subchannel_list->subchannels[i]);
   }
 }
 
-static void rr_exit_idle_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
+static void rr_exit_idle_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
   if (!p->started_picking) {
     start_picking_locked(exec_ctx, p);
   }
 }
 
-static int rr_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-                          const grpc_lb_policy_pick_args *pick_args,
-                          grpc_connected_subchannel **target,
-                          grpc_call_context_element *context, void **user_data,
-                          grpc_closure *on_complete) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
-  GPR_ASSERT(!p->shutdown);
+static int rr_pick_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+                          const grpc_lb_policy_pick_args* pick_args,
+                          grpc_connected_subchannel** target,
+                          grpc_call_context_element* context, void** user_data,
+                          grpc_closure* on_complete) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
   if (grpc_lb_round_robin_trace.enabled()) {
-    gpr_log(GPR_INFO, "[RR %p] Trying to pick", (void *)pol);
+    gpr_log(GPR_INFO, "[RR %p] Trying to pick (shutdown: %d)", (void*)pol,
+            p->shutdown);
   }
+  GPR_ASSERT(!p->shutdown);
   if (p->subchannel_list != NULL) {
     const size_t next_ready_index = get_next_ready_subchannel_index_locked(p);
     if (next_ready_index < p->subchannel_list->num_subchannels) {
       /* readily available, report right away */
-      subchannel_data *sd = &p->subchannel_list->subchannels[next_ready_index];
-      *target = GRPC_CONNECTED_SUBCHANNEL_REF(
-          grpc_subchannel_get_connected_subchannel(sd->subchannel),
-          "rr_picked");
+      grpc_lb_subchannel_data* sd =
+          &p->subchannel_list->subchannels[next_ready_index];
+      *target =
+          GRPC_CONNECTED_SUBCHANNEL_REF(sd->connected_subchannel, "rr_picked");
       if (user_data != NULL) {
         *user_data = sd->user_data;
       }
@@ -442,8 +296,8 @@
             GPR_DEBUG,
             "[RR %p] Picked target <-- Subchannel %p (connected %p) (sl %p, "
             "index %lu)",
-            (void *)p, (void *)sd->subchannel, (void *)*target,
-            (void *)sd->subchannel_list, (unsigned long)next_ready_index);
+            (void*)p, (void*)sd->subchannel, (void*)*target,
+            (void*)sd->subchannel_list, (unsigned long)next_ready_index);
       }
       /* only advance the last picked pointer if the selection was used */
       update_last_ready_subchannel_index_locked(p, next_ready_index);
@@ -454,7 +308,7 @@
   if (!p->started_picking) {
     start_picking_locked(exec_ctx, p);
   }
-  pending_pick *pp = (pending_pick *)gpr_malloc(sizeof(*pp));
+  pending_pick* pp = (pending_pick*)gpr_malloc(sizeof(*pp));
   pp->next = p->pending_picks;
   pp->target = target;
   pp->on_complete = on_complete;
@@ -464,8 +318,8 @@
   return 0;
 }
 
-static void update_state_counters_locked(subchannel_data *sd) {
-  rr_subchannel_list *subchannel_list = sd->subchannel_list;
+static void update_state_counters_locked(grpc_lb_subchannel_data* sd) {
+  grpc_lb_subchannel_list* subchannel_list = sd->subchannel_list;
   if (sd->prev_connectivity_state == GRPC_CHANNEL_READY) {
     GPR_ASSERT(subchannel_list->num_ready > 0);
     --subchannel_list->num_ready;
@@ -479,6 +333,7 @@
     GPR_ASSERT(subchannel_list->num_idle > 0);
     --subchannel_list->num_idle;
   }
+  sd->prev_connectivity_state = sd->curr_connectivity_state;
   if (sd->curr_connectivity_state == GRPC_CHANNEL_READY) {
     ++subchannel_list->num_ready;
   } else if (sd->curr_connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
@@ -491,12 +346,12 @@
 }
 
 /** Sets the policy's connectivity status based on that of the passed-in \a sd
- * (the subchannel_data associted with the updated subchannel) and the
+ * (the grpc_lb_subchannel_data associted with the updated subchannel) and the
  * subchannel list \a sd belongs to (sd->subchannel_list). \a error will only be
  * used upon policy transition to TRANSIENT_FAILURE or SHUTDOWN. Returns the
  * connectivity status set. */
 static grpc_connectivity_state update_lb_connectivity_status_locked(
-    grpc_exec_ctx *exec_ctx, subchannel_data *sd, grpc_error *error) {
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_data* sd, grpc_error* error) {
   /* In priority order. The first rule to match terminates the search (ie, if we
    * are on rule n, all previous rules were unfulfilled).
    *
@@ -518,8 +373,8 @@
    *    CHECK: p->num_idle == p->subchannel_list->num_subchannels.
    */
   grpc_connectivity_state new_state = sd->curr_connectivity_state;
-  rr_subchannel_list *subchannel_list = sd->subchannel_list;
-  round_robin_lb_policy *p = subchannel_list->policy;
+  grpc_lb_subchannel_list* subchannel_list = sd->subchannel_list;
+  round_robin_lb_policy* p = (round_robin_lb_policy*)subchannel_list->policy;
   if (subchannel_list->num_ready > 0) { /* 1) READY */
     grpc_connectivity_state_set(exec_ctx, &p->state_tracker, GRPC_CHANNEL_READY,
                                 GRPC_ERROR_NONE, "rr_ready");
@@ -537,6 +392,11 @@
                                 "rr_shutdown");
     p->shutdown = true;
     new_state = GRPC_CHANNEL_SHUTDOWN;
+    if (grpc_lb_round_robin_trace.enabled()) {
+      gpr_log(GPR_INFO,
+              "[RR %p] Shutting down: all subchannels have gone into shutdown",
+              (void*)p);
+    }
   } else if (subchannel_list->num_transient_failures ==
              p->subchannel_list->num_subchannels) { /* 4) TRANSIENT_FAILURE */
     grpc_connectivity_state_set(exec_ctx, &p->state_tracker,
@@ -553,17 +413,18 @@
   return new_state;
 }
 
-static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error) {
-  subchannel_data *sd = (subchannel_data *)arg;
-  round_robin_lb_policy *p = sd->subchannel_list->policy;
+static void rr_connectivity_changed_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error) {
+  grpc_lb_subchannel_data* sd = (grpc_lb_subchannel_data*)arg;
+  round_robin_lb_policy* p =
+      (round_robin_lb_policy*)sd->subchannel_list->policy;
   if (grpc_lb_round_robin_trace.enabled()) {
     gpr_log(
         GPR_DEBUG,
         "[RR %p] connectivity changed for subchannel %p, subchannel_list %p: "
         "prev_state=%s new_state=%s p->shutdown=%d "
         "sd->subchannel_list->shutting_down=%d error=%s",
-        (void *)p, (void *)sd->subchannel, (void *)sd->subchannel_list,
+        (void*)p, (void*)sd->subchannel, (void*)sd->subchannel_list,
         grpc_connectivity_state_name(sd->prev_connectivity_state),
         grpc_connectivity_state_name(sd->pending_connectivity_state_unsafe),
         p->shutdown, sd->subchannel_list->shutting_down,
@@ -571,71 +432,50 @@
   }
   // If the policy is shutting down, unref and return.
   if (p->shutdown) {
-    rr_subchannel_list_unref(exec_ctx, sd->subchannel_list,
-                             "pol_shutdown+started_picking");
-    GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "pol_shutdown");
+    grpc_lb_subchannel_data_stop_connectivity_watch(exec_ctx, sd);
+    grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd, "rr_shutdown");
+    grpc_lb_subchannel_list_unref_for_connectivity_watch(
+        exec_ctx, sd->subchannel_list, "rr_shutdown");
     return;
   }
-  if (sd->subchannel_list->shutting_down && error == GRPC_ERROR_CANCELLED) {
-    // the subchannel list associated with sd has been discarded. This callback
-    // corresponds to the unsubscription. The unrefs correspond to the picking
-    // ref (start_picking_locked or update_started_picking).
-    rr_subchannel_list_unref(exec_ctx, sd->subchannel_list,
-                             "sl_shutdown+started_picking");
-    GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "sl_shutdown+picking");
+  // If the subchannel list is shutting down, stop watching.
+  if (sd->subchannel_list->shutting_down || error == GRPC_ERROR_CANCELLED) {
+    grpc_lb_subchannel_data_stop_connectivity_watch(exec_ctx, sd);
+    grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd, "rr_sl_shutdown");
+    grpc_lb_subchannel_list_unref_for_connectivity_watch(
+        exec_ctx, sd->subchannel_list, "rr_sl_shutdown");
     return;
   }
-  // Dispose of outdated subchannel lists.
-  if (sd->subchannel_list != p->subchannel_list &&
-      sd->subchannel_list != p->latest_pending_subchannel_list) {
-    const char *reason = NULL;
-    if (sd->subchannel_list->shutting_down) {
-      reason = "sl_outdated_straggler";
-      rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, reason);
-    } else {
-      reason = "sl_outdated";
-      rr_subchannel_list_shutdown_and_unref(exec_ctx, sd->subchannel_list,
-                                            reason);
-    }
-    GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, reason);
-    return;
-  }
+  // If we're still here, the notification must be for a subchannel in
+  // either the current or latest pending subchannel lists.
+  GPR_ASSERT(sd->subchannel_list == p->subchannel_list ||
+             sd->subchannel_list == p->latest_pending_subchannel_list);
   // Now that we're inside the combiner, copy the pending connectivity
   // state (which was set by the connectivity state watcher) to
   // curr_connectivity_state, which is what we use inside of the combiner.
   sd->curr_connectivity_state = sd->pending_connectivity_state_unsafe;
   // Update state counters and determine new overall state.
   update_state_counters_locked(sd);
-  sd->prev_connectivity_state = sd->curr_connectivity_state;
   const grpc_connectivity_state new_policy_connectivity_state =
       update_lb_connectivity_status_locked(exec_ctx, sd, GRPC_ERROR_REF(error));
   // If the sd's new state is SHUTDOWN, unref the subchannel, and if the new
   // policy's state is SHUTDOWN, clean up.
   if (sd->curr_connectivity_state == GRPC_CHANNEL_SHUTDOWN) {
-    GRPC_SUBCHANNEL_UNREF(exec_ctx, sd->subchannel, "rr_subchannel_shutdown");
-    sd->subchannel = NULL;
-    if (sd->user_data != NULL) {
-      GPR_ASSERT(sd->user_data_vtable != NULL);
-      sd->user_data_vtable->destroy(exec_ctx, sd->user_data);
-      sd->user_data = NULL;
-    }
+    grpc_lb_subchannel_data_stop_connectivity_watch(exec_ctx, sd);
+    grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd,
+                                             "rr_connectivity_shutdown");
+    grpc_lb_subchannel_list_unref_for_connectivity_watch(
+        exec_ctx, sd->subchannel_list, "rr_connectivity_shutdown");
     if (new_policy_connectivity_state == GRPC_CHANNEL_SHUTDOWN) {
-      // the policy is shutting down. Flush all the pending picks...
-      pending_pick *pp;
-      while ((pp = p->pending_picks)) {
-        p->pending_picks = pp->next;
-        *pp->target = NULL;
-        GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete, GRPC_ERROR_NONE);
-        gpr_free(pp);
-      }
+      shutdown_locked(exec_ctx, p, GRPC_ERROR_REF(error));
     }
-    rr_subchannel_list_unref(exec_ctx, sd->subchannel_list,
-                             "sd_shutdown+started_picking");
-    // unref the "rr_connectivity_update" weak ref from start_picking.
-    GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base,
-                              "rr_connectivity_sd_shutdown");
   } else {  // sd not in SHUTDOWN
     if (sd->curr_connectivity_state == GRPC_CHANNEL_READY) {
+      if (sd->connected_subchannel == NULL) {
+        sd->connected_subchannel = GRPC_CONNECTED_SUBCHANNEL_REF(
+            grpc_subchannel_get_connected_subchannel(sd->subchannel),
+            "connected");
+      }
       if (sd->subchannel_list != p->subchannel_list) {
         // promote sd->subchannel_list to p->subchannel_list.
         // sd->subchannel_list must be equal to
@@ -651,13 +491,13 @@
           gpr_log(GPR_DEBUG,
                   "[RR %p] phasing out subchannel list %p (size %lu) in favor "
                   "of %p (size %lu)",
-                  (void *)p, (void *)p->subchannel_list, num_subchannels,
-                  (void *)sd->subchannel_list, num_subchannels);
+                  (void*)p, (void*)p->subchannel_list, num_subchannels,
+                  (void*)sd->subchannel_list, num_subchannels);
         }
         if (p->subchannel_list != NULL) {
           // dispose of the current subchannel_list
-          rr_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list,
-                                                "sl_phase_out_shutdown");
+          grpc_lb_subchannel_list_shutdown_and_unref(
+              exec_ctx, p->subchannel_list, "sl_phase_out_shutdown");
         }
         p->subchannel_list = p->latest_pending_subchannel_list;
         p->latest_pending_subchannel_list = NULL;
@@ -667,19 +507,18 @@
        * p->pending_picks. This preemtively replicates rr_pick()'s actions. */
       const size_t next_ready_index = get_next_ready_subchannel_index_locked(p);
       GPR_ASSERT(next_ready_index < p->subchannel_list->num_subchannels);
-      subchannel_data *selected =
+      grpc_lb_subchannel_data* selected =
           &p->subchannel_list->subchannels[next_ready_index];
       if (p->pending_picks != NULL) {
         // if the selected subchannel is going to be used for the pending
         // picks, update the last picked pointer
         update_last_ready_subchannel_index_locked(p, next_ready_index);
       }
-      pending_pick *pp;
+      pending_pick* pp;
       while ((pp = p->pending_picks)) {
         p->pending_picks = pp->next;
         *pp->target = GRPC_CONNECTED_SUBCHANNEL_REF(
-            grpc_subchannel_get_connected_subchannel(selected->subchannel),
-            "rr_picked");
+            selected->connected_subchannel, "rr_picked");
         if (pp->user_data != NULL) {
           *pp->user_data = selected->user_data;
         }
@@ -687,185 +526,119 @@
           gpr_log(GPR_DEBUG,
                   "[RR %p] Fulfilling pending pick. Target <-- subchannel %p "
                   "(subchannel_list %p, index %lu)",
-                  (void *)p, (void *)selected->subchannel,
-                  (void *)p->subchannel_list, (unsigned long)next_ready_index);
+                  (void*)p, (void*)selected->subchannel,
+                  (void*)p->subchannel_list, (unsigned long)next_ready_index);
         }
         GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete, GRPC_ERROR_NONE);
         gpr_free(pp);
       }
     }
-    /* renew notification: reuses the "rr_connectivity_update" weak ref on the
-     * policy as well as the sd->subchannel_list ref. */
-    grpc_subchannel_notify_on_state_change(
-        exec_ctx, sd->subchannel, p->base.interested_parties,
-        &sd->pending_connectivity_state_unsafe,
-        &sd->connectivity_changed_closure);
+    // Renew notification.
+    grpc_lb_subchannel_data_start_connectivity_watch(exec_ctx, sd);
   }
 }
 
 static grpc_connectivity_state rr_check_connectivity_locked(
-    grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_error **error) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol, grpc_error** error) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
   return grpc_connectivity_state_get(&p->state_tracker, error);
 }
 
-static void rr_notify_on_state_change_locked(grpc_exec_ctx *exec_ctx,
-                                             grpc_lb_policy *pol,
-                                             grpc_connectivity_state *current,
-                                             grpc_closure *notify) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
+static void rr_notify_on_state_change_locked(grpc_exec_ctx* exec_ctx,
+                                             grpc_lb_policy* pol,
+                                             grpc_connectivity_state* current,
+                                             grpc_closure* notify) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
   grpc_connectivity_state_notify_on_state_change(exec_ctx, &p->state_tracker,
                                                  current, notify);
 }
 
-static void rr_ping_one_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
-                               grpc_closure *closure) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
+static void rr_ping_one_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
+                               grpc_closure* closure) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
   const size_t next_ready_index = get_next_ready_subchannel_index_locked(p);
   if (next_ready_index < p->subchannel_list->num_subchannels) {
-    subchannel_data *selected =
+    grpc_lb_subchannel_data* selected =
         &p->subchannel_list->subchannels[next_ready_index];
-    grpc_connected_subchannel *target = GRPC_CONNECTED_SUBCHANNEL_REF(
-        grpc_subchannel_get_connected_subchannel(selected->subchannel),
-        "rr_picked");
+    grpc_connected_subchannel* target = GRPC_CONNECTED_SUBCHANNEL_REF(
+        selected->connected_subchannel, "rr_ping");
     grpc_connected_subchannel_ping(exec_ctx, target, closure);
-    GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, target, "rr_picked");
+    GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, target, "rr_ping");
   } else {
-    GRPC_CLOSURE_SCHED(exec_ctx, closure, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-                                              "Round Robin not connected"));
+    GRPC_CLOSURE_SCHED(
+        exec_ctx, closure,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Round Robin not connected"));
   }
 }
 
-static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
-                             const grpc_lb_policy_args *args) {
-  round_robin_lb_policy *p = (round_robin_lb_policy *)policy;
-  const grpc_arg *arg =
+static void rr_update_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* policy,
+                             const grpc_lb_policy_args* args) {
+  round_robin_lb_policy* p = (round_robin_lb_policy*)policy;
+  const grpc_arg* arg =
       grpc_channel_args_find(args->args, GRPC_ARG_LB_ADDRESSES);
   if (arg == NULL || arg->type != GRPC_ARG_POINTER) {
+    gpr_log(GPR_ERROR, "[RR %p] update provided no addresses; ignoring", p);
+    // If we don't have a current subchannel list, go into TRANSIENT_FAILURE.
+    // Otherwise, keep using the current subchannel list (ignore this update).
     if (p->subchannel_list == NULL) {
-      // If we don't have a current subchannel list, go into TRANSIENT FAILURE.
       grpc_connectivity_state_set(
           exec_ctx, &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
           GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing update in args"),
           "rr_update_missing");
-    } else {
-      // otherwise, keep using the current subchannel list (ignore this update).
-      gpr_log(GPR_ERROR,
-              "[RR %p] No valid LB addresses channel arg for update, ignoring.",
-              (void *)p);
     }
     return;
   }
-  grpc_lb_addresses *addresses = (grpc_lb_addresses *)arg->value.pointer.p;
-  rr_subchannel_list *subchannel_list =
-      rr_subchannel_list_create(p, addresses->num_addresses);
-  if (addresses->num_addresses == 0) {
+  grpc_lb_addresses* addresses = (grpc_lb_addresses*)arg->value.pointer.p;
+  if (grpc_lb_round_robin_trace.enabled()) {
+    gpr_log(GPR_DEBUG, "[RR %p] received update with %" PRIuPTR " addresses", p,
+            addresses->num_addresses);
+  }
+  grpc_lb_subchannel_list* subchannel_list = grpc_lb_subchannel_list_create(
+      exec_ctx, &p->base, &grpc_lb_round_robin_trace, addresses, args,
+      rr_connectivity_changed_locked);
+  if (subchannel_list->num_subchannels == 0) {
     grpc_connectivity_state_set(
         exec_ctx, &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"),
         "rr_update_empty");
     if (p->subchannel_list != NULL) {
-      rr_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list,
-                                            "sl_shutdown_empty_update");
+      grpc_lb_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list,
+                                                 "sl_shutdown_empty_update");
     }
     p->subchannel_list = subchannel_list;  // empty list
     return;
   }
-  size_t subchannel_index = 0;
-  if (p->latest_pending_subchannel_list != NULL && p->started_picking) {
-    if (grpc_lb_round_robin_trace.enabled()) {
-      gpr_log(GPR_DEBUG,
-              "[RR %p] Shutting down latest pending subchannel list %p, about "
-              "to be replaced by newer latest %p",
-              (void *)p, (void *)p->latest_pending_subchannel_list,
-              (void *)subchannel_list);
+  if (p->started_picking) {
+    if (p->latest_pending_subchannel_list != NULL) {
+      if (grpc_lb_round_robin_trace.enabled()) {
+        gpr_log(GPR_DEBUG,
+                "[RR %p] Shutting down latest pending subchannel list %p, "
+                "about to be replaced by newer latest %p",
+                (void*)p, (void*)p->latest_pending_subchannel_list,
+                (void*)subchannel_list);
+      }
+      grpc_lb_subchannel_list_shutdown_and_unref(
+          exec_ctx, p->latest_pending_subchannel_list, "sl_outdated");
     }
-    rr_subchannel_list_shutdown_and_unref(
-        exec_ctx, p->latest_pending_subchannel_list, "sl_outdated_dont_smash");
-  }
-  p->latest_pending_subchannel_list = subchannel_list;
-  grpc_subchannel_args sc_args;
-  /* We need to remove the LB addresses in order to be able to compare the
-   * subchannel keys of subchannels from a different batch of addresses. */
-  static const char *keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS,
-                                         GRPC_ARG_LB_ADDRESSES};
-  /* Create subchannels for addresses in the update. */
-  for (size_t i = 0; i < addresses->num_addresses; i++) {
-    // If there were any balancer, we would have chosen grpclb policy instead.
-    GPR_ASSERT(!addresses->addresses[i].is_balancer);
-    memset(&sc_args, 0, sizeof(grpc_subchannel_args));
-    grpc_arg addr_arg =
-        grpc_create_subchannel_address_arg(&addresses->addresses[i].address);
-    grpc_channel_args *new_args = grpc_channel_args_copy_and_add_and_remove(
-        args->args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), &addr_arg,
-        1);
-    gpr_free(addr_arg.value.string);
-    sc_args.args = new_args;
-    grpc_subchannel *subchannel = grpc_client_channel_factory_create_subchannel(
-        exec_ctx, args->client_channel_factory, &sc_args);
-    grpc_channel_args_destroy(exec_ctx, new_args);
-    grpc_error *error;
-    // Get the connectivity state of the subchannel. Already existing ones may
-    // be in a state other than INIT.
-    const grpc_connectivity_state subchannel_connectivity_state =
-        grpc_subchannel_check_connectivity(subchannel, &error);
-    if (error != GRPC_ERROR_NONE) {
-      // The subchannel is in error (e.g. shutting down). Ignore it.
-      GRPC_SUBCHANNEL_UNREF(exec_ctx, subchannel, "new_sc_connectivity_error");
-      GRPC_ERROR_UNREF(error);
-      continue;
-    }
-    if (grpc_lb_round_robin_trace.enabled()) {
-      char *address_uri =
-          grpc_sockaddr_to_uri(&addresses->addresses[i].address);
-      gpr_log(
-          GPR_DEBUG,
-          "[RR %p] index %lu: Created subchannel %p for address uri %s into "
-          "subchannel_list %p. Connectivity state %s",
-          (void *)p, (unsigned long)subchannel_index, (void *)subchannel,
-          address_uri, (void *)subchannel_list,
-          grpc_connectivity_state_name(subchannel_connectivity_state));
-      gpr_free(address_uri);
-    }
-    subchannel_data *sd = &subchannel_list->subchannels[subchannel_index++];
-    sd->subchannel_list = subchannel_list;
-    sd->subchannel = subchannel;
-    GRPC_CLOSURE_INIT(&sd->connectivity_changed_closure,
-                      rr_connectivity_changed_locked, sd,
-                      grpc_combiner_scheduler(args->combiner));
-    /* use some sentinel value outside of the range of
-     * grpc_connectivity_state to signal an undefined previous state. We
-     * won't be referring to this value again and it'll be overwritten after
-     * the first call to rr_connectivity_changed_locked */
-    sd->prev_connectivity_state = GRPC_CHANNEL_INIT;
-    sd->curr_connectivity_state = subchannel_connectivity_state;
-    sd->user_data_vtable = addresses->user_data_vtable;
-    if (sd->user_data_vtable != NULL) {
-      sd->user_data =
-          sd->user_data_vtable->copy(addresses->addresses[i].user_data);
-    }
-    if (p->started_picking) {
-      rr_subchannel_list_ref(sd->subchannel_list, "update_started_picking");
-      GRPC_LB_POLICY_WEAK_REF(&p->base, "rr_connectivity_update");
-      /* 2. Watch every new subchannel. A subchannel list becomes active the
+    p->latest_pending_subchannel_list = subchannel_list;
+    for (size_t i = 0; i < subchannel_list->num_subchannels; ++i) {
+      /* Watch every new subchannel. A subchannel list becomes active the
        * moment one of its subchannels is READY. At that moment, we swap
        * p->subchannel_list for sd->subchannel_list, provided the subchannel
        * list is still valid (ie, isn't shutting down) */
-      grpc_subchannel_notify_on_state_change(
-          exec_ctx, sd->subchannel, p->base.interested_parties,
-          &sd->pending_connectivity_state_unsafe,
-          &sd->connectivity_changed_closure);
+      grpc_lb_subchannel_list_ref_for_connectivity_watch(subchannel_list,
+                                                         "connectivity_watch");
+      grpc_lb_subchannel_data_start_connectivity_watch(
+          exec_ctx, &subchannel_list->subchannels[i]);
     }
-  }
-  if (!p->started_picking) {
+  } else {
     // The policy isn't picking yet. Save the update for later, disposing of
     // previous version if any.
     if (p->subchannel_list != NULL) {
-      rr_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list,
-                                            "rr_update_before_started_picking");
+      grpc_lb_subchannel_list_shutdown_and_unref(
+          exec_ctx, p->subchannel_list, "rr_update_before_started_picking");
     }
     p->subchannel_list = subchannel_list;
-    p->latest_pending_subchannel_list = NULL;
   }
 }
 
@@ -881,22 +654,22 @@
     rr_notify_on_state_change_locked,
     rr_update_locked};
 
-static void round_robin_factory_ref(grpc_lb_policy_factory *factory) {}
+static void round_robin_factory_ref(grpc_lb_policy_factory* factory) {}
 
-static void round_robin_factory_unref(grpc_lb_policy_factory *factory) {}
+static void round_robin_factory_unref(grpc_lb_policy_factory* factory) {}
 
-static grpc_lb_policy *round_robin_create(grpc_exec_ctx *exec_ctx,
-                                          grpc_lb_policy_factory *factory,
-                                          grpc_lb_policy_args *args) {
+static grpc_lb_policy* round_robin_create(grpc_exec_ctx* exec_ctx,
+                                          grpc_lb_policy_factory* factory,
+                                          grpc_lb_policy_args* args) {
   GPR_ASSERT(args->client_channel_factory != NULL);
-  round_robin_lb_policy *p = (round_robin_lb_policy *)gpr_zalloc(sizeof(*p));
+  round_robin_lb_policy* p = (round_robin_lb_policy*)gpr_zalloc(sizeof(*p));
   grpc_lb_policy_init(&p->base, &round_robin_lb_policy_vtable, args->combiner);
   grpc_subchannel_index_ref();
   grpc_connectivity_state_init(&p->state_tracker, GRPC_CHANNEL_IDLE,
                                "round_robin");
   rr_update_locked(exec_ctx, &p->base, args);
   if (grpc_lb_round_robin_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "[RR %p] Created with %lu subchannels", (void *)p,
+    gpr_log(GPR_DEBUG, "[RR %p] Created with %lu subchannels", (void*)p,
             (unsigned long)p->subchannel_list->num_subchannels);
   }
   return &p->base;
@@ -909,7 +682,7 @@
 static grpc_lb_policy_factory round_robin_lb_policy_factory = {
     &round_robin_factory_vtable};
 
-static grpc_lb_policy_factory *round_robin_lb_factory_create() {
+static grpc_lb_policy_factory* round_robin_lb_factory_create() {
   return &round_robin_lb_policy_factory;
 }
 
diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc
new file mode 100644
index 0000000..ec3fb4e
--- /dev/null
+++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc
@@ -0,0 +1,269 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/combiner.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/transport/connectivity_state.h"
+
+void grpc_lb_subchannel_data_unref_subchannel(grpc_exec_ctx* exec_ctx,
+                                              grpc_lb_subchannel_data* sd,
+                                              const char* reason) {
+  if (sd->subchannel != NULL) {
+    if (sd->subchannel_list->tracer->enabled()) {
+      gpr_log(GPR_DEBUG,
+              "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
+              " (subchannel %p): unreffing subchannel",
+              sd->subchannel_list->tracer->name(), sd->subchannel_list->policy,
+              sd->subchannel_list,
+              (size_t)(sd - sd->subchannel_list->subchannels),
+              sd->subchannel_list->num_subchannels, sd->subchannel);
+    }
+    GRPC_SUBCHANNEL_UNREF(exec_ctx, sd->subchannel, reason);
+    sd->subchannel = NULL;
+    if (sd->connected_subchannel != NULL) {
+      GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, sd->connected_subchannel,
+                                      reason);
+      sd->connected_subchannel = NULL;
+    }
+    if (sd->user_data != NULL) {
+      GPR_ASSERT(sd->user_data_vtable != NULL);
+      sd->user_data_vtable->destroy(exec_ctx, sd->user_data);
+      sd->user_data = NULL;
+    }
+  }
+}
+
+void grpc_lb_subchannel_data_start_connectivity_watch(
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_data* sd) {
+  if (sd->subchannel_list->tracer->enabled()) {
+    gpr_log(GPR_DEBUG,
+            "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
+            " (subchannel %p): requesting connectivity change notification",
+            sd->subchannel_list->tracer->name(), sd->subchannel_list->policy,
+            sd->subchannel_list,
+            (size_t)(sd - sd->subchannel_list->subchannels),
+            sd->subchannel_list->num_subchannels, sd->subchannel);
+  }
+  sd->connectivity_notification_pending = true;
+  grpc_subchannel_notify_on_state_change(
+      exec_ctx, sd->subchannel, sd->subchannel_list->policy->interested_parties,
+      &sd->pending_connectivity_state_unsafe,
+      &sd->connectivity_changed_closure);
+}
+
+void grpc_lb_subchannel_data_stop_connectivity_watch(
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_data* sd) {
+  if (sd->subchannel_list->tracer->enabled()) {
+    gpr_log(GPR_DEBUG,
+            "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
+            " (subchannel %p): stopping connectivity watch",
+            sd->subchannel_list->tracer->name(), sd->subchannel_list->policy,
+            sd->subchannel_list,
+            (size_t)(sd - sd->subchannel_list->subchannels),
+            sd->subchannel_list->num_subchannels, sd->subchannel);
+  }
+  GPR_ASSERT(sd->connectivity_notification_pending);
+  sd->connectivity_notification_pending = false;
+}
+
+grpc_lb_subchannel_list* grpc_lb_subchannel_list_create(
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy* p, grpc_core::TraceFlag* tracer,
+    const grpc_lb_addresses* addresses, const grpc_lb_policy_args* args,
+    grpc_iomgr_cb_func connectivity_changed_cb) {
+  grpc_lb_subchannel_list* subchannel_list =
+      (grpc_lb_subchannel_list*)gpr_zalloc(sizeof(*subchannel_list));
+  if (tracer->enabled()) {
+    gpr_log(GPR_DEBUG,
+            "[%s %p] Creating subchannel list %p for %" PRIuPTR " subchannels",
+            tracer->name(), p, subchannel_list, addresses->num_addresses);
+  }
+  subchannel_list->policy = p;
+  subchannel_list->tracer = tracer;
+  gpr_ref_init(&subchannel_list->refcount, 1);
+  subchannel_list->subchannels = (grpc_lb_subchannel_data*)gpr_zalloc(
+      sizeof(grpc_lb_subchannel_data) * addresses->num_addresses);
+  // We need to remove the LB addresses in order to be able to compare the
+  // subchannel keys of subchannels from a different batch of addresses.
+  static const char* keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS,
+                                         GRPC_ARG_LB_ADDRESSES};
+  // Create a subchannel for each address.
+  grpc_subchannel_args sc_args;
+  size_t subchannel_index = 0;
+  for (size_t i = 0; i < addresses->num_addresses; i++) {
+    // If there were any balancer, we would have chosen grpclb policy instead.
+    GPR_ASSERT(!addresses->addresses[i].is_balancer);
+    memset(&sc_args, 0, sizeof(grpc_subchannel_args));
+    grpc_arg addr_arg =
+        grpc_create_subchannel_address_arg(&addresses->addresses[i].address);
+    grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
+        args->args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), &addr_arg,
+        1);
+    gpr_free(addr_arg.value.string);
+    sc_args.args = new_args;
+    grpc_subchannel* subchannel = grpc_client_channel_factory_create_subchannel(
+        exec_ctx, args->client_channel_factory, &sc_args);
+    grpc_channel_args_destroy(exec_ctx, new_args);
+    if (subchannel == NULL) {
+      // Subchannel could not be created.
+      if (tracer->enabled()) {
+        char* address_uri =
+            grpc_sockaddr_to_uri(&addresses->addresses[i].address);
+        gpr_log(GPR_DEBUG,
+                "[%s %p] could not create subchannel for address uri %s, "
+                "ignoring",
+                tracer->name(), subchannel_list->policy, address_uri);
+        gpr_free(address_uri);
+      }
+      continue;
+    }
+    if (tracer->enabled()) {
+      char* address_uri =
+          grpc_sockaddr_to_uri(&addresses->addresses[i].address);
+      gpr_log(GPR_DEBUG,
+              "[%s %p] subchannel list %p index %" PRIuPTR
+              ": Created subchannel %p for address uri %s",
+              tracer->name(), p, subchannel_list, subchannel_index, subchannel,
+              address_uri);
+      gpr_free(address_uri);
+    }
+    grpc_lb_subchannel_data* sd =
+        &subchannel_list->subchannels[subchannel_index++];
+    sd->subchannel_list = subchannel_list;
+    sd->subchannel = subchannel;
+    GRPC_CLOSURE_INIT(&sd->connectivity_changed_closure,
+                      connectivity_changed_cb, sd,
+                      grpc_combiner_scheduler(args->combiner));
+    // We assume that the current state is IDLE.  If not, we'll get a
+    // callback telling us that.
+    sd->prev_connectivity_state = GRPC_CHANNEL_IDLE;
+    sd->curr_connectivity_state = GRPC_CHANNEL_IDLE;
+    sd->pending_connectivity_state_unsafe = GRPC_CHANNEL_IDLE;
+    sd->user_data_vtable = addresses->user_data_vtable;
+    if (sd->user_data_vtable != NULL) {
+      sd->user_data =
+          sd->user_data_vtable->copy(addresses->addresses[i].user_data);
+    }
+  }
+  subchannel_list->num_subchannels = subchannel_index;
+  subchannel_list->num_idle = subchannel_index;
+  return subchannel_list;
+}
+
+static void subchannel_list_destroy(grpc_exec_ctx* exec_ctx,
+                                    grpc_lb_subchannel_list* subchannel_list) {
+  if (subchannel_list->tracer->enabled()) {
+    gpr_log(GPR_DEBUG, "[%s %p] Destroying subchannel_list %p",
+            subchannel_list->tracer->name(), subchannel_list->policy,
+            subchannel_list);
+  }
+  for (size_t i = 0; i < subchannel_list->num_subchannels; i++) {
+    grpc_lb_subchannel_data* sd = &subchannel_list->subchannels[i];
+    grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd,
+                                             "subchannel_list_destroy");
+  }
+  gpr_free(subchannel_list->subchannels);
+  gpr_free(subchannel_list);
+}
+
+void grpc_lb_subchannel_list_ref(grpc_lb_subchannel_list* subchannel_list,
+                                 const char* reason) {
+  gpr_ref_non_zero(&subchannel_list->refcount);
+  if (subchannel_list->tracer->enabled()) {
+    const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count);
+    gpr_log(GPR_DEBUG, "[%s %p] subchannel_list %p REF %lu->%lu (%s)",
+            subchannel_list->tracer->name(), subchannel_list->policy,
+            subchannel_list, (unsigned long)(count - 1), (unsigned long)count,
+            reason);
+  }
+}
+
+void grpc_lb_subchannel_list_unref(grpc_exec_ctx* exec_ctx,
+                                   grpc_lb_subchannel_list* subchannel_list,
+                                   const char* reason) {
+  const bool done = gpr_unref(&subchannel_list->refcount);
+  if (subchannel_list->tracer->enabled()) {
+    const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count);
+    gpr_log(GPR_DEBUG, "[%s %p] subchannel_list %p UNREF %lu->%lu (%s)",
+            subchannel_list->tracer->name(), subchannel_list->policy,
+            subchannel_list, (unsigned long)(count + 1), (unsigned long)count,
+            reason);
+  }
+  if (done) {
+    subchannel_list_destroy(exec_ctx, subchannel_list);
+  }
+}
+
+void grpc_lb_subchannel_list_ref_for_connectivity_watch(
+    grpc_lb_subchannel_list* subchannel_list, const char* reason) {
+  GRPC_LB_POLICY_WEAK_REF(subchannel_list->policy, reason);
+  grpc_lb_subchannel_list_ref(subchannel_list, reason);
+}
+
+void grpc_lb_subchannel_list_unref_for_connectivity_watch(
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_list* subchannel_list,
+    const char* reason) {
+  GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, subchannel_list->policy, reason);
+  grpc_lb_subchannel_list_unref(exec_ctx, subchannel_list, reason);
+}
+
+static void subchannel_data_cancel_connectivity_watch(
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_data* sd, const char* reason) {
+  if (sd->subchannel_list->tracer->enabled()) {
+    gpr_log(GPR_DEBUG,
+            "[%s %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR
+            " (subchannel %p): canceling connectivity watch (%s)",
+            sd->subchannel_list->tracer->name(), sd->subchannel_list->policy,
+            sd->subchannel_list,
+            (size_t)(sd - sd->subchannel_list->subchannels),
+            sd->subchannel_list->num_subchannels, sd->subchannel, reason);
+  }
+  grpc_subchannel_notify_on_state_change(exec_ctx, sd->subchannel, NULL, NULL,
+                                         &sd->connectivity_changed_closure);
+}
+
+void grpc_lb_subchannel_list_shutdown_and_unref(
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_list* subchannel_list,
+    const char* reason) {
+  if (subchannel_list->tracer->enabled()) {
+    gpr_log(GPR_DEBUG, "[%s %p] Shutting down subchannel_list %p (%s)",
+            subchannel_list->tracer->name(), subchannel_list->policy,
+            subchannel_list, reason);
+  }
+  GPR_ASSERT(!subchannel_list->shutting_down);
+  subchannel_list->shutting_down = true;
+  for (size_t i = 0; i < subchannel_list->num_subchannels; i++) {
+    grpc_lb_subchannel_data* sd = &subchannel_list->subchannels[i];
+    // If there's a pending notification for this subchannel, cancel it;
+    // the callback is responsible for unreffing the subchannel.
+    // Otherwise, unref the subchannel directly.
+    if (sd->connectivity_notification_pending) {
+      subchannel_data_cancel_connectivity_watch(exec_ctx, sd, reason);
+    } else if (sd->subchannel != NULL) {
+      grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd, reason);
+    }
+  }
+  grpc_lb_subchannel_list_unref(exec_ctx, subchannel_list, reason);
+}
diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
new file mode 100644
index 0000000..6538bd0
--- /dev/null
+++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
@@ -0,0 +1,153 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_SUBCHANNEL_LIST_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_SUBCHANNEL_LIST_H
+
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/ext/filters/client_channel/subchannel.h"
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/transport/connectivity_state.h"
+
+// TODO(roth): This code is intended to be shared between pick_first and
+// round_robin.  However, the interface needs more work to provide clean
+// encapsulation.  For example, the structs here have some fields that are
+// only used in one of the two (e.g., the state counters in
+// grpc_lb_subchannel_list and the prev_connectivity_state field in
+// grpc_lb_subchannel_data are only used in round_robin, and the
+// checking_subchannel field in grpc_lb_subchannel_list is only used by
+// pick_first).  Also, there is probably some code duplication between the
+// connectivity state notification callback code in both pick_first and
+// round_robin that could be refactored and moved here.  In a future PR,
+// need to clean this up.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct grpc_lb_subchannel_list grpc_lb_subchannel_list;
+
+typedef struct {
+  /** backpointer to owning subchannel list */
+  grpc_lb_subchannel_list* subchannel_list;
+  /** subchannel itself */
+  grpc_subchannel* subchannel;
+  grpc_connected_subchannel* connected_subchannel;
+  /** Is a connectivity notification pending? */
+  bool connectivity_notification_pending;
+  /** notification that connectivity has changed on subchannel */
+  grpc_closure connectivity_changed_closure;
+  /** previous and current connectivity states.  Updated by \a
+   * \a connectivity_changed_closure based on
+   * \a pending_connectivity_state_unsafe. */
+  grpc_connectivity_state prev_connectivity_state;
+  grpc_connectivity_state curr_connectivity_state;
+  /** connectivity state to be updated by
+   * grpc_subchannel_notify_on_state_change(), not guarded by
+   * the combiner.  To be copied to \a curr_connectivity_state by
+   * \a connectivity_changed_closure. */
+  grpc_connectivity_state pending_connectivity_state_unsafe;
+  /** the subchannel's target user data */
+  void* user_data;
+  /** vtable to operate over \a user_data */
+  const grpc_lb_user_data_vtable* user_data_vtable;
+} grpc_lb_subchannel_data;
+
+/// Unrefs the subchannel contained in sd.
+void grpc_lb_subchannel_data_unref_subchannel(grpc_exec_ctx* exec_ctx,
+                                              grpc_lb_subchannel_data* sd,
+                                              const char* reason);
+
+/// Starts watching the connectivity state of the subchannel.
+/// The connectivity_changed_cb callback must invoke either
+/// grpc_lb_subchannel_data_stop_connectivity_watch() or again call
+/// grpc_lb_subchannel_data_start_connectivity_watch().
+void grpc_lb_subchannel_data_start_connectivity_watch(
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_data* sd);
+
+/// Stops watching the connectivity state of the subchannel.
+void grpc_lb_subchannel_data_stop_connectivity_watch(
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_data* sd);
+
+struct grpc_lb_subchannel_list {
+  /** backpointer to owning policy */
+  grpc_lb_policy* policy;
+
+  grpc_core::TraceFlag* tracer;
+
+  /** all our subchannels */
+  size_t num_subchannels;
+  grpc_lb_subchannel_data* subchannels;
+
+  /** Index into subchannels of the one we're currently checking.
+   * Used when connecting to subchannels serially instead of in parallel. */
+  // TODO(roth): When we have time, we can probably make this go away
+  // and compute the index dynamically by subtracting
+  // subchannel_list->subchannels from the subchannel_data pointer.
+  size_t checking_subchannel;
+
+  /** how many subchannels are in state READY */
+  size_t num_ready;
+  /** how many subchannels are in state TRANSIENT_FAILURE */
+  size_t num_transient_failures;
+  /** how many subchannels are in state SHUTDOWN */
+  size_t num_shutdown;
+  /** how many subchannels are in state IDLE */
+  size_t num_idle;
+
+  /** There will be one ref for each entry in subchannels for which there is a
+   * pending connectivity state watcher callback. */
+  gpr_refcount refcount;
+
+  /** Is this list shutting down? This may be true due to the shutdown of the
+   * policy itself or because a newer update has arrived while this one hadn't
+   * finished processing. */
+  bool shutting_down;
+};
+
+grpc_lb_subchannel_list* grpc_lb_subchannel_list_create(
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy* p, grpc_core::TraceFlag* tracer,
+    const grpc_lb_addresses* addresses, const grpc_lb_policy_args* args,
+    grpc_iomgr_cb_func connectivity_changed_cb);
+
+void grpc_lb_subchannel_list_ref(grpc_lb_subchannel_list* subchannel_list,
+                                 const char* reason);
+
+void grpc_lb_subchannel_list_unref(grpc_exec_ctx* exec_ctx,
+                                   grpc_lb_subchannel_list* subchannel_list,
+                                   const char* reason);
+
+/// Takes and releases refs needed for a connectivity notification.
+/// This includes a ref to subchannel_list and a weak ref to the LB policy.
+void grpc_lb_subchannel_list_ref_for_connectivity_watch(
+    grpc_lb_subchannel_list* subchannel_list, const char* reason);
+void grpc_lb_subchannel_list_unref_for_connectivity_watch(
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_list* subchannel_list,
+    const char* reason);
+
+/// Mark subchannel_list as discarded. Unsubscribes all its subchannels. The
+/// connectivity state notification callback will ultimately unref it.
+void grpc_lb_subchannel_list_shutdown_and_unref(
+    grpc_exec_ctx* exec_ctx, grpc_lb_subchannel_list* subchannel_list,
+    const char* reason);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_SUBCHANNEL_LIST_H */
diff --git a/src/core/ext/filters/client_channel/lb_policy_factory.h b/src/core/ext/filters/client_channel/lb_policy_factory.h
index 8790ffd..360a42b 100644
--- a/src/core/ext/filters/client_channel/lb_policy_factory.h
+++ b/src/core/ext/filters/client_channel/lb_policy_factory.h
@@ -37,7 +37,7 @@
 typedef struct grpc_lb_policy_factory_vtable grpc_lb_policy_factory_vtable;
 
 struct grpc_lb_policy_factory {
-  const grpc_lb_policy_factory_vtable *vtable;
+  const grpc_lb_policy_factory_vtable* vtable;
 };
 
 /** A resolved address alongside any LB related information associated with it.
@@ -48,91 +48,91 @@
 typedef struct grpc_lb_address {
   grpc_resolved_address address;
   bool is_balancer;
-  char *balancer_name; /* For secure naming. */
-  void *user_data;
+  char* balancer_name; /* For secure naming. */
+  void* user_data;
 } grpc_lb_address;
 
 typedef struct grpc_lb_user_data_vtable {
-  void *(*copy)(void *);
-  void (*destroy)(grpc_exec_ctx *exec_ctx, void *);
-  int (*cmp)(void *, void *);
+  void* (*copy)(void*);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, void*);
+  int (*cmp)(void*, void*);
 } grpc_lb_user_data_vtable;
 
 typedef struct grpc_lb_addresses {
   size_t num_addresses;
-  grpc_lb_address *addresses;
-  const grpc_lb_user_data_vtable *user_data_vtable;
+  grpc_lb_address* addresses;
+  const grpc_lb_user_data_vtable* user_data_vtable;
 } grpc_lb_addresses;
 
 /** Returns a grpc_addresses struct with enough space for
     \a num_addresses addresses.  The \a user_data_vtable argument may be
     NULL if no user data will be added. */
-grpc_lb_addresses *grpc_lb_addresses_create(
-    size_t num_addresses, const grpc_lb_user_data_vtable *user_data_vtable);
+grpc_lb_addresses* grpc_lb_addresses_create(
+    size_t num_addresses, const grpc_lb_user_data_vtable* user_data_vtable);
 
 /** Creates a copy of \a addresses. */
-grpc_lb_addresses *grpc_lb_addresses_copy(const grpc_lb_addresses *addresses);
+grpc_lb_addresses* grpc_lb_addresses_copy(const grpc_lb_addresses* addresses);
 
 /** Sets the value of the address at index \a index of \a addresses.
  * \a address is a socket address of length \a address_len.
  * Takes ownership of \a balancer_name. */
-void grpc_lb_addresses_set_address(grpc_lb_addresses *addresses, size_t index,
-                                   const void *address, size_t address_len,
-                                   bool is_balancer, const char *balancer_name,
-                                   void *user_data);
+void grpc_lb_addresses_set_address(grpc_lb_addresses* addresses, size_t index,
+                                   const void* address, size_t address_len,
+                                   bool is_balancer, const char* balancer_name,
+                                   void* user_data);
 
 /** Sets the value of the address at index \a index of \a addresses from \a uri.
  * Returns true upon success, false otherwise. Takes ownership of \a
  * balancer_name. */
-bool grpc_lb_addresses_set_address_from_uri(grpc_lb_addresses *addresses,
-                                            size_t index, const grpc_uri *uri,
+bool grpc_lb_addresses_set_address_from_uri(grpc_lb_addresses* addresses,
+                                            size_t index, const grpc_uri* uri,
                                             bool is_balancer,
-                                            const char *balancer_name,
-                                            void *user_data);
+                                            const char* balancer_name,
+                                            void* user_data);
 
 /** Compares \a addresses1 and \a addresses2. */
-int grpc_lb_addresses_cmp(const grpc_lb_addresses *addresses1,
-                          const grpc_lb_addresses *addresses2);
+int grpc_lb_addresses_cmp(const grpc_lb_addresses* addresses1,
+                          const grpc_lb_addresses* addresses2);
 
 /** Destroys \a addresses. */
-void grpc_lb_addresses_destroy(grpc_exec_ctx *exec_ctx,
-                               grpc_lb_addresses *addresses);
+void grpc_lb_addresses_destroy(grpc_exec_ctx* exec_ctx,
+                               grpc_lb_addresses* addresses);
 
 /** Returns a channel arg containing \a addresses. */
 grpc_arg grpc_lb_addresses_create_channel_arg(
-    const grpc_lb_addresses *addresses);
+    const grpc_lb_addresses* addresses);
 
 /** Returns the \a grpc_lb_addresses instance in \a channel_args or NULL */
-grpc_lb_addresses *grpc_lb_addresses_find_channel_arg(
-    const grpc_channel_args *channel_args);
+grpc_lb_addresses* grpc_lb_addresses_find_channel_arg(
+    const grpc_channel_args* channel_args);
 
 /** Arguments passed to LB policies. */
 struct grpc_lb_policy_args {
-  grpc_client_channel_factory *client_channel_factory;
-  grpc_channel_args *args;
-  grpc_combiner *combiner;
+  grpc_client_channel_factory* client_channel_factory;
+  grpc_channel_args* args;
+  grpc_combiner* combiner;
 };
 
 struct grpc_lb_policy_factory_vtable {
-  void (*ref)(grpc_lb_policy_factory *factory);
-  void (*unref)(grpc_lb_policy_factory *factory);
+  void (*ref)(grpc_lb_policy_factory* factory);
+  void (*unref)(grpc_lb_policy_factory* factory);
 
   /** Implementation of grpc_lb_policy_factory_create_lb_policy */
-  grpc_lb_policy *(*create_lb_policy)(grpc_exec_ctx *exec_ctx,
-                                      grpc_lb_policy_factory *factory,
-                                      grpc_lb_policy_args *args);
+  grpc_lb_policy* (*create_lb_policy)(grpc_exec_ctx* exec_ctx,
+                                      grpc_lb_policy_factory* factory,
+                                      grpc_lb_policy_args* args);
 
   /** Name for the LB policy this factory implements */
-  const char *name;
+  const char* name;
 };
 
-void grpc_lb_policy_factory_ref(grpc_lb_policy_factory *factory);
-void grpc_lb_policy_factory_unref(grpc_lb_policy_factory *factory);
+void grpc_lb_policy_factory_ref(grpc_lb_policy_factory* factory);
+void grpc_lb_policy_factory_unref(grpc_lb_policy_factory* factory);
 
 /** Create a lb_policy instance. */
-grpc_lb_policy *grpc_lb_policy_factory_create_lb_policy(
-    grpc_exec_ctx *exec_ctx, grpc_lb_policy_factory *factory,
-    grpc_lb_policy_args *args);
+grpc_lb_policy* grpc_lb_policy_factory_create_lb_policy(
+    grpc_exec_ctx* exec_ctx, grpc_lb_policy_factory* factory,
+    grpc_lb_policy_args* args);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/lb_policy_registry.cc b/src/core/ext/filters/client_channel/lb_policy_registry.cc
index f2460f8..7b0a926 100644
--- a/src/core/ext/filters/client_channel/lb_policy_registry.cc
+++ b/src/core/ext/filters/client_channel/lb_policy_registry.cc
@@ -24,7 +24,7 @@
 
 #define MAX_POLICIES 10
 
-static grpc_lb_policy_factory *g_all_of_the_lb_policies[MAX_POLICIES];
+static grpc_lb_policy_factory* g_all_of_the_lb_policies[MAX_POLICIES];
 static int g_number_of_lb_policies = 0;
 
 void grpc_lb_policy_registry_init(void) { g_number_of_lb_policies = 0; }
@@ -36,7 +36,7 @@
   }
 }
 
-void grpc_register_lb_policy(grpc_lb_policy_factory *factory) {
+void grpc_register_lb_policy(grpc_lb_policy_factory* factory) {
   int i;
   for (i = 0; i < g_number_of_lb_policies; i++) {
     GPR_ASSERT(0 != gpr_stricmp(factory->vtable->name,
@@ -47,7 +47,7 @@
   g_all_of_the_lb_policies[g_number_of_lb_policies++] = factory;
 }
 
-static grpc_lb_policy_factory *lookup_factory(const char *name) {
+static grpc_lb_policy_factory* lookup_factory(const char* name) {
   int i;
 
   if (name == NULL) return NULL;
@@ -61,10 +61,10 @@
   return NULL;
 }
 
-grpc_lb_policy *grpc_lb_policy_create(grpc_exec_ctx *exec_ctx, const char *name,
-                                      grpc_lb_policy_args *args) {
-  grpc_lb_policy_factory *factory = lookup_factory(name);
-  grpc_lb_policy *lb_policy =
+grpc_lb_policy* grpc_lb_policy_create(grpc_exec_ctx* exec_ctx, const char* name,
+                                      grpc_lb_policy_args* args) {
+  grpc_lb_policy_factory* factory = lookup_factory(name);
+  grpc_lb_policy* lb_policy =
       grpc_lb_policy_factory_create_lb_policy(exec_ctx, factory, args);
   return lb_policy;
 }
diff --git a/src/core/ext/filters/client_channel/lb_policy_registry.h b/src/core/ext/filters/client_channel/lb_policy_registry.h
index 55154cb..055f751 100644
--- a/src/core/ext/filters/client_channel/lb_policy_registry.h
+++ b/src/core/ext/filters/client_channel/lb_policy_registry.h
@@ -32,14 +32,14 @@
 void grpc_lb_policy_registry_shutdown(void);
 
 /** Register a LB policy factory. */
-void grpc_register_lb_policy(grpc_lb_policy_factory *factory);
+void grpc_register_lb_policy(grpc_lb_policy_factory* factory);
 
 /** Create a \a grpc_lb_policy instance.
  *
  * If \a name is NULL, the default factory from \a grpc_lb_policy_registry_init
  * will be returned. */
-grpc_lb_policy *grpc_lb_policy_create(grpc_exec_ctx *exec_ctx, const char *name,
-                                      grpc_lb_policy_args *args);
+grpc_lb_policy* grpc_lb_policy_create(grpc_exec_ctx* exec_ctx, const char* name,
+                                      grpc_lb_policy_args* args);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/parse_address.cc b/src/core/ext/filters/client_channel/parse_address.cc
index 2152b5a..6cf77f1 100644
--- a/src/core/ext/filters/client_channel/parse_address.cc
+++ b/src/core/ext/filters/client_channel/parse_address.cc
@@ -33,13 +33,13 @@
 
 #ifdef GRPC_HAVE_UNIX_SOCKET
 
-bool grpc_parse_unix(const grpc_uri *uri,
-                     grpc_resolved_address *resolved_addr) {
+bool grpc_parse_unix(const grpc_uri* uri,
+                     grpc_resolved_address* resolved_addr) {
   if (strcmp("unix", uri->scheme) != 0) {
     gpr_log(GPR_ERROR, "Expected 'unix' scheme, got '%s'", uri->scheme);
     return false;
   }
-  struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr;
+  struct sockaddr_un* un = (struct sockaddr_un*)resolved_addr->addr;
   const size_t maxlen = sizeof(un->sun_path);
   const size_t path_len = strnlen(uri->path, maxlen);
   if (path_len == maxlen) return false;
@@ -51,24 +51,24 @@
 
 #else /* GRPC_HAVE_UNIX_SOCKET */
 
-bool grpc_parse_unix(const grpc_uri *uri,
-                     grpc_resolved_address *resolved_addr) {
+bool grpc_parse_unix(const grpc_uri* uri,
+                     grpc_resolved_address* resolved_addr) {
   abort();
 }
 
 #endif /* GRPC_HAVE_UNIX_SOCKET */
 
-bool grpc_parse_ipv4_hostport(const char *hostport, grpc_resolved_address *addr,
+bool grpc_parse_ipv4_hostport(const char* hostport, grpc_resolved_address* addr,
                               bool log_errors) {
   bool success = false;
   // Split host and port.
-  char *host;
-  char *port;
+  char* host;
+  char* port;
   if (!gpr_split_host_port(hostport, &host, &port)) return false;
   // Parse IP address.
   memset(addr, 0, sizeof(*addr));
   addr->len = sizeof(struct sockaddr_in);
-  struct sockaddr_in *in = (struct sockaddr_in *)addr->addr;
+  struct sockaddr_in* in = (struct sockaddr_in*)addr->addr;
   in->sin_family = AF_INET;
   if (inet_pton(AF_INET, host, &in->sin_addr) == 0) {
     if (log_errors) gpr_log(GPR_ERROR, "invalid ipv4 address: '%s'", host);
@@ -92,32 +92,32 @@
   return success;
 }
 
-bool grpc_parse_ipv4(const grpc_uri *uri,
-                     grpc_resolved_address *resolved_addr) {
+bool grpc_parse_ipv4(const grpc_uri* uri,
+                     grpc_resolved_address* resolved_addr) {
   if (strcmp("ipv4", uri->scheme) != 0) {
     gpr_log(GPR_ERROR, "Expected 'ipv4' scheme, got '%s'", uri->scheme);
     return false;
   }
-  const char *host_port = uri->path;
+  const char* host_port = uri->path;
   if (*host_port == '/') ++host_port;
   return grpc_parse_ipv4_hostport(host_port, resolved_addr,
                                   true /* log_errors */);
 }
 
-bool grpc_parse_ipv6_hostport(const char *hostport, grpc_resolved_address *addr,
+bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
                               bool log_errors) {
   bool success = false;
   // Split host and port.
-  char *host;
-  char *port;
+  char* host;
+  char* port;
   if (!gpr_split_host_port(hostport, &host, &port)) return false;
   // Parse IP address.
   memset(addr, 0, sizeof(*addr));
   addr->len = sizeof(struct sockaddr_in6);
-  struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)addr->addr;
+  struct sockaddr_in6* in6 = (struct sockaddr_in6*)addr->addr;
   in6->sin6_family = AF_INET6;
   // Handle the RFC6874 syntax for IPv6 zone identifiers.
-  char *host_end = (char *)gpr_memrchr(host, '%', strlen(host));
+  char* host_end = (char*)gpr_memrchr(host, '%', strlen(host));
   if (host_end != NULL) {
     GPR_ASSERT(host_end >= host);
     char host_without_scope[INET6_ADDRSTRLEN];
@@ -161,19 +161,19 @@
   return success;
 }
 
-bool grpc_parse_ipv6(const grpc_uri *uri,
-                     grpc_resolved_address *resolved_addr) {
+bool grpc_parse_ipv6(const grpc_uri* uri,
+                     grpc_resolved_address* resolved_addr) {
   if (strcmp("ipv6", uri->scheme) != 0) {
     gpr_log(GPR_ERROR, "Expected 'ipv6' scheme, got '%s'", uri->scheme);
     return false;
   }
-  const char *host_port = uri->path;
+  const char* host_port = uri->path;
   if (*host_port == '/') ++host_port;
   return grpc_parse_ipv6_hostport(host_port, resolved_addr,
                                   true /* log_errors */);
 }
 
-bool grpc_parse_uri(const grpc_uri *uri, grpc_resolved_address *resolved_addr) {
+bool grpc_parse_uri(const grpc_uri* uri, grpc_resolved_address* resolved_addr) {
   if (strcmp("unix", uri->scheme) == 0) {
     return grpc_parse_unix(uri, resolved_addr);
   } else if (strcmp("ipv4", uri->scheme) == 0) {
diff --git a/src/core/ext/filters/client_channel/parse_address.h b/src/core/ext/filters/client_channel/parse_address.h
index 27d06a1..b45859f 100644
--- a/src/core/ext/filters/client_channel/parse_address.h
+++ b/src/core/ext/filters/client_channel/parse_address.h
@@ -30,23 +30,23 @@
 
 /** Populate \a resolved_addr from \a uri, whose path is expected to contain a
  * unix socket path. Returns true upon success. */
-bool grpc_parse_unix(const grpc_uri *uri, grpc_resolved_address *resolved_addr);
+bool grpc_parse_unix(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
 
 /** Populate \a resolved_addr from \a uri, whose path is expected to contain an
  * IPv4 host:port pair. Returns true upon success. */
-bool grpc_parse_ipv4(const grpc_uri *uri, grpc_resolved_address *resolved_addr);
+bool grpc_parse_ipv4(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
 
 /** Populate \a resolved_addr from \a uri, whose path is expected to contain an
  * IPv6 host:port pair. Returns true upon success. */
-bool grpc_parse_ipv6(const grpc_uri *uri, grpc_resolved_address *resolved_addr);
+bool grpc_parse_ipv6(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
 
 /** Populate \a resolved_addr from \a uri. Returns true upon success. */
-bool grpc_parse_uri(const grpc_uri *uri, grpc_resolved_address *resolved_addr);
+bool grpc_parse_uri(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
 
 /** Parse bare IPv4 or IPv6 "IP:port" strings. */
-bool grpc_parse_ipv4_hostport(const char *hostport, grpc_resolved_address *addr,
+bool grpc_parse_ipv4_hostport(const char* hostport, grpc_resolved_address* addr,
                               bool log_errors);
-bool grpc_parse_ipv6_hostport(const char *hostport, grpc_resolved_address *addr,
+bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
                               bool log_errors);
 
 #ifdef __cplusplus
diff --git a/src/core/ext/filters/client_channel/resolver.cc b/src/core/ext/filters/client_channel/resolver.cc
index d29a5e7..21ce14e 100644
--- a/src/core/ext/filters/client_channel/resolver.cc
+++ b/src/core/ext/filters/client_channel/resolver.cc
@@ -19,63 +19,64 @@
 #include "src/core/ext/filters/client_channel/resolver.h"
 #include "src/core/lib/iomgr/combiner.h"
 
-grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount(false,
-                                                           "resolver_refcount");
+#ifndef NDEBUG
+grpc_core::TraceFlag grpc_trace_resolver_refcount(false, "resolver_refcount");
+#endif
 
-void grpc_resolver_init(grpc_resolver *resolver,
-                        const grpc_resolver_vtable *vtable,
-                        grpc_combiner *combiner) {
+void grpc_resolver_init(grpc_resolver* resolver,
+                        const grpc_resolver_vtable* vtable,
+                        grpc_combiner* combiner) {
   resolver->vtable = vtable;
   resolver->combiner = GRPC_COMBINER_REF(combiner, "resolver");
   gpr_ref_init(&resolver->refs, 1);
 }
 
 #ifndef NDEBUG
-void grpc_resolver_ref(grpc_resolver *resolver, const char *file, int line,
-                       const char *reason) {
-  if (grpc_trace_resolver_refcount.enabled()) {
+void grpc_resolver_ref(grpc_resolver* resolver, const char* file, int line,
+                       const char* reason) {
+  if (GRPC_TRACER_ON(grpc_trace_resolver_refcount)) {
     gpr_atm old_refs = gpr_atm_no_barrier_load(&resolver->refs.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "RESOLVER:%p   ref %" PRIdPTR " -> %" PRIdPTR " %s", resolver,
             old_refs, old_refs + 1, reason);
   }
 #else
-void grpc_resolver_ref(grpc_resolver *resolver) {
+void grpc_resolver_ref(grpc_resolver* resolver) {
 #endif
   gpr_ref(&resolver->refs);
 }
 
 #ifndef NDEBUG
-void grpc_resolver_unref(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
-                         const char *file, int line, const char *reason) {
-  if (grpc_trace_resolver_refcount.enabled()) {
+void grpc_resolver_unref(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver,
+                         const char* file, int line, const char* reason) {
+  if (GRPC_TRACER_ON(grpc_trace_resolver_refcount)) {
     gpr_atm old_refs = gpr_atm_no_barrier_load(&resolver->refs.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "RESOLVER:%p unref %" PRIdPTR " -> %" PRIdPTR " %s", resolver,
             old_refs, old_refs - 1, reason);
   }
 #else
-void grpc_resolver_unref(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver) {
+void grpc_resolver_unref(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver) {
 #endif
   if (gpr_unref(&resolver->refs)) {
-    grpc_combiner *combiner = resolver->combiner;
+    grpc_combiner* combiner = resolver->combiner;
     resolver->vtable->destroy(exec_ctx, resolver);
     GRPC_COMBINER_UNREF(exec_ctx, combiner, "resolver");
   }
 }
 
-void grpc_resolver_shutdown_locked(grpc_exec_ctx *exec_ctx,
-                                   grpc_resolver *resolver) {
+void grpc_resolver_shutdown_locked(grpc_exec_ctx* exec_ctx,
+                                   grpc_resolver* resolver) {
   resolver->vtable->shutdown_locked(exec_ctx, resolver);
 }
 
-void grpc_resolver_channel_saw_error_locked(grpc_exec_ctx *exec_ctx,
-                                            grpc_resolver *resolver) {
+void grpc_resolver_channel_saw_error_locked(grpc_exec_ctx* exec_ctx,
+                                            grpc_resolver* resolver) {
   resolver->vtable->channel_saw_error_locked(exec_ctx, resolver);
 }
 
-void grpc_resolver_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
-                               grpc_channel_args **result,
-                               grpc_closure *on_complete) {
+void grpc_resolver_next_locked(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver,
+                               grpc_channel_args** result,
+                               grpc_closure* on_complete) {
   resolver->vtable->next_locked(exec_ctx, resolver, result, on_complete);
 }
diff --git a/src/core/ext/filters/client_channel/resolver.h b/src/core/ext/filters/client_channel/resolver.h
index 3ff787a..e61b186 100644
--- a/src/core/ext/filters/client_channel/resolver.h
+++ b/src/core/ext/filters/client_channel/resolver.h
@@ -35,49 +35,49 @@
 
 /** \a grpc_resolver provides \a grpc_channel_args objects to its caller */
 struct grpc_resolver {
-  const grpc_resolver_vtable *vtable;
+  const grpc_resolver_vtable* vtable;
   gpr_refcount refs;
-  grpc_combiner *combiner;
+  grpc_combiner* combiner;
 };
 
 struct grpc_resolver_vtable {
-  void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver);
-  void (*shutdown_locked)(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver);
-  void (*channel_saw_error_locked)(grpc_exec_ctx *exec_ctx,
-                                   grpc_resolver *resolver);
-  void (*next_locked)(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
-                      grpc_channel_args **result, grpc_closure *on_complete);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver);
+  void (*shutdown_locked)(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver);
+  void (*channel_saw_error_locked)(grpc_exec_ctx* exec_ctx,
+                                   grpc_resolver* resolver);
+  void (*next_locked)(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver,
+                      grpc_channel_args** result, grpc_closure* on_complete);
 };
 
 #ifndef NDEBUG
 #define GRPC_RESOLVER_REF(p, r) grpc_resolver_ref((p), __FILE__, __LINE__, (r))
 #define GRPC_RESOLVER_UNREF(e, p, r) \
   grpc_resolver_unref((e), (p), __FILE__, __LINE__, (r))
-void grpc_resolver_ref(grpc_resolver *policy, const char *file, int line,
-                       const char *reason);
-void grpc_resolver_unref(grpc_exec_ctx *exec_ctx, grpc_resolver *policy,
-                         const char *file, int line, const char *reason);
+void grpc_resolver_ref(grpc_resolver* policy, const char* file, int line,
+                       const char* reason);
+void grpc_resolver_unref(grpc_exec_ctx* exec_ctx, grpc_resolver* policy,
+                         const char* file, int line, const char* reason);
 #else
 #define GRPC_RESOLVER_REF(p, r) grpc_resolver_ref((p))
 #define GRPC_RESOLVER_UNREF(e, p, r) grpc_resolver_unref((e), (p))
-void grpc_resolver_ref(grpc_resolver *policy);
-void grpc_resolver_unref(grpc_exec_ctx *exec_ctx, grpc_resolver *policy);
+void grpc_resolver_ref(grpc_resolver* policy);
+void grpc_resolver_unref(grpc_exec_ctx* exec_ctx, grpc_resolver* policy);
 #endif
 
-void grpc_resolver_init(grpc_resolver *resolver,
-                        const grpc_resolver_vtable *vtable,
-                        grpc_combiner *combiner);
+void grpc_resolver_init(grpc_resolver* resolver,
+                        const grpc_resolver_vtable* vtable,
+                        grpc_combiner* combiner);
 
-void grpc_resolver_shutdown_locked(grpc_exec_ctx *exec_ctx,
-                                   grpc_resolver *resolver);
+void grpc_resolver_shutdown_locked(grpc_exec_ctx* exec_ctx,
+                                   grpc_resolver* resolver);
 
 /** Notification that the channel has seen an error on some address.
     Can be used as a hint that re-resolution is desirable soon.
 
     Must be called from the combiner passed as a resolver_arg at construction
     time.*/
-void grpc_resolver_channel_saw_error_locked(grpc_exec_ctx *exec_ctx,
-                                            grpc_resolver *resolver);
+void grpc_resolver_channel_saw_error_locked(grpc_exec_ctx* exec_ctx,
+                                            grpc_resolver* resolver);
 
 /** Get the next result from the resolver.  Expected to set \a *result with
     new channel args and then schedule \a on_complete for execution.
@@ -87,9 +87,9 @@
 
     Must be called from the combiner passed as a resolver_arg at construction
     time.*/
-void grpc_resolver_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
-                               grpc_channel_args **result,
-                               grpc_closure *on_complete);
+void grpc_resolver_next_locked(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver,
+                               grpc_channel_args** result,
+                               grpc_closure* on_complete);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
index 5f7ab98..76f0828 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@@ -53,38 +53,38 @@
   /** base class: must be first */
   grpc_resolver base;
   /** DNS server to use (if not system default) */
-  char *dns_server;
+  char* dns_server;
   /** name to resolve (usually the same as target_name) */
-  char *name_to_resolve;
+  char* name_to_resolve;
   /** default port to use */
-  char *default_port;
+  char* default_port;
   /** channel args. */
-  grpc_channel_args *channel_args;
+  grpc_channel_args* channel_args;
   /** whether to request the service config */
   bool request_service_config;
   /** pollset_set to drive the name resolution process */
-  grpc_pollset_set *interested_parties;
+  grpc_pollset_set* interested_parties;
 
   /** Closures used by the combiner */
   grpc_closure dns_ares_on_retry_timer_locked;
   grpc_closure dns_ares_on_resolved_locked;
 
   /** Combiner guarding the rest of the state */
-  grpc_combiner *combiner;
+  grpc_combiner* combiner;
   /** are we currently resolving? */
   bool resolving;
   /** the pending resolving request */
-  grpc_ares_request *pending_request;
+  grpc_ares_request* pending_request;
   /** which version of the result have we published? */
   int published_version;
   /** which version of the result is current? */
   int resolved_version;
   /** pending next completion, or NULL */
-  grpc_closure *next_completion;
+  grpc_closure* next_completion;
   /** target result address for next completion */
-  grpc_channel_args **target_result;
+  grpc_channel_args** target_result;
   /** current (fully resolved) result */
-  grpc_channel_args *resolved_result;
+  grpc_channel_args* resolved_result;
   /** retry timer */
   bool have_retry_timer;
   grpc_timer retry_timer;
@@ -92,32 +92,32 @@
   grpc_backoff backoff_state;
 
   /** currently resolving addresses */
-  grpc_lb_addresses *lb_addresses;
+  grpc_lb_addresses* lb_addresses;
   /** currently resolving service config */
-  char *service_config_json;
+  char* service_config_json;
 } ares_dns_resolver;
 
-static void dns_ares_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
+static void dns_ares_destroy(grpc_exec_ctx* exec_ctx, grpc_resolver* r);
 
-static void dns_ares_start_resolving_locked(grpc_exec_ctx *exec_ctx,
-                                            ares_dns_resolver *r);
-static void dns_ares_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
-                                              ares_dns_resolver *r);
+static void dns_ares_start_resolving_locked(grpc_exec_ctx* exec_ctx,
+                                            ares_dns_resolver* r);
+static void dns_ares_maybe_finish_next_locked(grpc_exec_ctx* exec_ctx,
+                                              ares_dns_resolver* r);
 
-static void dns_ares_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
-static void dns_ares_channel_saw_error_locked(grpc_exec_ctx *exec_ctx,
-                                              grpc_resolver *r);
-static void dns_ares_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *r,
-                                 grpc_channel_args **target_result,
-                                 grpc_closure *on_complete);
+static void dns_ares_shutdown_locked(grpc_exec_ctx* exec_ctx, grpc_resolver* r);
+static void dns_ares_channel_saw_error_locked(grpc_exec_ctx* exec_ctx,
+                                              grpc_resolver* r);
+static void dns_ares_next_locked(grpc_exec_ctx* exec_ctx, grpc_resolver* r,
+                                 grpc_channel_args** target_result,
+                                 grpc_closure* on_complete);
 
 static const grpc_resolver_vtable dns_ares_resolver_vtable = {
     dns_ares_destroy, dns_ares_shutdown_locked,
     dns_ares_channel_saw_error_locked, dns_ares_next_locked};
 
-static void dns_ares_shutdown_locked(grpc_exec_ctx *exec_ctx,
-                                     grpc_resolver *resolver) {
-  ares_dns_resolver *r = (ares_dns_resolver *)resolver;
+static void dns_ares_shutdown_locked(grpc_exec_ctx* exec_ctx,
+                                     grpc_resolver* resolver) {
+  ares_dns_resolver* r = (ares_dns_resolver*)resolver;
   if (r->have_retry_timer) {
     grpc_timer_cancel(exec_ctx, &r->retry_timer);
   }
@@ -133,18 +133,18 @@
   }
 }
 
-static void dns_ares_channel_saw_error_locked(grpc_exec_ctx *exec_ctx,
-                                              grpc_resolver *resolver) {
-  ares_dns_resolver *r = (ares_dns_resolver *)resolver;
+static void dns_ares_channel_saw_error_locked(grpc_exec_ctx* exec_ctx,
+                                              grpc_resolver* resolver) {
+  ares_dns_resolver* r = (ares_dns_resolver*)resolver;
   if (!r->resolving) {
     grpc_backoff_reset(&r->backoff_state);
     dns_ares_start_resolving_locked(exec_ctx, r);
   }
 }
 
-static void dns_ares_on_retry_timer_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error) {
-  ares_dns_resolver *r = (ares_dns_resolver *)arg;
+static void dns_ares_on_retry_timer_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error) {
+  ares_dns_resolver* r = (ares_dns_resolver*)arg;
   r->have_retry_timer = false;
   if (error == GRPC_ERROR_NONE) {
     if (!r->resolving) {
@@ -154,8 +154,8 @@
   GRPC_RESOLVER_UNREF(exec_ctx, &r->base, "retry-timer");
 }
 
-static bool value_in_json_array(grpc_json *array, const char *value) {
-  for (grpc_json *entry = array->child; entry != NULL; entry = entry->next) {
+static bool value_in_json_array(grpc_json* array, const char* value) {
+  for (grpc_json* entry = array->child; entry != NULL; entry = entry->next) {
     if (entry->type == GRPC_JSON_STRING && strcmp(entry->value, value) == 0) {
       return true;
     }
@@ -163,21 +163,21 @@
   return false;
 }
 
-static char *choose_service_config(char *service_config_choice_json) {
-  grpc_json *choices_json = grpc_json_parse_string(service_config_choice_json);
+static char* choose_service_config(char* service_config_choice_json) {
+  grpc_json* choices_json = grpc_json_parse_string(service_config_choice_json);
   if (choices_json == NULL || choices_json->type != GRPC_JSON_ARRAY) {
     gpr_log(GPR_ERROR, "cannot parse service config JSON string");
     return NULL;
   }
-  char *service_config = NULL;
-  for (grpc_json *choice = choices_json->child; choice != NULL;
+  char* service_config = NULL;
+  for (grpc_json* choice = choices_json->child; choice != NULL;
        choice = choice->next) {
     if (choice->type != GRPC_JSON_OBJECT) {
       gpr_log(GPR_ERROR, "cannot parse service config JSON string");
       break;
     }
-    grpc_json *service_config_json = NULL;
-    for (grpc_json *field = choice->child; field != NULL; field = field->next) {
+    grpc_json* service_config_json = NULL;
+    for (grpc_json* field = choice->child; field != NULL; field = field->next) {
       // Check client language, if specified.
       if (strcmp(field->key, "clientLanguage") == 0) {
         if (field->type != GRPC_JSON_ARRAY ||
@@ -188,7 +188,7 @@
       }
       // Check client hostname, if specified.
       if (strcmp(field->key, "clientHostname") == 0) {
-        char *hostname = grpc_gethostname();
+        char* hostname = grpc_gethostname();
         if (hostname == NULL || field->type != GRPC_JSON_ARRAY ||
             !value_in_json_array(field, hostname)) {
           service_config_json = NULL;
@@ -225,22 +225,22 @@
   return service_config;
 }
 
-static void dns_ares_on_resolved_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error) {
-  ares_dns_resolver *r = (ares_dns_resolver *)arg;
-  grpc_channel_args *result = NULL;
+static void dns_ares_on_resolved_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error) {
+  ares_dns_resolver* r = (ares_dns_resolver*)arg;
+  grpc_channel_args* result = NULL;
   GPR_ASSERT(r->resolving);
   r->resolving = false;
   r->pending_request = NULL;
   if (r->lb_addresses != NULL) {
-    static const char *args_to_remove[2];
+    static const char* args_to_remove[2];
     size_t num_args_to_remove = 0;
     grpc_arg new_args[3];
     size_t num_args_to_add = 0;
     new_args[num_args_to_add++] =
         grpc_lb_addresses_create_channel_arg(r->lb_addresses);
-    grpc_service_config *service_config = NULL;
-    char *service_config_string = NULL;
+    grpc_service_config* service_config = NULL;
+    char* service_config_string = NULL;
     if (r->service_config_json != NULL) {
       service_config_string = choose_service_config(r->service_config_json);
       gpr_free(r->service_config_json);
@@ -249,15 +249,15 @@
                 service_config_string);
         args_to_remove[num_args_to_remove++] = GRPC_ARG_SERVICE_CONFIG;
         new_args[num_args_to_add++] = grpc_channel_arg_string_create(
-            (char *)GRPC_ARG_SERVICE_CONFIG, service_config_string);
+            (char*)GRPC_ARG_SERVICE_CONFIG, service_config_string);
         service_config = grpc_service_config_create(service_config_string);
         if (service_config != NULL) {
-          const char *lb_policy_name =
+          const char* lb_policy_name =
               grpc_service_config_get_lb_policy_name(service_config);
           if (lb_policy_name != NULL) {
             args_to_remove[num_args_to_remove++] = GRPC_ARG_LB_POLICY_NAME;
             new_args[num_args_to_add++] = grpc_channel_arg_string_create(
-                (char *)GRPC_ARG_LB_POLICY_NAME, (char *)lb_policy_name);
+                (char*)GRPC_ARG_LB_POLICY_NAME, (char*)lb_policy_name);
           }
         }
       }
@@ -269,9 +269,10 @@
     gpr_free(service_config_string);
     grpc_lb_addresses_destroy(exec_ctx, r->lb_addresses);
   } else {
-    const char *msg = grpc_error_string(error);
+    const char* msg = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "dns resolution failed: %s", msg);
-    grpc_millis next_try = grpc_backoff_step(exec_ctx, &r->backoff_state);
+    grpc_millis next_try =
+        grpc_backoff_step(exec_ctx, &r->backoff_state).next_attempt_start_time;
     grpc_millis timeout = next_try - grpc_exec_ctx_now(exec_ctx);
     gpr_log(GPR_INFO, "dns resolution failed (will retry): %s",
             grpc_error_string(error));
@@ -295,12 +296,12 @@
   GRPC_RESOLVER_UNREF(exec_ctx, &r->base, "dns-resolving");
 }
 
-static void dns_ares_next_locked(grpc_exec_ctx *exec_ctx,
-                                 grpc_resolver *resolver,
-                                 grpc_channel_args **target_result,
-                                 grpc_closure *on_complete) {
+static void dns_ares_next_locked(grpc_exec_ctx* exec_ctx,
+                                 grpc_resolver* resolver,
+                                 grpc_channel_args** target_result,
+                                 grpc_closure* on_complete) {
   gpr_log(GPR_DEBUG, "dns_ares_next is called.");
-  ares_dns_resolver *r = (ares_dns_resolver *)resolver;
+  ares_dns_resolver* r = (ares_dns_resolver*)resolver;
   GPR_ASSERT(!r->next_completion);
   r->next_completion = on_complete;
   r->target_result = target_result;
@@ -312,8 +313,8 @@
   }
 }
 
-static void dns_ares_start_resolving_locked(grpc_exec_ctx *exec_ctx,
-                                            ares_dns_resolver *r) {
+static void dns_ares_start_resolving_locked(grpc_exec_ctx* exec_ctx,
+                                            ares_dns_resolver* r) {
   GRPC_RESOLVER_REF(&r->base, "dns-resolving");
   GPR_ASSERT(!r->resolving);
   r->resolving = true;
@@ -326,8 +327,8 @@
       r->request_service_config ? &r->service_config_json : NULL);
 }
 
-static void dns_ares_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
-                                              ares_dns_resolver *r) {
+static void dns_ares_maybe_finish_next_locked(grpc_exec_ctx* exec_ctx,
+                                              ares_dns_resolver* r) {
   if (r->next_completion != NULL &&
       r->resolved_version != r->published_version) {
     *r->target_result = r->resolved_result == NULL
@@ -340,9 +341,9 @@
   }
 }
 
-static void dns_ares_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
+static void dns_ares_destroy(grpc_exec_ctx* exec_ctx, grpc_resolver* gr) {
   gpr_log(GPR_DEBUG, "dns_ares_destroy");
-  ares_dns_resolver *r = (ares_dns_resolver *)gr;
+  ares_dns_resolver* r = (ares_dns_resolver*)gr;
   if (r->resolved_result != NULL) {
     grpc_channel_args_destroy(exec_ctx, r->resolved_result);
   }
@@ -354,15 +355,15 @@
   gpr_free(r);
 }
 
-static grpc_resolver *dns_ares_create(grpc_exec_ctx *exec_ctx,
-                                      grpc_resolver_args *args,
-                                      const char *default_port) {
+static grpc_resolver* dns_ares_create(grpc_exec_ctx* exec_ctx,
+                                      grpc_resolver_args* args,
+                                      const char* default_port) {
   /* Get name from args. */
-  const char *path = args->uri->path;
+  const char* path = args->uri->path;
   if (path[0] == '/') ++path;
   /* Create resolver. */
-  ares_dns_resolver *r =
-      (ares_dns_resolver *)gpr_zalloc(sizeof(ares_dns_resolver));
+  ares_dns_resolver* r =
+      (ares_dns_resolver*)gpr_zalloc(sizeof(ares_dns_resolver));
   grpc_resolver_init(&r->base, &dns_ares_resolver_vtable, args->combiner);
   if (0 != strcmp(args->uri->authority, "")) {
     r->dns_server = gpr_strdup(args->uri->authority);
@@ -370,7 +371,7 @@
   r->name_to_resolve = gpr_strdup(path);
   r->default_port = gpr_strdup(default_port);
   r->channel_args = grpc_channel_args_copy(args->args);
-  const grpc_arg *arg = grpc_channel_args_find(
+  const grpc_arg* arg = grpc_channel_args_find(
       r->channel_args, GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION);
   r->request_service_config = !grpc_channel_arg_get_integer(
       arg, (grpc_integer_options){false, false, true});
@@ -379,11 +380,11 @@
     grpc_pollset_set_add_pollset_set(exec_ctx, r->interested_parties,
                                      args->pollset_set);
   }
-  grpc_backoff_init(&r->backoff_state, GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS,
-                    GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER,
-                    GRPC_DNS_RECONNECT_JITTER,
-                    GRPC_DNS_MIN_CONNECT_TIMEOUT_SECONDS * 1000,
-                    GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000);
+  grpc_backoff_init(
+      &r->backoff_state, GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS * 1000,
+      GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER, GRPC_DNS_RECONNECT_JITTER,
+      GRPC_DNS_MIN_CONNECT_TIMEOUT_SECONDS * 1000,
+      GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000);
   GRPC_CLOSURE_INIT(&r->dns_ares_on_retry_timer_locked,
                     dns_ares_on_retry_timer_locked, r,
                     grpc_combiner_scheduler(r->base.combiner));
@@ -397,19 +398,19 @@
  * FACTORY
  */
 
-static void dns_ares_factory_ref(grpc_resolver_factory *factory) {}
+static void dns_ares_factory_ref(grpc_resolver_factory* factory) {}
 
-static void dns_ares_factory_unref(grpc_resolver_factory *factory) {}
+static void dns_ares_factory_unref(grpc_resolver_factory* factory) {}
 
-static grpc_resolver *dns_factory_create_resolver(
-    grpc_exec_ctx *exec_ctx, grpc_resolver_factory *factory,
-    grpc_resolver_args *args) {
+static grpc_resolver* dns_factory_create_resolver(
+    grpc_exec_ctx* exec_ctx, grpc_resolver_factory* factory,
+    grpc_resolver_args* args) {
   return dns_ares_create(exec_ctx, args, "https");
 }
 
-static char *dns_ares_factory_get_default_host_name(
-    grpc_resolver_factory *factory, grpc_uri *uri) {
-  const char *path = uri->path;
+static char* dns_ares_factory_get_default_host_name(
+    grpc_resolver_factory* factory, grpc_uri* uri) {
+  const char* path = uri->path;
   if (path[0] == '/') ++path;
   return gpr_strdup(path);
 }
@@ -419,16 +420,16 @@
     dns_ares_factory_get_default_host_name, "dns"};
 static grpc_resolver_factory dns_resolver_factory = {&dns_ares_factory_vtable};
 
-static grpc_resolver_factory *dns_ares_resolver_factory_create() {
+static grpc_resolver_factory* dns_ares_resolver_factory_create() {
   return &dns_resolver_factory;
 }
 
 extern "C" void grpc_resolver_dns_ares_init(void) {
-  char *resolver = gpr_getenv("GRPC_DNS_RESOLVER");
+  char* resolver = gpr_getenv("GRPC_DNS_RESOLVER");
   /* TODO(zyc): Turn on c-ares based resolver by default after the address
      sorter and the CNAME support are added. */
   if (resolver != NULL && gpr_stricmp(resolver, "ares") == 0) {
-    grpc_error *error = grpc_ares_init();
+    grpc_error* error = grpc_ares_init();
     if (error != GRPC_ERROR_NONE) {
       GRPC_LOG_IF_ERROR("ares_library_init() failed", error);
       return;
@@ -440,7 +441,7 @@
 }
 
 extern "C" void grpc_resolver_dns_ares_shutdown(void) {
-  char *resolver = gpr_getenv("GRPC_DNS_RESOLVER");
+  char* resolver = gpr_getenv("GRPC_DNS_RESOLVER");
   if (resolver != NULL && gpr_stricmp(resolver, "ares") == 0) {
     grpc_ares_cleanup();
   }
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
index 3d4309f..a5fb1f1 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
@@ -31,31 +31,31 @@
 /* Start \a ev_driver. It will keep working until all IO on its ares_channel is
    done, or grpc_ares_ev_driver_destroy() is called. It may notify the callbacks
    bound to its ares_channel when necessary. */
-void grpc_ares_ev_driver_start(grpc_exec_ctx *exec_ctx,
-                               grpc_ares_ev_driver *ev_driver);
+void grpc_ares_ev_driver_start(grpc_exec_ctx* exec_ctx,
+                               grpc_ares_ev_driver* ev_driver);
 
 /* Returns the ares_channel owned by \a ev_driver. To bind a c-ares query to
    \a ev_driver, use the ares_channel owned by \a ev_driver as the arg of the
    query. */
-ares_channel *grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver *ev_driver);
+ares_channel* grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver* ev_driver);
 
 /* Creates a new grpc_ares_ev_driver. Returns GRPC_ERROR_NONE if \a ev_driver is
    created successfully. */
-grpc_error *grpc_ares_ev_driver_create(grpc_ares_ev_driver **ev_driver,
-                                       grpc_pollset_set *pollset_set);
+grpc_error* grpc_ares_ev_driver_create(grpc_ares_ev_driver** ev_driver,
+                                       grpc_pollset_set* pollset_set);
 
 /* Destroys \a ev_driver asynchronously. Pending lookups made on \a ev_driver
    will be cancelled and their on_done callbacks will be invoked with a status
    of ARES_ECANCELLED. */
-void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver *ev_driver);
+void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver* ev_driver);
 
 /* Shutdown all the grpc_fds used by \a ev_driver */
-void grpc_ares_ev_driver_shutdown(grpc_exec_ctx *exec_ctx,
-                                  grpc_ares_ev_driver *ev_driver);
+void grpc_ares_ev_driver_shutdown(grpc_exec_ctx* exec_ctx,
+                                  grpc_ares_ev_driver* ev_driver);
 
 #ifdef __cplusplus
 }
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H \
-          */
+        */
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
index c30cc93..2bb98c1 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
@@ -37,7 +37,7 @@
 
 typedef struct fd_node {
   /** the owner of this fd node */
-  grpc_ares_ev_driver *ev_driver;
+  grpc_ares_ev_driver* ev_driver;
   /** a closure wrapping on_readable_cb, which should be invoked when the
       grpc_fd in this node becomes readable. */
   grpc_closure read_closure;
@@ -45,12 +45,12 @@
       grpc_fd in this node becomes writable. */
   grpc_closure write_closure;
   /** next fd node in the list */
-  struct fd_node *next;
+  struct fd_node* next;
 
   /** mutex guarding the rest of the state */
   gpr_mu mu;
   /** the grpc_fd owned by this fd node */
-  grpc_fd *fd;
+  grpc_fd* fd;
   /** if the readable closure has been registered */
   bool readable_registered;
   /** if the writable closure has been registered */
@@ -63,31 +63,31 @@
   /** the ares_channel owned by this event driver */
   ares_channel channel;
   /** pollset set for driving the IO events of the channel */
-  grpc_pollset_set *pollset_set;
+  grpc_pollset_set* pollset_set;
   /** refcount of the event driver */
   gpr_refcount refs;
 
   /** mutex guarding the rest of the state */
   gpr_mu mu;
   /** a list of grpc_fd that this event driver is currently using. */
-  fd_node *fds;
+  fd_node* fds;
   /** is this event driver currently working? */
   bool working;
   /** is this event driver being shut down */
   bool shutting_down;
 };
 
-static void grpc_ares_notify_on_event_locked(grpc_exec_ctx *exec_ctx,
-                                             grpc_ares_ev_driver *ev_driver);
+static void grpc_ares_notify_on_event_locked(grpc_exec_ctx* exec_ctx,
+                                             grpc_ares_ev_driver* ev_driver);
 
-static grpc_ares_ev_driver *grpc_ares_ev_driver_ref(
-    grpc_ares_ev_driver *ev_driver) {
+static grpc_ares_ev_driver* grpc_ares_ev_driver_ref(
+    grpc_ares_ev_driver* ev_driver) {
   gpr_log(GPR_DEBUG, "Ref ev_driver %" PRIuPTR, (uintptr_t)ev_driver);
   gpr_ref(&ev_driver->refs);
   return ev_driver;
 }
 
-static void grpc_ares_ev_driver_unref(grpc_ares_ev_driver *ev_driver) {
+static void grpc_ares_ev_driver_unref(grpc_ares_ev_driver* ev_driver) {
   gpr_log(GPR_DEBUG, "Unref ev_driver %" PRIuPTR, (uintptr_t)ev_driver);
   if (gpr_unref(&ev_driver->refs)) {
     gpr_log(GPR_DEBUG, "destroy ev_driver %" PRIuPTR, (uintptr_t)ev_driver);
@@ -98,7 +98,7 @@
   }
 }
 
-static void fd_node_destroy(grpc_exec_ctx *exec_ctx, fd_node *fdn) {
+static void fd_node_destroy(grpc_exec_ctx* exec_ctx, fd_node* fdn) {
   gpr_log(GPR_DEBUG, "delete fd: %d", grpc_fd_wrapped_fd(fdn->fd));
   GPR_ASSERT(!fdn->readable_registered);
   GPR_ASSERT(!fdn->writable_registered);
@@ -111,29 +111,30 @@
   gpr_free(fdn);
 }
 
-static void fd_node_shutdown(grpc_exec_ctx *exec_ctx, fd_node *fdn) {
+static void fd_node_shutdown(grpc_exec_ctx* exec_ctx, fd_node* fdn) {
   gpr_mu_lock(&fdn->mu);
   fdn->shutting_down = true;
   if (!fdn->readable_registered && !fdn->writable_registered) {
     gpr_mu_unlock(&fdn->mu);
     fd_node_destroy(exec_ctx, fdn);
   } else {
-    grpc_fd_shutdown(exec_ctx, fdn->fd, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-                                            "c-ares fd shutdown"));
+    grpc_fd_shutdown(
+        exec_ctx, fdn->fd,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("c-ares fd shutdown"));
     gpr_mu_unlock(&fdn->mu);
   }
 }
 
-grpc_error *grpc_ares_ev_driver_create(grpc_ares_ev_driver **ev_driver,
-                                       grpc_pollset_set *pollset_set) {
-  *ev_driver = (grpc_ares_ev_driver *)gpr_malloc(sizeof(grpc_ares_ev_driver));
+grpc_error* grpc_ares_ev_driver_create(grpc_ares_ev_driver** ev_driver,
+                                       grpc_pollset_set* pollset_set) {
+  *ev_driver = (grpc_ares_ev_driver*)gpr_malloc(sizeof(grpc_ares_ev_driver));
   int status = ares_init(&(*ev_driver)->channel);
   gpr_log(GPR_DEBUG, "grpc_ares_ev_driver_create");
   if (status != ARES_SUCCESS) {
-    char *err_msg;
+    char* err_msg;
     gpr_asprintf(&err_msg, "Failed to init ares channel. C-ares error: %s",
                  ares_strerror(status));
-    grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(err_msg);
+    grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(err_msg);
     gpr_free(err_msg);
     gpr_free(*ev_driver);
     return err;
@@ -147,7 +148,7 @@
   return GRPC_ERROR_NONE;
 }
 
-void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver *ev_driver) {
+void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver* ev_driver) {
   // It's not safe to shut down remaining fds here directly, becauses
   // ares_host_callback does not provide an exec_ctx. We mark the event driver
   // as being shut down. If the event driver is working,
@@ -159,14 +160,15 @@
   grpc_ares_ev_driver_unref(ev_driver);
 }
 
-void grpc_ares_ev_driver_shutdown(grpc_exec_ctx *exec_ctx,
-                                  grpc_ares_ev_driver *ev_driver) {
+void grpc_ares_ev_driver_shutdown(grpc_exec_ctx* exec_ctx,
+                                  grpc_ares_ev_driver* ev_driver) {
   gpr_mu_lock(&ev_driver->mu);
   ev_driver->shutting_down = true;
-  fd_node *fn = ev_driver->fds;
+  fd_node* fn = ev_driver->fds;
   while (fn != NULL) {
-    grpc_fd_shutdown(exec_ctx, fn->fd, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-                                           "grpc_ares_ev_driver_shutdown"));
+    grpc_fd_shutdown(
+        exec_ctx, fn->fd,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("grpc_ares_ev_driver_shutdown"));
     fn = fn->next;
   }
   gpr_mu_unlock(&ev_driver->mu);
@@ -174,13 +176,13 @@
 
 // Search fd in the fd_node list head. This is an O(n) search, the max possible
 // value of n is ARES_GETSOCK_MAXNUM (16). n is typically 1 - 2 in our tests.
-static fd_node *pop_fd_node(fd_node **head, int fd) {
+static fd_node* pop_fd_node(fd_node** head, int fd) {
   fd_node dummy_head;
   dummy_head.next = *head;
-  fd_node *node = &dummy_head;
+  fd_node* node = &dummy_head;
   while (node->next != NULL) {
     if (grpc_fd_wrapped_fd(node->next->fd) == fd) {
-      fd_node *ret = node->next;
+      fd_node* ret = node->next;
       node->next = node->next->next;
       *head = dummy_head.next;
       return ret;
@@ -191,16 +193,16 @@
 }
 
 /* Check if \a fd is still readable */
-static bool grpc_ares_is_fd_still_readable(grpc_ares_ev_driver *ev_driver,
+static bool grpc_ares_is_fd_still_readable(grpc_ares_ev_driver* ev_driver,
                                            int fd) {
   size_t bytes_available = 0;
   return ioctl(fd, FIONREAD, &bytes_available) == 0 && bytes_available > 0;
 }
 
-static void on_readable_cb(grpc_exec_ctx *exec_ctx, void *arg,
-                           grpc_error *error) {
-  fd_node *fdn = (fd_node *)arg;
-  grpc_ares_ev_driver *ev_driver = fdn->ev_driver;
+static void on_readable_cb(grpc_exec_ctx* exec_ctx, void* arg,
+                           grpc_error* error) {
+  fd_node* fdn = (fd_node*)arg;
+  grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
   gpr_mu_lock(&fdn->mu);
   const int fd = grpc_fd_wrapped_fd(fdn->fd);
   fdn->readable_registered = false;
@@ -232,10 +234,10 @@
   grpc_ares_ev_driver_unref(ev_driver);
 }
 
-static void on_writable_cb(grpc_exec_ctx *exec_ctx, void *arg,
-                           grpc_error *error) {
-  fd_node *fdn = (fd_node *)arg;
-  grpc_ares_ev_driver *ev_driver = fdn->ev_driver;
+static void on_writable_cb(grpc_exec_ctx* exec_ctx, void* arg,
+                           grpc_error* error) {
+  fd_node* fdn = (fd_node*)arg;
+  grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
   gpr_mu_lock(&fdn->mu);
   const int fd = grpc_fd_wrapped_fd(fdn->fd);
   fdn->writable_registered = false;
@@ -265,15 +267,15 @@
   grpc_ares_ev_driver_unref(ev_driver);
 }
 
-ares_channel *grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver *ev_driver) {
+ares_channel* grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver* ev_driver) {
   return &ev_driver->channel;
 }
 
 // Get the file descriptors used by the ev_driver's ares channel, register
 // driver_closure with these filedescriptors.
-static void grpc_ares_notify_on_event_locked(grpc_exec_ctx *exec_ctx,
-                                             grpc_ares_ev_driver *ev_driver) {
-  fd_node *new_list = NULL;
+static void grpc_ares_notify_on_event_locked(grpc_exec_ctx* exec_ctx,
+                                             grpc_ares_ev_driver* ev_driver) {
+  fd_node* new_list = NULL;
   if (!ev_driver->shutting_down) {
     ares_socket_t socks[ARES_GETSOCK_MAXNUM];
     int socks_bitmask =
@@ -281,12 +283,12 @@
     for (size_t i = 0; i < ARES_GETSOCK_MAXNUM; i++) {
       if (ARES_GETSOCK_READABLE(socks_bitmask, i) ||
           ARES_GETSOCK_WRITABLE(socks_bitmask, i)) {
-        fd_node *fdn = pop_fd_node(&ev_driver->fds, socks[i]);
+        fd_node* fdn = pop_fd_node(&ev_driver->fds, socks[i]);
         // Create a new fd_node if sock[i] is not in the fd_node list.
         if (fdn == NULL) {
-          char *fd_name;
+          char* fd_name;
           gpr_asprintf(&fd_name, "ares_ev_driver-%" PRIuPTR, i);
-          fdn = (fd_node *)gpr_malloc(sizeof(fd_node));
+          fdn = (fd_node*)gpr_malloc(sizeof(fd_node));
           gpr_log(GPR_DEBUG, "new fd: %d", socks[i]);
           fdn->fd = grpc_fd_create(socks[i], fd_name);
           fdn->ev_driver = ev_driver;
@@ -331,7 +333,7 @@
   // are therefore no longer in use, so they can be shut down and removed from
   // the list.
   while (ev_driver->fds != NULL) {
-    fd_node *cur = ev_driver->fds;
+    fd_node* cur = ev_driver->fds;
     ev_driver->fds = ev_driver->fds->next;
     fd_node_shutdown(exec_ctx, cur);
   }
@@ -343,8 +345,8 @@
   }
 }
 
-void grpc_ares_ev_driver_start(grpc_exec_ctx *exec_ctx,
-                               grpc_ares_ev_driver *ev_driver) {
+void grpc_ares_ev_driver_start(grpc_exec_ctx* exec_ctx,
+                               grpc_ares_ev_driver* ev_driver) {
   gpr_mu_lock(&ev_driver->mu);
   if (!ev_driver->working) {
     ev_driver->working = true;
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
index 0437997..9408b9d 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
@@ -51,13 +51,13 @@
   struct ares_addr_port_node dns_server_addr;
   /** following members are set in grpc_resolve_address_ares_impl */
   /** closure to call when the request completes */
-  grpc_closure *on_done;
+  grpc_closure* on_done;
   /** the pointer to receive the resolved addresses */
-  grpc_lb_addresses **lb_addrs_out;
+  grpc_lb_addresses** lb_addrs_out;
   /** the pointer to receive the service config in JSON */
-  char **service_config_json_out;
+  char** service_config_json_out;
   /** the evernt driver used by this request */
-  grpc_ares_ev_driver *ev_driver;
+  grpc_ares_ev_driver* ev_driver;
   /** number of ongoing queries */
   gpr_refcount pending_queries;
 
@@ -66,15 +66,15 @@
   /** is there at least one successful query, set in on_done_cb */
   bool success;
   /** the errors explaining the request failure, set in on_done_cb */
-  grpc_error *error;
+  grpc_error* error;
 };
 
 typedef struct grpc_ares_hostbyname_request {
   /** following members are set in create_hostbyname_request */
   /** the top-level request instance */
-  grpc_ares_request *parent_request;
+  grpc_ares_request* parent_request;
   /** host to resolve, parsed from the name to resolve */
-  char *host;
+  char* host;
   /** port to fill in sockaddr_in, parsed from the name to resolve */
   uint16_t port;
   /** is it a grpclb address */
@@ -83,7 +83,7 @@
 
 static void do_basic_init(void) { gpr_mu_init(&g_init_mu); }
 
-static uint16_t strhtons(const char *port) {
+static uint16_t strhtons(const char* port) {
   if (strcmp(port, "http") == 0) {
     return htons(80);
   } else if (strcmp(port, "https") == 0) {
@@ -92,12 +92,12 @@
   return htons((unsigned short)atoi(port));
 }
 
-static void grpc_ares_request_ref(grpc_ares_request *r) {
+static void grpc_ares_request_ref(grpc_ares_request* r) {
   gpr_ref(&r->pending_queries);
 }
 
-static void grpc_ares_request_unref(grpc_exec_ctx *exec_ctx,
-                                    grpc_ares_request *r) {
+static void grpc_ares_request_unref(grpc_exec_ctx* exec_ctx,
+                                    grpc_ares_request* r) {
   /* If there are no pending queries, invoke on_done callback and destroy the
      request */
   if (gpr_unref(&r->pending_queries)) {
@@ -120,10 +120,10 @@
   }
 }
 
-static grpc_ares_hostbyname_request *create_hostbyname_request(
-    grpc_ares_request *parent_request, char *host, uint16_t port,
+static grpc_ares_hostbyname_request* create_hostbyname_request(
+    grpc_ares_request* parent_request, char* host, uint16_t port,
     bool is_balancer) {
-  grpc_ares_hostbyname_request *hr = (grpc_ares_hostbyname_request *)gpr_zalloc(
+  grpc_ares_hostbyname_request* hr = (grpc_ares_hostbyname_request*)gpr_zalloc(
       sizeof(grpc_ares_hostbyname_request));
   hr->parent_request = parent_request;
   hr->host = gpr_strdup(host);
@@ -133,23 +133,23 @@
   return hr;
 }
 
-static void destroy_hostbyname_request(grpc_exec_ctx *exec_ctx,
-                                       grpc_ares_hostbyname_request *hr) {
+static void destroy_hostbyname_request(grpc_exec_ctx* exec_ctx,
+                                       grpc_ares_hostbyname_request* hr) {
   grpc_ares_request_unref(exec_ctx, hr->parent_request);
   gpr_free(hr->host);
   gpr_free(hr);
 }
 
-static void on_hostbyname_done_cb(void *arg, int status, int timeouts,
-                                  struct hostent *hostent) {
-  grpc_ares_hostbyname_request *hr = (grpc_ares_hostbyname_request *)arg;
-  grpc_ares_request *r = hr->parent_request;
+static void on_hostbyname_done_cb(void* arg, int status, int timeouts,
+                                  struct hostent* hostent) {
+  grpc_ares_hostbyname_request* hr = (grpc_ares_hostbyname_request*)arg;
+  grpc_ares_request* r = hr->parent_request;
   gpr_mu_lock(&r->mu);
   if (status == ARES_SUCCESS) {
     GRPC_ERROR_UNREF(r->error);
     r->error = GRPC_ERROR_NONE;
     r->success = true;
-    grpc_lb_addresses **lb_addresses = r->lb_addrs_out;
+    grpc_lb_addresses** lb_addresses = r->lb_addrs_out;
     if (*lb_addresses == NULL) {
       *lb_addresses = grpc_lb_addresses_create(0, NULL);
     }
@@ -158,7 +158,7 @@
     for (i = 0; hostent->h_addr_list[i] != NULL; i++) {
     }
     (*lb_addresses)->num_addresses += i;
-    (*lb_addresses)->addresses = (grpc_lb_address *)gpr_realloc(
+    (*lb_addresses)->addresses = (grpc_lb_address*)gpr_realloc(
         (*lb_addresses)->addresses,
         sizeof(grpc_lb_address) * (*lb_addresses)->num_addresses);
     for (i = prev_naddr; i < (*lb_addresses)->num_addresses; i++) {
@@ -208,10 +208,10 @@
       }
     }
   } else if (!r->success) {
-    char *error_msg;
+    char* error_msg;
     gpr_asprintf(&error_msg, "C-ares status is not ARES_SUCCESS: %s",
                  ares_strerror(status));
-    grpc_error *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
+    grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
     gpr_free(error_msg);
     if (r->error == GRPC_ERROR_NONE) {
       r->error = error;
@@ -223,26 +223,26 @@
   destroy_hostbyname_request(NULL, hr);
 }
 
-static void on_srv_query_done_cb(void *arg, int status, int timeouts,
-                                 unsigned char *abuf, int alen) {
-  grpc_ares_request *r = (grpc_ares_request *)arg;
+static void on_srv_query_done_cb(void* arg, int status, int timeouts,
+                                 unsigned char* abuf, int alen) {
+  grpc_ares_request* r = (grpc_ares_request*)arg;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   gpr_log(GPR_DEBUG, "on_query_srv_done_cb");
   if (status == ARES_SUCCESS) {
     gpr_log(GPR_DEBUG, "on_query_srv_done_cb ARES_SUCCESS");
-    struct ares_srv_reply *reply;
+    struct ares_srv_reply* reply;
     const int parse_status = ares_parse_srv_reply(abuf, alen, &reply);
     if (parse_status == ARES_SUCCESS) {
-      ares_channel *channel = grpc_ares_ev_driver_get_channel(r->ev_driver);
-      for (struct ares_srv_reply *srv_it = reply; srv_it != NULL;
+      ares_channel* channel = grpc_ares_ev_driver_get_channel(r->ev_driver);
+      for (struct ares_srv_reply* srv_it = reply; srv_it != NULL;
            srv_it = srv_it->next) {
         if (grpc_ipv6_loopback_available()) {
-          grpc_ares_hostbyname_request *hr = create_hostbyname_request(
+          grpc_ares_hostbyname_request* hr = create_hostbyname_request(
               r, srv_it->host, htons(srv_it->port), true /* is_balancer */);
           ares_gethostbyname(*channel, hr->host, AF_INET6,
                              on_hostbyname_done_cb, hr);
         }
-        grpc_ares_hostbyname_request *hr = create_hostbyname_request(
+        grpc_ares_hostbyname_request* hr = create_hostbyname_request(
             r, srv_it->host, htons(srv_it->port), true /* is_balancer */);
         ares_gethostbyname(*channel, hr->host, AF_INET, on_hostbyname_done_cb,
                            hr);
@@ -253,10 +253,10 @@
       ares_free_data(reply);
     }
   } else if (!r->success) {
-    char *error_msg;
+    char* error_msg;
     gpr_asprintf(&error_msg, "C-ares status is not ARES_SUCCESS: %s",
                  ares_strerror(status));
-    grpc_error *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
+    grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
     gpr_free(error_msg);
     if (r->error == GRPC_ERROR_NONE) {
       r->error = error;
@@ -270,15 +270,15 @@
 
 static const char g_service_config_attribute_prefix[] = "grpc_config=";
 
-static void on_txt_done_cb(void *arg, int status, int timeouts,
-                           unsigned char *buf, int len) {
+static void on_txt_done_cb(void* arg, int status, int timeouts,
+                           unsigned char* buf, int len) {
   gpr_log(GPR_DEBUG, "on_txt_done_cb");
-  char *error_msg;
-  grpc_ares_request *r = (grpc_ares_request *)arg;
+  char* error_msg;
+  grpc_ares_request* r = (grpc_ares_request*)arg;
   const size_t prefix_len = sizeof(g_service_config_attribute_prefix) - 1;
-  struct ares_txt_ext *result = NULL;
-  struct ares_txt_ext *reply = NULL;
-  grpc_error *error = GRPC_ERROR_NONE;
+  struct ares_txt_ext* result = NULL;
+  struct ares_txt_ext* reply = NULL;
+  grpc_error* error = GRPC_ERROR_NONE;
   gpr_mu_lock(&r->mu);
   if (status != ARES_SUCCESS) goto fail;
   status = ares_parse_txt_reply_ext(buf, len, &reply);
@@ -294,12 +294,12 @@
   // Found a service config record.
   if (result != NULL) {
     size_t service_config_len = result->length - prefix_len;
-    *r->service_config_json_out = (char *)gpr_malloc(service_config_len + 1);
+    *r->service_config_json_out = (char*)gpr_malloc(service_config_len + 1);
     memcpy(*r->service_config_json_out, result->txt + prefix_len,
            service_config_len);
     for (result = result->next; result != NULL && !result->record_start;
          result = result->next) {
-      *r->service_config_json_out = (char *)gpr_realloc(
+      *r->service_config_json_out = (char*)gpr_realloc(
           *r->service_config_json_out, service_config_len + result->length + 1);
       memcpy(*r->service_config_json_out + service_config_len, result->txt,
              result->length);
@@ -326,15 +326,15 @@
   grpc_ares_request_unref(NULL, r);
 }
 
-static grpc_ares_request *grpc_dns_lookup_ares_impl(
-    grpc_exec_ctx *exec_ctx, const char *dns_server, const char *name,
-    const char *default_port, grpc_pollset_set *interested_parties,
-    grpc_closure *on_done, grpc_lb_addresses **addrs, bool check_grpclb,
-    char **service_config_json) {
-  grpc_error *error = GRPC_ERROR_NONE;
-  grpc_ares_hostbyname_request *hr = NULL;
-  grpc_ares_request *r = NULL;
-  ares_channel *channel = NULL;
+static grpc_ares_request* grpc_dns_lookup_ares_impl(
+    grpc_exec_ctx* exec_ctx, const char* dns_server, const char* name,
+    const char* default_port, grpc_pollset_set* interested_parties,
+    grpc_closure* on_done, grpc_lb_addresses** addrs, bool check_grpclb,
+    char** service_config_json) {
+  grpc_error* error = GRPC_ERROR_NONE;
+  grpc_ares_hostbyname_request* hr = NULL;
+  grpc_ares_request* r = NULL;
+  ares_channel* channel = NULL;
   /* TODO(zyc): Enable tracing after #9603 is checked in */
   /* if (grpc_dns_trace) {
       gpr_log(GPR_DEBUG, "resolve_address (blocking): name=%s, default_port=%s",
@@ -342,8 +342,8 @@
      } */
 
   /* parse name, splitting it into host and port parts */
-  char *host;
-  char *port;
+  char* host;
+  char* port;
   gpr_split_host_port(name, &host, &port);
   if (host == NULL) {
     error = grpc_error_set_str(
@@ -360,11 +360,11 @@
     port = gpr_strdup(default_port);
   }
 
-  grpc_ares_ev_driver *ev_driver;
+  grpc_ares_ev_driver* ev_driver;
   error = grpc_ares_ev_driver_create(&ev_driver, interested_parties);
   if (error != GRPC_ERROR_NONE) goto error_cleanup;
 
-  r = (grpc_ares_request *)gpr_zalloc(sizeof(grpc_ares_request));
+  r = (grpc_ares_request*)gpr_zalloc(sizeof(grpc_ares_request));
   gpr_mu_init(&r->mu);
   r->ev_driver = ev_driver;
   r->on_done = on_done;
@@ -380,7 +380,7 @@
     grpc_resolved_address addr;
     if (grpc_parse_ipv4_hostport(dns_server, &addr, false /* log_errors */)) {
       r->dns_server_addr.family = AF_INET;
-      struct sockaddr_in *in = (struct sockaddr_in *)addr.addr;
+      struct sockaddr_in* in = (struct sockaddr_in*)addr.addr;
       memcpy(&r->dns_server_addr.addr.addr4, &in->sin_addr,
              sizeof(struct in_addr));
       r->dns_server_addr.tcp_port = grpc_sockaddr_get_port(&addr);
@@ -388,7 +388,7 @@
     } else if (grpc_parse_ipv6_hostport(dns_server, &addr,
                                         false /* log_errors */)) {
       r->dns_server_addr.family = AF_INET6;
-      struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)addr.addr;
+      struct sockaddr_in6* in6 = (struct sockaddr_in6*)addr.addr;
       memcpy(&r->dns_server_addr.addr.addr6, &in6->sin6_addr,
              sizeof(struct in6_addr));
       r->dns_server_addr.tcp_port = grpc_sockaddr_get_port(&addr);
@@ -402,7 +402,7 @@
     }
     int status = ares_set_servers_ports(*channel, &r->dns_server_addr);
     if (status != ARES_SUCCESS) {
-      char *error_msg;
+      char* error_msg;
       gpr_asprintf(&error_msg, "C-ares status is not ARES_SUCCESS: %s",
                    ares_strerror(status));
       error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
@@ -423,7 +423,7 @@
   if (check_grpclb) {
     /* Query the SRV record */
     grpc_ares_request_ref(r);
-    char *service_name;
+    char* service_name;
     gpr_asprintf(&service_name, "_grpclb._tcp.%s", host);
     ares_query(*channel, service_name, ns_c_in, ns_t_srv, on_srv_query_done_cb,
                r);
@@ -447,29 +447,29 @@
   return NULL;
 }
 
-grpc_ares_request *(*grpc_dns_lookup_ares)(
-    grpc_exec_ctx *exec_ctx, const char *dns_server, const char *name,
-    const char *default_port, grpc_pollset_set *interested_parties,
-    grpc_closure *on_done, grpc_lb_addresses **addrs, bool check_grpclb,
-    char **service_config_json) = grpc_dns_lookup_ares_impl;
+grpc_ares_request* (*grpc_dns_lookup_ares)(
+    grpc_exec_ctx* exec_ctx, const char* dns_server, const char* name,
+    const char* default_port, grpc_pollset_set* interested_parties,
+    grpc_closure* on_done, grpc_lb_addresses** addrs, bool check_grpclb,
+    char** service_config_json) = grpc_dns_lookup_ares_impl;
 
-void grpc_cancel_ares_request(grpc_exec_ctx *exec_ctx, grpc_ares_request *r) {
+void grpc_cancel_ares_request(grpc_exec_ctx* exec_ctx, grpc_ares_request* r) {
   if (grpc_dns_lookup_ares == grpc_dns_lookup_ares_impl) {
     grpc_ares_ev_driver_shutdown(exec_ctx, r->ev_driver);
   }
 }
 
-grpc_error *grpc_ares_init(void) {
+grpc_error* grpc_ares_init(void) {
   gpr_once_init(&g_basic_init, do_basic_init);
   gpr_mu_lock(&g_init_mu);
   int status = ares_library_init(ARES_LIB_INIT_ALL);
   gpr_mu_unlock(&g_init_mu);
 
   if (status != ARES_SUCCESS) {
-    char *error_msg;
+    char* error_msg;
     gpr_asprintf(&error_msg, "ares_library_init failed: %s",
                  ares_strerror(status));
-    grpc_error *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
+    grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
     gpr_free(error_msg);
     return error;
   }
@@ -488,28 +488,28 @@
 
 typedef struct grpc_resolve_address_ares_request {
   /** the pointer to receive the resolved addresses */
-  grpc_resolved_addresses **addrs_out;
+  grpc_resolved_addresses** addrs_out;
   /** currently resolving lb addresses */
-  grpc_lb_addresses *lb_addrs;
+  grpc_lb_addresses* lb_addrs;
   /** closure to call when the resolve_address_ares request completes */
-  grpc_closure *on_resolve_address_done;
+  grpc_closure* on_resolve_address_done;
   /** a closure wrapping on_dns_lookup_done_cb, which should be invoked when the
       grpc_dns_lookup_ares operation is done. */
   grpc_closure on_dns_lookup_done;
 } grpc_resolve_address_ares_request;
 
-static void on_dns_lookup_done_cb(grpc_exec_ctx *exec_ctx, void *arg,
-                                  grpc_error *error) {
-  grpc_resolve_address_ares_request *r =
-      (grpc_resolve_address_ares_request *)arg;
-  grpc_resolved_addresses **resolved_addresses = r->addrs_out;
+static void on_dns_lookup_done_cb(grpc_exec_ctx* exec_ctx, void* arg,
+                                  grpc_error* error) {
+  grpc_resolve_address_ares_request* r =
+      (grpc_resolve_address_ares_request*)arg;
+  grpc_resolved_addresses** resolved_addresses = r->addrs_out;
   if (r->lb_addrs == NULL || r->lb_addrs->num_addresses == 0) {
     *resolved_addresses = NULL;
   } else {
     *resolved_addresses =
-        (grpc_resolved_addresses *)gpr_zalloc(sizeof(grpc_resolved_addresses));
+        (grpc_resolved_addresses*)gpr_zalloc(sizeof(grpc_resolved_addresses));
     (*resolved_addresses)->naddrs = r->lb_addrs->num_addresses;
-    (*resolved_addresses)->addrs = (grpc_resolved_address *)gpr_zalloc(
+    (*resolved_addresses)->addrs = (grpc_resolved_address*)gpr_zalloc(
         sizeof(grpc_resolved_address) * (*resolved_addresses)->naddrs);
     for (size_t i = 0; i < (*resolved_addresses)->naddrs; i++) {
       GPR_ASSERT(!r->lb_addrs->addresses[i].is_balancer);
@@ -523,14 +523,14 @@
   gpr_free(r);
 }
 
-static void grpc_resolve_address_ares_impl(grpc_exec_ctx *exec_ctx,
-                                           const char *name,
-                                           const char *default_port,
-                                           grpc_pollset_set *interested_parties,
-                                           grpc_closure *on_done,
-                                           grpc_resolved_addresses **addrs) {
-  grpc_resolve_address_ares_request *r =
-      (grpc_resolve_address_ares_request *)gpr_zalloc(
+static void grpc_resolve_address_ares_impl(grpc_exec_ctx* exec_ctx,
+                                           const char* name,
+                                           const char* default_port,
+                                           grpc_pollset_set* interested_parties,
+                                           grpc_closure* on_done,
+                                           grpc_resolved_addresses** addrs) {
+  grpc_resolve_address_ares_request* r =
+      (grpc_resolve_address_ares_request*)gpr_zalloc(
           sizeof(grpc_resolve_address_ares_request));
   r->addrs_out = addrs;
   r->on_resolve_address_done = on_done;
@@ -543,8 +543,8 @@
 }
 
 void (*grpc_resolve_address_ares)(
-    grpc_exec_ctx *exec_ctx, const char *name, const char *default_port,
-    grpc_pollset_set *interested_parties, grpc_closure *on_done,
-    grpc_resolved_addresses **addrs) = grpc_resolve_address_ares_impl;
+    grpc_exec_ctx* exec_ctx, const char* name, const char* default_port,
+    grpc_pollset_set* interested_parties, grpc_closure* on_done,
+    grpc_resolved_addresses** addrs) = grpc_resolve_address_ares_impl;
 
 #endif /* GRPC_ARES == 1 && !defined(GRPC_UV) */
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
index 38fbea9..6882b7b 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
@@ -36,12 +36,12 @@
    must be called at least once before this function. \a on_done may be
    called directly in this function without being scheduled with \a exec_ctx,
    so it must not try to acquire locks that are being held by the caller. */
-extern void (*grpc_resolve_address_ares)(grpc_exec_ctx *exec_ctx,
-                                         const char *name,
-                                         const char *default_port,
-                                         grpc_pollset_set *interested_parties,
-                                         grpc_closure *on_done,
-                                         grpc_resolved_addresses **addresses);
+extern void (*grpc_resolve_address_ares)(grpc_exec_ctx* exec_ctx,
+                                         const char* name,
+                                         const char* default_port,
+                                         grpc_pollset_set* interested_parties,
+                                         grpc_closure* on_done,
+                                         grpc_resolved_addresses** addresses);
 
 /* Asynchronously resolve \a name. It will try to resolve grpclb SRV records in
   addition to the normal address records. For normal address records, it uses
@@ -50,19 +50,19 @@
   function. \a on_done may be called directly in this function without being
   scheduled with \a exec_ctx, so it must not try to acquire locks that are
   being held by the caller. */
-extern grpc_ares_request *(*grpc_dns_lookup_ares)(
-    grpc_exec_ctx *exec_ctx, const char *dns_server, const char *name,
-    const char *default_port, grpc_pollset_set *interested_parties,
-    grpc_closure *on_done, grpc_lb_addresses **addresses, bool check_grpclb,
-    char **service_config_json);
+extern grpc_ares_request* (*grpc_dns_lookup_ares)(
+    grpc_exec_ctx* exec_ctx, const char* dns_server, const char* name,
+    const char* default_port, grpc_pollset_set* interested_parties,
+    grpc_closure* on_done, grpc_lb_addresses** addresses, bool check_grpclb,
+    char** service_config_json);
 
 /* Cancel the pending grpc_ares_request \a request */
-void grpc_cancel_ares_request(grpc_exec_ctx *exec_ctx,
-                              grpc_ares_request *request);
+void grpc_cancel_ares_request(grpc_exec_ctx* exec_ctx,
+                              grpc_ares_request* request);
 
 /* Initialize gRPC ares wrapper. Must be called at least once before
    grpc_resolve_address_ares(). */
-grpc_error *grpc_ares_init(void);
+grpc_error* grpc_ares_init(void);
 
 /* Uninitialized gRPC ares wrapper. If there was more than one previous call to
    grpc_ares_init(), this function uninitializes the gRPC ares wrapper only if
@@ -74,4 +74,4 @@
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H \
-          */
+        */
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
index f2587c4..a68a7c4 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
@@ -25,36 +25,36 @@
   char val;
 };
 
-static grpc_ares_request *grpc_dns_lookup_ares_impl(
-    grpc_exec_ctx *exec_ctx, const char *dns_server, const char *name,
-    const char *default_port, grpc_pollset_set *interested_parties,
-    grpc_closure *on_done, grpc_lb_addresses **addrs, bool check_grpclb,
-    char **service_config_json) {
+static grpc_ares_request* grpc_dns_lookup_ares_impl(
+    grpc_exec_ctx* exec_ctx, const char* dns_server, const char* name,
+    const char* default_port, grpc_pollset_set* interested_parties,
+    grpc_closure* on_done, grpc_lb_addresses** addrs, bool check_grpclb,
+    char** service_config_json) {
   return NULL;
 }
 
-grpc_ares_request *(*grpc_dns_lookup_ares)(
-    grpc_exec_ctx *exec_ctx, const char *dns_server, const char *name,
-    const char *default_port, grpc_pollset_set *interested_parties,
-    grpc_closure *on_done, grpc_lb_addresses **addrs, bool check_grpclb,
-    char **service_config_json) = grpc_dns_lookup_ares_impl;
+grpc_ares_request* (*grpc_dns_lookup_ares)(
+    grpc_exec_ctx* exec_ctx, const char* dns_server, const char* name,
+    const char* default_port, grpc_pollset_set* interested_parties,
+    grpc_closure* on_done, grpc_lb_addresses** addrs, bool check_grpclb,
+    char** service_config_json) = grpc_dns_lookup_ares_impl;
 
-void grpc_cancel_ares_request(grpc_exec_ctx *exec_ctx, grpc_ares_request *r) {}
+void grpc_cancel_ares_request(grpc_exec_ctx* exec_ctx, grpc_ares_request* r) {}
 
-grpc_error *grpc_ares_init(void) { return GRPC_ERROR_NONE; }
+grpc_error* grpc_ares_init(void) { return GRPC_ERROR_NONE; }
 
 void grpc_ares_cleanup(void) {}
 
-static void grpc_resolve_address_ares_impl(grpc_exec_ctx *exec_ctx,
-                                           const char *name,
-                                           const char *default_port,
-                                           grpc_pollset_set *interested_parties,
-                                           grpc_closure *on_done,
-                                           grpc_resolved_addresses **addrs) {}
+static void grpc_resolve_address_ares_impl(grpc_exec_ctx* exec_ctx,
+                                           const char* name,
+                                           const char* default_port,
+                                           grpc_pollset_set* interested_parties,
+                                           grpc_closure* on_done,
+                                           grpc_resolved_addresses** addrs) {}
 
 void (*grpc_resolve_address_ares)(
-    grpc_exec_ctx *exec_ctx, const char *name, const char *default_port,
-    grpc_pollset_set *interested_parties, grpc_closure *on_done,
-    grpc_resolved_addresses **addrs) = grpc_resolve_address_ares_impl;
+    grpc_exec_ctx* exec_ctx, const char* name, const char* default_port,
+    grpc_pollset_set* interested_parties, grpc_closure* on_done,
+    grpc_resolved_addresses** addrs) = grpc_resolve_address_ares_impl;
 
 #endif /* GRPC_ARES != 1 || defined(GRPC_UV) */
diff --git a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
index e669b6d..a57ab66 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
@@ -45,13 +45,13 @@
   /** base class: must be first */
   grpc_resolver base;
   /** name to resolve */
-  char *name_to_resolve;
+  char* name_to_resolve;
   /** default port to use */
-  char *default_port;
+  char* default_port;
   /** channel args. */
-  grpc_channel_args *channel_args;
+  grpc_channel_args* channel_args;
   /** pollset_set to drive the name resolution process */
-  grpc_pollset_set *interested_parties;
+  grpc_pollset_set* interested_parties;
 
   /** are we currently resolving? */
   bool resolving;
@@ -60,11 +60,11 @@
   /** which version of the result is current? */
   int resolved_version;
   /** pending next completion, or NULL */
-  grpc_closure *next_completion;
+  grpc_closure* next_completion;
   /** target result address for next completion */
-  grpc_channel_args **target_result;
+  grpc_channel_args** target_result;
   /** current (fully resolved) result */
-  grpc_channel_args *resolved_result;
+  grpc_channel_args* resolved_result;
   /** retry timer */
   bool have_retry_timer;
   grpc_timer retry_timer;
@@ -73,30 +73,30 @@
   grpc_backoff backoff_state;
 
   /** currently resolving addresses */
-  grpc_resolved_addresses *addresses;
+  grpc_resolved_addresses* addresses;
 } dns_resolver;
 
-static void dns_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
+static void dns_destroy(grpc_exec_ctx* exec_ctx, grpc_resolver* r);
 
-static void dns_start_resolving_locked(grpc_exec_ctx *exec_ctx,
-                                       dns_resolver *r);
-static void dns_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
-                                         dns_resolver *r);
+static void dns_start_resolving_locked(grpc_exec_ctx* exec_ctx,
+                                       dns_resolver* r);
+static void dns_maybe_finish_next_locked(grpc_exec_ctx* exec_ctx,
+                                         dns_resolver* r);
 
-static void dns_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
-static void dns_channel_saw_error_locked(grpc_exec_ctx *exec_ctx,
-                                         grpc_resolver *r);
-static void dns_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *r,
-                            grpc_channel_args **target_result,
-                            grpc_closure *on_complete);
+static void dns_shutdown_locked(grpc_exec_ctx* exec_ctx, grpc_resolver* r);
+static void dns_channel_saw_error_locked(grpc_exec_ctx* exec_ctx,
+                                         grpc_resolver* r);
+static void dns_next_locked(grpc_exec_ctx* exec_ctx, grpc_resolver* r,
+                            grpc_channel_args** target_result,
+                            grpc_closure* on_complete);
 
 static const grpc_resolver_vtable dns_resolver_vtable = {
     dns_destroy, dns_shutdown_locked, dns_channel_saw_error_locked,
     dns_next_locked};
 
-static void dns_shutdown_locked(grpc_exec_ctx *exec_ctx,
-                                grpc_resolver *resolver) {
-  dns_resolver *r = (dns_resolver *)resolver;
+static void dns_shutdown_locked(grpc_exec_ctx* exec_ctx,
+                                grpc_resolver* resolver) {
+  dns_resolver* r = (dns_resolver*)resolver;
   if (r->have_retry_timer) {
     grpc_timer_cancel(exec_ctx, &r->retry_timer);
   }
@@ -109,19 +109,19 @@
   }
 }
 
-static void dns_channel_saw_error_locked(grpc_exec_ctx *exec_ctx,
-                                         grpc_resolver *resolver) {
-  dns_resolver *r = (dns_resolver *)resolver;
+static void dns_channel_saw_error_locked(grpc_exec_ctx* exec_ctx,
+                                         grpc_resolver* resolver) {
+  dns_resolver* r = (dns_resolver*)resolver;
   if (!r->resolving) {
     grpc_backoff_reset(&r->backoff_state);
     dns_start_resolving_locked(exec_ctx, r);
   }
 }
 
-static void dns_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
-                            grpc_channel_args **target_result,
-                            grpc_closure *on_complete) {
-  dns_resolver *r = (dns_resolver *)resolver;
+static void dns_next_locked(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver,
+                            grpc_channel_args** target_result,
+                            grpc_closure* on_complete) {
+  dns_resolver* r = (dns_resolver*)resolver;
   GPR_ASSERT(!r->next_completion);
   r->next_completion = on_complete;
   r->target_result = target_result;
@@ -133,9 +133,9 @@
   }
 }
 
-static void dns_on_retry_timer_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                      grpc_error *error) {
-  dns_resolver *r = (dns_resolver *)arg;
+static void dns_on_retry_timer_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                      grpc_error* error) {
+  dns_resolver* r = (dns_resolver*)arg;
 
   r->have_retry_timer = false;
   if (error == GRPC_ERROR_NONE) {
@@ -147,17 +147,17 @@
   GRPC_RESOLVER_UNREF(exec_ctx, &r->base, "retry-timer");
 }
 
-static void dns_on_resolved_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                   grpc_error *error) {
-  dns_resolver *r = (dns_resolver *)arg;
-  grpc_channel_args *result = NULL;
+static void dns_on_resolved_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                   grpc_error* error) {
+  dns_resolver* r = (dns_resolver*)arg;
+  grpc_channel_args* result = NULL;
   GPR_ASSERT(r->resolving);
   r->resolving = false;
   GRPC_ERROR_REF(error);
   error = grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
                              grpc_slice_from_copied_string(r->name_to_resolve));
   if (r->addresses != NULL) {
-    grpc_lb_addresses *addresses = grpc_lb_addresses_create(
+    grpc_lb_addresses* addresses = grpc_lb_addresses_create(
         r->addresses->naddrs, NULL /* user_data_vtable */);
     for (size_t i = 0; i < r->addresses->naddrs; ++i) {
       grpc_lb_addresses_set_address(
@@ -170,7 +170,8 @@
     grpc_resolved_addresses_destroy(r->addresses);
     grpc_lb_addresses_destroy(exec_ctx, addresses);
   } else {
-    grpc_millis next_try = grpc_backoff_step(exec_ctx, &r->backoff_state);
+    grpc_millis next_try =
+        grpc_backoff_step(exec_ctx, &r->backoff_state).next_attempt_start_time;
     grpc_millis timeout = next_try - grpc_exec_ctx_now(exec_ctx);
     gpr_log(GPR_INFO, "dns resolution failed (will retry): %s",
             grpc_error_string(error));
@@ -197,8 +198,8 @@
   GRPC_RESOLVER_UNREF(exec_ctx, &r->base, "dns-resolving");
 }
 
-static void dns_start_resolving_locked(grpc_exec_ctx *exec_ctx,
-                                       dns_resolver *r) {
+static void dns_start_resolving_locked(grpc_exec_ctx* exec_ctx,
+                                       dns_resolver* r) {
   GRPC_RESOLVER_REF(&r->base, "dns-resolving");
   GPR_ASSERT(!r->resolving);
   r->resolving = true;
@@ -210,8 +211,8 @@
       &r->addresses);
 }
 
-static void dns_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
-                                         dns_resolver *r) {
+static void dns_maybe_finish_next_locked(grpc_exec_ctx* exec_ctx,
+                                         dns_resolver* r) {
   if (r->next_completion != NULL &&
       r->resolved_version != r->published_version) {
     *r->target_result = r->resolved_result == NULL
@@ -223,8 +224,8 @@
   }
 }
 
-static void dns_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
-  dns_resolver *r = (dns_resolver *)gr;
+static void dns_destroy(grpc_exec_ctx* exec_ctx, grpc_resolver* gr) {
+  dns_resolver* r = (dns_resolver*)gr;
   if (r->resolved_result != NULL) {
     grpc_channel_args_destroy(exec_ctx, r->resolved_result);
   }
@@ -235,18 +236,18 @@
   gpr_free(r);
 }
 
-static grpc_resolver *dns_create(grpc_exec_ctx *exec_ctx,
-                                 grpc_resolver_args *args,
-                                 const char *default_port) {
+static grpc_resolver* dns_create(grpc_exec_ctx* exec_ctx,
+                                 grpc_resolver_args* args,
+                                 const char* default_port) {
   if (0 != strcmp(args->uri->authority, "")) {
     gpr_log(GPR_ERROR, "authority based dns uri's not supported");
     return NULL;
   }
   // Get name from args.
-  char *path = args->uri->path;
+  char* path = args->uri->path;
   if (path[0] == '/') ++path;
   // Create resolver.
-  dns_resolver *r = (dns_resolver *)gpr_zalloc(sizeof(dns_resolver));
+  dns_resolver* r = (dns_resolver*)gpr_zalloc(sizeof(dns_resolver));
   grpc_resolver_init(&r->base, &dns_resolver_vtable, args->combiner);
   r->name_to_resolve = gpr_strdup(path);
   r->default_port = gpr_strdup(default_port);
@@ -256,11 +257,11 @@
     grpc_pollset_set_add_pollset_set(exec_ctx, r->interested_parties,
                                      args->pollset_set);
   }
-  grpc_backoff_init(&r->backoff_state, GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS,
-                    GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER,
-                    GRPC_DNS_RECONNECT_JITTER,
-                    GRPC_DNS_MIN_CONNECT_TIMEOUT_SECONDS * 1000,
-                    GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000);
+  grpc_backoff_init(
+      &r->backoff_state, GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS * 1000,
+      GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER, GRPC_DNS_RECONNECT_JITTER,
+      GRPC_DNS_MIN_CONNECT_TIMEOUT_SECONDS * 1000,
+      GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000);
   return &r->base;
 }
 
@@ -268,19 +269,19 @@
  * FACTORY
  */
 
-static void dns_factory_ref(grpc_resolver_factory *factory) {}
+static void dns_factory_ref(grpc_resolver_factory* factory) {}
 
-static void dns_factory_unref(grpc_resolver_factory *factory) {}
+static void dns_factory_unref(grpc_resolver_factory* factory) {}
 
-static grpc_resolver *dns_factory_create_resolver(
-    grpc_exec_ctx *exec_ctx, grpc_resolver_factory *factory,
-    grpc_resolver_args *args) {
+static grpc_resolver* dns_factory_create_resolver(
+    grpc_exec_ctx* exec_ctx, grpc_resolver_factory* factory,
+    grpc_resolver_args* args) {
   return dns_create(exec_ctx, args, "https");
 }
 
-static char *dns_factory_get_default_host_name(grpc_resolver_factory *factory,
-                                               grpc_uri *uri) {
-  const char *path = uri->path;
+static char* dns_factory_get_default_host_name(grpc_resolver_factory* factory,
+                                               grpc_uri* uri) {
+  const char* path = uri->path;
   if (path[0] == '/') ++path;
   return gpr_strdup(path);
 }
@@ -290,17 +291,17 @@
     dns_factory_get_default_host_name, "dns"};
 static grpc_resolver_factory dns_resolver_factory = {&dns_factory_vtable};
 
-static grpc_resolver_factory *dns_resolver_factory_create() {
+static grpc_resolver_factory* dns_resolver_factory_create() {
   return &dns_resolver_factory;
 }
 
 extern "C" void grpc_resolver_dns_native_init(void) {
-  char *resolver = gpr_getenv("GRPC_DNS_RESOLVER");
+  char* resolver = gpr_getenv("GRPC_DNS_RESOLVER");
   if (resolver != NULL && gpr_stricmp(resolver, "native") == 0) {
     gpr_log(GPR_DEBUG, "Using native dns resolver");
     grpc_register_resolver_type(dns_resolver_factory_create());
   } else {
-    grpc_resolver_factory *existing_factory =
+    grpc_resolver_factory* existing_factory =
         grpc_resolver_factory_lookup("dns");
     if (existing_factory == NULL) {
       gpr_log(GPR_DEBUG, "Using native dns resolver");
diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
index 95c3baf..3f341fa 100644
--- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
+++ b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
@@ -65,4 +65,4 @@
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FAKE_FAKE_RESOLVER_H \
-          */
+        */
diff --git a/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc b/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
index dda9542..9fc8dff 100644
--- a/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
+++ b/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
@@ -41,36 +41,36 @@
   /** base class: must be first */
   grpc_resolver base;
   /** the addresses that we've 'resolved' */
-  grpc_lb_addresses *addresses;
+  grpc_lb_addresses* addresses;
   /** channel args */
-  grpc_channel_args *channel_args;
+  grpc_channel_args* channel_args;
   /** have we published? */
   bool published;
   /** pending next completion, or NULL */
-  grpc_closure *next_completion;
+  grpc_closure* next_completion;
   /** target result address for next completion */
-  grpc_channel_args **target_result;
+  grpc_channel_args** target_result;
 } sockaddr_resolver;
 
-static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
+static void sockaddr_destroy(grpc_exec_ctx* exec_ctx, grpc_resolver* r);
 
-static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
-                                              sockaddr_resolver *r);
+static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx* exec_ctx,
+                                              sockaddr_resolver* r);
 
-static void sockaddr_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
-static void sockaddr_channel_saw_error_locked(grpc_exec_ctx *exec_ctx,
-                                              grpc_resolver *r);
-static void sockaddr_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *r,
-                                 grpc_channel_args **target_result,
-                                 grpc_closure *on_complete);
+static void sockaddr_shutdown_locked(grpc_exec_ctx* exec_ctx, grpc_resolver* r);
+static void sockaddr_channel_saw_error_locked(grpc_exec_ctx* exec_ctx,
+                                              grpc_resolver* r);
+static void sockaddr_next_locked(grpc_exec_ctx* exec_ctx, grpc_resolver* r,
+                                 grpc_channel_args** target_result,
+                                 grpc_closure* on_complete);
 
 static const grpc_resolver_vtable sockaddr_resolver_vtable = {
     sockaddr_destroy, sockaddr_shutdown_locked,
     sockaddr_channel_saw_error_locked, sockaddr_next_locked};
 
-static void sockaddr_shutdown_locked(grpc_exec_ctx *exec_ctx,
-                                     grpc_resolver *resolver) {
-  sockaddr_resolver *r = (sockaddr_resolver *)resolver;
+static void sockaddr_shutdown_locked(grpc_exec_ctx* exec_ctx,
+                                     grpc_resolver* resolver) {
+  sockaddr_resolver* r = (sockaddr_resolver*)resolver;
   if (r->next_completion != NULL) {
     *r->target_result = NULL;
     GRPC_CLOSURE_SCHED(
@@ -80,26 +80,26 @@
   }
 }
 
-static void sockaddr_channel_saw_error_locked(grpc_exec_ctx *exec_ctx,
-                                              grpc_resolver *resolver) {
-  sockaddr_resolver *r = (sockaddr_resolver *)resolver;
+static void sockaddr_channel_saw_error_locked(grpc_exec_ctx* exec_ctx,
+                                              grpc_resolver* resolver) {
+  sockaddr_resolver* r = (sockaddr_resolver*)resolver;
   r->published = false;
   sockaddr_maybe_finish_next_locked(exec_ctx, r);
 }
 
-static void sockaddr_next_locked(grpc_exec_ctx *exec_ctx,
-                                 grpc_resolver *resolver,
-                                 grpc_channel_args **target_result,
-                                 grpc_closure *on_complete) {
-  sockaddr_resolver *r = (sockaddr_resolver *)resolver;
+static void sockaddr_next_locked(grpc_exec_ctx* exec_ctx,
+                                 grpc_resolver* resolver,
+                                 grpc_channel_args** target_result,
+                                 grpc_closure* on_complete) {
+  sockaddr_resolver* r = (sockaddr_resolver*)resolver;
   GPR_ASSERT(!r->next_completion);
   r->next_completion = on_complete;
   r->target_result = target_result;
   sockaddr_maybe_finish_next_locked(exec_ctx, r);
 }
 
-static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
-                                              sockaddr_resolver *r) {
+static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx* exec_ctx,
+                                              sockaddr_resolver* r) {
   if (r->next_completion != NULL && !r->published) {
     r->published = true;
     grpc_arg arg = grpc_lb_addresses_create_channel_arg(r->addresses);
@@ -110,42 +110,42 @@
   }
 }
 
-static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
-  sockaddr_resolver *r = (sockaddr_resolver *)gr;
+static void sockaddr_destroy(grpc_exec_ctx* exec_ctx, grpc_resolver* gr) {
+  sockaddr_resolver* r = (sockaddr_resolver*)gr;
   grpc_lb_addresses_destroy(exec_ctx, r->addresses);
   grpc_channel_args_destroy(exec_ctx, r->channel_args);
   gpr_free(r);
 }
 
-static char *ip_get_default_authority(grpc_uri *uri) {
-  const char *path = uri->path;
+static char* ip_get_default_authority(grpc_uri* uri) {
+  const char* path = uri->path;
   if (path[0] == '/') ++path;
   return gpr_strdup(path);
 }
 
-static char *ipv4_get_default_authority(grpc_resolver_factory *factory,
-                                        grpc_uri *uri) {
+static char* ipv4_get_default_authority(grpc_resolver_factory* factory,
+                                        grpc_uri* uri) {
   return ip_get_default_authority(uri);
 }
 
-static char *ipv6_get_default_authority(grpc_resolver_factory *factory,
-                                        grpc_uri *uri) {
+static char* ipv6_get_default_authority(grpc_resolver_factory* factory,
+                                        grpc_uri* uri) {
   return ip_get_default_authority(uri);
 }
 
 #ifdef GRPC_HAVE_UNIX_SOCKET
-char *unix_get_default_authority(grpc_resolver_factory *factory,
-                                 grpc_uri *uri) {
+char* unix_get_default_authority(grpc_resolver_factory* factory,
+                                 grpc_uri* uri) {
   return gpr_strdup("localhost");
 }
 #endif
 
-static void do_nothing(void *ignored) {}
+static void do_nothing(void* ignored) {}
 
-static grpc_resolver *sockaddr_create(grpc_exec_ctx *exec_ctx,
-                                      grpc_resolver_args *args,
-                                      bool parse(const grpc_uri *uri,
-                                                 grpc_resolved_address *dst)) {
+static grpc_resolver* sockaddr_create(grpc_exec_ctx* exec_ctx,
+                                      grpc_resolver_args* args,
+                                      bool parse(const grpc_uri* uri,
+                                                 grpc_resolved_address* dst)) {
   if (0 != strcmp(args->uri->authority, "")) {
     gpr_log(GPR_ERROR, "authority based uri's not supported by the %s scheme",
             args->uri->scheme);
@@ -157,12 +157,12 @@
   grpc_slice_buffer path_parts;
   grpc_slice_buffer_init(&path_parts);
   grpc_slice_split(path_slice, ",", &path_parts);
-  grpc_lb_addresses *addresses =
+  grpc_lb_addresses* addresses =
       grpc_lb_addresses_create(path_parts.count, NULL /* user_data_vtable */);
   bool errors_found = false;
   for (size_t i = 0; i < addresses->num_addresses; i++) {
     grpc_uri ith_uri = *args->uri;
-    char *part_str = grpc_slice_to_c_string(path_parts.slices[i]);
+    char* part_str = grpc_slice_to_c_string(path_parts.slices[i]);
     ith_uri.path = part_str;
     if (!parse(&ith_uri, &addresses->addresses[i].address)) {
       errors_found = true; /* GPR_TRUE */
@@ -177,8 +177,8 @@
     return NULL;
   }
   /* Instantiate resolver. */
-  sockaddr_resolver *r =
-      (sockaddr_resolver *)gpr_zalloc(sizeof(sockaddr_resolver));
+  sockaddr_resolver* r =
+      (sockaddr_resolver*)gpr_zalloc(sizeof(sockaddr_resolver));
   r->addresses = addresses;
   r->channel_args = grpc_channel_args_copy(args->args);
   grpc_resolver_init(&r->base, &sockaddr_resolver_vtable, args->combiner);
@@ -189,14 +189,14 @@
  * FACTORY
  */
 
-static void sockaddr_factory_ref(grpc_resolver_factory *factory) {}
+static void sockaddr_factory_ref(grpc_resolver_factory* factory) {}
 
-static void sockaddr_factory_unref(grpc_resolver_factory *factory) {}
+static void sockaddr_factory_unref(grpc_resolver_factory* factory) {}
 
 #define DECL_FACTORY(name)                                                  \
-  static grpc_resolver *name##_factory_create_resolver(                     \
-      grpc_exec_ctx *exec_ctx, grpc_resolver_factory *factory,              \
-      grpc_resolver_args *args) {                                           \
+  static grpc_resolver* name##_factory_create_resolver(                     \
+      grpc_exec_ctx* exec_ctx, grpc_resolver_factory* factory,              \
+      grpc_resolver_args* args) {                                           \
     return sockaddr_create(exec_ctx, args, grpc_parse_##name);              \
   }                                                                         \
   static const grpc_resolver_factory_vtable name##_factory_vtable = {       \
diff --git a/src/core/ext/filters/client_channel/resolver_factory.h b/src/core/ext/filters/client_channel/resolver_factory.h
index c8b2c58..62555a4 100644
--- a/src/core/ext/filters/client_channel/resolver_factory.h
+++ b/src/core/ext/filters/client_channel/resolver_factory.h
@@ -32,44 +32,44 @@
 typedef struct grpc_resolver_factory_vtable grpc_resolver_factory_vtable;
 
 struct grpc_resolver_factory {
-  const grpc_resolver_factory_vtable *vtable;
+  const grpc_resolver_factory_vtable* vtable;
 };
 
 typedef struct grpc_resolver_args {
-  grpc_uri *uri;
-  const grpc_channel_args *args;
-  grpc_pollset_set *pollset_set;
-  grpc_combiner *combiner;
+  grpc_uri* uri;
+  const grpc_channel_args* args;
+  grpc_pollset_set* pollset_set;
+  grpc_combiner* combiner;
 } grpc_resolver_args;
 
 struct grpc_resolver_factory_vtable {
-  void (*ref)(grpc_resolver_factory *factory);
-  void (*unref)(grpc_resolver_factory *factory);
+  void (*ref)(grpc_resolver_factory* factory);
+  void (*unref)(grpc_resolver_factory* factory);
 
   /** Implementation of grpc_resolver_factory_create_resolver */
-  grpc_resolver *(*create_resolver)(grpc_exec_ctx *exec_ctx,
-                                    grpc_resolver_factory *factory,
-                                    grpc_resolver_args *args);
+  grpc_resolver* (*create_resolver)(grpc_exec_ctx* exec_ctx,
+                                    grpc_resolver_factory* factory,
+                                    grpc_resolver_args* args);
 
   /** Implementation of grpc_resolver_factory_get_default_authority */
-  char *(*get_default_authority)(grpc_resolver_factory *factory, grpc_uri *uri);
+  char* (*get_default_authority)(grpc_resolver_factory* factory, grpc_uri* uri);
 
   /** URI scheme that this factory implements */
-  const char *scheme;
+  const char* scheme;
 };
 
-void grpc_resolver_factory_ref(grpc_resolver_factory *resolver);
-void grpc_resolver_factory_unref(grpc_resolver_factory *resolver);
+void grpc_resolver_factory_ref(grpc_resolver_factory* resolver);
+void grpc_resolver_factory_unref(grpc_resolver_factory* resolver);
 
 /** Create a resolver instance for a name */
-grpc_resolver *grpc_resolver_factory_create_resolver(
-    grpc_exec_ctx *exec_ctx, grpc_resolver_factory *factory,
-    grpc_resolver_args *args);
+grpc_resolver* grpc_resolver_factory_create_resolver(
+    grpc_exec_ctx* exec_ctx, grpc_resolver_factory* factory,
+    grpc_resolver_args* args);
 
 /** Return a (freshly allocated with gpr_malloc) string representing
     the default authority to use for this scheme. */
-char *grpc_resolver_factory_get_default_authority(
-    grpc_resolver_factory *factory, grpc_uri *uri);
+char* grpc_resolver_factory_get_default_authority(
+    grpc_resolver_factory* factory, grpc_uri* uri);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/resolver_registry.cc b/src/core/ext/filters/client_channel/resolver_registry.cc
index 1a0fb0b..9e45887 100644
--- a/src/core/ext/filters/client_channel/resolver_registry.cc
+++ b/src/core/ext/filters/client_channel/resolver_registry.cc
@@ -27,7 +27,7 @@
 #define MAX_RESOLVERS 10
 #define DEFAULT_RESOLVER_PREFIX_MAX_LENGTH 32
 
-static grpc_resolver_factory *g_all_of_the_resolvers[MAX_RESOLVERS];
+static grpc_resolver_factory* g_all_of_the_resolvers[MAX_RESOLVERS];
 static int g_number_of_resolvers = 0;
 
 static char g_default_resolver_prefix[DEFAULT_RESOLVER_PREFIX_MAX_LENGTH] =
@@ -49,7 +49,7 @@
 }
 
 void grpc_resolver_registry_set_default_prefix(
-    const char *default_resolver_prefix) {
+    const char* default_resolver_prefix) {
   const size_t len = strlen(default_resolver_prefix);
   GPR_ASSERT(len < DEFAULT_RESOLVER_PREFIX_MAX_LENGTH &&
              "default resolver prefix too long");
@@ -59,7 +59,7 @@
   strcpy(g_default_resolver_prefix, default_resolver_prefix);
 }
 
-void grpc_register_resolver_type(grpc_resolver_factory *factory) {
+void grpc_register_resolver_type(grpc_resolver_factory* factory) {
   int i;
   for (i = 0; i < g_number_of_resolvers; i++) {
     GPR_ASSERT(0 != strcmp(factory->vtable->scheme,
@@ -70,7 +70,7 @@
   g_all_of_the_resolvers[g_number_of_resolvers++] = factory;
 }
 
-static grpc_resolver_factory *lookup_factory(const char *name) {
+static grpc_resolver_factory* lookup_factory(const char* name) {
   int i;
 
   for (i = 0; i < g_number_of_resolvers; i++) {
@@ -81,22 +81,22 @@
   return NULL;
 }
 
-grpc_resolver_factory *grpc_resolver_factory_lookup(const char *name) {
-  grpc_resolver_factory *f = lookup_factory(name);
+grpc_resolver_factory* grpc_resolver_factory_lookup(const char* name) {
+  grpc_resolver_factory* f = lookup_factory(name);
   if (f) grpc_resolver_factory_ref(f);
   return f;
 }
 
-static grpc_resolver_factory *lookup_factory_by_uri(grpc_uri *uri) {
+static grpc_resolver_factory* lookup_factory_by_uri(grpc_uri* uri) {
   if (!uri) return NULL;
   return lookup_factory(uri->scheme);
 }
 
-static grpc_resolver_factory *resolve_factory(grpc_exec_ctx *exec_ctx,
-                                              const char *target,
-                                              grpc_uri **uri,
-                                              char **canonical_target) {
-  grpc_resolver_factory *factory = NULL;
+static grpc_resolver_factory* resolve_factory(grpc_exec_ctx* exec_ctx,
+                                              const char* target,
+                                              grpc_uri** uri,
+                                              char** canonical_target) {
+  grpc_resolver_factory* factory = NULL;
 
   GPR_ASSERT(uri != NULL);
   *uri = grpc_uri_parse(exec_ctx, target, 1);
@@ -116,15 +116,15 @@
   return factory;
 }
 
-grpc_resolver *grpc_resolver_create(grpc_exec_ctx *exec_ctx, const char *target,
-                                    const grpc_channel_args *args,
-                                    grpc_pollset_set *pollset_set,
-                                    grpc_combiner *combiner) {
-  grpc_uri *uri = NULL;
-  char *canonical_target = NULL;
-  grpc_resolver_factory *factory =
+grpc_resolver* grpc_resolver_create(grpc_exec_ctx* exec_ctx, const char* target,
+                                    const grpc_channel_args* args,
+                                    grpc_pollset_set* pollset_set,
+                                    grpc_combiner* combiner) {
+  grpc_uri* uri = NULL;
+  char* canonical_target = NULL;
+  grpc_resolver_factory* factory =
       resolve_factory(exec_ctx, target, &uri, &canonical_target);
-  grpc_resolver *resolver;
+  grpc_resolver* resolver;
   grpc_resolver_args resolver_args;
   memset(&resolver_args, 0, sizeof(resolver_args));
   resolver_args.uri = uri;
@@ -138,21 +138,21 @@
   return resolver;
 }
 
-char *grpc_get_default_authority(grpc_exec_ctx *exec_ctx, const char *target) {
-  grpc_uri *uri = NULL;
-  char *canonical_target = NULL;
-  grpc_resolver_factory *factory =
+char* grpc_get_default_authority(grpc_exec_ctx* exec_ctx, const char* target) {
+  grpc_uri* uri = NULL;
+  char* canonical_target = NULL;
+  grpc_resolver_factory* factory =
       resolve_factory(exec_ctx, target, &uri, &canonical_target);
-  char *authority = grpc_resolver_factory_get_default_authority(factory, uri);
+  char* authority = grpc_resolver_factory_get_default_authority(factory, uri);
   grpc_uri_destroy(uri);
   gpr_free(canonical_target);
   return authority;
 }
 
-char *grpc_resolver_factory_add_default_prefix_if_needed(
-    grpc_exec_ctx *exec_ctx, const char *target) {
-  grpc_uri *uri = NULL;
-  char *canonical_target = NULL;
+char* grpc_resolver_factory_add_default_prefix_if_needed(
+    grpc_exec_ctx* exec_ctx, const char* target) {
+  grpc_uri* uri = NULL;
+  char* canonical_target = NULL;
   resolve_factory(exec_ctx, target, &uri, &canonical_target);
   grpc_uri_destroy(uri);
   return canonical_target == NULL ? gpr_strdup(target) : canonical_target;
diff --git a/src/core/ext/filters/client_channel/resolver_registry.h b/src/core/ext/filters/client_channel/resolver_registry.h
index 06d0b99..01a2d0b 100644
--- a/src/core/ext/filters/client_channel/resolver_registry.h
+++ b/src/core/ext/filters/client_channel/resolver_registry.h
@@ -30,14 +30,14 @@
 void grpc_resolver_registry_shutdown(void);
 
 /** Set the default URI prefix to \a default_prefix. */
-void grpc_resolver_registry_set_default_prefix(const char *default_prefix);
+void grpc_resolver_registry_set_default_prefix(const char* default_prefix);
 
 /** Register a resolver type.
     URI's of \a scheme will be resolved with the given resolver.
     If \a priority is greater than zero, then the resolver will be eligible
     to resolve names that are passed in with no scheme. Higher priority
     resolvers will be tried before lower priority schemes. */
-void grpc_register_resolver_type(grpc_resolver_factory *factory);
+void grpc_register_resolver_type(grpc_resolver_factory* factory);
 
 /** Create a resolver given \a target.
     First tries to parse \a target as a URI. If this succeeds, tries
@@ -52,23 +52,23 @@
     (typically the set of arguments passed in from the client API).
     \a pollset_set is used to drive IO in the name resolution process, it
     should not be NULL. */
-grpc_resolver *grpc_resolver_create(grpc_exec_ctx *exec_ctx, const char *target,
-                                    const grpc_channel_args *args,
-                                    grpc_pollset_set *pollset_set,
-                                    grpc_combiner *combiner);
+grpc_resolver* grpc_resolver_create(grpc_exec_ctx* exec_ctx, const char* target,
+                                    const grpc_channel_args* args,
+                                    grpc_pollset_set* pollset_set,
+                                    grpc_combiner* combiner);
 
 /** Find a resolver factory given a name and return an (owned-by-the-caller)
  *  reference to it */
-grpc_resolver_factory *grpc_resolver_factory_lookup(const char *name);
+grpc_resolver_factory* grpc_resolver_factory_lookup(const char* name);
 
 /** Given a target, return a (freshly allocated with gpr_malloc) string
     representing the default authority to pass from a client. */
-char *grpc_get_default_authority(grpc_exec_ctx *exec_ctx, const char *target);
+char* grpc_get_default_authority(grpc_exec_ctx* exec_ctx, const char* target);
 
 /** Returns a newly allocated string containing \a target, adding the
     default prefix if needed. */
-char *grpc_resolver_factory_add_default_prefix_if_needed(
-    grpc_exec_ctx *exec_ctx, const char *target);
+char* grpc_resolver_factory_add_default_prefix_if_needed(
+    grpc_exec_ctx* exec_ctx, const char* target);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/subchannel.cc b/src/core/ext/filters/client_channel/subchannel.cc
index 3d7b5dd..a50726a 100644
--- a/src/core/ext/filters/client_channel/subchannel.cc
+++ b/src/core/ext/filters/client_channel/subchannel.cc
@@ -52,27 +52,27 @@
 #define GRPC_SUBCHANNEL_RECONNECT_MAX_BACKOFF_SECONDS 120
 #define GRPC_SUBCHANNEL_RECONNECT_JITTER 0.2
 
-#define GET_CONNECTED_SUBCHANNEL(subchannel, barrier)      \
-  ((grpc_connected_subchannel *)(gpr_atm_##barrier##_load( \
+#define GET_CONNECTED_SUBCHANNEL(subchannel, barrier)     \
+  ((grpc_connected_subchannel*)(gpr_atm_##barrier##_load( \
       &(subchannel)->connected_subchannel)))
 
 typedef struct {
   grpc_closure closure;
-  grpc_subchannel *subchannel;
+  grpc_subchannel* subchannel;
   grpc_connectivity_state connectivity_state;
 } state_watcher;
 
 typedef struct external_state_watcher {
-  grpc_subchannel *subchannel;
-  grpc_pollset_set *pollset_set;
-  grpc_closure *notify;
+  grpc_subchannel* subchannel;
+  grpc_pollset_set* pollset_set;
+  grpc_closure* notify;
   grpc_closure closure;
-  struct external_state_watcher *next;
-  struct external_state_watcher *prev;
+  struct external_state_watcher* next;
+  struct external_state_watcher* prev;
 } external_state_watcher;
 
 struct grpc_subchannel {
-  grpc_connector *connector;
+  grpc_connector* connector;
 
   /** refcount
       - lower INTERNAL_REF_BITS bits are for internal references:
@@ -82,12 +82,12 @@
   gpr_atm ref_pair;
 
   /** non-transport related channel filters */
-  const grpc_channel_filter **filters;
+  const grpc_channel_filter** filters;
   size_t num_filters;
   /** channel arguments */
-  grpc_channel_args *args;
+  grpc_channel_args* args;
 
-  grpc_subchannel_key *key;
+  grpc_subchannel_key* key;
 
   /** set during connection */
   grpc_connect_out_args connecting_result;
@@ -100,7 +100,7 @@
 
   /** pollset_set tracking who's interested in a connection
       being setup */
-  grpc_pollset_set *pollset_set;
+  grpc_pollset_set* pollset_set;
 
   /** active connection, or null; of type grpc_connected_subchannel */
   gpr_atm connected_subchannel;
@@ -117,10 +117,10 @@
 
   external_state_watcher root_external_state_watcher;
 
-  /** next connect attempt time */
-  grpc_millis next_attempt;
   /** backoff state */
   grpc_backoff backoff_state;
+  grpc_backoff_result backoff_result;
+
   /** do we have an active alarm? */
   bool have_alarm;
   /** have we started the backoff loop */
@@ -130,22 +130,22 @@
 };
 
 struct grpc_subchannel_call {
-  grpc_connected_subchannel *connection;
-  grpc_closure *schedule_closure_after_destroy;
+  grpc_connected_subchannel* connection;
+  grpc_closure* schedule_closure_after_destroy;
 };
 
-#define SUBCHANNEL_CALL_TO_CALL_STACK(call) ((grpc_call_stack *)((call) + 1))
-#define CHANNEL_STACK_FROM_CONNECTION(con) ((grpc_channel_stack *)(con))
+#define SUBCHANNEL_CALL_TO_CALL_STACK(call) ((grpc_call_stack*)((call) + 1))
+#define CHANNEL_STACK_FROM_CONNECTION(con) ((grpc_channel_stack*)(con))
 #define CALLSTACK_TO_SUBCHANNEL_CALL(callstack) \
-  (((grpc_subchannel_call *)(callstack)) - 1)
+  (((grpc_subchannel_call*)(callstack)) - 1)
 
-static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *subchannel,
-                                 grpc_error *error);
+static void subchannel_connected(grpc_exec_ctx* exec_ctx, void* subchannel,
+                                 grpc_error* error);
 
 #ifndef NDEBUG
 #define REF_REASON reason
 #define REF_MUTATE_EXTRA_ARGS \
-  GRPC_SUBCHANNEL_REF_EXTRA_ARGS, const char *purpose
+  GRPC_SUBCHANNEL_REF_EXTRA_ARGS, const char* purpose
 #define REF_MUTATE_PURPOSE(x) , file, line, reason, x
 #else
 #define REF_REASON ""
@@ -157,21 +157,21 @@
  * connection implementation
  */
 
-static void connection_destroy(grpc_exec_ctx *exec_ctx, void *arg,
-                               grpc_error *error) {
-  grpc_connected_subchannel *c = (grpc_connected_subchannel *)arg;
+static void connection_destroy(grpc_exec_ctx* exec_ctx, void* arg,
+                               grpc_error* error) {
+  grpc_connected_subchannel* c = (grpc_connected_subchannel*)arg;
   grpc_channel_stack_destroy(exec_ctx, CHANNEL_STACK_FROM_CONNECTION(c));
   gpr_free(c);
 }
 
-grpc_connected_subchannel *grpc_connected_subchannel_ref(
-    grpc_connected_subchannel *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
+grpc_connected_subchannel* grpc_connected_subchannel_ref(
+    grpc_connected_subchannel* c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
   GRPC_CHANNEL_STACK_REF(CHANNEL_STACK_FROM_CONNECTION(c), REF_REASON);
   return c;
 }
 
-void grpc_connected_subchannel_unref(grpc_exec_ctx *exec_ctx,
-                                     grpc_connected_subchannel *c
+void grpc_connected_subchannel_unref(grpc_exec_ctx* exec_ctx,
+                                     grpc_connected_subchannel* c
                                          GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
   GRPC_CHANNEL_STACK_UNREF(exec_ctx, CHANNEL_STACK_FROM_CONNECTION(c),
                            REF_REASON);
@@ -181,10 +181,10 @@
  * grpc_subchannel implementation
  */
 
-static void subchannel_destroy(grpc_exec_ctx *exec_ctx, void *arg,
-                               grpc_error *error) {
-  grpc_subchannel *c = (grpc_subchannel *)arg;
-  gpr_free((void *)c->filters);
+static void subchannel_destroy(grpc_exec_ctx* exec_ctx, void* arg,
+                               grpc_error* error) {
+  grpc_subchannel* c = (grpc_subchannel*)arg;
+  gpr_free((void*)c->filters);
   grpc_channel_args_destroy(exec_ctx, c->args);
   grpc_connectivity_state_destroy(exec_ctx, &c->state_tracker);
   grpc_connector_unref(exec_ctx, c->connector);
@@ -194,7 +194,7 @@
   gpr_free(c);
 }
 
-static gpr_atm ref_mutate(grpc_subchannel *c, gpr_atm delta,
+static gpr_atm ref_mutate(grpc_subchannel* c, gpr_atm delta,
                           int barrier REF_MUTATE_EXTRA_ARGS) {
   gpr_atm old_val = barrier ? gpr_atm_full_fetch_add(&c->ref_pair, delta)
                             : gpr_atm_no_barrier_fetch_add(&c->ref_pair, delta);
@@ -208,8 +208,8 @@
   return old_val;
 }
 
-grpc_subchannel *grpc_subchannel_ref(
-    grpc_subchannel *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
+grpc_subchannel* grpc_subchannel_ref(
+    grpc_subchannel* c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
   gpr_atm old_refs;
   old_refs = ref_mutate(c, (1 << INTERNAL_REF_BITS),
                         0 REF_MUTATE_PURPOSE("STRONG_REF"));
@@ -217,16 +217,16 @@
   return c;
 }
 
-grpc_subchannel *grpc_subchannel_weak_ref(
-    grpc_subchannel *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
+grpc_subchannel* grpc_subchannel_weak_ref(
+    grpc_subchannel* c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
   gpr_atm old_refs;
   old_refs = ref_mutate(c, 1, 0 REF_MUTATE_PURPOSE("WEAK_REF"));
   GPR_ASSERT(old_refs != 0);
   return c;
 }
 
-grpc_subchannel *grpc_subchannel_ref_from_weak_ref(
-    grpc_subchannel *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
+grpc_subchannel* grpc_subchannel_ref_from_weak_ref(
+    grpc_subchannel* c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
   if (!c) return NULL;
   for (;;) {
     gpr_atm old_refs = gpr_atm_acq_load(&c->ref_pair);
@@ -241,8 +241,8 @@
   }
 }
 
-static void disconnect(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
-  grpc_connected_subchannel *con;
+static void disconnect(grpc_exec_ctx* exec_ctx, grpc_subchannel* c) {
+  grpc_connected_subchannel* con;
   grpc_subchannel_index_unregister(exec_ctx, c->key, c);
   gpr_mu_lock(&c->mu);
   GPR_ASSERT(!c->disconnected);
@@ -258,8 +258,8 @@
   gpr_mu_unlock(&c->mu);
 }
 
-void grpc_subchannel_unref(grpc_exec_ctx *exec_ctx,
-                           grpc_subchannel *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
+void grpc_subchannel_unref(grpc_exec_ctx* exec_ctx,
+                           grpc_subchannel* c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
   gpr_atm old_refs;
   // add a weak ref and subtract a strong ref (atomically)
   old_refs = ref_mutate(c, (gpr_atm)1 - (gpr_atm)(1 << INTERNAL_REF_BITS),
@@ -270,56 +270,57 @@
   GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, c, "strong-unref");
 }
 
-void grpc_subchannel_weak_unref(grpc_exec_ctx *exec_ctx,
-                                grpc_subchannel *c
+void grpc_subchannel_weak_unref(grpc_exec_ctx* exec_ctx,
+                                grpc_subchannel* c
                                     GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
   gpr_atm old_refs;
   old_refs = ref_mutate(c, -(gpr_atm)1, 1 REF_MUTATE_PURPOSE("WEAK_UNREF"));
   if (old_refs == 1) {
-    GRPC_CLOSURE_SCHED(exec_ctx, GRPC_CLOSURE_CREATE(subchannel_destroy, c,
-                                                     grpc_schedule_on_exec_ctx),
-                       GRPC_ERROR_NONE);
+    GRPC_CLOSURE_SCHED(
+        exec_ctx,
+        GRPC_CLOSURE_CREATE(subchannel_destroy, c, grpc_schedule_on_exec_ctx),
+        GRPC_ERROR_NONE);
   }
 }
 
-grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
-                                        grpc_connector *connector,
-                                        const grpc_subchannel_args *args) {
-  grpc_subchannel_key *key = grpc_subchannel_key_create(args);
-  grpc_subchannel *c = grpc_subchannel_index_find(exec_ctx, key);
+grpc_subchannel* grpc_subchannel_create(grpc_exec_ctx* exec_ctx,
+                                        grpc_connector* connector,
+                                        const grpc_subchannel_args* args) {
+  grpc_subchannel_key* key = grpc_subchannel_key_create(args);
+  grpc_subchannel* c = grpc_subchannel_index_find(exec_ctx, key);
   if (c) {
     grpc_subchannel_key_destroy(exec_ctx, key);
     return c;
   }
 
   GRPC_STATS_INC_CLIENT_SUBCHANNELS_CREATED(exec_ctx);
-  c = (grpc_subchannel *)gpr_zalloc(sizeof(*c));
+  c = (grpc_subchannel*)gpr_zalloc(sizeof(*c));
   c->key = key;
   gpr_atm_no_barrier_store(&c->ref_pair, 1 << INTERNAL_REF_BITS);
   c->connector = connector;
   grpc_connector_ref(c->connector);
   c->num_filters = args->filter_count;
   if (c->num_filters > 0) {
-    c->filters = (const grpc_channel_filter **)gpr_malloc(
-        sizeof(grpc_channel_filter *) * c->num_filters);
-    memcpy((void *)c->filters, args->filters,
-           sizeof(grpc_channel_filter *) * c->num_filters);
+    c->filters = (const grpc_channel_filter**)gpr_malloc(
+        sizeof(grpc_channel_filter*) * c->num_filters);
+    memcpy((void*)c->filters, args->filters,
+           sizeof(grpc_channel_filter*) * c->num_filters);
   } else {
     c->filters = NULL;
   }
   c->pollset_set = grpc_pollset_set_create();
-  grpc_resolved_address *addr =
-      (grpc_resolved_address *)gpr_malloc(sizeof(*addr));
+  grpc_resolved_address* addr =
+      (grpc_resolved_address*)gpr_malloc(sizeof(*addr));
   grpc_get_subchannel_address_arg(exec_ctx, args->args, addr);
-  grpc_resolved_address *new_address = NULL;
-  grpc_channel_args *new_args = NULL;
+  grpc_resolved_address* new_address = NULL;
+  grpc_channel_args* new_args = NULL;
   if (grpc_proxy_mappers_map_address(exec_ctx, addr, args->args, &new_address,
                                      &new_args)) {
     GPR_ASSERT(new_address != NULL);
     gpr_free(addr);
     addr = new_address;
   }
-  static const char *keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS};
+  static const char* keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS};
   grpc_arg new_arg = grpc_create_subchannel_address_arg(addr);
   gpr_free(addr);
   c->args = grpc_channel_args_copy_and_add_and_remove(
@@ -375,12 +376,12 @@
   return grpc_subchannel_index_register(exec_ctx, key, c);
 }
 
-static void continue_connect_locked(grpc_exec_ctx *exec_ctx,
-                                    grpc_subchannel *c) {
+static void continue_connect_locked(grpc_exec_ctx* exec_ctx,
+                                    grpc_subchannel* c) {
   grpc_connect_in_args args;
 
   args.interested_parties = c->pollset_set;
-  args.deadline = c->next_attempt;
+  args.deadline = c->backoff_result.current_deadline;
   args.channel_args = c->args;
 
   grpc_connectivity_state_set(exec_ctx, &c->state_tracker,
@@ -390,8 +391,8 @@
                          &c->connected);
 }
 
-grpc_connectivity_state grpc_subchannel_check_connectivity(grpc_subchannel *c,
-                                                           grpc_error **error) {
+grpc_connectivity_state grpc_subchannel_check_connectivity(grpc_subchannel* c,
+                                                           grpc_error** error) {
   grpc_connectivity_state state;
   gpr_mu_lock(&c->mu);
   state = grpc_connectivity_state_get(&c->state_tracker, error);
@@ -399,10 +400,10 @@
   return state;
 }
 
-static void on_external_state_watcher_done(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error) {
-  external_state_watcher *w = (external_state_watcher *)arg;
-  grpc_closure *follow_up = w->notify;
+static void on_external_state_watcher_done(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error) {
+  external_state_watcher* w = (external_state_watcher*)arg;
+  grpc_closure* follow_up = w->notify;
   if (w->pollset_set != NULL) {
     grpc_pollset_set_del_pollset_set(exec_ctx, w->subchannel->pollset_set,
                                      w->pollset_set);
@@ -416,8 +417,8 @@
   GRPC_CLOSURE_RUN(exec_ctx, follow_up, GRPC_ERROR_REF(error));
 }
 
-static void on_alarm(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_subchannel *c = (grpc_subchannel *)arg;
+static void on_alarm(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_subchannel* c = (grpc_subchannel*)arg;
   gpr_mu_lock(&c->mu);
   c->have_alarm = false;
   if (c->disconnected) {
@@ -428,7 +429,7 @@
   }
   if (error == GRPC_ERROR_NONE) {
     gpr_log(GPR_INFO, "Failed to connect to channel, retrying");
-    c->next_attempt = grpc_backoff_step(exec_ctx, &c->backoff_state);
+    c->backoff_result = grpc_backoff_step(exec_ctx, &c->backoff_state);
     continue_connect_locked(exec_ctx, c);
     gpr_mu_unlock(&c->mu);
   } else {
@@ -438,8 +439,8 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void maybe_start_connecting_locked(grpc_exec_ctx *exec_ctx,
-                                          grpc_subchannel *c) {
+static void maybe_start_connecting_locked(grpc_exec_ctx* exec_ctx,
+                                          grpc_subchannel* c) {
   if (c->disconnected) {
     /* Don't try to connect if we're already disconnected */
     return;
@@ -465,28 +466,29 @@
 
   if (!c->backoff_begun) {
     c->backoff_begun = true;
-    c->next_attempt = grpc_backoff_begin(exec_ctx, &c->backoff_state);
+    c->backoff_result = grpc_backoff_begin(exec_ctx, &c->backoff_state);
     continue_connect_locked(exec_ctx, c);
   } else {
     GPR_ASSERT(!c->have_alarm);
     c->have_alarm = true;
     const grpc_millis time_til_next =
-        c->next_attempt - grpc_exec_ctx_now(exec_ctx);
+        c->backoff_result.next_attempt_start_time - grpc_exec_ctx_now(exec_ctx);
     if (time_til_next <= 0) {
       gpr_log(GPR_INFO, "Retry immediately");
     } else {
       gpr_log(GPR_INFO, "Retry in %" PRIdPTR " milliseconds", time_til_next);
     }
     GRPC_CLOSURE_INIT(&c->on_alarm, on_alarm, c, grpc_schedule_on_exec_ctx);
-    grpc_timer_init(exec_ctx, &c->alarm, c->next_attempt, &c->on_alarm);
+    grpc_timer_init(exec_ctx, &c->alarm,
+                    c->backoff_result.next_attempt_start_time, &c->on_alarm);
   }
 }
 
 void grpc_subchannel_notify_on_state_change(
-    grpc_exec_ctx *exec_ctx, grpc_subchannel *c,
-    grpc_pollset_set *interested_parties, grpc_connectivity_state *state,
-    grpc_closure *notify) {
-  external_state_watcher *w;
+    grpc_exec_ctx* exec_ctx, grpc_subchannel* c,
+    grpc_pollset_set* interested_parties, grpc_connectivity_state* state,
+    grpc_closure* notify) {
+  external_state_watcher* w;
 
   if (state == NULL) {
     gpr_mu_lock(&c->mu);
@@ -499,7 +501,7 @@
     }
     gpr_mu_unlock(&c->mu);
   } else {
-    w = (external_state_watcher *)gpr_malloc(sizeof(*w));
+    w = (external_state_watcher*)gpr_malloc(sizeof(*w));
     w->subchannel = c;
     w->pollset_set = interested_parties;
     w->notify = notify;
@@ -522,18 +524,18 @@
 }
 
 void grpc_connected_subchannel_process_transport_op(
-    grpc_exec_ctx *exec_ctx, grpc_connected_subchannel *con,
-    grpc_transport_op *op) {
-  grpc_channel_stack *channel_stack = CHANNEL_STACK_FROM_CONNECTION(con);
-  grpc_channel_element *top_elem = grpc_channel_stack_element(channel_stack, 0);
+    grpc_exec_ctx* exec_ctx, grpc_connected_subchannel* con,
+    grpc_transport_op* op) {
+  grpc_channel_stack* channel_stack = CHANNEL_STACK_FROM_CONNECTION(con);
+  grpc_channel_element* top_elem = grpc_channel_stack_element(channel_stack, 0);
   top_elem->filter->start_transport_op(exec_ctx, top_elem, op);
 }
 
-static void subchannel_on_child_state_changed(grpc_exec_ctx *exec_ctx, void *p,
-                                              grpc_error *error) {
-  state_watcher *sw = (state_watcher *)p;
-  grpc_subchannel *c = sw->subchannel;
-  gpr_mu *mu = &c->mu;
+static void subchannel_on_child_state_changed(grpc_exec_ctx* exec_ctx, void* p,
+                                              grpc_error* error) {
+  state_watcher* sw = (state_watcher*)p;
+  grpc_subchannel* c = sw->subchannel;
+  gpr_mu* mu = &c->mu;
 
   gpr_mu_lock(mu);
 
@@ -558,13 +560,13 @@
   gpr_free(sw);
 }
 
-static void connected_subchannel_state_op(grpc_exec_ctx *exec_ctx,
-                                          grpc_connected_subchannel *con,
-                                          grpc_pollset_set *interested_parties,
-                                          grpc_connectivity_state *state,
-                                          grpc_closure *closure) {
-  grpc_transport_op *op = grpc_make_transport_op(NULL);
-  grpc_channel_element *elem;
+static void connected_subchannel_state_op(grpc_exec_ctx* exec_ctx,
+                                          grpc_connected_subchannel* con,
+                                          grpc_pollset_set* interested_parties,
+                                          grpc_connectivity_state* state,
+                                          grpc_closure* closure) {
+  grpc_transport_op* op = grpc_make_transport_op(NULL);
+  grpc_channel_element* elem;
   op->connectivity_state = state;
   op->on_connectivity_state_change = closure;
   op->bind_pollset_set = interested_parties;
@@ -573,31 +575,31 @@
 }
 
 void grpc_connected_subchannel_notify_on_state_change(
-    grpc_exec_ctx *exec_ctx, grpc_connected_subchannel *con,
-    grpc_pollset_set *interested_parties, grpc_connectivity_state *state,
-    grpc_closure *closure) {
+    grpc_exec_ctx* exec_ctx, grpc_connected_subchannel* con,
+    grpc_pollset_set* interested_parties, grpc_connectivity_state* state,
+    grpc_closure* closure) {
   connected_subchannel_state_op(exec_ctx, con, interested_parties, state,
                                 closure);
 }
 
-void grpc_connected_subchannel_ping(grpc_exec_ctx *exec_ctx,
-                                    grpc_connected_subchannel *con,
-                                    grpc_closure *closure) {
-  grpc_transport_op *op = grpc_make_transport_op(NULL);
-  grpc_channel_element *elem;
+void grpc_connected_subchannel_ping(grpc_exec_ctx* exec_ctx,
+                                    grpc_connected_subchannel* con,
+                                    grpc_closure* closure) {
+  grpc_transport_op* op = grpc_make_transport_op(NULL);
+  grpc_channel_element* elem;
   op->send_ping = closure;
   elem = grpc_channel_stack_element(CHANNEL_STACK_FROM_CONNECTION(con), 0);
   elem->filter->start_transport_op(exec_ctx, elem, op);
 }
 
-static bool publish_transport_locked(grpc_exec_ctx *exec_ctx,
-                                     grpc_subchannel *c) {
-  grpc_connected_subchannel *con;
-  grpc_channel_stack *stk;
-  state_watcher *sw_subchannel;
+static bool publish_transport_locked(grpc_exec_ctx* exec_ctx,
+                                     grpc_subchannel* c) {
+  grpc_connected_subchannel* con;
+  grpc_channel_stack* stk;
+  state_watcher* sw_subchannel;
 
   /* construct channel stack */
-  grpc_channel_stack_builder *builder = grpc_channel_stack_builder_create();
+  grpc_channel_stack_builder* builder = grpc_channel_stack_builder_create();
   grpc_channel_stack_builder_set_channel_arguments(
       exec_ctx, builder, c->connecting_result.channel_args);
   grpc_channel_stack_builder_set_transport(builder,
@@ -608,8 +610,8 @@
     grpc_channel_stack_builder_destroy(exec_ctx, builder);
     return false;
   }
-  grpc_error *error = grpc_channel_stack_builder_finish(
-      exec_ctx, builder, 0, 1, connection_destroy, NULL, (void **)&con);
+  grpc_error* error = grpc_channel_stack_builder_finish(
+      exec_ctx, builder, 0, 1, connection_destroy, NULL, (void**)&con);
   if (error != GRPC_ERROR_NONE) {
     grpc_transport_destroy(exec_ctx, c->connecting_result.transport);
     gpr_log(GPR_ERROR, "error initializing subchannel stack: %s",
@@ -621,7 +623,7 @@
   memset(&c->connecting_result, 0, sizeof(c->connecting_result));
 
   /* initialize state watcher */
-  sw_subchannel = (state_watcher *)gpr_malloc(sizeof(*sw_subchannel));
+  sw_subchannel = (state_watcher*)gpr_malloc(sizeof(*sw_subchannel));
   sw_subchannel->subchannel = c;
   sw_subchannel->connectivity_state = GRPC_CHANNEL_READY;
   GRPC_CLOSURE_INIT(&sw_subchannel->closure, subchannel_on_child_state_changed,
@@ -656,10 +658,10 @@
   return true;
 }
 
-static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg,
-                                 grpc_error *error) {
-  grpc_subchannel *c = (grpc_subchannel *)arg;
-  grpc_channel_args *delete_channel_args = c->connecting_result.channel_args;
+static void subchannel_connected(grpc_exec_ctx* exec_ctx, void* arg,
+                                 grpc_error* error) {
+  grpc_subchannel* c = (grpc_subchannel*)arg;
+  grpc_channel_args* delete_channel_args = c->connecting_result.channel_args;
 
   GRPC_SUBCHANNEL_WEAK_REF(c, "connected");
   gpr_mu_lock(&c->mu);
@@ -677,7 +679,7 @@
                            GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE),
         "connect_failed");
 
-    const char *errmsg = grpc_error_string(error);
+    const char* errmsg = grpc_error_string(error);
     gpr_log(GPR_INFO, "Connect failed: %s", errmsg);
 
     maybe_start_connecting_locked(exec_ctx, c);
@@ -692,65 +694,65 @@
  * grpc_subchannel_call implementation
  */
 
-static void subchannel_call_destroy(grpc_exec_ctx *exec_ctx, void *call,
-                                    grpc_error *error) {
-  grpc_subchannel_call *c = (grpc_subchannel_call *)call;
+static void subchannel_call_destroy(grpc_exec_ctx* exec_ctx, void* call,
+                                    grpc_error* error) {
+  grpc_subchannel_call* c = (grpc_subchannel_call*)call;
   GPR_ASSERT(c->schedule_closure_after_destroy != NULL);
   GPR_TIMER_BEGIN("grpc_subchannel_call_unref.destroy", 0);
-  grpc_connected_subchannel *connection = c->connection;
+  grpc_connected_subchannel* connection = c->connection;
   grpc_call_stack_destroy(exec_ctx, SUBCHANNEL_CALL_TO_CALL_STACK(c), NULL,
                           c->schedule_closure_after_destroy);
   GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, connection, "subchannel_call");
   GPR_TIMER_END("grpc_subchannel_call_unref.destroy", 0);
 }
 
-void grpc_subchannel_call_set_cleanup_closure(grpc_subchannel_call *call,
-                                              grpc_closure *closure) {
+void grpc_subchannel_call_set_cleanup_closure(grpc_subchannel_call* call,
+                                              grpc_closure* closure) {
   GPR_ASSERT(call->schedule_closure_after_destroy == NULL);
   GPR_ASSERT(closure != NULL);
   call->schedule_closure_after_destroy = closure;
 }
 
 void grpc_subchannel_call_ref(
-    grpc_subchannel_call *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
+    grpc_subchannel_call* c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
   GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(c), REF_REASON);
 }
 
-void grpc_subchannel_call_unref(grpc_exec_ctx *exec_ctx,
-                                grpc_subchannel_call *c
+void grpc_subchannel_call_unref(grpc_exec_ctx* exec_ctx,
+                                grpc_subchannel_call* c
                                     GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
   GRPC_CALL_STACK_UNREF(exec_ctx, SUBCHANNEL_CALL_TO_CALL_STACK(c), REF_REASON);
 }
 
-void grpc_subchannel_call_process_op(grpc_exec_ctx *exec_ctx,
-                                     grpc_subchannel_call *call,
-                                     grpc_transport_stream_op_batch *batch) {
+void grpc_subchannel_call_process_op(grpc_exec_ctx* exec_ctx,
+                                     grpc_subchannel_call* call,
+                                     grpc_transport_stream_op_batch* batch) {
   GPR_TIMER_BEGIN("grpc_subchannel_call_process_op", 0);
-  grpc_call_stack *call_stack = SUBCHANNEL_CALL_TO_CALL_STACK(call);
-  grpc_call_element *top_elem = grpc_call_stack_element(call_stack, 0);
+  grpc_call_stack* call_stack = SUBCHANNEL_CALL_TO_CALL_STACK(call);
+  grpc_call_element* top_elem = grpc_call_stack_element(call_stack, 0);
   GRPC_CALL_LOG_OP(GPR_INFO, top_elem, batch);
   top_elem->filter->start_transport_stream_op_batch(exec_ctx, top_elem, batch);
   GPR_TIMER_END("grpc_subchannel_call_process_op", 0);
 }
 
-grpc_connected_subchannel *grpc_subchannel_get_connected_subchannel(
-    grpc_subchannel *c) {
+grpc_connected_subchannel* grpc_subchannel_get_connected_subchannel(
+    grpc_subchannel* c) {
   return GET_CONNECTED_SUBCHANNEL(c, acq);
 }
 
-const grpc_subchannel_key *grpc_subchannel_get_key(
-    const grpc_subchannel *subchannel) {
+const grpc_subchannel_key* grpc_subchannel_get_key(
+    const grpc_subchannel* subchannel) {
   return subchannel->key;
 }
 
-grpc_error *grpc_connected_subchannel_create_call(
-    grpc_exec_ctx *exec_ctx, grpc_connected_subchannel *con,
-    const grpc_connected_subchannel_call_args *args,
-    grpc_subchannel_call **call) {
-  grpc_channel_stack *chanstk = CHANNEL_STACK_FROM_CONNECTION(con);
-  *call = (grpc_subchannel_call *)gpr_arena_alloc(
+grpc_error* grpc_connected_subchannel_create_call(
+    grpc_exec_ctx* exec_ctx, grpc_connected_subchannel* con,
+    const grpc_connected_subchannel_call_args* args,
+    grpc_subchannel_call** call) {
+  grpc_channel_stack* chanstk = CHANNEL_STACK_FROM_CONNECTION(con);
+  *call = (grpc_subchannel_call*)gpr_arena_alloc(
       args->arena, sizeof(grpc_subchannel_call) + chanstk->call_stack_size);
-  grpc_call_stack *callstk = SUBCHANNEL_CALL_TO_CALL_STACK(*call);
+  grpc_call_stack* callstk = SUBCHANNEL_CALL_TO_CALL_STACK(*call);
   (*call)->connection = GRPC_CONNECTED_SUBCHANNEL_REF(con, "subchannel_call");
   const grpc_call_element_args call_args = {
       callstk,            /* call_stack */
@@ -762,10 +764,10 @@
       args->arena,        /* arena */
       args->call_combiner /* call_combiner */
   };
-  grpc_error *error = grpc_call_stack_init(
+  grpc_error* error = grpc_call_stack_init(
       exec_ctx, chanstk, 1, subchannel_call_destroy, *call, &call_args);
   if (error != GRPC_ERROR_NONE) {
-    const char *error_string = grpc_error_string(error);
+    const char* error_string = grpc_error_string(error);
     gpr_log(GPR_ERROR, "error: %s", error_string);
     return error;
   }
@@ -773,39 +775,39 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_call_stack *grpc_subchannel_call_get_call_stack(
-    grpc_subchannel_call *subchannel_call) {
+grpc_call_stack* grpc_subchannel_call_get_call_stack(
+    grpc_subchannel_call* subchannel_call) {
   return SUBCHANNEL_CALL_TO_CALL_STACK(subchannel_call);
 }
 
-static void grpc_uri_to_sockaddr(grpc_exec_ctx *exec_ctx, const char *uri_str,
-                                 grpc_resolved_address *addr) {
-  grpc_uri *uri = grpc_uri_parse(exec_ctx, uri_str, 0 /* suppress_errors */);
+static void grpc_uri_to_sockaddr(grpc_exec_ctx* exec_ctx, const char* uri_str,
+                                 grpc_resolved_address* addr) {
+  grpc_uri* uri = grpc_uri_parse(exec_ctx, uri_str, 0 /* suppress_errors */);
   GPR_ASSERT(uri != NULL);
   if (!grpc_parse_uri(uri, addr)) memset(addr, 0, sizeof(*addr));
   grpc_uri_destroy(uri);
 }
 
-void grpc_get_subchannel_address_arg(grpc_exec_ctx *exec_ctx,
-                                     const grpc_channel_args *args,
-                                     grpc_resolved_address *addr) {
-  const char *addr_uri_str = grpc_get_subchannel_address_uri_arg(args);
+void grpc_get_subchannel_address_arg(grpc_exec_ctx* exec_ctx,
+                                     const grpc_channel_args* args,
+                                     grpc_resolved_address* addr) {
+  const char* addr_uri_str = grpc_get_subchannel_address_uri_arg(args);
   memset(addr, 0, sizeof(*addr));
   if (*addr_uri_str != '\0') {
     grpc_uri_to_sockaddr(exec_ctx, addr_uri_str, addr);
   }
 }
 
-const char *grpc_get_subchannel_address_uri_arg(const grpc_channel_args *args) {
-  const grpc_arg *addr_arg =
+const char* grpc_get_subchannel_address_uri_arg(const grpc_channel_args* args) {
+  const grpc_arg* addr_arg =
       grpc_channel_args_find(args, GRPC_ARG_SUBCHANNEL_ADDRESS);
   GPR_ASSERT(addr_arg != NULL);  // Should have been set by LB policy.
   GPR_ASSERT(addr_arg->type == GRPC_ARG_STRING);
   return addr_arg->value.string;
 }
 
-grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address *addr) {
+grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address* addr) {
   return grpc_channel_arg_string_create(
-      (char *)GRPC_ARG_SUBCHANNEL_ADDRESS,
+      (char*)GRPC_ARG_SUBCHANNEL_ADDRESS,
       addr->len > 0 ? grpc_sockaddr_to_uri(addr) : gpr_strdup(""));
 }
diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h
index 46b29f1..970f182 100644
--- a/src/core/ext/filters/client_channel/subchannel.h
+++ b/src/core/ext/filters/client_channel/subchannel.h
@@ -79,118 +79,118 @@
 #define GRPC_SUBCHANNEL_REF_EXTRA_ARGS
 #endif
 
-grpc_subchannel *grpc_subchannel_ref(
-    grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
-grpc_subchannel *grpc_subchannel_ref_from_weak_ref(
-    grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
-void grpc_subchannel_unref(grpc_exec_ctx *exec_ctx,
-                           grpc_subchannel *channel
+grpc_subchannel* grpc_subchannel_ref(
+    grpc_subchannel* channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
+grpc_subchannel* grpc_subchannel_ref_from_weak_ref(
+    grpc_subchannel* channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
+void grpc_subchannel_unref(grpc_exec_ctx* exec_ctx,
+                           grpc_subchannel* channel
                                GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
-grpc_subchannel *grpc_subchannel_weak_ref(
-    grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
-void grpc_subchannel_weak_unref(grpc_exec_ctx *exec_ctx,
-                                grpc_subchannel *channel
+grpc_subchannel* grpc_subchannel_weak_ref(
+    grpc_subchannel* channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
+void grpc_subchannel_weak_unref(grpc_exec_ctx* exec_ctx,
+                                grpc_subchannel* channel
                                     GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
-grpc_connected_subchannel *grpc_connected_subchannel_ref(
-    grpc_connected_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
-void grpc_connected_subchannel_unref(grpc_exec_ctx *exec_ctx,
-                                     grpc_connected_subchannel *channel
+grpc_connected_subchannel* grpc_connected_subchannel_ref(
+    grpc_connected_subchannel* channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
+void grpc_connected_subchannel_unref(grpc_exec_ctx* exec_ctx,
+                                     grpc_connected_subchannel* channel
                                          GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
 void grpc_subchannel_call_ref(
-    grpc_subchannel_call *call GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
-void grpc_subchannel_call_unref(grpc_exec_ctx *exec_ctx,
-                                grpc_subchannel_call *call
+    grpc_subchannel_call* call GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
+void grpc_subchannel_call_unref(grpc_exec_ctx* exec_ctx,
+                                grpc_subchannel_call* call
                                     GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
 
 /** construct a subchannel call */
 typedef struct {
-  grpc_polling_entity *pollent;
+  grpc_polling_entity* pollent;
   grpc_slice path;
   gpr_timespec start_time;
   grpc_millis deadline;
-  gpr_arena *arena;
-  grpc_call_context_element *context;
-  grpc_call_combiner *call_combiner;
+  gpr_arena* arena;
+  grpc_call_context_element* context;
+  grpc_call_combiner* call_combiner;
 } grpc_connected_subchannel_call_args;
 
-grpc_error *grpc_connected_subchannel_create_call(
-    grpc_exec_ctx *exec_ctx, grpc_connected_subchannel *connected_subchannel,
-    const grpc_connected_subchannel_call_args *args,
-    grpc_subchannel_call **subchannel_call);
+grpc_error* grpc_connected_subchannel_create_call(
+    grpc_exec_ctx* exec_ctx, grpc_connected_subchannel* connected_subchannel,
+    const grpc_connected_subchannel_call_args* args,
+    grpc_subchannel_call** subchannel_call);
 
 /** process a transport level op */
 void grpc_connected_subchannel_process_transport_op(
-    grpc_exec_ctx *exec_ctx, grpc_connected_subchannel *subchannel,
-    grpc_transport_op *op);
+    grpc_exec_ctx* exec_ctx, grpc_connected_subchannel* subchannel,
+    grpc_transport_op* op);
 
 /** poll the current connectivity state of a channel */
 grpc_connectivity_state grpc_subchannel_check_connectivity(
-    grpc_subchannel *channel, grpc_error **error);
+    grpc_subchannel* channel, grpc_error** error);
 
-/** call notify when the connectivity state of a channel changes from *state.
-    Updates *state with the new state of the channel */
+/** Calls notify when the connectivity state of a channel becomes different
+    from *state.  Updates *state with the new state of the channel. */
 void grpc_subchannel_notify_on_state_change(
-    grpc_exec_ctx *exec_ctx, grpc_subchannel *channel,
-    grpc_pollset_set *interested_parties, grpc_connectivity_state *state,
-    grpc_closure *notify);
+    grpc_exec_ctx* exec_ctx, grpc_subchannel* channel,
+    grpc_pollset_set* interested_parties, grpc_connectivity_state* state,
+    grpc_closure* notify);
 void grpc_connected_subchannel_notify_on_state_change(
-    grpc_exec_ctx *exec_ctx, grpc_connected_subchannel *channel,
-    grpc_pollset_set *interested_parties, grpc_connectivity_state *state,
-    grpc_closure *notify);
-void grpc_connected_subchannel_ping(grpc_exec_ctx *exec_ctx,
-                                    grpc_connected_subchannel *channel,
-                                    grpc_closure *notify);
+    grpc_exec_ctx* exec_ctx, grpc_connected_subchannel* channel,
+    grpc_pollset_set* interested_parties, grpc_connectivity_state* state,
+    grpc_closure* notify);
+void grpc_connected_subchannel_ping(grpc_exec_ctx* exec_ctx,
+                                    grpc_connected_subchannel* channel,
+                                    grpc_closure* notify);
 
 /** retrieve the grpc_connected_subchannel - or NULL if called before
     the subchannel becomes connected */
-grpc_connected_subchannel *grpc_subchannel_get_connected_subchannel(
-    grpc_subchannel *subchannel);
+grpc_connected_subchannel* grpc_subchannel_get_connected_subchannel(
+    grpc_subchannel* subchannel);
 
 /** return the subchannel index key for \a subchannel */
-const grpc_subchannel_key *grpc_subchannel_get_key(
-    const grpc_subchannel *subchannel);
+const grpc_subchannel_key* grpc_subchannel_get_key(
+    const grpc_subchannel* subchannel);
 
 /** continue processing a transport op */
-void grpc_subchannel_call_process_op(grpc_exec_ctx *exec_ctx,
-                                     grpc_subchannel_call *subchannel_call,
-                                     grpc_transport_stream_op_batch *op);
+void grpc_subchannel_call_process_op(grpc_exec_ctx* exec_ctx,
+                                     grpc_subchannel_call* subchannel_call,
+                                     grpc_transport_stream_op_batch* op);
 
 /** Must be called once per call. Sets the 'then_schedule_closure' argument for
     call stack destruction. */
 void grpc_subchannel_call_set_cleanup_closure(
-    grpc_subchannel_call *subchannel_call, grpc_closure *closure);
+    grpc_subchannel_call* subchannel_call, grpc_closure* closure);
 
-grpc_call_stack *grpc_subchannel_call_get_call_stack(
-    grpc_subchannel_call *subchannel_call);
+grpc_call_stack* grpc_subchannel_call_get_call_stack(
+    grpc_subchannel_call* subchannel_call);
 
 struct grpc_subchannel_args {
   /* When updating this struct, also update subchannel_index.c */
 
   /** Channel filters for this channel - wrapped factories will likely
       want to mutate this */
-  const grpc_channel_filter **filters;
+  const grpc_channel_filter** filters;
   /** The number of filters in the above array */
   size_t filter_count;
   /** Channel arguments to be supplied to the newly created channel */
-  const grpc_channel_args *args;
+  const grpc_channel_args* args;
 };
 
 /** create a subchannel given a connector */
-grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
-                                        grpc_connector *connector,
-                                        const grpc_subchannel_args *args);
+grpc_subchannel* grpc_subchannel_create(grpc_exec_ctx* exec_ctx,
+                                        grpc_connector* connector,
+                                        const grpc_subchannel_args* args);
 
 /// Sets \a addr from \a args.
-void grpc_get_subchannel_address_arg(grpc_exec_ctx *exec_ctx,
-                                     const grpc_channel_args *args,
-                                     grpc_resolved_address *addr);
+void grpc_get_subchannel_address_arg(grpc_exec_ctx* exec_ctx,
+                                     const grpc_channel_args* args,
+                                     grpc_resolved_address* addr);
 
 /// Returns the URI string for the address to connect to.
-const char *grpc_get_subchannel_address_uri_arg(const grpc_channel_args *args);
+const char* grpc_get_subchannel_address_uri_arg(const grpc_channel_args* args);
 
 /// Returns a new channel arg encoding the subchannel address as a string.
 /// Caller is responsible for freeing the string.
-grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address *addr);
+grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address* addr);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/client_channel/subchannel_index.cc b/src/core/ext/filters/client_channel/subchannel_index.cc
index 1f466ec..0c4213c 100644
--- a/src/core/ext/filters/client_channel/subchannel_index.cc
+++ b/src/core/ext/filters/client_channel/subchannel_index.cc
@@ -42,15 +42,15 @@
 
 static bool g_force_creation = false;
 
-static grpc_subchannel_key *create_key(
-    const grpc_subchannel_args *args,
-    grpc_channel_args *(*copy_channel_args)(const grpc_channel_args *args)) {
-  grpc_subchannel_key *k = (grpc_subchannel_key *)gpr_malloc(sizeof(*k));
+static grpc_subchannel_key* create_key(
+    const grpc_subchannel_args* args,
+    grpc_channel_args* (*copy_channel_args)(const grpc_channel_args* args)) {
+  grpc_subchannel_key* k = (grpc_subchannel_key*)gpr_malloc(sizeof(*k));
   k->args.filter_count = args->filter_count;
   if (k->args.filter_count > 0) {
-    k->args.filters = (const grpc_channel_filter **)gpr_malloc(
+    k->args.filters = (const grpc_channel_filter**)gpr_malloc(
         sizeof(*k->args.filters) * k->args.filter_count);
-    memcpy((grpc_channel_filter *)k->args.filters, args->filters,
+    memcpy((grpc_channel_filter*)k->args.filters, args->filters,
            sizeof(*k->args.filters) * k->args.filter_count);
   } else {
     k->args.filters = NULL;
@@ -59,17 +59,17 @@
   return k;
 }
 
-grpc_subchannel_key *grpc_subchannel_key_create(
-    const grpc_subchannel_args *args) {
+grpc_subchannel_key* grpc_subchannel_key_create(
+    const grpc_subchannel_args* args) {
   return create_key(args, grpc_channel_args_normalize);
 }
 
-static grpc_subchannel_key *subchannel_key_copy(grpc_subchannel_key *k) {
+static grpc_subchannel_key* subchannel_key_copy(grpc_subchannel_key* k) {
   return create_key(&k->args, grpc_channel_args_copy);
 }
 
-int grpc_subchannel_key_compare(const grpc_subchannel_key *a,
-                                const grpc_subchannel_key *b) {
+int grpc_subchannel_key_compare(const grpc_subchannel_key* a,
+                                const grpc_subchannel_key* b) {
   if (g_force_creation) return false;
   int c = GPR_ICMP(a->args.filter_count, b->args.filter_count);
   if (c != 0) return c;
@@ -81,35 +81,34 @@
   return grpc_channel_args_compare(a->args.args, b->args.args);
 }
 
-void grpc_subchannel_key_destroy(grpc_exec_ctx *exec_ctx,
-                                 grpc_subchannel_key *k) {
-  gpr_free((grpc_channel_args *)k->args.filters);
-  grpc_channel_args_destroy(exec_ctx, (grpc_channel_args *)k->args.args);
+void grpc_subchannel_key_destroy(grpc_exec_ctx* exec_ctx,
+                                 grpc_subchannel_key* k) {
+  gpr_free((grpc_channel_args*)k->args.filters);
+  grpc_channel_args_destroy(exec_ctx, (grpc_channel_args*)k->args.args);
   gpr_free(k);
 }
 
-static void sck_avl_destroy(void *p, void *user_data) {
-  grpc_exec_ctx *exec_ctx = (grpc_exec_ctx *)user_data;
-  grpc_subchannel_key_destroy(exec_ctx, (grpc_subchannel_key *)p);
+static void sck_avl_destroy(void* p, void* user_data) {
+  grpc_exec_ctx* exec_ctx = (grpc_exec_ctx*)user_data;
+  grpc_subchannel_key_destroy(exec_ctx, (grpc_subchannel_key*)p);
 }
 
-static void *sck_avl_copy(void *p, void *unused) {
-  return subchannel_key_copy((grpc_subchannel_key *)p);
+static void* sck_avl_copy(void* p, void* unused) {
+  return subchannel_key_copy((grpc_subchannel_key*)p);
 }
 
-static long sck_avl_compare(void *a, void *b, void *unused) {
-  return grpc_subchannel_key_compare((grpc_subchannel_key *)a,
-                                     (grpc_subchannel_key *)b);
+static long sck_avl_compare(void* a, void* b, void* unused) {
+  return grpc_subchannel_key_compare((grpc_subchannel_key*)a,
+                                     (grpc_subchannel_key*)b);
 }
 
-static void scv_avl_destroy(void *p, void *user_data) {
-  grpc_exec_ctx *exec_ctx = (grpc_exec_ctx *)user_data;
-  GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, (grpc_subchannel *)p,
-                             "subchannel_index");
+static void scv_avl_destroy(void* p, void* user_data) {
+  grpc_exec_ctx* exec_ctx = (grpc_exec_ctx*)user_data;
+  GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, (grpc_subchannel*)p, "subchannel_index");
 }
 
-static void *scv_avl_copy(void *p, void *unused) {
-  GRPC_SUBCHANNEL_WEAK_REF((grpc_subchannel *)p, "subchannel_index");
+static void* scv_avl_copy(void* p, void* unused) {
+  GRPC_SUBCHANNEL_WEAK_REF((grpc_subchannel*)p, "subchannel_index");
   return p;
 }
 
@@ -145,25 +144,25 @@
 
 void grpc_subchannel_index_ref(void) { gpr_ref_non_zero(&g_refcount); }
 
-grpc_subchannel *grpc_subchannel_index_find(grpc_exec_ctx *exec_ctx,
-                                            grpc_subchannel_key *key) {
+grpc_subchannel* grpc_subchannel_index_find(grpc_exec_ctx* exec_ctx,
+                                            grpc_subchannel_key* key) {
   // Lock, and take a reference to the subchannel index.
   // We don't need to do the search under a lock as avl's are immutable.
   gpr_mu_lock(&g_mu);
   gpr_avl index = gpr_avl_ref(g_subchannel_index, exec_ctx);
   gpr_mu_unlock(&g_mu);
 
-  grpc_subchannel *c = GRPC_SUBCHANNEL_REF_FROM_WEAK_REF(
-      (grpc_subchannel *)gpr_avl_get(index, key, exec_ctx), "index_find");
+  grpc_subchannel* c = GRPC_SUBCHANNEL_REF_FROM_WEAK_REF(
+      (grpc_subchannel*)gpr_avl_get(index, key, exec_ctx), "index_find");
   gpr_avl_unref(index, exec_ctx);
 
   return c;
 }
 
-grpc_subchannel *grpc_subchannel_index_register(grpc_exec_ctx *exec_ctx,
-                                                grpc_subchannel_key *key,
-                                                grpc_subchannel *constructed) {
-  grpc_subchannel *c = NULL;
+grpc_subchannel* grpc_subchannel_index_register(grpc_exec_ctx* exec_ctx,
+                                                grpc_subchannel_key* key,
+                                                grpc_subchannel* constructed) {
+  grpc_subchannel* c = NULL;
   bool need_to_unref_constructed;
 
   while (c == NULL) {
@@ -176,7 +175,7 @@
     gpr_mu_unlock(&g_mu);
 
     // - Check to see if a subchannel already exists
-    c = (grpc_subchannel *)gpr_avl_get(index, key, exec_ctx);
+    c = (grpc_subchannel*)gpr_avl_get(index, key, exec_ctx);
     if (c != NULL) {
       c = GRPC_SUBCHANNEL_REF_FROM_WEAK_REF(c, "index_register");
     }
@@ -211,9 +210,9 @@
   return c;
 }
 
-void grpc_subchannel_index_unregister(grpc_exec_ctx *exec_ctx,
-                                      grpc_subchannel_key *key,
-                                      grpc_subchannel *constructed) {
+void grpc_subchannel_index_unregister(grpc_exec_ctx* exec_ctx,
+                                      grpc_subchannel_key* key,
+                                      grpc_subchannel* constructed) {
   bool done = false;
   while (!done) {
     // Compare and swap loop:
@@ -224,7 +223,7 @@
 
     // Check to see if this key still refers to the previously
     // registered subchannel
-    grpc_subchannel *c = (grpc_subchannel *)gpr_avl_get(index, key, exec_ctx);
+    grpc_subchannel* c = (grpc_subchannel*)gpr_avl_get(index, key, exec_ctx);
     if (c != constructed) {
       gpr_avl_unref(index, exec_ctx);
       break;
diff --git a/src/core/ext/filters/client_channel/subchannel_index.h b/src/core/ext/filters/client_channel/subchannel_index.h
index 05c3878..47f9c7b 100644
--- a/src/core/ext/filters/client_channel/subchannel_index.h
+++ b/src/core/ext/filters/client_channel/subchannel_index.h
@@ -29,34 +29,34 @@
     shared amongst channels */
 
 /** Create a key that can be used to uniquely identify a subchannel */
-grpc_subchannel_key *grpc_subchannel_key_create(
-    const grpc_subchannel_args *args);
+grpc_subchannel_key* grpc_subchannel_key_create(
+    const grpc_subchannel_args* args);
 
 /** Destroy a subchannel key */
-void grpc_subchannel_key_destroy(grpc_exec_ctx *exec_ctx,
-                                 grpc_subchannel_key *key);
+void grpc_subchannel_key_destroy(grpc_exec_ctx* exec_ctx,
+                                 grpc_subchannel_key* key);
 
 /** Given a subchannel key, find the subchannel registered for it.
     Returns NULL if no such channel exists.
     Thread-safe. */
-grpc_subchannel *grpc_subchannel_index_find(grpc_exec_ctx *exec_ctx,
-                                            grpc_subchannel_key *key);
+grpc_subchannel* grpc_subchannel_index_find(grpc_exec_ctx* exec_ctx,
+                                            grpc_subchannel_key* key);
 
 /** Register a subchannel against a key.
     Takes ownership of \a constructed.
     Returns the registered subchannel. This may be different from
     \a constructed in the case of a registration race. */
-grpc_subchannel *grpc_subchannel_index_register(grpc_exec_ctx *exec_ctx,
-                                                grpc_subchannel_key *key,
-                                                grpc_subchannel *constructed);
+grpc_subchannel* grpc_subchannel_index_register(grpc_exec_ctx* exec_ctx,
+                                                grpc_subchannel_key* key,
+                                                grpc_subchannel* constructed);
 
 /** Remove \a constructed as the registered subchannel for \a key. */
-void grpc_subchannel_index_unregister(grpc_exec_ctx *exec_ctx,
-                                      grpc_subchannel_key *key,
-                                      grpc_subchannel *constructed);
+void grpc_subchannel_index_unregister(grpc_exec_ctx* exec_ctx,
+                                      grpc_subchannel_key* key,
+                                      grpc_subchannel* constructed);
 
-int grpc_subchannel_key_compare(const grpc_subchannel_key *a,
-                                const grpc_subchannel_key *b);
+int grpc_subchannel_key_compare(const grpc_subchannel_key* a,
+                                const grpc_subchannel_key* b);
 
 /** Initialize the subchannel index (global) */
 void grpc_subchannel_index_init(void);
diff --git a/src/core/ext/filters/client_channel/uri_parser.cc b/src/core/ext/filters/client_channel/uri_parser.cc
index fb4fb8e..1cc52de 100644
--- a/src/core/ext/filters/client_channel/uri_parser.cc
+++ b/src/core/ext/filters/client_channel/uri_parser.cc
@@ -34,9 +34,9 @@
 /** a size_t default value... maps to all 1's */
 #define NOT_SET (~(size_t)0)
 
-static grpc_uri *bad_uri(const char *uri_text, size_t pos, const char *section,
+static grpc_uri* bad_uri(const char* uri_text, size_t pos, const char* section,
                          bool suppress_errors) {
-  char *line_prefix;
+  char* line_prefix;
   size_t pfx_len;
 
   if (!suppress_errors) {
@@ -45,7 +45,7 @@
     gpr_log(GPR_ERROR, "%s%s'", line_prefix, uri_text);
     gpr_free(line_prefix);
 
-    line_prefix = (char *)gpr_malloc(pfx_len + 1);
+    line_prefix = (char*)gpr_malloc(pfx_len + 1);
     memset(line_prefix, ' ', pfx_len);
     line_prefix[pfx_len] = 0;
     gpr_log(GPR_ERROR, "%s^ here", line_prefix);
@@ -56,13 +56,15 @@
 }
 
 /** Returns a copy of percent decoded \a src[begin, end) */
-static char *decode_and_copy_component(grpc_exec_ctx *exec_ctx, const char *src,
+static char* decode_and_copy_component(grpc_exec_ctx* exec_ctx, const char* src,
                                        size_t begin, size_t end) {
   grpc_slice component =
-      grpc_slice_from_copied_buffer(src + begin, end - begin);
+      (begin == NOT_SET || end == NOT_SET)
+          ? grpc_empty_slice()
+          : grpc_slice_from_copied_buffer(src + begin, end - begin);
   grpc_slice decoded_component =
       grpc_permissive_percent_decode_slice(component);
-  char *out = grpc_dump_slice(decoded_component, GPR_DUMP_ASCII);
+  char* out = grpc_dump_slice(decoded_component, GPR_DUMP_ASCII);
   grpc_slice_unref_internal(exec_ctx, component);
   grpc_slice_unref_internal(exec_ctx, decoded_component);
   return out;
@@ -76,7 +78,7 @@
 /** Returns how many chars to advance if \a uri_text[i] begins a valid \a pchar
  * production. If \a uri_text[i] introduces an invalid \a pchar (such as percent
  * sign not followed by two hex digits), NOT_SET is returned. */
-static size_t parse_pchar(const char *uri_text, size_t i) {
+static size_t parse_pchar(const char* uri_text, size_t i) {
   /* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
    * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
    * pct-encoded = "%" HEXDIG HEXDIG
@@ -118,7 +120,7 @@
 }
 
 /* *( pchar / "?" / "/" ) */
-static int parse_fragment_or_query(const char *uri_text, size_t *i) {
+static int parse_fragment_or_query(const char* uri_text, size_t* i) {
   char c;
   while ((c = uri_text[*i]) != 0) {
     const size_t advance = parse_pchar(uri_text, *i); /* pchar */
@@ -143,9 +145,9 @@
   return 1;
 }
 
-static void parse_query_parts(grpc_uri *uri) {
-  static const char *QUERY_PARTS_SEPARATOR = "&";
-  static const char *QUERY_PARTS_VALUE_SEPARATOR = "=";
+static void parse_query_parts(grpc_uri* uri) {
+  static const char* QUERY_PARTS_SEPARATOR = "&";
+  static const char* QUERY_PARTS_VALUE_SEPARATOR = "=";
   GPR_ASSERT(uri->query != NULL);
   if (uri->query[0] == '\0') {
     uri->query_parts = NULL;
@@ -157,11 +159,11 @@
   gpr_string_split(uri->query, QUERY_PARTS_SEPARATOR, &uri->query_parts,
                    &uri->num_query_parts);
   uri->query_parts_values =
-      (char **)gpr_malloc(uri->num_query_parts * sizeof(char **));
+      (char**)gpr_malloc(uri->num_query_parts * sizeof(char**));
   for (size_t i = 0; i < uri->num_query_parts; i++) {
-    char **query_param_parts;
+    char** query_param_parts;
     size_t num_query_param_parts;
-    char *full = uri->query_parts[i];
+    char* full = uri->query_parts[i];
     gpr_string_split(full, QUERY_PARTS_VALUE_SEPARATOR, &query_param_parts,
                      &num_query_param_parts);
     GPR_ASSERT(num_query_param_parts > 0);
@@ -182,9 +184,9 @@
   }
 }
 
-grpc_uri *grpc_uri_parse(grpc_exec_ctx *exec_ctx, const char *uri_text,
+grpc_uri* grpc_uri_parse(grpc_exec_ctx* exec_ctx, const char* uri_text,
                          bool suppress_errors) {
-  grpc_uri *uri;
+  grpc_uri* uri;
   size_t scheme_begin = 0;
   size_t scheme_end = NOT_SET;
   size_t authority_begin = NOT_SET;
@@ -270,7 +272,7 @@
     fragment_end = i;
   }
 
-  uri = (grpc_uri *)gpr_zalloc(sizeof(*uri));
+  uri = (grpc_uri*)gpr_zalloc(sizeof(*uri));
   uri->scheme =
       decode_and_copy_component(exec_ctx, uri_text, scheme_begin, scheme_end);
   uri->authority = decode_and_copy_component(exec_ctx, uri_text,
@@ -286,7 +288,7 @@
   return uri;
 }
 
-const char *grpc_uri_get_query_arg(const grpc_uri *uri, const char *key) {
+const char* grpc_uri_get_query_arg(const grpc_uri* uri, const char* key) {
   GPR_ASSERT(key != NULL);
   if (key[0] == '\0') return NULL;
 
@@ -298,7 +300,7 @@
   return NULL;
 }
 
-void grpc_uri_destroy(grpc_uri *uri) {
+void grpc_uri_destroy(grpc_uri* uri) {
   if (!uri) return;
   gpr_free(uri->scheme);
   gpr_free(uri->authority);
diff --git a/src/core/ext/filters/client_channel/uri_parser.h b/src/core/ext/filters/client_channel/uri_parser.h
index e78da59..cd877ad 100644
--- a/src/core/ext/filters/client_channel/uri_parser.h
+++ b/src/core/ext/filters/client_channel/uri_parser.h
@@ -27,29 +27,29 @@
 #endif
 
 typedef struct {
-  char *scheme;
-  char *authority;
-  char *path;
-  char *query;
+  char* scheme;
+  char* authority;
+  char* path;
+  char* query;
   /** Query substrings separated by '&' */
-  char **query_parts;
+  char** query_parts;
   /** Number of elements in \a query_parts and \a query_parts_values */
   size_t num_query_parts;
   /** Split each query part by '='. NULL if not present. */
-  char **query_parts_values;
-  char *fragment;
+  char** query_parts_values;
+  char* fragment;
 } grpc_uri;
 
 /** parse a uri, return NULL on failure */
-grpc_uri *grpc_uri_parse(grpc_exec_ctx *exec_ctx, const char *uri_text,
+grpc_uri* grpc_uri_parse(grpc_exec_ctx* exec_ctx, const char* uri_text,
                          bool suppress_errors);
 
 /** return the part of a query string after the '=' in "?key=xxx&...", or NULL
  * if key is not present */
-const char *grpc_uri_get_query_arg(const grpc_uri *uri, const char *key);
+const char* grpc_uri_get_query_arg(const grpc_uri* uri, const char* key);
 
 /** destroy a uri */
-void grpc_uri_destroy(grpc_uri *uri);
+void grpc_uri_destroy(grpc_uri* uri);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/filters/http/client/http_client_filter.cc b/src/core/ext/filters/http/client/http_client_filter.cc
index 6208089..590bd22 100644
--- a/src/core/ext/filters/http/client/http_client_filter.cc
+++ b/src/core/ext/filters/http/client/http_client_filter.cc
@@ -36,7 +36,7 @@
 static const size_t kMaxPayloadSizeForGet = 2048;
 
 typedef struct call_data {
-  grpc_call_combiner *call_combiner;
+  grpc_call_combiner* call_combiner;
   // State for handling send_initial_metadata ops.
   grpc_linked_mdelem method;
   grpc_linked_mdelem scheme;
@@ -45,20 +45,20 @@
   grpc_linked_mdelem content_type;
   grpc_linked_mdelem user_agent;
   // State for handling recv_initial_metadata ops.
-  grpc_metadata_batch *recv_initial_metadata;
-  grpc_closure *original_recv_initial_metadata_ready;
+  grpc_metadata_batch* recv_initial_metadata;
+  grpc_closure* original_recv_initial_metadata_ready;
   grpc_closure recv_initial_metadata_ready;
   // State for handling recv_trailing_metadata ops.
-  grpc_metadata_batch *recv_trailing_metadata;
-  grpc_closure *original_recv_trailing_metadata_on_complete;
+  grpc_metadata_batch* recv_trailing_metadata;
+  grpc_closure* original_recv_trailing_metadata_on_complete;
   grpc_closure recv_trailing_metadata_on_complete;
   // State for handling send_message ops.
-  grpc_transport_stream_op_batch *send_message_batch;
+  grpc_transport_stream_op_batch* send_message_batch;
   size_t send_message_bytes_read;
   grpc_byte_stream_cache send_message_cache;
   grpc_caching_byte_stream send_message_caching_stream;
   grpc_closure on_send_message_next_done;
-  grpc_closure *original_send_message_on_complete;
+  grpc_closure* original_send_message_on_complete;
   grpc_closure send_message_on_complete;
 } call_data;
 
@@ -68,18 +68,18 @@
   size_t max_payload_size_for_get;
 } channel_data;
 
-static grpc_error *client_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
-                                                   grpc_call_element *elem,
-                                                   grpc_metadata_batch *b) {
+static grpc_error* client_filter_incoming_metadata(grpc_exec_ctx* exec_ctx,
+                                                   grpc_call_element* elem,
+                                                   grpc_metadata_batch* b) {
   if (b->idx.named.status != NULL) {
     if (grpc_mdelem_eq(b->idx.named.status->md, GRPC_MDELEM_STATUS_200)) {
       grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.status);
     } else {
-      char *val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.status->md),
+      char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.status->md),
                                   GPR_DUMP_ASCII);
-      char *msg;
+      char* msg;
       gpr_asprintf(&msg, "Received http2 header with status: %s", val);
-      grpc_error *e = grpc_error_set_str(
+      grpc_error* e = grpc_error_set_str(
           grpc_error_set_int(
               grpc_error_set_str(
                   GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -125,7 +125,7 @@
       } else {
         /* TODO(klempner): We're currently allowing this, but we shouldn't
            see it without a proxy so log for now. */
-        char *val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.content_type->md),
+        char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.content_type->md),
                                     GPR_DUMP_ASCII);
         gpr_log(GPR_INFO, "Unexpected content-type '%s'", val);
         gpr_free(val);
@@ -137,10 +137,10 @@
   return GRPC_ERROR_NONE;
 }
 
-static void recv_initial_metadata_ready(grpc_exec_ctx *exec_ctx,
-                                        void *user_data, grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)user_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void recv_initial_metadata_ready(grpc_exec_ctx* exec_ctx,
+                                        void* user_data, grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)user_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (error == GRPC_ERROR_NONE) {
     error = client_filter_incoming_metadata(exec_ctx, elem,
                                             calld->recv_initial_metadata);
@@ -151,11 +151,11 @@
                    error);
 }
 
-static void recv_trailing_metadata_on_complete(grpc_exec_ctx *exec_ctx,
-                                               void *user_data,
-                                               grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)user_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void recv_trailing_metadata_on_complete(grpc_exec_ctx* exec_ctx,
+                                               void* user_data,
+                                               grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)user_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (error == GRPC_ERROR_NONE) {
     error = client_filter_incoming_metadata(exec_ctx, elem,
                                             calld->recv_trailing_metadata);
@@ -166,10 +166,10 @@
                    error);
 }
 
-static void send_message_on_complete(grpc_exec_ctx *exec_ctx, void *arg,
-                                     grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
+static void send_message_on_complete(grpc_exec_ctx* exec_ctx, void* arg,
+                                     grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
   grpc_byte_stream_cache_destroy(exec_ctx, &calld->send_message_cache);
   GRPC_CLOSURE_RUN(exec_ctx, calld->original_send_message_on_complete,
                    GRPC_ERROR_REF(error));
@@ -177,10 +177,10 @@
 
 // Pulls a slice from the send_message byte stream, updating
 // calld->send_message_bytes_read.
-static grpc_error *pull_slice_from_send_message(grpc_exec_ctx *exec_ctx,
-                                                call_data *calld) {
+static grpc_error* pull_slice_from_send_message(grpc_exec_ctx* exec_ctx,
+                                                call_data* calld) {
   grpc_slice incoming_slice;
-  grpc_error *error = grpc_byte_stream_pull(
+  grpc_error* error = grpc_byte_stream_pull(
       exec_ctx, &calld->send_message_caching_stream.base, &incoming_slice);
   if (error == GRPC_ERROR_NONE) {
     calld->send_message_bytes_read += GRPC_SLICE_LENGTH(incoming_slice);
@@ -194,12 +194,12 @@
 // calld->send_message_caching_stream.base.length, then we have completed
 // reading from the byte stream; otherwise, an async read has been dispatched
 // and on_send_message_next_done() will be invoked when it is complete.
-static grpc_error *read_all_available_send_message_data(grpc_exec_ctx *exec_ctx,
-                                                        call_data *calld) {
+static grpc_error* read_all_available_send_message_data(grpc_exec_ctx* exec_ctx,
+                                                        call_data* calld) {
   while (grpc_byte_stream_next(exec_ctx,
                                &calld->send_message_caching_stream.base,
                                ~(size_t)0, &calld->on_send_message_next_done)) {
-    grpc_error *error = pull_slice_from_send_message(exec_ctx, calld);
+    grpc_error* error = pull_slice_from_send_message(exec_ctx, calld);
     if (error != GRPC_ERROR_NONE) return error;
     if (calld->send_message_bytes_read ==
         calld->send_message_caching_stream.base.length) {
@@ -210,10 +210,10 @@
 }
 
 // Async callback for grpc_byte_stream_next().
-static void on_send_message_next_done(grpc_exec_ctx *exec_ctx, void *arg,
-                                      grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
+static void on_send_message_next_done(grpc_exec_ctx* exec_ctx, void* arg,
+                                      grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
   if (error != GRPC_ERROR_NONE) {
     grpc_transport_stream_op_batch_finish_with_failure(
         exec_ctx, calld->send_message_batch, error, calld->call_combiner);
@@ -233,8 +233,8 @@
   grpc_call_next_op(exec_ctx, elem, calld->send_message_batch);
 }
 
-static char *slice_buffer_to_string(grpc_slice_buffer *slice_buffer) {
-  char *payload_bytes = (char *)gpr_malloc(slice_buffer->length + 1);
+static char* slice_buffer_to_string(grpc_slice_buffer* slice_buffer) {
+  char* payload_bytes = (char*)gpr_malloc(slice_buffer->length + 1);
   size_t offset = 0;
   for (size_t i = 0; i < slice_buffer->count; ++i) {
     memcpy(payload_bytes + offset,
@@ -248,10 +248,10 @@
 
 // Modifies the path entry in the batch's send_initial_metadata to
 // append the base64-encoded query for a GET request.
-static grpc_error *update_path_for_get(grpc_exec_ctx *exec_ctx,
-                                       grpc_call_element *elem,
-                                       grpc_transport_stream_op_batch *batch) {
-  call_data *calld = (call_data *)elem->call_data;
+static grpc_error* update_path_for_get(grpc_exec_ctx* exec_ctx,
+                                       grpc_call_element* elem,
+                                       grpc_transport_stream_op_batch* batch) {
+  call_data* calld = (call_data*)elem->call_data;
   grpc_slice path_slice =
       GRPC_MDVALUE(batch->payload->send_initial_metadata.send_initial_metadata
                        ->idx.named.path->md);
@@ -264,33 +264,33 @@
       false /* multi_line */);
   grpc_slice path_with_query_slice = GRPC_SLICE_MALLOC(estimated_len);
   /* memcopy individual pieces into this slice */
-  char *write_ptr = (char *)GRPC_SLICE_START_PTR(path_with_query_slice);
-  char *original_path = (char *)GRPC_SLICE_START_PTR(path_slice);
+  char* write_ptr = (char*)GRPC_SLICE_START_PTR(path_with_query_slice);
+  char* original_path = (char*)GRPC_SLICE_START_PTR(path_slice);
   memcpy(write_ptr, original_path, GRPC_SLICE_LENGTH(path_slice));
   write_ptr += GRPC_SLICE_LENGTH(path_slice);
   *write_ptr++ = '?';
-  char *payload_bytes =
+  char* payload_bytes =
       slice_buffer_to_string(&calld->send_message_cache.cache_buffer);
-  grpc_base64_encode_core((char *)write_ptr, payload_bytes,
+  grpc_base64_encode_core((char*)write_ptr, payload_bytes,
                           batch->payload->send_message.send_message->length,
                           true /* url_safe */, false /* multi_line */);
   gpr_free(payload_bytes);
   /* remove trailing unused memory and add trailing 0 to terminate string */
-  char *t = (char *)GRPC_SLICE_START_PTR(path_with_query_slice);
+  char* t = (char*)GRPC_SLICE_START_PTR(path_with_query_slice);
   /* safe to use strlen since base64_encode will always add '\0' */
   path_with_query_slice =
       grpc_slice_sub_no_ref(path_with_query_slice, 0, strlen(t));
   /* substitute previous path with the new path+query */
   grpc_mdelem mdelem_path_and_query =
       grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_PATH, path_with_query_slice);
-  grpc_metadata_batch *b =
+  grpc_metadata_batch* b =
       batch->payload->send_initial_metadata.send_initial_metadata;
   return grpc_metadata_batch_substitute(exec_ctx, b, b->idx.named.path,
                                         mdelem_path_and_query);
 }
 
-static void remove_if_present(grpc_exec_ctx *exec_ctx,
-                              grpc_metadata_batch *batch,
+static void remove_if_present(grpc_exec_ctx* exec_ctx,
+                              grpc_metadata_batch* batch,
                               grpc_metadata_batch_callouts_index idx) {
   if (batch->idx.array[idx] != NULL) {
     grpc_metadata_batch_remove(exec_ctx, batch, batch->idx.array[idx]);
@@ -298,10 +298,10 @@
 }
 
 static void hc_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *batch) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *channeld = (channel_data *)elem->channel_data;
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* batch) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* channeld = (channel_data*)elem->channel_data;
   GPR_TIMER_BEGIN("hc_start_transport_stream_op_batch", 0);
 
   if (batch->recv_initial_metadata) {
@@ -322,7 +322,7 @@
     batch->on_complete = &calld->recv_trailing_metadata_on_complete;
   }
 
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   bool batch_will_be_handled_asynchronously = false;
   if (batch->send_initial_metadata) {
     // Decide which HTTP VERB to use. We use GET if the request is marked
@@ -422,10 +422,10 @@
 }
 
 /* Constructor for call_data */
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  call_data *calld = (call_data *)elem->call_data;
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  call_data* calld = (call_data*)elem->call_data;
   calld->call_combiner = args->call_combiner;
   GRPC_CLOSURE_INIT(&calld->recv_initial_metadata_ready,
                     recv_initial_metadata_ready, elem,
@@ -441,11 +441,11 @@
 }
 
 /* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {}
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {}
 
-static grpc_mdelem scheme_from_args(const grpc_channel_args *args) {
+static grpc_mdelem scheme_from_args(const grpc_channel_args* args) {
   unsigned i;
   size_t j;
   grpc_mdelem valid_schemes[] = {GRPC_MDELEM_SCHEME_HTTP,
@@ -466,7 +466,7 @@
   return GRPC_MDELEM_SCHEME_HTTP;
 }
 
-static size_t max_payload_size_from_args(const grpc_channel_args *args) {
+static size_t max_payload_size_from_args(const grpc_channel_args* args) {
   if (args != NULL) {
     for (size_t i = 0; i < args->num_args; ++i) {
       if (0 == strcmp(args->args[i].key, GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET)) {
@@ -482,12 +482,12 @@
   return kMaxPayloadSizeForGet;
 }
 
-static grpc_slice user_agent_from_args(const grpc_channel_args *args,
-                                       const char *transport_name) {
+static grpc_slice user_agent_from_args(const grpc_channel_args* args,
+                                       const char* transport_name) {
   gpr_strvec v;
   size_t i;
   int is_first = 1;
-  char *tmp;
+  char* tmp;
   grpc_slice result;
 
   gpr_strvec_init(&v);
@@ -533,10 +533,10 @@
 }
 
 /* Constructor for channel_data */
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   GPR_ASSERT(!args->is_last);
   GPR_ASSERT(args->optional_transport != NULL);
   chand->static_scheme = scheme_from_args(args->channel_args);
@@ -550,9 +550,9 @@
 }
 
 /* Destructor for channel data */
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   GRPC_MDELEM_UNREF(exec_ctx, chand->user_agent);
 }
 
diff --git a/src/core/ext/filters/http/http_filters_plugin.cc b/src/core/ext/filters/http/http_filters_plugin.cc
index cbcbca1..31a9d2b 100644
--- a/src/core/ext/filters/http/http_filters_plugin.cc
+++ b/src/core/ext/filters/http/http_filters_plugin.cc
@@ -27,25 +27,25 @@
 #include "src/core/lib/transport/transport_impl.h"
 
 typedef struct {
-  const grpc_channel_filter *filter;
-  const char *control_channel_arg;
+  const grpc_channel_filter* filter;
+  const char* control_channel_arg;
 } optional_filter;
 
 static optional_filter compress_filter = {
     &grpc_message_compress_filter, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION};
 
 static bool is_building_http_like_transport(
-    grpc_channel_stack_builder *builder) {
-  grpc_transport *t = grpc_channel_stack_builder_get_transport(builder);
+    grpc_channel_stack_builder* builder) {
+  grpc_transport* t = grpc_channel_stack_builder_get_transport(builder);
   return t != NULL && strstr(t->vtable->name, "http");
 }
 
-static bool maybe_add_optional_filter(grpc_exec_ctx *exec_ctx,
-                                      grpc_channel_stack_builder *builder,
-                                      void *arg) {
+static bool maybe_add_optional_filter(grpc_exec_ctx* exec_ctx,
+                                      grpc_channel_stack_builder* builder,
+                                      void* arg) {
   if (!is_building_http_like_transport(builder)) return true;
-  optional_filter *filtarg = (optional_filter *)arg;
-  const grpc_channel_args *channel_args =
+  optional_filter* filtarg = (optional_filter*)arg;
+  const grpc_channel_args* channel_args =
       grpc_channel_stack_builder_get_channel_arguments(builder);
   bool enable = grpc_channel_arg_get_bool(
       grpc_channel_args_find(channel_args, filtarg->control_channel_arg),
@@ -55,12 +55,12 @@
                 : true;
 }
 
-static bool maybe_add_required_filter(grpc_exec_ctx *exec_ctx,
-                                      grpc_channel_stack_builder *builder,
-                                      void *arg) {
+static bool maybe_add_required_filter(grpc_exec_ctx* exec_ctx,
+                                      grpc_channel_stack_builder* builder,
+                                      void* arg) {
   return is_building_http_like_transport(builder)
              ? grpc_channel_stack_builder_prepend_filter(
-                   builder, (const grpc_channel_filter *)arg, NULL, NULL)
+                   builder, (const grpc_channel_filter*)arg, NULL, NULL)
              : true;
 }
 
@@ -76,13 +76,13 @@
                                    maybe_add_optional_filter, &compress_filter);
   grpc_channel_init_register_stage(
       GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
-      maybe_add_required_filter, (void *)&grpc_http_client_filter);
+      maybe_add_required_filter, (void*)&grpc_http_client_filter);
   grpc_channel_init_register_stage(
       GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
-      maybe_add_required_filter, (void *)&grpc_http_client_filter);
+      maybe_add_required_filter, (void*)&grpc_http_client_filter);
   grpc_channel_init_register_stage(
       GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
-      maybe_add_required_filter, (void *)&grpc_http_server_filter);
+      maybe_add_required_filter, (void*)&grpc_http_server_filter);
 }
 
 extern "C" void grpc_http_filters_shutdown(void) {}
diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.cc b/src/core/ext/filters/http/message_compress/message_compress_filter.cc
index 5c47287..8227ba3 100644
--- a/src/core/ext/filters/http/message_compress/message_compress_filter.cc
+++ b/src/core/ext/filters/http/message_compress/message_compress_filter.cc
@@ -45,7 +45,7 @@
 } initial_metadata_state;
 
 typedef struct call_data {
-  grpc_call_combiner *call_combiner;
+  grpc_call_combiner* call_combiner;
   grpc_linked_mdelem compression_algorithm_storage;
   grpc_linked_mdelem stream_compression_algorithm_storage;
   grpc_linked_mdelem accept_encoding_storage;
@@ -54,12 +54,12 @@
    * metadata, or by the channel's default compression settings. */
   grpc_compression_algorithm compression_algorithm;
   initial_metadata_state send_initial_metadata_state;
-  grpc_error *cancel_error;
+  grpc_error* cancel_error;
   grpc_closure start_send_message_batch_in_call_combiner;
-  grpc_transport_stream_op_batch *send_message_batch;
+  grpc_transport_stream_op_batch* send_message_batch;
   grpc_slice_buffer slices; /**< Buffers up input slices to be compressed */
   grpc_slice_buffer_stream replacement_stream;
-  grpc_closure *original_send_message_on_complete;
+  grpc_closure* original_send_message_on_complete;
   grpc_closure send_message_on_complete;
   grpc_closure on_send_message_next_done;
 } call_data;
@@ -80,10 +80,10 @@
   uint32_t supported_stream_compression_algorithms;
 } channel_data;
 
-static bool skip_compression(grpc_call_element *elem, uint32_t flags,
+static bool skip_compression(grpc_call_element* elem, uint32_t flags,
                              bool has_compression_algorithm) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *channeld = (channel_data *)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* channeld = (channel_data*)elem->channel_data;
 
   if (flags & (GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_INTERNAL_COMPRESS)) {
     return true;
@@ -99,15 +99,15 @@
 }
 
 /** Filter initial metadata */
-static grpc_error *process_send_initial_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_metadata_batch *initial_metadata,
-    bool *has_compression_algorithm) GRPC_MUST_USE_RESULT;
-static grpc_error *process_send_initial_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_metadata_batch *initial_metadata, bool *has_compression_algorithm) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *channeld = (channel_data *)elem->channel_data;
+static grpc_error* process_send_initial_metadata(
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_metadata_batch* initial_metadata,
+    bool* has_compression_algorithm) GRPC_MUST_USE_RESULT;
+static grpc_error* process_send_initial_metadata(
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_metadata_batch* initial_metadata, bool* has_compression_algorithm) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* channeld = (channel_data*)elem->channel_data;
   *has_compression_algorithm = false;
   grpc_stream_compression_algorithm stream_compression_algorithm =
       GRPC_STREAM_COMPRESS_NONE;
@@ -117,7 +117,7 @@
         initial_metadata->idx.named.grpc_internal_stream_encoding_request->md;
     if (!grpc_stream_compression_algorithm_parse(
             GRPC_MDVALUE(md), &stream_compression_algorithm)) {
-      char *val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+      char* val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
       gpr_log(GPR_ERROR,
               "Invalid stream compression algorithm: '%s' (unknown). Ignoring.",
               val);
@@ -126,7 +126,7 @@
     }
     if (!GPR_BITGET(channeld->enabled_stream_compression_algorithms_bitset,
                     stream_compression_algorithm)) {
-      char *val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+      char* val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
       gpr_log(
           GPR_ERROR,
           "Invalid stream compression algorithm: '%s' (previously disabled). "
@@ -152,7 +152,7 @@
         initial_metadata->idx.named.grpc_internal_encoding_request->md;
     if (!grpc_compression_algorithm_parse(GRPC_MDVALUE(md),
                                           &calld->compression_algorithm)) {
-      char *val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+      char* val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
       gpr_log(GPR_ERROR,
               "Invalid compression algorithm: '%s' (unknown). Ignoring.", val);
       gpr_free(val);
@@ -177,7 +177,7 @@
     *has_compression_algorithm = true;
   }
 
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   /* hint compression algorithm */
   if (stream_compression_algorithm != GRPC_STREAM_COMPRESS_NONE) {
     error = grpc_metadata_batch_add_tail(
@@ -211,30 +211,30 @@
   return error;
 }
 
-static void send_message_on_complete(grpc_exec_ctx *exec_ctx, void *arg,
-                                     grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
+static void send_message_on_complete(grpc_exec_ctx* exec_ctx, void* arg,
+                                     grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
   grpc_slice_buffer_reset_and_unref_internal(exec_ctx, &calld->slices);
   GRPC_CLOSURE_RUN(exec_ctx, calld->original_send_message_on_complete,
                    GRPC_ERROR_REF(error));
 }
 
-static void send_message_batch_continue(grpc_exec_ctx *exec_ctx,
-                                        grpc_call_element *elem) {
-  call_data *calld = (call_data *)elem->call_data;
+static void send_message_batch_continue(grpc_exec_ctx* exec_ctx,
+                                        grpc_call_element* elem) {
+  call_data* calld = (call_data*)elem->call_data;
   // Note: The call to grpc_call_next_op() results in yielding the
   // call combiner, so we need to clear calld->send_message_batch
   // before we do that.
-  grpc_transport_stream_op_batch *send_message_batch =
+  grpc_transport_stream_op_batch* send_message_batch =
       calld->send_message_batch;
   calld->send_message_batch = NULL;
   grpc_call_next_op(exec_ctx, elem, send_message_batch);
 }
 
-static void finish_send_message(grpc_exec_ctx *exec_ctx,
-                                grpc_call_element *elem) {
-  call_data *calld = (call_data *)elem->call_data;
+static void finish_send_message(grpc_exec_ctx* exec_ctx,
+                                grpc_call_element* elem) {
+  call_data* calld = (call_data*)elem->call_data;
   // Compress the data if appropriate.
   grpc_slice_buffer tmp;
   grpc_slice_buffer_init(&tmp);
@@ -244,21 +244,22 @@
                                         &calld->slices, &tmp);
   if (did_compress) {
     if (grpc_compression_trace.enabled()) {
-      const char *algo_name;
+      const char* algo_name;
       const size_t before_size = calld->slices.length;
       const size_t after_size = tmp.length;
       const float savings_ratio = 1.0f - (float)after_size / (float)before_size;
       GPR_ASSERT(grpc_compression_algorithm_name(calld->compression_algorithm,
                                                  &algo_name));
-      gpr_log(GPR_DEBUG, "Compressed[%s] %" PRIuPTR " bytes vs. %" PRIuPTR
-                         " bytes (%.2f%% savings)",
+      gpr_log(GPR_DEBUG,
+              "Compressed[%s] %" PRIuPTR " bytes vs. %" PRIuPTR
+              " bytes (%.2f%% savings)",
               algo_name, before_size, after_size, 100 * savings_ratio);
     }
     grpc_slice_buffer_swap(&calld->slices, &tmp);
     send_flags |= GRPC_WRITE_INTERNAL_COMPRESS;
   } else {
     if (grpc_compression_trace.enabled()) {
-      const char *algo_name;
+      const char* algo_name;
       GPR_ASSERT(grpc_compression_algorithm_name(calld->compression_algorithm,
                                                  &algo_name));
       gpr_log(GPR_DEBUG,
@@ -282,10 +283,10 @@
   send_message_batch_continue(exec_ctx, elem);
 }
 
-static void fail_send_message_batch_in_call_combiner(grpc_exec_ctx *exec_ctx,
-                                                     void *arg,
-                                                     grpc_error *error) {
-  call_data *calld = (call_data *)arg;
+static void fail_send_message_batch_in_call_combiner(grpc_exec_ctx* exec_ctx,
+                                                     void* arg,
+                                                     grpc_error* error) {
+  call_data* calld = (call_data*)arg;
   if (calld->send_message_batch != NULL) {
     grpc_transport_stream_op_batch_finish_with_failure(
         exec_ctx, calld->send_message_batch, GRPC_ERROR_REF(error),
@@ -295,10 +296,10 @@
 }
 
 // Pulls a slice from the send_message byte stream and adds it to calld->slices.
-static grpc_error *pull_slice_from_send_message(grpc_exec_ctx *exec_ctx,
-                                                call_data *calld) {
+static grpc_error* pull_slice_from_send_message(grpc_exec_ctx* exec_ctx,
+                                                call_data* calld) {
   grpc_slice incoming_slice;
-  grpc_error *error = grpc_byte_stream_pull(
+  grpc_error* error = grpc_byte_stream_pull(
       exec_ctx, calld->send_message_batch->payload->send_message.send_message,
       &incoming_slice);
   if (error == GRPC_ERROR_NONE) {
@@ -311,13 +312,13 @@
 // If all data has been read, invokes finish_send_message().  Otherwise,
 // an async call to grpc_byte_stream_next() has been started, which will
 // eventually result in calling on_send_message_next_done().
-static void continue_reading_send_message(grpc_exec_ctx *exec_ctx,
-                                          grpc_call_element *elem) {
-  call_data *calld = (call_data *)elem->call_data;
+static void continue_reading_send_message(grpc_exec_ctx* exec_ctx,
+                                          grpc_call_element* elem) {
+  call_data* calld = (call_data*)elem->call_data;
   while (grpc_byte_stream_next(
       exec_ctx, calld->send_message_batch->payload->send_message.send_message,
       ~(size_t)0, &calld->on_send_message_next_done)) {
-    grpc_error *error = pull_slice_from_send_message(exec_ctx, calld);
+    grpc_error* error = pull_slice_from_send_message(exec_ctx, calld);
     if (error != GRPC_ERROR_NONE) {
       // Closure callback; does not take ownership of error.
       fail_send_message_batch_in_call_combiner(exec_ctx, calld, error);
@@ -333,10 +334,10 @@
 }
 
 // Async callback for grpc_byte_stream_next().
-static void on_send_message_next_done(grpc_exec_ctx *exec_ctx, void *arg,
-                                      grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
+static void on_send_message_next_done(grpc_exec_ctx* exec_ctx, void* arg,
+                                      grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
   if (error != GRPC_ERROR_NONE) {
     // Closure callback; does not take ownership of error.
     fail_send_message_batch_in_call_combiner(exec_ctx, calld, error);
@@ -357,10 +358,10 @@
   }
 }
 
-static void start_send_message_batch(grpc_exec_ctx *exec_ctx, void *arg,
-                                     grpc_error *unused) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
+static void start_send_message_batch(grpc_exec_ctx* exec_ctx, void* arg,
+                                     grpc_error* unused) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
   if (skip_compression(
           elem,
           calld->send_message_batch->payload->send_message.send_message->flags,
@@ -372,9 +373,9 @@
 }
 
 static void compress_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *batch) {
-  call_data *calld = (call_data *)elem->call_data;
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* batch) {
+  call_data* calld = (call_data*)elem->call_data;
   GPR_TIMER_BEGIN("compress_start_transport_stream_op_batch", 0);
   // Handle cancel_stream.
   if (batch->cancel_stream) {
@@ -405,7 +406,7 @@
   if (batch->send_initial_metadata) {
     GPR_ASSERT(calld->send_initial_metadata_state == INITIAL_METADATA_UNSEEN);
     bool has_compression_algorithm;
-    grpc_error *error = process_send_initial_metadata(
+    grpc_error* error = process_send_initial_metadata(
         exec_ctx, elem,
         batch->payload->send_initial_metadata.send_initial_metadata,
         &has_compression_algorithm);
@@ -453,10 +454,10 @@
 }
 
 /* Constructor for call_data */
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  call_data *calld = (call_data *)elem->call_data;
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  call_data* calld = (call_data*)elem->call_data;
   calld->call_combiner = args->call_combiner;
   calld->cancel_error = GRPC_ERROR_NONE;
   grpc_slice_buffer_init(&calld->slices);
@@ -470,19 +471,19 @@
 }
 
 /* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {
-  call_data *calld = (call_data *)elem->call_data;
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {
+  call_data* calld = (call_data*)elem->call_data;
   grpc_slice_buffer_destroy_internal(exec_ctx, &calld->slices);
   GRPC_ERROR_UNREF(calld->cancel_error);
 }
 
 /* Constructor for channel_data */
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  channel_data *channeld = (channel_data *)elem->channel_data;
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  channel_data* channeld = (channel_data*)elem->channel_data;
 
   /* Configuration for message compression */
   channeld->enabled_algorithms_bitset =
@@ -530,8 +531,8 @@
 }
 
 /* Destructor for channel data */
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {}
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {}
 
 const grpc_channel_filter grpc_message_compress_filter = {
     compress_start_transport_stream_op_batch,
diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.h b/src/core/ext/filters/http/message_compress/message_compress_filter.h
index 92771d9..79a2815 100644
--- a/src/core/ext/filters/http/message_compress/message_compress_filter.h
+++ b/src/core/ext/filters/http/message_compress/message_compress_filter.h
@@ -56,4 +56,4 @@
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H \
-          */
+        */
diff --git a/src/core/ext/filters/http/server/http_server_filter.cc b/src/core/ext/filters/http/server/http_server_filter.cc
index 0395813..5cfe5ac 100644
--- a/src/core/ext/filters/http/server/http_server_filter.cc
+++ b/src/core/ext/filters/http/server/http_server_filter.cc
@@ -32,7 +32,7 @@
 #define EXPECTED_CONTENT_TYPE_LENGTH sizeof(EXPECTED_CONTENT_TYPE) - 1
 
 typedef struct call_data {
-  grpc_call_combiner *call_combiner;
+  grpc_call_combiner* call_combiner;
 
   grpc_linked_mdelem status;
   grpc_linked_mdelem content_type;
@@ -42,15 +42,15 @@
   /* flag to ensure payload_bin is delivered only once */
   bool payload_bin_delivered;
 
-  grpc_metadata_batch *recv_initial_metadata;
-  uint32_t *recv_initial_metadata_flags;
+  grpc_metadata_batch* recv_initial_metadata;
+  uint32_t* recv_initial_metadata_flags;
   /** Closure to call when finished with the hs_on_recv hook */
-  grpc_closure *on_done_recv;
+  grpc_closure* on_done_recv;
   /** Closure to call when we retrieve read message from the path URI
    */
-  grpc_closure *recv_message_ready;
-  grpc_closure *on_complete;
-  grpc_byte_stream **pp_recv_message;
+  grpc_closure* recv_message_ready;
+  grpc_closure* on_complete;
+  grpc_byte_stream** pp_recv_message;
   grpc_slice_buffer read_slice_buffer;
   grpc_slice_buffer_stream read_stream;
 
@@ -62,11 +62,13 @@
   grpc_closure hs_recv_message_ready;
 } call_data;
 
-typedef struct channel_data { uint8_t unused; } channel_data;
+typedef struct channel_data {
+  uint8_t unused;
+} channel_data;
 
-static grpc_error *server_filter_outgoing_metadata(grpc_exec_ctx *exec_ctx,
-                                                   grpc_call_element *elem,
-                                                   grpc_metadata_batch *b) {
+static grpc_error* server_filter_outgoing_metadata(grpc_exec_ctx* exec_ctx,
+                                                   grpc_call_element* elem,
+                                                   grpc_metadata_batch* b) {
   if (b->idx.named.grpc_message != NULL) {
     grpc_slice pct_encoded_msg = grpc_percent_encode_slice(
         GRPC_MDVALUE(b->idx.named.grpc_message->md),
@@ -82,8 +84,8 @@
   return GRPC_ERROR_NONE;
 }
 
-static void add_error(const char *error_name, grpc_error **cumulative,
-                      grpc_error *new_err) {
+static void add_error(const char* error_name, grpc_error** cumulative,
+                      grpc_error* new_err) {
   if (new_err == GRPC_ERROR_NONE) return;
   if (*cumulative == GRPC_ERROR_NONE) {
     *cumulative = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_name);
@@ -91,12 +93,12 @@
   *cumulative = grpc_error_add_child(*cumulative, new_err);
 }
 
-static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
-                                                   grpc_call_element *elem,
-                                                   grpc_metadata_batch *b) {
-  call_data *calld = (call_data *)elem->call_data;
-  grpc_error *error = GRPC_ERROR_NONE;
-  static const char *error_name = "Failed processing incoming headers";
+static grpc_error* server_filter_incoming_metadata(grpc_exec_ctx* exec_ctx,
+                                                   grpc_call_element* elem,
+                                                   grpc_metadata_batch* b) {
+  call_data* calld = (call_data*)elem->call_data;
+  grpc_error* error = GRPC_ERROR_NONE;
+  static const char* error_name = "Failed processing incoming headers";
 
   if (b->idx.named.method != NULL) {
     if (grpc_mdelem_eq(b->idx.named.method->md, GRPC_MDELEM_METHOD_POST)) {
@@ -183,7 +185,7 @@
       } else {
         /* TODO(klempner): We're currently allowing this, but we shouldn't
            see it without a proxy so log for now. */
-        char *val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.content_type->md),
+        char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.content_type->md),
                                     GPR_DUMP_ASCII);
         gpr_log(GPR_INFO, "Unexpected content-type '%s'", val);
         gpr_free(val);
@@ -203,7 +205,7 @@
      * query parameter which is base64 encoded request payload. */
     const char k_query_separator = '?';
     grpc_slice path_slice = GRPC_MDVALUE(b->idx.named.path->md);
-    uint8_t *path_ptr = (uint8_t *)GRPC_SLICE_START_PTR(path_slice);
+    uint8_t* path_ptr = (uint8_t*)GRPC_SLICE_START_PTR(path_slice);
     size_t path_length = GRPC_SLICE_LENGTH(path_slice);
     /* offset of the character '?' */
     size_t offset = 0;
@@ -226,7 +228,7 @@
       grpc_slice_buffer_add(
           &calld->read_slice_buffer,
           grpc_base64_decode_with_len(
-              exec_ctx, (const char *)GRPC_SLICE_START_PTR(query_slice),
+              exec_ctx, (const char*)GRPC_SLICE_START_PTR(query_slice),
               GRPC_SLICE_LENGTH(query_slice), k_url_safe));
       grpc_slice_buffer_stream_init(&calld->read_stream,
                                     &calld->read_slice_buffer, 0);
@@ -238,15 +240,15 @@
   }
 
   if (b->idx.named.host != NULL && b->idx.named.authority == NULL) {
-    grpc_linked_mdelem *el = b->idx.named.host;
+    grpc_linked_mdelem* el = b->idx.named.host;
     grpc_mdelem md = GRPC_MDELEM_REF(el->md);
     grpc_metadata_batch_remove(exec_ctx, b, el);
-    add_error(
-        error_name, &error,
-        grpc_metadata_batch_add_head(
-            exec_ctx, b, el, grpc_mdelem_from_slices(
-                                 exec_ctx, GRPC_MDSTR_AUTHORITY,
-                                 grpc_slice_ref_internal(GRPC_MDVALUE(md)))));
+    add_error(error_name, &error,
+              grpc_metadata_batch_add_head(
+                  exec_ctx, b, el,
+                  grpc_mdelem_from_slices(
+                      exec_ctx, GRPC_MDSTR_AUTHORITY,
+                      grpc_slice_ref_internal(GRPC_MDVALUE(md)))));
     GRPC_MDELEM_UNREF(exec_ctx, md);
   }
 
@@ -261,10 +263,10 @@
   return error;
 }
 
-static void hs_on_recv(grpc_exec_ctx *exec_ctx, void *user_data,
-                       grpc_error *err) {
-  grpc_call_element *elem = (grpc_call_element *)user_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void hs_on_recv(grpc_exec_ctx* exec_ctx, void* user_data,
+                       grpc_error* err) {
+  grpc_call_element* elem = (grpc_call_element*)user_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (err == GRPC_ERROR_NONE) {
     err = server_filter_incoming_metadata(exec_ctx, elem,
                                           calld->recv_initial_metadata);
@@ -274,15 +276,15 @@
   GRPC_CLOSURE_RUN(exec_ctx, calld->on_done_recv, err);
 }
 
-static void hs_on_complete(grpc_exec_ctx *exec_ctx, void *user_data,
-                           grpc_error *err) {
-  grpc_call_element *elem = (grpc_call_element *)user_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void hs_on_complete(grpc_exec_ctx* exec_ctx, void* user_data,
+                           grpc_error* err) {
+  grpc_call_element* elem = (grpc_call_element*)user_data;
+  call_data* calld = (call_data*)elem->call_data;
   /* Call recv_message_ready if we got the payload via the path field */
   if (calld->seen_path_with_query && calld->recv_message_ready != NULL) {
     *calld->pp_recv_message = calld->payload_bin_delivered
                                   ? NULL
-                                  : (grpc_byte_stream *)&calld->read_stream;
+                                  : (grpc_byte_stream*)&calld->read_stream;
     // Re-enter call combiner for recv_message_ready, since the surface
     // code will release the call combiner for each callback it receives.
     GRPC_CALL_COMBINER_START(exec_ctx, calld->call_combiner,
@@ -294,10 +296,10 @@
   GRPC_CLOSURE_RUN(exec_ctx, calld->on_complete, GRPC_ERROR_REF(err));
 }
 
-static void hs_recv_message_ready(grpc_exec_ctx *exec_ctx, void *user_data,
-                                  grpc_error *err) {
-  grpc_call_element *elem = (grpc_call_element *)user_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void hs_recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data,
+                                  grpc_error* err) {
+  grpc_call_element* elem = (grpc_call_element*)user_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (calld->seen_path_with_query) {
     // Do nothing. This is probably a GET request, and payload will be
     // returned in hs_on_complete callback.
@@ -310,15 +312,15 @@
   }
 }
 
-static grpc_error *hs_mutate_op(grpc_exec_ctx *exec_ctx,
-                                grpc_call_element *elem,
-                                grpc_transport_stream_op_batch *op) {
+static grpc_error* hs_mutate_op(grpc_exec_ctx* exec_ctx,
+                                grpc_call_element* elem,
+                                grpc_transport_stream_op_batch* op) {
   /* grab pointers to our data from the call element */
-  call_data *calld = (call_data *)elem->call_data;
+  call_data* calld = (call_data*)elem->call_data;
 
   if (op->send_initial_metadata) {
-    grpc_error *error = GRPC_ERROR_NONE;
-    static const char *error_name = "Failed sending initial metadata";
+    grpc_error* error = GRPC_ERROR_NONE;
+    static const char* error_name = "Failed sending initial metadata";
     add_error(
         error_name, &error,
         grpc_metadata_batch_add_head(
@@ -364,7 +366,7 @@
   }
 
   if (op->send_trailing_metadata) {
-    grpc_error *error = server_filter_outgoing_metadata(
+    grpc_error* error = server_filter_outgoing_metadata(
         exec_ctx, elem,
         op->payload->send_trailing_metadata.send_trailing_metadata);
     if (error != GRPC_ERROR_NONE) return error;
@@ -374,11 +376,11 @@
 }
 
 static void hs_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *op) {
-  call_data *calld = (call_data *)elem->call_data;
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* op) {
+  call_data* calld = (call_data*)elem->call_data;
   GPR_TIMER_BEGIN("hs_start_transport_stream_op_batch", 0);
-  grpc_error *error = hs_mutate_op(exec_ctx, elem, op);
+  grpc_error* error = hs_mutate_op(exec_ctx, elem, op);
   if (error != GRPC_ERROR_NONE) {
     grpc_transport_stream_op_batch_finish_with_failure(exec_ctx, op, error,
                                                        calld->call_combiner);
@@ -389,11 +391,11 @@
 }
 
 /* Constructor for call_data */
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
   /* grab pointers to our data from the call element */
-  call_data *calld = (call_data *)elem->call_data;
+  call_data* calld = (call_data*)elem->call_data;
   /* initialize members */
   calld->call_combiner = args->call_combiner;
   GRPC_CLOSURE_INIT(&calld->hs_on_recv, hs_on_recv, elem,
@@ -407,24 +409,24 @@
 }
 
 /* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {
-  call_data *calld = (call_data *)elem->call_data;
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {
+  call_data* calld = (call_data*)elem->call_data;
   grpc_slice_buffer_destroy_internal(exec_ctx, &calld->read_slice_buffer);
 }
 
 /* Constructor for channel_data */
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
   GPR_ASSERT(!args->is_last);
   return GRPC_ERROR_NONE;
 }
 
 /* Destructor for channel data */
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {}
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {}
 
 const grpc_channel_filter grpc_http_server_filter = {
     hs_start_transport_stream_op_batch,
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
index ca8a3b2..77b086c 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
@@ -43,21 +43,21 @@
   /* stores the recv_initial_metadata op's ready closure, which we wrap with our
    * own (on_initial_md_ready) in order to capture the incoming initial metadata
    * */
-  grpc_closure *ops_recv_initial_metadata_ready;
+  grpc_closure* ops_recv_initial_metadata_ready;
 
   /* to get notified of the availability of the incoming initial metadata. */
   grpc_closure on_initial_md_ready;
-  grpc_metadata_batch *recv_initial_metadata;
+  grpc_metadata_batch* recv_initial_metadata;
 } call_data;
 
 typedef struct channel_data {
   intptr_t id; /**< an id unique to the channel */
 } channel_data;
 
-static void on_initial_md_ready(grpc_exec_ctx *exec_ctx, void *user_data,
-                                grpc_error *err) {
-  grpc_call_element *elem = (grpc_call_element *)user_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void on_initial_md_ready(grpc_exec_ctx* exec_ctx, void* user_data,
+                                grpc_error* err) {
+  grpc_call_element* elem = (grpc_call_element*)user_data;
+  call_data* calld = (call_data*)elem->call_data;
 
   if (err == GRPC_ERROR_NONE) {
     if (calld->recv_initial_metadata->idx.named.path != NULL) {
@@ -85,10 +85,10 @@
 }
 
 /* Constructor for call_data */
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  call_data *calld = (call_data *)elem->call_data;
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  call_data* calld = (call_data*)elem->call_data;
   calld->id = (intptr_t)args->call_stack;
   GRPC_CLOSURE_INIT(&calld->on_initial_md_ready, on_initial_md_ready, elem,
                     grpc_schedule_on_exec_ctx);
@@ -108,10 +108,10 @@
 }
 
 /* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {
-  call_data *calld = (call_data *)elem->call_data;
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {
+  call_data* calld = (call_data*)elem->call_data;
 
   /* TODO(dgq): do something with the data
   channel_data *chand = elem->channel_data;
@@ -136,12 +136,12 @@
 }
 
 /* Constructor for channel_data */
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
   GPR_ASSERT(!args->is_last);
 
-  channel_data *chand = (channel_data *)elem->channel_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   chand->id = (intptr_t)args->channel_stack;
 
   /* TODO(dgq): do something with the data
@@ -158,8 +158,8 @@
 }
 
 /* Destructor for channel data */
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {
   /* TODO(dgq): do something with the data
   channel_data *chand = elem->channel_data;
   grpc_load_reporting_call_data lr_call_data = {
@@ -173,11 +173,11 @@
   */
 }
 
-static grpc_filtered_mdelem lr_trailing_md_filter(grpc_exec_ctx *exec_ctx,
-                                                  void *user_data,
+static grpc_filtered_mdelem lr_trailing_md_filter(grpc_exec_ctx* exec_ctx,
+                                                  void* user_data,
                                                   grpc_mdelem md) {
-  grpc_call_element *elem = (grpc_call_element *)user_data;
-  call_data *calld = (call_data *)elem->call_data;
+  grpc_call_element* elem = (grpc_call_element*)user_data;
+  call_data* calld = (call_data*)elem->call_data;
   if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_LB_COST_BIN)) {
     calld->trailing_md_string = GRPC_MDVALUE(md);
     return GRPC_FILTERED_REMOVE();
@@ -186,10 +186,10 @@
 }
 
 static void lr_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *op) {
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* op) {
   GPR_TIMER_BEGIN("lr_start_transport_stream_op_batch", 0);
-  call_data *calld = (call_data *)elem->call_data;
+  call_data* calld = (call_data*)elem->call_data;
 
   if (op->recv_initial_metadata) {
     /* substitute our callback for the higher callback */
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
index 94d19cc..356f8b8 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
@@ -33,4 +33,4 @@
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_FILTER_H \
-          */
+        */
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
index 223fb3e..b26cbe3 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc
@@ -32,17 +32,17 @@
 #include "src/core/lib/surface/call.h"
 #include "src/core/lib/surface/channel_init.h"
 
-static bool is_load_reporting_enabled(const grpc_channel_args *a) {
+static bool is_load_reporting_enabled(const grpc_channel_args* a) {
   return grpc_channel_arg_get_bool(
       grpc_channel_args_find(a, GRPC_ARG_ENABLE_LOAD_REPORTING), false);
 }
 
 static bool maybe_add_server_load_reporting_filter(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder, void *arg) {
-  const grpc_channel_args *args =
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder, void* arg) {
+  const grpc_channel_args* args =
       grpc_channel_stack_builder_get_channel_arguments(builder);
-  const grpc_channel_filter *filter = (const grpc_channel_filter *)arg;
-  grpc_channel_stack_builder_iterator *it =
+  const grpc_channel_filter* filter = (const grpc_channel_filter*)arg;
+  grpc_channel_stack_builder_iterator* it =
       grpc_channel_stack_builder_iterator_find(builder, filter->name);
   const bool already_has_load_reporting_filter =
       !grpc_channel_stack_builder_iterator_is_end(it);
@@ -55,7 +55,7 @@
 }
 
 grpc_arg grpc_load_reporting_enable_arg() {
-  return grpc_channel_arg_integer_create((char *)GRPC_ARG_ENABLE_LOAD_REPORTING,
+  return grpc_channel_arg_integer_create((char*)GRPC_ARG_ENABLE_LOAD_REPORTING,
                                          1);
 }
 
@@ -64,7 +64,7 @@
 extern "C" void grpc_server_load_reporting_plugin_init(void) {
   grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
                                    maybe_add_server_load_reporting_filter,
-                                   (void *)&grpc_server_load_reporting_filter);
+                                   (void*)&grpc_server_load_reporting_filter);
 }
 
 extern "C" void grpc_server_load_reporting_plugin_shutdown() {}
diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h
index 65e254e..a6448ce 100644
--- a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h
+++ b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h
@@ -49,11 +49,11 @@
 
   /** Only valid when \a source is \a GRPC_LR_POINT_CALL_DESTRUCTION, that is,
    * once the call has completed */
-  const grpc_call_final_info *final_info;
+  const grpc_call_final_info* final_info;
 
-  const char *initial_md_string;  /**< value string for LR's initial md key */
-  const char *trailing_md_string; /**< value string for LR's trailing md key */
-  const char *method_name;        /**< Corresponds to :path header */
+  const char* initial_md_string;  /**< value string for LR's initial md key */
+  const char* trailing_md_string; /**< value string for LR's trailing md key */
+  const char* method_name;        /**< Corresponds to :path header */
 } grpc_load_reporting_call_data;
 
 /** Return a \a grpc_arg enabling load reporting */
@@ -64,4 +64,4 @@
 #endif
 
 #endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_PLUGIN_H \
-          */
+        */
diff --git a/src/core/ext/filters/message_size/message_size_filter.cc b/src/core/ext/filters/message_size/message_size_filter.cc
index 5dc131b..9376d97 100644
--- a/src/core/ext/filters/message_size/message_size_filter.cc
+++ b/src/core/ext/filters/message_size/message_size_filter.cc
@@ -30,16 +30,34 @@
 #include "src/core/lib/surface/channel_init.h"
 #include "src/core/lib/transport/service_config.h"
 
-typedef struct message_size_limits {
+typedef struct {
   int max_send_size;
   int max_recv_size;
 } message_size_limits;
 
-static void message_size_limits_free(grpc_exec_ctx* exec_ctx, void* value) {
-  gpr_free(value);
+typedef struct {
+  gpr_refcount refs;
+  message_size_limits limits;
+} refcounted_message_size_limits;
+
+static void* refcounted_message_size_limits_ref(void* value) {
+  refcounted_message_size_limits* limits =
+      (refcounted_message_size_limits*)value;
+  gpr_ref(&limits->refs);
+  return value;
 }
 
-static void* message_size_limits_create_from_json(const grpc_json* json) {
+static void refcounted_message_size_limits_unref(grpc_exec_ctx* exec_ctx,
+                                                 void* value) {
+  refcounted_message_size_limits* limits =
+      (refcounted_message_size_limits*)value;
+  if (gpr_unref(&limits->refs)) {
+    gpr_free(value);
+  }
+}
+
+static void* refcounted_message_size_limits_create_from_json(
+    const grpc_json* json) {
   int max_request_message_bytes = -1;
   int max_response_message_bytes = -1;
   for (grpc_json* field = json->child; field != NULL; field = field->next) {
@@ -60,10 +78,12 @@
       if (max_response_message_bytes == -1) return NULL;
     }
   }
-  message_size_limits* value =
-      (message_size_limits*)gpr_malloc(sizeof(message_size_limits));
-  value->max_send_size = max_request_message_bytes;
-  value->max_recv_size = max_response_message_bytes;
+  refcounted_message_size_limits* value =
+      (refcounted_message_size_limits*)gpr_malloc(
+          sizeof(refcounted_message_size_limits));
+  gpr_ref_init(&value->refs, 1);
+  value->limits.max_send_size = max_request_message_bytes;
+  value->limits.max_recv_size = max_response_message_bytes;
   return value;
 }
 
@@ -82,7 +102,7 @@
 
 typedef struct channel_data {
   message_size_limits limits;
-  // Maps path names to message_size_limits structs.
+  // Maps path names to refcounted_message_size_limits structs.
   grpc_slice_hash_table* method_limit_table;
 } channel_data;
 
@@ -164,19 +184,19 @@
   // size to the receive limit.
   calld->limits = chand->limits;
   if (chand->method_limit_table != NULL) {
-    message_size_limits* limits =
-        (message_size_limits*)grpc_method_config_table_get(
+    refcounted_message_size_limits* limits =
+        (refcounted_message_size_limits*)grpc_method_config_table_get(
             exec_ctx, chand->method_limit_table, args->path);
     if (limits != NULL) {
-      if (limits->max_send_size >= 0 &&
-          (limits->max_send_size < calld->limits.max_send_size ||
+      if (limits->limits.max_send_size >= 0 &&
+          (limits->limits.max_send_size < calld->limits.max_send_size ||
            calld->limits.max_send_size < 0)) {
-        calld->limits.max_send_size = limits->max_send_size;
+        calld->limits.max_send_size = limits->limits.max_send_size;
       }
-      if (limits->max_recv_size >= 0 &&
-          (limits->max_recv_size < calld->limits.max_recv_size ||
+      if (limits->limits.max_recv_size >= 0 &&
+          (limits->limits.max_recv_size < calld->limits.max_recv_size ||
            calld->limits.max_recv_size < 0)) {
-        calld->limits.max_recv_size = limits->max_recv_size;
+        calld->limits.max_recv_size = limits->limits.max_recv_size;
       }
     }
   }
@@ -237,8 +257,10 @@
     if (service_config != NULL) {
       chand->method_limit_table =
           grpc_service_config_create_method_config_table(
-              exec_ctx, service_config, message_size_limits_create_from_json,
-              message_size_limits_free);
+              exec_ctx, service_config,
+              refcounted_message_size_limits_create_from_json,
+              refcounted_message_size_limits_ref,
+              refcounted_message_size_limits_unref);
       grpc_service_config_destroy(service_config);
     }
   }
diff --git a/src/core/ext/filters/workarounds/workaround_utils.cc b/src/core/ext/filters/workarounds/workaround_utils.cc
index e600fbe..9db42fb 100644
--- a/src/core/ext/filters/workarounds/workaround_utils.cc
+++ b/src/core/ext/filters/workarounds/workaround_utils.cc
@@ -21,26 +21,26 @@
 
 user_agent_parser ua_parser[GRPC_MAX_WORKAROUND_ID];
 
-static void destroy_user_agent_md(void *user_agent_md) {
+static void destroy_user_agent_md(void* user_agent_md) {
   gpr_free(user_agent_md);
 }
 
-grpc_workaround_user_agent_md *grpc_parse_user_agent(grpc_mdelem md) {
-  grpc_workaround_user_agent_md *user_agent_md =
-      (grpc_workaround_user_agent_md *)grpc_mdelem_get_user_data(
+grpc_workaround_user_agent_md* grpc_parse_user_agent(grpc_mdelem md) {
+  grpc_workaround_user_agent_md* user_agent_md =
+      (grpc_workaround_user_agent_md*)grpc_mdelem_get_user_data(
           md, destroy_user_agent_md);
 
   if (NULL != user_agent_md) {
     return user_agent_md;
   }
-  user_agent_md = (grpc_workaround_user_agent_md *)gpr_malloc(
+  user_agent_md = (grpc_workaround_user_agent_md*)gpr_malloc(
       sizeof(grpc_workaround_user_agent_md));
   for (int i = 0; i < GRPC_MAX_WORKAROUND_ID; i++) {
     if (ua_parser[i]) {
       user_agent_md->workaround_active[i] = ua_parser[i](md);
     }
   }
-  grpc_mdelem_set_user_data(md, destroy_user_agent_md, (void *)user_agent_md);
+  grpc_mdelem_set_user_data(md, destroy_user_agent_md, (void*)user_agent_md);
 
   return user_agent_md;
 }
diff --git a/src/core/ext/filters/workarounds/workaround_utils.h b/src/core/ext/filters/workarounds/workaround_utils.h
index 3913cae..a954ad4 100644
--- a/src/core/ext/filters/workarounds/workaround_utils.h
+++ b/src/core/ext/filters/workarounds/workaround_utils.h
@@ -32,7 +32,7 @@
   bool workaround_active[GRPC_MAX_WORKAROUND_ID];
 } grpc_workaround_user_agent_md;
 
-grpc_workaround_user_agent_md *grpc_parse_user_agent(grpc_mdelem md);
+grpc_workaround_user_agent_md* grpc_parse_user_agent(grpc_mdelem md);
 
 typedef bool (*user_agent_parser)(grpc_mdelem);
 
diff --git a/src/core/ext/transport/chttp2/alpn/alpn.cc b/src/core/ext/transport/chttp2/alpn/alpn.cc
index ca2e801..8989245 100644
--- a/src/core/ext/transport/chttp2/alpn/alpn.cc
+++ b/src/core/ext/transport/chttp2/alpn/alpn.cc
@@ -21,9 +21,9 @@
 #include <grpc/support/useful.h>
 
 /* in order of preference */
-static const char *const supported_versions[] = {"grpc-exp", "h2"};
+static const char* const supported_versions[] = {"grpc-exp", "h2"};
 
-int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size) {
+int grpc_chttp2_is_alpn_version_supported(const char* version, size_t size) {
   size_t i;
   for (i = 0; i < GPR_ARRAY_SIZE(supported_versions); i++) {
     if (!strncmp(version, supported_versions[i], size)) return 1;
@@ -35,7 +35,7 @@
   return GPR_ARRAY_SIZE(supported_versions);
 }
 
-const char *grpc_chttp2_get_alpn_version_index(size_t i) {
+const char* grpc_chttp2_get_alpn_version_index(size_t i) {
   GPR_ASSERT(i < GPR_ARRAY_SIZE(supported_versions));
   return supported_versions[i];
 }
diff --git a/src/core/ext/transport/chttp2/alpn/alpn.h b/src/core/ext/transport/chttp2/alpn/alpn.h
index 99b928e..4a420e8 100644
--- a/src/core/ext/transport/chttp2/alpn/alpn.h
+++ b/src/core/ext/transport/chttp2/alpn/alpn.h
@@ -26,14 +26,14 @@
 #endif
 
 /* Retuns 1 if the version is supported, 0 otherwise. */
-int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size);
+int grpc_chttp2_is_alpn_version_supported(const char* version, size_t size);
 
 /* Returns the number of protocol versions to advertise */
 size_t grpc_chttp2_num_alpn_versions(void);
 
 /* Returns the protocol version at index i (0 <= i <
  * grpc_chttp2_num_alpn_versions()) */
-const char *grpc_chttp2_get_alpn_version_index(size_t i);
+const char* grpc_chttp2_get_alpn_version_index(size_t i);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/src/core/ext/transport/chttp2/client/chttp2_connector.cc
index 202bcd4..6cd476f 100644
--- a/src/core/ext/transport/chttp2/client/chttp2_connector.cc
+++ b/src/core/ext/transport/chttp2/client/chttp2_connector.cc
@@ -45,25 +45,25 @@
   bool shutdown;
   bool connecting;
 
-  grpc_closure *notify;
+  grpc_closure* notify;
   grpc_connect_in_args args;
-  grpc_connect_out_args *result;
+  grpc_connect_out_args* result;
 
-  grpc_endpoint *endpoint;  // Non-NULL until handshaking starts.
+  grpc_endpoint* endpoint;  // Non-NULL until handshaking starts.
 
   grpc_closure connected;
 
-  grpc_handshake_manager *handshake_mgr;
+  grpc_handshake_manager* handshake_mgr;
 } chttp2_connector;
 
-static void chttp2_connector_ref(grpc_connector *con) {
-  chttp2_connector *c = (chttp2_connector *)con;
+static void chttp2_connector_ref(grpc_connector* con) {
+  chttp2_connector* c = (chttp2_connector*)con;
   gpr_ref(&c->refs);
 }
 
-static void chttp2_connector_unref(grpc_exec_ctx *exec_ctx,
-                                   grpc_connector *con) {
-  chttp2_connector *c = (chttp2_connector *)con;
+static void chttp2_connector_unref(grpc_exec_ctx* exec_ctx,
+                                   grpc_connector* con) {
+  chttp2_connector* c = (chttp2_connector*)con;
   if (gpr_unref(&c->refs)) {
     gpr_mu_destroy(&c->mu);
     // If handshaking is not yet in progress, destroy the endpoint.
@@ -73,9 +73,9 @@
   }
 }
 
-static void chttp2_connector_shutdown(grpc_exec_ctx *exec_ctx,
-                                      grpc_connector *con, grpc_error *why) {
-  chttp2_connector *c = (chttp2_connector *)con;
+static void chttp2_connector_shutdown(grpc_exec_ctx* exec_ctx,
+                                      grpc_connector* con, grpc_error* why) {
+  chttp2_connector* c = (chttp2_connector*)con;
   gpr_mu_lock(&c->mu);
   c->shutdown = true;
   if (c->handshake_mgr != NULL) {
@@ -91,10 +91,10 @@
   GRPC_ERROR_UNREF(why);
 }
 
-static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
-                              grpc_error *error) {
-  grpc_handshaker_args *args = (grpc_handshaker_args *)arg;
-  chttp2_connector *c = (chttp2_connector *)args->user_data;
+static void on_handshake_done(grpc_exec_ctx* exec_ctx, void* arg,
+                              grpc_error* error) {
+  grpc_handshaker_args* args = (grpc_handshaker_args*)arg;
+  chttp2_connector* c = (chttp2_connector*)args->user_data;
   gpr_mu_lock(&c->mu);
   if (error != GRPC_ERROR_NONE || c->shutdown) {
     if (error == GRPC_ERROR_NONE) {
@@ -115,6 +115,8 @@
     }
     memset(c->result, 0, sizeof(*c->result));
   } else {
+    grpc_endpoint_delete_from_pollset_set(exec_ctx, args->endpoint,
+                                          c->args.interested_parties);
     c->result->transport =
         grpc_create_chttp2_transport(exec_ctx, args->args, args->endpoint, 1);
     GPR_ASSERT(c->result->transport);
@@ -122,28 +124,30 @@
                                         args->read_buffer);
     c->result->channel_args = args->args;
   }
-  grpc_closure *notify = c->notify;
+  grpc_closure* notify = c->notify;
   c->notify = NULL;
   GRPC_CLOSURE_SCHED(exec_ctx, notify, error);
   grpc_handshake_manager_destroy(exec_ctx, c->handshake_mgr);
   c->handshake_mgr = NULL;
   gpr_mu_unlock(&c->mu);
-  chttp2_connector_unref(exec_ctx, (grpc_connector *)c);
+  chttp2_connector_unref(exec_ctx, (grpc_connector*)c);
 }
 
-static void start_handshake_locked(grpc_exec_ctx *exec_ctx,
-                                   chttp2_connector *c) {
+static void start_handshake_locked(grpc_exec_ctx* exec_ctx,
+                                   chttp2_connector* c) {
   c->handshake_mgr = grpc_handshake_manager_create();
   grpc_handshakers_add(exec_ctx, HANDSHAKER_CLIENT, c->args.channel_args,
                        c->handshake_mgr);
+  grpc_endpoint_add_to_pollset_set(exec_ctx, c->endpoint,
+                                   c->args.interested_parties);
   grpc_handshake_manager_do_handshake(
       exec_ctx, c->handshake_mgr, c->endpoint, c->args.channel_args,
       c->args.deadline, NULL /* acceptor */, on_handshake_done, c);
   c->endpoint = NULL;  // Endpoint handed off to handshake manager.
 }
 
-static void connected(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  chttp2_connector *c = (chttp2_connector *)arg;
+static void connected(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  chttp2_connector* c = (chttp2_connector*)arg;
   gpr_mu_lock(&c->mu);
   GPR_ASSERT(c->connecting);
   c->connecting = false;
@@ -154,14 +158,14 @@
       error = GRPC_ERROR_REF(error);
     }
     memset(c->result, 0, sizeof(*c->result));
-    grpc_closure *notify = c->notify;
+    grpc_closure* notify = c->notify;
     c->notify = NULL;
     GRPC_CLOSURE_SCHED(exec_ctx, notify, error);
     if (c->endpoint != NULL) {
       grpc_endpoint_shutdown(exec_ctx, c->endpoint, GRPC_ERROR_REF(error));
     }
     gpr_mu_unlock(&c->mu);
-    chttp2_connector_unref(exec_ctx, (grpc_connector *)arg);
+    chttp2_connector_unref(exec_ctx, (grpc_connector*)arg);
   } else {
     GPR_ASSERT(c->endpoint != NULL);
     start_handshake_locked(exec_ctx, c);
@@ -169,12 +173,12 @@
   }
 }
 
-static void chttp2_connector_connect(grpc_exec_ctx *exec_ctx,
-                                     grpc_connector *con,
-                                     const grpc_connect_in_args *args,
-                                     grpc_connect_out_args *result,
-                                     grpc_closure *notify) {
-  chttp2_connector *c = (chttp2_connector *)con;
+static void chttp2_connector_connect(grpc_exec_ctx* exec_ctx,
+                                     grpc_connector* con,
+                                     const grpc_connect_in_args* args,
+                                     grpc_connect_out_args* result,
+                                     grpc_closure* notify) {
+  chttp2_connector* c = (chttp2_connector*)con;
   grpc_resolved_address addr;
   grpc_get_subchannel_address_arg(exec_ctx, args->channel_args, &addr);
   gpr_mu_lock(&c->mu);
@@ -197,8 +201,8 @@
     chttp2_connector_ref, chttp2_connector_unref, chttp2_connector_shutdown,
     chttp2_connector_connect};
 
-grpc_connector *grpc_chttp2_connector_create() {
-  chttp2_connector *c = (chttp2_connector *)gpr_zalloc(sizeof(*c));
+grpc_connector* grpc_chttp2_connector_create() {
+  chttp2_connector* c = (chttp2_connector*)gpr_zalloc(sizeof(*c));
   c->base.vtable = &chttp2_connector_vtable;
   gpr_mu_init(&c->mu);
   gpr_ref_init(&c->refs, 1);
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.cc b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
index 6410a60..26c7f0d 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
@@ -31,37 +31,37 @@
 #include "src/core/lib/surface/channel.h"
 
 static void client_channel_factory_ref(
-    grpc_client_channel_factory *cc_factory) {}
+    grpc_client_channel_factory* cc_factory) {}
 
 static void client_channel_factory_unref(
-    grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory) {}
+    grpc_exec_ctx* exec_ctx, grpc_client_channel_factory* cc_factory) {}
 
-static grpc_subchannel *client_channel_factory_create_subchannel(
-    grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
-    const grpc_subchannel_args *args) {
-  grpc_connector *connector = grpc_chttp2_connector_create();
-  grpc_subchannel *s = grpc_subchannel_create(exec_ctx, connector, args);
+static grpc_subchannel* client_channel_factory_create_subchannel(
+    grpc_exec_ctx* exec_ctx, grpc_client_channel_factory* cc_factory,
+    const grpc_subchannel_args* args) {
+  grpc_connector* connector = grpc_chttp2_connector_create();
+  grpc_subchannel* s = grpc_subchannel_create(exec_ctx, connector, args);
   grpc_connector_unref(exec_ctx, connector);
   return s;
 }
 
-static grpc_channel *client_channel_factory_create_channel(
-    grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
-    const char *target, grpc_client_channel_type type,
-    const grpc_channel_args *args) {
+static grpc_channel* client_channel_factory_create_channel(
+    grpc_exec_ctx* exec_ctx, grpc_client_channel_factory* cc_factory,
+    const char* target, grpc_client_channel_type type,
+    const grpc_channel_args* args) {
   if (target == NULL) {
     gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
     return NULL;
   }
   // Add channel arg containing the server URI.
   grpc_arg arg = grpc_channel_arg_string_create(
-      (char *)GRPC_ARG_SERVER_URI,
+      (char*)GRPC_ARG_SERVER_URI,
       grpc_resolver_factory_add_default_prefix_if_needed(exec_ctx, target));
-  const char *to_remove[] = {GRPC_ARG_SERVER_URI};
-  grpc_channel_args *new_args =
+  const char* to_remove[] = {GRPC_ARG_SERVER_URI};
+  grpc_channel_args* new_args =
       grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
   gpr_free(arg.value.string);
-  grpc_channel *channel = grpc_channel_create(exec_ctx, target, new_args,
+  grpc_channel* channel = grpc_channel_create(exec_ctx, target, new_args,
                                               GRPC_CLIENT_CHANNEL, NULL);
   grpc_channel_args_destroy(exec_ctx, new_args);
   return channel;
@@ -79,9 +79,9 @@
    Asynchronously: - resolve target
                    - connect to it (trying alternatives as presented)
                    - perform handshakes */
-grpc_channel *grpc_insecure_channel_create(const char *target,
-                                           const grpc_channel_args *args,
-                                           void *reserved) {
+grpc_channel* grpc_insecure_channel_create(const char* target,
+                                           const grpc_channel_args* args,
+                                           void* reserved) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GRPC_API_TRACE(
       "grpc_insecure_channel_create(target=%s, args=%p, reserved=%p)", 3,
@@ -90,15 +90,16 @@
   // Add channel arg containing the client channel factory.
   grpc_arg arg =
       grpc_client_channel_factory_create_channel_arg(&client_channel_factory);
-  grpc_channel_args *new_args = grpc_channel_args_copy_and_add(args, &arg, 1);
+  grpc_channel_args* new_args = grpc_channel_args_copy_and_add(args, &arg, 1);
   // Create channel.
-  grpc_channel *channel = client_channel_factory_create_channel(
+  grpc_channel* channel = client_channel_factory_create_channel(
       &exec_ctx, &client_channel_factory, target,
       GRPC_CLIENT_CHANNEL_TYPE_REGULAR, new_args);
   // Clean up.
   grpc_channel_args_destroy(&exec_ctx, new_args);
   grpc_exec_ctx_finish(&exec_ctx);
-  return channel != NULL ? channel : grpc_lame_client_channel_create(
-                                         target, GRPC_STATUS_INTERNAL,
-                                         "Failed to create client channel");
+  return channel != NULL ? channel
+                         : grpc_lame_client_channel_create(
+                               target, GRPC_STATUS_INTERNAL,
+                               "Failed to create client channel");
 }
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc b/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
index dd88136..0974a7c 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@@ -35,42 +35,43 @@
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/transport/transport.h"
 
-grpc_channel *grpc_insecure_channel_create_from_fd(
-    const char *target, int fd, const grpc_channel_args *args) {
+grpc_channel* grpc_insecure_channel_create_from_fd(
+    const char* target, int fd, const grpc_channel_args* args) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GRPC_API_TRACE("grpc_insecure_channel_create(target=%p, fd=%d, args=%p)", 3,
                  (target, fd, args));
 
   grpc_arg default_authority_arg = grpc_channel_arg_string_create(
-      (char *)GRPC_ARG_DEFAULT_AUTHORITY, (char *)"test.authority");
-  grpc_channel_args *final_args =
+      (char*)GRPC_ARG_DEFAULT_AUTHORITY, (char*)"test.authority");
+  grpc_channel_args* final_args =
       grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
 
   int flags = fcntl(fd, F_GETFL, 0);
   GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
 
-  grpc_endpoint *client = grpc_tcp_client_create_from_fd(
+  grpc_endpoint* client = grpc_tcp_client_create_from_fd(
       &exec_ctx, grpc_fd_create(fd, "client"), args, "fd-client");
 
-  grpc_transport *transport =
+  grpc_transport* transport =
       grpc_create_chttp2_transport(&exec_ctx, final_args, client, 1);
   GPR_ASSERT(transport);
-  grpc_channel *channel = grpc_channel_create(
+  grpc_channel* channel = grpc_channel_create(
       &exec_ctx, target, final_args, GRPC_CLIENT_DIRECT_CHANNEL, transport);
   grpc_channel_args_destroy(&exec_ctx, final_args);
   grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
 
   grpc_exec_ctx_finish(&exec_ctx);
 
-  return channel != NULL ? channel : grpc_lame_client_channel_create(
-                                         target, GRPC_STATUS_INTERNAL,
-                                         "Failed to create client channel");
+  return channel != NULL ? channel
+                         : grpc_lame_client_channel_create(
+                               target, GRPC_STATUS_INTERNAL,
+                               "Failed to create client channel");
 }
 
 #else  // !GPR_SUPPORT_CHANNELS_FROM_FD
 
-grpc_channel *grpc_insecure_channel_create_from_fd(
-    const char *target, int fd, const grpc_channel_args *args) {
+grpc_channel* grpc_insecure_channel_create_from_fd(
+    const char* target, int fd, const grpc_channel_args* args) {
   GPR_ASSERT(0);
   return NULL;
 }
diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
index fe296cf..68c1e18 100644
--- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
+++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
@@ -38,14 +38,14 @@
 #include "src/core/lib/surface/channel.h"
 
 static void client_channel_factory_ref(
-    grpc_client_channel_factory *cc_factory) {}
+    grpc_client_channel_factory* cc_factory) {}
 
 static void client_channel_factory_unref(
-    grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory) {}
+    grpc_exec_ctx* exec_ctx, grpc_client_channel_factory* cc_factory) {}
 
-static grpc_subchannel_args *get_secure_naming_subchannel_args(
-    grpc_exec_ctx *exec_ctx, const grpc_subchannel_args *args) {
-  grpc_channel_credentials *channel_credentials =
+static grpc_subchannel_args* get_secure_naming_subchannel_args(
+    grpc_exec_ctx* exec_ctx, const grpc_subchannel_args* args) {
+  grpc_channel_credentials* channel_credentials =
       grpc_channel_credentials_find_in_args(args->args);
   if (channel_credentials == NULL) {
     gpr_log(GPR_ERROR,
@@ -61,33 +61,33 @@
     return NULL;
   }
   // To which address are we connecting? By default, use the server URI.
-  const grpc_arg *server_uri_arg =
+  const grpc_arg* server_uri_arg =
       grpc_channel_args_find(args->args, GRPC_ARG_SERVER_URI);
   GPR_ASSERT(server_uri_arg != NULL);
   GPR_ASSERT(server_uri_arg->type == GRPC_ARG_STRING);
-  const char *server_uri_str = server_uri_arg->value.string;
+  const char* server_uri_str = server_uri_arg->value.string;
   GPR_ASSERT(server_uri_str != NULL);
-  grpc_uri *server_uri =
+  grpc_uri* server_uri =
       grpc_uri_parse(exec_ctx, server_uri_str, true /* supress errors */);
   GPR_ASSERT(server_uri != NULL);
-  const char *server_uri_path;
+  const char* server_uri_path;
   server_uri_path =
       server_uri->path[0] == '/' ? server_uri->path + 1 : server_uri->path;
-  const grpc_slice_hash_table *targets_info =
+  const grpc_slice_hash_table* targets_info =
       grpc_lb_targets_info_find_in_args(args->args);
-  char *target_name_to_check = NULL;
+  char* target_name_to_check = NULL;
   if (targets_info != NULL) {  // LB channel
     // Find the balancer name for the target.
-    const char *target_uri_str =
+    const char* target_uri_str =
         grpc_get_subchannel_address_uri_arg(args->args);
-    grpc_uri *target_uri =
+    grpc_uri* target_uri =
         grpc_uri_parse(exec_ctx, target_uri_str, false /* suppress errors */);
     GPR_ASSERT(target_uri != NULL);
     if (target_uri->path[0] != '\0') {  // "path" may be empty
       const grpc_slice key = grpc_slice_from_static_string(
           target_uri->path[0] == '/' ? target_uri->path + 1 : target_uri->path);
-      const char *value =
-          (const char *)grpc_slice_hash_table_get(targets_info, key);
+      const char* value =
+          (const char*)grpc_slice_hash_table_get(targets_info, key);
       if (value != NULL) target_name_to_check = gpr_strdup(value);
       grpc_slice_unref_internal(exec_ctx, key);
     }
@@ -102,9 +102,9 @@
   }
   grpc_uri_destroy(server_uri);
   GPR_ASSERT(target_name_to_check != NULL);
-  grpc_channel_security_connector *subchannel_security_connector = NULL;
+  grpc_channel_security_connector* subchannel_security_connector = NULL;
   // Create the security connector using the credentials and target name.
-  grpc_channel_args *new_args_from_connector = NULL;
+  grpc_channel_args* new_args_from_connector = NULL;
   const grpc_security_status security_status =
       grpc_channel_credentials_create_security_connector(
           exec_ctx, channel_credentials, target_name_to_check, args->args,
@@ -120,7 +120,7 @@
   grpc_arg new_security_connector_arg =
       grpc_security_connector_to_arg(&subchannel_security_connector->base);
 
-  grpc_channel_args *new_args = grpc_channel_args_copy_and_add(
+  grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
       new_args_from_connector != NULL ? new_args_from_connector : args->args,
       &new_security_connector_arg, 1);
   GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, &subchannel_security_connector->base,
@@ -128,17 +128,17 @@
   if (new_args_from_connector != NULL) {
     grpc_channel_args_destroy(exec_ctx, new_args_from_connector);
   }
-  grpc_subchannel_args *final_sc_args =
-      (grpc_subchannel_args *)gpr_malloc(sizeof(*final_sc_args));
+  grpc_subchannel_args* final_sc_args =
+      (grpc_subchannel_args*)gpr_malloc(sizeof(*final_sc_args));
   memcpy(final_sc_args, args, sizeof(*args));
   final_sc_args->args = new_args;
   return final_sc_args;
 }
 
-static grpc_subchannel *client_channel_factory_create_subchannel(
-    grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
-    const grpc_subchannel_args *args) {
-  grpc_subchannel_args *subchannel_args =
+static grpc_subchannel* client_channel_factory_create_subchannel(
+    grpc_exec_ctx* exec_ctx, grpc_client_channel_factory* cc_factory,
+    const grpc_subchannel_args* args) {
+  grpc_subchannel_args* subchannel_args =
       get_secure_naming_subchannel_args(exec_ctx, args);
   if (subchannel_args == NULL) {
     gpr_log(
@@ -146,33 +146,33 @@
         "Failed to create subchannel arguments during subchannel creation.");
     return NULL;
   }
-  grpc_connector *connector = grpc_chttp2_connector_create();
-  grpc_subchannel *s =
+  grpc_connector* connector = grpc_chttp2_connector_create();
+  grpc_subchannel* s =
       grpc_subchannel_create(exec_ctx, connector, subchannel_args);
   grpc_connector_unref(exec_ctx, connector);
   grpc_channel_args_destroy(exec_ctx,
-                            (grpc_channel_args *)subchannel_args->args);
+                            (grpc_channel_args*)subchannel_args->args);
   gpr_free(subchannel_args);
   return s;
 }
 
-static grpc_channel *client_channel_factory_create_channel(
-    grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
-    const char *target, grpc_client_channel_type type,
-    const grpc_channel_args *args) {
+static grpc_channel* client_channel_factory_create_channel(
+    grpc_exec_ctx* exec_ctx, grpc_client_channel_factory* cc_factory,
+    const char* target, grpc_client_channel_type type,
+    const grpc_channel_args* args) {
   if (target == NULL) {
     gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
     return NULL;
   }
   // Add channel arg containing the server URI.
   grpc_arg arg = grpc_channel_arg_string_create(
-      (char *)GRPC_ARG_SERVER_URI,
+      (char*)GRPC_ARG_SERVER_URI,
       grpc_resolver_factory_add_default_prefix_if_needed(exec_ctx, target));
-  const char *to_remove[] = {GRPC_ARG_SERVER_URI};
-  grpc_channel_args *new_args =
+  const char* to_remove[] = {GRPC_ARG_SERVER_URI};
+  grpc_channel_args* new_args =
       grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
   gpr_free(arg.value.string);
-  grpc_channel *channel = grpc_channel_create(exec_ctx, target, new_args,
+  grpc_channel* channel = grpc_channel_create(exec_ctx, target, new_args,
                                               GRPC_CLIENT_CHANNEL, NULL);
   grpc_channel_args_destroy(exec_ctx, new_args);
   return channel;
@@ -190,24 +190,24 @@
 //   Asynchronously: - resolve target
 //                   - connect to it (trying alternatives as presented)
 //                   - perform handshakes
-grpc_channel *grpc_secure_channel_create(grpc_channel_credentials *creds,
-                                         const char *target,
-                                         const grpc_channel_args *args,
-                                         void *reserved) {
+grpc_channel* grpc_secure_channel_create(grpc_channel_credentials* creds,
+                                         const char* target,
+                                         const grpc_channel_args* args,
+                                         void* reserved) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GRPC_API_TRACE(
       "grpc_secure_channel_create(creds=%p, target=%s, args=%p, "
       "reserved=%p)",
-      4, ((void *)creds, target, (void *)args, (void *)reserved));
+      4, ((void*)creds, target, (void*)args, (void*)reserved));
   GPR_ASSERT(reserved == NULL);
-  grpc_channel *channel = NULL;
+  grpc_channel* channel = NULL;
   if (creds != NULL) {
     // Add channel args containing the client channel factory and channel
     // credentials.
     grpc_arg args_to_add[] = {
         grpc_client_channel_factory_create_channel_arg(&client_channel_factory),
         grpc_channel_credentials_to_arg(creds)};
-    grpc_channel_args *new_args = grpc_channel_args_copy_and_add(
+    grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
         args, args_to_add, GPR_ARRAY_SIZE(args_to_add));
     // Create channel.
     channel = client_channel_factory_create_channel(
diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc
index 7ac7f4e..98683ac 100644
--- a/src/core/ext/transport/chttp2/server/chttp2_server.cc
+++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc
@@ -42,31 +42,31 @@
 #include "src/core/lib/surface/server.h"
 
 typedef struct {
-  grpc_server *server;
-  grpc_tcp_server *tcp_server;
-  grpc_channel_args *args;
+  grpc_server* server;
+  grpc_tcp_server* tcp_server;
+  grpc_channel_args* args;
   gpr_mu mu;
   bool shutdown;
   grpc_closure tcp_server_shutdown_complete;
-  grpc_closure *server_destroy_listener_done;
-  grpc_handshake_manager *pending_handshake_mgrs;
+  grpc_closure* server_destroy_listener_done;
+  grpc_handshake_manager* pending_handshake_mgrs;
 } server_state;
 
 typedef struct {
-  server_state *svr_state;
-  grpc_pollset *accepting_pollset;
-  grpc_tcp_server_acceptor *acceptor;
-  grpc_handshake_manager *handshake_mgr;
+  server_state* svr_state;
+  grpc_pollset* accepting_pollset;
+  grpc_tcp_server_acceptor* acceptor;
+  grpc_handshake_manager* handshake_mgr;
 } server_connection_state;
 
-static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
-                              grpc_error *error) {
-  grpc_handshaker_args *args = (grpc_handshaker_args *)arg;
-  server_connection_state *connection_state =
-      (server_connection_state *)args->user_data;
+static void on_handshake_done(grpc_exec_ctx* exec_ctx, void* arg,
+                              grpc_error* error) {
+  grpc_handshaker_args* args = (grpc_handshaker_args*)arg;
+  server_connection_state* connection_state =
+      (server_connection_state*)args->user_data;
   gpr_mu_lock(&connection_state->svr_state->mu);
   if (error != GRPC_ERROR_NONE || connection_state->svr_state->shutdown) {
-    const char *error_str = grpc_error_string(error);
+    const char* error_str = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "Handshaking failed: %s", error_str);
 
     if (error == GRPC_ERROR_NONE && args->endpoint != NULL) {
@@ -87,7 +87,7 @@
     // handshaker may have handed off the connection to some external
     // code, so we can just clean up here without creating a transport.
     if (args->endpoint != NULL) {
-      grpc_transport *transport =
+      grpc_transport* transport =
           grpc_create_chttp2_transport(exec_ctx, args->args, args->endpoint, 0);
       grpc_server_setup_transport(
           exec_ctx, connection_state->svr_state->server, transport,
@@ -107,10 +107,10 @@
   gpr_free(connection_state);
 }
 
-static void on_accept(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp,
-                      grpc_pollset *accepting_pollset,
-                      grpc_tcp_server_acceptor *acceptor) {
-  server_state *state = (server_state *)arg;
+static void on_accept(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* tcp,
+                      grpc_pollset* accepting_pollset,
+                      grpc_tcp_server_acceptor* acceptor) {
+  server_state* state = (server_state*)arg;
   gpr_mu_lock(&state->mu);
   if (state->shutdown) {
     gpr_mu_unlock(&state->mu);
@@ -119,13 +119,13 @@
     gpr_free(acceptor);
     return;
   }
-  grpc_handshake_manager *handshake_mgr = grpc_handshake_manager_create();
+  grpc_handshake_manager* handshake_mgr = grpc_handshake_manager_create();
   grpc_handshake_manager_pending_list_add(&state->pending_handshake_mgrs,
                                           handshake_mgr);
   gpr_mu_unlock(&state->mu);
   grpc_tcp_server_ref(state->tcp_server);
-  server_connection_state *connection_state =
-      (server_connection_state *)gpr_malloc(sizeof(*connection_state));
+  server_connection_state* connection_state =
+      (server_connection_state*)gpr_malloc(sizeof(*connection_state));
   connection_state->svr_state = state;
   connection_state->accepting_pollset = accepting_pollset;
   connection_state->acceptor = acceptor;
@@ -142,10 +142,10 @@
 }
 
 /* Server callback: start listening on our ports */
-static void server_start_listener(grpc_exec_ctx *exec_ctx, grpc_server *server,
-                                  void *arg, grpc_pollset **pollsets,
+static void server_start_listener(grpc_exec_ctx* exec_ctx, grpc_server* server,
+                                  void* arg, grpc_pollset** pollsets,
                                   size_t pollset_count) {
-  server_state *state = (server_state *)arg;
+  server_state* state = (server_state*)arg;
   gpr_mu_lock(&state->mu);
   state->shutdown = false;
   gpr_mu_unlock(&state->mu);
@@ -153,12 +153,12 @@
                         on_accept, state);
 }
 
-static void tcp_server_shutdown_complete(grpc_exec_ctx *exec_ctx, void *arg,
-                                         grpc_error *error) {
-  server_state *state = (server_state *)arg;
+static void tcp_server_shutdown_complete(grpc_exec_ctx* exec_ctx, void* arg,
+                                         grpc_error* error) {
+  server_state* state = (server_state*)arg;
   /* ensure all threads have unlocked */
   gpr_mu_lock(&state->mu);
-  grpc_closure *destroy_done = state->server_destroy_listener_done;
+  grpc_closure* destroy_done = state->server_destroy_listener_done;
   GPR_ASSERT(state->shutdown);
   grpc_handshake_manager_pending_list_shutdown_all(
       exec_ctx, state->pending_handshake_mgrs, GRPC_ERROR_REF(error));
@@ -177,31 +177,31 @@
 
 /* Server callback: destroy the tcp listener (so we don't generate further
    callbacks) */
-static void server_destroy_listener(grpc_exec_ctx *exec_ctx,
-                                    grpc_server *server, void *arg,
-                                    grpc_closure *destroy_done) {
-  server_state *state = (server_state *)arg;
+static void server_destroy_listener(grpc_exec_ctx* exec_ctx,
+                                    grpc_server* server, void* arg,
+                                    grpc_closure* destroy_done) {
+  server_state* state = (server_state*)arg;
   gpr_mu_lock(&state->mu);
   state->shutdown = true;
   state->server_destroy_listener_done = destroy_done;
-  grpc_tcp_server *tcp_server = state->tcp_server;
+  grpc_tcp_server* tcp_server = state->tcp_server;
   gpr_mu_unlock(&state->mu);
   grpc_tcp_server_shutdown_listeners(exec_ctx, tcp_server);
   grpc_tcp_server_unref(exec_ctx, tcp_server);
 }
 
-grpc_error *grpc_chttp2_server_add_port(grpc_exec_ctx *exec_ctx,
-                                        grpc_server *server, const char *addr,
-                                        grpc_channel_args *args,
-                                        int *port_num) {
-  grpc_resolved_addresses *resolved = NULL;
-  grpc_tcp_server *tcp_server = NULL;
+grpc_error* grpc_chttp2_server_add_port(grpc_exec_ctx* exec_ctx,
+                                        grpc_server* server, const char* addr,
+                                        grpc_channel_args* args,
+                                        int* port_num) {
+  grpc_resolved_addresses* resolved = NULL;
+  grpc_tcp_server* tcp_server = NULL;
   size_t i;
   size_t count = 0;
   int port_temp;
-  grpc_error *err = GRPC_ERROR_NONE;
-  server_state *state = NULL;
-  grpc_error **errors = NULL;
+  grpc_error* err = GRPC_ERROR_NONE;
+  server_state* state = NULL;
+  grpc_error** errors = NULL;
   size_t naddrs = 0;
 
   *port_num = -1;
@@ -211,7 +211,7 @@
   if (err != GRPC_ERROR_NONE) {
     goto error;
   }
-  state = (server_state *)gpr_zalloc(sizeof(*state));
+  state = (server_state*)gpr_zalloc(sizeof(*state));
   GRPC_CLOSURE_INIT(&state->tcp_server_shutdown_complete,
                     tcp_server_shutdown_complete, state,
                     grpc_schedule_on_exec_ctx);
@@ -228,7 +228,7 @@
   gpr_mu_init(&state->mu);
 
   naddrs = resolved->naddrs;
-  errors = (grpc_error **)gpr_malloc(sizeof(*errors) * naddrs);
+  errors = (grpc_error**)gpr_malloc(sizeof(*errors) * naddrs);
   for (i = 0; i < naddrs; i++) {
     errors[i] =
         grpc_tcp_server_add_port(tcp_server, &resolved->addrs[i], &port_temp);
@@ -242,21 +242,22 @@
     }
   }
   if (count == 0) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "No address added out of total %" PRIuPTR " resolved",
                  naddrs);
     err = GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(msg, errors, naddrs);
     gpr_free(msg);
     goto error;
   } else if (count != naddrs) {
-    char *msg;
-    gpr_asprintf(&msg, "Only %" PRIuPTR
-                       " addresses added out of total %" PRIuPTR " resolved",
+    char* msg;
+    gpr_asprintf(&msg,
+                 "Only %" PRIuPTR " addresses added out of total %" PRIuPTR
+                 " resolved",
                  count, naddrs);
     err = GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(msg, errors, naddrs);
     gpr_free(msg);
 
-    const char *warning_message = grpc_error_string(err);
+    const char* warning_message = grpc_error_string(err);
     gpr_log(GPR_INFO, "WARNING: %s", warning_message);
 
     /* we managed to bind some addresses: continue */
diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.h b/src/core/ext/transport/chttp2/server/chttp2_server.h
index 2ac1551..4e0e7aa 100644
--- a/src/core/ext/transport/chttp2/server/chttp2_server.h
+++ b/src/core/ext/transport/chttp2/server/chttp2_server.h
@@ -29,9 +29,9 @@
 
 /// Adds a port to \a server.  Sets \a port_num to the port number.
 /// Takes ownership of \a args.
-grpc_error *grpc_chttp2_server_add_port(grpc_exec_ctx *exec_ctx,
-                                        grpc_server *server, const char *addr,
-                                        grpc_channel_args *args, int *port_num);
+grpc_error* grpc_chttp2_server_add_port(grpc_exec_ctx* exec_ctx,
+                                        grpc_server* server, const char* addr,
+                                        grpc_channel_args* args, int* port_num);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
index d42b2d1..8984896 100644
--- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
+++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
@@ -25,16 +25,16 @@
 #include "src/core/lib/surface/api_trace.h"
 #include "src/core/lib/surface/server.h"
 
-int grpc_server_add_insecure_http2_port(grpc_server *server, const char *addr) {
+int grpc_server_add_insecure_http2_port(grpc_server* server, const char* addr) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   int port_num = 0;
   GRPC_API_TRACE("grpc_server_add_insecure_http2_port(server=%p, addr=%s)", 2,
                  (server, addr));
-  grpc_error *err = grpc_chttp2_server_add_port(
+  grpc_error* err = grpc_chttp2_server_add_port(
       &exec_ctx, server, addr,
       grpc_channel_args_copy(grpc_server_get_channel_args(server)), &port_num);
   if (err != GRPC_ERROR_NONE) {
-    const char *msg = grpc_error_string(err);
+    const char* msg = grpc_error_string(err);
     gpr_log(GPR_ERROR, "%s", msg);
 
     GRPC_ERROR_UNREF(err);
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
index e647067..e37d69e 100644
--- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
+++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
@@ -34,25 +34,25 @@
 #include "src/core/lib/surface/completion_queue.h"
 #include "src/core/lib/surface/server.h"
 
-void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
-                                              void *reserved, int fd) {
+void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
+                                              void* reserved, int fd) {
   GPR_ASSERT(reserved == NULL);
 
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  char *name;
+  char* name;
   gpr_asprintf(&name, "fd:%d", fd);
 
-  grpc_endpoint *server_endpoint =
+  grpc_endpoint* server_endpoint =
       grpc_tcp_create(&exec_ctx, grpc_fd_create(fd, name),
                       grpc_server_get_channel_args(server), name);
 
   gpr_free(name);
 
-  const grpc_channel_args *server_args = grpc_server_get_channel_args(server);
-  grpc_transport *transport = grpc_create_chttp2_transport(
+  const grpc_channel_args* server_args = grpc_server_get_channel_args(server);
+  grpc_transport* transport = grpc_create_chttp2_transport(
       &exec_ctx, server_args, server_endpoint, 0 /* is_client */);
 
-  grpc_pollset **pollsets;
+  grpc_pollset** pollsets;
   size_t num_pollsets = 0;
   grpc_server_get_pollsets(server, &pollsets, &num_pollsets);
 
@@ -67,8 +67,8 @@
 
 #else  // !GPR_SUPPORT_CHANNELS_FROM_FD
 
-void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
-                                              void *reserved, int fd) {
+void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
+                                              void* reserved, int fd) {
   GPR_ASSERT(0);
 }
 
diff --git a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
index e74a138..4b2e348 100644
--- a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
+++ b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
@@ -34,14 +34,14 @@
 #include "src/core/lib/surface/api_trace.h"
 #include "src/core/lib/surface/server.h"
 
-int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
-                                      grpc_server_credentials *creds) {
+int grpc_server_add_secure_http2_port(grpc_server* server, const char* addr,
+                                      grpc_server_credentials* creds) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_error *err = GRPC_ERROR_NONE;
-  grpc_server_security_connector *sc = NULL;
+  grpc_error* err = GRPC_ERROR_NONE;
+  grpc_server_security_connector* sc = NULL;
   int port_num = 0;
   grpc_security_status status;
-  grpc_channel_args *args = NULL;
+  grpc_channel_args* args = NULL;
   GRPC_API_TRACE(
       "grpc_server_add_secure_http2_port("
       "server=%p, addr=%s, creds=%p)",
@@ -55,7 +55,7 @@
   status =
       grpc_server_credentials_create_security_connector(&exec_ctx, creds, &sc);
   if (status != GRPC_SECURITY_OK) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg,
                  "Unable to create secure server with credentials of type %s.",
                  creds->type);
@@ -79,7 +79,7 @@
   }
   grpc_exec_ctx_finish(&exec_ctx);
   if (err != GRPC_ERROR_NONE) {
-    const char *msg = grpc_error_string(err);
+    const char* msg = grpc_error_string(err);
     gpr_log(GPR_ERROR, "%s", msg);
 
     GRPC_ERROR_UNREF(err);
diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.cc b/src/core/ext/transport/chttp2/transport/bin_decoder.cc
index 5a99cbe..3ccae7a 100644
--- a/src/core/ext/transport/chttp2/transport/bin_decoder.cc
+++ b/src/core/ext/transport/chttp2/transport/bin_decoder.cc
@@ -49,7 +49,7 @@
 
 static const uint8_t tail_xtra[4] = {0, 0, 1, 2};
 
-static bool input_is_valid(uint8_t *input_ptr, size_t length) {
+static bool input_is_valid(uint8_t* input_ptr, size_t length) {
   size_t i;
 
   for (i = 0; i < length; ++i) {
@@ -75,7 +75,7 @@
 #define COMPOSE_OUTPUT_BYTE_2(input_ptr) \
   (uint8_t)((decode_table[input_ptr[2]] << 6) | decode_table[input_ptr[3]])
 
-bool grpc_base64_decode_partial(struct grpc_base64_decode_context *ctx) {
+bool grpc_base64_decode_partial(struct grpc_base64_decode_context* ctx) {
   size_t input_tail;
 
   if (ctx->input_cur > ctx->input_end || ctx->output_cur > ctx->output_end) {
@@ -130,7 +130,7 @@
   return true;
 }
 
-grpc_slice grpc_chttp2_base64_decode(grpc_exec_ctx *exec_ctx,
+grpc_slice grpc_chttp2_base64_decode(grpc_exec_ctx* exec_ctx,
                                      grpc_slice input) {
   size_t input_length = GRPC_SLICE_LENGTH(input);
   size_t output_length = input_length / 4 * 3;
@@ -147,7 +147,7 @@
   }
 
   if (input_length > 0) {
-    uint8_t *input_end = GRPC_SLICE_END_PTR(input);
+    uint8_t* input_end = GRPC_SLICE_END_PTR(input);
     if (*(--input_end) == '=') {
       output_length--;
       if (*(--input_end) == '=') {
@@ -164,7 +164,7 @@
   ctx.contains_tail = false;
 
   if (!grpc_base64_decode_partial(&ctx)) {
-    char *s = grpc_slice_to_c_string(input);
+    char* s = grpc_slice_to_c_string(input);
     gpr_log(GPR_ERROR, "Base64 decoding failed, input string:\n%s\n", s);
     gpr_free(s);
     grpc_slice_unref_internal(exec_ctx, output);
@@ -175,7 +175,7 @@
   return output;
 }
 
-grpc_slice grpc_chttp2_base64_decode_with_length(grpc_exec_ctx *exec_ctx,
+grpc_slice grpc_chttp2_base64_decode_with_length(grpc_exec_ctx* exec_ctx,
                                                  grpc_slice input,
                                                  size_t output_length) {
   size_t input_length = GRPC_SLICE_LENGTH(input);
@@ -210,7 +210,7 @@
   ctx.contains_tail = true;
 
   if (!grpc_base64_decode_partial(&ctx)) {
-    char *s = grpc_slice_to_c_string(input);
+    char* s = grpc_slice_to_c_string(input);
     gpr_log(GPR_ERROR, "Base64 decoding failed, input string:\n%s\n", s);
     gpr_free(s);
     grpc_slice_unref_internal(exec_ctx, output);
diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.h b/src/core/ext/transport/chttp2/transport/bin_decoder.h
index 1c0b2b7..a9c4c9a 100644
--- a/src/core/ext/transport/chttp2/transport/bin_decoder.h
+++ b/src/core/ext/transport/chttp2/transport/bin_decoder.h
@@ -28,10 +28,10 @@
 
 struct grpc_base64_decode_context {
   /* input/output: */
-  uint8_t *input_cur;
-  uint8_t *input_end;
-  uint8_t *output_cur;
-  uint8_t *output_end;
+  uint8_t* input_cur;
+  uint8_t* input_end;
+  uint8_t* output_cur;
+  uint8_t* output_end;
   /* Indicate if the decoder should handle the tail of input data*/
   bool contains_tail;
 };
@@ -40,16 +40,16 @@
    or output_end is reached. When input_end is reached, (input_end - input_cur)
    is less than 4. When output_end is reached, (output_end - output_cur) is less
    than 3. Returns false if decoding is failed. */
-bool grpc_base64_decode_partial(struct grpc_base64_decode_context *ctx);
+bool grpc_base64_decode_partial(struct grpc_base64_decode_context* ctx);
 
 /* base64 decode a slice with pad chars. Returns a new slice, does not take
    ownership of the input. Returns an empty slice if decoding is failed. */
-grpc_slice grpc_chttp2_base64_decode(grpc_exec_ctx *exec_ctx, grpc_slice input);
+grpc_slice grpc_chttp2_base64_decode(grpc_exec_ctx* exec_ctx, grpc_slice input);
 
 /* base64 decode a slice without pad chars, data length is needed. Returns a new
    slice, does not take ownership of the input. Returns an empty slice if
    decoding is failed. */
-grpc_slice grpc_chttp2_base64_decode_with_length(grpc_exec_ctx *exec_ctx,
+grpc_slice grpc_chttp2_base64_decode_with_length(grpc_exec_ctx* exec_ctx,
                                                  grpc_slice input,
                                                  size_t output_length);
 
diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.cc b/src/core/ext/transport/chttp2/transport/bin_encoder.cc
index 42d481b..09f984d 100644
--- a/src/core/ext/transport/chttp2/transport/bin_encoder.cc
+++ b/src/core/ext/transport/chttp2/transport/bin_encoder.cc
@@ -52,8 +52,8 @@
   size_t tail_case = input_length % 3;
   size_t output_length = input_triplets * 4 + tail_xtra[tail_case];
   grpc_slice output = GRPC_SLICE_MALLOC(output_length);
-  uint8_t *in = GRPC_SLICE_START_PTR(input);
-  char *out = (char *)GRPC_SLICE_START_PTR(output);
+  uint8_t* in = GRPC_SLICE_START_PTR(input);
+  char* out = (char*)GRPC_SLICE_START_PTR(output);
   size_t i;
 
   /* encode full triplets */
@@ -85,15 +85,15 @@
       break;
   }
 
-  GPR_ASSERT(out == (char *)GRPC_SLICE_END_PTR(output));
+  GPR_ASSERT(out == (char*)GRPC_SLICE_END_PTR(output));
   GPR_ASSERT(in == GRPC_SLICE_END_PTR(input));
   return output;
 }
 
 grpc_slice grpc_chttp2_huffman_compress(grpc_slice input) {
   size_t nbits;
-  uint8_t *in;
-  uint8_t *out;
+  uint8_t* in;
+  uint8_t* out;
   grpc_slice output;
   uint32_t temp = 0;
   uint32_t temp_length = 0;
@@ -136,17 +136,17 @@
 typedef struct {
   uint32_t temp;
   uint32_t temp_length;
-  uint8_t *out;
+  uint8_t* out;
 } huff_out;
 
-static void enc_flush_some(huff_out *out) {
+static void enc_flush_some(huff_out* out) {
   while (out->temp_length > 8) {
     out->temp_length -= 8;
     *out->out++ = (uint8_t)(out->temp >> out->temp_length);
   }
 }
 
-static void enc_add2(huff_out *out, uint8_t a, uint8_t b) {
+static void enc_add2(huff_out* out, uint8_t a, uint8_t b) {
   b64_huff_sym sa = huff_alphabet[a];
   b64_huff_sym sb = huff_alphabet[b];
   out->temp = (out->temp << (sa.length + sb.length)) |
@@ -155,7 +155,7 @@
   enc_flush_some(out);
 }
 
-static void enc_add1(huff_out *out, uint8_t a) {
+static void enc_add1(huff_out* out, uint8_t a) {
   b64_huff_sym sa = huff_alphabet[a];
   out->temp = (out->temp << sa.length) | sa.bits;
   out->temp_length += sa.length;
@@ -170,8 +170,8 @@
   size_t max_output_bits = 11 * output_syms;
   size_t max_output_length = max_output_bits / 8 + (max_output_bits % 8 != 0);
   grpc_slice output = GRPC_SLICE_MALLOC(max_output_length);
-  uint8_t *in = GRPC_SLICE_START_PTR(input);
-  uint8_t *start_out = GRPC_SLICE_START_PTR(output);
+  uint8_t* in = GRPC_SLICE_START_PTR(input);
+  uint8_t* start_out = GRPC_SLICE_START_PTR(output);
   huff_out out;
   size_t i;
 
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index de62995..a6ec7bb 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -92,98 +92,99 @@
 #define MAX_CLIENT_STREAM_ID 0x7fffffffu
 grpc_core::TraceFlag grpc_http_trace(false, "http");
 
-grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount(false,
-                                                         "chttp2_refcount");
+#ifndef NDEBUG
+grpc_core::TraceFlag grpc_trace_chttp2_refcount(false, "chttp2_refcount");
+#endif
 
 /* forward declarations of various callbacks that we'll build closures around */
-static void write_action_begin_locked(grpc_exec_ctx *exec_ctx, void *t,
-                                      grpc_error *error);
-static void write_action(grpc_exec_ctx *exec_ctx, void *t, grpc_error *error);
-static void write_action_end_locked(grpc_exec_ctx *exec_ctx, void *t,
-                                    grpc_error *error);
+static void write_action_begin_locked(grpc_exec_ctx* exec_ctx, void* t,
+                                      grpc_error* error);
+static void write_action(grpc_exec_ctx* exec_ctx, void* t, grpc_error* error);
+static void write_action_end_locked(grpc_exec_ctx* exec_ctx, void* t,
+                                    grpc_error* error);
 
-static void read_action_locked(grpc_exec_ctx *exec_ctx, void *t,
-                               grpc_error *error);
+static void read_action_locked(grpc_exec_ctx* exec_ctx, void* t,
+                               grpc_error* error);
 
-static void complete_fetch_locked(grpc_exec_ctx *exec_ctx, void *gs,
-                                  grpc_error *error);
+static void complete_fetch_locked(grpc_exec_ctx* exec_ctx, void* gs,
+                                  grpc_error* error);
 /** Set a transport level setting, and push it to our peer */
-static void queue_setting_update(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_transport *t,
+static void queue_setting_update(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_transport* t,
                                  grpc_chttp2_setting_id id, uint32_t value);
 
-static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                           grpc_chttp2_stream *s, grpc_error *error);
+static void close_from_api(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                           grpc_chttp2_stream* s, grpc_error* error);
 
 /** Start new streams that have been created if we can */
-static void maybe_start_some_streams(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t);
+static void maybe_start_some_streams(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t);
 
-static void connectivity_state_set(grpc_exec_ctx *exec_ctx,
-                                   grpc_chttp2_transport *t,
+static void connectivity_state_set(grpc_exec_ctx* exec_ctx,
+                                   grpc_chttp2_transport* t,
                                    grpc_connectivity_state state,
-                                   grpc_error *error, const char *reason);
+                                   grpc_error* error, const char* reason);
 
-static void incoming_byte_stream_destroy_locked(grpc_exec_ctx *exec_ctx,
-                                                void *byte_stream,
-                                                grpc_error *error_ignored);
+static void incoming_byte_stream_destroy_locked(grpc_exec_ctx* exec_ctx,
+                                                void* byte_stream,
+                                                grpc_error* error_ignored);
 static void incoming_byte_stream_publish_error(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs,
-    grpc_error *error);
-static void incoming_byte_stream_unref(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_incoming_byte_stream *bs);
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_byte_stream* bs,
+    grpc_error* error);
+static void incoming_byte_stream_unref(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_incoming_byte_stream* bs);
 
-static void benign_reclaimer_locked(grpc_exec_ctx *exec_ctx, void *t,
-                                    grpc_error *error);
-static void destructive_reclaimer_locked(grpc_exec_ctx *exec_ctx, void *t,
-                                         grpc_error *error);
+static void benign_reclaimer_locked(grpc_exec_ctx* exec_ctx, void* t,
+                                    grpc_error* error);
+static void destructive_reclaimer_locked(grpc_exec_ctx* exec_ctx, void* t,
+                                         grpc_error* error);
 
-static void post_benign_reclaimer(grpc_exec_ctx *exec_ctx,
-                                  grpc_chttp2_transport *t);
-static void post_destructive_reclaimer(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_transport *t);
+static void post_benign_reclaimer(grpc_exec_ctx* exec_ctx,
+                                  grpc_chttp2_transport* t);
+static void post_destructive_reclaimer(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_transport* t);
 
-static void close_transport_locked(grpc_exec_ctx *exec_ctx,
-                                   grpc_chttp2_transport *t, grpc_error *error);
-static void end_all_the_calls(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                              grpc_error *error);
+static void close_transport_locked(grpc_exec_ctx* exec_ctx,
+                                   grpc_chttp2_transport* t, grpc_error* error);
+static void end_all_the_calls(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                              grpc_error* error);
 
-static void schedule_bdp_ping_locked(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t);
-static void start_bdp_ping_locked(grpc_exec_ctx *exec_ctx, void *tp,
-                                  grpc_error *error);
-static void finish_bdp_ping_locked(grpc_exec_ctx *exec_ctx, void *tp,
-                                   grpc_error *error);
-static void next_bdp_ping_timer_expired_locked(grpc_exec_ctx *exec_ctx,
-                                               void *tp, grpc_error *error);
+static void schedule_bdp_ping_locked(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t);
+static void start_bdp_ping_locked(grpc_exec_ctx* exec_ctx, void* tp,
+                                  grpc_error* error);
+static void finish_bdp_ping_locked(grpc_exec_ctx* exec_ctx, void* tp,
+                                   grpc_error* error);
+static void next_bdp_ping_timer_expired_locked(grpc_exec_ctx* exec_ctx,
+                                               void* tp, grpc_error* error);
 
-static void cancel_pings(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                         grpc_error *error);
-static void send_ping_locked(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                             grpc_closure *on_initiate,
-                             grpc_closure *on_complete);
-static void retry_initiate_ping_locked(grpc_exec_ctx *exec_ctx, void *tp,
-                                       grpc_error *error);
+static void cancel_pings(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                         grpc_error* error);
+static void send_ping_locked(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                             grpc_closure* on_initiate,
+                             grpc_closure* on_complete);
+static void retry_initiate_ping_locked(grpc_exec_ctx* exec_ctx, void* tp,
+                                       grpc_error* error);
 
 /** keepalive-relevant functions */
-static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                       grpc_error *error);
-static void start_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error);
-static void finish_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                         grpc_error *error);
-static void keepalive_watchdog_fired_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                            grpc_error *error);
+static void init_keepalive_ping_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                       grpc_error* error);
+static void start_keepalive_ping_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error);
+static void finish_keepalive_ping_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                         grpc_error* error);
+static void keepalive_watchdog_fired_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                            grpc_error* error);
 
-static void reset_byte_stream(grpc_exec_ctx *exec_ctx, void *arg,
-                              grpc_error *error);
+static void reset_byte_stream(grpc_exec_ctx* exec_ctx, void* arg,
+                              grpc_error* error);
 
 /*******************************************************************************
  * CONSTRUCTION/DESTRUCTION/REFCOUNTING
  */
 
-static void destruct_transport(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_transport *t) {
+static void destruct_transport(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_transport* t) {
   size_t i;
 
   grpc_endpoint_destroy(exec_ctx, t->ep);
@@ -202,6 +203,8 @@
     GPR_ASSERT(t->lists[i].tail == NULL);
   }
 
+  GRPC_ERROR_UNREF(t->goaway_error);
+
   GPR_ASSERT(grpc_chttp2_stream_map_size(&t->stream_map) == 0);
 
   grpc_chttp2_stream_map_destroy(&t->stream_map);
@@ -213,7 +216,7 @@
                GRPC_ERROR_CREATE_FROM_STATIC_STRING("Transport destroyed"));
 
   while (t->write_cb_pool) {
-    grpc_chttp2_write_cb *next = t->write_cb_pool->next;
+    grpc_chttp2_write_cb* next = t->write_cb_pool->next;
     gpr_free(t->write_cb_pool);
     t->write_cb_pool = next;
   }
@@ -227,9 +230,9 @@
 }
 
 #ifndef NDEBUG
-void grpc_chttp2_unref_transport(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_transport *t, const char *reason,
-                                 const char *file, int line) {
+void grpc_chttp2_unref_transport(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_transport* t, const char* reason,
+                                 const char* file, int line) {
   if (grpc_trace_chttp2_refcount.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&t->refs.count);
     gpr_log(GPR_DEBUG, "chttp2:unref:%p %" PRIdPTR "->%" PRIdPTR " %s [%s:%d]",
@@ -239,8 +242,8 @@
   destruct_transport(exec_ctx, t);
 }
 
-void grpc_chttp2_ref_transport(grpc_chttp2_transport *t, const char *reason,
-                               const char *file, int line) {
+void grpc_chttp2_ref_transport(grpc_chttp2_transport* t, const char* reason,
+                               const char* file, int line) {
   if (grpc_trace_chttp2_refcount.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&t->refs.count);
     gpr_log(GPR_DEBUG, "chttp2:  ref:%p %" PRIdPTR "->%" PRIdPTR " %s [%s:%d]",
@@ -249,20 +252,20 @@
   gpr_ref(&t->refs);
 }
 #else
-void grpc_chttp2_unref_transport(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_transport *t) {
+void grpc_chttp2_unref_transport(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_transport* t) {
   if (!gpr_unref(&t->refs)) return;
   destruct_transport(exec_ctx, t);
 }
 
-void grpc_chttp2_ref_transport(grpc_chttp2_transport *t) { gpr_ref(&t->refs); }
+void grpc_chttp2_ref_transport(grpc_chttp2_transport* t) { gpr_ref(&t->refs); }
 #endif
 
-static const grpc_transport_vtable *get_vtable(void);
+static const grpc_transport_vtable* get_vtable(void);
 
-static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                           const grpc_channel_args *channel_args,
-                           grpc_endpoint *ep, bool is_client) {
+static void init_transport(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                           const grpc_channel_args* channel_args,
+                           grpc_endpoint* ep, bool is_client) {
   size_t i;
   int j;
 
@@ -317,6 +320,7 @@
                     keepalive_watchdog_fired_locked, t,
                     grpc_combiner_scheduler(t->combiner));
 
+  t->goaway_error = GRPC_ERROR_NONE;
   grpc_chttp2_goaway_parser_init(&t->goaway_parser);
   grpc_chttp2_hpack_parser_init(exec_ctx, &t->hpack_parser);
 
@@ -491,7 +495,7 @@
         }
       } else {
         static const struct {
-          const char *channel_arg_name;
+          const char* channel_arg_name;
           grpc_chttp2_setting_id setting_id;
           grpc_integer_options integer_options;
           bool availability[2] /* server, client */;
@@ -577,9 +581,9 @@
   post_benign_reclaimer(exec_ctx, t);
 }
 
-static void destroy_transport_locked(grpc_exec_ctx *exec_ctx, void *tp,
-                                     grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)tp;
+static void destroy_transport_locked(grpc_exec_ctx* exec_ctx, void* tp,
+                                     grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)tp;
   t->destroying = 1;
   close_transport_locked(
       exec_ctx, t,
@@ -589,17 +593,17 @@
   GRPC_CHTTP2_UNREF_TRANSPORT(exec_ctx, t, "destroy");
 }
 
-static void destroy_transport(grpc_exec_ctx *exec_ctx, grpc_transport *gt) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
+static void destroy_transport(grpc_exec_ctx* exec_ctx, grpc_transport* gt) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)gt;
   GRPC_CLOSURE_SCHED(exec_ctx,
                      GRPC_CLOSURE_CREATE(destroy_transport_locked, t,
                                          grpc_combiner_scheduler(t->combiner)),
                      GRPC_ERROR_NONE);
 }
 
-static void close_transport_locked(grpc_exec_ctx *exec_ctx,
-                                   grpc_chttp2_transport *t,
-                                   grpc_error *error) {
+static void close_transport_locked(grpc_exec_ctx* exec_ctx,
+                                   grpc_chttp2_transport* t,
+                                   grpc_error* error) {
   end_all_the_calls(exec_ctx, t, GRPC_ERROR_REF(error));
   cancel_pings(exec_ctx, t, GRPC_ERROR_REF(error));
   if (t->closed_with_error == GRPC_ERROR_NONE) {
@@ -642,7 +646,7 @@
     }
 
     /* flush writable stream list to avoid dangling references */
-    grpc_chttp2_stream *s;
+    grpc_chttp2_stream* s;
     while (grpc_chttp2_list_pop_writable_stream(t, &s)) {
       GRPC_CHTTP2_STREAM_UNREF(exec_ctx, s, "chttp2_writing:close");
     }
@@ -653,28 +657,28 @@
 }
 
 #ifndef NDEBUG
-void grpc_chttp2_stream_ref(grpc_chttp2_stream *s, const char *reason) {
+void grpc_chttp2_stream_ref(grpc_chttp2_stream* s, const char* reason) {
   grpc_stream_ref(s->refcount, reason);
 }
-void grpc_chttp2_stream_unref(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream *s,
-                              const char *reason) {
+void grpc_chttp2_stream_unref(grpc_exec_ctx* exec_ctx, grpc_chttp2_stream* s,
+                              const char* reason) {
   grpc_stream_unref(exec_ctx, s->refcount, reason);
 }
 #else
-void grpc_chttp2_stream_ref(grpc_chttp2_stream *s) {
+void grpc_chttp2_stream_ref(grpc_chttp2_stream* s) {
   grpc_stream_ref(s->refcount);
 }
-void grpc_chttp2_stream_unref(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream *s) {
+void grpc_chttp2_stream_unref(grpc_exec_ctx* exec_ctx, grpc_chttp2_stream* s) {
   grpc_stream_unref(exec_ctx, s->refcount);
 }
 #endif
 
-static int init_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                       grpc_stream *gs, grpc_stream_refcount *refcount,
-                       const void *server_data, gpr_arena *arena) {
+static int init_stream(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                       grpc_stream* gs, grpc_stream_refcount* refcount,
+                       const void* server_data, gpr_arena* arena) {
   GPR_TIMER_BEGIN("init_stream", 0);
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
-  grpc_chttp2_stream *s = (grpc_chttp2_stream *)gs;
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)gt;
+  grpc_chttp2_stream* s = (grpc_chttp2_stream*)gs;
 
   s->t = t;
   s->refcount = refcount;
@@ -714,10 +718,10 @@
   return 0;
 }
 
-static void destroy_stream_locked(grpc_exec_ctx *exec_ctx, void *sp,
-                                  grpc_error *error) {
-  grpc_chttp2_stream *s = (grpc_chttp2_stream *)sp;
-  grpc_chttp2_transport *t = s->t;
+static void destroy_stream_locked(grpc_exec_ctx* exec_ctx, void* sp,
+                                  grpc_error* error) {
+  grpc_chttp2_stream* s = (grpc_chttp2_stream*)sp;
+  grpc_chttp2_transport* t = s->t;
 
   GPR_TIMER_BEGIN("destroy_stream", 0);
 
@@ -768,12 +772,12 @@
   GRPC_CLOSURE_SCHED(exec_ctx, s->destroy_stream_arg, GRPC_ERROR_NONE);
 }
 
-static void destroy_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                           grpc_stream *gs,
-                           grpc_closure *then_schedule_closure) {
+static void destroy_stream(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                           grpc_stream* gs,
+                           grpc_closure* then_schedule_closure) {
   GPR_TIMER_BEGIN("destroy_stream", 0);
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
-  grpc_chttp2_stream *s = (grpc_chttp2_stream *)gs;
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)gt;
+  grpc_chttp2_stream* s = (grpc_chttp2_stream*)gs;
 
   if (s->stream_compression_ctx != NULL) {
     grpc_stream_compression_context_destroy(s->stream_compression_ctx);
@@ -786,29 +790,30 @@
 
   s->destroy_stream_arg = then_schedule_closure;
   GRPC_CLOSURE_SCHED(
-      exec_ctx, GRPC_CLOSURE_INIT(&s->destroy_stream, destroy_stream_locked, s,
-                                  grpc_combiner_scheduler(t->combiner)),
+      exec_ctx,
+      GRPC_CLOSURE_INIT(&s->destroy_stream, destroy_stream_locked, s,
+                        grpc_combiner_scheduler(t->combiner)),
       GRPC_ERROR_NONE);
   GPR_TIMER_END("destroy_stream", 0);
 }
 
-grpc_chttp2_stream *grpc_chttp2_parsing_lookup_stream(grpc_chttp2_transport *t,
+grpc_chttp2_stream* grpc_chttp2_parsing_lookup_stream(grpc_chttp2_transport* t,
                                                       uint32_t id) {
-  return (grpc_chttp2_stream *)grpc_chttp2_stream_map_find(&t->stream_map, id);
+  return (grpc_chttp2_stream*)grpc_chttp2_stream_map_find(&t->stream_map, id);
 }
 
-grpc_chttp2_stream *grpc_chttp2_parsing_accept_stream(grpc_exec_ctx *exec_ctx,
-                                                      grpc_chttp2_transport *t,
+grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_exec_ctx* exec_ctx,
+                                                      grpc_chttp2_transport* t,
                                                       uint32_t id) {
   if (t->channel_callback.accept_stream == NULL) {
     return NULL;
   }
-  grpc_chttp2_stream *accepting;
+  grpc_chttp2_stream* accepting;
   GPR_ASSERT(t->accepting_stream == NULL);
   t->accepting_stream = &accepting;
   t->channel_callback.accept_stream(exec_ctx,
                                     t->channel_callback.accept_stream_user_data,
-                                    &t->base, (void *)(uintptr_t)id);
+                                    &t->base, (void*)(uintptr_t)id);
   t->accepting_stream = NULL;
   return accepting;
 }
@@ -817,7 +822,7 @@
  * OUTPUT PROCESSING
  */
 
-static const char *write_state_name(grpc_chttp2_write_state st) {
+static const char* write_state_name(grpc_chttp2_write_state st) {
   switch (st) {
     case GRPC_CHTTP2_WRITE_STATE_IDLE:
       return "IDLE";
@@ -829,8 +834,8 @@
   GPR_UNREACHABLE_CODE(return "UNKNOWN");
 }
 
-static void set_write_state(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                            grpc_chttp2_write_state st, const char *reason) {
+static void set_write_state(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                            grpc_chttp2_write_state st, const char* reason) {
   GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_DEBUG, "W:%p %s state %s -> %s [%s]", t,
                                  t->is_client ? "CLIENT" : "SERVER",
                                  write_state_name(t->write_state),
@@ -839,7 +844,7 @@
   if (st == GRPC_CHTTP2_WRITE_STATE_IDLE) {
     GRPC_CLOSURE_LIST_SCHED(exec_ctx, &t->run_after_write);
     if (t->close_transport_on_writes_finished != NULL) {
-      grpc_error *err = t->close_transport_on_writes_finished;
+      grpc_error* err = t->close_transport_on_writes_finished;
       t->close_transport_on_writes_finished = NULL;
       close_transport_locked(exec_ctx, t, err);
     }
@@ -847,7 +852,7 @@
 }
 
 static void inc_initiate_write_reason(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_initiate_write_reason reason) {
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_initiate_write_reason reason) {
   switch (reason) {
     case GRPC_CHTTP2_INITIATE_WRITE_INITIAL_WRITE:
       GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_INITIAL_WRITE(exec_ctx);
@@ -918,8 +923,8 @@
   }
 }
 
-void grpc_chttp2_initiate_write(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_transport *t,
+void grpc_chttp2_initiate_write(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_transport* t,
                                 grpc_chttp2_initiate_write_reason reason) {
   GPR_TIMER_BEGIN("grpc_chttp2_initiate_write", 0);
 
@@ -947,16 +952,16 @@
   GPR_TIMER_END("grpc_chttp2_initiate_write", 0);
 }
 
-void grpc_chttp2_mark_stream_writable(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_transport *t,
-                                      grpc_chttp2_stream *s) {
+void grpc_chttp2_mark_stream_writable(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_transport* t,
+                                      grpc_chttp2_stream* s) {
   if (t->closed_with_error == GRPC_ERROR_NONE &&
       grpc_chttp2_list_add_writable_stream(t, s)) {
     GRPC_CHTTP2_STREAM_REF(s, "chttp2_writing:become");
   }
 }
 
-static grpc_closure_scheduler *write_scheduler(grpc_chttp2_transport *t,
+static grpc_closure_scheduler* write_scheduler(grpc_chttp2_transport* t,
                                                bool early_results_scheduled,
                                                bool partial_write) {
   /* if it's not the first write in a batch, always offload to the executor:
@@ -984,7 +989,7 @@
 }
 
 #define WRITE_STATE_TUPLE_TO_INT(p, i) (2 * (int)(p) + (int)(i))
-static const char *begin_writing_desc(bool partial, bool inlined) {
+static const char* begin_writing_desc(bool partial, bool inlined) {
   switch (WRITE_STATE_TUPLE_TO_INT(partial, inlined)) {
     case WRITE_STATE_TUPLE_TO_INT(false, false):
       return "begin write in background";
@@ -998,10 +1003,10 @@
   GPR_UNREACHABLE_CODE(return "bad state tuple");
 }
 
-static void write_action_begin_locked(grpc_exec_ctx *exec_ctx, void *gt,
-                                      grpc_error *error_ignored) {
+static void write_action_begin_locked(grpc_exec_ctx* exec_ctx, void* gt,
+                                      grpc_error* error_ignored) {
   GPR_TIMER_BEGIN("write_action_begin_locked", 0);
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)gt;
   GPR_ASSERT(t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE);
   grpc_chttp2_begin_write_result r;
   if (t->closed_with_error != GRPC_ERROR_NONE) {
@@ -1016,18 +1021,20 @@
     if (!t->is_first_write_in_batch) {
       GRPC_STATS_INC_HTTP2_WRITES_CONTINUED(exec_ctx);
     }
-    grpc_closure_scheduler *scheduler =
+    grpc_closure_scheduler* scheduler =
         write_scheduler(t, r.early_results_scheduled, r.partial);
     if (scheduler != grpc_schedule_on_exec_ctx) {
       GRPC_STATS_INC_HTTP2_WRITES_OFFLOADED(exec_ctx);
     }
     set_write_state(
-        exec_ctx, t, r.partial ? GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE
-                               : GRPC_CHTTP2_WRITE_STATE_WRITING,
+        exec_ctx, t,
+        r.partial ? GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE
+                  : GRPC_CHTTP2_WRITE_STATE_WRITING,
         begin_writing_desc(r.partial, scheduler == grpc_schedule_on_exec_ctx));
-    GRPC_CLOSURE_SCHED(exec_ctx, GRPC_CLOSURE_INIT(&t->write_action,
-                                                   write_action, t, scheduler),
-                       GRPC_ERROR_NONE);
+    GRPC_CLOSURE_SCHED(
+        exec_ctx,
+        GRPC_CLOSURE_INIT(&t->write_action, write_action, t, scheduler),
+        GRPC_ERROR_NONE);
   } else {
     GRPC_STATS_INC_HTTP2_SPURIOUS_WRITES_BEGUN(exec_ctx);
     set_write_state(exec_ctx, t, GRPC_CHTTP2_WRITE_STATE_IDLE,
@@ -1037,8 +1044,8 @@
   GPR_TIMER_END("write_action_begin_locked", 0);
 }
 
-static void write_action(grpc_exec_ctx *exec_ctx, void *gt, grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
+static void write_action(grpc_exec_ctx* exec_ctx, void* gt, grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)gt;
   GPR_TIMER_BEGIN("write_action", 0);
   grpc_endpoint_write(
       exec_ctx, t->ep, &t->outbuf,
@@ -1047,10 +1054,10 @@
   GPR_TIMER_END("write_action", 0);
 }
 
-static void write_action_end_locked(grpc_exec_ctx *exec_ctx, void *tp,
-                                    grpc_error *error) {
+static void write_action_end_locked(grpc_exec_ctx* exec_ctx, void* tp,
+                                    grpc_error* error) {
   GPR_TIMER_BEGIN("terminate_writing_with_lock", 0);
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)tp;
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)tp;
 
   if (error != GRPC_ERROR_NONE) {
     close_transport_locked(exec_ctx, t, GRPC_ERROR_REF(error));
@@ -1095,10 +1102,10 @@
 
 // Dirties an HTTP2 setting to be sent out next time a writing path occurs.
 // If the change needs to occur immediately, manually initiate a write.
-static void queue_setting_update(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_transport *t,
+static void queue_setting_update(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_transport* t,
                                  grpc_chttp2_setting_id id, uint32_t value) {
-  const grpc_chttp2_setting_parameters *sp =
+  const grpc_chttp2_setting_parameters* sp =
       &grpc_chttp2_settings_parameters[id];
   uint32_t use_value = GPR_CLAMP(value, sp->min_value, sp->max_value);
   if (use_value != value) {
@@ -1111,13 +1118,22 @@
   }
 }
 
-void grpc_chttp2_add_incoming_goaway(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t,
+void grpc_chttp2_add_incoming_goaway(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t,
                                      uint32_t goaway_error,
                                      grpc_slice goaway_text) {
   // GRPC_CHTTP2_IF_TRACING(
   //     gpr_log(GPR_DEBUG, "got goaway [%d]: %s", goaway_error, msg));
-  t->seen_goaway = 1;
+
+  // Discard the error from a previous goaway frame (if any)
+  if (t->goaway_error != GRPC_ERROR_NONE) {
+    GRPC_ERROR_UNREF(t->goaway_error);
+  }
+  t->goaway_error = grpc_error_set_str(
+      grpc_error_set_int(
+          GRPC_ERROR_CREATE_FROM_STATIC_STRING("GOAWAY received"),
+          GRPC_ERROR_INT_HTTP2_ERROR, (intptr_t)goaway_error),
+      GRPC_ERROR_STR_RAW_BYTES, goaway_text);
 
   /* When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug
    * data equal to "too_many_pings", it should log the occurrence at a log level
@@ -1138,19 +1154,13 @@
 
   /* lie: use transient failure from the transport to indicate goaway has been
    * received */
-  connectivity_state_set(
-      exec_ctx, t, GRPC_CHANNEL_TRANSIENT_FAILURE,
-      grpc_error_set_str(
-          grpc_error_set_int(
-              GRPC_ERROR_CREATE_FROM_STATIC_STRING("GOAWAY received"),
-              GRPC_ERROR_INT_HTTP2_ERROR, (intptr_t)goaway_error),
-          GRPC_ERROR_STR_RAW_BYTES, goaway_text),
-      "got_goaway");
+  connectivity_state_set(exec_ctx, t, GRPC_CHANNEL_TRANSIENT_FAILURE,
+                         GRPC_ERROR_REF(t->goaway_error), "got_goaway");
 }
 
-static void maybe_start_some_streams(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t) {
-  grpc_chttp2_stream *s;
+static void maybe_start_some_streams(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t) {
+  grpc_chttp2_stream* s;
   /* start streams where we have free grpc_chttp2_stream ids and free
    * concurrency */
   while (t->next_stream_id <= MAX_CLIENT_STREAM_ID &&
@@ -1201,24 +1211,24 @@
    bits being used for flags defined above) */
 #define CLOSURE_BARRIER_FIRST_REF_BIT (1 << 16)
 
-static grpc_closure *add_closure_barrier(grpc_closure *closure) {
+static grpc_closure* add_closure_barrier(grpc_closure* closure) {
   closure->next_data.scratch += CLOSURE_BARRIER_FIRST_REF_BIT;
   return closure;
 }
 
-static void null_then_run_closure(grpc_exec_ctx *exec_ctx,
-                                  grpc_closure **closure, grpc_error *error) {
-  grpc_closure *c = *closure;
+static void null_then_run_closure(grpc_exec_ctx* exec_ctx,
+                                  grpc_closure** closure, grpc_error* error) {
+  grpc_closure* c = *closure;
   *closure = NULL;
   GRPC_CLOSURE_RUN(exec_ctx, c, error);
 }
 
-void grpc_chttp2_complete_closure_step(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_transport *t,
-                                       grpc_chttp2_stream *s,
-                                       grpc_closure **pclosure,
-                                       grpc_error *error, const char *desc) {
-  grpc_closure *closure = *pclosure;
+void grpc_chttp2_complete_closure_step(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_transport* t,
+                                       grpc_chttp2_stream* s,
+                                       grpc_closure** pclosure,
+                                       grpc_error* error, const char* desc) {
+  grpc_closure* closure = *pclosure;
   *pclosure = NULL;
   if (closure == NULL) {
     GRPC_ERROR_UNREF(error);
@@ -1226,7 +1236,7 @@
   }
   closure->next_data.scratch -= CLOSURE_BARRIER_FIRST_REF_BIT;
   if (grpc_http_trace.enabled()) {
-    const char *errstr = grpc_error_string(error);
+    const char* errstr = grpc_error_string(error);
     gpr_log(
         GPR_DEBUG,
         "complete_closure_step: t=%p %p refs=%d flags=0x%04x desc=%s err=%s "
@@ -1262,7 +1272,7 @@
   }
 }
 
-static bool contains_non_ok_status(grpc_metadata_batch *batch) {
+static bool contains_non_ok_status(grpc_metadata_batch* batch) {
   if (batch->idx.named.grpc_status != NULL) {
     return !grpc_mdelem_eq(batch->idx.named.grpc_status->md,
                            GRPC_MDELEM_GRPC_STATUS_0);
@@ -1270,9 +1280,9 @@
   return false;
 }
 
-static void maybe_become_writable_due_to_send_msg(grpc_exec_ctx *exec_ctx,
-                                                  grpc_chttp2_transport *t,
-                                                  grpc_chttp2_stream *s) {
+static void maybe_become_writable_due_to_send_msg(grpc_exec_ctx* exec_ctx,
+                                                  grpc_chttp2_transport* t,
+                                                  grpc_chttp2_stream* s) {
   if (s->id != 0 && (!s->write_buffering ||
                      s->flow_controlled_buffer.length > t->write_buffer_size)) {
     grpc_chttp2_mark_stream_writable(exec_ctx, t, s);
@@ -1281,18 +1291,18 @@
   }
 }
 
-static void add_fetched_slice_locked(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t,
-                                     grpc_chttp2_stream *s) {
+static void add_fetched_slice_locked(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t,
+                                     grpc_chttp2_stream* s) {
   s->fetched_send_message_length +=
       (uint32_t)GRPC_SLICE_LENGTH(s->fetching_slice);
   grpc_slice_buffer_add(&s->flow_controlled_buffer, s->fetching_slice);
   maybe_become_writable_due_to_send_msg(exec_ctx, t, s);
 }
 
-static void continue_fetching_send_locked(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_transport *t,
-                                          grpc_chttp2_stream *s) {
+static void continue_fetching_send_locked(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_transport* t,
+                                          grpc_chttp2_stream* s) {
   for (;;) {
     if (s->fetching_send_message == NULL) {
       /* Stream was cancelled before message fetch completed */
@@ -1307,16 +1317,16 @@
             exec_ctx, t, s, &s->fetching_send_message_finished, GRPC_ERROR_NONE,
             "fetching_send_message_finished");
       } else {
-        grpc_chttp2_write_cb *cb = t->write_cb_pool;
+        grpc_chttp2_write_cb* cb = t->write_cb_pool;
         if (cb == NULL) {
-          cb = (grpc_chttp2_write_cb *)gpr_malloc(sizeof(*cb));
+          cb = (grpc_chttp2_write_cb*)gpr_malloc(sizeof(*cb));
         } else {
           t->write_cb_pool = cb->next;
         }
         cb->call_at_byte = notify_offset;
         cb->closure = s->fetching_send_message_finished;
         s->fetching_send_message_finished = NULL;
-        grpc_chttp2_write_cb **list =
+        grpc_chttp2_write_cb** list =
             s->fetching_send_message->flags & GRPC_WRITE_THROUGH
                 ? &s->on_write_finished_cbs
                 : &s->on_flow_controlled_cbs;
@@ -1327,7 +1337,7 @@
       return; /* early out */
     } else if (grpc_byte_stream_next(exec_ctx, s->fetching_send_message,
                                      UINT32_MAX, &s->complete_fetch_locked)) {
-      grpc_error *error = grpc_byte_stream_pull(
+      grpc_error* error = grpc_byte_stream_pull(
           exec_ctx, s->fetching_send_message, &s->fetching_slice);
       if (error != GRPC_ERROR_NONE) {
         grpc_byte_stream_destroy(exec_ctx, s->fetching_send_message);
@@ -1339,10 +1349,10 @@
   }
 }
 
-static void complete_fetch_locked(grpc_exec_ctx *exec_ctx, void *gs,
-                                  grpc_error *error) {
-  grpc_chttp2_stream *s = (grpc_chttp2_stream *)gs;
-  grpc_chttp2_transport *t = s->t;
+static void complete_fetch_locked(grpc_exec_ctx* exec_ctx, void* gs,
+                                  grpc_error* error) {
+  grpc_chttp2_stream* s = (grpc_chttp2_stream*)gs;
+  grpc_chttp2_transport* t = s->t;
   if (error == GRPC_ERROR_NONE) {
     error = grpc_byte_stream_pull(exec_ctx, s->fetching_send_message,
                                   &s->fetching_slice);
@@ -1357,14 +1367,14 @@
   }
 }
 
-static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
+static void do_nothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
 
-static void log_metadata(const grpc_metadata_batch *md_batch, uint32_t id,
+static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
                          bool is_client, bool is_initial) {
-  for (grpc_linked_mdelem *md = md_batch->list.head; md != NULL;
+  for (grpc_linked_mdelem* md = md_batch->list.head; md != NULL;
        md = md->next) {
-    char *key = grpc_slice_to_c_string(GRPC_MDKEY(md->md));
-    char *value = grpc_slice_to_c_string(GRPC_MDVALUE(md->md));
+    char* key = grpc_slice_to_c_string(GRPC_MDKEY(md->md));
+    char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md->md));
     gpr_log(GPR_INFO, "HTTP:%d:%s:%s: %s: %s", id, is_initial ? "HDR" : "TRL",
             is_client ? "CLI" : "SVR", key, value);
     gpr_free(key);
@@ -1372,20 +1382,20 @@
   }
 }
 
-static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, void *stream_op,
-                                     grpc_error *error_ignored) {
+static void perform_stream_op_locked(grpc_exec_ctx* exec_ctx, void* stream_op,
+                                     grpc_error* error_ignored) {
   GPR_TIMER_BEGIN("perform_stream_op_locked", 0);
 
-  grpc_transport_stream_op_batch *op =
-      (grpc_transport_stream_op_batch *)stream_op;
-  grpc_chttp2_stream *s = (grpc_chttp2_stream *)op->handler_private.extra_arg;
-  grpc_transport_stream_op_batch_payload *op_payload = op->payload;
-  grpc_chttp2_transport *t = s->t;
+  grpc_transport_stream_op_batch* op =
+      (grpc_transport_stream_op_batch*)stream_op;
+  grpc_chttp2_stream* s = (grpc_chttp2_stream*)op->handler_private.extra_arg;
+  grpc_transport_stream_op_batch_payload* op_payload = op->payload;
+  grpc_chttp2_transport* t = s->t;
 
   GRPC_STATS_INC_HTTP2_OP_BATCHES(exec_ctx);
 
   if (grpc_http_trace.enabled()) {
-    char *str = grpc_transport_stream_op_batch_string(op);
+    char* str = grpc_transport_stream_op_batch_string(op);
     gpr_log(GPR_DEBUG, "perform_stream_op_locked: %s; on_complete = %p", str,
             op->on_complete);
     gpr_free(str);
@@ -1399,7 +1409,7 @@
     }
   }
 
-  grpc_closure *on_complete = op->on_complete;
+  grpc_closure* on_complete = op->on_complete;
   if (on_complete == NULL) {
     on_complete =
         GRPC_CLOSURE_CREATE(do_nothing, NULL, grpc_schedule_on_exec_ctx);
@@ -1527,7 +1537,7 @@
           "fetching_send_message_finished");
     } else {
       GPR_ASSERT(s->fetching_send_message == NULL);
-      uint8_t *frame_hdr = grpc_slice_buffer_tiny_add(
+      uint8_t* frame_hdr = grpc_slice_buffer_tiny_add(
           &s->flow_controlled_buffer, GRPC_HEADER_SIZE_IN_BYTES);
       uint32_t flags = op_payload->send_message.send_message->flags;
       frame_hdr[0] = (flags & GRPC_WRITE_INTERNAL_COMPRESS) != 0;
@@ -1654,12 +1664,12 @@
   GRPC_CHTTP2_STREAM_UNREF(exec_ctx, s, "perform_stream_op");
 }
 
-static void perform_stream_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                              grpc_stream *gs,
-                              grpc_transport_stream_op_batch *op) {
+static void perform_stream_op(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                              grpc_stream* gs,
+                              grpc_transport_stream_op_batch* op) {
   GPR_TIMER_BEGIN("perform_stream_op", 0);
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
-  grpc_chttp2_stream *s = (grpc_chttp2_stream *)gs;
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)gt;
+  grpc_chttp2_stream* s = (grpc_chttp2_stream*)gs;
 
   if (!t->is_client) {
     if (op->send_initial_metadata) {
@@ -1675,7 +1685,7 @@
   }
 
   if (grpc_http_trace.enabled()) {
-    char *str = grpc_transport_stream_op_batch_string(op);
+    char* str = grpc_transport_stream_op_batch_string(op);
     gpr_log(GPR_DEBUG, "perform_stream_op[s=%p]: %s", s, str);
     gpr_free(str);
   }
@@ -1690,11 +1700,11 @@
   GPR_TIMER_END("perform_stream_op", 0);
 }
 
-static void cancel_pings(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                         grpc_error *error) {
+static void cancel_pings(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                         grpc_error* error) {
   /* callback remaining pings: they're not allowed to call into the transpot,
      and maybe they hold resources that need to be freed */
-  grpc_chttp2_ping_queue *pq = &t->ping_queue;
+  grpc_chttp2_ping_queue* pq = &t->ping_queue;
   GPR_ASSERT(error != GRPC_ERROR_NONE);
   for (size_t j = 0; j < GRPC_CHTTP2_PCL_COUNT; j++) {
     grpc_closure_list_fail_all(&pq->lists[j], GRPC_ERROR_REF(error));
@@ -1703,24 +1713,24 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void send_ping_locked(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                             grpc_closure *on_initiate, grpc_closure *on_ack) {
+static void send_ping_locked(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                             grpc_closure* on_initiate, grpc_closure* on_ack) {
   if (t->closed_with_error != GRPC_ERROR_NONE) {
     GRPC_CLOSURE_SCHED(exec_ctx, on_initiate,
                        GRPC_ERROR_REF(t->closed_with_error));
     GRPC_CLOSURE_SCHED(exec_ctx, on_ack, GRPC_ERROR_REF(t->closed_with_error));
     return;
   }
-  grpc_chttp2_ping_queue *pq = &t->ping_queue;
+  grpc_chttp2_ping_queue* pq = &t->ping_queue;
   grpc_closure_list_append(&pq->lists[GRPC_CHTTP2_PCL_INITIATE], on_initiate,
                            GRPC_ERROR_NONE);
   grpc_closure_list_append(&pq->lists[GRPC_CHTTP2_PCL_NEXT], on_ack,
                            GRPC_ERROR_NONE);
 }
 
-static void retry_initiate_ping_locked(grpc_exec_ctx *exec_ctx, void *tp,
-                                       grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)tp;
+static void retry_initiate_ping_locked(grpc_exec_ctx* exec_ctx, void* tp,
+                                       grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)tp;
   t->ping_state.is_delayed_ping_timer_set = false;
   if (error == GRPC_ERROR_NONE) {
     grpc_chttp2_initiate_write(exec_ctx, t,
@@ -1728,11 +1738,11 @@
   }
 }
 
-void grpc_chttp2_ack_ping(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
+void grpc_chttp2_ack_ping(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
                           uint64_t id) {
-  grpc_chttp2_ping_queue *pq = &t->ping_queue;
+  grpc_chttp2_ping_queue* pq = &t->ping_queue;
   if (pq->inflight_id != id) {
-    char *from = grpc_endpoint_get_peer(t->ep);
+    char* from = grpc_endpoint_get_peer(t->ep);
     gpr_log(GPR_DEBUG, "Unknown ping response from %s: %" PRIx64, from, id);
     gpr_free(from);
     return;
@@ -1744,8 +1754,8 @@
   }
 }
 
-static void send_goaway(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                        grpc_error *error) {
+static void send_goaway(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                        grpc_error* error) {
   t->sent_goaway_state = GRPC_CHTTP2_GOAWAY_SEND_SCHEDULED;
   grpc_http2_error_code http_error;
   grpc_slice slice;
@@ -1758,8 +1768,8 @@
   GRPC_ERROR_UNREF(error);
 }
 
-void grpc_chttp2_add_ping_strike(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_transport *t) {
+void grpc_chttp2_add_ping_strike(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_transport* t) {
   t->ping_recv_state.ping_strikes++;
   if (++t->ping_recv_state.ping_strikes > t->ping_policy.max_ping_strikes &&
       t->ping_policy.max_ping_strikes != 0) {
@@ -1769,19 +1779,20 @@
                     GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM));
     /*The transport will be closed after the write is done */
     close_transport_locked(
-        exec_ctx, t, grpc_error_set_int(
-                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many pings"),
-                         GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
+        exec_ctx, t,
+        grpc_error_set_int(
+            GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many pings"),
+            GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
   }
 }
 
-static void perform_transport_op_locked(grpc_exec_ctx *exec_ctx,
-                                        void *stream_op,
-                                        grpc_error *error_ignored) {
-  grpc_transport_op *op = (grpc_transport_op *)stream_op;
-  grpc_chttp2_transport *t =
-      (grpc_chttp2_transport *)op->handler_private.extra_arg;
-  grpc_error *close_transport = op->disconnect_with_error;
+static void perform_transport_op_locked(grpc_exec_ctx* exec_ctx,
+                                        void* stream_op,
+                                        grpc_error* error_ignored) {
+  grpc_transport_op* op = (grpc_transport_op*)stream_op;
+  grpc_chttp2_transport* t =
+      (grpc_chttp2_transport*)op->handler_private.extra_arg;
+  grpc_error* close_transport = op->disconnect_with_error;
 
   if (op->goaway_error) {
     send_goaway(exec_ctx, t, op->goaway_error);
@@ -1822,10 +1833,10 @@
   GRPC_CHTTP2_UNREF_TRANSPORT(exec_ctx, t, "transport_op");
 }
 
-static void perform_transport_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                                 grpc_transport_op *op) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
-  char *msg = grpc_transport_op_string(op);
+static void perform_transport_op(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                                 grpc_transport_op* op) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)gt;
+  char* msg = grpc_transport_op_string(op);
   gpr_free(msg);
   op->handler_private.extra_arg = gt;
   GRPC_CHTTP2_REF_TRANSPORT(t, "transport_op");
@@ -1840,9 +1851,9 @@
  * INPUT PROCESSING - GENERAL
  */
 
-void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_exec_ctx *exec_ctx,
-                                                      grpc_chttp2_transport *t,
-                                                      grpc_chttp2_stream *s) {
+void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_exec_ctx* exec_ctx,
+                                                      grpc_chttp2_transport* t,
+                                                      grpc_chttp2_stream* s) {
   if (s->recv_initial_metadata_ready != NULL &&
       s->published_metadata[0] != GRPC_METADATA_NOT_PUBLISHED) {
     if (s->seen_error) {
@@ -1859,10 +1870,10 @@
   }
 }
 
-void grpc_chttp2_maybe_complete_recv_message(grpc_exec_ctx *exec_ctx,
-                                             grpc_chttp2_transport *t,
-                                             grpc_chttp2_stream *s) {
-  grpc_error *error = GRPC_ERROR_NONE;
+void grpc_chttp2_maybe_complete_recv_message(grpc_exec_ctx* exec_ctx,
+                                             grpc_chttp2_transport* t,
+                                             grpc_chttp2_stream* s) {
+  grpc_error* error = GRPC_ERROR_NONE;
   if (s->recv_message_ready != NULL) {
     *s->recv_message = NULL;
     if (s->final_metadata_requested && s->seen_error) {
@@ -1943,9 +1954,9 @@
   }
 }
 
-void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_exec_ctx *exec_ctx,
-                                                       grpc_chttp2_transport *t,
-                                                       grpc_chttp2_stream *s) {
+void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_exec_ctx* exec_ctx,
+                                                       grpc_chttp2_transport* t,
+                                                       grpc_chttp2_stream* s) {
   grpc_chttp2_maybe_complete_recv_message(exec_ctx, t, s);
   if (s->recv_trailing_metadata_finished != NULL && s->read_closed &&
       s->write_closed) {
@@ -1997,10 +2008,10 @@
   }
 }
 
-static void remove_stream(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                          uint32_t id, grpc_error *error) {
-  grpc_chttp2_stream *s =
-      (grpc_chttp2_stream *)grpc_chttp2_stream_map_delete(&t->stream_map, id);
+static void remove_stream(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                          uint32_t id, grpc_error* error) {
+  grpc_chttp2_stream* s =
+      (grpc_chttp2_stream*)grpc_chttp2_stream_map_delete(&t->stream_map, id);
   GPR_ASSERT(s);
   if (t->incoming_stream == s) {
     t->incoming_stream = NULL;
@@ -2008,7 +2019,7 @@
   }
   if (s->pending_byte_stream) {
     if (s->on_next != NULL) {
-      grpc_chttp2_incoming_byte_stream *bs = s->data_parser.parsing_frame;
+      grpc_chttp2_incoming_byte_stream* bs = s->data_parser.parsing_frame;
       if (error == GRPC_ERROR_NONE) {
         error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message");
       }
@@ -2039,9 +2050,9 @@
   maybe_start_some_streams(exec_ctx, t);
 }
 
-void grpc_chttp2_cancel_stream(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_transport *t, grpc_chttp2_stream *s,
-                               grpc_error *due_to_error) {
+void grpc_chttp2_cancel_stream(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_transport* t, grpc_chttp2_stream* s,
+                               grpc_error* due_to_error) {
   if (!t->is_client && !s->sent_trailing_metadata &&
       grpc_error_has_clear_grpc_status(due_to_error)) {
     close_from_api(exec_ctx, t, s, due_to_error);
@@ -2066,12 +2077,11 @@
   grpc_chttp2_mark_stream_closed(exec_ctx, t, s, 1, 1, due_to_error);
 }
 
-void grpc_chttp2_fake_status(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                             grpc_chttp2_stream *s, grpc_error *error) {
+void grpc_chttp2_fake_status(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                             grpc_chttp2_stream* s, grpc_error* error) {
   grpc_status_code status;
   grpc_slice slice;
   grpc_error_get_status(exec_ctx, error, s->deadline, &status, &slice, NULL);
-
   if (status != GRPC_STATUS_OK) {
     s->seen_error = true;
   }
@@ -2106,7 +2116,7 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void add_error(grpc_error *error, grpc_error **refs, size_t *nrefs) {
+static void add_error(grpc_error* error, grpc_error** refs, size_t* nrefs) {
   if (error == GRPC_ERROR_NONE) return;
   for (size_t i = 0; i < *nrefs; i++) {
     if (error == refs[i]) {
@@ -2117,14 +2127,14 @@
   ++*nrefs;
 }
 
-static grpc_error *removal_error(grpc_error *extra_error, grpc_chttp2_stream *s,
-                                 const char *master_error_msg) {
-  grpc_error *refs[3];
+static grpc_error* removal_error(grpc_error* extra_error, grpc_chttp2_stream* s,
+                                 const char* master_error_msg) {
+  grpc_error* refs[3];
   size_t nrefs = 0;
   add_error(s->read_closed_error, refs, &nrefs);
   add_error(s->write_closed_error, refs, &nrefs);
   add_error(extra_error, refs, &nrefs);
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   if (nrefs > 0) {
     error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(master_error_msg,
                                                              refs, nrefs);
@@ -2133,11 +2143,11 @@
   return error;
 }
 
-static void flush_write_list(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                             grpc_chttp2_stream *s, grpc_chttp2_write_cb **list,
-                             grpc_error *error) {
+static void flush_write_list(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                             grpc_chttp2_stream* s, grpc_chttp2_write_cb** list,
+                             grpc_error* error) {
   while (*list) {
-    grpc_chttp2_write_cb *cb = *list;
+    grpc_chttp2_write_cb* cb = *list;
     *list = cb->next;
     grpc_chttp2_complete_closure_step(exec_ctx, t, s, &cb->closure,
                                       GRPC_ERROR_REF(error),
@@ -2148,9 +2158,9 @@
   GRPC_ERROR_UNREF(error);
 }
 
-void grpc_chttp2_fail_pending_writes(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t,
-                                     grpc_chttp2_stream *s, grpc_error *error) {
+void grpc_chttp2_fail_pending_writes(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t,
+                                     grpc_chttp2_stream* s, grpc_error* error) {
   error =
       removal_error(error, s, "Pending writes failed due to stream closure");
   s->send_initial_metadata = NULL;
@@ -2172,10 +2182,10 @@
   flush_write_list(exec_ctx, t, s, &s->on_flow_controlled_cbs, error);
 }
 
-void grpc_chttp2_mark_stream_closed(grpc_exec_ctx *exec_ctx,
-                                    grpc_chttp2_transport *t,
-                                    grpc_chttp2_stream *s, int close_reads,
-                                    int close_writes, grpc_error *error) {
+void grpc_chttp2_mark_stream_closed(grpc_exec_ctx* exec_ctx,
+                                    grpc_chttp2_transport* t,
+                                    grpc_chttp2_stream* s, int close_reads,
+                                    int close_writes, grpc_error* error) {
   if (s->read_closed && s->write_closed) {
     /* already closed */
     grpc_chttp2_maybe_complete_recv_trailing_metadata(exec_ctx, t, s);
@@ -2196,7 +2206,7 @@
   }
   if (s->read_closed && s->write_closed) {
     became_closed = true;
-    grpc_error *overall_error =
+    grpc_error* overall_error =
         removal_error(GRPC_ERROR_REF(error), s, "Stream removed");
     if (s->id != 0) {
       remove_stream(exec_ctx, t, s->id, GRPC_ERROR_REF(overall_error));
@@ -2224,14 +2234,14 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                           grpc_chttp2_stream *s, grpc_error *error) {
+static void close_from_api(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                           grpc_chttp2_stream* s, grpc_error* error) {
   grpc_slice hdr;
   grpc_slice status_hdr;
   grpc_slice http_status_hdr;
   grpc_slice content_type_hdr;
   grpc_slice message_pfx;
-  uint8_t *p;
+  uint8_t* p;
   uint32_t len = 0;
   grpc_status_code grpc_status;
   grpc_slice slice;
@@ -2384,20 +2394,20 @@
 }
 
 typedef struct {
-  grpc_exec_ctx *exec_ctx;
-  grpc_error *error;
-  grpc_chttp2_transport *t;
+  grpc_exec_ctx* exec_ctx;
+  grpc_error* error;
+  grpc_chttp2_transport* t;
 } cancel_stream_cb_args;
 
-static void cancel_stream_cb(void *user_data, uint32_t key, void *stream) {
-  cancel_stream_cb_args *args = (cancel_stream_cb_args *)user_data;
-  grpc_chttp2_stream *s = (grpc_chttp2_stream *)stream;
+static void cancel_stream_cb(void* user_data, uint32_t key, void* stream) {
+  cancel_stream_cb_args* args = (cancel_stream_cb_args*)user_data;
+  grpc_chttp2_stream* s = (grpc_chttp2_stream*)stream;
   grpc_chttp2_cancel_stream(args->exec_ctx, args->t, s,
                             GRPC_ERROR_REF(args->error));
 }
 
-static void end_all_the_calls(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                              grpc_error *error) {
+static void end_all_the_calls(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                              grpc_error* error) {
   cancel_stream_cb_args args = {exec_ctx, error, t};
   grpc_chttp2_stream_map_for_each(&t->stream_map, cancel_stream_cb, &args);
   GRPC_ERROR_UNREF(error);
@@ -2408,7 +2418,7 @@
  */
 
 template <class F>
-static void WithUrgency(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
+static void WithUrgency(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
                         grpc_core::chttp2::FlowControlAction::Urgency urgency,
                         grpc_chttp2_initiate_write_reason reason, F action) {
   switch (urgency) {
@@ -2424,8 +2434,8 @@
 }
 
 void grpc_chttp2_act_on_flowctl_action(
-    grpc_exec_ctx *exec_ctx, const grpc_core::chttp2::FlowControlAction &action,
-    grpc_chttp2_transport *t, grpc_chttp2_stream *s) {
+    grpc_exec_ctx* exec_ctx, const grpc_core::chttp2::FlowControlAction& action,
+    grpc_chttp2_transport* t, grpc_chttp2_stream* s) {
   WithUrgency(
       exec_ctx, t, action.send_stream_update(),
       GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL,
@@ -2447,17 +2457,17 @@
       });
 }
 
-static grpc_error *try_http_parsing(grpc_exec_ctx *exec_ctx,
-                                    grpc_chttp2_transport *t) {
+static grpc_error* try_http_parsing(grpc_exec_ctx* exec_ctx,
+                                    grpc_chttp2_transport* t) {
   grpc_http_parser parser;
   size_t i = 0;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   grpc_http_response response;
   memset(&response, 0, sizeof(response));
 
   grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
 
-  grpc_error *parse_error = GRPC_ERROR_NONE;
+  grpc_error* parse_error = GRPC_ERROR_NONE;
   for (; i < t->read_buffer.count && parse_error == GRPC_ERROR_NONE; i++) {
     parse_error =
         grpc_http_parser_parse(&parser, t->read_buffer.slices[i], NULL);
@@ -2477,27 +2487,27 @@
   return error;
 }
 
-static void read_action_locked(grpc_exec_ctx *exec_ctx, void *tp,
-                               grpc_error *error) {
+static void read_action_locked(grpc_exec_ctx* exec_ctx, void* tp,
+                               grpc_error* error) {
   GPR_TIMER_BEGIN("reading_action_locked", 0);
 
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)tp;
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)tp;
 
   GRPC_ERROR_REF(error);
 
-  grpc_error *err = error;
+  grpc_error* err = error;
   if (err != GRPC_ERROR_NONE) {
     err = grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
                                  "Endpoint read failed", &err, 1),
                              GRPC_ERROR_INT_OCCURRED_DURING_WRITE,
                              t->write_state);
   }
-  GPR_SWAP(grpc_error *, err, error);
+  GPR_SWAP(grpc_error*, err, error);
   GRPC_ERROR_UNREF(err);
   if (t->closed_with_error == GRPC_ERROR_NONE) {
     GPR_TIMER_BEGIN("reading_action.parse", 0);
     size_t i = 0;
-    grpc_error *errors[3] = {GRPC_ERROR_REF(error), GRPC_ERROR_NONE,
+    grpc_error* errors[3] = {GRPC_ERROR_REF(error), GRPC_ERROR_NONE,
                              GRPC_ERROR_NONE};
     for (; i < t->read_buffer.count && errors[1] == GRPC_ERROR_NONE; i++) {
       t->flow_control->bdp_estimator()->AddIncomingBytes(
@@ -2519,7 +2529,7 @@
     GPR_TIMER_BEGIN("post_parse_locked", 0);
     if (t->initial_window_update != 0) {
       if (t->initial_window_update > 0) {
-        grpc_chttp2_stream *s;
+        grpc_chttp2_stream* s;
         while (grpc_chttp2_list_pop_stalled_by_stream(t, &s)) {
           grpc_chttp2_mark_stream_writable(exec_ctx, t, s);
           grpc_chttp2_initiate_write(
@@ -2539,6 +2549,12 @@
         "Transport closed", &t->closed_with_error, 1);
   }
   if (error != GRPC_ERROR_NONE) {
+    /* If a goaway frame was received, this might be the reason why the read
+     * failed. Add this info to the error */
+    if (t->goaway_error != GRPC_ERROR_NONE) {
+      error = grpc_error_add_child(error, GRPC_ERROR_REF(t->goaway_error));
+    }
+
     close_transport_locked(exec_ctx, t, GRPC_ERROR_REF(error));
     t->endpoint_reading = 0;
   } else if (t->closed_with_error == GRPC_ERROR_NONE) {
@@ -2566,16 +2582,16 @@
 
 // t is reffed prior to calling the first time, and once the callback chain
 // that kicks off finishes, it's unreffed
-static void schedule_bdp_ping_locked(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t) {
+static void schedule_bdp_ping_locked(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t) {
   t->flow_control->bdp_estimator()->SchedulePing();
   send_ping_locked(exec_ctx, t, &t->start_bdp_ping_locked,
                    &t->finish_bdp_ping_locked);
 }
 
-static void start_bdp_ping_locked(grpc_exec_ctx *exec_ctx, void *tp,
-                                  grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)tp;
+static void start_bdp_ping_locked(grpc_exec_ctx* exec_ctx, void* tp,
+                                  grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)tp;
   if (grpc_http_trace.enabled()) {
     gpr_log(GPR_DEBUG, "%s: Start BDP ping err=%s", t->peer_string,
             grpc_error_string(error));
@@ -2587,9 +2603,9 @@
   t->flow_control->bdp_estimator()->StartPing();
 }
 
-static void finish_bdp_ping_locked(grpc_exec_ctx *exec_ctx, void *tp,
-                                   grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)tp;
+static void finish_bdp_ping_locked(grpc_exec_ctx* exec_ctx, void* tp,
+                                   grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)tp;
   if (grpc_http_trace.enabled()) {
     gpr_log(GPR_DEBUG, "%s: Complete BDP ping err=%s", t->peer_string,
             grpc_error_string(error));
@@ -2608,9 +2624,9 @@
                   &t->next_bdp_ping_timer_expired_locked);
 }
 
-static void next_bdp_ping_timer_expired_locked(grpc_exec_ctx *exec_ctx,
-                                               void *tp, grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)tp;
+static void next_bdp_ping_timer_expired_locked(grpc_exec_ctx* exec_ctx,
+                                               void* tp, grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)tp;
   GPR_ASSERT(t->have_next_bdp_ping_timer);
   t->have_next_bdp_ping_timer = false;
   if (error != GRPC_ERROR_NONE) {
@@ -2620,7 +2636,7 @@
   schedule_bdp_ping_locked(exec_ctx, t);
 }
 
-void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args,
+void grpc_chttp2_config_default_keepalive_args(grpc_channel_args* args,
                                                bool is_client) {
   size_t i;
   if (args) {
@@ -2678,9 +2694,9 @@
   }
 }
 
-static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                       grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)arg;
+static void init_keepalive_ping_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                       grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)arg;
   GPR_ASSERT(t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING);
   if (t->destroying || t->closed_with_error != GRPC_ERROR_NONE) {
     t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
@@ -2709,18 +2725,18 @@
   GRPC_CHTTP2_UNREF_TRANSPORT(exec_ctx, t, "init keepalive ping");
 }
 
-static void start_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)arg;
+static void start_keepalive_ping_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)arg;
   GRPC_CHTTP2_REF_TRANSPORT(t, "keepalive watchdog");
   grpc_timer_init(exec_ctx, &t->keepalive_watchdog_timer,
                   grpc_exec_ctx_now(exec_ctx) + t->keepalive_time,
                   &t->keepalive_watchdog_fired_locked);
 }
 
-static void finish_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                         grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)arg;
+static void finish_keepalive_ping_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                         grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)arg;
   if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
     if (error == GRPC_ERROR_NONE) {
       t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING;
@@ -2734,9 +2750,9 @@
   GRPC_CHTTP2_UNREF_TRANSPORT(exec_ctx, t, "keepalive ping end");
 }
 
-static void keepalive_watchdog_fired_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                            grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)arg;
+static void keepalive_watchdog_fired_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                            grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)arg;
   if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
     if (error == GRPC_ERROR_NONE) {
       t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
@@ -2761,10 +2777,10 @@
  * CALLBACK LOOP
  */
 
-static void connectivity_state_set(grpc_exec_ctx *exec_ctx,
-                                   grpc_chttp2_transport *t,
+static void connectivity_state_set(grpc_exec_ctx* exec_ctx,
+                                   grpc_chttp2_transport* t,
                                    grpc_connectivity_state state,
-                                   grpc_error *error, const char *reason) {
+                                   grpc_error* error, const char* reason) {
   GRPC_CHTTP2_IF_TRACING(
       gpr_log(GPR_DEBUG, "set connectivity_state=%d", state));
   grpc_connectivity_state_set(exec_ctx, &t->channel_callback.state_tracker,
@@ -2775,15 +2791,15 @@
  * POLLSET STUFF
  */
 
-static void set_pollset(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                        grpc_stream *gs, grpc_pollset *pollset) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
+static void set_pollset(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                        grpc_stream* gs, grpc_pollset* pollset) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)gt;
   grpc_endpoint_add_to_pollset(exec_ctx, t->ep, pollset);
 }
 
-static void set_pollset_set(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                            grpc_stream *gs, grpc_pollset_set *pollset_set) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
+static void set_pollset_set(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                            grpc_stream* gs, grpc_pollset_set* pollset_set) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)gt;
   grpc_endpoint_add_to_pollset_set(exec_ctx, t->ep, pollset_set);
 }
 
@@ -2791,9 +2807,9 @@
  * BYTE STREAM
  */
 
-static void reset_byte_stream(grpc_exec_ctx *exec_ctx, void *arg,
-                              grpc_error *error) {
-  grpc_chttp2_stream *s = (grpc_chttp2_stream *)arg;
+static void reset_byte_stream(grpc_exec_ctx* exec_ctx, void* arg,
+                              grpc_error* error) {
+  grpc_chttp2_stream* s = (grpc_chttp2_stream*)arg;
 
   s->pending_byte_stream = false;
   if (error == GRPC_ERROR_NONE) {
@@ -2810,20 +2826,20 @@
   }
 }
 
-static void incoming_byte_stream_unref(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_incoming_byte_stream *bs) {
+static void incoming_byte_stream_unref(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_incoming_byte_stream* bs) {
   if (gpr_unref(&bs->refs)) {
     gpr_free(bs);
   }
 }
 
-static void incoming_byte_stream_next_locked(grpc_exec_ctx *exec_ctx,
-                                             void *argp,
-                                             grpc_error *error_ignored) {
-  grpc_chttp2_incoming_byte_stream *bs =
-      (grpc_chttp2_incoming_byte_stream *)argp;
-  grpc_chttp2_transport *t = bs->transport;
-  grpc_chttp2_stream *s = bs->stream;
+static void incoming_byte_stream_next_locked(grpc_exec_ctx* exec_ctx,
+                                             void* argp,
+                                             grpc_error* error_ignored) {
+  grpc_chttp2_incoming_byte_stream* bs =
+      (grpc_chttp2_incoming_byte_stream*)argp;
+  grpc_chttp2_transport* t = bs->transport;
+  grpc_chttp2_stream* s = bs->stream;
 
   size_t cur_length = s->frame_storage.length;
   if (!s->read_closed) {
@@ -2865,14 +2881,14 @@
   incoming_byte_stream_unref(exec_ctx, bs);
 }
 
-static bool incoming_byte_stream_next(grpc_exec_ctx *exec_ctx,
-                                      grpc_byte_stream *byte_stream,
+static bool incoming_byte_stream_next(grpc_exec_ctx* exec_ctx,
+                                      grpc_byte_stream* byte_stream,
                                       size_t max_size_hint,
-                                      grpc_closure *on_complete) {
+                                      grpc_closure* on_complete) {
   GPR_TIMER_BEGIN("incoming_byte_stream_next", 0);
-  grpc_chttp2_incoming_byte_stream *bs =
-      (grpc_chttp2_incoming_byte_stream *)byte_stream;
-  grpc_chttp2_stream *s = bs->stream;
+  grpc_chttp2_incoming_byte_stream* bs =
+      (grpc_chttp2_incoming_byte_stream*)byte_stream;
+  grpc_chttp2_stream* s = bs->stream;
   if (s->unprocessed_incoming_frames_buffer.length > 0) {
     GPR_TIMER_END("incoming_byte_stream_next", 0);
     return true;
@@ -2891,14 +2907,14 @@
   }
 }
 
-static grpc_error *incoming_byte_stream_pull(grpc_exec_ctx *exec_ctx,
-                                             grpc_byte_stream *byte_stream,
-                                             grpc_slice *slice) {
+static grpc_error* incoming_byte_stream_pull(grpc_exec_ctx* exec_ctx,
+                                             grpc_byte_stream* byte_stream,
+                                             grpc_slice* slice) {
   GPR_TIMER_BEGIN("incoming_byte_stream_pull", 0);
-  grpc_chttp2_incoming_byte_stream *bs =
-      (grpc_chttp2_incoming_byte_stream *)byte_stream;
-  grpc_chttp2_stream *s = bs->stream;
-  grpc_error *error;
+  grpc_chttp2_incoming_byte_stream* bs =
+      (grpc_chttp2_incoming_byte_stream*)byte_stream;
+  grpc_chttp2_stream* s = bs->stream;
+  grpc_error* error;
 
   if (s->unprocessed_incoming_frames_buffer.length > 0) {
     if (!s->unprocessed_incoming_frames_decompressed) {
@@ -2942,27 +2958,28 @@
   return GRPC_ERROR_NONE;
 }
 
-static void incoming_byte_stream_destroy_locked(grpc_exec_ctx *exec_ctx,
-                                                void *byte_stream,
-                                                grpc_error *error_ignored);
+static void incoming_byte_stream_destroy_locked(grpc_exec_ctx* exec_ctx,
+                                                void* byte_stream,
+                                                grpc_error* error_ignored);
 
-static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx,
-                                         grpc_byte_stream *byte_stream) {
+static void incoming_byte_stream_destroy(grpc_exec_ctx* exec_ctx,
+                                         grpc_byte_stream* byte_stream) {
   GPR_TIMER_BEGIN("incoming_byte_stream_destroy", 0);
-  grpc_chttp2_incoming_byte_stream *bs =
-      (grpc_chttp2_incoming_byte_stream *)byte_stream;
+  grpc_chttp2_incoming_byte_stream* bs =
+      (grpc_chttp2_incoming_byte_stream*)byte_stream;
   GRPC_CLOSURE_SCHED(
-      exec_ctx, GRPC_CLOSURE_INIT(
-                    &bs->destroy_action, incoming_byte_stream_destroy_locked,
-                    bs, grpc_combiner_scheduler(bs->transport->combiner)),
+      exec_ctx,
+      GRPC_CLOSURE_INIT(&bs->destroy_action,
+                        incoming_byte_stream_destroy_locked, bs,
+                        grpc_combiner_scheduler(bs->transport->combiner)),
       GRPC_ERROR_NONE);
   GPR_TIMER_END("incoming_byte_stream_destroy", 0);
 }
 
 static void incoming_byte_stream_publish_error(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs,
-    grpc_error *error) {
-  grpc_chttp2_stream *s = bs->stream;
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_byte_stream* bs,
+    grpc_error* error) {
+  grpc_chttp2_stream* s = bs->stream;
 
   GPR_ASSERT(error != GRPC_ERROR_NONE);
   GRPC_CLOSURE_SCHED(exec_ctx, s->on_next, GRPC_ERROR_REF(error));
@@ -2973,13 +2990,13 @@
                             GRPC_ERROR_REF(error));
 }
 
-grpc_error *grpc_chttp2_incoming_byte_stream_push(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs,
-    grpc_slice slice, grpc_slice *slice_out) {
-  grpc_chttp2_stream *s = bs->stream;
+grpc_error* grpc_chttp2_incoming_byte_stream_push(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_byte_stream* bs,
+    grpc_slice slice, grpc_slice* slice_out) {
+  grpc_chttp2_stream* s = bs->stream;
 
   if (bs->remaining_bytes < GRPC_SLICE_LENGTH(slice)) {
-    grpc_error *error =
+    grpc_error* error =
         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many bytes in stream");
 
     GRPC_CLOSURE_SCHED(exec_ctx, &s->reset_byte_stream, GRPC_ERROR_REF(error));
@@ -2994,10 +3011,10 @@
   }
 }
 
-grpc_error *grpc_chttp2_incoming_byte_stream_finished(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs,
-    grpc_error *error, bool reset_on_error) {
-  grpc_chttp2_stream *s = bs->stream;
+grpc_error* grpc_chttp2_incoming_byte_stream_finished(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_byte_stream* bs,
+    grpc_error* error, bool reset_on_error) {
+  grpc_chttp2_stream* s = bs->stream;
 
   if (error == GRPC_ERROR_NONE) {
     if (bs->remaining_bytes != 0) {
@@ -3011,11 +3028,11 @@
   return error;
 }
 
-static void incoming_byte_stream_shutdown(grpc_exec_ctx *exec_ctx,
-                                          grpc_byte_stream *byte_stream,
-                                          grpc_error *error) {
-  grpc_chttp2_incoming_byte_stream *bs =
-      (grpc_chttp2_incoming_byte_stream *)byte_stream;
+static void incoming_byte_stream_shutdown(grpc_exec_ctx* exec_ctx,
+                                          grpc_byte_stream* byte_stream,
+                                          grpc_error* error) {
+  grpc_chttp2_incoming_byte_stream* bs =
+      (grpc_chttp2_incoming_byte_stream*)byte_stream;
   GRPC_ERROR_UNREF(grpc_chttp2_incoming_byte_stream_finished(
       exec_ctx, bs, error, true /* reset_on_error */));
 }
@@ -3024,13 +3041,13 @@
     incoming_byte_stream_next, incoming_byte_stream_pull,
     incoming_byte_stream_shutdown, incoming_byte_stream_destroy};
 
-static void incoming_byte_stream_destroy_locked(grpc_exec_ctx *exec_ctx,
-                                                void *byte_stream,
-                                                grpc_error *error_ignored) {
-  grpc_chttp2_incoming_byte_stream *bs =
-      (grpc_chttp2_incoming_byte_stream *)byte_stream;
-  grpc_chttp2_stream *s = bs->stream;
-  grpc_chttp2_transport *t = s->t;
+static void incoming_byte_stream_destroy_locked(grpc_exec_ctx* exec_ctx,
+                                                void* byte_stream,
+                                                grpc_error* error_ignored) {
+  grpc_chttp2_incoming_byte_stream* bs =
+      (grpc_chttp2_incoming_byte_stream*)byte_stream;
+  grpc_chttp2_stream* s = bs->stream;
+  grpc_chttp2_transport* t = s->t;
 
   GPR_ASSERT(bs->base.vtable == &grpc_chttp2_incoming_byte_stream_vtable);
   incoming_byte_stream_unref(exec_ctx, bs);
@@ -3039,11 +3056,11 @@
   grpc_chttp2_maybe_complete_recv_trailing_metadata(exec_ctx, t, s);
 }
 
-grpc_chttp2_incoming_byte_stream *grpc_chttp2_incoming_byte_stream_create(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, grpc_chttp2_stream *s,
+grpc_chttp2_incoming_byte_stream* grpc_chttp2_incoming_byte_stream_create(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, grpc_chttp2_stream* s,
     uint32_t frame_size, uint32_t flags) {
-  grpc_chttp2_incoming_byte_stream *incoming_byte_stream =
-      (grpc_chttp2_incoming_byte_stream *)gpr_malloc(
+  grpc_chttp2_incoming_byte_stream* incoming_byte_stream =
+      (grpc_chttp2_incoming_byte_stream*)gpr_malloc(
           sizeof(*incoming_byte_stream));
   incoming_byte_stream->base.length = frame_size;
   incoming_byte_stream->remaining_bytes = frame_size;
@@ -3061,8 +3078,8 @@
  * RESOURCE QUOTAS
  */
 
-static void post_benign_reclaimer(grpc_exec_ctx *exec_ctx,
-                                  grpc_chttp2_transport *t) {
+static void post_benign_reclaimer(grpc_exec_ctx* exec_ctx,
+                                  grpc_chttp2_transport* t) {
   if (!t->benign_reclaimer_registered) {
     t->benign_reclaimer_registered = true;
     GRPC_CHTTP2_REF_TRANSPORT(t, "benign_reclaimer");
@@ -3072,8 +3089,8 @@
   }
 }
 
-static void post_destructive_reclaimer(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_transport *t) {
+static void post_destructive_reclaimer(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_transport* t) {
   if (!t->destructive_reclaimer_registered) {
     t->destructive_reclaimer_registered = true;
     GRPC_CHTTP2_REF_TRANSPORT(t, "destructive_reclaimer");
@@ -3083,9 +3100,9 @@
   }
 }
 
-static void benign_reclaimer_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                    grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)arg;
+static void benign_reclaimer_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                    grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)arg;
   if (error == GRPC_ERROR_NONE &&
       grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
     /* Channel with no active streams: send a goaway to try and make it
@@ -3098,7 +3115,8 @@
                 grpc_error_set_int(
                     GRPC_ERROR_CREATE_FROM_STATIC_STRING("Buffers full"),
                     GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM));
-  } else if (error == GRPC_ERROR_NONE && grpc_resource_quota_trace.enabled()) {
+  } else if (error == GRPC_ERROR_NONE &&
+             grpc_resource_quota_trace.enabled()) {
     gpr_log(GPR_DEBUG,
             "HTTP2: %s - skip benign reclamation, there are still %" PRIdPTR
             " streams",
@@ -3112,14 +3130,14 @@
   GRPC_CHTTP2_UNREF_TRANSPORT(exec_ctx, t, "benign_reclaimer");
 }
 
-static void destructive_reclaimer_locked(grpc_exec_ctx *exec_ctx, void *arg,
-                                         grpc_error *error) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)arg;
+static void destructive_reclaimer_locked(grpc_exec_ctx* exec_ctx, void* arg,
+                                         grpc_error* error) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)arg;
   size_t n = grpc_chttp2_stream_map_size(&t->stream_map);
   t->destructive_reclaimer_registered = false;
   if (error == GRPC_ERROR_NONE && n > 0) {
-    grpc_chttp2_stream *s =
-        (grpc_chttp2_stream *)grpc_chttp2_stream_map_rand(&t->stream_map);
+    grpc_chttp2_stream* s =
+        (grpc_chttp2_stream*)grpc_chttp2_stream_map_rand(&t->stream_map);
     if (grpc_resource_quota_trace.enabled()) {
       gpr_log(GPR_DEBUG, "HTTP2: %s - abandon stream id %d", t->peer_string,
               s->id);
@@ -3148,7 +3166,7 @@
  * MONITORING
  */
 
-const char *grpc_chttp2_initiate_write_reason_string(
+const char* grpc_chttp2_initiate_write_reason_string(
     grpc_chttp2_initiate_write_reason reason) {
   switch (reason) {
     case GRPC_CHTTP2_INITIATE_WRITE_INITIAL_WRITE:
@@ -3195,9 +3213,9 @@
   GPR_UNREACHABLE_CODE(return "unknown");
 }
 
-static grpc_endpoint *chttp2_get_endpoint(grpc_exec_ctx *exec_ctx,
-                                          grpc_transport *t) {
-  return ((grpc_chttp2_transport *)t)->ep;
+static grpc_endpoint* chttp2_get_endpoint(grpc_exec_ctx* exec_ctx,
+                                          grpc_transport* t) {
+  return ((grpc_chttp2_transport*)t)->ep;
 }
 
 static const grpc_transport_vtable vtable = {sizeof(grpc_chttp2_stream),
@@ -3211,21 +3229,21 @@
                                              destroy_transport,
                                              chttp2_get_endpoint};
 
-static const grpc_transport_vtable *get_vtable(void) { return &vtable; }
+static const grpc_transport_vtable* get_vtable(void) { return &vtable; }
 
-grpc_transport *grpc_create_chttp2_transport(
-    grpc_exec_ctx *exec_ctx, const grpc_channel_args *channel_args,
-    grpc_endpoint *ep, int is_client) {
-  grpc_chttp2_transport *t =
-      (grpc_chttp2_transport *)gpr_zalloc(sizeof(grpc_chttp2_transport));
+grpc_transport* grpc_create_chttp2_transport(
+    grpc_exec_ctx* exec_ctx, const grpc_channel_args* channel_args,
+    grpc_endpoint* ep, int is_client) {
+  grpc_chttp2_transport* t =
+      (grpc_chttp2_transport*)gpr_zalloc(sizeof(grpc_chttp2_transport));
   init_transport(exec_ctx, t, channel_args, ep, is_client != 0);
   return &t->base;
 }
 
-void grpc_chttp2_transport_start_reading(grpc_exec_ctx *exec_ctx,
-                                         grpc_transport *transport,
-                                         grpc_slice_buffer *read_buffer) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)transport;
+void grpc_chttp2_transport_start_reading(grpc_exec_ctx* exec_ctx,
+                                         grpc_transport* transport,
+                                         grpc_slice_buffer* read_buffer) {
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)transport;
   GRPC_CHTTP2_REF_TRANSPORT(
       t, "reading_action"); /* matches unref inside reading_action */
   if (read_buffer != NULL) {
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h
index 982db40..44702d4 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h
@@ -23,10 +23,6 @@
 #include "src/core/lib/iomgr/endpoint.h"
 #include "src/core/lib/transport/transport.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 extern grpc_core::TraceFlag grpc_http_trace;
 extern grpc_core::TraceFlag grpc_trace_http2_stream_state;
 
@@ -34,15 +30,19 @@
 extern grpc_core::TraceFlag grpc_trace_chttp2_refcount;
 #endif
 
-grpc_transport *grpc_create_chttp2_transport(
-    grpc_exec_ctx *exec_ctx, const grpc_channel_args *channel_args,
-    grpc_endpoint *ep, int is_client);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+grpc_transport* grpc_create_chttp2_transport(
+    grpc_exec_ctx* exec_ctx, const grpc_channel_args* channel_args,
+    grpc_endpoint* ep, int is_client);
 
 /// Takes ownership of \a read_buffer, which (if non-NULL) contains
 /// leftover bytes previously read from the endpoint (e.g., by handshakers).
-void grpc_chttp2_transport_start_reading(grpc_exec_ctx *exec_ctx,
-                                         grpc_transport *transport,
-                                         grpc_slice_buffer *read_buffer);
+void grpc_chttp2_transport_start_reading(grpc_exec_ctx* exec_ctx,
+                                         grpc_transport* transport,
+                                         grpc_slice_buffer* read_buffer);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/transport/flow_control.cc b/src/core/ext/transport/chttp2/transport/flow_control.cc
index 5a1358e..bc4e0f9 100644
--- a/src/core/ext/transport/chttp2/transport/flow_control.cc
+++ b/src/core/ext/transport/chttp2/transport/flow_control.cc
@@ -167,7 +167,7 @@
 
 uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) {
   FlowControlTrace trace("t updt sent", this, nullptr);
-  const uint32_t target_announced_window = target_window();
+  const uint32_t target_announced_window = (const uint32_t)target_window();
   if ((writing_anyway || announced_window_ <= target_announced_window / 2) &&
       announced_window_ != target_announced_window) {
     const uint32_t announce = (uint32_t)GPR_CLAMP(
@@ -226,9 +226,9 @@
               incoming_frame_size, acked_stream_window, sent_stream_window);
     } else {
       char* msg;
-      gpr_asprintf(&msg, "frame of size %" PRId64
-                         " overflows local window of %" PRId64,
-                   incoming_frame_size, acked_stream_window);
+      gpr_asprintf(
+          &msg, "frame of size %" PRId64 " overflows local window of %" PRId64,
+          incoming_frame_size, acked_stream_window);
       grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
       gpr_free(msg);
       return err;
diff --git a/src/core/ext/transport/chttp2/transport/flow_control.h b/src/core/ext/transport/chttp2/transport/flow_control.h
index 59ba758..bb710fe 100644
--- a/src/core/ext/transport/chttp2/transport/flow_control.h
+++ b/src/core/ext/transport/chttp2/transport/flow_control.h
@@ -32,6 +32,12 @@
 
 extern grpc_core::TraceFlag grpc_flowctl_trace;
 
+namespace grpc {
+namespace testing {
+class TrickledCHTTP2;  // to make this a friend
+}  // namespace testing
+}  // namespace grpc
+
 namespace grpc_core {
 namespace chttp2 {
 
@@ -203,6 +209,7 @@
   }
 
  private:
+  friend class ::grpc::testing::TrickledCHTTP2;
   double TargetLogBdp();
   double SmoothLogBdp(grpc_exec_ctx* exec_ctx, double value);
   FlowControlAction::Urgency DeltaUrgency(int32_t value,
@@ -297,6 +304,7 @@
   }
 
  private:
+  friend class ::grpc::testing::TrickledCHTTP2;
   TransportFlowControl* const tfc_;
   const grpc_chttp2_stream* const s_;
 
diff --git a/src/core/ext/transport/chttp2/transport/frame_data.cc b/src/core/ext/transport/chttp2/transport/frame_data.cc
index 73aaab1..7d2c7f5 100644
--- a/src/core/ext/transport/chttp2/transport/frame_data.cc
+++ b/src/core/ext/transport/chttp2/transport/frame_data.cc
@@ -30,14 +30,14 @@
 #include "src/core/lib/support/string.h"
 #include "src/core/lib/transport/transport.h"
 
-grpc_error *grpc_chttp2_data_parser_init(grpc_chttp2_data_parser *parser) {
+grpc_error* grpc_chttp2_data_parser_init(grpc_chttp2_data_parser* parser) {
   parser->state = GRPC_CHTTP2_DATA_FH_0;
   parser->parsing_frame = NULL;
   return GRPC_ERROR_NONE;
 }
 
-void grpc_chttp2_data_parser_destroy(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_data_parser *parser) {
+void grpc_chttp2_data_parser_destroy(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_data_parser* parser) {
   if (parser->parsing_frame != NULL) {
     GRPC_ERROR_UNREF(grpc_chttp2_incoming_byte_stream_finished(
         exec_ctx, parser->parsing_frame,
@@ -46,14 +46,14 @@
   GRPC_ERROR_UNREF(parser->error);
 }
 
-grpc_error *grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser *parser,
+grpc_error* grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser* parser,
                                                 uint8_t flags,
                                                 uint32_t stream_id,
-                                                grpc_chttp2_stream *s) {
+                                                grpc_chttp2_stream* s) {
   if (flags & ~GRPC_CHTTP2_DATA_FLAG_END_STREAM) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "unsupported data flags: 0x%02x", flags);
-    grpc_error *err =
+    grpc_error* err =
         grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg),
                            GRPC_ERROR_INT_STREAM_ID, (intptr_t)stream_id);
     gpr_free(msg);
@@ -69,12 +69,12 @@
   return GRPC_ERROR_NONE;
 }
 
-void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer *inbuf,
+void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer* inbuf,
                              uint32_t write_bytes, int is_eof,
-                             grpc_transport_one_way_stats *stats,
-                             grpc_slice_buffer *outbuf) {
+                             grpc_transport_one_way_stats* stats,
+                             grpc_slice_buffer* outbuf) {
   grpc_slice hdr;
-  uint8_t *p;
+  uint8_t* p;
   static const size_t header_size = 9;
 
   hdr = GRPC_SLICE_MALLOC(header_size);
@@ -97,17 +97,17 @@
   stats->data_bytes += write_bytes;
 }
 
-grpc_error *grpc_deframe_unprocessed_incoming_frames(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_data_parser *p, grpc_chttp2_stream *s,
-    grpc_slice_buffer *slices, grpc_slice *slice_out,
-    grpc_byte_stream **stream_out) {
-  grpc_error *error = GRPC_ERROR_NONE;
-  grpc_chttp2_transport *t = s->t;
+grpc_error* grpc_deframe_unprocessed_incoming_frames(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_data_parser* p, grpc_chttp2_stream* s,
+    grpc_slice_buffer* slices, grpc_slice* slice_out,
+    grpc_byte_stream** stream_out) {
+  grpc_error* error = GRPC_ERROR_NONE;
+  grpc_chttp2_transport* t = s->t;
 
   while (slices->count > 0) {
-    uint8_t *beg = NULL;
-    uint8_t *end = NULL;
-    uint8_t *cur = NULL;
+    uint8_t* beg = NULL;
+    uint8_t* end = NULL;
+    uint8_t* cur = NULL;
 
     grpc_slice slice = grpc_slice_buffer_take_first(slices);
 
@@ -115,7 +115,7 @@
     end = GRPC_SLICE_END_PTR(slice);
     cur = beg;
     uint32_t message_flags;
-    char *msg;
+    char* msg;
 
     if (cur == end) {
       grpc_slice_unref_internal(exec_ctx, slice);
@@ -289,9 +289,9 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_chttp2_data_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
-                                          grpc_chttp2_transport *t,
-                                          grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_data_parser_parse(grpc_exec_ctx* exec_ctx, void* parser,
+                                          grpc_chttp2_transport* t,
+                                          grpc_chttp2_stream* s,
                                           grpc_slice slice, int is_last) {
   if (!s->pending_byte_stream) {
     grpc_slice_ref_internal(slice);
diff --git a/src/core/ext/transport/chttp2/transport/frame_data.h b/src/core/ext/transport/chttp2/transport/frame_data.h
index 81ec536..96f823a 100644
--- a/src/core/ext/transport/chttp2/transport/frame_data.h
+++ b/src/core/ext/transport/chttp2/transport/frame_data.h
@@ -49,40 +49,40 @@
   grpc_chttp2_stream_state state;
   uint8_t frame_type;
   uint32_t frame_size;
-  grpc_error *error;
+  grpc_error* error;
 
   bool is_frame_compressed;
-  grpc_chttp2_incoming_byte_stream *parsing_frame;
+  grpc_chttp2_incoming_byte_stream* parsing_frame;
 } grpc_chttp2_data_parser;
 
 /* initialize per-stream state for data frame parsing */
-grpc_error *grpc_chttp2_data_parser_init(grpc_chttp2_data_parser *parser);
+grpc_error* grpc_chttp2_data_parser_init(grpc_chttp2_data_parser* parser);
 
-void grpc_chttp2_data_parser_destroy(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_data_parser *parser);
+void grpc_chttp2_data_parser_destroy(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_data_parser* parser);
 
 /* start processing a new data frame */
-grpc_error *grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser *parser,
+grpc_error* grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser* parser,
                                                 uint8_t flags,
                                                 uint32_t stream_id,
-                                                grpc_chttp2_stream *s);
+                                                grpc_chttp2_stream* s);
 
 /* handle a slice of a data frame - is_last indicates the last slice of a
    frame */
-grpc_error *grpc_chttp2_data_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
-                                          grpc_chttp2_transport *t,
-                                          grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_data_parser_parse(grpc_exec_ctx* exec_ctx, void* parser,
+                                          grpc_chttp2_transport* t,
+                                          grpc_chttp2_stream* s,
                                           grpc_slice slice, int is_last);
 
-void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer *inbuf,
+void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer* inbuf,
                              uint32_t write_bytes, int is_eof,
-                             grpc_transport_one_way_stats *stats,
-                             grpc_slice_buffer *outbuf);
+                             grpc_transport_one_way_stats* stats,
+                             grpc_slice_buffer* outbuf);
 
-grpc_error *grpc_deframe_unprocessed_incoming_frames(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_data_parser *p, grpc_chttp2_stream *s,
-    grpc_slice_buffer *slices, grpc_slice *slice_out,
-    grpc_byte_stream **stream_out);
+grpc_error* grpc_deframe_unprocessed_incoming_frames(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_data_parser* p, grpc_chttp2_stream* s,
+    grpc_slice_buffer* slices, grpc_slice* slice_out,
+    grpc_byte_stream** stream_out);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.cc b/src/core/ext/transport/chttp2/transport/frame_goaway.cc
index 78ec08e..6be1d0e 100644
--- a/src/core/ext/transport/chttp2/transport/frame_goaway.cc
+++ b/src/core/ext/transport/chttp2/transport/frame_goaway.cc
@@ -25,42 +25,42 @@
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 
-void grpc_chttp2_goaway_parser_init(grpc_chttp2_goaway_parser *p) {
+void grpc_chttp2_goaway_parser_init(grpc_chttp2_goaway_parser* p) {
   p->debug_data = NULL;
 }
 
-void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser *p) {
+void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser* p) {
   gpr_free(p->debug_data);
 }
 
-grpc_error *grpc_chttp2_goaway_parser_begin_frame(grpc_chttp2_goaway_parser *p,
+grpc_error* grpc_chttp2_goaway_parser_begin_frame(grpc_chttp2_goaway_parser* p,
                                                   uint32_t length,
                                                   uint8_t flags) {
   if (length < 8) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "goaway frame too short (%d bytes)", length);
-    grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+    grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
     return err;
   }
 
   gpr_free(p->debug_data);
   p->debug_length = length - 8;
-  p->debug_data = (char *)gpr_malloc(p->debug_length);
+  p->debug_data = (char*)gpr_malloc(p->debug_length);
   p->debug_pos = 0;
   p->state = GRPC_CHTTP2_GOAWAY_LSI0;
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_chttp2_goaway_parser_parse(grpc_exec_ctx *exec_ctx,
-                                            void *parser,
-                                            grpc_chttp2_transport *t,
-                                            grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_goaway_parser_parse(grpc_exec_ctx* exec_ctx,
+                                            void* parser,
+                                            grpc_chttp2_transport* t,
+                                            grpc_chttp2_stream* s,
                                             grpc_slice slice, int is_last) {
-  uint8_t *const beg = GRPC_SLICE_START_PTR(slice);
-  uint8_t *const end = GRPC_SLICE_END_PTR(slice);
-  uint8_t *cur = beg;
-  grpc_chttp2_goaway_parser *p = (grpc_chttp2_goaway_parser *)parser;
+  uint8_t* const beg = GRPC_SLICE_START_PTR(slice);
+  uint8_t* const end = GRPC_SLICE_END_PTR(slice);
+  uint8_t* cur = beg;
+  grpc_chttp2_goaway_parser* p = (grpc_chttp2_goaway_parser*)parser;
 
   switch (p->state) {
     case GRPC_CHTTP2_GOAWAY_LSI0:
@@ -147,9 +147,9 @@
 
 void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code,
                                grpc_slice debug_data,
-                               grpc_slice_buffer *slice_buffer) {
+                               grpc_slice_buffer* slice_buffer) {
   grpc_slice header = GRPC_SLICE_MALLOC(9 + 4 + 4);
-  uint8_t *p = GRPC_SLICE_START_PTR(header);
+  uint8_t* p = GRPC_SLICE_START_PTR(header);
   uint32_t frame_length;
   GPR_ASSERT(GRPC_SLICE_LENGTH(debug_data) < UINT32_MAX - 4 - 4);
   frame_length = 4 + 4 + (uint32_t)GRPC_SLICE_LENGTH(debug_data);
diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.h b/src/core/ext/transport/chttp2/transport/frame_goaway.h
index 7b3aa45..9790d0b 100644
--- a/src/core/ext/transport/chttp2/transport/frame_goaway.h
+++ b/src/core/ext/transport/chttp2/transport/frame_goaway.h
@@ -45,24 +45,24 @@
   grpc_chttp2_goaway_parse_state state;
   uint32_t last_stream_id;
   uint32_t error_code;
-  char *debug_data;
+  char* debug_data;
   uint32_t debug_length;
   uint32_t debug_pos;
 } grpc_chttp2_goaway_parser;
 
-void grpc_chttp2_goaway_parser_init(grpc_chttp2_goaway_parser *p);
-void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser *p);
-grpc_error *grpc_chttp2_goaway_parser_begin_frame(
-    grpc_chttp2_goaway_parser *parser, uint32_t length, uint8_t flags);
-grpc_error *grpc_chttp2_goaway_parser_parse(grpc_exec_ctx *exec_ctx,
-                                            void *parser,
-                                            grpc_chttp2_transport *t,
-                                            grpc_chttp2_stream *s,
+void grpc_chttp2_goaway_parser_init(grpc_chttp2_goaway_parser* p);
+void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser* p);
+grpc_error* grpc_chttp2_goaway_parser_begin_frame(
+    grpc_chttp2_goaway_parser* parser, uint32_t length, uint8_t flags);
+grpc_error* grpc_chttp2_goaway_parser_parse(grpc_exec_ctx* exec_ctx,
+                                            void* parser,
+                                            grpc_chttp2_transport* t,
+                                            grpc_chttp2_stream* s,
                                             grpc_slice slice, int is_last);
 
 void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code,
                                grpc_slice debug_data,
-                               grpc_slice_buffer *slice_buffer);
+                               grpc_slice_buffer* slice_buffer);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.cc b/src/core/ext/transport/chttp2/transport/frame_ping.cc
index 1cfa883..d0feb51 100644
--- a/src/core/ext/transport/chttp2/transport/frame_ping.cc
+++ b/src/core/ext/transport/chttp2/transport/frame_ping.cc
@@ -29,7 +29,7 @@
 
 grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint64_t opaque_8bytes) {
   grpc_slice slice = GRPC_SLICE_MALLOC(9 + 8);
-  uint8_t *p = GRPC_SLICE_START_PTR(slice);
+  uint8_t* p = GRPC_SLICE_START_PTR(slice);
 
   *p++ = 0;
   *p++ = 0;
@@ -52,13 +52,13 @@
   return slice;
 }
 
-grpc_error *grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser *parser,
+grpc_error* grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser* parser,
                                                 uint32_t length,
                                                 uint8_t flags) {
   if (flags & 0xfe || length != 8) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "invalid ping: length=%d, flags=%02x", length, flags);
-    grpc_error *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+    grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
     return error;
   }
@@ -68,14 +68,14 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
-                                          grpc_chttp2_transport *t,
-                                          grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_ping_parser_parse(grpc_exec_ctx* exec_ctx, void* parser,
+                                          grpc_chttp2_transport* t,
+                                          grpc_chttp2_stream* s,
                                           grpc_slice slice, int is_last) {
-  uint8_t *const beg = GRPC_SLICE_START_PTR(slice);
-  uint8_t *const end = GRPC_SLICE_END_PTR(slice);
-  uint8_t *cur = beg;
-  grpc_chttp2_ping_parser *p = (grpc_chttp2_ping_parser *)parser;
+  uint8_t* const beg = GRPC_SLICE_START_PTR(slice);
+  uint8_t* const end = GRPC_SLICE_END_PTR(slice);
+  uint8_t* cur = beg;
+  grpc_chttp2_ping_parser* p = (grpc_chttp2_ping_parser*)parser;
 
   while (p->byte != 8 && cur != end) {
     p->opaque_8bytes |= (((uint64_t)*cur) << (56 - 8 * p->byte));
@@ -112,7 +112,7 @@
       if (!g_disable_ping_ack) {
         if (t->ping_ack_count == t->ping_ack_capacity) {
           t->ping_ack_capacity = GPR_MAX(t->ping_ack_capacity * 3 / 2, 3);
-          t->ping_acks = (uint64_t *)gpr_realloc(
+          t->ping_acks = (uint64_t*)gpr_realloc(
               t->ping_acks, t->ping_ack_capacity * sizeof(*t->ping_acks));
         }
         t->ping_acks[t->ping_ack_count++] = p->opaque_8bytes;
diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.h b/src/core/ext/transport/chttp2/transport/frame_ping.h
index ffc2f0c..034aad0 100644
--- a/src/core/ext/transport/chttp2/transport/frame_ping.h
+++ b/src/core/ext/transport/chttp2/transport/frame_ping.h
@@ -35,11 +35,11 @@
 
 grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint64_t opaque_8bytes);
 
-grpc_error *grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser *parser,
+grpc_error* grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser* parser,
                                                 uint32_t length, uint8_t flags);
-grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser,
-                                          grpc_chttp2_transport *t,
-                                          grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_ping_parser_parse(grpc_exec_ctx* exec_ctx, void* parser,
+                                          grpc_chttp2_transport* t,
+                                          grpc_chttp2_stream* s,
                                           grpc_slice slice, int is_last);
 
 /* Test-only function for disabling ping ack */
diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
index 0133b6e..05a7f05 100644
--- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
+++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
@@ -27,11 +27,11 @@
 #include "src/core/lib/transport/http2_errors.h"
 
 grpc_slice grpc_chttp2_rst_stream_create(uint32_t id, uint32_t code,
-                                         grpc_transport_one_way_stats *stats) {
+                                         grpc_transport_one_way_stats* stats) {
   static const size_t frame_size = 13;
   grpc_slice slice = GRPC_SLICE_MALLOC(frame_size);
   stats->framing_bytes += frame_size;
-  uint8_t *p = GRPC_SLICE_START_PTR(slice);
+  uint8_t* p = GRPC_SLICE_START_PTR(slice);
 
   // Frame size.
   *p++ = 0;
@@ -55,13 +55,13 @@
   return slice;
 }
 
-grpc_error *grpc_chttp2_rst_stream_parser_begin_frame(
-    grpc_chttp2_rst_stream_parser *parser, uint32_t length, uint8_t flags) {
+grpc_error* grpc_chttp2_rst_stream_parser_begin_frame(
+    grpc_chttp2_rst_stream_parser* parser, uint32_t length, uint8_t flags) {
   if (length != 4) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "invalid rst_stream: length=%d, flags=%02x", length,
                  flags);
-    grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+    grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
     return err;
   }
@@ -69,15 +69,15 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx,
-                                                void *parser,
-                                                grpc_chttp2_transport *t,
-                                                grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx* exec_ctx,
+                                                void* parser,
+                                                grpc_chttp2_transport* t,
+                                                grpc_chttp2_stream* s,
                                                 grpc_slice slice, int is_last) {
-  uint8_t *const beg = GRPC_SLICE_START_PTR(slice);
-  uint8_t *const end = GRPC_SLICE_END_PTR(slice);
-  uint8_t *cur = beg;
-  grpc_chttp2_rst_stream_parser *p = (grpc_chttp2_rst_stream_parser *)parser;
+  uint8_t* const beg = GRPC_SLICE_START_PTR(slice);
+  uint8_t* const end = GRPC_SLICE_END_PTR(slice);
+  uint8_t* cur = beg;
+  grpc_chttp2_rst_stream_parser* p = (grpc_chttp2_rst_stream_parser*)parser;
 
   while (p->byte != 4 && cur != end) {
     p->reason_bytes[p->byte] = *cur;
@@ -92,9 +92,9 @@
                       (((uint32_t)p->reason_bytes[1]) << 16) |
                       (((uint32_t)p->reason_bytes[2]) << 8) |
                       (((uint32_t)p->reason_bytes[3]));
-    grpc_error *error = GRPC_ERROR_NONE;
+    grpc_error* error = GRPC_ERROR_NONE;
     if (reason != GRPC_HTTP2_NO_ERROR || s->metadata_buffer[1].size == 0) {
-      char *message;
+      char* message;
       gpr_asprintf(&message, "Received RST_STREAM with error code %d", reason);
       error = grpc_error_set_int(
           grpc_error_set_str(GRPC_ERROR_CREATE_FROM_STATIC_STRING("RST_STREAM"),
diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
index 102ffdb..3f5417e 100644
--- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
+++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
@@ -34,14 +34,14 @@
 } grpc_chttp2_rst_stream_parser;
 
 grpc_slice grpc_chttp2_rst_stream_create(uint32_t stream_id, uint32_t code,
-                                         grpc_transport_one_way_stats *stats);
+                                         grpc_transport_one_way_stats* stats);
 
-grpc_error *grpc_chttp2_rst_stream_parser_begin_frame(
-    grpc_chttp2_rst_stream_parser *parser, uint32_t length, uint8_t flags);
-grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx,
-                                                void *parser,
-                                                grpc_chttp2_transport *t,
-                                                grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_rst_stream_parser_begin_frame(
+    grpc_chttp2_rst_stream_parser* parser, uint32_t length, uint8_t flags);
+grpc_error* grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx* exec_ctx,
+                                                void* parser,
+                                                grpc_chttp2_transport* t,
+                                                grpc_chttp2_stream* s,
                                                 grpc_slice slice, int is_last);
 
 #ifdef __cplusplus
diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.cc b/src/core/ext/transport/chttp2/transport/frame_settings.cc
index 82906d3..75bb78d 100644
--- a/src/core/ext/transport/chttp2/transport/frame_settings.cc
+++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc
@@ -31,7 +31,7 @@
 #include "src/core/lib/debug/trace.h"
 #include "src/core/lib/transport/http2_errors.h"
 
-static uint8_t *fill_header(uint8_t *out, uint32_t length, uint8_t flags) {
+static uint8_t* fill_header(uint8_t* out, uint32_t length, uint8_t flags) {
   *out++ = (uint8_t)(length >> 16);
   *out++ = (uint8_t)(length >> 8);
   *out++ = (uint8_t)(length);
@@ -44,13 +44,13 @@
   return out;
 }
 
-grpc_slice grpc_chttp2_settings_create(uint32_t *old_settings,
-                                       const uint32_t *new_settings,
+grpc_slice grpc_chttp2_settings_create(uint32_t* old_settings,
+                                       const uint32_t* new_settings,
                                        uint32_t force_mask, size_t count) {
   size_t i;
   uint32_t n = 0;
   grpc_slice output;
-  uint8_t *p;
+  uint8_t* p;
 
   for (i = 0; i < count; i++) {
     n += (new_settings[i] != old_settings[i] || (force_mask & (1u << i)) != 0);
@@ -82,9 +82,9 @@
   return output;
 }
 
-grpc_error *grpc_chttp2_settings_parser_begin_frame(
-    grpc_chttp2_settings_parser *parser, uint32_t length, uint8_t flags,
-    uint32_t *settings) {
+grpc_error* grpc_chttp2_settings_parser_begin_frame(
+    grpc_chttp2_settings_parser* parser, uint32_t length, uint8_t flags,
+    uint32_t* settings) {
   parser->target_settings = settings;
   memcpy(parser->incoming_settings, settings,
          GRPC_CHTTP2_NUM_SETTINGS * sizeof(uint32_t));
@@ -108,14 +108,14 @@
   }
 }
 
-grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx, void *p,
-                                              grpc_chttp2_transport *t,
-                                              grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_settings_parser_parse(grpc_exec_ctx* exec_ctx, void* p,
+                                              grpc_chttp2_transport* t,
+                                              grpc_chttp2_stream* s,
                                               grpc_slice slice, int is_last) {
-  grpc_chttp2_settings_parser *parser = (grpc_chttp2_settings_parser *)p;
-  const uint8_t *cur = GRPC_SLICE_START_PTR(slice);
-  const uint8_t *end = GRPC_SLICE_END_PTR(slice);
-  char *msg;
+  grpc_chttp2_settings_parser* parser = (grpc_chttp2_settings_parser*)p;
+  const uint8_t* cur = GRPC_SLICE_START_PTR(slice);
+  const uint8_t* end = GRPC_SLICE_END_PTR(slice);
+  char* msg;
   grpc_chttp2_setting_id id;
 
   if (parser->is_ack) {
@@ -180,7 +180,7 @@
         cur++;
 
         if (grpc_wire_id_to_setting_id(parser->id, &id)) {
-          const grpc_chttp2_setting_parameters *sp =
+          const grpc_chttp2_setting_parameters* sp =
               &grpc_chttp2_settings_parameters[id];
           if (parser->value < sp->min_value || parser->value > sp->max_value) {
             switch (sp->invalid_value_behavior) {
@@ -195,7 +195,7 @@
                     &t->qbuf);
                 gpr_asprintf(&msg, "invalid value %u passed for %s",
                              parser->value, sp->name);
-                grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+                grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
                 gpr_free(msg);
                 return err;
             }
diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.h b/src/core/ext/transport/chttp2/transport/frame_settings.h
index 3364da1..18bde92 100644
--- a/src/core/ext/transport/chttp2/transport/frame_settings.h
+++ b/src/core/ext/transport/chttp2/transport/frame_settings.h
@@ -40,7 +40,7 @@
 
 typedef struct {
   grpc_chttp2_settings_parse_state state;
-  uint32_t *target_settings;
+  uint32_t* target_settings;
   uint8_t is_ack;
   uint16_t id;
   uint32_t value;
@@ -48,18 +48,18 @@
 } grpc_chttp2_settings_parser;
 
 /* Create a settings frame by diffing old & new, and updating old to be new */
-grpc_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *newval,
+grpc_slice grpc_chttp2_settings_create(uint32_t* old, const uint32_t* newval,
                                        uint32_t force_mask, size_t count);
 /* Create an ack settings frame */
 grpc_slice grpc_chttp2_settings_ack_create(void);
 
-grpc_error *grpc_chttp2_settings_parser_begin_frame(
-    grpc_chttp2_settings_parser *parser, uint32_t length, uint8_t flags,
-    uint32_t *settings);
-grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx,
-                                              void *parser,
-                                              grpc_chttp2_transport *t,
-                                              grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_settings_parser_begin_frame(
+    grpc_chttp2_settings_parser* parser, uint32_t length, uint8_t flags,
+    uint32_t* settings);
+grpc_error* grpc_chttp2_settings_parser_parse(grpc_exec_ctx* exec_ctx,
+                                              void* parser,
+                                              grpc_chttp2_transport* t,
+                                              grpc_chttp2_stream* s,
                                               grpc_slice slice, int is_last);
 
 #ifdef __cplusplus
diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.cc b/src/core/ext/transport/chttp2/transport/frame_window_update.cc
index 15eaf59..62a4587 100644
--- a/src/core/ext/transport/chttp2/transport/frame_window_update.cc
+++ b/src/core/ext/transport/chttp2/transport/frame_window_update.cc
@@ -24,11 +24,11 @@
 #include <grpc/support/string_util.h>
 
 grpc_slice grpc_chttp2_window_update_create(
-    uint32_t id, uint32_t window_update, grpc_transport_one_way_stats *stats) {
+    uint32_t id, uint32_t window_update, grpc_transport_one_way_stats* stats) {
   static const size_t frame_size = 13;
   grpc_slice slice = GRPC_SLICE_MALLOC(frame_size);
   stats->header_bytes += frame_size;
-  uint8_t *p = GRPC_SLICE_START_PTR(slice);
+  uint8_t* p = GRPC_SLICE_START_PTR(slice);
 
   GPR_ASSERT(window_update);
 
@@ -49,13 +49,13 @@
   return slice;
 }
 
-grpc_error *grpc_chttp2_window_update_parser_begin_frame(
-    grpc_chttp2_window_update_parser *parser, uint32_t length, uint8_t flags) {
+grpc_error* grpc_chttp2_window_update_parser_begin_frame(
+    grpc_chttp2_window_update_parser* parser, uint32_t length, uint8_t flags) {
   if (flags || length != 4) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "invalid window update: length=%d, flags=%02x", length,
                  flags);
-    grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+    grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
     return err;
   }
@@ -64,14 +64,14 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_chttp2_window_update_parser_parse(
-    grpc_exec_ctx *exec_ctx, void *parser, grpc_chttp2_transport *t,
-    grpc_chttp2_stream *s, grpc_slice slice, int is_last) {
-  uint8_t *const beg = GRPC_SLICE_START_PTR(slice);
-  uint8_t *const end = GRPC_SLICE_END_PTR(slice);
-  uint8_t *cur = beg;
-  grpc_chttp2_window_update_parser *p =
-      (grpc_chttp2_window_update_parser *)parser;
+grpc_error* grpc_chttp2_window_update_parser_parse(
+    grpc_exec_ctx* exec_ctx, void* parser, grpc_chttp2_transport* t,
+    grpc_chttp2_stream* s, grpc_slice slice, int is_last) {
+  uint8_t* const beg = GRPC_SLICE_START_PTR(slice);
+  uint8_t* const end = GRPC_SLICE_END_PTR(slice);
+  uint8_t* cur = beg;
+  grpc_chttp2_window_update_parser* p =
+      (grpc_chttp2_window_update_parser*)parser;
 
   while (p->byte != 4 && cur != end) {
     p->amount |= ((uint32_t)*cur) << (8 * (3 - p->byte));
@@ -86,9 +86,9 @@
   if (p->byte == 4) {
     uint32_t received_update = p->amount;
     if (received_update == 0 || (received_update & 0x80000000u)) {
-      char *msg;
+      char* msg;
       gpr_asprintf(&msg, "invalid window update bytes: %d", p->amount);
-      grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+      grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
       gpr_free(msg);
       return err;
     }
diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.h b/src/core/ext/transport/chttp2/transport/frame_window_update.h
index 400f9f5..daf7d2d 100644
--- a/src/core/ext/transport/chttp2/transport/frame_window_update.h
+++ b/src/core/ext/transport/chttp2/transport/frame_window_update.h
@@ -35,13 +35,13 @@
 } grpc_chttp2_window_update_parser;
 
 grpc_slice grpc_chttp2_window_update_create(
-    uint32_t id, uint32_t window_delta, grpc_transport_one_way_stats *stats);
+    uint32_t id, uint32_t window_delta, grpc_transport_one_way_stats* stats);
 
-grpc_error *grpc_chttp2_window_update_parser_begin_frame(
-    grpc_chttp2_window_update_parser *parser, uint32_t length, uint8_t flags);
-grpc_error *grpc_chttp2_window_update_parser_parse(
-    grpc_exec_ctx *exec_ctx, void *parser, grpc_chttp2_transport *t,
-    grpc_chttp2_stream *s, grpc_slice slice, int is_last);
+grpc_error* grpc_chttp2_window_update_parser_begin_frame(
+    grpc_chttp2_window_update_parser* parser, uint32_t length, uint8_t flags);
+grpc_error* grpc_chttp2_window_update_parser_parse(
+    grpc_exec_ctx* exec_ctx, void* parser, grpc_chttp2_transport* t,
+    grpc_chttp2_stream* s, grpc_slice slice, int is_last);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
index c380869..b57c930 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
+++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
@@ -57,8 +57,6 @@
     {{0, 0}}                  /* data.refcounted */
 };
 
-extern grpc_core::TraceFlag grpc_http_trace;
-
 typedef struct {
   int is_first_frame;
   /* number of bytes in 'output' when we started the frame - used to calculate
@@ -70,15 +68,15 @@
   uint8_t seen_regular_header;
   /* output stream id */
   uint32_t stream_id;
-  grpc_slice_buffer *output;
-  grpc_transport_one_way_stats *stats;
+  grpc_slice_buffer* output;
+  grpc_transport_one_way_stats* stats;
   /* maximum size of a frame */
   size_t max_frame_size;
   bool use_true_binary_metadata;
 } framer_state;
 
 /* fills p (which is expected to be 9 bytes long) with a data frame header */
-static void fill_header(uint8_t *p, uint8_t type, uint32_t id, size_t len,
+static void fill_header(uint8_t* p, uint8_t type, uint32_t id, size_t len,
                         uint8_t flags) {
   GPR_ASSERT(len < 16777316);
   *p++ = (uint8_t)(len >> 16);
@@ -93,7 +91,7 @@
 }
 
 /* finish a frame - fill in the previously reserved header */
-static void finish_frame(framer_state *st, int is_header_boundary,
+static void finish_frame(framer_state* st, int is_header_boundary,
                          int is_last_in_stream) {
   uint8_t type = 0xff;
   type = st->is_first_frame ? GRPC_CHTTP2_FRAME_HEADER
@@ -109,7 +107,7 @@
 
 /* begin a new frame: reserve off header space, remember how many bytes we'd
    output before beginning */
-static void begin_frame(framer_state *st) {
+static void begin_frame(framer_state* st) {
   st->header_idx =
       grpc_slice_buffer_add_indexed(st->output, GRPC_SLICE_MALLOC(9));
   st->output_length_at_start_of_frame = st->output->length;
@@ -118,7 +116,7 @@
 /* make sure that the current frame is of the type desired, and has sufficient
    space to add at least about_to_add bytes -- finishes the current frame if
    needed */
-static void ensure_space(framer_state *st, size_t need_bytes) {
+static void ensure_space(framer_state* st, size_t need_bytes) {
   if (st->output->length - st->output_length_at_start_of_frame + need_bytes <=
       st->max_frame_size) {
     return;
@@ -128,7 +126,7 @@
 }
 
 /* increment a filter count, halve all counts if one element reaches max */
-static void inc_filter(uint8_t idx, uint32_t *sum, uint8_t *elems) {
+static void inc_filter(uint8_t idx, uint32_t* sum, uint8_t* elems) {
   elems[idx]++;
   if (elems[idx] < 255) {
     (*sum)++;
@@ -142,7 +140,7 @@
   }
 }
 
-static void add_header_data(framer_state *st, grpc_slice slice) {
+static void add_header_data(framer_state* st, grpc_slice slice) {
   size_t len = GRPC_SLICE_LENGTH(slice);
   size_t remaining;
   if (len == 0) return;
@@ -160,13 +158,13 @@
   }
 }
 
-static uint8_t *add_tiny_header_data(framer_state *st, size_t len) {
+static uint8_t* add_tiny_header_data(framer_state* st, size_t len) {
   ensure_space(st, len);
   st->stats->header_bytes += len;
   return grpc_slice_buffer_tiny_add(st->output, len);
 }
 
-static void evict_entry(grpc_chttp2_hpack_compressor *c) {
+static void evict_entry(grpc_chttp2_hpack_compressor* c) {
   c->tail_remote_index++;
   GPR_ASSERT(c->tail_remote_index > 0);
   GPR_ASSERT(c->table_size >=
@@ -181,7 +179,7 @@
 // Reserve space in table for the new element, evict entries if needed.
 // Return the new index of the element. Return 0 to indicate not adding to
 // table.
-static uint32_t prepare_space_for_new_elem(grpc_chttp2_hpack_compressor *c,
+static uint32_t prepare_space_for_new_elem(grpc_chttp2_hpack_compressor* c,
                                            size_t elem_size) {
   uint32_t new_index = c->tail_remote_index + c->table_elems + 1;
   GPR_ASSERT(elem_size < 65536);
@@ -208,14 +206,14 @@
 }
 
 /* dummy function */
-static void add_nothing(grpc_exec_ctx *exec_ctx,
-                        grpc_chttp2_hpack_compressor *c, grpc_mdelem elem,
+static void add_nothing(grpc_exec_ctx* exec_ctx,
+                        grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
                         size_t elem_size) {}
 
 // Add a key to the dynamic table. Both key and value will be added to table at
 // the decoder.
-static void add_key_with_index(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hpack_compressor *c,
+static void add_key_with_index(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hpack_compressor* c,
                                grpc_mdelem elem, uint32_t new_index) {
   if (new_index == 0) {
     return;
@@ -257,8 +255,8 @@
 }
 
 /* add an element to the decoder table */
-static void add_elem_with_index(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_compressor *c,
+static void add_elem_with_index(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_compressor* c,
                                 grpc_mdelem elem, uint32_t new_index) {
   if (new_index == 0) {
     return;
@@ -301,21 +299,21 @@
   add_key_with_index(exec_ctx, c, elem, new_index);
 }
 
-static void add_elem(grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_compressor *c,
+static void add_elem(grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_compressor* c,
                      grpc_mdelem elem, size_t elem_size) {
   uint32_t new_index = prepare_space_for_new_elem(c, elem_size);
   add_elem_with_index(exec_ctx, c, elem, new_index);
 }
 
-static void add_key(grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_compressor *c,
+static void add_key(grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_compressor* c,
                     grpc_mdelem elem, size_t elem_size) {
   uint32_t new_index = prepare_space_for_new_elem(c, elem_size);
   add_key_with_index(exec_ctx, c, elem, new_index);
 }
 
-static void emit_indexed(grpc_exec_ctx *exec_ctx,
-                         grpc_chttp2_hpack_compressor *c, uint32_t elem_index,
-                         framer_state *st) {
+static void emit_indexed(grpc_exec_ctx* exec_ctx,
+                         grpc_chttp2_hpack_compressor* c, uint32_t elem_index,
+                         framer_state* st) {
   GRPC_STATS_INC_HPACK_SEND_INDEXED(exec_ctx);
   uint32_t len = GRPC_CHTTP2_VARINT_LENGTH(elem_index, 1);
   GRPC_CHTTP2_WRITE_VARINT(elem_index, 1, 0x80, add_tiny_header_data(st, len),
@@ -328,7 +326,7 @@
   bool insert_null_before_wire_value;
 } wire_value;
 
-static wire_value get_wire_value(grpc_exec_ctx *exec_ctx, grpc_mdelem elem,
+static wire_value get_wire_value(grpc_exec_ctx* exec_ctx, grpc_mdelem elem,
                                  bool true_binary_enabled) {
   wire_value wire_val;
   if (grpc_is_binary_header(GRPC_MDKEY(elem))) {
@@ -359,15 +357,15 @@
   return GPR_SLICE_LENGTH(v.data) + v.insert_null_before_wire_value;
 }
 
-static void add_wire_value(framer_state *st, wire_value v) {
+static void add_wire_value(framer_state* st, wire_value v) {
   if (v.insert_null_before_wire_value) *add_tiny_header_data(st, 1) = 0;
   add_header_data(st, v.data);
 }
 
-static void emit_lithdr_incidx(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hpack_compressor *c,
+static void emit_lithdr_incidx(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hpack_compressor* c,
                                uint32_t key_index, grpc_mdelem elem,
-                               framer_state *st) {
+                               framer_state* st) {
   GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX(exec_ctx);
   uint32_t len_pfx = GRPC_CHTTP2_VARINT_LENGTH(key_index, 2);
   wire_value value =
@@ -383,10 +381,10 @@
   add_wire_value(st, value);
 }
 
-static void emit_lithdr_noidx(grpc_exec_ctx *exec_ctx,
-                              grpc_chttp2_hpack_compressor *c,
+static void emit_lithdr_noidx(grpc_exec_ctx* exec_ctx,
+                              grpc_chttp2_hpack_compressor* c,
                               uint32_t key_index, grpc_mdelem elem,
-                              framer_state *st) {
+                              framer_state* st) {
   GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX(exec_ctx);
   uint32_t len_pfx = GRPC_CHTTP2_VARINT_LENGTH(key_index, 4);
   wire_value value =
@@ -402,10 +400,10 @@
   add_wire_value(st, value);
 }
 
-static void emit_lithdr_incidx_v(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_hpack_compressor *c,
+static void emit_lithdr_incidx_v(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_hpack_compressor* c,
                                  uint32_t unused_index, grpc_mdelem elem,
-                                 framer_state *st) {
+                                 framer_state* st) {
   GPR_ASSERT(unused_index == 0);
   GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX_V(exec_ctx);
   GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED(exec_ctx);
@@ -426,10 +424,10 @@
   add_wire_value(st, value);
 }
 
-static void emit_lithdr_noidx_v(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_compressor *c,
+static void emit_lithdr_noidx_v(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_compressor* c,
                                 uint32_t unused_index, grpc_mdelem elem,
-                                framer_state *st) {
+                                framer_state* st) {
   GPR_ASSERT(unused_index == 0);
   GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V(exec_ctx);
   GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED(exec_ctx);
@@ -450,22 +448,22 @@
   add_wire_value(st, value);
 }
 
-static void emit_advertise_table_size_change(grpc_chttp2_hpack_compressor *c,
-                                             framer_state *st) {
+static void emit_advertise_table_size_change(grpc_chttp2_hpack_compressor* c,
+                                             framer_state* st) {
   uint32_t len = GRPC_CHTTP2_VARINT_LENGTH(c->max_table_size, 3);
   GRPC_CHTTP2_WRITE_VARINT(c->max_table_size, 3, 0x20,
                            add_tiny_header_data(st, len), len);
   c->advertise_table_size_change = 0;
 }
 
-static uint32_t dynidx(grpc_chttp2_hpack_compressor *c, uint32_t elem_index) {
+static uint32_t dynidx(grpc_chttp2_hpack_compressor* c, uint32_t elem_index) {
   return 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY + c->tail_remote_index +
          c->table_elems - elem_index;
 }
 
 /* encode an mdelem */
-static void hpack_enc(grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_compressor *c,
-                      grpc_mdelem elem, framer_state *st) {
+static void hpack_enc(grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_compressor* c,
+                      grpc_mdelem elem, framer_state* st) {
   GPR_ASSERT(GRPC_SLICE_LENGTH(GRPC_MDKEY(elem)) > 0);
   if (GRPC_SLICE_START_PTR(GRPC_MDKEY(elem))[0] != ':') { /* regular header */
     st->seen_regular_header = 1;
@@ -476,8 +474,8 @@
   }
 
   if (grpc_http_trace.enabled()) {
-    char *k = grpc_slice_to_c_string(GRPC_MDKEY(elem));
-    char *v = NULL;
+    char* k = grpc_slice_to_c_string(GRPC_MDKEY(elem));
+    char* v = NULL;
     if (grpc_is_binary_header(GRPC_MDKEY(elem))) {
       v = grpc_dump_slice(GRPC_MDVALUE(elem), GPR_DUMP_HEX);
     } else {
@@ -540,11 +538,10 @@
                          decoder_space_usage < MAX_DECODER_SPACE_USAGE &&
                          c->filter_elems[HASH_FRAGMENT_1(elem_hash)] >=
                              c->filter_elems_sum / ONE_ON_ADD_PROBABILITY;
-  void (*maybe_add)(grpc_exec_ctx *, grpc_chttp2_hpack_compressor *,
-                    grpc_mdelem, size_t) =
-      should_add_elem ? add_elem : add_nothing;
-  void (*emit)(grpc_exec_ctx *, grpc_chttp2_hpack_compressor *, uint32_t,
-               grpc_mdelem, framer_state *) =
+  void (*maybe_add)(grpc_exec_ctx*, grpc_chttp2_hpack_compressor*, grpc_mdelem,
+                    size_t) = should_add_elem ? add_elem : add_nothing;
+  void (*emit)(grpc_exec_ctx*, grpc_chttp2_hpack_compressor*, uint32_t,
+               grpc_mdelem, framer_state*) =
       should_add_elem ? emit_lithdr_incidx : emit_lithdr_noidx;
 
   /* no hits for the elem... maybe there's a key? */
@@ -582,9 +579,9 @@
 #define STRLEN_LIT(x) (sizeof(x) - 1)
 #define TIMEOUT_KEY "grpc-timeout"
 
-static void deadline_enc(grpc_exec_ctx *exec_ctx,
-                         grpc_chttp2_hpack_compressor *c, grpc_millis deadline,
-                         framer_state *st) {
+static void deadline_enc(grpc_exec_ctx* exec_ctx,
+                         grpc_chttp2_hpack_compressor* c, grpc_millis deadline,
+                         framer_state* st) {
   char timeout_str[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE];
   grpc_mdelem mdelem;
   grpc_http2_encode_timeout(deadline - grpc_exec_ctx_now(exec_ctx),
@@ -597,14 +594,14 @@
 
 static uint32_t elems_for_bytes(uint32_t bytes) { return (bytes + 31) / 32; }
 
-void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor *c) {
+void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor* c) {
   memset(c, 0, sizeof(*c));
   c->max_table_size = GRPC_CHTTP2_HPACKC_INITIAL_TABLE_SIZE;
   c->cap_table_elems = elems_for_bytes(c->max_table_size);
   c->max_table_elems = c->cap_table_elems;
   c->max_usable_size = GRPC_CHTTP2_HPACKC_INITIAL_TABLE_SIZE;
   c->table_elem_size =
-      (uint16_t *)gpr_malloc(sizeof(*c->table_elem_size) * c->cap_table_elems);
+      (uint16_t*)gpr_malloc(sizeof(*c->table_elem_size) * c->cap_table_elems);
   memset(c->table_elem_size, 0,
          sizeof(*c->table_elem_size) * c->cap_table_elems);
   for (size_t i = 0; i < GPR_ARRAY_SIZE(c->entries_keys); i++) {
@@ -612,8 +609,8 @@
   }
 }
 
-void grpc_chttp2_hpack_compressor_destroy(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_hpack_compressor *c) {
+void grpc_chttp2_hpack_compressor_destroy(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_hpack_compressor* c) {
   int i;
   for (i = 0; i < GRPC_CHTTP2_HPACKC_NUM_VALUES; i++) {
     if (c->entries_keys[i].refcount != &terminal_slice_refcount) {
@@ -625,15 +622,15 @@
 }
 
 void grpc_chttp2_hpack_compressor_set_max_usable_size(
-    grpc_chttp2_hpack_compressor *c, uint32_t max_table_size) {
+    grpc_chttp2_hpack_compressor* c, uint32_t max_table_size) {
   c->max_usable_size = max_table_size;
   grpc_chttp2_hpack_compressor_set_max_table_size(
       c, GPR_MIN(c->max_table_size, max_table_size));
 }
 
-static void rebuild_elems(grpc_chttp2_hpack_compressor *c, uint32_t new_cap) {
-  uint16_t *table_elem_size =
-      (uint16_t *)gpr_malloc(sizeof(*table_elem_size) * new_cap);
+static void rebuild_elems(grpc_chttp2_hpack_compressor* c, uint32_t new_cap) {
+  uint16_t* table_elem_size =
+      (uint16_t*)gpr_malloc(sizeof(*table_elem_size) * new_cap);
   uint32_t i;
 
   memset(table_elem_size, 0, sizeof(*table_elem_size) * new_cap);
@@ -651,7 +648,7 @@
 }
 
 void grpc_chttp2_hpack_compressor_set_max_table_size(
-    grpc_chttp2_hpack_compressor *c, uint32_t max_table_size) {
+    grpc_chttp2_hpack_compressor* c, uint32_t max_table_size) {
   max_table_size = GPR_MIN(max_table_size, c->max_usable_size);
   if (max_table_size == c->max_table_size) {
     return;
@@ -675,13 +672,13 @@
   }
 }
 
-void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hpack_compressor *c,
-                               grpc_mdelem **extra_headers,
+void grpc_chttp2_encode_header(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hpack_compressor* c,
+                               grpc_mdelem** extra_headers,
                                size_t extra_headers_size,
-                               grpc_metadata_batch *metadata,
-                               const grpc_encode_header_options *options,
-                               grpc_slice_buffer *outbuf) {
+                               grpc_metadata_batch* metadata,
+                               const grpc_encode_header_options* options,
+                               grpc_slice_buffer* outbuf) {
   GPR_ASSERT(options->stream_id != 0);
 
   framer_state st;
@@ -705,7 +702,7 @@
     hpack_enc(exec_ctx, c, *extra_headers[i], &st);
   }
   grpc_metadata_batch_assert_ok(metadata);
-  for (grpc_linked_mdelem *l = metadata->list.head; l; l = l->next) {
+  for (grpc_linked_mdelem* l = metadata->list.head; l; l = l->next) {
     hpack_enc(exec_ctx, c, l->md, &st);
   }
   grpc_millis deadline = metadata->deadline;
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
index 16316b6..96d8e99 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
@@ -34,6 +34,8 @@
 /* maximum table size we'll actually use */
 #define GRPC_CHTTP2_HPACKC_MAX_TABLE_SIZE (1024 * 1024)
 
+extern grpc_core::TraceFlag grpc_http_trace;
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -68,32 +70,32 @@
   uint32_t indices_keys[GRPC_CHTTP2_HPACKC_NUM_VALUES];
   uint32_t indices_elems[GRPC_CHTTP2_HPACKC_NUM_VALUES];
 
-  uint16_t *table_elem_size;
+  uint16_t* table_elem_size;
 } grpc_chttp2_hpack_compressor;
 
-void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor *c);
-void grpc_chttp2_hpack_compressor_destroy(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_hpack_compressor *c);
+void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor* c);
+void grpc_chttp2_hpack_compressor_destroy(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_hpack_compressor* c);
 void grpc_chttp2_hpack_compressor_set_max_table_size(
-    grpc_chttp2_hpack_compressor *c, uint32_t max_table_size);
+    grpc_chttp2_hpack_compressor* c, uint32_t max_table_size);
 void grpc_chttp2_hpack_compressor_set_max_usable_size(
-    grpc_chttp2_hpack_compressor *c, uint32_t max_table_size);
+    grpc_chttp2_hpack_compressor* c, uint32_t max_table_size);
 
 typedef struct {
   uint32_t stream_id;
   bool is_eof;
   bool use_true_binary_metadata;
   size_t max_frame_size;
-  grpc_transport_one_way_stats *stats;
+  grpc_transport_one_way_stats* stats;
 } grpc_encode_header_options;
 
-void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hpack_compressor *c,
-                               grpc_mdelem **extra_headers,
+void grpc_chttp2_encode_header(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hpack_compressor* c,
+                               grpc_mdelem** extra_headers,
                                size_t extra_headers_size,
-                               grpc_metadata_batch *metadata,
-                               const grpc_encode_header_options *options,
-                               grpc_slice_buffer *outbuf);
+                               grpc_metadata_batch* metadata,
+                               const grpc_encode_header_options* options,
+                               grpc_slice_buffer* outbuf);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc
index 0c190db..6f7db56 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc
+++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc
@@ -61,97 +61,97 @@
    a set of indirect jumps, and so not waste stack space. */
 
 /* forward declarations for parsing states */
-static grpc_error *parse_begin(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                               const uint8_t *end);
-static grpc_error *parse_error(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                               const uint8_t *end, grpc_error *error);
-static grpc_error *still_parse_error(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_hpack_parser *p,
-                                     const uint8_t *cur, const uint8_t *end);
-static grpc_error *parse_illegal_op(grpc_exec_ctx *exec_ctx,
-                                    grpc_chttp2_hpack_parser *p,
-                                    const uint8_t *cur, const uint8_t *end);
+static grpc_error* parse_begin(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                               const uint8_t* end);
+static grpc_error* parse_error(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                               const uint8_t* end, grpc_error* error);
+static grpc_error* still_parse_error(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_hpack_parser* p,
+                                     const uint8_t* cur, const uint8_t* end);
+static grpc_error* parse_illegal_op(grpc_exec_ctx* exec_ctx,
+                                    grpc_chttp2_hpack_parser* p,
+                                    const uint8_t* cur, const uint8_t* end);
 
-static grpc_error *parse_string_prefix(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end);
-static grpc_error *parse_key_string(grpc_exec_ctx *exec_ctx,
-                                    grpc_chttp2_hpack_parser *p,
-                                    const uint8_t *cur, const uint8_t *end);
-static grpc_error *parse_value_string_with_indexed_key(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-    const uint8_t *end);
-static grpc_error *parse_value_string_with_literal_key(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-    const uint8_t *end);
+static grpc_error* parse_string_prefix(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end);
+static grpc_error* parse_key_string(grpc_exec_ctx* exec_ctx,
+                                    grpc_chttp2_hpack_parser* p,
+                                    const uint8_t* cur, const uint8_t* end);
+static grpc_error* parse_value_string_with_indexed_key(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+    const uint8_t* end);
+static grpc_error* parse_value_string_with_literal_key(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+    const uint8_t* end);
 
-static grpc_error *parse_value0(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end);
-static grpc_error *parse_value1(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end);
-static grpc_error *parse_value2(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end);
-static grpc_error *parse_value3(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end);
-static grpc_error *parse_value4(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end);
-static grpc_error *parse_value5up(grpc_exec_ctx *exec_ctx,
-                                  grpc_chttp2_hpack_parser *p,
-                                  const uint8_t *cur, const uint8_t *end);
+static grpc_error* parse_value0(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end);
+static grpc_error* parse_value1(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end);
+static grpc_error* parse_value2(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end);
+static grpc_error* parse_value3(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end);
+static grpc_error* parse_value4(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end);
+static grpc_error* parse_value5up(grpc_exec_ctx* exec_ctx,
+                                  grpc_chttp2_hpack_parser* p,
+                                  const uint8_t* cur, const uint8_t* end);
 
-static grpc_error *parse_indexed_field(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end);
-static grpc_error *parse_indexed_field_x(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end);
-static grpc_error *parse_lithdr_incidx(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end);
-static grpc_error *parse_lithdr_incidx_x(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end);
-static grpc_error *parse_lithdr_incidx_v(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end);
-static grpc_error *parse_lithdr_notidx(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end);
-static grpc_error *parse_lithdr_notidx_x(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end);
-static grpc_error *parse_lithdr_notidx_v(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end);
-static grpc_error *parse_lithdr_nvridx(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end);
-static grpc_error *parse_lithdr_nvridx_x(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end);
-static grpc_error *parse_lithdr_nvridx_v(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end);
-static grpc_error *parse_max_tbl_size(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_hpack_parser *p,
-                                      const uint8_t *cur, const uint8_t *end);
-static grpc_error *parse_max_tbl_size_x(grpc_exec_ctx *exec_ctx,
-                                        grpc_chttp2_hpack_parser *p,
-                                        const uint8_t *cur, const uint8_t *end);
+static grpc_error* parse_indexed_field(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end);
+static grpc_error* parse_indexed_field_x(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end);
+static grpc_error* parse_lithdr_incidx(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end);
+static grpc_error* parse_lithdr_incidx_x(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end);
+static grpc_error* parse_lithdr_incidx_v(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end);
+static grpc_error* parse_lithdr_notidx(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end);
+static grpc_error* parse_lithdr_notidx_x(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end);
+static grpc_error* parse_lithdr_notidx_v(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end);
+static grpc_error* parse_lithdr_nvridx(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end);
+static grpc_error* parse_lithdr_nvridx_x(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end);
+static grpc_error* parse_lithdr_nvridx_v(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end);
+static grpc_error* parse_max_tbl_size(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_hpack_parser* p,
+                                      const uint8_t* cur, const uint8_t* end);
+static grpc_error* parse_max_tbl_size_x(grpc_exec_ctx* exec_ctx,
+                                        grpc_chttp2_hpack_parser* p,
+                                        const uint8_t* cur, const uint8_t* end);
 
 /* we translate the first byte of a hpack field into one of these decoding
    cases, then use a lookup table to jump directly to the appropriate parser.
@@ -649,11 +649,11 @@
 };
 
 /* emission helpers */
-static grpc_error *on_hdr(grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p,
+static grpc_error* on_hdr(grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p,
                           grpc_mdelem md, int add_to_table) {
   if (grpc_http_trace.enabled()) {
-    char *k = grpc_slice_to_c_string(GRPC_MDKEY(md));
-    char *v = NULL;
+    char* k = grpc_slice_to_c_string(GRPC_MDKEY(md));
+    char* v = NULL;
     if (grpc_is_binary_header(GRPC_MDKEY(md))) {
       v = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX);
     } else {
@@ -671,7 +671,7 @@
   if (add_to_table) {
     GPR_ASSERT(GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_INTERNED ||
                GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC);
-    grpc_error *err = grpc_chttp2_hptbl_add(exec_ctx, &p->table, md);
+    grpc_error* err = grpc_chttp2_hptbl_add(exec_ctx, &p->table, md);
     if (err != GRPC_ERROR_NONE) return err;
   }
   if (p->on_header == NULL) {
@@ -682,9 +682,9 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_slice take_string(grpc_exec_ctx *exec_ctx,
-                              grpc_chttp2_hpack_parser *p,
-                              grpc_chttp2_hpack_parser_string *str,
+static grpc_slice take_string(grpc_exec_ctx* exec_ctx,
+                              grpc_chttp2_hpack_parser* p,
+                              grpc_chttp2_hpack_parser_string* str,
                               bool intern) {
   grpc_slice s;
   if (!str->copied) {
@@ -708,18 +708,18 @@
 }
 
 /* jump to the next state */
-static grpc_error *parse_next(grpc_exec_ctx *exec_ctx,
-                              grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                              const uint8_t *end) {
+static grpc_error* parse_next(grpc_exec_ctx* exec_ctx,
+                              grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                              const uint8_t* end) {
   p->state = *p->next_state++;
   return p->state(exec_ctx, p, cur, end);
 }
 
 /* begin parsing a header: all functionality is encoded into lookup tables
    above */
-static grpc_error *parse_begin(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                               const uint8_t *end) {
+static grpc_error* parse_begin(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                               const uint8_t* end) {
   if (cur == end) {
     p->state = parse_begin;
     return GRPC_ERROR_NONE;
@@ -729,9 +729,9 @@
 }
 
 /* stream dependency and prioritization data: we just skip it */
-static grpc_error *parse_stream_weight(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_stream_weight(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end) {
   if (cur == end) {
     p->state = parse_stream_weight;
     return GRPC_ERROR_NONE;
@@ -740,9 +740,9 @@
   return p->after_prioritization(exec_ctx, p, cur + 1, end);
 }
 
-static grpc_error *parse_stream_dep3(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_hpack_parser *p,
-                                     const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_stream_dep3(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_hpack_parser* p,
+                                     const uint8_t* cur, const uint8_t* end) {
   if (cur == end) {
     p->state = parse_stream_dep3;
     return GRPC_ERROR_NONE;
@@ -751,9 +751,9 @@
   return parse_stream_weight(exec_ctx, p, cur + 1, end);
 }
 
-static grpc_error *parse_stream_dep2(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_hpack_parser *p,
-                                     const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_stream_dep2(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_hpack_parser* p,
+                                     const uint8_t* cur, const uint8_t* end) {
   if (cur == end) {
     p->state = parse_stream_dep2;
     return GRPC_ERROR_NONE;
@@ -762,9 +762,9 @@
   return parse_stream_dep3(exec_ctx, p, cur + 1, end);
 }
 
-static grpc_error *parse_stream_dep1(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_hpack_parser *p,
-                                     const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_stream_dep1(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_hpack_parser* p,
+                                     const uint8_t* cur, const uint8_t* end) {
   if (cur == end) {
     p->state = parse_stream_dep1;
     return GRPC_ERROR_NONE;
@@ -773,9 +773,9 @@
   return parse_stream_dep2(exec_ctx, p, cur + 1, end);
 }
 
-static grpc_error *parse_stream_dep0(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_hpack_parser *p,
-                                     const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_stream_dep0(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_hpack_parser* p,
+                                     const uint8_t* cur, const uint8_t* end) {
   if (cur == end) {
     p->state = parse_stream_dep0;
     return GRPC_ERROR_NONE;
@@ -785,10 +785,10 @@
 }
 
 /* emit an indexed field; jumps to begin the next field on completion */
-static grpc_error *finish_indexed_field(grpc_exec_ctx *exec_ctx,
-                                        grpc_chttp2_hpack_parser *p,
-                                        const uint8_t *cur,
-                                        const uint8_t *end) {
+static grpc_error* finish_indexed_field(grpc_exec_ctx* exec_ctx,
+                                        grpc_chttp2_hpack_parser* p,
+                                        const uint8_t* cur,
+                                        const uint8_t* end) {
   grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
   if (GRPC_MDISNULL(md)) {
     return grpc_error_set_int(
@@ -799,25 +799,25 @@
   }
   GRPC_MDELEM_REF(md);
   GRPC_STATS_INC_HPACK_RECV_INDEXED(exec_ctx);
-  grpc_error *err = on_hdr(exec_ctx, p, md, 0);
+  grpc_error* err = on_hdr(exec_ctx, p, md, 0);
   if (err != GRPC_ERROR_NONE) return err;
   return parse_begin(exec_ctx, p, cur, end);
 }
 
 /* parse an indexed field with index < 127 */
-static grpc_error *parse_indexed_field(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_indexed_field(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end) {
   p->dynamic_table_update_allowed = 0;
   p->index = (*cur) & 0x7f;
   return finish_indexed_field(exec_ctx, p, cur + 1, end);
 }
 
 /* parse an indexed field with index >= 127 */
-static grpc_error *parse_indexed_field_x(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end) {
+static grpc_error* parse_indexed_field_x(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       finish_indexed_field};
   p->dynamic_table_update_allowed = 0;
@@ -828,14 +828,14 @@
 }
 
 /* finish a literal header with incremental indexing */
-static grpc_error *finish_lithdr_incidx(grpc_exec_ctx *exec_ctx,
-                                        grpc_chttp2_hpack_parser *p,
-                                        const uint8_t *cur,
-                                        const uint8_t *end) {
+static grpc_error* finish_lithdr_incidx(grpc_exec_ctx* exec_ctx,
+                                        grpc_chttp2_hpack_parser* p,
+                                        const uint8_t* cur,
+                                        const uint8_t* end) {
   grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
   GPR_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
   GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX(exec_ctx);
-  grpc_error *err = on_hdr(
+  grpc_error* err = on_hdr(
       exec_ctx, p,
       grpc_mdelem_from_slices(exec_ctx, grpc_slice_ref_internal(GRPC_MDKEY(md)),
                               take_string(exec_ctx, p, &p->value, true)),
@@ -845,12 +845,12 @@
 }
 
 /* finish a literal header with incremental indexing with no index */
-static grpc_error *finish_lithdr_incidx_v(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_hpack_parser *p,
-                                          const uint8_t *cur,
-                                          const uint8_t *end) {
+static grpc_error* finish_lithdr_incidx_v(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_hpack_parser* p,
+                                          const uint8_t* cur,
+                                          const uint8_t* end) {
   GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX_V(exec_ctx);
-  grpc_error *err = on_hdr(
+  grpc_error* err = on_hdr(
       exec_ctx, p,
       grpc_mdelem_from_slices(exec_ctx, take_string(exec_ctx, p, &p->key, true),
                               take_string(exec_ctx, p, &p->value, true)),
@@ -860,9 +860,9 @@
 }
 
 /* parse a literal header with incremental indexing; index < 63 */
-static grpc_error *parse_lithdr_incidx(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_lithdr_incidx(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       parse_value_string_with_indexed_key, finish_lithdr_incidx};
   p->dynamic_table_update_allowed = 0;
@@ -872,10 +872,10 @@
 }
 
 /* parse a literal header with incremental indexing; index >= 63 */
-static grpc_error *parse_lithdr_incidx_x(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end) {
+static grpc_error* parse_lithdr_incidx_x(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       parse_string_prefix, parse_value_string_with_indexed_key,
       finish_lithdr_incidx};
@@ -887,10 +887,10 @@
 }
 
 /* parse a literal header with incremental indexing; index = 0 */
-static grpc_error *parse_lithdr_incidx_v(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end) {
+static grpc_error* parse_lithdr_incidx_v(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       parse_key_string, parse_string_prefix,
       parse_value_string_with_literal_key, finish_lithdr_incidx_v};
@@ -900,14 +900,14 @@
 }
 
 /* finish a literal header without incremental indexing */
-static grpc_error *finish_lithdr_notidx(grpc_exec_ctx *exec_ctx,
-                                        grpc_chttp2_hpack_parser *p,
-                                        const uint8_t *cur,
-                                        const uint8_t *end) {
+static grpc_error* finish_lithdr_notidx(grpc_exec_ctx* exec_ctx,
+                                        grpc_chttp2_hpack_parser* p,
+                                        const uint8_t* cur,
+                                        const uint8_t* end) {
   grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
   GPR_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
   GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX(exec_ctx);
-  grpc_error *err = on_hdr(
+  grpc_error* err = on_hdr(
       exec_ctx, p,
       grpc_mdelem_from_slices(exec_ctx, grpc_slice_ref_internal(GRPC_MDKEY(md)),
                               take_string(exec_ctx, p, &p->value, false)),
@@ -917,12 +917,12 @@
 }
 
 /* finish a literal header without incremental indexing with index = 0 */
-static grpc_error *finish_lithdr_notidx_v(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_hpack_parser *p,
-                                          const uint8_t *cur,
-                                          const uint8_t *end) {
+static grpc_error* finish_lithdr_notidx_v(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_hpack_parser* p,
+                                          const uint8_t* cur,
+                                          const uint8_t* end) {
   GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX_V(exec_ctx);
-  grpc_error *err = on_hdr(
+  grpc_error* err = on_hdr(
       exec_ctx, p,
       grpc_mdelem_from_slices(exec_ctx, take_string(exec_ctx, p, &p->key, true),
                               take_string(exec_ctx, p, &p->value, false)),
@@ -932,9 +932,9 @@
 }
 
 /* parse a literal header without incremental indexing; index < 15 */
-static grpc_error *parse_lithdr_notidx(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_lithdr_notidx(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       parse_value_string_with_indexed_key, finish_lithdr_notidx};
   p->dynamic_table_update_allowed = 0;
@@ -944,10 +944,10 @@
 }
 
 /* parse a literal header without incremental indexing; index >= 15 */
-static grpc_error *parse_lithdr_notidx_x(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end) {
+static grpc_error* parse_lithdr_notidx_x(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       parse_string_prefix, parse_value_string_with_indexed_key,
       finish_lithdr_notidx};
@@ -959,10 +959,10 @@
 }
 
 /* parse a literal header without incremental indexing; index == 0 */
-static grpc_error *parse_lithdr_notidx_v(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end) {
+static grpc_error* parse_lithdr_notidx_v(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       parse_key_string, parse_string_prefix,
       parse_value_string_with_literal_key, finish_lithdr_notidx_v};
@@ -972,14 +972,14 @@
 }
 
 /* finish a literal header that is never indexed */
-static grpc_error *finish_lithdr_nvridx(grpc_exec_ctx *exec_ctx,
-                                        grpc_chttp2_hpack_parser *p,
-                                        const uint8_t *cur,
-                                        const uint8_t *end) {
+static grpc_error* finish_lithdr_nvridx(grpc_exec_ctx* exec_ctx,
+                                        grpc_chttp2_hpack_parser* p,
+                                        const uint8_t* cur,
+                                        const uint8_t* end) {
   grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
   GPR_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
   GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX(exec_ctx);
-  grpc_error *err = on_hdr(
+  grpc_error* err = on_hdr(
       exec_ctx, p,
       grpc_mdelem_from_slices(exec_ctx, grpc_slice_ref_internal(GRPC_MDKEY(md)),
                               take_string(exec_ctx, p, &p->value, false)),
@@ -989,12 +989,12 @@
 }
 
 /* finish a literal header that is never indexed with an extra value */
-static grpc_error *finish_lithdr_nvridx_v(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_hpack_parser *p,
-                                          const uint8_t *cur,
-                                          const uint8_t *end) {
+static grpc_error* finish_lithdr_nvridx_v(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_hpack_parser* p,
+                                          const uint8_t* cur,
+                                          const uint8_t* end) {
   GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX_V(exec_ctx);
-  grpc_error *err = on_hdr(
+  grpc_error* err = on_hdr(
       exec_ctx, p,
       grpc_mdelem_from_slices(exec_ctx, take_string(exec_ctx, p, &p->key, true),
                               take_string(exec_ctx, p, &p->value, false)),
@@ -1004,9 +1004,9 @@
 }
 
 /* parse a literal header that is never indexed; index < 15 */
-static grpc_error *parse_lithdr_nvridx(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_lithdr_nvridx(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       parse_value_string_with_indexed_key, finish_lithdr_nvridx};
   p->dynamic_table_update_allowed = 0;
@@ -1016,10 +1016,10 @@
 }
 
 /* parse a literal header that is never indexed; index >= 15 */
-static grpc_error *parse_lithdr_nvridx_x(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end) {
+static grpc_error* parse_lithdr_nvridx_x(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       parse_string_prefix, parse_value_string_with_indexed_key,
       finish_lithdr_nvridx};
@@ -1031,10 +1031,10 @@
 }
 
 /* parse a literal header that is never indexed; index == 0 */
-static grpc_error *parse_lithdr_nvridx_v(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_hpack_parser *p,
-                                         const uint8_t *cur,
-                                         const uint8_t *end) {
+static grpc_error* parse_lithdr_nvridx_v(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_hpack_parser* p,
+                                         const uint8_t* cur,
+                                         const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       parse_key_string, parse_string_prefix,
       parse_value_string_with_literal_key, finish_lithdr_nvridx_v};
@@ -1044,22 +1044,22 @@
 }
 
 /* finish parsing a max table size change */
-static grpc_error *finish_max_tbl_size(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end) {
+static grpc_error* finish_max_tbl_size(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end) {
   if (grpc_http_trace.enabled()) {
     gpr_log(GPR_INFO, "MAX TABLE SIZE: %d", p->index);
   }
-  grpc_error *err =
+  grpc_error* err =
       grpc_chttp2_hptbl_set_current_table_size(exec_ctx, &p->table, p->index);
   if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
   return parse_begin(exec_ctx, p, cur, end);
 }
 
 /* parse a max table size change, max size < 15 */
-static grpc_error *parse_max_tbl_size(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_hpack_parser *p,
-                                      const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_max_tbl_size(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_hpack_parser* p,
+                                      const uint8_t* cur, const uint8_t* end) {
   if (p->dynamic_table_update_allowed == 0) {
     return parse_error(
         exec_ctx, p, cur, end,
@@ -1072,10 +1072,10 @@
 }
 
 /* parse a max table size change, max size >= 15 */
-static grpc_error *parse_max_tbl_size_x(grpc_exec_ctx *exec_ctx,
-                                        grpc_chttp2_hpack_parser *p,
-                                        const uint8_t *cur,
-                                        const uint8_t *end) {
+static grpc_error* parse_max_tbl_size_x(grpc_exec_ctx* exec_ctx,
+                                        grpc_chttp2_hpack_parser* p,
+                                        const uint8_t* cur,
+                                        const uint8_t* end) {
   static const grpc_chttp2_hpack_parser_state and_then[] = {
       finish_max_tbl_size};
   if (p->dynamic_table_update_allowed == 0) {
@@ -1092,9 +1092,9 @@
 }
 
 /* a parse error: jam the parse state into parse_error, and return error */
-static grpc_error *parse_error(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                               const uint8_t *end, grpc_error *err) {
+static grpc_error* parse_error(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                               const uint8_t* end, grpc_error* err) {
   GPR_ASSERT(err != GRPC_ERROR_NONE);
   if (p->last_error == GRPC_ERROR_NONE) {
     p->last_error = GRPC_ERROR_REF(err);
@@ -1103,28 +1103,28 @@
   return err;
 }
 
-static grpc_error *still_parse_error(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_hpack_parser *p,
-                                     const uint8_t *cur, const uint8_t *end) {
+static grpc_error* still_parse_error(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_hpack_parser* p,
+                                     const uint8_t* cur, const uint8_t* end) {
   return GRPC_ERROR_REF(p->last_error);
 }
 
-static grpc_error *parse_illegal_op(grpc_exec_ctx *exec_ctx,
-                                    grpc_chttp2_hpack_parser *p,
-                                    const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_illegal_op(grpc_exec_ctx* exec_ctx,
+                                    grpc_chttp2_hpack_parser* p,
+                                    const uint8_t* cur, const uint8_t* end) {
   GPR_ASSERT(cur != end);
-  char *msg;
+  char* msg;
   gpr_asprintf(&msg, "Illegal hpack op code %d", *cur);
-  grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+  grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
   gpr_free(msg);
   return parse_error(exec_ctx, p, cur, end, err);
 }
 
 /* parse the 1st byte of a varint into p->parsing.value
    no overflow is possible */
-static grpc_error *parse_value0(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end) {
+static grpc_error* parse_value0(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end) {
   if (cur == end) {
     p->state = parse_value0;
     return GRPC_ERROR_NONE;
@@ -1141,9 +1141,9 @@
 
 /* parse the 2nd byte of a varint into p->parsing.value
    no overflow is possible */
-static grpc_error *parse_value1(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end) {
+static grpc_error* parse_value1(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end) {
   if (cur == end) {
     p->state = parse_value1;
     return GRPC_ERROR_NONE;
@@ -1160,9 +1160,9 @@
 
 /* parse the 3rd byte of a varint into p->parsing.value
    no overflow is possible */
-static grpc_error *parse_value2(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end) {
+static grpc_error* parse_value2(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end) {
   if (cur == end) {
     p->state = parse_value2;
     return GRPC_ERROR_NONE;
@@ -1179,9 +1179,9 @@
 
 /* parse the 4th byte of a varint into p->parsing.value
    no overflow is possible */
-static grpc_error *parse_value3(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end) {
+static grpc_error* parse_value3(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end) {
   if (cur == end) {
     p->state = parse_value3;
     return GRPC_ERROR_NONE;
@@ -1198,13 +1198,13 @@
 
 /* parse the 5th byte of a varint into p->parsing.value
    depending on the byte, we may overflow, and care must be taken */
-static grpc_error *parse_value4(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end) {
+static grpc_error* parse_value4(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end) {
   uint8_t c;
   uint32_t cur_value;
   uint32_t add_value;
-  char *msg;
+  char* msg;
 
   if (cur == end) {
     p->state = parse_value4;
@@ -1235,7 +1235,7 @@
                "integer overflow in hpack integer decoding: have 0x%08x, "
                "got byte 0x%02x on byte 5",
                *p->parsing.value, *cur);
-  grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+  grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
   gpr_free(msg);
   return parse_error(exec_ctx, p, cur, end, err);
 }
@@ -1243,9 +1243,9 @@
 /* parse any trailing bytes in a varint: it's possible to append an arbitrary
    number of 0x80's and not affect the value - a zero will terminate - and
    anything else will overflow */
-static grpc_error *parse_value5up(grpc_exec_ctx *exec_ctx,
-                                  grpc_chttp2_hpack_parser *p,
-                                  const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_value5up(grpc_exec_ctx* exec_ctx,
+                                  grpc_chttp2_hpack_parser* p,
+                                  const uint8_t* cur, const uint8_t* end) {
   while (cur != end && *cur == 0x80) {
     ++cur;
   }
@@ -1259,20 +1259,20 @@
     return parse_next(exec_ctx, p, cur + 1, end);
   }
 
-  char *msg;
+  char* msg;
   gpr_asprintf(&msg,
                "integer overflow in hpack integer decoding: have 0x%08x, "
                "got byte 0x%02x sometime after byte 5",
                *p->parsing.value, *cur);
-  grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+  grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
   gpr_free(msg);
   return parse_error(exec_ctx, p, cur, end, err);
 }
 
 /* parse a string prefix */
-static grpc_error *parse_string_prefix(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_hpack_parser *p,
-                                       const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_string_prefix(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_hpack_parser* p,
+                                       const uint8_t* cur, const uint8_t* end) {
   if (cur == end) {
     p->state = parse_string_prefix;
     return GRPC_ERROR_NONE;
@@ -1289,24 +1289,24 @@
 }
 
 /* append some bytes to a string */
-static void append_bytes(grpc_chttp2_hpack_parser_string *str,
-                         const uint8_t *data, size_t length) {
+static void append_bytes(grpc_chttp2_hpack_parser_string* str,
+                         const uint8_t* data, size_t length) {
   if (length == 0) return;
   if (length + str->data.copied.length > str->data.copied.capacity) {
     GPR_ASSERT(str->data.copied.length + length <= UINT32_MAX);
     str->data.copied.capacity = (uint32_t)(str->data.copied.length + length);
     str->data.copied.str =
-        (char *)gpr_realloc(str->data.copied.str, str->data.copied.capacity);
+        (char*)gpr_realloc(str->data.copied.str, str->data.copied.capacity);
   }
   memcpy(str->data.copied.str + str->data.copied.length, data, length);
   GPR_ASSERT(length <= UINT32_MAX - str->data.copied.length);
   str->data.copied.length += (uint32_t)length;
 }
 
-static grpc_error *append_string(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_hpack_parser *p,
-                                 const uint8_t *cur, const uint8_t *end) {
-  grpc_chttp2_hpack_parser_string *str = p->parsing.str;
+static grpc_error* append_string(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_hpack_parser* p,
+                                 const uint8_t* cur, const uint8_t* end) {
+  grpc_chttp2_hpack_parser_string* str = p->parsing.str;
   uint32_t bits;
   uint8_t decoded[3];
   switch ((binary_state)p->binary) {
@@ -1403,12 +1403,12 @@
       GRPC_ERROR_CREATE_FROM_STATIC_STRING("Should never reach here")));
 }
 
-static grpc_error *finish_str(grpc_exec_ctx *exec_ctx,
-                              grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                              const uint8_t *end) {
+static grpc_error* finish_str(grpc_exec_ctx* exec_ctx,
+                              grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                              const uint8_t* end) {
   uint8_t decoded[2];
   uint32_t bits;
-  grpc_chttp2_hpack_parser_string *str = p->parsing.str;
+  grpc_chttp2_hpack_parser_string* str = p->parsing.str;
   switch ((binary_state)p->binary) {
     case NOT_BINARY:
       break;
@@ -1423,10 +1423,10 @@
     case B64_BYTE2:
       bits = p->base64_buffer;
       if (bits & 0xffff) {
-        char *msg;
+        char* msg;
         gpr_asprintf(&msg, "trailing bits in base64 encoding: 0x%04x",
                      bits & 0xffff);
-        grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+        grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
         gpr_free(msg);
         return parse_error(exec_ctx, p, cur, end, err);
       }
@@ -1436,10 +1436,10 @@
     case B64_BYTE3:
       bits = p->base64_buffer;
       if (bits & 0xff) {
-        char *msg;
+        char* msg;
         gpr_asprintf(&msg, "trailing bits in base64 encoding: 0x%02x",
                      bits & 0xff);
-        grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+        grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
         gpr_free(msg);
         return parse_error(exec_ctx, p, cur, end, err);
       }
@@ -1452,14 +1452,14 @@
 }
 
 /* decode a nibble from a huffman encoded stream */
-static grpc_error *huff_nibble(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hpack_parser *p, uint8_t nibble) {
+static grpc_error* huff_nibble(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hpack_parser* p, uint8_t nibble) {
   int16_t emit = emit_sub_tbl[16 * emit_tbl[p->huff_state] + nibble];
   int16_t next = next_sub_tbl[16 * next_tbl[p->huff_state] + nibble];
   if (emit != -1) {
     if (emit >= 0 && emit < 256) {
       uint8_t c = (uint8_t)emit;
-      grpc_error *err = append_string(exec_ctx, p, &c, (&c) + 1);
+      grpc_error* err = append_string(exec_ctx, p, &c, (&c) + 1);
       if (err != GRPC_ERROR_NONE) return err;
     } else {
       assert(emit == 256);
@@ -1470,11 +1470,11 @@
 }
 
 /* decode full bytes from a huffman encoded stream */
-static grpc_error *add_huff_bytes(grpc_exec_ctx *exec_ctx,
-                                  grpc_chttp2_hpack_parser *p,
-                                  const uint8_t *cur, const uint8_t *end) {
+static grpc_error* add_huff_bytes(grpc_exec_ctx* exec_ctx,
+                                  grpc_chttp2_hpack_parser* p,
+                                  const uint8_t* cur, const uint8_t* end) {
   for (; cur != end; ++cur) {
-    grpc_error *err = huff_nibble(exec_ctx, p, *cur >> 4);
+    grpc_error* err = huff_nibble(exec_ctx, p, *cur >> 4);
     if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
     err = huff_nibble(exec_ctx, p, *cur & 0xf);
     if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
@@ -1484,9 +1484,9 @@
 
 /* decode some string bytes based on the current decoding mode
    (huffman or not) */
-static grpc_error *add_str_bytes(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_hpack_parser *p,
-                                 const uint8_t *cur, const uint8_t *end) {
+static grpc_error* add_str_bytes(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_hpack_parser* p,
+                                 const uint8_t* cur, const uint8_t* end) {
   if (p->huff) {
     return add_huff_bytes(exec_ctx, p, cur, end);
   } else {
@@ -1495,19 +1495,19 @@
 }
 
 /* parse a string - tries to do large chunks at a time */
-static grpc_error *parse_string(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-                                const uint8_t *end) {
+static grpc_error* parse_string(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+                                const uint8_t* end) {
   size_t remaining = p->strlen - p->strgot;
   size_t given = (size_t)(end - cur);
   if (remaining <= given) {
-    grpc_error *err = add_str_bytes(exec_ctx, p, cur, cur + remaining);
+    grpc_error* err = add_str_bytes(exec_ctx, p, cur, cur + remaining);
     if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
     err = finish_str(exec_ctx, p, cur + remaining, end);
     if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
     return parse_next(exec_ctx, p, cur + remaining, end);
   } else {
-    grpc_error *err = add_str_bytes(exec_ctx, p, cur, cur + given);
+    grpc_error* err = add_str_bytes(exec_ctx, p, cur, cur + given);
     if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
     GPR_ASSERT(given <= UINT32_MAX - p->strgot);
     p->strgot += (uint32_t)given;
@@ -1517,17 +1517,17 @@
 }
 
 /* begin parsing a string - performs setup, calls parse_string */
-static grpc_error *begin_parse_string(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_hpack_parser *p,
-                                      const uint8_t *cur, const uint8_t *end,
+static grpc_error* begin_parse_string(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_hpack_parser* p,
+                                      const uint8_t* cur, const uint8_t* end,
                                       uint8_t binary,
-                                      grpc_chttp2_hpack_parser_string *str) {
+                                      grpc_chttp2_hpack_parser_string* str) {
   if (!p->huff && binary == NOT_BINARY && (end - cur) >= (intptr_t)p->strlen &&
       p->current_slice_refcount != NULL) {
     GRPC_STATS_INC_HPACK_RECV_UNCOMPRESSED(exec_ctx);
     str->copied = false;
     str->data.referenced.refcount = p->current_slice_refcount;
-    str->data.referenced.data.refcounted.bytes = (uint8_t *)cur;
+    str->data.referenced.data.refcounted.bytes = (uint8_t*)cur;
     str->data.referenced.data.refcounted.length = p->strlen;
     grpc_slice_ref_internal(str->data.referenced);
     return parse_next(exec_ctx, p, cur + p->strlen, end);
@@ -1556,23 +1556,23 @@
 }
 
 /* parse the key string */
-static grpc_error *parse_key_string(grpc_exec_ctx *exec_ctx,
-                                    grpc_chttp2_hpack_parser *p,
-                                    const uint8_t *cur, const uint8_t *end) {
+static grpc_error* parse_key_string(grpc_exec_ctx* exec_ctx,
+                                    grpc_chttp2_hpack_parser* p,
+                                    const uint8_t* cur, const uint8_t* end) {
   return begin_parse_string(exec_ctx, p, cur, end, NOT_BINARY, &p->key);
 }
 
 /* check if a key represents a binary header or not */
 
-static bool is_binary_literal_header(grpc_chttp2_hpack_parser *p) {
+static bool is_binary_literal_header(grpc_chttp2_hpack_parser* p) {
   return grpc_is_binary_header(
       p->key.copied ? grpc_slice_from_static_buffer(p->key.data.copied.str,
                                                     p->key.data.copied.length)
                     : p->key.data.referenced);
 }
 
-static grpc_error *is_binary_indexed_header(grpc_chttp2_hpack_parser *p,
-                                            bool *is) {
+static grpc_error* is_binary_indexed_header(grpc_chttp2_hpack_parser* p,
+                                            bool* is) {
   grpc_mdelem elem = grpc_chttp2_hptbl_lookup(&p->table, p->index);
   if (GRPC_MDISNULL(elem)) {
     return grpc_error_set_int(
@@ -1586,33 +1586,33 @@
 }
 
 /* parse the value string */
-static grpc_error *parse_value_string(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_hpack_parser *p,
-                                      const uint8_t *cur, const uint8_t *end,
+static grpc_error* parse_value_string(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_hpack_parser* p,
+                                      const uint8_t* cur, const uint8_t* end,
                                       bool is_binary) {
   return begin_parse_string(exec_ctx, p, cur, end,
                             is_binary ? BINARY_BEGIN : NOT_BINARY, &p->value);
 }
 
-static grpc_error *parse_value_string_with_indexed_key(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-    const uint8_t *end) {
+static grpc_error* parse_value_string_with_indexed_key(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+    const uint8_t* end) {
   bool is_binary = false;
-  grpc_error *err = is_binary_indexed_header(p, &is_binary);
+  grpc_error* err = is_binary_indexed_header(p, &is_binary);
   if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
   return parse_value_string(exec_ctx, p, cur, end, is_binary);
 }
 
-static grpc_error *parse_value_string_with_literal_key(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p, const uint8_t *cur,
-    const uint8_t *end) {
+static grpc_error* parse_value_string_with_literal_key(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p, const uint8_t* cur,
+    const uint8_t* end) {
   return parse_value_string(exec_ctx, p, cur, end, is_binary_literal_header(p));
 }
 
 /* PUBLIC INTERFACE */
 
-void grpc_chttp2_hpack_parser_init(grpc_exec_ctx *exec_ctx,
-                                   grpc_chttp2_hpack_parser *p) {
+void grpc_chttp2_hpack_parser_init(grpc_exec_ctx* exec_ctx,
+                                   grpc_chttp2_hpack_parser* p) {
   p->on_header = NULL;
   p->on_header_user_data = NULL;
   p->state = parse_begin;
@@ -1629,13 +1629,13 @@
   grpc_chttp2_hptbl_init(exec_ctx, &p->table);
 }
 
-void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser *p) {
+void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser* p) {
   p->after_prioritization = p->state;
   p->state = parse_stream_dep0;
 }
 
-void grpc_chttp2_hpack_parser_destroy(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_hpack_parser *p) {
+void grpc_chttp2_hpack_parser_destroy(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_hpack_parser* p) {
   grpc_chttp2_hptbl_destroy(exec_ctx, &p->table);
   GRPC_ERROR_UNREF(p->last_error);
   grpc_slice_unref_internal(exec_ctx, p->key.data.referenced);
@@ -1644,18 +1644,18 @@
   gpr_free(p->value.data.copied.str);
 }
 
-grpc_error *grpc_chttp2_hpack_parser_parse(grpc_exec_ctx *exec_ctx,
-                                           grpc_chttp2_hpack_parser *p,
+grpc_error* grpc_chttp2_hpack_parser_parse(grpc_exec_ctx* exec_ctx,
+                                           grpc_chttp2_hpack_parser* p,
                                            grpc_slice slice) {
 /* max number of bytes to parse at a time... limits call stack depth on
  * compilers without TCO */
 #define MAX_PARSE_LENGTH 1024
   p->current_slice_refcount = slice.refcount;
-  uint8_t *start = GRPC_SLICE_START_PTR(slice);
-  uint8_t *end = GRPC_SLICE_END_PTR(slice);
-  grpc_error *error = GRPC_ERROR_NONE;
+  uint8_t* start = GRPC_SLICE_START_PTR(slice);
+  uint8_t* end = GRPC_SLICE_END_PTR(slice);
+  grpc_error* error = GRPC_ERROR_NONE;
   while (start != end && error == GRPC_ERROR_NONE) {
-    uint8_t *target = start + GPR_MIN(MAX_PARSE_LENGTH, end - start);
+    uint8_t* target = start + GPR_MIN(MAX_PARSE_LENGTH, end - start);
     error = p->state(exec_ctx, p, start, target);
     start = target;
   }
@@ -1663,17 +1663,17 @@
   return error;
 }
 
-typedef void (*maybe_complete_func_type)(grpc_exec_ctx *exec_ctx,
-                                         grpc_chttp2_transport *t,
-                                         grpc_chttp2_stream *s);
+typedef void (*maybe_complete_func_type)(grpc_exec_ctx* exec_ctx,
+                                         grpc_chttp2_transport* t,
+                                         grpc_chttp2_stream* s);
 static const maybe_complete_func_type maybe_complete_funcs[] = {
     grpc_chttp2_maybe_complete_recv_initial_metadata,
     grpc_chttp2_maybe_complete_recv_trailing_metadata};
 
-static void force_client_rst_stream(grpc_exec_ctx *exec_ctx, void *sp,
-                                    grpc_error *error) {
-  grpc_chttp2_stream *s = (grpc_chttp2_stream *)sp;
-  grpc_chttp2_transport *t = s->t;
+static void force_client_rst_stream(grpc_exec_ctx* exec_ctx, void* sp,
+                                    grpc_error* error) {
+  grpc_chttp2_stream* s = (grpc_chttp2_stream*)sp;
+  grpc_chttp2_transport* t = s->t;
   if (!s->write_closed) {
     grpc_slice_buffer_add(
         &t->qbuf, grpc_chttp2_rst_stream_create(s->id, GRPC_HTTP2_NO_ERROR,
@@ -1685,10 +1685,10 @@
   GRPC_CHTTP2_STREAM_UNREF(exec_ctx, s, "final_rst");
 }
 
-static void parse_stream_compression_md(grpc_exec_ctx *exec_ctx,
-                                        grpc_chttp2_transport *t,
-                                        grpc_chttp2_stream *s,
-                                        grpc_metadata_batch *initial_metadata) {
+static void parse_stream_compression_md(grpc_exec_ctx* exec_ctx,
+                                        grpc_chttp2_transport* t,
+                                        grpc_chttp2_stream* s,
+                                        grpc_metadata_batch* initial_metadata) {
   if (initial_metadata->idx.named.content_encoding == NULL ||
       grpc_stream_compression_method_parse(
           GRPC_MDVALUE(initial_metadata->idx.named.content_encoding->md), false,
@@ -1698,17 +1698,17 @@
   }
 }
 
-grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx,
-                                            void *hpack_parser,
-                                            grpc_chttp2_transport *t,
-                                            grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_header_parser_parse(grpc_exec_ctx* exec_ctx,
+                                            void* hpack_parser,
+                                            grpc_chttp2_transport* t,
+                                            grpc_chttp2_stream* s,
                                             grpc_slice slice, int is_last) {
-  grpc_chttp2_hpack_parser *parser = (grpc_chttp2_hpack_parser *)hpack_parser;
+  grpc_chttp2_hpack_parser* parser = (grpc_chttp2_hpack_parser*)hpack_parser;
   GPR_TIMER_BEGIN("grpc_chttp2_hpack_parser_parse", 0);
   if (s != NULL) {
     s->stats.incoming.header_bytes += GRPC_SLICE_LENGTH(slice);
   }
-  grpc_error *error = grpc_chttp2_hpack_parser_parse(exec_ctx, parser, slice);
+  grpc_error* error = grpc_chttp2_hpack_parser_parse(exec_ctx, parser, slice);
   if (error != GRPC_ERROR_NONE) {
     GPR_TIMER_END("grpc_chttp2_hpack_parser_parse", 0);
     return error;
diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.h b/src/core/ext/transport/chttp2/transport/hpack_parser.h
index 5201417..838c482 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_parser.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_parser.h
@@ -33,16 +33,16 @@
 
 typedef struct grpc_chttp2_hpack_parser grpc_chttp2_hpack_parser;
 
-typedef grpc_error *(*grpc_chttp2_hpack_parser_state)(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p, const uint8_t *beg,
-    const uint8_t *end);
+typedef grpc_error* (*grpc_chttp2_hpack_parser_state)(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p, const uint8_t* beg,
+    const uint8_t* end);
 
 typedef struct {
   bool copied;
   struct {
     grpc_slice referenced;
     struct {
-      char *str;
+      char* str;
       uint32_t length;
       uint32_t capacity;
     } copied;
@@ -51,23 +51,23 @@
 
 struct grpc_chttp2_hpack_parser {
   /* user specified callback for each header output */
-  void (*on_header)(grpc_exec_ctx *exec_ctx, void *user_data, grpc_mdelem md);
-  void *on_header_user_data;
+  void (*on_header)(grpc_exec_ctx* exec_ctx, void* user_data, grpc_mdelem md);
+  void* on_header_user_data;
 
-  grpc_error *last_error;
+  grpc_error* last_error;
 
   /* current parse state - or a function that implements it */
   grpc_chttp2_hpack_parser_state state;
   /* future states dependent on the opening op code */
-  const grpc_chttp2_hpack_parser_state *next_state;
+  const grpc_chttp2_hpack_parser_state* next_state;
   /* what to do after skipping prioritization data */
   grpc_chttp2_hpack_parser_state after_prioritization;
   /* the refcount of the slice that we're currently parsing */
-  grpc_slice_refcount *current_slice_refcount;
+  grpc_slice_refcount* current_slice_refcount;
   /* the value we're currently parsing */
   union {
-    uint32_t *value;
-    grpc_chttp2_hpack_parser_string *str;
+    uint32_t* value;
+    grpc_chttp2_hpack_parser_string* str;
   } parsing;
   /* string parameters for each chunk */
   grpc_chttp2_hpack_parser_string key;
@@ -96,23 +96,23 @@
   grpc_chttp2_hptbl table;
 };
 
-void grpc_chttp2_hpack_parser_init(grpc_exec_ctx *exec_ctx,
-                                   grpc_chttp2_hpack_parser *p);
-void grpc_chttp2_hpack_parser_destroy(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_hpack_parser *p);
+void grpc_chttp2_hpack_parser_init(grpc_exec_ctx* exec_ctx,
+                                   grpc_chttp2_hpack_parser* p);
+void grpc_chttp2_hpack_parser_destroy(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_hpack_parser* p);
 
-void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser *p);
+void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser* p);
 
-grpc_error *grpc_chttp2_hpack_parser_parse(grpc_exec_ctx *exec_ctx,
-                                           grpc_chttp2_hpack_parser *p,
+grpc_error* grpc_chttp2_hpack_parser_parse(grpc_exec_ctx* exec_ctx,
+                                           grpc_chttp2_hpack_parser* p,
                                            grpc_slice slice);
 
 /* wraps grpc_chttp2_hpack_parser_parse to provide a frame level parser for
    the transport */
-grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx,
-                                            void *hpack_parser,
-                                            grpc_chttp2_transport *t,
-                                            grpc_chttp2_stream *s,
+grpc_error* grpc_chttp2_header_parser_parse(grpc_exec_ctx* exec_ctx,
+                                            void* hpack_parser,
+                                            grpc_chttp2_transport* t,
+                                            grpc_chttp2_stream* s,
                                             grpc_slice slice, int is_last);
 
 #ifdef __cplusplus
diff --git a/src/core/ext/transport/chttp2/transport/hpack_table.cc b/src/core/ext/transport/chttp2/transport/hpack_table.cc
index 1cb8c0a..b18c35f 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_table.cc
+++ b/src/core/ext/transport/chttp2/transport/hpack_table.cc
@@ -31,8 +31,8 @@
 extern grpc_core::TraceFlag grpc_http_trace;
 
 static struct {
-  const char *key;
-  const char *value;
+  const char* key;
+  const char* value;
 } static_table[] = {
     /* 0: */
     {NULL, NULL},
@@ -165,7 +165,7 @@
          GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
 }
 
-void grpc_chttp2_hptbl_init(grpc_exec_ctx *exec_ctx, grpc_chttp2_hptbl *tbl) {
+void grpc_chttp2_hptbl_init(grpc_exec_ctx* exec_ctx, grpc_chttp2_hptbl* tbl) {
   size_t i;
 
   memset(tbl, 0, sizeof(*tbl));
@@ -173,7 +173,7 @@
       GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE;
   tbl->max_entries = tbl->cap_entries =
       entries_for_bytes(tbl->current_table_bytes);
-  tbl->ents = (grpc_mdelem *)gpr_malloc(sizeof(*tbl->ents) * tbl->cap_entries);
+  tbl->ents = (grpc_mdelem*)gpr_malloc(sizeof(*tbl->ents) * tbl->cap_entries);
   memset(tbl->ents, 0, sizeof(*tbl->ents) * tbl->cap_entries);
   for (i = 1; i <= GRPC_CHTTP2_LAST_STATIC_ENTRY; i++) {
     tbl->static_ents[i - 1] = grpc_mdelem_from_slices(
@@ -184,8 +184,8 @@
   }
 }
 
-void grpc_chttp2_hptbl_destroy(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_hptbl *tbl) {
+void grpc_chttp2_hptbl_destroy(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_hptbl* tbl) {
   size_t i;
   for (i = 0; i < GRPC_CHTTP2_LAST_STATIC_ENTRY; i++) {
     GRPC_MDELEM_UNREF(exec_ctx, tbl->static_ents[i]);
@@ -197,7 +197,7 @@
   gpr_free(tbl->ents);
 }
 
-grpc_mdelem grpc_chttp2_hptbl_lookup(const grpc_chttp2_hptbl *tbl,
+grpc_mdelem grpc_chttp2_hptbl_lookup(const grpc_chttp2_hptbl* tbl,
                                      uint32_t tbl_index) {
   /* Static table comes first, just return an entry from it */
   if (tbl_index <= GRPC_CHTTP2_LAST_STATIC_ENTRY) {
@@ -215,7 +215,7 @@
 }
 
 /* Evict one element from the table */
-static void evict1(grpc_exec_ctx *exec_ctx, grpc_chttp2_hptbl *tbl) {
+static void evict1(grpc_exec_ctx* exec_ctx, grpc_chttp2_hptbl* tbl) {
   grpc_mdelem first_ent = tbl->ents[tbl->first_ent];
   size_t elem_bytes = GRPC_SLICE_LENGTH(GRPC_MDKEY(first_ent)) +
                       GRPC_SLICE_LENGTH(GRPC_MDVALUE(first_ent)) +
@@ -227,8 +227,8 @@
   GRPC_MDELEM_UNREF(exec_ctx, first_ent);
 }
 
-static void rebuild_ents(grpc_chttp2_hptbl *tbl, uint32_t new_cap) {
-  grpc_mdelem *ents = (grpc_mdelem *)gpr_malloc(sizeof(*ents) * new_cap);
+static void rebuild_ents(grpc_chttp2_hptbl* tbl, uint32_t new_cap) {
+  grpc_mdelem* ents = (grpc_mdelem*)gpr_malloc(sizeof(*ents) * new_cap);
   uint32_t i;
 
   for (i = 0; i < tbl->num_ents; i++) {
@@ -240,8 +240,8 @@
   tbl->first_ent = 0;
 }
 
-void grpc_chttp2_hptbl_set_max_bytes(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_hptbl *tbl,
+void grpc_chttp2_hptbl_set_max_bytes(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_hptbl* tbl,
                                      uint32_t max_bytes) {
   if (tbl->max_bytes == max_bytes) {
     return;
@@ -255,18 +255,18 @@
   tbl->max_bytes = max_bytes;
 }
 
-grpc_error *grpc_chttp2_hptbl_set_current_table_size(grpc_exec_ctx *exec_ctx,
-                                                     grpc_chttp2_hptbl *tbl,
+grpc_error* grpc_chttp2_hptbl_set_current_table_size(grpc_exec_ctx* exec_ctx,
+                                                     grpc_chttp2_hptbl* tbl,
                                                      uint32_t bytes) {
   if (tbl->current_table_bytes == bytes) {
     return GRPC_ERROR_NONE;
   }
   if (bytes > tbl->max_bytes) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg,
                  "Attempt to make hpack table %d bytes when max is %d bytes",
                  bytes, tbl->max_bytes);
-    grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+    grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
     return err;
   }
@@ -289,21 +289,21 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_chttp2_hptbl_add(grpc_exec_ctx *exec_ctx,
-                                  grpc_chttp2_hptbl *tbl, grpc_mdelem md) {
+grpc_error* grpc_chttp2_hptbl_add(grpc_exec_ctx* exec_ctx,
+                                  grpc_chttp2_hptbl* tbl, grpc_mdelem md) {
   /* determine how many bytes of buffer this entry represents */
   size_t elem_bytes = GRPC_SLICE_LENGTH(GRPC_MDKEY(md)) +
                       GRPC_SLICE_LENGTH(GRPC_MDVALUE(md)) +
                       GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
 
   if (tbl->current_table_bytes > tbl->max_bytes) {
-    char *msg;
+    char* msg;
     gpr_asprintf(
         &msg,
         "HPACK max table size reduced to %d but not reflected by hpack "
         "stream (still at %d)",
         tbl->max_bytes, tbl->current_table_bytes);
-    grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+    grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
     return err;
   }
@@ -341,7 +341,7 @@
 }
 
 grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
-    const grpc_chttp2_hptbl *tbl, grpc_mdelem md) {
+    const grpc_chttp2_hptbl* tbl, grpc_mdelem md) {
   grpc_chttp2_hptbl_find_result r = {0, 0};
   uint32_t i;
 
diff --git a/src/core/ext/transport/chttp2/transport/hpack_table.h b/src/core/ext/transport/chttp2/transport/hpack_table.h
index a3ce273..ddc8888 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_table.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_table.h
@@ -68,26 +68,26 @@
   /* a circular buffer of headers - this is stored in the opposite order to
      what hpack specifies, in order to simplify table management a little...
      meaning lookups need to SUBTRACT from the end position */
-  grpc_mdelem *ents;
+  grpc_mdelem* ents;
   grpc_mdelem static_ents[GRPC_CHTTP2_LAST_STATIC_ENTRY];
 } grpc_chttp2_hptbl;
 
 /* initialize a hpack table */
-void grpc_chttp2_hptbl_init(grpc_exec_ctx *exec_ctx, grpc_chttp2_hptbl *tbl);
-void grpc_chttp2_hptbl_destroy(grpc_exec_ctx *exec_ctx, grpc_chttp2_hptbl *tbl);
-void grpc_chttp2_hptbl_set_max_bytes(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_hptbl *tbl,
+void grpc_chttp2_hptbl_init(grpc_exec_ctx* exec_ctx, grpc_chttp2_hptbl* tbl);
+void grpc_chttp2_hptbl_destroy(grpc_exec_ctx* exec_ctx, grpc_chttp2_hptbl* tbl);
+void grpc_chttp2_hptbl_set_max_bytes(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_hptbl* tbl,
                                      uint32_t max_bytes);
-grpc_error *grpc_chttp2_hptbl_set_current_table_size(grpc_exec_ctx *exec_ctx,
-                                                     grpc_chttp2_hptbl *tbl,
+grpc_error* grpc_chttp2_hptbl_set_current_table_size(grpc_exec_ctx* exec_ctx,
+                                                     grpc_chttp2_hptbl* tbl,
                                                      uint32_t bytes);
 
 /* lookup a table entry based on its hpack index */
-grpc_mdelem grpc_chttp2_hptbl_lookup(const grpc_chttp2_hptbl *tbl,
+grpc_mdelem grpc_chttp2_hptbl_lookup(const grpc_chttp2_hptbl* tbl,
                                      uint32_t index);
 /* add a table entry to the index */
-grpc_error *grpc_chttp2_hptbl_add(grpc_exec_ctx *exec_ctx,
-                                  grpc_chttp2_hptbl *tbl,
+grpc_error* grpc_chttp2_hptbl_add(grpc_exec_ctx* exec_ctx,
+                                  grpc_chttp2_hptbl* tbl,
                                   grpc_mdelem md) GRPC_MUST_USE_RESULT;
 /* Find a key/value pair in the table... returns the index in the table of the
    most similar entry, or 0 if the value was not found */
@@ -96,7 +96,7 @@
   int has_value;
 } grpc_chttp2_hptbl_find_result;
 grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
-    const grpc_chttp2_hptbl *tbl, grpc_mdelem md);
+    const grpc_chttp2_hptbl* tbl, grpc_mdelem md);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/transport/http2_settings.cc b/src/core/ext/transport/chttp2/transport/http2_settings.cc
index 46b7c0c..0aab864 100644
--- a/src/core/ext/transport/chttp2/transport/http2_settings.cc
+++ b/src/core/ext/transport/chttp2/transport/http2_settings.cc
@@ -25,7 +25,7 @@
 
 const uint16_t grpc_setting_id_to_wire_id[] = {1, 2, 3, 4, 5, 6, 65027};
 
-bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out) {
+bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id* out) {
   uint32_t i = wire_id - 1;
   uint32_t x = i % 256;
   uint32_t y = i / 256;
diff --git a/src/core/ext/transport/chttp2/transport/http2_settings.h b/src/core/ext/transport/chttp2/transport/http2_settings.h
index 0f76106..86069b4 100644
--- a/src/core/ext/transport/chttp2/transport/http2_settings.h
+++ b/src/core/ext/transport/chttp2/transport/http2_settings.h
@@ -41,7 +41,7 @@
 #endif
 extern const uint16_t grpc_setting_id_to_wire_id[];
 
-bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out);
+bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id* out);
 
 typedef enum {
   GRPC_CHTTP2_CLAMP_INVALID_VALUE,
@@ -49,7 +49,7 @@
 } grpc_chttp2_invalid_value_behavior;
 
 typedef struct {
-  const char *name;
+  const char* name;
   uint32_t default_value;
   uint32_t min_value;
   uint32_t max_value;
diff --git a/src/core/ext/transport/chttp2/transport/incoming_metadata.cc b/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
index 187ce0e..15f80fb 100644
--- a/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
+++ b/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
@@ -26,31 +26,32 @@
 #include <grpc/support/log.h>
 
 void grpc_chttp2_incoming_metadata_buffer_init(
-    grpc_chttp2_incoming_metadata_buffer *buffer, gpr_arena *arena) {
+    grpc_chttp2_incoming_metadata_buffer* buffer, gpr_arena* arena) {
   buffer->arena = arena;
   grpc_metadata_batch_init(&buffer->batch);
   buffer->batch.deadline = GRPC_MILLIS_INF_FUTURE;
 }
 
 void grpc_chttp2_incoming_metadata_buffer_destroy(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_metadata_buffer *buffer) {
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_metadata_buffer* buffer) {
   grpc_metadata_batch_destroy(exec_ctx, &buffer->batch);
 }
 
-grpc_error *grpc_chttp2_incoming_metadata_buffer_add(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_metadata_buffer *buffer,
+grpc_error* grpc_chttp2_incoming_metadata_buffer_add(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_metadata_buffer* buffer,
     grpc_mdelem elem) {
   buffer->size += GRPC_MDELEM_LENGTH(elem);
   return grpc_metadata_batch_add_tail(
-      exec_ctx, &buffer->batch, (grpc_linked_mdelem *)gpr_arena_alloc(
-                                    buffer->arena, sizeof(grpc_linked_mdelem)),
+      exec_ctx, &buffer->batch,
+      (grpc_linked_mdelem*)gpr_arena_alloc(buffer->arena,
+                                           sizeof(grpc_linked_mdelem)),
       elem);
 }
 
-grpc_error *grpc_chttp2_incoming_metadata_buffer_replace_or_add(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_metadata_buffer *buffer,
+grpc_error* grpc_chttp2_incoming_metadata_buffer_replace_or_add(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_metadata_buffer* buffer,
     grpc_mdelem elem) {
-  for (grpc_linked_mdelem *l = buffer->batch.list.head; l != NULL;
+  for (grpc_linked_mdelem* l = buffer->batch.list.head; l != NULL;
        l = l->next) {
     if (grpc_slice_eq(GRPC_MDKEY(l->md), GRPC_MDKEY(elem))) {
       GRPC_MDELEM_UNREF(exec_ctx, l->md);
@@ -62,13 +63,13 @@
 }
 
 void grpc_chttp2_incoming_metadata_buffer_set_deadline(
-    grpc_chttp2_incoming_metadata_buffer *buffer, grpc_millis deadline) {
+    grpc_chttp2_incoming_metadata_buffer* buffer, grpc_millis deadline) {
   buffer->batch.deadline = deadline;
 }
 
 void grpc_chttp2_incoming_metadata_buffer_publish(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_metadata_buffer *buffer,
-    grpc_metadata_batch *batch) {
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_metadata_buffer* buffer,
+    grpc_metadata_batch* batch) {
   *batch = buffer->batch;
   grpc_metadata_batch_init(&buffer->batch);
 }
diff --git a/src/core/ext/transport/chttp2/transport/incoming_metadata.h b/src/core/ext/transport/chttp2/transport/incoming_metadata.h
index a0e01f2..7ccb4a0 100644
--- a/src/core/ext/transport/chttp2/transport/incoming_metadata.h
+++ b/src/core/ext/transport/chttp2/transport/incoming_metadata.h
@@ -26,28 +26,28 @@
 #endif
 
 typedef struct {
-  gpr_arena *arena;
+  gpr_arena* arena;
   grpc_metadata_batch batch;
   size_t size;  // total size of metadata
 } grpc_chttp2_incoming_metadata_buffer;
 
 /** assumes everything initially zeroed */
 void grpc_chttp2_incoming_metadata_buffer_init(
-    grpc_chttp2_incoming_metadata_buffer *buffer, gpr_arena *arena);
+    grpc_chttp2_incoming_metadata_buffer* buffer, gpr_arena* arena);
 void grpc_chttp2_incoming_metadata_buffer_destroy(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_metadata_buffer *buffer);
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_metadata_buffer* buffer);
 void grpc_chttp2_incoming_metadata_buffer_publish(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_metadata_buffer *buffer,
-    grpc_metadata_batch *batch);
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_metadata_buffer* buffer,
+    grpc_metadata_batch* batch);
 
-grpc_error *grpc_chttp2_incoming_metadata_buffer_add(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_metadata_buffer *buffer,
+grpc_error* grpc_chttp2_incoming_metadata_buffer_add(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_metadata_buffer* buffer,
     grpc_mdelem elem) GRPC_MUST_USE_RESULT;
-grpc_error *grpc_chttp2_incoming_metadata_buffer_replace_or_add(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_metadata_buffer *buffer,
+grpc_error* grpc_chttp2_incoming_metadata_buffer_replace_or_add(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_metadata_buffer* buffer,
     grpc_mdelem elem) GRPC_MUST_USE_RESULT;
 void grpc_chttp2_incoming_metadata_buffer_set_deadline(
-    grpc_chttp2_incoming_metadata_buffer *buffer, grpc_millis deadline);
+    grpc_chttp2_incoming_metadata_buffer* buffer, grpc_millis deadline);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h
index ee6974a..17eecbd 100644
--- a/src/core/ext/transport/chttp2/transport/internal.h
+++ b/src/core/ext/transport/chttp2/transport/internal.h
@@ -100,7 +100,7 @@
   GRPC_CHTTP2_INITIATE_WRITE_FORCE_RST_STREAM,
 } grpc_chttp2_initiate_write_reason;
 
-const char *grpc_chttp2_initiate_write_reason_string(
+const char* grpc_chttp2_initiate_write_reason_string(
     grpc_chttp2_initiate_write_reason reason);
 
 typedef struct {
@@ -171,13 +171,13 @@
 } grpc_chttp2_deframe_transport_state;
 
 typedef struct {
-  grpc_chttp2_stream *head;
-  grpc_chttp2_stream *tail;
+  grpc_chttp2_stream* head;
+  grpc_chttp2_stream* tail;
 } grpc_chttp2_stream_list;
 
 typedef struct {
-  grpc_chttp2_stream *next;
-  grpc_chttp2_stream *prev;
+  grpc_chttp2_stream* next;
+  grpc_chttp2_stream* prev;
 } grpc_chttp2_stream_link;
 
 /* We keep several sets of connection wide parameters */
@@ -201,8 +201,8 @@
 
 typedef struct grpc_chttp2_write_cb {
   int64_t call_at_byte;
-  grpc_closure *closure;
-  struct grpc_chttp2_write_cb *next;
+  grpc_closure* closure;
+  struct grpc_chttp2_write_cb* next;
 } grpc_chttp2_write_cb;
 
 /* forward declared in frame_data.h */
@@ -210,8 +210,8 @@
   grpc_byte_stream base;
   gpr_refcount refs;
 
-  grpc_chttp2_transport *transport; /* immutable */
-  grpc_chttp2_stream *stream;       /* immutable */
+  grpc_chttp2_transport* transport; /* immutable */
+  grpc_chttp2_stream* stream;       /* immutable */
 
   /* Accessed only by transport thread when stream->pending_byte_stream == false
    * Accessed only by application thread when stream->pending_byte_stream ==
@@ -224,7 +224,7 @@
   struct {
     grpc_closure closure;
     size_t max_size_hint;
-    grpc_closure *on_complete;
+    grpc_closure* on_complete;
   } next_action;
   grpc_closure destroy_action;
   grpc_closure finished_action;
@@ -240,10 +240,10 @@
 struct grpc_chttp2_transport {
   grpc_transport base; /* must be first */
   gpr_refcount refs;
-  grpc_endpoint *ep;
-  char *peer_string;
+  grpc_endpoint* ep;
+  char* peer_string;
 
-  grpc_combiner *combiner;
+  grpc_combiner* combiner;
 
   /** write execution state of the transport */
   grpc_chttp2_write_state write_state;
@@ -255,7 +255,7 @@
   /** is the transport destroying itself? */
   uint8_t destroying;
   /** has the upper layer closed the transport? */
-  grpc_error *closed_with_error;
+  grpc_error* closed_with_error;
 
   /** is there a read request to the endpoint outstanding? */
   uint8_t endpoint_reading;
@@ -280,13 +280,13 @@
   /** address to place a newly accepted stream - set and unset by
       grpc_chttp2_parsing_accept_stream; used by init_stream to
       publish the accepted server stream */
-  grpc_chttp2_stream **accepting_stream;
+  grpc_chttp2_stream** accepting_stream;
 
   struct {
     /* accept stream callback */
-    void (*accept_stream)(grpc_exec_ctx *exec_ctx, void *user_data,
-                          grpc_transport *transport, const void *server_data);
-    void *accept_stream_user_data;
+    void (*accept_stream)(grpc_exec_ctx* exec_ctx, void* user_data,
+                          grpc_transport* transport, const void* server_data);
+    void* accept_stream_user_data;
 
     /** connectivity tracking */
     grpc_connectivity_state_tracker state_tracker;
@@ -306,9 +306,10 @@
    */
   uint32_t write_buffer_size;
 
-  /** have we seen a goaway */
-  bool seen_goaway;
-  /** have we sent a goaway */
+  /** Set to a grpc_error object if a goaway frame is received. By default, set
+   * to GRPC_ERROR_NONE */
+  grpc_error* goaway_error;
+
   grpc_chttp2_sent_goaway_state sent_goaway_state;
 
   /** are the local settings dirty and need to be sent? */
@@ -337,7 +338,7 @@
   /** ping acks */
   size_t ping_ack_count;
   size_t ping_ack_capacity;
-  uint64_t *ping_acks;
+  uint64_t* ping_acks;
   grpc_chttp2_server_ping_recv_state ping_recv_state;
 
   /** parser for headers */
@@ -370,18 +371,13 @@
   uint32_t incoming_stream_id;
 
   /* active parser */
-  void *parser_data;
-  grpc_chttp2_stream *incoming_stream;
-  grpc_error *(*parser)(grpc_exec_ctx *exec_ctx, void *parser_user_data,
-                        grpc_chttp2_transport *t, grpc_chttp2_stream *s,
+  void* parser_data;
+  grpc_chttp2_stream* incoming_stream;
+  grpc_error* (*parser)(grpc_exec_ctx* exec_ctx, void* parser_user_data,
+                        grpc_chttp2_transport* t, grpc_chttp2_stream* s,
                         grpc_slice slice, int is_last);
 
-  /* goaway data */
-  grpc_status_code goaway_error;
-  uint32_t goaway_last_stream_index;
-  grpc_slice goaway_text;
-
-  grpc_chttp2_write_cb *write_cb_pool;
+  grpc_chttp2_write_cb* write_cb_pool;
 
   /* bdp estimator */
   grpc_closure next_bdp_ping_timer_expired_locked;
@@ -390,7 +386,7 @@
 
   /* if non-NULL, close the transport with this error when writes are finished
    */
-  grpc_error *close_transport_on_writes_finished;
+  grpc_error* close_transport_on_writes_finished;
 
   /* a list of closures to run after writes are finished */
   grpc_closure_list run_after_write;
@@ -440,11 +436,11 @@
 } grpc_published_metadata_method;
 
 struct grpc_chttp2_stream {
-  grpc_chttp2_transport *t;
-  grpc_stream_refcount *refcount;
+  grpc_chttp2_transport* t;
+  grpc_stream_refcount* refcount;
 
   grpc_closure destroy_stream;
-  grpc_closure *destroy_stream_arg;
+  grpc_closure* destroy_stream_arg;
 
   grpc_chttp2_stream_link links[STREAM_LIST_COUNT];
   uint8_t included[STREAM_LIST_COUNT];
@@ -453,29 +449,29 @@
   uint32_t id;
 
   /** things the upper layers would like to send */
-  grpc_metadata_batch *send_initial_metadata;
-  grpc_closure *send_initial_metadata_finished;
-  grpc_metadata_batch *send_trailing_metadata;
-  grpc_closure *send_trailing_metadata_finished;
+  grpc_metadata_batch* send_initial_metadata;
+  grpc_closure* send_initial_metadata_finished;
+  grpc_metadata_batch* send_trailing_metadata;
+  grpc_closure* send_trailing_metadata_finished;
 
-  grpc_byte_stream *fetching_send_message;
+  grpc_byte_stream* fetching_send_message;
   uint32_t fetched_send_message_length;
   grpc_slice fetching_slice;
   int64_t next_message_end_offset;
   int64_t flow_controlled_bytes_written;
   int64_t flow_controlled_bytes_flowed;
   grpc_closure complete_fetch_locked;
-  grpc_closure *fetching_send_message_finished;
+  grpc_closure* fetching_send_message_finished;
 
-  grpc_metadata_batch *recv_initial_metadata;
-  grpc_closure *recv_initial_metadata_ready;
-  bool *trailing_metadata_available;
-  grpc_byte_stream **recv_message;
-  grpc_closure *recv_message_ready;
-  grpc_metadata_batch *recv_trailing_metadata;
-  grpc_closure *recv_trailing_metadata_finished;
+  grpc_metadata_batch* recv_initial_metadata;
+  grpc_closure* recv_initial_metadata_ready;
+  bool* trailing_metadata_available;
+  grpc_byte_stream** recv_message;
+  grpc_closure* recv_message_ready;
+  grpc_metadata_batch* recv_trailing_metadata;
+  grpc_closure* recv_trailing_metadata_finished;
 
-  grpc_transport_stream_stats *collecting_stats;
+  grpc_transport_stream_stats* collecting_stats;
   grpc_transport_stream_stats stats;
 
   /** Is this stream closed for writing. */
@@ -494,9 +490,9 @@
   bool received_trailing_metadata;
 
   /** the error that resulted in this stream being read-closed */
-  grpc_error *read_closed_error;
+  grpc_error* read_closed_error;
   /** the error that resulted in this stream being write-closed */
-  grpc_error *write_closed_error;
+  grpc_error* write_closed_error;
 
   grpc_published_metadata_method published_metadata[2];
   bool final_metadata_requested;
@@ -509,16 +505,16 @@
    * Accessed only by application thread when stream->pending_byte_stream ==
    * true */
   grpc_slice_buffer unprocessed_incoming_frames_buffer;
-  grpc_closure *on_next;    /* protected by t combiner */
+  grpc_closure* on_next;    /* protected by t combiner */
   bool pending_byte_stream; /* protected by t combiner */
   grpc_closure reset_byte_stream;
-  grpc_error *byte_stream_error; /* protected by t combiner */
+  grpc_error* byte_stream_error; /* protected by t combiner */
   bool received_last_frame;      /* protected by t combiner */
 
   grpc_millis deadline;
 
   /** saw some stream level error */
-  grpc_error *forced_close_error;
+  grpc_error* forced_close_error;
   /** how many header frames have we received? */
   uint8_t header_frames_received;
   /** parsing state for data frames */
@@ -537,9 +533,9 @@
 
   grpc_slice_buffer flow_controlled_buffer;
 
-  grpc_chttp2_write_cb *on_flow_controlled_cbs;
-  grpc_chttp2_write_cb *on_write_finished_cbs;
-  grpc_chttp2_write_cb *finish_after_write;
+  grpc_chttp2_write_cb* on_flow_controlled_cbs;
+  grpc_chttp2_write_cb* on_write_finished_cbs;
+  grpc_chttp2_write_cb* finish_after_write;
   size_t sending_bytes;
 
   /* Stream compression method to be used. */
@@ -547,9 +543,9 @@
   /* Stream decompression method to be used. */
   grpc_stream_compression_method stream_decompression_method;
   /** Stream compression decompress context */
-  grpc_stream_compression_context *stream_decompression_ctx;
+  grpc_stream_compression_context* stream_decompression_ctx;
   /** Stream compression compress context */
-  grpc_stream_compression_context *stream_compression_ctx;
+  grpc_stream_compression_context* stream_compression_ctx;
 
   /** Buffer storing data that is compressed but not sent */
   grpc_slice_buffer compressed_data_buffer;
@@ -577,8 +573,8 @@
 
     The actual call chain is documented in the implementation of this function.
     */
-void grpc_chttp2_initiate_write(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_transport *t,
+void grpc_chttp2_initiate_write(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_transport* t,
                                 grpc_chttp2_initiate_write_reason reason);
 
 typedef struct {
@@ -591,85 +587,85 @@
 } grpc_chttp2_begin_write_result;
 
 grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t);
-void grpc_chttp2_end_write(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                           grpc_error *error);
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t);
+void grpc_chttp2_end_write(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                           grpc_error* error);
 
 /** Process one slice of incoming data; return 1 if the connection is still
     viable after reading, or 0 if the connection should be torn down */
-grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t,
+grpc_error* grpc_chttp2_perform_read(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t,
                                      grpc_slice slice);
 
-bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport *t,
-                                          grpc_chttp2_stream *s);
+bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport* t,
+                                          grpc_chttp2_stream* s);
 /** Get a writable stream
     returns non-zero if there was a stream available */
-bool grpc_chttp2_list_pop_writable_stream(grpc_chttp2_transport *t,
-                                          grpc_chttp2_stream **s);
-bool grpc_chttp2_list_remove_writable_stream(grpc_chttp2_transport *t,
-                                             grpc_chttp2_stream *s);
+bool grpc_chttp2_list_pop_writable_stream(grpc_chttp2_transport* t,
+                                          grpc_chttp2_stream** s);
+bool grpc_chttp2_list_remove_writable_stream(grpc_chttp2_transport* t,
+                                             grpc_chttp2_stream* s);
 
-bool grpc_chttp2_list_add_writing_stream(grpc_chttp2_transport *t,
-                                         grpc_chttp2_stream *s);
-bool grpc_chttp2_list_have_writing_streams(grpc_chttp2_transport *t);
-bool grpc_chttp2_list_pop_writing_stream(grpc_chttp2_transport *t,
-                                         grpc_chttp2_stream **s);
+bool grpc_chttp2_list_add_writing_stream(grpc_chttp2_transport* t,
+                                         grpc_chttp2_stream* s);
+bool grpc_chttp2_list_have_writing_streams(grpc_chttp2_transport* t);
+bool grpc_chttp2_list_pop_writing_stream(grpc_chttp2_transport* t,
+                                         grpc_chttp2_stream** s);
 
-void grpc_chttp2_list_add_written_stream(grpc_chttp2_transport *t,
-                                         grpc_chttp2_stream *s);
-bool grpc_chttp2_list_pop_written_stream(grpc_chttp2_transport *t,
-                                         grpc_chttp2_stream **s);
+void grpc_chttp2_list_add_written_stream(grpc_chttp2_transport* t,
+                                         grpc_chttp2_stream* s);
+bool grpc_chttp2_list_pop_written_stream(grpc_chttp2_transport* t,
+                                         grpc_chttp2_stream** s);
 
-void grpc_chttp2_list_add_waiting_for_concurrency(grpc_chttp2_transport *t,
-                                                  grpc_chttp2_stream *s);
-bool grpc_chttp2_list_pop_waiting_for_concurrency(grpc_chttp2_transport *t,
-                                                  grpc_chttp2_stream **s);
-void grpc_chttp2_list_remove_waiting_for_concurrency(grpc_chttp2_transport *t,
-                                                     grpc_chttp2_stream *s);
+void grpc_chttp2_list_add_waiting_for_concurrency(grpc_chttp2_transport* t,
+                                                  grpc_chttp2_stream* s);
+bool grpc_chttp2_list_pop_waiting_for_concurrency(grpc_chttp2_transport* t,
+                                                  grpc_chttp2_stream** s);
+void grpc_chttp2_list_remove_waiting_for_concurrency(grpc_chttp2_transport* t,
+                                                     grpc_chttp2_stream* s);
 
-void grpc_chttp2_list_add_stalled_by_transport(grpc_chttp2_transport *t,
-                                               grpc_chttp2_stream *s);
-bool grpc_chttp2_list_pop_stalled_by_transport(grpc_chttp2_transport *t,
-                                               grpc_chttp2_stream **s);
-void grpc_chttp2_list_remove_stalled_by_transport(grpc_chttp2_transport *t,
-                                                  grpc_chttp2_stream *s);
+void grpc_chttp2_list_add_stalled_by_transport(grpc_chttp2_transport* t,
+                                               grpc_chttp2_stream* s);
+bool grpc_chttp2_list_pop_stalled_by_transport(grpc_chttp2_transport* t,
+                                               grpc_chttp2_stream** s);
+void grpc_chttp2_list_remove_stalled_by_transport(grpc_chttp2_transport* t,
+                                                  grpc_chttp2_stream* s);
 
-void grpc_chttp2_list_add_stalled_by_stream(grpc_chttp2_transport *t,
-                                            grpc_chttp2_stream *s);
-bool grpc_chttp2_list_pop_stalled_by_stream(grpc_chttp2_transport *t,
-                                            grpc_chttp2_stream **s);
-bool grpc_chttp2_list_remove_stalled_by_stream(grpc_chttp2_transport *t,
-                                               grpc_chttp2_stream *s);
+void grpc_chttp2_list_add_stalled_by_stream(grpc_chttp2_transport* t,
+                                            grpc_chttp2_stream* s);
+bool grpc_chttp2_list_pop_stalled_by_stream(grpc_chttp2_transport* t,
+                                            grpc_chttp2_stream** s);
+bool grpc_chttp2_list_remove_stalled_by_stream(grpc_chttp2_transport* t,
+                                               grpc_chttp2_stream* s);
 
 /********* Flow Control ***************/
 
 // Takes in a flow control action and performs all the needed operations.
 void grpc_chttp2_act_on_flowctl_action(
-    grpc_exec_ctx *exec_ctx, const grpc_core::chttp2::FlowControlAction &action,
-    grpc_chttp2_transport *t, grpc_chttp2_stream *s);
+    grpc_exec_ctx* exec_ctx, const grpc_core::chttp2::FlowControlAction& action,
+    grpc_chttp2_transport* t, grpc_chttp2_stream* s);
 
 /********* End of Flow Control ***************/
 
-grpc_chttp2_stream *grpc_chttp2_parsing_lookup_stream(grpc_chttp2_transport *t,
+grpc_chttp2_stream* grpc_chttp2_parsing_lookup_stream(grpc_chttp2_transport* t,
                                                       uint32_t id);
-grpc_chttp2_stream *grpc_chttp2_parsing_accept_stream(grpc_exec_ctx *exec_ctx,
-                                                      grpc_chttp2_transport *t,
+grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_exec_ctx* exec_ctx,
+                                                      grpc_chttp2_transport* t,
                                                       uint32_t id);
 
-void grpc_chttp2_add_incoming_goaway(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t,
+void grpc_chttp2_add_incoming_goaway(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t,
                                      uint32_t goaway_error,
                                      grpc_slice goaway_text);
 
-void grpc_chttp2_parsing_become_skip_parser(grpc_exec_ctx *exec_ctx,
-                                            grpc_chttp2_transport *t);
+void grpc_chttp2_parsing_become_skip_parser(grpc_exec_ctx* exec_ctx,
+                                            grpc_chttp2_transport* t);
 
-void grpc_chttp2_complete_closure_step(grpc_exec_ctx *exec_ctx,
-                                       grpc_chttp2_transport *t,
-                                       grpc_chttp2_stream *s,
-                                       grpc_closure **pclosure,
-                                       grpc_error *error, const char *desc);
+void grpc_chttp2_complete_closure_step(grpc_exec_ctx* exec_ctx,
+                                       grpc_chttp2_transport* t,
+                                       grpc_chttp2_stream* s,
+                                       grpc_closure** pclosure,
+                                       grpc_error* error, const char* desc);
 
 #define GRPC_HEADER_SIZE_IN_BYTES 5
 #define MAX_SIZE_T (~(size_t)0)
@@ -678,37 +674,38 @@
 #define GRPC_CHTTP2_CLIENT_CONNECT_STRLEN \
   (sizeof(GRPC_CHTTP2_CLIENT_CONNECT_STRING) - 1)
 
-extern grpc_core::TraceFlag grpc_http_trace;
+// extern grpc_core::TraceFlag grpc_http_trace;
+// extern grpc_core::TraceFlag grpc_flowctl_trace;
 
-#define GRPC_CHTTP2_IF_TRACING(stmt) \
-  if (!grpc_http_trace.enabled())    \
-    ;                                \
-  else                               \
-  stmt
+#define GRPC_CHTTP2_IF_TRACING(stmt)      \
+  if (!(grpc_http_trace.enabled())) \
+    ;                                     \
+  else                                    \
+    stmt
 
-void grpc_chttp2_fake_status(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                             grpc_chttp2_stream *stream, grpc_error *error);
-void grpc_chttp2_mark_stream_closed(grpc_exec_ctx *exec_ctx,
-                                    grpc_chttp2_transport *t,
-                                    grpc_chttp2_stream *s, int close_reads,
-                                    int close_writes, grpc_error *error);
-void grpc_chttp2_start_writing(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_transport *t);
+void grpc_chttp2_fake_status(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                             grpc_chttp2_stream* stream, grpc_error* error);
+void grpc_chttp2_mark_stream_closed(grpc_exec_ctx* exec_ctx,
+                                    grpc_chttp2_transport* t,
+                                    grpc_chttp2_stream* s, int close_reads,
+                                    int close_writes, grpc_error* error);
+void grpc_chttp2_start_writing(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_transport* t);
 
 #ifndef NDEBUG
 #define GRPC_CHTTP2_STREAM_REF(stream, reason) \
   grpc_chttp2_stream_ref(stream, reason)
 #define GRPC_CHTTP2_STREAM_UNREF(exec_ctx, stream, reason) \
   grpc_chttp2_stream_unref(exec_ctx, stream, reason)
-void grpc_chttp2_stream_ref(grpc_chttp2_stream *s, const char *reason);
-void grpc_chttp2_stream_unref(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream *s,
-                              const char *reason);
+void grpc_chttp2_stream_ref(grpc_chttp2_stream* s, const char* reason);
+void grpc_chttp2_stream_unref(grpc_exec_ctx* exec_ctx, grpc_chttp2_stream* s,
+                              const char* reason);
 #else
 #define GRPC_CHTTP2_STREAM_REF(stream, reason) grpc_chttp2_stream_ref(stream)
 #define GRPC_CHTTP2_STREAM_UNREF(exec_ctx, stream, reason) \
   grpc_chttp2_stream_unref(exec_ctx, stream)
-void grpc_chttp2_stream_ref(grpc_chttp2_stream *s);
-void grpc_chttp2_stream_unref(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream *s);
+void grpc_chttp2_stream_ref(grpc_chttp2_stream* s);
+void grpc_chttp2_stream_unref(grpc_exec_ctx* exec_ctx, grpc_chttp2_stream* s);
 #endif
 
 #ifndef NDEBUG
@@ -716,69 +713,69 @@
   grpc_chttp2_ref_transport(t, r, __FILE__, __LINE__)
 #define GRPC_CHTTP2_UNREF_TRANSPORT(cl, t, r) \
   grpc_chttp2_unref_transport(cl, t, r, __FILE__, __LINE__)
-void grpc_chttp2_unref_transport(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_transport *t, const char *reason,
-                                 const char *file, int line);
-void grpc_chttp2_ref_transport(grpc_chttp2_transport *t, const char *reason,
-                               const char *file, int line);
+void grpc_chttp2_unref_transport(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_transport* t, const char* reason,
+                                 const char* file, int line);
+void grpc_chttp2_ref_transport(grpc_chttp2_transport* t, const char* reason,
+                               const char* file, int line);
 #else
 #define GRPC_CHTTP2_REF_TRANSPORT(t, r) grpc_chttp2_ref_transport(t)
 #define GRPC_CHTTP2_UNREF_TRANSPORT(cl, t, r) grpc_chttp2_unref_transport(cl, t)
-void grpc_chttp2_unref_transport(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_transport *t);
-void grpc_chttp2_ref_transport(grpc_chttp2_transport *t);
+void grpc_chttp2_unref_transport(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_transport* t);
+void grpc_chttp2_ref_transport(grpc_chttp2_transport* t);
 #endif
 
-grpc_chttp2_incoming_byte_stream *grpc_chttp2_incoming_byte_stream_create(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, grpc_chttp2_stream *s,
+grpc_chttp2_incoming_byte_stream* grpc_chttp2_incoming_byte_stream_create(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, grpc_chttp2_stream* s,
     uint32_t frame_size, uint32_t flags);
-grpc_error *grpc_chttp2_incoming_byte_stream_push(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs,
-    grpc_slice slice, grpc_slice *slice_out);
-grpc_error *grpc_chttp2_incoming_byte_stream_finished(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs,
-    grpc_error *error, bool reset_on_error);
+grpc_error* grpc_chttp2_incoming_byte_stream_push(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_byte_stream* bs,
+    grpc_slice slice, grpc_slice* slice_out);
+grpc_error* grpc_chttp2_incoming_byte_stream_finished(
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_byte_stream* bs,
+    grpc_error* error, bool reset_on_error);
 void grpc_chttp2_incoming_byte_stream_notify(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_incoming_byte_stream *bs,
-    grpc_error *error);
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_incoming_byte_stream* bs,
+    grpc_error* error);
 
-void grpc_chttp2_ack_ping(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
+void grpc_chttp2_ack_ping(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
                           uint64_t id);
 
 /** Add a new ping strike to ping_recv_state.ping_strikes. If
     ping_recv_state.ping_strikes > ping_policy.max_ping_strikes, it sends GOAWAY
     with error code ENHANCE_YOUR_CALM and additional debug data resembling
     "too_many_pings" followed by immediately closing the connection. */
-void grpc_chttp2_add_ping_strike(grpc_exec_ctx *exec_ctx,
-                                 grpc_chttp2_transport *t);
+void grpc_chttp2_add_ping_strike(grpc_exec_ctx* exec_ctx,
+                                 grpc_chttp2_transport* t);
 
 /** add a ref to the stream and add it to the writable list;
     ref will be dropped in writing.c */
-void grpc_chttp2_mark_stream_writable(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_transport *t,
-                                      grpc_chttp2_stream *s);
+void grpc_chttp2_mark_stream_writable(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_transport* t,
+                                      grpc_chttp2_stream* s);
 
-void grpc_chttp2_cancel_stream(grpc_exec_ctx *exec_ctx,
-                               grpc_chttp2_transport *t, grpc_chttp2_stream *s,
-                               grpc_error *due_to_error);
+void grpc_chttp2_cancel_stream(grpc_exec_ctx* exec_ctx,
+                               grpc_chttp2_transport* t, grpc_chttp2_stream* s,
+                               grpc_error* due_to_error);
 
-void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_exec_ctx *exec_ctx,
-                                                      grpc_chttp2_transport *t,
-                                                      grpc_chttp2_stream *s);
-void grpc_chttp2_maybe_complete_recv_message(grpc_exec_ctx *exec_ctx,
-                                             grpc_chttp2_transport *t,
-                                             grpc_chttp2_stream *s);
-void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_exec_ctx *exec_ctx,
-                                                       grpc_chttp2_transport *t,
-                                                       grpc_chttp2_stream *s);
+void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_exec_ctx* exec_ctx,
+                                                      grpc_chttp2_transport* t,
+                                                      grpc_chttp2_stream* s);
+void grpc_chttp2_maybe_complete_recv_message(grpc_exec_ctx* exec_ctx,
+                                             grpc_chttp2_transport* t,
+                                             grpc_chttp2_stream* s);
+void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_exec_ctx* exec_ctx,
+                                                       grpc_chttp2_transport* t,
+                                                       grpc_chttp2_stream* s);
 
-void grpc_chttp2_fail_pending_writes(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t,
-                                     grpc_chttp2_stream *s, grpc_error *error);
+void grpc_chttp2_fail_pending_writes(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t,
+                                     grpc_chttp2_stream* s, grpc_error* error);
 
 /** Set the default keepalive configurations, must only be called at
     initialization */
-void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args,
+void grpc_chttp2_config_default_keepalive_args(grpc_channel_args* args,
                                                bool is_client);
 
 #ifdef __cplusplus
diff --git a/src/core/ext/transport/chttp2/transport/parsing.cc b/src/core/ext/transport/chttp2/transport/parsing.cc
index 28a14e1..80f12c1 100644
--- a/src/core/ext/transport/chttp2/transport/parsing.cc
+++ b/src/core/ext/transport/chttp2/transport/parsing.cc
@@ -31,38 +31,38 @@
 #include "src/core/lib/transport/status_conversion.h"
 #include "src/core/lib/transport/timeout_encoding.h"
 
-static grpc_error *init_frame_parser(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t);
-static grpc_error *init_header_frame_parser(grpc_exec_ctx *exec_ctx,
-                                            grpc_chttp2_transport *t,
+static grpc_error* init_frame_parser(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t);
+static grpc_error* init_header_frame_parser(grpc_exec_ctx* exec_ctx,
+                                            grpc_chttp2_transport* t,
                                             int is_continuation);
-static grpc_error *init_data_frame_parser(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_transport *t);
-static grpc_error *init_rst_stream_parser(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_transport *t);
-static grpc_error *init_settings_frame_parser(grpc_exec_ctx *exec_ctx,
-                                              grpc_chttp2_transport *t);
-static grpc_error *init_window_update_frame_parser(grpc_exec_ctx *exec_ctx,
-                                                   grpc_chttp2_transport *t);
-static grpc_error *init_ping_parser(grpc_exec_ctx *exec_ctx,
-                                    grpc_chttp2_transport *t);
-static grpc_error *init_goaway_parser(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_transport *t);
-static grpc_error *init_skip_frame_parser(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_transport *t,
+static grpc_error* init_data_frame_parser(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_transport* t);
+static grpc_error* init_rst_stream_parser(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_transport* t);
+static grpc_error* init_settings_frame_parser(grpc_exec_ctx* exec_ctx,
+                                              grpc_chttp2_transport* t);
+static grpc_error* init_window_update_frame_parser(grpc_exec_ctx* exec_ctx,
+                                                   grpc_chttp2_transport* t);
+static grpc_error* init_ping_parser(grpc_exec_ctx* exec_ctx,
+                                    grpc_chttp2_transport* t);
+static grpc_error* init_goaway_parser(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_transport* t);
+static grpc_error* init_skip_frame_parser(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_transport* t,
                                           int is_header);
 
-static grpc_error *parse_frame_slice(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t, grpc_slice slice,
+static grpc_error* parse_frame_slice(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t, grpc_slice slice,
                                      int is_last);
 
-grpc_error *grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t,
+grpc_error* grpc_chttp2_perform_read(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t,
                                      grpc_slice slice) {
-  uint8_t *beg = GRPC_SLICE_START_PTR(slice);
-  uint8_t *end = GRPC_SLICE_END_PTR(slice);
-  uint8_t *cur = beg;
-  grpc_error *err;
+  uint8_t* beg = GRPC_SLICE_START_PTR(slice);
+  uint8_t* end = GRPC_SLICE_END_PTR(slice);
+  uint8_t* cur = beg;
+  grpc_error* err;
 
   if (cur == end) return GRPC_ERROR_NONE;
 
@@ -93,7 +93,7 @@
     case GRPC_DTS_CLIENT_PREFIX_23:
       while (cur != end && t->deframe_state != GRPC_DTS_FH_0) {
         if (*cur != GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state]) {
-          char *msg;
+          char* msg;
           gpr_asprintf(
               &msg,
               "Connect string mismatch: expected '%c' (%d) got '%c' (%d) "
@@ -200,7 +200,7 @@
       } else if (t->incoming_frame_size >
                  t->settings[GRPC_ACKED_SETTINGS]
                             [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]) {
-        char *msg;
+        char* msg;
         gpr_asprintf(&msg, "Frame size %d is larger than max frame size %d",
                      t->incoming_frame_size,
                      t->settings[GRPC_ACKED_SETTINGS]
@@ -216,10 +216,11 @@
     case GRPC_DTS_FRAME:
       GPR_ASSERT(cur < end);
       if ((uint32_t)(end - cur) == t->incoming_frame_size) {
-        err = parse_frame_slice(
-            exec_ctx, t, grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
-                                               (size_t)(end - beg)),
-            1);
+        err =
+            parse_frame_slice(exec_ctx, t,
+                              grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
+                                                    (size_t)(end - beg)),
+                              1);
         if (err != GRPC_ERROR_NONE) {
           return err;
         }
@@ -240,10 +241,11 @@
         t->incoming_stream = NULL;
         goto dts_fh_0; /* loop */
       } else {
-        err = parse_frame_slice(
-            exec_ctx, t, grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
-                                               (size_t)(end - beg)),
-            0);
+        err =
+            parse_frame_slice(exec_ctx, t,
+                              grpc_slice_sub_no_ref(slice, (size_t)(cur - beg),
+                                                    (size_t)(end - beg)),
+                              0);
         if (err != GRPC_ERROR_NONE) {
           return err;
         }
@@ -256,36 +258,36 @@
   GPR_UNREACHABLE_CODE(return 0);
 }
 
-static grpc_error *init_frame_parser(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t) {
+static grpc_error* init_frame_parser(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t) {
   if (t->is_first_frame &&
       t->incoming_frame_type != GRPC_CHTTP2_FRAME_SETTINGS) {
-    char *msg;
+    char* msg;
     gpr_asprintf(
         &msg, "Expected SETTINGS frame as the first frame, got frame type %d",
         t->incoming_frame_type);
-    grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+    grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
     return err;
   }
   t->is_first_frame = false;
   if (t->expect_continuation_stream_id != 0) {
     if (t->incoming_frame_type != GRPC_CHTTP2_FRAME_CONTINUATION) {
-      char *msg;
+      char* msg;
       gpr_asprintf(&msg, "Expected CONTINUATION frame, got frame type %02x",
                    t->incoming_frame_type);
-      grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+      grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
       gpr_free(msg);
       return err;
     }
     if (t->expect_continuation_stream_id != t->incoming_stream_id) {
-      char *msg;
+      char* msg;
       gpr_asprintf(
           &msg,
           "Expected CONTINUATION frame for grpc_chttp2_stream %08x, got "
           "grpc_chttp2_stream %08x",
           t->expect_continuation_stream_id, t->incoming_stream_id);
-      grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+      grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
       gpr_free(msg);
       return err;
     }
@@ -317,18 +319,18 @@
   }
 }
 
-static grpc_error *skip_parser(grpc_exec_ctx *exec_ctx, void *parser,
-                               grpc_chttp2_transport *t, grpc_chttp2_stream *s,
+static grpc_error* skip_parser(grpc_exec_ctx* exec_ctx, void* parser,
+                               grpc_chttp2_transport* t, grpc_chttp2_stream* s,
                                grpc_slice slice, int is_last) {
   return GRPC_ERROR_NONE;
 }
 
-static void skip_header(grpc_exec_ctx *exec_ctx, void *tp, grpc_mdelem md) {
+static void skip_header(grpc_exec_ctx* exec_ctx, void* tp, grpc_mdelem md) {
   GRPC_MDELEM_UNREF(exec_ctx, md);
 }
 
-static grpc_error *init_skip_frame_parser(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_transport *t,
+static grpc_error* init_skip_frame_parser(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_transport* t,
                                           int is_header) {
   if (is_header) {
     uint8_t is_eoh = t->expect_continuation_stream_id != 0;
@@ -344,17 +346,17 @@
   return GRPC_ERROR_NONE;
 }
 
-void grpc_chttp2_parsing_become_skip_parser(grpc_exec_ctx *exec_ctx,
-                                            grpc_chttp2_transport *t) {
+void grpc_chttp2_parsing_become_skip_parser(grpc_exec_ctx* exec_ctx,
+                                            grpc_chttp2_transport* t) {
   init_skip_frame_parser(exec_ctx, t,
                          t->parser == grpc_chttp2_header_parser_parse);
 }
 
-static grpc_error *init_data_frame_parser(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_transport *t) {
-  grpc_chttp2_stream *s =
+static grpc_error* init_data_frame_parser(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_transport* t) {
+  grpc_chttp2_stream* s =
       grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
-  grpc_error *err = GRPC_ERROR_NONE;
+  grpc_error* err = GRPC_ERROR_NONE;
   grpc_core::chttp2::FlowControlAction action;
   if (s == nullptr) {
     err = t->flow_control->RecvData(t->incoming_frame_size);
@@ -404,20 +406,20 @@
   }
 }
 
-static void free_timeout(void *p) { gpr_free(p); }
+static void free_timeout(void* p) { gpr_free(p); }
 
-static void on_initial_header(grpc_exec_ctx *exec_ctx, void *tp,
+static void on_initial_header(grpc_exec_ctx* exec_ctx, void* tp,
                               grpc_mdelem md) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)tp;
-  grpc_chttp2_stream *s = t->incoming_stream;
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)tp;
+  grpc_chttp2_stream* s = t->incoming_stream;
 
   GPR_TIMER_BEGIN("on_initial_header", 0);
 
   GPR_ASSERT(s != NULL);
 
   if (grpc_http_trace.enabled()) {
-    char *key = grpc_slice_to_c_string(GRPC_MDKEY(md));
-    char *value =
+    char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
+    char* value =
         grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
     gpr_log(GPR_INFO, "HTTP:%d:HDR:%s: %s: %s", s->id,
             t->is_client ? "CLI" : "SVR", key, value);
@@ -432,21 +434,21 @@
   }
 
   if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_GRPC_TIMEOUT)) {
-    grpc_millis *cached_timeout =
-        static_cast<grpc_millis *>(grpc_mdelem_get_user_data(md, free_timeout));
+    grpc_millis* cached_timeout =
+        static_cast<grpc_millis*>(grpc_mdelem_get_user_data(md, free_timeout));
     grpc_millis timeout;
     if (cached_timeout != NULL) {
       timeout = *cached_timeout;
     } else {
       if (!grpc_http2_decode_timeout(GRPC_MDVALUE(md), &timeout)) {
-        char *val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+        char* val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
         gpr_log(GPR_ERROR, "Ignoring bad timeout value '%s'", val);
         gpr_free(val);
         timeout = GRPC_MILLIS_INF_FUTURE;
       }
       if (GRPC_MDELEM_IS_INTERNED(md)) {
         /* store the result */
-        cached_timeout = (grpc_millis *)gpr_malloc(sizeof(grpc_millis));
+        cached_timeout = (grpc_millis*)gpr_malloc(sizeof(grpc_millis));
         *cached_timeout = timeout;
         grpc_mdelem_set_user_data(md, free_timeout, cached_timeout);
       }
@@ -476,7 +478,7 @@
       s->seen_error = true;
       GRPC_MDELEM_UNREF(exec_ctx, md);
     } else {
-      grpc_error *error = grpc_chttp2_incoming_metadata_buffer_add(
+      grpc_error* error = grpc_chttp2_incoming_metadata_buffer_add(
           exec_ctx, &s->metadata_buffer[0], md);
       if (error != GRPC_ERROR_NONE) {
         grpc_chttp2_cancel_stream(exec_ctx, t, s, error);
@@ -490,18 +492,18 @@
   GPR_TIMER_END("on_initial_header", 0);
 }
 
-static void on_trailing_header(grpc_exec_ctx *exec_ctx, void *tp,
+static void on_trailing_header(grpc_exec_ctx* exec_ctx, void* tp,
                                grpc_mdelem md) {
-  grpc_chttp2_transport *t = (grpc_chttp2_transport *)tp;
-  grpc_chttp2_stream *s = t->incoming_stream;
+  grpc_chttp2_transport* t = (grpc_chttp2_transport*)tp;
+  grpc_chttp2_stream* s = t->incoming_stream;
 
   GPR_TIMER_BEGIN("on_trailing_header", 0);
 
   GPR_ASSERT(s != NULL);
 
   if (grpc_http_trace.enabled()) {
-    char *key = grpc_slice_to_c_string(GRPC_MDKEY(md));
-    char *value =
+    char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
+    char* value =
         grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
     gpr_log(GPR_INFO, "HTTP:%d:TRL:%s: %s: %s", s->id,
             t->is_client ? "CLI" : "SVR", key, value);
@@ -534,7 +536,7 @@
     s->seen_error = true;
     GRPC_MDELEM_UNREF(exec_ctx, md);
   } else {
-    grpc_error *error = grpc_chttp2_incoming_metadata_buffer_add(
+    grpc_error* error = grpc_chttp2_incoming_metadata_buffer_add(
         exec_ctx, &s->metadata_buffer[1], md);
     if (error != GRPC_ERROR_NONE) {
       grpc_chttp2_cancel_stream(exec_ctx, t, s, error);
@@ -547,12 +549,12 @@
   GPR_TIMER_END("on_trailing_header", 0);
 }
 
-static grpc_error *init_header_frame_parser(grpc_exec_ctx *exec_ctx,
-                                            grpc_chttp2_transport *t,
+static grpc_error* init_header_frame_parser(grpc_exec_ctx* exec_ctx,
+                                            grpc_chttp2_transport* t,
                                             int is_continuation) {
   uint8_t is_eoh =
       (t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_HEADERS) != 0;
-  grpc_chttp2_stream *s;
+  grpc_chttp2_stream* s;
 
   /* TODO(ctiller): when to increment header_frames_received? */
 
@@ -588,7 +590,11 @@
         GRPC_CHTTP2_IF_TRACING(gpr_log(
             GPR_ERROR, "ignoring new grpc_chttp2_stream creation on client"));
       }
-      return init_skip_frame_parser(exec_ctx, t, 1);
+      grpc_error* err = init_skip_frame_parser(exec_ctx, t, 1);
+      if (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_HAS_PRIORITY) {
+        grpc_chttp2_hpack_parser_set_has_priority(&t->hpack_parser);
+      }
+      return err;
     } else if (t->last_new_stream_id >= t->incoming_stream_id) {
       GRPC_CHTTP2_IF_TRACING(gpr_log(
           GPR_ERROR,
@@ -662,14 +668,14 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *init_window_update_frame_parser(grpc_exec_ctx *exec_ctx,
-                                                   grpc_chttp2_transport *t) {
-  grpc_error *err = grpc_chttp2_window_update_parser_begin_frame(
+static grpc_error* init_window_update_frame_parser(grpc_exec_ctx* exec_ctx,
+                                                   grpc_chttp2_transport* t) {
+  grpc_error* err = grpc_chttp2_window_update_parser_begin_frame(
       &t->simple.window_update, t->incoming_frame_size,
       t->incoming_frame_flags);
   if (err != GRPC_ERROR_NONE) return err;
   if (t->incoming_stream_id != 0) {
-    grpc_chttp2_stream *s = t->incoming_stream =
+    grpc_chttp2_stream* s = t->incoming_stream =
         grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
     if (s == NULL) {
       return init_skip_frame_parser(exec_ctx, t, 0);
@@ -681,9 +687,9 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *init_ping_parser(grpc_exec_ctx *exec_ctx,
-                                    grpc_chttp2_transport *t) {
-  grpc_error *err = grpc_chttp2_ping_parser_begin_frame(
+static grpc_error* init_ping_parser(grpc_exec_ctx* exec_ctx,
+                                    grpc_chttp2_transport* t) {
+  grpc_error* err = grpc_chttp2_ping_parser_begin_frame(
       &t->simple.ping, t->incoming_frame_size, t->incoming_frame_flags);
   if (err != GRPC_ERROR_NONE) return err;
   t->parser = grpc_chttp2_ping_parser_parse;
@@ -691,12 +697,12 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *init_rst_stream_parser(grpc_exec_ctx *exec_ctx,
-                                          grpc_chttp2_transport *t) {
-  grpc_error *err = grpc_chttp2_rst_stream_parser_begin_frame(
+static grpc_error* init_rst_stream_parser(grpc_exec_ctx* exec_ctx,
+                                          grpc_chttp2_transport* t) {
+  grpc_error* err = grpc_chttp2_rst_stream_parser_begin_frame(
       &t->simple.rst_stream, t->incoming_frame_size, t->incoming_frame_flags);
   if (err != GRPC_ERROR_NONE) return err;
-  grpc_chttp2_stream *s = t->incoming_stream =
+  grpc_chttp2_stream* s = t->incoming_stream =
       grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
   if (!t->incoming_stream) {
     return init_skip_frame_parser(exec_ctx, t, 0);
@@ -707,9 +713,9 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *init_goaway_parser(grpc_exec_ctx *exec_ctx,
-                                      grpc_chttp2_transport *t) {
-  grpc_error *err = grpc_chttp2_goaway_parser_begin_frame(
+static grpc_error* init_goaway_parser(grpc_exec_ctx* exec_ctx,
+                                      grpc_chttp2_transport* t) {
+  grpc_error* err = grpc_chttp2_goaway_parser_begin_frame(
       &t->goaway_parser, t->incoming_frame_size, t->incoming_frame_flags);
   if (err != GRPC_ERROR_NONE) return err;
   t->parser = grpc_chttp2_goaway_parser_parse;
@@ -717,14 +723,14 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *init_settings_frame_parser(grpc_exec_ctx *exec_ctx,
-                                              grpc_chttp2_transport *t) {
+static grpc_error* init_settings_frame_parser(grpc_exec_ctx* exec_ctx,
+                                              grpc_chttp2_transport* t) {
   if (t->incoming_stream_id != 0) {
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
         "Settings frame received for grpc_chttp2_stream");
   }
 
-  grpc_error *err = grpc_chttp2_settings_parser_begin_frame(
+  grpc_error* err = grpc_chttp2_settings_parser_begin_frame(
       &t->simple.settings, t->incoming_frame_size, t->incoming_frame_flags,
       t->settings[GRPC_PEER_SETTINGS]);
   if (err != GRPC_ERROR_NONE) {
@@ -744,16 +750,16 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *parse_frame_slice(grpc_exec_ctx *exec_ctx,
-                                     grpc_chttp2_transport *t, grpc_slice slice,
+static grpc_error* parse_frame_slice(grpc_exec_ctx* exec_ctx,
+                                     grpc_chttp2_transport* t, grpc_slice slice,
                                      int is_last) {
-  grpc_chttp2_stream *s = t->incoming_stream;
-  grpc_error *err = t->parser(exec_ctx, t->parser_data, t, s, slice, is_last);
+  grpc_chttp2_stream* s = t->incoming_stream;
+  grpc_error* err = t->parser(exec_ctx, t->parser_data, t, s, slice, is_last);
   if (err == GRPC_ERROR_NONE) {
     return err;
   } else if (grpc_error_get_int(err, GRPC_ERROR_INT_STREAM_ID, NULL)) {
     if (grpc_http_trace.enabled()) {
-      const char *msg = grpc_error_string(err);
+      const char* msg = grpc_error_string(err);
       gpr_log(GPR_ERROR, "%s", msg);
     }
     grpc_chttp2_parsing_become_skip_parser(exec_ctx, t);
diff --git a/src/core/ext/transport/chttp2/transport/stream_lists.cc b/src/core/ext/transport/chttp2/transport/stream_lists.cc
index f2acdd4..5e9d5d3 100644
--- a/src/core/ext/transport/chttp2/transport/stream_lists.cc
+++ b/src/core/ext/transport/chttp2/transport/stream_lists.cc
@@ -21,7 +21,7 @@
 
 #include <grpc/support/log.h>
 
-static const char *stream_list_id_string(grpc_chttp2_stream_list_id id) {
+static const char* stream_list_id_string(grpc_chttp2_stream_list_id id) {
   switch (id) {
     case GRPC_CHTTP2_LIST_WRITABLE:
       return "writable";
@@ -43,17 +43,17 @@
 
 /* core list management */
 
-static bool stream_list_empty(grpc_chttp2_transport *t,
+static bool stream_list_empty(grpc_chttp2_transport* t,
                               grpc_chttp2_stream_list_id id) {
   return t->lists[id].head == NULL;
 }
 
-static bool stream_list_pop(grpc_chttp2_transport *t,
-                            grpc_chttp2_stream **stream,
+static bool stream_list_pop(grpc_chttp2_transport* t,
+                            grpc_chttp2_stream** stream,
                             grpc_chttp2_stream_list_id id) {
-  grpc_chttp2_stream *s = t->lists[id].head;
+  grpc_chttp2_stream* s = t->lists[id].head;
   if (s) {
-    grpc_chttp2_stream *new_head = s->links[id].next;
+    grpc_chttp2_stream* new_head = s->links[id].next;
     GPR_ASSERT(s->included[id]);
     if (new_head) {
       t->lists[id].head = new_head;
@@ -72,7 +72,7 @@
   return s != 0;
 }
 
-static void stream_list_remove(grpc_chttp2_transport *t, grpc_chttp2_stream *s,
+static void stream_list_remove(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
                                grpc_chttp2_stream_list_id id) {
   GPR_ASSERT(s->included[id]);
   s->included[id] = 0;
@@ -93,8 +93,8 @@
   }
 }
 
-static bool stream_list_maybe_remove(grpc_chttp2_transport *t,
-                                     grpc_chttp2_stream *s,
+static bool stream_list_maybe_remove(grpc_chttp2_transport* t,
+                                     grpc_chttp2_stream* s,
                                      grpc_chttp2_stream_list_id id) {
   if (s->included[id]) {
     stream_list_remove(t, s, id);
@@ -104,10 +104,10 @@
   }
 }
 
-static void stream_list_add_tail(grpc_chttp2_transport *t,
-                                 grpc_chttp2_stream *s,
+static void stream_list_add_tail(grpc_chttp2_transport* t,
+                                 grpc_chttp2_stream* s,
                                  grpc_chttp2_stream_list_id id) {
-  grpc_chttp2_stream *old_tail;
+  grpc_chttp2_stream* old_tail;
   GPR_ASSERT(!s->included[id]);
   old_tail = t->lists[id].tail;
   s->links[id].next = NULL;
@@ -125,7 +125,7 @@
   }
 }
 
-static bool stream_list_add(grpc_chttp2_transport *t, grpc_chttp2_stream *s,
+static bool stream_list_add(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
                             grpc_chttp2_stream_list_id id) {
   if (s->included[id]) {
     return false;
@@ -136,77 +136,77 @@
 
 /* wrappers for specializations */
 
-bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport *t,
-                                          grpc_chttp2_stream *s) {
+bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport* t,
+                                          grpc_chttp2_stream* s) {
   GPR_ASSERT(s->id != 0);
   return stream_list_add(t, s, GRPC_CHTTP2_LIST_WRITABLE);
 }
 
-bool grpc_chttp2_list_pop_writable_stream(grpc_chttp2_transport *t,
-                                          grpc_chttp2_stream **s) {
+bool grpc_chttp2_list_pop_writable_stream(grpc_chttp2_transport* t,
+                                          grpc_chttp2_stream** s) {
   return stream_list_pop(t, s, GRPC_CHTTP2_LIST_WRITABLE);
 }
 
-bool grpc_chttp2_list_remove_writable_stream(grpc_chttp2_transport *t,
-                                             grpc_chttp2_stream *s) {
+bool grpc_chttp2_list_remove_writable_stream(grpc_chttp2_transport* t,
+                                             grpc_chttp2_stream* s) {
   return stream_list_maybe_remove(t, s, GRPC_CHTTP2_LIST_WRITABLE);
 }
 
-bool grpc_chttp2_list_add_writing_stream(grpc_chttp2_transport *t,
-                                         grpc_chttp2_stream *s) {
+bool grpc_chttp2_list_add_writing_stream(grpc_chttp2_transport* t,
+                                         grpc_chttp2_stream* s) {
   return stream_list_add(t, s, GRPC_CHTTP2_LIST_WRITING);
 }
 
-bool grpc_chttp2_list_have_writing_streams(grpc_chttp2_transport *t) {
+bool grpc_chttp2_list_have_writing_streams(grpc_chttp2_transport* t) {
   return !stream_list_empty(t, GRPC_CHTTP2_LIST_WRITING);
 }
 
-bool grpc_chttp2_list_pop_writing_stream(grpc_chttp2_transport *t,
-                                         grpc_chttp2_stream **s) {
+bool grpc_chttp2_list_pop_writing_stream(grpc_chttp2_transport* t,
+                                         grpc_chttp2_stream** s) {
   return stream_list_pop(t, s, GRPC_CHTTP2_LIST_WRITING);
 }
 
-void grpc_chttp2_list_add_waiting_for_concurrency(grpc_chttp2_transport *t,
-                                                  grpc_chttp2_stream *s) {
+void grpc_chttp2_list_add_waiting_for_concurrency(grpc_chttp2_transport* t,
+                                                  grpc_chttp2_stream* s) {
   stream_list_add(t, s, GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY);
 }
 
-bool grpc_chttp2_list_pop_waiting_for_concurrency(grpc_chttp2_transport *t,
-                                                  grpc_chttp2_stream **s) {
+bool grpc_chttp2_list_pop_waiting_for_concurrency(grpc_chttp2_transport* t,
+                                                  grpc_chttp2_stream** s) {
   return stream_list_pop(t, s, GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY);
 }
 
-void grpc_chttp2_list_remove_waiting_for_concurrency(grpc_chttp2_transport *t,
-                                                     grpc_chttp2_stream *s) {
+void grpc_chttp2_list_remove_waiting_for_concurrency(grpc_chttp2_transport* t,
+                                                     grpc_chttp2_stream* s) {
   stream_list_maybe_remove(t, s, GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY);
 }
 
-void grpc_chttp2_list_add_stalled_by_transport(grpc_chttp2_transport *t,
-                                               grpc_chttp2_stream *s) {
+void grpc_chttp2_list_add_stalled_by_transport(grpc_chttp2_transport* t,
+                                               grpc_chttp2_stream* s) {
   stream_list_add(t, s, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
 }
 
-bool grpc_chttp2_list_pop_stalled_by_transport(grpc_chttp2_transport *t,
-                                               grpc_chttp2_stream **s) {
+bool grpc_chttp2_list_pop_stalled_by_transport(grpc_chttp2_transport* t,
+                                               grpc_chttp2_stream** s) {
   return stream_list_pop(t, s, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
 }
 
-void grpc_chttp2_list_remove_stalled_by_transport(grpc_chttp2_transport *t,
-                                                  grpc_chttp2_stream *s) {
+void grpc_chttp2_list_remove_stalled_by_transport(grpc_chttp2_transport* t,
+                                                  grpc_chttp2_stream* s) {
   stream_list_maybe_remove(t, s, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
 }
 
-void grpc_chttp2_list_add_stalled_by_stream(grpc_chttp2_transport *t,
-                                            grpc_chttp2_stream *s) {
+void grpc_chttp2_list_add_stalled_by_stream(grpc_chttp2_transport* t,
+                                            grpc_chttp2_stream* s) {
   stream_list_add(t, s, GRPC_CHTTP2_LIST_STALLED_BY_STREAM);
 }
 
-bool grpc_chttp2_list_pop_stalled_by_stream(grpc_chttp2_transport *t,
-                                            grpc_chttp2_stream **s) {
+bool grpc_chttp2_list_pop_stalled_by_stream(grpc_chttp2_transport* t,
+                                            grpc_chttp2_stream** s) {
   return stream_list_pop(t, s, GRPC_CHTTP2_LIST_STALLED_BY_STREAM);
 }
 
-bool grpc_chttp2_list_remove_stalled_by_stream(grpc_chttp2_transport *t,
-                                               grpc_chttp2_stream *s) {
+bool grpc_chttp2_list_remove_stalled_by_stream(grpc_chttp2_transport* t,
+                                               grpc_chttp2_stream* s) {
   return stream_list_maybe_remove(t, s, GRPC_CHTTP2_LIST_STALLED_BY_STREAM);
 }
diff --git a/src/core/ext/transport/chttp2/transport/stream_map.cc b/src/core/ext/transport/chttp2/transport/stream_map.cc
index d6079a9..c863191 100644
--- a/src/core/ext/transport/chttp2/transport/stream_map.cc
+++ b/src/core/ext/transport/chttp2/transport/stream_map.cc
@@ -24,22 +24,22 @@
 #include <grpc/support/log.h>
 #include <grpc/support/useful.h>
 
-void grpc_chttp2_stream_map_init(grpc_chttp2_stream_map *map,
+void grpc_chttp2_stream_map_init(grpc_chttp2_stream_map* map,
                                  size_t initial_capacity) {
   GPR_ASSERT(initial_capacity > 1);
-  map->keys = (uint32_t *)gpr_malloc(sizeof(uint32_t) * initial_capacity);
-  map->values = (void **)gpr_malloc(sizeof(void *) * initial_capacity);
+  map->keys = (uint32_t*)gpr_malloc(sizeof(uint32_t) * initial_capacity);
+  map->values = (void**)gpr_malloc(sizeof(void*) * initial_capacity);
   map->count = 0;
   map->free = 0;
   map->capacity = initial_capacity;
 }
 
-void grpc_chttp2_stream_map_destroy(grpc_chttp2_stream_map *map) {
+void grpc_chttp2_stream_map_destroy(grpc_chttp2_stream_map* map) {
   gpr_free(map->keys);
   gpr_free(map->values);
 }
 
-static size_t compact(uint32_t *keys, void **values, size_t count) {
+static size_t compact(uint32_t* keys, void** values, size_t count) {
   size_t i, out;
 
   for (i = 0, out = 0; i < count; i++) {
@@ -53,12 +53,12 @@
   return out;
 }
 
-void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map *map, uint32_t key,
-                                void *value) {
+void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map* map, uint32_t key,
+                                void* value) {
   size_t count = map->count;
   size_t capacity = map->capacity;
-  uint32_t *keys = map->keys;
-  void **values = map->values;
+  uint32_t* keys = map->keys;
+  void** values = map->values;
 
   GPR_ASSERT(count == 0 || keys[count - 1] < key);
   GPR_ASSERT(value);
@@ -73,9 +73,9 @@
          won't help much */
       map->capacity = capacity = 3 * capacity / 2;
       map->keys = keys =
-          (uint32_t *)gpr_realloc(keys, capacity * sizeof(uint32_t));
+          (uint32_t*)gpr_realloc(keys, capacity * sizeof(uint32_t));
       map->values = values =
-          (void **)gpr_realloc(values, capacity * sizeof(void *));
+          (void**)gpr_realloc(values, capacity * sizeof(void*));
     }
   }
 
@@ -84,12 +84,12 @@
   map->count = count + 1;
 }
 
-static void **find(grpc_chttp2_stream_map *map, uint32_t key) {
+static void** find(grpc_chttp2_stream_map* map, uint32_t key) {
   size_t min_idx = 0;
   size_t max_idx = map->count;
   size_t mid_idx;
-  uint32_t *keys = map->keys;
-  void **values = map->values;
+  uint32_t* keys = map->keys;
+  void** values = map->values;
   uint32_t mid_key;
 
   if (max_idx == 0) return NULL;
@@ -112,9 +112,9 @@
   return NULL;
 }
 
-void *grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map *map, uint32_t key) {
-  void **pvalue = find(map, key);
-  void *out = NULL;
+void* grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map* map, uint32_t key) {
+  void** pvalue = find(map, key);
+  void* out = NULL;
   if (pvalue != NULL) {
     out = *pvalue;
     *pvalue = NULL;
@@ -129,16 +129,16 @@
   return out;
 }
 
-void *grpc_chttp2_stream_map_find(grpc_chttp2_stream_map *map, uint32_t key) {
-  void **pvalue = find(map, key);
+void* grpc_chttp2_stream_map_find(grpc_chttp2_stream_map* map, uint32_t key) {
+  void** pvalue = find(map, key);
   return pvalue != NULL ? *pvalue : NULL;
 }
 
-size_t grpc_chttp2_stream_map_size(grpc_chttp2_stream_map *map) {
+size_t grpc_chttp2_stream_map_size(grpc_chttp2_stream_map* map) {
   return map->count - map->free;
 }
 
-void *grpc_chttp2_stream_map_rand(grpc_chttp2_stream_map *map) {
+void* grpc_chttp2_stream_map_rand(grpc_chttp2_stream_map* map) {
   if (map->count == map->free) {
     return NULL;
   }
@@ -149,10 +149,10 @@
   return map->values[((size_t)rand()) % map->count];
 }
 
-void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map,
-                                     void (*f)(void *user_data, uint32_t key,
-                                               void *value),
-                                     void *user_data) {
+void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map* map,
+                                     void (*f)(void* user_data, uint32_t key,
+                                               void* value),
+                                     void* user_data) {
   size_t i;
 
   for (i = 0; i < map->count; i++) {
diff --git a/src/core/ext/transport/chttp2/transport/stream_map.h b/src/core/ext/transport/chttp2/transport/stream_map.h
index 7ab6a4f..c89d200 100644
--- a/src/core/ext/transport/chttp2/transport/stream_map.h
+++ b/src/core/ext/transport/chttp2/transport/stream_map.h
@@ -34,40 +34,40 @@
    Adds are restricted to strictly higher keys than previously seen (this is
    guaranteed by http2). */
 typedef struct {
-  uint32_t *keys;
-  void **values;
+  uint32_t* keys;
+  void** values;
   size_t count;
   size_t free;
   size_t capacity;
 } grpc_chttp2_stream_map;
 
-void grpc_chttp2_stream_map_init(grpc_chttp2_stream_map *map,
+void grpc_chttp2_stream_map_init(grpc_chttp2_stream_map* map,
                                  size_t initial_capacity);
-void grpc_chttp2_stream_map_destroy(grpc_chttp2_stream_map *map);
+void grpc_chttp2_stream_map_destroy(grpc_chttp2_stream_map* map);
 
 /* Add a new key: given http2 semantics, new keys must always be greater than
    existing keys - this is asserted */
-void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map *map, uint32_t key,
-                                void *value);
+void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map* map, uint32_t key,
+                                void* value);
 
 /* Delete an existing key - returns the previous value of the key if it existed,
    or NULL otherwise */
-void *grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map *map, uint32_t key);
+void* grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map* map, uint32_t key);
 
 /* Return an existing key, or NULL if it does not exist */
-void *grpc_chttp2_stream_map_find(grpc_chttp2_stream_map *map, uint32_t key);
+void* grpc_chttp2_stream_map_find(grpc_chttp2_stream_map* map, uint32_t key);
 
 /* Return a random entry */
-void *grpc_chttp2_stream_map_rand(grpc_chttp2_stream_map *map);
+void* grpc_chttp2_stream_map_rand(grpc_chttp2_stream_map* map);
 
 /* How many (populated) entries are in the stream map? */
-size_t grpc_chttp2_stream_map_size(grpc_chttp2_stream_map *map);
+size_t grpc_chttp2_stream_map_size(grpc_chttp2_stream_map* map);
 
 /* Callback on each stream */
-void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map,
-                                     void (*f)(void *user_data, uint32_t key,
-                                               void *value),
-                                     void *user_data);
+void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map* map,
+                                     void (*f)(void* user_data, uint32_t key,
+                                               void* value),
+                                     void* user_data);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc
index 25f7c85..2620694 100644
--- a/src/core/ext/transport/chttp2/transport/writing.cc
+++ b/src/core/ext/transport/chttp2/transport/writing.cc
@@ -27,24 +27,24 @@
 #include "src/core/lib/slice/slice_internal.h"
 #include "src/core/lib/transport/http2_errors.h"
 
-static void add_to_write_list(grpc_chttp2_write_cb **list,
-                              grpc_chttp2_write_cb *cb) {
+static void add_to_write_list(grpc_chttp2_write_cb** list,
+                              grpc_chttp2_write_cb* cb) {
   cb->next = *list;
   *list = cb;
 }
 
-static void finish_write_cb(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                            grpc_chttp2_stream *s, grpc_chttp2_write_cb *cb,
-                            grpc_error *error) {
+static void finish_write_cb(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                            grpc_chttp2_stream* s, grpc_chttp2_write_cb* cb,
+                            grpc_error* error) {
   grpc_chttp2_complete_closure_step(exec_ctx, t, s, &cb->closure, error,
                                     "finish_write_cb");
   cb->next = t->write_cb_pool;
   t->write_cb_pool = cb;
 }
 
-static void maybe_initiate_ping(grpc_exec_ctx *exec_ctx,
-                                grpc_chttp2_transport *t) {
-  grpc_chttp2_ping_queue *pq = &t->ping_queue;
+static void maybe_initiate_ping(grpc_exec_ctx* exec_ctx,
+                                grpc_chttp2_transport* t) {
+  grpc_chttp2_ping_queue* pq = &t->ping_queue;
   if (grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_NEXT])) {
     /* no ping needed: wait */
     return;
@@ -110,16 +110,16 @@
       (t->ping_state.pings_before_data_required != 0);
 }
 
-static bool update_list(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                        grpc_chttp2_stream *s, int64_t send_bytes,
-                        grpc_chttp2_write_cb **list, int64_t *ctr,
-                        grpc_error *error) {
+static bool update_list(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                        grpc_chttp2_stream* s, int64_t send_bytes,
+                        grpc_chttp2_write_cb** list, int64_t* ctr,
+                        grpc_error* error) {
   bool sched_any = false;
-  grpc_chttp2_write_cb *cb = *list;
+  grpc_chttp2_write_cb* cb = *list;
   *list = NULL;
   *ctr += send_bytes;
   while (cb) {
-    grpc_chttp2_write_cb *next = cb->next;
+    grpc_chttp2_write_cb* next = cb->next;
     if (cb->call_at_byte <= *ctr) {
       sched_any = true;
       finish_write_cb(exec_ctx, t, s, cb, GRPC_ERROR_REF(error));
@@ -132,8 +132,8 @@
   return sched_any;
 }
 
-static void report_stall(grpc_chttp2_transport *t, grpc_chttp2_stream *s,
-                         const char *staller) {
+static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
+                         const char* staller) {
   gpr_log(
       GPR_DEBUG,
       "%s:%p stream %d stalled by %s [fc:pending=%" PRIdPTR ":flowed=%" PRId64
@@ -151,7 +151,7 @@
       s->flow_control->remote_window_delta());
 }
 
-static bool stream_ref_if_not_destroyed(gpr_refcount *r) {
+static bool stream_ref_if_not_destroyed(gpr_refcount* r) {
   gpr_atm count;
   do {
     count = gpr_atm_acq_load(&r->count);
@@ -161,12 +161,12 @@
 }
 
 /* How many bytes would we like to put on the wire during a single syscall */
-static uint32_t target_write_size(grpc_chttp2_transport *t) {
+static uint32_t target_write_size(grpc_chttp2_transport* t) {
   return 1024 * 1024;
 }
 
 // Returns true if initial_metadata contains only default headers.
-static bool is_default_initial_metadata(grpc_metadata_batch *initial_metadata) {
+static bool is_default_initial_metadata(grpc_metadata_batch* initial_metadata) {
   return initial_metadata->list.default_count == initial_metadata->list.count;
 }
 
@@ -175,13 +175,13 @@
 
 class WriteContext {
  public:
-  WriteContext(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t) : t_(t) {
+  WriteContext(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t) : t_(t) {
     GRPC_STATS_INC_HTTP2_WRITES_BEGUN(exec_ctx);
     GPR_TIMER_BEGIN("grpc_chttp2_begin_write", 0);
   }
 
   // TODO(ctiller): make this the destructor
-  void FlushStats(grpc_exec_ctx *exec_ctx) {
+  void FlushStats(grpc_exec_ctx* exec_ctx) {
     GRPC_STATS_INC_HTTP2_SEND_INITIAL_METADATA_PER_WRITE(
         exec_ctx, initial_metadata_writes_);
     GRPC_STATS_INC_HTTP2_SEND_MESSAGE_PER_WRITE(exec_ctx, message_writes_);
@@ -190,7 +190,7 @@
     GRPC_STATS_INC_HTTP2_SEND_FLOWCTL_PER_WRITE(exec_ctx, flow_control_writes_);
   }
 
-  void FlushSettings(grpc_exec_ctx *exec_ctx) {
+  void FlushSettings(grpc_exec_ctx* exec_ctx) {
     if (t_->dirtied_local_settings && !t_->sent_local_settings) {
       grpc_slice_buffer_add(
           &t_->outbuf, grpc_chttp2_settings_create(
@@ -204,13 +204,13 @@
     }
   }
 
-  void FlushQueuedBuffers(grpc_exec_ctx *exec_ctx) {
+  void FlushQueuedBuffers(grpc_exec_ctx* exec_ctx) {
     /* simple writes are queued to qbuf, and flushed here */
     grpc_slice_buffer_move_into(&t_->qbuf, &t_->outbuf);
     GPR_ASSERT(t_->qbuf.count == 0);
   }
 
-  void FlushWindowUpdates(grpc_exec_ctx *exec_ctx) {
+  void FlushWindowUpdates(grpc_exec_ctx* exec_ctx) {
     uint32_t transport_announce =
         t_->flow_control->MaybeSendUpdate(t_->outbuf.count > 0);
     if (transport_announce) {
@@ -230,7 +230,7 @@
     t_->ping_ack_count = 0;
   }
 
-  void EnactHpackSettings(grpc_exec_ctx *exec_ctx) {
+  void EnactHpackSettings(grpc_exec_ctx* exec_ctx) {
     grpc_chttp2_hpack_compressor_set_max_table_size(
         &t_->hpack_compressor,
         t_->settings[GRPC_PEER_SETTINGS]
@@ -238,7 +238,7 @@
   }
 
   void UpdateStreamsNoLongerStalled() {
-    grpc_chttp2_stream *s;
+    grpc_chttp2_stream* s;
     while (grpc_chttp2_list_pop_stalled_by_transport(t_, &s)) {
       if (t_->closed_with_error == GRPC_ERROR_NONE &&
           grpc_chttp2_list_add_writable_stream(t_, s)) {
@@ -249,13 +249,13 @@
     }
   }
 
-  grpc_chttp2_stream *NextStream() {
+  grpc_chttp2_stream* NextStream() {
     if (t_->outbuf.length > target_write_size(t_)) {
       result_.partial = true;
       return nullptr;
     }
 
-    grpc_chttp2_stream *s;
+    grpc_chttp2_stream* s;
     if (!grpc_chttp2_list_pop_writable_stream(t_, &s)) {
       return nullptr;
     }
@@ -277,7 +277,7 @@
 
   void NoteScheduledResults() { result_.early_results_scheduled = true; }
 
-  grpc_chttp2_transport *transport() const { return t_; }
+  grpc_chttp2_transport* transport() const { return t_; }
 
   grpc_chttp2_begin_write_result Result() {
     result_.writing = t_->outbuf.count > 0;
@@ -285,7 +285,7 @@
   }
 
  private:
-  grpc_chttp2_transport *const t_;
+  grpc_chttp2_transport* const t_;
 
   /* stats histogram counters: we increment these throughout this function,
      and at the end publish to the central stats histograms */
@@ -298,8 +298,8 @@
 
 class DataSendContext {
  public:
-  DataSendContext(WriteContext *write_context, grpc_chttp2_transport *t,
-                  grpc_chttp2_stream *s)
+  DataSendContext(WriteContext* write_context, grpc_chttp2_transport* t,
+                  grpc_chttp2_stream* s)
       : write_context_(write_context),
         t_(t),
         s_(s),
@@ -369,7 +369,7 @@
 
   bool is_last_frame() const { return is_last_frame_; }
 
-  void CallCallbacks(grpc_exec_ctx *exec_ctx) {
+  void CallCallbacks(grpc_exec_ctx* exec_ctx) {
     if (update_list(exec_ctx, t_, s_,
                     (int64_t)(s_->sending_bytes - sending_bytes_before_),
                     &s_->on_flow_controlled_cbs,
@@ -379,16 +379,16 @@
   }
 
  private:
-  WriteContext *write_context_;
-  grpc_chttp2_transport *t_;
-  grpc_chttp2_stream *s_;
+  WriteContext* write_context_;
+  grpc_chttp2_transport* t_;
+  grpc_chttp2_stream* s_;
   const size_t sending_bytes_before_;
   bool is_last_frame_ = false;
 };
 
 class StreamWriteContext {
  public:
-  StreamWriteContext(WriteContext *write_context, grpc_chttp2_stream *s)
+  StreamWriteContext(WriteContext* write_context, grpc_chttp2_stream* s)
       : write_context_(write_context), t_(write_context->transport()), s_(s) {
     GRPC_CHTTP2_IF_TRACING(
         gpr_log(GPR_DEBUG, "W:%p %s[%d] im-(sent,send)=(%d,%d) announce=%d", t_,
@@ -398,7 +398,7 @@
                       s->flow_control->announced_window_delta())));
   }
 
-  void FlushInitialMetadata(grpc_exec_ctx *exec_ctx) {
+  void FlushInitialMetadata(grpc_exec_ctx* exec_ctx) {
     /* send initial metadata if it's available */
     if (s_->sent_initial_metadata) return;
     if (s_->send_initial_metadata == nullptr) return;
@@ -439,7 +439,7 @@
         "send_initial_metadata_finished");
   }
 
-  void FlushWindowUpdates(grpc_exec_ctx *exec_ctx) {
+  void FlushWindowUpdates(grpc_exec_ctx* exec_ctx) {
     /* send any window updates */
     const uint32_t stream_announce = s_->flow_control->MaybeSendUpdate();
     if (stream_announce == 0) return;
@@ -451,7 +451,7 @@
     write_context_->IncWindowUpdateWrites();
   }
 
-  void FlushData(grpc_exec_ctx *exec_ctx) {
+  void FlushData(grpc_exec_ctx* exec_ctx) {
     if (!s_->sent_initial_metadata) return;
 
     if (s_->flow_controlled_buffer.length == 0 &&
@@ -495,7 +495,7 @@
     write_context_->IncMessageWrites();
   }
 
-  void FlushTrailingMetadata(grpc_exec_ctx *exec_ctx) {
+  void FlushTrailingMetadata(grpc_exec_ctx* exec_ctx) {
     if (!s_->sent_initial_metadata) return;
 
     if (s_->send_trailing_metadata == NULL) return;
@@ -551,7 +551,7 @@
     }
   }
 
-  void SentLastFrame(grpc_exec_ctx *exec_ctx) {
+  void SentLastFrame(grpc_exec_ctx* exec_ctx) {
     s_->send_trailing_metadata = NULL;
     s_->sent_trailing_metadata = true;
 
@@ -564,17 +564,17 @@
                                    GRPC_ERROR_NONE);
   }
 
-  WriteContext *const write_context_;
-  grpc_chttp2_transport *const t_;
-  grpc_chttp2_stream *const s_;
+  WriteContext* const write_context_;
+  grpc_chttp2_transport* const t_;
+  grpc_chttp2_stream* const s_;
   bool stream_became_writable_ = false;
-  grpc_mdelem *extra_headers_for_trailing_metadata_[2];
+  grpc_mdelem* extra_headers_for_trailing_metadata_[2];
   size_t num_extra_headers_for_trailing_metadata_ = 0;
 };
 }  // namespace
 
 grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
-    grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t) {
+    grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t) {
   WriteContext ctx(exec_ctx, t);
   ctx.FlushSettings(exec_ctx);
   ctx.FlushPingAcks();
@@ -587,7 +587,7 @@
 
   /* for each grpc_chttp2_stream that's become writable, frame it's data
      (according to available window sizes) and add to the output buffer */
-  while (grpc_chttp2_stream *s = ctx.NextStream()) {
+  while (grpc_chttp2_stream* s = ctx.NextStream()) {
     StreamWriteContext stream_ctx(&ctx, s);
     stream_ctx.FlushInitialMetadata(exec_ctx);
     stream_ctx.FlushWindowUpdates(exec_ctx);
@@ -615,10 +615,10 @@
   return ctx.Result();
 }
 
-void grpc_chttp2_end_write(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
-                           grpc_error *error) {
+void grpc_chttp2_end_write(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
+                           grpc_error* error) {
   GPR_TIMER_BEGIN("grpc_chttp2_end_write", 0);
-  grpc_chttp2_stream *s;
+  grpc_chttp2_stream* s;
 
   while (grpc_chttp2_list_pop_writing_stream(t, &s)) {
     if (s->sending_bytes != 0) {
diff --git a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
index b280487..d590ba0 100644
--- a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
+++ b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
@@ -33,20 +33,20 @@
 // Cronet transport object
 typedef struct cronet_transport {
   grpc_transport base;  // must be first element in this structure
-  void *engine;
-  char *host;
+  void* engine;
+  char* host;
 } cronet_transport;
 
 extern grpc_transport_vtable grpc_cronet_vtable;
 
-GRPCAPI grpc_channel *grpc_cronet_secure_channel_create(
-    void *engine, const char *target, const grpc_channel_args *args,
-    void *reserved) {
+GRPCAPI grpc_channel* grpc_cronet_secure_channel_create(
+    void* engine, const char* target, const grpc_channel_args* args,
+    void* reserved) {
   gpr_log(GPR_DEBUG,
           "grpc_create_cronet_transport: stream_engine = %p, target=%s", engine,
           target);
 
-  grpc_transport *ct =
+  grpc_transport* ct =
       grpc_create_cronet_transport(engine, target, args, reserved);
 
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.cc b/src/core/ext/transport/cronet/transport/cronet_transport.cc
index 97e4f7d..0b1ddf8 100644
--- a/src/core/ext/transport/cronet/transport/cronet_transport.cc
+++ b/src/core/ext/transport/cronet/transport/cronet_transport.cc
@@ -75,17 +75,17 @@
 
 /* Cronet callbacks. See cronet_c_for_grpc.h for documentation for each. */
 
-static void on_stream_ready(bidirectional_stream *);
+static void on_stream_ready(bidirectional_stream*);
 static void on_response_headers_received(
-    bidirectional_stream *, const bidirectional_stream_header_array *,
-    const char *);
-static void on_write_completed(bidirectional_stream *, const char *);
-static void on_read_completed(bidirectional_stream *, char *, int);
+    bidirectional_stream*, const bidirectional_stream_header_array*,
+    const char*);
+static void on_write_completed(bidirectional_stream*, const char*);
+static void on_read_completed(bidirectional_stream*, char*, int);
 static void on_response_trailers_received(
-    bidirectional_stream *, const bidirectional_stream_header_array *);
-static void on_succeeded(bidirectional_stream *);
-static void on_failed(bidirectional_stream *, int);
-static void on_canceled(bidirectional_stream *);
+    bidirectional_stream*, const bidirectional_stream_header_array*);
+static void on_succeeded(bidirectional_stream*);
+static void on_failed(bidirectional_stream*, int);
+static void on_canceled(bidirectional_stream*);
 static bidirectional_stream_callback cronet_callbacks = {
     on_stream_ready,
     on_response_headers_received,
@@ -99,8 +99,8 @@
 /* Cronet transport object */
 struct grpc_cronet_transport {
   grpc_transport base; /* must be first element in this structure */
-  stream_engine *engine;
-  char *host;
+  stream_engine* engine;
+  char* host;
   bool use_packet_coalescing;
 };
 typedef struct grpc_cronet_transport grpc_cronet_transport;
@@ -109,14 +109,14 @@
    http://www.catb.org/esr/structure-packing/#_structure_reordering: */
 struct read_state {
   /* vars to store data coming from server */
-  char *read_buffer;
+  char* read_buffer;
   bool length_field_received;
   int received_bytes;
   int remaining_bytes;
   int length_field;
   bool compressed;
   char grpc_header_bytes[GRPC_HEADER_SIZE_IN_BYTES];
-  char *payload_field;
+  char* payload_field;
   bool read_stream_closed;
 
   /* vars for holding data destined for the application */
@@ -132,7 +132,7 @@
 };
 
 struct write_state {
-  char *write_buffer;
+  char* write_buffer;
 };
 
 /* track state of one stream op */
@@ -150,7 +150,7 @@
   bool pending_recv_trailing_metadata;
   /* Cronet has not issued a callback of a bidirectional read */
   bool pending_read_from_cronet;
-  grpc_error *cancel_error;
+  grpc_error* cancel_error;
   /* data structure for storing data coming from server */
   struct read_state rs;
   /* data structure for storing data going to the server */
@@ -161,22 +161,22 @@
   grpc_transport_stream_op_batch op;
   struct op_state state;
   bool done;
-  struct stream_obj *s;      /* Pointer back to the stream object */
-  struct op_and_state *next; /* next op_and_state in the linked list */
+  struct stream_obj* s;      /* Pointer back to the stream object */
+  struct op_and_state* next; /* next op_and_state in the linked list */
 };
 
 struct op_storage {
   int num_pending_ops;
-  struct op_and_state *head;
+  struct op_and_state* head;
 };
 
 struct stream_obj {
-  gpr_arena *arena;
-  struct op_and_state *oas;
-  grpc_transport_stream_op_batch *curr_op;
-  grpc_cronet_transport *curr_ct;
-  grpc_stream *curr_gs;
-  bidirectional_stream *cbs;
+  gpr_arena* arena;
+  struct op_and_state* oas;
+  grpc_transport_stream_op_batch* curr_op;
+  grpc_cronet_transport* curr_ct;
+  grpc_stream* curr_gs;
+  bidirectional_stream* cbs;
   bidirectional_stream_header_array header_array;
 
   /* Stream level state. Some state will be tracked both at stream and stream_op
@@ -190,7 +190,7 @@
   gpr_mu mu;
 
   /* Refcount object of the stream */
-  grpc_stream_refcount *refcount;
+  grpc_stream_refcount* refcount;
 };
 typedef struct stream_obj stream_obj;
 
@@ -199,30 +199,30 @@
   grpc_cronet_stream_ref((stream), (reason))
 #define GRPC_CRONET_STREAM_UNREF(exec_ctx, stream, reason) \
   grpc_cronet_stream_unref((exec_ctx), (stream), (reason))
-void grpc_cronet_stream_ref(stream_obj *s, const char *reason) {
+void grpc_cronet_stream_ref(stream_obj* s, const char* reason) {
   grpc_stream_ref(s->refcount, reason);
 }
-void grpc_cronet_stream_unref(grpc_exec_ctx *exec_ctx, stream_obj *s,
-                              const char *reason) {
+void grpc_cronet_stream_unref(grpc_exec_ctx* exec_ctx, stream_obj* s,
+                              const char* reason) {
   grpc_stream_unref(exec_ctx, s->refcount, reason);
 }
 #else
 #define GRPC_CRONET_STREAM_REF(stream, reason) grpc_cronet_stream_ref((stream))
 #define GRPC_CRONET_STREAM_UNREF(exec_ctx, stream, reason) \
   grpc_cronet_stream_unref((exec_ctx), (stream))
-void grpc_cronet_stream_ref(stream_obj *s) { grpc_stream_ref(s->refcount); }
-void grpc_cronet_stream_unref(grpc_exec_ctx *exec_ctx, stream_obj *s) {
+void grpc_cronet_stream_ref(stream_obj* s) { grpc_stream_ref(s->refcount); }
+void grpc_cronet_stream_unref(grpc_exec_ctx* exec_ctx, stream_obj* s) {
   grpc_stream_unref(exec_ctx, s->refcount);
 }
 #endif
 
-static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
-                                          struct op_and_state *oas);
+static enum e_op_result execute_stream_op(grpc_exec_ctx* exec_ctx,
+                                          struct op_and_state* oas);
 
 /*
   Utility function to translate enum into string for printing
 */
-static const char *op_result_string(enum e_op_result i) {
+static const char* op_result_string(enum e_op_result i) {
   switch (i) {
     case ACTION_TAKEN_WITH_CALLBACK:
       return "ACTION_TAKEN_WITH_CALLBACK";
@@ -234,7 +234,7 @@
   GPR_UNREACHABLE_CODE(return "UNKNOWN");
 }
 
-static const char *op_id_string(enum e_op_id i) {
+static const char* op_id_string(enum e_op_id i) {
   switch (i) {
     case OP_SEND_INITIAL_METADATA:
       return "OP_SEND_INITIAL_METADATA";
@@ -268,7 +268,7 @@
   return "UNKNOWN";
 }
 
-static void null_and_maybe_free_read_buffer(stream_obj *s) {
+static void null_and_maybe_free_read_buffer(stream_obj* s) {
   if (s->state.rs.read_buffer &&
       s->state.rs.read_buffer != s->state.rs.grpc_header_bytes) {
     gpr_free(s->state.rs.read_buffer);
@@ -276,7 +276,7 @@
   s->state.rs.read_buffer = NULL;
 }
 
-static void maybe_flush_read(stream_obj *s) {
+static void maybe_flush_read(stream_obj* s) {
   /* To enter flush read state (discarding all the buffered messages in
    * transport layer), two conditions must be satisfied: 1) non-zero grpc status
    * has been received, and 2) an op requesting the status code
@@ -289,7 +289,7 @@
       CRONET_LOG(GPR_DEBUG, "%p: Flush read", s);
       s->state.flush_read = true;
       null_and_maybe_free_read_buffer(s);
-      s->state.rs.read_buffer = (char *)gpr_malloc(GRPC_FLUSH_READ_SIZE);
+      s->state.rs.read_buffer = (char*)gpr_malloc(GRPC_FLUSH_READ_SIZE);
       if (!s->state.pending_read_from_cronet) {
         CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs);
         bidirectional_stream_read(s->cbs, s->state.rs.read_buffer,
@@ -300,8 +300,8 @@
   }
 }
 
-static grpc_error *make_error_with_desc(int error_code, const char *desc) {
-  grpc_error *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc);
+static grpc_error* make_error_with_desc(int error_code, const char* desc) {
+  grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc);
   error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS, error_code);
   return error;
 }
@@ -309,13 +309,13 @@
 /*
   Add a new stream op to op storage.
 */
-static void add_to_storage(struct stream_obj *s,
-                           grpc_transport_stream_op_batch *op) {
-  struct op_storage *storage = &s->storage;
+static void add_to_storage(struct stream_obj* s,
+                           grpc_transport_stream_op_batch* op) {
+  struct op_storage* storage = &s->storage;
   /* add new op at the beginning of the linked list. The memory is freed
   in remove_from_storage */
-  struct op_and_state *new_op =
-      (struct op_and_state *)gpr_malloc(sizeof(struct op_and_state));
+  struct op_and_state* new_op =
+      (struct op_and_state*)gpr_malloc(sizeof(struct op_and_state));
   memcpy(&new_op->op, op, sizeof(grpc_transport_stream_op_batch));
   memset(&new_op->state, 0, sizeof(new_op->state));
   new_op->s = s;
@@ -339,9 +339,9 @@
 /*
   Traverse the linked list and delete op and free memory
 */
-static void remove_from_storage(struct stream_obj *s,
-                                struct op_and_state *oas) {
-  struct op_and_state *curr;
+static void remove_from_storage(struct stream_obj* s,
+                                struct op_and_state* oas) {
+  struct op_and_state* curr;
   if (s->storage.head == NULL || oas == NULL) {
     return;
   }
@@ -373,9 +373,9 @@
   This can get executed from the Cronet network thread via cronet callback
   or on the application supplied thread via the perform_stream_op function.
 */
-static void execute_from_storage(grpc_exec_ctx *exec_ctx, stream_obj *s) {
+static void execute_from_storage(grpc_exec_ctx* exec_ctx, stream_obj* s) {
   gpr_mu_lock(&s->mu);
-  for (struct op_and_state *curr = s->storage.head; curr != NULL;) {
+  for (struct op_and_state* curr = s->storage.head; curr != NULL;) {
     CRONET_LOG(GPR_DEBUG, "calling op at %p. done = %d", curr, curr->done);
     GPR_ASSERT(curr->done == 0);
     enum e_op_result result = execute_stream_op(exec_ctx, curr);
@@ -383,7 +383,7 @@
                op_result_string(result));
     /* if this op is done, then remove it and free memory */
     if (curr->done) {
-      struct op_and_state *next = curr->next;
+      struct op_and_state* next = curr->next;
       remove_from_storage(s, curr);
       curr = next;
     }
@@ -400,11 +400,11 @@
 /*
   Cronet callback
 */
-static void on_failed(bidirectional_stream *stream, int net_error) {
+static void on_failed(bidirectional_stream* stream, int net_error) {
   CRONET_LOG(GPR_DEBUG, "on_failed(%p, %d)", stream, net_error);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
-  stream_obj *s = (stream_obj *)stream->annotation;
+  stream_obj* s = (stream_obj*)stream->annotation;
   gpr_mu_lock(&s->mu);
   bidirectional_stream_destroy(s->cbs);
   s->state.state_callback_received[OP_FAILED] = true;
@@ -427,11 +427,11 @@
 /*
   Cronet callback
 */
-static void on_canceled(bidirectional_stream *stream) {
+static void on_canceled(bidirectional_stream* stream) {
   CRONET_LOG(GPR_DEBUG, "on_canceled(%p)", stream);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
-  stream_obj *s = (stream_obj *)stream->annotation;
+  stream_obj* s = (stream_obj*)stream->annotation;
   gpr_mu_lock(&s->mu);
   bidirectional_stream_destroy(s->cbs);
   s->state.state_callback_received[OP_CANCELED] = true;
@@ -454,11 +454,11 @@
 /*
   Cronet callback
 */
-static void on_succeeded(bidirectional_stream *stream) {
+static void on_succeeded(bidirectional_stream* stream) {
   CRONET_LOG(GPR_DEBUG, "on_succeeded(%p)", stream);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
-  stream_obj *s = (stream_obj *)stream->annotation;
+  stream_obj* s = (stream_obj*)stream->annotation;
   gpr_mu_lock(&s->mu);
   bidirectional_stream_destroy(s->cbs);
   s->state.state_callback_received[OP_SUCCEEDED] = true;
@@ -473,11 +473,11 @@
 /*
   Cronet callback
 */
-static void on_stream_ready(bidirectional_stream *stream) {
+static void on_stream_ready(bidirectional_stream* stream) {
   CRONET_LOG(GPR_DEBUG, "W: on_stream_ready(%p)", stream);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  stream_obj *s = (stream_obj *)stream->annotation;
-  grpc_cronet_transport *t = (grpc_cronet_transport *)s->curr_ct;
+  stream_obj* s = (stream_obj*)stream->annotation;
+  grpc_cronet_transport* t = (grpc_cronet_transport*)s->curr_ct;
   gpr_mu_lock(&s->mu);
   s->state.state_op_done[OP_SEND_INITIAL_METADATA] = true;
   s->state.state_callback_received[OP_SEND_INITIAL_METADATA] = true;
@@ -503,13 +503,13 @@
   Cronet callback
 */
 static void on_response_headers_received(
-    bidirectional_stream *stream,
-    const bidirectional_stream_header_array *headers,
-    const char *negotiated_protocol) {
+    bidirectional_stream* stream,
+    const bidirectional_stream_header_array* headers,
+    const char* negotiated_protocol) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   CRONET_LOG(GPR_DEBUG, "R: on_response_headers_received(%p, %p, %s)", stream,
              headers, negotiated_protocol);
-  stream_obj *s = (stream_obj *)stream->annotation;
+  stream_obj* s = (stream_obj*)stream->annotation;
 
   /* Identify if this is a header or a trailer (in a trailer-only response case)
    */
@@ -526,15 +526,15 @@
   grpc_chttp2_incoming_metadata_buffer_init(&s->state.rs.initial_metadata,
                                             s->arena);
   for (size_t i = 0; i < headers->count; i++) {
-    GRPC_LOG_IF_ERROR(
-        "on_response_headers_received",
-        grpc_chttp2_incoming_metadata_buffer_add(
-            &exec_ctx, &s->state.rs.initial_metadata,
-            grpc_mdelem_from_slices(
-                &exec_ctx, grpc_slice_intern(grpc_slice_from_static_string(
-                               headers->headers[i].key)),
-                grpc_slice_intern(grpc_slice_from_static_string(
-                    headers->headers[i].value)))));
+    GRPC_LOG_IF_ERROR("on_response_headers_received",
+                      grpc_chttp2_incoming_metadata_buffer_add(
+                          &exec_ctx, &s->state.rs.initial_metadata,
+                          grpc_mdelem_from_slices(
+                              &exec_ctx,
+                              grpc_slice_intern(grpc_slice_from_static_string(
+                                  headers->headers[i].key)),
+                              grpc_slice_intern(grpc_slice_from_static_string(
+                                  headers->headers[i].value)))));
   }
   s->state.state_callback_received[OP_RECV_INITIAL_METADATA] = true;
   if (!(s->state.state_op_done[OP_CANCEL_ERROR] ||
@@ -559,9 +559,9 @@
 /*
   Cronet callback
 */
-static void on_write_completed(bidirectional_stream *stream, const char *data) {
+static void on_write_completed(bidirectional_stream* stream, const char* data) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  stream_obj *s = (stream_obj *)stream->annotation;
+  stream_obj* s = (stream_obj*)stream->annotation;
   CRONET_LOG(GPR_DEBUG, "W: on_write_completed(%p, %s)", stream, data);
   gpr_mu_lock(&s->mu);
   if (s->state.ws.write_buffer) {
@@ -577,10 +577,10 @@
 /*
   Cronet callback
 */
-static void on_read_completed(bidirectional_stream *stream, char *data,
+static void on_read_completed(bidirectional_stream* stream, char* data,
                               int count) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  stream_obj *s = (stream_obj *)stream->annotation;
+  stream_obj* s = (stream_obj*)stream->annotation;
   CRONET_LOG(GPR_DEBUG, "R: on_read_completed(%p, %p, %d)", stream, data,
              count);
   gpr_mu_lock(&s->mu);
@@ -620,13 +620,13 @@
   Cronet callback
 */
 static void on_response_trailers_received(
-    bidirectional_stream *stream,
-    const bidirectional_stream_header_array *trailers) {
+    bidirectional_stream* stream,
+    const bidirectional_stream_header_array* trailers) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   CRONET_LOG(GPR_DEBUG, "R: on_response_trailers_received(%p,%p)", stream,
              trailers);
-  stream_obj *s = (stream_obj *)stream->annotation;
-  grpc_cronet_transport *t = (grpc_cronet_transport *)s->curr_ct;
+  stream_obj* s = (stream_obj*)stream->annotation;
+  grpc_cronet_transport* t = (grpc_cronet_transport*)s->curr_ct;
   gpr_mu_lock(&s->mu);
   memset(&s->state.rs.trailing_metadata, 0,
          sizeof(s->state.rs.trailing_metadata));
@@ -636,15 +636,15 @@
   for (size_t i = 0; i < trailers->count; i++) {
     CRONET_LOG(GPR_DEBUG, "trailer key=%s, value=%s", trailers->headers[i].key,
                trailers->headers[i].value);
-    GRPC_LOG_IF_ERROR(
-        "on_response_trailers_received",
-        grpc_chttp2_incoming_metadata_buffer_add(
-            &exec_ctx, &s->state.rs.trailing_metadata,
-            grpc_mdelem_from_slices(
-                &exec_ctx, grpc_slice_intern(grpc_slice_from_static_string(
-                               trailers->headers[i].key)),
-                grpc_slice_intern(grpc_slice_from_static_string(
-                    trailers->headers[i].value)))));
+    GRPC_LOG_IF_ERROR("on_response_trailers_received",
+                      grpc_chttp2_incoming_metadata_buffer_add(
+                          &exec_ctx, &s->state.rs.trailing_metadata,
+                          grpc_mdelem_from_slices(
+                              &exec_ctx,
+                              grpc_slice_intern(grpc_slice_from_static_string(
+                                  trailers->headers[i].key)),
+                              grpc_slice_intern(grpc_slice_from_static_string(
+                                  trailers->headers[i].value)))));
     s->state.rs.trailing_metadata_valid = true;
     if (0 == strcmp(trailers->headers[i].key, "grpc-status") &&
         0 != strcmp(trailers->headers[i].value, "0")) {
@@ -679,17 +679,17 @@
  Utility function that takes the data from s->write_slice_buffer and assembles
  into a contiguous byte stream with 5 byte gRPC header prepended.
 */
-static void create_grpc_frame(grpc_exec_ctx *exec_ctx,
-                              grpc_slice_buffer *write_slice_buffer,
-                              char **pp_write_buffer,
-                              size_t *p_write_buffer_size, uint32_t flags) {
+static void create_grpc_frame(grpc_exec_ctx* exec_ctx,
+                              grpc_slice_buffer* write_slice_buffer,
+                              char** pp_write_buffer,
+                              size_t* p_write_buffer_size, uint32_t flags) {
   grpc_slice slice = grpc_slice_buffer_take_first(write_slice_buffer);
   size_t length = GRPC_SLICE_LENGTH(slice);
   *p_write_buffer_size = length + GRPC_HEADER_SIZE_IN_BYTES;
   /* This is freed in the on_write_completed callback */
-  char *write_buffer = (char *)gpr_malloc(length + GRPC_HEADER_SIZE_IN_BYTES);
+  char* write_buffer = (char*)gpr_malloc(length + GRPC_HEADER_SIZE_IN_BYTES);
   *pp_write_buffer = write_buffer;
-  uint8_t *p = (uint8_t *)write_buffer;
+  uint8_t* p = (uint8_t*)write_buffer;
   /* Append 5 byte header */
   /* Compressed flag */
   *p++ = (uint8_t)((flags & GRPC_WRITE_INTERNAL_COMPRESS) ? 1 : 0);
@@ -707,10 +707,10 @@
  Convert metadata in a format that Cronet can consume
 */
 static void convert_metadata_to_cronet_headers(
-    grpc_linked_mdelem *head, const char *host, char **pp_url,
-    bidirectional_stream_header **pp_headers, size_t *p_num_headers,
-    const char **method) {
-  grpc_linked_mdelem *curr = head;
+    grpc_linked_mdelem* head, const char* host, char** pp_url,
+    bidirectional_stream_header** pp_headers, size_t* p_num_headers,
+    const char** method) {
+  grpc_linked_mdelem* curr = head;
   /* Walk the linked list and get number of header fields */
   size_t num_headers_available = 0;
   while (curr != NULL) {
@@ -719,8 +719,8 @@
   }
   /* Allocate enough memory. It is freed in the on_stream_ready callback
    */
-  bidirectional_stream_header *headers =
-      (bidirectional_stream_header *)gpr_malloc(
+  bidirectional_stream_header* headers =
+      (bidirectional_stream_header*)gpr_malloc(
           sizeof(bidirectional_stream_header) * num_headers_available);
   *pp_headers = headers;
 
@@ -734,8 +734,8 @@
   while (num_headers < num_headers_available) {
     grpc_mdelem mdelem = curr->md;
     curr = curr->next;
-    char *key = grpc_slice_to_c_string(GRPC_MDKEY(mdelem));
-    char *value = grpc_slice_to_c_string(GRPC_MDVALUE(mdelem));
+    char* key = grpc_slice_to_c_string(GRPC_MDKEY(mdelem));
+    char* value = grpc_slice_to_c_string(GRPC_MDVALUE(mdelem));
     if (grpc_slice_eq(GRPC_MDKEY(mdelem), GRPC_MDSTR_SCHEME) ||
         grpc_slice_eq(GRPC_MDKEY(mdelem), GRPC_MDSTR_AUTHORITY)) {
       /* Cronet populates these fields on its own */
@@ -772,10 +772,10 @@
   *p_num_headers = (size_t)num_headers;
 }
 
-static void parse_grpc_header(const uint8_t *data, int *length,
-                              bool *compressed) {
+static void parse_grpc_header(const uint8_t* data, int* length,
+                              bool* compressed) {
   const uint8_t c = *data;
-  const uint8_t *p = data + 1;
+  const uint8_t* p = data + 1;
   *compressed = ((c & 0x01) == 0x01);
   *length = 0;
   *length |= ((uint8_t)*p++) << 24;
@@ -784,7 +784,7 @@
   *length |= ((uint8_t)*p++);
 }
 
-static bool header_has_authority(grpc_linked_mdelem *head) {
+static bool header_has_authority(grpc_linked_mdelem* head) {
   while (head != NULL) {
     if (grpc_slice_eq(GRPC_MDKEY(head->md), GRPC_MDSTR_AUTHORITY)) {
       return true;
@@ -798,11 +798,11 @@
   Op Execution: Decide if one of the actions contained in the stream op can be
   executed. This is the heart of the state machine.
 */
-static bool op_can_be_run(grpc_transport_stream_op_batch *curr_op,
-                          struct stream_obj *s, struct op_state *op_state,
+static bool op_can_be_run(grpc_transport_stream_op_batch* curr_op,
+                          struct stream_obj* s, struct op_state* op_state,
                           enum e_op_id op_id) {
-  struct op_state *stream_state = &s->state;
-  grpc_cronet_transport *t = s->curr_ct;
+  struct op_state* stream_state = &s->state;
+  grpc_cronet_transport* t = s->curr_ct;
   bool result = true;
   /* When call is canceled, every op can be run, except under following
   conditions
@@ -981,12 +981,12 @@
 /*
   TODO (makdharma): Break down this function in smaller chunks for readability.
 */
-static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
-                                          struct op_and_state *oas) {
-  grpc_transport_stream_op_batch *stream_op = &oas->op;
-  struct stream_obj *s = oas->s;
-  grpc_cronet_transport *t = (grpc_cronet_transport *)s->curr_ct;
-  struct op_state *stream_state = &s->state;
+static enum e_op_result execute_stream_op(grpc_exec_ctx* exec_ctx,
+                                          struct op_and_state* oas) {
+  grpc_transport_stream_op_batch* stream_op = &oas->op;
+  struct stream_obj* s = oas->s;
+  grpc_cronet_transport* t = (grpc_cronet_transport*)s->curr_ct;
+  struct op_state* stream_state = &s->state;
   enum e_op_result result = NO_ACTION_POSSIBLE;
   if (stream_op->send_initial_metadata &&
       op_can_be_run(stream_op, s, &oas->state, OP_SEND_INITIAL_METADATA)) {
@@ -1002,8 +1002,8 @@
       bidirectional_stream_disable_auto_flush(s->cbs, true);
       bidirectional_stream_delay_request_headers_until_flush(s->cbs, true);
     }
-    char *url = NULL;
-    const char *method = "POST";
+    char* url = NULL;
+    const char* method = "POST";
     s->header_array.headers = NULL;
     convert_metadata_to_cronet_headers(stream_op->payload->send_initial_metadata
                                            .send_initial_metadata->list.head,
@@ -1018,8 +1018,8 @@
     unsigned int header_index;
     for (header_index = 0; header_index < s->header_array.count;
          header_index++) {
-      gpr_free((void *)s->header_array.headers[header_index].key);
-      gpr_free((void *)s->header_array.headers[header_index].value);
+      gpr_free((void*)s->header_array.headers[header_index].key);
+      gpr_free((void*)s->header_array.headers[header_index].value);
     }
     stream_state->state_op_done[OP_SEND_INITIAL_METADATA] = true;
     if (t->use_packet_coalescing) {
@@ -1177,14 +1177,14 @@
           stream_state->rs.remaining_bytes == 0) {
         /* Start a read operation for data */
         stream_state->rs.length_field_received = true;
-        parse_grpc_header((const uint8_t *)stream_state->rs.read_buffer,
+        parse_grpc_header((const uint8_t*)stream_state->rs.read_buffer,
                           &stream_state->rs.length_field,
                           &stream_state->rs.compressed);
         CRONET_LOG(GPR_DEBUG, "length field = %d",
                    stream_state->rs.length_field);
         if (stream_state->rs.length_field > 0) {
           stream_state->rs.read_buffer =
-              (char *)gpr_malloc((size_t)stream_state->rs.length_field);
+              (char*)gpr_malloc((size_t)stream_state->rs.length_field);
           GPR_ASSERT(stream_state->rs.read_buffer);
           stream_state->rs.remaining_bytes = stream_state->rs.length_field;
           stream_state->rs.received_bytes = 0;
@@ -1207,9 +1207,8 @@
           if (stream_state->rs.compressed) {
             stream_state->rs.sbs.base.flags |= GRPC_WRITE_INTERNAL_COMPRESS;
           }
-          *((grpc_byte_buffer **)
-                stream_op->payload->recv_message.recv_message) =
-              (grpc_byte_buffer *)&stream_state->rs.sbs;
+          *((grpc_byte_buffer**)stream_op->payload->recv_message.recv_message) =
+              (grpc_byte_buffer*)&stream_state->rs.sbs;
           GRPC_CLOSURE_SCHED(
               exec_ctx, stream_op->payload->recv_message.recv_message_ready,
               GRPC_ERROR_NONE);
@@ -1250,7 +1249,7 @@
       CRONET_LOG(GPR_DEBUG, "read operation complete");
       grpc_slice read_data_slice =
           GRPC_SLICE_MALLOC((uint32_t)stream_state->rs.length_field);
-      uint8_t *dst_p = GRPC_SLICE_START_PTR(read_data_slice);
+      uint8_t* dst_p = GRPC_SLICE_START_PTR(read_data_slice);
       memcpy(dst_p, stream_state->rs.read_buffer,
              (size_t)stream_state->rs.length_field);
       null_and_maybe_free_read_buffer(s);
@@ -1265,8 +1264,8 @@
       if (stream_state->rs.compressed) {
         stream_state->rs.sbs.base.flags = GRPC_WRITE_INTERNAL_COMPRESS;
       }
-      *((grpc_byte_buffer **)stream_op->payload->recv_message.recv_message) =
-          (grpc_byte_buffer *)&stream_state->rs.sbs;
+      *((grpc_byte_buffer**)stream_op->payload->recv_message.recv_message) =
+          (grpc_byte_buffer*)&stream_state->rs.sbs;
       GRPC_CLOSURE_SCHED(exec_ctx,
                          stream_op->payload->recv_message.recv_message_ready,
                          GRPC_ERROR_NONE);
@@ -1351,10 +1350,10 @@
   Functions used by upper layers to access transport functionality.
 */
 
-static int init_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                       grpc_stream *gs, grpc_stream_refcount *refcount,
-                       const void *server_data, gpr_arena *arena) {
-  stream_obj *s = (stream_obj *)gs;
+static int init_stream(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                       grpc_stream* gs, grpc_stream_refcount* refcount,
+                       const void* server_data, gpr_arena* arena) {
+  stream_obj* s = (stream_obj*)gs;
 
   s->refcount = refcount;
   GRPC_CRONET_STREAM_REF(s, "cronet transport");
@@ -1377,23 +1376,23 @@
   s->state.pending_read_from_cronet = false;
 
   s->curr_gs = gs;
-  s->curr_ct = (grpc_cronet_transport *)gt;
+  s->curr_ct = (grpc_cronet_transport*)gt;
   s->arena = arena;
 
   gpr_mu_init(&s->mu);
   return 0;
 }
 
-static void set_pollset_do_nothing(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                                   grpc_stream *gs, grpc_pollset *pollset) {}
+static void set_pollset_do_nothing(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                                   grpc_stream* gs, grpc_pollset* pollset) {}
 
-static void set_pollset_set_do_nothing(grpc_exec_ctx *exec_ctx,
-                                       grpc_transport *gt, grpc_stream *gs,
-                                       grpc_pollset_set *pollset_set) {}
+static void set_pollset_set_do_nothing(grpc_exec_ctx* exec_ctx,
+                                       grpc_transport* gt, grpc_stream* gs,
+                                       grpc_pollset_set* pollset_set) {}
 
-static void perform_stream_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                              grpc_stream *gs,
-                              grpc_transport_stream_op_batch *op) {
+static void perform_stream_op(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                              grpc_stream* gs,
+                              grpc_transport_stream_op_batch* op) {
   CRONET_LOG(GPR_DEBUG, "perform_stream_op");
   if (op->send_initial_metadata &&
       header_has_authority(op->payload->send_initial_metadata
@@ -1413,15 +1412,15 @@
     GRPC_CLOSURE_SCHED(exec_ctx, op->on_complete, GRPC_ERROR_CANCELLED);
     return;
   }
-  stream_obj *s = (stream_obj *)gs;
+  stream_obj* s = (stream_obj*)gs;
   add_to_storage(s, op);
   execute_from_storage(exec_ctx, s);
 }
 
-static void destroy_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                           grpc_stream *gs,
-                           grpc_closure *then_schedule_closure) {
-  stream_obj *s = (stream_obj *)gs;
+static void destroy_stream(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                           grpc_stream* gs,
+                           grpc_closure* then_schedule_closure) {
+  stream_obj* s = (stream_obj*)gs;
   null_and_maybe_free_read_buffer(s);
   /* Clean up read_slice_buffer in case there is unread data. */
   grpc_slice_buffer_destroy_internal(exec_ctx, &s->state.rs.read_slice_buffer);
@@ -1429,15 +1428,15 @@
   GRPC_CLOSURE_SCHED(exec_ctx, then_schedule_closure, GRPC_ERROR_NONE);
 }
 
-static void destroy_transport(grpc_exec_ctx *exec_ctx, grpc_transport *gt) {}
+static void destroy_transport(grpc_exec_ctx* exec_ctx, grpc_transport* gt) {}
 
-static grpc_endpoint *get_endpoint(grpc_exec_ctx *exec_ctx,
-                                   grpc_transport *gt) {
+static grpc_endpoint* get_endpoint(grpc_exec_ctx* exec_ctx,
+                                   grpc_transport* gt) {
   return NULL;
 }
 
-static void perform_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                       grpc_transport_op *op) {}
+static void perform_op(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                       grpc_transport_op* op) {}
 
 static const grpc_transport_vtable grpc_cronet_vtable = {
     sizeof(stream_obj),
@@ -1451,17 +1450,17 @@
     destroy_transport,
     get_endpoint};
 
-grpc_transport *grpc_create_cronet_transport(void *engine, const char *target,
-                                             const grpc_channel_args *args,
-                                             void *reserved) {
-  grpc_cronet_transport *ct =
-      (grpc_cronet_transport *)gpr_malloc(sizeof(grpc_cronet_transport));
+grpc_transport* grpc_create_cronet_transport(void* engine, const char* target,
+                                             const grpc_channel_args* args,
+                                             void* reserved) {
+  grpc_cronet_transport* ct =
+      (grpc_cronet_transport*)gpr_malloc(sizeof(grpc_cronet_transport));
   if (!ct) {
     goto error;
   }
   ct->base.vtable = &grpc_cronet_vtable;
-  ct->engine = (stream_engine *)engine;
-  ct->host = (char *)gpr_malloc(strlen(target) + 1);
+  ct->engine = (stream_engine*)engine;
+  ct->host = (char*)gpr_malloc(strlen(target) + 1);
   if (!ct->host) {
     goto error;
   }
diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.h b/src/core/ext/transport/cronet/transport/cronet_transport.h
index 43ff391..7643fdb 100644
--- a/src/core/ext/transport/cronet/transport/cronet_transport.h
+++ b/src/core/ext/transport/cronet/transport/cronet_transport.h
@@ -25,9 +25,9 @@
 extern "C" {
 #endif
 
-grpc_transport *grpc_create_cronet_transport(void *engine, const char *target,
-                                             const grpc_channel_args *args,
-                                             void *reserved);
+grpc_transport* grpc_create_cronet_transport(void* engine, const char* target,
+                                             const grpc_channel_args* args,
+                                             void* reserved);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc
index 9d0feea..baefabe 100644
--- a/src/core/ext/transport/inproc/inproc_transport.cc
+++ b/src/core/ext/transport/inproc/inproc_transport.cc
@@ -32,8 +32,8 @@
 #include "src/core/lib/transport/error_utils.h"
 #include "src/core/lib/transport/transport_impl.h"
 
-#define INPROC_LOG(...)                                    \
-  do {                                                     \
+#define INPROC_LOG(...)                                          \
+  do {                                                           \
     if (grpc_inproc_trace.enabled()) gpr_log(__VA_ARGS__); \
   } while (0)
 
@@ -50,20 +50,20 @@
 
 typedef struct inproc_transport {
   grpc_transport base;
-  shared_mu *mu;
+  shared_mu* mu;
   gpr_refcount refs;
   bool is_client;
   grpc_connectivity_state_tracker connectivity;
-  void (*accept_stream_cb)(grpc_exec_ctx *exec_ctx, void *user_data,
-                           grpc_transport *transport, const void *server_data);
-  void *accept_stream_data;
+  void (*accept_stream_cb)(grpc_exec_ctx* exec_ctx, void* user_data,
+                           grpc_transport* transport, const void* server_data);
+  void* accept_stream_data;
   bool is_closed;
-  struct inproc_transport *other_side;
-  struct inproc_stream *stream_list;
+  struct inproc_transport* other_side;
+  struct inproc_stream* stream_list;
 } inproc_transport;
 
 typedef struct inproc_stream {
-  inproc_transport *t;
+  inproc_transport* t;
   grpc_metadata_batch to_read_initial_md;
   uint32_t to_read_initial_md_flags;
   bool to_read_initial_md_filled;
@@ -80,21 +80,21 @@
   grpc_millis write_buffer_deadline;
   grpc_metadata_batch write_buffer_trailing_md;
   bool write_buffer_trailing_md_filled;
-  grpc_error *write_buffer_cancel_error;
+  grpc_error* write_buffer_cancel_error;
 
-  struct inproc_stream *other_side;
+  struct inproc_stream* other_side;
   bool other_side_closed;               // won't talk anymore
   bool write_buffer_other_side_closed;  // on hold
-  grpc_stream_refcount *refs;
-  grpc_closure *closure_at_destroy;
+  grpc_stream_refcount* refs;
+  grpc_closure* closure_at_destroy;
 
-  gpr_arena *arena;
+  gpr_arena* arena;
 
-  grpc_transport_stream_op_batch *send_message_op;
-  grpc_transport_stream_op_batch *send_trailing_md_op;
-  grpc_transport_stream_op_batch *recv_initial_md_op;
-  grpc_transport_stream_op_batch *recv_message_op;
-  grpc_transport_stream_op_batch *recv_trailing_md_op;
+  grpc_transport_stream_op_batch* send_message_op;
+  grpc_transport_stream_op_batch* send_trailing_md_op;
+  grpc_transport_stream_op_batch* recv_initial_md_op;
+  grpc_transport_stream_op_batch* recv_message_op;
+  grpc_transport_stream_op_batch* recv_trailing_md_op;
 
   grpc_slice_buffer recv_message;
   grpc_slice_buffer_stream recv_stream;
@@ -107,29 +107,29 @@
 
   bool closed;
 
-  grpc_error *cancel_self_error;
-  grpc_error *cancel_other_error;
+  grpc_error* cancel_self_error;
+  grpc_error* cancel_other_error;
 
   grpc_millis deadline;
 
   bool listed;
-  struct inproc_stream *stream_list_prev;
-  struct inproc_stream *stream_list_next;
+  struct inproc_stream* stream_list_prev;
+  struct inproc_stream* stream_list_next;
 } inproc_stream;
 
 static grpc_closure do_nothing_closure;
-static bool cancel_stream_locked(grpc_exec_ctx *exec_ctx, inproc_stream *s,
-                                 grpc_error *error);
-static void op_state_machine(grpc_exec_ctx *exec_ctx, void *arg,
-                             grpc_error *error);
+static bool cancel_stream_locked(grpc_exec_ctx* exec_ctx, inproc_stream* s,
+                                 grpc_error* error);
+static void op_state_machine(grpc_exec_ctx* exec_ctx, void* arg,
+                             grpc_error* error);
 
-static void ref_transport(inproc_transport *t) {
+static void ref_transport(inproc_transport* t) {
   INPROC_LOG(GPR_DEBUG, "ref_transport %p", t);
   gpr_ref(&t->refs);
 }
 
-static void really_destroy_transport(grpc_exec_ctx *exec_ctx,
-                                     inproc_transport *t) {
+static void really_destroy_transport(grpc_exec_ctx* exec_ctx,
+                                     inproc_transport* t) {
   INPROC_LOG(GPR_DEBUG, "really_destroy_transport %p", t);
   grpc_connectivity_state_destroy(exec_ctx, &t->connectivity);
   if (gpr_unref(&t->mu->refs)) {
@@ -138,7 +138,7 @@
   gpr_free(t);
 }
 
-static void unref_transport(grpc_exec_ctx *exec_ctx, inproc_transport *t) {
+static void unref_transport(grpc_exec_ctx* exec_ctx, inproc_transport* t) {
   INPROC_LOG(GPR_DEBUG, "unref_transport %p", t);
   if (gpr_unref(&t->refs)) {
     really_destroy_transport(exec_ctx, t);
@@ -153,18 +153,18 @@
 #define STREAM_UNREF(e, refs, reason) grpc_stream_unref(e, refs)
 #endif
 
-static void ref_stream(inproc_stream *s, const char *reason) {
+static void ref_stream(inproc_stream* s, const char* reason) {
   INPROC_LOG(GPR_DEBUG, "ref_stream %p %s", s, reason);
   STREAM_REF(s->refs, reason);
 }
 
-static void unref_stream(grpc_exec_ctx *exec_ctx, inproc_stream *s,
-                         const char *reason) {
+static void unref_stream(grpc_exec_ctx* exec_ctx, inproc_stream* s,
+                         const char* reason) {
   INPROC_LOG(GPR_DEBUG, "unref_stream %p %s", s, reason);
   STREAM_UNREF(exec_ctx, s->refs, reason);
 }
 
-static void really_destroy_stream(grpc_exec_ctx *exec_ctx, inproc_stream *s) {
+static void really_destroy_stream(grpc_exec_ctx* exec_ctx, inproc_stream* s) {
   INPROC_LOG(GPR_DEBUG, "really_destroy_stream %p", s);
 
   GRPC_ERROR_UNREF(s->write_buffer_cancel_error);
@@ -182,12 +182,12 @@
   }
 }
 
-static void log_metadata(const grpc_metadata_batch *md_batch, bool is_client,
+static void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
                          bool is_initial) {
-  for (grpc_linked_mdelem *md = md_batch->list.head; md != NULL;
+  for (grpc_linked_mdelem* md = md_batch->list.head; md != NULL;
        md = md->next) {
-    char *key = grpc_slice_to_c_string(GRPC_MDKEY(md->md));
-    char *value = grpc_slice_to_c_string(GRPC_MDVALUE(md->md));
+    char* key = grpc_slice_to_c_string(GRPC_MDKEY(md->md));
+    char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md->md));
     gpr_log(GPR_INFO, "INPROC:%s:%s: %s: %s", is_initial ? "HDR" : "TRL",
             is_client ? "CLI" : "SVR", key, value);
     gpr_free(key);
@@ -195,10 +195,10 @@
   }
 }
 
-static grpc_error *fill_in_metadata(grpc_exec_ctx *exec_ctx, inproc_stream *s,
-                                    const grpc_metadata_batch *metadata,
-                                    uint32_t flags, grpc_metadata_batch *out_md,
-                                    uint32_t *outflags, bool *markfilled) {
+static grpc_error* fill_in_metadata(grpc_exec_ctx* exec_ctx, inproc_stream* s,
+                                    const grpc_metadata_batch* metadata,
+                                    uint32_t flags, grpc_metadata_batch* out_md,
+                                    uint32_t* outflags, bool* markfilled) {
   if (grpc_inproc_trace.enabled()) {
     log_metadata(metadata, s->t->is_client, outflags != NULL);
   }
@@ -209,11 +209,11 @@
   if (markfilled != NULL) {
     *markfilled = true;
   }
-  grpc_error *error = GRPC_ERROR_NONE;
-  for (grpc_linked_mdelem *elem = metadata->list.head;
+  grpc_error* error = GRPC_ERROR_NONE;
+  for (grpc_linked_mdelem* elem = metadata->list.head;
        (elem != NULL) && (error == GRPC_ERROR_NONE); elem = elem->next) {
-    grpc_linked_mdelem *nelem =
-        (grpc_linked_mdelem *)gpr_arena_alloc(s->arena, sizeof(*nelem));
+    grpc_linked_mdelem* nelem =
+        (grpc_linked_mdelem*)gpr_arena_alloc(s->arena, sizeof(*nelem));
     nelem->md = grpc_mdelem_from_slices(
         exec_ctx, grpc_slice_intern(GRPC_MDKEY(elem->md)),
         grpc_slice_intern(GRPC_MDVALUE(elem->md)));
@@ -223,12 +223,12 @@
   return error;
 }
 
-static int init_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                       grpc_stream *gs, grpc_stream_refcount *refcount,
-                       const void *server_data, gpr_arena *arena) {
+static int init_stream(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                       grpc_stream* gs, grpc_stream_refcount* refcount,
+                       const void* server_data, gpr_arena* arena) {
   INPROC_LOG(GPR_DEBUG, "init_stream %p %p %p", gt, gs, server_data);
-  inproc_transport *t = (inproc_transport *)gt;
-  inproc_stream *s = (inproc_stream *)gs;
+  inproc_transport* t = (inproc_transport*)gt;
+  inproc_stream* s = (inproc_stream*)gs;
   s->arena = arena;
 
   s->refs = refcount;
@@ -277,7 +277,7 @@
 
   if (!server_data) {
     ref_transport(t);
-    inproc_transport *st = t->other_side;
+    inproc_transport* st = t->other_side;
     ref_transport(st);
     s->other_side = NULL;  // will get filled in soon
     // Pass the client-side stream address to the server-side for a ref
@@ -286,10 +286,10 @@
     INPROC_LOG(GPR_DEBUG, "calling accept stream cb %p %p",
                st->accept_stream_cb, st->accept_stream_data);
     (*st->accept_stream_cb)(exec_ctx, st->accept_stream_data, &st->base,
-                            (void *)s);
+                            (void*)s);
   } else {
     // This is the server-side and is being called through accept_stream_cb
-    inproc_stream *cs = (inproc_stream *)server_data;
+    inproc_stream* cs = (inproc_stream*)server_data;
     s->other_side = cs;
     // Ref the server-side stream on behalf of the client now
     ref_stream(s, "inproc_init_stream:srv");
@@ -326,15 +326,15 @@
   return 0;  // return value is not important
 }
 
-static void close_stream_locked(grpc_exec_ctx *exec_ctx, inproc_stream *s) {
+static void close_stream_locked(grpc_exec_ctx* exec_ctx, inproc_stream* s) {
   if (!s->closed) {
     // Release the metadata that we would have written out
     grpc_metadata_batch_destroy(exec_ctx, &s->write_buffer_initial_md);
     grpc_metadata_batch_destroy(exec_ctx, &s->write_buffer_trailing_md);
 
     if (s->listed) {
-      inproc_stream *p = s->stream_list_prev;
-      inproc_stream *n = s->stream_list_next;
+      inproc_stream* p = s->stream_list_prev;
+      inproc_stream* n = s->stream_list_next;
       if (p != NULL) {
         p->stream_list_next = n;
       } else {
@@ -352,8 +352,8 @@
 }
 
 // This function means that we are done talking/listening to the other side
-static void close_other_side_locked(grpc_exec_ctx *exec_ctx, inproc_stream *s,
-                                    const char *reason) {
+static void close_other_side_locked(grpc_exec_ctx* exec_ctx, inproc_stream* s,
+                                    const char* reason) {
   if (s->other_side != NULL) {
     // First release the metadata that came from the other side's arena
     grpc_metadata_batch_destroy(exec_ctx, &s->to_read_initial_md);
@@ -371,10 +371,10 @@
 // this stream_op_batch is only one of the pending operations for this
 // stream. This is called when one of the pending operations for the stream
 // is done and about to be NULLed out
-static void complete_if_batch_end_locked(grpc_exec_ctx *exec_ctx,
-                                         inproc_stream *s, grpc_error *error,
-                                         grpc_transport_stream_op_batch *op,
-                                         const char *msg) {
+static void complete_if_batch_end_locked(grpc_exec_ctx* exec_ctx,
+                                         inproc_stream* s, grpc_error* error,
+                                         grpc_transport_stream_op_batch* op,
+                                         const char* msg) {
   int is_sm = (int)(op == s->send_message_op);
   int is_stm = (int)(op == s->send_trailing_md_op);
   int is_rim = (int)(op == s->recv_initial_md_op);
@@ -387,9 +387,9 @@
   }
 }
 
-static void maybe_schedule_op_closure_locked(grpc_exec_ctx *exec_ctx,
-                                             inproc_stream *s,
-                                             grpc_error *error) {
+static void maybe_schedule_op_closure_locked(grpc_exec_ctx* exec_ctx,
+                                             inproc_stream* s,
+                                             grpc_error* error) {
   if (s && s->ops_needed && !s->op_closure_scheduled) {
     GRPC_CLOSURE_SCHED(exec_ctx, &s->op_closure, GRPC_ERROR_REF(error));
     s->op_closure_scheduled = true;
@@ -397,8 +397,8 @@
   }
 }
 
-static void fail_helper_locked(grpc_exec_ctx *exec_ctx, inproc_stream *s,
-                               grpc_error *error) {
+static void fail_helper_locked(grpc_exec_ctx* exec_ctx, inproc_stream* s,
+                               grpc_error* error) {
   INPROC_LOG(GPR_DEBUG, "op_state_machine %p fail_helper", s);
   // If we're failing this side, we need to make sure that
   // we also send or have already sent trailing metadata
@@ -409,10 +409,10 @@
     grpc_metadata_batch fake_md;
     grpc_metadata_batch_init(&fake_md);
 
-    inproc_stream *other = s->other_side;
-    grpc_metadata_batch *dest = (other == NULL) ? &s->write_buffer_trailing_md
+    inproc_stream* other = s->other_side;
+    grpc_metadata_batch* dest = (other == NULL) ? &s->write_buffer_trailing_md
                                                 : &other->to_read_trailing_md;
-    bool *destfilled = (other == NULL) ? &s->write_buffer_trailing_md_filled
+    bool* destfilled = (other == NULL) ? &s->write_buffer_trailing_md_filled
                                        : &other->to_read_trailing_md_filled;
     fill_in_metadata(exec_ctx, s, &fake_md, 0, dest, NULL, destfilled);
     grpc_metadata_batch_destroy(exec_ctx, &fake_md);
@@ -427,20 +427,20 @@
     }
   }
   if (s->recv_initial_md_op) {
-    grpc_error *err;
+    grpc_error* err;
     if (!s->t->is_client) {
       // If this is a server, provide initial metadata with a path and authority
       // since it expects that as well as no error yet
       grpc_metadata_batch fake_md;
       grpc_metadata_batch_init(&fake_md);
-      grpc_linked_mdelem *path_md =
-          (grpc_linked_mdelem *)gpr_arena_alloc(s->arena, sizeof(*path_md));
+      grpc_linked_mdelem* path_md =
+          (grpc_linked_mdelem*)gpr_arena_alloc(s->arena, sizeof(*path_md));
       path_md->md =
           grpc_mdelem_from_slices(exec_ctx, g_fake_path_key, g_fake_path_value);
       GPR_ASSERT(grpc_metadata_batch_link_tail(exec_ctx, &fake_md, path_md) ==
                  GRPC_ERROR_NONE);
-      grpc_linked_mdelem *auth_md =
-          (grpc_linked_mdelem *)gpr_arena_alloc(s->arena, sizeof(*auth_md));
+      grpc_linked_mdelem* auth_md =
+          (grpc_linked_mdelem*)gpr_arena_alloc(s->arena, sizeof(*auth_md));
       auth_md->md =
           grpc_mdelem_from_slices(exec_ctx, g_fake_auth_key, g_fake_auth_value);
       GPR_ASSERT(grpc_metadata_batch_link_tail(exec_ctx, &fake_md, auth_md) ==
@@ -509,9 +509,9 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void message_transfer_locked(grpc_exec_ctx *exec_ctx,
-                                    inproc_stream *sender,
-                                    inproc_stream *receiver) {
+static void message_transfer_locked(grpc_exec_ctx* exec_ctx,
+                                    inproc_stream* sender,
+                                    inproc_stream* receiver) {
   size_t remaining =
       sender->send_message_op->payload->send_message.send_message->length;
   if (receiver->recv_inited) {
@@ -525,7 +525,7 @@
     GPR_ASSERT(grpc_byte_stream_next(
         exec_ctx, sender->send_message_op->payload->send_message.send_message,
         SIZE_MAX, &unused));
-    grpc_error *error = grpc_byte_stream_pull(
+    grpc_error* error = grpc_byte_stream_pull(
         exec_ctx, sender->send_message_op->payload->send_message.send_message,
         &message_slice);
     if (error != GRPC_ERROR_NONE) {
@@ -558,8 +558,8 @@
   sender->send_message_op = NULL;
 }
 
-static void op_state_machine(grpc_exec_ctx *exec_ctx, void *arg,
-                             grpc_error *error) {
+static void op_state_machine(grpc_exec_ctx* exec_ctx, void* arg,
+                             grpc_error* error) {
   // This function gets called when we have contents in the unprocessed reads
   // Get what we want based on our ops wanted
   // Schedule our appropriate closures
@@ -567,17 +567,17 @@
 
   // Since this is a closure directly invoked by the combiner, it should not
   // unref the error parameter explicitly; the combiner will do that implicitly
-  grpc_error *new_err = GRPC_ERROR_NONE;
+  grpc_error* new_err = GRPC_ERROR_NONE;
 
   bool needs_close = false;
 
   INPROC_LOG(GPR_DEBUG, "op_state_machine %p", arg);
-  inproc_stream *s = (inproc_stream *)arg;
-  gpr_mu *mu = &s->t->mu->mu;  // keep aside in case s gets closed
+  inproc_stream* s = (inproc_stream*)arg;
+  gpr_mu* mu = &s->t->mu->mu;  // keep aside in case s gets closed
   gpr_mu_lock(mu);
   s->op_closure_scheduled = false;
   // cancellation takes precedence
-  inproc_stream *other = s->other_side;
+  inproc_stream* other = s->other_side;
 
   if (s->cancel_self_error != GRPC_ERROR_NONE) {
     fail_helper_locked(exec_ctx, s, GRPC_ERROR_REF(s->cancel_self_error));
@@ -612,9 +612,9 @@
       (!s->send_message_op ||
        (s->t->is_client &&
         (s->trailing_md_recvd || s->to_read_trailing_md_filled)))) {
-    grpc_metadata_batch *dest = (other == NULL) ? &s->write_buffer_trailing_md
+    grpc_metadata_batch* dest = (other == NULL) ? &s->write_buffer_trailing_md
                                                 : &other->to_read_trailing_md;
-    bool *destfilled = (other == NULL) ? &s->write_buffer_trailing_md_filled
+    bool* destfilled = (other == NULL) ? &s->write_buffer_trailing_md_filled
                                        : &other->to_read_trailing_md_filled;
     if (*destfilled || s->trailing_md_sent) {
       // The buffer is already in use; that's an error!
@@ -810,8 +810,8 @@
   GRPC_ERROR_UNREF(new_err);
 }
 
-static bool cancel_stream_locked(grpc_exec_ctx *exec_ctx, inproc_stream *s,
-                                 grpc_error *error) {
+static bool cancel_stream_locked(grpc_exec_ctx* exec_ctx, inproc_stream* s,
+                                 grpc_error* error) {
   bool ret = false;  // was the cancel accepted
   INPROC_LOG(GPR_DEBUG, "cancel_stream %p with %s", s,
              grpc_error_string(error));
@@ -826,10 +826,10 @@
     grpc_metadata_batch cancel_md;
     grpc_metadata_batch_init(&cancel_md);
 
-    inproc_stream *other = s->other_side;
-    grpc_metadata_batch *dest = (other == NULL) ? &s->write_buffer_trailing_md
+    inproc_stream* other = s->other_side;
+    grpc_metadata_batch* dest = (other == NULL) ? &s->write_buffer_trailing_md
                                                 : &other->to_read_trailing_md;
-    bool *destfilled = (other == NULL) ? &s->write_buffer_trailing_md_filled
+    bool* destfilled = (other == NULL) ? &s->write_buffer_trailing_md_filled
                                        : &other->to_read_trailing_md_filled;
     fill_in_metadata(exec_ctx, s, &cancel_md, 0, dest, NULL, destfilled);
     grpc_metadata_batch_destroy(exec_ctx, &cancel_md);
@@ -862,12 +862,12 @@
   return ret;
 }
 
-static void perform_stream_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                              grpc_stream *gs,
-                              grpc_transport_stream_op_batch *op) {
+static void perform_stream_op(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                              grpc_stream* gs,
+                              grpc_transport_stream_op_batch* op) {
   INPROC_LOG(GPR_DEBUG, "perform_stream_op %p %p %p", gt, gs, op);
-  inproc_stream *s = (inproc_stream *)gs;
-  gpr_mu *mu = &s->t->mu->mu;  // save aside in case s gets closed
+  inproc_stream* s = (inproc_stream*)gs;
+  gpr_mu* mu = &s->t->mu->mu;  // save aside in case s gets closed
   gpr_mu_lock(mu);
 
   if (grpc_inproc_trace.enabled()) {
@@ -880,8 +880,8 @@
                    s->t->is_client, false);
     }
   }
-  grpc_error *error = GRPC_ERROR_NONE;
-  grpc_closure *on_complete = op->on_complete;
+  grpc_error* error = GRPC_ERROR_NONE;
+  grpc_closure* on_complete = op->on_complete;
   if (on_complete == NULL) {
     on_complete = &do_nothing_closure;
   }
@@ -907,18 +907,18 @@
 
   bool needs_close = false;
 
-  inproc_stream *other = s->other_side;
+  inproc_stream* other = s->other_side;
   if (error == GRPC_ERROR_NONE &&
       (op->send_initial_metadata || op->send_trailing_metadata)) {
     if (s->t->is_closed) {
       error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Endpoint already shutdown");
     }
     if (error == GRPC_ERROR_NONE && op->send_initial_metadata) {
-      grpc_metadata_batch *dest = (other == NULL) ? &s->write_buffer_initial_md
+      grpc_metadata_batch* dest = (other == NULL) ? &s->write_buffer_initial_md
                                                   : &other->to_read_initial_md;
-      uint32_t *destflags = (other == NULL) ? &s->write_buffer_initial_md_flags
+      uint32_t* destflags = (other == NULL) ? &s->write_buffer_initial_md_flags
                                             : &other->to_read_initial_md_flags;
-      bool *destfilled = (other == NULL) ? &s->write_buffer_initial_md_filled
+      bool* destfilled = (other == NULL) ? &s->write_buffer_initial_md_filled
                                          : &other->to_read_initial_md_filled;
       if (*destfilled || s->initial_md_sent) {
         // The buffer is already in use; that's an error!
@@ -933,7 +933,7 @@
               dest, destflags, destfilled);
         }
         if (s->t->is_client) {
-          grpc_millis *dl =
+          grpc_millis* dl =
               (other == NULL) ? &s->write_buffer_deadline : &other->deadline;
           *dl = GPR_MIN(*dl, op->payload->send_initial_metadata
                                  .send_initial_metadata->deadline);
@@ -972,8 +972,9 @@
     // 4. We want to receive a message and there is a message ready
     // 5. There is trailing metadata, even if nothing specifically wants
     //    that because that can shut down the receive message as well
-    if ((op->send_message && other && ((other->recv_message_op != NULL) ||
-                                       (other->recv_trailing_md_op != NULL))) ||
+    if ((op->send_message && other &&
+         ((other->recv_message_op != NULL) ||
+          (other->recv_trailing_md_op != NULL))) ||
         (op->send_trailing_metadata && !op->send_message) ||
         (op->recv_initial_metadata && s->to_read_initial_md_filled) ||
         (op->recv_message && other && (other->send_message_op != NULL)) ||
@@ -1020,8 +1021,8 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void close_transport_locked(grpc_exec_ctx *exec_ctx,
-                                   inproc_transport *t) {
+static void close_transport_locked(grpc_exec_ctx* exec_ctx,
+                                   inproc_transport* t) {
   INPROC_LOG(GPR_DEBUG, "close_transport %p %d", t, t->is_closed);
   grpc_connectivity_state_set(
       exec_ctx, &t->connectivity, GRPC_CHANNEL_SHUTDOWN,
@@ -1041,9 +1042,9 @@
   }
 }
 
-static void perform_transport_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                                 grpc_transport_op *op) {
-  inproc_transport *t = (inproc_transport *)gt;
+static void perform_transport_op(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                                 grpc_transport_op* op) {
+  inproc_transport* t = (inproc_transport*)gt;
   INPROC_LOG(GPR_DEBUG, "perform_transport_op %p %p", t, op);
   gpr_mu_lock(&t->mu->mu);
   if (op->on_connectivity_state_change) {
@@ -1075,17 +1076,17 @@
   gpr_mu_unlock(&t->mu->mu);
 }
 
-static void destroy_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                           grpc_stream *gs,
-                           grpc_closure *then_schedule_closure) {
+static void destroy_stream(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                           grpc_stream* gs,
+                           grpc_closure* then_schedule_closure) {
   INPROC_LOG(GPR_DEBUG, "destroy_stream %p %p", gs, then_schedule_closure);
-  inproc_stream *s = (inproc_stream *)gs;
+  inproc_stream* s = (inproc_stream*)gs;
   s->closure_at_destroy = then_schedule_closure;
   really_destroy_stream(exec_ctx, s);
 }
 
-static void destroy_transport(grpc_exec_ctx *exec_ctx, grpc_transport *gt) {
-  inproc_transport *t = (inproc_transport *)gt;
+static void destroy_transport(grpc_exec_ctx* exec_ctx, grpc_transport* gt) {
+  inproc_transport* t = (inproc_transport*)gt;
   INPROC_LOG(GPR_DEBUG, "destroy_transport %p", t);
   gpr_mu_lock(&t->mu->mu);
   close_transport_locked(exec_ctx, t);
@@ -1098,24 +1099,24 @@
  * INTEGRATION GLUE
  */
 
-static void set_pollset(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                        grpc_stream *gs, grpc_pollset *pollset) {
+static void set_pollset(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                        grpc_stream* gs, grpc_pollset* pollset) {
   // Nothing to do here
 }
 
-static void set_pollset_set(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
-                            grpc_stream *gs, grpc_pollset_set *pollset_set) {
+static void set_pollset_set(grpc_exec_ctx* exec_ctx, grpc_transport* gt,
+                            grpc_stream* gs, grpc_pollset_set* pollset_set) {
   // Nothing to do here
 }
 
-static grpc_endpoint *get_endpoint(grpc_exec_ctx *exec_ctx, grpc_transport *t) {
+static grpc_endpoint* get_endpoint(grpc_exec_ctx* exec_ctx, grpc_transport* t) {
   return NULL;
 }
 
 /*******************************************************************************
  * GLOBAL INIT AND DESTROY
  */
-static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
+static void do_nothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
 
 void grpc_inproc_transport_init(void) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -1146,16 +1147,16 @@
 /*******************************************************************************
  * Main inproc transport functions
  */
-static void inproc_transports_create(grpc_exec_ctx *exec_ctx,
-                                     grpc_transport **server_transport,
-                                     const grpc_channel_args *server_args,
-                                     grpc_transport **client_transport,
-                                     const grpc_channel_args *client_args) {
+static void inproc_transports_create(grpc_exec_ctx* exec_ctx,
+                                     grpc_transport** server_transport,
+                                     const grpc_channel_args* server_args,
+                                     grpc_transport** client_transport,
+                                     const grpc_channel_args* client_args) {
   INPROC_LOG(GPR_DEBUG, "inproc_transports_create");
-  inproc_transport *st = (inproc_transport *)gpr_zalloc(sizeof(*st));
-  inproc_transport *ct = (inproc_transport *)gpr_zalloc(sizeof(*ct));
+  inproc_transport* st = (inproc_transport*)gpr_zalloc(sizeof(*st));
+  inproc_transport* ct = (inproc_transport*)gpr_zalloc(sizeof(*ct));
   // Share one lock between both sides since both sides get affected
-  st->mu = ct->mu = (shared_mu *)gpr_malloc(sizeof(*st->mu));
+  st->mu = ct->mu = (shared_mu*)gpr_malloc(sizeof(*st->mu));
   gpr_mu_init(&st->mu->mu);
   gpr_ref_init(&st->mu->refs, 2);
   st->base.vtable = &inproc_vtable;
@@ -1174,37 +1175,37 @@
   ct->other_side = st;
   st->stream_list = NULL;
   ct->stream_list = NULL;
-  *server_transport = (grpc_transport *)st;
-  *client_transport = (grpc_transport *)ct;
+  *server_transport = (grpc_transport*)st;
+  *client_transport = (grpc_transport*)ct;
 }
 
-grpc_channel *grpc_inproc_channel_create(grpc_server *server,
-                                         grpc_channel_args *args,
-                                         void *reserved) {
+grpc_channel* grpc_inproc_channel_create(grpc_server* server,
+                                         grpc_channel_args* args,
+                                         void* reserved) {
   GRPC_API_TRACE("grpc_inproc_channel_create(server=%p, args=%p)", 2,
                  (server, args));
 
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
-  const grpc_channel_args *server_args = grpc_server_get_channel_args(server);
+  const grpc_channel_args* server_args = grpc_server_get_channel_args(server);
 
   // Add a default authority channel argument for the client
 
   grpc_arg default_authority_arg;
   default_authority_arg.type = GRPC_ARG_STRING;
-  default_authority_arg.key = (char *)GRPC_ARG_DEFAULT_AUTHORITY;
-  default_authority_arg.value.string = (char *)"inproc.authority";
-  grpc_channel_args *client_args =
+  default_authority_arg.key = (char*)GRPC_ARG_DEFAULT_AUTHORITY;
+  default_authority_arg.value.string = (char*)"inproc.authority";
+  grpc_channel_args* client_args =
       grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
 
-  grpc_transport *server_transport;
-  grpc_transport *client_transport;
+  grpc_transport* server_transport;
+  grpc_transport* client_transport;
   inproc_transports_create(&exec_ctx, &server_transport, server_args,
                            &client_transport, client_args);
 
   grpc_server_setup_transport(&exec_ctx, server, server_transport, NULL,
                               server_args);
-  grpc_channel *channel =
+  grpc_channel* channel =
       grpc_channel_create(&exec_ctx, "inproc", client_args,
                           GRPC_CLIENT_DIRECT_CHANNEL, client_transport);
 
diff --git a/src/core/ext/transport/inproc/inproc_transport.h b/src/core/ext/transport/inproc/inproc_transport.h
index 248a9dd..f27789a 100644
--- a/src/core/ext/transport/inproc/inproc_transport.h
+++ b/src/core/ext/transport/inproc/inproc_transport.h
@@ -25,9 +25,9 @@
 extern "C" {
 #endif
 
-grpc_channel *grpc_inproc_channel_create(grpc_server *server,
-                                         grpc_channel_args *args,
-                                         void *reserved);
+grpc_channel* grpc_inproc_channel_create(grpc_server* server,
+                                         grpc_channel_args* args,
+                                         void* reserved);
 
 extern grpc_core::TraceFlag grpc_inproc_trace;
 
diff --git a/src/core/lib/backoff/backoff.cc b/src/core/lib/backoff/backoff.cc
index fe0a751..dc754dd 100644
--- a/src/core/lib/backoff/backoff.cc
+++ b/src/core/lib/backoff/backoff.cc
@@ -20,54 +20,61 @@
 
 #include <grpc/support/useful.h>
 
-void grpc_backoff_init(grpc_backoff *backoff,
-                       grpc_millis initial_connect_timeout, double multiplier,
-                       double jitter, grpc_millis min_timeout_millis,
-                       grpc_millis max_timeout_millis) {
-  backoff->initial_connect_timeout = initial_connect_timeout;
+void grpc_backoff_init(grpc_backoff* backoff, grpc_millis initial_backoff,
+                       double multiplier, double jitter,
+                       grpc_millis min_connect_timeout,
+                       grpc_millis max_backoff) {
+  backoff->initial_backoff = initial_backoff;
   backoff->multiplier = multiplier;
   backoff->jitter = jitter;
-  backoff->min_timeout_millis = min_timeout_millis;
-  backoff->max_timeout_millis = max_timeout_millis;
+  backoff->min_connect_timeout = min_connect_timeout;
+  backoff->max_backoff = max_backoff;
   backoff->rng_state = (uint32_t)gpr_now(GPR_CLOCK_REALTIME).tv_nsec;
 }
 
-grpc_millis grpc_backoff_begin(grpc_exec_ctx *exec_ctx, grpc_backoff *backoff) {
-  backoff->current_timeout_millis = backoff->initial_connect_timeout;
-  const grpc_millis first_timeout =
-      GPR_MAX(backoff->current_timeout_millis, backoff->min_timeout_millis);
-  return grpc_exec_ctx_now(exec_ctx) + first_timeout;
+grpc_backoff_result grpc_backoff_begin(grpc_exec_ctx* exec_ctx,
+                                       grpc_backoff* backoff) {
+  backoff->current_backoff = backoff->initial_backoff;
+  const grpc_millis initial_timeout =
+      GPR_MAX(backoff->initial_backoff, backoff->min_connect_timeout);
+  const grpc_millis now = grpc_exec_ctx_now(exec_ctx);
+  const grpc_backoff_result result = {now + initial_timeout,
+                                      now + backoff->current_backoff};
+  return result;
 }
 
 /* Generate a random number between 0 and 1. */
-static double generate_uniform_random_number(uint32_t *rng_state) {
+static double generate_uniform_random_number(uint32_t* rng_state) {
   *rng_state = (1103515245 * *rng_state + 12345) % ((uint32_t)1 << 31);
   return *rng_state / (double)((uint32_t)1 << 31);
 }
 
-grpc_millis grpc_backoff_step(grpc_exec_ctx *exec_ctx, grpc_backoff *backoff) {
-  const double new_timeout_millis =
-      backoff->multiplier * (double)backoff->current_timeout_millis;
-  backoff->current_timeout_millis =
-      GPR_MIN((grpc_millis)new_timeout_millis, backoff->max_timeout_millis);
-
-  const double jitter_range_width = backoff->jitter * new_timeout_millis;
-  const double jitter =
-      (2 * generate_uniform_random_number(&backoff->rng_state) - 1) *
-      jitter_range_width;
-
-  backoff->current_timeout_millis =
-      (grpc_millis)((double)(backoff->current_timeout_millis) + jitter);
-
-  const grpc_millis current_deadline =
-      grpc_exec_ctx_now(exec_ctx) + backoff->current_timeout_millis;
-
-  const grpc_millis min_deadline =
-      grpc_exec_ctx_now(exec_ctx) + backoff->min_timeout_millis;
-
-  return GPR_MAX(current_deadline, min_deadline);
+static double generate_uniform_random_number_between(uint32_t* rng_state,
+                                                     double a, double b) {
+  if (a == b) return a;
+  if (a > b) GPR_SWAP(double, a, b);  // make sure a < b
+  const double range = b - a;
+  return a + generate_uniform_random_number(rng_state) * range;
 }
 
-void grpc_backoff_reset(grpc_backoff *backoff) {
-  backoff->current_timeout_millis = backoff->initial_connect_timeout;
+grpc_backoff_result grpc_backoff_step(grpc_exec_ctx* exec_ctx,
+                                      grpc_backoff* backoff) {
+  backoff->current_backoff = (grpc_millis)(GPR_MIN(
+      backoff->current_backoff * backoff->multiplier, backoff->max_backoff));
+  const double jitter = generate_uniform_random_number_between(
+      &backoff->rng_state, -backoff->jitter * backoff->current_backoff,
+      backoff->jitter * backoff->current_backoff);
+  const grpc_millis current_timeout =
+      GPR_MAX((grpc_millis)(backoff->current_backoff + jitter),
+              backoff->min_connect_timeout);
+  const grpc_millis next_timeout = GPR_MIN(
+      (grpc_millis)(backoff->current_backoff + jitter), backoff->max_backoff);
+  const grpc_millis now = grpc_exec_ctx_now(exec_ctx);
+  const grpc_backoff_result result = {now + current_timeout,
+                                      now + next_timeout};
+  return result;
+}
+
+void grpc_backoff_reset(grpc_backoff* backoff) {
+  backoff->current_backoff = backoff->initial_backoff;
 }
diff --git a/src/core/lib/backoff/backoff.h b/src/core/lib/backoff/backoff.h
index 80e49ea..1067281 100644
--- a/src/core/lib/backoff/backoff.h
+++ b/src/core/lib/backoff/backoff.h
@@ -27,37 +27,54 @@
 
 typedef struct {
   /// const:  how long to wait after the first failure before retrying
-  grpc_millis initial_connect_timeout;
+  grpc_millis initial_backoff;
+
   /// const: factor with which to multiply backoff after a failed retry
   double multiplier;
+
   /// const: amount to randomize backoffs
   double jitter;
-  /// const: minimum time between retries in milliseconds
-  grpc_millis min_timeout_millis;
-  /// const: maximum time between retries in milliseconds
-  grpc_millis max_timeout_millis;
+
+  /// const: minimum time between retries
+  grpc_millis min_connect_timeout;
+
+  /// const: maximum time between retries
+  grpc_millis max_backoff;
+
+  /// current delay before retries
+  grpc_millis current_backoff;
 
   /// random number generator
   uint32_t rng_state;
-
-  /// current retry timeout in milliseconds
-  grpc_millis current_timeout_millis;
 } grpc_backoff;
 
-/// Initialize backoff machinery - does not need to be destroyed
-void grpc_backoff_init(grpc_backoff *backoff,
-                       grpc_millis initial_connect_timeout, double multiplier,
-                       double jitter, grpc_millis min_timeout_millis,
-                       grpc_millis max_timeout_millis);
+typedef struct {
+  /// Deadline to be used for the current attempt.
+  grpc_millis current_deadline;
 
-/// Begin retry loop: returns a timespec for the NEXT retry
-grpc_millis grpc_backoff_begin(grpc_exec_ctx *exec_ctx, grpc_backoff *backoff);
-/// Step a retry loop: returns a timespec for the NEXT retry
-grpc_millis grpc_backoff_step(grpc_exec_ctx *exec_ctx, grpc_backoff *backoff);
+  /// Deadline to be used for the next attempt, following the backoff strategy.
+  grpc_millis next_attempt_start_time;
+} grpc_backoff_result;
+
+/// Initialize backoff machinery - does not need to be destroyed
+void grpc_backoff_init(grpc_backoff* backoff, grpc_millis initial_backoff,
+                       double multiplier, double jitter,
+                       grpc_millis min_connect_timeout,
+                       grpc_millis max_backoff);
+
+/// Begin retry loop: returns the deadlines to be used for the current attempt
+/// and the subsequent retry, if any.
+grpc_backoff_result grpc_backoff_begin(grpc_exec_ctx* exec_ctx,
+                                       grpc_backoff* backoff);
+
+/// Step a retry loop: returns the deadlines to be used for the current attempt
+/// and the subsequent retry, if any.
+grpc_backoff_result grpc_backoff_step(grpc_exec_ctx* exec_ctx,
+                                      grpc_backoff* backoff);
+
 /// Reset the backoff, so the next grpc_backoff_step will be a
-/// grpc_backoff_begin
-/// instead
-void grpc_backoff_reset(grpc_backoff *backoff);
+/// grpc_backoff_begin.
+void grpc_backoff_reset(grpc_backoff* backoff);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc
index 30248b3..23a6043 100644
--- a/src/core/lib/channel/channel_args.cc
+++ b/src/core/lib/channel/channel_args.cc
@@ -31,7 +31,7 @@
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/support/string.h"
 
-static grpc_arg copy_arg(const grpc_arg *src) {
+static grpc_arg copy_arg(const grpc_arg* src) {
   grpc_arg dst;
   dst.type = src->type;
   dst.key = gpr_strdup(src->key);
@@ -51,21 +51,21 @@
   return dst;
 }
 
-grpc_channel_args *grpc_channel_args_copy_and_add(const grpc_channel_args *src,
-                                                  const grpc_arg *to_add,
+grpc_channel_args* grpc_channel_args_copy_and_add(const grpc_channel_args* src,
+                                                  const grpc_arg* to_add,
                                                   size_t num_to_add) {
   return grpc_channel_args_copy_and_add_and_remove(src, NULL, 0, to_add,
                                                    num_to_add);
 }
 
-grpc_channel_args *grpc_channel_args_copy_and_remove(
-    const grpc_channel_args *src, const char **to_remove,
+grpc_channel_args* grpc_channel_args_copy_and_remove(
+    const grpc_channel_args* src, const char** to_remove,
     size_t num_to_remove) {
   return grpc_channel_args_copy_and_add_and_remove(src, to_remove,
                                                    num_to_remove, NULL, 0);
 }
 
-static bool should_remove_arg(const grpc_arg *arg, const char **to_remove,
+static bool should_remove_arg(const grpc_arg* arg, const char** to_remove,
                               size_t num_to_remove) {
   for (size_t i = 0; i < num_to_remove; ++i) {
     if (strcmp(arg->key, to_remove[i]) == 0) return true;
@@ -73,9 +73,9 @@
   return false;
 }
 
-grpc_channel_args *grpc_channel_args_copy_and_add_and_remove(
-    const grpc_channel_args *src, const char **to_remove, size_t num_to_remove,
-    const grpc_arg *to_add, size_t num_to_add) {
+grpc_channel_args* grpc_channel_args_copy_and_add_and_remove(
+    const grpc_channel_args* src, const char** to_remove, size_t num_to_remove,
+    const grpc_arg* to_add, size_t num_to_add) {
   // Figure out how many args we'll be copying.
   size_t num_args_to_copy = 0;
   if (src != NULL) {
@@ -86,14 +86,14 @@
     }
   }
   // Create result.
-  grpc_channel_args *dst =
-      (grpc_channel_args *)gpr_malloc(sizeof(grpc_channel_args));
+  grpc_channel_args* dst =
+      (grpc_channel_args*)gpr_malloc(sizeof(grpc_channel_args));
   dst->num_args = num_args_to_copy + num_to_add;
   if (dst->num_args == 0) {
     dst->args = NULL;
     return dst;
   }
-  dst->args = (grpc_arg *)gpr_malloc(sizeof(grpc_arg) * dst->num_args);
+  dst->args = (grpc_arg*)gpr_malloc(sizeof(grpc_arg) * dst->num_args);
   // Copy args from src that are not being removed.
   size_t dst_idx = 0;
   if (src != NULL) {
@@ -111,30 +111,30 @@
   return dst;
 }
 
-grpc_channel_args *grpc_channel_args_copy(const grpc_channel_args *src) {
+grpc_channel_args* grpc_channel_args_copy(const grpc_channel_args* src) {
   return grpc_channel_args_copy_and_add(src, NULL, 0);
 }
 
-grpc_channel_args *grpc_channel_args_union(const grpc_channel_args *a,
-                                           const grpc_channel_args *b) {
+grpc_channel_args* grpc_channel_args_union(const grpc_channel_args* a,
+                                           const grpc_channel_args* b) {
   const size_t max_out = (a->num_args + b->num_args);
-  grpc_arg *uniques = (grpc_arg *)gpr_malloc(sizeof(*uniques) * max_out);
+  grpc_arg* uniques = (grpc_arg*)gpr_malloc(sizeof(*uniques) * max_out);
   for (size_t i = 0; i < a->num_args; ++i) uniques[i] = a->args[i];
 
   size_t uniques_idx = a->num_args;
   for (size_t i = 0; i < b->num_args; ++i) {
-    const char *b_key = b->args[i].key;
+    const char* b_key = b->args[i].key;
     if (grpc_channel_args_find(a, b_key) == NULL) {  // not found
       uniques[uniques_idx++] = b->args[i];
     }
   }
-  grpc_channel_args *result =
+  grpc_channel_args* result =
       grpc_channel_args_copy_and_add(NULL, uniques, uniques_idx);
   gpr_free(uniques);
   return result;
 }
 
-static int cmp_arg(const grpc_arg *a, const grpc_arg *b) {
+static int cmp_arg(const grpc_arg* a, const grpc_arg* b) {
   int c = GPR_ICMP(a->type, b->type);
   if (c != 0) return c;
   c = strcmp(a->key, b->key);
@@ -160,26 +160,26 @@
 
 /* stabilizing comparison function: since channel_args ordering matters for
  * keys with the same name, we need to preserve that ordering */
-static int cmp_key_stable(const void *ap, const void *bp) {
-  const grpc_arg *const *a = (const grpc_arg *const *)ap;
-  const grpc_arg *const *b = (const grpc_arg *const *)bp;
+static int cmp_key_stable(const void* ap, const void* bp) {
+  const grpc_arg* const* a = (const grpc_arg* const*)ap;
+  const grpc_arg* const* b = (const grpc_arg* const*)bp;
   int c = strcmp((*a)->key, (*b)->key);
   if (c == 0) c = GPR_ICMP(*a, *b);
   return c;
 }
 
-grpc_channel_args *grpc_channel_args_normalize(const grpc_channel_args *a) {
-  grpc_arg **args = (grpc_arg **)gpr_malloc(sizeof(grpc_arg *) * a->num_args);
+grpc_channel_args* grpc_channel_args_normalize(const grpc_channel_args* a) {
+  grpc_arg** args = (grpc_arg**)gpr_malloc(sizeof(grpc_arg*) * a->num_args);
   for (size_t i = 0; i < a->num_args; i++) {
     args[i] = &a->args[i];
   }
   if (a->num_args > 1)
-    qsort(args, a->num_args, sizeof(grpc_arg *), cmp_key_stable);
+    qsort(args, a->num_args, sizeof(grpc_arg*), cmp_key_stable);
 
-  grpc_channel_args *b =
-      (grpc_channel_args *)gpr_malloc(sizeof(grpc_channel_args));
+  grpc_channel_args* b =
+      (grpc_channel_args*)gpr_malloc(sizeof(grpc_channel_args));
   b->num_args = a->num_args;
-  b->args = (grpc_arg *)gpr_malloc(sizeof(grpc_arg) * b->num_args);
+  b->args = (grpc_arg*)gpr_malloc(sizeof(grpc_arg) * b->num_args);
   for (size_t i = 0; i < a->num_args; i++) {
     b->args[i] = copy_arg(args[i]);
   }
@@ -188,7 +188,7 @@
   return b;
 }
 
-void grpc_channel_args_destroy(grpc_exec_ctx *exec_ctx, grpc_channel_args *a) {
+void grpc_channel_args_destroy(grpc_exec_ctx* exec_ctx, grpc_channel_args* a) {
   size_t i;
   if (!a) return;
   for (i = 0; i < a->num_args; i++) {
@@ -210,7 +210,7 @@
 }
 
 grpc_compression_algorithm grpc_channel_args_get_compression_algorithm(
-    const grpc_channel_args *a) {
+    const grpc_channel_args* a) {
   size_t i;
   if (a == NULL) return GRPC_COMPRESS_NONE;
   for (i = 0; i < a->num_args; ++i) {
@@ -224,7 +224,7 @@
 }
 
 grpc_stream_compression_algorithm
-grpc_channel_args_get_stream_compression_algorithm(const grpc_channel_args *a) {
+grpc_channel_args_get_stream_compression_algorithm(const grpc_channel_args* a) {
   size_t i;
   if (a == NULL) return GRPC_STREAM_COMPRESS_NONE;
   for (i = 0; i < a->num_args; ++i) {
@@ -238,22 +238,22 @@
   return GRPC_STREAM_COMPRESS_NONE;
 }
 
-grpc_channel_args *grpc_channel_args_set_compression_algorithm(
-    grpc_channel_args *a, grpc_compression_algorithm algorithm) {
+grpc_channel_args* grpc_channel_args_set_compression_algorithm(
+    grpc_channel_args* a, grpc_compression_algorithm algorithm) {
   GPR_ASSERT(algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT);
   grpc_arg tmp;
   tmp.type = GRPC_ARG_INTEGER;
-  tmp.key = (char *)GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM;
+  tmp.key = (char*)GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM;
   tmp.value.integer = algorithm;
   return grpc_channel_args_copy_and_add(a, &tmp, 1);
 }
 
-grpc_channel_args *grpc_channel_args_set_stream_compression_algorithm(
-    grpc_channel_args *a, grpc_stream_compression_algorithm algorithm) {
+grpc_channel_args* grpc_channel_args_set_stream_compression_algorithm(
+    grpc_channel_args* a, grpc_stream_compression_algorithm algorithm) {
   GPR_ASSERT(algorithm < GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT);
   grpc_arg tmp;
   tmp.type = GRPC_ARG_INTEGER;
-  tmp.key = (char *)GRPC_STREAM_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM;
+  tmp.key = (char*)GRPC_STREAM_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM;
   tmp.value.integer = algorithm;
   return grpc_channel_args_copy_and_add(a, &tmp, 1);
 }
@@ -261,8 +261,8 @@
 /** Returns 1 if the argument for compression algorithm's enabled states bitset
  * was found in \a a, returning the arg's value in \a states. Otherwise, returns
  * 0. */
-static int find_compression_algorithm_states_bitset(const grpc_channel_args *a,
-                                                    int **states_arg) {
+static int find_compression_algorithm_states_bitset(const grpc_channel_args* a,
+                                                    int** states_arg) {
   if (a != NULL) {
     size_t i;
     for (i = 0; i < a->num_args; ++i) {
@@ -282,7 +282,7 @@
  * was found in \a a, returning the arg's value in \a states. Otherwise, returns
  * 0. */
 static int find_stream_compression_algorithm_states_bitset(
-    const grpc_channel_args *a, int **states_arg) {
+    const grpc_channel_args* a, int** states_arg) {
   if (a != NULL) {
     size_t i;
     for (i = 0; i < a->num_args; ++i) {
@@ -298,17 +298,17 @@
   return 0; /* GPR_FALSE */
 }
 
-grpc_channel_args *grpc_channel_args_compression_algorithm_set_state(
-    grpc_exec_ctx *exec_ctx, grpc_channel_args **a,
+grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
+    grpc_exec_ctx* exec_ctx, grpc_channel_args** a,
     grpc_compression_algorithm algorithm, int state) {
-  int *states_arg = NULL;
-  grpc_channel_args *result = *a;
+  int* states_arg = NULL;
+  grpc_channel_args* result = *a;
   const int states_arg_found =
       find_compression_algorithm_states_bitset(*a, &states_arg);
 
   if (grpc_channel_args_get_compression_algorithm(*a) == algorithm &&
       state == 0) {
-    const char *algo_name = NULL;
+    const char* algo_name = NULL;
     GPR_ASSERT(grpc_compression_algorithm_name(algorithm, &algo_name) != 0);
     gpr_log(GPR_ERROR,
             "Tried to disable default compression algorithm '%s'. The "
@@ -316,21 +316,21 @@
             algo_name);
   } else if (states_arg_found) {
     if (state != 0) {
-      GPR_BITSET((unsigned *)states_arg, algorithm);
+      GPR_BITSET((unsigned*)states_arg, algorithm);
     } else if (algorithm != GRPC_COMPRESS_NONE) {
-      GPR_BITCLEAR((unsigned *)states_arg, algorithm);
+      GPR_BITCLEAR((unsigned*)states_arg, algorithm);
     }
   } else {
     /* create a new arg */
     grpc_arg tmp;
     tmp.type = GRPC_ARG_INTEGER;
-    tmp.key = (char *)GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET;
+    tmp.key = (char*)GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET;
     /* all enabled by default */
     tmp.value.integer = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1;
     if (state != 0) {
-      GPR_BITSET((unsigned *)&tmp.value.integer, algorithm);
+      GPR_BITSET((unsigned*)&tmp.value.integer, algorithm);
     } else if (algorithm != GRPC_COMPRESS_NONE) {
-      GPR_BITCLEAR((unsigned *)&tmp.value.integer, algorithm);
+      GPR_BITCLEAR((unsigned*)&tmp.value.integer, algorithm);
     }
     result = grpc_channel_args_copy_and_add(*a, &tmp, 1);
     grpc_channel_args_destroy(exec_ctx, *a);
@@ -339,17 +339,17 @@
   return result;
 }
 
-grpc_channel_args *grpc_channel_args_stream_compression_algorithm_set_state(
-    grpc_exec_ctx *exec_ctx, grpc_channel_args **a,
+grpc_channel_args* grpc_channel_args_stream_compression_algorithm_set_state(
+    grpc_exec_ctx* exec_ctx, grpc_channel_args** a,
     grpc_stream_compression_algorithm algorithm, int state) {
-  int *states_arg = NULL;
-  grpc_channel_args *result = *a;
+  int* states_arg = NULL;
+  grpc_channel_args* result = *a;
   const int states_arg_found =
       find_stream_compression_algorithm_states_bitset(*a, &states_arg);
 
   if (grpc_channel_args_get_stream_compression_algorithm(*a) == algorithm &&
       state == 0) {
-    const char *algo_name = NULL;
+    const char* algo_name = NULL;
     GPR_ASSERT(grpc_stream_compression_algorithm_name(algorithm, &algo_name) !=
                0);
     gpr_log(GPR_ERROR,
@@ -358,21 +358,21 @@
             algo_name);
   } else if (states_arg_found) {
     if (state != 0) {
-      GPR_BITSET((unsigned *)states_arg, algorithm);
+      GPR_BITSET((unsigned*)states_arg, algorithm);
     } else if (algorithm != GRPC_STREAM_COMPRESS_NONE) {
-      GPR_BITCLEAR((unsigned *)states_arg, algorithm);
+      GPR_BITCLEAR((unsigned*)states_arg, algorithm);
     }
   } else {
     /* create a new arg */
     grpc_arg tmp;
     tmp.type = GRPC_ARG_INTEGER;
-    tmp.key = (char *)GRPC_STREAM_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET;
+    tmp.key = (char*)GRPC_STREAM_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET;
     /* all enabled by default */
     tmp.value.integer = (1u << GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT) - 1;
     if (state != 0) {
-      GPR_BITSET((unsigned *)&tmp.value.integer, algorithm);
+      GPR_BITSET((unsigned*)&tmp.value.integer, algorithm);
     } else if (algorithm != GRPC_STREAM_COMPRESS_NONE) {
-      GPR_BITCLEAR((unsigned *)&tmp.value.integer, algorithm);
+      GPR_BITCLEAR((unsigned*)&tmp.value.integer, algorithm);
     }
     result = grpc_channel_args_copy_and_add(*a, &tmp, 1);
     grpc_channel_args_destroy(exec_ctx, *a);
@@ -382,8 +382,8 @@
 }
 
 uint32_t grpc_channel_args_compression_algorithm_get_states(
-    const grpc_channel_args *a) {
-  int *states_arg;
+    const grpc_channel_args* a) {
+  int* states_arg;
   if (find_compression_algorithm_states_bitset(a, &states_arg)) {
     return (uint32_t)*states_arg;
   } else {
@@ -392,8 +392,8 @@
 }
 
 uint32_t grpc_channel_args_stream_compression_algorithm_get_states(
-    const grpc_channel_args *a) {
-  int *states_arg;
+    const grpc_channel_args* a) {
+  int* states_arg;
   if (find_stream_compression_algorithm_states_bitset(a, &states_arg)) {
     return (uint32_t)*states_arg;
   } else {
@@ -402,14 +402,14 @@
   }
 }
 
-grpc_channel_args *grpc_channel_args_set_socket_mutator(
-    grpc_channel_args *a, grpc_socket_mutator *mutator) {
+grpc_channel_args* grpc_channel_args_set_socket_mutator(
+    grpc_channel_args* a, grpc_socket_mutator* mutator) {
   grpc_arg tmp = grpc_socket_mutator_to_arg(mutator);
   return grpc_channel_args_copy_and_add(a, &tmp, 1);
 }
 
-int grpc_channel_args_compare(const grpc_channel_args *a,
-                              const grpc_channel_args *b) {
+int grpc_channel_args_compare(const grpc_channel_args* a,
+                              const grpc_channel_args* b) {
   int c = GPR_ICMP(a->num_args, b->num_args);
   if (c != 0) return c;
   for (size_t i = 0; i < a->num_args; i++) {
@@ -419,8 +419,8 @@
   return 0;
 }
 
-const grpc_arg *grpc_channel_args_find(const grpc_channel_args *args,
-                                       const char *name) {
+const grpc_arg* grpc_channel_args_find(const grpc_channel_args* args,
+                                       const char* name) {
   if (args != NULL) {
     for (size_t i = 0; i < args->num_args; ++i) {
       if (strcmp(args->args[i].key, name) == 0) {
@@ -431,7 +431,7 @@
   return NULL;
 }
 
-int grpc_channel_arg_get_integer(const grpc_arg *arg,
+int grpc_channel_arg_get_integer(const grpc_arg* arg,
                                  const grpc_integer_options options) {
   if (arg == NULL) return options.default_value;
   if (arg->type != GRPC_ARG_INTEGER) {
@@ -451,7 +451,7 @@
   return arg->value.integer;
 }
 
-bool grpc_channel_arg_get_bool(const grpc_arg *arg, bool default_value) {
+bool grpc_channel_arg_get_bool(const grpc_arg* arg, bool default_value) {
   if (arg == NULL) return default_value;
   if (arg->type != GRPC_ARG_INTEGER) {
     gpr_log(GPR_ERROR, "%s ignored: it must be an integer", arg->key);
@@ -469,12 +469,12 @@
   }
 }
 
-bool grpc_channel_args_want_minimal_stack(const grpc_channel_args *args) {
+bool grpc_channel_args_want_minimal_stack(const grpc_channel_args* args) {
   return grpc_channel_arg_get_bool(
       grpc_channel_args_find(args, GRPC_ARG_MINIMAL_STACK), false);
 }
 
-grpc_arg grpc_channel_arg_string_create(char *name, char *value) {
+grpc_arg grpc_channel_arg_string_create(char* name, char* value) {
   grpc_arg arg;
   arg.type = GRPC_ARG_STRING;
   arg.key = name;
@@ -482,7 +482,7 @@
   return arg;
 }
 
-grpc_arg grpc_channel_arg_integer_create(char *name, int value) {
+grpc_arg grpc_channel_arg_integer_create(char* name, int value) {
   grpc_arg arg;
   arg.type = GRPC_ARG_INTEGER;
   arg.key = name;
@@ -491,7 +491,7 @@
 }
 
 grpc_arg grpc_channel_arg_pointer_create(
-    char *name, void *value, const grpc_arg_pointer_vtable *vtable) {
+    char* name, void* value, const grpc_arg_pointer_vtable* vtable) {
   grpc_arg arg;
   arg.type = GRPC_ARG_POINTER;
   arg.key = name;
diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h
index 1896d35..d36761d 100644
--- a/src/core/lib/channel/channel_args.h
+++ b/src/core/lib/channel/channel_args.h
@@ -30,56 +30,56 @@
 // Channel args are intentionally immutable, to avoid the need for locking.
 
 /** Copy the arguments in \a src into a new instance */
-grpc_channel_args *grpc_channel_args_copy(const grpc_channel_args *src);
+grpc_channel_args* grpc_channel_args_copy(const grpc_channel_args* src);
 
 /** Copy the arguments in \a src into a new instance, stably sorting keys */
-grpc_channel_args *grpc_channel_args_normalize(const grpc_channel_args *src);
+grpc_channel_args* grpc_channel_args_normalize(const grpc_channel_args* src);
 
 /** Copy the arguments in \a src and append \a to_add. If \a to_add is NULL, it
  * is equivalent to calling \a grpc_channel_args_copy. */
-grpc_channel_args *grpc_channel_args_copy_and_add(const grpc_channel_args *src,
-                                                  const grpc_arg *to_add,
+grpc_channel_args* grpc_channel_args_copy_and_add(const grpc_channel_args* src,
+                                                  const grpc_arg* to_add,
                                                   size_t num_to_add);
 
 /** Copies the arguments in \a src except for those whose keys are in
     \a to_remove. */
-grpc_channel_args *grpc_channel_args_copy_and_remove(
-    const grpc_channel_args *src, const char **to_remove, size_t num_to_remove);
+grpc_channel_args* grpc_channel_args_copy_and_remove(
+    const grpc_channel_args* src, const char** to_remove, size_t num_to_remove);
 
 /** Copies the arguments from \a src except for those whose keys are in
     \a to_remove and appends the arguments in \a to_add. */
-grpc_channel_args *grpc_channel_args_copy_and_add_and_remove(
-    const grpc_channel_args *src, const char **to_remove, size_t num_to_remove,
-    const grpc_arg *to_add, size_t num_to_add);
+grpc_channel_args* grpc_channel_args_copy_and_add_and_remove(
+    const grpc_channel_args* src, const char** to_remove, size_t num_to_remove,
+    const grpc_arg* to_add, size_t num_to_add);
 
 /** Perform the union of \a a and \a b, prioritizing \a a entries */
-grpc_channel_args *grpc_channel_args_union(const grpc_channel_args *a,
-                                           const grpc_channel_args *b);
+grpc_channel_args* grpc_channel_args_union(const grpc_channel_args* a,
+                                           const grpc_channel_args* b);
 
 /** Destroy arguments created by \a grpc_channel_args_copy */
-void grpc_channel_args_destroy(grpc_exec_ctx *exec_ctx, grpc_channel_args *a);
+void grpc_channel_args_destroy(grpc_exec_ctx* exec_ctx, grpc_channel_args* a);
 
 /** Returns the compression algorithm set in \a a. */
 grpc_compression_algorithm grpc_channel_args_get_compression_algorithm(
-    const grpc_channel_args *a);
+    const grpc_channel_args* a);
 
 /** Returns the stream compression algorithm set in \a a. */
 grpc_stream_compression_algorithm
-grpc_channel_args_get_stream_compression_algorithm(const grpc_channel_args *a);
+grpc_channel_args_get_stream_compression_algorithm(const grpc_channel_args* a);
 
 /** Returns a channel arg instance with compression enabled. If \a a is
  * non-NULL, its args are copied. N.B. GRPC_COMPRESS_NONE disables compression
  * for the channel. */
-grpc_channel_args *grpc_channel_args_set_compression_algorithm(
-    grpc_channel_args *a, grpc_compression_algorithm algorithm);
+grpc_channel_args* grpc_channel_args_set_compression_algorithm(
+    grpc_channel_args* a, grpc_compression_algorithm algorithm);
 
 /** Returns a channel arg instance with stream compression enabled. If \a a is
  * non-NULL, its args are copied. N.B. GRPC_STREAM_COMPRESS_NONE disables
  * stream compression for the channel. If a value other than
  * GRPC_STREAM_COMPRESS_NONE is set, it takes precedence over message-wise
  * compression algorithms. */
-grpc_channel_args *grpc_channel_args_set_stream_compression_algorithm(
-    grpc_channel_args *a, grpc_stream_compression_algorithm algorithm);
+grpc_channel_args* grpc_channel_args_set_stream_compression_algorithm(
+    grpc_channel_args* a, grpc_stream_compression_algorithm algorithm);
 
 /** Sets the support for the given compression algorithm. By default, all
  * compression algorithms are enabled. It's an error to disable an algorithm set
@@ -88,8 +88,8 @@
  * Returns an instance with the updated algorithm states. The \a a pointer is
  * modified to point to the returned instance (which may be different from the
  * input value of \a a). */
-grpc_channel_args *grpc_channel_args_compression_algorithm_set_state(
-    grpc_exec_ctx *exec_ctx, grpc_channel_args **a,
+grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
+    grpc_exec_ctx* exec_ctx, grpc_channel_args** a,
     grpc_compression_algorithm algorithm, int enabled);
 
 /** Sets the support for the given stream compression algorithm. By default, all
@@ -99,8 +99,8 @@
  * Returns an instance with the updated algorithm states. The \a a pointer is
  * modified to point to the returned instance (which may be different from the
  * input value of \a a). */
-grpc_channel_args *grpc_channel_args_stream_compression_algorithm_set_state(
-    grpc_exec_ctx *exec_ctx, grpc_channel_args **a,
+grpc_channel_args* grpc_channel_args_stream_compression_algorithm_set_state(
+    grpc_exec_ctx* exec_ctx, grpc_channel_args** a,
     grpc_stream_compression_algorithm algorithm, int enabled);
 
 /** Returns the bitset representing the support state (true for enabled, false
@@ -109,7 +109,7 @@
  * The i-th bit of the returned bitset corresponds to the i-th entry in the
  * grpc_compression_algorithm enum. */
 uint32_t grpc_channel_args_compression_algorithm_get_states(
-    const grpc_channel_args *a);
+    const grpc_channel_args* a);
 
 /** Returns the bitset representing the support state (true for enabled, false
  * for disabled) for stream compression algorithms.
@@ -117,23 +117,23 @@
  * The i-th bit of the returned bitset corresponds to the i-th entry in the
  * grpc_stream_compression_algorithm enum. */
 uint32_t grpc_channel_args_stream_compression_algorithm_get_states(
-    const grpc_channel_args *a);
+    const grpc_channel_args* a);
 
-int grpc_channel_args_compare(const grpc_channel_args *a,
-                              const grpc_channel_args *b);
+int grpc_channel_args_compare(const grpc_channel_args* a,
+                              const grpc_channel_args* b);
 
 /** Returns a channel arg instance with socket mutator added. The socket mutator
  * will perform its mutate_fd method on all file descriptors used by the
  * channel.
  * If \a a is non-MULL, its args are copied. */
-grpc_channel_args *grpc_channel_args_set_socket_mutator(
-    grpc_channel_args *a, grpc_socket_mutator *mutator);
+grpc_channel_args* grpc_channel_args_set_socket_mutator(
+    grpc_channel_args* a, grpc_socket_mutator* mutator);
 
 /** Returns the value of argument \a name from \a args, or NULL if not found. */
-const grpc_arg *grpc_channel_args_find(const grpc_channel_args *args,
-                                       const char *name);
+const grpc_arg* grpc_channel_args_find(const grpc_channel_args* args,
+                                       const char* name);
 
-bool grpc_channel_args_want_minimal_stack(const grpc_channel_args *args);
+bool grpc_channel_args_want_minimal_stack(const grpc_channel_args* args);
 
 typedef struct grpc_integer_options {
   int default_value;  // Return this if value is outside of expected bounds.
@@ -142,16 +142,16 @@
 } grpc_integer_options;
 
 /** Returns the value of \a arg, subject to the contraints in \a options. */
-int grpc_channel_arg_get_integer(const grpc_arg *arg,
+int grpc_channel_arg_get_integer(const grpc_arg* arg,
                                  const grpc_integer_options options);
 
-bool grpc_channel_arg_get_bool(const grpc_arg *arg, bool default_value);
+bool grpc_channel_arg_get_bool(const grpc_arg* arg, bool default_value);
 
 // Helpers for creating channel args.
-grpc_arg grpc_channel_arg_string_create(char *name, char *value);
-grpc_arg grpc_channel_arg_integer_create(char *name, int value);
-grpc_arg grpc_channel_arg_pointer_create(char *name, void *value,
-                                         const grpc_arg_pointer_vtable *vtable);
+grpc_arg grpc_channel_arg_string_create(char* name, char* value);
+grpc_arg grpc_channel_arg_integer_create(char* name, int value);
+grpc_arg grpc_channel_arg_pointer_create(char* name, void* value,
+                                         const grpc_arg_pointer_vtable* vtable);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/channel/channel_stack.cc b/src/core/lib/channel/channel_stack.cc
index 1e48d1c..07f666b 100644
--- a/src/core/lib/channel/channel_stack.cc
+++ b/src/core/lib/channel/channel_stack.cc
@@ -45,7 +45,7 @@
 #define ROUND_UP_TO_ALIGNMENT_SIZE(x) \
   (((x) + GPR_MAX_ALIGNMENT - 1u) & ~(GPR_MAX_ALIGNMENT - 1u))
 
-size_t grpc_channel_stack_size(const grpc_channel_filter **filters,
+size_t grpc_channel_stack_size(const grpc_channel_filter** filters,
                                size_t filter_count) {
   /* always need the header, and size for the channel elements */
   size_t size =
@@ -64,52 +64,51 @@
   return size;
 }
 
-#define CHANNEL_ELEMS_FROM_STACK(stk)                                   \
-  ((grpc_channel_element *)((char *)(stk) + ROUND_UP_TO_ALIGNMENT_SIZE( \
-                                                sizeof(grpc_channel_stack))))
+#define CHANNEL_ELEMS_FROM_STACK(stk)                                 \
+  ((grpc_channel_element*)((char*)(stk) + ROUND_UP_TO_ALIGNMENT_SIZE( \
+                                              sizeof(grpc_channel_stack))))
 
-#define CALL_ELEMS_FROM_STACK(stk)       \
-  ((grpc_call_element *)((char *)(stk) + \
-                         ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call_stack))))
+#define CALL_ELEMS_FROM_STACK(stk)     \
+  ((grpc_call_element*)((char*)(stk) + \
+                        ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call_stack))))
 
-grpc_channel_element *grpc_channel_stack_element(
-    grpc_channel_stack *channel_stack, size_t index) {
+grpc_channel_element* grpc_channel_stack_element(
+    grpc_channel_stack* channel_stack, size_t index) {
   return CHANNEL_ELEMS_FROM_STACK(channel_stack) + index;
 }
 
-grpc_channel_element *grpc_channel_stack_last_element(
-    grpc_channel_stack *channel_stack) {
+grpc_channel_element* grpc_channel_stack_last_element(
+    grpc_channel_stack* channel_stack) {
   return grpc_channel_stack_element(channel_stack, channel_stack->count - 1);
 }
 
-grpc_call_element *grpc_call_stack_element(grpc_call_stack *call_stack,
+grpc_call_element* grpc_call_stack_element(grpc_call_stack* call_stack,
                                            size_t index) {
   return CALL_ELEMS_FROM_STACK(call_stack) + index;
 }
 
-grpc_error *grpc_channel_stack_init(
-    grpc_exec_ctx *exec_ctx, int initial_refs, grpc_iomgr_cb_func destroy,
-    void *destroy_arg, const grpc_channel_filter **filters, size_t filter_count,
-    const grpc_channel_args *channel_args, grpc_transport *optional_transport,
-    const char *name, grpc_channel_stack *stack) {
+grpc_error* grpc_channel_stack_init(
+    grpc_exec_ctx* exec_ctx, int initial_refs, grpc_iomgr_cb_func destroy,
+    void* destroy_arg, const grpc_channel_filter** filters, size_t filter_count,
+    const grpc_channel_args* channel_args, grpc_transport* optional_transport,
+    const char* name, grpc_channel_stack* stack) {
   size_t call_size =
       ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call_stack)) +
       ROUND_UP_TO_ALIGNMENT_SIZE(filter_count * sizeof(grpc_call_element));
-  grpc_channel_element *elems;
+  grpc_channel_element* elems;
   grpc_channel_element_args args;
-  char *user_data;
+  char* user_data;
   size_t i;
 
   stack->count = filter_count;
   GRPC_STREAM_REF_INIT(&stack->refcount, initial_refs, destroy, destroy_arg,
                        name);
   elems = CHANNEL_ELEMS_FROM_STACK(stack);
-  user_data =
-      ((char *)elems) +
-      ROUND_UP_TO_ALIGNMENT_SIZE(filter_count * sizeof(grpc_channel_element));
+  user_data = ((char*)elems) + ROUND_UP_TO_ALIGNMENT_SIZE(
+                                   filter_count * sizeof(grpc_channel_element));
 
   /* init per-filter data */
-  grpc_error *first_error = GRPC_ERROR_NONE;
+  grpc_error* first_error = GRPC_ERROR_NONE;
   for (i = 0; i < filter_count; i++) {
     args.channel_stack = stack;
     args.channel_args = channel_args;
@@ -118,7 +117,7 @@
     args.is_last = i == (filter_count - 1);
     elems[i].filter = filters[i];
     elems[i].channel_data = user_data;
-    grpc_error *error =
+    grpc_error* error =
         elems[i].filter->init_channel_elem(exec_ctx, &elems[i], &args);
     if (error != GRPC_ERROR_NONE) {
       if (first_error == GRPC_ERROR_NONE) {
@@ -131,17 +130,17 @@
     call_size += ROUND_UP_TO_ALIGNMENT_SIZE(filters[i]->sizeof_call_data);
   }
 
-  GPR_ASSERT(user_data > (char *)stack);
-  GPR_ASSERT((uintptr_t)(user_data - (char *)stack) ==
+  GPR_ASSERT(user_data > (char*)stack);
+  GPR_ASSERT((uintptr_t)(user_data - (char*)stack) ==
              grpc_channel_stack_size(filters, filter_count));
 
   stack->call_stack_size = call_size;
   return first_error;
 }
 
-void grpc_channel_stack_destroy(grpc_exec_ctx *exec_ctx,
-                                grpc_channel_stack *stack) {
-  grpc_channel_element *channel_elems = CHANNEL_ELEMS_FROM_STACK(stack);
+void grpc_channel_stack_destroy(grpc_exec_ctx* exec_ctx,
+                                grpc_channel_stack* stack) {
+  grpc_channel_element* channel_elems = CHANNEL_ELEMS_FROM_STACK(stack);
   size_t count = stack->count;
   size_t i;
 
@@ -151,31 +150,31 @@
   }
 }
 
-grpc_error *grpc_call_stack_init(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_stack *channel_stack,
+grpc_error* grpc_call_stack_init(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_stack* channel_stack,
                                  int initial_refs, grpc_iomgr_cb_func destroy,
-                                 void *destroy_arg,
-                                 const grpc_call_element_args *elem_args) {
-  grpc_channel_element *channel_elems = CHANNEL_ELEMS_FROM_STACK(channel_stack);
+                                 void* destroy_arg,
+                                 const grpc_call_element_args* elem_args) {
+  grpc_channel_element* channel_elems = CHANNEL_ELEMS_FROM_STACK(channel_stack);
   size_t count = channel_stack->count;
-  grpc_call_element *call_elems;
-  char *user_data;
+  grpc_call_element* call_elems;
+  char* user_data;
   size_t i;
 
   elem_args->call_stack->count = count;
   GRPC_STREAM_REF_INIT(&elem_args->call_stack->refcount, initial_refs, destroy,
                        destroy_arg, "CALL_STACK");
   call_elems = CALL_ELEMS_FROM_STACK(elem_args->call_stack);
-  user_data = ((char *)call_elems) +
+  user_data = ((char*)call_elems) +
               ROUND_UP_TO_ALIGNMENT_SIZE(count * sizeof(grpc_call_element));
 
   /* init per-filter data */
-  grpc_error *first_error = GRPC_ERROR_NONE;
+  grpc_error* first_error = GRPC_ERROR_NONE;
   for (i = 0; i < count; i++) {
     call_elems[i].filter = channel_elems[i].filter;
     call_elems[i].channel_data = channel_elems[i].channel_data;
     call_elems[i].call_data = user_data;
-    grpc_error *error = call_elems[i].filter->init_call_elem(
+    grpc_error* error = call_elems[i].filter->init_call_elem(
         exec_ctx, &call_elems[i], elem_args);
     if (error != GRPC_ERROR_NONE) {
       if (first_error == GRPC_ERROR_NONE) {
@@ -190,16 +189,16 @@
   return first_error;
 }
 
-void grpc_call_stack_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
-                                                grpc_call_stack *call_stack,
-                                                grpc_polling_entity *pollent) {
+void grpc_call_stack_set_pollset_or_pollset_set(grpc_exec_ctx* exec_ctx,
+                                                grpc_call_stack* call_stack,
+                                                grpc_polling_entity* pollent) {
   size_t count = call_stack->count;
-  grpc_call_element *call_elems;
-  char *user_data;
+  grpc_call_element* call_elems;
+  char* user_data;
   size_t i;
 
   call_elems = CALL_ELEMS_FROM_STACK(call_stack);
-  user_data = ((char *)call_elems) +
+  user_data = ((char*)call_elems) +
               ROUND_UP_TO_ALIGNMENT_SIZE(count * sizeof(grpc_call_element));
 
   /* init per-filter data */
@@ -212,13 +211,13 @@
 }
 
 void grpc_call_stack_ignore_set_pollset_or_pollset_set(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_polling_entity *pollent) {}
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_polling_entity* pollent) {}
 
-void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack,
-                             const grpc_call_final_info *final_info,
-                             grpc_closure *then_schedule_closure) {
-  grpc_call_element *elems = CALL_ELEMS_FROM_STACK(stack);
+void grpc_call_stack_destroy(grpc_exec_ctx* exec_ctx, grpc_call_stack* stack,
+                             const grpc_call_final_info* final_info,
+                             grpc_closure* then_schedule_closure) {
+  grpc_call_element* elems = CALL_ELEMS_FROM_STACK(stack);
   size_t count = stack->count;
   size_t i;
 
@@ -230,33 +229,33 @@
   }
 }
 
-void grpc_call_next_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                       grpc_transport_stream_op_batch *op) {
-  grpc_call_element *next_elem = elem + 1;
+void grpc_call_next_op(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                       grpc_transport_stream_op_batch* op) {
+  grpc_call_element* next_elem = elem + 1;
   GRPC_CALL_LOG_OP(GPR_INFO, next_elem, op);
   next_elem->filter->start_transport_stream_op_batch(exec_ctx, next_elem, op);
 }
 
-void grpc_channel_next_get_info(grpc_exec_ctx *exec_ctx,
-                                grpc_channel_element *elem,
-                                const grpc_channel_info *channel_info) {
-  grpc_channel_element *next_elem = elem + 1;
+void grpc_channel_next_get_info(grpc_exec_ctx* exec_ctx,
+                                grpc_channel_element* elem,
+                                const grpc_channel_info* channel_info) {
+  grpc_channel_element* next_elem = elem + 1;
   next_elem->filter->get_channel_info(exec_ctx, next_elem, channel_info);
 }
 
-void grpc_channel_next_op(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                          grpc_transport_op *op) {
-  grpc_channel_element *next_elem = elem + 1;
+void grpc_channel_next_op(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                          grpc_transport_op* op) {
+  grpc_channel_element* next_elem = elem + 1;
   next_elem->filter->start_transport_op(exec_ctx, next_elem, op);
 }
 
-grpc_channel_stack *grpc_channel_stack_from_top_element(
-    grpc_channel_element *elem) {
-  return (grpc_channel_stack *)((char *)(elem)-ROUND_UP_TO_ALIGNMENT_SIZE(
+grpc_channel_stack* grpc_channel_stack_from_top_element(
+    grpc_channel_element* elem) {
+  return (grpc_channel_stack*)((char*)(elem)-ROUND_UP_TO_ALIGNMENT_SIZE(
       sizeof(grpc_channel_stack)));
 }
 
-grpc_call_stack *grpc_call_stack_from_top_element(grpc_call_element *elem) {
-  return (grpc_call_stack *)((char *)(elem)-ROUND_UP_TO_ALIGNMENT_SIZE(
+grpc_call_stack* grpc_call_stack_from_top_element(grpc_call_element* elem) {
+  return (grpc_call_stack*)((char*)(elem)-ROUND_UP_TO_ALIGNMENT_SIZE(
       sizeof(grpc_call_stack)));
 }
diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h
index 0796d6f..6b41ad1 100644
--- a/src/core/lib/channel/channel_stack.h
+++ b/src/core/lib/channel/channel_stack.h
@@ -56,23 +56,23 @@
 typedef struct grpc_call_stack grpc_call_stack;
 
 typedef struct {
-  grpc_channel_stack *channel_stack;
-  const grpc_channel_args *channel_args;
+  grpc_channel_stack* channel_stack;
+  const grpc_channel_args* channel_args;
   /** Transport, iff it is known */
-  grpc_transport *optional_transport;
+  grpc_transport* optional_transport;
   int is_first;
   int is_last;
 } grpc_channel_element_args;
 
 typedef struct {
-  grpc_call_stack *call_stack;
-  const void *server_transport_data;
-  grpc_call_context_element *context;
+  grpc_call_stack* call_stack;
+  const void* server_transport_data;
+  grpc_call_context_element* context;
   grpc_slice path;
   gpr_timespec start_time;
   grpc_millis deadline;
-  gpr_arena *arena;
-  grpc_call_combiner *call_combiner;
+  gpr_arena* arena;
+  grpc_call_combiner* call_combiner;
 } grpc_call_element_args;
 
 typedef struct {
@@ -99,14 +99,14 @@
 typedef struct {
   /* Called to eg. send/receive data on a call.
      See grpc_call_next_op on how to call the next element in the stack */
-  void (*start_transport_stream_op_batch)(grpc_exec_ctx *exec_ctx,
-                                          grpc_call_element *elem,
-                                          grpc_transport_stream_op_batch *op);
+  void (*start_transport_stream_op_batch)(grpc_exec_ctx* exec_ctx,
+                                          grpc_call_element* elem,
+                                          grpc_transport_stream_op_batch* op);
   /* Called to handle channel level operations - e.g. new calls, or transport
      closure.
      See grpc_channel_next_op on how to call the next element in the stack */
-  void (*start_transport_op)(grpc_exec_ctx *exec_ctx,
-                             grpc_channel_element *elem, grpc_transport_op *op);
+  void (*start_transport_op)(grpc_exec_ctx* exec_ctx,
+                             grpc_channel_element* elem, grpc_transport_op* op);
 
   /* sizeof(per call data) */
   size_t sizeof_call_data;
@@ -119,21 +119,21 @@
      transport and is on the server. Most filters want to ignore this
      argument.
      Implementations may assume that elem->call_data is all zeros. */
-  grpc_error *(*init_call_elem)(grpc_exec_ctx *exec_ctx,
-                                grpc_call_element *elem,
-                                const grpc_call_element_args *args);
-  void (*set_pollset_or_pollset_set)(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_element *elem,
-                                     grpc_polling_entity *pollent);
+  grpc_error* (*init_call_elem)(grpc_exec_ctx* exec_ctx,
+                                grpc_call_element* elem,
+                                const grpc_call_element_args* args);
+  void (*set_pollset_or_pollset_set)(grpc_exec_ctx* exec_ctx,
+                                     grpc_call_element* elem,
+                                     grpc_polling_entity* pollent);
   /* Destroy per call data.
      The filter does not need to do any chaining.
      The bottom filter of a stack will be passed a non-NULL pointer to
      \a then_schedule_closure that should be passed to GRPC_CLOSURE_SCHED when
      destruction is complete. \a final_info contains data about the completed
      call, mainly for reporting purposes. */
-  void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                            const grpc_call_final_info *final_info,
-                            grpc_closure *then_schedule_closure);
+  void (*destroy_call_elem)(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                            const grpc_call_final_info* final_info,
+                            grpc_closure* then_schedule_closure);
 
   /* sizeof(per channel data) */
   size_t sizeof_channel_data;
@@ -144,36 +144,36 @@
      useful for asserting correct configuration by upper layer code.
      The filter does not need to do any chaining.
      Implementations may assume that elem->call_data is all zeros. */
-  grpc_error *(*init_channel_elem)(grpc_exec_ctx *exec_ctx,
-                                   grpc_channel_element *elem,
-                                   grpc_channel_element_args *args);
+  grpc_error* (*init_channel_elem)(grpc_exec_ctx* exec_ctx,
+                                   grpc_channel_element* elem,
+                                   grpc_channel_element_args* args);
   /* Destroy per channel data.
      The filter does not need to do any chaining */
-  void (*destroy_channel_elem)(grpc_exec_ctx *exec_ctx,
-                               grpc_channel_element *elem);
+  void (*destroy_channel_elem)(grpc_exec_ctx* exec_ctx,
+                               grpc_channel_element* elem);
 
   /* Implement grpc_channel_get_info() */
-  void (*get_channel_info)(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                           const grpc_channel_info *channel_info);
+  void (*get_channel_info)(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                           const grpc_channel_info* channel_info);
 
   /* The name of this filter */
-  const char *name;
+  const char* name;
 } grpc_channel_filter;
 
 /* A channel_element tracks its filter and the filter requested memory within
    a channel allocation */
 struct grpc_channel_element {
-  const grpc_channel_filter *filter;
-  void *channel_data;
+  const grpc_channel_filter* filter;
+  void* channel_data;
 };
 
 /* A call_element tracks its filter, the filter requested memory within
    a channel allocation, and the filter requested memory within a call
    allocation */
 struct grpc_call_element {
-  const grpc_channel_filter *filter;
-  void *channel_data;
-  void *call_data;
+  const grpc_channel_filter* filter;
+  void* channel_data;
+  void* call_data;
 };
 
 /* A channel stack tracks a set of related filters for one channel, and
@@ -198,40 +198,40 @@
 };
 
 /* Get a channel element given a channel stack and its index */
-grpc_channel_element *grpc_channel_stack_element(grpc_channel_stack *stack,
+grpc_channel_element* grpc_channel_stack_element(grpc_channel_stack* stack,
                                                  size_t i);
 /* Get the last channel element in a channel stack */
-grpc_channel_element *grpc_channel_stack_last_element(
-    grpc_channel_stack *stack);
+grpc_channel_element* grpc_channel_stack_last_element(
+    grpc_channel_stack* stack);
 /* Get a call stack element given a call stack and an index */
-grpc_call_element *grpc_call_stack_element(grpc_call_stack *stack, size_t i);
+grpc_call_element* grpc_call_stack_element(grpc_call_stack* stack, size_t i);
 
 /* Determine memory required for a channel stack containing a set of filters */
-size_t grpc_channel_stack_size(const grpc_channel_filter **filters,
+size_t grpc_channel_stack_size(const grpc_channel_filter** filters,
                                size_t filter_count);
 /* Initialize a channel stack given some filters */
-grpc_error *grpc_channel_stack_init(
-    grpc_exec_ctx *exec_ctx, int initial_refs, grpc_iomgr_cb_func destroy,
-    void *destroy_arg, const grpc_channel_filter **filters, size_t filter_count,
-    const grpc_channel_args *args, grpc_transport *optional_transport,
-    const char *name, grpc_channel_stack *stack);
+grpc_error* grpc_channel_stack_init(
+    grpc_exec_ctx* exec_ctx, int initial_refs, grpc_iomgr_cb_func destroy,
+    void* destroy_arg, const grpc_channel_filter** filters, size_t filter_count,
+    const grpc_channel_args* args, grpc_transport* optional_transport,
+    const char* name, grpc_channel_stack* stack);
 /* Destroy a channel stack */
-void grpc_channel_stack_destroy(grpc_exec_ctx *exec_ctx,
-                                grpc_channel_stack *stack);
+void grpc_channel_stack_destroy(grpc_exec_ctx* exec_ctx,
+                                grpc_channel_stack* stack);
 
 /* Initialize a call stack given a channel stack. transport_server_data is
    expected to be NULL on a client, or an opaque transport owned pointer on the
    server. */
-grpc_error *grpc_call_stack_init(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_stack *channel_stack,
+grpc_error* grpc_call_stack_init(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_stack* channel_stack,
                                  int initial_refs, grpc_iomgr_cb_func destroy,
-                                 void *destroy_arg,
-                                 const grpc_call_element_args *elem_args);
+                                 void* destroy_arg,
+                                 const grpc_call_element_args* elem_args);
 /* Set a pollset or a pollset_set for a call stack: must occur before the first
  * op is started */
-void grpc_call_stack_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
-                                                grpc_call_stack *call_stack,
-                                                grpc_polling_entity *pollent);
+void grpc_call_stack_set_pollset_or_pollset_set(grpc_exec_ctx* exec_ctx,
+                                                grpc_call_stack* call_stack,
+                                                grpc_polling_entity* pollent);
 
 #ifndef NDEBUG
 #define GRPC_CALL_STACK_REF(call_stack, reason) \
@@ -254,36 +254,36 @@
 #endif
 
 /* Destroy a call stack */
-void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack,
-                             const grpc_call_final_info *final_info,
-                             grpc_closure *then_schedule_closure);
+void grpc_call_stack_destroy(grpc_exec_ctx* exec_ctx, grpc_call_stack* stack,
+                             const grpc_call_final_info* final_info,
+                             grpc_closure* then_schedule_closure);
 
 /* Ignore set pollset{_set} - used by filters if they don't care about pollsets
  * at all. Does nothing. */
 void grpc_call_stack_ignore_set_pollset_or_pollset_set(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_polling_entity *pollent);
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_polling_entity* pollent);
 /* Call the next operation in a call stack */
-void grpc_call_next_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                       grpc_transport_stream_op_batch *op);
+void grpc_call_next_op(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                       grpc_transport_stream_op_batch* op);
 /* Call the next operation (depending on call directionality) in a channel
    stack */
-void grpc_channel_next_op(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                          grpc_transport_op *op);
+void grpc_channel_next_op(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                          grpc_transport_op* op);
 /* Pass through a request to get_channel_info() to the next child element */
-void grpc_channel_next_get_info(grpc_exec_ctx *exec_ctx,
-                                grpc_channel_element *elem,
-                                const grpc_channel_info *channel_info);
+void grpc_channel_next_get_info(grpc_exec_ctx* exec_ctx,
+                                grpc_channel_element* elem,
+                                const grpc_channel_info* channel_info);
 
 /* Given the top element of a channel stack, get the channel stack itself */
-grpc_channel_stack *grpc_channel_stack_from_top_element(
-    grpc_channel_element *elem);
+grpc_channel_stack* grpc_channel_stack_from_top_element(
+    grpc_channel_element* elem);
 /* Given the top element of a call stack, get the call stack itself */
-grpc_call_stack *grpc_call_stack_from_top_element(grpc_call_element *elem);
+grpc_call_stack* grpc_call_stack_from_top_element(grpc_call_element* elem);
 
-void grpc_call_log_op(const char *file, int line, gpr_log_severity severity,
-                      grpc_call_element *elem,
-                      grpc_transport_stream_op_batch *op);
+void grpc_call_log_op(const char* file, int line, gpr_log_severity severity,
+                      grpc_call_element* elem,
+                      grpc_transport_stream_op_batch* op);
 
 extern grpc_core::TraceFlag grpc_trace_channel;
 
diff --git a/src/core/lib/channel/channel_stack_builder.cc b/src/core/lib/channel/channel_stack_builder.cc
index f01650b..5cd274d 100644
--- a/src/core/lib/channel/channel_stack_builder.cc
+++ b/src/core/lib/channel/channel_stack_builder.cc
@@ -27,11 +27,11 @@
                                                    "channel_stack_builder");
 
 typedef struct filter_node {
-  struct filter_node *next;
-  struct filter_node *prev;
-  const grpc_channel_filter *filter;
+  struct filter_node* next;
+  struct filter_node* prev;
+  const grpc_channel_filter* filter;
   grpc_post_filter_create_init_func init;
-  void *init_arg;
+  void* init_arg;
 } filter_node;
 
 struct grpc_channel_stack_builder {
@@ -39,20 +39,20 @@
   filter_node begin;
   filter_node end;
   // various set/get-able parameters
-  grpc_channel_args *args;
-  grpc_transport *transport;
-  char *target;
-  const char *name;
+  grpc_channel_args* args;
+  grpc_transport* transport;
+  char* target;
+  const char* name;
 };
 
 struct grpc_channel_stack_builder_iterator {
-  grpc_channel_stack_builder *builder;
-  filter_node *node;
+  grpc_channel_stack_builder* builder;
+  filter_node* node;
 };
 
-grpc_channel_stack_builder *grpc_channel_stack_builder_create(void) {
-  grpc_channel_stack_builder *b =
-      (grpc_channel_stack_builder *)gpr_zalloc(sizeof(*b));
+grpc_channel_stack_builder* grpc_channel_stack_builder_create(void) {
+  grpc_channel_stack_builder* b =
+      (grpc_channel_stack_builder*)gpr_zalloc(sizeof(*b));
 
   b->begin.filter = NULL;
   b->end.filter = NULL;
@@ -64,76 +64,76 @@
   return b;
 }
 
-void grpc_channel_stack_builder_set_target(grpc_channel_stack_builder *b,
-                                           const char *target) {
+void grpc_channel_stack_builder_set_target(grpc_channel_stack_builder* b,
+                                           const char* target) {
   gpr_free(b->target);
   b->target = gpr_strdup(target);
 }
 
-const char *grpc_channel_stack_builder_get_target(
-    grpc_channel_stack_builder *b) {
+const char* grpc_channel_stack_builder_get_target(
+    grpc_channel_stack_builder* b) {
   return b->target;
 }
 
-static grpc_channel_stack_builder_iterator *create_iterator_at_filter_node(
-    grpc_channel_stack_builder *builder, filter_node *node) {
-  grpc_channel_stack_builder_iterator *it =
-      (grpc_channel_stack_builder_iterator *)gpr_malloc(sizeof(*it));
+static grpc_channel_stack_builder_iterator* create_iterator_at_filter_node(
+    grpc_channel_stack_builder* builder, filter_node* node) {
+  grpc_channel_stack_builder_iterator* it =
+      (grpc_channel_stack_builder_iterator*)gpr_malloc(sizeof(*it));
   it->builder = builder;
   it->node = node;
   return it;
 }
 
 void grpc_channel_stack_builder_iterator_destroy(
-    grpc_channel_stack_builder_iterator *it) {
+    grpc_channel_stack_builder_iterator* it) {
   gpr_free(it);
 }
 
-grpc_channel_stack_builder_iterator *
+grpc_channel_stack_builder_iterator*
 grpc_channel_stack_builder_create_iterator_at_first(
-    grpc_channel_stack_builder *builder) {
+    grpc_channel_stack_builder* builder) {
   return create_iterator_at_filter_node(builder, &builder->begin);
 }
 
-grpc_channel_stack_builder_iterator *
+grpc_channel_stack_builder_iterator*
 grpc_channel_stack_builder_create_iterator_at_last(
-    grpc_channel_stack_builder *builder) {
+    grpc_channel_stack_builder* builder) {
   return create_iterator_at_filter_node(builder, &builder->end);
 }
 
 bool grpc_channel_stack_builder_iterator_is_end(
-    grpc_channel_stack_builder_iterator *iterator) {
+    grpc_channel_stack_builder_iterator* iterator) {
   return iterator->node == &iterator->builder->end;
 }
 
-const char *grpc_channel_stack_builder_iterator_filter_name(
-    grpc_channel_stack_builder_iterator *iterator) {
+const char* grpc_channel_stack_builder_iterator_filter_name(
+    grpc_channel_stack_builder_iterator* iterator) {
   if (iterator->node->filter == NULL) return NULL;
   return iterator->node->filter->name;
 }
 
 bool grpc_channel_stack_builder_move_next(
-    grpc_channel_stack_builder_iterator *iterator) {
+    grpc_channel_stack_builder_iterator* iterator) {
   if (iterator->node == &iterator->builder->end) return false;
   iterator->node = iterator->node->next;
   return true;
 }
 
 bool grpc_channel_stack_builder_move_prev(
-    grpc_channel_stack_builder_iterator *iterator) {
+    grpc_channel_stack_builder_iterator* iterator) {
   if (iterator->node == &iterator->builder->begin) return false;
   iterator->node = iterator->node->prev;
   return true;
 }
 
-grpc_channel_stack_builder_iterator *grpc_channel_stack_builder_iterator_find(
-    grpc_channel_stack_builder *builder, const char *filter_name) {
+grpc_channel_stack_builder_iterator* grpc_channel_stack_builder_iterator_find(
+    grpc_channel_stack_builder* builder, const char* filter_name) {
   GPR_ASSERT(filter_name != NULL);
-  grpc_channel_stack_builder_iterator *it =
+  grpc_channel_stack_builder_iterator* it =
       grpc_channel_stack_builder_create_iterator_at_first(builder);
   while (grpc_channel_stack_builder_move_next(it)) {
     if (grpc_channel_stack_builder_iterator_is_end(it)) break;
-    const char *filter_name_at_it =
+    const char* filter_name_at_it =
         grpc_channel_stack_builder_iterator_filter_name(it);
     if (strcmp(filter_name, filter_name_at_it) == 0) break;
   }
@@ -141,17 +141,17 @@
 }
 
 bool grpc_channel_stack_builder_move_prev(
-    grpc_channel_stack_builder_iterator *iterator);
+    grpc_channel_stack_builder_iterator* iterator);
 
-void grpc_channel_stack_builder_set_name(grpc_channel_stack_builder *builder,
-                                         const char *name) {
+void grpc_channel_stack_builder_set_name(grpc_channel_stack_builder* builder,
+                                         const char* name) {
   GPR_ASSERT(builder->name == NULL);
   builder->name = name;
 }
 
 void grpc_channel_stack_builder_set_channel_arguments(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder,
-    const grpc_channel_args *args) {
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder,
+    const grpc_channel_args* args) {
   if (builder->args != NULL) {
     grpc_channel_args_destroy(exec_ctx, builder->args);
   }
@@ -159,25 +159,25 @@
 }
 
 void grpc_channel_stack_builder_set_transport(
-    grpc_channel_stack_builder *builder, grpc_transport *transport) {
+    grpc_channel_stack_builder* builder, grpc_transport* transport) {
   GPR_ASSERT(builder->transport == NULL);
   builder->transport = transport;
 }
 
-grpc_transport *grpc_channel_stack_builder_get_transport(
-    grpc_channel_stack_builder *builder) {
+grpc_transport* grpc_channel_stack_builder_get_transport(
+    grpc_channel_stack_builder* builder) {
   return builder->transport;
 }
 
-const grpc_channel_args *grpc_channel_stack_builder_get_channel_arguments(
-    grpc_channel_stack_builder *builder) {
+const grpc_channel_args* grpc_channel_stack_builder_get_channel_arguments(
+    grpc_channel_stack_builder* builder) {
   return builder->args;
 }
 
 bool grpc_channel_stack_builder_append_filter(
-    grpc_channel_stack_builder *builder, const grpc_channel_filter *filter,
-    grpc_post_filter_create_init_func post_init_func, void *user_data) {
-  grpc_channel_stack_builder_iterator *it =
+    grpc_channel_stack_builder* builder, const grpc_channel_filter* filter,
+    grpc_post_filter_create_init_func post_init_func, void* user_data) {
+  grpc_channel_stack_builder_iterator* it =
       grpc_channel_stack_builder_create_iterator_at_last(builder);
   bool ok = grpc_channel_stack_builder_add_filter_before(
       it, filter, post_init_func, user_data);
@@ -186,8 +186,8 @@
 }
 
 bool grpc_channel_stack_builder_remove_filter(
-    grpc_channel_stack_builder *builder, const char *filter_name) {
-  grpc_channel_stack_builder_iterator *it =
+    grpc_channel_stack_builder* builder, const char* filter_name) {
+  grpc_channel_stack_builder_iterator* it =
       grpc_channel_stack_builder_iterator_find(builder, filter_name);
   if (grpc_channel_stack_builder_iterator_is_end(it)) {
     grpc_channel_stack_builder_iterator_destroy(it);
@@ -201,9 +201,9 @@
 }
 
 bool grpc_channel_stack_builder_prepend_filter(
-    grpc_channel_stack_builder *builder, const grpc_channel_filter *filter,
-    grpc_post_filter_create_init_func post_init_func, void *user_data) {
-  grpc_channel_stack_builder_iterator *it =
+    grpc_channel_stack_builder* builder, const grpc_channel_filter* filter,
+    grpc_post_filter_create_init_func post_init_func, void* user_data) {
+  grpc_channel_stack_builder_iterator* it =
       grpc_channel_stack_builder_create_iterator_at_first(builder);
   bool ok = grpc_channel_stack_builder_add_filter_after(
       it, filter, post_init_func, user_data);
@@ -211,10 +211,10 @@
   return ok;
 }
 
-static void add_after(filter_node *before, const grpc_channel_filter *filter,
+static void add_after(filter_node* before, const grpc_channel_filter* filter,
                       grpc_post_filter_create_init_func post_init_func,
-                      void *user_data) {
-  filter_node *new_node = (filter_node *)gpr_malloc(sizeof(*new_node));
+                      void* user_data) {
+  filter_node* new_node = (filter_node*)gpr_malloc(sizeof(*new_node));
   new_node->next = before->next;
   new_node->prev = before;
   new_node->next->prev = new_node->prev->next = new_node;
@@ -224,28 +224,28 @@
 }
 
 bool grpc_channel_stack_builder_add_filter_before(
-    grpc_channel_stack_builder_iterator *iterator,
-    const grpc_channel_filter *filter,
-    grpc_post_filter_create_init_func post_init_func, void *user_data) {
+    grpc_channel_stack_builder_iterator* iterator,
+    const grpc_channel_filter* filter,
+    grpc_post_filter_create_init_func post_init_func, void* user_data) {
   if (iterator->node == &iterator->builder->begin) return false;
   add_after(iterator->node->prev, filter, post_init_func, user_data);
   return true;
 }
 
 bool grpc_channel_stack_builder_add_filter_after(
-    grpc_channel_stack_builder_iterator *iterator,
-    const grpc_channel_filter *filter,
-    grpc_post_filter_create_init_func post_init_func, void *user_data) {
+    grpc_channel_stack_builder_iterator* iterator,
+    const grpc_channel_filter* filter,
+    grpc_post_filter_create_init_func post_init_func, void* user_data) {
   if (iterator->node == &iterator->builder->end) return false;
   add_after(iterator->node, filter, post_init_func, user_data);
   return true;
 }
 
-void grpc_channel_stack_builder_destroy(grpc_exec_ctx *exec_ctx,
-                                        grpc_channel_stack_builder *builder) {
-  filter_node *p = builder->begin.next;
+void grpc_channel_stack_builder_destroy(grpc_exec_ctx* exec_ctx,
+                                        grpc_channel_stack_builder* builder) {
+  filter_node* p = builder->begin.next;
   while (p != &builder->end) {
-    filter_node *next = p->next;
+    filter_node* next = p->next;
     gpr_free(p);
     p = next;
   }
@@ -256,21 +256,21 @@
   gpr_free(builder);
 }
 
-grpc_error *grpc_channel_stack_builder_finish(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder,
+grpc_error* grpc_channel_stack_builder_finish(
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder,
     size_t prefix_bytes, int initial_refs, grpc_iomgr_cb_func destroy,
-    void *destroy_arg, void **result) {
+    void* destroy_arg, void** result) {
   // count the number of filters
   size_t num_filters = 0;
-  for (filter_node *p = builder->begin.next; p != &builder->end; p = p->next) {
+  for (filter_node* p = builder->begin.next; p != &builder->end; p = p->next) {
     num_filters++;
   }
 
   // create an array of filters
-  const grpc_channel_filter **filters =
-      (const grpc_channel_filter **)gpr_malloc(sizeof(*filters) * num_filters);
+  const grpc_channel_filter** filters =
+      (const grpc_channel_filter**)gpr_malloc(sizeof(*filters) * num_filters);
   size_t i = 0;
-  for (filter_node *p = builder->begin.next; p != &builder->end; p = p->next) {
+  for (filter_node* p = builder->begin.next; p != &builder->end; p = p->next) {
     filters[i++] = p->filter;
   }
 
@@ -280,10 +280,10 @@
   // allocate memory, with prefix_bytes followed by channel_stack_size
   *result = gpr_zalloc(prefix_bytes + channel_stack_size);
   // fetch a pointer to the channel stack
-  grpc_channel_stack *channel_stack =
-      (grpc_channel_stack *)((char *)(*result) + prefix_bytes);
+  grpc_channel_stack* channel_stack =
+      (grpc_channel_stack*)((char*)(*result) + prefix_bytes);
   // and initialize it
-  grpc_error *error = grpc_channel_stack_init(
+  grpc_error* error = grpc_channel_stack_init(
       exec_ctx, initial_refs, destroy,
       destroy_arg == NULL ? *result : destroy_arg, filters, num_filters,
       builder->args, builder->transport, builder->name, channel_stack);
@@ -295,7 +295,7 @@
   } else {
     // run post-initialization functions
     i = 0;
-    for (filter_node *p = builder->begin.next; p != &builder->end;
+    for (filter_node* p = builder->begin.next; p != &builder->end;
          p = p->next) {
       if (p->init != NULL) {
         p->init(channel_stack, grpc_channel_stack_element(channel_stack, i),
@@ -306,7 +306,7 @@
   }
 
   grpc_channel_stack_builder_destroy(exec_ctx, builder);
-  gpr_free((grpc_channel_filter **)filters);
+  gpr_free((grpc_channel_filter**)filters);
 
   return error;
 }
diff --git a/src/core/lib/channel/channel_stack_builder.h b/src/core/lib/channel/channel_stack_builder.h
index 981be90..8e3ec2e 100644
--- a/src/core/lib/channel/channel_stack_builder.h
+++ b/src/core/lib/channel/channel_stack_builder.h
@@ -35,130 +35,130 @@
     grpc_channel_stack_builder_iterator;
 
 /// Create a new channel stack builder
-grpc_channel_stack_builder *grpc_channel_stack_builder_create(void);
+grpc_channel_stack_builder* grpc_channel_stack_builder_create(void);
 
 /// Assign a name to the channel stack: \a name must be statically allocated
-void grpc_channel_stack_builder_set_name(grpc_channel_stack_builder *builder,
-                                         const char *name);
+void grpc_channel_stack_builder_set_name(grpc_channel_stack_builder* builder,
+                                         const char* name);
 
 /// Set the target uri
-void grpc_channel_stack_builder_set_target(grpc_channel_stack_builder *b,
-                                           const char *target);
+void grpc_channel_stack_builder_set_target(grpc_channel_stack_builder* b,
+                                           const char* target);
 
-const char *grpc_channel_stack_builder_get_target(
-    grpc_channel_stack_builder *b);
+const char* grpc_channel_stack_builder_get_target(
+    grpc_channel_stack_builder* b);
 
 /// Attach \a transport to the builder (does not take ownership)
 void grpc_channel_stack_builder_set_transport(
-    grpc_channel_stack_builder *builder, grpc_transport *transport);
+    grpc_channel_stack_builder* builder, grpc_transport* transport);
 
 /// Fetch attached transport
-grpc_transport *grpc_channel_stack_builder_get_transport(
-    grpc_channel_stack_builder *builder);
+grpc_transport* grpc_channel_stack_builder_get_transport(
+    grpc_channel_stack_builder* builder);
 
 /// Set channel arguments: copies args
 void grpc_channel_stack_builder_set_channel_arguments(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder,
-    const grpc_channel_args *args);
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder,
+    const grpc_channel_args* args);
 
 /// Return a borrowed pointer to the channel arguments
-const grpc_channel_args *grpc_channel_stack_builder_get_channel_arguments(
-    grpc_channel_stack_builder *builder);
+const grpc_channel_args* grpc_channel_stack_builder_get_channel_arguments(
+    grpc_channel_stack_builder* builder);
 
 /// Begin iterating over already defined filters in the builder at the beginning
-grpc_channel_stack_builder_iterator *
+grpc_channel_stack_builder_iterator*
 grpc_channel_stack_builder_create_iterator_at_first(
-    grpc_channel_stack_builder *builder);
+    grpc_channel_stack_builder* builder);
 
 /// Begin iterating over already defined filters in the builder at the end
-grpc_channel_stack_builder_iterator *
+grpc_channel_stack_builder_iterator*
 grpc_channel_stack_builder_create_iterator_at_last(
-    grpc_channel_stack_builder *builder);
+    grpc_channel_stack_builder* builder);
 
 /// Is an iterator at the first element?
 bool grpc_channel_stack_builder_iterator_is_first(
-    grpc_channel_stack_builder_iterator *iterator);
+    grpc_channel_stack_builder_iterator* iterator);
 
 /// Is an iterator at the end?
 bool grpc_channel_stack_builder_iterator_is_end(
-    grpc_channel_stack_builder_iterator *iterator);
+    grpc_channel_stack_builder_iterator* iterator);
 
 /// What is the name of the filter at this iterator position?
-const char *grpc_channel_stack_builder_iterator_filter_name(
-    grpc_channel_stack_builder_iterator *iterator);
+const char* grpc_channel_stack_builder_iterator_filter_name(
+    grpc_channel_stack_builder_iterator* iterator);
 
 /// Move an iterator to the next item
 bool grpc_channel_stack_builder_move_next(
-    grpc_channel_stack_builder_iterator *iterator);
+    grpc_channel_stack_builder_iterator* iterator);
 
 /// Move an iterator to the previous item
 bool grpc_channel_stack_builder_move_prev(
-    grpc_channel_stack_builder_iterator *iterator);
+    grpc_channel_stack_builder_iterator* iterator);
 
 /// Return an iterator at \a filter_name, or at the end of the list if not
 /// found.
-grpc_channel_stack_builder_iterator *grpc_channel_stack_builder_iterator_find(
-    grpc_channel_stack_builder *builder, const char *filter_name);
+grpc_channel_stack_builder_iterator* grpc_channel_stack_builder_iterator_find(
+    grpc_channel_stack_builder* builder, const char* filter_name);
 
 typedef void (*grpc_post_filter_create_init_func)(
-    grpc_channel_stack *channel_stack, grpc_channel_element *elem, void *arg);
+    grpc_channel_stack* channel_stack, grpc_channel_element* elem, void* arg);
 
 /// Add \a filter to the stack, after \a iterator.
 /// Call \a post_init_func(..., \a user_data) once the channel stack is
 /// created.
 bool grpc_channel_stack_builder_add_filter_after(
-    grpc_channel_stack_builder_iterator *iterator,
-    const grpc_channel_filter *filter,
+    grpc_channel_stack_builder_iterator* iterator,
+    const grpc_channel_filter* filter,
     grpc_post_filter_create_init_func post_init_func,
-    void *user_data) GRPC_MUST_USE_RESULT;
+    void* user_data) GRPC_MUST_USE_RESULT;
 
 /// Add \a filter to the stack, before \a iterator.
 /// Call \a post_init_func(..., \a user_data) once the channel stack is
 /// created.
 bool grpc_channel_stack_builder_add_filter_before(
-    grpc_channel_stack_builder_iterator *iterator,
-    const grpc_channel_filter *filter,
+    grpc_channel_stack_builder_iterator* iterator,
+    const grpc_channel_filter* filter,
     grpc_post_filter_create_init_func post_init_func,
-    void *user_data) GRPC_MUST_USE_RESULT;
+    void* user_data) GRPC_MUST_USE_RESULT;
 
 /// Add \a filter to the beginning of the filter list.
 /// Call \a post_init_func(..., \a user_data) once the channel stack is
 /// created.
 bool grpc_channel_stack_builder_prepend_filter(
-    grpc_channel_stack_builder *builder, const grpc_channel_filter *filter,
+    grpc_channel_stack_builder* builder, const grpc_channel_filter* filter,
     grpc_post_filter_create_init_func post_init_func,
-    void *user_data) GRPC_MUST_USE_RESULT;
+    void* user_data) GRPC_MUST_USE_RESULT;
 
 /// Add \a filter to the end of the filter list.
 /// Call \a post_init_func(..., \a user_data) once the channel stack is
 /// created.
 bool grpc_channel_stack_builder_append_filter(
-    grpc_channel_stack_builder *builder, const grpc_channel_filter *filter,
+    grpc_channel_stack_builder* builder, const grpc_channel_filter* filter,
     grpc_post_filter_create_init_func post_init_func,
-    void *user_data) GRPC_MUST_USE_RESULT;
+    void* user_data) GRPC_MUST_USE_RESULT;
 
 /// Remove any filter whose name is \a filter_name from \a builder. Returns true
 /// if \a filter_name was not found.
 bool grpc_channel_stack_builder_remove_filter(
-    grpc_channel_stack_builder *builder, const char *filter_name);
+    grpc_channel_stack_builder* builder, const char* filter_name);
 
 /// Terminate iteration and destroy \a iterator
 void grpc_channel_stack_builder_iterator_destroy(
-    grpc_channel_stack_builder_iterator *iterator);
+    grpc_channel_stack_builder_iterator* iterator);
 
 /// Destroy the builder, return the freshly minted channel stack in \a result.
 /// Allocates \a prefix_bytes bytes before the channel stack
 /// Returns the base pointer of the allocated block
 /// \a initial_refs, \a destroy, \a destroy_arg are as per
 /// grpc_channel_stack_init
-grpc_error *grpc_channel_stack_builder_finish(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder,
+grpc_error* grpc_channel_stack_builder_finish(
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder,
     size_t prefix_bytes, int initial_refs, grpc_iomgr_cb_func destroy,
-    void *destroy_arg, void **result);
+    void* destroy_arg, void** result);
 
 /// Destroy the builder without creating a channel stack
-void grpc_channel_stack_builder_destroy(grpc_exec_ctx *exec_ctx,
-                                        grpc_channel_stack_builder *builder);
+void grpc_channel_stack_builder_destroy(grpc_exec_ctx* exec_ctx,
+                                        grpc_channel_stack_builder* builder);
 
 extern grpc_core::TraceFlag grpc_trace_channel_stack_builder;
 
diff --git a/src/core/lib/channel/connected_channel.cc b/src/core/lib/channel/connected_channel.cc
index 4f37908..49b9f14 100644
--- a/src/core/lib/channel/connected_channel.cc
+++ b/src/core/lib/channel/connected_channel.cc
@@ -33,41 +33,41 @@
 #define MAX_BUFFER_LENGTH 8192
 
 typedef struct connected_channel_channel_data {
-  grpc_transport *transport;
+  grpc_transport* transport;
 } channel_data;
 
 typedef struct {
   grpc_closure closure;
-  grpc_closure *original_closure;
-  grpc_call_combiner *call_combiner;
-  const char *reason;
+  grpc_closure* original_closure;
+  grpc_call_combiner* call_combiner;
+  const char* reason;
 } callback_state;
 
 typedef struct connected_channel_call_data {
-  grpc_call_combiner *call_combiner;
+  grpc_call_combiner* call_combiner;
   // Closures used for returning results on the call combiner.
   callback_state on_complete[6];  // Max number of pending batches.
   callback_state recv_initial_metadata_ready;
   callback_state recv_message_ready;
 } call_data;
 
-static void run_in_call_combiner(grpc_exec_ctx *exec_ctx, void *arg,
-                                 grpc_error *error) {
-  callback_state *state = (callback_state *)arg;
+static void run_in_call_combiner(grpc_exec_ctx* exec_ctx, void* arg,
+                                 grpc_error* error) {
+  callback_state* state = (callback_state*)arg;
   GRPC_CALL_COMBINER_START(exec_ctx, state->call_combiner,
                            state->original_closure, GRPC_ERROR_REF(error),
                            state->reason);
 }
 
-static void run_cancel_in_call_combiner(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error) {
+static void run_cancel_in_call_combiner(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error) {
   run_in_call_combiner(exec_ctx, arg, error);
   gpr_free(arg);
 }
 
-static void intercept_callback(call_data *calld, callback_state *state,
-                               bool free_when_done, const char *reason,
-                               grpc_closure **original_closure) {
+static void intercept_callback(call_data* calld, callback_state* state,
+                               bool free_when_done, const char* reason,
+                               grpc_closure** original_closure) {
   state->original_closure = *original_closure;
   state->call_combiner = calld->call_combiner;
   state->reason = reason;
@@ -77,8 +77,8 @@
       state, grpc_schedule_on_exec_ctx);
 }
 
-static callback_state *get_state_for_batch(
-    call_data *calld, grpc_transport_stream_op_batch *batch) {
+static callback_state* get_state_for_batch(
+    call_data* calld, grpc_transport_stream_op_batch* batch) {
   if (batch->send_initial_metadata) return &calld->on_complete[0];
   if (batch->send_message) return &calld->on_complete[1];
   if (batch->send_trailing_metadata) return &calld->on_complete[2];
@@ -91,25 +91,25 @@
 /* We perform a small hack to locate transport data alongside the connected
    channel data in call allocations, to allow everything to be pulled in minimal
    cache line requests */
-#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) ((grpc_stream *)((calld) + 1))
+#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) ((grpc_stream*)((calld) + 1))
 #define CALL_DATA_FROM_TRANSPORT_STREAM(transport_stream) \
-  (((call_data *)(transport_stream)) - 1)
+  (((call_data*)(transport_stream)) - 1)
 
 /* Intercept a call operation and either push it directly up or translate it
    into transport stream operations */
 static void con_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *batch) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* batch) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   if (batch->recv_initial_metadata) {
-    callback_state *state = &calld->recv_initial_metadata_ready;
+    callback_state* state = &calld->recv_initial_metadata_ready;
     intercept_callback(
         calld, state, false, "recv_initial_metadata_ready",
         &batch->payload->recv_initial_metadata.recv_initial_metadata_ready);
   }
   if (batch->recv_message) {
-    callback_state *state = &calld->recv_message_ready;
+    callback_state* state = &calld->recv_message_ready;
     intercept_callback(calld, state, false, "recv_message_ready",
                        &batch->payload->recv_message.recv_message_ready);
   }
@@ -119,11 +119,11 @@
     // calld->on_complete like we can for the other ops.  However,
     // cancellation isn't in the fast path, so we just allocate a new
     // closure for each one.
-    callback_state *state = (callback_state *)gpr_malloc(sizeof(*state));
+    callback_state* state = (callback_state*)gpr_malloc(sizeof(*state));
     intercept_callback(calld, state, true, "on_complete (cancel_stream)",
                        &batch->on_complete);
   } else {
-    callback_state *state = get_state_for_batch(calld, batch);
+    callback_state* state = get_state_for_batch(calld, batch);
     intercept_callback(calld, state, false, "on_complete", &batch->on_complete);
   }
   grpc_transport_perform_stream_op(exec_ctx, chand->transport,
@@ -133,19 +133,19 @@
                           "passed batch to transport");
 }
 
-static void con_start_transport_op(grpc_exec_ctx *exec_ctx,
-                                   grpc_channel_element *elem,
-                                   grpc_transport_op *op) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void con_start_transport_op(grpc_exec_ctx* exec_ctx,
+                                   grpc_channel_element* elem,
+                                   grpc_transport_op* op) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   grpc_transport_perform_op(exec_ctx, chand->transport, op);
 }
 
 /* Constructor for call_data */
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   calld->call_combiner = args->call_combiner;
   int r = grpc_transport_init_stream(
       exec_ctx, chand->transport, TRANSPORT_STREAM_FROM_CALL_DATA(calld),
@@ -155,49 +155,49 @@
                       "transport stream initialization failed");
 }
 
-static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
-                                       grpc_call_element *elem,
-                                       grpc_polling_entity *pollent) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void set_pollset_or_pollset_set(grpc_exec_ctx* exec_ctx,
+                                       grpc_call_element* elem,
+                                       grpc_polling_entity* pollent) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   grpc_transport_set_pops(exec_ctx, chand->transport,
                           TRANSPORT_STREAM_FROM_CALL_DATA(calld), pollent);
 }
 
 /* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *then_schedule_closure) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* then_schedule_closure) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   grpc_transport_destroy_stream(exec_ctx, chand->transport,
                                 TRANSPORT_STREAM_FROM_CALL_DATA(calld),
                                 then_schedule_closure);
 }
 
 /* Constructor for channel_data */
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  channel_data *cd = (channel_data *)elem->channel_data;
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  channel_data* cd = (channel_data*)elem->channel_data;
   GPR_ASSERT(args->is_last);
   cd->transport = NULL;
   return GRPC_ERROR_NONE;
 }
 
 /* Destructor for channel_data */
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {
-  channel_data *cd = (channel_data *)elem->channel_data;
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {
+  channel_data* cd = (channel_data*)elem->channel_data;
   if (cd->transport) {
     grpc_transport_destroy(exec_ctx, cd->transport);
   }
 }
 
 /* No-op. */
-static void con_get_channel_info(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem,
-                                 const grpc_channel_info *channel_info) {}
+static void con_get_channel_info(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem,
+                                 const grpc_channel_info* channel_info) {}
 
 const grpc_channel_filter grpc_connected_filter = {
     con_start_transport_stream_op_batch,
@@ -213,12 +213,12 @@
     "connected",
 };
 
-static void bind_transport(grpc_channel_stack *channel_stack,
-                           grpc_channel_element *elem, void *t) {
-  channel_data *cd = (channel_data *)elem->channel_data;
+static void bind_transport(grpc_channel_stack* channel_stack,
+                           grpc_channel_element* elem, void* t) {
+  channel_data* cd = (channel_data*)elem->channel_data;
   GPR_ASSERT(elem->filter == &grpc_connected_filter);
   GPR_ASSERT(cd->transport == NULL);
-  cd->transport = (grpc_transport *)t;
+  cd->transport = (grpc_transport*)t;
 
   /* HACK(ctiller): increase call stack size for the channel to make space
      for channel data. We need a cleaner (but performant) way to do this,
@@ -227,20 +227,20 @@
      the last call element, and the last call element MUST be the connected
      channel. */
   channel_stack->call_stack_size +=
-      grpc_transport_stream_size((grpc_transport *)t);
+      grpc_transport_stream_size((grpc_transport*)t);
 }
 
-bool grpc_add_connected_filter(grpc_exec_ctx *exec_ctx,
-                               grpc_channel_stack_builder *builder,
-                               void *arg_must_be_null) {
+bool grpc_add_connected_filter(grpc_exec_ctx* exec_ctx,
+                               grpc_channel_stack_builder* builder,
+                               void* arg_must_be_null) {
   GPR_ASSERT(arg_must_be_null == NULL);
-  grpc_transport *t = grpc_channel_stack_builder_get_transport(builder);
+  grpc_transport* t = grpc_channel_stack_builder_get_transport(builder);
   GPR_ASSERT(t != NULL);
   return grpc_channel_stack_builder_append_filter(
       builder, &grpc_connected_filter, bind_transport, t);
 }
 
-grpc_stream *grpc_connected_channel_get_stream(grpc_call_element *elem) {
-  call_data *calld = (call_data *)elem->call_data;
+grpc_stream* grpc_connected_channel_get_stream(grpc_call_element* elem) {
+  call_data* calld = (call_data*)elem->call_data;
   return TRANSPORT_STREAM_FROM_CALL_DATA(calld);
 }
diff --git a/src/core/lib/channel/connected_channel.h b/src/core/lib/channel/connected_channel.h
index 4615727..cca1973 100644
--- a/src/core/lib/channel/connected_channel.h
+++ b/src/core/lib/channel/connected_channel.h
@@ -27,12 +27,12 @@
 
 extern const grpc_channel_filter grpc_connected_filter;
 
-bool grpc_add_connected_filter(grpc_exec_ctx *exec_ctx,
-                               grpc_channel_stack_builder *builder,
-                               void *arg_must_be_null);
+bool grpc_add_connected_filter(grpc_exec_ctx* exec_ctx,
+                               grpc_channel_stack_builder* builder,
+                               void* arg_must_be_null);
 
 /* Debug helper to dig the transport stream out of a call element */
-grpc_stream *grpc_connected_channel_get_stream(grpc_call_element *elem);
+grpc_stream* grpc_connected_channel_get_stream(grpc_call_element* elem);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/channel/context.h b/src/core/lib/channel/context.h
index 191bd63..5daf48a 100644
--- a/src/core/lib/channel/context.h
+++ b/src/core/lib/channel/context.h
@@ -42,8 +42,8 @@
 } grpc_context_index;
 
 typedef struct {
-  void *value;
-  void (*destroy)(void *);
+  void* value;
+  void (*destroy)(void*);
 } grpc_call_context_element;
 
 #endif /* GRPC_CORE_LIB_CHANNEL_CONTEXT_H */
diff --git a/src/core/lib/channel/handshaker_factory.cc b/src/core/lib/channel/handshaker_factory.cc
index 4deb280..bf1188d 100644
--- a/src/core/lib/channel/handshaker_factory.cc
+++ b/src/core/lib/channel/handshaker_factory.cc
@@ -21,8 +21,8 @@
 #include <grpc/support/log.h>
 
 void grpc_handshaker_factory_add_handshakers(
-    grpc_exec_ctx *exec_ctx, grpc_handshaker_factory *handshaker_factory,
-    const grpc_channel_args *args, grpc_handshake_manager *handshake_mgr) {
+    grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* handshaker_factory,
+    const grpc_channel_args* args, grpc_handshake_manager* handshake_mgr) {
   if (handshaker_factory != NULL) {
     GPR_ASSERT(handshaker_factory->vtable != NULL);
     handshaker_factory->vtable->add_handshakers(exec_ctx, handshaker_factory,
@@ -31,7 +31,7 @@
 }
 
 void grpc_handshaker_factory_destroy(
-    grpc_exec_ctx *exec_ctx, grpc_handshaker_factory *handshaker_factory) {
+    grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* handshaker_factory) {
   if (handshaker_factory != NULL) {
     GPR_ASSERT(handshaker_factory->vtable != NULL);
     handshaker_factory->vtable->destroy(exec_ctx, handshaker_factory);
diff --git a/src/core/lib/channel/handshaker_factory.h b/src/core/lib/channel/handshaker_factory.h
index 59008ad..63d9b5a 100644
--- a/src/core/lib/channel/handshaker_factory.h
+++ b/src/core/lib/channel/handshaker_factory.h
@@ -33,24 +33,24 @@
 typedef struct grpc_handshaker_factory grpc_handshaker_factory;
 
 typedef struct {
-  void (*add_handshakers)(grpc_exec_ctx *exec_ctx,
-                          grpc_handshaker_factory *handshaker_factory,
-                          const grpc_channel_args *args,
-                          grpc_handshake_manager *handshake_mgr);
-  void (*destroy)(grpc_exec_ctx *exec_ctx,
-                  grpc_handshaker_factory *handshaker_factory);
+  void (*add_handshakers)(grpc_exec_ctx* exec_ctx,
+                          grpc_handshaker_factory* handshaker_factory,
+                          const grpc_channel_args* args,
+                          grpc_handshake_manager* handshake_mgr);
+  void (*destroy)(grpc_exec_ctx* exec_ctx,
+                  grpc_handshaker_factory* handshaker_factory);
 } grpc_handshaker_factory_vtable;
 
 struct grpc_handshaker_factory {
-  const grpc_handshaker_factory_vtable *vtable;
+  const grpc_handshaker_factory_vtable* vtable;
 };
 
 void grpc_handshaker_factory_add_handshakers(
-    grpc_exec_ctx *exec_ctx, grpc_handshaker_factory *handshaker_factory,
-    const grpc_channel_args *args, grpc_handshake_manager *handshake_mgr);
+    grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* handshaker_factory,
+    const grpc_channel_args* args, grpc_handshake_manager* handshake_mgr);
 
 void grpc_handshaker_factory_destroy(
-    grpc_exec_ctx *exec_ctx, grpc_handshaker_factory *handshaker_factory);
+    grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* handshaker_factory);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/compression/compression.cc b/src/core/lib/compression/compression.cc
index 1cfac23..a0d5bdc 100644
--- a/src/core/lib/compression/compression.cc
+++ b/src/core/lib/compression/compression.cc
@@ -27,7 +27,7 @@
 #include "src/core/lib/transport/static_metadata.h"
 
 int grpc_compression_algorithm_parse(grpc_slice name,
-                                     grpc_compression_algorithm *algorithm) {
+                                     grpc_compression_algorithm* algorithm) {
   /* we use strncmp not only because it's safer (even though in this case it
    * doesn't matter, given that we are comparing against string literals, but
    * because this way we needn't have "name" nil-terminated (useful for slice
@@ -47,7 +47,7 @@
 }
 
 int grpc_stream_compression_algorithm_parse(
-    grpc_slice name, grpc_stream_compression_algorithm *algorithm) {
+    grpc_slice name, grpc_stream_compression_algorithm* algorithm) {
   if (grpc_slice_eq(name, GRPC_MDSTR_IDENTITY)) {
     *algorithm = GRPC_STREAM_COMPRESS_NONE;
     return 1;
@@ -60,7 +60,7 @@
 }
 
 int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm,
-                                    const char **name) {
+                                    const char** name) {
   GRPC_API_TRACE("grpc_compression_algorithm_parse(algorithm=%d, name=%p)", 2,
                  ((int)algorithm, name));
   switch (algorithm) {
@@ -80,7 +80,7 @@
 }
 
 int grpc_stream_compression_algorithm_name(
-    grpc_stream_compression_algorithm algorithm, const char **name) {
+    grpc_stream_compression_algorithm algorithm, const char** name) {
   GRPC_API_TRACE(
       "grpc_stream_compression_algorithm_parse(algorithm=%d, name=%p)", 2,
       ((int)algorithm, name));
@@ -168,7 +168,7 @@
   return GRPC_MDNULL;
 }
 
-void grpc_compression_options_init(grpc_compression_options *opts) {
+void grpc_compression_options_init(grpc_compression_options* opts) {
   memset(opts, 0, sizeof(*opts));
   /* all enabled by default */
   opts->enabled_algorithms_bitset = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1;
@@ -177,23 +177,23 @@
 }
 
 void grpc_compression_options_enable_algorithm(
-    grpc_compression_options *opts, grpc_compression_algorithm algorithm) {
+    grpc_compression_options* opts, grpc_compression_algorithm algorithm) {
   GPR_BITSET(&opts->enabled_algorithms_bitset, algorithm);
 }
 
 void grpc_compression_options_disable_algorithm(
-    grpc_compression_options *opts, grpc_compression_algorithm algorithm) {
+    grpc_compression_options* opts, grpc_compression_algorithm algorithm) {
   GPR_BITCLEAR(&opts->enabled_algorithms_bitset, algorithm);
 }
 
 int grpc_compression_options_is_algorithm_enabled(
-    const grpc_compression_options *opts,
+    const grpc_compression_options* opts,
     grpc_compression_algorithm algorithm) {
   return GPR_BITGET(opts->enabled_algorithms_bitset, algorithm);
 }
 
 int grpc_compression_options_is_stream_compression_algorithm_enabled(
-    const grpc_compression_options *opts,
+    const grpc_compression_options* opts,
     grpc_stream_compression_algorithm algorithm) {
   return GPR_BITGET(opts->enabled_stream_compression_algorithms_bitset,
                     algorithm);
diff --git a/src/core/lib/compression/stream_compression.cc b/src/core/lib/compression/stream_compression.cc
index 7faeb0d..8a57b33 100644
--- a/src/core/lib/compression/stream_compression.cc
+++ b/src/core/lib/compression/stream_compression.cc
@@ -24,23 +24,23 @@
 extern "C" const grpc_stream_compression_vtable
     grpc_stream_compression_identity_vtable;
 
-bool grpc_stream_compress(grpc_stream_compression_context *ctx,
-                          grpc_slice_buffer *in, grpc_slice_buffer *out,
-                          size_t *output_size, size_t max_output_size,
+bool grpc_stream_compress(grpc_stream_compression_context* ctx,
+                          grpc_slice_buffer* in, grpc_slice_buffer* out,
+                          size_t* output_size, size_t max_output_size,
                           grpc_stream_compression_flush flush) {
   return ctx->vtable->compress(ctx, in, out, output_size, max_output_size,
                                flush);
 }
 
-bool grpc_stream_decompress(grpc_stream_compression_context *ctx,
-                            grpc_slice_buffer *in, grpc_slice_buffer *out,
-                            size_t *output_size, size_t max_output_size,
-                            bool *end_of_context) {
+bool grpc_stream_decompress(grpc_stream_compression_context* ctx,
+                            grpc_slice_buffer* in, grpc_slice_buffer* out,
+                            size_t* output_size, size_t max_output_size,
+                            bool* end_of_context) {
   return ctx->vtable->decompress(ctx, in, out, output_size, max_output_size,
                                  end_of_context);
 }
 
-grpc_stream_compression_context *grpc_stream_compression_context_create(
+grpc_stream_compression_context* grpc_stream_compression_context_create(
     grpc_stream_compression_method method) {
   switch (method) {
     case GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS:
@@ -56,13 +56,13 @@
 }
 
 void grpc_stream_compression_context_destroy(
-    grpc_stream_compression_context *ctx) {
+    grpc_stream_compression_context* ctx) {
   ctx->vtable->context_destroy(ctx);
 }
 
 int grpc_stream_compression_method_parse(
     grpc_slice value, bool is_compress,
-    grpc_stream_compression_method *method) {
+    grpc_stream_compression_method* method) {
   if (grpc_slice_eq(value, GRPC_MDSTR_IDENTITY)) {
     *method = is_compress ? GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS
                           : GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS;
diff --git a/src/core/lib/compression/stream_compression.h b/src/core/lib/compression/stream_compression.h
index 6ee3ac1..b56c142 100644
--- a/src/core/lib/compression/stream_compression.h
+++ b/src/core/lib/compression/stream_compression.h
@@ -34,7 +34,7 @@
 
 /* Stream compression/decompression context */
 typedef struct grpc_stream_compression_context {
-  const grpc_stream_compression_vtable *vtable;
+  const grpc_stream_compression_vtable* vtable;
 } grpc_stream_compression_context;
 
 typedef enum grpc_stream_compression_method {
@@ -53,16 +53,16 @@
 } grpc_stream_compression_flush;
 
 struct grpc_stream_compression_vtable {
-  bool (*compress)(grpc_stream_compression_context *ctx, grpc_slice_buffer *in,
-                   grpc_slice_buffer *out, size_t *output_size,
+  bool (*compress)(grpc_stream_compression_context* ctx, grpc_slice_buffer* in,
+                   grpc_slice_buffer* out, size_t* output_size,
                    size_t max_output_size, grpc_stream_compression_flush flush);
-  bool (*decompress)(grpc_stream_compression_context *ctx,
-                     grpc_slice_buffer *in, grpc_slice_buffer *out,
-                     size_t *output_size, size_t max_output_size,
-                     bool *end_of_context);
-  grpc_stream_compression_context *(*context_create)(
+  bool (*decompress)(grpc_stream_compression_context* ctx,
+                     grpc_slice_buffer* in, grpc_slice_buffer* out,
+                     size_t* output_size, size_t max_output_size,
+                     bool* end_of_context);
+  grpc_stream_compression_context* (*context_create)(
       grpc_stream_compression_method method);
-  void (*context_destroy)(grpc_stream_compression_context *ctx);
+  void (*context_destroy)(grpc_stream_compression_context* ctx);
 };
 
 /**
@@ -78,9 +78,9 @@
  * previous compressed bytes. It allows corresponding decompression context to
  * be dropped when reaching this boundary.
  */
-bool grpc_stream_compress(grpc_stream_compression_context *ctx,
-                          grpc_slice_buffer *in, grpc_slice_buffer *out,
-                          size_t *output_size, size_t max_output_size,
+bool grpc_stream_compress(grpc_stream_compression_context* ctx,
+                          grpc_slice_buffer* in, grpc_slice_buffer* out,
+                          size_t* output_size, size_t max_output_size,
                           grpc_stream_compression_flush flush);
 
 /**
@@ -90,30 +90,30 @@
  * it is set to false. The total number of bytes emitted is outputed in \a
  * output_size.
  */
-bool grpc_stream_decompress(grpc_stream_compression_context *ctx,
-                            grpc_slice_buffer *in, grpc_slice_buffer *out,
-                            size_t *output_size, size_t max_output_size,
-                            bool *end_of_context);
+bool grpc_stream_decompress(grpc_stream_compression_context* ctx,
+                            grpc_slice_buffer* in, grpc_slice_buffer* out,
+                            size_t* output_size, size_t max_output_size,
+                            bool* end_of_context);
 
 /**
  * Creates a stream compression context. \a pending_bytes_buffer is the input
  * buffer for compression/decompression operations. \a method specifies whether
  * the context is for compression or decompression.
  */
-grpc_stream_compression_context *grpc_stream_compression_context_create(
+grpc_stream_compression_context* grpc_stream_compression_context_create(
     grpc_stream_compression_method method);
 
 /**
  * Destroys a stream compression context.
  */
 void grpc_stream_compression_context_destroy(
-    grpc_stream_compression_context *ctx);
+    grpc_stream_compression_context* ctx);
 
 /**
  * Parse stream compression method based on algorithm name
  */
 int grpc_stream_compression_method_parse(
-    grpc_slice value, bool is_compress, grpc_stream_compression_method *method);
+    grpc_slice value, bool is_compress, grpc_stream_compression_method* method);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/compression/stream_compression_gzip.cc b/src/core/lib/compression/stream_compression_gzip.cc
index 087b018..53ec7ca 100644
--- a/src/core/lib/compression/stream_compression_gzip.cc
+++ b/src/core/lib/compression/stream_compression_gzip.cc
@@ -29,13 +29,13 @@
   grpc_stream_compression_context base;
 
   z_stream zs;
-  int (*flate)(z_stream *zs, int flush);
+  int (*flate)(z_stream* zs, int flush);
 } grpc_stream_compression_context_gzip;
 
-static bool gzip_flate(grpc_stream_compression_context_gzip *ctx,
-                       grpc_slice_buffer *in, grpc_slice_buffer *out,
-                       size_t *output_size, size_t max_output_size, int flush,
-                       bool *end_of_context) {
+static bool gzip_flate(grpc_stream_compression_context_gzip* ctx,
+                       grpc_slice_buffer* in, grpc_slice_buffer* out,
+                       size_t* output_size, size_t max_output_size, int flush,
+                       bool* end_of_context) {
   GPR_ASSERT(flush == 0 || flush == Z_SYNC_FLUSH || flush == Z_FINISH);
   /* Full flush is not allowed when inflating. */
   GPR_ASSERT(!(ctx->flate == inflate && (flush == Z_FINISH)));
@@ -131,17 +131,17 @@
   return true;
 }
 
-static bool grpc_stream_compress_gzip(grpc_stream_compression_context *ctx,
-                                      grpc_slice_buffer *in,
-                                      grpc_slice_buffer *out,
-                                      size_t *output_size,
+static bool grpc_stream_compress_gzip(grpc_stream_compression_context* ctx,
+                                      grpc_slice_buffer* in,
+                                      grpc_slice_buffer* out,
+                                      size_t* output_size,
                                       size_t max_output_size,
                                       grpc_stream_compression_flush flush) {
   if (ctx == NULL) {
     return false;
   }
-  grpc_stream_compression_context_gzip *gzip_ctx =
-      (grpc_stream_compression_context_gzip *)ctx;
+  grpc_stream_compression_context_gzip* gzip_ctx =
+      (grpc_stream_compression_context_gzip*)ctx;
   GPR_ASSERT(gzip_ctx->flate == deflate);
   int gzip_flush;
   switch (flush) {
@@ -161,29 +161,29 @@
                     NULL);
 }
 
-static bool grpc_stream_decompress_gzip(grpc_stream_compression_context *ctx,
-                                        grpc_slice_buffer *in,
-                                        grpc_slice_buffer *out,
-                                        size_t *output_size,
+static bool grpc_stream_decompress_gzip(grpc_stream_compression_context* ctx,
+                                        grpc_slice_buffer* in,
+                                        grpc_slice_buffer* out,
+                                        size_t* output_size,
                                         size_t max_output_size,
-                                        bool *end_of_context) {
+                                        bool* end_of_context) {
   if (ctx == NULL) {
     return false;
   }
-  grpc_stream_compression_context_gzip *gzip_ctx =
-      (grpc_stream_compression_context_gzip *)ctx;
+  grpc_stream_compression_context_gzip* gzip_ctx =
+      (grpc_stream_compression_context_gzip*)ctx;
   GPR_ASSERT(gzip_ctx->flate == inflate);
   return gzip_flate(gzip_ctx, in, out, output_size, max_output_size,
                     Z_SYNC_FLUSH, end_of_context);
 }
 
-static grpc_stream_compression_context *
+static grpc_stream_compression_context*
 grpc_stream_compression_context_create_gzip(
     grpc_stream_compression_method method) {
   GPR_ASSERT(method == GRPC_STREAM_COMPRESSION_GZIP_COMPRESS ||
              method == GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
-  grpc_stream_compression_context_gzip *gzip_ctx =
-      (grpc_stream_compression_context_gzip *)gpr_zalloc(
+  grpc_stream_compression_context_gzip* gzip_ctx =
+      (grpc_stream_compression_context_gzip*)gpr_zalloc(
           sizeof(grpc_stream_compression_context_gzip));
   int r;
   if (gzip_ctx == NULL) {
@@ -203,16 +203,16 @@
   }
 
   gzip_ctx->base.vtable = &grpc_stream_compression_gzip_vtable;
-  return (grpc_stream_compression_context *)gzip_ctx;
+  return (grpc_stream_compression_context*)gzip_ctx;
 }
 
 static void grpc_stream_compression_context_destroy_gzip(
-    grpc_stream_compression_context *ctx) {
+    grpc_stream_compression_context* ctx) {
   if (ctx == NULL) {
     return;
   }
-  grpc_stream_compression_context_gzip *gzip_ctx =
-      (grpc_stream_compression_context_gzip *)ctx;
+  grpc_stream_compression_context_gzip* gzip_ctx =
+      (grpc_stream_compression_context_gzip*)ctx;
   if (gzip_ctx->flate == inflate) {
     inflateEnd(&gzip_ctx->zs);
   } else {
diff --git a/src/core/lib/compression/stream_compression_identity.cc b/src/core/lib/compression/stream_compression_identity.cc
index 9b2e606..5e8bfc0 100644
--- a/src/core/lib/compression/stream_compression_identity.cc
+++ b/src/core/lib/compression/stream_compression_identity.cc
@@ -29,9 +29,9 @@
 static grpc_stream_compression_context identity_ctx = {
     &grpc_stream_compression_identity_vtable};
 
-static void grpc_stream_compression_pass_through(grpc_slice_buffer *in,
-                                                 grpc_slice_buffer *out,
-                                                 size_t *output_size,
+static void grpc_stream_compression_pass_through(grpc_slice_buffer* in,
+                                                 grpc_slice_buffer* out,
+                                                 size_t* output_size,
                                                  size_t max_output_size) {
   if (max_output_size >= in->length) {
     if (output_size) {
@@ -46,10 +46,10 @@
   }
 }
 
-static bool grpc_stream_compress_identity(grpc_stream_compression_context *ctx,
-                                          grpc_slice_buffer *in,
-                                          grpc_slice_buffer *out,
-                                          size_t *output_size,
+static bool grpc_stream_compress_identity(grpc_stream_compression_context* ctx,
+                                          grpc_slice_buffer* in,
+                                          grpc_slice_buffer* out,
+                                          size_t* output_size,
                                           size_t max_output_size,
                                           grpc_stream_compression_flush flush) {
   if (ctx == NULL) {
@@ -60,9 +60,9 @@
 }
 
 static bool grpc_stream_decompress_identity(
-    grpc_stream_compression_context *ctx, grpc_slice_buffer *in,
-    grpc_slice_buffer *out, size_t *output_size, size_t max_output_size,
-    bool *end_of_context) {
+    grpc_stream_compression_context* ctx, grpc_slice_buffer* in,
+    grpc_slice_buffer* out, size_t* output_size, size_t max_output_size,
+    bool* end_of_context) {
   if (ctx == NULL) {
     return false;
   }
@@ -73,17 +73,17 @@
   return true;
 }
 
-static grpc_stream_compression_context *
+static grpc_stream_compression_context*
 grpc_stream_compression_context_create_identity(
     grpc_stream_compression_method method) {
   GPR_ASSERT(method == GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS ||
              method == GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS);
   /* No context needed in this case. Use fake context instead. */
-  return (grpc_stream_compression_context *)&identity_ctx;
+  return (grpc_stream_compression_context*)&identity_ctx;
 }
 
 static void grpc_stream_compression_context_destroy_identity(
-    grpc_stream_compression_context *ctx) {
+    grpc_stream_compression_context* ctx) {
   return;
 }
 
diff --git a/src/core/lib/debug/stats.cc b/src/core/lib/debug/stats.cc
index 4096384..b32cf19 100644
--- a/src/core/lib/debug/stats.cc
+++ b/src/core/lib/debug/stats.cc
@@ -27,18 +27,18 @@
 
 #include "src/core/lib/support/string.h"
 
-grpc_stats_data *grpc_stats_per_cpu_storage = NULL;
+grpc_stats_data* grpc_stats_per_cpu_storage = NULL;
 static size_t g_num_cores;
 
 void grpc_stats_init(void) {
   g_num_cores = GPR_MAX(1, gpr_cpu_num_cores());
   grpc_stats_per_cpu_storage =
-      (grpc_stats_data *)gpr_zalloc(sizeof(grpc_stats_data) * g_num_cores);
+      (grpc_stats_data*)gpr_zalloc(sizeof(grpc_stats_data) * g_num_cores);
 }
 
 void grpc_stats_shutdown(void) { gpr_free(grpc_stats_per_cpu_storage); }
 
-void grpc_stats_collect(grpc_stats_data *output) {
+void grpc_stats_collect(grpc_stats_data* output) {
   memset(output, 0, sizeof(*output));
   for (size_t core = 0; core < g_num_cores; core++) {
     for (size_t i = 0; i < GRPC_STATS_COUNTER_COUNT; i++) {
@@ -52,8 +52,8 @@
   }
 }
 
-void grpc_stats_diff(const grpc_stats_data *b, const grpc_stats_data *a,
-                     grpc_stats_data *c) {
+void grpc_stats_diff(const grpc_stats_data* b, const grpc_stats_data* a,
+                     grpc_stats_data* c) {
   for (size_t i = 0; i < GRPC_STATS_COUNTER_COUNT; i++) {
     c->counters[i] = b->counters[i] - a->counters[i];
   }
@@ -62,13 +62,13 @@
   }
 }
 
-int grpc_stats_histo_find_bucket_slow(grpc_exec_ctx *exec_ctx, int value,
-                                      const int *table, int table_size) {
+int grpc_stats_histo_find_bucket_slow(grpc_exec_ctx* exec_ctx, int value,
+                                      const int* table, int table_size) {
   GRPC_STATS_INC_HISTOGRAM_SLOW_LOOKUPS(exec_ctx);
-  const int *const start = table;
+  const int* const start = table;
   while (table_size > 0) {
     int step = table_size / 2;
-    const int *it = table + step;
+    const int* it = table + step;
     if (value >= *it) {
       table = it + 1;
       table_size -= step + 1;
@@ -79,7 +79,7 @@
   return (int)(table - start) - 1;
 }
 
-size_t grpc_stats_histo_count(const grpc_stats_data *stats,
+size_t grpc_stats_histo_count(const grpc_stats_data* stats,
                               grpc_stats_histograms histogram) {
   size_t sum = 0;
   for (int i = 0; i < grpc_stats_histo_buckets[histogram]; i++) {
@@ -88,8 +88,8 @@
   return sum;
 }
 
-static double threshold_for_count_below(const gpr_atm *bucket_counts,
-                                        const int *bucket_boundaries,
+static double threshold_for_count_below(const gpr_atm* bucket_counts,
+                                        const int* bucket_boundaries,
                                         int num_buckets, double count_below) {
   double count_so_far;
   double lower_bound;
@@ -119,13 +119,13 @@
        should lie */
     lower_bound = bucket_boundaries[lower_idx];
     upper_bound = bucket_boundaries[lower_idx + 1];
-    return upper_bound -
-           (upper_bound - lower_bound) * (count_so_far - count_below) /
-               (double)bucket_counts[lower_idx];
+    return upper_bound - (upper_bound - lower_bound) *
+                             (count_so_far - count_below) /
+                             (double)bucket_counts[lower_idx];
   }
 }
 
-double grpc_stats_histo_percentile(const grpc_stats_data *stats,
+double grpc_stats_histo_percentile(const grpc_stats_data* stats,
                                    grpc_stats_histograms histogram,
                                    double percentile) {
   size_t count = grpc_stats_histo_count(stats, histogram);
@@ -136,9 +136,9 @@
       grpc_stats_histo_buckets[histogram], (double)count * percentile / 100.0);
 }
 
-char *grpc_stats_data_as_json(const grpc_stats_data *data) {
+char* grpc_stats_data_as_json(const grpc_stats_data* data) {
   gpr_strvec v;
-  char *tmp;
+  char* tmp;
   bool is_first = true;
   gpr_strvec_init(&v);
   gpr_strvec_add(&v, gpr_strdup("{"));
diff --git a/src/core/lib/debug/stats.h b/src/core/lib/debug/stats.h
index fec1d65..1c19e72 100644
--- a/src/core/lib/debug/stats.h
+++ b/src/core/lib/debug/stats.h
@@ -32,7 +32,7 @@
   gpr_atm histograms[GRPC_STATS_HISTOGRAM_BUCKETS];
 } grpc_stats_data;
 
-extern grpc_stats_data *grpc_stats_per_cpu_storage;
+extern grpc_stats_data* grpc_stats_per_cpu_storage;
 
 #define GRPC_THREAD_STATS_DATA(exec_ctx) \
   (&grpc_stats_per_cpu_storage[(exec_ctx)->starting_cpu])
@@ -49,17 +49,17 @@
 
 void grpc_stats_init(void);
 void grpc_stats_shutdown(void);
-void grpc_stats_collect(grpc_stats_data *output);
+void grpc_stats_collect(grpc_stats_data* output);
 // c = b-a
-void grpc_stats_diff(const grpc_stats_data *b, const grpc_stats_data *a,
-                     grpc_stats_data *c);
-char *grpc_stats_data_as_json(const grpc_stats_data *data);
-int grpc_stats_histo_find_bucket_slow(grpc_exec_ctx *exec_ctx, int value,
-                                      const int *table, int table_size);
-double grpc_stats_histo_percentile(const grpc_stats_data *data,
+void grpc_stats_diff(const grpc_stats_data* b, const grpc_stats_data* a,
+                     grpc_stats_data* c);
+char* grpc_stats_data_as_json(const grpc_stats_data* data);
+int grpc_stats_histo_find_bucket_slow(grpc_exec_ctx* exec_ctx, int value,
+                                      const int* table, int table_size);
+double grpc_stats_histo_percentile(const grpc_stats_data* data,
                                    grpc_stats_histograms histogram,
                                    double percentile);
-size_t grpc_stats_histo_count(const grpc_stats_data *data,
+size_t grpc_stats_histo_count(const grpc_stats_data* data,
                               grpc_stats_histograms histogram);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/debug/stats_data.cc b/src/core/lib/debug/stats_data.cc
index 5d737c5..17e15f4 100644
--- a/src/core/lib/debug/stats_data.cc
+++ b/src/core/lib/debug/stats_data.cc
@@ -22,7 +22,7 @@
 #include <grpc/support/useful.h>
 #include "src/core/lib/debug/stats.h"
 #include "src/core/lib/iomgr/exec_ctx.h"
-const char *grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = {
+const char* grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = {
     "client_calls_created",
     "server_calls_created",
     "cqs_created",
@@ -120,11 +120,13 @@
     "cq_ev_queue_trylock_successes",
     "cq_ev_queue_transient_pop_failures",
 };
-const char *grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT] = {
+const char* grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT] = {
     "Number of client side calls created by this process",
     "Number of server side calls created by this process",
-    "Number of completion queues created", "Number of client channels created",
-    "Number of client subchannels created", "Number of server channels created",
+    "Number of completion queues created",
+    "Number of client channels created",
+    "Number of client subchannels created",
+    "Number of server channels created",
     "Number of polling syscalls (epoll_wait, poll, etc) made by this process",
     "Number of sleeping syscalls made by this process",
     "How many polling wakeups were performed by the process (only valid for "
@@ -154,7 +156,8 @@
     "Number of batches containing receive initial metadata",
     "Number of batches containing receive message",
     "Number of batches containing receive trailing metadata",
-    "Number of settings frames sent", "Number of HTTP2 pings sent by process",
+    "Number of settings frames sent",
+    "Number of HTTP2 pings sent by process",
     "Number of HTTP2 writes initiated",
     "Number of HTTP2 writes offloaded to the executor from application threads",
     "Number of HTTP2 writes that finished seeing more data needed to be "
@@ -241,7 +244,7 @@
     "Number of times NULL was popped out of completion queue's event queue "
     "even though the event queue was not empty",
 };
-const char *grpc_stats_histogram_name[GRPC_STATS_HISTOGRAM_COUNT] = {
+const char* grpc_stats_histogram_name[GRPC_STATS_HISTOGRAM_COUNT] = {
     "call_initial_size",
     "poll_events_returned",
     "tcp_write_size",
@@ -256,7 +259,7 @@
     "http2_send_flowctl_per_write",
     "server_cqs_checked",
 };
-const char *grpc_stats_histogram_doc[GRPC_STATS_HISTOGRAM_COUNT] = {
+const char* grpc_stats_histogram_doc[GRPC_STATS_HISTOGRAM_COUNT] = {
     "Initial size of the grpc_call arena created at call start",
     "How many events are called for each syscall_poll",
     "Number of bytes offered to each syscall_write",
@@ -339,7 +342,7 @@
     42, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51, 51};
 const int grpc_stats_table_8[9] = {0, 1, 2, 4, 7, 13, 23, 39, 64};
 const uint8_t grpc_stats_table_9[9] = {0, 0, 1, 2, 2, 3, 4, 4, 5};
-void grpc_stats_inc_call_initial_size(grpc_exec_ctx *exec_ctx, int value) {
+void grpc_stats_inc_call_initial_size(grpc_exec_ctx* exec_ctx, int value) {
   value = GPR_CLAMP(value, 0, 262144);
   if (value < 6) {
     GRPC_STATS_INC_HISTOGRAM((exec_ctx), GRPC_STATS_HISTOGRAM_CALL_INITIAL_SIZE,
@@ -364,7 +367,7 @@
                            grpc_stats_histo_find_bucket_slow(
                                (exec_ctx), value, grpc_stats_table_0, 64));
 }
-void grpc_stats_inc_poll_events_returned(grpc_exec_ctx *exec_ctx, int value) {
+void grpc_stats_inc_poll_events_returned(grpc_exec_ctx* exec_ctx, int value) {
   value = GPR_CLAMP(value, 0, 1024);
   if (value < 29) {
     GRPC_STATS_INC_HISTOGRAM((exec_ctx),
@@ -390,7 +393,7 @@
                            grpc_stats_histo_find_bucket_slow(
                                (exec_ctx), value, grpc_stats_table_2, 128));
 }
-void grpc_stats_inc_tcp_write_size(grpc_exec_ctx *exec_ctx, int value) {
+void grpc_stats_inc_tcp_write_size(grpc_exec_ctx* exec_ctx, int value) {
   value = GPR_CLAMP(value, 0, 16777216);
   if (value < 5) {
     GRPC_STATS_INC_HISTOGRAM((exec_ctx), GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE,
@@ -415,7 +418,7 @@
                            grpc_stats_histo_find_bucket_slow(
                                (exec_ctx), value, grpc_stats_table_4, 64));
 }
-void grpc_stats_inc_tcp_write_iov_size(grpc_exec_ctx *exec_ctx, int value) {
+void grpc_stats_inc_tcp_write_iov_size(grpc_exec_ctx* exec_ctx, int value) {
   value = GPR_CLAMP(value, 0, 1024);
   if (value < 13) {
     GRPC_STATS_INC_HISTOGRAM((exec_ctx),
@@ -440,7 +443,7 @@
                            grpc_stats_histo_find_bucket_slow(
                                (exec_ctx), value, grpc_stats_table_6, 64));
 }
-void grpc_stats_inc_tcp_read_size(grpc_exec_ctx *exec_ctx, int value) {
+void grpc_stats_inc_tcp_read_size(grpc_exec_ctx* exec_ctx, int value) {
   value = GPR_CLAMP(value, 0, 16777216);
   if (value < 5) {
     GRPC_STATS_INC_HISTOGRAM((exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_SIZE,
@@ -465,7 +468,7 @@
                            grpc_stats_histo_find_bucket_slow(
                                (exec_ctx), value, grpc_stats_table_4, 64));
 }
-void grpc_stats_inc_tcp_read_offer(grpc_exec_ctx *exec_ctx, int value) {
+void grpc_stats_inc_tcp_read_offer(grpc_exec_ctx* exec_ctx, int value) {
   value = GPR_CLAMP(value, 0, 16777216);
   if (value < 5) {
     GRPC_STATS_INC_HISTOGRAM((exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_OFFER,
@@ -490,7 +493,7 @@
                            grpc_stats_histo_find_bucket_slow(
                                (exec_ctx), value, grpc_stats_table_4, 64));
 }
-void grpc_stats_inc_tcp_read_offer_iov_size(grpc_exec_ctx *exec_ctx,
+void grpc_stats_inc_tcp_read_offer_iov_size(grpc_exec_ctx* exec_ctx,
                                             int value) {
   value = GPR_CLAMP(value, 0, 1024);
   if (value < 13) {
@@ -517,7 +520,7 @@
                            grpc_stats_histo_find_bucket_slow(
                                (exec_ctx), value, grpc_stats_table_6, 64));
 }
-void grpc_stats_inc_http2_send_message_size(grpc_exec_ctx *exec_ctx,
+void grpc_stats_inc_http2_send_message_size(grpc_exec_ctx* exec_ctx,
                                             int value) {
   value = GPR_CLAMP(value, 0, 16777216);
   if (value < 5) {
@@ -545,7 +548,7 @@
                                (exec_ctx), value, grpc_stats_table_4, 64));
 }
 void grpc_stats_inc_http2_send_initial_metadata_per_write(
-    grpc_exec_ctx *exec_ctx, int value) {
+    grpc_exec_ctx* exec_ctx, int value) {
   value = GPR_CLAMP(value, 0, 1024);
   if (value < 13) {
     GRPC_STATS_INC_HISTOGRAM(
@@ -573,7 +576,7 @@
       grpc_stats_histo_find_bucket_slow((exec_ctx), value, grpc_stats_table_6,
                                         64));
 }
-void grpc_stats_inc_http2_send_message_per_write(grpc_exec_ctx *exec_ctx,
+void grpc_stats_inc_http2_send_message_per_write(grpc_exec_ctx* exec_ctx,
                                                  int value) {
   value = GPR_CLAMP(value, 0, 1024);
   if (value < 13) {
@@ -601,7 +604,7 @@
                                (exec_ctx), value, grpc_stats_table_6, 64));
 }
 void grpc_stats_inc_http2_send_trailing_metadata_per_write(
-    grpc_exec_ctx *exec_ctx, int value) {
+    grpc_exec_ctx* exec_ctx, int value) {
   value = GPR_CLAMP(value, 0, 1024);
   if (value < 13) {
     GRPC_STATS_INC_HISTOGRAM(
@@ -629,7 +632,7 @@
       grpc_stats_histo_find_bucket_slow((exec_ctx), value, grpc_stats_table_6,
                                         64));
 }
-void grpc_stats_inc_http2_send_flowctl_per_write(grpc_exec_ctx *exec_ctx,
+void grpc_stats_inc_http2_send_flowctl_per_write(grpc_exec_ctx* exec_ctx,
                                                  int value) {
   value = GPR_CLAMP(value, 0, 1024);
   if (value < 13) {
@@ -656,7 +659,7 @@
                            grpc_stats_histo_find_bucket_slow(
                                (exec_ctx), value, grpc_stats_table_6, 64));
 }
-void grpc_stats_inc_server_cqs_checked(grpc_exec_ctx *exec_ctx, int value) {
+void grpc_stats_inc_server_cqs_checked(grpc_exec_ctx* exec_ctx, int value) {
   value = GPR_CLAMP(value, 0, 64);
   if (value < 3) {
     GRPC_STATS_INC_HISTOGRAM((exec_ctx),
@@ -685,13 +688,13 @@
                                           64, 64,  64, 64, 64, 8};
 const int grpc_stats_histo_start[13] = {0,   64,  192, 256, 320, 384, 448,
                                         512, 576, 640, 704, 768, 832};
-const int *const grpc_stats_histo_bucket_boundaries[13] = {
+const int* const grpc_stats_histo_bucket_boundaries[13] = {
     grpc_stats_table_0, grpc_stats_table_2, grpc_stats_table_4,
     grpc_stats_table_6, grpc_stats_table_4, grpc_stats_table_4,
     grpc_stats_table_6, grpc_stats_table_4, grpc_stats_table_6,
     grpc_stats_table_6, grpc_stats_table_6, grpc_stats_table_6,
     grpc_stats_table_8};
-void (*const grpc_stats_inc_histogram[13])(grpc_exec_ctx *exec_ctx, int x) = {
+void (*const grpc_stats_inc_histogram[13])(grpc_exec_ctx* exec_ctx, int x) = {
     grpc_stats_inc_call_initial_size,
     grpc_stats_inc_poll_events_returned,
     grpc_stats_inc_tcp_write_size,
diff --git a/src/core/lib/debug/stats_data.h b/src/core/lib/debug/stats_data.h
index 031942d..fbfcce8 100644
--- a/src/core/lib/debug/stats_data.h
+++ b/src/core/lib/debug/stats_data.h
@@ -127,8 +127,8 @@
   GRPC_STATS_COUNTER_CQ_EV_QUEUE_TRANSIENT_POP_FAILURES,
   GRPC_STATS_COUNTER_COUNT
 } grpc_stats_counters;
-extern const char *grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT];
-extern const char *grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT];
+extern const char* grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT];
+extern const char* grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT];
 typedef enum {
   GRPC_STATS_HISTOGRAM_CALL_INITIAL_SIZE,
   GRPC_STATS_HISTOGRAM_POLL_EVENTS_RETURNED,
@@ -145,8 +145,8 @@
   GRPC_STATS_HISTOGRAM_SERVER_CQS_CHECKED,
   GRPC_STATS_HISTOGRAM_COUNT
 } grpc_stats_histograms;
-extern const char *grpc_stats_histogram_name[GRPC_STATS_HISTOGRAM_COUNT];
-extern const char *grpc_stats_histogram_doc[GRPC_STATS_HISTOGRAM_COUNT];
+extern const char* grpc_stats_histogram_name[GRPC_STATS_HISTOGRAM_COUNT];
+extern const char* grpc_stats_histogram_doc[GRPC_STATS_HISTOGRAM_COUNT];
 typedef enum {
   GRPC_STATS_HISTOGRAM_CALL_INITIAL_SIZE_FIRST_SLOT = 0,
   GRPC_STATS_HISTOGRAM_CALL_INITIAL_SIZE_BUCKETS = 64,
@@ -454,52 +454,52 @@
       (exec_ctx), GRPC_STATS_COUNTER_CQ_EV_QUEUE_TRANSIENT_POP_FAILURES)
 #define GRPC_STATS_INC_CALL_INITIAL_SIZE(exec_ctx, value) \
   grpc_stats_inc_call_initial_size((exec_ctx), (int)(value))
-void grpc_stats_inc_call_initial_size(grpc_exec_ctx *exec_ctx, int x);
+void grpc_stats_inc_call_initial_size(grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_POLL_EVENTS_RETURNED(exec_ctx, value) \
   grpc_stats_inc_poll_events_returned((exec_ctx), (int)(value))
-void grpc_stats_inc_poll_events_returned(grpc_exec_ctx *exec_ctx, int x);
+void grpc_stats_inc_poll_events_returned(grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_TCP_WRITE_SIZE(exec_ctx, value) \
   grpc_stats_inc_tcp_write_size((exec_ctx), (int)(value))
-void grpc_stats_inc_tcp_write_size(grpc_exec_ctx *exec_ctx, int x);
+void grpc_stats_inc_tcp_write_size(grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_TCP_WRITE_IOV_SIZE(exec_ctx, value) \
   grpc_stats_inc_tcp_write_iov_size((exec_ctx), (int)(value))
-void grpc_stats_inc_tcp_write_iov_size(grpc_exec_ctx *exec_ctx, int x);
+void grpc_stats_inc_tcp_write_iov_size(grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_TCP_READ_SIZE(exec_ctx, value) \
   grpc_stats_inc_tcp_read_size((exec_ctx), (int)(value))
-void grpc_stats_inc_tcp_read_size(grpc_exec_ctx *exec_ctx, int x);
+void grpc_stats_inc_tcp_read_size(grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_TCP_READ_OFFER(exec_ctx, value) \
   grpc_stats_inc_tcp_read_offer((exec_ctx), (int)(value))
-void grpc_stats_inc_tcp_read_offer(grpc_exec_ctx *exec_ctx, int x);
+void grpc_stats_inc_tcp_read_offer(grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_TCP_READ_OFFER_IOV_SIZE(exec_ctx, value) \
   grpc_stats_inc_tcp_read_offer_iov_size((exec_ctx), (int)(value))
-void grpc_stats_inc_tcp_read_offer_iov_size(grpc_exec_ctx *exec_ctx, int x);
+void grpc_stats_inc_tcp_read_offer_iov_size(grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_HTTP2_SEND_MESSAGE_SIZE(exec_ctx, value) \
   grpc_stats_inc_http2_send_message_size((exec_ctx), (int)(value))
-void grpc_stats_inc_http2_send_message_size(grpc_exec_ctx *exec_ctx, int x);
+void grpc_stats_inc_http2_send_message_size(grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_HTTP2_SEND_INITIAL_METADATA_PER_WRITE(exec_ctx, value) \
   grpc_stats_inc_http2_send_initial_metadata_per_write((exec_ctx), (int)(value))
 void grpc_stats_inc_http2_send_initial_metadata_per_write(
-    grpc_exec_ctx *exec_ctx, int x);
+    grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_HTTP2_SEND_MESSAGE_PER_WRITE(exec_ctx, value) \
   grpc_stats_inc_http2_send_message_per_write((exec_ctx), (int)(value))
-void grpc_stats_inc_http2_send_message_per_write(grpc_exec_ctx *exec_ctx,
+void grpc_stats_inc_http2_send_message_per_write(grpc_exec_ctx* exec_ctx,
                                                  int x);
 #define GRPC_STATS_INC_HTTP2_SEND_TRAILING_METADATA_PER_WRITE(exec_ctx, value) \
   grpc_stats_inc_http2_send_trailing_metadata_per_write((exec_ctx),            \
                                                         (int)(value))
 void grpc_stats_inc_http2_send_trailing_metadata_per_write(
-    grpc_exec_ctx *exec_ctx, int x);
+    grpc_exec_ctx* exec_ctx, int x);
 #define GRPC_STATS_INC_HTTP2_SEND_FLOWCTL_PER_WRITE(exec_ctx, value) \
   grpc_stats_inc_http2_send_flowctl_per_write((exec_ctx), (int)(value))
-void grpc_stats_inc_http2_send_flowctl_per_write(grpc_exec_ctx *exec_ctx,
+void grpc_stats_inc_http2_send_flowctl_per_write(grpc_exec_ctx* exec_ctx,
                                                  int x);
 #define GRPC_STATS_INC_SERVER_CQS_CHECKED(exec_ctx, value) \
   grpc_stats_inc_server_cqs_checked((exec_ctx), (int)(value))
-void grpc_stats_inc_server_cqs_checked(grpc_exec_ctx *exec_ctx, int x);
+void grpc_stats_inc_server_cqs_checked(grpc_exec_ctx* exec_ctx, int x);
 extern const int grpc_stats_histo_buckets[13];
 extern const int grpc_stats_histo_start[13];
-extern const int *const grpc_stats_histo_bucket_boundaries[13];
-extern void (*const grpc_stats_inc_histogram[13])(grpc_exec_ctx *exec_ctx,
+extern const int* const grpc_stats_histo_bucket_boundaries[13];
+extern void (*const grpc_stats_inc_histogram[13])(grpc_exec_ctx* exec_ctx,
                                                   int x);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h
index f7a6005..fe4c875 100644
--- a/src/core/lib/debug/trace.h
+++ b/src/core/lib/debug/trace.h
@@ -51,6 +51,8 @@
 
   static bool Set(const char *tracer, bool enabled);
 
+  const char* name() const { return name_; }
+
   bool enabled() {
 #ifdef GRPC_THREADSAFE_TRACER
     gpr_atm_no_barrier_load(&value_) != 0
diff --git a/src/core/lib/http/format_request.cc b/src/core/lib/http/format_request.cc
index 88fb0ab..f3f3cbd 100644
--- a/src/core/lib/http/format_request.cc
+++ b/src/core/lib/http/format_request.cc
@@ -28,8 +28,8 @@
 #include <grpc/support/useful.h>
 #include "src/core/lib/support/string.h"
 
-static void fill_common_header(const grpc_httpcli_request *request,
-                               gpr_strvec *buf, bool connection_close) {
+static void fill_common_header(const grpc_httpcli_request* request,
+                               gpr_strvec* buf, bool connection_close) {
   size_t i;
   gpr_strvec_add(buf, gpr_strdup(request->http.path));
   gpr_strvec_add(buf, gpr_strdup(" HTTP/1.0\r\n"));
@@ -51,9 +51,9 @@
 }
 
 grpc_slice grpc_httpcli_format_get_request(
-    const grpc_httpcli_request *request) {
+    const grpc_httpcli_request* request) {
   gpr_strvec out;
-  char *flat;
+  char* flat;
   size_t flat_len;
 
   gpr_strvec_init(&out);
@@ -67,11 +67,11 @@
   return grpc_slice_new(flat, flat_len, gpr_free);
 }
 
-grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
-                                            const char *body_bytes,
+grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request* request,
+                                            const char* body_bytes,
                                             size_t body_size) {
   gpr_strvec out;
-  char *tmp;
+  char* tmp;
   size_t out_len;
   size_t i;
 
@@ -98,7 +98,7 @@
   gpr_strvec_destroy(&out);
 
   if (body_bytes) {
-    tmp = (char *)gpr_realloc(tmp, out_len + body_size);
+    tmp = (char*)gpr_realloc(tmp, out_len + body_size);
     memcpy(tmp + out_len, body_bytes, body_size);
     out_len += body_size;
   }
@@ -107,14 +107,14 @@
 }
 
 grpc_slice grpc_httpcli_format_connect_request(
-    const grpc_httpcli_request *request) {
+    const grpc_httpcli_request* request) {
   gpr_strvec out;
   gpr_strvec_init(&out);
   gpr_strvec_add(&out, gpr_strdup("CONNECT "));
   fill_common_header(request, &out, false);
   gpr_strvec_add(&out, gpr_strdup("\r\n"));
   size_t flat_len;
-  char *flat = gpr_strvec_flatten(&out, &flat_len);
+  char* flat = gpr_strvec_flatten(&out, &flat_len);
   gpr_strvec_destroy(&out);
   return grpc_slice_new(flat, flat_len, gpr_free);
 }
diff --git a/src/core/lib/http/format_request.h b/src/core/lib/http/format_request.h
index 2e77e86..3205480 100644
--- a/src/core/lib/http/format_request.h
+++ b/src/core/lib/http/format_request.h
@@ -26,12 +26,12 @@
 extern "C" {
 #endif
 
-grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request);
-grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
-                                            const char *body_bytes,
+grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request* request);
+grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request* request,
+                                            const char* body_bytes,
                                             size_t body_size);
 grpc_slice grpc_httpcli_format_connect_request(
-    const grpc_httpcli_request *request);
+    const grpc_httpcli_request* request);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/http/httpcli.cc b/src/core/lib/http/httpcli.cc
index c96800b..493e6af 100644
--- a/src/core/lib/http/httpcli.cc
+++ b/src/core/lib/http/httpcli.cc
@@ -39,56 +39,56 @@
 typedef struct {
   grpc_slice request_text;
   grpc_http_parser parser;
-  grpc_resolved_addresses *addresses;
+  grpc_resolved_addresses* addresses;
   size_t next_address;
-  grpc_endpoint *ep;
-  char *host;
-  char *ssl_host_override;
+  grpc_endpoint* ep;
+  char* host;
+  char* ssl_host_override;
   grpc_millis deadline;
   int have_read_byte;
-  const grpc_httpcli_handshaker *handshaker;
-  grpc_closure *on_done;
-  grpc_httpcli_context *context;
-  grpc_polling_entity *pollent;
+  const grpc_httpcli_handshaker* handshaker;
+  grpc_closure* on_done;
+  grpc_httpcli_context* context;
+  grpc_polling_entity* pollent;
   grpc_iomgr_object iomgr_obj;
   grpc_slice_buffer incoming;
   grpc_slice_buffer outgoing;
   grpc_closure on_read;
   grpc_closure done_write;
   grpc_closure connected;
-  grpc_error *overall_error;
-  grpc_resource_quota *resource_quota;
+  grpc_error* overall_error;
+  grpc_resource_quota* resource_quota;
 } internal_request;
 
 static grpc_httpcli_get_override g_get_override = NULL;
 static grpc_httpcli_post_override g_post_override = NULL;
 
-static void plaintext_handshake(grpc_exec_ctx *exec_ctx, void *arg,
-                                grpc_endpoint *endpoint, const char *host,
+static void plaintext_handshake(grpc_exec_ctx* exec_ctx, void* arg,
+                                grpc_endpoint* endpoint, const char* host,
                                 grpc_millis deadline,
-                                void (*on_done)(grpc_exec_ctx *exec_ctx,
-                                                void *arg,
-                                                grpc_endpoint *endpoint)) {
+                                void (*on_done)(grpc_exec_ctx* exec_ctx,
+                                                void* arg,
+                                                grpc_endpoint* endpoint)) {
   on_done(exec_ctx, arg, endpoint);
 }
 
 const grpc_httpcli_handshaker grpc_httpcli_plaintext = {"http",
                                                         plaintext_handshake};
 
-void grpc_httpcli_context_init(grpc_httpcli_context *context) {
+void grpc_httpcli_context_init(grpc_httpcli_context* context) {
   context->pollset_set = grpc_pollset_set_create();
 }
 
-void grpc_httpcli_context_destroy(grpc_exec_ctx *exec_ctx,
-                                  grpc_httpcli_context *context) {
+void grpc_httpcli_context_destroy(grpc_exec_ctx* exec_ctx,
+                                  grpc_httpcli_context* context) {
   grpc_pollset_set_destroy(exec_ctx, context->pollset_set);
 }
 
-static void next_address(grpc_exec_ctx *exec_ctx, internal_request *req,
-                         grpc_error *due_to_error);
+static void next_address(grpc_exec_ctx* exec_ctx, internal_request* req,
+                         grpc_error* due_to_error);
 
-static void finish(grpc_exec_ctx *exec_ctx, internal_request *req,
-                   grpc_error *error) {
+static void finish(grpc_exec_ctx* exec_ctx, internal_request* req,
+                   grpc_error* error) {
   grpc_polling_entity_del_from_pollset_set(exec_ctx, req->pollent,
                                            req->context->pollset_set);
   GRPC_CLOSURE_SCHED(exec_ctx, req->on_done, error);
@@ -110,13 +110,13 @@
   gpr_free(req);
 }
 
-static void append_error(internal_request *req, grpc_error *error) {
+static void append_error(internal_request* req, grpc_error* error) {
   if (req->overall_error == GRPC_ERROR_NONE) {
     req->overall_error =
         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed HTTP/1 client request");
   }
-  grpc_resolved_address *addr = &req->addresses->addrs[req->next_address - 1];
-  char *addr_text = grpc_sockaddr_to_uri(addr);
+  grpc_resolved_address* addr = &req->addresses->addrs[req->next_address - 1];
+  char* addr_text = grpc_sockaddr_to_uri(addr);
   req->overall_error = grpc_error_add_child(
       req->overall_error,
       grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
@@ -124,19 +124,19 @@
   gpr_free(addr_text);
 }
 
-static void do_read(grpc_exec_ctx *exec_ctx, internal_request *req) {
+static void do_read(grpc_exec_ctx* exec_ctx, internal_request* req) {
   grpc_endpoint_read(exec_ctx, req->ep, &req->incoming, &req->on_read);
 }
 
-static void on_read(grpc_exec_ctx *exec_ctx, void *user_data,
-                    grpc_error *error) {
-  internal_request *req = (internal_request *)user_data;
+static void on_read(grpc_exec_ctx* exec_ctx, void* user_data,
+                    grpc_error* error) {
+  internal_request* req = (internal_request*)user_data;
   size_t i;
 
   for (i = 0; i < req->incoming.count; i++) {
     if (GRPC_SLICE_LENGTH(req->incoming.slices[i])) {
       req->have_read_byte = 1;
-      grpc_error *err =
+      grpc_error* err =
           grpc_http_parser_parse(&req->parser, req->incoming.slices[i], NULL);
       if (err != GRPC_ERROR_NONE) {
         finish(exec_ctx, req, err);
@@ -154,12 +154,12 @@
   }
 }
 
-static void on_written(grpc_exec_ctx *exec_ctx, internal_request *req) {
+static void on_written(grpc_exec_ctx* exec_ctx, internal_request* req) {
   do_read(exec_ctx, req);
 }
 
-static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  internal_request *req = (internal_request *)arg;
+static void done_write(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  internal_request* req = (internal_request*)arg;
   if (error == GRPC_ERROR_NONE) {
     on_written(exec_ctx, req);
   } else {
@@ -167,19 +167,20 @@
   }
 }
 
-static void start_write(grpc_exec_ctx *exec_ctx, internal_request *req) {
+static void start_write(grpc_exec_ctx* exec_ctx, internal_request* req) {
   grpc_slice_ref_internal(req->request_text);
   grpc_slice_buffer_add(&req->outgoing, req->request_text);
   grpc_endpoint_write(exec_ctx, req->ep, &req->outgoing, &req->done_write);
 }
 
-static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
-                              grpc_endpoint *ep) {
-  internal_request *req = (internal_request *)arg;
+static void on_handshake_done(grpc_exec_ctx* exec_ctx, void* arg,
+                              grpc_endpoint* ep) {
+  internal_request* req = (internal_request*)arg;
 
   if (!ep) {
-    next_address(exec_ctx, req, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-                                    "Unexplained handshake failure"));
+    next_address(
+        exec_ctx, req,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unexplained handshake failure"));
     return;
   }
 
@@ -187,9 +188,9 @@
   start_write(exec_ctx, req);
 }
 
-static void on_connected(grpc_exec_ctx *exec_ctx, void *arg,
-                         grpc_error *error) {
-  internal_request *req = (internal_request *)arg;
+static void on_connected(grpc_exec_ctx* exec_ctx, void* arg,
+                         grpc_error* error) {
+  internal_request* req = (internal_request*)arg;
 
   if (!req->ep) {
     next_address(exec_ctx, req, GRPC_ERROR_REF(error));
@@ -201,9 +202,9 @@
       req->deadline, on_handshake_done);
 }
 
-static void next_address(grpc_exec_ctx *exec_ctx, internal_request *req,
-                         grpc_error *error) {
-  grpc_resolved_address *addr;
+static void next_address(grpc_exec_ctx* exec_ctx, internal_request* req,
+                         grpc_error* error) {
+  grpc_resolved_address* addr;
   if (error != GRPC_ERROR_NONE) {
     append_error(req, error);
   }
@@ -217,7 +218,7 @@
   GRPC_CLOSURE_INIT(&req->connected, on_connected, req,
                     grpc_schedule_on_exec_ctx);
   grpc_arg arg = grpc_channel_arg_pointer_create(
-      (char *)GRPC_ARG_RESOURCE_QUOTA, req->resource_quota,
+      (char*)GRPC_ARG_RESOURCE_QUOTA, req->resource_quota,
       grpc_resource_quota_arg_vtable());
   grpc_channel_args args = {1, &arg};
   grpc_tcp_client_connect(exec_ctx, &req->connected, &req->ep,
@@ -225,8 +226,8 @@
                           req->deadline);
 }
 
-static void on_resolved(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  internal_request *req = (internal_request *)arg;
+static void on_resolved(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  internal_request* req = (internal_request*)arg;
   if (error != GRPC_ERROR_NONE) {
     finish(exec_ctx, req, GRPC_ERROR_REF(error));
     return;
@@ -235,16 +236,16 @@
   next_address(exec_ctx, req, GRPC_ERROR_NONE);
 }
 
-static void internal_request_begin(grpc_exec_ctx *exec_ctx,
-                                   grpc_httpcli_context *context,
-                                   grpc_polling_entity *pollent,
-                                   grpc_resource_quota *resource_quota,
-                                   const grpc_httpcli_request *request,
-                                   grpc_millis deadline, grpc_closure *on_done,
-                                   grpc_httpcli_response *response,
-                                   const char *name, grpc_slice request_text) {
-  internal_request *req =
-      (internal_request *)gpr_malloc(sizeof(internal_request));
+static void internal_request_begin(grpc_exec_ctx* exec_ctx,
+                                   grpc_httpcli_context* context,
+                                   grpc_polling_entity* pollent,
+                                   grpc_resource_quota* resource_quota,
+                                   const grpc_httpcli_request* request,
+                                   grpc_millis deadline, grpc_closure* on_done,
+                                   grpc_httpcli_response* response,
+                                   const char* name, grpc_slice request_text) {
+  internal_request* req =
+      (internal_request*)gpr_malloc(sizeof(internal_request));
   memset(req, 0, sizeof(*req));
   req->request_text = request_text;
   grpc_http_parser_init(&req->parser, GRPC_HTTP_RESPONSE, response);
@@ -275,12 +276,12 @@
       &req->addresses);
 }
 
-void grpc_httpcli_get(grpc_exec_ctx *exec_ctx, grpc_httpcli_context *context,
-                      grpc_polling_entity *pollent,
-                      grpc_resource_quota *resource_quota,
-                      const grpc_httpcli_request *request, grpc_millis deadline,
-                      grpc_closure *on_done, grpc_httpcli_response *response) {
-  char *name;
+void grpc_httpcli_get(grpc_exec_ctx* exec_ctx, grpc_httpcli_context* context,
+                      grpc_polling_entity* pollent,
+                      grpc_resource_quota* resource_quota,
+                      const grpc_httpcli_request* request, grpc_millis deadline,
+                      grpc_closure* on_done, grpc_httpcli_response* response) {
+  char* name;
   if (g_get_override &&
       g_get_override(exec_ctx, request, deadline, on_done, response)) {
     return;
@@ -292,14 +293,14 @@
   gpr_free(name);
 }
 
-void grpc_httpcli_post(grpc_exec_ctx *exec_ctx, grpc_httpcli_context *context,
-                       grpc_polling_entity *pollent,
-                       grpc_resource_quota *resource_quota,
-                       const grpc_httpcli_request *request,
-                       const char *body_bytes, size_t body_size,
-                       grpc_millis deadline, grpc_closure *on_done,
-                       grpc_httpcli_response *response) {
-  char *name;
+void grpc_httpcli_post(grpc_exec_ctx* exec_ctx, grpc_httpcli_context* context,
+                       grpc_polling_entity* pollent,
+                       grpc_resource_quota* resource_quota,
+                       const grpc_httpcli_request* request,
+                       const char* body_bytes, size_t body_size,
+                       grpc_millis deadline, grpc_closure* on_done,
+                       grpc_httpcli_response* response) {
+  char* name;
   if (g_post_override &&
       g_post_override(exec_ctx, request, body_bytes, body_size, deadline,
                       on_done, response)) {
diff --git a/src/core/lib/http/httpcli.h b/src/core/lib/http/httpcli.h
index 76b790f..a341134 100644
--- a/src/core/lib/http/httpcli.h
+++ b/src/core/lib/http/httpcli.h
@@ -40,15 +40,15 @@
    TODO(ctiller): allow caching and capturing multiple requests for the
                   same content and combining them */
 typedef struct grpc_httpcli_context {
-  grpc_pollset_set *pollset_set;
+  grpc_pollset_set* pollset_set;
 } grpc_httpcli_context;
 
 typedef struct {
-  const char *default_port;
-  void (*handshake)(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *endpoint,
-                    const char *host, grpc_millis deadline,
-                    void (*on_done)(grpc_exec_ctx *exec_ctx, void *arg,
-                                    grpc_endpoint *endpoint));
+  const char* default_port;
+  void (*handshake)(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* endpoint,
+                    const char* host, grpc_millis deadline,
+                    void (*on_done)(grpc_exec_ctx* exec_ctx, void* arg,
+                                    grpc_endpoint* endpoint));
 } grpc_httpcli_handshaker;
 
 extern const grpc_httpcli_handshaker grpc_httpcli_plaintext;
@@ -57,23 +57,23 @@
 /* A request */
 typedef struct grpc_httpcli_request {
   /* The host name to connect to */
-  char *host;
+  char* host;
   /* The host to verify in the SSL handshake (or NULL) */
-  char *ssl_host_override;
+  char* ssl_host_override;
   /* The main part of the request
      The following headers are supplied automatically and MUST NOT be set here:
      Host, Connection, User-Agent */
   grpc_http_request http;
   /* handshaker to use ssl for the request */
-  const grpc_httpcli_handshaker *handshaker;
+  const grpc_httpcli_handshaker* handshaker;
 } grpc_httpcli_request;
 
 /* Expose the parser response type as a httpcli response too */
 typedef struct grpc_http_response grpc_httpcli_response;
 
-void grpc_httpcli_context_init(grpc_httpcli_context *context);
-void grpc_httpcli_context_destroy(grpc_exec_ctx *exec_ctx,
-                                  grpc_httpcli_context *context);
+void grpc_httpcli_context_init(grpc_httpcli_context* context);
+void grpc_httpcli_context_destroy(grpc_exec_ctx* exec_ctx,
+                                  grpc_httpcli_context* context);
 
 /* Asynchronously perform a HTTP GET.
    'context' specifies the http context under which to do the get
@@ -84,12 +84,12 @@
      destroyed once the call returns
    'deadline' contains a deadline for the request (or gpr_inf_future)
    'on_response' is a callback to report results to */
-void grpc_httpcli_get(grpc_exec_ctx *exec_ctx, grpc_httpcli_context *context,
-                      grpc_polling_entity *pollent,
-                      grpc_resource_quota *resource_quota,
-                      const grpc_httpcli_request *request, grpc_millis deadline,
-                      grpc_closure *on_complete,
-                      grpc_httpcli_response *response);
+void grpc_httpcli_get(grpc_exec_ctx* exec_ctx, grpc_httpcli_context* context,
+                      grpc_polling_entity* pollent,
+                      grpc_resource_quota* resource_quota,
+                      const grpc_httpcli_request* request, grpc_millis deadline,
+                      grpc_closure* on_complete,
+                      grpc_httpcli_response* response);
 
 /* Asynchronously perform a HTTP POST.
    'context' specifies the http context under which to do the post
@@ -105,24 +105,24 @@
      lifetime of the request
    'on_response' is a callback to report results to
    Does not support ?var1=val1&var2=val2 in the path. */
-void grpc_httpcli_post(grpc_exec_ctx *exec_ctx, grpc_httpcli_context *context,
-                       grpc_polling_entity *pollent,
-                       grpc_resource_quota *resource_quota,
-                       const grpc_httpcli_request *request,
-                       const char *body_bytes, size_t body_size,
-                       grpc_millis deadline, grpc_closure *on_complete,
-                       grpc_httpcli_response *response);
+void grpc_httpcli_post(grpc_exec_ctx* exec_ctx, grpc_httpcli_context* context,
+                       grpc_polling_entity* pollent,
+                       grpc_resource_quota* resource_quota,
+                       const grpc_httpcli_request* request,
+                       const char* body_bytes, size_t body_size,
+                       grpc_millis deadline, grpc_closure* on_complete,
+                       grpc_httpcli_response* response);
 
 /* override functions return 1 if they handled the request, 0 otherwise */
-typedef int (*grpc_httpcli_get_override)(grpc_exec_ctx *exec_ctx,
-                                         const grpc_httpcli_request *request,
+typedef int (*grpc_httpcli_get_override)(grpc_exec_ctx* exec_ctx,
+                                         const grpc_httpcli_request* request,
                                          grpc_millis deadline,
-                                         grpc_closure *on_complete,
-                                         grpc_httpcli_response *response);
+                                         grpc_closure* on_complete,
+                                         grpc_httpcli_response* response);
 typedef int (*grpc_httpcli_post_override)(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    const char *body_bytes, size_t body_size, grpc_millis deadline,
-    grpc_closure *on_complete, grpc_httpcli_response *response);
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    const char* body_bytes, size_t body_size, grpc_millis deadline,
+    grpc_closure* on_complete, grpc_httpcli_response* response);
 
 void grpc_httpcli_set_override(grpc_httpcli_get_override get,
                                grpc_httpcli_post_override post);
diff --git a/src/core/lib/http/httpcli_security_connector.cc b/src/core/lib/http/httpcli_security_connector.cc
index d832dac..d029323 100644
--- a/src/core/lib/http/httpcli_security_connector.cc
+++ b/src/core/lib/http/httpcli_security_connector.cc
@@ -34,14 +34,14 @@
 
 typedef struct {
   grpc_channel_security_connector base;
-  tsi_ssl_client_handshaker_factory *handshaker_factory;
-  char *secure_peer_name;
+  tsi_ssl_client_handshaker_factory* handshaker_factory;
+  char* secure_peer_name;
 } grpc_httpcli_ssl_channel_security_connector;
 
-static void httpcli_ssl_destroy(grpc_exec_ctx *exec_ctx,
-                                grpc_security_connector *sc) {
-  grpc_httpcli_ssl_channel_security_connector *c =
-      (grpc_httpcli_ssl_channel_security_connector *)sc;
+static void httpcli_ssl_destroy(grpc_exec_ctx* exec_ctx,
+                                grpc_security_connector* sc) {
+  grpc_httpcli_ssl_channel_security_connector* c =
+      (grpc_httpcli_ssl_channel_security_connector*)sc;
   if (c->handshaker_factory != NULL) {
     tsi_ssl_client_handshaker_factory_unref(c->handshaker_factory);
     c->handshaker_factory = NULL;
@@ -50,12 +50,12 @@
   gpr_free(sc);
 }
 
-static void httpcli_ssl_add_handshakers(grpc_exec_ctx *exec_ctx,
-                                        grpc_channel_security_connector *sc,
-                                        grpc_handshake_manager *handshake_mgr) {
-  grpc_httpcli_ssl_channel_security_connector *c =
-      (grpc_httpcli_ssl_channel_security_connector *)sc;
-  tsi_handshaker *handshaker = NULL;
+static void httpcli_ssl_add_handshakers(grpc_exec_ctx* exec_ctx,
+                                        grpc_channel_security_connector* sc,
+                                        grpc_handshake_manager* handshake_mgr) {
+  grpc_httpcli_ssl_channel_security_connector* c =
+      (grpc_httpcli_ssl_channel_security_connector*)sc;
+  tsi_handshaker* handshaker = NULL;
   if (c->handshaker_factory != NULL) {
     tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker(
         c->handshaker_factory, c->secure_peer_name, &handshaker);
@@ -70,18 +70,18 @@
           exec_ctx, tsi_create_adapter_handshaker(handshaker), &sc->base));
 }
 
-static void httpcli_ssl_check_peer(grpc_exec_ctx *exec_ctx,
-                                   grpc_security_connector *sc, tsi_peer peer,
-                                   grpc_auth_context **auth_context,
-                                   grpc_closure *on_peer_checked) {
-  grpc_httpcli_ssl_channel_security_connector *c =
-      (grpc_httpcli_ssl_channel_security_connector *)sc;
-  grpc_error *error = GRPC_ERROR_NONE;
+static void httpcli_ssl_check_peer(grpc_exec_ctx* exec_ctx,
+                                   grpc_security_connector* sc, tsi_peer peer,
+                                   grpc_auth_context** auth_context,
+                                   grpc_closure* on_peer_checked) {
+  grpc_httpcli_ssl_channel_security_connector* c =
+      (grpc_httpcli_ssl_channel_security_connector*)sc;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   /* Check the peer name. */
   if (c->secure_peer_name != NULL &&
       !tsi_ssl_peer_matches_name(&peer, c->secure_peer_name)) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "Peer name %s is not in peer certificate",
                  c->secure_peer_name);
     error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
@@ -91,12 +91,12 @@
   tsi_peer_destruct(&peer);
 }
 
-static int httpcli_ssl_cmp(grpc_security_connector *sc1,
-                           grpc_security_connector *sc2) {
-  grpc_httpcli_ssl_channel_security_connector *c1 =
-      (grpc_httpcli_ssl_channel_security_connector *)sc1;
-  grpc_httpcli_ssl_channel_security_connector *c2 =
-      (grpc_httpcli_ssl_channel_security_connector *)sc2;
+static int httpcli_ssl_cmp(grpc_security_connector* sc1,
+                           grpc_security_connector* sc2) {
+  grpc_httpcli_ssl_channel_security_connector* c1 =
+      (grpc_httpcli_ssl_channel_security_connector*)sc1;
+  grpc_httpcli_ssl_channel_security_connector* c2 =
+      (grpc_httpcli_ssl_channel_security_connector*)sc2;
   return strcmp(c1->secure_peer_name, c2->secure_peer_name);
 }
 
@@ -104,10 +104,10 @@
     httpcli_ssl_destroy, httpcli_ssl_check_peer, httpcli_ssl_cmp};
 
 static grpc_security_status httpcli_ssl_channel_security_connector_create(
-    grpc_exec_ctx *exec_ctx, const char *pem_root_certs,
-    const char *secure_peer_name, grpc_channel_security_connector **sc) {
+    grpc_exec_ctx* exec_ctx, const char* pem_root_certs,
+    const char* secure_peer_name, grpc_channel_security_connector** sc) {
   tsi_result result = TSI_OK;
-  grpc_httpcli_ssl_channel_security_connector *c;
+  grpc_httpcli_ssl_channel_security_connector* c;
 
   if (secure_peer_name != NULL && pem_root_certs == NULL) {
     gpr_log(GPR_ERROR,
@@ -115,7 +115,7 @@
     return GRPC_SECURITY_ERROR;
   }
 
-  c = (grpc_httpcli_ssl_channel_security_connector *)gpr_zalloc(
+  c = (grpc_httpcli_ssl_channel_security_connector*)gpr_zalloc(
       sizeof(grpc_httpcli_ssl_channel_security_connector));
 
   gpr_ref_init(&c->base.base.refcount, 1);
@@ -135,7 +135,7 @@
   // We don't actually need a channel credentials object in this case,
   // but we set it to a non-NULL address so that we don't trigger
   // assertions in grpc_channel_security_connector_cmp().
-  c->base.channel_creds = (grpc_channel_credentials *)1;
+  c->base.channel_creds = (grpc_channel_credentials*)1;
   c->base.add_handshakers = httpcli_ssl_add_handshakers;
   *sc = &c->base;
   return GRPC_SECURITY_OK;
@@ -144,17 +144,17 @@
 /* handshaker */
 
 typedef struct {
-  void (*func)(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *endpoint);
-  void *arg;
-  grpc_handshake_manager *handshake_mgr;
+  void (*func)(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* endpoint);
+  void* arg;
+  grpc_handshake_manager* handshake_mgr;
 } on_done_closure;
 
-static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
-                              grpc_error *error) {
-  grpc_handshaker_args *args = (grpc_handshaker_args *)arg;
-  on_done_closure *c = (on_done_closure *)args->user_data;
+static void on_handshake_done(grpc_exec_ctx* exec_ctx, void* arg,
+                              grpc_error* error) {
+  grpc_handshaker_args* args = (grpc_handshaker_args*)arg;
+  on_done_closure* c = (on_done_closure*)args->user_data;
   if (error != GRPC_ERROR_NONE) {
-    const char *msg = grpc_error_string(error);
+    const char* msg = grpc_error_string(error);
     gpr_log(GPR_ERROR, "Secure transport setup failed: %s", msg);
 
     c->func(exec_ctx, c->arg, NULL);
@@ -168,13 +168,13 @@
   gpr_free(c);
 }
 
-static void ssl_handshake(grpc_exec_ctx *exec_ctx, void *arg,
-                          grpc_endpoint *tcp, const char *host,
+static void ssl_handshake(grpc_exec_ctx* exec_ctx, void* arg,
+                          grpc_endpoint* tcp, const char* host,
                           grpc_millis deadline,
-                          void (*on_done)(grpc_exec_ctx *exec_ctx, void *arg,
-                                          grpc_endpoint *endpoint)) {
-  on_done_closure *c = (on_done_closure *)gpr_malloc(sizeof(*c));
-  const char *pem_root_certs = grpc_get_default_ssl_roots();
+                          void (*on_done)(grpc_exec_ctx* exec_ctx, void* arg,
+                                          grpc_endpoint* endpoint)) {
+  on_done_closure* c = (on_done_closure*)gpr_malloc(sizeof(*c));
+  const char* pem_root_certs = grpc_get_default_ssl_roots();
   if (pem_root_certs == NULL) {
     gpr_log(GPR_ERROR, "Could not get default pem root certs.");
     on_done(exec_ctx, arg, NULL);
@@ -183,7 +183,7 @@
   }
   c->func = on_done;
   c->arg = arg;
-  grpc_channel_security_connector *sc = NULL;
+  grpc_channel_security_connector* sc = NULL;
   GPR_ASSERT(httpcli_ssl_channel_security_connector_create(
                  exec_ctx, pem_root_certs, host, &sc) == GRPC_SECURITY_OK);
   grpc_arg channel_arg = grpc_security_connector_to_arg(&sc->base);
diff --git a/src/core/lib/http/parser.cc b/src/core/lib/http/parser.cc
index 720e8e8..db60f5b 100644
--- a/src/core/lib/http/parser.cc
+++ b/src/core/lib/http/parser.cc
@@ -27,17 +27,17 @@
 
 grpc_core::TraceFlag grpc_http1_trace(false, "http1");
 
-static char *buf2str(void *buffer, size_t length) {
-  char *out = (char *)gpr_malloc(length + 1);
+static char* buf2str(void* buffer, size_t length) {
+  char* out = (char*)gpr_malloc(length + 1);
   memcpy(out, buffer, length);
   out[length] = 0;
   return out;
 }
 
-static grpc_error *handle_response_line(grpc_http_parser *parser) {
-  uint8_t *beg = parser->cur_line;
-  uint8_t *cur = beg;
-  uint8_t *end = beg + parser->cur_line_length;
+static grpc_error* handle_response_line(grpc_http_parser* parser) {
+  uint8_t* beg = parser->cur_line;
+  uint8_t* cur = beg;
+  uint8_t* end = beg + parser->cur_line_length;
 
   if (cur == end || *cur++ != 'H')
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Expected 'H'");
@@ -75,10 +75,10 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *handle_request_line(grpc_http_parser *parser) {
-  uint8_t *beg = parser->cur_line;
-  uint8_t *cur = beg;
-  uint8_t *end = beg + parser->cur_line_length;
+static grpc_error* handle_request_line(grpc_http_parser* parser) {
+  uint8_t* beg = parser->cur_line;
+  uint8_t* cur = beg;
+  uint8_t* end = beg + parser->cur_line_length;
   uint8_t vers_major = 0;
   uint8_t vers_minor = 0;
 
@@ -137,7 +137,7 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *handle_first_line(grpc_http_parser *parser) {
+static grpc_error* handle_first_line(grpc_http_parser* parser) {
   switch (parser->type) {
     case GRPC_HTTP_REQUEST:
       return handle_request_line(parser);
@@ -148,14 +148,14 @@
       return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Should never reach here"));
 }
 
-static grpc_error *add_header(grpc_http_parser *parser) {
-  uint8_t *beg = parser->cur_line;
-  uint8_t *cur = beg;
-  uint8_t *end = beg + parser->cur_line_length;
-  size_t *hdr_count = NULL;
-  grpc_http_header **hdrs = NULL;
+static grpc_error* add_header(grpc_http_parser* parser) {
+  uint8_t* beg = parser->cur_line;
+  uint8_t* cur = beg;
+  uint8_t* end = beg + parser->cur_line_length;
+  size_t* hdr_count = NULL;
+  grpc_http_header** hdrs = NULL;
   grpc_http_header hdr = {NULL, NULL};
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   GPR_ASSERT(cur != end);
 
@@ -197,7 +197,7 @@
   if (*hdr_count == parser->hdr_capacity) {
     parser->hdr_capacity =
         GPR_MAX(parser->hdr_capacity + 1, parser->hdr_capacity * 3 / 2);
-    *hdrs = (grpc_http_header *)gpr_realloc(
+    *hdrs = (grpc_http_header*)gpr_realloc(
         *hdrs, parser->hdr_capacity * sizeof(**hdrs));
   }
   (*hdrs)[(*hdr_count)++] = hdr;
@@ -210,9 +210,9 @@
   return error;
 }
 
-static grpc_error *finish_line(grpc_http_parser *parser,
-                               bool *found_body_start) {
-  grpc_error *err;
+static grpc_error* finish_line(grpc_http_parser* parser,
+                               bool* found_body_start) {
+  grpc_error* err;
   switch (parser->state) {
     case GRPC_HTTP_FIRST_LINE:
       err = handle_first_line(parser);
@@ -239,9 +239,9 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *addbyte_body(grpc_http_parser *parser, uint8_t byte) {
-  size_t *body_length = NULL;
-  char **body = NULL;
+static grpc_error* addbyte_body(grpc_http_parser* parser, uint8_t byte) {
+  size_t* body_length = NULL;
+  char** body = NULL;
 
   if (parser->type == GRPC_HTTP_RESPONSE) {
     body_length = &parser->http.response->body_length;
@@ -256,7 +256,7 @@
 
   if (*body_length == parser->body_capacity) {
     parser->body_capacity = GPR_MAX(8, parser->body_capacity * 3 / 2);
-    *body = (char *)gpr_realloc((void *)*body, parser->body_capacity);
+    *body = (char*)gpr_realloc((void*)*body, parser->body_capacity);
   }
   (*body)[*body_length] = (char)byte;
   (*body_length)++;
@@ -264,7 +264,7 @@
   return GRPC_ERROR_NONE;
 }
 
-static bool check_line(grpc_http_parser *parser) {
+static bool check_line(grpc_http_parser* parser) {
   if (parser->cur_line_length >= 2 &&
       parser->cur_line[parser->cur_line_length - 2] == '\r' &&
       parser->cur_line[parser->cur_line_length - 1] == '\n') {
@@ -288,8 +288,8 @@
   return false;
 }
 
-static grpc_error *addbyte(grpc_http_parser *parser, uint8_t byte,
-                           bool *found_body_start) {
+static grpc_error* addbyte(grpc_http_parser* parser, uint8_t byte,
+                           bool* found_body_start) {
   switch (parser->state) {
     case GRPC_HTTP_FIRST_LINE:
     case GRPC_HTTP_HEADERS:
@@ -312,8 +312,8 @@
   GPR_UNREACHABLE_CODE(return GRPC_ERROR_NONE);
 }
 
-void grpc_http_parser_init(grpc_http_parser *parser, grpc_http_type type,
-                           void *request_or_response) {
+void grpc_http_parser_init(grpc_http_parser* parser, grpc_http_type type,
+                           void* request_or_response) {
   memset(parser, 0, sizeof(*parser));
   parser->state = GRPC_HTTP_FIRST_LINE;
   parser->type = type;
@@ -321,9 +321,9 @@
   parser->cur_line_end_length = 2;
 }
 
-void grpc_http_parser_destroy(grpc_http_parser *parser) {}
+void grpc_http_parser_destroy(grpc_http_parser* parser) {}
 
-void grpc_http_request_destroy(grpc_http_request *request) {
+void grpc_http_request_destroy(grpc_http_request* request) {
   size_t i;
   gpr_free(request->body);
   for (i = 0; i < request->hdr_count; i++) {
@@ -335,7 +335,7 @@
   gpr_free(request->path);
 }
 
-void grpc_http_response_destroy(grpc_http_response *response) {
+void grpc_http_response_destroy(grpc_http_response* response) {
   size_t i;
   gpr_free(response->body);
   for (i = 0; i < response->hdr_count; i++) {
@@ -345,11 +345,11 @@
   gpr_free(response->hdrs);
 }
 
-grpc_error *grpc_http_parser_parse(grpc_http_parser *parser, grpc_slice slice,
-                                   size_t *start_of_body) {
+grpc_error* grpc_http_parser_parse(grpc_http_parser* parser, grpc_slice slice,
+                                   size_t* start_of_body) {
   for (size_t i = 0; i < GRPC_SLICE_LENGTH(slice); i++) {
     bool found_body_start = false;
-    grpc_error *err =
+    grpc_error* err =
         addbyte(parser, GRPC_SLICE_START_PTR(slice)[i], &found_body_start);
     if (err != GRPC_ERROR_NONE) return err;
     if (found_body_start && start_of_body != NULL) *start_of_body = i + 1;
@@ -357,7 +357,7 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_http_parser_eof(grpc_http_parser *parser) {
+grpc_error* grpc_http_parser_eof(grpc_http_parser* parser) {
   if (parser->state != GRPC_HTTP_BODY) {
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Did not finish headers");
   }
diff --git a/src/core/lib/http/parser.h b/src/core/lib/http/parser.h
index 044f159..391bd35 100644
--- a/src/core/lib/http/parser.h
+++ b/src/core/lib/http/parser.h
@@ -33,8 +33,8 @@
 
 /* A single header to be passed in a request */
 typedef struct grpc_http_header {
-  char *key;
-  char *value;
+  char* key;
+  char* value;
 } grpc_http_header;
 
 typedef enum {
@@ -57,17 +57,17 @@
 /* A request */
 typedef struct grpc_http_request {
   /* Method of the request (e.g. GET, POST) */
-  char *method;
+  char* method;
   /* The path of the resource to fetch */
-  char *path;
+  char* path;
   /* HTTP version to use */
   grpc_http_version version;
   /* Headers attached to the request */
   size_t hdr_count;
-  grpc_http_header *hdrs;
+  grpc_http_header* hdrs;
   /* Body: length and contents; contents are NOT null-terminated */
   size_t body_length;
-  char *body;
+  char* body;
 } grpc_http_request;
 
 /* A response */
@@ -76,10 +76,10 @@
   int status;
   /* Headers: count and key/values */
   size_t hdr_count;
-  grpc_http_header *hdrs;
+  grpc_http_header* hdrs;
   /* Body: length and contents; contents are NOT null-terminated */
   size_t body_length;
-  char *body;
+  char* body;
 } grpc_http_response;
 
 typedef struct {
@@ -87,9 +87,9 @@
   grpc_http_type type;
 
   union {
-    grpc_http_response *response;
-    grpc_http_request *request;
-    void *request_or_response;
+    grpc_http_response* response;
+    grpc_http_request* request;
+    void* request_or_response;
   } http;
   size_t body_capacity;
   size_t hdr_capacity;
@@ -99,17 +99,17 @@
   size_t cur_line_end_length;
 } grpc_http_parser;
 
-void grpc_http_parser_init(grpc_http_parser *parser, grpc_http_type type,
-                           void *request_or_response);
-void grpc_http_parser_destroy(grpc_http_parser *parser);
+void grpc_http_parser_init(grpc_http_parser* parser, grpc_http_type type,
+                           void* request_or_response);
+void grpc_http_parser_destroy(grpc_http_parser* parser);
 
 /* Sets \a start_of_body to the offset in \a slice of the start of the body. */
-grpc_error *grpc_http_parser_parse(grpc_http_parser *parser, grpc_slice slice,
-                                   size_t *start_of_body);
-grpc_error *grpc_http_parser_eof(grpc_http_parser *parser);
+grpc_error* grpc_http_parser_parse(grpc_http_parser* parser, grpc_slice slice,
+                                   size_t* start_of_body);
+grpc_error* grpc_http_parser_eof(grpc_http_parser* parser);
 
-void grpc_http_request_destroy(grpc_http_request *request);
-void grpc_http_response_destroy(grpc_http_response *response);
+void grpc_http_request_destroy(grpc_http_request* request);
+void grpc_http_response_destroy(grpc_http_response* response);
 
 extern grpc_core::TraceFlag grpc_http1_trace;
 
diff --git a/src/core/lib/iomgr/closure.cc b/src/core/lib/iomgr/closure.cc
index 47429b4..c5f127d 100644
--- a/src/core/lib/iomgr/closure.cc
+++ b/src/core/lib/iomgr/closure.cc
@@ -27,14 +27,14 @@
 grpc_core::DebugOnlyTraceFlag grpc_trace_closure(false, "closure");
 
 #ifndef NDEBUG
-grpc_closure *grpc_closure_init(const char *file, int line,
-                                grpc_closure *closure, grpc_iomgr_cb_func cb,
-                                void *cb_arg,
-                                grpc_closure_scheduler *scheduler) {
+grpc_closure* grpc_closure_init(const char* file, int line,
+                                grpc_closure* closure, grpc_iomgr_cb_func cb,
+                                void* cb_arg,
+                                grpc_closure_scheduler* scheduler) {
 #else
-grpc_closure *grpc_closure_init(grpc_closure *closure, grpc_iomgr_cb_func cb,
-                                void *cb_arg,
-                                grpc_closure_scheduler *scheduler) {
+grpc_closure* grpc_closure_init(grpc_closure* closure, grpc_iomgr_cb_func cb,
+                                void* cb_arg,
+                                grpc_closure_scheduler* scheduler) {
 #endif
   closure->cb = cb;
   closure->cb_arg = cb_arg;
@@ -50,12 +50,12 @@
   return closure;
 }
 
-void grpc_closure_list_init(grpc_closure_list *closure_list) {
+void grpc_closure_list_init(grpc_closure_list* closure_list) {
   closure_list->head = closure_list->tail = NULL;
 }
 
-bool grpc_closure_list_append(grpc_closure_list *closure_list,
-                              grpc_closure *closure, grpc_error *error) {
+bool grpc_closure_list_append(grpc_closure_list* closure_list,
+                              grpc_closure* closure, grpc_error* error) {
   if (closure == NULL) {
     GRPC_ERROR_UNREF(error);
     return false;
@@ -72,9 +72,9 @@
   return was_empty;
 }
 
-void grpc_closure_list_fail_all(grpc_closure_list *list,
-                                grpc_error *forced_failure) {
-  for (grpc_closure *c = list->head; c != NULL; c = c->next_data.next) {
+void grpc_closure_list_fail_all(grpc_closure_list* list,
+                                grpc_error* forced_failure) {
+  for (grpc_closure* c = list->head; c != NULL; c = c->next_data.next) {
     if (c->error_data.error == GRPC_ERROR_NONE) {
       c->error_data.error = GRPC_ERROR_REF(forced_failure);
     }
@@ -86,7 +86,7 @@
   return closure_list.head == NULL;
 }
 
-void grpc_closure_list_move(grpc_closure_list *src, grpc_closure_list *dst) {
+void grpc_closure_list_move(grpc_closure_list* src, grpc_closure_list* dst) {
   if (src->head == NULL) {
     return;
   }
@@ -101,28 +101,28 @@
 
 typedef struct {
   grpc_iomgr_cb_func cb;
-  void *cb_arg;
+  void* cb_arg;
   grpc_closure wrapper;
 } wrapped_closure;
 
-static void closure_wrapper(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_error *error) {
-  wrapped_closure *wc = (wrapped_closure *)arg;
+static void closure_wrapper(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_error* error) {
+  wrapped_closure* wc = (wrapped_closure*)arg;
   grpc_iomgr_cb_func cb = wc->cb;
-  void *cb_arg = wc->cb_arg;
+  void* cb_arg = wc->cb_arg;
   gpr_free(wc);
   cb(exec_ctx, cb_arg, error);
 }
 
 #ifndef NDEBUG
-grpc_closure *grpc_closure_create(const char *file, int line,
-                                  grpc_iomgr_cb_func cb, void *cb_arg,
-                                  grpc_closure_scheduler *scheduler) {
+grpc_closure* grpc_closure_create(const char* file, int line,
+                                  grpc_iomgr_cb_func cb, void* cb_arg,
+                                  grpc_closure_scheduler* scheduler) {
 #else
-grpc_closure *grpc_closure_create(grpc_iomgr_cb_func cb, void *cb_arg,
-                                  grpc_closure_scheduler *scheduler) {
+grpc_closure* grpc_closure_create(grpc_iomgr_cb_func cb, void* cb_arg,
+                                  grpc_closure_scheduler* scheduler) {
 #endif
-  wrapped_closure *wc = (wrapped_closure *)gpr_malloc(sizeof(*wc));
+  wrapped_closure* wc = (wrapped_closure*)gpr_malloc(sizeof(*wc));
   wc->cb = cb;
   wc->cb_arg = cb_arg;
 #ifndef NDEBUG
@@ -134,11 +134,11 @@
 }
 
 #ifndef NDEBUG
-void grpc_closure_run(const char *file, int line, grpc_exec_ctx *exec_ctx,
-                      grpc_closure *c, grpc_error *error) {
+void grpc_closure_run(const char* file, int line, grpc_exec_ctx* exec_ctx,
+                      grpc_closure* c, grpc_error* error) {
 #else
-void grpc_closure_run(grpc_exec_ctx *exec_ctx, grpc_closure *c,
-                      grpc_error *error) {
+void grpc_closure_run(grpc_exec_ctx* exec_ctx, grpc_closure* c,
+                      grpc_error* error) {
 #endif
   GPR_TIMER_BEGIN("grpc_closure_run", 0);
   if (c != NULL) {
@@ -156,11 +156,11 @@
 }
 
 #ifndef NDEBUG
-void grpc_closure_sched(const char *file, int line, grpc_exec_ctx *exec_ctx,
-                        grpc_closure *c, grpc_error *error) {
+void grpc_closure_sched(const char* file, int line, grpc_exec_ctx* exec_ctx,
+                        grpc_closure* c, grpc_error* error) {
 #else
-void grpc_closure_sched(grpc_exec_ctx *exec_ctx, grpc_closure *c,
-                        grpc_error *error) {
+void grpc_closure_sched(grpc_exec_ctx* exec_ctx, grpc_closure* c,
+                        grpc_error* error) {
 #endif
   GPR_TIMER_BEGIN("grpc_closure_sched", 0);
   if (c != NULL) {
@@ -187,14 +187,14 @@
 }
 
 #ifndef NDEBUG
-void grpc_closure_list_sched(const char *file, int line,
-                             grpc_exec_ctx *exec_ctx, grpc_closure_list *list) {
+void grpc_closure_list_sched(const char* file, int line,
+                             grpc_exec_ctx* exec_ctx, grpc_closure_list* list) {
 #else
-void grpc_closure_list_sched(grpc_exec_ctx *exec_ctx, grpc_closure_list *list) {
+void grpc_closure_list_sched(grpc_exec_ctx* exec_ctx, grpc_closure_list* list) {
 #endif
-  grpc_closure *c = list->head;
+  grpc_closure* c = list->head;
   while (c != NULL) {
-    grpc_closure *next = c->next_data.next;
+    grpc_closure* next = c->next_data.next;
 #ifndef NDEBUG
     if (c->scheduled) {
       gpr_log(GPR_ERROR,
diff --git a/src/core/lib/iomgr/closure.h b/src/core/lib/iomgr/closure.h
index 66484a2..527075e 100644
--- a/src/core/lib/iomgr/closure.h
+++ b/src/core/lib/iomgr/closure.h
@@ -38,8 +38,8 @@
 #endif
 
 typedef struct grpc_closure_list {
-  grpc_closure *head;
-  grpc_closure *tail;
+  grpc_closure* head;
+  grpc_closure* tail;
 } grpc_closure_list;
 
 /** gRPC Callback definition.
@@ -49,24 +49,24 @@
  *              describing what went wrong.
  *              Error contract: it is not the cb's job to unref this error;
  *              the closure scheduler will do that after the cb returns */
-typedef void (*grpc_iomgr_cb_func)(grpc_exec_ctx *exec_ctx, void *arg,
-                                   grpc_error *error);
+typedef void (*grpc_iomgr_cb_func)(grpc_exec_ctx* exec_ctx, void* arg,
+                                   grpc_error* error);
 
 typedef struct grpc_closure_scheduler grpc_closure_scheduler;
 
 typedef struct grpc_closure_scheduler_vtable {
   /* NOTE: for all these functions, closure->scheduler == the scheduler that was
            used to find this vtable */
-  void (*run)(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-              grpc_error *error);
-  void (*sched)(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                grpc_error *error);
-  const char *name;
+  void (*run)(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+              grpc_error* error);
+  void (*sched)(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                grpc_error* error);
+  const char* name;
 } grpc_closure_scheduler_vtable;
 
 /** Abstract type that can schedule closures for execution */
 struct grpc_closure_scheduler {
-  const grpc_closure_scheduler_vtable *vtable;
+  const grpc_closure_scheduler_vtable* vtable;
 };
 
 /** A closure over a grpc_iomgr_cb_func. */
@@ -74,7 +74,7 @@
   /** Once queued, next indicates the next queued closure; before then, scratch
    *  space */
   union {
-    grpc_closure *next;
+    grpc_closure* next;
     gpr_mpscq_node atm_next;
     uintptr_t scratch;
   } next_data;
@@ -83,15 +83,15 @@
   grpc_iomgr_cb_func cb;
 
   /** Arguments to be passed to "cb". */
-  void *cb_arg;
+  void* cb_arg;
 
   /** Scheduler to schedule against: NULL to schedule against current execution
       context */
-  grpc_closure_scheduler *scheduler;
+  grpc_closure_scheduler* scheduler;
 
   /** Once queued, the result of the closure. Before then: scratch space */
   union {
-    grpc_error *error;
+    grpc_error* error;
     uintptr_t scratch;
   } error_data;
 
@@ -100,39 +100,39 @@
 #ifndef NDEBUG
   bool scheduled;
   bool run;  // true = run, false = scheduled
-  const char *file_created;
+  const char* file_created;
   int line_created;
-  const char *file_initiated;
+  const char* file_initiated;
   int line_initiated;
 #endif
 };
 
 /** Initializes \a closure with \a cb and \a cb_arg. Returns \a closure. */
 #ifndef NDEBUG
-grpc_closure *grpc_closure_init(const char *file, int line,
-                                grpc_closure *closure, grpc_iomgr_cb_func cb,
-                                void *cb_arg,
-                                grpc_closure_scheduler *scheduler);
+grpc_closure* grpc_closure_init(const char* file, int line,
+                                grpc_closure* closure, grpc_iomgr_cb_func cb,
+                                void* cb_arg,
+                                grpc_closure_scheduler* scheduler);
 #define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler) \
   grpc_closure_init(__FILE__, __LINE__, closure, cb, cb_arg, scheduler)
 #else
-grpc_closure *grpc_closure_init(grpc_closure *closure, grpc_iomgr_cb_func cb,
-                                void *cb_arg,
-                                grpc_closure_scheduler *scheduler);
+grpc_closure* grpc_closure_init(grpc_closure* closure, grpc_iomgr_cb_func cb,
+                                void* cb_arg,
+                                grpc_closure_scheduler* scheduler);
 #define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler) \
   grpc_closure_init(closure, cb, cb_arg, scheduler)
 #endif
 
 /* Create a heap allocated closure: try to avoid except for very rare events */
 #ifndef NDEBUG
-grpc_closure *grpc_closure_create(const char *file, int line,
-                                  grpc_iomgr_cb_func cb, void *cb_arg,
-                                  grpc_closure_scheduler *scheduler);
+grpc_closure* grpc_closure_create(const char* file, int line,
+                                  grpc_iomgr_cb_func cb, void* cb_arg,
+                                  grpc_closure_scheduler* scheduler);
 #define GRPC_CLOSURE_CREATE(cb, cb_arg, scheduler) \
   grpc_closure_create(__FILE__, __LINE__, cb, cb_arg, scheduler)
 #else
-grpc_closure *grpc_closure_create(grpc_iomgr_cb_func cb, void *cb_arg,
-                                  grpc_closure_scheduler *scheduler);
+grpc_closure* grpc_closure_create(grpc_iomgr_cb_func cb, void* cb_arg,
+                                  grpc_closure_scheduler* scheduler);
 #define GRPC_CLOSURE_CREATE(cb, cb_arg, scheduler) \
   grpc_closure_create(cb, cb_arg, scheduler)
 #endif
@@ -140,20 +140,20 @@
 #define GRPC_CLOSURE_LIST_INIT \
   { NULL, NULL }
 
-void grpc_closure_list_init(grpc_closure_list *list);
+void grpc_closure_list_init(grpc_closure_list* list);
 
 /** add \a closure to the end of \a list
     and set \a closure's result to \a error
     Returns true if \a list becomes non-empty */
-bool grpc_closure_list_append(grpc_closure_list *list, grpc_closure *closure,
-                              grpc_error *error);
+bool grpc_closure_list_append(grpc_closure_list* list, grpc_closure* closure,
+                              grpc_error* error);
 
 /** force all success bits in \a list to false */
-void grpc_closure_list_fail_all(grpc_closure_list *list,
-                                grpc_error *forced_failure);
+void grpc_closure_list_fail_all(grpc_closure_list* list,
+                                grpc_error* forced_failure);
 
 /** append all closures from \a src to \a dst and empty \a src. */
-void grpc_closure_list_move(grpc_closure_list *src, grpc_closure_list *dst);
+void grpc_closure_list_move(grpc_closure_list* src, grpc_closure_list* dst);
 
 /** return whether \a list is empty. */
 bool grpc_closure_list_empty(grpc_closure_list list);
@@ -162,26 +162,26 @@
  *  Note that calling this at the end of a closure callback function itself is
  *  by definition safe. */
 #ifndef NDEBUG
-void grpc_closure_run(const char *file, int line, grpc_exec_ctx *exec_ctx,
-                      grpc_closure *closure, grpc_error *error);
+void grpc_closure_run(const char* file, int line, grpc_exec_ctx* exec_ctx,
+                      grpc_closure* closure, grpc_error* error);
 #define GRPC_CLOSURE_RUN(exec_ctx, closure, error) \
   grpc_closure_run(__FILE__, __LINE__, exec_ctx, closure, error)
 #else
-void grpc_closure_run(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                      grpc_error *error);
+void grpc_closure_run(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                      grpc_error* error);
 #define GRPC_CLOSURE_RUN(exec_ctx, closure, error) \
   grpc_closure_run(exec_ctx, closure, error)
 #endif
 
 /** Schedule a closure to be run. Does not need to be run from a safe point. */
 #ifndef NDEBUG
-void grpc_closure_sched(const char *file, int line, grpc_exec_ctx *exec_ctx,
-                        grpc_closure *closure, grpc_error *error);
+void grpc_closure_sched(const char* file, int line, grpc_exec_ctx* exec_ctx,
+                        grpc_closure* closure, grpc_error* error);
 #define GRPC_CLOSURE_SCHED(exec_ctx, closure, error) \
   grpc_closure_sched(__FILE__, __LINE__, exec_ctx, closure, error)
 #else
-void grpc_closure_sched(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                        grpc_error *error);
+void grpc_closure_sched(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                        grpc_error* error);
 #define GRPC_CLOSURE_SCHED(exec_ctx, closure, error) \
   grpc_closure_sched(exec_ctx, closure, error)
 #endif
@@ -189,14 +189,14 @@
 /** Schedule all closures in a list to be run. Does not need to be run from a
  * safe point. */
 #ifndef NDEBUG
-void grpc_closure_list_sched(const char *file, int line,
-                             grpc_exec_ctx *exec_ctx,
-                             grpc_closure_list *closure_list);
+void grpc_closure_list_sched(const char* file, int line,
+                             grpc_exec_ctx* exec_ctx,
+                             grpc_closure_list* closure_list);
 #define GRPC_CLOSURE_LIST_SCHED(exec_ctx, closure_list) \
   grpc_closure_list_sched(__FILE__, __LINE__, exec_ctx, closure_list)
 #else
-void grpc_closure_list_sched(grpc_exec_ctx *exec_ctx,
-                             grpc_closure_list *closure_list);
+void grpc_closure_list_sched(grpc_exec_ctx* exec_ctx,
+                             grpc_closure_list* closure_list);
 #define GRPC_CLOSURE_LIST_SCHED(exec_ctx, closure_list) \
   grpc_closure_list_sched(exec_ctx, closure_list)
 #endif
diff --git a/src/core/lib/iomgr/combiner.cc b/src/core/lib/iomgr/combiner.cc
index 30e3b91..ab583de 100644
--- a/src/core/lib/iomgr/combiner.cc
+++ b/src/core/lib/iomgr/combiner.cc
@@ -42,7 +42,7 @@
 #define STATE_ELEM_COUNT_LOW_BIT 2
 
 struct grpc_combiner {
-  grpc_combiner *next_combiner_on_this_exec_ctx;
+  grpc_combiner* next_combiner_on_this_exec_ctx;
   grpc_closure_scheduler scheduler;
   grpc_closure_scheduler finally_scheduler;
   gpr_mpscq queue;
@@ -61,20 +61,20 @@
   gpr_refcount refs;
 };
 
-static void combiner_exec(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                          grpc_error *error);
-static void combiner_finally_exec(grpc_exec_ctx *exec_ctx,
-                                  grpc_closure *closure, grpc_error *error);
+static void combiner_exec(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                          grpc_error* error);
+static void combiner_finally_exec(grpc_exec_ctx* exec_ctx,
+                                  grpc_closure* closure, grpc_error* error);
 
 static const grpc_closure_scheduler_vtable scheduler = {
     combiner_exec, combiner_exec, "combiner:immediately"};
 static const grpc_closure_scheduler_vtable finally_scheduler = {
     combiner_finally_exec, combiner_finally_exec, "combiner:finally"};
 
-static void offload(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error);
+static void offload(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error);
 
-grpc_combiner *grpc_combiner_create(void) {
-  grpc_combiner *lock = (grpc_combiner *)gpr_zalloc(sizeof(*lock));
+grpc_combiner* grpc_combiner_create(void) {
+  grpc_combiner* lock = (grpc_combiner*)gpr_zalloc(sizeof(*lock));
   gpr_ref_init(&lock->refs, 1);
   lock->scheduler.vtable = &scheduler;
   lock->finally_scheduler.vtable = &finally_scheduler;
@@ -87,14 +87,14 @@
   return lock;
 }
 
-static void really_destroy(grpc_exec_ctx *exec_ctx, grpc_combiner *lock) {
+static void really_destroy(grpc_exec_ctx* exec_ctx, grpc_combiner* lock) {
   GRPC_COMBINER_TRACE(gpr_log(GPR_DEBUG, "C:%p really_destroy", lock));
   GPR_ASSERT(gpr_atm_no_barrier_load(&lock->state) == 0);
   gpr_mpscq_destroy(&lock->queue);
   gpr_free(lock);
 }
 
-static void start_destroy(grpc_exec_ctx *exec_ctx, grpc_combiner *lock) {
+static void start_destroy(grpc_exec_ctx* exec_ctx, grpc_combiner* lock) {
   gpr_atm old_state = gpr_atm_full_fetch_add(&lock->state, -STATE_UNORPHANED);
   GRPC_COMBINER_TRACE(gpr_log(
       GPR_DEBUG, "C:%p really_destroy old_state=%" PRIdPTR, lock, old_state));
@@ -115,22 +115,22 @@
 #define GRPC_COMBINER_DEBUG_SPAM(op, delta)
 #endif
 
-void grpc_combiner_unref(grpc_exec_ctx *exec_ctx,
-                         grpc_combiner *lock GRPC_COMBINER_DEBUG_ARGS) {
+void grpc_combiner_unref(grpc_exec_ctx* exec_ctx,
+                         grpc_combiner* lock GRPC_COMBINER_DEBUG_ARGS) {
   GRPC_COMBINER_DEBUG_SPAM("UNREF", -1);
   if (gpr_unref(&lock->refs)) {
     start_destroy(exec_ctx, lock);
   }
 }
 
-grpc_combiner *grpc_combiner_ref(grpc_combiner *lock GRPC_COMBINER_DEBUG_ARGS) {
+grpc_combiner* grpc_combiner_ref(grpc_combiner* lock GRPC_COMBINER_DEBUG_ARGS) {
   GRPC_COMBINER_DEBUG_SPAM("  REF", 1);
   gpr_ref(&lock->refs);
   return lock;
 }
 
-static void push_last_on_exec_ctx(grpc_exec_ctx *exec_ctx,
-                                  grpc_combiner *lock) {
+static void push_last_on_exec_ctx(grpc_exec_ctx* exec_ctx,
+                                  grpc_combiner* lock) {
   lock->next_combiner_on_this_exec_ctx = NULL;
   if (exec_ctx->active_combiner == NULL) {
     exec_ctx->active_combiner = exec_ctx->last_combiner = lock;
@@ -140,8 +140,8 @@
   }
 }
 
-static void push_first_on_exec_ctx(grpc_exec_ctx *exec_ctx,
-                                   grpc_combiner *lock) {
+static void push_first_on_exec_ctx(grpc_exec_ctx* exec_ctx,
+                                   grpc_combiner* lock) {
   lock->next_combiner_on_this_exec_ctx = exec_ctx->active_combiner;
   exec_ctx->active_combiner = lock;
   if (lock->next_combiner_on_this_exec_ctx == NULL) {
@@ -150,14 +150,14 @@
 }
 
 #define COMBINER_FROM_CLOSURE_SCHEDULER(closure, scheduler_name) \
-  ((grpc_combiner *)(((char *)((closure)->scheduler)) -          \
-                     offsetof(grpc_combiner, scheduler_name)))
+  ((grpc_combiner*)(((char*)((closure)->scheduler)) -            \
+                    offsetof(grpc_combiner, scheduler_name)))
 
-static void combiner_exec(grpc_exec_ctx *exec_ctx, grpc_closure *cl,
-                          grpc_error *error) {
+static void combiner_exec(grpc_exec_ctx* exec_ctx, grpc_closure* cl,
+                          grpc_error* error) {
   GRPC_STATS_INC_COMBINER_LOCKS_SCHEDULED_ITEMS(exec_ctx);
   GPR_TIMER_BEGIN("combiner.execute", 0);
-  grpc_combiner *lock = COMBINER_FROM_CLOSURE_SCHEDULER(cl, scheduler);
+  grpc_combiner* lock = COMBINER_FROM_CLOSURE_SCHEDULER(cl, scheduler);
   gpr_atm last = gpr_atm_full_fetch_add(&lock->state, STATE_ELEM_COUNT_LOW_BIT);
   GRPC_COMBINER_TRACE(gpr_log(GPR_DEBUG,
                               "C:%p grpc_combiner_execute c=%p last=%" PRIdPTR,
@@ -186,7 +186,7 @@
   GPR_TIMER_END("combiner.execute", 0);
 }
 
-static void move_next(grpc_exec_ctx *exec_ctx) {
+static void move_next(grpc_exec_ctx* exec_ctx) {
   exec_ctx->active_combiner =
       exec_ctx->active_combiner->next_combiner_on_this_exec_ctx;
   if (exec_ctx->active_combiner == NULL) {
@@ -194,21 +194,21 @@
   }
 }
 
-static void offload(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_combiner *lock = (grpc_combiner *)arg;
+static void offload(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_combiner* lock = (grpc_combiner*)arg;
   push_last_on_exec_ctx(exec_ctx, lock);
 }
 
-static void queue_offload(grpc_exec_ctx *exec_ctx, grpc_combiner *lock) {
+static void queue_offload(grpc_exec_ctx* exec_ctx, grpc_combiner* lock) {
   GRPC_STATS_INC_COMBINER_LOCKS_OFFLOADED(exec_ctx);
   move_next(exec_ctx);
   GRPC_COMBINER_TRACE(gpr_log(GPR_DEBUG, "C:%p queue_offload", lock));
   GRPC_CLOSURE_SCHED(exec_ctx, &lock->offload, GRPC_ERROR_NONE);
 }
 
-bool grpc_combiner_continue_exec_ctx(grpc_exec_ctx *exec_ctx) {
+bool grpc_combiner_continue_exec_ctx(grpc_exec_ctx* exec_ctx) {
   GPR_TIMER_BEGIN("combiner.continue_exec_ctx", 0);
-  grpc_combiner *lock = exec_ctx->active_combiner;
+  grpc_combiner* lock = exec_ctx->active_combiner;
   if (lock == NULL) {
     GPR_TIMER_END("combiner.continue_exec_ctx", 0);
     return false;
@@ -240,7 +240,7 @@
       // peek to see if something new has shown up, and execute that with
       // priority
       (gpr_atm_acq_load(&lock->state) >> 1) > 1) {
-    gpr_mpscq_node *n = gpr_mpscq_pop(&lock->queue);
+    gpr_mpscq_node* n = gpr_mpscq_pop(&lock->queue);
     GRPC_COMBINER_TRACE(
         gpr_log(GPR_DEBUG, "C:%p maybe_finish_one n=%p", lock, n));
     if (n == NULL) {
@@ -252,8 +252,8 @@
       return true;
     }
     GPR_TIMER_BEGIN("combiner.exec1", 0);
-    grpc_closure *cl = (grpc_closure *)n;
-    grpc_error *cl_err = cl->error_data.error;
+    grpc_closure* cl = (grpc_closure*)n;
+    grpc_error* cl_err = cl->error_data.error;
 #ifndef NDEBUG
     cl->scheduled = false;
 #endif
@@ -261,7 +261,7 @@
     GRPC_ERROR_UNREF(cl_err);
     GPR_TIMER_END("combiner.exec1", 0);
   } else {
-    grpc_closure *c = lock->final_list.head;
+    grpc_closure* c = lock->final_list.head;
     GPR_ASSERT(c != NULL);
     grpc_closure_list_init(&lock->final_list);
     int loops = 0;
@@ -269,8 +269,8 @@
       GPR_TIMER_BEGIN("combiner.exec_1final", 0);
       GRPC_COMBINER_TRACE(
           gpr_log(GPR_DEBUG, "C:%p execute_final[%d] c=%p", lock, loops, c));
-      grpc_closure *next = c->next_data.next;
-      grpc_error *error = c->error_data.error;
+      grpc_closure* next = c->next_data.next;
+      grpc_error* error = c->error_data.error;
 #ifndef NDEBUG
       c->scheduled = false;
 #endif
@@ -326,13 +326,13 @@
   return true;
 }
 
-static void enqueue_finally(grpc_exec_ctx *exec_ctx, void *closure,
-                            grpc_error *error);
+static void enqueue_finally(grpc_exec_ctx* exec_ctx, void* closure,
+                            grpc_error* error);
 
-static void combiner_finally_exec(grpc_exec_ctx *exec_ctx,
-                                  grpc_closure *closure, grpc_error *error) {
+static void combiner_finally_exec(grpc_exec_ctx* exec_ctx,
+                                  grpc_closure* closure, grpc_error* error) {
   GRPC_STATS_INC_COMBINER_LOCKS_SCHEDULED_FINAL_ITEMS(exec_ctx);
-  grpc_combiner *lock =
+  grpc_combiner* lock =
       COMBINER_FROM_CLOSURE_SCHEDULER(closure, finally_scheduler);
   GRPC_COMBINER_TRACE(gpr_log(GPR_DEBUG,
                               "C:%p grpc_combiner_execute_finally c=%p; ac=%p",
@@ -355,17 +355,17 @@
   GPR_TIMER_END("combiner.execute_finally", 0);
 }
 
-static void enqueue_finally(grpc_exec_ctx *exec_ctx, void *closure,
-                            grpc_error *error) {
-  combiner_finally_exec(exec_ctx, (grpc_closure *)closure,
+static void enqueue_finally(grpc_exec_ctx* exec_ctx, void* closure,
+                            grpc_error* error) {
+  combiner_finally_exec(exec_ctx, (grpc_closure*)closure,
                         GRPC_ERROR_REF(error));
 }
 
-grpc_closure_scheduler *grpc_combiner_scheduler(grpc_combiner *combiner) {
+grpc_closure_scheduler* grpc_combiner_scheduler(grpc_combiner* combiner) {
   return &combiner->scheduler;
 }
 
-grpc_closure_scheduler *grpc_combiner_finally_scheduler(
-    grpc_combiner *combiner) {
+grpc_closure_scheduler* grpc_combiner_finally_scheduler(
+    grpc_combiner* combiner) {
   return &combiner->finally_scheduler;
 }
diff --git a/src/core/lib/iomgr/combiner.h b/src/core/lib/iomgr/combiner.h
index 8eeb0df..e99b063 100644
--- a/src/core/lib/iomgr/combiner.h
+++ b/src/core/lib/iomgr/combiner.h
@@ -37,7 +37,7 @@
 
 // Initialize the lock, with an optional workqueue to shift load to when
 // necessary
-grpc_combiner *grpc_combiner_create(void);
+grpc_combiner* grpc_combiner_create(void);
 
 #ifndef NDEBUG
 #define GRPC_COMBINER_DEBUG_ARGS \
@@ -55,15 +55,15 @@
 
 // Ref/unref the lock, for when we're sharing the lock ownership
 // Prefer to use the macros above
-grpc_combiner *grpc_combiner_ref(grpc_combiner *lock GRPC_COMBINER_DEBUG_ARGS);
-void grpc_combiner_unref(grpc_exec_ctx *exec_ctx,
-                         grpc_combiner *lock GRPC_COMBINER_DEBUG_ARGS);
+grpc_combiner* grpc_combiner_ref(grpc_combiner* lock GRPC_COMBINER_DEBUG_ARGS);
+void grpc_combiner_unref(grpc_exec_ctx* exec_ctx,
+                         grpc_combiner* lock GRPC_COMBINER_DEBUG_ARGS);
 // Fetch a scheduler to schedule closures against
-grpc_closure_scheduler *grpc_combiner_scheduler(grpc_combiner *lock);
+grpc_closure_scheduler* grpc_combiner_scheduler(grpc_combiner* lock);
 // Scheduler to execute \a action within the lock just prior to unlocking.
-grpc_closure_scheduler *grpc_combiner_finally_scheduler(grpc_combiner *lock);
+grpc_closure_scheduler* grpc_combiner_finally_scheduler(grpc_combiner* lock);
 
-bool grpc_combiner_continue_exec_ctx(grpc_exec_ctx *exec_ctx);
+bool grpc_combiner_continue_exec_ctx(grpc_exec_ctx* exec_ctx);
 
 extern grpc_core::TraceFlag grpc_combiner_trace;
 
diff --git a/src/core/lib/iomgr/endpoint.cc b/src/core/lib/iomgr/endpoint.cc
index 37cce33..5eab1d3 100644
--- a/src/core/lib/iomgr/endpoint.cc
+++ b/src/core/lib/iomgr/endpoint.cc
@@ -39,6 +39,12 @@
   ep->vtable->add_to_pollset_set(exec_ctx, ep, pollset_set);
 }
 
+void grpc_endpoint_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                           grpc_endpoint* ep,
+                                           grpc_pollset_set* pollset_set) {
+  ep->vtable->delete_from_pollset_set(exec_ctx, ep, pollset_set);
+}
+
 void grpc_endpoint_shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
                             grpc_error* why) {
   ep->vtable->shutdown(exec_ctx, ep, why);
diff --git a/src/core/lib/iomgr/endpoint.h b/src/core/lib/iomgr/endpoint.h
index 21347d9..1b0a9e7 100644
--- a/src/core/lib/iomgr/endpoint.h
+++ b/src/core/lib/iomgr/endpoint.h
@@ -37,19 +37,21 @@
 typedef struct grpc_endpoint_vtable grpc_endpoint_vtable;
 
 struct grpc_endpoint_vtable {
-  void (*read)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-               grpc_slice_buffer *slices, grpc_closure *cb);
-  void (*write)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                grpc_slice_buffer *slices, grpc_closure *cb);
-  void (*add_to_pollset)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                         grpc_pollset *pollset);
-  void (*add_to_pollset_set)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                             grpc_pollset_set *pollset);
-  void (*shutdown)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, grpc_error *why);
-  void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep);
-  grpc_resource_user *(*get_resource_user)(grpc_endpoint *ep);
-  char *(*get_peer)(grpc_endpoint *ep);
-  int (*get_fd)(grpc_endpoint *ep);
+  void (*read)(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+               grpc_slice_buffer* slices, grpc_closure* cb);
+  void (*write)(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                grpc_slice_buffer* slices, grpc_closure* cb);
+  void (*add_to_pollset)(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                         grpc_pollset* pollset);
+  void (*add_to_pollset_set)(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                             grpc_pollset_set* pollset);
+  void (*delete_from_pollset_set)(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                  grpc_pollset_set* pollset);
+  void (*shutdown)(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep, grpc_error* why);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep);
+  grpc_resource_user* (*get_resource_user)(grpc_endpoint* ep);
+  char* (*get_peer)(grpc_endpoint* ep);
+  int (*get_fd)(grpc_endpoint* ep);
 };
 
 /* When data is available on the connection, calls the callback with slices.
@@ -57,14 +59,14 @@
    indicates the endpoint is closed.
    Valid slices may be placed into \a slices even when the callback is
    invoked with error != GRPC_ERROR_NONE. */
-void grpc_endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                        grpc_slice_buffer *slices, grpc_closure *cb);
+void grpc_endpoint_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                        grpc_slice_buffer* slices, grpc_closure* cb);
 
-char *grpc_endpoint_get_peer(grpc_endpoint *ep);
+char* grpc_endpoint_get_peer(grpc_endpoint* ep);
 
 /* Get the file descriptor used by \a ep. Return -1 if \a ep is not using an fd.
-   */
-int grpc_endpoint_get_fd(grpc_endpoint *ep);
+ */
+int grpc_endpoint_get_fd(grpc_endpoint* ep);
 
 /* Write slices out to the socket.
 
@@ -76,27 +78,32 @@
    No guarantee is made to the content of slices after a write EXCEPT that
    it is a valid slice buffer.
    */
-void grpc_endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                         grpc_slice_buffer *slices, grpc_closure *cb);
+void grpc_endpoint_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                         grpc_slice_buffer* slices, grpc_closure* cb);
 
 /* Causes any pending and future read/write callbacks to run immediately with
    success==0 */
-void grpc_endpoint_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                            grpc_error *why);
-void grpc_endpoint_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep);
+void grpc_endpoint_shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                            grpc_error* why);
+void grpc_endpoint_destroy(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep);
 
-/* Add an endpoint to a pollset, so that when the pollset is polled, events from
-   this endpoint are considered */
-void grpc_endpoint_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                  grpc_pollset *pollset);
-void grpc_endpoint_add_to_pollset_set(grpc_exec_ctx *exec_ctx,
-                                      grpc_endpoint *ep,
-                                      grpc_pollset_set *pollset_set);
+/* Add an endpoint to a pollset or pollset_set, so that when the pollset is
+   polled, events from this endpoint are considered */
+void grpc_endpoint_add_to_pollset(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                  grpc_pollset* pollset);
+void grpc_endpoint_add_to_pollset_set(grpc_exec_ctx* exec_ctx,
+                                      grpc_endpoint* ep,
+                                      grpc_pollset_set* pollset_set);
 
-grpc_resource_user *grpc_endpoint_get_resource_user(grpc_endpoint *endpoint);
+/* Delete an endpoint from a pollset_set */
+void grpc_endpoint_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                           grpc_endpoint* ep,
+                                           grpc_pollset_set* pollset_set);
+
+grpc_resource_user* grpc_endpoint_get_resource_user(grpc_endpoint* endpoint);
 
 struct grpc_endpoint {
-  const grpc_endpoint_vtable *vtable;
+  const grpc_endpoint_vtable* vtable;
 };
 
 #ifdef __cplusplus
diff --git a/src/core/lib/iomgr/endpoint_pair.h b/src/core/lib/iomgr/endpoint_pair.h
index ee91795..219eea8 100644
--- a/src/core/lib/iomgr/endpoint_pair.h
+++ b/src/core/lib/iomgr/endpoint_pair.h
@@ -26,12 +26,12 @@
 #endif
 
 typedef struct {
-  grpc_endpoint *client;
-  grpc_endpoint *server;
+  grpc_endpoint* client;
+  grpc_endpoint* server;
 } grpc_endpoint_pair;
 
-grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char *name,
-                                                   grpc_channel_args *args);
+grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
+                                                   grpc_channel_args* args);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/endpoint_pair_posix.cc b/src/core/lib/iomgr/endpoint_pair_posix.cc
index 3ade214..f5f59f9 100644
--- a/src/core/lib/iomgr/endpoint_pair_posix.cc
+++ b/src/core/lib/iomgr/endpoint_pair_posix.cc
@@ -47,11 +47,11 @@
   GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[1]) == GRPC_ERROR_NONE);
 }
 
-grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char *name,
-                                                   grpc_channel_args *args) {
+grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
+                                                   grpc_channel_args* args) {
   int sv[2];
   grpc_endpoint_pair p;
-  char *final_name;
+  char* final_name;
   create_sockets(sv);
 
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
diff --git a/src/core/lib/iomgr/endpoint_pair_uv.cc b/src/core/lib/iomgr/endpoint_pair_uv.cc
index ff72fe0..128a947 100644
--- a/src/core/lib/iomgr/endpoint_pair_uv.cc
+++ b/src/core/lib/iomgr/endpoint_pair_uv.cc
@@ -26,8 +26,8 @@
 
 #include "src/core/lib/iomgr/endpoint_pair.h"
 
-grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char *name,
-                                                   grpc_channel_args *args) {
+grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
+                                                   grpc_channel_args* args) {
   grpc_endpoint_pair endpoint_pair;
   // TODO(mlumish): implement this properly under libuv
   GPR_ASSERT(false &&
diff --git a/src/core/lib/iomgr/endpoint_pair_windows.cc b/src/core/lib/iomgr/endpoint_pair_windows.cc
index 782fa2f..afa995a 100644
--- a/src/core/lib/iomgr/endpoint_pair_windows.cc
+++ b/src/core/lib/iomgr/endpoint_pair_windows.cc
@@ -44,19 +44,19 @@
   memset(&addr, 0, sizeof(addr));
   addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
   addr.sin_family = AF_INET;
-  GPR_ASSERT(bind(lst_sock, (struct sockaddr *)&addr, sizeof(addr)) !=
+  GPR_ASSERT(bind(lst_sock, (struct sockaddr*)&addr, sizeof(addr)) !=
              SOCKET_ERROR);
   GPR_ASSERT(listen(lst_sock, SOMAXCONN) != SOCKET_ERROR);
-  GPR_ASSERT(getsockname(lst_sock, (struct sockaddr *)&addr, &addr_len) !=
+  GPR_ASSERT(getsockname(lst_sock, (struct sockaddr*)&addr, &addr_len) !=
              SOCKET_ERROR);
 
   cli_sock = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0,
                        WSA_FLAG_OVERLAPPED);
   GPR_ASSERT(cli_sock != INVALID_SOCKET);
 
-  GPR_ASSERT(WSAConnect(cli_sock, (struct sockaddr *)&addr, addr_len, NULL,
-                        NULL, NULL, NULL) == 0);
-  svr_sock = accept(lst_sock, (struct sockaddr *)&addr, &addr_len);
+  GPR_ASSERT(WSAConnect(cli_sock, (struct sockaddr*)&addr, addr_len, NULL, NULL,
+                        NULL, NULL) == 0);
+  svr_sock = accept(lst_sock, (struct sockaddr*)&addr, &addr_len);
   GPR_ASSERT(svr_sock != INVALID_SOCKET);
 
   closesocket(lst_sock);
@@ -68,7 +68,7 @@
 }
 
 grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(
-    const char *name, grpc_channel_args *channel_args) {
+    const char* name, grpc_channel_args* channel_args) {
   SOCKET sv[2];
   grpc_endpoint_pair p;
   create_sockets(sv);
diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc
index e1e2c65..72f9353 100644
--- a/src/core/lib/iomgr/error.cc
+++ b/src/core/lib/iomgr/error.cc
@@ -40,7 +40,7 @@
 grpc_core::DebugOnlyTraceFlag grpc_trace_error_refcount(false,
                                                         "error_refcount");
 
-static const char *error_int_name(grpc_error_ints key) {
+static const char* error_int_name(grpc_error_ints key) {
   switch (key) {
     case GRPC_ERROR_INT_ERRNO:
       return "errno";
@@ -78,7 +78,7 @@
   GPR_UNREACHABLE_CODE(return "unknown");
 }
 
-static const char *error_str_name(grpc_error_strs key) {
+static const char* error_str_name(grpc_error_strs key) {
   switch (key) {
     case GRPC_ERROR_STR_KEY:
       return "key";
@@ -110,7 +110,7 @@
   GPR_UNREACHABLE_CODE(return "unknown");
 }
 
-static const char *error_time_name(grpc_error_times key) {
+static const char* error_time_name(grpc_error_times key) {
   switch (key) {
     case GRPC_ERROR_TIME_CREATED:
       return "created";
@@ -120,13 +120,13 @@
   GPR_UNREACHABLE_CODE(return "unknown");
 }
 
-bool grpc_error_is_special(grpc_error *err) {
+bool grpc_error_is_special(grpc_error* err) {
   return err == GRPC_ERROR_NONE || err == GRPC_ERROR_OOM ||
          err == GRPC_ERROR_CANCELLED;
 }
 
 #ifndef NDEBUG
-grpc_error *grpc_error_ref(grpc_error *err, const char *file, int line) {
+grpc_error* grpc_error_ref(grpc_error* err, const char* file, int line) {
   if (grpc_error_is_special(err)) return err;
   if (grpc_trace_error_refcount.enabled()) {
     gpr_log(GPR_DEBUG, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d]", err,
@@ -137,17 +137,17 @@
   return err;
 }
 #else
-grpc_error *grpc_error_ref(grpc_error *err) {
+grpc_error* grpc_error_ref(grpc_error* err) {
   if (grpc_error_is_special(err)) return err;
   gpr_ref(&err->atomics.refs);
   return err;
 }
 #endif
 
-static void unref_errs(grpc_error *err) {
+static void unref_errs(grpc_error* err) {
   uint8_t slot = err->first_err;
   while (slot != UINT8_MAX) {
-    grpc_linked_error *lerr = (grpc_linked_error *)(err->arena + slot);
+    grpc_linked_error* lerr = (grpc_linked_error*)(err->arena + slot);
     GRPC_ERROR_UNREF(lerr->err);
     GPR_ASSERT(err->last_err == slot ? lerr->next == UINT8_MAX
                                      : lerr->next != UINT8_MAX);
@@ -161,25 +161,25 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void unref_strs(grpc_error *err) {
+static void unref_strs(grpc_error* err) {
   for (size_t which = 0; which < GRPC_ERROR_STR_MAX; ++which) {
     uint8_t slot = err->strs[which];
     if (slot != UINT8_MAX) {
-      unref_slice(*(grpc_slice *)(err->arena + slot));
+      unref_slice(*(grpc_slice*)(err->arena + slot));
     }
   }
 }
 
-static void error_destroy(grpc_error *err) {
+static void error_destroy(grpc_error* err) {
   GPR_ASSERT(!grpc_error_is_special(err));
   unref_errs(err);
   unref_strs(err);
-  gpr_free((void *)gpr_atm_acq_load(&err->atomics.error_string));
+  gpr_free((void*)gpr_atm_acq_load(&err->atomics.error_string));
   gpr_free(err);
 }
 
 #ifndef NDEBUG
-void grpc_error_unref(grpc_error *err, const char *file, int line) {
+void grpc_error_unref(grpc_error* err, const char* file, int line) {
   if (grpc_error_is_special(err)) return;
   if (grpc_trace_error_refcount.enabled()) {
     gpr_log(GPR_DEBUG, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d]", err,
@@ -191,7 +191,7 @@
   }
 }
 #else
-void grpc_error_unref(grpc_error *err) {
+void grpc_error_unref(grpc_error* err) {
   if (grpc_error_is_special(err)) return;
   if (gpr_unref(&err->atomics.refs)) {
     error_destroy(err);
@@ -199,7 +199,7 @@
 }
 #endif
 
-static uint8_t get_placement(grpc_error **err, size_t size) {
+static uint8_t get_placement(grpc_error** err, size_t size) {
   GPR_ASSERT(*err);
   uint8_t slots = (uint8_t)(size / sizeof(intptr_t));
   if ((*err)->arena_size + slots > (*err)->arena_capacity) {
@@ -209,9 +209,9 @@
       return UINT8_MAX;
     }
 #ifndef NDEBUG
-    grpc_error *orig = *err;
+    grpc_error* orig = *err;
 #endif
-    *err = (grpc_error *)gpr_realloc(
+    *err = (grpc_error*)gpr_realloc(
         *err, sizeof(grpc_error) + (*err)->arena_capacity * sizeof(intptr_t));
 #ifndef NDEBUG
     if (grpc_trace_error_refcount.enabled()) {
@@ -226,7 +226,7 @@
   return placement;
 }
 
-static void internal_set_int(grpc_error **err, grpc_error_ints which,
+static void internal_set_int(grpc_error** err, grpc_error_ints which,
                              intptr_t value) {
   uint8_t slot = (*err)->ints[which];
   if (slot == UINT8_MAX) {
@@ -241,36 +241,36 @@
   (*err)->arena[slot] = value;
 }
 
-static void internal_set_str(grpc_error **err, grpc_error_strs which,
+static void internal_set_str(grpc_error** err, grpc_error_strs which,
                              grpc_slice value) {
   uint8_t slot = (*err)->strs[which];
   if (slot == UINT8_MAX) {
     slot = get_placement(err, sizeof(value));
     if (slot == UINT8_MAX) {
-      const char *str = grpc_slice_to_c_string(value);
+      const char* str = grpc_slice_to_c_string(value);
       gpr_log(GPR_ERROR, "Error %p is full, dropping string {\"%s\":\"%s\"}",
               *err, error_str_name(which), str);
-      gpr_free((void *)str);
+      gpr_free((void*)str);
       return;
     }
   } else {
-    unref_slice(*(grpc_slice *)((*err)->arena + slot));
+    unref_slice(*(grpc_slice*)((*err)->arena + slot));
   }
   (*err)->strs[which] = slot;
   memcpy((*err)->arena + slot, &value, sizeof(value));
 }
 
-static char *fmt_time(gpr_timespec tm);
-static void internal_set_time(grpc_error **err, grpc_error_times which,
+static char* fmt_time(gpr_timespec tm);
+static void internal_set_time(grpc_error** err, grpc_error_times which,
                               gpr_timespec value) {
   uint8_t slot = (*err)->times[which];
   if (slot == UINT8_MAX) {
     slot = get_placement(err, sizeof(value));
     if (slot == UINT8_MAX) {
-      const char *time_str = fmt_time(value);
+      const char* time_str = fmt_time(value);
       gpr_log(GPR_ERROR, "Error %p is full, dropping \"%s\":\"%s\"}", *err,
               error_time_name(which), time_str);
-      gpr_free((void *)time_str);
+      gpr_free((void*)time_str);
       return;
     }
   }
@@ -278,7 +278,7 @@
   memcpy((*err)->arena + slot, &value, sizeof(value));
 }
 
-static void internal_add_error(grpc_error **err, grpc_error *new_err) {
+static void internal_add_error(grpc_error** err, grpc_error* new_err) {
   grpc_linked_error new_last = {new_err, UINT8_MAX};
   uint8_t slot = get_placement(err, sizeof(grpc_linked_error));
   if (slot == UINT8_MAX) {
@@ -293,8 +293,8 @@
     (*err)->first_err = slot;
   } else {
     GPR_ASSERT((*err)->last_err != UINT8_MAX);
-    grpc_linked_error *old_last =
-        (grpc_linked_error *)((*err)->arena + (*err)->last_err);
+    grpc_linked_error* old_last =
+        (grpc_linked_error*)((*err)->arena + (*err)->last_err);
     old_last->next = slot;
     (*err)->last_err = slot;
   }
@@ -314,14 +314,14 @@
 // It is very common to include and extra int and string in an error
 #define SURPLUS_CAPACITY (2 * SLOTS_PER_INT + SLOTS_PER_TIME)
 
-grpc_error *grpc_error_create(const char *file, int line, grpc_slice desc,
-                              grpc_error **referencing,
+grpc_error* grpc_error_create(const char* file, int line, grpc_slice desc,
+                              grpc_error** referencing,
                               size_t num_referencing) {
   GPR_TIMER_BEGIN("grpc_error_create", 0);
   uint8_t initial_arena_capacity = (uint8_t)(
       DEFAULT_ERROR_CAPACITY +
       (uint8_t)(num_referencing * SLOTS_PER_LINKED_ERROR) + SURPLUS_CAPACITY);
-  grpc_error *err = (grpc_error *)gpr_malloc(
+  grpc_error* err = (grpc_error*)gpr_malloc(
       sizeof(*err) + initial_arena_capacity * sizeof(intptr_t));
   if (err == NULL) {  // TODO(ctiller): make gpr_malloc return NULL
     return GRPC_ERROR_OOM;
@@ -362,27 +362,27 @@
   return err;
 }
 
-static void ref_strs(grpc_error *err) {
+static void ref_strs(grpc_error* err) {
   for (size_t i = 0; i < GRPC_ERROR_STR_MAX; ++i) {
     uint8_t slot = err->strs[i];
     if (slot != UINT8_MAX) {
-      grpc_slice_ref_internal(*(grpc_slice *)(err->arena + slot));
+      grpc_slice_ref_internal(*(grpc_slice*)(err->arena + slot));
     }
   }
 }
 
-static void ref_errs(grpc_error *err) {
+static void ref_errs(grpc_error* err) {
   uint8_t slot = err->first_err;
   while (slot != UINT8_MAX) {
-    grpc_linked_error *lerr = (grpc_linked_error *)(err->arena + slot);
+    grpc_linked_error* lerr = (grpc_linked_error*)(err->arena + slot);
     GRPC_ERROR_REF(lerr->err);
     slot = lerr->next;
   }
 }
 
-static grpc_error *copy_error_and_unref(grpc_error *in) {
+static grpc_error* copy_error_and_unref(grpc_error* in) {
   GPR_TIMER_BEGIN("copy_error_and_unref", 0);
-  grpc_error *out;
+  grpc_error* out;
   if (grpc_error_is_special(in)) {
     out = GRPC_ERROR_CREATE_FROM_STATIC_STRING("unknown");
     if (in == GRPC_ERROR_NONE) {
@@ -406,8 +406,8 @@
     if (in->arena_capacity - in->arena_size < (uint8_t)SLOTS_PER_STR) {
       new_arena_capacity = (uint8_t)(3 * new_arena_capacity / 2);
     }
-    out = (grpc_error *)gpr_malloc(sizeof(*in) +
-                                   new_arena_capacity * sizeof(intptr_t));
+    out = (grpc_error*)gpr_malloc(sizeof(*in) +
+                                  new_arena_capacity * sizeof(intptr_t));
 #ifndef NDEBUG
     if (grpc_trace_error_refcount.enabled()) {
       gpr_log(GPR_DEBUG, "%p create copying %p", out, in);
@@ -415,7 +415,7 @@
 #endif
     // bulk memcpy of the rest of the struct.
     size_t skip = sizeof(&out->atomics);
-    memcpy((void *)((uintptr_t)out + skip), (void *)((uintptr_t)in + skip),
+    memcpy((void*)((uintptr_t)out + skip), (void*)((uintptr_t)in + skip),
            sizeof(*in) + (in->arena_size * sizeof(intptr_t)) - skip);
     // manually set the atomics and the new capacity
     gpr_atm_no_barrier_store(&out->atomics.error_string, 0);
@@ -429,19 +429,19 @@
   return out;
 }
 
-grpc_error *grpc_error_set_int(grpc_error *src, grpc_error_ints which,
+grpc_error* grpc_error_set_int(grpc_error* src, grpc_error_ints which,
                                intptr_t value) {
   GPR_TIMER_BEGIN("grpc_error_set_int", 0);
-  grpc_error *new_err = copy_error_and_unref(src);
+  grpc_error* new_err = copy_error_and_unref(src);
   internal_set_int(&new_err, which, value);
   GPR_TIMER_END("grpc_error_set_int", 0);
   return new_err;
 }
 
 typedef struct {
-  grpc_error *error;
+  grpc_error* error;
   grpc_status_code code;
-  const char *msg;
+  const char* msg;
 } special_error_status_map;
 static special_error_status_map error_status_map[] = {
     {GRPC_ERROR_NONE, GRPC_STATUS_OK, ""},
@@ -449,7 +449,7 @@
     {GRPC_ERROR_OOM, GRPC_STATUS_RESOURCE_EXHAUSTED, "Out of memory"},
 };
 
-bool grpc_error_get_int(grpc_error *err, grpc_error_ints which, intptr_t *p) {
+bool grpc_error_get_int(grpc_error* err, grpc_error_ints which, intptr_t* p) {
   GPR_TIMER_BEGIN("grpc_error_get_int", 0);
   if (grpc_error_is_special(err)) {
     if (which == GRPC_ERROR_INT_GRPC_STATUS) {
@@ -474,17 +474,17 @@
   return false;
 }
 
-grpc_error *grpc_error_set_str(grpc_error *src, grpc_error_strs which,
+grpc_error* grpc_error_set_str(grpc_error* src, grpc_error_strs which,
                                grpc_slice str) {
   GPR_TIMER_BEGIN("grpc_error_set_str", 0);
-  grpc_error *new_err = copy_error_and_unref(src);
+  grpc_error* new_err = copy_error_and_unref(src);
   internal_set_str(&new_err, which, str);
   GPR_TIMER_END("grpc_error_set_str", 0);
   return new_err;
 }
 
-bool grpc_error_get_str(grpc_error *err, grpc_error_strs which,
-                        grpc_slice *str) {
+bool grpc_error_get_str(grpc_error* err, grpc_error_strs which,
+                        grpc_slice* str) {
   if (grpc_error_is_special(err)) {
     if (which == GRPC_ERROR_STR_GRPC_MESSAGE) {
       for (size_t i = 0; i < GPR_ARRAY_SIZE(error_status_map); i++) {
@@ -498,53 +498,53 @@
   }
   uint8_t slot = err->strs[which];
   if (slot != UINT8_MAX) {
-    *str = *(grpc_slice *)(err->arena + slot);
+    *str = *(grpc_slice*)(err->arena + slot);
     return true;
   } else {
     return false;
   }
 }
 
-grpc_error *grpc_error_add_child(grpc_error *src, grpc_error *child) {
+grpc_error* grpc_error_add_child(grpc_error* src, grpc_error* child) {
   GPR_TIMER_BEGIN("grpc_error_add_child", 0);
-  grpc_error *new_err = copy_error_and_unref(src);
+  grpc_error* new_err = copy_error_and_unref(src);
   internal_add_error(&new_err, child);
   GPR_TIMER_END("grpc_error_add_child", 0);
   return new_err;
 }
 
-static const char *no_error_string = "\"No Error\"";
-static const char *oom_error_string = "\"Out of memory\"";
-static const char *cancelled_error_string = "\"Cancelled\"";
+static const char* no_error_string = "\"No Error\"";
+static const char* oom_error_string = "\"Out of memory\"";
+static const char* cancelled_error_string = "\"Cancelled\"";
 
 typedef struct {
-  char *key;
-  char *value;
+  char* key;
+  char* value;
 } kv_pair;
 
 typedef struct {
-  kv_pair *kvs;
+  kv_pair* kvs;
   size_t num_kvs;
   size_t cap_kvs;
 } kv_pairs;
 
-static void append_chr(char c, char **s, size_t *sz, size_t *cap) {
+static void append_chr(char c, char** s, size_t* sz, size_t* cap) {
   if (*sz == *cap) {
     *cap = GPR_MAX(8, 3 * *cap / 2);
-    *s = (char *)gpr_realloc(*s, *cap);
+    *s = (char*)gpr_realloc(*s, *cap);
   }
   (*s)[(*sz)++] = c;
 }
 
-static void append_str(const char *str, char **s, size_t *sz, size_t *cap) {
-  for (const char *c = str; *c; c++) {
+static void append_str(const char* str, char** s, size_t* sz, size_t* cap) {
+  for (const char* c = str; *c; c++) {
     append_chr(*c, s, sz, cap);
   }
 }
 
-static void append_esc_str(const uint8_t *str, size_t len, char **s, size_t *sz,
-                           size_t *cap) {
-  static const char *hex = "0123456789abcdef";
+static void append_esc_str(const uint8_t* str, size_t len, char** s, size_t* sz,
+                           size_t* cap) {
+  static const char* hex = "0123456789abcdef";
   append_chr('"', s, sz, cap);
   for (size_t i = 0; i < len; i++, str++) {
     if (*str < 32 || *str >= 127) {
@@ -580,28 +580,28 @@
   append_chr('"', s, sz, cap);
 }
 
-static void append_kv(kv_pairs *kvs, char *key, char *value) {
+static void append_kv(kv_pairs* kvs, char* key, char* value) {
   if (kvs->num_kvs == kvs->cap_kvs) {
     kvs->cap_kvs = GPR_MAX(3 * kvs->cap_kvs / 2, 4);
     kvs->kvs =
-        (kv_pair *)gpr_realloc(kvs->kvs, sizeof(*kvs->kvs) * kvs->cap_kvs);
+        (kv_pair*)gpr_realloc(kvs->kvs, sizeof(*kvs->kvs) * kvs->cap_kvs);
   }
   kvs->kvs[kvs->num_kvs].key = key;
   kvs->kvs[kvs->num_kvs].value = value;
   kvs->num_kvs++;
 }
 
-static char *key_int(grpc_error_ints which) {
+static char* key_int(grpc_error_ints which) {
   return gpr_strdup(error_int_name(which));
 }
 
-static char *fmt_int(intptr_t p) {
-  char *s;
+static char* fmt_int(intptr_t p) {
+  char* s;
   gpr_asprintf(&s, "%" PRIdPTR, p);
   return s;
 }
 
-static void collect_ints_kvs(grpc_error *err, kv_pairs *kvs) {
+static void collect_ints_kvs(grpc_error* err, kv_pairs* kvs) {
   for (size_t which = 0; which < GRPC_ERROR_INT_MAX; ++which) {
     uint8_t slot = err->ints[which];
     if (slot != UINT8_MAX) {
@@ -611,37 +611,37 @@
   }
 }
 
-static char *key_str(grpc_error_strs which) {
+static char* key_str(grpc_error_strs which) {
   return gpr_strdup(error_str_name(which));
 }
 
-static char *fmt_str(grpc_slice slice) {
-  char *s = NULL;
+static char* fmt_str(grpc_slice slice) {
+  char* s = NULL;
   size_t sz = 0;
   size_t cap = 0;
-  append_esc_str((const uint8_t *)GRPC_SLICE_START_PTR(slice),
+  append_esc_str((const uint8_t*)GRPC_SLICE_START_PTR(slice),
                  GRPC_SLICE_LENGTH(slice), &s, &sz, &cap);
   append_chr(0, &s, &sz, &cap);
   return s;
 }
 
-static void collect_strs_kvs(grpc_error *err, kv_pairs *kvs) {
+static void collect_strs_kvs(grpc_error* err, kv_pairs* kvs) {
   for (size_t which = 0; which < GRPC_ERROR_STR_MAX; ++which) {
     uint8_t slot = err->strs[which];
     if (slot != UINT8_MAX) {
       append_kv(kvs, key_str((grpc_error_strs)which),
-                fmt_str(*(grpc_slice *)(err->arena + slot)));
+                fmt_str(*(grpc_slice*)(err->arena + slot)));
     }
   }
 }
 
-static char *key_time(grpc_error_times which) {
+static char* key_time(grpc_error_times which) {
   return gpr_strdup(error_time_name(which));
 }
 
-static char *fmt_time(gpr_timespec tm) {
-  char *out;
-  const char *pfx = "!!";
+static char* fmt_time(gpr_timespec tm) {
+  char* out;
+  const char* pfx = "!!";
   switch (tm.clock_type) {
     case GPR_CLOCK_MONOTONIC:
       pfx = "@monotonic:";
@@ -660,24 +660,24 @@
   return out;
 }
 
-static void collect_times_kvs(grpc_error *err, kv_pairs *kvs) {
+static void collect_times_kvs(grpc_error* err, kv_pairs* kvs) {
   for (size_t which = 0; which < GRPC_ERROR_TIME_MAX; ++which) {
     uint8_t slot = err->times[which];
     if (slot != UINT8_MAX) {
       append_kv(kvs, key_time((grpc_error_times)which),
-                fmt_time(*(gpr_timespec *)(err->arena + slot)));
+                fmt_time(*(gpr_timespec*)(err->arena + slot)));
     }
   }
 }
 
-static void add_errs(grpc_error *err, char **s, size_t *sz, size_t *cap) {
+static void add_errs(grpc_error* err, char** s, size_t* sz, size_t* cap) {
   uint8_t slot = err->first_err;
   bool first = true;
   while (slot != UINT8_MAX) {
-    grpc_linked_error *lerr = (grpc_linked_error *)(err->arena + slot);
+    grpc_linked_error* lerr = (grpc_linked_error*)(err->arena + slot);
     if (!first) append_chr(',', s, sz, cap);
     first = false;
-    const char *e = grpc_error_string(lerr->err);
+    const char* e = grpc_error_string(lerr->err);
     append_str(e, s, sz, cap);
     GPR_ASSERT(err->last_err == slot ? lerr->next == UINT8_MAX
                                      : lerr->next != UINT8_MAX);
@@ -685,8 +685,8 @@
   }
 }
 
-static char *errs_string(grpc_error *err) {
-  char *s = NULL;
+static char* errs_string(grpc_error* err) {
+  char* s = NULL;
   size_t sz = 0;
   size_t cap = 0;
   append_chr('[', &s, &sz, &cap);
@@ -696,22 +696,22 @@
   return s;
 }
 
-static int cmp_kvs(const void *a, const void *b) {
-  const kv_pair *ka = (const kv_pair *)a;
-  const kv_pair *kb = (const kv_pair *)b;
+static int cmp_kvs(const void* a, const void* b) {
+  const kv_pair* ka = (const kv_pair*)a;
+  const kv_pair* kb = (const kv_pair*)b;
   return strcmp(ka->key, kb->key);
 }
 
-static char *finish_kvs(kv_pairs *kvs) {
-  char *s = NULL;
+static char* finish_kvs(kv_pairs* kvs) {
+  char* s = NULL;
   size_t sz = 0;
   size_t cap = 0;
 
   append_chr('{', &s, &sz, &cap);
   for (size_t i = 0; i < kvs->num_kvs; i++) {
     if (i != 0) append_chr(',', &s, &sz, &cap);
-    append_esc_str((const uint8_t *)kvs->kvs[i].key, strlen(kvs->kvs[i].key),
-                   &s, &sz, &cap);
+    append_esc_str((const uint8_t*)kvs->kvs[i].key, strlen(kvs->kvs[i].key), &s,
+                   &sz, &cap);
     gpr_free(kvs->kvs[i].key);
     append_chr(':', &s, &sz, &cap);
     append_str(kvs->kvs[i].value, &s, &sz, &cap);
@@ -724,16 +724,16 @@
   return s;
 }
 
-const char *grpc_error_string(grpc_error *err) {
+const char* grpc_error_string(grpc_error* err) {
   GPR_TIMER_BEGIN("grpc_error_string", 0);
   if (err == GRPC_ERROR_NONE) return no_error_string;
   if (err == GRPC_ERROR_OOM) return oom_error_string;
   if (err == GRPC_ERROR_CANCELLED) return cancelled_error_string;
 
-  void *p = (void *)gpr_atm_acq_load(&err->atomics.error_string);
+  void* p = (void*)gpr_atm_acq_load(&err->atomics.error_string);
   if (p != NULL) {
     GPR_TIMER_END("grpc_error_string", 0);
-    return (const char *)p;
+    return (const char*)p;
   }
 
   kv_pairs kvs;
@@ -748,19 +748,19 @@
 
   qsort(kvs.kvs, kvs.num_kvs, sizeof(kv_pair), cmp_kvs);
 
-  char *out = finish_kvs(&kvs);
+  char* out = finish_kvs(&kvs);
 
   if (!gpr_atm_rel_cas(&err->atomics.error_string, 0, (gpr_atm)out)) {
     gpr_free(out);
-    out = (char *)gpr_atm_no_barrier_load(&err->atomics.error_string);
+    out = (char*)gpr_atm_no_barrier_load(&err->atomics.error_string);
   }
 
   GPR_TIMER_END("grpc_error_string", 0);
   return out;
 }
 
-grpc_error *grpc_os_error(const char *file, int line, int err,
-                          const char *call_name) {
+grpc_error* grpc_os_error(const char* file, int line, int err,
+                          const char* call_name) {
   return grpc_error_set_str(
       grpc_error_set_str(
           grpc_error_set_int(
@@ -774,10 +774,10 @@
 }
 
 #ifdef GPR_WINDOWS
-grpc_error *grpc_wsa_error(const char *file, int line, int err,
-                           const char *call_name) {
-  char *utf8_message = gpr_format_message(err);
-  grpc_error *error = grpc_error_set_str(
+grpc_error* grpc_wsa_error(const char* file, int line, int err,
+                           const char* call_name) {
+  char* utf8_message = gpr_format_message(err);
+  grpc_error* error = grpc_error_set_str(
       grpc_error_set_str(
           grpc_error_set_int(
               grpc_error_create(file, line,
@@ -791,10 +791,10 @@
 }
 #endif
 
-bool grpc_log_if_error(const char *what, grpc_error *error, const char *file,
+bool grpc_log_if_error(const char* what, grpc_error* error, const char* file,
                        int line) {
   if (error == GRPC_ERROR_NONE) return true;
-  const char *msg = grpc_error_string(error);
+  const char* msg = grpc_error_string(error);
   gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "%s: %s", what, msg);
   GRPC_ERROR_UNREF(error);
   return false;
diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h
index d4050c1..271938b 100644
--- a/src/core/lib/iomgr/error.h
+++ b/src/core/lib/iomgr/error.h
@@ -122,15 +122,15 @@
 /// They are always even so that other code (particularly combiner locks,
 /// polling engines) can safely use the lower bit for themselves.
 
-#define GRPC_ERROR_NONE ((grpc_error *)NULL)
-#define GRPC_ERROR_OOM ((grpc_error *)2)
-#define GRPC_ERROR_CANCELLED ((grpc_error *)4)
+#define GRPC_ERROR_NONE ((grpc_error*)NULL)
+#define GRPC_ERROR_OOM ((grpc_error*)2)
+#define GRPC_ERROR_CANCELLED ((grpc_error*)4)
 
-const char *grpc_error_string(grpc_error *error);
+const char* grpc_error_string(grpc_error* error);
 
 /// Create an error - but use GRPC_ERROR_CREATE instead
-grpc_error *grpc_error_create(const char *file, int line, grpc_slice desc,
-                              grpc_error **referencing, size_t num_referencing);
+grpc_error* grpc_error_create(const char* file, int line, grpc_slice desc,
+                              grpc_error** referencing, size_t num_referencing);
 /// Create an error (this is the preferred way of generating an error that is
 ///   not due to a system call - for system calls, use GRPC_OS_ERROR or
 ///   GRPC_WSA_ERROR as appropriate)
@@ -156,44 +156,44 @@
                     errs, count)
 
 #ifndef NDEBUG
-grpc_error *grpc_error_ref(grpc_error *err, const char *file, int line);
-void grpc_error_unref(grpc_error *err, const char *file, int line);
+grpc_error* grpc_error_ref(grpc_error* err, const char* file, int line);
+void grpc_error_unref(grpc_error* err, const char* file, int line);
 #define GRPC_ERROR_REF(err) grpc_error_ref(err, __FILE__, __LINE__)
 #define GRPC_ERROR_UNREF(err) grpc_error_unref(err, __FILE__, __LINE__)
 #else
-grpc_error *grpc_error_ref(grpc_error *err);
-void grpc_error_unref(grpc_error *err);
+grpc_error* grpc_error_ref(grpc_error* err);
+void grpc_error_unref(grpc_error* err);
 #define GRPC_ERROR_REF(err) grpc_error_ref(err)
 #define GRPC_ERROR_UNREF(err) grpc_error_unref(err)
 #endif
 
-grpc_error *grpc_error_set_int(grpc_error *src, grpc_error_ints which,
+grpc_error* grpc_error_set_int(grpc_error* src, grpc_error_ints which,
                                intptr_t value) GRPC_MUST_USE_RESULT;
-bool grpc_error_get_int(grpc_error *error, grpc_error_ints which, intptr_t *p);
-grpc_error *grpc_error_set_str(grpc_error *src, grpc_error_strs which,
+bool grpc_error_get_int(grpc_error* error, grpc_error_ints which, intptr_t* p);
+grpc_error* grpc_error_set_str(grpc_error* src, grpc_error_strs which,
                                grpc_slice str) GRPC_MUST_USE_RESULT;
 /// Returns false if the specified string is not set.
 /// Caller does NOT own the slice.
-bool grpc_error_get_str(grpc_error *error, grpc_error_strs which,
-                        grpc_slice *s);
+bool grpc_error_get_str(grpc_error* error, grpc_error_strs which,
+                        grpc_slice* s);
 
 /// Add a child error: an error that is believed to have contributed to this
 /// error occurring. Allows root causing high level errors from lower level
 /// errors that contributed to them.
-grpc_error *grpc_error_add_child(grpc_error *src,
-                                 grpc_error *child) GRPC_MUST_USE_RESULT;
-grpc_error *grpc_os_error(const char *file, int line, int err,
-                          const char *call_name) GRPC_MUST_USE_RESULT;
+grpc_error* grpc_error_add_child(grpc_error* src,
+                                 grpc_error* child) GRPC_MUST_USE_RESULT;
+grpc_error* grpc_os_error(const char* file, int line, int err,
+                          const char* call_name) GRPC_MUST_USE_RESULT;
 /// create an error associated with errno!=0 (an 'operating system' error)
 #define GRPC_OS_ERROR(err, call_name) \
   grpc_os_error(__FILE__, __LINE__, err, call_name)
-grpc_error *grpc_wsa_error(const char *file, int line, int err,
-                           const char *call_name) GRPC_MUST_USE_RESULT;
+grpc_error* grpc_wsa_error(const char* file, int line, int err,
+                           const char* call_name) GRPC_MUST_USE_RESULT;
 /// windows only: create an error associated with WSAGetLastError()!=0
 #define GRPC_WSA_ERROR(err, call_name) \
   grpc_wsa_error(__FILE__, __LINE__, err, call_name)
 
-bool grpc_log_if_error(const char *what, grpc_error *error, const char *file,
+bool grpc_log_if_error(const char* what, grpc_error* error, const char* file,
                        int line);
 #define GRPC_LOG_IF_ERROR(what, error) \
   grpc_log_if_error((what), (error), __FILE__, __LINE__)
diff --git a/src/core/lib/iomgr/error_internal.h b/src/core/lib/iomgr/error_internal.h
index 8746d5d..acf6e04 100644
--- a/src/core/lib/iomgr/error_internal.h
+++ b/src/core/lib/iomgr/error_internal.h
@@ -31,7 +31,7 @@
 typedef struct grpc_linked_error grpc_linked_error;
 
 struct grpc_linked_error {
-  grpc_error *err;
+  grpc_error* err;
   uint8_t next;
 };
 
@@ -59,7 +59,7 @@
   intptr_t arena[0];
 };
 
-bool grpc_error_is_special(grpc_error *err);
+bool grpc_error_is_special(grpc_error* err);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc
index 4bda75e..61da996 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.cc
+++ b/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -18,6 +18,8 @@
 
 #include "src/core/lib/iomgr/port.h"
 
+#include <grpc/support/log.h>
+
 /* This polling engine is only relevant on linux kernels supporting epoll() */
 #ifdef GRPC_LINUX_EPOLL
 #include "src/core/lib/iomgr/ev_epoll1_linux.h"
@@ -34,7 +36,6 @@
 
 #include <grpc/support/alloc.h>
 #include <grpc/support/cpu.h>
-#include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/tls.h>
 #include <grpc/support/useful.h>
@@ -46,6 +47,7 @@
 #include "src/core/lib/iomgr/lockfree_event.h"
 #include "src/core/lib/iomgr/wakeup_fd_posix.h"
 #include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/support/manual_constructor.h"
 #include "src/core/lib/support/string.h"
 
 static grpc_wakeup_fd global_wakeup_fd;
@@ -111,10 +113,10 @@
 struct grpc_fd {
   int fd;
 
-  gpr_atm read_closure;
-  gpr_atm write_closure;
+  grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
+  grpc_core::ManualConstructor<grpc_core::LockfreeEvent> write_closure;
 
-  struct grpc_fd *freelist_next;
+  struct grpc_fd* freelist_next;
 
   /* The pollset that last noticed that the fd is readable. The actual type
    * stored in this is (grpc_pollset *) */
@@ -132,7 +134,7 @@
 
 typedef enum { UNKICKED, KICKED, DESIGNATED_POLLER } kick_state;
 
-static const char *kick_state_string(kick_state st) {
+static const char* kick_state_string(kick_state st) {
   switch (st) {
     case UNKICKED:
       return "UNKICKED";
@@ -148,8 +150,8 @@
   kick_state state;
   int kick_state_mutator;  // which line of code last changed kick state
   bool initialized_cv;
-  grpc_pollset_worker *next;
-  grpc_pollset_worker *prev;
+  grpc_pollset_worker* next;
+  grpc_pollset_worker* prev;
   gpr_cv cv;
   grpc_closure_list schedule_on_end_work;
 };
@@ -164,29 +166,29 @@
 
 typedef struct pollset_neighborhood {
   gpr_mu mu;
-  grpc_pollset *active_root;
+  grpc_pollset* active_root;
   char pad[GPR_CACHELINE_SIZE];
 } pollset_neighborhood;
 
 struct grpc_pollset {
   gpr_mu mu;
-  pollset_neighborhood *neighborhood;
+  pollset_neighborhood* neighborhood;
   bool reassigning_neighborhood;
-  grpc_pollset_worker *root_worker;
+  grpc_pollset_worker* root_worker;
   bool kicked_without_poller;
 
   /* Set to true if the pollset is observed to have no workers available to
      poll */
   bool seen_inactive;
   bool shutting_down;             /* Is the pollset shutting down ? */
-  grpc_closure *shutdown_closure; /* Called after after shutdown is complete */
+  grpc_closure* shutdown_closure; /* Called after after shutdown is complete */
 
   /* Number of workers who are *about-to* attach themselves to the pollset
    * worker list */
   int begin_refs;
 
-  grpc_pollset *next;
-  grpc_pollset *prev;
+  grpc_pollset* next;
+  grpc_pollset* prev;
 };
 
 /*******************************************************************************
@@ -201,8 +203,8 @@
  * Common helpers
  */
 
-static bool append_error(grpc_error **composite, grpc_error *error,
-                         const char *desc) {
+static bool append_error(grpc_error** composite, grpc_error* error,
+                         const char* desc) {
   if (error == GRPC_ERROR_NONE) return true;
   if (*composite == GRPC_ERROR_NONE) {
     *composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc);
@@ -233,7 +235,7 @@
  * alarm 'epoch'). This wakeup_fd gives us something to alert on when such a
  * case occurs. */
 
-static grpc_fd *fd_freelist = NULL;
+static grpc_fd* fd_freelist = NULL;
 static gpr_mu fd_freelist_mu;
 
 static void fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); }
@@ -242,15 +244,15 @@
   gpr_mu_lock(&fd_freelist_mu);
   gpr_mu_unlock(&fd_freelist_mu);
   while (fd_freelist != NULL) {
-    grpc_fd *fd = fd_freelist;
+    grpc_fd* fd = fd_freelist;
     fd_freelist = fd_freelist->freelist_next;
     gpr_free(fd);
   }
   gpr_mu_destroy(&fd_freelist_mu);
 }
 
-static grpc_fd *fd_create(int fd, const char *name) {
-  grpc_fd *new_fd = NULL;
+static grpc_fd* fd_create(int fd, const char* name) {
+  grpc_fd* new_fd = NULL;
 
   gpr_mu_lock(&fd_freelist_mu);
   if (fd_freelist != NULL) {
@@ -260,21 +262,21 @@
   gpr_mu_unlock(&fd_freelist_mu);
 
   if (new_fd == NULL) {
-    new_fd = (grpc_fd *)gpr_malloc(sizeof(grpc_fd));
+    new_fd = (grpc_fd*)gpr_malloc(sizeof(grpc_fd));
   }
 
   new_fd->fd = fd;
-  grpc_lfev_init(&new_fd->read_closure);
-  grpc_lfev_init(&new_fd->write_closure);
+  new_fd->read_closure.Init();
+  new_fd->write_closure.Init();
   gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
 
   new_fd->freelist_next = NULL;
 
-  char *fd_name;
+  char* fd_name;
   gpr_asprintf(&fd_name, "%s fd=%d", name, fd);
   grpc_iomgr_register_object(&new_fd->iomgr_object, fd_name);
 #ifndef NDEBUG
-  if (grpc_trace_fd_refcount.enabled()) {
+  if (GRPC_TRACER_ON(grpc_trace_fd_refcount)) {
     gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, new_fd, fd_name);
   }
 #endif
@@ -290,35 +292,34 @@
   return new_fd;
 }
 
-static int fd_wrapped_fd(grpc_fd *fd) { return fd->fd; }
+static int fd_wrapped_fd(grpc_fd* fd) { return fd->fd; }
 
 /* if 'releasing_fd' is true, it means that we are going to detach the internal
  * fd from grpc_fd structure (i.e which means we should not be calling
  * shutdown() syscall on that fd) */
-static void fd_shutdown_internal(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                                 grpc_error *why, bool releasing_fd) {
-  if (grpc_lfev_set_shutdown(exec_ctx, &fd->read_closure,
-                             GRPC_ERROR_REF(why))) {
+static void fd_shutdown_internal(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                                 grpc_error* why, bool releasing_fd) {
+  if (fd->read_closure->SetShutdown(exec_ctx, GRPC_ERROR_REF(why))) {
     if (!releasing_fd) {
       shutdown(fd->fd, SHUT_RDWR);
     }
-    grpc_lfev_set_shutdown(exec_ctx, &fd->write_closure, GRPC_ERROR_REF(why));
+    fd->write_closure->SetShutdown(exec_ctx, GRPC_ERROR_REF(why));
   }
   GRPC_ERROR_UNREF(why);
 }
 
 /* Might be called multiple times */
-static void fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_error *why) {
+static void fd_shutdown(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_error* why) {
   fd_shutdown_internal(exec_ctx, fd, why, false);
 }
 
-static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                      grpc_closure *on_done, int *release_fd,
-                      bool already_closed, const char *reason) {
-  grpc_error *error = GRPC_ERROR_NONE;
+static void fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                      grpc_closure* on_done, int* release_fd,
+                      bool already_closed, const char* reason) {
+  grpc_error* error = GRPC_ERROR_NONE;
   bool is_release_fd = (release_fd != NULL);
 
-  if (!grpc_lfev_is_shutdown(&fd->read_closure)) {
+  if (!fd->read_closure->IsShutdown()) {
     fd_shutdown_internal(exec_ctx, fd,
                          GRPC_ERROR_CREATE_FROM_COPIED_STRING(reason),
                          is_release_fd);
@@ -335,8 +336,8 @@
   GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_REF(error));
 
   grpc_iomgr_unregister_object(&fd->iomgr_object);
-  grpc_lfev_destroy(&fd->read_closure);
-  grpc_lfev_destroy(&fd->write_closure);
+  fd->read_closure.Destroy();
+  fd->write_closure.Destroy();
 
   gpr_mu_lock(&fd_freelist_mu);
   fd->freelist_next = fd_freelist;
@@ -344,35 +345,35 @@
   gpr_mu_unlock(&fd_freelist_mu);
 }
 
-static grpc_pollset *fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx,
-                                                  grpc_fd *fd) {
+static grpc_pollset* fd_get_read_notifier_pollset(grpc_exec_ctx* exec_ctx,
+                                                  grpc_fd* fd) {
   gpr_atm notifier = gpr_atm_acq_load(&fd->read_notifier_pollset);
-  return (grpc_pollset *)notifier;
+  return (grpc_pollset*)notifier;
 }
 
-static bool fd_is_shutdown(grpc_fd *fd) {
-  return grpc_lfev_is_shutdown(&fd->read_closure);
+static bool fd_is_shutdown(grpc_fd* fd) {
+  return fd->read_closure->IsShutdown();
 }
 
-static void fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                              grpc_closure *closure) {
-  grpc_lfev_notify_on(exec_ctx, &fd->read_closure, closure, "read");
+static void fd_notify_on_read(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                              grpc_closure* closure) {
+  fd->read_closure->NotifyOn(exec_ctx, closure);
 }
 
-static void fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                               grpc_closure *closure) {
-  grpc_lfev_notify_on(exec_ctx, &fd->write_closure, closure, "write");
+static void fd_notify_on_write(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                               grpc_closure* closure) {
+  fd->write_closure->NotifyOn(exec_ctx, closure);
 }
 
-static void fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                               grpc_pollset *notifier) {
-  grpc_lfev_set_ready(exec_ctx, &fd->read_closure, "read");
+static void fd_become_readable(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                               grpc_pollset* notifier) {
+  fd->read_closure->SetReady(exec_ctx);
   /* Use release store to match with acquire load in fd_get_read_notifier */
   gpr_atm_rel_store(&fd->read_notifier_pollset, (gpr_atm)notifier);
 }
 
-static void fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
-  grpc_lfev_set_ready(exec_ctx, &fd->write_closure, "write");
+static void fd_become_writable(grpc_exec_ctx* exec_ctx, grpc_fd* fd) {
+  fd->write_closure->SetReady(exec_ctx);
 }
 
 /*******************************************************************************
@@ -385,11 +386,11 @@
 /* The designated poller */
 static gpr_atm g_active_poller;
 
-static pollset_neighborhood *g_neighborhoods;
+static pollset_neighborhood* g_neighborhoods;
 static size_t g_num_neighborhoods;
 
 /* Return true if first in list */
-static bool worker_insert(grpc_pollset *pollset, grpc_pollset_worker *worker) {
+static bool worker_insert(grpc_pollset* pollset, grpc_pollset_worker* worker) {
   if (pollset->root_worker == NULL) {
     pollset->root_worker = worker;
     worker->next = worker->prev = worker;
@@ -406,8 +407,8 @@
 /* Return true if last in list */
 typedef enum { EMPTIED, NEW_ROOT, REMOVED } worker_remove_result;
 
-static worker_remove_result worker_remove(grpc_pollset *pollset,
-                                          grpc_pollset_worker *worker) {
+static worker_remove_result worker_remove(grpc_pollset* pollset,
+                                          grpc_pollset_worker* worker) {
   if (worker == pollset->root_worker) {
     if (worker == worker->next) {
       pollset->root_worker = NULL;
@@ -429,12 +430,12 @@
   return (size_t)gpr_cpu_current_cpu() % g_num_neighborhoods;
 }
 
-static grpc_error *pollset_global_init(void) {
+static grpc_error* pollset_global_init(void) {
   gpr_tls_init(&g_current_thread_pollset);
   gpr_tls_init(&g_current_thread_worker);
   gpr_atm_no_barrier_store(&g_active_poller, 0);
   global_wakeup_fd.read_fd = -1;
-  grpc_error *err = grpc_wakeup_fd_init(&global_wakeup_fd);
+  grpc_error* err = grpc_wakeup_fd_init(&global_wakeup_fd);
   if (err != GRPC_ERROR_NONE) return err;
   struct epoll_event ev;
   ev.events = (uint32_t)(EPOLLIN | EPOLLET);
@@ -444,8 +445,8 @@
     return GRPC_OS_ERROR(errno, "epoll_ctl");
   }
   g_num_neighborhoods = GPR_CLAMP(gpr_cpu_num_cores(), 1, MAX_NEIGHBORHOODS);
-  g_neighborhoods = (pollset_neighborhood *)gpr_zalloc(
-      sizeof(*g_neighborhoods) * g_num_neighborhoods);
+  g_neighborhoods = (pollset_neighborhood*)gpr_zalloc(sizeof(*g_neighborhoods) *
+                                                      g_num_neighborhoods);
   for (size_t i = 0; i < g_num_neighborhoods; i++) {
     gpr_mu_init(&g_neighborhoods[i].mu);
   }
@@ -462,7 +463,7 @@
   gpr_free(g_neighborhoods);
 }
 
-static void pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
+static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
   gpr_mu_init(&pollset->mu);
   *mu = &pollset->mu;
   pollset->neighborhood = &g_neighborhoods[choose_neighborhood()];
@@ -476,10 +477,10 @@
   pollset->next = pollset->prev = NULL;
 }
 
-static void pollset_destroy(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
+static void pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
   gpr_mu_lock(&pollset->mu);
   if (!pollset->seen_inactive) {
-    pollset_neighborhood *neighborhood = pollset->neighborhood;
+    pollset_neighborhood* neighborhood = pollset->neighborhood;
     gpr_mu_unlock(&pollset->mu);
   retry_lock_neighborhood:
     gpr_mu_lock(&neighborhood->mu);
@@ -504,12 +505,12 @@
   gpr_mu_destroy(&pollset->mu);
 }
 
-static grpc_error *pollset_kick_all(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset *pollset) {
+static grpc_error* pollset_kick_all(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset* pollset) {
   GPR_TIMER_BEGIN("pollset_kick_all", 0);
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   if (pollset->root_worker != NULL) {
-    grpc_pollset_worker *worker = pollset->root_worker;
+    grpc_pollset_worker* worker = pollset->root_worker;
     do {
       GRPC_STATS_INC_POLLSET_KICK(exec_ctx);
       switch (worker->state) {
@@ -540,8 +541,8 @@
   return error;
 }
 
-static void pollset_maybe_finish_shutdown(grpc_exec_ctx *exec_ctx,
-                                          grpc_pollset *pollset) {
+static void pollset_maybe_finish_shutdown(grpc_exec_ctx* exec_ctx,
+                                          grpc_pollset* pollset) {
   if (pollset->shutdown_closure != NULL && pollset->root_worker == NULL &&
       pollset->begin_refs == 0) {
     GPR_TIMER_MARK("pollset_finish_shutdown", 0);
@@ -550,8 +551,8 @@
   }
 }
 
-static void pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                             grpc_closure *closure) {
+static void pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                             grpc_closure* closure) {
   GPR_TIMER_BEGIN("pollset_shutdown", 0);
   GPR_ASSERT(pollset->shutdown_closure == NULL);
   GPR_ASSERT(!pollset->shutting_down);
@@ -562,7 +563,7 @@
   GPR_TIMER_END("pollset_shutdown", 0);
 }
 
-static int poll_deadline_to_millis_timeout(grpc_exec_ctx *exec_ctx,
+static int poll_deadline_to_millis_timeout(grpc_exec_ctx* exec_ctx,
                                            grpc_millis millis) {
   if (millis == GRPC_MILLIS_INF_FUTURE) return -1;
   grpc_millis delta = millis - grpc_exec_ctx_now(exec_ctx);
@@ -583,10 +584,10 @@
    NOTE ON SYNCRHONIZATION: Similar to do_epoll_wait(), this function is only
    called by g_active_poller thread. So there is no need for synchronization
    when accessing fields in g_epoll_set */
-static grpc_error *process_epoll_events(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset *pollset) {
-  static const char *err_desc = "process_events";
-  grpc_error *error = GRPC_ERROR_NONE;
+static grpc_error* process_epoll_events(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset* pollset) {
+  static const char* err_desc = "process_events";
+  grpc_error* error = GRPC_ERROR_NONE;
 
   GPR_TIMER_BEGIN("process_epoll_events", 0);
   long num_events = gpr_atm_acq_load(&g_epoll_set.num_events);
@@ -595,14 +596,14 @@
        (idx < MAX_EPOLL_EVENTS_HANDLED_PER_ITERATION) && cursor != num_events;
        idx++) {
     long c = cursor++;
-    struct epoll_event *ev = &g_epoll_set.events[c];
-    void *data_ptr = ev->data.ptr;
+    struct epoll_event* ev = &g_epoll_set.events[c];
+    void* data_ptr = ev->data.ptr;
 
     if (data_ptr == &global_wakeup_fd) {
       append_error(&error, grpc_wakeup_fd_consume_wakeup(&global_wakeup_fd),
                    err_desc);
     } else {
-      grpc_fd *fd = (grpc_fd *)(data_ptr);
+      grpc_fd* fd = (grpc_fd*)(data_ptr);
       bool cancel = (ev->events & (EPOLLERR | EPOLLHUP)) != 0;
       bool read_ev = (ev->events & (EPOLLIN | EPOLLPRI)) != 0;
       bool write_ev = (ev->events & EPOLLOUT) != 0;
@@ -628,7 +629,7 @@
    NOTE ON SYNCHRONIZATION: At any point of time, only the g_active_poller
    (i.e the designated poller thread) will be calling this function. So there is
    no need for any synchronization when accesing fields in g_epoll_set */
-static grpc_error *do_epoll_wait(grpc_exec_ctx *exec_ctx, grpc_pollset *ps,
+static grpc_error* do_epoll_wait(grpc_exec_ctx* exec_ctx, grpc_pollset* ps,
                                  grpc_millis deadline) {
   GPR_TIMER_BEGIN("do_epoll_wait", 0);
 
@@ -650,7 +651,7 @@
 
   GRPC_STATS_INC_POLL_EVENTS_RETURNED(exec_ctx, r);
 
-  if (grpc_polling_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "ps: %p poll got %d events", ps, r);
   }
 
@@ -661,9 +662,9 @@
   return GRPC_ERROR_NONE;
 }
 
-static bool begin_worker(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                         grpc_pollset_worker *worker,
-                         grpc_pollset_worker **worker_hdl,
+static bool begin_worker(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                         grpc_pollset_worker* worker,
+                         grpc_pollset_worker** worker_hdl,
                          grpc_millis deadline) {
   GPR_TIMER_BEGIN("begin_worker", 0);
   if (worker_hdl != NULL) *worker_hdl = worker;
@@ -672,7 +673,7 @@
   worker->schedule_on_end_work = (grpc_closure_list)GRPC_CLOSURE_LIST_INIT;
   pollset->begin_refs++;
 
-  if (grpc_polling_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_ERROR, "PS:%p BEGIN_STARTS:%p", pollset, worker);
   }
 
@@ -685,13 +686,13 @@
       pollset->reassigning_neighborhood = true;
       pollset->neighborhood = &g_neighborhoods[choose_neighborhood()];
     }
-    pollset_neighborhood *neighborhood = pollset->neighborhood;
+    pollset_neighborhood* neighborhood = pollset->neighborhood;
     gpr_mu_unlock(&pollset->mu);
   // pollset unlocked: state may change (even worker->kick_state)
   retry_lock_neighborhood:
     gpr_mu_lock(&neighborhood->mu);
     gpr_mu_lock(&pollset->mu);
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_ERROR, "PS:%p BEGIN_REORG:%p kick_state=%s is_reassigning=%d",
               pollset, worker, kick_state_string(worker->state),
               is_reassigning);
@@ -743,7 +744,7 @@
     worker->initialized_cv = true;
     gpr_cv_init(&worker->cv);
     while (worker->state == UNKICKED && !pollset->shutting_down) {
-      if (grpc_polling_trace.enabled()) {
+      if (GRPC_TRACER_ON(grpc_polling_trace)) {
         gpr_log(GPR_ERROR, "PS:%p BEGIN_WAIT:%p kick_state=%s shutdown=%d",
                 pollset, worker, kick_state_string(worker->state),
                 pollset->shutting_down);
@@ -760,7 +761,7 @@
     grpc_exec_ctx_invalidate_now(exec_ctx);
   }
 
-  if (grpc_polling_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_ERROR,
             "PS:%p BEGIN_DONE:%p kick_state=%s shutdown=%d "
             "kicked_without_poller: %d",
@@ -788,24 +789,24 @@
 }
 
 static bool check_neighborhood_for_available_poller(
-    grpc_exec_ctx *exec_ctx, pollset_neighborhood *neighborhood) {
+    grpc_exec_ctx* exec_ctx, pollset_neighborhood* neighborhood) {
   GPR_TIMER_BEGIN("check_neighborhood_for_available_poller", 0);
   bool found_worker = false;
   do {
-    grpc_pollset *inspect = neighborhood->active_root;
+    grpc_pollset* inspect = neighborhood->active_root;
     if (inspect == NULL) {
       break;
     }
     gpr_mu_lock(&inspect->mu);
     GPR_ASSERT(!inspect->seen_inactive);
-    grpc_pollset_worker *inspect_worker = inspect->root_worker;
+    grpc_pollset_worker* inspect_worker = inspect->root_worker;
     if (inspect_worker != NULL) {
       do {
         switch (inspect_worker->state) {
           case UNKICKED:
             if (gpr_atm_no_barrier_cas(&g_active_poller, 0,
                                        (gpr_atm)inspect_worker)) {
-              if (grpc_polling_trace.enabled()) {
+              if (GRPC_TRACER_ON(grpc_polling_trace)) {
                 gpr_log(GPR_DEBUG, " .. choose next poller to be %p",
                         inspect_worker);
               }
@@ -816,7 +817,7 @@
                 gpr_cv_signal(&inspect_worker->cv);
               }
             } else {
-              if (grpc_polling_trace.enabled()) {
+              if (GRPC_TRACER_ON(grpc_polling_trace)) {
                 gpr_log(GPR_DEBUG, " .. beaten to choose next poller");
               }
             }
@@ -834,7 +835,7 @@
       } while (!found_worker && inspect_worker != inspect->root_worker);
     }
     if (!found_worker) {
-      if (grpc_polling_trace.enabled()) {
+      if (GRPC_TRACER_ON(grpc_polling_trace)) {
         gpr_log(GPR_DEBUG, " .. mark pollset %p inactive", inspect);
       }
       inspect->seen_inactive = true;
@@ -852,11 +853,11 @@
   return found_worker;
 }
 
-static void end_worker(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                       grpc_pollset_worker *worker,
-                       grpc_pollset_worker **worker_hdl) {
+static void end_worker(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                       grpc_pollset_worker* worker,
+                       grpc_pollset_worker** worker_hdl) {
   GPR_TIMER_BEGIN("end_worker", 0);
-  if (grpc_polling_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "PS:%p END_WORKER:%p", pollset, worker);
   }
   if (worker_hdl != NULL) *worker_hdl = NULL;
@@ -866,7 +867,7 @@
                          &exec_ctx->closure_list);
   if (gpr_atm_no_barrier_load(&g_active_poller) == (gpr_atm)worker) {
     if (worker->next != worker && worker->next->state == UNKICKED) {
-      if (grpc_polling_trace.enabled()) {
+      if (GRPC_TRACER_ON(grpc_polling_trace)) {
         gpr_log(GPR_DEBUG, " .. choose next poller to be peer %p", worker);
       }
       GPR_ASSERT(worker->next->initialized_cv);
@@ -887,7 +888,7 @@
       bool found_worker = false;
       bool scan_state[MAX_NEIGHBORHOODS];
       for (size_t i = 0; !found_worker && i < g_num_neighborhoods; i++) {
-        pollset_neighborhood *neighborhood =
+        pollset_neighborhood* neighborhood =
             &g_neighborhoods[(poller_neighborhood_idx + i) %
                              g_num_neighborhoods];
         if (gpr_mu_trylock(&neighborhood->mu)) {
@@ -901,7 +902,7 @@
       }
       for (size_t i = 0; !found_worker && i < g_num_neighborhoods; i++) {
         if (scan_state[i]) continue;
-        pollset_neighborhood *neighborhood =
+        pollset_neighborhood* neighborhood =
             &g_neighborhoods[(poller_neighborhood_idx + i) %
                              g_num_neighborhoods];
         gpr_mu_lock(&neighborhood->mu);
@@ -920,7 +921,7 @@
   if (worker->initialized_cv) {
     gpr_cv_destroy(&worker->cv);
   }
-  if (grpc_polling_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, " .. remove worker");
   }
   if (EMPTIED == worker_remove(pollset, worker)) {
@@ -934,12 +935,12 @@
    The function pollset_work() may temporarily release the lock (pollset->po.mu)
    during the course of its execution but it will always re-acquire the lock and
    ensure that it is held by the time the function returns */
-static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *ps,
-                                grpc_pollset_worker **worker_hdl,
+static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* ps,
+                                grpc_pollset_worker** worker_hdl,
                                 grpc_millis deadline) {
   grpc_pollset_worker worker;
-  grpc_error *error = GRPC_ERROR_NONE;
-  static const char *err_desc = "pollset_work";
+  grpc_error* error = GRPC_ERROR_NONE;
+  static const char* err_desc = "pollset_work";
   GPR_TIMER_BEGIN("pollset_work", 0);
   if (ps->kicked_without_poller) {
     ps->kicked_without_poller = false;
@@ -987,19 +988,19 @@
   return error;
 }
 
-static grpc_error *pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                                grpc_pollset_worker *specific_worker) {
+static grpc_error* pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                                grpc_pollset_worker* specific_worker) {
   GPR_TIMER_BEGIN("pollset_kick", 0);
   GRPC_STATS_INC_POLLSET_KICK(exec_ctx);
-  grpc_error *ret_err = GRPC_ERROR_NONE;
-  if (grpc_polling_trace.enabled()) {
+  grpc_error* ret_err = GRPC_ERROR_NONE;
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_strvec log;
     gpr_strvec_init(&log);
-    char *tmp;
-    gpr_asprintf(
-        &tmp, "PS:%p KICK:%p curps=%p curworker=%p root=%p", pollset,
-        specific_worker, (void *)gpr_tls_get(&g_current_thread_pollset),
-        (void *)gpr_tls_get(&g_current_thread_worker), pollset->root_worker);
+    char* tmp;
+    gpr_asprintf(&tmp, "PS:%p KICK:%p curps=%p curworker=%p root=%p", pollset,
+                 specific_worker, (void*)gpr_tls_get(&g_current_thread_pollset),
+                 (void*)gpr_tls_get(&g_current_thread_worker),
+                 pollset->root_worker);
     gpr_strvec_add(&log, tmp);
     if (pollset->root_worker != NULL) {
       gpr_asprintf(&tmp, " {kick_state=%s next=%p {kick_state=%s}}",
@@ -1021,26 +1022,26 @@
 
   if (specific_worker == NULL) {
     if (gpr_tls_get(&g_current_thread_pollset) != (intptr_t)pollset) {
-      grpc_pollset_worker *root_worker = pollset->root_worker;
+      grpc_pollset_worker* root_worker = pollset->root_worker;
       if (root_worker == NULL) {
         GRPC_STATS_INC_POLLSET_KICKED_WITHOUT_POLLER(exec_ctx);
         pollset->kicked_without_poller = true;
-        if (grpc_polling_trace.enabled()) {
+        if (GRPC_TRACER_ON(grpc_polling_trace)) {
           gpr_log(GPR_ERROR, " .. kicked_without_poller");
         }
         goto done;
       }
-      grpc_pollset_worker *next_worker = root_worker->next;
+      grpc_pollset_worker* next_worker = root_worker->next;
       if (root_worker->state == KICKED) {
         GRPC_STATS_INC_POLLSET_KICKED_AGAIN(exec_ctx);
-        if (grpc_polling_trace.enabled()) {
+        if (GRPC_TRACER_ON(grpc_polling_trace)) {
           gpr_log(GPR_ERROR, " .. already kicked %p", root_worker);
         }
         SET_KICK_STATE(root_worker, KICKED);
         goto done;
       } else if (next_worker->state == KICKED) {
         GRPC_STATS_INC_POLLSET_KICKED_AGAIN(exec_ctx);
-        if (grpc_polling_trace.enabled()) {
+        if (GRPC_TRACER_ON(grpc_polling_trace)) {
           gpr_log(GPR_ERROR, " .. already kicked %p", next_worker);
         }
         SET_KICK_STATE(next_worker, KICKED);
@@ -1048,10 +1049,10 @@
       } else if (root_worker ==
                      next_worker &&  // only try and wake up a poller if
                                      // there is no next worker
-                 root_worker == (grpc_pollset_worker *)gpr_atm_no_barrier_load(
+                 root_worker == (grpc_pollset_worker*)gpr_atm_no_barrier_load(
                                     &g_active_poller)) {
         GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(exec_ctx);
-        if (grpc_polling_trace.enabled()) {
+        if (GRPC_TRACER_ON(grpc_polling_trace)) {
           gpr_log(GPR_ERROR, " .. kicked %p", root_worker);
         }
         SET_KICK_STATE(root_worker, KICKED);
@@ -1059,7 +1060,7 @@
         goto done;
       } else if (next_worker->state == UNKICKED) {
         GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(exec_ctx);
-        if (grpc_polling_trace.enabled()) {
+        if (GRPC_TRACER_ON(grpc_polling_trace)) {
           gpr_log(GPR_ERROR, " .. kicked %p", next_worker);
         }
         GPR_ASSERT(next_worker->initialized_cv);
@@ -1068,7 +1069,7 @@
         goto done;
       } else if (next_worker->state == DESIGNATED_POLLER) {
         if (root_worker->state != DESIGNATED_POLLER) {
-          if (grpc_polling_trace.enabled()) {
+          if (GRPC_TRACER_ON(grpc_polling_trace)) {
             gpr_log(
                 GPR_ERROR,
                 " .. kicked root non-poller %p (initialized_cv=%d) (poller=%p)",
@@ -1082,7 +1083,7 @@
           goto done;
         } else {
           GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(exec_ctx);
-          if (grpc_polling_trace.enabled()) {
+          if (GRPC_TRACER_ON(grpc_polling_trace)) {
             gpr_log(GPR_ERROR, " .. non-root poller %p (root=%p)", next_worker,
                     root_worker);
           }
@@ -1098,7 +1099,7 @@
       }
     } else {
       GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(exec_ctx);
-      if (grpc_polling_trace.enabled()) {
+      if (GRPC_TRACER_ON(grpc_polling_trace)) {
         gpr_log(GPR_ERROR, " .. kicked while waking up");
       }
       goto done;
@@ -1108,22 +1109,22 @@
   }
 
   if (specific_worker->state == KICKED) {
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_ERROR, " .. specific worker already kicked");
     }
     goto done;
   } else if (gpr_tls_get(&g_current_thread_worker) ==
              (intptr_t)specific_worker) {
     GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(exec_ctx);
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_ERROR, " .. mark %p kicked", specific_worker);
     }
     SET_KICK_STATE(specific_worker, KICKED);
     goto done;
   } else if (specific_worker ==
-             (grpc_pollset_worker *)gpr_atm_no_barrier_load(&g_active_poller)) {
+             (grpc_pollset_worker*)gpr_atm_no_barrier_load(&g_active_poller)) {
     GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(exec_ctx);
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_ERROR, " .. kick active poller");
     }
     SET_KICK_STATE(specific_worker, KICKED);
@@ -1131,7 +1132,7 @@
     goto done;
   } else if (specific_worker->initialized_cv) {
     GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(exec_ctx);
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_ERROR, " .. kick waiting worker");
     }
     SET_KICK_STATE(specific_worker, KICKED);
@@ -1139,7 +1140,7 @@
     goto done;
   } else {
     GRPC_STATS_INC_POLLSET_KICKED_AGAIN(exec_ctx);
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_ERROR, " .. kick non-waiting worker");
     }
     SET_KICK_STATE(specific_worker, KICKED);
@@ -1150,39 +1151,39 @@
   return ret_err;
 }
 
-static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           grpc_fd *fd) {}
+static void pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           grpc_fd* fd) {}
 
 /*******************************************************************************
  * Pollset-set Definitions
  */
 
-static grpc_pollset_set *pollset_set_create(void) {
-  return (grpc_pollset_set *)((intptr_t)0xdeafbeef);
+static grpc_pollset_set* pollset_set_create(void) {
+  return (grpc_pollset_set*)((intptr_t)0xdeafbeef);
 }
 
-static void pollset_set_destroy(grpc_exec_ctx *exec_ctx,
-                                grpc_pollset_set *pss) {}
+static void pollset_set_destroy(grpc_exec_ctx* exec_ctx,
+                                grpc_pollset_set* pss) {}
 
-static void pollset_set_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset_set *pss,
-                               grpc_fd *fd) {}
+static void pollset_set_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset_set* pss,
+                               grpc_fd* fd) {}
 
-static void pollset_set_del_fd(grpc_exec_ctx *exec_ctx, grpc_pollset_set *pss,
-                               grpc_fd *fd) {}
+static void pollset_set_del_fd(grpc_exec_ctx* exec_ctx, grpc_pollset_set* pss,
+                               grpc_fd* fd) {}
 
-static void pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset_set *pss, grpc_pollset *ps) {}
+static void pollset_set_add_pollset(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset_set* pss, grpc_pollset* ps) {}
 
-static void pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset_set *pss, grpc_pollset *ps) {}
+static void pollset_set_del_pollset(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset_set* pss, grpc_pollset* ps) {}
 
-static void pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset_set *bag,
-                                        grpc_pollset_set *item) {}
+static void pollset_set_add_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset_set* bag,
+                                        grpc_pollset_set* item) {}
 
-static void pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset_set *bag,
-                                        grpc_pollset_set *item) {}
+static void pollset_set_del_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset_set* bag,
+                                        grpc_pollset_set* item) {}
 
 /*******************************************************************************
  * Event engine binding
@@ -1228,8 +1229,9 @@
 /* It is possible that GLIBC has epoll but the underlying kernel doesn't.
  * Create epoll_fd (epoll_set_init() takes care of that) to make sure epoll
  * support is available */
-const grpc_event_engine_vtable *grpc_init_epoll1_linux(bool explicit_request) {
+const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request) {
   if (!grpc_has_wakeup_fd()) {
+    gpr_log(GPR_ERROR, "Skipping epoll1 because of no wakeup fd.");
     return NULL;
   }
 
@@ -1253,7 +1255,9 @@
 #include "src/core/lib/iomgr/ev_epoll1_linux.h"
 /* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
  * NULL */
-const grpc_event_engine_vtable *grpc_init_epoll1_linux(bool explicit_request) {
+const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request) {
+  gpr_log(GPR_ERROR,
+          "Skipping epoll1 becuase GRPC_LINUX_EPOLL is not defined.");
   return NULL;
 }
 #endif /* defined(GRPC_POSIX_SOCKET) */
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.h b/src/core/lib/iomgr/ev_epoll1_linux.h
index b437032..3e66747 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.h
+++ b/src/core/lib/iomgr/ev_epoll1_linux.h
@@ -28,7 +28,7 @@
 
 // a polling engine that utilizes a singleton epoll set and turnstile polling
 
-const grpc_event_engine_vtable *grpc_init_epoll1_linux(bool explicit_request);
+const grpc_event_engine_vtable* grpc_init_epoll1_linux(bool explicit_request);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
index 89a5a22..0ce6320 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.cc
+++ b/src/core/lib/iomgr/ev_epollex_linux.cc
@@ -18,6 +18,8 @@
 
 #include "src/core/lib/iomgr/port.h"
 
+#include <grpc/support/log.h>
+
 /* This polling engine is only relevant on linux kernels supporting epoll() */
 #ifdef GRPC_LINUX_EPOLL
 
@@ -34,7 +36,6 @@
 #include <unistd.h>
 
 #include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/tls.h>
 #include <grpc/support/useful.h>
@@ -48,6 +49,7 @@
 #include "src/core/lib/iomgr/timer.h"
 #include "src/core/lib/iomgr/wakeup_fd_posix.h"
 #include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/support/manual_constructor.h"
 #include "src/core/lib/support/spinlock.h"
 
 // debug aid: create workers on the heap (allows asan to spot
@@ -57,8 +59,9 @@
 #define MAX_EPOLL_EVENTS 100
 #define MAX_EPOLL_EVENTS_HANDLED_EACH_POLL_CALL 5
 
-grpc_core::DebugOnlyTraceFlag grpc_trace_pollable_refcount(false,
-                                                           "pollable_refcount");
+#ifndef NDEBUG
+grpc_core::TraceFlag grpc_trace_pollable_refcount(false, "pollable_refcount");
+#endif
 
 /*******************************************************************************
  * pollable Declarations
@@ -84,21 +87,21 @@
   grpc_wakeup_fd wakeup;
 
   // only for type fd... one ref to the owner fd
-  grpc_fd *owner_fd;
+  grpc_fd* owner_fd;
 
-  grpc_pollset_set *pollset_set;
-  pollable *next;
-  pollable *prev;
+  grpc_pollset_set* pollset_set;
+  pollable* next;
+  pollable* prev;
 
   gpr_mu mu;
-  grpc_pollset_worker *root_worker;
+  grpc_pollset_worker* root_worker;
 
   int event_cursor;
   int event_count;
   struct epoll_event events[MAX_EPOLL_EVENTS];
 };
 
-static const char *pollable_type_string(pollable_type t) {
+static const char* pollable_type_string(pollable_type t) {
   switch (t) {
     case PO_MULTI:
       return "pollset";
@@ -110,8 +113,8 @@
   return "<invalid>";
 }
 
-static char *pollable_desc(pollable *p) {
-  char *out;
+static char* pollable_desc(pollable* p) {
+  char* out;
   gpr_asprintf(&out, "type=%s epfd=%d wakeup=%d", pollable_type_string(p->type),
                p->epfd, p->wakeup.read_fd);
   return out;
@@ -119,17 +122,17 @@
 
 /// Shared empty pollable - used by pollset to poll on until the first fd is
 /// added
-static pollable *g_empty_pollable;
+static pollable* g_empty_pollable;
 
-static grpc_error *pollable_create(pollable_type type, pollable **p);
+static grpc_error* pollable_create(pollable_type type, pollable** p);
 #ifdef NDEBUG
-static pollable *pollable_ref(pollable *p);
-static void pollable_unref(pollable *p);
+static pollable* pollable_ref(pollable* p);
+static void pollable_unref(pollable* p);
 #define POLLABLE_REF(p, r) pollable_ref(p)
 #define POLLABLE_UNREF(p, r) pollable_unref(p)
 #else
-static pollable *pollable_ref(pollable *p, int line, const char *reason);
-static void pollable_unref(pollable *p, int line, const char *reason);
+static pollable* pollable_ref(pollable* p, int line, const char* reason);
+static void pollable_unref(pollable* p, int line, const char* reason);
 #define POLLABLE_REF(p, r) pollable_ref((p), __LINE__, (r))
 #define POLLABLE_UNREF(p, r) pollable_unref((p), __LINE__, (r))
 #endif
@@ -149,13 +152,13 @@
   gpr_mu orphan_mu;
 
   gpr_mu pollable_mu;
-  pollable *pollable_obj;
+  pollable* pollable_obj;
 
-  gpr_atm read_closure;
-  gpr_atm write_closure;
+  grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
+  grpc_core::ManualConstructor<grpc_core::LockfreeEvent> write_closure;
 
-  struct grpc_fd *freelist_next;
-  grpc_closure *on_done_closure;
+  struct grpc_fd* freelist_next;
+  grpc_closure* on_done_closure;
 
   /* The pollset that last noticed that the fd is readable. The actual type
    * stored in this is (grpc_pollset *) */
@@ -172,8 +175,8 @@
  */
 
 typedef struct {
-  grpc_pollset_worker *next;
-  grpc_pollset_worker *prev;
+  grpc_pollset_worker* next;
+  grpc_pollset_worker* prev;
 } pwlink;
 
 typedef enum { PWLINK_POLLABLE = 0, PWLINK_POLLSET, PWLINK_COUNT } pwlinks;
@@ -186,18 +189,18 @@
   pid_t originator;
 #endif
   gpr_cv cv;
-  grpc_pollset *pollset;
-  pollable *pollable_obj;
+  grpc_pollset* pollset;
+  pollable* pollable_obj;
 
   pwlink links[PWLINK_COUNT];
 };
 
 struct grpc_pollset {
   gpr_mu mu;
-  pollable *active_pollable;
+  pollable* active_pollable;
   bool kicked_without_poller;
-  grpc_closure *shutdown_closure;
-  grpc_pollset_worker *root_worker;
+  grpc_closure* shutdown_closure;
+  grpc_pollset_worker* root_worker;
   int containing_pollset_set_count;
 };
 
@@ -208,23 +211,23 @@
 struct grpc_pollset_set {
   gpr_refcount refs;
   gpr_mu mu;
-  grpc_pollset_set *parent;
+  grpc_pollset_set* parent;
 
   size_t pollset_count;
   size_t pollset_capacity;
-  grpc_pollset **pollsets;
+  grpc_pollset** pollsets;
 
   size_t fd_count;
   size_t fd_capacity;
-  grpc_fd **fds;
+  grpc_fd** fds;
 };
 
 /*******************************************************************************
  * Common helpers
  */
 
-static bool append_error(grpc_error **composite, grpc_error *error,
-                         const char *desc) {
+static bool append_error(grpc_error** composite, grpc_error* error,
+                         const char* desc) {
   if (error == GRPC_ERROR_NONE) return true;
   if (*composite == GRPC_ERROR_NONE) {
     *composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc);
@@ -250,16 +253,16 @@
  * becomes a spurious read notification on a reused fd.
  */
 
-static grpc_fd *fd_freelist = NULL;
+static grpc_fd* fd_freelist = NULL;
 static gpr_mu fd_freelist_mu;
 
 #ifndef NDEBUG
 #define REF_BY(fd, n, reason) ref_by(fd, n, reason, __FILE__, __LINE__)
 #define UNREF_BY(ec, fd, n, reason) \
   unref_by(ec, fd, n, reason, __FILE__, __LINE__)
-static void ref_by(grpc_fd *fd, int n, const char *reason, const char *file,
+static void ref_by(grpc_fd* fd, int n, const char* reason, const char* file,
                    int line) {
-  if (grpc_trace_fd_refcount.enabled()) {
+  if (GRPC_TRACER_ON(grpc_trace_fd_refcount)) {
     gpr_log(GPR_DEBUG,
             "FD %d %p   ref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]",
             fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst),
@@ -268,13 +271,13 @@
 #else
 #define REF_BY(fd, n, reason) ref_by(fd, n)
 #define UNREF_BY(ec, fd, n, reason) unref_by(ec, fd, n)
-static void ref_by(grpc_fd *fd, int n) {
+static void ref_by(grpc_fd* fd, int n) {
 #endif
   GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&fd->refst, n) > 0);
 }
 
-static void fd_destroy(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_fd *fd = (grpc_fd *)arg;
+static void fd_destroy(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_fd* fd = (grpc_fd*)arg;
   /* Add the fd to the freelist */
   grpc_iomgr_unregister_object(&fd->iomgr_object);
   POLLABLE_UNREF(fd->pollable_obj, "fd_pollable");
@@ -284,29 +287,30 @@
   fd->freelist_next = fd_freelist;
   fd_freelist = fd;
 
-  grpc_lfev_destroy(&fd->read_closure);
-  grpc_lfev_destroy(&fd->write_closure);
+  fd->read_closure.Destroy();
+  fd->write_closure.Destroy();
 
   gpr_mu_unlock(&fd_freelist_mu);
 }
 
 #ifndef NDEBUG
-static void unref_by(grpc_exec_ctx *exec_ctx, grpc_fd *fd, int n,
-                     const char *reason, const char *file, int line) {
-  if (grpc_trace_fd_refcount.enabled()) {
+static void unref_by(grpc_exec_ctx* exec_ctx, grpc_fd* fd, int n,
+                     const char* reason, const char* file, int line) {
+  if (GRPC_TRACER_ON(grpc_trace_fd_refcount)) {
     gpr_log(GPR_DEBUG,
             "FD %d %p unref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]",
             fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst),
             gpr_atm_no_barrier_load(&fd->refst) - n, reason, file, line);
   }
 #else
-static void unref_by(grpc_exec_ctx *exec_ctx, grpc_fd *fd, int n) {
+static void unref_by(grpc_exec_ctx* exec_ctx, grpc_fd* fd, int n) {
 #endif
   gpr_atm old = gpr_atm_full_fetch_add(&fd->refst, -n);
   if (old == n) {
-    GRPC_CLOSURE_SCHED(exec_ctx, GRPC_CLOSURE_CREATE(fd_destroy, fd,
-                                                     grpc_schedule_on_exec_ctx),
-                       GRPC_ERROR_NONE);
+    GRPC_CLOSURE_SCHED(
+        exec_ctx,
+        GRPC_CLOSURE_CREATE(fd_destroy, fd, grpc_schedule_on_exec_ctx),
+        GRPC_ERROR_NONE);
   } else {
     GPR_ASSERT(old > n);
   }
@@ -318,15 +322,15 @@
   gpr_mu_lock(&fd_freelist_mu);
   gpr_mu_unlock(&fd_freelist_mu);
   while (fd_freelist != NULL) {
-    grpc_fd *fd = fd_freelist;
+    grpc_fd* fd = fd_freelist;
     fd_freelist = fd_freelist->freelist_next;
     gpr_free(fd);
   }
   gpr_mu_destroy(&fd_freelist_mu);
 }
 
-static grpc_fd *fd_create(int fd, const char *name) {
-  grpc_fd *new_fd = NULL;
+static grpc_fd* fd_create(int fd, const char* name) {
+  grpc_fd* new_fd = NULL;
 
   gpr_mu_lock(&fd_freelist_mu);
   if (fd_freelist != NULL) {
@@ -336,7 +340,7 @@
   gpr_mu_unlock(&fd_freelist_mu);
 
   if (new_fd == NULL) {
-    new_fd = (grpc_fd *)gpr_malloc(sizeof(grpc_fd));
+    new_fd = (grpc_fd*)gpr_malloc(sizeof(grpc_fd));
   }
 
   gpr_mu_init(&new_fd->pollable_mu);
@@ -344,18 +348,18 @@
   new_fd->pollable_obj = NULL;
   gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1);
   new_fd->fd = fd;
-  grpc_lfev_init(&new_fd->read_closure);
-  grpc_lfev_init(&new_fd->write_closure);
+  new_fd->read_closure.Init();
+  new_fd->write_closure.Init();
   gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
 
   new_fd->freelist_next = NULL;
   new_fd->on_done_closure = NULL;
 
-  char *fd_name;
+  char* fd_name;
   gpr_asprintf(&fd_name, "%s fd=%d", name, fd);
   grpc_iomgr_register_object(&new_fd->iomgr_object, fd_name);
 #ifndef NDEBUG
-  if (grpc_trace_fd_refcount.enabled()) {
+  if (GRPC_TRACER_ON(grpc_trace_fd_refcount)) {
     gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, new_fd, fd_name);
   }
 #endif
@@ -363,14 +367,14 @@
   return new_fd;
 }
 
-static int fd_wrapped_fd(grpc_fd *fd) {
+static int fd_wrapped_fd(grpc_fd* fd) {
   int ret_fd = fd->fd;
   return (gpr_atm_acq_load(&fd->refst) & 1) ? ret_fd : -1;
 }
 
-static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                      grpc_closure *on_done, int *release_fd,
-                      bool already_closed, const char *reason) {
+static void fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                      grpc_closure* on_done, int* release_fd,
+                      bool already_closed, const char* reason) {
   bool is_fd_closed = already_closed;
 
   gpr_mu_lock(&fd->orphan_mu);
@@ -401,49 +405,48 @@
   UNREF_BY(exec_ctx, fd, 2, reason); /* Drop the reference */
 }
 
-static grpc_pollset *fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx,
-                                                  grpc_fd *fd) {
+static grpc_pollset* fd_get_read_notifier_pollset(grpc_exec_ctx* exec_ctx,
+                                                  grpc_fd* fd) {
   gpr_atm notifier = gpr_atm_acq_load(&fd->read_notifier_pollset);
-  return (grpc_pollset *)notifier;
+  return (grpc_pollset*)notifier;
 }
 
-static bool fd_is_shutdown(grpc_fd *fd) {
-  return grpc_lfev_is_shutdown(&fd->read_closure);
+static bool fd_is_shutdown(grpc_fd* fd) {
+  return fd->read_closure->IsShutdown();
 }
 
 /* Might be called multiple times */
-static void fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_error *why) {
-  if (grpc_lfev_set_shutdown(exec_ctx, &fd->read_closure,
-                             GRPC_ERROR_REF(why))) {
+static void fd_shutdown(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_error* why) {
+  if (fd->read_closure->SetShutdown(exec_ctx, GRPC_ERROR_REF(why))) {
     shutdown(fd->fd, SHUT_RDWR);
-    grpc_lfev_set_shutdown(exec_ctx, &fd->write_closure, GRPC_ERROR_REF(why));
+    fd->write_closure->SetShutdown(exec_ctx, GRPC_ERROR_REF(why));
   }
   GRPC_ERROR_UNREF(why);
 }
 
-static void fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                              grpc_closure *closure) {
-  grpc_lfev_notify_on(exec_ctx, &fd->read_closure, closure, "read");
+static void fd_notify_on_read(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                              grpc_closure* closure) {
+  fd->read_closure->NotifyOn(exec_ctx, closure);
 }
 
-static void fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                               grpc_closure *closure) {
-  grpc_lfev_notify_on(exec_ctx, &fd->write_closure, closure, "write");
+static void fd_notify_on_write(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                               grpc_closure* closure) {
+  fd->write_closure->NotifyOn(exec_ctx, closure);
 }
 
 /*******************************************************************************
  * Pollable Definitions
  */
 
-static grpc_error *pollable_create(pollable_type type, pollable **p) {
+static grpc_error* pollable_create(pollable_type type, pollable** p) {
   *p = NULL;
 
   int epfd = epoll_create1(EPOLL_CLOEXEC);
   if (epfd == -1) {
     return GRPC_OS_ERROR(errno, "epoll_create1");
   }
-  *p = (pollable *)gpr_malloc(sizeof(**p));
-  grpc_error *err = grpc_wakeup_fd_init(&(*p)->wakeup);
+  *p = (pollable*)gpr_malloc(sizeof(**p));
+  grpc_error* err = grpc_wakeup_fd_init(&(*p)->wakeup);
   if (err != GRPC_ERROR_NONE) {
     close(epfd);
     gpr_free(*p);
@@ -452,7 +455,7 @@
   }
   struct epoll_event ev;
   ev.events = (uint32_t)(EPOLLIN | EPOLLET);
-  ev.data.ptr = (void *)(1 | (intptr_t) & (*p)->wakeup);
+  ev.data.ptr = (void*)(1 | (intptr_t) & (*p)->wakeup);
   if (epoll_ctl(epfd, EPOLL_CTL_ADD, (*p)->wakeup.read_fd, &ev) != 0) {
     err = GRPC_OS_ERROR(errno, "epoll_ctl");
     close(epfd);
@@ -476,10 +479,10 @@
 }
 
 #ifdef NDEBUG
-static pollable *pollable_ref(pollable *p) {
+static pollable* pollable_ref(pollable* p) {
 #else
-static pollable *pollable_ref(pollable *p, int line, const char *reason) {
-  if (grpc_trace_pollable_refcount.enabled()) {
+static pollable* pollable_ref(pollable* p, int line, const char* reason) {
+  if (GRPC_TRACER_ON(grpc_trace_pollable_refcount)) {
     int r = (int)gpr_atm_no_barrier_load(&p->refs.count);
     gpr_log(__FILE__, line, GPR_LOG_SEVERITY_DEBUG,
             "POLLABLE:%p   ref %d->%d %s", p, r, r + 1, reason);
@@ -490,11 +493,11 @@
 }
 
 #ifdef NDEBUG
-static void pollable_unref(pollable *p) {
+static void pollable_unref(pollable* p) {
 #else
-static void pollable_unref(pollable *p, int line, const char *reason) {
+static void pollable_unref(pollable* p, int line, const char* reason) {
   if (p == NULL) return;
-  if (grpc_trace_pollable_refcount.enabled()) {
+  if (GRPC_TRACER_ON(grpc_trace_pollable_refcount)) {
     int r = (int)gpr_atm_no_barrier_load(&p->refs.count);
     gpr_log(__FILE__, line, GPR_LOG_SEVERITY_DEBUG,
             "POLLABLE:%p unref %d->%d %s", p, r, r - 1, reason);
@@ -507,12 +510,12 @@
   }
 }
 
-static grpc_error *pollable_add_fd(pollable *p, grpc_fd *fd) {
-  grpc_error *error = GRPC_ERROR_NONE;
-  static const char *err_desc = "pollable_add_fd";
+static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) {
+  grpc_error* error = GRPC_ERROR_NONE;
+  static const char* err_desc = "pollable_add_fd";
   const int epfd = p->epfd;
 
-  if (grpc_polling_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "add fd %p (%d) to pollable %p", fd, fd->fd, p);
   }
 
@@ -539,7 +542,7 @@
 GPR_TLS_DECL(g_current_thread_worker);
 
 /* Global state management */
-static grpc_error *pollset_global_init(void) {
+static grpc_error* pollset_global_init(void) {
   gpr_tls_init(&g_current_thread_pollset);
   gpr_tls_init(&g_current_thread_worker);
   return pollable_create(PO_EMPTY, &g_empty_pollable);
@@ -552,9 +555,9 @@
 }
 
 /* pollset->mu must be held while calling this function */
-static void pollset_maybe_finish_shutdown(grpc_exec_ctx *exec_ctx,
-                                          grpc_pollset *pollset) {
-  if (grpc_polling_trace.enabled()) {
+static void pollset_maybe_finish_shutdown(grpc_exec_ctx* exec_ctx,
+                                          grpc_pollset* pollset) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG,
             "PS:%p (pollable:%p) maybe_finish_shutdown sc=%p (target:!NULL) "
             "rw=%p (target:NULL) cpsc=%d (target:0)",
@@ -571,21 +574,20 @@
 /* pollset->mu must be held before calling this function,
  * pollset->active_pollable->mu & specific_worker->pollable_obj->mu must not be
  * held */
-static grpc_error *kick_one_worker(grpc_exec_ctx *exec_ctx,
-                                   grpc_pollset_worker *specific_worker) {
-  pollable *p = specific_worker->pollable_obj;
+static grpc_error* kick_one_worker(grpc_exec_ctx* exec_ctx,
+                                   grpc_pollset_worker* specific_worker) {
+  pollable* p = specific_worker->pollable_obj;
   grpc_core::mu_guard lock(&p->mu);
-  GRPC_STATS_INC_POLLSET_KICK(exec_ctx);
   GPR_ASSERT(specific_worker != NULL);
   if (specific_worker->kicked) {
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_DEBUG, "PS:%p kicked_specific_but_already_kicked", p);
     }
     GRPC_STATS_INC_POLLSET_KICKED_AGAIN(exec_ctx);
     return GRPC_ERROR_NONE;
   }
   if (gpr_tls_get(&g_current_thread_worker) == (intptr_t)specific_worker) {
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_DEBUG, "PS:%p kicked_specific_but_awake", p);
     }
     GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(exec_ctx);
@@ -594,16 +596,16 @@
   }
   if (specific_worker == p->root_worker) {
     GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD(exec_ctx);
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_DEBUG, "PS:%p kicked_specific_via_wakeup_fd", p);
     }
     specific_worker->kicked = true;
-    grpc_error *error = grpc_wakeup_fd_wakeup(&p->wakeup);
+    grpc_error* error = grpc_wakeup_fd_wakeup(&p->wakeup);
     return error;
   }
   if (specific_worker->initialized_cv) {
     GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV(exec_ctx);
-    if (grpc_polling_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_polling_trace)) {
       gpr_log(GPR_DEBUG, "PS:%p kicked_specific_via_cv", p);
     }
     specific_worker->kicked = true;
@@ -615,20 +617,20 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                                grpc_pollset_worker *specific_worker) {
-  if (grpc_polling_trace.enabled()) {
+static grpc_error* pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                                grpc_pollset_worker* specific_worker) {
+  GRPC_STATS_INC_POLLSET_KICK(exec_ctx);
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG,
             "PS:%p kick %p tls_pollset=%p tls_worker=%p pollset.root_worker=%p",
             pollset, specific_worker,
-            (void *)gpr_tls_get(&g_current_thread_pollset),
-            (void *)gpr_tls_get(&g_current_thread_worker),
-            pollset->root_worker);
+            (void*)gpr_tls_get(&g_current_thread_pollset),
+            (void*)gpr_tls_get(&g_current_thread_worker), pollset->root_worker);
   }
   if (specific_worker == NULL) {
     if (gpr_tls_get(&g_current_thread_pollset) != (intptr_t)pollset) {
       if (pollset->root_worker == NULL) {
-        if (grpc_polling_trace.enabled()) {
+        if (GRPC_TRACER_ON(grpc_polling_trace)) {
           gpr_log(GPR_DEBUG, "PS:%p kicked_any_without_poller", pollset);
         }
         GRPC_STATS_INC_POLLSET_KICKED_WITHOUT_POLLER(exec_ctx);
@@ -654,7 +656,7 @@
             exec_ctx, pollset->root_worker->links[PWLINK_POLLSET].next);
       }
     } else {
-      if (grpc_polling_trace.enabled()) {
+      if (GRPC_TRACER_ON(grpc_polling_trace)) {
         gpr_log(GPR_DEBUG, "PS:%p kicked_any_but_awake", pollset);
       }
       GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD(exec_ctx);
@@ -665,13 +667,14 @@
   }
 }
 
-static grpc_error *pollset_kick_all(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset *pollset) {
-  grpc_error *error = GRPC_ERROR_NONE;
-  const char *err_desc = "pollset_kick_all";
-  grpc_pollset_worker *w = pollset->root_worker;
+static grpc_error* pollset_kick_all(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset* pollset) {
+  grpc_error* error = GRPC_ERROR_NONE;
+  const char* err_desc = "pollset_kick_all";
+  grpc_pollset_worker* w = pollset->root_worker;
   if (w != NULL) {
     do {
+      GRPC_STATS_INC_POLLSET_KICK(exec_ctx);
       append_error(&error, kick_one_worker(exec_ctx, w), err_desc);
       w = w->links[PWLINK_POLLSET].next;
     } while (w != pollset->root_worker);
@@ -679,13 +682,13 @@
   return error;
 }
 
-static void pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
+static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
   gpr_mu_init(&pollset->mu);
   pollset->active_pollable = POLLABLE_REF(g_empty_pollable, "pollset");
   *mu = &pollset->mu;
 }
 
-static int poll_deadline_to_millis_timeout(grpc_exec_ctx *exec_ctx,
+static int poll_deadline_to_millis_timeout(grpc_exec_ctx* exec_ctx,
                                            grpc_millis millis) {
   if (millis == GRPC_MILLIS_INF_FUTURE) return -1;
   grpc_millis delta = millis - grpc_exec_ctx_now(exec_ctx);
@@ -697,9 +700,9 @@
     return (int)delta;
 }
 
-static void fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                               grpc_pollset *notifier) {
-  grpc_lfev_set_ready(exec_ctx, &fd->read_closure, "read");
+static void fd_become_readable(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                               grpc_pollset* notifier) {
+  fd->read_closure->SetReady(exec_ctx);
 
   /* Note, it is possible that fd_become_readable might be called twice with
      different 'notifier's when an fd becomes readable and it is in two epoll
@@ -710,14 +713,14 @@
   gpr_atm_rel_store(&fd->read_notifier_pollset, (gpr_atm)notifier);
 }
 
-static void fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
-  grpc_lfev_set_ready(exec_ctx, &fd->write_closure, "write");
+static void fd_become_writable(grpc_exec_ctx* exec_ctx, grpc_fd* fd) {
+  fd->write_closure->SetReady(exec_ctx);
 }
 
-static grpc_error *fd_get_or_become_pollable(grpc_fd *fd, pollable **p) {
+static grpc_error* fd_get_or_become_pollable(grpc_fd* fd, pollable** p) {
   gpr_mu_lock(&fd->pollable_mu);
-  grpc_error *error = GRPC_ERROR_NONE;
-  static const char *err_desc = "fd_get_or_become_pollable";
+  grpc_error* error = GRPC_ERROR_NONE;
+  static const char* err_desc = "fd_get_or_become_pollable";
   if (fd->pollable_obj == NULL) {
     if (append_error(&error, pollable_create(PO_FD, &fd->pollable_obj),
                      err_desc)) {
@@ -741,39 +744,39 @@
 }
 
 /* pollset->po.mu lock must be held by the caller before calling this */
-static void pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                             grpc_closure *closure) {
+static void pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                             grpc_closure* closure) {
   GPR_ASSERT(pollset->shutdown_closure == NULL);
   pollset->shutdown_closure = closure;
   GRPC_LOG_IF_ERROR("pollset_shutdown", pollset_kick_all(exec_ctx, pollset));
   pollset_maybe_finish_shutdown(exec_ctx, pollset);
 }
 
-static grpc_error *pollable_process_events(grpc_exec_ctx *exec_ctx,
-                                           grpc_pollset *pollset,
-                                           pollable *pollable_obj, bool drain) {
-  static const char *err_desc = "pollset_process_events";
-  grpc_error *error = GRPC_ERROR_NONE;
+static grpc_error* pollable_process_events(grpc_exec_ctx* exec_ctx,
+                                           grpc_pollset* pollset,
+                                           pollable* pollable_obj, bool drain) {
+  static const char* err_desc = "pollset_process_events";
+  grpc_error* error = GRPC_ERROR_NONE;
   for (int i = 0; (drain || i < MAX_EPOLL_EVENTS_HANDLED_EACH_POLL_CALL) &&
                   pollable_obj->event_cursor != pollable_obj->event_count;
        i++) {
     int n = pollable_obj->event_cursor++;
-    struct epoll_event *ev = &pollable_obj->events[n];
-    void *data_ptr = ev->data.ptr;
+    struct epoll_event* ev = &pollable_obj->events[n];
+    void* data_ptr = ev->data.ptr;
     if (1 & (intptr_t)data_ptr) {
-      if (grpc_polling_trace.enabled()) {
+      if (GRPC_TRACER_ON(grpc_polling_trace)) {
         gpr_log(GPR_DEBUG, "PS:%p got pollset_wakeup %p", pollset, data_ptr);
       }
       append_error(&error,
                    grpc_wakeup_fd_consume_wakeup(
-                       (grpc_wakeup_fd *)((~(intptr_t)1) & (intptr_t)data_ptr)),
+                       (grpc_wakeup_fd*)((~(intptr_t)1) & (intptr_t)data_ptr)),
                    err_desc);
     } else {
-      grpc_fd *fd = (grpc_fd *)data_ptr;
+      grpc_fd* fd = (grpc_fd*)data_ptr;
       bool cancel = (ev->events & (EPOLLERR | EPOLLHUP)) != 0;
       bool read_ev = (ev->events & (EPOLLIN | EPOLLPRI)) != 0;
       bool write_ev = (ev->events & EPOLLOUT) != 0;
-      if (grpc_polling_trace.enabled()) {
+      if (GRPC_TRACER_ON(grpc_polling_trace)) {
         gpr_log(GPR_DEBUG,
                 "PS:%p got fd %p: cancel=%d read=%d "
                 "write=%d",
@@ -792,17 +795,17 @@
 }
 
 /* pollset_shutdown is guaranteed to be called before pollset_destroy. */
-static void pollset_destroy(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
+static void pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
   POLLABLE_UNREF(pollset->active_pollable, "pollset");
   pollset->active_pollable = NULL;
 }
 
-static grpc_error *pollable_epoll(grpc_exec_ctx *exec_ctx, pollable *p,
+static grpc_error* pollable_epoll(grpc_exec_ctx* exec_ctx, pollable* p,
                                   grpc_millis deadline) {
   int timeout = poll_deadline_to_millis_timeout(exec_ctx, deadline);
 
-  if (grpc_polling_trace.enabled()) {
-    char *desc = pollable_desc(p);
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
+    char* desc = pollable_desc(p);
     gpr_log(GPR_DEBUG, "POLLABLE:%p[%s] poll for %dms", p, desc, timeout);
     gpr_free(desc);
   }
@@ -821,7 +824,7 @@
 
   if (r < 0) return GRPC_OS_ERROR(errno, "epoll_wait");
 
-  if (grpc_polling_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "POLLABLE:%p got %d events", p, r);
   }
 
@@ -832,8 +835,8 @@
 }
 
 /* Return true if first in list */
-static bool worker_insert(grpc_pollset_worker **root_worker,
-                          grpc_pollset_worker *worker, pwlinks link) {
+static bool worker_insert(grpc_pollset_worker** root_worker,
+                          grpc_pollset_worker* worker, pwlinks link) {
   if (*root_worker == NULL) {
     *root_worker = worker;
     worker->links[link].next = worker->links[link].prev = worker;
@@ -850,8 +853,8 @@
 /* returns the new root IFF the root changed */
 typedef enum { WRR_NEW_ROOT, WRR_EMPTIED, WRR_REMOVED } worker_remove_result;
 
-static worker_remove_result worker_remove(grpc_pollset_worker **root_worker,
-                                          grpc_pollset_worker *worker,
+static worker_remove_result worker_remove(grpc_pollset_worker** root_worker,
+                                          grpc_pollset_worker* worker,
                                           pwlinks link) {
   if (worker == *root_worker) {
     if (worker == worker->links[link].next) {
@@ -871,9 +874,9 @@
 }
 
 /* Return true if this thread should poll */
-static bool begin_worker(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                         grpc_pollset_worker *worker,
-                         grpc_pollset_worker **worker_hdl,
+static bool begin_worker(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                         grpc_pollset_worker* worker,
+                         grpc_pollset_worker** worker_hdl,
                          grpc_millis deadline) {
   bool do_poll = (pollset->shutdown_closure == nullptr);
   if (worker_hdl != NULL) *worker_hdl = worker;
@@ -889,7 +892,7 @@
     worker->initialized_cv = true;
     gpr_cv_init(&worker->cv);
     gpr_mu_unlock(&pollset->mu);
-    if (grpc_polling_trace.enabled() &&
+    if (GRPC_TRACER_ON(grpc_polling_trace) &&
         worker->pollable_obj->root_worker != worker) {
       gpr_log(GPR_DEBUG, "PS:%p wait %p w=%p for %dms", pollset,
               worker->pollable_obj, worker,
@@ -898,18 +901,18 @@
     while (do_poll && worker->pollable_obj->root_worker != worker) {
       if (gpr_cv_wait(&worker->cv, &worker->pollable_obj->mu,
                       grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME))) {
-        if (grpc_polling_trace.enabled()) {
+        if (GRPC_TRACER_ON(grpc_polling_trace)) {
           gpr_log(GPR_DEBUG, "PS:%p timeout_wait %p w=%p", pollset,
                   worker->pollable_obj, worker);
         }
         do_poll = false;
       } else if (worker->kicked) {
-        if (grpc_polling_trace.enabled()) {
+        if (GRPC_TRACER_ON(grpc_polling_trace)) {
           gpr_log(GPR_DEBUG, "PS:%p wakeup %p w=%p", pollset,
                   worker->pollable_obj, worker);
         }
         do_poll = false;
-      } else if (grpc_polling_trace.enabled() &&
+      } else if (GRPC_TRACER_ON(grpc_polling_trace) &&
                  worker->pollable_obj->root_worker != worker) {
         gpr_log(GPR_DEBUG, "PS:%p spurious_wakeup %p w=%p", pollset,
                 worker->pollable_obj, worker);
@@ -924,16 +927,16 @@
   return do_poll;
 }
 
-static void end_worker(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                       grpc_pollset_worker *worker,
-                       grpc_pollset_worker **worker_hdl) {
+static void end_worker(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                       grpc_pollset_worker* worker,
+                       grpc_pollset_worker** worker_hdl) {
   gpr_mu_lock(&pollset->mu);
   gpr_mu_lock(&worker->pollable_obj->mu);
   switch (worker_remove(&worker->pollable_obj->root_worker, worker,
                         PWLINK_POLLABLE)) {
     case WRR_NEW_ROOT: {
       // wakeup new poller
-      grpc_pollset_worker *new_root = worker->pollable_obj->root_worker;
+      grpc_pollset_worker* new_root = worker->pollable_obj->root_worker;
       GPR_ASSERT(new_root->initialized_cv);
       gpr_cv_signal(&new_root->cv);
       break;
@@ -966,12 +969,12 @@
    The function pollset_work() may temporarily release the lock (pollset->po.mu)
    during the course of its execution but it will always re-acquire the lock and
    ensure that it is held by the time the function returns */
-static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                                grpc_pollset_worker **worker_hdl,
+static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                                grpc_pollset_worker** worker_hdl,
                                 grpc_millis deadline) {
 #ifdef GRPC_EPOLLEX_CREATE_WORKERS_ON_HEAP
-  grpc_pollset_worker *worker =
-      (grpc_pollset_worker *)gpr_malloc(sizeof(*worker));
+  grpc_pollset_worker* worker =
+      (grpc_pollset_worker*)gpr_malloc(sizeof(*worker));
 #define WORKER_PTR (worker)
 #else
   grpc_pollset_worker worker;
@@ -980,14 +983,15 @@
 #ifndef NDEBUG
   WORKER_PTR->originator = gettid();
 #endif
-  if (grpc_polling_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "PS:%p work hdl=%p worker=%p now=%" PRIdPTR
-                       " deadline=%" PRIdPTR " kwp=%d pollable=%p",
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
+    gpr_log(GPR_DEBUG,
+            "PS:%p work hdl=%p worker=%p now=%" PRIdPTR " deadline=%" PRIdPTR
+            " kwp=%d pollable=%p",
             pollset, worker_hdl, WORKER_PTR, grpc_exec_ctx_now(exec_ctx),
             deadline, pollset->kicked_without_poller, pollset->active_pollable);
   }
-  static const char *err_desc = "pollset_work";
-  grpc_error *error = GRPC_ERROR_NONE;
+  static const char* err_desc = "pollset_work";
+  grpc_error* error = GRPC_ERROR_NONE;
   if (pollset->kicked_without_poller) {
     pollset->kicked_without_poller = false;
   } else {
@@ -996,9 +1000,10 @@
       gpr_tls_set(&g_current_thread_worker, (intptr_t)WORKER_PTR);
       if (WORKER_PTR->pollable_obj->event_cursor ==
           WORKER_PTR->pollable_obj->event_count) {
-        append_error(&error, pollable_epoll(exec_ctx, WORKER_PTR->pollable_obj,
-                                            deadline),
-                     err_desc);
+        append_error(
+            &error,
+            pollable_epoll(exec_ctx, WORKER_PTR->pollable_obj, deadline),
+            err_desc);
       }
       append_error(&error,
                    pollable_process_events(exec_ctx, pollset,
@@ -1017,11 +1022,11 @@
   return error;
 }
 
-static grpc_error *pollset_transition_pollable_from_empty_to_fd_locked(
-    grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, grpc_fd *fd) {
-  static const char *err_desc = "pollset_transition_pollable_from_empty_to_fd";
-  grpc_error *error = GRPC_ERROR_NONE;
-  if (grpc_polling_trace.enabled()) {
+static grpc_error* pollset_transition_pollable_from_empty_to_fd_locked(
+    grpc_exec_ctx* exec_ctx, grpc_pollset* pollset, grpc_fd* fd) {
+  static const char* err_desc = "pollset_transition_pollable_from_empty_to_fd";
+  grpc_error* error = GRPC_ERROR_NONE;
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG,
             "PS:%p add fd %p (%d); transition pollable from empty to fd",
             pollset, fd, fd->fd);
@@ -1033,11 +1038,11 @@
   return error;
 }
 
-static grpc_error *pollset_transition_pollable_from_fd_to_multi_locked(
-    grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, grpc_fd *and_add_fd) {
-  static const char *err_desc = "pollset_transition_pollable_from_fd_to_multi";
-  grpc_error *error = GRPC_ERROR_NONE;
-  if (grpc_polling_trace.enabled()) {
+static grpc_error* pollset_transition_pollable_from_fd_to_multi_locked(
+    grpc_exec_ctx* exec_ctx, grpc_pollset* pollset, grpc_fd* and_add_fd) {
+  static const char* err_desc = "pollset_transition_pollable_from_fd_to_multi";
+  grpc_error* error = GRPC_ERROR_NONE;
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(
         GPR_DEBUG,
         "PS:%p add fd %p (%d); transition pollable from fd %p to multipoller",
@@ -1045,7 +1050,7 @@
         pollset->active_pollable->owner_fd);
   }
   append_error(&error, pollset_kick_all(exec_ctx, pollset), err_desc);
-  grpc_fd *initial_fd = pollset->active_pollable->owner_fd;
+  grpc_fd* initial_fd = pollset->active_pollable->owner_fd;
   POLLABLE_UNREF(pollset->active_pollable, "pollset");
   pollset->active_pollable = NULL;
   if (append_error(&error, pollable_create(PO_MULTI, &pollset->active_pollable),
@@ -1062,10 +1067,10 @@
 }
 
 /* expects pollsets locked, flag whether fd is locked or not */
-static grpc_error *pollset_add_fd_locked(grpc_exec_ctx *exec_ctx,
-                                         grpc_pollset *pollset, grpc_fd *fd) {
-  grpc_error *error = GRPC_ERROR_NONE;
-  pollable *po_at_start =
+static grpc_error* pollset_add_fd_locked(grpc_exec_ctx* exec_ctx,
+                                         grpc_pollset* pollset, grpc_fd* fd) {
+  grpc_error* error = GRPC_ERROR_NONE;
+  pollable* po_at_start =
       POLLABLE_REF(pollset->active_pollable, "pollset_add_fd");
   switch (pollset->active_pollable->type) {
     case PO_EMPTY:
@@ -1099,11 +1104,11 @@
   return error;
 }
 
-static grpc_error *pollset_as_multipollable_locked(grpc_exec_ctx *exec_ctx,
-                                                   grpc_pollset *pollset,
-                                                   pollable **pollable_obj) {
-  grpc_error *error = GRPC_ERROR_NONE;
-  pollable *po_at_start =
+static grpc_error* pollset_as_multipollable_locked(grpc_exec_ctx* exec_ctx,
+                                                   grpc_pollset* pollset,
+                                                   pollable** pollable_obj) {
+  grpc_error* error = GRPC_ERROR_NONE;
+  pollable* po_at_start =
       POLLABLE_REF(pollset->active_pollable, "pollset_as_multipollable");
   switch (pollset->active_pollable->type) {
     case PO_EMPTY:
@@ -1136,10 +1141,10 @@
   return error;
 }
 
-static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           grpc_fd *fd) {
+static void pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           grpc_fd* fd) {
   gpr_mu_lock(&pollset->mu);
-  grpc_error *error = pollset_add_fd_locked(exec_ctx, pollset, fd);
+  grpc_error* error = pollset_add_fd_locked(exec_ctx, pollset, fd);
   gpr_mu_unlock(&pollset->mu);
   GRPC_LOG_IF_ERROR("pollset_add_fd", error);
 }
@@ -1148,7 +1153,7 @@
  * Pollset-set Definitions
  */
 
-static grpc_pollset_set *pss_lock_adam(grpc_pollset_set *pss) {
+static grpc_pollset_set* pss_lock_adam(grpc_pollset_set* pss) {
   gpr_mu_lock(&pss->mu);
   while (pss->parent != NULL) {
     gpr_mu_unlock(&pss->mu);
@@ -1158,14 +1163,14 @@
   return pss;
 }
 
-static grpc_pollset_set *pollset_set_create(void) {
-  grpc_pollset_set *pss = (grpc_pollset_set *)gpr_zalloc(sizeof(*pss));
+static grpc_pollset_set* pollset_set_create(void) {
+  grpc_pollset_set* pss = (grpc_pollset_set*)gpr_zalloc(sizeof(*pss));
   gpr_mu_init(&pss->mu);
   gpr_ref_init(&pss->refs, 1);
   return pss;
 }
 
-static void pollset_set_unref(grpc_exec_ctx *exec_ctx, grpc_pollset_set *pss) {
+static void pollset_set_unref(grpc_exec_ctx* exec_ctx, grpc_pollset_set* pss) {
   if (pss == NULL) return;
   if (!gpr_unref(&pss->refs)) return;
   pollset_set_unref(exec_ctx, pss->parent);
@@ -1185,13 +1190,13 @@
   gpr_free(pss);
 }
 
-static void pollset_set_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset_set *pss,
-                               grpc_fd *fd) {
-  if (grpc_polling_trace.enabled()) {
+static void pollset_set_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset_set* pss,
+                               grpc_fd* fd) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "PSS:%p: add fd %p (%d)", pss, fd, fd->fd);
   }
-  grpc_error *error = GRPC_ERROR_NONE;
-  static const char *err_desc = "pollset_set_add_fd";
+  grpc_error* error = GRPC_ERROR_NONE;
+  static const char* err_desc = "pollset_set_add_fd";
   pss = pss_lock_adam(pss);
   for (size_t i = 0; i < pss->pollset_count; i++) {
     append_error(&error, pollable_add_fd(pss->pollsets[i]->active_pollable, fd),
@@ -1200,7 +1205,7 @@
   if (pss->fd_count == pss->fd_capacity) {
     pss->fd_capacity = GPR_MAX(pss->fd_capacity * 2, 8);
     pss->fds =
-        (grpc_fd **)gpr_realloc(pss->fds, pss->fd_capacity * sizeof(*pss->fds));
+        (grpc_fd**)gpr_realloc(pss->fds, pss->fd_capacity * sizeof(*pss->fds));
   }
   REF_BY(fd, 2, "pollset_set");
   pss->fds[pss->fd_count++] = fd;
@@ -1209,9 +1214,9 @@
   GRPC_LOG_IF_ERROR(err_desc, error);
 }
 
-static void pollset_set_del_fd(grpc_exec_ctx *exec_ctx, grpc_pollset_set *pss,
-                               grpc_fd *fd) {
-  if (grpc_polling_trace.enabled()) {
+static void pollset_set_del_fd(grpc_exec_ctx* exec_ctx, grpc_pollset_set* pss,
+                               grpc_fd* fd) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "PSS:%p: del fd %p", pss, fd);
   }
   pss = pss_lock_adam(pss);
@@ -1230,9 +1235,9 @@
   gpr_mu_unlock(&pss->mu);
 }
 
-static void pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset_set *pss, grpc_pollset *ps) {
-  if (grpc_polling_trace.enabled()) {
+static void pollset_set_del_pollset(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset_set* pss, grpc_pollset* ps) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "PSS:%p: del pollset %p", pss, ps);
   }
   pss = pss_lock_adam(pss);
@@ -1257,12 +1262,12 @@
 
 // add all fds to pollables, and output a new array of unorphaned out_fds
 // assumes pollsets are multipollable
-static grpc_error *add_fds_to_pollsets(grpc_exec_ctx *exec_ctx, grpc_fd **fds,
-                                       size_t fd_count, grpc_pollset **pollsets,
+static grpc_error* add_fds_to_pollsets(grpc_exec_ctx* exec_ctx, grpc_fd** fds,
+                                       size_t fd_count, grpc_pollset** pollsets,
                                        size_t pollset_count,
-                                       const char *err_desc, grpc_fd **out_fds,
-                                       size_t *out_fd_count) {
-  grpc_error *error = GRPC_ERROR_NONE;
+                                       const char* err_desc, grpc_fd** out_fds,
+                                       size_t* out_fd_count) {
+  grpc_error* error = GRPC_ERROR_NONE;
   for (size_t i = 0; i < fd_count; i++) {
     gpr_mu_lock(&fds[i]->orphan_mu);
     if ((gpr_atm_no_barrier_load(&fds[i]->refst) & 1) == 0) {
@@ -1281,14 +1286,14 @@
   return error;
 }
 
-static void pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset_set *pss, grpc_pollset *ps) {
-  if (grpc_polling_trace.enabled()) {
+static void pollset_set_add_pollset(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset_set* pss, grpc_pollset* ps) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "PSS:%p: add pollset %p", pss, ps);
   }
-  grpc_error *error = GRPC_ERROR_NONE;
-  static const char *err_desc = "pollset_set_add_pollset";
-  pollable *pollable_obj = NULL;
+  grpc_error* error = GRPC_ERROR_NONE;
+  static const char* err_desc = "pollset_set_add_pollset";
+  pollable* pollable_obj = NULL;
   gpr_mu_lock(&ps->mu);
   if (!GRPC_LOG_IF_ERROR(err_desc, pollset_as_multipollable_locked(
                                        exec_ctx, ps, &pollable_obj))) {
@@ -1307,7 +1312,7 @@
                err_desc);
   if (pss->pollset_count == pss->pollset_capacity) {
     pss->pollset_capacity = GPR_MAX(pss->pollset_capacity * 2, 8);
-    pss->pollsets = (grpc_pollset **)gpr_realloc(
+    pss->pollsets = (grpc_pollset**)gpr_realloc(
         pss->pollsets, pss->pollset_capacity * sizeof(*pss->pollsets));
   }
   pss->pollsets[pss->pollset_count++] = ps;
@@ -1317,24 +1322,24 @@
   GRPC_LOG_IF_ERROR(err_desc, error);
 }
 
-static void pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset_set *a,
-                                        grpc_pollset_set *b) {
-  if (grpc_polling_trace.enabled()) {
+static void pollset_set_add_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset_set* a,
+                                        grpc_pollset_set* b) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "PSS: merge (%p, %p)", a, b);
   }
-  grpc_error *error = GRPC_ERROR_NONE;
-  static const char *err_desc = "pollset_set_add_fd";
+  grpc_error* error = GRPC_ERROR_NONE;
+  static const char* err_desc = "pollset_set_add_fd";
   for (;;) {
     if (a == b) {
       // pollset ancestors are the same: nothing to do
       return;
     }
     if (a > b) {
-      GPR_SWAP(grpc_pollset_set *, a, b);
+      GPR_SWAP(grpc_pollset_set*, a, b);
     }
-    gpr_mu *a_mu = &a->mu;
-    gpr_mu *b_mu = &b->mu;
+    gpr_mu* a_mu = &a->mu;
+    gpr_mu* b_mu = &b->mu;
     gpr_mu_lock(a_mu);
     gpr_mu_lock(b_mu);
     if (a->parent != NULL) {
@@ -1352,31 +1357,33 @@
   const size_t a_size = a->fd_count + a->pollset_count;
   const size_t b_size = b->fd_count + b->pollset_count;
   if (b_size > a_size) {
-    GPR_SWAP(grpc_pollset_set *, a, b);
+    GPR_SWAP(grpc_pollset_set*, a, b);
   }
-  if (grpc_polling_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_log(GPR_DEBUG, "PSS: parent %p to %p", b, a);
   }
   gpr_ref(&a->refs);
   b->parent = a;
   if (a->fd_capacity < a->fd_count + b->fd_count) {
     a->fd_capacity = GPR_MAX(2 * a->fd_capacity, a->fd_count + b->fd_count);
-    a->fds = (grpc_fd **)gpr_realloc(a->fds, a->fd_capacity * sizeof(*a->fds));
+    a->fds = (grpc_fd**)gpr_realloc(a->fds, a->fd_capacity * sizeof(*a->fds));
   }
   size_t initial_a_fd_count = a->fd_count;
   a->fd_count = 0;
-  append_error(&error, add_fds_to_pollsets(exec_ctx, a->fds, initial_a_fd_count,
-                                           b->pollsets, b->pollset_count,
-                                           "merge_a2b", a->fds, &a->fd_count),
-               err_desc);
-  append_error(&error, add_fds_to_pollsets(exec_ctx, b->fds, b->fd_count,
-                                           a->pollsets, a->pollset_count,
-                                           "merge_b2a", a->fds, &a->fd_count),
-               err_desc);
+  append_error(
+      &error,
+      add_fds_to_pollsets(exec_ctx, a->fds, initial_a_fd_count, b->pollsets,
+                          b->pollset_count, "merge_a2b", a->fds, &a->fd_count),
+      err_desc);
+  append_error(
+      &error,
+      add_fds_to_pollsets(exec_ctx, b->fds, b->fd_count, a->pollsets,
+                          a->pollset_count, "merge_b2a", a->fds, &a->fd_count),
+      err_desc);
   if (a->pollset_capacity < a->pollset_count + b->pollset_count) {
     a->pollset_capacity =
         GPR_MAX(2 * a->pollset_capacity, a->pollset_count + b->pollset_count);
-    a->pollsets = (grpc_pollset **)gpr_realloc(
+    a->pollsets = (grpc_pollset**)gpr_realloc(
         a->pollsets, a->pollset_capacity * sizeof(*a->pollsets));
   }
   if (b->pollset_count > 0) {
@@ -1393,9 +1400,9 @@
   gpr_mu_unlock(&b->mu);
 }
 
-static void pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset_set *bag,
-                                        grpc_pollset_set *item) {}
+static void pollset_set_del_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset_set* bag,
+                                        grpc_pollset_set* item) {}
 
 /*******************************************************************************
  * Event engine binding
@@ -1437,20 +1444,26 @@
     shutdown_engine,
 };
 
-const grpc_event_engine_vtable *grpc_init_epollex_linux(
+const grpc_event_engine_vtable* grpc_init_epollex_linux(
     bool explicitly_requested) {
   if (!explicitly_requested) {
     return NULL;
   }
 
   if (!grpc_has_wakeup_fd()) {
+    gpr_log(GPR_ERROR, "Skipping epollex because of no wakeup fd.");
     return NULL;
   }
 
   if (!grpc_is_epollexclusive_available()) {
+    gpr_log(GPR_INFO, "Skipping epollex because it is not supported.");
     return NULL;
   }
 
+#ifndef NDEBUG
+  grpc_register_tracer(&grpc_trace_pollable_refcount);
+#endif
+
   fd_global_init();
 
   if (!GRPC_LOG_IF_ERROR("pollset_global_init", pollset_global_init())) {
@@ -1467,8 +1480,10 @@
 #include "src/core/lib/iomgr/ev_epollex_linux.h"
 /* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
  * NULL */
-const grpc_event_engine_vtable *grpc_init_epollex_linux(
+const grpc_event_engine_vtable* grpc_init_epollex_linux(
     bool explicitly_requested) {
+  gpr_log(GPR_ERROR,
+          "Skipping epollex becuase GRPC_LINUX_EPOLL is not defined.");
   return NULL;
 }
 #endif /* defined(GRPC_POSIX_SOCKET) */
diff --git a/src/core/lib/iomgr/ev_epollex_linux.h b/src/core/lib/iomgr/ev_epollex_linux.h
index 2849a23..22b536c 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.h
+++ b/src/core/lib/iomgr/ev_epollex_linux.h
@@ -26,7 +26,7 @@
 extern "C" {
 #endif
 
-const grpc_event_engine_vtable *grpc_init_epollex_linux(
+const grpc_event_engine_vtable* grpc_init_epollex_linux(
     bool explicitly_requested);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/iomgr/ev_epollsig_linux.cc b/src/core/lib/iomgr/ev_epollsig_linux.cc
index ad7b27b..42806e9 100644
--- a/src/core/lib/iomgr/ev_epollsig_linux.cc
+++ b/src/core/lib/iomgr/ev_epollsig_linux.cc
@@ -19,6 +19,7 @@
 #include "src/core/lib/iomgr/port.h"
 
 #include <grpc/grpc_posix.h>
+#include <grpc/support/log.h>
 
 /* This polling engine is only relevant on linux kernels supporting epoll() */
 #ifdef GRPC_LINUX_EPOLL
@@ -37,7 +38,6 @@
 #include <unistd.h>
 
 #include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/tls.h>
 #include <grpc/support/useful.h>
@@ -50,12 +50,13 @@
 #include "src/core/lib/iomgr/timer.h"
 #include "src/core/lib/iomgr/wakeup_fd_posix.h"
 #include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/support/manual_constructor.h"
 
-#define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker *)1)
+#define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker*)1)
 
-#define GRPC_POLLING_TRACE(...)       \
-  if (grpc_polling_trace.enabled()) { \
-    gpr_log(GPR_INFO, __VA_ARGS__);   \
+#define GRPC_POLLING_TRACE(...)             \
+  if (GRPC_TRACER_ON(grpc_polling_trace)) { \
+    gpr_log(GPR_INFO, __VA_ARGS__);         \
   }
 
 static int grpc_wakeup_signal = -1;
@@ -90,10 +91,10 @@
   poll_obj_type obj_type;
 #endif
   gpr_mu mu;
-  struct polling_island *pi;
+  struct polling_island* pi;
 } poll_obj;
 
-const char *poll_obj_string(poll_obj_type po_type) {
+const char* poll_obj_string(poll_obj_type po_type) {
   switch (po_type) {
     case POLL_OBJ_FD:
       return "fd";
@@ -106,11 +107,11 @@
   GPR_UNREACHABLE_CODE(return "UNKNOWN");
 }
 
-/*******************************************************************************
- * Fd Declarations
- */
+  /*******************************************************************************
+   * Fd Declarations
+   */
 
-#define FD_FROM_PO(po) ((grpc_fd *)(po))
+#define FD_FROM_PO(po) ((grpc_fd*)(po))
 
 struct grpc_fd {
   poll_obj po;
@@ -127,11 +128,11 @@
      valid */
   bool orphaned;
 
-  gpr_atm read_closure;
-  gpr_atm write_closure;
+  grpc_core::ManualConstructor<grpc_core::LockfreeEvent> read_closure;
+  grpc_core::ManualConstructor<grpc_core::LockfreeEvent> write_closure;
 
-  struct grpc_fd *freelist_next;
-  grpc_closure *on_done_closure;
+  struct grpc_fd* freelist_next;
+  grpc_closure* on_done_closure;
 
   /* The pollset that last noticed that the fd is readable. The actual type
    * stored in this is (grpc_pollset *) */
@@ -142,14 +143,14 @@
 
 /* Reference counting for fds */
 #ifndef NDEBUG
-static void fd_ref(grpc_fd *fd, const char *reason, const char *file, int line);
-static void fd_unref(grpc_fd *fd, const char *reason, const char *file,
+static void fd_ref(grpc_fd* fd, const char* reason, const char* file, int line);
+static void fd_unref(grpc_fd* fd, const char* reason, const char* file,
                      int line);
 #define GRPC_FD_REF(fd, reason) fd_ref(fd, reason, __FILE__, __LINE__)
 #define GRPC_FD_UNREF(fd, reason) fd_unref(fd, reason, __FILE__, __LINE__)
 #else
-static void fd_ref(grpc_fd *fd);
-static void fd_unref(grpc_fd *fd);
+static void fd_ref(grpc_fd* fd);
+static void fd_unref(grpc_fd* fd);
 #define GRPC_FD_REF(fd, reason) fd_ref(fd)
 #define GRPC_FD_UNREF(fd, reason) fd_unref(fd)
 #endif
@@ -203,7 +204,7 @@
   /* The file descriptors in the epoll set */
   size_t fd_cnt;
   size_t fd_capacity;
-  grpc_fd **fds;
+  grpc_fd** fds;
 } polling_island;
 
 /*******************************************************************************
@@ -215,8 +216,8 @@
 
   /* Used to prevent a worker from getting kicked multiple times */
   gpr_atm is_kicked;
-  struct grpc_pollset_worker *next;
-  struct grpc_pollset_worker *prev;
+  struct grpc_pollset_worker* next;
+  struct grpc_pollset_worker* prev;
 };
 
 struct grpc_pollset {
@@ -227,7 +228,7 @@
 
   bool shutting_down;          /* Is the pollset shutting down ? */
   bool finish_shutdown_called; /* Is the 'finish_shutdown_locked()' called ? */
-  grpc_closure *shutdown_done; /* Called after after shutdown is complete */
+  grpc_closure* shutdown_done; /* Called after after shutdown is complete */
 };
 
 /*******************************************************************************
@@ -241,8 +242,8 @@
  * Common helpers
  */
 
-static bool append_error(grpc_error **composite, grpc_error *error,
-                         const char *desc) {
+static bool append_error(grpc_error** composite, grpc_error* error,
+                         const char* desc) {
   if (error == GRPC_ERROR_NONE) return true;
   if (*composite == GRPC_ERROR_NONE) {
     *composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc);
@@ -266,10 +267,10 @@
 
 /* The polling island being polled right now.
    See comments in workqueue_maybe_wakeup for why this is tracked. */
-static __thread polling_island *g_current_thread_polling_island;
+static __thread polling_island* g_current_thread_polling_island;
 
 /* Forward declaration */
-static void polling_island_delete(grpc_exec_ctx *exec_ctx, polling_island *pi);
+static void polling_island_delete(grpc_exec_ctx* exec_ctx, polling_island* pi);
 
 #ifdef GRPC_TSAN
 /* Currently TSAN may incorrectly flag data races between epoll_ctl and
@@ -282,38 +283,40 @@
 gpr_atm g_epoll_sync;
 #endif /* defined(GRPC_TSAN) */
 
-static void pi_add_ref(polling_island *pi);
-static void pi_unref(grpc_exec_ctx *exec_ctx, polling_island *pi);
+static void pi_add_ref(polling_island* pi);
+static void pi_unref(grpc_exec_ctx* exec_ctx, polling_island* pi);
 
 #ifndef NDEBUG
-static void pi_add_ref_dbg(polling_island *pi, const char *reason,
-                           const char *file, int line) {
-  if (grpc_polling_trace.enabled()) {
+static void pi_add_ref_dbg(polling_island* pi, const char* reason,
+                           const char* file, int line) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_atm old_cnt = gpr_atm_acq_load(&pi->ref_count);
-    gpr_log(GPR_DEBUG, "Add ref pi: %p, old:%" PRIdPTR " -> new:%" PRIdPTR
-                       " (%s) - (%s, %d)",
+    gpr_log(GPR_DEBUG,
+            "Add ref pi: %p, old:%" PRIdPTR " -> new:%" PRIdPTR
+            " (%s) - (%s, %d)",
             pi, old_cnt, old_cnt + 1, reason, file, line);
   }
   pi_add_ref(pi);
 }
 
-static void pi_unref_dbg(grpc_exec_ctx *exec_ctx, polling_island *pi,
-                         const char *reason, const char *file, int line) {
-  if (grpc_polling_trace.enabled()) {
+static void pi_unref_dbg(grpc_exec_ctx* exec_ctx, polling_island* pi,
+                         const char* reason, const char* file, int line) {
+  if (GRPC_TRACER_ON(grpc_polling_trace)) {
     gpr_atm old_cnt = gpr_atm_acq_load(&pi->ref_count);
-    gpr_log(GPR_DEBUG, "Unref pi: %p, old:%" PRIdPTR " -> new:%" PRIdPTR
-                       " (%s) - (%s, %d)",
+    gpr_log(GPR_DEBUG,
+            "Unref pi: %p, old:%" PRIdPTR " -> new:%" PRIdPTR
+            " (%s) - (%s, %d)",
             pi, old_cnt, (old_cnt - 1), reason, file, line);
   }
   pi_unref(exec_ctx, pi);
 }
 #endif
 
-static void pi_add_ref(polling_island *pi) {
+static void pi_add_ref(polling_island* pi) {
   gpr_atm_no_barrier_fetch_add(&pi->ref_count, 1);
 }
 
-static void pi_unref(grpc_exec_ctx *exec_ctx, polling_island *pi) {
+static void pi_unref(grpc_exec_ctx* exec_ctx, polling_island* pi) {
   /* If ref count went to zero, delete the polling island.
      Note that this deletion not be done under a lock. Once the ref count goes
      to zero, we are guaranteed that no one else holds a reference to the
@@ -323,7 +326,7 @@
      non-empty, we should remove a ref to the merged_to polling island
    */
   if (1 == gpr_atm_full_fetch_add(&pi->ref_count, -1)) {
-    polling_island *next = (polling_island *)gpr_atm_acq_load(&pi->merged_to);
+    polling_island* next = (polling_island*)gpr_atm_acq_load(&pi->merged_to);
     polling_island_delete(exec_ctx, pi);
     if (next != NULL) {
       PI_UNREF(exec_ctx, next, "pi_delete"); /* Recursive call */
@@ -332,14 +335,14 @@
 }
 
 /* The caller is expected to hold pi->mu lock before calling this function */
-static void polling_island_add_fds_locked(polling_island *pi, grpc_fd **fds,
+static void polling_island_add_fds_locked(polling_island* pi, grpc_fd** fds,
                                           size_t fd_count, bool add_fd_refs,
-                                          grpc_error **error) {
+                                          grpc_error** error) {
   int err;
   size_t i;
   struct epoll_event ev;
-  char *err_msg;
-  const char *err_desc = "polling_island_add_fds";
+  char* err_msg;
+  const char* err_desc = "polling_island_add_fds";
 
 #ifdef GRPC_TSAN
   /* See the definition of g_epoll_sync for more context */
@@ -367,7 +370,7 @@
     if (pi->fd_cnt == pi->fd_capacity) {
       pi->fd_capacity = GPR_MAX(pi->fd_capacity + 8, pi->fd_cnt * 3 / 2);
       pi->fds =
-          (grpc_fd **)gpr_realloc(pi->fds, sizeof(grpc_fd *) * pi->fd_capacity);
+          (grpc_fd**)gpr_realloc(pi->fds, sizeof(grpc_fd*) * pi->fd_capacity);
     }
 
     pi->fds[pi->fd_cnt++] = fds[i];
@@ -378,13 +381,13 @@
 }
 
 /* The caller is expected to hold pi->mu before calling this */
-static void polling_island_add_wakeup_fd_locked(polling_island *pi,
-                                                grpc_wakeup_fd *wakeup_fd,
-                                                grpc_error **error) {
+static void polling_island_add_wakeup_fd_locked(polling_island* pi,
+                                                grpc_wakeup_fd* wakeup_fd,
+                                                grpc_error** error) {
   struct epoll_event ev;
   int err;
-  char *err_msg;
-  const char *err_desc = "polling_island_add_wakeup_fd";
+  char* err_msg;
+  const char* err_desc = "polling_island_add_wakeup_fd";
 
   ev.events = (uint32_t)(EPOLLIN | EPOLLET);
   ev.data.ptr = wakeup_fd;
@@ -402,13 +405,13 @@
 }
 
 /* The caller is expected to hold pi->mu lock before calling this function */
-static void polling_island_remove_all_fds_locked(polling_island *pi,
+static void polling_island_remove_all_fds_locked(polling_island* pi,
                                                  bool remove_fd_refs,
-                                                 grpc_error **error) {
+                                                 grpc_error** error) {
   int err;
   size_t i;
-  char *err_msg;
-  const char *err_desc = "polling_island_remove_fds";
+  char* err_msg;
+  const char* err_desc = "polling_island_remove_fds";
 
   for (i = 0; i < pi->fd_cnt; i++) {
     err = epoll_ctl(pi->epoll_fd, EPOLL_CTL_DEL, pi->fds[i]->fd, NULL);
@@ -430,13 +433,13 @@
 }
 
 /* The caller is expected to hold pi->mu lock before calling this function */
-static void polling_island_remove_fd_locked(polling_island *pi, grpc_fd *fd,
+static void polling_island_remove_fd_locked(polling_island* pi, grpc_fd* fd,
                                             bool is_fd_closed,
-                                            grpc_error **error) {
+                                            grpc_error** error) {
   int err;
   size_t i;
-  char *err_msg;
-  const char *err_desc = "polling_island_remove_fd";
+  char* err_msg;
+  const char* err_desc = "polling_island_remove_fd";
 
   /* If fd is already closed, then it would have been automatically been removed
      from the epoll set */
@@ -462,15 +465,15 @@
 }
 
 /* Might return NULL in case of an error */
-static polling_island *polling_island_create(grpc_exec_ctx *exec_ctx,
-                                             grpc_fd *initial_fd,
-                                             grpc_error **error) {
-  polling_island *pi = NULL;
-  const char *err_desc = "polling_island_create";
+static polling_island* polling_island_create(grpc_exec_ctx* exec_ctx,
+                                             grpc_fd* initial_fd,
+                                             grpc_error** error) {
+  polling_island* pi = NULL;
+  const char* err_desc = "polling_island_create";
 
   *error = GRPC_ERROR_NONE;
 
-  pi = (polling_island *)gpr_malloc(sizeof(*pi));
+  pi = (polling_island*)gpr_malloc(sizeof(*pi));
   gpr_mu_init(&pi->mu);
   pi->fd_cnt = 0;
   pi->fd_capacity = 0;
@@ -500,7 +503,7 @@
   return pi;
 }
 
-static void polling_island_delete(grpc_exec_ctx *exec_ctx, polling_island *pi) {
+static void polling_island_delete(grpc_exec_ctx* exec_ctx, polling_island* pi) {
   GPR_ASSERT(pi->fd_cnt == 0);
 
   if (pi->epoll_fd >= 0) {
@@ -514,11 +517,11 @@
 /* Attempts to gets the last polling island in the linked list (liked by the
  * 'merged_to' field). Since this does not lock the polling island, there are no
  * guarantees that the island returned is the last island */
-static polling_island *polling_island_maybe_get_latest(polling_island *pi) {
-  polling_island *next = (polling_island *)gpr_atm_acq_load(&pi->merged_to);
+static polling_island* polling_island_maybe_get_latest(polling_island* pi) {
+  polling_island* next = (polling_island*)gpr_atm_acq_load(&pi->merged_to);
   while (next != NULL) {
     pi = next;
-    next = (polling_island *)gpr_atm_acq_load(&pi->merged_to);
+    next = (polling_island*)gpr_atm_acq_load(&pi->merged_to);
   }
 
   return pi;
@@ -533,18 +536,18 @@
       ... critical section ..
       ...
       gpr_mu_unlock(&pi_latest->mu); // NOTE: use pi_latest->mu. NOT pi->mu */
-static polling_island *polling_island_lock(polling_island *pi) {
-  polling_island *next = NULL;
+static polling_island* polling_island_lock(polling_island* pi) {
+  polling_island* next = NULL;
 
   while (true) {
-    next = (polling_island *)gpr_atm_acq_load(&pi->merged_to);
+    next = (polling_island*)gpr_atm_acq_load(&pi->merged_to);
     if (next == NULL) {
       /* Looks like 'pi' is the last node in the linked list but unless we check
          this by holding the pi->mu lock, we cannot be sure (i.e without the
          pi->mu lock, we don't prevent island merges).
          To be absolutely sure, check once more by holding the pi->mu lock */
       gpr_mu_lock(&pi->mu);
-      next = (polling_island *)gpr_atm_acq_load(&pi->merged_to);
+      next = (polling_island*)gpr_atm_acq_load(&pi->merged_to);
       if (next == NULL) {
         /* pi is infact the last node and we have the pi->mu lock. we're done */
         break;
@@ -582,11 +585,11 @@
      // Release locks: Always call polling_island_unlock_pair() to release locks
      polling_island_unlock_pair(p1, p2);
 */
-static void polling_island_lock_pair(polling_island **p, polling_island **q) {
-  polling_island *pi_1 = *p;
-  polling_island *pi_2 = *q;
-  polling_island *next_1 = NULL;
-  polling_island *next_2 = NULL;
+static void polling_island_lock_pair(polling_island** p, polling_island** q) {
+  polling_island* pi_1 = *p;
+  polling_island* pi_2 = *q;
+  polling_island* next_1 = NULL;
+  polling_island* next_2 = NULL;
 
   /* The algorithm is simple:
       - Go to the last polling islands in the linked lists *pi_1 and *pi_2 (and
@@ -603,16 +606,16 @@
       - If the polling islands are the last islands, we are done. If not,
         release the locks and continue the process from the first step */
   while (true) {
-    next_1 = (polling_island *)gpr_atm_acq_load(&pi_1->merged_to);
+    next_1 = (polling_island*)gpr_atm_acq_load(&pi_1->merged_to);
     while (next_1 != NULL) {
       pi_1 = next_1;
-      next_1 = (polling_island *)gpr_atm_acq_load(&pi_1->merged_to);
+      next_1 = (polling_island*)gpr_atm_acq_load(&pi_1->merged_to);
     }
 
-    next_2 = (polling_island *)gpr_atm_acq_load(&pi_2->merged_to);
+    next_2 = (polling_island*)gpr_atm_acq_load(&pi_2->merged_to);
     while (next_2 != NULL) {
       pi_2 = next_2;
-      next_2 = (polling_island *)gpr_atm_acq_load(&pi_2->merged_to);
+      next_2 = (polling_island*)gpr_atm_acq_load(&pi_2->merged_to);
     }
 
     if (pi_1 == pi_2) {
@@ -628,8 +631,8 @@
       gpr_mu_lock(&pi_1->mu);
     }
 
-    next_1 = (polling_island *)gpr_atm_acq_load(&pi_1->merged_to);
-    next_2 = (polling_island *)gpr_atm_acq_load(&pi_2->merged_to);
+    next_1 = (polling_island*)gpr_atm_acq_load(&pi_1->merged_to);
+    next_2 = (polling_island*)gpr_atm_acq_load(&pi_2->merged_to);
     if (next_1 == NULL && next_2 == NULL) {
       break;
     }
@@ -642,7 +645,7 @@
   *q = pi_2;
 }
 
-static void polling_island_unlock_pair(polling_island *p, polling_island *q) {
+static void polling_island_unlock_pair(polling_island* p, polling_island* q) {
   if (p == q) {
     gpr_mu_unlock(&p->mu);
   } else {
@@ -651,16 +654,16 @@
   }
 }
 
-static polling_island *polling_island_merge(polling_island *p,
-                                            polling_island *q,
-                                            grpc_error **error) {
+static polling_island* polling_island_merge(polling_island* p,
+                                            polling_island* q,
+                                            grpc_error** error) {
   /* Get locks on both the polling islands */
   polling_island_lock_pair(&p, &q);
 
   if (p != q) {
     /* Make sure that p points to the polling island with fewer fds than q */
     if (p->fd_cnt > q->fd_cnt) {
-      GPR_SWAP(polling_island *, p, q);
+      GPR_SWAP(polling_island*, p, q);
     }
 
     /* Merge p with q i.e move all the fds from p (The one with fewer fds) to q
@@ -685,8 +688,8 @@
   return q;
 }
 
-static grpc_error *polling_island_global_init() {
-  grpc_error *error = GRPC_ERROR_NONE;
+static grpc_error* polling_island_global_init() {
+  grpc_error* error = GRPC_ERROR_NONE;
 
   error = grpc_wakeup_fd_init(&polling_island_wakeup_fd);
   if (error == GRPC_ERROR_NONE) {
@@ -722,15 +725,15 @@
  * alarm 'epoch'). This wakeup_fd gives us something to alert on when such a
  * case occurs. */
 
-static grpc_fd *fd_freelist = NULL;
+static grpc_fd* fd_freelist = NULL;
 static gpr_mu fd_freelist_mu;
 
 #ifndef NDEBUG
 #define REF_BY(fd, n, reason) ref_by(fd, n, reason, __FILE__, __LINE__)
 #define UNREF_BY(fd, n, reason) unref_by(fd, n, reason, __FILE__, __LINE__)
-static void ref_by(grpc_fd *fd, int n, const char *reason, const char *file,
+static void ref_by(grpc_fd* fd, int n, const char* reason, const char* file,
                    int line) {
-  if (grpc_trace_fd_refcount.enabled()) {
+  if (GRPC_TRACER_ON(grpc_trace_fd_refcount)) {
     gpr_log(GPR_DEBUG,
             "FD %d %p   ref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]",
             fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst),
@@ -739,22 +742,22 @@
 #else
 #define REF_BY(fd, n, reason) ref_by(fd, n)
 #define UNREF_BY(fd, n, reason) unref_by(fd, n)
-static void ref_by(grpc_fd *fd, int n) {
+static void ref_by(grpc_fd* fd, int n) {
 #endif
   GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&fd->refst, n) > 0);
 }
 
 #ifndef NDEBUG
-static void unref_by(grpc_fd *fd, int n, const char *reason, const char *file,
+static void unref_by(grpc_fd* fd, int n, const char* reason, const char* file,
                      int line) {
-  if (grpc_trace_fd_refcount.enabled()) {
+  if (GRPC_TRACER_ON(grpc_trace_fd_refcount)) {
     gpr_log(GPR_DEBUG,
             "FD %d %p unref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]",
             fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst),
             gpr_atm_no_barrier_load(&fd->refst) - n, reason, file, line);
   }
 #else
-static void unref_by(grpc_fd *fd, int n) {
+static void unref_by(grpc_fd* fd, int n) {
 #endif
   gpr_atm old = gpr_atm_full_fetch_add(&fd->refst, -n);
   if (old == n) {
@@ -764,8 +767,8 @@
     fd_freelist = fd;
     grpc_iomgr_unregister_object(&fd->iomgr_object);
 
-    grpc_lfev_destroy(&fd->read_closure);
-    grpc_lfev_destroy(&fd->write_closure);
+    fd->read_closure.Destroy();
+    fd->write_closure.Destroy();
 
     gpr_mu_unlock(&fd_freelist_mu);
   } else {
@@ -775,18 +778,18 @@
 
 /* Increment refcount by two to avoid changing the orphan bit */
 #ifndef NDEBUG
-static void fd_ref(grpc_fd *fd, const char *reason, const char *file,
+static void fd_ref(grpc_fd* fd, const char* reason, const char* file,
                    int line) {
   ref_by(fd, 2, reason, file, line);
 }
 
-static void fd_unref(grpc_fd *fd, const char *reason, const char *file,
+static void fd_unref(grpc_fd* fd, const char* reason, const char* file,
                      int line) {
   unref_by(fd, 2, reason, file, line);
 }
 #else
-static void fd_ref(grpc_fd *fd) { ref_by(fd, 2); }
-static void fd_unref(grpc_fd *fd) { unref_by(fd, 2); }
+static void fd_ref(grpc_fd* fd) { ref_by(fd, 2); }
+static void fd_unref(grpc_fd* fd) { unref_by(fd, 2); }
 #endif
 
 static void fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); }
@@ -795,7 +798,7 @@
   gpr_mu_lock(&fd_freelist_mu);
   gpr_mu_unlock(&fd_freelist_mu);
   while (fd_freelist != NULL) {
-    grpc_fd *fd = fd_freelist;
+    grpc_fd* fd = fd_freelist;
     fd_freelist = fd_freelist->freelist_next;
     gpr_mu_destroy(&fd->po.mu);
     gpr_free(fd);
@@ -803,8 +806,8 @@
   gpr_mu_destroy(&fd_freelist_mu);
 }
 
-static grpc_fd *fd_create(int fd, const char *name) {
-  grpc_fd *new_fd = NULL;
+static grpc_fd* fd_create(int fd, const char* name) {
+  grpc_fd* new_fd = NULL;
 
   gpr_mu_lock(&fd_freelist_mu);
   if (fd_freelist != NULL) {
@@ -814,7 +817,7 @@
   gpr_mu_unlock(&fd_freelist_mu);
 
   if (new_fd == NULL) {
-    new_fd = (grpc_fd *)gpr_malloc(sizeof(grpc_fd));
+    new_fd = (grpc_fd*)gpr_malloc(sizeof(grpc_fd));
     gpr_mu_init(&new_fd->po.mu);
   }
 
@@ -830,8 +833,8 @@
   gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1);
   new_fd->fd = fd;
   new_fd->orphaned = false;
-  grpc_lfev_init(&new_fd->read_closure);
-  grpc_lfev_init(&new_fd->write_closure);
+  new_fd->read_closure.Init();
+  new_fd->write_closure.Init();
   gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL);
 
   new_fd->freelist_next = NULL;
@@ -839,14 +842,14 @@
 
   gpr_mu_unlock(&new_fd->po.mu);
 
-  char *fd_name;
+  char* fd_name;
   gpr_asprintf(&fd_name, "%s fd=%d", name, fd);
   grpc_iomgr_register_object(&new_fd->iomgr_object, fd_name);
   gpr_free(fd_name);
   return new_fd;
 }
 
-static int fd_wrapped_fd(grpc_fd *fd) {
+static int fd_wrapped_fd(grpc_fd* fd) {
   int ret_fd = -1;
   gpr_mu_lock(&fd->po.mu);
   if (!fd->orphaned) {
@@ -857,11 +860,11 @@
   return ret_fd;
 }
 
-static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                      grpc_closure *on_done, int *release_fd,
-                      bool already_closed, const char *reason) {
-  grpc_error *error = GRPC_ERROR_NONE;
-  polling_island *unref_pi = NULL;
+static void fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                      grpc_closure* on_done, int* release_fd,
+                      bool already_closed, const char* reason) {
+  grpc_error* error = GRPC_ERROR_NONE;
+  polling_island* unref_pi = NULL;
 
   gpr_mu_lock(&fd->po.mu);
   fd->on_done_closure = on_done;
@@ -879,7 +882,7 @@
      - Set fd->po.pi to NULL (but remove the ref on the polling island
        before doing this.) */
   if (fd->po.pi != NULL) {
-    polling_island *pi_latest = polling_island_lock(fd->po.pi);
+    polling_island* pi_latest = polling_island_lock(fd->po.pi);
     polling_island_remove_fd_locked(pi_latest, fd, already_closed, &error);
     gpr_mu_unlock(&pi_latest->mu);
 
@@ -909,40 +912,39 @@
     PI_UNREF(exec_ctx, unref_pi, "fd_orphan");
   }
   if (error != GRPC_ERROR_NONE) {
-    const char *msg = grpc_error_string(error);
+    const char* msg = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "fd_orphan: %s", msg);
   }
   GRPC_ERROR_UNREF(error);
 }
 
-static grpc_pollset *fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx,
-                                                  grpc_fd *fd) {
+static grpc_pollset* fd_get_read_notifier_pollset(grpc_exec_ctx* exec_ctx,
+                                                  grpc_fd* fd) {
   gpr_atm notifier = gpr_atm_acq_load(&fd->read_notifier_pollset);
-  return (grpc_pollset *)notifier;
+  return (grpc_pollset*)notifier;
 }
 
-static bool fd_is_shutdown(grpc_fd *fd) {
-  return grpc_lfev_is_shutdown(&fd->read_closure);
+static bool fd_is_shutdown(grpc_fd* fd) {
+  return fd->read_closure->IsShutdown();
 }
 
 /* Might be called multiple times */
-static void fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_error *why) {
-  if (grpc_lfev_set_shutdown(exec_ctx, &fd->read_closure,
-                             GRPC_ERROR_REF(why))) {
+static void fd_shutdown(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_error* why) {
+  if (fd->read_closure->SetShutdown(exec_ctx, GRPC_ERROR_REF(why))) {
     shutdown(fd->fd, SHUT_RDWR);
-    grpc_lfev_set_shutdown(exec_ctx, &fd->write_closure, GRPC_ERROR_REF(why));
+    fd->write_closure->SetShutdown(exec_ctx, GRPC_ERROR_REF(why));
   }
   GRPC_ERROR_UNREF(why);
 }
 
-static void fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                              grpc_closure *closure) {
-  grpc_lfev_notify_on(exec_ctx, &fd->read_closure, closure, "read");
+static void fd_notify_on_read(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                              grpc_closure* closure) {
+  fd->read_closure->NotifyOn(exec_ctx, closure);
 }
 
-static void fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                               grpc_closure *closure) {
-  grpc_lfev_notify_on(exec_ctx, &fd->write_closure, closure, "write");
+static void fd_notify_on_write(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                               grpc_closure* closure) {
+  fd->write_closure->NotifyOn(exec_ctx, closure);
 }
 
 /*******************************************************************************
@@ -962,7 +964,7 @@
 static void poller_kick_init() { signal(grpc_wakeup_signal, sig_handler); }
 
 /* Global state management */
-static grpc_error *pollset_global_init(void) {
+static grpc_error* pollset_global_init(void) {
   gpr_tls_init(&g_current_thread_pollset);
   gpr_tls_init(&g_current_thread_worker);
   poller_kick_init();
@@ -974,14 +976,14 @@
   gpr_tls_destroy(&g_current_thread_worker);
 }
 
-static grpc_error *pollset_worker_kick(grpc_pollset_worker *worker) {
-  grpc_error *err = GRPC_ERROR_NONE;
+static grpc_error* pollset_worker_kick(grpc_pollset_worker* worker) {
+  grpc_error* err = GRPC_ERROR_NONE;
 
   /* Kick the worker only if it was not already kicked */
   if (gpr_atm_no_barrier_cas(&worker->is_kicked, (gpr_atm)0, (gpr_atm)1)) {
     GRPC_POLLING_TRACE(
         "pollset_worker_kick: Kicking worker: %p (thread id: %ld)",
-        (void *)worker, (long int)worker->pt_id);
+        (void*)worker, (long int)worker->pt_id);
     int err_num = pthread_kill(worker->pt_id, grpc_wakeup_signal);
     if (err_num != 0) {
       err = GRPC_OS_ERROR(err_num, "pthread_kill");
@@ -992,18 +994,18 @@
 
 /* Return 1 if the pollset has active threads in pollset_work (pollset must
  * be locked) */
-static int pollset_has_workers(grpc_pollset *p) {
+static int pollset_has_workers(grpc_pollset* p) {
   return p->root_worker.next != &p->root_worker;
 }
 
-static void remove_worker(grpc_pollset *p, grpc_pollset_worker *worker) {
+static void remove_worker(grpc_pollset* p, grpc_pollset_worker* worker) {
   worker->prev->next = worker->next;
   worker->next->prev = worker->prev;
 }
 
-static grpc_pollset_worker *pop_front_worker(grpc_pollset *p) {
+static grpc_pollset_worker* pop_front_worker(grpc_pollset* p) {
   if (pollset_has_workers(p)) {
-    grpc_pollset_worker *w = p->root_worker.next;
+    grpc_pollset_worker* w = p->root_worker.next;
     remove_worker(p, w);
     return w;
   } else {
@@ -1011,26 +1013,26 @@
   }
 }
 
-static void push_back_worker(grpc_pollset *p, grpc_pollset_worker *worker) {
+static void push_back_worker(grpc_pollset* p, grpc_pollset_worker* worker) {
   worker->next = &p->root_worker;
   worker->prev = worker->next->prev;
   worker->prev->next = worker->next->prev = worker;
 }
 
-static void push_front_worker(grpc_pollset *p, grpc_pollset_worker *worker) {
+static void push_front_worker(grpc_pollset* p, grpc_pollset_worker* worker) {
   worker->prev = &p->root_worker;
   worker->next = worker->prev->next;
   worker->prev->next = worker->next->prev = worker;
 }
 
 /* p->mu must be held before calling this function */
-static grpc_error *pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *p,
-                                grpc_pollset_worker *specific_worker) {
+static grpc_error* pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* p,
+                                grpc_pollset_worker* specific_worker) {
   GPR_TIMER_BEGIN("pollset_kick", 0);
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   GRPC_STATS_INC_POLLSET_KICK(exec_ctx);
-  const char *err_desc = "Kick Failure";
-  grpc_pollset_worker *worker = specific_worker;
+  const char* err_desc = "Kick Failure";
+  grpc_pollset_worker* worker = specific_worker;
   if (worker != NULL) {
     if (worker == GRPC_POLLSET_KICK_BROADCAST) {
       if (pollset_has_workers(p)) {
@@ -1076,7 +1078,7 @@
   return error;
 }
 
-static void pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
+static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
   gpr_mu_init(&pollset->po.mu);
   *mu = &pollset->po.mu;
   pollset->po.pi = NULL;
@@ -1092,7 +1094,7 @@
   pollset->shutdown_done = NULL;
 }
 
-static int poll_deadline_to_millis_timeout(grpc_exec_ctx *exec_ctx,
+static int poll_deadline_to_millis_timeout(grpc_exec_ctx* exec_ctx,
                                            grpc_millis millis) {
   if (millis == GRPC_MILLIS_INF_FUTURE) return -1;
   grpc_millis delta = millis - grpc_exec_ctx_now(exec_ctx);
@@ -1104,9 +1106,9 @@
     return (int)delta;
 }
 
-static void fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                               grpc_pollset *notifier) {
-  grpc_lfev_set_ready(exec_ctx, &fd->read_closure, "read");
+static void fd_become_readable(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                               grpc_pollset* notifier) {
+  fd->read_closure->SetReady(exec_ctx);
 
   /* Note, it is possible that fd_become_readable might be called twice with
      different 'notifier's when an fd becomes readable and it is in two epoll
@@ -1117,21 +1119,21 @@
   gpr_atm_rel_store(&fd->read_notifier_pollset, (gpr_atm)notifier);
 }
 
-static void fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
-  grpc_lfev_set_ready(exec_ctx, &fd->write_closure, "write");
+static void fd_become_writable(grpc_exec_ctx* exec_ctx, grpc_fd* fd) {
+  fd->write_closure->SetReady(exec_ctx);
 }
 
-static void pollset_release_polling_island(grpc_exec_ctx *exec_ctx,
-                                           grpc_pollset *ps,
-                                           const char *reason) {
+static void pollset_release_polling_island(grpc_exec_ctx* exec_ctx,
+                                           grpc_pollset* ps,
+                                           const char* reason) {
   if (ps->po.pi != NULL) {
     PI_UNREF(exec_ctx, ps->po.pi, reason);
   }
   ps->po.pi = NULL;
 }
 
-static void finish_shutdown_locked(grpc_exec_ctx *exec_ctx,
-                                   grpc_pollset *pollset) {
+static void finish_shutdown_locked(grpc_exec_ctx* exec_ctx,
+                                   grpc_pollset* pollset) {
   /* The pollset cannot have any workers if we are at this stage */
   GPR_ASSERT(!pollset_has_workers(pollset));
 
@@ -1143,8 +1145,8 @@
 }
 
 /* pollset->po.mu lock must be held by the caller before calling this */
-static void pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                             grpc_closure *closure) {
+static void pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                             grpc_closure* closure) {
   GPR_TIMER_BEGIN("pollset_shutdown", 0);
   GPR_ASSERT(!pollset->shutting_down);
   pollset->shutting_down = true;
@@ -1165,23 +1167,23 @@
 /* pollset_shutdown is guaranteed to be called before pollset_destroy. So other
  * than destroying the mutexes, there is nothing special that needs to be done
  * here */
-static void pollset_destroy(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
+static void pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
   GPR_ASSERT(!pollset_has_workers(pollset));
   gpr_mu_destroy(&pollset->po.mu);
 }
 
 #define GRPC_EPOLL_MAX_EVENTS 100
 /* Note: sig_mask contains the signal mask to use *during* epoll_wait() */
-static void pollset_work_and_unlock(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset *pollset,
-                                    grpc_pollset_worker *worker, int timeout_ms,
-                                    sigset_t *sig_mask, grpc_error **error) {
+static void pollset_work_and_unlock(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset* pollset,
+                                    grpc_pollset_worker* worker, int timeout_ms,
+                                    sigset_t* sig_mask, grpc_error** error) {
   struct epoll_event ep_ev[GRPC_EPOLL_MAX_EVENTS];
   int epoll_fd = -1;
   int ep_rv;
-  polling_island *pi = NULL;
-  char *err_msg;
-  const char *err_desc = "pollset_work_and_unlock";
+  polling_island* pi = NULL;
+  char* err_msg;
+  const char* err_desc = "pollset_work_and_unlock";
   GPR_TIMER_BEGIN("pollset_work_and_unlock", 0);
 
   /* We need to get the epoll_fd to wait on. The epoll_fd is in inside the
@@ -1203,7 +1205,7 @@
 
     PI_ADD_REF(pollset->po.pi, "ps");
     GRPC_POLLING_TRACE("pollset_work: pollset: %p created new pi: %p",
-                       (void *)pollset, (void *)pollset->po.pi);
+                       (void*)pollset, (void*)pollset->po.pi);
   }
 
   pi = polling_island_maybe_get_latest(pollset->po.pi);
@@ -1243,7 +1245,7 @@
       /* We were interrupted. Save an interation by doing a zero timeout
          epoll_wait to see if there are any other events of interest */
       GRPC_POLLING_TRACE("pollset_work: pollset: %p, worker: %p received kick",
-                         (void *)pollset, (void *)worker);
+                         (void*)pollset, (void*)worker);
       ep_rv = epoll_wait(epoll_fd, ep_ev, GRPC_EPOLL_MAX_EVENTS, 0);
     }
   }
@@ -1254,18 +1256,18 @@
 #endif /* defined(GRPC_TSAN) */
 
   for (int i = 0; i < ep_rv; ++i) {
-    void *data_ptr = ep_ev[i].data.ptr;
+    void* data_ptr = ep_ev[i].data.ptr;
     if (data_ptr == &polling_island_wakeup_fd) {
       GRPC_POLLING_TRACE(
           "pollset_work: pollset: %p, worker: %p polling island (epoll_fd: "
           "%d) got merged",
-          (void *)pollset, (void *)worker, epoll_fd);
+          (void*)pollset, (void*)worker, epoll_fd);
       /* This means that our polling island is merged with a different
          island. We do not have to do anything here since the subsequent call
          to the function pollset_work_and_unlock() will pick up the correct
          epoll_fd */
     } else {
-      grpc_fd *fd = (grpc_fd *)data_ptr;
+      grpc_fd* fd = (grpc_fd*)data_ptr;
       int cancel = ep_ev[i].events & (EPOLLERR | EPOLLHUP);
       int read_ev = ep_ev[i].events & (EPOLLIN | EPOLLPRI);
       int write_ev = ep_ev[i].events & EPOLLOUT;
@@ -1297,11 +1299,11 @@
    The function pollset_work() may temporarily release the lock (pollset->po.mu)
    during the course of its execution but it will always re-acquire the lock and
    ensure that it is held by the time the function returns */
-static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                                grpc_pollset_worker **worker_hdl,
+static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                                grpc_pollset_worker** worker_hdl,
                                 grpc_millis deadline) {
   GPR_TIMER_BEGIN("pollset_work", 0);
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   int timeout_ms = poll_deadline_to_millis_timeout(exec_ctx, deadline);
 
   sigset_t new_mask;
@@ -1400,8 +1402,8 @@
   return error;
 }
 
-static void add_poll_object(grpc_exec_ctx *exec_ctx, poll_obj *bag,
-                            poll_obj_type bag_type, poll_obj *item,
+static void add_poll_object(grpc_exec_ctx* exec_ctx, poll_obj* bag,
+                            poll_obj_type bag_type, poll_obj* item,
                             poll_obj_type item_type) {
   GPR_TIMER_BEGIN("add_poll_object", 0);
 
@@ -1410,8 +1412,8 @@
   GPR_ASSERT(bag->obj_type == bag_type);
 #endif
 
-  grpc_error *error = GRPC_ERROR_NONE;
-  polling_island *pi_new = NULL;
+  grpc_error* error = GRPC_ERROR_NONE;
+  polling_island* pi_new = NULL;
 
   gpr_mu_lock(&bag->mu);
   gpr_mu_lock(&item->mu);
@@ -1462,8 +1464,8 @@
           GRPC_POLLING_TRACE(
               "add_poll_object: Raced creating new polling island. pi_new: %p "
               "(fd: %d, %s: %p)",
-              (void *)pi_new, FD_FROM_PO(item)->fd, poll_obj_string(bag_type),
-              (void *)bag);
+              (void*)pi_new, FD_FROM_PO(item)->fd, poll_obj_string(bag_type),
+              (void*)bag);
           /* No need to lock 'pi_new' here since this is a new polling island
              and no one has a reference to it yet */
           polling_island_remove_all_fds_locked(pi_new, true, &error);
@@ -1481,13 +1483,12 @@
       GRPC_POLLING_TRACE(
           "add_poll_object: Created new polling island. pi_new: %p (%s: %p, "
           "%s: %p)",
-          (void *)pi_new, poll_obj_string(item_type), (void *)item,
-          poll_obj_string(bag_type), (void *)bag);
+          (void*)pi_new, poll_obj_string(item_type), (void*)item,
+          poll_obj_string(bag_type), (void*)bag);
     } else {
       GRPC_POLLING_TRACE(
           "add_poll_object: Same polling island. pi: %p (%s, %s)",
-          (void *)pi_new, poll_obj_string(item_type),
-          poll_obj_string(bag_type));
+          (void*)pi_new, poll_obj_string(item_type), poll_obj_string(bag_type));
     }
   } else if (item->pi == NULL) {
     /* GPR_ASSERT(bag->pi != NULL) */
@@ -1495,7 +1496,7 @@
     pi_new = polling_island_lock(bag->pi);
 
     if (item_type == POLL_OBJ_FD) {
-      grpc_fd *fd = FD_FROM_PO(item);
+      grpc_fd* fd = FD_FROM_PO(item);
       polling_island_add_fds_locked(pi_new, &fd, 1, true, &error);
     }
 
@@ -1503,8 +1504,8 @@
     GRPC_POLLING_TRACE(
         "add_poll_obj: item->pi was NULL. pi_new: %p (item(%s): %p, "
         "bag(%s): %p)",
-        (void *)pi_new, poll_obj_string(item_type), (void *)item,
-        poll_obj_string(bag_type), (void *)bag);
+        (void*)pi_new, poll_obj_string(item_type), (void*)item,
+        poll_obj_string(bag_type), (void*)bag);
   } else if (bag->pi == NULL) {
     /* GPR_ASSERT(item->pi != NULL) */
     /* Make pi_new to point to latest pi */
@@ -1513,15 +1514,15 @@
     GRPC_POLLING_TRACE(
         "add_poll_obj: bag->pi was NULL. pi_new: %p (item(%s): %p, "
         "bag(%s): %p)",
-        (void *)pi_new, poll_obj_string(item_type), (void *)item,
-        poll_obj_string(bag_type), (void *)bag);
+        (void*)pi_new, poll_obj_string(item_type), (void*)item,
+        poll_obj_string(bag_type), (void*)bag);
   } else {
     pi_new = polling_island_merge(item->pi, bag->pi, &error);
     GRPC_POLLING_TRACE(
         "add_poll_obj: polling islands merged. pi_new: %p (item(%s): %p, "
         "bag(%s): %p)",
-        (void *)pi_new, poll_obj_string(item_type), (void *)item,
-        poll_obj_string(bag_type), (void *)bag);
+        (void*)pi_new, poll_obj_string(item_type), (void*)item,
+        poll_obj_string(bag_type), (void*)bag);
   }
 
   /* At this point, pi_new is the polling island that both item->pi and bag->pi
@@ -1550,8 +1551,8 @@
   GPR_TIMER_END("add_poll_object", 0);
 }
 
-static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           grpc_fd *fd) {
+static void pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           grpc_fd* fd) {
   add_poll_object(exec_ctx, &pollset->po, POLL_OBJ_POLLSET, &fd->po,
                   POLL_OBJ_FD);
 }
@@ -1560,8 +1561,8 @@
  * Pollset-set Definitions
  */
 
-static grpc_pollset_set *pollset_set_create(void) {
-  grpc_pollset_set *pss = (grpc_pollset_set *)gpr_malloc(sizeof(*pss));
+static grpc_pollset_set* pollset_set_create(void) {
+  grpc_pollset_set* pss = (grpc_pollset_set*)gpr_malloc(sizeof(*pss));
   gpr_mu_init(&pss->po.mu);
   pss->po.pi = NULL;
 #ifndef NDEBUG
@@ -1570,8 +1571,8 @@
   return pss;
 }
 
-static void pollset_set_destroy(grpc_exec_ctx *exec_ctx,
-                                grpc_pollset_set *pss) {
+static void pollset_set_destroy(grpc_exec_ctx* exec_ctx,
+                                grpc_pollset_set* pss) {
   gpr_mu_destroy(&pss->po.mu);
 
   if (pss->po.pi != NULL) {
@@ -1581,45 +1582,45 @@
   gpr_free(pss);
 }
 
-static void pollset_set_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset_set *pss,
-                               grpc_fd *fd) {
+static void pollset_set_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset_set* pss,
+                               grpc_fd* fd) {
   add_poll_object(exec_ctx, &pss->po, POLL_OBJ_POLLSET_SET, &fd->po,
                   POLL_OBJ_FD);
 }
 
-static void pollset_set_del_fd(grpc_exec_ctx *exec_ctx, grpc_pollset_set *pss,
-                               grpc_fd *fd) {
+static void pollset_set_del_fd(grpc_exec_ctx* exec_ctx, grpc_pollset_set* pss,
+                               grpc_fd* fd) {
   /* Nothing to do */
 }
 
-static void pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset_set *pss, grpc_pollset *ps) {
+static void pollset_set_add_pollset(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset_set* pss, grpc_pollset* ps) {
   add_poll_object(exec_ctx, &pss->po, POLL_OBJ_POLLSET_SET, &ps->po,
                   POLL_OBJ_POLLSET);
 }
 
-static void pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset_set *pss, grpc_pollset *ps) {
+static void pollset_set_del_pollset(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset_set* pss, grpc_pollset* ps) {
   /* Nothing to do */
 }
 
-static void pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset_set *bag,
-                                        grpc_pollset_set *item) {
+static void pollset_set_add_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset_set* bag,
+                                        grpc_pollset_set* item) {
   add_poll_object(exec_ctx, &bag->po, POLL_OBJ_POLLSET_SET, &item->po,
                   POLL_OBJ_POLLSET_SET);
 }
 
-static void pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset_set *bag,
-                                        grpc_pollset_set *item) {
+static void pollset_set_del_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset_set* bag,
+                                        grpc_pollset_set* item) {
   /* Nothing to do */
 }
 
 /* Test helper functions
  * */
-void *grpc_fd_get_polling_island(grpc_fd *fd) {
-  polling_island *pi;
+void* grpc_fd_get_polling_island(grpc_fd* fd) {
+  polling_island* pi;
 
   gpr_mu_lock(&fd->po.mu);
   pi = fd->po.pi;
@@ -1628,8 +1629,8 @@
   return pi;
 }
 
-void *grpc_pollset_get_polling_island(grpc_pollset *ps) {
-  polling_island *pi;
+void* grpc_pollset_get_polling_island(grpc_pollset* ps) {
+  polling_island* pi;
 
   gpr_mu_lock(&ps->po.mu);
   pi = ps->po.pi;
@@ -1638,9 +1639,9 @@
   return pi;
 }
 
-bool grpc_are_polling_islands_equal(void *p, void *q) {
-  polling_island *p1 = (polling_island *)p;
-  polling_island *p2 = (polling_island *)q;
+bool grpc_are_polling_islands_equal(void* p, void* q) {
+  polling_island* p1 = (polling_island*)p;
+  polling_island* p2 = (polling_island*)q;
 
   /* Note: polling_island_lock_pair() may change p1 and p2 to point to the
      latest polling islands in their respective linked lists */
@@ -1706,18 +1707,21 @@
   return true;
 }
 
-const grpc_event_engine_vtable *grpc_init_epollsig_linux(
+const grpc_event_engine_vtable* grpc_init_epollsig_linux(
     bool explicit_request) {
   /* If use of signals is disabled, we cannot use epoll engine*/
   if (is_grpc_wakeup_signal_initialized && grpc_wakeup_signal < 0) {
+    gpr_log(GPR_ERROR, "Skipping epollsig because use of signals is disabled.");
     return NULL;
   }
 
   if (!grpc_has_wakeup_fd()) {
+    gpr_log(GPR_ERROR, "Skipping epollsig because of no wakeup fd.");
     return NULL;
   }
 
   if (!is_epoll_available()) {
+    gpr_log(GPR_ERROR, "Skipping epollsig because epoll is unavailable.");
     return NULL;
   }
 
@@ -1725,6 +1729,8 @@
     if (explicit_request) {
       grpc_use_signal(SIGRTMIN + 6);
     } else {
+      gpr_log(GPR_ERROR,
+              "Skipping epollsig because uninitialized wakeup signal.");
       return NULL;
     }
   }
@@ -1748,8 +1754,10 @@
 #include "src/core/lib/iomgr/ev_epollsig_linux.h"
 /* If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
  * NULL */
-const grpc_event_engine_vtable *grpc_init_epollsig_linux(
+const grpc_event_engine_vtable* grpc_init_epollsig_linux(
     bool explicit_request) {
+  gpr_log(GPR_ERROR,
+          "Skipping epollsig becuase GRPC_LINUX_EPOLL is not defined.");
   return NULL;
 }
 #endif /* defined(GRPC_POSIX_SOCKET) */
diff --git a/src/core/lib/iomgr/ev_epollsig_linux.h b/src/core/lib/iomgr/ev_epollsig_linux.h
index c04ff27..ca68595 100644
--- a/src/core/lib/iomgr/ev_epollsig_linux.h
+++ b/src/core/lib/iomgr/ev_epollsig_linux.h
@@ -26,12 +26,12 @@
 extern "C" {
 #endif
 
-const grpc_event_engine_vtable *grpc_init_epollsig_linux(bool explicit_request);
+const grpc_event_engine_vtable* grpc_init_epollsig_linux(bool explicit_request);
 
 #ifdef GRPC_LINUX_EPOLL
-void *grpc_fd_get_polling_island(grpc_fd *fd);
-void *grpc_pollset_get_polling_island(grpc_pollset *ps);
-bool grpc_are_polling_islands_equal(void *p, void *q);
+void* grpc_fd_get_polling_island(grpc_fd* fd);
+void* grpc_pollset_get_polling_island(grpc_pollset* ps);
+bool grpc_are_polling_islands_equal(void* p, void* q);
 #endif /* defined(GRPC_LINUX_EPOLL) */
 
 #ifdef __cplusplus
diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc
index ad4d016..d34516f 100644
--- a/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
@@ -45,17 +45,17 @@
 #include "src/core/lib/profiling/timers.h"
 #include "src/core/lib/support/murmur_hash.h"
 
-#define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker *)1)
+#define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker*)1)
 
 /*******************************************************************************
  * FD declarations
  */
 typedef struct grpc_fd_watcher {
-  struct grpc_fd_watcher *next;
-  struct grpc_fd_watcher *prev;
-  grpc_pollset *pollset;
-  grpc_pollset_worker *worker;
-  grpc_fd *fd;
+  struct grpc_fd_watcher* next;
+  struct grpc_fd_watcher* prev;
+  grpc_pollset* pollset;
+  grpc_pollset_worker* worker;
+  grpc_fd* fd;
 } grpc_fd_watcher;
 
 struct grpc_fd {
@@ -71,7 +71,7 @@
   int shutdown;
   int closed;
   int released;
-  grpc_error *shutdown_error;
+  grpc_error* shutdown_error;
 
   /* The watcher list.
 
@@ -96,18 +96,18 @@
      the inactive pollers may be kicked out of their poll loops to take
      that responsibility. */
   grpc_fd_watcher inactive_watcher_root;
-  grpc_fd_watcher *read_watcher;
-  grpc_fd_watcher *write_watcher;
+  grpc_fd_watcher* read_watcher;
+  grpc_fd_watcher* write_watcher;
 
-  grpc_closure *read_closure;
-  grpc_closure *write_closure;
+  grpc_closure* read_closure;
+  grpc_closure* write_closure;
 
-  grpc_closure *on_done_closure;
+  grpc_closure* on_done_closure;
 
   grpc_iomgr_object iomgr_object;
 
   /* The pollset that last noticed and notified that the fd is readable */
-  grpc_pollset *read_notifier_pollset;
+  grpc_pollset* read_notifier_pollset;
 };
 
 /* Begin polling on an fd.
@@ -121,35 +121,35 @@
    Polling strategies that do not need to alter their behavior depending on the
    fd's current interest (such as epoll) do not need to call this function.
    MUST NOT be called with a pollset lock taken */
-static uint32_t fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
-                              grpc_pollset_worker *worker, uint32_t read_mask,
-                              uint32_t write_mask, grpc_fd_watcher *rec);
+static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset,
+                              grpc_pollset_worker* worker, uint32_t read_mask,
+                              uint32_t write_mask, grpc_fd_watcher* rec);
 /* Complete polling previously started with fd_begin_poll
    MUST NOT be called with a pollset lock taken
    if got_read or got_write are 1, also does the become_{readable,writable} as
    appropriate. */
-static void fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *rec,
+static void fd_end_poll(grpc_exec_ctx* exec_ctx, grpc_fd_watcher* rec,
                         int got_read, int got_write,
-                        grpc_pollset *read_notifier_pollset);
+                        grpc_pollset* read_notifier_pollset);
 
 /* Return 1 if this fd is orphaned, 0 otherwise */
-static bool fd_is_orphaned(grpc_fd *fd);
+static bool fd_is_orphaned(grpc_fd* fd);
 
 #ifndef NDEBUG
-static void fd_ref(grpc_fd *fd, const char *reason, const char *file, int line);
-static void fd_unref(grpc_fd *fd, const char *reason, const char *file,
+static void fd_ref(grpc_fd* fd, const char* reason, const char* file, int line);
+static void fd_unref(grpc_fd* fd, const char* reason, const char* file,
                      int line);
 #define GRPC_FD_REF(fd, reason) fd_ref(fd, reason, __FILE__, __LINE__)
 #define GRPC_FD_UNREF(fd, reason) fd_unref(fd, reason, __FILE__, __LINE__)
 #else
-static void fd_ref(grpc_fd *fd);
-static void fd_unref(grpc_fd *fd);
+static void fd_ref(grpc_fd* fd);
+static void fd_unref(grpc_fd* fd);
 #define GRPC_FD_REF(fd, reason) fd_ref(fd)
 #define GRPC_FD_UNREF(fd, reason) fd_unref(fd)
 #endif
 
-#define CLOSURE_NOT_READY ((grpc_closure *)0)
-#define CLOSURE_READY ((grpc_closure *)1)
+#define CLOSURE_NOT_READY ((grpc_closure*)0)
+#define CLOSURE_READY ((grpc_closure*)1)
 
 /*******************************************************************************
  * pollset declarations
@@ -157,15 +157,15 @@
 
 typedef struct grpc_cached_wakeup_fd {
   grpc_wakeup_fd fd;
-  struct grpc_cached_wakeup_fd *next;
+  struct grpc_cached_wakeup_fd* next;
 } grpc_cached_wakeup_fd;
 
 struct grpc_pollset_worker {
-  grpc_cached_wakeup_fd *wakeup_fd;
+  grpc_cached_wakeup_fd* wakeup_fd;
   int reevaluate_polling_on_wakeup;
   int kicked_specifically;
-  struct grpc_pollset_worker *next;
-  struct grpc_pollset_worker *prev;
+  struct grpc_pollset_worker* next;
+  struct grpc_pollset_worker* prev;
 };
 
 struct grpc_pollset {
@@ -174,23 +174,23 @@
   int shutting_down;
   int called_shutdown;
   int kicked_without_pollers;
-  grpc_closure *shutdown_done;
+  grpc_closure* shutdown_done;
   grpc_closure_list idle_jobs;
   int pollset_set_count;
   /* all polled fds */
   size_t fd_count;
   size_t fd_capacity;
-  grpc_fd **fds;
+  grpc_fd** fds;
   /* Local cache of eventfds for workers */
-  grpc_cached_wakeup_fd *local_wakeup_cache;
+  grpc_cached_wakeup_fd* local_wakeup_cache;
 };
 
 /* Add an fd to a pollset */
-static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           struct grpc_fd *fd);
+static void pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           struct grpc_fd* fd);
 
-static void pollset_set_add_fd(grpc_exec_ctx *exec_ctx,
-                               grpc_pollset_set *pollset_set, grpc_fd *fd);
+static void pollset_set_add_fd(grpc_exec_ctx* exec_ctx,
+                               grpc_pollset_set* pollset_set, grpc_fd* fd);
 
 /* Convert a timespec to milliseconds:
    - very small or negative poll times are clamped to zero to do a
@@ -199,7 +199,7 @@
    - longer than a millisecond polls are rounded up to the next nearest
      millisecond to avoid spinning
    - infinite timeouts are converted to -1 */
-static int poll_deadline_to_millis_timeout(grpc_exec_ctx *exec_ctx,
+static int poll_deadline_to_millis_timeout(grpc_exec_ctx* exec_ctx,
                                            grpc_millis deadline);
 
 /* Allow kick to wakeup the currently polling worker */
@@ -208,13 +208,13 @@
 #define GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP 2
 /* As per pollset_kick, with an extended set of flags (defined above)
    -- mostly for fd_posix's use. */
-static grpc_error *pollset_kick_ext(grpc_exec_ctx *exec_ctx, grpc_pollset *p,
-                                    grpc_pollset_worker *specific_worker,
+static grpc_error* pollset_kick_ext(grpc_exec_ctx* exec_ctx, grpc_pollset* p,
+                                    grpc_pollset_worker* specific_worker,
                                     uint32_t flags) GRPC_MUST_USE_RESULT;
 
 /* Return 1 if the pollset has active threads in pollset_work (pollset must
  * be locked) */
-static bool pollset_has_workers(grpc_pollset *pollset);
+static bool pollset_has_workers(grpc_pollset* pollset);
 
 /*******************************************************************************
  * pollset_set definitions
@@ -225,15 +225,15 @@
 
   size_t pollset_count;
   size_t pollset_capacity;
-  grpc_pollset **pollsets;
+  grpc_pollset** pollsets;
 
   size_t pollset_set_count;
   size_t pollset_set_capacity;
-  struct grpc_pollset_set **pollset_sets;
+  struct grpc_pollset_set** pollset_sets;
 
   size_t fd_count;
   size_t fd_capacity;
-  grpc_fd **fds;
+  grpc_fd** fds;
 };
 
 /*******************************************************************************
@@ -246,9 +246,9 @@
 
 typedef struct poll_result {
   gpr_refcount refcount;
-  cv_node *watchers;
+  cv_node* watchers;
   int watchcount;
-  struct pollfd *fds;
+  struct pollfd* fds;
   nfds_t nfds;
   int retval;
   int err;
@@ -258,11 +258,11 @@
 typedef struct poll_args {
   gpr_cv trigger;
   int trigger_set;
-  struct pollfd *fds;
+  struct pollfd* fds;
   nfds_t nfds;
-  poll_result *result;
-  struct poll_args *next;
-  struct poll_args *prev;
+  poll_result* result;
+  struct poll_args* next;
+  struct poll_args* prev;
 } poll_args;
 
 // This is a 2-tiered cache, we mantain a hash table
@@ -270,8 +270,8 @@
 // of that call.  We also maintain a freelist of inactive
 // poll threads.
 typedef struct poll_hash_table {
-  poll_args *free_pollers;
-  poll_args **active_pollers;
+  poll_args* free_pollers;
+  poll_args** active_pollers;
   unsigned int size;
   unsigned int count;
 } poll_hash_table;
@@ -286,7 +286,7 @@
 #ifndef NDEBUG
 #define REF_BY(fd, n, reason) ref_by(fd, n, reason, __FILE__, __LINE__)
 #define UNREF_BY(fd, n, reason) unref_by(fd, n, reason, __FILE__, __LINE__)
-static void ref_by(grpc_fd *fd, int n, const char *reason, const char *file,
+static void ref_by(grpc_fd* fd, int n, const char* reason, const char* file,
                    int line) {
   if (grpc_trace_fd_refcount.enabled()) {
     gpr_log(GPR_DEBUG,
@@ -297,13 +297,13 @@
 #else
 #define REF_BY(fd, n, reason) ref_by(fd, n)
 #define UNREF_BY(fd, n, reason) unref_by(fd, n)
-static void ref_by(grpc_fd *fd, int n) {
+static void ref_by(grpc_fd* fd, int n) {
 #endif
   GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&fd->refst, n) > 0);
 }
 
 #ifndef NDEBUG
-static void unref_by(grpc_fd *fd, int n, const char *reason, const char *file,
+static void unref_by(grpc_fd* fd, int n, const char* reason, const char* file,
                      int line) {
   if (grpc_trace_fd_refcount.enabled()) {
     gpr_log(GPR_DEBUG,
@@ -312,7 +312,7 @@
             gpr_atm_no_barrier_load(&fd->refst) - n, reason, file, line);
   }
 #else
-static void unref_by(grpc_fd *fd, int n) {
+static void unref_by(grpc_fd* fd, int n) {
 #endif
   gpr_atm old = gpr_atm_full_fetch_add(&fd->refst, -n);
   if (old == n) {
@@ -325,8 +325,8 @@
   }
 }
 
-static grpc_fd *fd_create(int fd, const char *name) {
-  grpc_fd *r = (grpc_fd *)gpr_malloc(sizeof(*r));
+static grpc_fd* fd_create(int fd, const char* name) {
+  grpc_fd* r = (grpc_fd*)gpr_malloc(sizeof(*r));
   gpr_mu_init(&r->mu);
   gpr_atm_rel_store(&r->refst, 1);
   r->shutdown = 0;
@@ -341,21 +341,21 @@
   r->released = 0;
   r->read_notifier_pollset = NULL;
 
-  char *name2;
+  char* name2;
   gpr_asprintf(&name2, "%s fd=%d", name, fd);
   grpc_iomgr_register_object(&r->iomgr_object, name2);
   gpr_free(name2);
   return r;
 }
 
-static bool fd_is_orphaned(grpc_fd *fd) {
+static bool fd_is_orphaned(grpc_fd* fd) {
   return (gpr_atm_acq_load(&fd->refst) & 1) == 0;
 }
 
 /* Return the read-notifier pollset */
-static grpc_pollset *fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx,
-                                                  grpc_fd *fd) {
-  grpc_pollset *notifier = NULL;
+static grpc_pollset* fd_get_read_notifier_pollset(grpc_exec_ctx* exec_ctx,
+                                                  grpc_fd* fd) {
+  grpc_pollset* notifier = NULL;
 
   gpr_mu_lock(&fd->mu);
   notifier = fd->read_notifier_pollset;
@@ -364,19 +364,19 @@
   return notifier;
 }
 
-static grpc_error *pollset_kick_locked(grpc_exec_ctx *exec_ctx,
-                                       grpc_fd_watcher *watcher) {
+static grpc_error* pollset_kick_locked(grpc_exec_ctx* exec_ctx,
+                                       grpc_fd_watcher* watcher) {
   gpr_mu_lock(&watcher->pollset->mu);
   GPR_ASSERT(watcher->worker);
-  grpc_error *err =
+  grpc_error* err =
       pollset_kick_ext(exec_ctx, watcher->pollset, watcher->worker,
                        GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP);
   gpr_mu_unlock(&watcher->pollset->mu);
   return err;
 }
 
-static void maybe_wake_one_watcher_locked(grpc_exec_ctx *exec_ctx,
-                                          grpc_fd *fd) {
+static void maybe_wake_one_watcher_locked(grpc_exec_ctx* exec_ctx,
+                                          grpc_fd* fd) {
   if (fd->inactive_watcher_root.next != &fd->inactive_watcher_root) {
     pollset_kick_locked(exec_ctx, fd->inactive_watcher_root.next);
   } else if (fd->read_watcher) {
@@ -386,8 +386,8 @@
   }
 }
 
-static void wake_all_watchers_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
-  grpc_fd_watcher *watcher;
+static void wake_all_watchers_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd) {
+  grpc_fd_watcher* watcher;
   for (watcher = fd->inactive_watcher_root.next;
        watcher != &fd->inactive_watcher_root; watcher = watcher->next) {
     pollset_kick_locked(exec_ctx, watcher);
@@ -400,12 +400,12 @@
   }
 }
 
-static int has_watchers(grpc_fd *fd) {
+static int has_watchers(grpc_fd* fd) {
   return fd->read_watcher != NULL || fd->write_watcher != NULL ||
          fd->inactive_watcher_root.next != &fd->inactive_watcher_root;
 }
 
-static void close_fd_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
+static void close_fd_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd) {
   fd->closed = 1;
   if (!fd->released) {
     close(fd->fd);
@@ -413,7 +413,7 @@
   GRPC_CLOSURE_SCHED(exec_ctx, fd->on_done_closure, GRPC_ERROR_NONE);
 }
 
-static int fd_wrapped_fd(grpc_fd *fd) {
+static int fd_wrapped_fd(grpc_fd* fd) {
   if (fd->released || fd->closed) {
     return -1;
   } else {
@@ -421,9 +421,9 @@
   }
 }
 
-static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                      grpc_closure *on_done, int *release_fd,
-                      bool already_closed, const char *reason) {
+static void fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                      grpc_closure* on_done, int* release_fd,
+                      bool already_closed, const char* reason) {
   fd->on_done_closure = on_done;
   fd->released = release_fd != NULL;
   if (release_fd != NULL) {
@@ -445,22 +445,22 @@
 
 /* increment refcount by two to avoid changing the orphan bit */
 #ifndef NDEBUG
-static void fd_ref(grpc_fd *fd, const char *reason, const char *file,
+static void fd_ref(grpc_fd* fd, const char* reason, const char* file,
                    int line) {
   ref_by(fd, 2, reason, file, line);
 }
 
-static void fd_unref(grpc_fd *fd, const char *reason, const char *file,
+static void fd_unref(grpc_fd* fd, const char* reason, const char* file,
                      int line) {
   unref_by(fd, 2, reason, file, line);
 }
 #else
-static void fd_ref(grpc_fd *fd) { ref_by(fd, 2); }
+static void fd_ref(grpc_fd* fd) { ref_by(fd, 2); }
 
-static void fd_unref(grpc_fd *fd) { unref_by(fd, 2); }
+static void fd_unref(grpc_fd* fd) { unref_by(fd, 2); }
 #endif
 
-static grpc_error *fd_shutdown_error(grpc_fd *fd) {
+static grpc_error* fd_shutdown_error(grpc_fd* fd) {
   if (!fd->shutdown) {
     return GRPC_ERROR_NONE;
   } else {
@@ -469,8 +469,8 @@
   }
 }
 
-static void notify_on_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                             grpc_closure **st, grpc_closure *closure) {
+static void notify_on_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                             grpc_closure** st, grpc_closure* closure) {
   if (fd->shutdown) {
     GRPC_CLOSURE_SCHED(exec_ctx, closure,
                        GRPC_ERROR_CREATE_FROM_STATIC_STRING("FD shutdown"));
@@ -492,8 +492,8 @@
 }
 
 /* returns 1 if state becomes not ready */
-static int set_ready_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                            grpc_closure **st) {
+static int set_ready_locked(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                            grpc_closure** st) {
   if (*st == CLOSURE_READY) {
     /* duplicate ready ==> ignore */
     return 0;
@@ -510,11 +510,11 @@
 }
 
 static void set_read_notifier_pollset_locked(
-    grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_pollset *read_notifier_pollset) {
+    grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_pollset* read_notifier_pollset) {
   fd->read_notifier_pollset = read_notifier_pollset;
 }
 
-static void fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_error *why) {
+static void fd_shutdown(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_error* why) {
   gpr_mu_lock(&fd->mu);
   /* only shutdown once */
   if (!fd->shutdown) {
@@ -530,32 +530,32 @@
   gpr_mu_unlock(&fd->mu);
 }
 
-static bool fd_is_shutdown(grpc_fd *fd) {
+static bool fd_is_shutdown(grpc_fd* fd) {
   gpr_mu_lock(&fd->mu);
   bool r = fd->shutdown;
   gpr_mu_unlock(&fd->mu);
   return r;
 }
 
-static void fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                              grpc_closure *closure) {
+static void fd_notify_on_read(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                              grpc_closure* closure) {
   gpr_mu_lock(&fd->mu);
   notify_on_locked(exec_ctx, fd, &fd->read_closure, closure);
   gpr_mu_unlock(&fd->mu);
 }
 
-static void fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                               grpc_closure *closure) {
+static void fd_notify_on_write(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                               grpc_closure* closure) {
   gpr_mu_lock(&fd->mu);
   notify_on_locked(exec_ctx, fd, &fd->write_closure, closure);
   gpr_mu_unlock(&fd->mu);
 }
 
-static uint32_t fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
-                              grpc_pollset_worker *worker, uint32_t read_mask,
-                              uint32_t write_mask, grpc_fd_watcher *watcher) {
+static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset,
+                              grpc_pollset_worker* worker, uint32_t read_mask,
+                              uint32_t write_mask, grpc_fd_watcher* watcher) {
   uint32_t mask = 0;
-  grpc_closure *cur;
+  grpc_closure* cur;
   int requested;
   /* keep track of pollers that have requested our events, in case they change
    */
@@ -602,12 +602,12 @@
   return mask;
 }
 
-static void fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *watcher,
+static void fd_end_poll(grpc_exec_ctx* exec_ctx, grpc_fd_watcher* watcher,
                         int got_read, int got_write,
-                        grpc_pollset *read_notifier_pollset) {
+                        grpc_pollset* read_notifier_pollset) {
   int was_polling = 0;
   int kick = 0;
-  grpc_fd *fd = watcher->fd;
+  grpc_fd* fd = watcher->fd;
 
   if (fd == NULL) {
     return;
@@ -667,26 +667,26 @@
 GPR_TLS_DECL(g_current_thread_poller);
 GPR_TLS_DECL(g_current_thread_worker);
 
-static void remove_worker(grpc_pollset *p, grpc_pollset_worker *worker) {
+static void remove_worker(grpc_pollset* p, grpc_pollset_worker* worker) {
   worker->prev->next = worker->next;
   worker->next->prev = worker->prev;
 }
 
-static bool pollset_has_workers(grpc_pollset *p) {
+static bool pollset_has_workers(grpc_pollset* p) {
   return p->root_worker.next != &p->root_worker;
 }
 
-static bool pollset_in_pollset_sets(grpc_pollset *p) {
+static bool pollset_in_pollset_sets(grpc_pollset* p) {
   return p->pollset_set_count;
 }
 
-static bool pollset_has_observers(grpc_pollset *p) {
+static bool pollset_has_observers(grpc_pollset* p) {
   return pollset_has_workers(p) || pollset_in_pollset_sets(p);
 }
 
-static grpc_pollset_worker *pop_front_worker(grpc_pollset *p) {
+static grpc_pollset_worker* pop_front_worker(grpc_pollset* p) {
   if (pollset_has_workers(p)) {
-    grpc_pollset_worker *w = p->root_worker.next;
+    grpc_pollset_worker* w = p->root_worker.next;
     remove_worker(p, w);
     return w;
   } else {
@@ -694,19 +694,19 @@
   }
 }
 
-static void push_back_worker(grpc_pollset *p, grpc_pollset_worker *worker) {
+static void push_back_worker(grpc_pollset* p, grpc_pollset_worker* worker) {
   worker->next = &p->root_worker;
   worker->prev = worker->next->prev;
   worker->prev->next = worker->next->prev = worker;
 }
 
-static void push_front_worker(grpc_pollset *p, grpc_pollset_worker *worker) {
+static void push_front_worker(grpc_pollset* p, grpc_pollset_worker* worker) {
   worker->prev = &p->root_worker;
   worker->next = worker->prev->next;
   worker->prev->next = worker->next->prev = worker;
 }
 
-static void kick_append_error(grpc_error **composite, grpc_error *error) {
+static void kick_append_error(grpc_error** composite, grpc_error* error) {
   if (error == GRPC_ERROR_NONE) return;
   if (*composite == GRPC_ERROR_NONE) {
     *composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Kick Failure");
@@ -714,11 +714,11 @@
   *composite = grpc_error_add_child(*composite, error);
 }
 
-static grpc_error *pollset_kick_ext(grpc_exec_ctx *exec_ctx, grpc_pollset *p,
-                                    grpc_pollset_worker *specific_worker,
+static grpc_error* pollset_kick_ext(grpc_exec_ctx* exec_ctx, grpc_pollset* p,
+                                    grpc_pollset_worker* specific_worker,
                                     uint32_t flags) {
   GPR_TIMER_BEGIN("pollset_kick_ext", 0);
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   GRPC_STATS_INC_POLLSET_KICK(exec_ctx);
 
   /* pollset->mu already held */
@@ -785,14 +785,14 @@
   return error;
 }
 
-static grpc_error *pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *p,
-                                grpc_pollset_worker *specific_worker) {
+static grpc_error* pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* p,
+                                grpc_pollset_worker* specific_worker) {
   return pollset_kick_ext(exec_ctx, p, specific_worker, 0);
 }
 
 /* global state management */
 
-static grpc_error *pollset_global_init(void) {
+static grpc_error* pollset_global_init(void) {
   gpr_tls_init(&g_current_thread_poller);
   gpr_tls_init(&g_current_thread_worker);
   return GRPC_ERROR_NONE;
@@ -805,7 +805,7 @@
 
 /* main interface */
 
-static void pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
+static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
   gpr_mu_init(&pollset->mu);
   *mu = &pollset->mu;
   pollset->root_worker.next = pollset->root_worker.prev = &pollset->root_worker;
@@ -821,11 +821,11 @@
   pollset->pollset_set_count = 0;
 }
 
-static void pollset_destroy(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
+static void pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
   GPR_ASSERT(!pollset_has_workers(pollset));
   GPR_ASSERT(pollset->idle_jobs.head == pollset->idle_jobs.tail);
   while (pollset->local_wakeup_cache) {
-    grpc_cached_wakeup_fd *next = pollset->local_wakeup_cache->next;
+    grpc_cached_wakeup_fd* next = pollset->local_wakeup_cache->next;
     grpc_wakeup_fd_destroy(&pollset->local_wakeup_cache->fd);
     gpr_free(pollset->local_wakeup_cache);
     pollset->local_wakeup_cache = next;
@@ -834,8 +834,8 @@
   gpr_mu_destroy(&pollset->mu);
 }
 
-static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           grpc_fd *fd) {
+static void pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           grpc_fd* fd) {
   gpr_mu_lock(&pollset->mu);
   size_t i;
   /* TODO(ctiller): this is O(num_fds^2); maybe switch to a hash set here */
@@ -845,8 +845,8 @@
   if (pollset->fd_count == pollset->fd_capacity) {
     pollset->fd_capacity =
         GPR_MAX(pollset->fd_capacity + 8, pollset->fd_count * 3 / 2);
-    pollset->fds = (grpc_fd **)gpr_realloc(
-        pollset->fds, sizeof(grpc_fd *) * pollset->fd_capacity);
+    pollset->fds = (grpc_fd**)gpr_realloc(
+        pollset->fds, sizeof(grpc_fd*) * pollset->fd_capacity);
   }
   pollset->fds[pollset->fd_count++] = fd;
   GRPC_FD_REF(fd, "multipoller");
@@ -855,7 +855,7 @@
   gpr_mu_unlock(&pollset->mu);
 }
 
-static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
+static void finish_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
   GPR_ASSERT(grpc_closure_list_empty(pollset->idle_jobs));
   size_t i;
   for (i = 0; i < pollset->fd_count; i++) {
@@ -865,7 +865,7 @@
   GRPC_CLOSURE_SCHED(exec_ctx, pollset->shutdown_done, GRPC_ERROR_NONE);
 }
 
-static void work_combine_error(grpc_error **composite, grpc_error *error) {
+static void work_combine_error(grpc_error** composite, grpc_error* error) {
   if (error == GRPC_ERROR_NONE) return;
   if (*composite == GRPC_ERROR_NONE) {
     *composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("pollset_work");
@@ -873,12 +873,12 @@
   *composite = grpc_error_add_child(*composite, error);
 }
 
-static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                                grpc_pollset_worker **worker_hdl,
+static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                                grpc_pollset_worker** worker_hdl,
                                 grpc_millis deadline) {
   grpc_pollset_worker worker;
   if (worker_hdl) *worker_hdl = &worker;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   /* Avoid malloc for small number of elements. */
   enum { inline_elements = 96 };
@@ -899,7 +899,7 @@
     pollset->local_wakeup_cache = worker.wakeup_fd->next;
   } else {
     worker.wakeup_fd =
-        (grpc_cached_wakeup_fd *)gpr_malloc(sizeof(*worker.wakeup_fd));
+        (grpc_cached_wakeup_fd*)gpr_malloc(sizeof(*worker.wakeup_fd));
     error = grpc_wakeup_fd_init(&worker.wakeup_fd->fd);
     if (error != GRPC_ERROR_NONE) {
       GRPC_LOG_IF_ERROR("pollset_work", GRPC_ERROR_REF(error));
@@ -941,8 +941,8 @@
       int r;
       size_t i, fd_count;
       nfds_t pfd_count;
-      grpc_fd_watcher *watchers;
-      struct pollfd *pfds;
+      grpc_fd_watcher* watchers;
+      struct pollfd* pfds;
 
       timeout = poll_deadline_to_millis_timeout(exec_ctx, deadline);
 
@@ -953,9 +953,9 @@
         /* Allocate one buffer to hold both pfds and watchers arrays */
         const size_t pfd_size = sizeof(*pfds) * (pollset->fd_count + 2);
         const size_t watch_size = sizeof(*watchers) * (pollset->fd_count + 2);
-        void *buf = gpr_malloc(pfd_size + watch_size);
-        pfds = (struct pollfd *)buf;
-        watchers = (grpc_fd_watcher *)(void *)((char *)buf + pfd_size);
+        void* buf = gpr_malloc(pfd_size + watch_size);
+        pfds = (struct pollfd*)buf;
+        watchers = (grpc_fd_watcher*)(void*)((char*)buf + pfd_size);
       }
 
       fd_count = 0;
@@ -979,7 +979,7 @@
       gpr_mu_unlock(&pollset->mu);
 
       for (i = 1; i < pfd_count; i++) {
-        grpc_fd *fd = watchers[i].fd;
+        grpc_fd* fd = watchers[i].fd;
         pfds[i].events = (short)fd_begin_poll(fd, pollset, &worker, POLLIN,
                                               POLLOUT, &watchers[i]);
         GRPC_FD_UNREF(fd, "multipoller_start");
@@ -1107,8 +1107,8 @@
   return error;
 }
 
-static void pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                             grpc_closure *closure) {
+static void pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                             grpc_closure* closure) {
   GPR_ASSERT(!pollset->shutting_down);
   pollset->shutting_down = 1;
   pollset->shutdown_done = closure;
@@ -1122,7 +1122,7 @@
   }
 }
 
-static int poll_deadline_to_millis_timeout(grpc_exec_ctx *exec_ctx,
+static int poll_deadline_to_millis_timeout(grpc_exec_ctx* exec_ctx,
                                            grpc_millis deadline) {
   if (deadline == GRPC_MILLIS_INF_FUTURE) return -1;
   if (deadline == 0) return 0;
@@ -1136,22 +1136,22 @@
  * pollset_set_posix.c
  */
 
-static grpc_pollset_set *pollset_set_create(void) {
-  grpc_pollset_set *pollset_set =
-      (grpc_pollset_set *)gpr_zalloc(sizeof(*pollset_set));
+static grpc_pollset_set* pollset_set_create(void) {
+  grpc_pollset_set* pollset_set =
+      (grpc_pollset_set*)gpr_zalloc(sizeof(*pollset_set));
   gpr_mu_init(&pollset_set->mu);
   return pollset_set;
 }
 
-static void pollset_set_destroy(grpc_exec_ctx *exec_ctx,
-                                grpc_pollset_set *pollset_set) {
+static void pollset_set_destroy(grpc_exec_ctx* exec_ctx,
+                                grpc_pollset_set* pollset_set) {
   size_t i;
   gpr_mu_destroy(&pollset_set->mu);
   for (i = 0; i < pollset_set->fd_count; i++) {
     GRPC_FD_UNREF(pollset_set->fds[i], "pollset_set");
   }
   for (i = 0; i < pollset_set->pollset_count; i++) {
-    grpc_pollset *pollset = pollset_set->pollsets[i];
+    grpc_pollset* pollset = pollset_set->pollsets[i];
     gpr_mu_lock(&pollset->mu);
     pollset->pollset_set_count--;
     /* check shutdown */
@@ -1170,9 +1170,9 @@
   gpr_free(pollset_set);
 }
 
-static void pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset_set *pollset_set,
-                                    grpc_pollset *pollset) {
+static void pollset_set_add_pollset(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset_set* pollset_set,
+                                    grpc_pollset* pollset) {
   size_t i, j;
   gpr_mu_lock(&pollset->mu);
   pollset->pollset_set_count++;
@@ -1181,7 +1181,7 @@
   if (pollset_set->pollset_count == pollset_set->pollset_capacity) {
     pollset_set->pollset_capacity =
         GPR_MAX(8, 2 * pollset_set->pollset_capacity);
-    pollset_set->pollsets = (grpc_pollset **)gpr_realloc(
+    pollset_set->pollsets = (grpc_pollset**)gpr_realloc(
         pollset_set->pollsets,
         pollset_set->pollset_capacity * sizeof(*pollset_set->pollsets));
   }
@@ -1198,15 +1198,15 @@
   gpr_mu_unlock(&pollset_set->mu);
 }
 
-static void pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
-                                    grpc_pollset_set *pollset_set,
-                                    grpc_pollset *pollset) {
+static void pollset_set_del_pollset(grpc_exec_ctx* exec_ctx,
+                                    grpc_pollset_set* pollset_set,
+                                    grpc_pollset* pollset) {
   size_t i;
   gpr_mu_lock(&pollset_set->mu);
   for (i = 0; i < pollset_set->pollset_count; i++) {
     if (pollset_set->pollsets[i] == pollset) {
       pollset_set->pollset_count--;
-      GPR_SWAP(grpc_pollset *, pollset_set->pollsets[i],
+      GPR_SWAP(grpc_pollset*, pollset_set->pollsets[i],
                pollset_set->pollsets[pollset_set->pollset_count]);
       break;
     }
@@ -1225,14 +1225,14 @@
   }
 }
 
-static void pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset_set *bag,
-                                        grpc_pollset_set *item) {
+static void pollset_set_add_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset_set* bag,
+                                        grpc_pollset_set* item) {
   size_t i, j;
   gpr_mu_lock(&bag->mu);
   if (bag->pollset_set_count == bag->pollset_set_capacity) {
     bag->pollset_set_capacity = GPR_MAX(8, 2 * bag->pollset_set_capacity);
-    bag->pollset_sets = (grpc_pollset_set **)gpr_realloc(
+    bag->pollset_sets = (grpc_pollset_set**)gpr_realloc(
         bag->pollset_sets,
         bag->pollset_set_capacity * sizeof(*bag->pollset_sets));
   }
@@ -1249,15 +1249,15 @@
   gpr_mu_unlock(&bag->mu);
 }
 
-static void pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset_set *bag,
-                                        grpc_pollset_set *item) {
+static void pollset_set_del_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset_set* bag,
+                                        grpc_pollset_set* item) {
   size_t i;
   gpr_mu_lock(&bag->mu);
   for (i = 0; i < bag->pollset_set_count; i++) {
     if (bag->pollset_sets[i] == item) {
       bag->pollset_set_count--;
-      GPR_SWAP(grpc_pollset_set *, bag->pollset_sets[i],
+      GPR_SWAP(grpc_pollset_set*, bag->pollset_sets[i],
                bag->pollset_sets[bag->pollset_set_count]);
       break;
     }
@@ -1265,13 +1265,13 @@
   gpr_mu_unlock(&bag->mu);
 }
 
-static void pollset_set_add_fd(grpc_exec_ctx *exec_ctx,
-                               grpc_pollset_set *pollset_set, grpc_fd *fd) {
+static void pollset_set_add_fd(grpc_exec_ctx* exec_ctx,
+                               grpc_pollset_set* pollset_set, grpc_fd* fd) {
   size_t i;
   gpr_mu_lock(&pollset_set->mu);
   if (pollset_set->fd_count == pollset_set->fd_capacity) {
     pollset_set->fd_capacity = GPR_MAX(8, 2 * pollset_set->fd_capacity);
-    pollset_set->fds = (grpc_fd **)gpr_realloc(
+    pollset_set->fds = (grpc_fd**)gpr_realloc(
         pollset_set->fds, pollset_set->fd_capacity * sizeof(*pollset_set->fds));
   }
   GRPC_FD_REF(fd, "pollset_set");
@@ -1285,14 +1285,14 @@
   gpr_mu_unlock(&pollset_set->mu);
 }
 
-static void pollset_set_del_fd(grpc_exec_ctx *exec_ctx,
-                               grpc_pollset_set *pollset_set, grpc_fd *fd) {
+static void pollset_set_del_fd(grpc_exec_ctx* exec_ctx,
+                               grpc_pollset_set* pollset_set, grpc_fd* fd) {
   size_t i;
   gpr_mu_lock(&pollset_set->mu);
   for (i = 0; i < pollset_set->fd_count; i++) {
     if (pollset_set->fds[i] == fd) {
       pollset_set->fd_count--;
-      GPR_SWAP(grpc_fd *, pollset_set->fds[i],
+      GPR_SWAP(grpc_fd*, pollset_set->fds[i],
                pollset_set->fds[pollset_set->fd_count]);
       GRPC_FD_UNREF(fd, "pollset_set");
       break;
@@ -1308,10 +1308,10 @@
  * Condition Variable polling extensions
  */
 
-static void run_poll(void *args);
-static void cache_poller_locked(poll_args *args);
+static void run_poll(void* args);
+static void cache_poller_locked(poll_args* args);
 
-static void cache_insert_locked(poll_args *args) {
+static void cache_insert_locked(poll_args* args) {
   uint32_t key = gpr_murmur_hash3(args->fds, args->nfds * sizeof(struct pollfd),
                                   0xDEADBEEF);
   key = key % poll_cache.size;
@@ -1324,13 +1324,13 @@
   poll_cache.count++;
 }
 
-static void init_result(poll_args *pargs) {
-  pargs->result = (poll_result *)gpr_malloc(sizeof(poll_result));
+static void init_result(poll_args* pargs) {
+  pargs->result = (poll_result*)gpr_malloc(sizeof(poll_result));
   gpr_ref_init(&pargs->result->refcount, 1);
   pargs->result->watchers = NULL;
   pargs->result->watchcount = 0;
   pargs->result->fds =
-      (struct pollfd *)gpr_malloc(sizeof(struct pollfd) * pargs->nfds);
+      (struct pollfd*)gpr_malloc(sizeof(struct pollfd) * pargs->nfds);
   memcpy(pargs->result->fds, pargs->fds, sizeof(struct pollfd) * pargs->nfds);
   pargs->result->nfds = pargs->nfds;
   pargs->result->retval = 0;
@@ -1340,11 +1340,11 @@
 
 // Creates a poll_args object for a given arguments to poll().
 // This object may return a poll_args in the cache.
-static poll_args *get_poller_locked(struct pollfd *fds, nfds_t count) {
+static poll_args* get_poller_locked(struct pollfd* fds, nfds_t count) {
   uint32_t key =
       gpr_murmur_hash3(fds, count * sizeof(struct pollfd), 0xDEADBEEF);
   key = key % poll_cache.size;
-  poll_args *curr = poll_cache.active_pollers[key];
+  poll_args* curr = poll_cache.active_pollers[key];
   while (curr) {
     if (curr->nfds == count &&
         memcmp(curr->fds, fds, count * sizeof(struct pollfd)) == 0) {
@@ -1355,7 +1355,7 @@
   }
 
   if (poll_cache.free_pollers) {
-    poll_args *pargs = poll_cache.free_pollers;
+    poll_args* pargs = poll_cache.free_pollers;
     poll_cache.free_pollers = pargs->next;
     if (poll_cache.free_pollers) {
       poll_cache.free_pollers->prev = NULL;
@@ -1369,7 +1369,7 @@
     return pargs;
   }
 
-  poll_args *pargs = (poll_args *)gpr_malloc(sizeof(struct poll_args));
+  poll_args* pargs = (poll_args*)gpr_malloc(sizeof(struct poll_args));
   gpr_cv_init(&pargs->trigger);
   pargs->fds = fds;
   pargs->nfds = count;
@@ -1386,7 +1386,7 @@
   return pargs;
 }
 
-static void cache_delete_locked(poll_args *args) {
+static void cache_delete_locked(poll_args* args) {
   if (!args->prev) {
     uint32_t key = gpr_murmur_hash3(
         args->fds, args->nfds * sizeof(struct pollfd), 0xDEADBEEF);
@@ -1411,19 +1411,19 @@
   poll_cache.free_pollers = args;
 }
 
-static void cache_poller_locked(poll_args *args) {
+static void cache_poller_locked(poll_args* args) {
   if (poll_cache.count + 1 > poll_cache.size / 2) {
-    poll_args **old_active_pollers = poll_cache.active_pollers;
+    poll_args** old_active_pollers = poll_cache.active_pollers;
     poll_cache.size = poll_cache.size * 2;
     poll_cache.count = 0;
     poll_cache.active_pollers =
-        (poll_args **)gpr_malloc(sizeof(void *) * poll_cache.size);
+        (poll_args**)gpr_malloc(sizeof(void*) * poll_cache.size);
     for (unsigned int i = 0; i < poll_cache.size; i++) {
       poll_cache.active_pollers[i] = NULL;
     }
     for (unsigned int i = 0; i < poll_cache.size / 2; i++) {
-      poll_args *curr = old_active_pollers[i];
-      poll_args *next = NULL;
+      poll_args* curr = old_active_pollers[i];
+      poll_args* next = NULL;
       while (curr) {
         next = curr->next;
         cache_insert_locked(curr);
@@ -1436,7 +1436,7 @@
   cache_insert_locked(args);
 }
 
-static void cache_destroy_locked(poll_args *args) {
+static void cache_destroy_locked(poll_args* args) {
   if (args->next) {
     args->next->prev = args->prev;
   }
@@ -1450,7 +1450,7 @@
   gpr_free(args);
 }
 
-static void decref_poll_result(poll_result *res) {
+static void decref_poll_result(poll_result* res) {
   if (gpr_unref(&res->refcount)) {
     GPR_ASSERT(!res->watchers);
     gpr_free(res->fds);
@@ -1458,7 +1458,7 @@
   }
 }
 
-void remove_cvn(cv_node **head, cv_node *target) {
+void remove_cvn(cv_node** head, cv_node* target) {
   if (target->next) {
     target->next->prev = target->prev;
   }
@@ -1473,17 +1473,17 @@
 gpr_timespec thread_grace;
 
 // Poll in a background thread
-static void run_poll(void *args) {
-  poll_args *pargs = (poll_args *)args;
+static void run_poll(void* args) {
+  poll_args* pargs = (poll_args*)args;
   while (1) {
-    poll_result *result = pargs->result;
+    poll_result* result = pargs->result;
     int retval = g_cvfds.poll(result->fds, result->nfds, CV_POLL_PERIOD_MS);
     gpr_mu_lock(&g_cvfds.mu);
     if (retval != 0) {
       result->completed = 1;
       result->retval = retval;
       result->err = errno;
-      cv_node *watcher = result->watchers;
+      cv_node* watcher = result->watchers;
       while (watcher) {
         gpr_cv_signal(watcher->cv);
         watcher = watcher->next;
@@ -1514,20 +1514,20 @@
 }
 
 // This function overrides poll() to handle condition variable wakeup fds
-static int cvfd_poll(struct pollfd *fds, nfds_t nfds, int timeout) {
+static int cvfd_poll(struct pollfd* fds, nfds_t nfds, int timeout) {
   unsigned int i;
   int res, idx;
-  cv_node *pollcv;
+  cv_node* pollcv;
   int skip_poll = 0;
   nfds_t nsockfds = 0;
-  poll_result *result = NULL;
+  poll_result* result = NULL;
   gpr_mu_lock(&g_cvfds.mu);
-  pollcv = (cv_node *)gpr_malloc(sizeof(cv_node));
+  pollcv = (cv_node*)gpr_malloc(sizeof(cv_node));
   pollcv->next = NULL;
   gpr_cv pollcv_cv;
   gpr_cv_init(&pollcv_cv);
   pollcv->cv = &pollcv_cv;
-  cv_node *fd_cvs = (cv_node *)gpr_malloc(nfds * sizeof(cv_node));
+  cv_node* fd_cvs = (cv_node*)gpr_malloc(nfds * sizeof(cv_node));
 
   for (i = 0; i < nfds; i++) {
     fds[i].revents = 0;
@@ -1559,8 +1559,8 @@
 
   res = 0;
   if (!skip_poll && nsockfds > 0) {
-    struct pollfd *pollfds =
-        (struct pollfd *)gpr_malloc(sizeof(struct pollfd) * nsockfds);
+    struct pollfd* pollfds =
+        (struct pollfd*)gpr_malloc(sizeof(struct pollfd) * nsockfds);
     idx = 0;
     for (i = 0; i < nfds; i++) {
       if (fds[i].fd >= 0) {
@@ -1570,7 +1570,7 @@
         idx++;
       }
     }
-    poll_args *pargs = get_poller_locked(pollfds, nsockfds);
+    poll_args* pargs = get_poller_locked(pollfds, nsockfds);
     result = pargs->result;
     pollcv->next = result->watchers;
     pollcv->prev = NULL;
@@ -1623,8 +1623,7 @@
   gpr_cv_init(&g_cvfds.shutdown_cv);
   gpr_ref_init(&g_cvfds.pollcount, 1);
   g_cvfds.size = CV_DEFAULT_TABLE_SIZE;
-  g_cvfds.cvfds =
-      (fd_node *)gpr_malloc(sizeof(fd_node) * CV_DEFAULT_TABLE_SIZE);
+  g_cvfds.cvfds = (fd_node*)gpr_malloc(sizeof(fd_node) * CV_DEFAULT_TABLE_SIZE);
   g_cvfds.free_fds = NULL;
   thread_grace = gpr_time_from_millis(POLLCV_THREAD_GRACE_MS, GPR_TIMESPAN);
   for (int i = 0; i < CV_DEFAULT_TABLE_SIZE; i++) {
@@ -1641,7 +1640,7 @@
   poll_cache.size = 32;
   poll_cache.count = 0;
   poll_cache.free_pollers = NULL;
-  poll_cache.active_pollers = (poll_args **)gpr_malloc(sizeof(void *) * 32);
+  poll_cache.active_pollers = (poll_args**)gpr_malloc(sizeof(void*) * 32);
   for (unsigned int i = 0; i < poll_cache.size; i++) {
     poll_cache.active_pollers[i] = NULL;
   }
@@ -1711,8 +1710,9 @@
     shutdown_engine,
 };
 
-const grpc_event_engine_vtable *grpc_init_poll_posix(bool explicit_request) {
+const grpc_event_engine_vtable* grpc_init_poll_posix(bool explicit_request) {
   if (!grpc_has_wakeup_fd()) {
+    gpr_log(GPR_ERROR, "Skipping poll because of no wakeup fd.");
     return NULL;
   }
   if (!GRPC_LOG_IF_ERROR("pollset_global_init", pollset_global_init())) {
@@ -1721,7 +1721,7 @@
   return &vtable;
 }
 
-const grpc_event_engine_vtable *grpc_init_poll_cv_posix(bool explicit_request) {
+const grpc_event_engine_vtable* grpc_init_poll_cv_posix(bool explicit_request) {
   global_cv_fd_table_init();
   grpc_enable_cv_wakeup_fds(1);
   if (!GRPC_LOG_IF_ERROR("pollset_global_init", pollset_global_init())) {
diff --git a/src/core/lib/iomgr/ev_poll_posix.h b/src/core/lib/iomgr/ev_poll_posix.h
index 8612572..626e95b 100644
--- a/src/core/lib/iomgr/ev_poll_posix.h
+++ b/src/core/lib/iomgr/ev_poll_posix.h
@@ -25,8 +25,8 @@
 extern "C" {
 #endif
 
-const grpc_event_engine_vtable *grpc_init_poll_posix(bool explicit_request);
-const grpc_event_engine_vtable *grpc_init_poll_cv_posix(bool explicit_request);
+const grpc_event_engine_vtable* grpc_init_poll_posix(bool explicit_request);
+const grpc_event_engine_vtable* grpc_init_poll_cv_posix(bool explicit_request);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc
index 87fcfd2..b666917 100644
--- a/src/core/lib/iomgr/ev_posix.cc
+++ b/src/core/lib/iomgr/ev_posix.cc
@@ -36,8 +36,7 @@
 #include "src/core/lib/iomgr/ev_poll_posix.h"
 #include "src/core/lib/support/env.h"
 
-grpc_core::TraceFlag grpc_polling_trace(false,
-                                     "polling"); /* Disabled by default */
+grpc_core::TraceFlag grpc_polling_trace(false, "polling"); /* Disabled by default */
 
 #ifndef NDEBUG
 grpc_core::TraceFlag grpc_trace_fd_refcount(false, "fd_refcount");
@@ -49,14 +48,14 @@
 
 grpc_wakeup_fd grpc_global_wakeup_fd;
 
-static const grpc_event_engine_vtable *g_event_engine;
-static const char *g_poll_strategy_name = NULL;
+static const grpc_event_engine_vtable* g_event_engine;
+static const char* g_poll_strategy_name = NULL;
 
-typedef const grpc_event_engine_vtable *(*event_engine_factory_fn)(
+typedef const grpc_event_engine_vtable* (*event_engine_factory_fn)(
     bool explicit_request);
 
 typedef struct {
-  const char *name;
+  const char* name;
   event_engine_factory_fn factory;
 } event_engine_factory;
 
@@ -77,7 +76,7 @@
 }
 }  // extern "C"
 
-const grpc_event_engine_vtable *init_non_polling(bool explicit_request) {
+const grpc_event_engine_vtable* init_non_polling(bool explicit_request) {
   if (!explicit_request) {
     return nullptr;
   }
@@ -96,23 +95,23 @@
     {"poll-cv", grpc_init_poll_cv_posix},   {"none", init_non_polling},
 };
 
-static void add(const char *beg, const char *end, char ***ss, size_t *ns) {
+static void add(const char* beg, const char* end, char*** ss, size_t* ns) {
   size_t n = *ns;
   size_t np = n + 1;
-  char *s;
+  char* s;
   size_t len;
   GPR_ASSERT(end >= beg);
   len = (size_t)(end - beg);
-  s = (char *)gpr_malloc(len + 1);
+  s = (char*)gpr_malloc(len + 1);
   memcpy(s, beg, len);
   s[len] = 0;
-  *ss = (char **)gpr_realloc(*ss, sizeof(char **) * np);
+  *ss = (char**)gpr_realloc(*ss, sizeof(char**) * np);
   (*ss)[n] = s;
   *ns = np;
 }
 
-static void split(const char *s, char ***ss, size_t *ns) {
-  const char *c = strchr(s, ',');
+static void split(const char* s, char*** ss, size_t* ns) {
+  const char* c = strchr(s, ',');
   if (c == NULL) {
     add(s, s + strlen(s), ss, ns);
   } else {
@@ -121,11 +120,11 @@
   }
 }
 
-static bool is(const char *want, const char *have) {
+static bool is(const char* want, const char* have) {
   return 0 == strcmp(want, "all") || 0 == strcmp(want, have);
 }
 
-static void try_engine(const char *engine) {
+static void try_engine(const char* engine) {
   for (size_t i = 0; i < GPR_ARRAY_SIZE(g_factories); i++) {
     if (is(engine, g_factories[i].name)) {
       if ((g_event_engine = g_factories[i].factory(
@@ -140,24 +139,24 @@
 
 /* This should be used for testing purposes ONLY */
 void grpc_set_event_engine_test_only(
-    const grpc_event_engine_vtable *ev_engine) {
+    const grpc_event_engine_vtable* ev_engine) {
   g_event_engine = ev_engine;
 }
 
-const grpc_event_engine_vtable *grpc_get_event_engine_test_only() {
+const grpc_event_engine_vtable* grpc_get_event_engine_test_only() {
   return g_event_engine;
 }
 
 /* Call this only after calling grpc_event_engine_init() */
-const char *grpc_get_poll_strategy_name() { return g_poll_strategy_name; }
+const char* grpc_get_poll_strategy_name() { return g_poll_strategy_name; }
 
 void grpc_event_engine_init(void) {
-  char *s = gpr_getenv("GRPC_POLL_STRATEGY");
+  char* s = gpr_getenv("GRPC_POLL_STRATEGY");
   if (s == NULL) {
     s = gpr_strdup("all");
   }
 
-  char **strings = NULL;
+  char** strings = NULL;
   size_t nstrings = 0;
   split(s, &strings, &nstrings);
 
@@ -169,12 +168,12 @@
     gpr_free(strings[i]);
   }
   gpr_free(strings);
-  gpr_free(s);
 
   if (g_event_engine == NULL) {
-    gpr_log(GPR_ERROR, "No event engine could be initialized");
+    gpr_log(GPR_ERROR, "No event engine could be initialized from %s", s);
     abort();
   }
+  gpr_free(s);
 }
 
 void grpc_event_engine_shutdown(void) {
@@ -182,109 +181,109 @@
   g_event_engine = NULL;
 }
 
-grpc_fd *grpc_fd_create(int fd, const char *name) {
+grpc_fd* grpc_fd_create(int fd, const char* name) {
   return g_event_engine->fd_create(fd, name);
 }
 
-int grpc_fd_wrapped_fd(grpc_fd *fd) {
+int grpc_fd_wrapped_fd(grpc_fd* fd) {
   return g_event_engine->fd_wrapped_fd(fd);
 }
 
-void grpc_fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done,
-                    int *release_fd, bool already_closed, const char *reason) {
+void grpc_fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_closure* on_done,
+                    int* release_fd, bool already_closed, const char* reason) {
   g_event_engine->fd_orphan(exec_ctx, fd, on_done, release_fd, already_closed,
                             reason);
 }
 
-void grpc_fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_error *why) {
+void grpc_fd_shutdown(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_error* why) {
   g_event_engine->fd_shutdown(exec_ctx, fd, why);
 }
 
-bool grpc_fd_is_shutdown(grpc_fd *fd) {
+bool grpc_fd_is_shutdown(grpc_fd* fd) {
   return g_event_engine->fd_is_shutdown(fd);
 }
 
-void grpc_fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                            grpc_closure *closure) {
+void grpc_fd_notify_on_read(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                            grpc_closure* closure) {
   g_event_engine->fd_notify_on_read(exec_ctx, fd, closure);
 }
 
-void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                             grpc_closure *closure) {
+void grpc_fd_notify_on_write(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                             grpc_closure* closure) {
   g_event_engine->fd_notify_on_write(exec_ctx, fd, closure);
 }
 
 size_t grpc_pollset_size(void) { return g_event_engine->pollset_size; }
 
-void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
+void grpc_pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
   g_event_engine->pollset_init(pollset, mu);
 }
 
-void grpc_pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           grpc_closure *closure) {
+void grpc_pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           grpc_closure* closure) {
   g_event_engine->pollset_shutdown(exec_ctx, pollset, closure);
 }
 
-void grpc_pollset_destroy(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
+void grpc_pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
   g_event_engine->pollset_destroy(exec_ctx, pollset);
 }
 
-grpc_error *grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                              grpc_pollset_worker **worker,
+grpc_error* grpc_pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                              grpc_pollset_worker** worker,
                               grpc_millis deadline) {
   return g_event_engine->pollset_work(exec_ctx, pollset, worker, deadline);
 }
 
-grpc_error *grpc_pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                              grpc_pollset_worker *specific_worker) {
+grpc_error* grpc_pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                              grpc_pollset_worker* specific_worker) {
   return g_event_engine->pollset_kick(exec_ctx, pollset, specific_worker);
 }
 
-void grpc_pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                         struct grpc_fd *fd) {
+void grpc_pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                         struct grpc_fd* fd) {
   g_event_engine->pollset_add_fd(exec_ctx, pollset, fd);
 }
 
-grpc_pollset_set *grpc_pollset_set_create(void) {
+grpc_pollset_set* grpc_pollset_set_create(void) {
   return g_event_engine->pollset_set_create();
 }
 
-void grpc_pollset_set_destroy(grpc_exec_ctx *exec_ctx,
-                              grpc_pollset_set *pollset_set) {
+void grpc_pollset_set_destroy(grpc_exec_ctx* exec_ctx,
+                              grpc_pollset_set* pollset_set) {
   g_event_engine->pollset_set_destroy(exec_ctx, pollset_set);
 }
 
-void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
-                                  grpc_pollset_set *pollset_set,
-                                  grpc_pollset *pollset) {
+void grpc_pollset_set_add_pollset(grpc_exec_ctx* exec_ctx,
+                                  grpc_pollset_set* pollset_set,
+                                  grpc_pollset* pollset) {
   g_event_engine->pollset_set_add_pollset(exec_ctx, pollset_set, pollset);
 }
 
-void grpc_pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
-                                  grpc_pollset_set *pollset_set,
-                                  grpc_pollset *pollset) {
+void grpc_pollset_set_del_pollset(grpc_exec_ctx* exec_ctx,
+                                  grpc_pollset_set* pollset_set,
+                                  grpc_pollset* pollset) {
   g_event_engine->pollset_set_del_pollset(exec_ctx, pollset_set, pollset);
 }
 
-void grpc_pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
-                                      grpc_pollset_set *bag,
-                                      grpc_pollset_set *item) {
+void grpc_pollset_set_add_pollset_set(grpc_exec_ctx* exec_ctx,
+                                      grpc_pollset_set* bag,
+                                      grpc_pollset_set* item) {
   g_event_engine->pollset_set_add_pollset_set(exec_ctx, bag, item);
 }
 
-void grpc_pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
-                                      grpc_pollset_set *bag,
-                                      grpc_pollset_set *item) {
+void grpc_pollset_set_del_pollset_set(grpc_exec_ctx* exec_ctx,
+                                      grpc_pollset_set* bag,
+                                      grpc_pollset_set* item) {
   g_event_engine->pollset_set_del_pollset_set(exec_ctx, bag, item);
 }
 
-void grpc_pollset_set_add_fd(grpc_exec_ctx *exec_ctx,
-                             grpc_pollset_set *pollset_set, grpc_fd *fd) {
+void grpc_pollset_set_add_fd(grpc_exec_ctx* exec_ctx,
+                             grpc_pollset_set* pollset_set, grpc_fd* fd) {
   g_event_engine->pollset_set_add_fd(exec_ctx, pollset_set, fd);
 }
 
-void grpc_pollset_set_del_fd(grpc_exec_ctx *exec_ctx,
-                             grpc_pollset_set *pollset_set, grpc_fd *fd) {
+void grpc_pollset_set_del_fd(grpc_exec_ctx* exec_ctx,
+                             grpc_pollset_set* pollset_set, grpc_fd* fd) {
   g_event_engine->pollset_set_del_fd(exec_ctx, pollset_set, fd);
 }
 
diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h
index d4d6d98..8f45d2e 100644
--- a/src/core/lib/iomgr/ev_posix.h
+++ b/src/core/lib/iomgr/ev_posix.h
@@ -38,50 +38,50 @@
 typedef struct grpc_event_engine_vtable {
   size_t pollset_size;
 
-  grpc_fd *(*fd_create)(int fd, const char *name);
-  int (*fd_wrapped_fd)(grpc_fd *fd);
-  void (*fd_orphan)(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done,
-                    int *release_fd, bool already_closed, const char *reason);
-  void (*fd_shutdown)(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_error *why);
-  void (*fd_notify_on_read)(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                            grpc_closure *closure);
-  void (*fd_notify_on_write)(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                             grpc_closure *closure);
-  bool (*fd_is_shutdown)(grpc_fd *fd);
-  grpc_pollset *(*fd_get_read_notifier_pollset)(grpc_exec_ctx *exec_ctx,
-                                                grpc_fd *fd);
+  grpc_fd* (*fd_create)(int fd, const char* name);
+  int (*fd_wrapped_fd)(grpc_fd* fd);
+  void (*fd_orphan)(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_closure* on_done,
+                    int* release_fd, bool already_closed, const char* reason);
+  void (*fd_shutdown)(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_error* why);
+  void (*fd_notify_on_read)(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                            grpc_closure* closure);
+  void (*fd_notify_on_write)(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                             grpc_closure* closure);
+  bool (*fd_is_shutdown)(grpc_fd* fd);
+  grpc_pollset* (*fd_get_read_notifier_pollset)(grpc_exec_ctx* exec_ctx,
+                                                grpc_fd* fd);
 
-  void (*pollset_init)(grpc_pollset *pollset, gpr_mu **mu);
-  void (*pollset_shutdown)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           grpc_closure *closure);
-  void (*pollset_destroy)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset);
-  grpc_error *(*pollset_work)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                              grpc_pollset_worker **worker,
+  void (*pollset_init)(grpc_pollset* pollset, gpr_mu** mu);
+  void (*pollset_shutdown)(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           grpc_closure* closure);
+  void (*pollset_destroy)(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset);
+  grpc_error* (*pollset_work)(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                              grpc_pollset_worker** worker,
                               grpc_millis deadline);
-  grpc_error *(*pollset_kick)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                              grpc_pollset_worker *specific_worker);
-  void (*pollset_add_fd)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                         struct grpc_fd *fd);
+  grpc_error* (*pollset_kick)(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                              grpc_pollset_worker* specific_worker);
+  void (*pollset_add_fd)(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                         struct grpc_fd* fd);
 
-  grpc_pollset_set *(*pollset_set_create)(void);
-  void (*pollset_set_destroy)(grpc_exec_ctx *exec_ctx,
-                              grpc_pollset_set *pollset_set);
-  void (*pollset_set_add_pollset)(grpc_exec_ctx *exec_ctx,
-                                  grpc_pollset_set *pollset_set,
-                                  grpc_pollset *pollset);
-  void (*pollset_set_del_pollset)(grpc_exec_ctx *exec_ctx,
-                                  grpc_pollset_set *pollset_set,
-                                  grpc_pollset *pollset);
-  void (*pollset_set_add_pollset_set)(grpc_exec_ctx *exec_ctx,
-                                      grpc_pollset_set *bag,
-                                      grpc_pollset_set *item);
-  void (*pollset_set_del_pollset_set)(grpc_exec_ctx *exec_ctx,
-                                      grpc_pollset_set *bag,
-                                      grpc_pollset_set *item);
-  void (*pollset_set_add_fd)(grpc_exec_ctx *exec_ctx,
-                             grpc_pollset_set *pollset_set, grpc_fd *fd);
-  void (*pollset_set_del_fd)(grpc_exec_ctx *exec_ctx,
-                             grpc_pollset_set *pollset_set, grpc_fd *fd);
+  grpc_pollset_set* (*pollset_set_create)(void);
+  void (*pollset_set_destroy)(grpc_exec_ctx* exec_ctx,
+                              grpc_pollset_set* pollset_set);
+  void (*pollset_set_add_pollset)(grpc_exec_ctx* exec_ctx,
+                                  grpc_pollset_set* pollset_set,
+                                  grpc_pollset* pollset);
+  void (*pollset_set_del_pollset)(grpc_exec_ctx* exec_ctx,
+                                  grpc_pollset_set* pollset_set,
+                                  grpc_pollset* pollset);
+  void (*pollset_set_add_pollset_set)(grpc_exec_ctx* exec_ctx,
+                                      grpc_pollset_set* bag,
+                                      grpc_pollset_set* item);
+  void (*pollset_set_del_pollset_set)(grpc_exec_ctx* exec_ctx,
+                                      grpc_pollset_set* bag,
+                                      grpc_pollset_set* item);
+  void (*pollset_set_add_fd)(grpc_exec_ctx* exec_ctx,
+                             grpc_pollset_set* pollset_set, grpc_fd* fd);
+  void (*pollset_set_del_fd)(grpc_exec_ctx* exec_ctx,
+                             grpc_pollset_set* pollset_set, grpc_fd* fd);
 
   void (*shutdown_engine)(void);
 } grpc_event_engine_vtable;
@@ -90,15 +90,15 @@
 void grpc_event_engine_shutdown(void);
 
 /* Return the name of the poll strategy */
-const char *grpc_get_poll_strategy_name();
+const char* grpc_get_poll_strategy_name();
 
 /* Create a wrapped file descriptor.
    Requires fd is a non-blocking file descriptor.
    This takes ownership of closing fd. */
-grpc_fd *grpc_fd_create(int fd, const char *name);
+grpc_fd* grpc_fd_create(int fd, const char* name);
 
 /* Return the wrapped fd, or -1 if it has been released or closed. */
-int grpc_fd_wrapped_fd(grpc_fd *fd);
+int grpc_fd_wrapped_fd(grpc_fd* fd);
 
 /* Releases fd to be asynchronously destroyed.
    on_done is called when the underlying file descriptor is definitely close()d.
@@ -107,14 +107,14 @@
    Requires: *fd initialized; no outstanding notify_on_read or
    notify_on_write.
    MUST NOT be called with a pollset lock taken */
-void grpc_fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done,
-                    int *release_fd, bool already_closed, const char *reason);
+void grpc_fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_closure* on_done,
+                    int* release_fd, bool already_closed, const char* reason);
 
 /* Has grpc_fd_shutdown been called on an fd? */
-bool grpc_fd_is_shutdown(grpc_fd *fd);
+bool grpc_fd_is_shutdown(grpc_fd* fd);
 
 /* Cause any current and future callbacks to fail. */
-void grpc_fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_error *why);
+void grpc_fd_shutdown(grpc_exec_ctx* exec_ctx, grpc_fd* fd, grpc_error* why);
 
 /* Register read interest, causing read_cb to be called once when fd becomes
    readable, on deadline specified by deadline, or on shutdown triggered by
@@ -129,38 +129,38 @@
    underlying platform. This means that users must drain fd in read_cb before
    calling notify_on_read again. Users are also expected to handle spurious
    events, i.e read_cb is called while nothing can be readable from fd  */
-void grpc_fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                            grpc_closure *closure);
+void grpc_fd_notify_on_read(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                            grpc_closure* closure);
 
 /* Exactly the same semantics as above, except based on writable events.  */
-void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                             grpc_closure *closure);
+void grpc_fd_notify_on_write(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                             grpc_closure* closure);
 
 /* Return the read notifier pollset from the fd */
-grpc_pollset *grpc_fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx,
-                                                grpc_fd *fd);
+grpc_pollset* grpc_fd_get_read_notifier_pollset(grpc_exec_ctx* exec_ctx,
+                                                grpc_fd* fd);
 
 /* pollset_posix functions */
 
 /* Add an fd to a pollset */
-void grpc_pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                         struct grpc_fd *fd);
+void grpc_pollset_add_fd(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                         struct grpc_fd* fd);
 
 /* pollset_set_posix functions */
 
-void grpc_pollset_set_add_fd(grpc_exec_ctx *exec_ctx,
-                             grpc_pollset_set *pollset_set, grpc_fd *fd);
-void grpc_pollset_set_del_fd(grpc_exec_ctx *exec_ctx,
-                             grpc_pollset_set *pollset_set, grpc_fd *fd);
+void grpc_pollset_set_add_fd(grpc_exec_ctx* exec_ctx,
+                             grpc_pollset_set* pollset_set, grpc_fd* fd);
+void grpc_pollset_set_del_fd(grpc_exec_ctx* exec_ctx,
+                             grpc_pollset_set* pollset_set, grpc_fd* fd);
 
 /* override to allow tests to hook poll() usage */
-typedef int (*grpc_poll_function_type)(struct pollfd *, nfds_t, int);
+typedef int (*grpc_poll_function_type)(struct pollfd*, nfds_t, int);
 extern grpc_poll_function_type grpc_poll_function;
 
 /* WARNING: The following two functions should be used for testing purposes
  * ONLY */
-void grpc_set_event_engine_test_only(const grpc_event_engine_vtable *);
-const grpc_event_engine_vtable *grpc_get_event_engine_test_only();
+void grpc_set_event_engine_test_only(const grpc_event_engine_vtable*);
+const grpc_event_engine_vtable* grpc_get_event_engine_test_only();
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/exec_ctx.cc b/src/core/lib/iomgr/exec_ctx.cc
index e4d956d..6661f67 100644
--- a/src/core/lib/iomgr/exec_ctx.cc
+++ b/src/core/lib/iomgr/exec_ctx.cc
@@ -25,7 +25,7 @@
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/profiling/timers.h"
 
-bool grpc_exec_ctx_ready_to_finish(grpc_exec_ctx *exec_ctx) {
+bool grpc_exec_ctx_ready_to_finish(grpc_exec_ctx* exec_ctx) {
   if ((exec_ctx->flags & GRPC_EXEC_CTX_FLAG_IS_FINISHED) == 0) {
     if (exec_ctx->check_ready_to_finish(exec_ctx,
                                         exec_ctx->check_ready_to_finish_arg)) {
@@ -38,26 +38,26 @@
   }
 }
 
-bool grpc_never_ready_to_finish(grpc_exec_ctx *exec_ctx, void *arg_ignored) {
+bool grpc_never_ready_to_finish(grpc_exec_ctx* exec_ctx, void* arg_ignored) {
   return false;
 }
 
-bool grpc_always_ready_to_finish(grpc_exec_ctx *exec_ctx, void *arg_ignored) {
+bool grpc_always_ready_to_finish(grpc_exec_ctx* exec_ctx, void* arg_ignored) {
   return true;
 }
 
-bool grpc_exec_ctx_has_work(grpc_exec_ctx *exec_ctx) {
+bool grpc_exec_ctx_has_work(grpc_exec_ctx* exec_ctx) {
   return exec_ctx->active_combiner != NULL ||
          !grpc_closure_list_empty(exec_ctx->closure_list);
 }
 
-void grpc_exec_ctx_finish(grpc_exec_ctx *exec_ctx) {
+void grpc_exec_ctx_finish(grpc_exec_ctx* exec_ctx) {
   exec_ctx->flags |= GRPC_EXEC_CTX_FLAG_IS_FINISHED;
   grpc_exec_ctx_flush(exec_ctx);
 }
 
-static void exec_ctx_run(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                         grpc_error *error) {
+static void exec_ctx_run(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                         grpc_error* error) {
 #ifndef NDEBUG
   closure->scheduled = false;
   if (grpc_trace_closure.enabled()) {
@@ -76,16 +76,16 @@
   GRPC_ERROR_UNREF(error);
 }
 
-bool grpc_exec_ctx_flush(grpc_exec_ctx *exec_ctx) {
+bool grpc_exec_ctx_flush(grpc_exec_ctx* exec_ctx) {
   bool did_something = 0;
   GPR_TIMER_BEGIN("grpc_exec_ctx_flush", 0);
   for (;;) {
     if (!grpc_closure_list_empty(exec_ctx->closure_list)) {
-      grpc_closure *c = exec_ctx->closure_list.head;
+      grpc_closure* c = exec_ctx->closure_list.head;
       exec_ctx->closure_list.head = exec_ctx->closure_list.tail = NULL;
       while (c != NULL) {
-        grpc_closure *next = c->next_data.next;
-        grpc_error *error = c->error_data.error;
+        grpc_closure* next = c->next_data.next;
+        grpc_error* error = c->error_data.error;
         did_something = true;
         exec_ctx_run(exec_ctx, c, error);
         c = next;
@@ -99,8 +99,8 @@
   return did_something;
 }
 
-static void exec_ctx_sched(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                           grpc_error *error) {
+static void exec_ctx_sched(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                           grpc_error* error) {
   grpc_closure_list_append(&exec_ctx->closure_list, closure, error);
 }
 
@@ -138,7 +138,7 @@
   return (gpr_atm)x;
 }
 
-grpc_millis grpc_exec_ctx_now(grpc_exec_ctx *exec_ctx) {
+grpc_millis grpc_exec_ctx_now(grpc_exec_ctx* exec_ctx) {
   if (!exec_ctx->now_is_valid) {
     exec_ctx->now = timespec_to_atm_round_down(gpr_now(GPR_CLOCK_MONOTONIC));
     exec_ctx->now_is_valid = true;
@@ -146,7 +146,7 @@
   return exec_ctx->now;
 }
 
-void grpc_exec_ctx_invalidate_now(grpc_exec_ctx *exec_ctx) {
+void grpc_exec_ctx_invalidate_now(grpc_exec_ctx* exec_ctx) {
   exec_ctx->now_is_valid = false;
 }
 
@@ -179,4 +179,4 @@
 static const grpc_closure_scheduler_vtable exec_ctx_scheduler_vtable = {
     exec_ctx_run, exec_ctx_sched, "exec_ctx"};
 static grpc_closure_scheduler exec_ctx_scheduler = {&exec_ctx_scheduler_vtable};
-grpc_closure_scheduler *grpc_schedule_on_exec_ctx = &exec_ctx_scheduler;
+grpc_closure_scheduler* grpc_schedule_on_exec_ctx = &exec_ctx_scheduler;
diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h
index 44b9be7..bd27506 100644
--- a/src/core/lib/iomgr/exec_ctx.h
+++ b/src/core/lib/iomgr/exec_ctx.h
@@ -68,13 +68,13 @@
 struct grpc_exec_ctx {
   grpc_closure_list closure_list;
   /** currently active combiner: updated only via combiner.c */
-  grpc_combiner *active_combiner;
+  grpc_combiner* active_combiner;
   /** last active combiner in the active combiner list */
-  grpc_combiner *last_combiner;
+  grpc_combiner* last_combiner;
   uintptr_t flags;
   unsigned starting_cpu;
-  void *check_ready_to_finish_arg;
-  bool (*check_ready_to_finish)(grpc_exec_ctx *exec_ctx, void *arg);
+  void* check_ready_to_finish_arg;
+  bool (*check_ready_to_finish)(grpc_exec_ctx* exec_ctx, void* arg);
 
   bool now_is_valid;
   grpc_millis now;
@@ -93,33 +93,33 @@
 #define GRPC_EXEC_CTX_INIT \
   GRPC_EXEC_CTX_INITIALIZER(GRPC_EXEC_CTX_FLAG_IS_FINISHED, NULL, NULL)
 
-extern grpc_closure_scheduler *grpc_schedule_on_exec_ctx;
+extern grpc_closure_scheduler* grpc_schedule_on_exec_ctx;
 
-bool grpc_exec_ctx_has_work(grpc_exec_ctx *exec_ctx);
+bool grpc_exec_ctx_has_work(grpc_exec_ctx* exec_ctx);
 
 /** Flush any work that has been enqueued onto this grpc_exec_ctx.
  *  Caller must guarantee that no interfering locks are held.
  *  Returns true if work was performed, false otherwise. */
-bool grpc_exec_ctx_flush(grpc_exec_ctx *exec_ctx);
+bool grpc_exec_ctx_flush(grpc_exec_ctx* exec_ctx);
 /** Finish any pending work for a grpc_exec_ctx. Must be called before
  *  the instance is destroyed, or work may be lost. */
-void grpc_exec_ctx_finish(grpc_exec_ctx *exec_ctx);
+void grpc_exec_ctx_finish(grpc_exec_ctx* exec_ctx);
 /** Returns true if we'd like to leave this execution context as soon as
     possible: useful for deciding whether to do something more or not depending
     on outside context */
-bool grpc_exec_ctx_ready_to_finish(grpc_exec_ctx *exec_ctx);
+bool grpc_exec_ctx_ready_to_finish(grpc_exec_ctx* exec_ctx);
 /** A finish check that is never ready to finish */
-bool grpc_never_ready_to_finish(grpc_exec_ctx *exec_ctx, void *arg_ignored);
+bool grpc_never_ready_to_finish(grpc_exec_ctx* exec_ctx, void* arg_ignored);
 /** A finish check that is always ready to finish */
-bool grpc_always_ready_to_finish(grpc_exec_ctx *exec_ctx, void *arg_ignored);
+bool grpc_always_ready_to_finish(grpc_exec_ctx* exec_ctx, void* arg_ignored);
 
 void grpc_exec_ctx_global_init(void);
 
 void grpc_exec_ctx_global_init(void);
 void grpc_exec_ctx_global_shutdown(void);
 
-grpc_millis grpc_exec_ctx_now(grpc_exec_ctx *exec_ctx);
-void grpc_exec_ctx_invalidate_now(grpc_exec_ctx *exec_ctx);
+grpc_millis grpc_exec_ctx_now(grpc_exec_ctx* exec_ctx);
+void grpc_exec_ctx_invalidate_now(grpc_exec_ctx* exec_ctx);
 gpr_timespec grpc_millis_to_timespec(grpc_millis millis, gpr_clock_type clock);
 grpc_millis grpc_timespec_to_millis_round_down(gpr_timespec timespec);
 grpc_millis grpc_timespec_to_millis_round_up(gpr_timespec timespec);
diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc
index 59c7818..da58774 100644
--- a/src/core/lib/iomgr/executor.cc
+++ b/src/core/lib/iomgr/executor.cc
@@ -44,24 +44,24 @@
   gpr_thd_id id;
 } thread_state;
 
-static thread_state *g_thread_state;
+static thread_state* g_thread_state;
 static size_t g_max_threads;
 static gpr_atm g_cur_threads;
 static gpr_spinlock g_adding_thread_lock = GPR_SPINLOCK_STATIC_INITIALIZER;
 
 GPR_TLS_DECL(g_this_thread_state);
 
-static grpc_core::TraceFlag executor_trace(false, "executor");
+grpc_core::TraceFlag executor_trace(false, "executor");
 
-static void executor_thread(void *arg);
+static void executor_thread(void* arg);
 
-static size_t run_closures(grpc_exec_ctx *exec_ctx, grpc_closure_list list) {
+static size_t run_closures(grpc_exec_ctx* exec_ctx, grpc_closure_list list) {
   size_t n = 0;
 
-  grpc_closure *c = list.head;
+  grpc_closure* c = list.head;
   while (c != NULL) {
-    grpc_closure *next = c->next_data.next;
-    grpc_error *error = c->error_data.error;
+    grpc_closure* next = c->next_data.next;
+    grpc_error* error = c->error_data.error;
     if (executor_trace.enabled()) {
 #ifndef NDEBUG
       gpr_log(GPR_DEBUG, "EXECUTOR: run %p [created by %s:%d]", c,
@@ -87,7 +87,7 @@
   return gpr_atm_no_barrier_load(&g_cur_threads) > 0;
 }
 
-void grpc_executor_set_threading(grpc_exec_ctx *exec_ctx, bool threading) {
+void grpc_executor_set_threading(grpc_exec_ctx* exec_ctx, bool threading) {
   gpr_atm cur_threads = gpr_atm_no_barrier_load(&g_cur_threads);
   if (threading) {
     if (cur_threads > 0) return;
@@ -95,7 +95,7 @@
     gpr_atm_no_barrier_store(&g_cur_threads, 1);
     gpr_tls_init(&g_this_thread_state);
     g_thread_state =
-        (thread_state *)gpr_zalloc(sizeof(thread_state) * g_max_threads);
+        (thread_state*)gpr_zalloc(sizeof(thread_state) * g_max_threads);
     for (size_t i = 0; i < g_max_threads; i++) {
       gpr_mu_init(&g_thread_state[i].mu);
       gpr_cv_init(&g_thread_state[i].cv);
@@ -132,17 +132,17 @@
   }
 }
 
-void grpc_executor_init(grpc_exec_ctx *exec_ctx) {
+void grpc_executor_init(grpc_exec_ctx* exec_ctx) {
   gpr_atm_no_barrier_store(&g_cur_threads, 0);
   grpc_executor_set_threading(exec_ctx, true);
 }
 
-void grpc_executor_shutdown(grpc_exec_ctx *exec_ctx) {
+void grpc_executor_shutdown(grpc_exec_ctx* exec_ctx) {
   grpc_executor_set_threading(exec_ctx, false);
 }
 
-static void executor_thread(void *arg) {
-  thread_state *ts = (thread_state *)arg;
+static void executor_thread(void* arg) {
+  thread_state* ts = (thread_state*)arg;
   gpr_tls_set(&g_this_thread_state, (intptr_t)ts);
 
   grpc_exec_ctx exec_ctx =
@@ -182,8 +182,8 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void executor_push(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                          grpc_error *error, bool is_short) {
+static void executor_push(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                          grpc_error* error, bool is_short) {
   bool retry_push;
   if (is_short) {
     GRPC_STATS_INC_EXECUTOR_SCHEDULED_SHORT_ITEMS(exec_ctx);
@@ -205,13 +205,13 @@
       grpc_closure_list_append(&exec_ctx->closure_list, closure, error);
       return;
     }
-    thread_state *ts = (thread_state *)gpr_tls_get(&g_this_thread_state);
+    thread_state* ts = (thread_state*)gpr_tls_get(&g_this_thread_state);
     if (ts == NULL) {
       ts = &g_thread_state[GPR_HASH_POINTER(exec_ctx, cur_thread_count)];
     } else {
       GRPC_STATS_INC_EXECUTOR_SCHEDULED_TO_SELF(exec_ctx);
     }
-    thread_state *orig_ts = ts;
+    thread_state* orig_ts = ts;
 
     bool try_new_thread;
     for (;;) {
@@ -274,13 +274,13 @@
   } while (retry_push);
 }
 
-static void executor_push_short(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                                grpc_error *error) {
+static void executor_push_short(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                                grpc_error* error) {
   executor_push(exec_ctx, closure, error, true);
 }
 
-static void executor_push_long(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                               grpc_error *error) {
+static void executor_push_long(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                               grpc_error* error) {
   executor_push(exec_ctx, closure, error, false);
 }
 
@@ -293,7 +293,7 @@
     executor_push_long, executor_push_long, "executor"};
 static grpc_closure_scheduler executor_scheduler_long = {&executor_vtable_long};
 
-grpc_closure_scheduler *grpc_executor_scheduler(
+grpc_closure_scheduler* grpc_executor_scheduler(
     grpc_executor_job_length length) {
   return length == GRPC_EXECUTOR_SHORT ? &executor_scheduler_short
                                        : &executor_scheduler_long;
diff --git a/src/core/lib/iomgr/executor.h b/src/core/lib/iomgr/executor.h
index ef5ac56..8418ace 100644
--- a/src/core/lib/iomgr/executor.h
+++ b/src/core/lib/iomgr/executor.h
@@ -35,19 +35,19 @@
  * This mechanism is meant to outsource work (grpc_closure instances) to a
  * thread, for those cases where blocking isn't an option but there isn't a
  * non-blocking solution available. */
-void grpc_executor_init(grpc_exec_ctx *exec_ctx);
+void grpc_executor_init(grpc_exec_ctx* exec_ctx);
 
-grpc_closure_scheduler *grpc_executor_scheduler(grpc_executor_job_length);
+grpc_closure_scheduler* grpc_executor_scheduler(grpc_executor_job_length);
 
 /** Shutdown the executor, running all pending work as part of the call */
-void grpc_executor_shutdown(grpc_exec_ctx *exec_ctx);
+void grpc_executor_shutdown(grpc_exec_ctx* exec_ctx);
 
 /** Is the executor multi-threaded? */
 bool grpc_executor_is_threaded();
 
 /* enable/disable threading - must be called after grpc_executor_init and before
    grpc_executor_shutdown */
-void grpc_executor_set_threading(grpc_exec_ctx *exec_ctx, bool enable);
+void grpc_executor_set_threading(grpc_exec_ctx* exec_ctx, bool enable);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/gethostname.h b/src/core/lib/iomgr/gethostname.h
index f335fea..2e65b5f 100644
--- a/src/core/lib/iomgr/gethostname.h
+++ b/src/core/lib/iomgr/gethostname.h
@@ -25,7 +25,7 @@
 
 // Returns the hostname of the local machine.
 // Caller takes ownership of result.
-char *grpc_gethostname();
+char* grpc_gethostname();
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/gethostname_fallback.cc b/src/core/lib/iomgr/gethostname_fallback.cc
index e6f4c2f..81e2c7a 100644
--- a/src/core/lib/iomgr/gethostname_fallback.cc
+++ b/src/core/lib/iomgr/gethostname_fallback.cc
@@ -23,6 +23,6 @@
 
 #include <stddef.h>
 
-char *grpc_gethostname() { return NULL; }
+char* grpc_gethostname() { return NULL; }
 
 #endif  // GRPC_GETHOSTNAME_FALLBACK
diff --git a/src/core/lib/iomgr/gethostname_host_name_max.cc b/src/core/lib/iomgr/gethostname_host_name_max.cc
index cdaf097..987ff1e 100644
--- a/src/core/lib/iomgr/gethostname_host_name_max.cc
+++ b/src/core/lib/iomgr/gethostname_host_name_max.cc
@@ -26,8 +26,8 @@
 
 #include <grpc/support/alloc.h>
 
-char *grpc_gethostname() {
-  char *hostname = (char *)gpr_malloc(HOST_NAME_MAX);
+char* grpc_gethostname() {
+  char* hostname = (char*)gpr_malloc(HOST_NAME_MAX);
   if (gethostname(hostname, HOST_NAME_MAX) != 0) {
     gpr_free(hostname);
     return NULL;
diff --git a/src/core/lib/iomgr/gethostname_sysconf.cc b/src/core/lib/iomgr/gethostname_sysconf.cc
index 8441e06..e099fbd 100644
--- a/src/core/lib/iomgr/gethostname_sysconf.cc
+++ b/src/core/lib/iomgr/gethostname_sysconf.cc
@@ -25,9 +25,9 @@
 
 #include <grpc/support/alloc.h>
 
-char *grpc_gethostname() {
+char* grpc_gethostname() {
   size_t host_name_max = (size_t)sysconf(_SC_HOST_NAME_MAX);
-  char *hostname = (char *)gpr_malloc(host_name_max);
+  char* hostname = (char*)gpr_malloc(host_name_max);
   if (gethostname(hostname, host_name_max) != 0) {
     gpr_free(hostname);
     return NULL;
diff --git a/src/core/lib/iomgr/iocp_windows.cc b/src/core/lib/iomgr/iocp_windows.cc
index 78185cc..6bbe566 100644
--- a/src/core/lib/iomgr/iocp_windows.cc
+++ b/src/core/lib/iomgr/iocp_windows.cc
@@ -42,7 +42,7 @@
 
 static HANDLE g_iocp;
 
-static DWORD deadline_to_millis_timeout(grpc_exec_ctx *exec_ctx,
+static DWORD deadline_to_millis_timeout(grpc_exec_ctx* exec_ctx,
                                         grpc_millis deadline) {
   if (deadline == GRPC_MILLIS_INF_FUTURE) {
     return INFINITE;
@@ -54,15 +54,15 @@
   return static_cast<DWORD>(deadline - now);
 }
 
-grpc_iocp_work_status grpc_iocp_work(grpc_exec_ctx *exec_ctx,
+grpc_iocp_work_status grpc_iocp_work(grpc_exec_ctx* exec_ctx,
                                      grpc_millis deadline) {
   BOOL success;
   DWORD bytes = 0;
   DWORD flags = 0;
   ULONG_PTR completion_key;
   LPOVERLAPPED overlapped;
-  grpc_winsocket *socket;
-  grpc_winsocket_callback_info *info;
+  grpc_winsocket* socket;
+  grpc_winsocket_callback_info* info;
   GRPC_STATS_INC_SYSCALL_POLL(exec_ctx);
   success =
       GetQueuedCompletionStatus(g_iocp, &bytes, &completion_key, &overlapped,
@@ -82,7 +82,7 @@
     abort();
   }
 
-  socket = (grpc_winsocket *)completion_key;
+  socket = (grpc_winsocket*)completion_key;
   if (overlapped == &socket->write_info.overlapped) {
     info = &socket->write_info;
   } else if (overlapped == &socket->read_info.overlapped) {
@@ -134,13 +134,13 @@
   GPR_ASSERT(CloseHandle(g_iocp));
 }
 
-void grpc_iocp_add_socket(grpc_winsocket *socket) {
+void grpc_iocp_add_socket(grpc_winsocket* socket) {
   HANDLE ret;
   if (socket->added_to_iocp) return;
   ret = CreateIoCompletionPort((HANDLE)socket->socket, g_iocp,
                                (uintptr_t)socket, 0);
   if (!ret) {
-    char *utf8_message = gpr_format_message(WSAGetLastError());
+    char* utf8_message = gpr_format_message(WSAGetLastError());
     gpr_log(GPR_ERROR, "Unable to add socket to iocp: %s", utf8_message);
     gpr_free(utf8_message);
     __debugbreak();
diff --git a/src/core/lib/iomgr/iocp_windows.h b/src/core/lib/iomgr/iocp_windows.h
index 4efbc946..ff9b31e 100644
--- a/src/core/lib/iomgr/iocp_windows.h
+++ b/src/core/lib/iomgr/iocp_windows.h
@@ -33,13 +33,13 @@
   GRPC_IOCP_WORK_KICK
 } grpc_iocp_work_status;
 
-grpc_iocp_work_status grpc_iocp_work(grpc_exec_ctx *exec_ctx,
+grpc_iocp_work_status grpc_iocp_work(grpc_exec_ctx* exec_ctx,
                                      grpc_millis deadline);
 void grpc_iocp_init(void);
 void grpc_iocp_kick(void);
 void grpc_iocp_flush(void);
 void grpc_iocp_shutdown(void);
-void grpc_iocp_add_socket(grpc_winsocket *);
+void grpc_iocp_add_socket(grpc_winsocket*);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/iomgr.cc b/src/core/lib/iomgr/iomgr.cc
index d6a5b4a..86ea08e 100644
--- a/src/core/lib/iomgr/iomgr.cc
+++ b/src/core/lib/iomgr/iomgr.cc
@@ -45,7 +45,7 @@
 static int g_shutdown;
 static grpc_iomgr_object g_root_object;
 
-void grpc_iomgr_init(grpc_exec_ctx *exec_ctx) {
+void grpc_iomgr_init(grpc_exec_ctx* exec_ctx) {
   g_shutdown = 0;
   gpr_mu_init(&g_mu);
   gpr_cv_init(&g_rcv);
@@ -53,15 +53,15 @@
   grpc_executor_init(exec_ctx);
   grpc_timer_list_init(exec_ctx);
   g_root_object.next = g_root_object.prev = &g_root_object;
-  g_root_object.name = (char *)"root";
+  g_root_object.name = (char*)"root";
   grpc_network_status_init();
   grpc_iomgr_platform_init();
 }
 
-void grpc_iomgr_start(grpc_exec_ctx *exec_ctx) { grpc_timer_manager_init(); }
+void grpc_iomgr_start(grpc_exec_ctx* exec_ctx) { grpc_timer_manager_init(); }
 
 static size_t count_objects(void) {
-  grpc_iomgr_object *obj;
+  grpc_iomgr_object* obj;
   size_t n = 0;
   for (obj = g_root_object.next; obj != &g_root_object; obj = obj->next) {
     n++;
@@ -69,14 +69,14 @@
   return n;
 }
 
-static void dump_objects(const char *kind) {
-  grpc_iomgr_object *obj;
+static void dump_objects(const char* kind) {
+  grpc_iomgr_object* obj;
   for (obj = g_root_object.next; obj != &g_root_object; obj = obj->next) {
     gpr_log(GPR_DEBUG, "%s OBJECT: %s %p", kind, obj->name, obj);
   }
 }
 
-void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx) {
+void grpc_iomgr_shutdown(grpc_exec_ctx* exec_ctx) {
   gpr_timespec shutdown_deadline = gpr_time_add(
       gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(10, GPR_TIMESPAN));
   gpr_timespec last_warning_time = gpr_now(GPR_CLOCK_REALTIME);
@@ -109,9 +109,10 @@
     }
     if (g_root_object.next != &g_root_object) {
       if (grpc_iomgr_abort_on_leaks()) {
-        gpr_log(GPR_DEBUG, "Failed to free %" PRIuPTR
-                           " iomgr objects before shutdown deadline: "
-                           "memory leaks are likely",
+        gpr_log(GPR_DEBUG,
+                "Failed to free %" PRIuPTR
+                " iomgr objects before shutdown deadline: "
+                "memory leaks are likely",
                 count_objects());
         dump_objects("LEAKED");
         abort();
@@ -121,9 +122,10 @@
       if (gpr_cv_wait(&g_rcv, &g_mu, short_deadline)) {
         if (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), shutdown_deadline) > 0) {
           if (g_root_object.next != &g_root_object) {
-            gpr_log(GPR_DEBUG, "Failed to free %" PRIuPTR
-                               " iomgr objects before shutdown deadline: "
-                               "memory leaks are likely",
+            gpr_log(GPR_DEBUG,
+                    "Failed to free %" PRIuPTR
+                    " iomgr objects before shutdown deadline: "
+                    "memory leaks are likely",
                     count_objects());
             dump_objects("LEAKED");
           }
@@ -148,7 +150,7 @@
   gpr_cv_destroy(&g_rcv);
 }
 
-void grpc_iomgr_register_object(grpc_iomgr_object *obj, const char *name) {
+void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name) {
   obj->name = gpr_strdup(name);
   gpr_mu_lock(&g_mu);
   obj->next = &g_root_object;
@@ -157,7 +159,7 @@
   gpr_mu_unlock(&g_mu);
 }
 
-void grpc_iomgr_unregister_object(grpc_iomgr_object *obj) {
+void grpc_iomgr_unregister_object(grpc_iomgr_object* obj) {
   gpr_mu_lock(&g_mu);
   obj->next->prev = obj->prev;
   obj->prev->next = obj->next;
@@ -167,7 +169,7 @@
 }
 
 bool grpc_iomgr_abort_on_leaks(void) {
-  char *env = gpr_getenv("GRPC_ABORT_ON_LEAKS");
+  char* env = gpr_getenv("GRPC_ABORT_ON_LEAKS");
   bool should_we = gpr_is_true(env);
   gpr_free(env);
   return should_we;
diff --git a/src/core/lib/iomgr/iomgr.h b/src/core/lib/iomgr/iomgr.h
index 6c0a08b..d1549c8 100644
--- a/src/core/lib/iomgr/iomgr.h
+++ b/src/core/lib/iomgr/iomgr.h
@@ -27,14 +27,14 @@
 #endif
 
 /** Initializes the iomgr. */
-void grpc_iomgr_init(grpc_exec_ctx *exec_ctx);
+void grpc_iomgr_init(grpc_exec_ctx* exec_ctx);
 
 /** Starts any background threads for iomgr. */
-void grpc_iomgr_start(grpc_exec_ctx *exec_ctx);
+void grpc_iomgr_start(grpc_exec_ctx* exec_ctx);
 
 /** Signals the intention to shutdown the iomgr. Expects to be able to flush
  * exec_ctx. */
-void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx);
+void grpc_iomgr_shutdown(grpc_exec_ctx* exec_ctx);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/iomgr_internal.h b/src/core/lib/iomgr/iomgr_internal.h
index 52db37c..b818c68 100644
--- a/src/core/lib/iomgr/iomgr_internal.h
+++ b/src/core/lib/iomgr/iomgr_internal.h
@@ -28,13 +28,13 @@
 #endif
 
 typedef struct grpc_iomgr_object {
-  char *name;
-  struct grpc_iomgr_object *next;
-  struct grpc_iomgr_object *prev;
+  char* name;
+  struct grpc_iomgr_object* next;
+  struct grpc_iomgr_object* prev;
 } grpc_iomgr_object;
 
-void grpc_iomgr_register_object(grpc_iomgr_object *obj, const char *name);
-void grpc_iomgr_unregister_object(grpc_iomgr_object *obj);
+void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name);
+void grpc_iomgr_unregister_object(grpc_iomgr_object* obj);
 
 void grpc_iomgr_platform_init(void);
 /** flush any globally queued work from iomgr */
diff --git a/src/core/lib/iomgr/load_file.cc b/src/core/lib/iomgr/load_file.cc
index 5cb4099..97e448f 100644
--- a/src/core/lib/iomgr/load_file.cc
+++ b/src/core/lib/iomgr/load_file.cc
@@ -28,14 +28,14 @@
 #include "src/core/lib/iomgr/block_annotate.h"
 #include "src/core/lib/support/string.h"
 
-grpc_error *grpc_load_file(const char *filename, int add_null_terminator,
-                           grpc_slice *output) {
-  unsigned char *contents = NULL;
+grpc_error* grpc_load_file(const char* filename, int add_null_terminator,
+                           grpc_slice* output) {
+  unsigned char* contents = NULL;
   size_t contents_size = 0;
   grpc_slice result = grpc_empty_slice();
-  FILE *file;
+  FILE* file;
   size_t bytes_read = 0;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   GRPC_SCHEDULING_START_BLOCKING_REGION;
   file = fopen(filename, "rb");
@@ -47,8 +47,8 @@
   /* Converting to size_t on the assumption that it will not fail */
   contents_size = (size_t)ftell(file);
   fseek(file, 0, SEEK_SET);
-  contents = (unsigned char *)gpr_malloc(contents_size +
-                                         (add_null_terminator ? 1 : 0));
+  contents =
+      (unsigned char*)gpr_malloc(contents_size + (add_null_terminator ? 1 : 0));
   bytes_read = fread(contents, 1, contents_size, file);
   if (bytes_read < contents_size) {
     error = GRPC_OS_ERROR(errno, "fread");
@@ -64,7 +64,7 @@
   *output = result;
   if (file != NULL) fclose(file);
   if (error != GRPC_ERROR_NONE) {
-    grpc_error *error_out =
+    grpc_error* error_out =
         grpc_error_set_str(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
                                "Failed to load file", &error, 1),
                            GRPC_ERROR_STR_FILENAME,
diff --git a/src/core/lib/iomgr/load_file.h b/src/core/lib/iomgr/load_file.h
index db1ffb3..5b367c1 100644
--- a/src/core/lib/iomgr/load_file.h
+++ b/src/core/lib/iomgr/load_file.h
@@ -31,8 +31,8 @@
 
 /* Loads the content of a file into a slice. add_null_terminator will add
    a NULL terminator if non-zero. */
-grpc_error *grpc_load_file(const char *filename, int add_null_terminator,
-                           grpc_slice *slice);
+grpc_error* grpc_load_file(const char* filename, int add_null_terminator,
+                           grpc_slice* slice);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/lockfree_event.cc b/src/core/lib/iomgr/lockfree_event.cc
index a4aeacc..d477f64 100644
--- a/src/core/lib/iomgr/lockfree_event.cc
+++ b/src/core/lib/iomgr/lockfree_event.cc
@@ -26,92 +26,96 @@
 
 /* 'state' holds the to call when the fd is readable or writable respectively.
    It can contain one of the following values:
-     CLOSURE_READY     : The fd has an I/O event of interest but there is no
+     kClosureReady     : The fd has an I/O event of interest but there is no
                          closure yet to execute
 
-     CLOSURE_NOT_READY : The fd has no I/O event of interest
+     kClosureNotReady : The fd has no I/O event of interest
 
      closure ptr       : The closure to be executed when the fd has an I/O
                          event of interest
 
-     shutdown_error | FD_SHUTDOWN_BIT :
-                        'shutdown_error' field ORed with FD_SHUTDOWN_BIT.
+     shutdown_error | kShutdownBit :
+                        'shutdown_error' field ORed with kShutdownBit.
                          This indicates that the fd is shutdown. Since all
                          memory allocations are word-aligned, the lower two
                          bits of the shutdown_error pointer are always 0. So
-                         it is safe to OR these with FD_SHUTDOWN_BIT
+                         it is safe to OR these with kShutdownBit
 
    Valid state transitions:
 
-     <closure ptr> <-----3------ CLOSURE_NOT_READY ----1---->  CLOSURE_READY
+     <closure ptr> <-----3------ kClosureNotReady -----1------->  kClosureReady
        |  |                         ^   |    ^                         |  |
        |  |                         |   |    |                         |  |
        |  +--------------4----------+   6    +---------2---------------+  |
        |                                |                                 |
        |                                v                                 |
-       +-----5------->  [shutdown_error | FD_SHUTDOWN_BIT] <----7---------+
+       +-----5------->  [shutdown_error | kShutdownBit] <-------7---------+
 
-    For 1, 4 : See grpc_lfev_set_ready() function
-    For 2, 3 : See grpc_lfev_notify_on() function
-    For 5,6,7: See grpc_lfev_set_shutdown() function */
+    For 1, 4 : See SetReady() function
+    For 2, 3 : See NotifyOn() function
+    For 5,6,7: See SetShutdown() function */
 
-#define CLOSURE_NOT_READY ((gpr_atm)0)
-#define CLOSURE_READY ((gpr_atm)2)
+namespace grpc_core {
 
-#define FD_SHUTDOWN_BIT ((gpr_atm)1)
+LockfreeEvent::LockfreeEvent() {
+  /* Perform an atomic store to start the state machine.
 
-void grpc_lfev_init(gpr_atm *state) {
-  gpr_atm_no_barrier_store(state, CLOSURE_NOT_READY);
+     Note carefully that LockfreeEvent *MAY* be used whilst in a destroyed
+     state, while a file descriptor is on a freelist. In such a state it may
+     be SetReady'd, and so we need to perform an atomic operation here to
+     ensure no races */
+  gpr_atm_no_barrier_store(&state_, kClosureNotReady);
 }
 
-void grpc_lfev_destroy(gpr_atm *state) {
-  gpr_atm curr = gpr_atm_no_barrier_load(state);
-  if (curr & FD_SHUTDOWN_BIT) {
-    GRPC_ERROR_UNREF((grpc_error *)(curr & ~FD_SHUTDOWN_BIT));
-  } else {
-    GPR_ASSERT(curr == CLOSURE_NOT_READY || curr == CLOSURE_READY);
-  }
+LockfreeEvent::~LockfreeEvent() {
+  gpr_atm curr;
+  do {
+    curr = gpr_atm_no_barrier_load(&state_);
+    if (curr & kShutdownBit) {
+      GRPC_ERROR_UNREF((grpc_error*)(curr & ~kShutdownBit));
+    } else {
+      GPR_ASSERT(curr == kClosureNotReady || curr == kClosureReady);
+    }
+    /* we CAS in a shutdown, no error value here. If this event is interacted
+       with post-deletion (see the note in the constructor) we want the bit
+       pattern to prevent error retention in a deleted object */
+  } while (!gpr_atm_no_barrier_cas(&state_, curr,
+                                   kShutdownBit /* shutdown, no error */));
 }
 
-bool grpc_lfev_is_shutdown(gpr_atm *state) {
-  gpr_atm curr = gpr_atm_no_barrier_load(state);
-  return (curr & FD_SHUTDOWN_BIT) != 0;
-}
-
-void grpc_lfev_notify_on(grpc_exec_ctx *exec_ctx, gpr_atm *state,
-                         grpc_closure *closure, const char *variable) {
+void LockfreeEvent::NotifyOn(grpc_exec_ctx* exec_ctx, grpc_closure* closure) {
   while (true) {
-    gpr_atm curr = gpr_atm_no_barrier_load(state);
+    gpr_atm curr = gpr_atm_no_barrier_load(&state_);
     if (grpc_polling_trace.enabled()) {
-      gpr_log(GPR_ERROR, "lfev_notify_on[%s]: %p curr=%p closure=%p", variable,
-              state, (void *)curr, closure);
+      gpr_log(GPR_ERROR, "LockfreeEvent::NotifyOn: %p curr=%p closure=%p", this,
+              (void*)curr, closure);
     }
     switch (curr) {
-      case CLOSURE_NOT_READY: {
-        /* CLOSURE_NOT_READY -> <closure>.
+      case kClosureNotReady: {
+        /* kClosureNotReady -> <closure>.
 
            We're guaranteed by API that there's an acquire barrier before here,
            so there's no need to double-dip and this can be a release-only.
 
            The release itself pairs with the acquire half of a set_ready full
            barrier. */
-        if (gpr_atm_rel_cas(state, CLOSURE_NOT_READY, (gpr_atm)closure)) {
+        if (gpr_atm_rel_cas(&state_, kClosureNotReady, (gpr_atm)closure)) {
           return; /* Successful. Return */
         }
 
         break; /* retry */
       }
 
-      case CLOSURE_READY: {
-        /* Change the state to CLOSURE_NOT_READY. Schedule the closure if
+      case kClosureReady: {
+        /* Change the state to kClosureNotReady. Schedule the closure if
            successful. If not, the state most likely transitioned to shutdown.
            We should retry.
 
            This can be a no-barrier cas since the state is being transitioned to
-           CLOSURE_NOT_READY; set_ready and set_shutdown do not schedule any
+           kClosureNotReady; set_ready and set_shutdown do not schedule any
            closure when transitioning out of CLOSURE_NO_READY state (i.e there
            is no other code that needs to 'happen-after' this) */
-        if (gpr_atm_no_barrier_cas(state, CLOSURE_READY, CLOSURE_NOT_READY)) {
+        if (gpr_atm_no_barrier_cas(&state_, kClosureReady, kClosureNotReady)) {
           GRPC_CLOSURE_SCHED(exec_ctx, closure, GRPC_ERROR_NONE);
           return; /* Successful. Return */
         }
@@ -123,8 +127,8 @@
         /* 'curr' is either a closure or the fd is shutdown(in which case 'curr'
            contains a pointer to the shutdown-error). If the fd is shutdown,
            schedule the closure with the shutdown error */
-        if ((curr & FD_SHUTDOWN_BIT) > 0) {
-          grpc_error *shutdown_err = (grpc_error *)(curr & ~FD_SHUTDOWN_BIT);
+        if ((curr & kShutdownBit) > 0) {
+          grpc_error* shutdown_err = (grpc_error*)(curr & ~kShutdownBit);
           GRPC_CLOSURE_SCHED(exec_ctx, closure,
                              GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
                                  "FD Shutdown", &shutdown_err, 1));
@@ -133,7 +137,8 @@
 
         /* There is already a closure!. This indicates a bug in the code */
         gpr_log(GPR_ERROR,
-                "notify_on called with a previous callback still pending");
+                "LockfreeEvent::NotifyOn: notify_on called with a previous "
+                "callback still pending");
         abort();
       }
     }
@@ -142,22 +147,22 @@
   GPR_UNREACHABLE_CODE(return );
 }
 
-bool grpc_lfev_set_shutdown(grpc_exec_ctx *exec_ctx, gpr_atm *state,
-                            grpc_error *shutdown_err) {
-  gpr_atm new_state = (gpr_atm)shutdown_err | FD_SHUTDOWN_BIT;
+bool LockfreeEvent::SetShutdown(grpc_exec_ctx* exec_ctx,
+                                grpc_error* shutdown_err) {
+  gpr_atm new_state = (gpr_atm)shutdown_err | kShutdownBit;
 
   while (true) {
-    gpr_atm curr = gpr_atm_no_barrier_load(state);
+    gpr_atm curr = gpr_atm_no_barrier_load(&state_);
     if (grpc_polling_trace.enabled()) {
-      gpr_log(GPR_ERROR, "lfev_set_shutdown: %p curr=%p err=%s", state,
-              (void *)curr, grpc_error_string(shutdown_err));
+      gpr_log(GPR_ERROR, "LockfreeEvent::SetShutdown: %p curr=%p err=%s",
+              &state_, (void*)curr, grpc_error_string(shutdown_err));
     }
     switch (curr) {
-      case CLOSURE_READY:
-      case CLOSURE_NOT_READY:
+      case kClosureReady:
+      case kClosureNotReady:
         /* Need a full barrier here so that the initial load in notify_on
            doesn't need a barrier */
-        if (gpr_atm_full_cas(state, curr, new_state)) {
+        if (gpr_atm_full_cas(&state_, curr, new_state)) {
           return true; /* early out */
         }
         break; /* retry */
@@ -166,7 +171,7 @@
         /* 'curr' is either a closure or the fd is already shutdown */
 
         /* If fd is already shutdown, we are done */
-        if ((curr & FD_SHUTDOWN_BIT) > 0) {
+        if ((curr & kShutdownBit) > 0) {
           GRPC_ERROR_UNREF(shutdown_err);
           return false;
         }
@@ -176,8 +181,8 @@
            Needs an acquire to pair with setting the closure (and get a
            happens-after on that edge), and a release to pair with anything
            loading the shutdown state. */
-        if (gpr_atm_full_cas(state, curr, new_state)) {
-          GRPC_CLOSURE_SCHED(exec_ctx, (grpc_closure *)curr,
+        if (gpr_atm_full_cas(&state_, curr, new_state)) {
+          GRPC_CLOSURE_SCHED(exec_ctx, (grpc_closure*)curr,
                              GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
                                  "FD Shutdown", &shutdown_err, 1));
           return true;
@@ -193,26 +198,25 @@
   GPR_UNREACHABLE_CODE(return false);
 }
 
-void grpc_lfev_set_ready(grpc_exec_ctx *exec_ctx, gpr_atm *state,
-                         const char *variable) {
+void LockfreeEvent::SetReady(grpc_exec_ctx* exec_ctx) {
   while (true) {
-    gpr_atm curr = gpr_atm_no_barrier_load(state);
+    gpr_atm curr = gpr_atm_no_barrier_load(&state_);
 
     if (grpc_polling_trace.enabled()) {
-      gpr_log(GPR_ERROR, "lfev_set_ready[%s]: %p curr=%p", variable, state,
-              (void *)curr);
+      gpr_log(GPR_ERROR, "LockfreeEvent::SetReady: %p curr=%p", &state_,
+              (void*)curr);
     }
 
     switch (curr) {
-      case CLOSURE_READY: {
+      case kClosureReady: {
         /* Already ready. We are done here */
         return;
       }
 
-      case CLOSURE_NOT_READY: {
+      case kClosureNotReady: {
         /* No barrier required as we're transitioning to a state that does not
            involve a closure */
-        if (gpr_atm_no_barrier_cas(state, CLOSURE_NOT_READY, CLOSURE_READY)) {
+        if (gpr_atm_no_barrier_cas(&state_, kClosureNotReady, kClosureReady)) {
           return; /* early out */
         }
         break; /* retry */
@@ -220,15 +224,15 @@
 
       default: {
         /* 'curr' is either a closure or the fd is shutdown */
-        if ((curr & FD_SHUTDOWN_BIT) > 0) {
+        if ((curr & kShutdownBit) > 0) {
           /* The fd is shutdown. Do nothing */
           return;
         }
         /* Full cas: acquire pairs with this cas' release in the event of a
            spurious set_ready; release pairs with this or the acquire in
            notify_on (or set_shutdown) */
-        else if (gpr_atm_full_cas(state, curr, CLOSURE_NOT_READY)) {
-          GRPC_CLOSURE_SCHED(exec_ctx, (grpc_closure *)curr, GRPC_ERROR_NONE);
+        else if (gpr_atm_full_cas(&state_, curr, kClosureNotReady)) {
+          GRPC_CLOSURE_SCHED(exec_ctx, (grpc_closure*)curr, GRPC_ERROR_NONE);
           return;
         }
         /* else the state changed again (only possible by either a racing
@@ -239,3 +243,5 @@
     }
   }
 }
+
+}  // namespace grpc_core
diff --git a/src/core/lib/iomgr/lockfree_event.h b/src/core/lib/iomgr/lockfree_event.h
index 02229e5..c667dcd 100644
--- a/src/core/lib/iomgr/lockfree_event.h
+++ b/src/core/lib/iomgr/lockfree_event.h
@@ -25,24 +25,30 @@
 
 #include "src/core/lib/iomgr/exec_ctx.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+namespace grpc_core {
 
-void grpc_lfev_init(gpr_atm *state);
-void grpc_lfev_destroy(gpr_atm *state);
-bool grpc_lfev_is_shutdown(gpr_atm *state);
+class LockfreeEvent {
+ public:
+  LockfreeEvent();
+  ~LockfreeEvent();
 
-void grpc_lfev_notify_on(grpc_exec_ctx *exec_ctx, gpr_atm *state,
-                         grpc_closure *closure, const char *variable);
-/* Returns true on first successful shutdown */
-bool grpc_lfev_set_shutdown(grpc_exec_ctx *exec_ctx, gpr_atm *state,
-                            grpc_error *shutdown_err);
-void grpc_lfev_set_ready(grpc_exec_ctx *exec_ctx, gpr_atm *state,
-                         const char *variable);
+  LockfreeEvent(const LockfreeEvent&) = delete;
+  LockfreeEvent& operator=(const LockfreeEvent&) = delete;
 
-#ifdef __cplusplus
-}
-#endif
+  bool IsShutdown() const {
+    return (gpr_atm_no_barrier_load(&state_) & kShutdownBit) != 0;
+  }
+
+  void NotifyOn(grpc_exec_ctx* exec_ctx, grpc_closure* closure);
+  bool SetShutdown(grpc_exec_ctx* exec_ctx, grpc_error* error);
+  void SetReady(grpc_exec_ctx* exec_ctx);
+
+ private:
+  enum State { kClosureNotReady = 0, kClosureReady = 2, kShutdownBit = 1 };
+
+  gpr_atm state_;
+};
+
+}  // namespace grpc_core
 
 #endif /* GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H */
diff --git a/src/core/lib/iomgr/network_status_tracker.cc b/src/core/lib/iomgr/network_status_tracker.cc
index 57a7faa..73f8fbf 100644
--- a/src/core/lib/iomgr/network_status_tracker.cc
+++ b/src/core/lib/iomgr/network_status_tracker.cc
@@ -27,8 +27,8 @@
 
 void grpc_destroy_network_status_monitor() {}
 
-void grpc_network_status_register_endpoint(grpc_endpoint *ep) { (void)ep; }
+void grpc_network_status_register_endpoint(grpc_endpoint* ep) { (void)ep; }
 
-void grpc_network_status_unregister_endpoint(grpc_endpoint *ep) { (void)ep; }
+void grpc_network_status_unregister_endpoint(grpc_endpoint* ep) { (void)ep; }
 
 void grpc_network_status_shutdown_all_endpoints() {}
diff --git a/src/core/lib/iomgr/network_status_tracker.h b/src/core/lib/iomgr/network_status_tracker.h
index cba38d4..32244d9 100644
--- a/src/core/lib/iomgr/network_status_tracker.h
+++ b/src/core/lib/iomgr/network_status_tracker.h
@@ -20,19 +20,11 @@
 #define GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H
 #include "src/core/lib/iomgr/endpoint.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 void grpc_network_status_init(void);
 void grpc_network_status_shutdown(void);
 
-void grpc_network_status_register_endpoint(grpc_endpoint *ep);
-void grpc_network_status_unregister_endpoint(grpc_endpoint *ep);
+void grpc_network_status_register_endpoint(grpc_endpoint* ep);
+void grpc_network_status_unregister_endpoint(grpc_endpoint* ep);
 void grpc_network_status_shutdown_all_endpoints();
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H */
diff --git a/src/core/lib/iomgr/polling_entity.cc b/src/core/lib/iomgr/polling_entity.cc
index 8591a55..f0ef2cf 100644
--- a/src/core/lib/iomgr/polling_entity.cc
+++ b/src/core/lib/iomgr/polling_entity.cc
@@ -22,7 +22,7 @@
 #include "src/core/lib/iomgr/polling_entity.h"
 
 grpc_polling_entity grpc_polling_entity_create_from_pollset_set(
-    grpc_pollset_set *pollset_set) {
+    grpc_pollset_set* pollset_set) {
   grpc_polling_entity pollent;
   pollent.pollent.pollset_set = pollset_set;
   pollent.tag = GRPC_POLLS_POLLSET_SET;
@@ -30,35 +30,35 @@
 }
 
 grpc_polling_entity grpc_polling_entity_create_from_pollset(
-    grpc_pollset *pollset) {
+    grpc_pollset* pollset) {
   grpc_polling_entity pollent;
   pollent.pollent.pollset = pollset;
   pollent.tag = GRPC_POLLS_POLLSET;
   return pollent;
 }
 
-grpc_pollset *grpc_polling_entity_pollset(grpc_polling_entity *pollent) {
+grpc_pollset* grpc_polling_entity_pollset(grpc_polling_entity* pollent) {
   if (pollent->tag == GRPC_POLLS_POLLSET) {
     return pollent->pollent.pollset;
   }
   return NULL;
 }
 
-grpc_pollset_set *grpc_polling_entity_pollset_set(
-    grpc_polling_entity *pollent) {
+grpc_pollset_set* grpc_polling_entity_pollset_set(
+    grpc_polling_entity* pollent) {
   if (pollent->tag == GRPC_POLLS_POLLSET_SET) {
     return pollent->pollent.pollset_set;
   }
   return NULL;
 }
 
-bool grpc_polling_entity_is_empty(const grpc_polling_entity *pollent) {
+bool grpc_polling_entity_is_empty(const grpc_polling_entity* pollent) {
   return pollent->tag == GRPC_POLLS_NONE;
 }
 
-void grpc_polling_entity_add_to_pollset_set(grpc_exec_ctx *exec_ctx,
-                                            grpc_polling_entity *pollent,
-                                            grpc_pollset_set *pss_dst) {
+void grpc_polling_entity_add_to_pollset_set(grpc_exec_ctx* exec_ctx,
+                                            grpc_polling_entity* pollent,
+                                            grpc_pollset_set* pss_dst) {
   if (pollent->tag == GRPC_POLLS_POLLSET) {
     GPR_ASSERT(pollent->pollent.pollset != NULL);
     grpc_pollset_set_add_pollset(exec_ctx, pss_dst, pollent->pollent.pollset);
@@ -72,9 +72,9 @@
   }
 }
 
-void grpc_polling_entity_del_from_pollset_set(grpc_exec_ctx *exec_ctx,
-                                              grpc_polling_entity *pollent,
-                                              grpc_pollset_set *pss_dst) {
+void grpc_polling_entity_del_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                              grpc_polling_entity* pollent,
+                                              grpc_pollset_set* pss_dst) {
   if (pollent->tag == GRPC_POLLS_POLLSET) {
     GPR_ASSERT(pollent->pollent.pollset != NULL);
     grpc_pollset_set_del_pollset(exec_ctx, pss_dst, pollent->pollent.pollset);
diff --git a/src/core/lib/iomgr/polling_entity.h b/src/core/lib/iomgr/polling_entity.h
index 009f968..867e085 100644
--- a/src/core/lib/iomgr/polling_entity.h
+++ b/src/core/lib/iomgr/polling_entity.h
@@ -38,36 +38,36 @@
 
 typedef struct grpc_polling_entity {
   union {
-    grpc_pollset *pollset;
-    grpc_pollset_set *pollset_set;
+    grpc_pollset* pollset;
+    grpc_pollset_set* pollset_set;
   } pollent;
   grpc_pollset_tag tag;
 } grpc_polling_entity;
 
 grpc_polling_entity grpc_polling_entity_create_from_pollset_set(
-    grpc_pollset_set *pollset_set);
+    grpc_pollset_set* pollset_set);
 grpc_polling_entity grpc_polling_entity_create_from_pollset(
-    grpc_pollset *pollset);
+    grpc_pollset* pollset);
 
 /** If \a pollent contains a pollset, return it. Otherwise, return NULL */
-grpc_pollset *grpc_polling_entity_pollset(grpc_polling_entity *pollent);
+grpc_pollset* grpc_polling_entity_pollset(grpc_polling_entity* pollent);
 
 /** If \a pollent contains a pollset_set, return it. Otherwise, return NULL */
-grpc_pollset_set *grpc_polling_entity_pollset_set(grpc_polling_entity *pollent);
+grpc_pollset_set* grpc_polling_entity_pollset_set(grpc_polling_entity* pollent);
 
-bool grpc_polling_entity_is_empty(const grpc_polling_entity *pollent);
+bool grpc_polling_entity_is_empty(const grpc_polling_entity* pollent);
 
 /** Add the pollset or pollset_set in \a pollent to the destination pollset_set
  * \a * pss_dst */
-void grpc_polling_entity_add_to_pollset_set(grpc_exec_ctx *exec_ctx,
-                                            grpc_polling_entity *pollent,
-                                            grpc_pollset_set *pss_dst);
+void grpc_polling_entity_add_to_pollset_set(grpc_exec_ctx* exec_ctx,
+                                            grpc_polling_entity* pollent,
+                                            grpc_pollset_set* pss_dst);
 
 /** Delete the pollset or pollset_set in \a pollent from the destination
  * pollset_set \a * pss_dst */
-void grpc_polling_entity_del_from_pollset_set(grpc_exec_ctx *exec_ctx,
-                                              grpc_polling_entity *pollent,
-                                              grpc_pollset_set *pss_dst);
+void grpc_polling_entity_del_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                              grpc_polling_entity* pollent,
+                                              grpc_pollset_set* pss_dst);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/core/lib/iomgr/pollset.h b/src/core/lib/iomgr/pollset.h
index d48f7f8..c48ff98 100644
--- a/src/core/lib/iomgr/pollset.h
+++ b/src/core/lib/iomgr/pollset.h
@@ -45,12 +45,12 @@
 
 size_t grpc_pollset_size(void);
 /* Initialize a pollset: assumes *pollset contains all zeros */
-void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu);
+void grpc_pollset_init(grpc_pollset* pollset, gpr_mu** mu);
 /* Begin shutting down the pollset, and call closure when done.
  * pollset's mutex must be held */
-void grpc_pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           grpc_closure *closure);
-void grpc_pollset_destroy(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset);
+void grpc_pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           grpc_closure* closure);
+void grpc_pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset);
 
 /* Do some work on a pollset.
    May involve invoking asynchronous callbacks, or actually polling file
@@ -74,14 +74,14 @@
    May call grpc_closure_list_run on grpc_closure_list, without holding the
    pollset
    lock */
-grpc_error *grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                              grpc_pollset_worker **worker,
+grpc_error* grpc_pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                              grpc_pollset_worker** worker,
                               grpc_millis deadline) GRPC_MUST_USE_RESULT;
 
 /* Break one polling thread out of polling work for this pollset.
    If specific_worker is non-NULL, then kick that worker. */
-grpc_error *grpc_pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                              grpc_pollset_worker *specific_worker)
+grpc_error* grpc_pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                              grpc_pollset_worker* specific_worker)
     GRPC_MUST_USE_RESULT;
 
 #ifdef __cplusplus
diff --git a/src/core/lib/iomgr/pollset_set.h b/src/core/lib/iomgr/pollset_set.h
index 5455eda..0167a50 100644
--- a/src/core/lib/iomgr/pollset_set.h
+++ b/src/core/lib/iomgr/pollset_set.h
@@ -32,21 +32,21 @@
 
 typedef struct grpc_pollset_set grpc_pollset_set;
 
-grpc_pollset_set *grpc_pollset_set_create(void);
-void grpc_pollset_set_destroy(grpc_exec_ctx *exec_ctx,
-                              grpc_pollset_set *pollset_set);
-void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
-                                  grpc_pollset_set *pollset_set,
-                                  grpc_pollset *pollset);
-void grpc_pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
-                                  grpc_pollset_set *pollset_set,
-                                  grpc_pollset *pollset);
-void grpc_pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
-                                      grpc_pollset_set *bag,
-                                      grpc_pollset_set *item);
-void grpc_pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx,
-                                      grpc_pollset_set *bag,
-                                      grpc_pollset_set *item);
+grpc_pollset_set* grpc_pollset_set_create(void);
+void grpc_pollset_set_destroy(grpc_exec_ctx* exec_ctx,
+                              grpc_pollset_set* pollset_set);
+void grpc_pollset_set_add_pollset(grpc_exec_ctx* exec_ctx,
+                                  grpc_pollset_set* pollset_set,
+                                  grpc_pollset* pollset);
+void grpc_pollset_set_del_pollset(grpc_exec_ctx* exec_ctx,
+                                  grpc_pollset_set* pollset_set,
+                                  grpc_pollset* pollset);
+void grpc_pollset_set_add_pollset_set(grpc_exec_ctx* exec_ctx,
+                                      grpc_pollset_set* bag,
+                                      grpc_pollset_set* item);
+void grpc_pollset_set_del_pollset_set(grpc_exec_ctx* exec_ctx,
+                                      grpc_pollset_set* bag,
+                                      grpc_pollset_set* item);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/pollset_uv.cc b/src/core/lib/iomgr/pollset_uv.cc
index 64e47e6..16132f3 100644
--- a/src/core/lib/iomgr/pollset_uv.cc
+++ b/src/core/lib/iomgr/pollset_uv.cc
@@ -37,7 +37,7 @@
 grpc_core::DebugOnlyTraceFlag grpc_trace_fd_refcount(false, "fd_refcount");
 
 struct grpc_pollset {
-  uv_timer_t timer;
+  uv_timer_t* timer;
   int shutting_down;
 };
 
@@ -52,17 +52,17 @@
    immediately in the next loop iteration.
    Note: In the future, if there is a bug that involves missing wakeups in the
    future, try adding a uv_async_t to kick the loop differently */
-uv_timer_t *dummy_uv_handle;
+uv_timer_t* dummy_uv_handle;
 
 size_t grpc_pollset_size() { return sizeof(grpc_pollset); }
 
-void dummy_timer_cb(uv_timer_t *handle) {}
+void dummy_timer_cb(uv_timer_t* handle) {}
 
-void dummy_handle_close_cb(uv_handle_t *handle) { gpr_free(handle); }
+void dummy_handle_close_cb(uv_handle_t* handle) { gpr_free(handle); }
 
 void grpc_pollset_global_init(void) {
   gpr_mu_init(&grpc_polling_mu);
-  dummy_uv_handle = (uv_timer_t *)gpr_malloc(sizeof(uv_timer_t));
+  dummy_uv_handle = (uv_timer_t*)gpr_malloc(sizeof(uv_timer_t));
   uv_timer_init(uv_default_loop(), dummy_uv_handle);
   grpc_pollset_work_run_loop = 1;
 }
@@ -70,22 +70,26 @@
 void grpc_pollset_global_shutdown(void) {
   GRPC_UV_ASSERT_SAME_THREAD();
   gpr_mu_destroy(&grpc_polling_mu);
-  uv_close((uv_handle_t *)dummy_uv_handle, dummy_handle_close_cb);
+  uv_close((uv_handle_t*)dummy_uv_handle, dummy_handle_close_cb);
 }
 
-static void timer_run_cb(uv_timer_t *timer) {}
+static void timer_run_cb(uv_timer_t* timer) {}
 
-static void timer_close_cb(uv_handle_t *handle) { handle->data = (void *)1; }
+static void timer_close_cb(uv_handle_t* handle) {
+  handle->data = (void*)1;
+  gpr_free(handle);
+}
 
-void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
+void grpc_pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
   GRPC_UV_ASSERT_SAME_THREAD();
   *mu = &grpc_polling_mu;
-  uv_timer_init(uv_default_loop(), &pollset->timer);
+  pollset->timer = (uv_timer_t*)gpr_malloc(sizeof(uv_timer_t));
+  uv_timer_init(uv_default_loop(), pollset->timer);
   pollset->shutting_down = 0;
 }
 
-void grpc_pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           grpc_closure *closure) {
+void grpc_pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           grpc_closure* closure) {
   GPR_ASSERT(!pollset->shutting_down);
   GRPC_UV_ASSERT_SAME_THREAD();
   pollset->shutting_down = 1;
@@ -99,20 +103,20 @@
   GRPC_CLOSURE_SCHED(exec_ctx, closure, GRPC_ERROR_NONE);
 }
 
-void grpc_pollset_destroy(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
+void grpc_pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {
   GRPC_UV_ASSERT_SAME_THREAD();
-  uv_close((uv_handle_t *)&pollset->timer, timer_close_cb);
+  uv_close((uv_handle_t*)pollset->timer, timer_close_cb);
   // timer.data is a boolean indicating that the timer has finished closing
-  pollset->timer.data = (void *)0;
+  pollset->timer->data = (void*)0;
   if (grpc_pollset_work_run_loop) {
-    while (!pollset->timer.data) {
+    while (!pollset->timer->data) {
       uv_run(uv_default_loop(), UV_RUN_NOWAIT);
     }
   }
 }
 
-grpc_error *grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                              grpc_pollset_worker **worker_hdl,
+grpc_error* grpc_pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                              grpc_pollset_worker** worker_hdl,
                               grpc_millis deadline) {
   uint64_t timeout;
   GRPC_UV_ASSERT_SAME_THREAD();
@@ -127,11 +131,11 @@
     /* We special-case timeout=0 so that we don't bother with the timer when
        the loop won't block anyway */
     if (timeout > 0) {
-      uv_timer_start(&pollset->timer, timer_run_cb, timeout, 0);
+      uv_timer_start(pollset->timer, timer_run_cb, timeout, 0);
       /* Run until there is some I/O activity or the timer triggers. It doesn't
          matter which happens */
       uv_run(uv_default_loop(), UV_RUN_ONCE);
-      uv_timer_stop(&pollset->timer);
+      uv_timer_stop(pollset->timer);
     } else {
       uv_run(uv_default_loop(), UV_RUN_NOWAIT);
     }
@@ -143,8 +147,8 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                              grpc_pollset_worker *specific_worker) {
+grpc_error* grpc_pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                              grpc_pollset_worker* specific_worker) {
   GRPC_UV_ASSERT_SAME_THREAD();
   uv_timer_start(dummy_uv_handle, dummy_timer_cb, 0, 0);
   return GRPC_ERROR_NONE;
diff --git a/src/core/lib/iomgr/pollset_windows.cc b/src/core/lib/iomgr/pollset_windows.cc
index 07bd586..95dd7d7 100644
--- a/src/core/lib/iomgr/pollset_windows.cc
+++ b/src/core/lib/iomgr/pollset_windows.cc
@@ -28,12 +28,12 @@
 #include "src/core/lib/iomgr/pollset.h"
 #include "src/core/lib/iomgr/pollset_windows.h"
 
-#define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker *)1)
+#define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker*)1)
 
 grpc_core::DebugOnlyTraceFlag grpc_trace_fd_refcount(false, "fd_refcount");
 
 gpr_mu grpc_polling_mu;
-static grpc_pollset_worker *g_active_poller;
+static grpc_pollset_worker* g_active_poller;
 static grpc_pollset_worker g_global_root_worker;
 
 void grpc_pollset_global_init(void) {
@@ -46,22 +46,22 @@
 
 void grpc_pollset_global_shutdown(void) { gpr_mu_destroy(&grpc_polling_mu); }
 
-static void remove_worker(grpc_pollset_worker *worker,
+static void remove_worker(grpc_pollset_worker* worker,
                           grpc_pollset_worker_link_type type) {
   worker->links[type].prev->links[type].next = worker->links[type].next;
   worker->links[type].next->links[type].prev = worker->links[type].prev;
   worker->links[type].next = worker->links[type].prev = worker;
 }
 
-static int has_workers(grpc_pollset_worker *root,
+static int has_workers(grpc_pollset_worker* root,
                        grpc_pollset_worker_link_type type) {
   return root->links[type].next != root;
 }
 
-static grpc_pollset_worker *pop_front_worker(
-    grpc_pollset_worker *root, grpc_pollset_worker_link_type type) {
+static grpc_pollset_worker* pop_front_worker(
+    grpc_pollset_worker* root, grpc_pollset_worker_link_type type) {
   if (has_workers(root, type)) {
-    grpc_pollset_worker *w = root->links[type].next;
+    grpc_pollset_worker* w = root->links[type].next;
     remove_worker(w, type);
     return w;
   } else {
@@ -69,9 +69,9 @@
   }
 }
 
-static void push_front_worker(grpc_pollset_worker *root,
+static void push_front_worker(grpc_pollset_worker* root,
                               grpc_pollset_worker_link_type type,
-                              grpc_pollset_worker *worker) {
+                              grpc_pollset_worker* worker) {
   worker->links[type].prev = root;
   worker->links[type].next = worker->links[type].prev->links[type].next;
   worker->links[type].prev->links[type].next =
@@ -85,15 +85,15 @@
    set of features for the sake of the rest of grpc. But grpc_pollset_work
    won't actually do any polling, and return as quickly as possible. */
 
-void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
+void grpc_pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
   *mu = &grpc_polling_mu;
   pollset->root_worker.links[GRPC_POLLSET_WORKER_LINK_POLLSET].next =
       pollset->root_worker.links[GRPC_POLLSET_WORKER_LINK_POLLSET].prev =
           &pollset->root_worker;
 }
 
-void grpc_pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                           grpc_closure *closure) {
+void grpc_pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                           grpc_closure* closure) {
   pollset->shutting_down = 1;
   grpc_pollset_kick(exec_ctx, pollset, GRPC_POLLSET_KICK_BROADCAST);
   if (!pollset->is_iocp_worker) {
@@ -103,10 +103,10 @@
   }
 }
 
-void grpc_pollset_destroy(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {}
+void grpc_pollset_destroy(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset) {}
 
-grpc_error *grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                              grpc_pollset_worker **worker_hdl,
+grpc_error* grpc_pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                              grpc_pollset_worker** worker_hdl,
                               grpc_millis deadline) {
   grpc_pollset_worker worker;
   if (worker_hdl) *worker_hdl = &worker;
@@ -121,7 +121,7 @@
   gpr_cv_init(&worker.cv);
   if (!pollset->kicked_without_pollers && !pollset->shutting_down) {
     if (g_active_poller == NULL) {
-      grpc_pollset_worker *next_worker;
+      grpc_pollset_worker* next_worker;
       /* become poller */
       pollset->is_iocp_worker = 1;
       g_active_poller = &worker;
@@ -158,8 +158,10 @@
     while (!worker.kicked) {
       if (gpr_cv_wait(&worker.cv, &grpc_polling_mu,
                       grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME))) {
+        grpc_exec_ctx_invalidate_now(exec_ctx);
         break;
       }
+      grpc_exec_ctx_invalidate_now(exec_ctx);
     }
   } else {
     pollset->kicked_without_pollers = 0;
@@ -179,8 +181,8 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *p,
-                              grpc_pollset_worker *specific_worker) {
+grpc_error* grpc_pollset_kick(grpc_exec_ctx* exec_ctx, grpc_pollset* p,
+                              grpc_pollset_worker* specific_worker) {
   if (specific_worker != NULL) {
     if (specific_worker == GRPC_POLLSET_KICK_BROADCAST) {
       for (specific_worker =
diff --git a/src/core/lib/iomgr/pollset_windows.h b/src/core/lib/iomgr/pollset_windows.h
index 2479b25..aaeb5f5 100644
--- a/src/core/lib/iomgr/pollset_windows.h
+++ b/src/core/lib/iomgr/pollset_windows.h
@@ -39,8 +39,8 @@
 } grpc_pollset_worker_link_type;
 
 typedef struct grpc_pollset_worker_link {
-  struct grpc_pollset_worker *next;
-  struct grpc_pollset_worker *prev;
+  struct grpc_pollset_worker* next;
+  struct grpc_pollset_worker* prev;
 } grpc_pollset_worker_link;
 
 struct grpc_pollset;
@@ -49,7 +49,7 @@
 typedef struct grpc_pollset_worker {
   gpr_cv cv;
   int kicked;
-  struct grpc_pollset *pollset;
+  struct grpc_pollset* pollset;
   grpc_pollset_worker_link links[GRPC_POLLSET_WORKER_LINK_TYPES];
 } grpc_pollset_worker;
 
@@ -58,7 +58,7 @@
   int kicked_without_pollers;
   int is_iocp_worker;
   grpc_pollset_worker root_worker;
-  grpc_closure *on_shutdown;
+  grpc_closure* on_shutdown;
 };
 
 void grpc_pollset_global_init(void);
diff --git a/src/core/lib/iomgr/resolve_address.h b/src/core/lib/iomgr/resolve_address.h
index 5f06342..847e10f 100644
--- a/src/core/lib/iomgr/resolve_address.h
+++ b/src/core/lib/iomgr/resolve_address.h
@@ -36,25 +36,25 @@
 
 typedef struct {
   size_t naddrs;
-  grpc_resolved_address *addrs;
+  grpc_resolved_address* addrs;
 } grpc_resolved_addresses;
 
 /* Asynchronously resolve addr. Use default_port if a port isn't designated
    in addr, otherwise use the port in addr. */
 /* TODO(ctiller): add a timeout here */
-extern void (*grpc_resolve_address)(grpc_exec_ctx *exec_ctx, const char *addr,
-                                    const char *default_port,
-                                    grpc_pollset_set *interested_parties,
-                                    grpc_closure *on_done,
-                                    grpc_resolved_addresses **addresses);
+extern void (*grpc_resolve_address)(grpc_exec_ctx* exec_ctx, const char* addr,
+                                    const char* default_port,
+                                    grpc_pollset_set* interested_parties,
+                                    grpc_closure* on_done,
+                                    grpc_resolved_addresses** addresses);
 /* Destroy resolved addresses */
-void grpc_resolved_addresses_destroy(grpc_resolved_addresses *addresses);
+void grpc_resolved_addresses_destroy(grpc_resolved_addresses* addresses);
 
 /* Resolve addr in a blocking fashion. Returns NULL on failure. On success,
    result must be freed with grpc_resolved_addresses_destroy. */
-extern grpc_error *(*grpc_blocking_resolve_address)(
-    const char *name, const char *default_port,
-    grpc_resolved_addresses **addresses);
+extern grpc_error* (*grpc_blocking_resolve_address)(
+    const char* name, const char* default_port,
+    grpc_resolved_addresses** addresses);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/resolve_address_posix.cc b/src/core/lib/iomgr/resolve_address_posix.cc
index 1b78349..e27c730 100644
--- a/src/core/lib/iomgr/resolve_address_posix.cc
+++ b/src/core/lib/iomgr/resolve_address_posix.cc
@@ -39,16 +39,16 @@
 #include "src/core/lib/iomgr/unix_sockets_posix.h"
 #include "src/core/lib/support/string.h"
 
-static grpc_error *blocking_resolve_address_impl(
-    const char *name, const char *default_port,
-    grpc_resolved_addresses **addresses) {
+static grpc_error* blocking_resolve_address_impl(
+    const char* name, const char* default_port,
+    grpc_resolved_addresses** addresses) {
   struct addrinfo hints;
   struct addrinfo *result = NULL, *resp;
-  char *host;
-  char *port;
+  char* host;
+  char* port;
   int s;
   size_t i;
-  grpc_error *err;
+  grpc_error* err;
 
   if (name[0] == 'u' && name[1] == 'n' && name[2] == 'i' && name[3] == 'x' &&
       name[4] == ':' && name[5] != 0) {
@@ -85,7 +85,7 @@
 
   if (s != 0) {
     /* Retry if well-known service name is recognized */
-    const char *svc[][2] = {{"http", "80"}, {"https", "443"}};
+    const char* svc[][2] = {{"http", "80"}, {"https", "443"}};
     for (i = 0; i < GPR_ARRAY_SIZE(svc); i++) {
       if (strcmp(port, svc[i][0]) == 0) {
         GRPC_SCHEDULING_START_BLOCKING_REGION;
@@ -113,12 +113,12 @@
 
   /* Success path: set addrs non-NULL, fill it in */
   *addresses =
-      (grpc_resolved_addresses *)gpr_malloc(sizeof(grpc_resolved_addresses));
+      (grpc_resolved_addresses*)gpr_malloc(sizeof(grpc_resolved_addresses));
   (*addresses)->naddrs = 0;
   for (resp = result; resp != NULL; resp = resp->ai_next) {
     (*addresses)->naddrs++;
   }
-  (*addresses)->addrs = (grpc_resolved_address *)gpr_malloc(
+  (*addresses)->addrs = (grpc_resolved_address*)gpr_malloc(
       sizeof(grpc_resolved_address) * (*addresses)->naddrs);
   i = 0;
   for (resp = result; resp != NULL; resp = resp->ai_next) {
@@ -137,24 +137,24 @@
   return err;
 }
 
-grpc_error *(*grpc_blocking_resolve_address)(
-    const char *name, const char *default_port,
-    grpc_resolved_addresses **addresses) = blocking_resolve_address_impl;
+grpc_error* (*grpc_blocking_resolve_address)(
+    const char* name, const char* default_port,
+    grpc_resolved_addresses** addresses) = blocking_resolve_address_impl;
 
 typedef struct {
-  char *name;
-  char *default_port;
-  grpc_closure *on_done;
-  grpc_resolved_addresses **addrs_out;
+  char* name;
+  char* default_port;
+  grpc_closure* on_done;
+  grpc_resolved_addresses** addrs_out;
   grpc_closure request_closure;
-  void *arg;
+  void* arg;
 } request;
 
 /* Callback to be passed to grpc_executor to asynch-ify
  * grpc_blocking_resolve_address */
-static void do_request_thread(grpc_exec_ctx *exec_ctx, void *rp,
-                              grpc_error *error) {
-  request *r = (request *)rp;
+static void do_request_thread(grpc_exec_ctx* exec_ctx, void* rp,
+                              grpc_error* error) {
+  request* r = (request*)rp;
   GRPC_CLOSURE_SCHED(
       exec_ctx, r->on_done,
       grpc_blocking_resolve_address(r->name, r->default_port, r->addrs_out));
@@ -163,19 +163,19 @@
   gpr_free(r);
 }
 
-void grpc_resolved_addresses_destroy(grpc_resolved_addresses *addrs) {
+void grpc_resolved_addresses_destroy(grpc_resolved_addresses* addrs) {
   if (addrs != NULL) {
     gpr_free(addrs->addrs);
   }
   gpr_free(addrs);
 }
 
-static void resolve_address_impl(grpc_exec_ctx *exec_ctx, const char *name,
-                                 const char *default_port,
-                                 grpc_pollset_set *interested_parties,
-                                 grpc_closure *on_done,
-                                 grpc_resolved_addresses **addrs) {
-  request *r = (request *)gpr_malloc(sizeof(request));
+static void resolve_address_impl(grpc_exec_ctx* exec_ctx, const char* name,
+                                 const char* default_port,
+                                 grpc_pollset_set* interested_parties,
+                                 grpc_closure* on_done,
+                                 grpc_resolved_addresses** addrs) {
+  request* r = (request*)gpr_malloc(sizeof(request));
   GRPC_CLOSURE_INIT(&r->request_closure, do_request_thread, r,
                     grpc_executor_scheduler(GRPC_EXECUTOR_SHORT));
   r->name = gpr_strdup(name);
@@ -186,8 +186,8 @@
 }
 
 void (*grpc_resolve_address)(
-    grpc_exec_ctx *exec_ctx, const char *name, const char *default_port,
-    grpc_pollset_set *interested_parties, grpc_closure *on_done,
-    grpc_resolved_addresses **addrs) = resolve_address_impl;
+    grpc_exec_ctx* exec_ctx, const char* name, const char* default_port,
+    grpc_pollset_set* interested_parties, grpc_closure* on_done,
+    grpc_resolved_addresses** addrs) = resolve_address_impl;
 
 #endif
diff --git a/src/core/lib/iomgr/resolve_address_uv.cc b/src/core/lib/iomgr/resolve_address_uv.cc
index 4f7f234..6d09fd1 100644
--- a/src/core/lib/iomgr/resolve_address_uv.cc
+++ b/src/core/lib/iomgr/resolve_address_uv.cc
@@ -38,23 +38,23 @@
 #include <string.h>
 
 typedef struct request {
-  grpc_closure *on_done;
-  grpc_resolved_addresses **addresses;
-  struct addrinfo *hints;
-  char *host;
-  char *port;
+  grpc_closure* on_done;
+  grpc_resolved_addresses** addresses;
+  struct addrinfo* hints;
+  char* host;
+  char* port;
 } request;
 
-static int retry_named_port_failure(int status, request *r,
+static int retry_named_port_failure(int status, request* r,
                                     uv_getaddrinfo_cb getaddrinfo_cb) {
   if (status != 0) {
     // This loop is copied from resolve_address_posix.c
-    const char *svc[][2] = {{"http", "80"}, {"https", "443"}};
+    const char* svc[][2] = {{"http", "80"}, {"https", "443"}};
     for (size_t i = 0; i < GPR_ARRAY_SIZE(svc); i++) {
       if (strcmp(r->port, svc[i][0]) == 0) {
         int retry_status;
-        uv_getaddrinfo_t *req =
-            (uv_getaddrinfo_t *)gpr_malloc(sizeof(uv_getaddrinfo_t));
+        uv_getaddrinfo_t* req =
+            (uv_getaddrinfo_t*)gpr_malloc(sizeof(uv_getaddrinfo_t));
         req->data = r;
         r->port = gpr_strdup(svc[i][1]);
         retry_status = uv_getaddrinfo(uv_default_loop(), req, getaddrinfo_cb,
@@ -73,12 +73,12 @@
   return 1;
 }
 
-static grpc_error *handle_addrinfo_result(int status, struct addrinfo *result,
-                                          grpc_resolved_addresses **addresses) {
-  struct addrinfo *resp;
+static grpc_error* handle_addrinfo_result(int status, struct addrinfo* result,
+                                          grpc_resolved_addresses** addresses) {
+  struct addrinfo* resp;
   size_t i;
   if (status != 0) {
-    grpc_error *error;
+    grpc_error* error;
     *addresses = NULL;
     error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("getaddrinfo failed");
     error =
@@ -87,12 +87,12 @@
     return error;
   }
   (*addresses) =
-      (grpc_resolved_addresses *)gpr_malloc(sizeof(grpc_resolved_addresses));
+      (grpc_resolved_addresses*)gpr_malloc(sizeof(grpc_resolved_addresses));
   (*addresses)->naddrs = 0;
   for (resp = result; resp != NULL; resp = resp->ai_next) {
     (*addresses)->naddrs++;
   }
-  (*addresses)->addrs = (grpc_resolved_address *)gpr_malloc(
+  (*addresses)->addrs = (grpc_resolved_address*)gpr_malloc(
       sizeof(grpc_resolved_address) * (*addresses)->naddrs);
   i = 0;
   for (resp = result; resp != NULL; resp = resp->ai_next) {
@@ -103,7 +103,7 @@
 
   {
     for (i = 0; i < (*addresses)->naddrs; i++) {
-      char *buf;
+      char* buf;
       grpc_sockaddr_to_string(&buf, &(*addresses)->addrs[i], 0);
       gpr_free(buf);
     }
@@ -111,13 +111,13 @@
   return GRPC_ERROR_NONE;
 }
 
-static void getaddrinfo_callback(uv_getaddrinfo_t *req, int status,
-                                 struct addrinfo *res) {
-  request *r = (request *)req->data;
+static void getaddrinfo_callback(uv_getaddrinfo_t* req, int status,
+                                 struct addrinfo* res) {
+  request* r = (request*)req->data;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_error *error;
+  grpc_error* error;
   int retry_status;
-  char *port = r->port;
+  char* port = r->port;
 
   gpr_free(req);
   retry_status = retry_named_port_failure(status, r, getaddrinfo_callback);
@@ -139,14 +139,14 @@
   uv_freeaddrinfo(res);
 }
 
-static grpc_error *try_split_host_port(const char *name,
-                                       const char *default_port, char **host,
-                                       char **port) {
+static grpc_error* try_split_host_port(const char* name,
+                                       const char* default_port, char** host,
+                                       char** port) {
   /* parse name, splitting it into host and port parts */
-  grpc_error *error;
+  grpc_error* error;
   gpr_split_host_port(name, host, port);
   if (*host == NULL) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "unparseable host:port: '%s'", name);
     error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
@@ -155,7 +155,7 @@
   if (*port == NULL) {
     // TODO(murgatroid99): add tests for this case
     if (default_port == NULL) {
-      char *msg;
+      char* msg;
       gpr_asprintf(&msg, "no port in name '%s'", name);
       error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
       gpr_free(msg);
@@ -166,15 +166,15 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *blocking_resolve_address_impl(
-    const char *name, const char *default_port,
-    grpc_resolved_addresses **addresses) {
-  char *host;
-  char *port;
+static grpc_error* blocking_resolve_address_impl(
+    const char* name, const char* default_port,
+    grpc_resolved_addresses** addresses) {
+  char* host;
+  char* port;
   struct addrinfo hints;
   uv_getaddrinfo_t req;
   int s;
-  grpc_error *err;
+  grpc_error* err;
   int retry_status;
   request r;
 
@@ -213,28 +213,28 @@
   return err;
 }
 
-grpc_error *(*grpc_blocking_resolve_address)(
-    const char *name, const char *default_port,
-    grpc_resolved_addresses **addresses) = blocking_resolve_address_impl;
+grpc_error* (*grpc_blocking_resolve_address)(
+    const char* name, const char* default_port,
+    grpc_resolved_addresses** addresses) = blocking_resolve_address_impl;
 
-void grpc_resolved_addresses_destroy(grpc_resolved_addresses *addrs) {
+void grpc_resolved_addresses_destroy(grpc_resolved_addresses* addrs) {
   if (addrs != NULL) {
     gpr_free(addrs->addrs);
   }
   gpr_free(addrs);
 }
 
-static void resolve_address_impl(grpc_exec_ctx *exec_ctx, const char *name,
-                                 const char *default_port,
-                                 grpc_pollset_set *interested_parties,
-                                 grpc_closure *on_done,
-                                 grpc_resolved_addresses **addrs) {
-  uv_getaddrinfo_t *req = NULL;
-  request *r = NULL;
-  struct addrinfo *hints = NULL;
-  char *host = NULL;
-  char *port = NULL;
-  grpc_error *err;
+static void resolve_address_impl(grpc_exec_ctx* exec_ctx, const char* name,
+                                 const char* default_port,
+                                 grpc_pollset_set* interested_parties,
+                                 grpc_closure* on_done,
+                                 grpc_resolved_addresses** addrs) {
+  uv_getaddrinfo_t* req = NULL;
+  request* r = NULL;
+  struct addrinfo* hints = NULL;
+  char* host = NULL;
+  char* port = NULL;
+  grpc_error* err;
   int s;
   GRPC_UV_ASSERT_SAME_THREAD();
   err = try_split_host_port(name, default_port, &host, &port);
@@ -244,16 +244,16 @@
     gpr_free(port);
     return;
   }
-  r = (request *)gpr_malloc(sizeof(request));
+  r = (request*)gpr_malloc(sizeof(request));
   r->on_done = on_done;
   r->addresses = addrs;
   r->host = host;
   r->port = port;
-  req = (uv_getaddrinfo_t *)gpr_malloc(sizeof(uv_getaddrinfo_t));
+  req = (uv_getaddrinfo_t*)gpr_malloc(sizeof(uv_getaddrinfo_t));
   req->data = r;
 
   /* Call getaddrinfo */
-  hints = (addrinfo *)gpr_malloc(sizeof(struct addrinfo));
+  hints = (addrinfo*)gpr_malloc(sizeof(struct addrinfo));
   memset(hints, 0, sizeof(struct addrinfo));
   hints->ai_family = AF_UNSPEC;     /* ipv4 or ipv6 */
   hints->ai_socktype = SOCK_STREAM; /* stream socket */
@@ -278,8 +278,8 @@
 }
 
 void (*grpc_resolve_address)(
-    grpc_exec_ctx *exec_ctx, const char *name, const char *default_port,
-    grpc_pollset_set *interested_parties, grpc_closure *on_done,
-    grpc_resolved_addresses **addrs) = resolve_address_impl;
+    grpc_exec_ctx* exec_ctx, const char* name, const char* default_port,
+    grpc_pollset_set* interested_parties, grpc_closure* on_done,
+    grpc_resolved_addresses** addrs) = resolve_address_impl;
 
 #endif /* GRPC_UV */
diff --git a/src/core/lib/iomgr/resolve_address_windows.cc b/src/core/lib/iomgr/resolve_address_windows.cc
index 451f01a..d9fc17a 100644
--- a/src/core/lib/iomgr/resolve_address_windows.cc
+++ b/src/core/lib/iomgr/resolve_address_windows.cc
@@ -41,28 +41,28 @@
 #include "src/core/lib/support/string.h"
 
 typedef struct {
-  char *name;
-  char *default_port;
+  char* name;
+  char* default_port;
   grpc_closure request_closure;
-  grpc_closure *on_done;
-  grpc_resolved_addresses **addresses;
+  grpc_closure* on_done;
+  grpc_resolved_addresses** addresses;
 } request;
 
-static grpc_error *blocking_resolve_address_impl(
-    const char *name, const char *default_port,
-    grpc_resolved_addresses **addresses) {
+static grpc_error* blocking_resolve_address_impl(
+    const char* name, const char* default_port,
+    grpc_resolved_addresses** addresses) {
   struct addrinfo hints;
   struct addrinfo *result = NULL, *resp;
-  char *host;
-  char *port;
+  char* host;
+  char* port;
   int s;
   size_t i;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   /* parse name, splitting it into host and port parts */
   gpr_split_host_port(name, &host, &port);
   if (host == NULL) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "unparseable host:port: '%s'", name);
     error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
@@ -70,7 +70,7 @@
   }
   if (port == NULL) {
     if (default_port == NULL) {
-      char *msg;
+      char* msg;
       gpr_asprintf(&msg, "no port in name '%s'", name);
       error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
       gpr_free(msg);
@@ -95,12 +95,12 @@
 
   /* Success path: set addrs non-NULL, fill it in */
   (*addresses) =
-      (grpc_resolved_addresses *)gpr_malloc(sizeof(grpc_resolved_addresses));
+      (grpc_resolved_addresses*)gpr_malloc(sizeof(grpc_resolved_addresses));
   (*addresses)->naddrs = 0;
   for (resp = result; resp != NULL; resp = resp->ai_next) {
     (*addresses)->naddrs++;
   }
-  (*addresses)->addrs = (grpc_resolved_address *)gpr_malloc(
+  (*addresses)->addrs = (grpc_resolved_address*)gpr_malloc(
       sizeof(grpc_resolved_address) * (*addresses)->naddrs);
   i = 0;
   for (resp = result; resp != NULL; resp = resp->ai_next) {
@@ -111,7 +111,7 @@
 
   {
     for (i = 0; i < (*addresses)->naddrs; i++) {
-      char *buf;
+      char* buf;
       grpc_sockaddr_to_string(&buf, &(*addresses)->addrs[i], 0);
       gpr_free(buf);
     }
@@ -126,15 +126,15 @@
   return error;
 }
 
-grpc_error *(*grpc_blocking_resolve_address)(
-    const char *name, const char *default_port,
-    grpc_resolved_addresses **addresses) = blocking_resolve_address_impl;
+grpc_error* (*grpc_blocking_resolve_address)(
+    const char* name, const char* default_port,
+    grpc_resolved_addresses** addresses) = blocking_resolve_address_impl;
 
 /* Callback to be passed to grpc_executor to asynch-ify
  * grpc_blocking_resolve_address */
-static void do_request_thread(grpc_exec_ctx *exec_ctx, void *rp,
-                              grpc_error *error) {
-  request *r = (request *)rp;
+static void do_request_thread(grpc_exec_ctx* exec_ctx, void* rp,
+                              grpc_error* error) {
+  request* r = (request*)rp;
   if (error == GRPC_ERROR_NONE) {
     error =
         grpc_blocking_resolve_address(r->name, r->default_port, r->addresses);
@@ -147,19 +147,19 @@
   gpr_free(r);
 }
 
-void grpc_resolved_addresses_destroy(grpc_resolved_addresses *addrs) {
+void grpc_resolved_addresses_destroy(grpc_resolved_addresses* addrs) {
   if (addrs != NULL) {
     gpr_free(addrs->addrs);
   }
   gpr_free(addrs);
 }
 
-static void resolve_address_impl(grpc_exec_ctx *exec_ctx, const char *name,
-                                 const char *default_port,
-                                 grpc_pollset_set *interested_parties,
-                                 grpc_closure *on_done,
-                                 grpc_resolved_addresses **addresses) {
-  request *r = (request *)gpr_malloc(sizeof(request));
+static void resolve_address_impl(grpc_exec_ctx* exec_ctx, const char* name,
+                                 const char* default_port,
+                                 grpc_pollset_set* interested_parties,
+                                 grpc_closure* on_done,
+                                 grpc_resolved_addresses** addresses) {
+  request* r = (request*)gpr_malloc(sizeof(request));
   GRPC_CLOSURE_INIT(&r->request_closure, do_request_thread, r,
                     grpc_executor_scheduler(GRPC_EXECUTOR_SHORT));
   r->name = gpr_strdup(name);
@@ -170,8 +170,8 @@
 }
 
 void (*grpc_resolve_address)(
-    grpc_exec_ctx *exec_ctx, const char *name, const char *default_port,
-    grpc_pollset_set *interested_parties, grpc_closure *on_done,
-    grpc_resolved_addresses **addresses) = resolve_address_impl;
+    grpc_exec_ctx* exec_ctx, const char* name, const char* default_port,
+    grpc_pollset_set* interested_parties, grpc_closure* on_done,
+    grpc_resolved_addresses** addresses) = resolve_address_impl;
 
 #endif
diff --git a/src/core/lib/iomgr/resource_quota.cc b/src/core/lib/iomgr/resource_quota.cc
index 28098ec..9cce80c 100644
--- a/src/core/lib/iomgr/resource_quota.cc
+++ b/src/core/lib/iomgr/resource_quota.cc
@@ -37,8 +37,8 @@
 
 /* Internal linked list pointers for a resource user */
 typedef struct {
-  grpc_resource_user *next;
-  grpc_resource_user *prev;
+  grpc_resource_user* next;
+  grpc_resource_user* prev;
 } grpc_resource_user_link;
 
 /* Resource users are kept in (potentially) several intrusive linked lists
@@ -59,7 +59,7 @@
 
 struct grpc_resource_user {
   /* The quota this resource user consumes from */
-  grpc_resource_quota *resource_quota;
+  grpc_resource_quota* resource_quota;
 
   /* Closure to schedule an allocation under the resource quota combiner lock */
   grpc_closure allocate_closure;
@@ -96,10 +96,10 @@
 
   /* Reclaimers: index 0 is the benign reclaimer, 1 is the destructive reclaimer
    */
-  grpc_closure *reclaimers[2];
+  grpc_closure* reclaimers[2];
   /* Reclaimers just posted: once we're in the combiner lock, we'll move them
      to the array above */
-  grpc_closure *new_reclaimers[2];
+  grpc_closure* new_reclaimers[2];
   /* Trampoline closures to finish reclamation and re-enter the quota combiner
      lock */
   grpc_closure post_reclaimer_closure[2];
@@ -112,7 +112,7 @@
   grpc_resource_user_link links[GRPC_RULIST_COUNT];
 
   /* The name of this resource user, for debugging/tracing */
-  char *name;
+  char* name;
 };
 
 struct grpc_resource_quota {
@@ -125,7 +125,7 @@
 
   /* Master combiner lock: all activity on a quota executes under this combiner
    * (so no mutex is needed for this data structure) */
-  grpc_combiner *combiner;
+  grpc_combiner* combiner;
   /* Size of the resource quota */
   int64_t size;
   /* Amount of free memory in the resource quota */
@@ -145,26 +145,26 @@
   /* This is only really usable for debugging: it's always a stale pointer, but
      a stale pointer that might just be fresh enough to guide us to where the
      reclamation system is stuck */
-  grpc_closure *debug_only_last_initiated_reclaimer;
-  grpc_resource_user *debug_only_last_reclaimer_resource_user;
+  grpc_closure* debug_only_last_initiated_reclaimer;
+  grpc_resource_user* debug_only_last_reclaimer_resource_user;
 
   /* Roots of all resource user lists */
-  grpc_resource_user *roots[GRPC_RULIST_COUNT];
+  grpc_resource_user* roots[GRPC_RULIST_COUNT];
 
-  char *name;
+  char* name;
 };
 
-static void ru_unref_by(grpc_exec_ctx *exec_ctx,
-                        grpc_resource_user *resource_user, gpr_atm amount);
+static void ru_unref_by(grpc_exec_ctx* exec_ctx,
+                        grpc_resource_user* resource_user, gpr_atm amount);
 
 /*******************************************************************************
  * list management
  */
 
-static void rulist_add_head(grpc_resource_user *resource_user,
+static void rulist_add_head(grpc_resource_user* resource_user,
                             grpc_rulist list) {
-  grpc_resource_quota *resource_quota = resource_user->resource_quota;
-  grpc_resource_user **root = &resource_quota->roots[list];
+  grpc_resource_quota* resource_quota = resource_user->resource_quota;
+  grpc_resource_user** root = &resource_quota->roots[list];
   if (*root == NULL) {
     *root = resource_user;
     resource_user->links[list].next = resource_user->links[list].prev =
@@ -178,10 +178,10 @@
   }
 }
 
-static void rulist_add_tail(grpc_resource_user *resource_user,
+static void rulist_add_tail(grpc_resource_user* resource_user,
                             grpc_rulist list) {
-  grpc_resource_quota *resource_quota = resource_user->resource_quota;
-  grpc_resource_user **root = &resource_quota->roots[list];
+  grpc_resource_quota* resource_quota = resource_user->resource_quota;
+  grpc_resource_user** root = &resource_quota->roots[list];
   if (*root == NULL) {
     *root = resource_user;
     resource_user->links[list].next = resource_user->links[list].prev =
@@ -194,15 +194,15 @@
   }
 }
 
-static bool rulist_empty(grpc_resource_quota *resource_quota,
+static bool rulist_empty(grpc_resource_quota* resource_quota,
                          grpc_rulist list) {
   return resource_quota->roots[list] == NULL;
 }
 
-static grpc_resource_user *rulist_pop_head(grpc_resource_quota *resource_quota,
+static grpc_resource_user* rulist_pop_head(grpc_resource_quota* resource_quota,
                                            grpc_rulist list) {
-  grpc_resource_user **root = &resource_quota->roots[list];
-  grpc_resource_user *resource_user = *root;
+  grpc_resource_user** root = &resource_quota->roots[list];
+  grpc_resource_user* resource_user = *root;
   if (resource_user == NULL) {
     return NULL;
   }
@@ -219,9 +219,9 @@
   return resource_user;
 }
 
-static void rulist_remove(grpc_resource_user *resource_user, grpc_rulist list) {
+static void rulist_remove(grpc_resource_user* resource_user, grpc_rulist list) {
   if (resource_user->links[list].next == NULL) return;
-  grpc_resource_quota *resource_quota = resource_user->resource_quota;
+  grpc_resource_quota* resource_quota = resource_user->resource_quota;
   if (resource_quota->roots[list] == resource_user) {
     resource_quota->roots[list] = resource_user->links[list].next;
     if (resource_quota->roots[list] == resource_user) {
@@ -239,15 +239,15 @@
  * resource quota state machine
  */
 
-static bool rq_alloc(grpc_exec_ctx *exec_ctx,
-                     grpc_resource_quota *resource_quota);
+static bool rq_alloc(grpc_exec_ctx* exec_ctx,
+                     grpc_resource_quota* resource_quota);
 static bool rq_reclaim_from_per_user_free_pool(
-    grpc_exec_ctx *exec_ctx, grpc_resource_quota *resource_quota);
-static bool rq_reclaim(grpc_exec_ctx *exec_ctx,
-                       grpc_resource_quota *resource_quota, bool destructive);
+    grpc_exec_ctx* exec_ctx, grpc_resource_quota* resource_quota);
+static bool rq_reclaim(grpc_exec_ctx* exec_ctx,
+                       grpc_resource_quota* resource_quota, bool destructive);
 
-static void rq_step(grpc_exec_ctx *exec_ctx, void *rq, grpc_error *error) {
-  grpc_resource_quota *resource_quota = (grpc_resource_quota *)rq;
+static void rq_step(grpc_exec_ctx* exec_ctx, void* rq, grpc_error* error) {
+  grpc_resource_quota* resource_quota = (grpc_resource_quota*)rq;
   resource_quota->step_scheduled = false;
   do {
     if (rq_alloc(exec_ctx, resource_quota)) goto done;
@@ -261,8 +261,8 @@
   grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
 }
 
-static void rq_step_sched(grpc_exec_ctx *exec_ctx,
-                          grpc_resource_quota *resource_quota) {
+static void rq_step_sched(grpc_exec_ctx* exec_ctx,
+                          grpc_resource_quota* resource_quota) {
   if (resource_quota->step_scheduled) return;
   resource_quota->step_scheduled = true;
   grpc_resource_quota_ref_internal(resource_quota);
@@ -272,13 +272,12 @@
 
 /* update the atomically available resource estimate - use no barriers since
    timeliness of delivery really doesn't matter much */
-static void rq_update_estimate(grpc_resource_quota *resource_quota) {
+static void rq_update_estimate(grpc_resource_quota* resource_quota) {
   gpr_atm memory_usage_estimation = MEMORY_USAGE_ESTIMATION_MAX;
   if (resource_quota->size != 0) {
     memory_usage_estimation =
-        GPR_CLAMP((gpr_atm)((1.0 -
-                             ((double)resource_quota->free_pool) /
-                                 ((double)resource_quota->size)) *
+        GPR_CLAMP((gpr_atm)((1.0 - ((double)resource_quota->free_pool) /
+                                       ((double)resource_quota->size)) *
                             MEMORY_USAGE_ESTIMATION_MAX),
                   0, MEMORY_USAGE_ESTIMATION_MAX);
   }
@@ -287,15 +286,16 @@
 }
 
 /* returns true if all allocations are completed */
-static bool rq_alloc(grpc_exec_ctx *exec_ctx,
-                     grpc_resource_quota *resource_quota) {
-  grpc_resource_user *resource_user;
+static bool rq_alloc(grpc_exec_ctx* exec_ctx,
+                     grpc_resource_quota* resource_quota) {
+  grpc_resource_user* resource_user;
   while ((resource_user = rulist_pop_head(resource_quota,
                                           GRPC_RULIST_AWAITING_ALLOCATION))) {
     gpr_mu_lock(&resource_user->mu);
     if (grpc_resource_quota_trace.enabled()) {
-      gpr_log(GPR_DEBUG, "RQ: check allocation for user %p shutdown=%" PRIdPTR
-                         " free_pool=%" PRId64,
+      gpr_log(GPR_DEBUG,
+              "RQ: check allocation for user %p shutdown=%" PRIdPTR
+              " free_pool=%" PRId64,
               resource_user, gpr_atm_no_barrier_load(&resource_user->shutdown),
               resource_user->free_pool);
     }
@@ -319,8 +319,9 @@
       resource_quota->free_pool -= amt;
       rq_update_estimate(resource_quota);
       if (grpc_resource_quota_trace.enabled()) {
-        gpr_log(GPR_DEBUG, "RQ %s %s: grant alloc %" PRId64
-                           " bytes; rq_free_pool -> %" PRId64,
+        gpr_log(GPR_DEBUG,
+                "RQ %s %s: grant alloc %" PRId64
+                " bytes; rq_free_pool -> %" PRId64,
                 resource_quota->name, resource_user->name, amt,
                 resource_quota->free_pool);
       }
@@ -345,8 +346,8 @@
 
 /* returns true if any memory could be reclaimed from buffers */
 static bool rq_reclaim_from_per_user_free_pool(
-    grpc_exec_ctx *exec_ctx, grpc_resource_quota *resource_quota) {
-  grpc_resource_user *resource_user;
+    grpc_exec_ctx* exec_ctx, grpc_resource_quota* resource_quota) {
+  grpc_resource_user* resource_user;
   while ((resource_user = rulist_pop_head(resource_quota,
                                           GRPC_RULIST_NON_EMPTY_FREE_POOL))) {
     gpr_mu_lock(&resource_user->mu);
@@ -356,8 +357,9 @@
       resource_quota->free_pool += amt;
       rq_update_estimate(resource_quota);
       if (grpc_resource_quota_trace.enabled()) {
-        gpr_log(GPR_DEBUG, "RQ %s %s: reclaim_from_per_user_free_pool %" PRId64
-                           " bytes; rq_free_pool -> %" PRId64,
+        gpr_log(GPR_DEBUG,
+                "RQ %s %s: reclaim_from_per_user_free_pool %" PRId64
+                " bytes; rq_free_pool -> %" PRId64,
                 resource_quota->name, resource_user->name, amt,
                 resource_quota->free_pool);
       }
@@ -371,12 +373,12 @@
 }
 
 /* returns true if reclamation is proceeding */
-static bool rq_reclaim(grpc_exec_ctx *exec_ctx,
-                       grpc_resource_quota *resource_quota, bool destructive) {
+static bool rq_reclaim(grpc_exec_ctx* exec_ctx,
+                       grpc_resource_quota* resource_quota, bool destructive) {
   if (resource_quota->reclaiming) return true;
   grpc_rulist list = destructive ? GRPC_RULIST_RECLAIMER_DESTRUCTIVE
                                  : GRPC_RULIST_RECLAIMER_BENIGN;
-  grpc_resource_user *resource_user = rulist_pop_head(resource_quota, list);
+  grpc_resource_user* resource_user = rulist_pop_head(resource_quota, list);
   if (resource_user == NULL) return false;
   if (grpc_resource_quota_trace.enabled()) {
     gpr_log(GPR_DEBUG, "RQ %s %s: initiate %s reclamation",
@@ -385,7 +387,7 @@
   }
   resource_quota->reclaiming = true;
   grpc_resource_quota_ref_internal(resource_quota);
-  grpc_closure *c = resource_user->reclaimers[destructive];
+  grpc_closure* c = resource_user->reclaimers[destructive];
   GPR_ASSERT(c);
   resource_quota->debug_only_last_reclaimer_resource_user = resource_user;
   resource_quota->debug_only_last_initiated_reclaimer = c;
@@ -401,17 +403,17 @@
 typedef struct {
   grpc_slice_refcount base;
   gpr_refcount refs;
-  grpc_resource_user *resource_user;
+  grpc_resource_user* resource_user;
   size_t size;
 } ru_slice_refcount;
 
-static void ru_slice_ref(void *p) {
-  ru_slice_refcount *rc = (ru_slice_refcount *)p;
+static void ru_slice_ref(void* p) {
+  ru_slice_refcount* rc = (ru_slice_refcount*)p;
   gpr_ref(&rc->refs);
 }
 
-static void ru_slice_unref(grpc_exec_ctx *exec_ctx, void *p) {
-  ru_slice_refcount *rc = (ru_slice_refcount *)p;
+static void ru_slice_unref(grpc_exec_ctx* exec_ctx, void* p) {
+  ru_slice_refcount* rc = (ru_slice_refcount*)p;
   if (gpr_unref(&rc->refs)) {
     grpc_resource_user_free(exec_ctx, rc->resource_user, rc->size);
     gpr_free(rc);
@@ -422,10 +424,10 @@
     ru_slice_ref, ru_slice_unref, grpc_slice_default_eq_impl,
     grpc_slice_default_hash_impl};
 
-static grpc_slice ru_slice_create(grpc_resource_user *resource_user,
+static grpc_slice ru_slice_create(grpc_resource_user* resource_user,
                                   size_t size) {
-  ru_slice_refcount *rc =
-      (ru_slice_refcount *)gpr_malloc(sizeof(ru_slice_refcount) + size);
+  ru_slice_refcount* rc =
+      (ru_slice_refcount*)gpr_malloc(sizeof(ru_slice_refcount) + size);
   rc->base.vtable = &ru_slice_vtable;
   rc->base.sub_refcount = &rc->base;
   gpr_ref_init(&rc->refs, 1);
@@ -433,7 +435,7 @@
   rc->size = size;
   grpc_slice slice;
   slice.refcount = &rc->base;
-  slice.data.refcounted.bytes = (uint8_t *)(rc + 1);
+  slice.data.refcounted.bytes = (uint8_t*)(rc + 1);
   slice.data.refcounted.length = size;
   return slice;
 }
@@ -443,8 +445,8 @@
  * the combiner
  */
 
-static void ru_allocate(grpc_exec_ctx *exec_ctx, void *ru, grpc_error *error) {
-  grpc_resource_user *resource_user = (grpc_resource_user *)ru;
+static void ru_allocate(grpc_exec_ctx* exec_ctx, void* ru, grpc_error* error) {
+  grpc_resource_user* resource_user = (grpc_resource_user*)ru;
   if (rulist_empty(resource_user->resource_quota,
                    GRPC_RULIST_AWAITING_ALLOCATION)) {
     rq_step_sched(exec_ctx, resource_user->resource_quota);
@@ -452,9 +454,9 @@
   rulist_add_tail(resource_user, GRPC_RULIST_AWAITING_ALLOCATION);
 }
 
-static void ru_add_to_free_pool(grpc_exec_ctx *exec_ctx, void *ru,
-                                grpc_error *error) {
-  grpc_resource_user *resource_user = (grpc_resource_user *)ru;
+static void ru_add_to_free_pool(grpc_exec_ctx* exec_ctx, void* ru,
+                                grpc_error* error) {
+  grpc_resource_user* resource_user = (grpc_resource_user*)ru;
   if (!rulist_empty(resource_user->resource_quota,
                     GRPC_RULIST_AWAITING_ALLOCATION) &&
       rulist_empty(resource_user->resource_quota,
@@ -464,10 +466,10 @@
   rulist_add_tail(resource_user, GRPC_RULIST_NON_EMPTY_FREE_POOL);
 }
 
-static bool ru_post_reclaimer(grpc_exec_ctx *exec_ctx,
-                              grpc_resource_user *resource_user,
+static bool ru_post_reclaimer(grpc_exec_ctx* exec_ctx,
+                              grpc_resource_user* resource_user,
                               bool destructive) {
-  grpc_closure *closure = resource_user->new_reclaimers[destructive];
+  grpc_closure* closure = resource_user->new_reclaimers[destructive];
   GPR_ASSERT(closure != NULL);
   resource_user->new_reclaimers[destructive] = NULL;
   GPR_ASSERT(resource_user->reclaimers[destructive] == NULL);
@@ -479,9 +481,9 @@
   return true;
 }
 
-static void ru_post_benign_reclaimer(grpc_exec_ctx *exec_ctx, void *ru,
-                                     grpc_error *error) {
-  grpc_resource_user *resource_user = (grpc_resource_user *)ru;
+static void ru_post_benign_reclaimer(grpc_exec_ctx* exec_ctx, void* ru,
+                                     grpc_error* error) {
+  grpc_resource_user* resource_user = (grpc_resource_user*)ru;
   if (!ru_post_reclaimer(exec_ctx, resource_user, false)) return;
   if (!rulist_empty(resource_user->resource_quota,
                     GRPC_RULIST_AWAITING_ALLOCATION) &&
@@ -494,9 +496,9 @@
   rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_BENIGN);
 }
 
-static void ru_post_destructive_reclaimer(grpc_exec_ctx *exec_ctx, void *ru,
-                                          grpc_error *error) {
-  grpc_resource_user *resource_user = (grpc_resource_user *)ru;
+static void ru_post_destructive_reclaimer(grpc_exec_ctx* exec_ctx, void* ru,
+                                          grpc_error* error) {
+  grpc_resource_user* resource_user = (grpc_resource_user*)ru;
   if (!ru_post_reclaimer(exec_ctx, resource_user, true)) return;
   if (!rulist_empty(resource_user->resource_quota,
                     GRPC_RULIST_AWAITING_ALLOCATION) &&
@@ -511,11 +513,11 @@
   rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_DESTRUCTIVE);
 }
 
-static void ru_shutdown(grpc_exec_ctx *exec_ctx, void *ru, grpc_error *error) {
+static void ru_shutdown(grpc_exec_ctx* exec_ctx, void* ru, grpc_error* error) {
   if (grpc_resource_quota_trace.enabled()) {
     gpr_log(GPR_DEBUG, "RU shutdown %p", ru);
   }
-  grpc_resource_user *resource_user = (grpc_resource_user *)ru;
+  grpc_resource_user* resource_user = (grpc_resource_user*)ru;
   GRPC_CLOSURE_SCHED(exec_ctx, resource_user->reclaimers[0],
                      GRPC_ERROR_CANCELLED);
   GRPC_CLOSURE_SCHED(exec_ctx, resource_user->reclaimers[1],
@@ -529,8 +531,8 @@
   }
 }
 
-static void ru_destroy(grpc_exec_ctx *exec_ctx, void *ru, grpc_error *error) {
-  grpc_resource_user *resource_user = (grpc_resource_user *)ru;
+static void ru_destroy(grpc_exec_ctx* exec_ctx, void* ru, grpc_error* error) {
+  grpc_resource_user* resource_user = (grpc_resource_user*)ru;
   GPR_ASSERT(gpr_atm_no_barrier_load(&resource_user->refs) == 0);
   for (int i = 0; i < GRPC_RULIST_COUNT; i++) {
     rulist_remove(resource_user, (grpc_rulist)i);
@@ -549,10 +551,10 @@
   gpr_free(resource_user);
 }
 
-static void ru_allocated_slices(grpc_exec_ctx *exec_ctx, void *arg,
-                                grpc_error *error) {
-  grpc_resource_user_slice_allocator *slice_allocator =
-      (grpc_resource_user_slice_allocator *)arg;
+static void ru_allocated_slices(grpc_exec_ctx* exec_ctx, void* arg,
+                                grpc_error* error) {
+  grpc_resource_user_slice_allocator* slice_allocator =
+      (grpc_resource_user_slice_allocator*)arg;
   if (error == GRPC_ERROR_NONE) {
     for (size_t i = 0; i < slice_allocator->count; i++) {
       grpc_slice_buffer_add_indexed(
@@ -570,12 +572,12 @@
 
 typedef struct {
   int64_t size;
-  grpc_resource_quota *resource_quota;
+  grpc_resource_quota* resource_quota;
   grpc_closure closure;
 } rq_resize_args;
 
-static void rq_resize(grpc_exec_ctx *exec_ctx, void *args, grpc_error *error) {
-  rq_resize_args *a = (rq_resize_args *)args;
+static void rq_resize(grpc_exec_ctx* exec_ctx, void* args, grpc_error* error) {
+  rq_resize_args* a = (rq_resize_args*)args;
   int64_t delta = a->size - a->resource_quota->size;
   a->resource_quota->size += delta;
   a->resource_quota->free_pool += delta;
@@ -585,9 +587,9 @@
   gpr_free(a);
 }
 
-static void rq_reclamation_done(grpc_exec_ctx *exec_ctx, void *rq,
-                                grpc_error *error) {
-  grpc_resource_quota *resource_quota = (grpc_resource_quota *)rq;
+static void rq_reclamation_done(grpc_exec_ctx* exec_ctx, void* rq,
+                                grpc_error* error) {
+  grpc_resource_quota* resource_quota = (grpc_resource_quota*)rq;
   resource_quota->reclaiming = false;
   rq_step_sched(exec_ctx, resource_quota);
   grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
@@ -598,9 +600,9 @@
  */
 
 /* Public API */
-grpc_resource_quota *grpc_resource_quota_create(const char *name) {
-  grpc_resource_quota *resource_quota =
-      (grpc_resource_quota *)gpr_malloc(sizeof(*resource_quota));
+grpc_resource_quota* grpc_resource_quota_create(const char* name) {
+  grpc_resource_quota* resource_quota =
+      (grpc_resource_quota*)gpr_malloc(sizeof(*resource_quota));
   gpr_ref_init(&resource_quota->refs, 1);
   resource_quota->combiner = grpc_combiner_create();
   resource_quota->free_pool = INT64_MAX;
@@ -626,8 +628,8 @@
   return resource_quota;
 }
 
-void grpc_resource_quota_unref_internal(grpc_exec_ctx *exec_ctx,
-                                        grpc_resource_quota *resource_quota) {
+void grpc_resource_quota_unref_internal(grpc_exec_ctx* exec_ctx,
+                                        grpc_resource_quota* resource_quota) {
   if (gpr_unref(&resource_quota->refs)) {
     GRPC_COMBINER_UNREF(exec_ctx, resource_quota->combiner, "resource_quota");
     gpr_free(resource_quota->name);
@@ -636,35 +638,35 @@
 }
 
 /* Public API */
-void grpc_resource_quota_unref(grpc_resource_quota *resource_quota) {
+void grpc_resource_quota_unref(grpc_resource_quota* resource_quota) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-grpc_resource_quota *grpc_resource_quota_ref_internal(
-    grpc_resource_quota *resource_quota) {
+grpc_resource_quota* grpc_resource_quota_ref_internal(
+    grpc_resource_quota* resource_quota) {
   gpr_ref(&resource_quota->refs);
   return resource_quota;
 }
 
 /* Public API */
-void grpc_resource_quota_ref(grpc_resource_quota *resource_quota) {
+void grpc_resource_quota_ref(grpc_resource_quota* resource_quota) {
   grpc_resource_quota_ref_internal(resource_quota);
 }
 
 double grpc_resource_quota_get_memory_pressure(
-    grpc_resource_quota *resource_quota) {
+    grpc_resource_quota* resource_quota) {
   return ((double)(gpr_atm_no_barrier_load(
              &resource_quota->memory_usage_estimation))) /
          ((double)MEMORY_USAGE_ESTIMATION_MAX);
 }
 
 /* Public API */
-void grpc_resource_quota_resize(grpc_resource_quota *resource_quota,
+void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
                                 size_t size) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  rq_resize_args *a = (rq_resize_args *)gpr_malloc(sizeof(*a));
+  rq_resize_args* a = (rq_resize_args*)gpr_malloc(sizeof(*a));
   a->resource_quota = grpc_resource_quota_ref_internal(resource_quota);
   a->size = (int64_t)size;
   gpr_atm_no_barrier_store(&resource_quota->last_size,
@@ -674,7 +676,7 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-size_t grpc_resource_quota_peek_size(grpc_resource_quota *resource_quota) {
+size_t grpc_resource_quota_peek_size(grpc_resource_quota* resource_quota) {
   return (size_t)gpr_atm_no_barrier_load(&resource_quota->last_size);
 }
 
@@ -682,13 +684,13 @@
  * grpc_resource_user channel args api
  */
 
-grpc_resource_quota *grpc_resource_quota_from_channel_args(
-    const grpc_channel_args *channel_args) {
+grpc_resource_quota* grpc_resource_quota_from_channel_args(
+    const grpc_channel_args* channel_args) {
   for (size_t i = 0; i < channel_args->num_args; i++) {
     if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
       if (channel_args->args[i].type == GRPC_ARG_POINTER) {
         return grpc_resource_quota_ref_internal(
-            (grpc_resource_quota *)channel_args->args[i].value.pointer.p);
+            (grpc_resource_quota*)channel_args->args[i].value.pointer.p);
       } else {
         gpr_log(GPR_DEBUG, GRPC_ARG_RESOURCE_QUOTA " should be a pointer");
       }
@@ -697,18 +699,18 @@
   return grpc_resource_quota_create(NULL);
 }
 
-static void *rq_copy(void *rq) {
-  grpc_resource_quota_ref((grpc_resource_quota *)rq);
+static void* rq_copy(void* rq) {
+  grpc_resource_quota_ref((grpc_resource_quota*)rq);
   return rq;
 }
 
-static void rq_destroy(grpc_exec_ctx *exec_ctx, void *rq) {
-  grpc_resource_quota_unref_internal(exec_ctx, (grpc_resource_quota *)rq);
+static void rq_destroy(grpc_exec_ctx* exec_ctx, void* rq) {
+  grpc_resource_quota_unref_internal(exec_ctx, (grpc_resource_quota*)rq);
 }
 
-static int rq_cmp(void *a, void *b) { return GPR_ICMP(a, b); }
+static int rq_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
 
-const grpc_arg_pointer_vtable *grpc_resource_quota_arg_vtable(void) {
+const grpc_arg_pointer_vtable* grpc_resource_quota_arg_vtable(void) {
   static const grpc_arg_pointer_vtable vtable = {rq_copy, rq_destroy, rq_cmp};
   return &vtable;
 }
@@ -717,10 +719,10 @@
  * grpc_resource_user api
  */
 
-grpc_resource_user *grpc_resource_user_create(
-    grpc_resource_quota *resource_quota, const char *name) {
-  grpc_resource_user *resource_user =
-      (grpc_resource_user *)gpr_malloc(sizeof(*resource_user));
+grpc_resource_user* grpc_resource_user_create(
+    grpc_resource_quota* resource_quota, const char* name) {
+  grpc_resource_user* resource_user =
+      (grpc_resource_user*)gpr_malloc(sizeof(*resource_user));
   resource_user->resource_quota =
       grpc_resource_quota_ref_internal(resource_quota);
   GRPC_CLOSURE_INIT(&resource_user->allocate_closure, &ru_allocate,
@@ -761,18 +763,18 @@
   return resource_user;
 }
 
-grpc_resource_quota *grpc_resource_user_quota(
-    grpc_resource_user *resource_user) {
+grpc_resource_quota* grpc_resource_user_quota(
+    grpc_resource_user* resource_user) {
   return resource_user->resource_quota;
 }
 
-static void ru_ref_by(grpc_resource_user *resource_user, gpr_atm amount) {
+static void ru_ref_by(grpc_resource_user* resource_user, gpr_atm amount) {
   GPR_ASSERT(amount > 0);
   GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&resource_user->refs, amount) != 0);
 }
 
-static void ru_unref_by(grpc_exec_ctx *exec_ctx,
-                        grpc_resource_user *resource_user, gpr_atm amount) {
+static void ru_unref_by(grpc_exec_ctx* exec_ctx,
+                        grpc_resource_user* resource_user, gpr_atm amount) {
   GPR_ASSERT(amount > 0);
   gpr_atm old = gpr_atm_full_fetch_add(&resource_user->refs, -amount);
   GPR_ASSERT(old >= amount);
@@ -782,17 +784,17 @@
   }
 }
 
-void grpc_resource_user_ref(grpc_resource_user *resource_user) {
+void grpc_resource_user_ref(grpc_resource_user* resource_user) {
   ru_ref_by(resource_user, 1);
 }
 
-void grpc_resource_user_unref(grpc_exec_ctx *exec_ctx,
-                              grpc_resource_user *resource_user) {
+void grpc_resource_user_unref(grpc_exec_ctx* exec_ctx,
+                              grpc_resource_user* resource_user) {
   ru_unref_by(exec_ctx, resource_user, 1);
 }
 
-void grpc_resource_user_shutdown(grpc_exec_ctx *exec_ctx,
-                                 grpc_resource_user *resource_user) {
+void grpc_resource_user_shutdown(grpc_exec_ctx* exec_ctx,
+                                 grpc_resource_user* resource_user) {
   if (gpr_atm_full_fetch_add(&resource_user->shutdown, 1) == 0) {
     GRPC_CLOSURE_SCHED(
         exec_ctx,
@@ -803,9 +805,9 @@
   }
 }
 
-void grpc_resource_user_alloc(grpc_exec_ctx *exec_ctx,
-                              grpc_resource_user *resource_user, size_t size,
-                              grpc_closure *optional_on_done) {
+void grpc_resource_user_alloc(grpc_exec_ctx* exec_ctx,
+                              grpc_resource_user* resource_user, size_t size,
+                              grpc_closure* optional_on_done) {
   gpr_mu_lock(&resource_user->mu);
   ru_ref_by(resource_user, (gpr_atm)size);
   resource_user->free_pool -= (int64_t)size;
@@ -830,8 +832,8 @@
   gpr_mu_unlock(&resource_user->mu);
 }
 
-void grpc_resource_user_free(grpc_exec_ctx *exec_ctx,
-                             grpc_resource_user *resource_user, size_t size) {
+void grpc_resource_user_free(grpc_exec_ctx* exec_ctx,
+                             grpc_resource_user* resource_user, size_t size) {
   gpr_mu_lock(&resource_user->mu);
   bool was_zero_or_negative = resource_user->free_pool <= 0;
   resource_user->free_pool += (int64_t)size;
@@ -851,10 +853,10 @@
   ru_unref_by(exec_ctx, resource_user, (gpr_atm)size);
 }
 
-void grpc_resource_user_post_reclaimer(grpc_exec_ctx *exec_ctx,
-                                       grpc_resource_user *resource_user,
+void grpc_resource_user_post_reclaimer(grpc_exec_ctx* exec_ctx,
+                                       grpc_resource_user* resource_user,
                                        bool destructive,
-                                       grpc_closure *closure) {
+                                       grpc_closure* closure) {
   GPR_ASSERT(resource_user->new_reclaimers[destructive] == NULL);
   resource_user->new_reclaimers[destructive] = closure;
   GRPC_CLOSURE_SCHED(exec_ctx,
@@ -862,8 +864,8 @@
                      GRPC_ERROR_NONE);
 }
 
-void grpc_resource_user_finish_reclamation(grpc_exec_ctx *exec_ctx,
-                                           grpc_resource_user *resource_user) {
+void grpc_resource_user_finish_reclamation(grpc_exec_ctx* exec_ctx,
+                                           grpc_resource_user* resource_user) {
   if (grpc_resource_quota_trace.enabled()) {
     gpr_log(GPR_DEBUG, "RQ %s %s: reclamation complete",
             resource_user->resource_quota->name, resource_user->name);
@@ -874,8 +876,8 @@
 }
 
 void grpc_resource_user_slice_allocator_init(
-    grpc_resource_user_slice_allocator *slice_allocator,
-    grpc_resource_user *resource_user, grpc_iomgr_cb_func cb, void *p) {
+    grpc_resource_user_slice_allocator* slice_allocator,
+    grpc_resource_user* resource_user, grpc_iomgr_cb_func cb, void* p) {
   GRPC_CLOSURE_INIT(&slice_allocator->on_allocated, ru_allocated_slices,
                     slice_allocator, grpc_schedule_on_exec_ctx);
   GRPC_CLOSURE_INIT(&slice_allocator->on_done, cb, p,
@@ -884,9 +886,9 @@
 }
 
 void grpc_resource_user_alloc_slices(
-    grpc_exec_ctx *exec_ctx,
-    grpc_resource_user_slice_allocator *slice_allocator, size_t length,
-    size_t count, grpc_slice_buffer *dest) {
+    grpc_exec_ctx* exec_ctx,
+    grpc_resource_user_slice_allocator* slice_allocator, size_t length,
+    size_t count, grpc_slice_buffer* dest) {
   slice_allocator->length = length;
   slice_allocator->count = count;
   slice_allocator->dest = dest;
@@ -894,8 +896,8 @@
                            count * length, &slice_allocator->on_allocated);
 }
 
-grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx *exec_ctx,
-                                           grpc_resource_user *resource_user,
+grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx* exec_ctx,
+                                           grpc_resource_user* resource_user,
                                            size_t size) {
   grpc_resource_user_alloc(exec_ctx, resource_user, size, NULL);
   return ru_slice_create(resource_user, size);
diff --git a/src/core/lib/iomgr/resource_quota.h b/src/core/lib/iomgr/resource_quota.h
index fdebe89..3af93a8 100644
--- a/src/core/lib/iomgr/resource_quota.h
+++ b/src/core/lib/iomgr/resource_quota.h
@@ -67,58 +67,58 @@
 
 extern grpc_core::TraceFlag grpc_resource_quota_trace;
 
-grpc_resource_quota *grpc_resource_quota_ref_internal(
-    grpc_resource_quota *resource_quota);
-void grpc_resource_quota_unref_internal(grpc_exec_ctx *exec_ctx,
-                                        grpc_resource_quota *resource_quota);
-grpc_resource_quota *grpc_resource_quota_from_channel_args(
-    const grpc_channel_args *channel_args);
+grpc_resource_quota* grpc_resource_quota_ref_internal(
+    grpc_resource_quota* resource_quota);
+void grpc_resource_quota_unref_internal(grpc_exec_ctx* exec_ctx,
+                                        grpc_resource_quota* resource_quota);
+grpc_resource_quota* grpc_resource_quota_from_channel_args(
+    const grpc_channel_args* channel_args);
 
 /* Return a number indicating current memory pressure:
    0.0 ==> no memory usage
    1.0 ==> maximum memory usage */
 double grpc_resource_quota_get_memory_pressure(
-    grpc_resource_quota *resource_quota);
+    grpc_resource_quota* resource_quota);
 
-size_t grpc_resource_quota_peek_size(grpc_resource_quota *resource_quota);
+size_t grpc_resource_quota_peek_size(grpc_resource_quota* resource_quota);
 
 typedef struct grpc_resource_user grpc_resource_user;
 
-grpc_resource_user *grpc_resource_user_create(
-    grpc_resource_quota *resource_quota, const char *name);
+grpc_resource_user* grpc_resource_user_create(
+    grpc_resource_quota* resource_quota, const char* name);
 
 /* Returns a borrowed reference to the underlying resource quota for this
    resource user. */
-grpc_resource_quota *grpc_resource_user_quota(
-    grpc_resource_user *resource_user);
+grpc_resource_quota* grpc_resource_user_quota(
+    grpc_resource_user* resource_user);
 
-void grpc_resource_user_ref(grpc_resource_user *resource_user);
-void grpc_resource_user_unref(grpc_exec_ctx *exec_ctx,
-                              grpc_resource_user *resource_user);
-void grpc_resource_user_shutdown(grpc_exec_ctx *exec_ctx,
-                                 grpc_resource_user *resource_user);
+void grpc_resource_user_ref(grpc_resource_user* resource_user);
+void grpc_resource_user_unref(grpc_exec_ctx* exec_ctx,
+                              grpc_resource_user* resource_user);
+void grpc_resource_user_shutdown(grpc_exec_ctx* exec_ctx,
+                                 grpc_resource_user* resource_user);
 
 /* Allocate from the resource user (and its quota).
    If optional_on_done is NULL, then allocate immediately. This may push the
    quota over-limit, at which point reclamation will kick in.
    If optional_on_done is non-NULL, it will be scheduled when the allocation has
    been granted by the quota. */
-void grpc_resource_user_alloc(grpc_exec_ctx *exec_ctx,
-                              grpc_resource_user *resource_user, size_t size,
-                              grpc_closure *optional_on_done);
+void grpc_resource_user_alloc(grpc_exec_ctx* exec_ctx,
+                              grpc_resource_user* resource_user, size_t size,
+                              grpc_closure* optional_on_done);
 /* Release memory back to the quota */
-void grpc_resource_user_free(grpc_exec_ctx *exec_ctx,
-                             grpc_resource_user *resource_user, size_t size);
+void grpc_resource_user_free(grpc_exec_ctx* exec_ctx,
+                             grpc_resource_user* resource_user, size_t size);
 /* Post a memory reclaimer to the resource user. Only one benign and one
    destructive reclaimer can be posted at once. When executed, the reclaimer
    MUST call grpc_resource_user_finish_reclamation before it completes, to
    return control to the resource quota. */
-void grpc_resource_user_post_reclaimer(grpc_exec_ctx *exec_ctx,
-                                       grpc_resource_user *resource_user,
-                                       bool destructive, grpc_closure *closure);
+void grpc_resource_user_post_reclaimer(grpc_exec_ctx* exec_ctx,
+                                       grpc_resource_user* resource_user,
+                                       bool destructive, grpc_closure* closure);
 /* Finish a reclamation step */
-void grpc_resource_user_finish_reclamation(grpc_exec_ctx *exec_ctx,
-                                           grpc_resource_user *resource_user);
+void grpc_resource_user_finish_reclamation(grpc_exec_ctx* exec_ctx,
+                                           grpc_resource_user* resource_user);
 
 /* Helper to allocate slices from a resource user */
 typedef struct grpc_resource_user_slice_allocator {
@@ -131,27 +131,27 @@
   /* Number of slices to allocate on the current request */
   size_t count;
   /* Destination for slices to allocate on the current request */
-  grpc_slice_buffer *dest;
+  grpc_slice_buffer* dest;
   /* Parent resource user */
-  grpc_resource_user *resource_user;
+  grpc_resource_user* resource_user;
 } grpc_resource_user_slice_allocator;
 
 /* Initialize a slice allocator.
    When an allocation is completed, calls \a cb with arg \p. */
 void grpc_resource_user_slice_allocator_init(
-    grpc_resource_user_slice_allocator *slice_allocator,
-    grpc_resource_user *resource_user, grpc_iomgr_cb_func cb, void *p);
+    grpc_resource_user_slice_allocator* slice_allocator,
+    grpc_resource_user* resource_user, grpc_iomgr_cb_func cb, void* p);
 
 /* Allocate \a count slices of length \a length into \a dest. Only one request
    can be outstanding at a time. */
 void grpc_resource_user_alloc_slices(
-    grpc_exec_ctx *exec_ctx,
-    grpc_resource_user_slice_allocator *slice_allocator, size_t length,
-    size_t count, grpc_slice_buffer *dest);
+    grpc_exec_ctx* exec_ctx,
+    grpc_resource_user_slice_allocator* slice_allocator, size_t length,
+    size_t count, grpc_slice_buffer* dest);
 
 /* Allocate one slice of length \a size synchronously. */
-grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx *exec_ctx,
-                                           grpc_resource_user *resource_user,
+grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx* exec_ctx,
+                                           grpc_resource_user* resource_user,
                                            size_t size);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/iomgr/sockaddr_utils.cc b/src/core/lib/iomgr/sockaddr_utils.cc
index 8a2e6ed..2dbc5aa 100644
--- a/src/core/lib/iomgr/sockaddr_utils.cc
+++ b/src/core/lib/iomgr/sockaddr_utils.cc
@@ -36,16 +36,16 @@
 static const uint8_t kV4MappedPrefix[] = {0, 0, 0, 0, 0,    0,
                                           0, 0, 0, 0, 0xff, 0xff};
 
-int grpc_sockaddr_is_v4mapped(const grpc_resolved_address *resolved_addr,
-                              grpc_resolved_address *resolved_addr4_out) {
+int grpc_sockaddr_is_v4mapped(const grpc_resolved_address* resolved_addr,
+                              grpc_resolved_address* resolved_addr4_out) {
   GPR_ASSERT(resolved_addr != resolved_addr4_out);
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
-  struct sockaddr_in *addr4_out =
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
+  struct sockaddr_in* addr4_out =
       resolved_addr4_out == NULL
           ? NULL
-          : (struct sockaddr_in *)resolved_addr4_out->addr;
+          : (struct sockaddr_in*)resolved_addr4_out->addr;
   if (addr->sa_family == AF_INET6) {
-    const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr;
+    const struct sockaddr_in6* addr6 = (const struct sockaddr_in6*)addr;
     if (memcmp(addr6->sin6_addr.s6_addr, kV4MappedPrefix,
                sizeof(kV4MappedPrefix)) == 0) {
       if (resolved_addr4_out != NULL) {
@@ -63,14 +63,14 @@
   return 0;
 }
 
-int grpc_sockaddr_to_v4mapped(const grpc_resolved_address *resolved_addr,
-                              grpc_resolved_address *resolved_addr6_out) {
+int grpc_sockaddr_to_v4mapped(const grpc_resolved_address* resolved_addr,
+                              grpc_resolved_address* resolved_addr6_out) {
   GPR_ASSERT(resolved_addr != resolved_addr6_out);
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
-  struct sockaddr_in6 *addr6_out =
-      (struct sockaddr_in6 *)resolved_addr6_out->addr;
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
+  struct sockaddr_in6* addr6_out =
+      (struct sockaddr_in6*)resolved_addr6_out->addr;
   if (addr->sa_family == AF_INET) {
-    const struct sockaddr_in *addr4 = (const struct sockaddr_in *)addr;
+    const struct sockaddr_in* addr4 = (const struct sockaddr_in*)addr;
     memset(resolved_addr6_out, 0, sizeof(*resolved_addr6_out));
     addr6_out->sin6_family = AF_INET6;
     memcpy(&addr6_out->sin6_addr.s6_addr[0], kV4MappedPrefix, 12);
@@ -82,17 +82,17 @@
   return 0;
 }
 
-int grpc_sockaddr_is_wildcard(const grpc_resolved_address *resolved_addr,
-                              int *port_out) {
-  const struct sockaddr *addr;
+int grpc_sockaddr_is_wildcard(const grpc_resolved_address* resolved_addr,
+                              int* port_out) {
+  const struct sockaddr* addr;
   grpc_resolved_address addr4_normalized;
   if (grpc_sockaddr_is_v4mapped(resolved_addr, &addr4_normalized)) {
     resolved_addr = &addr4_normalized;
   }
-  addr = (const struct sockaddr *)resolved_addr->addr;
+  addr = (const struct sockaddr*)resolved_addr->addr;
   if (addr->sa_family == AF_INET) {
     /* Check for 0.0.0.0 */
-    const struct sockaddr_in *addr4 = (const struct sockaddr_in *)addr;
+    const struct sockaddr_in* addr4 = (const struct sockaddr_in*)addr;
     if (addr4->sin_addr.s_addr != 0) {
       return 0;
     }
@@ -100,7 +100,7 @@
     return 1;
   } else if (addr->sa_family == AF_INET6) {
     /* Check for :: */
-    const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr;
+    const struct sockaddr_in6* addr6 = (const struct sockaddr_in6*)addr;
     int i;
     for (i = 0; i < 16; i++) {
       if (addr6->sin6_addr.s6_addr[i] != 0) {
@@ -114,15 +114,15 @@
   }
 }
 
-void grpc_sockaddr_make_wildcards(int port, grpc_resolved_address *wild4_out,
-                                  grpc_resolved_address *wild6_out) {
+void grpc_sockaddr_make_wildcards(int port, grpc_resolved_address* wild4_out,
+                                  grpc_resolved_address* wild6_out) {
   grpc_sockaddr_make_wildcard4(port, wild4_out);
   grpc_sockaddr_make_wildcard6(port, wild6_out);
 }
 
 void grpc_sockaddr_make_wildcard4(int port,
-                                  grpc_resolved_address *resolved_wild_out) {
-  struct sockaddr_in *wild_out = (struct sockaddr_in *)resolved_wild_out->addr;
+                                  grpc_resolved_address* resolved_wild_out) {
+  struct sockaddr_in* wild_out = (struct sockaddr_in*)resolved_wild_out->addr;
   GPR_ASSERT(port >= 0 && port < 65536);
   memset(resolved_wild_out, 0, sizeof(*resolved_wild_out));
   wild_out->sin_family = AF_INET;
@@ -131,9 +131,8 @@
 }
 
 void grpc_sockaddr_make_wildcard6(int port,
-                                  grpc_resolved_address *resolved_wild_out) {
-  struct sockaddr_in6 *wild_out =
-      (struct sockaddr_in6 *)resolved_wild_out->addr;
+                                  grpc_resolved_address* resolved_wild_out) {
+  struct sockaddr_in6* wild_out = (struct sockaddr_in6*)resolved_wild_out->addr;
   GPR_ASSERT(port >= 0 && port < 65536);
   memset(resolved_wild_out, 0, sizeof(*resolved_wild_out));
   wild_out->sin6_family = AF_INET6;
@@ -141,14 +140,14 @@
   resolved_wild_out->len = sizeof(struct sockaddr_in6);
 }
 
-int grpc_sockaddr_to_string(char **out,
-                            const grpc_resolved_address *resolved_addr,
+int grpc_sockaddr_to_string(char** out,
+                            const grpc_resolved_address* resolved_addr,
                             int normalize) {
-  const struct sockaddr *addr;
+  const struct sockaddr* addr;
   const int save_errno = errno;
   grpc_resolved_address addr_normalized;
   char ntop_buf[INET6_ADDRSTRLEN];
-  const void *ip = NULL;
+  const void* ip = NULL;
   int port;
   uint32_t sin6_scope_id = 0;
   int ret;
@@ -157,13 +156,13 @@
   if (normalize && grpc_sockaddr_is_v4mapped(resolved_addr, &addr_normalized)) {
     resolved_addr = &addr_normalized;
   }
-  addr = (const struct sockaddr *)resolved_addr->addr;
+  addr = (const struct sockaddr*)resolved_addr->addr;
   if (addr->sa_family == AF_INET) {
-    const struct sockaddr_in *addr4 = (const struct sockaddr_in *)addr;
+    const struct sockaddr_in* addr4 = (const struct sockaddr_in*)addr;
     ip = &addr4->sin_addr;
     port = ntohs(addr4->sin_port);
   } else if (addr->sa_family == AF_INET6) {
-    const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr;
+    const struct sockaddr_in6* addr6 = (const struct sockaddr_in6*)addr;
     ip = &addr6->sin6_addr;
     port = ntohs(addr6->sin6_port);
     sin6_scope_id = addr6->sin6_scope_id;
@@ -171,7 +170,7 @@
   if (ip != NULL &&
       grpc_inet_ntop(addr->sa_family, ip, ntop_buf, sizeof(ntop_buf)) != NULL) {
     if (sin6_scope_id != 0) {
-      char *host_with_scope;
+      char* host_with_scope;
       /* Enclose sin6_scope_id with the format defined in RFC 6784 section 2. */
       gpr_asprintf(&host_with_scope, "%s%%25%" PRIu32, ntop_buf, sin6_scope_id);
       ret = gpr_join_host_port(out, host_with_scope, port);
@@ -187,17 +186,17 @@
   return ret;
 }
 
-char *grpc_sockaddr_to_uri(const grpc_resolved_address *resolved_addr) {
+char* grpc_sockaddr_to_uri(const grpc_resolved_address* resolved_addr) {
   grpc_resolved_address addr_normalized;
   if (grpc_sockaddr_is_v4mapped(resolved_addr, &addr_normalized)) {
     resolved_addr = &addr_normalized;
   }
-  const char *scheme = grpc_sockaddr_get_uri_scheme(resolved_addr);
+  const char* scheme = grpc_sockaddr_get_uri_scheme(resolved_addr);
   if (scheme == NULL || strcmp("unix", scheme) == 0) {
     return grpc_sockaddr_to_uri_unix_if_possible(resolved_addr);
   }
-  char *path = NULL;
-  char *uri_str = NULL;
+  char* path = NULL;
+  char* uri_str = NULL;
   if (grpc_sockaddr_to_string(&path, resolved_addr,
                               false /* suppress errors */) &&
       scheme != NULL) {
@@ -207,9 +206,9 @@
   return uri_str != NULL ? uri_str : NULL;
 }
 
-const char *grpc_sockaddr_get_uri_scheme(
-    const grpc_resolved_address *resolved_addr) {
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
+const char* grpc_sockaddr_get_uri_scheme(
+    const grpc_resolved_address* resolved_addr) {
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
   switch (addr->sa_family) {
     case AF_INET:
       return "ipv4";
@@ -221,18 +220,18 @@
   return NULL;
 }
 
-int grpc_sockaddr_get_family(const grpc_resolved_address *resolved_addr) {
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
+int grpc_sockaddr_get_family(const grpc_resolved_address* resolved_addr) {
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
   return addr->sa_family;
 }
 
-int grpc_sockaddr_get_port(const grpc_resolved_address *resolved_addr) {
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
+int grpc_sockaddr_get_port(const grpc_resolved_address* resolved_addr) {
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
   switch (addr->sa_family) {
     case AF_INET:
-      return ntohs(((struct sockaddr_in *)addr)->sin_port);
+      return ntohs(((struct sockaddr_in*)addr)->sin_port);
     case AF_INET6:
-      return ntohs(((struct sockaddr_in6 *)addr)->sin6_port);
+      return ntohs(((struct sockaddr_in6*)addr)->sin6_port);
     default:
       if (grpc_is_unix_socket(resolved_addr)) {
         return 1;
@@ -243,17 +242,17 @@
   }
 }
 
-int grpc_sockaddr_set_port(const grpc_resolved_address *resolved_addr,
+int grpc_sockaddr_set_port(const grpc_resolved_address* resolved_addr,
                            int port) {
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
   switch (addr->sa_family) {
     case AF_INET:
       GPR_ASSERT(port >= 0 && port < 65536);
-      ((struct sockaddr_in *)addr)->sin_port = htons((uint16_t)port);
+      ((struct sockaddr_in*)addr)->sin_port = htons((uint16_t)port);
       return 1;
     case AF_INET6:
       GPR_ASSERT(port >= 0 && port < 65536);
-      ((struct sockaddr_in6 *)addr)->sin6_port = htons((uint16_t)port);
+      ((struct sockaddr_in6*)addr)->sin6_port = htons((uint16_t)port);
       return 1;
     default:
       gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_set_port",
diff --git a/src/core/lib/iomgr/sockaddr_utils.h b/src/core/lib/iomgr/sockaddr_utils.h
index 1fd552f..090470d 100644
--- a/src/core/lib/iomgr/sockaddr_utils.h
+++ b/src/core/lib/iomgr/sockaddr_utils.h
@@ -30,33 +30,33 @@
 
    If addr4_out is non-NULL, the inner IPv4 address will be copied here when
    returning true. */
-int grpc_sockaddr_is_v4mapped(const grpc_resolved_address *addr,
-                              grpc_resolved_address *addr4_out);
+int grpc_sockaddr_is_v4mapped(const grpc_resolved_address* addr,
+                              grpc_resolved_address* addr4_out);
 
 /* If addr is an AF_INET address, writes the corresponding ::ffff:0.0.0.0/96
    address to addr6_out and returns true.  Otherwise returns false. */
-int grpc_sockaddr_to_v4mapped(const grpc_resolved_address *addr,
-                              grpc_resolved_address *addr6_out);
+int grpc_sockaddr_to_v4mapped(const grpc_resolved_address* addr,
+                              grpc_resolved_address* addr6_out);
 
 /* If addr is ::, 0.0.0.0, or ::ffff:0.0.0.0, writes the port number to
  *port_out (if not NULL) and returns true, otherwise returns false. */
-int grpc_sockaddr_is_wildcard(const grpc_resolved_address *addr, int *port_out);
+int grpc_sockaddr_is_wildcard(const grpc_resolved_address* addr, int* port_out);
 
 /* Writes 0.0.0.0:port and [::]:port to separate sockaddrs. */
-void grpc_sockaddr_make_wildcards(int port, grpc_resolved_address *wild4_out,
-                                  grpc_resolved_address *wild6_out);
+void grpc_sockaddr_make_wildcards(int port, grpc_resolved_address* wild4_out,
+                                  grpc_resolved_address* wild6_out);
 
 /* Writes 0.0.0.0:port. */
-void grpc_sockaddr_make_wildcard4(int port, grpc_resolved_address *wild_out);
+void grpc_sockaddr_make_wildcard4(int port, grpc_resolved_address* wild_out);
 
 /* Writes [::]:port. */
-void grpc_sockaddr_make_wildcard6(int port, grpc_resolved_address *wild_out);
+void grpc_sockaddr_make_wildcard6(int port, grpc_resolved_address* wild_out);
 
 /* Return the IP port number of a sockaddr */
-int grpc_sockaddr_get_port(const grpc_resolved_address *addr);
+int grpc_sockaddr_get_port(const grpc_resolved_address* addr);
 
 /* Set IP port number of a sockaddr */
-int grpc_sockaddr_set_port(const grpc_resolved_address *addr, int port);
+int grpc_sockaddr_set_port(const grpc_resolved_address* addr, int port);
 
 /* Converts a sockaddr into a newly-allocated human-readable string.
 
@@ -70,16 +70,16 @@
 
    In the unlikely event of an error, returns -1 and sets *out to NULL.
    The existing value of errno is always preserved. */
-int grpc_sockaddr_to_string(char **out, const grpc_resolved_address *addr,
+int grpc_sockaddr_to_string(char** out, const grpc_resolved_address* addr,
                             int normalize);
 
 /* Returns the URI string corresponding to \a addr */
-char *grpc_sockaddr_to_uri(const grpc_resolved_address *addr);
+char* grpc_sockaddr_to_uri(const grpc_resolved_address* addr);
 
 /* Returns the URI scheme corresponding to \a addr */
-const char *grpc_sockaddr_get_uri_scheme(const grpc_resolved_address *addr);
+const char* grpc_sockaddr_get_uri_scheme(const grpc_resolved_address* addr);
 
-int grpc_sockaddr_get_family(const grpc_resolved_address *resolved_addr);
+int grpc_sockaddr_get_family(const grpc_resolved_address* resolved_addr);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/socket_factory_posix.cc b/src/core/lib/iomgr/socket_factory_posix.cc
index 8e90770..40bfecd 100644
--- a/src/core/lib/iomgr/socket_factory_posix.cc
+++ b/src/core/lib/iomgr/socket_factory_posix.cc
@@ -27,28 +27,28 @@
 #include <grpc/support/sync.h>
 #include <grpc/support/useful.h>
 
-void grpc_socket_factory_init(grpc_socket_factory *factory,
-                              const grpc_socket_factory_vtable *vtable) {
+void grpc_socket_factory_init(grpc_socket_factory* factory,
+                              const grpc_socket_factory_vtable* vtable) {
   factory->vtable = vtable;
   gpr_ref_init(&factory->refcount, 1);
 }
 
-int grpc_socket_factory_socket(grpc_socket_factory *factory, int domain,
+int grpc_socket_factory_socket(grpc_socket_factory* factory, int domain,
                                int type, int protocol) {
   return factory->vtable->socket(factory, domain, type, protocol);
 }
 
-int grpc_socket_factory_bind(grpc_socket_factory *factory, int sockfd,
-                             const grpc_resolved_address *addr) {
+int grpc_socket_factory_bind(grpc_socket_factory* factory, int sockfd,
+                             const grpc_resolved_address* addr) {
   return factory->vtable->bind(factory, sockfd, addr);
 }
 
-int grpc_socket_factory_compare(grpc_socket_factory *a,
-                                grpc_socket_factory *b) {
+int grpc_socket_factory_compare(grpc_socket_factory* a,
+                                grpc_socket_factory* b) {
   int c = GPR_ICMP(a, b);
   if (c != 0) {
-    grpc_socket_factory *sma = a;
-    grpc_socket_factory *smb = b;
+    grpc_socket_factory* sma = a;
+    grpc_socket_factory* smb = b;
     c = GPR_ICMP(sma->vtable, smb->vtable);
     if (c == 0) {
       c = sma->vtable->compare(sma, smb);
@@ -57,35 +57,35 @@
   return c;
 }
 
-grpc_socket_factory *grpc_socket_factory_ref(grpc_socket_factory *factory) {
+grpc_socket_factory* grpc_socket_factory_ref(grpc_socket_factory* factory) {
   gpr_ref(&factory->refcount);
   return factory;
 }
 
-void grpc_socket_factory_unref(grpc_socket_factory *factory) {
+void grpc_socket_factory_unref(grpc_socket_factory* factory) {
   if (gpr_unref(&factory->refcount)) {
     factory->vtable->destroy(factory);
   }
 }
 
-static void *socket_factory_arg_copy(void *p) {
-  return grpc_socket_factory_ref((grpc_socket_factory *)p);
+static void* socket_factory_arg_copy(void* p) {
+  return grpc_socket_factory_ref((grpc_socket_factory*)p);
 }
 
-static void socket_factory_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
-  grpc_socket_factory_unref((grpc_socket_factory *)p);
+static void socket_factory_arg_destroy(grpc_exec_ctx* exec_ctx, void* p) {
+  grpc_socket_factory_unref((grpc_socket_factory*)p);
 }
 
-static int socket_factory_cmp(void *a, void *b) {
-  return grpc_socket_factory_compare((grpc_socket_factory *)a,
-                                     (grpc_socket_factory *)b);
+static int socket_factory_cmp(void* a, void* b) {
+  return grpc_socket_factory_compare((grpc_socket_factory*)a,
+                                     (grpc_socket_factory*)b);
 }
 
 static const grpc_arg_pointer_vtable socket_factory_arg_vtable = {
     socket_factory_arg_copy, socket_factory_arg_destroy, socket_factory_cmp};
 
-grpc_arg grpc_socket_factory_to_arg(grpc_socket_factory *factory) {
-  return grpc_channel_arg_pointer_create((char *)GRPC_ARG_SOCKET_FACTORY,
+grpc_arg grpc_socket_factory_to_arg(grpc_socket_factory* factory) {
+  return grpc_channel_arg_pointer_create((char*)GRPC_ARG_SOCKET_FACTORY,
                                          factory, &socket_factory_arg_vtable);
 }
 
diff --git a/src/core/lib/iomgr/socket_factory_posix.h b/src/core/lib/iomgr/socket_factory_posix.h
index a46938b..e8257b0 100644
--- a/src/core/lib/iomgr/socket_factory_posix.h
+++ b/src/core/lib/iomgr/socket_factory_posix.h
@@ -30,43 +30,43 @@
 /** The virtual table of grpc_socket_factory */
 typedef struct {
   /** Replacement for socket(2) */
-  int (*socket)(grpc_socket_factory *factory, int domain, int type,
+  int (*socket)(grpc_socket_factory* factory, int domain, int type,
                 int protocol);
   /** Replacement for bind(2) */
-  int (*bind)(grpc_socket_factory *factory, int sockfd,
-              const grpc_resolved_address *addr);
+  int (*bind)(grpc_socket_factory* factory, int sockfd,
+              const grpc_resolved_address* addr);
   /** Compare socket factory \a a and \a b */
-  int (*compare)(grpc_socket_factory *a, grpc_socket_factory *b);
+  int (*compare)(grpc_socket_factory* a, grpc_socket_factory* b);
   /** Destroys the socket factory instance */
-  void (*destroy)(grpc_socket_factory *factory);
+  void (*destroy)(grpc_socket_factory* factory);
 } grpc_socket_factory_vtable;
 
 /** The Socket Factory interface allows changes on socket options */
 struct grpc_socket_factory {
-  const grpc_socket_factory_vtable *vtable;
+  const grpc_socket_factory_vtable* vtable;
   gpr_refcount refcount;
 };
 
 /** called by concrete implementations to initialize the base struct */
-void grpc_socket_factory_init(grpc_socket_factory *factory,
-                              const grpc_socket_factory_vtable *vtable);
+void grpc_socket_factory_init(grpc_socket_factory* factory,
+                              const grpc_socket_factory_vtable* vtable);
 
 /** Wrap \a factory as a grpc_arg */
-grpc_arg grpc_socket_factory_to_arg(grpc_socket_factory *factory);
+grpc_arg grpc_socket_factory_to_arg(grpc_socket_factory* factory);
 
 /** Perform the equivalent of a socket(2) operation using \a factory */
-int grpc_socket_factory_socket(grpc_socket_factory *factory, int domain,
+int grpc_socket_factory_socket(grpc_socket_factory* factory, int domain,
                                int type, int protocol);
 
 /** Perform the equivalent of a bind(2) operation using \a factory */
-int grpc_socket_factory_bind(grpc_socket_factory *factory, int sockfd,
-                             const grpc_resolved_address *addr);
+int grpc_socket_factory_bind(grpc_socket_factory* factory, int sockfd,
+                             const grpc_resolved_address* addr);
 
 /** Compare if \a a and \a b are the same factory or have same settings */
-int grpc_socket_factory_compare(grpc_socket_factory *a, grpc_socket_factory *b);
+int grpc_socket_factory_compare(grpc_socket_factory* a, grpc_socket_factory* b);
 
-grpc_socket_factory *grpc_socket_factory_ref(grpc_socket_factory *factory);
-void grpc_socket_factory_unref(grpc_socket_factory *factory);
+grpc_socket_factory* grpc_socket_factory_ref(grpc_socket_factory* factory);
+void grpc_socket_factory_unref(grpc_socket_factory* factory);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/socket_mutator.cc b/src/core/lib/iomgr/socket_mutator.cc
index b0435d5..ff6c0c7 100644
--- a/src/core/lib/iomgr/socket_mutator.cc
+++ b/src/core/lib/iomgr/socket_mutator.cc
@@ -24,27 +24,27 @@
 #include <grpc/support/sync.h>
 #include <grpc/support/useful.h>
 
-void grpc_socket_mutator_init(grpc_socket_mutator *mutator,
-                              const grpc_socket_mutator_vtable *vtable) {
+void grpc_socket_mutator_init(grpc_socket_mutator* mutator,
+                              const grpc_socket_mutator_vtable* vtable) {
   mutator->vtable = vtable;
   gpr_ref_init(&mutator->refcount, 1);
 }
 
-grpc_socket_mutator *grpc_socket_mutator_ref(grpc_socket_mutator *mutator) {
+grpc_socket_mutator* grpc_socket_mutator_ref(grpc_socket_mutator* mutator) {
   gpr_ref(&mutator->refcount);
   return mutator;
 }
 
-bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator *mutator, int fd) {
+bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd) {
   return mutator->vtable->mutate_fd(fd, mutator);
 }
 
-int grpc_socket_mutator_compare(grpc_socket_mutator *a,
-                                grpc_socket_mutator *b) {
+int grpc_socket_mutator_compare(grpc_socket_mutator* a,
+                                grpc_socket_mutator* b) {
   int c = GPR_ICMP(a, b);
   if (c != 0) {
-    grpc_socket_mutator *sma = a;
-    grpc_socket_mutator *smb = b;
+    grpc_socket_mutator* sma = a;
+    grpc_socket_mutator* smb = b;
     c = GPR_ICMP(sma->vtable, smb->vtable);
     if (c == 0) {
       c = sma->vtable->compare(sma, smb);
@@ -53,29 +53,29 @@
   return c;
 }
 
-void grpc_socket_mutator_unref(grpc_socket_mutator *mutator) {
+void grpc_socket_mutator_unref(grpc_socket_mutator* mutator) {
   if (gpr_unref(&mutator->refcount)) {
     mutator->vtable->destory(mutator);
   }
 }
 
-static void *socket_mutator_arg_copy(void *p) {
-  return grpc_socket_mutator_ref((grpc_socket_mutator *)p);
+static void* socket_mutator_arg_copy(void* p) {
+  return grpc_socket_mutator_ref((grpc_socket_mutator*)p);
 }
 
-static void socket_mutator_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
-  grpc_socket_mutator_unref((grpc_socket_mutator *)p);
+static void socket_mutator_arg_destroy(grpc_exec_ctx* exec_ctx, void* p) {
+  grpc_socket_mutator_unref((grpc_socket_mutator*)p);
 }
 
-static int socket_mutator_cmp(void *a, void *b) {
-  return grpc_socket_mutator_compare((grpc_socket_mutator *)a,
-                                     (grpc_socket_mutator *)b);
+static int socket_mutator_cmp(void* a, void* b) {
+  return grpc_socket_mutator_compare((grpc_socket_mutator*)a,
+                                     (grpc_socket_mutator*)b);
 }
 
 static const grpc_arg_pointer_vtable socket_mutator_arg_vtable = {
     socket_mutator_arg_copy, socket_mutator_arg_destroy, socket_mutator_cmp};
 
-grpc_arg grpc_socket_mutator_to_arg(grpc_socket_mutator *mutator) {
-  return grpc_channel_arg_pointer_create((char *)GRPC_ARG_SOCKET_MUTATOR,
+grpc_arg grpc_socket_mutator_to_arg(grpc_socket_mutator* mutator) {
+  return grpc_channel_arg_pointer_create((char*)GRPC_ARG_SOCKET_MUTATOR,
                                          mutator, &socket_mutator_arg_vtable);
 }
diff --git a/src/core/lib/iomgr/socket_mutator.h b/src/core/lib/iomgr/socket_mutator.h
index ba956e1..b4103f7 100644
--- a/src/core/lib/iomgr/socket_mutator.h
+++ b/src/core/lib/iomgr/socket_mutator.h
@@ -31,34 +31,34 @@
 /** The virtual table of grpc_socket_mutator */
 typedef struct {
   /** Mutates the socket opitons of \a fd */
-  bool (*mutate_fd)(int fd, grpc_socket_mutator *mutator);
+  bool (*mutate_fd)(int fd, grpc_socket_mutator* mutator);
   /** Compare socket mutator \a a and \a b */
-  int (*compare)(grpc_socket_mutator *a, grpc_socket_mutator *b);
+  int (*compare)(grpc_socket_mutator* a, grpc_socket_mutator* b);
   /** Destroys the socket mutator instance */
-  void (*destory)(grpc_socket_mutator *mutator);
+  void (*destory)(grpc_socket_mutator* mutator);
 } grpc_socket_mutator_vtable;
 
 /** The Socket Mutator interface allows changes on socket options */
 struct grpc_socket_mutator {
-  const grpc_socket_mutator_vtable *vtable;
+  const grpc_socket_mutator_vtable* vtable;
   gpr_refcount refcount;
 };
 
 /** called by concrete implementations to initialize the base struct */
-void grpc_socket_mutator_init(grpc_socket_mutator *mutator,
-                              const grpc_socket_mutator_vtable *vtable);
+void grpc_socket_mutator_init(grpc_socket_mutator* mutator,
+                              const grpc_socket_mutator_vtable* vtable);
 
 /** Wrap \a mutator as a grpc_arg */
-grpc_arg grpc_socket_mutator_to_arg(grpc_socket_mutator *mutator);
+grpc_arg grpc_socket_mutator_to_arg(grpc_socket_mutator* mutator);
 
 /** Perform the file descriptor mutation operation of \a mutator on \a fd */
-bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator *mutator, int fd);
+bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd);
 
 /** Compare if \a a and \a b are the same mutator or have same settings */
-int grpc_socket_mutator_compare(grpc_socket_mutator *a, grpc_socket_mutator *b);
+int grpc_socket_mutator_compare(grpc_socket_mutator* a, grpc_socket_mutator* b);
 
-grpc_socket_mutator *grpc_socket_mutator_ref(grpc_socket_mutator *mutator);
-void grpc_socket_mutator_unref(grpc_socket_mutator *mutator);
+grpc_socket_mutator* grpc_socket_mutator_ref(grpc_socket_mutator* mutator);
+void grpc_socket_mutator_unref(grpc_socket_mutator* mutator);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/socket_utils.h b/src/core/lib/iomgr/socket_utils.h
index d6c538e..4816ab6 100644
--- a/src/core/lib/iomgr/socket_utils.h
+++ b/src/core/lib/iomgr/socket_utils.h
@@ -26,7 +26,7 @@
 #endif
 
 /* A wrapper for inet_ntop on POSIX systems and InetNtop on Windows systems */
-const char *grpc_inet_ntop(int af, const void *src, char *dst, size_t size);
+const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/socket_utils_common_posix.cc b/src/core/lib/iomgr/socket_utils_common_posix.cc
index b8e2a0c..88b757a 100644
--- a/src/core/lib/iomgr/socket_utils_common_posix.cc
+++ b/src/core/lib/iomgr/socket_utils_common_posix.cc
@@ -44,7 +44,7 @@
 #include "src/core/lib/support/string.h"
 
 /* set a socket to non blocking mode */
-grpc_error *grpc_set_socket_nonblocking(int fd, int non_blocking) {
+grpc_error* grpc_set_socket_nonblocking(int fd, int non_blocking) {
   int oldflags = fcntl(fd, F_GETFL, 0);
   if (oldflags < 0) {
     return GRPC_OS_ERROR(errno, "fcntl");
@@ -63,7 +63,7 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_set_socket_no_sigpipe_if_possible(int fd) {
+grpc_error* grpc_set_socket_no_sigpipe_if_possible(int fd) {
 #ifdef GRPC_HAVE_SO_NOSIGPIPE
   int val = 1;
   int newval;
@@ -81,7 +81,7 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_set_socket_ip_pktinfo_if_possible(int fd) {
+grpc_error* grpc_set_socket_ip_pktinfo_if_possible(int fd) {
 #ifdef GRPC_HAVE_IP_PKTINFO
   int get_local_ip = 1;
   if (0 != setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &get_local_ip,
@@ -92,7 +92,7 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
+grpc_error* grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
 #ifdef GRPC_HAVE_IPV6_RECVPKTINFO
   int get_local_ip = 1;
   if (0 != setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &get_local_ip,
@@ -103,14 +103,14 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_set_socket_sndbuf(int fd, int buffer_size_bytes) {
+grpc_error* grpc_set_socket_sndbuf(int fd, int buffer_size_bytes) {
   return 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &buffer_size_bytes,
                          sizeof(buffer_size_bytes))
              ? GRPC_ERROR_NONE
              : GRPC_OS_ERROR(errno, "setsockopt(SO_SNDBUF)");
 }
 
-grpc_error *grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes) {
+grpc_error* grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes) {
   return 0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &buffer_size_bytes,
                          sizeof(buffer_size_bytes))
              ? GRPC_ERROR_NONE
@@ -118,7 +118,7 @@
 }
 
 /* set a socket to close on exec */
-grpc_error *grpc_set_socket_cloexec(int fd, int close_on_exec) {
+grpc_error* grpc_set_socket_cloexec(int fd, int close_on_exec) {
   int oldflags = fcntl(fd, F_GETFD, 0);
   if (oldflags < 0) {
     return GRPC_OS_ERROR(errno, "fcntl");
@@ -138,7 +138,7 @@
 }
 
 /* set a socket to reuse old addresses */
-grpc_error *grpc_set_socket_reuse_addr(int fd, int reuse) {
+grpc_error* grpc_set_socket_reuse_addr(int fd, int reuse) {
   int val = (reuse != 0);
   int newval;
   socklen_t intlen = sizeof(newval);
@@ -156,7 +156,7 @@
 }
 
 /* set a socket to reuse old addresses */
-grpc_error *grpc_set_socket_reuse_port(int fd, int reuse) {
+grpc_error* grpc_set_socket_reuse_port(int fd, int reuse) {
 #ifndef SO_REUSEPORT
   return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
       "SO_REUSEPORT unavailable on compiling system");
@@ -179,7 +179,7 @@
 }
 
 /* disable nagle */
-grpc_error *grpc_set_socket_low_latency(int fd, int low_latency) {
+grpc_error* grpc_set_socket_low_latency(int fd, int low_latency) {
   int val = (low_latency != 0);
   int newval;
   socklen_t intlen = sizeof(newval);
@@ -196,7 +196,7 @@
 }
 
 /* set a socket using a grpc_socket_mutator */
-grpc_error *grpc_set_socket_with_mutator(int fd, grpc_socket_mutator *mutator) {
+grpc_error* grpc_set_socket_with_mutator(int fd, grpc_socket_mutator* mutator) {
   GPR_ASSERT(mutator);
   if (!grpc_socket_mutator_mutate_fd(mutator, fd)) {
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING("grpc_socket_mutator failed.");
@@ -217,7 +217,7 @@
     memset(&addr, 0, sizeof(addr));
     addr.sin6_family = AF_INET6;
     addr.sin6_addr.s6_addr[15] = 1; /* [::1]:0 */
-    if (bind(fd, (struct sockaddr *)&addr, sizeof(addr)) == 0) {
+    if (bind(fd, (struct sockaddr*)&addr, sizeof(addr)) == 0) {
       g_ipv6_loopback_available = 1;
     } else {
       gpr_log(GPR_INFO,
@@ -249,35 +249,35 @@
   }
 }
 
-static grpc_error *error_for_fd(int fd, const grpc_resolved_address *addr) {
+static grpc_error* error_for_fd(int fd, const grpc_resolved_address* addr) {
   if (fd >= 0) return GRPC_ERROR_NONE;
-  char *addr_str;
+  char* addr_str;
   grpc_sockaddr_to_string(&addr_str, addr, 0);
-  grpc_error *err = grpc_error_set_str(GRPC_OS_ERROR(errno, "socket"),
+  grpc_error* err = grpc_error_set_str(GRPC_OS_ERROR(errno, "socket"),
                                        GRPC_ERROR_STR_TARGET_ADDRESS,
                                        grpc_slice_from_copied_string(addr_str));
   gpr_free(addr_str);
   return err;
 }
 
-grpc_error *grpc_create_dualstack_socket(
-    const grpc_resolved_address *resolved_addr, int type, int protocol,
-    grpc_dualstack_mode *dsmode, int *newfd) {
+grpc_error* grpc_create_dualstack_socket(
+    const grpc_resolved_address* resolved_addr, int type, int protocol,
+    grpc_dualstack_mode* dsmode, int* newfd) {
   return grpc_create_dualstack_socket_using_factory(NULL, resolved_addr, type,
                                                     protocol, dsmode, newfd);
 }
 
-static int create_socket(grpc_socket_factory *factory, int domain, int type,
+static int create_socket(grpc_socket_factory* factory, int domain, int type,
                          int protocol) {
   return (factory != NULL)
              ? grpc_socket_factory_socket(factory, domain, type, protocol)
              : socket(domain, type, protocol);
 }
 
-grpc_error *grpc_create_dualstack_socket_using_factory(
-    grpc_socket_factory *factory, const grpc_resolved_address *resolved_addr,
-    int type, int protocol, grpc_dualstack_mode *dsmode, int *newfd) {
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
+grpc_error* grpc_create_dualstack_socket_using_factory(
+    grpc_socket_factory* factory, const grpc_resolved_address* resolved_addr,
+    int type, int protocol, grpc_dualstack_mode* dsmode, int* newfd) {
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
   int family = addr->sa_family;
   if (family == AF_INET6) {
     if (grpc_ipv6_loopback_available()) {
@@ -307,7 +307,7 @@
   return error_for_fd(*newfd, resolved_addr);
 }
 
-const char *grpc_inet_ntop(int af, const void *src, char *dst, size_t size) {
+const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) {
   GPR_ASSERT(size <= (socklen_t)-1);
   return inet_ntop(af, src, dst, (socklen_t)size);
 }
diff --git a/src/core/lib/iomgr/socket_utils_linux.cc b/src/core/lib/iomgr/socket_utils_linux.cc
index e7b094d..12199c5 100644
--- a/src/core/lib/iomgr/socket_utils_linux.cc
+++ b/src/core/lib/iomgr/socket_utils_linux.cc
@@ -28,15 +28,15 @@
 #include <sys/socket.h>
 #include <sys/types.h>
 
-int grpc_accept4(int sockfd, grpc_resolved_address *resolved_addr, int nonblock,
+int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
                  int cloexec) {
   int flags = 0;
   GPR_ASSERT(sizeof(socklen_t) <= sizeof(size_t));
   GPR_ASSERT(resolved_addr->len <= (socklen_t)-1);
   flags |= nonblock ? SOCK_NONBLOCK : 0;
   flags |= cloexec ? SOCK_CLOEXEC : 0;
-  return accept4(sockfd, (struct sockaddr *)resolved_addr->addr,
-                 (socklen_t *)&resolved_addr->len, flags);
+  return accept4(sockfd, (struct sockaddr*)resolved_addr->addr,
+                 (socklen_t*)&resolved_addr->len, flags);
 }
 
 #endif
diff --git a/src/core/lib/iomgr/socket_utils_posix.cc b/src/core/lib/iomgr/socket_utils_posix.cc
index dfd1ffd..c49cbb2 100644
--- a/src/core/lib/iomgr/socket_utils_posix.cc
+++ b/src/core/lib/iomgr/socket_utils_posix.cc
@@ -29,13 +29,13 @@
 #include <grpc/support/log.h>
 #include "src/core/lib/iomgr/sockaddr.h"
 
-int grpc_accept4(int sockfd, grpc_resolved_address *resolved_addr, int nonblock,
+int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
                  int cloexec) {
   int fd, flags;
   GPR_ASSERT(sizeof(socklen_t) <= sizeof(size_t));
   GPR_ASSERT(resolved_addr->len <= (socklen_t)-1);
-  fd = accept(sockfd, (struct sockaddr *)resolved_addr->addr,
-              (socklen_t *)&resolved_addr->len);
+  fd = accept(sockfd, (struct sockaddr*)resolved_addr->addr,
+              (socklen_t*)&resolved_addr->len);
   if (fd >= 0) {
     if (nonblock) {
       flags = fcntl(fd, F_GETFL, 0);
diff --git a/src/core/lib/iomgr/socket_utils_posix.h b/src/core/lib/iomgr/socket_utils_posix.h
index 73809b6..7a9c813 100644
--- a/src/core/lib/iomgr/socket_utils_posix.h
+++ b/src/core/lib/iomgr/socket_utils_posix.h
@@ -34,23 +34,23 @@
 #endif
 
 /* a wrapper for accept or accept4 */
-int grpc_accept4(int sockfd, grpc_resolved_address *resolved_addr, int nonblock,
+int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
                  int cloexec);
 
 /* set a socket to non blocking mode */
-grpc_error *grpc_set_socket_nonblocking(int fd, int non_blocking);
+grpc_error* grpc_set_socket_nonblocking(int fd, int non_blocking);
 
 /* set a socket to close on exec */
-grpc_error *grpc_set_socket_cloexec(int fd, int close_on_exec);
+grpc_error* grpc_set_socket_cloexec(int fd, int close_on_exec);
 
 /* set a socket to reuse old addresses */
-grpc_error *grpc_set_socket_reuse_addr(int fd, int reuse);
+grpc_error* grpc_set_socket_reuse_addr(int fd, int reuse);
 
 /* disable nagle */
-grpc_error *grpc_set_socket_low_latency(int fd, int low_latency);
+grpc_error* grpc_set_socket_low_latency(int fd, int low_latency);
 
 /* set SO_REUSEPORT */
-grpc_error *grpc_set_socket_reuse_port(int fd, int reuse);
+grpc_error* grpc_set_socket_reuse_port(int fd, int reuse);
 
 /* Returns true if this system can create AF_INET6 sockets bound to ::1.
    The value is probed once, and cached for the life of the process.
@@ -64,24 +64,24 @@
 
 /* Tries to set SO_NOSIGPIPE if available on this platform.
    If SO_NO_SIGPIPE is not available, returns 1. */
-grpc_error *grpc_set_socket_no_sigpipe_if_possible(int fd);
+grpc_error* grpc_set_socket_no_sigpipe_if_possible(int fd);
 
 /* Tries to set IP_PKTINFO if available on this platform.
    If IP_PKTINFO is not available, returns 1. */
-grpc_error *grpc_set_socket_ip_pktinfo_if_possible(int fd);
+grpc_error* grpc_set_socket_ip_pktinfo_if_possible(int fd);
 
 /* Tries to set IPV6_RECVPKTINFO if available on this platform.
    If IPV6_RECVPKTINFO is not available, returns 1. */
-grpc_error *grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd);
+grpc_error* grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd);
 
 /* Tries to set the socket's send buffer to given size. */
-grpc_error *grpc_set_socket_sndbuf(int fd, int buffer_size_bytes);
+grpc_error* grpc_set_socket_sndbuf(int fd, int buffer_size_bytes);
 
 /* Tries to set the socket's receive buffer to given size. */
-grpc_error *grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes);
+grpc_error* grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes);
 
 /* Tries to set the socket using a grpc_socket_mutator */
-grpc_error *grpc_set_socket_with_mutator(int fd, grpc_socket_mutator *mutator);
+grpc_error* grpc_set_socket_with_mutator(int fd, grpc_socket_mutator* mutator);
 
 /* An enum to keep track of IPv4/IPv6 socket modes.
 
@@ -122,16 +122,16 @@
      IPv4, so that bind() or connect() see the correct family.
    Also, it's important to distinguish between DUALSTACK and IPV6 when
    listening on the [::] wildcard address. */
-grpc_error *grpc_create_dualstack_socket(const grpc_resolved_address *addr,
+grpc_error* grpc_create_dualstack_socket(const grpc_resolved_address* addr,
                                          int type, int protocol,
-                                         grpc_dualstack_mode *dsmode,
-                                         int *newfd);
+                                         grpc_dualstack_mode* dsmode,
+                                         int* newfd);
 
 /* Same as grpc_create_dualstack_socket(), but use the given socket factory (if
    non-null) to create the socket, rather than calling socket() directly. */
-grpc_error *grpc_create_dualstack_socket_using_factory(
-    grpc_socket_factory *factory, const grpc_resolved_address *addr, int type,
-    int protocol, grpc_dualstack_mode *dsmode, int *newfd);
+grpc_error* grpc_create_dualstack_socket_using_factory(
+    grpc_socket_factory* factory, const grpc_resolved_address* addr, int type,
+    int protocol, grpc_dualstack_mode* dsmode, int* newfd);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/socket_utils_uv.cc b/src/core/lib/iomgr/socket_utils_uv.cc
index 0f7de4d..75316d8 100644
--- a/src/core/lib/iomgr/socket_utils_uv.cc
+++ b/src/core/lib/iomgr/socket_utils_uv.cc
@@ -26,7 +26,7 @@
 
 #include <grpc/support/log.h>
 
-const char *grpc_inet_ntop(int af, const void *src, char *dst, size_t size) {
+const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) {
   uv_inet_ntop(af, src, dst, size);
   return dst;
 }
diff --git a/src/core/lib/iomgr/socket_utils_windows.cc b/src/core/lib/iomgr/socket_utils_windows.cc
index 6e85e4b..0482a17 100644
--- a/src/core/lib/iomgr/socket_utils_windows.cc
+++ b/src/core/lib/iomgr/socket_utils_windows.cc
@@ -25,9 +25,9 @@
 
 #include <grpc/support/log.h>
 
-const char *grpc_inet_ntop(int af, const void *src, char *dst, size_t size) {
+const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) {
   /* Windows InetNtopA wants a mutable ip pointer */
-  return InetNtopA(af, (void *)src, dst, size);
+  return InetNtopA(af, (void*)src, dst, size);
 }
 
 #endif /* GRPC_WINDOWS_SOCKETUTILS */
diff --git a/src/core/lib/iomgr/socket_windows.cc b/src/core/lib/iomgr/socket_windows.cc
index 8c7f7cf..aee80f4 100644
--- a/src/core/lib/iomgr/socket_windows.cc
+++ b/src/core/lib/iomgr/socket_windows.cc
@@ -36,9 +36,9 @@
 #include "src/core/lib/iomgr/pollset_windows.h"
 #include "src/core/lib/iomgr/socket_windows.h"
 
-grpc_winsocket *grpc_winsocket_create(SOCKET socket, const char *name) {
-  char *final_name;
-  grpc_winsocket *r = (grpc_winsocket *)gpr_malloc(sizeof(grpc_winsocket));
+grpc_winsocket* grpc_winsocket_create(SOCKET socket, const char* name) {
+  char* final_name;
+  grpc_winsocket* r = (grpc_winsocket*)gpr_malloc(sizeof(grpc_winsocket));
   memset(r, 0, sizeof(grpc_winsocket));
   r->socket = socket;
   gpr_mu_init(&r->state_mu);
@@ -53,7 +53,7 @@
    operations to abort them. We need to do that this way because of the
    various callsites of that function, which happens to be in various
    mutex hold states, and that'd be unsafe to call them directly. */
-void grpc_winsocket_shutdown(grpc_winsocket *winsocket) {
+void grpc_winsocket_shutdown(grpc_winsocket* winsocket) {
   /* Grab the function pointer for DisconnectEx for that specific socket.
      It may change depending on the interface. */
   int status;
@@ -76,7 +76,7 @@
   if (status == 0) {
     DisconnectEx(winsocket->socket, NULL, 0, 0);
   } else {
-    char *utf8_message = gpr_format_message(WSAGetLastError());
+    char* utf8_message = gpr_format_message(WSAGetLastError());
     gpr_log(GPR_INFO, "Unable to retrieve DisconnectEx pointer : %s",
             utf8_message);
     gpr_free(utf8_message);
@@ -84,19 +84,19 @@
   closesocket(winsocket->socket);
 }
 
-static void destroy(grpc_winsocket *winsocket) {
+static void destroy(grpc_winsocket* winsocket) {
   grpc_iomgr_unregister_object(&winsocket->iomgr_object);
   gpr_mu_destroy(&winsocket->state_mu);
   gpr_free(winsocket);
 }
 
-static bool check_destroyable(grpc_winsocket *winsocket) {
+static bool check_destroyable(grpc_winsocket* winsocket) {
   return winsocket->destroy_called == true &&
          winsocket->write_info.closure == NULL &&
          winsocket->read_info.closure == NULL;
 }
 
-void grpc_winsocket_destroy(grpc_winsocket *winsocket) {
+void grpc_winsocket_destroy(grpc_winsocket* winsocket) {
   gpr_mu_lock(&winsocket->state_mu);
   GPR_ASSERT(!winsocket->destroy_called);
   winsocket->destroy_called = true;
@@ -109,9 +109,9 @@
 -) The IOCP already completed in the background, and we need to call
 the callback now.
 -) The IOCP hasn't completed yet, and we're queuing it for later. */
-static void socket_notify_on_iocp(grpc_exec_ctx *exec_ctx,
-                                  grpc_winsocket *socket, grpc_closure *closure,
-                                  grpc_winsocket_callback_info *info) {
+static void socket_notify_on_iocp(grpc_exec_ctx* exec_ctx,
+                                  grpc_winsocket* socket, grpc_closure* closure,
+                                  grpc_winsocket_callback_info* info) {
   GPR_ASSERT(info->closure == NULL);
   gpr_mu_lock(&socket->state_mu);
   if (info->has_pending_iocp) {
@@ -123,19 +123,19 @@
   gpr_mu_unlock(&socket->state_mu);
 }
 
-void grpc_socket_notify_on_write(grpc_exec_ctx *exec_ctx,
-                                 grpc_winsocket *socket,
-                                 grpc_closure *closure) {
+void grpc_socket_notify_on_write(grpc_exec_ctx* exec_ctx,
+                                 grpc_winsocket* socket,
+                                 grpc_closure* closure) {
   socket_notify_on_iocp(exec_ctx, socket, closure, &socket->write_info);
 }
 
-void grpc_socket_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_winsocket *socket,
-                                grpc_closure *closure) {
+void grpc_socket_notify_on_read(grpc_exec_ctx* exec_ctx, grpc_winsocket* socket,
+                                grpc_closure* closure) {
   socket_notify_on_iocp(exec_ctx, socket, closure, &socket->read_info);
 }
 
-void grpc_socket_become_ready(grpc_exec_ctx *exec_ctx, grpc_winsocket *socket,
-                              grpc_winsocket_callback_info *info) {
+void grpc_socket_become_ready(grpc_exec_ctx* exec_ctx, grpc_winsocket* socket,
+                              grpc_winsocket_callback_info* info) {
   GPR_ASSERT(!info->has_pending_iocp);
   gpr_mu_lock(&socket->state_mu);
   if (info->closure) {
diff --git a/src/core/lib/iomgr/socket_windows.h b/src/core/lib/iomgr/socket_windows.h
index 84fa071..6f6c7a7 100644
--- a/src/core/lib/iomgr/socket_windows.h
+++ b/src/core/lib/iomgr/socket_windows.h
@@ -44,7 +44,7 @@
   OVERLAPPED overlapped;
   /* The callback information for the pending operation. May be empty if the
      caller hasn't registered a callback yet. */
-  grpc_closure *closure;
+  grpc_closure* closure;
   /* A boolean to describe if the IO Completion Port got a notification for
      that operation. This will happen if the operation completed before the
      called had time to register a callback. We could avoid that behavior
@@ -90,26 +90,26 @@
 
 /* Create a wrapped windows handle. This takes ownership of it, meaning that
    it will be responsible for closing it. */
-grpc_winsocket *grpc_winsocket_create(SOCKET socket, const char *name);
+grpc_winsocket* grpc_winsocket_create(SOCKET socket, const char* name);
 
 /* Initiate an asynchronous shutdown of the socket. Will call off any pending
    operation to cancel them. */
-void grpc_winsocket_shutdown(grpc_winsocket *socket);
+void grpc_winsocket_shutdown(grpc_winsocket* socket);
 
 /* Destroy a socket. Should only be called if there's no pending operation. */
-void grpc_winsocket_destroy(grpc_winsocket *socket);
+void grpc_winsocket_destroy(grpc_winsocket* socket);
 
-void grpc_socket_notify_on_write(grpc_exec_ctx *exec_ctx,
-                                 grpc_winsocket *winsocket,
-                                 grpc_closure *closure);
+void grpc_socket_notify_on_write(grpc_exec_ctx* exec_ctx,
+                                 grpc_winsocket* winsocket,
+                                 grpc_closure* closure);
 
-void grpc_socket_notify_on_read(grpc_exec_ctx *exec_ctx,
-                                grpc_winsocket *winsocket,
-                                grpc_closure *closure);
+void grpc_socket_notify_on_read(grpc_exec_ctx* exec_ctx,
+                                grpc_winsocket* winsocket,
+                                grpc_closure* closure);
 
-void grpc_socket_become_ready(grpc_exec_ctx *exec_ctx,
-                              grpc_winsocket *winsocket,
-                              grpc_winsocket_callback_info *ci);
+void grpc_socket_become_ready(grpc_exec_ctx* exec_ctx,
+                              grpc_winsocket* winsocket,
+                              grpc_winsocket_callback_info* ci);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/tcp_client.h b/src/core/lib/iomgr/tcp_client.h
index b2f365f..c18d8a9 100644
--- a/src/core/lib/iomgr/tcp_client.h
+++ b/src/core/lib/iomgr/tcp_client.h
@@ -34,11 +34,11 @@
    NULL on failure).
    interested_parties points to a set of pollsets that would be interested
    in this connection being established (in order to continue their work) */
-void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *on_connect,
-                             grpc_endpoint **endpoint,
-                             grpc_pollset_set *interested_parties,
-                             const grpc_channel_args *channel_args,
-                             const grpc_resolved_address *addr,
+void grpc_tcp_client_connect(grpc_exec_ctx* exec_ctx, grpc_closure* on_connect,
+                             grpc_endpoint** endpoint,
+                             grpc_pollset_set* interested_parties,
+                             const grpc_channel_args* channel_args,
+                             const grpc_resolved_address* addr,
                              grpc_millis deadline);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc
index 05c2ada..f2e759d 100644
--- a/src/core/lib/iomgr/tcp_client_posix.cc
+++ b/src/core/lib/iomgr/tcp_client_posix.cc
@@ -47,21 +47,21 @@
 
 typedef struct {
   gpr_mu mu;
-  grpc_fd *fd;
+  grpc_fd* fd;
   grpc_timer alarm;
   grpc_closure on_alarm;
   int refs;
   grpc_closure write_closure;
-  grpc_pollset_set *interested_parties;
-  char *addr_str;
-  grpc_endpoint **ep;
-  grpc_closure *closure;
-  grpc_channel_args *channel_args;
+  grpc_pollset_set* interested_parties;
+  char* addr_str;
+  grpc_endpoint** ep;
+  grpc_closure* closure;
+  grpc_channel_args* channel_args;
 } async_connect;
 
-static grpc_error *prepare_socket(const grpc_resolved_address *addr, int fd,
-                                  const grpc_channel_args *channel_args) {
-  grpc_error *err = GRPC_ERROR_NONE;
+static grpc_error* prepare_socket(const grpc_resolved_address* addr, int fd,
+                                  const grpc_channel_args* channel_args) {
+  grpc_error* err = GRPC_ERROR_NONE;
 
   GPR_ASSERT(fd >= 0);
 
@@ -79,8 +79,8 @@
     for (size_t i = 0; i < channel_args->num_args; i++) {
       if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_SOCKET_MUTATOR)) {
         GPR_ASSERT(channel_args->args[i].type == GRPC_ARG_POINTER);
-        grpc_socket_mutator *mutator =
-            (grpc_socket_mutator *)channel_args->args[i].value.pointer.p;
+        grpc_socket_mutator* mutator =
+            (grpc_socket_mutator*)channel_args->args[i].value.pointer.p;
         err = grpc_set_socket_with_mutator(fd, mutator);
         if (err != GRPC_ERROR_NONE) goto error;
       }
@@ -96,18 +96,19 @@
   return err;
 }
 
-static void tc_on_alarm(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) {
+static void tc_on_alarm(grpc_exec_ctx* exec_ctx, void* acp, grpc_error* error) {
   int done;
-  async_connect *ac = (async_connect *)acp;
+  async_connect* ac = (async_connect*)acp;
   if (grpc_tcp_trace.enabled()) {
-    const char *str = grpc_error_string(error);
+    const char* str = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_alarm: error=%s", ac->addr_str,
             str);
   }
   gpr_mu_lock(&ac->mu);
   if (ac->fd != NULL) {
-    grpc_fd_shutdown(exec_ctx, ac->fd, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-                                           "connect() timed out"));
+    grpc_fd_shutdown(
+        exec_ctx, ac->fd,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("connect() timed out"));
   }
   done = (--ac->refs == 0);
   gpr_mu_unlock(&ac->mu);
@@ -119,26 +120,26 @@
   }
 }
 
-grpc_endpoint *grpc_tcp_client_create_from_fd(
-    grpc_exec_ctx *exec_ctx, grpc_fd *fd, const grpc_channel_args *channel_args,
-    const char *addr_str) {
+grpc_endpoint* grpc_tcp_client_create_from_fd(
+    grpc_exec_ctx* exec_ctx, grpc_fd* fd, const grpc_channel_args* channel_args,
+    const char* addr_str) {
   return grpc_tcp_create(exec_ctx, fd, channel_args, addr_str);
 }
 
-static void on_writable(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) {
-  async_connect *ac = (async_connect *)acp;
+static void on_writable(grpc_exec_ctx* exec_ctx, void* acp, grpc_error* error) {
+  async_connect* ac = (async_connect*)acp;
   int so_error = 0;
   socklen_t so_error_size;
   int err;
   int done;
-  grpc_endpoint **ep = ac->ep;
-  grpc_closure *closure = ac->closure;
-  grpc_fd *fd;
+  grpc_endpoint** ep = ac->ep;
+  grpc_closure* closure = ac->closure;
+  grpc_fd* fd;
 
   GRPC_ERROR_REF(error);
 
   if (grpc_tcp_trace.enabled()) {
-    const char *str = grpc_error_string(error);
+    const char* str = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_writable: error=%s",
             ac->addr_str, str);
   }
@@ -216,11 +217,11 @@
   done = (--ac->refs == 0);
   gpr_mu_unlock(&ac->mu);
   if (error != GRPC_ERROR_NONE) {
-    char *error_descr;
+    char* error_descr;
     grpc_slice str;
     bool ret = grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &str);
     GPR_ASSERT(ret);
-    char *desc = grpc_slice_to_c_string(str);
+    char* desc = grpc_slice_to_c_string(str);
     gpr_asprintf(&error_descr, "Failed to connect to remote host: %s", desc);
     error = grpc_error_set_str(error, GRPC_ERROR_STR_DESCRIPTION,
                                grpc_slice_from_copied_string(error_descr));
@@ -238,22 +239,22 @@
   GRPC_CLOSURE_SCHED(exec_ctx, closure, error);
 }
 
-static void tcp_client_connect_impl(grpc_exec_ctx *exec_ctx,
-                                    grpc_closure *closure, grpc_endpoint **ep,
-                                    grpc_pollset_set *interested_parties,
-                                    const grpc_channel_args *channel_args,
-                                    const grpc_resolved_address *addr,
+static void tcp_client_connect_impl(grpc_exec_ctx* exec_ctx,
+                                    grpc_closure* closure, grpc_endpoint** ep,
+                                    grpc_pollset_set* interested_parties,
+                                    const grpc_channel_args* channel_args,
+                                    const grpc_resolved_address* addr,
                                     grpc_millis deadline) {
   int fd;
   grpc_dualstack_mode dsmode;
   int err;
-  async_connect *ac;
+  async_connect* ac;
   grpc_resolved_address addr6_v4mapped;
   grpc_resolved_address addr4_copy;
-  grpc_fd *fdobj;
-  char *name;
-  char *addr_str;
-  grpc_error *error;
+  grpc_fd* fdobj;
+  char* name;
+  char* addr_str;
+  grpc_error* error;
 
   *ep = NULL;
 
@@ -279,8 +280,7 @@
 
   do {
     GPR_ASSERT(addr->len < ~(socklen_t)0);
-    err =
-        connect(fd, (const struct sockaddr *)addr->addr, (socklen_t)addr->len);
+    err = connect(fd, (const struct sockaddr*)addr->addr, (socklen_t)addr->len);
   } while (err < 0 && errno == EINTR);
 
   addr_str = grpc_sockaddr_to_uri(addr);
@@ -304,7 +304,7 @@
 
   grpc_pollset_set_add_fd(exec_ctx, interested_parties, fdobj);
 
-  ac = (async_connect *)gpr_malloc(sizeof(async_connect));
+  ac = (async_connect*)gpr_malloc(sizeof(async_connect));
   ac->closure = closure;
   ac->ep = ep;
   ac->fd = fdobj;
@@ -336,17 +336,17 @@
 // overridden by api_fuzzer.c
 extern "C" {
 void (*grpc_tcp_client_connect_impl)(
-    grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_endpoint **ep,
-    grpc_pollset_set *interested_parties, const grpc_channel_args *channel_args,
-    const grpc_resolved_address *addr,
+    grpc_exec_ctx* exec_ctx, grpc_closure* closure, grpc_endpoint** ep,
+    grpc_pollset_set* interested_parties, const grpc_channel_args* channel_args,
+    const grpc_resolved_address* addr,
     grpc_millis deadline) = tcp_client_connect_impl;
 }
 
-void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                             grpc_endpoint **ep,
-                             grpc_pollset_set *interested_parties,
-                             const grpc_channel_args *channel_args,
-                             const grpc_resolved_address *addr,
+void grpc_tcp_client_connect(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                             grpc_endpoint** ep,
+                             grpc_pollset_set* interested_parties,
+                             const grpc_channel_args* channel_args,
+                             const grpc_resolved_address* addr,
                              grpc_millis deadline) {
   grpc_tcp_client_connect_impl(exec_ctx, closure, ep, interested_parties,
                                channel_args, addr, deadline);
diff --git a/src/core/lib/iomgr/tcp_client_posix.h b/src/core/lib/iomgr/tcp_client_posix.h
index 8740511..13d9178 100644
--- a/src/core/lib/iomgr/tcp_client_posix.h
+++ b/src/core/lib/iomgr/tcp_client_posix.h
@@ -27,9 +27,9 @@
 extern "C" {
 #endif
 
-grpc_endpoint *grpc_tcp_client_create_from_fd(
-    grpc_exec_ctx *exec_ctx, grpc_fd *fd, const grpc_channel_args *channel_args,
-    const char *addr_str);
+grpc_endpoint* grpc_tcp_client_create_from_fd(
+    grpc_exec_ctx* exec_ctx, grpc_fd* fd, const grpc_channel_args* channel_args,
+    const char* addr_str);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/tcp_client_uv.cc b/src/core/lib/iomgr/tcp_client_uv.cc
index b2aefc2..a599816 100644
--- a/src/core/lib/iomgr/tcp_client_uv.cc
+++ b/src/core/lib/iomgr/tcp_client_uv.cc
@@ -38,29 +38,29 @@
   uv_connect_t connect_req;
   grpc_timer alarm;
   grpc_closure on_alarm;
-  uv_tcp_t *tcp_handle;
-  grpc_closure *closure;
-  grpc_endpoint **endpoint;
+  uv_tcp_t* tcp_handle;
+  grpc_closure* closure;
+  grpc_endpoint** endpoint;
   int refs;
-  char *addr_name;
-  grpc_resource_quota *resource_quota;
+  char* addr_name;
+  grpc_resource_quota* resource_quota;
 } grpc_uv_tcp_connect;
 
-static void uv_tcp_connect_cleanup(grpc_exec_ctx *exec_ctx,
-                                   grpc_uv_tcp_connect *connect) {
+static void uv_tcp_connect_cleanup(grpc_exec_ctx* exec_ctx,
+                                   grpc_uv_tcp_connect* connect) {
   grpc_resource_quota_unref_internal(exec_ctx, connect->resource_quota);
   gpr_free(connect->addr_name);
   gpr_free(connect);
 }
 
-static void tcp_close_callback(uv_handle_t *handle) { gpr_free(handle); }
+static void tcp_close_callback(uv_handle_t* handle) { gpr_free(handle); }
 
-static void uv_tc_on_alarm(grpc_exec_ctx *exec_ctx, void *acp,
-                           grpc_error *error) {
+static void uv_tc_on_alarm(grpc_exec_ctx* exec_ctx, void* acp,
+                           grpc_error* error) {
   int done;
-  grpc_uv_tcp_connect *connect = (grpc_uv_tcp_connect *)acp;
-  if (grpc_tcp_trace.enabled()) {
-    const char *str = grpc_error_string(error);
+  grpc_uv_tcp_connect* connect = (grpc_uv_tcp_connect*)acp;
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
+    const char* str = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_alarm: error=%s",
             connect->addr_name, str);
   }
@@ -68,7 +68,7 @@
     /* error == NONE implies that the timer ran out, and wasn't cancelled. If
        it was cancelled, then the handler that cancelled it also should close
        the handle, if applicable */
-    uv_close((uv_handle_t *)connect->tcp_handle, tcp_close_callback);
+    uv_close((uv_handle_t*)connect->tcp_handle, tcp_close_callback);
   }
   done = (--connect->refs == 0);
   if (done) {
@@ -76,12 +76,12 @@
   }
 }
 
-static void uv_tc_on_connect(uv_connect_t *req, int status) {
-  grpc_uv_tcp_connect *connect = (grpc_uv_tcp_connect *)req->data;
+static void uv_tc_on_connect(uv_connect_t* req, int status) {
+  grpc_uv_tcp_connect* connect = (grpc_uv_tcp_connect*)req->data;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   int done;
-  grpc_closure *closure = connect->closure;
+  grpc_closure* closure = connect->closure;
   grpc_timer_cancel(&exec_ctx, &connect->alarm);
   if (status == 0) {
     *connect->endpoint = grpc_tcp_create(
@@ -102,7 +102,7 @@
       error = grpc_error_set_str(
           error, GRPC_ERROR_STR_OS_ERROR,
           grpc_slice_from_static_string(uv_strerror(status)));
-      uv_close((uv_handle_t *)connect->tcp_handle, tcp_close_callback);
+      uv_close((uv_handle_t*)connect->tcp_handle, tcp_close_callback);
     }
   }
   done = (--connect->refs == 0);
@@ -114,14 +114,14 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void tcp_client_connect_impl(grpc_exec_ctx *exec_ctx,
-                                    grpc_closure *closure, grpc_endpoint **ep,
-                                    grpc_pollset_set *interested_parties,
-                                    const grpc_channel_args *channel_args,
-                                    const grpc_resolved_address *resolved_addr,
+static void tcp_client_connect_impl(grpc_exec_ctx* exec_ctx,
+                                    grpc_closure* closure, grpc_endpoint** ep,
+                                    grpc_pollset_set* interested_parties,
+                                    const grpc_channel_args* channel_args,
+                                    const grpc_resolved_address* resolved_addr,
                                     grpc_millis deadline) {
-  grpc_uv_tcp_connect *connect;
-  grpc_resource_quota *resource_quota = grpc_resource_quota_create(NULL);
+  grpc_uv_tcp_connect* connect;
+  grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
   (void)channel_args;
   (void)interested_parties;
 
@@ -132,30 +132,29 @@
       if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
         grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
         resource_quota = grpc_resource_quota_ref_internal(
-            (grpc_resource_quota *)channel_args->args[i].value.pointer.p);
+            (grpc_resource_quota*)channel_args->args[i].value.pointer.p);
       }
     }
   }
 
-  connect = (grpc_uv_tcp_connect *)gpr_zalloc(sizeof(grpc_uv_tcp_connect));
+  connect = (grpc_uv_tcp_connect*)gpr_zalloc(sizeof(grpc_uv_tcp_connect));
   connect->closure = closure;
   connect->endpoint = ep;
-  connect->tcp_handle = (uv_tcp_t *)gpr_malloc(sizeof(uv_tcp_t));
+  connect->tcp_handle = (uv_tcp_t*)gpr_malloc(sizeof(uv_tcp_t));
   connect->addr_name = grpc_sockaddr_to_uri(resolved_addr);
   connect->resource_quota = resource_quota;
   uv_tcp_init(uv_default_loop(), connect->tcp_handle);
   connect->connect_req.data = connect;
   connect->refs = 2;  // One for the connect operation, one for the timer.
 
-  if (grpc_tcp_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: asynchronously connecting",
             connect->addr_name);
   }
 
   // TODO(murgatroid99): figure out what the return value here means
   uv_tcp_connect(&connect->connect_req, connect->tcp_handle,
-                 (const struct sockaddr *)resolved_addr->addr,
-                 uv_tc_on_connect);
+                 (const struct sockaddr*)resolved_addr->addr, uv_tc_on_connect);
   GRPC_CLOSURE_INIT(&connect->on_alarm, uv_tc_on_alarm, connect,
                     grpc_schedule_on_exec_ctx);
   grpc_timer_init(exec_ctx, &connect->alarm, deadline, &connect->on_alarm);
@@ -164,17 +163,17 @@
 // overridden by api_fuzzer.c
 extern "C" {
 void (*grpc_tcp_client_connect_impl)(
-    grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_endpoint **ep,
-    grpc_pollset_set *interested_parties, const grpc_channel_args *channel_args,
-    const grpc_resolved_address *addr,
+    grpc_exec_ctx* exec_ctx, grpc_closure* closure, grpc_endpoint** ep,
+    grpc_pollset_set* interested_parties, const grpc_channel_args* channel_args,
+    const grpc_resolved_address* addr,
     grpc_millis deadline) = tcp_client_connect_impl;
 }
 
-void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                             grpc_endpoint **ep,
-                             grpc_pollset_set *interested_parties,
-                             const grpc_channel_args *channel_args,
-                             const grpc_resolved_address *addr,
+void grpc_tcp_client_connect(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                             grpc_endpoint** ep,
+                             grpc_pollset_set* interested_parties,
+                             const grpc_channel_args* channel_args,
+                             const grpc_resolved_address* addr,
                              grpc_millis deadline) {
   grpc_tcp_client_connect_impl(exec_ctx, closure, ep, interested_parties,
                                channel_args, addr, deadline);
diff --git a/src/core/lib/iomgr/tcp_client_windows.cc b/src/core/lib/iomgr/tcp_client_windows.cc
index 9adf7ee..103e6b7 100644
--- a/src/core/lib/iomgr/tcp_client_windows.cc
+++ b/src/core/lib/iomgr/tcp_client_windows.cc
@@ -40,21 +40,21 @@
 #include "src/core/lib/iomgr/timer.h"
 
 typedef struct {
-  grpc_closure *on_done;
+  grpc_closure* on_done;
   gpr_mu mu;
-  grpc_winsocket *socket;
+  grpc_winsocket* socket;
   grpc_timer alarm;
   grpc_closure on_alarm;
-  char *addr_name;
+  char* addr_name;
   int refs;
   grpc_closure on_connect;
-  grpc_endpoint **endpoint;
-  grpc_channel_args *channel_args;
+  grpc_endpoint** endpoint;
+  grpc_channel_args* channel_args;
 } async_connect;
 
-static void async_connect_unlock_and_cleanup(grpc_exec_ctx *exec_ctx,
-                                             async_connect *ac,
-                                             grpc_winsocket *socket) {
+static void async_connect_unlock_and_cleanup(grpc_exec_ctx* exec_ctx,
+                                             async_connect* ac,
+                                             grpc_winsocket* socket) {
   int done = (--ac->refs == 0);
   gpr_mu_unlock(&ac->mu);
   if (done) {
@@ -66,10 +66,10 @@
   if (socket != NULL) grpc_winsocket_destroy(socket);
 }
 
-static void on_alarm(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) {
-  async_connect *ac = (async_connect *)acp;
+static void on_alarm(grpc_exec_ctx* exec_ctx, void* acp, grpc_error* error) {
+  async_connect* ac = (async_connect*)acp;
   gpr_mu_lock(&ac->mu);
-  grpc_winsocket *socket = ac->socket;
+  grpc_winsocket* socket = ac->socket;
   ac->socket = NULL;
   if (socket != NULL) {
     grpc_winsocket_shutdown(socket);
@@ -77,16 +77,16 @@
   async_connect_unlock_and_cleanup(exec_ctx, ac, socket);
 }
 
-static void on_connect(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) {
-  async_connect *ac = (async_connect *)acp;
-  grpc_endpoint **ep = ac->endpoint;
+static void on_connect(grpc_exec_ctx* exec_ctx, void* acp, grpc_error* error) {
+  async_connect* ac = (async_connect*)acp;
+  grpc_endpoint** ep = ac->endpoint;
   GPR_ASSERT(*ep == NULL);
-  grpc_closure *on_done = ac->on_done;
+  grpc_closure* on_done = ac->on_done;
 
   GRPC_ERROR_REF(error);
 
   gpr_mu_lock(&ac->mu);
-  grpc_winsocket *socket = ac->socket;
+  grpc_winsocket* socket = ac->socket;
   ac->socket = NULL;
   gpr_mu_unlock(&ac->mu);
 
@@ -123,21 +123,21 @@
 /* Tries to issue one async connection, then schedules both an IOCP
    notification request for the connection, and one timeout alert. */
 static void tcp_client_connect_impl(
-    grpc_exec_ctx *exec_ctx, grpc_closure *on_done, grpc_endpoint **endpoint,
-    grpc_pollset_set *interested_parties, const grpc_channel_args *channel_args,
-    const grpc_resolved_address *addr, grpc_millis deadline) {
+    grpc_exec_ctx* exec_ctx, grpc_closure* on_done, grpc_endpoint** endpoint,
+    grpc_pollset_set* interested_parties, const grpc_channel_args* channel_args,
+    const grpc_resolved_address* addr, grpc_millis deadline) {
   SOCKET sock = INVALID_SOCKET;
   BOOL success;
   int status;
   grpc_resolved_address addr6_v4mapped;
   grpc_resolved_address local_address;
-  async_connect *ac;
-  grpc_winsocket *socket = NULL;
+  async_connect* ac;
+  grpc_winsocket* socket = NULL;
   LPFN_CONNECTEX ConnectEx;
   GUID guid = WSAID_CONNECTEX;
   DWORD ioctl_num_bytes;
-  grpc_winsocket_callback_info *info;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_winsocket_callback_info* info;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   *endpoint = NULL;
 
@@ -172,8 +172,8 @@
 
   grpc_sockaddr_make_wildcard6(0, &local_address);
 
-  status = bind(sock, (struct sockaddr *)&local_address.addr,
-                (int)local_address.len);
+  status =
+      bind(sock, (struct sockaddr*)&local_address.addr, (int)local_address.len);
   if (status != 0) {
     error = GRPC_WSA_ERROR(WSAGetLastError(), "bind");
     goto failure;
@@ -181,8 +181,8 @@
 
   socket = grpc_winsocket_create(sock, "client");
   info = &socket->write_info;
-  success = ConnectEx(sock, (struct sockaddr *)&addr->addr, (int)addr->len,
-                      NULL, 0, NULL, &info->overlapped);
+  success = ConnectEx(sock, (struct sockaddr*)&addr->addr, (int)addr->len, NULL,
+                      0, NULL, &info->overlapped);
 
   /* It wouldn't be unusual to get a success immediately. But we'll still get
      an IOCP notification, so let's ignore it. */
@@ -194,7 +194,7 @@
     }
   }
 
-  ac = (async_connect *)gpr_malloc(sizeof(async_connect));
+  ac = (async_connect*)gpr_malloc(sizeof(async_connect));
   ac->on_done = on_done;
   ac->socket = socket;
   gpr_mu_init(&ac->mu);
@@ -211,8 +211,8 @@
 
 failure:
   GPR_ASSERT(error != GRPC_ERROR_NONE);
-  char *target_uri = grpc_sockaddr_to_uri(addr);
-  grpc_error *final_error = grpc_error_set_str(
+  char* target_uri = grpc_sockaddr_to_uri(addr);
+  grpc_error* final_error = grpc_error_set_str(
       GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING("Failed to connect",
                                                        &error, 1),
       GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(target_uri));
@@ -228,17 +228,17 @@
 // overridden by api_fuzzer.c
 extern "C" {
 void (*grpc_tcp_client_connect_impl)(
-    grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_endpoint **ep,
-    grpc_pollset_set *interested_parties, const grpc_channel_args *channel_args,
-    const grpc_resolved_address *addr,
+    grpc_exec_ctx* exec_ctx, grpc_closure* closure, grpc_endpoint** ep,
+    grpc_pollset_set* interested_parties, const grpc_channel_args* channel_args,
+    const grpc_resolved_address* addr,
     grpc_millis deadline) = tcp_client_connect_impl;
 }
 
-void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                             grpc_endpoint **ep,
-                             grpc_pollset_set *interested_parties,
-                             const grpc_channel_args *channel_args,
-                             const grpc_resolved_address *addr,
+void grpc_tcp_client_connect(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                             grpc_endpoint** ep,
+                             grpc_pollset_set* interested_parties,
+                             const grpc_channel_args* channel_args,
+                             const grpc_resolved_address* addr,
                              grpc_millis deadline) {
   grpc_tcp_client_connect_impl(exec_ctx, closure, ep, interested_parties,
                                channel_args, addr, deadline);
diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc
index 3fa175d..d40007a 100644
--- a/src/core/lib/iomgr/tcp_posix.cc
+++ b/src/core/lib/iomgr/tcp_posix.cc
@@ -65,7 +65,7 @@
 
 typedef struct {
   grpc_endpoint base;
-  grpc_fd *em_fd;
+  grpc_fd* em_fd;
   int fd;
   bool finished_edge;
   double target_length;
@@ -79,48 +79,48 @@
   /* garbage after the last read */
   grpc_slice_buffer last_read_buffer;
 
-  grpc_slice_buffer *incoming_buffer;
-  grpc_slice_buffer *outgoing_buffer;
+  grpc_slice_buffer* incoming_buffer;
+  grpc_slice_buffer* outgoing_buffer;
   /** slice within outgoing_buffer to write next */
   size_t outgoing_slice_idx;
   /** byte within outgoing_buffer->slices[outgoing_slice_idx] to write next */
   size_t outgoing_byte_idx;
 
-  grpc_closure *read_cb;
-  grpc_closure *write_cb;
-  grpc_closure *release_fd_cb;
-  int *release_fd;
+  grpc_closure* read_cb;
+  grpc_closure* write_cb;
+  grpc_closure* release_fd_cb;
+  int* release_fd;
 
   grpc_closure read_done_closure;
   grpc_closure write_done_closure;
 
-  char *peer_string;
+  char* peer_string;
 
-  grpc_resource_user *resource_user;
+  grpc_resource_user* resource_user;
   grpc_resource_user_slice_allocator slice_allocator;
 } grpc_tcp;
 
 typedef struct backup_poller {
-  gpr_mu *pollset_mu;
+  gpr_mu* pollset_mu;
   grpc_closure run_poller;
 } backup_poller;
 
-#define BACKUP_POLLER_POLLSET(b) ((grpc_pollset *)((b) + 1))
+#define BACKUP_POLLER_POLLSET(b) ((grpc_pollset*)((b) + 1))
 
 static gpr_atm g_uncovered_notifications_pending;
 static gpr_atm g_backup_poller; /* backup_poller* */
 
-static void tcp_handle_read(grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */,
-                            grpc_error *error);
-static void tcp_handle_write(grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */,
-                             grpc_error *error);
-static void tcp_drop_uncovered_then_handle_write(grpc_exec_ctx *exec_ctx,
-                                                 void *arg /* grpc_tcp */,
-                                                 grpc_error *error);
+static void tcp_handle_read(grpc_exec_ctx* exec_ctx, void* arg /* grpc_tcp */,
+                            grpc_error* error);
+static void tcp_handle_write(grpc_exec_ctx* exec_ctx, void* arg /* grpc_tcp */,
+                             grpc_error* error);
+static void tcp_drop_uncovered_then_handle_write(grpc_exec_ctx* exec_ctx,
+                                                 void* arg /* grpc_tcp */,
+                                                 grpc_error* error);
 
-static void done_poller(grpc_exec_ctx *exec_ctx, void *bp,
-                        grpc_error *error_ignored) {
-  backup_poller *p = (backup_poller *)bp;
+static void done_poller(grpc_exec_ctx* exec_ctx, void* bp,
+                        grpc_error* error_ignored) {
+  backup_poller* p = (backup_poller*)bp;
   if (grpc_tcp_trace.enabled()) {
     gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p destroy", p);
   }
@@ -128,9 +128,9 @@
   gpr_free(p);
 }
 
-static void run_poller(grpc_exec_ctx *exec_ctx, void *bp,
-                       grpc_error *error_ignored) {
-  backup_poller *p = (backup_poller *)bp;
+static void run_poller(grpc_exec_ctx* exec_ctx, void* bp,
+                       grpc_error* error_ignored) {
+  backup_poller* p = (backup_poller*)bp;
   if (grpc_tcp_trace.enabled()) {
     gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p run", p);
   }
@@ -165,8 +165,8 @@
   }
 }
 
-static void drop_uncovered(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
-  backup_poller *p = (backup_poller *)gpr_atm_acq_load(&g_backup_poller);
+static void drop_uncovered(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
+  backup_poller* p = (backup_poller*)gpr_atm_acq_load(&g_backup_poller);
   gpr_atm old_count =
       gpr_atm_no_barrier_fetch_add(&g_uncovered_notifications_pending, -1);
   if (grpc_tcp_trace.enabled()) {
@@ -176,8 +176,8 @@
   GPR_ASSERT(old_count != 1);
 }
 
-static void cover_self(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
-  backup_poller *p;
+static void cover_self(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
+  backup_poller* p;
   gpr_atm old_count =
       gpr_atm_no_barrier_fetch_add(&g_uncovered_notifications_pending, 2);
   if (grpc_tcp_trace.enabled()) {
@@ -186,7 +186,7 @@
   }
   if (old_count == 0) {
     GRPC_STATS_INC_TCP_BACKUP_POLLERS_CREATED(exec_ctx);
-    p = (backup_poller *)gpr_zalloc(sizeof(*p) + grpc_pollset_size());
+    p = (backup_poller*)gpr_zalloc(sizeof(*p) + grpc_pollset_size());
     if (grpc_tcp_trace.enabled()) {
       gpr_log(GPR_DEBUG, "BACKUP_POLLER:%p create", p);
     }
@@ -198,7 +198,7 @@
                           grpc_executor_scheduler(GRPC_EXECUTOR_LONG)),
         GRPC_ERROR_NONE);
   } else {
-    while ((p = (backup_poller *)gpr_atm_acq_load(&g_backup_poller)) == NULL) {
+    while ((p = (backup_poller*)gpr_atm_acq_load(&g_backup_poller)) == NULL) {
       // spin waiting for backup poller
     }
   }
@@ -211,7 +211,7 @@
   }
 }
 
-static void notify_on_read(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void notify_on_read(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   if (grpc_tcp_trace.enabled()) {
     gpr_log(GPR_DEBUG, "TCP:%p notify_on_read", tcp);
   }
@@ -220,7 +220,7 @@
   grpc_fd_notify_on_read(exec_ctx, tcp->em_fd, &tcp->read_done_closure);
 }
 
-static void notify_on_write(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void notify_on_write(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   if (grpc_tcp_trace.enabled()) {
     gpr_log(GPR_DEBUG, "TCP:%p notify_on_write", tcp);
   }
@@ -231,20 +231,20 @@
   grpc_fd_notify_on_write(exec_ctx, tcp->em_fd, &tcp->write_done_closure);
 }
 
-static void tcp_drop_uncovered_then_handle_write(grpc_exec_ctx *exec_ctx,
-                                                 void *arg, grpc_error *error) {
+static void tcp_drop_uncovered_then_handle_write(grpc_exec_ctx* exec_ctx,
+                                                 void* arg, grpc_error* error) {
   if (grpc_tcp_trace.enabled()) {
     gpr_log(GPR_DEBUG, "TCP:%p got_write: %s", arg, grpc_error_string(error));
   }
-  drop_uncovered(exec_ctx, (grpc_tcp *)arg);
+  drop_uncovered(exec_ctx, (grpc_tcp*)arg);
   tcp_handle_write(exec_ctx, arg, error);
 }
 
-static void add_to_estimate(grpc_tcp *tcp, size_t bytes) {
+static void add_to_estimate(grpc_tcp* tcp, size_t bytes) {
   tcp->bytes_read_this_round += (double)bytes;
 }
 
-static void finish_estimate(grpc_tcp *tcp) {
+static void finish_estimate(grpc_tcp* tcp) {
   /* If we read >80% of the target buffer in one read loop, increase the size
      of the target buffer to either the amount read, or twice its previous
      value */
@@ -258,8 +258,8 @@
   tcp->bytes_read_this_round = 0;
 }
 
-static size_t get_target_read_size(grpc_tcp *tcp) {
-  grpc_resource_quota *rq = grpc_resource_user_quota(tcp->resource_user);
+static size_t get_target_read_size(grpc_tcp* tcp) {
+  grpc_resource_quota* rq = grpc_resource_user_quota(tcp->resource_user);
   double pressure = grpc_resource_quota_get_memory_pressure(rq);
   double target =
       tcp->target_length * (pressure > 0.8 ? (1.0 - pressure) / 0.2 : 1.0);
@@ -276,26 +276,26 @@
   return sz;
 }
 
-static grpc_error *tcp_annotate_error(grpc_error *src_error, grpc_tcp *tcp) {
+static grpc_error* tcp_annotate_error(grpc_error* src_error, grpc_tcp* tcp) {
   return grpc_error_set_str(
       grpc_error_set_int(src_error, GRPC_ERROR_INT_FD, tcp->fd),
       GRPC_ERROR_STR_TARGET_ADDRESS,
       grpc_slice_from_copied_string(tcp->peer_string));
 }
 
-static void tcp_handle_read(grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */,
-                            grpc_error *error);
-static void tcp_handle_write(grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */,
-                             grpc_error *error);
+static void tcp_handle_read(grpc_exec_ctx* exec_ctx, void* arg /* grpc_tcp */,
+                            grpc_error* error);
+static void tcp_handle_write(grpc_exec_ctx* exec_ctx, void* arg /* grpc_tcp */,
+                             grpc_error* error);
 
-static void tcp_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                         grpc_error *why) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static void tcp_shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                         grpc_error* why) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   grpc_fd_shutdown(exec_ctx, tcp->em_fd, why);
   grpc_resource_user_shutdown(exec_ctx, tcp->resource_user);
 }
 
-static void tcp_free(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void tcp_free(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   grpc_fd_orphan(exec_ctx, tcp->em_fd, tcp->release_fd_cb, tcp->release_fd,
                  false /* already_closed */, "tcp_unref_orphan");
   grpc_slice_buffer_destroy_internal(exec_ctx, &tcp->last_read_buffer);
@@ -308,8 +308,8 @@
 #define TCP_UNREF(cl, tcp, reason) \
   tcp_unref((cl), (tcp), (reason), __FILE__, __LINE__)
 #define TCP_REF(tcp, reason) tcp_ref((tcp), (reason), __FILE__, __LINE__)
-static void tcp_unref(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp,
-                      const char *reason, const char *file, int line) {
+static void tcp_unref(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp,
+                      const char* reason, const char* file, int line) {
   if (grpc_tcp_trace.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
@@ -321,7 +321,7 @@
   }
 }
 
-static void tcp_ref(grpc_tcp *tcp, const char *reason, const char *file,
+static void tcp_ref(grpc_tcp* tcp, const char* reason, const char* file,
                     int line) {
   if (grpc_tcp_trace.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count);
@@ -334,34 +334,34 @@
 #else
 #define TCP_UNREF(cl, tcp, reason) tcp_unref((cl), (tcp))
 #define TCP_REF(tcp, reason) tcp_ref((tcp))
-static void tcp_unref(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void tcp_unref(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   if (gpr_unref(&tcp->refcount)) {
     tcp_free(exec_ctx, tcp);
   }
 }
 
-static void tcp_ref(grpc_tcp *tcp) { gpr_ref(&tcp->refcount); }
+static void tcp_ref(grpc_tcp* tcp) { gpr_ref(&tcp->refcount); }
 #endif
 
-static void tcp_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
+static void tcp_destroy(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep) {
   grpc_network_status_unregister_endpoint(ep);
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   grpc_slice_buffer_reset_and_unref_internal(exec_ctx, &tcp->last_read_buffer);
   TCP_UNREF(exec_ctx, tcp, "destroy");
 }
 
-static void call_read_cb(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp,
-                         grpc_error *error) {
-  grpc_closure *cb = tcp->read_cb;
+static void call_read_cb(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp,
+                         grpc_error* error) {
+  grpc_closure* cb = tcp->read_cb;
 
   if (grpc_tcp_trace.enabled()) {
     gpr_log(GPR_DEBUG, "TCP:%p call_cb %p %p:%p", tcp, cb, cb->cb, cb->cb_arg);
     size_t i;
-    const char *str = grpc_error_string(error);
+    const char* str = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "read: error=%s", str);
 
     for (i = 0; i < tcp->incoming_buffer->count; i++) {
-      char *dump = grpc_dump_slice(tcp->incoming_buffer->slices[i],
+      char* dump = grpc_dump_slice(tcp->incoming_buffer->slices[i],
                                    GPR_DUMP_HEX | GPR_DUMP_ASCII);
       gpr_log(GPR_DEBUG, "READ %p (peer=%s): %s", tcp, tcp->peer_string, dump);
       gpr_free(dump);
@@ -374,7 +374,7 @@
 }
 
 #define MAX_READ_IOVEC 4
-static void tcp_do_read(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void tcp_do_read(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   struct msghdr msg;
   struct iovec iov[MAX_READ_IOVEC];
   ssize_t read_bytes;
@@ -447,9 +447,9 @@
   GPR_TIMER_END("tcp_continue_read", 0);
 }
 
-static void tcp_read_allocation_done(grpc_exec_ctx *exec_ctx, void *tcpp,
-                                     grpc_error *error) {
-  grpc_tcp *tcp = (grpc_tcp *)tcpp;
+static void tcp_read_allocation_done(grpc_exec_ctx* exec_ctx, void* tcpp,
+                                     grpc_error* error) {
+  grpc_tcp* tcp = (grpc_tcp*)tcpp;
   if (grpc_tcp_trace.enabled()) {
     gpr_log(GPR_DEBUG, "TCP:%p read_allocation_done: %s", tcp,
             grpc_error_string(error));
@@ -465,7 +465,7 @@
   }
 }
 
-static void tcp_continue_read(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void tcp_continue_read(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   size_t target_read_size = get_target_read_size(tcp);
   if (tcp->incoming_buffer->length < target_read_size &&
       tcp->incoming_buffer->count < MAX_READ_IOVEC) {
@@ -482,9 +482,9 @@
   }
 }
 
-static void tcp_handle_read(grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */,
-                            grpc_error *error) {
-  grpc_tcp *tcp = (grpc_tcp *)arg;
+static void tcp_handle_read(grpc_exec_ctx* exec_ctx, void* arg /* grpc_tcp */,
+                            grpc_error* error) {
+  grpc_tcp* tcp = (grpc_tcp*)arg;
   GPR_ASSERT(!tcp->finished_edge);
   if (grpc_tcp_trace.enabled()) {
     gpr_log(GPR_DEBUG, "TCP:%p got_read: %s", tcp, grpc_error_string(error));
@@ -501,9 +501,9 @@
   }
 }
 
-static void tcp_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                     grpc_slice_buffer *incoming_buffer, grpc_closure *cb) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static void tcp_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                     grpc_slice_buffer* incoming_buffer, grpc_closure* cb) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   GPR_ASSERT(tcp->read_cb == NULL);
   tcp->read_cb = cb;
   tcp->incoming_buffer = incoming_buffer;
@@ -520,8 +520,8 @@
 
 /* returns true if done, false if pending; if returning true, *error is set */
 #define MAX_WRITE_IOVEC 1000
-static bool tcp_flush(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp,
-                      grpc_error **error) {
+static bool tcp_flush(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp,
+                      grpc_error** error) {
   struct msghdr msg;
   struct iovec iov[MAX_WRITE_IOVEC];
   msg_iovlen_type iov_size;
@@ -610,10 +610,10 @@
   };
 }
 
-static void tcp_handle_write(grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */,
-                             grpc_error *error) {
-  grpc_tcp *tcp = (grpc_tcp *)arg;
-  grpc_closure *cb;
+static void tcp_handle_write(grpc_exec_ctx* exec_ctx, void* arg /* grpc_tcp */,
+                             grpc_error* error) {
+  grpc_tcp* tcp = (grpc_tcp*)arg;
+  grpc_closure* cb;
 
   if (error != GRPC_ERROR_NONE) {
     cb = tcp->write_cb;
@@ -632,7 +632,7 @@
     cb = tcp->write_cb;
     tcp->write_cb = NULL;
     if (grpc_tcp_trace.enabled()) {
-      const char *str = grpc_error_string(error);
+      const char* str = grpc_error_string(error);
       gpr_log(GPR_DEBUG, "write: %s", str);
     }
 
@@ -641,16 +641,16 @@
   }
 }
 
-static void tcp_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                      grpc_slice_buffer *buf, grpc_closure *cb) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
-  grpc_error *error = GRPC_ERROR_NONE;
+static void tcp_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                      grpc_slice_buffer* buf, grpc_closure* cb) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   if (grpc_tcp_trace.enabled()) {
     size_t i;
 
     for (i = 0; i < buf->count; i++) {
-      char *data =
+      char* data =
           grpc_dump_slice(buf->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII);
       gpr_log(GPR_DEBUG, "WRITE %p (peer=%s): %s", tcp, tcp->peer_string, data);
       gpr_free(data);
@@ -683,7 +683,7 @@
     notify_on_write(exec_ctx, tcp);
   } else {
     if (grpc_tcp_trace.enabled()) {
-      const char *str = grpc_error_string(error);
+      const char* str = grpc_error_string(error);
       gpr_log(GPR_DEBUG, "write: %s", str);
     }
     GRPC_CLOSURE_SCHED(exec_ctx, cb, error);
@@ -692,47 +692,60 @@
   GPR_TIMER_END("tcp_write", 0);
 }
 
-static void tcp_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                               grpc_pollset *pollset) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static void tcp_add_to_pollset(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                               grpc_pollset* pollset) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   grpc_pollset_add_fd(exec_ctx, pollset, tcp->em_fd);
 }
 
-static void tcp_add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                   grpc_pollset_set *pollset_set) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static void tcp_add_to_pollset_set(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                   grpc_pollset_set* pollset_set) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   grpc_pollset_set_add_fd(exec_ctx, pollset_set, tcp->em_fd);
 }
 
-static char *tcp_get_peer(grpc_endpoint *ep) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static void tcp_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_endpoint* ep,
+                                        grpc_pollset_set* pollset_set) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
+  grpc_pollset_set_del_fd(exec_ctx, pollset_set, tcp->em_fd);
+}
+
+static char* tcp_get_peer(grpc_endpoint* ep) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   return gpr_strdup(tcp->peer_string);
 }
 
-static int tcp_get_fd(grpc_endpoint *ep) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static int tcp_get_fd(grpc_endpoint* ep) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   return tcp->fd;
 }
 
-static grpc_resource_user *tcp_get_resource_user(grpc_endpoint *ep) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static grpc_resource_user* tcp_get_resource_user(grpc_endpoint* ep) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   return tcp->resource_user;
 }
 
-static const grpc_endpoint_vtable vtable = {
-    tcp_read,     tcp_write,   tcp_add_to_pollset,    tcp_add_to_pollset_set,
-    tcp_shutdown, tcp_destroy, tcp_get_resource_user, tcp_get_peer,
-    tcp_get_fd};
+static const grpc_endpoint_vtable vtable = {tcp_read,
+                                            tcp_write,
+                                            tcp_add_to_pollset,
+                                            tcp_add_to_pollset_set,
+                                            tcp_delete_from_pollset_set,
+                                            tcp_shutdown,
+                                            tcp_destroy,
+                                            tcp_get_resource_user,
+                                            tcp_get_peer,
+                                            tcp_get_fd};
 
 #define MAX_CHUNK_SIZE 32 * 1024 * 1024
 
-grpc_endpoint *grpc_tcp_create(grpc_exec_ctx *exec_ctx, grpc_fd *em_fd,
-                               const grpc_channel_args *channel_args,
-                               const char *peer_string) {
+grpc_endpoint* grpc_tcp_create(grpc_exec_ctx* exec_ctx, grpc_fd* em_fd,
+                               const grpc_channel_args* channel_args,
+                               const char* peer_string) {
   int tcp_read_chunk_size = GRPC_TCP_DEFAULT_READ_SLICE_SIZE;
   int tcp_max_read_chunk_size = 4 * 1024 * 1024;
   int tcp_min_read_chunk_size = 256;
-  grpc_resource_quota *resource_quota = grpc_resource_quota_create(NULL);
+  grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
   if (channel_args != NULL) {
     for (size_t i = 0; i < channel_args->num_args; i++) {
       if (0 ==
@@ -757,7 +770,7 @@
                  strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
         grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
         resource_quota = grpc_resource_quota_ref_internal(
-            (grpc_resource_quota *)channel_args->args[i].value.pointer.p);
+            (grpc_resource_quota*)channel_args->args[i].value.pointer.p);
       }
     }
   }
@@ -768,7 +781,7 @@
   tcp_read_chunk_size = GPR_CLAMP(tcp_read_chunk_size, tcp_min_read_chunk_size,
                                   tcp_max_read_chunk_size);
 
-  grpc_tcp *tcp = (grpc_tcp *)gpr_malloc(sizeof(grpc_tcp));
+  grpc_tcp* tcp = (grpc_tcp*)gpr_malloc(sizeof(grpc_tcp));
   tcp->base.vtable = &vtable;
   tcp->peer_string = gpr_strdup(peer_string);
   tcp->fd = grpc_fd_wrapped_fd(em_fd);
@@ -797,16 +810,16 @@
   return &tcp->base;
 }
 
-int grpc_tcp_fd(grpc_endpoint *ep) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+int grpc_tcp_fd(grpc_endpoint* ep) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   GPR_ASSERT(ep->vtable == &vtable);
   return grpc_fd_wrapped_fd(tcp->em_fd);
 }
 
-void grpc_tcp_destroy_and_release_fd(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                     int *fd, grpc_closure *done) {
+void grpc_tcp_destroy_and_release_fd(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                     int* fd, grpc_closure* done) {
   grpc_network_status_unregister_endpoint(ep);
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   GPR_ASSERT(ep->vtable == &vtable);
   tcp->release_fd = fd;
   tcp->release_fd_cb = done;
diff --git a/src/core/lib/iomgr/tcp_posix.h b/src/core/lib/iomgr/tcp_posix.h
index d9963c2..ba85146 100644
--- a/src/core/lib/iomgr/tcp_posix.h
+++ b/src/core/lib/iomgr/tcp_posix.h
@@ -41,21 +41,21 @@
 
 /* Create a tcp endpoint given a file desciptor and a read slice size.
    Takes ownership of fd. */
-grpc_endpoint *grpc_tcp_create(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
-                               const grpc_channel_args *args,
-                               const char *peer_string);
+grpc_endpoint* grpc_tcp_create(grpc_exec_ctx* exec_ctx, grpc_fd* fd,
+                               const grpc_channel_args* args,
+                               const char* peer_string);
 
 /* Return the tcp endpoint's fd, or -1 if this is not available. Does not
    release the fd.
    Requires: ep must be a tcp endpoint.
  */
-int grpc_tcp_fd(grpc_endpoint *ep);
+int grpc_tcp_fd(grpc_endpoint* ep);
 
 /* Destroy the tcp endpoint without closing its fd. *fd will be set and done
  * will be called when the endpoint is destroyed.
  * Requires: ep must be a tcp endpoint and fd must not be NULL. */
-void grpc_tcp_destroy_and_release_fd(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                     int *fd, grpc_closure *done);
+void grpc_tcp_destroy_and_release_fd(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                     int* fd, grpc_closure* done);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/tcp_server.h b/src/core/lib/iomgr/tcp_server.h
index 8f9ce38..ef98319 100644
--- a/src/core/lib/iomgr/tcp_server.h
+++ b/src/core/lib/iomgr/tcp_server.h
@@ -35,7 +35,7 @@
 typedef struct grpc_tcp_server_acceptor {
   /* grpc_tcp_server_cb functions share a ref on from_server that is valid
      until the function returns. */
-  grpc_tcp_server *from_server;
+  grpc_tcp_server* from_server;
   /* Indices that may be passed to grpc_tcp_server_port_fd(). */
   unsigned port_index;
   unsigned fd_index;
@@ -43,23 +43,23 @@
 
 /* Called for newly connected TCP connections.
    Takes ownership of acceptor. */
-typedef void (*grpc_tcp_server_cb)(grpc_exec_ctx *exec_ctx, void *arg,
-                                   grpc_endpoint *ep,
-                                   grpc_pollset *accepting_pollset,
-                                   grpc_tcp_server_acceptor *acceptor);
+typedef void (*grpc_tcp_server_cb)(grpc_exec_ctx* exec_ctx, void* arg,
+                                   grpc_endpoint* ep,
+                                   grpc_pollset* accepting_pollset,
+                                   grpc_tcp_server_acceptor* acceptor);
 
 /* Create a server, initially not bound to any ports. The caller owns one ref.
    If shutdown_complete is not NULL, it will be used by
    grpc_tcp_server_unref() when the ref count reaches zero. */
-grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx,
-                                   grpc_closure *shutdown_complete,
-                                   const grpc_channel_args *args,
-                                   grpc_tcp_server **server);
+grpc_error* grpc_tcp_server_create(grpc_exec_ctx* exec_ctx,
+                                   grpc_closure* shutdown_complete,
+                                   const grpc_channel_args* args,
+                                   grpc_tcp_server** server);
 
 /* Start listening to bound ports */
-void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *server,
-                           grpc_pollset **pollsets, size_t pollset_count,
-                           grpc_tcp_server_cb on_accept_cb, void *cb_arg);
+void grpc_tcp_server_start(grpc_exec_ctx* exec_ctx, grpc_tcp_server* server,
+                           grpc_pollset** pollsets, size_t pollset_count,
+                           grpc_tcp_server_cb on_accept_cb, void* cb_arg);
 
 /* Add a port to the server, returning the newly allocated port on success, or
    -1 on failure.
@@ -70,37 +70,37 @@
    but not dualstack sockets. */
 /* TODO(ctiller): deprecate this, and make grpc_tcp_server_add_ports to handle
                   all of the multiple socket port matching logic in one place */
-grpc_error *grpc_tcp_server_add_port(grpc_tcp_server *s,
-                                     const grpc_resolved_address *addr,
-                                     int *out_port);
+grpc_error* grpc_tcp_server_add_port(grpc_tcp_server* s,
+                                     const grpc_resolved_address* addr,
+                                     int* out_port);
 
 /* Number of fds at the given port_index, or 0 if port_index is out of
    bounds. */
-unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server *s, unsigned port_index);
+unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server* s, unsigned port_index);
 
 /* Returns the file descriptor of the Mth (fd_index) listening socket of the Nth
    (port_index) call to add_port() on this server, or -1 if the indices are out
    of bounds. The file descriptor remains owned by the server, and will be
    cleaned up when the ref count reaches zero. */
-int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index,
+int grpc_tcp_server_port_fd(grpc_tcp_server* s, unsigned port_index,
                             unsigned fd_index);
 
 /* Ref s and return s. */
-grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s);
+grpc_tcp_server* grpc_tcp_server_ref(grpc_tcp_server* s);
 
 /* shutdown_starting is called when ref count has reached zero and the server is
    about to be destroyed. The server will be deleted after it returns. Calling
    grpc_tcp_server_ref() from it has no effect. */
-void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s,
-                                           grpc_closure *shutdown_starting);
+void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server* s,
+                                           grpc_closure* shutdown_starting);
 
 /* If the refcount drops to zero, enqueue calls on exec_ctx to
    shutdown_listeners and delete s. */
-void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s);
+void grpc_tcp_server_unref(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s);
 
 /* Shutdown the fds of listeners. */
-void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx,
-                                        grpc_tcp_server *s);
+void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx* exec_ctx,
+                                        grpc_tcp_server* s);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/tcp_server_posix.cc b/src/core/lib/iomgr/tcp_server_posix.cc
index 777b96e..de3f4a6 100644
--- a/src/core/lib/iomgr/tcp_server_posix.cc
+++ b/src/core/lib/iomgr/tcp_server_posix.cc
@@ -68,13 +68,13 @@
 #endif
 }
 
-grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx,
-                                   grpc_closure *shutdown_complete,
-                                   const grpc_channel_args *args,
-                                   grpc_tcp_server **server) {
+grpc_error* grpc_tcp_server_create(grpc_exec_ctx* exec_ctx,
+                                   grpc_closure* shutdown_complete,
+                                   const grpc_channel_args* args,
+                                   grpc_tcp_server** server) {
   gpr_once_init(&check_init, init);
 
-  grpc_tcp_server *s = (grpc_tcp_server *)gpr_zalloc(sizeof(grpc_tcp_server));
+  grpc_tcp_server* s = (grpc_tcp_server*)gpr_zalloc(sizeof(grpc_tcp_server));
   s->so_reuseport = has_so_reuseport;
   s->expand_wildcard_addrs = false;
   for (size_t i = 0; i < (args == NULL ? 0 : args->num_args); i++) {
@@ -116,7 +116,7 @@
   return GRPC_ERROR_NONE;
 }
 
-static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
+static void finish_shutdown(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s) {
   gpr_mu_lock(&s->mu);
   GPR_ASSERT(s->shutdown);
   gpr_mu_unlock(&s->mu);
@@ -127,7 +127,7 @@
   gpr_mu_destroy(&s->mu);
 
   while (s->head) {
-    grpc_tcp_listener *sp = s->head;
+    grpc_tcp_listener* sp = s->head;
     s->head = sp->next;
     gpr_free(sp);
   }
@@ -136,9 +136,9 @@
   gpr_free(s);
 }
 
-static void destroyed_port(grpc_exec_ctx *exec_ctx, void *server,
-                           grpc_error *error) {
-  grpc_tcp_server *s = (grpc_tcp_server *)server;
+static void destroyed_port(grpc_exec_ctx* exec_ctx, void* server,
+                           grpc_error* error) {
+  grpc_tcp_server* s = (grpc_tcp_server*)server;
   gpr_mu_lock(&s->mu);
   s->destroyed_ports++;
   if (s->destroyed_ports == s->nports) {
@@ -153,14 +153,14 @@
 /* called when all listening endpoints have been shutdown, so no further
    events will be received on them - at this point it's safe to destroy
    things */
-static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
+static void deactivated_all_ports(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s) {
   /* delete ALL the things */
   gpr_mu_lock(&s->mu);
 
   GPR_ASSERT(s->shutdown);
 
   if (s->head) {
-    grpc_tcp_listener *sp;
+    grpc_tcp_listener* sp;
     for (sp = s->head; sp; sp = sp->next) {
       grpc_unlink_if_unix_domain_socket(&sp->addr);
       GRPC_CLOSURE_INIT(&sp->destroyed_closure, destroyed_port, s,
@@ -175,7 +175,7 @@
   }
 }
 
-static void tcp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
+static void tcp_server_destroy(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s) {
   gpr_mu_lock(&s->mu);
 
   GPR_ASSERT(!s->shutdown);
@@ -183,10 +183,11 @@
 
   /* shutdown all fd's */
   if (s->active_ports) {
-    grpc_tcp_listener *sp;
+    grpc_tcp_listener* sp;
     for (sp = s->head; sp; sp = sp->next) {
-      grpc_fd_shutdown(exec_ctx, sp->emfd, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-                                               "Server destroyed"));
+      grpc_fd_shutdown(
+          exec_ctx, sp->emfd,
+          GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server destroyed"));
     }
     gpr_mu_unlock(&s->mu);
   } else {
@@ -196,9 +197,9 @@
 }
 
 /* event manager callback when reads are ready */
-static void on_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *err) {
-  grpc_tcp_listener *sp = (grpc_tcp_listener *)arg;
-  grpc_pollset *read_notifier_pollset;
+static void on_read(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* err) {
+  grpc_tcp_listener* sp = (grpc_tcp_listener*)arg;
+  grpc_pollset* read_notifier_pollset;
   if (err != GRPC_ERROR_NONE) {
     goto error;
   }
@@ -211,8 +212,8 @@
   /* loop until accept4 returns EAGAIN, and then re-arm notification */
   for (;;) {
     grpc_resolved_address addr;
-    char *addr_str;
-    char *name;
+    char* addr_str;
+    char* name;
     addr.len = sizeof(struct sockaddr_storage);
     /* Note: If we ever decide to return this address to the user, remember to
        strip off the ::ffff:0.0.0.0/96 prefix first. */
@@ -246,13 +247,13 @@
       gpr_log(GPR_DEBUG, "SERVER_CONNECT: incoming connection: %s", addr_str);
     }
 
-    grpc_fd *fdobj = grpc_fd_create(fd, name);
+    grpc_fd* fdobj = grpc_fd_create(fd, name);
 
     grpc_pollset_add_fd(exec_ctx, read_notifier_pollset, fdobj);
 
     // Create acceptor.
-    grpc_tcp_server_acceptor *acceptor =
-        (grpc_tcp_server_acceptor *)gpr_malloc(sizeof(*acceptor));
+    grpc_tcp_server_acceptor* acceptor =
+        (grpc_tcp_server_acceptor*)gpr_malloc(sizeof(*acceptor));
     acceptor->from_server = sp->server;
     acceptor->port_index = sp->port_index;
     acceptor->fd_index = sp->fd_index;
@@ -279,18 +280,18 @@
 }
 
 /* Treat :: or 0.0.0.0 as a family-agnostic wildcard. */
-static grpc_error *add_wildcard_addrs_to_server(grpc_tcp_server *s,
+static grpc_error* add_wildcard_addrs_to_server(grpc_tcp_server* s,
                                                 unsigned port_index,
                                                 int requested_port,
-                                                int *out_port) {
+                                                int* out_port) {
   grpc_resolved_address wild4;
   grpc_resolved_address wild6;
   unsigned fd_index = 0;
   grpc_dualstack_mode dsmode;
-  grpc_tcp_listener *sp = NULL;
-  grpc_tcp_listener *sp2 = NULL;
-  grpc_error *v6_err = GRPC_ERROR_NONE;
-  grpc_error *v4_err = GRPC_ERROR_NONE;
+  grpc_tcp_listener* sp = NULL;
+  grpc_tcp_listener* sp2 = NULL;
+  grpc_error* v6_err = GRPC_ERROR_NONE;
+  grpc_error* v4_err = GRPC_ERROR_NONE;
   *out_port = -1;
 
   if (grpc_tcp_server_have_ifaddrs() && s->expand_wildcard_addrs) {
@@ -335,7 +336,7 @@
     }
     return GRPC_ERROR_NONE;
   } else {
-    grpc_error *root_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+    grpc_error* root_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
         "Failed to add any wildcard listeners");
     GPR_ASSERT(v6_err != GRPC_ERROR_NONE && v4_err != GRPC_ERROR_NONE);
     root_err = grpc_error_add_child(root_err, v6_err);
@@ -344,13 +345,13 @@
   }
 }
 
-static grpc_error *clone_port(grpc_tcp_listener *listener, unsigned count) {
-  grpc_tcp_listener *sp = NULL;
-  char *addr_str;
-  char *name;
-  grpc_error *err;
+static grpc_error* clone_port(grpc_tcp_listener* listener, unsigned count) {
+  grpc_tcp_listener* sp = NULL;
+  char* addr_str;
+  char* name;
+  grpc_error* err;
 
-  for (grpc_tcp_listener *l = listener->next; l && l->is_sibling; l = l->next) {
+  for (grpc_tcp_listener* l = listener->next; l && l->is_sibling; l = l->next) {
     l->fd_index += count;
   }
 
@@ -366,7 +367,7 @@
     listener->server->nports++;
     grpc_sockaddr_to_string(&addr_str, &listener->addr, 1);
     gpr_asprintf(&name, "tcp-server-listener:%s/clone-%d", addr_str, i);
-    sp = (grpc_tcp_listener *)gpr_malloc(sizeof(grpc_tcp_listener));
+    sp = (grpc_tcp_listener*)gpr_malloc(sizeof(grpc_tcp_listener));
     sp->next = listener->next;
     listener->next = sp;
     /* sp (the new listener) is a sibling of 'listener' (the original
@@ -392,16 +393,16 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_tcp_server_add_port(grpc_tcp_server *s,
-                                     const grpc_resolved_address *addr,
-                                     int *out_port) {
-  grpc_tcp_listener *sp;
+grpc_error* grpc_tcp_server_add_port(grpc_tcp_server* s,
+                                     const grpc_resolved_address* addr,
+                                     int* out_port) {
+  grpc_tcp_listener* sp;
   grpc_resolved_address sockname_temp;
   grpc_resolved_address addr6_v4mapped;
   int requested_port = grpc_sockaddr_get_port(addr);
   unsigned port_index = 0;
   grpc_dualstack_mode dsmode;
-  grpc_error *err;
+  grpc_error* err;
   *out_port = -1;
   if (s->tail != NULL) {
     port_index = s->tail->port_index + 1;
@@ -413,8 +414,8 @@
   if (requested_port == 0) {
     for (sp = s->head; sp; sp = sp->next) {
       sockname_temp.len = sizeof(struct sockaddr_storage);
-      if (0 == getsockname(sp->fd, (struct sockaddr *)&sockname_temp.addr,
-                           (socklen_t *)&sockname_temp.len)) {
+      if (0 == getsockname(sp->fd, (struct sockaddr*)&sockname_temp.addr,
+                           (socklen_t*)&sockname_temp.len)) {
         int used_port = grpc_sockaddr_get_port(&sockname_temp);
         if (used_port > 0) {
           memcpy(&sockname_temp, addr, sizeof(grpc_resolved_address));
@@ -442,10 +443,10 @@
 
 /* Return listener at port_index or NULL. Should only be called with s->mu
    locked. */
-static grpc_tcp_listener *get_port_index(grpc_tcp_server *s,
+static grpc_tcp_listener* get_port_index(grpc_tcp_server* s,
                                          unsigned port_index) {
   unsigned num_ports = 0;
-  grpc_tcp_listener *sp;
+  grpc_tcp_listener* sp;
   for (sp = s->head; sp; sp = sp->next) {
     if (!sp->is_sibling) {
       if (++num_ports > port_index) {
@@ -456,11 +457,11 @@
   return NULL;
 }
 
-unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server *s,
+unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server* s,
                                        unsigned port_index) {
   unsigned num_fds = 0;
   gpr_mu_lock(&s->mu);
-  grpc_tcp_listener *sp = get_port_index(s, port_index);
+  grpc_tcp_listener* sp = get_port_index(s, port_index);
   for (; sp; sp = sp->sibling) {
     ++num_fds;
   }
@@ -468,10 +469,10 @@
   return num_fds;
 }
 
-int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index,
+int grpc_tcp_server_port_fd(grpc_tcp_server* s, unsigned port_index,
                             unsigned fd_index) {
   gpr_mu_lock(&s->mu);
-  grpc_tcp_listener *sp = get_port_index(s, port_index);
+  grpc_tcp_listener* sp = get_port_index(s, port_index);
   for (; sp; sp = sp->sibling, --fd_index) {
     if (fd_index == 0) {
       gpr_mu_unlock(&s->mu);
@@ -482,12 +483,12 @@
   return -1;
 }
 
-void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s,
-                           grpc_pollset **pollsets, size_t pollset_count,
+void grpc_tcp_server_start(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s,
+                           grpc_pollset** pollsets, size_t pollset_count,
                            grpc_tcp_server_cb on_accept_cb,
-                           void *on_accept_cb_arg) {
+                           void* on_accept_cb_arg) {
   size_t i;
-  grpc_tcp_listener *sp;
+  grpc_tcp_listener* sp;
   GPR_ASSERT(on_accept_cb);
   gpr_mu_lock(&s->mu);
   GPR_ASSERT(!s->on_accept_cb);
@@ -524,20 +525,20 @@
   gpr_mu_unlock(&s->mu);
 }
 
-grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s) {
+grpc_tcp_server* grpc_tcp_server_ref(grpc_tcp_server* s) {
   gpr_ref_non_zero(&s->refs);
   return s;
 }
 
-void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s,
-                                           grpc_closure *shutdown_starting) {
+void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server* s,
+                                           grpc_closure* shutdown_starting) {
   gpr_mu_lock(&s->mu);
   grpc_closure_list_append(&s->shutdown_starting, shutdown_starting,
                            GRPC_ERROR_NONE);
   gpr_mu_unlock(&s->mu);
 }
 
-void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
+void grpc_tcp_server_unref(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s) {
   if (gpr_unref(&s->refs)) {
     grpc_tcp_server_shutdown_listeners(exec_ctx, s);
     gpr_mu_lock(&s->mu);
@@ -547,13 +548,13 @@
   }
 }
 
-void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx,
-                                        grpc_tcp_server *s) {
+void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx* exec_ctx,
+                                        grpc_tcp_server* s) {
   gpr_mu_lock(&s->mu);
   s->shutdown_listeners = true;
   /* shutdown all fd's */
   if (s->active_ports) {
-    grpc_tcp_listener *sp;
+    grpc_tcp_listener* sp;
     for (sp = s->head; sp; sp = sp->next) {
       grpc_fd_shutdown(exec_ctx, sp->emfd,
                        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server shutdown"));
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix.h b/src/core/lib/iomgr/tcp_server_utils_posix.h
index 6746333..608fba3 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix.h
+++ b/src/core/lib/iomgr/tcp_server_utils_posix.h
@@ -31,22 +31,22 @@
 /* one listening port */
 typedef struct grpc_tcp_listener {
   int fd;
-  grpc_fd *emfd;
-  grpc_tcp_server *server;
+  grpc_fd* emfd;
+  grpc_tcp_server* server;
   grpc_resolved_address addr;
   int port;
   unsigned port_index;
   unsigned fd_index;
   grpc_closure read_closure;
   grpc_closure destroyed_closure;
-  struct grpc_tcp_listener *next;
+  struct grpc_tcp_listener* next;
   /* sibling is a linked list of all listeners for a given port. add_port and
      clone_port place all new listeners in the same sibling list. A member of
      the 'sibling' list is also a member of the 'next' list. The head of each
      sibling list has is_sibling==0, and subsequent members of sibling lists
      have is_sibling==1. is_sibling allows separate sibling lists to be
      identified while iterating through 'next'. */
-  struct grpc_tcp_listener *sibling;
+  struct grpc_tcp_listener* sibling;
   int is_sibling;
 } grpc_tcp_listener;
 
@@ -55,7 +55,7 @@
   gpr_refcount refs;
   /* Called whenever accept() succeeds on a server port. */
   grpc_tcp_server_cb on_accept_cb;
-  void *on_accept_cb_arg;
+  void* on_accept_cb_arg;
 
   gpr_mu mu;
 
@@ -74,18 +74,18 @@
   bool expand_wildcard_addrs;
 
   /* linked list of server ports */
-  grpc_tcp_listener *head;
-  grpc_tcp_listener *tail;
+  grpc_tcp_listener* head;
+  grpc_tcp_listener* tail;
   unsigned nports;
 
   /* List of closures passed to shutdown_starting_add(). */
   grpc_closure_list shutdown_starting;
 
   /* shutdown callback */
-  grpc_closure *shutdown_complete;
+  grpc_closure* shutdown_complete;
 
   /* all pollsets interested in new connections */
-  grpc_pollset **pollsets;
+  grpc_pollset** pollsets;
   /* number of pollsets in the pollsets array */
   size_t pollset_count;
 
@@ -93,31 +93,31 @@
   gpr_atm next_pollset_to_assign;
 
   /* channel args for this server */
-  grpc_channel_args *channel_args;
+  grpc_channel_args* channel_args;
 };
 
 /* If successful, add a listener to \a s for \a addr, set \a dsmode for the
    socket, and return the \a listener. */
-grpc_error *grpc_tcp_server_add_addr(grpc_tcp_server *s,
-                                     const grpc_resolved_address *addr,
+grpc_error* grpc_tcp_server_add_addr(grpc_tcp_server* s,
+                                     const grpc_resolved_address* addr,
                                      unsigned port_index, unsigned fd_index,
-                                     grpc_dualstack_mode *dsmode,
-                                     grpc_tcp_listener **listener);
+                                     grpc_dualstack_mode* dsmode,
+                                     grpc_tcp_listener** listener);
 
 /* Get all addresses assigned to network interfaces on the machine and create a
    listener for each. requested_port is the port to use for every listener, or 0
    to select one random port that will be used for every listener. Set *out_port
    to the port selected. Return GRPC_ERROR_NONE only if all listeners were
    added. */
-grpc_error *grpc_tcp_server_add_all_local_addrs(grpc_tcp_server *s,
+grpc_error* grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
                                                 unsigned port_index,
                                                 int requested_port,
-                                                int *out_port);
+                                                int* out_port);
 
 /* Prepare a recently-created socket for listening. */
-grpc_error *grpc_tcp_server_prepare_socket(int fd,
-                                           const grpc_resolved_address *addr,
-                                           bool so_reuseport, int *port);
+grpc_error* grpc_tcp_server_prepare_socket(int fd,
+                                           const grpc_resolved_address* addr,
+                                           bool so_reuseport, int* port);
 /* Ruturn true if the platform supports ifaddrs */
 bool grpc_tcp_server_have_ifaddrs(void);
 
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_common.cc b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
index a828bee..51e6731 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
+++ b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
@@ -46,14 +46,14 @@
 static void init_max_accept_queue_size(void) {
   int n = SOMAXCONN;
   char buf[64];
-  FILE *fp = fopen("/proc/sys/net/core/somaxconn", "r");
+  FILE* fp = fopen("/proc/sys/net/core/somaxconn", "r");
   if (fp == NULL) {
     /* 2.4 kernel. */
     s_max_accept_queue_size = SOMAXCONN;
     return;
   }
   if (fgets(buf, sizeof buf, fp)) {
-    char *end;
+    char* end;
     long i = strtol(buf, &end, 10);
     if (i > 0 && i <= INT_MAX && end && *end == 0) {
       n = (int)i;
@@ -75,16 +75,16 @@
   return s_max_accept_queue_size;
 }
 
-static grpc_error *add_socket_to_server(grpc_tcp_server *s, int fd,
-                                        const grpc_resolved_address *addr,
+static grpc_error* add_socket_to_server(grpc_tcp_server* s, int fd,
+                                        const grpc_resolved_address* addr,
                                         unsigned port_index, unsigned fd_index,
-                                        grpc_tcp_listener **listener) {
-  grpc_tcp_listener *sp = NULL;
+                                        grpc_tcp_listener** listener) {
+  grpc_tcp_listener* sp = NULL;
   int port = -1;
-  char *addr_str;
-  char *name;
+  char* addr_str;
+  char* name;
 
-  grpc_error *err =
+  grpc_error* err =
       grpc_tcp_server_prepare_socket(fd, addr, s->so_reuseport, &port);
   if (err == GRPC_ERROR_NONE) {
     GPR_ASSERT(port > 0);
@@ -93,7 +93,7 @@
     gpr_mu_lock(&s->mu);
     s->nports++;
     GPR_ASSERT(!s->on_accept_cb && "must add ports before starting server");
-    sp = (grpc_tcp_listener *)gpr_malloc(sizeof(grpc_tcp_listener));
+    sp = (grpc_tcp_listener*)gpr_malloc(sizeof(grpc_tcp_listener));
     sp->next = NULL;
     if (s->head == NULL) {
       s->head = sp;
@@ -122,14 +122,14 @@
 
 /* If successful, add a listener to s for addr, set *dsmode for the socket, and
    return the *listener. */
-grpc_error *grpc_tcp_server_add_addr(grpc_tcp_server *s,
-                                     const grpc_resolved_address *addr,
+grpc_error* grpc_tcp_server_add_addr(grpc_tcp_server* s,
+                                     const grpc_resolved_address* addr,
                                      unsigned port_index, unsigned fd_index,
-                                     grpc_dualstack_mode *dsmode,
-                                     grpc_tcp_listener **listener) {
+                                     grpc_dualstack_mode* dsmode,
+                                     grpc_tcp_listener** listener) {
   grpc_resolved_address addr4_copy;
   int fd;
-  grpc_error *err =
+  grpc_error* err =
       grpc_create_dualstack_socket(addr, SOCK_STREAM, 0, dsmode, &fd);
   if (err != GRPC_ERROR_NONE) {
     return err;
@@ -142,11 +142,11 @@
 }
 
 /* Prepare a recently-created socket for listening. */
-grpc_error *grpc_tcp_server_prepare_socket(int fd,
-                                           const grpc_resolved_address *addr,
-                                           bool so_reuseport, int *port) {
+grpc_error* grpc_tcp_server_prepare_socket(int fd,
+                                           const grpc_resolved_address* addr,
+                                           bool so_reuseport, int* port) {
   grpc_resolved_address sockname_temp;
-  grpc_error *err = GRPC_ERROR_NONE;
+  grpc_error* err = GRPC_ERROR_NONE;
 
   GPR_ASSERT(fd >= 0);
 
@@ -169,7 +169,7 @@
   if (err != GRPC_ERROR_NONE) goto error;
 
   GPR_ASSERT(addr->len < ~(socklen_t)0);
-  if (bind(fd, (struct sockaddr *)addr->addr, (socklen_t)addr->len) < 0) {
+  if (bind(fd, (struct sockaddr*)addr->addr, (socklen_t)addr->len) < 0) {
     err = GRPC_OS_ERROR(errno, "bind");
     goto error;
   }
@@ -181,8 +181,8 @@
 
   sockname_temp.len = sizeof(struct sockaddr_storage);
 
-  if (getsockname(fd, (struct sockaddr *)sockname_temp.addr,
-                  (socklen_t *)&sockname_temp.len) < 0) {
+  if (getsockname(fd, (struct sockaddr*)sockname_temp.addr,
+                  (socklen_t*)&sockname_temp.len) < 0) {
     err = GRPC_OS_ERROR(errno, "getsockname");
     goto error;
   }
@@ -195,7 +195,7 @@
   if (fd >= 0) {
     close(fd);
   }
-  grpc_error *ret =
+  grpc_error* ret =
       grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
                              "Unable to configure socket", &err, 1),
                          GRPC_ERROR_INT_FD, fd);
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc b/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
index a243b69..b7437db 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
+++ b/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
@@ -36,9 +36,9 @@
 #include "src/core/lib/iomgr/sockaddr_utils.h"
 
 /* Return the listener in s with address addr or NULL. */
-static grpc_tcp_listener *find_listener_with_addr(grpc_tcp_server *s,
-                                                  grpc_resolved_address *addr) {
-  grpc_tcp_listener *l;
+static grpc_tcp_listener* find_listener_with_addr(grpc_tcp_server* s,
+                                                  grpc_resolved_address* addr) {
+  grpc_tcp_listener* l;
   gpr_mu_lock(&s->mu);
   for (l = s->head; l != NULL; l = l->next) {
     if (l->addr.len != addr->len) {
@@ -53,12 +53,12 @@
 }
 
 /* Bind to "::" to get a port number not used by any address. */
-static grpc_error *get_unused_port(int *port) {
+static grpc_error* get_unused_port(int* port) {
   grpc_resolved_address wild;
   grpc_sockaddr_make_wildcard6(0, &wild);
   grpc_dualstack_mode dsmode;
   int fd;
-  grpc_error *err =
+  grpc_error* err =
       grpc_create_dualstack_socket(&wild, SOCK_STREAM, 0, &dsmode, &fd);
   if (err != GRPC_ERROR_NONE) {
     return err;
@@ -66,12 +66,12 @@
   if (dsmode == GRPC_DSMODE_IPV4) {
     grpc_sockaddr_make_wildcard4(0, &wild);
   }
-  if (bind(fd, (const struct sockaddr *)wild.addr, (socklen_t)wild.len) != 0) {
+  if (bind(fd, (const struct sockaddr*)wild.addr, (socklen_t)wild.len) != 0) {
     err = GRPC_OS_ERROR(errno, "bind");
     close(fd);
     return err;
   }
-  if (getsockname(fd, (struct sockaddr *)wild.addr, (socklen_t *)&wild.len) !=
+  if (getsockname(fd, (struct sockaddr*)wild.addr, (socklen_t*)&wild.len) !=
       0) {
     err = GRPC_OS_ERROR(errno, "getsockname");
     close(fd);
@@ -83,15 +83,15 @@
                     : GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_tcp_server_add_all_local_addrs(grpc_tcp_server *s,
+grpc_error* grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
                                                 unsigned port_index,
                                                 int requested_port,
-                                                int *out_port) {
-  struct ifaddrs *ifa = NULL;
-  struct ifaddrs *ifa_it;
+                                                int* out_port) {
+  struct ifaddrs* ifa = NULL;
+  struct ifaddrs* ifa_it;
   unsigned fd_index = 0;
-  grpc_tcp_listener *sp = NULL;
-  grpc_error *err = GRPC_ERROR_NONE;
+  grpc_tcp_listener* sp = NULL;
+  grpc_error* err = GRPC_ERROR_NONE;
   if (requested_port == 0) {
     /* Note: There could be a race where some local addrs can listen on the
        selected port and some can't. The sane way to handle this would be to
@@ -109,10 +109,10 @@
   }
   for (ifa_it = ifa; ifa_it != NULL; ifa_it = ifa_it->ifa_next) {
     grpc_resolved_address addr;
-    char *addr_str = NULL;
+    char* addr_str = NULL;
     grpc_dualstack_mode dsmode;
-    grpc_tcp_listener *new_sp = NULL;
-    const char *ifa_name = (ifa_it->ifa_name ? ifa_it->ifa_name : "<unknown>");
+    grpc_tcp_listener* new_sp = NULL;
+    const char* ifa_name = (ifa_it->ifa_name ? ifa_it->ifa_name : "<unknown>");
     if (ifa_it->ifa_addr == NULL) {
       continue;
     } else if (ifa_it->ifa_addr->sa_family == AF_INET) {
@@ -144,8 +144,8 @@
     }
     if ((err = grpc_tcp_server_add_addr(s, &addr, port_index, fd_index, &dsmode,
                                         &new_sp)) != GRPC_ERROR_NONE) {
-      char *err_str = NULL;
-      grpc_error *root_err;
+      char* err_str = NULL;
+      grpc_error* root_err;
       if (gpr_asprintf(&err_str, "Failed to add listener: %s", addr_str) < 0) {
         err_str = gpr_strdup("Failed to add listener");
       }
diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc b/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
index 34eab20..2d72b95 100644
--- a/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
+++ b/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
@@ -22,10 +22,10 @@
 
 #include "src/core/lib/iomgr/tcp_server_utils_posix.h"
 
-grpc_error *grpc_tcp_server_add_all_local_addrs(grpc_tcp_server *s,
+grpc_error* grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
                                                 unsigned port_index,
                                                 int requested_port,
-                                                int *out_port) {
+                                                int* out_port) {
   return GRPC_ERROR_CREATE_FROM_STATIC_STRING("no ifaddrs available");
 }
 
diff --git a/src/core/lib/iomgr/tcp_server_uv.cc b/src/core/lib/iomgr/tcp_server_uv.cc
index 2880fe2..0eed4d4 100644
--- a/src/core/lib/iomgr/tcp_server_uv.cc
+++ b/src/core/lib/iomgr/tcp_server_uv.cc
@@ -37,12 +37,12 @@
 /* one listening port */
 typedef struct grpc_tcp_listener grpc_tcp_listener;
 struct grpc_tcp_listener {
-  uv_tcp_t *handle;
-  grpc_tcp_server *server;
+  uv_tcp_t* handle;
+  grpc_tcp_server* server;
   unsigned port_index;
   int port;
   /* linked list */
-  struct grpc_tcp_listener *next;
+  struct grpc_tcp_listener* next;
 
   bool closed;
 
@@ -54,37 +54,37 @@
 
   /* Called whenever accept() succeeds on a server port. */
   grpc_tcp_server_cb on_accept_cb;
-  void *on_accept_cb_arg;
+  void* on_accept_cb_arg;
 
   int open_ports;
 
   /* linked list of server ports */
-  grpc_tcp_listener *head;
-  grpc_tcp_listener *tail;
+  grpc_tcp_listener* head;
+  grpc_tcp_listener* tail;
 
   /* List of closures passed to shutdown_starting_add(). */
   grpc_closure_list shutdown_starting;
 
   /* shutdown callback */
-  grpc_closure *shutdown_complete;
+  grpc_closure* shutdown_complete;
 
   bool shutdown;
 
-  grpc_resource_quota *resource_quota;
+  grpc_resource_quota* resource_quota;
 };
 
-grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx,
-                                   grpc_closure *shutdown_complete,
-                                   const grpc_channel_args *args,
-                                   grpc_tcp_server **server) {
-  grpc_tcp_server *s = (grpc_tcp_server *)gpr_malloc(sizeof(grpc_tcp_server));
+grpc_error* grpc_tcp_server_create(grpc_exec_ctx* exec_ctx,
+                                   grpc_closure* shutdown_complete,
+                                   const grpc_channel_args* args,
+                                   grpc_tcp_server** server) {
+  grpc_tcp_server* s = (grpc_tcp_server*)gpr_malloc(sizeof(grpc_tcp_server));
   s->resource_quota = grpc_resource_quota_create(NULL);
   for (size_t i = 0; i < (args == NULL ? 0 : args->num_args); i++) {
     if (0 == strcmp(GRPC_ARG_RESOURCE_QUOTA, args->args[i].key)) {
       if (args->args[i].type == GRPC_ARG_POINTER) {
         grpc_resource_quota_unref_internal(exec_ctx, s->resource_quota);
         s->resource_quota = grpc_resource_quota_ref_internal(
-            (grpc_resource_quota *)args->args[i].value.pointer.p);
+            (grpc_resource_quota*)args->args[i].value.pointer.p);
       } else {
         grpc_resource_quota_unref_internal(exec_ctx, s->resource_quota);
         gpr_free(s);
@@ -107,26 +107,26 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s) {
+grpc_tcp_server* grpc_tcp_server_ref(grpc_tcp_server* s) {
   GRPC_UV_ASSERT_SAME_THREAD();
   gpr_ref(&s->refs);
   return s;
 }
 
-void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s,
-                                           grpc_closure *shutdown_starting) {
+void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server* s,
+                                           grpc_closure* shutdown_starting) {
   grpc_closure_list_append(&s->shutdown_starting, shutdown_starting,
                            GRPC_ERROR_NONE);
 }
 
-static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
+static void finish_shutdown(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s) {
   GPR_ASSERT(s->shutdown);
   if (s->shutdown_complete != NULL) {
     GRPC_CLOSURE_SCHED(exec_ctx, s->shutdown_complete, GRPC_ERROR_NONE);
   }
 
   while (s->head) {
-    grpc_tcp_listener *sp = s->head;
+    grpc_tcp_listener* sp = s->head;
     s->head = sp->next;
     sp->next = NULL;
     gpr_free(sp->handle);
@@ -136,8 +136,8 @@
   gpr_free(s);
 }
 
-static void handle_close_callback(uv_handle_t *handle) {
-  grpc_tcp_listener *sp = (grpc_tcp_listener *)handle->data;
+static void handle_close_callback(uv_handle_t* handle) {
+  grpc_tcp_listener* sp = (grpc_tcp_listener*)handle->data;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   sp->server->open_ports--;
   if (sp->server->open_ports == 0 && sp->server->shutdown) {
@@ -146,16 +146,16 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void close_listener(grpc_tcp_listener *sp) {
+static void close_listener(grpc_tcp_listener* sp) {
   if (!sp->closed) {
     sp->closed = true;
-    uv_close((uv_handle_t *)sp->handle, handle_close_callback);
+    uv_close((uv_handle_t*)sp->handle, handle_close_callback);
   }
 }
 
-static void tcp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
+static void tcp_server_destroy(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s) {
   int immediately_done = 0;
-  grpc_tcp_listener *sp;
+  grpc_tcp_listener* sp;
 
   GPR_ASSERT(!s->shutdown);
   s->shutdown = true;
@@ -172,7 +172,7 @@
   }
 }
 
-void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
+void grpc_tcp_server_unref(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s) {
   GRPC_UV_ASSERT_SAME_THREAD();
   if (gpr_unref(&s->refs)) {
     /* Complete shutdown_starting work before destroying. */
@@ -189,31 +189,31 @@
   }
 }
 
-static void finish_accept(grpc_exec_ctx *exec_ctx, grpc_tcp_listener *sp) {
-  grpc_tcp_server_acceptor *acceptor =
-      (grpc_tcp_server_acceptor *)gpr_malloc(sizeof(*acceptor));
-  uv_tcp_t *client = NULL;
-  grpc_endpoint *ep = NULL;
+static void finish_accept(grpc_exec_ctx* exec_ctx, grpc_tcp_listener* sp) {
+  grpc_tcp_server_acceptor* acceptor =
+      (grpc_tcp_server_acceptor*)gpr_malloc(sizeof(*acceptor));
+  uv_tcp_t* client = NULL;
+  grpc_endpoint* ep = NULL;
   grpc_resolved_address peer_name;
-  char *peer_name_string;
+  char* peer_name_string;
   int err;
-  uv_tcp_t *server = sp->handle;
+  uv_tcp_t* server = sp->handle;
 
-  client = (uv_tcp_t *)gpr_malloc(sizeof(uv_tcp_t));
+  client = (uv_tcp_t*)gpr_malloc(sizeof(uv_tcp_t));
   uv_tcp_init(uv_default_loop(), client);
   // UV documentation says this is guaranteed to succeed
-  uv_accept((uv_stream_t *)server, (uv_stream_t *)client);
+  uv_accept((uv_stream_t*)server, (uv_stream_t*)client);
   peer_name_string = NULL;
   memset(&peer_name, 0, sizeof(grpc_resolved_address));
   peer_name.len = sizeof(struct sockaddr_storage);
-  err = uv_tcp_getpeername(client, (struct sockaddr *)&peer_name.addr,
-                           (int *)&peer_name.len);
+  err = uv_tcp_getpeername(client, (struct sockaddr*)&peer_name.addr,
+                           (int*)&peer_name.len);
   if (err == 0) {
     peer_name_string = grpc_sockaddr_to_uri(&peer_name);
   } else {
     gpr_log(GPR_INFO, "uv_tcp_getpeername error: %s", uv_strerror(err));
   }
-  if (grpc_tcp_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     if (peer_name_string) {
       gpr_log(GPR_DEBUG, "SERVER_CONNECT: %p accepted connection: %s",
               sp->server, peer_name_string);
@@ -230,8 +230,8 @@
   gpr_free(peer_name_string);
 }
 
-static void on_connect(uv_stream_t *server, int status) {
-  grpc_tcp_listener *sp = (grpc_tcp_listener *)server->data;
+static void on_connect(uv_stream_t* server, int status) {
+  grpc_tcp_listener* sp = (grpc_tcp_listener*)server->data;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
   if (status < 0) {
@@ -247,7 +247,7 @@
 
   GPR_ASSERT(!sp->has_pending_connection);
 
-  if (grpc_tcp_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     gpr_log(GPR_DEBUG, "SERVER_CONNECT: %p incoming connection", sp->server);
   }
 
@@ -260,18 +260,18 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static grpc_error *add_socket_to_server(grpc_tcp_server *s, uv_tcp_t *handle,
-                                        const grpc_resolved_address *addr,
+static grpc_error* add_socket_to_server(grpc_tcp_server* s, uv_tcp_t* handle,
+                                        const grpc_resolved_address* addr,
                                         unsigned port_index,
-                                        grpc_tcp_listener **listener) {
-  grpc_tcp_listener *sp = NULL;
+                                        grpc_tcp_listener** listener) {
+  grpc_tcp_listener* sp = NULL;
   int port = -1;
   int status;
-  grpc_error *error;
+  grpc_error* error;
   grpc_resolved_address sockname_temp;
 
   // The last argument to uv_tcp_bind is flags
-  status = uv_tcp_bind(handle, (struct sockaddr *)addr->addr, 0);
+  status = uv_tcp_bind(handle, (struct sockaddr*)addr->addr, 0);
   if (status != 0) {
     error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to bind to port");
     error =
@@ -280,7 +280,7 @@
     return error;
   }
 
-  status = uv_listen((uv_stream_t *)handle, SOMAXCONN, on_connect);
+  status = uv_listen((uv_stream_t*)handle, SOMAXCONN, on_connect);
   if (status != 0) {
     error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to listen to port");
     error =
@@ -290,8 +290,8 @@
   }
 
   sockname_temp.len = (int)sizeof(struct sockaddr_storage);
-  status = uv_tcp_getsockname(handle, (struct sockaddr *)&sockname_temp.addr,
-                              (int *)&sockname_temp.len);
+  status = uv_tcp_getsockname(handle, (struct sockaddr*)&sockname_temp.addr,
+                              (int*)&sockname_temp.len);
   if (status != 0) {
     error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("getsockname failed");
     error =
@@ -304,7 +304,7 @@
 
   GPR_ASSERT(port >= 0);
   GPR_ASSERT(!s->on_accept_cb && "must add ports before starting server");
-  sp = (grpc_tcp_listener *)gpr_zalloc(sizeof(grpc_tcp_listener));
+  sp = (grpc_tcp_listener*)gpr_zalloc(sizeof(grpc_tcp_listener));
   sp->next = NULL;
   if (s->head == NULL) {
     s->head = sp;
@@ -325,19 +325,19 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_tcp_server_add_port(grpc_tcp_server *s,
-                                     const grpc_resolved_address *addr,
-                                     int *port) {
+grpc_error* grpc_tcp_server_add_port(grpc_tcp_server* s,
+                                     const grpc_resolved_address* addr,
+                                     int* port) {
   // This function is mostly copied from tcp_server_windows.c
-  grpc_tcp_listener *sp = NULL;
-  uv_tcp_t *handle;
+  grpc_tcp_listener* sp = NULL;
+  uv_tcp_t* handle;
   grpc_resolved_address addr6_v4mapped;
   grpc_resolved_address wildcard;
-  grpc_resolved_address *allocated_addr = NULL;
+  grpc_resolved_address* allocated_addr = NULL;
   grpc_resolved_address sockname_temp;
   unsigned port_index = 0;
   int status;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   int family;
 
   GRPC_UV_ASSERT_SAME_THREAD();
@@ -352,12 +352,12 @@
     for (sp = s->head; sp; sp = sp->next) {
       sockname_temp.len = sizeof(struct sockaddr_storage);
       if (0 == uv_tcp_getsockname(sp->handle,
-                                  (struct sockaddr *)&sockname_temp.addr,
-                                  (int *)&sockname_temp.len)) {
+                                  (struct sockaddr*)&sockname_temp.addr,
+                                  (int*)&sockname_temp.len)) {
         *port = grpc_sockaddr_get_port(&sockname_temp);
         if (*port > 0) {
-          allocated_addr = (grpc_resolved_address *)gpr_malloc(
-              sizeof(grpc_resolved_address));
+          allocated_addr =
+              (grpc_resolved_address*)gpr_malloc(sizeof(grpc_resolved_address));
           memcpy(allocated_addr, addr, sizeof(grpc_resolved_address));
           grpc_sockaddr_set_port(allocated_addr, *port);
           addr = allocated_addr;
@@ -378,14 +378,14 @@
     addr = &wildcard;
   }
 
-  handle = (uv_tcp_t *)gpr_malloc(sizeof(uv_tcp_t));
+  handle = (uv_tcp_t*)gpr_malloc(sizeof(uv_tcp_t));
 
   family = grpc_sockaddr_get_family(addr);
   status = uv_tcp_init_ex(uv_default_loop(), handle, (unsigned int)family);
 #if defined(GPR_LINUX) && defined(SO_REUSEPORT)
   if (family == AF_INET || family == AF_INET6) {
     int fd;
-    uv_fileno((uv_handle_t *)handle, &fd);
+    uv_fileno((uv_handle_t*)handle, &fd);
     int enable = 1;
     setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(enable));
   }
@@ -403,10 +403,10 @@
 
   gpr_free(allocated_addr);
 
-  if (grpc_tcp_trace.enabled()) {
-    char *port_string;
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
+    char* port_string;
     grpc_sockaddr_to_string(&port_string, addr, 0);
-    const char *str = grpc_error_string(error);
+    const char* str = grpc_error_string(error);
     if (port_string) {
       gpr_log(GPR_DEBUG, "SERVER %p add_port %s error=%s", s, port_string, str);
       gpr_free(port_string);
@@ -416,7 +416,7 @@
   }
 
   if (error != GRPC_ERROR_NONE) {
-    grpc_error *error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+    grpc_error* error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
         "Failed to add port to server", &error, 1);
     GRPC_ERROR_UNREF(error);
     error = error_out;
@@ -428,14 +428,14 @@
   return error;
 }
 
-void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *server,
-                           grpc_pollset **pollsets, size_t pollset_count,
-                           grpc_tcp_server_cb on_accept_cb, void *cb_arg) {
-  grpc_tcp_listener *sp;
+void grpc_tcp_server_start(grpc_exec_ctx* exec_ctx, grpc_tcp_server* server,
+                           grpc_pollset** pollsets, size_t pollset_count,
+                           grpc_tcp_server_cb on_accept_cb, void* cb_arg) {
+  grpc_tcp_listener* sp;
   (void)pollsets;
   (void)pollset_count;
   GRPC_UV_ASSERT_SAME_THREAD();
-  if (grpc_tcp_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     gpr_log(GPR_DEBUG, "SERVER_START %p", server);
   }
   GPR_ASSERT(on_accept_cb);
@@ -450,7 +450,7 @@
   }
 }
 
-void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx,
-                                        grpc_tcp_server *s) {}
+void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx* exec_ctx,
+                                        grpc_tcp_server* s) {}
 
 #endif /* GRPC_UV */
diff --git a/src/core/lib/iomgr/tcp_server_windows.cc b/src/core/lib/iomgr/tcp_server_windows.cc
index f198aaa..f538194 100644
--- a/src/core/lib/iomgr/tcp_server_windows.cc
+++ b/src/core/lib/iomgr/tcp_server_windows.cc
@@ -52,11 +52,11 @@
   /* This will hold the socket for the next accept. */
   SOCKET new_socket;
   /* The listener winsocket. */
-  grpc_winsocket *socket;
+  grpc_winsocket* socket;
   /* The actual TCP port number. */
   int port;
   unsigned port_index;
-  grpc_tcp_server *server;
+  grpc_tcp_server* server;
   /* The cached AcceptEx for that port. */
   LPFN_ACCEPTEX AcceptEx;
   int shutting_down;
@@ -64,7 +64,7 @@
   /* closure for socket notification of accept being ready */
   grpc_closure on_accept;
   /* linked list */
-  struct grpc_tcp_listener *next;
+  struct grpc_tcp_listener* next;
 };
 
 /* the overall server */
@@ -72,7 +72,7 @@
   gpr_refcount refs;
   /* Called whenever accept() succeeds on a server port. */
   grpc_tcp_server_cb on_accept_cb;
-  void *on_accept_cb_arg;
+  void* on_accept_cb_arg;
 
   gpr_mu mu;
 
@@ -80,25 +80,25 @@
   int active_ports;
 
   /* linked list of server ports */
-  grpc_tcp_listener *head;
-  grpc_tcp_listener *tail;
+  grpc_tcp_listener* head;
+  grpc_tcp_listener* tail;
 
   /* List of closures passed to shutdown_starting_add(). */
   grpc_closure_list shutdown_starting;
 
   /* shutdown callback */
-  grpc_closure *shutdown_complete;
+  grpc_closure* shutdown_complete;
 
-  grpc_channel_args *channel_args;
+  grpc_channel_args* channel_args;
 };
 
 /* Public function. Allocates the proper data structures to hold a
    grpc_tcp_server. */
-grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx,
-                                   grpc_closure *shutdown_complete,
-                                   const grpc_channel_args *args,
-                                   grpc_tcp_server **server) {
-  grpc_tcp_server *s = (grpc_tcp_server *)gpr_malloc(sizeof(grpc_tcp_server));
+grpc_error* grpc_tcp_server_create(grpc_exec_ctx* exec_ctx,
+                                   grpc_closure* shutdown_complete,
+                                   const grpc_channel_args* args,
+                                   grpc_tcp_server** server) {
+  grpc_tcp_server* s = (grpc_tcp_server*)gpr_malloc(sizeof(grpc_tcp_server));
   s->channel_args = grpc_channel_args_copy(args);
   gpr_ref_init(&s->refs, 1);
   gpr_mu_init(&s->mu);
@@ -114,15 +114,15 @@
   return GRPC_ERROR_NONE;
 }
 
-static void destroy_server(grpc_exec_ctx *exec_ctx, void *arg,
-                           grpc_error *error) {
-  grpc_tcp_server *s = (grpc_tcp_server *)arg;
+static void destroy_server(grpc_exec_ctx* exec_ctx, void* arg,
+                           grpc_error* error) {
+  grpc_tcp_server* s = (grpc_tcp_server*)arg;
 
   /* Now that the accepts have been aborted, we can destroy the sockets.
      The IOCP won't get notified on these, so we can flag them as already
      closed by the system. */
   while (s->head) {
-    grpc_tcp_listener *sp = s->head;
+    grpc_tcp_listener* sp = s->head;
     s->head = sp->next;
     sp->next = NULL;
     grpc_winsocket_destroy(sp->socket);
@@ -132,32 +132,33 @@
   gpr_free(s);
 }
 
-static void finish_shutdown_locked(grpc_exec_ctx *exec_ctx,
-                                   grpc_tcp_server *s) {
+static void finish_shutdown_locked(grpc_exec_ctx* exec_ctx,
+                                   grpc_tcp_server* s) {
   if (s->shutdown_complete != NULL) {
     GRPC_CLOSURE_SCHED(exec_ctx, s->shutdown_complete, GRPC_ERROR_NONE);
   }
 
-  GRPC_CLOSURE_SCHED(exec_ctx, GRPC_CLOSURE_CREATE(destroy_server, s,
-                                                   grpc_schedule_on_exec_ctx),
-                     GRPC_ERROR_NONE);
+  GRPC_CLOSURE_SCHED(
+      exec_ctx,
+      GRPC_CLOSURE_CREATE(destroy_server, s, grpc_schedule_on_exec_ctx),
+      GRPC_ERROR_NONE);
 }
 
-grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s) {
+grpc_tcp_server* grpc_tcp_server_ref(grpc_tcp_server* s) {
   gpr_ref_non_zero(&s->refs);
   return s;
 }
 
-void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s,
-                                           grpc_closure *shutdown_starting) {
+void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server* s,
+                                           grpc_closure* shutdown_starting) {
   gpr_mu_lock(&s->mu);
   grpc_closure_list_append(&s->shutdown_starting, shutdown_starting,
                            GRPC_ERROR_NONE);
   gpr_mu_unlock(&s->mu);
 }
 
-static void tcp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
-  grpc_tcp_listener *sp;
+static void tcp_server_destroy(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s) {
+  grpc_tcp_listener* sp;
   gpr_mu_lock(&s->mu);
 
   /* First, shutdown all fd's. This will queue abortion calls for all
@@ -173,7 +174,7 @@
   gpr_mu_unlock(&s->mu);
 }
 
-void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
+void grpc_tcp_server_unref(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s) {
   if (gpr_unref(&s->refs)) {
     grpc_tcp_server_shutdown_listeners(exec_ctx, s);
     gpr_mu_lock(&s->mu);
@@ -184,11 +185,11 @@
 }
 
 /* Prepare (bind) a recently-created socket for listening. */
-static grpc_error *prepare_socket(SOCKET sock,
-                                  const grpc_resolved_address *addr,
-                                  int *port) {
+static grpc_error* prepare_socket(SOCKET sock,
+                                  const grpc_resolved_address* addr,
+                                  int* port) {
   grpc_resolved_address sockname_temp;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   int sockname_temp_len;
 
   error = grpc_tcp_prepare_socket(sock);
@@ -196,7 +197,7 @@
     goto failure;
   }
 
-  if (bind(sock, (const struct sockaddr *)addr->addr, (int)addr->len) ==
+  if (bind(sock, (const struct sockaddr*)addr->addr, (int)addr->len) ==
       SOCKET_ERROR) {
     error = GRPC_WSA_ERROR(WSAGetLastError(), "bind");
     goto failure;
@@ -208,7 +209,7 @@
   }
 
   sockname_temp_len = sizeof(struct sockaddr_storage);
-  if (getsockname(sock, (struct sockaddr *)sockname_temp.addr,
+  if (getsockname(sock, (struct sockaddr*)sockname_temp.addr,
                   &sockname_temp_len) == SOCKET_ERROR) {
     error = GRPC_WSA_ERROR(WSAGetLastError(), "getsockname");
     goto failure;
@@ -220,7 +221,7 @@
 
 failure:
   GPR_ASSERT(error != GRPC_ERROR_NONE);
-  char *tgtaddr = grpc_sockaddr_to_uri(addr);
+  char* tgtaddr = grpc_sockaddr_to_uri(addr);
   grpc_error_set_int(
       grpc_error_set_str(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
                              "Failed to prepare server socket", &error, 1),
@@ -233,8 +234,8 @@
   return error;
 }
 
-static void decrement_active_ports_and_notify_locked(grpc_exec_ctx *exec_ctx,
-                                                     grpc_tcp_listener *sp) {
+static void decrement_active_ports_and_notify_locked(grpc_exec_ctx* exec_ctx,
+                                                     grpc_tcp_listener* sp) {
   sp->shutting_down = 0;
   GPR_ASSERT(sp->server->active_ports > 0);
   if (0 == --sp->server->active_ports) {
@@ -244,13 +245,13 @@
 
 /* In order to do an async accept, we need to create a socket first which
    will be the one assigned to the new incoming connection. */
-static grpc_error *start_accept_locked(grpc_exec_ctx *exec_ctx,
-                                       grpc_tcp_listener *port) {
+static grpc_error* start_accept_locked(grpc_exec_ctx* exec_ctx,
+                                       grpc_tcp_listener* port) {
   SOCKET sock = INVALID_SOCKET;
   BOOL success;
   DWORD addrlen = sizeof(struct sockaddr_in6) + 16;
   DWORD bytes_received = 0;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   if (port->shutting_down) {
     return GRPC_ERROR_NONE;
@@ -295,14 +296,14 @@
 }
 
 /* Event manager callback when reads are ready. */
-static void on_accept(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_tcp_listener *sp = (grpc_tcp_listener *)arg;
+static void on_accept(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_tcp_listener* sp = (grpc_tcp_listener*)arg;
   SOCKET sock = sp->new_socket;
-  grpc_winsocket_callback_info *info = &sp->socket->read_info;
-  grpc_endpoint *ep = NULL;
+  grpc_winsocket_callback_info* info = &sp->socket->read_info;
+  grpc_endpoint* ep = NULL;
   grpc_resolved_address peer_name;
-  char *peer_name_string;
-  char *fd_name;
+  char* peer_name_string;
+  char* fd_name;
   DWORD transfered_bytes;
   DWORD flags;
   BOOL wsa_success;
@@ -316,7 +317,7 @@
      this is necessary in the read/write case, it's useless for the accept
      case. We only need to adjust the pending callback count */
   if (error != GRPC_ERROR_NONE) {
-    const char *msg = grpc_error_string(error);
+    const char* msg = grpc_error_string(error);
     gpr_log(GPR_INFO, "Skipping on_accept due to error: %s", msg);
 
     gpr_mu_unlock(&sp->server->mu);
@@ -330,7 +331,7 @@
                                        &transfered_bytes, FALSE, &flags);
   if (!wsa_success) {
     if (!sp->shutting_down) {
-      char *utf8_message = gpr_format_message(WSAGetLastError());
+      char* utf8_message = gpr_format_message(WSAGetLastError());
       gpr_log(GPR_ERROR, "on_accept error: %s", utf8_message);
       gpr_free(utf8_message);
     }
@@ -339,20 +340,19 @@
     if (!sp->shutting_down) {
       peer_name_string = NULL;
       err = setsockopt(sock, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT,
-                       (char *)&sp->socket->socket, sizeof(sp->socket->socket));
+                       (char*)&sp->socket->socket, sizeof(sp->socket->socket));
       if (err) {
-        char *utf8_message = gpr_format_message(WSAGetLastError());
+        char* utf8_message = gpr_format_message(WSAGetLastError());
         gpr_log(GPR_ERROR, "setsockopt error: %s", utf8_message);
         gpr_free(utf8_message);
       }
       int peer_name_len = (int)peer_name.len;
-      err =
-          getpeername(sock, (struct sockaddr *)peer_name.addr, &peer_name_len);
+      err = getpeername(sock, (struct sockaddr*)peer_name.addr, &peer_name_len);
       peer_name.len = (size_t)peer_name_len;
       if (!err) {
         peer_name_string = grpc_sockaddr_to_uri(&peer_name);
       } else {
-        char *utf8_message = gpr_format_message(WSAGetLastError());
+        char* utf8_message = gpr_format_message(WSAGetLastError());
         gpr_log(GPR_ERROR, "getpeername error: %s", utf8_message);
         gpr_free(utf8_message);
       }
@@ -370,8 +370,8 @@
      managed to accept a connection, and created an endpoint. */
   if (ep) {
     // Create acceptor.
-    grpc_tcp_server_acceptor *acceptor =
-        (grpc_tcp_server_acceptor *)gpr_malloc(sizeof(*acceptor));
+    grpc_tcp_server_acceptor* acceptor =
+        (grpc_tcp_server_acceptor*)gpr_malloc(sizeof(*acceptor));
     acceptor->from_server = sp->server;
     acceptor->port_index = sp->port_index;
     acceptor->fd_index = 0;
@@ -390,17 +390,17 @@
   gpr_mu_unlock(&sp->server->mu);
 }
 
-static grpc_error *add_socket_to_server(grpc_tcp_server *s, SOCKET sock,
-                                        const grpc_resolved_address *addr,
+static grpc_error* add_socket_to_server(grpc_tcp_server* s, SOCKET sock,
+                                        const grpc_resolved_address* addr,
                                         unsigned port_index,
-                                        grpc_tcp_listener **listener) {
-  grpc_tcp_listener *sp = NULL;
+                                        grpc_tcp_listener** listener) {
+  grpc_tcp_listener* sp = NULL;
   int port = -1;
   int status;
   GUID guid = WSAID_ACCEPTEX;
   DWORD ioctl_num_bytes;
   LPFN_ACCEPTEX AcceptEx;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   /* We need to grab the AcceptEx pointer for that port, as it may be
      interface-dependent. We'll cache it to avoid doing that again. */
@@ -409,7 +409,7 @@
                &AcceptEx, sizeof(AcceptEx), &ioctl_num_bytes, NULL, NULL);
 
   if (status != 0) {
-    char *utf8_message = gpr_format_message(WSAGetLastError());
+    char* utf8_message = gpr_format_message(WSAGetLastError());
     gpr_log(GPR_ERROR, "on_connect error: %s", utf8_message);
     gpr_free(utf8_message);
     closesocket(sock);
@@ -424,7 +424,7 @@
   GPR_ASSERT(port >= 0);
   gpr_mu_lock(&s->mu);
   GPR_ASSERT(!s->on_accept_cb && "must add ports before starting server");
-  sp = (grpc_tcp_listener *)gpr_malloc(sizeof(grpc_tcp_listener));
+  sp = (grpc_tcp_listener*)gpr_malloc(sizeof(grpc_tcp_listener));
   sp->next = NULL;
   if (s->head == NULL) {
     s->head = sp;
@@ -448,17 +448,17 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_tcp_server_add_port(grpc_tcp_server *s,
-                                     const grpc_resolved_address *addr,
-                                     int *port) {
-  grpc_tcp_listener *sp = NULL;
+grpc_error* grpc_tcp_server_add_port(grpc_tcp_server* s,
+                                     const grpc_resolved_address* addr,
+                                     int* port) {
+  grpc_tcp_listener* sp = NULL;
   SOCKET sock;
   grpc_resolved_address addr6_v4mapped;
   grpc_resolved_address wildcard;
-  grpc_resolved_address *allocated_addr = NULL;
+  grpc_resolved_address* allocated_addr = NULL;
   grpc_resolved_address sockname_temp;
   unsigned port_index = 0;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
 
   if (s->tail != NULL) {
     port_index = s->tail->port_index + 1;
@@ -470,13 +470,13 @@
     for (sp = s->head; sp; sp = sp->next) {
       int sockname_temp_len = sizeof(struct sockaddr_storage);
       if (0 == getsockname(sp->socket->socket,
-                           (struct sockaddr *)sockname_temp.addr,
+                           (struct sockaddr*)sockname_temp.addr,
                            &sockname_temp_len)) {
         sockname_temp.len = (size_t)sockname_temp_len;
         *port = grpc_sockaddr_get_port(&sockname_temp);
         if (*port > 0) {
-          allocated_addr = (grpc_resolved_address *)gpr_malloc(
-              sizeof(grpc_resolved_address));
+          allocated_addr =
+              (grpc_resolved_address*)gpr_malloc(sizeof(grpc_resolved_address));
           memcpy(allocated_addr, addr, sizeof(grpc_resolved_address));
           grpc_sockaddr_set_port(allocated_addr, *port);
           addr = allocated_addr;
@@ -510,7 +510,7 @@
   gpr_free(allocated_addr);
 
   if (error != GRPC_ERROR_NONE) {
-    grpc_error *error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+    grpc_error* error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
         "Failed to add port to server", &error, 1);
     GRPC_ERROR_UNREF(error);
     error = error_out;
@@ -522,11 +522,11 @@
   return error;
 }
 
-void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s,
-                           grpc_pollset **pollset, size_t pollset_count,
+void grpc_tcp_server_start(grpc_exec_ctx* exec_ctx, grpc_tcp_server* s,
+                           grpc_pollset** pollset, size_t pollset_count,
                            grpc_tcp_server_cb on_accept_cb,
-                           void *on_accept_cb_arg) {
-  grpc_tcp_listener *sp;
+                           void* on_accept_cb_arg) {
+  grpc_tcp_listener* sp;
   GPR_ASSERT(on_accept_cb);
   gpr_mu_lock(&s->mu);
   GPR_ASSERT(!s->on_accept_cb);
@@ -541,7 +541,7 @@
   gpr_mu_unlock(&s->mu);
 }
 
-void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx,
-                                        grpc_tcp_server *s) {}
+void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx* exec_ctx,
+                                        grpc_tcp_server* s) {}
 
 #endif /* GRPC_WINSOCK_SOCKET */
diff --git a/src/core/lib/iomgr/tcp_uv.cc b/src/core/lib/iomgr/tcp_uv.cc
index b245ce4..1d04eee 100644
--- a/src/core/lib/iomgr/tcp_uv.cc
+++ b/src/core/lib/iomgr/tcp_uv.cc
@@ -47,25 +47,25 @@
   uv_write_t write_req;
   uv_shutdown_t shutdown_req;
 
-  uv_tcp_t *handle;
+  uv_tcp_t* handle;
 
-  grpc_closure *read_cb;
-  grpc_closure *write_cb;
+  grpc_closure* read_cb;
+  grpc_closure* write_cb;
 
   grpc_slice read_slice;
-  grpc_slice_buffer *read_slices;
-  grpc_slice_buffer *write_slices;
-  uv_buf_t *write_buffers;
+  grpc_slice_buffer* read_slices;
+  grpc_slice_buffer* write_slices;
+  uv_buf_t* write_buffers;
 
-  grpc_resource_user *resource_user;
+  grpc_resource_user* resource_user;
 
   bool shutting_down;
 
-  char *peer_string;
-  grpc_pollset *pollset;
+  char* peer_string;
+  grpc_pollset* pollset;
 } grpc_tcp;
 
-static void tcp_free(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void tcp_free(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   grpc_slice_unref_internal(exec_ctx, tcp->read_slice);
   grpc_resource_user_unref(exec_ctx, tcp->resource_user);
   gpr_free(tcp->handle);
@@ -77,9 +77,9 @@
 #define TCP_UNREF(exec_ctx, tcp, reason) \
   tcp_unref((exec_ctx), (tcp), (reason), __FILE__, __LINE__)
 #define TCP_REF(tcp, reason) tcp_ref((tcp), (reason), __FILE__, __LINE__)
-static void tcp_unref(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp,
-                      const char *reason, const char *file, int line) {
-  if (grpc_tcp_trace.enabled()) {
+static void tcp_unref(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp,
+                      const char* reason, const char* file, int line) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "TCP unref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val,
@@ -90,9 +90,9 @@
   }
 }
 
-static void tcp_ref(grpc_tcp *tcp, const char *reason, const char *file,
+static void tcp_ref(grpc_tcp* tcp, const char* reason, const char* file,
                     int line) {
-  if (grpc_tcp_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "TCP   ref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val,
@@ -103,45 +103,45 @@
 #else
 #define TCP_UNREF(exec_ctx, tcp, reason) tcp_unref((exec_ctx), (tcp))
 #define TCP_REF(tcp, reason) tcp_ref((tcp))
-static void tcp_unref(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void tcp_unref(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   if (gpr_unref(&tcp->refcount)) {
     tcp_free(exec_ctx, tcp);
   }
 }
 
-static void tcp_ref(grpc_tcp *tcp) { gpr_ref(&tcp->refcount); }
+static void tcp_ref(grpc_tcp* tcp) { gpr_ref(&tcp->refcount); }
 #endif
 
-static void uv_close_callback(uv_handle_t *handle) {
+static void uv_close_callback(uv_handle_t* handle) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_tcp *tcp = (grpc_tcp *)handle->data;
+  grpc_tcp* tcp = (grpc_tcp*)handle->data;
   TCP_UNREF(&exec_ctx, tcp, "destroy");
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static grpc_slice alloc_read_slice(grpc_exec_ctx *exec_ctx,
-                                   grpc_resource_user *resource_user) {
+static grpc_slice alloc_read_slice(grpc_exec_ctx* exec_ctx,
+                                   grpc_resource_user* resource_user) {
   return grpc_resource_user_slice_malloc(exec_ctx, resource_user,
                                          GRPC_TCP_DEFAULT_READ_SLICE_SIZE);
 }
 
-static void alloc_uv_buf(uv_handle_t *handle, size_t suggested_size,
-                         uv_buf_t *buf) {
+static void alloc_uv_buf(uv_handle_t* handle, size_t suggested_size,
+                         uv_buf_t* buf) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_tcp *tcp = (grpc_tcp *)handle->data;
+  grpc_tcp* tcp = (grpc_tcp*)handle->data;
   (void)suggested_size;
-  buf->base = (char *)GRPC_SLICE_START_PTR(tcp->read_slice);
+  buf->base = (char*)GRPC_SLICE_START_PTR(tcp->read_slice);
   buf->len = GRPC_SLICE_LENGTH(tcp->read_slice);
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void read_callback(uv_stream_t *stream, ssize_t nread,
-                          const uv_buf_t *buf) {
+static void read_callback(uv_stream_t* stream, ssize_t nread,
+                          const uv_buf_t* buf) {
   grpc_slice sub;
-  grpc_error *error;
+  grpc_error* error;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_tcp *tcp = (grpc_tcp *)stream->data;
-  grpc_closure *cb = tcp->read_cb;
+  grpc_tcp* tcp = (grpc_tcp*)stream->data;
+  grpc_closure* cb = tcp->read_cb;
   if (nread == 0) {
     // Nothing happened. Wait for the next callback
     return;
@@ -158,13 +158,13 @@
     grpc_slice_buffer_add(tcp->read_slices, sub);
     tcp->read_slice = alloc_read_slice(&exec_ctx, tcp->resource_user);
     error = GRPC_ERROR_NONE;
-    if (grpc_tcp_trace.enabled()) {
+    if (GRPC_TRACER_ON(grpc_tcp_trace)) {
       size_t i;
-      const char *str = grpc_error_string(error);
+      const char* str = grpc_error_string(error);
       gpr_log(GPR_DEBUG, "read: error=%s", str);
 
       for (i = 0; i < tcp->read_slices->count; i++) {
-        char *dump = grpc_dump_slice(tcp->read_slices->slices[i],
+        char* dump = grpc_dump_slice(tcp->read_slices->slices[i],
                                      GPR_DUMP_HEX | GPR_DUMP_ASCII);
         gpr_log(GPR_DEBUG, "READ %p (peer=%s): %s", tcp, tcp->peer_string,
                 dump);
@@ -179,11 +179,11 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void uv_endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                             grpc_slice_buffer *read_slices, grpc_closure *cb) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static void uv_endpoint_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                             grpc_slice_buffer* read_slices, grpc_closure* cb) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   int status;
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   GRPC_UV_ASSERT_SAME_THREAD();
   GPR_ASSERT(tcp->read_cb == NULL);
   tcp->read_cb = cb;
@@ -192,7 +192,7 @@
   TCP_REF(tcp, "read");
   // TODO(murgatroid99): figure out what the return value here means
   status =
-      uv_read_start((uv_stream_t *)tcp->handle, alloc_uv_buf, read_callback);
+      uv_read_start((uv_stream_t*)tcp->handle, alloc_uv_buf, read_callback);
   if (status != 0) {
     error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("TCP Read failed at start");
     error =
@@ -200,17 +200,17 @@
                            grpc_slice_from_static_string(uv_strerror(status)));
     GRPC_CLOSURE_SCHED(exec_ctx, cb, error);
   }
-  if (grpc_tcp_trace.enabled()) {
-    const char *str = grpc_error_string(error);
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
+    const char* str = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "Initiating read on %p: error=%s", tcp, str);
   }
 }
 
-static void write_callback(uv_write_t *req, int status) {
-  grpc_tcp *tcp = (grpc_tcp *)req->data;
-  grpc_error *error;
+static void write_callback(uv_write_t* req, int status) {
+  grpc_tcp* tcp = (grpc_tcp*)req->data;
+  grpc_error* error;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_closure *cb = tcp->write_cb;
+  grpc_closure* cb = tcp->write_cb;
   tcp->write_cb = NULL;
   TCP_UNREF(&exec_ctx, tcp, "write");
   if (status == 0) {
@@ -218,8 +218,8 @@
   } else {
     error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("TCP Write failed");
   }
-  if (grpc_tcp_trace.enabled()) {
-    const char *str = grpc_error_string(error);
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
+    const char* str = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "write complete on %p: error=%s", tcp, str);
   }
   gpr_free(tcp->write_buffers);
@@ -229,22 +229,22 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void uv_endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                              grpc_slice_buffer *write_slices,
-                              grpc_closure *cb) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
-  uv_buf_t *buffers;
+static void uv_endpoint_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                              grpc_slice_buffer* write_slices,
+                              grpc_closure* cb) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
+  uv_buf_t* buffers;
   unsigned int buffer_count;
   unsigned int i;
-  grpc_slice *slice;
-  uv_write_t *write_req;
+  grpc_slice* slice;
+  uv_write_t* write_req;
   GRPC_UV_ASSERT_SAME_THREAD();
 
-  if (grpc_tcp_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     size_t j;
 
     for (j = 0; j < write_slices->count; j++) {
-      char *data = grpc_dump_slice(write_slices->slices[j],
+      char* data = grpc_dump_slice(write_slices->slices[j],
                                    GPR_DUMP_HEX | GPR_DUMP_ASCII);
       gpr_log(GPR_DEBUG, "WRITE %p (peer=%s): %s", tcp, tcp->peer_string, data);
       gpr_free(data);
@@ -252,8 +252,9 @@
   }
 
   if (tcp->shutting_down) {
-    GRPC_CLOSURE_SCHED(exec_ctx, cb, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-                                         "TCP socket is shutting down"));
+    GRPC_CLOSURE_SCHED(
+        exec_ctx, cb,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("TCP socket is shutting down"));
     return;
   }
 
@@ -269,12 +270,12 @@
 
   tcp->write_cb = cb;
   buffer_count = (unsigned int)tcp->write_slices->count;
-  buffers = (uv_buf_t *)gpr_malloc(sizeof(uv_buf_t) * buffer_count);
+  buffers = (uv_buf_t*)gpr_malloc(sizeof(uv_buf_t) * buffer_count);
   grpc_resource_user_alloc(exec_ctx, tcp->resource_user,
                            sizeof(uv_buf_t) * buffer_count, NULL);
   for (i = 0; i < buffer_count; i++) {
     slice = &tcp->write_slices->slices[i];
-    buffers[i].base = (char *)GRPC_SLICE_START_PTR(*slice);
+    buffers[i].base = (char*)GRPC_SLICE_START_PTR(*slice);
     buffers[i].len = GRPC_SLICE_LENGTH(*slice);
   }
   tcp->write_buffers = buffers;
@@ -282,76 +283,91 @@
   write_req->data = tcp;
   TCP_REF(tcp, "write");
   // TODO(murgatroid99): figure out what the return value here means
-  uv_write(write_req, (uv_stream_t *)tcp->handle, buffers, buffer_count,
+  uv_write(write_req, (uv_stream_t*)tcp->handle, buffers, buffer_count,
            write_callback);
 }
 
-static void uv_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                              grpc_pollset *pollset) {
+static void uv_add_to_pollset(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                              grpc_pollset* pollset) {
   // No-op. We're ignoring pollsets currently
   (void)exec_ctx;
   (void)ep;
   (void)pollset;
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   tcp->pollset = pollset;
 }
 
-static void uv_add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                  grpc_pollset_set *pollset) {
+static void uv_add_to_pollset_set(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                  grpc_pollset_set* pollset) {
   // No-op. We're ignoring pollsets currently
   (void)exec_ctx;
   (void)ep;
   (void)pollset;
 }
 
-static void shutdown_callback(uv_shutdown_t *req, int status) {}
+static void uv_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                       grpc_endpoint* ep,
+                                       grpc_pollset_set* pollset) {
+  // No-op. We're ignoring pollsets currently
+  (void)exec_ctx;
+  (void)ep;
+  (void)pollset;
+}
 
-static void uv_endpoint_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                 grpc_error *why) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static void shutdown_callback(uv_shutdown_t* req, int status) {}
+
+static void uv_endpoint_shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                 grpc_error* why) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   if (!tcp->shutting_down) {
-    if (grpc_tcp_trace.enabled()) {
-      const char *str = grpc_error_string(why);
+    if (GRPC_TRACER_ON(grpc_tcp_trace)) {
+      const char* str = grpc_error_string(why);
       gpr_log(GPR_DEBUG, "TCP %p shutdown why=%s", tcp->handle, str);
     }
     tcp->shutting_down = true;
-    uv_shutdown_t *req = &tcp->shutdown_req;
-    uv_shutdown(req, (uv_stream_t *)tcp->handle, shutdown_callback);
+    uv_shutdown_t* req = &tcp->shutdown_req;
+    uv_shutdown(req, (uv_stream_t*)tcp->handle, shutdown_callback);
     grpc_resource_user_shutdown(exec_ctx, tcp->resource_user);
   }
   GRPC_ERROR_UNREF(why);
 }
 
-static void uv_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
+static void uv_destroy(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep) {
   grpc_network_status_unregister_endpoint(ep);
-  grpc_tcp *tcp = (grpc_tcp *)ep;
-  uv_close((uv_handle_t *)tcp->handle, uv_close_callback);
+  grpc_tcp* tcp = (grpc_tcp*)ep;
+  uv_close((uv_handle_t*)tcp->handle, uv_close_callback);
 }
 
-static char *uv_get_peer(grpc_endpoint *ep) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static char* uv_get_peer(grpc_endpoint* ep) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   return gpr_strdup(tcp->peer_string);
 }
 
-static grpc_resource_user *uv_get_resource_user(grpc_endpoint *ep) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static grpc_resource_user* uv_get_resource_user(grpc_endpoint* ep) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   return tcp->resource_user;
 }
 
-static int uv_get_fd(grpc_endpoint *ep) { return -1; }
+static int uv_get_fd(grpc_endpoint* ep) { return -1; }
 
-static grpc_endpoint_vtable vtable = {
-    uv_endpoint_read,      uv_endpoint_write,    uv_add_to_pollset,
-    uv_add_to_pollset_set, uv_endpoint_shutdown, uv_destroy,
-    uv_get_resource_user,  uv_get_peer,          uv_get_fd};
+static grpc_endpoint_vtable vtable = {uv_endpoint_read,
+                                      uv_endpoint_write,
+                                      uv_add_to_pollset,
+                                      uv_add_to_pollset_set,
+                                      uv_delete_from_pollset_set,
+                                      uv_endpoint_shutdown,
+                                      uv_destroy,
+                                      uv_get_resource_user,
+                                      uv_get_peer,
+                                      uv_get_fd};
 
-grpc_endpoint *grpc_tcp_create(uv_tcp_t *handle,
-                               grpc_resource_quota *resource_quota,
-                               char *peer_string) {
-  grpc_tcp *tcp = (grpc_tcp *)gpr_malloc(sizeof(grpc_tcp));
+grpc_endpoint* grpc_tcp_create(uv_tcp_t* handle,
+                               grpc_resource_quota* resource_quota,
+                               char* peer_string) {
+  grpc_tcp* tcp = (grpc_tcp*)gpr_malloc(sizeof(grpc_tcp));
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
-  if (grpc_tcp_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     gpr_log(GPR_DEBUG, "Creating TCP endpoint %p", tcp);
   }
 
@@ -371,7 +387,7 @@
   grpc_network_status_register_endpoint(&tcp->base);
 
 #ifndef GRPC_UV_TCP_HOLD_LOOP
-  uv_unref((uv_handle_t *)handle);
+  uv_unref((uv_handle_t*)handle);
 #endif
 
   grpc_exec_ctx_finish(&exec_ctx);
diff --git a/src/core/lib/iomgr/tcp_uv.h b/src/core/lib/iomgr/tcp_uv.h
index 3d4afe0..37c0f84 100644
--- a/src/core/lib/iomgr/tcp_uv.h
+++ b/src/core/lib/iomgr/tcp_uv.h
@@ -42,9 +42,9 @@
 extern "C" {
 #endif
 
-grpc_endpoint *grpc_tcp_create(uv_tcp_t *handle,
-                               grpc_resource_quota *resource_quota,
-                               char *peer_string);
+grpc_endpoint* grpc_tcp_create(uv_tcp_t* handle,
+                               grpc_resource_quota* resource_quota,
+                               char* peer_string);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/tcp_windows.cc b/src/core/lib/iomgr/tcp_windows.cc
index 99304bb..f29dd13 100644
--- a/src/core/lib/iomgr/tcp_windows.cc
+++ b/src/core/lib/iomgr/tcp_windows.cc
@@ -51,7 +51,7 @@
 
 grpc_core::TraceFlag grpc_tcp_trace(false, "tcp");
 
-static grpc_error *set_non_block(SOCKET sock) {
+static grpc_error* set_non_block(SOCKET sock) {
   int status;
   uint32_t param = 1;
   DWORD ret;
@@ -62,18 +62,18 @@
              : GRPC_WSA_ERROR(WSAGetLastError(), "WSAIoctl(GRPC_FIONBIO)");
 }
 
-static grpc_error *set_dualstack(SOCKET sock) {
+static grpc_error* set_dualstack(SOCKET sock) {
   int status;
   unsigned long param = 0;
-  status = setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&param,
+  status = setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&param,
                       sizeof(param));
   return status == 0
              ? GRPC_ERROR_NONE
              : GRPC_WSA_ERROR(WSAGetLastError(), "setsockopt(IPV6_V6ONLY)");
 }
 
-grpc_error *grpc_tcp_prepare_socket(SOCKET sock) {
-  grpc_error *err;
+grpc_error* grpc_tcp_prepare_socket(SOCKET sock) {
+  grpc_error* err;
   err = set_non_block(sock);
   if (err != GRPC_ERROR_NONE) return err;
   err = set_dualstack(sock);
@@ -85,31 +85,31 @@
   /* This is our C++ class derivation emulation. */
   grpc_endpoint base;
   /* The one socket this endpoint is using. */
-  grpc_winsocket *socket;
+  grpc_winsocket* socket;
   /* Refcounting how many operations are in progress. */
   gpr_refcount refcount;
 
   grpc_closure on_read;
   grpc_closure on_write;
 
-  grpc_closure *read_cb;
-  grpc_closure *write_cb;
+  grpc_closure* read_cb;
+  grpc_closure* write_cb;
   grpc_slice read_slice;
-  grpc_slice_buffer *write_slices;
-  grpc_slice_buffer *read_slices;
+  grpc_slice_buffer* write_slices;
+  grpc_slice_buffer* read_slices;
 
-  grpc_resource_user *resource_user;
+  grpc_resource_user* resource_user;
 
   /* The IO Completion Port runs from another thread. We need some mechanism
      to protect ourselves when requesting a shutdown. */
   gpr_mu mu;
   int shutting_down;
-  grpc_error *shutdown_error;
+  grpc_error* shutdown_error;
 
-  char *peer_string;
+  char* peer_string;
 } grpc_tcp;
 
-static void tcp_free(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void tcp_free(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   grpc_winsocket_destroy(tcp->socket);
   gpr_mu_destroy(&tcp->mu);
   gpr_free(tcp->peer_string);
@@ -122,9 +122,9 @@
 #define TCP_UNREF(exec_ctx, tcp, reason) \
   tcp_unref((exec_ctx), (tcp), (reason), __FILE__, __LINE__)
 #define TCP_REF(tcp, reason) tcp_ref((tcp), (reason), __FILE__, __LINE__)
-static void tcp_unref(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp,
-                      const char *reason, const char *file, int line) {
-  if (grpc_tcp_trace.enabled()) {
+static void tcp_unref(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp,
+                      const char* reason, const char* file, int line) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "TCP unref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val,
@@ -135,9 +135,9 @@
   }
 }
 
-static void tcp_ref(grpc_tcp *tcp, const char *reason, const char *file,
+static void tcp_ref(grpc_tcp* tcp, const char* reason, const char* file,
                     int line) {
-  if (grpc_tcp_trace.enabled()) {
+  if (GRPC_TRACER_ON(grpc_tcp_trace)) {
     gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "TCP   ref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val,
@@ -148,28 +148,28 @@
 #else
 #define TCP_UNREF(exec_ctx, tcp, reason) tcp_unref((exec_ctx), (tcp))
 #define TCP_REF(tcp, reason) tcp_ref((tcp))
-static void tcp_unref(grpc_exec_ctx *exec_ctx, grpc_tcp *tcp) {
+static void tcp_unref(grpc_exec_ctx* exec_ctx, grpc_tcp* tcp) {
   if (gpr_unref(&tcp->refcount)) {
     tcp_free(exec_ctx, tcp);
   }
 }
 
-static void tcp_ref(grpc_tcp *tcp) { gpr_ref(&tcp->refcount); }
+static void tcp_ref(grpc_tcp* tcp) { gpr_ref(&tcp->refcount); }
 #endif
 
 /* Asynchronous callback from the IOCP, or the background thread. */
-static void on_read(grpc_exec_ctx *exec_ctx, void *tcpp, grpc_error *error) {
-  grpc_tcp *tcp = (grpc_tcp *)tcpp;
-  grpc_closure *cb = tcp->read_cb;
-  grpc_winsocket *socket = tcp->socket;
+static void on_read(grpc_exec_ctx* exec_ctx, void* tcpp, grpc_error* error) {
+  grpc_tcp* tcp = (grpc_tcp*)tcpp;
+  grpc_closure* cb = tcp->read_cb;
+  grpc_winsocket* socket = tcp->socket;
   grpc_slice sub;
-  grpc_winsocket_callback_info *info = &socket->read_info;
+  grpc_winsocket_callback_info* info = &socket->read_info;
 
   GRPC_ERROR_REF(error);
 
   if (error == GRPC_ERROR_NONE) {
     if (info->wsa_error != 0 && !tcp->shutting_down) {
-      char *utf8_message = gpr_format_message(info->wsa_error);
+      char* utf8_message = gpr_format_message(info->wsa_error);
       error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(utf8_message);
       gpr_free(utf8_message);
       grpc_slice_unref_internal(exec_ctx, tcp->read_slice);
@@ -192,11 +192,11 @@
   GRPC_CLOSURE_SCHED(exec_ctx, cb, error);
 }
 
-static void win_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                     grpc_slice_buffer *read_slices, grpc_closure *cb) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
-  grpc_winsocket *handle = tcp->socket;
-  grpc_winsocket_callback_info *info = &handle->read_info;
+static void win_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                     grpc_slice_buffer* read_slices, grpc_closure* cb) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
+  grpc_winsocket* handle = tcp->socket;
+  grpc_winsocket_callback_info* info = &handle->read_info;
   int status;
   DWORD bytes_read = 0;
   DWORD flags = 0;
@@ -218,7 +218,7 @@
 
   buffer.len = (ULONG)GRPC_SLICE_LENGTH(
       tcp->read_slice);  // we know slice size fits in 32bit.
-  buffer.buf = (char *)GRPC_SLICE_START_PTR(tcp->read_slice);
+  buffer.buf = (char*)GRPC_SLICE_START_PTR(tcp->read_slice);
 
   TCP_REF(tcp, "read");
 
@@ -253,11 +253,11 @@
 }
 
 /* Asynchronous callback from the IOCP, or the background thread. */
-static void on_write(grpc_exec_ctx *exec_ctx, void *tcpp, grpc_error *error) {
-  grpc_tcp *tcp = (grpc_tcp *)tcpp;
-  grpc_winsocket *handle = tcp->socket;
-  grpc_winsocket_callback_info *info = &handle->write_info;
-  grpc_closure *cb;
+static void on_write(grpc_exec_ctx* exec_ctx, void* tcpp, grpc_error* error) {
+  grpc_tcp* tcp = (grpc_tcp*)tcpp;
+  grpc_winsocket* handle = tcp->socket;
+  grpc_winsocket_callback_info* info = &handle->write_info;
+  grpc_closure* cb;
 
   GRPC_ERROR_REF(error);
 
@@ -279,17 +279,17 @@
 }
 
 /* Initiates a write. */
-static void win_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                      grpc_slice_buffer *slices, grpc_closure *cb) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
-  grpc_winsocket *socket = tcp->socket;
-  grpc_winsocket_callback_info *info = &socket->write_info;
+static void win_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                      grpc_slice_buffer* slices, grpc_closure* cb) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
+  grpc_winsocket* socket = tcp->socket;
+  grpc_winsocket_callback_info* info = &socket->write_info;
   unsigned i;
   DWORD bytes_sent;
   int status;
   WSABUF local_buffers[16];
-  WSABUF *allocated = NULL;
-  WSABUF *buffers = local_buffers;
+  WSABUF* allocated = NULL;
+  WSABUF* buffers = local_buffers;
   size_t len;
 
   if (tcp->shutting_down) {
@@ -304,7 +304,7 @@
   tcp->write_slices = slices;
   GPR_ASSERT(tcp->write_slices->count <= UINT_MAX);
   if (tcp->write_slices->count > GPR_ARRAY_SIZE(local_buffers)) {
-    buffers = (WSABUF *)gpr_malloc(sizeof(WSABUF) * tcp->write_slices->count);
+    buffers = (WSABUF*)gpr_malloc(sizeof(WSABUF) * tcp->write_slices->count);
     allocated = buffers;
   }
 
@@ -312,7 +312,7 @@
     len = GRPC_SLICE_LENGTH(tcp->write_slices->slices[i]);
     GPR_ASSERT(len <= ULONG_MAX);
     buffers[i].len = (ULONG)len;
-    buffers[i].buf = (char *)GRPC_SLICE_START_PTR(tcp->write_slices->slices[i]);
+    buffers[i].buf = (char*)GRPC_SLICE_START_PTR(tcp->write_slices->slices[i]);
   }
 
   /* First, let's try a synchronous, non-blocking write. */
@@ -324,7 +324,7 @@
      connection that has its send queue filled up. But if we don't, then we can
      avoid doing an async write operation at all. */
   if (info->wsa_error != WSAEWOULDBLOCK) {
-    grpc_error *error = status == 0
+    grpc_error* error = status == 0
                             ? GRPC_ERROR_NONE
                             : GRPC_WSA_ERROR(info->wsa_error, "WSASend");
     GRPC_CLOSURE_SCHED(exec_ctx, cb, error);
@@ -355,31 +355,35 @@
   grpc_socket_notify_on_write(exec_ctx, socket, &tcp->on_write);
 }
 
-static void win_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                               grpc_pollset *ps) {
-  grpc_tcp *tcp;
+static void win_add_to_pollset(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                               grpc_pollset* ps) {
+  grpc_tcp* tcp;
   (void)ps;
-  tcp = (grpc_tcp *)ep;
+  tcp = (grpc_tcp*)ep;
   grpc_iocp_add_socket(tcp->socket);
 }
 
-static void win_add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                   grpc_pollset_set *pss) {
-  grpc_tcp *tcp;
+static void win_add_to_pollset_set(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                   grpc_pollset_set* pss) {
+  grpc_tcp* tcp;
   (void)pss;
-  tcp = (grpc_tcp *)ep;
+  tcp = (grpc_tcp*)ep;
   grpc_iocp_add_socket(tcp->socket);
 }
 
+static void win_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_endpoint* ep,
+                                        grpc_pollset_set* pss) {}
+
 /* Initiates a shutdown of the TCP endpoint. This will queue abort callbacks
    for the potential read and write operations. It is up to the caller to
    guarantee this isn't called in parallel to a read or write request, so
    we're not going to protect against these. However the IO Completion Port
    callback will happen from another thread, so we need to protect against
    concurrent access of the data structure in that regard. */
-static void win_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                         grpc_error *why) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static void win_shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                         grpc_error* why) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   gpr_mu_lock(&tcp->mu);
   /* At that point, what may happen is that we're already inside the IOCP
      callback. See the comments in on_read and on_write. */
@@ -394,43 +398,49 @@
   grpc_resource_user_shutdown(exec_ctx, tcp->resource_user);
 }
 
-static void win_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
+static void win_destroy(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep) {
   grpc_network_status_unregister_endpoint(ep);
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   TCP_UNREF(exec_ctx, tcp, "destroy");
 }
 
-static char *win_get_peer(grpc_endpoint *ep) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static char* win_get_peer(grpc_endpoint* ep) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   return gpr_strdup(tcp->peer_string);
 }
 
-static grpc_resource_user *win_get_resource_user(grpc_endpoint *ep) {
-  grpc_tcp *tcp = (grpc_tcp *)ep;
+static grpc_resource_user* win_get_resource_user(grpc_endpoint* ep) {
+  grpc_tcp* tcp = (grpc_tcp*)ep;
   return tcp->resource_user;
 }
 
-static int win_get_fd(grpc_endpoint *ep) { return -1; }
+static int win_get_fd(grpc_endpoint* ep) { return -1; }
 
-static grpc_endpoint_vtable vtable = {
-    win_read,     win_write,   win_add_to_pollset,    win_add_to_pollset_set,
-    win_shutdown, win_destroy, win_get_resource_user, win_get_peer,
-    win_get_fd};
+static grpc_endpoint_vtable vtable = {win_read,
+                                      win_write,
+                                      win_add_to_pollset,
+                                      win_add_to_pollset_set,
+                                      win_delete_from_pollset_set,
+                                      win_shutdown,
+                                      win_destroy,
+                                      win_get_resource_user,
+                                      win_get_peer,
+                                      win_get_fd};
 
-grpc_endpoint *grpc_tcp_create(grpc_exec_ctx *exec_ctx, grpc_winsocket *socket,
-                               grpc_channel_args *channel_args,
-                               const char *peer_string) {
-  grpc_resource_quota *resource_quota = grpc_resource_quota_create(NULL);
+grpc_endpoint* grpc_tcp_create(grpc_exec_ctx* exec_ctx, grpc_winsocket* socket,
+                               grpc_channel_args* channel_args,
+                               const char* peer_string) {
+  grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
   if (channel_args != NULL) {
     for (size_t i = 0; i < channel_args->num_args; i++) {
       if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
         grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
         resource_quota = grpc_resource_quota_ref_internal(
-            (grpc_resource_quota *)channel_args->args[i].value.pointer.p);
+            (grpc_resource_quota*)channel_args->args[i].value.pointer.p);
       }
     }
   }
-  grpc_tcp *tcp = (grpc_tcp *)gpr_malloc(sizeof(grpc_tcp));
+  grpc_tcp* tcp = (grpc_tcp*)gpr_malloc(sizeof(grpc_tcp));
   memset(tcp, 0, sizeof(grpc_tcp));
   tcp->base.vtable = &vtable;
   tcp->socket = socket;
@@ -442,6 +452,7 @@
   tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string);
   /* Tell network status tracking code about the new endpoint */
   grpc_network_status_register_endpoint(&tcp->base);
+  grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
 
   return &tcp->base;
 }
diff --git a/src/core/lib/iomgr/tcp_windows.h b/src/core/lib/iomgr/tcp_windows.h
index f3697f7..aea5bab 100644
--- a/src/core/lib/iomgr/tcp_windows.h
+++ b/src/core/lib/iomgr/tcp_windows.h
@@ -39,11 +39,11 @@
 /* Create a tcp endpoint given a winsock handle.
  * Takes ownership of the handle.
  */
-grpc_endpoint *grpc_tcp_create(grpc_exec_ctx *exec_ctx, grpc_winsocket *socket,
-                               grpc_channel_args *channel_args,
-                               const char *peer_string);
+grpc_endpoint* grpc_tcp_create(grpc_exec_ctx* exec_ctx, grpc_winsocket* socket,
+                               grpc_channel_args* channel_args,
+                               const char* peer_string);
 
-grpc_error *grpc_tcp_prepare_socket(SOCKET sock);
+grpc_error* grpc_tcp_prepare_socket(SOCKET sock);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/timer.h b/src/core/lib/iomgr/timer.h
index 419e834..cd8334e 100644
--- a/src/core/lib/iomgr/timer.h
+++ b/src/core/lib/iomgr/timer.h
@@ -44,12 +44,12 @@
    application code should check the error to determine how it was invoked. The
    application callback is also responsible for maintaining information about
    when to free up any user-level state. */
-void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer,
-                     grpc_millis deadline, grpc_closure *closure);
+void grpc_timer_init(grpc_exec_ctx* exec_ctx, grpc_timer* timer,
+                     grpc_millis deadline, grpc_closure* closure);
 
 /* Initialize *timer without setting it. This can later be passed through
    the regular init or cancel */
-void grpc_timer_init_unset(grpc_timer *timer);
+void grpc_timer_init_unset(grpc_timer* timer);
 
 /* Note that there is no timer destroy function. This is because the
    timer is a one-time occurrence with a guarantee that the callback will
@@ -77,7 +77,7 @@
    matches this aim.
 
    Requires: cancel() must happen after init() on a given timer */
-void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer);
+void grpc_timer_cancel(grpc_exec_ctx* exec_ctx, grpc_timer* timer);
 
 /* iomgr internal api for dealing with timers */
 
@@ -94,10 +94,10 @@
    *next is never guaranteed to be updated on any given execution; however,
    with high probability at least one thread in the system will see an update
    at any time slice. */
-grpc_timer_check_result grpc_timer_check(grpc_exec_ctx *exec_ctx,
-                                         grpc_millis *next);
-void grpc_timer_list_init(grpc_exec_ctx *exec_ctx);
-void grpc_timer_list_shutdown(grpc_exec_ctx *exec_ctx);
+grpc_timer_check_result grpc_timer_check(grpc_exec_ctx* exec_ctx,
+                                         grpc_millis* next);
+void grpc_timer_list_init(grpc_exec_ctx* exec_ctx);
+void grpc_timer_list_shutdown(grpc_exec_ctx* exec_ctx);
 
 /* Consume a kick issued by grpc_kick_poller */
 void grpc_timer_consume_kick(void);
diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc
index 1735aeb..d5c4875 100644
--- a/src/core/lib/iomgr/timer_generic.cc
+++ b/src/core/lib/iomgr/timer_generic.cc
@@ -43,10 +43,8 @@
 #define MIN_QUEUE_WINDOW_DURATION 0.01
 #define MAX_QUEUE_WINDOW_DURATION 1
 
-extern "C" {
 grpc_core::TraceFlag grpc_timer_trace(false, "timer");
 grpc_core::TraceFlag grpc_timer_check_trace(false, "timer_check");
-}
 
 /* A "timer shard". Contains a 'heap' and a 'list' of timers. All timers with
  * deadlines earlier than 'queue_deadline" cap are maintained in the heap and
@@ -80,7 +78,7 @@
 /* Maintains a sorted list of timer shards (sorted by their min_deadline, i.e
  * the deadline of the next timer in each shard).
  * Access to this is protected by g_shared_mutables.mu */
-static timer_shard *g_shard_queue[NUM_SHARDS];
+static timer_shard* g_shard_queue[NUM_SHARDS];
 
 #ifndef NDEBUG
 
@@ -89,7 +87,7 @@
 #define NUM_HASH_BUCKETS 1009 /* Prime number close to 1000 */
 
 static gpr_mu g_hash_mu[NUM_HASH_BUCKETS]; /* One mutex per bucket */
-static grpc_timer *g_timer_ht[NUM_HASH_BUCKETS] = {NULL};
+static grpc_timer* g_timer_ht[NUM_HASH_BUCKETS] = {NULL};
 
 static void init_timer_ht() {
   for (int i = 0; i < NUM_HASH_BUCKETS; i++) {
@@ -97,11 +95,11 @@
   }
 }
 
-static bool is_in_ht(grpc_timer *t) {
+static bool is_in_ht(grpc_timer* t) {
   size_t i = GPR_HASH_POINTER(t, NUM_HASH_BUCKETS);
 
   gpr_mu_lock(&g_hash_mu[i]);
-  grpc_timer *p = g_timer_ht[i];
+  grpc_timer* p = g_timer_ht[i];
   while (p != NULL && p != t) {
     p = p->hash_table_next;
   }
@@ -110,18 +108,18 @@
   return (p == t);
 }
 
-static void add_to_ht(grpc_timer *t) {
+static void add_to_ht(grpc_timer* t) {
   GPR_ASSERT(!t->hash_table_next);
   size_t i = GPR_HASH_POINTER(t, NUM_HASH_BUCKETS);
 
   gpr_mu_lock(&g_hash_mu[i]);
-  grpc_timer *p = g_timer_ht[i];
+  grpc_timer* p = g_timer_ht[i];
   while (p != NULL && p != t) {
     p = p->hash_table_next;
   }
 
   if (p == t) {
-    grpc_closure *c = t->closure;
+    grpc_closure* c = t->closure;
     gpr_log(GPR_ERROR,
             "** Duplicate timer (%p) being added. Closure: (%p), created at: "
             "(%s:%d), scheduled at: (%s:%d) **",
@@ -136,7 +134,7 @@
   gpr_mu_unlock(&g_hash_mu[i]);
 }
 
-static void remove_from_ht(grpc_timer *t) {
+static void remove_from_ht(grpc_timer* t) {
   size_t i = GPR_HASH_POINTER(t, NUM_HASH_BUCKETS);
   bool removed = false;
 
@@ -145,7 +143,7 @@
     g_timer_ht[i] = g_timer_ht[i]->hash_table_next;
     removed = true;
   } else if (g_timer_ht[i] != NULL) {
-    grpc_timer *p = g_timer_ht[i];
+    grpc_timer* p = g_timer_ht[i];
     while (p->hash_table_next != NULL && p->hash_table_next != t) {
       p = p->hash_table_next;
     }
@@ -158,7 +156,7 @@
   gpr_mu_unlock(&g_hash_mu[i]);
 
   if (!removed) {
-    grpc_closure *c = t->closure;
+    grpc_closure* c = t->closure;
     gpr_log(GPR_ERROR,
             "** Removing timer (%p) that is not added to hash table. Closure "
             "(%p), created at: (%s:%d), scheduled at: (%s:%d) **",
@@ -174,9 +172,9 @@
  * be pending. A timer is added to hash table only-if it is added to the
  * timer shard.
  * Therefore, if timer->pending is false, it cannot be in hash table */
-static void validate_non_pending_timer(grpc_timer *t) {
+static void validate_non_pending_timer(grpc_timer* t) {
   if (!t->pending && is_in_ht(t)) {
-    grpc_closure *c = t->closure;
+    grpc_closure* c = t->closure;
     gpr_log(GPR_ERROR,
             "** gpr_timer_cancel() called on a non-pending timer (%p) which "
             "is in the hash table. Closure: (%p), created at: (%s:%d), "
@@ -226,18 +224,18 @@
   return a + b;
 }
 
-static grpc_timer_check_result run_some_expired_timers(grpc_exec_ctx *exec_ctx,
+static grpc_timer_check_result run_some_expired_timers(grpc_exec_ctx* exec_ctx,
                                                        gpr_atm now,
-                                                       gpr_atm *next,
-                                                       grpc_error *error);
+                                                       gpr_atm* next,
+                                                       grpc_error* error);
 
-static gpr_atm compute_min_deadline(timer_shard *shard) {
+static gpr_atm compute_min_deadline(timer_shard* shard) {
   return grpc_timer_heap_is_empty(&shard->heap)
              ? saturating_add(shard->queue_deadline_cap, 1)
              : grpc_timer_heap_top(&shard->heap)->deadline;
 }
 
-void grpc_timer_list_init(grpc_exec_ctx *exec_ctx) {
+void grpc_timer_list_init(grpc_exec_ctx* exec_ctx) {
   uint32_t i;
 
   g_shared_mutables.initialized = true;
@@ -248,7 +246,7 @@
   gpr_tls_set(&g_last_seen_min_timer, 0);
 
   for (i = 0; i < NUM_SHARDS; i++) {
-    timer_shard *shard = &g_shards[i];
+    timer_shard* shard = &g_shards[i];
     gpr_mu_init(&shard->mu);
     grpc_time_averaged_stats_init(&shard->stats, 1.0 / ADD_DEADLINE_SCALE, 0.1,
                                   0.5);
@@ -263,13 +261,13 @@
   INIT_TIMER_HASH_TABLE();
 }
 
-void grpc_timer_list_shutdown(grpc_exec_ctx *exec_ctx) {
+void grpc_timer_list_shutdown(grpc_exec_ctx* exec_ctx) {
   int i;
   run_some_expired_timers(
       exec_ctx, GPR_ATM_MAX, NULL,
       GRPC_ERROR_CREATE_FROM_STATIC_STRING("Timer list shutdown"));
   for (i = 0; i < NUM_SHARDS; i++) {
-    timer_shard *shard = &g_shards[i];
+    timer_shard* shard = &g_shards[i];
     gpr_mu_destroy(&shard->mu);
     grpc_timer_heap_destroy(&shard->heap);
   }
@@ -279,19 +277,19 @@
 }
 
 /* returns true if the first element in the list */
-static void list_join(grpc_timer *head, grpc_timer *timer) {
+static void list_join(grpc_timer* head, grpc_timer* timer) {
   timer->next = head;
   timer->prev = head->prev;
   timer->next->prev = timer->prev->next = timer;
 }
 
-static void list_remove(grpc_timer *timer) {
+static void list_remove(grpc_timer* timer) {
   timer->next->prev = timer->prev;
   timer->prev->next = timer->next;
 }
 
 static void swap_adjacent_shards_in_queue(uint32_t first_shard_queue_index) {
-  timer_shard *temp;
+  timer_shard* temp;
   temp = g_shard_queue[first_shard_queue_index];
   g_shard_queue[first_shard_queue_index] =
       g_shard_queue[first_shard_queue_index + 1];
@@ -302,7 +300,7 @@
       first_shard_queue_index + 1;
 }
 
-static void note_deadline_change(timer_shard *shard) {
+static void note_deadline_change(timer_shard* shard) {
   while (shard->shard_queue_index > 0 &&
          shard->min_deadline <
              g_shard_queue[shard->shard_queue_index - 1]->min_deadline) {
@@ -315,12 +313,12 @@
   }
 }
 
-void grpc_timer_init_unset(grpc_timer *timer) { timer->pending = false; }
+void grpc_timer_init_unset(grpc_timer* timer) { timer->pending = false; }
 
-void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer,
-                     grpc_millis deadline, grpc_closure *closure) {
+void grpc_timer_init(grpc_exec_ctx* exec_ctx, grpc_timer* timer,
+                     grpc_millis deadline, grpc_closure* closure) {
   int is_first_timer = 0;
-  timer_shard *shard = &g_shards[GPR_HASH_POINTER(timer, NUM_SHARDS)];
+  timer_shard* shard = &g_shards[GPR_HASH_POINTER(timer, NUM_SHARDS)];
   timer->closure = closure;
   timer->deadline = deadline;
 
@@ -365,8 +363,9 @@
     list_join(&shard->list, timer);
   }
   if (grpc_timer_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "  .. add to shard %d with queue_deadline_cap=%" PRIdPTR
-                       " => is_first_timer=%s",
+    gpr_log(GPR_DEBUG,
+            "  .. add to shard %d with queue_deadline_cap=%" PRIdPTR
+            " => is_first_timer=%s",
             (int)(shard - g_shards), shard->queue_deadline_cap,
             is_first_timer ? "true" : "false");
   }
@@ -407,13 +406,13 @@
   gpr_tls_set(&g_last_seen_min_timer, 0);
 }
 
-void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer) {
+void grpc_timer_cancel(grpc_exec_ctx* exec_ctx, grpc_timer* timer) {
   if (!g_shared_mutables.initialized) {
     /* must have already been cancelled, also the shard mutex is invalid */
     return;
   }
 
-  timer_shard *shard = &g_shards[GPR_HASH_POINTER(timer, NUM_SHARDS)];
+  timer_shard* shard = &g_shards[GPR_HASH_POINTER(timer, NUM_SHARDS)];
   gpr_mu_lock(&shard->mu);
   if (grpc_timer_trace.enabled()) {
     gpr_log(GPR_DEBUG, "TIMER %p: CANCEL pending=%s", timer,
@@ -441,7 +440,7 @@
    'queue_deadline_cap') into into shard->heap.
    Returns 'true' if shard->heap has atleast ONE element
    REQUIRES: shard->mu locked */
-static int refill_heap(timer_shard *shard, gpr_atm now) {
+static int refill_heap(timer_shard* shard, gpr_atm now) {
   /* Compute the new queue window width and bound by the limits: */
   double computed_deadline_delta =
       grpc_time_averaged_stats_update_average(&shard->stats) *
@@ -478,8 +477,8 @@
 /* This pops the next non-cancelled timer with deadline <= now from the
    queue, or returns NULL if there isn't one.
    REQUIRES: shard->mu locked */
-static grpc_timer *pop_one(timer_shard *shard, gpr_atm now) {
-  grpc_timer *timer;
+static grpc_timer* pop_one(timer_shard* shard, gpr_atm now) {
+  grpc_timer* timer;
   for (;;) {
     if (grpc_timer_check_trace.enabled()) {
       gpr_log(GPR_DEBUG, "  .. shard[%d]: heap_empty=%s",
@@ -509,11 +508,11 @@
 }
 
 /* REQUIRES: shard->mu unlocked */
-static size_t pop_timers(grpc_exec_ctx *exec_ctx, timer_shard *shard,
-                         gpr_atm now, gpr_atm *new_min_deadline,
-                         grpc_error *error) {
+static size_t pop_timers(grpc_exec_ctx* exec_ctx, timer_shard* shard,
+                         gpr_atm now, gpr_atm* new_min_deadline,
+                         grpc_error* error) {
   size_t n = 0;
-  grpc_timer *timer;
+  grpc_timer* timer;
   gpr_mu_lock(&shard->mu);
   while ((timer = pop_one(shard, now))) {
     REMOVE_FROM_HASH_TABLE(timer);
@@ -529,10 +528,10 @@
   return n;
 }
 
-static grpc_timer_check_result run_some_expired_timers(grpc_exec_ctx *exec_ctx,
+static grpc_timer_check_result run_some_expired_timers(grpc_exec_ctx* exec_ctx,
                                                        gpr_atm now,
-                                                       gpr_atm *next,
-                                                       grpc_error *error) {
+                                                       gpr_atm* next,
+                                                       grpc_error* error) {
   grpc_timer_check_result result = GRPC_TIMERS_NOT_CHECKED;
 
   gpr_atm min_timer = gpr_atm_no_barrier_load(&g_shared_mutables.min_timer);
@@ -597,8 +596,8 @@
   return result;
 }
 
-grpc_timer_check_result grpc_timer_check(grpc_exec_ctx *exec_ctx,
-                                         grpc_millis *next) {
+grpc_timer_check_result grpc_timer_check(grpc_exec_ctx* exec_ctx,
+                                         grpc_millis* next) {
   // prelude
   grpc_millis now = grpc_exec_ctx_now(exec_ctx);
 
@@ -617,21 +616,22 @@
     return GRPC_TIMERS_CHECKED_AND_EMPTY;
   }
 
-  grpc_error *shutdown_error =
+  grpc_error* shutdown_error =
       now != GRPC_MILLIS_INF_FUTURE
           ? GRPC_ERROR_NONE
           : GRPC_ERROR_CREATE_FROM_STATIC_STRING("Shutting down timer system");
 
   // tracing
   if (grpc_timer_check_trace.enabled()) {
-    char *next_str;
+    char* next_str;
     if (next == NULL) {
       next_str = gpr_strdup("NULL");
     } else {
       gpr_asprintf(&next_str, "%" PRIdPTR, *next);
     }
-    gpr_log(GPR_DEBUG, "TIMER CHECK BEGIN: now=%" PRIdPTR
-                       " next=%s tls_min=%" PRIdPTR " glob_min=%" PRIdPTR,
+    gpr_log(GPR_DEBUG,
+            "TIMER CHECK BEGIN: now=%" PRIdPTR " next=%s tls_min=%" PRIdPTR
+            " glob_min=%" PRIdPTR,
             now, next_str, gpr_tls_get(&g_last_seen_min_timer),
             gpr_atm_no_barrier_load(&g_shared_mutables.min_timer));
     gpr_free(next_str);
@@ -641,7 +641,7 @@
       run_some_expired_timers(exec_ctx, now, next, shutdown_error);
   // tracing
   if (grpc_timer_check_trace.enabled()) {
-    char *next_str;
+    char* next_str;
     if (next == NULL) {
       next_str = gpr_strdup("NULL");
     } else {
diff --git a/src/core/lib/iomgr/timer_generic.h b/src/core/lib/iomgr/timer_generic.h
index f0597f6..190381e 100644
--- a/src/core/lib/iomgr/timer_generic.h
+++ b/src/core/lib/iomgr/timer_generic.h
@@ -26,11 +26,11 @@
   gpr_atm deadline;
   uint32_t heap_index; /* INVALID_HEAP_INDEX if not in heap */
   bool pending;
-  struct grpc_timer *next;
-  struct grpc_timer *prev;
-  grpc_closure *closure;
+  struct grpc_timer* next;
+  struct grpc_timer* prev;
+  grpc_closure* closure;
 #ifndef NDEBUG
-  struct grpc_timer *hash_table_next;
+  struct grpc_timer* hash_table_next;
 #endif
 };
 
diff --git a/src/core/lib/iomgr/timer_heap.cc b/src/core/lib/iomgr/timer_heap.cc
index 2648d5d..b350452 100644
--- a/src/core/lib/iomgr/timer_heap.cc
+++ b/src/core/lib/iomgr/timer_heap.cc
@@ -32,7 +32,7 @@
    position. This functor is called each time immediately after modifying a
    value in the underlying container, with the offset of the modified element as
    its argument. */
-static void adjust_upwards(grpc_timer **first, uint32_t i, grpc_timer *t) {
+static void adjust_upwards(grpc_timer** first, uint32_t i, grpc_timer* t) {
   while (i > 0) {
     uint32_t parent = (uint32_t)(((int)i - 1) / 2);
     if (first[parent]->deadline <= t->deadline) break;
@@ -47,17 +47,16 @@
 /* Adjusts a heap so as to move a hole at position i farther away from the root,
    until a suitable position is found for element t.  Then, copies t into that
    position. */
-static void adjust_downwards(grpc_timer **first, uint32_t i, uint32_t length,
-                             grpc_timer *t) {
+static void adjust_downwards(grpc_timer** first, uint32_t i, uint32_t length,
+                             grpc_timer* t) {
   for (;;) {
     uint32_t left_child = 1u + 2u * i;
     if (left_child >= length) break;
     uint32_t right_child = left_child + 1;
-    uint32_t next_i =
-        right_child < length &&
-                first[left_child]->deadline > first[right_child]->deadline
-            ? right_child
-            : left_child;
+    uint32_t next_i = right_child < length && first[left_child]->deadline >
+                                                  first[right_child]->deadline
+                          ? right_child
+                          : left_child;
     if (t->deadline <= first[next_i]->deadline) break;
     first[i] = first[next_i];
     first[i]->heap_index = i;
@@ -70,16 +69,16 @@
 #define SHRINK_MIN_ELEMS 8
 #define SHRINK_FULLNESS_FACTOR 2
 
-static void maybe_shrink(grpc_timer_heap *heap) {
+static void maybe_shrink(grpc_timer_heap* heap) {
   if (heap->timer_count >= 8 &&
       heap->timer_count <= heap->timer_capacity / SHRINK_FULLNESS_FACTOR / 2) {
     heap->timer_capacity = heap->timer_count * SHRINK_FULLNESS_FACTOR;
-    heap->timers = (grpc_timer **)gpr_realloc(
-        heap->timers, heap->timer_capacity * sizeof(grpc_timer *));
+    heap->timers = (grpc_timer**)gpr_realloc(
+        heap->timers, heap->timer_capacity * sizeof(grpc_timer*));
   }
 }
 
-static void note_changed_priority(grpc_timer_heap *heap, grpc_timer *timer) {
+static void note_changed_priority(grpc_timer_heap* heap, grpc_timer* timer) {
   uint32_t i = timer->heap_index;
   uint32_t parent = (uint32_t)(((int)i - 1) / 2);
   if (heap->timers[parent]->deadline > timer->deadline) {
@@ -89,18 +88,18 @@
   }
 }
 
-void grpc_timer_heap_init(grpc_timer_heap *heap) {
+void grpc_timer_heap_init(grpc_timer_heap* heap) {
   memset(heap, 0, sizeof(*heap));
 }
 
-void grpc_timer_heap_destroy(grpc_timer_heap *heap) { gpr_free(heap->timers); }
+void grpc_timer_heap_destroy(grpc_timer_heap* heap) { gpr_free(heap->timers); }
 
-int grpc_timer_heap_add(grpc_timer_heap *heap, grpc_timer *timer) {
+int grpc_timer_heap_add(grpc_timer_heap* heap, grpc_timer* timer) {
   if (heap->timer_count == heap->timer_capacity) {
     heap->timer_capacity =
         GPR_MAX(heap->timer_capacity + 1, heap->timer_capacity * 3 / 2);
-    heap->timers = (grpc_timer **)gpr_realloc(
-        heap->timers, heap->timer_capacity * sizeof(grpc_timer *));
+    heap->timers = (grpc_timer**)gpr_realloc(
+        heap->timers, heap->timer_capacity * sizeof(grpc_timer*));
   }
   timer->heap_index = heap->timer_count;
   adjust_upwards(heap->timers, heap->timer_count, timer);
@@ -108,7 +107,7 @@
   return timer->heap_index == 0;
 }
 
-void grpc_timer_heap_remove(grpc_timer_heap *heap, grpc_timer *timer) {
+void grpc_timer_heap_remove(grpc_timer_heap* heap, grpc_timer* timer) {
   uint32_t i = timer->heap_index;
   if (i == heap->timer_count - 1) {
     heap->timer_count--;
@@ -122,15 +121,15 @@
   note_changed_priority(heap, heap->timers[i]);
 }
 
-int grpc_timer_heap_is_empty(grpc_timer_heap *heap) {
+int grpc_timer_heap_is_empty(grpc_timer_heap* heap) {
   return heap->timer_count == 0;
 }
 
-grpc_timer *grpc_timer_heap_top(grpc_timer_heap *heap) {
+grpc_timer* grpc_timer_heap_top(grpc_timer_heap* heap) {
   return heap->timers[0];
 }
 
-void grpc_timer_heap_pop(grpc_timer_heap *heap) {
+void grpc_timer_heap_pop(grpc_timer_heap* heap) {
   grpc_timer_heap_remove(heap, grpc_timer_heap_top(heap));
 }
 
diff --git a/src/core/lib/iomgr/timer_heap.h b/src/core/lib/iomgr/timer_heap.h
index 228d038..ae56e5a 100644
--- a/src/core/lib/iomgr/timer_heap.h
+++ b/src/core/lib/iomgr/timer_heap.h
@@ -26,22 +26,22 @@
 #endif
 
 typedef struct {
-  grpc_timer **timers;
+  grpc_timer** timers;
   uint32_t timer_count;
   uint32_t timer_capacity;
 } grpc_timer_heap;
 
 /* return 1 if the new timer is the first timer in the heap */
-int grpc_timer_heap_add(grpc_timer_heap *heap, grpc_timer *timer);
+int grpc_timer_heap_add(grpc_timer_heap* heap, grpc_timer* timer);
 
-void grpc_timer_heap_init(grpc_timer_heap *heap);
-void grpc_timer_heap_destroy(grpc_timer_heap *heap);
+void grpc_timer_heap_init(grpc_timer_heap* heap);
+void grpc_timer_heap_destroy(grpc_timer_heap* heap);
 
-void grpc_timer_heap_remove(grpc_timer_heap *heap, grpc_timer *timer);
-grpc_timer *grpc_timer_heap_top(grpc_timer_heap *heap);
-void grpc_timer_heap_pop(grpc_timer_heap *heap);
+void grpc_timer_heap_remove(grpc_timer_heap* heap, grpc_timer* timer);
+grpc_timer* grpc_timer_heap_top(grpc_timer_heap* heap);
+void grpc_timer_heap_pop(grpc_timer_heap* heap);
 
-int grpc_timer_heap_is_empty(grpc_timer_heap *heap);
+int grpc_timer_heap_is_empty(grpc_timer_heap* heap);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/timer_manager.cc b/src/core/lib/iomgr/timer_manager.cc
index 9f2dcb5..5e06bd6 100644
--- a/src/core/lib/iomgr/timer_manager.cc
+++ b/src/core/lib/iomgr/timer_manager.cc
@@ -30,7 +30,7 @@
 
 typedef struct completed_thread {
   gpr_thd_id t;
-  struct completed_thread *next;
+  struct completed_thread* next;
 } completed_thread;
 
 extern grpc_core::TraceFlag grpc_timer_check_trace;
@@ -48,7 +48,7 @@
 // number of threads sitting around waiting
 static int g_waiter_count;
 // linked list of threads that have completed (and need joining)
-static completed_thread *g_completed_threads;
+static completed_thread* g_completed_threads;
 // was the manager kicked by the timer system
 static bool g_kicked;
 // is there a thread waiting until the next timer should fire?
@@ -59,16 +59,16 @@
 // generation counter to track which thread is waiting for the next timer
 static uint64_t g_timed_waiter_generation;
 
-static void timer_thread(void *completed_thread_ptr);
+static void timer_thread(void* completed_thread_ptr);
 
 static void gc_completed_threads(void) {
   if (g_completed_threads != NULL) {
-    completed_thread *to_gc = g_completed_threads;
+    completed_thread* to_gc = g_completed_threads;
     g_completed_threads = NULL;
     gpr_mu_unlock(&g_mu);
     while (to_gc != NULL) {
       gpr_thd_join(to_gc->t);
-      completed_thread *next = to_gc->next;
+      completed_thread* next = to_gc->next;
       gpr_free(to_gc);
       to_gc = next;
     }
@@ -86,7 +86,7 @@
   }
   gpr_thd_options opt = gpr_thd_options_default();
   gpr_thd_options_set_joinable(&opt);
-  completed_thread *ct = (completed_thread *)gpr_malloc(sizeof(*ct));
+  completed_thread* ct = (completed_thread*)gpr_malloc(sizeof(*ct));
   // The call to gpr_thd_new() has to be under the same lock used by
   // gc_completed_threads(), particularly due to ct->t, which is written here
   // (internally by gpr_thd_new) and read there. Otherwise it's possible for ct
@@ -104,7 +104,7 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void run_some_timers(grpc_exec_ctx *exec_ctx) {
+static void run_some_timers(grpc_exec_ctx* exec_ctx) {
   // if there's something to execute...
   gpr_mu_lock(&g_mu);
   // remove a waiter from the pool, and start another thread if necessary
@@ -138,7 +138,7 @@
 // wait until 'next' (or forever if there is already a timed waiter in the pool)
 // returns true if the thread should continue executing (false if it should
 // shutdown)
-static bool wait_until(grpc_exec_ctx *exec_ctx, grpc_millis next) {
+static bool wait_until(grpc_exec_ctx* exec_ctx, grpc_millis next) {
   gpr_mu_lock(&g_mu);
   // if we're not threaded anymore, leave
   if (!g_threaded) {
@@ -220,7 +220,7 @@
   return true;
 }
 
-static void timer_main_loop(grpc_exec_ctx *exec_ctx) {
+static void timer_main_loop(grpc_exec_ctx* exec_ctx) {
   for (;;) {
     grpc_millis next = GRPC_MILLIS_INF_FUTURE;
     grpc_exec_ctx_invalidate_now(exec_ctx);
@@ -253,7 +253,7 @@
   }
 }
 
-static void timer_thread_cleanup(completed_thread *ct) {
+static void timer_thread_cleanup(completed_thread* ct) {
   gpr_mu_lock(&g_mu);
   // terminate the thread: drop the waiter count, thread count, and let whomever
   // stopped the threading stuff know that we're done
@@ -270,14 +270,14 @@
   }
 }
 
-static void timer_thread(void *completed_thread_ptr) {
+static void timer_thread(void* completed_thread_ptr) {
   // this threads exec_ctx: we try to run things through to completion here
   // since it's easy to spin up new threads
   grpc_exec_ctx exec_ctx =
       GRPC_EXEC_CTX_INITIALIZER(0, grpc_never_ready_to_finish, NULL);
   timer_main_loop(&exec_ctx);
   grpc_exec_ctx_finish(&exec_ctx);
-  timer_thread_cleanup((completed_thread *)completed_thread_ptr);
+  timer_thread_cleanup((completed_thread*)completed_thread_ptr);
 }
 
 static void start_threads(void) {
diff --git a/src/core/lib/iomgr/timer_uv.cc b/src/core/lib/iomgr/timer_uv.cc
index c4d46ff..b55a09d 100644
--- a/src/core/lib/iomgr/timer_uv.cc
+++ b/src/core/lib/iomgr/timer_uv.cc
@@ -34,16 +34,16 @@
 grpc_core::TraceFlag grpc_timer_check_trace(false, "timer_check");
 }
 
-static void timer_close_callback(uv_handle_t *handle) { gpr_free(handle); }
+static void timer_close_callback(uv_handle_t* handle) { gpr_free(handle); }
 
-static void stop_uv_timer(uv_timer_t *handle) {
+static void stop_uv_timer(uv_timer_t* handle) {
   uv_timer_stop(handle);
-  uv_unref((uv_handle_t *)handle);
-  uv_close((uv_handle_t *)handle, timer_close_callback);
+  uv_unref((uv_handle_t*)handle);
+  uv_close((uv_handle_t*)handle, timer_close_callback);
 }
 
-void run_expired_timer(uv_timer_t *handle) {
-  grpc_timer *timer = (grpc_timer *)handle->data;
+void run_expired_timer(uv_timer_t* handle) {
+  grpc_timer* timer = (grpc_timer*)handle->data;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GRPC_UV_ASSERT_SAME_THREAD();
   GPR_ASSERT(timer->pending);
@@ -53,10 +53,10 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer,
-                     grpc_millis deadline, grpc_closure *closure) {
+void grpc_timer_init(grpc_exec_ctx* exec_ctx, grpc_timer* timer,
+                     grpc_millis deadline, grpc_closure* closure) {
   uint64_t timeout;
-  uv_timer_t *uv_timer;
+  uv_timer_t* uv_timer;
   GRPC_UV_ASSERT_SAME_THREAD();
   timer->closure = closure;
   if (deadline <= grpc_exec_ctx_now(exec_ctx)) {
@@ -66,7 +66,7 @@
   }
   timer->pending = 1;
   timeout = (uint64_t)(deadline - grpc_exec_ctx_now(exec_ctx));
-  uv_timer = (uv_timer_t *)gpr_malloc(sizeof(uv_timer_t));
+  uv_timer = (uv_timer_t*)gpr_malloc(sizeof(uv_timer_t));
   uv_timer_init(uv_default_loop(), uv_timer);
   uv_timer->data = timer;
   timer->uv_timer = uv_timer;
@@ -74,27 +74,27 @@
   /* We assume that gRPC timers are only used alongside other active gRPC
      objects, and that there will therefore always be something else keeping
      the uv loop alive whenever there is a timer */
-  uv_unref((uv_handle_t *)uv_timer);
+  uv_unref((uv_handle_t*)uv_timer);
 }
 
-void grpc_timer_init_unset(grpc_timer *timer) { timer->pending = 0; }
+void grpc_timer_init_unset(grpc_timer* timer) { timer->pending = 0; }
 
-void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer) {
+void grpc_timer_cancel(grpc_exec_ctx* exec_ctx, grpc_timer* timer) {
   GRPC_UV_ASSERT_SAME_THREAD();
   if (timer->pending) {
     timer->pending = 0;
     GRPC_CLOSURE_SCHED(exec_ctx, timer->closure, GRPC_ERROR_CANCELLED);
-    stop_uv_timer((uv_timer_t *)timer->uv_timer);
+    stop_uv_timer((uv_timer_t*)timer->uv_timer);
   }
 }
 
-grpc_timer_check_result grpc_timer_check(grpc_exec_ctx *exec_ctx,
-                                         grpc_millis *next) {
+grpc_timer_check_result grpc_timer_check(grpc_exec_ctx* exec_ctx,
+                                         grpc_millis* next) {
   return GRPC_TIMERS_NOT_CHECKED;
 }
 
-void grpc_timer_list_init(grpc_exec_ctx *exec_ctx) {}
-void grpc_timer_list_shutdown(grpc_exec_ctx *exec_ctx) {}
+void grpc_timer_list_init(grpc_exec_ctx* exec_ctx) {}
+void grpc_timer_list_shutdown(grpc_exec_ctx* exec_ctx) {}
 
 void grpc_timer_consume_kick(void) {}
 
diff --git a/src/core/lib/iomgr/timer_uv.h b/src/core/lib/iomgr/timer_uv.h
index 8a4c17c..214aaa6 100644
--- a/src/core/lib/iomgr/timer_uv.h
+++ b/src/core/lib/iomgr/timer_uv.h
@@ -22,10 +22,10 @@
 #include "src/core/lib/iomgr/exec_ctx.h"
 
 struct grpc_timer {
-  grpc_closure *closure;
+  grpc_closure* closure;
   /* This is actually a uv_timer_t*, but we want to keep platform-specific
      types out of headers */
-  void *uv_timer;
+  void* uv_timer;
   int pending;
 };
 
diff --git a/src/core/lib/iomgr/udp_server.cc b/src/core/lib/iomgr/udp_server.cc
index 00b2e68..8ce8b96 100644
--- a/src/core/lib/iomgr/udp_server.cc
+++ b/src/core/lib/iomgr/udp_server.cc
@@ -59,8 +59,8 @@
 typedef struct grpc_udp_listener grpc_udp_listener;
 struct grpc_udp_listener {
   int fd;
-  grpc_fd *emfd;
-  grpc_udp_server *server;
+  grpc_fd* emfd;
+  grpc_udp_server* server;
   grpc_resolved_address addr;
   grpc_closure read_closure;
   grpc_closure write_closure;
@@ -74,12 +74,12 @@
   // True if orphan_cb is trigered.
   bool orphan_notified;
 
-  struct grpc_udp_listener *next;
+  struct grpc_udp_listener* next;
 };
 
 struct shutdown_fd_args {
-  grpc_fd *fd;
-  gpr_mu *server_mu;
+  grpc_fd* fd;
+  gpr_mu* server_mu;
 };
 
 /* the overall server */
@@ -87,7 +87,7 @@
   gpr_mu mu;
 
   /* factory to use for creating and binding sockets, or NULL */
-  grpc_socket_factory *socket_factory;
+  grpc_socket_factory* socket_factory;
 
   /* active port count: how many ports are actually still listening */
   size_t active_ports;
@@ -98,34 +98,34 @@
   int shutdown;
 
   /* linked list of server ports */
-  grpc_udp_listener *head;
-  grpc_udp_listener *tail;
+  grpc_udp_listener* head;
+  grpc_udp_listener* tail;
   unsigned nports;
 
   /* shutdown callback */
-  grpc_closure *shutdown_complete;
+  grpc_closure* shutdown_complete;
 
   /* all pollsets interested in new connections */
-  grpc_pollset **pollsets;
+  grpc_pollset** pollsets;
   /* number of pollsets in the pollsets array */
   size_t pollset_count;
   /* opaque object to pass to callbacks */
-  void *user_data;
+  void* user_data;
 };
 
-static grpc_socket_factory *get_socket_factory(const grpc_channel_args *args) {
+static grpc_socket_factory* get_socket_factory(const grpc_channel_args* args) {
   if (args) {
-    const grpc_arg *arg = grpc_channel_args_find(args, GRPC_ARG_SOCKET_FACTORY);
+    const grpc_arg* arg = grpc_channel_args_find(args, GRPC_ARG_SOCKET_FACTORY);
     if (arg) {
       GPR_ASSERT(arg->type == GRPC_ARG_POINTER);
-      return (grpc_socket_factory *)arg->value.pointer.p;
+      return (grpc_socket_factory*)arg->value.pointer.p;
     }
   }
   return NULL;
 }
 
-grpc_udp_server *grpc_udp_server_create(const grpc_channel_args *args) {
-  grpc_udp_server *s = (grpc_udp_server *)gpr_malloc(sizeof(grpc_udp_server));
+grpc_udp_server* grpc_udp_server_create(const grpc_channel_args* args) {
+  grpc_udp_server* s = (grpc_udp_server*)gpr_malloc(sizeof(grpc_udp_server));
   gpr_mu_init(&s->mu);
   s->socket_factory = get_socket_factory(args);
   if (s->socket_factory) {
@@ -141,20 +141,20 @@
   return s;
 }
 
-static void shutdown_fd(grpc_exec_ctx *exec_ctx, void *args,
-                        grpc_error *error) {
-  struct shutdown_fd_args *shutdown_args = (struct shutdown_fd_args *)args;
+static void shutdown_fd(grpc_exec_ctx* exec_ctx, void* args,
+                        grpc_error* error) {
+  struct shutdown_fd_args* shutdown_args = (struct shutdown_fd_args*)args;
   gpr_mu_lock(shutdown_args->server_mu);
   grpc_fd_shutdown(exec_ctx, shutdown_args->fd, GRPC_ERROR_REF(error));
   gpr_mu_unlock(shutdown_args->server_mu);
   gpr_free(shutdown_args);
 }
 
-static void dummy_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
+static void dummy_cb(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
   // No-op.
 }
 
-static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) {
+static void finish_shutdown(grpc_exec_ctx* exec_ctx, grpc_udp_server* s) {
   if (s->shutdown_complete != NULL) {
     GRPC_CLOSURE_SCHED(exec_ctx, s->shutdown_complete, GRPC_ERROR_NONE);
   }
@@ -162,7 +162,7 @@
   gpr_mu_destroy(&s->mu);
 
   while (s->head) {
-    grpc_udp_listener *sp = s->head;
+    grpc_udp_listener* sp = s->head;
     s->head = sp->next;
     gpr_free(sp);
   }
@@ -174,9 +174,9 @@
   gpr_free(s);
 }
 
-static void destroyed_port(grpc_exec_ctx *exec_ctx, void *server,
-                           grpc_error *error) {
-  grpc_udp_server *s = (grpc_udp_server *)server;
+static void destroyed_port(grpc_exec_ctx* exec_ctx, void* server,
+                           grpc_error* error) {
+  grpc_udp_server* s = (grpc_udp_server*)server;
   gpr_mu_lock(&s->mu);
   s->destroyed_ports++;
   if (s->destroyed_ports == s->nports) {
@@ -190,14 +190,14 @@
 /* called when all listening endpoints have been shutdown, so no further
    events will be received on them - at this point it's safe to destroy
    things */
-static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) {
+static void deactivated_all_ports(grpc_exec_ctx* exec_ctx, grpc_udp_server* s) {
   /* delete ALL the things */
   gpr_mu_lock(&s->mu);
 
   GPR_ASSERT(s->shutdown);
 
   if (s->head) {
-    grpc_udp_listener *sp;
+    grpc_udp_listener* sp;
     for (sp = s->head; sp; sp = sp->next) {
       grpc_unlink_if_unix_domain_socket(&sp->addr);
 
@@ -223,9 +223,9 @@
   }
 }
 
-void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *s,
-                             grpc_closure *on_done) {
-  grpc_udp_listener *sp;
+void grpc_udp_server_destroy(grpc_exec_ctx* exec_ctx, grpc_udp_server* s,
+                             grpc_closure* on_done) {
+  grpc_udp_listener* sp;
   gpr_mu_lock(&s->mu);
 
   GPR_ASSERT(!s->shutdown);
@@ -237,8 +237,8 @@
   if (s->active_ports) {
     for (sp = s->head; sp; sp = sp->next) {
       GPR_ASSERT(sp->orphan_cb);
-      struct shutdown_fd_args *args =
-          (struct shutdown_fd_args *)gpr_malloc(sizeof(*args));
+      struct shutdown_fd_args* args =
+          (struct shutdown_fd_args*)gpr_malloc(sizeof(*args));
       args->fd = sp->emfd;
       args->server_mu = &s->mu;
       GRPC_CLOSURE_INIT(&sp->orphan_fd_closure, shutdown_fd, args,
@@ -254,19 +254,18 @@
   }
 }
 
-static int bind_socket(grpc_socket_factory *socket_factory, int sockfd,
-                       const grpc_resolved_address *addr) {
+static int bind_socket(grpc_socket_factory* socket_factory, int sockfd,
+                       const grpc_resolved_address* addr) {
   return (socket_factory != NULL)
              ? grpc_socket_factory_bind(socket_factory, sockfd, addr)
-             : bind(sockfd, (struct sockaddr *)addr->addr,
-                    (socklen_t)addr->len);
+             : bind(sockfd, (struct sockaddr*)addr->addr, (socklen_t)addr->len);
 }
 
 /* Prepare a recently-created socket for listening. */
-static int prepare_socket(grpc_socket_factory *socket_factory, int fd,
-                          const grpc_resolved_address *addr) {
+static int prepare_socket(grpc_socket_factory* socket_factory, int fd,
+                          const grpc_resolved_address* addr) {
   grpc_resolved_address sockname_temp;
-  struct sockaddr *addr_ptr = (struct sockaddr *)addr->addr;
+  struct sockaddr* addr_ptr = (struct sockaddr*)addr->addr;
   /* Set send/receive socket buffers to 1 MB */
   int buffer_size_bytes = 1024 * 1024;
 
@@ -295,7 +294,7 @@
 
   GPR_ASSERT(addr->len < ~(socklen_t)0);
   if (bind_socket(socket_factory, fd, addr) < 0) {
-    char *addr_str;
+    char* addr_str;
     grpc_sockaddr_to_string(&addr_str, addr, 0);
     gpr_log(GPR_ERROR, "bind addr=%s: %s", addr_str, strerror(errno));
     gpr_free(addr_str);
@@ -304,8 +303,8 @@
 
   sockname_temp.len = sizeof(struct sockaddr_storage);
 
-  if (getsockname(fd, (struct sockaddr *)sockname_temp.addr,
-                  (socklen_t *)&sockname_temp.len) < 0) {
+  if (getsockname(fd, (struct sockaddr*)sockname_temp.addr,
+                  (socklen_t*)&sockname_temp.len) < 0) {
     goto error;
   }
 
@@ -331,8 +330,8 @@
 }
 
 /* event manager callback when reads are ready */
-static void on_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_udp_listener *sp = (grpc_udp_listener *)arg;
+static void on_read(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_udp_listener* sp = (grpc_udp_listener*)arg;
 
   gpr_mu_lock(&sp->server->mu);
   if (error != GRPC_ERROR_NONE) {
@@ -354,8 +353,8 @@
   gpr_mu_unlock(&sp->server->mu);
 }
 
-static void on_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_udp_listener *sp = (grpc_udp_listener *)arg;
+static void on_write(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_udp_listener* sp = (grpc_udp_listener*)arg;
 
   gpr_mu_lock(&(sp->server->mu));
   if (error != GRPC_ERROR_NONE) {
@@ -377,15 +376,15 @@
   gpr_mu_unlock(&sp->server->mu);
 }
 
-static int add_socket_to_server(grpc_udp_server *s, int fd,
-                                const grpc_resolved_address *addr,
+static int add_socket_to_server(grpc_udp_server* s, int fd,
+                                const grpc_resolved_address* addr,
                                 grpc_udp_server_read_cb read_cb,
                                 grpc_udp_server_write_cb write_cb,
                                 grpc_udp_server_orphan_cb orphan_cb) {
-  grpc_udp_listener *sp;
+  grpc_udp_listener* sp;
   int port;
-  char *addr_str;
-  char *name;
+  char* addr_str;
+  char* name;
 
   port = prepare_socket(s->socket_factory, fd, addr);
   if (port >= 0) {
@@ -394,7 +393,7 @@
     gpr_free(addr_str);
     gpr_mu_lock(&s->mu);
     s->nports++;
-    sp = (grpc_udp_listener *)gpr_malloc(sizeof(grpc_udp_listener));
+    sp = (grpc_udp_listener*)gpr_malloc(sizeof(grpc_udp_listener));
     sp->next = NULL;
     if (s->head == NULL) {
       s->head = sp;
@@ -418,12 +417,12 @@
   return port;
 }
 
-int grpc_udp_server_add_port(grpc_udp_server *s,
-                             const grpc_resolved_address *addr,
+int grpc_udp_server_add_port(grpc_udp_server* s,
+                             const grpc_resolved_address* addr,
                              grpc_udp_server_read_cb read_cb,
                              grpc_udp_server_write_cb write_cb,
                              grpc_udp_server_orphan_cb orphan_cb) {
-  grpc_udp_listener *sp;
+  grpc_udp_listener* sp;
   int allocated_port1 = -1;
   int allocated_port2 = -1;
   int fd;
@@ -432,7 +431,7 @@
   grpc_resolved_address wild4;
   grpc_resolved_address wild6;
   grpc_resolved_address addr4_copy;
-  grpc_resolved_address *allocated_addr = NULL;
+  grpc_resolved_address* allocated_addr = NULL;
   grpc_resolved_address sockname_temp;
   int port;
 
@@ -441,12 +440,12 @@
   if (grpc_sockaddr_get_port(addr) == 0) {
     for (sp = s->head; sp; sp = sp->next) {
       sockname_temp.len = sizeof(struct sockaddr_storage);
-      if (0 == getsockname(sp->fd, (struct sockaddr *)sockname_temp.addr,
-                           (socklen_t *)&sockname_temp.len)) {
+      if (0 == getsockname(sp->fd, (struct sockaddr*)sockname_temp.addr,
+                           (socklen_t*)&sockname_temp.len)) {
         port = grpc_sockaddr_get_port(&sockname_temp);
         if (port > 0) {
-          allocated_addr = (grpc_resolved_address *)gpr_malloc(
-              sizeof(grpc_resolved_address));
+          allocated_addr =
+              (grpc_resolved_address*)gpr_malloc(sizeof(grpc_resolved_address));
           memcpy(allocated_addr, addr, sizeof(grpc_resolved_address));
           grpc_sockaddr_set_port(allocated_addr, port);
           addr = allocated_addr;
@@ -500,8 +499,8 @@
   return allocated_port1 >= 0 ? allocated_port1 : allocated_port2;
 }
 
-int grpc_udp_server_get_fd(grpc_udp_server *s, unsigned port_index) {
-  grpc_udp_listener *sp;
+int grpc_udp_server_get_fd(grpc_udp_server* s, unsigned port_index) {
+  grpc_udp_listener* sp;
   if (port_index >= s->nports) {
     return -1;
   }
@@ -512,12 +511,12 @@
   return sp->fd;
 }
 
-void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s,
-                           grpc_pollset **pollsets, size_t pollset_count,
-                           void *user_data) {
+void grpc_udp_server_start(grpc_exec_ctx* exec_ctx, grpc_udp_server* s,
+                           grpc_pollset** pollsets, size_t pollset_count,
+                           void* user_data) {
   size_t i;
   gpr_mu_lock(&s->mu);
-  grpc_udp_listener *sp;
+  grpc_udp_listener* sp;
   GPR_ASSERT(s->active_ports == 0);
   s->pollsets = pollsets;
   s->user_data = user_data;
diff --git a/src/core/lib/iomgr/udp_server.h b/src/core/lib/iomgr/udp_server.h
index e887cb1..bca0f04 100644
--- a/src/core/lib/iomgr/udp_server.h
+++ b/src/core/lib/iomgr/udp_server.h
@@ -35,28 +35,28 @@
 typedef struct grpc_udp_server grpc_udp_server;
 
 /* Called when data is available to read from the socket. */
-typedef void (*grpc_udp_server_read_cb)(grpc_exec_ctx *exec_ctx, grpc_fd *emfd,
-                                        void *user_data);
+typedef void (*grpc_udp_server_read_cb)(grpc_exec_ctx* exec_ctx, grpc_fd* emfd,
+                                        void* user_data);
 
 /* Called when the socket is writeable. */
-typedef void (*grpc_udp_server_write_cb)(grpc_exec_ctx *exec_ctx, grpc_fd *emfd,
-                                         void *user_data);
+typedef void (*grpc_udp_server_write_cb)(grpc_exec_ctx* exec_ctx, grpc_fd* emfd,
+                                         void* user_data);
 
 /* Called when the grpc_fd is about to be orphaned (and the FD closed). */
-typedef void (*grpc_udp_server_orphan_cb)(grpc_exec_ctx *exec_ctx,
-                                          grpc_fd *emfd,
-                                          grpc_closure *shutdown_fd_callback,
-                                          void *user_data);
+typedef void (*grpc_udp_server_orphan_cb)(grpc_exec_ctx* exec_ctx,
+                                          grpc_fd* emfd,
+                                          grpc_closure* shutdown_fd_callback,
+                                          void* user_data);
 
 /* Create a server, initially not bound to any ports */
-grpc_udp_server *grpc_udp_server_create(const grpc_channel_args *args);
+grpc_udp_server* grpc_udp_server_create(const grpc_channel_args* args);
 
 /* Start listening to bound ports. user_data is passed to callbacks. */
-void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *udp_server,
-                           grpc_pollset **pollsets, size_t pollset_count,
-                           void *user_data);
+void grpc_udp_server_start(grpc_exec_ctx* exec_ctx, grpc_udp_server* udp_server,
+                           grpc_pollset** pollsets, size_t pollset_count,
+                           void* user_data);
 
-int grpc_udp_server_get_fd(grpc_udp_server *s, unsigned port_index);
+int grpc_udp_server_get_fd(grpc_udp_server* s, unsigned port_index);
 
 /* Add a port to the server, returning port number on success, or negative
    on failure.
@@ -68,14 +68,14 @@
 
 /* TODO(ctiller): deprecate this, and make grpc_udp_server_add_ports to handle
                   all of the multiple socket port matching logic in one place */
-int grpc_udp_server_add_port(grpc_udp_server *s,
-                             const grpc_resolved_address *addr,
+int grpc_udp_server_add_port(grpc_udp_server* s,
+                             const grpc_resolved_address* addr,
                              grpc_udp_server_read_cb read_cb,
                              grpc_udp_server_write_cb write_cb,
                              grpc_udp_server_orphan_cb orphan_cb);
 
-void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *server,
-                             grpc_closure *on_done);
+void grpc_udp_server_destroy(grpc_exec_ctx* exec_ctx, grpc_udp_server* server,
+                             grpc_closure* on_done);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/unix_sockets_posix.cc b/src/core/lib/iomgr/unix_sockets_posix.cc
index 35f898f..5d3689c 100644
--- a/src/core/lib/iomgr/unix_sockets_posix.cc
+++ b/src/core/lib/iomgr/unix_sockets_posix.cc
@@ -36,12 +36,12 @@
   GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
 }
 
-grpc_error *grpc_resolve_unix_domain_address(const char *name,
-                                             grpc_resolved_addresses **addrs) {
-  struct sockaddr_un *un;
-  if (strlen(name) > GPR_ARRAY_SIZE(((struct sockaddr_un *)0)->sun_path) - 1) {
-    char *err_msg;
-    grpc_error *err;
+grpc_error* grpc_resolve_unix_domain_address(const char* name,
+                                             grpc_resolved_addresses** addrs) {
+  struct sockaddr_un* un;
+  if (strlen(name) > GPR_ARRAY_SIZE(((struct sockaddr_un*)0)->sun_path) - 1) {
+    char* err_msg;
+    grpc_error* err;
     gpr_asprintf(&err_msg,
                  "Path name should not have more than %" PRIuPTR " characters.",
                  GPR_ARRAY_SIZE(un->sun_path) - 1);
@@ -50,29 +50,29 @@
     return err;
   }
   *addrs =
-      (grpc_resolved_addresses *)gpr_malloc(sizeof(grpc_resolved_addresses));
+      (grpc_resolved_addresses*)gpr_malloc(sizeof(grpc_resolved_addresses));
   (*addrs)->naddrs = 1;
   (*addrs)->addrs =
-      (grpc_resolved_address *)gpr_malloc(sizeof(grpc_resolved_address));
-  un = (struct sockaddr_un *)(*addrs)->addrs->addr;
+      (grpc_resolved_address*)gpr_malloc(sizeof(grpc_resolved_address));
+  un = (struct sockaddr_un*)(*addrs)->addrs->addr;
   un->sun_family = AF_UNIX;
   strcpy(un->sun_path, name);
   (*addrs)->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1;
   return GRPC_ERROR_NONE;
 }
 
-int grpc_is_unix_socket(const grpc_resolved_address *resolved_addr) {
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
+int grpc_is_unix_socket(const grpc_resolved_address* resolved_addr) {
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
   return addr->sa_family == AF_UNIX;
 }
 
 void grpc_unlink_if_unix_domain_socket(
-    const grpc_resolved_address *resolved_addr) {
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
+    const grpc_resolved_address* resolved_addr) {
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
   if (addr->sa_family != AF_UNIX) {
     return;
   }
-  struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr;
+  struct sockaddr_un* un = (struct sockaddr_un*)resolved_addr->addr;
   struct stat st;
 
   if (stat(un->sun_path, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) {
@@ -80,15 +80,15 @@
   }
 }
 
-char *grpc_sockaddr_to_uri_unix_if_possible(
-    const grpc_resolved_address *resolved_addr) {
-  const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
+char* grpc_sockaddr_to_uri_unix_if_possible(
+    const grpc_resolved_address* resolved_addr) {
+  const struct sockaddr* addr = (const struct sockaddr*)resolved_addr->addr;
   if (addr->sa_family != AF_UNIX) {
     return NULL;
   }
 
-  char *result;
-  gpr_asprintf(&result, "unix:%s", ((struct sockaddr_un *)addr)->sun_path);
+  char* result;
+  gpr_asprintf(&result, "unix:%s", ((struct sockaddr_un*)addr)->sun_path);
   return result;
 }
 
diff --git a/src/core/lib/iomgr/unix_sockets_posix.h b/src/core/lib/iomgr/unix_sockets_posix.h
index 3e7f9c7..be3c33d 100644
--- a/src/core/lib/iomgr/unix_sockets_posix.h
+++ b/src/core/lib/iomgr/unix_sockets_posix.h
@@ -31,16 +31,16 @@
 
 void grpc_create_socketpair_if_unix(int sv[2]);
 
-grpc_error *grpc_resolve_unix_domain_address(
-    const char *name, grpc_resolved_addresses **addresses);
+grpc_error* grpc_resolve_unix_domain_address(
+    const char* name, grpc_resolved_addresses** addresses);
 
-int grpc_is_unix_socket(const grpc_resolved_address *resolved_addr);
+int grpc_is_unix_socket(const grpc_resolved_address* resolved_addr);
 
 void grpc_unlink_if_unix_domain_socket(
-    const grpc_resolved_address *resolved_addr);
+    const grpc_resolved_address* resolved_addr);
 
-char *grpc_sockaddr_to_uri_unix_if_possible(
-    const grpc_resolved_address *resolved_addr);
+char* grpc_sockaddr_to_uri_unix_if_possible(
+    const grpc_resolved_address* resolved_addr);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/iomgr/unix_sockets_posix_noop.cc b/src/core/lib/iomgr/unix_sockets_posix_noop.cc
index e46b1c0..fbd9602 100644
--- a/src/core/lib/iomgr/unix_sockets_posix_noop.cc
+++ b/src/core/lib/iomgr/unix_sockets_posix_noop.cc
@@ -29,18 +29,18 @@
   GPR_ASSERT(0);
 }
 
-grpc_error *grpc_resolve_unix_domain_address(
-    const char *name, grpc_resolved_addresses **addresses) {
+grpc_error* grpc_resolve_unix_domain_address(
+    const char* name, grpc_resolved_addresses** addresses) {
   *addresses = NULL;
   return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
       "Unix domain sockets are not supported on Windows");
 }
 
-int grpc_is_unix_socket(const grpc_resolved_address *addr) { return false; }
+int grpc_is_unix_socket(const grpc_resolved_address* addr) { return false; }
 
-void grpc_unlink_if_unix_domain_socket(const grpc_resolved_address *addr) {}
+void grpc_unlink_if_unix_domain_socket(const grpc_resolved_address* addr) {}
 
-char *grpc_sockaddr_to_uri_unix_if_possible(const grpc_resolved_address *addr) {
+char* grpc_sockaddr_to_uri_unix_if_possible(const grpc_resolved_address* addr) {
   return NULL;
 }
 
diff --git a/src/core/lib/iomgr/wakeup_fd_posix.cc b/src/core/lib/iomgr/wakeup_fd_posix.cc
index 9af96d3..dcad61b 100644
--- a/src/core/lib/iomgr/wakeup_fd_posix.cc
+++ b/src/core/lib/iomgr/wakeup_fd_posix.cc
@@ -25,7 +25,7 @@
 #include "src/core/lib/iomgr/wakeup_fd_pipe.h"
 #include "src/core/lib/iomgr/wakeup_fd_posix.h"
 
-static const grpc_wakeup_fd_vtable *wakeup_fd_vtable = NULL;
+static const grpc_wakeup_fd_vtable* wakeup_fd_vtable = NULL;
 
 int grpc_allow_specialized_wakeup_fd = 1;
 int grpc_allow_pipe_wakeup_fd = 1;
@@ -53,28 +53,28 @@
 
 void grpc_enable_cv_wakeup_fds(int enable) { cv_wakeup_fds_enabled = enable; }
 
-grpc_error *grpc_wakeup_fd_init(grpc_wakeup_fd *fd_info) {
+grpc_error* grpc_wakeup_fd_init(grpc_wakeup_fd* fd_info) {
   if (cv_wakeup_fds_enabled) {
     return grpc_cv_wakeup_fd_vtable.init(fd_info);
   }
   return wakeup_fd_vtable->init(fd_info);
 }
 
-grpc_error *grpc_wakeup_fd_consume_wakeup(grpc_wakeup_fd *fd_info) {
+grpc_error* grpc_wakeup_fd_consume_wakeup(grpc_wakeup_fd* fd_info) {
   if (cv_wakeup_fds_enabled) {
     return grpc_cv_wakeup_fd_vtable.consume(fd_info);
   }
   return wakeup_fd_vtable->consume(fd_info);
 }
 
-grpc_error *grpc_wakeup_fd_wakeup(grpc_wakeup_fd *fd_info) {
+grpc_error* grpc_wakeup_fd_wakeup(grpc_wakeup_fd* fd_info) {
   if (cv_wakeup_fds_enabled) {
     return grpc_cv_wakeup_fd_vtable.wakeup(fd_info);
   }
   return wakeup_fd_vtable->wakeup(fd_info);
 }
 
-void grpc_wakeup_fd_destroy(grpc_wakeup_fd *fd_info) {
+void grpc_wakeup_fd_destroy(grpc_wakeup_fd* fd_info) {
   if (cv_wakeup_fds_enabled) {
     grpc_cv_wakeup_fd_vtable.destroy(fd_info);
   } else {
diff --git a/src/core/lib/json/json_reader.cc b/src/core/lib/json/json_reader.cc
index 094a351..3003941 100644
--- a/src/core/lib/json/json_reader.cc
+++ b/src/core/lib/json/json_reader.cc
@@ -24,60 +24,60 @@
 
 #include "src/core/lib/json/json_reader.h"
 
-static void json_reader_string_clear(grpc_json_reader *reader) {
+static void json_reader_string_clear(grpc_json_reader* reader) {
   reader->vtable->string_clear(reader->userdata);
 }
 
-static void json_reader_string_add_char(grpc_json_reader *reader, uint32_t c) {
+static void json_reader_string_add_char(grpc_json_reader* reader, uint32_t c) {
   reader->vtable->string_add_char(reader->userdata, c);
 }
 
-static void json_reader_string_add_utf32(grpc_json_reader *reader,
+static void json_reader_string_add_utf32(grpc_json_reader* reader,
                                          uint32_t utf32) {
   reader->vtable->string_add_utf32(reader->userdata, utf32);
 }
 
-static uint32_t grpc_json_reader_read_char(grpc_json_reader *reader) {
+static uint32_t grpc_json_reader_read_char(grpc_json_reader* reader) {
   return reader->vtable->read_char(reader->userdata);
 }
 
-static void json_reader_container_begins(grpc_json_reader *reader,
+static void json_reader_container_begins(grpc_json_reader* reader,
                                          grpc_json_type type) {
   reader->vtable->container_begins(reader->userdata, type);
 }
 
 static grpc_json_type grpc_json_reader_container_ends(
-    grpc_json_reader *reader) {
+    grpc_json_reader* reader) {
   return reader->vtable->container_ends(reader->userdata);
 }
 
-static void json_reader_set_key(grpc_json_reader *reader) {
+static void json_reader_set_key(grpc_json_reader* reader) {
   reader->vtable->set_key(reader->userdata);
 }
 
-static void json_reader_set_string(grpc_json_reader *reader) {
+static void json_reader_set_string(grpc_json_reader* reader) {
   reader->vtable->set_string(reader->userdata);
 }
 
-static int json_reader_set_number(grpc_json_reader *reader) {
+static int json_reader_set_number(grpc_json_reader* reader) {
   return reader->vtable->set_number(reader->userdata);
 }
 
-static void json_reader_set_true(grpc_json_reader *reader) {
+static void json_reader_set_true(grpc_json_reader* reader) {
   reader->vtable->set_true(reader->userdata);
 }
 
-static void json_reader_set_false(grpc_json_reader *reader) {
+static void json_reader_set_false(grpc_json_reader* reader) {
   reader->vtable->set_false(reader->userdata);
 }
 
-static void json_reader_set_null(grpc_json_reader *reader) {
+static void json_reader_set_null(grpc_json_reader* reader) {
   reader->vtable->set_null(reader->userdata);
 }
 
 /* Call this function to initialize the reader structure. */
-void grpc_json_reader_init(grpc_json_reader *reader,
-                           grpc_json_reader_vtable *vtable, void *userdata) {
+void grpc_json_reader_init(grpc_json_reader* reader,
+                           grpc_json_reader_vtable* vtable, void* userdata) {
   memset(reader, 0, sizeof(*reader));
   reader->vtable = vtable;
   reader->userdata = userdata;
@@ -85,13 +85,13 @@
   reader->state = GRPC_JSON_STATE_VALUE_BEGIN;
 }
 
-int grpc_json_reader_is_complete(grpc_json_reader *reader) {
+int grpc_json_reader_is_complete(grpc_json_reader* reader) {
   return ((reader->depth == 0) &&
           ((reader->state == GRPC_JSON_STATE_END) ||
            (reader->state == GRPC_JSON_STATE_VALUE_END)));
 }
 
-grpc_json_reader_status grpc_json_reader_run(grpc_json_reader *reader) {
+grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader) {
   uint32_t c, success;
 
   /* This state-machine is a strict implementation of ECMA-404 */
@@ -177,8 +177,8 @@
             if (!success) return GRPC_JSON_PARSE_ERROR;
             json_reader_string_clear(reader);
             reader->state = GRPC_JSON_STATE_VALUE_END;
-          /* The missing break here is intentional. */
-          /* fallthrough */
+            /* The missing break here is intentional. */
+            /* fallthrough */
 
           case GRPC_JSON_STATE_VALUE_END:
           case GRPC_JSON_STATE_OBJECT_KEY_BEGIN:
diff --git a/src/core/lib/json/json_reader.h b/src/core/lib/json/json_reader.h
index 7f14a9a..2636d2b 100644
--- a/src/core/lib/json/json_reader.h
+++ b/src/core/lib/json/json_reader.h
@@ -71,27 +71,27 @@
 
 typedef struct grpc_json_reader_vtable {
   /* Clears your internal string scratchpad. */
-  void (*string_clear)(void *userdata);
+  void (*string_clear)(void* userdata);
   /* Adds a char to the string scratchpad. */
-  void (*string_add_char)(void *userdata, uint32_t c);
+  void (*string_add_char)(void* userdata, uint32_t c);
   /* Adds a utf32 char to the string scratchpad. */
-  void (*string_add_utf32)(void *userdata, uint32_t c);
+  void (*string_add_utf32)(void* userdata, uint32_t c);
   /* Reads a character from your input. May be utf-8, 16 or 32. */
-  uint32_t (*read_char)(void *userdata);
+  uint32_t (*read_char)(void* userdata);
   /* Starts a container of type GRPC_JSON_ARRAY or GRPC_JSON_OBJECT. */
-  void (*container_begins)(void *userdata, grpc_json_type type);
+  void (*container_begins)(void* userdata, grpc_json_type type);
   /* Ends the current container. Must return the type of its parent. */
-  grpc_json_type (*container_ends)(void *userdata);
+  grpc_json_type (*container_ends)(void* userdata);
   /* Your internal string scratchpad is an object's key. */
-  void (*set_key)(void *userdata);
+  void (*set_key)(void* userdata);
   /* Your internal string scratchpad is a string value. */
-  void (*set_string)(void *userdata);
+  void (*set_string)(void* userdata);
   /* Your internal string scratchpad is a numerical value. Return 1 if valid. */
-  int (*set_number)(void *userdata);
+  int (*set_number)(void* userdata);
   /* Sets the values true, false or null. */
-  void (*set_true)(void *userdata);
-  void (*set_false)(void *userdata);
-  void (*set_null)(void *userdata);
+  void (*set_true)(void* userdata);
+  void (*set_false)(void* userdata);
+  void (*set_null)(void* userdata);
 } grpc_json_reader_vtable;
 
 typedef struct grpc_json_reader {
@@ -99,8 +99,8 @@
    * The definition is public so you can put it on your stack.
    */
 
-  void *userdata;
-  grpc_json_reader_vtable *vtable;
+  void* userdata;
+  grpc_json_reader_vtable* vtable;
   int depth;
   int in_object;
   int in_array;
@@ -133,18 +133,18 @@
  *    . GRPC_JSON_INTERNAL_ERROR if the parser somehow ended into an invalid
  *      internal state.
  */
-grpc_json_reader_status grpc_json_reader_run(grpc_json_reader *reader);
+grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader);
 
 /* Call this function to initialize the reader structure. */
-void grpc_json_reader_init(grpc_json_reader *reader,
-                           grpc_json_reader_vtable *vtable, void *userdata);
+void grpc_json_reader_init(grpc_json_reader* reader,
+                           grpc_json_reader_vtable* vtable, void* userdata);
 
 /* You may call this from the read_char callback if you don't know where is the
  * end of your input stream, and you'd like the json reader to hint you that it
  * has completed reading its input, so you can return an EOF to it. Note that
  * there might still be trailing whitespaces after that point.
  */
-int grpc_json_reader_is_complete(grpc_json_reader *reader);
+int grpc_json_reader_is_complete(grpc_json_reader* reader);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/json/json_string.cc b/src/core/lib/json/json_string.cc
index 3178d2d..8674d72 100644
--- a/src/core/lib/json/json_string.cc
+++ b/src/core/lib/json/json_string.cc
@@ -38,13 +38,13 @@
  * input size, and never expands it.
  */
 typedef struct {
-  grpc_json *top;
-  grpc_json *current_container;
-  grpc_json *current_value;
-  uint8_t *input;
-  uint8_t *key;
-  uint8_t *string;
-  uint8_t *string_ptr;
+  grpc_json* top;
+  grpc_json* current_container;
+  grpc_json* current_value;
+  uint8_t* input;
+  uint8_t* key;
+  uint8_t* string;
+  uint8_t* string_ptr;
   size_t remaining_input;
 } json_reader_userdata;
 
@@ -52,7 +52,7 @@
  * The point is that we allocate that string in chunks of 256 bytes.
  */
 typedef struct {
-  char *output;
+  char* output;
   size_t free_space;
   size_t string_len;
   size_t allocated;
@@ -62,35 +62,35 @@
  * and will enlarge it if necessary. We're only allocating chunks of 256
  * bytes at a time (or multiples thereof).
  */
-static void json_writer_output_check(void *userdata, size_t needed) {
-  json_writer_userdata *state = (json_writer_userdata *)userdata;
+static void json_writer_output_check(void* userdata, size_t needed) {
+  json_writer_userdata* state = (json_writer_userdata*)userdata;
   if (state->free_space >= needed) return;
   needed -= state->free_space;
   /* Round up by 256 bytes. */
   needed = (needed + 0xff) & ~0xffU;
-  state->output = (char *)gpr_realloc(state->output, state->allocated + needed);
+  state->output = (char*)gpr_realloc(state->output, state->allocated + needed);
   state->free_space += needed;
   state->allocated += needed;
 }
 
 /* These are needed by the writer's implementation. */
-static void json_writer_output_char(void *userdata, char c) {
-  json_writer_userdata *state = (json_writer_userdata *)userdata;
+static void json_writer_output_char(void* userdata, char c) {
+  json_writer_userdata* state = (json_writer_userdata*)userdata;
   json_writer_output_check(userdata, 1);
   state->output[state->string_len++] = c;
   state->free_space--;
 }
 
-static void json_writer_output_string_with_len(void *userdata, const char *str,
+static void json_writer_output_string_with_len(void* userdata, const char* str,
                                                size_t len) {
-  json_writer_userdata *state = (json_writer_userdata *)userdata;
+  json_writer_userdata* state = (json_writer_userdata*)userdata;
   json_writer_output_check(userdata, len);
   memcpy(state->output + state->string_len, str, len);
   state->string_len += len;
   state->free_space -= len;
 }
 
-static void json_writer_output_string(void *userdata, const char *str) {
+static void json_writer_output_string(void* userdata, const char* str) {
   size_t len = strlen(str);
   json_writer_output_string_with_len(userdata, str, len);
 }
@@ -98,8 +98,8 @@
 /* The reader asks us to clear our scratchpad. In our case, we'll simply mark
  * the end of the current string, and advance our output pointer.
  */
-static void json_reader_string_clear(void *userdata) {
-  json_reader_userdata *state = (json_reader_userdata *)userdata;
+static void json_reader_string_clear(void* userdata) {
+  json_reader_userdata* state = (json_reader_userdata*)userdata;
   if (state->string) {
     GPR_ASSERT(state->string_ptr < state->input);
     *state->string_ptr++ = 0;
@@ -107,8 +107,8 @@
   state->string = state->string_ptr;
 }
 
-static void json_reader_string_add_char(void *userdata, uint32_t c) {
-  json_reader_userdata *state = (json_reader_userdata *)userdata;
+static void json_reader_string_add_char(void* userdata, uint32_t c) {
+  json_reader_userdata* state = (json_reader_userdata*)userdata;
   GPR_ASSERT(state->string_ptr < state->input);
   GPR_ASSERT(c <= 0xff);
   *state->string_ptr++ = (uint8_t)c;
@@ -117,7 +117,7 @@
 /* We are converting a UTF-32 character into UTF-8 here,
  * as described by RFC3629.
  */
-static void json_reader_string_add_utf32(void *userdata, uint32_t c) {
+static void json_reader_string_add_utf32(void* userdata, uint32_t c) {
   if (c <= 0x7f) {
     json_reader_string_add_char(userdata, c);
   } else if (c <= 0x7ff) {
@@ -147,9 +147,9 @@
 /* We consider that the input may be a zero-terminated string. So we
  * can end up hitting eof before the end of the alleged string length.
  */
-static uint32_t json_reader_read_char(void *userdata) {
+static uint32_t json_reader_read_char(void* userdata) {
   uint32_t r;
-  json_reader_userdata *state = (json_reader_userdata *)userdata;
+  json_reader_userdata* state = (json_reader_userdata*)userdata;
 
   if (state->remaining_input == 0) return GRPC_JSON_READ_CHAR_EOF;
 
@@ -167,9 +167,9 @@
 /* Helper function to create a new grpc_json object and link it into
  * our tree-in-progress inside our opaque structure.
  */
-static grpc_json *json_create_and_link(void *userdata, grpc_json_type type) {
-  json_reader_userdata *state = (json_reader_userdata *)userdata;
-  grpc_json *json = grpc_json_create(type);
+static grpc_json* json_create_and_link(void* userdata, grpc_json_type type) {
+  json_reader_userdata* state = (json_reader_userdata*)userdata;
+  grpc_json* json = grpc_json_create(type);
 
   json->parent = state->current_container;
   json->prev = state->current_value;
@@ -183,7 +183,7 @@
       json->parent->child = json;
     }
     if (json->parent->type == GRPC_JSON_OBJECT) {
-      json->key = (char *)state->key;
+      json->key = (char*)state->key;
     }
   }
   if (!state->top) {
@@ -193,9 +193,9 @@
   return json;
 }
 
-static void json_reader_container_begins(void *userdata, grpc_json_type type) {
-  json_reader_userdata *state = (json_reader_userdata *)userdata;
-  grpc_json *container;
+static void json_reader_container_begins(void* userdata, grpc_json_type type) {
+  json_reader_userdata* state = (json_reader_userdata*)userdata;
+  grpc_json* container;
 
   GPR_ASSERT(type == GRPC_JSON_ARRAY || type == GRPC_JSON_OBJECT);
 
@@ -213,9 +213,9 @@
  * Also note that if we're at the top of the tree, and the last container
  * ends, we have to return GRPC_JSON_TOP_LEVEL.
  */
-static grpc_json_type json_reader_container_ends(void *userdata) {
+static grpc_json_type json_reader_container_ends(void* userdata) {
   grpc_json_type container_type = GRPC_JSON_TOP_LEVEL;
-  json_reader_userdata *state = (json_reader_userdata *)userdata;
+  json_reader_userdata* state = (json_reader_userdata*)userdata;
 
   GPR_ASSERT(state->current_container);
 
@@ -235,36 +235,36 @@
  * Note that in the set_number case, we're not going to try interpreting it.
  * We'll keep it as a string, and leave it to the caller to evaluate it.
  */
-static void json_reader_set_key(void *userdata) {
-  json_reader_userdata *state = (json_reader_userdata *)userdata;
+static void json_reader_set_key(void* userdata) {
+  json_reader_userdata* state = (json_reader_userdata*)userdata;
   state->key = state->string;
 }
 
-static void json_reader_set_string(void *userdata) {
-  json_reader_userdata *state = (json_reader_userdata *)userdata;
-  grpc_json *json = json_create_and_link(userdata, GRPC_JSON_STRING);
-  json->value = (char *)state->string;
+static void json_reader_set_string(void* userdata) {
+  json_reader_userdata* state = (json_reader_userdata*)userdata;
+  grpc_json* json = json_create_and_link(userdata, GRPC_JSON_STRING);
+  json->value = (char*)state->string;
 }
 
-static int json_reader_set_number(void *userdata) {
-  json_reader_userdata *state = (json_reader_userdata *)userdata;
-  grpc_json *json = json_create_and_link(userdata, GRPC_JSON_NUMBER);
-  json->value = (char *)state->string;
+static int json_reader_set_number(void* userdata) {
+  json_reader_userdata* state = (json_reader_userdata*)userdata;
+  grpc_json* json = json_create_and_link(userdata, GRPC_JSON_NUMBER);
+  json->value = (char*)state->string;
   return 1;
 }
 
 /* The object types true, false and null are self-sufficient, and don't need
  * any more information beside their type.
  */
-static void json_reader_set_true(void *userdata) {
+static void json_reader_set_true(void* userdata) {
   json_create_and_link(userdata, GRPC_JSON_TRUE);
 }
 
-static void json_reader_set_false(void *userdata) {
+static void json_reader_set_false(void* userdata) {
   json_create_and_link(userdata, GRPC_JSON_FALSE);
 }
 
-static void json_reader_set_null(void *userdata) {
+static void json_reader_set_null(void* userdata) {
   json_create_and_link(userdata, GRPC_JSON_NULL);
 }
 
@@ -277,17 +277,17 @@
     json_reader_set_false,        json_reader_set_null};
 
 /* And finally, let's define our public API. */
-grpc_json *grpc_json_parse_string_with_len(char *input, size_t size) {
+grpc_json* grpc_json_parse_string_with_len(char* input, size_t size) {
   grpc_json_reader reader;
   json_reader_userdata state;
-  grpc_json *json = NULL;
+  grpc_json* json = NULL;
   grpc_json_reader_status status;
 
   if (!input) return NULL;
 
   state.top = state.current_container = state.current_value = NULL;
   state.string = state.key = NULL;
-  state.string_ptr = state.input = (uint8_t *)input;
+  state.string_ptr = state.input = (uint8_t*)input;
   state.remaining_input = size;
   grpc_json_reader_init(&reader, &reader_vtable, &state);
 
@@ -304,11 +304,11 @@
 
 #define UNBOUND_JSON_STRING_LENGTH 0x7fffffff
 
-grpc_json *grpc_json_parse_string(char *input) {
+grpc_json* grpc_json_parse_string(char* input) {
   return grpc_json_parse_string_with_len(input, UNBOUND_JSON_STRING_LENGTH);
 }
 
-static void json_dump_recursive(grpc_json_writer *writer, grpc_json *json,
+static void json_dump_recursive(grpc_json_writer* writer, grpc_json* json,
                                 int in_object) {
   while (json) {
     if (in_object) grpc_json_writer_object_key(writer, json->key);
@@ -348,7 +348,7 @@
     json_writer_output_char, json_writer_output_string,
     json_writer_output_string_with_len};
 
-char *grpc_json_dump_to_string(grpc_json *json, int indent) {
+char* grpc_json_dump_to_string(grpc_json* json, int indent) {
   grpc_json_writer writer;
   json_writer_userdata state;
 
diff --git a/src/core/lib/json/json_writer.cc b/src/core/lib/json/json_writer.cc
index eab1bff..0b9c7c3 100644
--- a/src/core/lib/json/json_writer.cc
+++ b/src/core/lib/json/json_writer.cc
@@ -22,22 +22,22 @@
 
 #include "src/core/lib/json/json_writer.h"
 
-static void json_writer_output_char(grpc_json_writer *writer, char c) {
+static void json_writer_output_char(grpc_json_writer* writer, char c) {
   writer->vtable->output_char(writer->userdata, c);
 }
 
-static void json_writer_output_string(grpc_json_writer *writer,
-                                      const char *str) {
+static void json_writer_output_string(grpc_json_writer* writer,
+                                      const char* str) {
   writer->vtable->output_string(writer->userdata, str);
 }
 
-static void json_writer_output_string_with_len(grpc_json_writer *writer,
-                                               const char *str, size_t len) {
+static void json_writer_output_string_with_len(grpc_json_writer* writer,
+                                               const char* str, size_t len) {
   writer->vtable->output_string_with_len(writer->userdata, str, len);
 }
 
-void grpc_json_writer_init(grpc_json_writer *writer, int indent,
-                           grpc_json_writer_vtable *vtable, void *userdata) {
+void grpc_json_writer_init(grpc_json_writer* writer, int indent,
+                           grpc_json_writer_vtable* vtable, void* userdata) {
   memset(writer, 0, sizeof(*writer));
   writer->container_empty = 1;
   writer->indent = indent;
@@ -45,7 +45,7 @@
   writer->userdata = userdata;
 }
 
-static void json_writer_output_indent(grpc_json_writer *writer) {
+static void json_writer_output_indent(grpc_json_writer* writer) {
   static const char spacesstr[] =
       "                "
       "                "
@@ -73,7 +73,7 @@
       writer, spacesstr + sizeof(spacesstr) - 1 - spaces, spaces);
 }
 
-static void json_writer_value_end(grpc_json_writer *writer) {
+static void json_writer_value_end(grpc_json_writer* writer) {
   if (writer->container_empty) {
     writer->container_empty = 0;
     if ((writer->indent == 0) || (writer->depth == 0)) return;
@@ -85,7 +85,7 @@
   }
 }
 
-static void json_writer_escape_utf16(grpc_json_writer *writer, uint16_t utf16) {
+static void json_writer_escape_utf16(grpc_json_writer* writer, uint16_t utf16) {
   static const char hex[] = "0123456789abcdef";
 
   json_writer_output_string_with_len(writer, "\\u", 2);
@@ -95,8 +95,8 @@
   json_writer_output_char(writer, hex[(utf16)&0x0f]);
 }
 
-static void json_writer_escape_string(grpc_json_writer *writer,
-                                      const char *string) {
+static void json_writer_escape_string(grpc_json_writer* writer,
+                                      const char* string) {
   json_writer_output_char(writer, '"');
 
   for (;;) {
@@ -190,7 +190,7 @@
   json_writer_output_char(writer, '"');
 }
 
-void grpc_json_writer_container_begins(grpc_json_writer *writer,
+void grpc_json_writer_container_begins(grpc_json_writer* writer,
                                        grpc_json_type type) {
   if (!writer->got_key) json_writer_value_end(writer);
   json_writer_output_indent(writer);
@@ -200,7 +200,7 @@
   writer->depth++;
 }
 
-void grpc_json_writer_container_ends(grpc_json_writer *writer,
+void grpc_json_writer_container_ends(grpc_json_writer* writer,
                                      grpc_json_type type) {
   if (writer->indent && !writer->container_empty)
     json_writer_output_char(writer, '\n');
@@ -211,7 +211,7 @@
   writer->got_key = 0;
 }
 
-void grpc_json_writer_object_key(grpc_json_writer *writer, const char *string) {
+void grpc_json_writer_object_key(grpc_json_writer* writer, const char* string) {
   json_writer_value_end(writer);
   json_writer_output_indent(writer);
   json_writer_escape_string(writer, string);
@@ -219,23 +219,23 @@
   writer->got_key = 1;
 }
 
-void grpc_json_writer_value_raw(grpc_json_writer *writer, const char *string) {
+void grpc_json_writer_value_raw(grpc_json_writer* writer, const char* string) {
   if (!writer->got_key) json_writer_value_end(writer);
   json_writer_output_indent(writer);
   json_writer_output_string(writer, string);
   writer->got_key = 0;
 }
 
-void grpc_json_writer_value_raw_with_len(grpc_json_writer *writer,
-                                         const char *string, size_t len) {
+void grpc_json_writer_value_raw_with_len(grpc_json_writer* writer,
+                                         const char* string, size_t len) {
   if (!writer->got_key) json_writer_value_end(writer);
   json_writer_output_indent(writer);
   json_writer_output_string_with_len(writer, string, len);
   writer->got_key = 0;
 }
 
-void grpc_json_writer_value_string(grpc_json_writer *writer,
-                                   const char *string) {
+void grpc_json_writer_value_string(grpc_json_writer* writer,
+                                   const char* string) {
   if (!writer->got_key) json_writer_value_end(writer);
   json_writer_output_indent(writer);
   json_writer_escape_string(writer, string);
diff --git a/src/core/lib/json/json_writer.h b/src/core/lib/json/json_writer.h
index 132d1f2..93eeb20 100644
--- a/src/core/lib/json/json_writer.h
+++ b/src/core/lib/json/json_writer.h
@@ -41,17 +41,17 @@
 
 typedef struct grpc_json_writer_vtable {
   /* Adds a character to the output stream. */
-  void (*output_char)(void *userdata, char);
+  void (*output_char)(void* userdata, char);
   /* Adds a zero-terminated string to the output stream. */
-  void (*output_string)(void *userdata, const char *str);
+  void (*output_string)(void* userdata, const char* str);
   /* Adds a fixed-length string to the output stream. */
-  void (*output_string_with_len)(void *userdata, const char *str, size_t len);
+  void (*output_string_with_len)(void* userdata, const char* str, size_t len);
 
 } grpc_json_writer_vtable;
 
 typedef struct grpc_json_writer {
-  void *userdata;
-  grpc_json_writer_vtable *vtable;
+  void* userdata;
+  grpc_json_writer_vtable* vtable;
   int indent;
   int depth;
   int container_empty;
@@ -63,25 +63,25 @@
  * use indent=0, then the output will not have any newlines either, thus
  * emitting a condensed json output.
  */
-void grpc_json_writer_init(grpc_json_writer *writer, int indent,
-                           grpc_json_writer_vtable *vtable, void *userdata);
+void grpc_json_writer_init(grpc_json_writer* writer, int indent,
+                           grpc_json_writer_vtable* vtable, void* userdata);
 
 /* Signals the beginning of a container. */
-void grpc_json_writer_container_begins(grpc_json_writer *writer,
+void grpc_json_writer_container_begins(grpc_json_writer* writer,
                                        grpc_json_type type);
 /* Signals the end of a container. */
-void grpc_json_writer_container_ends(grpc_json_writer *writer,
+void grpc_json_writer_container_ends(grpc_json_writer* writer,
                                      grpc_json_type type);
 /* Writes down an object key for the next value. */
-void grpc_json_writer_object_key(grpc_json_writer *writer, const char *string);
+void grpc_json_writer_object_key(grpc_json_writer* writer, const char* string);
 /* Sets a raw value. Useful for numbers. */
-void grpc_json_writer_value_raw(grpc_json_writer *writer, const char *string);
+void grpc_json_writer_value_raw(grpc_json_writer* writer, const char* string);
 /* Sets a raw value with its length. Useful for values like true or false. */
-void grpc_json_writer_value_raw_with_len(grpc_json_writer *writer,
-                                         const char *string, size_t len);
+void grpc_json_writer_value_raw_with_len(grpc_json_writer* writer,
+                                         const char* string, size_t len);
 /* Sets a string value. It'll be escaped, and utf-8 validated. */
-void grpc_json_writer_value_string(grpc_json_writer *writer,
-                                   const char *string);
+void grpc_json_writer_value_string(grpc_json_writer* writer,
+                                   const char* string);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/profiling/basic_timers.cc b/src/core/lib/profiling/basic_timers.cc
index 0ae7d7f..3ec6280 100644
--- a/src/core/lib/profiling/basic_timers.cc
+++ b/src/core/lib/profiling/basic_timers.cc
@@ -36,8 +36,8 @@
 
 typedef struct gpr_timer_entry {
   gpr_timespec tm;
-  const char *tagstr;
-  const char *file;
+  const char* tagstr;
+  const char* file;
   short line;
   char type;
   uint8_t important;
@@ -48,21 +48,21 @@
 
 typedef struct gpr_timer_log {
   size_t num_entries;
-  struct gpr_timer_log *next;
-  struct gpr_timer_log *prev;
+  struct gpr_timer_log* next;
+  struct gpr_timer_log* prev;
   gpr_timer_entry log[MAX_COUNT];
 } gpr_timer_log;
 
 typedef struct gpr_timer_log_list {
-  gpr_timer_log *head;
+  gpr_timer_log* head;
   /* valid iff head!=NULL */
-  gpr_timer_log *tail;
+  gpr_timer_log* tail;
 } gpr_timer_log_list;
 
-static __thread gpr_timer_log *g_thread_log;
+static __thread gpr_timer_log* g_thread_log;
 static gpr_once g_once_init = GPR_ONCE_INIT;
-static FILE *output_file;
-static const char *output_filename_or_null = NULL;
+static FILE* output_file;
+static const char* output_filename_or_null = NULL;
 static pthread_mutex_t g_mu;
 static pthread_cond_t g_cv;
 static gpr_timer_log_list g_in_progress_logs;
@@ -73,7 +73,7 @@
 static int g_next_thread_id;
 static int g_writing_enabled = 1;
 
-static const char *output_filename() {
+static const char* output_filename() {
   if (output_filename_or_null == NULL) {
     output_filename_or_null = gpr_getenv("LATENCY_TRACE");
     if (output_filename_or_null == NULL ||
@@ -84,7 +84,7 @@
   return output_filename_or_null;
 }
 
-static int timer_log_push_back(gpr_timer_log_list *list, gpr_timer_log *log) {
+static int timer_log_push_back(gpr_timer_log_list* list, gpr_timer_log* log) {
   if (list->head == NULL) {
     list->head = list->tail = log;
     log->next = log->prev = NULL;
@@ -98,8 +98,8 @@
   }
 }
 
-static gpr_timer_log *timer_log_pop_front(gpr_timer_log_list *list) {
-  gpr_timer_log *out = list->head;
+static gpr_timer_log* timer_log_pop_front(gpr_timer_log_list* list) {
+  gpr_timer_log* out = list->head;
   if (out != NULL) {
     list->head = out->next;
     if (list->head != NULL) {
@@ -111,7 +111,7 @@
   return out;
 }
 
-static void timer_log_remove(gpr_timer_log_list *list, gpr_timer_log *log) {
+static void timer_log_remove(gpr_timer_log_list* list, gpr_timer_log* log) {
   if (log->prev == NULL) {
     list->head = log->next;
     if (list->head != NULL) {
@@ -130,13 +130,13 @@
   }
 }
 
-static void write_log(gpr_timer_log *log) {
+static void write_log(gpr_timer_log* log) {
   size_t i;
   if (output_file == NULL) {
     output_file = fopen(output_filename(), "w");
   }
   for (i = 0; i < log->num_entries; i++) {
-    gpr_timer_entry *entry = &(log->log[i]);
+    gpr_timer_entry* entry = &(log->log[i]);
     if (gpr_time_cmp(entry->tm, gpr_time_0(entry->tm.clock_type)) < 0) {
       entry->tm = gpr_time_0(entry->tm.clock_type);
     }
@@ -149,8 +149,8 @@
   }
 }
 
-static void writing_thread(void *unused) {
-  gpr_timer_log *log;
+static void writing_thread(void* unused) {
+  gpr_timer_log* log;
   pthread_mutex_lock(&g_mu);
   for (;;) {
     while ((log = timer_log_pop_front(&g_done_logs)) == NULL && !g_shutdown) {
@@ -169,8 +169,8 @@
   }
 }
 
-static void flush_logs(gpr_timer_log_list *list) {
-  gpr_timer_log *log;
+static void flush_logs(gpr_timer_log_list* list) {
+  gpr_timer_log* log;
   while ((log = timer_log_pop_front(list)) != NULL) {
     write_log(log);
     free(log);
@@ -196,7 +196,7 @@
   }
 }
 
-void gpr_timers_set_log_filename(const char *filename) {
+void gpr_timers_set_log_filename(const char* filename) {
   output_filename_or_null = filename;
 }
 
@@ -209,7 +209,7 @@
 
 static void rotate_log() {
   /* Using malloc here, as this code could end up being called by gpr_malloc */
-  gpr_timer_log *log = static_cast<gpr_timer_log *>(malloc(sizeof(*log)));
+  gpr_timer_log* log = static_cast<gpr_timer_log*>(malloc(sizeof(*log)));
   gpr_once_init(&g_once_init, init_output);
   log->num_entries = 0;
   pthread_mutex_lock(&g_mu);
@@ -226,9 +226,9 @@
   g_thread_log = log;
 }
 
-static void gpr_timers_log_add(const char *tagstr, marker_type type,
-                               int important, const char *file, int line) {
-  gpr_timer_entry *entry;
+static void gpr_timers_log_add(const char* tagstr, marker_type type,
+                               int important, const char* file, int line) {
+  gpr_timer_entry* entry;
 
   if (!g_writing_enabled) {
     return;
@@ -250,17 +250,17 @@
 }
 
 /* Latency profiler API implementation. */
-void gpr_timer_add_mark(const char *tagstr, int important, const char *file,
+void gpr_timer_add_mark(const char* tagstr, int important, const char* file,
                         int line) {
   gpr_timers_log_add(tagstr, MARK, important, file, line);
 }
 
-void gpr_timer_begin(const char *tagstr, int important, const char *file,
+void gpr_timer_begin(const char* tagstr, int important, const char* file,
                      int line) {
   gpr_timers_log_add(tagstr, BEGIN, important, file, line);
 }
 
-void gpr_timer_end(const char *tagstr, int important, const char *file,
+void gpr_timer_end(const char* tagstr, int important, const char* file,
                    int line) {
   gpr_timers_log_add(tagstr, END, important, file, line);
 }
@@ -277,7 +277,7 @@
 
 void gpr_timers_global_destroy(void) {}
 
-void gpr_timers_set_log_filename(const char *filename) {}
+void gpr_timers_set_log_filename(const char* filename) {}
 
 void gpr_timer_set_enabled(int enabled) {}
 #endif /* GRPC_BASIC_PROFILER */
diff --git a/src/core/lib/profiling/stap_timers.cc b/src/core/lib/profiling/stap_timers.cc
index c86d74f..5ee1c43 100644
--- a/src/core/lib/profiling/stap_timers.cc
+++ b/src/core/lib/profiling/stap_timers.cc
@@ -27,22 +27,22 @@
 #include "src/core/lib/profiling/stap_probes.h"
 
 /* Latency profiler API implementation. */
-void gpr_timer_add_mark(int tag, const char *tagstr, void *id, const char *file,
+void gpr_timer_add_mark(int tag, const char* tagstr, void* id, const char* file,
                         int line) {
   _STAP_ADD_MARK(tag);
 }
 
-void gpr_timer_add_important_mark(int tag, const char *tagstr, void *id,
-                                  const char *file, int line) {
+void gpr_timer_add_important_mark(int tag, const char* tagstr, void* id,
+                                  const char* file, int line) {
   _STAP_ADD_IMPORTANT_MARK(tag);
 }
 
-void gpr_timer_begin(int tag, const char *tagstr, void *id, const char *file,
+void gpr_timer_begin(int tag, const char* tagstr, void* id, const char* file,
                      int line) {
   _STAP_TIMING_NS_BEGIN(tag);
 }
 
-void gpr_timer_end(int tag, const char *tagstr, void *id, const char *file,
+void gpr_timer_end(int tag, const char* tagstr, void* id, const char* file,
                    int line) {
   _STAP_TIMING_NS_END(tag);
 }
diff --git a/src/core/lib/profiling/timers.h b/src/core/lib/profiling/timers.h
index 7f02b4b..8b6c254 100644
--- a/src/core/lib/profiling/timers.h
+++ b/src/core/lib/profiling/timers.h
@@ -26,14 +26,14 @@
 void gpr_timers_global_init(void);
 void gpr_timers_global_destroy(void);
 
-void gpr_timer_add_mark(const char *tagstr, int important, const char *file,
+void gpr_timer_add_mark(const char* tagstr, int important, const char* file,
                         int line);
-void gpr_timer_begin(const char *tagstr, int important, const char *file,
+void gpr_timer_begin(const char* tagstr, int important, const char* file,
                      int line);
-void gpr_timer_end(const char *tagstr, int important, const char *file,
+void gpr_timer_end(const char* tagstr, int important, const char* file,
                    int line);
 
-void gpr_timers_set_log_filename(const char *filename);
+void gpr_timers_set_log_filename(const char* filename);
 
 void gpr_timer_set_enabled(int enabled);
 
@@ -92,14 +92,14 @@
 namespace grpc {
 class ProfileScope {
  public:
-  ProfileScope(const char *desc, bool important, const char *file, int line)
+  ProfileScope(const char* desc, bool important, const char* file, int line)
       : desc_(desc) {
     gpr_timer_begin(desc_, important ? 1 : 0, file, line);
   }
   ~ProfileScope() { gpr_timer_end(desc_, 0, "n/a", 0); }
 
  private:
-  const char *const desc_;
+  const char* const desc_;
 };
 }  // namespace grpc
 
diff --git a/src/core/lib/security/context/security_context.cc b/src/core/lib/security/context/security_context.cc
index b086895..f12b312 100644
--- a/src/core/lib/security/context/security_context.cc
+++ b/src/core/lib/security/context/security_context.cc
@@ -36,17 +36,17 @@
 
 /* --- grpc_call --- */
 
-grpc_call_error grpc_call_set_credentials(grpc_call *call,
-                                          grpc_call_credentials *creds) {
+grpc_call_error grpc_call_set_credentials(grpc_call* call,
+                                          grpc_call_credentials* creds) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_client_security_context *ctx = NULL;
+  grpc_client_security_context* ctx = NULL;
   GRPC_API_TRACE("grpc_call_set_credentials(call=%p, creds=%p)", 2,
                  (call, creds));
   if (!grpc_call_is_client(call)) {
     gpr_log(GPR_ERROR, "Method is client-side only.");
     return GRPC_CALL_ERROR_NOT_ON_SERVER;
   }
-  ctx = (grpc_client_security_context *)grpc_call_context_get(
+  ctx = (grpc_client_security_context*)grpc_call_context_get(
       call, GRPC_CONTEXT_SECURITY);
   if (ctx == NULL) {
     ctx = grpc_client_security_context_create();
@@ -61,34 +61,34 @@
   return GRPC_CALL_OK;
 }
 
-grpc_auth_context *grpc_call_auth_context(grpc_call *call) {
-  void *sec_ctx = grpc_call_context_get(call, GRPC_CONTEXT_SECURITY);
+grpc_auth_context* grpc_call_auth_context(grpc_call* call) {
+  void* sec_ctx = grpc_call_context_get(call, GRPC_CONTEXT_SECURITY);
   GRPC_API_TRACE("grpc_call_auth_context(call=%p)", 1, (call));
   if (sec_ctx == NULL) return NULL;
   return grpc_call_is_client(call)
              ? GRPC_AUTH_CONTEXT_REF(
-                   ((grpc_client_security_context *)sec_ctx)->auth_context,
+                   ((grpc_client_security_context*)sec_ctx)->auth_context,
                    "grpc_call_auth_context client")
              : GRPC_AUTH_CONTEXT_REF(
-                   ((grpc_server_security_context *)sec_ctx)->auth_context,
+                   ((grpc_server_security_context*)sec_ctx)->auth_context,
                    "grpc_call_auth_context server");
 }
 
-void grpc_auth_context_release(grpc_auth_context *context) {
+void grpc_auth_context_release(grpc_auth_context* context) {
   GRPC_API_TRACE("grpc_auth_context_release(context=%p)", 1, (context));
   GRPC_AUTH_CONTEXT_UNREF(context, "grpc_auth_context_unref");
 }
 
 /* --- grpc_client_security_context --- */
 
-grpc_client_security_context *grpc_client_security_context_create(void) {
-  return (grpc_client_security_context *)gpr_zalloc(
+grpc_client_security_context* grpc_client_security_context_create(void) {
+  return (grpc_client_security_context*)gpr_zalloc(
       sizeof(grpc_client_security_context));
 }
 
-void grpc_client_security_context_destroy(void *ctx) {
+void grpc_client_security_context_destroy(void* ctx) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_client_security_context *c = (grpc_client_security_context *)ctx;
+  grpc_client_security_context* c = (grpc_client_security_context*)ctx;
   grpc_call_credentials_unref(&exec_ctx, c->creds);
   GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "client_security_context");
   if (c->extension.instance != NULL && c->extension.destroy != NULL) {
@@ -100,13 +100,13 @@
 
 /* --- grpc_server_security_context --- */
 
-grpc_server_security_context *grpc_server_security_context_create(void) {
-  return (grpc_server_security_context *)gpr_zalloc(
+grpc_server_security_context* grpc_server_security_context_create(void) {
+  return (grpc_server_security_context*)gpr_zalloc(
       sizeof(grpc_server_security_context));
 }
 
-void grpc_server_security_context_destroy(void *ctx) {
-  grpc_server_security_context *c = (grpc_server_security_context *)ctx;
+void grpc_server_security_context_destroy(void* ctx) {
+  grpc_server_security_context* c = (grpc_server_security_context*)ctx;
   GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "server_security_context");
   if (c->extension.instance != NULL && c->extension.destroy != NULL) {
     c->extension.destroy(c->extension.instance);
@@ -118,9 +118,9 @@
 
 static grpc_auth_property_iterator empty_iterator = {NULL, 0, NULL};
 
-grpc_auth_context *grpc_auth_context_create(grpc_auth_context *chained) {
-  grpc_auth_context *ctx =
-      (grpc_auth_context *)gpr_zalloc(sizeof(grpc_auth_context));
+grpc_auth_context* grpc_auth_context_create(grpc_auth_context* chained) {
+  grpc_auth_context* ctx =
+      (grpc_auth_context*)gpr_zalloc(sizeof(grpc_auth_context));
   gpr_ref_init(&ctx->refcount, 1);
   if (chained != NULL) {
     ctx->chained = GRPC_AUTH_CONTEXT_REF(chained, "chained");
@@ -131,9 +131,9 @@
 }
 
 #ifndef NDEBUG
-grpc_auth_context *grpc_auth_context_ref(grpc_auth_context *ctx,
-                                         const char *file, int line,
-                                         const char *reason) {
+grpc_auth_context* grpc_auth_context_ref(grpc_auth_context* ctx,
+                                         const char* file, int line,
+                                         const char* reason) {
   if (ctx == NULL) return NULL;
   if (grpc_trace_auth_context_refcount.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&ctx->refcount.count);
@@ -142,7 +142,7 @@
             val + 1, reason);
   }
 #else
-grpc_auth_context *grpc_auth_context_ref(grpc_auth_context *ctx) {
+grpc_auth_context* grpc_auth_context_ref(grpc_auth_context* ctx) {
   if (ctx == NULL) return NULL;
 #endif
   gpr_ref(&ctx->refcount);
@@ -150,8 +150,8 @@
 }
 
 #ifndef NDEBUG
-void grpc_auth_context_unref(grpc_auth_context *ctx, const char *file, int line,
-                             const char *reason) {
+void grpc_auth_context_unref(grpc_auth_context* ctx, const char* file, int line,
+                             const char* reason) {
   if (ctx == NULL) return;
   if (grpc_trace_auth_context_refcount.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&ctx->refcount.count);
@@ -160,7 +160,7 @@
             val - 1, reason);
   }
 #else
-void grpc_auth_context_unref(grpc_auth_context *ctx) {
+void grpc_auth_context_unref(grpc_auth_context* ctx) {
   if (ctx == NULL) return;
 #endif
   if (gpr_unref(&ctx->refcount)) {
@@ -176,18 +176,18 @@
   }
 }
 
-const char *grpc_auth_context_peer_identity_property_name(
-    const grpc_auth_context *ctx) {
+const char* grpc_auth_context_peer_identity_property_name(
+    const grpc_auth_context* ctx) {
   GRPC_API_TRACE("grpc_auth_context_peer_identity_property_name(ctx=%p)", 1,
                  (ctx));
   return ctx->peer_identity_property_name;
 }
 
-int grpc_auth_context_set_peer_identity_property_name(grpc_auth_context *ctx,
-                                                      const char *name) {
+int grpc_auth_context_set_peer_identity_property_name(grpc_auth_context* ctx,
+                                                      const char* name) {
   grpc_auth_property_iterator it =
       grpc_auth_context_find_properties_by_name(ctx, name);
-  const grpc_auth_property *prop = grpc_auth_property_iterator_next(&it);
+  const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
   GRPC_API_TRACE(
       "grpc_auth_context_set_peer_identity_property_name(ctx=%p, name=%s)", 2,
       (ctx, name));
@@ -200,13 +200,13 @@
   return 1;
 }
 
-int grpc_auth_context_peer_is_authenticated(const grpc_auth_context *ctx) {
+int grpc_auth_context_peer_is_authenticated(const grpc_auth_context* ctx) {
   GRPC_API_TRACE("grpc_auth_context_peer_is_authenticated(ctx=%p)", 1, (ctx));
   return ctx->peer_identity_property_name == NULL ? 0 : 1;
 }
 
 grpc_auth_property_iterator grpc_auth_context_property_iterator(
-    const grpc_auth_context *ctx) {
+    const grpc_auth_context* ctx) {
   grpc_auth_property_iterator it = empty_iterator;
   GRPC_API_TRACE("grpc_auth_context_property_iterator(ctx=%p)", 1, (ctx));
   if (ctx == NULL) return it;
@@ -214,8 +214,8 @@
   return it;
 }
 
-const grpc_auth_property *grpc_auth_property_iterator_next(
-    grpc_auth_property_iterator *it) {
+const grpc_auth_property* grpc_auth_property_iterator_next(
+    grpc_auth_property_iterator* it) {
   GRPC_API_TRACE("grpc_auth_property_iterator_next(it=%p)", 1, (it));
   if (it == NULL || it->ctx == NULL) return NULL;
   while (it->index == it->ctx->properties.count) {
@@ -227,7 +227,7 @@
     return &it->ctx->properties.array[it->index++];
   } else {
     while (it->index < it->ctx->properties.count) {
-      const grpc_auth_property *prop = &it->ctx->properties.array[it->index++];
+      const grpc_auth_property* prop = &it->ctx->properties.array[it->index++];
       GPR_ASSERT(prop->name != NULL);
       if (strcmp(it->name, prop->name) == 0) {
         return prop;
@@ -239,7 +239,7 @@
 }
 
 grpc_auth_property_iterator grpc_auth_context_find_properties_by_name(
-    const grpc_auth_context *ctx, const char *name) {
+    const grpc_auth_context* ctx, const char* name) {
   grpc_auth_property_iterator it = empty_iterator;
   GRPC_API_TRACE("grpc_auth_context_find_properties_by_name(ctx=%p, name=%s)",
                  2, (ctx, name));
@@ -250,44 +250,45 @@
 }
 
 grpc_auth_property_iterator grpc_auth_context_peer_identity(
-    const grpc_auth_context *ctx) {
+    const grpc_auth_context* ctx) {
   GRPC_API_TRACE("grpc_auth_context_peer_identity(ctx=%p)", 1, (ctx));
   if (ctx == NULL) return empty_iterator;
   return grpc_auth_context_find_properties_by_name(
       ctx, ctx->peer_identity_property_name);
 }
 
-static void ensure_auth_context_capacity(grpc_auth_context *ctx) {
+static void ensure_auth_context_capacity(grpc_auth_context* ctx) {
   if (ctx->properties.count == ctx->properties.capacity) {
     ctx->properties.capacity =
         GPR_MAX(ctx->properties.capacity + 8, ctx->properties.capacity * 2);
-    ctx->properties.array = (grpc_auth_property *)gpr_realloc(
+    ctx->properties.array = (grpc_auth_property*)gpr_realloc(
         ctx->properties.array,
         ctx->properties.capacity * sizeof(grpc_auth_property));
   }
 }
 
-void grpc_auth_context_add_property(grpc_auth_context *ctx, const char *name,
-                                    const char *value, size_t value_length) {
-  grpc_auth_property *prop;
+void grpc_auth_context_add_property(grpc_auth_context* ctx, const char* name,
+                                    const char* value, size_t value_length) {
+  grpc_auth_property* prop;
   GRPC_API_TRACE(
       "grpc_auth_context_add_property(ctx=%p, name=%s, value=%*.*s, "
       "value_length=%lu)",
-      6, (ctx, name, (int)value_length, (int)value_length, value,
-          (unsigned long)value_length));
+      6,
+      (ctx, name, (int)value_length, (int)value_length, value,
+       (unsigned long)value_length));
   ensure_auth_context_capacity(ctx);
   prop = &ctx->properties.array[ctx->properties.count++];
   prop->name = gpr_strdup(name);
-  prop->value = (char *)gpr_malloc(value_length + 1);
+  prop->value = (char*)gpr_malloc(value_length + 1);
   memcpy(prop->value, value, value_length);
   prop->value[value_length] = '\0';
   prop->value_length = value_length;
 }
 
-void grpc_auth_context_add_cstring_property(grpc_auth_context *ctx,
-                                            const char *name,
-                                            const char *value) {
-  grpc_auth_property *prop;
+void grpc_auth_context_add_cstring_property(grpc_auth_context* ctx,
+                                            const char* name,
+                                            const char* value) {
+  grpc_auth_property* prop;
   GRPC_API_TRACE(
       "grpc_auth_context_add_cstring_property(ctx=%p, name=%s, value=%s)", 3,
       (ctx, name, value));
@@ -298,48 +299,48 @@
   prop->value_length = strlen(value);
 }
 
-void grpc_auth_property_reset(grpc_auth_property *property) {
+void grpc_auth_property_reset(grpc_auth_property* property) {
   gpr_free(property->name);
   gpr_free(property->value);
   memset(property, 0, sizeof(grpc_auth_property));
 }
 
-static void auth_context_pointer_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
-  GRPC_AUTH_CONTEXT_UNREF((grpc_auth_context *)p, "auth_context_pointer_arg");
+static void auth_context_pointer_arg_destroy(grpc_exec_ctx* exec_ctx, void* p) {
+  GRPC_AUTH_CONTEXT_UNREF((grpc_auth_context*)p, "auth_context_pointer_arg");
 }
 
-static void *auth_context_pointer_arg_copy(void *p) {
-  return GRPC_AUTH_CONTEXT_REF((grpc_auth_context *)p,
+static void* auth_context_pointer_arg_copy(void* p) {
+  return GRPC_AUTH_CONTEXT_REF((grpc_auth_context*)p,
                                "auth_context_pointer_arg");
 }
 
-static int auth_context_pointer_cmp(void *a, void *b) { return GPR_ICMP(a, b); }
+static int auth_context_pointer_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
 
 static const grpc_arg_pointer_vtable auth_context_pointer_vtable = {
     auth_context_pointer_arg_copy, auth_context_pointer_arg_destroy,
     auth_context_pointer_cmp};
 
-grpc_arg grpc_auth_context_to_arg(grpc_auth_context *p) {
-  return grpc_channel_arg_pointer_create((char *)GRPC_AUTH_CONTEXT_ARG, p,
+grpc_arg grpc_auth_context_to_arg(grpc_auth_context* p) {
+  return grpc_channel_arg_pointer_create((char*)GRPC_AUTH_CONTEXT_ARG, p,
                                          &auth_context_pointer_vtable);
 }
 
-grpc_auth_context *grpc_auth_context_from_arg(const grpc_arg *arg) {
+grpc_auth_context* grpc_auth_context_from_arg(const grpc_arg* arg) {
   if (strcmp(arg->key, GRPC_AUTH_CONTEXT_ARG) != 0) return NULL;
   if (arg->type != GRPC_ARG_POINTER) {
     gpr_log(GPR_ERROR, "Invalid type %d for arg %s", arg->type,
             GRPC_AUTH_CONTEXT_ARG);
     return NULL;
   }
-  return (grpc_auth_context *)arg->value.pointer.p;
+  return (grpc_auth_context*)arg->value.pointer.p;
 }
 
-grpc_auth_context *grpc_find_auth_context_in_args(
-    const grpc_channel_args *args) {
+grpc_auth_context* grpc_find_auth_context_in_args(
+    const grpc_channel_args* args) {
   size_t i;
   if (args == NULL) return NULL;
   for (i = 0; i < args->num_args; i++) {
-    grpc_auth_context *p = grpc_auth_context_from_arg(&args->args[i]);
+    grpc_auth_context* p = grpc_auth_context_from_arg(&args->args[i]);
     if (p != NULL) return p;
   }
   return NULL;
diff --git a/src/core/lib/security/context/security_context.h b/src/core/lib/security/context/security_context.h
index cc03bd6..57344df 100644
--- a/src/core/lib/security/context/security_context.h
+++ b/src/core/lib/security/context/security_context.h
@@ -37,21 +37,21 @@
 /* Property names are always NULL terminated. */
 
 typedef struct {
-  grpc_auth_property *array;
+  grpc_auth_property* array;
   size_t count;
   size_t capacity;
 } grpc_auth_property_array;
 
 struct grpc_auth_context {
-  struct grpc_auth_context *chained;
+  struct grpc_auth_context* chained;
   grpc_auth_property_array properties;
   gpr_refcount refcount;
-  const char *peer_identity_property_name;
-  grpc_pollset *pollset;
+  const char* peer_identity_property_name;
+  grpc_pollset* pollset;
 };
 
 /* Creation. */
-grpc_auth_context *grpc_auth_context_create(grpc_auth_context *chained);
+grpc_auth_context* grpc_auth_context_create(grpc_auth_context* chained);
 
 /* Refcounting. */
 #ifndef NDEBUG
@@ -59,19 +59,19 @@
   grpc_auth_context_ref((p), __FILE__, __LINE__, (r))
 #define GRPC_AUTH_CONTEXT_UNREF(p, r) \
   grpc_auth_context_unref((p), __FILE__, __LINE__, (r))
-grpc_auth_context *grpc_auth_context_ref(grpc_auth_context *policy,
-                                         const char *file, int line,
-                                         const char *reason);
-void grpc_auth_context_unref(grpc_auth_context *policy, const char *file,
-                             int line, const char *reason);
+grpc_auth_context* grpc_auth_context_ref(grpc_auth_context* policy,
+                                         const char* file, int line,
+                                         const char* reason);
+void grpc_auth_context_unref(grpc_auth_context* policy, const char* file,
+                             int line, const char* reason);
 #else
 #define GRPC_AUTH_CONTEXT_REF(p, r) grpc_auth_context_ref((p))
 #define GRPC_AUTH_CONTEXT_UNREF(p, r) grpc_auth_context_unref((p))
-grpc_auth_context *grpc_auth_context_ref(grpc_auth_context *policy);
-void grpc_auth_context_unref(grpc_auth_context *policy);
+grpc_auth_context* grpc_auth_context_ref(grpc_auth_context* policy);
+void grpc_auth_context_unref(grpc_auth_context* policy);
 #endif
 
-void grpc_auth_property_reset(grpc_auth_property *property);
+void grpc_auth_property_reset(grpc_auth_property* property);
 
 /* --- grpc_security_context_extension ---
 
@@ -79,8 +79,8 @@
    later by a higher level method on a grpc_call object. */
 
 typedef struct {
-  void *instance;
-  void (*destroy)(void *);
+  void* instance;
+  void (*destroy)(void*);
 } grpc_security_context_extension;
 
 /* --- grpc_client_security_context ---
@@ -88,33 +88,33 @@
    Internal client-side security context. */
 
 typedef struct {
-  grpc_call_credentials *creds;
-  grpc_auth_context *auth_context;
+  grpc_call_credentials* creds;
+  grpc_auth_context* auth_context;
   grpc_security_context_extension extension;
 } grpc_client_security_context;
 
-grpc_client_security_context *grpc_client_security_context_create(void);
-void grpc_client_security_context_destroy(void *ctx);
+grpc_client_security_context* grpc_client_security_context_create(void);
+void grpc_client_security_context_destroy(void* ctx);
 
 /* --- grpc_server_security_context ---
 
    Internal server-side security context. */
 
 typedef struct {
-  grpc_auth_context *auth_context;
+  grpc_auth_context* auth_context;
   grpc_security_context_extension extension;
 } grpc_server_security_context;
 
-grpc_server_security_context *grpc_server_security_context_create(void);
-void grpc_server_security_context_destroy(void *ctx);
+grpc_server_security_context* grpc_server_security_context_create(void);
+void grpc_server_security_context_destroy(void* ctx);
 
 /* --- Channel args for auth context --- */
 #define GRPC_AUTH_CONTEXT_ARG "grpc.auth_context"
 
-grpc_arg grpc_auth_context_to_arg(grpc_auth_context *c);
-grpc_auth_context *grpc_auth_context_from_arg(const grpc_arg *arg);
-grpc_auth_context *grpc_find_auth_context_in_args(
-    const grpc_channel_args *args);
+grpc_arg grpc_auth_context_to_arg(grpc_auth_context* c);
+grpc_auth_context* grpc_auth_context_from_arg(const grpc_arg* arg);
+grpc_auth_context* grpc_find_auth_context_in_args(
+    const grpc_channel_args* args);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/security/credentials/composite/composite_credentials.cc b/src/core/lib/security/credentials/composite/composite_credentials.cc
index 779300a..5eb7f9d 100644
--- a/src/core/lib/security/credentials/composite/composite_credentials.cc
+++ b/src/core/lib/security/credentials/composite/composite_credentials.cc
@@ -30,32 +30,32 @@
 /* -- Composite call credentials. -- */
 
 typedef struct {
-  grpc_composite_call_credentials *composite_creds;
+  grpc_composite_call_credentials* composite_creds;
   size_t creds_index;
-  grpc_polling_entity *pollent;
+  grpc_polling_entity* pollent;
   grpc_auth_metadata_context auth_md_context;
-  grpc_credentials_mdelem_array *md_array;
-  grpc_closure *on_request_metadata;
+  grpc_credentials_mdelem_array* md_array;
+  grpc_closure* on_request_metadata;
   grpc_closure internal_on_request_metadata;
 } grpc_composite_call_credentials_metadata_context;
 
-static void composite_call_destruct(grpc_exec_ctx *exec_ctx,
-                                    grpc_call_credentials *creds) {
-  grpc_composite_call_credentials *c = (grpc_composite_call_credentials *)creds;
+static void composite_call_destruct(grpc_exec_ctx* exec_ctx,
+                                    grpc_call_credentials* creds) {
+  grpc_composite_call_credentials* c = (grpc_composite_call_credentials*)creds;
   for (size_t i = 0; i < c->inner.num_creds; i++) {
     grpc_call_credentials_unref(exec_ctx, c->inner.creds_array[i]);
   }
   gpr_free(c->inner.creds_array);
 }
 
-static void composite_call_metadata_cb(grpc_exec_ctx *exec_ctx, void *arg,
-                                       grpc_error *error) {
-  grpc_composite_call_credentials_metadata_context *ctx =
-      (grpc_composite_call_credentials_metadata_context *)arg;
+static void composite_call_metadata_cb(grpc_exec_ctx* exec_ctx, void* arg,
+                                       grpc_error* error) {
+  grpc_composite_call_credentials_metadata_context* ctx =
+      (grpc_composite_call_credentials_metadata_context*)arg;
   if (error == GRPC_ERROR_NONE) {
     /* See if we need to get some more metadata. */
     if (ctx->creds_index < ctx->composite_creds->inner.num_creds) {
-      grpc_call_credentials *inner_creds =
+      grpc_call_credentials* inner_creds =
           ctx->composite_creds->inner.creds_array[ctx->creds_index++];
       if (grpc_call_credentials_get_request_metadata(
               exec_ctx, inner_creds, ctx->pollent, ctx->auth_md_context,
@@ -73,13 +73,13 @@
 }
 
 static bool composite_call_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_polling_entity *pollent, grpc_auth_metadata_context auth_md_context,
-    grpc_credentials_mdelem_array *md_array, grpc_closure *on_request_metadata,
-    grpc_error **error) {
-  grpc_composite_call_credentials *c = (grpc_composite_call_credentials *)creds;
-  grpc_composite_call_credentials_metadata_context *ctx;
-  ctx = (grpc_composite_call_credentials_metadata_context *)gpr_zalloc(
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_polling_entity* pollent, grpc_auth_metadata_context auth_md_context,
+    grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
+    grpc_error** error) {
+  grpc_composite_call_credentials* c = (grpc_composite_call_credentials*)creds;
+  grpc_composite_call_credentials_metadata_context* ctx;
+  ctx = (grpc_composite_call_credentials_metadata_context*)gpr_zalloc(
       sizeof(grpc_composite_call_credentials_metadata_context));
   ctx->composite_creds = c;
   ctx->pollent = pollent;
@@ -90,7 +90,7 @@
                     composite_call_metadata_cb, ctx, grpc_schedule_on_exec_ctx);
   bool synchronous = true;
   while (ctx->creds_index < ctx->composite_creds->inner.num_creds) {
-    grpc_call_credentials *inner_creds =
+    grpc_call_credentials* inner_creds =
         ctx->composite_creds->inner.creds_array[ctx->creds_index++];
     if (grpc_call_credentials_get_request_metadata(
             exec_ctx, inner_creds, ctx->pollent, ctx->auth_md_context,
@@ -106,9 +106,9 @@
 }
 
 static void composite_call_cancel_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_credentials_mdelem_array *md_array, grpc_error *error) {
-  grpc_composite_call_credentials *c = (grpc_composite_call_credentials *)creds;
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_credentials_mdelem_array* md_array, grpc_error* error) {
+  grpc_composite_call_credentials* c = (grpc_composite_call_credentials*)creds;
   for (size_t i = 0; i < c->inner.num_creds; ++i) {
     grpc_call_credentials_cancel_get_request_metadata(
         exec_ctx, c->inner.creds_array[i], md_array, GRPC_ERROR_REF(error));
@@ -121,9 +121,9 @@
     composite_call_cancel_get_request_metadata};
 
 static grpc_call_credentials_array get_creds_array(
-    grpc_call_credentials **creds_addr) {
+    grpc_call_credentials** creds_addr) {
   grpc_call_credentials_array result;
-  grpc_call_credentials *creds = *creds_addr;
+  grpc_call_credentials* creds = *creds_addr;
   result.creds_array = creds_addr;
   result.num_creds = 1;
   if (strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) == 0) {
@@ -132,14 +132,14 @@
   return result;
 }
 
-grpc_call_credentials *grpc_composite_call_credentials_create(
-    grpc_call_credentials *creds1, grpc_call_credentials *creds2,
-    void *reserved) {
+grpc_call_credentials* grpc_composite_call_credentials_create(
+    grpc_call_credentials* creds1, grpc_call_credentials* creds2,
+    void* reserved) {
   size_t i;
   size_t creds_array_byte_size;
   grpc_call_credentials_array creds1_array;
   grpc_call_credentials_array creds2_array;
-  grpc_composite_call_credentials *c;
+  grpc_composite_call_credentials* c;
   GRPC_API_TRACE(
       "grpc_composite_call_credentials_create(creds1=%p, creds2=%p, "
       "reserved=%p)",
@@ -147,7 +147,7 @@
   GPR_ASSERT(reserved == NULL);
   GPR_ASSERT(creds1 != NULL);
   GPR_ASSERT(creds2 != NULL);
-  c = (grpc_composite_call_credentials *)gpr_zalloc(
+  c = (grpc_composite_call_credentials*)gpr_zalloc(
       sizeof(grpc_composite_call_credentials));
   c->base.type = GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE;
   c->base.vtable = &composite_call_credentials_vtable;
@@ -155,38 +155,38 @@
   creds1_array = get_creds_array(&creds1);
   creds2_array = get_creds_array(&creds2);
   c->inner.num_creds = creds1_array.num_creds + creds2_array.num_creds;
-  creds_array_byte_size = c->inner.num_creds * sizeof(grpc_call_credentials *);
+  creds_array_byte_size = c->inner.num_creds * sizeof(grpc_call_credentials*);
   c->inner.creds_array =
-      (grpc_call_credentials **)gpr_zalloc(creds_array_byte_size);
+      (grpc_call_credentials**)gpr_zalloc(creds_array_byte_size);
   for (i = 0; i < creds1_array.num_creds; i++) {
-    grpc_call_credentials *cur_creds = creds1_array.creds_array[i];
+    grpc_call_credentials* cur_creds = creds1_array.creds_array[i];
     c->inner.creds_array[i] = grpc_call_credentials_ref(cur_creds);
   }
   for (i = 0; i < creds2_array.num_creds; i++) {
-    grpc_call_credentials *cur_creds = creds2_array.creds_array[i];
+    grpc_call_credentials* cur_creds = creds2_array.creds_array[i];
     c->inner.creds_array[i + creds1_array.num_creds] =
         grpc_call_credentials_ref(cur_creds);
   }
   return &c->base;
 }
 
-const grpc_call_credentials_array *
-grpc_composite_call_credentials_get_credentials(grpc_call_credentials *creds) {
-  const grpc_composite_call_credentials *c =
-      (const grpc_composite_call_credentials *)creds;
+const grpc_call_credentials_array*
+grpc_composite_call_credentials_get_credentials(grpc_call_credentials* creds) {
+  const grpc_composite_call_credentials* c =
+      (const grpc_composite_call_credentials*)creds;
   GPR_ASSERT(strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) == 0);
   return &c->inner;
 }
 
-grpc_call_credentials *grpc_credentials_contains_type(
-    grpc_call_credentials *creds, const char *type,
-    grpc_call_credentials **composite_creds) {
+grpc_call_credentials* grpc_credentials_contains_type(
+    grpc_call_credentials* creds, const char* type,
+    grpc_call_credentials** composite_creds) {
   size_t i;
   if (strcmp(creds->type, type) == 0) {
     if (composite_creds != NULL) *composite_creds = NULL;
     return creds;
   } else if (strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) == 0) {
-    const grpc_call_credentials_array *inner_creds_array =
+    const grpc_call_credentials_array* inner_creds_array =
         grpc_composite_call_credentials_get_credentials(creds);
     for (i = 0; i < inner_creds_array->num_creds; i++) {
       if (strcmp(type, inner_creds_array->creds_array[i]->type) == 0) {
@@ -200,21 +200,21 @@
 
 /* -- Composite channel credentials. -- */
 
-static void composite_channel_destruct(grpc_exec_ctx *exec_ctx,
-                                       grpc_channel_credentials *creds) {
-  grpc_composite_channel_credentials *c =
-      (grpc_composite_channel_credentials *)creds;
+static void composite_channel_destruct(grpc_exec_ctx* exec_ctx,
+                                       grpc_channel_credentials* creds) {
+  grpc_composite_channel_credentials* c =
+      (grpc_composite_channel_credentials*)creds;
   grpc_channel_credentials_unref(exec_ctx, c->inner_creds);
   grpc_call_credentials_unref(exec_ctx, c->call_creds);
 }
 
 static grpc_security_status composite_channel_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_channel_credentials *creds,
-    grpc_call_credentials *call_creds, const char *target,
-    const grpc_channel_args *args, grpc_channel_security_connector **sc,
-    grpc_channel_args **new_args) {
-  grpc_composite_channel_credentials *c =
-      (grpc_composite_channel_credentials *)creds;
+    grpc_exec_ctx* exec_ctx, grpc_channel_credentials* creds,
+    grpc_call_credentials* call_creds, const char* target,
+    const grpc_channel_args* args, grpc_channel_security_connector** sc,
+    grpc_channel_args** new_args) {
+  grpc_composite_channel_credentials* c =
+      (grpc_composite_channel_credentials*)creds;
   grpc_security_status status = GRPC_SECURITY_ERROR;
 
   GPR_ASSERT(c->inner_creds != NULL && c->call_creds != NULL &&
@@ -223,7 +223,7 @@
   /* If we are passed a call_creds, create a call composite to pass it
      downstream. */
   if (call_creds != NULL) {
-    grpc_call_credentials *composite_call_creds =
+    grpc_call_credentials* composite_call_creds =
         grpc_composite_call_credentials_create(c->call_creds, call_creds, NULL);
     status = c->inner_creds->vtable->create_security_connector(
         exec_ctx, c->inner_creds, composite_call_creds, target, args, sc,
@@ -236,11 +236,11 @@
   return status;
 }
 
-static grpc_channel_credentials *
+static grpc_channel_credentials*
 composite_channel_duplicate_without_call_credentials(
-    grpc_channel_credentials *creds) {
-  grpc_composite_channel_credentials *c =
-      (grpc_composite_channel_credentials *)creds;
+    grpc_channel_credentials* creds) {
+  grpc_composite_channel_credentials* c =
+      (grpc_composite_channel_credentials*)creds;
   return grpc_channel_credentials_ref(c->inner_creds);
 }
 
@@ -248,11 +248,11 @@
     composite_channel_destruct, composite_channel_create_security_connector,
     composite_channel_duplicate_without_call_credentials};
 
-grpc_channel_credentials *grpc_composite_channel_credentials_create(
-    grpc_channel_credentials *channel_creds, grpc_call_credentials *call_creds,
-    void *reserved) {
-  grpc_composite_channel_credentials *c =
-      (grpc_composite_channel_credentials *)gpr_zalloc(sizeof(*c));
+grpc_channel_credentials* grpc_composite_channel_credentials_create(
+    grpc_channel_credentials* channel_creds, grpc_call_credentials* call_creds,
+    void* reserved) {
+  grpc_composite_channel_credentials* c =
+      (grpc_composite_channel_credentials*)gpr_zalloc(sizeof(*c));
   GPR_ASSERT(channel_creds != NULL && call_creds != NULL && reserved == NULL);
   GRPC_API_TRACE(
       "grpc_composite_channel_credentials_create(channel_creds=%p, "
diff --git a/src/core/lib/security/credentials/composite/composite_credentials.h b/src/core/lib/security/credentials/composite/composite_credentials.h
index 6e9f9a8..efb5f4f 100644
--- a/src/core/lib/security/credentials/composite/composite_credentials.h
+++ b/src/core/lib/security/credentials/composite/composite_credentials.h
@@ -26,28 +26,28 @@
 #endif
 
 typedef struct {
-  grpc_call_credentials **creds_array;
+  grpc_call_credentials** creds_array;
   size_t num_creds;
 } grpc_call_credentials_array;
 
-const grpc_call_credentials_array *
+const grpc_call_credentials_array*
 grpc_composite_call_credentials_get_credentials(
-    grpc_call_credentials *composite_creds);
+    grpc_call_credentials* composite_creds);
 
 /* Returns creds if creds is of the specified type or the inner creds of the
    specified type (if found), if the creds is of type COMPOSITE.
    If composite_creds is not NULL, *composite_creds will point to creds if of
    type COMPOSITE in case of success. */
-grpc_call_credentials *grpc_credentials_contains_type(
-    grpc_call_credentials *creds, const char *type,
-    grpc_call_credentials **composite_creds);
+grpc_call_credentials* grpc_credentials_contains_type(
+    grpc_call_credentials* creds, const char* type,
+    grpc_call_credentials** composite_creds);
 
 /* -- Composite channel credentials. -- */
 
 typedef struct {
   grpc_channel_credentials base;
-  grpc_channel_credentials *inner_creds;
-  grpc_call_credentials *call_creds;
+  grpc_channel_credentials* inner_creds;
+  grpc_call_credentials* call_creds;
 } grpc_composite_channel_credentials;
 
 /* -- Composite call credentials. -- */
@@ -62,4 +62,4 @@
 #endif
 
 #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_COMPOSITE_COMPOSITE_CREDENTIALS_H \
-          */
+        */
diff --git a/src/core/lib/security/credentials/credentials.cc b/src/core/lib/security/credentials/credentials.cc
index ebbf350..e60d022 100644
--- a/src/core/lib/security/credentials/credentials.cc
+++ b/src/core/lib/security/credentials/credentials.cc
@@ -37,31 +37,31 @@
 
 /* -- Common. -- */
 
-grpc_credentials_metadata_request *grpc_credentials_metadata_request_create(
-    grpc_call_credentials *creds) {
-  grpc_credentials_metadata_request *r =
-      (grpc_credentials_metadata_request *)gpr_zalloc(
+grpc_credentials_metadata_request* grpc_credentials_metadata_request_create(
+    grpc_call_credentials* creds) {
+  grpc_credentials_metadata_request* r =
+      (grpc_credentials_metadata_request*)gpr_zalloc(
           sizeof(grpc_credentials_metadata_request));
   r->creds = grpc_call_credentials_ref(creds);
   return r;
 }
 
 void grpc_credentials_metadata_request_destroy(
-    grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *r) {
+    grpc_exec_ctx* exec_ctx, grpc_credentials_metadata_request* r) {
   grpc_call_credentials_unref(exec_ctx, r->creds);
   grpc_http_response_destroy(&r->response);
   gpr_free(r);
 }
 
-grpc_channel_credentials *grpc_channel_credentials_ref(
-    grpc_channel_credentials *creds) {
+grpc_channel_credentials* grpc_channel_credentials_ref(
+    grpc_channel_credentials* creds) {
   if (creds == NULL) return NULL;
   gpr_ref(&creds->refcount);
   return creds;
 }
 
-void grpc_channel_credentials_unref(grpc_exec_ctx *exec_ctx,
-                                    grpc_channel_credentials *creds) {
+void grpc_channel_credentials_unref(grpc_exec_ctx* exec_ctx,
+                                    grpc_channel_credentials* creds) {
   if (creds == NULL) return;
   if (gpr_unref(&creds->refcount)) {
     if (creds->vtable->destruct != NULL) {
@@ -71,21 +71,21 @@
   }
 }
 
-void grpc_channel_credentials_release(grpc_channel_credentials *creds) {
+void grpc_channel_credentials_release(grpc_channel_credentials* creds) {
   GRPC_API_TRACE("grpc_channel_credentials_release(creds=%p)", 1, (creds));
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_channel_credentials_unref(&exec_ctx, creds);
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-grpc_call_credentials *grpc_call_credentials_ref(grpc_call_credentials *creds) {
+grpc_call_credentials* grpc_call_credentials_ref(grpc_call_credentials* creds) {
   if (creds == NULL) return NULL;
   gpr_ref(&creds->refcount);
   return creds;
 }
 
-void grpc_call_credentials_unref(grpc_exec_ctx *exec_ctx,
-                                 grpc_call_credentials *creds) {
+void grpc_call_credentials_unref(grpc_exec_ctx* exec_ctx,
+                                 grpc_call_credentials* creds) {
   if (creds == NULL) return;
   if (gpr_unref(&creds->refcount)) {
     if (creds->vtable->destruct != NULL) {
@@ -95,7 +95,7 @@
   }
 }
 
-void grpc_call_credentials_release(grpc_call_credentials *creds) {
+void grpc_call_credentials_release(grpc_call_credentials* creds) {
   GRPC_API_TRACE("grpc_call_credentials_release(creds=%p)", 1, (creds));
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_call_credentials_unref(&exec_ctx, creds);
@@ -103,10 +103,10 @@
 }
 
 bool grpc_call_credentials_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_polling_entity *pollent, grpc_auth_metadata_context context,
-    grpc_credentials_mdelem_array *md_array, grpc_closure *on_request_metadata,
-    grpc_error **error) {
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_polling_entity* pollent, grpc_auth_metadata_context context,
+    grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
+    grpc_error** error) {
   if (creds == NULL || creds->vtable->get_request_metadata == NULL) {
     return true;
   }
@@ -115,8 +115,8 @@
 }
 
 void grpc_call_credentials_cancel_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_credentials_mdelem_array *md_array, grpc_error *error) {
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_credentials_mdelem_array* md_array, grpc_error* error) {
   if (creds == NULL || creds->vtable->cancel_get_request_metadata == NULL) {
     return;
   }
@@ -124,9 +124,9 @@
 }
 
 grpc_security_status grpc_channel_credentials_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_channel_credentials *channel_creds,
-    const char *target, const grpc_channel_args *args,
-    grpc_channel_security_connector **sc, grpc_channel_args **new_args) {
+    grpc_exec_ctx* exec_ctx, grpc_channel_credentials* channel_creds,
+    const char* target, const grpc_channel_args* args,
+    grpc_channel_security_connector** sc, grpc_channel_args** new_args) {
   *new_args = NULL;
   if (channel_creds == NULL) {
     return GRPC_SECURITY_ERROR;
@@ -136,9 +136,9 @@
       exec_ctx, channel_creds, NULL, target, args, sc, new_args);
 }
 
-grpc_channel_credentials *
+grpc_channel_credentials*
 grpc_channel_credentials_duplicate_without_call_credentials(
-    grpc_channel_credentials *channel_creds) {
+    grpc_channel_credentials* channel_creds) {
   if (channel_creds != NULL && channel_creds->vtable != NULL &&
       channel_creds->vtable->duplicate_without_call_credentials != NULL) {
     return channel_creds->vtable->duplicate_without_call_credentials(
@@ -148,59 +148,59 @@
   }
 }
 
-static void credentials_pointer_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
-  grpc_channel_credentials_unref(exec_ctx, (grpc_channel_credentials *)p);
+static void credentials_pointer_arg_destroy(grpc_exec_ctx* exec_ctx, void* p) {
+  grpc_channel_credentials_unref(exec_ctx, (grpc_channel_credentials*)p);
 }
 
-static void *credentials_pointer_arg_copy(void *p) {
-  return grpc_channel_credentials_ref((grpc_channel_credentials *)p);
+static void* credentials_pointer_arg_copy(void* p) {
+  return grpc_channel_credentials_ref((grpc_channel_credentials*)p);
 }
 
-static int credentials_pointer_cmp(void *a, void *b) { return GPR_ICMP(a, b); }
+static int credentials_pointer_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
 
 static const grpc_arg_pointer_vtable credentials_pointer_vtable = {
     credentials_pointer_arg_copy, credentials_pointer_arg_destroy,
     credentials_pointer_cmp};
 
 grpc_arg grpc_channel_credentials_to_arg(
-    grpc_channel_credentials *credentials) {
-  return grpc_channel_arg_pointer_create((char *)GRPC_ARG_CHANNEL_CREDENTIALS,
+    grpc_channel_credentials* credentials) {
+  return grpc_channel_arg_pointer_create((char*)GRPC_ARG_CHANNEL_CREDENTIALS,
                                          credentials,
                                          &credentials_pointer_vtable);
 }
 
-grpc_channel_credentials *grpc_channel_credentials_from_arg(
-    const grpc_arg *arg) {
+grpc_channel_credentials* grpc_channel_credentials_from_arg(
+    const grpc_arg* arg) {
   if (strcmp(arg->key, GRPC_ARG_CHANNEL_CREDENTIALS)) return NULL;
   if (arg->type != GRPC_ARG_POINTER) {
     gpr_log(GPR_ERROR, "Invalid type %d for arg %s", arg->type,
             GRPC_ARG_CHANNEL_CREDENTIALS);
     return NULL;
   }
-  return (grpc_channel_credentials *)arg->value.pointer.p;
+  return (grpc_channel_credentials*)arg->value.pointer.p;
 }
 
-grpc_channel_credentials *grpc_channel_credentials_find_in_args(
-    const grpc_channel_args *args) {
+grpc_channel_credentials* grpc_channel_credentials_find_in_args(
+    const grpc_channel_args* args) {
   size_t i;
   if (args == NULL) return NULL;
   for (i = 0; i < args->num_args; i++) {
-    grpc_channel_credentials *credentials =
+    grpc_channel_credentials* credentials =
         grpc_channel_credentials_from_arg(&args->args[i]);
     if (credentials != NULL) return credentials;
   }
   return NULL;
 }
 
-grpc_server_credentials *grpc_server_credentials_ref(
-    grpc_server_credentials *creds) {
+grpc_server_credentials* grpc_server_credentials_ref(
+    grpc_server_credentials* creds) {
   if (creds == NULL) return NULL;
   gpr_ref(&creds->refcount);
   return creds;
 }
 
-void grpc_server_credentials_unref(grpc_exec_ctx *exec_ctx,
-                                   grpc_server_credentials *creds) {
+void grpc_server_credentials_unref(grpc_exec_ctx* exec_ctx,
+                                   grpc_server_credentials* creds) {
   if (creds == NULL) return;
   if (gpr_unref(&creds->refcount)) {
     if (creds->vtable->destruct != NULL) {
@@ -213,7 +213,7 @@
   }
 }
 
-void grpc_server_credentials_release(grpc_server_credentials *creds) {
+void grpc_server_credentials_release(grpc_server_credentials* creds) {
   GRPC_API_TRACE("grpc_server_credentials_release(creds=%p)", 1, (creds));
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_server_credentials_unref(&exec_ctx, creds);
@@ -221,8 +221,8 @@
 }
 
 grpc_security_status grpc_server_credentials_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_server_credentials *creds,
-    grpc_server_security_connector **sc) {
+    grpc_exec_ctx* exec_ctx, grpc_server_credentials* creds,
+    grpc_server_security_connector** sc) {
   if (creds == NULL || creds->vtable->create_security_connector == NULL) {
     gpr_log(GPR_ERROR, "Server credentials cannot create security context.");
     return GRPC_SECURITY_ERROR;
@@ -231,12 +231,12 @@
 }
 
 void grpc_server_credentials_set_auth_metadata_processor(
-    grpc_server_credentials *creds, grpc_auth_metadata_processor processor) {
+    grpc_server_credentials* creds, grpc_auth_metadata_processor processor) {
   GRPC_API_TRACE(
       "grpc_server_credentials_set_auth_metadata_processor("
       "creds=%p, "
       "processor=grpc_auth_metadata_processor { process: %p, state: %p })",
-      3, (creds, (void *)(intptr_t)processor.process, processor.state));
+      3, (creds, (void*)(intptr_t)processor.process, processor.state));
   if (creds == NULL) return;
   if (creds->processor.destroy != NULL && creds->processor.state != NULL) {
     creds->processor.destroy(creds->processor.state);
@@ -244,16 +244,16 @@
   creds->processor = processor;
 }
 
-static void server_credentials_pointer_arg_destroy(grpc_exec_ctx *exec_ctx,
-                                                   void *p) {
-  grpc_server_credentials_unref(exec_ctx, (grpc_server_credentials *)p);
+static void server_credentials_pointer_arg_destroy(grpc_exec_ctx* exec_ctx,
+                                                   void* p) {
+  grpc_server_credentials_unref(exec_ctx, (grpc_server_credentials*)p);
 }
 
-static void *server_credentials_pointer_arg_copy(void *p) {
-  return grpc_server_credentials_ref((grpc_server_credentials *)p);
+static void* server_credentials_pointer_arg_copy(void* p) {
+  return grpc_server_credentials_ref((grpc_server_credentials*)p);
 }
 
-static int server_credentials_pointer_cmp(void *a, void *b) {
+static int server_credentials_pointer_cmp(void* a, void* b) {
   return GPR_ICMP(a, b);
 }
 
@@ -261,27 +261,27 @@
     server_credentials_pointer_arg_copy, server_credentials_pointer_arg_destroy,
     server_credentials_pointer_cmp};
 
-grpc_arg grpc_server_credentials_to_arg(grpc_server_credentials *p) {
-  return grpc_channel_arg_pointer_create((char *)GRPC_SERVER_CREDENTIALS_ARG, p,
+grpc_arg grpc_server_credentials_to_arg(grpc_server_credentials* p) {
+  return grpc_channel_arg_pointer_create((char*)GRPC_SERVER_CREDENTIALS_ARG, p,
                                          &cred_ptr_vtable);
 }
 
-grpc_server_credentials *grpc_server_credentials_from_arg(const grpc_arg *arg) {
+grpc_server_credentials* grpc_server_credentials_from_arg(const grpc_arg* arg) {
   if (strcmp(arg->key, GRPC_SERVER_CREDENTIALS_ARG) != 0) return NULL;
   if (arg->type != GRPC_ARG_POINTER) {
     gpr_log(GPR_ERROR, "Invalid type %d for arg %s", arg->type,
             GRPC_SERVER_CREDENTIALS_ARG);
     return NULL;
   }
-  return (grpc_server_credentials *)arg->value.pointer.p;
+  return (grpc_server_credentials*)arg->value.pointer.p;
 }
 
-grpc_server_credentials *grpc_find_server_credentials_in_args(
-    const grpc_channel_args *args) {
+grpc_server_credentials* grpc_find_server_credentials_in_args(
+    const grpc_channel_args* args) {
   size_t i;
   if (args == NULL) return NULL;
   for (i = 0; i < args->num_args; i++) {
-    grpc_server_credentials *p =
+    grpc_server_credentials* p =
         grpc_server_credentials_from_arg(&args->args[i]);
     if (p != NULL) return p;
   }
diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h
index 73e39ae..c65b966 100644
--- a/src/core/lib/security/credentials/credentials.h
+++ b/src/core/lib/security/credentials/credentials.h
@@ -77,13 +77,13 @@
 /* --- Google utils --- */
 
 /* It is the caller's responsibility to gpr_free the result if not NULL. */
-char *grpc_get_well_known_google_credentials_file_path(void);
+char* grpc_get_well_known_google_credentials_file_path(void);
 
 /* Implementation function for the different platforms. */
-char *grpc_get_well_known_google_credentials_file_path_impl(void);
+char* grpc_get_well_known_google_credentials_file_path_impl(void);
 
 /* Override for testing only. Not thread-safe */
-typedef char *(*grpc_well_known_credentials_path_getter)(void);
+typedef char* (*grpc_well_known_credentials_path_getter)(void);
 void grpc_override_well_known_credentials_path_getter(
     grpc_well_known_credentials_path_getter getter);
 
@@ -92,169 +92,169 @@
 #define GRPC_ARG_CHANNEL_CREDENTIALS "grpc.channel_credentials"
 
 typedef struct {
-  void (*destruct)(grpc_exec_ctx *exec_ctx, grpc_channel_credentials *c);
+  void (*destruct)(grpc_exec_ctx* exec_ctx, grpc_channel_credentials* c);
 
   grpc_security_status (*create_security_connector)(
-      grpc_exec_ctx *exec_ctx, grpc_channel_credentials *c,
-      grpc_call_credentials *call_creds, const char *target,
-      const grpc_channel_args *args, grpc_channel_security_connector **sc,
-      grpc_channel_args **new_args);
+      grpc_exec_ctx* exec_ctx, grpc_channel_credentials* c,
+      grpc_call_credentials* call_creds, const char* target,
+      const grpc_channel_args* args, grpc_channel_security_connector** sc,
+      grpc_channel_args** new_args);
 
-  grpc_channel_credentials *(*duplicate_without_call_credentials)(
-      grpc_channel_credentials *c);
+  grpc_channel_credentials* (*duplicate_without_call_credentials)(
+      grpc_channel_credentials* c);
 } grpc_channel_credentials_vtable;
 
 struct grpc_channel_credentials {
-  const grpc_channel_credentials_vtable *vtable;
-  const char *type;
+  const grpc_channel_credentials_vtable* vtable;
+  const char* type;
   gpr_refcount refcount;
 };
 
-grpc_channel_credentials *grpc_channel_credentials_ref(
-    grpc_channel_credentials *creds);
-void grpc_channel_credentials_unref(grpc_exec_ctx *exec_ctx,
-                                    grpc_channel_credentials *creds);
+grpc_channel_credentials* grpc_channel_credentials_ref(
+    grpc_channel_credentials* creds);
+void grpc_channel_credentials_unref(grpc_exec_ctx* exec_ctx,
+                                    grpc_channel_credentials* creds);
 
 /* Creates a security connector for the channel. May also create new channel
    args for the channel to be used in place of the passed in const args if
    returned non NULL. In that case the caller is responsible for destroying
    new_args after channel creation. */
 grpc_security_status grpc_channel_credentials_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_channel_credentials *creds,
-    const char *target, const grpc_channel_args *args,
-    grpc_channel_security_connector **sc, grpc_channel_args **new_args);
+    grpc_exec_ctx* exec_ctx, grpc_channel_credentials* creds,
+    const char* target, const grpc_channel_args* args,
+    grpc_channel_security_connector** sc, grpc_channel_args** new_args);
 
 /* Creates a version of the channel credentials without any attached call
    credentials. This can be used in order to open a channel to a non-trusted
    gRPC load balancer. */
-grpc_channel_credentials *
+grpc_channel_credentials*
 grpc_channel_credentials_duplicate_without_call_credentials(
-    grpc_channel_credentials *creds);
+    grpc_channel_credentials* creds);
 
 /* Util to encapsulate the channel credentials in a channel arg. */
-grpc_arg grpc_channel_credentials_to_arg(grpc_channel_credentials *credentials);
+grpc_arg grpc_channel_credentials_to_arg(grpc_channel_credentials* credentials);
 
 /* Util to get the channel credentials from a channel arg. */
-grpc_channel_credentials *grpc_channel_credentials_from_arg(
-    const grpc_arg *arg);
+grpc_channel_credentials* grpc_channel_credentials_from_arg(
+    const grpc_arg* arg);
 
 /* Util to find the channel credentials from channel args. */
-grpc_channel_credentials *grpc_channel_credentials_find_in_args(
-    const grpc_channel_args *args);
+grpc_channel_credentials* grpc_channel_credentials_find_in_args(
+    const grpc_channel_args* args);
 
 /* --- grpc_credentials_mdelem_array. --- */
 
 typedef struct {
-  grpc_mdelem *md;
+  grpc_mdelem* md;
   size_t size;
 } grpc_credentials_mdelem_array;
 
 /// Takes a new ref to \a md.
-void grpc_credentials_mdelem_array_add(grpc_credentials_mdelem_array *list,
+void grpc_credentials_mdelem_array_add(grpc_credentials_mdelem_array* list,
                                        grpc_mdelem md);
 
 /// Appends all elements from \a src to \a dst, taking a new ref to each one.
-void grpc_credentials_mdelem_array_append(grpc_credentials_mdelem_array *dst,
-                                          grpc_credentials_mdelem_array *src);
+void grpc_credentials_mdelem_array_append(grpc_credentials_mdelem_array* dst,
+                                          grpc_credentials_mdelem_array* src);
 
-void grpc_credentials_mdelem_array_destroy(grpc_exec_ctx *exec_ctx,
-                                           grpc_credentials_mdelem_array *list);
+void grpc_credentials_mdelem_array_destroy(grpc_exec_ctx* exec_ctx,
+                                           grpc_credentials_mdelem_array* list);
 
 /* --- grpc_call_credentials. --- */
 
 typedef struct {
-  void (*destruct)(grpc_exec_ctx *exec_ctx, grpc_call_credentials *c);
-  bool (*get_request_metadata)(grpc_exec_ctx *exec_ctx,
-                               grpc_call_credentials *c,
-                               grpc_polling_entity *pollent,
+  void (*destruct)(grpc_exec_ctx* exec_ctx, grpc_call_credentials* c);
+  bool (*get_request_metadata)(grpc_exec_ctx* exec_ctx,
+                               grpc_call_credentials* c,
+                               grpc_polling_entity* pollent,
                                grpc_auth_metadata_context context,
-                               grpc_credentials_mdelem_array *md_array,
-                               grpc_closure *on_request_metadata,
-                               grpc_error **error);
-  void (*cancel_get_request_metadata)(grpc_exec_ctx *exec_ctx,
-                                      grpc_call_credentials *c,
-                                      grpc_credentials_mdelem_array *md_array,
-                                      grpc_error *error);
+                               grpc_credentials_mdelem_array* md_array,
+                               grpc_closure* on_request_metadata,
+                               grpc_error** error);
+  void (*cancel_get_request_metadata)(grpc_exec_ctx* exec_ctx,
+                                      grpc_call_credentials* c,
+                                      grpc_credentials_mdelem_array* md_array,
+                                      grpc_error* error);
 } grpc_call_credentials_vtable;
 
 struct grpc_call_credentials {
-  const grpc_call_credentials_vtable *vtable;
-  const char *type;
+  const grpc_call_credentials_vtable* vtable;
+  const char* type;
   gpr_refcount refcount;
 };
 
-grpc_call_credentials *grpc_call_credentials_ref(grpc_call_credentials *creds);
-void grpc_call_credentials_unref(grpc_exec_ctx *exec_ctx,
-                                 grpc_call_credentials *creds);
+grpc_call_credentials* grpc_call_credentials_ref(grpc_call_credentials* creds);
+void grpc_call_credentials_unref(grpc_exec_ctx* exec_ctx,
+                                 grpc_call_credentials* creds);
 
 /// Returns true if completed synchronously, in which case \a error will
 /// be set to indicate the result.  Otherwise, \a on_request_metadata will
 /// be invoked asynchronously when complete.  \a md_array will be populated
 /// with the resulting metadata once complete.
 bool grpc_call_credentials_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_polling_entity *pollent, grpc_auth_metadata_context context,
-    grpc_credentials_mdelem_array *md_array, grpc_closure *on_request_metadata,
-    grpc_error **error);
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_polling_entity* pollent, grpc_auth_metadata_context context,
+    grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
+    grpc_error** error);
 
 /// Cancels a pending asynchronous operation started by
 /// grpc_call_credentials_get_request_metadata() with the corresponding
 /// value of \a md_array.
 void grpc_call_credentials_cancel_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *c,
-    grpc_credentials_mdelem_array *md_array, grpc_error *error);
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* c,
+    grpc_credentials_mdelem_array* md_array, grpc_error* error);
 
 /* Metadata-only credentials with the specified key and value where
    asynchronicity can be simulated for testing. */
-grpc_call_credentials *grpc_md_only_test_credentials_create(
-    grpc_exec_ctx *exec_ctx, const char *md_key, const char *md_value,
+grpc_call_credentials* grpc_md_only_test_credentials_create(
+    grpc_exec_ctx* exec_ctx, const char* md_key, const char* md_value,
     bool is_async);
 
 /* --- grpc_server_credentials. --- */
 
 typedef struct {
-  void (*destruct)(grpc_exec_ctx *exec_ctx, grpc_server_credentials *c);
+  void (*destruct)(grpc_exec_ctx* exec_ctx, grpc_server_credentials* c);
   grpc_security_status (*create_security_connector)(
-      grpc_exec_ctx *exec_ctx, grpc_server_credentials *c,
-      grpc_server_security_connector **sc);
+      grpc_exec_ctx* exec_ctx, grpc_server_credentials* c,
+      grpc_server_security_connector** sc);
 } grpc_server_credentials_vtable;
 
 struct grpc_server_credentials {
-  const grpc_server_credentials_vtable *vtable;
-  const char *type;
+  const grpc_server_credentials_vtable* vtable;
+  const char* type;
   gpr_refcount refcount;
   grpc_auth_metadata_processor processor;
 };
 
 grpc_security_status grpc_server_credentials_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_server_credentials *creds,
-    grpc_server_security_connector **sc);
+    grpc_exec_ctx* exec_ctx, grpc_server_credentials* creds,
+    grpc_server_security_connector** sc);
 
-grpc_server_credentials *grpc_server_credentials_ref(
-    grpc_server_credentials *creds);
+grpc_server_credentials* grpc_server_credentials_ref(
+    grpc_server_credentials* creds);
 
-void grpc_server_credentials_unref(grpc_exec_ctx *exec_ctx,
-                                   grpc_server_credentials *creds);
+void grpc_server_credentials_unref(grpc_exec_ctx* exec_ctx,
+                                   grpc_server_credentials* creds);
 
 #define GRPC_SERVER_CREDENTIALS_ARG "grpc.server_credentials"
 
-grpc_arg grpc_server_credentials_to_arg(grpc_server_credentials *c);
-grpc_server_credentials *grpc_server_credentials_from_arg(const grpc_arg *arg);
-grpc_server_credentials *grpc_find_server_credentials_in_args(
-    const grpc_channel_args *args);
+grpc_arg grpc_server_credentials_to_arg(grpc_server_credentials* c);
+grpc_server_credentials* grpc_server_credentials_from_arg(const grpc_arg* arg);
+grpc_server_credentials* grpc_find_server_credentials_in_args(
+    const grpc_channel_args* args);
 
 /* -- Credentials Metadata Request. -- */
 
 typedef struct {
-  grpc_call_credentials *creds;
+  grpc_call_credentials* creds;
   grpc_http_response response;
 } grpc_credentials_metadata_request;
 
-grpc_credentials_metadata_request *grpc_credentials_metadata_request_create(
-    grpc_call_credentials *creds);
+grpc_credentials_metadata_request* grpc_credentials_metadata_request_create(
+    grpc_call_credentials* creds);
 
 void grpc_credentials_metadata_request_destroy(
-    grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *r);
+    grpc_exec_ctx* exec_ctx, grpc_credentials_metadata_request* r);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/security/credentials/credentials_metadata.cc b/src/core/lib/security/credentials/credentials_metadata.cc
index 5ba98bd..a3623fa 100644
--- a/src/core/lib/security/credentials/credentials_metadata.cc
+++ b/src/core/lib/security/credentials/credentials_metadata.cc
@@ -24,7 +24,7 @@
 
 #include "src/core/lib/slice/slice_internal.h"
 
-static void mdelem_list_ensure_capacity(grpc_credentials_mdelem_array *list,
+static void mdelem_list_ensure_capacity(grpc_credentials_mdelem_array* list,
                                         size_t additional_space_needed) {
   size_t target_size = list->size + additional_space_needed;
   // Find the next power of two greater than the target size (i.e.,
@@ -34,17 +34,17 @@
     new_size *= 2;
   }
   list->md =
-      (grpc_mdelem *)gpr_realloc(list->md, sizeof(grpc_mdelem) * new_size);
+      (grpc_mdelem*)gpr_realloc(list->md, sizeof(grpc_mdelem) * new_size);
 }
 
-void grpc_credentials_mdelem_array_add(grpc_credentials_mdelem_array *list,
+void grpc_credentials_mdelem_array_add(grpc_credentials_mdelem_array* list,
                                        grpc_mdelem md) {
   mdelem_list_ensure_capacity(list, 1);
   list->md[list->size++] = GRPC_MDELEM_REF(md);
 }
 
-void grpc_credentials_mdelem_array_append(grpc_credentials_mdelem_array *dst,
-                                          grpc_credentials_mdelem_array *src) {
+void grpc_credentials_mdelem_array_append(grpc_credentials_mdelem_array* dst,
+                                          grpc_credentials_mdelem_array* src) {
   mdelem_list_ensure_capacity(dst, src->size);
   for (size_t i = 0; i < src->size; ++i) {
     dst->md[dst->size++] = GRPC_MDELEM_REF(src->md[i]);
@@ -52,7 +52,7 @@
 }
 
 void grpc_credentials_mdelem_array_destroy(
-    grpc_exec_ctx *exec_ctx, grpc_credentials_mdelem_array *list) {
+    grpc_exec_ctx* exec_ctx, grpc_credentials_mdelem_array* list) {
   for (size_t i = 0; i < list->size; ++i) {
     GRPC_MDELEM_UNREF(exec_ctx, list->md[i]);
   }
diff --git a/src/core/lib/security/credentials/fake/fake_credentials.cc b/src/core/lib/security/credentials/fake/fake_credentials.cc
index cf10bf2..17700f5 100644
--- a/src/core/lib/security/credentials/fake/fake_credentials.cc
+++ b/src/core/lib/security/credentials/fake/fake_credentials.cc
@@ -34,10 +34,10 @@
   "grpc.fake_security.expected_targets"
 
 static grpc_security_status fake_transport_security_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_channel_credentials *c,
-    grpc_call_credentials *call_creds, const char *target,
-    const grpc_channel_args *args, grpc_channel_security_connector **sc,
-    grpc_channel_args **new_args) {
+    grpc_exec_ctx* exec_ctx, grpc_channel_credentials* c,
+    grpc_call_credentials* call_creds, const char* target,
+    const grpc_channel_args* args, grpc_channel_security_connector** sc,
+    grpc_channel_args** new_args) {
   *sc =
       grpc_fake_channel_security_connector_create(c, call_creds, target, args);
   return GRPC_SECURITY_OK;
@@ -45,8 +45,8 @@
 
 static grpc_security_status
 fake_transport_security_server_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_server_credentials *c,
-    grpc_server_security_connector **sc) {
+    grpc_exec_ctx* exec_ctx, grpc_server_credentials* c,
+    grpc_server_security_connector** sc) {
   *sc = grpc_fake_server_security_connector_create(c);
   return GRPC_SECURITY_OK;
 }
@@ -59,20 +59,20 @@
     fake_transport_security_server_credentials_vtable = {
         NULL, fake_transport_security_server_create_security_connector};
 
-grpc_channel_credentials *grpc_fake_transport_security_credentials_create(
+grpc_channel_credentials* grpc_fake_transport_security_credentials_create(
     void) {
-  grpc_channel_credentials *c =
-      (grpc_channel_credentials *)gpr_zalloc(sizeof(grpc_channel_credentials));
+  grpc_channel_credentials* c =
+      (grpc_channel_credentials*)gpr_zalloc(sizeof(grpc_channel_credentials));
   c->type = GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY;
   c->vtable = &fake_transport_security_credentials_vtable;
   gpr_ref_init(&c->refcount, 1);
   return c;
 }
 
-grpc_server_credentials *grpc_fake_transport_security_server_credentials_create(
+grpc_server_credentials* grpc_fake_transport_security_server_credentials_create(
     void) {
-  grpc_server_credentials *c =
-      (grpc_server_credentials *)gpr_malloc(sizeof(grpc_server_credentials));
+  grpc_server_credentials* c =
+      (grpc_server_credentials*)gpr_malloc(sizeof(grpc_server_credentials));
   memset(c, 0, sizeof(grpc_server_credentials));
   c->type = GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY;
   gpr_ref_init(&c->refcount, 1);
@@ -80,14 +80,14 @@
   return c;
 }
 
-grpc_arg grpc_fake_transport_expected_targets_arg(char *expected_targets) {
+grpc_arg grpc_fake_transport_expected_targets_arg(char* expected_targets) {
   return grpc_channel_arg_string_create(
-      (char *)GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS, expected_targets);
+      (char*)GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS, expected_targets);
 }
 
-const char *grpc_fake_transport_get_expected_targets(
-    const grpc_channel_args *args) {
-  const grpc_arg *expected_target_arg =
+const char* grpc_fake_transport_get_expected_targets(
+    const grpc_channel_args* args) {
+  const grpc_arg* expected_target_arg =
       grpc_channel_args_find(args, GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS);
   if (expected_target_arg != NULL &&
       expected_target_arg->type == GRPC_ARG_STRING) {
@@ -98,18 +98,18 @@
 
 /* -- Metadata-only test credentials. -- */
 
-static void md_only_test_destruct(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_credentials *creds) {
-  grpc_md_only_test_credentials *c = (grpc_md_only_test_credentials *)creds;
+static void md_only_test_destruct(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_credentials* creds) {
+  grpc_md_only_test_credentials* c = (grpc_md_only_test_credentials*)creds;
   GRPC_MDELEM_UNREF(exec_ctx, c->md);
 }
 
 static bool md_only_test_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_polling_entity *pollent, grpc_auth_metadata_context context,
-    grpc_credentials_mdelem_array *md_array, grpc_closure *on_request_metadata,
-    grpc_error **error) {
-  grpc_md_only_test_credentials *c = (grpc_md_only_test_credentials *)creds;
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_polling_entity* pollent, grpc_auth_metadata_context context,
+    grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
+    grpc_error** error) {
+  grpc_md_only_test_credentials* c = (grpc_md_only_test_credentials*)creds;
   grpc_credentials_mdelem_array_add(md_array, c->md);
   if (c->is_async) {
     GRPC_CLOSURE_SCHED(exec_ctx, on_request_metadata, GRPC_ERROR_NONE);
@@ -119,8 +119,8 @@
 }
 
 static void md_only_test_cancel_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *c,
-    grpc_credentials_mdelem_array *md_array, grpc_error *error) {
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* c,
+    grpc_credentials_mdelem_array* md_array, grpc_error* error) {
   GRPC_ERROR_UNREF(error);
 }
 
@@ -128,12 +128,11 @@
     md_only_test_destruct, md_only_test_get_request_metadata,
     md_only_test_cancel_get_request_metadata};
 
-grpc_call_credentials *grpc_md_only_test_credentials_create(
-    grpc_exec_ctx *exec_ctx, const char *md_key, const char *md_value,
+grpc_call_credentials* grpc_md_only_test_credentials_create(
+    grpc_exec_ctx* exec_ctx, const char* md_key, const char* md_value,
     bool is_async) {
-  grpc_md_only_test_credentials *c =
-      (grpc_md_only_test_credentials *)gpr_zalloc(
-          sizeof(grpc_md_only_test_credentials));
+  grpc_md_only_test_credentials* c = (grpc_md_only_test_credentials*)gpr_zalloc(
+      sizeof(grpc_md_only_test_credentials));
   c->base.type = GRPC_CALL_CREDENTIALS_TYPE_OAUTH2;
   c->base.vtable = &md_only_test_vtable;
   gpr_ref_init(&c->base.refcount, 1);
diff --git a/src/core/lib/security/credentials/fake/fake_credentials.h b/src/core/lib/security/credentials/fake/fake_credentials.h
index ed3f893..b8b58cc 100644
--- a/src/core/lib/security/credentials/fake/fake_credentials.h
+++ b/src/core/lib/security/credentials/fake/fake_credentials.h
@@ -28,10 +28,10 @@
 /* -- Fake transport security credentials. -- */
 
 /* Creates a fake transport security credentials object for testing. */
-grpc_channel_credentials *grpc_fake_transport_security_credentials_create(void);
+grpc_channel_credentials* grpc_fake_transport_security_credentials_create(void);
 
 /* Creates a fake server transport security credentials object for testing. */
-grpc_server_credentials *grpc_fake_transport_security_server_credentials_create(
+grpc_server_credentials* grpc_fake_transport_security_server_credentials_create(
     void);
 
 /* Used to verify the target names given to the fake transport security
@@ -46,11 +46,11 @@
  * That is to say, LB channels have a heading list of LB targets separated from
  * the list of backend targets by a semicolon. For non-LB channels, only the
  * latter is present. */
-grpc_arg grpc_fake_transport_expected_targets_arg(char *expected_targets);
+grpc_arg grpc_fake_transport_expected_targets_arg(char* expected_targets);
 
 /* Return the value associated with the expected targets channel arg or NULL */
-const char *grpc_fake_transport_get_expected_targets(
-    const grpc_channel_args *args);
+const char* grpc_fake_transport_get_expected_targets(
+    const grpc_channel_args* args);
 
 /* --  Metadata-only Test credentials. -- */
 
diff --git a/src/core/lib/security/credentials/google_default/credentials_generic.cc b/src/core/lib/security/credentials/google_default/credentials_generic.cc
index 4f79718..c2a336f 100644
--- a/src/core/lib/security/credentials/google_default/credentials_generic.cc
+++ b/src/core/lib/security/credentials/google_default/credentials_generic.cc
@@ -25,9 +25,9 @@
 #include "src/core/lib/support/env.h"
 #include "src/core/lib/support/string.h"
 
-char *grpc_get_well_known_google_credentials_file_path_impl(void) {
-  char *result = NULL;
-  char *base = gpr_getenv(GRPC_GOOGLE_CREDENTIALS_PATH_ENV_VAR);
+char* grpc_get_well_known_google_credentials_file_path_impl(void) {
+  char* result = NULL;
+  char* base = gpr_getenv(GRPC_GOOGLE_CREDENTIALS_PATH_ENV_VAR);
   if (base == NULL) {
     gpr_log(GPR_ERROR, "Could not get " GRPC_GOOGLE_CREDENTIALS_ENV_VAR
                        " environment variable.");
diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
index 5b2ddce..3ce19e9 100644
--- a/src/core/lib/security/credentials/google_default/google_default_credentials.cc
+++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
@@ -43,10 +43,10 @@
 
 /* -- Default credentials. -- */
 
-static grpc_channel_credentials *default_credentials = NULL;
+static grpc_channel_credentials* default_credentials = NULL;
 static int compute_engine_detection_done = 0;
 static gpr_mu g_state_mu;
-static gpr_mu *g_polling_mu;
+static gpr_mu* g_polling_mu;
 static gpr_once g_once = GPR_ONCE_INIT;
 
 static void init_default_credentials(void) { gpr_mu_init(&g_state_mu); }
@@ -58,17 +58,17 @@
   grpc_http_response response;
 } compute_engine_detector;
 
-static void on_compute_engine_detection_http_response(grpc_exec_ctx *exec_ctx,
-                                                      void *user_data,
-                                                      grpc_error *error) {
-  compute_engine_detector *detector = (compute_engine_detector *)user_data;
+static void on_compute_engine_detection_http_response(grpc_exec_ctx* exec_ctx,
+                                                      void* user_data,
+                                                      grpc_error* error) {
+  compute_engine_detector* detector = (compute_engine_detector*)user_data;
   if (error == GRPC_ERROR_NONE && detector->response.status == 200 &&
       detector->response.hdr_count > 0) {
     /* Internet providers can return a generic response to all requests, so
        it is necessary to check that metadata header is present also. */
     size_t i;
     for (i = 0; i < detector->response.hdr_count; i++) {
-      grpc_http_header *header = &detector->response.hdrs[i];
+      grpc_http_header* header = &detector->response.hdrs[i];
       if (strcmp(header->key, "Metadata-Flavor") == 0 &&
           strcmp(header->value, "Google") == 0) {
         detector->success = 1;
@@ -85,11 +85,11 @@
   gpr_mu_unlock(g_polling_mu);
 }
 
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, grpc_error *e) {
-  grpc_pollset_destroy(exec_ctx, (grpc_pollset *)p);
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p, grpc_error* e) {
+  grpc_pollset_destroy(exec_ctx, (grpc_pollset*)p);
 }
 
-static int is_stack_running_on_compute_engine(grpc_exec_ctx *exec_ctx) {
+static int is_stack_running_on_compute_engine(grpc_exec_ctx* exec_ctx) {
   compute_engine_detector detector;
   grpc_httpcli_request request;
   grpc_httpcli_context context;
@@ -99,7 +99,7 @@
      on compute engine. */
   grpc_millis max_detection_delay = GPR_MS_PER_SEC;
 
-  grpc_pollset *pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size());
+  grpc_pollset* pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
   grpc_pollset_init(pollset, &g_polling_mu);
   detector.pollent = grpc_polling_entity_create_from_pollset(pollset);
   detector.is_done = 0;
@@ -107,12 +107,12 @@
 
   memset(&detector.response, 0, sizeof(detector.response));
   memset(&request, 0, sizeof(grpc_httpcli_request));
-  request.host = (char *)GRPC_COMPUTE_ENGINE_DETECTION_HOST;
-  request.http.path = (char *)"/";
+  request.host = (char*)GRPC_COMPUTE_ENGINE_DETECTION_HOST;
+  request.http.path = (char*)"/";
 
   grpc_httpcli_context_init(&context);
 
-  grpc_resource_quota *resource_quota =
+  grpc_resource_quota* resource_quota =
       grpc_resource_quota_create("google_default_credentials");
   grpc_httpcli_get(
       exec_ctx, &context, &detector.pollent, resource_quota, &request,
@@ -128,7 +128,7 @@
      called once for the lifetime of the process by the default credentials. */
   gpr_mu_lock(g_polling_mu);
   while (!detector.is_done) {
-    grpc_pollset_worker *worker = NULL;
+    grpc_pollset_worker* worker = NULL;
     if (!GRPC_LOG_IF_ERROR(
             "pollset_work",
             grpc_pollset_work(exec_ctx,
@@ -157,14 +157,14 @@
 }
 
 /* Takes ownership of creds_path if not NULL. */
-static grpc_error *create_default_creds_from_path(
-    grpc_exec_ctx *exec_ctx, char *creds_path, grpc_call_credentials **creds) {
-  grpc_json *json = NULL;
+static grpc_error* create_default_creds_from_path(
+    grpc_exec_ctx* exec_ctx, char* creds_path, grpc_call_credentials** creds) {
+  grpc_json* json = NULL;
   grpc_auth_json_key key;
   grpc_auth_refresh_token token;
-  grpc_call_credentials *result = NULL;
+  grpc_call_credentials* result = NULL;
   grpc_slice creds_data = grpc_empty_slice();
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   if (creds_path == NULL) {
     error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("creds_path unset");
     goto end;
@@ -174,7 +174,7 @@
     goto end;
   }
   json = grpc_json_parse_string_with_len(
-      (char *)GRPC_SLICE_START_PTR(creds_data), GRPC_SLICE_LENGTH(creds_data));
+      (char*)GRPC_SLICE_START_PTR(creds_data), GRPC_SLICE_LENGTH(creds_data));
   if (json == NULL) {
     error = grpc_error_set_str(
         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to parse JSON"),
@@ -218,12 +218,12 @@
   return error;
 }
 
-grpc_channel_credentials *grpc_google_default_credentials_create(void) {
-  grpc_channel_credentials *result = NULL;
-  grpc_call_credentials *call_creds = NULL;
-  grpc_error *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+grpc_channel_credentials* grpc_google_default_credentials_create(void) {
+  grpc_channel_credentials* result = NULL;
+  grpc_call_credentials* call_creds = NULL;
+  grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
       "Failed to create Google credentials");
-  grpc_error *err;
+  grpc_error* err;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
   GRPC_API_TRACE("grpc_google_default_credentials_create(void)", 0, ());
@@ -272,7 +272,7 @@
       /* Blend with default ssl credentials and add a global reference so that
          it
          can be cached and re-served. */
-      grpc_channel_credentials *ssl_creds =
+      grpc_channel_credentials* ssl_creds =
           grpc_ssl_credentials_create(NULL, NULL, NULL);
       default_credentials = grpc_channel_credentials_ref(
           grpc_composite_channel_credentials_create(ssl_creds, call_creds,
@@ -312,7 +312,7 @@
 
 static grpc_well_known_credentials_path_getter creds_path_getter = NULL;
 
-char *grpc_get_well_known_google_credentials_file_path(void) {
+char* grpc_get_well_known_google_credentials_file_path(void) {
   if (creds_path_getter != NULL) return creds_path_getter();
   return grpc_get_well_known_google_credentials_file_path_impl();
 }
diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.h b/src/core/lib/security/credentials/google_default/google_default_credentials.h
index 6667787..a0f8dc9 100644
--- a/src/core/lib/security/credentials/google_default/google_default_credentials.h
+++ b/src/core/lib/security/credentials/google_default/google_default_credentials.h
@@ -50,4 +50,4 @@
 #endif
 
 #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_GOOGLE_DEFAULT_GOOGLE_DEFAULT_CREDENTIALS_H \
-          */
+        */
diff --git a/src/core/lib/security/credentials/iam/iam_credentials.cc b/src/core/lib/security/credentials/iam/iam_credentials.cc
index e9cf208..7410294 100644
--- a/src/core/lib/security/credentials/iam/iam_credentials.cc
+++ b/src/core/lib/security/credentials/iam/iam_credentials.cc
@@ -27,35 +27,35 @@
 #include <grpc/support/string_util.h>
 #include <grpc/support/sync.h>
 
-static void iam_destruct(grpc_exec_ctx *exec_ctx,
-                         grpc_call_credentials *creds) {
-  grpc_google_iam_credentials *c = (grpc_google_iam_credentials *)creds;
+static void iam_destruct(grpc_exec_ctx* exec_ctx,
+                         grpc_call_credentials* creds) {
+  grpc_google_iam_credentials* c = (grpc_google_iam_credentials*)creds;
   grpc_credentials_mdelem_array_destroy(exec_ctx, &c->md_array);
 }
 
-static bool iam_get_request_metadata(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_credentials *creds,
-                                     grpc_polling_entity *pollent,
+static bool iam_get_request_metadata(grpc_exec_ctx* exec_ctx,
+                                     grpc_call_credentials* creds,
+                                     grpc_polling_entity* pollent,
                                      grpc_auth_metadata_context context,
-                                     grpc_credentials_mdelem_array *md_array,
-                                     grpc_closure *on_request_metadata,
-                                     grpc_error **error) {
-  grpc_google_iam_credentials *c = (grpc_google_iam_credentials *)creds;
+                                     grpc_credentials_mdelem_array* md_array,
+                                     grpc_closure* on_request_metadata,
+                                     grpc_error** error) {
+  grpc_google_iam_credentials* c = (grpc_google_iam_credentials*)creds;
   grpc_credentials_mdelem_array_append(md_array, &c->md_array);
   return true;
 }
 
 static void iam_cancel_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *c,
-    grpc_credentials_mdelem_array *md_array, grpc_error *error) {
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* c,
+    grpc_credentials_mdelem_array* md_array, grpc_error* error) {
   GRPC_ERROR_UNREF(error);
 }
 
 static grpc_call_credentials_vtable iam_vtable = {
     iam_destruct, iam_get_request_metadata, iam_cancel_get_request_metadata};
 
-grpc_call_credentials *grpc_google_iam_credentials_create(
-    const char *token, const char *authority_selector, void *reserved) {
+grpc_call_credentials* grpc_google_iam_credentials_create(
+    const char* token, const char* authority_selector, void* reserved) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GRPC_API_TRACE(
       "grpc_iam_credentials_create(token=%s, authority_selector=%s, "
@@ -64,8 +64,8 @@
   GPR_ASSERT(reserved == NULL);
   GPR_ASSERT(token != NULL);
   GPR_ASSERT(authority_selector != NULL);
-  grpc_google_iam_credentials *c =
-      (grpc_google_iam_credentials *)gpr_zalloc(sizeof(*c));
+  grpc_google_iam_credentials* c =
+      (grpc_google_iam_credentials*)gpr_zalloc(sizeof(*c));
   c->base.type = GRPC_CALL_CREDENTIALS_TYPE_IAM;
   c->base.vtable = &iam_vtable;
   gpr_ref_init(&c->base.refcount, 1);
diff --git a/src/core/lib/security/credentials/jwt/json_token.cc b/src/core/lib/security/credentials/jwt/json_token.cc
index 8c30353..e195ec7 100644
--- a/src/core/lib/security/credentials/jwt/json_token.cc
+++ b/src/core/lib/security/credentials/jwt/json_token.cc
@@ -56,15 +56,15 @@
 
 /* --- grpc_auth_json_key. --- */
 
-int grpc_auth_json_key_is_valid(const grpc_auth_json_key *json_key) {
+int grpc_auth_json_key_is_valid(const grpc_auth_json_key* json_key) {
   return (json_key != NULL) &&
          strcmp(json_key->type, GRPC_AUTH_JSON_TYPE_INVALID);
 }
 
-grpc_auth_json_key grpc_auth_json_key_create_from_json(const grpc_json *json) {
+grpc_auth_json_key grpc_auth_json_key_create_from_json(const grpc_json* json) {
   grpc_auth_json_key result;
-  BIO *bio = NULL;
-  const char *prop_value;
+  BIO* bio = NULL;
+  const char* prop_value;
   int success = 0;
 
   memset(&result, 0, sizeof(grpc_auth_json_key));
@@ -99,7 +99,7 @@
     gpr_log(GPR_ERROR, "Could not write into openssl BIO.");
     goto end;
   }
-  result.private_key = PEM_read_bio_RSAPrivateKey(bio, NULL, NULL, (void *)"");
+  result.private_key = PEM_read_bio_RSAPrivateKey(bio, NULL, NULL, (void*)"");
   if (result.private_key == NULL) {
     gpr_log(GPR_ERROR, "Could not deserialize private key.");
     goto end;
@@ -113,16 +113,16 @@
 }
 
 grpc_auth_json_key grpc_auth_json_key_create_from_string(
-    const char *json_string) {
-  char *scratchpad = gpr_strdup(json_string);
-  grpc_json *json = grpc_json_parse_string(scratchpad);
+    const char* json_string) {
+  char* scratchpad = gpr_strdup(json_string);
+  grpc_json* json = grpc_json_parse_string(scratchpad);
   grpc_auth_json_key result = grpc_auth_json_key_create_from_json(json);
   if (json != NULL) grpc_json_destroy(json);
   gpr_free(scratchpad);
   return result;
 }
 
-void grpc_auth_json_key_destruct(grpc_auth_json_key *json_key) {
+void grpc_auth_json_key_destruct(grpc_auth_json_key* json_key) {
   if (json_key == NULL) return;
   json_key->type = GRPC_AUTH_JSON_TYPE_INVALID;
   if (json_key->client_id != NULL) {
@@ -145,10 +145,10 @@
 
 /* --- jwt encoding and signature. --- */
 
-static grpc_json *create_child(grpc_json *brother, grpc_json *parent,
-                               const char *key, const char *value,
+static grpc_json* create_child(grpc_json* brother, grpc_json* parent,
+                               const char* key, const char* value,
                                grpc_json_type type) {
-  grpc_json *child = grpc_json_create(type);
+  grpc_json* child = grpc_json_create(type);
   if (brother) brother->next = child;
   if (!parent->child) parent->child = child;
   child->parent = parent;
@@ -157,11 +157,11 @@
   return child;
 }
 
-static char *encoded_jwt_header(const char *key_id, const char *algorithm) {
-  grpc_json *json = grpc_json_create(GRPC_JSON_OBJECT);
-  grpc_json *child = NULL;
-  char *json_str = NULL;
-  char *result = NULL;
+static char* encoded_jwt_header(const char* key_id, const char* algorithm) {
+  grpc_json* json = grpc_json_create(GRPC_JSON_OBJECT);
+  grpc_json* child = NULL;
+  char* json_str = NULL;
+  char* result = NULL;
 
   child = create_child(NULL, json, "alg", algorithm, GRPC_JSON_STRING);
   child = create_child(child, json, "typ", GRPC_JWT_TYPE, GRPC_JSON_STRING);
@@ -174,13 +174,13 @@
   return result;
 }
 
-static char *encoded_jwt_claim(const grpc_auth_json_key *json_key,
-                               const char *audience,
-                               gpr_timespec token_lifetime, const char *scope) {
-  grpc_json *json = grpc_json_create(GRPC_JSON_OBJECT);
-  grpc_json *child = NULL;
-  char *json_str = NULL;
-  char *result = NULL;
+static char* encoded_jwt_claim(const grpc_auth_json_key* json_key,
+                               const char* audience,
+                               gpr_timespec token_lifetime, const char* scope) {
+  grpc_json* json = grpc_json_create(GRPC_JSON_OBJECT);
+  grpc_json* child = NULL;
+  char* json_str = NULL;
+  char* result = NULL;
   gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
   gpr_timespec expiration = gpr_time_add(now, token_lifetime);
   char now_str[GPR_LTOA_MIN_BUFSIZE];
@@ -213,12 +213,12 @@
   return result;
 }
 
-static char *dot_concat_and_free_strings(char *str1, char *str2) {
+static char* dot_concat_and_free_strings(char* str1, char* str2) {
   size_t str1_len = strlen(str1);
   size_t str2_len = strlen(str2);
   size_t result_len = str1_len + 1 /* dot */ + str2_len;
-  char *result = (char *)gpr_malloc(result_len + 1 /* NULL terminated */);
-  char *current = result;
+  char* result = (char*)gpr_malloc(result_len + 1 /* NULL terminated */);
+  char* current = result;
   memcpy(current, str1, str1_len);
   current += str1_len;
   *(current++) = '.';
@@ -232,7 +232,7 @@
   return result;
 }
 
-const EVP_MD *openssl_digest_from_algorithm(const char *algorithm) {
+const EVP_MD* openssl_digest_from_algorithm(const char* algorithm) {
   if (strcmp(algorithm, GRPC_JWT_RSA_SHA256_ALGORITHM) == 0) {
     return EVP_sha256();
   } else {
@@ -241,15 +241,15 @@
   }
 }
 
-char *compute_and_encode_signature(const grpc_auth_json_key *json_key,
-                                   const char *signature_algorithm,
-                                   const char *to_sign) {
-  const EVP_MD *md = openssl_digest_from_algorithm(signature_algorithm);
-  EVP_MD_CTX *md_ctx = NULL;
-  EVP_PKEY *key = EVP_PKEY_new();
+char* compute_and_encode_signature(const grpc_auth_json_key* json_key,
+                                   const char* signature_algorithm,
+                                   const char* to_sign) {
+  const EVP_MD* md = openssl_digest_from_algorithm(signature_algorithm);
+  EVP_MD_CTX* md_ctx = NULL;
+  EVP_PKEY* key = EVP_PKEY_new();
   size_t sig_len = 0;
-  unsigned char *sig = NULL;
-  char *result = NULL;
+  unsigned char* sig = NULL;
+  char* result = NULL;
   if (md == NULL) return NULL;
   md_ctx = EVP_MD_CTX_create();
   if (md_ctx == NULL) {
@@ -269,7 +269,7 @@
     gpr_log(GPR_ERROR, "DigestFinal (get signature length) failed.");
     goto end;
   }
-  sig = (unsigned char *)gpr_malloc(sig_len);
+  sig = (unsigned char*)gpr_malloc(sig_len);
   if (EVP_DigestSignFinal(md_ctx, sig, &sig_len) != 1) {
     gpr_log(GPR_ERROR, "DigestFinal (signature compute) failed.");
     goto end;
@@ -283,18 +283,18 @@
   return result;
 }
 
-char *grpc_jwt_encode_and_sign(const grpc_auth_json_key *json_key,
-                               const char *audience,
-                               gpr_timespec token_lifetime, const char *scope) {
+char* grpc_jwt_encode_and_sign(const grpc_auth_json_key* json_key,
+                               const char* audience,
+                               gpr_timespec token_lifetime, const char* scope) {
   if (g_jwt_encode_and_sign_override != NULL) {
     return g_jwt_encode_and_sign_override(json_key, audience, token_lifetime,
                                           scope);
   } else {
-    const char *sig_algo = GRPC_JWT_RSA_SHA256_ALGORITHM;
-    char *to_sign = dot_concat_and_free_strings(
+    const char* sig_algo = GRPC_JWT_RSA_SHA256_ALGORITHM;
+    char* to_sign = dot_concat_and_free_strings(
         encoded_jwt_header(json_key->private_key_id, sig_algo),
         encoded_jwt_claim(json_key, audience, token_lifetime, scope));
-    char *sig = compute_and_encode_signature(json_key, sig_algo, to_sign);
+    char* sig = compute_and_encode_signature(json_key, sig_algo, to_sign);
     if (sig == NULL) {
       gpr_free(to_sign);
       return NULL;
diff --git a/src/core/lib/security/credentials/jwt/json_token.h b/src/core/lib/security/credentials/jwt/json_token.h
index b923b02..b2c3c09 100644
--- a/src/core/lib/security/credentials/jwt/json_token.h
+++ b/src/core/lib/security/credentials/jwt/json_token.h
@@ -35,40 +35,40 @@
 /* --- auth_json_key parsing. --- */
 
 typedef struct {
-  const char *type;
-  char *private_key_id;
-  char *client_id;
-  char *client_email;
-  RSA *private_key;
+  const char* type;
+  char* private_key_id;
+  char* client_id;
+  char* client_email;
+  RSA* private_key;
 } grpc_auth_json_key;
 
 /* Returns 1 if the object is valid, 0 otherwise. */
-int grpc_auth_json_key_is_valid(const grpc_auth_json_key *json_key);
+int grpc_auth_json_key_is_valid(const grpc_auth_json_key* json_key);
 
 /* Creates a json_key object from string. Returns an invalid object if a parsing
    error has been encountered. */
 grpc_auth_json_key grpc_auth_json_key_create_from_string(
-    const char *json_string);
+    const char* json_string);
 
 /* Creates a json_key object from parsed json. Returns an invalid object if a
    parsing error has been encountered. */
-grpc_auth_json_key grpc_auth_json_key_create_from_json(const grpc_json *json);
+grpc_auth_json_key grpc_auth_json_key_create_from_json(const grpc_json* json);
 
 /* Destructs the object. */
-void grpc_auth_json_key_destruct(grpc_auth_json_key *json_key);
+void grpc_auth_json_key_destruct(grpc_auth_json_key* json_key);
 
 /* --- json token encoding and signing. --- */
 
 /* Caller is responsible for calling gpr_free on the returned value. May return
    NULL on invalid input. The scope parameter may be NULL. */
-char *grpc_jwt_encode_and_sign(const grpc_auth_json_key *json_key,
-                               const char *audience,
-                               gpr_timespec token_lifetime, const char *scope);
+char* grpc_jwt_encode_and_sign(const grpc_auth_json_key* json_key,
+                               const char* audience,
+                               gpr_timespec token_lifetime, const char* scope);
 
 /* Override encode_and_sign function for testing. */
-typedef char *(*grpc_jwt_encode_and_sign_override)(
-    const grpc_auth_json_key *json_key, const char *audience,
-    gpr_timespec token_lifetime, const char *scope);
+typedef char* (*grpc_jwt_encode_and_sign_override)(
+    const grpc_auth_json_key* json_key, const char* audience,
+    gpr_timespec token_lifetime, const char* scope);
 
 /* Set a custom encode_and_sign override for testing. */
 void grpc_jwt_encode_and_sign_set_override(
diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.cc b/src/core/lib/security/credentials/jwt/jwt_credentials.cc
index 82d7ad5..77d0bc1 100644
--- a/src/core/lib/security/credentials/jwt/jwt_credentials.cc
+++ b/src/core/lib/security/credentials/jwt/jwt_credentials.cc
@@ -30,8 +30,8 @@
 #include <grpc/support/string_util.h>
 #include <grpc/support/sync.h>
 
-static void jwt_reset_cache(grpc_exec_ctx *exec_ctx,
-                            grpc_service_account_jwt_access_credentials *c) {
+static void jwt_reset_cache(grpc_exec_ctx* exec_ctx,
+                            grpc_service_account_jwt_access_credentials* c) {
   GRPC_MDELEM_UNREF(exec_ctx, c->cached.jwt_md);
   c->cached.jwt_md = GRPC_MDNULL;
   if (c->cached.service_url != NULL) {
@@ -41,24 +41,24 @@
   c->cached.jwt_expiration = gpr_inf_past(GPR_CLOCK_REALTIME);
 }
 
-static void jwt_destruct(grpc_exec_ctx *exec_ctx,
-                         grpc_call_credentials *creds) {
-  grpc_service_account_jwt_access_credentials *c =
-      (grpc_service_account_jwt_access_credentials *)creds;
+static void jwt_destruct(grpc_exec_ctx* exec_ctx,
+                         grpc_call_credentials* creds) {
+  grpc_service_account_jwt_access_credentials* c =
+      (grpc_service_account_jwt_access_credentials*)creds;
   grpc_auth_json_key_destruct(&c->key);
   jwt_reset_cache(exec_ctx, c);
   gpr_mu_destroy(&c->cache_mu);
 }
 
-static bool jwt_get_request_metadata(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_credentials *creds,
-                                     grpc_polling_entity *pollent,
+static bool jwt_get_request_metadata(grpc_exec_ctx* exec_ctx,
+                                     grpc_call_credentials* creds,
+                                     grpc_polling_entity* pollent,
                                      grpc_auth_metadata_context context,
-                                     grpc_credentials_mdelem_array *md_array,
-                                     grpc_closure *on_request_metadata,
-                                     grpc_error **error) {
-  grpc_service_account_jwt_access_credentials *c =
-      (grpc_service_account_jwt_access_credentials *)creds;
+                                     grpc_credentials_mdelem_array* md_array,
+                                     grpc_closure* on_request_metadata,
+                                     grpc_error** error) {
+  grpc_service_account_jwt_access_credentials* c =
+      (grpc_service_account_jwt_access_credentials*)creds;
   gpr_timespec refresh_threshold = gpr_time_from_seconds(
       GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS, GPR_TIMESPAN);
 
@@ -78,14 +78,14 @@
   }
 
   if (GRPC_MDISNULL(jwt_md)) {
-    char *jwt = NULL;
+    char* jwt = NULL;
     /* Generate a new jwt. */
     gpr_mu_lock(&c->cache_mu);
     jwt_reset_cache(exec_ctx, c);
     jwt = grpc_jwt_encode_and_sign(&c->key, context.service_url,
                                    c->jwt_lifetime, NULL);
     if (jwt != NULL) {
-      char *md_value;
+      char* md_value;
       gpr_asprintf(&md_value, "Bearer %s", jwt);
       gpr_free(jwt);
       c->cached.jwt_expiration =
@@ -111,24 +111,24 @@
 }
 
 static void jwt_cancel_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *c,
-    grpc_credentials_mdelem_array *md_array, grpc_error *error) {
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* c,
+    grpc_credentials_mdelem_array* md_array, grpc_error* error) {
   GRPC_ERROR_UNREF(error);
 }
 
 static grpc_call_credentials_vtable jwt_vtable = {
     jwt_destruct, jwt_get_request_metadata, jwt_cancel_get_request_metadata};
 
-grpc_call_credentials *
+grpc_call_credentials*
 grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
-    grpc_exec_ctx *exec_ctx, grpc_auth_json_key key,
+    grpc_exec_ctx* exec_ctx, grpc_auth_json_key key,
     gpr_timespec token_lifetime) {
-  grpc_service_account_jwt_access_credentials *c;
+  grpc_service_account_jwt_access_credentials* c;
   if (!grpc_auth_json_key_is_valid(&key)) {
     gpr_log(GPR_ERROR, "Invalid input for jwt credentials creation");
     return NULL;
   }
-  c = (grpc_service_account_jwt_access_credentials *)gpr_zalloc(
+  c = (grpc_service_account_jwt_access_credentials*)gpr_zalloc(
       sizeof(grpc_service_account_jwt_access_credentials));
   c->base.type = GRPC_CALL_CREDENTIALS_TYPE_JWT;
   gpr_ref_init(&c->base.refcount, 1);
@@ -147,33 +147,33 @@
   return &c->base;
 }
 
-static char *redact_private_key(const char *json_key) {
-  char *json_copy = gpr_strdup(json_key);
-  grpc_json *json = grpc_json_parse_string(json_copy);
+static char* redact_private_key(const char* json_key) {
+  char* json_copy = gpr_strdup(json_key);
+  grpc_json* json = grpc_json_parse_string(json_copy);
   if (!json) {
     gpr_free(json_copy);
     return gpr_strdup("<Json failed to parse.>");
   }
-  const char *redacted = "<redacted>";
-  grpc_json *current = json->child;
+  const char* redacted = "<redacted>";
+  grpc_json* current = json->child;
   while (current) {
     if (current->type == GRPC_JSON_STRING &&
         strcmp(current->key, "private_key") == 0) {
-      current->value = (char *)redacted;
+      current->value = (char*)redacted;
       break;
     }
     current = current->next;
   }
-  char *clean_json = grpc_json_dump_to_string(json, 2);
+  char* clean_json = grpc_json_dump_to_string(json, 2);
   gpr_free(json_copy);
   grpc_json_destroy(json);
   return clean_json;
 }
 
-grpc_call_credentials *grpc_service_account_jwt_access_credentials_create(
-    const char *json_key, gpr_timespec token_lifetime, void *reserved) {
+grpc_call_credentials* grpc_service_account_jwt_access_credentials_create(
+    const char* json_key, gpr_timespec token_lifetime, void* reserved) {
   if (grpc_api_trace.enabled()) {
-    char *clean_json = redact_private_key(json_key);
+    char* clean_json = redact_private_key(json_key);
     gpr_log(GPR_INFO,
             "grpc_service_account_jwt_access_credentials_create("
             "json_key=%s, "
@@ -187,7 +187,7 @@
   }
   GPR_ASSERT(reserved == NULL);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_call_credentials *creds =
+  grpc_call_credentials* creds =
       grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
           &exec_ctx, grpc_auth_json_key_create_from_string(json_key),
           token_lifetime);
diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.h b/src/core/lib/security/credentials/jwt/jwt_credentials.h
index 5cee6ed..d554613 100644
--- a/src/core/lib/security/credentials/jwt/jwt_credentials.h
+++ b/src/core/lib/security/credentials/jwt/jwt_credentials.h
@@ -34,7 +34,7 @@
   gpr_mu cache_mu;
   struct {
     grpc_mdelem jwt_md;
-    char *service_url;
+    char* service_url;
     gpr_timespec jwt_expiration;
   } cached;
 
@@ -44,9 +44,9 @@
 
 // Private constructor for jwt credentials from an already parsed json key.
 // Takes ownership of the key.
-grpc_call_credentials *
+grpc_call_credentials*
 grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
-    grpc_exec_ctx *exec_ctx, grpc_auth_json_key key,
+    grpc_exec_ctx* exec_ctx, grpc_auth_json_key key,
     gpr_timespec token_lifetime);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.cc b/src/core/lib/security/credentials/jwt/jwt_verifier.cc
index 39e72c1..0fce5f5 100644
--- a/src/core/lib/security/credentials/jwt/jwt_verifier.cc
+++ b/src/core/lib/security/credentials/jwt/jwt_verifier.cc
@@ -40,7 +40,7 @@
 
 /* --- Utils. --- */
 
-const char *grpc_jwt_verifier_status_to_string(
+const char* grpc_jwt_verifier_status_to_string(
     grpc_jwt_verifier_status status) {
   switch (status) {
     case GRPC_JWT_VERIFIER_OK:
@@ -62,7 +62,7 @@
   }
 }
 
-static const EVP_MD *evp_md_from_alg(const char *alg) {
+static const EVP_MD* evp_md_from_alg(const char* alg) {
   if (strcmp(alg, "RS256") == 0) {
     return EVP_sha256();
   } else if (strcmp(alg, "RS384") == 0) {
@@ -74,17 +74,17 @@
   }
 }
 
-static grpc_json *parse_json_part_from_jwt(grpc_exec_ctx *exec_ctx,
-                                           const char *str, size_t len,
-                                           grpc_slice *buffer) {
-  grpc_json *json;
+static grpc_json* parse_json_part_from_jwt(grpc_exec_ctx* exec_ctx,
+                                           const char* str, size_t len,
+                                           grpc_slice* buffer) {
+  grpc_json* json;
 
   *buffer = grpc_base64_decode_with_len(exec_ctx, str, len, 1);
   if (GRPC_SLICE_IS_EMPTY(*buffer)) {
     gpr_log(GPR_ERROR, "Invalid base64.");
     return NULL;
   }
-  json = grpc_json_parse_string_with_len((char *)GRPC_SLICE_START_PTR(*buffer),
+  json = grpc_json_parse_string_with_len((char*)GRPC_SLICE_START_PTR(*buffer),
                                          GRPC_SLICE_LENGTH(*buffer));
   if (json == NULL) {
     grpc_slice_unref_internal(exec_ctx, *buffer);
@@ -93,8 +93,8 @@
   return json;
 }
 
-static const char *validate_string_field(const grpc_json *json,
-                                         const char *key) {
+static const char* validate_string_field(const grpc_json* json,
+                                         const char* key) {
   if (json->type != GRPC_JSON_STRING) {
     gpr_log(GPR_ERROR, "Invalid %s field [%s]", key, json->value);
     return NULL;
@@ -102,8 +102,8 @@
   return json->value;
 }
 
-static gpr_timespec validate_time_field(const grpc_json *json,
-                                        const char *key) {
+static gpr_timespec validate_time_field(const grpc_json* json,
+                                        const char* key) {
   gpr_timespec result = gpr_time_0(GPR_CLOCK_REALTIME);
   if (json->type != GRPC_JSON_NUMBER) {
     gpr_log(GPR_ERROR, "Invalid %s field [%s]", key, json->value);
@@ -116,23 +116,23 @@
 /* --- JOSE header. see http://tools.ietf.org/html/rfc7515#section-4 --- */
 
 typedef struct {
-  const char *alg;
-  const char *kid;
-  const char *typ;
+  const char* alg;
+  const char* kid;
+  const char* typ;
   /* TODO(jboeuf): Add others as needed (jku, jwk, x5u, x5c and so on...). */
   grpc_slice buffer;
 } jose_header;
 
-static void jose_header_destroy(grpc_exec_ctx *exec_ctx, jose_header *h) {
+static void jose_header_destroy(grpc_exec_ctx* exec_ctx, jose_header* h) {
   grpc_slice_unref_internal(exec_ctx, h->buffer);
   gpr_free(h);
 }
 
 /* Takes ownership of json and buffer. */
-static jose_header *jose_header_from_json(grpc_exec_ctx *exec_ctx,
-                                          grpc_json *json, grpc_slice buffer) {
-  grpc_json *cur;
-  jose_header *h = (jose_header *)gpr_zalloc(sizeof(jose_header));
+static jose_header* jose_header_from_json(grpc_exec_ctx* exec_ctx,
+                                          grpc_json* json, grpc_slice buffer) {
+  grpc_json* cur;
+  jose_header* h = (jose_header*)gpr_zalloc(sizeof(jose_header));
   h->buffer = buffer;
   for (cur = json->child; cur != NULL; cur = cur->next) {
     if (strcmp(cur->key, "alg") == 0) {
@@ -172,70 +172,70 @@
 
 struct grpc_jwt_claims {
   /* Well known properties already parsed. */
-  const char *sub;
-  const char *iss;
-  const char *aud;
-  const char *jti;
+  const char* sub;
+  const char* iss;
+  const char* aud;
+  const char* jti;
   gpr_timespec iat;
   gpr_timespec exp;
   gpr_timespec nbf;
 
-  grpc_json *json;
+  grpc_json* json;
   grpc_slice buffer;
 };
 
-void grpc_jwt_claims_destroy(grpc_exec_ctx *exec_ctx, grpc_jwt_claims *claims) {
+void grpc_jwt_claims_destroy(grpc_exec_ctx* exec_ctx, grpc_jwt_claims* claims) {
   grpc_json_destroy(claims->json);
   grpc_slice_unref_internal(exec_ctx, claims->buffer);
   gpr_free(claims);
 }
 
-const grpc_json *grpc_jwt_claims_json(const grpc_jwt_claims *claims) {
+const grpc_json* grpc_jwt_claims_json(const grpc_jwt_claims* claims) {
   if (claims == NULL) return NULL;
   return claims->json;
 }
 
-const char *grpc_jwt_claims_subject(const grpc_jwt_claims *claims) {
+const char* grpc_jwt_claims_subject(const grpc_jwt_claims* claims) {
   if (claims == NULL) return NULL;
   return claims->sub;
 }
 
-const char *grpc_jwt_claims_issuer(const grpc_jwt_claims *claims) {
+const char* grpc_jwt_claims_issuer(const grpc_jwt_claims* claims) {
   if (claims == NULL) return NULL;
   return claims->iss;
 }
 
-const char *grpc_jwt_claims_id(const grpc_jwt_claims *claims) {
+const char* grpc_jwt_claims_id(const grpc_jwt_claims* claims) {
   if (claims == NULL) return NULL;
   return claims->jti;
 }
 
-const char *grpc_jwt_claims_audience(const grpc_jwt_claims *claims) {
+const char* grpc_jwt_claims_audience(const grpc_jwt_claims* claims) {
   if (claims == NULL) return NULL;
   return claims->aud;
 }
 
-gpr_timespec grpc_jwt_claims_issued_at(const grpc_jwt_claims *claims) {
+gpr_timespec grpc_jwt_claims_issued_at(const grpc_jwt_claims* claims) {
   if (claims == NULL) return gpr_inf_past(GPR_CLOCK_REALTIME);
   return claims->iat;
 }
 
-gpr_timespec grpc_jwt_claims_expires_at(const grpc_jwt_claims *claims) {
+gpr_timespec grpc_jwt_claims_expires_at(const grpc_jwt_claims* claims) {
   if (claims == NULL) return gpr_inf_future(GPR_CLOCK_REALTIME);
   return claims->exp;
 }
 
-gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims *claims) {
+gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims* claims) {
   if (claims == NULL) return gpr_inf_past(GPR_CLOCK_REALTIME);
   return claims->nbf;
 }
 
 /* Takes ownership of json and buffer even in case of failure. */
-grpc_jwt_claims *grpc_jwt_claims_from_json(grpc_exec_ctx *exec_ctx,
-                                           grpc_json *json, grpc_slice buffer) {
-  grpc_json *cur;
-  grpc_jwt_claims *claims =
-      (grpc_jwt_claims *)gpr_malloc(sizeof(grpc_jwt_claims));
+grpc_jwt_claims* grpc_jwt_claims_from_json(grpc_exec_ctx* exec_ctx,
+                                           grpc_json* json, grpc_slice buffer) {
+  grpc_json* cur;
+  grpc_jwt_claims* claims =
+      (grpc_jwt_claims*)gpr_malloc(sizeof(grpc_jwt_claims));
   memset(claims, 0, sizeof(grpc_jwt_claims));
   claims->json = json;
   claims->buffer = buffer;
@@ -278,8 +278,8 @@
   return NULL;
 }
 
-grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims *claims,
-                                               const char *audience) {
+grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims* claims,
+                                               const char* audience) {
   gpr_timespec skewed_now;
   int audience_ok;
 
@@ -332,26 +332,26 @@
 } http_response_index;
 
 typedef struct {
-  grpc_jwt_verifier *verifier;
+  grpc_jwt_verifier* verifier;
   grpc_polling_entity pollent;
-  jose_header *header;
-  grpc_jwt_claims *claims;
-  char *audience;
+  jose_header* header;
+  grpc_jwt_claims* claims;
+  char* audience;
   grpc_slice signature;
   grpc_slice signed_data;
-  void *user_data;
+  void* user_data;
   grpc_jwt_verification_done_cb user_cb;
   grpc_http_response responses[HTTP_RESPONSE_COUNT];
 } verifier_cb_ctx;
 
 /* Takes ownership of the header, claims and signature. */
-static verifier_cb_ctx *verifier_cb_ctx_create(
-    grpc_jwt_verifier *verifier, grpc_pollset *pollset, jose_header *header,
-    grpc_jwt_claims *claims, const char *audience, grpc_slice signature,
-    const char *signed_jwt, size_t signed_jwt_len, void *user_data,
+static verifier_cb_ctx* verifier_cb_ctx_create(
+    grpc_jwt_verifier* verifier, grpc_pollset* pollset, jose_header* header,
+    grpc_jwt_claims* claims, const char* audience, grpc_slice signature,
+    const char* signed_jwt, size_t signed_jwt_len, void* user_data,
     grpc_jwt_verification_done_cb cb) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  verifier_cb_ctx *ctx = (verifier_cb_ctx *)gpr_zalloc(sizeof(verifier_cb_ctx));
+  verifier_cb_ctx* ctx = (verifier_cb_ctx*)gpr_zalloc(sizeof(verifier_cb_ctx));
   ctx->verifier = verifier;
   ctx->pollent = grpc_polling_entity_create_from_pollset(pollset);
   ctx->header = header;
@@ -365,7 +365,7 @@
   return ctx;
 }
 
-void verifier_cb_ctx_destroy(grpc_exec_ctx *exec_ctx, verifier_cb_ctx *ctx) {
+void verifier_cb_ctx_destroy(grpc_exec_ctx* exec_ctx, verifier_cb_ctx* ctx) {
   if (ctx->audience != NULL) gpr_free(ctx->audience);
   if (ctx->claims != NULL) grpc_jwt_claims_destroy(exec_ctx, ctx->claims);
   grpc_slice_unref_internal(exec_ctx, ctx->signature);
@@ -387,19 +387,19 @@
 grpc_millis grpc_jwt_verifier_max_delay = 60 * GPR_MS_PER_SEC;
 
 typedef struct {
-  char *email_domain;
-  char *key_url_prefix;
+  char* email_domain;
+  char* key_url_prefix;
 } email_key_mapping;
 
 struct grpc_jwt_verifier {
-  email_key_mapping *mappings;
+  email_key_mapping* mappings;
   size_t num_mappings; /* Should be very few, linear search ok. */
   size_t allocated_mappings;
   grpc_httpcli_context http_ctx;
 };
 
-static grpc_json *json_from_http(const grpc_httpcli_response *response) {
-  grpc_json *json = NULL;
+static grpc_json* json_from_http(const grpc_httpcli_response* response) {
+  grpc_json* json = NULL;
 
   if (response == NULL) {
     gpr_log(GPR_ERROR, "HTTP response is NULL.");
@@ -418,19 +418,19 @@
   return json;
 }
 
-static const grpc_json *find_property_by_name(const grpc_json *json,
-                                              const char *name) {
-  const grpc_json *cur;
+static const grpc_json* find_property_by_name(const grpc_json* json,
+                                              const char* name) {
+  const grpc_json* cur;
   for (cur = json->child; cur != NULL; cur = cur->next) {
     if (strcmp(cur->key, name) == 0) return cur;
   }
   return NULL;
 }
 
-static EVP_PKEY *extract_pkey_from_x509(const char *x509_str) {
-  X509 *x509 = NULL;
-  EVP_PKEY *result = NULL;
-  BIO *bio = BIO_new(BIO_s_mem());
+static EVP_PKEY* extract_pkey_from_x509(const char* x509_str) {
+  X509* x509 = NULL;
+  EVP_PKEY* result = NULL;
+  BIO* bio = BIO_new(BIO_s_mem());
   size_t len = strlen(x509_str);
   GPR_ASSERT(len < INT_MAX);
   BIO_write(bio, x509_str, (int)len);
@@ -450,8 +450,8 @@
   return result;
 }
 
-static BIGNUM *bignum_from_base64(grpc_exec_ctx *exec_ctx, const char *b64) {
-  BIGNUM *result = NULL;
+static BIGNUM* bignum_from_base64(grpc_exec_ctx* exec_ctx, const char* b64) {
+  BIGNUM* result = NULL;
   grpc_slice bin;
 
   if (b64 == NULL) return NULL;
@@ -469,7 +469,7 @@
 #if OPENSSL_VERSION_NUMBER < 0x10100000L
 
 // Provide compatibility across OpenSSL 1.02 and 1.1.
-static int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) {
+static int RSA_set0_key(RSA* r, BIGNUM* n, BIGNUM* e, BIGNUM* d) {
   /* If the fields n and e in r are NULL, the corresponding input
    * parameters MUST be non-NULL for n and e.  d may be
    * left NULL (in case only the public key is used).
@@ -495,13 +495,13 @@
 }
 #endif  // OPENSSL_VERSION_NUMBER < 0x10100000L
 
-static EVP_PKEY *pkey_from_jwk(grpc_exec_ctx *exec_ctx, const grpc_json *json,
-                               const char *kty) {
-  const grpc_json *key_prop;
-  RSA *rsa = NULL;
-  EVP_PKEY *result = NULL;
-  BIGNUM *tmp_n = NULL;
-  BIGNUM *tmp_e = NULL;
+static EVP_PKEY* pkey_from_jwk(grpc_exec_ctx* exec_ctx, const grpc_json* json,
+                               const char* kty) {
+  const grpc_json* key_prop;
+  RSA* rsa = NULL;
+  EVP_PKEY* result = NULL;
+  BIGNUM* tmp_n = NULL;
+  BIGNUM* tmp_e = NULL;
 
   GPR_ASSERT(kty != NULL && json != NULL);
   if (strcmp(kty, "RSA") != 0) {
@@ -545,19 +545,19 @@
   return result;
 }
 
-static EVP_PKEY *find_verification_key(grpc_exec_ctx *exec_ctx,
-                                       const grpc_json *json,
-                                       const char *header_alg,
-                                       const char *header_kid) {
-  const grpc_json *jkey;
-  const grpc_json *jwk_keys;
+static EVP_PKEY* find_verification_key(grpc_exec_ctx* exec_ctx,
+                                       const grpc_json* json,
+                                       const char* header_alg,
+                                       const char* header_kid) {
+  const grpc_json* jkey;
+  const grpc_json* jwk_keys;
   /* Try to parse the json as a JWK set:
      https://tools.ietf.org/html/rfc7517#section-5. */
   jwk_keys = find_property_by_name(json, "keys");
   if (jwk_keys == NULL) {
     /* Use the google proprietary format which is:
        { <kid1>: <x5091>, <kid2>: <x5092>, ... } */
-    const grpc_json *cur = find_property_by_name(json, header_kid);
+    const grpc_json* cur = find_property_by_name(json, header_kid);
     if (cur == NULL) return NULL;
     return extract_pkey_from_x509(cur->value);
   }
@@ -570,10 +570,10 @@
   /* Key format is specified in:
      https://tools.ietf.org/html/rfc7518#section-6. */
   for (jkey = jwk_keys->child; jkey != NULL; jkey = jkey->next) {
-    grpc_json *key_prop;
-    const char *alg = NULL;
-    const char *kid = NULL;
-    const char *kty = NULL;
+    grpc_json* key_prop;
+    const char* alg = NULL;
+    const char* kid = NULL;
+    const char* kty = NULL;
 
     if (jkey->type != GRPC_JSON_OBJECT) continue;
     for (key_prop = jkey->child; key_prop != NULL; key_prop = key_prop->next) {
@@ -599,10 +599,10 @@
   return NULL;
 }
 
-static int verify_jwt_signature(EVP_PKEY *key, const char *alg,
+static int verify_jwt_signature(EVP_PKEY* key, const char* alg,
                                 grpc_slice signature, grpc_slice signed_data) {
-  EVP_MD_CTX *md_ctx = EVP_MD_CTX_create();
-  const EVP_MD *md = evp_md_from_alg(alg);
+  EVP_MD_CTX* md_ctx = EVP_MD_CTX_create();
+  const EVP_MD* md = evp_md_from_alg(alg);
   int result = 0;
 
   GPR_ASSERT(md != NULL); /* Checked before. */
@@ -631,13 +631,13 @@
   return result;
 }
 
-static void on_keys_retrieved(grpc_exec_ctx *exec_ctx, void *user_data,
-                              grpc_error *error) {
-  verifier_cb_ctx *ctx = (verifier_cb_ctx *)user_data;
-  grpc_json *json = json_from_http(&ctx->responses[HTTP_RESPONSE_KEYS]);
-  EVP_PKEY *verification_key = NULL;
+static void on_keys_retrieved(grpc_exec_ctx* exec_ctx, void* user_data,
+                              grpc_error* error) {
+  verifier_cb_ctx* ctx = (verifier_cb_ctx*)user_data;
+  grpc_json* json = json_from_http(&ctx->responses[HTTP_RESPONSE_KEYS]);
+  EVP_PKEY* verification_key = NULL;
   grpc_jwt_verifier_status status = GRPC_JWT_VERIFIER_GENERIC_ERROR;
-  grpc_jwt_claims *claims = NULL;
+  grpc_jwt_claims* claims = NULL;
 
   if (json == NULL) {
     status = GRPC_JWT_VERIFIER_KEY_RETRIEVAL_ERROR;
@@ -672,15 +672,15 @@
   verifier_cb_ctx_destroy(exec_ctx, ctx);
 }
 
-static void on_openid_config_retrieved(grpc_exec_ctx *exec_ctx, void *user_data,
-                                       grpc_error *error) {
-  const grpc_json *cur;
-  verifier_cb_ctx *ctx = (verifier_cb_ctx *)user_data;
-  const grpc_http_response *response = &ctx->responses[HTTP_RESPONSE_OPENID];
-  grpc_json *json = json_from_http(response);
+static void on_openid_config_retrieved(grpc_exec_ctx* exec_ctx, void* user_data,
+                                       grpc_error* error) {
+  const grpc_json* cur;
+  verifier_cb_ctx* ctx = (verifier_cb_ctx*)user_data;
+  const grpc_http_response* response = &ctx->responses[HTTP_RESPONSE_OPENID];
+  grpc_json* json = json_from_http(response);
   grpc_httpcli_request req;
-  const char *jwks_uri;
-  grpc_resource_quota *resource_quota = NULL;
+  const char* jwks_uri;
+  grpc_resource_quota* resource_quota = NULL;
 
   /* TODO(jboeuf): Cache the jwks_uri in order to avoid this hop next time. */
   if (json == NULL) goto error;
@@ -698,9 +698,9 @@
   jwks_uri += 8;
   req.handshaker = &grpc_httpcli_ssl;
   req.host = gpr_strdup(jwks_uri);
-  req.http.path = (char *)strchr(jwks_uri, '/');
+  req.http.path = (char*)strchr(jwks_uri, '/');
   if (req.http.path == NULL) {
-    req.http.path = (char *)"";
+    req.http.path = (char*)"";
   } else {
     *(req.host + (req.http.path - jwks_uri)) = '\0';
   }
@@ -726,8 +726,8 @@
   verifier_cb_ctx_destroy(exec_ctx, ctx);
 }
 
-static email_key_mapping *verifier_get_mapping(grpc_jwt_verifier *v,
-                                               const char *email_domain) {
+static email_key_mapping* verifier_get_mapping(grpc_jwt_verifier* v,
+                                               const char* email_domain) {
   size_t i;
   if (v->mappings == NULL) return NULL;
   for (i = 0; i < v->num_mappings; i++) {
@@ -738,9 +738,9 @@
   return NULL;
 }
 
-static void verifier_put_mapping(grpc_jwt_verifier *v, const char *email_domain,
-                                 const char *key_url_prefix) {
-  email_key_mapping *mapping = verifier_get_mapping(v, email_domain);
+static void verifier_put_mapping(grpc_jwt_verifier* v, const char* email_domain,
+                                 const char* key_url_prefix) {
+  email_key_mapping* mapping = verifier_get_mapping(v, email_domain);
   GPR_ASSERT(v->num_mappings < v->allocated_mappings);
   if (mapping != NULL) {
     gpr_free(mapping->key_url_prefix);
@@ -755,30 +755,30 @@
 
 /* Very non-sophisticated way to detect an email address. Should be good
    enough for now... */
-const char *grpc_jwt_issuer_email_domain(const char *issuer) {
-  const char *at_sign = strchr(issuer, '@');
+const char* grpc_jwt_issuer_email_domain(const char* issuer) {
+  const char* at_sign = strchr(issuer, '@');
   if (at_sign == NULL) return NULL;
-  const char *email_domain = at_sign + 1;
+  const char* email_domain = at_sign + 1;
   if (*email_domain == '\0') return NULL;
-  const char *dot = strrchr(email_domain, '.');
+  const char* dot = strrchr(email_domain, '.');
   if (dot == NULL || dot == email_domain) return email_domain;
   GPR_ASSERT(dot > email_domain);
   /* There may be a subdomain, we just want the domain. */
-  dot = (const char *)gpr_memrchr((void *)email_domain, '.',
-                                  (size_t)(dot - email_domain));
+  dot = (const char*)gpr_memrchr((void*)email_domain, '.',
+                                 (size_t)(dot - email_domain));
   if (dot == NULL) return email_domain;
   return dot + 1;
 }
 
 /* Takes ownership of ctx. */
-static void retrieve_key_and_verify(grpc_exec_ctx *exec_ctx,
-                                    verifier_cb_ctx *ctx) {
-  const char *email_domain;
-  grpc_closure *http_cb;
-  char *path_prefix = NULL;
-  const char *iss;
+static void retrieve_key_and_verify(grpc_exec_ctx* exec_ctx,
+                                    verifier_cb_ctx* ctx) {
+  const char* email_domain;
+  grpc_closure* http_cb;
+  char* path_prefix = NULL;
+  const char* iss;
   grpc_httpcli_request req;
-  grpc_resource_quota *resource_quota = NULL;
+  grpc_resource_quota* resource_quota = NULL;
   memset(&req, 0, sizeof(grpc_httpcli_request));
   req.handshaker = &grpc_httpcli_ssl;
   http_response_index rsp_idx;
@@ -801,7 +801,7 @@
      Part 4, on the other hand is implemented by both google and salesforce. */
   email_domain = grpc_jwt_issuer_email_domain(iss);
   if (email_domain != NULL) {
-    email_key_mapping *mapping;
+    email_key_mapping* mapping;
     GPR_ASSERT(ctx->verifier != NULL);
     mapping = verifier_get_mapping(ctx->verifier, email_domain);
     if (mapping == NULL) {
@@ -853,21 +853,21 @@
   verifier_cb_ctx_destroy(exec_ctx, ctx);
 }
 
-void grpc_jwt_verifier_verify(grpc_exec_ctx *exec_ctx,
-                              grpc_jwt_verifier *verifier,
-                              grpc_pollset *pollset, const char *jwt,
-                              const char *audience,
+void grpc_jwt_verifier_verify(grpc_exec_ctx* exec_ctx,
+                              grpc_jwt_verifier* verifier,
+                              grpc_pollset* pollset, const char* jwt,
+                              const char* audience,
                               grpc_jwt_verification_done_cb cb,
-                              void *user_data) {
-  const char *dot = NULL;
-  grpc_json *json;
-  jose_header *header = NULL;
-  grpc_jwt_claims *claims = NULL;
+                              void* user_data) {
+  const char* dot = NULL;
+  grpc_json* json;
+  jose_header* header = NULL;
+  grpc_jwt_claims* claims = NULL;
   grpc_slice header_buffer;
   grpc_slice claims_buffer;
   grpc_slice signature;
   size_t signed_jwt_len;
-  const char *cur = jwt;
+  const char* cur = jwt;
 
   GPR_ASSERT(verifier != NULL && jwt != NULL && audience != NULL && cb != NULL);
   dot = strchr(cur, '.');
@@ -903,17 +903,17 @@
   cb(exec_ctx, user_data, GRPC_JWT_VERIFIER_BAD_FORMAT, NULL);
 }
 
-grpc_jwt_verifier *grpc_jwt_verifier_create(
-    const grpc_jwt_verifier_email_domain_key_url_mapping *mappings,
+grpc_jwt_verifier* grpc_jwt_verifier_create(
+    const grpc_jwt_verifier_email_domain_key_url_mapping* mappings,
     size_t num_mappings) {
-  grpc_jwt_verifier *v =
-      (grpc_jwt_verifier *)gpr_zalloc(sizeof(grpc_jwt_verifier));
+  grpc_jwt_verifier* v =
+      (grpc_jwt_verifier*)gpr_zalloc(sizeof(grpc_jwt_verifier));
   grpc_httpcli_context_init(&v->http_ctx);
 
   /* We know at least of one mapping. */
   v->allocated_mappings = 1 + num_mappings;
-  v->mappings = (email_key_mapping *)gpr_malloc(v->allocated_mappings *
-                                                sizeof(email_key_mapping));
+  v->mappings = (email_key_mapping*)gpr_malloc(v->allocated_mappings *
+                                               sizeof(email_key_mapping));
   verifier_put_mapping(v, GRPC_GOOGLE_SERVICE_ACCOUNTS_EMAIL_DOMAIN,
                        GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX);
   /* User-Provided mappings. */
@@ -927,7 +927,7 @@
   return v;
 }
 
-void grpc_jwt_verifier_destroy(grpc_exec_ctx *exec_ctx, grpc_jwt_verifier *v) {
+void grpc_jwt_verifier_destroy(grpc_exec_ctx* exec_ctx, grpc_jwt_verifier* v) {
   size_t i;
   if (v == NULL) return;
   grpc_httpcli_context_destroy(exec_ctx, &v->http_ctx);
diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.h b/src/core/lib/security/credentials/jwt/jwt_verifier.h
index 998365e..8083cf9 100644
--- a/src/core/lib/security/credentials/jwt/jwt_verifier.h
+++ b/src/core/lib/security/credentials/jwt/jwt_verifier.h
@@ -49,25 +49,25 @@
   GRPC_JWT_VERIFIER_GENERIC_ERROR
 } grpc_jwt_verifier_status;
 
-const char *grpc_jwt_verifier_status_to_string(grpc_jwt_verifier_status status);
+const char* grpc_jwt_verifier_status_to_string(grpc_jwt_verifier_status status);
 
 /* --- grpc_jwt_claims. --- */
 
 typedef struct grpc_jwt_claims grpc_jwt_claims;
 
-void grpc_jwt_claims_destroy(grpc_exec_ctx *exec_ctx, grpc_jwt_claims *claims);
+void grpc_jwt_claims_destroy(grpc_exec_ctx* exec_ctx, grpc_jwt_claims* claims);
 
 /* Returns the whole JSON tree of the claims. */
-const grpc_json *grpc_jwt_claims_json(const grpc_jwt_claims *claims);
+const grpc_json* grpc_jwt_claims_json(const grpc_jwt_claims* claims);
 
 /* Access to registered claims in https://tools.ietf.org/html/rfc7519#page-9 */
-const char *grpc_jwt_claims_subject(const grpc_jwt_claims *claims);
-const char *grpc_jwt_claims_issuer(const grpc_jwt_claims *claims);
-const char *grpc_jwt_claims_id(const grpc_jwt_claims *claims);
-const char *grpc_jwt_claims_audience(const grpc_jwt_claims *claims);
-gpr_timespec grpc_jwt_claims_issued_at(const grpc_jwt_claims *claims);
-gpr_timespec grpc_jwt_claims_expires_at(const grpc_jwt_claims *claims);
-gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims *claims);
+const char* grpc_jwt_claims_subject(const grpc_jwt_claims* claims);
+const char* grpc_jwt_claims_issuer(const grpc_jwt_claims* claims);
+const char* grpc_jwt_claims_id(const grpc_jwt_claims* claims);
+const char* grpc_jwt_claims_audience(const grpc_jwt_claims* claims);
+gpr_timespec grpc_jwt_claims_issued_at(const grpc_jwt_claims* claims);
+gpr_timespec grpc_jwt_claims_expires_at(const grpc_jwt_claims* claims);
+gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims* claims);
 
 /* --- grpc_jwt_verifier. --- */
 
@@ -75,12 +75,12 @@
 
 typedef struct {
   /* The email domain is the part after the @ sign. */
-  const char *email_domain;
+  const char* email_domain;
 
   /* The key url prefix will be used to get the public key from the issuer:
      https://<key_url_prefix>/<issuer_email>
      Therefore the key_url_prefix must NOT contain https://. */
-  const char *key_url_prefix;
+  const char* key_url_prefix;
 } grpc_jwt_verifier_email_domain_key_url_mapping;
 
 /* Globals to control the verifier. Not thread-safe. */
@@ -93,38 +93,38 @@
    A verifier object has one built-in mapping (unless overridden):
    GRPC_GOOGLE_SERVICE_ACCOUNTS_EMAIL_DOMAIN ->
    GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX.*/
-grpc_jwt_verifier *grpc_jwt_verifier_create(
-    const grpc_jwt_verifier_email_domain_key_url_mapping *mappings,
+grpc_jwt_verifier* grpc_jwt_verifier_create(
+    const grpc_jwt_verifier_email_domain_key_url_mapping* mappings,
     size_t num_mappings);
 
 /*The verifier must not be destroyed if there are still outstanding callbacks.*/
-void grpc_jwt_verifier_destroy(grpc_exec_ctx *exec_ctx,
-                               grpc_jwt_verifier *verifier);
+void grpc_jwt_verifier_destroy(grpc_exec_ctx* exec_ctx,
+                               grpc_jwt_verifier* verifier);
 
 /* User provided callback that will be called when the verification of the JWT
    is done (maybe in another thread).
    It is the responsibility of the callee to call grpc_jwt_claims_destroy on
    the claims. */
-typedef void (*grpc_jwt_verification_done_cb)(grpc_exec_ctx *exec_ctx,
-                                              void *user_data,
+typedef void (*grpc_jwt_verification_done_cb)(grpc_exec_ctx* exec_ctx,
+                                              void* user_data,
                                               grpc_jwt_verifier_status status,
-                                              grpc_jwt_claims *claims);
+                                              grpc_jwt_claims* claims);
 
 /* Verifies for the JWT for the given expected audience. */
-void grpc_jwt_verifier_verify(grpc_exec_ctx *exec_ctx,
-                              grpc_jwt_verifier *verifier,
-                              grpc_pollset *pollset, const char *jwt,
-                              const char *audience,
+void grpc_jwt_verifier_verify(grpc_exec_ctx* exec_ctx,
+                              grpc_jwt_verifier* verifier,
+                              grpc_pollset* pollset, const char* jwt,
+                              const char* audience,
                               grpc_jwt_verification_done_cb cb,
-                              void *user_data);
+                              void* user_data);
 
 /* --- TESTING ONLY exposed functions. --- */
 
-grpc_jwt_claims *grpc_jwt_claims_from_json(grpc_exec_ctx *exec_ctx,
-                                           grpc_json *json, grpc_slice buffer);
-grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims *claims,
-                                               const char *audience);
-const char *grpc_jwt_issuer_email_domain(const char *issuer);
+grpc_jwt_claims* grpc_jwt_claims_from_json(grpc_exec_ctx* exec_ctx,
+                                           grpc_json* json, grpc_slice buffer);
+grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims* claims,
+                                               const char* audience);
+const char* grpc_jwt_issuer_email_domain(const char* issuer);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
index e58f4ee..ef44a80 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
@@ -32,15 +32,15 @@
 //
 
 int grpc_auth_refresh_token_is_valid(
-    const grpc_auth_refresh_token *refresh_token) {
+    const grpc_auth_refresh_token* refresh_token) {
   return (refresh_token != NULL) &&
          strcmp(refresh_token->type, GRPC_AUTH_JSON_TYPE_INVALID);
 }
 
 grpc_auth_refresh_token grpc_auth_refresh_token_create_from_json(
-    const grpc_json *json) {
+    const grpc_json* json) {
   grpc_auth_refresh_token result;
-  const char *prop_value;
+  const char* prop_value;
   int success = 0;
 
   memset(&result, 0, sizeof(grpc_auth_refresh_token));
@@ -72,9 +72,9 @@
 }
 
 grpc_auth_refresh_token grpc_auth_refresh_token_create_from_string(
-    const char *json_string) {
-  char *scratchpad = gpr_strdup(json_string);
-  grpc_json *json = grpc_json_parse_string(scratchpad);
+    const char* json_string) {
+  char* scratchpad = gpr_strdup(json_string);
+  grpc_json* json = grpc_json_parse_string(scratchpad);
   grpc_auth_refresh_token result =
       grpc_auth_refresh_token_create_from_json(json);
   if (json != NULL) grpc_json_destroy(json);
@@ -82,7 +82,7 @@
   return result;
 }
 
-void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token *refresh_token) {
+void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token* refresh_token) {
   if (refresh_token == NULL) return;
   refresh_token->type = GRPC_AUTH_JSON_TYPE_INVALID;
   if (refresh_token->client_id != NULL) {
@@ -103,10 +103,10 @@
 // Oauth2 Token Fetcher credentials.
 //
 
-static void oauth2_token_fetcher_destruct(grpc_exec_ctx *exec_ctx,
-                                          grpc_call_credentials *creds) {
-  grpc_oauth2_token_fetcher_credentials *c =
-      (grpc_oauth2_token_fetcher_credentials *)creds;
+static void oauth2_token_fetcher_destruct(grpc_exec_ctx* exec_ctx,
+                                          grpc_call_credentials* creds) {
+  grpc_oauth2_token_fetcher_credentials* c =
+      (grpc_oauth2_token_fetcher_credentials*)creds;
   GRPC_MDELEM_UNREF(exec_ctx, c->access_token_md);
   gpr_mu_destroy(&c->mu);
   grpc_pollset_set_destroy(exec_ctx,
@@ -116,12 +116,12 @@
 
 grpc_credentials_status
 grpc_oauth2_token_fetcher_credentials_parse_server_response(
-    grpc_exec_ctx *exec_ctx, const grpc_http_response *response,
-    grpc_mdelem *token_md, grpc_millis *token_lifetime) {
-  char *null_terminated_body = NULL;
-  char *new_access_token = NULL;
+    grpc_exec_ctx* exec_ctx, const grpc_http_response* response,
+    grpc_mdelem* token_md, grpc_millis* token_lifetime) {
+  char* null_terminated_body = NULL;
+  char* new_access_token = NULL;
   grpc_credentials_status status = GRPC_CREDENTIALS_OK;
-  grpc_json *json = NULL;
+  grpc_json* json = NULL;
 
   if (response == NULL) {
     gpr_log(GPR_ERROR, "Received NULL response.");
@@ -130,7 +130,7 @@
   }
 
   if (response->body_length > 0) {
-    null_terminated_body = (char *)gpr_malloc(response->body_length + 1);
+    null_terminated_body = (char*)gpr_malloc(response->body_length + 1);
     null_terminated_body[response->body_length] = '\0';
     memcpy(null_terminated_body, response->body, response->body_length);
   }
@@ -142,10 +142,10 @@
     status = GRPC_CREDENTIALS_ERROR;
     goto end;
   } else {
-    grpc_json *access_token = NULL;
-    grpc_json *token_type = NULL;
-    grpc_json *expires_in = NULL;
-    grpc_json *ptr;
+    grpc_json* access_token = NULL;
+    grpc_json* token_type = NULL;
+    grpc_json* expires_in = NULL;
+    grpc_json* ptr;
     json = grpc_json_parse_string(null_terminated_body);
     if (json == NULL) {
       gpr_log(GPR_ERROR, "Could not parse JSON from %s", null_terminated_body);
@@ -203,14 +203,14 @@
   return status;
 }
 
-static void on_oauth2_token_fetcher_http_response(grpc_exec_ctx *exec_ctx,
-                                                  void *user_data,
-                                                  grpc_error *error) {
+static void on_oauth2_token_fetcher_http_response(grpc_exec_ctx* exec_ctx,
+                                                  void* user_data,
+                                                  grpc_error* error) {
   GRPC_LOG_IF_ERROR("oauth_fetch", GRPC_ERROR_REF(error));
-  grpc_credentials_metadata_request *r =
-      (grpc_credentials_metadata_request *)user_data;
-  grpc_oauth2_token_fetcher_credentials *c =
-      (grpc_oauth2_token_fetcher_credentials *)r->creds;
+  grpc_credentials_metadata_request* r =
+      (grpc_credentials_metadata_request*)user_data;
+  grpc_oauth2_token_fetcher_credentials* c =
+      (grpc_oauth2_token_fetcher_credentials*)r->creds;
   grpc_mdelem access_token_md = GRPC_MDNULL;
   grpc_millis token_lifetime;
   grpc_credentials_status status =
@@ -223,7 +223,7 @@
   c->token_expiration = status == GRPC_CREDENTIALS_OK
                             ? grpc_exec_ctx_now(exec_ctx) + token_lifetime
                             : 0;
-  grpc_oauth2_pending_get_request_metadata *pending_request =
+  grpc_oauth2_pending_get_request_metadata* pending_request =
       c->pending_requests;
   c->pending_requests = NULL;
   gpr_mu_unlock(&c->mu);
@@ -240,7 +240,7 @@
     grpc_polling_entity_del_from_pollset_set(
         exec_ctx, pending_request->pollent,
         grpc_polling_entity_pollset_set(&c->pollent));
-    grpc_oauth2_pending_get_request_metadata *prev = pending_request;
+    grpc_oauth2_pending_get_request_metadata* prev = pending_request;
     pending_request = pending_request->next;
     gpr_free(prev);
   }
@@ -250,12 +250,12 @@
 }
 
 static bool oauth2_token_fetcher_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_polling_entity *pollent, grpc_auth_metadata_context context,
-    grpc_credentials_mdelem_array *md_array, grpc_closure *on_request_metadata,
-    grpc_error **error) {
-  grpc_oauth2_token_fetcher_credentials *c =
-      (grpc_oauth2_token_fetcher_credentials *)creds;
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_polling_entity* pollent, grpc_auth_metadata_context context,
+    grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
+    grpc_error** error) {
+  grpc_oauth2_token_fetcher_credentials* c =
+      (grpc_oauth2_token_fetcher_credentials*)creds;
   // Check if we can use the cached token.
   grpc_millis refresh_threshold =
       GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS * GPR_MS_PER_SEC;
@@ -273,8 +273,8 @@
   }
   // Couldn't get the token from the cache.
   // Add request to c->pending_requests and start a new fetch if needed.
-  grpc_oauth2_pending_get_request_metadata *pending_request =
-      (grpc_oauth2_pending_get_request_metadata *)gpr_malloc(
+  grpc_oauth2_pending_get_request_metadata* pending_request =
+      (grpc_oauth2_pending_get_request_metadata*)gpr_malloc(
           sizeof(*pending_request));
   pending_request->md_array = md_array;
   pending_request->on_request_metadata = on_request_metadata;
@@ -300,13 +300,13 @@
 }
 
 static void oauth2_token_fetcher_cancel_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_credentials_mdelem_array *md_array, grpc_error *error) {
-  grpc_oauth2_token_fetcher_credentials *c =
-      (grpc_oauth2_token_fetcher_credentials *)creds;
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_credentials_mdelem_array* md_array, grpc_error* error) {
+  grpc_oauth2_token_fetcher_credentials* c =
+      (grpc_oauth2_token_fetcher_credentials*)creds;
   gpr_mu_lock(&c->mu);
-  grpc_oauth2_pending_get_request_metadata *prev = NULL;
-  grpc_oauth2_pending_get_request_metadata *pending_request =
+  grpc_oauth2_pending_get_request_metadata* prev = NULL;
+  grpc_oauth2_pending_get_request_metadata* pending_request =
       c->pending_requests;
   while (pending_request != NULL) {
     if (pending_request->md_array == md_array) {
@@ -329,7 +329,7 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void init_oauth2_token_fetcher(grpc_oauth2_token_fetcher_credentials *c,
+static void init_oauth2_token_fetcher(grpc_oauth2_token_fetcher_credentials* c,
                                       grpc_fetch_oauth2_func fetch_func) {
   memset(c, 0, sizeof(grpc_oauth2_token_fetcher_credentials));
   c->base.type = GRPC_CALL_CREDENTIALS_TYPE_OAUTH2;
@@ -351,20 +351,20 @@
     oauth2_token_fetcher_cancel_get_request_metadata};
 
 static void compute_engine_fetch_oauth2(
-    grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *metadata_req,
-    grpc_httpcli_context *httpcli_context, grpc_polling_entity *pollent,
+    grpc_exec_ctx* exec_ctx, grpc_credentials_metadata_request* metadata_req,
+    grpc_httpcli_context* httpcli_context, grpc_polling_entity* pollent,
     grpc_iomgr_cb_func response_cb, grpc_millis deadline) {
-  grpc_http_header header = {(char *)"Metadata-Flavor", (char *)"Google"};
+  grpc_http_header header = {(char*)"Metadata-Flavor", (char*)"Google"};
   grpc_httpcli_request request;
   memset(&request, 0, sizeof(grpc_httpcli_request));
-  request.host = (char *)GRPC_COMPUTE_ENGINE_METADATA_HOST;
-  request.http.path = (char *)GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH;
+  request.host = (char*)GRPC_COMPUTE_ENGINE_METADATA_HOST;
+  request.http.path = (char*)GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH;
   request.http.hdr_count = 1;
   request.http.hdrs = &header;
   /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
      channel. This would allow us to cancel an authentication query when under
      extreme memory pressure. */
-  grpc_resource_quota *resource_quota =
+  grpc_resource_quota* resource_quota =
       grpc_resource_quota_create("oauth2_credentials");
   grpc_httpcli_get(
       exec_ctx, httpcli_context, pollent, resource_quota, &request, deadline,
@@ -373,10 +373,10 @@
   grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
 }
 
-grpc_call_credentials *grpc_google_compute_engine_credentials_create(
-    void *reserved) {
-  grpc_oauth2_token_fetcher_credentials *c =
-      (grpc_oauth2_token_fetcher_credentials *)gpr_malloc(
+grpc_call_credentials* grpc_google_compute_engine_credentials_create(
+    void* reserved) {
+  grpc_oauth2_token_fetcher_credentials* c =
+      (grpc_oauth2_token_fetcher_credentials*)gpr_malloc(
           sizeof(grpc_oauth2_token_fetcher_credentials));
   GRPC_API_TRACE("grpc_compute_engine_credentials_create(reserved=%p)", 1,
                  (reserved));
@@ -390,10 +390,10 @@
 // Google Refresh Token credentials.
 //
 
-static void refresh_token_destruct(grpc_exec_ctx *exec_ctx,
-                                   grpc_call_credentials *creds) {
-  grpc_google_refresh_token_credentials *c =
-      (grpc_google_refresh_token_credentials *)creds;
+static void refresh_token_destruct(grpc_exec_ctx* exec_ctx,
+                                   grpc_call_credentials* creds) {
+  grpc_google_refresh_token_credentials* c =
+      (grpc_google_refresh_token_credentials*)creds;
   grpc_auth_refresh_token_destruct(&c->refresh_token);
   oauth2_token_fetcher_destruct(exec_ctx, &c->base.base);
 }
@@ -403,28 +403,28 @@
     oauth2_token_fetcher_cancel_get_request_metadata};
 
 static void refresh_token_fetch_oauth2(
-    grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *metadata_req,
-    grpc_httpcli_context *httpcli_context, grpc_polling_entity *pollent,
+    grpc_exec_ctx* exec_ctx, grpc_credentials_metadata_request* metadata_req,
+    grpc_httpcli_context* httpcli_context, grpc_polling_entity* pollent,
     grpc_iomgr_cb_func response_cb, grpc_millis deadline) {
-  grpc_google_refresh_token_credentials *c =
-      (grpc_google_refresh_token_credentials *)metadata_req->creds;
-  grpc_http_header header = {(char *)"Content-Type",
-                             (char *)"application/x-www-form-urlencoded"};
+  grpc_google_refresh_token_credentials* c =
+      (grpc_google_refresh_token_credentials*)metadata_req->creds;
+  grpc_http_header header = {(char*)"Content-Type",
+                             (char*)"application/x-www-form-urlencoded"};
   grpc_httpcli_request request;
-  char *body = NULL;
+  char* body = NULL;
   gpr_asprintf(&body, GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING,
                c->refresh_token.client_id, c->refresh_token.client_secret,
                c->refresh_token.refresh_token);
   memset(&request, 0, sizeof(grpc_httpcli_request));
-  request.host = (char *)GRPC_GOOGLE_OAUTH2_SERVICE_HOST;
-  request.http.path = (char *)GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH;
+  request.host = (char*)GRPC_GOOGLE_OAUTH2_SERVICE_HOST;
+  request.http.path = (char*)GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH;
   request.http.hdr_count = 1;
   request.http.hdrs = &header;
   request.handshaker = &grpc_httpcli_ssl;
   /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
      channel. This would allow us to cancel an authentication query when under
      extreme memory pressure. */
-  grpc_resource_quota *resource_quota =
+  grpc_resource_quota* resource_quota =
       grpc_resource_quota_create("oauth2_credentials_refresh");
   grpc_httpcli_post(
       exec_ctx, httpcli_context, pollent, resource_quota, &request, body,
@@ -435,15 +435,15 @@
   gpr_free(body);
 }
 
-grpc_call_credentials *
+grpc_call_credentials*
 grpc_refresh_token_credentials_create_from_auth_refresh_token(
     grpc_auth_refresh_token refresh_token) {
-  grpc_google_refresh_token_credentials *c;
+  grpc_google_refresh_token_credentials* c;
   if (!grpc_auth_refresh_token_is_valid(&refresh_token)) {
     gpr_log(GPR_ERROR, "Invalid input for refresh token credentials creation");
     return NULL;
   }
-  c = (grpc_google_refresh_token_credentials *)gpr_zalloc(
+  c = (grpc_google_refresh_token_credentials*)gpr_zalloc(
       sizeof(grpc_google_refresh_token_credentials));
   init_oauth2_token_fetcher(&c->base, refresh_token_fetch_oauth2);
   c->base.base.vtable = &refresh_token_vtable;
@@ -451,11 +451,11 @@
   return &c->base.base;
 }
 
-static char *create_loggable_refresh_token(grpc_auth_refresh_token *token) {
+static char* create_loggable_refresh_token(grpc_auth_refresh_token* token) {
   if (strcmp(token->type, GRPC_AUTH_JSON_TYPE_INVALID) == 0) {
     return gpr_strdup("<Invalid json token>");
   }
-  char *loggable_token = NULL;
+  char* loggable_token = NULL;
   gpr_asprintf(&loggable_token,
                "{\n type: %s\n client_id: %s\n client_secret: "
                "<redacted>\n refresh_token: <redacted>\n}",
@@ -463,12 +463,12 @@
   return loggable_token;
 }
 
-grpc_call_credentials *grpc_google_refresh_token_credentials_create(
-    const char *json_refresh_token, void *reserved) {
+grpc_call_credentials* grpc_google_refresh_token_credentials_create(
+    const char* json_refresh_token, void* reserved) {
   grpc_auth_refresh_token token =
       grpc_auth_refresh_token_create_from_string(json_refresh_token);
   if (grpc_api_trace.enabled()) {
-    char *loggable_token = create_loggable_refresh_token(&token);
+    char* loggable_token = create_loggable_refresh_token(&token);
     gpr_log(GPR_INFO,
             "grpc_refresh_token_credentials_create(json_refresh_token=%s, "
             "reserved=%p)",
@@ -483,25 +483,25 @@
 // Oauth2 Access Token credentials.
 //
 
-static void access_token_destruct(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_credentials *creds) {
-  grpc_access_token_credentials *c = (grpc_access_token_credentials *)creds;
+static void access_token_destruct(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_credentials* creds) {
+  grpc_access_token_credentials* c = (grpc_access_token_credentials*)creds;
   GRPC_MDELEM_UNREF(exec_ctx, c->access_token_md);
 }
 
 static bool access_token_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_polling_entity *pollent, grpc_auth_metadata_context context,
-    grpc_credentials_mdelem_array *md_array, grpc_closure *on_request_metadata,
-    grpc_error **error) {
-  grpc_access_token_credentials *c = (grpc_access_token_credentials *)creds;
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_polling_entity* pollent, grpc_auth_metadata_context context,
+    grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
+    grpc_error** error) {
+  grpc_access_token_credentials* c = (grpc_access_token_credentials*)creds;
   grpc_credentials_mdelem_array_add(md_array, c->access_token_md);
   return true;
 }
 
 static void access_token_cancel_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *c,
-    grpc_credentials_mdelem_array *md_array, grpc_error *error) {
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* c,
+    grpc_credentials_mdelem_array* md_array, grpc_error* error) {
   GRPC_ERROR_UNREF(error);
 }
 
@@ -509,11 +509,10 @@
     access_token_destruct, access_token_get_request_metadata,
     access_token_cancel_get_request_metadata};
 
-grpc_call_credentials *grpc_access_token_credentials_create(
-    const char *access_token, void *reserved) {
-  grpc_access_token_credentials *c =
-      (grpc_access_token_credentials *)gpr_zalloc(
-          sizeof(grpc_access_token_credentials));
+grpc_call_credentials* grpc_access_token_credentials_create(
+    const char* access_token, void* reserved) {
+  grpc_access_token_credentials* c = (grpc_access_token_credentials*)gpr_zalloc(
+      sizeof(grpc_access_token_credentials));
   GRPC_API_TRACE(
       "grpc_access_token_credentials_create(access_token=<redacted>, "
       "reserved=%p)",
@@ -522,7 +521,7 @@
   c->base.type = GRPC_CALL_CREDENTIALS_TYPE_OAUTH2;
   c->base.vtable = &access_token_vtable;
   gpr_ref_init(&c->base.refcount, 1);
-  char *token_md_value;
+  char* token_md_value;
   gpr_asprintf(&token_md_value, "Bearer %s", access_token);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   c->access_token_md = grpc_mdelem_from_slices(
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
index c12db89..32d3ff7 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
@@ -28,46 +28,46 @@
 
 // auth_refresh_token parsing.
 typedef struct {
-  const char *type;
-  char *client_id;
-  char *client_secret;
-  char *refresh_token;
+  const char* type;
+  char* client_id;
+  char* client_secret;
+  char* refresh_token;
 } grpc_auth_refresh_token;
 
 /// Returns 1 if the object is valid, 0 otherwise.
 int grpc_auth_refresh_token_is_valid(
-    const grpc_auth_refresh_token *refresh_token);
+    const grpc_auth_refresh_token* refresh_token);
 
 /// Creates a refresh token object from string. Returns an invalid object if a
 /// parsing error has been encountered.
 grpc_auth_refresh_token grpc_auth_refresh_token_create_from_string(
-    const char *json_string);
+    const char* json_string);
 
 /// Creates a refresh token object from parsed json. Returns an invalid object
 /// if a parsing error has been encountered.
 grpc_auth_refresh_token grpc_auth_refresh_token_create_from_json(
-    const grpc_json *json);
+    const grpc_json* json);
 
 /// Destructs the object.
-void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token *refresh_token);
+void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token* refresh_token);
 
 // -- Oauth2 Token Fetcher credentials --
 //
 //  This object is a base for credentials that need to acquire an oauth2 token
 //  from an http service.
 
-typedef void (*grpc_fetch_oauth2_func)(grpc_exec_ctx *exec_ctx,
-                                       grpc_credentials_metadata_request *req,
-                                       grpc_httpcli_context *http_context,
-                                       grpc_polling_entity *pollent,
+typedef void (*grpc_fetch_oauth2_func)(grpc_exec_ctx* exec_ctx,
+                                       grpc_credentials_metadata_request* req,
+                                       grpc_httpcli_context* http_context,
+                                       grpc_polling_entity* pollent,
                                        grpc_iomgr_cb_func cb,
                                        grpc_millis deadline);
 
 typedef struct grpc_oauth2_pending_get_request_metadata {
-  grpc_credentials_mdelem_array *md_array;
-  grpc_closure *on_request_metadata;
-  grpc_polling_entity *pollent;
-  struct grpc_oauth2_pending_get_request_metadata *next;
+  grpc_credentials_mdelem_array* md_array;
+  grpc_closure* on_request_metadata;
+  grpc_polling_entity* pollent;
+  struct grpc_oauth2_pending_get_request_metadata* next;
 } grpc_oauth2_pending_get_request_metadata;
 
 typedef struct {
@@ -76,7 +76,7 @@
   grpc_mdelem access_token_md;
   grpc_millis token_expiration;
   bool token_fetch_pending;
-  grpc_oauth2_pending_get_request_metadata *pending_requests;
+  grpc_oauth2_pending_get_request_metadata* pending_requests;
   grpc_httpcli_context httpcli_context;
   grpc_fetch_oauth2_func fetch_func;
   grpc_polling_entity pollent;
@@ -96,15 +96,15 @@
 
 // Private constructor for refresh token credentials from an already parsed
 // refresh token. Takes ownership of the refresh token.
-grpc_call_credentials *
+grpc_call_credentials*
 grpc_refresh_token_credentials_create_from_auth_refresh_token(
     grpc_auth_refresh_token token);
 
 // Exposed for testing only.
 grpc_credentials_status
 grpc_oauth2_token_fetcher_credentials_parse_server_response(
-    grpc_exec_ctx *exec_ctx, const struct grpc_http_response *response,
-    grpc_mdelem *token_md, grpc_millis *token_lifetime);
+    grpc_exec_ctx* exec_ctx, const struct grpc_http_response* response,
+    grpc_mdelem* token_md, grpc_millis* token_lifetime);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.cc b/src/core/lib/security/credentials/plugin/plugin_credentials.cc
index 4700798..7651eff 100644
--- a/src/core/lib/security/credentials/plugin/plugin_credentials.cc
+++ b/src/core/lib/security/credentials/plugin/plugin_credentials.cc
@@ -33,9 +33,9 @@
 
 grpc_core::TraceFlag grpc_plugin_credentials_trace(false, "plugin_credentials");
 
-static void plugin_destruct(grpc_exec_ctx *exec_ctx,
-                            grpc_call_credentials *creds) {
-  grpc_plugin_credentials *c = (grpc_plugin_credentials *)creds;
+static void plugin_destruct(grpc_exec_ctx* exec_ctx,
+                            grpc_call_credentials* creds) {
+  grpc_plugin_credentials* c = (grpc_plugin_credentials*)creds;
   gpr_mu_destroy(&c->mu);
   if (c->plugin.state != NULL && c->plugin.destroy != NULL) {
     c->plugin.destroy(c->plugin.state);
@@ -43,8 +43,8 @@
 }
 
 static void pending_request_remove_locked(
-    grpc_plugin_credentials *c,
-    grpc_plugin_credentials_pending_request *pending_request) {
+    grpc_plugin_credentials* c,
+    grpc_plugin_credentials_pending_request* pending_request) {
   if (pending_request->prev == NULL) {
     c->pending_requests = pending_request->next;
   } else {
@@ -61,7 +61,7 @@
 // When this returns, r->cancelled indicates whether the request was
 // cancelled before completion.
 static void pending_request_complete(
-    grpc_exec_ctx *exec_ctx, grpc_plugin_credentials_pending_request *r) {
+    grpc_exec_ctx* exec_ctx, grpc_plugin_credentials_pending_request* r) {
   gpr_mu_lock(&r->creds->mu);
   if (!r->cancelled) pending_request_remove_locked(r->creds, r);
   gpr_mu_unlock(&r->creds->mu);
@@ -69,13 +69,13 @@
   grpc_call_credentials_unref(exec_ctx, &r->creds->base);
 }
 
-static grpc_error *process_plugin_result(
-    grpc_exec_ctx *exec_ctx, grpc_plugin_credentials_pending_request *r,
-    const grpc_metadata *md, size_t num_md, grpc_status_code status,
-    const char *error_details) {
-  grpc_error *error = GRPC_ERROR_NONE;
+static grpc_error* process_plugin_result(
+    grpc_exec_ctx* exec_ctx, grpc_plugin_credentials_pending_request* r,
+    const grpc_metadata* md, size_t num_md, grpc_status_code status,
+    const char* error_details) {
+  grpc_error* error = GRPC_ERROR_NONE;
   if (status != GRPC_STATUS_OK) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "Getting metadata from plugin failed with error: %s",
                  error_details);
     error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
@@ -111,17 +111,17 @@
   return error;
 }
 
-static void plugin_md_request_metadata_ready(void *request,
-                                             const grpc_metadata *md,
+static void plugin_md_request_metadata_ready(void* request,
+                                             const grpc_metadata* md,
                                              size_t num_md,
                                              grpc_status_code status,
-                                             const char *error_details) {
+                                             const char* error_details) {
   /* called from application code */
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INITIALIZER(
       GRPC_EXEC_CTX_FLAG_IS_FINISHED | GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP,
       NULL, NULL);
-  grpc_plugin_credentials_pending_request *r =
-      (grpc_plugin_credentials_pending_request *)request;
+  grpc_plugin_credentials_pending_request* r =
+      (grpc_plugin_credentials_pending_request*)request;
   if (grpc_plugin_credentials_trace.enabled()) {
     gpr_log(GPR_INFO,
             "plugin_credentials[%p]: request %p: plugin returned "
@@ -132,7 +132,7 @@
   pending_request_complete(&exec_ctx, r);
   // If it has not been cancelled, process it.
   if (!r->cancelled) {
-    grpc_error *error =
+    grpc_error* error =
         process_plugin_result(&exec_ctx, r, md, num_md, status, error_details);
     GRPC_CLOSURE_SCHED(&exec_ctx, r->on_request_metadata, error);
   } else if (grpc_plugin_credentials_trace.enabled()) {
@@ -145,19 +145,19 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static bool plugin_get_request_metadata(grpc_exec_ctx *exec_ctx,
-                                        grpc_call_credentials *creds,
-                                        grpc_polling_entity *pollent,
+static bool plugin_get_request_metadata(grpc_exec_ctx* exec_ctx,
+                                        grpc_call_credentials* creds,
+                                        grpc_polling_entity* pollent,
                                         grpc_auth_metadata_context context,
-                                        grpc_credentials_mdelem_array *md_array,
-                                        grpc_closure *on_request_metadata,
-                                        grpc_error **error) {
-  grpc_plugin_credentials *c = (grpc_plugin_credentials *)creds;
+                                        grpc_credentials_mdelem_array* md_array,
+                                        grpc_closure* on_request_metadata,
+                                        grpc_error** error) {
+  grpc_plugin_credentials* c = (grpc_plugin_credentials*)creds;
   bool retval = true;  // Synchronous return.
   if (c->plugin.get_metadata != NULL) {
     // Create pending_request object.
-    grpc_plugin_credentials_pending_request *pending_request =
-        (grpc_plugin_credentials_pending_request *)gpr_zalloc(
+    grpc_plugin_credentials_pending_request* pending_request =
+        (grpc_plugin_credentials_pending_request*)gpr_zalloc(
             sizeof(*pending_request));
     pending_request->creds = c;
     pending_request->md_array = md_array;
@@ -179,7 +179,7 @@
     grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX];
     size_t num_creds_md = 0;
     grpc_status_code status = GRPC_STATUS_OK;
-    const char *error_details = NULL;
+    const char* error_details = NULL;
     if (!c->plugin.get_metadata(c->plugin.state, context,
                                 plugin_md_request_metadata_ready,
                                 pending_request, creds_md, &num_creds_md,
@@ -221,18 +221,18 @@
       grpc_slice_unref_internal(exec_ctx, creds_md[i].key);
       grpc_slice_unref_internal(exec_ctx, creds_md[i].value);
     }
-    gpr_free((void *)error_details);
+    gpr_free((void*)error_details);
     gpr_free(pending_request);
   }
   return retval;
 }
 
 static void plugin_cancel_get_request_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds,
-    grpc_credentials_mdelem_array *md_array, grpc_error *error) {
-  grpc_plugin_credentials *c = (grpc_plugin_credentials *)creds;
+    grpc_exec_ctx* exec_ctx, grpc_call_credentials* creds,
+    grpc_credentials_mdelem_array* md_array, grpc_error* error) {
+  grpc_plugin_credentials* c = (grpc_plugin_credentials*)creds;
   gpr_mu_lock(&c->mu);
-  for (grpc_plugin_credentials_pending_request *pending_request =
+  for (grpc_plugin_credentials_pending_request* pending_request =
            c->pending_requests;
        pending_request != NULL; pending_request = pending_request->next) {
     if (pending_request->md_array == md_array) {
@@ -255,10 +255,9 @@
     plugin_destruct, plugin_get_request_metadata,
     plugin_cancel_get_request_metadata};
 
-grpc_call_credentials *grpc_metadata_credentials_create_from_plugin(
-    grpc_metadata_credentials_plugin plugin, void *reserved) {
-  grpc_plugin_credentials *c =
-      (grpc_plugin_credentials *)gpr_zalloc(sizeof(*c));
+grpc_call_credentials* grpc_metadata_credentials_create_from_plugin(
+    grpc_metadata_credentials_plugin plugin, void* reserved) {
+  grpc_plugin_credentials* c = (grpc_plugin_credentials*)gpr_zalloc(sizeof(*c));
   GRPC_API_TRACE("grpc_metadata_credentials_create_from_plugin(reserved=%p)", 1,
                  (reserved));
   GPR_ASSERT(reserved == NULL);
diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.h b/src/core/lib/security/credentials/plugin/plugin_credentials.h
index f0d757e..e1467b0 100644
--- a/src/core/lib/security/credentials/plugin/plugin_credentials.h
+++ b/src/core/lib/security/credentials/plugin/plugin_credentials.h
@@ -27,18 +27,18 @@
 
 typedef struct grpc_plugin_credentials_pending_request {
   bool cancelled;
-  struct grpc_plugin_credentials *creds;
-  grpc_credentials_mdelem_array *md_array;
-  grpc_closure *on_request_metadata;
-  struct grpc_plugin_credentials_pending_request *prev;
-  struct grpc_plugin_credentials_pending_request *next;
+  struct grpc_plugin_credentials* creds;
+  grpc_credentials_mdelem_array* md_array;
+  grpc_closure* on_request_metadata;
+  struct grpc_plugin_credentials_pending_request* prev;
+  struct grpc_plugin_credentials_pending_request* next;
 } grpc_plugin_credentials_pending_request;
 
 typedef struct grpc_plugin_credentials {
   grpc_call_credentials base;
   grpc_metadata_credentials_plugin plugin;
   gpr_mu mu;
-  grpc_plugin_credentials_pending_request *pending_requests;
+  grpc_plugin_credentials_pending_request* pending_requests;
 } grpc_plugin_credentials;
 
 #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_PLUGIN_PLUGIN_CREDENTIALS_H */
diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.cc b/src/core/lib/security/credentials/ssl/ssl_credentials.cc
index 290336a..79e223d 100644
--- a/src/core/lib/security/credentials/ssl/ssl_credentials.cc
+++ b/src/core/lib/security/credentials/ssl/ssl_credentials.cc
@@ -31,30 +31,33 @@
 // SSL Channel Credentials.
 //
 
-static void ssl_config_pem_key_cert_pair_destroy(
-    tsi_ssl_pem_key_cert_pair *kp) {
+void grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_ssl_pem_key_cert_pair* kp,
+                                             size_t num_key_cert_pairs) {
   if (kp == NULL) return;
-  gpr_free((void *)kp->private_key);
-  gpr_free((void *)kp->cert_chain);
+  for (size_t i = 0; i < num_key_cert_pairs; i++) {
+    gpr_free((void*)kp[i].private_key);
+    gpr_free((void*)kp[i].cert_chain);
+  }
+  gpr_free(kp);
 }
 
-static void ssl_destruct(grpc_exec_ctx *exec_ctx,
-                         grpc_channel_credentials *creds) {
-  grpc_ssl_credentials *c = (grpc_ssl_credentials *)creds;
+static void ssl_destruct(grpc_exec_ctx* exec_ctx,
+                         grpc_channel_credentials* creds) {
+  grpc_ssl_credentials* c = (grpc_ssl_credentials*)creds;
   gpr_free(c->config.pem_root_certs);
-  ssl_config_pem_key_cert_pair_destroy(&c->config.pem_key_cert_pair);
+  grpc_tsi_ssl_pem_key_cert_pairs_destroy(c->config.pem_key_cert_pair, 1);
 }
 
 static grpc_security_status ssl_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_channel_credentials *creds,
-    grpc_call_credentials *call_creds, const char *target,
-    const grpc_channel_args *args, grpc_channel_security_connector **sc,
-    grpc_channel_args **new_args) {
-  grpc_ssl_credentials *c = (grpc_ssl_credentials *)creds;
+    grpc_exec_ctx* exec_ctx, grpc_channel_credentials* creds,
+    grpc_call_credentials* call_creds, const char* target,
+    const grpc_channel_args* args, grpc_channel_security_connector** sc,
+    grpc_channel_args** new_args) {
+  grpc_ssl_credentials* c = (grpc_ssl_credentials*)creds;
   grpc_security_status status = GRPC_SECURITY_OK;
-  const char *overridden_target_name = NULL;
+  const char* overridden_target_name = NULL;
   for (size_t i = 0; args && i < args->num_args; i++) {
-    grpc_arg *arg = &args->args[i];
+    grpc_arg* arg = &args->args[i];
     if (strcmp(arg->key, GRPC_SSL_TARGET_NAME_OVERRIDE_ARG) == 0 &&
         arg->type == GRPC_ARG_STRING) {
       overridden_target_name = arg->value.string;
@@ -68,7 +71,7 @@
     return status;
   }
   grpc_arg new_arg = grpc_channel_arg_string_create(
-      (char *)GRPC_ARG_HTTP2_SCHEME, (char *)"https");
+      (char*)GRPC_ARG_HTTP2_SCHEME, (char*)"https");
   *new_args = grpc_channel_args_copy_and_add(args, &new_arg, 1);
   return status;
 }
@@ -76,27 +79,29 @@
 static grpc_channel_credentials_vtable ssl_vtable = {
     ssl_destruct, ssl_create_security_connector, NULL};
 
-static void ssl_build_config(const char *pem_root_certs,
-                             grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,
-                             grpc_ssl_config *config) {
+static void ssl_build_config(const char* pem_root_certs,
+                             grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
+                             grpc_ssl_config* config) {
   if (pem_root_certs != NULL) {
     config->pem_root_certs = gpr_strdup(pem_root_certs);
   }
   if (pem_key_cert_pair != NULL) {
     GPR_ASSERT(pem_key_cert_pair->private_key != NULL);
     GPR_ASSERT(pem_key_cert_pair->cert_chain != NULL);
-    config->pem_key_cert_pair.cert_chain =
+    config->pem_key_cert_pair = (tsi_ssl_pem_key_cert_pair*)gpr_zalloc(
+        sizeof(tsi_ssl_pem_key_cert_pair));
+    config->pem_key_cert_pair->cert_chain =
         gpr_strdup(pem_key_cert_pair->cert_chain);
-    config->pem_key_cert_pair.private_key =
+    config->pem_key_cert_pair->private_key =
         gpr_strdup(pem_key_cert_pair->private_key);
   }
 }
 
-grpc_channel_credentials *grpc_ssl_credentials_create(
-    const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,
-    void *reserved) {
-  grpc_ssl_credentials *c =
-      (grpc_ssl_credentials *)gpr_zalloc(sizeof(grpc_ssl_credentials));
+grpc_channel_credentials* grpc_ssl_credentials_create(
+    const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
+    void* reserved) {
+  grpc_ssl_credentials* c =
+      (grpc_ssl_credentials*)gpr_zalloc(sizeof(grpc_ssl_credentials));
   GRPC_API_TRACE(
       "grpc_ssl_credentials_create(pem_root_certs=%s, "
       "pem_key_cert_pair=%p, "
@@ -114,45 +119,78 @@
 // SSL Server Credentials.
 //
 
-static void ssl_server_destruct(grpc_exec_ctx *exec_ctx,
-                                grpc_server_credentials *creds) {
-  grpc_ssl_server_credentials *c = (grpc_ssl_server_credentials *)creds;
-  size_t i;
-  for (i = 0; i < c->config.num_key_cert_pairs; i++) {
-    ssl_config_pem_key_cert_pair_destroy(&c->config.pem_key_cert_pairs[i]);
-  }
-  gpr_free(c->config.pem_key_cert_pairs);
+struct grpc_ssl_server_credentials_options {
+  grpc_ssl_client_certificate_request_type client_certificate_request;
+  grpc_ssl_server_certificate_config* certificate_config;
+  grpc_ssl_server_certificate_config_fetcher* certificate_config_fetcher;
+};
+
+static void ssl_server_destruct(grpc_exec_ctx* exec_ctx,
+                                grpc_server_credentials* creds) {
+  grpc_ssl_server_credentials* c = (grpc_ssl_server_credentials*)creds;
+  grpc_tsi_ssl_pem_key_cert_pairs_destroy(c->config.pem_key_cert_pairs,
+                                          c->config.num_key_cert_pairs);
   gpr_free(c->config.pem_root_certs);
 }
 
 static grpc_security_status ssl_server_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_server_credentials *creds,
-    grpc_server_security_connector **sc) {
-  grpc_ssl_server_credentials *c = (grpc_ssl_server_credentials *)creds;
-  return grpc_ssl_server_security_connector_create(exec_ctx, creds, &c->config,
-                                                   sc);
+    grpc_exec_ctx* exec_ctx, grpc_server_credentials* creds,
+    grpc_server_security_connector** sc) {
+  return grpc_ssl_server_security_connector_create(exec_ctx, creds, sc);
 }
 
 static grpc_server_credentials_vtable ssl_server_vtable = {
     ssl_server_destruct, ssl_server_create_security_connector};
 
+tsi_ssl_pem_key_cert_pair* grpc_convert_grpc_to_tsi_cert_pairs(
+    const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs) {
+  tsi_ssl_pem_key_cert_pair* tsi_pairs = NULL;
+  if (num_key_cert_pairs > 0) {
+    GPR_ASSERT(pem_key_cert_pairs != NULL);
+    tsi_pairs = (tsi_ssl_pem_key_cert_pair*)gpr_zalloc(
+        num_key_cert_pairs * sizeof(tsi_ssl_pem_key_cert_pair));
+  }
+  for (size_t i = 0; i < num_key_cert_pairs; i++) {
+    GPR_ASSERT(pem_key_cert_pairs[i].private_key != NULL);
+    GPR_ASSERT(pem_key_cert_pairs[i].cert_chain != NULL);
+    tsi_pairs[i].cert_chain = gpr_strdup(pem_key_cert_pairs[i].cert_chain);
+    tsi_pairs[i].private_key = gpr_strdup(pem_key_cert_pairs[i].private_key);
+  }
+  return tsi_pairs;
+}
+
 static void ssl_build_server_config(
-    const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs,
+    const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
     size_t num_key_cert_pairs,
     grpc_ssl_client_certificate_request_type client_certificate_request,
-    grpc_ssl_server_config *config) {
-  size_t i;
+    grpc_ssl_server_config* config) {
   config->client_certificate_request = client_certificate_request;
   if (pem_root_certs != NULL) {
     config->pem_root_certs = gpr_strdup(pem_root_certs);
   }
+  config->pem_key_cert_pairs = grpc_convert_grpc_to_tsi_cert_pairs(
+      pem_key_cert_pairs, num_key_cert_pairs);
+  config->num_key_cert_pairs = num_key_cert_pairs;
+}
+
+grpc_ssl_server_certificate_config* grpc_ssl_server_certificate_config_create(
+    const char* pem_root_certs,
+    const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs) {
+  grpc_ssl_server_certificate_config* config =
+      (grpc_ssl_server_certificate_config*)gpr_zalloc(
+          sizeof(grpc_ssl_server_certificate_config));
+  if (pem_root_certs != NULL) {
+    config->pem_root_certs = gpr_strdup(pem_root_certs);
+  }
   if (num_key_cert_pairs > 0) {
     GPR_ASSERT(pem_key_cert_pairs != NULL);
-    config->pem_key_cert_pairs = (tsi_ssl_pem_key_cert_pair *)gpr_zalloc(
-        num_key_cert_pairs * sizeof(tsi_ssl_pem_key_cert_pair));
+    config->pem_key_cert_pairs = (grpc_ssl_pem_key_cert_pair*)gpr_zalloc(
+        num_key_cert_pairs * sizeof(grpc_ssl_pem_key_cert_pair));
   }
   config->num_key_cert_pairs = num_key_cert_pairs;
-  for (i = 0; i < num_key_cert_pairs; i++) {
+  for (size_t i = 0; i < num_key_cert_pairs; i++) {
     GPR_ASSERT(pem_key_cert_pairs[i].private_key != NULL);
     GPR_ASSERT(pem_key_cert_pairs[i].cert_chain != NULL);
     config->pem_key_cert_pairs[i].cert_chain =
@@ -160,11 +198,65 @@
     config->pem_key_cert_pairs[i].private_key =
         gpr_strdup(pem_key_cert_pairs[i].private_key);
   }
+  return config;
 }
 
-grpc_server_credentials *grpc_ssl_server_credentials_create(
-    const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs,
-    size_t num_key_cert_pairs, int force_client_auth, void *reserved) {
+void grpc_ssl_server_certificate_config_destroy(
+    grpc_ssl_server_certificate_config* config) {
+  if (config == NULL) return;
+  for (size_t i = 0; i < config->num_key_cert_pairs; i++) {
+    gpr_free((void*)config->pem_key_cert_pairs[i].private_key);
+    gpr_free((void*)config->pem_key_cert_pairs[i].cert_chain);
+  }
+  gpr_free(config->pem_key_cert_pairs);
+  gpr_free(config->pem_root_certs);
+  gpr_free(config);
+}
+
+grpc_ssl_server_credentials_options*
+grpc_ssl_server_credentials_create_options_using_config(
+    grpc_ssl_client_certificate_request_type client_certificate_request,
+    grpc_ssl_server_certificate_config* config) {
+  grpc_ssl_server_credentials_options* options = NULL;
+  if (config == NULL) {
+    gpr_log(GPR_ERROR, "Certificate config must not be NULL.");
+    goto done;
+  }
+  options = (grpc_ssl_server_credentials_options*)gpr_zalloc(
+      sizeof(grpc_ssl_server_credentials_options));
+  options->client_certificate_request = client_certificate_request;
+  options->certificate_config = config;
+done:
+  return options;
+}
+
+grpc_ssl_server_credentials_options*
+grpc_ssl_server_credentials_create_options_using_config_fetcher(
+    grpc_ssl_client_certificate_request_type client_certificate_request,
+    grpc_ssl_server_certificate_config_callback cb, void* user_data) {
+  if (cb == NULL) {
+    gpr_log(GPR_ERROR, "Invalid certificate config callback parameter.");
+    return NULL;
+  }
+
+  grpc_ssl_server_certificate_config_fetcher* fetcher =
+      (grpc_ssl_server_certificate_config_fetcher*)gpr_zalloc(
+          sizeof(grpc_ssl_server_certificate_config_fetcher));
+  fetcher->cb = cb;
+  fetcher->user_data = user_data;
+
+  grpc_ssl_server_credentials_options* options =
+      (grpc_ssl_server_credentials_options*)gpr_zalloc(
+          sizeof(grpc_ssl_server_credentials_options));
+  options->client_certificate_request = client_certificate_request;
+  options->certificate_config_fetcher = fetcher;
+
+  return options;
+}
+
+grpc_server_credentials* grpc_ssl_server_credentials_create(
+    const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs, int force_client_auth, void* reserved) {
   return grpc_ssl_server_credentials_create_ex(
       pem_root_certs, pem_key_cert_pairs, num_key_cert_pairs,
       force_client_auth
@@ -173,25 +265,80 @@
       reserved);
 }
 
-grpc_server_credentials *grpc_ssl_server_credentials_create_ex(
-    const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs,
+grpc_server_credentials* grpc_ssl_server_credentials_create_ex(
+    const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
     size_t num_key_cert_pairs,
     grpc_ssl_client_certificate_request_type client_certificate_request,
-    void *reserved) {
-  grpc_ssl_server_credentials *c = (grpc_ssl_server_credentials *)gpr_zalloc(
-      sizeof(grpc_ssl_server_credentials));
+    void* reserved) {
   GRPC_API_TRACE(
       "grpc_ssl_server_credentials_create_ex("
       "pem_root_certs=%s, pem_key_cert_pairs=%p, num_key_cert_pairs=%lu, "
       "client_certificate_request=%d, reserved=%p)",
-      5, (pem_root_certs, pem_key_cert_pairs, (unsigned long)num_key_cert_pairs,
-          client_certificate_request, reserved));
+      5,
+      (pem_root_certs, pem_key_cert_pairs, (unsigned long)num_key_cert_pairs,
+       client_certificate_request, reserved));
   GPR_ASSERT(reserved == NULL);
+
+  grpc_ssl_server_certificate_config* cert_config =
+      grpc_ssl_server_certificate_config_create(
+          pem_root_certs, pem_key_cert_pairs, num_key_cert_pairs);
+  grpc_ssl_server_credentials_options* options =
+      grpc_ssl_server_credentials_create_options_using_config(
+          client_certificate_request, cert_config);
+
+  return grpc_ssl_server_credentials_create_with_options(options);
+}
+
+grpc_server_credentials* grpc_ssl_server_credentials_create_with_options(
+    grpc_ssl_server_credentials_options* options) {
+  grpc_server_credentials* retval = NULL;
+  grpc_ssl_server_credentials* c = NULL;
+
+  if (options == NULL) {
+    gpr_log(GPR_ERROR,
+            "Invalid options trying to create SSL server credentials.");
+    goto done;
+  }
+
+  if (options->certificate_config == NULL &&
+      options->certificate_config_fetcher == NULL) {
+    gpr_log(GPR_ERROR,
+            "SSL server credentials options must specify either "
+            "certificate config or fetcher.");
+    goto done;
+  } else if (options->certificate_config_fetcher != NULL &&
+             options->certificate_config_fetcher->cb == NULL) {
+    gpr_log(GPR_ERROR, "Certificate config fetcher callback must not be NULL.");
+    goto done;
+  }
+
+  c = (grpc_ssl_server_credentials*)gpr_zalloc(
+      sizeof(grpc_ssl_server_credentials));
   c->base.type = GRPC_CHANNEL_CREDENTIALS_TYPE_SSL;
   gpr_ref_init(&c->base.refcount, 1);
   c->base.vtable = &ssl_server_vtable;
-  ssl_build_server_config(pem_root_certs, pem_key_cert_pairs,
-                          num_key_cert_pairs, client_certificate_request,
-                          &c->config);
-  return &c->base;
+
+  if (options->certificate_config_fetcher != NULL) {
+    c->config.client_certificate_request = options->client_certificate_request;
+    c->certificate_config_fetcher = *options->certificate_config_fetcher;
+  } else {
+    ssl_build_server_config(options->certificate_config->pem_root_certs,
+                            options->certificate_config->pem_key_cert_pairs,
+                            options->certificate_config->num_key_cert_pairs,
+                            options->client_certificate_request, &c->config);
+  }
+
+  retval = &c->base;
+
+done:
+  grpc_ssl_server_credentials_options_destroy(options);
+  return retval;
+}
+
+void grpc_ssl_server_credentials_options_destroy(
+    grpc_ssl_server_credentials_options* o) {
+  if (o == NULL) return;
+  gpr_free(o->certificate_config_fetcher);
+  grpc_ssl_server_certificate_config_destroy(o->certificate_config);
+  gpr_free(o);
 }
diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.h b/src/core/lib/security/credentials/ssl/ssl_credentials.h
index b43c656..82b9ce1 100644
--- a/src/core/lib/security/credentials/ssl/ssl_credentials.h
+++ b/src/core/lib/security/credentials/ssl/ssl_credentials.h
@@ -20,14 +20,41 @@
 
 #include "src/core/lib/security/credentials/credentials.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct {
   grpc_channel_credentials base;
   grpc_ssl_config config;
 } grpc_ssl_credentials;
 
+struct grpc_ssl_server_certificate_config {
+  grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs;
+  size_t num_key_cert_pairs;
+  char* pem_root_certs;
+};
+
+typedef struct {
+  grpc_ssl_server_certificate_config_callback cb;
+  void* user_data;
+} grpc_ssl_server_certificate_config_fetcher;
+
 typedef struct {
   grpc_server_credentials base;
   grpc_ssl_server_config config;
+  grpc_ssl_server_certificate_config_fetcher certificate_config_fetcher;
 } grpc_ssl_server_credentials;
 
+tsi_ssl_pem_key_cert_pair* grpc_convert_grpc_to_tsi_cert_pairs(
+    const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs);
+
+void grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_ssl_pem_key_cert_pair* kp,
+                                             size_t num_key_cert_pairs);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H */
diff --git a/src/core/lib/security/transport/auth_filters.h b/src/core/lib/security/transport/auth_filters.h
index ba5df7f..6376929 100644
--- a/src/core/lib/security/transport/auth_filters.h
+++ b/src/core/lib/security/transport/auth_filters.h
@@ -19,6 +19,7 @@
 #ifndef GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H
 #define GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H
 
+#include <grpc/grpc_security.h>
 #include "src/core/lib/channel/channel_stack.h"
 
 #ifdef __cplusplus
@@ -28,6 +29,13 @@
 extern const grpc_channel_filter grpc_client_auth_filter;
 extern const grpc_channel_filter grpc_server_auth_filter;
 
+void grpc_auth_metadata_context_build(
+    const char* url_scheme, grpc_slice call_host, grpc_slice call_method,
+    grpc_auth_context* auth_context,
+    grpc_auth_metadata_context* auth_md_context);
+
+void grpc_auth_metadata_context_reset(grpc_auth_metadata_context* context);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/core/lib/security/transport/client_auth_filter.cc b/src/core/lib/security/transport/client_auth_filter.cc
index a8464db..11f5a13 100644
--- a/src/core/lib/security/transport/client_auth_filter.cc
+++ b/src/core/lib/security/transport/client_auth_filter.cc
@@ -39,9 +39,9 @@
 
 /* We can have a per-call credentials. */
 typedef struct {
-  grpc_call_stack *owning_call;
-  grpc_call_combiner *call_combiner;
-  grpc_call_credentials *creds;
+  grpc_call_stack* owning_call;
+  grpc_call_combiner* call_combiner;
+  grpc_call_credentials* creds;
   bool have_host;
   bool have_method;
   grpc_slice host;
@@ -50,7 +50,7 @@
      network requests, they should be done under a pollset added to this
      pollset_set so that work can progress when this call wants work to progress
   */
-  grpc_polling_entity *pollent;
+  grpc_polling_entity* pollent;
   grpc_credentials_mdelem_array md_array;
   grpc_linked_mdelem md_links[MAX_CREDENTIALS_METADATA_COUNT];
   grpc_auth_metadata_context auth_md_context;
@@ -61,27 +61,27 @@
 
 /* We can have a per-channel credentials. */
 typedef struct {
-  grpc_channel_security_connector *security_connector;
-  grpc_auth_context *auth_context;
+  grpc_channel_security_connector* security_connector;
+  grpc_auth_context* auth_context;
 } channel_data;
 
-static void reset_auth_metadata_context(
-    grpc_auth_metadata_context *auth_md_context) {
+void grpc_auth_metadata_context_reset(
+    grpc_auth_metadata_context* auth_md_context) {
   if (auth_md_context->service_url != NULL) {
-    gpr_free((char *)auth_md_context->service_url);
+    gpr_free((char*)auth_md_context->service_url);
     auth_md_context->service_url = NULL;
   }
   if (auth_md_context->method_name != NULL) {
-    gpr_free((char *)auth_md_context->method_name);
+    gpr_free((char*)auth_md_context->method_name);
     auth_md_context->method_name = NULL;
   }
   GRPC_AUTH_CONTEXT_UNREF(
-      (grpc_auth_context *)auth_md_context->channel_auth_context,
+      (grpc_auth_context*)auth_md_context->channel_auth_context,
       "grpc_auth_metadata_context");
   auth_md_context->channel_auth_context = NULL;
 }
 
-static void add_error(grpc_error **combined, grpc_error *error) {
+static void add_error(grpc_error** combined, grpc_error* error) {
   if (error == GRPC_ERROR_NONE) return;
   if (*combined == GRPC_ERROR_NONE) {
     *combined = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -90,18 +90,18 @@
   *combined = grpc_error_add_child(*combined, error);
 }
 
-static void on_credentials_metadata(grpc_exec_ctx *exec_ctx, void *arg,
-                                    grpc_error *input_error) {
-  grpc_transport_stream_op_batch *batch = (grpc_transport_stream_op_batch *)arg;
-  grpc_call_element *elem =
-      (grpc_call_element *)batch->handler_private.extra_arg;
-  call_data *calld = (call_data *)elem->call_data;
-  reset_auth_metadata_context(&calld->auth_md_context);
-  grpc_error *error = GRPC_ERROR_REF(input_error);
+static void on_credentials_metadata(grpc_exec_ctx* exec_ctx, void* arg,
+                                    grpc_error* input_error) {
+  grpc_transport_stream_op_batch* batch = (grpc_transport_stream_op_batch*)arg;
+  grpc_call_element* elem =
+      (grpc_call_element*)batch->handler_private.extra_arg;
+  call_data* calld = (call_data*)elem->call_data;
+  grpc_auth_metadata_context_reset(&calld->auth_md_context);
+  grpc_error* error = GRPC_ERROR_REF(input_error);
   if (error == GRPC_ERROR_NONE) {
     GPR_ASSERT(calld->md_array.size <= MAX_CREDENTIALS_METADATA_COUNT);
     GPR_ASSERT(batch->send_initial_metadata);
-    grpc_metadata_batch *mdb =
+    grpc_metadata_batch* mdb =
         batch->payload->send_initial_metadata.send_initial_metadata;
     for (size_t i = 0; i < calld->md_array.size; ++i) {
       add_error(&error, grpc_metadata_batch_add_tail(
@@ -119,40 +119,47 @@
   }
 }
 
-void build_auth_metadata_context(grpc_security_connector *sc,
-                                 grpc_auth_context *auth_context,
-                                 call_data *calld) {
-  char *service = grpc_slice_to_c_string(calld->method);
-  char *last_slash = strrchr(service, '/');
-  char *method_name = NULL;
-  char *service_url = NULL;
-  reset_auth_metadata_context(&calld->auth_md_context);
+void grpc_auth_metadata_context_build(
+    const char* url_scheme, grpc_slice call_host, grpc_slice call_method,
+    grpc_auth_context* auth_context,
+    grpc_auth_metadata_context* auth_md_context) {
+  char* service = grpc_slice_to_c_string(call_method);
+  char* last_slash = strrchr(service, '/');
+  char* method_name = NULL;
+  char* service_url = NULL;
+  grpc_auth_metadata_context_reset(auth_md_context);
   if (last_slash == NULL) {
     gpr_log(GPR_ERROR, "No '/' found in fully qualified method name");
     service[0] = '\0';
+    method_name = gpr_strdup("");
   } else if (last_slash == service) {
-    /* No service part in fully qualified method name: will just be "/". */
-    service[1] = '\0';
+    method_name = gpr_strdup("");
   } else {
     *last_slash = '\0';
     method_name = gpr_strdup(last_slash + 1);
   }
-  if (method_name == NULL) method_name = gpr_strdup("");
-  char *host = grpc_slice_to_c_string(calld->host);
-  gpr_asprintf(&service_url, "%s://%s%s",
-               sc->url_scheme == NULL ? "" : sc->url_scheme, host, service);
-  calld->auth_md_context.service_url = service_url;
-  calld->auth_md_context.method_name = method_name;
-  calld->auth_md_context.channel_auth_context =
+  char* host_and_port = grpc_slice_to_c_string(call_host);
+  if (url_scheme != NULL && strcmp(url_scheme, GRPC_SSL_URL_SCHEME) == 0) {
+    /* Remove the port if it is 443. */
+    char* port_delimiter = strrchr(host_and_port, ':');
+    if (port_delimiter != NULL && strcmp(port_delimiter + 1, "443") == 0) {
+      *port_delimiter = '\0';
+    }
+  }
+  gpr_asprintf(&service_url, "%s://%s%s", url_scheme == NULL ? "" : url_scheme,
+               host_and_port, service);
+  auth_md_context->service_url = service_url;
+  auth_md_context->method_name = method_name;
+  auth_md_context->channel_auth_context =
       GRPC_AUTH_CONTEXT_REF(auth_context, "grpc_auth_metadata_context");
   gpr_free(service);
-  gpr_free(host);
+  gpr_free(host_and_port);
 }
 
-static void cancel_get_request_metadata(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
+static void cancel_get_request_metadata(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
   if (error != GRPC_ERROR_NONE) {
     grpc_call_credentials_cancel_get_request_metadata(
         exec_ctx, calld->creds, &calld->md_array, GRPC_ERROR_REF(error));
@@ -161,16 +168,16 @@
                         "cancel_get_request_metadata");
 }
 
-static void send_security_metadata(grpc_exec_ctx *exec_ctx,
-                                   grpc_call_element *elem,
-                                   grpc_transport_stream_op_batch *batch) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
-  grpc_client_security_context *ctx =
-      (grpc_client_security_context *)batch->payload
+static void send_security_metadata(grpc_exec_ctx* exec_ctx,
+                                   grpc_call_element* elem,
+                                   grpc_transport_stream_op_batch* batch) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
+  grpc_client_security_context* ctx =
+      (grpc_client_security_context*)batch->payload
           ->context[GRPC_CONTEXT_SECURITY]
           .value;
-  grpc_call_credentials *channel_call_creds =
+  grpc_call_credentials* channel_call_creds =
       chand->security_connector->request_metadata_creds;
   int call_creds_has_md = (ctx != NULL) && (ctx->creds != NULL);
 
@@ -198,14 +205,15 @@
         call_creds_has_md ? ctx->creds : channel_call_creds);
   }
 
-  build_auth_metadata_context(&chand->security_connector->base,
-                              chand->auth_context, calld);
+  grpc_auth_metadata_context_build(
+      chand->security_connector->base.url_scheme, calld->host, calld->method,
+      chand->auth_context, &calld->auth_md_context);
 
   GPR_ASSERT(calld->pollent != NULL);
 
   GRPC_CLOSURE_INIT(&calld->async_result_closure, on_credentials_metadata,
                     batch, grpc_schedule_on_exec_ctx);
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   if (grpc_call_credentials_get_request_metadata(
           exec_ctx, calld->creds, calld->pollent, calld->auth_md_context,
           &calld->md_array, &calld->async_result_closure, &error)) {
@@ -223,17 +231,17 @@
   }
 }
 
-static void on_host_checked(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_error *error) {
-  grpc_transport_stream_op_batch *batch = (grpc_transport_stream_op_batch *)arg;
-  grpc_call_element *elem =
-      (grpc_call_element *)batch->handler_private.extra_arg;
-  call_data *calld = (call_data *)elem->call_data;
+static void on_host_checked(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_error* error) {
+  grpc_transport_stream_op_batch* batch = (grpc_transport_stream_op_batch*)arg;
+  grpc_call_element* elem =
+      (grpc_call_element*)batch->handler_private.extra_arg;
+  call_data* calld = (call_data*)elem->call_data;
   if (error == GRPC_ERROR_NONE) {
     send_security_metadata(exec_ctx, elem, batch);
   } else {
-    char *error_msg;
-    char *host = grpc_slice_to_c_string(calld->host);
+    char* error_msg;
+    char* host = grpc_slice_to_c_string(calld->host);
     gpr_asprintf(&error_msg, "Invalid host %s set in :authority metadata.",
                  host);
     gpr_free(host);
@@ -247,11 +255,11 @@
   }
 }
 
-static void cancel_check_call_host(grpc_exec_ctx *exec_ctx, void *arg,
-                                   grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void cancel_check_call_host(grpc_exec_ctx* exec_ctx, void* arg,
+                                   grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   if (error != GRPC_ERROR_NONE) {
     grpc_channel_security_connector_cancel_check_call_host(
         exec_ctx, chand->security_connector, &calld->async_result_closure,
@@ -261,13 +269,13 @@
 }
 
 static void auth_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *batch) {
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* batch) {
   GPR_TIMER_BEGIN("auth_start_transport_stream_op_batch", 0);
 
   /* grab pointers to our data from the call element */
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
 
   if (!batch->cancel_stream) {
     GPR_ASSERT(batch->payload->context != NULL);
@@ -277,8 +285,8 @@
       batch->payload->context[GRPC_CONTEXT_SECURITY].destroy =
           grpc_client_security_context_destroy;
     }
-    grpc_client_security_context *sec_ctx =
-        (grpc_client_security_context *)batch->payload
+    grpc_client_security_context* sec_ctx =
+        (grpc_client_security_context*)batch->payload
             ->context[GRPC_CONTEXT_SECURITY]
             .value;
     GRPC_AUTH_CONTEXT_UNREF(sec_ctx->auth_context, "client auth filter");
@@ -287,7 +295,7 @@
   }
 
   if (batch->send_initial_metadata) {
-    for (grpc_linked_mdelem *l = batch->payload->send_initial_metadata
+    for (grpc_linked_mdelem* l = batch->payload->send_initial_metadata
                                      .send_initial_metadata->list.head;
          l != NULL; l = l->next) {
       grpc_mdelem md = l->md;
@@ -311,8 +319,8 @@
       batch->handler_private.extra_arg = elem;
       GRPC_CLOSURE_INIT(&calld->async_result_closure, on_host_checked, batch,
                         grpc_schedule_on_exec_ctx);
-      char *call_host = grpc_slice_to_c_string(calld->host);
-      grpc_error *error = GRPC_ERROR_NONE;
+      char* call_host = grpc_slice_to_c_string(calld->host);
+      grpc_error* error = GRPC_ERROR_NONE;
       if (grpc_channel_security_connector_check_call_host(
               exec_ctx, chand->security_connector, call_host,
               chand->auth_context, &calld->async_result_closure, &error)) {
@@ -340,27 +348,27 @@
 }
 
 /* Constructor for call_data */
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  call_data *calld = (call_data *)elem->call_data;
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  call_data* calld = (call_data*)elem->call_data;
   calld->owning_call = args->call_stack;
   calld->call_combiner = args->call_combiner;
   return GRPC_ERROR_NONE;
 }
 
-static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
-                                       grpc_call_element *elem,
-                                       grpc_polling_entity *pollent) {
-  call_data *calld = (call_data *)elem->call_data;
+static void set_pollset_or_pollset_set(grpc_exec_ctx* exec_ctx,
+                                       grpc_call_element* elem,
+                                       grpc_polling_entity* pollent) {
+  call_data* calld = (call_data*)elem->call_data;
   calld->pollent = pollent;
 }
 
 /* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {
-  call_data *calld = (call_data *)elem->call_data;
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {
+  call_data* calld = (call_data*)elem->call_data;
   grpc_credentials_mdelem_array_destroy(exec_ctx, &calld->md_array);
   grpc_call_credentials_unref(exec_ctx, calld->creds);
   if (calld->have_host) {
@@ -369,20 +377,20 @@
   if (calld->have_method) {
     grpc_slice_unref_internal(exec_ctx, calld->method);
   }
-  reset_auth_metadata_context(&calld->auth_md_context);
+  grpc_auth_metadata_context_reset(&calld->auth_md_context);
 }
 
 /* Constructor for channel_data */
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  grpc_security_connector *sc =
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  grpc_security_connector* sc =
       grpc_security_connector_find_in_args(args->channel_args);
   if (sc == NULL) {
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
         "Security connector missing from client auth filter args");
   }
-  grpc_auth_context *auth_context =
+  grpc_auth_context* auth_context =
       grpc_find_auth_context_in_args(args->channel_args);
   if (auth_context == NULL) {
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -390,7 +398,7 @@
   }
 
   /* grab pointers to our data from the channel element */
-  channel_data *chand = (channel_data *)elem->channel_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
 
   /* The first and the last filters tend to be implemented differently to
      handle the case that there's no 'next' filter to call on the up or down
@@ -399,7 +407,7 @@
 
   /* initialize members */
   chand->security_connector =
-      (grpc_channel_security_connector *)GRPC_SECURITY_CONNECTOR_REF(
+      (grpc_channel_security_connector*)GRPC_SECURITY_CONNECTOR_REF(
           sc, "client_auth_filter");
   chand->auth_context =
       GRPC_AUTH_CONTEXT_REF(auth_context, "client_auth_filter");
@@ -407,11 +415,11 @@
 }
 
 /* Destructor for channel data */
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {
   /* grab pointers to our data from the channel element */
-  channel_data *chand = (channel_data *)elem->channel_data;
-  grpc_channel_security_connector *sc = chand->security_connector;
+  channel_data* chand = (channel_data*)elem->channel_data;
+  grpc_channel_security_connector* sc = chand->security_connector;
   if (sc != NULL) {
     GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, &sc->base, "client_auth_filter");
   }
diff --git a/src/core/lib/security/transport/lb_targets_info.cc b/src/core/lib/security/transport/lb_targets_info.cc
index 947fc1a..1655e18 100644
--- a/src/core/lib/security/transport/lb_targets_info.cc
+++ b/src/core/lib/security/transport/lb_targets_info.cc
@@ -25,33 +25,33 @@
  * secure naming purposes. */
 #define GRPC_ARG_LB_SECURE_NAMING_MAP "grpc.lb_secure_naming_map"
 
-static void *targets_info_copy(void *p) {
-  return grpc_slice_hash_table_ref((grpc_slice_hash_table *)p);
+static void* targets_info_copy(void* p) {
+  return grpc_slice_hash_table_ref((grpc_slice_hash_table*)p);
 }
-static void targets_info_destroy(grpc_exec_ctx *exec_ctx, void *p) {
-  grpc_slice_hash_table_unref(exec_ctx, (grpc_slice_hash_table *)p);
+static void targets_info_destroy(grpc_exec_ctx* exec_ctx, void* p) {
+  grpc_slice_hash_table_unref(exec_ctx, (grpc_slice_hash_table*)p);
 }
-static int targets_info_cmp(void *a, void *b) {
-  return grpc_slice_hash_table_cmp((const grpc_slice_hash_table *)a,
-                                   (const grpc_slice_hash_table *)b);
+static int targets_info_cmp(void* a, void* b) {
+  return grpc_slice_hash_table_cmp((const grpc_slice_hash_table*)a,
+                                   (const grpc_slice_hash_table*)b);
 }
 static const grpc_arg_pointer_vtable server_to_balancer_names_vtable = {
     targets_info_copy, targets_info_destroy, targets_info_cmp};
 
 grpc_arg grpc_lb_targets_info_create_channel_arg(
-    grpc_slice_hash_table *targets_info) {
-  return grpc_channel_arg_pointer_create((char *)GRPC_ARG_LB_SECURE_NAMING_MAP,
+    grpc_slice_hash_table* targets_info) {
+  return grpc_channel_arg_pointer_create((char*)GRPC_ARG_LB_SECURE_NAMING_MAP,
                                          targets_info,
                                          &server_to_balancer_names_vtable);
 }
 
-grpc_slice_hash_table *grpc_lb_targets_info_find_in_args(
-    const grpc_channel_args *args) {
-  const grpc_arg *targets_info_arg =
+grpc_slice_hash_table* grpc_lb_targets_info_find_in_args(
+    const grpc_channel_args* args) {
+  const grpc_arg* targets_info_arg =
       grpc_channel_args_find(args, GRPC_ARG_LB_SECURE_NAMING_MAP);
   if (targets_info_arg != NULL) {
     GPR_ASSERT(targets_info_arg->type == GRPC_ARG_POINTER);
-    return (grpc_slice_hash_table *)targets_info_arg->value.pointer.p;
+    return (grpc_slice_hash_table*)targets_info_arg->value.pointer.p;
   }
   return NULL;
 }
diff --git a/src/core/lib/security/transport/lb_targets_info.h b/src/core/lib/security/transport/lb_targets_info.h
index 43f0e64..b4a0bc9 100644
--- a/src/core/lib/security/transport/lb_targets_info.h
+++ b/src/core/lib/security/transport/lb_targets_info.h
@@ -27,11 +27,11 @@
 
 /** Return a channel argument containing \a targets_info. */
 grpc_arg grpc_lb_targets_info_create_channel_arg(
-    grpc_slice_hash_table *targets_info);
+    grpc_slice_hash_table* targets_info);
 
 /** Return the instance of targets info in \a args or NULL */
-grpc_slice_hash_table *grpc_lb_targets_info_find_in_args(
-    const grpc_channel_args *args);
+grpc_slice_hash_table* grpc_lb_targets_info_find_in_args(
+    const grpc_channel_args* args);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/security/transport/secure_endpoint.cc b/src/core/lib/security/transport/secure_endpoint.cc
index 5964f3b..b81b8a4 100644
--- a/src/core/lib/security/transport/secure_endpoint.cc
+++ b/src/core/lib/security/transport/secure_endpoint.cc
@@ -40,15 +40,15 @@
 
 typedef struct {
   grpc_endpoint base;
-  grpc_endpoint *wrapped_ep;
-  struct tsi_frame_protector *protector;
-  struct tsi_zero_copy_grpc_protector *zero_copy_protector;
+  grpc_endpoint* wrapped_ep;
+  struct tsi_frame_protector* protector;
+  struct tsi_zero_copy_grpc_protector* zero_copy_protector;
   gpr_mu protector_mu;
   /* saved upper level callbacks and user_data. */
-  grpc_closure *read_cb;
-  grpc_closure *write_cb;
+  grpc_closure* read_cb;
+  grpc_closure* write_cb;
   grpc_closure on_read;
-  grpc_slice_buffer *read_buffer;
+  grpc_slice_buffer* read_buffer;
   grpc_slice_buffer source_buffer;
   /* saved handshaker leftover data to unprotect. */
   grpc_slice_buffer leftover_bytes;
@@ -63,8 +63,8 @@
 
 grpc_core::TraceFlag grpc_trace_secure_endpoint(false, "secure_endpoint");
 
-static void destroy(grpc_exec_ctx *exec_ctx, secure_endpoint *secure_ep) {
-  secure_endpoint *ep = secure_ep;
+static void destroy(grpc_exec_ctx* exec_ctx, secure_endpoint* secure_ep) {
+  secure_endpoint* ep = secure_ep;
   grpc_endpoint_destroy(exec_ctx, ep->wrapped_ep);
   tsi_frame_protector_destroy(ep->protector);
   tsi_zero_copy_grpc_protector_destroy(exec_ctx, ep->zero_copy_protector);
@@ -82,8 +82,8 @@
   secure_endpoint_unref((exec_ctx), (ep), (reason), __FILE__, __LINE__)
 #define SECURE_ENDPOINT_REF(ep, reason) \
   secure_endpoint_ref((ep), (reason), __FILE__, __LINE__)
-static void secure_endpoint_unref(grpc_exec_ctx *exec_ctx, secure_endpoint *ep,
-                                  const char *reason, const char *file,
+static void secure_endpoint_unref(grpc_exec_ctx* exec_ctx, secure_endpoint* ep,
+                                  const char* reason, const char* file,
                                   int line) {
   if (grpc_trace_secure_endpoint.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&ep->ref.count);
@@ -96,8 +96,8 @@
   }
 }
 
-static void secure_endpoint_ref(secure_endpoint *ep, const char *reason,
-                                const char *file, int line) {
+static void secure_endpoint_ref(secure_endpoint* ep, const char* reason,
+                                const char* file, int line) {
   if (grpc_trace_secure_endpoint.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&ep->ref.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
@@ -110,30 +110,30 @@
 #define SECURE_ENDPOINT_UNREF(exec_ctx, ep, reason) \
   secure_endpoint_unref((exec_ctx), (ep))
 #define SECURE_ENDPOINT_REF(ep, reason) secure_endpoint_ref((ep))
-static void secure_endpoint_unref(grpc_exec_ctx *exec_ctx,
-                                  secure_endpoint *ep) {
+static void secure_endpoint_unref(grpc_exec_ctx* exec_ctx,
+                                  secure_endpoint* ep) {
   if (gpr_unref(&ep->ref)) {
     destroy(exec_ctx, ep);
   }
 }
 
-static void secure_endpoint_ref(secure_endpoint *ep) { gpr_ref(&ep->ref); }
+static void secure_endpoint_ref(secure_endpoint* ep) { gpr_ref(&ep->ref); }
 #endif
 
-static void flush_read_staging_buffer(secure_endpoint *ep, uint8_t **cur,
-                                      uint8_t **end) {
+static void flush_read_staging_buffer(secure_endpoint* ep, uint8_t** cur,
+                                      uint8_t** end) {
   grpc_slice_buffer_add(ep->read_buffer, ep->read_staging_buffer);
   ep->read_staging_buffer = GRPC_SLICE_MALLOC(STAGING_BUFFER_SIZE);
   *cur = GRPC_SLICE_START_PTR(ep->read_staging_buffer);
   *end = GRPC_SLICE_END_PTR(ep->read_staging_buffer);
 }
 
-static void call_read_cb(grpc_exec_ctx *exec_ctx, secure_endpoint *ep,
-                         grpc_error *error) {
+static void call_read_cb(grpc_exec_ctx* exec_ctx, secure_endpoint* ep,
+                         grpc_error* error) {
   if (grpc_trace_secure_endpoint.enabled()) {
     size_t i;
     for (i = 0; i < ep->read_buffer->count; i++) {
-      char *data = grpc_dump_slice(ep->read_buffer->slices[i],
+      char* data = grpc_dump_slice(ep->read_buffer->slices[i],
                                    GPR_DUMP_HEX | GPR_DUMP_ASCII);
       gpr_log(GPR_DEBUG, "READ %p: %s", ep, data);
       gpr_free(data);
@@ -144,19 +144,20 @@
   SECURE_ENDPOINT_UNREF(exec_ctx, ep, "read");
 }
 
-static void on_read(grpc_exec_ctx *exec_ctx, void *user_data,
-                    grpc_error *error) {
+static void on_read(grpc_exec_ctx* exec_ctx, void* user_data,
+                    grpc_error* error) {
   unsigned i;
   uint8_t keep_looping = 0;
   tsi_result result = TSI_OK;
-  secure_endpoint *ep = (secure_endpoint *)user_data;
-  uint8_t *cur = GRPC_SLICE_START_PTR(ep->read_staging_buffer);
-  uint8_t *end = GRPC_SLICE_END_PTR(ep->read_staging_buffer);
+  secure_endpoint* ep = (secure_endpoint*)user_data;
+  uint8_t* cur = GRPC_SLICE_START_PTR(ep->read_staging_buffer);
+  uint8_t* end = GRPC_SLICE_END_PTR(ep->read_staging_buffer);
 
   if (error != GRPC_ERROR_NONE) {
     grpc_slice_buffer_reset_and_unref_internal(exec_ctx, ep->read_buffer);
-    call_read_cb(exec_ctx, ep, GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
-                                   "Secure read failed", &error, 1));
+    call_read_cb(exec_ctx, ep,
+                 GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+                     "Secure read failed", &error, 1));
     return;
   }
 
@@ -169,7 +170,7 @@
     /* TODO(yangg) check error, maybe bail out early */
     for (i = 0; i < ep->source_buffer.count; i++) {
       grpc_slice encrypted = ep->source_buffer.slices[i];
-      uint8_t *message_bytes = GRPC_SLICE_START_PTR(encrypted);
+      uint8_t* message_bytes = GRPC_SLICE_START_PTR(encrypted);
       size_t message_size = GRPC_SLICE_LENGTH(encrypted);
 
       while (message_size > 0 || keep_looping) {
@@ -230,9 +231,9 @@
   call_read_cb(exec_ctx, ep, GRPC_ERROR_NONE);
 }
 
-static void endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
-                          grpc_slice_buffer *slices, grpc_closure *cb) {
-  secure_endpoint *ep = (secure_endpoint *)secure_ep;
+static void endpoint_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* secure_ep,
+                          grpc_slice_buffer* slices, grpc_closure* cb) {
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
   ep->read_cb = cb;
   ep->read_buffer = slices;
   grpc_slice_buffer_reset_and_unref_internal(exec_ctx, ep->read_buffer);
@@ -249,29 +250,29 @@
                      &ep->on_read);
 }
 
-static void flush_write_staging_buffer(secure_endpoint *ep, uint8_t **cur,
-                                       uint8_t **end) {
+static void flush_write_staging_buffer(secure_endpoint* ep, uint8_t** cur,
+                                       uint8_t** end) {
   grpc_slice_buffer_add(&ep->output_buffer, ep->write_staging_buffer);
   ep->write_staging_buffer = GRPC_SLICE_MALLOC(STAGING_BUFFER_SIZE);
   *cur = GRPC_SLICE_START_PTR(ep->write_staging_buffer);
   *end = GRPC_SLICE_END_PTR(ep->write_staging_buffer);
 }
 
-static void endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
-                           grpc_slice_buffer *slices, grpc_closure *cb) {
+static void endpoint_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* secure_ep,
+                           grpc_slice_buffer* slices, grpc_closure* cb) {
   GPR_TIMER_BEGIN("secure_endpoint.endpoint_write", 0);
 
   unsigned i;
   tsi_result result = TSI_OK;
-  secure_endpoint *ep = (secure_endpoint *)secure_ep;
-  uint8_t *cur = GRPC_SLICE_START_PTR(ep->write_staging_buffer);
-  uint8_t *end = GRPC_SLICE_END_PTR(ep->write_staging_buffer);
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
+  uint8_t* cur = GRPC_SLICE_START_PTR(ep->write_staging_buffer);
+  uint8_t* end = GRPC_SLICE_END_PTR(ep->write_staging_buffer);
 
   grpc_slice_buffer_reset_and_unref_internal(exec_ctx, &ep->output_buffer);
 
   if (grpc_trace_secure_endpoint.enabled()) {
     for (i = 0; i < slices->count; i++) {
-      char *data =
+      char* data =
           grpc_dump_slice(slices->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII);
       gpr_log(GPR_DEBUG, "WRITE %p: %s", ep, data);
       gpr_free(data);
@@ -286,7 +287,7 @@
     // Use frame protector to protect.
     for (i = 0; i < slices->count; i++) {
       grpc_slice plain = slices->slices[i];
-      uint8_t *message_bytes = GRPC_SLICE_START_PTR(plain);
+      uint8_t* message_bytes = GRPC_SLICE_START_PTR(plain);
       size_t message_size = GRPC_SLICE_LENGTH(plain);
       while (message_size > 0) {
         size_t protected_buffer_size_to_send = (size_t)(end - cur);
@@ -352,45 +353,52 @@
   GPR_TIMER_END("secure_endpoint.endpoint_write", 0);
 }
 
-static void endpoint_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *secure_ep,
-                              grpc_error *why) {
-  secure_endpoint *ep = (secure_endpoint *)secure_ep;
+static void endpoint_shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* secure_ep,
+                              grpc_error* why) {
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
   grpc_endpoint_shutdown(exec_ctx, ep->wrapped_ep, why);
 }
 
-static void endpoint_destroy(grpc_exec_ctx *exec_ctx,
-                             grpc_endpoint *secure_ep) {
-  secure_endpoint *ep = (secure_endpoint *)secure_ep;
+static void endpoint_destroy(grpc_exec_ctx* exec_ctx,
+                             grpc_endpoint* secure_ep) {
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
   SECURE_ENDPOINT_UNREF(exec_ctx, ep, "destroy");
 }
 
-static void endpoint_add_to_pollset(grpc_exec_ctx *exec_ctx,
-                                    grpc_endpoint *secure_ep,
-                                    grpc_pollset *pollset) {
-  secure_endpoint *ep = (secure_endpoint *)secure_ep;
+static void endpoint_add_to_pollset(grpc_exec_ctx* exec_ctx,
+                                    grpc_endpoint* secure_ep,
+                                    grpc_pollset* pollset) {
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
   grpc_endpoint_add_to_pollset(exec_ctx, ep->wrapped_ep, pollset);
 }
 
-static void endpoint_add_to_pollset_set(grpc_exec_ctx *exec_ctx,
-                                        grpc_endpoint *secure_ep,
-                                        grpc_pollset_set *pollset_set) {
-  secure_endpoint *ep = (secure_endpoint *)secure_ep;
+static void endpoint_add_to_pollset_set(grpc_exec_ctx* exec_ctx,
+                                        grpc_endpoint* secure_ep,
+                                        grpc_pollset_set* pollset_set) {
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
   grpc_endpoint_add_to_pollset_set(exec_ctx, ep->wrapped_ep, pollset_set);
 }
 
-static char *endpoint_get_peer(grpc_endpoint *secure_ep) {
-  secure_endpoint *ep = (secure_endpoint *)secure_ep;
+static void endpoint_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                             grpc_endpoint* secure_ep,
+                                             grpc_pollset_set* pollset_set) {
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
+  grpc_endpoint_delete_from_pollset_set(exec_ctx, ep->wrapped_ep, pollset_set);
+}
+
+static char* endpoint_get_peer(grpc_endpoint* secure_ep) {
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
   return grpc_endpoint_get_peer(ep->wrapped_ep);
 }
 
-static int endpoint_get_fd(grpc_endpoint *secure_ep) {
-  secure_endpoint *ep = (secure_endpoint *)secure_ep;
+static int endpoint_get_fd(grpc_endpoint* secure_ep) {
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
   return grpc_endpoint_get_fd(ep->wrapped_ep);
 }
 
-static grpc_resource_user *endpoint_get_resource_user(
-    grpc_endpoint *secure_ep) {
-  secure_endpoint *ep = (secure_endpoint *)secure_ep;
+static grpc_resource_user* endpoint_get_resource_user(
+    grpc_endpoint* secure_ep) {
+  secure_endpoint* ep = (secure_endpoint*)secure_ep;
   return grpc_endpoint_get_resource_user(ep->wrapped_ep);
 }
 
@@ -398,19 +406,20 @@
                                             endpoint_write,
                                             endpoint_add_to_pollset,
                                             endpoint_add_to_pollset_set,
+                                            endpoint_delete_from_pollset_set,
                                             endpoint_shutdown,
                                             endpoint_destroy,
                                             endpoint_get_resource_user,
                                             endpoint_get_peer,
                                             endpoint_get_fd};
 
-grpc_endpoint *grpc_secure_endpoint_create(
-    struct tsi_frame_protector *protector,
-    struct tsi_zero_copy_grpc_protector *zero_copy_protector,
-    grpc_endpoint *transport, grpc_slice *leftover_slices,
+grpc_endpoint* grpc_secure_endpoint_create(
+    struct tsi_frame_protector* protector,
+    struct tsi_zero_copy_grpc_protector* zero_copy_protector,
+    grpc_endpoint* transport, grpc_slice* leftover_slices,
     size_t leftover_nslices) {
   size_t i;
-  secure_endpoint *ep = (secure_endpoint *)gpr_malloc(sizeof(secure_endpoint));
+  secure_endpoint* ep = (secure_endpoint*)gpr_malloc(sizeof(secure_endpoint));
   ep->base.vtable = &vtable;
   ep->wrapped_ep = transport;
   ep->protector = protector;
diff --git a/src/core/lib/security/transport/secure_endpoint.h b/src/core/lib/security/transport/secure_endpoint.h
index 4748c88..92c4574 100644
--- a/src/core/lib/security/transport/secure_endpoint.h
+++ b/src/core/lib/security/transport/secure_endpoint.h
@@ -34,10 +34,10 @@
 /* Takes ownership of protector, zero_copy_protector, and to_wrap, and refs
  * leftover_slices. If zero_copy_protector is not NULL, protector will never be
  * used. */
-grpc_endpoint *grpc_secure_endpoint_create(
-    struct tsi_frame_protector *protector,
-    struct tsi_zero_copy_grpc_protector *zero_copy_protector,
-    grpc_endpoint *to_wrap, grpc_slice *leftover_slices,
+grpc_endpoint* grpc_secure_endpoint_create(
+    struct tsi_frame_protector* protector,
+    struct tsi_zero_copy_grpc_protector* zero_copy_protector,
+    grpc_endpoint* to_wrap, grpc_slice* leftover_slices,
     size_t leftover_nslices);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/security/transport/security_connector.cc b/src/core/lib/security/transport/security_connector.cc
index 9c5c53e..23e92c0 100644
--- a/src/core/lib/security/transport/security_connector.cc
+++ b/src/core/lib/security/transport/security_connector.cc
@@ -34,6 +34,7 @@
 #include "src/core/lib/security/context/security_context.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/core/lib/security/credentials/ssl/ssl_credentials.h"
 #include "src/core/lib/security/transport/lb_targets_info.h"
 #include "src/core/lib/security/transport/secure_endpoint.h"
 #include "src/core/lib/security/transport/security_handshaker.h"
@@ -51,9 +52,9 @@
 /* -- Constants. -- */
 
 #ifndef INSTALL_PREFIX
-static const char *installed_roots_path = "/usr/share/grpc/roots.pem";
+static const char* installed_roots_path = "/usr/share/grpc/roots.pem";
 #else
-static const char *installed_roots_path =
+static const char* installed_roots_path =
     INSTALL_PREFIX "/share/grpc/roots.pem";
 #endif
 
@@ -73,14 +74,14 @@
   "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384"
 
 static gpr_once cipher_suites_once = GPR_ONCE_INIT;
-static const char *cipher_suites = NULL;
+static const char* cipher_suites = NULL;
 
 static void init_cipher_suites(void) {
-  char *overridden = gpr_getenv("GRPC_SSL_CIPHER_SUITES");
+  char* overridden = gpr_getenv("GRPC_SSL_CIPHER_SUITES");
   cipher_suites = overridden != NULL ? overridden : GRPC_SSL_CIPHER_SUITES;
 }
 
-static const char *ssl_cipher_suites(void) {
+static const char* ssl_cipher_suites(void) {
   gpr_once_init(&cipher_suites_once, init_cipher_suites);
   return cipher_suites;
 }
@@ -88,12 +89,12 @@
 /* -- Common methods. -- */
 
 /* Returns the first property with that name. */
-const tsi_peer_property *tsi_peer_get_property_by_name(const tsi_peer *peer,
-                                                       const char *name) {
+const tsi_peer_property* tsi_peer_get_property_by_name(const tsi_peer* peer,
+                                                       const char* name) {
   size_t i;
   if (peer == NULL) return NULL;
   for (i = 0; i < peer->property_count; i++) {
-    const tsi_peer_property *property = &peer->properties[i];
+    const tsi_peer_property* property = &peer->properties[i];
     if (name == NULL && property->name == NULL) {
       return property;
     }
@@ -106,26 +107,26 @@
 }
 
 void grpc_channel_security_connector_add_handshakers(
-    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *connector,
-    grpc_handshake_manager *handshake_mgr) {
+    grpc_exec_ctx* exec_ctx, grpc_channel_security_connector* connector,
+    grpc_handshake_manager* handshake_mgr) {
   if (connector != NULL) {
     connector->add_handshakers(exec_ctx, connector, handshake_mgr);
   }
 }
 
 void grpc_server_security_connector_add_handshakers(
-    grpc_exec_ctx *exec_ctx, grpc_server_security_connector *connector,
-    grpc_handshake_manager *handshake_mgr) {
+    grpc_exec_ctx* exec_ctx, grpc_server_security_connector* connector,
+    grpc_handshake_manager* handshake_mgr) {
   if (connector != NULL) {
     connector->add_handshakers(exec_ctx, connector, handshake_mgr);
   }
 }
 
-void grpc_security_connector_check_peer(grpc_exec_ctx *exec_ctx,
-                                        grpc_security_connector *sc,
+void grpc_security_connector_check_peer(grpc_exec_ctx* exec_ctx,
+                                        grpc_security_connector* sc,
                                         tsi_peer peer,
-                                        grpc_auth_context **auth_context,
-                                        grpc_closure *on_peer_checked) {
+                                        grpc_auth_context** auth_context,
+                                        grpc_closure* on_peer_checked) {
   if (sc == NULL) {
     GRPC_CLOSURE_SCHED(exec_ctx, on_peer_checked,
                        GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -136,43 +137,43 @@
   }
 }
 
-int grpc_security_connector_cmp(grpc_security_connector *sc,
-                                grpc_security_connector *other) {
+int grpc_security_connector_cmp(grpc_security_connector* sc,
+                                grpc_security_connector* other) {
   if (sc == NULL || other == NULL) return GPR_ICMP(sc, other);
   int c = GPR_ICMP(sc->vtable, other->vtable);
   if (c != 0) return c;
   return sc->vtable->cmp(sc, other);
 }
 
-int grpc_channel_security_connector_cmp(grpc_channel_security_connector *sc1,
-                                        grpc_channel_security_connector *sc2) {
+int grpc_channel_security_connector_cmp(grpc_channel_security_connector* sc1,
+                                        grpc_channel_security_connector* sc2) {
   GPR_ASSERT(sc1->channel_creds != NULL);
   GPR_ASSERT(sc2->channel_creds != NULL);
   int c = GPR_ICMP(sc1->channel_creds, sc2->channel_creds);
   if (c != 0) return c;
   c = GPR_ICMP(sc1->request_metadata_creds, sc2->request_metadata_creds);
   if (c != 0) return c;
-  c = GPR_ICMP((void *)sc1->check_call_host, (void *)sc2->check_call_host);
+  c = GPR_ICMP((void*)sc1->check_call_host, (void*)sc2->check_call_host);
   if (c != 0) return c;
-  c = GPR_ICMP((void *)sc1->cancel_check_call_host,
-               (void *)sc2->cancel_check_call_host);
+  c = GPR_ICMP((void*)sc1->cancel_check_call_host,
+               (void*)sc2->cancel_check_call_host);
   if (c != 0) return c;
-  return GPR_ICMP((void *)sc1->add_handshakers, (void *)sc2->add_handshakers);
+  return GPR_ICMP((void*)sc1->add_handshakers, (void*)sc2->add_handshakers);
 }
 
-int grpc_server_security_connector_cmp(grpc_server_security_connector *sc1,
-                                       grpc_server_security_connector *sc2) {
+int grpc_server_security_connector_cmp(grpc_server_security_connector* sc1,
+                                       grpc_server_security_connector* sc2) {
   GPR_ASSERT(sc1->server_creds != NULL);
   GPR_ASSERT(sc2->server_creds != NULL);
   int c = GPR_ICMP(sc1->server_creds, sc2->server_creds);
   if (c != 0) return c;
-  return GPR_ICMP((void *)sc1->add_handshakers, (void *)sc2->add_handshakers);
+  return GPR_ICMP((void*)sc1->add_handshakers, (void*)sc2->add_handshakers);
 }
 
 bool grpc_channel_security_connector_check_call_host(
-    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
-    const char *host, grpc_auth_context *auth_context,
-    grpc_closure *on_call_host_checked, grpc_error **error) {
+    grpc_exec_ctx* exec_ctx, grpc_channel_security_connector* sc,
+    const char* host, grpc_auth_context* auth_context,
+    grpc_closure* on_call_host_checked, grpc_error** error) {
   if (sc == NULL || sc->check_call_host == NULL) {
     *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
         "cannot check call host -- no security connector");
@@ -183,8 +184,8 @@
 }
 
 void grpc_channel_security_connector_cancel_check_call_host(
-    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
-    grpc_closure *on_call_host_checked, grpc_error *error) {
+    grpc_exec_ctx* exec_ctx, grpc_channel_security_connector* sc,
+    grpc_closure* on_call_host_checked, grpc_error* error) {
   if (sc == NULL || sc->cancel_check_call_host == NULL) {
     GRPC_ERROR_UNREF(error);
     return;
@@ -193,9 +194,9 @@
 }
 
 #ifndef NDEBUG
-grpc_security_connector *grpc_security_connector_ref(
-    grpc_security_connector *sc, const char *file, int line,
-    const char *reason) {
+grpc_security_connector* grpc_security_connector_ref(
+    grpc_security_connector* sc, const char* file, int line,
+    const char* reason) {
   if (sc == NULL) return NULL;
   if (grpc_trace_security_connector_refcount.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&sc->refcount.count);
@@ -204,8 +205,8 @@
             val, val + 1, reason);
   }
 #else
-grpc_security_connector *grpc_security_connector_ref(
-    grpc_security_connector *sc) {
+grpc_security_connector* grpc_security_connector_ref(
+    grpc_security_connector* sc) {
   if (sc == NULL) return NULL;
 #endif
   gpr_ref(&sc->refcount);
@@ -213,10 +214,10 @@
 }
 
 #ifndef NDEBUG
-void grpc_security_connector_unref(grpc_exec_ctx *exec_ctx,
-                                   grpc_security_connector *sc,
-                                   const char *file, int line,
-                                   const char *reason) {
+void grpc_security_connector_unref(grpc_exec_ctx* exec_ctx,
+                                   grpc_security_connector* sc,
+                                   const char* file, int line,
+                                   const char* reason) {
   if (sc == NULL) return;
   if (grpc_trace_security_connector_refcount.enabled()) {
     gpr_atm val = gpr_atm_no_barrier_load(&sc->refcount.count);
@@ -225,87 +226,111 @@
             val, val - 1, reason);
   }
 #else
-void grpc_security_connector_unref(grpc_exec_ctx *exec_ctx,
-                                   grpc_security_connector *sc) {
+void grpc_security_connector_unref(grpc_exec_ctx* exec_ctx,
+                                   grpc_security_connector* sc) {
   if (sc == NULL) return;
 #endif
   if (gpr_unref(&sc->refcount)) sc->vtable->destroy(exec_ctx, sc);
 }
 
-static void connector_arg_destroy(grpc_exec_ctx *exec_ctx, void *p) {
-  GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, (grpc_security_connector *)p,
+static void connector_arg_destroy(grpc_exec_ctx* exec_ctx, void* p) {
+  GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, (grpc_security_connector*)p,
                                 "connector_arg_destroy");
 }
 
-static void *connector_arg_copy(void *p) {
-  return GRPC_SECURITY_CONNECTOR_REF((grpc_security_connector *)p,
+static void* connector_arg_copy(void* p) {
+  return GRPC_SECURITY_CONNECTOR_REF((grpc_security_connector*)p,
                                      "connector_arg_copy");
 }
 
-static int connector_cmp(void *a, void *b) {
-  return grpc_security_connector_cmp((grpc_security_connector *)a,
-                                     (grpc_security_connector *)b);
+static int connector_cmp(void* a, void* b) {
+  return grpc_security_connector_cmp((grpc_security_connector*)a,
+                                     (grpc_security_connector*)b);
 }
 
 static const grpc_arg_pointer_vtable connector_arg_vtable = {
     connector_arg_copy, connector_arg_destroy, connector_cmp};
 
-grpc_arg grpc_security_connector_to_arg(grpc_security_connector *sc) {
-  return grpc_channel_arg_pointer_create((char *)GRPC_ARG_SECURITY_CONNECTOR,
-                                         sc, &connector_arg_vtable);
+grpc_arg grpc_security_connector_to_arg(grpc_security_connector* sc) {
+  return grpc_channel_arg_pointer_create((char*)GRPC_ARG_SECURITY_CONNECTOR, sc,
+                                         &connector_arg_vtable);
 }
 
-grpc_security_connector *grpc_security_connector_from_arg(const grpc_arg *arg) {
+grpc_security_connector* grpc_security_connector_from_arg(const grpc_arg* arg) {
   if (strcmp(arg->key, GRPC_ARG_SECURITY_CONNECTOR)) return NULL;
   if (arg->type != GRPC_ARG_POINTER) {
     gpr_log(GPR_ERROR, "Invalid type %d for arg %s", arg->type,
             GRPC_ARG_SECURITY_CONNECTOR);
     return NULL;
   }
-  return (grpc_security_connector *)arg->value.pointer.p;
+  return (grpc_security_connector*)arg->value.pointer.p;
 }
 
-grpc_security_connector *grpc_security_connector_find_in_args(
-    const grpc_channel_args *args) {
+grpc_security_connector* grpc_security_connector_find_in_args(
+    const grpc_channel_args* args) {
   size_t i;
   if (args == NULL) return NULL;
   for (i = 0; i < args->num_args; i++) {
-    grpc_security_connector *sc =
+    grpc_security_connector* sc =
         grpc_security_connector_from_arg(&args->args[i]);
     if (sc != NULL) return sc;
   }
   return NULL;
 }
 
+static tsi_client_certificate_request_type
+get_tsi_client_certificate_request_type(
+    grpc_ssl_client_certificate_request_type grpc_request_type) {
+  switch (grpc_request_type) {
+    case GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE:
+      return TSI_DONT_REQUEST_CLIENT_CERTIFICATE;
+
+    case GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY:
+      return TSI_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY;
+
+    case GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY:
+      return TSI_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY;
+
+    case GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY:
+      return TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY;
+
+    case GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY:
+      return TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY;
+
+    default:
+      return TSI_DONT_REQUEST_CLIENT_CERTIFICATE;
+  }
+}
+
 /* -- Fake implementation. -- */
 
 typedef struct {
   grpc_channel_security_connector base;
-  char *target;
-  char *expected_targets;
+  char* target;
+  char* expected_targets;
   bool is_lb_channel;
 } grpc_fake_channel_security_connector;
 
-static void fake_channel_destroy(grpc_exec_ctx *exec_ctx,
-                                 grpc_security_connector *sc) {
-  grpc_fake_channel_security_connector *c =
-      (grpc_fake_channel_security_connector *)sc;
+static void fake_channel_destroy(grpc_exec_ctx* exec_ctx,
+                                 grpc_security_connector* sc) {
+  grpc_fake_channel_security_connector* c =
+      (grpc_fake_channel_security_connector*)sc;
   grpc_call_credentials_unref(exec_ctx, c->base.request_metadata_creds);
   gpr_free(c->target);
   gpr_free(c->expected_targets);
   gpr_free(c);
 }
 
-static void fake_server_destroy(grpc_exec_ctx *exec_ctx,
-                                grpc_security_connector *sc) {
+static void fake_server_destroy(grpc_exec_ctx* exec_ctx,
+                                grpc_security_connector* sc) {
   gpr_free(sc);
 }
 
-static bool fake_check_target(const char *target_type, const char *target,
-                              const char *set_str) {
+static bool fake_check_target(const char* target_type, const char* target,
+                              const char* set_str) {
   GPR_ASSERT(target_type != NULL);
   GPR_ASSERT(target != NULL);
-  char **set = NULL;
+  char** set = NULL;
   size_t set_size = 0;
   gpr_string_split(set_str, ",", &set, &set_size);
   bool found = false;
@@ -319,11 +344,11 @@
   return found;
 }
 
-static void fake_secure_name_check(const char *target,
-                                   const char *expected_targets,
+static void fake_secure_name_check(const char* target,
+                                   const char* expected_targets,
                                    bool is_lb_channel) {
   if (expected_targets == NULL) return;
-  char **lbs_and_backends = NULL;
+  char** lbs_and_backends = NULL;
   size_t lbs_and_backends_size = 0;
   bool success = false;
   gpr_string_split(expected_targets, ";", &lbs_and_backends,
@@ -363,12 +388,12 @@
   if (!success) abort();
 }
 
-static void fake_check_peer(grpc_exec_ctx *exec_ctx,
-                            grpc_security_connector *sc, tsi_peer peer,
-                            grpc_auth_context **auth_context,
-                            grpc_closure *on_peer_checked) {
-  const char *prop_name;
-  grpc_error *error = GRPC_ERROR_NONE;
+static void fake_check_peer(grpc_exec_ctx* exec_ctx,
+                            grpc_security_connector* sc, tsi_peer peer,
+                            grpc_auth_context** auth_context,
+                            grpc_closure* on_peer_checked) {
+  const char* prop_name;
+  grpc_error* error = GRPC_ERROR_NONE;
   *auth_context = NULL;
   if (peer.property_count != 1) {
     error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -378,7 +403,7 @@
   prop_name = peer.properties[0].name;
   if (prop_name == NULL ||
       strcmp(prop_name, TSI_CERTIFICATE_TYPE_PEER_PROPERTY)) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "Unexpected property in fake peer: %s.",
                  prop_name == NULL ? "<EMPTY>" : prop_name);
     error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
@@ -400,29 +425,29 @@
   tsi_peer_destruct(&peer);
 }
 
-static void fake_channel_check_peer(grpc_exec_ctx *exec_ctx,
-                                    grpc_security_connector *sc, tsi_peer peer,
-                                    grpc_auth_context **auth_context,
-                                    grpc_closure *on_peer_checked) {
+static void fake_channel_check_peer(grpc_exec_ctx* exec_ctx,
+                                    grpc_security_connector* sc, tsi_peer peer,
+                                    grpc_auth_context** auth_context,
+                                    grpc_closure* on_peer_checked) {
   fake_check_peer(exec_ctx, sc, peer, auth_context, on_peer_checked);
-  grpc_fake_channel_security_connector *c =
-      (grpc_fake_channel_security_connector *)sc;
+  grpc_fake_channel_security_connector* c =
+      (grpc_fake_channel_security_connector*)sc;
   fake_secure_name_check(c->target, c->expected_targets, c->is_lb_channel);
 }
 
-static void fake_server_check_peer(grpc_exec_ctx *exec_ctx,
-                                   grpc_security_connector *sc, tsi_peer peer,
-                                   grpc_auth_context **auth_context,
-                                   grpc_closure *on_peer_checked) {
+static void fake_server_check_peer(grpc_exec_ctx* exec_ctx,
+                                   grpc_security_connector* sc, tsi_peer peer,
+                                   grpc_auth_context** auth_context,
+                                   grpc_closure* on_peer_checked) {
   fake_check_peer(exec_ctx, sc, peer, auth_context, on_peer_checked);
 }
 
-static int fake_channel_cmp(grpc_security_connector *sc1,
-                            grpc_security_connector *sc2) {
-  grpc_fake_channel_security_connector *c1 =
-      (grpc_fake_channel_security_connector *)sc1;
-  grpc_fake_channel_security_connector *c2 =
-      (grpc_fake_channel_security_connector *)sc2;
+static int fake_channel_cmp(grpc_security_connector* sc1,
+                            grpc_security_connector* sc2) {
+  grpc_fake_channel_security_connector* c1 =
+      (grpc_fake_channel_security_connector*)sc1;
+  grpc_fake_channel_security_connector* c2 =
+      (grpc_fake_channel_security_connector*)sc2;
   int c = grpc_channel_security_connector_cmp(&c1->base, &c2->base);
   if (c != 0) return c;
   c = strcmp(c1->target, c2->target);
@@ -436,31 +461,31 @@
   return GPR_ICMP(c1->is_lb_channel, c2->is_lb_channel);
 }
 
-static int fake_server_cmp(grpc_security_connector *sc1,
-                           grpc_security_connector *sc2) {
+static int fake_server_cmp(grpc_security_connector* sc1,
+                           grpc_security_connector* sc2) {
   return grpc_server_security_connector_cmp(
-      (grpc_server_security_connector *)sc1,
-      (grpc_server_security_connector *)sc2);
+      (grpc_server_security_connector*)sc1,
+      (grpc_server_security_connector*)sc2);
 }
 
-static bool fake_channel_check_call_host(grpc_exec_ctx *exec_ctx,
-                                         grpc_channel_security_connector *sc,
-                                         const char *host,
-                                         grpc_auth_context *auth_context,
-                                         grpc_closure *on_call_host_checked,
-                                         grpc_error **error) {
+static bool fake_channel_check_call_host(grpc_exec_ctx* exec_ctx,
+                                         grpc_channel_security_connector* sc,
+                                         const char* host,
+                                         grpc_auth_context* auth_context,
+                                         grpc_closure* on_call_host_checked,
+                                         grpc_error** error) {
   return true;
 }
 
 static void fake_channel_cancel_check_call_host(
-    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
-    grpc_closure *on_call_host_checked, grpc_error *error) {
+    grpc_exec_ctx* exec_ctx, grpc_channel_security_connector* sc,
+    grpc_closure* on_call_host_checked, grpc_error* error) {
   GRPC_ERROR_UNREF(error);
 }
 
 static void fake_channel_add_handshakers(
-    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
-    grpc_handshake_manager *handshake_mgr) {
+    grpc_exec_ctx* exec_ctx, grpc_channel_security_connector* sc,
+    grpc_handshake_manager* handshake_mgr) {
   grpc_handshake_manager_add(
       handshake_mgr,
       grpc_security_handshaker_create(
@@ -468,9 +493,9 @@
           &sc->base));
 }
 
-static void fake_server_add_handshakers(grpc_exec_ctx *exec_ctx,
-                                        grpc_server_security_connector *sc,
-                                        grpc_handshake_manager *handshake_mgr) {
+static void fake_server_add_handshakers(grpc_exec_ctx* exec_ctx,
+                                        grpc_server_security_connector* sc,
+                                        grpc_handshake_manager* handshake_mgr) {
   grpc_handshake_manager_add(
       handshake_mgr,
       grpc_security_handshaker_create(
@@ -484,12 +509,12 @@
 static grpc_security_connector_vtable fake_server_vtable = {
     fake_server_destroy, fake_server_check_peer, fake_server_cmp};
 
-grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
-    grpc_channel_credentials *channel_creds,
-    grpc_call_credentials *request_metadata_creds, const char *target,
-    const grpc_channel_args *args) {
-  grpc_fake_channel_security_connector *c =
-      (grpc_fake_channel_security_connector *)gpr_zalloc(sizeof(*c));
+grpc_channel_security_connector* grpc_fake_channel_security_connector_create(
+    grpc_channel_credentials* channel_creds,
+    grpc_call_credentials* request_metadata_creds, const char* target,
+    const grpc_channel_args* args) {
+  grpc_fake_channel_security_connector* c =
+      (grpc_fake_channel_security_connector*)gpr_zalloc(sizeof(*c));
   gpr_ref_init(&c->base.base.refcount, 1);
   c->base.base.url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
   c->base.base.vtable = &fake_channel_vtable;
@@ -500,16 +525,16 @@
   c->base.cancel_check_call_host = fake_channel_cancel_check_call_host;
   c->base.add_handshakers = fake_channel_add_handshakers;
   c->target = gpr_strdup(target);
-  const char *expected_targets = grpc_fake_transport_get_expected_targets(args);
+  const char* expected_targets = grpc_fake_transport_get_expected_targets(args);
   c->expected_targets = gpr_strdup(expected_targets);
   c->is_lb_channel = (grpc_lb_targets_info_find_in_args(args) != NULL);
   return &c->base;
 }
 
-grpc_server_security_connector *grpc_fake_server_security_connector_create(
-    grpc_server_credentials *server_creds) {
-  grpc_server_security_connector *c =
-      (grpc_server_security_connector *)gpr_zalloc(
+grpc_server_security_connector* grpc_fake_server_security_connector_create(
+    grpc_server_credentials* server_creds) {
+  grpc_server_security_connector* c =
+      (grpc_server_security_connector*)gpr_zalloc(
           sizeof(grpc_server_security_connector));
   gpr_ref_init(&c->base.refcount, 1);
   c->base.vtable = &fake_server_vtable;
@@ -523,20 +548,29 @@
 
 typedef struct {
   grpc_channel_security_connector base;
-  tsi_ssl_client_handshaker_factory *client_handshaker_factory;
-  char *target_name;
-  char *overridden_target_name;
+  tsi_ssl_client_handshaker_factory* client_handshaker_factory;
+  char* target_name;
+  char* overridden_target_name;
 } grpc_ssl_channel_security_connector;
 
 typedef struct {
   grpc_server_security_connector base;
-  tsi_ssl_server_handshaker_factory *server_handshaker_factory;
+  tsi_ssl_server_handshaker_factory* server_handshaker_factory;
 } grpc_ssl_server_security_connector;
 
-static void ssl_channel_destroy(grpc_exec_ctx *exec_ctx,
-                                grpc_security_connector *sc) {
-  grpc_ssl_channel_security_connector *c =
-      (grpc_ssl_channel_security_connector *)sc;
+static bool server_connector_has_cert_config_fetcher(
+    grpc_ssl_server_security_connector* c) {
+  GPR_ASSERT(c != NULL);
+  grpc_ssl_server_credentials* server_creds =
+      (grpc_ssl_server_credentials*)c->base.server_creds;
+  GPR_ASSERT(server_creds != NULL);
+  return server_creds->certificate_config_fetcher.cb != NULL;
+}
+
+static void ssl_channel_destroy(grpc_exec_ctx* exec_ctx,
+                                grpc_security_connector* sc) {
+  grpc_ssl_channel_security_connector* c =
+      (grpc_ssl_channel_security_connector*)sc;
   grpc_channel_credentials_unref(exec_ctx, c->base.channel_creds);
   grpc_call_credentials_unref(exec_ctx, c->base.request_metadata_creds);
   tsi_ssl_client_handshaker_factory_unref(c->client_handshaker_factory);
@@ -546,23 +580,23 @@
   gpr_free(sc);
 }
 
-static void ssl_server_destroy(grpc_exec_ctx *exec_ctx,
-                               grpc_security_connector *sc) {
-  grpc_ssl_server_security_connector *c =
-      (grpc_ssl_server_security_connector *)sc;
+static void ssl_server_destroy(grpc_exec_ctx* exec_ctx,
+                               grpc_security_connector* sc) {
+  grpc_ssl_server_security_connector* c =
+      (grpc_ssl_server_security_connector*)sc;
   grpc_server_credentials_unref(exec_ctx, c->base.server_creds);
   tsi_ssl_server_handshaker_factory_unref(c->server_handshaker_factory);
   c->server_handshaker_factory = NULL;
   gpr_free(sc);
 }
 
-static void ssl_channel_add_handshakers(grpc_exec_ctx *exec_ctx,
-                                        grpc_channel_security_connector *sc,
-                                        grpc_handshake_manager *handshake_mgr) {
-  grpc_ssl_channel_security_connector *c =
-      (grpc_ssl_channel_security_connector *)sc;
+static void ssl_channel_add_handshakers(grpc_exec_ctx* exec_ctx,
+                                        grpc_channel_security_connector* sc,
+                                        grpc_handshake_manager* handshake_mgr) {
+  grpc_ssl_channel_security_connector* c =
+      (grpc_ssl_channel_security_connector*)sc;
   // Instantiate TSI handshaker.
-  tsi_handshaker *tsi_hs = NULL;
+  tsi_handshaker* tsi_hs = NULL;
   tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker(
       c->client_handshaker_factory,
       c->overridden_target_name != NULL ? c->overridden_target_name
@@ -573,7 +607,6 @@
             tsi_result_to_string(result));
     return;
   }
-
   // Create handshakers.
   grpc_handshake_manager_add(
       handshake_mgr,
@@ -581,13 +614,103 @@
           exec_ctx, tsi_create_adapter_handshaker(tsi_hs), &sc->base));
 }
 
-static void ssl_server_add_handshakers(grpc_exec_ctx *exec_ctx,
-                                       grpc_server_security_connector *sc,
-                                       grpc_handshake_manager *handshake_mgr) {
-  grpc_ssl_server_security_connector *c =
-      (grpc_ssl_server_security_connector *)sc;
+static const char** fill_alpn_protocol_strings(size_t* num_alpn_protocols) {
+  GPR_ASSERT(num_alpn_protocols != NULL);
+  *num_alpn_protocols = grpc_chttp2_num_alpn_versions();
+  const char** alpn_protocol_strings =
+      (const char**)gpr_malloc(sizeof(const char*) * (*num_alpn_protocols));
+  for (size_t i = 0; i < *num_alpn_protocols; i++) {
+    alpn_protocol_strings[i] = grpc_chttp2_get_alpn_version_index(i);
+  }
+  return alpn_protocol_strings;
+}
+
+/* Attempts to replace the server_handshaker_factory with a new factory using
+ * the provided grpc_ssl_server_certificate_config. Should new factory creation
+ * fail, the existing factory will not be replaced. Returns true on success (new
+ * factory created). */
+static bool try_replace_server_handshaker_factory(
+    grpc_ssl_server_security_connector* sc,
+    const grpc_ssl_server_certificate_config* config) {
+  if (config == NULL) {
+    gpr_log(GPR_ERROR,
+            "Server certificate config callback returned invalid (NULL) "
+            "config.");
+    return false;
+  }
+  gpr_log(GPR_DEBUG, "Using new server certificate config (%p).", config);
+
+  size_t num_alpn_protocols = 0;
+  const char** alpn_protocol_strings =
+      fill_alpn_protocol_strings(&num_alpn_protocols);
+  tsi_ssl_pem_key_cert_pair* cert_pairs = grpc_convert_grpc_to_tsi_cert_pairs(
+      config->pem_key_cert_pairs, config->num_key_cert_pairs);
+  tsi_ssl_server_handshaker_factory* new_handshaker_factory = NULL;
+  grpc_ssl_server_credentials* server_creds =
+      (grpc_ssl_server_credentials*)sc->base.server_creds;
+  tsi_result result = tsi_create_ssl_server_handshaker_factory_ex(
+      cert_pairs, config->num_key_cert_pairs, config->pem_root_certs,
+      get_tsi_client_certificate_request_type(
+          server_creds->config.client_certificate_request),
+      ssl_cipher_suites(), alpn_protocol_strings, (uint16_t)num_alpn_protocols,
+      &new_handshaker_factory);
+  gpr_free(cert_pairs);
+  gpr_free((void*)alpn_protocol_strings);
+
+  if (result != TSI_OK) {
+    gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
+            tsi_result_to_string(result));
+    return false;
+  }
+  tsi_ssl_server_handshaker_factory_unref(sc->server_handshaker_factory);
+  sc->server_handshaker_factory = new_handshaker_factory;
+  return true;
+}
+
+/* Attempts to fetch the server certificate config if a callback is available.
+ * Current certificate config will continue to be used if the callback returns
+ * an error. Returns true if new credentials were sucessfully loaded. */
+static bool try_fetch_ssl_server_credentials(
+    grpc_ssl_server_security_connector* sc) {
+  grpc_ssl_server_certificate_config* certificate_config = NULL;
+  bool status;
+
+  GPR_ASSERT(sc != NULL);
+  if (!server_connector_has_cert_config_fetcher(sc)) return false;
+
+  grpc_ssl_server_credentials* server_creds =
+      (grpc_ssl_server_credentials*)sc->base.server_creds;
+  grpc_ssl_certificate_config_reload_status cb_result =
+      server_creds->certificate_config_fetcher.cb(
+          server_creds->certificate_config_fetcher.user_data,
+          &certificate_config);
+  if (cb_result == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED) {
+    gpr_log(GPR_DEBUG, "No change in SSL server credentials.");
+    status = false;
+  } else if (cb_result == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW) {
+    status = try_replace_server_handshaker_factory(sc, certificate_config);
+  } else {
+    // Log error, continue using previously-loaded credentials.
+    gpr_log(GPR_ERROR,
+            "Failed fetching new server credentials, continuing to "
+            "use previously-loaded credentials.");
+    status = false;
+  }
+
+  if (certificate_config != NULL) {
+    grpc_ssl_server_certificate_config_destroy(certificate_config);
+  }
+  return status;
+}
+
+static void ssl_server_add_handshakers(grpc_exec_ctx* exec_ctx,
+                                       grpc_server_security_connector* sc,
+                                       grpc_handshake_manager* handshake_mgr) {
+  grpc_ssl_server_security_connector* c =
+      (grpc_ssl_server_security_connector*)sc;
   // Instantiate TSI handshaker.
-  tsi_handshaker *tsi_hs = NULL;
+  try_fetch_ssl_server_credentials(c);
+  tsi_handshaker* tsi_hs = NULL;
   tsi_result result = tsi_ssl_server_handshaker_factory_create_handshaker(
       c->server_handshaker_factory, &tsi_hs);
   if (result != TSI_OK) {
@@ -595,7 +718,6 @@
             tsi_result_to_string(result));
     return;
   }
-
   // Create handshakers.
   grpc_handshake_manager_add(
       handshake_mgr,
@@ -603,12 +725,12 @@
           exec_ctx, tsi_create_adapter_handshaker(tsi_hs), &sc->base));
 }
 
-static int ssl_host_matches_name(const tsi_peer *peer, const char *peer_name) {
-  char *allocated_name = NULL;
+static int ssl_host_matches_name(const tsi_peer* peer, const char* peer_name) {
+  char* allocated_name = NULL;
   int r;
 
   if (strchr(peer_name, ':') != NULL) {
-    char *ignored_port;
+    char* ignored_port;
     gpr_split_host_port(peer_name, &allocated_name, &ignored_port);
     gpr_free(ignored_port);
     peer_name = allocated_name;
@@ -619,10 +741,10 @@
   return r;
 }
 
-grpc_auth_context *tsi_ssl_peer_to_auth_context(const tsi_peer *peer) {
+grpc_auth_context* tsi_ssl_peer_to_auth_context(const tsi_peer* peer) {
   size_t i;
-  grpc_auth_context *ctx = NULL;
-  const char *peer_identity_property_name = NULL;
+  grpc_auth_context* ctx = NULL;
+  const char* peer_identity_property_name = NULL;
 
   /* The caller has checked the certificate type property. */
   GPR_ASSERT(peer->property_count >= 1);
@@ -631,7 +753,7 @@
       ctx, GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
       GRPC_SSL_TRANSPORT_SECURITY_TYPE);
   for (i = 0; i < peer->property_count; i++) {
-    const tsi_peer_property *prop = &peer->properties[i];
+    const tsi_peer_property* prop = &peer->properties[i];
     if (prop->name == NULL) continue;
     if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) {
       /* If there is no subject alt name, have the CN as the identity. */
@@ -657,11 +779,11 @@
   return ctx;
 }
 
-static grpc_error *ssl_check_peer(grpc_security_connector *sc,
-                                  const char *peer_name, const tsi_peer *peer,
-                                  grpc_auth_context **auth_context) {
+static grpc_error* ssl_check_peer(grpc_security_connector* sc,
+                                  const char* peer_name, const tsi_peer* peer,
+                                  grpc_auth_context** auth_context) {
   /* Check the ALPN. */
-  const tsi_peer_property *p =
+  const tsi_peer_property* p =
       tsi_peer_get_property_by_name(peer, TSI_SSL_ALPN_SELECTED_PROTOCOL);
   if (p == NULL) {
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -674,9 +796,9 @@
 
   /* Check the peer name if specified. */
   if (peer_name != NULL && !ssl_host_matches_name(peer, peer_name)) {
-    char *msg;
+    char* msg;
     gpr_asprintf(&msg, "Peer name %s is not in peer certificate", peer_name);
-    grpc_error *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
+    grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
     gpr_free(msg);
     return error;
   }
@@ -684,35 +806,36 @@
   return GRPC_ERROR_NONE;
 }
 
-static void ssl_channel_check_peer(grpc_exec_ctx *exec_ctx,
-                                   grpc_security_connector *sc, tsi_peer peer,
-                                   grpc_auth_context **auth_context,
-                                   grpc_closure *on_peer_checked) {
-  grpc_ssl_channel_security_connector *c =
-      (grpc_ssl_channel_security_connector *)sc;
-  grpc_error *error = ssl_check_peer(sc, c->overridden_target_name != NULL
-                                             ? c->overridden_target_name
-                                             : c->target_name,
+static void ssl_channel_check_peer(grpc_exec_ctx* exec_ctx,
+                                   grpc_security_connector* sc, tsi_peer peer,
+                                   grpc_auth_context** auth_context,
+                                   grpc_closure* on_peer_checked) {
+  grpc_ssl_channel_security_connector* c =
+      (grpc_ssl_channel_security_connector*)sc;
+  grpc_error* error = ssl_check_peer(sc,
+                                     c->overridden_target_name != NULL
+                                         ? c->overridden_target_name
+                                         : c->target_name,
                                      &peer, auth_context);
   GRPC_CLOSURE_SCHED(exec_ctx, on_peer_checked, error);
   tsi_peer_destruct(&peer);
 }
 
-static void ssl_server_check_peer(grpc_exec_ctx *exec_ctx,
-                                  grpc_security_connector *sc, tsi_peer peer,
-                                  grpc_auth_context **auth_context,
-                                  grpc_closure *on_peer_checked) {
-  grpc_error *error = ssl_check_peer(sc, NULL, &peer, auth_context);
+static void ssl_server_check_peer(grpc_exec_ctx* exec_ctx,
+                                  grpc_security_connector* sc, tsi_peer peer,
+                                  grpc_auth_context** auth_context,
+                                  grpc_closure* on_peer_checked) {
+  grpc_error* error = ssl_check_peer(sc, NULL, &peer, auth_context);
   tsi_peer_destruct(&peer);
   GRPC_CLOSURE_SCHED(exec_ctx, on_peer_checked, error);
 }
 
-static int ssl_channel_cmp(grpc_security_connector *sc1,
-                           grpc_security_connector *sc2) {
-  grpc_ssl_channel_security_connector *c1 =
-      (grpc_ssl_channel_security_connector *)sc1;
-  grpc_ssl_channel_security_connector *c2 =
-      (grpc_ssl_channel_security_connector *)sc2;
+static int ssl_channel_cmp(grpc_security_connector* sc1,
+                           grpc_security_connector* sc2) {
+  grpc_ssl_channel_security_connector* c1 =
+      (grpc_ssl_channel_security_connector*)sc1;
+  grpc_ssl_channel_security_connector* c2 =
+      (grpc_ssl_channel_security_connector*)sc2;
   int c = grpc_channel_security_connector_cmp(&c1->base, &c2->base);
   if (c != 0) return c;
   c = strcmp(c1->target_name, c2->target_name);
@@ -723,27 +846,27 @@
              : strcmp(c1->overridden_target_name, c2->overridden_target_name);
 }
 
-static int ssl_server_cmp(grpc_security_connector *sc1,
-                          grpc_security_connector *sc2) {
+static int ssl_server_cmp(grpc_security_connector* sc1,
+                          grpc_security_connector* sc2) {
   return grpc_server_security_connector_cmp(
-      (grpc_server_security_connector *)sc1,
-      (grpc_server_security_connector *)sc2);
+      (grpc_server_security_connector*)sc1,
+      (grpc_server_security_connector*)sc2);
 }
 
-static void add_shallow_auth_property_to_peer(tsi_peer *peer,
-                                              const grpc_auth_property *prop,
-                                              const char *tsi_prop_name) {
-  tsi_peer_property *tsi_prop = &peer->properties[peer->property_count++];
-  tsi_prop->name = (char *)tsi_prop_name;
+static void add_shallow_auth_property_to_peer(tsi_peer* peer,
+                                              const grpc_auth_property* prop,
+                                              const char* tsi_prop_name) {
+  tsi_peer_property* tsi_prop = &peer->properties[peer->property_count++];
+  tsi_prop->name = (char*)tsi_prop_name;
   tsi_prop->value.data = prop->value;
   tsi_prop->value.length = prop->value_length;
 }
 
 tsi_peer tsi_shallow_peer_from_ssl_auth_context(
-    const grpc_auth_context *auth_context) {
+    const grpc_auth_context* auth_context) {
   size_t max_num_props = 0;
   grpc_auth_property_iterator it;
-  const grpc_auth_property *prop;
+  const grpc_auth_property* prop;
   tsi_peer peer;
   memset(&peer, 0, sizeof(peer));
 
@@ -751,8 +874,8 @@
   while (grpc_auth_property_iterator_next(&it) != NULL) max_num_props++;
 
   if (max_num_props > 0) {
-    peer.properties = (tsi_peer_property *)gpr_malloc(
-        max_num_props * sizeof(tsi_peer_property));
+    peer.properties = (tsi_peer_property*)gpr_malloc(max_num_props *
+                                                     sizeof(tsi_peer_property));
     it = grpc_auth_context_property_iterator(auth_context);
     while ((prop = grpc_auth_property_iterator_next(&it)) != NULL) {
       if (strcmp(prop->name, GRPC_X509_SAN_PROPERTY_NAME) == 0) {
@@ -770,18 +893,18 @@
   return peer;
 }
 
-void tsi_shallow_peer_destruct(tsi_peer *peer) {
+void tsi_shallow_peer_destruct(tsi_peer* peer) {
   if (peer->properties != NULL) gpr_free(peer->properties);
 }
 
-static bool ssl_channel_check_call_host(grpc_exec_ctx *exec_ctx,
-                                        grpc_channel_security_connector *sc,
-                                        const char *host,
-                                        grpc_auth_context *auth_context,
-                                        grpc_closure *on_call_host_checked,
-                                        grpc_error **error) {
-  grpc_ssl_channel_security_connector *c =
-      (grpc_ssl_channel_security_connector *)sc;
+static bool ssl_channel_check_call_host(grpc_exec_ctx* exec_ctx,
+                                        grpc_channel_security_connector* sc,
+                                        const char* host,
+                                        grpc_auth_context* auth_context,
+                                        grpc_closure* on_call_host_checked,
+                                        grpc_error** error) {
+  grpc_ssl_channel_security_connector* c =
+      (grpc_ssl_channel_security_connector*)sc;
   grpc_security_status status = GRPC_SECURITY_ERROR;
   tsi_peer peer = tsi_shallow_peer_from_ssl_auth_context(auth_context);
   if (ssl_host_matches_name(&peer, host)) status = GRPC_SECURITY_OK;
@@ -800,8 +923,8 @@
 }
 
 static void ssl_channel_cancel_check_call_host(
-    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
-    grpc_closure *on_call_host_checked, grpc_error *error) {
+    grpc_exec_ctx* exec_ctx, grpc_channel_security_connector* sc,
+    grpc_closure* on_call_host_checked, grpc_error* error) {
   GRPC_ERROR_UNREF(error);
 }
 
@@ -816,7 +939,7 @@
   grpc_slice result = grpc_empty_slice();
 
   /* First try to load the roots from the environment. */
-  char *default_root_certs_path =
+  char* default_root_certs_path =
       gpr_getenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR);
   if (default_root_certs_path != NULL) {
     GRPC_LOG_IF_ERROR("load_file",
@@ -827,7 +950,7 @@
   /* Try overridden roots if needed. */
   grpc_ssl_roots_override_result ovrd_res = GRPC_SSL_ROOTS_OVERRIDE_FAIL;
   if (GRPC_SLICE_IS_EMPTY(result) && ssl_roots_override_cb != NULL) {
-    char *pem_root_certs = NULL;
+    char* pem_root_certs = NULL;
     ovrd_res = ssl_roots_override_cb(&pem_root_certs);
     if (ovrd_res == GRPC_SSL_ROOTS_OVERRIDE_OK) {
       GPR_ASSERT(pem_root_certs != NULL);
@@ -857,58 +980,29 @@
   return compute_default_pem_root_certs_once();
 }
 
-static tsi_client_certificate_request_type
-get_tsi_client_certificate_request_type(
-    grpc_ssl_client_certificate_request_type grpc_request_type) {
-  switch (grpc_request_type) {
-    case GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE:
-      return TSI_DONT_REQUEST_CLIENT_CERTIFICATE;
-
-    case GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY:
-      return TSI_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY;
-
-    case GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY:
-      return TSI_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY;
-
-    case GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY:
-      return TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY;
-
-    case GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY:
-      return TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY;
-
-    default:
-      // Is this a sane default
-      return TSI_DONT_REQUEST_CLIENT_CERTIFICATE;
-  }
-}
-
-const char *grpc_get_default_ssl_roots(void) {
+const char* grpc_get_default_ssl_roots(void) {
   /* TODO(jboeuf@google.com): Maybe revisit the approach which consists in
      loading all the roots once for the lifetime of the process. */
   static gpr_once once = GPR_ONCE_INIT;
   gpr_once_init(&once, init_default_pem_root_certs);
   return GRPC_SLICE_IS_EMPTY(default_pem_root_certs)
              ? NULL
-             : (const char *)GRPC_SLICE_START_PTR(default_pem_root_certs);
+             : (const char*)GRPC_SLICE_START_PTR(default_pem_root_certs);
 }
 
 grpc_security_status grpc_ssl_channel_security_connector_create(
-    grpc_exec_ctx *exec_ctx, grpc_channel_credentials *channel_creds,
-    grpc_call_credentials *request_metadata_creds,
-    const grpc_ssl_config *config, const char *target_name,
-    const char *overridden_target_name, grpc_channel_security_connector **sc) {
-  size_t num_alpn_protocols = grpc_chttp2_num_alpn_versions();
-  const char **alpn_protocol_strings =
-      (const char **)gpr_malloc(sizeof(const char *) * num_alpn_protocols);
+    grpc_exec_ctx* exec_ctx, grpc_channel_credentials* channel_creds,
+    grpc_call_credentials* request_metadata_creds,
+    const grpc_ssl_config* config, const char* target_name,
+    const char* overridden_target_name, grpc_channel_security_connector** sc) {
+  size_t num_alpn_protocols = 0;
+  const char** alpn_protocol_strings =
+      fill_alpn_protocol_strings(&num_alpn_protocols);
   tsi_result result = TSI_OK;
-  grpc_ssl_channel_security_connector *c;
-  size_t i;
-  const char *pem_root_certs;
-  char *port;
+  grpc_ssl_channel_security_connector* c;
+  const char* pem_root_certs;
+  char* port;
   bool has_key_cert_pair;
-  for (i = 0; i < num_alpn_protocols; i++) {
-    alpn_protocol_strings[i] = grpc_chttp2_get_alpn_version_index(i);
-  }
 
   if (config == NULL || target_name == NULL) {
     gpr_log(GPR_ERROR, "An ssl channel needs a config and a target name.");
@@ -924,7 +1018,7 @@
     pem_root_certs = config->pem_root_certs;
   }
 
-  c = (grpc_ssl_channel_security_connector *)gpr_zalloc(
+  c = (grpc_ssl_channel_security_connector*)gpr_zalloc(
       sizeof(grpc_ssl_channel_security_connector));
 
   gpr_ref_init(&c->base.base.refcount, 1);
@@ -942,10 +1036,11 @@
     c->overridden_target_name = gpr_strdup(overridden_target_name);
   }
 
-  has_key_cert_pair = config->pem_key_cert_pair.private_key != NULL &&
-                      config->pem_key_cert_pair.cert_chain != NULL;
+  has_key_cert_pair = config->pem_key_cert_pair != NULL &&
+                      config->pem_key_cert_pair->private_key != NULL &&
+                      config->pem_key_cert_pair->cert_chain != NULL;
   result = tsi_create_ssl_client_handshaker_factory(
-      has_key_cert_pair ? &config->pem_key_cert_pair : NULL, pem_root_certs,
+      has_key_cert_pair ? config->pem_key_cert_pair : NULL, pem_root_certs,
       ssl_cipher_suites(), alpn_protocol_strings, (uint16_t)num_alpn_protocols,
       &c->client_handshaker_factory);
   if (result != TSI_OK) {
@@ -956,58 +1051,72 @@
     goto error;
   }
   *sc = &c->base;
-  gpr_free((void *)alpn_protocol_strings);
+  gpr_free((void*)alpn_protocol_strings);
   return GRPC_SECURITY_OK;
 
 error:
-  gpr_free((void *)alpn_protocol_strings);
+  gpr_free((void*)alpn_protocol_strings);
   return GRPC_SECURITY_ERROR;
 }
 
-grpc_security_status grpc_ssl_server_security_connector_create(
-    grpc_exec_ctx *exec_ctx, grpc_server_credentials *server_creds,
-    const grpc_ssl_server_config *config, grpc_server_security_connector **sc) {
-  size_t num_alpn_protocols = grpc_chttp2_num_alpn_versions();
-  const char **alpn_protocol_strings =
-      (const char **)gpr_malloc(sizeof(const char *) * num_alpn_protocols);
-  tsi_result result = TSI_OK;
-  grpc_ssl_server_security_connector *c;
-  size_t i;
-
-  for (i = 0; i < num_alpn_protocols; i++) {
-    alpn_protocol_strings[i] = grpc_chttp2_get_alpn_version_index(i);
-  }
-
-  if (config == NULL || config->num_key_cert_pairs == 0) {
-    gpr_log(GPR_ERROR, "An SSL server needs a key and a cert.");
-    goto error;
-  }
-  c = (grpc_ssl_server_security_connector *)gpr_zalloc(
-      sizeof(grpc_ssl_server_security_connector));
-
+static grpc_ssl_server_security_connector*
+grpc_ssl_server_security_connector_initialize(
+    grpc_server_credentials* server_creds) {
+  grpc_ssl_server_security_connector* c =
+      (grpc_ssl_server_security_connector*)gpr_zalloc(
+          sizeof(grpc_ssl_server_security_connector));
   gpr_ref_init(&c->base.base.refcount, 1);
   c->base.base.url_scheme = GRPC_SSL_URL_SCHEME;
   c->base.base.vtable = &ssl_server_vtable;
-  c->base.server_creds = grpc_server_credentials_ref(server_creds);
-  result = tsi_create_ssl_server_handshaker_factory_ex(
-      config->pem_key_cert_pairs, config->num_key_cert_pairs,
-      config->pem_root_certs, get_tsi_client_certificate_request_type(
-                                  config->client_certificate_request),
-      ssl_cipher_suites(), alpn_protocol_strings, (uint16_t)num_alpn_protocols,
-      &c->server_handshaker_factory);
-  if (result != TSI_OK) {
-    gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
-            tsi_result_to_string(result));
-    ssl_server_destroy(exec_ctx, &c->base.base);
-    *sc = NULL;
-    goto error;
-  }
   c->base.add_handshakers = ssl_server_add_handshakers;
-  *sc = &c->base;
-  gpr_free((void *)alpn_protocol_strings);
-  return GRPC_SECURITY_OK;
+  c->base.server_creds = grpc_server_credentials_ref(server_creds);
+  return c;
+}
 
-error:
-  gpr_free((void *)alpn_protocol_strings);
-  return GRPC_SECURITY_ERROR;
+grpc_security_status grpc_ssl_server_security_connector_create(
+    grpc_exec_ctx* exec_ctx, grpc_server_credentials* gsc,
+    grpc_server_security_connector** sc) {
+  tsi_result result = TSI_OK;
+  grpc_ssl_server_credentials* server_credentials =
+      (grpc_ssl_server_credentials*)gsc;
+  grpc_security_status retval = GRPC_SECURITY_OK;
+
+  GPR_ASSERT(server_credentials != NULL);
+  GPR_ASSERT(sc != NULL);
+
+  grpc_ssl_server_security_connector* c =
+      grpc_ssl_server_security_connector_initialize(gsc);
+  if (server_connector_has_cert_config_fetcher(c)) {
+    // Load initial credentials from certificate_config_fetcher:
+    if (!try_fetch_ssl_server_credentials(c)) {
+      gpr_log(GPR_ERROR, "Failed loading SSL server credentials from fetcher.");
+      retval = GRPC_SECURITY_ERROR;
+    }
+  } else {
+    size_t num_alpn_protocols = 0;
+    const char** alpn_protocol_strings =
+        fill_alpn_protocol_strings(&num_alpn_protocols);
+    result = tsi_create_ssl_server_handshaker_factory_ex(
+        server_credentials->config.pem_key_cert_pairs,
+        server_credentials->config.num_key_cert_pairs,
+        server_credentials->config.pem_root_certs,
+        get_tsi_client_certificate_request_type(
+            server_credentials->config.client_certificate_request),
+        ssl_cipher_suites(), alpn_protocol_strings,
+        (uint16_t)num_alpn_protocols, &c->server_handshaker_factory);
+    gpr_free((void*)alpn_protocol_strings);
+    if (result != TSI_OK) {
+      gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
+              tsi_result_to_string(result));
+      retval = GRPC_SECURITY_ERROR;
+    }
+  }
+
+  if (retval == GRPC_SECURITY_OK) {
+    *sc = &c->base;
+  } else {
+    if (c != NULL) ssl_server_destroy(exec_ctx, &c->base.base);
+    if (sc != NULL) *sc = NULL;
+  }
+  return retval;
 }
diff --git a/src/core/lib/security/transport/security_connector.h b/src/core/lib/security/transport/security_connector.h
index f401349..10a4ef1 100644
--- a/src/core/lib/security/transport/security_connector.h
+++ b/src/core/lib/security/transport/security_connector.h
@@ -56,17 +56,17 @@
 #define GRPC_ARG_SECURITY_CONNECTOR "grpc.security_connector"
 
 typedef struct {
-  void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_security_connector *sc);
-  void (*check_peer)(grpc_exec_ctx *exec_ctx, grpc_security_connector *sc,
-                     tsi_peer peer, grpc_auth_context **auth_context,
-                     grpc_closure *on_peer_checked);
-  int (*cmp)(grpc_security_connector *sc, grpc_security_connector *other);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_security_connector* sc);
+  void (*check_peer)(grpc_exec_ctx* exec_ctx, grpc_security_connector* sc,
+                     tsi_peer peer, grpc_auth_context** auth_context,
+                     grpc_closure* on_peer_checked);
+  int (*cmp)(grpc_security_connector* sc, grpc_security_connector* other);
 } grpc_security_connector_vtable;
 
 struct grpc_security_connector {
-  const grpc_security_connector_vtable *vtable;
+  const grpc_security_connector_vtable* vtable;
   gpr_refcount refcount;
-  const char *url_scheme;
+  const char* url_scheme;
 };
 
 /* Refcounting. */
@@ -75,44 +75,44 @@
   grpc_security_connector_ref((p), __FILE__, __LINE__, (r))
 #define GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, p, r) \
   grpc_security_connector_unref((exec_ctx), (p), __FILE__, __LINE__, (r))
-grpc_security_connector *grpc_security_connector_ref(
-    grpc_security_connector *policy, const char *file, int line,
-    const char *reason);
-void grpc_security_connector_unref(grpc_exec_ctx *exec_ctx,
-                                   grpc_security_connector *policy,
-                                   const char *file, int line,
-                                   const char *reason);
+grpc_security_connector* grpc_security_connector_ref(
+    grpc_security_connector* policy, const char* file, int line,
+    const char* reason);
+void grpc_security_connector_unref(grpc_exec_ctx* exec_ctx,
+                                   grpc_security_connector* policy,
+                                   const char* file, int line,
+                                   const char* reason);
 #else
 #define GRPC_SECURITY_CONNECTOR_REF(p, r) grpc_security_connector_ref((p))
 #define GRPC_SECURITY_CONNECTOR_UNREF(exec_ctx, p, r) \
   grpc_security_connector_unref((exec_ctx), (p))
-grpc_security_connector *grpc_security_connector_ref(
-    grpc_security_connector *policy);
-void grpc_security_connector_unref(grpc_exec_ctx *exec_ctx,
-                                   grpc_security_connector *policy);
+grpc_security_connector* grpc_security_connector_ref(
+    grpc_security_connector* policy);
+void grpc_security_connector_unref(grpc_exec_ctx* exec_ctx,
+                                   grpc_security_connector* policy);
 #endif
 
 /* Check the peer. Callee takes ownership of the peer object.
    When done, sets *auth_context and invokes on_peer_checked. */
-void grpc_security_connector_check_peer(grpc_exec_ctx *exec_ctx,
-                                        grpc_security_connector *sc,
+void grpc_security_connector_check_peer(grpc_exec_ctx* exec_ctx,
+                                        grpc_security_connector* sc,
                                         tsi_peer peer,
-                                        grpc_auth_context **auth_context,
-                                        grpc_closure *on_peer_checked);
+                                        grpc_auth_context** auth_context,
+                                        grpc_closure* on_peer_checked);
 
 /* Compares two security connectors. */
-int grpc_security_connector_cmp(grpc_security_connector *sc,
-                                grpc_security_connector *other);
+int grpc_security_connector_cmp(grpc_security_connector* sc,
+                                grpc_security_connector* other);
 
 /* Util to encapsulate the connector in a channel arg. */
-grpc_arg grpc_security_connector_to_arg(grpc_security_connector *sc);
+grpc_arg grpc_security_connector_to_arg(grpc_security_connector* sc);
 
 /* Util to get the connector from a channel arg. */
-grpc_security_connector *grpc_security_connector_from_arg(const grpc_arg *arg);
+grpc_security_connector* grpc_security_connector_from_arg(const grpc_arg* arg);
 
 /* Util to find the connector from channel args. */
-grpc_security_connector *grpc_security_connector_find_in_args(
-    const grpc_channel_args *args);
+grpc_security_connector* grpc_security_connector_find_in_args(
+    const grpc_channel_args* args);
 
 /* --- channel_security_connector object. ---
 
@@ -123,46 +123,46 @@
 
 struct grpc_channel_security_connector {
   grpc_security_connector base;
-  grpc_channel_credentials *channel_creds;
-  grpc_call_credentials *request_metadata_creds;
-  bool (*check_call_host)(grpc_exec_ctx *exec_ctx,
-                          grpc_channel_security_connector *sc, const char *host,
-                          grpc_auth_context *auth_context,
-                          grpc_closure *on_call_host_checked,
-                          grpc_error **error);
-  void (*cancel_check_call_host)(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_security_connector *sc,
-                                 grpc_closure *on_call_host_checked,
-                                 grpc_error *error);
-  void (*add_handshakers)(grpc_exec_ctx *exec_ctx,
-                          grpc_channel_security_connector *sc,
-                          grpc_handshake_manager *handshake_mgr);
+  grpc_channel_credentials* channel_creds;
+  grpc_call_credentials* request_metadata_creds;
+  bool (*check_call_host)(grpc_exec_ctx* exec_ctx,
+                          grpc_channel_security_connector* sc, const char* host,
+                          grpc_auth_context* auth_context,
+                          grpc_closure* on_call_host_checked,
+                          grpc_error** error);
+  void (*cancel_check_call_host)(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_security_connector* sc,
+                                 grpc_closure* on_call_host_checked,
+                                 grpc_error* error);
+  void (*add_handshakers)(grpc_exec_ctx* exec_ctx,
+                          grpc_channel_security_connector* sc,
+                          grpc_handshake_manager* handshake_mgr);
 };
 
 /// A helper function for use in grpc_security_connector_cmp() implementations.
-int grpc_channel_security_connector_cmp(grpc_channel_security_connector *sc1,
-                                        grpc_channel_security_connector *sc2);
+int grpc_channel_security_connector_cmp(grpc_channel_security_connector* sc1,
+                                        grpc_channel_security_connector* sc2);
 
 /// Checks that the host that will be set for a call is acceptable.
 /// Returns true if completed synchronously, in which case \a error will
 /// be set to indicate the result.  Otherwise, \a on_call_host_checked
 /// will be invoked when complete.
 bool grpc_channel_security_connector_check_call_host(
-    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
-    const char *host, grpc_auth_context *auth_context,
-    grpc_closure *on_call_host_checked, grpc_error **error);
+    grpc_exec_ctx* exec_ctx, grpc_channel_security_connector* sc,
+    const char* host, grpc_auth_context* auth_context,
+    grpc_closure* on_call_host_checked, grpc_error** error);
 
 /// Cancels a pending asychronous call to
 /// grpc_channel_security_connector_check_call_host() with
 /// \a on_call_host_checked as its callback.
 void grpc_channel_security_connector_cancel_check_call_host(
-    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
-    grpc_closure *on_call_host_checked, grpc_error *error);
+    grpc_exec_ctx* exec_ctx, grpc_channel_security_connector* sc,
+    grpc_closure* on_call_host_checked, grpc_error* error);
 
 /* Registers handshakers with \a handshake_mgr. */
 void grpc_channel_security_connector_add_handshakers(
-    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *connector,
-    grpc_handshake_manager *handshake_mgr);
+    grpc_exec_ctx* exec_ctx, grpc_channel_security_connector* connector,
+    grpc_handshake_manager* handshake_mgr);
 
 /* --- server_security_connector object. ---
 
@@ -173,39 +173,39 @@
 
 struct grpc_server_security_connector {
   grpc_security_connector base;
-  grpc_server_credentials *server_creds;
-  void (*add_handshakers)(grpc_exec_ctx *exec_ctx,
-                          grpc_server_security_connector *sc,
-                          grpc_handshake_manager *handshake_mgr);
+  grpc_server_credentials* server_creds;
+  void (*add_handshakers)(grpc_exec_ctx* exec_ctx,
+                          grpc_server_security_connector* sc,
+                          grpc_handshake_manager* handshake_mgr);
 };
 
 /// A helper function for use in grpc_security_connector_cmp() implementations.
-int grpc_server_security_connector_cmp(grpc_server_security_connector *sc1,
-                                       grpc_server_security_connector *sc2);
+int grpc_server_security_connector_cmp(grpc_server_security_connector* sc1,
+                                       grpc_server_security_connector* sc2);
 
 void grpc_server_security_connector_add_handshakers(
-    grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
-    grpc_handshake_manager *handshake_mgr);
+    grpc_exec_ctx* exec_ctx, grpc_server_security_connector* sc,
+    grpc_handshake_manager* handshake_mgr);
 
 /* --- Creation security connectors. --- */
 
 /* For TESTING ONLY!
    Creates a fake connector that emulates real channel security.  */
-grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
-    grpc_channel_credentials *channel_creds,
-    grpc_call_credentials *request_metadata_creds, const char *target,
-    const grpc_channel_args *args);
+grpc_channel_security_connector* grpc_fake_channel_security_connector_create(
+    grpc_channel_credentials* channel_creds,
+    grpc_call_credentials* request_metadata_creds, const char* target,
+    const grpc_channel_args* args);
 
 /* For TESTING ONLY!
    Creates a fake connector that emulates real server security.  */
-grpc_server_security_connector *grpc_fake_server_security_connector_create(
-    grpc_server_credentials *server_creds);
+grpc_server_security_connector* grpc_fake_server_security_connector_create(
+    grpc_server_credentials* server_creds);
 
 /* Config for ssl clients. */
 
 typedef struct {
-  tsi_ssl_pem_key_cert_pair pem_key_cert_pair;
-  char *pem_root_certs;
+  tsi_ssl_pem_key_cert_pair* pem_key_cert_pair;
+  char* pem_root_certs;
 } grpc_ssl_config;
 
 /* Creates an SSL channel_security_connector.
@@ -222,22 +222,22 @@
   specific error code otherwise.
 */
 grpc_security_status grpc_ssl_channel_security_connector_create(
-    grpc_exec_ctx *exec_ctx, grpc_channel_credentials *channel_creds,
-    grpc_call_credentials *request_metadata_creds,
-    const grpc_ssl_config *config, const char *target_name,
-    const char *overridden_target_name, grpc_channel_security_connector **sc);
+    grpc_exec_ctx* exec_ctx, grpc_channel_credentials* channel_creds,
+    grpc_call_credentials* request_metadata_creds,
+    const grpc_ssl_config* config, const char* target_name,
+    const char* overridden_target_name, grpc_channel_security_connector** sc);
 
 /* Gets the default ssl roots. Returns NULL if not found. */
-const char *grpc_get_default_ssl_roots(void);
+const char* grpc_get_default_ssl_roots(void);
 
 /* Exposed for TESTING ONLY!. */
 grpc_slice grpc_get_default_ssl_roots_for_testing(void);
 
 /* Config for ssl servers. */
 typedef struct {
-  tsi_ssl_pem_key_cert_pair *pem_key_cert_pairs;
+  tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs;
   size_t num_key_cert_pairs;
-  char *pem_root_certs;
+  char* pem_root_certs;
   grpc_ssl_client_certificate_request_type client_certificate_request;
 } grpc_ssl_server_config;
 
@@ -248,18 +248,18 @@
   specific error code otherwise.
 */
 grpc_security_status grpc_ssl_server_security_connector_create(
-    grpc_exec_ctx *exec_ctx, grpc_server_credentials *server_creds,
-    const grpc_ssl_server_config *config, grpc_server_security_connector **sc);
+    grpc_exec_ctx* exec_ctx, grpc_server_credentials* server_credentials,
+    grpc_server_security_connector** sc);
 
 /* Util. */
-const tsi_peer_property *tsi_peer_get_property_by_name(const tsi_peer *peer,
-                                                       const char *name);
+const tsi_peer_property* tsi_peer_get_property_by_name(const tsi_peer* peer,
+                                                       const char* name);
 
 /* Exposed for testing only. */
-grpc_auth_context *tsi_ssl_peer_to_auth_context(const tsi_peer *peer);
+grpc_auth_context* tsi_ssl_peer_to_auth_context(const tsi_peer* peer);
 tsi_peer tsi_shallow_peer_from_ssl_auth_context(
-    const grpc_auth_context *auth_context);
-void tsi_shallow_peer_destruct(tsi_peer *peer);
+    const grpc_auth_context* auth_context);
+void tsi_shallow_peer_destruct(tsi_peer* peer);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/security/transport/security_handshaker.cc b/src/core/lib/security/transport/security_handshaker.cc
index 3d19605..63706f1 100644
--- a/src/core/lib/security/transport/security_handshaker.cc
+++ b/src/core/lib/security/transport/security_handshaker.cc
@@ -40,33 +40,33 @@
   grpc_handshaker base;
 
   // State set at creation time.
-  tsi_handshaker *handshaker;
-  grpc_security_connector *connector;
+  tsi_handshaker* handshaker;
+  grpc_security_connector* connector;
 
   gpr_mu mu;
   gpr_refcount refs;
 
   bool shutdown;
   // Endpoint and read buffer to destroy after a shutdown.
-  grpc_endpoint *endpoint_to_destroy;
-  grpc_slice_buffer *read_buffer_to_destroy;
+  grpc_endpoint* endpoint_to_destroy;
+  grpc_slice_buffer* read_buffer_to_destroy;
 
   // State saved while performing the handshake.
-  grpc_handshaker_args *args;
-  grpc_closure *on_handshake_done;
+  grpc_handshaker_args* args;
+  grpc_closure* on_handshake_done;
 
-  unsigned char *handshake_buffer;
+  unsigned char* handshake_buffer;
   size_t handshake_buffer_size;
   grpc_slice_buffer outgoing;
   grpc_closure on_handshake_data_sent_to_peer;
   grpc_closure on_handshake_data_received_from_peer;
   grpc_closure on_peer_checked;
-  grpc_auth_context *auth_context;
-  tsi_handshaker_result *handshaker_result;
+  grpc_auth_context* auth_context;
+  tsi_handshaker_result* handshaker_result;
 } security_handshaker;
 
-static void security_handshaker_unref(grpc_exec_ctx *exec_ctx,
-                                      security_handshaker *h) {
+static void security_handshaker_unref(grpc_exec_ctx* exec_ctx,
+                                      security_handshaker* h) {
   if (gpr_unref(&h->refs)) {
     gpr_mu_destroy(&h->mu);
     tsi_handshaker_destroy(h->handshaker);
@@ -88,8 +88,8 @@
 
 // Set args fields to NULL, saving the endpoint and read buffer for
 // later destruction.
-static void cleanup_args_for_failure_locked(grpc_exec_ctx *exec_ctx,
-                                            security_handshaker *h) {
+static void cleanup_args_for_failure_locked(grpc_exec_ctx* exec_ctx,
+                                            security_handshaker* h) {
   h->endpoint_to_destroy = h->args->endpoint;
   h->args->endpoint = NULL;
   h->read_buffer_to_destroy = h->args->read_buffer;
@@ -100,15 +100,15 @@
 
 // If the handshake failed or we're shutting down, clean up and invoke the
 // callback with the error.
-static void security_handshake_failed_locked(grpc_exec_ctx *exec_ctx,
-                                             security_handshaker *h,
-                                             grpc_error *error) {
+static void security_handshake_failed_locked(grpc_exec_ctx* exec_ctx,
+                                             security_handshaker* h,
+                                             grpc_error* error) {
   if (error == GRPC_ERROR_NONE) {
     // If we were shut down after the handshake succeeded but before an
     // endpoint callback was invoked, we need to generate our own error.
     error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Handshaker shutdown");
   }
-  const char *msg = grpc_error_string(error);
+  const char* msg = grpc_error_string(error);
   gpr_log(GPR_DEBUG, "Security handshake failed: %s", msg);
 
   if (!h->shutdown) {
@@ -128,14 +128,14 @@
   GRPC_CLOSURE_SCHED(exec_ctx, h->on_handshake_done, error);
 }
 
-static void on_peer_checked_inner(grpc_exec_ctx *exec_ctx,
-                                  security_handshaker *h, grpc_error *error) {
+static void on_peer_checked_inner(grpc_exec_ctx* exec_ctx,
+                                  security_handshaker* h, grpc_error* error) {
   if (error != GRPC_ERROR_NONE || h->shutdown) {
     security_handshake_failed_locked(exec_ctx, h, GRPC_ERROR_REF(error));
     return;
   }
   // Create zero-copy frame protector, if implemented.
-  tsi_zero_copy_grpc_protector *zero_copy_protector = NULL;
+  tsi_zero_copy_grpc_protector* zero_copy_protector = NULL;
   tsi_result result = tsi_handshaker_result_create_zero_copy_grpc_protector(
       exec_ctx, h->handshaker_result, NULL, &zero_copy_protector);
   if (result != TSI_OK && result != TSI_UNIMPLEMENTED) {
@@ -147,7 +147,7 @@
     return;
   }
   // Create frame protector if zero-copy frame protector is NULL.
-  tsi_frame_protector *protector = NULL;
+  tsi_frame_protector* protector = NULL;
   if (zero_copy_protector == NULL) {
     result = tsi_handshaker_result_create_frame_protector(h->handshaker_result,
                                                           NULL, &protector);
@@ -160,14 +160,14 @@
     }
   }
   // Get unused bytes.
-  const unsigned char *unused_bytes = NULL;
+  const unsigned char* unused_bytes = NULL;
   size_t unused_bytes_size = 0;
   result = tsi_handshaker_result_get_unused_bytes(
       h->handshaker_result, &unused_bytes, &unused_bytes_size);
   // Create secure endpoint.
   if (unused_bytes_size > 0) {
     grpc_slice slice =
-        grpc_slice_from_copied_buffer((char *)unused_bytes, unused_bytes_size);
+        grpc_slice_from_copied_buffer((char*)unused_bytes, unused_bytes_size);
     h->args->endpoint = grpc_secure_endpoint_create(
         protector, zero_copy_protector, h->args->endpoint, &slice, 1);
     grpc_slice_unref_internal(exec_ctx, slice);
@@ -181,7 +181,7 @@
   grpc_slice_buffer_reset_and_unref_internal(exec_ctx, h->args->read_buffer);
   // Add auth context to channel args.
   grpc_arg auth_context_arg = grpc_auth_context_to_arg(h->auth_context);
-  grpc_channel_args *tmp_args = h->args->args;
+  grpc_channel_args* tmp_args = h->args->args;
   h->args->args =
       grpc_channel_args_copy_and_add(tmp_args, &auth_context_arg, 1);
   grpc_channel_args_destroy(exec_ctx, tmp_args);
@@ -192,17 +192,17 @@
   h->shutdown = true;
 }
 
-static void on_peer_checked(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_error *error) {
-  security_handshaker *h = (security_handshaker *)arg;
+static void on_peer_checked(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_error* error) {
+  security_handshaker* h = (security_handshaker*)arg;
   gpr_mu_lock(&h->mu);
   on_peer_checked_inner(exec_ctx, h, error);
   gpr_mu_unlock(&h->mu);
   security_handshaker_unref(exec_ctx, h);
 }
 
-static grpc_error *check_peer_locked(grpc_exec_ctx *exec_ctx,
-                                     security_handshaker *h) {
+static grpc_error* check_peer_locked(grpc_exec_ctx* exec_ctx,
+                                     security_handshaker* h) {
   tsi_peer peer;
   tsi_result result =
       tsi_handshaker_result_extract_peer(h->handshaker_result, &peer);
@@ -215,11 +215,11 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *on_handshake_next_done_locked(
-    grpc_exec_ctx *exec_ctx, security_handshaker *h, tsi_result result,
-    const unsigned char *bytes_to_send, size_t bytes_to_send_size,
-    tsi_handshaker_result *handshaker_result) {
-  grpc_error *error = GRPC_ERROR_NONE;
+static grpc_error* on_handshake_next_done_locked(
+    grpc_exec_ctx* exec_ctx, security_handshaker* h, tsi_result result,
+    const unsigned char* bytes_to_send, size_t bytes_to_send_size,
+    tsi_handshaker_result* handshaker_result) {
+  grpc_error* error = GRPC_ERROR_NONE;
   // Read more if we need to.
   if (result == TSI_INCOMPLETE_DATA) {
     GPR_ASSERT(bytes_to_send_size == 0);
@@ -239,7 +239,7 @@
   if (bytes_to_send_size > 0) {
     // Send data to peer, if needed.
     grpc_slice to_send = grpc_slice_from_copied_buffer(
-        (const char *)bytes_to_send, bytes_to_send_size);
+        (const char*)bytes_to_send, bytes_to_send_size);
     grpc_slice_buffer_reset_and_unref_internal(exec_ctx, &h->outgoing);
     grpc_slice_buffer_add(&h->outgoing, to_send);
     grpc_endpoint_write(exec_ctx, h->args->endpoint, &h->outgoing,
@@ -256,14 +256,14 @@
 }
 
 static void on_handshake_next_done_grpc_wrapper(
-    tsi_result result, void *user_data, const unsigned char *bytes_to_send,
-    size_t bytes_to_send_size, tsi_handshaker_result *handshaker_result) {
-  security_handshaker *h = (security_handshaker *)user_data;
+    tsi_result result, void* user_data, const unsigned char* bytes_to_send,
+    size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result) {
+  security_handshaker* h = (security_handshaker*)user_data;
   // This callback will be invoked by TSI in a non-grpc thread, so it's
   // safe to create our own exec_ctx here.
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   gpr_mu_lock(&h->mu);
-  grpc_error *error =
+  grpc_error* error =
       on_handshake_next_done_locked(&exec_ctx, h, result, bytes_to_send,
                                     bytes_to_send_size, handshaker_result);
   if (error != GRPC_ERROR_NONE) {
@@ -276,13 +276,13 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static grpc_error *do_handshaker_next_locked(
-    grpc_exec_ctx *exec_ctx, security_handshaker *h,
-    const unsigned char *bytes_received, size_t bytes_received_size) {
+static grpc_error* do_handshaker_next_locked(
+    grpc_exec_ctx* exec_ctx, security_handshaker* h,
+    const unsigned char* bytes_received, size_t bytes_received_size) {
   // Invoke TSI handshaker.
-  const unsigned char *bytes_to_send = NULL;
+  const unsigned char* bytes_to_send = NULL;
   size_t bytes_to_send_size = 0;
-  tsi_handshaker_result *handshaker_result = NULL;
+  tsi_handshaker_result* handshaker_result = NULL;
   tsi_result result = tsi_handshaker_next(
       h->handshaker, bytes_received, bytes_received_size, &bytes_to_send,
       &bytes_to_send_size, &handshaker_result,
@@ -298,14 +298,15 @@
                                        bytes_to_send_size, handshaker_result);
 }
 
-static void on_handshake_data_received_from_peer(grpc_exec_ctx *exec_ctx,
-                                                 void *arg, grpc_error *error) {
-  security_handshaker *h = (security_handshaker *)arg;
+static void on_handshake_data_received_from_peer(grpc_exec_ctx* exec_ctx,
+                                                 void* arg, grpc_error* error) {
+  security_handshaker* h = (security_handshaker*)arg;
   gpr_mu_lock(&h->mu);
   if (error != GRPC_ERROR_NONE || h->shutdown) {
     security_handshake_failed_locked(
-        exec_ctx, h, GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
-                         "Handshake read failed", &error, 1));
+        exec_ctx, h,
+        GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+            "Handshake read failed", &error, 1));
     gpr_mu_unlock(&h->mu);
     security_handshaker_unref(exec_ctx, h);
     return;
@@ -318,7 +319,7 @@
   }
   if (bytes_received_size > h->handshake_buffer_size) {
     h->handshake_buffer =
-        (uint8_t *)gpr_realloc(h->handshake_buffer, bytes_received_size);
+        (uint8_t*)gpr_realloc(h->handshake_buffer, bytes_received_size);
     h->handshake_buffer_size = bytes_received_size;
   }
   size_t offset = 0;
@@ -341,14 +342,15 @@
   }
 }
 
-static void on_handshake_data_sent_to_peer(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *error) {
-  security_handshaker *h = (security_handshaker *)arg;
+static void on_handshake_data_sent_to_peer(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* error) {
+  security_handshaker* h = (security_handshaker*)arg;
   gpr_mu_lock(&h->mu);
   if (error != GRPC_ERROR_NONE || h->shutdown) {
     security_handshake_failed_locked(
-        exec_ctx, h, GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
-                         "Handshake write failed", &error, 1));
+        exec_ctx, h,
+        GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+            "Handshake write failed", &error, 1));
     gpr_mu_unlock(&h->mu);
     security_handshaker_unref(exec_ctx, h);
     return;
@@ -373,16 +375,16 @@
 // public handshaker API
 //
 
-static void security_handshaker_destroy(grpc_exec_ctx *exec_ctx,
-                                        grpc_handshaker *handshaker) {
-  security_handshaker *h = (security_handshaker *)handshaker;
+static void security_handshaker_destroy(grpc_exec_ctx* exec_ctx,
+                                        grpc_handshaker* handshaker) {
+  security_handshaker* h = (security_handshaker*)handshaker;
   security_handshaker_unref(exec_ctx, h);
 }
 
-static void security_handshaker_shutdown(grpc_exec_ctx *exec_ctx,
-                                         grpc_handshaker *handshaker,
-                                         grpc_error *why) {
-  security_handshaker *h = (security_handshaker *)handshaker;
+static void security_handshaker_shutdown(grpc_exec_ctx* exec_ctx,
+                                         grpc_handshaker* handshaker,
+                                         grpc_error* why) {
+  security_handshaker* h = (security_handshaker*)handshaker;
   gpr_mu_lock(&h->mu);
   if (!h->shutdown) {
     h->shutdown = true;
@@ -393,17 +395,17 @@
   GRPC_ERROR_UNREF(why);
 }
 
-static void security_handshaker_do_handshake(grpc_exec_ctx *exec_ctx,
-                                             grpc_handshaker *handshaker,
-                                             grpc_tcp_server_acceptor *acceptor,
-                                             grpc_closure *on_handshake_done,
-                                             grpc_handshaker_args *args) {
-  security_handshaker *h = (security_handshaker *)handshaker;
+static void security_handshaker_do_handshake(grpc_exec_ctx* exec_ctx,
+                                             grpc_handshaker* handshaker,
+                                             grpc_tcp_server_acceptor* acceptor,
+                                             grpc_closure* on_handshake_done,
+                                             grpc_handshaker_args* args) {
+  security_handshaker* h = (security_handshaker*)handshaker;
   gpr_mu_lock(&h->mu);
   h->args = args;
   h->on_handshake_done = on_handshake_done;
   gpr_ref(&h->refs);
-  grpc_error *error = do_handshaker_next_locked(exec_ctx, h, NULL, 0);
+  grpc_error* error = do_handshaker_next_locked(exec_ctx, h, NULL, 0);
   if (error != GRPC_ERROR_NONE) {
     security_handshake_failed_locked(exec_ctx, h, error);
     gpr_mu_unlock(&h->mu);
@@ -417,18 +419,18 @@
     security_handshaker_destroy, security_handshaker_shutdown,
     security_handshaker_do_handshake};
 
-static grpc_handshaker *security_handshaker_create(
-    grpc_exec_ctx *exec_ctx, tsi_handshaker *handshaker,
-    grpc_security_connector *connector) {
-  security_handshaker *h =
-      (security_handshaker *)gpr_zalloc(sizeof(security_handshaker));
+static grpc_handshaker* security_handshaker_create(
+    grpc_exec_ctx* exec_ctx, tsi_handshaker* handshaker,
+    grpc_security_connector* connector) {
+  security_handshaker* h =
+      (security_handshaker*)gpr_zalloc(sizeof(security_handshaker));
   grpc_handshaker_init(&security_handshaker_vtable, &h->base);
   h->handshaker = handshaker;
   h->connector = GRPC_SECURITY_CONNECTOR_REF(connector, "handshake");
   gpr_mu_init(&h->mu);
   gpr_ref_init(&h->refs, 1);
   h->handshake_buffer_size = GRPC_INITIAL_HANDSHAKE_BUFFER_SIZE;
-  h->handshake_buffer = (uint8_t *)gpr_malloc(h->handshake_buffer_size);
+  h->handshake_buffer = (uint8_t*)gpr_malloc(h->handshake_buffer_size);
   GRPC_CLOSURE_INIT(&h->on_handshake_data_sent_to_peer,
                     on_handshake_data_sent_to_peer, h,
                     grpc_schedule_on_exec_ctx);
@@ -445,22 +447,22 @@
 // fail_handshaker
 //
 
-static void fail_handshaker_destroy(grpc_exec_ctx *exec_ctx,
-                                    grpc_handshaker *handshaker) {
+static void fail_handshaker_destroy(grpc_exec_ctx* exec_ctx,
+                                    grpc_handshaker* handshaker) {
   gpr_free(handshaker);
 }
 
-static void fail_handshaker_shutdown(grpc_exec_ctx *exec_ctx,
-                                     grpc_handshaker *handshaker,
-                                     grpc_error *why) {
+static void fail_handshaker_shutdown(grpc_exec_ctx* exec_ctx,
+                                     grpc_handshaker* handshaker,
+                                     grpc_error* why) {
   GRPC_ERROR_UNREF(why);
 }
 
-static void fail_handshaker_do_handshake(grpc_exec_ctx *exec_ctx,
-                                         grpc_handshaker *handshaker,
-                                         grpc_tcp_server_acceptor *acceptor,
-                                         grpc_closure *on_handshake_done,
-                                         grpc_handshaker_args *args) {
+static void fail_handshaker_do_handshake(grpc_exec_ctx* exec_ctx,
+                                         grpc_handshaker* handshaker,
+                                         grpc_tcp_server_acceptor* acceptor,
+                                         grpc_closure* on_handshake_done,
+                                         grpc_handshaker_args* args) {
   GRPC_CLOSURE_SCHED(exec_ctx, on_handshake_done,
                      GRPC_ERROR_CREATE_FROM_STATIC_STRING(
                          "Failed to create security handshaker"));
@@ -470,8 +472,8 @@
     fail_handshaker_destroy, fail_handshaker_shutdown,
     fail_handshaker_do_handshake};
 
-static grpc_handshaker *fail_handshaker_create() {
-  grpc_handshaker *h = (grpc_handshaker *)gpr_malloc(sizeof(*h));
+static grpc_handshaker* fail_handshaker_create() {
+  grpc_handshaker* h = (grpc_handshaker*)gpr_malloc(sizeof(*h));
   grpc_handshaker_init(&fail_handshaker_vtable, h);
   return h;
 }
@@ -481,27 +483,27 @@
 //
 
 static void client_handshaker_factory_add_handshakers(
-    grpc_exec_ctx *exec_ctx, grpc_handshaker_factory *handshaker_factory,
-    const grpc_channel_args *args, grpc_handshake_manager *handshake_mgr) {
-  grpc_channel_security_connector *security_connector =
-      (grpc_channel_security_connector *)grpc_security_connector_find_in_args(
+    grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* handshaker_factory,
+    const grpc_channel_args* args, grpc_handshake_manager* handshake_mgr) {
+  grpc_channel_security_connector* security_connector =
+      (grpc_channel_security_connector*)grpc_security_connector_find_in_args(
           args);
   grpc_channel_security_connector_add_handshakers(exec_ctx, security_connector,
                                                   handshake_mgr);
 }
 
 static void server_handshaker_factory_add_handshakers(
-    grpc_exec_ctx *exec_ctx, grpc_handshaker_factory *hf,
-    const grpc_channel_args *args, grpc_handshake_manager *handshake_mgr) {
-  grpc_server_security_connector *security_connector =
-      (grpc_server_security_connector *)grpc_security_connector_find_in_args(
+    grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* hf,
+    const grpc_channel_args* args, grpc_handshake_manager* handshake_mgr) {
+  grpc_server_security_connector* security_connector =
+      (grpc_server_security_connector*)grpc_security_connector_find_in_args(
           args);
   grpc_server_security_connector_add_handshakers(exec_ctx, security_connector,
                                                  handshake_mgr);
 }
 
 static void handshaker_factory_destroy(
-    grpc_exec_ctx *exec_ctx, grpc_handshaker_factory *handshaker_factory) {}
+    grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* handshaker_factory) {}
 
 static const grpc_handshaker_factory_vtable client_handshaker_factory_vtable = {
     client_handshaker_factory_add_handshakers, handshaker_factory_destroy};
@@ -519,9 +521,9 @@
 // exported functions
 //
 
-grpc_handshaker *grpc_security_handshaker_create(
-    grpc_exec_ctx *exec_ctx, tsi_handshaker *handshaker,
-    grpc_security_connector *connector) {
+grpc_handshaker* grpc_security_handshaker_create(
+    grpc_exec_ctx* exec_ctx, tsi_handshaker* handshaker,
+    grpc_security_connector* connector) {
   // If no TSI handshaker was created, return a handshaker that always fails.
   // Otherwise, return a real security handshaker.
   if (handshaker == NULL) {
diff --git a/src/core/lib/security/transport/security_handshaker.h b/src/core/lib/security/transport/security_handshaker.h
index 178099b..174f70f 100644
--- a/src/core/lib/security/transport/security_handshaker.h
+++ b/src/core/lib/security/transport/security_handshaker.h
@@ -28,9 +28,9 @@
 #endif
 
 /// Creates a security handshaker using \a handshaker.
-grpc_handshaker *grpc_security_handshaker_create(
-    grpc_exec_ctx *exec_ctx, tsi_handshaker *handshaker,
-    grpc_security_connector *connector);
+grpc_handshaker* grpc_security_handshaker_create(
+    grpc_exec_ctx* exec_ctx, tsi_handshaker* handshaker,
+    grpc_security_connector* connector);
 
 /// Registers security handshaker factories.
 void grpc_security_register_handshaker_factories();
diff --git a/src/core/lib/security/transport/server_auth_filter.cc b/src/core/lib/security/transport/server_auth_filter.cc
index f5e02f4..e130741 100644
--- a/src/core/lib/security/transport/server_auth_filter.cc
+++ b/src/core/lib/security/transport/server_auth_filter.cc
@@ -33,37 +33,37 @@
 } async_state;
 
 typedef struct call_data {
-  grpc_call_combiner *call_combiner;
-  grpc_call_stack *owning_call;
-  grpc_transport_stream_op_batch *recv_initial_metadata_batch;
-  grpc_closure *original_recv_initial_metadata_ready;
+  grpc_call_combiner* call_combiner;
+  grpc_call_stack* owning_call;
+  grpc_transport_stream_op_batch* recv_initial_metadata_batch;
+  grpc_closure* original_recv_initial_metadata_ready;
   grpc_closure recv_initial_metadata_ready;
   grpc_metadata_array md;
-  const grpc_metadata *consumed_md;
+  const grpc_metadata* consumed_md;
   size_t num_consumed_md;
-  grpc_auth_context *auth_context;
+  grpc_auth_context* auth_context;
   grpc_closure cancel_closure;
   gpr_atm state;  // async_state
 } call_data;
 
 typedef struct channel_data {
-  grpc_auth_context *auth_context;
-  grpc_server_credentials *creds;
+  grpc_auth_context* auth_context;
+  grpc_server_credentials* creds;
 } channel_data;
 
 static grpc_metadata_array metadata_batch_to_md_array(
-    const grpc_metadata_batch *batch) {
-  grpc_linked_mdelem *l;
+    const grpc_metadata_batch* batch) {
+  grpc_linked_mdelem* l;
   grpc_metadata_array result;
   grpc_metadata_array_init(&result);
   for (l = batch->list.head; l != NULL; l = l->next) {
-    grpc_metadata *usr_md = NULL;
+    grpc_metadata* usr_md = NULL;
     grpc_mdelem md = l->md;
     grpc_slice key = GRPC_MDKEY(md);
     grpc_slice value = GRPC_MDVALUE(md);
     if (result.count == result.capacity) {
       result.capacity = GPR_MAX(result.capacity + 8, result.capacity * 2);
-      result.metadata = (grpc_metadata *)gpr_realloc(
+      result.metadata = (grpc_metadata*)gpr_realloc(
           result.metadata, result.capacity * sizeof(grpc_metadata));
     }
     usr_md = &result.metadata[result.count++];
@@ -73,14 +73,14 @@
   return result;
 }
 
-static grpc_filtered_mdelem remove_consumed_md(grpc_exec_ctx *exec_ctx,
-                                               void *user_data,
+static grpc_filtered_mdelem remove_consumed_md(grpc_exec_ctx* exec_ctx,
+                                               void* user_data,
                                                grpc_mdelem md) {
-  grpc_call_element *elem = (grpc_call_element *)user_data;
-  call_data *calld = (call_data *)elem->call_data;
+  grpc_call_element* elem = (grpc_call_element*)user_data;
+  call_data* calld = (call_data*)elem->call_data;
   size_t i;
   for (i = 0; i < calld->num_consumed_md; i++) {
-    const grpc_metadata *consumed_md = &calld->consumed_md[i];
+    const grpc_metadata* consumed_md = &calld->consumed_md[i];
     if (grpc_slice_eq(GRPC_MDKEY(md), consumed_md->key) &&
         grpc_slice_eq(GRPC_MDVALUE(md), consumed_md->value))
       return GRPC_FILTERED_REMOVE();
@@ -88,15 +88,15 @@
   return GRPC_FILTERED_MDELEM(md);
 }
 
-static void on_md_processing_done_inner(grpc_exec_ctx *exec_ctx,
-                                        grpc_call_element *elem,
-                                        const grpc_metadata *consumed_md,
+static void on_md_processing_done_inner(grpc_exec_ctx* exec_ctx,
+                                        grpc_call_element* elem,
+                                        const grpc_metadata* consumed_md,
                                         size_t num_consumed_md,
-                                        const grpc_metadata *response_md,
+                                        const grpc_metadata* response_md,
                                         size_t num_response_md,
-                                        grpc_error *error) {
-  call_data *calld = (call_data *)elem->call_data;
-  grpc_transport_stream_op_batch *batch = calld->recv_initial_metadata_batch;
+                                        grpc_error* error) {
+  call_data* calld = (call_data*)elem->call_data;
+  grpc_transport_stream_op_batch* batch = calld->recv_initial_metadata_batch;
   /* TODO(jboeuf): Implement support for response_md. */
   if (response_md != NULL && num_response_md > 0) {
     gpr_log(GPR_INFO,
@@ -116,16 +116,16 @@
 
 // Called from application code.
 static void on_md_processing_done(
-    void *user_data, const grpc_metadata *consumed_md, size_t num_consumed_md,
-    const grpc_metadata *response_md, size_t num_response_md,
-    grpc_status_code status, const char *error_details) {
-  grpc_call_element *elem = (grpc_call_element *)user_data;
-  call_data *calld = (call_data *)elem->call_data;
+    void* user_data, const grpc_metadata* consumed_md, size_t num_consumed_md,
+    const grpc_metadata* response_md, size_t num_response_md,
+    grpc_status_code status, const char* error_details) {
+  grpc_call_element* elem = (grpc_call_element*)user_data;
+  call_data* calld = (call_data*)elem->call_data;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   // If the call was not cancelled while we were in flight, process the result.
   if (gpr_atm_full_cas(&calld->state, (gpr_atm)STATE_INIT,
                        (gpr_atm)STATE_DONE)) {
-    grpc_error *error = GRPC_ERROR_NONE;
+    grpc_error* error = GRPC_ERROR_NONE;
     if (status != GRPC_STATUS_OK) {
       if (error_details == NULL) {
         error_details = "Authentication metadata processing failed.";
@@ -147,9 +147,9 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void cancel_call(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
+static void cancel_call(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
   // If the result was not already processed, invoke the callback now.
   if (error != GRPC_ERROR_NONE &&
       gpr_atm_full_cas(&calld->state, (gpr_atm)STATE_INIT,
@@ -160,12 +160,12 @@
   GRPC_CALL_STACK_UNREF(exec_ctx, calld->owning_call, "cancel_call");
 }
 
-static void recv_initial_metadata_ready(grpc_exec_ctx *exec_ctx, void *arg,
-                                        grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
-  grpc_transport_stream_op_batch *batch = calld->recv_initial_metadata_batch;
+static void recv_initial_metadata_ready(grpc_exec_ctx* exec_ctx, void* arg,
+                                        grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
+  grpc_transport_stream_op_batch* batch = calld->recv_initial_metadata_batch;
   if (error == GRPC_ERROR_NONE) {
     if (chand->creds != NULL && chand->creds->processor.process != NULL) {
       // We're calling out to the application, so we need to make sure
@@ -189,9 +189,9 @@
 }
 
 static void auth_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *batch) {
-  call_data *calld = (call_data *)elem->call_data;
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* batch) {
+  call_data* calld = (call_data*)elem->call_data;
   if (batch->recv_initial_metadata) {
     // Inject our callback.
     calld->recv_initial_metadata_batch = batch;
@@ -204,11 +204,11 @@
 }
 
 /* Constructor for call_data */
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   calld->call_combiner = args->call_combiner;
   calld->owning_call = args->call_stack;
   GRPC_CLOSURE_INIT(&calld->recv_initial_metadata_ready,
@@ -216,7 +216,7 @@
                     grpc_schedule_on_exec_ctx);
   // Create server security context.  Set its auth context from channel
   // data and save it in the call context.
-  grpc_server_security_context *server_ctx =
+  grpc_server_security_context* server_ctx =
       grpc_server_security_context_create();
   server_ctx->auth_context = grpc_auth_context_create(chand->auth_context);
   calld->auth_context = server_ctx->auth_context;
@@ -231,31 +231,31 @@
 }
 
 /* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {}
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {}
 
 /* Constructor for channel_data */
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
   GPR_ASSERT(!args->is_last);
-  channel_data *chand = (channel_data *)elem->channel_data;
-  grpc_auth_context *auth_context =
+  channel_data* chand = (channel_data*)elem->channel_data;
+  grpc_auth_context* auth_context =
       grpc_find_auth_context_in_args(args->channel_args);
   GPR_ASSERT(auth_context != NULL);
   chand->auth_context =
       GRPC_AUTH_CONTEXT_REF(auth_context, "server_auth_filter");
-  grpc_server_credentials *creds =
+  grpc_server_credentials* creds =
       grpc_find_server_credentials_in_args(args->channel_args);
   chand->creds = grpc_server_credentials_ref(creds);
   return GRPC_ERROR_NONE;
 }
 
 /* Destructor for channel data */
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   GRPC_AUTH_CONTEXT_UNREF(chand->auth_context, "server_auth_filter");
   grpc_server_credentials_unref(exec_ctx, chand->creds);
 }
diff --git a/src/core/lib/security/transport/tsi_error.cc b/src/core/lib/security/transport/tsi_error.cc
index 72f9600..f71696d 100644
--- a/src/core/lib/security/transport/tsi_error.cc
+++ b/src/core/lib/security/transport/tsi_error.cc
@@ -18,7 +18,7 @@
 
 #include "src/core/lib/security/transport/tsi_error.h"
 
-grpc_error *grpc_set_tsi_error_result(grpc_error *error, tsi_result result) {
+grpc_error* grpc_set_tsi_error_result(grpc_error* error, tsi_result result) {
   return grpc_error_set_int(
       grpc_error_set_str(
           error, GRPC_ERROR_STR_TSI_ERROR,
diff --git a/src/core/lib/security/transport/tsi_error.h b/src/core/lib/security/transport/tsi_error.h
index 4e19daf..4e8418f 100644
--- a/src/core/lib/security/transport/tsi_error.h
+++ b/src/core/lib/security/transport/tsi_error.h
@@ -26,7 +26,7 @@
 extern "C" {
 #endif
 
-grpc_error *grpc_set_tsi_error_result(grpc_error *error, tsi_result result);
+grpc_error* grpc_set_tsi_error_result(grpc_error* error, tsi_result result);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/security/util/json_util.cc b/src/core/lib/security/util/json_util.cc
index d847add..365bd15 100644
--- a/src/core/lib/security/util/json_util.cc
+++ b/src/core/lib/security/util/json_util.cc
@@ -23,9 +23,9 @@
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 
-const char *grpc_json_get_string_property(const grpc_json *json,
-                                          const char *prop_name) {
-  grpc_json *child;
+const char* grpc_json_get_string_property(const grpc_json* json,
+                                          const char* prop_name) {
+  grpc_json* child;
   for (child = json->child; child != NULL; child = child->next) {
     if (strcmp(child->key, prop_name) == 0) break;
   }
@@ -36,10 +36,10 @@
   return child->value;
 }
 
-bool grpc_copy_json_string_property(const grpc_json *json,
-                                    const char *prop_name,
-                                    char **copied_value) {
-  const char *prop_value = grpc_json_get_string_property(json, prop_name);
+bool grpc_copy_json_string_property(const grpc_json* json,
+                                    const char* prop_name,
+                                    char** copied_value) {
+  const char* prop_value = grpc_json_get_string_property(json, prop_name);
   if (prop_value == NULL) return false;
   *copied_value = gpr_strdup(prop_value);
   return true;
diff --git a/src/core/lib/security/util/json_util.h b/src/core/lib/security/util/json_util.h
index cdd8a71..7538f76 100644
--- a/src/core/lib/security/util/json_util.h
+++ b/src/core/lib/security/util/json_util.h
@@ -33,13 +33,13 @@
 #endif
 
 // Gets a child property from a json node.
-const char *grpc_json_get_string_property(const grpc_json *json,
-                                          const char *prop_name);
+const char* grpc_json_get_string_property(const grpc_json* json,
+                                          const char* prop_name);
 
 // Copies the value of the json child property specified by prop_name.
 // Returns false if the property was not found.
-bool grpc_copy_json_string_property(const grpc_json *json,
-                                    const char *prop_name, char **copied_value);
+bool grpc_copy_json_string_property(const grpc_json* json,
+                                    const char* prop_name, char** copied_value);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/slice/b64.cc b/src/core/lib/slice/b64.cc
index 5026471..fe7a86e 100644
--- a/src/core/lib/slice/b64.cc
+++ b/src/core/lib/slice/b64.cc
@@ -54,11 +54,11 @@
 
 /* --- base64 functions. --- */
 
-char *grpc_base64_encode(const void *vdata, size_t data_size, int url_safe,
+char* grpc_base64_encode(const void* vdata, size_t data_size, int url_safe,
                          int multiline) {
   size_t result_projected_size =
       grpc_base64_estimate_encoded_size(data_size, url_safe, multiline);
-  char *result = (char *)gpr_malloc(result_projected_size);
+  char* result = (char*)gpr_malloc(result_projected_size);
   grpc_base64_encode_core(result, vdata, data_size, url_safe, multiline);
   return result;
 }
@@ -73,15 +73,15 @@
   return result_projected_size;
 }
 
-void grpc_base64_encode_core(char *result, const void *vdata, size_t data_size,
+void grpc_base64_encode_core(char* result, const void* vdata, size_t data_size,
                              int url_safe, int multiline) {
-  const unsigned char *data = (const unsigned char *)vdata;
-  const char *base64_chars =
+  const unsigned char* data = (const unsigned char*)vdata;
+  const char* base64_chars =
       url_safe ? base64_url_safe_chars : base64_url_unsafe_chars;
   const size_t result_projected_size =
       grpc_base64_estimate_encoded_size(data_size, url_safe, multiline);
 
-  char *current = result;
+  char* current = result;
   size_t num_blocks = 0;
   size_t i = 0;
 
@@ -122,27 +122,27 @@
   result[current - result] = '\0';
 }
 
-grpc_slice grpc_base64_decode(grpc_exec_ctx *exec_ctx, const char *b64,
+grpc_slice grpc_base64_decode(grpc_exec_ctx* exec_ctx, const char* b64,
                               int url_safe) {
   return grpc_base64_decode_with_len(exec_ctx, b64, strlen(b64), url_safe);
 }
 
-static void decode_one_char(const unsigned char *codes, unsigned char *result,
-                            size_t *result_offset) {
+static void decode_one_char(const unsigned char* codes, unsigned char* result,
+                            size_t* result_offset) {
   uint32_t packed = ((uint32_t)codes[0] << 2) | ((uint32_t)codes[1] >> 4);
   result[(*result_offset)++] = (unsigned char)packed;
 }
 
-static void decode_two_chars(const unsigned char *codes, unsigned char *result,
-                             size_t *result_offset) {
+static void decode_two_chars(const unsigned char* codes, unsigned char* result,
+                             size_t* result_offset) {
   uint32_t packed = ((uint32_t)codes[0] << 10) | ((uint32_t)codes[1] << 4) |
                     ((uint32_t)codes[2] >> 2);
   result[(*result_offset)++] = (unsigned char)(packed >> 8);
   result[(*result_offset)++] = (unsigned char)(packed);
 }
 
-static int decode_group(const unsigned char *codes, size_t num_codes,
-                        unsigned char *result, size_t *result_offset) {
+static int decode_group(const unsigned char* codes, size_t num_codes,
+                        unsigned char* result, size_t* result_offset) {
   GPR_ASSERT(num_codes <= 4);
 
   /* Short end groups that may not have padding. */
@@ -185,10 +185,10 @@
   return 1;
 }
 
-grpc_slice grpc_base64_decode_with_len(grpc_exec_ctx *exec_ctx, const char *b64,
+grpc_slice grpc_base64_decode_with_len(grpc_exec_ctx* exec_ctx, const char* b64,
                                        size_t b64_len, int url_safe) {
   grpc_slice result = GRPC_SLICE_MALLOC(b64_len);
-  unsigned char *current = GRPC_SLICE_START_PTR(result);
+  unsigned char* current = GRPC_SLICE_START_PTR(result);
   size_t result_size = 0;
   unsigned char codes[4];
   size_t num_codes = 0;
diff --git a/src/core/lib/slice/b64.h b/src/core/lib/slice/b64.h
index 9b4dc65..467f5d8 100644
--- a/src/core/lib/slice/b64.h
+++ b/src/core/lib/slice/b64.h
@@ -28,7 +28,7 @@
 /* Encodes data using base64. It is the caller's responsability to free
    the returned char * using gpr_free. Returns NULL on NULL input.
    TODO(makdharma) : change the flags to bool from int */
-char *grpc_base64_encode(const void *data, size_t data_size, int url_safe,
+char* grpc_base64_encode(const void* data, size_t data_size, int url_safe,
                          int multiline);
 
 /* estimate the upper bound on size of base64 encoded data. The actual size
@@ -39,16 +39,16 @@
 /* Encodes data using base64 and write it to memory pointed to by result. It is
  * the caller's responsiblity to allocate enough memory in |result| to fit the
  * encoded data. */
-void grpc_base64_encode_core(char *result, const void *vdata, size_t data_size,
+void grpc_base64_encode_core(char* result, const void* vdata, size_t data_size,
                              int url_safe, int multiline);
 
 /* Decodes data according to the base64 specification. Returns an empty
    slice in case of failure. */
-grpc_slice grpc_base64_decode(grpc_exec_ctx *exec_ctx, const char *b64,
+grpc_slice grpc_base64_decode(grpc_exec_ctx* exec_ctx, const char* b64,
                               int url_safe);
 
 /* Same as above except that the length is provided by the caller. */
-grpc_slice grpc_base64_decode_with_len(grpc_exec_ctx *exec_ctx, const char *b64,
+grpc_slice grpc_base64_decode_with_len(grpc_exec_ctx* exec_ctx, const char* b64,
                                        size_t b64_len, int url_safe);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/slice/percent_encoding.cc b/src/core/lib/slice/percent_encoding.cc
index effc8d7..894e43b 100644
--- a/src/core/lib/slice/percent_encoding.cc
+++ b/src/core/lib/slice/percent_encoding.cc
@@ -32,19 +32,19 @@
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
 static bool is_unreserved_character(uint8_t c,
-                                    const uint8_t *unreserved_bytes) {
+                                    const uint8_t* unreserved_bytes) {
   return ((unreserved_bytes[c / 8] >> (c % 8)) & 1) != 0;
 }
 
 grpc_slice grpc_percent_encode_slice(grpc_slice slice,
-                                     const uint8_t *unreserved_bytes) {
+                                     const uint8_t* unreserved_bytes) {
   static const uint8_t hex[] = "0123456789ABCDEF";
 
   // first pass: count the number of bytes needed to output this string
   size_t output_length = 0;
-  const uint8_t *slice_start = GRPC_SLICE_START_PTR(slice);
-  const uint8_t *slice_end = GRPC_SLICE_END_PTR(slice);
-  const uint8_t *p;
+  const uint8_t* slice_start = GRPC_SLICE_START_PTR(slice);
+  const uint8_t* slice_end = GRPC_SLICE_END_PTR(slice);
+  const uint8_t* p;
   bool any_reserved_bytes = false;
   for (p = slice_start; p < slice_end; p++) {
     bool unres = is_unreserved_character(*p, unreserved_bytes);
@@ -57,7 +57,7 @@
   }
   // second pass: actually encode
   grpc_slice out = GRPC_SLICE_MALLOC(output_length);
-  uint8_t *q = GRPC_SLICE_START_PTR(out);
+  uint8_t* q = GRPC_SLICE_START_PTR(out);
   for (p = slice_start; p < slice_end; p++) {
     if (is_unreserved_character(*p, unreserved_bytes)) {
       *q++ = *p;
@@ -71,7 +71,7 @@
   return out;
 }
 
-static bool valid_hex(const uint8_t *p, const uint8_t *end) {
+static bool valid_hex(const uint8_t* p, const uint8_t* end) {
   if (p >= end) return false;
   return (*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f') ||
          (*p >= 'A' && *p <= 'F');
@@ -85,10 +85,10 @@
 }
 
 bool grpc_strict_percent_decode_slice(grpc_slice slice_in,
-                                      const uint8_t *unreserved_bytes,
-                                      grpc_slice *slice_out) {
-  const uint8_t *p = GRPC_SLICE_START_PTR(slice_in);
-  const uint8_t *in_end = GRPC_SLICE_END_PTR(slice_in);
+                                      const uint8_t* unreserved_bytes,
+                                      grpc_slice* slice_out) {
+  const uint8_t* p = GRPC_SLICE_START_PTR(slice_in);
+  const uint8_t* in_end = GRPC_SLICE_END_PTR(slice_in);
   size_t out_length = 0;
   bool any_percent_encoded_stuff = false;
   while (p != in_end) {
@@ -111,7 +111,7 @@
   }
   p = GRPC_SLICE_START_PTR(slice_in);
   *slice_out = GRPC_SLICE_MALLOC(out_length);
-  uint8_t *q = GRPC_SLICE_START_PTR(*slice_out);
+  uint8_t* q = GRPC_SLICE_START_PTR(*slice_out);
   while (p != in_end) {
     if (*p == '%') {
       *q++ = (uint8_t)(dehex(p[1]) << 4) | (dehex(p[2]));
@@ -125,8 +125,8 @@
 }
 
 grpc_slice grpc_permissive_percent_decode_slice(grpc_slice slice_in) {
-  const uint8_t *p = GRPC_SLICE_START_PTR(slice_in);
-  const uint8_t *in_end = GRPC_SLICE_END_PTR(slice_in);
+  const uint8_t* p = GRPC_SLICE_START_PTR(slice_in);
+  const uint8_t* in_end = GRPC_SLICE_END_PTR(slice_in);
   size_t out_length = 0;
   bool any_percent_encoded_stuff = false;
   while (p != in_end) {
@@ -149,7 +149,7 @@
   }
   p = GRPC_SLICE_START_PTR(slice_in);
   grpc_slice out = GRPC_SLICE_MALLOC(out_length);
-  uint8_t *q = GRPC_SLICE_START_PTR(out);
+  uint8_t* q = GRPC_SLICE_START_PTR(out);
   while (p != in_end) {
     if (*p == '%') {
       if (!valid_hex(p + 1, in_end) || !valid_hex(p + 2, in_end)) {
diff --git a/src/core/lib/slice/percent_encoding.h b/src/core/lib/slice/percent_encoding.h
index 14a4deb..22b5e8d 100644
--- a/src/core/lib/slice/percent_encoding.h
+++ b/src/core/lib/slice/percent_encoding.h
@@ -49,7 +49,7 @@
    unreserved_bytes is a bitfield indicating which bytes are considered
    unreserved and thus do not need percent encoding */
 grpc_slice grpc_percent_encode_slice(grpc_slice slice,
-                                     const uint8_t *unreserved_bytes);
+                                     const uint8_t* unreserved_bytes);
 /* Percent-decode a slice, strictly.
    If the input is legal (contains no unreserved bytes, and legal % encodings),
    returns true and sets *slice_out to the decoded slice.
@@ -57,8 +57,8 @@
    unreserved_bytes is a bitfield indicating which bytes are considered
    unreserved and thus do not need percent encoding */
 bool grpc_strict_percent_decode_slice(grpc_slice slice_in,
-                                      const uint8_t *unreserved_bytes,
-                                      grpc_slice *slice_out);
+                                      const uint8_t* unreserved_bytes,
+                                      grpc_slice* slice_out);
 /* Percent-decode a slice, permissively.
    If a % triplet can not be decoded, pass it through verbatim.
    This cannot fail. */
diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc
index 0764eda..d8e3200 100644
--- a/src/core/lib/slice/slice.cc
+++ b/src/core/lib/slice/slice.cc
@@ -26,8 +26,8 @@
 
 #include "src/core/lib/iomgr/exec_ctx.h"
 
-char *grpc_slice_to_c_string(grpc_slice slice) {
-  char *out = (char *)gpr_malloc(GRPC_SLICE_LENGTH(slice) + 1);
+char* grpc_slice_to_c_string(grpc_slice slice) {
+  char* out = (char*)gpr_malloc(GRPC_SLICE_LENGTH(slice) + 1);
   memcpy(out, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice));
   out[GRPC_SLICE_LENGTH(slice)] = 0;
   return out;
@@ -54,7 +54,7 @@
   return slice;
 }
 
-void grpc_slice_unref_internal(grpc_exec_ctx *exec_ctx, grpc_slice slice) {
+void grpc_slice_unref_internal(grpc_exec_ctx* exec_ctx, grpc_slice slice) {
   if (slice.refcount) {
     slice.refcount->vtable->unref(exec_ctx, slice.refcount);
   }
@@ -74,8 +74,8 @@
 
 /* grpc_slice_from_static_string support structure - a refcount that does
    nothing */
-static void noop_ref(void *unused) {}
-static void noop_unref(grpc_exec_ctx *exec_ctx, void *unused) {}
+static void noop_ref(void* unused) {}
+static void noop_unref(grpc_exec_ctx* exec_ctx, void* unused) {}
 
 static const grpc_slice_refcount_vtable noop_refcount_vtable = {
     noop_ref, noop_unref, grpc_slice_default_eq_impl,
@@ -83,15 +83,15 @@
 static grpc_slice_refcount noop_refcount = {&noop_refcount_vtable,
                                             &noop_refcount};
 
-grpc_slice grpc_slice_from_static_buffer(const void *s, size_t len) {
+grpc_slice grpc_slice_from_static_buffer(const void* s, size_t len) {
   grpc_slice slice;
   slice.refcount = &noop_refcount;
-  slice.data.refcounted.bytes = (uint8_t *)s;
+  slice.data.refcounted.bytes = (uint8_t*)s;
   slice.data.refcounted.length = len;
   return slice;
 }
 
-grpc_slice grpc_slice_from_static_string(const char *s) {
+grpc_slice grpc_slice_from_static_string(const char* s) {
   return grpc_slice_from_static_buffer(s, strlen(s));
 }
 
@@ -100,17 +100,17 @@
 typedef struct new_slice_refcount {
   grpc_slice_refcount rc;
   gpr_refcount refs;
-  void (*user_destroy)(void *);
-  void *user_data;
+  void (*user_destroy)(void*);
+  void* user_data;
 } new_slice_refcount;
 
-static void new_slice_ref(void *p) {
-  new_slice_refcount *r = (new_slice_refcount *)p;
+static void new_slice_ref(void* p) {
+  new_slice_refcount* r = (new_slice_refcount*)p;
   gpr_ref(&r->refs);
 }
 
-static void new_slice_unref(grpc_exec_ctx *exec_ctx, void *p) {
-  new_slice_refcount *r = (new_slice_refcount *)p;
+static void new_slice_unref(grpc_exec_ctx* exec_ctx, void* p) {
+  new_slice_refcount* r = (new_slice_refcount*)p;
   if (gpr_unref(&r->refs)) {
     r->user_destroy(r->user_data);
     gpr_free(r);
@@ -121,12 +121,12 @@
     new_slice_ref, new_slice_unref, grpc_slice_default_eq_impl,
     grpc_slice_default_hash_impl};
 
-grpc_slice grpc_slice_new_with_user_data(void *p, size_t len,
-                                         void (*destroy)(void *),
-                                         void *user_data) {
+grpc_slice grpc_slice_new_with_user_data(void* p, size_t len,
+                                         void (*destroy)(void*),
+                                         void* user_data) {
   grpc_slice slice;
-  new_slice_refcount *rc =
-      (new_slice_refcount *)gpr_malloc(sizeof(new_slice_refcount));
+  new_slice_refcount* rc =
+      (new_slice_refcount*)gpr_malloc(sizeof(new_slice_refcount));
   gpr_ref_init(&rc->refs, 1);
   rc->rc.vtable = &new_slice_vtable;
   rc->rc.sub_refcount = &rc->rc;
@@ -134,12 +134,12 @@
   rc->user_data = user_data;
 
   slice.refcount = &rc->rc;
-  slice.data.refcounted.bytes = (uint8_t *)p;
+  slice.data.refcounted.bytes = (uint8_t*)p;
   slice.data.refcounted.length = len;
   return slice;
 }
 
-grpc_slice grpc_slice_new(void *p, size_t len, void (*destroy)(void *)) {
+grpc_slice grpc_slice_new(void* p, size_t len, void (*destroy)(void*)) {
   /* Pass "p" to *destroy when the slice is no longer needed. */
   return grpc_slice_new_with_user_data(p, len, destroy, p);
 }
@@ -149,18 +149,18 @@
 typedef struct new_with_len_slice_refcount {
   grpc_slice_refcount rc;
   gpr_refcount refs;
-  void *user_data;
+  void* user_data;
   size_t user_length;
-  void (*user_destroy)(void *, size_t);
+  void (*user_destroy)(void*, size_t);
 } new_with_len_slice_refcount;
 
-static void new_with_len_ref(void *p) {
-  new_with_len_slice_refcount *r = (new_with_len_slice_refcount *)p;
+static void new_with_len_ref(void* p) {
+  new_with_len_slice_refcount* r = (new_with_len_slice_refcount*)p;
   gpr_ref(&r->refs);
 }
 
-static void new_with_len_unref(grpc_exec_ctx *exec_ctx, void *p) {
-  new_with_len_slice_refcount *r = (new_with_len_slice_refcount *)p;
+static void new_with_len_unref(grpc_exec_ctx* exec_ctx, void* p) {
+  new_with_len_slice_refcount* r = (new_with_len_slice_refcount*)p;
   if (gpr_unref(&r->refs)) {
     r->user_destroy(r->user_data, r->user_length);
     gpr_free(r);
@@ -171,10 +171,10 @@
     new_with_len_ref, new_with_len_unref, grpc_slice_default_eq_impl,
     grpc_slice_default_hash_impl};
 
-grpc_slice grpc_slice_new_with_len(void *p, size_t len,
-                                   void (*destroy)(void *, size_t)) {
+grpc_slice grpc_slice_new_with_len(void* p, size_t len,
+                                   void (*destroy)(void*, size_t)) {
   grpc_slice slice;
-  new_with_len_slice_refcount *rc = (new_with_len_slice_refcount *)gpr_malloc(
+  new_with_len_slice_refcount* rc = (new_with_len_slice_refcount*)gpr_malloc(
       sizeof(new_with_len_slice_refcount));
   gpr_ref_init(&rc->refs, 1);
   rc->rc.vtable = &new_with_len_vtable;
@@ -184,19 +184,19 @@
   rc->user_length = len;
 
   slice.refcount = &rc->rc;
-  slice.data.refcounted.bytes = (uint8_t *)p;
+  slice.data.refcounted.bytes = (uint8_t*)p;
   slice.data.refcounted.length = len;
   return slice;
 }
 
-grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t length) {
+grpc_slice grpc_slice_from_copied_buffer(const char* source, size_t length) {
   if (length == 0) return grpc_empty_slice();
   grpc_slice slice = GRPC_SLICE_MALLOC(length);
   memcpy(GRPC_SLICE_START_PTR(slice), source, length);
   return slice;
 }
 
-grpc_slice grpc_slice_from_copied_string(const char *source) {
+grpc_slice grpc_slice_from_copied_string(const char* source) {
   return grpc_slice_from_copied_buffer(source, strlen(source));
 }
 
@@ -205,13 +205,13 @@
   gpr_refcount refs;
 } malloc_refcount;
 
-static void malloc_ref(void *p) {
-  malloc_refcount *r = (malloc_refcount *)p;
+static void malloc_ref(void* p) {
+  malloc_refcount* r = (malloc_refcount*)p;
   gpr_ref(&r->refs);
 }
 
-static void malloc_unref(grpc_exec_ctx *exec_ctx, void *p) {
-  malloc_refcount *r = (malloc_refcount *)p;
+static void malloc_unref(grpc_exec_ctx* exec_ctx, void* p) {
+  malloc_refcount* r = (malloc_refcount*)p;
   if (gpr_unref(&r->refs)) {
     gpr_free(r);
   }
@@ -233,8 +233,8 @@
      refcount is a malloc_refcount
      bytes is an array of bytes of the requested length
      Both parts are placed in the same allocation returned from gpr_malloc */
-  malloc_refcount *rc =
-      (malloc_refcount *)gpr_malloc(sizeof(malloc_refcount) + length);
+  malloc_refcount* rc =
+      (malloc_refcount*)gpr_malloc(sizeof(malloc_refcount) + length);
 
   /* Initial refcount on rc is 1 - and it's up to the caller to release
      this reference. */
@@ -247,7 +247,7 @@
   /* The slices refcount points back to the allocated block. */
   slice.refcount = &rc->base;
   /* The data bytes are placed immediately after the refcount struct */
-  slice.data.refcounted.bytes = (uint8_t *)(rc + 1);
+  slice.data.refcounted.bytes = (uint8_t*)(rc + 1);
   /* And the length of the block is set to the requested length */
   slice.data.refcounted.length = length;
   return slice;
@@ -307,7 +307,7 @@
   return subset;
 }
 
-grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice *source, size_t split,
+grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice* source, size_t split,
                                            grpc_slice_ref_whom ref_whom) {
   grpc_slice tail;
 
@@ -358,11 +358,11 @@
   return tail;
 }
 
-grpc_slice grpc_slice_split_tail(grpc_slice *source, size_t split) {
+grpc_slice grpc_slice_split_tail(grpc_slice* source, size_t split) {
   return grpc_slice_split_tail_maybe_ref(source, split, GRPC_SLICE_REF_BOTH);
 }
 
-grpc_slice grpc_slice_split_head(grpc_slice *source, size_t split) {
+grpc_slice grpc_slice_split_head(grpc_slice* source, size_t split) {
   grpc_slice head;
 
   if (source->refcount == NULL) {
@@ -423,7 +423,7 @@
                 GRPC_SLICE_LENGTH(a));
 }
 
-int grpc_slice_str_cmp(grpc_slice a, const char *b) {
+int grpc_slice_str_cmp(grpc_slice a, const char* b) {
   size_t b_length = strlen(b);
   int d = (int)(GRPC_SLICE_LENGTH(a) - b_length);
   if (d != 0) return d;
@@ -438,13 +438,13 @@
          a.data.refcounted.bytes == b.data.refcounted.bytes;
 }
 
-int grpc_slice_buf_start_eq(grpc_slice a, const void *b, size_t len) {
+int grpc_slice_buf_start_eq(grpc_slice a, const void* b, size_t len) {
   if (GRPC_SLICE_LENGTH(a) < len) return 0;
   return 0 == memcmp(GRPC_SLICE_START_PTR(a), b, len);
 }
 
 int grpc_slice_rchr(grpc_slice s, char c) {
-  const char *b = (const char *)GRPC_SLICE_START_PTR(s);
+  const char* b = (const char*)GRPC_SLICE_START_PTR(s);
   int i;
   for (i = (int)GRPC_SLICE_LENGTH(s) - 1; i != -1 && b[i] != c; i--)
     ;
@@ -452,16 +452,16 @@
 }
 
 int grpc_slice_chr(grpc_slice s, char c) {
-  const char *b = (const char *)GRPC_SLICE_START_PTR(s);
-  const char *p = (const char *)memchr(b, c, GRPC_SLICE_LENGTH(s));
+  const char* b = (const char*)GRPC_SLICE_START_PTR(s);
+  const char* p = (const char*)memchr(b, c, GRPC_SLICE_LENGTH(s));
   return p == NULL ? -1 : (int)(p - b);
 }
 
 int grpc_slice_slice(grpc_slice haystack, grpc_slice needle) {
   size_t haystack_len = GRPC_SLICE_LENGTH(haystack);
-  const uint8_t *haystack_bytes = GRPC_SLICE_START_PTR(haystack);
+  const uint8_t* haystack_bytes = GRPC_SLICE_START_PTR(haystack);
   size_t needle_len = GRPC_SLICE_LENGTH(needle);
-  const uint8_t *needle_bytes = GRPC_SLICE_START_PTR(needle);
+  const uint8_t* needle_bytes = GRPC_SLICE_START_PTR(needle);
 
   if (haystack_len == 0 || needle_len == 0) return -1;
   if (haystack_len < needle_len) return -1;
@@ -469,8 +469,8 @@
     return grpc_slice_eq(haystack, needle) ? 0 : -1;
   if (needle_len == 1) return grpc_slice_chr(haystack, (char)*needle_bytes);
 
-  const uint8_t *last = haystack_bytes + haystack_len - needle_len;
-  for (const uint8_t *cur = haystack_bytes; cur != last; ++cur) {
+  const uint8_t* last = haystack_bytes + haystack_len - needle_len;
+  for (const uint8_t* cur = haystack_bytes; cur != last; ++cur) {
     if (0 == memcmp(cur, needle_bytes, needle_len)) {
       return (int)(cur - haystack_bytes);
     }
diff --git a/src/core/lib/slice/slice_buffer.cc b/src/core/lib/slice/slice_buffer.cc
index 63ffc0b..3b71fdd 100644
--- a/src/core/lib/slice/slice_buffer.cc
+++ b/src/core/lib/slice/slice_buffer.cc
@@ -30,7 +30,7 @@
 /* grow a buffer; requires GRPC_SLICE_BUFFER_INLINE_ELEMENTS > 1 */
 #define GROW(x) (3 * (x) / 2)
 
-static void maybe_embiggen(grpc_slice_buffer *sb) {
+static void maybe_embiggen(grpc_slice_buffer* sb) {
   /* How far away from sb->base_slices is sb->slices pointer */
   size_t slice_offset = (size_t)(sb->slices - sb->base_slices);
   size_t slice_count = sb->count + slice_offset;
@@ -46,10 +46,10 @@
       GPR_ASSERT(sb->capacity > slice_count);
       if (sb->base_slices == sb->inlined) {
         sb->base_slices =
-            (grpc_slice *)gpr_malloc(sb->capacity * sizeof(grpc_slice));
+            (grpc_slice*)gpr_malloc(sb->capacity * sizeof(grpc_slice));
         memcpy(sb->base_slices, sb->inlined, slice_count * sizeof(grpc_slice));
       } else {
-        sb->base_slices = (grpc_slice *)gpr_realloc(
+        sb->base_slices = (grpc_slice*)gpr_realloc(
             sb->base_slices, sb->capacity * sizeof(grpc_slice));
       }
 
@@ -58,30 +58,30 @@
   }
 }
 
-void grpc_slice_buffer_init(grpc_slice_buffer *sb) {
+void grpc_slice_buffer_init(grpc_slice_buffer* sb) {
   sb->count = 0;
   sb->length = 0;
   sb->capacity = GRPC_SLICE_BUFFER_INLINE_ELEMENTS;
   sb->base_slices = sb->slices = sb->inlined;
 }
 
-void grpc_slice_buffer_destroy_internal(grpc_exec_ctx *exec_ctx,
-                                        grpc_slice_buffer *sb) {
+void grpc_slice_buffer_destroy_internal(grpc_exec_ctx* exec_ctx,
+                                        grpc_slice_buffer* sb) {
   grpc_slice_buffer_reset_and_unref_internal(exec_ctx, sb);
   if (sb->base_slices != sb->inlined) {
     gpr_free(sb->base_slices);
   }
 }
 
-void grpc_slice_buffer_destroy(grpc_slice_buffer *sb) {
+void grpc_slice_buffer_destroy(grpc_slice_buffer* sb) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_slice_buffer_destroy_internal(&exec_ctx, sb);
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-uint8_t *grpc_slice_buffer_tiny_add(grpc_slice_buffer *sb, size_t n) {
-  grpc_slice *back;
-  uint8_t *out;
+uint8_t* grpc_slice_buffer_tiny_add(grpc_slice_buffer* sb, size_t n) {
+  grpc_slice* back;
+  uint8_t* out;
 
   sb->length += n;
 
@@ -103,7 +103,7 @@
   return back->data.inlined.bytes;
 }
 
-size_t grpc_slice_buffer_add_indexed(grpc_slice_buffer *sb, grpc_slice s) {
+size_t grpc_slice_buffer_add_indexed(grpc_slice_buffer* sb, grpc_slice s) {
   size_t out = sb->count;
   maybe_embiggen(sb);
   sb->slices[out] = s;
@@ -112,7 +112,7 @@
   return out;
 }
 
-void grpc_slice_buffer_add(grpc_slice_buffer *sb, grpc_slice s) {
+void grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice s) {
   size_t n = sb->count;
   /* if both the last slice in the slice buffer and the slice being added
      are inlined (that is, that they carry their data inside the slice data
@@ -120,7 +120,7 @@
      into the back slice, preventing many small slices being passed into
      writes */
   if (!s.refcount && n) {
-    grpc_slice *back = &sb->slices[n - 1];
+    grpc_slice* back = &sb->slices[n - 1];
     if (!back->refcount &&
         back->data.inlined.length < GRPC_SLICE_INLINED_SIZE) {
       if (s.data.inlined.length + back->data.inlined.length <=
@@ -149,22 +149,22 @@
   grpc_slice_buffer_add_indexed(sb, s);
 }
 
-void grpc_slice_buffer_addn(grpc_slice_buffer *sb, grpc_slice *s, size_t n) {
+void grpc_slice_buffer_addn(grpc_slice_buffer* sb, grpc_slice* s, size_t n) {
   size_t i;
   for (i = 0; i < n; i++) {
     grpc_slice_buffer_add(sb, s[i]);
   }
 }
 
-void grpc_slice_buffer_pop(grpc_slice_buffer *sb) {
+void grpc_slice_buffer_pop(grpc_slice_buffer* sb) {
   if (sb->count != 0) {
     size_t count = --sb->count;
     sb->length -= GRPC_SLICE_LENGTH(sb->slices[count]);
   }
 }
 
-void grpc_slice_buffer_reset_and_unref_internal(grpc_exec_ctx *exec_ctx,
-                                                grpc_slice_buffer *sb) {
+void grpc_slice_buffer_reset_and_unref_internal(grpc_exec_ctx* exec_ctx,
+                                                grpc_slice_buffer* sb) {
   size_t i;
   for (i = 0; i < sb->count; i++) {
     grpc_slice_unref_internal(exec_ctx, sb->slices[i]);
@@ -174,13 +174,13 @@
   sb->length = 0;
 }
 
-void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer *sb) {
+void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer* sb) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_slice_buffer_reset_and_unref_internal(&exec_ctx, sb);
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-void grpc_slice_buffer_swap(grpc_slice_buffer *a, grpc_slice_buffer *b) {
+void grpc_slice_buffer_swap(grpc_slice_buffer* a, grpc_slice_buffer* b) {
   size_t a_offset = (size_t)(a->slices - a->base_slices);
   size_t b_offset = (size_t)(b->slices - b->base_slices);
 
@@ -207,7 +207,7 @@
     memcpy(a->base_slices, b->inlined, b_count * sizeof(grpc_slice));
   } else {
     /* no inlining: easy swap */
-    GPR_SWAP(grpc_slice *, a->base_slices, b->base_slices);
+    GPR_SWAP(grpc_slice*, a->base_slices, b->base_slices);
   }
 
   /* Update the slices pointers (cannot do a GPR_SWAP on slices fields here).
@@ -222,8 +222,8 @@
   GPR_SWAP(size_t, a->length, b->length);
 }
 
-void grpc_slice_buffer_move_into(grpc_slice_buffer *src,
-                                 grpc_slice_buffer *dst) {
+void grpc_slice_buffer_move_into(grpc_slice_buffer* src,
+                                 grpc_slice_buffer* dst) {
   /* anything to move? */
   if (src->count == 0) {
     return;
@@ -239,8 +239,8 @@
   src->length = 0;
 }
 
-static void slice_buffer_move_first_maybe_ref(grpc_slice_buffer *src, size_t n,
-                                              grpc_slice_buffer *dst,
+static void slice_buffer_move_first_maybe_ref(grpc_slice_buffer* src, size_t n,
+                                              grpc_slice_buffer* dst,
                                               bool incref) {
   GPR_ASSERT(src->length >= n);
   if (src->length == n) {
@@ -279,20 +279,20 @@
   GPR_ASSERT(src->count > 0);
 }
 
-void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
-                                  grpc_slice_buffer *dst) {
+void grpc_slice_buffer_move_first(grpc_slice_buffer* src, size_t n,
+                                  grpc_slice_buffer* dst) {
   slice_buffer_move_first_maybe_ref(src, n, dst, true);
 }
 
-void grpc_slice_buffer_move_first_no_ref(grpc_slice_buffer *src, size_t n,
-                                         grpc_slice_buffer *dst) {
+void grpc_slice_buffer_move_first_no_ref(grpc_slice_buffer* src, size_t n,
+                                         grpc_slice_buffer* dst) {
   slice_buffer_move_first_maybe_ref(src, n, dst, false);
 }
 
-void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx *exec_ctx,
-                                              grpc_slice_buffer *src, size_t n,
-                                              void *dst) {
-  char *dstp = (char *)dst;
+void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx* exec_ctx,
+                                              grpc_slice_buffer* src, size_t n,
+                                              void* dst) {
+  char* dstp = (char*)dst;
   GPR_ASSERT(src->length >= n);
 
   while (n > 0) {
@@ -316,8 +316,8 @@
   }
 }
 
-void grpc_slice_buffer_trim_end(grpc_slice_buffer *sb, size_t n,
-                                grpc_slice_buffer *garbage) {
+void grpc_slice_buffer_trim_end(grpc_slice_buffer* sb, size_t n,
+                                grpc_slice_buffer* garbage) {
   GPR_ASSERT(n <= sb->length);
   sb->length -= n;
   for (;;) {
@@ -340,7 +340,7 @@
   }
 }
 
-grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *sb) {
+grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer* sb) {
   grpc_slice slice;
   GPR_ASSERT(sb->count > 0);
   slice = sb->slices[0];
@@ -351,7 +351,7 @@
   return slice;
 }
 
-void grpc_slice_buffer_undo_take_first(grpc_slice_buffer *sb,
+void grpc_slice_buffer_undo_take_first(grpc_slice_buffer* sb,
                                        grpc_slice slice) {
   sb->slices--;
   sb->slices[0] = slice;
diff --git a/src/core/lib/slice/slice_hash_table.h b/src/core/lib/slice/slice_hash_table.h
index 41250df..f86f25e 100644
--- a/src/core/lib/slice/slice_hash_table.h
+++ b/src/core/lib/slice/slice_hash_table.h
@@ -39,7 +39,7 @@
 
 typedef struct grpc_slice_hash_table_entry {
   grpc_slice key;
-  void *value; /* Must not be NULL. */
+  void* value; /* Must not be NULL. */
 } grpc_slice_hash_table_entry;
 
 /** Creates a new hash table of containing \a entries, which is an array
@@ -48,18 +48,18 @@
     value_cmp will be used to compare values in the context of \a
     grpc_slice_hash_table_cmp. If NULL, raw pointer (\a GPR_ICMP) comparison
     will be used. */
-grpc_slice_hash_table *grpc_slice_hash_table_create(
-    size_t num_entries, grpc_slice_hash_table_entry *entries,
-    void (*destroy_value)(grpc_exec_ctx *exec_ctx, void *value),
-    int (*value_cmp)(void *a, void *b));
+grpc_slice_hash_table* grpc_slice_hash_table_create(
+    size_t num_entries, grpc_slice_hash_table_entry* entries,
+    void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value),
+    int (*value_cmp)(void* a, void* b));
 
-grpc_slice_hash_table *grpc_slice_hash_table_ref(grpc_slice_hash_table *table);
-void grpc_slice_hash_table_unref(grpc_exec_ctx *exec_ctx,
-                                 grpc_slice_hash_table *table);
+grpc_slice_hash_table* grpc_slice_hash_table_ref(grpc_slice_hash_table* table);
+void grpc_slice_hash_table_unref(grpc_exec_ctx* exec_ctx,
+                                 grpc_slice_hash_table* table);
 
 /** Returns the value from \a table associated with \a key.
     Returns NULL if \a key is not found. */
-void *grpc_slice_hash_table_get(const grpc_slice_hash_table *table,
+void* grpc_slice_hash_table_get(const grpc_slice_hash_table* table,
                                 const grpc_slice key);
 
 /** Compares \a a vs. \a b.
@@ -68,8 +68,8 @@
  *  - else, it contains fewer (resp. more) entries,
  *  - else, if strcmp(a_key, b_key) < 1 (resp. > 1),
  *  - else, if value_cmp(a_value, b_value) < 1 (resp. > 1). */
-int grpc_slice_hash_table_cmp(const grpc_slice_hash_table *a,
-                              const grpc_slice_hash_table *b);
+int grpc_slice_hash_table_cmp(const grpc_slice_hash_table* a,
+                              const grpc_slice_hash_table* b);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/slice/slice_intern.cc b/src/core/lib/slice/slice_intern.cc
index 1ea9a2a..50a0eba 100644
--- a/src/core/lib/slice/slice_intern.cc
+++ b/src/core/lib/slice/slice_intern.cc
@@ -43,12 +43,12 @@
   size_t length;
   gpr_atm refcnt;
   uint32_t hash;
-  struct interned_slice_refcount *bucket_next;
+  struct interned_slice_refcount* bucket_next;
 } interned_slice_refcount;
 
 typedef struct slice_shard {
   gpr_mu mu;
-  interned_slice_refcount **strs;
+  interned_slice_refcount** strs;
   size_t count;
   size_t capacity;
 } slice_shard;
@@ -69,17 +69,17 @@
 static uint32_t max_static_metadata_hash_probe;
 static uint32_t static_metadata_hash_values[GRPC_STATIC_MDSTR_COUNT];
 
-static void interned_slice_ref(void *p) {
-  interned_slice_refcount *s = (interned_slice_refcount *)p;
+static void interned_slice_ref(void* p) {
+  interned_slice_refcount* s = (interned_slice_refcount*)p;
   GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&s->refcnt, 1) > 0);
 }
 
-static void interned_slice_destroy(interned_slice_refcount *s) {
-  slice_shard *shard = &g_shards[SHARD_IDX(s->hash)];
+static void interned_slice_destroy(interned_slice_refcount* s) {
+  slice_shard* shard = &g_shards[SHARD_IDX(s->hash)];
   gpr_mu_lock(&shard->mu);
   GPR_ASSERT(0 == gpr_atm_no_barrier_load(&s->refcnt));
-  interned_slice_refcount **prev_next;
-  interned_slice_refcount *cur;
+  interned_slice_refcount** prev_next;
+  interned_slice_refcount* cur;
   for (prev_next = &shard->strs[TABLE_IDX(s->hash, shard->capacity)],
       cur = *prev_next;
        cur != s; prev_next = &cur->bucket_next, cur = cur->bucket_next)
@@ -90,24 +90,24 @@
   gpr_mu_unlock(&shard->mu);
 }
 
-static void interned_slice_unref(grpc_exec_ctx *exec_ctx, void *p) {
-  interned_slice_refcount *s = (interned_slice_refcount *)p;
+static void interned_slice_unref(grpc_exec_ctx* exec_ctx, void* p) {
+  interned_slice_refcount* s = (interned_slice_refcount*)p;
   if (1 == gpr_atm_full_fetch_add(&s->refcnt, -1)) {
     interned_slice_destroy(s);
   }
 }
 
-static void interned_slice_sub_ref(void *p) {
-  interned_slice_ref(((char *)p) - offsetof(interned_slice_refcount, sub));
+static void interned_slice_sub_ref(void* p) {
+  interned_slice_ref(((char*)p) - offsetof(interned_slice_refcount, sub));
 }
 
-static void interned_slice_sub_unref(grpc_exec_ctx *exec_ctx, void *p) {
+static void interned_slice_sub_unref(grpc_exec_ctx* exec_ctx, void* p) {
   interned_slice_unref(exec_ctx,
-                       ((char *)p) - offsetof(interned_slice_refcount, sub));
+                       ((char*)p) - offsetof(interned_slice_refcount, sub));
 }
 
 static uint32_t interned_slice_hash(grpc_slice slice) {
-  interned_slice_refcount *s = (interned_slice_refcount *)slice.refcount;
+  interned_slice_refcount* s = (interned_slice_refcount*)slice.refcount;
   return s->hash;
 }
 
@@ -122,16 +122,16 @@
     interned_slice_sub_ref, interned_slice_sub_unref,
     grpc_slice_default_eq_impl, grpc_slice_default_hash_impl};
 
-static void grow_shard(slice_shard *shard) {
+static void grow_shard(slice_shard* shard) {
   size_t capacity = shard->capacity * 2;
   size_t i;
-  interned_slice_refcount **strtab;
+  interned_slice_refcount** strtab;
   interned_slice_refcount *s, *next;
 
   GPR_TIMER_BEGIN("grow_strtab", 0);
 
-  strtab = (interned_slice_refcount **)gpr_zalloc(
-      sizeof(interned_slice_refcount *) * capacity);
+  strtab = (interned_slice_refcount**)gpr_zalloc(
+      sizeof(interned_slice_refcount*) * capacity);
 
   for (i = 0; i < shard->capacity; i++) {
     for (s = shard->strs[i]; s; s = next) {
@@ -149,10 +149,10 @@
   GPR_TIMER_END("grow_strtab", 0);
 }
 
-static grpc_slice materialize(interned_slice_refcount *s) {
+static grpc_slice materialize(interned_slice_refcount* s) {
   grpc_slice slice;
   slice.refcount = &s->base;
-  slice.data.refcounted.bytes = (uint8_t *)(s + 1);
+  slice.data.refcounted.bytes = (uint8_t*)(s + 1);
   slice.data.refcounted.length = s->length;
   return slice;
 }
@@ -176,7 +176,7 @@
 }
 
 grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice,
-                                          bool *returned_slice_is_different) {
+                                          bool* returned_slice_is_different) {
   if (GRPC_IS_STATIC_METADATA_STRING(slice)) {
     return slice;
   }
@@ -218,8 +218,8 @@
     }
   }
 
-  interned_slice_refcount *s;
-  slice_shard *shard = &g_shards[SHARD_IDX(hash)];
+  interned_slice_refcount* s;
+  slice_shard* shard = &g_shards[SHARD_IDX(hash)];
 
   gpr_mu_lock(&shard->mu);
 
@@ -244,8 +244,8 @@
 
   /* not found: create a new string */
   /* string data goes after the internal_string header */
-  s = (interned_slice_refcount *)gpr_malloc(sizeof(*s) +
-                                            GRPC_SLICE_LENGTH(slice));
+  s = (interned_slice_refcount*)gpr_malloc(sizeof(*s) +
+                                           GRPC_SLICE_LENGTH(slice));
   gpr_atm_rel_store(&s->refcnt, 1);
   s->length = GRPC_SLICE_LENGTH(slice);
   s->hash = hash;
@@ -279,12 +279,12 @@
     g_hash_seed = (uint32_t)gpr_now(GPR_CLOCK_REALTIME).tv_nsec;
   }
   for (size_t i = 0; i < SHARD_COUNT; i++) {
-    slice_shard *shard = &g_shards[i];
+    slice_shard* shard = &g_shards[i];
     gpr_mu_init(&shard->mu);
     shard->count = 0;
     shard->capacity = INITIAL_SHARD_CAPACITY;
-    shard->strs = (interned_slice_refcount **)gpr_zalloc(sizeof(*shard->strs) *
-                                                         shard->capacity);
+    shard->strs = (interned_slice_refcount**)gpr_zalloc(sizeof(*shard->strs) *
+                                                        shard->capacity);
   }
   for (size_t i = 0; i < GPR_ARRAY_SIZE(static_metadata_hash); i++) {
     static_metadata_hash[i].hash = 0;
@@ -311,16 +311,16 @@
 
 void grpc_slice_intern_shutdown(void) {
   for (size_t i = 0; i < SHARD_COUNT; i++) {
-    slice_shard *shard = &g_shards[i];
+    slice_shard* shard = &g_shards[i];
     gpr_mu_destroy(&shard->mu);
     /* TODO(ctiller): GPR_ASSERT(shard->count == 0); */
     if (shard->count != 0) {
       gpr_log(GPR_DEBUG, "WARNING: %" PRIuPTR " metadata strings were leaked",
               shard->count);
       for (size_t j = 0; j < shard->capacity; j++) {
-        for (interned_slice_refcount *s = shard->strs[j]; s;
+        for (interned_slice_refcount* s = shard->strs[j]; s;
              s = s->bucket_next) {
-          char *text =
+          char* text =
               grpc_dump_slice(materialize(s), GPR_DUMP_HEX | GPR_DUMP_ASCII);
           gpr_log(GPR_DEBUG, "LEAKED: %s", text);
           gpr_free(text);
diff --git a/src/core/lib/slice/slice_internal.h b/src/core/lib/slice/slice_internal.h
index fcf70a0..2439fc0 100644
--- a/src/core/lib/slice/slice_internal.h
+++ b/src/core/lib/slice/slice_internal.h
@@ -29,11 +29,11 @@
 #endif
 
 grpc_slice grpc_slice_ref_internal(grpc_slice slice);
-void grpc_slice_unref_internal(grpc_exec_ctx *exec_ctx, grpc_slice slice);
-void grpc_slice_buffer_reset_and_unref_internal(grpc_exec_ctx *exec_ctx,
-                                                grpc_slice_buffer *sb);
-void grpc_slice_buffer_destroy_internal(grpc_exec_ctx *exec_ctx,
-                                        grpc_slice_buffer *sb);
+void grpc_slice_unref_internal(grpc_exec_ctx* exec_ctx, grpc_slice slice);
+void grpc_slice_buffer_reset_and_unref_internal(grpc_exec_ctx* exec_ctx,
+                                                grpc_slice_buffer* sb);
+void grpc_slice_buffer_destroy_internal(grpc_exec_ctx* exec_ctx,
+                                        grpc_slice_buffer* sb);
 
 /* Check if a slice is interned */
 bool grpc_slice_is_interned(grpc_slice slice);
@@ -46,7 +46,7 @@
 // used for surface boundaries where we might receive an un-interned static
 // string
 grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice,
-                                          bool *returned_slice_is_different);
+                                          bool* returned_slice_is_different);
 uint32_t grpc_static_slice_hash(grpc_slice s);
 int grpc_static_slice_eq(grpc_slice a, grpc_slice b);
 
diff --git a/src/core/lib/slice/slice_string_helpers.cc b/src/core/lib/slice/slice_string_helpers.cc
index d461c47..5385be9 100644
--- a/src/core/lib/slice/slice_string_helpers.cc
+++ b/src/core/lib/slice/slice_string_helpers.cc
@@ -25,8 +25,8 @@
 #include "src/core/lib/slice/slice_internal.h"
 #include "src/core/lib/support/string.h"
 
-char *grpc_dump_slice(grpc_slice s, uint32_t flags) {
-  return gpr_dump((const char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s),
+char* grpc_dump_slice(grpc_slice s, uint32_t flags) {
+  return gpr_dump((const char*)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s),
                   flags);
 }
 
@@ -35,11 +35,11 @@
  * str.
  *
  * Returns 1 and updates \a begin and \a end. Returns 0 otherwise. */
-static int slice_find_separator_offset(const grpc_slice str, const char *sep,
-                                       const size_t read_offset, size_t *begin,
-                                       size_t *end) {
+static int slice_find_separator_offset(const grpc_slice str, const char* sep,
+                                       const size_t read_offset, size_t* begin,
+                                       size_t* end) {
   size_t i;
-  const uint8_t *str_ptr = GRPC_SLICE_START_PTR(str) + read_offset;
+  const uint8_t* str_ptr = GRPC_SLICE_START_PTR(str) + read_offset;
   const size_t str_len = GRPC_SLICE_LENGTH(str) - read_offset;
   const size_t sep_len = strlen(sep);
   if (str_len < sep_len) {
@@ -56,7 +56,7 @@
   return 0;
 }
 
-void grpc_slice_split(grpc_slice str, const char *sep, grpc_slice_buffer *dst) {
+void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst) {
   const size_t sep_len = strlen(sep);
   size_t begin, end;
 
@@ -74,7 +74,7 @@
   }
 }
 
-bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t *result) {
-  return gpr_parse_bytes_to_uint32((const char *)GRPC_SLICE_START_PTR(str),
+bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t* result) {
+  return gpr_parse_bytes_to_uint32((const char*)GRPC_SLICE_START_PTR(str),
                                    GRPC_SLICE_LENGTH(str), result) != 0;
 }
diff --git a/src/core/lib/slice/slice_string_helpers.h b/src/core/lib/slice/slice_string_helpers.h
index bcfb33b..acbc41e 100644
--- a/src/core/lib/slice/slice_string_helpers.h
+++ b/src/core/lib/slice/slice_string_helpers.h
@@ -33,13 +33,13 @@
 #endif
 
 /* Calls gpr_dump on a slice. */
-char *grpc_dump_slice(grpc_slice slice, uint32_t flags);
+char* grpc_dump_slice(grpc_slice slice, uint32_t flags);
 
 /** Split \a str by the separator \a sep. Results are stored in \a dst, which
  * should be a properly initialized instance. */
-void grpc_slice_split(grpc_slice str, const char *sep, grpc_slice_buffer *dst);
+void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst);
 
-bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t *result);
+bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t* result);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/support/alloc.cc b/src/core/lib/support/alloc.cc
index 886d69d..aef4cb8 100644
--- a/src/core/lib/support/alloc.cc
+++ b/src/core/lib/support/alloc.cc
@@ -24,10 +24,10 @@
 #include <string.h>
 #include "src/core/lib/profiling/timers.h"
 
-static void *zalloc_with_calloc(size_t sz) { return calloc(sz, 1); }
+static void* zalloc_with_calloc(size_t sz) { return calloc(sz, 1); }
 
-static void *zalloc_with_gpr_malloc(size_t sz) {
-  void *p = gpr_malloc(sz);
+static void* zalloc_with_gpr_malloc(size_t sz) {
+  void* p = gpr_malloc(sz);
   memset(p, 0, sz);
   return p;
 }
@@ -49,8 +49,8 @@
   g_alloc_functions = functions;
 }
 
-void *gpr_malloc(size_t size) {
-  void *p;
+void* gpr_malloc(size_t size) {
+  void* p;
   if (size == 0) return NULL;
   GPR_TIMER_BEGIN("gpr_malloc", 0);
   p = g_alloc_functions.malloc_fn(size);
@@ -61,8 +61,8 @@
   return p;
 }
 
-void *gpr_zalloc(size_t size) {
-  void *p;
+void* gpr_zalloc(size_t size) {
+  void* p;
   if (size == 0) return NULL;
   GPR_TIMER_BEGIN("gpr_zalloc", 0);
   p = g_alloc_functions.zalloc_fn(size);
@@ -73,13 +73,13 @@
   return p;
 }
 
-void gpr_free(void *p) {
+void gpr_free(void* p) {
   GPR_TIMER_BEGIN("gpr_free", 0);
   g_alloc_functions.free_fn(p);
   GPR_TIMER_END("gpr_free", 0);
 }
 
-void *gpr_realloc(void *p, size_t size) {
+void* gpr_realloc(void* p, size_t size) {
   if ((size == 0) && (p == NULL)) return NULL;
   GPR_TIMER_BEGIN("gpr_realloc", 0);
   p = g_alloc_functions.realloc_fn(p, size);
@@ -90,13 +90,13 @@
   return p;
 }
 
-void *gpr_malloc_aligned(size_t size, size_t alignment_log) {
+void* gpr_malloc_aligned(size_t size, size_t alignment_log) {
   size_t alignment = ((size_t)1) << alignment_log;
-  size_t extra = alignment - 1 + sizeof(void *);
-  void *p = gpr_malloc(size + extra);
-  void **ret = (void **)(((uintptr_t)p + extra) & ~(alignment - 1));
+  size_t extra = alignment - 1 + sizeof(void*);
+  void* p = gpr_malloc(size + extra);
+  void** ret = (void**)(((uintptr_t)p + extra) & ~(alignment - 1));
   ret[-1] = p;
-  return (void *)ret;
+  return (void*)ret;
 }
 
-void gpr_free_aligned(void *ptr) { gpr_free(((void **)ptr)[-1]); }
+void gpr_free_aligned(void* ptr) { gpr_free(((void**)ptr)[-1]); }
diff --git a/src/core/lib/support/arena.cc b/src/core/lib/support/arena.cc
index 9e0f73a..0b37a88 100644
--- a/src/core/lib/support/arena.cc
+++ b/src/core/lib/support/arena.cc
@@ -36,40 +36,40 @@
   zone initial_zone;
 };
 
-gpr_arena *gpr_arena_create(size_t initial_size) {
+gpr_arena* gpr_arena_create(size_t initial_size) {
   initial_size = ROUND_UP_TO_ALIGNMENT_SIZE(initial_size);
-  gpr_arena *a = (gpr_arena *)gpr_zalloc(sizeof(gpr_arena) + initial_size);
+  gpr_arena* a = (gpr_arena*)gpr_zalloc(sizeof(gpr_arena) + initial_size);
   a->initial_zone.size_end = initial_size;
   return a;
 }
 
-size_t gpr_arena_destroy(gpr_arena *arena) {
+size_t gpr_arena_destroy(gpr_arena* arena) {
   gpr_atm size = gpr_atm_no_barrier_load(&arena->size_so_far);
-  zone *z = (zone *)gpr_atm_no_barrier_load(&arena->initial_zone.next_atm);
+  zone* z = (zone*)gpr_atm_no_barrier_load(&arena->initial_zone.next_atm);
   gpr_free(arena);
   while (z) {
-    zone *next_z = (zone *)gpr_atm_no_barrier_load(&z->next_atm);
+    zone* next_z = (zone*)gpr_atm_no_barrier_load(&z->next_atm);
     gpr_free(z);
     z = next_z;
   }
   return (size_t)size;
 }
 
-void *gpr_arena_alloc(gpr_arena *arena, size_t size) {
+void* gpr_arena_alloc(gpr_arena* arena, size_t size) {
   size = ROUND_UP_TO_ALIGNMENT_SIZE(size);
   size_t start =
       (size_t)gpr_atm_no_barrier_fetch_add(&arena->size_so_far, size);
-  zone *z = &arena->initial_zone;
+  zone* z = &arena->initial_zone;
   while (start > z->size_end) {
-    zone *next_z = (zone *)gpr_atm_acq_load(&z->next_atm);
+    zone* next_z = (zone*)gpr_atm_acq_load(&z->next_atm);
     if (next_z == NULL) {
       size_t next_z_size = (size_t)gpr_atm_no_barrier_load(&arena->size_so_far);
-      next_z = (zone *)gpr_zalloc(sizeof(zone) + next_z_size);
+      next_z = (zone*)gpr_zalloc(sizeof(zone) + next_z_size);
       next_z->size_begin = z->size_end;
       next_z->size_end = z->size_end + next_z_size;
       if (!gpr_atm_rel_cas(&z->next_atm, (gpr_atm)NULL, (gpr_atm)next_z)) {
         gpr_free(next_z);
-        next_z = (zone *)gpr_atm_acq_load(&z->next_atm);
+        next_z = (zone*)gpr_atm_acq_load(&z->next_atm);
       }
     }
     z = next_z;
@@ -79,5 +79,5 @@
   }
   GPR_ASSERT(start >= z->size_begin);
   GPR_ASSERT(start + size <= z->size_end);
-  return ((char *)(z + 1)) + start - z->size_begin;
+  return ((char*)(z + 1)) + start - z->size_begin;
 }
diff --git a/src/core/lib/support/arena.h b/src/core/lib/support/arena.h
index 8a50786..4d43c56 100644
--- a/src/core/lib/support/arena.h
+++ b/src/core/lib/support/arena.h
@@ -34,11 +34,11 @@
 typedef struct gpr_arena gpr_arena;
 
 // Create an arena, with \a initial_size bytes in the first allocated buffer
-gpr_arena *gpr_arena_create(size_t initial_size);
+gpr_arena* gpr_arena_create(size_t initial_size);
 // Allocate \a size bytes from the arena
-void *gpr_arena_alloc(gpr_arena *arena, size_t size);
+void* gpr_arena_alloc(gpr_arena* arena, size_t size);
 // Destroy an arena, returning the total number of bytes allocated
-size_t gpr_arena_destroy(gpr_arena *arena);
+size_t gpr_arena_destroy(gpr_arena* arena);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/support/atm.cc b/src/core/lib/support/atm.cc
index 2f37d62..15bfe52 100644
--- a/src/core/lib/support/atm.cc
+++ b/src/core/lib/support/atm.cc
@@ -19,7 +19,7 @@
 #include <grpc/support/atm.h>
 #include <grpc/support/useful.h>
 
-gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm *value, gpr_atm delta,
+gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm* value, gpr_atm delta,
                                        gpr_atm min, gpr_atm max) {
   gpr_atm current_value;
   gpr_atm new_value;
diff --git a/src/core/lib/support/avl.cc b/src/core/lib/support/avl.cc
index 0e28b24..4ba101b 100644
--- a/src/core/lib/support/avl.cc
+++ b/src/core/lib/support/avl.cc
@@ -25,22 +25,22 @@
 #include <grpc/support/string_util.h>
 #include <grpc/support/useful.h>
 
-gpr_avl gpr_avl_create(const gpr_avl_vtable *vtable) {
+gpr_avl gpr_avl_create(const gpr_avl_vtable* vtable) {
   gpr_avl out;
   out.vtable = vtable;
   out.root = NULL;
   return out;
 }
 
-static gpr_avl_node *ref_node(gpr_avl_node *node) {
+static gpr_avl_node* ref_node(gpr_avl_node* node) {
   if (node) {
     gpr_ref(&node->refs);
   }
   return node;
 }
 
-static void unref_node(const gpr_avl_vtable *vtable, gpr_avl_node *node,
-                       void *user_data) {
+static void unref_node(const gpr_avl_vtable* vtable, gpr_avl_node* node,
+                       void* user_data) {
   if (node == NULL) {
     return;
   }
@@ -53,17 +53,18 @@
   }
 }
 
-static long node_height(gpr_avl_node *node) {
+static long node_height(gpr_avl_node* node) {
   return node == NULL ? 0 : node->height;
 }
 
 #ifndef NDEBUG
-static long calculate_height(gpr_avl_node *node) {
-  return node == NULL ? 0 : 1 + GPR_MAX(calculate_height(node->left),
-                                        calculate_height(node->right));
+static long calculate_height(gpr_avl_node* node) {
+  return node == NULL ? 0
+                      : 1 + GPR_MAX(calculate_height(node->left),
+                                    calculate_height(node->right));
 }
 
-static gpr_avl_node *assert_invariants(gpr_avl_node *n) {
+static gpr_avl_node* assert_invariants(gpr_avl_node* n) {
   if (n == NULL) return NULL;
   assert_invariants(n->left);
   assert_invariants(n->right);
@@ -72,12 +73,12 @@
   return n;
 }
 #else
-static gpr_avl_node *assert_invariants(gpr_avl_node *n) { return n; }
+static gpr_avl_node* assert_invariants(gpr_avl_node* n) { return n; }
 #endif
 
-gpr_avl_node *new_node(void *key, void *value, gpr_avl_node *left,
-                       gpr_avl_node *right) {
-  gpr_avl_node *node = (gpr_avl_node *)gpr_malloc(sizeof(*node));
+gpr_avl_node* new_node(void* key, void* value, gpr_avl_node* left,
+                       gpr_avl_node* right) {
+  gpr_avl_node* node = (gpr_avl_node*)gpr_malloc(sizeof(*node));
   gpr_ref_init(&node->refs, 1);
   node->key = key;
   node->value = value;
@@ -87,8 +88,8 @@
   return node;
 }
 
-static gpr_avl_node *get(const gpr_avl_vtable *vtable, gpr_avl_node *node,
-                         void *key, void *user_data) {
+static gpr_avl_node* get(const gpr_avl_vtable* vtable, gpr_avl_node* node,
+                         void* key, void* user_data) {
   long cmp;
 
   if (node == NULL) {
@@ -105,13 +106,13 @@
   }
 }
 
-void *gpr_avl_get(gpr_avl avl, void *key, void *user_data) {
-  gpr_avl_node *node = get(avl.vtable, avl.root, key, user_data);
+void* gpr_avl_get(gpr_avl avl, void* key, void* user_data) {
+  gpr_avl_node* node = get(avl.vtable, avl.root, key, user_data);
   return node ? node->value : NULL;
 }
 
-int gpr_avl_maybe_get(gpr_avl avl, void *key, void **value, void *user_data) {
-  gpr_avl_node *node = get(avl.vtable, avl.root, key, user_data);
+int gpr_avl_maybe_get(gpr_avl avl, void* key, void** value, void* user_data) {
+  gpr_avl_node* node = get(avl.vtable, avl.root, key, user_data);
   if (node != NULL) {
     *value = node->value;
     return 1;
@@ -119,10 +120,10 @@
   return 0;
 }
 
-static gpr_avl_node *rotate_left(const gpr_avl_vtable *vtable, void *key,
-                                 void *value, gpr_avl_node *left,
-                                 gpr_avl_node *right, void *user_data) {
-  gpr_avl_node *n = new_node(vtable->copy_key(right->key, user_data),
+static gpr_avl_node* rotate_left(const gpr_avl_vtable* vtable, void* key,
+                                 void* value, gpr_avl_node* left,
+                                 gpr_avl_node* right, void* user_data) {
+  gpr_avl_node* n = new_node(vtable->copy_key(right->key, user_data),
                              vtable->copy_value(right->value, user_data),
                              new_node(key, value, left, ref_node(right->left)),
                              ref_node(right->right));
@@ -130,10 +131,10 @@
   return n;
 }
 
-static gpr_avl_node *rotate_right(const gpr_avl_vtable *vtable, void *key,
-                                  void *value, gpr_avl_node *left,
-                                  gpr_avl_node *right, void *user_data) {
-  gpr_avl_node *n =
+static gpr_avl_node* rotate_right(const gpr_avl_vtable* vtable, void* key,
+                                  void* value, gpr_avl_node* left,
+                                  gpr_avl_node* right, void* user_data) {
+  gpr_avl_node* n =
       new_node(vtable->copy_key(left->key, user_data),
                vtable->copy_value(left->value, user_data), ref_node(left->left),
                new_node(key, value, ref_node(left->right), right));
@@ -141,11 +142,11 @@
   return n;
 }
 
-static gpr_avl_node *rotate_left_right(const gpr_avl_vtable *vtable, void *key,
-                                       void *value, gpr_avl_node *left,
-                                       gpr_avl_node *right, void *user_data) {
+static gpr_avl_node* rotate_left_right(const gpr_avl_vtable* vtable, void* key,
+                                       void* value, gpr_avl_node* left,
+                                       gpr_avl_node* right, void* user_data) {
   /* rotate_right(..., rotate_left(left), right) */
-  gpr_avl_node *n =
+  gpr_avl_node* n =
       new_node(vtable->copy_key(left->right->key, user_data),
                vtable->copy_value(left->right->value, user_data),
                new_node(vtable->copy_key(left->key, user_data),
@@ -156,11 +157,11 @@
   return n;
 }
 
-static gpr_avl_node *rotate_right_left(const gpr_avl_vtable *vtable, void *key,
-                                       void *value, gpr_avl_node *left,
-                                       gpr_avl_node *right, void *user_data) {
+static gpr_avl_node* rotate_right_left(const gpr_avl_vtable* vtable, void* key,
+                                       void* value, gpr_avl_node* left,
+                                       gpr_avl_node* right, void* user_data) {
   /* rotate_left(..., left, rotate_right(right)) */
-  gpr_avl_node *n =
+  gpr_avl_node* n =
       new_node(vtable->copy_key(right->left->key, user_data),
                vtable->copy_value(right->left->value, user_data),
                new_node(key, value, left, ref_node(right->left->left)),
@@ -171,9 +172,9 @@
   return n;
 }
 
-static gpr_avl_node *rebalance(const gpr_avl_vtable *vtable, void *key,
-                               void *value, gpr_avl_node *left,
-                               gpr_avl_node *right, void *user_data) {
+static gpr_avl_node* rebalance(const gpr_avl_vtable* vtable, void* key,
+                               void* value, gpr_avl_node* left,
+                               gpr_avl_node* right, void* user_data) {
   switch (node_height(left) - node_height(right)) {
     case 2:
       if (node_height(left->left) - node_height(left->right) == -1) {
@@ -196,8 +197,8 @@
   }
 }
 
-static gpr_avl_node *add_key(const gpr_avl_vtable *vtable, gpr_avl_node *node,
-                             void *key, void *value, void *user_data) {
+static gpr_avl_node* add_key(const gpr_avl_vtable* vtable, gpr_avl_node* node,
+                             void* key, void* value, void* user_data) {
   long cmp;
   if (node == NULL) {
     return new_node(key, value, NULL, NULL);
@@ -218,31 +219,31 @@
   }
 }
 
-gpr_avl gpr_avl_add(gpr_avl avl, void *key, void *value, void *user_data) {
-  gpr_avl_node *old_root = avl.root;
+gpr_avl gpr_avl_add(gpr_avl avl, void* key, void* value, void* user_data) {
+  gpr_avl_node* old_root = avl.root;
   avl.root = add_key(avl.vtable, avl.root, key, value, user_data);
   assert_invariants(avl.root);
   unref_node(avl.vtable, old_root, user_data);
   return avl;
 }
 
-static gpr_avl_node *in_order_head(gpr_avl_node *node) {
+static gpr_avl_node* in_order_head(gpr_avl_node* node) {
   while (node->left != NULL) {
     node = node->left;
   }
   return node;
 }
 
-static gpr_avl_node *in_order_tail(gpr_avl_node *node) {
+static gpr_avl_node* in_order_tail(gpr_avl_node* node) {
   while (node->right != NULL) {
     node = node->right;
   }
   return node;
 }
 
-static gpr_avl_node *remove_key(const gpr_avl_vtable *vtable,
-                                gpr_avl_node *node, void *key,
-                                void *user_data) {
+static gpr_avl_node* remove_key(const gpr_avl_vtable* vtable,
+                                gpr_avl_node* node, void* key,
+                                void* user_data) {
   long cmp;
   if (node == NULL) {
     return NULL;
@@ -254,13 +255,13 @@
     } else if (node->right == NULL) {
       return ref_node(node->left);
     } else if (node->left->height < node->right->height) {
-      gpr_avl_node *h = in_order_head(node->right);
+      gpr_avl_node* h = in_order_head(node->right);
       return rebalance(
           vtable, vtable->copy_key(h->key, user_data),
           vtable->copy_value(h->value, user_data), ref_node(node->left),
           remove_key(vtable, node->right, h->key, user_data), user_data);
     } else {
-      gpr_avl_node *h = in_order_tail(node->left);
+      gpr_avl_node* h = in_order_tail(node->left);
       return rebalance(vtable, vtable->copy_key(h->key, user_data),
                        vtable->copy_value(h->value, user_data),
                        remove_key(vtable, node->left, h->key, user_data),
@@ -279,20 +280,20 @@
   }
 }
 
-gpr_avl gpr_avl_remove(gpr_avl avl, void *key, void *user_data) {
-  gpr_avl_node *old_root = avl.root;
+gpr_avl gpr_avl_remove(gpr_avl avl, void* key, void* user_data) {
+  gpr_avl_node* old_root = avl.root;
   avl.root = remove_key(avl.vtable, avl.root, key, user_data);
   assert_invariants(avl.root);
   unref_node(avl.vtable, old_root, user_data);
   return avl;
 }
 
-gpr_avl gpr_avl_ref(gpr_avl avl, void *user_data) {
+gpr_avl gpr_avl_ref(gpr_avl avl, void* user_data) {
   ref_node(avl.root);
   return avl;
 }
 
-void gpr_avl_unref(gpr_avl avl, void *user_data) {
+void gpr_avl_unref(gpr_avl avl, void* user_data) {
   unref_node(avl.vtable, avl.root, user_data);
 }
 
diff --git a/src/core/lib/support/cmdline.cc b/src/core/lib/support/cmdline.cc
index 9fb80d4..d2785d2 100644
--- a/src/core/lib/support/cmdline.cc
+++ b/src/core/lib/support/cmdline.cc
@@ -30,33 +30,33 @@
 typedef enum { ARGTYPE_INT, ARGTYPE_BOOL, ARGTYPE_STRING } argtype;
 
 typedef struct arg {
-  const char *name;
-  const char *help;
+  const char* name;
+  const char* help;
   argtype type;
-  void *value;
-  struct arg *next;
+  void* value;
+  struct arg* next;
 } arg;
 
 struct gpr_cmdline {
-  const char *description;
-  arg *args;
-  const char *argv0;
+  const char* description;
+  arg* args;
+  const char* argv0;
 
-  const char *extra_arg_name;
-  const char *extra_arg_help;
-  void (*extra_arg)(void *user_data, const char *arg);
-  void *extra_arg_user_data;
+  const char* extra_arg_name;
+  const char* extra_arg_help;
+  void (*extra_arg)(void* user_data, const char* arg);
+  void* extra_arg_user_data;
 
-  int (*state)(gpr_cmdline *cl, char *arg);
-  arg *cur_arg;
+  int (*state)(gpr_cmdline* cl, char* arg);
+  arg* cur_arg;
 
   int survive_failure;
 };
 
-static int normal_state(gpr_cmdline *cl, char *arg);
+static int normal_state(gpr_cmdline* cl, char* arg);
 
-gpr_cmdline *gpr_cmdline_create(const char *description) {
-  gpr_cmdline *cl = (gpr_cmdline *)gpr_zalloc(sizeof(gpr_cmdline));
+gpr_cmdline* gpr_cmdline_create(const char* description) {
+  gpr_cmdline* cl = (gpr_cmdline*)gpr_zalloc(sizeof(gpr_cmdline));
 
   cl->description = description;
   cl->state = normal_state;
@@ -64,28 +64,28 @@
   return cl;
 }
 
-void gpr_cmdline_set_survive_failure(gpr_cmdline *cl) {
+void gpr_cmdline_set_survive_failure(gpr_cmdline* cl) {
   cl->survive_failure = 1;
 }
 
-void gpr_cmdline_destroy(gpr_cmdline *cl) {
+void gpr_cmdline_destroy(gpr_cmdline* cl) {
   while (cl->args) {
-    arg *a = cl->args;
+    arg* a = cl->args;
     cl->args = a->next;
     gpr_free(a);
   }
   gpr_free(cl);
 }
 
-static void add_arg(gpr_cmdline *cl, const char *name, const char *help,
-                    argtype type, void *value) {
-  arg *a;
+static void add_arg(gpr_cmdline* cl, const char* name, const char* help,
+                    argtype type, void* value) {
+  arg* a;
 
   for (a = cl->args; a; a = a->next) {
     GPR_ASSERT(0 != strcmp(a->name, name));
   }
 
-  a = (arg *)gpr_zalloc(sizeof(arg));
+  a = (arg*)gpr_zalloc(sizeof(arg));
   a->name = name;
   a->help = help;
   a->type = type;
@@ -94,24 +94,24 @@
   cl->args = a;
 }
 
-void gpr_cmdline_add_int(gpr_cmdline *cl, const char *name, const char *help,
-                         int *value) {
+void gpr_cmdline_add_int(gpr_cmdline* cl, const char* name, const char* help,
+                         int* value) {
   add_arg(cl, name, help, ARGTYPE_INT, value);
 }
 
-void gpr_cmdline_add_flag(gpr_cmdline *cl, const char *name, const char *help,
-                          int *value) {
+void gpr_cmdline_add_flag(gpr_cmdline* cl, const char* name, const char* help,
+                          int* value) {
   add_arg(cl, name, help, ARGTYPE_BOOL, value);
 }
 
-void gpr_cmdline_add_string(gpr_cmdline *cl, const char *name, const char *help,
-                            char **value) {
+void gpr_cmdline_add_string(gpr_cmdline* cl, const char* name, const char* help,
+                            const char** value) {
   add_arg(cl, name, help, ARGTYPE_STRING, value);
 }
 
 void gpr_cmdline_on_extra_arg(
-    gpr_cmdline *cl, const char *name, const char *help,
-    void (*on_extra_arg)(void *user_data, const char *arg), void *user_data) {
+    gpr_cmdline* cl, const char* name, const char* help,
+    void (*on_extra_arg)(void* user_data, const char* arg), void* user_data) {
   GPR_ASSERT(!cl->extra_arg);
   GPR_ASSERT(on_extra_arg);
 
@@ -124,8 +124,8 @@
 /* recursively descend argument list, adding the last element
    to s first - so that arguments are added in the order they were
    added to the list by api calls */
-static void add_args_to_usage(gpr_strvec *s, arg *a) {
-  char *tmp;
+static void add_args_to_usage(gpr_strvec* s, arg* a) {
+  char* tmp;
 
   if (!a) return;
   add_args_to_usage(s, a->next);
@@ -146,11 +146,11 @@
   }
 }
 
-char *gpr_cmdline_usage_string(gpr_cmdline *cl, const char *argv0) {
+char* gpr_cmdline_usage_string(gpr_cmdline* cl, const char* argv0) {
   /* TODO(ctiller): make this prettier */
   gpr_strvec s;
-  char *tmp;
-  const char *name = strrchr(argv0, '/');
+  char* tmp;
+  const char* name = strrchr(argv0, '/');
 
   if (name) {
     name++;
@@ -174,8 +174,8 @@
   return tmp;
 }
 
-static int print_usage_and_die(gpr_cmdline *cl) {
-  char *usage = gpr_cmdline_usage_string(cl, cl->argv0);
+static int print_usage_and_die(gpr_cmdline* cl) {
+  char* usage = gpr_cmdline_usage_string(cl, cl->argv0);
   fprintf(stderr, "%s", usage);
   gpr_free(usage);
   if (!cl->survive_failure) {
@@ -184,7 +184,7 @@
   return 0;
 }
 
-static int extra_state(gpr_cmdline *cl, char *str) {
+static int extra_state(gpr_cmdline* cl, char* str) {
   if (!cl->extra_arg) {
     return print_usage_and_die(cl);
   }
@@ -192,8 +192,8 @@
   return 1;
 }
 
-static arg *find_arg(gpr_cmdline *cl, char *name) {
-  arg *a;
+static arg* find_arg(gpr_cmdline* cl, char* name) {
+  arg* a;
 
   for (a = cl->args; a; a = a->next) {
     if (0 == strcmp(a->name, name)) {
@@ -209,9 +209,9 @@
   return a;
 }
 
-static int value_state(gpr_cmdline *cl, char *str) {
+static int value_state(gpr_cmdline* cl, char* str) {
   long intval;
-  char *end;
+  char* end;
 
   GPR_ASSERT(cl->cur_arg);
 
@@ -223,13 +223,13 @@
                 cl->cur_arg->name);
         return print_usage_and_die(cl);
       }
-      *(int *)cl->cur_arg->value = (int)intval;
+      *(int*)cl->cur_arg->value = (int)intval;
       break;
     case ARGTYPE_BOOL:
       if (0 == strcmp(str, "1") || 0 == strcmp(str, "true")) {
-        *(int *)cl->cur_arg->value = 1;
+        *(int*)cl->cur_arg->value = 1;
       } else if (0 == strcmp(str, "0") || 0 == strcmp(str, "false")) {
-        *(int *)cl->cur_arg->value = 0;
+        *(int*)cl->cur_arg->value = 0;
       } else {
         fprintf(stderr, "expected boolean, got '%s' for %s\n", str,
                 cl->cur_arg->name);
@@ -237,7 +237,7 @@
       }
       break;
     case ARGTYPE_STRING:
-      *(char **)cl->cur_arg->value = str;
+      *(char**)cl->cur_arg->value = str;
       break;
   }
 
@@ -245,10 +245,10 @@
   return 1;
 }
 
-static int normal_state(gpr_cmdline *cl, char *str) {
-  char *eq = NULL;
-  char *tmp = NULL;
-  char *arg_name = NULL;
+static int normal_state(gpr_cmdline* cl, char* str) {
+  char* eq = NULL;
+  char* tmp = NULL;
+  char* arg_name = NULL;
   int r = 1;
 
   if (0 == strcmp(str, "-help") || 0 == strcmp(str, "--help") ||
@@ -281,13 +281,13 @@
         fprintf(stderr, "%s is not a flag argument\n", str);
         return print_usage_and_die(cl);
       }
-      *(int *)cl->cur_arg->value = 0;
+      *(int*)cl->cur_arg->value = 0;
       return 1; /* early out */
     }
     eq = strchr(str, '=');
     if (eq != NULL) {
       /* copy the string into a temp buffer and extract the name */
-      tmp = arg_name = (char *)gpr_malloc((size_t)(eq - str + 1));
+      tmp = arg_name = (char*)gpr_malloc((size_t)(eq - str + 1));
       memcpy(arg_name, str, (size_t)(eq - str));
       arg_name[eq - str] = 0;
     } else {
@@ -305,7 +305,7 @@
       cl->state = value_state;
     } else {
       /* flag parameter: just set the value */
-      *(int *)cl->cur_arg->value = 1;
+      *(int*)cl->cur_arg->value = 1;
     }
   } else {
     r = extra_state(cl, str);
@@ -315,7 +315,7 @@
   return r;
 }
 
-int gpr_cmdline_parse(gpr_cmdline *cl, int argc, char **argv) {
+int gpr_cmdline_parse(gpr_cmdline* cl, int argc, char** argv) {
   int i;
 
   GPR_ASSERT(argc >= 1);
diff --git a/src/core/lib/support/env.h b/src/core/lib/support/env.h
index e2c012a..f50d7bc 100644
--- a/src/core/lib/support/env.h
+++ b/src/core/lib/support/env.h
@@ -31,16 +31,16 @@
    Returns a newly allocated string. It is the responsability of the caller to
    gpr_free the return value if not NULL (which means that the environment
    variable exists). */
-char *gpr_getenv(const char *name);
+char* gpr_getenv(const char* name);
 
 /* Sets the the environment with the specified name to the specified value. */
-void gpr_setenv(const char *name, const char *value);
+void gpr_setenv(const char* name, const char* value);
 
 /* This is a version of gpr_getenv that does not produce any output if it has to
    use an insecure version of the function. It is ONLY to be used to solve the
    problem in which we need to check an env variable to configure the verbosity
    level of logging. So DO NOT USE THIS. */
-const char *gpr_getenv_silent(const char *name, char **dst);
+const char* gpr_getenv_silent(const char* name, char** dst);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/support/env_linux.cc b/src/core/lib/support/env_linux.cc
index 4c45a97..012ef63 100644
--- a/src/core/lib/support/env_linux.cc
+++ b/src/core/lib/support/env_linux.cc
@@ -38,15 +38,15 @@
 
 #include "src/core/lib/support/string.h"
 
-const char *gpr_getenv_silent(const char *name, char **dst) {
-  const char *insecure_func_used = NULL;
-  char *result = NULL;
+const char* gpr_getenv_silent(const char* name, char** dst) {
+  const char* insecure_func_used = NULL;
+  char* result = NULL;
 #if defined(GPR_BACKWARDS_COMPATIBILITY_MODE)
-  typedef char *(*getenv_type)(const char *);
+  typedef char* (*getenv_type)(const char*);
   static getenv_type getenv_func = NULL;
   /* Check to see which getenv variant is supported (go from most
    * to least secure) */
-  const char *names[] = {"secure_getenv", "__secure_getenv", "getenv"};
+  const char* names[] = {"secure_getenv", "__secure_getenv", "getenv"};
   for (size_t i = 0; getenv_func == NULL && i < GPR_ARRAY_SIZE(names); i++) {
     getenv_func = (getenv_type)dlsym(RTLD_DEFAULT, names[i]);
     if (getenv_func != NULL && strstr(names[i], "secure") == NULL) {
@@ -64,9 +64,9 @@
   return insecure_func_used;
 }
 
-char *gpr_getenv(const char *name) {
-  char *result = NULL;
-  const char *insecure_func_used = gpr_getenv_silent(name, &result);
+char* gpr_getenv(const char* name) {
+  char* result = NULL;
+  const char* insecure_func_used = gpr_getenv_silent(name, &result);
   if (insecure_func_used != NULL) {
     gpr_log(GPR_DEBUG, "Warning: insecure environment read function '%s' used",
             insecure_func_used);
@@ -74,7 +74,7 @@
   return result;
 }
 
-void gpr_setenv(const char *name, const char *value) {
+void gpr_setenv(const char* name, const char* value) {
   int res = setenv(name, value, 1);
   GPR_ASSERT(res == 0);
 }
diff --git a/src/core/lib/support/env_posix.cc b/src/core/lib/support/env_posix.cc
index b88822c..7bea31c 100644
--- a/src/core/lib/support/env_posix.cc
+++ b/src/core/lib/support/env_posix.cc
@@ -29,17 +29,17 @@
 #include <grpc/support/string_util.h>
 #include "src/core/lib/support/string.h"
 
-const char *gpr_getenv_silent(const char *name, char **dst) {
+const char* gpr_getenv_silent(const char* name, char** dst) {
   *dst = gpr_getenv(name);
   return NULL;
 }
 
-char *gpr_getenv(const char *name) {
-  char *result = getenv(name);
+char* gpr_getenv(const char* name) {
+  char* result = getenv(name);
   return result == NULL ? result : gpr_strdup(result);
 }
 
-void gpr_setenv(const char *name, const char *value) {
+void gpr_setenv(const char* name, const char* value) {
   int res = setenv(name, value, 1);
   GPR_ASSERT(res == 0);
 }
diff --git a/src/core/lib/support/env_windows.cc b/src/core/lib/support/env_windows.cc
index c5a25dc..cdb1d58 100644
--- a/src/core/lib/support/env_windows.cc
+++ b/src/core/lib/support/env_windows.cc
@@ -30,13 +30,13 @@
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 
-const char *gpr_getenv_silent(const char *name, char **dst) {
+const char* gpr_getenv_silent(const char* name, char** dst) {
   *dst = gpr_getenv(name);
   return NULL;
 }
 
-char *gpr_getenv(const char *name) {
-  char *result = NULL;
+char* gpr_getenv(const char* name) {
+  char* result = NULL;
   DWORD size;
   LPTSTR tresult = NULL;
   LPTSTR tname = gpr_char_to_tchar(name);
@@ -60,7 +60,7 @@
   return result;
 }
 
-void gpr_setenv(const char *name, const char *value) {
+void gpr_setenv(const char* name, const char* value) {
   LPTSTR tname = gpr_char_to_tchar(name);
   LPTSTR tvalue = gpr_char_to_tchar(value);
   BOOL res = SetEnvironmentVariable(tname, tvalue);
diff --git a/src/core/lib/support/histogram.cc b/src/core/lib/support/histogram.cc
index 6d5ead9..73c821a 100644
--- a/src/core/lib/support/histogram.cc
+++ b/src/core/lib/support/histogram.cc
@@ -51,29 +51,29 @@
   /* number of buckets */
   size_t num_buckets;
   /* the buckets themselves */
-  uint32_t *buckets;
+  uint32_t* buckets;
 };
 
 /* determine a bucket index given a value - does no bounds checking */
-static size_t bucket_for_unchecked(gpr_histogram *h, double x) {
+static size_t bucket_for_unchecked(gpr_histogram* h, double x) {
   return (size_t)(log(x) * h->one_on_log_multiplier);
 }
 
 /* bounds checked version of the above */
-static size_t bucket_for(gpr_histogram *h, double x) {
+static size_t bucket_for(gpr_histogram* h, double x) {
   size_t bucket = bucket_for_unchecked(h, GPR_CLAMP(x, 1.0, h->max_possible));
   GPR_ASSERT(bucket < h->num_buckets);
   return bucket;
 }
 
 /* at what value does a bucket start? */
-static double bucket_start(gpr_histogram *h, double x) {
+static double bucket_start(gpr_histogram* h, double x) {
   return pow(h->multiplier, x);
 }
 
-gpr_histogram *gpr_histogram_create(double resolution,
+gpr_histogram* gpr_histogram_create(double resolution,
                                     double max_bucket_start) {
-  gpr_histogram *h = (gpr_histogram *)gpr_malloc(sizeof(gpr_histogram));
+  gpr_histogram* h = (gpr_histogram*)gpr_malloc(sizeof(gpr_histogram));
   GPR_ASSERT(resolution > 0.0);
   GPR_ASSERT(max_bucket_start > resolution);
   h->sum = 0.0;
@@ -87,16 +87,16 @@
   h->num_buckets = bucket_for_unchecked(h, max_bucket_start) + 1;
   GPR_ASSERT(h->num_buckets > 1);
   GPR_ASSERT(h->num_buckets < 100000000);
-  h->buckets = (uint32_t *)gpr_zalloc(sizeof(uint32_t) * h->num_buckets);
+  h->buckets = (uint32_t*)gpr_zalloc(sizeof(uint32_t) * h->num_buckets);
   return h;
 }
 
-void gpr_histogram_destroy(gpr_histogram *h) {
+void gpr_histogram_destroy(gpr_histogram* h) {
   gpr_free(h->buckets);
   gpr_free(h);
 }
 
-void gpr_histogram_add(gpr_histogram *h, double x) {
+void gpr_histogram_add(gpr_histogram* h, double x) {
   h->sum += x;
   h->sum_of_squares += x * x;
   h->count++;
@@ -109,7 +109,7 @@
   h->buckets[bucket_for(h, x)]++;
 }
 
-int gpr_histogram_merge(gpr_histogram *dst, const gpr_histogram *src) {
+int gpr_histogram_merge(gpr_histogram* dst, const gpr_histogram* src) {
   if ((dst->num_buckets != src->num_buckets) ||
       (dst->multiplier != src->multiplier)) {
     /* Fail because these histograms don't match */
@@ -121,7 +121,7 @@
   return 1;
 }
 
-void gpr_histogram_merge_contents(gpr_histogram *dst, const uint32_t *data,
+void gpr_histogram_merge_contents(gpr_histogram* dst, const uint32_t* data,
                                   size_t data_count, double min_seen,
                                   double max_seen, double sum,
                                   double sum_of_squares, double count) {
@@ -141,7 +141,7 @@
   }
 }
 
-static double threshold_for_count_below(gpr_histogram *h, double count_below) {
+static double threshold_for_count_below(gpr_histogram* h, double count_below) {
   double count_so_far;
   double lower_bound;
   double upper_bound;
@@ -183,46 +183,45 @@
        should lie */
     lower_bound = bucket_start(h, (double)lower_idx);
     upper_bound = bucket_start(h, (double)(lower_idx + 1));
-    return GPR_CLAMP(upper_bound -
-                         (upper_bound - lower_bound) *
-                             (count_so_far - count_below) /
-                             h->buckets[lower_idx],
+    return GPR_CLAMP(upper_bound - (upper_bound - lower_bound) *
+                                       (count_so_far - count_below) /
+                                       h->buckets[lower_idx],
                      h->min_seen, h->max_seen);
   }
 }
 
-double gpr_histogram_percentile(gpr_histogram *h, double percentile) {
+double gpr_histogram_percentile(gpr_histogram* h, double percentile) {
   return threshold_for_count_below(h, h->count * percentile / 100.0);
 }
 
-double gpr_histogram_mean(gpr_histogram *h) {
+double gpr_histogram_mean(gpr_histogram* h) {
   GPR_ASSERT(h->count != 0);
   return h->sum / h->count;
 }
 
-double gpr_histogram_stddev(gpr_histogram *h) {
+double gpr_histogram_stddev(gpr_histogram* h) {
   return sqrt(gpr_histogram_variance(h));
 }
 
-double gpr_histogram_variance(gpr_histogram *h) {
+double gpr_histogram_variance(gpr_histogram* h) {
   if (h->count == 0) return 0.0;
   return (h->sum_of_squares * h->count - h->sum * h->sum) /
          (h->count * h->count);
 }
 
-double gpr_histogram_maximum(gpr_histogram *h) { return h->max_seen; }
+double gpr_histogram_maximum(gpr_histogram* h) { return h->max_seen; }
 
-double gpr_histogram_minimum(gpr_histogram *h) { return h->min_seen; }
+double gpr_histogram_minimum(gpr_histogram* h) { return h->min_seen; }
 
-double gpr_histogram_count(gpr_histogram *h) { return h->count; }
+double gpr_histogram_count(gpr_histogram* h) { return h->count; }
 
-double gpr_histogram_sum(gpr_histogram *h) { return h->sum; }
+double gpr_histogram_sum(gpr_histogram* h) { return h->sum; }
 
-double gpr_histogram_sum_of_squares(gpr_histogram *h) {
+double gpr_histogram_sum_of_squares(gpr_histogram* h) {
   return h->sum_of_squares;
 }
 
-const uint32_t *gpr_histogram_get_contents(gpr_histogram *h, size_t *size) {
+const uint32_t* gpr_histogram_get_contents(gpr_histogram* h, size_t* size) {
   *size = h->num_buckets;
   return h->buckets;
 }
diff --git a/src/core/lib/support/host_port.cc b/src/core/lib/support/host_port.cc
index 3302e57..1927d55 100644
--- a/src/core/lib/support/host_port.cc
+++ b/src/core/lib/support/host_port.cc
@@ -25,7 +25,7 @@
 #include <grpc/support/string_util.h>
 #include "src/core/lib/support/string.h"
 
-int gpr_join_host_port(char **out, const char *host, int port) {
+int gpr_join_host_port(char** out, const char* host, int port) {
   if (host[0] != '[' && strchr(host, ':') != NULL) {
     /* IPv6 literals must be enclosed in brackets. */
     return gpr_asprintf(out, "[%s]:%d", host, port);
@@ -35,17 +35,17 @@
   }
 }
 
-int gpr_split_host_port(const char *name, char **host, char **port) {
-  const char *host_start;
+int gpr_split_host_port(const char* name, char** host, char** port) {
+  const char* host_start;
   size_t host_len;
-  const char *port_start;
+  const char* port_start;
 
   *host = NULL;
   *port = NULL;
 
   if (name[0] == '[') {
     /* Parse a bracketed host, typically an IPv6 literal. */
-    const char *rbracket = strchr(name, ']');
+    const char* rbracket = strchr(name, ']');
     if (rbracket == NULL) {
       /* Unmatched [ */
       return 0;
@@ -68,7 +68,7 @@
       return 0;
     }
   } else {
-    const char *colon = strchr(name, ':');
+    const char* colon = strchr(name, ':');
     if (colon != NULL && strchr(colon + 1, ':') == NULL) {
       /* Exactly 1 colon.  Split into host:port. */
       host_start = name;
@@ -83,7 +83,7 @@
   }
 
   /* Allocate return values. */
-  *host = (char *)gpr_malloc(host_len + 1);
+  *host = (char*)gpr_malloc(host_len + 1);
   memcpy(*host, host_start, host_len);
   (*host)[host_len] = '\0';
 
diff --git a/src/core/lib/support/log.cc b/src/core/lib/support/log.cc
index 69f92e0..2140e4b 100644
--- a/src/core/lib/support/log.cc
+++ b/src/core/lib/support/log.cc
@@ -27,11 +27,11 @@
 #include <stdio.h>
 #include <string.h>
 
-extern "C" void gpr_default_log(gpr_log_func_args *args);
+extern "C" void gpr_default_log(gpr_log_func_args* args);
 static gpr_atm g_log_func = (gpr_atm)gpr_default_log;
 static gpr_atm g_min_severity_to_print = GPR_LOG_VERBOSITY_UNSET;
 
-const char *gpr_log_severity_string(gpr_log_severity severity) {
+const char* gpr_log_severity_string(gpr_log_severity severity) {
   switch (severity) {
     case GPR_LOG_SEVERITY_DEBUG:
       return "D";
@@ -43,8 +43,8 @@
   GPR_UNREACHABLE_CODE(return "UNKNOWN");
 }
 
-void gpr_log_message(const char *file, int line, gpr_log_severity severity,
-                     const char *message) {
+void gpr_log_message(const char* file, int line, gpr_log_severity severity,
+                     const char* message) {
   if ((gpr_atm)severity < gpr_atm_no_barrier_load(&g_min_severity_to_print)) {
     return;
   }
@@ -64,8 +64,8 @@
 }
 
 void gpr_log_verbosity_init() {
-  char *verbosity = NULL;
-  const char *insecure_getenv = gpr_getenv_silent("GRPC_VERBOSITY", &verbosity);
+  char* verbosity = NULL;
+  const char* insecure_getenv = gpr_getenv_silent("GRPC_VERBOSITY", &verbosity);
 
   gpr_atm min_severity_to_print = GPR_LOG_SEVERITY_ERROR;
   if (verbosity != NULL) {
diff --git a/src/core/lib/support/log_android.cc b/src/core/lib/support/log_android.cc
index 9e8529c..73d24cd 100644
--- a/src/core/lib/support/log_android.cc
+++ b/src/core/lib/support/log_android.cc
@@ -39,9 +39,9 @@
   return ANDROID_LOG_DEFAULT;
 }
 
-extern "C" void gpr_log(const char *file, int line, gpr_log_severity severity,
-                        const char *format, ...) {
-  char *message = NULL;
+extern "C" void gpr_log(const char* file, int line, gpr_log_severity severity,
+                        const char* format, ...) {
+  char* message = NULL;
   va_list args;
   va_start(args, format);
   vasprintf(&message, format, args);
@@ -50,10 +50,10 @@
   free(message);
 }
 
-extern "C" void gpr_default_log(gpr_log_func_args *args) {
-  const char *final_slash;
-  const char *display_file;
-  char *output = NULL;
+extern "C" void gpr_default_log(gpr_log_func_args* args) {
+  const char* final_slash;
+  const char* display_file;
+  char* output = NULL;
 
   final_slash = strrchr(args->file, '/');
   if (final_slash == NULL)
diff --git a/src/core/lib/support/log_linux.cc b/src/core/lib/support/log_linux.cc
index 0914ace..e9be970 100644
--- a/src/core/lib/support/log_linux.cc
+++ b/src/core/lib/support/log_linux.cc
@@ -41,9 +41,9 @@
 
 static long gettid(void) { return syscall(__NR_gettid); }
 
-void gpr_log(const char *file, int line, gpr_log_severity severity,
-             const char *format, ...) {
-  char *message = NULL;
+void gpr_log(const char* file, int line, gpr_log_severity severity,
+             const char* format, ...) {
+  char* message = NULL;
   va_list args;
   va_start(args, format);
   if (vasprintf(&message, format, args) == -1) {
@@ -56,10 +56,10 @@
   free(message);
 }
 
-extern "C" void gpr_default_log(gpr_log_func_args *args) {
-  const char *final_slash;
-  char *prefix;
-  const char *display_file;
+extern "C" void gpr_default_log(gpr_log_func_args* args) {
+  const char* final_slash;
+  char* prefix;
+  const char* display_file;
   char time_buffer[64];
   time_t timer;
   gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
diff --git a/src/core/lib/support/log_posix.cc b/src/core/lib/support/log_posix.cc
index 29530c8..e765f91 100644
--- a/src/core/lib/support/log_posix.cc
+++ b/src/core/lib/support/log_posix.cc
@@ -27,17 +27,16 @@
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
-#include <stdio.h>
 #include <string.h>
 #include <time.h>
 
 static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
 
-void gpr_log(const char *file, int line, gpr_log_severity severity,
-             const char *format, ...) {
+void gpr_log(const char* file, int line, gpr_log_severity severity,
+             const char* format, ...) {
   char buf[64];
-  char *allocated = NULL;
-  char *message = NULL;
+  char* allocated = NULL;
+  char* message = NULL;
   int ret;
   va_list args;
   va_start(args, format);
@@ -48,7 +47,7 @@
   } else if ((size_t)ret <= sizeof(buf) - 1) {
     message = buf;
   } else {
-    message = allocated = (char *)gpr_malloc((size_t)ret + 1);
+    message = allocated = (char*)gpr_malloc((size_t)ret + 1);
     va_start(args, format);
     vsnprintf(message, (size_t)(ret + 1), format, args);
     va_end(args);
@@ -57,9 +56,9 @@
   gpr_free(allocated);
 }
 
-extern "C" void gpr_default_log(gpr_log_func_args *args) {
-  const char *final_slash;
-  const char *display_file;
+extern "C" void gpr_default_log(gpr_log_func_args* args) {
+  const char* final_slash;
+  const char* display_file;
   char time_buffer[64];
   time_t timer;
   gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
@@ -79,7 +78,7 @@
     strcpy(time_buffer, "error:strftime");
   }
 
-  char *prefix;
+  char* prefix;
   gpr_asprintf(&prefix, "%s%s.%09d %7tu %s:%d]",
                gpr_log_severity_string(args->severity), time_buffer,
                (int)(now.tv_nsec), gettid(), display_file, args->line);
diff --git a/src/core/lib/support/log_windows.cc b/src/core/lib/support/log_windows.cc
index ee52abe..d448179 100644
--- a/src/core/lib/support/log_windows.cc
+++ b/src/core/lib/support/log_windows.cc
@@ -32,9 +32,9 @@
 #include "src/core/lib/support/string.h"
 #include "src/core/lib/support/string_windows.h"
 
-void gpr_log(const char *file, int line, gpr_log_severity severity,
-             const char *format, ...) {
-  char *message = NULL;
+void gpr_log(const char* file, int line, gpr_log_severity severity,
+             const char* format, ...) {
+  char* message = NULL;
   va_list args;
   int ret;
 
@@ -47,7 +47,7 @@
   } else {
     /* Allocate a new buffer, with space for the NUL terminator. */
     size_t strp_buflen = (size_t)ret + 1;
-    message = (char *)gpr_malloc(strp_buflen);
+    message = (char*)gpr_malloc(strp_buflen);
 
     /* Print to the buffer. */
     va_start(args, format);
@@ -65,9 +65,9 @@
 }
 
 /* Simple starter implementation */
-extern "C" void gpr_default_log(gpr_log_func_args *args) {
-  const char *final_slash;
-  const char *display_file;
+extern "C" void gpr_default_log(gpr_log_func_args* args) {
+  const char* final_slash;
+  const char* display_file;
   char time_buffer[64];
   time_t timer;
   gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
diff --git a/src/core/lib/support/mpscq.cc b/src/core/lib/support/mpscq.cc
index e9f8939..b270777 100644
--- a/src/core/lib/support/mpscq.cc
+++ b/src/core/lib/support/mpscq.cc
@@ -20,32 +20,33 @@
 
 #include <grpc/support/log.h>
 
-void gpr_mpscq_init(gpr_mpscq *q) {
+void gpr_mpscq_init(gpr_mpscq* q) {
   gpr_atm_no_barrier_store(&q->head, (gpr_atm)&q->stub);
   q->tail = &q->stub;
   gpr_atm_no_barrier_store(&q->stub.next, (gpr_atm)NULL);
 }
 
-void gpr_mpscq_destroy(gpr_mpscq *q) {
+void gpr_mpscq_destroy(gpr_mpscq* q) {
   GPR_ASSERT(gpr_atm_no_barrier_load(&q->head) == (gpr_atm)&q->stub);
   GPR_ASSERT(q->tail == &q->stub);
 }
 
-void gpr_mpscq_push(gpr_mpscq *q, gpr_mpscq_node *n) {
+bool gpr_mpscq_push(gpr_mpscq* q, gpr_mpscq_node* n) {
   gpr_atm_no_barrier_store(&n->next, (gpr_atm)NULL);
-  gpr_mpscq_node *prev =
-      (gpr_mpscq_node *)gpr_atm_full_xchg(&q->head, (gpr_atm)n);
+  gpr_mpscq_node* prev =
+      (gpr_mpscq_node*)gpr_atm_full_xchg(&q->head, (gpr_atm)n);
   gpr_atm_rel_store(&prev->next, (gpr_atm)n);
+  return prev == &q->stub;
 }
 
-gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q) {
+gpr_mpscq_node* gpr_mpscq_pop(gpr_mpscq* q) {
   bool empty;
   return gpr_mpscq_pop_and_check_end(q, &empty);
 }
 
-gpr_mpscq_node *gpr_mpscq_pop_and_check_end(gpr_mpscq *q, bool *empty) {
-  gpr_mpscq_node *tail = q->tail;
-  gpr_mpscq_node *next = (gpr_mpscq_node *)gpr_atm_acq_load(&tail->next);
+gpr_mpscq_node* gpr_mpscq_pop_and_check_end(gpr_mpscq* q, bool* empty) {
+  gpr_mpscq_node* tail = q->tail;
+  gpr_mpscq_node* next = (gpr_mpscq_node*)gpr_atm_acq_load(&tail->next);
   if (tail == &q->stub) {
     // indicates the list is actually (ephemerally) empty
     if (next == NULL) {
@@ -54,21 +55,21 @@
     }
     q->tail = next;
     tail = next;
-    next = (gpr_mpscq_node *)gpr_atm_acq_load(&tail->next);
+    next = (gpr_mpscq_node*)gpr_atm_acq_load(&tail->next);
   }
   if (next != NULL) {
     *empty = false;
     q->tail = next;
     return tail;
   }
-  gpr_mpscq_node *head = (gpr_mpscq_node *)gpr_atm_acq_load(&q->head);
+  gpr_mpscq_node* head = (gpr_mpscq_node*)gpr_atm_acq_load(&q->head);
   if (tail != head) {
     *empty = false;
     // indicates a retry is in order: we're still adding
     return NULL;
   }
   gpr_mpscq_push(q, &q->stub);
-  next = (gpr_mpscq_node *)gpr_atm_acq_load(&tail->next);
+  next = (gpr_mpscq_node*)gpr_atm_acq_load(&tail->next);
   if (next != NULL) {
     q->tail = next;
     return tail;
@@ -77,3 +78,37 @@
   *empty = false;
   return NULL;
 }
+
+void gpr_locked_mpscq_init(gpr_locked_mpscq* q) {
+  gpr_mpscq_init(&q->queue);
+  gpr_mu_init(&q->mu);
+}
+
+void gpr_locked_mpscq_destroy(gpr_locked_mpscq* q) {
+  gpr_mpscq_destroy(&q->queue);
+  gpr_mu_destroy(&q->mu);
+}
+
+bool gpr_locked_mpscq_push(gpr_locked_mpscq* q, gpr_mpscq_node* n) {
+  return gpr_mpscq_push(&q->queue, n);
+}
+
+gpr_mpscq_node* gpr_locked_mpscq_try_pop(gpr_locked_mpscq* q) {
+  if (gpr_mu_trylock(&q->mu)) {
+    gpr_mpscq_node* n = gpr_mpscq_pop(&q->queue);
+    gpr_mu_unlock(&q->mu);
+    return n;
+  }
+  return NULL;
+}
+
+gpr_mpscq_node* gpr_locked_mpscq_pop(gpr_locked_mpscq* q) {
+  gpr_mu_lock(&q->mu);
+  bool empty = false;
+  gpr_mpscq_node* n;
+  do {
+    n = gpr_mpscq_pop_and_check_end(&q->queue, &empty);
+  } while (n == NULL && !empty);
+  gpr_mu_unlock(&q->mu);
+  return n;
+}
diff --git a/src/core/lib/support/mpscq.h b/src/core/lib/support/mpscq.h
index ca63a04..fb22742 100644
--- a/src/core/lib/support/mpscq.h
+++ b/src/core/lib/support/mpscq.h
@@ -20,6 +20,7 @@
 #define GRPC_CORE_LIB_SUPPORT_MPSCQ_H
 
 #include <grpc/support/atm.h>
+#include <grpc/support/sync.h>
 #include <stdbool.h>
 #include <stddef.h>
 
@@ -33,27 +34,56 @@
 
 // List node (include this in a data structure at the top, and add application
 // fields after it - to simulate inheritance)
-typedef struct gpr_mpscq_node { gpr_atm next; } gpr_mpscq_node;
+typedef struct gpr_mpscq_node {
+  gpr_atm next;
+} gpr_mpscq_node;
 
 // Actual queue type
 typedef struct gpr_mpscq {
   gpr_atm head;
   // make sure head & tail don't share a cacheline
   char padding[GPR_CACHELINE_SIZE];
-  gpr_mpscq_node *tail;
+  gpr_mpscq_node* tail;
   gpr_mpscq_node stub;
 } gpr_mpscq;
 
-void gpr_mpscq_init(gpr_mpscq *q);
-void gpr_mpscq_destroy(gpr_mpscq *q);
+void gpr_mpscq_init(gpr_mpscq* q);
+void gpr_mpscq_destroy(gpr_mpscq* q);
 // Push a node
-void gpr_mpscq_push(gpr_mpscq *q, gpr_mpscq_node *n);
+// Thread safe - can be called from multiple threads concurrently
+// Returns true if this was possibly the first node (may return true
+// sporadically, will not return false sporadically)
+bool gpr_mpscq_push(gpr_mpscq* q, gpr_mpscq_node* n);
 // Pop a node (returns NULL if no node is ready - which doesn't indicate that
 // the queue is empty!!)
-gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q);
+// Thread compatible - can only be called from one thread at a time
+gpr_mpscq_node* gpr_mpscq_pop(gpr_mpscq* q);
 // Pop a node; sets *empty to true if the queue is empty, or false if it is not
-gpr_mpscq_node *gpr_mpscq_pop_and_check_end(gpr_mpscq *q, bool *empty);
+gpr_mpscq_node* gpr_mpscq_pop_and_check_end(gpr_mpscq* q, bool* empty);
 
+// An mpscq with a lock: it's safe to pop from multiple threads, but doing
+// only one thread will succeed concurrently
+typedef struct gpr_locked_mpscq {
+  gpr_mpscq queue;
+  gpr_mu mu;
+} gpr_locked_mpscq;
+
+void gpr_locked_mpscq_init(gpr_locked_mpscq* q);
+void gpr_locked_mpscq_destroy(gpr_locked_mpscq* q);
+// Push a node
+// Thread safe - can be called from multiple threads concurrently
+// Returns true if this was possibly the first node (may return true
+// sporadically, will not return false sporadically)
+bool gpr_locked_mpscq_push(gpr_locked_mpscq* q, gpr_mpscq_node* n);
+
+// Pop a node (returns NULL if no node is ready - which doesn't indicate that
+// the queue is empty!!)
+// Thread safe - can be called from multiple threads concurrently
+gpr_mpscq_node* gpr_locked_mpscq_try_pop(gpr_locked_mpscq* q);
+
+// Pop a node.  Returns NULL only if the queue was empty at some point after
+// calling this function
+gpr_mpscq_node* gpr_locked_mpscq_pop(gpr_locked_mpscq* q);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/core/lib/support/murmur_hash.cc b/src/core/lib/support/murmur_hash.cc
index f06b970..4e08579 100644
--- a/src/core/lib/support/murmur_hash.cc
+++ b/src/core/lib/support/murmur_hash.cc
@@ -29,8 +29,8 @@
   (h) *= 0xc2b2ae35; \
   (h) ^= (h) >> 16;
 
-uint32_t gpr_murmur_hash3(const void *key, size_t len, uint32_t seed) {
-  const uint8_t *data = (const uint8_t *)key;
+uint32_t gpr_murmur_hash3(const void* key, size_t len, uint32_t seed) {
+  const uint8_t* data = (const uint8_t*)key;
   const size_t nblocks = len / 4;
   int i;
 
@@ -40,8 +40,8 @@
   const uint32_t c1 = 0xcc9e2d51;
   const uint32_t c2 = 0x1b873593;
 
-  const uint32_t *blocks = ((const uint32_t *)key) + nblocks;
-  const uint8_t *tail = (const uint8_t *)(data + nblocks * 4);
+  const uint32_t* blocks = ((const uint32_t*)key) + nblocks;
+  const uint8_t* tail = (const uint8_t*)(data + nblocks * 4);
 
   /* body */
   for (i = -(int)nblocks; i; i++) {
diff --git a/src/core/lib/support/murmur_hash.h b/src/core/lib/support/murmur_hash.h
index a4c642e..d02bba6 100644
--- a/src/core/lib/support/murmur_hash.h
+++ b/src/core/lib/support/murmur_hash.h
@@ -28,7 +28,7 @@
 #endif
 
 /* compute the hash of key (length len) */
-uint32_t gpr_murmur_hash3(const void *key, size_t len, uint32_t seed);
+uint32_t gpr_murmur_hash3(const void* key, size_t len, uint32_t seed);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/support/spinlock.h b/src/core/lib/support/spinlock.h
index 47584f6..8b43964 100644
--- a/src/core/lib/support/spinlock.h
+++ b/src/core/lib/support/spinlock.h
@@ -23,7 +23,9 @@
 
 /* Simple spinlock. No backoff strategy, gpr_spinlock_lock is almost always
    a concurrency code smell. */
-typedef struct { gpr_atm atm; } gpr_spinlock;
+typedef struct {
+  gpr_atm atm;
+} gpr_spinlock;
 
 #ifdef __cplusplus
 #define GPR_SPINLOCK_INITIALIZER (gpr_spinlock{0})
diff --git a/src/core/lib/support/stack_lockfree.cc b/src/core/lib/support/stack_lockfree.cc
index 0fb64ed..7a4ede3 100644
--- a/src/core/lib/support/stack_lockfree.cc
+++ b/src/core/lib/support/stack_lockfree.cc
@@ -55,18 +55,18 @@
 #define INVALID_ENTRY_INDEX ((1 << 16) - 1)
 
 struct gpr_stack_lockfree {
-  lockfree_node *entries;
+  lockfree_node* entries;
   lockfree_node head; /* An atomic entry describing curr head */
 };
 
-gpr_stack_lockfree *gpr_stack_lockfree_create(size_t entries) {
-  gpr_stack_lockfree *stack;
-  stack = (gpr_stack_lockfree *)gpr_malloc(sizeof(*stack));
+gpr_stack_lockfree* gpr_stack_lockfree_create(size_t entries) {
+  gpr_stack_lockfree* stack;
+  stack = (gpr_stack_lockfree*)gpr_malloc(sizeof(*stack));
   /* Since we only allocate 16 bits to represent an entry number,
    * make sure that we are within the desired range */
   /* Reserve the highest entry number as a dummy */
   GPR_ASSERT(entries < INVALID_ENTRY_INDEX);
-  stack->entries = (lockfree_node *)gpr_malloc_aligned(
+  stack->entries = (lockfree_node*)gpr_malloc_aligned(
       entries * sizeof(stack->entries[0]), ENTRY_ALIGNMENT_BITS);
   /* Clear out all entries */
   memset(stack->entries, 0, entries * sizeof(stack->entries[0]));
@@ -84,12 +84,12 @@
   return stack;
 }
 
-void gpr_stack_lockfree_destroy(gpr_stack_lockfree *stack) {
+void gpr_stack_lockfree_destroy(gpr_stack_lockfree* stack) {
   gpr_free_aligned(stack->entries);
   gpr_free(stack);
 }
 
-int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) {
+int gpr_stack_lockfree_push(gpr_stack_lockfree* stack, int entry) {
   lockfree_node head;
   lockfree_node newhead;
   lockfree_node curent;
@@ -119,7 +119,7 @@
   return head.contents.index == INVALID_ENTRY_INDEX;
 }
 
-int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack) {
+int gpr_stack_lockfree_pop(gpr_stack_lockfree* stack) {
   lockfree_node head;
   lockfree_node newhead;
 
diff --git a/src/core/lib/support/stack_lockfree.h b/src/core/lib/support/stack_lockfree.h
index 706f63f..337ecc2 100644
--- a/src/core/lib/support/stack_lockfree.h
+++ b/src/core/lib/support/stack_lockfree.h
@@ -29,15 +29,15 @@
 
 /* This stack must specify the maximum number of entries to track.
    The current implementation only allows up to 65534 entries */
-gpr_stack_lockfree *gpr_stack_lockfree_create(size_t entries);
-void gpr_stack_lockfree_destroy(gpr_stack_lockfree *stack);
+gpr_stack_lockfree* gpr_stack_lockfree_create(size_t entries);
+void gpr_stack_lockfree_destroy(gpr_stack_lockfree* stack);
 
 /* Pass in a valid entry number for the next stack entry */
 /* Returns 1 if this is the first element on the stack, 0 otherwise */
-int gpr_stack_lockfree_push(gpr_stack_lockfree *, int entry);
+int gpr_stack_lockfree_push(gpr_stack_lockfree*, int entry);
 
 /* Returns -1 on empty or the actual entry number */
-int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack);
+int gpr_stack_lockfree_pop(gpr_stack_lockfree* stack);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/support/string.cc b/src/core/lib/support/string.cc
index d558638..6dc4fbc 100644
--- a/src/core/lib/support/string.cc
+++ b/src/core/lib/support/string.cc
@@ -30,8 +30,8 @@
 #include <grpc/support/string_util.h>
 #include <grpc/support/useful.h>
 
-char *gpr_strdup(const char *src) {
-  char *dst;
+char* gpr_strdup(const char* src) {
+  char* dst;
   size_t len;
 
   if (!src) {
@@ -39,7 +39,7 @@
   }
 
   len = strlen(src) + 1;
-  dst = (char *)gpr_malloc(len);
+  dst = (char*)gpr_malloc(len);
 
   memcpy(dst, src, len);
 
@@ -49,7 +49,7 @@
 typedef struct {
   size_t capacity;
   size_t length;
-  char *data;
+  char* data;
 } dump_out;
 
 static dump_out dump_out_create(void) {
@@ -57,20 +57,20 @@
   return r;
 }
 
-static void dump_out_append(dump_out *out, char c) {
+static void dump_out_append(dump_out* out, char c) {
   if (out->length == out->capacity) {
     out->capacity = GPR_MAX(8, 2 * out->capacity);
-    out->data = (char *)gpr_realloc(out->data, out->capacity);
+    out->data = (char*)gpr_realloc(out->data, out->capacity);
   }
   out->data[out->length++] = c;
 }
 
-static void hexdump(dump_out *out, const char *buf, size_t len) {
-  static const char *hex = "0123456789abcdef";
+static void hexdump(dump_out* out, const char* buf, size_t len) {
+  static const char* hex = "0123456789abcdef";
 
-  const uint8_t *const beg = (const uint8_t *)buf;
-  const uint8_t *const end = beg + len;
-  const uint8_t *cur;
+  const uint8_t* const beg = (const uint8_t*)buf;
+  const uint8_t* const end = beg + len;
+  const uint8_t* cur;
 
   for (cur = beg; cur != end; ++cur) {
     if (cur != beg) dump_out_append(out, ' ');
@@ -79,24 +79,24 @@
   }
 }
 
-static void asciidump(dump_out *out, const char *buf, size_t len) {
-  const uint8_t *const beg = (const uint8_t *)buf;
-  const uint8_t *const end = beg + len;
-  const uint8_t *cur;
+static void asciidump(dump_out* out, const char* buf, size_t len) {
+  const uint8_t* const beg = (const uint8_t*)buf;
+  const uint8_t* const end = beg + len;
+  const uint8_t* cur;
   int out_was_empty = (out->length == 0);
   if (!out_was_empty) {
     dump_out_append(out, ' ');
     dump_out_append(out, '\'');
   }
   for (cur = beg; cur != end; ++cur) {
-    dump_out_append(out, (char)(isprint(*cur) ? *(char *)cur : '.'));
+    dump_out_append(out, (char)(isprint(*cur) ? *(char*)cur : '.'));
   }
   if (!out_was_empty) {
     dump_out_append(out, '\'');
   }
 }
 
-char *gpr_dump(const char *buf, size_t len, uint32_t flags) {
+char* gpr_dump(const char* buf, size_t len, uint32_t flags) {
   dump_out out = dump_out_create();
   if (flags & GPR_DUMP_HEX) {
     hexdump(&out, buf, len);
@@ -108,7 +108,7 @@
   return out.data;
 }
 
-int gpr_parse_bytes_to_uint32(const char *buf, size_t len, uint32_t *result) {
+int gpr_parse_bytes_to_uint32(const char* buf, size_t len, uint32_t* result) {
   uint32_t out = 0;
   uint32_t new_val;
   size_t i;
@@ -126,7 +126,7 @@
   return 1;
 }
 
-void gpr_reverse_bytes(char *str, int len) {
+void gpr_reverse_bytes(char* str, int len) {
   char *p1, *p2;
   for (p1 = str, p2 = str + len - 1; p2 > p1; ++p1, --p2) {
     char temp = *p1;
@@ -135,7 +135,7 @@
   }
 }
 
-int gpr_ltoa(long value, char *string) {
+int gpr_ltoa(long value, char* string) {
   long sign;
   int i = 0;
 
@@ -156,7 +156,7 @@
   return i;
 }
 
-int int64_ttoa(int64_t value, char *string) {
+int int64_ttoa(int64_t value, char* string) {
   int64_t sign;
   int i = 0;
 
@@ -177,33 +177,33 @@
   return i;
 }
 
-int gpr_parse_nonnegative_int(const char *value) {
-  char *end;
+int gpr_parse_nonnegative_int(const char* value) {
+  char* end;
   long result = strtol(value, &end, 0);
   if (*end != '\0' || result < 0 || result > INT_MAX) return -1;
   return (int)result;
 }
 
-char *gpr_leftpad(const char *str, char flag, size_t length) {
+char* gpr_leftpad(const char* str, char flag, size_t length) {
   const size_t str_length = strlen(str);
   const size_t out_length = str_length > length ? str_length : length;
-  char *out = (char *)gpr_malloc(out_length + 1);
+  char* out = (char*)gpr_malloc(out_length + 1);
   memset(out, flag, out_length - str_length);
   memcpy(out + out_length - str_length, str, str_length);
   out[out_length] = 0;
   return out;
 }
 
-char *gpr_strjoin(const char **strs, size_t nstrs, size_t *final_length) {
+char* gpr_strjoin(const char** strs, size_t nstrs, size_t* final_length) {
   return gpr_strjoin_sep(strs, nstrs, "", final_length);
 }
 
-char *gpr_strjoin_sep(const char **strs, size_t nstrs, const char *sep,
-                      size_t *final_length) {
+char* gpr_strjoin_sep(const char** strs, size_t nstrs, const char* sep,
+                      size_t* final_length) {
   const size_t sep_len = strlen(sep);
   size_t out_length = 0;
   size_t i;
-  char *out;
+  char* out;
   for (i = 0; i < nstrs; i++) {
     out_length += strlen(strs[i]);
   }
@@ -211,7 +211,7 @@
   if (nstrs > 0) {
     out_length += sep_len * (nstrs - 1); /* separators */
   }
-  out = (char *)gpr_malloc(out_length);
+  out = (char*)gpr_malloc(out_length);
   out_length = 0;
   for (i = 0; i < nstrs; i++) {
     const size_t slen = strlen(strs[i]);
@@ -229,9 +229,9 @@
   return out;
 }
 
-void gpr_strvec_init(gpr_strvec *sv) { memset(sv, 0, sizeof(*sv)); }
+void gpr_strvec_init(gpr_strvec* sv) { memset(sv, 0, sizeof(*sv)); }
 
-void gpr_strvec_destroy(gpr_strvec *sv) {
+void gpr_strvec_destroy(gpr_strvec* sv) {
   size_t i;
   for (i = 0; i < sv->count; i++) {
     gpr_free(sv->strs[i]);
@@ -239,19 +239,19 @@
   gpr_free(sv->strs);
 }
 
-void gpr_strvec_add(gpr_strvec *sv, char *str) {
+void gpr_strvec_add(gpr_strvec* sv, char* str) {
   if (sv->count == sv->capacity) {
     sv->capacity = GPR_MAX(sv->capacity + 8, sv->capacity * 2);
-    sv->strs = (char **)gpr_realloc(sv->strs, sizeof(char *) * sv->capacity);
+    sv->strs = (char**)gpr_realloc(sv->strs, sizeof(char*) * sv->capacity);
   }
   sv->strs[sv->count++] = str;
 }
 
-char *gpr_strvec_flatten(gpr_strvec *sv, size_t *final_length) {
-  return gpr_strjoin((const char **)sv->strs, sv->count, final_length);
+char* gpr_strvec_flatten(gpr_strvec* sv, size_t* final_length) {
+  return gpr_strjoin((const char**)sv->strs, sv->count, final_length);
 }
 
-int gpr_stricmp(const char *a, const char *b) {
+int gpr_stricmp(const char* a, const char* b) {
   int ca, cb;
   do {
     ca = tolower(*a);
@@ -262,22 +262,22 @@
   return ca - cb;
 }
 
-static void add_string_to_split(const char *beg, const char *end, char ***strs,
-                                size_t *nstrs, size_t *capstrs) {
-  char *out = (char *)gpr_malloc((size_t)(end - beg) + 1);
+static void add_string_to_split(const char* beg, const char* end, char*** strs,
+                                size_t* nstrs, size_t* capstrs) {
+  char* out = (char*)gpr_malloc((size_t)(end - beg) + 1);
   memcpy(out, beg, (size_t)(end - beg));
   out[end - beg] = 0;
   if (*nstrs == *capstrs) {
     *capstrs = GPR_MAX(8, 2 * *capstrs);
-    *strs = (char **)gpr_realloc(*strs, sizeof(*strs) * *capstrs);
+    *strs = (char**)gpr_realloc(*strs, sizeof(*strs) * *capstrs);
   }
   (*strs)[*nstrs] = out;
   ++*nstrs;
 }
 
-void gpr_string_split(const char *input, const char *sep, char ***strs,
-                      size_t *nstrs) {
-  const char *next;
+void gpr_string_split(const char* input, const char* sep, char*** strs,
+                      size_t* nstrs) {
+  const char* next;
   *strs = NULL;
   *nstrs = 0;
   size_t capstrs = 0;
@@ -288,9 +288,9 @@
   add_string_to_split(input, input + strlen(input), strs, nstrs, &capstrs);
 }
 
-void *gpr_memrchr(const void *s, int c, size_t n) {
+void* gpr_memrchr(const void* s, int c, size_t n) {
   if (s == NULL) return NULL;
-  char *b = (char *)s;
+  char* b = (char*)s;
   size_t i;
   for (i = 0; i < n; i++) {
     if (b[n - i - 1] == c) {
@@ -300,12 +300,12 @@
   return NULL;
 }
 
-bool gpr_is_true(const char *s) {
+bool gpr_is_true(const char* s) {
   size_t i;
   if (s == NULL) {
     return false;
   }
-  static const char *truthy[] = {"yes", "true", "1"};
+  static const char* truthy[] = {"yes", "true", "1"};
   for (i = 0; i < GPR_ARRAY_SIZE(truthy); i++) {
     if (0 == gpr_stricmp(s, truthy[i])) {
       return true;
diff --git a/src/core/lib/support/string.h b/src/core/lib/support/string.h
index 5a56fa3..0b18ffc 100644
--- a/src/core/lib/support/string.h
+++ b/src/core/lib/support/string.h
@@ -36,12 +36,12 @@
 
 /* Converts array buf, of length len, into a C string  according to the flags.
    Result should be freed with gpr_free() */
-char *gpr_dump(const char *buf, size_t len, uint32_t flags);
+char* gpr_dump(const char* buf, size_t len, uint32_t flags);
 
 /* Parses an array of bytes into an integer (base 10). Returns 1 on success,
    0 on failure. */
-int gpr_parse_bytes_to_uint32(const char *data, size_t length,
-                              uint32_t *result);
+int gpr_parse_bytes_to_uint32(const char* data, size_t length,
+                              uint32_t* result);
 
 /* Minimum buffer size for calling ltoa */
 #define GPR_LTOA_MIN_BUFSIZE (3 * sizeof(long))
@@ -49,7 +49,7 @@
 /* Convert a long to a string in base 10; returns the length of the
    output string (or 0 on failure).
    output must be at least GPR_LTOA_MIN_BUFSIZE bytes long. */
-int gpr_ltoa(long value, char *output);
+int gpr_ltoa(long value, char* output);
 
 /* Minimum buffer size for calling int64toa */
 #define GPR_INT64TOA_MIN_BUFSIZE (3 * sizeof(int64_t))
@@ -59,56 +59,56 @@
 output must be at least GPR_INT64TOA_MIN_BUFSIZE bytes long.
 NOTE: This function ensures sufficient bit width even on Win x64,
 where long is 32bit is size.*/
-int int64_ttoa(int64_t value, char *output);
+int int64_ttoa(int64_t value, char* output);
 
 // Parses a non-negative number from a value string.  Returns -1 on error.
-int gpr_parse_nonnegative_int(const char *value);
+int gpr_parse_nonnegative_int(const char* value);
 
 /* Reverse a run of bytes */
-void gpr_reverse_bytes(char *str, int len);
+void gpr_reverse_bytes(char* str, int len);
 
 /* Pad a string with flag characters. The given length specifies the minimum
    field width. The input string is never truncated. */
-char *gpr_leftpad(const char *str, char flag, size_t length);
+char* gpr_leftpad(const char* str, char flag, size_t length);
 
 /* Join a set of strings, returning the resulting string.
    Total combined length (excluding null terminator) is returned in total_length
    if it is non-null. */
-char *gpr_strjoin(const char **strs, size_t nstrs, size_t *total_length);
+char* gpr_strjoin(const char** strs, size_t nstrs, size_t* total_length);
 
 /* Join a set of strings using a separator, returning the resulting string.
    Total combined length (excluding null terminator) is returned in total_length
    if it is non-null. */
-char *gpr_strjoin_sep(const char **strs, size_t nstrs, const char *sep,
-                      size_t *total_length);
+char* gpr_strjoin_sep(const char** strs, size_t nstrs, const char* sep,
+                      size_t* total_length);
 
-void gpr_string_split(const char *input, const char *sep, char ***strs,
-                      size_t *nstrs);
+void gpr_string_split(const char* input, const char* sep, char*** strs,
+                      size_t* nstrs);
 
 /* A vector of strings... for building up a final string one piece at a time */
 typedef struct {
-  char **strs;
+  char** strs;
   size_t count;
   size_t capacity;
 } gpr_strvec;
 
 /* Initialize/destroy */
-void gpr_strvec_init(gpr_strvec *strs);
-void gpr_strvec_destroy(gpr_strvec *strs);
+void gpr_strvec_init(gpr_strvec* strs);
+void gpr_strvec_destroy(gpr_strvec* strs);
 /* Add a string to a strvec, takes ownership of the string */
-void gpr_strvec_add(gpr_strvec *strs, char *add);
+void gpr_strvec_add(gpr_strvec* strs, char* add);
 /* Return a joined string with all added substrings, optionally setting
    total_length as per gpr_strjoin */
-char *gpr_strvec_flatten(gpr_strvec *strs, size_t *total_length);
+char* gpr_strvec_flatten(gpr_strvec* strs, size_t* total_length);
 
 /** Case insensitive string comparison... return <0 if lower(a)<lower(b), ==0 if
     lower(a)==lower(b), >0 if lower(a)>lower(b) */
-int gpr_stricmp(const char *a, const char *b);
+int gpr_stricmp(const char* a, const char* b);
 
-void *gpr_memrchr(const void *s, int c, size_t n);
+void* gpr_memrchr(const void* s, int c, size_t n);
 
 /** Return true if lower(s) equals "true", "yes" or "1", otherwise false. */
-bool gpr_is_true(const char *s);
+bool gpr_is_true(const char* s);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/core/lib/support/string_posix.cc b/src/core/lib/support/string_posix.cc
index 92de21a..79c8165 100644
--- a/src/core/lib/support/string_posix.cc
+++ b/src/core/lib/support/string_posix.cc
@@ -27,7 +27,7 @@
 #include <grpc/support/alloc.h>
 #include <grpc/support/string_util.h>
 
-int gpr_asprintf(char **strp, const char *format, ...) {
+int gpr_asprintf(char** strp, const char* format, ...) {
   va_list args;
   int ret;
   char buf[64];
@@ -44,7 +44,7 @@
 
   /* Allocate a new buffer, with space for the NUL terminator. */
   strp_buflen = (size_t)ret + 1;
-  if ((*strp = (char *)gpr_malloc(strp_buflen)) == NULL) {
+  if ((*strp = (char*)gpr_malloc(strp_buflen)) == NULL) {
     /* This shouldn't happen, because gpr_malloc() calls abort(). */
     return -1;
   }
diff --git a/src/core/lib/support/string_util_windows.cc b/src/core/lib/support/string_util_windows.cc
index b365512..e2b386b 100644
--- a/src/core/lib/support/string_util_windows.cc
+++ b/src/core/lib/support/string_util_windows.cc
@@ -65,9 +65,9 @@
 LPTSTR gpr_char_to_tchar(LPCTSTR input) { return (LPTSTR)gpr_strdup(input); }
 #endif
 
-char *gpr_format_message(int messageid) {
+char* gpr_format_message(int messageid) {
   LPTSTR tmessage;
-  char *message;
+  char* message;
   DWORD status = FormatMessage(
       FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
           FORMAT_MESSAGE_IGNORE_INSERTS,
diff --git a/src/core/lib/support/string_windows.cc b/src/core/lib/support/string_windows.cc
index d37863c..ceb78f0 100644
--- a/src/core/lib/support/string_windows.cc
+++ b/src/core/lib/support/string_windows.cc
@@ -31,7 +31,7 @@
 
 #include "src/core/lib/support/string.h"
 
-int gpr_asprintf(char **strp, const char *format, ...) {
+int gpr_asprintf(char** strp, const char* format, ...) {
   va_list args;
   int ret;
   size_t strp_buflen;
@@ -47,7 +47,7 @@
 
   /* Allocate a new buffer, with space for the NUL terminator. */
   strp_buflen = (size_t)ret + 1;
-  if ((*strp = (char *)gpr_malloc(strp_buflen)) == NULL) {
+  if ((*strp = (char*)gpr_malloc(strp_buflen)) == NULL) {
     /* This shouldn't happen, because gpr_malloc() calls abort(). */
     return -1;
   }
diff --git a/src/core/lib/support/subprocess_posix.cc b/src/core/lib/support/subprocess_posix.cc
index af75162..4d6972a 100644
--- a/src/core/lib/support/subprocess_posix.cc
+++ b/src/core/lib/support/subprocess_posix.cc
@@ -41,19 +41,19 @@
   bool joined;
 };
 
-const char *gpr_subprocess_binary_extension() { return ""; }
+const char* gpr_subprocess_binary_extension() { return ""; }
 
-gpr_subprocess *gpr_subprocess_create(int argc, const char **argv) {
-  gpr_subprocess *r;
+gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) {
+  gpr_subprocess* r;
   int pid;
-  char **exec_args;
+  char** exec_args;
 
   pid = fork();
   if (pid == -1) {
     return NULL;
   } else if (pid == 0) {
-    exec_args = (char **)gpr_malloc(((size_t)argc + 1) * sizeof(char *));
-    memcpy(exec_args, argv, (size_t)argc * sizeof(char *));
+    exec_args = (char**)gpr_malloc(((size_t)argc + 1) * sizeof(char*));
+    memcpy(exec_args, argv, (size_t)argc * sizeof(char*));
     exec_args[argc] = NULL;
     execv(exec_args[0], exec_args);
     /* if we reach here, an error has occurred */
@@ -61,13 +61,13 @@
     _exit(1);
     return NULL;
   } else {
-    r = (gpr_subprocess *)gpr_zalloc(sizeof(gpr_subprocess));
+    r = (gpr_subprocess*)gpr_zalloc(sizeof(gpr_subprocess));
     r->pid = pid;
     return r;
   }
 }
 
-void gpr_subprocess_destroy(gpr_subprocess *p) {
+void gpr_subprocess_destroy(gpr_subprocess* p) {
   if (!p->joined) {
     kill(p->pid, SIGKILL);
     gpr_subprocess_join(p);
@@ -75,7 +75,7 @@
   gpr_free(p);
 }
 
-int gpr_subprocess_join(gpr_subprocess *p) {
+int gpr_subprocess_join(gpr_subprocess* p) {
   int status;
 retry:
   if (waitpid(p->pid, &status, 0) == -1) {
@@ -90,7 +90,7 @@
   return status;
 }
 
-void gpr_subprocess_interrupt(gpr_subprocess *p) {
+void gpr_subprocess_interrupt(gpr_subprocess* p) {
   if (!p->joined) {
     kill(p->pid, SIGINT);
   }
diff --git a/src/core/lib/support/subprocess_windows.cc b/src/core/lib/support/subprocess_windows.cc
index 6769f1d..dcdafb5 100644
--- a/src/core/lib/support/subprocess_windows.cc
+++ b/src/core/lib/support/subprocess_windows.cc
@@ -36,16 +36,16 @@
   int interrupted;
 };
 
-const char *gpr_subprocess_binary_extension() { return ".exe"; }
+const char* gpr_subprocess_binary_extension() { return ".exe"; }
 
-gpr_subprocess *gpr_subprocess_create(int argc, const char **argv) {
-  gpr_subprocess *r;
+gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) {
+  gpr_subprocess* r;
 
   STARTUPINFO si;
   PROCESS_INFORMATION pi;
 
-  char *args = gpr_strjoin_sep(argv, (size_t)argc, " ", NULL);
-  TCHAR *args_tchar;
+  char* args = gpr_strjoin_sep(argv, (size_t)argc, " ", NULL);
+  TCHAR* args_tchar;
 
   args_tchar = gpr_char_to_tchar(args);
   gpr_free(args);
@@ -61,13 +61,13 @@
   }
   gpr_free(args_tchar);
 
-  r = (gpr_subprocess *)gpr_malloc(sizeof(gpr_subprocess));
+  r = (gpr_subprocess*)gpr_malloc(sizeof(gpr_subprocess));
   memset(r, 0, sizeof(*r));
   r->pi = pi;
   return r;
 }
 
-void gpr_subprocess_destroy(gpr_subprocess *p) {
+void gpr_subprocess_destroy(gpr_subprocess* p) {
   if (p) {
     if (!p->joined) {
       gpr_subprocess_interrupt(p);
@@ -83,7 +83,7 @@
   }
 }
 
-int gpr_subprocess_join(gpr_subprocess *p) {
+int gpr_subprocess_join(gpr_subprocess* p) {
   DWORD dwExitCode;
   if (GetExitCodeProcess(p->pi.hProcess, &dwExitCode)) {
     if (dwExitCode == STILL_ACTIVE) {
@@ -110,7 +110,7 @@
   }
 }
 
-void gpr_subprocess_interrupt(gpr_subprocess *p) {
+void gpr_subprocess_interrupt(gpr_subprocess* p) {
   DWORD dwExitCode;
   if (GetExitCodeProcess(p->pi.hProcess, &dwExitCode)) {
     if (dwExitCode == STILL_ACTIVE) {
diff --git a/src/core/lib/support/sync.cc b/src/core/lib/support/sync.cc
index 994dcb0..1c051a1 100644
--- a/src/core/lib/support/sync.cc
+++ b/src/core/lib/support/sync.cc
@@ -45,17 +45,17 @@
 }
 
 /* Hash ev into an element of sync_array[]. */
-static struct sync_array_s *hash(gpr_event *ev) {
+static struct sync_array_s* hash(gpr_event* ev) {
   return &sync_array[((uintptr_t)ev) % event_sync_partitions];
 }
 
-void gpr_event_init(gpr_event *ev) {
+void gpr_event_init(gpr_event* ev) {
   gpr_once_init(&event_once, &event_initialize);
   ev->state = 0;
 }
 
-void gpr_event_set(gpr_event *ev, void *value) {
-  struct sync_array_s *s = hash(ev);
+void gpr_event_set(gpr_event* ev, void* value) {
+  struct sync_array_s* s = hash(ev);
   gpr_mu_lock(&s->mu);
   GPR_ASSERT(gpr_atm_acq_load(&ev->state) == 0);
   gpr_atm_rel_store(&ev->state, (gpr_atm)value);
@@ -64,28 +64,28 @@
   GPR_ASSERT(value != NULL);
 }
 
-void *gpr_event_get(gpr_event *ev) {
-  return (void *)gpr_atm_acq_load(&ev->state);
+void* gpr_event_get(gpr_event* ev) {
+  return (void*)gpr_atm_acq_load(&ev->state);
 }
 
-void *gpr_event_wait(gpr_event *ev, gpr_timespec abs_deadline) {
-  void *result = (void *)gpr_atm_acq_load(&ev->state);
+void* gpr_event_wait(gpr_event* ev, gpr_timespec abs_deadline) {
+  void* result = (void*)gpr_atm_acq_load(&ev->state);
   if (result == NULL) {
-    struct sync_array_s *s = hash(ev);
+    struct sync_array_s* s = hash(ev);
     gpr_mu_lock(&s->mu);
     do {
-      result = (void *)gpr_atm_acq_load(&ev->state);
+      result = (void*)gpr_atm_acq_load(&ev->state);
     } while (result == NULL && !gpr_cv_wait(&s->cv, &s->mu, abs_deadline));
     gpr_mu_unlock(&s->mu);
   }
   return result;
 }
 
-void gpr_ref_init(gpr_refcount *r, int n) { gpr_atm_rel_store(&r->count, n); }
+void gpr_ref_init(gpr_refcount* r, int n) { gpr_atm_rel_store(&r->count, n); }
 
-void gpr_ref(gpr_refcount *r) { gpr_atm_no_barrier_fetch_add(&r->count, 1); }
+void gpr_ref(gpr_refcount* r) { gpr_atm_no_barrier_fetch_add(&r->count, 1); }
 
-void gpr_ref_non_zero(gpr_refcount *r) {
+void gpr_ref_non_zero(gpr_refcount* r) {
 #ifndef NDEBUG
   gpr_atm prior = gpr_atm_no_barrier_fetch_add(&r->count, 1);
   assert(prior > 0);
@@ -94,29 +94,29 @@
 #endif
 }
 
-void gpr_refn(gpr_refcount *r, int n) {
+void gpr_refn(gpr_refcount* r, int n) {
   gpr_atm_no_barrier_fetch_add(&r->count, n);
 }
 
-int gpr_unref(gpr_refcount *r) {
+int gpr_unref(gpr_refcount* r) {
   gpr_atm prior = gpr_atm_full_fetch_add(&r->count, -1);
   GPR_ASSERT(prior > 0);
   return prior == 1;
 }
 
-int gpr_ref_is_unique(gpr_refcount *r) {
+int gpr_ref_is_unique(gpr_refcount* r) {
   return gpr_atm_acq_load(&r->count) == 1;
 }
 
-void gpr_stats_init(gpr_stats_counter *c, intptr_t n) {
+void gpr_stats_init(gpr_stats_counter* c, intptr_t n) {
   gpr_atm_rel_store(&c->value, n);
 }
 
-void gpr_stats_inc(gpr_stats_counter *c, intptr_t inc) {
+void gpr_stats_inc(gpr_stats_counter* c, intptr_t inc) {
   gpr_atm_no_barrier_fetch_add(&c->value, inc);
 }
 
-intptr_t gpr_stats_read(const gpr_stats_counter *c) {
+intptr_t gpr_stats_read(const gpr_stats_counter* c) {
   /* don't need acquire-load, but we have no no-barrier load yet */
   return gpr_atm_acq_load(&c->value);
 }
diff --git a/src/core/lib/support/sync_windows.cc b/src/core/lib/support/sync_windows.cc
index 62fdd40..7cd4163 100644
--- a/src/core/lib/support/sync_windows.cc
+++ b/src/core/lib/support/sync_windows.cc
@@ -26,25 +26,25 @@
 #include <grpc/support/sync.h>
 #include <grpc/support/time.h>
 
-void gpr_mu_init(gpr_mu *mu) {
+void gpr_mu_init(gpr_mu* mu) {
   InitializeCriticalSection(&mu->cs);
   mu->locked = 0;
 }
 
-void gpr_mu_destroy(gpr_mu *mu) { DeleteCriticalSection(&mu->cs); }
+void gpr_mu_destroy(gpr_mu* mu) { DeleteCriticalSection(&mu->cs); }
 
-void gpr_mu_lock(gpr_mu *mu) {
+void gpr_mu_lock(gpr_mu* mu) {
   EnterCriticalSection(&mu->cs);
   GPR_ASSERT(!mu->locked);
   mu->locked = 1;
 }
 
-void gpr_mu_unlock(gpr_mu *mu) {
+void gpr_mu_unlock(gpr_mu* mu) {
   mu->locked = 0;
   LeaveCriticalSection(&mu->cs);
 }
 
-int gpr_mu_trylock(gpr_mu *mu) {
+int gpr_mu_trylock(gpr_mu* mu) {
   int result = TryEnterCriticalSection(&mu->cs);
   if (result) {
     if (mu->locked) {                /* This thread already holds the lock. */
@@ -58,13 +58,13 @@
 
 /*----------------------------------------*/
 
-void gpr_cv_init(gpr_cv *cv) { InitializeConditionVariable(cv); }
+void gpr_cv_init(gpr_cv* cv) { InitializeConditionVariable(cv); }
 
-void gpr_cv_destroy(gpr_cv *cv) {
+void gpr_cv_destroy(gpr_cv* cv) {
   /* Condition variables don't need destruction in Win32. */
 }
 
-int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline) {
+int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline) {
   int timeout = 0;
   DWORD timeout_max_ms;
   mu->locked = 0;
@@ -93,23 +93,23 @@
   return timeout;
 }
 
-void gpr_cv_signal(gpr_cv *cv) { WakeConditionVariable(cv); }
+void gpr_cv_signal(gpr_cv* cv) { WakeConditionVariable(cv); }
 
-void gpr_cv_broadcast(gpr_cv *cv) { WakeAllConditionVariable(cv); }
+void gpr_cv_broadcast(gpr_cv* cv) { WakeAllConditionVariable(cv); }
 
 /*----------------------------------------*/
 
-static void *dummy;
+static void* dummy;
 struct run_once_func_arg {
   void (*init_function)(void);
 };
-static BOOL CALLBACK run_once_func(gpr_once *once, void *v, void **pv) {
-  struct run_once_func_arg *arg = (struct run_once_func_arg *)v;
+static BOOL CALLBACK run_once_func(gpr_once* once, void* v, void** pv) {
+  struct run_once_func_arg* arg = (struct run_once_func_arg*)v;
   (*arg->init_function)();
   return 1;
 }
 
-void gpr_once_init(gpr_once *once, void (*init_function)(void)) {
+void gpr_once_init(gpr_once* once, void (*init_function)(void)) {
   struct run_once_func_arg arg;
   arg.init_function = init_function;
   InitOnceExecuteOnce(once, run_once_func, &arg, &dummy);
diff --git a/src/core/lib/support/thd_posix.cc b/src/core/lib/support/thd_posix.cc
index 98afd10..297714e 100644
--- a/src/core/lib/support/thd_posix.cc
+++ b/src/core/lib/support/thd_posix.cc
@@ -31,26 +31,26 @@
 #include <string.h>
 
 struct thd_arg {
-  void (*body)(void *arg); /* body of a thread */
-  void *arg;               /* argument to a thread */
+  void (*body)(void* arg); /* body of a thread */
+  void* arg;               /* argument to a thread */
 };
 
 /* Body of every thread started via gpr_thd_new. */
-static void *thread_body(void *v) {
-  struct thd_arg a = *(struct thd_arg *)v;
+static void* thread_body(void* v) {
+  struct thd_arg a = *(struct thd_arg*)v;
   free(v);
   (*a.body)(a.arg);
   return NULL;
 }
 
-int gpr_thd_new(gpr_thd_id *t, void (*thd_body)(void *arg), void *arg,
-                const gpr_thd_options *options) {
+int gpr_thd_new(gpr_thd_id* t, void (*thd_body)(void* arg), void* arg,
+                const gpr_thd_options* options) {
   int thread_started;
   pthread_attr_t attr;
   pthread_t p;
   /* don't use gpr_malloc as we may cause an infinite recursion with
    * the profiling code */
-  struct thd_arg *a = (struct thd_arg *)malloc(sizeof(*a));
+  struct thd_arg* a = (struct thd_arg*)malloc(sizeof(*a));
   GPR_ASSERT(a != NULL);
   a->body = thd_body;
   a->arg = arg;
diff --git a/src/core/lib/support/thd_windows.cc b/src/core/lib/support/thd_windows.cc
index 1a82805..5bda7f4 100644
--- a/src/core/lib/support/thd_windows.cc
+++ b/src/core/lib/support/thd_windows.cc
@@ -36,23 +36,23 @@
 #endif
 
 struct thd_info {
-  void (*body)(void *arg); /* body of a thread */
-  void *arg;               /* argument to a thread */
+  void (*body)(void* arg); /* body of a thread */
+  void* arg;               /* argument to a thread */
   HANDLE join_event;       /* if joinable, the join event */
   int joinable;            /* true if not detached */
 };
 
-static thread_local struct thd_info *g_thd_info;
+static thread_local struct thd_info* g_thd_info;
 
 /* Destroys a thread info */
-static void destroy_thread(struct thd_info *t) {
+static void destroy_thread(struct thd_info* t) {
   if (t->joinable) CloseHandle(t->join_event);
   gpr_free(t);
 }
 
 /* Body of every thread started via gpr_thd_new. */
-static DWORD WINAPI thread_body(void *v) {
-  g_thd_info = (struct thd_info *)v;
+static DWORD WINAPI thread_body(void* v) {
+  g_thd_info = (struct thd_info*)v;
   g_thd_info->body(g_thd_info->arg);
   if (g_thd_info->joinable) {
     BOOL ret = SetEvent(g_thd_info->join_event);
@@ -63,10 +63,10 @@
   return 0;
 }
 
-int gpr_thd_new(gpr_thd_id *t, void (*thd_body)(void *arg), void *arg,
-                const gpr_thd_options *options) {
+int gpr_thd_new(gpr_thd_id* t, void (*thd_body)(void* arg), void* arg,
+                const gpr_thd_options* options) {
   HANDLE handle;
-  struct thd_info *info = (struct thd_info *)gpr_malloc(sizeof(*info));
+  struct thd_info* info = (struct thd_info*)gpr_malloc(sizeof(*info));
   info->body = thd_body;
   info->arg = arg;
   *t = 0;
@@ -93,7 +93,7 @@
 gpr_thd_id gpr_thd_currentid(void) { return (gpr_thd_id)g_thd_info; }
 
 void gpr_thd_join(gpr_thd_id t) {
-  struct thd_info *info = (struct thd_info *)t;
+  struct thd_info* info = (struct thd_info*)t;
   DWORD ret = WaitForSingleObject(info->join_event, INFINITE);
   GPR_ASSERT(ret == WAIT_OBJECT_0);
   destroy_thread(info);
diff --git a/src/core/lib/support/time_posix.cc b/src/core/lib/support/time_posix.cc
index 3f8a909..3674ef7 100644
--- a/src/core/lib/support/time_posix.cc
+++ b/src/core/lib/support/time_posix.cc
@@ -81,7 +81,7 @@
   }
 }
 #else
-/* For some reason Apple's OSes haven't implemented clock_gettime. */
+  /* For some reason Apple's OSes haven't implemented clock_gettime. */
 
 #include <mach/mach.h>
 #include <mach/mach_time.h>
diff --git a/src/core/lib/support/time_precise.cc b/src/core/lib/support/time_precise.cc
index 05ef7c5..b7372df 100644
--- a/src/core/lib/support/time_precise.cc
+++ b/src/core/lib/support/time_precise.cc
@@ -24,7 +24,7 @@
 
 #ifdef GRPC_TIMERS_RDTSC
 #if defined(__i386__)
-static void gpr_get_cycle_counter(int64_t int *clk) {
+static void gpr_get_cycle_counter(int64_t int* clk) {
   int64_t int ret;
   __asm__ volatile("rdtsc" : "=A"(ret));
   *clk = ret;
@@ -32,7 +32,7 @@
 
 // ----------------------------------------------------------------
 #elif defined(__x86_64__) || defined(__amd64__)
-static void gpr_get_cycle_counter(int64_t *clk) {
+static void gpr_get_cycle_counter(int64_t* clk) {
   uint64_t low, high;
   __asm__ volatile("rdtsc" : "=a"(low), "=d"(high));
   *clk = (int64_t)(high << 32) | (int64_t)low;
@@ -56,7 +56,7 @@
   gpr_log(GPR_DEBUG, "... cycles_per_second = %f\n", cycles_per_second);
 }
 
-void gpr_precise_clock_now(gpr_timespec *clk) {
+void gpr_precise_clock_now(gpr_timespec* clk) {
   int64_t counter;
   double secs;
   gpr_get_cycle_counter(&counter);
@@ -69,7 +69,7 @@
 #else  /* GRPC_TIMERS_RDTSC */
 void gpr_precise_clock_init(void) {}
 
-void gpr_precise_clock_now(gpr_timespec *clk) {
+void gpr_precise_clock_now(gpr_timespec* clk) {
   *clk = gpr_now(GPR_CLOCK_REALTIME);
   clk->clock_type = GPR_CLOCK_PRECISE;
 }
diff --git a/src/core/lib/support/time_precise.h b/src/core/lib/support/time_precise.h
index cb15cdf..3befda3 100644
--- a/src/core/lib/support/time_precise.h
+++ b/src/core/lib/support/time_precise.h
@@ -26,7 +26,7 @@
 #endif
 
 void gpr_precise_clock_init(void);
-void gpr_precise_clock_now(gpr_timespec *clk);
+void gpr_precise_clock_now(gpr_timespec* clk);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/support/tls_pthread.cc b/src/core/lib/support/tls_pthread.cc
index 9ebee57..ebeef2a 100644
--- a/src/core/lib/support/tls_pthread.cc
+++ b/src/core/lib/support/tls_pthread.cc
@@ -22,8 +22,8 @@
 
 #include <grpc/support/tls.h>
 
-intptr_t gpr_tls_set(struct gpr_pthread_thread_local *tls, intptr_t value) {
-  GPR_ASSERT(0 == pthread_setspecific(tls->key, (void *)value));
+intptr_t gpr_tls_set(struct gpr_pthread_thread_local* tls, intptr_t value) {
+  GPR_ASSERT(0 == pthread_setspecific(tls->key, (void*)value));
   return value;
 }
 
diff --git a/src/core/lib/support/tmpfile.h b/src/core/lib/support/tmpfile.h
index caa1d0f..437d871 100644
--- a/src/core/lib/support/tmpfile.h
+++ b/src/core/lib/support/tmpfile.h
@@ -29,7 +29,7 @@
    If tmp_filename is not NULL, *tmp_filename is assigned the name of the
    created file and it is the responsibility of the caller to gpr_free it
    unless an error occurs in which case it will be set to NULL. */
-FILE *gpr_tmpfile(const char *prefix, char **tmp_filename);
+FILE* gpr_tmpfile(const char* prefix, char** tmp_filename);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/support/tmpfile_msys.cc b/src/core/lib/support/tmpfile_msys.cc
index 614c0a4..430e866 100644
--- a/src/core/lib/support/tmpfile_msys.cc
+++ b/src/core/lib/support/tmpfile_msys.cc
@@ -32,8 +32,8 @@
 #include "src/core/lib/support/string_windows.h"
 #include "src/core/lib/support/tmpfile.h"
 
-FILE *gpr_tmpfile(const char *prefix, char **tmp_filename_out) {
-  FILE *result = NULL;
+FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) {
+  FILE* result = NULL;
   char tmp_filename[MAX_PATH];
   UINT success;
 
diff --git a/src/core/lib/support/tmpfile_posix.cc b/src/core/lib/support/tmpfile_posix.cc
index 7ad3af0..2e14d28 100644
--- a/src/core/lib/support/tmpfile_posix.cc
+++ b/src/core/lib/support/tmpfile_posix.cc
@@ -33,9 +33,9 @@
 
 #include "src/core/lib/support/string.h"
 
-FILE *gpr_tmpfile(const char *prefix, char **tmp_filename) {
-  FILE *result = NULL;
-  char *filename_template;
+FILE* gpr_tmpfile(const char* prefix, char** tmp_filename) {
+  FILE* result = NULL;
+  char* filename_template;
   int fd;
 
   if (tmp_filename != NULL) *tmp_filename = NULL;
diff --git a/src/core/lib/support/tmpfile_windows.cc b/src/core/lib/support/tmpfile_windows.cc
index 47b4510..2b10bcd 100644
--- a/src/core/lib/support/tmpfile_windows.cc
+++ b/src/core/lib/support/tmpfile_windows.cc
@@ -32,8 +32,8 @@
 #include "src/core/lib/support/string_windows.h"
 #include "src/core/lib/support/tmpfile.h"
 
-FILE *gpr_tmpfile(const char *prefix, char **tmp_filename_out) {
-  FILE *result = NULL;
+FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) {
+  FILE* result = NULL;
   LPTSTR template_string = NULL;
   TCHAR tmp_path[MAX_PATH];
   TCHAR tmp_filename[MAX_PATH];
diff --git a/src/core/lib/support/wrap_memcpy.cc b/src/core/lib/support/wrap_memcpy.cc
index c2362bf..9b8608e 100644
--- a/src/core/lib/support/wrap_memcpy.cc
+++ b/src/core/lib/support/wrap_memcpy.cc
@@ -30,11 +30,11 @@
 #ifdef __linux__
 #if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT)
 __asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
-void *__wrap_memcpy(void *destination, const void *source, size_t num) {
+void* __wrap_memcpy(void* destination, const void* source, size_t num) {
   return memcpy(destination, source, num);
 }
 #else /* !__x86_64__ */
-void *__wrap_memcpy(void *destination, const void *source, size_t num) {
+void* __wrap_memcpy(void* destination, const void* source, size_t num) {
   return memmove(destination, source, num);
 }
 #endif
diff --git a/src/core/lib/surface/alarm.cc b/src/core/lib/surface/alarm.cc
index 4ebdba7..9af9e5c 100644
--- a/src/core/lib/surface/alarm.cc
+++ b/src/core/lib/surface/alarm.cc
@@ -37,14 +37,14 @@
   grpc_closure on_alarm;
   grpc_cq_completion completion;
   /** completion queue where events about this alarm will be posted */
-  grpc_completion_queue *cq;
+  grpc_completion_queue* cq;
   /** user supplied tag */
-  void *tag;
+  void* tag;
 };
 
-static void alarm_ref(grpc_alarm *alarm) { gpr_ref(&alarm->refs); }
+static void alarm_ref(grpc_alarm* alarm) { gpr_ref(&alarm->refs); }
 
-static void alarm_unref(grpc_alarm *alarm) {
+static void alarm_unref(grpc_alarm* alarm) {
   if (gpr_unref(&alarm->refs)) {
     grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
     if (alarm->cq != NULL) {
@@ -56,9 +56,9 @@
 }
 
 #ifndef NDEBUG
-static void alarm_ref_dbg(grpc_alarm *alarm, const char *reason,
-                          const char *file, int line) {
-  if (grpc_trace_alarm_refcount.enabled()) {
+static void alarm_ref_dbg(grpc_alarm* alarm, const char* reason,
+                          const char* file, int line) {
+  if (GRPC_TRACER_ON(grpc_trace_alarm_refcount)) {
     gpr_atm val = gpr_atm_no_barrier_load(&alarm->refs.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "Alarm:%p  ref %" PRIdPTR " -> %" PRIdPTR " %s", alarm, val,
@@ -68,9 +68,9 @@
   alarm_ref(alarm);
 }
 
-static void alarm_unref_dbg(grpc_alarm *alarm, const char *reason,
-                            const char *file, int line) {
-  if (grpc_trace_alarm_refcount.enabled()) {
+static void alarm_unref_dbg(grpc_alarm* alarm, const char* reason,
+                            const char* file, int line) {
+  if (GRPC_TRACER_ON(grpc_trace_alarm_refcount)) {
     gpr_atm val = gpr_atm_no_barrier_load(&alarm->refs.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "Alarm:%p  Unref %" PRIdPTR " -> %" PRIdPTR " %s", alarm, val,
@@ -81,28 +81,28 @@
 }
 #endif
 
-static void alarm_end_completion(grpc_exec_ctx *exec_ctx, void *arg,
-                                 grpc_cq_completion *c) {
-  grpc_alarm *alarm = (grpc_alarm *)arg;
+static void alarm_end_completion(grpc_exec_ctx* exec_ctx, void* arg,
+                                 grpc_cq_completion* c) {
+  grpc_alarm* alarm = (grpc_alarm*)arg;
   GRPC_ALARM_UNREF(alarm, "dequeue-end-op");
 }
 
-static void alarm_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_alarm *alarm = (grpc_alarm *)arg;
+static void alarm_cb(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_alarm* alarm = (grpc_alarm*)arg;
 
   /* We are queuing an op on completion queue. This means, the alarm's structure
      cannot be destroyed until the op is dequeued. Adding an extra ref
      here and unref'ing when the op is dequeued will achieve this */
   GRPC_ALARM_REF(alarm, "queue-end-op");
   grpc_cq_end_op(exec_ctx, alarm->cq, alarm->tag, error, alarm_end_completion,
-                 (void *)alarm, &alarm->completion);
+                 (void*)alarm, &alarm->completion);
 }
 
-grpc_alarm *grpc_alarm_create(void *reserved) {
-  grpc_alarm *alarm = (grpc_alarm *)gpr_malloc(sizeof(grpc_alarm));
+grpc_alarm* grpc_alarm_create(void* reserved) {
+  grpc_alarm* alarm = (grpc_alarm*)gpr_malloc(sizeof(grpc_alarm));
 
 #ifndef NDEBUG
-  if (grpc_trace_alarm_refcount.enabled()) {
+  if (GRPC_TRACER_ON(grpc_trace_alarm_refcount)) {
     gpr_log(GPR_DEBUG, "Alarm:%p created (ref: 1)", alarm);
   }
 #endif
@@ -115,8 +115,8 @@
   return alarm;
 }
 
-void grpc_alarm_set(grpc_alarm *alarm, grpc_completion_queue *cq,
-                    gpr_timespec deadline, void *tag, void *reserved) {
+void grpc_alarm_set(grpc_alarm* alarm, grpc_completion_queue* cq,
+                    gpr_timespec deadline, void* tag, void* reserved) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
   GRPC_CQ_INTERNAL_REF(cq, "alarm");
@@ -129,13 +129,13 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-void grpc_alarm_cancel(grpc_alarm *alarm, void *reserved) {
+void grpc_alarm_cancel(grpc_alarm* alarm, void* reserved) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_timer_cancel(&exec_ctx, &alarm->alarm);
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-void grpc_alarm_destroy(grpc_alarm *alarm, void *reserved) {
+void grpc_alarm_destroy(grpc_alarm* alarm, void* reserved) {
   grpc_alarm_cancel(alarm, reserved);
   GRPC_ALARM_UNREF(alarm, "alarm_destroy");
 }
diff --git a/src/core/lib/surface/byte_buffer.cc b/src/core/lib/surface/byte_buffer.cc
index 7ed550e..a640f78 100644
--- a/src/core/lib/surface/byte_buffer.cc
+++ b/src/core/lib/surface/byte_buffer.cc
@@ -22,18 +22,18 @@
 
 #include "src/core/lib/slice/slice_internal.h"
 
-grpc_byte_buffer *grpc_raw_byte_buffer_create(grpc_slice *slices,
+grpc_byte_buffer* grpc_raw_byte_buffer_create(grpc_slice* slices,
                                               size_t nslices) {
   return grpc_raw_compressed_byte_buffer_create(slices, nslices,
                                                 GRPC_COMPRESS_NONE);
 }
 
-grpc_byte_buffer *grpc_raw_compressed_byte_buffer_create(
-    grpc_slice *slices, size_t nslices,
+grpc_byte_buffer* grpc_raw_compressed_byte_buffer_create(
+    grpc_slice* slices, size_t nslices,
     grpc_compression_algorithm compression) {
   size_t i;
-  grpc_byte_buffer *bb =
-      (grpc_byte_buffer *)gpr_malloc(sizeof(grpc_byte_buffer));
+  grpc_byte_buffer* bb =
+      (grpc_byte_buffer*)gpr_malloc(sizeof(grpc_byte_buffer));
   bb->type = GRPC_BB_RAW;
   bb->data.raw.compression = compression;
   grpc_slice_buffer_init(&bb->data.raw.slice_buffer);
@@ -44,10 +44,10 @@
   return bb;
 }
 
-grpc_byte_buffer *grpc_raw_byte_buffer_from_reader(
-    grpc_byte_buffer_reader *reader) {
-  grpc_byte_buffer *bb =
-      (grpc_byte_buffer *)gpr_malloc(sizeof(grpc_byte_buffer));
+grpc_byte_buffer* grpc_raw_byte_buffer_from_reader(
+    grpc_byte_buffer_reader* reader) {
+  grpc_byte_buffer* bb =
+      (grpc_byte_buffer*)gpr_malloc(sizeof(grpc_byte_buffer));
   grpc_slice slice;
   bb->type = GRPC_BB_RAW;
   bb->data.raw.compression = GRPC_COMPRESS_NONE;
@@ -59,7 +59,7 @@
   return bb;
 }
 
-grpc_byte_buffer *grpc_byte_buffer_copy(grpc_byte_buffer *bb) {
+grpc_byte_buffer* grpc_byte_buffer_copy(grpc_byte_buffer* bb) {
   switch (bb->type) {
     case GRPC_BB_RAW:
       return grpc_raw_compressed_byte_buffer_create(
@@ -69,7 +69,7 @@
   GPR_UNREACHABLE_CODE(return NULL);
 }
 
-void grpc_byte_buffer_destroy(grpc_byte_buffer *bb) {
+void grpc_byte_buffer_destroy(grpc_byte_buffer* bb) {
   if (!bb) return;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   switch (bb->type) {
@@ -81,7 +81,7 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-size_t grpc_byte_buffer_length(grpc_byte_buffer *bb) {
+size_t grpc_byte_buffer_length(grpc_byte_buffer* bb) {
   switch (bb->type) {
     case GRPC_BB_RAW:
       return bb->data.raw.slice_buffer.length;
diff --git a/src/core/lib/surface/byte_buffer_reader.cc b/src/core/lib/surface/byte_buffer_reader.cc
index 87bd323..001227a 100644
--- a/src/core/lib/surface/byte_buffer_reader.cc
+++ b/src/core/lib/surface/byte_buffer_reader.cc
@@ -29,7 +29,7 @@
 #include "src/core/lib/compression/message_compress.h"
 #include "src/core/lib/slice/slice_internal.h"
 
-static int is_compressed(grpc_byte_buffer *buffer) {
+static int is_compressed(grpc_byte_buffer* buffer) {
   switch (buffer->type) {
     case GRPC_BB_RAW:
       if (buffer->data.raw.compression == GRPC_COMPRESS_NONE) {
@@ -40,8 +40,8 @@
   return 1 /* GPR_TRUE */;
 }
 
-int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
-                                 grpc_byte_buffer *buffer) {
+int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
+                                 grpc_byte_buffer* buffer) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_slice_buffer decompressed_slices_buffer;
   reader->buffer_in = buffer;
@@ -76,7 +76,7 @@
   return 1;
 }
 
-void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader) {
+void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader* reader) {
   switch (reader->buffer_in->type) {
     case GRPC_BB_RAW:
       /* keeping the same if-else structure as in the init function */
@@ -87,11 +87,11 @@
   }
 }
 
-int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
-                                 grpc_slice *slice) {
+int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader* reader,
+                                 grpc_slice* slice) {
   switch (reader->buffer_in->type) {
     case GRPC_BB_RAW: {
-      grpc_slice_buffer *slice_buffer;
+      grpc_slice_buffer* slice_buffer;
       slice_buffer = &reader->buffer_out->data.raw.slice_buffer;
       if (reader->current.index < slice_buffer->count) {
         *slice = grpc_slice_ref_internal(
@@ -105,12 +105,12 @@
   return 0;
 }
 
-grpc_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader *reader) {
+grpc_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader* reader) {
   grpc_slice in_slice;
   size_t bytes_read = 0;
   const size_t input_size = grpc_byte_buffer_length(reader->buffer_out);
   grpc_slice out_slice = GRPC_SLICE_MALLOC(input_size);
-  uint8_t *const outbuf = GRPC_SLICE_START_PTR(out_slice); /* just an alias */
+  uint8_t* const outbuf = GRPC_SLICE_START_PTR(out_slice); /* just an alias */
 
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   while (grpc_byte_buffer_reader_next(reader, &in_slice) != 0) {
diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc
index a003439..173f698 100644
--- a/src/core/lib/surface/call.cc
+++ b/src/core/lib/surface/call.cc
@@ -86,7 +86,7 @@
 
 typedef struct {
   bool is_set;
-  grpc_error *error;
+  grpc_error* error;
 } received_status;
 
 static gpr_atm pack_received_status(received_status r) {
@@ -97,14 +97,14 @@
   if ((atm & 1) == 0) {
     return {false, GRPC_ERROR_NONE};
   } else {
-    return {true, (grpc_error *)(atm & ~(gpr_atm)1)};
+    return {true, (grpc_error*)(atm & ~(gpr_atm)1)};
   }
 }
 
 #define MAX_ERRORS_PER_BATCH 4
 
 typedef struct batch_control {
-  grpc_call *call;
+  grpc_call* call;
   /* Share memory for cq_completion and notify_tag as they are never needed
      simultaneously. Each byte used in this data structure count as six bytes
      per call, so any savings we can make are worthwhile,
@@ -120,7 +120,7 @@
          \a is_closure is true, \a tag indicates a closure to be invoked;
          otherwise, \a tag indicates the tag to be used in the notification to
          be sent to the completion queue. */
-      void *tag;
+      void* tag;
       bool is_closure;
     } notify_tag;
   } completion_data;
@@ -128,7 +128,7 @@
   grpc_closure finish_batch;
   gpr_refcount steps_to_complete;
 
-  grpc_error *errors[MAX_ERRORS_PER_BATCH];
+  grpc_error* errors[MAX_ERRORS_PER_BATCH];
   gpr_atm num_errors;
 
   grpc_transport_stream_op_batch op;
@@ -136,16 +136,16 @@
 
 typedef struct {
   gpr_mu child_list_mu;
-  grpc_call *first_child;
+  grpc_call* first_child;
 } parent_call;
 
 typedef struct {
-  grpc_call *parent;
+  grpc_call* parent;
   /** siblings: children of the same parent form a list, and this list is
      protected under
       parent->mu */
-  grpc_call *sibling_next;
-  grpc_call *sibling_prev;
+  grpc_call* sibling_next;
+  grpc_call* sibling_prev;
 } child_call;
 
 #define RECV_NONE ((gpr_atm)0)
@@ -153,14 +153,14 @@
 
 struct grpc_call {
   gpr_refcount ext_ref;
-  gpr_arena *arena;
+  gpr_arena* arena;
   grpc_call_combiner call_combiner;
-  grpc_completion_queue *cq;
+  grpc_completion_queue* cq;
   grpc_polling_entity pollent;
-  grpc_channel *channel;
+  grpc_channel* channel;
   gpr_timespec start_time;
   /* parent_call* */ gpr_atm parent_call_atm;
-  child_call *child;
+  child_call* child;
 
   /* client or server call */
   bool is_client;
@@ -178,7 +178,7 @@
   gpr_atm any_ops_sent_atm;
   gpr_atm received_final_op_atm;
 
-  batch_control *active_batches[MAX_CONCURRENT_BATCHES];
+  batch_control* active_batches[MAX_CONCURRENT_BATCHES];
   grpc_transport_stream_op_batch_payload stream_op_payload;
 
   /* first idx: is_receiving, second idx: is_trailing */
@@ -186,7 +186,7 @@
 
   /* Buffered read metadata waiting to be returned to the application.
      Element 0 is initial metadata, element 1 is trailing metadata. */
-  grpc_metadata_array *buffered_metadata[2];
+  grpc_metadata_array* buffered_metadata[2];
 
   grpc_metadata compression_md;
 
@@ -220,8 +220,8 @@
 
   grpc_slice_buffer_stream sending_stream;
 
-  grpc_byte_stream *receiving_stream;
-  grpc_byte_buffer **receiving_buffer;
+  grpc_byte_stream* receiving_stream;
+  grpc_byte_buffer** receiving_buffer;
   grpc_slice receiving_slice;
   grpc_closure receiving_slice_ready;
   grpc_closure receiving_stream_ready;
@@ -232,11 +232,11 @@
 
   union {
     struct {
-      grpc_status_code *status;
-      grpc_slice *status_details;
+      grpc_status_code* status;
+      grpc_slice* status_details;
     } client;
     struct {
-      int *cancelled;
+      int* cancelled;
     } server;
   } final_op;
 
@@ -262,78 +262,78 @@
 grpc_core::TraceFlag grpc_call_error_trace(false, "call_error");
 grpc_core::TraceFlag grpc_compression_trace(false, "compression");
 
-#define CALL_STACK_FROM_CALL(call) ((grpc_call_stack *)((call) + 1))
-#define CALL_FROM_CALL_STACK(call_stack) (((grpc_call *)(call_stack)) - 1)
+#define CALL_STACK_FROM_CALL(call) ((grpc_call_stack*)((call) + 1))
+#define CALL_FROM_CALL_STACK(call_stack) (((grpc_call*)(call_stack)) - 1)
 #define CALL_ELEM_FROM_CALL(call, idx) \
   grpc_call_stack_element(CALL_STACK_FROM_CALL(call), idx)
 #define CALL_FROM_TOP_ELEM(top_elem) \
   CALL_FROM_CALL_STACK(grpc_call_stack_from_top_element(top_elem))
 
-static void execute_batch(grpc_exec_ctx *exec_ctx, grpc_call *call,
-                          grpc_transport_stream_op_batch *op,
-                          grpc_closure *start_batch_closure);
-static void cancel_with_status(grpc_exec_ctx *exec_ctx, grpc_call *c,
+static void execute_batch(grpc_exec_ctx* exec_ctx, grpc_call* call,
+                          grpc_transport_stream_op_batch* op,
+                          grpc_closure* start_batch_closure);
+static void cancel_with_status(grpc_exec_ctx* exec_ctx, grpc_call* c,
                                status_source source, grpc_status_code status,
-                               const char *description);
-static void cancel_with_error(grpc_exec_ctx *exec_ctx, grpc_call *c,
-                              status_source source, grpc_error *error);
-static void destroy_call(grpc_exec_ctx *exec_ctx, void *call_stack,
-                         grpc_error *error);
-static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
-                                  grpc_error *error);
-static void get_final_status(grpc_exec_ctx *exec_ctx, grpc_call *call,
+                               const char* description);
+static void cancel_with_error(grpc_exec_ctx* exec_ctx, grpc_call* c,
+                              status_source source, grpc_error* error);
+static void destroy_call(grpc_exec_ctx* exec_ctx, void* call_stack,
+                         grpc_error* error);
+static void receiving_slice_ready(grpc_exec_ctx* exec_ctx, void* bctlp,
+                                  grpc_error* error);
+static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call,
                              void (*set_value)(grpc_status_code code,
-                                               void *user_data),
-                             void *set_value_user_data, grpc_slice *details);
-static void set_status_value_directly(grpc_status_code status, void *dest);
-static void set_status_from_error(grpc_exec_ctx *exec_ctx, grpc_call *call,
-                                  status_source source, grpc_error *error);
-static void process_data_after_md(grpc_exec_ctx *exec_ctx, batch_control *bctl);
-static void post_batch_completion(grpc_exec_ctx *exec_ctx, batch_control *bctl);
-static void add_batch_error(grpc_exec_ctx *exec_ctx, batch_control *bctl,
-                            grpc_error *error, bool has_cancelled);
+                                               void* user_data),
+                             void* set_value_user_data, grpc_slice* details);
+static void set_status_value_directly(grpc_status_code status, void* dest);
+static void set_status_from_error(grpc_exec_ctx* exec_ctx, grpc_call* call,
+                                  status_source source, grpc_error* error);
+static void process_data_after_md(grpc_exec_ctx* exec_ctx, batch_control* bctl);
+static void post_batch_completion(grpc_exec_ctx* exec_ctx, batch_control* bctl);
+static void add_batch_error(grpc_exec_ctx* exec_ctx, batch_control* bctl,
+                            grpc_error* error, bool has_cancelled);
 
-static void add_init_error(grpc_error **composite, grpc_error *new_err) {
+static void add_init_error(grpc_error** composite, grpc_error* new_err) {
   if (new_err == GRPC_ERROR_NONE) return;
   if (*composite == GRPC_ERROR_NONE)
     *composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Call creation failed");
   *composite = grpc_error_add_child(*composite, new_err);
 }
 
-void *grpc_call_arena_alloc(grpc_call *call, size_t size) {
+void* grpc_call_arena_alloc(grpc_call* call, size_t size) {
   return gpr_arena_alloc(call->arena, size);
 }
 
-static parent_call *get_or_create_parent_call(grpc_call *call) {
-  parent_call *p = (parent_call *)gpr_atm_acq_load(&call->parent_call_atm);
+static parent_call* get_or_create_parent_call(grpc_call* call) {
+  parent_call* p = (parent_call*)gpr_atm_acq_load(&call->parent_call_atm);
   if (p == NULL) {
-    p = (parent_call *)gpr_arena_alloc(call->arena, sizeof(*p));
+    p = (parent_call*)gpr_arena_alloc(call->arena, sizeof(*p));
     gpr_mu_init(&p->child_list_mu);
     if (!gpr_atm_rel_cas(&call->parent_call_atm, (gpr_atm)NULL, (gpr_atm)p)) {
       gpr_mu_destroy(&p->child_list_mu);
-      p = (parent_call *)gpr_atm_acq_load(&call->parent_call_atm);
+      p = (parent_call*)gpr_atm_acq_load(&call->parent_call_atm);
     }
   }
   return p;
 }
 
-static parent_call *get_parent_call(grpc_call *call) {
-  return (parent_call *)gpr_atm_acq_load(&call->parent_call_atm);
+static parent_call* get_parent_call(grpc_call* call) {
+  return (parent_call*)gpr_atm_acq_load(&call->parent_call_atm);
 }
 
-grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
-                             const grpc_call_create_args *args,
-                             grpc_call **out_call) {
+grpc_error* grpc_call_create(grpc_exec_ctx* exec_ctx,
+                             const grpc_call_create_args* args,
+                             grpc_call** out_call) {
   size_t i, j;
-  grpc_error *error = GRPC_ERROR_NONE;
-  grpc_channel_stack *channel_stack =
+  grpc_error* error = GRPC_ERROR_NONE;
+  grpc_channel_stack* channel_stack =
       grpc_channel_get_channel_stack(args->channel);
-  grpc_call *call;
+  grpc_call* call;
   GPR_TIMER_BEGIN("grpc_call_create", 0);
   size_t initial_size = grpc_channel_get_call_size_estimate(args->channel);
   GRPC_STATS_INC_CALL_INITIAL_SIZE(exec_ctx, initial_size);
-  gpr_arena *arena = gpr_arena_create(initial_size);
-  call = (grpc_call *)gpr_arena_alloc(
+  gpr_arena* arena = gpr_arena_create(initial_size);
+  call = (grpc_call*)gpr_arena_alloc(
       arena, sizeof(grpc_call) + channel_stack->call_stack_size);
   gpr_ref_init(&call->ext_ref, 1);
   call->arena = arena;
@@ -378,15 +378,15 @@
   bool immediately_cancel = false;
 
   if (args->parent != NULL) {
-    child_call *cc = call->child =
-        (child_call *)gpr_arena_alloc(arena, sizeof(child_call));
+    child_call* cc = call->child =
+        (child_call*)gpr_arena_alloc(arena, sizeof(child_call));
     call->child->parent = args->parent;
 
     GRPC_CALL_INTERNAL_REF(args->parent, "child");
     GPR_ASSERT(call->is_client);
     GPR_ASSERT(!args->parent->is_client);
 
-    parent_call *pc = get_or_create_parent_call(args->parent);
+    parent_call* pc = get_or_create_parent_call(args->parent);
 
     gpr_mu_lock(&pc->child_list_mu);
 
@@ -476,8 +476,8 @@
   return error;
 }
 
-void grpc_call_set_completion_queue(grpc_exec_ctx *exec_ctx, grpc_call *call,
-                                    grpc_completion_queue *cq) {
+void grpc_call_set_completion_queue(grpc_exec_ctx* exec_ctx, grpc_call* call,
+                                    grpc_completion_queue* cq) {
   GPR_ASSERT(cq);
 
   if (grpc_polling_entity_pollset_set(&call->pollent) != NULL) {
@@ -493,34 +493,34 @@
 
 #ifndef NDEBUG
 #define REF_REASON reason
-#define REF_ARG , const char *reason
+#define REF_ARG , const char* reason
 #else
 #define REF_REASON ""
 #define REF_ARG
 #endif
-void grpc_call_internal_ref(grpc_call *c REF_ARG) {
+void grpc_call_internal_ref(grpc_call* c REF_ARG) {
   GRPC_CALL_STACK_REF(CALL_STACK_FROM_CALL(c), REF_REASON);
 }
-void grpc_call_internal_unref(grpc_exec_ctx *exec_ctx, grpc_call *c REF_ARG) {
+void grpc_call_internal_unref(grpc_exec_ctx* exec_ctx, grpc_call* c REF_ARG) {
   GRPC_CALL_STACK_UNREF(exec_ctx, CALL_STACK_FROM_CALL(c), REF_REASON);
 }
 
-static void release_call(grpc_exec_ctx *exec_ctx, void *call,
-                         grpc_error *error) {
-  grpc_call *c = (grpc_call *)call;
-  grpc_channel *channel = c->channel;
+static void release_call(grpc_exec_ctx* exec_ctx, void* call,
+                         grpc_error* error) {
+  grpc_call* c = (grpc_call*)call;
+  grpc_channel* channel = c->channel;
   grpc_call_combiner_destroy(&c->call_combiner);
-  gpr_free((char *)c->peer_string);
+  gpr_free((char*)c->peer_string);
   grpc_channel_update_call_size_estimate(channel, gpr_arena_destroy(c->arena));
   GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel, "call");
 }
 
-static void set_status_value_directly(grpc_status_code status, void *dest);
-static void destroy_call(grpc_exec_ctx *exec_ctx, void *call,
-                         grpc_error *error) {
+static void set_status_value_directly(grpc_status_code status, void* dest);
+static void destroy_call(grpc_exec_ctx* exec_ctx, void* call,
+                         grpc_error* error) {
   size_t i;
   int ii;
-  grpc_call *c = (grpc_call *)call;
+  grpc_call* c = (grpc_call*)call;
   GPR_TIMER_BEGIN("destroy_call", 0);
   for (i = 0; i < 2; i++) {
     grpc_metadata_batch_destroy(
@@ -529,7 +529,7 @@
   if (c->receiving_stream != NULL) {
     grpc_byte_stream_destroy(exec_ctx, c->receiving_stream);
   }
-  parent_call *pc = get_parent_call(c);
+  parent_call* pc = get_parent_call(c);
   if (pc != NULL) {
     gpr_mu_destroy(&pc->child_list_mu);
   }
@@ -561,19 +561,19 @@
   GPR_TIMER_END("destroy_call", 0);
 }
 
-void grpc_call_ref(grpc_call *c) { gpr_ref(&c->ext_ref); }
+void grpc_call_ref(grpc_call* c) { gpr_ref(&c->ext_ref); }
 
-void grpc_call_unref(grpc_call *c) {
+void grpc_call_unref(grpc_call* c) {
   if (!gpr_unref(&c->ext_ref)) return;
 
-  child_call *cc = c->child;
+  child_call* cc = c->child;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
   GPR_TIMER_BEGIN("grpc_call_unref", 0);
   GRPC_API_TRACE("grpc_call_unref(c=%p)", 1, (c));
 
   if (cc) {
-    parent_call *pc = get_parent_call(cc->parent);
+    parent_call* pc = get_parent_call(cc->parent);
     gpr_mu_lock(&pc->child_list_mu);
     if (c == pc->first_child) {
       pc->first_child = cc->sibling_next;
@@ -606,7 +606,7 @@
   GPR_TIMER_END("grpc_call_unref", 0);
 }
 
-grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved) {
+grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
   GRPC_API_TRACE("grpc_call_cancel(call=%p, reserved=%p)", 2, (call, reserved));
   GPR_ASSERT(!reserved);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -618,12 +618,12 @@
 
 // This is called via the call combiner to start sending a batch down
 // the filter stack.
-static void execute_batch_in_call_combiner(grpc_exec_ctx *exec_ctx, void *arg,
-                                           grpc_error *ignored) {
-  grpc_transport_stream_op_batch *batch = (grpc_transport_stream_op_batch *)arg;
-  grpc_call *call = (grpc_call *)batch->handler_private.extra_arg;
+static void execute_batch_in_call_combiner(grpc_exec_ctx* exec_ctx, void* arg,
+                                           grpc_error* ignored) {
+  grpc_transport_stream_op_batch* batch = (grpc_transport_stream_op_batch*)arg;
+  grpc_call* call = (grpc_call*)batch->handler_private.extra_arg;
   GPR_TIMER_BEGIN("execute_batch", 0);
-  grpc_call_element *elem = CALL_ELEM_FROM_CALL(call, 0);
+  grpc_call_element* elem = CALL_ELEM_FROM_CALL(call, 0);
   GRPC_CALL_LOG_OP(GPR_INFO, elem, batch);
   elem->filter->start_transport_stream_op_batch(exec_ctx, elem, batch);
   GPR_TIMER_END("execute_batch", 0);
@@ -631,9 +631,9 @@
 
 // start_batch_closure points to a caller-allocated closure to be used
 // for entering the call combiner.
-static void execute_batch(grpc_exec_ctx *exec_ctx, grpc_call *call,
-                          grpc_transport_stream_op_batch *batch,
-                          grpc_closure *start_batch_closure) {
+static void execute_batch(grpc_exec_ctx* exec_ctx, grpc_call* call,
+                          grpc_transport_stream_op_batch* batch,
+                          grpc_closure* start_batch_closure) {
   batch->handler_private.extra_arg = call;
   GRPC_CLOSURE_INIT(start_batch_closure, execute_batch_in_call_combiner, batch,
                     grpc_schedule_on_exec_ctx);
@@ -641,15 +641,15 @@
                            GRPC_ERROR_NONE, "executing batch");
 }
 
-char *grpc_call_get_peer(grpc_call *call) {
-  char *peer_string = (char *)gpr_atm_acq_load(&call->peer_string);
+char* grpc_call_get_peer(grpc_call* call) {
+  char* peer_string = (char*)gpr_atm_acq_load(&call->peer_string);
   if (peer_string != NULL) return gpr_strdup(peer_string);
   peer_string = grpc_channel_get_target(call->channel);
   if (peer_string != NULL) return peer_string;
   return gpr_strdup("unknown");
 }
 
-grpc_call *grpc_call_from_top_element(grpc_call_element *elem) {
+grpc_call* grpc_call_from_top_element(grpc_call_element* elem) {
   return CALL_FROM_TOP_ELEM(elem);
 }
 
@@ -657,10 +657,10 @@
  * CANCELLATION
  */
 
-grpc_call_error grpc_call_cancel_with_status(grpc_call *c,
+grpc_call_error grpc_call_cancel_with_status(grpc_call* c,
                                              grpc_status_code status,
-                                             const char *description,
-                                             void *reserved) {
+                                             const char* description,
+                                             void* reserved) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GRPC_API_TRACE(
       "grpc_call_cancel_with_status("
@@ -674,24 +674,24 @@
 }
 
 typedef struct {
-  grpc_call *call;
+  grpc_call* call;
   grpc_closure start_batch;
   grpc_closure finish_batch;
 } cancel_state;
 
 // The on_complete callback used when sending a cancel_stream batch down
 // the filter stack.  Yields the call combiner when the batch is done.
-static void done_termination(grpc_exec_ctx *exec_ctx, void *arg,
-                             grpc_error *error) {
-  cancel_state *state = (cancel_state *)arg;
+static void done_termination(grpc_exec_ctx* exec_ctx, void* arg,
+                             grpc_error* error) {
+  cancel_state* state = (cancel_state*)arg;
   GRPC_CALL_COMBINER_STOP(exec_ctx, &state->call->call_combiner,
                           "on_complete for cancel_stream op");
   GRPC_CALL_INTERNAL_UNREF(exec_ctx, state->call, "termination");
   gpr_free(state);
 }
 
-static void cancel_with_error(grpc_exec_ctx *exec_ctx, grpc_call *c,
-                              status_source source, grpc_error *error) {
+static void cancel_with_error(grpc_exec_ctx* exec_ctx, grpc_call* c,
+                              status_source source, grpc_error* error) {
   GRPC_CALL_INTERNAL_REF(c, "termination");
   // Inform the call combiner of the cancellation, so that it can cancel
   // any in-flight asynchronous actions that may be holding the call
@@ -699,19 +699,19 @@
   // down the filter stack in a timely manner.
   grpc_call_combiner_cancel(exec_ctx, &c->call_combiner, GRPC_ERROR_REF(error));
   set_status_from_error(exec_ctx, c, source, GRPC_ERROR_REF(error));
-  cancel_state *state = (cancel_state *)gpr_malloc(sizeof(*state));
+  cancel_state* state = (cancel_state*)gpr_malloc(sizeof(*state));
   state->call = c;
   GRPC_CLOSURE_INIT(&state->finish_batch, done_termination, state,
                     grpc_schedule_on_exec_ctx);
-  grpc_transport_stream_op_batch *op =
+  grpc_transport_stream_op_batch* op =
       grpc_make_transport_stream_op(&state->finish_batch);
   op->cancel_stream = true;
   op->payload->cancel_stream.cancel_error = error;
   execute_batch(exec_ctx, c, op, &state->start_batch);
 }
 
-static grpc_error *error_from_status(grpc_status_code status,
-                                     const char *description) {
+static grpc_error* error_from_status(grpc_status_code status,
+                                     const char* description) {
   // copying 'description' is needed to ensure the grpc_call_cancel_with_status
   // guarantee that can be short-lived.
   return grpc_error_set_int(
@@ -721,9 +721,9 @@
       GRPC_ERROR_INT_GRPC_STATUS, status);
 }
 
-static void cancel_with_status(grpc_exec_ctx *exec_ctx, grpc_call *c,
+static void cancel_with_status(grpc_exec_ctx* exec_ctx, grpc_call* c,
                                status_source source, grpc_status_code status,
-                               const char *description) {
+                               const char* description) {
   cancel_with_error(exec_ctx, c, source,
                     error_from_status(status, description));
 }
@@ -732,12 +732,12 @@
  * FINAL STATUS CODE MANIPULATION
  */
 
-static bool get_final_status_from(grpc_exec_ctx *exec_ctx, grpc_call *call,
-                                  grpc_error *error, bool allow_ok_status,
+static bool get_final_status_from(grpc_exec_ctx* exec_ctx, grpc_call* call,
+                                  grpc_error* error, bool allow_ok_status,
                                   void (*set_value)(grpc_status_code code,
-                                                    void *user_data),
-                                  void *set_value_user_data,
-                                  grpc_slice *details) {
+                                                    void* user_data),
+                                  void* set_value_user_data,
+                                  grpc_slice* details) {
   grpc_status_code code;
   grpc_slice slice = grpc_empty_slice();
   grpc_error_get_status(exec_ctx, error, call->send_deadline, &code, &slice,
@@ -753,10 +753,10 @@
   return true;
 }
 
-static void get_final_status(grpc_exec_ctx *exec_ctx, grpc_call *call,
+static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call,
                              void (*set_value)(grpc_status_code code,
-                                               void *user_data),
-                             void *set_value_user_data, grpc_slice *details) {
+                                               void* user_data),
+                             void* set_value_user_data, grpc_slice* details) {
   int i;
   received_status status[STATUS_SOURCE_COUNT];
   for (i = 0; i < STATUS_SOURCE_COUNT; i++) {
@@ -804,8 +804,8 @@
   }
 }
 
-static void set_status_from_error(grpc_exec_ctx *exec_ctx, grpc_call *call,
-                                  status_source source, grpc_error *error) {
+static void set_status_from_error(grpc_exec_ctx* exec_ctx, grpc_call* call,
+                                  status_source source, grpc_error* error) {
   if (!gpr_atm_rel_cas(&call->status[source],
                        pack_received_status({false, GRPC_ERROR_NONE}),
                        pack_received_status({true, error}))) {
@@ -818,52 +818,52 @@
  */
 
 static void set_incoming_compression_algorithm(
-    grpc_call *call, grpc_compression_algorithm algo) {
+    grpc_call* call, grpc_compression_algorithm algo) {
   GPR_ASSERT(algo < GRPC_COMPRESS_ALGORITHMS_COUNT);
   call->incoming_compression_algorithm = algo;
 }
 
 static void set_incoming_stream_compression_algorithm(
-    grpc_call *call, grpc_stream_compression_algorithm algo) {
+    grpc_call* call, grpc_stream_compression_algorithm algo) {
   GPR_ASSERT(algo < GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT);
   call->incoming_stream_compression_algorithm = algo;
 }
 
 grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
-    grpc_call *call) {
+    grpc_call* call) {
   grpc_compression_algorithm algorithm;
   algorithm = call->incoming_compression_algorithm;
   return algorithm;
 }
 
 static grpc_compression_algorithm compression_algorithm_for_level_locked(
-    grpc_call *call, grpc_compression_level level) {
+    grpc_call* call, grpc_compression_level level) {
   return grpc_compression_algorithm_for_level(level,
                                               call->encodings_accepted_by_peer);
 }
 
 static grpc_stream_compression_algorithm
 stream_compression_algorithm_for_level_locked(
-    grpc_call *call, grpc_stream_compression_level level) {
+    grpc_call* call, grpc_stream_compression_level level) {
   return grpc_stream_compression_algorithm_for_level(
       level, call->stream_encodings_accepted_by_peer);
 }
 
-uint32_t grpc_call_test_only_get_message_flags(grpc_call *call) {
+uint32_t grpc_call_test_only_get_message_flags(grpc_call* call) {
   uint32_t flags;
   flags = call->test_only_last_message_flags;
   return flags;
 }
 
-static void destroy_encodings_accepted_by_peer(void *p) { return; }
+static void destroy_encodings_accepted_by_peer(void* p) { return; }
 
-static void set_encodings_accepted_by_peer(grpc_exec_ctx *exec_ctx,
-                                           grpc_call *call, grpc_mdelem mdel) {
+static void set_encodings_accepted_by_peer(grpc_exec_ctx* exec_ctx,
+                                           grpc_call* call, grpc_mdelem mdel) {
   size_t i;
   grpc_compression_algorithm algorithm;
   grpc_slice_buffer accept_encoding_parts;
   grpc_slice accept_encoding_slice;
-  void *accepted_user_data;
+  void* accepted_user_data;
 
   accepted_user_data =
       grpc_mdelem_get_user_data(mdel, destroy_encodings_accepted_by_peer);
@@ -887,7 +887,7 @@
                                          &algorithm)) {
       GPR_BITSET(&call->encodings_accepted_by_peer, algorithm);
     } else {
-      char *accept_encoding_entry_str =
+      char* accept_encoding_entry_str =
           grpc_slice_to_c_string(accept_encoding_entry_slice);
       gpr_log(GPR_ERROR,
               "Invalid entry in accept encoding metadata: '%s'. Ignoring.",
@@ -900,17 +900,17 @@
 
   grpc_mdelem_set_user_data(
       mdel, destroy_encodings_accepted_by_peer,
-      (void *)(((uintptr_t)call->encodings_accepted_by_peer) + 1));
+      (void*)(((uintptr_t)call->encodings_accepted_by_peer) + 1));
 }
 
-static void set_stream_encodings_accepted_by_peer(grpc_exec_ctx *exec_ctx,
-                                                  grpc_call *call,
+static void set_stream_encodings_accepted_by_peer(grpc_exec_ctx* exec_ctx,
+                                                  grpc_call* call,
                                                   grpc_mdelem mdel) {
   size_t i;
   grpc_stream_compression_algorithm algorithm;
   grpc_slice_buffer accept_encoding_parts;
   grpc_slice accept_encoding_slice;
-  void *accepted_user_data;
+  void* accepted_user_data;
 
   accepted_user_data =
       grpc_mdelem_get_user_data(mdel, destroy_encodings_accepted_by_peer);
@@ -933,7 +933,7 @@
                                                 &algorithm)) {
       GPR_BITSET(&call->stream_encodings_accepted_by_peer, algorithm);
     } else {
-      char *accept_encoding_entry_str =
+      char* accept_encoding_entry_str =
           grpc_slice_to_c_string(accept_encoding_entry_slice);
       gpr_log(GPR_ERROR,
               "Invalid entry in accept encoding metadata: '%s'. Ignoring.",
@@ -946,52 +946,52 @@
 
   grpc_mdelem_set_user_data(
       mdel, destroy_encodings_accepted_by_peer,
-      (void *)(((uintptr_t)call->stream_encodings_accepted_by_peer) + 1));
+      (void*)(((uintptr_t)call->stream_encodings_accepted_by_peer) + 1));
 }
 
-uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call *call) {
+uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call* call) {
   uint32_t encodings_accepted_by_peer;
   encodings_accepted_by_peer = call->encodings_accepted_by_peer;
   return encodings_accepted_by_peer;
 }
 
 uint32_t grpc_call_test_only_get_stream_encodings_accepted_by_peer(
-    grpc_call *call) {
+    grpc_call* call) {
   uint32_t stream_encodings_accepted_by_peer;
   stream_encodings_accepted_by_peer = call->stream_encodings_accepted_by_peer;
   return stream_encodings_accepted_by_peer;
 }
 
 grpc_stream_compression_algorithm
-grpc_call_test_only_get_incoming_stream_encodings(grpc_call *call) {
+grpc_call_test_only_get_incoming_stream_encodings(grpc_call* call) {
   return call->incoming_stream_compression_algorithm;
 }
 
-static grpc_linked_mdelem *linked_from_md(const grpc_metadata *md) {
-  return (grpc_linked_mdelem *)&md->internal_data;
+static grpc_linked_mdelem* linked_from_md(const grpc_metadata* md) {
+  return (grpc_linked_mdelem*)&md->internal_data;
 }
 
-static grpc_metadata *get_md_elem(grpc_metadata *metadata,
-                                  grpc_metadata *additional_metadata, int i,
+static grpc_metadata* get_md_elem(grpc_metadata* metadata,
+                                  grpc_metadata* additional_metadata, int i,
                                   int count) {
-  grpc_metadata *res =
+  grpc_metadata* res =
       i < count ? &metadata[i] : &additional_metadata[i - count];
   GPR_ASSERT(res);
   return res;
 }
 
 static int prepare_application_metadata(
-    grpc_exec_ctx *exec_ctx, grpc_call *call, int count,
-    grpc_metadata *metadata, int is_trailing, int prepend_extra_metadata,
-    grpc_metadata *additional_metadata, int additional_metadata_count) {
+    grpc_exec_ctx* exec_ctx, grpc_call* call, int count,
+    grpc_metadata* metadata, int is_trailing, int prepend_extra_metadata,
+    grpc_metadata* additional_metadata, int additional_metadata_count) {
   int total_count = count + additional_metadata_count;
   int i;
-  grpc_metadata_batch *batch =
+  grpc_metadata_batch* batch =
       &call->metadata_batch[0 /* is_receiving */][is_trailing];
   for (i = 0; i < total_count; i++) {
-    const grpc_metadata *md =
+    const grpc_metadata* md =
         get_md_elem(metadata, additional_metadata, i, count);
-    grpc_linked_mdelem *l = linked_from_md(md);
+    grpc_linked_mdelem* l = linked_from_md(md);
     GPR_ASSERT(sizeof(grpc_linked_mdelem) == sizeof(md->internal_data));
     if (!GRPC_LOG_IF_ERROR("validate_metadata",
                            grpc_validate_header_key_is_legal(md->key))) {
@@ -1002,13 +1002,13 @@
                    grpc_validate_header_nonbin_value_is_legal(md->value))) {
       break;
     }
-    l->md = grpc_mdelem_from_grpc_metadata(exec_ctx, (grpc_metadata *)md);
+    l->md = grpc_mdelem_from_grpc_metadata(exec_ctx, (grpc_metadata*)md);
   }
   if (i != total_count) {
     for (int j = 0; j < i; j++) {
-      const grpc_metadata *md =
+      const grpc_metadata* md =
           get_md_elem(metadata, additional_metadata, j, count);
-      grpc_linked_mdelem *l = linked_from_md(md);
+      grpc_linked_mdelem* l = linked_from_md(md);
       GRPC_MDELEM_UNREF(exec_ctx, l->md);
     }
     return 0;
@@ -1025,9 +1025,9 @@
     }
   }
   for (i = 0; i < total_count; i++) {
-    grpc_metadata *md = get_md_elem(metadata, additional_metadata, i, count);
-    grpc_linked_mdelem *l = linked_from_md(md);
-    grpc_error *error = grpc_metadata_batch_link_tail(exec_ctx, batch, l);
+    grpc_metadata* md = get_md_elem(metadata, additional_metadata, i, count);
+    grpc_linked_mdelem* l = linked_from_md(md);
+    grpc_error* error = grpc_metadata_batch_link_tail(exec_ctx, batch, l);
     if (error != GRPC_ERROR_NONE) {
       GRPC_MDELEM_UNREF(exec_ctx, l->md);
     }
@@ -1042,11 +1042,11 @@
    as metadata cannot store a 0 value (which is used as OK for grpc_status_codes
    */
 #define STATUS_OFFSET 1
-static void destroy_status(void *ignored) {}
+static void destroy_status(void* ignored) {}
 
 static uint32_t decode_status(grpc_mdelem md) {
   uint32_t status;
-  void *user_data;
+  void* user_data;
   if (grpc_mdelem_eq(md, GRPC_MDELEM_GRPC_STATUS_0)) return 0;
   if (grpc_mdelem_eq(md, GRPC_MDELEM_GRPC_STATUS_1)) return 1;
   if (grpc_mdelem_eq(md, GRPC_MDELEM_GRPC_STATUS_2)) return 2;
@@ -1058,7 +1058,7 @@
       status = GRPC_STATUS_UNKNOWN; /* could not parse status code */
     }
     grpc_mdelem_set_user_data(md, destroy_status,
-                              (void *)(intptr_t)(status + STATUS_OFFSET));
+                              (void*)(intptr_t)(status + STATUS_OFFSET));
   }
   return status;
 }
@@ -1067,7 +1067,7 @@
   grpc_compression_algorithm algorithm =
       grpc_compression_algorithm_from_slice(GRPC_MDVALUE(md));
   if (algorithm == GRPC_COMPRESS_ALGORITHMS_COUNT) {
-    char *md_c_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+    char* md_c_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
     gpr_log(GPR_ERROR,
             "Invalid incoming compression algorithm: '%s'. Interpreting "
             "incoming data as uncompressed.",
@@ -1083,7 +1083,7 @@
   grpc_stream_compression_algorithm algorithm =
       grpc_stream_compression_algorithm_from_slice(GRPC_MDVALUE(md));
   if (algorithm == GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT) {
-    char *md_c_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+    char* md_c_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
     gpr_log(GPR_ERROR,
             "Invalid incoming stream compression algorithm: '%s'. Interpreting "
             "incoming data as uncompressed.",
@@ -1094,20 +1094,20 @@
   return algorithm;
 }
 
-static void publish_app_metadata(grpc_call *call, grpc_metadata_batch *b,
+static void publish_app_metadata(grpc_call* call, grpc_metadata_batch* b,
                                  int is_trailing) {
   if (b->list.count == 0) return;
   GPR_TIMER_BEGIN("publish_app_metadata", 0);
-  grpc_metadata_array *dest;
-  grpc_metadata *mdusr;
+  grpc_metadata_array* dest;
+  grpc_metadata* mdusr;
   dest = call->buffered_metadata[is_trailing];
   if (dest->count + b->list.count > dest->capacity) {
     dest->capacity =
         GPR_MAX(dest->capacity + b->list.count, dest->capacity * 3 / 2);
-    dest->metadata = (grpc_metadata *)gpr_realloc(
+    dest->metadata = (grpc_metadata*)gpr_realloc(
         dest->metadata, sizeof(grpc_metadata) * dest->capacity);
   }
-  for (grpc_linked_mdelem *l = b->list.head; l != NULL; l = l->next) {
+  for (grpc_linked_mdelem* l = b->list.head; l != NULL; l = l->next) {
     mdusr = &dest->metadata[dest->count++];
     /* we pass back borrowed slices that are valid whilst the call is valid */
     mdusr->key = GRPC_MDKEY(l->md);
@@ -1116,8 +1116,8 @@
   GPR_TIMER_END("publish_app_metadata", 0);
 }
 
-static void recv_initial_filter(grpc_exec_ctx *exec_ctx, grpc_call *call,
-                                grpc_metadata_batch *b) {
+static void recv_initial_filter(grpc_exec_ctx* exec_ctx, grpc_call* call,
+                                grpc_metadata_batch* b) {
   if (b->idx.named.content_encoding != NULL) {
     if (b->idx.named.grpc_encoding != NULL) {
       gpr_log(GPR_ERROR,
@@ -1154,12 +1154,12 @@
   publish_app_metadata(call, b, false);
 }
 
-static void recv_trailing_filter(grpc_exec_ctx *exec_ctx, void *args,
-                                 grpc_metadata_batch *b) {
-  grpc_call *call = (grpc_call *)args;
+static void recv_trailing_filter(grpc_exec_ctx* exec_ctx, void* args,
+                                 grpc_metadata_batch* b) {
+  grpc_call* call = (grpc_call*)args;
   if (b->idx.named.grpc_status != NULL) {
     uint32_t status_code = decode_status(b->idx.named.grpc_status->md);
-    grpc_error *error =
+    grpc_error* error =
         status_code == GRPC_STATUS_OK
             ? GRPC_ERROR_NONE
             : grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -1181,7 +1181,7 @@
   publish_app_metadata(call, b, true);
 }
 
-grpc_call_stack *grpc_call_get_call_stack(grpc_call *call) {
+grpc_call_stack* grpc_call_get_call_stack(grpc_call* call) {
   return CALL_STACK_FROM_CALL(call);
 }
 
@@ -1189,12 +1189,12 @@
  * BATCH API IMPLEMENTATION
  */
 
-static void set_status_value_directly(grpc_status_code status, void *dest) {
-  *(grpc_status_code *)dest = status;
+static void set_status_value_directly(grpc_status_code status, void* dest) {
+  *(grpc_status_code*)dest = status;
 }
 
-static void set_cancelled_value(grpc_status_code status, void *dest) {
-  *(int *)dest = (status != GRPC_STATUS_OK);
+static void set_cancelled_value(grpc_status_code status, void* dest) {
+  *(int*)dest = (status != GRPC_STATUS_OK);
 }
 
 static bool are_write_flags_valid(uint32_t flags) {
@@ -1234,16 +1234,16 @@
   GPR_UNREACHABLE_CODE(return 123456789);
 }
 
-static batch_control *allocate_batch_control(grpc_call *call,
-                                             const grpc_op *ops,
+static batch_control* allocate_batch_control(grpc_call* call,
+                                             const grpc_op* ops,
                                              size_t num_ops) {
   int slot = batch_slot_for_op(ops[0].op);
-  batch_control **pslot = &call->active_batches[slot];
+  batch_control** pslot = &call->active_batches[slot];
   if (*pslot == NULL) {
     *pslot =
-        (batch_control *)gpr_arena_alloc(call->arena, sizeof(batch_control));
+        (batch_control*)gpr_arena_alloc(call->arena, sizeof(batch_control));
   }
-  batch_control *bctl = *pslot;
+  batch_control* bctl = *pslot;
   if (bctl->call != NULL) {
     return NULL;
   }
@@ -1253,26 +1253,26 @@
   return bctl;
 }
 
-static void finish_batch_completion(grpc_exec_ctx *exec_ctx, void *user_data,
-                                    grpc_cq_completion *storage) {
-  batch_control *bctl = (batch_control *)user_data;
-  grpc_call *call = bctl->call;
+static void finish_batch_completion(grpc_exec_ctx* exec_ctx, void* user_data,
+                                    grpc_cq_completion* storage) {
+  batch_control* bctl = (batch_control*)user_data;
+  grpc_call* call = bctl->call;
   bctl->call = NULL;
   GRPC_CALL_INTERNAL_UNREF(exec_ctx, call, "completion");
 }
 
-static grpc_error *consolidate_batch_errors(batch_control *bctl) {
+static grpc_error* consolidate_batch_errors(batch_control* bctl) {
   size_t n = (size_t)gpr_atm_acq_load(&bctl->num_errors);
   if (n == 0) {
     return GRPC_ERROR_NONE;
   } else if (n == 1) {
     /* Skip creating a composite error in the case that only one error was
        logged */
-    grpc_error *e = bctl->errors[0];
+    grpc_error* e = bctl->errors[0];
     bctl->errors[0] = NULL;
     return e;
   } else {
-    grpc_error *error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+    grpc_error* error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
         "Call batch failed", bctl->errors, n);
     for (size_t i = 0; i < n; i++) {
       GRPC_ERROR_UNREF(bctl->errors[i]);
@@ -1282,11 +1282,11 @@
   }
 }
 
-static void post_batch_completion(grpc_exec_ctx *exec_ctx,
-                                  batch_control *bctl) {
-  grpc_call *next_child_call;
-  grpc_call *call = bctl->call;
-  grpc_error *error = consolidate_batch_errors(bctl);
+static void post_batch_completion(grpc_exec_ctx* exec_ctx,
+                                  batch_control* bctl) {
+  grpc_call* next_child_call;
+  grpc_call* call = bctl->call;
+  grpc_error* error = consolidate_batch_errors(bctl);
 
   if (bctl->op.send_initial_metadata) {
     grpc_metadata_batch_destroy(
@@ -1302,15 +1302,15 @@
         &call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */]);
   }
   if (bctl->op.recv_trailing_metadata) {
-    grpc_metadata_batch *md =
+    grpc_metadata_batch* md =
         &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
     recv_trailing_filter(exec_ctx, call, md);
 
     /* propagate cancellation to any interested children */
     gpr_atm_rel_store(&call->received_final_op_atm, 1);
-    parent_call *pc = get_parent_call(call);
+    parent_call* pc = get_parent_call(call);
     if (pc != NULL) {
-      grpc_call *child;
+      grpc_call* child;
       gpr_mu_lock(&pc->child_list_mu);
       child = pc->first_child;
       if (child != NULL) {
@@ -1350,7 +1350,7 @@
     /* unrefs bctl->error */
     bctl->call = NULL;
     GRPC_CLOSURE_RUN(
-        exec_ctx, (grpc_closure *)bctl->completion_data.notify_tag.tag, error);
+        exec_ctx, (grpc_closure*)bctl->completion_data.notify_tag.tag, error);
     GRPC_CALL_INTERNAL_UNREF(exec_ctx, call, "completion");
   } else {
     /* unrefs bctl->error */
@@ -1360,16 +1360,16 @@
   }
 }
 
-static void finish_batch_step(grpc_exec_ctx *exec_ctx, batch_control *bctl) {
+static void finish_batch_step(grpc_exec_ctx* exec_ctx, batch_control* bctl) {
   if (gpr_unref(&bctl->steps_to_complete)) {
     post_batch_completion(exec_ctx, bctl);
   }
 }
 
-static void continue_receiving_slices(grpc_exec_ctx *exec_ctx,
-                                      batch_control *bctl) {
-  grpc_error *error;
-  grpc_call *call = bctl->call;
+static void continue_receiving_slices(grpc_exec_ctx* exec_ctx,
+                                      batch_control* bctl) {
+  grpc_error* error;
+  grpc_call* call = bctl->call;
   for (;;) {
     size_t remaining = call->receiving_stream->length -
                        (*call->receiving_buffer)->data.raw.slice_buffer.length;
@@ -1402,11 +1402,11 @@
   }
 }
 
-static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
-                                  grpc_error *error) {
-  batch_control *bctl = (batch_control *)bctlp;
-  grpc_call *call = bctl->call;
-  grpc_byte_stream *bs = call->receiving_stream;
+static void receiving_slice_ready(grpc_exec_ctx* exec_ctx, void* bctlp,
+                                  grpc_error* error) {
+  batch_control* bctl = (batch_control*)bctlp;
+  grpc_call* call = bctl->call;
+  grpc_byte_stream* bs = call->receiving_stream;
   bool release_error = false;
 
   if (error == GRPC_ERROR_NONE) {
@@ -1439,9 +1439,9 @@
   }
 }
 
-static void process_data_after_md(grpc_exec_ctx *exec_ctx,
-                                  batch_control *bctl) {
-  grpc_call *call = bctl->call;
+static void process_data_after_md(grpc_exec_ctx* exec_ctx,
+                                  batch_control* bctl) {
+  grpc_call* call = bctl->call;
   if (call->receiving_stream == NULL) {
     *call->receiving_buffer = NULL;
     call->receiving_message = 0;
@@ -1461,10 +1461,10 @@
   }
 }
 
-static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
-                                   grpc_error *error) {
-  batch_control *bctl = (batch_control *)bctlp;
-  grpc_call *call = bctl->call;
+static void receiving_stream_ready(grpc_exec_ctx* exec_ctx, void* bctlp,
+                                   grpc_error* error) {
+  batch_control* bctl = (batch_control*)bctlp;
+  grpc_call* call = bctl->call;
   if (error != GRPC_ERROR_NONE) {
     if (call->receiving_stream != NULL) {
       grpc_byte_stream_destroy(exec_ctx, call->receiving_stream);
@@ -1486,24 +1486,24 @@
 // The recv_message_ready callback used when sending a batch containing
 // a recv_message op down the filter stack.  Yields the call combiner
 // before processing the received message.
-static void receiving_stream_ready_in_call_combiner(grpc_exec_ctx *exec_ctx,
-                                                    void *bctlp,
-                                                    grpc_error *error) {
-  batch_control *bctl = (batch_control *)bctlp;
-  grpc_call *call = bctl->call;
+static void receiving_stream_ready_in_call_combiner(grpc_exec_ctx* exec_ctx,
+                                                    void* bctlp,
+                                                    grpc_error* error) {
+  batch_control* bctl = (batch_control*)bctlp;
+  grpc_call* call = bctl->call;
   GRPC_CALL_COMBINER_STOP(exec_ctx, &call->call_combiner, "recv_message_ready");
   receiving_stream_ready(exec_ctx, bctlp, error);
 }
 
-static void validate_filtered_metadata(grpc_exec_ctx *exec_ctx,
-                                       batch_control *bctl) {
-  grpc_call *call = bctl->call;
+static void validate_filtered_metadata(grpc_exec_ctx* exec_ctx,
+                                       batch_control* bctl) {
+  grpc_call* call = bctl->call;
   /* validate compression algorithms */
   if (call->incoming_stream_compression_algorithm !=
       GRPC_STREAM_COMPRESS_NONE) {
     const grpc_stream_compression_algorithm algo =
         call->incoming_stream_compression_algorithm;
-    char *error_msg = NULL;
+    char* error_msg = NULL;
     const grpc_compression_options compression_options =
         grpc_channel_compression_options(call->channel);
     if (algo >= GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT) {
@@ -1515,7 +1515,7 @@
     } else if (grpc_compression_options_is_stream_compression_algorithm_enabled(
                    &compression_options, algo) == 0) {
       /* check if algorithm is supported by current channel config */
-      const char *algo_name = NULL;
+      const char* algo_name = NULL;
       grpc_stream_compression_algorithm_name(algo, &algo_name);
       gpr_asprintf(&error_msg, "Stream compression algorithm '%s' is disabled.",
                    algo_name);
@@ -1529,7 +1529,7 @@
     if (!GPR_BITGET(call->stream_encodings_accepted_by_peer,
                     call->incoming_stream_compression_algorithm)) {
       if (grpc_compression_trace.enabled()) {
-        const char *algo_name = NULL;
+        const char* algo_name = NULL;
         grpc_stream_compression_algorithm_name(
             call->incoming_stream_compression_algorithm, &algo_name);
         gpr_log(
@@ -1543,7 +1543,7 @@
   } else if (call->incoming_compression_algorithm != GRPC_COMPRESS_NONE) {
     const grpc_compression_algorithm algo =
         call->incoming_compression_algorithm;
-    char *error_msg = NULL;
+    char* error_msg = NULL;
     const grpc_compression_options compression_options =
         grpc_channel_compression_options(call->channel);
     /* check if algorithm is known */
@@ -1556,7 +1556,7 @@
     } else if (grpc_compression_options_is_algorithm_enabled(
                    &compression_options, algo) == 0) {
       /* check if algorithm is supported by current channel config */
-      const char *algo_name = NULL;
+      const char* algo_name = NULL;
       grpc_compression_algorithm_name(algo, &algo_name);
       gpr_asprintf(&error_msg, "Compression algorithm '%s' is disabled.",
                    algo_name);
@@ -1572,7 +1572,7 @@
     if (!GPR_BITGET(call->encodings_accepted_by_peer,
                     call->incoming_compression_algorithm)) {
       if (grpc_compression_trace.enabled()) {
-        const char *algo_name = NULL;
+        const char* algo_name = NULL;
         grpc_compression_algorithm_name(call->incoming_compression_algorithm,
                                         &algo_name);
         gpr_log(GPR_ERROR,
@@ -1585,8 +1585,8 @@
   }
 }
 
-static void add_batch_error(grpc_exec_ctx *exec_ctx, batch_control *bctl,
-                            grpc_error *error, bool has_cancelled) {
+static void add_batch_error(grpc_exec_ctx* exec_ctx, batch_control* bctl,
+                            grpc_error* error, bool has_cancelled) {
   if (error == GRPC_ERROR_NONE) return;
   int idx = (int)gpr_atm_full_fetch_add(&bctl->num_errors, 1);
   if (idx == 0 && !has_cancelled) {
@@ -1596,17 +1596,17 @@
   bctl->errors[idx] = error;
 }
 
-static void receiving_initial_metadata_ready(grpc_exec_ctx *exec_ctx,
-                                             void *bctlp, grpc_error *error) {
-  batch_control *bctl = (batch_control *)bctlp;
-  grpc_call *call = bctl->call;
+static void receiving_initial_metadata_ready(grpc_exec_ctx* exec_ctx,
+                                             void* bctlp, grpc_error* error) {
+  batch_control* bctl = (batch_control*)bctlp;
+  grpc_call* call = bctl->call;
 
   GRPC_CALL_COMBINER_STOP(exec_ctx, &call->call_combiner,
                           "recv_initial_metadata_ready");
 
   add_batch_error(exec_ctx, bctl, GRPC_ERROR_REF(error), false);
   if (error == GRPC_ERROR_NONE) {
-    grpc_metadata_batch *md =
+    grpc_metadata_batch* md =
         &call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */];
     recv_initial_filter(exec_ctx, call, md);
 
@@ -1620,7 +1620,7 @@
     }
   }
 
-  grpc_closure *saved_rsr_closure = NULL;
+  grpc_closure* saved_rsr_closure = NULL;
   while (true) {
     gpr_atm rsr_bctlp = gpr_atm_acq_load(&call->recv_state);
     /* Should only receive initial metadata once */
@@ -1637,9 +1637,9 @@
       }
     } else {
       /* Already received messages */
-      saved_rsr_closure = GRPC_CLOSURE_CREATE(receiving_stream_ready,
-                                              (batch_control *)rsr_bctlp,
-                                              grpc_schedule_on_exec_ctx);
+      saved_rsr_closure =
+          GRPC_CLOSURE_CREATE(receiving_stream_ready, (batch_control*)rsr_bctlp,
+                              grpc_schedule_on_exec_ctx);
       /* No need to modify recv_state */
       break;
     }
@@ -1651,31 +1651,31 @@
   finish_batch_step(exec_ctx, bctl);
 }
 
-static void finish_batch(grpc_exec_ctx *exec_ctx, void *bctlp,
-                         grpc_error *error) {
-  batch_control *bctl = (batch_control *)bctlp;
-  grpc_call *call = bctl->call;
+static void finish_batch(grpc_exec_ctx* exec_ctx, void* bctlp,
+                         grpc_error* error) {
+  batch_control* bctl = (batch_control*)bctlp;
+  grpc_call* call = bctl->call;
   GRPC_CALL_COMBINER_STOP(exec_ctx, &call->call_combiner, "on_complete");
   add_batch_error(exec_ctx, bctl, GRPC_ERROR_REF(error), false);
   finish_batch_step(exec_ctx, bctl);
 }
 
-static void free_no_op_completion(grpc_exec_ctx *exec_ctx, void *p,
-                                  grpc_cq_completion *completion) {
+static void free_no_op_completion(grpc_exec_ctx* exec_ctx, void* p,
+                                  grpc_cq_completion* completion) {
   gpr_free(completion);
 }
 
-static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
-                                        grpc_call *call, const grpc_op *ops,
-                                        size_t nops, void *notify_tag,
+static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx,
+                                        grpc_call* call, const grpc_op* ops,
+                                        size_t nops, void* notify_tag,
                                         int is_notify_tag_closure) {
   size_t i;
-  const grpc_op *op;
-  batch_control *bctl;
+  const grpc_op* op;
+  batch_control* bctl;
   int num_completion_callbacks_needed = 1;
   grpc_call_error error = GRPC_CALL_OK;
-  grpc_transport_stream_op_batch *stream_op;
-  grpc_transport_stream_op_batch_payload *stream_op_payload;
+  grpc_transport_stream_op_batch* stream_op;
+  grpc_transport_stream_op_batch_payload* stream_op_payload;
 
   GPR_TIMER_BEGIN("grpc_call_start_batch", 0);
   GRPC_CALL_LOG_BATCH(GPR_INFO, call, ops, nops, notify_tag);
@@ -1686,9 +1686,9 @@
       grpc_cq_end_op(
           exec_ctx, call->cq, notify_tag, GRPC_ERROR_NONE,
           free_no_op_completion, NULL,
-          (grpc_cq_completion *)gpr_malloc(sizeof(grpc_cq_completion)));
+          (grpc_cq_completion*)gpr_malloc(sizeof(grpc_cq_completion)));
     } else {
-      GRPC_CLOSURE_SCHED(exec_ctx, (grpc_closure *)notify_tag, GRPC_ERROR_NONE);
+      GRPC_CLOSURE_SCHED(exec_ctx, (grpc_closure*)notify_tag, GRPC_ERROR_NONE);
     }
     error = GRPC_CALL_OK;
     goto done;
@@ -1884,7 +1884,7 @@
         call->send_extra_metadata[0].md = grpc_channel_get_reffed_status_elem(
             exec_ctx, call->channel, op->data.send_status_from_server.status);
         {
-          grpc_error *override_error = GRPC_ERROR_NONE;
+          grpc_error* override_error = GRPC_ERROR_NONE;
           if (op->data.send_status_from_server.status != GRPC_STATUS_OK) {
             override_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
                 "Error from server send status");
@@ -1895,7 +1895,7 @@
                 grpc_slice_ref_internal(
                     *op->data.send_status_from_server.status_details));
             call->send_extra_metadata_count++;
-            char *msg = grpc_slice_to_c_string(
+            char* msg = grpc_slice_to_c_string(
                 GRPC_MDVALUE(call->send_extra_metadata[1].md));
             override_error =
                 grpc_error_set_str(override_error, GRPC_ERROR_STR_GRPC_MESSAGE,
@@ -2070,8 +2070,8 @@
   goto done;
 }
 
-grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
-                                      size_t nops, void *tag, void *reserved) {
+grpc_call_error grpc_call_start_batch(grpc_call* call, const grpc_op* ops,
+                                      size_t nops, void* tag, void* reserved) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_call_error err;
 
@@ -2090,16 +2090,16 @@
   return err;
 }
 
-grpc_call_error grpc_call_start_batch_and_execute(grpc_exec_ctx *exec_ctx,
-                                                  grpc_call *call,
-                                                  const grpc_op *ops,
+grpc_call_error grpc_call_start_batch_and_execute(grpc_exec_ctx* exec_ctx,
+                                                  grpc_call* call,
+                                                  const grpc_op* ops,
                                                   size_t nops,
-                                                  grpc_closure *closure) {
+                                                  grpc_closure* closure) {
   return call_start_batch(exec_ctx, call, ops, nops, closure, 1);
 }
 
-void grpc_call_context_set(grpc_call *call, grpc_context_index elem,
-                           void *value, void (*destroy)(void *value)) {
+void grpc_call_context_set(grpc_call* call, grpc_context_index elem,
+                           void* value, void (*destroy)(void* value)) {
   if (call->context[elem].destroy) {
     call->context[elem].destroy(call->context[elem].value);
   }
@@ -2107,20 +2107,20 @@
   call->context[elem].destroy = destroy;
 }
 
-void *grpc_call_context_get(grpc_call *call, grpc_context_index elem) {
+void* grpc_call_context_get(grpc_call* call, grpc_context_index elem) {
   return call->context[elem].value;
 }
 
-uint8_t grpc_call_is_client(grpc_call *call) { return call->is_client; }
+uint8_t grpc_call_is_client(grpc_call* call) { return call->is_client; }
 
 grpc_compression_algorithm grpc_call_compression_for_level(
-    grpc_call *call, grpc_compression_level level) {
+    grpc_call* call, grpc_compression_level level) {
   grpc_compression_algorithm algo =
       compression_algorithm_for_level_locked(call, level);
   return algo;
 }
 
-const char *grpc_call_error_to_string(grpc_call_error error) {
+const char* grpc_call_error_to_string(grpc_call_error error) {
   switch (error) {
     case GRPC_CALL_ERROR:
       return "GRPC_CALL_ERROR";
diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h
index 0fbdf98..07c4e48 100644
--- a/src/core/lib/surface/call.h
+++ b/src/core/lib/surface/call.h
@@ -30,23 +30,23 @@
 #include <grpc/grpc.h>
 #include <grpc/impl/codegen/compression_types.h>
 
-typedef void (*grpc_ioreq_completion_func)(grpc_exec_ctx *exec_ctx,
-                                           grpc_call *call, int success,
-                                           void *user_data);
+typedef void (*grpc_ioreq_completion_func)(grpc_exec_ctx* exec_ctx,
+                                           grpc_call* call, int success,
+                                           void* user_data);
 
 typedef struct grpc_call_create_args {
-  grpc_channel *channel;
+  grpc_channel* channel;
 
-  grpc_call *parent;
+  grpc_call* parent;
   uint32_t propagation_mask;
 
-  grpc_completion_queue *cq;
+  grpc_completion_queue* cq;
   /* if not NULL, it'll be used in lieu of cq */
-  grpc_pollset_set *pollset_set_alternative;
+  grpc_pollset_set* pollset_set_alternative;
 
-  const void *server_transport_data;
+  const void* server_transport_data;
 
-  grpc_mdelem *add_initial_metadata;
+  grpc_mdelem* add_initial_metadata;
   size_t add_initial_metadata_count;
 
   grpc_millis send_deadline;
@@ -55,61 +55,61 @@
 /* Create a new call based on \a args.
    Regardless of success or failure, always returns a valid new call into *call
    */
-grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
-                             const grpc_call_create_args *args,
-                             grpc_call **call);
+grpc_error* grpc_call_create(grpc_exec_ctx* exec_ctx,
+                             const grpc_call_create_args* args,
+                             grpc_call** call);
 
-void grpc_call_set_completion_queue(grpc_exec_ctx *exec_ctx, grpc_call *call,
-                                    grpc_completion_queue *cq);
+void grpc_call_set_completion_queue(grpc_exec_ctx* exec_ctx, grpc_call* call,
+                                    grpc_completion_queue* cq);
 
 #ifndef NDEBUG
-void grpc_call_internal_ref(grpc_call *call, const char *reason);
-void grpc_call_internal_unref(grpc_exec_ctx *exec_ctx, grpc_call *call,
-                              const char *reason);
+void grpc_call_internal_ref(grpc_call* call, const char* reason);
+void grpc_call_internal_unref(grpc_exec_ctx* exec_ctx, grpc_call* call,
+                              const char* reason);
 #define GRPC_CALL_INTERNAL_REF(call, reason) \
   grpc_call_internal_ref(call, reason)
 #define GRPC_CALL_INTERNAL_UNREF(exec_ctx, call, reason) \
   grpc_call_internal_unref(exec_ctx, call, reason)
 #else
-void grpc_call_internal_ref(grpc_call *call);
-void grpc_call_internal_unref(grpc_exec_ctx *exec_ctx, grpc_call *call);
+void grpc_call_internal_ref(grpc_call* call);
+void grpc_call_internal_unref(grpc_exec_ctx* exec_ctx, grpc_call* call);
 #define GRPC_CALL_INTERNAL_REF(call, reason) grpc_call_internal_ref(call)
 #define GRPC_CALL_INTERNAL_UNREF(exec_ctx, call, reason) \
   grpc_call_internal_unref(exec_ctx, call)
 #endif
 
-grpc_call_stack *grpc_call_get_call_stack(grpc_call *call);
+grpc_call_stack* grpc_call_get_call_stack(grpc_call* call);
 
-grpc_call_error grpc_call_start_batch_and_execute(grpc_exec_ctx *exec_ctx,
-                                                  grpc_call *call,
-                                                  const grpc_op *ops,
+grpc_call_error grpc_call_start_batch_and_execute(grpc_exec_ctx* exec_ctx,
+                                                  grpc_call* call,
+                                                  const grpc_op* ops,
                                                   size_t nops,
-                                                  grpc_closure *closure);
+                                                  grpc_closure* closure);
 
 /* Given the top call_element, get the call object. */
-grpc_call *grpc_call_from_top_element(grpc_call_element *surface_element);
+grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element);
 
-void grpc_call_log_batch(const char *file, int line, gpr_log_severity severity,
-                         grpc_call *call, const grpc_op *ops, size_t nops,
-                         void *tag);
+void grpc_call_log_batch(const char* file, int line, gpr_log_severity severity,
+                         grpc_call* call, const grpc_op* ops, size_t nops,
+                         void* tag);
 
 /* Set a context pointer.
    No thread safety guarantees are made wrt this value. */
 /* TODO(#9731): add exec_ctx to destroy */
-void grpc_call_context_set(grpc_call *call, grpc_context_index elem,
-                           void *value, void (*destroy)(void *value));
+void grpc_call_context_set(grpc_call* call, grpc_context_index elem,
+                           void* value, void (*destroy)(void* value));
 /* Get a context pointer. */
-void *grpc_call_context_get(grpc_call *call, grpc_context_index elem);
+void* grpc_call_context_get(grpc_call* call, grpc_context_index elem);
 
 #define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \
   if (grpc_api_trace.enabled()) grpc_call_log_batch(sev, call, ops, nops, tag)
 
-uint8_t grpc_call_is_client(grpc_call *call);
+uint8_t grpc_call_is_client(grpc_call* call);
 
 /* Return an appropriate compression algorithm for the requested compression \a
  * level in the context of \a call. */
 grpc_compression_algorithm grpc_call_compression_for_level(
-    grpc_call *call, grpc_compression_level level);
+    grpc_call* call, grpc_compression_level level);
 
 extern grpc_core::TraceFlag grpc_call_error_trace;
 extern grpc_core::TraceFlag grpc_compression_trace;
diff --git a/src/core/lib/surface/call_log_batch.cc b/src/core/lib/surface/call_log_batch.cc
index 5557927..0309646 100644
--- a/src/core/lib/surface/call_log_batch.cc
+++ b/src/core/lib/surface/call_log_batch.cc
@@ -25,7 +25,7 @@
 #include "src/core/lib/slice/slice_string_helpers.h"
 #include "src/core/lib/support/string.h"
 
-static void add_metadata(gpr_strvec *b, const grpc_metadata *md, size_t count) {
+static void add_metadata(gpr_strvec* b, const grpc_metadata* md, size_t count) {
   size_t i;
   if (md == NULL) {
     gpr_strvec_add(b, gpr_strdup("(nil)"));
@@ -41,9 +41,9 @@
   }
 }
 
-char *grpc_op_string(const grpc_op *op) {
-  char *tmp;
-  char *out;
+char* grpc_op_string(const grpc_op* op) {
+  char* tmp;
+  char* out;
 
   gpr_strvec b;
   gpr_strvec_init(&b);
@@ -105,10 +105,10 @@
   return out;
 }
 
-void grpc_call_log_batch(const char *file, int line, gpr_log_severity severity,
-                         grpc_call *call, const grpc_op *ops, size_t nops,
-                         void *tag) {
-  char *tmp;
+void grpc_call_log_batch(const char* file, int line, gpr_log_severity severity,
+                         grpc_call* call, const grpc_op* ops, size_t nops,
+                         void* tag) {
+  char* tmp;
   size_t i;
   for (i = 0; i < nops; i++) {
     tmp = grpc_op_string(&ops[i]);
diff --git a/src/core/lib/surface/call_test_only.h b/src/core/lib/surface/call_test_only.h
index a5a01b3..2ff4a48 100644
--- a/src/core/lib/surface/call_test_only.h
+++ b/src/core/lib/surface/call_test_only.h
@@ -29,30 +29,30 @@
  *
  * \warning This function should \b only be used in test code. */
 grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
-    grpc_call *call);
+    grpc_call* call);
 
 /** Return the message flags from \a call.
  *
  * \warning This function should \b only be used in test code. */
-uint32_t grpc_call_test_only_get_message_flags(grpc_call *call);
+uint32_t grpc_call_test_only_get_message_flags(grpc_call* call);
 
 /** Returns a bitset for the encodings (compression algorithms) supported by \a
  * call's peer.
  *
  * To be indexed by grpc_compression_algorithm enum values. */
-uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call *call);
+uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call* call);
 
 /** Returns a bitset for the stream encodings (stream compression algorithms)
  * supported by \a call's peer.
  *
  * To be indexed by grpc_stream_compression_algorithm enum values. */
 uint32_t grpc_call_test_only_get_stream_encodings_accepted_by_peer(
-    grpc_call *call);
+    grpc_call* call);
 
 /** Returns the incoming stream compression algorithm (content-encoding header)
  * received by a call. */
 grpc_stream_compression_algorithm
-grpc_call_test_only_get_incoming_stream_encodings(grpc_call *call);
+grpc_call_test_only_get_incoming_stream_encodings(grpc_call* call);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc
index 860dcc8..832cc07 100644
--- a/src/core/lib/surface/channel.cc
+++ b/src/core/lib/surface/channel.cc
@@ -47,7 +47,7 @@
 typedef struct registered_call {
   grpc_mdelem path;
   grpc_mdelem authority;
-  struct registered_call *next;
+  struct registered_call* next;
 } registered_call;
 
 struct grpc_channel {
@@ -58,35 +58,35 @@
   gpr_atm call_size_estimate;
 
   gpr_mu registered_call_mu;
-  registered_call *registered_calls;
+  registered_call* registered_calls;
 
-  char *target;
+  char* target;
 };
 
-#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack *)((c) + 1))
+#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack*)((c) + 1))
 #define CHANNEL_FROM_CHANNEL_STACK(channel_stack) \
-  (((grpc_channel *)(channel_stack)) - 1)
+  (((grpc_channel*)(channel_stack)) - 1)
 #define CHANNEL_FROM_TOP_ELEM(top_elem) \
   CHANNEL_FROM_CHANNEL_STACK(grpc_channel_stack_from_top_element(top_elem))
 
-static void destroy_channel(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_error *error);
+static void destroy_channel(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_error* error);
 
-grpc_channel *grpc_channel_create_with_builder(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder,
+grpc_channel* grpc_channel_create_with_builder(
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder,
     grpc_channel_stack_type channel_stack_type) {
-  char *target = gpr_strdup(grpc_channel_stack_builder_get_target(builder));
-  grpc_channel_args *args = grpc_channel_args_copy(
+  char* target = gpr_strdup(grpc_channel_stack_builder_get_target(builder));
+  grpc_channel_args* args = grpc_channel_args_copy(
       grpc_channel_stack_builder_get_channel_arguments(builder));
-  grpc_channel *channel;
+  grpc_channel* channel;
   if (channel_stack_type == GRPC_SERVER_CHANNEL) {
     GRPC_STATS_INC_SERVER_CHANNELS_CREATED(exec_ctx);
   } else {
     GRPC_STATS_INC_CLIENT_CHANNELS_CREATED(exec_ctx);
   }
-  grpc_error *error = grpc_channel_stack_builder_finish(
+  grpc_error* error = grpc_channel_stack_builder_finish(
       exec_ctx, builder, sizeof(grpc_channel), 1, destroy_channel, NULL,
-      (void **)&channel);
+      (void**)&channel);
   if (error != GRPC_ERROR_NONE) {
     gpr_log(GPR_ERROR, "channel stack builder failed: %s",
             grpc_error_string(error));
@@ -195,11 +195,11 @@
   return channel;
 }
 
-grpc_channel *grpc_channel_create(grpc_exec_ctx *exec_ctx, const char *target,
-                                  const grpc_channel_args *input_args,
+grpc_channel* grpc_channel_create(grpc_exec_ctx* exec_ctx, const char* target,
+                                  const grpc_channel_args* input_args,
                                   grpc_channel_stack_type channel_stack_type,
-                                  grpc_transport *optional_transport) {
-  grpc_channel_stack_builder *builder = grpc_channel_stack_builder_create();
+                                  grpc_transport* optional_transport) {
+  grpc_channel_stack_builder* builder = grpc_channel_stack_builder_create();
   grpc_channel_stack_builder_set_channel_arguments(exec_ctx, builder,
                                                    input_args);
   grpc_channel_stack_builder_set_target(builder, target);
@@ -212,7 +212,7 @@
                                           channel_stack_type);
 }
 
-size_t grpc_channel_get_call_size_estimate(grpc_channel *channel) {
+size_t grpc_channel_get_call_size_estimate(grpc_channel* channel) {
 #define ROUND_UP_SIZE 256
   /* We round up our current estimate to the NEXT value of ROUND_UP_SIZE.
      This ensures:
@@ -225,7 +225,7 @@
          ~(size_t)(ROUND_UP_SIZE - 1);
 }
 
-void grpc_channel_update_call_size_estimate(grpc_channel *channel,
+void grpc_channel_update_call_size_estimate(grpc_channel* channel,
                                             size_t size) {
   size_t cur = (size_t)gpr_atm_no_barrier_load(&channel->call_size_estimate);
   if (cur < size) {
@@ -244,24 +244,24 @@
   }
 }
 
-char *grpc_channel_get_target(grpc_channel *channel) {
+char* grpc_channel_get_target(grpc_channel* channel) {
   GRPC_API_TRACE("grpc_channel_get_target(channel=%p)", 1, (channel));
   return gpr_strdup(channel->target);
 }
 
-void grpc_channel_get_info(grpc_channel *channel,
-                           const grpc_channel_info *channel_info) {
+void grpc_channel_get_info(grpc_channel* channel,
+                           const grpc_channel_info* channel_info) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_channel_element *elem =
+  grpc_channel_element* elem =
       grpc_channel_stack_element(CHANNEL_STACK_FROM_CHANNEL(channel), 0);
   elem->filter->get_channel_info(&exec_ctx, elem, channel_info);
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static grpc_call *grpc_channel_create_call_internal(
-    grpc_exec_ctx *exec_ctx, grpc_channel *channel, grpc_call *parent_call,
-    uint32_t propagation_mask, grpc_completion_queue *cq,
-    grpc_pollset_set *pollset_set_alternative, grpc_mdelem path_mdelem,
+static grpc_call* grpc_channel_create_call_internal(
+    grpc_exec_ctx* exec_ctx, grpc_channel* channel, grpc_call* parent_call,
+    uint32_t propagation_mask, grpc_completion_queue* cq,
+    grpc_pollset_set* pollset_set_alternative, grpc_mdelem path_mdelem,
     grpc_mdelem authority_mdelem, grpc_millis deadline) {
   grpc_mdelem send_metadata[2];
   size_t num_metadata = 0;
@@ -288,20 +288,20 @@
   args.add_initial_metadata_count = num_metadata;
   args.send_deadline = deadline;
 
-  grpc_call *call;
+  grpc_call* call;
   GRPC_LOG_IF_ERROR("call_create", grpc_call_create(exec_ctx, &args, &call));
   return call;
 }
 
-grpc_call *grpc_channel_create_call(grpc_channel *channel,
-                                    grpc_call *parent_call,
+grpc_call* grpc_channel_create_call(grpc_channel* channel,
+                                    grpc_call* parent_call,
                                     uint32_t propagation_mask,
-                                    grpc_completion_queue *cq,
-                                    grpc_slice method, const grpc_slice *host,
-                                    gpr_timespec deadline, void *reserved) {
+                                    grpc_completion_queue* cq,
+                                    grpc_slice method, const grpc_slice* host,
+                                    gpr_timespec deadline, void* reserved) {
   GPR_ASSERT(!reserved);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_call *call = grpc_channel_create_call_internal(
+  grpc_call* call = grpc_channel_create_call_internal(
       &exec_ctx, channel, parent_call, propagation_mask, cq, NULL,
       grpc_mdelem_from_slices(&exec_ctx, GRPC_MDSTR_PATH,
                               grpc_slice_ref_internal(method)),
@@ -313,10 +313,10 @@
   return call;
 }
 
-grpc_call *grpc_channel_create_pollset_set_call(
-    grpc_exec_ctx *exec_ctx, grpc_channel *channel, grpc_call *parent_call,
-    uint32_t propagation_mask, grpc_pollset_set *pollset_set, grpc_slice method,
-    const grpc_slice *host, grpc_millis deadline, void *reserved) {
+grpc_call* grpc_channel_create_pollset_set_call(
+    grpc_exec_ctx* exec_ctx, grpc_channel* channel, grpc_call* parent_call,
+    uint32_t propagation_mask, grpc_pollset_set* pollset_set, grpc_slice method,
+    const grpc_slice* host, grpc_millis deadline, void* reserved) {
   GPR_ASSERT(!reserved);
   return grpc_channel_create_call_internal(
       exec_ctx, channel, parent_call, propagation_mask, NULL, pollset_set,
@@ -328,9 +328,9 @@
       deadline);
 }
 
-void *grpc_channel_register_call(grpc_channel *channel, const char *method,
-                                 const char *host, void *reserved) {
-  registered_call *rc = (registered_call *)gpr_malloc(sizeof(registered_call));
+void* grpc_channel_register_call(grpc_channel* channel, const char* method,
+                                 const char* host, void* reserved) {
+  registered_call* rc = (registered_call*)gpr_malloc(sizeof(registered_call));
   GRPC_API_TRACE(
       "grpc_channel_register_call(channel=%p, method=%s, host=%s, reserved=%p)",
       4, (channel, method, host, reserved));
@@ -353,11 +353,11 @@
   return rc;
 }
 
-grpc_call *grpc_channel_create_registered_call(
-    grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
-    grpc_completion_queue *completion_queue, void *registered_call_handle,
-    gpr_timespec deadline, void *reserved) {
-  registered_call *rc = (registered_call *)registered_call_handle;
+grpc_call* grpc_channel_create_registered_call(
+    grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
+    grpc_completion_queue* completion_queue, void* registered_call_handle,
+    gpr_timespec deadline, void* reserved) {
+  registered_call* rc = (registered_call*)registered_call_handle;
   GRPC_API_TRACE(
       "grpc_channel_create_registered_call("
       "channel=%p, parent_call=%p, propagation_mask=%x, completion_queue=%p, "
@@ -365,12 +365,13 @@
       "deadline=gpr_timespec { tv_sec: %" PRId64
       ", tv_nsec: %d, clock_type: %d }, "
       "reserved=%p)",
-      9, (channel, parent_call, (unsigned)propagation_mask, completion_queue,
-          registered_call_handle, deadline.tv_sec, deadline.tv_nsec,
-          (int)deadline.clock_type, reserved));
+      9,
+      (channel, parent_call, (unsigned)propagation_mask, completion_queue,
+       registered_call_handle, deadline.tv_sec, deadline.tv_nsec,
+       (int)deadline.clock_type, reserved));
   GPR_ASSERT(!reserved);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_call *call = grpc_channel_create_call_internal(
+  grpc_call* call = grpc_channel_create_call_internal(
       &exec_ctx, channel, parent_call, propagation_mask, completion_queue, NULL,
       GRPC_MDELEM_REF(rc->path), GRPC_MDELEM_REF(rc->authority),
       grpc_timespec_to_millis_round_up(deadline));
@@ -380,26 +381,26 @@
 
 #ifndef NDEBUG
 #define REF_REASON reason
-#define REF_ARG , const char *reason
+#define REF_ARG , const char* reason
 #else
 #define REF_REASON ""
 #define REF_ARG
 #endif
-void grpc_channel_internal_ref(grpc_channel *c REF_ARG) {
+void grpc_channel_internal_ref(grpc_channel* c REF_ARG) {
   GRPC_CHANNEL_STACK_REF(CHANNEL_STACK_FROM_CHANNEL(c), REF_REASON);
 }
 
-void grpc_channel_internal_unref(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel *c REF_ARG) {
+void grpc_channel_internal_unref(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel* c REF_ARG) {
   GRPC_CHANNEL_STACK_UNREF(exec_ctx, CHANNEL_STACK_FROM_CHANNEL(c), REF_REASON);
 }
 
-static void destroy_channel(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_error *error) {
-  grpc_channel *channel = (grpc_channel *)arg;
+static void destroy_channel(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_error* error) {
+  grpc_channel* channel = (grpc_channel*)arg;
   grpc_channel_stack_destroy(exec_ctx, CHANNEL_STACK_FROM_CHANNEL(channel));
   while (channel->registered_calls) {
-    registered_call *rc = channel->registered_calls;
+    registered_call* rc = channel->registered_calls;
     channel->registered_calls = rc->next;
     GRPC_MDELEM_UNREF(exec_ctx, rc->path);
     GRPC_MDELEM_UNREF(exec_ctx, rc->authority);
@@ -411,9 +412,9 @@
   gpr_free(channel);
 }
 
-void grpc_channel_destroy(grpc_channel *channel) {
-  grpc_transport_op *op = grpc_make_transport_op(NULL);
-  grpc_channel_element *elem;
+void grpc_channel_destroy(grpc_channel* channel) {
+  grpc_transport_op* op = grpc_make_transport_op(NULL);
+  grpc_channel_element* elem;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GRPC_API_TRACE("grpc_channel_destroy(channel=%p)", 1, (channel));
   op->disconnect_with_error =
@@ -426,17 +427,17 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-grpc_channel_stack *grpc_channel_get_channel_stack(grpc_channel *channel) {
+grpc_channel_stack* grpc_channel_get_channel_stack(grpc_channel* channel) {
   return CHANNEL_STACK_FROM_CHANNEL(channel);
 }
 
 grpc_compression_options grpc_channel_compression_options(
-    const grpc_channel *channel) {
+    const grpc_channel* channel) {
   return channel->compression_options;
 }
 
-grpc_mdelem grpc_channel_get_reffed_status_elem(grpc_exec_ctx *exec_ctx,
-                                                grpc_channel *channel, int i) {
+grpc_mdelem grpc_channel_get_reffed_status_elem(grpc_exec_ctx* exec_ctx,
+                                                grpc_channel* channel, int i) {
   char tmp[GPR_LTOA_MIN_BUFSIZE];
   switch (i) {
     case 0:
diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h
index 4d1c7e3..063e685 100644
--- a/src/core/lib/surface/channel.h
+++ b/src/core/lib/surface/channel.h
@@ -27,13 +27,13 @@
 extern "C" {
 #endif
 
-grpc_channel *grpc_channel_create(grpc_exec_ctx *exec_ctx, const char *target,
-                                  const grpc_channel_args *args,
+grpc_channel* grpc_channel_create(grpc_exec_ctx* exec_ctx, const char* target,
+                                  const grpc_channel_args* args,
                                   grpc_channel_stack_type channel_stack_type,
-                                  grpc_transport *optional_transport);
+                                  grpc_transport* optional_transport);
 
-grpc_channel *grpc_channel_create_with_builder(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder,
+grpc_channel* grpc_channel_create_with_builder(
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder,
     grpc_channel_stack_type channel_stack_type);
 
 /** Create a call given a grpc_channel, in order to call \a method.
@@ -44,37 +44,37 @@
     non-NULL, it must be a server-side call. It will be used to propagate
     properties from the server call to this new client call, depending on the
     value of \a propagation_mask (see propagation_bits.h for possible values) */
-grpc_call *grpc_channel_create_pollset_set_call(
-    grpc_exec_ctx *exec_ctx, grpc_channel *channel, grpc_call *parent_call,
-    uint32_t propagation_mask, grpc_pollset_set *pollset_set, grpc_slice method,
-    const grpc_slice *host, grpc_millis deadline, void *reserved);
+grpc_call* grpc_channel_create_pollset_set_call(
+    grpc_exec_ctx* exec_ctx, grpc_channel* channel, grpc_call* parent_call,
+    uint32_t propagation_mask, grpc_pollset_set* pollset_set, grpc_slice method,
+    const grpc_slice* host, grpc_millis deadline, void* reserved);
 
 /** Get a (borrowed) pointer to this channels underlying channel stack */
-grpc_channel_stack *grpc_channel_get_channel_stack(grpc_channel *channel);
+grpc_channel_stack* grpc_channel_get_channel_stack(grpc_channel* channel);
 
 /** Get a grpc_mdelem of grpc-status: X where X is the numeric value of
     status_code.
 
     The returned elem is owned by the caller. */
-grpc_mdelem grpc_channel_get_reffed_status_elem(grpc_exec_ctx *exec_ctx,
-                                                grpc_channel *channel,
+grpc_mdelem grpc_channel_get_reffed_status_elem(grpc_exec_ctx* exec_ctx,
+                                                grpc_channel* channel,
                                                 int status_code);
 
-size_t grpc_channel_get_call_size_estimate(grpc_channel *channel);
-void grpc_channel_update_call_size_estimate(grpc_channel *channel, size_t size);
+size_t grpc_channel_get_call_size_estimate(grpc_channel* channel);
+void grpc_channel_update_call_size_estimate(grpc_channel* channel, size_t size);
 
 #ifndef NDEBUG
-void grpc_channel_internal_ref(grpc_channel *channel, const char *reason);
-void grpc_channel_internal_unref(grpc_exec_ctx *exec_ctx, grpc_channel *channel,
-                                 const char *reason);
+void grpc_channel_internal_ref(grpc_channel* channel, const char* reason);
+void grpc_channel_internal_unref(grpc_exec_ctx* exec_ctx, grpc_channel* channel,
+                                 const char* reason);
 #define GRPC_CHANNEL_INTERNAL_REF(channel, reason) \
   grpc_channel_internal_ref(channel, reason)
 #define GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel, reason) \
   grpc_channel_internal_unref(exec_ctx, channel, reason)
 #else
-void grpc_channel_internal_ref(grpc_channel *channel);
-void grpc_channel_internal_unref(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel *channel);
+void grpc_channel_internal_ref(grpc_channel* channel);
+void grpc_channel_internal_unref(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel* channel);
 #define GRPC_CHANNEL_INTERNAL_REF(channel, reason) \
   grpc_channel_internal_ref(channel)
 #define GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel, reason) \
@@ -83,7 +83,7 @@
 
 /** Return the channel's compression options. */
 grpc_compression_options grpc_channel_compression_options(
-    const grpc_channel *channel);
+    const grpc_channel* channel);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/surface/channel_init.cc b/src/core/lib/surface/channel_init.cc
index 33f444b..17d8caf 100644
--- a/src/core/lib/surface/channel_init.cc
+++ b/src/core/lib/surface/channel_init.cc
@@ -23,13 +23,13 @@
 
 typedef struct stage_slot {
   grpc_channel_init_stage fn;
-  void *arg;
+  void* arg;
   int priority;
   size_t insertion_order;
 } stage_slot;
 
 typedef struct stage_slots {
-  stage_slot *slots;
+  stage_slot* slots;
   size_t num_slots;
   size_t cap_slots;
 } stage_slots;
@@ -49,24 +49,24 @@
 void grpc_channel_init_register_stage(grpc_channel_stack_type type,
                                       int priority,
                                       grpc_channel_init_stage stage,
-                                      void *stage_arg) {
+                                      void* stage_arg) {
   GPR_ASSERT(!g_finalized);
   if (g_slots[type].cap_slots == g_slots[type].num_slots) {
     g_slots[type].cap_slots = GPR_MAX(8, 3 * g_slots[type].cap_slots / 2);
-    g_slots[type].slots = (stage_slot *)gpr_realloc(
+    g_slots[type].slots = (stage_slot*)gpr_realloc(
         g_slots[type].slots,
         g_slots[type].cap_slots * sizeof(*g_slots[type].slots));
   }
-  stage_slot *s = &g_slots[type].slots[g_slots[type].num_slots++];
+  stage_slot* s = &g_slots[type].slots[g_slots[type].num_slots++];
   s->insertion_order = g_slots[type].num_slots;
   s->priority = priority;
   s->fn = stage;
   s->arg = stage_arg;
 }
 
-static int compare_slots(const void *a, const void *b) {
-  const stage_slot *sa = (const stage_slot *)a;
-  const stage_slot *sb = (const stage_slot *)b;
+static int compare_slots(const void* a, const void* b) {
+  const stage_slot* sa = (const stage_slot*)a;
+  const stage_slot* sb = (const stage_slot*)b;
 
   int c = GPR_ICMP(sa->priority, sb->priority);
   if (c != 0) return c;
@@ -85,12 +85,12 @@
 void grpc_channel_init_shutdown(void) {
   for (int i = 0; i < GRPC_NUM_CHANNEL_STACK_TYPES; i++) {
     gpr_free(g_slots[i].slots);
-    g_slots[i].slots = (stage_slot *)(void *)(uintptr_t)0xdeadbeef;
+    g_slots[i].slots = (stage_slot*)(void*)(uintptr_t)0xdeadbeef;
   }
 }
 
-bool grpc_channel_init_create_stack(grpc_exec_ctx *exec_ctx,
-                                    grpc_channel_stack_builder *builder,
+bool grpc_channel_init_create_stack(grpc_exec_ctx* exec_ctx,
+                                    grpc_channel_stack_builder* builder,
                                     grpc_channel_stack_type type) {
   GPR_ASSERT(g_finalized);
 
@@ -98,7 +98,7 @@
                                       grpc_channel_stack_type_string(type));
 
   for (size_t i = 0; i < g_slots[type].num_slots; i++) {
-    const stage_slot *slot = &g_slots[type].slots[i];
+    const stage_slot* slot = &g_slots[type].slots[i];
     if (!slot->fn(exec_ctx, builder, slot->arg)) {
       return false;
     }
diff --git a/src/core/lib/surface/channel_init.h b/src/core/lib/surface/channel_init.h
index 5f10933..9932781 100644
--- a/src/core/lib/surface/channel_init.h
+++ b/src/core/lib/surface/channel_init.h
@@ -36,9 +36,9 @@
 
 /// One stage of mutation: call functions against \a builder to influence the
 /// finally constructed channel stack
-typedef bool (*grpc_channel_init_stage)(grpc_exec_ctx *exec_ctx,
-                                        grpc_channel_stack_builder *builder,
-                                        void *arg);
+typedef bool (*grpc_channel_init_stage)(grpc_exec_ctx* exec_ctx,
+                                        grpc_channel_stack_builder* builder,
+                                        void* arg);
 
 /// Global initialization of the system
 void grpc_channel_init_init(void);
@@ -51,7 +51,7 @@
 void grpc_channel_init_register_stage(grpc_channel_stack_type type,
                                       int priority,
                                       grpc_channel_init_stage stage_fn,
-                                      void *stage_arg);
+                                      void* stage_arg);
 
 /// Finalize registration. No more calls to grpc_channel_init_register_stage are
 /// allowed.
@@ -70,8 +70,8 @@
 /// \a optional_transport is either NULL or a constructed transport object
 /// Returns a pointer to the base of the memory allocated (the actual channel
 /// stack object will be prefix_bytes past that pointer)
-bool grpc_channel_init_create_stack(grpc_exec_ctx *exec_ctx,
-                                    grpc_channel_stack_builder *builder,
+bool grpc_channel_init_create_stack(grpc_exec_ctx* exec_ctx,
+                                    grpc_channel_stack_builder* builder,
                                     grpc_channel_stack_type type);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/surface/channel_ping.cc b/src/core/lib/surface/channel_ping.cc
index f45b568..5660bb8 100644
--- a/src/core/lib/surface/channel_ping.cc
+++ b/src/core/lib/surface/channel_ping.cc
@@ -28,29 +28,29 @@
 
 typedef struct {
   grpc_closure closure;
-  void *tag;
-  grpc_completion_queue *cq;
+  void* tag;
+  grpc_completion_queue* cq;
   grpc_cq_completion completion_storage;
 } ping_result;
 
-static void ping_destroy(grpc_exec_ctx *exec_ctx, void *arg,
-                         grpc_cq_completion *storage) {
+static void ping_destroy(grpc_exec_ctx* exec_ctx, void* arg,
+                         grpc_cq_completion* storage) {
   gpr_free(arg);
 }
 
-static void ping_done(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  ping_result *pr = (ping_result *)arg;
+static void ping_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  ping_result* pr = (ping_result*)arg;
   grpc_cq_end_op(exec_ctx, pr->cq, pr->tag, GRPC_ERROR_REF(error), ping_destroy,
                  pr, &pr->completion_storage);
 }
 
-void grpc_channel_ping(grpc_channel *channel, grpc_completion_queue *cq,
-                       void *tag, void *reserved) {
+void grpc_channel_ping(grpc_channel* channel, grpc_completion_queue* cq,
+                       void* tag, void* reserved) {
   GRPC_API_TRACE("grpc_channel_ping(channel=%p, cq=%p, tag=%p, reserved=%p)", 4,
                  (channel, cq, tag, reserved));
-  grpc_transport_op *op = grpc_make_transport_op(NULL);
-  ping_result *pr = (ping_result *)gpr_malloc(sizeof(*pr));
-  grpc_channel_element *top_elem =
+  grpc_transport_op* op = grpc_make_transport_op(NULL);
+  ping_result* pr = (ping_result*)gpr_malloc(sizeof(*pr));
+  grpc_channel_element* top_elem =
       grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0);
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GPR_ASSERT(reserved == NULL);
diff --git a/src/core/lib/surface/channel_stack_type.cc b/src/core/lib/surface/channel_stack_type.cc
index 5f5c877..366c452 100644
--- a/src/core/lib/surface/channel_stack_type.cc
+++ b/src/core/lib/surface/channel_stack_type.cc
@@ -38,7 +38,7 @@
   GPR_UNREACHABLE_CODE(return true;);
 }
 
-const char *grpc_channel_stack_type_string(grpc_channel_stack_type type) {
+const char* grpc_channel_stack_type_string(grpc_channel_stack_type type) {
   switch (type) {
     case GRPC_CLIENT_CHANNEL:
       return "CLIENT_CHANNEL";
diff --git a/src/core/lib/surface/channel_stack_type.h b/src/core/lib/surface/channel_stack_type.h
index c778487..feecd3a 100644
--- a/src/core/lib/surface/channel_stack_type.h
+++ b/src/core/lib/surface/channel_stack_type.h
@@ -44,7 +44,7 @@
 
 bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type);
 
-const char *grpc_channel_stack_type_string(grpc_channel_stack_type type);
+const char* grpc_channel_stack_type_string(grpc_channel_stack_type type);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc
index 5c35e44..8e74a0a 100644
--- a/src/core/lib/surface/completion_queue.cc
+++ b/src/core/lib/surface/completion_queue.cc
@@ -28,6 +28,7 @@
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 #include <grpc/support/time.h>
+#include <grpc/support/tls.h>
 
 #include "src/core/lib/debug/stats.h"
 #include "src/core/lib/iomgr/pollset.h"
@@ -45,63 +46,71 @@
 grpc_core::TraceFlag grpc_trace_cq_refcount(false, "cq_refcount");
 #endif
 
+// Specifies a cq thread local cache.
+// The first event that occurs on a thread
+// with a cq cache will go into that cache, and
+// will only be returned on the thread that initialized the cache.
+// NOTE: Only one event will ever be cached.
+GPR_TLS_DECL(g_cached_event);
+GPR_TLS_DECL(g_cached_cq);
+
 typedef struct {
-  grpc_pollset_worker **worker;
-  void *tag;
+  grpc_pollset_worker** worker;
+  void* tag;
 } plucker;
 
 typedef struct {
   bool can_get_pollset;
   bool can_listen;
   size_t (*size)(void);
-  void (*init)(grpc_pollset *pollset, gpr_mu **mu);
-  grpc_error *(*kick)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                      grpc_pollset_worker *specific_worker);
-  grpc_error *(*work)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                      grpc_pollset_worker **worker, grpc_millis deadline);
-  void (*shutdown)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                   grpc_closure *closure);
-  void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset);
+  void (*init)(grpc_pollset* pollset, gpr_mu** mu);
+  grpc_error* (*kick)(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                      grpc_pollset_worker* specific_worker);
+  grpc_error* (*work)(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                      grpc_pollset_worker** worker, grpc_millis deadline);
+  void (*shutdown)(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+                   grpc_closure* closure);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_pollset* pollset);
 } cq_poller_vtable;
 
 typedef struct non_polling_worker {
   gpr_cv cv;
   bool kicked;
-  struct non_polling_worker *next;
-  struct non_polling_worker *prev;
+  struct non_polling_worker* next;
+  struct non_polling_worker* prev;
 } non_polling_worker;
 
 typedef struct {
   gpr_mu mu;
-  non_polling_worker *root;
-  grpc_closure *shutdown;
+  non_polling_worker* root;
+  grpc_closure* shutdown;
 } non_polling_poller;
 
 static size_t non_polling_poller_size(void) {
   return sizeof(non_polling_poller);
 }
 
-static void non_polling_poller_init(grpc_pollset *pollset, gpr_mu **mu) {
-  non_polling_poller *npp = (non_polling_poller *)pollset;
+static void non_polling_poller_init(grpc_pollset* pollset, gpr_mu** mu) {
+  non_polling_poller* npp = (non_polling_poller*)pollset;
   gpr_mu_init(&npp->mu);
   *mu = &npp->mu;
 }
 
-static void non_polling_poller_destroy(grpc_exec_ctx *exec_ctx,
-                                       grpc_pollset *pollset) {
-  non_polling_poller *npp = (non_polling_poller *)pollset;
+static void non_polling_poller_destroy(grpc_exec_ctx* exec_ctx,
+                                       grpc_pollset* pollset) {
+  non_polling_poller* npp = (non_polling_poller*)pollset;
   gpr_mu_destroy(&npp->mu);
 }
 
-static grpc_error *non_polling_poller_work(grpc_exec_ctx *exec_ctx,
-                                           grpc_pollset *pollset,
-                                           grpc_pollset_worker **worker,
+static grpc_error* non_polling_poller_work(grpc_exec_ctx* exec_ctx,
+                                           grpc_pollset* pollset,
+                                           grpc_pollset_worker** worker,
                                            grpc_millis deadline) {
-  non_polling_poller *npp = (non_polling_poller *)pollset;
+  non_polling_poller* npp = (non_polling_poller*)pollset;
   if (npp->shutdown) return GRPC_ERROR_NONE;
   non_polling_worker w;
   gpr_cv_init(&w.cv);
-  if (worker != NULL) *worker = (grpc_pollset_worker *)&w;
+  if (worker != NULL) *worker = (grpc_pollset_worker*)&w;
   if (npp->root == NULL) {
     npp->root = w.next = w.prev = &w;
   } else {
@@ -115,6 +124,7 @@
   while (!npp->shutdown && !w.kicked &&
          !gpr_cv_wait(&w.cv, &npp->mu, deadline_ts))
     ;
+  grpc_exec_ctx_invalidate_now(exec_ctx);
   if (&w == npp->root) {
     npp->root = w.next;
     if (&w == npp->root) {
@@ -131,13 +141,13 @@
   return GRPC_ERROR_NONE;
 }
 
-static grpc_error *non_polling_poller_kick(
-    grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-    grpc_pollset_worker *specific_worker) {
-  non_polling_poller *p = (non_polling_poller *)pollset;
-  if (specific_worker == NULL) specific_worker = (grpc_pollset_worker *)p->root;
+static grpc_error* non_polling_poller_kick(
+    grpc_exec_ctx* exec_ctx, grpc_pollset* pollset,
+    grpc_pollset_worker* specific_worker) {
+  non_polling_poller* p = (non_polling_poller*)pollset;
+  if (specific_worker == NULL) specific_worker = (grpc_pollset_worker*)p->root;
   if (specific_worker != NULL) {
-    non_polling_worker *w = (non_polling_worker *)specific_worker;
+    non_polling_worker* w = (non_polling_worker*)specific_worker;
     if (!w->kicked) {
       w->kicked = true;
       gpr_cv_signal(&w->cv);
@@ -146,16 +156,16 @@
   return GRPC_ERROR_NONE;
 }
 
-static void non_polling_poller_shutdown(grpc_exec_ctx *exec_ctx,
-                                        grpc_pollset *pollset,
-                                        grpc_closure *closure) {
-  non_polling_poller *p = (non_polling_poller *)pollset;
+static void non_polling_poller_shutdown(grpc_exec_ctx* exec_ctx,
+                                        grpc_pollset* pollset,
+                                        grpc_closure* closure) {
+  non_polling_poller* p = (non_polling_poller*)pollset;
   GPR_ASSERT(closure != NULL);
   p->shutdown = closure;
   if (p->root == NULL) {
     GRPC_CLOSURE_SCHED(exec_ctx, closure, GRPC_ERROR_NONE);
   } else {
-    non_polling_worker *w = p->root;
+    non_polling_worker* w = p->root;
     do {
       gpr_cv_signal(&w->cv);
       w = w->next;
@@ -179,19 +189,19 @@
 typedef struct cq_vtable {
   grpc_cq_completion_type cq_completion_type;
   size_t data_size;
-  void (*init)(void *data);
-  void (*shutdown)(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cq);
-  void (*destroy)(void *data);
-  bool (*begin_op)(grpc_completion_queue *cq, void *tag);
-  void (*end_op)(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cq, void *tag,
-                 grpc_error *error,
-                 void (*done)(grpc_exec_ctx *exec_ctx, void *done_arg,
-                              grpc_cq_completion *storage),
-                 void *done_arg, grpc_cq_completion *storage);
-  grpc_event (*next)(grpc_completion_queue *cq, gpr_timespec deadline,
-                     void *reserved);
-  grpc_event (*pluck)(grpc_completion_queue *cq, void *tag,
-                      gpr_timespec deadline, void *reserved);
+  void (*init)(void* data);
+  void (*shutdown)(grpc_exec_ctx* exec_ctx, grpc_completion_queue* cq);
+  void (*destroy)(void* data);
+  bool (*begin_op)(grpc_completion_queue* cq, void* tag);
+  void (*end_op)(grpc_exec_ctx* exec_ctx, grpc_completion_queue* cq, void* tag,
+                 grpc_error* error,
+                 void (*done)(grpc_exec_ctx* exec_ctx, void* done_arg,
+                              grpc_cq_completion* storage),
+                 void* done_arg, grpc_cq_completion* storage);
+  grpc_event (*next)(grpc_completion_queue* cq, gpr_timespec deadline,
+                     void* reserved);
+  grpc_event (*pluck)(grpc_completion_queue* cq, void* tag,
+                      gpr_timespec deadline, void* reserved);
 } cq_vtable;
 
 /* Queue that holds the cq_completion_events. Internally uses gpr_mpscq queue
@@ -228,7 +238,7 @@
 typedef struct cq_pluck_data {
   /** Completed events for completion-queues of type GRPC_CQ_PLUCK */
   grpc_cq_completion completed_head;
-  grpc_cq_completion *completed_tail;
+  grpc_cq_completion* completed_tail;
 
   /** Number of pending events (+1 if we're not shutdown) */
   gpr_atm pending_events;
@@ -255,13 +265,13 @@
   /** Once owning_refs drops to zero, we will destroy the cq */
   gpr_refcount owning_refs;
 
-  gpr_mu *mu;
+  gpr_mu* mu;
 
-  const cq_vtable *vtable;
-  const cq_poller_vtable *poller_vtable;
+  const cq_vtable* vtable;
+  const cq_poller_vtable* poller_vtable;
 
 #ifndef NDEBUG
-  void **outstanding_tags;
+  void** outstanding_tags;
   size_t outstanding_tag_count;
   size_t outstanding_tag_capacity;
 #endif
@@ -271,44 +281,44 @@
 };
 
 /* Forward declarations */
-static void cq_finish_shutdown_next(grpc_exec_ctx *exec_ctx,
-                                    grpc_completion_queue *cq);
-static void cq_finish_shutdown_pluck(grpc_exec_ctx *exec_ctx,
-                                     grpc_completion_queue *cq);
-static void cq_shutdown_next(grpc_exec_ctx *exec_ctx,
-                             grpc_completion_queue *cq);
-static void cq_shutdown_pluck(grpc_exec_ctx *exec_ctx,
-                              grpc_completion_queue *cq);
+static void cq_finish_shutdown_next(grpc_exec_ctx* exec_ctx,
+                                    grpc_completion_queue* cq);
+static void cq_finish_shutdown_pluck(grpc_exec_ctx* exec_ctx,
+                                     grpc_completion_queue* cq);
+static void cq_shutdown_next(grpc_exec_ctx* exec_ctx,
+                             grpc_completion_queue* cq);
+static void cq_shutdown_pluck(grpc_exec_ctx* exec_ctx,
+                              grpc_completion_queue* cq);
 
-static bool cq_begin_op_for_next(grpc_completion_queue *cq, void *tag);
-static bool cq_begin_op_for_pluck(grpc_completion_queue *cq, void *tag);
+static bool cq_begin_op_for_next(grpc_completion_queue* cq, void* tag);
+static bool cq_begin_op_for_pluck(grpc_completion_queue* cq, void* tag);
 
-static void cq_end_op_for_next(grpc_exec_ctx *exec_ctx,
-                               grpc_completion_queue *cq, void *tag,
-                               grpc_error *error,
-                               void (*done)(grpc_exec_ctx *exec_ctx,
-                                            void *done_arg,
-                                            grpc_cq_completion *storage),
-                               void *done_arg, grpc_cq_completion *storage);
+static void cq_end_op_for_next(grpc_exec_ctx* exec_ctx,
+                               grpc_completion_queue* cq, void* tag,
+                               grpc_error* error,
+                               void (*done)(grpc_exec_ctx* exec_ctx,
+                                            void* done_arg,
+                                            grpc_cq_completion* storage),
+                               void* done_arg, grpc_cq_completion* storage);
 
-static void cq_end_op_for_pluck(grpc_exec_ctx *exec_ctx,
-                                grpc_completion_queue *cq, void *tag,
-                                grpc_error *error,
-                                void (*done)(grpc_exec_ctx *exec_ctx,
-                                             void *done_arg,
-                                             grpc_cq_completion *storage),
-                                void *done_arg, grpc_cq_completion *storage);
+static void cq_end_op_for_pluck(grpc_exec_ctx* exec_ctx,
+                                grpc_completion_queue* cq, void* tag,
+                                grpc_error* error,
+                                void (*done)(grpc_exec_ctx* exec_ctx,
+                                             void* done_arg,
+                                             grpc_cq_completion* storage),
+                                void* done_arg, grpc_cq_completion* storage);
 
-static grpc_event cq_next(grpc_completion_queue *cq, gpr_timespec deadline,
-                          void *reserved);
+static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
+                          void* reserved);
 
-static grpc_event cq_pluck(grpc_completion_queue *cq, void *tag,
-                           gpr_timespec deadline, void *reserved);
+static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
+                           gpr_timespec deadline, void* reserved);
 
-static void cq_init_next(void *data);
-static void cq_init_pluck(void *data);
-static void cq_destroy_next(void *data);
-static void cq_destroy_pluck(void *data);
+static void cq_init_next(void* data);
+static void cq_init_pluck(void* data);
+static void cq_destroy_next(void* data);
+static void cq_destroy_pluck(void* data);
 
 /* Completion queue vtables based on the completion-type */
 static const cq_vtable g_cq_vtable[] = {
@@ -321,48 +331,89 @@
      cq_pluck},
 };
 
-#define DATA_FROM_CQ(cq) ((void *)(cq + 1))
+#define DATA_FROM_CQ(cq) ((void*)(cq + 1))
 #define POLLSET_FROM_CQ(cq) \
-  ((grpc_pollset *)(cq->vtable->data_size + (char *)DATA_FROM_CQ(cq)))
+  ((grpc_pollset*)(cq->vtable->data_size + (char*)DATA_FROM_CQ(cq)))
 
 grpc_core::TraceFlag grpc_cq_pluck_trace(true, "queue_pluck");
 grpc_core::TraceFlag grpc_cq_event_timeout_trace(true, "queue_timeout");
 
-#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event)                       \
-  if (grpc_api_trace.enabled() && (grpc_cq_pluck_trace.enabled() ||        \
-                                   (event)->type != GRPC_QUEUE_TIMEOUT)) { \
-    char *_ev = grpc_event_string(event);                                  \
-    gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev);                    \
-    gpr_free(_ev);                                                         \
+#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event)    \
+  if (grpc_api_trace.enabled() &&                 \
+      (grpc_cq_pluck_trace.enabled() ||           \
+       (event)->type != GRPC_QUEUE_TIMEOUT)) {          \
+    char* _ev = grpc_event_string(event);               \
+    gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \
+    gpr_free(_ev);                                      \
   }
 
-static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *cq,
-                                     grpc_error *error);
+static void on_pollset_shutdown_done(grpc_exec_ctx* exec_ctx, void* cq,
+                                     grpc_error* error);
 
-static void cq_event_queue_init(grpc_cq_event_queue *q) {
+void grpc_cq_global_init() {
+  gpr_tls_init(&g_cached_event);
+  gpr_tls_init(&g_cached_cq);
+}
+
+void grpc_completion_queue_thread_local_cache_init(grpc_completion_queue* cq) {
+  if ((grpc_completion_queue*)gpr_tls_get(&g_cached_cq) == nullptr) {
+    gpr_tls_set(&g_cached_event, (intptr_t)0);
+    gpr_tls_set(&g_cached_cq, (intptr_t)cq);
+  }
+}
+
+int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue* cq,
+                                                   void** tag, int* ok) {
+  grpc_cq_completion* storage =
+      (grpc_cq_completion*)gpr_tls_get(&g_cached_event);
+  int ret = 0;
+  if (storage != NULL &&
+      (grpc_completion_queue*)gpr_tls_get(&g_cached_cq) == cq) {
+    *tag = storage->tag;
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    *ok = (storage->next & (uintptr_t)(1)) == 1;
+    storage->done(&exec_ctx, storage->done_arg, storage);
+    ret = 1;
+    cq_next_data* cqd = (cq_next_data*)DATA_FROM_CQ(cq);
+    if (gpr_atm_full_fetch_add(&cqd->pending_events, -1) == 1) {
+      GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
+      gpr_mu_lock(cq->mu);
+      cq_finish_shutdown_next(&exec_ctx, cq);
+      gpr_mu_unlock(cq->mu);
+      GRPC_CQ_INTERNAL_UNREF(&exec_ctx, cq, "shutting_down");
+    }
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  gpr_tls_set(&g_cached_event, (intptr_t)0);
+  gpr_tls_set(&g_cached_cq, (intptr_t)0);
+
+  return ret;
+}
+
+static void cq_event_queue_init(grpc_cq_event_queue* q) {
   gpr_mpscq_init(&q->queue);
   q->queue_lock = GPR_SPINLOCK_INITIALIZER;
   gpr_atm_no_barrier_store(&q->num_queue_items, 0);
 }
 
-static void cq_event_queue_destroy(grpc_cq_event_queue *q) {
+static void cq_event_queue_destroy(grpc_cq_event_queue* q) {
   gpr_mpscq_destroy(&q->queue);
 }
 
-static bool cq_event_queue_push(grpc_cq_event_queue *q, grpc_cq_completion *c) {
-  gpr_mpscq_push(&q->queue, (gpr_mpscq_node *)c);
+static bool cq_event_queue_push(grpc_cq_event_queue* q, grpc_cq_completion* c) {
+  gpr_mpscq_push(&q->queue, (gpr_mpscq_node*)c);
   return gpr_atm_no_barrier_fetch_add(&q->num_queue_items, 1) == 0;
 }
 
-static grpc_cq_completion *cq_event_queue_pop(grpc_cq_event_queue *q) {
-  grpc_cq_completion *c = NULL;
+static grpc_cq_completion* cq_event_queue_pop(grpc_cq_event_queue* q) {
+  grpc_cq_completion* c = NULL;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
   if (gpr_spinlock_trylock(&q->queue_lock)) {
     GRPC_STATS_INC_CQ_EV_QUEUE_TRYLOCK_SUCCESSES(&exec_ctx);
 
     bool is_empty = false;
-    c = (grpc_cq_completion *)gpr_mpscq_pop_and_check_end(&q->queue, &is_empty);
+    c = (grpc_cq_completion*)gpr_mpscq_pop_and_check_end(&q->queue, &is_empty);
     gpr_spinlock_unlock(&q->queue_lock);
 
     if (c == NULL && !is_empty) {
@@ -383,14 +434,14 @@
 
 /* Note: The counter is not incremented/decremented atomically with push/pop.
  * The count is only eventually consistent */
-static long cq_event_queue_num_items(grpc_cq_event_queue *q) {
+static long cq_event_queue_num_items(grpc_cq_event_queue* q) {
   return (long)gpr_atm_no_barrier_load(&q->num_queue_items);
 }
 
-grpc_completion_queue *grpc_completion_queue_create_internal(
+grpc_completion_queue* grpc_completion_queue_create_internal(
     grpc_cq_completion_type completion_type,
     grpc_cq_polling_type polling_type) {
-  grpc_completion_queue *cq;
+  grpc_completion_queue* cq;
 
   GPR_TIMER_BEGIN("grpc_completion_queue_create_internal", 0);
 
@@ -399,17 +450,17 @@
       "polling_type=%d)",
       2, (completion_type, polling_type));
 
-  const cq_vtable *vtable = &g_cq_vtable[completion_type];
-  const cq_poller_vtable *poller_vtable =
+  const cq_vtable* vtable = &g_cq_vtable[completion_type];
+  const cq_poller_vtable* poller_vtable =
       &g_poller_vtable_by_poller_type[polling_type];
 
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GRPC_STATS_INC_CQS_CREATED(&exec_ctx);
   grpc_exec_ctx_finish(&exec_ctx);
 
-  cq = (grpc_completion_queue *)gpr_zalloc(sizeof(grpc_completion_queue) +
-                                           vtable->data_size +
-                                           poller_vtable->size());
+  cq = (grpc_completion_queue*)gpr_zalloc(sizeof(grpc_completion_queue) +
+                                          vtable->data_size +
+                                          poller_vtable->size());
 
   cq->vtable = vtable;
   cq->poller_vtable = poller_vtable;
@@ -428,8 +479,8 @@
   return cq;
 }
 
-static void cq_init_next(void *ptr) {
-  cq_next_data *cqd = (cq_next_data *)ptr;
+static void cq_init_next(void* ptr) {
+  cq_next_data* cqd = (cq_next_data*)ptr;
   /* Initial count is dropped by grpc_completion_queue_shutdown */
   gpr_atm_no_barrier_store(&cqd->pending_events, 1);
   cqd->shutdown_called = false;
@@ -437,14 +488,14 @@
   cq_event_queue_init(&cqd->queue);
 }
 
-static void cq_destroy_next(void *ptr) {
-  cq_next_data *cqd = (cq_next_data *)ptr;
+static void cq_destroy_next(void* ptr) {
+  cq_next_data* cqd = (cq_next_data*)ptr;
   GPR_ASSERT(cq_event_queue_num_items(&cqd->queue) == 0);
   cq_event_queue_destroy(&cqd->queue);
 }
 
-static void cq_init_pluck(void *ptr) {
-  cq_pluck_data *cqd = (cq_pluck_data *)ptr;
+static void cq_init_pluck(void* ptr) {
+  cq_pluck_data* cqd = (cq_pluck_data*)ptr;
   /* Initial count is dropped by grpc_completion_queue_shutdown */
   gpr_atm_no_barrier_store(&cqd->pending_events, 1);
   cqd->completed_tail = &cqd->completed_head;
@@ -455,16 +506,16 @@
   gpr_atm_no_barrier_store(&cqd->things_queued_ever, 0);
 }
 
-static void cq_destroy_pluck(void *ptr) {
-  cq_pluck_data *cqd = (cq_pluck_data *)ptr;
+static void cq_destroy_pluck(void* ptr) {
+  cq_pluck_data* cqd = (cq_pluck_data*)ptr;
   GPR_ASSERT(cqd->completed_head.next == (uintptr_t)&cqd->completed_head);
 }
 
-grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue *cq) {
+grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue* cq) {
   return cq->vtable->cq_completion_type;
 }
 
-int grpc_get_cq_poll_num(grpc_completion_queue *cq) {
+int grpc_get_cq_poll_num(grpc_completion_queue* cq) {
   int cur_num_polls;
   gpr_mu_lock(cq->mu);
   cur_num_polls = cq->num_polls;
@@ -473,38 +524,38 @@
 }
 
 #ifndef NDEBUG
-void grpc_cq_internal_ref(grpc_completion_queue *cq, const char *reason,
-                          const char *file, int line) {
-  if (grpc_trace_cq_refcount.enabled()) {
+void grpc_cq_internal_ref(grpc_completion_queue* cq, const char* reason,
+                          const char* file, int line) {
+  if (grpc_trace_cq_refcount.enabled() {
     gpr_atm val = gpr_atm_no_barrier_load(&cq->owning_refs.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "CQ:%p   ref %" PRIdPTR " -> %" PRIdPTR " %s", cq, val, val + 1,
             reason);
   }
 #else
-void grpc_cq_internal_ref(grpc_completion_queue *cq) {
+void grpc_cq_internal_ref(grpc_completion_queue* cq) {
 #endif
   gpr_ref(&cq->owning_refs);
 }
 
-static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *arg,
-                                     grpc_error *error) {
-  grpc_completion_queue *cq = (grpc_completion_queue *)arg;
+static void on_pollset_shutdown_done(grpc_exec_ctx* exec_ctx, void* arg,
+                                     grpc_error* error) {
+  grpc_completion_queue* cq = (grpc_completion_queue*)arg;
   GRPC_CQ_INTERNAL_UNREF(exec_ctx, cq, "pollset_destroy");
 }
 
 #ifndef NDEBUG
-void grpc_cq_internal_unref(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cq,
-                            const char *reason, const char *file, int line) {
-  if (grpc_trace_cq_refcount.enabled()) {
+void grpc_cq_internal_unref(grpc_exec_ctx* exec_ctx, grpc_completion_queue* cq,
+                            const char* reason, const char* file, int line) {
+  if (grpc_trace_cq_refcount.enabled() {
     gpr_atm val = gpr_atm_no_barrier_load(&cq->owning_refs.count);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
             "CQ:%p unref %" PRIdPTR " -> %" PRIdPTR " %s", cq, val, val - 1,
             reason);
   }
 #else
-void grpc_cq_internal_unref(grpc_exec_ctx *exec_ctx,
-                            grpc_completion_queue *cq) {
+void grpc_cq_internal_unref(grpc_exec_ctx* exec_ctx,
+                            grpc_completion_queue* cq) {
 #endif
   if (gpr_unref(&cq->owning_refs)) {
     cq->vtable->destroy(DATA_FROM_CQ(cq));
@@ -517,7 +568,7 @@
 }
 
 #ifndef NDEBUG
-static void cq_check_tag(grpc_completion_queue *cq, void *tag, bool lock_cq) {
+static void cq_check_tag(grpc_completion_queue* cq, void* tag, bool lock_cq) {
   int found = 0;
   if (lock_cq) {
     gpr_mu_lock(cq->mu);
@@ -526,7 +577,7 @@
   for (int i = 0; i < (int)cq->outstanding_tag_count; i++) {
     if (cq->outstanding_tags[i] == tag) {
       cq->outstanding_tag_count--;
-      GPR_SWAP(void *, cq->outstanding_tags[i],
+      GPR_SWAP(void*, cq->outstanding_tags[i],
                cq->outstanding_tags[cq->outstanding_tag_count]);
       found = 1;
       break;
@@ -540,12 +591,12 @@
   GPR_ASSERT(found);
 }
 #else
-static void cq_check_tag(grpc_completion_queue *cq, void *tag, bool lock_cq) {}
+static void cq_check_tag(grpc_completion_queue* cq, void* tag, bool lock_cq) {}
 #endif
 
 /* Atomically increments a counter only if the counter is not zero. Returns
  * true if the increment was successful; false if the counter is zero */
-static bool atm_inc_if_nonzero(gpr_atm *counter) {
+static bool atm_inc_if_nonzero(gpr_atm* counter) {
   while (true) {
     gpr_atm count = gpr_atm_acq_load(counter);
     /* If zero, we are done. If not, we must to a CAS (instead of an atomic
@@ -561,22 +612,22 @@
   return true;
 }
 
-static bool cq_begin_op_for_next(grpc_completion_queue *cq, void *tag) {
-  cq_next_data *cqd = (cq_next_data *)DATA_FROM_CQ(cq);
+static bool cq_begin_op_for_next(grpc_completion_queue* cq, void* tag) {
+  cq_next_data* cqd = (cq_next_data*)DATA_FROM_CQ(cq);
   return atm_inc_if_nonzero(&cqd->pending_events);
 }
 
-static bool cq_begin_op_for_pluck(grpc_completion_queue *cq, void *tag) {
-  cq_pluck_data *cqd = (cq_pluck_data *)DATA_FROM_CQ(cq);
+static bool cq_begin_op_for_pluck(grpc_completion_queue* cq, void* tag) {
+  cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
   return atm_inc_if_nonzero(&cqd->pending_events);
 }
 
-bool grpc_cq_begin_op(grpc_completion_queue *cq, void *tag) {
+bool grpc_cq_begin_op(grpc_completion_queue* cq, void* tag) {
 #ifndef NDEBUG
   gpr_mu_lock(cq->mu);
   if (cq->outstanding_tag_count == cq->outstanding_tag_capacity) {
     cq->outstanding_tag_capacity = GPR_MAX(4, 2 * cq->outstanding_tag_capacity);
-    cq->outstanding_tags = (void **)gpr_realloc(
+    cq->outstanding_tags = (void**)gpr_realloc(
         cq->outstanding_tags,
         sizeof(*cq->outstanding_tags) * cq->outstanding_tag_capacity);
   }
@@ -589,28 +640,29 @@
 /* Queue a GRPC_OP_COMPLETED operation to a completion queue (with a
  * completion
  * type of GRPC_CQ_NEXT) */
-static void cq_end_op_for_next(grpc_exec_ctx *exec_ctx,
-                               grpc_completion_queue *cq, void *tag,
-                               grpc_error *error,
-                               void (*done)(grpc_exec_ctx *exec_ctx,
-                                            void *done_arg,
-                                            grpc_cq_completion *storage),
-                               void *done_arg, grpc_cq_completion *storage) {
+static void cq_end_op_for_next(grpc_exec_ctx* exec_ctx,
+                               grpc_completion_queue* cq, void* tag,
+                               grpc_error* error,
+                               void (*done)(grpc_exec_ctx* exec_ctx,
+                                            void* done_arg,
+                                            grpc_cq_completion* storage),
+                               void* done_arg, grpc_cq_completion* storage) {
   GPR_TIMER_BEGIN("cq_end_op_for_next", 0);
 
   if (grpc_api_trace.enabled() ||
-      (grpc_trace_operation_failures.enabled() && error != GRPC_ERROR_NONE)) {
-    const char *errmsg = grpc_error_string(error);
+      (grpc_trace_operation_failures.enabled() &&
+       error != GRPC_ERROR_NONE)) {
+    const char* errmsg = grpc_error_string(error);
     GRPC_API_TRACE(
         "cq_end_op_for_next(exec_ctx=%p, cq=%p, tag=%p, error=%s, "
         "done=%p, done_arg=%p, storage=%p)",
         7, (exec_ctx, cq, tag, errmsg, done, done_arg, storage));
-    if (grpc_trace_operation_failures.enabled() && error != GRPC_ERROR_NONE) {
+    if (grpc_trace_operation_failures.enabled() &&
+        error != GRPC_ERROR_NONE) {
       gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg);
     }
   }
-
-  cq_next_data *cqd = (cq_next_data *)DATA_FROM_CQ(cq);
+  cq_next_data* cqd = (cq_next_data*)DATA_FROM_CQ(cq);
   int is_success = (error == GRPC_ERROR_NONE);
 
   storage->tag = tag;
@@ -620,44 +672,50 @@
 
   cq_check_tag(cq, tag, true); /* Used in debug builds only */
 
-  /* Add the completion to the queue */
-  bool is_first = cq_event_queue_push(&cqd->queue, storage);
-  gpr_atm_no_barrier_fetch_add(&cqd->things_queued_ever, 1);
+  if ((grpc_completion_queue*)gpr_tls_get(&g_cached_cq) == cq &&
+      (grpc_cq_completion*)gpr_tls_get(&g_cached_event) == nullptr) {
+    gpr_tls_set(&g_cached_event, (intptr_t)storage);
+  } else {
+    /* Add the completion to the queue */
+    bool is_first = cq_event_queue_push(&cqd->queue, storage);
+    gpr_atm_no_barrier_fetch_add(&cqd->things_queued_ever, 1);
 
-  /* Since we do not hold the cq lock here, it is important to do an 'acquire'
-     load here (instead of a 'no_barrier' load) to match with the release store
-     (done via gpr_atm_full_fetch_add(pending_events, -1)) in cq_shutdown_next
-     */
-  bool will_definitely_shutdown = gpr_atm_acq_load(&cqd->pending_events) == 1;
+    /* Since we do not hold the cq lock here, it is important to do an 'acquire'
+       load here (instead of a 'no_barrier' load) to match with the release
+       store
+       (done via gpr_atm_full_fetch_add(pending_events, -1)) in cq_shutdown_next
+       */
+    bool will_definitely_shutdown = gpr_atm_acq_load(&cqd->pending_events) == 1;
 
-  if (!will_definitely_shutdown) {
-    /* Only kick if this is the first item queued */
-    if (is_first) {
-      gpr_mu_lock(cq->mu);
-      grpc_error *kick_error =
-          cq->poller_vtable->kick(exec_ctx, POLLSET_FROM_CQ(cq), NULL);
-      gpr_mu_unlock(cq->mu);
+    if (!will_definitely_shutdown) {
+      /* Only kick if this is the first item queued */
+      if (is_first) {
+        gpr_mu_lock(cq->mu);
+        grpc_error* kick_error =
+            cq->poller_vtable->kick(exec_ctx, POLLSET_FROM_CQ(cq), NULL);
+        gpr_mu_unlock(cq->mu);
 
-      if (kick_error != GRPC_ERROR_NONE) {
-        const char *msg = grpc_error_string(kick_error);
-        gpr_log(GPR_ERROR, "Kick failed: %s", msg);
-        GRPC_ERROR_UNREF(kick_error);
+        if (kick_error != GRPC_ERROR_NONE) {
+          const char* msg = grpc_error_string(kick_error);
+          gpr_log(GPR_ERROR, "Kick failed: %s", msg);
+          GRPC_ERROR_UNREF(kick_error);
+        }
       }
-    }
-    if (gpr_atm_full_fetch_add(&cqd->pending_events, -1) == 1) {
+      if (gpr_atm_full_fetch_add(&cqd->pending_events, -1) == 1) {
+        GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
+        gpr_mu_lock(cq->mu);
+        cq_finish_shutdown_next(exec_ctx, cq);
+        gpr_mu_unlock(cq->mu);
+        GRPC_CQ_INTERNAL_UNREF(exec_ctx, cq, "shutting_down");
+      }
+    } else {
       GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
+      gpr_atm_rel_store(&cqd->pending_events, 0);
       gpr_mu_lock(cq->mu);
       cq_finish_shutdown_next(exec_ctx, cq);
       gpr_mu_unlock(cq->mu);
       GRPC_CQ_INTERNAL_UNREF(exec_ctx, cq, "shutting_down");
     }
-  } else {
-    GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
-    gpr_atm_rel_store(&cqd->pending_events, 0);
-    gpr_mu_lock(cq->mu);
-    cq_finish_shutdown_next(exec_ctx, cq);
-    gpr_mu_unlock(cq->mu);
-    GRPC_CQ_INTERNAL_UNREF(exec_ctx, cq, "shutting_down");
   }
 
   GPR_TIMER_END("cq_end_op_for_next", 0);
@@ -668,26 +726,28 @@
 /* Queue a GRPC_OP_COMPLETED operation to a completion queue (with a
  * completion
  * type of GRPC_CQ_PLUCK) */
-static void cq_end_op_for_pluck(grpc_exec_ctx *exec_ctx,
-                                grpc_completion_queue *cq, void *tag,
-                                grpc_error *error,
-                                void (*done)(grpc_exec_ctx *exec_ctx,
-                                             void *done_arg,
-                                             grpc_cq_completion *storage),
-                                void *done_arg, grpc_cq_completion *storage) {
-  cq_pluck_data *cqd = (cq_pluck_data *)DATA_FROM_CQ(cq);
+static void cq_end_op_for_pluck(grpc_exec_ctx* exec_ctx,
+                                grpc_completion_queue* cq, void* tag,
+                                grpc_error* error,
+                                void (*done)(grpc_exec_ctx* exec_ctx,
+                                             void* done_arg,
+                                             grpc_cq_completion* storage),
+                                void* done_arg, grpc_cq_completion* storage) {
+  cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
   int is_success = (error == GRPC_ERROR_NONE);
 
   GPR_TIMER_BEGIN("cq_end_op_for_pluck", 0);
 
   if (grpc_api_trace.enabled() ||
-      (grpc_trace_operation_failures.enabled() && error != GRPC_ERROR_NONE)) {
-    const char *errmsg = grpc_error_string(error);
+      (grpc_trace_operation_failures.enabled() &&
+       error != GRPC_ERROR_NONE)) {
+    const char* errmsg = grpc_error_string(error);
     GRPC_API_TRACE(
         "cq_end_op_for_pluck(exec_ctx=%p, cq=%p, tag=%p, error=%s, "
         "done=%p, done_arg=%p, storage=%p)",
         7, (exec_ctx, cq, tag, errmsg, done, done_arg, storage));
-    if (grpc_trace_operation_failures.enabled() && error != GRPC_ERROR_NONE) {
+    if (grpc_trace_operation_failures.enabled() &&
+        error != GRPC_ERROR_NONE) {
       gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg);
     }
   }
@@ -710,7 +770,7 @@
     cq_finish_shutdown_pluck(exec_ctx, cq);
     gpr_mu_unlock(cq->mu);
   } else {
-    grpc_pollset_worker *pluck_worker = NULL;
+    grpc_pollset_worker* pluck_worker = NULL;
     for (int i = 0; i < cqd->num_pluckers; i++) {
       if (cqd->pluckers[i].tag == tag) {
         pluck_worker = *cqd->pluckers[i].worker;
@@ -718,13 +778,13 @@
       }
     }
 
-    grpc_error *kick_error =
+    grpc_error* kick_error =
         cq->poller_vtable->kick(exec_ctx, POLLSET_FROM_CQ(cq), pluck_worker);
 
     gpr_mu_unlock(cq->mu);
 
     if (kick_error != GRPC_ERROR_NONE) {
-      const char *msg = grpc_error_string(kick_error);
+      const char* msg = grpc_error_string(kick_error);
       gpr_log(GPR_ERROR, "Kick failed: %s", msg);
 
       GRPC_ERROR_UNREF(kick_error);
@@ -736,27 +796,27 @@
   GRPC_ERROR_UNREF(error);
 }
 
-void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cq,
-                    void *tag, grpc_error *error,
-                    void (*done)(grpc_exec_ctx *exec_ctx, void *done_arg,
-                                 grpc_cq_completion *storage),
-                    void *done_arg, grpc_cq_completion *storage) {
+void grpc_cq_end_op(grpc_exec_ctx* exec_ctx, grpc_completion_queue* cq,
+                    void* tag, grpc_error* error,
+                    void (*done)(grpc_exec_ctx* exec_ctx, void* done_arg,
+                                 grpc_cq_completion* storage),
+                    void* done_arg, grpc_cq_completion* storage) {
   cq->vtable->end_op(exec_ctx, cq, tag, error, done, done_arg, storage);
 }
 
 typedef struct {
   gpr_atm last_seen_things_queued_ever;
-  grpc_completion_queue *cq;
+  grpc_completion_queue* cq;
   grpc_millis deadline;
-  grpc_cq_completion *stolen_completion;
-  void *tag; /* for pluck */
+  grpc_cq_completion* stolen_completion;
+  void* tag; /* for pluck */
   bool first_loop;
 } cq_is_finished_arg;
 
-static bool cq_is_next_finished(grpc_exec_ctx *exec_ctx, void *arg) {
-  cq_is_finished_arg *a = (cq_is_finished_arg *)arg;
-  grpc_completion_queue *cq = a->cq;
-  cq_next_data *cqd = (cq_next_data *)DATA_FROM_CQ(cq);
+static bool cq_is_next_finished(grpc_exec_ctx* exec_ctx, void* arg) {
+  cq_is_finished_arg* a = (cq_is_finished_arg*)arg;
+  grpc_completion_queue* cq = a->cq;
+  cq_next_data* cqd = (cq_next_data*)DATA_FROM_CQ(cq);
   GPR_ASSERT(a->stolen_completion == NULL);
 
   gpr_atm current_last_seen_things_queued_ever =
@@ -780,7 +840,7 @@
 }
 
 #ifndef NDEBUG
-static void dump_pending_tags(grpc_completion_queue *cq) {
+static void dump_pending_tags(grpc_completion_queue* cq) {
   if (!grpc_trace_pending_tags.enabled()) return;
 
   gpr_strvec v;
@@ -788,24 +848,24 @@
   gpr_strvec_add(&v, gpr_strdup("PENDING TAGS:"));
   gpr_mu_lock(cq->mu);
   for (size_t i = 0; i < cq->outstanding_tag_count; i++) {
-    char *s;
+    char* s;
     gpr_asprintf(&s, " %p", cq->outstanding_tags[i]);
     gpr_strvec_add(&v, s);
   }
   gpr_mu_unlock(cq->mu);
-  char *out = gpr_strvec_flatten(&v, NULL);
+  char* out = gpr_strvec_flatten(&v, NULL);
   gpr_strvec_destroy(&v);
   gpr_log(GPR_DEBUG, "%s", out);
   gpr_free(out);
 }
 #else
-static void dump_pending_tags(grpc_completion_queue *cq) {}
+static void dump_pending_tags(grpc_completion_queue* cq) {}
 #endif
 
-static grpc_event cq_next(grpc_completion_queue *cq, gpr_timespec deadline,
-                          void *reserved) {
+static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
+                          void* reserved) {
   grpc_event ret;
-  cq_next_data *cqd = (cq_next_data *)DATA_FROM_CQ(cq);
+  cq_next_data* cqd = (cq_next_data*)DATA_FROM_CQ(cq);
 
   GPR_TIMER_BEGIN("grpc_completion_queue_next", 0);
 
@@ -815,8 +875,9 @@
       "deadline=gpr_timespec { tv_sec: %" PRId64
       ", tv_nsec: %d, clock_type: %d }, "
       "reserved=%p)",
-      5, (cq, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type,
-          reserved));
+      5,
+      (cq, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type,
+       reserved));
   GPR_ASSERT(!reserved);
 
   dump_pending_tags(cq);
@@ -837,7 +898,7 @@
     grpc_millis iteration_deadline = deadline_millis;
 
     if (is_finished_arg.stolen_completion != NULL) {
-      grpc_cq_completion *c = is_finished_arg.stolen_completion;
+      grpc_cq_completion* c = is_finished_arg.stolen_completion;
       is_finished_arg.stolen_completion = NULL;
       ret.type = GRPC_OP_COMPLETE;
       ret.success = c->next & 1u;
@@ -846,7 +907,7 @@
       break;
     }
 
-    grpc_cq_completion *c = cq_event_queue_pop(&cqd->queue);
+    grpc_cq_completion* c = cq_event_queue_pop(&cqd->queue);
 
     if (c != NULL) {
       ret.type = GRPC_OP_COMPLETE;
@@ -893,12 +954,12 @@
     /* The main polling work happens in grpc_pollset_work */
     gpr_mu_lock(cq->mu);
     cq->num_polls++;
-    grpc_error *err = cq->poller_vtable->work(&exec_ctx, POLLSET_FROM_CQ(cq),
+    grpc_error* err = cq->poller_vtable->work(&exec_ctx, POLLSET_FROM_CQ(cq),
                                               NULL, iteration_deadline);
     gpr_mu_unlock(cq->mu);
 
     if (err != GRPC_ERROR_NONE) {
-      const char *msg = grpc_error_string(err);
+      const char* msg = grpc_error_string(err);
       gpr_log(GPR_ERROR, "Completion queue next failed: %s", msg);
 
       GRPC_ERROR_UNREF(err);
@@ -933,9 +994,9 @@
    - Must be called only once in completion queue's lifetime
    - grpc_completion_queue_shutdown() MUST have been called before calling
    this function */
-static void cq_finish_shutdown_next(grpc_exec_ctx *exec_ctx,
-                                    grpc_completion_queue *cq) {
-  cq_next_data *cqd = (cq_next_data *)DATA_FROM_CQ(cq);
+static void cq_finish_shutdown_next(grpc_exec_ctx* exec_ctx,
+                                    grpc_completion_queue* cq) {
+  cq_next_data* cqd = (cq_next_data*)DATA_FROM_CQ(cq);
 
   GPR_ASSERT(cqd->shutdown_called);
   GPR_ASSERT(gpr_atm_no_barrier_load(&cqd->pending_events) == 0);
@@ -944,9 +1005,9 @@
                               &cq->pollset_shutdown_done);
 }
 
-static void cq_shutdown_next(grpc_exec_ctx *exec_ctx,
-                             grpc_completion_queue *cq) {
-  cq_next_data *cqd = (cq_next_data *)DATA_FROM_CQ(cq);
+static void cq_shutdown_next(grpc_exec_ctx* exec_ctx,
+                             grpc_completion_queue* cq) {
+  cq_next_data* cqd = (cq_next_data*)DATA_FROM_CQ(cq);
 
   /* Need an extra ref for cq here because:
    * We call cq_finish_shutdown_next() below, that would call pollset shutdown.
@@ -972,14 +1033,14 @@
   GRPC_CQ_INTERNAL_UNREF(exec_ctx, cq, "shutting_down");
 }
 
-grpc_event grpc_completion_queue_next(grpc_completion_queue *cq,
-                                      gpr_timespec deadline, void *reserved) {
+grpc_event grpc_completion_queue_next(grpc_completion_queue* cq,
+                                      gpr_timespec deadline, void* reserved) {
   return cq->vtable->next(cq, deadline, reserved);
 }
 
-static int add_plucker(grpc_completion_queue *cq, void *tag,
-                       grpc_pollset_worker **worker) {
-  cq_pluck_data *cqd = (cq_pluck_data *)DATA_FROM_CQ(cq);
+static int add_plucker(grpc_completion_queue* cq, void* tag,
+                       grpc_pollset_worker** worker) {
+  cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
   if (cqd->num_pluckers == GRPC_MAX_COMPLETION_QUEUE_PLUCKERS) {
     return 0;
   }
@@ -989,9 +1050,9 @@
   return 1;
 }
 
-static void del_plucker(grpc_completion_queue *cq, void *tag,
-                        grpc_pollset_worker **worker) {
-  cq_pluck_data *cqd = (cq_pluck_data *)DATA_FROM_CQ(cq);
+static void del_plucker(grpc_completion_queue* cq, void* tag,
+                        grpc_pollset_worker** worker) {
+  cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
   for (int i = 0; i < cqd->num_pluckers; i++) {
     if (cqd->pluckers[i].tag == tag && cqd->pluckers[i].worker == worker) {
       cqd->num_pluckers--;
@@ -1002,10 +1063,10 @@
   GPR_UNREACHABLE_CODE(return );
 }
 
-static bool cq_is_pluck_finished(grpc_exec_ctx *exec_ctx, void *arg) {
-  cq_is_finished_arg *a = (cq_is_finished_arg *)arg;
-  grpc_completion_queue *cq = a->cq;
-  cq_pluck_data *cqd = (cq_pluck_data *)DATA_FROM_CQ(cq);
+static bool cq_is_pluck_finished(grpc_exec_ctx* exec_ctx, void* arg) {
+  cq_is_finished_arg* a = (cq_is_finished_arg*)arg;
+  grpc_completion_queue* cq = a->cq;
+  cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
 
   GPR_ASSERT(a->stolen_completion == NULL);
   gpr_atm current_last_seen_things_queued_ever =
@@ -1014,9 +1075,9 @@
     gpr_mu_lock(cq->mu);
     a->last_seen_things_queued_ever =
         gpr_atm_no_barrier_load(&cqd->things_queued_ever);
-    grpc_cq_completion *c;
-    grpc_cq_completion *prev = &cqd->completed_head;
-    while ((c = (grpc_cq_completion *)(prev->next & ~(uintptr_t)1)) !=
+    grpc_cq_completion* c;
+    grpc_cq_completion* prev = &cqd->completed_head;
+    while ((c = (grpc_cq_completion*)(prev->next & ~(uintptr_t)1)) !=
            &cqd->completed_head) {
       if (c->tag == a->tag) {
         prev->next = (prev->next & (uintptr_t)1) | (c->next & ~(uintptr_t)1);
@@ -1034,13 +1095,13 @@
   return !a->first_loop && a->deadline < grpc_exec_ctx_now(exec_ctx);
 }
 
-static grpc_event cq_pluck(grpc_completion_queue *cq, void *tag,
-                           gpr_timespec deadline, void *reserved) {
+static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
+                           gpr_timespec deadline, void* reserved) {
   grpc_event ret;
-  grpc_cq_completion *c;
-  grpc_cq_completion *prev;
-  grpc_pollset_worker *worker = NULL;
-  cq_pluck_data *cqd = (cq_pluck_data *)DATA_FROM_CQ(cq);
+  grpc_cq_completion* c;
+  grpc_cq_completion* prev;
+  grpc_pollset_worker* worker = NULL;
+  cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
 
   GPR_TIMER_BEGIN("grpc_completion_queue_pluck", 0);
 
@@ -1051,8 +1112,9 @@
         "deadline=gpr_timespec { tv_sec: %" PRId64
         ", tv_nsec: %d, clock_type: %d }, "
         "reserved=%p)",
-        6, (cq, tag, deadline.tv_sec, deadline.tv_nsec,
-            (int)deadline.clock_type, reserved));
+        6,
+        (cq, tag, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type,
+         reserved));
   }
   GPR_ASSERT(!reserved);
 
@@ -1082,7 +1144,7 @@
       break;
     }
     prev = &cqd->completed_head;
-    while ((c = (grpc_cq_completion *)(prev->next & ~(uintptr_t)1)) !=
+    while ((c = (grpc_cq_completion*)(prev->next & ~(uintptr_t)1)) !=
            &cqd->completed_head) {
       if (c->tag == tag) {
         prev->next = (prev->next & (uintptr_t)1) | (c->next & ~(uintptr_t)1);
@@ -1126,12 +1188,12 @@
       break;
     }
     cq->num_polls++;
-    grpc_error *err = cq->poller_vtable->work(&exec_ctx, POLLSET_FROM_CQ(cq),
+    grpc_error* err = cq->poller_vtable->work(&exec_ctx, POLLSET_FROM_CQ(cq),
                                               &worker, deadline_millis);
     if (err != GRPC_ERROR_NONE) {
       del_plucker(cq, tag, &worker);
       gpr_mu_unlock(cq->mu);
-      const char *msg = grpc_error_string(err);
+      const char* msg = grpc_error_string(err);
       gpr_log(GPR_ERROR, "Completion queue pluck failed: %s", msg);
 
       GRPC_ERROR_UNREF(err);
@@ -1154,14 +1216,14 @@
   return ret;
 }
 
-grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag,
-                                       gpr_timespec deadline, void *reserved) {
+grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, void* tag,
+                                       gpr_timespec deadline, void* reserved) {
   return cq->vtable->pluck(cq, tag, deadline, reserved);
 }
 
-static void cq_finish_shutdown_pluck(grpc_exec_ctx *exec_ctx,
-                                     grpc_completion_queue *cq) {
-  cq_pluck_data *cqd = (cq_pluck_data *)DATA_FROM_CQ(cq);
+static void cq_finish_shutdown_pluck(grpc_exec_ctx* exec_ctx,
+                                     grpc_completion_queue* cq) {
+  cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
 
   GPR_ASSERT(cqd->shutdown_called);
   GPR_ASSERT(!gpr_atm_no_barrier_load(&cqd->shutdown));
@@ -1173,9 +1235,9 @@
 
 /* NOTE: This function is almost exactly identical to cq_shutdown_next() but
  * merging them is a bit tricky and probably not worth it */
-static void cq_shutdown_pluck(grpc_exec_ctx *exec_ctx,
-                              grpc_completion_queue *cq) {
-  cq_pluck_data *cqd = (cq_pluck_data *)DATA_FROM_CQ(cq);
+static void cq_shutdown_pluck(grpc_exec_ctx* exec_ctx,
+                              grpc_completion_queue* cq) {
+  cq_pluck_data* cqd = (cq_pluck_data*)DATA_FROM_CQ(cq);
 
   /* Need an extra ref for cq here because:
    * We call cq_finish_shutdown_pluck() below, that would call pollset shutdown.
@@ -1200,7 +1262,7 @@
 
 /* Shutdown simply drops a ref that we reserved at creation time; if we drop
    to zero here, then enter shutdown mode and wake up any waiters */
-void grpc_completion_queue_shutdown(grpc_completion_queue *cq) {
+void grpc_completion_queue_shutdown(grpc_completion_queue* cq) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   GPR_TIMER_BEGIN("grpc_completion_queue_shutdown", 0);
   GRPC_API_TRACE("grpc_completion_queue_shutdown(cq=%p)", 1, (cq));
@@ -1209,7 +1271,7 @@
   GPR_TIMER_END("grpc_completion_queue_shutdown", 0);
 }
 
-void grpc_completion_queue_destroy(grpc_completion_queue *cq) {
+void grpc_completion_queue_destroy(grpc_completion_queue* cq) {
   GRPC_API_TRACE("grpc_completion_queue_destroy(cq=%p)", 1, (cq));
   GPR_TIMER_BEGIN("grpc_completion_queue_destroy", 0);
   grpc_completion_queue_shutdown(cq);
@@ -1220,10 +1282,10 @@
   GPR_TIMER_END("grpc_completion_queue_destroy", 0);
 }
 
-grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cq) {
+grpc_pollset* grpc_cq_pollset(grpc_completion_queue* cq) {
   return cq->poller_vtable->can_get_pollset ? POLLSET_FROM_CQ(cq) : NULL;
 }
 
-bool grpc_cq_can_listen(grpc_completion_queue *cq) {
+bool grpc_cq_can_listen(grpc_completion_queue* cq) {
   return cq->poller_vtable->can_listen;
 }
diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h
index cb390fe..945b673 100644
--- a/src/core/lib/surface/completion_queue.h
+++ b/src/core/lib/surface/completion_queue.h
@@ -44,55 +44,58 @@
   gpr_mpscq_node node;
 
   /** user supplied tag */
-  void *tag;
+  void* tag;
   /** done callback - called when this queue element is no longer
       needed by the completion queue */
-  void (*done)(grpc_exec_ctx *exec_ctx, void *done_arg,
-               struct grpc_cq_completion *c);
-  void *done_arg;
+  void (*done)(grpc_exec_ctx* exec_ctx, void* done_arg,
+               struct grpc_cq_completion* c);
+  void* done_arg;
   /** next pointer; low bit is used to indicate success or not */
   uintptr_t next;
 } grpc_cq_completion;
 
 #ifndef NDEBUG
-void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason,
-                          const char *file, int line);
-void grpc_cq_internal_unref(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
-                            const char *reason, const char *file, int line);
+void grpc_cq_internal_ref(grpc_completion_queue* cc, const char* reason,
+                          const char* file, int line);
+void grpc_cq_internal_unref(grpc_exec_ctx* exec_ctx, grpc_completion_queue* cc,
+                            const char* reason, const char* file, int line);
 #define GRPC_CQ_INTERNAL_REF(cc, reason) \
   grpc_cq_internal_ref(cc, reason, __FILE__, __LINE__)
 #define GRPC_CQ_INTERNAL_UNREF(ec, cc, reason) \
   grpc_cq_internal_unref(ec, cc, reason, __FILE__, __LINE__)
 #else
-void grpc_cq_internal_ref(grpc_completion_queue *cc);
-void grpc_cq_internal_unref(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc);
+void grpc_cq_internal_ref(grpc_completion_queue* cc);
+void grpc_cq_internal_unref(grpc_exec_ctx* exec_ctx, grpc_completion_queue* cc);
 #define GRPC_CQ_INTERNAL_REF(cc, reason) grpc_cq_internal_ref(cc)
 #define GRPC_CQ_INTERNAL_UNREF(ec, cc, reason) grpc_cq_internal_unref(ec, cc)
 #endif
 
+/* Initializes global variables used by completion queues */
+void grpc_cq_global_init();
+
 /* Flag that an operation is beginning: the completion channel will not finish
    shutdown until a corrensponding grpc_cq_end_* call is made.
    \a tag is currently used only in debug builds. Return true on success, and
    false if completion_queue has been shutdown. */
-bool grpc_cq_begin_op(grpc_completion_queue *cc, void *tag);
+bool grpc_cq_begin_op(grpc_completion_queue* cc, void* tag);
 
 /* Queue a GRPC_OP_COMPLETED operation; tag must correspond to the tag passed to
    grpc_cq_begin_op */
-void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
-                    void *tag, grpc_error *error,
-                    void (*done)(grpc_exec_ctx *exec_ctx, void *done_arg,
-                                 grpc_cq_completion *storage),
-                    void *done_arg, grpc_cq_completion *storage);
+void grpc_cq_end_op(grpc_exec_ctx* exec_ctx, grpc_completion_queue* cc,
+                    void* tag, grpc_error* error,
+                    void (*done)(grpc_exec_ctx* exec_ctx, void* done_arg,
+                                 grpc_cq_completion* storage),
+                    void* done_arg, grpc_cq_completion* storage);
 
-grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc);
+grpc_pollset* grpc_cq_pollset(grpc_completion_queue* cc);
 
-bool grpc_cq_can_listen(grpc_completion_queue *cc);
+bool grpc_cq_can_listen(grpc_completion_queue* cc);
 
-grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue *cc);
+grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue* cc);
 
-int grpc_get_cq_poll_num(grpc_completion_queue *cc);
+int grpc_get_cq_poll_num(grpc_completion_queue* cc);
 
-grpc_completion_queue *grpc_completion_queue_create_internal(
+grpc_completion_queue* grpc_completion_queue_create_internal(
     grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type);
 
 #ifdef __cplusplus
diff --git a/src/core/lib/surface/event_string.cc b/src/core/lib/surface/event_string.cc
index f236272..b92ee6a 100644
--- a/src/core/lib/surface/event_string.cc
+++ b/src/core/lib/surface/event_string.cc
@@ -24,22 +24,22 @@
 #include <grpc/support/string_util.h>
 #include "src/core/lib/support/string.h"
 
-static void addhdr(gpr_strvec *buf, grpc_event *ev) {
-  char *tmp;
+static void addhdr(gpr_strvec* buf, grpc_event* ev) {
+  char* tmp;
   gpr_asprintf(&tmp, "tag:%p", ev->tag);
   gpr_strvec_add(buf, tmp);
 }
 
-static const char *errstr(int success) { return success ? "OK" : "ERROR"; }
+static const char* errstr(int success) { return success ? "OK" : "ERROR"; }
 
-static void adderr(gpr_strvec *buf, int success) {
-  char *tmp;
+static void adderr(gpr_strvec* buf, int success) {
+  char* tmp;
   gpr_asprintf(&tmp, " %s", errstr(success));
   gpr_strvec_add(buf, tmp);
 }
 
-char *grpc_event_string(grpc_event *ev) {
-  char *out;
+char* grpc_event_string(grpc_event* ev) {
+  char* out;
   gpr_strvec buf;
 
   if (ev == NULL) return gpr_strdup("null");
diff --git a/src/core/lib/surface/event_string.h b/src/core/lib/surface/event_string.h
index 2d53cf0..4bdb11f 100644
--- a/src/core/lib/surface/event_string.h
+++ b/src/core/lib/surface/event_string.h
@@ -26,7 +26,7 @@
 #endif
 
 /* Returns a string describing an event. Must be later freed with gpr_free() */
-char *grpc_event_string(grpc_event *ev);
+char* grpc_event_string(grpc_event* ev);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/surface/init.cc b/src/core/lib/surface/init.cc
index 2db761b..c8a28e3 100644
--- a/src/core/lib/surface/init.cc
+++ b/src/core/lib/surface/init.cc
@@ -64,19 +64,20 @@
   gpr_log_verbosity_init();
   gpr_mu_init(&g_init_mu);
   grpc_register_built_in_plugins();
+  grpc_cq_global_init();
   g_initializations = 0;
 }
 
-static bool append_filter(grpc_exec_ctx *exec_ctx,
-                          grpc_channel_stack_builder *builder, void *arg) {
+static bool append_filter(grpc_exec_ctx* exec_ctx,
+                          grpc_channel_stack_builder* builder, void* arg) {
   return grpc_channel_stack_builder_append_filter(
-      builder, (const grpc_channel_filter *)arg, NULL, NULL);
+      builder, (const grpc_channel_filter*)arg, NULL, NULL);
 }
 
-static bool prepend_filter(grpc_exec_ctx *exec_ctx,
-                           grpc_channel_stack_builder *builder, void *arg) {
+static bool prepend_filter(grpc_exec_ctx* exec_ctx,
+                           grpc_channel_stack_builder* builder, void* arg) {
   return grpc_channel_stack_builder_prepend_filter(
-      builder, (const grpc_channel_filter *)arg, NULL, NULL);
+      builder, (const grpc_channel_filter*)arg, NULL, NULL);
 }
 
 static void register_builtin_channel_init() {
@@ -91,9 +92,9 @@
                                    grpc_add_connected_filter, NULL);
   grpc_channel_init_register_stage(GRPC_CLIENT_LAME_CHANNEL,
                                    GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
-                                   append_filter, (void *)&grpc_lame_filter);
+                                   append_filter, (void*)&grpc_lame_filter);
   grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX, prepend_filter,
-                                   (void *)&grpc_server_top_filter);
+                                   (void*)&grpc_server_top_filter);
 }
 
 typedef struct grpc_plugin {
@@ -106,7 +107,7 @@
 
 void grpc_register_plugin(void (*init)(void), void (*destroy)(void)) {
   GRPC_API_TRACE("grpc_register_plugin(init=%p, destroy=%p)", 2,
-                 ((void *)(intptr_t)init, (void *)(intptr_t)destroy));
+                 ((void*)(intptr_t)init, (void*)(intptr_t)destroy));
   GPR_ASSERT(g_number_of_plugins != MAX_PLUGINS);
   g_all_of_the_plugins[g_number_of_plugins].init = init;
   g_all_of_the_plugins[g_number_of_plugins].destroy = destroy;
diff --git a/src/core/lib/surface/init_secure.cc b/src/core/lib/surface/init_secure.cc
index 80b1fe0..fcca71c 100644
--- a/src/core/lib/surface/init_secure.cc
+++ b/src/core/lib/surface/init_secure.cc
@@ -44,8 +44,8 @@
 }
 
 static bool maybe_prepend_client_auth_filter(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder, void *arg) {
-  const grpc_channel_args *args =
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder, void* arg) {
+  const grpc_channel_args* args =
       grpc_channel_stack_builder_get_channel_arguments(builder);
   if (args) {
     for (size_t i = 0; i < args->num_args; i++) {
@@ -59,8 +59,8 @@
 }
 
 static bool maybe_prepend_server_auth_filter(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder, void *arg) {
-  const grpc_channel_args *args =
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder, void* arg) {
+  const grpc_channel_args* args =
       grpc_channel_stack_builder_get_channel_arguments(builder);
   if (args) {
     for (size_t i = 0; i < args->num_args; i++) {
diff --git a/src/core/lib/surface/lame_client.cc b/src/core/lib/surface/lame_client.cc
index 88e26cb..add7be2 100644
--- a/src/core/lib/surface/lame_client.cc
+++ b/src/core/lib/surface/lame_client.cc
@@ -40,7 +40,7 @@
 namespace {
 
 struct CallData {
-  grpc_call_combiner *call_combiner;
+  grpc_call_combiner* call_combiner;
   grpc_linked_mdelem status;
   grpc_linked_mdelem details;
   grpc_core::atomic<bool> filled_metadata;
@@ -48,19 +48,19 @@
 
 struct ChannelData {
   grpc_status_code error_code;
-  const char *error_message;
+  const char* error_message;
 };
 
-static void fill_metadata(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                          grpc_metadata_batch *mdb) {
-  CallData *calld = reinterpret_cast<CallData *>(elem->call_data);
+static void fill_metadata(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                          grpc_metadata_batch* mdb) {
+  CallData* calld = reinterpret_cast<CallData*>(elem->call_data);
   bool expected = false;
   if (!calld->filled_metadata.compare_exchange_strong(
           expected, true, grpc_core::memory_order_relaxed,
           grpc_core::memory_order_relaxed)) {
     return;
   }
-  ChannelData *chand = reinterpret_cast<ChannelData *>(elem->channel_data);
+  ChannelData* chand = reinterpret_cast<ChannelData*>(elem->channel_data);
   char tmp[GPR_LTOA_MIN_BUFSIZE];
   gpr_ltoa(chand->error_code, tmp);
   calld->status.md = grpc_mdelem_from_slices(
@@ -78,9 +78,9 @@
 }
 
 static void lame_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *op) {
-  CallData *calld = reinterpret_cast<CallData *>(elem->call_data);
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* op) {
+  CallData* calld = reinterpret_cast<CallData*>(elem->call_data);
   if (op->recv_initial_metadata) {
     fill_metadata(exec_ctx, elem,
                   op->payload->recv_initial_metadata.recv_initial_metadata);
@@ -93,13 +93,13 @@
       calld->call_combiner);
 }
 
-static void lame_get_channel_info(grpc_exec_ctx *exec_ctx,
-                                  grpc_channel_element *elem,
-                                  const grpc_channel_info *channel_info) {}
+static void lame_get_channel_info(grpc_exec_ctx* exec_ctx,
+                                  grpc_channel_element* elem,
+                                  const grpc_channel_info* channel_info) {}
 
-static void lame_start_transport_op(grpc_exec_ctx *exec_ctx,
-                                    grpc_channel_element *elem,
-                                    grpc_transport_op *op) {
+static void lame_start_transport_op(grpc_exec_ctx* exec_ctx,
+                                    grpc_channel_element* elem,
+                                    grpc_transport_op* op) {
   if (op->on_connectivity_state_change) {
     GPR_ASSERT(*op->connectivity_state != GRPC_CHANNEL_SHUTDOWN);
     *op->connectivity_state = GRPC_CHANNEL_SHUTDOWN;
@@ -117,30 +117,30 @@
   }
 }
 
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  CallData *calld = reinterpret_cast<CallData *>(elem->call_data);
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  CallData* calld = reinterpret_cast<CallData*>(elem->call_data);
   calld->call_combiner = args->call_combiner;
   return GRPC_ERROR_NONE;
 }
 
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *then_schedule_closure) {
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* then_schedule_closure) {
   GRPC_CLOSURE_SCHED(exec_ctx, then_schedule_closure, GRPC_ERROR_NONE);
 }
 
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
   GPR_ASSERT(args->is_first);
   GPR_ASSERT(args->is_last);
   return GRPC_ERROR_NONE;
 }
 
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {}
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {}
 
 }  // namespace
 
@@ -160,14 +160,14 @@
     "lame-client",
 };
 
-#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack *)((c) + 1))
+#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack*)((c) + 1))
 
-grpc_channel *grpc_lame_client_channel_create(const char *target,
+grpc_channel* grpc_lame_client_channel_create(const char* target,
                                               grpc_status_code error_code,
-                                              const char *error_message) {
+                                              const char* error_message) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_channel_element *elem;
-  grpc_channel *channel = grpc_channel_create(&exec_ctx, target, NULL,
+  grpc_channel_element* elem;
+  grpc_channel* channel = grpc_channel_create(&exec_ctx, target, NULL,
                                               GRPC_CLIENT_LAME_CHANNEL, NULL);
   elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0);
   GRPC_API_TRACE(
@@ -175,7 +175,7 @@
       "error_message=%s)",
       3, (target, (int)error_code, error_message));
   GPR_ASSERT(elem->filter == &grpc_lame_filter);
-  auto chand = reinterpret_cast<grpc_core::ChannelData *>(elem->channel_data);
+  auto chand = reinterpret_cast<grpc_core::ChannelData*>(elem->channel_data);
   chand->error_code = error_code;
   chand->error_message = error_message;
   grpc_exec_ctx_finish(&exec_ctx);
diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc
index 97e00ee..0905342 100644
--- a/src/core/lib/surface/server.cc
+++ b/src/core/lib/surface/server.cc
@@ -33,7 +33,8 @@
 #include "src/core/lib/iomgr/executor.h"
 #include "src/core/lib/iomgr/iomgr.h"
 #include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/support/stack_lockfree.h"
+#include "src/core/lib/support/mpscq.h"
+#include "src/core/lib/support/spinlock.h"
 #include "src/core/lib/support/string.h"
 #include "src/core/lib/surface/api_trace.h"
 #include "src/core/lib/surface/call.h"
@@ -44,12 +45,12 @@
 #include "src/core/lib/transport/static_metadata.h"
 
 typedef struct listener {
-  void *arg;
-  void (*start)(grpc_exec_ctx *exec_ctx, grpc_server *server, void *arg,
-                grpc_pollset **pollsets, size_t pollset_count);
-  void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_server *server, void *arg,
-                  grpc_closure *closure);
-  struct listener *next;
+  void* arg;
+  void (*start)(grpc_exec_ctx* exec_ctx, grpc_server* server, void* arg,
+                grpc_pollset** pollsets, size_t pollset_count);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_server* server, void* arg,
+                  grpc_closure* closure);
+  struct listener* next;
   grpc_closure destroy_done;
 } listener;
 
@@ -62,28 +63,29 @@
 grpc_core::TraceFlag grpc_server_channel_trace(false, "server_channel");
 
 typedef struct requested_call {
+  gpr_mpscq_node request_link; /* must be first */
   requested_call_type type;
   size_t cq_idx;
-  void *tag;
-  grpc_server *server;
-  grpc_completion_queue *cq_bound_to_call;
-  grpc_call **call;
+  void* tag;
+  grpc_server* server;
+  grpc_completion_queue* cq_bound_to_call;
+  grpc_call** call;
   grpc_cq_completion completion;
-  grpc_metadata_array *initial_metadata;
+  grpc_metadata_array* initial_metadata;
   union {
     struct {
-      grpc_call_details *details;
+      grpc_call_details* details;
     } batch;
     struct {
-      registered_method *method;
-      gpr_timespec *deadline;
-      grpc_byte_buffer **optional_payload;
+      registered_method* method;
+      gpr_timespec* deadline;
+      grpc_byte_buffer** optional_payload;
     } registered;
   } data;
 } requested_call;
 
 typedef struct channel_registered_method {
-  registered_method *server_registered_method;
+  registered_method* server_registered_method;
   uint32_t flags;
   bool has_host;
   grpc_slice method;
@@ -91,14 +93,14 @@
 } channel_registered_method;
 
 struct channel_data {
-  grpc_server *server;
+  grpc_server* server;
   grpc_connectivity_state connectivity_state;
-  grpc_channel *channel;
+  grpc_channel* channel;
   size_t cq_idx;
   /* linked list of all channels on a server */
-  channel_data *next;
-  channel_data *prev;
-  channel_registered_method *registered_methods;
+  channel_data* next;
+  channel_data* prev;
+  channel_registered_method* registered_methods;
   uint32_t registered_method_slots;
   uint32_t registered_method_max_probes;
   grpc_closure finish_destroy_channel_closure;
@@ -106,8 +108,8 @@
 };
 
 typedef struct shutdown_tag {
-  void *tag;
-  grpc_completion_queue *cq;
+  void* tag;
+  grpc_completion_queue* cq;
   grpc_cq_completion completion;
 } shutdown_tag;
 
@@ -125,12 +127,9 @@
 typedef struct request_matcher request_matcher;
 
 struct call_data {
-  grpc_call *call;
+  grpc_call* call;
 
-  /** protects state */
-  gpr_mu mu_state;
-  /** the current state of a call - see call_state */
-  call_state state;
+  gpr_atm state;
 
   bool path_set;
   bool host_set;
@@ -138,52 +137,52 @@
   grpc_slice host;
   grpc_millis deadline;
 
-  grpc_completion_queue *cq_new;
+  grpc_completion_queue* cq_new;
 
-  grpc_metadata_batch *recv_initial_metadata;
+  grpc_metadata_batch* recv_initial_metadata;
   uint32_t recv_initial_metadata_flags;
   grpc_metadata_array initial_metadata;
 
-  request_matcher *matcher;
-  grpc_byte_buffer *payload;
+  request_matcher* matcher;
+  grpc_byte_buffer* payload;
 
   grpc_closure got_initial_metadata;
   grpc_closure server_on_recv_initial_metadata;
   grpc_closure kill_zombie_closure;
-  grpc_closure *on_done_recv_initial_metadata;
+  grpc_closure* on_done_recv_initial_metadata;
 
   grpc_closure publish;
 
-  call_data *pending_next;
+  call_data* pending_next;
 };
 
 struct request_matcher {
-  grpc_server *server;
-  call_data *pending_head;
-  call_data *pending_tail;
-  gpr_stack_lockfree **requests_per_cq;
+  grpc_server* server;
+  call_data* pending_head;
+  call_data* pending_tail;
+  gpr_locked_mpscq* requests_per_cq;
 };
 
 struct registered_method {
-  char *method;
-  char *host;
+  char* method;
+  char* host;
   grpc_server_register_method_payload_handling payload_handling;
   uint32_t flags;
   /* one request matcher per method */
   request_matcher matcher;
-  registered_method *next;
+  registered_method* next;
 };
 
 typedef struct {
-  grpc_channel **channels;
+  grpc_channel** channels;
   size_t num_channels;
 } channel_broadcaster;
 
 struct grpc_server {
-  grpc_channel_args *channel_args;
+  grpc_channel_args* channel_args;
 
-  grpc_completion_queue **cqs;
-  grpc_pollset **pollsets;
+  grpc_completion_queue** cqs;
+  grpc_pollset** pollsets;
   size_t cq_count;
   size_t pollset_count;
   bool started;
@@ -203,23 +202,18 @@
   bool starting;
   gpr_cv starting_cv;
 
-  registered_method *registered_methods;
+  registered_method* registered_methods;
   /** one request matcher for unregistered methods */
   request_matcher unregistered_request_matcher;
-  /** free list of available requested_calls_per_cq indices */
-  gpr_stack_lockfree **request_freelist_per_cq;
-  /** requested call backing data */
-  requested_call **requested_calls_per_cq;
-  int max_requested_calls_per_cq;
 
   gpr_atm shutdown_flag;
   uint8_t shutdown_published;
   size_t num_shutdown_tags;
-  shutdown_tag *shutdown_tags;
+  shutdown_tag* shutdown_tags;
 
   channel_data root_channel_data;
 
-  listener *listeners;
+  listener* listeners;
   int listeners_destroyed;
   gpr_refcount internal_refcount;
 
@@ -228,30 +222,30 @@
 };
 
 #define SERVER_FROM_CALL_ELEM(elem) \
-  (((channel_data *)(elem)->channel_data)->server)
+  (((channel_data*)(elem)->channel_data)->server)
 
-static void publish_new_rpc(grpc_exec_ctx *exec_ctx, void *calld,
-                            grpc_error *error);
-static void fail_call(grpc_exec_ctx *exec_ctx, grpc_server *server,
-                      size_t cq_idx, requested_call *rc, grpc_error *error);
+static void publish_new_rpc(grpc_exec_ctx* exec_ctx, void* calld,
+                            grpc_error* error);
+static void fail_call(grpc_exec_ctx* exec_ctx, grpc_server* server,
+                      size_t cq_idx, requested_call* rc, grpc_error* error);
 /* Before calling maybe_finish_shutdown, we must hold mu_global and not
    hold mu_call */
-static void maybe_finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_server *server);
+static void maybe_finish_shutdown(grpc_exec_ctx* exec_ctx, grpc_server* server);
 
 /*
  * channel broadcaster
  */
 
 /* assumes server locked */
-static void channel_broadcaster_init(grpc_server *s, channel_broadcaster *cb) {
-  channel_data *c;
+static void channel_broadcaster_init(grpc_server* s, channel_broadcaster* cb) {
+  channel_data* c;
   size_t count = 0;
   for (c = s->root_channel_data.next; c != &s->root_channel_data; c = c->next) {
     count++;
   }
   cb->num_channels = count;
   cb->channels =
-      (grpc_channel **)gpr_malloc(sizeof(*cb->channels) * cb->num_channels);
+      (grpc_channel**)gpr_malloc(sizeof(*cb->channels) * cb->num_channels);
   count = 0;
   for (c = s->root_channel_data.next; c != &s->root_channel_data; c = c->next) {
     cb->channels[count++] = c->channel;
@@ -264,21 +258,21 @@
   grpc_slice slice;
 };
 
-static void shutdown_cleanup(grpc_exec_ctx *exec_ctx, void *arg,
-                             grpc_error *error) {
-  struct shutdown_cleanup_args *a = (struct shutdown_cleanup_args *)arg;
+static void shutdown_cleanup(grpc_exec_ctx* exec_ctx, void* arg,
+                             grpc_error* error) {
+  struct shutdown_cleanup_args* a = (struct shutdown_cleanup_args*)arg;
   grpc_slice_unref_internal(exec_ctx, a->slice);
   gpr_free(a);
 }
 
-static void send_shutdown(grpc_exec_ctx *exec_ctx, grpc_channel *channel,
-                          bool send_goaway, grpc_error *send_disconnect) {
-  struct shutdown_cleanup_args *sc =
-      (struct shutdown_cleanup_args *)gpr_malloc(sizeof(*sc));
+static void send_shutdown(grpc_exec_ctx* exec_ctx, grpc_channel* channel,
+                          bool send_goaway, grpc_error* send_disconnect) {
+  struct shutdown_cleanup_args* sc =
+      (struct shutdown_cleanup_args*)gpr_malloc(sizeof(*sc));
   GRPC_CLOSURE_INIT(&sc->closure, shutdown_cleanup, sc,
                     grpc_schedule_on_exec_ctx);
-  grpc_transport_op *op = grpc_make_transport_op(&sc->closure);
-  grpc_channel_element *elem;
+  grpc_transport_op* op = grpc_make_transport_op(&sc->closure);
+  grpc_channel_element* elem;
 
   op->goaway_error =
       send_goaway ? grpc_error_set_int(
@@ -293,10 +287,10 @@
   elem->filter->start_transport_op(exec_ctx, elem, op);
 }
 
-static void channel_broadcaster_shutdown(grpc_exec_ctx *exec_ctx,
-                                         channel_broadcaster *cb,
+static void channel_broadcaster_shutdown(grpc_exec_ctx* exec_ctx,
+                                         channel_broadcaster* cb,
                                          bool send_goaway,
-                                         grpc_error *force_disconnect) {
+                                         grpc_error* force_disconnect) {
   size_t i;
 
   for (i = 0; i < cb->num_channels; i++) {
@@ -312,38 +306,35 @@
  * request_matcher
  */
 
-static void request_matcher_init(request_matcher *rm, size_t entries,
-                                 grpc_server *server) {
+static void request_matcher_init(request_matcher* rm, grpc_server* server) {
   memset(rm, 0, sizeof(*rm));
   rm->server = server;
-  rm->requests_per_cq = (gpr_stack_lockfree **)gpr_malloc(
+  rm->requests_per_cq = (gpr_locked_mpscq*)gpr_malloc(
       sizeof(*rm->requests_per_cq) * server->cq_count);
   for (size_t i = 0; i < server->cq_count; i++) {
-    rm->requests_per_cq[i] = gpr_stack_lockfree_create(entries);
+    gpr_locked_mpscq_init(&rm->requests_per_cq[i]);
   }
 }
 
-static void request_matcher_destroy(request_matcher *rm) {
+static void request_matcher_destroy(request_matcher* rm) {
   for (size_t i = 0; i < rm->server->cq_count; i++) {
-    GPR_ASSERT(gpr_stack_lockfree_pop(rm->requests_per_cq[i]) == -1);
-    gpr_stack_lockfree_destroy(rm->requests_per_cq[i]);
+    GPR_ASSERT(gpr_locked_mpscq_pop(&rm->requests_per_cq[i]) == NULL);
+    gpr_locked_mpscq_destroy(&rm->requests_per_cq[i]);
   }
   gpr_free(rm->requests_per_cq);
 }
 
-static void kill_zombie(grpc_exec_ctx *exec_ctx, void *elem,
-                        grpc_error *error) {
-  grpc_call_unref(grpc_call_from_top_element((grpc_call_element *)elem));
+static void kill_zombie(grpc_exec_ctx* exec_ctx, void* elem,
+                        grpc_error* error) {
+  grpc_call_unref(grpc_call_from_top_element((grpc_call_element*)elem));
 }
 
-static void request_matcher_zombify_all_pending_calls(grpc_exec_ctx *exec_ctx,
-                                                      request_matcher *rm) {
+static void request_matcher_zombify_all_pending_calls(grpc_exec_ctx* exec_ctx,
+                                                      request_matcher* rm) {
   while (rm->pending_head) {
-    call_data *calld = rm->pending_head;
+    call_data* calld = rm->pending_head;
     rm->pending_head = calld->pending_next;
-    gpr_mu_lock(&calld->mu_state);
-    calld->state = ZOMBIED;
-    gpr_mu_unlock(&calld->mu_state);
+    gpr_atm_no_barrier_store(&calld->state, ZOMBIED);
     GRPC_CLOSURE_INIT(
         &calld->kill_zombie_closure, kill_zombie,
         grpc_call_stack_element(grpc_call_get_call_stack(calld->call), 0),
@@ -352,17 +343,21 @@
   }
 }
 
-static void request_matcher_kill_requests(grpc_exec_ctx *exec_ctx,
-                                          grpc_server *server,
-                                          request_matcher *rm,
-                                          grpc_error *error) {
-  int request_id;
+static void request_matcher_kill_requests(grpc_exec_ctx* exec_ctx,
+                                          grpc_server* server,
+                                          request_matcher* rm,
+                                          grpc_error* error) {
+  requested_call* rc;
   for (size_t i = 0; i < server->cq_count; i++) {
-    while ((request_id = gpr_stack_lockfree_pop(rm->requests_per_cq[i])) !=
-           -1) {
-      fail_call(exec_ctx, server, i,
-                &server->requested_calls_per_cq[i][request_id],
-                GRPC_ERROR_REF(error));
+    /* Here we know:
+       1. no requests are being added (since the server is shut down)
+       2. no other threads are pulling (since the shut down process is single
+          threaded)
+       So, we can ignore the queue lock and just pop, with the guarantee that a
+       NULL returned here truly means that the queue is empty */
+    while ((rc = (requested_call*)gpr_mpscq_pop(
+                &rm->requests_per_cq[i].queue)) != NULL) {
+      fail_call(exec_ctx, server, i, rc, GRPC_ERROR_REF(error));
     }
   }
   GRPC_ERROR_UNREF(error);
@@ -372,12 +367,12 @@
  * server proper
  */
 
-static void server_ref(grpc_server *server) {
+static void server_ref(grpc_server* server) {
   gpr_ref(&server->internal_refcount);
 }
 
-static void server_delete(grpc_exec_ctx *exec_ctx, grpc_server *server) {
-  registered_method *rm;
+static void server_delete(grpc_exec_ctx* exec_ctx, grpc_server* server) {
+  registered_method* rm;
   size_t i;
   grpc_channel_args_destroy(exec_ctx, server->channel_args);
   gpr_mu_destroy(&server->mu_global);
@@ -397,45 +392,39 @@
   }
   for (i = 0; i < server->cq_count; i++) {
     GRPC_CQ_INTERNAL_UNREF(exec_ctx, server->cqs[i], "server");
-    if (server->started) {
-      gpr_stack_lockfree_destroy(server->request_freelist_per_cq[i]);
-      gpr_free(server->requested_calls_per_cq[i]);
-    }
   }
-  gpr_free(server->request_freelist_per_cq);
-  gpr_free(server->requested_calls_per_cq);
   gpr_free(server->cqs);
   gpr_free(server->pollsets);
   gpr_free(server->shutdown_tags);
   gpr_free(server);
 }
 
-static void server_unref(grpc_exec_ctx *exec_ctx, grpc_server *server) {
+static void server_unref(grpc_exec_ctx* exec_ctx, grpc_server* server) {
   if (gpr_unref(&server->internal_refcount)) {
     server_delete(exec_ctx, server);
   }
 }
 
-static int is_channel_orphaned(channel_data *chand) {
+static int is_channel_orphaned(channel_data* chand) {
   return chand->next == chand;
 }
 
-static void orphan_channel(channel_data *chand) {
+static void orphan_channel(channel_data* chand) {
   chand->next->prev = chand->prev;
   chand->prev->next = chand->next;
   chand->next = chand->prev = chand;
 }
 
-static void finish_destroy_channel(grpc_exec_ctx *exec_ctx, void *cd,
-                                   grpc_error *error) {
-  channel_data *chand = (channel_data *)cd;
-  grpc_server *server = chand->server;
+static void finish_destroy_channel(grpc_exec_ctx* exec_ctx, void* cd,
+                                   grpc_error* error) {
+  channel_data* chand = (channel_data*)cd;
+  grpc_server* server = chand->server;
   GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, chand->channel, "server");
   server_unref(exec_ctx, server);
 }
 
-static void destroy_channel(grpc_exec_ctx *exec_ctx, channel_data *chand,
-                            grpc_error *error) {
+static void destroy_channel(grpc_exec_ctx* exec_ctx, channel_data* chand,
+                            grpc_error* error) {
   if (is_channel_orphaned(chand)) return;
   GPR_ASSERT(chand->server != NULL);
   orphan_channel(chand);
@@ -445,12 +434,12 @@
                     finish_destroy_channel, chand, grpc_schedule_on_exec_ctx);
 
   if (grpc_server_channel_trace.enabled() && error != GRPC_ERROR_NONE) {
-    const char *msg = grpc_error_string(error);
+    const char* msg = grpc_error_string(error);
     gpr_log(GPR_INFO, "Disconnected client: %s", msg);
   }
   GRPC_ERROR_UNREF(error);
 
-  grpc_transport_op *op =
+  grpc_transport_op* op =
       grpc_make_transport_op(&chand->finish_destroy_channel_closure);
   op->set_accept_stream = true;
   grpc_channel_next_op(exec_ctx,
@@ -459,29 +448,15 @@
                        op);
 }
 
-static void done_request_event(grpc_exec_ctx *exec_ctx, void *req,
-                               grpc_cq_completion *c) {
-  requested_call *rc = (requested_call *)req;
-  grpc_server *server = rc->server;
-
-  if (rc >= server->requested_calls_per_cq[rc->cq_idx] &&
-      rc < server->requested_calls_per_cq[rc->cq_idx] +
-               server->max_requested_calls_per_cq) {
-    GPR_ASSERT(rc - server->requested_calls_per_cq[rc->cq_idx] <= INT_MAX);
-    gpr_stack_lockfree_push(
-        server->request_freelist_per_cq[rc->cq_idx],
-        (int)(rc - server->requested_calls_per_cq[rc->cq_idx]));
-  } else {
-    gpr_free(req);
-  }
-
-  server_unref(exec_ctx, server);
+static void done_request_event(grpc_exec_ctx* exec_ctx, void* req,
+                               grpc_cq_completion* c) {
+  gpr_free(req);
 }
 
-static void publish_call(grpc_exec_ctx *exec_ctx, grpc_server *server,
-                         call_data *calld, size_t cq_idx, requested_call *rc) {
+static void publish_call(grpc_exec_ctx* exec_ctx, grpc_server* server,
+                         call_data* calld, size_t cq_idx, requested_call* rc) {
   grpc_call_set_completion_queue(exec_ctx, calld->call, rc->cq_bound_to_call);
-  grpc_call *call = calld->call;
+  grpc_call* call = calld->call;
   *rc->call = call;
   calld->cq_new = server->cqs[cq_idx];
   GPR_SWAP(grpc_metadata_array, *rc->initial_metadata, calld->initial_metadata);
@@ -507,26 +482,20 @@
       GPR_UNREACHABLE_CODE(return );
   }
 
-  grpc_call_element *elem =
-      grpc_call_stack_element(grpc_call_get_call_stack(call), 0);
-  channel_data *chand = (channel_data *)elem->channel_data;
-  server_ref(chand->server);
   grpc_cq_end_op(exec_ctx, calld->cq_new, rc->tag, GRPC_ERROR_NONE,
                  done_request_event, rc, &rc->completion);
 }
 
-static void publish_new_rpc(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_error *error) {
-  grpc_call_element *call_elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)call_elem->call_data;
-  channel_data *chand = (channel_data *)call_elem->channel_data;
-  request_matcher *rm = calld->matcher;
-  grpc_server *server = rm->server;
+static void publish_new_rpc(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_error* error) {
+  grpc_call_element* call_elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)call_elem->call_data;
+  channel_data* chand = (channel_data*)call_elem->channel_data;
+  request_matcher* rm = calld->matcher;
+  grpc_server* server = rm->server;
 
   if (error != GRPC_ERROR_NONE || gpr_atm_acq_load(&server->shutdown_flag)) {
-    gpr_mu_lock(&calld->mu_state);
-    calld->state = ZOMBIED;
-    gpr_mu_unlock(&calld->mu_state);
+    gpr_atm_no_barrier_store(&calld->state, ZOMBIED);
     GRPC_CLOSURE_INIT(
         &calld->kill_zombie_closure, kill_zombie,
         grpc_call_stack_element(grpc_call_get_call_stack(calld->call), 0),
@@ -538,16 +507,14 @@
 
   for (size_t i = 0; i < server->cq_count; i++) {
     size_t cq_idx = (chand->cq_idx + i) % server->cq_count;
-    int request_id = gpr_stack_lockfree_pop(rm->requests_per_cq[cq_idx]);
-    if (request_id == -1) {
+    requested_call* rc =
+        (requested_call*)gpr_locked_mpscq_try_pop(&rm->requests_per_cq[cq_idx]);
+    if (rc == NULL) {
       continue;
     } else {
       GRPC_STATS_INC_SERVER_CQS_CHECKED(exec_ctx, i);
-      gpr_mu_lock(&calld->mu_state);
-      calld->state = ACTIVATED;
-      gpr_mu_unlock(&calld->mu_state);
-      publish_call(exec_ctx, server, calld, cq_idx,
-                   &server->requested_calls_per_cq[cq_idx][request_id]);
+      gpr_atm_no_barrier_store(&calld->state, ACTIVATED);
+      publish_call(exec_ctx, server, calld, cq_idx, rc);
       return; /* early out */
     }
   }
@@ -555,9 +522,27 @@
   /* no cq to take the request found: queue it on the slow list */
   GRPC_STATS_INC_SERVER_SLOWPATH_REQUESTS_QUEUED(exec_ctx);
   gpr_mu_lock(&server->mu_call);
-  gpr_mu_lock(&calld->mu_state);
-  calld->state = PENDING;
-  gpr_mu_unlock(&calld->mu_state);
+
+  // We need to ensure that all the queues are empty.  We do this under
+  // the server mu_call lock to ensure that if something is added to
+  // an empty request queue, it will block until the call is actually
+  // added to the pending list.
+  for (size_t i = 0; i < server->cq_count; i++) {
+    size_t cq_idx = (chand->cq_idx + i) % server->cq_count;
+    requested_call* rc =
+        (requested_call*)gpr_locked_mpscq_pop(&rm->requests_per_cq[cq_idx]);
+    if (rc == NULL) {
+      continue;
+    } else {
+      gpr_mu_unlock(&server->mu_call);
+      GRPC_STATS_INC_SERVER_CQS_CHECKED(exec_ctx, i + server->cq_count);
+      gpr_atm_no_barrier_store(&calld->state, ACTIVATED);
+      publish_call(exec_ctx, server, calld, cq_idx, rc);
+      return; /* early out */
+    }
+  }
+
+  gpr_atm_no_barrier_store(&calld->state, PENDING);
   if (rm->pending_head == NULL) {
     rm->pending_tail = rm->pending_head = calld;
   } else {
@@ -569,15 +554,13 @@
 }
 
 static void finish_start_new_rpc(
-    grpc_exec_ctx *exec_ctx, grpc_server *server, grpc_call_element *elem,
-    request_matcher *rm,
+    grpc_exec_ctx* exec_ctx, grpc_server* server, grpc_call_element* elem,
+    request_matcher* rm,
     grpc_server_register_method_payload_handling payload_handling) {
-  call_data *calld = (call_data *)elem->call_data;
+  call_data* calld = (call_data*)elem->call_data;
 
   if (gpr_atm_acq_load(&server->shutdown_flag)) {
-    gpr_mu_lock(&calld->mu_state);
-    calld->state = ZOMBIED;
-    gpr_mu_unlock(&calld->mu_state);
+    gpr_atm_no_barrier_store(&calld->state, ZOMBIED);
     GRPC_CLOSURE_INIT(&calld->kill_zombie_closure, kill_zombie, elem,
                       grpc_schedule_on_exec_ctx);
     GRPC_CLOSURE_SCHED(exec_ctx, &calld->kill_zombie_closure, GRPC_ERROR_NONE);
@@ -604,13 +587,13 @@
   }
 }
 
-static void start_new_rpc(grpc_exec_ctx *exec_ctx, grpc_call_element *elem) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
-  grpc_server *server = chand->server;
+static void start_new_rpc(grpc_exec_ctx* exec_ctx, grpc_call_element* elem) {
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
+  grpc_server* server = chand->server;
   uint32_t i;
   uint32_t hash;
-  channel_registered_method *rm;
+  channel_registered_method* rm;
 
   if (chand->registered_methods && calld->path_set && calld->host_set) {
     /* TODO(ctiller): unify these two searches */
@@ -658,8 +641,8 @@
                        GRPC_SRM_PAYLOAD_NONE);
 }
 
-static int num_listeners(grpc_server *server) {
-  listener *l;
+static int num_listeners(grpc_server* server) {
+  listener* l;
   int n = 0;
   for (l = server->listeners; l; l = l->next) {
     n++;
@@ -667,13 +650,13 @@
   return n;
 }
 
-static void done_shutdown_event(grpc_exec_ctx *exec_ctx, void *server,
-                                grpc_cq_completion *completion) {
-  server_unref(exec_ctx, (grpc_server *)server);
+static void done_shutdown_event(grpc_exec_ctx* exec_ctx, void* server,
+                                grpc_cq_completion* completion) {
+  server_unref(exec_ctx, (grpc_server*)server);
 }
 
-static int num_channels(grpc_server *server) {
-  channel_data *chand;
+static int num_channels(grpc_server* server) {
+  channel_data* chand;
   int n = 0;
   for (chand = server->root_channel_data.next;
        chand != &server->root_channel_data; chand = chand->next) {
@@ -682,15 +665,15 @@
   return n;
 }
 
-static void kill_pending_work_locked(grpc_exec_ctx *exec_ctx,
-                                     grpc_server *server, grpc_error *error) {
+static void kill_pending_work_locked(grpc_exec_ctx* exec_ctx,
+                                     grpc_server* server, grpc_error* error) {
   if (server->started) {
     request_matcher_kill_requests(exec_ctx, server,
                                   &server->unregistered_request_matcher,
                                   GRPC_ERROR_REF(error));
     request_matcher_zombify_all_pending_calls(
         exec_ctx, &server->unregistered_request_matcher);
-    for (registered_method *rm = server->registered_methods; rm;
+    for (registered_method* rm = server->registered_methods; rm;
          rm = rm->next) {
       request_matcher_kill_requests(exec_ctx, server, &rm->matcher,
                                     GRPC_ERROR_REF(error));
@@ -700,8 +683,8 @@
   GRPC_ERROR_UNREF(error);
 }
 
-static void maybe_finish_shutdown(grpc_exec_ctx *exec_ctx,
-                                  grpc_server *server) {
+static void maybe_finish_shutdown(grpc_exec_ctx* exec_ctx,
+                                  grpc_server* server) {
   size_t i;
   if (!gpr_atm_acq_load(&server->shutdown_flag) || server->shutdown_published) {
     return;
@@ -736,10 +719,10 @@
   }
 }
 
-static void server_on_recv_initial_metadata(grpc_exec_ctx *exec_ctx, void *ptr,
-                                            grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)ptr;
-  call_data *calld = (call_data *)elem->call_data;
+static void server_on_recv_initial_metadata(grpc_exec_ctx* exec_ctx, void* ptr,
+                                            grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)ptr;
+  call_data* calld = (call_data*)elem->call_data;
   grpc_millis op_deadline;
 
   if (error == GRPC_ERROR_NONE) {
@@ -766,7 +749,7 @@
   if (calld->host_set && calld->path_set) {
     /* do nothing */
   } else {
-    grpc_error *src_error = error;
+    grpc_error* src_error = error;
     error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
         "Missing :authority or :path", &error, 1);
     GRPC_ERROR_UNREF(src_error);
@@ -775,9 +758,9 @@
   GRPC_CLOSURE_RUN(exec_ctx, calld->on_done_recv_initial_metadata, error);
 }
 
-static void server_mutate_op(grpc_call_element *elem,
-                             grpc_transport_stream_op_batch *op) {
-  call_data *calld = (call_data *)elem->call_data;
+static void server_mutate_op(grpc_call_element* elem,
+                             grpc_transport_stream_op_batch* op) {
+  call_data* calld = (call_data*)elem->call_data;
 
   if (op->recv_initial_metadata) {
     GPR_ASSERT(op->payload->recv_initial_metadata.recv_flags == NULL);
@@ -793,58 +776,51 @@
 }
 
 static void server_start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *op) {
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* op) {
   server_mutate_op(elem, op);
   grpc_call_next_op(exec_ctx, elem, op);
 }
 
-static void got_initial_metadata(grpc_exec_ctx *exec_ctx, void *ptr,
-                                 grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)ptr;
-  call_data *calld = (call_data *)elem->call_data;
+static void got_initial_metadata(grpc_exec_ctx* exec_ctx, void* ptr,
+                                 grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)ptr;
+  call_data* calld = (call_data*)elem->call_data;
   if (error == GRPC_ERROR_NONE) {
     start_new_rpc(exec_ctx, elem);
   } else {
-    gpr_mu_lock(&calld->mu_state);
-    if (calld->state == NOT_STARTED) {
-      calld->state = ZOMBIED;
-      gpr_mu_unlock(&calld->mu_state);
+    if (gpr_atm_full_cas(&calld->state, NOT_STARTED, ZOMBIED)) {
       GRPC_CLOSURE_INIT(&calld->kill_zombie_closure, kill_zombie, elem,
                         grpc_schedule_on_exec_ctx);
       GRPC_CLOSURE_SCHED(exec_ctx, &calld->kill_zombie_closure,
                          GRPC_ERROR_NONE);
-    } else if (calld->state == PENDING) {
-      calld->state = ZOMBIED;
-      gpr_mu_unlock(&calld->mu_state);
+    } else if (gpr_atm_full_cas(&calld->state, PENDING, ZOMBIED)) {
       /* zombied call will be destroyed when it's removed from the pending
          queue... later */
-    } else {
-      gpr_mu_unlock(&calld->mu_state);
     }
   }
 }
 
-static void accept_stream(grpc_exec_ctx *exec_ctx, void *cd,
-                          grpc_transport *transport,
-                          const void *transport_server_data) {
-  channel_data *chand = (channel_data *)cd;
+static void accept_stream(grpc_exec_ctx* exec_ctx, void* cd,
+                          grpc_transport* transport,
+                          const void* transport_server_data) {
+  channel_data* chand = (channel_data*)cd;
   /* create a call */
   grpc_call_create_args args;
   memset(&args, 0, sizeof(args));
   args.channel = chand->channel;
   args.server_transport_data = transport_server_data;
   args.send_deadline = GRPC_MILLIS_INF_FUTURE;
-  grpc_call *call;
-  grpc_error *error = grpc_call_create(exec_ctx, &args, &call);
-  grpc_call_element *elem =
+  grpc_call* call;
+  grpc_error* error = grpc_call_create(exec_ctx, &args, &call);
+  grpc_call_element* elem =
       grpc_call_stack_element(grpc_call_get_call_stack(call), 0);
   if (error != GRPC_ERROR_NONE) {
     got_initial_metadata(exec_ctx, elem, error);
     GRPC_ERROR_UNREF(error);
     return;
   }
-  call_data *calld = (call_data *)elem->call_data;
+  call_data* calld = (call_data*)elem->call_data;
   grpc_op op;
   memset(&op, 0, sizeof(op));
   op.op = GRPC_OP_RECV_INITIAL_METADATA;
@@ -856,12 +832,12 @@
                                     &calld->got_initial_metadata);
 }
 
-static void channel_connectivity_changed(grpc_exec_ctx *exec_ctx, void *cd,
-                                         grpc_error *error) {
-  channel_data *chand = (channel_data *)cd;
-  grpc_server *server = chand->server;
+static void channel_connectivity_changed(grpc_exec_ctx* exec_ctx, void* cd,
+                                         grpc_error* error) {
+  channel_data* chand = (channel_data*)cd;
+  grpc_server* server = chand->server;
   if (chand->connectivity_state != GRPC_CHANNEL_SHUTDOWN) {
-    grpc_transport_op *op = grpc_make_transport_op(NULL);
+    grpc_transport_op* op = grpc_make_transport_op(NULL);
     op->on_connectivity_state_change = &chand->channel_connectivity_changed,
     op->connectivity_state = &chand->connectivity_state;
     grpc_channel_next_op(exec_ctx,
@@ -876,15 +852,14 @@
   }
 }
 
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  call_data *calld = (call_data *)elem->call_data;
-  channel_data *chand = (channel_data *)elem->channel_data;
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  call_data* calld = (call_data*)elem->call_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   memset(calld, 0, sizeof(call_data));
   calld->deadline = GRPC_MILLIS_INF_FUTURE;
   calld->call = grpc_call_from_top_element(elem);
-  gpr_mu_init(&calld->mu_state);
 
   GRPC_CLOSURE_INIT(&calld->server_on_recv_initial_metadata,
                     server_on_recv_initial_metadata, elem,
@@ -894,11 +869,11 @@
   return GRPC_ERROR_NONE;
 }
 
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {
-  channel_data *chand = (channel_data *)elem->channel_data;
-  call_data *calld = (call_data *)elem->call_data;
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {
+  channel_data* chand = (channel_data*)elem->channel_data;
+  call_data* calld = (call_data*)elem->call_data;
 
   GPR_ASSERT(calld->state != PENDING);
 
@@ -911,15 +886,13 @@
   grpc_metadata_array_destroy(&calld->initial_metadata);
   grpc_byte_buffer_destroy(calld->payload);
 
-  gpr_mu_destroy(&calld->mu_state);
-
   server_unref(exec_ctx, chand->server);
 }
 
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  channel_data *chand = (channel_data *)elem->channel_data;
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  channel_data* chand = (channel_data*)elem->channel_data;
   GPR_ASSERT(args->is_first);
   GPR_ASSERT(!args->is_last);
   chand->server = NULL;
@@ -933,10 +906,10 @@
   return GRPC_ERROR_NONE;
 }
 
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {
   size_t i;
-  channel_data *chand = (channel_data *)elem->channel_data;
+  channel_data* chand = (channel_data*)elem->channel_data;
   if (chand->registered_methods) {
     for (i = 0; i < chand->registered_method_slots; i++) {
       grpc_slice_unref_internal(exec_ctx, chand->registered_methods[i].method);
@@ -971,9 +944,9 @@
     "server",
 };
 
-static void register_completion_queue(grpc_server *server,
-                                      grpc_completion_queue *cq,
-                                      void *reserved) {
+static void register_completion_queue(grpc_server* server,
+                                      grpc_completion_queue* cq,
+                                      void* reserved) {
   size_t i, n;
   GPR_ASSERT(!reserved);
   for (i = 0; i < server->cq_count; i++) {
@@ -982,14 +955,14 @@
 
   GRPC_CQ_INTERNAL_REF(cq, "server");
   n = server->cq_count++;
-  server->cqs = (grpc_completion_queue **)gpr_realloc(
-      server->cqs, server->cq_count * sizeof(grpc_completion_queue *));
+  server->cqs = (grpc_completion_queue**)gpr_realloc(
+      server->cqs, server->cq_count * sizeof(grpc_completion_queue*));
   server->cqs[n] = cq;
 }
 
-void grpc_server_register_completion_queue(grpc_server *server,
-                                           grpc_completion_queue *cq,
-                                           void *reserved) {
+void grpc_server_register_completion_queue(grpc_server* server,
+                                           grpc_completion_queue* cq,
+                                           void* reserved) {
   GRPC_API_TRACE(
       "grpc_server_register_completion_queue(server=%p, cq=%p, reserved=%p)", 3,
       (server, cq, reserved));
@@ -1005,10 +978,10 @@
   register_completion_queue(server, cq, reserved);
 }
 
-grpc_server *grpc_server_create(const grpc_channel_args *args, void *reserved) {
+grpc_server* grpc_server_create(const grpc_channel_args* args, void* reserved) {
   GRPC_API_TRACE("grpc_server_create(%p, %p)", 2, (args, reserved));
 
-  grpc_server *server = (grpc_server *)gpr_zalloc(sizeof(grpc_server));
+  grpc_server* server = (grpc_server*)gpr_zalloc(sizeof(grpc_server));
 
   gpr_mu_init(&server->mu_global);
   gpr_mu_init(&server->mu_call);
@@ -1019,25 +992,23 @@
   server->root_channel_data.next = server->root_channel_data.prev =
       &server->root_channel_data;
 
-  /* TODO(ctiller): expose a channel_arg for this */
-  server->max_requested_calls_per_cq = 32768;
   server->channel_args = grpc_channel_args_copy(args);
 
   return server;
 }
 
-static int streq(const char *a, const char *b) {
+static int streq(const char* a, const char* b) {
   if (a == NULL && b == NULL) return 1;
   if (a == NULL) return 0;
   if (b == NULL) return 0;
   return 0 == strcmp(a, b);
 }
 
-void *grpc_server_register_method(
-    grpc_server *server, const char *method, const char *host,
+void* grpc_server_register_method(
+    grpc_server* server, const char* method, const char* host,
     grpc_server_register_method_payload_handling payload_handling,
     uint32_t flags) {
-  registered_method *m;
+  registered_method* m;
   GRPC_API_TRACE(
       "grpc_server_register_method(server=%p, method=%s, host=%s, "
       "flags=0x%08x)",
@@ -1059,7 +1030,7 @@
             flags);
     return NULL;
   }
-  m = (registered_method *)gpr_zalloc(sizeof(registered_method));
+  m = (registered_method*)gpr_zalloc(sizeof(registered_method));
   m->method = gpr_strdup(method);
   m->host = gpr_strdup(host);
   m->next = server->registered_methods;
@@ -1069,10 +1040,10 @@
   return m;
 }
 
-static void start_listeners(grpc_exec_ctx *exec_ctx, void *s,
-                            grpc_error *error) {
-  grpc_server *server = (grpc_server *)s;
-  for (listener *l = server->listeners; l; l = l->next) {
+static void start_listeners(grpc_exec_ctx* exec_ctx, void* s,
+                            grpc_error* error) {
+  grpc_server* server = (grpc_server*)s;
+  for (listener* l = server->listeners; l; l = l->next) {
     l->start(exec_ctx, server, l->arg, server->pollsets, server->pollset_count);
   }
 
@@ -1084,7 +1055,7 @@
   server_unref(exec_ctx, server);
 }
 
-void grpc_server_start(grpc_server *server) {
+void grpc_server_start(grpc_server* server) {
   size_t i;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
@@ -1093,30 +1064,16 @@
   server->started = true;
   server->pollset_count = 0;
   server->pollsets =
-      (grpc_pollset **)gpr_malloc(sizeof(grpc_pollset *) * server->cq_count);
-  server->request_freelist_per_cq = (gpr_stack_lockfree **)gpr_malloc(
-      sizeof(*server->request_freelist_per_cq) * server->cq_count);
-  server->requested_calls_per_cq = (requested_call **)gpr_malloc(
-      sizeof(*server->requested_calls_per_cq) * server->cq_count);
+      (grpc_pollset**)gpr_malloc(sizeof(grpc_pollset*) * server->cq_count);
   for (i = 0; i < server->cq_count; i++) {
     if (grpc_cq_can_listen(server->cqs[i])) {
       server->pollsets[server->pollset_count++] =
           grpc_cq_pollset(server->cqs[i]);
     }
-    server->request_freelist_per_cq[i] =
-        gpr_stack_lockfree_create((size_t)server->max_requested_calls_per_cq);
-    for (int j = 0; j < server->max_requested_calls_per_cq; j++) {
-      gpr_stack_lockfree_push(server->request_freelist_per_cq[i], j);
-    }
-    server->requested_calls_per_cq[i] = (requested_call *)gpr_malloc(
-        (size_t)server->max_requested_calls_per_cq *
-        sizeof(*server->requested_calls_per_cq[i]));
   }
-  request_matcher_init(&server->unregistered_request_matcher,
-                       (size_t)server->max_requested_calls_per_cq, server);
-  for (registered_method *rm = server->registered_methods; rm; rm = rm->next) {
-    request_matcher_init(&rm->matcher,
-                         (size_t)server->max_requested_calls_per_cq, server);
+  request_matcher_init(&server->unregistered_request_matcher, server);
+  for (registered_method* rm = server->registered_methods; rm; rm = rm->next) {
+    request_matcher_init(&rm->matcher, server);
   }
 
   server_ref(server);
@@ -1130,31 +1087,31 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-void grpc_server_get_pollsets(grpc_server *server, grpc_pollset ***pollsets,
-                              size_t *pollset_count) {
+void grpc_server_get_pollsets(grpc_server* server, grpc_pollset*** pollsets,
+                              size_t* pollset_count) {
   *pollset_count = server->pollset_count;
   *pollsets = server->pollsets;
 }
 
-void grpc_server_setup_transport(grpc_exec_ctx *exec_ctx, grpc_server *s,
-                                 grpc_transport *transport,
-                                 grpc_pollset *accepting_pollset,
-                                 const grpc_channel_args *args) {
+void grpc_server_setup_transport(grpc_exec_ctx* exec_ctx, grpc_server* s,
+                                 grpc_transport* transport,
+                                 grpc_pollset* accepting_pollset,
+                                 const grpc_channel_args* args) {
   size_t num_registered_methods;
   size_t alloc;
-  registered_method *rm;
-  channel_registered_method *crm;
-  grpc_channel *channel;
-  channel_data *chand;
+  registered_method* rm;
+  channel_registered_method* crm;
+  grpc_channel* channel;
+  channel_data* chand;
   uint32_t hash;
   size_t slots;
   uint32_t probes;
   uint32_t max_probes = 0;
-  grpc_transport_op *op = NULL;
+  grpc_transport_op* op = NULL;
 
   channel =
       grpc_channel_create(exec_ctx, NULL, args, GRPC_SERVER_CHANNEL, transport);
-  chand = (channel_data *)grpc_channel_stack_element(
+  chand = (channel_data*)grpc_channel_stack_element(
               grpc_channel_get_channel_stack(channel), 0)
               ->channel_data;
   chand->server = s;
@@ -1180,7 +1137,7 @@
   if (num_registered_methods > 0) {
     slots = 2 * num_registered_methods;
     alloc = sizeof(channel_registered_method) * slots;
-    chand->registered_methods = (channel_registered_method *)gpr_zalloc(alloc);
+    chand->registered_methods = (channel_registered_method*)gpr_zalloc(alloc);
     for (rm = s->registered_methods; rm; rm = rm->next) {
       grpc_slice host;
       bool has_host;
@@ -1233,25 +1190,25 @@
   grpc_transport_perform_op(exec_ctx, transport, op);
 }
 
-void done_published_shutdown(grpc_exec_ctx *exec_ctx, void *done_arg,
-                             grpc_cq_completion *storage) {
+void done_published_shutdown(grpc_exec_ctx* exec_ctx, void* done_arg,
+                             grpc_cq_completion* storage) {
   (void)done_arg;
   gpr_free(storage);
 }
 
-static void listener_destroy_done(grpc_exec_ctx *exec_ctx, void *s,
-                                  grpc_error *error) {
-  grpc_server *server = (grpc_server *)s;
+static void listener_destroy_done(grpc_exec_ctx* exec_ctx, void* s,
+                                  grpc_error* error) {
+  grpc_server* server = (grpc_server*)s;
   gpr_mu_lock(&server->mu_global);
   server->listeners_destroyed++;
   maybe_finish_shutdown(exec_ctx, server);
   gpr_mu_unlock(&server->mu_global);
 }
 
-void grpc_server_shutdown_and_notify(grpc_server *server,
-                                     grpc_completion_queue *cq, void *tag) {
-  listener *l;
-  shutdown_tag *sdt;
+void grpc_server_shutdown_and_notify(grpc_server* server,
+                                     grpc_completion_queue* cq, void* tag) {
+  listener* l;
+  shutdown_tag* sdt;
   channel_broadcaster broadcaster;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
@@ -1268,13 +1225,13 @@
   /* stay locked, and gather up some stuff to do */
   GPR_ASSERT(grpc_cq_begin_op(cq, tag));
   if (server->shutdown_published) {
-    grpc_cq_end_op(
-        &exec_ctx, cq, tag, GRPC_ERROR_NONE, done_published_shutdown, NULL,
-        (grpc_cq_completion *)gpr_malloc(sizeof(grpc_cq_completion)));
+    grpc_cq_end_op(&exec_ctx, cq, tag, GRPC_ERROR_NONE, done_published_shutdown,
+                   NULL,
+                   (grpc_cq_completion*)gpr_malloc(sizeof(grpc_cq_completion)));
     gpr_mu_unlock(&server->mu_global);
     goto done;
   }
-  server->shutdown_tags = (shutdown_tag *)gpr_realloc(
+  server->shutdown_tags = (shutdown_tag*)gpr_realloc(
       server->shutdown_tags,
       sizeof(shutdown_tag) * (server->num_shutdown_tags + 1));
   sdt = &server->shutdown_tags[server->num_shutdown_tags++];
@@ -1315,7 +1272,7 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-void grpc_server_cancel_all_calls(grpc_server *server) {
+void grpc_server_cancel_all_calls(grpc_server* server) {
   channel_broadcaster broadcaster;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
@@ -1331,8 +1288,8 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-void grpc_server_destroy(grpc_server *server) {
-  listener *l;
+void grpc_server_destroy(grpc_server* server) {
+  listener* l;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
   GRPC_API_TRACE("grpc_server_destroy(server=%p)", 1, (server));
@@ -1354,12 +1311,12 @@
 }
 
 void grpc_server_add_listener(
-    grpc_exec_ctx *exec_ctx, grpc_server *server, void *arg,
-    void (*start)(grpc_exec_ctx *exec_ctx, grpc_server *server, void *arg,
-                  grpc_pollset **pollsets, size_t pollset_count),
-    void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_server *server, void *arg,
-                    grpc_closure *on_done)) {
-  listener *l = (listener *)gpr_malloc(sizeof(listener));
+    grpc_exec_ctx* exec_ctx, grpc_server* server, void* arg,
+    void (*start)(grpc_exec_ctx* exec_ctx, grpc_server* server, void* arg,
+                  grpc_pollset** pollsets, size_t pollset_count),
+    void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_server* server, void* arg,
+                    grpc_closure* on_done)) {
+  listener* l = (listener*)gpr_malloc(sizeof(listener));
   l->arg = arg;
   l->start = start;
   l->destroy = destroy;
@@ -1367,26 +1324,16 @@
   server->listeners = l;
 }
 
-static grpc_call_error queue_call_request(grpc_exec_ctx *exec_ctx,
-                                          grpc_server *server, size_t cq_idx,
-                                          requested_call *rc) {
-  call_data *calld = NULL;
-  request_matcher *rm = NULL;
-  int request_id;
+static grpc_call_error queue_call_request(grpc_exec_ctx* exec_ctx,
+                                          grpc_server* server, size_t cq_idx,
+                                          requested_call* rc) {
+  call_data* calld = NULL;
+  request_matcher* rm = NULL;
   if (gpr_atm_acq_load(&server->shutdown_flag)) {
     fail_call(exec_ctx, server, cq_idx, rc,
               GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
     return GRPC_CALL_OK;
   }
-  request_id = gpr_stack_lockfree_pop(server->request_freelist_per_cq[cq_idx]);
-  if (request_id == -1) {
-    /* out of request ids: just fail this one */
-    fail_call(exec_ctx, server, cq_idx, rc,
-              grpc_error_set_int(
-                  GRPC_ERROR_CREATE_FROM_STATIC_STRING("Out of request ids"),
-                  GRPC_ERROR_INT_LIMIT, server->max_requested_calls_per_cq));
-    return GRPC_CALL_OK;
-  }
   switch (rc->type) {
     case BATCH_CALL:
       rm = &server->unregistered_request_matcher;
@@ -1395,20 +1342,17 @@
       rm = &rc->data.registered.method->matcher;
       break;
   }
-  server->requested_calls_per_cq[cq_idx][request_id] = *rc;
-  gpr_free(rc);
-  if (gpr_stack_lockfree_push(rm->requests_per_cq[cq_idx], request_id)) {
+  if (gpr_locked_mpscq_push(&rm->requests_per_cq[cq_idx], &rc->request_link)) {
     /* this was the first queued request: we need to lock and start
        matching calls */
     gpr_mu_lock(&server->mu_call);
     while ((calld = rm->pending_head) != NULL) {
-      request_id = gpr_stack_lockfree_pop(rm->requests_per_cq[cq_idx]);
-      if (request_id == -1) break;
+      rc = (requested_call*)gpr_locked_mpscq_pop(&rm->requests_per_cq[cq_idx]);
+      if (rc == NULL) break;
       rm->pending_head = calld->pending_next;
       gpr_mu_unlock(&server->mu_call);
-      gpr_mu_lock(&calld->mu_state);
-      if (calld->state == ZOMBIED) {
-        gpr_mu_unlock(&calld->mu_state);
+      if (!gpr_atm_full_cas(&calld->state, PENDING, ACTIVATED)) {
+        // Zombied Call
         GRPC_CLOSURE_INIT(
             &calld->kill_zombie_closure, kill_zombie,
             grpc_call_stack_element(grpc_call_get_call_stack(calld->call), 0),
@@ -1416,11 +1360,7 @@
         GRPC_CLOSURE_SCHED(exec_ctx, &calld->kill_zombie_closure,
                            GRPC_ERROR_NONE);
       } else {
-        GPR_ASSERT(calld->state == PENDING);
-        calld->state = ACTIVATED;
-        gpr_mu_unlock(&calld->mu_state);
-        publish_call(exec_ctx, server, calld, cq_idx,
-                     &server->requested_calls_per_cq[cq_idx][request_id]);
+        publish_call(exec_ctx, server, calld, cq_idx, rc);
       }
       gpr_mu_lock(&server->mu_call);
     }
@@ -1430,20 +1370,21 @@
 }
 
 grpc_call_error grpc_server_request_call(
-    grpc_server *server, grpc_call **call, grpc_call_details *details,
-    grpc_metadata_array *initial_metadata,
-    grpc_completion_queue *cq_bound_to_call,
-    grpc_completion_queue *cq_for_notification, void *tag) {
+    grpc_server* server, grpc_call** call, grpc_call_details* details,
+    grpc_metadata_array* initial_metadata,
+    grpc_completion_queue* cq_bound_to_call,
+    grpc_completion_queue* cq_for_notification, void* tag) {
   grpc_call_error error;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  requested_call *rc = (requested_call *)gpr_malloc(sizeof(*rc));
+  requested_call* rc = (requested_call*)gpr_malloc(sizeof(*rc));
   GRPC_STATS_INC_SERVER_REQUESTED_CALLS(&exec_ctx);
   GRPC_API_TRACE(
       "grpc_server_request_call("
       "server=%p, call=%p, details=%p, initial_metadata=%p, "
       "cq_bound_to_call=%p, cq_for_notification=%p, tag=%p)",
-      7, (server, call, details, initial_metadata, cq_bound_to_call,
-          cq_for_notification, tag));
+      7,
+      (server, call, details, initial_metadata, cq_bound_to_call,
+       cq_for_notification, tag));
   size_t cq_idx;
   for (cq_idx = 0; cq_idx < server->cq_count; cq_idx++) {
     if (server->cqs[cq_idx] == cq_for_notification) {
@@ -1476,22 +1417,23 @@
 }
 
 grpc_call_error grpc_server_request_registered_call(
-    grpc_server *server, void *rmp, grpc_call **call, gpr_timespec *deadline,
-    grpc_metadata_array *initial_metadata, grpc_byte_buffer **optional_payload,
-    grpc_completion_queue *cq_bound_to_call,
-    grpc_completion_queue *cq_for_notification, void *tag) {
+    grpc_server* server, void* rmp, grpc_call** call, gpr_timespec* deadline,
+    grpc_metadata_array* initial_metadata, grpc_byte_buffer** optional_payload,
+    grpc_completion_queue* cq_bound_to_call,
+    grpc_completion_queue* cq_for_notification, void* tag) {
   grpc_call_error error;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  requested_call *rc = (requested_call *)gpr_malloc(sizeof(*rc));
-  registered_method *rm = (registered_method *)rmp;
+  requested_call* rc = (requested_call*)gpr_malloc(sizeof(*rc));
+  registered_method* rm = (registered_method*)rmp;
   GRPC_STATS_INC_SERVER_REQUESTED_CALLS(&exec_ctx);
   GRPC_API_TRACE(
       "grpc_server_request_registered_call("
       "server=%p, rmp=%p, call=%p, deadline=%p, initial_metadata=%p, "
       "optional_payload=%p, cq_bound_to_call=%p, cq_for_notification=%p, "
       "tag=%p)",
-      9, (server, rmp, call, deadline, initial_metadata, optional_payload,
-          cq_bound_to_call, cq_for_notification, tag));
+      9,
+      (server, rmp, call, deadline, initial_metadata, optional_payload,
+       cq_bound_to_call, cq_for_notification, tag));
 
   size_t cq_idx;
   for (cq_idx = 0; cq_idx < server->cq_count; cq_idx++) {
@@ -1531,22 +1473,21 @@
   return error;
 }
 
-static void fail_call(grpc_exec_ctx *exec_ctx, grpc_server *server,
-                      size_t cq_idx, requested_call *rc, grpc_error *error) {
+static void fail_call(grpc_exec_ctx* exec_ctx, grpc_server* server,
+                      size_t cq_idx, requested_call* rc, grpc_error* error) {
   *rc->call = NULL;
   rc->initial_metadata->count = 0;
   GPR_ASSERT(error != GRPC_ERROR_NONE);
 
-  server_ref(server);
   grpc_cq_end_op(exec_ctx, server->cqs[cq_idx], rc->tag, error,
                  done_request_event, rc, &rc->completion);
 }
 
-const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server) {
+const grpc_channel_args* grpc_server_get_channel_args(grpc_server* server) {
   return server->channel_args;
 }
 
-int grpc_server_has_open_connections(grpc_server *server) {
+int grpc_server_has_open_connections(grpc_server* server) {
   int r;
   gpr_mu_lock(&server->mu_global);
   r = server->root_channel_data.next != &server->root_channel_data;
diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h
index a7c3405..d5c2b0f 100644
--- a/src/core/lib/surface/server.h
+++ b/src/core/lib/surface/server.h
@@ -36,27 +36,27 @@
 /* Add a listener to the server: when the server starts, it will call start,
    and when it shuts down, it will call destroy */
 void grpc_server_add_listener(
-    grpc_exec_ctx *exec_ctx, grpc_server *server, void *listener,
-    void (*start)(grpc_exec_ctx *exec_ctx, grpc_server *server, void *arg,
-                  grpc_pollset **pollsets, size_t npollsets),
-    void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_server *server, void *arg,
-                    grpc_closure *on_done));
+    grpc_exec_ctx* exec_ctx, grpc_server* server, void* listener,
+    void (*start)(grpc_exec_ctx* exec_ctx, grpc_server* server, void* arg,
+                  grpc_pollset** pollsets, size_t npollsets),
+    void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_server* server, void* arg,
+                    grpc_closure* on_done));
 
 /* Setup a transport - creates a channel stack, binds the transport to the
    server */
-void grpc_server_setup_transport(grpc_exec_ctx *exec_ctx, grpc_server *server,
-                                 grpc_transport *transport,
-                                 grpc_pollset *accepting_pollset,
-                                 const grpc_channel_args *args);
+void grpc_server_setup_transport(grpc_exec_ctx* exec_ctx, grpc_server* server,
+                                 grpc_transport* transport,
+                                 grpc_pollset* accepting_pollset,
+                                 const grpc_channel_args* args);
 
-const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server);
+const grpc_channel_args* grpc_server_get_channel_args(grpc_server* server);
 
-int grpc_server_has_open_connections(grpc_server *server);
+int grpc_server_has_open_connections(grpc_server* server);
 
 /* Do not call this before grpc_server_start. Returns the pollsets and the
  * number of pollsets via 'pollsets' and 'pollset_count'. */
-void grpc_server_get_pollsets(grpc_server *server, grpc_pollset ***pollsets,
-                              size_t *pollset_count);
+void grpc_server_get_pollsets(grpc_server* server, grpc_pollset*** pollsets,
+                              size_t* pollset_count);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/surface/validate_metadata.cc b/src/core/lib/surface/validate_metadata.cc
index 81d07fa..fc94ea7 100644
--- a/src/core/lib/surface/validate_metadata.cc
+++ b/src/core/lib/surface/validate_metadata.cc
@@ -28,17 +28,17 @@
 #include "src/core/lib/slice/slice_string_helpers.h"
 #include "src/core/lib/surface/validate_metadata.h"
 
-static grpc_error *conforms_to(grpc_slice slice, const uint8_t *legal_bits,
-                               const char *err_desc) {
-  const uint8_t *p = GRPC_SLICE_START_PTR(slice);
-  const uint8_t *e = GRPC_SLICE_END_PTR(slice);
+static grpc_error* conforms_to(grpc_slice slice, const uint8_t* legal_bits,
+                               const char* err_desc) {
+  const uint8_t* p = GRPC_SLICE_START_PTR(slice);
+  const uint8_t* e = GRPC_SLICE_END_PTR(slice);
   for (; p != e; p++) {
     int idx = *p;
     int byte = idx / 8;
     int bit = idx % 8;
     if ((legal_bits[byte] & (1 << bit)) == 0) {
-      char *dump = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-      grpc_error *error = grpc_error_set_str(
+      char* dump = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+      grpc_error* error = grpc_error_set_str(
           grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(err_desc),
                              GRPC_ERROR_INT_OFFSET,
                              p - GRPC_SLICE_START_PTR(slice)),
@@ -50,13 +50,13 @@
   return GRPC_ERROR_NONE;
 }
 
-static int error2int(grpc_error *error) {
+static int error2int(grpc_error* error) {
   int r = (error == GRPC_ERROR_NONE);
   GRPC_ERROR_UNREF(error);
   return r;
 }
 
-grpc_error *grpc_validate_header_key_is_legal(grpc_slice slice) {
+grpc_error* grpc_validate_header_key_is_legal(grpc_slice slice) {
   static const uint8_t legal_header_bits[256 / 8] = {
       0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xff, 0x03, 0x00, 0x00, 0x00,
       0x80, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -76,7 +76,7 @@
   return error2int(grpc_validate_header_key_is_legal(slice));
 }
 
-grpc_error *grpc_validate_header_nonbin_value_is_legal(grpc_slice slice) {
+grpc_error* grpc_validate_header_nonbin_value_is_legal(grpc_slice slice) {
   static const uint8_t legal_header_bits[256 / 8] = {
       0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
       0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/src/core/lib/surface/validate_metadata.h b/src/core/lib/surface/validate_metadata.h
index afc8be6..9ca2069 100644
--- a/src/core/lib/surface/validate_metadata.h
+++ b/src/core/lib/surface/validate_metadata.h
@@ -26,8 +26,8 @@
 extern "C" {
 #endif
 
-grpc_error *grpc_validate_header_key_is_legal(grpc_slice slice);
-grpc_error *grpc_validate_header_nonbin_value_is_legal(grpc_slice slice);
+grpc_error* grpc_validate_header_key_is_legal(grpc_slice slice);
+grpc_error* grpc_validate_header_nonbin_value_is_legal(grpc_slice slice);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc
index 6cb8e7e..f4feadc 100644
--- a/src/core/lib/surface/version.cc
+++ b/src/core/lib/surface/version.cc
@@ -21,6 +21,6 @@
 
 #include <grpc/grpc.h>
 
-const char *grpc_version_string(void) { return "5.0.0-dev"; }
+const char* grpc_version_string(void) { return "5.0.0-dev"; }
 
-const char *grpc_g_stands_for(void) { return "generous"; }
+const char* grpc_g_stands_for(void) { return "generous"; }
diff --git a/src/core/lib/transport/bdp_estimator.cc b/src/core/lib/transport/bdp_estimator.cc
index a9db572..bb0e583 100644
--- a/src/core/lib/transport/bdp_estimator.cc
+++ b/src/core/lib/transport/bdp_estimator.cc
@@ -27,7 +27,7 @@
 
 namespace grpc_core {
 
-BdpEstimator::BdpEstimator(const char *name)
+BdpEstimator::BdpEstimator(const char* name)
     : ping_state_(PingState::UNSCHEDULED),
       accumulator_(0),
       estimate_(65536),
@@ -37,15 +37,16 @@
       bw_est_(0),
       name_(name) {}
 
-grpc_millis BdpEstimator::CompletePing(grpc_exec_ctx *exec_ctx) {
+grpc_millis BdpEstimator::CompletePing(grpc_exec_ctx* exec_ctx) {
   gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
   gpr_timespec dt_ts = gpr_time_sub(now, ping_start_time_);
   double dt = (double)dt_ts.tv_sec + 1e-9 * (double)dt_ts.tv_nsec;
   double bw = dt > 0 ? ((double)accumulator_ / dt) : 0;
   int start_inter_ping_delay = inter_ping_delay_;
   if (grpc_bdp_estimator_trace.enabled()) {
-    gpr_log(GPR_DEBUG, "bdp[%s]:complete acc=%" PRId64 " est=%" PRId64
-                       " dt=%lf bw=%lfMbs bw_est=%lfMbs",
+    gpr_log(GPR_DEBUG,
+            "bdp[%s]:complete acc=%" PRId64 " est=%" PRId64
+            " dt=%lf bw=%lfMbs bw_est=%lfMbs",
             name_, accumulator_, estimate_, dt, bw / 125000.0,
             bw_est_ / 125000.0);
   }
diff --git a/src/core/lib/transport/bdp_estimator.h b/src/core/lib/transport/bdp_estimator.h
index 872cfaa..df3a86c 100644
--- a/src/core/lib/transport/bdp_estimator.h
+++ b/src/core/lib/transport/bdp_estimator.h
@@ -37,7 +37,7 @@
 
 class BdpEstimator {
  public:
-  explicit BdpEstimator(const char *name);
+  explicit BdpEstimator(const char* name);
   ~BdpEstimator() {}
 
   int64_t EstimateBdp() const { return estimate_; }
@@ -73,7 +73,7 @@
   }
 
   // Completes a previously started ping, returns when to schedule the next one
-  grpc_millis CompletePing(grpc_exec_ctx *exec_ctx);
+  grpc_millis CompletePing(grpc_exec_ctx* exec_ctx);
 
  private:
   enum class PingState { UNSCHEDULED, SCHEDULED, STARTED };
@@ -86,7 +86,7 @@
   int inter_ping_delay_;
   int stable_estimate_count_;
   double bw_est_;
-  const char *name_;
+  const char* name_;
 };
 
 }  // namespace grpc_core
diff --git a/src/core/lib/transport/byte_stream.cc b/src/core/lib/transport/byte_stream.cc
index 08f6162..b872025 100644
--- a/src/core/lib/transport/byte_stream.cc
+++ b/src/core/lib/transport/byte_stream.cc
@@ -25,45 +25,45 @@
 
 #include "src/core/lib/slice/slice_internal.h"
 
-bool grpc_byte_stream_next(grpc_exec_ctx *exec_ctx,
-                           grpc_byte_stream *byte_stream, size_t max_size_hint,
-                           grpc_closure *on_complete) {
+bool grpc_byte_stream_next(grpc_exec_ctx* exec_ctx,
+                           grpc_byte_stream* byte_stream, size_t max_size_hint,
+                           grpc_closure* on_complete) {
   return byte_stream->vtable->next(exec_ctx, byte_stream, max_size_hint,
                                    on_complete);
 }
 
-grpc_error *grpc_byte_stream_pull(grpc_exec_ctx *exec_ctx,
-                                  grpc_byte_stream *byte_stream,
-                                  grpc_slice *slice) {
+grpc_error* grpc_byte_stream_pull(grpc_exec_ctx* exec_ctx,
+                                  grpc_byte_stream* byte_stream,
+                                  grpc_slice* slice) {
   return byte_stream->vtable->pull(exec_ctx, byte_stream, slice);
 }
 
-void grpc_byte_stream_shutdown(grpc_exec_ctx *exec_ctx,
-                               grpc_byte_stream *byte_stream,
-                               grpc_error *error) {
+void grpc_byte_stream_shutdown(grpc_exec_ctx* exec_ctx,
+                               grpc_byte_stream* byte_stream,
+                               grpc_error* error) {
   byte_stream->vtable->shutdown(exec_ctx, byte_stream, error);
 }
 
-void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx,
-                              grpc_byte_stream *byte_stream) {
+void grpc_byte_stream_destroy(grpc_exec_ctx* exec_ctx,
+                              grpc_byte_stream* byte_stream) {
   byte_stream->vtable->destroy(exec_ctx, byte_stream);
 }
 
 // grpc_slice_buffer_stream
 
-static bool slice_buffer_stream_next(grpc_exec_ctx *exec_ctx,
-                                     grpc_byte_stream *byte_stream,
+static bool slice_buffer_stream_next(grpc_exec_ctx* exec_ctx,
+                                     grpc_byte_stream* byte_stream,
                                      size_t max_size_hint,
-                                     grpc_closure *on_complete) {
-  grpc_slice_buffer_stream *stream = (grpc_slice_buffer_stream *)byte_stream;
+                                     grpc_closure* on_complete) {
+  grpc_slice_buffer_stream* stream = (grpc_slice_buffer_stream*)byte_stream;
   GPR_ASSERT(stream->cursor < stream->backing_buffer->count);
   return true;
 }
 
-static grpc_error *slice_buffer_stream_pull(grpc_exec_ctx *exec_ctx,
-                                            grpc_byte_stream *byte_stream,
-                                            grpc_slice *slice) {
-  grpc_slice_buffer_stream *stream = (grpc_slice_buffer_stream *)byte_stream;
+static grpc_error* slice_buffer_stream_pull(grpc_exec_ctx* exec_ctx,
+                                            grpc_byte_stream* byte_stream,
+                                            grpc_slice* slice) {
+  grpc_slice_buffer_stream* stream = (grpc_slice_buffer_stream*)byte_stream;
   if (stream->shutdown_error != GRPC_ERROR_NONE) {
     return GRPC_ERROR_REF(stream->shutdown_error);
   }
@@ -74,17 +74,17 @@
   return GRPC_ERROR_NONE;
 }
 
-static void slice_buffer_stream_shutdown(grpc_exec_ctx *exec_ctx,
-                                         grpc_byte_stream *byte_stream,
-                                         grpc_error *error) {
-  grpc_slice_buffer_stream *stream = (grpc_slice_buffer_stream *)byte_stream;
+static void slice_buffer_stream_shutdown(grpc_exec_ctx* exec_ctx,
+                                         grpc_byte_stream* byte_stream,
+                                         grpc_error* error) {
+  grpc_slice_buffer_stream* stream = (grpc_slice_buffer_stream*)byte_stream;
   GRPC_ERROR_UNREF(stream->shutdown_error);
   stream->shutdown_error = error;
 }
 
-static void slice_buffer_stream_destroy(grpc_exec_ctx *exec_ctx,
-                                        grpc_byte_stream *byte_stream) {
-  grpc_slice_buffer_stream *stream = (grpc_slice_buffer_stream *)byte_stream;
+static void slice_buffer_stream_destroy(grpc_exec_ctx* exec_ctx,
+                                        grpc_byte_stream* byte_stream) {
+  grpc_slice_buffer_stream* stream = (grpc_slice_buffer_stream*)byte_stream;
   grpc_slice_buffer_reset_and_unref_internal(exec_ctx, stream->backing_buffer);
   GRPC_ERROR_UNREF(stream->shutdown_error);
 }
@@ -93,8 +93,8 @@
     slice_buffer_stream_next, slice_buffer_stream_pull,
     slice_buffer_stream_shutdown, slice_buffer_stream_destroy};
 
-void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream *stream,
-                                   grpc_slice_buffer *slice_buffer,
+void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream* stream,
+                                   grpc_slice_buffer* slice_buffer,
                                    uint32_t flags) {
   GPR_ASSERT(slice_buffer->length <= UINT32_MAX);
   stream->base.length = (uint32_t)slice_buffer->length;
@@ -107,33 +107,33 @@
 
 // grpc_caching_byte_stream
 
-void grpc_byte_stream_cache_init(grpc_byte_stream_cache *cache,
-                                 grpc_byte_stream *underlying_stream) {
+void grpc_byte_stream_cache_init(grpc_byte_stream_cache* cache,
+                                 grpc_byte_stream* underlying_stream) {
   cache->underlying_stream = underlying_stream;
   grpc_slice_buffer_init(&cache->cache_buffer);
 }
 
-void grpc_byte_stream_cache_destroy(grpc_exec_ctx *exec_ctx,
-                                    grpc_byte_stream_cache *cache) {
+void grpc_byte_stream_cache_destroy(grpc_exec_ctx* exec_ctx,
+                                    grpc_byte_stream_cache* cache) {
   grpc_byte_stream_destroy(exec_ctx, cache->underlying_stream);
   grpc_slice_buffer_destroy_internal(exec_ctx, &cache->cache_buffer);
 }
 
-static bool caching_byte_stream_next(grpc_exec_ctx *exec_ctx,
-                                     grpc_byte_stream *byte_stream,
+static bool caching_byte_stream_next(grpc_exec_ctx* exec_ctx,
+                                     grpc_byte_stream* byte_stream,
                                      size_t max_size_hint,
-                                     grpc_closure *on_complete) {
-  grpc_caching_byte_stream *stream = (grpc_caching_byte_stream *)byte_stream;
+                                     grpc_closure* on_complete) {
+  grpc_caching_byte_stream* stream = (grpc_caching_byte_stream*)byte_stream;
   if (stream->shutdown_error != GRPC_ERROR_NONE) return true;
   if (stream->cursor < stream->cache->cache_buffer.count) return true;
   return grpc_byte_stream_next(exec_ctx, stream->cache->underlying_stream,
                                max_size_hint, on_complete);
 }
 
-static grpc_error *caching_byte_stream_pull(grpc_exec_ctx *exec_ctx,
-                                            grpc_byte_stream *byte_stream,
-                                            grpc_slice *slice) {
-  grpc_caching_byte_stream *stream = (grpc_caching_byte_stream *)byte_stream;
+static grpc_error* caching_byte_stream_pull(grpc_exec_ctx* exec_ctx,
+                                            grpc_byte_stream* byte_stream,
+                                            grpc_slice* slice) {
+  grpc_caching_byte_stream* stream = (grpc_caching_byte_stream*)byte_stream;
   if (stream->shutdown_error != GRPC_ERROR_NONE) {
     return GRPC_ERROR_REF(stream->shutdown_error);
   }
@@ -143,7 +143,7 @@
     ++stream->cursor;
     return GRPC_ERROR_NONE;
   }
-  grpc_error *error =
+  grpc_error* error =
       grpc_byte_stream_pull(exec_ctx, stream->cache->underlying_stream, slice);
   if (error == GRPC_ERROR_NONE) {
     ++stream->cursor;
@@ -153,18 +153,18 @@
   return error;
 }
 
-static void caching_byte_stream_shutdown(grpc_exec_ctx *exec_ctx,
-                                         grpc_byte_stream *byte_stream,
-                                         grpc_error *error) {
-  grpc_caching_byte_stream *stream = (grpc_caching_byte_stream *)byte_stream;
+static void caching_byte_stream_shutdown(grpc_exec_ctx* exec_ctx,
+                                         grpc_byte_stream* byte_stream,
+                                         grpc_error* error) {
+  grpc_caching_byte_stream* stream = (grpc_caching_byte_stream*)byte_stream;
   GRPC_ERROR_UNREF(stream->shutdown_error);
   stream->shutdown_error = GRPC_ERROR_REF(error);
   grpc_byte_stream_shutdown(exec_ctx, stream->cache->underlying_stream, error);
 }
 
-static void caching_byte_stream_destroy(grpc_exec_ctx *exec_ctx,
-                                        grpc_byte_stream *byte_stream) {
-  grpc_caching_byte_stream *stream = (grpc_caching_byte_stream *)byte_stream;
+static void caching_byte_stream_destroy(grpc_exec_ctx* exec_ctx,
+                                        grpc_byte_stream* byte_stream) {
+  grpc_caching_byte_stream* stream = (grpc_caching_byte_stream*)byte_stream;
   GRPC_ERROR_UNREF(stream->shutdown_error);
 }
 
@@ -172,8 +172,8 @@
     caching_byte_stream_next, caching_byte_stream_pull,
     caching_byte_stream_shutdown, caching_byte_stream_destroy};
 
-void grpc_caching_byte_stream_init(grpc_caching_byte_stream *stream,
-                                   grpc_byte_stream_cache *cache) {
+void grpc_caching_byte_stream_init(grpc_caching_byte_stream* stream,
+                                   grpc_byte_stream_cache* cache) {
   memset(stream, 0, sizeof(*stream));
   stream->base.length = cache->underlying_stream->length;
   stream->base.flags = cache->underlying_stream->flags;
@@ -182,6 +182,6 @@
   stream->shutdown_error = GRPC_ERROR_NONE;
 }
 
-void grpc_caching_byte_stream_reset(grpc_caching_byte_stream *stream) {
+void grpc_caching_byte_stream_reset(grpc_caching_byte_stream* stream) {
   stream->cursor = 0;
 }
diff --git a/src/core/lib/transport/byte_stream.h b/src/core/lib/transport/byte_stream.h
index c1d8ee5..54ad4b9 100644
--- a/src/core/lib/transport/byte_stream.h
+++ b/src/core/lib/transport/byte_stream.h
@@ -35,19 +35,19 @@
 typedef struct grpc_byte_stream grpc_byte_stream;
 
 typedef struct {
-  bool (*next)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream,
-               size_t max_size_hint, grpc_closure *on_complete);
-  grpc_error *(*pull)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream,
-                      grpc_slice *slice);
-  void (*shutdown)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream,
-                   grpc_error *error);
-  void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream);
+  bool (*next)(grpc_exec_ctx* exec_ctx, grpc_byte_stream* byte_stream,
+               size_t max_size_hint, grpc_closure* on_complete);
+  grpc_error* (*pull)(grpc_exec_ctx* exec_ctx, grpc_byte_stream* byte_stream,
+                      grpc_slice* slice);
+  void (*shutdown)(grpc_exec_ctx* exec_ctx, grpc_byte_stream* byte_stream,
+                   grpc_error* error);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_byte_stream* byte_stream);
 } grpc_byte_stream_vtable;
 
 struct grpc_byte_stream {
   uint32_t length;
   uint32_t flags;
-  const grpc_byte_stream_vtable *vtable;
+  const grpc_byte_stream_vtable* vtable;
 };
 
 // Returns true if the bytes are available immediately (in which case
@@ -56,18 +56,18 @@
 //
 // max_size_hint can be set as a hint as to the maximum number
 // of bytes that would be acceptable to read.
-bool grpc_byte_stream_next(grpc_exec_ctx *exec_ctx,
-                           grpc_byte_stream *byte_stream, size_t max_size_hint,
-                           grpc_closure *on_complete);
+bool grpc_byte_stream_next(grpc_exec_ctx* exec_ctx,
+                           grpc_byte_stream* byte_stream, size_t max_size_hint,
+                           grpc_closure* on_complete);
 
 // Returns the next slice in the byte stream when it is ready (indicated by
 // either grpc_byte_stream_next returning true or on_complete passed to
 // grpc_byte_stream_next is called).
 //
 // Once a slice is returned into *slice, it is owned by the caller.
-grpc_error *grpc_byte_stream_pull(grpc_exec_ctx *exec_ctx,
-                                  grpc_byte_stream *byte_stream,
-                                  grpc_slice *slice);
+grpc_error* grpc_byte_stream_pull(grpc_exec_ctx* exec_ctx,
+                                  grpc_byte_stream* byte_stream,
+                                  grpc_slice* slice);
 
 // Shuts down the byte stream.
 //
@@ -76,12 +76,12 @@
 //
 // The next call to grpc_byte_stream_pull() (if any) will return the error
 // passed to grpc_byte_stream_shutdown().
-void grpc_byte_stream_shutdown(grpc_exec_ctx *exec_ctx,
-                               grpc_byte_stream *byte_stream,
-                               grpc_error *error);
+void grpc_byte_stream_shutdown(grpc_exec_ctx* exec_ctx,
+                               grpc_byte_stream* byte_stream,
+                               grpc_error* error);
 
-void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx,
-                              grpc_byte_stream *byte_stream);
+void grpc_byte_stream_destroy(grpc_exec_ctx* exec_ctx,
+                              grpc_byte_stream* byte_stream);
 
 // grpc_slice_buffer_stream
 //
@@ -91,13 +91,13 @@
 
 typedef struct grpc_slice_buffer_stream {
   grpc_byte_stream base;
-  grpc_slice_buffer *backing_buffer;
+  grpc_slice_buffer* backing_buffer;
   size_t cursor;
-  grpc_error *shutdown_error;
+  grpc_error* shutdown_error;
 } grpc_slice_buffer_stream;
 
-void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream *stream,
-                                   grpc_slice_buffer *slice_buffer,
+void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream* stream,
+                                   grpc_slice_buffer* slice_buffer,
                                    uint32_t flags);
 
 // grpc_caching_byte_stream
@@ -114,30 +114,30 @@
 // grpc_byte_stream_cache at the same time.
 
 typedef struct {
-  grpc_byte_stream *underlying_stream;
+  grpc_byte_stream* underlying_stream;
   grpc_slice_buffer cache_buffer;
 } grpc_byte_stream_cache;
 
 // Takes ownership of underlying_stream.
-void grpc_byte_stream_cache_init(grpc_byte_stream_cache *cache,
-                                 grpc_byte_stream *underlying_stream);
+void grpc_byte_stream_cache_init(grpc_byte_stream_cache* cache,
+                                 grpc_byte_stream* underlying_stream);
 
 // Must not be called while still in use by a grpc_caching_byte_stream.
-void grpc_byte_stream_cache_destroy(grpc_exec_ctx *exec_ctx,
-                                    grpc_byte_stream_cache *cache);
+void grpc_byte_stream_cache_destroy(grpc_exec_ctx* exec_ctx,
+                                    grpc_byte_stream_cache* cache);
 
 typedef struct {
   grpc_byte_stream base;
-  grpc_byte_stream_cache *cache;
+  grpc_byte_stream_cache* cache;
   size_t cursor;
-  grpc_error *shutdown_error;
+  grpc_error* shutdown_error;
 } grpc_caching_byte_stream;
 
-void grpc_caching_byte_stream_init(grpc_caching_byte_stream *stream,
-                                   grpc_byte_stream_cache *cache);
+void grpc_caching_byte_stream_init(grpc_caching_byte_stream* stream,
+                                   grpc_byte_stream_cache* cache);
 
 // Resets the byte stream to the start of the underlying stream.
-void grpc_caching_byte_stream_reset(grpc_caching_byte_stream *stream);
+void grpc_caching_byte_stream_reset(grpc_caching_byte_stream* stream);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/transport/connectivity_state.cc b/src/core/lib/transport/connectivity_state.cc
index eb3bbeb..e6f3b04 100644
--- a/src/core/lib/transport/connectivity_state.cc
+++ b/src/core/lib/transport/connectivity_state.cc
@@ -26,10 +26,8 @@
 
 grpc_core::TraceFlag grpc_connectivity_state_trace(false, "connectivity_state");
 
-const char *grpc_connectivity_state_name(grpc_connectivity_state state) {
+const char* grpc_connectivity_state_name(grpc_connectivity_state state) {
   switch (state) {
-    case GRPC_CHANNEL_INIT:
-      return "INIT";
     case GRPC_CHANNEL_IDLE:
       return "IDLE";
     case GRPC_CHANNEL_CONNECTING:
@@ -44,19 +42,19 @@
   GPR_UNREACHABLE_CODE(return "UNKNOWN");
 }
 
-void grpc_connectivity_state_init(grpc_connectivity_state_tracker *tracker,
+void grpc_connectivity_state_init(grpc_connectivity_state_tracker* tracker,
                                   grpc_connectivity_state init_state,
-                                  const char *name) {
+                                  const char* name) {
   gpr_atm_no_barrier_store(&tracker->current_state_atm, init_state);
   tracker->current_error = GRPC_ERROR_NONE;
   tracker->watchers = NULL;
   tracker->name = gpr_strdup(name);
 }
 
-void grpc_connectivity_state_destroy(grpc_exec_ctx *exec_ctx,
-                                     grpc_connectivity_state_tracker *tracker) {
-  grpc_error *error;
-  grpc_connectivity_state_watcher *w;
+void grpc_connectivity_state_destroy(grpc_exec_ctx* exec_ctx,
+                                     grpc_connectivity_state_tracker* tracker) {
+  grpc_error* error;
+  grpc_connectivity_state_watcher* w;
   while ((w = tracker->watchers)) {
     tracker->watchers = w->next;
 
@@ -75,7 +73,7 @@
 }
 
 grpc_connectivity_state grpc_connectivity_state_check(
-    grpc_connectivity_state_tracker *tracker) {
+    grpc_connectivity_state_tracker* tracker) {
   grpc_connectivity_state cur =
       (grpc_connectivity_state)gpr_atm_no_barrier_load(
           &tracker->current_state_atm);
@@ -87,7 +85,7 @@
 }
 
 grpc_connectivity_state grpc_connectivity_state_get(
-    grpc_connectivity_state_tracker *tracker, grpc_error **error) {
+    grpc_connectivity_state_tracker* tracker, grpc_error** error) {
   grpc_connectivity_state cur =
       (grpc_connectivity_state)gpr_atm_no_barrier_load(
           &tracker->current_state_atm);
@@ -102,13 +100,13 @@
 }
 
 bool grpc_connectivity_state_has_watchers(
-    grpc_connectivity_state_tracker *connectivity_state) {
+    grpc_connectivity_state_tracker* connectivity_state) {
   return connectivity_state->watchers != NULL;
 }
 
 bool grpc_connectivity_state_notify_on_state_change(
-    grpc_exec_ctx *exec_ctx, grpc_connectivity_state_tracker *tracker,
-    grpc_connectivity_state *current, grpc_closure *notify) {
+    grpc_exec_ctx* exec_ctx, grpc_connectivity_state_tracker* tracker,
+    grpc_connectivity_state* current, grpc_closure* notify) {
   grpc_connectivity_state cur =
       (grpc_connectivity_state)gpr_atm_no_barrier_load(
           &tracker->current_state_atm);
@@ -123,7 +121,7 @@
     }
   }
   if (current == NULL) {
-    grpc_connectivity_state_watcher *w = tracker->watchers;
+    grpc_connectivity_state_watcher* w = tracker->watchers;
     if (w != NULL && w->notify == notify) {
       GRPC_CLOSURE_SCHED(exec_ctx, notify, GRPC_ERROR_CANCELLED);
       tracker->watchers = w->next;
@@ -131,7 +129,7 @@
       return false;
     }
     while (w != NULL) {
-      grpc_connectivity_state_watcher *rm_candidate = w->next;
+      grpc_connectivity_state_watcher* rm_candidate = w->next;
       if (rm_candidate != NULL && rm_candidate->notify == notify) {
         GRPC_CLOSURE_SCHED(exec_ctx, notify, GRPC_ERROR_CANCELLED);
         w->next = w->next->next;
@@ -147,8 +145,8 @@
       GRPC_CLOSURE_SCHED(exec_ctx, notify,
                          GRPC_ERROR_REF(tracker->current_error));
     } else {
-      grpc_connectivity_state_watcher *w =
-          (grpc_connectivity_state_watcher *)gpr_malloc(sizeof(*w));
+      grpc_connectivity_state_watcher* w =
+          (grpc_connectivity_state_watcher*)gpr_malloc(sizeof(*w));
       w->current = current;
       w->notify = notify;
       w->next = tracker->watchers;
@@ -158,22 +156,21 @@
   }
 }
 
-void grpc_connectivity_state_set(grpc_exec_ctx *exec_ctx,
-                                 grpc_connectivity_state_tracker *tracker,
+void grpc_connectivity_state_set(grpc_exec_ctx* exec_ctx,
+                                 grpc_connectivity_state_tracker* tracker,
                                  grpc_connectivity_state state,
-                                 grpc_error *error, const char *reason) {
+                                 grpc_error* error, const char* reason) {
   grpc_connectivity_state cur =
       (grpc_connectivity_state)gpr_atm_no_barrier_load(
           &tracker->current_state_atm);
-  grpc_connectivity_state_watcher *w;
+  grpc_connectivity_state_watcher* w;
   if (grpc_connectivity_state_trace.enabled()) {
-    const char *error_string = grpc_error_string(error);
+    const char* error_string = grpc_error_string(error);
     gpr_log(GPR_DEBUG, "SET: %p %s: %s --> %s [%s] error=%p %s", tracker,
             tracker->name, grpc_connectivity_state_name(cur),
             grpc_connectivity_state_name(state), reason, error, error_string);
   }
   switch (state) {
-    case GRPC_CHANNEL_INIT:
     case GRPC_CHANNEL_CONNECTING:
     case GRPC_CHANNEL_IDLE:
     case GRPC_CHANNEL_READY:
diff --git a/src/core/lib/transport/connectivity_state.h b/src/core/lib/transport/connectivity_state.h
index 3127f56..60d20dd 100644
--- a/src/core/lib/transport/connectivity_state.h
+++ b/src/core/lib/transport/connectivity_state.h
@@ -29,64 +29,64 @@
 
 typedef struct grpc_connectivity_state_watcher {
   /** we keep watchers in a linked list */
-  struct grpc_connectivity_state_watcher *next;
+  struct grpc_connectivity_state_watcher* next;
   /** closure to notify on change */
-  grpc_closure *notify;
+  grpc_closure* notify;
   /** the current state as believed by the watcher */
-  grpc_connectivity_state *current;
+  grpc_connectivity_state* current;
 } grpc_connectivity_state_watcher;
 
 typedef struct {
   /** current grpc_connectivity_state */
   gpr_atm current_state_atm;
   /** error associated with state */
-  grpc_error *current_error;
+  grpc_error* current_error;
   /** all our watchers */
-  grpc_connectivity_state_watcher *watchers;
+  grpc_connectivity_state_watcher* watchers;
   /** a name to help debugging */
-  char *name;
+  char* name;
 } grpc_connectivity_state_tracker;
 
 extern grpc_core::TraceFlag grpc_connectivity_state_trace;
 
 /** enum --> string conversion */
-const char *grpc_connectivity_state_name(grpc_connectivity_state state);
+const char* grpc_connectivity_state_name(grpc_connectivity_state state);
 
-void grpc_connectivity_state_init(grpc_connectivity_state_tracker *tracker,
+void grpc_connectivity_state_init(grpc_connectivity_state_tracker* tracker,
                                   grpc_connectivity_state init_state,
-                                  const char *name);
-void grpc_connectivity_state_destroy(grpc_exec_ctx *exec_ctx,
-                                     grpc_connectivity_state_tracker *tracker);
+                                  const char* name);
+void grpc_connectivity_state_destroy(grpc_exec_ctx* exec_ctx,
+                                     grpc_connectivity_state_tracker* tracker);
 
 /** Set connectivity state; not thread safe; access must be serialized with an
  *  external lock */
-void grpc_connectivity_state_set(grpc_exec_ctx *exec_ctx,
-                                 grpc_connectivity_state_tracker *tracker,
+void grpc_connectivity_state_set(grpc_exec_ctx* exec_ctx,
+                                 grpc_connectivity_state_tracker* tracker,
                                  grpc_connectivity_state state,
-                                 grpc_error *associated_error,
-                                 const char *reason);
+                                 grpc_error* associated_error,
+                                 const char* reason);
 
 /** Return true if this connectivity state has watchers.
     Access must be serialized with an external lock. */
 bool grpc_connectivity_state_has_watchers(
-    grpc_connectivity_state_tracker *tracker);
+    grpc_connectivity_state_tracker* tracker);
 
 /** Return the last seen connectivity state. No need to synchronize access. */
 grpc_connectivity_state grpc_connectivity_state_check(
-    grpc_connectivity_state_tracker *tracker);
+    grpc_connectivity_state_tracker* tracker);
 
 /** Return the last seen connectivity state, and the associated error.
     Access must be serialized with an external lock. */
 grpc_connectivity_state grpc_connectivity_state_get(
-    grpc_connectivity_state_tracker *tracker, grpc_error **error);
+    grpc_connectivity_state_tracker* tracker, grpc_error** error);
 
 /** Return 1 if the channel should start connecting, 0 otherwise.
     If current==NULL cancel notify if it is already queued (success==0 in that
     case).
     Access must be serialized with an external lock. */
 bool grpc_connectivity_state_notify_on_state_change(
-    grpc_exec_ctx *exec_ctx, grpc_connectivity_state_tracker *tracker,
-    grpc_connectivity_state *current, grpc_closure *notify);
+    grpc_exec_ctx* exec_ctx, grpc_connectivity_state_tracker* tracker,
+    grpc_connectivity_state* current, grpc_closure* notify);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc
index 2e3b61b..d968b04 100644
--- a/src/core/lib/transport/error_utils.cc
+++ b/src/core/lib/transport/error_utils.cc
@@ -21,7 +21,7 @@
 #include "src/core/lib/iomgr/error_internal.h"
 #include "src/core/lib/transport/status_conversion.h"
 
-static grpc_error *recursively_find_error_with_field(grpc_error *error,
+static grpc_error* recursively_find_error_with_field(grpc_error* error,
                                                      grpc_error_ints which) {
   // If the error itself has a status code, return it.
   if (grpc_error_get_int(error, which, NULL)) {
@@ -31,21 +31,21 @@
   // Otherwise, search through its children.
   uint8_t slot = error->first_err;
   while (slot != UINT8_MAX) {
-    grpc_linked_error *lerr = (grpc_linked_error *)(error->arena + slot);
-    grpc_error *result = recursively_find_error_with_field(lerr->err, which);
+    grpc_linked_error* lerr = (grpc_linked_error*)(error->arena + slot);
+    grpc_error* result = recursively_find_error_with_field(lerr->err, which);
     if (result) return result;
     slot = lerr->next;
   }
   return NULL;
 }
 
-void grpc_error_get_status(grpc_exec_ctx *exec_ctx, grpc_error *error,
-                           grpc_millis deadline, grpc_status_code *code,
-                           grpc_slice *slice,
-                           grpc_http2_error_code *http_error) {
+void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error,
+                           grpc_millis deadline, grpc_status_code* code,
+                           grpc_slice* slice,
+                           grpc_http2_error_code* http_error) {
   // Start with the parent error and recurse through the tree of children
   // until we find the first one that has a status code.
-  grpc_error *found_error =
+  grpc_error* found_error =
       recursively_find_error_with_field(error, GRPC_ERROR_INT_GRPC_STATUS);
   if (found_error == NULL) {
     /// If no grpc-status exists, retry through the tree to find a http2 error
@@ -94,13 +94,13 @@
   if (found_error == NULL) found_error = error;
 }
 
-bool grpc_error_has_clear_grpc_status(grpc_error *error) {
+bool grpc_error_has_clear_grpc_status(grpc_error* error) {
   if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, NULL)) {
     return true;
   }
   uint8_t slot = error->first_err;
   while (slot != UINT8_MAX) {
-    grpc_linked_error *lerr = (grpc_linked_error *)(error->arena + slot);
+    grpc_linked_error* lerr = (grpc_linked_error*)(error->arena + slot);
     if (grpc_error_has_clear_grpc_status(lerr->err)) {
       return true;
     }
diff --git a/src/core/lib/transport/error_utils.h b/src/core/lib/transport/error_utils.h
index b4f9df4..690e420 100644
--- a/src/core/lib/transport/error_utils.h
+++ b/src/core/lib/transport/error_utils.h
@@ -33,16 +33,16 @@
 /// All attributes are pulled from the same child error. If any of the
 /// attributes (code, msg, http_status) are unneeded, they can be passed as
 /// NULL.
-void grpc_error_get_status(grpc_exec_ctx *exec_ctx, grpc_error *error,
-                           grpc_millis deadline, grpc_status_code *code,
-                           grpc_slice *slice,
-                           grpc_http2_error_code *http_status);
+void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error,
+                           grpc_millis deadline, grpc_status_code* code,
+                           grpc_slice* slice,
+                           grpc_http2_error_code* http_status);
 
 /// A utility function to check whether there is a clear status code that
 /// doesn't need to be guessed in \a error. This means that \a error or some
 /// child has GRPC_ERROR_INT_GRPC_STATUS set, or that it is GRPC_ERROR_NONE or
 /// GRPC_ERROR_CANCELLED
-bool grpc_error_has_clear_grpc_status(grpc_error *error);
+bool grpc_error_has_clear_grpc_status(grpc_error* error);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/transport/metadata.cc b/src/core/lib/transport/metadata.cc
index 9adf43d..7113007 100644
--- a/src/core/lib/transport/metadata.cc
+++ b/src/core/lib/transport/metadata.cc
@@ -66,7 +66,7 @@
 #define TABLE_IDX(hash, capacity) (((hash) >> (LOG2_SHARD_COUNT)) % (capacity))
 #define SHARD_IDX(hash) ((hash) & ((1 << (LOG2_SHARD_COUNT)) - 1))
 
-typedef void (*destroy_user_data_func)(void *user_data);
+typedef void (*destroy_user_data_func)(void* user_data);
 
 /* Shadow structure for grpc_mdelem_data for interned elements */
 typedef struct interned_metadata {
@@ -81,7 +81,7 @@
   gpr_atm destroy_user_data;
   gpr_atm user_data;
 
-  struct interned_metadata *bucket_next;
+  struct interned_metadata* bucket_next;
 } interned_metadata;
 
 /* Shadow structure for grpc_mdelem_data for allocated elements */
@@ -96,7 +96,7 @@
 
 typedef struct mdtab_shard {
   gpr_mu mu;
-  interned_metadata **elems;
+  interned_metadata** elems;
   size_t count;
   size_t capacity;
   /** Estimate of the number of unreferenced mdelems in the hash table.
@@ -107,24 +107,24 @@
 
 static mdtab_shard g_shards[SHARD_COUNT];
 
-static void gc_mdtab(grpc_exec_ctx *exec_ctx, mdtab_shard *shard);
+static void gc_mdtab(grpc_exec_ctx* exec_ctx, mdtab_shard* shard);
 
 void grpc_mdctx_global_init(void) {
   /* initialize shards */
   for (size_t i = 0; i < SHARD_COUNT; i++) {
-    mdtab_shard *shard = &g_shards[i];
+    mdtab_shard* shard = &g_shards[i];
     gpr_mu_init(&shard->mu);
     shard->count = 0;
     gpr_atm_no_barrier_store(&shard->free_estimate, 0);
     shard->capacity = INITIAL_SHARD_CAPACITY;
-    shard->elems = (interned_metadata **)gpr_zalloc(sizeof(*shard->elems) *
-                                                    shard->capacity);
+    shard->elems = (interned_metadata**)gpr_zalloc(sizeof(*shard->elems) *
+                                                   shard->capacity);
   }
 }
 
-void grpc_mdctx_global_shutdown(grpc_exec_ctx *exec_ctx) {
+void grpc_mdctx_global_shutdown(grpc_exec_ctx* exec_ctx) {
   for (size_t i = 0; i < SHARD_COUNT; i++) {
-    mdtab_shard *shard = &g_shards[i];
+    mdtab_shard* shard = &g_shards[i];
     gpr_mu_destroy(&shard->mu);
     gc_mdtab(exec_ctx, shard);
     /* TODO(ctiller): GPR_ASSERT(shard->count == 0); */
@@ -145,14 +145,14 @@
              &grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];
 }
 
-static void ref_md_locked(mdtab_shard *shard,
-                          interned_metadata *md DEBUG_ARGS) {
+static void ref_md_locked(mdtab_shard* shard,
+                          interned_metadata* md DEBUG_ARGS) {
 #ifndef NDEBUG
-  if (grpc_trace_metadata.enabled()) {
-    char *key_str = grpc_slice_to_c_string(md->key);
-    char *value_str = grpc_slice_to_c_string(md->value);
+  if (GRPC_TRACER_ON(grpc_trace_metadata)) {
+    char* key_str = grpc_slice_to_c_string(md->key);
+    char* value_str = grpc_slice_to_c_string(md->value);
     gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
-            "ELM   REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", (void *)md,
+            "ELM   REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", (void*)md,
             gpr_atm_no_barrier_load(&md->refcnt),
             gpr_atm_no_barrier_load(&md->refcnt) + 1, key_str, value_str);
     gpr_free(key_str);
@@ -164,9 +164,9 @@
   }
 }
 
-static void gc_mdtab(grpc_exec_ctx *exec_ctx, mdtab_shard *shard) {
+static void gc_mdtab(grpc_exec_ctx* exec_ctx, mdtab_shard* shard) {
   size_t i;
-  interned_metadata **prev_next;
+  interned_metadata** prev_next;
   interned_metadata *md, *next;
   gpr_atm num_freed = 0;
 
@@ -174,7 +174,7 @@
   for (i = 0; i < shard->capacity; i++) {
     prev_next = &shard->elems[i];
     for (md = shard->elems[i]; md; md = next) {
-      void *user_data = (void *)gpr_atm_no_barrier_load(&md->user_data);
+      void* user_data = (void*)gpr_atm_no_barrier_load(&md->user_data);
       next = md->bucket_next;
       if (gpr_atm_acq_load(&md->refcnt) == 0) {
         grpc_slice_unref_internal(exec_ctx, md->key);
@@ -196,17 +196,17 @@
   GPR_TIMER_END("gc_mdtab", 0);
 }
 
-static void grow_mdtab(mdtab_shard *shard) {
+static void grow_mdtab(mdtab_shard* shard) {
   size_t capacity = shard->capacity * 2;
   size_t i;
-  interned_metadata **mdtab;
+  interned_metadata** mdtab;
   interned_metadata *md, *next;
   uint32_t hash;
 
   GPR_TIMER_BEGIN("grow_mdtab", 0);
 
   mdtab =
-      (interned_metadata **)gpr_zalloc(sizeof(interned_metadata *) * capacity);
+      (interned_metadata**)gpr_zalloc(sizeof(interned_metadata*) * capacity);
 
   for (i = 0; i < shard->capacity; i++) {
     for (md = shard->elems[i]; md; md = next) {
@@ -227,7 +227,7 @@
   GPR_TIMER_END("grow_mdtab", 0);
 }
 
-static void rehash_mdtab(grpc_exec_ctx *exec_ctx, mdtab_shard *shard) {
+static void rehash_mdtab(grpc_exec_ctx* exec_ctx, mdtab_shard* shard) {
   if (gpr_atm_no_barrier_load(&shard->free_estimate) >
       (gpr_atm)(shard->capacity / 4)) {
     gc_mdtab(exec_ctx, shard);
@@ -237,25 +237,25 @@
 }
 
 grpc_mdelem grpc_mdelem_create(
-    grpc_exec_ctx *exec_ctx, grpc_slice key, grpc_slice value,
-    grpc_mdelem_data *compatible_external_backing_store) {
+    grpc_exec_ctx* exec_ctx, grpc_slice key, grpc_slice value,
+    grpc_mdelem_data* compatible_external_backing_store) {
   if (!grpc_slice_is_interned(key) || !grpc_slice_is_interned(value)) {
     if (compatible_external_backing_store != NULL) {
       return GRPC_MAKE_MDELEM(compatible_external_backing_store,
                               GRPC_MDELEM_STORAGE_EXTERNAL);
     }
 
-    allocated_metadata *allocated =
-        (allocated_metadata *)gpr_malloc(sizeof(*allocated));
+    allocated_metadata* allocated =
+        (allocated_metadata*)gpr_malloc(sizeof(*allocated));
     allocated->key = grpc_slice_ref_internal(key);
     allocated->value = grpc_slice_ref_internal(value);
     gpr_atm_rel_store(&allocated->refcnt, 1);
 #ifndef NDEBUG
-    if (grpc_trace_metadata.enabled()) {
-      char *key_str = grpc_slice_to_c_string(allocated->key);
-      char *value_str = grpc_slice_to_c_string(allocated->value);
+    if (GRPC_TRACER_ON(grpc_trace_metadata)) {
+      char* key_str = grpc_slice_to_c_string(allocated->key);
+      char* value_str = grpc_slice_to_c_string(allocated->value);
       gpr_log(GPR_DEBUG, "ELM ALLOC:%p:%" PRIdPTR ": '%s' = '%s'",
-              (void *)allocated, gpr_atm_no_barrier_load(&allocated->refcnt),
+              (void*)allocated, gpr_atm_no_barrier_load(&allocated->refcnt),
               key_str, value_str);
       gpr_free(key_str);
       gpr_free(value_str);
@@ -275,8 +275,8 @@
 
   uint32_t hash =
       GRPC_MDSTR_KV_HASH(grpc_slice_hash(key), grpc_slice_hash(value));
-  interned_metadata *md;
-  mdtab_shard *shard = &g_shards[SHARD_IDX(hash)];
+  interned_metadata* md;
+  mdtab_shard* shard = &g_shards[SHARD_IDX(hash)];
   size_t idx;
 
   GPR_TIMER_BEGIN("grpc_mdelem_from_metadata_strings", 0);
@@ -295,7 +295,7 @@
   }
 
   /* not found: create a new pair */
-  md = (interned_metadata *)gpr_malloc(sizeof(interned_metadata));
+  md = (interned_metadata*)gpr_malloc(sizeof(interned_metadata));
   gpr_atm_rel_store(&md->refcnt, 1);
   md->key = grpc_slice_ref_internal(key);
   md->value = grpc_slice_ref_internal(value);
@@ -305,10 +305,10 @@
   shard->elems[idx] = md;
   gpr_mu_init(&md->mu_user_data);
 #ifndef NDEBUG
-  if (grpc_trace_metadata.enabled()) {
-    char *key_str = grpc_slice_to_c_string(md->key);
-    char *value_str = grpc_slice_to_c_string(md->value);
-    gpr_log(GPR_DEBUG, "ELM   NEW:%p:%" PRIdPTR ": '%s' = '%s'", (void *)md,
+  if (GRPC_TRACER_ON(grpc_trace_metadata)) {
+    char* key_str = grpc_slice_to_c_string(md->key);
+    char* value_str = grpc_slice_to_c_string(md->value);
+    gpr_log(GPR_DEBUG, "ELM   NEW:%p:%" PRIdPTR ": '%s' = '%s'", (void*)md,
             gpr_atm_no_barrier_load(&md->refcnt), key_str, value_str);
     gpr_free(key_str);
     gpr_free(value_str);
@@ -327,7 +327,7 @@
   return GRPC_MAKE_MDELEM(md, GRPC_MDELEM_STORAGE_INTERNED);
 }
 
-grpc_mdelem grpc_mdelem_from_slices(grpc_exec_ctx *exec_ctx, grpc_slice key,
+grpc_mdelem grpc_mdelem_from_slices(grpc_exec_ctx* exec_ctx, grpc_slice key,
                                     grpc_slice value) {
   grpc_mdelem out = grpc_mdelem_create(exec_ctx, key, value, NULL);
   grpc_slice_unref_internal(exec_ctx, key);
@@ -335,15 +335,15 @@
   return out;
 }
 
-grpc_mdelem grpc_mdelem_from_grpc_metadata(grpc_exec_ctx *exec_ctx,
-                                           grpc_metadata *metadata) {
+grpc_mdelem grpc_mdelem_from_grpc_metadata(grpc_exec_ctx* exec_ctx,
+                                           grpc_metadata* metadata) {
   bool changed = false;
   grpc_slice key_slice =
       grpc_slice_maybe_static_intern(metadata->key, &changed);
   grpc_slice value_slice =
       grpc_slice_maybe_static_intern(metadata->value, &changed);
   return grpc_mdelem_create(exec_ctx, key_slice, value_slice,
-                            changed ? NULL : (grpc_mdelem_data *)metadata);
+                            changed ? NULL : (grpc_mdelem_data*)metadata);
 }
 
 static size_t get_base64_encoded_size(size_t raw_length) {
@@ -370,14 +370,14 @@
     case GRPC_MDELEM_STORAGE_STATIC:
       break;
     case GRPC_MDELEM_STORAGE_INTERNED: {
-      interned_metadata *md = (interned_metadata *)GRPC_MDELEM_DATA(gmd);
+      interned_metadata* md = (interned_metadata*)GRPC_MDELEM_DATA(gmd);
 #ifndef NDEBUG
-      if (grpc_trace_metadata.enabled()) {
-        char *key_str = grpc_slice_to_c_string(md->key);
-        char *value_str = grpc_slice_to_c_string(md->value);
+      if (GRPC_TRACER_ON(grpc_trace_metadata)) {
+        char* key_str = grpc_slice_to_c_string(md->key);
+        char* value_str = grpc_slice_to_c_string(md->value);
         gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
                 "ELM   REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'",
-                (void *)md, gpr_atm_no_barrier_load(&md->refcnt),
+                (void*)md, gpr_atm_no_barrier_load(&md->refcnt),
                 gpr_atm_no_barrier_load(&md->refcnt) + 1, key_str, value_str);
         gpr_free(key_str);
         gpr_free(value_str);
@@ -392,14 +392,14 @@
       break;
     }
     case GRPC_MDELEM_STORAGE_ALLOCATED: {
-      allocated_metadata *md = (allocated_metadata *)GRPC_MDELEM_DATA(gmd);
+      allocated_metadata* md = (allocated_metadata*)GRPC_MDELEM_DATA(gmd);
 #ifndef NDEBUG
-      if (grpc_trace_metadata.enabled()) {
-        char *key_str = grpc_slice_to_c_string(md->key);
-        char *value_str = grpc_slice_to_c_string(md->value);
+      if (GRPC_TRACER_ON(grpc_trace_metadata)) {
+        char* key_str = grpc_slice_to_c_string(md->key);
+        char* value_str = grpc_slice_to_c_string(md->value);
         gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
                 "ELM   REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'",
-                (void *)md, gpr_atm_no_barrier_load(&md->refcnt),
+                (void*)md, gpr_atm_no_barrier_load(&md->refcnt),
                 gpr_atm_no_barrier_load(&md->refcnt) + 1, key_str, value_str);
         gpr_free(key_str);
         gpr_free(value_str);
@@ -416,20 +416,20 @@
   return gmd;
 }
 
-void grpc_mdelem_unref(grpc_exec_ctx *exec_ctx, grpc_mdelem gmd DEBUG_ARGS) {
+void grpc_mdelem_unref(grpc_exec_ctx* exec_ctx, grpc_mdelem gmd DEBUG_ARGS) {
   switch (GRPC_MDELEM_STORAGE(gmd)) {
     case GRPC_MDELEM_STORAGE_EXTERNAL:
     case GRPC_MDELEM_STORAGE_STATIC:
       break;
     case GRPC_MDELEM_STORAGE_INTERNED: {
-      interned_metadata *md = (interned_metadata *)GRPC_MDELEM_DATA(gmd);
+      interned_metadata* md = (interned_metadata*)GRPC_MDELEM_DATA(gmd);
 #ifndef NDEBUG
-      if (grpc_trace_metadata.enabled()) {
-        char *key_str = grpc_slice_to_c_string(md->key);
-        char *value_str = grpc_slice_to_c_string(md->value);
+      if (GRPC_TRACER_ON(grpc_trace_metadata)) {
+        char* key_str = grpc_slice_to_c_string(md->key);
+        char* value_str = grpc_slice_to_c_string(md->value);
         gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
                 "ELM UNREF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'",
-                (void *)md, gpr_atm_no_barrier_load(&md->refcnt),
+                (void*)md, gpr_atm_no_barrier_load(&md->refcnt),
                 gpr_atm_no_barrier_load(&md->refcnt) - 1, key_str, value_str);
         gpr_free(key_str);
         gpr_free(value_str);
@@ -442,20 +442,20 @@
       if (1 == prev_refcount) {
         /* once the refcount hits zero, some other thread can come along and
            free md at any time: it's unsafe from this point on to access it */
-        mdtab_shard *shard = &g_shards[SHARD_IDX(hash)];
+        mdtab_shard* shard = &g_shards[SHARD_IDX(hash)];
         gpr_atm_no_barrier_fetch_add(&shard->free_estimate, 1);
       }
       break;
     }
     case GRPC_MDELEM_STORAGE_ALLOCATED: {
-      allocated_metadata *md = (allocated_metadata *)GRPC_MDELEM_DATA(gmd);
+      allocated_metadata* md = (allocated_metadata*)GRPC_MDELEM_DATA(gmd);
 #ifndef NDEBUG
-      if (grpc_trace_metadata.enabled()) {
-        char *key_str = grpc_slice_to_c_string(md->key);
-        char *value_str = grpc_slice_to_c_string(md->value);
+      if (GRPC_TRACER_ON(grpc_trace_metadata)) {
+        char* key_str = grpc_slice_to_c_string(md->key);
+        char* value_str = grpc_slice_to_c_string(md->value);
         gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
                 "ELM UNREF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'",
-                (void *)md, gpr_atm_no_barrier_load(&md->refcnt),
+                (void*)md, gpr_atm_no_barrier_load(&md->refcnt),
                 gpr_atm_no_barrier_load(&md->refcnt) - 1, key_str, value_str);
         gpr_free(key_str);
         gpr_free(value_str);
@@ -473,19 +473,19 @@
   }
 }
 
-void *grpc_mdelem_get_user_data(grpc_mdelem md, void (*destroy_func)(void *)) {
+void* grpc_mdelem_get_user_data(grpc_mdelem md, void (*destroy_func)(void*)) {
   switch (GRPC_MDELEM_STORAGE(md)) {
     case GRPC_MDELEM_STORAGE_EXTERNAL:
     case GRPC_MDELEM_STORAGE_ALLOCATED:
       return NULL;
     case GRPC_MDELEM_STORAGE_STATIC:
-      return (void *)grpc_static_mdelem_user_data[GRPC_MDELEM_DATA(md) -
-                                                  grpc_static_mdelem_table];
+      return (void*)grpc_static_mdelem_user_data[GRPC_MDELEM_DATA(md) -
+                                                 grpc_static_mdelem_table];
     case GRPC_MDELEM_STORAGE_INTERNED: {
-      interned_metadata *im = (interned_metadata *)GRPC_MDELEM_DATA(md);
-      void *result;
+      interned_metadata* im = (interned_metadata*)GRPC_MDELEM_DATA(md);
+      void* result;
       if (gpr_atm_acq_load(&im->destroy_user_data) == (gpr_atm)destroy_func) {
-        return (void *)gpr_atm_no_barrier_load(&im->user_data);
+        return (void*)gpr_atm_no_barrier_load(&im->user_data);
       } else {
         return NULL;
       }
@@ -495,8 +495,8 @@
   GPR_UNREACHABLE_CODE(return NULL);
 }
 
-void *grpc_mdelem_set_user_data(grpc_mdelem md, void (*destroy_func)(void *),
-                                void *user_data) {
+void* grpc_mdelem_set_user_data(grpc_mdelem md, void (*destroy_func)(void*),
+                                void* user_data) {
   switch (GRPC_MDELEM_STORAGE(md)) {
     case GRPC_MDELEM_STORAGE_EXTERNAL:
     case GRPC_MDELEM_STORAGE_ALLOCATED:
@@ -504,10 +504,10 @@
       return NULL;
     case GRPC_MDELEM_STORAGE_STATIC:
       destroy_func(user_data);
-      return (void *)grpc_static_mdelem_user_data[GRPC_MDELEM_DATA(md) -
-                                                  grpc_static_mdelem_table];
+      return (void*)grpc_static_mdelem_user_data[GRPC_MDELEM_DATA(md) -
+                                                 grpc_static_mdelem_table];
     case GRPC_MDELEM_STORAGE_INTERNED: {
-      interned_metadata *im = (interned_metadata *)GRPC_MDELEM_DATA(md);
+      interned_metadata* im = (interned_metadata*)GRPC_MDELEM_DATA(md);
       GPR_ASSERT(!is_mdelem_static(md));
       GPR_ASSERT((user_data == NULL) == (destroy_func == NULL));
       gpr_mu_lock(&im->mu_user_data);
@@ -517,7 +517,7 @@
         if (destroy_func != NULL) {
           destroy_func(user_data);
         }
-        return (void *)gpr_atm_no_barrier_load(&im->user_data);
+        return (void*)gpr_atm_no_barrier_load(&im->user_data);
       }
       gpr_atm_no_barrier_store(&im->user_data, (gpr_atm)user_data);
       gpr_atm_rel_store(&im->destroy_user_data, (gpr_atm)destroy_func);
diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h
index 678c213..2f11252 100644
--- a/src/core/lib/transport/metadata.h
+++ b/src/core/lib/transport/metadata.h
@@ -98,8 +98,7 @@
   uintptr_t payload;
 };
 
-#define GRPC_MDELEM_DATA(md) \
-  ((grpc_mdelem_data *)((md).payload & ~(uintptr_t)3))
+#define GRPC_MDELEM_DATA(md) ((grpc_mdelem_data*)((md).payload & ~(uintptr_t)3))
 #define GRPC_MDELEM_STORAGE(md) \
   ((grpc_mdelem_data_storage)((md).payload & (uintptr_t)3))
 #ifdef __cplusplus
@@ -114,21 +113,21 @@
                               (uintptr_t)GRPC_MDELEM_STORAGE_INTERNED_BIT))
 
 /* Unrefs the slices. */
-grpc_mdelem grpc_mdelem_from_slices(grpc_exec_ctx *exec_ctx, grpc_slice key,
+grpc_mdelem grpc_mdelem_from_slices(grpc_exec_ctx* exec_ctx, grpc_slice key,
                                     grpc_slice value);
 
 /* Cheaply convert a grpc_metadata to a grpc_mdelem; may use the grpc_metadata
    object as backing storage (so lifetimes should align) */
-grpc_mdelem grpc_mdelem_from_grpc_metadata(grpc_exec_ctx *exec_ctx,
-                                           grpc_metadata *metadata);
+grpc_mdelem grpc_mdelem_from_grpc_metadata(grpc_exec_ctx* exec_ctx,
+                                           grpc_metadata* metadata);
 
 /* Does not unref the slices; if a new non-interned mdelem is needed, allocates
    one if compatible_external_backing_store is NULL, or uses
    compatible_external_backing_store if it is non-NULL (in which case it's the
    users responsibility to ensure that it outlives usage) */
 grpc_mdelem grpc_mdelem_create(
-    grpc_exec_ctx *exec_ctx, grpc_slice key, grpc_slice value,
-    grpc_mdelem_data *compatible_external_backing_store);
+    grpc_exec_ctx* exec_ctx, grpc_slice key, grpc_slice value,
+    grpc_mdelem_data* compatible_external_backing_store);
 
 bool grpc_mdelem_eq(grpc_mdelem a, grpc_mdelem b);
 
@@ -137,23 +136,22 @@
 
 /* Mutator and accessor for grpc_mdelem user data. The destructor function
    is used as a type tag and is checked during user_data fetch. */
-void *grpc_mdelem_get_user_data(grpc_mdelem md,
-                                void (*if_destroy_func)(void *));
-void *grpc_mdelem_set_user_data(grpc_mdelem md, void (*destroy_func)(void *),
-                                void *user_data);
+void* grpc_mdelem_get_user_data(grpc_mdelem md, void (*if_destroy_func)(void*));
+void* grpc_mdelem_set_user_data(grpc_mdelem md, void (*destroy_func)(void*),
+                                void* user_data);
 
 #ifndef NDEBUG
 #define GRPC_MDELEM_REF(s) grpc_mdelem_ref((s), __FILE__, __LINE__)
 #define GRPC_MDELEM_UNREF(exec_ctx, s) \
   grpc_mdelem_unref((exec_ctx), (s), __FILE__, __LINE__)
-grpc_mdelem grpc_mdelem_ref(grpc_mdelem md, const char *file, int line);
-void grpc_mdelem_unref(grpc_exec_ctx *exec_ctx, grpc_mdelem md,
-                       const char *file, int line);
+grpc_mdelem grpc_mdelem_ref(grpc_mdelem md, const char* file, int line);
+void grpc_mdelem_unref(grpc_exec_ctx* exec_ctx, grpc_mdelem md,
+                       const char* file, int line);
 #else
 #define GRPC_MDELEM_REF(s) grpc_mdelem_ref((s))
 #define GRPC_MDELEM_UNREF(exec_ctx, s) grpc_mdelem_unref((exec_ctx), (s))
 grpc_mdelem grpc_mdelem_ref(grpc_mdelem md);
-void grpc_mdelem_unref(grpc_exec_ctx *exec_ctx, grpc_mdelem md);
+void grpc_mdelem_unref(grpc_exec_ctx* exec_ctx, grpc_mdelem md);
 #endif
 
 #define GRPC_MDKEY(md) (GRPC_MDELEM_DATA(md)->key)
@@ -170,7 +168,7 @@
 #define GRPC_MDSTR_KV_HASH(k_hash, v_hash) (GPR_ROTL((k_hash), 2) ^ (v_hash))
 
 void grpc_mdctx_global_init(void);
-void grpc_mdctx_global_shutdown(grpc_exec_ctx *exec_ctx);
+void grpc_mdctx_global_shutdown(grpc_exec_ctx* exec_ctx);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/transport/metadata_batch.cc b/src/core/lib/transport/metadata_batch.cc
index 2df9c91..90e84cd 100644
--- a/src/core/lib/transport/metadata_batch.cc
+++ b/src/core/lib/transport/metadata_batch.cc
@@ -28,9 +28,9 @@
 #include "src/core/lib/slice/slice_internal.h"
 #include "src/core/lib/slice/slice_string_helpers.h"
 
-static void assert_valid_list(grpc_mdelem_list *list) {
+static void assert_valid_list(grpc_mdelem_list* list) {
 #ifndef NDEBUG
-  grpc_linked_mdelem *l;
+  grpc_linked_mdelem* l;
 
   GPR_ASSERT((list->head == NULL) == (list->tail == NULL));
   if (!list->head) return;
@@ -51,10 +51,10 @@
 #endif /* NDEBUG */
 }
 
-static void assert_valid_callouts(grpc_exec_ctx *exec_ctx,
-                                  grpc_metadata_batch *batch) {
+static void assert_valid_callouts(grpc_exec_ctx* exec_ctx,
+                                  grpc_metadata_batch* batch) {
 #ifndef NDEBUG
-  for (grpc_linked_mdelem *l = batch->list.head; l != NULL; l = l->next) {
+  for (grpc_linked_mdelem* l = batch->list.head; l != NULL; l = l->next) {
     grpc_slice key_interned = grpc_slice_intern(GRPC_MDKEY(l->md));
     grpc_metadata_batch_callouts_index callout_idx =
         GRPC_BATCH_INDEX_OF(key_interned);
@@ -67,38 +67,38 @@
 }
 
 #ifndef NDEBUG
-void grpc_metadata_batch_assert_ok(grpc_metadata_batch *batch) {
+void grpc_metadata_batch_assert_ok(grpc_metadata_batch* batch) {
   assert_valid_list(&batch->list);
 }
 #endif /* NDEBUG */
 
-void grpc_metadata_batch_init(grpc_metadata_batch *batch) {
+void grpc_metadata_batch_init(grpc_metadata_batch* batch) {
   memset(batch, 0, sizeof(*batch));
   batch->deadline = GRPC_MILLIS_INF_FUTURE;
 }
 
-void grpc_metadata_batch_destroy(grpc_exec_ctx *exec_ctx,
-                                 grpc_metadata_batch *batch) {
-  grpc_linked_mdelem *l;
+void grpc_metadata_batch_destroy(grpc_exec_ctx* exec_ctx,
+                                 grpc_metadata_batch* batch) {
+  grpc_linked_mdelem* l;
   for (l = batch->list.head; l; l = l->next) {
     GRPC_MDELEM_UNREF(exec_ctx, l->md);
   }
 }
 
-grpc_error *grpc_attach_md_to_error(grpc_error *src, grpc_mdelem md) {
-  grpc_error *out = grpc_error_set_str(
+grpc_error* grpc_attach_md_to_error(grpc_error* src, grpc_mdelem md) {
+  grpc_error* out = grpc_error_set_str(
       grpc_error_set_str(src, GRPC_ERROR_STR_KEY,
                          grpc_slice_ref_internal(GRPC_MDKEY(md))),
       GRPC_ERROR_STR_VALUE, grpc_slice_ref_internal(GRPC_MDVALUE(md)));
   return out;
 }
 
-static grpc_error *maybe_link_callout(grpc_metadata_batch *batch,
-                                      grpc_linked_mdelem *storage)
+static grpc_error* maybe_link_callout(grpc_metadata_batch* batch,
+                                      grpc_linked_mdelem* storage)
     GRPC_MUST_USE_RESULT;
 
-static grpc_error *maybe_link_callout(grpc_metadata_batch *batch,
-                                      grpc_linked_mdelem *storage) {
+static grpc_error* maybe_link_callout(grpc_metadata_batch* batch,
+                                      grpc_linked_mdelem* storage) {
   grpc_metadata_batch_callouts_index idx =
       GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
   if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
@@ -114,8 +114,8 @@
       storage->md);
 }
 
-static void maybe_unlink_callout(grpc_metadata_batch *batch,
-                                 grpc_linked_mdelem *storage) {
+static void maybe_unlink_callout(grpc_metadata_batch* batch,
+                                 grpc_linked_mdelem* storage) {
   grpc_metadata_batch_callouts_index idx =
       GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
   if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
@@ -126,16 +126,16 @@
   batch->idx.array[idx] = NULL;
 }
 
-grpc_error *grpc_metadata_batch_add_head(grpc_exec_ctx *exec_ctx,
-                                         grpc_metadata_batch *batch,
-                                         grpc_linked_mdelem *storage,
+grpc_error* grpc_metadata_batch_add_head(grpc_exec_ctx* exec_ctx,
+                                         grpc_metadata_batch* batch,
+                                         grpc_linked_mdelem* storage,
                                          grpc_mdelem elem_to_add) {
   GPR_ASSERT(!GRPC_MDISNULL(elem_to_add));
   storage->md = elem_to_add;
   return grpc_metadata_batch_link_head(exec_ctx, batch, storage);
 }
 
-static void link_head(grpc_mdelem_list *list, grpc_linked_mdelem *storage) {
+static void link_head(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
   assert_valid_list(list);
   GPR_ASSERT(!GRPC_MDISNULL(storage->md));
   storage->prev = NULL;
@@ -150,11 +150,11 @@
   assert_valid_list(list);
 }
 
-grpc_error *grpc_metadata_batch_link_head(grpc_exec_ctx *exec_ctx,
-                                          grpc_metadata_batch *batch,
-                                          grpc_linked_mdelem *storage) {
+grpc_error* grpc_metadata_batch_link_head(grpc_exec_ctx* exec_ctx,
+                                          grpc_metadata_batch* batch,
+                                          grpc_linked_mdelem* storage) {
   assert_valid_callouts(exec_ctx, batch);
-  grpc_error *err = maybe_link_callout(batch, storage);
+  grpc_error* err = maybe_link_callout(batch, storage);
   if (err != GRPC_ERROR_NONE) {
     assert_valid_callouts(exec_ctx, batch);
     return err;
@@ -164,16 +164,16 @@
   return GRPC_ERROR_NONE;
 }
 
-grpc_error *grpc_metadata_batch_add_tail(grpc_exec_ctx *exec_ctx,
-                                         grpc_metadata_batch *batch,
-                                         grpc_linked_mdelem *storage,
+grpc_error* grpc_metadata_batch_add_tail(grpc_exec_ctx* exec_ctx,
+                                         grpc_metadata_batch* batch,
+                                         grpc_linked_mdelem* storage,
                                          grpc_mdelem elem_to_add) {
   GPR_ASSERT(!GRPC_MDISNULL(elem_to_add));
   storage->md = elem_to_add;
   return grpc_metadata_batch_link_tail(exec_ctx, batch, storage);
 }
 
-static void link_tail(grpc_mdelem_list *list, grpc_linked_mdelem *storage) {
+static void link_tail(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
   assert_valid_list(list);
   GPR_ASSERT(!GRPC_MDISNULL(storage->md));
   storage->prev = list->tail;
@@ -189,11 +189,11 @@
   assert_valid_list(list);
 }
 
-grpc_error *grpc_metadata_batch_link_tail(grpc_exec_ctx *exec_ctx,
-                                          grpc_metadata_batch *batch,
-                                          grpc_linked_mdelem *storage) {
+grpc_error* grpc_metadata_batch_link_tail(grpc_exec_ctx* exec_ctx,
+                                          grpc_metadata_batch* batch,
+                                          grpc_linked_mdelem* storage) {
   assert_valid_callouts(exec_ctx, batch);
-  grpc_error *err = maybe_link_callout(batch, storage);
+  grpc_error* err = maybe_link_callout(batch, storage);
   if (err != GRPC_ERROR_NONE) {
     assert_valid_callouts(exec_ctx, batch);
     return err;
@@ -203,8 +203,8 @@
   return GRPC_ERROR_NONE;
 }
 
-static void unlink_storage(grpc_mdelem_list *list,
-                           grpc_linked_mdelem *storage) {
+static void unlink_storage(grpc_mdelem_list* list,
+                           grpc_linked_mdelem* storage) {
   assert_valid_list(list);
   if (storage->prev != NULL) {
     storage->prev->next = storage->next;
@@ -220,9 +220,9 @@
   assert_valid_list(list);
 }
 
-void grpc_metadata_batch_remove(grpc_exec_ctx *exec_ctx,
-                                grpc_metadata_batch *batch,
-                                grpc_linked_mdelem *storage) {
+void grpc_metadata_batch_remove(grpc_exec_ctx* exec_ctx,
+                                grpc_metadata_batch* batch,
+                                grpc_linked_mdelem* storage) {
   assert_valid_callouts(exec_ctx, batch);
   maybe_unlink_callout(batch, storage);
   unlink_storage(&batch->list, storage);
@@ -230,8 +230,8 @@
   assert_valid_callouts(exec_ctx, batch);
 }
 
-void grpc_metadata_batch_set_value(grpc_exec_ctx *exec_ctx,
-                                   grpc_linked_mdelem *storage,
+void grpc_metadata_batch_set_value(grpc_exec_ctx* exec_ctx,
+                                   grpc_linked_mdelem* storage,
                                    grpc_slice value) {
   grpc_mdelem old_mdelem = storage->md;
   grpc_mdelem new_mdelem = grpc_mdelem_from_slices(
@@ -240,12 +240,12 @@
   GRPC_MDELEM_UNREF(exec_ctx, old_mdelem);
 }
 
-grpc_error *grpc_metadata_batch_substitute(grpc_exec_ctx *exec_ctx,
-                                           grpc_metadata_batch *batch,
-                                           grpc_linked_mdelem *storage,
+grpc_error* grpc_metadata_batch_substitute(grpc_exec_ctx* exec_ctx,
+                                           grpc_metadata_batch* batch,
+                                           grpc_linked_mdelem* storage,
                                            grpc_mdelem new_mdelem) {
   assert_valid_callouts(exec_ctx, batch);
-  grpc_error *error = GRPC_ERROR_NONE;
+  grpc_error* error = GRPC_ERROR_NONE;
   grpc_mdelem old_mdelem = storage->md;
   if (!grpc_slice_eq(GRPC_MDKEY(new_mdelem), GRPC_MDKEY(old_mdelem))) {
     maybe_unlink_callout(batch, storage);
@@ -263,27 +263,27 @@
   return error;
 }
 
-void grpc_metadata_batch_clear(grpc_exec_ctx *exec_ctx,
-                               grpc_metadata_batch *batch) {
+void grpc_metadata_batch_clear(grpc_exec_ctx* exec_ctx,
+                               grpc_metadata_batch* batch) {
   grpc_metadata_batch_destroy(exec_ctx, batch);
   grpc_metadata_batch_init(batch);
 }
 
-bool grpc_metadata_batch_is_empty(grpc_metadata_batch *batch) {
+bool grpc_metadata_batch_is_empty(grpc_metadata_batch* batch) {
   return batch->list.head == NULL && batch->deadline == GRPC_MILLIS_INF_FUTURE;
 }
 
-size_t grpc_metadata_batch_size(grpc_metadata_batch *batch) {
+size_t grpc_metadata_batch_size(grpc_metadata_batch* batch) {
   size_t size = 0;
-  for (grpc_linked_mdelem *elem = batch->list.head; elem != NULL;
+  for (grpc_linked_mdelem* elem = batch->list.head; elem != NULL;
        elem = elem->next) {
     size += GRPC_MDELEM_LENGTH(elem->md);
   }
   return size;
 }
 
-static void add_error(grpc_error **composite, grpc_error *error,
-                      const char *composite_error_string) {
+static void add_error(grpc_error** composite, grpc_error* error,
+                      const char* composite_error_string) {
   if (error == GRPC_ERROR_NONE) return;
   if (*composite == GRPC_ERROR_NONE) {
     *composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(composite_error_string);
@@ -291,15 +291,15 @@
   *composite = grpc_error_add_child(*composite, error);
 }
 
-grpc_error *grpc_metadata_batch_filter(grpc_exec_ctx *exec_ctx,
-                                       grpc_metadata_batch *batch,
+grpc_error* grpc_metadata_batch_filter(grpc_exec_ctx* exec_ctx,
+                                       grpc_metadata_batch* batch,
                                        grpc_metadata_batch_filter_func func,
-                                       void *user_data,
-                                       const char *composite_error_string) {
-  grpc_linked_mdelem *l = batch->list.head;
-  grpc_error *error = GRPC_ERROR_NONE;
+                                       void* user_data,
+                                       const char* composite_error_string) {
+  grpc_linked_mdelem* l = batch->list.head;
+  grpc_error* error = GRPC_ERROR_NONE;
   while (l) {
-    grpc_linked_mdelem *next = l->next;
+    grpc_linked_mdelem* next = l->next;
     grpc_filtered_mdelem new_mdelem = func(exec_ctx, user_data, l->md);
     add_error(&error, new_mdelem.error, composite_error_string);
     if (GRPC_MDISNULL(new_mdelem.md)) {
diff --git a/src/core/lib/transport/metadata_batch.h b/src/core/lib/transport/metadata_batch.h
index a2b4b92..7d17393 100644
--- a/src/core/lib/transport/metadata_batch.h
+++ b/src/core/lib/transport/metadata_batch.h
@@ -34,16 +34,16 @@
 
 typedef struct grpc_linked_mdelem {
   grpc_mdelem md;
-  struct grpc_linked_mdelem *next;
-  struct grpc_linked_mdelem *prev;
-  void *reserved;
+  struct grpc_linked_mdelem* next;
+  struct grpc_linked_mdelem* prev;
+  void* reserved;
 } grpc_linked_mdelem;
 
 typedef struct grpc_mdelem_list {
   size_t count;
   size_t default_count;  // Number of default keys.
-  grpc_linked_mdelem *head;
-  grpc_linked_mdelem *tail;
+  grpc_linked_mdelem* head;
+  grpc_linked_mdelem* tail;
 } grpc_mdelem_list;
 
 typedef struct grpc_metadata_batch {
@@ -56,29 +56,29 @@
   grpc_millis deadline;
 } grpc_metadata_batch;
 
-void grpc_metadata_batch_init(grpc_metadata_batch *batch);
-void grpc_metadata_batch_destroy(grpc_exec_ctx *exec_ctx,
-                                 grpc_metadata_batch *batch);
-void grpc_metadata_batch_clear(grpc_exec_ctx *exec_ctx,
-                               grpc_metadata_batch *batch);
-bool grpc_metadata_batch_is_empty(grpc_metadata_batch *batch);
+void grpc_metadata_batch_init(grpc_metadata_batch* batch);
+void grpc_metadata_batch_destroy(grpc_exec_ctx* exec_ctx,
+                                 grpc_metadata_batch* batch);
+void grpc_metadata_batch_clear(grpc_exec_ctx* exec_ctx,
+                               grpc_metadata_batch* batch);
+bool grpc_metadata_batch_is_empty(grpc_metadata_batch* batch);
 
 /* Returns the transport size of the batch. */
-size_t grpc_metadata_batch_size(grpc_metadata_batch *batch);
+size_t grpc_metadata_batch_size(grpc_metadata_batch* batch);
 
 /** Remove \a storage from the batch, unreffing the mdelem contained */
-void grpc_metadata_batch_remove(grpc_exec_ctx *exec_ctx,
-                                grpc_metadata_batch *batch,
-                                grpc_linked_mdelem *storage);
+void grpc_metadata_batch_remove(grpc_exec_ctx* exec_ctx,
+                                grpc_metadata_batch* batch,
+                                grpc_linked_mdelem* storage);
 
 /** Substitute a new mdelem for an old value */
-grpc_error *grpc_metadata_batch_substitute(grpc_exec_ctx *exec_ctx,
-                                           grpc_metadata_batch *batch,
-                                           grpc_linked_mdelem *storage,
+grpc_error* grpc_metadata_batch_substitute(grpc_exec_ctx* exec_ctx,
+                                           grpc_metadata_batch* batch,
+                                           grpc_linked_mdelem* storage,
                                            grpc_mdelem new_value);
 
-void grpc_metadata_batch_set_value(grpc_exec_ctx *exec_ctx,
-                                   grpc_linked_mdelem *storage,
+void grpc_metadata_batch_set_value(grpc_exec_ctx* exec_ctx,
+                                   grpc_linked_mdelem* storage,
                                    grpc_slice value);
 
 /** Add \a storage to the beginning of \a batch. storage->md is
@@ -86,17 +86,17 @@
     \a storage is owned by the caller and must survive for the
     lifetime of batch. This usually means it should be around
     for the lifetime of the call. */
-grpc_error *grpc_metadata_batch_link_head(
-    grpc_exec_ctx *exec_ctx, grpc_metadata_batch *batch,
-    grpc_linked_mdelem *storage) GRPC_MUST_USE_RESULT;
+grpc_error* grpc_metadata_batch_link_head(
+    grpc_exec_ctx* exec_ctx, grpc_metadata_batch* batch,
+    grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
 /** Add \a storage to the end of \a batch. storage->md is
     assumed to be valid.
     \a storage is owned by the caller and must survive for the
     lifetime of batch. This usually means it should be around
     for the lifetime of the call. */
-grpc_error *grpc_metadata_batch_link_tail(
-    grpc_exec_ctx *exec_ctx, grpc_metadata_batch *batch,
-    grpc_linked_mdelem *storage) GRPC_MUST_USE_RESULT;
+grpc_error* grpc_metadata_batch_link_tail(
+    grpc_exec_ctx* exec_ctx, grpc_metadata_batch* batch,
+    grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
 
 /** Add \a elem_to_add as the first element in \a batch, using
     \a storage as backing storage for the linked list element.
@@ -104,23 +104,23 @@
     lifetime of batch. This usually means it should be around
     for the lifetime of the call.
     Takes ownership of \a elem_to_add */
-grpc_error *grpc_metadata_batch_add_head(
-    grpc_exec_ctx *exec_ctx, grpc_metadata_batch *batch,
-    grpc_linked_mdelem *storage, grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
+grpc_error* grpc_metadata_batch_add_head(
+    grpc_exec_ctx* exec_ctx, grpc_metadata_batch* batch,
+    grpc_linked_mdelem* storage, grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
 /** Add \a elem_to_add as the last element in \a batch, using
     \a storage as backing storage for the linked list element.
     \a storage is owned by the caller and must survive for the
     lifetime of batch. This usually means it should be around
     for the lifetime of the call.
     Takes ownership of \a elem_to_add */
-grpc_error *grpc_metadata_batch_add_tail(
-    grpc_exec_ctx *exec_ctx, grpc_metadata_batch *batch,
-    grpc_linked_mdelem *storage, grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
+grpc_error* grpc_metadata_batch_add_tail(
+    grpc_exec_ctx* exec_ctx, grpc_metadata_batch* batch,
+    grpc_linked_mdelem* storage, grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
 
-grpc_error *grpc_attach_md_to_error(grpc_error *src, grpc_mdelem md);
+grpc_error* grpc_attach_md_to_error(grpc_error* src, grpc_mdelem md);
 
 typedef struct {
-  grpc_error *error;
+  grpc_error* error;
   grpc_mdelem md;
 } grpc_filtered_mdelem;
 
@@ -132,14 +132,14 @@
   { GRPC_ERROR_NONE, GRPC_MDNULL }
 
 typedef grpc_filtered_mdelem (*grpc_metadata_batch_filter_func)(
-    grpc_exec_ctx *exec_ctx, void *user_data, grpc_mdelem elem);
-grpc_error *grpc_metadata_batch_filter(
-    grpc_exec_ctx *exec_ctx, grpc_metadata_batch *batch,
-    grpc_metadata_batch_filter_func func, void *user_data,
-    const char *composite_error_string) GRPC_MUST_USE_RESULT;
+    grpc_exec_ctx* exec_ctx, void* user_data, grpc_mdelem elem);
+grpc_error* grpc_metadata_batch_filter(
+    grpc_exec_ctx* exec_ctx, grpc_metadata_batch* batch,
+    grpc_metadata_batch_filter_func func, void* user_data,
+    const char* composite_error_string) GRPC_MUST_USE_RESULT;
 
 #ifndef NDEBUG
-void grpc_metadata_batch_assert_ok(grpc_metadata_batch *comd);
+void grpc_metadata_batch_assert_ok(grpc_metadata_batch* comd);
 #else
 #define grpc_metadata_batch_assert_ok(comd) \
   do {                                      \
diff --git a/src/core/lib/transport/pid_controller.cc b/src/core/lib/transport/pid_controller.cc
index 9f7750d..e31cc85 100644
--- a/src/core/lib/transport/pid_controller.cc
+++ b/src/core/lib/transport/pid_controller.cc
@@ -21,7 +21,7 @@
 
 namespace grpc_core {
 
-PidController::PidController(const Args &args)
+PidController::PidController(const Args& args)
     : last_control_value_(args.initial_control_value()), args_(args) {}
 
 double PidController::Update(double error, double dt) {
diff --git a/src/core/lib/transport/service_config.cc b/src/core/lib/transport/service_config.cc
index 070a13a..05907de 100644
--- a/src/core/lib/transport/service_config.cc
+++ b/src/core/lib/transport/service_config.cc
@@ -111,7 +111,13 @@
 static size_t count_names_in_method_config_json(grpc_json* json) {
   size_t num_names = 0;
   for (grpc_json* field = json->child; field != NULL; field = field->next) {
-    if (field->key != NULL && strcmp(field->key, "name") == 0) ++num_names;
+    if (field->key != NULL && strcmp(field->key, "name") == 0) {
+      if (field->type != GRPC_JSON_ARRAY) return -1;
+      for (grpc_json* name = field->child; name != NULL; name = name->next) {
+        if (name->type != GRPC_JSON_OBJECT) return -1;
+        ++num_names;
+      }
+    }
   }
   return num_names;
 }
@@ -148,6 +154,8 @@
 static bool parse_json_method_config(
     grpc_exec_ctx* exec_ctx, grpc_json* json,
     void* (*create_value)(const grpc_json* method_config_json),
+    void* (*ref_value)(void* value),
+    void (*unref_value)(grpc_exec_ctx* exec_ctx, void* value),
     grpc_slice_hash_table_entry* entries, size_t* idx) {
   // Construct value.
   void* method_config = create_value(json);
@@ -162,6 +170,7 @@
       if (child->type != GRPC_JSON_ARRAY) goto done;
       for (grpc_json* name = child->child; name != NULL; name = name->next) {
         char* path = parse_json_method_name(name);
+        if (path == NULL) goto done;
         gpr_strvec_add(&paths, path);
       }
     }
@@ -170,11 +179,12 @@
   // Add entry for each path.
   for (size_t i = 0; i < paths.count; ++i) {
     entries[*idx].key = grpc_slice_from_copied_string(paths.strs[i]);
-    entries[*idx].value = method_config;
+    entries[*idx].value = ref_value(method_config);
     ++*idx;
   }
   success = true;
 done:
+  unref_value(exec_ctx, method_config);
   gpr_strvec_destroy(&paths);
   return success;
 }
@@ -182,7 +192,8 @@
 grpc_slice_hash_table* grpc_service_config_create_method_config_table(
     grpc_exec_ctx* exec_ctx, const grpc_service_config* service_config,
     void* (*create_value)(const grpc_json* method_config_json),
-    void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value)) {
+    void* (*ref_value)(void* value),
+    void (*unref_value)(grpc_exec_ctx* exec_ctx, void* value)) {
   const grpc_json* json = service_config->json_tree;
   // Traverse parsed JSON tree.
   if (json->type != GRPC_JSON_OBJECT || json->key != NULL) return NULL;
@@ -196,7 +207,9 @@
       // Find number of entries.
       for (grpc_json* method = field->child; method != NULL;
            method = method->next) {
-        num_entries += count_names_in_method_config_json(method);
+        size_t count = count_names_in_method_config_json(method);
+        if (count <= 0) return NULL;
+        num_entries += count;
       }
       // Populate method config table entries.
       entries = (grpc_slice_hash_table_entry*)gpr_malloc(
@@ -204,8 +217,13 @@
       size_t idx = 0;
       for (grpc_json* method = field->child; method != NULL;
            method = method->next) {
-        if (!parse_json_method_config(exec_ctx, method, create_value, entries,
-                                      &idx)) {
+        if (!parse_json_method_config(exec_ctx, method, create_value, ref_value,
+                                      unref_value, entries, &idx)) {
+          for (size_t i = 0; i < idx; ++i) {
+            grpc_slice_unref_internal(exec_ctx, entries[i].key);
+            unref_value(exec_ctx, entries[i].value);
+          }
+          gpr_free(entries);
           return NULL;
         }
       }
@@ -216,7 +234,7 @@
   grpc_slice_hash_table* method_config_table = NULL;
   if (entries != NULL) {
     method_config_table =
-        grpc_slice_hash_table_create(num_entries, entries, destroy_value, NULL);
+        grpc_slice_hash_table_create(num_entries, entries, unref_value, NULL);
     gpr_free(entries);
   }
   return method_config_table;
diff --git a/src/core/lib/transport/service_config.h b/src/core/lib/transport/service_config.h
index 9c43093..405d0f5 100644
--- a/src/core/lib/transport/service_config.h
+++ b/src/core/lib/transport/service_config.h
@@ -46,12 +46,13 @@
 /// Creates a method config table based on the data in \a json.
 /// The table's keys are request paths.  The table's value type is
 /// returned by \a create_value(), based on data parsed from the JSON tree.
-/// \a destroy_value is used to clean up values.
+/// \a ref_value() and \a unref_value() are used to ref and unref values.
 /// Returns NULL on error.
 grpc_slice_hash_table* grpc_service_config_create_method_config_table(
     grpc_exec_ctx* exec_ctx, const grpc_service_config* service_config,
     void* (*create_value)(const grpc_json* method_config_json),
-    void (*destroy_value)(grpc_exec_ctx* exec_ctx, void* value));
+    void* (*ref_value)(void* value),
+    void (*unref_value)(grpc_exec_ctx* exec_ctx, void* value));
 
 /// A helper function for looking up values in the table returned by
 /// \a grpc_service_config_create_method_config_table().
diff --git a/src/core/lib/transport/static_metadata.cc b/src/core/lib/transport/static_metadata.cc
index 472cf88..844724c 100644
--- a/src/core/lib/transport/static_metadata.cc
+++ b/src/core/lib/transport/static_metadata.cc
@@ -103,8 +103,8 @@
     105, 100, 101, 110, 116, 105, 116, 121, 44,  100, 101, 102, 108, 97,  116,
     101, 44,  103, 122, 105, 112};
 
-static void static_ref(void *unused) {}
-static void static_unref(grpc_exec_ctx *exec_ctx, void *unused) {}
+static void static_ref(void* unused) {}
+static void static_unref(grpc_exec_ctx* exec_ctx, void* unused) {}
 static const grpc_slice_refcount_vtable static_sub_vtable = {
     static_ref, static_unref, grpc_slice_default_eq_impl,
     grpc_slice_default_hash_impl};
diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h
index 299410f..8e73d5f 100644
--- a/src/core/lib/transport/static_metadata.h
+++ b/src/core/lib/transport/static_metadata.h
@@ -541,30 +541,30 @@
 } grpc_metadata_batch_callouts_index;
 
 typedef union {
-  struct grpc_linked_mdelem *array[GRPC_BATCH_CALLOUTS_COUNT];
+  struct grpc_linked_mdelem* array[GRPC_BATCH_CALLOUTS_COUNT];
   struct {
-    struct grpc_linked_mdelem *path;
-    struct grpc_linked_mdelem *method;
-    struct grpc_linked_mdelem *status;
-    struct grpc_linked_mdelem *authority;
-    struct grpc_linked_mdelem *scheme;
-    struct grpc_linked_mdelem *te;
-    struct grpc_linked_mdelem *grpc_message;
-    struct grpc_linked_mdelem *grpc_status;
-    struct grpc_linked_mdelem *grpc_payload_bin;
-    struct grpc_linked_mdelem *grpc_encoding;
-    struct grpc_linked_mdelem *grpc_accept_encoding;
-    struct grpc_linked_mdelem *grpc_server_stats_bin;
-    struct grpc_linked_mdelem *grpc_tags_bin;
-    struct grpc_linked_mdelem *grpc_trace_bin;
-    struct grpc_linked_mdelem *content_type;
-    struct grpc_linked_mdelem *content_encoding;
-    struct grpc_linked_mdelem *accept_encoding;
-    struct grpc_linked_mdelem *grpc_internal_encoding_request;
-    struct grpc_linked_mdelem *grpc_internal_stream_encoding_request;
-    struct grpc_linked_mdelem *user_agent;
-    struct grpc_linked_mdelem *host;
-    struct grpc_linked_mdelem *lb_token;
+    struct grpc_linked_mdelem* path;
+    struct grpc_linked_mdelem* method;
+    struct grpc_linked_mdelem* status;
+    struct grpc_linked_mdelem* authority;
+    struct grpc_linked_mdelem* scheme;
+    struct grpc_linked_mdelem* te;
+    struct grpc_linked_mdelem* grpc_message;
+    struct grpc_linked_mdelem* grpc_status;
+    struct grpc_linked_mdelem* grpc_payload_bin;
+    struct grpc_linked_mdelem* grpc_encoding;
+    struct grpc_linked_mdelem* grpc_accept_encoding;
+    struct grpc_linked_mdelem* grpc_server_stats_bin;
+    struct grpc_linked_mdelem* grpc_tags_bin;
+    struct grpc_linked_mdelem* grpc_trace_bin;
+    struct grpc_linked_mdelem* content_type;
+    struct grpc_linked_mdelem* content_encoding;
+    struct grpc_linked_mdelem* accept_encoding;
+    struct grpc_linked_mdelem* grpc_internal_encoding_request;
+    struct grpc_linked_mdelem* grpc_internal_stream_encoding_request;
+    struct grpc_linked_mdelem* user_agent;
+    struct grpc_linked_mdelem* host;
+    struct grpc_linked_mdelem* lb_token;
   } named;
 } grpc_metadata_batch_callouts;
 
diff --git a/src/core/lib/transport/status_conversion.cc b/src/core/lib/transport/status_conversion.cc
index 891c442..a0a5f1b 100644
--- a/src/core/lib/transport/status_conversion.cc
+++ b/src/core/lib/transport/status_conversion.cc
@@ -37,7 +37,7 @@
   }
 }
 
-grpc_status_code grpc_http2_error_to_grpc_status(grpc_exec_ctx *exec_ctx,
+grpc_status_code grpc_http2_error_to_grpc_status(grpc_exec_ctx* exec_ctx,
                                                  grpc_http2_error_code error,
                                                  grpc_millis deadline) {
   switch (error) {
diff --git a/src/core/lib/transport/status_conversion.h b/src/core/lib/transport/status_conversion.h
index 8ef91ae..b6fcebd 100644
--- a/src/core/lib/transport/status_conversion.h
+++ b/src/core/lib/transport/status_conversion.h
@@ -29,7 +29,7 @@
 
 /* Conversion of grpc status codes to http2 error codes (for RST_STREAM) */
 grpc_http2_error_code grpc_status_to_http2_error(grpc_status_code status);
-grpc_status_code grpc_http2_error_to_grpc_status(grpc_exec_ctx *exec_ctx,
+grpc_status_code grpc_http2_error_to_grpc_status(grpc_exec_ctx* exec_ctx,
                                                  grpc_http2_error_code error,
                                                  grpc_millis deadline);
 
diff --git a/src/core/lib/transport/timeout_encoding.cc b/src/core/lib/transport/timeout_encoding.cc
index 23a9ef3..86db6c8 100644
--- a/src/core/lib/transport/timeout_encoding.cc
+++ b/src/core/lib/transport/timeout_encoding.cc
@@ -41,15 +41,15 @@
 }
 
 /* encode our minimum viable timeout value */
-static void enc_tiny(char *buffer) { memcpy(buffer, "1n", 3); }
+static void enc_tiny(char* buffer) { memcpy(buffer, "1n", 3); }
 
-static void enc_ext(char *buffer, int64_t value, char ext) {
+static void enc_ext(char* buffer, int64_t value, char ext) {
   int n = int64_ttoa(value, buffer);
   buffer[n] = ext;
   buffer[n + 1] = 0;
 }
 
-static void enc_seconds(char *buffer, int64_t sec) {
+static void enc_seconds(char* buffer, int64_t sec) {
   if (sec % 3600 == 0) {
     enc_ext(buffer, sec / 3600, 'H');
   } else if (sec % 60 == 0) {
@@ -59,7 +59,7 @@
   }
 }
 
-static void enc_millis(char *buffer, int64_t x) {
+static void enc_millis(char* buffer, int64_t x) {
   x = round_up_to_three_sig_figs(x);
   if (x < GPR_MS_PER_SEC) {
     enc_ext(buffer, x, 'm');
@@ -72,7 +72,7 @@
   }
 }
 
-void grpc_http2_encode_timeout(grpc_millis timeout, char *buffer) {
+void grpc_http2_encode_timeout(grpc_millis timeout, char* buffer) {
   if (timeout <= 0) {
     enc_tiny(buffer);
   } else if (timeout < 1000 * GPR_MS_PER_SEC) {
@@ -83,15 +83,15 @@
   }
 }
 
-static int is_all_whitespace(const char *p, const char *end) {
+static int is_all_whitespace(const char* p, const char* end) {
   while (p != end && *p == ' ') p++;
   return p == end;
 }
 
-int grpc_http2_decode_timeout(grpc_slice text, grpc_millis *timeout) {
+int grpc_http2_decode_timeout(grpc_slice text, grpc_millis* timeout) {
   grpc_millis x = 0;
-  const uint8_t *p = GRPC_SLICE_START_PTR(text);
-  const uint8_t *end = GRPC_SLICE_END_PTR(text);
+  const uint8_t* p = GRPC_SLICE_START_PTR(text);
+  const uint8_t* end = GRPC_SLICE_END_PTR(text);
   int have_digit = 0;
   /* skip whitespace */
   for (; p != end && *p == ' '; p++)
@@ -138,5 +138,5 @@
       return 0;
   }
   p++;
-  return is_all_whitespace((const char *)p, (const char *)end);
+  return is_all_whitespace((const char*)p, (const char*)end);
 }
diff --git a/src/core/lib/transport/timeout_encoding.h b/src/core/lib/transport/timeout_encoding.h
index 91cdf0f..9c3c459 100644
--- a/src/core/lib/transport/timeout_encoding.h
+++ b/src/core/lib/transport/timeout_encoding.h
@@ -33,8 +33,8 @@
 
 /* Encode/decode timeouts to the GRPC over HTTP/2 format;
    encoding may round up arbitrarily */
-void grpc_http2_encode_timeout(grpc_millis timeout, char *buffer);
-int grpc_http2_decode_timeout(grpc_slice text, grpc_millis *timeout);
+void grpc_http2_encode_timeout(grpc_millis timeout, char* buffer);
+int grpc_http2_decode_timeout(grpc_slice text, grpc_millis* timeout);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc
index d0c4e04..dee68c8 100644
--- a/src/core/lib/transport/transport.cc
+++ b/src/core/lib/transport/transport.cc
@@ -36,31 +36,31 @@
 #endif
 
 #ifndef NDEBUG
-void grpc_stream_ref(grpc_stream_refcount *refcount, const char *reason) {
-  if (grpc_trace_stream_refcount.enabled()) {
+void grpc_stream_ref(grpc_stream_refcount* refcount, const char* reason) {
+  if (GRPC_TRACER_ON(grpc_trace_stream_refcount)) {
     gpr_atm val = gpr_atm_no_barrier_load(&refcount->refs.count);
     gpr_log(GPR_DEBUG, "%s %p:%p   REF %" PRIdPTR "->%" PRIdPTR " %s",
             refcount->object_type, refcount, refcount->destroy.cb_arg, val,
             val + 1, reason);
   }
 #else
-void grpc_stream_ref(grpc_stream_refcount *refcount) {
+void grpc_stream_ref(grpc_stream_refcount* refcount) {
 #endif
   gpr_ref_non_zero(&refcount->refs);
 }
 
 #ifndef NDEBUG
-void grpc_stream_unref(grpc_exec_ctx *exec_ctx, grpc_stream_refcount *refcount,
-                       const char *reason) {
-  if (grpc_trace_stream_refcount.enabled()) {
+void grpc_stream_unref(grpc_exec_ctx* exec_ctx, grpc_stream_refcount* refcount,
+                       const char* reason) {
+  if (GRPC_TRACER_ON(grpc_trace_stream_refcount)) {
     gpr_atm val = gpr_atm_no_barrier_load(&refcount->refs.count);
     gpr_log(GPR_DEBUG, "%s %p:%p UNREF %" PRIdPTR "->%" PRIdPTR " %s",
             refcount->object_type, refcount, refcount->destroy.cb_arg, val,
             val - 1, reason);
   }
 #else
-void grpc_stream_unref(grpc_exec_ctx *exec_ctx,
-                       grpc_stream_refcount *refcount) {
+void grpc_stream_unref(grpc_exec_ctx* exec_ctx,
+                       grpc_stream_refcount* refcount) {
 #endif
   if (gpr_unref(&refcount->refs)) {
     if (exec_ctx->flags & GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP) {
@@ -78,11 +78,11 @@
   }
 }
 
-#define STREAM_REF_FROM_SLICE_REF(p)         \
-  ((grpc_stream_refcount *)(((uint8_t *)p) - \
-                            offsetof(grpc_stream_refcount, slice_refcount)))
+#define STREAM_REF_FROM_SLICE_REF(p)       \
+  ((grpc_stream_refcount*)(((uint8_t*)p) - \
+                           offsetof(grpc_stream_refcount, slice_refcount)))
 
-static void slice_stream_ref(void *p) {
+static void slice_stream_ref(void* p) {
 #ifndef NDEBUG
   grpc_stream_ref(STREAM_REF_FROM_SLICE_REF(p), "slice");
 #else
@@ -90,7 +90,7 @@
 #endif
 }
 
-static void slice_stream_unref(grpc_exec_ctx *exec_ctx, void *p) {
+static void slice_stream_unref(grpc_exec_ctx* exec_ctx, void* p) {
 #ifndef NDEBUG
   grpc_stream_unref(exec_ctx, STREAM_REF_FROM_SLICE_REF(p), "slice");
 #else
@@ -98,12 +98,12 @@
 #endif
 }
 
-grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount *refcount,
-                                               void *buffer, size_t length) {
+grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount* refcount,
+                                               void* buffer, size_t length) {
   slice_stream_ref(&refcount->slice_refcount);
   grpc_slice res;
   res.refcount = &refcount->slice_refcount,
-  res.data.refcounted.bytes = (uint8_t *)buffer;
+  res.data.refcounted.bytes = (uint8_t*)buffer;
   res.data.refcounted.length = length;
   return res;
 }
@@ -116,13 +116,13 @@
 };
 
 #ifndef NDEBUG
-void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs,
-                          grpc_iomgr_cb_func cb, void *cb_arg,
-                          const char *object_type) {
+void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs,
+                          grpc_iomgr_cb_func cb, void* cb_arg,
+                          const char* object_type) {
   refcount->object_type = object_type;
 #else
-void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs,
-                          grpc_iomgr_cb_func cb, void *cb_arg) {
+void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs,
+                          grpc_iomgr_cb_func cb, void* cb_arg) {
 #endif
   gpr_ref_init(&refcount->refs, initial_refs);
   GRPC_CLOSURE_INIT(&refcount->destroy, cb, cb_arg, grpc_schedule_on_exec_ctx);
@@ -130,59 +130,59 @@
   refcount->slice_refcount.sub_refcount = &refcount->slice_refcount;
 }
 
-static void move64(uint64_t *from, uint64_t *to) {
+static void move64(uint64_t* from, uint64_t* to) {
   *to += *from;
   *from = 0;
 }
 
-void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats *from,
-                                       grpc_transport_one_way_stats *to) {
+void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats* from,
+                                       grpc_transport_one_way_stats* to) {
   move64(&from->framing_bytes, &to->framing_bytes);
   move64(&from->data_bytes, &to->data_bytes);
   move64(&from->header_bytes, &to->header_bytes);
 }
 
-void grpc_transport_move_stats(grpc_transport_stream_stats *from,
-                               grpc_transport_stream_stats *to) {
+void grpc_transport_move_stats(grpc_transport_stream_stats* from,
+                               grpc_transport_stream_stats* to) {
   grpc_transport_move_one_way_stats(&from->incoming, &to->incoming);
   grpc_transport_move_one_way_stats(&from->outgoing, &to->outgoing);
 }
 
-size_t grpc_transport_stream_size(grpc_transport *transport) {
+size_t grpc_transport_stream_size(grpc_transport* transport) {
   return transport->vtable->sizeof_stream;
 }
 
-void grpc_transport_destroy(grpc_exec_ctx *exec_ctx,
-                            grpc_transport *transport) {
+void grpc_transport_destroy(grpc_exec_ctx* exec_ctx,
+                            grpc_transport* transport) {
   transport->vtable->destroy(exec_ctx, transport);
 }
 
-int grpc_transport_init_stream(grpc_exec_ctx *exec_ctx,
-                               grpc_transport *transport, grpc_stream *stream,
-                               grpc_stream_refcount *refcount,
-                               const void *server_data, gpr_arena *arena) {
+int grpc_transport_init_stream(grpc_exec_ctx* exec_ctx,
+                               grpc_transport* transport, grpc_stream* stream,
+                               grpc_stream_refcount* refcount,
+                               const void* server_data, gpr_arena* arena) {
   return transport->vtable->init_stream(exec_ctx, transport, stream, refcount,
                                         server_data, arena);
 }
 
-void grpc_transport_perform_stream_op(grpc_exec_ctx *exec_ctx,
-                                      grpc_transport *transport,
-                                      grpc_stream *stream,
-                                      grpc_transport_stream_op_batch *op) {
+void grpc_transport_perform_stream_op(grpc_exec_ctx* exec_ctx,
+                                      grpc_transport* transport,
+                                      grpc_stream* stream,
+                                      grpc_transport_stream_op_batch* op) {
   transport->vtable->perform_stream_op(exec_ctx, transport, stream, op);
 }
 
-void grpc_transport_perform_op(grpc_exec_ctx *exec_ctx,
-                               grpc_transport *transport,
-                               grpc_transport_op *op) {
+void grpc_transport_perform_op(grpc_exec_ctx* exec_ctx,
+                               grpc_transport* transport,
+                               grpc_transport_op* op) {
   transport->vtable->perform_op(exec_ctx, transport, op);
 }
 
-void grpc_transport_set_pops(grpc_exec_ctx *exec_ctx, grpc_transport *transport,
-                             grpc_stream *stream,
-                             grpc_polling_entity *pollent) {
-  grpc_pollset *pollset;
-  grpc_pollset_set *pollset_set;
+void grpc_transport_set_pops(grpc_exec_ctx* exec_ctx, grpc_transport* transport,
+                             grpc_stream* stream,
+                             grpc_polling_entity* pollent) {
+  grpc_pollset* pollset;
+  grpc_pollset_set* pollset_set;
   if ((pollset = grpc_polling_entity_pollset(pollent)) != NULL) {
     transport->vtable->set_pollset(exec_ctx, transport, stream, pollset);
   } else if ((pollset_set = grpc_polling_entity_pollset_set(pollent)) != NULL) {
@@ -193,16 +193,16 @@
   }
 }
 
-void grpc_transport_destroy_stream(grpc_exec_ctx *exec_ctx,
-                                   grpc_transport *transport,
-                                   grpc_stream *stream,
-                                   grpc_closure *then_schedule_closure) {
+void grpc_transport_destroy_stream(grpc_exec_ctx* exec_ctx,
+                                   grpc_transport* transport,
+                                   grpc_stream* stream,
+                                   grpc_closure* then_schedule_closure) {
   transport->vtable->destroy_stream(exec_ctx, transport, stream,
                                     then_schedule_closure);
 }
 
-grpc_endpoint *grpc_transport_get_endpoint(grpc_exec_ctx *exec_ctx,
-                                           grpc_transport *transport) {
+grpc_endpoint* grpc_transport_get_endpoint(grpc_exec_ctx* exec_ctx,
+                                           grpc_transport* transport) {
   return transport->vtable->get_endpoint(exec_ctx, transport);
 }
 
@@ -214,8 +214,8 @@
 // though it lives in lib, it handles transport stream ops sure
 // it's grpc_transport_stream_op_batch_finish_with_failure
 void grpc_transport_stream_op_batch_finish_with_failure(
-    grpc_exec_ctx *exec_ctx, grpc_transport_stream_op_batch *batch,
-    grpc_error *error, grpc_call_combiner *call_combiner) {
+    grpc_exec_ctx* exec_ctx, grpc_transport_stream_op_batch* batch,
+    grpc_error* error, grpc_call_combiner* call_combiner) {
   if (batch->send_message) {
     grpc_byte_stream_destroy(exec_ctx,
                              batch->payload->send_message.send_message);
@@ -240,19 +240,19 @@
 
 typedef struct {
   grpc_closure outer_on_complete;
-  grpc_closure *inner_on_complete;
+  grpc_closure* inner_on_complete;
   grpc_transport_op op;
 } made_transport_op;
 
-static void destroy_made_transport_op(grpc_exec_ctx *exec_ctx, void *arg,
-                                      grpc_error *error) {
-  made_transport_op *op = (made_transport_op *)arg;
+static void destroy_made_transport_op(grpc_exec_ctx* exec_ctx, void* arg,
+                                      grpc_error* error) {
+  made_transport_op* op = (made_transport_op*)arg;
   GRPC_CLOSURE_SCHED(exec_ctx, op->inner_on_complete, GRPC_ERROR_REF(error));
   gpr_free(op);
 }
 
-grpc_transport_op *grpc_make_transport_op(grpc_closure *on_complete) {
-  made_transport_op *op = (made_transport_op *)gpr_malloc(sizeof(*op));
+grpc_transport_op* grpc_make_transport_op(grpc_closure* on_complete) {
+  made_transport_op* op = (made_transport_op*)gpr_malloc(sizeof(*op));
   GRPC_CLOSURE_INIT(&op->outer_on_complete, destroy_made_transport_op, op,
                     grpc_schedule_on_exec_ctx);
   op->inner_on_complete = on_complete;
@@ -263,23 +263,23 @@
 
 typedef struct {
   grpc_closure outer_on_complete;
-  grpc_closure *inner_on_complete;
+  grpc_closure* inner_on_complete;
   grpc_transport_stream_op_batch op;
   grpc_transport_stream_op_batch_payload payload;
 } made_transport_stream_op;
 
-static void destroy_made_transport_stream_op(grpc_exec_ctx *exec_ctx, void *arg,
-                                             grpc_error *error) {
-  made_transport_stream_op *op = (made_transport_stream_op *)arg;
-  grpc_closure *c = op->inner_on_complete;
+static void destroy_made_transport_stream_op(grpc_exec_ctx* exec_ctx, void* arg,
+                                             grpc_error* error) {
+  made_transport_stream_op* op = (made_transport_stream_op*)arg;
+  grpc_closure* c = op->inner_on_complete;
   gpr_free(op);
   GRPC_CLOSURE_RUN(exec_ctx, c, GRPC_ERROR_REF(error));
 }
 
-grpc_transport_stream_op_batch *grpc_make_transport_stream_op(
-    grpc_closure *on_complete) {
-  made_transport_stream_op *op =
-      (made_transport_stream_op *)gpr_zalloc(sizeof(*op));
+grpc_transport_stream_op_batch* grpc_make_transport_stream_op(
+    grpc_closure* on_complete) {
+  made_transport_stream_op* op =
+      (made_transport_stream_op*)gpr_zalloc(sizeof(*op));
   op->op.payload = &op->payload;
   GRPC_CLOSURE_INIT(&op->outer_on_complete, destroy_made_transport_stream_op,
                     op, grpc_schedule_on_exec_ctx);
diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h
index ae0dea3..6750f8c 100644
--- a/src/core/lib/transport/transport.h
+++ b/src/core/lib/transport/transport.h
@@ -51,33 +51,33 @@
   gpr_refcount refs;
   grpc_closure destroy;
 #ifndef NDEBUG
-  const char *object_type;
+  const char* object_type;
 #endif
   grpc_slice_refcount slice_refcount;
 } grpc_stream_refcount;
 
 #ifndef NDEBUG
-void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs,
-                          grpc_iomgr_cb_func cb, void *cb_arg,
-                          const char *object_type);
-void grpc_stream_ref(grpc_stream_refcount *refcount, const char *reason);
-void grpc_stream_unref(grpc_exec_ctx *exec_ctx, grpc_stream_refcount *refcount,
-                       const char *reason);
+void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs,
+                          grpc_iomgr_cb_func cb, void* cb_arg,
+                          const char* object_type);
+void grpc_stream_ref(grpc_stream_refcount* refcount, const char* reason);
+void grpc_stream_unref(grpc_exec_ctx* exec_ctx, grpc_stream_refcount* refcount,
+                       const char* reason);
 #define GRPC_STREAM_REF_INIT(rc, ir, cb, cb_arg, objtype) \
   grpc_stream_ref_init(rc, ir, cb, cb_arg, objtype)
 #else
-void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs,
-                          grpc_iomgr_cb_func cb, void *cb_arg);
-void grpc_stream_ref(grpc_stream_refcount *refcount);
-void grpc_stream_unref(grpc_exec_ctx *exec_ctx, grpc_stream_refcount *refcount);
+void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs,
+                          grpc_iomgr_cb_func cb, void* cb_arg);
+void grpc_stream_ref(grpc_stream_refcount* refcount);
+void grpc_stream_unref(grpc_exec_ctx* exec_ctx, grpc_stream_refcount* refcount);
 #define GRPC_STREAM_REF_INIT(rc, ir, cb, cb_arg, objtype) \
   grpc_stream_ref_init(rc, ir, cb, cb_arg)
 #endif
 
 /* Wrap a buffer that is owned by some stream object into a slice that shares
    the same refcount */
-grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount *refcount,
-                                               void *buffer, size_t length);
+grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount* refcount,
+                                               void* buffer, size_t length);
 
 typedef struct {
   uint64_t framing_bytes;
@@ -90,14 +90,14 @@
   grpc_transport_one_way_stats outgoing;
 } grpc_transport_stream_stats;
 
-void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats *from,
-                                       grpc_transport_one_way_stats *to);
+void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats* from,
+                                       grpc_transport_one_way_stats* to);
 
-void grpc_transport_move_stats(grpc_transport_stream_stats *from,
-                               grpc_transport_stream_stats *to);
+void grpc_transport_move_stats(grpc_transport_stream_stats* from,
+                               grpc_transport_stream_stats* to);
 
 typedef struct {
-  void *extra_arg;
+  void* extra_arg;
   grpc_closure closure;
 } grpc_handler_private_op_data;
 
@@ -110,10 +110,10 @@
   /** Should be enqueued when all requested operations (excluding recv_message
       and recv_initial_metadata which have their own closures) in a given batch
       have been completed. */
-  grpc_closure *on_complete;
+  grpc_closure* on_complete;
 
   /** Values for the stream op (fields set are determined by flags above) */
-  grpc_transport_stream_op_batch_payload *payload;
+  grpc_transport_stream_op_batch_payload* payload;
 
   /** Send initial metadata to the peer, from the provided metadata batch. */
   bool send_initial_metadata : 1;
@@ -149,17 +149,17 @@
 
 struct grpc_transport_stream_op_batch_payload {
   struct {
-    grpc_metadata_batch *send_initial_metadata;
+    grpc_metadata_batch* send_initial_metadata;
     /** Iff send_initial_metadata != NULL, flags associated with
         send_initial_metadata: a bitfield of GRPC_INITIAL_METADATA_xxx */
     uint32_t send_initial_metadata_flags;
     // If non-NULL, will be set by the transport to the peer string
     // (a char*, which the caller takes ownership of).
-    gpr_atm *peer_string;
+    gpr_atm* peer_string;
   } send_initial_metadata;
 
   struct {
-    grpc_metadata_batch *send_trailing_metadata;
+    grpc_metadata_batch* send_trailing_metadata;
   } send_trailing_metadata;
 
   struct {
@@ -168,21 +168,21 @@
     // grpc_byte_stream_destroy() on this.
     // The batch's on_complete will not be called until after the byte
     // stream is destroyed.
-    grpc_byte_stream *send_message;
+    grpc_byte_stream* send_message;
   } send_message;
 
   struct {
-    grpc_metadata_batch *recv_initial_metadata;
-    uint32_t *recv_flags;
+    grpc_metadata_batch* recv_initial_metadata;
+    uint32_t* recv_flags;
     /** Should be enqueued when initial metadata is ready to be processed. */
-    grpc_closure *recv_initial_metadata_ready;
+    grpc_closure* recv_initial_metadata_ready;
     // If not NULL, will be set to true if trailing metadata is
     // immediately available.  This may be a signal that we received a
     // Trailers-Only response.
-    bool *trailing_metadata_available;
+    bool* trailing_metadata_available;
     // If non-NULL, will be set by the transport to the peer string
     // (a char*, which the caller takes ownership of).
-    gpr_atm *peer_string;
+    gpr_atm* peer_string;
   } recv_initial_metadata;
 
   struct {
@@ -190,17 +190,17 @@
     // containing a received message.
     // The caller is responsible for calling grpc_byte_stream_destroy()
     // on this byte stream.
-    grpc_byte_stream **recv_message;
+    grpc_byte_stream** recv_message;
     /** Should be enqueued when one message is ready to be processed. */
-    grpc_closure *recv_message_ready;
+    grpc_closure* recv_message_ready;
   } recv_message;
 
   struct {
-    grpc_metadata_batch *recv_trailing_metadata;
+    grpc_metadata_batch* recv_trailing_metadata;
   } recv_trailing_metadata;
 
   struct {
-    grpc_transport_stream_stats *collect_stats;
+    grpc_transport_stream_stats* collect_stats;
   } collect_stats;
 
   /** Forcefully close this stream.
@@ -216,43 +216,43 @@
   struct {
     // Error contract: the transport that gets this op must cause cancel_error
     //                 to be unref'ed after processing it
-    grpc_error *cancel_error;
+    grpc_error* cancel_error;
   } cancel_stream;
 
   /* Indexes correspond to grpc_context_index enum values */
-  grpc_call_context_element *context;
+  grpc_call_context_element* context;
 };
 
 /** Transport op: a set of operations to perform on a transport as a whole */
 typedef struct grpc_transport_op {
   /** Called when processing of this op is done. */
-  grpc_closure *on_consumed;
+  grpc_closure* on_consumed;
   /** connectivity monitoring - set connectivity_state to NULL to unsubscribe */
-  grpc_closure *on_connectivity_state_change;
-  grpc_connectivity_state *connectivity_state;
+  grpc_closure* on_connectivity_state_change;
+  grpc_connectivity_state* connectivity_state;
   /** should the transport be disconnected
    * Error contract: the transport that gets this op must cause
    *                 disconnect_with_error to be unref'ed after processing it */
-  grpc_error *disconnect_with_error;
+  grpc_error* disconnect_with_error;
   /** what should the goaway contain?
    * Error contract: the transport that gets this op must cause
    *                 goaway_error to be unref'ed after processing it */
-  grpc_error *goaway_error;
+  grpc_error* goaway_error;
   /** set the callback for accepting new streams;
       this is a permanent callback, unlike the other one-shot closures.
       If true, the callback is set to set_accept_stream_fn, with its
       user_data argument set to set_accept_stream_user_data */
   bool set_accept_stream;
-  void (*set_accept_stream_fn)(grpc_exec_ctx *exec_ctx, void *user_data,
-                               grpc_transport *transport,
-                               const void *server_data);
-  void *set_accept_stream_user_data;
+  void (*set_accept_stream_fn)(grpc_exec_ctx* exec_ctx, void* user_data,
+                               grpc_transport* transport,
+                               const void* server_data);
+  void* set_accept_stream_user_data;
   /** add this transport to a pollset */
-  grpc_pollset *bind_pollset;
+  grpc_pollset* bind_pollset;
   /** add this transport to a pollset_set */
-  grpc_pollset_set *bind_pollset_set;
+  grpc_pollset_set* bind_pollset_set;
   /** send a ping, call this back if not NULL */
-  grpc_closure *send_ping;
+  grpc_closure* send_ping;
 
   /***************************************************************************
    * remaining fields are initialized and used at the discretion of the
@@ -263,7 +263,7 @@
 
 /* Returns the amount of memory required to store a grpc_stream for this
    transport */
-size_t grpc_transport_stream_size(grpc_transport *transport);
+size_t grpc_transport_stream_size(grpc_transport* transport);
 
 /* Initialize transport data for a stream.
 
@@ -275,13 +275,13 @@
      stream      - a pointer to uninitialized memory to initialize
      server_data - either NULL for a client initiated stream, or a pointer
                    supplied from the accept_stream callback function */
-int grpc_transport_init_stream(grpc_exec_ctx *exec_ctx,
-                               grpc_transport *transport, grpc_stream *stream,
-                               grpc_stream_refcount *refcount,
-                               const void *server_data, gpr_arena *arena);
+int grpc_transport_init_stream(grpc_exec_ctx* exec_ctx,
+                               grpc_transport* transport, grpc_stream* stream,
+                               grpc_stream_refcount* refcount,
+                               const void* server_data, gpr_arena* arena);
 
-void grpc_transport_set_pops(grpc_exec_ctx *exec_ctx, grpc_transport *transport,
-                             grpc_stream *stream, grpc_polling_entity *pollent);
+void grpc_transport_set_pops(grpc_exec_ctx* exec_ctx, grpc_transport* transport,
+                             grpc_stream* stream, grpc_polling_entity* pollent);
 
 /* Destroy transport data for a stream.
 
@@ -293,17 +293,17 @@
      transport - the transport on which to create this stream
      stream    - the grpc_stream to destroy (memory is still owned by the
                  caller, but any child memory must be cleaned up) */
-void grpc_transport_destroy_stream(grpc_exec_ctx *exec_ctx,
-                                   grpc_transport *transport,
-                                   grpc_stream *stream,
-                                   grpc_closure *then_schedule_closure);
+void grpc_transport_destroy_stream(grpc_exec_ctx* exec_ctx,
+                                   grpc_transport* transport,
+                                   grpc_stream* stream,
+                                   grpc_closure* then_schedule_closure);
 
 void grpc_transport_stream_op_batch_finish_with_failure(
-    grpc_exec_ctx *exec_ctx, grpc_transport_stream_op_batch *op,
-    grpc_error *error, grpc_call_combiner *call_combiner);
+    grpc_exec_ctx* exec_ctx, grpc_transport_stream_op_batch* op,
+    grpc_error* error, grpc_call_combiner* call_combiner);
 
-char *grpc_transport_stream_op_batch_string(grpc_transport_stream_op_batch *op);
-char *grpc_transport_op_string(grpc_transport_op *op);
+char* grpc_transport_stream_op_batch_string(grpc_transport_stream_op_batch* op);
+char* grpc_transport_op_string(grpc_transport_op* op);
 
 /* Send a batch of operations on a transport
 
@@ -315,42 +315,42 @@
                  non-NULL and previously initialized by the same transport.
      op        - a grpc_transport_stream_op_batch specifying the op to perform
    */
-void grpc_transport_perform_stream_op(grpc_exec_ctx *exec_ctx,
-                                      grpc_transport *transport,
-                                      grpc_stream *stream,
-                                      grpc_transport_stream_op_batch *op);
+void grpc_transport_perform_stream_op(grpc_exec_ctx* exec_ctx,
+                                      grpc_transport* transport,
+                                      grpc_stream* stream,
+                                      grpc_transport_stream_op_batch* op);
 
-void grpc_transport_perform_op(grpc_exec_ctx *exec_ctx,
-                               grpc_transport *transport,
-                               grpc_transport_op *op);
+void grpc_transport_perform_op(grpc_exec_ctx* exec_ctx,
+                               grpc_transport* transport,
+                               grpc_transport_op* op);
 
 /* Send a ping on a transport
 
    Calls cb with user data when a response is received. */
-void grpc_transport_ping(grpc_transport *transport, grpc_closure *cb);
+void grpc_transport_ping(grpc_transport* transport, grpc_closure* cb);
 
 /* Advise peer of pending connection termination. */
-void grpc_transport_goaway(grpc_transport *transport, grpc_status_code status,
+void grpc_transport_goaway(grpc_transport* transport, grpc_status_code status,
                            grpc_slice debug_data);
 
 /* Close a transport. Aborts all open streams. */
-void grpc_transport_close(grpc_transport *transport);
+void grpc_transport_close(grpc_transport* transport);
 
 /* Destroy the transport */
-void grpc_transport_destroy(grpc_exec_ctx *exec_ctx, grpc_transport *transport);
+void grpc_transport_destroy(grpc_exec_ctx* exec_ctx, grpc_transport* transport);
 
 /* Get the endpoint used by \a transport */
-grpc_endpoint *grpc_transport_get_endpoint(grpc_exec_ctx *exec_ctx,
-                                           grpc_transport *transport);
+grpc_endpoint* grpc_transport_get_endpoint(grpc_exec_ctx* exec_ctx,
+                                           grpc_transport* transport);
 
 /* Allocate a grpc_transport_op, and preconfigure the on_consumed closure to
    \a on_consumed and then delete the returned transport op */
-grpc_transport_op *grpc_make_transport_op(grpc_closure *on_consumed);
+grpc_transport_op* grpc_make_transport_op(grpc_closure* on_consumed);
 /* Allocate a grpc_transport_stream_op_batch, and preconfigure the on_consumed
    closure
    to \a on_consumed and then delete the returned transport op */
-grpc_transport_stream_op_batch *grpc_make_transport_stream_op(
-    grpc_closure *on_consumed);
+grpc_transport_stream_op_batch* grpc_make_transport_stream_op(
+    grpc_closure* on_consumed);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/lib/transport/transport_impl.h b/src/core/lib/transport/transport_impl.h
index 445fb41..22ad599 100644
--- a/src/core/lib/transport/transport_impl.h
+++ b/src/core/lib/transport/transport_impl.h
@@ -31,46 +31,46 @@
   size_t sizeof_stream; /* = sizeof(transport stream) */
 
   /* name of this transport implementation */
-  const char *name;
+  const char* name;
 
   /* implementation of grpc_transport_init_stream */
-  int (*init_stream)(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                     grpc_stream *stream, grpc_stream_refcount *refcount,
-                     const void *server_data, gpr_arena *arena);
+  int (*init_stream)(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                     grpc_stream* stream, grpc_stream_refcount* refcount,
+                     const void* server_data, gpr_arena* arena);
 
   /* implementation of grpc_transport_set_pollset */
-  void (*set_pollset)(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                      grpc_stream *stream, grpc_pollset *pollset);
+  void (*set_pollset)(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                      grpc_stream* stream, grpc_pollset* pollset);
 
   /* implementation of grpc_transport_set_pollset */
-  void (*set_pollset_set)(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                          grpc_stream *stream, grpc_pollset_set *pollset_set);
+  void (*set_pollset_set)(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                          grpc_stream* stream, grpc_pollset_set* pollset_set);
 
   /* implementation of grpc_transport_perform_stream_op */
-  void (*perform_stream_op)(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                            grpc_stream *stream,
-                            grpc_transport_stream_op_batch *op);
+  void (*perform_stream_op)(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                            grpc_stream* stream,
+                            grpc_transport_stream_op_batch* op);
 
   /* implementation of grpc_transport_perform_op */
-  void (*perform_op)(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                     grpc_transport_op *op);
+  void (*perform_op)(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                     grpc_transport_op* op);
 
   /* implementation of grpc_transport_destroy_stream */
-  void (*destroy_stream)(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                         grpc_stream *stream,
-                         grpc_closure *then_schedule_closure);
+  void (*destroy_stream)(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                         grpc_stream* stream,
+                         grpc_closure* then_schedule_closure);
 
   /* implementation of grpc_transport_destroy */
-  void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_transport *self);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_transport* self);
 
   /* implementation of grpc_transport_get_endpoint */
-  grpc_endpoint *(*get_endpoint)(grpc_exec_ctx *exec_ctx, grpc_transport *self);
+  grpc_endpoint* (*get_endpoint)(grpc_exec_ctx* exec_ctx, grpc_transport* self);
 } grpc_transport_vtable;
 
 /* an instance of a grpc transport */
 struct grpc_transport {
   /* pointer to a vtable defining operations on this transport */
-  const grpc_transport_vtable *vtable;
+  const grpc_transport_vtable* vtable;
 };
 
 #ifdef __cplusplus
diff --git a/src/core/lib/transport/transport_op_string.cc b/src/core/lib/transport/transport_op_string.cc
index cc11b0c..24e74c1 100644
--- a/src/core/lib/transport/transport_op_string.cc
+++ b/src/core/lib/transport/transport_op_string.cc
@@ -35,7 +35,7 @@
 /* These routines are here to facilitate debugging - they produce string
    representations of various transport data structures */
 
-static void put_metadata(gpr_strvec *b, grpc_mdelem md) {
+static void put_metadata(gpr_strvec* b, grpc_mdelem md) {
   gpr_strvec_add(b, gpr_strdup("key="));
   gpr_strvec_add(
       b, grpc_dump_slice(GRPC_MDKEY(md), GPR_DUMP_HEX | GPR_DUMP_ASCII));
@@ -45,23 +45,23 @@
       b, grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII));
 }
 
-static void put_metadata_list(gpr_strvec *b, grpc_metadata_batch md) {
-  grpc_linked_mdelem *m;
+static void put_metadata_list(gpr_strvec* b, grpc_metadata_batch md) {
+  grpc_linked_mdelem* m;
   for (m = md.list.head; m != NULL; m = m->next) {
     if (m != md.list.head) gpr_strvec_add(b, gpr_strdup(", "));
     put_metadata(b, m->md);
   }
   if (md.deadline != GRPC_MILLIS_INF_FUTURE) {
-    char *tmp;
+    char* tmp;
     gpr_asprintf(&tmp, " deadline=%" PRIdPTR, md.deadline);
     gpr_strvec_add(b, tmp);
   }
 }
 
-char *grpc_transport_stream_op_batch_string(
-    grpc_transport_stream_op_batch *op) {
-  char *tmp;
-  char *out;
+char* grpc_transport_stream_op_batch_string(
+    grpc_transport_stream_op_batch* op) {
+  char* tmp;
+  char* out;
 
   gpr_strvec b;
   gpr_strvec_init(&b);
@@ -107,7 +107,7 @@
 
   if (op->cancel_stream) {
     gpr_strvec_add(&b, gpr_strdup(" "));
-    const char *msg =
+    const char* msg =
         grpc_error_string(op->payload->cancel_stream.cancel_error);
     gpr_asprintf(&tmp, "CANCEL:%s", msg);
 
@@ -127,9 +127,9 @@
   return out;
 }
 
-char *grpc_transport_op_string(grpc_transport_op *op) {
-  char *tmp;
-  char *out;
+char* grpc_transport_op_string(grpc_transport_op* op) {
+  char* tmp;
+  char* out;
   bool first = true;
 
   gpr_strvec b;
@@ -153,7 +153,7 @@
   if (op->disconnect_with_error != GRPC_ERROR_NONE) {
     if (!first) gpr_strvec_add(&b, gpr_strdup(" "));
     first = false;
-    const char *err = grpc_error_string(op->disconnect_with_error);
+    const char* err = grpc_error_string(op->disconnect_with_error);
     gpr_asprintf(&tmp, "DISCONNECT:%s", err);
     gpr_strvec_add(&b, tmp);
   }
@@ -161,7 +161,7 @@
   if (op->goaway_error) {
     if (!first) gpr_strvec_add(&b, gpr_strdup(" "));
     first = false;
-    const char *msg = grpc_error_string(op->goaway_error);
+    const char* msg = grpc_error_string(op->goaway_error);
     gpr_asprintf(&tmp, "SEND_GOAWAY:%s", msg);
 
     gpr_strvec_add(&b, tmp);
@@ -199,10 +199,10 @@
   return out;
 }
 
-void grpc_call_log_op(const char *file, int line, gpr_log_severity severity,
-                      grpc_call_element *elem,
-                      grpc_transport_stream_op_batch *op) {
-  char *str = grpc_transport_stream_op_batch_string(op);
+void grpc_call_log_op(const char* file, int line, gpr_log_severity severity,
+                      grpc_call_element* elem,
+                      grpc_transport_stream_op_batch* op) {
+  char* str = grpc_transport_stream_op_batch_string(op);
   gpr_log(file, line, severity, "OP[%s:%p]: %s", elem->filter->name, elem, str);
   gpr_free(str);
 }
diff --git a/src/core/plugin_registry/grpc_plugin_registry.cc b/src/core/plugin_registry/grpc_plugin_registry.cc
index 2d332e2..339c9bb 100644
--- a/src/core/plugin_registry/grpc_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_plugin_registry.cc
@@ -46,8 +46,6 @@
 extern "C" void grpc_resolver_sockaddr_shutdown(void);
 extern "C" void grpc_server_load_reporting_plugin_init(void);
 extern "C" void grpc_server_load_reporting_plugin_shutdown(void);
-extern "C" void census_grpc_plugin_init(void);
-extern "C" void census_grpc_plugin_shutdown(void);
 extern "C" void grpc_max_age_filter_init(void);
 extern "C" void grpc_max_age_filter_shutdown(void);
 extern "C" void grpc_message_size_filter_init(void);
@@ -84,8 +82,6 @@
                        grpc_resolver_sockaddr_shutdown);
   grpc_register_plugin(grpc_server_load_reporting_plugin_init,
                        grpc_server_load_reporting_plugin_shutdown);
-  grpc_register_plugin(census_grpc_plugin_init,
-                       census_grpc_plugin_shutdown);
   grpc_register_plugin(grpc_max_age_filter_init,
                        grpc_max_age_filter_shutdown);
   grpc_register_plugin(grpc_message_size_filter_init,
diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
index 7821858..c9fc17d 100644
--- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
+++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
@@ -44,8 +44,6 @@
 extern "C" void grpc_lb_policy_pick_first_shutdown(void);
 extern "C" void grpc_lb_policy_round_robin_init(void);
 extern "C" void grpc_lb_policy_round_robin_shutdown(void);
-extern "C" void census_grpc_plugin_init(void);
-extern "C" void census_grpc_plugin_shutdown(void);
 extern "C" void grpc_max_age_filter_init(void);
 extern "C" void grpc_max_age_filter_shutdown(void);
 extern "C" void grpc_message_size_filter_init(void);
@@ -80,8 +78,6 @@
                        grpc_lb_policy_pick_first_shutdown);
   grpc_register_plugin(grpc_lb_policy_round_robin_init,
                        grpc_lb_policy_round_robin_shutdown);
-  grpc_register_plugin(census_grpc_plugin_init,
-                       census_grpc_plugin_shutdown);
   grpc_register_plugin(grpc_max_age_filter_init,
                        grpc_max_age_filter_shutdown);
   grpc_register_plugin(grpc_message_size_filter_init,
diff --git a/src/core/tsi/fake_transport_security.cc b/src/core/tsi/fake_transport_security.cc
index 08628e4..8cb944e 100644
--- a/src/core/tsi/fake_transport_security.cc
+++ b/src/core/tsi/fake_transport_security.cc
@@ -41,7 +41,7 @@
    where the size field value is the size of the size field plus the size of
    the data encoded in little endian on 4 bytes.  */
 typedef struct {
-  unsigned char *data;
+  unsigned char* data;
   size_t size;
   size_t allocated_size;
   size_t offset;
@@ -63,7 +63,7 @@
   int needs_incoming_message;
   tsi_fake_frame incoming_frame;
   tsi_fake_frame outgoing_frame;
-  unsigned char *outgoing_bytes_buffer;
+  unsigned char* outgoing_bytes_buffer;
   size_t outgoing_bytes_buffer_size;
   tsi_result result;
 } tsi_fake_handshaker;
@@ -85,10 +85,10 @@
 
 /* --- Utils. ---*/
 
-static const char *tsi_fake_handshake_message_strings[] = {
+static const char* tsi_fake_handshake_message_strings[] = {
     "CLIENT_INIT", "SERVER_INIT", "CLIENT_FINISHED", "SERVER_FINISHED"};
 
-static const char *tsi_fake_handshake_message_to_string(int msg) {
+static const char* tsi_fake_handshake_message_to_string(int msg) {
   if (msg < 0 || msg >= TSI_FAKE_HANDSHAKE_MESSAGE_MAX) {
     gpr_log(GPR_ERROR, "Invalid message %d", msg);
     return "UNKNOWN";
@@ -97,7 +97,7 @@
 }
 
 static tsi_result tsi_fake_handshake_message_from_string(
-    const char *msg_string, tsi_fake_handshake_message *msg) {
+    const char* msg_string, tsi_fake_handshake_message* msg) {
   for (int i = 0; i < TSI_FAKE_HANDSHAKE_MESSAGE_MAX; i++) {
     if (strncmp(msg_string, tsi_fake_handshake_message_strings[i],
                 strlen(tsi_fake_handshake_message_strings[i])) == 0) {
@@ -109,22 +109,22 @@
   return TSI_DATA_CORRUPTED;
 }
 
-static uint32_t load32_little_endian(const unsigned char *buf) {
+static uint32_t load32_little_endian(const unsigned char* buf) {
   return ((uint32_t)(buf[0]) | (uint32_t)(buf[1] << 8) |
           (uint32_t)(buf[2] << 16) | (uint32_t)(buf[3] << 24));
 }
 
-static void store32_little_endian(uint32_t value, unsigned char *buf) {
+static void store32_little_endian(uint32_t value, unsigned char* buf) {
   buf[3] = (unsigned char)((value >> 24) & 0xFF);
   buf[2] = (unsigned char)((value >> 16) & 0xFF);
   buf[1] = (unsigned char)((value >> 8) & 0xFF);
   buf[0] = (unsigned char)((value)&0xFF);
 }
 
-static uint32_t read_frame_size(const grpc_slice_buffer *sb) {
+static uint32_t read_frame_size(const grpc_slice_buffer* sb) {
   GPR_ASSERT(sb != NULL && sb->length >= TSI_FAKE_FRAME_HEADER_SIZE);
   uint8_t frame_size_buffer[TSI_FAKE_FRAME_HEADER_SIZE];
-  uint8_t *buf = frame_size_buffer;
+  uint8_t* buf = frame_size_buffer;
   /* Copies the first 4 bytes to a temporary buffer.  */
   size_t remaining = TSI_FAKE_FRAME_HEADER_SIZE;
   for (size_t i = 0; i < sb->count; i++) {
@@ -143,7 +143,7 @@
   return load32_little_endian(frame_size_buffer);
 }
 
-static void tsi_fake_frame_reset(tsi_fake_frame *frame, int needs_draining) {
+static void tsi_fake_frame_reset(tsi_fake_frame* frame, int needs_draining) {
   frame->offset = 0;
   frame->needs_draining = needs_draining;
   if (!needs_draining) frame->size = 0;
@@ -151,13 +151,13 @@
 
 /* Checks if the frame's allocated size is at least frame->size, and reallocs
  * more memory if necessary. */
-static void tsi_fake_frame_ensure_size(tsi_fake_frame *frame) {
+static void tsi_fake_frame_ensure_size(tsi_fake_frame* frame) {
   if (frame->data == NULL) {
     frame->allocated_size = frame->size;
-    frame->data = (unsigned char *)gpr_malloc(frame->allocated_size);
+    frame->data = (unsigned char*)gpr_malloc(frame->allocated_size);
   } else if (frame->size > frame->allocated_size) {
-    unsigned char *new_data =
-        (unsigned char *)gpr_realloc(frame->data, frame->size);
+    unsigned char* new_data =
+        (unsigned char*)gpr_realloc(frame->data, frame->size);
     frame->data = new_data;
     frame->allocated_size = frame->size;
   }
@@ -166,17 +166,17 @@
 /* Decodes the serialized fake frame contained in incoming_bytes, and fills
  * frame with the contents of the decoded frame.
  * This method should not be called if frame->needs_framing is not 0.  */
-static tsi_result tsi_fake_frame_decode(const unsigned char *incoming_bytes,
-                                        size_t *incoming_bytes_size,
-                                        tsi_fake_frame *frame) {
+static tsi_result tsi_fake_frame_decode(const unsigned char* incoming_bytes,
+                                        size_t* incoming_bytes_size,
+                                        tsi_fake_frame* frame) {
   size_t available_size = *incoming_bytes_size;
   size_t to_read_size = 0;
-  const unsigned char *bytes_cursor = incoming_bytes;
+  const unsigned char* bytes_cursor = incoming_bytes;
 
   if (frame->needs_draining) return TSI_INTERNAL_ERROR;
   if (frame->data == NULL) {
     frame->allocated_size = TSI_FAKE_FRAME_INITIAL_ALLOCATED_SIZE;
-    frame->data = (unsigned char *)gpr_malloc(frame->allocated_size);
+    frame->data = (unsigned char*)gpr_malloc(frame->allocated_size);
   }
 
   if (frame->offset < TSI_FAKE_FRAME_HEADER_SIZE) {
@@ -215,9 +215,9 @@
 /* Encodes a fake frame into its wire format and places the result in
  * outgoing_bytes. outgoing_bytes_size indicates the size of the encoded frame.
  * This method should not be called if frame->needs_framing is 0.  */
-static tsi_result tsi_fake_frame_encode(unsigned char *outgoing_bytes,
-                                        size_t *outgoing_bytes_size,
-                                        tsi_fake_frame *frame) {
+static tsi_result tsi_fake_frame_encode(unsigned char* outgoing_bytes,
+                                        size_t* outgoing_bytes_size,
+                                        tsi_fake_frame* frame) {
   size_t to_write_size = frame->size - frame->offset;
   if (!frame->needs_draining) return TSI_INTERNAL_ERROR;
   if (*outgoing_bytes_size < to_write_size) {
@@ -233,8 +233,8 @@
 
 /* Sets the payload of a fake frame to contain the given data blob, where
  * data_size indicates the size of data. */
-static tsi_result tsi_fake_frame_set_data(unsigned char *data, size_t data_size,
-                                          tsi_fake_frame *frame) {
+static tsi_result tsi_fake_frame_set_data(unsigned char* data, size_t data_size,
+                                          tsi_fake_frame* frame) {
   frame->offset = 0;
   frame->size = data_size + TSI_FAKE_FRAME_HEADER_SIZE;
   tsi_fake_frame_ensure_size(frame);
@@ -245,24 +245,24 @@
 }
 
 /* Destroys the contents of a fake frame. */
-static void tsi_fake_frame_destruct(tsi_fake_frame *frame) {
+static void tsi_fake_frame_destruct(tsi_fake_frame* frame) {
   if (frame->data != NULL) gpr_free(frame->data);
 }
 
 /* --- tsi_frame_protector methods implementation. ---*/
 
-static tsi_result fake_protector_protect(tsi_frame_protector *self,
-                                         const unsigned char *unprotected_bytes,
-                                         size_t *unprotected_bytes_size,
-                                         unsigned char *protected_output_frames,
-                                         size_t *protected_output_frames_size) {
+static tsi_result fake_protector_protect(tsi_frame_protector* self,
+                                         const unsigned char* unprotected_bytes,
+                                         size_t* unprotected_bytes_size,
+                                         unsigned char* protected_output_frames,
+                                         size_t* protected_output_frames_size) {
   tsi_result result = TSI_OK;
-  tsi_fake_frame_protector *impl = (tsi_fake_frame_protector *)self;
+  tsi_fake_frame_protector* impl = (tsi_fake_frame_protector*)self;
   unsigned char frame_header[TSI_FAKE_FRAME_HEADER_SIZE];
-  tsi_fake_frame *frame = &impl->protect_frame;
+  tsi_fake_frame* frame = &impl->protect_frame;
   size_t saved_output_size = *protected_output_frames_size;
   size_t drained_size = 0;
-  size_t *num_bytes_written = protected_output_frames_size;
+  size_t* num_bytes_written = protected_output_frames_size;
   *num_bytes_written = 0;
 
   /* Try to drain first. */
@@ -313,11 +313,11 @@
 }
 
 static tsi_result fake_protector_protect_flush(
-    tsi_frame_protector *self, unsigned char *protected_output_frames,
-    size_t *protected_output_frames_size, size_t *still_pending_size) {
+    tsi_frame_protector* self, unsigned char* protected_output_frames,
+    size_t* protected_output_frames_size, size_t* still_pending_size) {
   tsi_result result = TSI_OK;
-  tsi_fake_frame_protector *impl = (tsi_fake_frame_protector *)self;
-  tsi_fake_frame *frame = &impl->protect_frame;
+  tsi_fake_frame_protector* impl = (tsi_fake_frame_protector*)self;
+  tsi_fake_frame* frame = &impl->protect_frame;
   if (!frame->needs_draining) {
     /* Create a short frame. */
     frame->size = frame->offset;
@@ -334,15 +334,15 @@
 }
 
 static tsi_result fake_protector_unprotect(
-    tsi_frame_protector *self, const unsigned char *protected_frames_bytes,
-    size_t *protected_frames_bytes_size, unsigned char *unprotected_bytes,
-    size_t *unprotected_bytes_size) {
+    tsi_frame_protector* self, const unsigned char* protected_frames_bytes,
+    size_t* protected_frames_bytes_size, unsigned char* unprotected_bytes,
+    size_t* unprotected_bytes_size) {
   tsi_result result = TSI_OK;
-  tsi_fake_frame_protector *impl = (tsi_fake_frame_protector *)self;
-  tsi_fake_frame *frame = &impl->unprotect_frame;
+  tsi_fake_frame_protector* impl = (tsi_fake_frame_protector*)self;
+  tsi_fake_frame* frame = &impl->unprotect_frame;
   size_t saved_output_size = *unprotected_bytes_size;
   size_t drained_size = 0;
-  size_t *num_bytes_written = unprotected_bytes_size;
+  size_t* num_bytes_written = unprotected_bytes_size;
   *num_bytes_written = 0;
 
   /* Try to drain first. */
@@ -382,29 +382,31 @@
   return result;
 }
 
-static void fake_protector_destroy(tsi_frame_protector *self) {
-  tsi_fake_frame_protector *impl = (tsi_fake_frame_protector *)self;
+static void fake_protector_destroy(tsi_frame_protector* self) {
+  tsi_fake_frame_protector* impl = (tsi_fake_frame_protector*)self;
   tsi_fake_frame_destruct(&impl->protect_frame);
   tsi_fake_frame_destruct(&impl->unprotect_frame);
   gpr_free(self);
 }
 
 static const tsi_frame_protector_vtable frame_protector_vtable = {
-    fake_protector_protect, fake_protector_protect_flush,
-    fake_protector_unprotect, fake_protector_destroy,
+    fake_protector_protect,
+    fake_protector_protect_flush,
+    fake_protector_unprotect,
+    fake_protector_destroy,
 };
 
 /* --- tsi_zero_copy_grpc_protector methods implementation. ---*/
 
 static tsi_result fake_zero_copy_grpc_protector_protect(
-    grpc_exec_ctx *exec_ctx, tsi_zero_copy_grpc_protector *self,
-    grpc_slice_buffer *unprotected_slices,
-    grpc_slice_buffer *protected_slices) {
+    grpc_exec_ctx* exec_ctx, tsi_zero_copy_grpc_protector* self,
+    grpc_slice_buffer* unprotected_slices,
+    grpc_slice_buffer* protected_slices) {
   if (self == NULL || unprotected_slices == NULL || protected_slices == NULL) {
     return TSI_INVALID_ARGUMENT;
   }
-  tsi_fake_zero_copy_grpc_protector *impl =
-      (tsi_fake_zero_copy_grpc_protector *)self;
+  tsi_fake_zero_copy_grpc_protector* impl =
+      (tsi_fake_zero_copy_grpc_protector*)self;
   /* Protects each frame. */
   while (unprotected_slices->length > 0) {
     size_t frame_length =
@@ -421,14 +423,14 @@
 }
 
 static tsi_result fake_zero_copy_grpc_protector_unprotect(
-    grpc_exec_ctx *exec_ctx, tsi_zero_copy_grpc_protector *self,
-    grpc_slice_buffer *protected_slices,
-    grpc_slice_buffer *unprotected_slices) {
+    grpc_exec_ctx* exec_ctx, tsi_zero_copy_grpc_protector* self,
+    grpc_slice_buffer* protected_slices,
+    grpc_slice_buffer* unprotected_slices) {
   if (self == NULL || unprotected_slices == NULL || protected_slices == NULL) {
     return TSI_INVALID_ARGUMENT;
   }
-  tsi_fake_zero_copy_grpc_protector *impl =
-      (tsi_fake_zero_copy_grpc_protector *)self;
+  tsi_fake_zero_copy_grpc_protector* impl =
+      (tsi_fake_zero_copy_grpc_protector*)self;
   grpc_slice_buffer_move_into(protected_slices, &impl->protected_sb);
   /* Unprotect each frame, if we get a full frame. */
   while (impl->protected_sb.length >= TSI_FAKE_FRAME_HEADER_SIZE) {
@@ -456,10 +458,10 @@
 }
 
 static void fake_zero_copy_grpc_protector_destroy(
-    grpc_exec_ctx *exec_ctx, tsi_zero_copy_grpc_protector *self) {
+    grpc_exec_ctx* exec_ctx, tsi_zero_copy_grpc_protector* self) {
   if (self == NULL) return;
-  tsi_fake_zero_copy_grpc_protector *impl =
-      (tsi_fake_zero_copy_grpc_protector *)self;
+  tsi_fake_zero_copy_grpc_protector* impl =
+      (tsi_fake_zero_copy_grpc_protector*)self;
   grpc_slice_buffer_destroy_internal(exec_ctx, &impl->header_sb);
   grpc_slice_buffer_destroy_internal(exec_ctx, &impl->protected_sb);
   gpr_free(impl);
@@ -476,12 +478,12 @@
 
 typedef struct {
   tsi_handshaker_result base;
-  unsigned char *unused_bytes;
+  unsigned char* unused_bytes;
   size_t unused_bytes_size;
 } fake_handshaker_result;
 
 static tsi_result fake_handshaker_result_extract_peer(
-    const tsi_handshaker_result *self, tsi_peer *peer) {
+    const tsi_handshaker_result* self, tsi_peer* peer) {
   /* Construct a tsi_peer with 1 property: certificate type. */
   tsi_result result = tsi_construct_peer(1, peer);
   if (result != TSI_OK) return result;
@@ -493,32 +495,32 @@
 }
 
 static tsi_result fake_handshaker_result_create_zero_copy_grpc_protector(
-    void *exec_ctx, const tsi_handshaker_result *self,
-    size_t *max_output_protected_frame_size,
-    tsi_zero_copy_grpc_protector **protector) {
+    void* exec_ctx, const tsi_handshaker_result* self,
+    size_t* max_output_protected_frame_size,
+    tsi_zero_copy_grpc_protector** protector) {
   *protector =
       tsi_create_fake_zero_copy_grpc_protector(max_output_protected_frame_size);
   return TSI_OK;
 }
 
 static tsi_result fake_handshaker_result_create_frame_protector(
-    const tsi_handshaker_result *self, size_t *max_output_protected_frame_size,
-    tsi_frame_protector **protector) {
+    const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
+    tsi_frame_protector** protector) {
   *protector = tsi_create_fake_frame_protector(max_output_protected_frame_size);
   return TSI_OK;
 }
 
 static tsi_result fake_handshaker_result_get_unused_bytes(
-    const tsi_handshaker_result *self, const unsigned char **bytes,
-    size_t *bytes_size) {
-  fake_handshaker_result *result = (fake_handshaker_result *)self;
+    const tsi_handshaker_result* self, const unsigned char** bytes,
+    size_t* bytes_size) {
+  fake_handshaker_result* result = (fake_handshaker_result*)self;
   *bytes_size = result->unused_bytes_size;
   *bytes = result->unused_bytes;
   return TSI_OK;
 }
 
-static void fake_handshaker_result_destroy(tsi_handshaker_result *self) {
-  fake_handshaker_result *result = (fake_handshaker_result *)self;
+static void fake_handshaker_result_destroy(tsi_handshaker_result* self) {
+  fake_handshaker_result* result = (fake_handshaker_result*)self;
   gpr_free(result->unused_bytes);
   gpr_free(self);
 }
@@ -532,17 +534,17 @@
 };
 
 static tsi_result fake_handshaker_result_create(
-    const unsigned char *unused_bytes, size_t unused_bytes_size,
-    tsi_handshaker_result **handshaker_result) {
+    const unsigned char* unused_bytes, size_t unused_bytes_size,
+    tsi_handshaker_result** handshaker_result) {
   if ((unused_bytes_size > 0 && unused_bytes == NULL) ||
       handshaker_result == NULL) {
     return TSI_INVALID_ARGUMENT;
   }
-  fake_handshaker_result *result =
-      (fake_handshaker_result *)gpr_zalloc(sizeof(*result));
+  fake_handshaker_result* result =
+      (fake_handshaker_result*)gpr_zalloc(sizeof(*result));
   result->base.vtable = &handshaker_result_vtable;
   if (unused_bytes_size > 0) {
-    result->unused_bytes = (unsigned char *)gpr_malloc(unused_bytes_size);
+    result->unused_bytes = (unsigned char*)gpr_malloc(unused_bytes_size);
     memcpy(result->unused_bytes, unused_bytes, unused_bytes_size);
   }
   result->unused_bytes_size = unused_bytes_size;
@@ -553,8 +555,8 @@
 /* --- tsi_handshaker methods implementation. ---*/
 
 static tsi_result fake_handshaker_get_bytes_to_send_to_peer(
-    tsi_handshaker *self, unsigned char *bytes, size_t *bytes_size) {
-  tsi_fake_handshaker *impl = (tsi_fake_handshaker *)self;
+    tsi_handshaker* self, unsigned char* bytes, size_t* bytes_size) {
+  tsi_fake_handshaker* impl = (tsi_fake_handshaker*)self;
   tsi_result result = TSI_OK;
   if (impl->needs_incoming_message || impl->result == TSI_OK) {
     *bytes_size = 0;
@@ -563,9 +565,9 @@
   if (!impl->outgoing_frame.needs_draining) {
     tsi_fake_handshake_message next_message_to_send =
         (tsi_fake_handshake_message)(impl->next_message_to_send + 2);
-    const char *msg_string =
+    const char* msg_string =
         tsi_fake_handshake_message_to_string(impl->next_message_to_send);
-    result = tsi_fake_frame_set_data((unsigned char *)msg_string,
+    result = tsi_fake_frame_set_data((unsigned char*)msg_string,
                                      strlen(msg_string), &impl->outgoing_frame);
     if (result != TSI_OK) return result;
     if (next_message_to_send > TSI_FAKE_HANDSHAKE_MESSAGE_MAX) {
@@ -594,9 +596,9 @@
 }
 
 static tsi_result fake_handshaker_process_bytes_from_peer(
-    tsi_handshaker *self, const unsigned char *bytes, size_t *bytes_size) {
+    tsi_handshaker* self, const unsigned char* bytes, size_t* bytes_size) {
   tsi_result result = TSI_OK;
-  tsi_fake_handshaker *impl = (tsi_fake_handshaker *)self;
+  tsi_fake_handshaker* impl = (tsi_fake_handshaker*)self;
   tsi_fake_handshake_message expected_msg =
       (tsi_fake_handshake_message)(impl->next_message_to_send - 1);
   tsi_fake_handshake_message received_msg;
@@ -610,7 +612,7 @@
 
   /* We now have a complete frame. */
   result = tsi_fake_handshake_message_from_string(
-      (const char *)impl->incoming_frame.data + TSI_FAKE_FRAME_HEADER_SIZE,
+      (const char*)impl->incoming_frame.data + TSI_FAKE_FRAME_HEADER_SIZE,
       &received_msg);
   if (result != TSI_OK) {
     impl->result = result;
@@ -637,13 +639,13 @@
   return TSI_OK;
 }
 
-static tsi_result fake_handshaker_get_result(tsi_handshaker *self) {
-  tsi_fake_handshaker *impl = (tsi_fake_handshaker *)self;
+static tsi_result fake_handshaker_get_result(tsi_handshaker* self) {
+  tsi_fake_handshaker* impl = (tsi_fake_handshaker*)self;
   return impl->result;
 }
 
-static void fake_handshaker_destroy(tsi_handshaker *self) {
-  tsi_fake_handshaker *impl = (tsi_fake_handshaker *)self;
+static void fake_handshaker_destroy(tsi_handshaker* self) {
+  tsi_fake_handshaker* impl = (tsi_fake_handshaker*)self;
   tsi_fake_frame_destruct(&impl->incoming_frame);
   tsi_fake_frame_destruct(&impl->outgoing_frame);
   gpr_free(impl->outgoing_bytes_buffer);
@@ -651,17 +653,17 @@
 }
 
 static tsi_result fake_handshaker_next(
-    tsi_handshaker *self, const unsigned char *received_bytes,
-    size_t received_bytes_size, const unsigned char **bytes_to_send,
-    size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result,
-    tsi_handshaker_on_next_done_cb cb, void *user_data) {
+    tsi_handshaker* self, const unsigned char* received_bytes,
+    size_t received_bytes_size, const unsigned char** bytes_to_send,
+    size_t* bytes_to_send_size, tsi_handshaker_result** handshaker_result,
+    tsi_handshaker_on_next_done_cb cb, void* user_data) {
   /* Sanity check the arguments. */
   if ((received_bytes_size > 0 && received_bytes == NULL) ||
       bytes_to_send == NULL || bytes_to_send_size == NULL ||
       handshaker_result == NULL) {
     return TSI_INVALID_ARGUMENT;
   }
-  tsi_fake_handshaker *handshaker = (tsi_fake_handshaker *)self;
+  tsi_fake_handshaker* handshaker = (tsi_fake_handshaker*)self;
   tsi_result result = TSI_OK;
 
   /* Decode and process a handshake frame from the peer. */
@@ -683,8 +685,8 @@
     if (result == TSI_INCOMPLETE_DATA) {
       handshaker->outgoing_bytes_buffer_size *= 2;
       handshaker->outgoing_bytes_buffer =
-          (unsigned char *)gpr_realloc(handshaker->outgoing_bytes_buffer,
-                                       handshaker->outgoing_bytes_buffer_size);
+          (unsigned char*)gpr_realloc(handshaker->outgoing_bytes_buffer,
+                                      handshaker->outgoing_bytes_buffer_size);
     }
   } while (result == TSI_INCOMPLETE_DATA);
   if (result != TSI_OK) return result;
@@ -696,7 +698,7 @@
     *handshaker_result = NULL;
   } else {
     /* Calculate the unused bytes. */
-    const unsigned char *unused_bytes = NULL;
+    const unsigned char* unused_bytes = NULL;
     size_t unused_bytes_size = received_bytes_size - consumed_bytes_size;
     if (unused_bytes_size > 0) {
       unused_bytes = received_bytes + consumed_bytes_size;
@@ -724,15 +726,15 @@
     fake_handshaker_next,
 };
 
-tsi_handshaker *tsi_create_fake_handshaker(int is_client) {
-  tsi_fake_handshaker *impl = (tsi_fake_handshaker *)gpr_zalloc(sizeof(*impl));
+tsi_handshaker* tsi_create_fake_handshaker(int is_client) {
+  tsi_fake_handshaker* impl = (tsi_fake_handshaker*)gpr_zalloc(sizeof(*impl));
   impl->base.vtable = &handshaker_vtable;
   impl->is_client = is_client;
   impl->result = TSI_HANDSHAKE_IN_PROGRESS;
   impl->outgoing_bytes_buffer_size =
       TSI_FAKE_HANDSHAKER_OUTGOING_BUFFER_INITIAL_SIZE;
   impl->outgoing_bytes_buffer =
-      (unsigned char *)gpr_malloc(impl->outgoing_bytes_buffer_size);
+      (unsigned char*)gpr_malloc(impl->outgoing_bytes_buffer_size);
   if (is_client) {
     impl->needs_incoming_message = 0;
     impl->next_message_to_send = TSI_FAKE_CLIENT_INIT;
@@ -743,10 +745,10 @@
   return &impl->base;
 }
 
-tsi_frame_protector *tsi_create_fake_frame_protector(
-    size_t *max_protected_frame_size) {
-  tsi_fake_frame_protector *impl =
-      (tsi_fake_frame_protector *)gpr_zalloc(sizeof(*impl));
+tsi_frame_protector* tsi_create_fake_frame_protector(
+    size_t* max_protected_frame_size) {
+  tsi_fake_frame_protector* impl =
+      (tsi_fake_frame_protector*)gpr_zalloc(sizeof(*impl));
   impl->max_frame_size = (max_protected_frame_size == NULL)
                              ? TSI_FAKE_DEFAULT_FRAME_SIZE
                              : *max_protected_frame_size;
@@ -754,10 +756,10 @@
   return &impl->base;
 }
 
-tsi_zero_copy_grpc_protector *tsi_create_fake_zero_copy_grpc_protector(
-    size_t *max_protected_frame_size) {
-  tsi_fake_zero_copy_grpc_protector *impl =
-      (tsi_fake_zero_copy_grpc_protector *)gpr_zalloc(sizeof(*impl));
+tsi_zero_copy_grpc_protector* tsi_create_fake_zero_copy_grpc_protector(
+    size_t* max_protected_frame_size) {
+  tsi_fake_zero_copy_grpc_protector* impl =
+      (tsi_fake_zero_copy_grpc_protector*)gpr_zalloc(sizeof(*impl));
   grpc_slice_buffer_init(&impl->header_sb);
   grpc_slice_buffer_init(&impl->protected_sb);
   impl->max_frame_size = (max_protected_frame_size == NULL)
diff --git a/src/core/tsi/fake_transport_security.h b/src/core/tsi/fake_transport_security.h
index 6159708..b90b996 100644
--- a/src/core/tsi/fake_transport_security.h
+++ b/src/core/tsi/fake_transport_security.h
@@ -33,16 +33,16 @@
    No cryptography is performed in these objects. They just simulate handshake
    messages going back and forth for the handshaker and do some framing on
    cleartext data for the protector.  */
-tsi_handshaker *tsi_create_fake_handshaker(int is_client);
+tsi_handshaker* tsi_create_fake_handshaker(int is_client);
 
 /* Creates a protector directly without going through the handshake phase. */
-tsi_frame_protector *tsi_create_fake_frame_protector(
-    size_t *max_protected_frame_size);
+tsi_frame_protector* tsi_create_fake_frame_protector(
+    size_t* max_protected_frame_size);
 
 /* Creates a zero-copy protector directly without going through the handshake
  * phase. */
-tsi_zero_copy_grpc_protector *tsi_create_fake_zero_copy_grpc_protector(
-    size_t *max_protected_frame_size);
+tsi_zero_copy_grpc_protector* tsi_create_fake_zero_copy_grpc_protector(
+    size_t* max_protected_frame_size);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/tsi/gts_transport_security.cc b/src/core/tsi/gts_transport_security.cc
index d37f3bf..1dfd8c4 100644
--- a/src/core/tsi/gts_transport_security.cc
+++ b/src/core/tsi/gts_transport_security.cc
@@ -22,7 +22,7 @@
 
 static gts_shared_resource g_gts_resource;
 
-gts_shared_resource *gts_get_shared_resource(void) { return &g_gts_resource; }
+gts_shared_resource* gts_get_shared_resource(void) { return &g_gts_resource; }
 
 extern "C" void grpc_tsi_gts_init() {
   memset(&g_gts_resource, 0, sizeof(gts_shared_resource));
diff --git a/src/core/tsi/gts_transport_security.h b/src/core/tsi/gts_transport_security.h
index 9590038..8bc2107 100644
--- a/src/core/tsi/gts_transport_security.h
+++ b/src/core/tsi/gts_transport_security.h
@@ -29,14 +29,14 @@
 
 typedef struct gts_shared_resource {
   gpr_thd_id thread_id;
-  grpc_channel *channel;
-  grpc_completion_queue *cq;
+  grpc_channel* channel;
+  grpc_completion_queue* cq;
   gpr_mu mu;
 } gts_shared_resource;
 
 /* This method returns the address of gts_shared_resource object shared by all
  *    TSI handshakes. */
-gts_shared_resource *gts_get_shared_resource(void);
+gts_shared_resource* gts_get_shared_resource(void);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc
index 09d6c70..914e8c3 100644
--- a/src/core/tsi/ssl_transport_security.cc
+++ b/src/core/tsi/ssl_transport_security.cc
@@ -70,14 +70,14 @@
 /* --- Structure definitions. ---*/
 
 struct tsi_ssl_handshaker_factory {
-  const tsi_ssl_handshaker_factory_vtable *vtable;
+  const tsi_ssl_handshaker_factory_vtable* vtable;
   gpr_refcount refcount;
 };
 
 struct tsi_ssl_client_handshaker_factory {
   tsi_ssl_handshaker_factory base;
-  SSL_CTX *ssl_context;
-  unsigned char *alpn_protocol_list;
+  SSL_CTX* ssl_context;
+  unsigned char* alpn_protocol_list;
   size_t alpn_protocol_list_length;
 };
 
@@ -86,28 +86,28 @@
      The tsi_peer array contains the subject names of the server certificates
      associated with the contexts at the same index.  */
   tsi_ssl_handshaker_factory base;
-  SSL_CTX **ssl_contexts;
-  tsi_peer *ssl_context_x509_subject_names;
+  SSL_CTX** ssl_contexts;
+  tsi_peer* ssl_context_x509_subject_names;
   size_t ssl_context_count;
-  unsigned char *alpn_protocol_list;
+  unsigned char* alpn_protocol_list;
   size_t alpn_protocol_list_length;
 };
 
 typedef struct {
   tsi_handshaker base;
-  SSL *ssl;
-  BIO *into_ssl;
-  BIO *from_ssl;
+  SSL* ssl;
+  BIO* into_ssl;
+  BIO* from_ssl;
   tsi_result result;
-  tsi_ssl_handshaker_factory *factory_ref;
+  tsi_ssl_handshaker_factory* factory_ref;
 } tsi_ssl_handshaker;
 
 typedef struct {
   tsi_frame_protector base;
-  SSL *ssl;
-  BIO *into_ssl;
-  BIO *from_ssl;
-  unsigned char *buffer;
+  SSL* ssl;
+  BIO* into_ssl;
+  BIO* from_ssl;
+  unsigned char* buffer;
   size_t buffer_size;
   size_t buffer_offset;
 } tsi_ssl_frame_protector;
@@ -115,9 +115,9 @@
 /* --- Library Initialization. ---*/
 
 static gpr_once init_openssl_once = GPR_ONCE_INIT;
-static gpr_mu *openssl_mutexes = NULL;
+static gpr_mu* openssl_mutexes = NULL;
 
-static void openssl_locking_cb(int mode, int type, const char *file, int line) {
+static void openssl_locking_cb(int mode, int type, const char* file, int line) {
   if (mode & CRYPTO_LOCK) {
     gpr_mu_lock(&openssl_mutexes[type]);
   } else {
@@ -137,7 +137,7 @@
   OpenSSL_add_all_algorithms();
   num_locks = CRYPTO_num_locks();
   GPR_ASSERT(num_locks > 0);
-  openssl_mutexes = (gpr_mu *)gpr_malloc((size_t)num_locks * sizeof(gpr_mu));
+  openssl_mutexes = (gpr_mu*)gpr_malloc((size_t)num_locks * sizeof(gpr_mu));
   for (i = 0; i < CRYPTO_num_locks(); i++) {
     gpr_mu_init(&openssl_mutexes[i]);
   }
@@ -147,7 +147,7 @@
 
 /* --- Ssl utils. ---*/
 
-static const char *ssl_error_string(int error) {
+static const char* ssl_error_string(int error) {
   switch (error) {
     case SSL_ERROR_NONE:
       return "SSL_ERROR_NONE";
@@ -173,8 +173,8 @@
 }
 
 /* TODO(jboeuf): Remove when we are past the debugging phase with this code. */
-static void ssl_log_where_info(const SSL *ssl, int where, int flag,
-                               const char *msg) {
+static void ssl_log_where_info(const SSL* ssl, int where, int flag,
+                               const char* msg) {
   if ((where & flag) && tsi_tracing_enabled.enabled()) {
     gpr_log(GPR_INFO, "%20.20s - %30.30s  - %5.10s", msg,
             SSL_state_string_long(ssl), SSL_state_string(ssl));
@@ -182,7 +182,7 @@
 }
 
 /* Used for debugging. TODO(jboeuf): Remove when code is mature enough. */
-static void ssl_info_callback(const SSL *ssl, int where, int ret) {
+static void ssl_info_callback(const SSL* ssl, int where, int ret) {
   if (ret == 0) {
     gpr_log(GPR_ERROR, "ssl_info_callback: error occured.\n");
     return;
@@ -195,7 +195,7 @@
 
 /* Returns 1 if name looks like an IP address, 0 otherwise.
    This is a very rough heuristic, and only handles IPv6 in hexadecimal form. */
-static int looks_like_ip_address(const char *name) {
+static int looks_like_ip_address(const char* name) {
   size_t i;
   size_t dot_count = 0;
   size_t num_size = 0;
@@ -220,12 +220,12 @@
 }
 
 /* Gets the subject CN from an X509 cert. */
-static tsi_result ssl_get_x509_common_name(X509 *cert, unsigned char **utf8,
-                                           size_t *utf8_size) {
+static tsi_result ssl_get_x509_common_name(X509* cert, unsigned char** utf8,
+                                           size_t* utf8_size) {
   int common_name_index = -1;
-  X509_NAME_ENTRY *common_name_entry = NULL;
-  ASN1_STRING *common_name_asn1 = NULL;
-  X509_NAME *subject_name = X509_get_subject_name(cert);
+  X509_NAME_ENTRY* common_name_entry = NULL;
+  ASN1_STRING* common_name_asn1 = NULL;
+  X509_NAME* subject_name = X509_get_subject_name(cert);
   int utf8_returned_size = 0;
   if (subject_name == NULL) {
     gpr_log(GPR_ERROR, "Could not get subject name from certificate.");
@@ -260,8 +260,8 @@
 
 /* Gets the subject CN of an X509 cert as a tsi_peer_property. */
 static tsi_result peer_property_from_x509_common_name(
-    X509 *cert, tsi_peer_property *property) {
-  unsigned char *common_name;
+    X509* cert, tsi_peer_property* property) {
+  unsigned char* common_name;
   size_t common_name_size;
   tsi_result result =
       ssl_get_x509_common_name(cert, &common_name, &common_name_size);
@@ -275,35 +275,34 @@
   }
   result = tsi_construct_string_peer_property(
       TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY,
-      common_name == NULL ? "" : (const char *)common_name, common_name_size,
+      common_name == NULL ? "" : (const char*)common_name, common_name_size,
       property);
   OPENSSL_free(common_name);
   return result;
 }
 
 /* Gets the X509 cert in PEM format as a tsi_peer_property. */
-static tsi_result add_pem_certificate(X509 *cert, tsi_peer_property *property) {
-  BIO *bio = BIO_new(BIO_s_mem());
+static tsi_result add_pem_certificate(X509* cert, tsi_peer_property* property) {
+  BIO* bio = BIO_new(BIO_s_mem());
   if (!PEM_write_bio_X509(bio, cert)) {
     BIO_free(bio);
     return TSI_INTERNAL_ERROR;
   }
-  char *contents;
+  char* contents;
   long len = BIO_get_mem_data(bio, &contents);
   if (len <= 0) {
     BIO_free(bio);
     return TSI_INTERNAL_ERROR;
   }
   tsi_result result = tsi_construct_string_peer_property(
-      TSI_X509_PEM_CERT_PROPERTY, (const char *)contents, (size_t)len,
-      property);
+      TSI_X509_PEM_CERT_PROPERTY, (const char*)contents, (size_t)len, property);
   BIO_free(bio);
   return result;
 }
 
 /* Gets the subject SANs from an X509 cert as a tsi_peer_property. */
 static tsi_result add_subject_alt_names_properties_to_peer(
-    tsi_peer *peer, GENERAL_NAMES *subject_alt_names,
+    tsi_peer* peer, GENERAL_NAMES* subject_alt_names,
     size_t subject_alt_name_count) {
   size_t i;
   tsi_result result = TSI_OK;
@@ -312,11 +311,11 @@
   peer->property_count -= subject_alt_name_count;
 
   for (i = 0; i < subject_alt_name_count; i++) {
-    GENERAL_NAME *subject_alt_name =
+    GENERAL_NAME* subject_alt_name =
         sk_GENERAL_NAME_value(subject_alt_names, TSI_SIZE_AS_SIZE(i));
     /* Filter out the non-dns entries names. */
     if (subject_alt_name->type == GEN_DNS) {
-      unsigned char *name = NULL;
+      unsigned char* name = NULL;
       int name_size;
       name_size = ASN1_STRING_to_UTF8(&name, subject_alt_name->d.dNSName);
       if (name_size < 0) {
@@ -325,7 +324,7 @@
         break;
       }
       result = tsi_construct_string_peer_property(
-          TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, (const char *)name,
+          TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, (const char*)name,
           (size_t)name_size, &peer->properties[peer->property_count++]);
       OPENSSL_free(name);
     } else if (subject_alt_name->type == GEN_IPADD) {
@@ -341,7 +340,7 @@
         result = TSI_INTERNAL_ERROR;
         break;
       }
-      const char *name = inet_ntop(af, subject_alt_name->d.iPAddress->data,
+      const char* name = inet_ntop(af, subject_alt_name->d.iPAddress->data,
                                    ntop_buf, INET6_ADDRSTRLEN);
       if (name == NULL) {
         gpr_log(GPR_ERROR, "Could not get IP string from asn1 octet.");
@@ -359,11 +358,11 @@
 }
 
 /* Gets information about the peer's X509 cert as a tsi_peer object. */
-static tsi_result peer_from_x509(X509 *cert, int include_certificate_type,
-                                 tsi_peer *peer) {
+static tsi_result peer_from_x509(X509* cert, int include_certificate_type,
+                                 tsi_peer* peer) {
   /* TODO(jboeuf): Maybe add more properties. */
-  GENERAL_NAMES *subject_alt_names =
-      (GENERAL_NAMES *)X509_get_ext_d2i(cert, NID_subject_alt_name, 0, 0);
+  GENERAL_NAMES* subject_alt_names =
+      (GENERAL_NAMES*)X509_get_ext_d2i(cert, NID_subject_alt_name, 0, 0);
   int subject_alt_name_count = (subject_alt_names != NULL)
                                    ? (int)sk_GENERAL_NAME_num(subject_alt_names)
                                    : 0;
@@ -415,8 +414,8 @@
 }
 
 /* Performs an SSL_read and handle errors. */
-static tsi_result do_ssl_read(SSL *ssl, unsigned char *unprotected_bytes,
-                              size_t *unprotected_bytes_size) {
+static tsi_result do_ssl_read(SSL* ssl, unsigned char* unprotected_bytes,
+                              size_t* unprotected_bytes_size) {
   int read_from_ssl;
   GPR_ASSERT(*unprotected_bytes_size <= INT_MAX);
   read_from_ssl =
@@ -448,7 +447,7 @@
 }
 
 /* Performs an SSL_write and handle errors. */
-static tsi_result do_ssl_write(SSL *ssl, unsigned char *unprotected_bytes,
+static tsi_result do_ssl_write(SSL* ssl, unsigned char* unprotected_bytes,
                                size_t unprotected_bytes_size) {
   int ssl_write_result;
   GPR_ASSERT(unprotected_bytes_size <= INT_MAX);
@@ -470,18 +469,18 @@
 }
 
 /* Loads an in-memory PEM certificate chain into the SSL context. */
-static tsi_result ssl_ctx_use_certificate_chain(SSL_CTX *context,
-                                                const char *pem_cert_chain,
+static tsi_result ssl_ctx_use_certificate_chain(SSL_CTX* context,
+                                                const char* pem_cert_chain,
                                                 size_t pem_cert_chain_size) {
   tsi_result result = TSI_OK;
-  X509 *certificate = NULL;
-  BIO *pem;
+  X509* certificate = NULL;
+  BIO* pem;
   GPR_ASSERT(pem_cert_chain_size <= INT_MAX);
-  pem = BIO_new_mem_buf((void *)pem_cert_chain, (int)pem_cert_chain_size);
+  pem = BIO_new_mem_buf((void*)pem_cert_chain, (int)pem_cert_chain_size);
   if (pem == NULL) return TSI_OUT_OF_RESOURCES;
 
   do {
-    certificate = PEM_read_bio_X509_AUX(pem, NULL, NULL, (void *)"");
+    certificate = PEM_read_bio_X509_AUX(pem, NULL, NULL, (void*)"");
     if (certificate == NULL) {
       result = TSI_INVALID_ARGUMENT;
       break;
@@ -491,8 +490,8 @@
       break;
     }
     while (1) {
-      X509 *certificate_authority =
-          PEM_read_bio_X509(pem, NULL, NULL, (void *)"");
+      X509* certificate_authority =
+          PEM_read_bio_X509(pem, NULL, NULL, (void*)"");
       if (certificate_authority == NULL) {
         ERR_clear_error();
         break; /* Done reading. */
@@ -514,16 +513,16 @@
 }
 
 /* Loads an in-memory PEM private key into the SSL context. */
-static tsi_result ssl_ctx_use_private_key(SSL_CTX *context, const char *pem_key,
+static tsi_result ssl_ctx_use_private_key(SSL_CTX* context, const char* pem_key,
                                           size_t pem_key_size) {
   tsi_result result = TSI_OK;
-  EVP_PKEY *private_key = NULL;
-  BIO *pem;
+  EVP_PKEY* private_key = NULL;
+  BIO* pem;
   GPR_ASSERT(pem_key_size <= INT_MAX);
-  pem = BIO_new_mem_buf((void *)pem_key, (int)pem_key_size);
+  pem = BIO_new_mem_buf((void*)pem_key, (int)pem_key_size);
   if (pem == NULL) return TSI_OUT_OF_RESOURCES;
   do {
-    private_key = PEM_read_bio_PrivateKey(pem, NULL, NULL, (void *)"");
+    private_key = PEM_read_bio_PrivateKey(pem, NULL, NULL, (void*)"");
     if (private_key == NULL) {
       result = TSI_INVALID_ARGUMENT;
       break;
@@ -540,19 +539,19 @@
 
 /* Loads in-memory PEM verification certs into the SSL context and optionally
    returns the verification cert names (root_names can be NULL). */
-static tsi_result ssl_ctx_load_verification_certs(SSL_CTX *context,
-                                                  const char *pem_roots,
+static tsi_result ssl_ctx_load_verification_certs(SSL_CTX* context,
+                                                  const char* pem_roots,
                                                   size_t pem_roots_size,
                                                   STACK_OF(X509_NAME) *
                                                       *root_names) {
   tsi_result result = TSI_OK;
   size_t num_roots = 0;
-  X509 *root = NULL;
-  X509_NAME *root_name = NULL;
-  BIO *pem;
-  X509_STORE *root_store;
+  X509* root = NULL;
+  X509_NAME* root_name = NULL;
+  BIO* pem;
+  X509_STORE* root_store;
   GPR_ASSERT(pem_roots_size <= INT_MAX);
-  pem = BIO_new_mem_buf((void *)pem_roots, (int)pem_roots_size);
+  pem = BIO_new_mem_buf((void*)pem_roots, (int)pem_roots_size);
   root_store = SSL_CTX_get_cert_store(context);
   if (root_store == NULL) return TSI_INVALID_ARGUMENT;
   if (pem == NULL) return TSI_OUT_OF_RESOURCES;
@@ -562,7 +561,7 @@
   }
 
   while (1) {
-    root = PEM_read_bio_X509_AUX(pem, NULL, NULL, (void *)"");
+    root = PEM_read_bio_X509_AUX(pem, NULL, NULL, (void*)"");
     if (root == NULL) {
       ERR_clear_error();
       break; /* We're at the end of stream. */
@@ -611,8 +610,8 @@
 /* Populates the SSL context with a private key and a cert chain, and sets the
    cipher list and the ephemeral ECDH key. */
 static tsi_result populate_ssl_context(
-    SSL_CTX *context, const tsi_ssl_pem_key_cert_pair *key_cert_pair,
-    const char *cipher_list) {
+    SSL_CTX* context, const tsi_ssl_pem_key_cert_pair* key_cert_pair,
+    const char* cipher_list) {
   tsi_result result = TSI_OK;
   if (key_cert_pair != NULL) {
     if (key_cert_pair->cert_chain != NULL) {
@@ -637,7 +636,7 @@
     return TSI_INVALID_ARGUMENT;
   }
   {
-    EC_KEY *ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
+    EC_KEY* ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
     if (!SSL_CTX_set_tmp_ecdh(context, ecdh)) {
       gpr_log(GPR_ERROR, "Could not set ephemeral ECDH key.");
       EC_KEY_free(ecdh);
@@ -650,15 +649,15 @@
 }
 
 /* Extracts the CN and the SANs from an X509 cert as a peer object. */
-static tsi_result extract_x509_subject_names_from_pem_cert(const char *pem_cert,
-                                                           tsi_peer *peer) {
+static tsi_result extract_x509_subject_names_from_pem_cert(const char* pem_cert,
+                                                           tsi_peer* peer) {
   tsi_result result = TSI_OK;
-  X509 *cert = NULL;
-  BIO *pem;
-  pem = BIO_new_mem_buf((void *)pem_cert, (int)strlen(pem_cert));
+  X509* cert = NULL;
+  BIO* pem;
+  pem = BIO_new_mem_buf((void*)pem_cert, (int)strlen(pem_cert));
   if (pem == NULL) return TSI_OUT_OF_RESOURCES;
 
-  cert = PEM_read_bio_X509(pem, NULL, NULL, (void *)"");
+  cert = PEM_read_bio_X509(pem, NULL, NULL, (void*)"");
   if (cert == NULL) {
     gpr_log(GPR_ERROR, "Invalid certificate");
     result = TSI_INVALID_ARGUMENT;
@@ -672,10 +671,10 @@
 
 /* Builds the alpn protocol name list according to rfc 7301. */
 static tsi_result build_alpn_protocol_name_list(
-    const char **alpn_protocols, uint16_t num_alpn_protocols,
-    unsigned char **protocol_name_list, size_t *protocol_name_list_length) {
+    const char** alpn_protocols, uint16_t num_alpn_protocols,
+    unsigned char** protocol_name_list, size_t* protocol_name_list_length) {
   uint16_t i;
-  unsigned char *current;
+  unsigned char* current;
   *protocol_name_list = NULL;
   *protocol_name_list_length = 0;
   if (num_alpn_protocols == 0) return TSI_INVALID_ARGUMENT;
@@ -687,7 +686,7 @@
     }
     *protocol_name_list_length += length + 1;
   }
-  *protocol_name_list = (unsigned char *)gpr_malloc(*protocol_name_list_length);
+  *protocol_name_list = (unsigned char*)gpr_malloc(*protocol_name_list_length);
   if (*protocol_name_list == NULL) return TSI_OUT_OF_RESOURCES;
   current = *protocol_name_list;
   for (i = 0; i < num_alpn_protocols; i++) {
@@ -709,18 +708,18 @@
 // the server's certificate, but we need to pull it anyway, in case a higher
 // layer wants to look at it. In this case the verification may fail, but
 // we don't really care.
-static int NullVerifyCallback(int preverify_ok, X509_STORE_CTX *ctx) {
+static int NullVerifyCallback(int preverify_ok, X509_STORE_CTX* ctx) {
   return 1;
 }
 
 /* --- tsi_frame_protector methods implementation. ---*/
 
-static tsi_result ssl_protector_protect(tsi_frame_protector *self,
-                                        const unsigned char *unprotected_bytes,
-                                        size_t *unprotected_bytes_size,
-                                        unsigned char *protected_output_frames,
-                                        size_t *protected_output_frames_size) {
-  tsi_ssl_frame_protector *impl = (tsi_ssl_frame_protector *)self;
+static tsi_result ssl_protector_protect(tsi_frame_protector* self,
+                                        const unsigned char* unprotected_bytes,
+                                        size_t* unprotected_bytes_size,
+                                        unsigned char* protected_output_frames,
+                                        size_t* protected_output_frames_size) {
+  tsi_ssl_frame_protector* impl = (tsi_ssl_frame_protector*)self;
   int read_from_ssl;
   size_t available;
   tsi_result result = TSI_OK;
@@ -771,10 +770,10 @@
 }
 
 static tsi_result ssl_protector_protect_flush(
-    tsi_frame_protector *self, unsigned char *protected_output_frames,
-    size_t *protected_output_frames_size, size_t *still_pending_size) {
+    tsi_frame_protector* self, unsigned char* protected_output_frames,
+    size_t* protected_output_frames_size, size_t* still_pending_size) {
   tsi_result result = TSI_OK;
-  tsi_ssl_frame_protector *impl = (tsi_ssl_frame_protector *)self;
+  tsi_ssl_frame_protector* impl = (tsi_ssl_frame_protector*)self;
   int read_from_ssl = 0;
   int pending;
 
@@ -804,14 +803,14 @@
 }
 
 static tsi_result ssl_protector_unprotect(
-    tsi_frame_protector *self, const unsigned char *protected_frames_bytes,
-    size_t *protected_frames_bytes_size, unsigned char *unprotected_bytes,
-    size_t *unprotected_bytes_size) {
+    tsi_frame_protector* self, const unsigned char* protected_frames_bytes,
+    size_t* protected_frames_bytes_size, unsigned char* unprotected_bytes,
+    size_t* unprotected_bytes_size) {
   tsi_result result = TSI_OK;
   int written_into_ssl = 0;
   size_t output_bytes_size = *unprotected_bytes_size;
   size_t output_bytes_offset = 0;
-  tsi_ssl_frame_protector *impl = (tsi_ssl_frame_protector *)self;
+  tsi_ssl_frame_protector* impl = (tsi_ssl_frame_protector*)self;
 
   /* First, try to read remaining data from ssl. */
   result = do_ssl_read(impl->ssl, unprotected_bytes, unprotected_bytes_size);
@@ -845,22 +844,24 @@
   return result;
 }
 
-static void ssl_protector_destroy(tsi_frame_protector *self) {
-  tsi_ssl_frame_protector *impl = (tsi_ssl_frame_protector *)self;
+static void ssl_protector_destroy(tsi_frame_protector* self) {
+  tsi_ssl_frame_protector* impl = (tsi_ssl_frame_protector*)self;
   if (impl->buffer != NULL) gpr_free(impl->buffer);
   if (impl->ssl != NULL) SSL_free(impl->ssl);
   gpr_free(self);
 }
 
 static const tsi_frame_protector_vtable frame_protector_vtable = {
-    ssl_protector_protect, ssl_protector_protect_flush, ssl_protector_unprotect,
+    ssl_protector_protect,
+    ssl_protector_protect_flush,
+    ssl_protector_unprotect,
     ssl_protector_destroy,
 };
 
 /* --- tsi_server_handshaker_factory methods implementation. --- */
 
 static void tsi_ssl_handshaker_factory_destroy(
-    tsi_ssl_handshaker_factory *self) {
+    tsi_ssl_handshaker_factory* self) {
   if (self == NULL) return;
 
   if (self->vtable != NULL && self->vtable->destroy != NULL) {
@@ -871,14 +872,14 @@
    * any memory, it should be free'd here. */
 }
 
-static tsi_ssl_handshaker_factory *tsi_ssl_handshaker_factory_ref(
-    tsi_ssl_handshaker_factory *self) {
+static tsi_ssl_handshaker_factory* tsi_ssl_handshaker_factory_ref(
+    tsi_ssl_handshaker_factory* self) {
   if (self == NULL) return NULL;
   gpr_refn(&self->refcount, 1);
   return self;
 }
 
-static void tsi_ssl_handshaker_factory_unref(tsi_ssl_handshaker_factory *self) {
+static void tsi_ssl_handshaker_factory_unref(tsi_ssl_handshaker_factory* self) {
   if (self == NULL) return;
 
   if (gpr_unref(&self->refcount)) {
@@ -891,7 +892,7 @@
 /* Initializes a tsi_ssl_handshaker_factory object. Caller is responsible for
  * allocating memory for the factory. */
 static void tsi_ssl_handshaker_factory_init(
-    tsi_ssl_handshaker_factory *factory) {
+    tsi_ssl_handshaker_factory* factory) {
   GPR_ASSERT(factory != NULL);
 
   factory->vtable = &handshaker_factory_vtable;
@@ -900,10 +901,10 @@
 
 /* --- tsi_handshaker methods implementation. ---*/
 
-static tsi_result ssl_handshaker_get_bytes_to_send_to_peer(tsi_handshaker *self,
-                                                           unsigned char *bytes,
-                                                           size_t *bytes_size) {
-  tsi_ssl_handshaker *impl = (tsi_ssl_handshaker *)self;
+static tsi_result ssl_handshaker_get_bytes_to_send_to_peer(tsi_handshaker* self,
+                                                           unsigned char* bytes,
+                                                           size_t* bytes_size) {
+  tsi_ssl_handshaker* impl = (tsi_ssl_handshaker*)self;
   int bytes_read_from_ssl = 0;
   if (bytes == NULL || bytes_size == NULL || *bytes_size == 0 ||
       *bytes_size > INT_MAX) {
@@ -924,8 +925,8 @@
   return BIO_pending(impl->from_ssl) == 0 ? TSI_OK : TSI_INCOMPLETE_DATA;
 }
 
-static tsi_result ssl_handshaker_get_result(tsi_handshaker *self) {
-  tsi_ssl_handshaker *impl = (tsi_ssl_handshaker *)self;
+static tsi_result ssl_handshaker_get_result(tsi_handshaker* self) {
+  tsi_ssl_handshaker* impl = (tsi_ssl_handshaker*)self;
   if ((impl->result == TSI_HANDSHAKE_IN_PROGRESS) &&
       SSL_is_init_finished(impl->ssl)) {
     impl->result = TSI_OK;
@@ -934,8 +935,8 @@
 }
 
 static tsi_result ssl_handshaker_process_bytes_from_peer(
-    tsi_handshaker *self, const unsigned char *bytes, size_t *bytes_size) {
-  tsi_ssl_handshaker *impl = (tsi_ssl_handshaker *)self;
+    tsi_handshaker* self, const unsigned char* bytes, size_t* bytes_size) {
+  tsi_ssl_handshaker* impl = (tsi_ssl_handshaker*)self;
   int bytes_written_into_ssl_size = 0;
   if (bytes == NULL || bytes_size == 0 || *bytes_size > INT_MAX) {
     return TSI_INVALID_ARGUMENT;
@@ -979,13 +980,13 @@
   }
 }
 
-static tsi_result ssl_handshaker_extract_peer(tsi_handshaker *self,
-                                              tsi_peer *peer) {
+static tsi_result ssl_handshaker_extract_peer(tsi_handshaker* self,
+                                              tsi_peer* peer) {
   tsi_result result = TSI_OK;
-  const unsigned char *alpn_selected = NULL;
+  const unsigned char* alpn_selected = NULL;
   unsigned int alpn_selected_len;
-  tsi_ssl_handshaker *impl = (tsi_ssl_handshaker *)self;
-  X509 *peer_cert = SSL_get_peer_certificate(impl->ssl);
+  tsi_ssl_handshaker* impl = (tsi_ssl_handshaker*)self;
+  X509* peer_cert = SSL_get_peer_certificate(impl->ssl);
   if (peer_cert != NULL) {
     result = peer_from_x509(peer_cert, 1, peer);
     X509_free(peer_cert);
@@ -1001,13 +1002,13 @@
   }
   if (alpn_selected != NULL) {
     size_t i;
-    tsi_peer_property *new_properties = (tsi_peer_property *)gpr_zalloc(
+    tsi_peer_property* new_properties = (tsi_peer_property*)gpr_zalloc(
         sizeof(*new_properties) * (peer->property_count + 1));
     for (i = 0; i < peer->property_count; i++) {
       new_properties[i] = peer->properties[i];
     }
     result = tsi_construct_string_peer_property(
-        TSI_SSL_ALPN_SELECTED_PROTOCOL, (const char *)alpn_selected,
+        TSI_SSL_ALPN_SELECTED_PROTOCOL, (const char*)alpn_selected,
         alpn_selected_len, &new_properties[peer->property_count]);
     if (result != TSI_OK) {
       gpr_free(new_properties);
@@ -1021,13 +1022,13 @@
 }
 
 static tsi_result ssl_handshaker_create_frame_protector(
-    tsi_handshaker *self, size_t *max_output_protected_frame_size,
-    tsi_frame_protector **protector) {
+    tsi_handshaker* self, size_t* max_output_protected_frame_size,
+    tsi_frame_protector** protector) {
   size_t actual_max_output_protected_frame_size =
       TSI_SSL_MAX_PROTECTED_FRAME_SIZE_UPPER_BOUND;
-  tsi_ssl_handshaker *impl = (tsi_ssl_handshaker *)self;
-  tsi_ssl_frame_protector *protector_impl =
-      (tsi_ssl_frame_protector *)gpr_zalloc(sizeof(*protector_impl));
+  tsi_ssl_handshaker* impl = (tsi_ssl_handshaker*)self;
+  tsi_ssl_frame_protector* protector_impl =
+      (tsi_ssl_frame_protector*)gpr_zalloc(sizeof(*protector_impl));
 
   if (max_output_protected_frame_size != NULL) {
     if (*max_output_protected_frame_size >
@@ -1044,7 +1045,7 @@
   protector_impl->buffer_size =
       actual_max_output_protected_frame_size - TSI_SSL_MAX_PROTECTION_OVERHEAD;
   protector_impl->buffer =
-      (unsigned char *)gpr_malloc(protector_impl->buffer_size);
+      (unsigned char*)gpr_malloc(protector_impl->buffer_size);
   if (protector_impl->buffer == NULL) {
     gpr_log(GPR_ERROR,
             "Could not allocated buffer for tsi_ssl_frame_protector.");
@@ -1064,8 +1065,8 @@
   return TSI_OK;
 }
 
-static void ssl_handshaker_destroy(tsi_handshaker *self) {
-  tsi_ssl_handshaker *impl = (tsi_ssl_handshaker *)self;
+static void ssl_handshaker_destroy(tsi_handshaker* self) {
+  tsi_ssl_handshaker* impl = (tsi_ssl_handshaker*)self;
   SSL_free(impl->ssl); /* The BIO objects are owned by ssl */
   tsi_ssl_handshaker_factory_unref(impl->factory_ref);
   gpr_free(impl);
@@ -1083,14 +1084,14 @@
 
 /* --- tsi_ssl_handshaker_factory common methods. --- */
 
-static tsi_result create_tsi_ssl_handshaker(SSL_CTX *ctx, int is_client,
-                                            const char *server_name_indication,
-                                            tsi_ssl_handshaker_factory *factory,
-                                            tsi_handshaker **handshaker) {
-  SSL *ssl = SSL_new(ctx);
-  BIO *into_ssl = NULL;
-  BIO *from_ssl = NULL;
-  tsi_ssl_handshaker *impl = NULL;
+static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client,
+                                            const char* server_name_indication,
+                                            tsi_ssl_handshaker_factory* factory,
+                                            tsi_handshaker** handshaker) {
+  SSL* ssl = SSL_new(ctx);
+  BIO* into_ssl = NULL;
+  BIO* from_ssl = NULL;
+  tsi_ssl_handshaker* impl = NULL;
   *handshaker = NULL;
   if (ctx == NULL) {
     gpr_log(GPR_ERROR, "SSL Context is null. Should never happen.");
@@ -1135,7 +1136,7 @@
     SSL_set_accept_state(ssl);
   }
 
-  impl = (tsi_ssl_handshaker *)gpr_zalloc(sizeof(*impl));
+  impl = (tsi_ssl_handshaker*)gpr_zalloc(sizeof(*impl));
   impl->ssl = ssl;
   impl->into_ssl = into_ssl;
   impl->from_ssl = from_ssl;
@@ -1147,16 +1148,16 @@
   return TSI_OK;
 }
 
-static int select_protocol_list(const unsigned char **out,
-                                unsigned char *outlen,
-                                const unsigned char *client_list,
+static int select_protocol_list(const unsigned char** out,
+                                unsigned char* outlen,
+                                const unsigned char* client_list,
                                 size_t client_list_len,
-                                const unsigned char *server_list,
+                                const unsigned char* server_list,
                                 size_t server_list_len) {
-  const unsigned char *client_current = client_list;
+  const unsigned char* client_current = client_list;
   while ((unsigned int)(client_current - client_list) < client_list_len) {
     unsigned char client_current_len = *(client_current++);
-    const unsigned char *server_current = server_list;
+    const unsigned char* server_current = server_list;
     while ((server_current >= server_list) &&
            (uintptr_t)(server_current - server_list) < server_list_len) {
       unsigned char server_current_len = *(server_current++);
@@ -1176,36 +1177,36 @@
 /* --- tsi_ssl_client_handshaker_factory methods implementation. --- */
 
 tsi_result tsi_ssl_client_handshaker_factory_create_handshaker(
-    tsi_ssl_client_handshaker_factory *self, const char *server_name_indication,
-    tsi_handshaker **handshaker) {
+    tsi_ssl_client_handshaker_factory* self, const char* server_name_indication,
+    tsi_handshaker** handshaker) {
   return create_tsi_ssl_handshaker(self->ssl_context, 1, server_name_indication,
                                    &self->base, handshaker);
 }
 
 void tsi_ssl_client_handshaker_factory_unref(
-    tsi_ssl_client_handshaker_factory *self) {
+    tsi_ssl_client_handshaker_factory* self) {
   if (self == NULL) return;
   tsi_ssl_handshaker_factory_unref(&self->base);
 }
 
 static void tsi_ssl_client_handshaker_factory_destroy(
-    tsi_ssl_handshaker_factory *factory) {
+    tsi_ssl_handshaker_factory* factory) {
   if (factory == NULL) return;
-  tsi_ssl_client_handshaker_factory *self =
-      (tsi_ssl_client_handshaker_factory *)factory;
+  tsi_ssl_client_handshaker_factory* self =
+      (tsi_ssl_client_handshaker_factory*)factory;
   if (self->ssl_context != NULL) SSL_CTX_free(self->ssl_context);
   if (self->alpn_protocol_list != NULL) gpr_free(self->alpn_protocol_list);
   gpr_free(self);
 }
 
-static int client_handshaker_factory_npn_callback(SSL *ssl, unsigned char **out,
-                                                  unsigned char *outlen,
-                                                  const unsigned char *in,
+static int client_handshaker_factory_npn_callback(SSL* ssl, unsigned char** out,
+                                                  unsigned char* outlen,
+                                                  const unsigned char* in,
                                                   unsigned int inlen,
-                                                  void *arg) {
-  tsi_ssl_client_handshaker_factory *factory =
-      (tsi_ssl_client_handshaker_factory *)arg;
-  return select_protocol_list((const unsigned char **)out, outlen,
+                                                  void* arg) {
+  tsi_ssl_client_handshaker_factory* factory =
+      (tsi_ssl_client_handshaker_factory*)arg;
+  return select_protocol_list((const unsigned char**)out, outlen,
                               factory->alpn_protocol_list,
                               factory->alpn_protocol_list_length, in, inlen);
 }
@@ -1213,7 +1214,7 @@
 /* --- tsi_ssl_server_handshaker_factory methods implementation. --- */
 
 tsi_result tsi_ssl_server_handshaker_factory_create_handshaker(
-    tsi_ssl_server_handshaker_factory *self, tsi_handshaker **handshaker) {
+    tsi_ssl_server_handshaker_factory* self, tsi_handshaker** handshaker) {
   if (self->ssl_context_count == 0) return TSI_INVALID_ARGUMENT;
   /* Create the handshaker with the first context. We will switch if needed
      because of SNI in ssl_server_handshaker_factory_servername_callback.  */
@@ -1222,16 +1223,16 @@
 }
 
 void tsi_ssl_server_handshaker_factory_unref(
-    tsi_ssl_server_handshaker_factory *self) {
+    tsi_ssl_server_handshaker_factory* self) {
   if (self == NULL) return;
   tsi_ssl_handshaker_factory_unref(&self->base);
 }
 
 static void tsi_ssl_server_handshaker_factory_destroy(
-    tsi_ssl_handshaker_factory *factory) {
+    tsi_ssl_handshaker_factory* factory) {
   if (factory == NULL) return;
-  tsi_ssl_server_handshaker_factory *self =
-      (tsi_ssl_server_handshaker_factory *)factory;
+  tsi_ssl_server_handshaker_factory* self =
+      (tsi_ssl_server_handshaker_factory*)factory;
   size_t i;
   for (i = 0; i < self->ssl_context_count; i++) {
     if (self->ssl_contexts[i] != NULL) {
@@ -1247,10 +1248,10 @@
   gpr_free(self);
 }
 
-static int does_entry_match_name(const char *entry, size_t entry_length,
-                                 const char *name) {
-  const char *dot;
-  const char *name_subdomain = NULL;
+static int does_entry_match_name(const char* entry, size_t entry_length,
+                                 const char* name) {
+  const char* dot;
+  const char* name_subdomain = NULL;
   size_t name_length = strlen(name);
   size_t name_subdomain_length;
   if (entry_length == 0) return 0;
@@ -1295,12 +1296,12 @@
           strncmp(entry, name_subdomain, entry_length) == 0);
 }
 
-static int ssl_server_handshaker_factory_servername_callback(SSL *ssl, int *ap,
-                                                             void *arg) {
-  tsi_ssl_server_handshaker_factory *impl =
-      (tsi_ssl_server_handshaker_factory *)arg;
+static int ssl_server_handshaker_factory_servername_callback(SSL* ssl, int* ap,
+                                                             void* arg) {
+  tsi_ssl_server_handshaker_factory* impl =
+      (tsi_ssl_server_handshaker_factory*)arg;
   size_t i = 0;
-  const char *servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
+  const char* servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
   if (servername == NULL || strlen(servername) == 0) {
     return SSL_TLSEXT_ERR_NOACK;
   }
@@ -1318,10 +1319,10 @@
 
 #if TSI_OPENSSL_ALPN_SUPPORT
 static int server_handshaker_factory_alpn_callback(
-    SSL *ssl, const unsigned char **out, unsigned char *outlen,
-    const unsigned char *in, unsigned int inlen, void *arg) {
-  tsi_ssl_server_handshaker_factory *factory =
-      (tsi_ssl_server_handshaker_factory *)arg;
+    SSL* ssl, const unsigned char** out, unsigned char* outlen,
+    const unsigned char* in, unsigned int inlen, void* arg) {
+  tsi_ssl_server_handshaker_factory* factory =
+      (tsi_ssl_server_handshaker_factory*)arg;
   return select_protocol_list(out, outlen, in, inlen,
                               factory->alpn_protocol_list,
                               factory->alpn_protocol_list_length);
@@ -1329,9 +1330,9 @@
 #endif /* TSI_OPENSSL_ALPN_SUPPORT */
 
 static int server_handshaker_factory_npn_advertised_callback(
-    SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg) {
-  tsi_ssl_server_handshaker_factory *factory =
-      (tsi_ssl_server_handshaker_factory *)arg;
+    SSL* ssl, const unsigned char** out, unsigned int* outlen, void* arg) {
+  tsi_ssl_server_handshaker_factory* factory =
+      (tsi_ssl_server_handshaker_factory*)arg;
   *out = factory->alpn_protocol_list;
   GPR_ASSERT(factory->alpn_protocol_list_length <= UINT_MAX);
   *outlen = (unsigned int)factory->alpn_protocol_list_length;
@@ -1344,12 +1345,12 @@
     tsi_ssl_client_handshaker_factory_destroy};
 
 tsi_result tsi_create_ssl_client_handshaker_factory(
-    const tsi_ssl_pem_key_cert_pair *pem_key_cert_pair,
-    const char *pem_root_certs, const char *cipher_suites,
-    const char **alpn_protocols, uint16_t num_alpn_protocols,
-    tsi_ssl_client_handshaker_factory **factory) {
-  SSL_CTX *ssl_context = NULL;
-  tsi_ssl_client_handshaker_factory *impl = NULL;
+    const tsi_ssl_pem_key_cert_pair* pem_key_cert_pair,
+    const char* pem_root_certs, const char* cipher_suites,
+    const char** alpn_protocols, uint16_t num_alpn_protocols,
+    tsi_ssl_client_handshaker_factory** factory) {
+  SSL_CTX* ssl_context = NULL;
+  tsi_ssl_client_handshaker_factory* impl = NULL;
   tsi_result result = TSI_OK;
 
   gpr_once_init(&init_openssl_once, init_openssl);
@@ -1364,7 +1365,7 @@
     return TSI_INVALID_ARGUMENT;
   }
 
-  impl = (tsi_ssl_client_handshaker_factory *)gpr_zalloc(sizeof(*impl));
+  impl = (tsi_ssl_client_handshaker_factory*)gpr_zalloc(sizeof(*impl));
   tsi_ssl_handshaker_factory_init(&impl->base);
   impl->base.vtable = &client_handshaker_factory_vtable;
 
@@ -1419,11 +1420,11 @@
     tsi_ssl_server_handshaker_factory_destroy};
 
 tsi_result tsi_create_ssl_server_handshaker_factory(
-    const tsi_ssl_pem_key_cert_pair *pem_key_cert_pairs,
-    size_t num_key_cert_pairs, const char *pem_client_root_certs,
-    int force_client_auth, const char *cipher_suites,
-    const char **alpn_protocols, uint16_t num_alpn_protocols,
-    tsi_ssl_server_handshaker_factory **factory) {
+    const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs, const char* pem_client_root_certs,
+    int force_client_auth, const char* cipher_suites,
+    const char** alpn_protocols, uint16_t num_alpn_protocols,
+    tsi_ssl_server_handshaker_factory** factory) {
   return tsi_create_ssl_server_handshaker_factory_ex(
       pem_key_cert_pairs, num_key_cert_pairs, pem_client_root_certs,
       force_client_auth ? TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
@@ -1432,12 +1433,12 @@
 }
 
 tsi_result tsi_create_ssl_server_handshaker_factory_ex(
-    const tsi_ssl_pem_key_cert_pair *pem_key_cert_pairs,
-    size_t num_key_cert_pairs, const char *pem_client_root_certs,
+    const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs, const char* pem_client_root_certs,
     tsi_client_certificate_request_type client_certificate_request,
-    const char *cipher_suites, const char **alpn_protocols,
-    uint16_t num_alpn_protocols, tsi_ssl_server_handshaker_factory **factory) {
-  tsi_ssl_server_handshaker_factory *impl = NULL;
+    const char* cipher_suites, const char** alpn_protocols,
+    uint16_t num_alpn_protocols, tsi_ssl_server_handshaker_factory** factory) {
+  tsi_ssl_server_handshaker_factory* impl = NULL;
   tsi_result result = TSI_OK;
   size_t i = 0;
 
@@ -1449,14 +1450,14 @@
     return TSI_INVALID_ARGUMENT;
   }
 
-  impl = (tsi_ssl_server_handshaker_factory *)gpr_zalloc(sizeof(*impl));
+  impl = (tsi_ssl_server_handshaker_factory*)gpr_zalloc(sizeof(*impl));
   tsi_ssl_handshaker_factory_init(&impl->base);
   impl->base.vtable = &server_handshaker_factory_vtable;
 
   impl->ssl_contexts =
-      (SSL_CTX **)gpr_zalloc(num_key_cert_pairs * sizeof(SSL_CTX *));
+      (SSL_CTX**)gpr_zalloc(num_key_cert_pairs * sizeof(SSL_CTX*));
   impl->ssl_context_x509_subject_names =
-      (tsi_peer *)gpr_zalloc(num_key_cert_pairs * sizeof(tsi_peer));
+      (tsi_peer*)gpr_zalloc(num_key_cert_pairs * sizeof(tsi_peer));
   if (impl->ssl_contexts == NULL ||
       impl->ssl_context_x509_subject_names == NULL) {
     tsi_ssl_handshaker_factory_unref(&impl->base);
@@ -1487,7 +1488,7 @@
       if (result != TSI_OK) break;
 
       if (pem_client_root_certs != NULL) {
-        STACK_OF(X509_NAME) *root_names = NULL;
+        STACK_OF(X509_NAME)* root_names = NULL;
         result = ssl_ctx_load_verification_certs(
             impl->ssl_contexts[i], pem_client_root_certs,
             strlen(pem_client_root_certs), &root_names);
@@ -1552,15 +1553,15 @@
 
 /* --- tsi_ssl utils. --- */
 
-int tsi_ssl_peer_matches_name(const tsi_peer *peer, const char *name) {
+int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name) {
   size_t i = 0;
   size_t san_count = 0;
-  const tsi_peer_property *cn_property = NULL;
+  const tsi_peer_property* cn_property = NULL;
   int like_ip = looks_like_ip_address(name);
 
   /* Check the SAN first. */
   for (i = 0; i < peer->property_count; i++) {
-    const tsi_peer_property *property = &peer->properties[i];
+    const tsi_peer_property* property = &peer->properties[i];
     if (property->name == NULL) continue;
     if (strcmp(property->name,
                TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) == 0) {
@@ -1594,13 +1595,13 @@
 }
 
 /* --- Testing support. --- */
-const tsi_ssl_handshaker_factory_vtable *tsi_ssl_handshaker_factory_swap_vtable(
-    tsi_ssl_handshaker_factory *factory,
-    tsi_ssl_handshaker_factory_vtable *new_vtable) {
+const tsi_ssl_handshaker_factory_vtable* tsi_ssl_handshaker_factory_swap_vtable(
+    tsi_ssl_handshaker_factory* factory,
+    tsi_ssl_handshaker_factory_vtable* new_vtable) {
   GPR_ASSERT(factory != NULL);
   GPR_ASSERT(factory->vtable != NULL);
 
-  const tsi_ssl_handshaker_factory_vtable *orig_vtable = factory->vtable;
+  const tsi_ssl_handshaker_factory_vtable* orig_vtable = factory->vtable;
   factory->vtable = new_vtable;
   return orig_vtable;
 }
diff --git a/src/core/tsi/ssl_transport_security.h b/src/core/tsi/ssl_transport_security.h
index 3abfdf5..595c4cc 100644
--- a/src/core/tsi/ssl_transport_security.h
+++ b/src/core/tsi/ssl_transport_security.h
@@ -49,11 +49,11 @@
 typedef struct {
   /* private_key is the NULL-terminated string containing the PEM encoding of
      the client's private key. */
-  const char *private_key;
+  const char* private_key;
 
   /* cert_chain is the NULL-terminated string containing the PEM encoding of
      the client's certificate chain. */
-  const char *cert_chain;
+  const char* cert_chain;
 } tsi_ssl_pem_key_cert_pair;
 
 /* Creates a client handshaker factory.
@@ -78,10 +78,10 @@
    - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case
      where a parameter is invalid.  */
 tsi_result tsi_create_ssl_client_handshaker_factory(
-    const tsi_ssl_pem_key_cert_pair *pem_key_cert_pair,
-    const char *pem_root_certs, const char *cipher_suites,
-    const char **alpn_protocols, uint16_t num_alpn_protocols,
-    tsi_ssl_client_handshaker_factory **factory);
+    const tsi_ssl_pem_key_cert_pair* pem_key_cert_pair,
+    const char* pem_root_certs, const char* cipher_suites,
+    const char** alpn_protocols, uint16_t num_alpn_protocols,
+    tsi_ssl_client_handshaker_factory** factory);
 
 /* Creates a client handshaker.
   - self is the factory from which the handshaker will be created.
@@ -93,13 +93,13 @@
   - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case
     where a parameter is invalid.  */
 tsi_result tsi_ssl_client_handshaker_factory_create_handshaker(
-    tsi_ssl_client_handshaker_factory *self, const char *server_name_indication,
-    tsi_handshaker **handshaker);
+    tsi_ssl_client_handshaker_factory* self, const char* server_name_indication,
+    tsi_handshaker** handshaker);
 
 /* Decrements reference count of the handshaker factory. Handshaker factory will
  * be destroyed once no references exist. */
 void tsi_ssl_client_handshaker_factory_unref(
-    tsi_ssl_client_handshaker_factory *factory);
+    tsi_ssl_client_handshaker_factory* factory);
 
 /* --- tsi_ssl_server_handshaker_factory object ---
 
@@ -130,11 +130,11 @@
    - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case
      where a parameter is invalid.  */
 tsi_result tsi_create_ssl_server_handshaker_factory(
-    const tsi_ssl_pem_key_cert_pair *pem_key_cert_pairs,
-    size_t num_key_cert_pairs, const char *pem_client_root_certs,
-    int force_client_auth, const char *cipher_suites,
-    const char **alpn_protocols, uint16_t num_alpn_protocols,
-    tsi_ssl_server_handshaker_factory **factory);
+    const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs, const char* pem_client_root_certs,
+    int force_client_auth, const char* cipher_suites,
+    const char** alpn_protocols, uint16_t num_alpn_protocols,
+    tsi_ssl_server_handshaker_factory** factory);
 
 /* Same as tsi_create_ssl_server_handshaker_factory method except uses
    tsi_client_certificate_request_type to support more ways to handle client
@@ -143,11 +143,11 @@
      authenticate with an SSL cert. Note that this option is ignored if
      pem_client_root_certs is NULL or pem_client_roots_certs_size is 0 */
 tsi_result tsi_create_ssl_server_handshaker_factory_ex(
-    const tsi_ssl_pem_key_cert_pair *pem_key_cert_pairs,
-    size_t num_key_cert_pairs, const char *pem_client_root_certs,
+    const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs,
+    size_t num_key_cert_pairs, const char* pem_client_root_certs,
     tsi_client_certificate_request_type client_certificate_request,
-    const char *cipher_suites, const char **alpn_protocols,
-    uint16_t num_alpn_protocols, tsi_ssl_server_handshaker_factory **factory);
+    const char* cipher_suites, const char** alpn_protocols,
+    uint16_t num_alpn_protocols, tsi_ssl_server_handshaker_factory** factory);
 
 /* Creates a server handshaker.
   - self is the factory from which the handshaker will be created.
@@ -156,19 +156,19 @@
   - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case
     where a parameter is invalid.  */
 tsi_result tsi_ssl_server_handshaker_factory_create_handshaker(
-    tsi_ssl_server_handshaker_factory *self, tsi_handshaker **handshaker);
+    tsi_ssl_server_handshaker_factory* self, tsi_handshaker** handshaker);
 
 /* Decrements reference count of the handshaker factory. Handshaker factory will
  * be destroyed once no references exist. */
 void tsi_ssl_server_handshaker_factory_unref(
-    tsi_ssl_server_handshaker_factory *self);
+    tsi_ssl_server_handshaker_factory* self);
 
 /* Util that checks that an ssl peer matches a specific name.
    Still TODO(jboeuf):
    - handle mixed case.
    - handle %encoded chars.
    - handle public suffix wildchar more strictly (e.g. *.co.uk) */
-int tsi_ssl_peer_matches_name(const tsi_peer *peer, const char *name);
+int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name);
 
 /* --- Testing support. ---
 
@@ -180,7 +180,7 @@
 
 /* Function pointer to handshaker_factory destructor. */
 typedef void (*tsi_ssl_handshaker_factory_destructor)(
-    tsi_ssl_handshaker_factory *factory);
+    tsi_ssl_handshaker_factory* factory);
 
 /* Virtual table for tsi_ssl_handshaker_factory. */
 typedef struct {
@@ -189,9 +189,9 @@
 
 /* Set destructor of handshaker_factory to new_destructor, returns previous
    destructor. */
-const tsi_ssl_handshaker_factory_vtable *tsi_ssl_handshaker_factory_swap_vtable(
-    tsi_ssl_handshaker_factory *factory,
-    tsi_ssl_handshaker_factory_vtable *new_vtable);
+const tsi_ssl_handshaker_factory_vtable* tsi_ssl_handshaker_factory_swap_vtable(
+    tsi_ssl_handshaker_factory* factory,
+    tsi_ssl_handshaker_factory_vtable* new_vtable);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/tsi/transport_security.cc b/src/core/tsi/transport_security.cc
index a2f45f5..8399f32 100644
--- a/src/core/tsi/transport_security.cc
+++ b/src/core/tsi/transport_security.cc
@@ -30,7 +30,7 @@
 
 /* --- tsi_result common implementation. --- */
 
-const char *tsi_result_to_string(tsi_result result) {
+const char* tsi_result_to_string(tsi_result result) {
   switch (result) {
     case TSI_OK:
       return "TSI_OK";
@@ -69,11 +69,11 @@
 
    Calls specific implementation after state/input validation. */
 
-tsi_result tsi_frame_protector_protect(tsi_frame_protector *self,
-                                       const unsigned char *unprotected_bytes,
-                                       size_t *unprotected_bytes_size,
-                                       unsigned char *protected_output_frames,
-                                       size_t *protected_output_frames_size) {
+tsi_result tsi_frame_protector_protect(tsi_frame_protector* self,
+                                       const unsigned char* unprotected_bytes,
+                                       size_t* unprotected_bytes_size,
+                                       unsigned char* protected_output_frames,
+                                       size_t* protected_output_frames_size) {
   if (self == NULL || self->vtable == NULL || unprotected_bytes == NULL ||
       unprotected_bytes_size == NULL || protected_output_frames == NULL ||
       protected_output_frames_size == NULL) {
@@ -86,8 +86,8 @@
 }
 
 tsi_result tsi_frame_protector_protect_flush(
-    tsi_frame_protector *self, unsigned char *protected_output_frames,
-    size_t *protected_output_frames_size, size_t *still_pending_size) {
+    tsi_frame_protector* self, unsigned char* protected_output_frames,
+    size_t* protected_output_frames_size, size_t* still_pending_size) {
   if (self == NULL || self->vtable == NULL || protected_output_frames == NULL ||
       protected_output_frames_size == NULL || still_pending_size == NULL) {
     return TSI_INVALID_ARGUMENT;
@@ -99,9 +99,9 @@
 }
 
 tsi_result tsi_frame_protector_unprotect(
-    tsi_frame_protector *self, const unsigned char *protected_frames_bytes,
-    size_t *protected_frames_bytes_size, unsigned char *unprotected_bytes,
-    size_t *unprotected_bytes_size) {
+    tsi_frame_protector* self, const unsigned char* protected_frames_bytes,
+    size_t* protected_frames_bytes_size, unsigned char* unprotected_bytes,
+    size_t* unprotected_bytes_size) {
   if (self == NULL || self->vtable == NULL || protected_frames_bytes == NULL ||
       protected_frames_bytes_size == NULL || unprotected_bytes == NULL ||
       unprotected_bytes_size == NULL) {
@@ -113,7 +113,7 @@
                                  unprotected_bytes_size);
 }
 
-void tsi_frame_protector_destroy(tsi_frame_protector *self) {
+void tsi_frame_protector_destroy(tsi_frame_protector* self) {
   if (self == NULL) return;
   self->vtable->destroy(self);
 }
@@ -122,9 +122,9 @@
 
    Calls specific implementation after state/input validation. */
 
-tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker *self,
-                                                    unsigned char *bytes,
-                                                    size_t *bytes_size) {
+tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker* self,
+                                                    unsigned char* bytes,
+                                                    size_t* bytes_size) {
   if (self == NULL || self->vtable == NULL || bytes == NULL ||
       bytes_size == NULL) {
     return TSI_INVALID_ARGUMENT;
@@ -134,9 +134,9 @@
   return self->vtable->get_bytes_to_send_to_peer(self, bytes, bytes_size);
 }
 
-tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker *self,
-                                                  const unsigned char *bytes,
-                                                  size_t *bytes_size) {
+tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker* self,
+                                                  const unsigned char* bytes,
+                                                  size_t* bytes_size) {
   if (self == NULL || self->vtable == NULL || bytes == NULL ||
       bytes_size == NULL) {
     return TSI_INVALID_ARGUMENT;
@@ -146,14 +146,14 @@
   return self->vtable->process_bytes_from_peer(self, bytes, bytes_size);
 }
 
-tsi_result tsi_handshaker_get_result(tsi_handshaker *self) {
+tsi_result tsi_handshaker_get_result(tsi_handshaker* self) {
   if (self == NULL || self->vtable == NULL) return TSI_INVALID_ARGUMENT;
   if (self->frame_protector_created) return TSI_FAILED_PRECONDITION;
   if (self->vtable->get_result == NULL) return TSI_UNIMPLEMENTED;
   return self->vtable->get_result(self);
 }
 
-tsi_result tsi_handshaker_extract_peer(tsi_handshaker *self, tsi_peer *peer) {
+tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer) {
   if (self == NULL || self->vtable == NULL || peer == NULL) {
     return TSI_INVALID_ARGUMENT;
   }
@@ -167,8 +167,8 @@
 }
 
 tsi_result tsi_handshaker_create_frame_protector(
-    tsi_handshaker *self, size_t *max_protected_frame_size,
-    tsi_frame_protector **protector) {
+    tsi_handshaker* self, size_t* max_protected_frame_size,
+    tsi_frame_protector** protector) {
   tsi_result result;
   if (self == NULL || self->vtable == NULL || protector == NULL) {
     return TSI_INVALID_ARGUMENT;
@@ -185,10 +185,10 @@
 }
 
 tsi_result tsi_handshaker_next(
-    tsi_handshaker *self, const unsigned char *received_bytes,
-    size_t received_bytes_size, const unsigned char **bytes_to_send,
-    size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result,
-    tsi_handshaker_on_next_done_cb cb, void *user_data) {
+    tsi_handshaker* self, const unsigned char* received_bytes,
+    size_t received_bytes_size, const unsigned char** bytes_to_send,
+    size_t* bytes_to_send_size, tsi_handshaker_result** handshaker_result,
+    tsi_handshaker_on_next_done_cb cb, void* user_data) {
   if (self == NULL || self->vtable == NULL) return TSI_INVALID_ARGUMENT;
   if (self->handshaker_result_created) return TSI_FAILED_PRECONDITION;
   if (self->vtable->next == NULL) return TSI_UNIMPLEMENTED;
@@ -197,15 +197,15 @@
                             handshaker_result, cb, user_data);
 }
 
-void tsi_handshaker_destroy(tsi_handshaker *self) {
+void tsi_handshaker_destroy(tsi_handshaker* self) {
   if (self == NULL) return;
   self->vtable->destroy(self);
 }
 
 /* --- tsi_handshaker_result implementation. --- */
 
-tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result *self,
-                                              tsi_peer *peer) {
+tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result* self,
+                                              tsi_peer* peer) {
   if (self == NULL || self->vtable == NULL || peer == NULL) {
     return TSI_INVALID_ARGUMENT;
   }
@@ -215,8 +215,8 @@
 }
 
 tsi_result tsi_handshaker_result_create_frame_protector(
-    const tsi_handshaker_result *self, size_t *max_protected_frame_size,
-    tsi_frame_protector **protector) {
+    const tsi_handshaker_result* self, size_t* max_protected_frame_size,
+    tsi_frame_protector** protector) {
   if (self == NULL || self->vtable == NULL || protector == NULL) {
     return TSI_INVALID_ARGUMENT;
   }
@@ -226,8 +226,8 @@
 }
 
 tsi_result tsi_handshaker_result_get_unused_bytes(
-    const tsi_handshaker_result *self, const unsigned char **bytes,
-    size_t *bytes_size) {
+    const tsi_handshaker_result* self, const unsigned char** bytes,
+    size_t* bytes_size) {
   if (self == NULL || self->vtable == NULL || bytes == NULL ||
       bytes_size == NULL) {
     return TSI_INVALID_ARGUMENT;
@@ -236,7 +236,7 @@
   return self->vtable->get_unused_bytes(self, bytes, bytes_size);
 }
 
-void tsi_handshaker_result_destroy(tsi_handshaker_result *self) {
+void tsi_handshaker_result_destroy(tsi_handshaker_result* self) {
   if (self == NULL) return;
   self->vtable->destroy(self);
 }
@@ -249,7 +249,7 @@
   return property;
 }
 
-static void tsi_peer_destroy_list_property(tsi_peer_property *children,
+static void tsi_peer_destroy_list_property(tsi_peer_property* children,
                                            size_t child_count) {
   size_t i;
   for (i = 0; i < child_count; i++) {
@@ -258,7 +258,7 @@
   gpr_free(children);
 }
 
-void tsi_peer_property_destruct(tsi_peer_property *property) {
+void tsi_peer_property_destruct(tsi_peer_property* property) {
   if (property->name != NULL) {
     gpr_free(property->name);
   }
@@ -268,7 +268,7 @@
   *property = tsi_init_peer_property(); /* Reset everything to 0. */
 }
 
-void tsi_peer_destruct(tsi_peer *self) {
+void tsi_peer_destruct(tsi_peer* self) {
   if (self == NULL) return;
   if (self->properties != NULL) {
     tsi_peer_destroy_list_property(self->properties, self->property_count);
@@ -278,26 +278,26 @@
 }
 
 tsi_result tsi_construct_allocated_string_peer_property(
-    const char *name, size_t value_length, tsi_peer_property *property) {
+    const char* name, size_t value_length, tsi_peer_property* property) {
   *property = tsi_init_peer_property();
   if (name != NULL) property->name = gpr_strdup(name);
   if (value_length > 0) {
-    property->value.data = (char *)gpr_zalloc(value_length);
+    property->value.data = (char*)gpr_zalloc(value_length);
     property->value.length = value_length;
   }
   return TSI_OK;
 }
 
 tsi_result tsi_construct_string_peer_property_from_cstring(
-    const char *name, const char *value, tsi_peer_property *property) {
+    const char* name, const char* value, tsi_peer_property* property) {
   return tsi_construct_string_peer_property(name, value, strlen(value),
                                             property);
 }
 
-tsi_result tsi_construct_string_peer_property(const char *name,
-                                              const char *value,
+tsi_result tsi_construct_string_peer_property(const char* name,
+                                              const char* value,
                                               size_t value_length,
-                                              tsi_peer_property *property) {
+                                              tsi_peer_property* property) {
   tsi_result result = tsi_construct_allocated_string_peer_property(
       name, value_length, property);
   if (result != TSI_OK) return result;
@@ -307,10 +307,10 @@
   return TSI_OK;
 }
 
-tsi_result tsi_construct_peer(size_t property_count, tsi_peer *peer) {
+tsi_result tsi_construct_peer(size_t property_count, tsi_peer* peer) {
   memset(peer, 0, sizeof(tsi_peer));
   if (property_count > 0) {
-    peer->properties = (tsi_peer_property *)gpr_zalloc(
+    peer->properties = (tsi_peer_property*)gpr_zalloc(
         property_count * sizeof(tsi_peer_property));
     peer->property_count = property_count;
   }
diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h
index c5fbba1..7d6dd44 100644
--- a/src/core/tsi/transport_security.h
+++ b/src/core/tsi/transport_security.h
@@ -33,52 +33,52 @@
 /* Base for tsi_frame_protector implementations.
    See transport_security_interface.h for documentation. */
 typedef struct {
-  tsi_result (*protect)(tsi_frame_protector *self,
-                        const unsigned char *unprotected_bytes,
-                        size_t *unprotected_bytes_size,
-                        unsigned char *protected_output_frames,
-                        size_t *protected_output_frames_size);
-  tsi_result (*protect_flush)(tsi_frame_protector *self,
-                              unsigned char *protected_output_frames,
-                              size_t *protected_output_frames_size,
-                              size_t *still_pending_size);
-  tsi_result (*unprotect)(tsi_frame_protector *self,
-                          const unsigned char *protected_frames_bytes,
-                          size_t *protected_frames_bytes_size,
-                          unsigned char *unprotected_bytes,
-                          size_t *unprotected_bytes_size);
-  void (*destroy)(tsi_frame_protector *self);
+  tsi_result (*protect)(tsi_frame_protector* self,
+                        const unsigned char* unprotected_bytes,
+                        size_t* unprotected_bytes_size,
+                        unsigned char* protected_output_frames,
+                        size_t* protected_output_frames_size);
+  tsi_result (*protect_flush)(tsi_frame_protector* self,
+                              unsigned char* protected_output_frames,
+                              size_t* protected_output_frames_size,
+                              size_t* still_pending_size);
+  tsi_result (*unprotect)(tsi_frame_protector* self,
+                          const unsigned char* protected_frames_bytes,
+                          size_t* protected_frames_bytes_size,
+                          unsigned char* unprotected_bytes,
+                          size_t* unprotected_bytes_size);
+  void (*destroy)(tsi_frame_protector* self);
 } tsi_frame_protector_vtable;
 
 struct tsi_frame_protector {
-  const tsi_frame_protector_vtable *vtable;
+  const tsi_frame_protector_vtable* vtable;
 };
 
 /* Base for tsi_handshaker implementations.
    See transport_security_interface.h for documentation. */
 typedef struct {
-  tsi_result (*get_bytes_to_send_to_peer)(tsi_handshaker *self,
-                                          unsigned char *bytes,
-                                          size_t *bytes_size);
-  tsi_result (*process_bytes_from_peer)(tsi_handshaker *self,
-                                        const unsigned char *bytes,
-                                        size_t *bytes_size);
-  tsi_result (*get_result)(tsi_handshaker *self);
-  tsi_result (*extract_peer)(tsi_handshaker *self, tsi_peer *peer);
-  tsi_result (*create_frame_protector)(tsi_handshaker *self,
-                                       size_t *max_protected_frame_size,
-                                       tsi_frame_protector **protector);
-  void (*destroy)(tsi_handshaker *self);
-  tsi_result (*next)(tsi_handshaker *self, const unsigned char *received_bytes,
+  tsi_result (*get_bytes_to_send_to_peer)(tsi_handshaker* self,
+                                          unsigned char* bytes,
+                                          size_t* bytes_size);
+  tsi_result (*process_bytes_from_peer)(tsi_handshaker* self,
+                                        const unsigned char* bytes,
+                                        size_t* bytes_size);
+  tsi_result (*get_result)(tsi_handshaker* self);
+  tsi_result (*extract_peer)(tsi_handshaker* self, tsi_peer* peer);
+  tsi_result (*create_frame_protector)(tsi_handshaker* self,
+                                       size_t* max_protected_frame_size,
+                                       tsi_frame_protector** protector);
+  void (*destroy)(tsi_handshaker* self);
+  tsi_result (*next)(tsi_handshaker* self, const unsigned char* received_bytes,
                      size_t received_bytes_size,
-                     const unsigned char **bytes_to_send,
-                     size_t *bytes_to_send_size,
-                     tsi_handshaker_result **handshaker_result,
-                     tsi_handshaker_on_next_done_cb cb, void *user_data);
+                     const unsigned char** bytes_to_send,
+                     size_t* bytes_to_send_size,
+                     tsi_handshaker_result** handshaker_result,
+                     tsi_handshaker_on_next_done_cb cb, void* user_data);
 } tsi_handshaker_vtable;
 
 struct tsi_handshaker {
-  const tsi_handshaker_vtable *vtable;
+  const tsi_handshaker_vtable* vtable;
   bool frame_protector_created;
   bool handshaker_result_created;
 };
@@ -92,39 +92,39 @@
    needs to compile in other applications, where grpc_exec_ctx is not defined.
 */
 typedef struct {
-  tsi_result (*extract_peer)(const tsi_handshaker_result *self, tsi_peer *peer);
+  tsi_result (*extract_peer)(const tsi_handshaker_result* self, tsi_peer* peer);
   tsi_result (*create_zero_copy_grpc_protector)(
-      void *exec_ctx, const tsi_handshaker_result *self,
-      size_t *max_output_protected_frame_size,
-      tsi_zero_copy_grpc_protector **protector);
-  tsi_result (*create_frame_protector)(const tsi_handshaker_result *self,
-                                       size_t *max_output_protected_frame_size,
-                                       tsi_frame_protector **protector);
-  tsi_result (*get_unused_bytes)(const tsi_handshaker_result *self,
-                                 const unsigned char **bytes,
-                                 size_t *bytes_size);
-  void (*destroy)(tsi_handshaker_result *self);
+      void* exec_ctx, const tsi_handshaker_result* self,
+      size_t* max_output_protected_frame_size,
+      tsi_zero_copy_grpc_protector** protector);
+  tsi_result (*create_frame_protector)(const tsi_handshaker_result* self,
+                                       size_t* max_output_protected_frame_size,
+                                       tsi_frame_protector** protector);
+  tsi_result (*get_unused_bytes)(const tsi_handshaker_result* self,
+                                 const unsigned char** bytes,
+                                 size_t* bytes_size);
+  void (*destroy)(tsi_handshaker_result* self);
 } tsi_handshaker_result_vtable;
 
 struct tsi_handshaker_result {
-  const tsi_handshaker_result_vtable *vtable;
+  const tsi_handshaker_result_vtable* vtable;
 };
 
 /* Peer and property construction/destruction functions. */
-tsi_result tsi_construct_peer(size_t property_count, tsi_peer *peer);
+tsi_result tsi_construct_peer(size_t property_count, tsi_peer* peer);
 tsi_peer_property tsi_init_peer_property(void);
-void tsi_peer_property_destruct(tsi_peer_property *property);
-tsi_result tsi_construct_string_peer_property(const char *name,
-                                              const char *value,
+void tsi_peer_property_destruct(tsi_peer_property* property);
+tsi_result tsi_construct_string_peer_property(const char* name,
+                                              const char* value,
                                               size_t value_length,
-                                              tsi_peer_property *property);
+                                              tsi_peer_property* property);
 tsi_result tsi_construct_allocated_string_peer_property(
-    const char *name, size_t value_length, tsi_peer_property *property);
+    const char* name, size_t value_length, tsi_peer_property* property);
 tsi_result tsi_construct_string_peer_property_from_cstring(
-    const char *name, const char *value, tsi_peer_property *property);
+    const char* name, const char* value, tsi_peer_property* property);
 
 /* Utils. */
-char *tsi_strdup(const char *src); /* Sadly, no strdup in C89. */
+char* tsi_strdup(const char* src); /* Sadly, no strdup in C89. */
 
 #ifdef __cplusplus
 }
diff --git a/src/core/tsi/transport_security_adapter.cc b/src/core/tsi/transport_security_adapter.cc
index e399e42..ec4e7d8 100644
--- a/src/core/tsi/transport_security_adapter.cc
+++ b/src/core/tsi/transport_security_adapter.cc
@@ -30,36 +30,36 @@
 
 typedef struct {
   tsi_handshaker_result base;
-  tsi_handshaker *wrapped;
-  unsigned char *unused_bytes;
+  tsi_handshaker* wrapped;
+  unsigned char* unused_bytes;
   size_t unused_bytes_size;
 } tsi_adapter_handshaker_result;
 
-static tsi_result adapter_result_extract_peer(const tsi_handshaker_result *self,
-                                              tsi_peer *peer) {
-  tsi_adapter_handshaker_result *impl = (tsi_adapter_handshaker_result *)self;
+static tsi_result adapter_result_extract_peer(const tsi_handshaker_result* self,
+                                              tsi_peer* peer) {
+  tsi_adapter_handshaker_result* impl = (tsi_adapter_handshaker_result*)self;
   return tsi_handshaker_extract_peer(impl->wrapped, peer);
 }
 
 static tsi_result adapter_result_create_frame_protector(
-    const tsi_handshaker_result *self, size_t *max_output_protected_frame_size,
-    tsi_frame_protector **protector) {
-  tsi_adapter_handshaker_result *impl = (tsi_adapter_handshaker_result *)self;
+    const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
+    tsi_frame_protector** protector) {
+  tsi_adapter_handshaker_result* impl = (tsi_adapter_handshaker_result*)self;
   return tsi_handshaker_create_frame_protector(
       impl->wrapped, max_output_protected_frame_size, protector);
 }
 
 static tsi_result adapter_result_get_unused_bytes(
-    const tsi_handshaker_result *self, const unsigned char **bytes,
-    size_t *byte_size) {
-  tsi_adapter_handshaker_result *impl = (tsi_adapter_handshaker_result *)self;
+    const tsi_handshaker_result* self, const unsigned char** bytes,
+    size_t* byte_size) {
+  tsi_adapter_handshaker_result* impl = (tsi_adapter_handshaker_result*)self;
   *bytes = impl->unused_bytes;
   *byte_size = impl->unused_bytes_size;
   return TSI_OK;
 }
 
-static void adapter_result_destroy(tsi_handshaker_result *self) {
-  tsi_adapter_handshaker_result *impl = (tsi_adapter_handshaker_result *)self;
+static void adapter_result_destroy(tsi_handshaker_result* self) {
+  tsi_adapter_handshaker_result* impl = (tsi_adapter_handshaker_result*)self;
   tsi_handshaker_destroy(impl->wrapped);
   gpr_free(impl->unused_bytes);
   gpr_free(self);
@@ -75,18 +75,18 @@
 
 /* Ownership of wrapped tsi_handshaker is transferred to the result object.  */
 static tsi_result tsi_adapter_create_handshaker_result(
-    tsi_handshaker *wrapped, const unsigned char *unused_bytes,
-    size_t unused_bytes_size, tsi_handshaker_result **handshaker_result) {
+    tsi_handshaker* wrapped, const unsigned char* unused_bytes,
+    size_t unused_bytes_size, tsi_handshaker_result** handshaker_result) {
   if (wrapped == NULL || (unused_bytes_size > 0 && unused_bytes == NULL)) {
     return TSI_INVALID_ARGUMENT;
   }
-  tsi_adapter_handshaker_result *impl =
-      (tsi_adapter_handshaker_result *)gpr_zalloc(sizeof(*impl));
+  tsi_adapter_handshaker_result* impl =
+      (tsi_adapter_handshaker_result*)gpr_zalloc(sizeof(*impl));
   impl->base.vtable = &result_vtable;
   impl->wrapped = wrapped;
   impl->unused_bytes_size = unused_bytes_size;
   if (unused_bytes_size > 0) {
-    impl->unused_bytes = (unsigned char *)gpr_malloc(unused_bytes_size);
+    impl->unused_bytes = (unsigned char*)gpr_malloc(unused_bytes_size);
     memcpy(impl->unused_bytes, unused_bytes, unused_bytes_size);
   } else {
     impl->unused_bytes = NULL;
@@ -99,54 +99,54 @@
 
 typedef struct {
   tsi_handshaker base;
-  tsi_handshaker *wrapped;
-  unsigned char *adapter_buffer;
+  tsi_handshaker* wrapped;
+  unsigned char* adapter_buffer;
   size_t adapter_buffer_size;
 } tsi_adapter_handshaker;
 
-static tsi_result adapter_get_bytes_to_send_to_peer(tsi_handshaker *self,
-                                                    unsigned char *bytes,
-                                                    size_t *bytes_size) {
+static tsi_result adapter_get_bytes_to_send_to_peer(tsi_handshaker* self,
+                                                    unsigned char* bytes,
+                                                    size_t* bytes_size) {
   return tsi_handshaker_get_bytes_to_send_to_peer(
       tsi_adapter_handshaker_get_wrapped(self), bytes, bytes_size);
 }
 
-static tsi_result adapter_process_bytes_from_peer(tsi_handshaker *self,
-                                                  const unsigned char *bytes,
-                                                  size_t *bytes_size) {
+static tsi_result adapter_process_bytes_from_peer(tsi_handshaker* self,
+                                                  const unsigned char* bytes,
+                                                  size_t* bytes_size) {
   return tsi_handshaker_process_bytes_from_peer(
       tsi_adapter_handshaker_get_wrapped(self), bytes, bytes_size);
 }
 
-static tsi_result adapter_get_result(tsi_handshaker *self) {
+static tsi_result adapter_get_result(tsi_handshaker* self) {
   return tsi_handshaker_get_result(tsi_adapter_handshaker_get_wrapped(self));
 }
 
-static tsi_result adapter_extract_peer(tsi_handshaker *self, tsi_peer *peer) {
+static tsi_result adapter_extract_peer(tsi_handshaker* self, tsi_peer* peer) {
   return tsi_handshaker_extract_peer(tsi_adapter_handshaker_get_wrapped(self),
                                      peer);
 }
 
 static tsi_result adapter_create_frame_protector(
-    tsi_handshaker *self, size_t *max_protected_frame_size,
-    tsi_frame_protector **protector) {
+    tsi_handshaker* self, size_t* max_protected_frame_size,
+    tsi_frame_protector** protector) {
   return tsi_handshaker_create_frame_protector(
       tsi_adapter_handshaker_get_wrapped(self), max_protected_frame_size,
       protector);
 }
 
-static void adapter_destroy(tsi_handshaker *self) {
-  tsi_adapter_handshaker *impl = (tsi_adapter_handshaker *)self;
+static void adapter_destroy(tsi_handshaker* self) {
+  tsi_adapter_handshaker* impl = (tsi_adapter_handshaker*)self;
   tsi_handshaker_destroy(impl->wrapped);
   gpr_free(impl->adapter_buffer);
   gpr_free(self);
 }
 
 static tsi_result adapter_next(
-    tsi_handshaker *self, const unsigned char *received_bytes,
-    size_t received_bytes_size, const unsigned char **bytes_to_send,
-    size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result,
-    tsi_handshaker_on_next_done_cb cb, void *user_data) {
+    tsi_handshaker* self, const unsigned char* received_bytes,
+    size_t received_bytes_size, const unsigned char** bytes_to_send,
+    size_t* bytes_to_send_size, tsi_handshaker_result** handshaker_result,
+    tsi_handshaker_on_next_done_cb cb, void* user_data) {
   /* Input sanity check.  */
   if ((received_bytes_size > 0 && received_bytes == NULL) ||
       bytes_to_send == NULL || bytes_to_send_size == NULL ||
@@ -155,7 +155,7 @@
   }
 
   /* If there are received bytes, process them first.  */
-  tsi_adapter_handshaker *impl = (tsi_adapter_handshaker *)self;
+  tsi_adapter_handshaker* impl = (tsi_adapter_handshaker*)self;
   tsi_result status = TSI_OK;
   size_t bytes_consumed = received_bytes_size;
   if (received_bytes_size > 0) {
@@ -173,7 +173,7 @@
     offset += to_send_size;
     if (status == TSI_INCOMPLETE_DATA) {
       impl->adapter_buffer_size *= 2;
-      impl->adapter_buffer = (unsigned char *)gpr_realloc(
+      impl->adapter_buffer = (unsigned char*)gpr_realloc(
           impl->adapter_buffer, impl->adapter_buffer_size);
     }
   } while (status == TSI_INCOMPLETE_DATA);
@@ -186,7 +186,7 @@
     *handshaker_result = NULL;
   } else {
     size_t unused_bytes_size = received_bytes_size - bytes_consumed;
-    const unsigned char *unused_bytes =
+    const unsigned char* unused_bytes =
         unused_bytes_size == 0 ? NULL : received_bytes + bytes_consumed;
     status = tsi_adapter_create_handshaker_result(
         impl->wrapped, unused_bytes, unused_bytes_size, handshaker_result);
@@ -208,19 +208,19 @@
     adapter_next,
 };
 
-tsi_handshaker *tsi_create_adapter_handshaker(tsi_handshaker *wrapped) {
+tsi_handshaker* tsi_create_adapter_handshaker(tsi_handshaker* wrapped) {
   GPR_ASSERT(wrapped != NULL);
-  tsi_adapter_handshaker *impl =
-      (tsi_adapter_handshaker *)gpr_zalloc(sizeof(*impl));
+  tsi_adapter_handshaker* impl =
+      (tsi_adapter_handshaker*)gpr_zalloc(sizeof(*impl));
   impl->base.vtable = &handshaker_vtable;
   impl->wrapped = wrapped;
   impl->adapter_buffer_size = TSI_ADAPTER_INITIAL_BUFFER_SIZE;
-  impl->adapter_buffer = (unsigned char *)gpr_malloc(impl->adapter_buffer_size);
+  impl->adapter_buffer = (unsigned char*)gpr_malloc(impl->adapter_buffer_size);
   return &impl->base;
 }
 
-tsi_handshaker *tsi_adapter_handshaker_get_wrapped(tsi_handshaker *adapter) {
+tsi_handshaker* tsi_adapter_handshaker_get_wrapped(tsi_handshaker* adapter) {
   if (adapter == NULL) return NULL;
-  tsi_adapter_handshaker *impl = (tsi_adapter_handshaker *)adapter;
+  tsi_adapter_handshaker* impl = (tsi_adapter_handshaker*)adapter;
   return impl->wrapped;
 }
diff --git a/src/core/tsi/transport_security_adapter.h b/src/core/tsi/transport_security_adapter.h
index 02f33d4..232705f 100644
--- a/src/core/tsi/transport_security_adapter.h
+++ b/src/core/tsi/transport_security_adapter.h
@@ -33,12 +33,12 @@
    this tsi adapter handshaker is temporary. It will be removed once TSI has
    been fully migrated to the new interface.
    Ownership of input tsi_handshaker is transferred to this new adapter.  */
-tsi_handshaker *tsi_create_adapter_handshaker(tsi_handshaker *wrapped);
+tsi_handshaker* tsi_create_adapter_handshaker(tsi_handshaker* wrapped);
 
 /* Given a tsi adapter handshaker, return the original wrapped handshaker. The
    adapter still owns the wrapped handshaker which should not be destroyed by
    the caller. */
-tsi_handshaker *tsi_adapter_handshaker_get_wrapped(tsi_handshaker *adapter);
+tsi_handshaker* tsi_adapter_handshaker_get_wrapped(tsi_handshaker* adapter);
 
 #ifdef __cplusplus
 }
diff --git a/src/core/tsi/transport_security_grpc.cc b/src/core/tsi/transport_security_grpc.cc
index affd995..3c98647 100644
--- a/src/core/tsi/transport_security_grpc.cc
+++ b/src/core/tsi/transport_security_grpc.cc
@@ -20,9 +20,9 @@
 
 /* This method creates a tsi_zero_copy_grpc_protector object.  */
 tsi_result tsi_handshaker_result_create_zero_copy_grpc_protector(
-    grpc_exec_ctx *exec_ctx, const tsi_handshaker_result *self,
-    size_t *max_output_protected_frame_size,
-    tsi_zero_copy_grpc_protector **protector) {
+    grpc_exec_ctx* exec_ctx, const tsi_handshaker_result* self,
+    size_t* max_output_protected_frame_size,
+    tsi_zero_copy_grpc_protector** protector) {
   if (exec_ctx == NULL || self == NULL || self->vtable == NULL ||
       protector == NULL) {
     return TSI_INVALID_ARGUMENT;
@@ -39,9 +39,9 @@
    Calls specific implementation after state/input validation. */
 
 tsi_result tsi_zero_copy_grpc_protector_protect(
-    grpc_exec_ctx *exec_ctx, tsi_zero_copy_grpc_protector *self,
-    grpc_slice_buffer *unprotected_slices,
-    grpc_slice_buffer *protected_slices) {
+    grpc_exec_ctx* exec_ctx, tsi_zero_copy_grpc_protector* self,
+    grpc_slice_buffer* unprotected_slices,
+    grpc_slice_buffer* protected_slices) {
   if (exec_ctx == NULL || self == NULL || self->vtable == NULL ||
       unprotected_slices == NULL || protected_slices == NULL) {
     return TSI_INVALID_ARGUMENT;
@@ -52,9 +52,9 @@
 }
 
 tsi_result tsi_zero_copy_grpc_protector_unprotect(
-    grpc_exec_ctx *exec_ctx, tsi_zero_copy_grpc_protector *self,
-    grpc_slice_buffer *protected_slices,
-    grpc_slice_buffer *unprotected_slices) {
+    grpc_exec_ctx* exec_ctx, tsi_zero_copy_grpc_protector* self,
+    grpc_slice_buffer* protected_slices,
+    grpc_slice_buffer* unprotected_slices) {
   if (exec_ctx == NULL || self == NULL || self->vtable == NULL ||
       protected_slices == NULL || unprotected_slices == NULL) {
     return TSI_INVALID_ARGUMENT;
@@ -64,8 +64,8 @@
                                  unprotected_slices);
 }
 
-void tsi_zero_copy_grpc_protector_destroy(grpc_exec_ctx *exec_ctx,
-                                          tsi_zero_copy_grpc_protector *self) {
+void tsi_zero_copy_grpc_protector_destroy(grpc_exec_ctx* exec_ctx,
+                                          tsi_zero_copy_grpc_protector* self) {
   if (self == NULL) return;
   self->vtable->destroy(exec_ctx, self);
 }
diff --git a/src/core/tsi/transport_security_grpc.h b/src/core/tsi/transport_security_grpc.h
index ca6755c..1c54693 100644
--- a/src/core/tsi/transport_security_grpc.h
+++ b/src/core/tsi/transport_security_grpc.h
@@ -30,9 +30,9 @@
    assuming there is no fatal error.
    The caller is responsible for destroying the protector.  */
 tsi_result tsi_handshaker_result_create_zero_copy_grpc_protector(
-    grpc_exec_ctx *exec_ctx, const tsi_handshaker_result *self,
-    size_t *max_output_protected_frame_size,
-    tsi_zero_copy_grpc_protector **protector);
+    grpc_exec_ctx* exec_ctx, const tsi_handshaker_result* self,
+    size_t* max_output_protected_frame_size,
+    tsi_zero_copy_grpc_protector** protector);
 
 /* -- tsi_zero_copy_grpc_protector object --  */
 
@@ -43,8 +43,8 @@
    - This method returns TSI_OK in case of success or a specific error code in
      case of failure.  */
 tsi_result tsi_zero_copy_grpc_protector_protect(
-    grpc_exec_ctx *exec_ctx, tsi_zero_copy_grpc_protector *self,
-    grpc_slice_buffer *unprotected_slices, grpc_slice_buffer *protected_slices);
+    grpc_exec_ctx* exec_ctx, tsi_zero_copy_grpc_protector* self,
+    grpc_slice_buffer* unprotected_slices, grpc_slice_buffer* protected_slices);
 
 /* Outputs unprotected bytes.
    - protected_slices is the bytes of protected frames.
@@ -53,28 +53,28 @@
      there is not enough data to output in which case unprotected_slices has 0
      bytes.  */
 tsi_result tsi_zero_copy_grpc_protector_unprotect(
-    grpc_exec_ctx *exec_ctx, tsi_zero_copy_grpc_protector *self,
-    grpc_slice_buffer *protected_slices, grpc_slice_buffer *unprotected_slices);
+    grpc_exec_ctx* exec_ctx, tsi_zero_copy_grpc_protector* self,
+    grpc_slice_buffer* protected_slices, grpc_slice_buffer* unprotected_slices);
 
 /* Destroys the tsi_zero_copy_grpc_protector object.  */
-void tsi_zero_copy_grpc_protector_destroy(grpc_exec_ctx *exec_ctx,
-                                          tsi_zero_copy_grpc_protector *self);
+void tsi_zero_copy_grpc_protector_destroy(grpc_exec_ctx* exec_ctx,
+                                          tsi_zero_copy_grpc_protector* self);
 
 /* Base for tsi_zero_copy_grpc_protector implementations.  */
 typedef struct {
-  tsi_result (*protect)(grpc_exec_ctx *exec_ctx,
-                        tsi_zero_copy_grpc_protector *self,
-                        grpc_slice_buffer *unprotected_slices,
-                        grpc_slice_buffer *protected_slices);
-  tsi_result (*unprotect)(grpc_exec_ctx *exec_ctx,
-                          tsi_zero_copy_grpc_protector *self,
-                          grpc_slice_buffer *protected_slices,
-                          grpc_slice_buffer *unprotected_slices);
-  void (*destroy)(grpc_exec_ctx *exec_ctx, tsi_zero_copy_grpc_protector *self);
+  tsi_result (*protect)(grpc_exec_ctx* exec_ctx,
+                        tsi_zero_copy_grpc_protector* self,
+                        grpc_slice_buffer* unprotected_slices,
+                        grpc_slice_buffer* protected_slices);
+  tsi_result (*unprotect)(grpc_exec_ctx* exec_ctx,
+                          tsi_zero_copy_grpc_protector* self,
+                          grpc_slice_buffer* protected_slices,
+                          grpc_slice_buffer* unprotected_slices);
+  void (*destroy)(grpc_exec_ctx* exec_ctx, tsi_zero_copy_grpc_protector* self);
 } tsi_zero_copy_grpc_protector_vtable;
 
 struct tsi_zero_copy_grpc_protector {
-  const tsi_zero_copy_grpc_protector_vtable *vtable;
+  const tsi_zero_copy_grpc_protector_vtable* vtable;
 };
 
 #ifdef __cplusplus
diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h
index 40a5a59..0f3d468 100644
--- a/src/core/tsi/transport_security_interface.h
+++ b/src/core/tsi/transport_security_interface.h
@@ -56,7 +56,7 @@
   TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY,
 } tsi_client_certificate_request_type;
 
-const char *tsi_result_to_string(tsi_result result);
+const char* tsi_result_to_string(tsi_result result);
 
 /* --- tsi tracing --- */
 
@@ -131,11 +131,11 @@
 
    if (result != TSI_OK) HandleError(result);
    ------------------------------------------------------------------------  */
-tsi_result tsi_frame_protector_protect(tsi_frame_protector *self,
-                                       const unsigned char *unprotected_bytes,
-                                       size_t *unprotected_bytes_size,
-                                       unsigned char *protected_output_frames,
-                                       size_t *protected_output_frames_size);
+tsi_result tsi_frame_protector_protect(tsi_frame_protector* self,
+                                       const unsigned char* unprotected_bytes,
+                                       size_t* unprotected_bytes_size,
+                                       unsigned char* protected_output_frames,
+                                       size_t* protected_output_frames_size);
 
 /* Indicates that we need to flush the bytes buffered in the protector and get
    the resulting frame.
@@ -146,8 +146,8 @@
    - still_pending_bytes is an output parameter indicating the number of bytes
      that still need to be flushed from the protector.*/
 tsi_result tsi_frame_protector_protect_flush(
-    tsi_frame_protector *self, unsigned char *protected_output_frames,
-    size_t *protected_output_frames_size, size_t *still_pending_size);
+    tsi_frame_protector* self, unsigned char* protected_output_frames,
+    size_t* protected_output_frames_size, size_t* still_pending_size);
 
 /* Outputs unprotected bytes.
    - protected_frames_bytes is an input only parameter and points to the
@@ -172,12 +172,12 @@
      needs to be read before new protected data can be processed in which case
      protected_frames_size will be set to 0.  */
 tsi_result tsi_frame_protector_unprotect(
-    tsi_frame_protector *self, const unsigned char *protected_frames_bytes,
-    size_t *protected_frames_bytes_size, unsigned char *unprotected_bytes,
-    size_t *unprotected_bytes_size);
+    tsi_frame_protector* self, const unsigned char* protected_frames_bytes,
+    size_t* protected_frames_bytes_size, unsigned char* unprotected_bytes,
+    size_t* unprotected_bytes_size);
 
 /* Destroys the tsi_frame_protector object.  */
-void tsi_frame_protector_destroy(tsi_frame_protector *self);
+void tsi_frame_protector_destroy(tsi_frame_protector* self);
 
 /* --- tsi_peer objects ---
 
@@ -189,20 +189,20 @@
 /* Property values may contain NULL characters just like C++ strings.
    The length field gives the length of the string. */
 typedef struct tsi_peer_property {
-  char *name;
+  char* name;
   struct {
-    char *data;
+    char* data;
     size_t length;
   } value;
 } tsi_peer_property;
 
 typedef struct {
-  tsi_peer_property *properties;
+  tsi_peer_property* properties;
   size_t property_count;
 } tsi_peer;
 
 /* Destructs the tsi_peer object. */
-void tsi_peer_destruct(tsi_peer *self);
+void tsi_peer_destruct(tsi_peer* self);
 
 /*  --- tsi_handshaker_result object ---
 
@@ -215,27 +215,27 @@
 /* This method extracts tsi peer. It returns TSI_OK assuming there is no fatal
    error.
    The caller is responsible for destructing the peer.  */
-tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result *self,
-                                              tsi_peer *peer);
+tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result* self,
+                                              tsi_peer* peer);
 
 /* This method creates a tsi_frame_protector object. It returns TSI_OK assuming
    there is no fatal error.
    The caller is responsible for destroying the protector.  */
 tsi_result tsi_handshaker_result_create_frame_protector(
-    const tsi_handshaker_result *self, size_t *max_output_protected_frame_size,
-    tsi_frame_protector **protector);
+    const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
+    tsi_frame_protector** protector);
 
 /* This method returns the unused bytes from the handshake. It returns TSI_OK
    assuming there is no fatal error.
    Ownership of the bytes is retained by the handshaker result. As a
    consequence, the caller must not free the bytes.  */
 tsi_result tsi_handshaker_result_get_unused_bytes(
-    const tsi_handshaker_result *self, const unsigned char **bytes,
-    size_t *byte_size);
+    const tsi_handshaker_result* self, const unsigned char** bytes,
+    size_t* byte_size);
 
 /* This method releases the tsi_handshaker_handshaker object. After this method
    is called, no other method can be called on the object.  */
-void tsi_handshaker_result_destroy(tsi_handshaker_result *self);
+void tsi_handshaker_result_destroy(tsi_handshaker_result* self);
 
 /* --- tsi_handshaker objects ----
 
@@ -346,9 +346,9 @@
    needs to be called again to get all the bytes to send to the peer (there
    was more data to write than the specified bytes_size). In case of a fatal
    error in the handshake, another specific error code is returned.  */
-tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker *self,
-                                                    unsigned char *bytes,
-                                                    size_t *bytes_size);
+tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker* self,
+                                                    unsigned char* bytes,
+                                                    size_t* bytes_size);
 
 /* TO BE DEPRECATED SOON. Use tsi_handshaker_next instead.
    Processes bytes received from the peer.
@@ -360,9 +360,9 @@
    needs to be called again to complete the data needed for processing. In
    case of a fatal error in the handshake, another specific error code is
    returned.  */
-tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker *self,
-                                                  const unsigned char *bytes,
-                                                  size_t *bytes_size);
+tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker* self,
+                                                  const unsigned char* bytes,
+                                                  size_t* bytes_size);
 
 /* TO BE DEPRECATED SOON.
    Gets the result of the handshaker.
@@ -370,7 +370,7 @@
    errors. Returns TSI_HANDSHAKE_IN_PROGRESS if the handshaker is not done yet
    but no error has been encountered so far. Otherwise the handshaker failed
    with the returned error.  */
-tsi_result tsi_handshaker_get_result(tsi_handshaker *self);
+tsi_result tsi_handshaker_get_result(tsi_handshaker* self);
 
 /* TO BE DEPRECATED SOON.
    Returns 1 if the handshake is in progress, 0 otherwise.  */
@@ -382,7 +382,7 @@
    tsi_handshaker_is_in_progress returns 1, it returns TSI_OK otherwise
    assuming the handshaker is not in a fatal error state.
    The caller is responsible for destructing the peer.  */
-tsi_result tsi_handshaker_extract_peer(tsi_handshaker *self, tsi_peer *peer);
+tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer);
 
 /* TO BE DEPRECATED SOON. Use tsi_handshaker_result_create_frame_protector
    instead.
@@ -403,8 +403,8 @@
    the handshaker is not in a fatal error state.
    The caller is responsible for destroying the protector.  */
 tsi_result tsi_handshaker_create_frame_protector(
-    tsi_handshaker *self, size_t *max_output_protected_frame_size,
-    tsi_frame_protector **protector);
+    tsi_handshaker* self, size_t* max_output_protected_frame_size,
+    tsi_frame_protector** protector);
 
 /* Callback function definition for tsi_handshaker_next.
    - status indicates the status of the next operation.
@@ -414,8 +414,8 @@
    - handshaker_result is the result of handshake when the handshake completes,
      is NULL otherwise.  */
 typedef void (*tsi_handshaker_on_next_done_cb)(
-    tsi_result status, void *user_data, const unsigned char *bytes_to_send,
-    size_t bytes_to_send_size, tsi_handshaker_result *handshaker_result);
+    tsi_result status, void* user_data, const unsigned char* bytes_to_send,
+    size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result);
 
 /* Conduct a next step of the handshake.
    - received_bytes is the buffer containing the data received from the peer.
@@ -437,14 +437,14 @@
    the caller should not free bytes_to_send, as the buffer is owned by the
    tsi_handshaker object.  */
 tsi_result tsi_handshaker_next(
-    tsi_handshaker *self, const unsigned char *received_bytes,
-    size_t received_bytes_size, const unsigned char **bytes_to_send,
-    size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result,
-    tsi_handshaker_on_next_done_cb cb, void *user_data);
+    tsi_handshaker* self, const unsigned char* received_bytes,
+    size_t received_bytes_size, const unsigned char** bytes_to_send,
+    size_t* bytes_to_send_size, tsi_handshaker_result** handshaker_result,
+    tsi_handshaker_on_next_done_cb cb, void* user_data);
 
 /* This method releases the tsi_handshaker object. After this method is called,
    no other method can be called on the object.  */
-void tsi_handshaker_destroy(tsi_handshaker *self);
+void tsi_handshaker_destroy(tsi_handshaker* self);
 
 /* This method initializes the necessary shared objects used for tsi
    implementation.  */
diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc
index 19a25c8..9df5310 100644
--- a/src/cpp/client/channel_cc.cc
+++ b/src/cpp/client/channel_cc.cc
@@ -48,187 +48,13 @@
 
 namespace grpc {
 
-namespace {
-int kConnectivityCheckIntervalMsec = 500;
-void WatchStateChange(void* arg);
-
-class TagSaver final : public CompletionQueueTag {
- public:
-  explicit TagSaver(void* tag) : tag_(tag) {}
-  ~TagSaver() override {}
-  bool FinalizeResult(void** tag, bool* status) override {
-    *tag = tag_;
-    delete this;
-    return true;
-  }
-
- private:
-  void* tag_;
-};
-
-// Constantly watches channel connectivity status to reconnect a transiently
-// disconnected channel. This is a temporary work-around before we have retry
-// support.
-class ChannelConnectivityWatcher : private GrpcLibraryCodegen {
- public:
-  static void StartWatching(grpc_channel* channel) {
-    if (!IsDisabled()) {
-      std::unique_lock<std::mutex> lock(g_watcher_mu_);
-      if (g_watcher_ == nullptr) {
-        g_watcher_ = new ChannelConnectivityWatcher();
-      }
-      g_watcher_->StartWatchingLocked(channel);
-    }
-  }
-
-  static void StopWatching() {
-    if (!IsDisabled()) {
-      std::unique_lock<std::mutex> lock(g_watcher_mu_);
-      if (g_watcher_->StopWatchingLocked()) {
-        delete g_watcher_;
-        g_watcher_ = nullptr;
-      }
-    }
-  }
-
- private:
-  ChannelConnectivityWatcher() : channel_count_(0), shutdown_(false) {
-    gpr_ref_init(&ref_, 0);
-    gpr_thd_options options = gpr_thd_options_default();
-    gpr_thd_options_set_joinable(&options);
-    gpr_thd_new(&thd_id_, &WatchStateChange, this, &options);
-  }
-
-  static bool IsDisabled() {
-    char* env = gpr_getenv("GRPC_DISABLE_CHANNEL_CONNECTIVITY_WATCHER");
-    bool disabled = gpr_is_true(env);
-    gpr_free(env);
-    return disabled;
-  }
-
-  void WatchStateChangeImpl() {
-    bool ok = false;
-    void* tag = NULL;
-    CompletionQueue::NextStatus status = CompletionQueue::GOT_EVENT;
-    while (true) {
-      {
-        std::unique_lock<std::mutex> lock(shutdown_mu_);
-        if (shutdown_) {
-          // Drain cq_ if the watcher is shutting down
-          status = cq_.AsyncNext(&tag, &ok, gpr_inf_future(GPR_CLOCK_REALTIME));
-        } else {
-          status = cq_.AsyncNext(&tag, &ok, gpr_inf_past(GPR_CLOCK_REALTIME));
-          // Make sure we've seen 2 TIMEOUTs before going to sleep
-          if (status == CompletionQueue::TIMEOUT) {
-            status = cq_.AsyncNext(&tag, &ok, gpr_inf_past(GPR_CLOCK_REALTIME));
-            if (status == CompletionQueue::TIMEOUT) {
-              shutdown_cv_.wait_for(lock, std::chrono::milliseconds(
-                                              kConnectivityCheckIntervalMsec));
-              continue;
-            }
-          }
-        }
-      }
-      ChannelState* channel_state = static_cast<ChannelState*>(tag);
-      channel_state->state =
-          grpc_channel_check_connectivity_state(channel_state->channel, false);
-      if (channel_state->state == GRPC_CHANNEL_SHUTDOWN) {
-        void* shutdown_tag = NULL;
-        channel_state->shutdown_cq.Next(&shutdown_tag, &ok);
-        delete channel_state;
-        if (gpr_unref(&ref_)) {
-          break;
-        }
-      } else {
-        TagSaver* tag_saver = new TagSaver(channel_state);
-        grpc_channel_watch_connectivity_state(
-            channel_state->channel, channel_state->state,
-            gpr_inf_future(GPR_CLOCK_REALTIME), cq_.cq(), tag_saver);
-      }
-    }
-  }
-
-  void StartWatchingLocked(grpc_channel* channel) {
-    if (thd_id_ != 0) {
-      gpr_ref(&ref_);
-      ++channel_count_;
-      ChannelState* channel_state = new ChannelState(channel);
-      // The first grpc_channel_watch_connectivity_state() is not used to
-      // monitor the channel state change, but to hold a reference of the
-      // c channel. So that WatchStateChangeImpl() can observe state ==
-      // GRPC_CHANNEL_SHUTDOWN before the channel gets destroyed.
-      grpc_channel_watch_connectivity_state(
-          channel_state->channel, channel_state->state,
-          gpr_inf_future(GPR_CLOCK_REALTIME), channel_state->shutdown_cq.cq(),
-          new TagSaver(nullptr));
-      grpc_channel_watch_connectivity_state(
-          channel_state->channel, channel_state->state,
-          gpr_inf_future(GPR_CLOCK_REALTIME), cq_.cq(),
-          new TagSaver(channel_state));
-    }
-  }
-
-  bool StopWatchingLocked() {
-    if (--channel_count_ == 0) {
-      {
-        std::unique_lock<std::mutex> lock(shutdown_mu_);
-        shutdown_ = true;
-        shutdown_cv_.notify_one();
-      }
-      gpr_thd_join(thd_id_);
-      return true;
-    }
-    return false;
-  }
-
-  friend void WatchStateChange(void* arg);
-  struct ChannelState {
-    explicit ChannelState(grpc_channel* channel)
-        : channel(channel), state(GRPC_CHANNEL_IDLE){};
-    grpc_channel* channel;
-    grpc_connectivity_state state;
-    CompletionQueue shutdown_cq;
-  };
-  gpr_thd_id thd_id_;
-  CompletionQueue cq_;
-  gpr_refcount ref_;
-  int channel_count_;
-
-  std::mutex shutdown_mu_;
-  std::condition_variable shutdown_cv_;  // protected by shutdown_mu_
-  bool shutdown_;                        // protected by shutdown_mu_
-
-  static std::mutex g_watcher_mu_;
-  static ChannelConnectivityWatcher* g_watcher_;  // protected by g_watcher_mu_
-};
-
-std::mutex ChannelConnectivityWatcher::g_watcher_mu_;
-ChannelConnectivityWatcher* ChannelConnectivityWatcher::g_watcher_ = nullptr;
-
-void WatchStateChange(void* arg) {
-  ChannelConnectivityWatcher* watcher =
-      static_cast<ChannelConnectivityWatcher*>(arg);
-  watcher->WatchStateChangeImpl();
-}
-}  // namespace
-
 static internal::GrpcLibraryInitializer g_gli_initializer;
 Channel::Channel(const grpc::string& host, grpc_channel* channel)
     : host_(host), c_channel_(channel) {
   g_gli_initializer.summon();
-  if (grpc_channel_support_connectivity_watcher(channel)) {
-    ChannelConnectivityWatcher::StartWatching(channel);
-  }
 }
 
-Channel::~Channel() {
-  const bool stop_watching =
-      grpc_channel_support_connectivity_watcher(c_channel_);
-  grpc_channel_destroy(c_channel_);
-  if (stop_watching) {
-    ChannelConnectivityWatcher::StopWatching();
-  }
-}
+Channel::~Channel() { grpc_channel_destroy(c_channel_); }
 
 namespace {
 
@@ -259,8 +85,9 @@
                              &channel_info.service_config_json);
 }
 
-Call Channel::CreateCall(const RpcMethod& method, ClientContext* context,
-                         CompletionQueue* cq) {
+internal::Call Channel::CreateCall(const internal::RpcMethod& method,
+                                   ClientContext* context,
+                                   CompletionQueue* cq) {
   const bool kRegistered = method.channel_tag() && context->authority().empty();
   grpc_call* c_call = NULL;
   if (kRegistered) {
@@ -292,10 +119,11 @@
   }
   grpc_census_call_set_context(c_call, context->census_context());
   context->set_call(c_call, shared_from_this());
-  return Call(c_call, this, cq);
+  return internal::Call(c_call, this, cq);
 }
 
-void Channel::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) {
+void Channel::PerformOpsOnCall(internal::CallOpSetInterface* ops,
+                               internal::Call* call) {
   static const size_t MAX_OPS = 8;
   size_t nops = 0;
   grpc_op cops[MAX_OPS];
@@ -313,6 +141,24 @@
   return grpc_channel_check_connectivity_state(c_channel_, try_to_connect);
 }
 
+namespace {
+
+class TagSaver final : public internal::CompletionQueueTag {
+ public:
+  explicit TagSaver(void* tag) : tag_(tag) {}
+  ~TagSaver() override {}
+  bool FinalizeResult(void** tag, bool* status) override {
+    *tag = tag_;
+    delete this;
+    return true;
+  }
+
+ private:
+  void* tag_;
+};
+
+}  // namespace
+
 void Channel::NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
                                       gpr_timespec deadline,
                                       CompletionQueue* cq, void* tag) {
diff --git a/src/cpp/client/generic_stub.cc b/src/cpp/client/generic_stub.cc
index 693b8be..4b4b8dd 100644
--- a/src/cpp/client/generic_stub.cc
+++ b/src/cpp/client/generic_stub.cc
@@ -27,8 +27,10 @@
     ChannelInterface* channel, ClientContext* context,
     const grpc::string& method, CompletionQueue* cq, bool start, void* tag) {
   return std::unique_ptr<GenericClientAsyncReaderWriter>(
-      GenericClientAsyncReaderWriter::Create(
-          channel, cq, RpcMethod(method.c_str(), RpcMethod::BIDI_STREAMING),
+      internal::ClientAsyncReaderWriterFactory<ByteBuffer, ByteBuffer>::Create(
+          channel, cq,
+          internal::RpcMethod(method.c_str(),
+                              internal::RpcMethod::BIDI_STREAMING),
           context, start, tag));
 }
 
@@ -52,8 +54,9 @@
     ClientContext* context, const grpc::string& method,
     const ByteBuffer& request, CompletionQueue* cq) {
   return std::unique_ptr<GenericClientAsyncResponseReader>(
-      GenericClientAsyncResponseReader::Create(
-          channel_.get(), cq, RpcMethod(method.c_str(), RpcMethod::NORMAL_RPC),
+      internal::ClientAsyncResponseReaderFactory<ByteBuffer>::Create(
+          channel_.get(), cq,
+          internal::RpcMethod(method.c_str(), internal::RpcMethod::NORMAL_RPC),
           context, request, false));
 }
 
diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc
index 13bbc30..4fb128d 100644
--- a/src/cpp/client/secure_credentials.cc
+++ b/src/cpp/client/secure_credentials.cc
@@ -56,14 +56,16 @@
 namespace {
 std::shared_ptr<ChannelCredentials> WrapChannelCredentials(
     grpc_channel_credentials* creds) {
-  return creds == nullptr ? nullptr : std::shared_ptr<ChannelCredentials>(
-                                          new SecureChannelCredentials(creds));
+  return creds == nullptr ? nullptr
+                          : std::shared_ptr<ChannelCredentials>(
+                                new SecureChannelCredentials(creds));
 }
 
 std::shared_ptr<CallCredentials> WrapCallCredentials(
     grpc_call_credentials* creds) {
-  return creds == nullptr ? nullptr : std::shared_ptr<CallCredentials>(
-                                          new SecureCallCredentials(creds));
+  return creds == nullptr ? nullptr
+                          : std::shared_ptr<CallCredentials>(
+                                new SecureCallCredentials(creds));
 }
 }  // namespace
 
diff --git a/src/cpp/common/channel_filter.cc b/src/cpp/common/channel_filter.cc
index ea44cff..d1cfd2b 100644
--- a/src/cpp/common/channel_filter.cc
+++ b/src/cpp/common/channel_filter.cc
@@ -29,10 +29,10 @@
 
 // MetadataBatch
 
-grpc_linked_mdelem *MetadataBatch::AddMetadata(grpc_exec_ctx *exec_ctx,
-                                               const string &key,
-                                               const string &value) {
-  grpc_linked_mdelem *storage = new grpc_linked_mdelem;
+grpc_linked_mdelem* MetadataBatch::AddMetadata(grpc_exec_ctx* exec_ctx,
+                                               const string& key,
+                                               const string& value) {
+  grpc_linked_mdelem* storage = new grpc_linked_mdelem;
   memset(storage, 0, sizeof(grpc_linked_mdelem));
   storage->md = grpc_mdelem_from_slices(exec_ctx, SliceFromCopiedString(key),
                                         SliceFromCopiedString(value));
@@ -43,28 +43,28 @@
 
 // ChannelData
 
-void ChannelData::StartTransportOp(grpc_exec_ctx *exec_ctx,
-                                   grpc_channel_element *elem,
-                                   TransportOp *op) {
+void ChannelData::StartTransportOp(grpc_exec_ctx* exec_ctx,
+                                   grpc_channel_element* elem,
+                                   TransportOp* op) {
   grpc_channel_next_op(exec_ctx, elem, op->op());
 }
 
-void ChannelData::GetInfo(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                          const grpc_channel_info *channel_info) {
+void ChannelData::GetInfo(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                          const grpc_channel_info* channel_info) {
   grpc_channel_next_get_info(exec_ctx, elem, channel_info);
 }
 
 // CallData
 
-void CallData::StartTransportStreamOpBatch(grpc_exec_ctx *exec_ctx,
-                                           grpc_call_element *elem,
-                                           TransportStreamOpBatch *op) {
+void CallData::StartTransportStreamOpBatch(grpc_exec_ctx* exec_ctx,
+                                           grpc_call_element* elem,
+                                           TransportStreamOpBatch* op) {
   grpc_call_next_op(exec_ctx, elem, op->op());
 }
 
-void CallData::SetPollsetOrPollsetSet(grpc_exec_ctx *exec_ctx,
-                                      grpc_call_element *elem,
-                                      grpc_polling_entity *pollent) {
+void CallData::SetPollsetOrPollsetSet(grpc_exec_ctx* exec_ctx,
+                                      grpc_call_element* elem,
+                                      grpc_polling_entity* pollent) {
   grpc_call_stack_ignore_set_pollset_or_pollset_set(exec_ctx, elem, pollent);
 }
 
@@ -73,15 +73,15 @@
 namespace internal {
 
 // Note: Implicitly initialized to nullptr due to static lifetime.
-std::vector<FilterRecord> *channel_filters;
+std::vector<FilterRecord>* channel_filters;
 
 namespace {
 
-bool MaybeAddFilter(grpc_exec_ctx *exec_ctx,
-                    grpc_channel_stack_builder *builder, void *arg) {
-  const FilterRecord &filter = *(FilterRecord *)arg;
+bool MaybeAddFilter(grpc_exec_ctx* exec_ctx,
+                    grpc_channel_stack_builder* builder, void* arg) {
+  const FilterRecord& filter = *(FilterRecord*)arg;
   if (filter.include_filter) {
-    const grpc_channel_args *args =
+    const grpc_channel_args* args =
         grpc_channel_stack_builder_get_channel_arguments(builder);
     if (!filter.include_filter(*args)) return true;
   }
@@ -93,9 +93,9 @@
 
 void ChannelFilterPluginInit() {
   for (size_t i = 0; i < channel_filters->size(); ++i) {
-    FilterRecord &filter = (*channel_filters)[i];
+    FilterRecord& filter = (*channel_filters)[i];
     grpc_channel_init_register_stage(filter.stack_type, filter.priority,
-                                     MaybeAddFilter, (void *)&filter);
+                                     MaybeAddFilter, (void*)&filter);
   }
 }
 
diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h
index c1aeb3f..4fb81ec 100644
--- a/src/cpp/common/channel_filter.h
+++ b/src/cpp/common/channel_filter.h
@@ -49,23 +49,23 @@
   /// Borrows a pointer to \a batch, but does NOT take ownership.
   /// The caller must ensure that \a batch continues to exist for as
   /// long as the MetadataBatch object does.
-  explicit MetadataBatch(grpc_metadata_batch *batch) : batch_(batch) {}
+  explicit MetadataBatch(grpc_metadata_batch* batch) : batch_(batch) {}
 
-  grpc_metadata_batch *batch() const { return batch_; }
+  grpc_metadata_batch* batch() const { return batch_; }
 
   /// Adds metadata and returns the newly allocated storage.
   /// The caller takes ownership of the result, which must exist for the
   /// lifetime of the gRPC call.
-  grpc_linked_mdelem *AddMetadata(grpc_exec_ctx *exec_ctx, const string &key,
-                                  const string &value);
+  grpc_linked_mdelem* AddMetadata(grpc_exec_ctx* exec_ctx, const string& key,
+                                  const string& value);
 
   class const_iterator : public std::iterator<std::bidirectional_iterator_tag,
                                               const grpc_mdelem> {
    public:
-    const grpc_mdelem &operator*() const { return elem_->md; }
+    const grpc_mdelem& operator*() const { return elem_->md; }
     const grpc_mdelem operator->() const { return elem_->md; }
 
-    const_iterator &operator++() {
+    const_iterator& operator++() {
       elem_ = elem_->next;
       return *this;
     }
@@ -74,7 +74,7 @@
       operator++();
       return tmp;
     }
-    const_iterator &operator--() {
+    const_iterator& operator--() {
       elem_ = elem_->prev;
       return *this;
     }
@@ -84,25 +84,25 @@
       return tmp;
     }
 
-    bool operator==(const const_iterator &other) const {
+    bool operator==(const const_iterator& other) const {
       return elem_ == other.elem_;
     }
-    bool operator!=(const const_iterator &other) const {
+    bool operator!=(const const_iterator& other) const {
       return elem_ != other.elem_;
     }
 
    private:
     friend class MetadataBatch;
-    explicit const_iterator(grpc_linked_mdelem *elem) : elem_(elem) {}
+    explicit const_iterator(grpc_linked_mdelem* elem) : elem_(elem) {}
 
-    grpc_linked_mdelem *elem_;
+    grpc_linked_mdelem* elem_;
   };
 
   const_iterator begin() const { return const_iterator(batch_->list.head); }
   const_iterator end() const { return const_iterator(nullptr); }
 
  private:
-  grpc_metadata_batch *batch_;  // Not owned.
+  grpc_metadata_batch* batch_;  // Not owned.
 };
 
 /// A C++ wrapper for the \c grpc_transport_op struct.
@@ -111,12 +111,12 @@
   /// Borrows a pointer to \a op, but does NOT take ownership.
   /// The caller must ensure that \a op continues to exist for as
   /// long as the TransportOp object does.
-  explicit TransportOp(grpc_transport_op *op) : op_(op) {}
+  explicit TransportOp(grpc_transport_op* op) : op_(op) {}
 
-  grpc_transport_op *op() const { return op_; }
+  grpc_transport_op* op() const { return op_; }
 
   // TODO(roth): Add a C++ wrapper for grpc_error?
-  grpc_error *disconnect_with_error() const {
+  grpc_error* disconnect_with_error() const {
     return op_->disconnect_with_error;
   }
   bool send_goaway() const { return op_->goaway_error != GRPC_ERROR_NONE; }
@@ -124,7 +124,7 @@
   // TODO(roth): Add methods for additional fields as needed.
 
  private:
-  grpc_transport_op *op_;  // Not owned.
+  grpc_transport_op* op_;  // Not owned.
 };
 
 /// A C++ wrapper for the \c grpc_transport_stream_op_batch struct.
@@ -133,7 +133,7 @@
   /// Borrows a pointer to \a op, but does NOT take ownership.
   /// The caller must ensure that \a op continues to exist for as
   /// long as the TransportStreamOpBatch object does.
-  explicit TransportStreamOpBatch(grpc_transport_stream_op_batch *op)
+  explicit TransportStreamOpBatch(grpc_transport_stream_op_batch* op)
       : op_(op),
         send_initial_metadata_(
             op->send_initial_metadata
@@ -152,64 +152,63 @@
                 ? op->payload->recv_trailing_metadata.recv_trailing_metadata
                 : nullptr) {}
 
-  grpc_transport_stream_op_batch *op() const { return op_; }
+  grpc_transport_stream_op_batch* op() const { return op_; }
 
-  grpc_closure *on_complete() const { return op_->on_complete; }
-  void set_on_complete(grpc_closure *closure) { op_->on_complete = closure; }
+  grpc_closure* on_complete() const { return op_->on_complete; }
+  void set_on_complete(grpc_closure* closure) { op_->on_complete = closure; }
 
-  MetadataBatch *send_initial_metadata() {
+  MetadataBatch* send_initial_metadata() {
     return op_->send_initial_metadata ? &send_initial_metadata_ : nullptr;
   }
-  MetadataBatch *send_trailing_metadata() {
+  MetadataBatch* send_trailing_metadata() {
     return op_->send_trailing_metadata ? &send_trailing_metadata_ : nullptr;
   }
-  MetadataBatch *recv_initial_metadata() {
+  MetadataBatch* recv_initial_metadata() {
     return op_->recv_initial_metadata ? &recv_initial_metadata_ : nullptr;
   }
-  MetadataBatch *recv_trailing_metadata() {
+  MetadataBatch* recv_trailing_metadata() {
     return op_->recv_trailing_metadata ? &recv_trailing_metadata_ : nullptr;
   }
 
-  uint32_t *send_initial_metadata_flags() const {
-    return op_->send_initial_metadata
-               ? &op_->payload->send_initial_metadata
-                      .send_initial_metadata_flags
-               : nullptr;
+  uint32_t* send_initial_metadata_flags() const {
+    return op_->send_initial_metadata ? &op_->payload->send_initial_metadata
+                                             .send_initial_metadata_flags
+                                      : nullptr;
   }
 
-  grpc_closure *recv_initial_metadata_ready() const {
+  grpc_closure* recv_initial_metadata_ready() const {
     return op_->recv_initial_metadata
                ? op_->payload->recv_initial_metadata.recv_initial_metadata_ready
                : nullptr;
   }
-  void set_recv_initial_metadata_ready(grpc_closure *closure) {
+  void set_recv_initial_metadata_ready(grpc_closure* closure) {
     op_->payload->recv_initial_metadata.recv_initial_metadata_ready = closure;
   }
 
-  grpc_byte_stream *send_message() const {
+  grpc_byte_stream* send_message() const {
     return op_->send_message ? op_->payload->send_message.send_message
                              : nullptr;
   }
-  void set_send_message(grpc_byte_stream *send_message) {
+  void set_send_message(grpc_byte_stream* send_message) {
     op_->send_message = true;
     op_->payload->send_message.send_message = send_message;
   }
 
-  grpc_byte_stream **recv_message() const {
+  grpc_byte_stream** recv_message() const {
     return op_->recv_message ? op_->payload->recv_message.recv_message
                              : nullptr;
   }
-  void set_recv_message(grpc_byte_stream **recv_message) {
+  void set_recv_message(grpc_byte_stream** recv_message) {
     op_->recv_message = true;
     op_->payload->recv_message.recv_message = recv_message;
   }
 
-  census_context *get_census_context() const {
-    return (census_context *)op_->payload->context[GRPC_CONTEXT_TRACING].value;
+  census_context* get_census_context() const {
+    return (census_context*)op_->payload->context[GRPC_CONTEXT_TRACING].value;
   }
 
  private:
-  grpc_transport_stream_op_batch *op_;  // Not owned.
+  grpc_transport_stream_op_batch* op_;  // Not owned.
   MetadataBatch send_initial_metadata_;
   MetadataBatch send_trailing_metadata_;
   MetadataBatch recv_initial_metadata_;
@@ -225,19 +224,19 @@
   // TODO(roth): Come up with a more C++-like API for the channel element.
 
   /// Initializes the channel data.
-  virtual grpc_error *Init(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                           grpc_channel_element_args *args) {
+  virtual grpc_error* Init(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                           grpc_channel_element_args* args) {
     return GRPC_ERROR_NONE;
   }
 
   // Called before destruction.
-  virtual void Destroy(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) {}
+  virtual void Destroy(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem) {}
 
-  virtual void StartTransportOp(grpc_exec_ctx *exec_ctx,
-                                grpc_channel_element *elem, TransportOp *op);
+  virtual void StartTransportOp(grpc_exec_ctx* exec_ctx,
+                                grpc_channel_element* elem, TransportOp* op);
 
-  virtual void GetInfo(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                       const grpc_channel_info *channel_info);
+  virtual void GetInfo(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                       const grpc_channel_info* channel_info);
 };
 
 /// Represents call data.
@@ -249,25 +248,25 @@
   // TODO(roth): Come up with a more C++-like API for the call element.
 
   /// Initializes the call data.
-  virtual grpc_error *Init(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                           const grpc_call_element_args *args) {
+  virtual grpc_error* Init(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                           const grpc_call_element_args* args) {
     return GRPC_ERROR_NONE;
   }
 
   // Called before destruction.
-  virtual void Destroy(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                       const grpc_call_final_info *final_info,
-                       grpc_closure *then_call_closure) {}
+  virtual void Destroy(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                       const grpc_call_final_info* final_info,
+                       grpc_closure* then_call_closure) {}
 
   /// Starts a new stream operation.
-  virtual void StartTransportStreamOpBatch(grpc_exec_ctx *exec_ctx,
-                                           grpc_call_element *elem,
-                                           TransportStreamOpBatch *op);
+  virtual void StartTransportStreamOpBatch(grpc_exec_ctx* exec_ctx,
+                                           grpc_call_element* elem,
+                                           TransportStreamOpBatch* op);
 
   /// Sets a pollset or pollset set.
-  virtual void SetPollsetOrPollsetSet(grpc_exec_ctx *exec_ctx,
-                                      grpc_call_element *elem,
-                                      grpc_polling_entity *pollent);
+  virtual void SetPollsetOrPollsetSet(grpc_exec_ctx* exec_ctx,
+                                      grpc_call_element* elem,
+                                      grpc_polling_entity* pollent);
 };
 
 namespace internal {
@@ -280,70 +279,70 @@
  public:
   static const size_t channel_data_size = sizeof(ChannelDataType);
 
-  static grpc_error *InitChannelElement(grpc_exec_ctx *exec_ctx,
-                                        grpc_channel_element *elem,
-                                        grpc_channel_element_args *args) {
+  static grpc_error* InitChannelElement(grpc_exec_ctx* exec_ctx,
+                                        grpc_channel_element* elem,
+                                        grpc_channel_element_args* args) {
     // Construct the object in the already-allocated memory.
-    ChannelDataType *channel_data = new (elem->channel_data) ChannelDataType();
+    ChannelDataType* channel_data = new (elem->channel_data) ChannelDataType();
     return channel_data->Init(exec_ctx, elem, args);
   }
 
-  static void DestroyChannelElement(grpc_exec_ctx *exec_ctx,
-                                    grpc_channel_element *elem) {
-    ChannelDataType *channel_data =
-        reinterpret_cast<ChannelDataType *>(elem->channel_data);
+  static void DestroyChannelElement(grpc_exec_ctx* exec_ctx,
+                                    grpc_channel_element* elem) {
+    ChannelDataType* channel_data =
+        reinterpret_cast<ChannelDataType*>(elem->channel_data);
     channel_data->Destroy(exec_ctx, elem);
     channel_data->~ChannelDataType();
   }
 
-  static void StartTransportOp(grpc_exec_ctx *exec_ctx,
-                               grpc_channel_element *elem,
-                               grpc_transport_op *op) {
-    ChannelDataType *channel_data =
-        reinterpret_cast<ChannelDataType *>(elem->channel_data);
+  static void StartTransportOp(grpc_exec_ctx* exec_ctx,
+                               grpc_channel_element* elem,
+                               grpc_transport_op* op) {
+    ChannelDataType* channel_data =
+        reinterpret_cast<ChannelDataType*>(elem->channel_data);
     TransportOp op_wrapper(op);
     channel_data->StartTransportOp(exec_ctx, elem, &op_wrapper);
   }
 
-  static void GetChannelInfo(grpc_exec_ctx *exec_ctx,
-                             grpc_channel_element *elem,
-                             const grpc_channel_info *channel_info) {
-    ChannelDataType *channel_data =
-        reinterpret_cast<ChannelDataType *>(elem->channel_data);
+  static void GetChannelInfo(grpc_exec_ctx* exec_ctx,
+                             grpc_channel_element* elem,
+                             const grpc_channel_info* channel_info) {
+    ChannelDataType* channel_data =
+        reinterpret_cast<ChannelDataType*>(elem->channel_data);
     channel_data->GetInfo(exec_ctx, elem, channel_info);
   }
 
   static const size_t call_data_size = sizeof(CallDataType);
 
-  static grpc_error *InitCallElement(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_element *elem,
-                                     const grpc_call_element_args *args) {
+  static grpc_error* InitCallElement(grpc_exec_ctx* exec_ctx,
+                                     grpc_call_element* elem,
+                                     const grpc_call_element_args* args) {
     // Construct the object in the already-allocated memory.
-    CallDataType *call_data = new (elem->call_data) CallDataType();
+    CallDataType* call_data = new (elem->call_data) CallDataType();
     return call_data->Init(exec_ctx, elem, args);
   }
 
-  static void DestroyCallElement(grpc_exec_ctx *exec_ctx,
-                                 grpc_call_element *elem,
-                                 const grpc_call_final_info *final_info,
-                                 grpc_closure *then_call_closure) {
-    CallDataType *call_data = reinterpret_cast<CallDataType *>(elem->call_data);
+  static void DestroyCallElement(grpc_exec_ctx* exec_ctx,
+                                 grpc_call_element* elem,
+                                 const grpc_call_final_info* final_info,
+                                 grpc_closure* then_call_closure) {
+    CallDataType* call_data = reinterpret_cast<CallDataType*>(elem->call_data);
     call_data->Destroy(exec_ctx, elem, final_info, then_call_closure);
     call_data->~CallDataType();
   }
 
-  static void StartTransportStreamOpBatch(grpc_exec_ctx *exec_ctx,
-                                          grpc_call_element *elem,
-                                          grpc_transport_stream_op_batch *op) {
-    CallDataType *call_data = reinterpret_cast<CallDataType *>(elem->call_data);
+  static void StartTransportStreamOpBatch(grpc_exec_ctx* exec_ctx,
+                                          grpc_call_element* elem,
+                                          grpc_transport_stream_op_batch* op) {
+    CallDataType* call_data = reinterpret_cast<CallDataType*>(elem->call_data);
     TransportStreamOpBatch op_wrapper(op);
     call_data->StartTransportStreamOpBatch(exec_ctx, elem, &op_wrapper);
   }
 
-  static void SetPollsetOrPollsetSet(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_element *elem,
-                                     grpc_polling_entity *pollent) {
-    CallDataType *call_data = reinterpret_cast<CallDataType *>(elem->call_data);
+  static void SetPollsetOrPollsetSet(grpc_exec_ctx* exec_ctx,
+                                     grpc_call_element* elem,
+                                     grpc_polling_entity* pollent) {
+    CallDataType* call_data = reinterpret_cast<CallDataType*>(elem->call_data);
     call_data->SetPollsetOrPollsetSet(exec_ctx, elem, pollent);
   }
 };
@@ -351,10 +350,10 @@
 struct FilterRecord {
   grpc_channel_stack_type stack_type;
   int priority;
-  std::function<bool(const grpc_channel_args &)> include_filter;
+  std::function<bool(const grpc_channel_args&)> include_filter;
   grpc_channel_filter filter;
 };
-extern std::vector<FilterRecord> *channel_filters;
+extern std::vector<FilterRecord>* channel_filters;
 
 void ChannelFilterPluginInit();
 void ChannelFilterPluginShutdown();
@@ -368,8 +367,8 @@
 /// value is nullptr, the filter will be added unconditionally.
 template <typename ChannelDataType, typename CallDataType>
 void RegisterChannelFilter(
-    const char *name, grpc_channel_stack_type stack_type, int priority,
-    std::function<bool(const grpc_channel_args &)> include_filter) {
+    const char* name, grpc_channel_stack_type stack_type, int priority,
+    std::function<bool(const grpc_channel_args&)> include_filter) {
   // If we haven't been called before, initialize channel_filters and
   // call grpc_register_plugin().
   if (internal::channel_filters == nullptr) {
diff --git a/src/cpp/common/completion_queue_cc.cc b/src/cpp/common/completion_queue_cc.cc
index f34b0f3..eb6dc8c 100644
--- a/src/cpp/common/completion_queue_cc.cc
+++ b/src/cpp/common/completion_queue_cc.cc
@@ -60,7 +60,7 @@
       case GRPC_QUEUE_SHUTDOWN:
         return SHUTDOWN;
       case GRPC_OP_COMPLETE:
-        auto cq_tag = static_cast<CompletionQueueTag*>(ev.tag);
+        auto cq_tag = static_cast<internal::CompletionQueueTag*>(ev.tag);
         *ok = ev.success != 0;
         *tag = cq_tag;
         if (cq_tag->FinalizeResult(tag, ok)) {
@@ -71,4 +71,29 @@
   }
 }
 
+CompletionQueue::CompletionQueueTLSCache::CompletionQueueTLSCache(
+    CompletionQueue* cq)
+    : cq_(cq), flushed_(false) {
+  grpc_completion_queue_thread_local_cache_init(cq_->cq_);
+}
+
+CompletionQueue::CompletionQueueTLSCache::~CompletionQueueTLSCache() {
+  GPR_ASSERT(flushed_);
+}
+
+bool CompletionQueue::CompletionQueueTLSCache::Flush(void** tag, bool* ok) {
+  int res = 0;
+  void* res_tag;
+  flushed_ = true;
+  if (grpc_completion_queue_thread_local_cache_flush(cq_->cq_, &res_tag,
+                                                     &res)) {
+    auto cq_tag = static_cast<internal::CompletionQueueTag*>(res_tag);
+    *ok = res == 1;
+    if (cq_tag->FinalizeResult(tag, ok)) {
+      return true;
+    }
+  }
+  return false;
+}
+
 }  // namespace grpc
diff --git a/src/cpp/common/core_codegen.cc b/src/cpp/common/core_codegen.cc
index 6ea5f1d..3cbf08a 100644
--- a/src/cpp/common/core_codegen.cc
+++ b/src/cpp/common/core_codegen.cc
@@ -76,6 +76,9 @@
 
 void CoreCodegen::gpr_free(void* p) { return ::gpr_free(p); }
 
+void CoreCodegen::grpc_init() { ::grpc_init(); }
+void CoreCodegen::grpc_shutdown() { ::grpc_shutdown(); }
+
 void CoreCodegen::gpr_mu_init(gpr_mu* mu) { ::gpr_mu_init(mu); };
 void CoreCodegen::gpr_mu_destroy(gpr_mu* mu) { ::gpr_mu_destroy(mu); }
 void CoreCodegen::gpr_mu_lock(gpr_mu* mu) { ::gpr_mu_lock(mu); }
@@ -156,6 +159,10 @@
   return ::grpc_slice_split_head(s, split);
 }
 
+grpc_slice CoreCodegen::grpc_slice_sub(grpc_slice s, size_t begin, size_t end) {
+  return ::grpc_slice_sub(s, begin, end);
+}
+
 grpc_slice CoreCodegen::grpc_slice_from_static_buffer(const void* buffer,
                                                       size_t length) {
   return ::grpc_slice_from_static_buffer(buffer, length);
diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc
index 8049cbe..e1e5e89 100644
--- a/src/cpp/common/version_cc.cc
+++ b/src/cpp/common/version_cc.cc
@@ -23,4 +23,4 @@
 
 namespace grpc {
 grpc::string Version() { return "1.8.0-dev"; }
-}
+}  // namespace grpc
diff --git a/src/cpp/ext/proto_server_reflection.cc b/src/cpp/ext/proto_server_reflection.cc
index ac08ce5..e612211 100644
--- a/src/cpp/ext/proto_server_reflection.cc
+++ b/src/cpp/ext/proto_server_reflection.cc
@@ -25,14 +25,14 @@
 
 using grpc::Status;
 using grpc::StatusCode;
-using grpc::reflection::v1alpha::ServerReflectionRequest;
-using grpc::reflection::v1alpha::ExtensionRequest;
-using grpc::reflection::v1alpha::ServerReflectionResponse;
-using grpc::reflection::v1alpha::ListServiceResponse;
-using grpc::reflection::v1alpha::ServiceResponse;
-using grpc::reflection::v1alpha::ExtensionNumberResponse;
 using grpc::reflection::v1alpha::ErrorResponse;
+using grpc::reflection::v1alpha::ExtensionNumberResponse;
+using grpc::reflection::v1alpha::ExtensionRequest;
 using grpc::reflection::v1alpha::FileDescriptorResponse;
+using grpc::reflection::v1alpha::ListServiceResponse;
+using grpc::reflection::v1alpha::ServerReflectionRequest;
+using grpc::reflection::v1alpha::ServerReflectionResponse;
+using grpc::reflection::v1alpha::ServiceResponse;
 
 namespace grpc {
 
diff --git a/src/cpp/server/channel_argument_option.cc b/src/cpp/server/channel_argument_option.cc
index 0d3a0dc..dcad253 100644
--- a/src/cpp/server/channel_argument_option.cc
+++ b/src/cpp/server/channel_argument_option.cc
@@ -21,17 +21,17 @@
 namespace grpc {
 
 std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
-    const grpc::string &name, const grpc::string &value) {
+    const grpc::string& name, const grpc::string& value) {
   class StringOption final : public ServerBuilderOption {
    public:
-    StringOption(const grpc::string &name, const grpc::string &value)
+    StringOption(const grpc::string& name, const grpc::string& value)
         : name_(name), value_(value) {}
 
-    virtual void UpdateArguments(ChannelArguments *args) override {
+    virtual void UpdateArguments(ChannelArguments* args) override {
       args->SetString(name_, value_);
     }
     virtual void UpdatePlugins(
-        std::vector<std::unique_ptr<ServerBuilderPlugin>> *plugins) override {}
+        std::vector<std::unique_ptr<ServerBuilderPlugin>>* plugins) override {}
 
    private:
     const grpc::string name_;
@@ -41,17 +41,17 @@
 }
 
 std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
-    const grpc::string &name, int value) {
+    const grpc::string& name, int value) {
   class IntOption final : public ServerBuilderOption {
    public:
-    IntOption(const grpc::string &name, int value)
+    IntOption(const grpc::string& name, int value)
         : name_(name), value_(value) {}
 
-    virtual void UpdateArguments(ChannelArguments *args) override {
+    virtual void UpdateArguments(ChannelArguments* args) override {
       args->SetInt(name_, value_);
     }
     virtual void UpdatePlugins(
-        std::vector<std::unique_ptr<ServerBuilderPlugin>> *plugins) override {}
+        std::vector<std::unique_ptr<ServerBuilderPlugin>>* plugins) override {}
 
    private:
     const grpc::string name_;
diff --git a/src/cpp/server/health/default_health_check_service.cc b/src/cpp/server/health/default_health_check_service.cc
index d2cba6d..10dbd3c 100644
--- a/src/cpp/server/health/default_health_check_service.cc
+++ b/src/cpp/server/health/default_health_check_service.cc
@@ -37,11 +37,12 @@
 DefaultHealthCheckService::HealthCheckServiceImpl::HealthCheckServiceImpl(
     DefaultHealthCheckService* service)
     : service_(service), method_(nullptr) {
-  MethodHandler* handler =
-      new RpcMethodHandler<HealthCheckServiceImpl, ByteBuffer, ByteBuffer>(
+  internal::MethodHandler* handler =
+      new internal::RpcMethodHandler<HealthCheckServiceImpl, ByteBuffer,
+                                     ByteBuffer>(
           std::mem_fn(&HealthCheckServiceImpl::Check), this);
-  method_ = new RpcServiceMethod(kHealthCheckMethodName, RpcMethod::NORMAL_RPC,
-                                 handler);
+  method_ = new internal::RpcServiceMethod(
+      kHealthCheckMethodName, internal::RpcMethod::NORMAL_RPC, handler);
   AddMethod(method_);
 }
 
diff --git a/src/cpp/server/health/default_health_check_service.h b/src/cpp/server/health/default_health_check_service.h
index 09d5ceb..99d6680 100644
--- a/src/cpp/server/health/default_health_check_service.h
+++ b/src/cpp/server/health/default_health_check_service.h
@@ -41,7 +41,7 @@
 
    private:
     const DefaultHealthCheckService* const service_;
-    RpcServiceMethod* method_;
+    internal::RpcServiceMethod* method_;
   };
 
   DefaultHealthCheckService();
diff --git a/src/cpp/server/health/health_check_service.cc b/src/cpp/server/health/health_check_service.cc
index 14c83e7..a34b533 100644
--- a/src/cpp/server/health/health_check_service.cc
+++ b/src/cpp/server/health/health_check_service.cc
@@ -21,7 +21,7 @@
 namespace grpc {
 namespace {
 bool g_grpc_default_health_check_service_enabled = false;
-}  // namesapce
+}  // namespace
 
 bool DefaultHealthCheckServiceEnabled() {
   return g_grpc_default_health_check_service_enabled;
diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc
index d982a3d..6480482 100644
--- a/src/cpp/server/server_cc.cc
+++ b/src/cpp/server/server_cc.cc
@@ -90,7 +90,8 @@
   ServerCompletionQueue* const cq_;
 };
 
-typedef SneakyCallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus>
+typedef internal::SneakyCallOpSet<internal::CallOpSendInitialMetadata,
+                                  internal::CallOpServerSendStatus>
     UnimplementedAsyncResponseOp;
 class Server::UnimplementedAsyncResponse final
     : public UnimplementedAsyncResponseOp {
@@ -108,12 +109,12 @@
   UnimplementedAsyncRequest* const request_;
 };
 
-class ShutdownTag : public CompletionQueueTag {
+class ShutdownTag : public internal::CompletionQueueTag {
  public:
   bool FinalizeResult(void** tag, bool* status) { return false; }
 };
 
-class DummyTag : public CompletionQueueTag {
+class DummyTag : public internal::CompletionQueueTag {
  public:
   bool FinalizeResult(void** tag, bool* status) {
     *status = true;
@@ -121,15 +122,15 @@
   }
 };
 
-class Server::SyncRequest final : public CompletionQueueTag {
+class Server::SyncRequest final : public internal::CompletionQueueTag {
  public:
-  SyncRequest(RpcServiceMethod* method, void* tag)
+  SyncRequest(internal::RpcServiceMethod* method, void* tag)
       : method_(method),
         tag_(tag),
         in_flight_(false),
-        has_request_payload_(method->method_type() == RpcMethod::NORMAL_RPC ||
-                             method->method_type() ==
-                                 RpcMethod::SERVER_STREAMING),
+        has_request_payload_(
+            method->method_type() == internal::RpcMethod::NORMAL_RPC ||
+            method->method_type() == internal::RpcMethod::SERVER_STREAMING),
         call_details_(nullptr),
         cq_(nullptr) {
     grpc_metadata_array_init(&request_metadata_);
@@ -212,14 +213,14 @@
     void Run(std::shared_ptr<GlobalCallbacks> global_callbacks) {
       ctx_.BeginCompletionOp(&call_);
       global_callbacks->PreSynchronousRequest(&ctx_);
-      method_->handler()->RunHandler(
-          MethodHandler::HandlerParameter(&call_, &ctx_, request_payload_));
+      method_->handler()->RunHandler(internal::MethodHandler::HandlerParameter(
+          &call_, &ctx_, request_payload_));
       global_callbacks->PostSynchronousRequest(&ctx_);
       request_payload_ = nullptr;
 
       cq_.Shutdown();
 
-      CompletionQueueTag* op_tag = ctx_.GetCompletionOpTag();
+      internal::CompletionQueueTag* op_tag = ctx_.GetCompletionOpTag();
       cq_.TryPluck(op_tag, gpr_inf_future(GPR_CLOCK_REALTIME));
 
       /* Ensure the cq_ is shutdown */
@@ -229,15 +230,15 @@
 
    private:
     CompletionQueue cq_;
-    Call call_;
+    internal::Call call_;
     ServerContext ctx_;
     const bool has_request_payload_;
     grpc_byte_buffer* request_payload_;
-    RpcServiceMethod* const method_;
+    internal::RpcServiceMethod* const method_;
   };
 
  private:
-  RpcServiceMethod* const method_;
+  internal::RpcServiceMethod* const method_;
   void* const tag_;
   bool in_flight_;
   const bool has_request_payload_;
@@ -311,14 +312,15 @@
     // object
   }
 
-  void AddSyncMethod(RpcServiceMethod* method, void* tag) {
+  void AddSyncMethod(internal::RpcServiceMethod* method, void* tag) {
     sync_requests_.emplace_back(new SyncRequest(method, tag));
   }
 
   void AddUnknownSyncMethod() {
     if (!sync_requests_.empty()) {
-      unknown_method_.reset(new RpcServiceMethod(
-          "unknown", RpcMethod::BIDI_STREAMING, new UnknownMethodHandler));
+      unknown_method_.reset(new internal::RpcServiceMethod(
+          "unknown", internal::RpcMethod::BIDI_STREAMING,
+          new internal::UnknownMethodHandler));
       sync_requests_.emplace_back(
           new SyncRequest(unknown_method_.get(), nullptr));
     }
@@ -355,8 +357,8 @@
   CompletionQueue* server_cq_;
   int cq_timeout_msec_;
   std::vector<std::unique_ptr<SyncRequest>> sync_requests_;
-  std::unique_ptr<RpcServiceMethod> unknown_method_;
-  std::unique_ptr<RpcServiceMethod> health_check_;
+  std::unique_ptr<internal::RpcServiceMethod> unknown_method_;
+  std::unique_ptr<internal::RpcServiceMethod> health_check_;
   std::shared_ptr<Server::GlobalCallbacks> global_callbacks_;
 };
 
@@ -439,13 +441,13 @@
 }
 
 static grpc_server_register_method_payload_handling PayloadHandlingForMethod(
-    RpcServiceMethod* method) {
+    internal::RpcServiceMethod* method) {
   switch (method->method_type()) {
-    case RpcMethod::NORMAL_RPC:
-    case RpcMethod::SERVER_STREAMING:
+    case internal::RpcMethod::NORMAL_RPC:
+    case internal::RpcMethod::SERVER_STREAMING:
       return GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER;
-    case RpcMethod::CLIENT_STREAMING:
-    case RpcMethod::BIDI_STREAMING:
+    case internal::RpcMethod::CLIENT_STREAMING:
+    case internal::RpcMethod::BIDI_STREAMING:
       return GRPC_SRM_PAYLOAD_NONE;
   }
   GPR_UNREACHABLE_CODE(return GRPC_SRM_PAYLOAD_NONE;);
@@ -466,7 +468,7 @@
       continue;
     }
 
-    RpcServiceMethod* method = it->get();
+    internal::RpcServiceMethod* method = it->get();
     void* tag = grpc_server_register_method(
         server_, method->name(), host ? host->c_str() : nullptr,
         PayloadHandlingForMethod(method), 0);
@@ -606,7 +608,8 @@
   }
 }
 
-void Server::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) {
+void Server::PerformOpsOnCall(internal::CallOpSetInterface* ops,
+                              internal::Call* call) {
   static const size_t MAX_OPS = 8;
   size_t nops = 0;
   grpc_op cops[MAX_OPS];
@@ -622,8 +625,8 @@
 
 ServerInterface::BaseAsyncRequest::BaseAsyncRequest(
     ServerInterface* server, ServerContext* context,
-    ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq, void* tag,
-    bool delete_on_finalize)
+    internal::ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
+    void* tag, bool delete_on_finalize)
     : server_(server),
       context_(context),
       stream_(stream),
@@ -645,7 +648,8 @@
   }
   context_->set_call(call_);
   context_->cq_ = call_cq_;
-  Call call(call_, server_, call_cq_, server_->max_receive_message_size());
+  internal::Call call(call_, server_, call_cq_,
+                      server_->max_receive_message_size());
   if (*status && call_) {
     context_->BeginCompletionOp(&call);
   }
@@ -660,7 +664,8 @@
 
 ServerInterface::RegisteredAsyncRequest::RegisteredAsyncRequest(
     ServerInterface* server, ServerContext* context,
-    ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq, void* tag)
+    internal::ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
+    void* tag)
     : BaseAsyncRequest(server, context, stream, call_cq, tag, true) {}
 
 void ServerInterface::RegisteredAsyncRequest::IssueRequest(
@@ -675,7 +680,7 @@
 
 ServerInterface::GenericAsyncRequest::GenericAsyncRequest(
     ServerInterface* server, GenericServerContext* context,
-    ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
+    internal::ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
     ServerCompletionQueue* notification_cq, void* tag, bool delete_on_finalize)
     : BaseAsyncRequest(server, context, stream, call_cq, tag,
                        delete_on_finalize) {
@@ -718,7 +723,7 @@
     UnimplementedAsyncRequest* request)
     : request_(request) {
   Status status(StatusCode::UNIMPLEMENTED, "");
-  UnknownMethodHandler::FillOps(request_->context(), this);
+  internal::UnknownMethodHandler::FillOps(request_->context(), this);
   request_->stream()->call_.PerformOps(this);
 }
 
diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc
index d7876a0..f2cb636 100644
--- a/src/cpp/server/server_context.cc
+++ b/src/cpp/server/server_context.cc
@@ -37,7 +37,7 @@
 
 // CompletionOp
 
-class ServerContext::CompletionOp final : public CallOpSetInterface {
+class ServerContext::CompletionOp final : public internal::CallOpSetInterface {
  public:
   // initial refs: one in the server context, one in the cq
   CompletionOp()
@@ -146,7 +146,7 @@
   }
 }
 
-void ServerContext::BeginCompletionOp(Call* call) {
+void ServerContext::BeginCompletionOp(internal::Call* call) {
   GPR_ASSERT(!completion_op_);
   completion_op_ = new CompletionOp();
   if (has_notify_when_done_tag_) {
@@ -155,8 +155,8 @@
   call->PerformOps(completion_op_);
 }
 
-CompletionQueueTag* ServerContext::GetCompletionOpTag() {
-  return static_cast<CompletionQueueTag*>(completion_op_);
+internal::CompletionQueueTag* ServerContext::GetCompletionOpTag() {
+  return static_cast<internal::CompletionQueueTag*>(completion_op_);
 }
 
 void ServerContext::AddInitialMetadata(const grpc::string& key,
diff --git a/src/cpp/util/error_details.cc b/src/cpp/util/error_details.cc
index 44bc4d1..f06b475 100644
--- a/src/cpp/util/error_details.cc
+++ b/src/cpp/util/error_details.cc
@@ -37,7 +37,8 @@
     return Status(StatusCode::FAILED_PRECONDITION, "");
   }
   StatusCode code = StatusCode::UNKNOWN;
-  if (from.code() >= StatusCode::OK && from.code() <= StatusCode::DATA_LOSS) {
+  if (from.code() >= StatusCode::OK &&
+      from.code() <= StatusCode::UNAUTHENTICATED) {
     code = static_cast<StatusCode>(from.code());
   }
   *to = Status(code, from.message(), from.SerializeAsString());
diff --git a/src/cpp/util/time_cc.cc b/src/cpp/util/time_cc.cc
index 1c658b0..3b6e075 100644
--- a/src/cpp/util/time_cc.cc
+++ b/src/cpp/util/time_cc.cc
@@ -21,10 +21,10 @@
 #include <grpc/support/time.h>
 
 using std::chrono::duration_cast;
+using std::chrono::high_resolution_clock;
 using std::chrono::nanoseconds;
 using std::chrono::seconds;
 using std::chrono::system_clock;
-using std::chrono::high_resolution_clock;
 
 namespace grpc {
 
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c
index 92291f9..bcb3bfa 100644
--- a/src/csharp/ext/grpc_csharp_ext.c
+++ b/src/csharp/ext/grpc_csharp_ext.c
@@ -43,9 +43,9 @@
 #define GPR_CALLTYPE
 #endif
 
-grpc_byte_buffer *string_to_byte_buffer(const char *buffer, size_t len) {
+grpc_byte_buffer* string_to_byte_buffer(const char* buffer, size_t len) {
   grpc_slice slice = grpc_slice_from_copied_buffer(buffer, len);
-  grpc_byte_buffer *bb = grpc_raw_byte_buffer_create(&slice, 1);
+  grpc_byte_buffer* bb = grpc_raw_byte_buffer_create(&slice, 1);
   grpc_slice_unref(slice);
   return bb;
 }
@@ -55,12 +55,12 @@
  */
 typedef struct grpcsharp_batch_context {
   grpc_metadata_array send_initial_metadata;
-  grpc_byte_buffer *send_message;
+  grpc_byte_buffer* send_message;
   struct {
     grpc_metadata_array trailing_metadata;
   } send_status_from_server;
   grpc_metadata_array recv_initial_metadata;
-  grpc_byte_buffer *recv_message;
+  grpc_byte_buffer* recv_message;
   struct {
     grpc_metadata_array trailing_metadata;
     grpc_status_code status;
@@ -69,22 +69,22 @@
   int recv_close_on_server_cancelled;
 } grpcsharp_batch_context;
 
-GPR_EXPORT grpcsharp_batch_context *GPR_CALLTYPE
+GPR_EXPORT grpcsharp_batch_context* GPR_CALLTYPE
 grpcsharp_batch_context_create() {
-  grpcsharp_batch_context *ctx = gpr_malloc(sizeof(grpcsharp_batch_context));
+  grpcsharp_batch_context* ctx = gpr_malloc(sizeof(grpcsharp_batch_context));
   memset(ctx, 0, sizeof(grpcsharp_batch_context));
   return ctx;
 }
 
 typedef struct {
-  grpc_call *call;
+  grpc_call* call;
   grpc_call_details call_details;
   grpc_metadata_array request_metadata;
 } grpcsharp_request_call_context;
 
-GPR_EXPORT grpcsharp_request_call_context *GPR_CALLTYPE
+GPR_EXPORT grpcsharp_request_call_context* GPR_CALLTYPE
 grpcsharp_request_call_context_create() {
-  grpcsharp_request_call_context *ctx =
+  grpcsharp_request_call_context* ctx =
       gpr_malloc(sizeof(grpcsharp_request_call_context));
   memset(ctx, 0, sizeof(grpcsharp_request_call_context));
   return ctx;
@@ -95,7 +95,7 @@
  * The array pointer itself is not freed.
  */
 void grpcsharp_metadata_array_destroy_metadata_only(
-    grpc_metadata_array *array) {
+    grpc_metadata_array* array) {
   gpr_free(array->metadata);
 }
 
@@ -104,7 +104,7 @@
  * The array pointer itself is not freed.
  */
 void grpcsharp_metadata_array_destroy_metadata_including_entries(
-    grpc_metadata_array *array) {
+    grpc_metadata_array* array) {
   size_t i;
   if (array->metadata) {
     for (i = 0; i < array->count; i++) {
@@ -119,7 +119,7 @@
  * Fully destroys the metadata array.
  */
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_metadata_array_destroy_full(grpc_metadata_array *array) {
+grpcsharp_metadata_array_destroy_full(grpc_metadata_array* array) {
   if (!array) {
     return;
   }
@@ -131,16 +131,16 @@
  * Creates an empty metadata array with given capacity.
  * Array can later be destroyed by grpc_metadata_array_destroy_full.
  */
-GPR_EXPORT grpc_metadata_array *GPR_CALLTYPE
+GPR_EXPORT grpc_metadata_array* GPR_CALLTYPE
 grpcsharp_metadata_array_create(size_t capacity) {
-  grpc_metadata_array *array =
-      (grpc_metadata_array *)gpr_malloc(sizeof(grpc_metadata_array));
+  grpc_metadata_array* array =
+      (grpc_metadata_array*)gpr_malloc(sizeof(grpc_metadata_array));
   grpc_metadata_array_init(array);
   array->capacity = capacity;
   array->count = 0;
   if (capacity > 0) {
     array->metadata =
-        (grpc_metadata *)gpr_malloc(sizeof(grpc_metadata) * capacity);
+        (grpc_metadata*)gpr_malloc(sizeof(grpc_metadata) * capacity);
     memset(array->metadata, 0, sizeof(grpc_metadata) * capacity);
   } else {
     array->metadata = NULL;
@@ -149,8 +149,8 @@
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_metadata_array_add(grpc_metadata_array *array, const char *key,
-                             const char *value, size_t value_length) {
+grpcsharp_metadata_array_add(grpc_metadata_array* array, const char* key,
+                             const char* value, size_t value_length) {
   size_t i = array->count;
   GPR_ASSERT(array->count < array->capacity);
   array->metadata[i].key = grpc_slice_from_copied_string(key);
@@ -159,27 +159,27 @@
 }
 
 GPR_EXPORT intptr_t GPR_CALLTYPE
-grpcsharp_metadata_array_count(grpc_metadata_array *array) {
+grpcsharp_metadata_array_count(grpc_metadata_array* array) {
   return (intptr_t)array->count;
 }
 
-GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_metadata_array_get_key(
-    grpc_metadata_array *array, size_t index, size_t *key_length) {
+GPR_EXPORT const char* GPR_CALLTYPE grpcsharp_metadata_array_get_key(
+    grpc_metadata_array* array, size_t index, size_t* key_length) {
   GPR_ASSERT(index < array->count);
   *key_length = GRPC_SLICE_LENGTH(array->metadata[index].key);
-  return (char *)GRPC_SLICE_START_PTR(array->metadata[index].key);
+  return (char*)GRPC_SLICE_START_PTR(array->metadata[index].key);
 }
 
-GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_metadata_array_get_value(
-    grpc_metadata_array *array, size_t index, size_t *value_length) {
+GPR_EXPORT const char* GPR_CALLTYPE grpcsharp_metadata_array_get_value(
+    grpc_metadata_array* array, size_t index, size_t* value_length) {
   GPR_ASSERT(index < array->count);
   *value_length = GRPC_SLICE_LENGTH(array->metadata[index].value);
-  return (char *)GRPC_SLICE_START_PTR(array->metadata[index].value);
+  return (char*)GRPC_SLICE_START_PTR(array->metadata[index].value);
 }
 
 /* Move contents of metadata array */
-void grpcsharp_metadata_array_move(grpc_metadata_array *dest,
-                                   grpc_metadata_array *src) {
+void grpcsharp_metadata_array_move(grpc_metadata_array* dest,
+                                   grpc_metadata_array* src) {
   if (!src) {
     dest->capacity = 0;
     dest->count = 0;
@@ -197,7 +197,7 @@
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_batch_context_destroy(grpcsharp_batch_context *ctx) {
+grpcsharp_batch_context_destroy(grpcsharp_batch_context* ctx) {
   if (!ctx) {
     return;
   }
@@ -221,7 +221,7 @@
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_request_call_context_destroy(grpcsharp_request_call_context *ctx) {
+grpcsharp_request_call_context_destroy(grpcsharp_request_call_context* ctx) {
   if (!ctx) {
     return;
   }
@@ -235,14 +235,14 @@
   gpr_free(ctx);
 }
 
-GPR_EXPORT const grpc_metadata_array *GPR_CALLTYPE
+GPR_EXPORT const grpc_metadata_array* GPR_CALLTYPE
 grpcsharp_batch_context_recv_initial_metadata(
-    const grpcsharp_batch_context *ctx) {
+    const grpcsharp_batch_context* ctx) {
   return &(ctx->recv_initial_metadata);
 }
 
 GPR_EXPORT intptr_t GPR_CALLTYPE grpcsharp_batch_context_recv_message_length(
-    const grpcsharp_batch_context *ctx) {
+    const grpcsharp_batch_context* ctx) {
   grpc_byte_buffer_reader reader;
   if (!ctx->recv_message) {
     return -1;
@@ -260,7 +260,7 @@
  * buffer is too small.
  */
 GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_recv_message_to_buffer(
-    const grpcsharp_batch_context *ctx, char *buffer, size_t buffer_len) {
+    const grpcsharp_batch_context* ctx, char* buffer, size_t buffer_len) {
   grpc_byte_buffer_reader reader;
   grpc_slice slice;
   size_t offset = 0;
@@ -281,56 +281,55 @@
 
 GPR_EXPORT grpc_status_code GPR_CALLTYPE
 grpcsharp_batch_context_recv_status_on_client_status(
-    const grpcsharp_batch_context *ctx) {
+    const grpcsharp_batch_context* ctx) {
   return ctx->recv_status_on_client.status;
 }
 
-GPR_EXPORT const char *GPR_CALLTYPE
+GPR_EXPORT const char* GPR_CALLTYPE
 grpcsharp_batch_context_recv_status_on_client_details(
-    const grpcsharp_batch_context *ctx, size_t *details_length) {
+    const grpcsharp_batch_context* ctx, size_t* details_length) {
   *details_length =
       GRPC_SLICE_LENGTH(ctx->recv_status_on_client.status_details);
-  return (char *)GRPC_SLICE_START_PTR(
-      ctx->recv_status_on_client.status_details);
+  return (char*)GRPC_SLICE_START_PTR(ctx->recv_status_on_client.status_details);
 }
 
-GPR_EXPORT const grpc_metadata_array *GPR_CALLTYPE
+GPR_EXPORT const grpc_metadata_array* GPR_CALLTYPE
 grpcsharp_batch_context_recv_status_on_client_trailing_metadata(
-    const grpcsharp_batch_context *ctx) {
+    const grpcsharp_batch_context* ctx) {
   return &(ctx->recv_status_on_client.trailing_metadata);
 }
 
-GPR_EXPORT grpc_call *GPR_CALLTYPE
-grpcsharp_request_call_context_call(const grpcsharp_request_call_context *ctx) {
+GPR_EXPORT grpc_call* GPR_CALLTYPE
+grpcsharp_request_call_context_call(const grpcsharp_request_call_context* ctx) {
   return ctx->call;
 }
 
-GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_request_call_context_method(
-    const grpcsharp_request_call_context *ctx, size_t *method_length) {
+GPR_EXPORT const char* GPR_CALLTYPE grpcsharp_request_call_context_method(
+    const grpcsharp_request_call_context* ctx, size_t* method_length) {
   *method_length = GRPC_SLICE_LENGTH(ctx->call_details.method);
-  return (char *)GRPC_SLICE_START_PTR(ctx->call_details.method);
+  return (char*)GRPC_SLICE_START_PTR(ctx->call_details.method);
 }
 
-GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_request_call_context_host(
-    const grpcsharp_request_call_context *ctx, size_t *host_length) {
+GPR_EXPORT const char* GPR_CALLTYPE grpcsharp_request_call_context_host(
+    const grpcsharp_request_call_context* ctx, size_t* host_length) {
   *host_length = GRPC_SLICE_LENGTH(ctx->call_details.host);
-  return (char *)GRPC_SLICE_START_PTR(ctx->call_details.host);
+  return (char*)GRPC_SLICE_START_PTR(ctx->call_details.host);
 }
 
 GPR_EXPORT gpr_timespec GPR_CALLTYPE grpcsharp_request_call_context_deadline(
-    const grpcsharp_request_call_context *ctx) {
+    const grpcsharp_request_call_context* ctx) {
   return ctx->call_details.deadline;
 }
 
-GPR_EXPORT const grpc_metadata_array *GPR_CALLTYPE
+GPR_EXPORT const grpc_metadata_array* GPR_CALLTYPE
 grpcsharp_request_call_context_request_metadata(
-    const grpcsharp_request_call_context *ctx) {
+    const grpcsharp_request_call_context* ctx) {
   return &(ctx->request_metadata);
 }
 
 GPR_EXPORT int32_t GPR_CALLTYPE
 grpcsharp_batch_context_recv_close_on_server_cancelled(
-    const grpcsharp_batch_context *ctx) {
+    const grpcsharp_batch_context* ctx) {
   return (int32_t)ctx->recv_close_on_server_cancelled;
 }
 
@@ -342,63 +341,63 @@
 
 /* Completion queue */
 
-GPR_EXPORT grpc_completion_queue *GPR_CALLTYPE
+GPR_EXPORT grpc_completion_queue* GPR_CALLTYPE
 grpcsharp_completion_queue_create_async(void) {
   return grpc_completion_queue_create_for_next(NULL);
 }
 
-GPR_EXPORT grpc_completion_queue *GPR_CALLTYPE
+GPR_EXPORT grpc_completion_queue* GPR_CALLTYPE
 grpcsharp_completion_queue_create_sync(void) {
   return grpc_completion_queue_create_for_pluck(NULL);
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_completion_queue_shutdown(grpc_completion_queue *cq) {
+grpcsharp_completion_queue_shutdown(grpc_completion_queue* cq) {
   grpc_completion_queue_shutdown(cq);
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_completion_queue_destroy(grpc_completion_queue *cq) {
+grpcsharp_completion_queue_destroy(grpc_completion_queue* cq) {
   grpc_completion_queue_destroy(cq);
 }
 
 GPR_EXPORT grpc_event GPR_CALLTYPE
-grpcsharp_completion_queue_next(grpc_completion_queue *cq) {
+grpcsharp_completion_queue_next(grpc_completion_queue* cq) {
   return grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME),
                                     NULL);
 }
 
 GPR_EXPORT grpc_event GPR_CALLTYPE
-grpcsharp_completion_queue_pluck(grpc_completion_queue *cq, void *tag) {
+grpcsharp_completion_queue_pluck(grpc_completion_queue* cq, void* tag) {
   return grpc_completion_queue_pluck(cq, tag,
                                      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
 }
 
 /* Channel */
 
-GPR_EXPORT grpc_channel *GPR_CALLTYPE
+GPR_EXPORT grpc_channel* GPR_CALLTYPE
 
-grpcsharp_insecure_channel_create(const char *target,
-                                  const grpc_channel_args *args) {
+grpcsharp_insecure_channel_create(const char* target,
+                                  const grpc_channel_args* args) {
   return grpc_insecure_channel_create(target, args, NULL);
 }
 
-GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_destroy(grpc_channel *channel) {
+GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_destroy(grpc_channel* channel) {
   grpc_channel_destroy(channel);
 }
 
-GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_channel_create_call(
-    grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
-    grpc_completion_queue *cq, const char *method, const char *host,
+GPR_EXPORT grpc_call* GPR_CALLTYPE grpcsharp_channel_create_call(
+    grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
+    grpc_completion_queue* cq, const char* method, const char* host,
     gpr_timespec deadline) {
   grpc_slice method_slice = grpc_slice_from_copied_string(method);
-  grpc_slice *host_slice_ptr = NULL;
+  grpc_slice* host_slice_ptr = NULL;
   grpc_slice host_slice;
   if (host != NULL) {
     host_slice = grpc_slice_from_copied_string(host);
     host_slice_ptr = &host_slice;
   }
-  grpc_call *ret =
+  grpc_call* ret =
       grpc_channel_create_call(channel, parent_call, propagation_mask, cq,
                                method_slice, host_slice_ptr, deadline, NULL);
   grpc_slice_unref(method_slice);
@@ -409,40 +408,40 @@
 }
 
 GPR_EXPORT grpc_connectivity_state GPR_CALLTYPE
-grpcsharp_channel_check_connectivity_state(grpc_channel *channel,
+grpcsharp_channel_check_connectivity_state(grpc_channel* channel,
                                            int32_t try_to_connect) {
   return grpc_channel_check_connectivity_state(channel, try_to_connect);
 }
 
 GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_watch_connectivity_state(
-    grpc_channel *channel, grpc_connectivity_state last_observed_state,
-    gpr_timespec deadline, grpc_completion_queue *cq,
-    grpcsharp_batch_context *ctx) {
+    grpc_channel* channel, grpc_connectivity_state last_observed_state,
+    gpr_timespec deadline, grpc_completion_queue* cq,
+    grpcsharp_batch_context* ctx) {
   grpc_channel_watch_connectivity_state(channel, last_observed_state, deadline,
                                         cq, ctx);
 }
 
-GPR_EXPORT char *GPR_CALLTYPE
-grpcsharp_channel_get_target(grpc_channel *channel) {
+GPR_EXPORT char* GPR_CALLTYPE
+grpcsharp_channel_get_target(grpc_channel* channel) {
   return grpc_channel_get_target(channel);
 }
 
 /* Channel args */
 
-GPR_EXPORT grpc_channel_args *GPR_CALLTYPE
+GPR_EXPORT grpc_channel_args* GPR_CALLTYPE
 grpcsharp_channel_args_create(size_t num_args) {
-  grpc_channel_args *args =
-      (grpc_channel_args *)gpr_malloc(sizeof(grpc_channel_args));
+  grpc_channel_args* args =
+      (grpc_channel_args*)gpr_malloc(sizeof(grpc_channel_args));
   memset(args, 0, sizeof(grpc_channel_args));
 
   args->num_args = num_args;
-  args->args = (grpc_arg *)gpr_malloc(sizeof(grpc_arg) * num_args);
+  args->args = (grpc_arg*)gpr_malloc(sizeof(grpc_arg) * num_args);
   memset(args->args, 0, sizeof(grpc_arg) * num_args);
   return args;
 }
 
 GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_args_set_string(
-    grpc_channel_args *args, size_t index, const char *key, const char *value) {
+    grpc_channel_args* args, size_t index, const char* key, const char* value) {
   GPR_ASSERT(args);
   GPR_ASSERT(index < args->num_args);
   args->args[index].type = GRPC_ARG_STRING;
@@ -451,7 +450,7 @@
 }
 
 GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_args_set_integer(
-    grpc_channel_args *args, size_t index, const char *key, int value) {
+    grpc_channel_args* args, size_t index, const char* key, int value) {
   GPR_ASSERT(args);
   GPR_ASSERT(index < args->num_args);
   args->args[index].type = GRPC_ARG_INTEGER;
@@ -460,7 +459,7 @@
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_channel_args_destroy(grpc_channel_args *args) {
+grpcsharp_channel_args_destroy(grpc_channel_args* args) {
   size_t i;
   if (args) {
     for (i = 0; i < args->num_args; i++) {
@@ -501,61 +500,61 @@
 
 /* Call */
 
-GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_cancel(grpc_call *call) {
+GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_cancel(grpc_call* call) {
   return grpc_call_cancel(call, NULL);
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_cancel_with_status(
-    grpc_call *call, grpc_status_code status, const char *description) {
+    grpc_call* call, grpc_status_code status, const char* description) {
   return grpc_call_cancel_with_status(call, status, description, NULL);
 }
 
-GPR_EXPORT char *GPR_CALLTYPE grpcsharp_call_get_peer(grpc_call *call) {
+GPR_EXPORT char* GPR_CALLTYPE grpcsharp_call_get_peer(grpc_call* call) {
   return grpc_call_get_peer(call);
 }
 
-GPR_EXPORT void GPR_CALLTYPE gprsharp_free(void *p) { gpr_free(p); }
+GPR_EXPORT void GPR_CALLTYPE gprsharp_free(void* p) { gpr_free(p); }
 
-GPR_EXPORT void GPR_CALLTYPE grpcsharp_call_destroy(grpc_call *call) {
+GPR_EXPORT void GPR_CALLTYPE grpcsharp_call_destroy(grpc_call* call) {
   grpc_call_unref(call);
 }
 
-typedef grpc_call_error (*grpcsharp_call_start_batch_func)(grpc_call *call,
-                                                           const grpc_op *ops,
+typedef grpc_call_error (*grpcsharp_call_start_batch_func)(grpc_call* call,
+                                                           const grpc_op* ops,
                                                            size_t nops,
-                                                           void *tag,
-                                                           void *reserved);
+                                                           void* tag,
+                                                           void* reserved);
 
 /* Only for testing */
-static grpc_call_error grpcsharp_call_start_batch_nop(grpc_call *call,
-                                                      const grpc_op *ops,
-                                                      size_t nops, void *tag,
-                                                      void *reserved) {
+static grpc_call_error grpcsharp_call_start_batch_nop(grpc_call* call,
+                                                      const grpc_op* ops,
+                                                      size_t nops, void* tag,
+                                                      void* reserved) {
   return GRPC_CALL_OK;
 }
 
-static grpc_call_error grpcsharp_call_start_batch_default(grpc_call *call,
-                                                          const grpc_op *ops,
+static grpc_call_error grpcsharp_call_start_batch_default(grpc_call* call,
+                                                          const grpc_op* ops,
                                                           size_t nops,
-                                                          void *tag,
-                                                          void *reserved) {
+                                                          void* tag,
+                                                          void* reserved) {
   return grpc_call_start_batch(call, ops, nops, tag, reserved);
 }
 
 static grpcsharp_call_start_batch_func g_call_start_batch_func =
     grpcsharp_call_start_batch_default;
 
-static grpc_call_error grpcsharp_call_start_batch(grpc_call *call,
-                                                  const grpc_op *ops,
-                                                  size_t nops, void *tag,
-                                                  void *reserved) {
+static grpc_call_error grpcsharp_call_start_batch(grpc_call* call,
+                                                  const grpc_op* ops,
+                                                  size_t nops, void* tag,
+                                                  void* reserved) {
   return g_call_start_batch_func(call, ops, nops, tag, reserved);
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_unary(
-    grpc_call *call, grpcsharp_batch_context *ctx, const char *send_buffer,
+    grpc_call* call, grpcsharp_batch_context* ctx, const char* send_buffer,
     size_t send_buffer_len, uint32_t write_flags,
-    grpc_metadata_array *initial_metadata, uint32_t initial_metadata_flags) {
+    grpc_metadata_array* initial_metadata, uint32_t initial_metadata_flags) {
   /* TODO: don't use magic number */
   grpc_op ops[6];
   memset(ops, 0, sizeof(ops));
@@ -604,8 +603,8 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_client_streaming(
-    grpc_call *call, grpcsharp_batch_context *ctx,
-    grpc_metadata_array *initial_metadata, uint32_t initial_metadata_flags) {
+    grpc_call* call, grpcsharp_batch_context* ctx,
+    grpc_metadata_array* initial_metadata, uint32_t initial_metadata_flags) {
   /* TODO: don't use magic number */
   grpc_op ops[4];
   memset(ops, 0, sizeof(ops));
@@ -644,9 +643,9 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_server_streaming(
-    grpc_call *call, grpcsharp_batch_context *ctx, const char *send_buffer,
+    grpc_call* call, grpcsharp_batch_context* ctx, const char* send_buffer,
     size_t send_buffer_len, uint32_t write_flags,
-    grpc_metadata_array *initial_metadata, uint32_t initial_metadata_flags) {
+    grpc_metadata_array* initial_metadata, uint32_t initial_metadata_flags) {
   /* TODO: don't use magic number */
   grpc_op ops[4];
   memset(ops, 0, sizeof(ops));
@@ -684,8 +683,8 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_duplex_streaming(
-    grpc_call *call, grpcsharp_batch_context *ctx,
-    grpc_metadata_array *initial_metadata, uint32_t initial_metadata_flags) {
+    grpc_call* call, grpcsharp_batch_context* ctx,
+    grpc_metadata_array* initial_metadata, uint32_t initial_metadata_flags) {
   /* TODO: don't use magic number */
   grpc_op ops[2];
   memset(ops, 0, sizeof(ops));
@@ -713,7 +712,7 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_recv_initial_metadata(
-    grpc_call *call, grpcsharp_batch_context *ctx) {
+    grpc_call* call, grpcsharp_batch_context* ctx) {
   /* TODO: don't use magic number */
   grpc_op ops[1];
   ops[0].op = GRPC_OP_RECV_INITIAL_METADATA;
@@ -727,7 +726,7 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_message(
-    grpc_call *call, grpcsharp_batch_context *ctx, const char *send_buffer,
+    grpc_call* call, grpcsharp_batch_context* ctx, const char* send_buffer,
     size_t send_buffer_len, uint32_t write_flags,
     int32_t send_empty_initial_metadata) {
   /* TODO: don't use magic number */
@@ -747,7 +746,7 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_close_from_client(
-    grpc_call *call, grpcsharp_batch_context *ctx) {
+    grpc_call* call, grpcsharp_batch_context* ctx) {
   /* TODO: don't use magic number */
   grpc_op ops[1];
   ops[0].op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
@@ -759,10 +758,10 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_status_from_server(
-    grpc_call *call, grpcsharp_batch_context *ctx, grpc_status_code status_code,
-    const char *status_details, size_t status_details_len,
-    grpc_metadata_array *trailing_metadata, int32_t send_empty_initial_metadata,
-    const char *optional_send_buffer, size_t optional_send_buffer_len,
+    grpc_call* call, grpcsharp_batch_context* ctx, grpc_status_code status_code,
+    const char* status_details, size_t status_details_len,
+    grpc_metadata_array* trailing_metadata, int32_t send_empty_initial_metadata,
+    const char* optional_send_buffer, size_t optional_send_buffer_len,
     uint32_t write_flags) {
   /* TODO: don't use magic number */
   grpc_op ops[3];
@@ -802,7 +801,7 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE
-grpcsharp_call_recv_message(grpc_call *call, grpcsharp_batch_context *ctx) {
+grpcsharp_call_recv_message(grpc_call* call, grpcsharp_batch_context* ctx) {
   /* TODO: don't use magic number */
   grpc_op ops[1];
   ops[0].op = GRPC_OP_RECV_MESSAGE;
@@ -814,7 +813,7 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE
-grpcsharp_call_start_serverside(grpc_call *call, grpcsharp_batch_context *ctx) {
+grpcsharp_call_start_serverside(grpc_call* call, grpcsharp_batch_context* ctx) {
   /* TODO: don't use magic number */
   grpc_op ops[1];
   ops[0].op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -828,8 +827,8 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_initial_metadata(
-    grpc_call *call, grpcsharp_batch_context *ctx,
-    grpc_metadata_array *initial_metadata) {
+    grpc_call* call, grpcsharp_batch_context* ctx,
+    grpc_metadata_array* initial_metadata) {
   /* TODO: don't use magic number */
   grpc_op ops[1];
   memset(ops, 0, sizeof(ops));
@@ -847,59 +846,59 @@
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE
-grpcsharp_call_set_credentials(grpc_call *call, grpc_call_credentials *creds) {
+grpcsharp_call_set_credentials(grpc_call* call, grpc_call_credentials* creds) {
   return grpc_call_set_credentials(call, creds);
 }
 
 /* Server */
 
-GPR_EXPORT grpc_server *GPR_CALLTYPE
-grpcsharp_server_create(const grpc_channel_args *args) {
+GPR_EXPORT grpc_server* GPR_CALLTYPE
+grpcsharp_server_create(const grpc_channel_args* args) {
   return grpc_server_create(args, NULL);
 }
 
 GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_register_completion_queue(
-    grpc_server *server, grpc_completion_queue *cq) {
+    grpc_server* server, grpc_completion_queue* cq) {
   grpc_server_register_completion_queue(server, cq, NULL);
 }
 
 GPR_EXPORT int32_t GPR_CALLTYPE grpcsharp_server_add_insecure_http2_port(
-    grpc_server *server, const char *addr) {
+    grpc_server* server, const char* addr) {
   return grpc_server_add_insecure_http2_port(server, addr);
 }
 
-GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_start(grpc_server *server) {
+GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_start(grpc_server* server) {
   grpc_server_start(server);
 }
 
 GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_shutdown_and_notify_callback(
-    grpc_server *server, grpc_completion_queue *cq,
-    grpcsharp_batch_context *ctx) {
+    grpc_server* server, grpc_completion_queue* cq,
+    grpcsharp_batch_context* ctx) {
   grpc_server_shutdown_and_notify(server, cq, ctx);
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_server_cancel_all_calls(grpc_server *server) {
+grpcsharp_server_cancel_all_calls(grpc_server* server) {
   grpc_server_cancel_all_calls(server);
 }
 
-GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_destroy(grpc_server *server) {
+GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_destroy(grpc_server* server) {
   grpc_server_destroy(server);
 }
 
 GPR_EXPORT grpc_call_error GPR_CALLTYPE
-grpcsharp_server_request_call(grpc_server *server, grpc_completion_queue *cq,
-                              grpcsharp_request_call_context *ctx) {
+grpcsharp_server_request_call(grpc_server* server, grpc_completion_queue* cq,
+                              grpcsharp_request_call_context* ctx) {
   return grpc_server_request_call(server, &(ctx->call), &(ctx->call_details),
                                   &(ctx->request_metadata), cq, cq, ctx);
 }
 
 /* Security */
 
-static char *default_pem_root_certs = NULL;
+static char* default_pem_root_certs = NULL;
 
 static grpc_ssl_roots_override_result override_ssl_roots_handler(
-    char **pem_root_certs) {
+    char** pem_root_certs) {
   if (!default_pem_root_certs) {
     *pem_root_certs = NULL;
     return GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY;
@@ -909,7 +908,7 @@
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_override_default_ssl_roots(const char *pem_root_certs) {
+grpcsharp_override_default_ssl_roots(const char* pem_root_certs) {
   /*
    * This currently wastes ~300kB of memory by keeping a copy of roots
    * in a static variable, but for desktop/server use, the overhead
@@ -920,10 +919,10 @@
   grpc_set_ssl_roots_override_callback(override_ssl_roots_handler);
 }
 
-GPR_EXPORT grpc_channel_credentials *GPR_CALLTYPE
-grpcsharp_ssl_credentials_create(const char *pem_root_certs,
-                                 const char *key_cert_pair_cert_chain,
-                                 const char *key_cert_pair_private_key) {
+GPR_EXPORT grpc_channel_credentials* GPR_CALLTYPE
+grpcsharp_ssl_credentials_create(const char* pem_root_certs,
+                                 const char* key_cert_pair_cert_chain,
+                                 const char* key_cert_pair_private_key) {
   grpc_ssl_pem_key_cert_pair key_cert_pair;
   if (key_cert_pair_cert_chain || key_cert_pair_private_key) {
     key_cert_pair.cert_chain = key_cert_pair_cert_chain;
@@ -937,29 +936,29 @@
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_channel_credentials_release(grpc_channel_credentials *creds) {
+grpcsharp_channel_credentials_release(grpc_channel_credentials* creds) {
   grpc_channel_credentials_release(creds);
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_call_credentials_release(grpc_call_credentials *creds) {
+grpcsharp_call_credentials_release(grpc_call_credentials* creds) {
   grpc_call_credentials_release(creds);
 }
 
-GPR_EXPORT grpc_channel *GPR_CALLTYPE grpcsharp_secure_channel_create(
-    grpc_channel_credentials *creds, const char *target,
-    const grpc_channel_args *args) {
+GPR_EXPORT grpc_channel* GPR_CALLTYPE grpcsharp_secure_channel_create(
+    grpc_channel_credentials* creds, const char* target,
+    const grpc_channel_args* args) {
   return grpc_secure_channel_create(creds, target, args, NULL);
 }
 
-GPR_EXPORT grpc_server_credentials *GPR_CALLTYPE
+GPR_EXPORT grpc_server_credentials* GPR_CALLTYPE
 grpcsharp_ssl_server_credentials_create(
-    const char *pem_root_certs, const char **key_cert_pair_cert_chain_array,
-    const char **key_cert_pair_private_key_array, size_t num_key_cert_pairs,
+    const char* pem_root_certs, const char** key_cert_pair_cert_chain_array,
+    const char** key_cert_pair_private_key_array, size_t num_key_cert_pairs,
     int force_client_auth) {
   size_t i;
-  grpc_server_credentials *creds;
-  grpc_ssl_pem_key_cert_pair *key_cert_pairs =
+  grpc_server_credentials* creds;
+  grpc_ssl_pem_key_cert_pair* key_cert_pairs =
       gpr_malloc(sizeof(grpc_ssl_pem_key_cert_pair) * num_key_cert_pairs);
   memset(key_cert_pairs, 0,
          sizeof(grpc_ssl_pem_key_cert_pair) * num_key_cert_pairs);
@@ -982,35 +981,35 @@
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_server_credentials_release(grpc_server_credentials *creds) {
+grpcsharp_server_credentials_release(grpc_server_credentials* creds) {
   grpc_server_credentials_release(creds);
 }
 
 GPR_EXPORT int32_t GPR_CALLTYPE grpcsharp_server_add_secure_http2_port(
-    grpc_server *server, const char *addr, grpc_server_credentials *creds) {
+    grpc_server* server, const char* addr, grpc_server_credentials* creds) {
   return grpc_server_add_secure_http2_port(server, addr, creds);
 }
 
-GPR_EXPORT grpc_channel_credentials *GPR_CALLTYPE
+GPR_EXPORT grpc_channel_credentials* GPR_CALLTYPE
 grpcsharp_composite_channel_credentials_create(
-    grpc_channel_credentials *channel_creds,
-    grpc_call_credentials *call_creds) {
+    grpc_channel_credentials* channel_creds,
+    grpc_call_credentials* call_creds) {
   return grpc_composite_channel_credentials_create(channel_creds, call_creds,
                                                    NULL);
 }
 
-GPR_EXPORT grpc_call_credentials *GPR_CALLTYPE
-grpcsharp_composite_call_credentials_create(grpc_call_credentials *creds1,
-                                            grpc_call_credentials *creds2) {
+GPR_EXPORT grpc_call_credentials* GPR_CALLTYPE
+grpcsharp_composite_call_credentials_create(grpc_call_credentials* creds1,
+                                            grpc_call_credentials* creds2) {
   return grpc_composite_call_credentials_create(creds1, creds2, NULL);
 }
 
 /* Metadata credentials plugin */
 
 GPR_EXPORT void GPR_CALLTYPE grpcsharp_metadata_credentials_notify_from_plugin(
-    grpc_credentials_plugin_metadata_cb cb, void *user_data,
-    grpc_metadata_array *metadata, grpc_status_code status,
-    const char *error_details) {
+    grpc_credentials_plugin_metadata_cb cb, void* user_data,
+    grpc_metadata_array* metadata, grpc_status_code status,
+    const char* error_details) {
   if (metadata) {
     cb(user_data, metadata->metadata, metadata->count, status, error_details);
   } else {
@@ -1018,17 +1017,17 @@
   }
 }
 
-typedef void(GPR_CALLTYPE *grpcsharp_metadata_interceptor_func)(
-    void *state, const char *service_url, const char *method_name,
-    grpc_credentials_plugin_metadata_cb cb, void *user_data,
+typedef void(GPR_CALLTYPE* grpcsharp_metadata_interceptor_func)(
+    void* state, const char* service_url, const char* method_name,
+    grpc_credentials_plugin_metadata_cb cb, void* user_data,
     int32_t is_destroy);
 
 static int grpcsharp_get_metadata_handler(
-    void *state, grpc_auth_metadata_context context,
-    grpc_credentials_plugin_metadata_cb cb, void *user_data,
+    void* state, grpc_auth_metadata_context context,
+    grpc_credentials_plugin_metadata_cb cb, void* user_data,
     grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
-    size_t *num_creds_md, grpc_status_code *status,
-    const char **error_details) {
+    size_t* num_creds_md, grpc_status_code* status,
+    const char** error_details) {
   grpcsharp_metadata_interceptor_func interceptor =
       (grpcsharp_metadata_interceptor_func)(intptr_t)state;
   interceptor(state, context.service_url, context.method_name, cb, user_data,
@@ -1036,61 +1035,61 @@
   return 0; /* Asynchronous return. */
 }
 
-static void grpcsharp_metadata_credentials_destroy_handler(void *state) {
+static void grpcsharp_metadata_credentials_destroy_handler(void* state) {
   grpcsharp_metadata_interceptor_func interceptor =
       (grpcsharp_metadata_interceptor_func)(intptr_t)state;
   interceptor(state, NULL, NULL, NULL, NULL, 1);
 }
 
-GPR_EXPORT grpc_call_credentials *GPR_CALLTYPE
+GPR_EXPORT grpc_call_credentials* GPR_CALLTYPE
 grpcsharp_metadata_credentials_create_from_plugin(
     grpcsharp_metadata_interceptor_func metadata_interceptor) {
   grpc_metadata_credentials_plugin plugin;
   plugin.get_metadata = grpcsharp_get_metadata_handler;
   plugin.destroy = grpcsharp_metadata_credentials_destroy_handler;
-  plugin.state = (void *)(intptr_t)metadata_interceptor;
+  plugin.state = (void*)(intptr_t)metadata_interceptor;
   plugin.type = "";
   return grpc_metadata_credentials_create_from_plugin(plugin, NULL);
 }
 
 /* Auth context */
 
-GPR_EXPORT grpc_auth_context *GPR_CALLTYPE
-grpcsharp_call_auth_context(grpc_call *call) {
+GPR_EXPORT grpc_auth_context* GPR_CALLTYPE
+grpcsharp_call_auth_context(grpc_call* call) {
   return grpc_call_auth_context(call);
 }
 
-GPR_EXPORT const char *GPR_CALLTYPE
+GPR_EXPORT const char* GPR_CALLTYPE
 grpcsharp_auth_context_peer_identity_property_name(
-    const grpc_auth_context *ctx) {
+    const grpc_auth_context* ctx) {
   return grpc_auth_context_peer_identity_property_name(ctx);
 }
 
 GPR_EXPORT grpc_auth_property_iterator GPR_CALLTYPE
-grpcsharp_auth_context_property_iterator(const grpc_auth_context *ctx) {
+grpcsharp_auth_context_property_iterator(const grpc_auth_context* ctx) {
   return grpc_auth_context_property_iterator(ctx);
 }
 
-GPR_EXPORT const grpc_auth_property *GPR_CALLTYPE
-grpcsharp_auth_property_iterator_next(grpc_auth_property_iterator *it) {
+GPR_EXPORT const grpc_auth_property* GPR_CALLTYPE
+grpcsharp_auth_property_iterator_next(grpc_auth_property_iterator* it) {
   return grpc_auth_property_iterator_next(it);
 }
 
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_auth_context_release(grpc_auth_context *ctx) {
+grpcsharp_auth_context_release(grpc_auth_context* ctx) {
   grpc_auth_context_release(ctx);
 }
 
 /* Logging */
 
-typedef void(GPR_CALLTYPE *grpcsharp_log_func)(const char *file, int32_t line,
+typedef void(GPR_CALLTYPE* grpcsharp_log_func)(const char* file, int32_t line,
                                                uint64_t thd_id,
-                                               const char *severity_string,
-                                               const char *msg);
+                                               const char* severity_string,
+                                               const char* msg);
 static grpcsharp_log_func log_func = NULL;
 
 /* Redirects gpr_log to log_func callback */
-static void grpcsharp_log_handler(gpr_log_func_args *args) {
+static void grpcsharp_log_handler(gpr_log_func_args* args) {
   log_func(args->file, args->line, gpr_thd_currentid(),
            gpr_log_severity_string(args->severity), args->message);
 }
@@ -1101,10 +1100,10 @@
   gpr_set_log_function(grpcsharp_log_handler);
 }
 
-typedef void(GPR_CALLTYPE *test_callback_funcptr)(int32_t success);
+typedef void(GPR_CALLTYPE* test_callback_funcptr)(int32_t success);
 
 /* Version info */
-GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_version_string() {
+GPR_EXPORT const char* GPR_CALLTYPE grpcsharp_version_string() {
   return grpc_version_string();
 }
 
@@ -1115,7 +1114,7 @@
 }
 
 /* For testing */
-GPR_EXPORT void *GPR_CALLTYPE grpcsharp_test_nop(void *ptr) { return ptr; }
+GPR_EXPORT void* GPR_CALLTYPE grpcsharp_test_nop(void* ptr) { return ptr; }
 
 /* For testing */
 GPR_EXPORT int32_t GPR_CALLTYPE grpcsharp_sizeof_grpc_event(void) {
@@ -1124,7 +1123,7 @@
 
 /* Override a method for testing */
 GPR_EXPORT void GPR_CALLTYPE
-grpcsharp_test_override_method(const char *method_name, const char *variant) {
+grpcsharp_test_override_method(const char* method_name, const char* variant) {
   if (strcmp("grpcsharp_call_start_batch", method_name) == 0) {
     if (strcmp("nop", variant) == 0) {
       g_call_start_batch_func = grpcsharp_call_start_batch_nop;
diff --git a/src/node/.jshintignore b/src/node/.jshintignore
deleted file mode 100644
index 0a73e1e..0000000
--- a/src/node/.jshintignore
+++ /dev/null
@@ -1 +0,0 @@
-**/*_pb.js
\ No newline at end of file
diff --git a/src/node/README.md b/src/node/README.md
deleted file mode 100644
index 3b98b97..0000000
--- a/src/node/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-[![npm](https://img.shields.io/npm/v/grpc.svg)](https://www.npmjs.com/package/grpc)
-# Node.js gRPC Library
-
-## PREREQUISITES
-- `node`: This requires `node` to be installed, version `4.0` or above. If you instead have the `nodejs` executable on Debian, you should install the [`nodejs-legacy`](https://packages.debian.org/sid/nodejs-legacy) package.
-
-- **Note:** If you installed `node` via a package manager and the version is still less than `4.0`, try directly installing it from [nodejs.org](https://nodejs.org).
-
-## INSTALLATION
-
-Install the gRPC NPM package
-
-```sh
-npm install grpc
-```
-
-## BUILD FROM SOURCE
- 1. Clone [the grpc Git Repository](https://github.com/grpc/grpc).
- 2. Run `npm install --build-from-source` from the repository root.
-
- - **Note:** On Windows, this might fail due to [nodejs issue #4932](https://github.com/nodejs/node/issues/4932) in which case, you will see something like the following in `npm install`'s output (towards the very beginning):
-
-    ```
-     ..
-     Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
-     WINDOWS_BUILD_WARNING
-      "..\IMPORTANT: Due to https:\github.com\nodejs\node\issues\4932, to build this library on Windows, you must first remove C:\Users\jenkins\.node-gyp\4.4.0\include\node\openssl"
-      ...
-      ..
-    ```
-
-    To fix this, you will have to delete the folder `C:\Users\<username>\.node-gyp\<node_version>\include\node\openssl` and retry `npm install`
-
-
-## TESTING
-To run the test suite, simply run `npm test` in the install location.
diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc
deleted file mode 100644
index 1040f70..0000000
--- a/src/node/ext/byte_buffer.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <nan.h>
-#include <node.h>
-#include "grpc/byte_buffer_reader.h"
-#include "grpc/grpc.h"
-#include "grpc/slice.h"
-
-#include "byte_buffer.h"
-#include "slice.h"
-
-namespace grpc {
-namespace node {
-
-using Nan::Callback;
-using Nan::MaybeLocal;
-
-using v8::Function;
-using v8::Local;
-using v8::Object;
-using v8::Number;
-using v8::Value;
-
-grpc_byte_buffer *BufferToByteBuffer(Local<Value> buffer) {
-  Nan::HandleScope scope;
-  grpc_slice slice = CreateSliceFromBuffer(buffer);
-  grpc_byte_buffer *byte_buffer(grpc_raw_byte_buffer_create(&slice, 1));
-  grpc_slice_unref(slice);
-  return byte_buffer;
-}
-
-namespace {
-void delete_buffer(char *data, void *hint) {
-  grpc_slice *slice = static_cast<grpc_slice *>(hint);
-  grpc_slice_unref(*slice);
-  delete slice;
-}
-}
-
-Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
-  Nan::EscapableHandleScope scope;
-  if (buffer == NULL) {
-    return scope.Escape(Nan::Null());
-  }
-  grpc_byte_buffer_reader reader;
-  if (!grpc_byte_buffer_reader_init(&reader, buffer)) {
-    Nan::ThrowError("Error initializing byte buffer reader.");
-    return scope.Escape(Nan::Undefined());
-  }
-  grpc_slice *slice = new grpc_slice;
-  *slice = grpc_byte_buffer_reader_readall(&reader);
-  grpc_byte_buffer_reader_destroy(&reader);
-  char *result = reinterpret_cast<char *>(GRPC_SLICE_START_PTR(*slice));
-  size_t length = GRPC_SLICE_LENGTH(*slice);
-  Local<Value> buf =
-      Nan::NewBuffer(result, length, delete_buffer, slice).ToLocalChecked();
-  return scope.Escape(buf);
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/byte_buffer.h b/src/node/ext/byte_buffer.h
deleted file mode 100644
index 6223147..0000000
--- a/src/node/ext/byte_buffer.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef NET_GRPC_NODE_BYTE_BUFFER_H_
-#define NET_GRPC_NODE_BYTE_BUFFER_H_
-
-#include <string.h>
-
-#include <nan.h>
-#include <node.h>
-#include "grpc/grpc.h"
-
-namespace grpc {
-namespace node {
-
-/* Convert a Node.js Buffer to grpc_byte_buffer. Requires that
-   ::node::Buffer::HasInstance(buffer) */
-grpc_byte_buffer *BufferToByteBuffer(v8::Local<v8::Value> buffer);
-
-/* Convert a grpc_byte_buffer to a Node.js Buffer */
-v8::Local<v8::Value> ByteBufferToBuffer(grpc_byte_buffer *buffer);
-
-}  // namespace node
-}  // namespace grpc
-
-#endif  // NET_GRPC_NODE_BYTE_BUFFER_H_
diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc
deleted file mode 100644
index 26095a7..0000000
--- a/src/node/ext/call.cc
+++ /dev/null
@@ -1,815 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <map>
-#include <memory>
-#include <vector>
-
-#include <node.h>
-
-#include "byte_buffer.h"
-#include "call.h"
-#include "call_credentials.h"
-#include "channel.h"
-#include "completion_queue.h"
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
-#include "grpc/support/alloc.h"
-#include "grpc/support/log.h"
-#include "grpc/support/time.h"
-#include "slice.h"
-#include "timeval.h"
-
-using std::unique_ptr;
-using std::shared_ptr;
-using std::vector;
-
-namespace grpc {
-namespace node {
-
-using Nan::Callback;
-using Nan::EscapableHandleScope;
-using Nan::HandleScope;
-using Nan::Maybe;
-using Nan::MaybeLocal;
-using Nan::ObjectWrap;
-using Nan::Persistent;
-using Nan::Utf8String;
-
-using v8::Array;
-using v8::Boolean;
-using v8::Exception;
-using v8::External;
-using v8::Function;
-using v8::FunctionTemplate;
-using v8::Integer;
-using v8::Local;
-using v8::Number;
-using v8::Object;
-using v8::ObjectTemplate;
-using v8::Uint32;
-using v8::String;
-using v8::Value;
-
-Callback *Call::constructor;
-Persistent<FunctionTemplate> Call::fun_tpl;
-
-/**
- * Helper function for throwing errors with a grpc_call_error value.
- * Modified from the answer by Gus Goose to
- * http://stackoverflow.com/questions/31794200.
- */
-Local<Value> nanErrorWithCode(const char *msg, grpc_call_error code) {
-  EscapableHandleScope scope;
-  Local<Object> err = Nan::Error(msg).As<Object>();
-  Nan::Set(err, Nan::New("code").ToLocalChecked(), Nan::New<Uint32>(code));
-  return scope.Escape(err);
-}
-
-bool CreateMetadataArray(Local<Object> metadata, grpc_metadata_array *array) {
-  HandleScope scope;
-  Local<Array> keys = Nan::GetOwnPropertyNames(metadata).ToLocalChecked();
-  for (unsigned int i = 0; i < keys->Length(); i++) {
-    Local<String> current_key =
-        Nan::To<String>(Nan::Get(keys, i).ToLocalChecked()).ToLocalChecked();
-    Local<Value> value_array = Nan::Get(metadata, current_key).ToLocalChecked();
-    if (!value_array->IsArray()) {
-      return false;
-    }
-    array->capacity += Local<Array>::Cast(value_array)->Length();
-  }
-  array->metadata = reinterpret_cast<grpc_metadata *>(
-      gpr_zalloc(array->capacity * sizeof(grpc_metadata)));
-  for (unsigned int i = 0; i < keys->Length(); i++) {
-    Local<String> current_key(Nan::To<String>(keys->Get(i)).ToLocalChecked());
-    Local<Array> values =
-        Local<Array>::Cast(Nan::Get(metadata, current_key).ToLocalChecked());
-    grpc_slice key_slice = CreateSliceFromString(current_key);
-    grpc_slice key_intern_slice = grpc_slice_intern(key_slice);
-    grpc_slice_unref(key_slice);
-    for (unsigned int j = 0; j < values->Length(); j++) {
-      Local<Value> value = Nan::Get(values, j).ToLocalChecked();
-      grpc_metadata *current = &array->metadata[array->count];
-      current->key = key_intern_slice;
-      // Only allow binary headers for "-bin" keys
-      if (grpc_is_binary_header(key_intern_slice)) {
-        if (::node::Buffer::HasInstance(value)) {
-          current->value = CreateSliceFromBuffer(value);
-        } else {
-          return false;
-        }
-      } else {
-        if (value->IsString()) {
-          Local<String> string_value = Nan::To<String>(value).ToLocalChecked();
-          current->value = CreateSliceFromString(string_value);
-        } else {
-          return false;
-        }
-      }
-      array->count += 1;
-    }
-  }
-  return true;
-}
-
-void DestroyMetadataArray(grpc_metadata_array *array) {
-  for (size_t i = 0; i < array->count; i++) {
-    // Don't unref keys because they are interned
-    grpc_slice_unref(array->metadata[i].value);
-  }
-  grpc_metadata_array_destroy(array);
-}
-
-Local<Value> ParseMetadata(const grpc_metadata_array *metadata_array) {
-  EscapableHandleScope scope;
-  grpc_metadata *metadata_elements = metadata_array->metadata;
-  size_t length = metadata_array->count;
-  Local<Object> metadata_object = Nan::New<Object>();
-  for (unsigned int i = 0; i < length; i++) {
-    grpc_metadata *elem = &metadata_elements[i];
-    // TODO(murgatroid99): Use zero-copy string construction instead
-    Local<String> key_string = CopyStringFromSlice(elem->key);
-    Local<Array> array;
-    MaybeLocal<Value> maybe_array = Nan::Get(metadata_object, key_string);
-    if (maybe_array.IsEmpty() || !maybe_array.ToLocalChecked()->IsArray()) {
-      array = Nan::New<Array>(0);
-      Nan::Set(metadata_object, key_string, array);
-    } else {
-      array = Local<Array>::Cast(maybe_array.ToLocalChecked());
-    }
-    if (grpc_is_binary_header(elem->key)) {
-      Nan::Set(array, array->Length(), CreateBufferFromSlice(elem->value));
-    } else {
-      // TODO(murgatroid99): Use zero-copy string construction instead
-      Nan::Set(array, array->Length(), CopyStringFromSlice(elem->value));
-    }
-  }
-  return scope.Escape(metadata_object);
-}
-
-Local<Value> Op::GetOpType() const {
-  EscapableHandleScope scope;
-  return scope.Escape(Nan::New(GetTypeString()).ToLocalChecked());
-}
-
-Op::~Op() {}
-
-class SendMetadataOp : public Op {
- public:
-  SendMetadataOp() { grpc_metadata_array_init(&send_metadata); }
-  ~SendMetadataOp() { DestroyMetadataArray(&send_metadata); }
-  Local<Value> GetNodeValue() const {
-    EscapableHandleScope scope;
-    return scope.Escape(Nan::True());
-  }
-  bool ParseOp(Local<Value> value, grpc_op *out) {
-    if (!value->IsObject()) {
-      return false;
-    }
-    MaybeLocal<Object> maybe_metadata = Nan::To<Object>(value);
-    if (maybe_metadata.IsEmpty()) {
-      return false;
-    }
-    if (!CreateMetadataArray(maybe_metadata.ToLocalChecked(), &send_metadata)) {
-      return false;
-    }
-    out->data.send_initial_metadata.count = send_metadata.count;
-    out->data.send_initial_metadata.metadata = send_metadata.metadata;
-    return true;
-  }
-  bool IsFinalOp() { return false; }
-  void OnComplete(bool success) {}
-
- protected:
-  std::string GetTypeString() const { return "send_metadata"; }
-
- private:
-  grpc_metadata_array send_metadata;
-};
-
-class SendMessageOp : public Op {
- public:
-  SendMessageOp() { send_message = NULL; }
-  ~SendMessageOp() {
-    if (send_message != NULL) {
-      grpc_byte_buffer_destroy(send_message);
-    }
-  }
-  Local<Value> GetNodeValue() const {
-    EscapableHandleScope scope;
-    return scope.Escape(Nan::True());
-  }
-  bool ParseOp(Local<Value> value, grpc_op *out) {
-    if (!::node::Buffer::HasInstance(value)) {
-      return false;
-    }
-    Local<Object> object_value = Nan::To<Object>(value).ToLocalChecked();
-    MaybeLocal<Value> maybe_flag_value =
-        Nan::Get(object_value, Nan::New("grpcWriteFlags").ToLocalChecked());
-    if (!maybe_flag_value.IsEmpty()) {
-      Local<Value> flag_value = maybe_flag_value.ToLocalChecked();
-      if (flag_value->IsUint32()) {
-        Maybe<uint32_t> maybe_flag = Nan::To<uint32_t>(flag_value);
-        out->flags = maybe_flag.FromMaybe(0) & GRPC_WRITE_USED_MASK;
-      }
-    }
-    send_message = BufferToByteBuffer(value);
-    out->data.send_message.send_message = send_message;
-    return true;
-  }
-
-  bool IsFinalOp() { return false; }
-  void OnComplete(bool success) {}
-
- protected:
-  std::string GetTypeString() const { return "send_message"; }
-
- private:
-  grpc_byte_buffer *send_message;
-};
-
-class SendClientCloseOp : public Op {
- public:
-  Local<Value> GetNodeValue() const {
-    EscapableHandleScope scope;
-    return scope.Escape(Nan::True());
-  }
-
-  bool ParseOp(Local<Value> value, grpc_op *out) { return true; }
-  bool IsFinalOp() { return false; }
-  void OnComplete(bool success) {}
-
- protected:
-  std::string GetTypeString() const { return "client_close"; }
-};
-
-class SendServerStatusOp : public Op {
- public:
-  SendServerStatusOp() {
-    details = grpc_empty_slice();
-    grpc_metadata_array_init(&status_metadata);
-  }
-  ~SendServerStatusOp() {
-    grpc_slice_unref(details);
-    DestroyMetadataArray(&status_metadata);
-  }
-  Local<Value> GetNodeValue() const {
-    EscapableHandleScope scope;
-    return scope.Escape(Nan::True());
-  }
-  bool ParseOp(Local<Value> value, grpc_op *out) {
-    if (!value->IsObject()) {
-      return false;
-    }
-    Local<Object> server_status = Nan::To<Object>(value).ToLocalChecked();
-    MaybeLocal<Value> maybe_metadata =
-        Nan::Get(server_status, Nan::New("metadata").ToLocalChecked());
-    if (maybe_metadata.IsEmpty()) {
-      return false;
-    }
-    if (!maybe_metadata.ToLocalChecked()->IsObject()) {
-      return false;
-    }
-    Local<Object> metadata =
-        Nan::To<Object>(maybe_metadata.ToLocalChecked()).ToLocalChecked();
-    MaybeLocal<Value> maybe_code =
-        Nan::Get(server_status, Nan::New("code").ToLocalChecked());
-    if (maybe_code.IsEmpty()) {
-      return false;
-    }
-    if (!maybe_code.ToLocalChecked()->IsUint32()) {
-      return false;
-    }
-    uint32_t code = Nan::To<uint32_t>(maybe_code.ToLocalChecked()).FromJust();
-    MaybeLocal<Value> maybe_details =
-        Nan::Get(server_status, Nan::New("details").ToLocalChecked());
-    if (maybe_details.IsEmpty()) {
-      return false;
-    }
-    if (!maybe_details.ToLocalChecked()->IsString()) {
-      return false;
-    }
-    Local<String> details =
-        Nan::To<String>(maybe_details.ToLocalChecked()).ToLocalChecked();
-    if (!CreateMetadataArray(metadata, &status_metadata)) {
-      return false;
-    }
-    out->data.send_status_from_server.trailing_metadata_count =
-        status_metadata.count;
-    out->data.send_status_from_server.trailing_metadata =
-        status_metadata.metadata;
-    out->data.send_status_from_server.status =
-        static_cast<grpc_status_code>(code);
-    this->details = CreateSliceFromString(details);
-    out->data.send_status_from_server.status_details = &this->details;
-    return true;
-  }
-  bool IsFinalOp() { return true; }
-  void OnComplete(bool success) {}
-
- protected:
-  std::string GetTypeString() const { return "send_status"; }
-
- private:
-  grpc_slice details;
-  grpc_metadata_array status_metadata;
-};
-
-class GetMetadataOp : public Op {
- public:
-  GetMetadataOp() { grpc_metadata_array_init(&recv_metadata); }
-
-  ~GetMetadataOp() { grpc_metadata_array_destroy(&recv_metadata); }
-
-  Local<Value> GetNodeValue() const {
-    EscapableHandleScope scope;
-    return scope.Escape(ParseMetadata(&recv_metadata));
-  }
-
-  bool ParseOp(Local<Value> value, grpc_op *out) {
-    out->data.recv_initial_metadata.recv_initial_metadata = &recv_metadata;
-    return true;
-  }
-  bool IsFinalOp() { return false; }
-  void OnComplete(bool success) {}
-
- protected:
-  std::string GetTypeString() const { return "metadata"; }
-
- private:
-  grpc_metadata_array recv_metadata;
-};
-
-class ReadMessageOp : public Op {
- public:
-  ReadMessageOp() { recv_message = NULL; }
-  ~ReadMessageOp() {
-    if (recv_message != NULL) {
-      grpc_byte_buffer_destroy(recv_message);
-    }
-  }
-  Local<Value> GetNodeValue() const {
-    EscapableHandleScope scope;
-    return scope.Escape(ByteBufferToBuffer(recv_message));
-  }
-
-  bool ParseOp(Local<Value> value, grpc_op *out) {
-    out->data.recv_message.recv_message = &recv_message;
-    return true;
-  }
-  bool IsFinalOp() { return false; }
-  void OnComplete(bool success) {}
-
- protected:
-  std::string GetTypeString() const { return "read"; }
-
- private:
-  grpc_byte_buffer *recv_message;
-};
-
-class ClientStatusOp : public Op {
- public:
-  ClientStatusOp() {
-    grpc_metadata_array_init(&metadata_array);
-    status_details = grpc_empty_slice();
-  }
-
-  ~ClientStatusOp() {
-    grpc_metadata_array_destroy(&metadata_array);
-    grpc_slice_unref(status_details);
-  }
-
-  bool ParseOp(Local<Value> value, grpc_op *out) {
-    out->data.recv_status_on_client.trailing_metadata = &metadata_array;
-    out->data.recv_status_on_client.status = &status;
-    out->data.recv_status_on_client.status_details = &status_details;
-    return true;
-  }
-
-  Local<Value> GetNodeValue() const {
-    EscapableHandleScope scope;
-    Local<Object> status_obj = Nan::New<Object>();
-    Nan::Set(status_obj, Nan::New("code").ToLocalChecked(),
-             Nan::New<Number>(status));
-    Nan::Set(status_obj, Nan::New("details").ToLocalChecked(),
-             CopyStringFromSlice(status_details));
-    Nan::Set(status_obj, Nan::New("metadata").ToLocalChecked(),
-             ParseMetadata(&metadata_array));
-    return scope.Escape(status_obj);
-  }
-  bool IsFinalOp() { return true; }
-  void OnComplete(bool success) {}
-
- protected:
-  std::string GetTypeString() const { return "status"; }
-
- private:
-  grpc_metadata_array metadata_array;
-  grpc_status_code status;
-  grpc_slice status_details;
-};
-
-class ServerCloseResponseOp : public Op {
- public:
-  Local<Value> GetNodeValue() const {
-    EscapableHandleScope scope;
-    return scope.Escape(Nan::New<Boolean>(cancelled));
-  }
-
-  bool ParseOp(Local<Value> value, grpc_op *out) {
-    out->data.recv_close_on_server.cancelled = &cancelled;
-    return true;
-  }
-  bool IsFinalOp() { return false; }
-  void OnComplete(bool success) {}
-
- protected:
-  std::string GetTypeString() const { return "cancelled"; }
-
- private:
-  int cancelled;
-};
-
-tag::tag(Callback *callback, OpVec *ops, Call *call, Local<Value> call_value)
-    : callback(callback), ops(ops), call(call) {
-  HandleScope scope;
-  call_persist.Reset(call_value);
-}
-
-tag::~tag() {
-  delete callback;
-  delete ops;
-}
-
-void CompleteTag(void *tag, const char *error_message) {
-  HandleScope scope;
-  struct tag *tag_struct = reinterpret_cast<struct tag *>(tag);
-  Callback *callback = tag_struct->callback;
-  if (error_message == NULL) {
-    Local<Object> tag_obj = Nan::New<Object>();
-    for (vector<unique_ptr<Op> >::iterator it = tag_struct->ops->begin();
-         it != tag_struct->ops->end(); ++it) {
-      Op *op_ptr = it->get();
-      Nan::Set(tag_obj, op_ptr->GetOpType(), op_ptr->GetNodeValue());
-    }
-    Local<Value> argv[] = {Nan::Null(), tag_obj};
-    callback->Call(2, argv);
-  } else {
-    Local<Value> argv[] = {Nan::Error(error_message)};
-    callback->Call(1, argv);
-  }
-  bool success = (error_message == NULL);
-  bool is_final_op = false;
-  for (vector<unique_ptr<Op> >::iterator it = tag_struct->ops->begin();
-       it != tag_struct->ops->end(); ++it) {
-    Op *op_ptr = it->get();
-    op_ptr->OnComplete(success);
-    if (op_ptr->IsFinalOp()) {
-      is_final_op = true;
-    }
-  }
-  if (tag_struct->call == NULL) {
-    return;
-  }
-  tag_struct->call->CompleteBatch(is_final_op);
-}
-
-void DestroyTag(void *tag) {
-  struct tag *tag_struct = reinterpret_cast<struct tag *>(tag);
-  delete tag_struct;
-}
-
-void Call::DestroyCall() {
-  if (this->wrapped_call != NULL) {
-    grpc_call_unref(this->wrapped_call);
-    this->wrapped_call = NULL;
-  }
-}
-
-Call::Call(grpc_call *call)
-    : wrapped_call(call), pending_batches(0), has_final_op_completed(false) {
-  peer = grpc_call_get_peer(call);
-}
-
-Call::~Call() {
-  DestroyCall();
-  gpr_free(peer);
-}
-
-void Call::Init(Local<Object> exports) {
-  HandleScope scope;
-  Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New);
-  tpl->SetClassName(Nan::New("Call").ToLocalChecked());
-  tpl->InstanceTemplate()->SetInternalFieldCount(1);
-  Nan::SetPrototypeMethod(tpl, "startBatch", StartBatch);
-  Nan::SetPrototypeMethod(tpl, "cancel", Cancel);
-  Nan::SetPrototypeMethod(tpl, "cancelWithStatus", CancelWithStatus);
-  Nan::SetPrototypeMethod(tpl, "getPeer", GetPeer);
-  Nan::SetPrototypeMethod(tpl, "setCredentials", SetCredentials);
-  fun_tpl.Reset(tpl);
-  Local<Function> ctr = Nan::GetFunction(tpl).ToLocalChecked();
-  Nan::Set(exports, Nan::New("Call").ToLocalChecked(), ctr);
-  constructor = new Callback(ctr);
-}
-
-bool Call::HasInstance(Local<Value> val) {
-  HandleScope scope;
-  return Nan::New(fun_tpl)->HasInstance(val);
-}
-
-Local<Value> Call::WrapStruct(grpc_call *call) {
-  EscapableHandleScope scope;
-  if (call == NULL) {
-    return scope.Escape(Nan::Null());
-  }
-  const int argc = 1;
-  Local<Value> argv[argc] = {
-      Nan::New<External>(reinterpret_cast<void *>(call))};
-  MaybeLocal<Object> maybe_instance =
-      Nan::NewInstance(constructor->GetFunction(), argc, argv);
-  if (maybe_instance.IsEmpty()) {
-    return scope.Escape(Nan::Null());
-  } else {
-    return scope.Escape(maybe_instance.ToLocalChecked());
-  }
-}
-
-void Call::CompleteBatch(bool is_final_op) {
-  if (is_final_op) {
-    this->has_final_op_completed = true;
-  }
-  this->pending_batches--;
-  if (this->has_final_op_completed && this->pending_batches == 0) {
-    this->DestroyCall();
-  }
-}
-
-NAN_METHOD(Call::New) {
-  /* Arguments:
-   * 0: Channel to make the call on
-   * 1: Method
-   * 2: Deadline
-   * 3: host
-   * 4: parent Call
-   * 5: propagation flags
-   */
-  if (info.IsConstructCall()) {
-    Call *call;
-    if (info[0]->IsExternal()) {
-      Local<External> ext = info[0].As<External>();
-      // This option is used for wrapping an existing call
-      grpc_call *call_value = reinterpret_cast<grpc_call *>(ext->Value());
-      call = new Call(call_value);
-    } else {
-      if (!Channel::HasInstance(info[0])) {
-        return Nan::ThrowTypeError("Call's first argument must be a Channel");
-      }
-      if (!info[1]->IsString()) {
-        return Nan::ThrowTypeError("Call's second argument must be a string");
-      }
-      if (!(info[2]->IsNumber() || info[2]->IsDate())) {
-        return Nan::ThrowTypeError(
-            "Call's third argument must be a date or a number");
-      }
-      // These arguments are at the end because they are optional
-      grpc_call *parent_call = NULL;
-      if (Call::HasInstance(info[4])) {
-        Call *parent_obj =
-            ObjectWrap::Unwrap<Call>(Nan::To<Object>(info[4]).ToLocalChecked());
-        parent_call = parent_obj->wrapped_call;
-      } else if (!(info[4]->IsUndefined() || info[4]->IsNull())) {
-        return Nan::ThrowTypeError(
-            "Call's fifth argument must be another call, if provided");
-      }
-      uint32_t propagate_flags = GRPC_PROPAGATE_DEFAULTS;
-      if (info[5]->IsUint32()) {
-        propagate_flags = Nan::To<uint32_t>(info[5]).FromJust();
-      } else if (!(info[5]->IsUndefined() || info[5]->IsNull())) {
-        return Nan::ThrowTypeError(
-            "Call's sixth argument must be propagate flags, if provided");
-      }
-      Local<Object> channel_object = Nan::To<Object>(info[0]).ToLocalChecked();
-      Channel *channel = ObjectWrap::Unwrap<Channel>(channel_object);
-      if (channel->GetWrappedChannel() == NULL) {
-        return Nan::ThrowError("Call cannot be created from a closed channel");
-      }
-      double deadline = Nan::To<double>(info[2]).FromJust();
-      grpc_channel *wrapped_channel = channel->GetWrappedChannel();
-      grpc_call *wrapped_call;
-      grpc_slice method =
-          CreateSliceFromString(Nan::To<String>(info[1]).ToLocalChecked());
-      if (info[3]->IsString()) {
-        grpc_slice *host = new grpc_slice;
-        *host =
-            CreateSliceFromString(Nan::To<String>(info[3]).ToLocalChecked());
-        wrapped_call = grpc_channel_create_call(
-            wrapped_channel, parent_call, propagate_flags, GetCompletionQueue(),
-            method, host, MillisecondsToTimespec(deadline), NULL);
-        delete host;
-      } else if (info[3]->IsUndefined() || info[3]->IsNull()) {
-        wrapped_call = grpc_channel_create_call(
-            wrapped_channel, parent_call, propagate_flags, GetCompletionQueue(),
-            method, NULL, MillisecondsToTimespec(deadline), NULL);
-      } else {
-        return Nan::ThrowTypeError("Call's fourth argument must be a string");
-      }
-      grpc_slice_unref(method);
-      call = new Call(wrapped_call);
-      Nan::Set(info.This(), Nan::New("channel_").ToLocalChecked(),
-               channel_object);
-    }
-    call->Wrap(info.This());
-    info.GetReturnValue().Set(info.This());
-  } else {
-    const int argc = 4;
-    Local<Value> argv[argc] = {info[0], info[1], info[2], info[3]};
-    MaybeLocal<Object> maybe_instance =
-        Nan::NewInstance(constructor->GetFunction(), argc, argv);
-    if (maybe_instance.IsEmpty()) {
-      // There's probably a pending exception
-      return;
-    } else {
-      info.GetReturnValue().Set(maybe_instance.ToLocalChecked());
-    }
-  }
-}
-
-NAN_METHOD(Call::StartBatch) {
-  if (!Call::HasInstance(info.This())) {
-    return Nan::ThrowTypeError("startBatch can only be called on Call objects");
-  }
-  if (!info[0]->IsObject()) {
-    return Nan::ThrowError("startBatch's first argument must be an object");
-  }
-  if (!info[1]->IsFunction()) {
-    return Nan::ThrowError("startBatch's second argument must be a callback");
-  }
-  Local<Function> callback_func = info[1].As<Function>();
-  Call *call = ObjectWrap::Unwrap<Call>(info.This());
-  if (call->wrapped_call == NULL) {
-    /* This implies that the call has completed and has been destroyed. To
-     * emulate
-     * previous behavior, we should call the callback immediately with an error,
-     * as though the batch had failed in core */
-    Local<Value> argv[] = {
-        Nan::Error("The async function failed because the call has completed")};
-    Nan::Call(callback_func, Nan::New<Object>(), 1, argv);
-    return;
-  }
-  Local<Object> obj = Nan::To<Object>(info[0]).ToLocalChecked();
-  Local<Array> keys = Nan::GetOwnPropertyNames(obj).ToLocalChecked();
-  size_t nops = keys->Length();
-  vector<grpc_op> ops(nops);
-  unique_ptr<OpVec> op_vector(new OpVec());
-  for (unsigned int i = 0; i < nops; i++) {
-    unique_ptr<Op> op;
-    MaybeLocal<Value> maybe_key = Nan::Get(keys, i);
-    if (maybe_key.IsEmpty() || (!maybe_key.ToLocalChecked()->IsUint32())) {
-      return Nan::ThrowError(
-          "startBatch's first argument's keys must be integers");
-    }
-    uint32_t type = Nan::To<uint32_t>(maybe_key.ToLocalChecked()).FromJust();
-    ops[i].op = static_cast<grpc_op_type>(type);
-    ops[i].flags = 0;
-    ops[i].reserved = NULL;
-    switch (type) {
-      case GRPC_OP_SEND_INITIAL_METADATA:
-        op.reset(new SendMetadataOp());
-        break;
-      case GRPC_OP_SEND_MESSAGE:
-        op.reset(new SendMessageOp());
-        break;
-      case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
-        op.reset(new SendClientCloseOp());
-        break;
-      case GRPC_OP_SEND_STATUS_FROM_SERVER:
-        op.reset(new SendServerStatusOp());
-        break;
-      case GRPC_OP_RECV_INITIAL_METADATA:
-        op.reset(new GetMetadataOp());
-        break;
-      case GRPC_OP_RECV_MESSAGE:
-        op.reset(new ReadMessageOp());
-        break;
-      case GRPC_OP_RECV_STATUS_ON_CLIENT:
-        op.reset(new ClientStatusOp());
-        break;
-      case GRPC_OP_RECV_CLOSE_ON_SERVER:
-        op.reset(new ServerCloseResponseOp());
-        break;
-      default:
-        return Nan::ThrowError("Argument object had an unrecognized key");
-    }
-    if (!op->ParseOp(obj->Get(type), &ops[i])) {
-      return Nan::ThrowTypeError("Incorrectly typed arguments to startBatch");
-    }
-    op_vector->push_back(std::move(op));
-  }
-  Callback *callback = new Callback(callback_func);
-  grpc_call_error error = grpc_call_start_batch(
-      call->wrapped_call, &ops[0], nops,
-      new struct tag(callback, op_vector.release(), call, info.This()), NULL);
-  if (error != GRPC_CALL_OK) {
-    return Nan::ThrowError(nanErrorWithCode("startBatch failed", error));
-  }
-  call->pending_batches++;
-  CompletionQueueNext();
-}
-
-NAN_METHOD(Call::Cancel) {
-  if (!Call::HasInstance(info.This())) {
-    return Nan::ThrowTypeError("cancel can only be called on Call objects");
-  }
-  Call *call = ObjectWrap::Unwrap<Call>(info.This());
-  if (call->wrapped_call == NULL) {
-    /* Cancel is supposed to be idempotent. If the call has already finished,
-     * cancel should just complete silently */
-    return;
-  }
-  grpc_call_error error = grpc_call_cancel(call->wrapped_call, NULL);
-  if (error != GRPC_CALL_OK) {
-    return Nan::ThrowError(nanErrorWithCode("cancel failed", error));
-  }
-}
-
-NAN_METHOD(Call::CancelWithStatus) {
-  Nan::HandleScope scope;
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError("cancel can only be called on Call objects");
-  }
-  if (!info[0]->IsUint32()) {
-    return Nan::ThrowTypeError(
-        "cancelWithStatus's first argument must be a status code");
-  }
-  if (!info[1]->IsString()) {
-    return Nan::ThrowTypeError(
-        "cancelWithStatus's second argument must be a string");
-  }
-  Call *call = ObjectWrap::Unwrap<Call>(info.This());
-  if (call->wrapped_call == NULL) {
-    /* Cancel is supposed to be idempotent. If the call has already finished,
-     * cancel should just complete silently */
-    return;
-  }
-  grpc_status_code code =
-      static_cast<grpc_status_code>(Nan::To<uint32_t>(info[0]).FromJust());
-  if (code == GRPC_STATUS_OK) {
-    return Nan::ThrowRangeError(
-        "cancelWithStatus cannot be called with OK status");
-  }
-  Utf8String details(info[1]);
-  grpc_call_cancel_with_status(call->wrapped_call, code, *details, NULL);
-}
-
-NAN_METHOD(Call::GetPeer) {
-  Nan::HandleScope scope;
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError("getPeer can only be called on Call objects");
-  }
-  Call *call = ObjectWrap::Unwrap<Call>(info.This());
-  Local<Value> peer_value = Nan::New(call->peer).ToLocalChecked();
-  info.GetReturnValue().Set(peer_value);
-}
-
-NAN_METHOD(Call::SetCredentials) {
-  Nan::HandleScope scope;
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError(
-        "setCredentials can only be called on Call objects");
-  }
-  if (!CallCredentials::HasInstance(info[0])) {
-    return Nan::ThrowTypeError(
-        "setCredentials' first argument must be a CallCredentials");
-  }
-  Call *call = ObjectWrap::Unwrap<Call>(info.This());
-  if (call->wrapped_call == NULL) {
-    return Nan::ThrowError(
-        "Cannot set credentials on a call that has already started");
-  }
-  CallCredentials *creds_object = ObjectWrap::Unwrap<CallCredentials>(
-      Nan::To<Object>(info[0]).ToLocalChecked());
-  grpc_call_credentials *creds = creds_object->GetWrappedCredentials();
-  grpc_call_error error = GRPC_CALL_ERROR;
-  if (creds) {
-    error = grpc_call_set_credentials(call->wrapped_call, creds);
-  }
-  info.GetReturnValue().Set(Nan::New<Uint32>(error));
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/call.h b/src/node/ext/call.h
deleted file mode 100644
index 50248c0..0000000
--- a/src/node/ext/call.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef NET_GRPC_NODE_CALL_H_
-#define NET_GRPC_NODE_CALL_H_
-
-#include <memory>
-#include <vector>
-
-#include <nan.h>
-#include <node.h>
-#include "grpc/grpc.h"
-#include "grpc/support/log.h"
-
-#include "channel.h"
-
-namespace grpc {
-namespace node {
-
-using std::unique_ptr;
-using std::shared_ptr;
-
-v8::Local<v8::Value> nanErrorWithCode(const char *msg, grpc_call_error code);
-
-v8::Local<v8::Value> ParseMetadata(const grpc_metadata_array *metadata_array);
-
-bool CreateMetadataArray(v8::Local<v8::Object> metadata,
-                         grpc_metadata_array *array);
-
-void DestroyMetadataArray(grpc_metadata_array *array);
-
-/* Wrapper class for grpc_call structs. */
-class Call : public Nan::ObjectWrap {
- public:
-  static void Init(v8::Local<v8::Object> exports);
-  static bool HasInstance(v8::Local<v8::Value> val);
-  /* Wrap a grpc_call struct in a javascript object */
-  static v8::Local<v8::Value> WrapStruct(grpc_call *call);
-
-  void CompleteBatch(bool is_final_op);
-
- private:
-  explicit Call(grpc_call *call);
-  ~Call();
-
-  // Prevent copying
-  Call(const Call &);
-  Call &operator=(const Call &);
-
-  void DestroyCall();
-
-  static NAN_METHOD(New);
-  static NAN_METHOD(StartBatch);
-  static NAN_METHOD(Cancel);
-  static NAN_METHOD(CancelWithStatus);
-  static NAN_METHOD(GetPeer);
-  static NAN_METHOD(SetCredentials);
-  static Nan::Callback *constructor;
-  // Used for typechecking instances of this javascript class
-  static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
-
-  grpc_call *wrapped_call;
-  // The number of ops that were started but not completed on this call
-  int pending_batches;
-  /* Indicates whether the "final" op on a call has completed. For a client
-     call, this is GRPC_OP_RECV_STATUS_ON_CLIENT and for a server call, this
-     is GRPC_OP_SEND_STATUS_FROM_SERVER */
-  bool has_final_op_completed;
-  char *peer;
-};
-
-class Op {
- public:
-  virtual v8::Local<v8::Value> GetNodeValue() const = 0;
-  virtual bool ParseOp(v8::Local<v8::Value> value, grpc_op *out) = 0;
-  virtual ~Op();
-  v8::Local<v8::Value> GetOpType() const;
-  virtual bool IsFinalOp() = 0;
-  virtual void OnComplete(bool success) = 0;
-
- protected:
-  virtual std::string GetTypeString() const = 0;
-};
-
-typedef std::vector<unique_ptr<Op>> OpVec;
-struct tag {
-  tag(Nan::Callback *callback, OpVec *ops, Call *call,
-      v8::Local<v8::Value> call_value);
-  ~tag();
-  Nan::Callback *callback;
-  OpVec *ops;
-  Call *call;
-  Nan::Persistent<v8::Value, Nan::CopyablePersistentTraits<v8::Value>>
-      call_persist;
-};
-
-void DestroyTag(void *tag);
-
-void CompleteTag(void *tag, const char *error_message);
-
-}  // namespace node
-}  // namespace grpc
-
-#endif  // NET_GRPC_NODE_CALL_H_
diff --git a/src/node/ext/call_credentials.cc b/src/node/ext/call_credentials.cc
deleted file mode 100644
index 0644a81..0000000
--- a/src/node/ext/call_credentials.cc
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <nan.h>
-#include <node.h>
-#include <uv.h>
-
-#include <queue>
-
-#include "call.h"
-#include "call_credentials.h"
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
-#include "grpc/support/log.h"
-
-namespace grpc {
-namespace node {
-
-using Nan::Callback;
-using Nan::EscapableHandleScope;
-using Nan::HandleScope;
-using Nan::Maybe;
-using Nan::MaybeLocal;
-using Nan::ObjectWrap;
-using Nan::Persistent;
-using Nan::Utf8String;
-
-using v8::Exception;
-using v8::External;
-using v8::Function;
-using v8::FunctionTemplate;
-using v8::Integer;
-using v8::Local;
-using v8::Object;
-using v8::ObjectTemplate;
-using v8::Value;
-
-Nan::Callback *CallCredentials::constructor;
-Persistent<FunctionTemplate> CallCredentials::fun_tpl;
-
-static Callback *plugin_callback;
-
-CallCredentials::CallCredentials(grpc_call_credentials *credentials)
-    : wrapped_credentials(credentials) {}
-
-CallCredentials::~CallCredentials() {
-  grpc_call_credentials_release(wrapped_credentials);
-}
-
-void CallCredentials::Init(Local<Object> exports) {
-  HandleScope scope;
-  Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New);
-  tpl->SetClassName(Nan::New("CallCredentials").ToLocalChecked());
-  tpl->InstanceTemplate()->SetInternalFieldCount(1);
-  Nan::SetPrototypeMethod(tpl, "compose", Compose);
-  fun_tpl.Reset(tpl);
-  Local<Function> ctr = Nan::GetFunction(tpl).ToLocalChecked();
-  Nan::Set(ctr, Nan::New("createFromPlugin").ToLocalChecked(),
-           Nan::GetFunction(Nan::New<FunctionTemplate>(CreateFromPlugin))
-               .ToLocalChecked());
-  Nan::Set(exports, Nan::New("CallCredentials").ToLocalChecked(), ctr);
-  constructor = new Nan::Callback(ctr);
-
-  Local<FunctionTemplate> callback_tpl =
-      Nan::New<FunctionTemplate>(PluginCallback);
-  plugin_callback =
-      new Callback(Nan::GetFunction(callback_tpl).ToLocalChecked());
-}
-
-bool CallCredentials::HasInstance(Local<Value> val) {
-  HandleScope scope;
-  return Nan::New(fun_tpl)->HasInstance(val);
-}
-
-Local<Value> CallCredentials::WrapStruct(grpc_call_credentials *credentials) {
-  EscapableHandleScope scope;
-  const int argc = 1;
-  if (credentials == NULL) {
-    return scope.Escape(Nan::Null());
-  }
-  Local<Value> argv[argc] = {
-      Nan::New<External>(reinterpret_cast<void *>(credentials))};
-  MaybeLocal<Object> maybe_instance =
-      Nan::NewInstance(constructor->GetFunction(), argc, argv);
-  if (maybe_instance.IsEmpty()) {
-    return scope.Escape(Nan::Null());
-  } else {
-    return scope.Escape(maybe_instance.ToLocalChecked());
-  }
-}
-
-grpc_call_credentials *CallCredentials::GetWrappedCredentials() {
-  return wrapped_credentials;
-}
-
-NAN_METHOD(CallCredentials::New) {
-  if (info.IsConstructCall()) {
-    if (!info[0]->IsExternal()) {
-      return Nan::ThrowTypeError(
-          "CallCredentials can only be created with the provided functions");
-    }
-    Local<External> ext = info[0].As<External>();
-    grpc_call_credentials *creds_value =
-        reinterpret_cast<grpc_call_credentials *>(ext->Value());
-    CallCredentials *credentials = new CallCredentials(creds_value);
-    credentials->Wrap(info.This());
-    info.GetReturnValue().Set(info.This());
-    return;
-  } else {
-    // This should never be called directly
-    return Nan::ThrowTypeError(
-        "CallCredentials can only be created with the provided functions");
-  }
-}
-
-NAN_METHOD(CallCredentials::Compose) {
-  if (!CallCredentials::HasInstance(info.This())) {
-    return Nan::ThrowTypeError(
-        "compose can only be called on CallCredentials objects");
-  }
-  if (!CallCredentials::HasInstance(info[0])) {
-    return Nan::ThrowTypeError(
-        "compose's first argument must be a CallCredentials object");
-  }
-  CallCredentials *self = ObjectWrap::Unwrap<CallCredentials>(info.This());
-  CallCredentials *other = ObjectWrap::Unwrap<CallCredentials>(
-      Nan::To<Object>(info[0]).ToLocalChecked());
-  grpc_call_credentials *creds = grpc_composite_call_credentials_create(
-      self->wrapped_credentials, other->wrapped_credentials, NULL);
-  info.GetReturnValue().Set(WrapStruct(creds));
-}
-
-NAN_METHOD(CallCredentials::CreateFromPlugin) {
-  if (!info[0]->IsFunction()) {
-    return Nan::ThrowTypeError(
-        "createFromPlugin's argument must be a function");
-  }
-  grpc_metadata_credentials_plugin plugin;
-  plugin_state *state = new plugin_state;
-  state->callback = new Nan::Callback(info[0].As<Function>());
-  state->pending_callbacks = new std::queue<plugin_callback_data *>();
-  uv_mutex_init(&state->plugin_mutex);
-  uv_async_init(uv_default_loop(), &state->plugin_async, SendPluginCallback);
-  uv_unref((uv_handle_t *)&state->plugin_async);
-
-  state->plugin_async.data = state;
-
-  plugin.get_metadata = plugin_get_metadata;
-  plugin.destroy = plugin_destroy_state;
-  plugin.state = reinterpret_cast<void *>(state);
-  plugin.type = "";
-  grpc_call_credentials *creds =
-      grpc_metadata_credentials_create_from_plugin(plugin, NULL);
-  info.GetReturnValue().Set(WrapStruct(creds));
-}
-
-NAN_METHOD(PluginCallback) {
-  // Arguments: status code, error details, metadata
-  if (!info[0]->IsUint32()) {
-    return Nan::ThrowTypeError(
-        "The callback's first argument must be a status code");
-  }
-  if (!info[1]->IsString()) {
-    return Nan::ThrowTypeError(
-        "The callback's second argument must be a string");
-  }
-  if (!info[2]->IsObject()) {
-    return Nan::ThrowTypeError(
-        "The callback's third argument must be an object");
-  }
-  if (!info[3]->IsObject()) {
-    return Nan::ThrowTypeError(
-        "The callback's fourth argument must be an object");
-  }
-  grpc_status_code code =
-      static_cast<grpc_status_code>(Nan::To<uint32_t>(info[0]).FromJust());
-  Utf8String details_utf8_str(info[1]);
-  char *details = *details_utf8_str;
-  grpc_metadata_array array;
-  grpc_metadata_array_init(&array);
-  Local<Object> callback_data = Nan::To<Object>(info[3]).ToLocalChecked();
-  if (!CreateMetadataArray(Nan::To<Object>(info[2]).ToLocalChecked(), &array)) {
-    return Nan::ThrowError("Failed to parse metadata");
-  }
-  grpc_credentials_plugin_metadata_cb cb =
-      reinterpret_cast<grpc_credentials_plugin_metadata_cb>(
-          Nan::Get(callback_data, Nan::New("cb").ToLocalChecked())
-              .ToLocalChecked()
-              .As<External>()
-              ->Value());
-  void *user_data =
-      Nan::Get(callback_data, Nan::New("user_data").ToLocalChecked())
-          .ToLocalChecked()
-          .As<External>()
-          ->Value();
-  cb(user_data, array.metadata, array.count, code, details);
-  DestroyMetadataArray(&array);
-}
-
-NAUV_WORK_CB(SendPluginCallback) {
-  Nan::HandleScope scope;
-  plugin_state *state = reinterpret_cast<plugin_state *>(async->data);
-  std::queue<plugin_callback_data *> callbacks;
-  uv_mutex_lock(&state->plugin_mutex);
-  state->pending_callbacks->swap(callbacks);
-  uv_mutex_unlock(&state->plugin_mutex);
-  while (!callbacks.empty()) {
-    plugin_callback_data *data = callbacks.front();
-    callbacks.pop();
-    Local<Object> callback_data = Nan::New<Object>();
-    Nan::Set(callback_data, Nan::New("cb").ToLocalChecked(),
-             Nan::New<v8::External>(reinterpret_cast<void *>(data->cb)));
-    Nan::Set(callback_data, Nan::New("user_data").ToLocalChecked(),
-             Nan::New<v8::External>(data->user_data));
-    const int argc = 3;
-    v8::Local<v8::Value> argv[argc] = {
-        Nan::New(data->service_url).ToLocalChecked(), callback_data,
-        // Get Local<Function> from Nan::Callback*
-        **plugin_callback};
-    Nan::Callback *callback = state->callback;
-    callback->Call(argc, argv);
-    delete data;
-  }
-}
-
-int plugin_get_metadata(
-    void *state, grpc_auth_metadata_context context,
-    grpc_credentials_plugin_metadata_cb cb, void *user_data,
-    grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
-    size_t *num_creds_md, grpc_status_code *status,
-    const char **error_details) {
-  plugin_state *p_state = reinterpret_cast<plugin_state *>(state);
-  plugin_callback_data *data = new plugin_callback_data;
-  data->service_url = context.service_url;
-  data->cb = cb;
-  data->user_data = user_data;
-
-  uv_mutex_lock(&p_state->plugin_mutex);
-  p_state->pending_callbacks->push(data);
-  uv_mutex_unlock(&p_state->plugin_mutex);
-
-  uv_async_send(&p_state->plugin_async);
-  return 0;  // Async processing.
-}
-
-void plugin_uv_close_cb(uv_handle_t *handle) {
-  uv_async_t *async = reinterpret_cast<uv_async_t *>(handle);
-  plugin_state *state = reinterpret_cast<plugin_state *>(async->data);
-  uv_mutex_destroy(&state->plugin_mutex);
-  delete state->pending_callbacks;
-  delete state->callback;
-  delete state;
-}
-
-void plugin_destroy_state(void *ptr) {
-  plugin_state *state = reinterpret_cast<plugin_state *>(ptr);
-  uv_close((uv_handle_t *)&state->plugin_async, plugin_uv_close_cb);
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/call_credentials.h b/src/node/ext/call_credentials.h
deleted file mode 100644
index 3a54bbf..0000000
--- a/src/node/ext/call_credentials.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_NODE_CALL_CREDENTIALS_H_
-#define GRPC_NODE_CALL_CREDENTIALS_H_
-
-#include <queue>
-
-#include <nan.h>
-#include <node.h>
-#include <uv.h>
-#include "grpc/grpc_security.h"
-
-namespace grpc {
-namespace node {
-
-class CallCredentials : public Nan::ObjectWrap {
- public:
-  static void Init(v8::Local<v8::Object> exports);
-  static bool HasInstance(v8::Local<v8::Value> val);
-  /* Wrap a grpc_call_credentials struct in a javascript object */
-  static v8::Local<v8::Value> WrapStruct(grpc_call_credentials *credentials);
-
-  /* Returns the grpc_call_credentials struct that this object wraps */
-  grpc_call_credentials *GetWrappedCredentials();
-
- private:
-  explicit CallCredentials(grpc_call_credentials *credentials);
-  ~CallCredentials();
-
-  // Prevent copying
-  CallCredentials(const CallCredentials &);
-  CallCredentials &operator=(const CallCredentials &);
-
-  static NAN_METHOD(New);
-  static NAN_METHOD(CreateSsl);
-  static NAN_METHOD(CreateFromPlugin);
-
-  static NAN_METHOD(Compose);
-  static Nan::Callback *constructor;
-  // Used for typechecking instances of this javascript class
-  static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
-
-  grpc_call_credentials *wrapped_credentials;
-};
-
-/* Auth metadata plugin functionality */
-
-typedef struct plugin_callback_data {
-  const char *service_url;
-  grpc_credentials_plugin_metadata_cb cb;
-  void *user_data;
-} plugin_callback_data;
-
-typedef struct plugin_state {
-  Nan::Callback *callback;
-  std::queue<plugin_callback_data *> *pending_callbacks;
-  uv_mutex_t plugin_mutex;
-  // async.data == this
-  uv_async_t plugin_async;
-} plugin_state;
-
-int plugin_get_metadata(
-    void *state, grpc_auth_metadata_context context,
-    grpc_credentials_plugin_metadata_cb cb, void *user_data,
-    grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
-    size_t *num_creds_md, grpc_status_code *status, const char **error_details);
-
-void plugin_destroy_state(void *state);
-
-NAN_METHOD(PluginCallback);
-
-NAUV_WORK_CB(SendPluginCallback);
-
-}  // namespace node
-}  // namepsace grpc
-
-#endif  // GRPC_NODE_CALL_CREDENTIALS_H_
diff --git a/src/node/ext/channel.cc b/src/node/ext/channel.cc
deleted file mode 100644
index fc085fa..0000000
--- a/src/node/ext/channel.cc
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <vector>
-
-#include "grpc/support/log.h"
-
-#include <nan.h>
-#include <node.h>
-#include "call.h"
-#include "channel.h"
-#include "channel_credentials.h"
-#include "completion_queue.h"
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
-#include "timeval.h"
-
-namespace grpc {
-namespace node {
-
-using Nan::Callback;
-using Nan::EscapableHandleScope;
-using Nan::HandleScope;
-using Nan::Maybe;
-using Nan::MaybeLocal;
-using Nan::ObjectWrap;
-using Nan::Persistent;
-using Nan::Utf8String;
-
-using v8::Array;
-using v8::Exception;
-using v8::Function;
-using v8::FunctionTemplate;
-using v8::Integer;
-using v8::Local;
-using v8::Number;
-using v8::Object;
-using v8::String;
-using v8::Value;
-
-Callback *Channel::constructor;
-Persistent<FunctionTemplate> Channel::fun_tpl;
-
-bool ParseChannelArgs(Local<Value> args_val,
-                      grpc_channel_args **channel_args_ptr) {
-  if (args_val->IsUndefined() || args_val->IsNull()) {
-    *channel_args_ptr = NULL;
-    return true;
-  }
-  if (!args_val->IsObject()) {
-    *channel_args_ptr = NULL;
-    return false;
-  }
-  grpc_channel_args *channel_args =
-      reinterpret_cast<grpc_channel_args *>(malloc(sizeof(grpc_channel_args)));
-  *channel_args_ptr = channel_args;
-  Local<Object> args_hash = Nan::To<Object>(args_val).ToLocalChecked();
-  Local<Array> keys = Nan::GetOwnPropertyNames(args_hash).ToLocalChecked();
-  channel_args->num_args = keys->Length();
-  channel_args->args = reinterpret_cast<grpc_arg *>(
-      calloc(channel_args->num_args, sizeof(grpc_arg)));
-  for (unsigned int i = 0; i < channel_args->num_args; i++) {
-    Local<Value> key = Nan::Get(keys, i).ToLocalChecked();
-    Utf8String key_str(key);
-    if (*key_str == NULL) {
-      // Key string onversion failed
-      return false;
-    }
-    Local<Value> value = Nan::Get(args_hash, key).ToLocalChecked();
-    if (value->IsInt32()) {
-      channel_args->args[i].type = GRPC_ARG_INTEGER;
-      channel_args->args[i].value.integer = Nan::To<int32_t>(value).FromJust();
-    } else if (value->IsString()) {
-      Utf8String val_str(value);
-      channel_args->args[i].type = GRPC_ARG_STRING;
-      channel_args->args[i].value.string =
-          reinterpret_cast<char *>(calloc(val_str.length() + 1, sizeof(char)));
-      memcpy(channel_args->args[i].value.string, *val_str,
-             val_str.length() + 1);
-    } else {
-      // The value does not match either of the accepted types
-      return false;
-    }
-    channel_args->args[i].key =
-        reinterpret_cast<char *>(calloc(key_str.length() + 1, sizeof(char)));
-    memcpy(channel_args->args[i].key, *key_str, key_str.length() + 1);
-  }
-  return true;
-}
-
-void DeallocateChannelArgs(grpc_channel_args *channel_args) {
-  if (channel_args == NULL) {
-    return;
-  }
-  for (size_t i = 0; i < channel_args->num_args; i++) {
-    if (channel_args->args[i].key == NULL) {
-      /* NULL key implies that this argument and all subsequent arguments failed
-       * to parse */
-      break;
-    }
-    free(channel_args->args[i].key);
-    if (channel_args->args[i].type == GRPC_ARG_STRING) {
-      free(channel_args->args[i].value.string);
-    }
-  }
-  free(channel_args->args);
-  free(channel_args);
-}
-
-Channel::Channel(grpc_channel *channel) : wrapped_channel(channel) {}
-
-Channel::~Channel() {
-  gpr_log(GPR_DEBUG, "Destroying channel");
-  if (wrapped_channel != NULL) {
-    grpc_channel_destroy(wrapped_channel);
-  }
-}
-
-void Channel::Init(Local<Object> exports) {
-  Nan::HandleScope scope;
-  Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New);
-  tpl->SetClassName(Nan::New("Channel").ToLocalChecked());
-  tpl->InstanceTemplate()->SetInternalFieldCount(1);
-  Nan::SetPrototypeMethod(tpl, "close", Close);
-  Nan::SetPrototypeMethod(tpl, "getTarget", GetTarget);
-  Nan::SetPrototypeMethod(tpl, "getConnectivityState", GetConnectivityState);
-  Nan::SetPrototypeMethod(tpl, "watchConnectivityState",
-                          WatchConnectivityState);
-  fun_tpl.Reset(tpl);
-  Local<Function> ctr = Nan::GetFunction(tpl).ToLocalChecked();
-  Nan::Set(exports, Nan::New("Channel").ToLocalChecked(), ctr);
-  constructor = new Callback(ctr);
-}
-
-bool Channel::HasInstance(Local<Value> val) {
-  HandleScope scope;
-  return Nan::New(fun_tpl)->HasInstance(val);
-}
-
-grpc_channel *Channel::GetWrappedChannel() { return this->wrapped_channel; }
-
-NAN_METHOD(Channel::New) {
-  if (info.IsConstructCall()) {
-    if (!info[0]->IsString()) {
-      return Nan::ThrowTypeError(
-          "Channel expects a string, a credential and an object");
-    }
-    grpc_channel *wrapped_channel;
-    // Owned by the Channel object
-    Utf8String host(info[0]);
-    grpc_channel_credentials *creds;
-    if (!ChannelCredentials::HasInstance(info[1])) {
-      return Nan::ThrowTypeError(
-          "Channel's second argument must be a ChannelCredentials");
-    }
-    ChannelCredentials *creds_object = ObjectWrap::Unwrap<ChannelCredentials>(
-        Nan::To<Object>(info[1]).ToLocalChecked());
-    creds = creds_object->GetWrappedCredentials();
-    grpc_channel_args *channel_args_ptr = NULL;
-    if (!ParseChannelArgs(info[2], &channel_args_ptr)) {
-      DeallocateChannelArgs(channel_args_ptr);
-      return Nan::ThrowTypeError(
-          "Channel options must be an object with "
-          "string keys and integer or string values");
-    }
-    if (creds == NULL) {
-      wrapped_channel =
-          grpc_insecure_channel_create(*host, channel_args_ptr, NULL);
-    } else {
-      wrapped_channel =
-          grpc_secure_channel_create(creds, *host, channel_args_ptr, NULL);
-    }
-    DeallocateChannelArgs(channel_args_ptr);
-    Channel *channel = new Channel(wrapped_channel);
-    channel->Wrap(info.This());
-    info.GetReturnValue().Set(info.This());
-    return;
-  } else {
-    const int argc = 3;
-    Local<Value> argv[argc] = {info[0], info[1], info[2]};
-    MaybeLocal<Object> maybe_instance =
-        Nan::NewInstance(constructor->GetFunction(), argc, argv);
-    if (maybe_instance.IsEmpty()) {
-      // There's probably a pending exception
-      return;
-    } else {
-      info.GetReturnValue().Set(maybe_instance.ToLocalChecked());
-    }
-  }
-}
-
-NAN_METHOD(Channel::Close) {
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError("close can only be called on Channel objects");
-  }
-  Channel *channel = ObjectWrap::Unwrap<Channel>(info.This());
-  if (channel->wrapped_channel != NULL) {
-    grpc_channel_destroy(channel->wrapped_channel);
-    channel->wrapped_channel = NULL;
-  }
-}
-
-NAN_METHOD(Channel::GetTarget) {
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError(
-        "getTarget can only be called on Channel objects");
-  }
-  Channel *channel = ObjectWrap::Unwrap<Channel>(info.This());
-  info.GetReturnValue().Set(
-      Nan::New(grpc_channel_get_target(channel->wrapped_channel))
-          .ToLocalChecked());
-}
-
-NAN_METHOD(Channel::GetConnectivityState) {
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError(
-        "getConnectivityState can only be called on Channel objects");
-  }
-  Channel *channel = ObjectWrap::Unwrap<Channel>(info.This());
-  int try_to_connect = (int)info[0]->Equals(Nan::True());
-  info.GetReturnValue().Set(grpc_channel_check_connectivity_state(
-      channel->wrapped_channel, try_to_connect));
-}
-
-NAN_METHOD(Channel::WatchConnectivityState) {
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError(
-        "watchConnectivityState can only be called on Channel objects");
-  }
-  if (!info[0]->IsUint32()) {
-    return Nan::ThrowTypeError(
-        "watchConnectivityState's first argument must be a channel state");
-  }
-  if (!(info[1]->IsNumber() || info[1]->IsDate())) {
-    return Nan::ThrowTypeError(
-        "watchConnectivityState's second argument must be a date or a number");
-  }
-  if (!info[2]->IsFunction()) {
-    return Nan::ThrowTypeError(
-        "watchConnectivityState's third argument must be a callback");
-  }
-  grpc_connectivity_state last_state = static_cast<grpc_connectivity_state>(
-      Nan::To<uint32_t>(info[0]).FromJust());
-  double deadline = Nan::To<double>(info[1]).FromJust();
-  Local<Function> callback_func = info[2].As<Function>();
-  Nan::Callback *callback = new Callback(callback_func);
-  Channel *channel = ObjectWrap::Unwrap<Channel>(info.This());
-  unique_ptr<OpVec> ops(new OpVec());
-  grpc_channel_watch_connectivity_state(
-      channel->wrapped_channel, last_state, MillisecondsToTimespec(deadline),
-      GetCompletionQueue(),
-      new struct tag(callback, ops.release(), NULL, Nan::Null()));
-  CompletionQueueNext();
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/channel.h b/src/node/ext/channel.h
deleted file mode 100644
index a93dbe9..0000000
--- a/src/node/ext/channel.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef NET_GRPC_NODE_CHANNEL_H_
-#define NET_GRPC_NODE_CHANNEL_H_
-
-#include <nan.h>
-#include <node.h>
-#include "grpc/grpc.h"
-
-namespace grpc {
-namespace node {
-
-bool ParseChannelArgs(v8::Local<v8::Value> args_val,
-                      grpc_channel_args **channel_args_ptr);
-
-void DeallocateChannelArgs(grpc_channel_args *channel_args);
-
-/* Wrapper class for grpc_channel structs */
-class Channel : public Nan::ObjectWrap {
- public:
-  static void Init(v8::Local<v8::Object> exports);
-  static bool HasInstance(v8::Local<v8::Value> val);
-  /* This is used to typecheck javascript objects before converting them to
-     this type */
-  static v8::Persistent<v8::Value> prototype;
-
-  /* Returns the grpc_channel struct that this object wraps */
-  grpc_channel *GetWrappedChannel();
-
- private:
-  explicit Channel(grpc_channel *channel);
-  ~Channel();
-
-  // Prevent copying
-  Channel(const Channel &);
-  Channel &operator=(const Channel &);
-
-  static NAN_METHOD(New);
-  static NAN_METHOD(Close);
-  static NAN_METHOD(GetTarget);
-  static NAN_METHOD(GetConnectivityState);
-  static NAN_METHOD(WatchConnectivityState);
-  static Nan::Callback *constructor;
-  static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
-
-  grpc_channel *wrapped_channel;
-};
-
-}  // namespace node
-}  // namespace grpc
-
-#endif  // NET_GRPC_NODE_CHANNEL_H_
diff --git a/src/node/ext/channel_credentials.cc b/src/node/ext/channel_credentials.cc
deleted file mode 100644
index 9e87fb6..0000000
--- a/src/node/ext/channel_credentials.cc
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <node.h>
-
-#include "call.h"
-#include "call_credentials.h"
-#include "channel_credentials.h"
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
-#include "grpc/support/log.h"
-
-namespace grpc {
-namespace node {
-
-using Nan::Callback;
-using Nan::EscapableHandleScope;
-using Nan::HandleScope;
-using Nan::Maybe;
-using Nan::MaybeLocal;
-using Nan::ObjectWrap;
-using Nan::Persistent;
-using Nan::Utf8String;
-
-using v8::Exception;
-using v8::External;
-using v8::Function;
-using v8::FunctionTemplate;
-using v8::Integer;
-using v8::Local;
-using v8::Object;
-using v8::ObjectTemplate;
-using v8::Value;
-
-Nan::Callback *ChannelCredentials::constructor;
-Persistent<FunctionTemplate> ChannelCredentials::fun_tpl;
-
-ChannelCredentials::ChannelCredentials(grpc_channel_credentials *credentials)
-    : wrapped_credentials(credentials) {}
-
-ChannelCredentials::~ChannelCredentials() {
-  grpc_channel_credentials_release(wrapped_credentials);
-}
-
-void ChannelCredentials::Init(Local<Object> exports) {
-  HandleScope scope;
-  Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New);
-  tpl->SetClassName(Nan::New("ChannelCredentials").ToLocalChecked());
-  tpl->InstanceTemplate()->SetInternalFieldCount(1);
-  Nan::SetPrototypeMethod(tpl, "compose", Compose);
-  fun_tpl.Reset(tpl);
-  Local<Function> ctr = Nan::GetFunction(tpl).ToLocalChecked();
-  Nan::Set(
-      ctr, Nan::New("createSsl").ToLocalChecked(),
-      Nan::GetFunction(Nan::New<FunctionTemplate>(CreateSsl)).ToLocalChecked());
-  Nan::Set(ctr, Nan::New("createInsecure").ToLocalChecked(),
-           Nan::GetFunction(Nan::New<FunctionTemplate>(CreateInsecure))
-               .ToLocalChecked());
-  Nan::Set(exports, Nan::New("ChannelCredentials").ToLocalChecked(), ctr);
-  constructor = new Nan::Callback(ctr);
-}
-
-bool ChannelCredentials::HasInstance(Local<Value> val) {
-  HandleScope scope;
-  return Nan::New(fun_tpl)->HasInstance(val);
-}
-
-Local<Value> ChannelCredentials::WrapStruct(
-    grpc_channel_credentials *credentials) {
-  EscapableHandleScope scope;
-  const int argc = 1;
-  Local<Value> argv[argc] = {
-      Nan::New<External>(reinterpret_cast<void *>(credentials))};
-  MaybeLocal<Object> maybe_instance =
-      Nan::NewInstance(constructor->GetFunction(), argc, argv);
-  if (maybe_instance.IsEmpty()) {
-    return scope.Escape(Nan::Null());
-  } else {
-    return scope.Escape(maybe_instance.ToLocalChecked());
-  }
-}
-
-grpc_channel_credentials *ChannelCredentials::GetWrappedCredentials() {
-  return wrapped_credentials;
-}
-
-NAN_METHOD(ChannelCredentials::New) {
-  if (info.IsConstructCall()) {
-    if (!info[0]->IsExternal()) {
-      return Nan::ThrowTypeError(
-          "ChannelCredentials can only be created with the provided functions");
-    }
-    Local<External> ext = info[0].As<External>();
-    grpc_channel_credentials *creds_value =
-        reinterpret_cast<grpc_channel_credentials *>(ext->Value());
-    ChannelCredentials *credentials = new ChannelCredentials(creds_value);
-    credentials->Wrap(info.This());
-    info.GetReturnValue().Set(info.This());
-    return;
-  } else {
-    // This should never be called directly
-    return Nan::ThrowTypeError(
-        "ChannelCredentials can only be created with the provided functions");
-  }
-}
-
-NAN_METHOD(ChannelCredentials::CreateSsl) {
-  char *root_certs = NULL;
-  grpc_ssl_pem_key_cert_pair key_cert_pair = {NULL, NULL};
-  if (::node::Buffer::HasInstance(info[0])) {
-    root_certs = ::node::Buffer::Data(info[0]);
-  } else if (!(info[0]->IsNull() || info[0]->IsUndefined())) {
-    return Nan::ThrowTypeError("createSsl's first argument must be a Buffer");
-  }
-  if (::node::Buffer::HasInstance(info[1])) {
-    key_cert_pair.private_key = ::node::Buffer::Data(info[1]);
-  } else if (!(info[1]->IsNull() || info[1]->IsUndefined())) {
-    return Nan::ThrowTypeError(
-        "createSSl's second argument must be a Buffer if provided");
-  }
-  if (::node::Buffer::HasInstance(info[2])) {
-    key_cert_pair.cert_chain = ::node::Buffer::Data(info[2]);
-  } else if (!(info[2]->IsNull() || info[2]->IsUndefined())) {
-    return Nan::ThrowTypeError(
-        "createSSl's third argument must be a Buffer if provided");
-  }
-  if ((key_cert_pair.private_key == NULL) !=
-      (key_cert_pair.cert_chain == NULL)) {
-    return Nan::ThrowError(
-        "createSsl's second and third arguments must be"
-        " provided or omitted together");
-  }
-  grpc_channel_credentials *creds = grpc_ssl_credentials_create(
-      root_certs, key_cert_pair.private_key == NULL ? NULL : &key_cert_pair,
-      NULL);
-  if (creds == NULL) {
-    info.GetReturnValue().SetNull();
-  } else {
-    info.GetReturnValue().Set(WrapStruct(creds));
-  }
-}
-
-NAN_METHOD(ChannelCredentials::Compose) {
-  if (!ChannelCredentials::HasInstance(info.This())) {
-    return Nan::ThrowTypeError(
-        "compose can only be called on ChannelCredentials objects");
-  }
-  if (!CallCredentials::HasInstance(info[0])) {
-    return Nan::ThrowTypeError(
-        "compose's first argument must be a CallCredentials object");
-  }
-  ChannelCredentials *self =
-      ObjectWrap::Unwrap<ChannelCredentials>(info.This());
-  if (self->wrapped_credentials == NULL) {
-    return Nan::ThrowTypeError("Cannot compose insecure credential");
-  }
-  CallCredentials *other = ObjectWrap::Unwrap<CallCredentials>(
-      Nan::To<Object>(info[0]).ToLocalChecked());
-  grpc_channel_credentials *creds = grpc_composite_channel_credentials_create(
-      self->wrapped_credentials, other->GetWrappedCredentials(), NULL);
-  if (creds == NULL) {
-    info.GetReturnValue().SetNull();
-  } else {
-    info.GetReturnValue().Set(WrapStruct(creds));
-  }
-}
-
-NAN_METHOD(ChannelCredentials::CreateInsecure) {
-  info.GetReturnValue().Set(WrapStruct(NULL));
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/channel_credentials.h b/src/node/ext/channel_credentials.h
deleted file mode 100644
index 18c1483..0000000
--- a/src/node/ext/channel_credentials.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_
-#define NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_
-
-#include <nan.h>
-#include <node.h>
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
-
-namespace grpc {
-namespace node {
-
-/* Wrapper class for grpc_channel_credentials structs */
-class ChannelCredentials : public Nan::ObjectWrap {
- public:
-  static void Init(v8::Local<v8::Object> exports);
-  static bool HasInstance(v8::Local<v8::Value> val);
-  /* Wrap a grpc_channel_credentials struct in a javascript object */
-  static v8::Local<v8::Value> WrapStruct(grpc_channel_credentials *credentials);
-
-  /* Returns the grpc_channel_credentials struct that this object wraps */
-  grpc_channel_credentials *GetWrappedCredentials();
-
- private:
-  explicit ChannelCredentials(grpc_channel_credentials *credentials);
-  ~ChannelCredentials();
-
-  // Prevent copying
-  ChannelCredentials(const ChannelCredentials &);
-  ChannelCredentials &operator=(const ChannelCredentials &);
-
-  static NAN_METHOD(New);
-  static NAN_METHOD(CreateSsl);
-  static NAN_METHOD(CreateInsecure);
-
-  static NAN_METHOD(Compose);
-  static Nan::Callback *constructor;
-  // Used for typechecking instances of this javascript class
-  static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
-
-  grpc_channel_credentials *wrapped_credentials;
-};
-
-}  // namespace node
-}  // namespace grpc
-
-#endif  // NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_
diff --git a/src/node/ext/completion_queue.cc b/src/node/ext/completion_queue.cc
deleted file mode 100644
index a08febb..0000000
--- a/src/node/ext/completion_queue.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <node.h>
-#include <uv.h>
-#include <v8.h>
-
-#include "call.h"
-#include "completion_queue.h"
-
-namespace grpc {
-namespace node {
-
-using v8::Local;
-using v8::Object;
-using v8::Value;
-
-grpc_completion_queue *queue;
-uv_prepare_t prepare;
-int pending_batches;
-
-void drain_completion_queue(uv_prepare_t *handle) {
-  Nan::HandleScope scope;
-  grpc_event event;
-  (void)handle;
-  do {
-    event = grpc_completion_queue_next(queue, gpr_inf_past(GPR_CLOCK_MONOTONIC),
-                                       NULL);
-
-    if (event.type == GRPC_OP_COMPLETE) {
-      const char *error_message;
-      if (event.success) {
-        error_message = NULL;
-      } else {
-        error_message = "The async function encountered an error";
-      }
-      CompleteTag(event.tag, error_message);
-      grpc::node::DestroyTag(event.tag);
-      pending_batches--;
-      if (pending_batches == 0) {
-        uv_prepare_stop(&prepare);
-      }
-    }
-  } while (event.type != GRPC_QUEUE_TIMEOUT);
-}
-
-grpc_completion_queue *GetCompletionQueue() { return queue; }
-
-void CompletionQueueNext() {
-  if (pending_batches == 0) {
-    GPR_ASSERT(!uv_is_active((uv_handle_t *)&prepare));
-    uv_prepare_start(&prepare, drain_completion_queue);
-  }
-  pending_batches++;
-}
-
-void CompletionQueueInit(Local<Object> exports) {
-  queue = grpc_completion_queue_create_for_next(NULL);
-  uv_prepare_init(uv_default_loop(), &prepare);
-  pending_batches = 0;
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/completion_queue.h b/src/node/ext/completion_queue.h
deleted file mode 100644
index f91d5ea..0000000
--- a/src/node/ext/completion_queue.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <v8.h>
-
-namespace grpc {
-namespace node {
-
-grpc_completion_queue *GetCompletionQueue();
-
-void CompletionQueueNext();
-
-void CompletionQueueInit(v8::Local<v8::Object> exports);
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/node_grpc.cc b/src/node/ext/node_grpc.cc
deleted file mode 100644
index 11ed083..0000000
--- a/src/node/ext/node_grpc.cc
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <queue>
-
-#include <nan.h>
-#include <node.h>
-#include <v8.h>
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
-#include "grpc/support/alloc.h"
-#include "grpc/support/log.h"
-#include "grpc/support/time.h"
-
-// TODO(murgatroid99): Remove this when the endpoint API becomes public
-extern "C" {
-#include "src/core/lib/iomgr/pollset_uv.h"
-}
-
-#include "call.h"
-#include "call_credentials.h"
-#include "channel.h"
-#include "channel_credentials.h"
-#include "completion_queue.h"
-#include "server.h"
-#include "server_credentials.h"
-#include "slice.h"
-#include "timeval.h"
-
-using grpc::node::CreateSliceFromString;
-
-using v8::FunctionTemplate;
-using v8::Local;
-using v8::Value;
-using v8::Number;
-using v8::Object;
-using v8::Uint32;
-using v8::String;
-
-typedef struct log_args {
-  gpr_log_func_args core_args;
-  gpr_timespec timestamp;
-} log_args;
-
-typedef struct logger_state {
-  Nan::Callback *callback;
-  std::queue<log_args *> *pending_args;
-  uv_mutex_t mutex;
-  uv_async_t async;
-  // Indicates that a logger has been set
-  bool logger_set;
-} logger_state;
-
-logger_state grpc_logger_state;
-
-static char *pem_root_certs = NULL;
-
-void InitOpTypeConstants(Local<Object> exports) {
-  Nan::HandleScope scope;
-  Local<Object> op_type = Nan::New<Object>();
-  Nan::Set(exports, Nan::New("opType").ToLocalChecked(), op_type);
-  Local<Value> SEND_INITIAL_METADATA(
-      Nan::New<Uint32, uint32_t>(GRPC_OP_SEND_INITIAL_METADATA));
-  Nan::Set(op_type, Nan::New("SEND_INITIAL_METADATA").ToLocalChecked(),
-           SEND_INITIAL_METADATA);
-  Local<Value> SEND_MESSAGE(Nan::New<Uint32, uint32_t>(GRPC_OP_SEND_MESSAGE));
-  Nan::Set(op_type, Nan::New("SEND_MESSAGE").ToLocalChecked(), SEND_MESSAGE);
-  Local<Value> SEND_CLOSE_FROM_CLIENT(
-      Nan::New<Uint32, uint32_t>(GRPC_OP_SEND_CLOSE_FROM_CLIENT));
-  Nan::Set(op_type, Nan::New("SEND_CLOSE_FROM_CLIENT").ToLocalChecked(),
-           SEND_CLOSE_FROM_CLIENT);
-  Local<Value> SEND_STATUS_FROM_SERVER(
-      Nan::New<Uint32, uint32_t>(GRPC_OP_SEND_STATUS_FROM_SERVER));
-  Nan::Set(op_type, Nan::New("SEND_STATUS_FROM_SERVER").ToLocalChecked(),
-           SEND_STATUS_FROM_SERVER);
-  Local<Value> RECV_INITIAL_METADATA(
-      Nan::New<Uint32, uint32_t>(GRPC_OP_RECV_INITIAL_METADATA));
-  Nan::Set(op_type, Nan::New("RECV_INITIAL_METADATA").ToLocalChecked(),
-           RECV_INITIAL_METADATA);
-  Local<Value> RECV_MESSAGE(Nan::New<Uint32, uint32_t>(GRPC_OP_RECV_MESSAGE));
-  Nan::Set(op_type, Nan::New("RECV_MESSAGE").ToLocalChecked(), RECV_MESSAGE);
-  Local<Value> RECV_STATUS_ON_CLIENT(
-      Nan::New<Uint32, uint32_t>(GRPC_OP_RECV_STATUS_ON_CLIENT));
-  Nan::Set(op_type, Nan::New("RECV_STATUS_ON_CLIENT").ToLocalChecked(),
-           RECV_STATUS_ON_CLIENT);
-  Local<Value> RECV_CLOSE_ON_SERVER(
-      Nan::New<Uint32, uint32_t>(GRPC_OP_RECV_CLOSE_ON_SERVER));
-  Nan::Set(op_type, Nan::New("RECV_CLOSE_ON_SERVER").ToLocalChecked(),
-           RECV_CLOSE_ON_SERVER);
-}
-
-void InitConnectivityStateConstants(Local<Object> exports) {
-  Nan::HandleScope scope;
-  Local<Object> channel_state = Nan::New<Object>();
-  Nan::Set(exports, Nan::New("connectivityState").ToLocalChecked(),
-           channel_state);
-  Local<Value> IDLE(Nan::New<Uint32, uint32_t>(GRPC_CHANNEL_IDLE));
-  Nan::Set(channel_state, Nan::New("IDLE").ToLocalChecked(), IDLE);
-  Local<Value> CONNECTING(Nan::New<Uint32, uint32_t>(GRPC_CHANNEL_CONNECTING));
-  Nan::Set(channel_state, Nan::New("CONNECTING").ToLocalChecked(), CONNECTING);
-  Local<Value> READY(Nan::New<Uint32, uint32_t>(GRPC_CHANNEL_READY));
-  Nan::Set(channel_state, Nan::New("READY").ToLocalChecked(), READY);
-  Local<Value> TRANSIENT_FAILURE(
-      Nan::New<Uint32, uint32_t>(GRPC_CHANNEL_TRANSIENT_FAILURE));
-  Nan::Set(channel_state, Nan::New("TRANSIENT_FAILURE").ToLocalChecked(),
-           TRANSIENT_FAILURE);
-  Local<Value> FATAL_FAILURE(Nan::New<Uint32, uint32_t>(GRPC_CHANNEL_SHUTDOWN));
-  Nan::Set(channel_state, Nan::New("FATAL_FAILURE").ToLocalChecked(),
-           FATAL_FAILURE);
-}
-
-NAN_METHOD(MetadataKeyIsLegal) {
-  if (!info[0]->IsString()) {
-    return Nan::ThrowTypeError("headerKeyIsLegal's argument must be a string");
-  }
-  Local<String> key = Nan::To<String>(info[0]).ToLocalChecked();
-  grpc_slice slice = CreateSliceFromString(key);
-  info.GetReturnValue().Set(static_cast<bool>(grpc_header_key_is_legal(slice)));
-  grpc_slice_unref(slice);
-}
-
-NAN_METHOD(MetadataNonbinValueIsLegal) {
-  if (!info[0]->IsString()) {
-    return Nan::ThrowTypeError(
-        "metadataNonbinValueIsLegal's argument must be a string");
-  }
-  Local<String> value = Nan::To<String>(info[0]).ToLocalChecked();
-  grpc_slice slice = CreateSliceFromString(value);
-  info.GetReturnValue().Set(
-      static_cast<bool>(grpc_header_nonbin_value_is_legal(slice)));
-  grpc_slice_unref(slice);
-}
-
-NAN_METHOD(MetadataKeyIsBinary) {
-  if (!info[0]->IsString()) {
-    return Nan::ThrowTypeError(
-        "metadataKeyIsLegal's argument must be a string");
-  }
-  Local<String> key = Nan::To<String>(info[0]).ToLocalChecked();
-  grpc_slice slice = CreateSliceFromString(key);
-  info.GetReturnValue().Set(static_cast<bool>(grpc_is_binary_header(slice)));
-  grpc_slice_unref(slice);
-}
-
-static grpc_ssl_roots_override_result get_ssl_roots_override(
-    char **pem_root_certs_ptr) {
-  *pem_root_certs_ptr = pem_root_certs;
-  if (pem_root_certs == NULL) {
-    return GRPC_SSL_ROOTS_OVERRIDE_FAIL;
-  } else {
-    return GRPC_SSL_ROOTS_OVERRIDE_OK;
-  }
-}
-
-/* This should only be called once, and only before creating any
- *ServerCredentials */
-NAN_METHOD(SetDefaultRootsPem) {
-  if (!info[0]->IsString()) {
-    return Nan::ThrowTypeError(
-        "setDefaultRootsPem's argument must be a string");
-  }
-  Nan::Utf8String utf8_roots(info[0]);
-  size_t length = static_cast<size_t>(utf8_roots.length());
-  if (length > 0) {
-    const char *data = *utf8_roots;
-    pem_root_certs = (char *)gpr_malloc((length + 1) * sizeof(char));
-    memcpy(pem_root_certs, data, length + 1);
-  }
-}
-
-NAUV_WORK_CB(LogMessagesCallback) {
-  Nan::HandleScope scope;
-  std::queue<log_args *> args;
-  uv_mutex_lock(&grpc_logger_state.mutex);
-  grpc_logger_state.pending_args->swap(args);
-  uv_mutex_unlock(&grpc_logger_state.mutex);
-  /* Call the callback with each log message */
-  while (!args.empty()) {
-    log_args *arg = args.front();
-    args.pop();
-    Local<Value> file = Nan::New(arg->core_args.file).ToLocalChecked();
-    Local<Value> line = Nan::New<Uint32, uint32_t>(arg->core_args.line);
-    Local<Value> severity =
-        Nan::New(gpr_log_severity_string(arg->core_args.severity))
-            .ToLocalChecked();
-    Local<Value> message = Nan::New(arg->core_args.message).ToLocalChecked();
-    Local<Value> timestamp =
-        Nan::New<v8::Date>(grpc::node::TimespecToMilliseconds(arg->timestamp))
-            .ToLocalChecked();
-    const int argc = 5;
-    Local<Value> argv[argc] = {file, line, severity, message, timestamp};
-    grpc_logger_state.callback->Call(argc, argv);
-    delete[] arg->core_args.message;
-    delete arg;
-  }
-}
-
-void node_log_func(gpr_log_func_args *args) {
-  // TODO(mlumish): Use the core's log formatter when it becomes available
-  log_args *args_copy = new log_args;
-  size_t message_len = strlen(args->message) + 1;
-  char *message = new char[message_len];
-  memcpy(message, args->message, message_len);
-  memcpy(&args_copy->core_args, args, sizeof(gpr_log_func_args));
-  args_copy->core_args.message = message;
-  args_copy->timestamp = gpr_now(GPR_CLOCK_REALTIME);
-
-  uv_mutex_lock(&grpc_logger_state.mutex);
-  grpc_logger_state.pending_args->push(args_copy);
-  uv_mutex_unlock(&grpc_logger_state.mutex);
-
-  uv_async_send(&grpc_logger_state.async);
-}
-
-void init_logger() {
-  memset(&grpc_logger_state, 0, sizeof(logger_state));
-  grpc_logger_state.pending_args = new std::queue<log_args *>();
-  uv_mutex_init(&grpc_logger_state.mutex);
-  uv_async_init(uv_default_loop(), &grpc_logger_state.async,
-                LogMessagesCallback);
-  uv_unref((uv_handle_t *)&grpc_logger_state.async);
-  grpc_logger_state.logger_set = false;
-
-  gpr_log_verbosity_init();
-}
-
-/* This registers a JavaScript logger for messages from the gRPC core. Because
-   that handler has to be run in the context of the JavaScript event loop, it
-   will be run asynchronously. To minimize the problems that could cause for
-   debugging, we leave core to do its default synchronous logging until a
-   JavaScript logger is set */
-NAN_METHOD(SetDefaultLoggerCallback) {
-  if (!info[0]->IsFunction()) {
-    return Nan::ThrowTypeError(
-        "setDefaultLoggerCallback's argument must be a function");
-  }
-  if (!grpc_logger_state.logger_set) {
-    gpr_set_log_function(node_log_func);
-    grpc_logger_state.logger_set = true;
-  }
-  grpc_logger_state.callback = new Nan::Callback(info[0].As<v8::Function>());
-}
-
-NAN_METHOD(SetLogVerbosity) {
-  if (!info[0]->IsUint32()) {
-    return Nan::ThrowTypeError("setLogVerbosity's argument must be a number");
-  }
-  gpr_log_severity severity =
-      static_cast<gpr_log_severity>(Nan::To<uint32_t>(info[0]).FromJust());
-  gpr_set_log_verbosity(severity);
-}
-
-void init(Local<Object> exports) {
-  Nan::HandleScope scope;
-  grpc_init();
-  grpc_set_ssl_roots_override_callback(get_ssl_roots_override);
-  init_logger();
-
-  InitOpTypeConstants(exports);
-  InitConnectivityStateConstants(exports);
-
-  grpc_pollset_work_run_loop = 0;
-
-  grpc::node::Call::Init(exports);
-  grpc::node::CallCredentials::Init(exports);
-  grpc::node::Channel::Init(exports);
-  grpc::node::ChannelCredentials::Init(exports);
-  grpc::node::Server::Init(exports);
-  grpc::node::ServerCredentials::Init(exports);
-
-  grpc::node::CompletionQueueInit(exports);
-
-  // Attach a few utility functions directly to the module
-  Nan::Set(exports, Nan::New("metadataKeyIsLegal").ToLocalChecked(),
-           Nan::GetFunction(Nan::New<FunctionTemplate>(MetadataKeyIsLegal))
-               .ToLocalChecked());
-  Nan::Set(
-      exports, Nan::New("metadataNonbinValueIsLegal").ToLocalChecked(),
-      Nan::GetFunction(Nan::New<FunctionTemplate>(MetadataNonbinValueIsLegal))
-          .ToLocalChecked());
-  Nan::Set(exports, Nan::New("metadataKeyIsBinary").ToLocalChecked(),
-           Nan::GetFunction(Nan::New<FunctionTemplate>(MetadataKeyIsBinary))
-               .ToLocalChecked());
-  Nan::Set(exports, Nan::New("setDefaultRootsPem").ToLocalChecked(),
-           Nan::GetFunction(Nan::New<FunctionTemplate>(SetDefaultRootsPem))
-               .ToLocalChecked());
-  Nan::Set(
-      exports, Nan::New("setDefaultLoggerCallback").ToLocalChecked(),
-      Nan::GetFunction(Nan::New<FunctionTemplate>(SetDefaultLoggerCallback))
-          .ToLocalChecked());
-  Nan::Set(exports, Nan::New("setLogVerbosity").ToLocalChecked(),
-           Nan::GetFunction(Nan::New<FunctionTemplate>(SetLogVerbosity))
-               .ToLocalChecked());
-}
-
-NODE_MODULE(grpc_node, init)
diff --git a/src/node/ext/server.cc b/src/node/ext/server.cc
deleted file mode 100644
index c6ab5e1..0000000
--- a/src/node/ext/server.cc
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <memory>
-
-#include "server.h"
-
-#include <nan.h>
-#include <node.h>
-
-#include <vector>
-#include "call.h"
-#include "completion_queue.h"
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
-#include "grpc/support/log.h"
-#include "server_credentials.h"
-#include "slice.h"
-#include "timeval.h"
-
-namespace grpc {
-namespace node {
-
-using Nan::Callback;
-using Nan::EscapableHandleScope;
-using Nan::HandleScope;
-using Nan::Maybe;
-using Nan::MaybeLocal;
-using Nan::ObjectWrap;
-using Nan::Persistent;
-using Nan::Utf8String;
-
-using std::unique_ptr;
-using v8::Array;
-using v8::Boolean;
-using v8::Date;
-using v8::Exception;
-using v8::External;
-using v8::Function;
-using v8::FunctionTemplate;
-using v8::Local;
-using v8::Number;
-using v8::Object;
-using v8::String;
-using v8::Value;
-
-Nan::Callback *Server::constructor;
-Persistent<FunctionTemplate> Server::fun_tpl;
-
-static Callback *shutdown_callback = NULL;
-
-class ServerShutdownOp : public Op {
- public:
-  ServerShutdownOp(grpc_server *server) : server(server) {}
-
-  ~ServerShutdownOp() {}
-
-  Local<Value> GetNodeValue() const { return Nan::Null(); }
-
-  bool ParseOp(Local<Value> value, grpc_op *out) { return true; }
-  bool IsFinalOp() { return false; }
-  void OnComplete(bool success) {
-    /* Because cancel_all_calls was called, we assume that shutdown_and_notify
-       completes successfully */
-    grpc_server_destroy(server);
-  }
-
-  grpc_server *server;
-
- protected:
-  std::string GetTypeString() const { return "shutdown"; }
-};
-
-class NewCallOp : public Op {
- public:
-  NewCallOp() {
-    call = NULL;
-    grpc_call_details_init(&details);
-    grpc_metadata_array_init(&request_metadata);
-  }
-
-  ~NewCallOp() {
-    grpc_call_details_destroy(&details);
-    grpc_metadata_array_destroy(&request_metadata);
-  }
-
-  Local<Value> GetNodeValue() const {
-    Nan::EscapableHandleScope scope;
-    if (call == NULL) {
-      return scope.Escape(Nan::Null());
-    }
-    Local<Object> obj = Nan::New<Object>();
-    Nan::Set(obj, Nan::New("call").ToLocalChecked(), Call::WrapStruct(call));
-    // TODO(murgatroid99): Use zero-copy string construction instead
-    Nan::Set(obj, Nan::New("method").ToLocalChecked(),
-             CopyStringFromSlice(details.method));
-    Nan::Set(obj, Nan::New("host").ToLocalChecked(),
-             CopyStringFromSlice(details.host));
-    Nan::Set(obj, Nan::New("deadline").ToLocalChecked(),
-             Nan::New<Date>(TimespecToMilliseconds(details.deadline))
-                 .ToLocalChecked());
-    Nan::Set(obj, Nan::New("metadata").ToLocalChecked(),
-             ParseMetadata(&request_metadata));
-    return scope.Escape(obj);
-  }
-
-  bool ParseOp(Local<Value> value, grpc_op *out) { return true; }
-  bool IsFinalOp() { return false; }
-  void OnComplete(bool success) {}
-
-  grpc_call *call;
-  grpc_call_details details;
-  grpc_metadata_array request_metadata;
-
- protected:
-  std::string GetTypeString() const { return "new_call"; }
-};
-
-class TryShutdownOp : public Op {
- public:
-  TryShutdownOp(Server *server, Local<Value> server_value) : server(server) {
-    server_persist.Reset(server_value);
-  }
-  Local<Value> GetNodeValue() const {
-    EscapableHandleScope scope;
-    return scope.Escape(Nan::New(server_persist));
-  }
-  bool ParseOp(Local<Value> value, grpc_op *out) { return true; }
-  bool IsFinalOp() { return false; }
-  void OnComplete(bool success) {
-    if (success) {
-      server->DestroyWrappedServer();
-    }
-  }
-
- protected:
-  std::string GetTypeString() const { return "try_shutdown"; }
-
- private:
-  Server *server;
-  Nan::Persistent<v8::Value, Nan::CopyablePersistentTraits<v8::Value>>
-      server_persist;
-};
-
-Server::Server(grpc_server *server) : wrapped_server(server) {}
-
-Server::~Server() { this->ShutdownServer(); }
-
-void Server::Init(Local<Object> exports) {
-  HandleScope scope;
-  Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New);
-  tpl->SetClassName(Nan::New("Server").ToLocalChecked());
-  tpl->InstanceTemplate()->SetInternalFieldCount(1);
-  Nan::SetPrototypeMethod(tpl, "requestCall", RequestCall);
-  Nan::SetPrototypeMethod(tpl, "addHttp2Port", AddHttp2Port);
-  Nan::SetPrototypeMethod(tpl, "start", Start);
-  Nan::SetPrototypeMethod(tpl, "tryShutdown", TryShutdown);
-  Nan::SetPrototypeMethod(tpl, "forceShutdown", ForceShutdown);
-  fun_tpl.Reset(tpl);
-  Local<Function> ctr = Nan::GetFunction(tpl).ToLocalChecked();
-  Nan::Set(exports, Nan::New("Server").ToLocalChecked(), ctr);
-  constructor = new Callback(ctr);
-}
-
-bool Server::HasInstance(Local<Value> val) {
-  HandleScope scope;
-  return Nan::New(fun_tpl)->HasInstance(val);
-}
-
-void Server::DestroyWrappedServer() {
-  if (this->wrapped_server != NULL) {
-    grpc_server_destroy(this->wrapped_server);
-    this->wrapped_server = NULL;
-  }
-}
-
-NAN_METHOD(ServerShutdownCallback) {
-  if (!info[0]->IsNull()) {
-    return Nan::ThrowError("forceShutdown failed somehow");
-  }
-}
-
-void Server::ShutdownServer() {
-  Nan::HandleScope scope;
-  if (this->wrapped_server != NULL) {
-    if (shutdown_callback == NULL) {
-      Local<FunctionTemplate> callback_tpl =
-          Nan::New<FunctionTemplate>(ServerShutdownCallback);
-      shutdown_callback =
-          new Callback(Nan::GetFunction(callback_tpl).ToLocalChecked());
-    }
-
-    ServerShutdownOp *op = new ServerShutdownOp(this->wrapped_server);
-    unique_ptr<OpVec> ops(new OpVec());
-    ops->push_back(unique_ptr<Op>(op));
-
-    grpc_server_shutdown_and_notify(
-        this->wrapped_server, GetCompletionQueue(),
-        new struct tag(new Callback(**shutdown_callback), ops.release(), NULL,
-                       Nan::Null()));
-    grpc_server_cancel_all_calls(this->wrapped_server);
-    CompletionQueueNext();
-    this->wrapped_server = NULL;
-  }
-}
-
-NAN_METHOD(Server::New) {
-  /* If this is not a constructor call, make a constructor call and return
-     the result */
-  if (!info.IsConstructCall()) {
-    const int argc = 1;
-    Local<Value> argv[argc] = {info[0]};
-    MaybeLocal<Object> maybe_instance =
-        Nan::NewInstance(constructor->GetFunction(), argc, argv);
-    if (maybe_instance.IsEmpty()) {
-      // There's probably a pending exception
-      return;
-    } else {
-      info.GetReturnValue().Set(maybe_instance.ToLocalChecked());
-      return;
-    }
-  }
-  grpc_server *wrapped_server;
-  grpc_completion_queue *queue = GetCompletionQueue();
-  grpc_channel_args *channel_args;
-  if (!ParseChannelArgs(info[0], &channel_args)) {
-    DeallocateChannelArgs(channel_args);
-    return Nan::ThrowTypeError(
-        "Server options must be an object with "
-        "string keys and integer or string values");
-  }
-  wrapped_server = grpc_server_create(channel_args, NULL);
-  DeallocateChannelArgs(channel_args);
-  grpc_server_register_completion_queue(wrapped_server, queue, NULL);
-  Server *server = new Server(wrapped_server);
-  server->Wrap(info.This());
-  info.GetReturnValue().Set(info.This());
-}
-
-NAN_METHOD(Server::RequestCall) {
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError("requestCall can only be called on a Server");
-  }
-  Server *server = ObjectWrap::Unwrap<Server>(info.This());
-  NewCallOp *op = new NewCallOp();
-  unique_ptr<OpVec> ops(new OpVec());
-  ops->push_back(unique_ptr<Op>(op));
-  grpc_call_error error = grpc_server_request_call(
-      server->wrapped_server, &op->call, &op->details, &op->request_metadata,
-      GetCompletionQueue(), GetCompletionQueue(),
-      new struct tag(new Callback(info[0].As<Function>()), ops.release(), NULL,
-                     Nan::Null()));
-  if (error != GRPC_CALL_OK) {
-    return Nan::ThrowError(nanErrorWithCode("requestCall failed", error));
-  }
-  CompletionQueueNext();
-}
-
-NAN_METHOD(Server::AddHttp2Port) {
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError("addHttp2Port can only be called on a Server");
-  }
-  if (!info[0]->IsString()) {
-    return Nan::ThrowTypeError(
-        "addHttp2Port's first argument must be a String");
-  }
-  if (!ServerCredentials::HasInstance(info[1])) {
-    return Nan::ThrowTypeError(
-        "addHttp2Port's second argument must be ServerCredentials");
-  }
-  Server *server = ObjectWrap::Unwrap<Server>(info.This());
-  ServerCredentials *creds_object = ObjectWrap::Unwrap<ServerCredentials>(
-      Nan::To<Object>(info[1]).ToLocalChecked());
-  grpc_server_credentials *creds = creds_object->GetWrappedServerCredentials();
-  int port;
-  if (creds == NULL) {
-    port = grpc_server_add_insecure_http2_port(server->wrapped_server,
-                                               *Utf8String(info[0]));
-  } else {
-    port = grpc_server_add_secure_http2_port(server->wrapped_server,
-                                             *Utf8String(info[0]), creds);
-  }
-  info.GetReturnValue().Set(Nan::New<Number>(port));
-}
-
-NAN_METHOD(Server::Start) {
-  Nan::HandleScope scope;
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError("start can only be called on a Server");
-  }
-  Server *server = ObjectWrap::Unwrap<Server>(info.This());
-  grpc_server_start(server->wrapped_server);
-}
-
-NAN_METHOD(Server::TryShutdown) {
-  Nan::HandleScope scope;
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError("tryShutdown can only be called on a Server");
-  }
-  Server *server = ObjectWrap::Unwrap<Server>(info.This());
-  if (server->wrapped_server == NULL) {
-    // Server is already shut down. Call callback immediately.
-    Nan::Callback callback(info[0].As<Function>());
-    callback.Call(0, {});
-    return;
-  }
-  TryShutdownOp *op = new TryShutdownOp(server, info.This());
-  unique_ptr<OpVec> ops(new OpVec());
-  ops->push_back(unique_ptr<Op>(op));
-  grpc_server_shutdown_and_notify(
-      server->wrapped_server, GetCompletionQueue(),
-      new struct tag(new Nan::Callback(info[0].As<Function>()), ops.release(),
-                     NULL, Nan::Null()));
-  CompletionQueueNext();
-}
-
-NAN_METHOD(Server::ForceShutdown) {
-  Nan::HandleScope scope;
-  if (!HasInstance(info.This())) {
-    return Nan::ThrowTypeError("forceShutdown can only be called on a Server");
-  }
-  Server *server = ObjectWrap::Unwrap<Server>(info.This());
-  server->ShutdownServer();
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/server.h b/src/node/ext/server.h
deleted file mode 100644
index 66b3ac5..0000000
--- a/src/node/ext/server.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef NET_GRPC_NODE_SERVER_H_
-#define NET_GRPC_NODE_SERVER_H_
-
-#include <nan.h>
-#include <node.h>
-#include "grpc/grpc.h"
-
-namespace grpc {
-namespace node {
-
-/* Wraps grpc_server as a JavaScript object. Provides a constructor
-   and wrapper methods for grpc_server_create, grpc_server_request_call,
-   grpc_server_add_http2_port, and grpc_server_start. */
-class Server : public Nan::ObjectWrap {
- public:
-  /* Initializes the Server class and exposes the constructor and
-     wrapper methods to JavaScript */
-  static void Init(v8::Local<v8::Object> exports);
-  /* Tests whether the given value was constructed by this class's
-     JavaScript constructor */
-  static bool HasInstance(v8::Local<v8::Value> val);
-
-  void DestroyWrappedServer();
-
- private:
-  explicit Server(grpc_server *server);
-  ~Server();
-
-  // Prevent copying
-  Server(const Server &);
-  Server &operator=(const Server &);
-
-  void ShutdownServer();
-
-  static NAN_METHOD(New);
-  static NAN_METHOD(RequestCall);
-  static NAN_METHOD(AddHttp2Port);
-  static NAN_METHOD(Start);
-  static NAN_METHOD(TryShutdown);
-  static NAN_METHOD(ForceShutdown);
-  static Nan::Callback *constructor;
-  static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
-
-  grpc_server *wrapped_server;
-  grpc_completion_queue *shutdown_queue;
-};
-
-}  // namespace node
-}  // namespace grpc
-
-#endif  // NET_GRPC_NODE_SERVER_H_
diff --git a/src/node/ext/server_credentials.cc b/src/node/ext/server_credentials.cc
deleted file mode 100644
index b7fa478..0000000
--- a/src/node/ext/server_credentials.cc
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <node.h>
-
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
-#include "grpc/support/log.h"
-#include "server_credentials.h"
-
-namespace grpc {
-namespace node {
-
-using Nan::Callback;
-using Nan::EscapableHandleScope;
-using Nan::HandleScope;
-using Nan::Maybe;
-using Nan::MaybeLocal;
-using Nan::ObjectWrap;
-using Nan::Persistent;
-using Nan::Utf8String;
-
-using v8::Array;
-using v8::Exception;
-using v8::External;
-using v8::Function;
-using v8::FunctionTemplate;
-using v8::Integer;
-using v8::Local;
-using v8::Object;
-using v8::ObjectTemplate;
-using v8::String;
-using v8::Value;
-
-Nan::Callback *ServerCredentials::constructor;
-Persistent<FunctionTemplate> ServerCredentials::fun_tpl;
-
-ServerCredentials::ServerCredentials(grpc_server_credentials *credentials)
-    : wrapped_credentials(credentials) {}
-
-ServerCredentials::~ServerCredentials() {
-  grpc_server_credentials_release(wrapped_credentials);
-}
-
-void ServerCredentials::Init(Local<Object> exports) {
-  Nan::HandleScope scope;
-  Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New);
-  tpl->SetClassName(Nan::New("ServerCredentials").ToLocalChecked());
-  tpl->InstanceTemplate()->SetInternalFieldCount(1);
-  Local<Function> ctr = tpl->GetFunction();
-  Nan::Set(
-      ctr, Nan::New("createSsl").ToLocalChecked(),
-      Nan::GetFunction(Nan::New<FunctionTemplate>(CreateSsl)).ToLocalChecked());
-  Nan::Set(ctr, Nan::New("createInsecure").ToLocalChecked(),
-           Nan::GetFunction(Nan::New<FunctionTemplate>(CreateInsecure))
-               .ToLocalChecked());
-  fun_tpl.Reset(tpl);
-  constructor = new Nan::Callback(ctr);
-  Nan::Set(exports, Nan::New("ServerCredentials").ToLocalChecked(), ctr);
-}
-
-bool ServerCredentials::HasInstance(Local<Value> val) {
-  Nan::HandleScope scope;
-  return Nan::New(fun_tpl)->HasInstance(val);
-}
-
-Local<Value> ServerCredentials::WrapStruct(
-    grpc_server_credentials *credentials) {
-  Nan::EscapableHandleScope scope;
-  const int argc = 1;
-  Local<Value> argv[argc] = {
-      Nan::New<External>(reinterpret_cast<void *>(credentials))};
-  MaybeLocal<Object> maybe_instance =
-      Nan::NewInstance(constructor->GetFunction(), argc, argv);
-  if (maybe_instance.IsEmpty()) {
-    return scope.Escape(Nan::Null());
-  } else {
-    return scope.Escape(maybe_instance.ToLocalChecked());
-  }
-}
-
-grpc_server_credentials *ServerCredentials::GetWrappedServerCredentials() {
-  return wrapped_credentials;
-}
-
-NAN_METHOD(ServerCredentials::New) {
-  if (info.IsConstructCall()) {
-    if (!info[0]->IsExternal()) {
-      return Nan::ThrowTypeError(
-          "ServerCredentials can only be created with the provided functions");
-    }
-    Local<External> ext = info[0].As<External>();
-    grpc_server_credentials *creds_value =
-        reinterpret_cast<grpc_server_credentials *>(ext->Value());
-    ServerCredentials *credentials = new ServerCredentials(creds_value);
-    credentials->Wrap(info.This());
-    info.GetReturnValue().Set(info.This());
-  } else {
-    // This should never be called directly
-    return Nan::ThrowTypeError(
-        "ServerCredentials can only be created with the provided functions");
-  }
-}
-
-NAN_METHOD(ServerCredentials::CreateSsl) {
-  Nan::HandleScope scope;
-  char *root_certs = NULL;
-  if (::node::Buffer::HasInstance(info[0])) {
-    root_certs = ::node::Buffer::Data(info[0]);
-  } else if (!(info[0]->IsNull() || info[0]->IsUndefined())) {
-    return Nan::ThrowTypeError(
-        "createSSl's first argument must be a Buffer if provided");
-  }
-  if (!info[1]->IsArray()) {
-    return Nan::ThrowTypeError(
-        "createSsl's second argument must be a list of objects");
-  }
-
-  // Default to not requesting the client certificate
-  grpc_ssl_client_certificate_request_type client_certificate_request =
-      GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE;
-  if (info[2]->IsBoolean()) {
-    client_certificate_request =
-        Nan::To<bool>(info[2]).FromJust()
-            ? GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
-            : GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE;
-  } else if (!(info[2]->IsUndefined() || info[2]->IsNull())) {
-    return Nan::ThrowTypeError(
-        "createSsl's third argument must be a boolean if provided");
-  }
-  Local<Array> pair_list = Local<Array>::Cast(info[1]);
-  uint32_t key_cert_pair_count = pair_list->Length();
-  grpc_ssl_pem_key_cert_pair *key_cert_pairs =
-      new grpc_ssl_pem_key_cert_pair[key_cert_pair_count];
-
-  Local<String> key_key = Nan::New("private_key").ToLocalChecked();
-  Local<String> cert_key = Nan::New("cert_chain").ToLocalChecked();
-
-  for (uint32_t i = 0; i < key_cert_pair_count; i++) {
-    Local<Value> pair_val = Nan::Get(pair_list, i).ToLocalChecked();
-    if (!pair_val->IsObject()) {
-      delete[] key_cert_pairs;
-      return Nan::ThrowTypeError("Key/cert pairs must be objects");
-    }
-    Local<Object> pair_obj = Nan::To<Object>(pair_val).ToLocalChecked();
-    Local<Value> maybe_key = Nan::Get(pair_obj, key_key).ToLocalChecked();
-    Local<Value> maybe_cert = Nan::Get(pair_obj, cert_key).ToLocalChecked();
-    if (!::node::Buffer::HasInstance(maybe_key)) {
-      delete[] key_cert_pairs;
-      return Nan::ThrowTypeError("private_key must be a Buffer");
-    }
-    if (!::node::Buffer::HasInstance(maybe_cert)) {
-      delete[] key_cert_pairs;
-      return Nan::ThrowTypeError("cert_chain must be a Buffer");
-    }
-    key_cert_pairs[i].private_key = ::node::Buffer::Data(maybe_key);
-    key_cert_pairs[i].cert_chain = ::node::Buffer::Data(maybe_cert);
-  }
-  grpc_server_credentials *creds = grpc_ssl_server_credentials_create_ex(
-      root_certs, key_cert_pairs, key_cert_pair_count,
-      client_certificate_request, NULL);
-  delete[] key_cert_pairs;
-  if (creds == NULL) {
-    info.GetReturnValue().SetNull();
-  } else {
-    info.GetReturnValue().Set(WrapStruct(creds));
-  }
-}
-
-NAN_METHOD(ServerCredentials::CreateInsecure) {
-  info.GetReturnValue().Set(WrapStruct(NULL));
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/server_credentials.h b/src/node/ext/server_credentials.h
deleted file mode 100644
index 59f9148..0000000
--- a/src/node/ext/server_credentials.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef NET_GRPC_NODE_SERVER_CREDENTIALS_H_
-#define NET_GRPC_NODE_SERVER_CREDENTIALS_H_
-
-#include <nan.h>
-#include <node.h>
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
-
-namespace grpc {
-namespace node {
-
-/* Wrapper class for grpc_server_credentials structs */
-class ServerCredentials : public Nan::ObjectWrap {
- public:
-  static void Init(v8::Local<v8::Object> exports);
-  static bool HasInstance(v8::Local<v8::Value> val);
-  /* Wrap a grpc_server_credentials struct in a javascript object */
-  static v8::Local<v8::Value> WrapStruct(grpc_server_credentials *credentials);
-
-  /* Returns the grpc_server_credentials struct that this object wraps */
-  grpc_server_credentials *GetWrappedServerCredentials();
-
- private:
-  explicit ServerCredentials(grpc_server_credentials *credentials);
-  ~ServerCredentials();
-
-  // Prevent copying
-  ServerCredentials(const ServerCredentials &);
-  ServerCredentials &operator=(const ServerCredentials &);
-
-  static NAN_METHOD(New);
-  static NAN_METHOD(CreateSsl);
-  static NAN_METHOD(CreateInsecure);
-  static Nan::Callback *constructor;
-  // Used for typechecking instances of this javascript class
-  static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
-
-  grpc_server_credentials *wrapped_credentials;
-};
-
-}  // namespace node
-}  // namespace grpc
-
-#endif  // NET_GRPC_NODE_SERVER_CREDENTIALS_H_
diff --git a/src/node/ext/slice.cc b/src/node/ext/slice.cc
deleted file mode 100644
index 8806a61..0000000
--- a/src/node/ext/slice.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <nan.h>
-#include <node.h>
-
-#include "slice.h"
-
-namespace grpc {
-namespace node {
-
-using Nan::Persistent;
-
-using v8::Local;
-using v8::String;
-using v8::Value;
-
-namespace {
-void SliceFreeCallback(char *data, void *hint) {
-  grpc_slice *slice = reinterpret_cast<grpc_slice *>(hint);
-  grpc_slice_unref(*slice);
-  delete slice;
-}
-
-void string_destroy_func(void *user_data) {
-  delete reinterpret_cast<Nan::Utf8String *>(user_data);
-}
-
-void buffer_destroy_func(void *user_data) {
-  delete reinterpret_cast<PersistentValue *>(user_data);
-}
-}  // namespace
-
-grpc_slice CreateSliceFromString(const Local<String> source) {
-  Nan::HandleScope scope;
-  Nan::Utf8String *utf8_value = new Nan::Utf8String(source);
-  return grpc_slice_new_with_user_data(**utf8_value, source->Length(),
-                                       string_destroy_func, utf8_value);
-}
-
-grpc_slice CreateSliceFromBuffer(const Local<Value> source) {
-  // Prerequisite: ::node::Buffer::HasInstance(source)
-  Nan::HandleScope scope;
-  return grpc_slice_new_with_user_data(
-      ::node::Buffer::Data(source), ::node::Buffer::Length(source),
-      buffer_destroy_func, new PersistentValue(source));
-}
-Local<String> CopyStringFromSlice(const grpc_slice slice) {
-  Nan::EscapableHandleScope scope;
-  if (GRPC_SLICE_LENGTH(slice) == 0) {
-    return scope.Escape(Nan::EmptyString());
-  }
-  return scope.Escape(
-      Nan::New<String>(const_cast<char *>(reinterpret_cast<const char *>(
-                           GRPC_SLICE_START_PTR(slice))),
-                       GRPC_SLICE_LENGTH(slice))
-          .ToLocalChecked());
-}
-
-Local<Value> CreateBufferFromSlice(const grpc_slice slice) {
-  Nan::EscapableHandleScope scope;
-  grpc_slice *slice_ptr = new grpc_slice;
-  *slice_ptr = grpc_slice_ref(slice);
-  return scope.Escape(
-      Nan::NewBuffer(
-          const_cast<char *>(
-              reinterpret_cast<const char *>(GRPC_SLICE_START_PTR(*slice_ptr))),
-          GRPC_SLICE_LENGTH(*slice_ptr), SliceFreeCallback, slice_ptr)
-          .ToLocalChecked());
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/slice.h b/src/node/ext/slice.h
deleted file mode 100644
index 0a652c5..0000000
--- a/src/node/ext/slice.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/slice.h>
-#include <nan.h>
-#include <node.h>
-
-namespace grpc {
-namespace node {
-
-typedef Nan::Persistent<v8::Value, Nan::CopyablePersistentTraits<v8::Value>>
-    PersistentValue;
-
-grpc_slice CreateSliceFromString(const v8::Local<v8::String> source);
-
-grpc_slice CreateSliceFromBuffer(const v8::Local<v8::Value> source);
-
-v8::Local<v8::String> CopyStringFromSlice(const grpc_slice slice);
-
-v8::Local<v8::Value> CreateBufferFromSlice(const grpc_slice slice);
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/timeval.cc b/src/node/ext/timeval.cc
deleted file mode 100644
index 6142584..0000000
--- a/src/node/ext/timeval.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <cstdint>
-#include <limits>
-
-#include "grpc/grpc.h"
-#include "grpc/support/time.h"
-#include "timeval.h"
-
-namespace grpc {
-namespace node {
-
-gpr_timespec MillisecondsToTimespec(double millis) {
-  if (millis == std::numeric_limits<double>::infinity()) {
-    return gpr_inf_future(GPR_CLOCK_REALTIME);
-  } else if (millis == -std::numeric_limits<double>::infinity()) {
-    return gpr_inf_past(GPR_CLOCK_REALTIME);
-  } else {
-    return gpr_time_from_micros(static_cast<int64_t>(millis * 1000),
-                                GPR_CLOCK_REALTIME);
-  }
-}
-
-double TimespecToMilliseconds(gpr_timespec timespec) {
-  timespec = gpr_convert_clock_type(timespec, GPR_CLOCK_REALTIME);
-  if (gpr_time_cmp(timespec, gpr_inf_future(GPR_CLOCK_REALTIME)) == 0) {
-    return std::numeric_limits<double>::infinity();
-  } else if (gpr_time_cmp(timespec, gpr_inf_past(GPR_CLOCK_REALTIME)) == 0) {
-    return -std::numeric_limits<double>::infinity();
-  } else {
-    return (static_cast<double>(timespec.tv_sec) * 1000 +
-            static_cast<double>(timespec.tv_nsec) / 1000000);
-  }
-}
-
-}  // namespace node
-}  // namespace grpc
diff --git a/src/node/ext/timeval.h b/src/node/ext/timeval.h
deleted file mode 100644
index 17d7f16..0000000
--- a/src/node/ext/timeval.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef NET_GRPC_NODE_TIMEVAL_H_
-#define NET_GRPC_NODE_TIMEVAL_H_
-
-#include "grpc/support/time.h"
-
-namespace grpc {
-namespace node {
-
-double TimespecToMilliseconds(gpr_timespec time);
-gpr_timespec MillisecondsToTimespec(double millis);
-
-}  // namespace node
-}  // namespace grpc
-
-#endif  // NET_GRPC_NODE_TIMEVAL_H_
diff --git a/src/node/health_check/LICENSE b/src/node/health_check/LICENSE
deleted file mode 100644
index 7750ce4..0000000
--- a/src/node/health_check/LICENSE
+++ /dev/null
@@ -1,186 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        https://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for any such Derivative Works as a whole, provided Your use,
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   Copyright 2015-2017 gRPC authors.
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
diff --git a/src/node/health_check/health.js b/src/node/health_check/health.js
deleted file mode 100644
index 7ad2c1e..0000000
--- a/src/node/health_check/health.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var grpc = require('grpc');
-
-var _ = require('lodash');
-
-var health_messages = require('./v1/health_pb');
-var health_service = require('./v1/health_grpc_pb');
-
-function HealthImplementation(statusMap) {
-  this.statusMap = _.clone(statusMap);
-}
-
-HealthImplementation.prototype.setStatus = function(service, status) {
-  this.statusMap[service] = status;
-};
-
-HealthImplementation.prototype.check = function(call, callback){
-  var service = call.request.getService();
-  var status = _.get(this.statusMap, service, null);
-  if (status === null) {
-    callback({code:grpc.status.NOT_FOUND});
-  } else {
-    var response = new health_messages.HealthCheckResponse();
-    response.setStatus(status);
-    callback(null, response);
-  }
-};
-
-module.exports = {
-  Client: health_service.HealthClient,
-  service: health_service.HealthService,
-  Implementation: HealthImplementation
-};
diff --git a/src/node/health_check/node_modules/grpc.js b/src/node/health_check/node_modules/grpc.js
deleted file mode 100644
index 83f1982..0000000
--- a/src/node/health_check/node_modules/grpc.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* This exists solely to allow the generated code to import the grpc module
- * without using a relative path */
-
-module.exports = require('../..');
diff --git a/src/node/health_check/package.json b/src/node/health_check/package.json
deleted file mode 100644
index 6f09c8f..0000000
--- a/src/node/health_check/package.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "name": "grpc-health-check",
-  "version": "1.8.0-dev",
-  "author": "Google Inc.",
-  "description": "Health check service for use with gRPC",
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/grpc/grpc.git"
-  },
-  "bugs": "https://github.com/grpc/grpc/issues",
-  "contributors": [
-    {
-      "name": "Michael Lumish",
-      "email": "mlumish@google.com"
-    }
-  ],
-  "dependencies": {
-    "grpc": "^1.8.0-dev",
-    "lodash": "^3.9.3",
-    "google-protobuf": "^3.0.0"
-  },
-  "files": [
-    "LICENSE",
-    "health.js",
-    "v1"
-  ],
-  "main": "src/node/index.js",
-  "license": "Apache-2.0"
-}
diff --git a/src/node/health_check/v1/health_grpc_pb.js b/src/node/health_check/v1/health_grpc_pb.js
deleted file mode 100644
index 2a1ac6f..0000000
--- a/src/node/health_check/v1/health_grpc_pb.js
+++ /dev/null
@@ -1,59 +0,0 @@
-// GENERATED CODE -- DO NOT EDIT!
-
-// Original file comments:
-// Copyright 2015 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-'use strict';
-var grpc = require('grpc');
-var v1_health_pb = require('../v1/health_pb.js');
-
-function serialize_HealthCheckRequest(arg) {
-  if (!(arg instanceof v1_health_pb.HealthCheckRequest)) {
-    throw new Error('Expected argument of type HealthCheckRequest');
-  }
-  return new Buffer(arg.serializeBinary());
-}
-
-function deserialize_HealthCheckRequest(buffer_arg) {
-  return v1_health_pb.HealthCheckRequest.deserializeBinary(new Uint8Array(buffer_arg));
-}
-
-function serialize_HealthCheckResponse(arg) {
-  if (!(arg instanceof v1_health_pb.HealthCheckResponse)) {
-    throw new Error('Expected argument of type HealthCheckResponse');
-  }
-  return new Buffer(arg.serializeBinary());
-}
-
-function deserialize_HealthCheckResponse(buffer_arg) {
-  return v1_health_pb.HealthCheckResponse.deserializeBinary(new Uint8Array(buffer_arg));
-}
-
-
-var HealthService = exports.HealthService = {
-  check: {
-    path: '/grpc.health.v1.Health/Check',
-    requestStream: false,
-    responseStream: false,
-    requestType: v1_health_pb.HealthCheckRequest,
-    responseType: v1_health_pb.HealthCheckResponse,
-    requestSerialize: serialize_HealthCheckRequest,
-    requestDeserialize: deserialize_HealthCheckRequest,
-    responseSerialize: serialize_HealthCheckResponse,
-    responseDeserialize: deserialize_HealthCheckResponse,
-  },
-};
-
-exports.HealthClient = grpc.makeGenericClientConstructor(HealthService);
diff --git a/src/node/health_check/v1/health_pb.js b/src/node/health_check/v1/health_pb.js
deleted file mode 100644
index b36d47c..0000000
--- a/src/node/health_check/v1/health_pb.js
+++ /dev/null
@@ -1,342 +0,0 @@
-/**
- * @fileoverview
- * @enhanceable
- * @public
- */
-// GENERATED CODE -- DO NOT EDIT!
-
-var jspb = require('google-protobuf');
-var goog = jspb;
-var global = Function('return this')();
-
-goog.exportSymbol('proto.grpc.health.v1.HealthCheckRequest', null, global);
-goog.exportSymbol('proto.grpc.health.v1.HealthCheckResponse', null, global);
-goog.exportSymbol('proto.grpc.health.v1.HealthCheckResponse.ServingStatus', null, global);
-
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.grpc.health.v1.HealthCheckRequest = function(opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.grpc.health.v1.HealthCheckRequest, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
-  proto.grpc.health.v1.HealthCheckRequest.displayName = 'proto.grpc.health.v1.HealthCheckRequest';
-}
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto suitable for use in Soy templates.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
- * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.grpc.health.v1.HealthCheckRequest.prototype.toObject = function(opt_includeInstance) {
-  return proto.grpc.health.v1.HealthCheckRequest.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
- *     http://goto/soy-param-migration
- * @param {!proto.grpc.health.v1.HealthCheckRequest} msg The msg instance to transform.
- * @return {!Object}
- */
-proto.grpc.health.v1.HealthCheckRequest.toObject = function(includeInstance, msg) {
-  var f, obj = {
-    service: msg.getService()
-  };
-
-  if (includeInstance) {
-    obj.$jspbMessageInstance = msg;
-  }
-  return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.grpc.health.v1.HealthCheckRequest}
- */
-proto.grpc.health.v1.HealthCheckRequest.deserializeBinary = function(bytes) {
-  var reader = new jspb.BinaryReader(bytes);
-  var msg = new proto.grpc.health.v1.HealthCheckRequest;
-  return proto.grpc.health.v1.HealthCheckRequest.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.grpc.health.v1.HealthCheckRequest} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.grpc.health.v1.HealthCheckRequest}
- */
-proto.grpc.health.v1.HealthCheckRequest.deserializeBinaryFromReader = function(msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break;
-    }
-    var field = reader.getFieldNumber();
-    switch (field) {
-    case 1:
-      var value = /** @type {string} */ (reader.readString());
-      msg.setService(value);
-      break;
-    default:
-      reader.skipField();
-      break;
-    }
-  }
-  return msg;
-};
-
-
-/**
- * Class method variant: serializes the given message to binary data
- * (in protobuf wire format), writing to the given BinaryWriter.
- * @param {!proto.grpc.health.v1.HealthCheckRequest} message
- * @param {!jspb.BinaryWriter} writer
- */
-proto.grpc.health.v1.HealthCheckRequest.serializeBinaryToWriter = function(message, writer) {
-  message.serializeBinaryToWriter(writer);
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.grpc.health.v1.HealthCheckRequest.prototype.serializeBinary = function() {
-  var writer = new jspb.BinaryWriter();
-  this.serializeBinaryToWriter(writer);
-  return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format),
- * writing to the given BinaryWriter.
- * @param {!jspb.BinaryWriter} writer
- */
-proto.grpc.health.v1.HealthCheckRequest.prototype.serializeBinaryToWriter = function (writer) {
-  var f = undefined;
-  f = this.getService();
-  if (f.length > 0) {
-    writer.writeString(
-      1,
-      f
-    );
-  }
-};
-
-
-/**
- * Creates a deep clone of this proto. No data is shared with the original.
- * @return {!proto.grpc.health.v1.HealthCheckRequest} The clone.
- */
-proto.grpc.health.v1.HealthCheckRequest.prototype.cloneMessage = function() {
-  return /** @type {!proto.grpc.health.v1.HealthCheckRequest} */ (jspb.Message.cloneMessage(this));
-};
-
-
-/**
- * optional string service = 1;
- * @return {string}
- */
-proto.grpc.health.v1.HealthCheckRequest.prototype.getService = function() {
-  return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, ""));
-};
-
-
-/** @param {string} value  */
-proto.grpc.health.v1.HealthCheckRequest.prototype.setService = function(value) {
-  jspb.Message.setField(this, 1, value);
-};
-
-
-
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.grpc.health.v1.HealthCheckResponse = function(opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.grpc.health.v1.HealthCheckResponse, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
-  proto.grpc.health.v1.HealthCheckResponse.displayName = 'proto.grpc.health.v1.HealthCheckResponse';
-}
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto suitable for use in Soy templates.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
- * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.grpc.health.v1.HealthCheckResponse.prototype.toObject = function(opt_includeInstance) {
-  return proto.grpc.health.v1.HealthCheckResponse.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
- *     http://goto/soy-param-migration
- * @param {!proto.grpc.health.v1.HealthCheckResponse} msg The msg instance to transform.
- * @return {!Object}
- */
-proto.grpc.health.v1.HealthCheckResponse.toObject = function(includeInstance, msg) {
-  var f, obj = {
-    status: msg.getStatus()
-  };
-
-  if (includeInstance) {
-    obj.$jspbMessageInstance = msg;
-  }
-  return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.grpc.health.v1.HealthCheckResponse}
- */
-proto.grpc.health.v1.HealthCheckResponse.deserializeBinary = function(bytes) {
-  var reader = new jspb.BinaryReader(bytes);
-  var msg = new proto.grpc.health.v1.HealthCheckResponse;
-  return proto.grpc.health.v1.HealthCheckResponse.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.grpc.health.v1.HealthCheckResponse} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.grpc.health.v1.HealthCheckResponse}
- */
-proto.grpc.health.v1.HealthCheckResponse.deserializeBinaryFromReader = function(msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break;
-    }
-    var field = reader.getFieldNumber();
-    switch (field) {
-    case 1:
-      var value = /** @type {!proto.grpc.health.v1.HealthCheckResponse.ServingStatus} */ (reader.readEnum());
-      msg.setStatus(value);
-      break;
-    default:
-      reader.skipField();
-      break;
-    }
-  }
-  return msg;
-};
-
-
-/**
- * Class method variant: serializes the given message to binary data
- * (in protobuf wire format), writing to the given BinaryWriter.
- * @param {!proto.grpc.health.v1.HealthCheckResponse} message
- * @param {!jspb.BinaryWriter} writer
- */
-proto.grpc.health.v1.HealthCheckResponse.serializeBinaryToWriter = function(message, writer) {
-  message.serializeBinaryToWriter(writer);
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.grpc.health.v1.HealthCheckResponse.prototype.serializeBinary = function() {
-  var writer = new jspb.BinaryWriter();
-  this.serializeBinaryToWriter(writer);
-  return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format),
- * writing to the given BinaryWriter.
- * @param {!jspb.BinaryWriter} writer
- */
-proto.grpc.health.v1.HealthCheckResponse.prototype.serializeBinaryToWriter = function (writer) {
-  var f = undefined;
-  f = this.getStatus();
-  if (f !== 0.0) {
-    writer.writeEnum(
-      1,
-      f
-    );
-  }
-};
-
-
-/**
- * Creates a deep clone of this proto. No data is shared with the original.
- * @return {!proto.grpc.health.v1.HealthCheckResponse} The clone.
- */
-proto.grpc.health.v1.HealthCheckResponse.prototype.cloneMessage = function() {
-  return /** @type {!proto.grpc.health.v1.HealthCheckResponse} */ (jspb.Message.cloneMessage(this));
-};
-
-
-/**
- * optional ServingStatus status = 1;
- * @return {!proto.grpc.health.v1.HealthCheckResponse.ServingStatus}
- */
-proto.grpc.health.v1.HealthCheckResponse.prototype.getStatus = function() {
-  return /** @type {!proto.grpc.health.v1.HealthCheckResponse.ServingStatus} */ (jspb.Message.getFieldProto3(this, 1, 0));
-};
-
-
-/** @param {!proto.grpc.health.v1.HealthCheckResponse.ServingStatus} value  */
-proto.grpc.health.v1.HealthCheckResponse.prototype.setStatus = function(value) {
-  jspb.Message.setField(this, 1, value);
-};
-
-
-/**
- * @enum {number}
- */
-proto.grpc.health.v1.HealthCheckResponse.ServingStatus = {
-  UNKNOWN: 0,
-  SERVING: 1,
-  NOT_SERVING: 2
-};
-
-goog.object.extend(exports, proto.grpc.health.v1);
diff --git a/src/node/index.js b/src/node/index.js
deleted file mode 100644
index 452b11f..0000000
--- a/src/node/index.js
+++ /dev/null
@@ -1,255 +0,0 @@
-/**
- * @license
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var path = require('path');
-var fs = require('fs');
-
-var SSL_ROOTS_PATH = path.resolve(__dirname, '..', '..', 'etc', 'roots.pem');
-
-var _ = require('lodash');
-
-var ProtoBuf = require('protobufjs');
-
-var client = require('./src/client.js');
-
-var server = require('./src/server.js');
-
-var common = require('./src/common.js');
-
-var Metadata = require('./src/metadata.js');
-
-var grpc = require('./src/grpc_extension');
-
-var protobuf_js_5_common = require('./src/protobuf_js_5_common');
-var protobuf_js_6_common = require('./src/protobuf_js_6_common');
-
-var constants = require('./src/constants.js');
-
-grpc.setDefaultRootsPem(fs.readFileSync(SSL_ROOTS_PATH, 'ascii'));
-
-/**
- * @namespace grpc
- */
-
-/**
- * Load a ProtoBuf.js object as a gRPC object.
- * @memberof grpc
- * @alias grpc.loadObject
- * @param {Object} value The ProtoBuf.js reflection object to load
- * @param {Object=} options Options to apply to the loaded file
- * @param {bool=} [options.binaryAsBase64=false] deserialize bytes values as
- *     base64 strings instead of Buffers
- * @param {bool=} [options.longsAsStrings=true] deserialize long values as
- *     strings instead of objects
- * @param {bool=} [options.enumsAsStrings=true] deserialize enum values as
- *     strings instead of numbers. Only works with Protobuf.js 6 values.
- * @param {bool=} [options.deprecatedArgumentOrder=false] use the beta method
- *     argument order for client methods, with optional arguments after the
- *     callback. This option is only a temporary stopgap measure to smooth an
- *     API breakage. It is deprecated, and new code should not use it.
- * @param {(number|string)=} [options.protobufjsVersion='detect'] 5 and 6
- *     respectively indicate that an object from the corresponding version of
- *     Protobuf.js is provided in the value argument. If the option is 'detect',
- *     gRPC wll guess what the version is based on the structure of the value.
- * @return {Object<string, *>} The resulting gRPC object.
- */
-exports.loadObject = function loadObject(value, options) {
-  options = _.defaults(options, common.defaultGrpcOptions);
-  options = _.defaults(options, {'protobufjsVersion': 'detect'});
-  var protobufjsVersion;
-  if (options.protobufjsVersion === 'detect') {
-    if (protobuf_js_6_common.isProbablyProtobufJs6(value)) {
-      protobufjsVersion = 6;
-    } else if (protobuf_js_5_common.isProbablyProtobufJs5(value)) {
-      protobufjsVersion = 5;
-    } else {
-      var error_message = 'Could not detect ProtoBuf.js version. Please ' +
-          'specify the version number with the "protobufjs_version" option';
-      throw new Error(error_message);
-    }
-  } else {
-    protobufjsVersion = options.protobufjsVersion;
-  }
-  switch (protobufjsVersion) {
-    case 6: return protobuf_js_6_common.loadObject(value, options);
-    case 5:
-    return protobuf_js_5_common.loadObject(value, options);
-    default:
-    throw new Error('Unrecognized protobufjsVersion', protobufjsVersion);
-  }
-};
-
-var loadObject = exports.loadObject;
-
-/**
- * Load a gRPC object from a .proto file.
- * @memberof grpc
- * @alias grpc.load
- * @param {string|{root: string, file: string}} filename The file to load
- * @param {string=} format The file format to expect. Must be either 'proto' or
- *     'json'. Defaults to 'proto'
- * @param {Object=} options Options to apply to the loaded file
- * @param {bool=} [options.convertFieldsToCamelCase=false] Load this file with
- *     field names in camel case instead of their original case
- * @param {bool=} [options.binaryAsBase64=false] deserialize bytes values as
- *     base64 strings instead of Buffers
- * @param {bool=} [options.longsAsStrings=true] deserialize long values as
- *     strings instead of objects
- * @param {bool=} [options.deprecatedArgumentOrder=false] use the beta method
- *     argument order for client methods, with optional arguments after the
- *     callback. This option is only a temporary stopgap measure to smooth an
- *     API breakage. It is deprecated, and new code should not use it.
- * @return {Object<string, *>} The resulting gRPC object
- */
-exports.load = function load(filename, format, options) {
-  options = _.defaults(options, common.defaultGrpcOptions);
-  options.protobufjsVersion = 5;
-  if (!format) {
-    format = 'proto';
-  }
-  var convertFieldsToCamelCaseOriginal = ProtoBuf.convertFieldsToCamelCase;
-  if(options && options.hasOwnProperty('convertFieldsToCamelCase')) {
-    ProtoBuf.convertFieldsToCamelCase = options.convertFieldsToCamelCase;
-  }
-  var builder;
-  try {
-    switch(format) {
-      case 'proto':
-      builder = ProtoBuf.loadProtoFile(filename);
-      break;
-      case 'json':
-      builder = ProtoBuf.loadJsonFile(filename);
-      break;
-      default:
-      throw new Error('Unrecognized format "' + format + '"');
-    }
-  } finally {
-    ProtoBuf.convertFieldsToCamelCase = convertFieldsToCamelCaseOriginal;
-  }
-  return loadObject(builder.ns, options);
-};
-
-var log_template = _.template(
-    '{severity} {timestamp}\t{file}:{line}]\t{message}',
-    {interpolate: /{([\s\S]+?)}/g});
-
-/**
- * Sets the logger function for the gRPC module. For debugging purposes, the C
- * core will log synchronously directly to stdout unless this function is
- * called. Note: the output format here is intended to be informational, and
- * is not guaranteed to stay the same in the future.
- * Logs will be directed to logger.error.
- * @memberof grpc
- * @alias grpc.setLogger
- * @param {Console} logger A Console-like object.
- */
-exports.setLogger = function setLogger(logger) {
-  common.logger = logger;
-  grpc.setDefaultLoggerCallback(function(file, line, severity,
-                                         message, timestamp) {
-    logger.error(log_template({
-      file: path.basename(file),
-      line: line,
-      severity: severity,
-      message: message,
-      timestamp: timestamp.toISOString()
-    }));
-  });
-};
-
-/**
- * Sets the logger verbosity for gRPC module logging. The options are members
- * of the grpc.logVerbosity map.
- * @memberof grpc
- * @alias grpc.setLogVerbosity
- * @param {Number} verbosity The minimum severity to log
- */
-exports.setLogVerbosity = function setLogVerbosity(verbosity) {
-  common.logVerbosity = verbosity;
-  grpc.setLogVerbosity(verbosity);
-};
-
-exports.Server = server.Server;
-
-exports.Metadata = Metadata;
-
-exports.status = constants.status;
-
-exports.propagate = constants.propagate;
-
-exports.callError = constants.callError;
-
-exports.writeFlags = constants.writeFlags;
-
-exports.logVerbosity = constants.logVerbosity;
-
-exports.credentials = require('./src/credentials.js');
-
-/**
- * ServerCredentials factories
- * @constructor ServerCredentials
- * @memberof grpc
- */
-exports.ServerCredentials = grpc.ServerCredentials;
-
-/**
- * Create insecure server credentials
- * @name grpc.ServerCredentials.createInsecure
- * @kind function
- * @return grpc.ServerCredentials
- */
-
-/**
- * A private key and certificate pair
- * @typedef {Object} grpc.ServerCredentials~keyCertPair
- * @property {Buffer} privateKey The server's private key
- * @property {Buffer} certChain The server's certificate chain
- */
-
-/**
- * Create SSL server credentials
- * @name grpc.ServerCredentials.createInsecure
- * @kind function
- * @param {?Buffer} rootCerts Root CA certificates for validating client
- *     certificates
- * @param {Array<grpc.ServerCredentials~keyCertPair>} keyCertPairs A list of
- *     private key and certificate chain pairs to be used for authenticating
- *     the server
- * @param {boolean} [checkClientCertificate=false] Indicates that the server
- *     should request and verify the client's certificates
- * @return grpc.ServerCredentials
- */
-
-exports.makeGenericClientConstructor = client.makeClientConstructor;
-
-exports.getClientChannel = client.getClientChannel;
-
-exports.waitForClientReady = client.waitForClientReady;
-
-/**
- * @memberof grpc
- * @alias grpc.closeClient
- * @param {grpc.Client} client_obj The client to close
- */
-exports.closeClient = function closeClient(client_obj) {
-  client.Client.prototype.close.apply(client_obj);
-};
-
-exports.Client = client.Client;
diff --git a/src/node/interop/async_delay_queue.js b/src/node/interop/async_delay_queue.js
deleted file mode 100644
index 43ac573..0000000
--- a/src/node/interop/async_delay_queue.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var _ = require('lodash');
-
-/**
- * This class represents a queue of callbacks that must happen sequentially,
- * each with a specific delay after the previous event.
- */
-function AsyncDelayQueue() {
-  this.queue = [];
-
-  this.callback_pending = false;
-}
-
-/**
- * Run the next callback after its corresponding delay, if there are any
- * remaining.
- */
-AsyncDelayQueue.prototype.runNext = function() {
-  var next = this.queue.shift();
-  var continueCallback = _.bind(this.runNext, this);
-  if (next) {
-    this.callback_pending = true;
-    setTimeout(function() {
-      next.callback(continueCallback);
-    }, next.delay);
-  } else {
-    this.callback_pending = false;
-  }
-};
-
-/**
- * Add a callback to be called with a specific delay after now or after the
- * current last item in the queue or current pending callback, whichever is
- * latest.
- * @param {function(function())} callback The callback
- * @param {Number} The delay to apply, in milliseconds
- */
-AsyncDelayQueue.prototype.add = function(callback, delay) {
-  this.queue.push({callback: callback, delay: delay});
-  if (!this.callback_pending) {
-    this.runNext();
-  }
-};
-
-module.exports = AsyncDelayQueue;
diff --git a/src/node/interop/interop_client.js b/src/node/interop/interop_client.js
deleted file mode 100644
index f321d58..0000000
--- a/src/node/interop/interop_client.js
+++ /dev/null
@@ -1,621 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var fs = require('fs');
-var path = require('path');
-var grpc = require('..');
-var testProto = grpc.load({
-  root: __dirname + '/../../..',
-  file: 'src/proto/grpc/testing/test.proto'}).grpc.testing;
-var GoogleAuth = require('google-auth-library');
-
-var assert = require('assert');
-
-var SERVICE_ACCOUNT_EMAIL;
-try {
-  SERVICE_ACCOUNT_EMAIL = require(
-      process.env.GOOGLE_APPLICATION_CREDENTIALS).client_email;
-} catch (e) {
-  // This will cause the tests to fail if they need that string
-  SERVICE_ACCOUNT_EMAIL = null;
-}
-
-var ECHO_INITIAL_KEY = 'x-grpc-test-echo-initial';
-var ECHO_TRAILING_KEY = 'x-grpc-test-echo-trailing-bin';
-
-/**
- * Create a buffer filled with size zeroes
- * @param {number} size The length of the buffer
- * @return {Buffer} The new buffer
- */
-function zeroBuffer(size) {
-  var zeros = new Buffer(size);
-  zeros.fill(0);
-  return zeros;
-}
-
-/**
- * This is used for testing functions with multiple asynchronous calls that
- * can happen in different orders. This should be passed the number of async
- * function invocations that can occur last, and each of those should call this
- * function's return value
- * @param {function()} done The function that should be called when a test is
- *     complete.
- * @param {number} count The number of calls to the resulting function if the
- *     test passes.
- * @return {function()} The function that should be called at the end of each
- *     sequence of asynchronous functions.
- */
-function multiDone(done, count) {
-  return function() {
-    count -= 1;
-    if (count <= 0) {
-      done();
-    }
-  };
-}
-
-/**
- * Run the empty_unary test
- * @param {Client} client The client to test against
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- */
-function emptyUnary(client, done) {
-  client.emptyCall({}, function(err, resp) {
-    assert.ifError(err);
-    if (done) {
-      done();
-    }
-  });
-}
-
-/**
- * Run the large_unary test
- * @param {Client} client The client to test against
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- */
-function largeUnary(client, done) {
-  var arg = {
-    response_type: 'COMPRESSABLE',
-    response_size: 314159,
-    payload: {
-      body: zeroBuffer(271828)
-    }
-  };
-  client.unaryCall(arg, function(err, resp) {
-    assert.ifError(err);
-    assert.strictEqual(resp.payload.type, 'COMPRESSABLE');
-    assert.strictEqual(resp.payload.body.length, 314159);
-    if (done) {
-      done();
-    }
-  });
-}
-
-/**
- * Run the client_streaming test
- * @param {Client} client The client to test against
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- */
-function clientStreaming(client, done) {
-  var call = client.streamingInputCall(function(err, resp) {
-    assert.ifError(err);
-    assert.strictEqual(resp.aggregated_payload_size, 74922);
-    if (done) {
-      done();
-    }
-  });
-  var payload_sizes = [27182, 8, 1828, 45904];
-  for (var i = 0; i < payload_sizes.length; i++) {
-    call.write({payload: {body: zeroBuffer(payload_sizes[i])}});
-  }
-  call.end();
-}
-
-/**
- * Run the server_streaming test
- * @param {Client} client The client to test against
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- */
-function serverStreaming(client, done) {
-  var arg = {
-    response_type: 'COMPRESSABLE',
-    response_parameters: [
-      {size: 31415},
-      {size: 9},
-      {size: 2653},
-      {size: 58979}
-    ]
-  };
-  var call = client.streamingOutputCall(arg);
-  var resp_index = 0;
-  call.on('data', function(value) {
-    assert(resp_index < 4);
-    assert.strictEqual(value.payload.type, 'COMPRESSABLE');
-    assert.strictEqual(value.payload.body.length,
-                       arg.response_parameters[resp_index].size);
-    resp_index += 1;
-  });
-  call.on('end', function() {
-    assert.strictEqual(resp_index, 4);
-    if (done) {
-      done();
-    }
-  });
-  call.on('status', function(status) {
-    assert.strictEqual(status.code, grpc.status.OK);
-  });
-}
-
-/**
- * Run the ping_pong test
- * @param {Client} client The client to test against
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- */
-function pingPong(client, done) {
-  var payload_sizes = [27182, 8, 1828, 45904];
-  var response_sizes = [31415, 9, 2653, 58979];
-  var call = client.fullDuplexCall();
-  call.on('status', function(status) {
-    assert.strictEqual(status.code, grpc.status.OK);
-    if (done) {
-      done();
-    }
-  });
-  var index = 0;
-  call.write({
-      response_type: 'COMPRESSABLE',
-      response_parameters: [
-        {size: response_sizes[index]}
-      ],
-      payload: {body: zeroBuffer(payload_sizes[index])}
-  });
-  call.on('data', function(response) {
-    assert.strictEqual(response.payload.type, 'COMPRESSABLE');
-    assert.equal(response.payload.body.length, response_sizes[index]);
-    index += 1;
-    if (index === 4) {
-      call.end();
-    } else {
-      call.write({
-        response_type: 'COMPRESSABLE',
-        response_parameters: [
-          {size: response_sizes[index]}
-        ],
-        payload: {body: zeroBuffer(payload_sizes[index])}
-      });
-    }
-  });
-}
-
-/**
- * Run the empty_stream test.
- * @param {Client} client The client to test against
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- */
-function emptyStream(client, done) {
-  var call = client.fullDuplexCall();
-  call.on('status', function(status) {
-    assert.strictEqual(status.code, grpc.status.OK);
-    if (done) {
-      done();
-    }
-  });
-  call.on('data', function(value) {
-    assert.fail(value, null, 'No data should have been received', '!==');
-  });
-  call.end();
-}
-
-/**
- * Run the cancel_after_begin test.
- * @param {Client} client The client to test against
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- */
-function cancelAfterBegin(client, done) {
-  var call = client.streamingInputCall(function(err, resp) {
-    assert.strictEqual(err.code, grpc.status.CANCELLED);
-    done();
-  });
-  call.cancel();
-}
-
-/**
- * Run the cancel_after_first_response test.
- * @param {Client} client The client to test against
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- */
-function cancelAfterFirstResponse(client, done) {
-  var call = client.fullDuplexCall();
-  call.write({
-      response_type: 'COMPRESSABLE',
-      response_parameters: [
-        {size: 31415}
-      ],
-      payload: {body: zeroBuffer(27182)}
-  });
-  call.on('data', function(data) {
-    call.cancel();
-  });
-  call.on('error', function(error) {
-    assert.strictEqual(error.code, grpc.status.CANCELLED);
-    done();
-  });
-}
-
-function timeoutOnSleepingServer(client, done) {
-  var deadline = new Date();
-  deadline.setMilliseconds(deadline.getMilliseconds() + 1);
-  var call = client.fullDuplexCall({deadline: deadline});
-  call.write({
-    payload: {body: zeroBuffer(27182)}
-  });
-  call.on('data', function() {});
-  call.on('error', function(error) {
-
-    assert(error.code === grpc.status.DEADLINE_EXCEEDED ||
-        error.code === grpc.status.INTERNAL);
-    done();
-  });
-}
-
-function customMetadata(client, done) {
-  done = multiDone(done, 5);
-  var metadata = new grpc.Metadata();
-  metadata.set(ECHO_INITIAL_KEY, 'test_initial_metadata_value');
-  metadata.set(ECHO_TRAILING_KEY, new Buffer('ababab', 'hex'));
-  var arg = {
-    response_type: 'COMPRESSABLE',
-    response_size: 314159,
-    payload: {
-      body: zeroBuffer(271828)
-    }
-  };
-  var streaming_arg = {
-    response_parameters: [
-     {size: 314159}
-    ],
-    payload: {
-      body: zeroBuffer(271828)
-    }
-  };
-  var unary = client.unaryCall(arg, metadata, function(err, resp) {
-    assert.ifError(err);
-    done();
-  });
-  unary.on('metadata', function(metadata) {
-    assert.deepEqual(metadata.get(ECHO_INITIAL_KEY),
-                     ['test_initial_metadata_value']);
-    done();
-  });
-  unary.on('status', function(status) {
-    var echo_trailer = status.metadata.get(ECHO_TRAILING_KEY);
-    assert(echo_trailer.length > 0);
-    assert.strictEqual(echo_trailer[0].toString('hex'), 'ababab');
-    done();
-  });
-  var stream = client.fullDuplexCall(metadata);
-  stream.on('metadata', function(metadata) {
-    assert.deepEqual(metadata.get(ECHO_INITIAL_KEY),
-                     ['test_initial_metadata_value']);
-    done();
-  });
-  stream.on('data', function() {});
-  stream.on('status', function(status) {
-    var echo_trailer = status.metadata.get(ECHO_TRAILING_KEY);
-    assert(echo_trailer.length > 0);
-    assert.strictEqual(echo_trailer[0].toString('hex'), 'ababab');
-    done();
-  });
-  stream.write(streaming_arg);
-  stream.end();
-}
-
-function statusCodeAndMessage(client, done) {
-  done = multiDone(done, 2);
-  var arg = {
-    response_status: {
-      code: 2,
-      message: 'test status message'
-    }
-  };
-  client.unaryCall(arg, function(err, resp) {
-    assert(err);
-    assert.strictEqual(err.code, 2);
-    assert.strictEqual(err.message, 'test status message');
-    done();
-  });
-  var duplex = client.fullDuplexCall();
-  duplex.on('data', function() {});
-  duplex.on('status', function(status) {
-    assert(status);
-    assert.strictEqual(status.code, 2);
-    assert.strictEqual(status.details, 'test status message');
-    done();
-  });
-  duplex.on('error', function(){});
-  duplex.write(arg);
-  duplex.end();
-}
-
-// NOTE: the client param to this function is from UnimplementedService
-function unimplementedService(client, done) {
-  client.unimplementedCall({}, function(err, resp) {
-    assert(err);
-    assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED);
-    done();
-  });
-}
-
-// NOTE: the client param to this function is from TestService
-function unimplementedMethod(client, done) {
-  client.unimplementedCall({}, function(err, resp) {
-    assert(err);
-    assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED);
-    done();
-  });
-}
-
-/**
- * Run one of the authentication tests.
- * @param {string} expected_user The expected username in the response
- * @param {Client} client The client to test against
- * @param {?string} scope The scope to apply to the credentials
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- */
-function authTest(expected_user, scope, client, done) {
-  var arg = {
-    response_type: 'COMPRESSABLE',
-    response_size: 314159,
-    payload: {
-      body: zeroBuffer(271828)
-    },
-    fill_username: true,
-    fill_oauth_scope: true
-  };
-  client.unaryCall(arg, function(err, resp) {
-    assert.ifError(err);
-    assert.strictEqual(resp.payload.type, 'COMPRESSABLE');
-    assert.strictEqual(resp.payload.body.length, 314159);
-    assert.strictEqual(resp.username, expected_user);
-    if (scope) {
-      assert(scope.indexOf(resp.oauth_scope) > -1);
-    }
-    if (done) {
-      done();
-    }
-  });
-}
-
-function computeEngineCreds(client, done, extra) {
-  authTest(extra.service_account, null, client, done);
-}
-
-function serviceAccountCreds(client, done, extra) {
-  authTest(SERVICE_ACCOUNT_EMAIL, extra.oauth_scope, client, done);
-}
-
-function jwtTokenCreds(client, done, extra) {
-  authTest(SERVICE_ACCOUNT_EMAIL, null, client, done);
-}
-
-function oauth2Test(client, done, extra) {
-  var arg = {
-    fill_username: true,
-    fill_oauth_scope: true
-  };
-  client.unaryCall(arg, function(err, resp) {
-    assert.ifError(err);
-    assert.strictEqual(resp.username, SERVICE_ACCOUNT_EMAIL);
-    assert(extra.oauth_scope.indexOf(resp.oauth_scope) > -1);
-    if (done) {
-      done();
-    }
-  });
-}
-
-function perRpcAuthTest(client, done, extra) {
-  (new GoogleAuth()).getApplicationDefault(function(err, credential) {
-    assert.ifError(err);
-    var arg = {
-      fill_username: true,
-      fill_oauth_scope: true
-    };
-    var scope = extra.oauth_scope;
-    if (credential.createScopedRequired() && scope) {
-      credential = credential.createScoped(scope);
-    }
-    var creds = grpc.credentials.createFromGoogleCredential(credential);
-    client.unaryCall(arg, {credentials: creds}, function(err, resp) {
-      assert.ifError(err);
-      assert.strictEqual(resp.username, SERVICE_ACCOUNT_EMAIL);
-      assert(extra.oauth_scope.indexOf(resp.oauth_scope) > -1);
-      if (done) {
-        done();
-      }
-    });
-  });
-}
-
-function getApplicationCreds(scope, callback) {
-  (new GoogleAuth()).getApplicationDefault(function(err, credential) {
-    if (err) {
-      callback(err);
-      return;
-    }
-    if (credential.createScopedRequired() && scope) {
-      credential = credential.createScoped(scope);
-    }
-    callback(null, grpc.credentials.createFromGoogleCredential(credential));
-  });
-}
-
-function getOauth2Creds(scope, callback) {
-  (new GoogleAuth()).getApplicationDefault(function(err, credential) {
-    if (err) {
-      callback(err);
-      return;
-    }
-    credential = credential.createScoped(scope);
-    credential.getAccessToken(function(err, token) {
-      if (err) {
-        callback(err);
-        return;
-      }
-      var updateMd = function(service_url, callback) {
-        var metadata = new grpc.Metadata();
-        metadata.add('authorization', 'Bearer ' + token);
-        callback(null, metadata);
-      };
-      callback(null, grpc.credentials.createFromMetadataGenerator(updateMd));
-    });
-  });
-}
-
-/**
- * Map from test case names to test functions
- */
-var test_cases = {
-  empty_unary: {run: emptyUnary,
-                Client: testProto.TestService},
-  large_unary: {run: largeUnary,
-                Client: testProto.TestService},
-  client_streaming: {run: clientStreaming,
-                     Client: testProto.TestService},
-  server_streaming: {run: serverStreaming,
-                     Client: testProto.TestService},
-  ping_pong: {run: pingPong,
-              Client: testProto.TestService},
-  empty_stream: {run: emptyStream,
-                 Client: testProto.TestService},
-  cancel_after_begin: {run: cancelAfterBegin,
-                       Client: testProto.TestService},
-  cancel_after_first_response: {run: cancelAfterFirstResponse,
-                                Client: testProto.TestService},
-  timeout_on_sleeping_server: {run: timeoutOnSleepingServer,
-                               Client: testProto.TestService},
-  custom_metadata: {run: customMetadata,
-                    Client: testProto.TestService},
-  status_code_and_message: {run: statusCodeAndMessage,
-                            Client: testProto.TestService},
-  unimplemented_service: {run: unimplementedService,
-                         Client: testProto.UnimplementedService},
-  unimplemented_method: {run: unimplementedMethod,
-                         Client: testProto.TestService},
-  compute_engine_creds: {run: computeEngineCreds,
-                         Client: testProto.TestService,
-                         getCreds: getApplicationCreds},
-  service_account_creds: {run: serviceAccountCreds,
-                          Client: testProto.TestService,
-                          getCreds: getApplicationCreds},
-  jwt_token_creds: {run: jwtTokenCreds,
-                    Client: testProto.TestService,
-                    getCreds: getApplicationCreds},
-  oauth2_auth_token: {run: oauth2Test,
-                      Client: testProto.TestService,
-                      getCreds: getOauth2Creds},
-  per_rpc_creds: {run: perRpcAuthTest,
-                  Client: testProto.TestService}
-};
-
-exports.test_cases = test_cases;
-
-/**
- * Execute a single test case.
- * @param {string} address The address of the server to connect to, in the
- *     format 'hostname:port'
- * @param {string} host_overrirde The hostname of the server to use as an SSL
- *     override
- * @param {string} test_case The name of the test case to run
- * @param {bool} tls Indicates that a secure channel should be used
- * @param {function} done Callback to call when the test is completed. Included
- *     primarily for use with mocha
- * @param {object=} extra Extra options for some tests
- */
-function runTest(address, host_override, test_case, tls, test_ca, done, extra) {
-  // TODO(mlumish): enable TLS functionality
-  var options = {};
-  var creds;
-  if (tls) {
-    var ca_path;
-    if (test_ca) {
-      ca_path = path.join(__dirname, '../test/data/ca.pem');
-      var ca_data = fs.readFileSync(ca_path);
-      creds = grpc.credentials.createSsl(ca_data);
-    } else {
-      creds = grpc.credentials.createSsl();
-    }
-    if (host_override) {
-      options['grpc.ssl_target_name_override'] = host_override;
-      options['grpc.default_authority'] = host_override;
-    }
-  } else {
-    creds = grpc.credentials.createInsecure();
-  }
-  var test = test_cases[test_case];
-
-  var execute = function(err, creds) {
-    assert.ifError(err);
-    var client = new test.Client(address, creds, options);
-    test.run(client, done, extra);
-  };
-
-  if (test.getCreds) {
-    test.getCreds(extra.oauth_scope, function(err, new_creds) {
-      assert.ifError(err);
-      execute(err, grpc.credentials.combineChannelCredentials(
-          creds, new_creds));
-    });
-  } else {
-    execute(null, creds);
-  }
-}
-
-if (require.main === module) {
-  var parseArgs = require('minimist');
-  var argv = parseArgs(process.argv, {
-    string: ['server_host', 'server_host_override', 'server_port', 'test_case',
-             'use_tls', 'use_test_ca', 'default_service_account', 'oauth_scope',
-             'service_account_key_file']
-  });
-  var extra_args = {
-    service_account: argv.default_service_account,
-    oauth_scope: argv.oauth_scope
-  };
-  runTest(argv.server_host + ':' + argv.server_port, argv.server_host_override,
-          argv.test_case, argv.use_tls === 'true', argv.use_test_ca === 'true',
-          function () {
-            console.log('OK:', argv.test_case);
-          }, extra_args);
-}
-
-/**
- * See docs for runTest
- */
-exports.runTest = runTest;
diff --git a/src/node/interop/interop_server.js b/src/node/interop/interop_server.js
deleted file mode 100644
index c2028af..0000000
--- a/src/node/interop/interop_server.js
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var fs = require('fs');
-var path = require('path');
-var _ = require('lodash');
-var AsyncDelayQueue = require('./async_delay_queue');
-var grpc = require('..');
-var testProto = grpc.load({
-  root: __dirname + '/../../..',
-  file: 'src/proto/grpc/testing/test.proto'}).grpc.testing;
-
-var ECHO_INITIAL_KEY = 'x-grpc-test-echo-initial';
-var ECHO_TRAILING_KEY = 'x-grpc-test-echo-trailing-bin';
-
-/**
- * Create a buffer filled with size zeroes
- * @param {number} size The length of the buffer
- * @return {Buffer} The new buffer
- */
-function zeroBuffer(size) {
-  var zeros = new Buffer(size);
-  zeros.fill(0);
-  return zeros;
-}
-
-/**
- * Echos a header metadata item as specified in the interop spec.
- * @param {Call} call The call to echo metadata on
- */
-function echoHeader(call) {
-  var echo_initial = call.metadata.get(ECHO_INITIAL_KEY);
-  if (echo_initial.length > 0) {
-    var response_metadata = new grpc.Metadata();
-    response_metadata.set(ECHO_INITIAL_KEY, echo_initial[0]);
-    call.sendMetadata(response_metadata);
-  }
-}
-
-/**
- * Gets the trailer metadata that should be echoed when the call is done,
- * as specified in the interop spec.
- * @param {Call} call The call to get metadata from
- * @return {grpc.Metadata} The metadata to send as a trailer
- */
-function getEchoTrailer(call) {
-  var echo_trailer = call.metadata.get(ECHO_TRAILING_KEY);
-  var response_trailer = new grpc.Metadata();
-  if (echo_trailer.length > 0) {
-    response_trailer.set(ECHO_TRAILING_KEY, echo_trailer[0]);
-  }
-  return response_trailer;
-}
-
-function getPayload(payload_type, size) {
-  var body = zeroBuffer(size);
-  return {type: payload_type, body: body};
-}
-
-/**
- * Respond to an empty parameter with an empty response.
- * NOTE: this currently does not work due to issue #137
- * @param {Call} call Call to handle
- * @param {function(Error, Object)} callback Callback to call with result
- *     or error
- */
-function handleEmpty(call, callback) {
-  echoHeader(call);
-  callback(null, {}, getEchoTrailer(call));
-}
-
-/**
- * Handle a unary request by sending the requested payload
- * @param {Call} call Call to handle
- * @param {function(Error, Object)} callback Callback to call with result or
- *     error
- */
-function handleUnary(call, callback) {
-  echoHeader(call);
-  var req = call.request;
-  if (req.response_status) {
-    var status = req.response_status;
-    status.metadata = getEchoTrailer(call);
-    callback(status);
-    return;
-  }
-  var payload = getPayload(req.response_type, req.response_size);
-  callback(null, {payload: payload},
-           getEchoTrailer(call));
-}
-
-/**
- * Respond to a streaming call with the total size of all payloads
- * @param {Call} call Call to handle
- * @param {function(Error, Object)} callback Callback to call with result or
- *     error
- */
-function handleStreamingInput(call, callback) {
-  echoHeader(call);
-  var aggregate_size = 0;
-  call.on('data', function(value) {
-    aggregate_size += value.payload.body.length;
-  });
-  call.on('end', function() {
-    callback(null, {aggregated_payload_size: aggregate_size},
-             getEchoTrailer(call));
-  });
-}
-
-/**
- * Respond to a payload request with a stream of the requested payloads
- * @param {Call} call Call to handle
- */
-function handleStreamingOutput(call) {
-  echoHeader(call);
-  var delay_queue = new AsyncDelayQueue();
-  var req = call.request;
-  if (req.response_status) {
-    var status = req.response_status;
-    status.metadata = getEchoTrailer(call);
-    call.emit('error', status);
-    return;
-  }
-  _.each(req.response_parameters, function(resp_param) {
-    delay_queue.add(function(next) {
-      call.write({payload: getPayload(req.response_type, resp_param.size)});
-      next();
-    }, resp_param.interval_us);
-  });
-  delay_queue.add(function(next) {
-    call.end(getEchoTrailer(call));
-    next();
-  });
-}
-
-/**
- * Respond to a stream of payload requests with a stream of payload responses as
- * they arrive.
- * @param {Call} call Call to handle
- */
-function handleFullDuplex(call) {
-  echoHeader(call);
-  var delay_queue = new AsyncDelayQueue();
-  call.on('data', function(value) {
-    if (value.response_status) {
-      var status = value.response_status;
-      status.metadata = getEchoTrailer(call);
-      call.emit('error', status);
-      return;
-    }
-    _.each(value.response_parameters, function(resp_param) {
-      delay_queue.add(function(next) {
-        call.write({payload: getPayload(value.response_type, resp_param.size)});
-        next();
-      }, resp_param.interval_us);
-    });
-  });
-  call.on('end', function() {
-    delay_queue.add(function(next) {
-      call.end(getEchoTrailer(call));
-      next();
-    });
-  });
-}
-
-/**
- * Respond to a stream of payload requests with a stream of payload responses
- * after all requests have arrived
- * @param {Call} call Call to handle
- */
-function handleHalfDuplex(call) {
-  call.emit('error', Error('HalfDuplexCall not yet implemented'));
-}
-
-/**
- * Get a server object bound to the given port
- * @param {string} port Port to which to bind
- * @param {boolean} tls Indicates that the bound port should use TLS
- * @return {{server: Server, port: number}} Server object bound to the support,
- *     and port number that the server is bound to
- */
-function getServer(port, tls) {
-  // TODO(mlumish): enable TLS functionality
-  var options = {};
-  var server_creds;
-  if (tls) {
-    var key_path = path.join(__dirname, '../test/data/server1.key');
-    var pem_path = path.join(__dirname, '../test/data/server1.pem');
-
-    var key_data = fs.readFileSync(key_path);
-    var pem_data = fs.readFileSync(pem_path);
-    server_creds = grpc.ServerCredentials.createSsl(null,
-                                                    [{private_key: key_data,
-                                                      cert_chain: pem_data}]);
-  } else {
-    server_creds = grpc.ServerCredentials.createInsecure();
-  }
-  var server = new grpc.Server(options);
-  server.addService(testProto.TestService.service, {
-    emptyCall: handleEmpty,
-    unaryCall: handleUnary,
-    streamingOutputCall: handleStreamingOutput,
-    streamingInputCall: handleStreamingInput,
-    fullDuplexCall: handleFullDuplex,
-    halfDuplexCall: handleHalfDuplex
-  });
-  var port_num = server.bind('0.0.0.0:' + port, server_creds);
-  return {server: server, port: port_num};
-}
-
-if (require.main === module) {
-  var parseArgs = require('minimist');
-  var argv = parseArgs(process.argv, {
-    string: ['port', 'use_tls']
-  });
-  var server_obj = getServer(argv.port, argv.use_tls === 'true');
-  console.log('Server attaching to port ' + argv.port);
-  server_obj.server.start();
-}
-
-/**
- * See docs for getServer
- */
-exports.getServer = getServer;
diff --git a/src/node/jsdoc_conf.json b/src/node/jsdoc_conf.json
deleted file mode 100644
index 2d96775..0000000
--- a/src/node/jsdoc_conf.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-  "tags": {
-    "allowUnknownTags": true
-  },
-  "source": {
-    "include": [ "src/node/index.js", "src/node/src" ],
-    "includePattern": "src/node/.+\\.js(doc)?$",
-    "excludePattern": "(^|\\/|\\\\)_"
-  },
-  "opts": {
-    "package": "package.json",
-    "readme": "src/node/README.md"
-  },
-  "plugins": ["plugins/markdown"],
-  "templates": {
-    "cleverLinks": false,
-    "monospaceLinks": false,
-    "default": {
-      "outputSourceFiles": true
-    }
-  }
-}
diff --git a/src/node/performance/benchmark_client.js b/src/node/performance/benchmark_client.js
deleted file mode 100644
index 68afb8a..0000000
--- a/src/node/performance/benchmark_client.js
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * Benchmark client module
- * @module
- */
-
-'use strict';
-
-var fs = require('fs');
-var path = require('path');
-var util = require('util');
-var EventEmitter = require('events');
-
-var async = require('async');
-var _ = require('lodash');
-var PoissonProcess = require('poisson-process');
-var Histogram = require('./histogram');
-
-var genericService = require('./generic_service');
-
-var grpc = require('../../../');
-var serviceProto = grpc.load({
-  root: __dirname + '/../../..',
-  file: 'src/proto/grpc/testing/services.proto'}).grpc.testing;
-
-/**
- * Create a buffer filled with size zeroes
- * @param {number} size The length of the buffer
- * @return {Buffer} The new buffer
- */
-function zeroBuffer(size) {
-  var zeros = new Buffer(size);
-  zeros.fill(0);
-  return zeros;
-}
-
-/**
- * Convert a time difference, as returned by process.hrtime, to a number of
- * nanoseconds.
- * @param {Array.<number>} time_diff The time diff, represented as
- *     [seconds, nanoseconds]
- * @return {number} The total number of nanoseconds
- */
-function timeDiffToNanos(time_diff) {
-  return time_diff[0] * 1e9 + time_diff[1];
-}
-
-/**
- * The BenchmarkClient class. Opens channels to servers and makes RPCs based on
- * parameters from the driver, and records statistics about those RPCs.
- * @param {Array.<string>} server_targets List of servers to connect to
- * @param {number} channels The total number of channels to open
- * @param {Object} histogram_params Options for setting up the histogram
- * @param {Object=} security_params Options for TLS setup. If absent, don't use
- *     TLS
- */
-function BenchmarkClient(server_targets, channels, histogram_params,
-    security_params) {
-  var options = {
-    "grpc.max_receive_message_length": -1,
-    "grpc.max_send_message_length": -1
-  };
-  var creds;
-  if (security_params) {
-    var ca_path;
-    if (security_params.use_test_ca) {
-      ca_path = path.join(__dirname, '../test/data/ca.pem');
-      var ca_data = fs.readFileSync(ca_path);
-      creds = grpc.credentials.createSsl(ca_data);
-    } else {
-      creds = grpc.credentials.createSsl();
-    }
-    if (security_params.server_host_override) {
-      var host_override = security_params.server_host_override;
-      options['grpc.ssl_target_name_override'] = host_override;
-      options['grpc.default_authority'] = host_override;
-    }
-  } else {
-    creds = grpc.credentials.createInsecure();
-  }
-
-  this.clients = [];
-  var GenericClient = grpc.makeGenericClientConstructor(genericService);
-  this.genericClients = [];
-
-  for (var i = 0; i < channels; i++) {
-    this.clients[i] = new serviceProto.BenchmarkService(
-        server_targets[i % server_targets.length], creds, options);
-    this.genericClients[i] = new GenericClient(
-        server_targets[i % server_targets.length], creds, options);
-  }
-
-  this.histogram = new Histogram(histogram_params.resolution,
-                                 histogram_params.max_possible);
-
-  this.running = false;
-
-  this.pending_calls = 0;
-};
-
-util.inherits(BenchmarkClient, EventEmitter);
-
-/**
- * Start every client in the list of clients by waiting for each to be ready,
- * then starting outstanding_rpcs_per_channel calls on each of them
- * @param {Array<grpc.Client>} client_list The list of clients
- * @param {Number} outstanding_rpcs_per_channel The number of calls to start
- *     on each client
- * @param {function(grpc.Client)} makeCall Function to make a single call on
- *     a single client
- * @param {EventEmitter} emitter The event emitter to send errors on, if
- *     necessary
- */
-function startAllClients(client_list, outstanding_rpcs_per_channel, makeCall,
-                         emitter) {
-  var ready_wait_funcs = _.map(client_list, function(client) {
-    return _.partial(grpc.waitForClientReady, client, Infinity);
-  });
-  async.parallel(ready_wait_funcs, function(err) {
-    if (err) {
-      emitter.emit('error', err);
-      return;
-    }
-
-    _.each(client_list, function(client) {
-      _.times(outstanding_rpcs_per_channel, function() {
-        makeCall(client);
-      });
-    });
-  });
-}
-
-/**
- * Start a closed-loop test. For each channel, start
- * outstanding_rpcs_per_channel RPCs. Then, whenever an RPC finishes, start
- * another one.
- * @param {number} outstanding_rpcs_per_channel Number of RPCs to start per
- *     channel
- * @param {string} rpc_type Which method to call. Should be 'UNARY' or
- *     'STREAMING'
- * @param {number} req_size The size of the payload to send with each request
- * @param {number} resp_size The size of payload to request be sent in responses
- * @param {boolean} generic Indicates that the generic (non-proto) clients
- *     should be used
- */
-BenchmarkClient.prototype.startClosedLoop = function(
-    outstanding_rpcs_per_channel, rpc_type, req_size, resp_size, generic) {
-  var self = this;
-
-  self.running = true;
-
-  self.last_wall_time = process.hrtime();
-
-  self.last_usage = process.cpuUsage();
-
-  var makeCall;
-
-  var argument;
-  var client_list;
-  if (generic) {
-    argument = zeroBuffer(req_size);
-    client_list = self.genericClients;
-  } else {
-    argument = {
-      response_size: resp_size,
-      payload: {
-        body: zeroBuffer(req_size)
-      }
-    };
-    client_list = self.clients;
-  }
-
-  if (rpc_type == 'UNARY') {
-    makeCall = function(client) {
-      if (self.running) {
-        self.pending_calls++;
-        var start_time = process.hrtime();
-        client.unaryCall(argument, function(error, response) {
-          if (error) {
-            self.emit('error', new Error('Client error: ' + error.message));
-            self.running = false;
-            return;
-          }
-          var time_diff = process.hrtime(start_time);
-          self.histogram.add(timeDiffToNanos(time_diff));
-          makeCall(client);
-          self.pending_calls--;
-          if ((!self.running) && self.pending_calls == 0) {
-            self.emit('finished');
-          }
-        });
-      }
-    };
-  } else {
-    makeCall = function(client) {
-      if (self.running) {
-        self.pending_calls++;
-        var call = client.streamingCall();
-        var start_time = process.hrtime();
-        call.write(argument);
-        call.on('data', function() {
-          var time_diff = process.hrtime(start_time);
-          self.histogram.add(timeDiffToNanos(time_diff));
-          self.pending_calls--;
-          if (self.running) {
-            self.pending_calls++;
-            start_time = process.hrtime();
-            call.write(argument);
-          } else {
-            call.end();
-            if (self.pending_calls == 0) {
-              self.emit('finished');
-            }
-          }
-        });
-        call.on('error', function(error) {
-          self.emit('error', new Error('Client error: ' + error.message));
-          self.running = false;
-        });
-      }
-    };
-  }
-
-  startAllClients(client_list, outstanding_rpcs_per_channel, makeCall, self);
-};
-
-/**
- * Start a poisson test. For each channel, this initiates a number of Poisson
- * processes equal to outstanding_rpcs_per_channel, where each Poisson process
- * has the load parameter offered_load.
- * @param {number} outstanding_rpcs_per_channel Number of RPCs to start per
- *     channel
- * @param {string} rpc_type Which method to call. Should be 'UNARY' or
- *     'STREAMING'
- * @param {number} req_size The size of the payload to send with each request
- * @param {number} resp_size The size of payload to request be sent in responses
- * @param {number} offered_load The load parameter for the Poisson process
- * @param {boolean} generic Indicates that the generic (non-proto) clients
- *     should be used
- */
-BenchmarkClient.prototype.startPoisson = function(
-    outstanding_rpcs_per_channel, rpc_type, req_size, resp_size, offered_load,
-    generic) {
-  var self = this;
-
-  self.running = true;
-
-  self.last_wall_time = process.hrtime();
-
-  self.last_usage = process.cpuUsage();
-
-  var makeCall;
-
-  var argument;
-  var client_list;
-  if (generic) {
-    argument = zeroBuffer(req_size);
-    client_list = self.genericClients;
-  } else {
-    argument = {
-      response_size: resp_size,
-      payload: {
-        body: zeroBuffer(req_size)
-      }
-    };
-    client_list = self.clients;
-  }
-
-  if (rpc_type == 'UNARY') {
-    makeCall = function(client, poisson) {
-      if (self.running) {
-        self.pending_calls++;
-        var start_time = process.hrtime();
-        client.unaryCall(argument, function(error, response) {
-          if (error) {
-            self.emit('error', new Error('Client error: ' + error.message));
-            self.running = false;
-            return;
-          }
-          var time_diff = process.hrtime(start_time);
-          self.histogram.add(timeDiffToNanos(time_diff));
-          self.pending_calls--;
-          if ((!self.running) && self.pending_calls == 0) {
-            self.emit('finished');
-          }
-        });
-      } else {
-        poisson.stop();
-      }
-    };
-  } else {
-    self.emit('error', new Error('Streaming Poisson benchmarks not supported'));
-    return;
-  }
-
-  var averageIntervalMs = (1 / offered_load) * 1000;
-
-  startAllClients(client_list, outstanding_rpcs_per_channel, function(client){
-    var p = PoissonProcess.create(averageIntervalMs, function() {
-      makeCall(client, p);
-    });
-    p.start();
-  }, self);
-};
-
-/**
- * Return curent statistics for the client. If reset is set, restart
- * statistic collection.
- * @param {boolean} reset Indicates that statistics should be reset
- * @return {object} Client statistics
- */
-BenchmarkClient.prototype.mark = function(reset) {
-  var wall_time_diff = process.hrtime(this.last_wall_time);
-  var usage_diff = process.cpuUsage(this.last_usage);
-  var histogram = this.histogram;
-  if (reset) {
-    this.last_wall_time = process.hrtime();
-    this.last_usage = process.cpuUsage();
-    this.histogram = new Histogram(histogram.resolution,
-                                   histogram.max_possible);
-  }
-
-  return {
-    latencies: {
-      bucket: histogram.getContents(),
-      min_seen: histogram.minimum(),
-      max_seen: histogram.maximum(),
-      sum: histogram.getSum(),
-      sum_of_squares: histogram.sumOfSquares(),
-      count: histogram.getCount()
-    },
-    time_elapsed: wall_time_diff[0] + wall_time_diff[1] / 1e9,
-    time_user: usage_diff.user / 1000000,
-    time_system: usage_diff.system / 1000000
-  };
-};
-
-/**
- * Stop the clients.
- * @param {function} callback Called when the clients have finished shutting
- *     down
- */
-BenchmarkClient.prototype.stop = function(callback) {
-  this.running = false;
-  this.on('finished', callback);
-};
-
-module.exports = BenchmarkClient;
diff --git a/src/node/performance/benchmark_client_express.js b/src/node/performance/benchmark_client_express.js
deleted file mode 100644
index 815843f..0000000
--- a/src/node/performance/benchmark_client_express.js
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * Benchmark client module
- * @module
- */
-
-'use strict';
-
-var fs = require('fs');
-var path = require('path');
-var util = require('util');
-var EventEmitter = require('events');
-var http = require('http');
-var https = require('https');
-
-var async = require('async');
-var _ = require('lodash');
-var PoissonProcess = require('poisson-process');
-var Histogram = require('./histogram');
-
-/**
- * Convert a time difference, as returned by process.hrtime, to a number of
- * nanoseconds.
- * @param {Array.<number>} time_diff The time diff, represented as
- *     [seconds, nanoseconds]
- * @return {number} The total number of nanoseconds
- */
-function timeDiffToNanos(time_diff) {
-  return time_diff[0] * 1e9 + time_diff[1];
-}
-
-function BenchmarkClient(server_targets, channels, histogram_params,
-    security_params) {
-  var options = {
-    method: 'PUT',
-    headers: {
-      'Content-Type': 'application/json'
-    }
-  };
-  var protocol;
-  if (security_params) {
-    var ca_path;
-    protocol = https;
-    this.request = _.bind(https.request, https);
-    if (security_params.use_test_ca) {
-      ca_path = path.join(__dirname, '../test/data/ca.pem');
-      var ca_data = fs.readFileSync(ca_path);
-      options.ca = ca_data;
-    }
-    if (security_params.server_host_override) {
-      var host_override = security_params.server_host_override;
-      options.servername = host_override;
-    }
-  } else {
-    protocol = http;
-  }
-
-  this.request = _.bind(protocol.request, protocol);
-
-  this.client_options = [];
-
-  for (var i = 0; i < channels; i++) {
-    var host_port;
-    host_port = server_targets[i % server_targets.length].split(':');
-    var new_options = _.assign({hostname: host_port[0], port: +host_port[1]}, options);
-    this.client_options[i] = new_options;
-  }
-
-  this.histogram = new Histogram(histogram_params.resolution,
-                                 histogram_params.max_possible);
-
-  this.running = false;
-
-  this.pending_calls = 0;
-}
-
-util.inherits(BenchmarkClient, EventEmitter);
-
-function startAllClients(client_options_list, outstanding_rpcs_per_channel,
-                         makeCall, emitter) {
-  _.each(client_options_list, function(client_options) {
-    _.times(outstanding_rpcs_per_channel, function() {
-      makeCall(client_options);
-    });
-  });
-}
-
-BenchmarkClient.prototype.startClosedLoop = function(
-    outstanding_rpcs_per_channel, rpc_type, req_size, resp_size, generic) {
-  var self = this;
-
-  var options = {};
-
-  self.running = true;
-
-  if (rpc_type == 'UNARY') {
-    options.path = '/serviceProto.BenchmarkService.service/unaryCall';
-  } else {
-    self.emit('error', new Error('Unsupported rpc_type: ' + rpc_type));
-  }
-
-  if (generic) {
-    self.emit('error', new Error('Generic client not supported'));
-  }
-
-  self.last_wall_time = process.hrtime();
-  self.last_usage = process.cpuUsage();
-
-  var argument = {
-    response_size: resp_size,
-    payload: {
-      body: '0'.repeat(req_size)
-    }
-  };
-
-  function makeCall(client_options) {
-    if (self.running) {
-      self.pending_calls++;
-      var start_time = process.hrtime();
-      function finishCall(success) {
-        if (success) {
-          var time_diff = process.hrtime(start_time);
-          self.histogram.add(timeDiffToNanos(time_diff));
-        }
-        makeCall(client_options);
-        self.pending_calls--;
-        if ((!self.running) && self.pending_calls == 0) {
-          self.emit('finished');
-        }
-      }
-      var req = self.request(client_options, function(res) {
-        var res_data = '';
-        res.on('data', function(data) {
-          res_data += data;
-        });
-        res.on('end', function() {
-          JSON.parse(res_data);
-          finishCall(true);
-        });
-      });
-      req.write(JSON.stringify(argument));
-      req.end();
-      req.on('error', function(error) {
-        if (error.code === 'ECONNRESET' || error.code === 'ETIMEDOUT') {
-          finishCall(false);
-          return;
-        }
-        self.emit('error', new Error('Client error: ' + error.message));
-        self.running = false;
-      });
-    }
-  }
-
-  startAllClients(_.map(self.client_options, _.partial(_.assign, options)),
-                  outstanding_rpcs_per_channel, makeCall, self);
-};
-
-BenchmarkClient.prototype.startPoisson = function(
-    outstanding_rpcs_per_channel, rpc_type, req_size, resp_size, offered_load,
-    generic) {
-  var self = this;
-
-  var options = {};
-
-  self.running = true;
-
-  if (rpc_type == 'UNARY') {
-    options.path = '/serviceProto.BenchmarkService.service/unaryCall';
-  } else {
-    self.emit('error', new Error('Unsupported rpc_type: ' + rpc_type));
-  }
-
-  if (generic) {
-    self.emit('error', new Error('Generic client not supported'));
-  }
-
-  self.last_wall_time = process.hrtime();
-  self.last_usage = process.cpuUsage();
-
-  var argument = {
-    response_size: resp_size,
-    payload: {
-      body: '0'.repeat(req_size)
-    }
-  };
-
-  function makeCall(client_options, poisson) {
-    if (self.running) {
-      self.pending_calls++;
-      var start_time = process.hrtime();
-      var req = self.request(client_options, function(res) {
-        var res_data = '';
-        res.on('data', function(data) {
-          res_data += data;
-        });
-        res.on('end', function() {
-          JSON.parse(res_data);
-          var time_diff = process.hrtime(start_time);
-          self.histogram.add(timeDiffToNanos(time_diff));
-          self.pending_calls--;
-          if ((!self.running) && self.pending_calls == 0) {
-            self.emit('finished');
-          }
-        });
-      });
-      req.write(JSON.stringify(argument));
-      req.end();
-      req.on('error', function(error) {
-        self.emit('error', new Error('Client error: ' + error.message));
-        self.running = false;
-      });
-    } else {
-      poisson.stop();
-    }
-  }
-
-  var averageIntervalMs = (1 / offered_load) * 1000;
-
-  startAllClients(_.map(self.client_options, _.partial(_.assign, options)),
-                  outstanding_rpcs_per_channel, function(opts){
-                    var p = PoissonProcess.create(averageIntervalMs, function() {
-                      makeCall(opts, p);
-                    });
-                    p.start();
-                  }, self);
-};
-
-/**
- * Return curent statistics for the client. If reset is set, restart
- * statistic collection.
- * @param {boolean} reset Indicates that statistics should be reset
- * @return {object} Client statistics
- */
-BenchmarkClient.prototype.mark = function(reset) {
-  var wall_time_diff = process.hrtime(this.last_wall_time);
-  var usage_diff = process.cpuUsage(this.last_usage);
-  var histogram = this.histogram;
-  if (reset) {
-    this.last_wall_time = process.hrtime();
-    this.last_usage = process.cpuUsage();
-    this.histogram = new Histogram(histogram.resolution,
-                                   histogram.max_possible);
-  }
-
-  return {
-    latencies: {
-      bucket: histogram.getContents(),
-      min_seen: histogram.minimum(),
-      max_seen: histogram.maximum(),
-      sum: histogram.getSum(),
-      sum_of_squares: histogram.sumOfSquares(),
-      count: histogram.getCount()
-    },
-    time_elapsed: wall_time_diff[0] + wall_time_diff[1] / 1e9,
-    time_user: usage_diff.user / 1000000,
-    time_system: usage_diff.system / 1000000
-  };
-};
-
-/**
- * Stop the clients.
- * @param {function} callback Called when the clients have finished shutting
- *     down
- */
-BenchmarkClient.prototype.stop = function(callback) {
-  this.running = false;
-  this.on('finished', callback);
-};
-
-module.exports = BenchmarkClient;
diff --git a/src/node/performance/benchmark_server.js b/src/node/performance/benchmark_server.js
deleted file mode 100644
index 8d3a2b9..0000000
--- a/src/node/performance/benchmark_server.js
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * Benchmark server module
- * @module
- */
-
-'use strict';
-
-var fs = require('fs');
-var path = require('path');
-var EventEmitter = require('events');
-var util = require('util');
-
-var genericService = require('./generic_service');
-
-var grpc = require('../../../');
-var serviceProto = grpc.load({
-  root: __dirname + '/../../..',
-  file: 'src/proto/grpc/testing/services.proto'}).grpc.testing;
-
-/**
- * Create a buffer filled with size zeroes
- * @param {number} size The length of the buffer
- * @return {Buffer} The new buffer
- */
-function zeroBuffer(size) {
-  var zeros = new Buffer(size);
-  zeros.fill(0);
-  return zeros;
-}
-
-/**
- * Handler for the unary benchmark method. Simply responds with a payload
- * containing the requested number of zero bytes.
- * @param {Call} call The call object to be handled
- * @param {function} callback The callback to call with the response
- */
-function unaryCall(call, callback) {
-  var req = call.request;
-  var payload = {body: zeroBuffer(req.response_size)};
-  callback(null, {payload: payload});
-}
-
-/**
- * Handler for the streaming benchmark method. Simply responds to each request
- * with a payload containing the requested number of zero bytes.
- * @param {Call} call The call object to be handled
- */
-function streamingCall(call) {
-  call.on('data', function(value) {
-    var payload = {body: zeroBuffer(value.response_size)};
-    call.write({payload: payload});
-  });
-  call.on('end', function() {
-    call.end();
-  });
-}
-
-function makeUnaryGenericCall(response_size) {
-  var response = zeroBuffer(response_size);
-  return function unaryGenericCall(call, callback) {
-    callback(null, response);
-  };
-}
-
-function makeStreamingGenericCall(response_size) {
-  var response = zeroBuffer(response_size);
-  return function streamingGenericCall(call) {
-    call.on('data', function(value) {
-      call.write(response);
-    });
-    call.on('end', function() {
-      call.end();
-    });
-  };
-}
-
-/**
- * BenchmarkServer class. Constructed based on parameters from the driver and
- * stores statistics.
- * @param {string} host The host to serve on
- * @param {number} port The port to listen to
- * @param {boolean} tls Indicates whether TLS should be used
- * @param {boolean} generic Indicates whether to use the generic service
- * @param {number=} response_size The response size for the generic service
- */
-function BenchmarkServer(host, port, tls, generic, response_size) {
-  var server_creds;
-  var host_override;
-  if (tls) {
-    var key_path = path.join(__dirname, '../test/data/server1.key');
-    var pem_path = path.join(__dirname, '../test/data/server1.pem');
-
-    var key_data = fs.readFileSync(key_path);
-    var pem_data = fs.readFileSync(pem_path);
-    server_creds = grpc.ServerCredentials.createSsl(null,
-                                                    [{private_key: key_data,
-                                                      cert_chain: pem_data}]);
-  } else {
-    server_creds = grpc.ServerCredentials.createInsecure();
-  }
-
-  var options = {
-    "grpc.max_receive_message_length": -1,
-    "grpc.max_send_message_length": -1
-  };
-
-  var server = new grpc.Server(options);
-  this.port = server.bind(host + ':' + port, server_creds);
-  if (generic) {
-    server.addService(genericService, {
-      unaryCall: makeUnaryGenericCall(response_size),
-      streamingCall: makeStreamingGenericCall(response_size)
-    });
-  } else {
-    server.addService(serviceProto.BenchmarkService.service, {
-      unaryCall: unaryCall,
-      streamingCall: streamingCall
-    });
-  }
-  this.server = server;
-}
-
-util.inherits(BenchmarkServer, EventEmitter);
-
-/**
- * Start the benchmark server.
- */
-BenchmarkServer.prototype.start = function() {
-  this.server.start();
-  this.last_wall_time = process.hrtime();
-  this.last_usage = process.cpuUsage();
-  this.emit('started');
-};
-
-/**
- * Return the port number that the server is bound to.
- * @return {Number} The port number
- */
-BenchmarkServer.prototype.getPort = function() {
-  return this.port;
-};
-
-/**
- * Return current statistics for the server. If reset is set, restart
- * statistic collection.
- * @param {boolean} reset Indicates that statistics should be reset
- * @return {object} Server statistics
- */
-BenchmarkServer.prototype.mark = function(reset) {
-  var wall_time_diff = process.hrtime(this.last_wall_time);
-  var usage_diff = process.cpuUsage(this.last_usage);
-  if (reset) {
-    this.last_wall_time = process.hrtime();
-    this.last_usage = process.cpuUsage();
-  }
-  return {
-    time_elapsed: wall_time_diff[0] + wall_time_diff[1] / 1e9,
-    time_user: usage_diff.user / 1000000,
-    time_system: usage_diff.system / 1000000
-  };
-};
-
-/**
- * Stop the server.
- * @param {function} callback Called when the server has finished shutting down
- */
-BenchmarkServer.prototype.stop = function(callback) {
-  this.server.tryShutdown(callback);
-};
-
-module.exports = BenchmarkServer;
diff --git a/src/node/performance/benchmark_server_express.js b/src/node/performance/benchmark_server_express.js
deleted file mode 100644
index 73e5409..0000000
--- a/src/node/performance/benchmark_server_express.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * Benchmark server module
- * @module
- */
-
-'use strict';
-
-var fs = require('fs');
-var path = require('path');
-var http = require('http');
-var https = require('https');
-var EventEmitter = require('events');
-var util = require('util');
-
-var express = require('express');
-var bodyParser = require('body-parser');
-
-function unaryCall(req, res) {
-  var reqObj = req.body;
-  var payload = {body: '0'.repeat(reqObj.response_size)};
-  res.json(payload);
-}
-
-function BenchmarkServer(host, port, tls, generic, response_size) {
-  var app = express();
-  app.use(bodyParser.json());
-  app.put('/serviceProto.BenchmarkService.service/unaryCall', unaryCall);
-  this.input_host = host;
-  this.input_port = port;
-  if (tls) {
-    var credentials = {};
-    var key_path = path.join(__dirname, '../test/data/server1.key');
-    var pem_path = path.join(__dirname, '../test/data/server1.pem');
-
-    var key_data = fs.readFileSync(key_path);
-    var pem_data = fs.readFileSync(pem_path);
-    credentials['key'] = key_data;
-    credentials['cert'] = pem_data;
-    this.server = https.createServer(credentials, app);
-  } else {
-    this.server = http.createServer(app);
-  }
-}
-
-util.inherits(BenchmarkServer, EventEmitter);
-
-BenchmarkServer.prototype.start = function() {
-  var self = this;
-  this.server.listen(this.input_port, this.input_hostname, function() {
-    self.last_wall_time = process.hrtime();
-    self.last_usage = process.cpuUsage();
-    self.emit('started');
-  });
-};
-
-BenchmarkServer.prototype.getPort = function() {
-  return this.server.address().port;
-};
-
-BenchmarkServer.prototype.mark = function(reset) {
-  var wall_time_diff = process.hrtime(this.last_wall_time);
-  var usage_diff = process.cpuUsage(this.last_usage);
-  if (reset) {
-    this.last_wall_time = process.hrtime();
-    this.last_usage = process.cpuUsage();
-  }
-  return {
-    time_elapsed: wall_time_diff[0] + wall_time_diff[1] / 1e9,
-    time_user: usage_diff.user / 1000000,
-    time_system: usage_diff.system / 1000000
-  };
-};
-
-BenchmarkServer.prototype.stop = function(callback) {
-  this.server.close(callback);
-};
-
-module.exports = BenchmarkServer;
diff --git a/src/node/performance/generic_service.js b/src/node/performance/generic_service.js
deleted file mode 100644
index 8e76c50..0000000
--- a/src/node/performance/generic_service.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var _ = require('lodash');
-
-module.exports = {
-  'unaryCall' : {
-    path: '/grpc.testing.BenchmarkService/UnaryCall',
-    requestStream: false,
-    responseStream: false,
-    requestSerialize: _.identity,
-    requestDeserialize: _.identity,
-    responseSerialize: _.identity,
-    responseDeserialize: _.identity
-  },
-  'streamingCall' : {
-    path: '/grpc.testing.BenchmarkService/StreamingCall',
-    requestStream: true,
-    responseStream: true,
-    requestSerialize: _.identity,
-    requestDeserialize: _.identity,
-    responseSerialize: _.identity,
-    responseDeserialize: _.identity
-  }
-};
diff --git a/src/node/performance/histogram.js b/src/node/performance/histogram.js
deleted file mode 100644
index a03f2c1..0000000
--- a/src/node/performance/histogram.js
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * Histogram module. Exports the Histogram class
- * @module
- */
-
-'use strict';
-
-/**
- * Histogram class. Collects data and exposes a histogram and other statistics.
- * This data structure is taken directly from src/core/support/histogram.c, but
- * pared down to the statistics needed for client stats in
- * test/proto/benchmarks/stats.proto.
- * @constructor
- * @param {number} resolution The histogram's bucket resolution. Must be positive
- * @param {number} max_possible The maximum allowed value. Must be greater than 1
- */
-function Histogram(resolution, max_possible) {
-  this.resolution = resolution;
-  this.max_possible = max_possible;
-
-  this.sum = 0;
-  this.sum_of_squares = 0;
-  this.multiplier = 1 + resolution;
-  this.count = 0;
-  this.min_seen = max_possible;
-  this.max_seen = 0;
-  this.buckets = [];
-  for (var i = 0; i < this.bucketFor(max_possible) + 1; i++) {
-    this.buckets[i] = 0;
-  }
-}
-
-/**
- * Get the bucket index for a given value.
- * @param {number} value The value to check
- * @return {number} The bucket index
- */
-Histogram.prototype.bucketFor = function(value) {
-  return Math.floor(Math.log(value) / Math.log(this.multiplier));
-};
-
-/**
- * Get the minimum value for a given bucket index
- * @param {number} The bucket index to check
- * @return {number} The minimum value for that bucket
- */
-Histogram.prototype.bucketStart = function(index) {
-  return Math.pow(this.multiplier, index);
-};
-
-/**
- * Add a value to the histogram. This updates all statistics with the new
- * value. Those statistics should not be modified except with this function
- * @param {number} value The value to add
- */
-Histogram.prototype.add = function(value) {
-  // Ensure value is a number
-  value = +value;
-  this.sum += value;
-  this.sum_of_squares += value * value;
-  this.count++;
-  if (value < this.min_seen) {
-    this.min_seen = value;
-  }
-  if (value > this.max_seen) {
-    this.max_seen = value;
-  }
-  this.buckets[this.bucketFor(value)]++;
-};
-
-/**
- * Get the mean of all added values
- * @return {number} The mean
- */
-Histogram.prototype.mean = function() {
-  return this.sum / this.count;
-};
-
-/**
- * Get the variance of all added values. Used to calulate the standard deviation
- * @return {number} The variance
- */
-Histogram.prototype.variance = function() {
-  if (this.count == 0) {
-    return 0;
-  }
-  return (this.sum_of_squares * this.count - this.sum * this.sum) /
-      (this.count * this.count);
-};
-
-/**
- * Get the standard deviation of all added values
- * @return {number} The standard deviation
- */
-Histogram.prototype.stddev = function() {
-  return Math.sqrt(this.variance);
-};
-
-/**
- * Get the maximum among all added values
- * @return {number} The maximum
- */
-Histogram.prototype.maximum = function() {
-  return this.max_seen;
-};
-
-/**
- * Get the minimum among all added values
- * @return {number} The minimum
- */
-Histogram.prototype.minimum = function() {
-  return this.min_seen;
-};
-
-/**
- * Get the number of all added values
- * @return {number} The count
- */
-Histogram.prototype.getCount = function() {
-  return this.count;
-};
-
-/**
- * Get the sum of all added values
- * @return {number} The sum
- */
-Histogram.prototype.getSum = function() {
-  return this.sum;
-};
-
-/**
- * Get the sum of squares of all added values
- * @return {number} The sum of squares
- */
-Histogram.prototype.sumOfSquares = function() {
-  return this.sum_of_squares;
-};
-
-/**
- * Get the raw histogram as a list of bucket sizes
- * @return {Array.<number>} The buckets
- */
-Histogram.prototype.getContents = function() {
-  return this.buckets;
-};
-
-module.exports = Histogram;
diff --git a/src/node/performance/worker.js b/src/node/performance/worker.js
deleted file mode 100644
index d0fb3bc..0000000
--- a/src/node/performance/worker.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var console = require('console');
-var WorkerServiceImpl = require('./worker_service_impl');
-
-var grpc = require('../../../');
-var serviceProto = grpc.load({
-  root: __dirname + '/../../..',
-  file: 'src/proto/grpc/testing/services.proto'}).grpc.testing;
-
-function runServer(port, benchmark_impl) {
-  var server_creds = grpc.ServerCredentials.createInsecure();
-  var server = new grpc.Server();
-  server.addService(serviceProto.WorkerService.service,
-                    new WorkerServiceImpl(benchmark_impl, server));
-  var address = '0.0.0.0:' + port;
-  server.bind(address, server_creds);
-  server.start();
-  console.log('running QPS worker on %s', address);
-  return server;
-}
-
-if (require.main === module) {
-  Error.stackTraceLimit = Infinity;
-  var parseArgs = require('minimist');
-  var argv = parseArgs(process.argv, {
-    string: ['driver_port', 'benchmark_impl']
-  });
-  runServer(argv.driver_port, argv.benchmark_impl);
-}
-
-exports.runServer = runServer;
diff --git a/src/node/performance/worker_service_impl.js b/src/node/performance/worker_service_impl.js
deleted file mode 100644
index a73d77e..0000000
--- a/src/node/performance/worker_service_impl.js
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var os = require('os');
-var console = require('console');
-var BenchmarkClient = require('./benchmark_client');
-var BenchmarkServer = require('./benchmark_server');
-
-module.exports = function WorkerServiceImpl(benchmark_impl, server) {
-  var BenchmarkClient;
-  var BenchmarkServer;
-  switch (benchmark_impl) {
-    case 'grpc':
-    BenchmarkClient = require('./benchmark_client');
-    BenchmarkServer = require('./benchmark_server');
-    break;
-    case 'express':
-    BenchmarkClient = require('./benchmark_client_express');
-    BenchmarkServer = require('./benchmark_server_express');
-    break;
-    default:
-    throw new Error('Unrecognized benchmark impl: ' + benchmark_impl);
-  }
-
-  this.quitWorker = function quitWorker(call, callback) {
-    callback(null, {});
-    server.tryShutdown(function() {});
-  };
-
-  this.runClient = function runClient(call) {
-    var client;
-    call.on('data', function(request) {
-      var stats;
-      switch (request.argtype) {
-        case 'setup':
-        var setup = request.setup;
-        console.log('ClientConfig %j', setup);
-        client = new BenchmarkClient(setup.server_targets,
-                                     setup.client_channels,
-                                     setup.histogram_params,
-                                     setup.security_params);
-        client.on('error', function(error) {
-          call.emit('error', error);
-        });
-        var req_size, resp_size, generic;
-        switch (setup.payload_config.payload) {
-          case 'bytebuf_params':
-          req_size = setup.payload_config.bytebuf_params.req_size;
-          resp_size = setup.payload_config.bytebuf_params.resp_size;
-          generic = true;
-          break;
-          case 'simple_params':
-          req_size = setup.payload_config.simple_params.req_size;
-          resp_size = setup.payload_config.simple_params.resp_size;
-          generic = false;
-          break;
-          default:
-          call.emit('error', new Error('Unsupported PayloadConfig type' +
-              setup.payload_config.payload));
-          return;
-        }
-        switch (setup.load_params.load) {
-          case 'closed_loop':
-          client.startClosedLoop(setup.outstanding_rpcs_per_channel,
-                                 setup.rpc_type, req_size, resp_size, generic);
-          break;
-          case 'poisson':
-          client.startPoisson(setup.outstanding_rpcs_per_channel,
-                              setup.rpc_type, req_size, resp_size,
-                              setup.load_params.poisson.offered_load, generic);
-          break;
-          default:
-          call.emit('error', new Error('Unsupported LoadParams type' +
-              setup.load_params.load));
-          return;
-        }
-        stats = client.mark();
-        call.write({
-          stats: stats
-        });
-        break;
-        case 'mark':
-        if (client) {
-          stats = client.mark(request.mark.reset);
-          call.write({
-            stats: stats
-          });
-        } else {
-          call.emit('error', new Error('Got Mark before ClientConfig'));
-        }
-        break;
-        default:
-        throw new Error('Nonexistent client argtype option: ' + request.argtype);
-      }
-    });
-    call.on('end', function() {
-      client.stop(function() {
-        call.end();
-      });
-    });
-  };
-
-  this.runServer = function runServer(call) {
-    var server;
-    call.on('data', function(request) {
-      var stats;
-      switch (request.argtype) {
-        case 'setup':
-        console.log('ServerConfig %j', request.setup);
-        var setup = request.setup;
-        var resp_size, generic;
-        if (setup.payload_config) {
-          switch (setup.payload_config.payload) {
-            case 'bytebuf_params':
-            resp_size = setup.payload_config.bytebuf_params.resp_size;
-            generic = true;
-            break;
-            case 'simple_params':
-            resp_size = setup.payload_config.simple_params.resp_size;
-            generic = false;
-            break;
-            default:
-            call.emit('error', new Error('Unsupported PayloadConfig type' +
-                setup.payload_config.payload));
-            return;
-          }
-        }
-        server = new BenchmarkServer('[::]', request.setup.port,
-                                     request.setup.security_params,
-                                     generic, resp_size);
-        server.on('started', function() {
-          stats = server.mark();
-          call.write({
-            stats: stats,
-            port: server.getPort()
-          });
-        });
-        server.start();
-        break;
-        case 'mark':
-        if (server) {
-          stats = server.mark(request.mark.reset);
-          call.write({
-            stats: stats,
-            port: server.getPort(),
-            cores: 1
-          });
-        } else {
-          call.emit('error', new Error('Got Mark before ServerConfig'));
-        }
-        break;
-        default:
-        throw new Error('Nonexistent server argtype option');
-      }
-    });
-    call.on('end', function() {
-      server.stop(function() {
-        call.end();
-      });
-    });
-  };
-
-  this.coreCount = function coreCount(call, callback) {
-    callback(null, {cores: os.cpus().length});
-  };
-};
diff --git a/src/node/src/client.js b/src/node/src/client.js
deleted file mode 100644
index edc51b7..0000000
--- a/src/node/src/client.js
+++ /dev/null
@@ -1,951 +0,0 @@
-/**
- * @license
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * Client module
- *
- * This module contains the factory method for creating Client classes, and the
- * method calling code for all types of methods.
- *
- * @example <caption>Create a client and call a method on it</caption>
- *
- * var proto_obj = grpc.load(proto_file_path);
- * var Client = proto_obj.package.subpackage.ServiceName;
- * var client = new Client(server_address, client_credentials);
- * var call = client.unaryMethod(arguments, callback);
- */
-
-'use strict';
-
-var _ = require('lodash');
-var arguejs = require('arguejs');
-
-var grpc = require('./grpc_extension');
-
-var common = require('./common');
-
-var Metadata = require('./metadata');
-
-var constants = require('./constants');
-
-var EventEmitter = require('events').EventEmitter;
-
-var stream = require('stream');
-
-var Readable = stream.Readable;
-var Writable = stream.Writable;
-var Duplex = stream.Duplex;
-var util = require('util');
-var version = require('../../../package.json').version;
-
-/**
- * Initial response metadata sent by the server when it starts processing the
- * call
- * @event grpc~ClientUnaryCall#metadata
- * @type {grpc.Metadata}
- */
-
-/**
- * Status of the call when it has completed.
- * @event grpc~ClientUnaryCall#status
- * @type grpc~StatusObject
- */
-
-util.inherits(ClientUnaryCall, EventEmitter);
-
-/**
- * An EventEmitter. Used for unary calls.
- * @constructor grpc~ClientUnaryCall
- * @extends external:EventEmitter
- * @param {grpc.internal~Call} call The call object associated with the request
- */
-function ClientUnaryCall(call) {
-  EventEmitter.call(this);
-  this.call = call;
-}
-
-util.inherits(ClientWritableStream, Writable);
-
-/**
- * A stream that the client can write to. Used for calls that are streaming from
- * the client side.
- * @constructor grpc~ClientWritableStream
- * @extends external:Writable
- * @borrows grpc~ClientUnaryCall#cancel as grpc~ClientWritableStream#cancel
- * @borrows grpc~ClientUnaryCall#getPeer as grpc~ClientWritableStream#getPeer
- * @borrows grpc~ClientUnaryCall#event:metadata as
- *     grpc~ClientWritableStream#metadata
- * @borrows grpc~ClientUnaryCall#event:status as
- *     grpc~ClientWritableStream#status
- * @param {grpc.internal~Call} call The call object to send data with
- * @param {grpc~serialize=} [serialize=identity] Serialization
- *     function for writes.
- */
-function ClientWritableStream(call, serialize) {
-  Writable.call(this, {objectMode: true});
-  this.call = call;
-  this.serialize = common.wrapIgnoreNull(serialize);
-  this.on('finish', function() {
-    var batch = {};
-    batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
-    call.startBatch(batch, function() {});
-  });
-}
-
-/**
- * Write a message to the request stream. If serializing the argument fails,
- * the call will be cancelled and the stream will end with an error.
- * @name grpc~ClientWritableStream#write
- * @kind function
- * @override
- * @param {*} message The message to write. Must be a valid argument to the
- *     serialize function of the corresponding method
- * @param {grpc.writeFlags} flags Flags to modify how the message is written
- * @param {Function} callback Callback for when this chunk of data is flushed
- * @return {boolean} As defined for [Writable]{@link external:Writable}
- */
-
-/**
- * Attempt to write the given chunk. Calls the callback when done. This is an
- * implementation of a method needed for implementing stream.Writable.
- * @private
- * @param {*} chunk The chunk to write
- * @param {grpc.writeFlags} encoding Used to pass write flags
- * @param {function(Error=)} callback Called when the write is complete
- */
-function _write(chunk, encoding, callback) {
-  /* jshint validthis: true */
-  var batch = {};
-  var message;
-  var self = this;
-  if (this.writeFailed) {
-    /* Once a write fails, just call the callback immediately to let the caller
-       flush any pending writes. */
-    setImmediate(callback);
-    return;
-  }
-  try {
-    message = this.serialize(chunk);
-  } catch (e) {
-    /* Sending this error to the server and emitting it immediately on the
-       client may put the call in a slightly weird state on the client side,
-       but passing an object that causes a serialization failure is a misuse
-       of the API anyway, so that's OK. The primary purpose here is to give the
-       programmer a useful error and to stop the stream properly */
-    this.call.cancelWithStatus(constants.status.INTERNAL,
-                               'Serialization failure');
-    callback(e);
-    return;
-  }
-  if (_.isFinite(encoding)) {
-    /* Attach the encoding if it is a finite number. This is the closest we
-     * can get to checking that it is valid flags */
-    message.grpcWriteFlags = encoding;
-  }
-  batch[grpc.opType.SEND_MESSAGE] = message;
-  this.call.startBatch(batch, function(err, event) {
-    if (err) {
-      /* Assume that the call is complete and that writing failed because a
-         status was received. In that case, set a flag to discard all future
-         writes */
-      self.writeFailed = true;
-    }
-    callback();
-  });
-}
-
-ClientWritableStream.prototype._write = _write;
-
-util.inherits(ClientReadableStream, Readable);
-
-/**
- * A stream that the client can read from. Used for calls that are streaming
- * from the server side.
- * @constructor grpc~ClientReadableStream
- * @extends external:Readable
- * @borrows grpc~ClientUnaryCall#cancel as grpc~ClientReadableStream#cancel
- * @borrows grpc~ClientUnaryCall#getPeer as grpc~ClientReadableStream#getPeer
- * @borrows grpc~ClientUnaryCall#event:metadata as
- *     grpc~ClientReadableStream#metadata
- * @borrows grpc~ClientUnaryCall#event:status as
- *     grpc~ClientReadableStream#status
- * @param {grpc.internal~Call} call The call object to read data with
- * @param {grpc~deserialize=} [deserialize=identity]
- *     Deserialization function for reads
- */
-function ClientReadableStream(call, deserialize) {
-  Readable.call(this, {objectMode: true});
-  this.call = call;
-  this.finished = false;
-  this.reading = false;
-  this.deserialize = common.wrapIgnoreNull(deserialize);
-  /* Status generated from reading messages from the server. Overrides the
-   * status from the server if not OK */
-  this.read_status = null;
-  /* Status received from the server. */
-  this.received_status = null;
-}
-
-/**
- * Called when all messages from the server have been processed. The status
- * parameter indicates that the call should end with that status. status
- * defaults to OK if not provided.
- * @param {Object!} status The status that the call should end with
- * @private
- */
-function _readsDone(status) {
-  /* jshint validthis: true */
-  if (!status) {
-    status = {code: constants.status.OK, details: 'OK'};
-  }
-  if (status.code !== constants.status.OK) {
-    this.call.cancelWithStatus(status.code, status.details);
-  }
-  this.finished = true;
-  this.read_status = status;
-  this._emitStatusIfDone();
-}
-
-ClientReadableStream.prototype._readsDone = _readsDone;
-
-/**
- * Called to indicate that we have received a status from the server.
- * @private
- */
-function _receiveStatus(status) {
-  /* jshint validthis: true */
-  this.received_status = status;
-  this._emitStatusIfDone();
-}
-
-ClientReadableStream.prototype._receiveStatus = _receiveStatus;
-
-/**
- * If we have both processed all incoming messages and received the status from
- * the server, emit the status. Otherwise, do nothing.
- * @private
- */
-function _emitStatusIfDone() {
-  /* jshint validthis: true */
-  var status;
-  if (this.read_status && this.received_status) {
-    if (this.read_status.code !== constants.status.OK) {
-      status = this.read_status;
-    } else {
-      status = this.received_status;
-    }
-    if (status.code === constants.status.OK) {
-      this.push(null);
-    } else {
-      var error = new Error(status.details);
-      error.code = status.code;
-      error.metadata = status.metadata;
-      this.emit('error', error);
-    }
-    this.emit('status', status);
-  }
-}
-
-ClientReadableStream.prototype._emitStatusIfDone = _emitStatusIfDone;
-
-/**
- * Read the next object from the stream.
- * @private
- * @param {*} size Ignored because we use objectMode=true
- */
-function _read(size) {
-  /* jshint validthis: true */
-  var self = this;
-  /**
-   * Callback to be called when a READ event is received. Pushes the data onto
-   * the read queue and starts reading again if applicable
-   * @param {grpc.Event} event READ event object
-   */
-  function readCallback(err, event) {
-    if (err) {
-      // Something has gone wrong. Stop reading and wait for status
-      self.finished = true;
-      self._readsDone();
-      return;
-    }
-    var data = event.read;
-    var deserialized;
-    try {
-      deserialized = self.deserialize(data);
-    } catch (e) {
-      self._readsDone({code: constants.status.INTERNAL,
-                       details: 'Failed to parse server response'});
-      return;
-    }
-    if (data === null) {
-      self._readsDone();
-      return;
-    }
-    if (self.push(deserialized) && data !== null) {
-      var read_batch = {};
-      read_batch[grpc.opType.RECV_MESSAGE] = true;
-      self.call.startBatch(read_batch, readCallback);
-    } else {
-      self.reading = false;
-    }
-  }
-  if (self.finished) {
-    self.push(null);
-  } else {
-    if (!self.reading) {
-      self.reading = true;
-      var read_batch = {};
-      read_batch[grpc.opType.RECV_MESSAGE] = true;
-      self.call.startBatch(read_batch, readCallback);
-    }
-  }
-}
-
-ClientReadableStream.prototype._read = _read;
-
-util.inherits(ClientDuplexStream, Duplex);
-
-/**
- * A stream that the client can read from or write to. Used for calls with
- * duplex streaming.
- * @constructor grpc~ClientDuplexStream
- * @extends external:Duplex
- * @borrows grpc~ClientUnaryCall#cancel as grpc~ClientDuplexStream#cancel
- * @borrows grpc~ClientUnaryCall#getPeer as grpc~ClientDuplexStream#getPeer
- * @borrows grpc~ClientWritableStream#write as grpc~ClientDuplexStream#write
- * @borrows grpc~ClientUnaryCall#event:metadata as
- *     grpc~ClientDuplexStream#metadata
- * @borrows grpc~ClientUnaryCall#event:status as
- *     grpc~ClientDuplexStream#status
- * @param {grpc.internal~Call} call Call object to proxy
- * @param {grpc~serialize=} [serialize=identity] Serialization
- *     function for requests
- * @param {grpc~deserialize=} [deserialize=identity]
- *     Deserialization function for responses
- */
-function ClientDuplexStream(call, serialize, deserialize) {
-  Duplex.call(this, {objectMode: true});
-  this.serialize = common.wrapIgnoreNull(serialize);
-  this.deserialize = common.wrapIgnoreNull(deserialize);
-  this.call = call;
-  /* Status generated from reading messages from the server. Overrides the
-   * status from the server if not OK */
-  this.read_status = null;
-  /* Status received from the server. */
-  this.received_status = null;
-  this.on('finish', function() {
-    var batch = {};
-    batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
-    call.startBatch(batch, function() {});
-  });
-}
-
-ClientDuplexStream.prototype._readsDone = _readsDone;
-ClientDuplexStream.prototype._receiveStatus = _receiveStatus;
-ClientDuplexStream.prototype._emitStatusIfDone = _emitStatusIfDone;
-ClientDuplexStream.prototype._read = _read;
-ClientDuplexStream.prototype._write = _write;
-
-/**
- * Cancel the ongoing call. Results in the call ending with a CANCELLED status,
- * unless it has already ended with some other status.
- * @alias grpc~ClientUnaryCall#cancel
- */
-function cancel() {
-  /* jshint validthis: true */
-  this.call.cancel();
-}
-
-ClientUnaryCall.prototype.cancel = cancel;
-ClientReadableStream.prototype.cancel = cancel;
-ClientWritableStream.prototype.cancel = cancel;
-ClientDuplexStream.prototype.cancel = cancel;
-
-/**
- * Get the endpoint this call/stream is connected to.
- * @return {string} The URI of the endpoint
- * @alias grpc~ClientUnaryCall#getPeer
- */
-function getPeer() {
-  /* jshint validthis: true */
-  return this.call.getPeer();
-}
-
-ClientUnaryCall.prototype.getPeer = getPeer;
-ClientReadableStream.prototype.getPeer = getPeer;
-ClientWritableStream.prototype.getPeer = getPeer;
-ClientDuplexStream.prototype.getPeer = getPeer;
-
-/**
- * Any client call type
- * @typedef {(ClientUnaryCall|ClientReadableStream|
- *            ClientWritableStream|ClientDuplexStream)}
- *     grpc.Client~Call
- */
-
-/**
- * Options that can be set on a call.
- * @typedef {Object} grpc.Client~CallOptions
- * @property {grpc~Deadline} deadline The deadline for the entire call to
- *     complete.
- * @property {string} host Server hostname to set on the call. Only meaningful
- *     if different from the server address used to construct the client.
- * @property {grpc.Client~Call} parent Parent call. Used in servers when
- *     making a call as part of the process of handling a call. Used to
- *     propagate some information automatically, as specified by
- *     propagate_flags.
- * @property {number} propagate_flags Indicates which properties of a parent
- *     call should propagate to this call. Bitwise combination of flags in
- *     {@link grpc.propagate}.
- * @property {grpc.credentials~CallCredentials} credentials The credentials that
- *     should be used to make this particular call.
- */
-
-/**
- * Get a call object built with the provided options.
- * @access private
- * @param {grpc.Client~CallOptions=} options Options object.
- */
-function getCall(channel, method, options) {
-  var deadline;
-  var host;
-  var parent;
-  var propagate_flags;
-  var credentials;
-  if (options) {
-    deadline = options.deadline;
-    host = options.host;
-    parent = _.get(options, 'parent.call');
-    propagate_flags = options.propagate_flags;
-    credentials = options.credentials;
-  }
-  if (deadline === undefined) {
-    deadline = Infinity;
-  }
-  var call = new grpc.Call(channel, method, deadline, host,
-                           parent, propagate_flags);
-  if (credentials) {
-    call.setCredentials(credentials);
-  }
-  return call;
-}
-
-/**
- * A generic gRPC client. Primarily useful as a base class for generated clients
- * @memberof grpc
- * @constructor
- * @param {string} address Server address to connect to
- * @param {grpc~ChannelCredentials} credentials Credentials to use to connect to
- *     the server
- * @param {Object} options Options to apply to channel creation
- */
-function Client(address, credentials, options) {
-  if (!options) {
-    options = {};
-  }
-  /* Append the grpc-node user agent string after the application user agent
-   * string, and put the combination at the beginning of the user agent string
-   */
-  if (options['grpc.primary_user_agent']) {
-    options['grpc.primary_user_agent'] += ' ';
-  } else {
-    options['grpc.primary_user_agent'] = '';
-  }
-  options['grpc.primary_user_agent'] += 'grpc-node/' + version;
-  /* Private fields use $ as a prefix instead of _ because it is an invalid
-   * prefix of a method name */
-  this.$channel = new grpc.Channel(address, credentials, options);
-}
-
-exports.Client = Client;
-
-/**
- * @callback grpc.Client~requestCallback
- * @param {?grpc~ServiceError} error The error, if the call
- *     failed
- * @param {*} value The response value, if the call succeeded
- */
-
-/**
- * Make a unary request to the given method, using the given serialize
- * and deserialize functions, with the given argument.
- * @param {string} method The name of the method to request
- * @param {grpc~serialize} serialize The serialization function for
- *     inputs
- * @param {grpc~deserialize} deserialize The deserialization
- *     function for outputs
- * @param {*} argument The argument to the call. Should be serializable with
- *     serialize
- * @param {grpc.Metadata=} metadata Metadata to add to the call
- * @param {grpc.Client~CallOptions=} options Options map
- * @param {grpc.Client~requestCallback} callback The callback to
- *     for when the response is received
- * @return {grpc~ClientUnaryCall} An event emitter for stream related events
- */
-Client.prototype.makeUnaryRequest = function(method, serialize, deserialize,
-                                             argument, metadata, options,
-                                             callback) {
-  /* While the arguments are listed in the function signature, those variables
-   * are not used directly. Instead, ArgueJS processes the arguments
-   * object. This allows for simple handling of optional arguments in the
-   * middle of the argument list, and also provides type checking. */
-  var args = arguejs({method: String, serialize: Function,
-                      deserialize: Function,
-                      argument: null, metadata: [Metadata, new Metadata()],
-                      options: [Object], callback: Function}, arguments);
-  var call = getCall(this.$channel, method, args.options);
-  var emitter = new ClientUnaryCall(call);
-  metadata = args.metadata.clone();
-  var client_batch = {};
-  var message = serialize(args.argument);
-  if (args.options) {
-    message.grpcWriteFlags = args.options.flags;
-  }
-
-  client_batch[grpc.opType.SEND_INITIAL_METADATA] =
-      metadata._getCoreRepresentation();
-  client_batch[grpc.opType.SEND_MESSAGE] = message;
-  client_batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
-  client_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
-  client_batch[grpc.opType.RECV_MESSAGE] = true;
-  client_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-  call.startBatch(client_batch, function(err, response) {
-    response.status.metadata = Metadata._fromCoreRepresentation(
-        response.status.metadata);
-    var status = response.status;
-    var error;
-    var deserialized;
-    emitter.emit('metadata', Metadata._fromCoreRepresentation(
-        response.metadata));
-    if (status.code === constants.status.OK) {
-      if (err) {
-        // Got a batch error, but OK status. Something went wrong
-        args.callback(err);
-        return;
-      } else {
-        try {
-          deserialized = deserialize(response.read);
-        } catch (e) {
-          /* Change status to indicate bad server response. This will result
-           * in passing an error to the callback */
-          status = {
-            code: constants.status.INTERNAL,
-            details: 'Failed to parse server response'
-          };
-        }
-      }
-    }
-    if (status.code !== constants.status.OK) {
-      error = new Error(status.details);
-      error.code = status.code;
-      error.metadata = status.metadata;
-      args.callback(error);
-    } else {
-      args.callback(null, deserialized);
-    }
-    emitter.emit('status', status);
-  });
-  return emitter;
-};
-
-/**
- * Make a client stream request to the given method, using the given serialize
- * and deserialize functions, with the given argument.
- * @param {string} method The name of the method to request
- * @param {grpc~serialize} serialize The serialization function for
- *     inputs
- * @param {grpc~deserialize} deserialize The deserialization
- *     function for outputs
- * @param {grpc.Metadata=} metadata Array of metadata key/value pairs to add to
- *     the call
- * @param {grpc.Client~CallOptions=} options Options map
- * @param {grpc.Client~requestCallback} callback The callback to for when the
- *     response is received
- * @return {grpc~ClientWritableStream} An event emitter for stream related
- *     events
- */
-Client.prototype.makeClientStreamRequest = function(method, serialize,
-                                                      deserialize, metadata,
-                                                      options, callback) {
-  /* While the arguments are listed in the function signature, those variables
-   * are not used directly. Instead, ArgueJS processes the arguments
-   * object. This allows for simple handling of optional arguments in the
-   * middle of the argument list, and also provides type checking. */
-  var args = arguejs({method:String, serialize: Function,
-                      deserialize: Function,
-                      metadata: [Metadata, new Metadata()],
-                      options: [Object], callback: Function}, arguments);
-  var call = getCall(this.$channel, method, args.options);
-  metadata = args.metadata.clone();
-  var stream = new ClientWritableStream(call, serialize);
-  var metadata_batch = {};
-  metadata_batch[grpc.opType.SEND_INITIAL_METADATA] =
-      metadata._getCoreRepresentation();
-  metadata_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
-  call.startBatch(metadata_batch, function(err, response) {
-    if (err) {
-      // The call has stopped for some reason. A non-OK status will arrive
-      // in the other batch.
-      return;
-    }
-    stream.emit('metadata', Metadata._fromCoreRepresentation(
-        response.metadata));
-  });
-  var client_batch = {};
-  client_batch[grpc.opType.RECV_MESSAGE] = true;
-  client_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-  call.startBatch(client_batch, function(err, response) {
-    response.status.metadata = Metadata._fromCoreRepresentation(
-        response.status.metadata);
-    var status = response.status;
-    var error;
-    var deserialized;
-    if (status.code === constants.status.OK) {
-      if (err) {
-        // Got a batch error, but OK status. Something went wrong
-        args.callback(err);
-        return;
-      } else {
-        try {
-          deserialized = deserialize(response.read);
-        } catch (e) {
-          /* Change status to indicate bad server response. This will result
-           * in passing an error to the callback */
-          status = {
-            code: constants.status.INTERNAL,
-            details: 'Failed to parse server response'
-          };
-        }
-      }
-    }
-    if (status.code !== constants.status.OK) {
-      error = new Error(response.status.details);
-      error.code = status.code;
-      error.metadata = status.metadata;
-      args.callback(error);
-    } else {
-      args.callback(null, deserialized);
-    }
-    stream.emit('status', status);
-  });
-  return stream;
-};
-
-/**
- * Make a server stream request to the given method, with the given serialize
- * and deserialize function, using the given argument
- * @param {string} method The name of the method to request
- * @param {grpc~serialize} serialize The serialization function for inputs
- * @param {grpc~deserialize} deserialize The deserialization
- *     function for outputs
- * @param {*} argument The argument to the call. Should be serializable with
- *     serialize
- * @param {grpc.Metadata=} metadata Array of metadata key/value pairs to add to
- *     the call
- * @param {grpc.Client~CallOptions=} options Options map
- * @return {grpc~ClientReadableStream} An event emitter for stream related
- *     events
- */
-Client.prototype.makeServerStreamRequest = function(method, serialize,
-                                                    deserialize, argument,
-                                                    metadata, options) {
-  /* While the arguments are listed in the function signature, those variables
-   * are not used directly. Instead, ArgueJS processes the arguments
-   * object. */
-  var args = arguejs({method:String, serialize: Function,
-                      deserialize: Function,
-                      argument: null, metadata: [Metadata, new Metadata()],
-                      options: [Object]}, arguments);
-  var call = getCall(this.$channel, method, args.options);
-  metadata = args.metadata.clone();
-  var stream = new ClientReadableStream(call, deserialize);
-  var start_batch = {};
-  var message = serialize(args.argument);
-  if (args.options) {
-    message.grpcWriteFlags = args.options.flags;
-  }
-  start_batch[grpc.opType.SEND_INITIAL_METADATA] =
-      metadata._getCoreRepresentation();
-  start_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
-  start_batch[grpc.opType.SEND_MESSAGE] = message;
-  start_batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
-  call.startBatch(start_batch, function(err, response) {
-    if (err) {
-      // The call has stopped for some reason. A non-OK status will arrive
-      // in the other batch.
-      return;
-    }
-    stream.emit('metadata', Metadata._fromCoreRepresentation(
-        response.metadata));
-  });
-  var status_batch = {};
-  status_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-  call.startBatch(status_batch, function(err, response) {
-    if (err) {
-      stream.emit('error', err);
-      return;
-    }
-    response.status.metadata = Metadata._fromCoreRepresentation(
-        response.status.metadata);
-    stream._receiveStatus(response.status);
-  });
-  return stream;
-};
-
-
-/**
- * Make a bidirectional stream request with this method on the given channel.
- * @param {string} method The name of the method to request
- * @param {grpc~serialize} serialize The serialization function for inputs
- * @param {grpc~deserialize} deserialize The deserialization
- *     function for outputs
- * @param {grpc.Metadata=} metadata Array of metadata key/value
- *     pairs to add to the call
- * @param {grpc.Client~CallOptions=} options Options map
- * @return {grpc~ClientDuplexStream} An event emitter for stream related events
- */
-Client.prototype.makeBidiStreamRequest = function(method, serialize,
-                                                  deserialize, metadata,
-                                                  options) {
-  /* While the arguments are listed in the function signature, those variables
-   * are not used directly. Instead, ArgueJS processes the arguments
-   * object. */
-  var args = arguejs({method:String, serialize: Function,
-                      deserialize: Function,
-                      metadata: [Metadata, new Metadata()],
-                      options: [Object]}, arguments);
-  var call = getCall(this.$channel, method, args.options);
-  metadata = args.metadata.clone();
-  var stream = new ClientDuplexStream(call, serialize, deserialize);
-  var start_batch = {};
-  start_batch[grpc.opType.SEND_INITIAL_METADATA] =
-      metadata._getCoreRepresentation();
-  start_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
-  call.startBatch(start_batch, function(err, response) {
-    if (err) {
-      // The call has stopped for some reason. A non-OK status will arrive
-      // in the other batch.
-      return;
-    }
-    stream.emit('metadata', Metadata._fromCoreRepresentation(
-        response.metadata));
-  });
-  var status_batch = {};
-  status_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-  call.startBatch(status_batch, function(err, response) {
-    if (err) {
-      stream.emit('error', err);
-      return;
-    }
-    response.status.metadata = Metadata._fromCoreRepresentation(
-        response.status.metadata);
-    stream._receiveStatus(response.status);
-  });
-  return stream;
-};
-
-/**
- * Close this client.
- */
-Client.prototype.close = function() {
-  this.$channel.close();
-};
-
-/**
- * Return the underlying channel object for the specified client
- * @return {Channel} The channel
- */
-Client.prototype.getChannel = function() {
-  return this.$channel;
-};
-
-/**
- * Wait for the client to be ready. The callback will be called when the
- * client has successfully connected to the server, and it will be called
- * with an error if the attempt to connect to the server has unrecoverablly
- * failed or if the deadline expires. This function will make the channel
- * start connecting if it has not already done so.
- * @param {grpc~Deadline} deadline When to stop waiting for a connection.
- * @param {function(Error)} callback The callback to call when done attempting
- *     to connect.
- */
-Client.prototype.waitForReady = function(deadline, callback) {
-  var self = this;
-  var checkState = function(err) {
-    if (err) {
-      callback(new Error('Failed to connect before the deadline'));
-      return;
-    }
-    var new_state = self.$channel.getConnectivityState(true);
-    if (new_state === grpc.connectivityState.READY) {
-      callback();
-    } else if (new_state === grpc.connectivityState.FATAL_FAILURE) {
-      callback(new Error('Failed to connect to server'));
-    } else {
-      self.$channel.watchConnectivityState(new_state, deadline, checkState);
-    }
-  };
-  checkState();
-};
-
-/**
- * Map with short names for each of the requester maker functions. Used in
- * makeClientConstructor
- * @private
- */
-var requester_funcs = {
-  unary: Client.prototype.makeUnaryRequest,
-  server_stream: Client.prototype.makeServerStreamRequest,
-  client_stream: Client.prototype.makeClientStreamRequest,
-  bidi: Client.prototype.makeBidiStreamRequest
-};
-
-function getDefaultValues(metadata, options) {
-  var res = {};
-  res.metadata = metadata || new Metadata();
-  res.options = options || {};
-  return res;
-}
-
-/**
- * Map with wrappers for each type of requester function to make it use the old
- * argument order with optional arguments after the callback.
- * @access private
- */
-var deprecated_request_wrap = {
-  unary: function(makeUnaryRequest) {
-    return function makeWrappedUnaryRequest(argument, callback,
-                                            metadata, options) {
-      /* jshint validthis: true */
-      var opt_args = getDefaultValues(metadata, metadata);
-      return makeUnaryRequest.call(this, argument, opt_args.metadata,
-                                   opt_args.options, callback);
-    };
-  },
-  client_stream: function(makeServerStreamRequest) {
-    return function makeWrappedClientStreamRequest(callback, metadata,
-                                                   options) {
-      /* jshint validthis: true */
-      var opt_args = getDefaultValues(metadata, options);
-      return makeServerStreamRequest.call(this, opt_args.metadata,
-                                          opt_args.options, callback);
-    };
-  },
-  server_stream: _.identity,
-  bidi: _.identity
-};
-
-/**
- * Creates a constructor for a client with the given methods, as specified in
- * the methods argument. The resulting class will have an instance method for
- * each method in the service, which is a partial application of one of the
- * [Client]{@link grpc.Client} request methods, depending on `requestSerialize`
- * and `responseSerialize`, with the `method`, `serialize`, and `deserialize`
- * arguments predefined.
- * @memberof grpc
- * @alias grpc~makeGenericClientConstructor
- * @param {grpc~ServiceDefinition} methods An object mapping method names to
- *     method attributes
- * @param {string} serviceName The fully qualified name of the service
- * @param {Object} class_options An options object.
- * @param {boolean=} [class_options.deprecatedArgumentOrder=false] Indicates
- *     that the old argument order should be used for methods, with optional
- *     arguments at the end instead of the callback at the end. This option
- *     is only a temporary stopgap measure to smooth an API breakage.
- *     It is deprecated, and new code should not use it.
- * @return {function} New client constructor, which is a subclass of
- *     {@link grpc.Client}, and has the same arguments as that constructor.
- */
-exports.makeClientConstructor = function(methods, serviceName,
-                                         class_options) {
-  if (!class_options) {
-    class_options = {};
-  }
-
-  function ServiceClient(address, credentials, options) {
-    Client.call(this, address, credentials, options);
-  }
-
-  util.inherits(ServiceClient, Client);
-
-  _.each(methods, function(attrs, name) {
-    var method_type;
-    if (_.startsWith(name, '$')) {
-      throw new Error('Method names cannot start with $');
-    }
-    if (attrs.requestStream) {
-      if (attrs.responseStream) {
-        method_type = 'bidi';
-      } else {
-        method_type = 'client_stream';
-      }
-    } else {
-      if (attrs.responseStream) {
-        method_type = 'server_stream';
-      } else {
-        method_type = 'unary';
-      }
-    }
-    var serialize = attrs.requestSerialize;
-    var deserialize = attrs.responseDeserialize;
-    var method_func = _.partial(requester_funcs[method_type], attrs.path,
-                                serialize, deserialize);
-    if (class_options.deprecatedArgumentOrder) {
-      ServiceClient.prototype[name] = deprecated_request_wrap(method_func);
-    } else {
-      ServiceClient.prototype[name] = method_func;
-    }
-    // Associate all provided attributes with the method
-    _.assign(ServiceClient.prototype[name], attrs);
-  });
-
-  ServiceClient.service = methods;
-
-  return ServiceClient;
-};
-
-/**
- * Return the underlying channel object for the specified client
- * @memberof grpc
- * @alias grpc~getClientChannel
- * @param {Client} client
- * @return {Channel} The channel
- * @see grpc.Client#getChannel
- */
-exports.getClientChannel = function(client) {
-  return Client.prototype.getChannel.call(client);
-};
-
-/**
- * Wait for the client to be ready. The callback will be called when the
- * client has successfully connected to the server, and it will be called
- * with an error if the attempt to connect to the server has unrecoverablly
- * failed or if the deadline expires. This function will make the channel
- * start connecting if it has not already done so.
- * @memberof grpc
- * @alias grpc~waitForClientReady
- * @param {Client} client The client to wait on
- * @param {grpc~Deadline} deadline When to stop waiting for a connection. Pass
- *     Infinity to wait forever.
- * @param {function(Error)} callback The callback to call when done attempting
- *     to connect.
- * @see grpc.Client#waitForReady
- */
-exports.waitForClientReady = function(client, deadline, callback) {
-  Client.prototype.waitForReady.call(client, deadline, callback);
-};
diff --git a/src/node/src/common.js b/src/node/src/common.js
deleted file mode 100644
index 5a444f5..0000000
--- a/src/node/src/common.js
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
- * @license
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var _ = require('lodash');
-
-/**
- * Wrap a function to pass null-like values through without calling it. If no
- * function is given, just uses the identity.
- * @private
- * @param {?function} func The function to wrap
- * @return {function} The wrapped function
- */
-exports.wrapIgnoreNull = function wrapIgnoreNull(func) {
-  if (!func) {
-    return _.identity;
-  }
-  return function(arg) {
-    if (arg === null || arg === undefined) {
-      return null;
-    }
-    return func(arg);
-  };
-};
-
-/**
- * The logger object for the gRPC module. Defaults to console.
- * @private
- */
-exports.logger = console;
-
-/**
- * The current logging verbosity. 0 corresponds to logging everything
- * @private
- */
-exports.logVerbosity = 0;
-
-/**
- * Log a message if the severity is at least as high as the current verbosity
- * @private
- * @param {Number} severity A value of the grpc.logVerbosity map
- * @param {String} message The message to log
- */
-exports.log = function log(severity, message) {
-  if (severity >= exports.logVerbosity) {
-    exports.logger.error(message);
-  }
-};
-
-/**
- * Default options for loading proto files into gRPC
- * @alias grpc~defaultLoadOptions
- */
-exports.defaultGrpcOptions = {
-  convertFieldsToCamelCase: false,
-  binaryAsBase64: false,
-  longsAsStrings: true,
-  enumsAsStrings: true,
-  deprecatedArgumentOrder: false
-};
-
-// JSDoc definitions that are used in multiple other modules
-
-/**
- * Represents the status of a completed request. If `code` is
- * {@link grpc.status}.OK, then the request has completed successfully.
- * Otherwise, the request has failed, `details` will contain a description of
- * the error. Either way, `metadata` contains the trailing response metadata
- * sent by the server when it finishes processing the call.
- * @typedef {object} grpc~StatusObject
- * @property {number} code The error code, a key of {@link grpc.status}
- * @property {string} details Human-readable description of the status
- * @property {grpc.Metadata} metadata Trailing metadata sent with the status,
- *     if applicable
- */
-
-/**
- * Describes how a request has failed. The member `message` will be the same as
- * `details` in {@link grpc~StatusObject}, and `code` and `metadata` are the
- * same as in that object.
- * @typedef {Error} grpc~ServiceError
- * @property {number} code The error code, a key of {@link grpc.status} that is
- *     not `grpc.status.OK`
- * @property {grpc.Metadata} metadata Trailing metadata sent with the status,
- *     if applicable
- */
-
-/**
- * The EventEmitter class in the event standard module
- * @external EventEmitter
- * @see https://nodejs.org/api/events.html#events_class_eventemitter
- */
-
-/**
- * The Readable class in the stream standard module
- * @external Readable
- * @see https://nodejs.org/api/stream.html#stream_readable_streams
- */
-
-/**
- * The Writable class in the stream standard module
- * @external Writable
- * @see https://nodejs.org/api/stream.html#stream_writable_streams
- */
-
-/**
- * The Duplex class in the stream standard module
- * @external Duplex
- * @see https://nodejs.org/api/stream.html#stream_class_stream_duplex
- */
-
-/**
- * A serialization function
- * @callback grpc~serialize
- * @param {*} value The value to serialize
- * @return {Buffer} The value serialized as a byte sequence
- */
-
-/**
- * A deserialization function
- * @callback grpc~deserialize
- * @param {Buffer} data The byte sequence to deserialize
- * @return {*} The data deserialized as a value
- */
-
-/**
- * The deadline of an operation. If it is a date, the deadline is reached at
- * the date and time specified. If it is a finite number, it is treated as
- * a number of milliseconds since the Unix Epoch. If it is Infinity, the
- * deadline will never be reached. If it is -Infinity, the deadline has already
- * passed.
- * @typedef {(number|date)} grpc~Deadline
- */
-
-/**
- * An object that completely defines a service method signature.
- * @typedef {Object} grpc~MethodDefinition
- * @property {string} path The method's URL path
- * @property {boolean} requestStream Indicates whether the method accepts
- *     a stream of requests
- * @property {boolean} responseStream Indicates whether the method returns
- *     a stream of responses
- * @property {grpc~serialize} requestSerialize Serialization
- *     function for request values
- * @property {grpc~serialize} responseSerialize Serialization
- *     function for response values
- * @property {grpc~deserialize} requestDeserialize Deserialization
- *     function for request data
- * @property {grpc~deserialize} responseDeserialize Deserialization
- *     function for repsonse data
- */
-
-/**
- * An object that completely defines a service.
- * @typedef {Object.<string, grpc~MethodDefinition>} grpc~ServiceDefinition
- */
diff --git a/src/node/src/constants.js b/src/node/src/constants.js
deleted file mode 100644
index c90e44d..0000000
--- a/src/node/src/constants.js
+++ /dev/null
@@ -1,236 +0,0 @@
-/**
- * @license
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* The comments about status codes are copied verbatim (with some formatting
- * modifications) from include/grpc/impl/codegen/status.h, for the purpose of
- * including them in generated documentation.
- */
-/**
- * Enum of status codes that gRPC can return
- * @memberof grpc
- * @alias grpc.status
- * @readonly
- * @enum {number}
- */
-exports.status = {
-  /** Not an error; returned on success */
-  OK: 0,
-  /** The operation was cancelled (typically by the caller). */
-  CANCELLED: 1,
-  /**
-   * Unknown error.  An example of where this error may be returned is
-   * if a status value received from another address space belongs to
-   * an error-space that is not known in this address space.  Also
-   * errors raised by APIs that do not return enough error information
-   * may be converted to this error.
-   */
-  UNKNOWN: 2,
-  /**
-   * Client specified an invalid argument.  Note that this differs
-   * from FAILED_PRECONDITION.  INVALID_ARGUMENT indicates arguments
-   * that are problematic regardless of the state of the system
-   * (e.g., a malformed file name).
-   */
-  INVALID_ARGUMENT: 3,
-  /**
-   * Deadline expired before operation could complete.  For operations
-   * that change the state of the system, this error may be returned
-   * even if the operation has completed successfully.  For example, a
-   * successful response from a server could have been delayed long
-   * enough for the deadline to expire.
-   */
-  DEADLINE_EXCEEDED: 4,
-  /** Some requested entity (e.g., file or directory) was not found. */
-  NOT_FOUND: 5,
-  /**
-   * Some entity that we attempted to create (e.g., file or directory)
-   * already exists.
-   */
-  ALREADY_EXISTS: 6,
-  /**
-   * The caller does not have permission to execute the specified
-   * operation.  PERMISSION_DENIED must not be used for rejections
-   * caused by exhausting some resource (use RESOURCE_EXHAUSTED
-   * instead for those errors).  PERMISSION_DENIED must not be
-   * used if the caller can not be identified (use UNAUTHENTICATED
-   * instead for those errors).
-   */
-  PERMISSION_DENIED: 7,
-  /**
-   * Some resource has been exhausted, perhaps a per-user quota, or
-   * perhaps the entire file system is out of space.
-   */
-  RESOURCE_EXHAUSTED: 8,
-  /**
-   * Operation was rejected because the system is not in a state
-   * required for the operation's execution.  For example, directory
-   * to be deleted may be non-empty, an rmdir operation is applied to
-   * a non-directory, etc.
-   *
-   * A litmus test that may help a service implementor in deciding
-   * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
-   *
-   *  - Use UNAVAILABLE if the client can retry just the failing call.
-   *  - Use ABORTED if the client should retry at a higher-level
-   *    (e.g., restarting a read-modify-write sequence).
-   *  - Use FAILED_PRECONDITION if the client should not retry until
-   *    the system state has been explicitly fixed.  E.g., if an "rmdir"
-   *    fails because the directory is non-empty, FAILED_PRECONDITION
-   *    should be returned since the client should not retry unless
-   *    they have first fixed up the directory by deleting files from it.
-   *  - Use FAILED_PRECONDITION if the client performs conditional
-   *    REST Get/Update/Delete on a resource and the resource on the
-   *    server does not match the condition. E.g., conflicting
-   *    read-modify-write on the same resource.
-   */
-  FAILED_PRECONDITION: 9,
-  /**
-   * The operation was aborted, typically due to a concurrency issue
-   * like sequencer check failures, transaction aborts, etc.
-   *
-   * See litmus test above for deciding between FAILED_PRECONDITION,
-   * ABORTED, and UNAVAILABLE.
-   */
-  ABORTED: 10,
-  /**
-   * Operation was attempted past the valid range.  E.g., seeking or
-   * reading past end of file.
-   *
-   * Unlike INVALID_ARGUMENT, this error indicates a problem that may
-   * be fixed if the system state changes. For example, a 32-bit file
-   * system will generate INVALID_ARGUMENT if asked to read at an
-   * offset that is not in the range [0,2^32-1], but it will generate
-   * OUT_OF_RANGE if asked to read from an offset past the current
-   * file size.
-   *
-   * There is a fair bit of overlap between FAILED_PRECONDITION and
-   * OUT_OF_RANGE.  We recommend using OUT_OF_RANGE (the more specific
-   * error) when it applies so that callers who are iterating through
-   * a space can easily look for an OUT_OF_RANGE error to detect when
-   * they are done.
-   */
-  OUT_OF_RANGE: 11,
-  /** Operation is not implemented or not supported/enabled in this service. */
-  UNIMPLEMENTED: 12,
-  /**
-   * Internal errors.  Means some invariants expected by underlying
-   * system has been broken.  If you see one of these errors,
-   * something is very broken.
-   */
-  INTERNAL: 13,
-  /**
-   * The service is currently unavailable.  This is a most likely a
-   * transient condition and may be corrected by retrying with
-   * a backoff.
-   *
-   * See litmus test above for deciding between FAILED_PRECONDITION,
-   * ABORTED, and UNAVAILABLE. */
-  UNAVAILABLE: 14,
-  /** Unrecoverable data loss or corruption. */
-  DATA_LOSS: 15,
-  /**
-   * The request does not have valid authentication credentials for the
-   * operation.
-   */
-  UNAUTHENTICATED: 16
-};
-
-/* The comments about propagation bit flags are copied rom
- * include/grpc/impl/codegen/propagation_bits.h for the purpose of including
- * them in generated documentation.
- */
-/**
- * Propagation flags: these can be bitwise or-ed to form the propagation option
- * for calls.
- *
- * Users are encouraged to write propagation masks as deltas from the default.
- * i.e. write `grpc.propagate.DEFAULTS & ~grpc.propagate.DEADLINE` to disable
- * deadline propagation.
- * @memberof grpc
- * @alias grpc.propagate
- * @enum {number}
- */
-exports.propagate = {
-  DEADLINE: 1,
-  CENSUS_STATS_CONTEXT: 2,
-  CENSUS_TRACING_CONTEXT: 4,
-  CANCELLATION: 8,
-  DEFAULTS: 65535
-};
-
-/* Many of the following comments are copied from
- * include/grpc/impl/codegen/grpc_types.h
- */
-/**
- * Call error constants. Call errors almost always indicate bugs in the gRPC
- * library, and these error codes are mainly useful for finding those bugs.
- * @memberof grpc
- * @readonly
- * @enum {number}
- */
-const callError = {
-  OK: 0,
-  ERROR: 1,
-  NOT_ON_SERVER: 2,
-  NOT_ON_CLIENT: 3,
-  ALREADY_INVOKED: 5,
-  NOT_INVOKED: 6,
-  ALREADY_FINISHED: 7,
-  TOO_MANY_OPERATIONS: 8,
-  INVALID_FLAGS: 9,
-  INVALID_METADATA: 10,
-  INVALID_MESSAGE: 11,
-  NOT_SERVER_COMPLETION_QUEUE: 12,
-  BATCH_TOO_BIG: 13,
-  PAYLOAD_TYPE_MISMATCH: 14
-};
-
-exports.callError = callError;
-
-/**
- * Write flags: these can be bitwise or-ed to form write options that modify
- * how data is written.
- * @memberof grpc
- * @alias grpc.writeFlags
- * @readonly
- * @enum {number}
- */
-exports.writeFlags = {
-  /**
-   * Hint that the write may be buffered and need not go out on the wire
-   * immediately. GRPC is free to buffer the message until the next non-buffered
-   * write, or until writes_done, but it need not buffer completely or at all.
-   */
-  BUFFER_HINT: 1,
-  /**
-   * Force compression to be disabled for a particular write
-   */
-  NO_COMPRESS: 2
-};
-
-/**
- * @memberof grpc
- * @alias grpc.logVerbosity
- * @readonly
- * @enum {number}
- */
-exports.logVerbosity = {
-  DEBUG: 0,
-  INFO: 1,
-  ERROR: 2
-};
diff --git a/src/node/src/credentials.js b/src/node/src/credentials.js
deleted file mode 100644
index d68d888..0000000
--- a/src/node/src/credentials.js
+++ /dev/null
@@ -1,207 +0,0 @@
-/**
- * @license
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * Credentials module
- *
- * This module contains factory methods for two different credential types:
- * CallCredentials and ChannelCredentials. ChannelCredentials are things like
- * SSL credentials that can be used to secure a connection, and are used to
- * construct a Client object. CallCredentials genrally modify metadata, so they
- * can be attached to an individual method call.
- *
- * CallCredentials can be composed with other CallCredentials to create
- * CallCredentials. ChannelCredentials can be composed with CallCredentials
- * to create ChannelCredentials. No combined credential can have more than
- * one ChannelCredentials.
- *
- * For example, to create a client secured with SSL that uses Google
- * default application credentials to authenticate:
- *
- * @example
- * var channel_creds = credentials.createSsl(root_certs);
- * (new GoogleAuth()).getApplicationDefault(function(err, credential) {
- *   var call_creds = credentials.createFromGoogleCredential(credential);
- *   var combined_creds = credentials.combineChannelCredentials(
- *       channel_creds, call_creds);
- *   var client = new Client(address, combined_creds);
- * });
- *
- * @namespace grpc.credentials
- */
-
-'use strict';
-
-var grpc = require('./grpc_extension');
-
-/**
- * This cannot be constructed directly. Instead, instances of this class should
- * be created using the factory functions in {@link grpc.credentials}
- * @constructor grpc.credentials~CallCredentials
- */
-var CallCredentials = grpc.CallCredentials;
-
-/**
- * This cannot be constructed directly. Instead, instances of this class should
- * be created using the factory functions in {@link grpc.credentials}
- * @constructor grpc.credentials~ChannelCredentials
- */
-var ChannelCredentials = grpc.ChannelCredentials;
-
-var Metadata = require('./metadata.js');
-
-var common = require('./common.js');
-
-var constants = require('./constants');
-
-var _ = require('lodash');
-
-/**
- * @external GoogleCredential
- * @see https://github.com/google/google-auth-library-nodejs
- */
-
-/**
- * Create an SSL Credentials object. If using a client-side certificate, both
- * the second and third arguments must be passed.
- * @memberof grpc.credentials
- * @alias grpc.credentials.createSsl
- * @kind function
- * @param {Buffer=} root_certs The root certificate data
- * @param {Buffer=} private_key The client certificate private key, if
- *     applicable
- * @param {Buffer=} cert_chain The client certificate cert chain, if applicable
- * @return {grpc.credentials.ChannelCredentials} The SSL Credentials object
- */
-exports.createSsl = ChannelCredentials.createSsl;
-
-/**
- * @callback grpc.credentials~metadataCallback
- * @param {Error} error The error, if getting metadata failed
- * @param {grpc.Metadata} metadata The metadata
- */
-
-/**
- * @callback grpc.credentials~generateMetadata
- * @param {Object} params Parameters that can modify metadata generation
- * @param {string} params.service_url The URL of the service that the call is
- *     going to
- * @param {grpc.credentials~metadataCallback} callback
- */
-
-/**
- * Create a gRPC credentials object from a metadata generation function. This
- * function gets the service URL and a callback as parameters. The error
- * passed to the callback can optionally have a 'code' value attached to it,
- * which corresponds to a status code that this library uses.
- * @memberof grpc.credentials
- * @alias grpc.credentials.createFromMetadataGenerator
- * @param {grpc.credentials~generateMetadata} metadata_generator The function
- *     that generates metadata
- * @return {grpc.credentials.CallCredentials} The credentials object
- */
-exports.createFromMetadataGenerator = function(metadata_generator) {
-  return CallCredentials.createFromPlugin(function(service_url, cb_data,
-                                                   callback) {
-    metadata_generator({service_url: service_url}, function(error, metadata) {
-      var code = constants.status.OK;
-      var message = '';
-      if (error) {
-        message = error.message;
-        if (error.hasOwnProperty('code') && _.isFinite(error.code)) {
-          code = error.code;
-        } else {
-          code = constants.status.UNAUTHENTICATED;
-        }
-        if (!metadata) {
-          metadata = new Metadata();
-        }
-      }
-      callback(code, message, metadata._getCoreRepresentation(), cb_data);
-    });
-  });
-};
-
-/**
- * Create a gRPC credential from a Google credential object.
- * @memberof grpc.credentials
- * @alias grpc.credentials.createFromGoogleCredential
- * @param {external:GoogleCredential} google_credential The Google credential
- *     object to use
- * @return {grpc.credentials.CallCredentials} The resulting credentials object
- */
-exports.createFromGoogleCredential = function(google_credential) {
-  return exports.createFromMetadataGenerator(function(auth_context, callback) {
-    var service_url = auth_context.service_url;
-    google_credential.getRequestMetadata(service_url, function(err, header) {
-      if (err) {
-        common.log(constants.logVerbosity.INFO, 'Auth error:' + err);
-        callback(err);
-        return;
-      }
-      var metadata = new Metadata();
-      metadata.add('authorization', header.Authorization);
-      callback(null, metadata);
-    });
-  });
-};
-
-/**
- * Combine a ChannelCredentials with any number of CallCredentials into a single
- * ChannelCredentials object.
- * @memberof grpc.credentials
- * @alias grpc.credentials.combineChannelCredentials
- * @param {ChannelCredentials} channel_credential The ChannelCredentials to
- *     start with
- * @param {...CallCredentials} credentials The CallCredentials to compose
- * @return ChannelCredentials A credentials object that combines all of the
- *     input credentials
- */
-exports.combineChannelCredentials = function(channel_credential) {
-  var current = channel_credential;
-  for (var i = 1; i < arguments.length; i++) {
-    current = current.compose(arguments[i]);
-  }
-  return current;
-};
-
-/**
- * Combine any number of CallCredentials into a single CallCredentials object
- * @memberof grpc.credentials
- * @alias grpc.credentials.combineCallCredentials
- * @param {...CallCredentials} credentials the CallCredentials to compose
- * @return CallCredentials A credentials object that combines all of the input
- *     credentials
- */
-exports.combineCallCredentials = function() {
-  var current = arguments[0];
-  for (var i = 1; i < arguments.length; i++) {
-    current = current.compose(arguments[i]);
-  }
-  return current;
-};
-
-/**
- * Create an insecure credentials object. This is used to create a channel that
- * does not use SSL. This cannot be composed with anything.
- * @memberof grpc.credentials
- * @alias grpc.credentials.createInsecure
- * @kind function
- * @return {ChannelCredentials} The insecure credentials object
- */
-exports.createInsecure = ChannelCredentials.createInsecure;
diff --git a/src/node/src/grpc_extension.js b/src/node/src/grpc_extension.js
deleted file mode 100644
index af43eac..0000000
--- a/src/node/src/grpc_extension.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * @license
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * @module
- * @private
- */
-
-'use strict';
-
-var binary = require('node-pre-gyp/lib/pre-binding');
-var path = require('path');
-var binding_path =
-    binary.find(path.resolve(path.join(__dirname, '../../../package.json')));
-var binding = require(binding_path);
-
-module.exports = binding;
diff --git a/src/node/src/metadata.js b/src/node/src/metadata.js
deleted file mode 100644
index 46f9e0f..0000000
--- a/src/node/src/metadata.js
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
- * @license
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var _ = require('lodash');
-
-var grpc = require('./grpc_extension');
-
-/**
- * Class for storing metadata. Keys are normalized to lowercase ASCII.
- * @memberof grpc
- * @constructor
- * @example
- * var metadata = new metadata_module.Metadata();
- * metadata.set('key1', 'value1');
- * metadata.add('key1', 'value2');
- * metadata.get('key1') // returns ['value1', 'value2']
- */
-function Metadata() {
-  this._internal_repr = {};
-}
-
-function normalizeKey(key) {
-  key = key.toLowerCase();
-  if (grpc.metadataKeyIsLegal(key)) {
-    return key;
-  } else {
-    throw new Error('Metadata key"' + key + '" contains illegal characters');
-  }
-}
-
-function validate(key, value) {
-  if (grpc.metadataKeyIsBinary(key)) {
-    if (!(value instanceof Buffer)) {
-      throw new Error('keys that end with \'-bin\' must have Buffer values');
-    }
-  } else {
-    if (!_.isString(value)) {
-      throw new Error(
-          'keys that don\'t end with \'-bin\' must have String values');
-    }
-    if (!grpc.metadataNonbinValueIsLegal(value)) {
-      throw new Error('Metadata string value "' + value +
-                      '" contains illegal characters');
-    }
-  }
-}
-
-/**
- * Sets the given value for the given key, replacing any other values associated
- * with that key. Normalizes the key.
- * @param {String} key The key to set
- * @param {String|Buffer} value The value to set. Must be a buffer if and only
- *     if the normalized key ends with '-bin'
- */
-Metadata.prototype.set = function(key, value) {
-  key = normalizeKey(key);
-  validate(key, value);
-  this._internal_repr[key] = [value];
-};
-
-/**
- * Adds the given value for the given key. Normalizes the key.
- * @param {String} key The key to add to.
- * @param {String|Buffer} value The value to add. Must be a buffer if and only
- *     if the normalized key ends with '-bin'
- */
-Metadata.prototype.add = function(key, value) {
-  key = normalizeKey(key);
-  validate(key, value);
-  if (!this._internal_repr[key]) {
-    this._internal_repr[key] = [];
-  }
-  this._internal_repr[key].push(value);
-};
-
-/**
- * Remove the given key and any associated values. Normalizes the key.
- * @param {String} key The key to remove
- */
-Metadata.prototype.remove = function(key) {
-  key = normalizeKey(key);
-  if (Object.prototype.hasOwnProperty.call(this._internal_repr, key)) {
-    delete this._internal_repr[key];
-  }
-};
-
-/**
- * Gets a list of all values associated with the key. Normalizes the key.
- * @param {String} key The key to get
- * @return {Array.<String|Buffer>} The values associated with that key
- */
-Metadata.prototype.get = function(key) {
-  key = normalizeKey(key);
-  if (Object.prototype.hasOwnProperty.call(this._internal_repr, key)) {
-    return this._internal_repr[key];
-  } else {
-    return [];
-  }
-};
-
-/**
- * Get a map of each key to a single associated value. This reflects the most
- * common way that people will want to see metadata.
- * @return {Object.<String,String|Buffer>} A key/value mapping of the metadata
- */
-Metadata.prototype.getMap = function() {
-  var result = {};
-  _.forOwn(this._internal_repr, function(values, key) {
-    if(values.length > 0) {
-      result[key] = values[0];
-    }
-  });
-  return result;
-};
-
-/**
- * Clone the metadata object.
- * @return {Metadata} The new cloned object
- */
-Metadata.prototype.clone = function() {
-  var copy = new Metadata();
-  _.forOwn(this._internal_repr, function(value, key) {
-    copy._internal_repr[key] = _.clone(value);
-  });
-  return copy;
-};
-
-/**
- * Gets the metadata in the format used by interal code. Intended for internal
- * use only. API stability is not guaranteed.
- * @private
- * @return {Object.<String, Array.<String|Buffer>>} The metadata
- */
-Metadata.prototype._getCoreRepresentation = function() {
-  return this._internal_repr;
-};
-
-/**
- * Creates a Metadata object from a metadata map in the internal format.
- * Intended for internal use only. API stability is not guaranteed.
- * @private
- * @param {Object.<String, Array.<String|Buffer>>} The metadata
- * @return {Metadata} The new Metadata object
- */
-Metadata._fromCoreRepresentation = function(metadata) {
-  var newMetadata = new Metadata();
-  if (metadata) {
-    _.forOwn(metadata, function(value, key) {
-      newMetadata._internal_repr[key] = _.clone(value);
-    });
-  }
-  return newMetadata;
-};
-
-module.exports = Metadata;
diff --git a/src/node/src/protobuf_js_5_common.js b/src/node/src/protobuf_js_5_common.js
deleted file mode 100644
index 541965f..0000000
--- a/src/node/src/protobuf_js_5_common.js
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * @license
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * @module
- * @private
- */
-
-'use strict';
-
-var _ = require('lodash');
-var client = require('./client');
-
-/**
- * Get a function that deserializes a specific type of protobuf.
- * @param {function()} cls The constructor of the message type to deserialize
- * @param {bool=} binaryAsBase64 Deserialize bytes fields as base64 strings
- *     instead of Buffers. Defaults to false
- * @param {bool=} longsAsStrings Deserialize long values as strings instead of
- *     objects. Defaults to true
- * @return {function(Buffer):cls} The deserialization function
- */
-exports.deserializeCls = function deserializeCls(cls, options) {
-  /**
-   * Deserialize a buffer to a message object
-   * @param {Buffer} arg_buf The buffer to deserialize
-   * @return {cls} The resulting object
-   */
-  return function deserialize(arg_buf) {
-    // Convert to a native object with binary fields as Buffers (first argument)
-    // and longs as strings (second argument)
-    return cls.decode(arg_buf).toRaw(options.binaryAsBase64,
-                                     options.longsAsStrings);
-  };
-};
-
-var deserializeCls = exports.deserializeCls;
-
-/**
- * Get a function that serializes objects to a buffer by protobuf class.
- * @param {function()} Cls The constructor of the message type to serialize
- * @return {function(Cls):Buffer} The serialization function
- */
-exports.serializeCls = function serializeCls(Cls) {
-  /**
-   * Serialize an object to a Buffer
-   * @param {Object} arg The object to serialize
-   * @return {Buffer} The serialized object
-   */
-  return function serialize(arg) {
-    return new Buffer(new Cls(arg).encode().toBuffer());
-  };
-};
-
-var serializeCls = exports.serializeCls;
-
-/**
- * Get the fully qualified (dotted) name of a ProtoBuf.Reflect value.
- * @param {ProtoBuf.Reflect.Namespace} value The value to get the name of
- * @return {string} The fully qualified name of the value
- */
-exports.fullyQualifiedName = function fullyQualifiedName(value) {
-  if (value === null || value === undefined) {
-    return '';
-  }
-  var name = value.name;
-  var parent_name = fullyQualifiedName(value.parent);
-  if (parent_name !== '') {
-    name = parent_name + '.' + name;
-  }
-  return name;
-};
-
-var fullyQualifiedName = exports.fullyQualifiedName;
-
-/**
- * Return a map from method names to method attributes for the service.
- * @param {ProtoBuf.Reflect.Service} service The service to get attributes for
- * @param {Object=} options Options to apply to these attributes
- * @return {Object} The attributes map
- */
-exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service,
-                                                                   options) {
-  var prefix = '/' + fullyQualifiedName(service) + '/';
-  var binaryAsBase64, longsAsStrings;
-  if (options) {
-    binaryAsBase64 = options.binaryAsBase64;
-    longsAsStrings = options.longsAsStrings;
-  }
-  /* This slightly awkward construction is used to make sure we only use
-     lodash@3.10.1-compatible functions. A previous version used
-     _.fromPairs, which would be cleaner, but was introduced in lodash
-     version 4 */
-  return _.zipObject(_.map(service.children, function(method) {
-    return _.camelCase(method.name);
-  }), _.map(service.children, function(method) {
-    return {
-      originalName: method.name,
-      path: prefix + method.name,
-      requestStream: method.requestStream,
-      responseStream: method.responseStream,
-      requestType: method.resolvedRequestType,
-      responseType: method.resolvedResponseType,
-      requestSerialize: serializeCls(method.resolvedRequestType.build()),
-      requestDeserialize: deserializeCls(method.resolvedRequestType.build(),
-                                         options),
-      responseSerialize: serializeCls(method.resolvedResponseType.build()),
-      responseDeserialize: deserializeCls(method.resolvedResponseType.build(),
-                                          options)
-    };
-  }));
-};
-
-var getProtobufServiceAttrs = exports.getProtobufServiceAttrs;
-
-/**
- * Load a gRPC object from an existing ProtoBuf.Reflect object.
- * @param {ProtoBuf.Reflect.Namespace} value The ProtoBuf object to load.
- * @param {Object=} options Options to apply to the loaded object
- * @return {Object<string, *>} The resulting gRPC object
- */
-exports.loadObject = function loadObject(value, options) {
-  var result = {};
-  if (!value) {
-    return value;
-  }
-  if (value.hasOwnProperty('ns')) {
-    return loadObject(value.ns, options);
-  }
-  if (value.className === 'Namespace') {
-    _.each(value.children, function(child) {
-      result[child.name] = loadObject(child, options);
-    });
-    return result;
-  } else if (value.className === 'Service') {
-    return client.makeClientConstructor(getProtobufServiceAttrs(value, options),
-                                        options);
-  } else if (value.className === 'Message' || value.className === 'Enum') {
-    return value.build();
-  } else {
-    return value;
-  }
-};
-
-/**
- * The primary purpose of this method is to distinguish between reflection
- * objects from different versions of ProtoBuf.js. This is just a heuristic,
- * checking for properties that are (currently) specific to this version of
- * ProtoBuf.js
- * @param {Object} obj The object to check
- * @return {boolean} Whether the object appears to be a Protobuf.js 5
- *   ReflectionObject
- */
-exports.isProbablyProtobufJs5 = function isProbablyProtobufJs5(obj) {
-  return _.isArray(obj.children) && (typeof obj.build === 'function');
-};
diff --git a/src/node/src/protobuf_js_6_common.js b/src/node/src/protobuf_js_6_common.js
deleted file mode 100644
index 0f07251..0000000
--- a/src/node/src/protobuf_js_6_common.js
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * @license
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * @module
- * @private
- */
-
-'use strict';
-
-var _ = require('lodash');
-var client = require('./client');
-
-/**
- * Get a function that deserializes a specific type of protobuf.
- * @param {function()} cls The constructor of the message type to deserialize
- * @param {bool=} binaryAsBase64 Deserialize bytes fields as base64 strings
- *     instead of Buffers. Defaults to false
- * @param {bool=} longsAsStrings Deserialize long values as strings instead of
- *     objects. Defaults to true
- * @return {function(Buffer):cls} The deserialization function
- */
-exports.deserializeCls = function deserializeCls(cls, options) {
-  var conversion_options = {
-    defaults: true,
-    bytes: options.binaryAsBase64 ? String : Buffer,
-    longs: options.longsAsStrings ? String : null,
-    enums: options.enumsAsStrings ? String : null,
-    oneofs: true
-  };
-  /**
-   * Deserialize a buffer to a message object
-   * @param {Buffer} arg_buf The buffer to deserialize
-   * @return {cls} The resulting object
-   */
-  return function deserialize(arg_buf) {
-    return cls.toObject(cls.decode(arg_buf), conversion_options);
-  };
-};
-
-var deserializeCls = exports.deserializeCls;
-
-/**
- * Get a function that serializes objects to a buffer by protobuf class.
- * @param {function()} Cls The constructor of the message type to serialize
- * @return {function(Cls):Buffer} The serialization function
- */
-exports.serializeCls = function serializeCls(cls) {
-  /**
-   * Serialize an object to a Buffer
-   * @param {Object} arg The object to serialize
-   * @return {Buffer} The serialized object
-   */
-  return function serialize(arg) {
-    var message = cls.fromObject(arg);
-    return cls.encode(message).finish();
-  };
-};
-
-var serializeCls = exports.serializeCls;
-
-/**
- * Get the fully qualified (dotted) name of a ProtoBuf.Reflect value.
- * @param {ProtoBuf.ReflectionObject} value The value to get the name of
- * @return {string} The fully qualified name of the value
- */
-exports.fullyQualifiedName = function fullyQualifiedName(value) {
-  if (value === null || value === undefined) {
-    return '';
-  }
-  var name = value.name;
-  var parent_fqn = fullyQualifiedName(value.parent);
-  if (parent_fqn !== '') {
-    name = parent_fqn + '.' + name;
-  }
-  return name;
-};
-
-var fullyQualifiedName = exports.fullyQualifiedName;
-
-/**
- * Return a map from method names to method attributes for the service.
- * @param {ProtoBuf.Service} service The service to get attributes for
- * @param {Object=} options Options to apply to these attributes
- * @return {Object} The attributes map
- */
-exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service,
-                                                                   options) {
-  var prefix = '/' + fullyQualifiedName(service) + '/';
-  service.resolveAll();
-  return _.zipObject(_.map(service.methods, function(method) {
-    return _.camelCase(method.name);
-  }), _.map(service.methods, function(method) {
-    return {
-      originalName: method.name,
-      path: prefix + method.name,
-      requestStream: !!method.requestStream,
-      responseStream: !!method.responseStream,
-      requestType: method.resolvedRequestType,
-      responseType: method.resolvedResponseType,
-      requestSerialize: serializeCls(method.resolvedRequestType),
-      requestDeserialize: deserializeCls(method.resolvedRequestType, options),
-      responseSerialize: serializeCls(method.resolvedResponseType),
-      responseDeserialize: deserializeCls(method.resolvedResponseType, options)
-    };
-  }));
-};
-
-var getProtobufServiceAttrs = exports.getProtobufServiceAttrs;
-
-exports.loadObject = function loadObject(value, options) {
-  var result = {};
-  if (!value) {
-    return value;
-  }
-  if (value.hasOwnProperty('methods')) {
-    // It's a service object
-    var service_attrs = getProtobufServiceAttrs(value, options);
-    return client.makeClientConstructor(service_attrs);
-  }
-
-  if (value.hasOwnProperty('nested')) {
-    // It's a namespace or root object
-    _.each(value.nested, function(nested, name) {
-      result[name] = loadObject(nested, options);
-    });
-    return result;
-  }
-
-  // Otherwise, it's not something we need to change
-  return value;
-};
-
-/**
- * The primary purpose of this method is to distinguish between reflection
- * objects from different versions of ProtoBuf.js. This is just a heuristic,
- * checking for properties that are (currently) specific to this version of
- * ProtoBuf.js
- * @param {Object} obj The object to check
- * @return {boolean} Whether the object appears to be a Protobuf.js 6
- *   ReflectionObject
- */
-exports.isProbablyProtobufJs6 = function isProbablyProtobufJs6(obj) {
-  return (typeof obj.root === 'object') && (typeof obj.resolve === 'function');
-};
diff --git a/src/node/src/server.js b/src/node/src/server.js
deleted file mode 100644
index 8b7c0b6..0000000
--- a/src/node/src/server.js
+++ /dev/null
@@ -1,965 +0,0 @@
-/**
- * @license
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var _ = require('lodash');
-
-var grpc = require('./grpc_extension');
-
-var common = require('./common');
-
-var Metadata = require('./metadata');
-
-var constants = require('./constants');
-
-var stream = require('stream');
-
-var Readable = stream.Readable;
-var Writable = stream.Writable;
-var Duplex = stream.Duplex;
-var util = require('util');
-
-var EventEmitter = require('events').EventEmitter;
-
-/**
- * Handle an error on a call by sending it as a status
- * @private
- * @param {grpc.internal~Call} call The call to send the error on
- * @param {(Object|Error)} error The error object
- */
-function handleError(call, error) {
-  var statusMetadata = new Metadata();
-  var status = {
-    code: constants.status.UNKNOWN,
-    details: 'Unknown Error'
-  };
-  if (error.hasOwnProperty('message')) {
-    status.details = error.message;
-  }
-  if (error.hasOwnProperty('code')) {
-    status.code = error.code;
-    if (error.hasOwnProperty('details')) {
-      status.details = error.details;
-    }
-  }
-  if (error.hasOwnProperty('metadata')) {
-    statusMetadata = error.metadata;
-  }
-  status.metadata = statusMetadata._getCoreRepresentation();
-  var error_batch = {};
-  if (!call.metadataSent) {
-    error_batch[grpc.opType.SEND_INITIAL_METADATA] =
-        (new Metadata())._getCoreRepresentation();
-  }
-  error_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = status;
-  call.startBatch(error_batch, function(){});
-}
-
-/**
- * Send a response to a unary or client streaming call.
- * @private
- * @param {grpc.Call} call The call to respond on
- * @param {*} value The value to respond with
- * @param {grpc~serialize} serialize Serialization function for the
- *     response
- * @param {grpc.Metadata=} metadata Optional trailing metadata to send with
- *     status
- * @param {number=} [flags=0] Flags for modifying how the message is sent.
- */
-function sendUnaryResponse(call, value, serialize, metadata, flags) {
-  var end_batch = {};
-  var statusMetadata = new Metadata();
-  var status = {
-    code: constants.status.OK,
-    details: 'OK'
-  };
-  if (metadata) {
-    statusMetadata = metadata;
-  }
-  var message;
-  try {
-    message = serialize(value);
-  } catch (e) {
-    e.code = constants.status.INTERNAL;
-    handleError(call, e);
-    return;
-  }
-  status.metadata = statusMetadata._getCoreRepresentation();
-  if (!call.metadataSent) {
-    end_batch[grpc.opType.SEND_INITIAL_METADATA] =
-        (new Metadata())._getCoreRepresentation();
-    call.metadataSent = true;
-  }
-  message.grpcWriteFlags = flags;
-  end_batch[grpc.opType.SEND_MESSAGE] = message;
-  end_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = status;
-  call.startBatch(end_batch, function (){});
-}
-
-/**
- * Initialize a writable stream. This is used for both the writable and duplex
- * stream constructors.
- * @private
- * @param {Writable} stream The stream to set up
- * @param {function(*):Buffer=} Serialization function for responses
- */
-function setUpWritable(stream, serialize) {
-  stream.finished = false;
-  stream.status = {
-    code : constants.status.OK,
-    details : 'OK',
-    metadata : new Metadata()
-  };
-  stream.serialize = common.wrapIgnoreNull(serialize);
-  function sendStatus() {
-    var batch = {};
-    if (!stream.call.metadataSent) {
-      stream.call.metadataSent = true;
-      batch[grpc.opType.SEND_INITIAL_METADATA] =
-          (new Metadata())._getCoreRepresentation();
-    }
-
-    if (stream.status.metadata) {
-      stream.status.metadata = stream.status.metadata._getCoreRepresentation();
-    }
-    batch[grpc.opType.SEND_STATUS_FROM_SERVER] = stream.status;
-    stream.call.startBatch(batch, function(){});
-  }
-  stream.on('finish', sendStatus);
-  /**
-   * Set the pending status to a given error status. If the error does not have
-   * code or details properties, the code will be set to grpc.status.UNKNOWN
-   * and the details will be set to 'Unknown Error'.
-   * @param {Error} err The error object
-   */
-  function setStatus(err) {
-    var code = constants.status.UNKNOWN;
-    var details = 'Unknown Error';
-    var metadata = new Metadata();
-    if (err.hasOwnProperty('message')) {
-      details = err.message;
-    }
-    if (err.hasOwnProperty('code')) {
-      code = err.code;
-      if (err.hasOwnProperty('details')) {
-        details = err.details;
-      }
-    }
-    if (err.hasOwnProperty('metadata')) {
-      metadata = err.metadata;
-    }
-    stream.status = {code: code, details: details, metadata: metadata};
-  }
-  /**
-   * Terminate the call. This includes indicating that reads are done, draining
-   * all pending writes, and sending the given error as a status
-   * @param {Error} err The error object
-   * @this GrpcServerStream
-   */
-  function terminateCall(err) {
-    // Drain readable data
-    setStatus(err);
-    stream.end();
-  }
-  stream.on('error', terminateCall);
-  /**
-   * Override of Writable#end method that allows for sending metadata with a
-   * success status.
-   * @param {Metadata=} metadata Metadata to send with the status
-   */
-  stream.end = function(metadata) {
-    if (metadata) {
-      stream.status.metadata = metadata;
-    }
-    Writable.prototype.end.call(this);
-  };
-}
-
-/**
- * Initialize a readable stream. This is used for both the readable and duplex
- * stream constructors.
- * @private
- * @param {Readable} stream The stream to initialize
- * @param {grpc~deserialize} deserialize Deserialization function for
- *     incoming data.
- */
-function setUpReadable(stream, deserialize) {
-  stream.deserialize = common.wrapIgnoreNull(deserialize);
-  stream.finished = false;
-  stream.reading = false;
-
-  stream.terminate = function() {
-    stream.finished = true;
-    stream.on('data', function() {});
-  };
-
-  stream.on('cancelled', function() {
-    stream.terminate();
-  });
-}
-
-/**
- * Emitted when the call has been cancelled. After this has been emitted, the
- * call's `cancelled` property will be set to `true`.
- * @event grpc~ServerUnaryCall~cancelled
- */
-
-util.inherits(ServerUnaryCall, EventEmitter);
-
-/**
- * An EventEmitter. Used for unary calls.
- * @constructor grpc~ServerUnaryCall
- * @extends external:EventEmitter
- * @param {grpc.internal~Call} call The call object associated with the request
- * @param {grpc.Metadata} metadata The request metadata from the client
- */
-function ServerUnaryCall(call, metadata) {
-  EventEmitter.call(this);
-  this.call = call;
-  /**
-   * Indicates if the call has been cancelled
-   * @member {boolean} grpc~ServerUnaryCall#cancelled
-   */
-  this.cancelled = false;
-  /**
-   * The request metadata from the client
-   * @member {grpc.Metadata} grpc~ServerUnaryCall#metadata
-   */
-  this.metadata = metadata;
-  /**
-   * The request message from the client
-   * @member {*} grpc~ServerUnaryCall#request
-   */
-  this.request = undefined;
-}
-
-/**
- * Emitted when the call has been cancelled. After this has been emitted, the
- * call's `cancelled` property will be set to `true`.
- * @event grpc~ServerWritableStream~cancelled
- */
-
-util.inherits(ServerWritableStream, Writable);
-
-/**
- * A stream that the server can write to. Used for calls that are streaming from
- * the server side.
- * @constructor grpc~ServerWritableStream
- * @extends external:Writable
- * @borrows grpc~ServerUnaryCall#sendMetadata as
- *     grpc~ServerWritableStream#sendMetadata
- * @borrows grpc~ServerUnaryCall#getPeer as grpc~ServerWritableStream#getPeer
- * @param {grpc.internal~Call} call The call object to send data with
- * @param {grpc.Metadata} metadata The request metadata from the client
- * @param {grpc~serialize} serialize Serialization function for writes
- */
-function ServerWritableStream(call, metadata, serialize) {
-  Writable.call(this, {objectMode: true});
-  this.call = call;
-
-  this.finished = false;
-  setUpWritable(this, serialize);
-  /**
-   * Indicates if the call has been cancelled
-   * @member {boolean} grpc~ServerWritableStream#cancelled
-   */
-  this.cancelled = false;
-  /**
-   * The request metadata from the client
-   * @member {grpc.Metadata} grpc~ServerWritableStream#metadata
-   */
-  this.metadata = metadata;
-  /**
-   * The request message from the client
-   * @member {*} grpc~ServerWritableStream#request
-   */
-  this.request = undefined;
-}
-
-/**
- * Start writing a chunk of data. This is an implementation of a method required
- * for implementing stream.Writable.
- * @private
- * @param {Buffer} chunk The chunk of data to write
- * @param {string} encoding Used to pass write flags
- * @param {function(Error=)} callback Callback to indicate that the write is
- *     complete
- */
-function _write(chunk, encoding, callback) {
-  /* jshint validthis: true */
-  var batch = {};
-  var self = this;
-  var message;
-  try {
-    message = this.serialize(chunk);
-  } catch (e) {
-    e.code = constants.status.INTERNAL;
-    callback(e);
-    return;
-  }
-  if (!this.call.metadataSent) {
-    batch[grpc.opType.SEND_INITIAL_METADATA] =
-        (new Metadata())._getCoreRepresentation();
-    this.call.metadataSent = true;
-  }
-  if (_.isFinite(encoding)) {
-    /* Attach the encoding if it is a finite number. This is the closest we
-     * can get to checking that it is valid flags */
-    message.grpcWriteFlags = encoding;
-  }
-  batch[grpc.opType.SEND_MESSAGE] = message;
-  this.call.startBatch(batch, function(err, value) {
-    if (err) {
-      self.emit('error', err);
-      return;
-    }
-    callback();
-  });
-}
-
-ServerWritableStream.prototype._write = _write;
-
-/**
- * Emitted when the call has been cancelled. After this has been emitted, the
- * call's `cancelled` property will be set to `true`.
- * @event grpc~ServerReadableStream~cancelled
- */
-
-util.inherits(ServerReadableStream, Readable);
-
-/**
- * A stream that the server can read from. Used for calls that are streaming
- * from the client side.
- * @constructor grpc~ServerReadableStream
- * @extends external:Readable
- * @borrows grpc~ServerUnaryCall#sendMetadata as
- *     grpc~ServerReadableStream#sendMetadata
- * @borrows grpc~ServerUnaryCall#getPeer as grpc~ServerReadableStream#getPeer
- * @param {grpc.internal~Call} call The call object to read data with
- * @param {grpc.Metadata} metadata The request metadata from the client
- * @param {grpc~deserialize} deserialize Deserialization function for reads
- */
-function ServerReadableStream(call, metadata, deserialize) {
-  Readable.call(this, {objectMode: true});
-  this.call = call;
-  setUpReadable(this, deserialize);
-  /**
-   * Indicates if the call has been cancelled
-   * @member {boolean} grpc~ServerReadableStream#cancelled
-   */
-  this.cancelled = false;
-  /**
-   * The request metadata from the client
-   * @member {grpc.Metadata} grpc~ServerReadableStream#metadata
-   */
-  this.metadata = metadata;
-}
-
-/**
- * Start reading from the gRPC data source. This is an implementation of a
- * method required for implementing stream.Readable
- * @access private
- * @param {number} size Ignored
- */
-function _read(size) {
-  /* jshint validthis: true */
-  var self = this;
-  /**
-   * Callback to be called when a READ event is received. Pushes the data onto
-   * the read queue and starts reading again if applicable
-   * @param {grpc.Event} event READ event object
-   */
-  function readCallback(err, event) {
-    if (err) {
-      self.terminate();
-      return;
-    }
-    if (self.finished) {
-      self.push(null);
-      return;
-    }
-    var data = event.read;
-    var deserialized;
-    try {
-      deserialized = self.deserialize(data);
-    } catch (e) {
-      e.code = constants.status.INTERNAL;
-      self.emit('error', e);
-      return;
-    }
-    if (self.push(deserialized) && data !== null) {
-      var read_batch = {};
-      read_batch[grpc.opType.RECV_MESSAGE] = true;
-      self.call.startBatch(read_batch, readCallback);
-    } else {
-      self.reading = false;
-    }
-  }
-  if (self.finished) {
-    self.push(null);
-  } else {
-    if (!self.reading) {
-      self.reading = true;
-      var batch = {};
-      batch[grpc.opType.RECV_MESSAGE] = true;
-      self.call.startBatch(batch, readCallback);
-    }
-  }
-}
-
-ServerReadableStream.prototype._read = _read;
-
-/**
- * Emitted when the call has been cancelled. After this has been emitted, the
- * call's `cancelled` property will be set to `true`.
- * @event grpc~ServerDuplexStream~cancelled
- */
-
-util.inherits(ServerDuplexStream, Duplex);
-
-/**
- * A stream that the server can read from or write to. Used for calls with
- * duplex streaming.
- * @constructor grpc~ServerDuplexStream
- * @extends external:Duplex
- * @borrows grpc~ServerUnaryCall#sendMetadata as
- *     grpc~ServerDuplexStream#sendMetadata
- * @borrows grpc~ServerUnaryCall#getPeer as grpc~ServerDuplexStream#getPeer
- * @param {grpc.internal~Call} call Call object to proxy
- * @param {grpc.Metadata} metadata The request metadata from the client
- * @param {grpc~serialize} serialize Serialization function for requests
- * @param {grpc~deserialize} deserialize Deserialization function for
- *     responses
- */
-function ServerDuplexStream(call, metadata, serialize, deserialize) {
-  Duplex.call(this, {objectMode: true});
-  this.call = call;
-  setUpWritable(this, serialize);
-  setUpReadable(this, deserialize);
-  /**
-   * Indicates if the call has been cancelled
-   * @member {boolean} grpc~ServerReadableStream#cancelled
-   */
-  this.cancelled = false;
-  /**
-   * The request metadata from the client
-   * @member {grpc.Metadata} grpc~ServerReadableStream#metadata
-   */
-  this.metadata = metadata;
-}
-
-ServerDuplexStream.prototype._read = _read;
-ServerDuplexStream.prototype._write = _write;
-
-/**
- * Send the initial metadata for a writable stream.
- * @alias grpc~ServerUnaryCall#sendMetadata
- * @param {Metadata} responseMetadata Metadata to send
- */
-function sendMetadata(responseMetadata) {
-  /* jshint validthis: true */
-  var self = this;
-  if (!this.call.metadataSent) {
-    this.call.metadataSent = true;
-    var batch = {};
-    batch[grpc.opType.SEND_INITIAL_METADATA] =
-        responseMetadata._getCoreRepresentation();
-    this.call.startBatch(batch, function(err) {
-      if (err) {
-        self.emit('error', err);
-        return;
-      }
-    });
-  }
-}
-
-ServerUnaryCall.prototype.sendMetadata = sendMetadata;
-ServerWritableStream.prototype.sendMetadata = sendMetadata;
-ServerReadableStream.prototype.sendMetadata = sendMetadata;
-ServerDuplexStream.prototype.sendMetadata = sendMetadata;
-
-/**
- * Get the endpoint this call/stream is connected to.
- * @alias grpc~ServerUnaryCall#getPeer
- * @return {string} The URI of the endpoint
- */
-function getPeer() {
-  /* jshint validthis: true */
-  return this.call.getPeer();
-}
-
-ServerUnaryCall.prototype.getPeer = getPeer;
-ServerReadableStream.prototype.getPeer = getPeer;
-ServerWritableStream.prototype.getPeer = getPeer;
-ServerDuplexStream.prototype.getPeer = getPeer;
-
-/**
- * Wait for the client to close, then emit a cancelled event if the client
- * cancelled.
- * @private
- */
-function waitForCancel() {
-  /* jshint validthis: true */
-  var self = this;
-  var cancel_batch = {};
-  cancel_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
-  self.call.startBatch(cancel_batch, function(err, result) {
-    if (err) {
-      self.emit('error', err);
-    }
-    if (result.cancelled) {
-      self.cancelled = true;
-      self.emit('cancelled');
-    }
-  });
-}
-
-ServerUnaryCall.prototype.waitForCancel = waitForCancel;
-ServerReadableStream.prototype.waitForCancel = waitForCancel;
-ServerWritableStream.prototype.waitForCancel = waitForCancel;
-ServerDuplexStream.prototype.waitForCancel = waitForCancel;
-
-/**
- * Callback function passed to server handlers that handle methods with unary
- * responses.
- * @callback grpc.Server~sendUnaryData
- * @param {grpc~ServiceError} error An error, if the call failed
- * @param {*} value The response value. Must be a valid argument to the
- *     `responseSerialize` method of the method that is being handled
- * @param {grpc.Metadata=} trailer Trailing metadata to send, if applicable
- * @param {grpc.writeFlags=} flags Flags to modify writing the response
- */
-
-/**
- * User-provided method to handle unary requests on a server
- * @callback grpc.Server~handleUnaryCall
- * @param {grpc~ServerUnaryCall} call The call object
- * @param {grpc.Server~sendUnaryData} callback The callback to call to respond
- *     to the request
- */
-
-/**
- * Fully handle a unary call
- * @private
- * @param {grpc.internal~Call} call The call to handle
- * @param {Object} handler Request handler object for the method that was called
- * @param {grpc~Server.handleUnaryCall} handler.func The handler function
- * @param {grpc~deserialize} handler.deserialize The deserialization function
- *     for request data
- * @param {grpc~serialize} handler.serialize The serialization function for
- *     response data
- * @param {grpc.Metadata} metadata Metadata from the client
- */
-function handleUnary(call, handler, metadata) {
-  var emitter = new ServerUnaryCall(call, metadata);
-  emitter.on('error', function(error) {
-    handleError(call, error);
-  });
-  emitter.waitForCancel();
-  var batch = {};
-  batch[grpc.opType.RECV_MESSAGE] = true;
-  call.startBatch(batch, function(err, result) {
-    if (err) {
-      handleError(call, err);
-      return;
-    }
-    try {
-      emitter.request = handler.deserialize(result.read);
-    } catch (e) {
-      e.code = constants.status.INTERNAL;
-      handleError(call, e);
-      return;
-    }
-    if (emitter.cancelled) {
-      return;
-    }
-    handler.func(emitter, function sendUnaryData(err, value, trailer, flags) {
-      if (err) {
-        if (trailer) {
-          err.metadata = trailer;
-        }
-        handleError(call, err);
-      } else {
-        sendUnaryResponse(call, value, handler.serialize, trailer, flags);
-      }
-    });
-  });
-}
-
-/**
- * User provided method to handle server streaming methods on the server.
- * @callback grpc.Server~handleServerStreamingCall
- * @param {grpc~ServerWritableStream} call The call object
- */
-
-/**
- * Fully handle a server streaming call
- * @private
- * @param {grpc.internal~Call} call The call to handle
- * @param {Object} handler Request handler object for the method that was called
- * @param {grpc~Server.handleServerStreamingCall} handler.func The handler
- *     function
- * @param {grpc~deserialize} handler.deserialize The deserialization function
- *     for request data
- * @param {grpc~serialize} handler.serialize The serialization function for
- *     response data
- * @param {grpc.Metadata} metadata Metadata from the client
- */
-function handleServerStreaming(call, handler, metadata) {
-  var stream = new ServerWritableStream(call, metadata, handler.serialize);
-  stream.waitForCancel();
-  var batch = {};
-  batch[grpc.opType.RECV_MESSAGE] = true;
-  call.startBatch(batch, function(err, result) {
-    if (err) {
-      stream.emit('error', err);
-      return;
-    }
-    try {
-      stream.request = handler.deserialize(result.read);
-    } catch (e) {
-      e.code = constants.status.INTERNAL;
-      stream.emit('error', e);
-      return;
-    }
-    handler.func(stream);
-  });
-}
-
-/**
- * User provided method to handle client streaming methods on the server.
- * @callback grpc.Server~handleClientStreamingCall
- * @param {grpc~ServerReadableStream} call The call object
- * @param {grpc.Server~sendUnaryData} callback The callback to call to respond
- *     to the request
- */
-
-/**
- * Fully handle a client streaming call
- * @access private
- * @param {grpc.internal~Call} call The call to handle
- * @param {Object} handler Request handler object for the method that was called
- * @param {grpc~Server.handleClientStreamingCall} handler.func The handler
- *     function
- * @param {grpc~deserialize} handler.deserialize The deserialization function
- *     for request data
- * @param {grpc~serialize} handler.serialize The serialization function for
- *     response data
- * @param {grpc.Metadata} metadata Metadata from the client
- */
-function handleClientStreaming(call, handler, metadata) {
-  var stream = new ServerReadableStream(call, metadata, handler.deserialize);
-  stream.on('error', function(error) {
-    handleError(call, error);
-  });
-  stream.waitForCancel();
-  handler.func(stream, function(err, value, trailer, flags) {
-    stream.terminate();
-    if (err) {
-      if (trailer) {
-        err.metadata = trailer;
-      }
-      handleError(call, err);
-    } else {
-      sendUnaryResponse(call, value, handler.serialize, trailer, flags);
-    }
-  });
-}
-
-/**
- * User provided method to handle bidirectional streaming calls on the server.
- * @callback grpc.Server~handleBidiStreamingCall
- * @param {grpc~ServerDuplexStream} call The call object
- */
-
-/**
- * Fully handle a bidirectional streaming call
- * @private
- * @param {grpc.internal~Call} call The call to handle
- * @param {Object} handler Request handler object for the method that was called
- * @param {grpc~Server.handleBidiStreamingCall} handler.func The handler
- *     function
- * @param {grpc~deserialize} handler.deserialize The deserialization function
- *     for request data
- * @param {grpc~serialize} handler.serialize The serialization function for
- *     response data
- * @param {Metadata} metadata Metadata from the client
- */
-function handleBidiStreaming(call, handler, metadata) {
-  var stream = new ServerDuplexStream(call, metadata, handler.serialize,
-                                      handler.deserialize);
-  stream.waitForCancel();
-  handler.func(stream);
-}
-
-var streamHandlers = {
-  unary: handleUnary,
-  server_stream: handleServerStreaming,
-  client_stream: handleClientStreaming,
-  bidi: handleBidiStreaming
-};
-
-/**
- * Constructs a server object that stores request handlers and delegates
- * incoming requests to those handlers
- * @memberof grpc
- * @constructor
- * @param {Object=} options Options that should be passed to the internal server
- *     implementation
- * @example
- * var server = new grpc.Server();
- * server.addProtoService(protobuf_service_descriptor, service_implementation);
- * server.bind('address:port', server_credential);
- * server.start();
- */
-function Server(options) {
-  this.handlers = {};
-  var server = new grpc.Server(options);
-  this._server = server;
-  this.started = false;
-}
-
-/**
- * Start the server and begin handling requests
- */
-Server.prototype.start = function() {
-  if (this.started) {
-    throw new Error('Server is already running');
-  }
-  var self = this;
-  this.started = true;
-  this._server.start();
-  /**
-   * Handles the SERVER_RPC_NEW event. If there is a handler associated with
-   * the requested method, use that handler to respond to the request. Then
-   * wait for the next request
-   * @param {grpc.internal~Event} event The event to handle with tag
-   *     SERVER_RPC_NEW
-   */
-  function handleNewCall(err, event) {
-    if (err) {
-      return;
-    }
-    var details = event.new_call;
-    var call = details.call;
-    var method = details.method;
-    var metadata = Metadata._fromCoreRepresentation(details.metadata);
-    if (method === null) {
-      return;
-    }
-    self._server.requestCall(handleNewCall);
-    var handler;
-    if (self.handlers.hasOwnProperty(method)) {
-      handler = self.handlers[method];
-    } else {
-      var batch = {};
-      batch[grpc.opType.SEND_INITIAL_METADATA] =
-          (new Metadata())._getCoreRepresentation();
-      batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-        code: constants.status.UNIMPLEMENTED,
-        details: '',
-        metadata: {}
-      };
-      batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
-      call.startBatch(batch, function() {});
-      return;
-    }
-    streamHandlers[handler.type](call, handler, metadata);
-  }
-  this._server.requestCall(handleNewCall);
-};
-
-/**
- * Unified type for application handlers for all types of calls
- * @typedef {(grpc.Server~handleUnaryCall
- *            |grpc.Server~handleClientStreamingCall
- *            |grpc.Server~handleServerStreamingCall
- *            |grpc.Server~handleBidiStreamingCall)} grpc.Server~handleCall
- */
-
-/**
- * Registers a handler to handle the named method. Fails if there already is
- * a handler for the given method. Returns true on success
- * @param {string} name The name of the method that the provided function should
- *     handle/respond to.
- * @param {grpc.Server~handleCall} handler Function that takes a stream of
- *     request values and returns a stream of response values
- * @param {grpc~serialize} serialize Serialization function for responses
- * @param {grpc~deserialize} deserialize Deserialization function for requests
- * @param {string} type The streaming type of method that this handles
- * @return {boolean} True if the handler was set. False if a handler was already
- *     set for that name.
- */
-Server.prototype.register = function(name, handler, serialize, deserialize,
-                                     type) {
-  if (this.handlers.hasOwnProperty(name)) {
-    return false;
-  }
-  this.handlers[name] = {
-    func: handler,
-    serialize: serialize,
-    deserialize: deserialize,
-    type: type
-  };
-  return true;
-};
-
-/**
- * Gracefully shuts down the server. The server will stop receiving new calls,
- * and any pending calls will complete. The callback will be called when all
- * pending calls have completed and the server is fully shut down. This method
- * is idempotent with itself and forceShutdown.
- * @param {function()} callback The shutdown complete callback
- */
-Server.prototype.tryShutdown = function(callback) {
-  this._server.tryShutdown(callback);
-};
-
-/**
- * Forcibly shuts down the server. The server will stop receiving new calls
- * and cancel all pending calls. When it returns, the server has shut down.
- * This method is idempotent with itself and tryShutdown, and it will trigger
- * any outstanding tryShutdown callbacks.
- */
-Server.prototype.forceShutdown = function() {
-  this._server.forceShutdown();
-};
-
-var unimplementedStatusResponse = {
-  code: constants.status.UNIMPLEMENTED,
-  details: 'The server does not implement this method'
-};
-
-var defaultHandler = {
-  unary: function(call, callback) {
-    callback(unimplementedStatusResponse);
-  },
-  client_stream: function(call, callback) {
-    callback(unimplementedStatusResponse);
-  },
-  server_stream: function(call) {
-    call.emit('error', unimplementedStatusResponse);
-  },
-  bidi: function(call) {
-    call.emit('error', unimplementedStatusResponse);
-  }
-};
-
-/**
- * Add a service to the server, with a corresponding implementation.
- * @param {grpc~ServiceDefinition} service The service descriptor
- * @param {Object<String, grpc.Server~handleCall>} implementation Map of method
- *     names to method implementation for the provided service.
- */
-Server.prototype.addService = function(service, implementation) {
-  if (!_.isObject(service) || !_.isObject(implementation)) {
-    throw new Error('addService requires two objects as arguments');
-  }
-  if (_.keys(service).length === 0) {
-    throw new Error('Cannot add an empty service to a server');
-  }
-  if (this.started) {
-    throw new Error('Can\'t add a service to a started server.');
-  }
-  var self = this;
-  _.forOwn(service, function(attrs, name) {
-    var method_type;
-    if (attrs.requestStream) {
-      if (attrs.responseStream) {
-        method_type = 'bidi';
-      } else {
-        method_type = 'client_stream';
-      }
-    } else {
-      if (attrs.responseStream) {
-        method_type = 'server_stream';
-      } else {
-        method_type = 'unary';
-      }
-    }
-    var impl;
-    if (implementation[name] === undefined) {
-      /* Handle the case where the method is passed with the name exactly as
-         written in the proto file, instead of using JavaScript function
-         naming style */
-      if (implementation[attrs.originalName] === undefined) {
-        common.log(constants.logVerbosity.ERROR, 'Method handler ' + name +
-            ' for ' + attrs.path + ' expected but not provided');
-        impl = defaultHandler[method_type];
-      } else {
-        impl = _.bind(implementation[attrs.originalName], implementation);
-      }
-    } else {
-      impl = _.bind(implementation[name], implementation);
-    }
-    var serialize = attrs.responseSerialize;
-    var deserialize = attrs.requestDeserialize;
-    var register_success = self.register(attrs.path, impl, serialize,
-                                         deserialize, method_type);
-    if (!register_success) {
-      throw new Error('Method handler for ' + attrs.path +
-          ' already provided.');
-    }
-  });
-};
-
-/**
- * Add a proto service to the server, with a corresponding implementation
- * @deprecated Use {@link grpc.Server#addService} instead
- * @param {Protobuf.Reflect.Service} service The proto service descriptor
- * @param {Object<String, grpc.Server~handleCall>} implementation Map of method
- *     names to method implementation for the provided service.
- */
-Server.prototype.addProtoService = util.deprecate(function(service,
-                                                           implementation) {
-  var options;
-  var protobuf_js_5_common = require('./protobuf_js_5_common');
-  var protobuf_js_6_common = require('./protobuf_js_6_common');
-  if (protobuf_js_5_common.isProbablyProtobufJs5(service)) {
-    options = _.defaults(service.grpc_options, common.defaultGrpcOptions);
-    this.addService(
-        protobuf_js_5_common.getProtobufServiceAttrs(service, options),
-        implementation);
-  } else if (protobuf_js_6_common.isProbablyProtobufJs6(service)) {
-    options = _.defaults(service.grpc_options, common.defaultGrpcOptions);
-    this.addService(
-        protobuf_js_6_common.getProtobufServiceAttrs(service, options),
-        implementation);
-  } else {
-    // We assume that this is a service attributes object
-    this.addService(service, implementation);
-  }
-}, 'Server#addProtoService: Use Server#addService instead');
-
-/**
- * Binds the server to the given port, with SSL disabled if creds is an
- * insecure credentials object
- * @param {string} port The port that the server should bind on, in the format
- *     "address:port"
- * @param {grpc.ServerCredentials} creds Server credential object to be used for
- *     SSL. Pass an insecure credentials object for an insecure port.
- */
-Server.prototype.bind = function(port, creds) {
-  if (this.started) {
-    throw new Error('Can\'t bind an already running server to an address');
-  }
-  return this._server.addHttp2Port(port, creds);
-};
-
-exports.Server = Server;
diff --git a/src/node/stress/metrics_client.js b/src/node/stress/metrics_client.js
deleted file mode 100644
index 6850601..0000000
--- a/src/node/stress/metrics_client.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var grpc = require('../../..');
-
-var proto = grpc.load(__dirname + '/../../proto/grpc/testing/metrics.proto');
-var metrics = proto.grpc.testing;
-
-function main() {
-  var parseArgs = require('minimist');
-  var argv = parseArgs(process.argv, {
-    string: 'metrics_server_address',
-    boolean: 'total_only'
-  });
-  var client = new metrics.MetricsService(argv.metrics_server_address,
-                                          grpc.credentials.createInsecure());
-  if (argv.total_only) {
-    client.getGauge({name: 'qps'}, function(err, data) {
-      console.log(data.name + ':', data.long_value);
-    });
-  } else {
-    var call = client.getAllGauges({});
-    call.on('data', function(data) {
-      console.log(data.name + ':', data.long_value);
-    });
-  }
-}
-
-main();
diff --git a/src/node/stress/metrics_server.js b/src/node/stress/metrics_server.js
deleted file mode 100644
index 52ef27b..0000000
--- a/src/node/stress/metrics_server.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var _ = require('lodash');
-
-var grpc = require('../../..');
-
-var proto = grpc.load(__dirname + '/../../proto/grpc/testing/metrics.proto');
-var metrics = proto.grpc.testing;
-
-function getGauge(call, callback) {
-  /* jshint validthis: true */
-  // Should be bound to a MetricsServer object
-  var name = call.request.name;
-  if (this.gauges.hasOwnProperty(name)) {
-    callback(null, _.assign({name: name}, this.gauges[name]()));
-  } else {
-    callback({code: grpc.status.NOT_FOUND,
-              details: 'No such gauge: ' + name});
-  }
-}
-
-function getAllGauges(call) {
-  /* jshint validthis: true */
-  // Should be bound to a MetricsServer object
-  _.each(this.gauges, function(getter, name) {
-    call.write(_.assign({name: name}, getter()));
-  });
-  call.end();
-}
-
-function MetricsServer(port) {
-  var server = new grpc.Server();
-  server.addService(metrics.MetricsService.service, {
-    getGauge: _.bind(getGauge, this),
-    getAllGauges: _.bind(getAllGauges, this)
-  });
-  server.bind('localhost:' + port, grpc.ServerCredentials.createInsecure());
-  this.server = server;
-  this.gauges = {};
-}
-
-MetricsServer.prototype.start = function() {
-  this.server.start();
-}
-
-MetricsServer.prototype.registerGauge = function(name, getter) {
-  this.gauges[name] = getter;
-};
-
-MetricsServer.prototype.shutdown = function() {
-  this.server.forceShutdown();
-};
-
-module.exports = MetricsServer;
diff --git a/src/node/stress/stress_client.js b/src/node/stress/stress_client.js
deleted file mode 100644
index fc35d45..0000000
--- a/src/node/stress/stress_client.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var _ = require('lodash');
-
-var grpc = require('../../..');
-
-var interop_client = require('../interop/interop_client');
-var MetricsServer = require('./metrics_server');
-
-var running;
-
-var metrics_server;
-
-var start_time;
-var query_count;
-
-function makeCall(client, test_cases) {
-  if (!running) {
-    return;
-  }
-  var test_case = test_cases[_.random(test_cases.length - 1)];
-  interop_client.test_cases[test_case].run(client, function() {
-    query_count += 1;
-    makeCall(client, test_cases);
-  });
-}
-
-function makeCalls(client, test_cases, parallel_calls_per_channel) {
-  _.times(parallel_calls_per_channel, function() {
-    makeCall(client, test_cases);
-  });
-}
-
-function getQps() {
-  var diff = process.hrtime(start_time);
-  var seconds = diff[0] + diff[1] / 1e9;
-  return {long_value: query_count / seconds};
-}
-
-function start(server_addresses, test_cases, channels_per_server,
-               parallel_calls_per_channel, metrics_port) {
-  running = true;
-  /* Assuming that we are not calling unimplemented_method. The client class
-   * used by empty_unary is (currently) the client class used by every interop
-   * test except unimplemented_method */
-  var Client = interop_client.test_cases.empty_unary.Client;
-  /* Make channels_per_server clients connecting to each server address */
-  var channels = _.flatten(_.times(
-      channels_per_server, _.partial(_.map, server_addresses, function(address) {
-        return new Client(address, grpc.credentials.createInsecure());
-      })));
-  metrics_server = new MetricsServer(metrics_port);
-  metrics_server.registerGauge('qps', getQps);
-  start_time = process.hrtime();
-  query_count = 0;
-  _.each(channels, _.partial(makeCalls, _, test_cases,
-                             parallel_calls_per_channel));
-  metrics_server.start();
-}
-
-function stop() {
-  running = false;
-  metrics_server.shutdown();
-  console.log('QPS: ' + getQps().long_value);
-}
-
-function main() {
-  var parseArgs = require('minimist');
-  var argv = parseArgs(process.argv, {
-    string: ['server_addresses', 'test_cases', 'metrics_port'],
-    default: {'server_addresses': 'localhost:8080',
-              'test_duration_secs': -1,
-              'num_channels_per_server': 1,
-              'num_stubs_per_channel': 1,
-              'metrics_port': '8081'}
-  });
-  var server_addresses = argv.server_addresses.split(',');
-  /* Generate an array of test cases, where the number of instances of each name
-   * corresponds to the number given in the argument.
-   * e.g. 'empty_unary:1,large_unary:2' =>
-   * ['empty_unary', 'large_unary', 'large_unary'] */
-  var test_cases = _.flatten(_.map(argv.test_cases.split(','), function(value) {
-    var split = value.split(':');
-    return _.times(split[1], _.constant(split[0]));
-  }));
-  start(server_addresses, test_cases, argv.num_channels_per_server,
-        argv.num_stubs_per_channel, argv.metrics_port);
-  if (argv.test_duration_secs > -1) {
-    setTimeout(stop, argv.test_duration_secs * 1000);
-  }
-}
-
-main();
diff --git a/src/node/test/async_test.js b/src/node/test/async_test.js
deleted file mode 100644
index b62b414..0000000
--- a/src/node/test/async_test.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-
-var grpc = require('..');
-var math = grpc.load(__dirname + '/../../proto/math/math.proto').math;
-
-
-/**
- * Client to use to make requests to a running server.
- */
-var math_client;
-
-/**
- * Server to test against
- */
-var getServer = require('./math/math_server.js');
-
-var server = getServer();
-
-describe('Async functionality', function() {
-  before(function(done) {
-    var port_num = server.bind('0.0.0.0:0',
-                               grpc.ServerCredentials.createInsecure());
-    server.start();
-    math_client = new math.Math('localhost:' + port_num,
-                                grpc.credentials.createInsecure());
-    done();
-  });
-  after(function() {
-    grpc.closeClient(math_client);
-    server.forceShutdown();
-  });
-  it('should not hang', function(done) {
-    var chunkCount=0;
-    var call = math_client.sum(function handleSumResult(err, value) {
-      assert.ifError(err);
-      assert.equal(value.num, chunkCount);
-    });
-
-    var path = require('path');
-    var fs = require('fs');
-    var fileToRead = path.join(__dirname, 'numbers.txt');
-    var readStream = fs.createReadStream(fileToRead);
-
-    readStream.once('readable', function () {
-      readStream.on('data', function (chunk) {
-        call.write({'num': 1});
-        chunkCount += 1;
-      });
-
-      readStream.on('end', function () {
-        call.end();
-      });
-
-      readStream.on('error', function (error) {
-      });
-    });
-
-    call.on('status', function checkStatus(status) {
-      assert.strictEqual(status.code, grpc.status.OK);
-      done();
-    });
-  });
-});
diff --git a/src/node/test/call_test.js b/src/node/test/call_test.js
deleted file mode 100644
index b5246c4..0000000
--- a/src/node/test/call_test.js
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-var grpc = require('../src/grpc_extension');
-var constants = require('../src/constants');
-
-/**
- * Helper function to return an absolute deadline given a relative timeout in
- * seconds.
- * @param {number} timeout_secs The number of seconds to wait before timing out
- * @return {Date} A date timeout_secs in the future
- */
-function getDeadline(timeout_secs) {
-  var deadline = new Date();
-  deadline.setSeconds(deadline.getSeconds() + timeout_secs);
-  return deadline;
-}
-
-var insecureCreds = grpc.ChannelCredentials.createInsecure();
-
-describe('call', function() {
-  var channel;
-  var server;
-  before(function() {
-    server = new grpc.Server();
-    var port = server.addHttp2Port('localhost:0',
-                                   grpc.ServerCredentials.createInsecure());
-    server.start();
-    channel = new grpc.Channel('localhost:' + port, insecureCreds);
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  describe('constructor', function() {
-    it('should reject anything less than 3 arguments', function() {
-      assert.throws(function() {
-        new grpc.Call();
-      }, TypeError);
-      assert.throws(function() {
-        new grpc.Call(channel);
-      }, TypeError);
-      assert.throws(function() {
-        new grpc.Call(channel, 'method');
-      }, TypeError);
-    });
-    it('should succeed with a Channel, a string, and a date or number',
-       function() {
-         assert.doesNotThrow(function() {
-           new grpc.Call(channel, 'method', new Date());
-         });
-         assert.doesNotThrow(function() {
-           new grpc.Call(channel, 'method', 0);
-         });
-       });
-    it('should accept an optional fourth string parameter', function() {
-      assert.doesNotThrow(function() {
-        new grpc.Call(channel, 'method', new Date(), 'host_override');
-      });
-    });
-    it('should fail with a closed channel', function() {
-      var local_channel = new grpc.Channel('hostname', insecureCreds);
-      local_channel.close();
-      assert.throws(function() {
-        new grpc.Call(channel, 'method');
-      });
-    });
-    it('should fail with other types', function() {
-      assert.throws(function() {
-        new grpc.Call({}, 'method', 0);
-      }, TypeError);
-      assert.throws(function() {
-        new grpc.Call(channel, null, 0);
-      }, TypeError);
-      assert.throws(function() {
-        new grpc.Call(channel, 'method', 'now');
-      }, TypeError);
-    });
-    it('should succeed without the new keyword', function() {
-      assert.doesNotThrow(function() {
-        var call = grpc.Call(channel, 'method', new Date());
-        assert(call instanceof grpc.Call);
-      });
-    });
-  });
-  describe('deadline', function() {
-    it('should time out immediately with negative deadline', function(done) {
-      var call = new grpc.Call(channel, 'method', -Infinity);
-      var batch = {};
-      batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-      call.startBatch(batch, function(err, response) {
-        assert.strictEqual(response.status.code,
-                           constants.status.DEADLINE_EXCEEDED);
-        done();
-      });
-    });
-  });
-  describe('startBatch', function() {
-    it('should fail without an object and a function', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        call.startBatch();
-      });
-      assert.throws(function() {
-        call.startBatch({});
-      });
-      assert.throws(function() {
-        call.startBatch(null, function(){});
-      });
-    });
-    it('should succeed with an empty object', function(done) {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.doesNotThrow(function() {
-        call.startBatch({}, function(err) {
-          assert.ifError(err);
-          done();
-        });
-      });
-    });
-  });
-  describe('startBatch with metadata', function() {
-    it('should succeed with a map of strings to string arrays', function(done) {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.doesNotThrow(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_INITIAL_METADATA] = {'key1': ['value1'],
-                                                    'key2': ['value2']};
-        call.startBatch(batch, function(err, resp) {
-          assert.ifError(err);
-          assert.deepEqual(resp, {'send_metadata': true});
-          done();
-        });
-      });
-    });
-    it('should succeed with a map of strings to buffer arrays', function(done) {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.doesNotThrow(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_INITIAL_METADATA] = {
-          'key1-bin': [new Buffer('value1')],
-          'key2-bin': [new Buffer('value2')]
-        };
-        call.startBatch(batch, function(err, resp) {
-          assert.ifError(err);
-          assert.deepEqual(resp, {'send_metadata': true});
-          done();
-        });
-      });
-    });
-    it('should fail with other parameter types', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_INITIAL_METADATA] = undefined;
-        call.startBatch(batch, function(){});
-      });
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_INITIAL_METADATA] = null;
-        call.startBatch(batch, function(){});
-      }, TypeError);
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_INITIAL_METADATA] = 'value';
-        call.startBatch(batch, function(){});
-      }, TypeError);
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_INITIAL_METADATA] = 5;
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-  });
-  describe('startBatch with message', function() {
-    it('should fail with null argument', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_MESSAGE] = null;
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-    it('should fail with numeric argument', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_MESSAGE] = 5;
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-    it('should fail with string argument', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_MESSAGE] = 'value';
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-  });
-  describe('startBatch with status', function() {
-    it('should fail without a code', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-          details: 'details string',
-          metadata: {}
-        };
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-    it('should fail without details', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-          code: 0,
-          metadata: {}
-        };
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-    it('should fail without metadata', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-          code: 0,
-          details: 'details string'
-        };
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-    it('should fail with incorrectly typed code argument', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-          code: 'code string',
-          details: 'details string',
-          metadata: {}
-        };
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-    it('should fail with incorrectly typed details argument', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-          code: 0,
-          details: 5,
-          metadata: {}
-        };
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-    it('should fail with incorrectly typed metadata argument', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.throws(function() {
-        var batch = {};
-        batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-          code: 0,
-          details: 'details string',
-          metadata: 'abc'
-        };
-        call.startBatch(batch, function(){});
-      }, TypeError);
-    });
-  });
-  describe('cancel', function() {
-    it('should succeed', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.doesNotThrow(function() {
-        call.cancel();
-      });
-    });
-  });
-  describe('cancelWithStatus', function() {
-    it('should reject anything other than an integer and a string', function() {
-      assert.doesNotThrow(function() {
-        var call = new grpc.Call(channel, 'method', getDeadline(1));
-        call.cancelWithStatus(1, 'details');
-      });
-      assert.throws(function() {
-        var call = new grpc.Call(channel, 'method', getDeadline(1));
-        call.cancelWithStatus();
-      });
-      assert.throws(function() {
-        var call = new grpc.Call(channel, 'method', getDeadline(1));
-        call.cancelWithStatus('');
-      });
-      assert.throws(function() {
-        var call = new grpc.Call(channel, 'method', getDeadline(1));
-        call.cancelWithStatus(5, {});
-      });
-    });
-    it('should reject the OK status code', function() {
-      assert.throws(function() {
-        var call = new grpc.Call(channel, 'method', getDeadline(1));
-        call.cancelWithStatus(0, 'details');
-      });
-    });
-    it('should result in the call ending with a status', function(done) {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      var batch = {};
-      batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-      call.startBatch(batch, function(err, response) {
-        assert.strictEqual(response.status.code, 5);
-        assert.strictEqual(response.status.details, 'details');
-        done();
-      });
-      call.cancelWithStatus(5, 'details');
-    });
-  });
-  describe('getPeer', function() {
-    it('should return a string', function() {
-      var call = new grpc.Call(channel, 'method', getDeadline(1));
-      assert.strictEqual(typeof call.getPeer(), 'string');
-    });
-  });
-});
diff --git a/src/node/test/channel_test.js b/src/node/test/channel_test.js
deleted file mode 100644
index 373c5ac..0000000
--- a/src/node/test/channel_test.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-var grpc = require('../src/grpc_extension');
-
-/**
- * This is used for testing functions with multiple asynchronous calls that
- * can happen in different orders. This should be passed the number of async
- * function invocations that can occur last, and each of those should call this
- * function's return value
- * @param {function()} done The function that should be called when a test is
- *     complete.
- * @param {number} count The number of calls to the resulting function if the
- *     test passes.
- * @return {function()} The function that should be called at the end of each
- *     sequence of asynchronous functions.
- */
-function multiDone(done, count) {
-  return function() {
-    count -= 1;
-    if (count <= 0) {
-      done();
-    }
-  };
-}
-var insecureCreds = grpc.ChannelCredentials.createInsecure();
-
-describe('channel', function() {
-  describe('constructor', function() {
-    it('should require a string for the first argument', function() {
-      assert.doesNotThrow(function() {
-        new grpc.Channel('hostname', insecureCreds);
-      });
-      assert.throws(function() {
-        new grpc.Channel();
-      }, TypeError);
-      assert.throws(function() {
-        new grpc.Channel(5);
-      });
-    });
-    it('should require a credential for the second argument', function() {
-      assert.doesNotThrow(function() {
-        new grpc.Channel('hostname', insecureCreds);
-      });
-      assert.throws(function() {
-        new grpc.Channel('hostname', 5);
-      });
-      assert.throws(function() {
-        new grpc.Channel('hostname');
-      });
-    });
-    it('should accept an object for the third argument', function() {
-      assert.doesNotThrow(function() {
-        new grpc.Channel('hostname', insecureCreds, {});
-      });
-      assert.throws(function() {
-        new grpc.Channel('hostname', insecureCreds, 'abc');
-      });
-    });
-    it('should only accept objects with string or int values', function() {
-      assert.doesNotThrow(function() {
-        new grpc.Channel('hostname', insecureCreds,{'key' : 'value'});
-      });
-      assert.doesNotThrow(function() {
-        new grpc.Channel('hostname', insecureCreds, {'key' : 5});
-      });
-      assert.throws(function() {
-        new grpc.Channel('hostname', insecureCreds, {'key' : null});
-      });
-      assert.throws(function() {
-        new grpc.Channel('hostname', insecureCreds, {'key' : new Date()});
-      });
-    });
-    it('should succeed without the new keyword', function() {
-      assert.doesNotThrow(function() {
-        var channel = grpc.Channel('hostname', insecureCreds);
-        assert(channel instanceof grpc.Channel);
-      });
-    });
-  });
-  describe('close', function() {
-    var channel;
-    beforeEach(function() {
-      channel = new grpc.Channel('hostname', insecureCreds, {});
-    });
-    it('should succeed silently', function() {
-      assert.doesNotThrow(function() {
-        channel.close();
-      });
-    });
-    it('should be idempotent', function() {
-      assert.doesNotThrow(function() {
-        channel.close();
-        channel.close();
-      });
-    });
-  });
-  describe('getTarget', function() {
-    var channel;
-    beforeEach(function() {
-      channel = new grpc.Channel('hostname', insecureCreds, {});
-    });
-    it('should return a string', function() {
-      assert.strictEqual(typeof channel.getTarget(), 'string');
-    });
-  });
-  describe('getConnectivityState', function() {
-    var channel;
-    beforeEach(function() {
-      channel = new grpc.Channel('hostname', insecureCreds, {});
-    });
-    it('should return IDLE for a new channel', function() {
-      assert.strictEqual(channel.getConnectivityState(),
-                         grpc.connectivityState.IDLE);
-    });
-  });
-  describe('watchConnectivityState', function() {
-    var channel;
-    beforeEach(function() {
-      channel = new grpc.Channel('localhost', insecureCreds, {});
-    });
-    afterEach(function() {
-      channel.close();
-    });
-    it('should time out if called alone', function(done) {
-      var old_state = channel.getConnectivityState();
-      var deadline = new Date();
-      deadline.setSeconds(deadline.getSeconds() + 1);
-      channel.watchConnectivityState(old_state, deadline, function(err, value) {
-        assert(err);
-        done();
-      });
-    });
-    it('should complete if a connection attempt is forced', function(done) {
-      var old_state = channel.getConnectivityState();
-      var deadline = new Date();
-      deadline.setSeconds(deadline.getSeconds() + 1);
-      channel.watchConnectivityState(old_state, deadline, function(err, value) {
-        assert.ifError(err);
-        assert.notEqual(value.new_state, old_state);
-        done();
-      });
-      channel.getConnectivityState(true);
-    });
-    it('should complete twice if called twice', function(done) {
-      done = multiDone(done, 2);
-      var old_state = channel.getConnectivityState();
-      var deadline = new Date();
-      deadline.setSeconds(deadline.getSeconds() + 1);
-      channel.watchConnectivityState(old_state, deadline, function(err, value) {
-        assert.ifError(err);
-        assert.notEqual(value.new_state, old_state);
-        done();
-      });
-      channel.watchConnectivityState(old_state, deadline, function(err, value) {
-        assert.ifError(err);
-        assert.notEqual(value.new_state, old_state);
-        done();
-      });
-      channel.getConnectivityState(true);
-    });
-  });
-});
diff --git a/src/node/test/common_test.js b/src/node/test/common_test.js
deleted file mode 100644
index d50c1a2..0000000
--- a/src/node/test/common_test.js
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-var _ = require('lodash');
-
-var common = require('../src/common');
-var protobuf_js_5_common = require('../src/protobuf_js_5_common');
-
-var serializeCls = protobuf_js_5_common.serializeCls;
-var deserializeCls = protobuf_js_5_common.deserializeCls;
-
-var ProtoBuf = require('protobufjs');
-
-var messages_proto = ProtoBuf.loadProtoFile(
-    __dirname + '/test_messages.proto').build();
-
-var default_options = common.defaultGrpcOptions;
-
-describe('Proto message long int serialize and deserialize', function() {
-  var longSerialize = serializeCls(messages_proto.LongValues);
-  var longDeserialize = deserializeCls(messages_proto.LongValues,
-                                       default_options);
-  var pos_value = '314159265358979';
-  var neg_value = '-27182818284590';
-  it('should preserve positive int64 values', function() {
-    var serialized = longSerialize({int_64: pos_value});
-    assert.strictEqual(longDeserialize(serialized).int_64.toString(),
-                       pos_value);
-  });
-  it('should preserve negative int64 values', function() {
-    var serialized = longSerialize({int_64: neg_value});
-    assert.strictEqual(longDeserialize(serialized).int_64.toString(),
-                       neg_value);
-  });
-  it('should preserve uint64 values', function() {
-    var serialized = longSerialize({uint_64: pos_value});
-    assert.strictEqual(longDeserialize(serialized).uint_64.toString(),
-                       pos_value);
-  });
-  it('should preserve positive sint64 values', function() {
-    var serialized = longSerialize({sint_64: pos_value});
-    assert.strictEqual(longDeserialize(serialized).sint_64.toString(),
-                       pos_value);
-  });
-  it('should preserve negative sint64 values', function() {
-    var serialized = longSerialize({sint_64: neg_value});
-    assert.strictEqual(longDeserialize(serialized).sint_64.toString(),
-                       neg_value);
-  });
-  it('should preserve fixed64 values', function() {
-    var serialized = longSerialize({fixed_64: pos_value});
-    assert.strictEqual(longDeserialize(serialized).fixed_64.toString(),
-                       pos_value);
-  });
-  it('should preserve positive sfixed64 values', function() {
-    var serialized = longSerialize({sfixed_64: pos_value});
-    assert.strictEqual(longDeserialize(serialized).sfixed_64.toString(),
-                       pos_value);
-  });
-  it('should preserve negative sfixed64 values', function() {
-    var serialized = longSerialize({sfixed_64: neg_value});
-    assert.strictEqual(longDeserialize(serialized).sfixed_64.toString(),
-                       neg_value);
-  });
-  it('should deserialize as a number with the right option set', function() {
-    var num_options = _.defaults({longsAsStrings: false}, default_options);
-    var longNumDeserialize = deserializeCls(messages_proto.LongValues,
-                                            num_options);
-    var serialized = longSerialize({int_64: pos_value});
-    assert.strictEqual(typeof longDeserialize(serialized).int_64, 'string');
-    /* With the longsAsStrings option disabled, long values are represented as
-     * objects with 3 keys: low, high, and unsigned */
-    assert.strictEqual(typeof longNumDeserialize(serialized).int_64, 'object');
-  });
-});
-describe('Proto message bytes serialize and deserialize', function() {
-  var sequenceSerialize = serializeCls(messages_proto.SequenceValues);
-  var sequenceDeserialize = deserializeCls(
-      messages_proto.SequenceValues, default_options);
-  var b64_options = _.defaults({binaryAsBase64: true}, default_options);
-  var sequenceBase64Deserialize = deserializeCls(
-      messages_proto.SequenceValues, b64_options);
-  var buffer_val = new Buffer([0x69, 0xb7]);
-  var base64_val = 'abc=';
-  it('should preserve a buffer', function() {
-    var serialized = sequenceSerialize({bytes_field: buffer_val});
-    var deserialized = sequenceDeserialize(serialized);
-    assert.strictEqual(deserialized.bytes_field.compare(buffer_val), 0);
-  });
-  it('should accept base64 encoded strings', function() {
-    var serialized = sequenceSerialize({bytes_field: base64_val});
-    var deserialized = sequenceDeserialize(serialized);
-    assert.strictEqual(deserialized.bytes_field.compare(buffer_val), 0);
-  });
-  it('should output base64 encoded strings with an option set', function() {
-    var serialized = sequenceSerialize({bytes_field: base64_val});
-    var deserialized = sequenceBase64Deserialize(serialized);
-    assert.strictEqual(deserialized.bytes_field, base64_val);
-  });
-  it('should serialize a repeated field as packed by default', function() {
-    var expected_serialize = new Buffer([0x12, 0x01, 0x0a]);
-    var serialized = sequenceSerialize({repeated_field: [10]});
-    assert.strictEqual(expected_serialize.compare(serialized), 0);
-  });
-  // This tests a bug that was fixed in Protobuf.js 6
-  it.skip('should deserialize packed or unpacked repeated', function() {
-    var expectedDeserialize = {
-      bytes_field: new Buffer(''),
-      repeated_field: [10]
-    };
-    var packedSerialized = new Buffer([0x12, 0x01, 0x0a]);
-    var unpackedSerialized = new Buffer([0x10, 0x0a]);
-    var packedDeserialized;
-    var unpackedDeserialized;
-    assert.doesNotThrow(function() {
-      packedDeserialized = sequenceDeserialize(packedSerialized);
-    });
-    assert.doesNotThrow(function() {
-      unpackedDeserialized = sequenceDeserialize(unpackedSerialized);
-    });
-    assert.deepEqual(packedDeserialized, expectedDeserialize);
-    assert.deepEqual(unpackedDeserialized, expectedDeserialize);
-  });
-});
-// This tests a bug that was fixed in Protobuf.js 6
-describe.skip('Proto message oneof serialize and deserialize', function() {
-  var oneofSerialize = serializeCls(messages_proto.OneOfValues);
-  var oneofDeserialize = deserializeCls(
-      messages_proto.OneOfValues, default_options);
-  it('Should have idempotent round trips', function() {
-    var test_message = {oneof_choice: 'int_choice', int_choice: 5};
-    var serialized1 = oneofSerialize(test_message);
-    var deserialized1 = oneofDeserialize(serialized1);
-    assert.equal(deserialized1.int_choice, 5);
-    var serialized2 = oneofSerialize(deserialized1);
-    var deserialized2 = oneofDeserialize(serialized2);
-    assert.deepEqual(deserialized1, deserialized2);
-  });
-  it('Should emit a property indicating which field was chosen', function() {
-    var test_message1 = {oneof_choice: 'int_choice', int_choice: 5};
-    var serialized1 = oneofSerialize(test_message1);
-    var deserialized1 = oneofDeserialize(serialized1);
-    assert.equal(deserialized1.oneof_choice, 'int_choice');
-    var test_message2 = {oneof_choice: 'string_choice', string_choice: 'abc'};
-    var serialized2 = oneofSerialize(test_message2);
-    var deserialized2 = oneofDeserialize(serialized2);
-    assert.equal(deserialized2.oneof_choice, 'string_choice');
-  });
-});
-describe('Proto message enum serialize and deserialize', function() {
-  var enumSerialize = serializeCls(messages_proto.EnumValues);
-  var enumDeserialize = deserializeCls(
-      messages_proto.EnumValues, default_options);
-  var enumIntOptions = _.defaults({enumsAsStrings: false}, default_options);
-  var enumIntDeserialize = deserializeCls(
-      messages_proto.EnumValues, enumIntOptions);
-  it('Should accept both names and numbers', function() {
-    var nameSerialized = enumSerialize({enum_value: 'ONE'});
-    var numberSerialized = enumSerialize({enum_value: 1});
-    assert.strictEqual(messages_proto.TestEnum.ONE, 1);
-    assert.deepEqual(enumDeserialize(nameSerialized),
-                     enumDeserialize(numberSerialized));
-  });
-  // This tests a bug that was fixed in Protobuf.js 6
-  it.skip('Should correctly handle the enumsAsStrings option', function() {
-    var serialized = enumSerialize({enum_value: 'TWO'});
-    var nameDeserialized = enumDeserialize(serialized);
-    var numberDeserialized = enumIntDeserialize(serialized);
-    assert.deepEqual(nameDeserialized, {enum_value: 'TWO'});
-    assert.deepEqual(numberDeserialized, {enum_value: 2});
-  });
-});
diff --git a/src/node/test/credentials_test.js b/src/node/test/credentials_test.js
deleted file mode 100644
index 0ff838e..0000000
--- a/src/node/test/credentials_test.js
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-var fs = require('fs');
-var path = require('path');
-
-var grpc = require('..');
-
-/**
- * This is used for testing functions with multiple asynchronous calls that
- * can happen in different orders. This should be passed the number of async
- * function invocations that can occur last, and each of those should call this
- * function's return value
- * @param {function()} done The function that should be called when a test is
- *     complete.
- * @param {number} count The number of calls to the resulting function if the
- *     test passes.
- * @return {function()} The function that should be called at the end of each
- *     sequence of asynchronous functions.
- */
-function multiDone(done, count) {
-  return function() {
-    count -= 1;
-    if (count <= 0) {
-      done();
-    }
-  };
-}
-
-var fakeSuccessfulGoogleCredentials = {
-  getRequestMetadata: function(service_url, callback) {
-    setTimeout(function() {
-      callback(null, {Authorization: 'success'});
-    }, 0);
-  }
-};
-
-var fakeFailingGoogleCredentials = {
-  getRequestMetadata: function(service_url, callback) {
-    setTimeout(function() {
-      // Google credentials currently adds string error codes to auth errors
-      var error = new Error('Authentication failure');
-      error.code = 'ENOENT';
-      callback(error);
-    }, 0);
-  }
-};
-
-var key_data, pem_data, ca_data;
-
-before(function() {
-  var key_path = path.join(__dirname, './data/server1.key');
-  var pem_path = path.join(__dirname, './data/server1.pem');
-  var ca_path = path.join(__dirname, '../test/data/ca.pem');
-  key_data = fs.readFileSync(key_path);
-  pem_data = fs.readFileSync(pem_path);
-  ca_data = fs.readFileSync(ca_path);
-});
-
-describe('channel credentials', function() {
-  describe('#createSsl', function() {
-    it('works with no arguments', function() {
-      var creds;
-      assert.doesNotThrow(function() {
-        creds = grpc.credentials.createSsl();
-      });
-      assert.notEqual(creds, null);
-    });
-    it('works with just one Buffer argument', function() {
-      var creds;
-      assert.doesNotThrow(function() {
-        creds = grpc.credentials.createSsl(ca_data);
-      });
-      assert.notEqual(creds, null);
-    });
-    it('works with 3 Buffer arguments', function() {
-      var creds;
-      assert.doesNotThrow(function() {
-        creds = grpc.credentials.createSsl(ca_data, key_data, pem_data);
-      });
-      assert.notEqual(creds, null);
-    });
-    it('works if the first argument is null', function() {
-      var creds;
-      assert.doesNotThrow(function() {
-        creds = grpc.credentials.createSsl(null, key_data, pem_data);
-      });
-      assert.notEqual(creds, null);
-    });
-    it('fails if the first argument is a non-Buffer value', function() {
-      assert.throws(function() {
-        grpc.credentials.createSsl('test');
-      }, TypeError);
-    });
-    it('fails if the second argument is a non-Buffer value', function() {
-      assert.throws(function() {
-        grpc.credentials.createSsl(null, 'test', pem_data);
-      }, TypeError);
-    });
-    it('fails if the third argument is a non-Buffer value', function() {
-      assert.throws(function() {
-        grpc.credentials.createSsl(null, key_data, 'test');
-      }, TypeError);
-    });
-    it('fails if only 1 of the last 2 arguments is provided', function() {
-      assert.throws(function() {
-        grpc.credentials.createSsl(null, key_data);
-      });
-      assert.throws(function() {
-        grpc.credentials.createSsl(null, null, pem_data);
-      });
-    });
-  });
-});
-
-describe('server credentials', function() {
-  describe('#createSsl', function() {
-    it('accepts a buffer and array as the first 2 arguments', function() {
-      var creds;
-      assert.doesNotThrow(function() {
-        creds = grpc.ServerCredentials.createSsl(ca_data, []);
-      });
-      assert.notEqual(creds, null);
-    });
-    it('accepts a boolean as the third argument', function() {
-      var creds;
-      assert.doesNotThrow(function() {
-        creds = grpc.ServerCredentials.createSsl(ca_data, [], true);
-      });
-      assert.notEqual(creds, null);
-    });
-    it('accepts an object with two buffers in the second argument', function() {
-      var creds;
-      assert.doesNotThrow(function() {
-        creds = grpc.ServerCredentials.createSsl(null,
-                                                 [{private_key: key_data,
-                                                   cert_chain: pem_data}]);
-      });
-      assert.notEqual(creds, null);
-    });
-    it('accepts multiple objects in the second argument', function() {
-      var creds;
-      assert.doesNotThrow(function() {
-        creds = grpc.ServerCredentials.createSsl(null,
-                                                 [{private_key: key_data,
-                                                   cert_chain: pem_data},
-                                                  {private_key: key_data,
-                                                   cert_chain: pem_data}]);
-      });
-      assert.notEqual(creds, null);
-    });
-    it('fails if the second argument is not an Array', function() {
-      assert.throws(function() {
-        grpc.ServerCredentials.createSsl(ca_data, 'test');
-      }, TypeError);
-    });
-    it('fails if the first argument is a non-Buffer value', function() {
-      assert.throws(function() {
-        grpc.ServerCredentials.createSsl('test', []);
-      }, TypeError);
-    });
-    it('fails if the third argument is a non-boolean value', function() {
-      assert.throws(function() {
-        grpc.ServerCredentials.createSsl(ca_data, [], 'test');
-      }, TypeError);
-    });
-    it('fails if the array elements are not objects', function() {
-      assert.throws(function() {
-        grpc.ServerCredentials.createSsl(ca_data, 'test');
-      }, TypeError);
-    });
-    it('fails if the object does not have a Buffer private_key', function() {
-      assert.throws(function() {
-        grpc.ServerCredentials.createSsl(null,
-                                         [{private_key: 'test',
-                                           cert_chain: pem_data}]);
-      }, TypeError);
-    });
-    it('fails if the object does not have a Buffer cert_chain', function() {
-      assert.throws(function() {
-        grpc.ServerCredentials.createSsl(null,
-                                         [{private_key: key_data,
-                                           cert_chain: 'test'}]);
-      }, TypeError);
-    });
-  });
-});
-
-describe('client credentials', function() {
-  var Client;
-  var server;
-  var port;
-  var client_ssl_creds;
-  var client_options = {};
-  before(function() {
-    var proto = grpc.load(__dirname + '/test_service.proto');
-    server = new grpc.Server();
-    server.addService(proto.TestService.service, {
-      unary: function(call, cb) {
-        call.sendMetadata(call.metadata);
-        cb(null, {});
-      },
-      clientStream: function(stream, cb){
-        stream.on('data', function(data) {});
-        stream.on('end', function() {
-          stream.sendMetadata(stream.metadata);
-          cb(null, {});
-        });
-      },
-      serverStream: function(stream) {
-        stream.sendMetadata(stream.metadata);
-        stream.end();
-      },
-      bidiStream: function(stream) {
-        stream.on('data', function(data) {});
-        stream.on('end', function() {
-          stream.sendMetadata(stream.metadata);
-          stream.end();
-        });
-      }
-    });
-    var creds = grpc.ServerCredentials.createSsl(null,
-                                                 [{private_key: key_data,
-                                                   cert_chain: pem_data}]);
-    port = server.bind('localhost:0', creds);
-    server.start();
-
-    Client = proto.TestService;
-    client_ssl_creds = grpc.credentials.createSsl(ca_data);
-    var host_override = 'foo.test.google.fr';
-    client_options['grpc.ssl_target_name_override'] = host_override;
-    client_options['grpc.default_authority'] = host_override;
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('Should accept SSL creds for a client', function(done) {
-    var client = new Client('localhost:' + port, client_ssl_creds,
-                            client_options);
-    client.unary({}, function(err, data) {
-      assert.ifError(err);
-      done();
-    });
-  });
-  it('Should update metadata with SSL creds', function(done) {
-    var metadataUpdater = function(service_url, callback) {
-      var metadata = new grpc.Metadata();
-      metadata.set('plugin_key', 'plugin_value');
-      callback(null, metadata);
-    };
-    var creds = grpc.credentials.createFromMetadataGenerator(metadataUpdater);
-    var combined_creds = grpc.credentials.combineChannelCredentials(
-        client_ssl_creds, creds);
-    var client = new Client('localhost:' + port, combined_creds,
-                            client_options);
-    var call = client.unary({}, function(err, data) {
-      assert.ifError(err);
-    });
-    call.on('metadata', function(metadata) {
-      assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']);
-      done();
-    });
-  });
-  it('Should update metadata for two simultaneous calls', function(done) {
-    done = multiDone(done, 2);
-    var metadataUpdater = function(service_url, callback) {
-      var metadata = new grpc.Metadata();
-      metadata.set('plugin_key', 'plugin_value');
-      callback(null, metadata);
-    };
-    var creds = grpc.credentials.createFromMetadataGenerator(metadataUpdater);
-    var combined_creds = grpc.credentials.combineChannelCredentials(
-        client_ssl_creds, creds);
-    var client = new Client('localhost:' + port, combined_creds,
-                            client_options);
-    var call = client.unary({}, function(err, data) {
-      assert.ifError(err);
-    });
-    call.on('metadata', function(metadata) {
-      assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']);
-      done();
-    });
-    var call2 = client.unary({}, function(err, data) {
-      assert.ifError(err);
-    });
-    call2.on('metadata', function(metadata) {
-      assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']);
-      done();
-    });
-  });
-  it('should propagate errors that the updater emits', function(done) {
-    var metadataUpdater = function(service_url, callback) {
-      var error = new Error('Authentication error');
-      error.code = grpc.status.UNAUTHENTICATED;
-      callback(error);
-    };
-    var creds = grpc.credentials.createFromMetadataGenerator(metadataUpdater);
-    var combined_creds = grpc.credentials.combineChannelCredentials(
-        client_ssl_creds, creds);
-    var client = new Client('localhost:' + port, combined_creds,
-                            client_options);
-    client.unary({}, function(err, data) {
-      assert(err);
-      assert.strictEqual(err.message,
-                         'Getting metadata from plugin failed with error: ' +
-                         'Authentication error');
-      assert.strictEqual(err.code, grpc.status.UNAUTHENTICATED);
-      done();
-    });
-  });
-  it('should successfully wrap a Google credential', function(done) {
-    var creds = grpc.credentials.createFromGoogleCredential(
-        fakeSuccessfulGoogleCredentials);
-    var combined_creds = grpc.credentials.combineChannelCredentials(
-        client_ssl_creds, creds);
-    var client = new Client('localhost:' + port, combined_creds,
-                            client_options);
-    var call = client.unary({}, function(err, data) {
-      assert.ifError(err);
-    });
-    call.on('metadata', function(metadata) {
-      assert.deepEqual(metadata.get('authorization'), ['success']);
-      done();
-    });
-  });
-  it('Should not add metadata with just SSL credentials', function(done) {
-    // Tests idempotency of credentials composition
-    var metadataUpdater = function(service_url, callback) {
-      var metadata = new grpc.Metadata();
-      metadata.set('plugin_key', 'plugin_value');
-      callback(null, metadata);
-    };
-    var creds = grpc.credentials.createFromMetadataGenerator(metadataUpdater);
-    grpc.credentials.combineChannelCredentials(client_ssl_creds, creds);
-    var client = new Client('localhost:' + port, client_ssl_creds,
-                            client_options);
-    var call = client.unary({}, function(err, data) {
-      assert.ifError(err);
-    });
-    call.on('metadata', function(metadata) {
-      assert.deepEqual(metadata.get('plugin_key'), []);
-      done();
-    });
-  });
-  it('should get an error from a Google credential', function(done) {
-    var creds = grpc.credentials.createFromGoogleCredential(
-        fakeFailingGoogleCredentials);
-    var combined_creds = grpc.credentials.combineChannelCredentials(
-        client_ssl_creds, creds);
-    var client = new Client('localhost:' + port, combined_creds,
-                            client_options);
-    client.unary({}, function(err, data) {
-      assert(err);
-      assert.strictEqual(err.message,
-                         'Getting metadata from plugin failed with error: ' +
-                         'Authentication failure');
-      done();
-    });
-  });
-  describe('Per-rpc creds', function() {
-    var client;
-    var updater_creds;
-    before(function() {
-      client = new Client('localhost:' + port, client_ssl_creds,
-                          client_options);
-      var metadataUpdater = function(service_url, callback) {
-        var metadata = new grpc.Metadata();
-        metadata.set('plugin_key', 'plugin_value');
-        callback(null, metadata);
-      };
-      updater_creds = grpc.credentials.createFromMetadataGenerator(
-          metadataUpdater);
-    });
-    it('Should update metadata on a unary call', function(done) {
-      var call = client.unary({}, {credentials: updater_creds},
-                              function(err, data) {
-                                assert.ifError(err);
-                              });
-      call.on('metadata', function(metadata) {
-        assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']);
-        done();
-      });
-    });
-    it('should update metadata on a client streaming call', function(done) {
-      var call = client.clientStream({credentials: updater_creds},
-                                     function(err, data) {
-                                       assert.ifError(err);
-                                     });
-      call.on('metadata', function(metadata) {
-        assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']);
-        done();
-      });
-      call.end();
-    });
-    it('should update metadata on a server streaming call', function(done) {
-      var call = client.serverStream({}, {credentials: updater_creds});
-      call.on('data', function() {});
-      call.on('metadata', function(metadata) {
-        assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']);
-        done();
-      });
-    });
-    it('should update metadata on a bidi streaming call', function(done) {
-      var call = client.bidiStream({credentials: updater_creds});
-      call.on('data', function() {});
-      call.on('metadata', function(metadata) {
-        assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']);
-        done();
-      });
-      call.end();
-    });
-    it('should be able to use multiple plugin credentials', function(done) {
-      var altMetadataUpdater = function(service_url, callback) {
-        var metadata = new grpc.Metadata();
-        metadata.set('other_plugin_key', 'other_plugin_value');
-        callback(null, metadata);
-      };
-      var alt_updater_creds = grpc.credentials.createFromMetadataGenerator(
-          altMetadataUpdater);
-      var combined_updater = grpc.credentials.combineCallCredentials(
-          updater_creds, alt_updater_creds);
-      var call = client.unary({}, {credentials: combined_updater},
-                              function(err, data) {
-                                assert.ifError(err);
-                              });
-      call.on('metadata', function(metadata) {
-        assert.deepEqual(metadata.get('plugin_key'), ['plugin_value']);
-        assert.deepEqual(metadata.get('other_plugin_key'),
-                         ['other_plugin_value']);
-        done();
-      });
-    });
-  });
-});
diff --git a/src/node/test/data/README b/src/node/test/data/README
deleted file mode 100644
index 888d95b..0000000
--- a/src/node/test/data/README
+++ /dev/null
@@ -1 +0,0 @@
-CONFIRMEDTESTKEY
diff --git a/src/node/test/data/ca.pem b/src/node/test/data/ca.pem
deleted file mode 100644
index 6c8511a..0000000
--- a/src/node/test/data/ca.pem
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICSjCCAbOgAwIBAgIJAJHGGR4dGioHMA0GCSqGSIb3DQEBCwUAMFYxCzAJBgNV
-BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
-aWRnaXRzIFB0eSBMdGQxDzANBgNVBAMTBnRlc3RjYTAeFw0xNDExMTEyMjMxMjla
-Fw0yNDExMDgyMjMxMjlaMFYxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0
-YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMT
-BnRlc3RjYTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwEDfBV5MYdlHVHJ7
-+L4nxrZy7mBfAVXpOc5vMYztssUI7mL2/iYujiIXM+weZYNTEpLdjyJdu7R5gGUu
-g1jSVK/EPHfc74O7AyZU34PNIP4Sh33N+/A5YexrNgJlPY+E3GdVYi4ldWJjgkAd
-Qah2PH5ACLrIIC6tRka9hcaBlIECAwEAAaMgMB4wDAYDVR0TBAUwAwEB/zAOBgNV
-HQ8BAf8EBAMCAgQwDQYJKoZIhvcNAQELBQADgYEAHzC7jdYlzAVmddi/gdAeKPau
-sPBG/C2HCWqHzpCUHcKuvMzDVkY/MP2o6JIW2DBbY64bO/FceExhjcykgaYtCH/m
-oIU63+CFOTtR7otyQAWHqXa7q4SbCDlG7DyRFxqG0txPtGvy12lgldA2+RgcigQG
-Dfcog5wrJytaQ6UA0wE=
------END CERTIFICATE-----
diff --git a/src/node/test/data/server1.key b/src/node/test/data/server1.key
deleted file mode 100644
index 143a5b8..0000000
--- a/src/node/test/data/server1.key
+++ /dev/null
@@ -1,16 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAOHDFScoLCVJpYDD
-M4HYtIdV6Ake/sMNaaKdODjDMsux/4tDydlumN+fm+AjPEK5GHhGn1BgzkWF+slf
-3BxhrA/8dNsnunstVA7ZBgA/5qQxMfGAq4wHNVX77fBZOgp9VlSMVfyd9N8YwbBY
-AckOeUQadTi2X1S6OgJXgQ0m3MWhAgMBAAECgYAn7qGnM2vbjJNBm0VZCkOkTIWm
-V10okw7EPJrdL2mkre9NasghNXbE1y5zDshx5Nt3KsazKOxTT8d0Jwh/3KbaN+YY
-tTCbKGW0pXDRBhwUHRcuRzScjli8Rih5UOCiZkhefUTcRb6xIhZJuQy71tjaSy0p
-dHZRmYyBYO2YEQ8xoQJBAPrJPhMBkzmEYFtyIEqAxQ/o/A6E+E4w8i+KM7nQCK7q
-K4JXzyXVAjLfyBZWHGM2uro/fjqPggGD6QH1qXCkI4MCQQDmdKeb2TrKRh5BY1LR
-81aJGKcJ2XbcDu6wMZK4oqWbTX2KiYn9GB0woM6nSr/Y6iy1u145YzYxEV/iMwff
-DJULAkB8B2MnyzOg0pNFJqBJuH29bKCcHa8gHJzqXhNO5lAlEbMK95p/P2Wi+4Hd
-aiEIAF1BF326QJcvYKmwSmrORp85AkAlSNxRJ50OWrfMZnBgzVjDx3xG6KsFQVk2
-ol6VhqL6dFgKUORFUWBvnKSyhjJxurlPEahV6oo6+A+mPhFY8eUvAkAZQyTdupP3
-XEFQKctGz+9+gKkemDp7LBBMEMBXrGTLPhpEfcjv/7KPdnFHYmhYeBTBnuVmTVWe
-F98XJ7tIFfJq
------END PRIVATE KEY-----
diff --git a/src/node/test/data/server1.pem b/src/node/test/data/server1.pem
deleted file mode 100644
index f3d43fc..0000000
--- a/src/node/test/data/server1.pem
+++ /dev/null
@@ -1,16 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICnDCCAgWgAwIBAgIBBzANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJBVTET
-MBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQ
-dHkgTHRkMQ8wDQYDVQQDEwZ0ZXN0Y2EwHhcNMTUxMTA0MDIyMDI0WhcNMjUxMTAx
-MDIyMDI0WjBlMQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNV
-BAcTB0NoaWNhZ28xFTATBgNVBAoTDEV4YW1wbGUsIENvLjEaMBgGA1UEAxQRKi50
-ZXN0Lmdvb2dsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOHDFSco
-LCVJpYDDM4HYtIdV6Ake/sMNaaKdODjDMsux/4tDydlumN+fm+AjPEK5GHhGn1Bg
-zkWF+slf3BxhrA/8dNsnunstVA7ZBgA/5qQxMfGAq4wHNVX77fBZOgp9VlSMVfyd
-9N8YwbBYAckOeUQadTi2X1S6OgJXgQ0m3MWhAgMBAAGjazBpMAkGA1UdEwQCMAAw
-CwYDVR0PBAQDAgXgME8GA1UdEQRIMEaCECoudGVzdC5nb29nbGUuZnKCGHdhdGVy
-em9vaS50ZXN0Lmdvb2dsZS5iZYISKi50ZXN0LnlvdXR1YmUuY29thwTAqAEDMA0G
-CSqGSIb3DQEBCwUAA4GBAJFXVifQNub1LUP4JlnX5lXNlo8FxZ2a12AFQs+bzoJ6
-hM044EDjqyxUqSbVePK0ni3w1fHQB5rY9yYC5f8G7aqqTY1QOhoUk8ZTSTRpnkTh
-y4jjdvTZeLDVBlueZUTDRmy2feY5aZIU18vFDK08dTG0A87pppuv1LNIR3loveU8
------END CERTIFICATE-----
diff --git a/src/node/test/echo_service.proto b/src/node/test/echo_service.proto
deleted file mode 100644
index 0b27c8b..0000000
--- a/src/node/test/echo_service.proto
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2015 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-message EchoMessage {
-  string value = 1;
-  int32 value2 = 2;
-}
-
-service EchoService {
-  rpc Echo (EchoMessage) returns (EchoMessage);
-}
diff --git a/src/node/test/end_to_end_test.js b/src/node/test/end_to_end_test.js
deleted file mode 100644
index c11dfa9..0000000
--- a/src/node/test/end_to_end_test.js
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-var grpc = require('../src/grpc_extension');
-var constants = require('../src/constants');
-
-/**
- * This is used for testing functions with multiple asynchronous calls that
- * can happen in different orders. This should be passed the number of async
- * function invocations that can occur last, and each of those should call this
- * function's return value
- * @param {function()} done The function that should be called when a test is
- *     complete.
- * @param {number} count The number of calls to the resulting function if the
- *     test passes.
- * @return {function()} The function that should be called at the end of each
- *     sequence of asynchronous functions.
- */
-function multiDone(done, count) {
-  return function() {
-    count -= 1;
-    if (count <= 0) {
-      done();
-    }
-  };
-}
-
-var insecureCreds = grpc.ChannelCredentials.createInsecure();
-
-describe('end-to-end', function() {
-  var server;
-  var channel;
-  before(function() {
-    server = new grpc.Server();
-    var port_num = server.addHttp2Port('0.0.0.0:0',
-                                       grpc.ServerCredentials.createInsecure());
-    server.start();
-    channel = new grpc.Channel('localhost:' + port_num, insecureCreds);
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('should start and end a request without error', function(complete) {
-    var done = multiDone(complete, 2);
-    var status_text = 'xyz';
-    var call = new grpc.Call(channel,
-                             'dummy_method',
-                             Infinity);
-    var client_batch = {};
-    client_batch[grpc.opType.SEND_INITIAL_METADATA] = {};
-    client_batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
-    client_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
-    client_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-    call.startBatch(client_batch, function(err, response) {
-      assert.ifError(err);
-      assert.deepEqual(response, {
-        send_metadata: true,
-        client_close: true,
-        metadata: {},
-        status: {
-          code: constants.status.OK,
-          details: status_text,
-          metadata: {}
-        }
-      });
-      done();
-    });
-
-    server.requestCall(function(err, call_details) {
-      var new_call = call_details.new_call;
-      assert.notEqual(new_call, null);
-      var server_call = new_call.call;
-      assert.notEqual(server_call, null);
-      var server_batch = {};
-      server_batch[grpc.opType.SEND_INITIAL_METADATA] = {};
-      server_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-        metadata: {},
-        code: constants.status.OK,
-        details: status_text
-      };
-      server_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
-      server_call.startBatch(server_batch, function(err, response) {
-        assert.ifError(err);
-        assert.deepEqual(response, {
-          send_metadata: true,
-          send_status: true,
-          cancelled: false
-        });
-       done();
-      });
-    });
-  });
-  it('should successfully send and receive metadata', function(complete) {
-    var done = multiDone(complete, 2);
-    var status_text = 'xyz';
-    var call = new grpc.Call(channel,
-                             'dummy_method',
-                             Infinity);
-    var client_batch = {};
-    client_batch[grpc.opType.SEND_INITIAL_METADATA] = {
-      client_key: ['client_value']
-    };
-    client_batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
-    client_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
-    client_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-    call.startBatch(client_batch, function(err, response) {
-      assert.ifError(err);
-      assert.deepEqual(response,{
-        send_metadata: true,
-        client_close: true,
-        metadata: {server_key: ['server_value']},
-        status: {code: constants.status.OK,
-                 details: status_text,
-                 metadata: {}}
-      });
-      done();
-    });
-
-    server.requestCall(function(err, call_details) {
-      var new_call = call_details.new_call;
-      assert.notEqual(new_call, null);
-      assert.strictEqual(new_call.metadata.client_key[0],
-                         'client_value');
-      var server_call = new_call.call;
-      assert.notEqual(server_call, null);
-      var server_batch = {};
-      server_batch[grpc.opType.SEND_INITIAL_METADATA] = {
-        server_key: ['server_value']
-      };
-      server_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-        metadata: {},
-        code: constants.status.OK,
-        details: status_text
-      };
-      server_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
-      server_call.startBatch(server_batch, function(err, response) {
-        assert.ifError(err);
-        assert.deepEqual(response, {
-          send_metadata: true,
-          send_status: true,
-          cancelled: false
-        });
-       done();
-      });
-    });
-  });
-  it('should send and receive data without error', function(complete) {
-    var req_text = 'client_request';
-    var reply_text = 'server_response';
-    var done = multiDone(complete, 2);
-    var status_text = 'success';
-    var call = new grpc.Call(channel,
-                             'dummy_method',
-                             Infinity);
-    var client_batch = {};
-    client_batch[grpc.opType.SEND_INITIAL_METADATA] = {};
-    client_batch[grpc.opType.SEND_MESSAGE] = new Buffer(req_text);
-    client_batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
-    client_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
-    client_batch[grpc.opType.RECV_MESSAGE] = true;
-    client_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-    call.startBatch(client_batch, function(err, response) {
-      assert.ifError(err);
-      assert(response.send_metadata);
-      assert(response.client_close);
-      assert.deepEqual(response.metadata, {});
-      assert(response.send_message);
-      assert.strictEqual(response.read.toString(), reply_text);
-      assert.deepEqual(response.status, {code: constants.status.OK,
-                                         details: status_text,
-                                         metadata: {}});
-      done();
-    });
-
-    server.requestCall(function(err, call_details) {
-      var new_call = call_details.new_call;
-      assert.notEqual(new_call, null);
-      var server_call = new_call.call;
-      assert.notEqual(server_call, null);
-      var server_batch = {};
-      server_batch[grpc.opType.SEND_INITIAL_METADATA] = {};
-      server_batch[grpc.opType.RECV_MESSAGE] = true;
-      server_call.startBatch(server_batch, function(err, response) {
-        assert.ifError(err);
-        assert(response.send_metadata);
-        assert.strictEqual(response.read.toString(), req_text);
-        var response_batch = {};
-        response_batch[grpc.opType.SEND_MESSAGE] = new Buffer(reply_text);
-        response_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-          metadata: {},
-          code: constants.status.OK,
-          details: status_text
-        };
-        response_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
-        server_call.startBatch(response_batch, function(err, response) {
-          assert(response.send_status);
-          assert(!response.cancelled);
-          done();
-        });
-      });
-    });
-  });
-  it('should send multiple messages', function(complete) {
-    var done = multiDone(complete, 2);
-    var requests = ['req1', 'req2'];
-    var status_text = 'xyz';
-    var call = new grpc.Call(channel,
-                             'dummy_method',
-                             Infinity);
-    var client_batch = {};
-    client_batch[grpc.opType.SEND_INITIAL_METADATA] = {};
-    client_batch[grpc.opType.SEND_MESSAGE] = new Buffer(requests[0]);
-    client_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
-    call.startBatch(client_batch, function(err, response) {
-      assert.ifError(err);
-      assert.deepEqual(response, {
-        send_metadata: true,
-        send_message: true,
-        metadata: {}
-      });
-      var req2_batch = {};
-      req2_batch[grpc.opType.SEND_MESSAGE] = new Buffer(requests[1]);
-      req2_batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
-      req2_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
-      call.startBatch(req2_batch, function(err, resp) {
-        assert.ifError(err);
-        assert.deepEqual(resp, {
-          send_message: true,
-          client_close: true,
-          status: {
-            code: constants.status.OK,
-            details: status_text,
-            metadata: {}
-          }
-        });
-        done();
-      });
-    });
-
-    server.requestCall(function(err, call_details) {
-      var new_call = call_details.new_call;
-      assert.notEqual(new_call, null);
-      var server_call = new_call.call;
-      assert.notEqual(server_call, null);
-      var server_batch = {};
-      server_batch[grpc.opType.SEND_INITIAL_METADATA] = {};
-      server_batch[grpc.opType.RECV_MESSAGE] = true;
-      server_call.startBatch(server_batch, function(err, response) {
-        assert.ifError(err);
-        assert(response.send_metadata);
-        assert.strictEqual(response.read.toString(), requests[0]);
-        var snd_batch = {};
-        snd_batch[grpc.opType.RECV_MESSAGE] = true;
-        server_call.startBatch(snd_batch, function(err, response) {
-          assert.ifError(err);
-          assert.strictEqual(response.read.toString(), requests[1]);
-          var end_batch = {};
-          end_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
-          end_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
-            metadata: {},
-            code: constants.status.OK,
-            details: status_text
-          };
-          server_call.startBatch(end_batch, function(err, response) {
-            assert.ifError(err);
-            assert(response.send_status);
-            assert(!response.cancelled);
-            done();
-          });
-        });
-      });
-    });
-  });
-});
diff --git a/src/node/test/health_test.js b/src/node/test/health_test.js
deleted file mode 100644
index dc00864..0000000
--- a/src/node/test/health_test.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-
-var health = require('../health_check/health');
-
-var health_messages = require('../health_check/v1/health_pb');
-
-var ServingStatus = health_messages.HealthCheckResponse.ServingStatus;
-
-var grpc = require('../');
-
-describe('Health Checking', function() {
-  var statusMap = {
-    '': ServingStatus.SERVING,
-    'grpc.test.TestServiceNotServing': ServingStatus.NOT_SERVING,
-    'grpc.test.TestServiceServing': ServingStatus.SERVING
-  };
-  var healthServer;
-  var healthImpl;
-  var healthClient;
-  before(function() {
-    healthServer = new grpc.Server();
-    healthImpl = new health.Implementation(statusMap);
-    healthServer.addService(health.service, healthImpl);
-    var port_num = healthServer.bind('0.0.0.0:0',
-                                     grpc.ServerCredentials.createInsecure());
-    healthServer.start();
-    healthClient = new health.Client('localhost:' + port_num,
-                                     grpc.credentials.createInsecure());
-  });
-  after(function() {
-    healthServer.forceShutdown();
-  });
-  it('should say an enabled service is SERVING', function(done) {
-    var request = new health_messages.HealthCheckRequest();
-    request.setService('');
-    healthClient.check(request, function(err, response) {
-      assert.ifError(err);
-      assert.strictEqual(response.getStatus(), ServingStatus.SERVING);
-      done();
-    });
-  });
-  it('should say that a disabled service is NOT_SERVING', function(done) {
-    var request = new health_messages.HealthCheckRequest();
-    request.setService('grpc.test.TestServiceNotServing');
-    healthClient.check(request, function(err, response) {
-      assert.ifError(err);
-      assert.strictEqual(response.getStatus(), ServingStatus.NOT_SERVING);
-      done();
-    });
-  });
-  it('should say that an enabled service is SERVING', function(done) {
-    var request = new health_messages.HealthCheckRequest();
-    request.setService('grpc.test.TestServiceServing');
-    healthClient.check(request, function(err, response) {
-      assert.ifError(err);
-      assert.strictEqual(response.getStatus(), ServingStatus.SERVING);
-      done();
-    });
-  });
-  it('should get NOT_FOUND if the service is not registered', function(done) {
-    var request = new health_messages.HealthCheckRequest();
-    request.setService('not_registered');
-    healthClient.check(request, function(err, response) {
-      assert(err);
-      assert.strictEqual(err.code, grpc.status.NOT_FOUND);
-      done();
-    });
-  });
-  it('should get a different response if the status changes', function(done) {
-    var request = new health_messages.HealthCheckRequest();
-    request.setService('transient');
-    healthClient.check(request, function(err, response) {
-      assert(err);
-      assert.strictEqual(err.code, grpc.status.NOT_FOUND);
-      healthImpl.setStatus('transient', ServingStatus.SERVING);
-      healthClient.check(request, function(err, response) {
-        assert.ifError(err);
-        assert.strictEqual(response.getStatus(), ServingStatus.SERVING);
-        done();
-      });
-    });
-  });
-});
diff --git a/src/node/test/interop_sanity_test.js b/src/node/test/interop_sanity_test.js
deleted file mode 100644
index b3f65a0..0000000
--- a/src/node/test/interop_sanity_test.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var interop_server = require('../interop/interop_server.js');
-var interop_client = require('../interop/interop_client.js');
-
-var server;
-
-var port;
-
-var name_override = 'foo.test.google.fr';
-
-describe('Interop tests', function() {
-  before(function(done) {
-    var server_obj = interop_server.getServer(0, true);
-    server = server_obj.server;
-    server.start();
-    port = 'localhost:' + server_obj.port;
-    done();
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  // This depends on not using a binary stream
-  it('should pass empty_unary', function(done) {
-    interop_client.runTest(port, name_override, 'empty_unary', true, true,
-                           done);
-  });
-  // This fails due to an unknown bug
-  it('should pass large_unary', function(done) {
-    interop_client.runTest(port, name_override, 'large_unary', true, true,
-                           done);
-  });
-  it('should pass client_streaming', function(done) {
-    interop_client.runTest(port, name_override, 'client_streaming', true, true,
-                           done);
-  });
-  it('should pass server_streaming', function(done) {
-    interop_client.runTest(port, name_override, 'server_streaming', true, true,
-                           done);
-  });
-  it('should pass ping_pong', function(done) {
-    interop_client.runTest(port, name_override, 'ping_pong', true, true, done);
-  });
-  it('should pass empty_stream', function(done) {
-    interop_client.runTest(port, name_override, 'empty_stream', true, true,
-                           done);
-  });
-  it('should pass cancel_after_begin', function(done) {
-    interop_client.runTest(port, name_override, 'cancel_after_begin', true,
-                           true, done);
-  });
-  it('should pass cancel_after_first_response', function(done) {
-    interop_client.runTest(port, name_override, 'cancel_after_first_response',
-                           true, true, done);
-  });
-  it('should pass timeout_on_sleeping_server', function(done) {
-    interop_client.runTest(port, name_override, 'timeout_on_sleeping_server',
-                           true, true, done);
-  });
-  it('should pass custom_metadata', function(done) {
-    interop_client.runTest(port, name_override, 'custom_metadata',
-                           true, true, done);
-  });
-  it('should pass status_code_and_message', function(done) {
-    interop_client.runTest(port, name_override, 'status_code_and_message',
-                           true, true, done);
-  });
-  it('should pass unimplemented_service', function(done) {
-    interop_client.runTest(port, name_override, 'unimplemented_service',
-                           true, true, done);
-  });
-  it('should pass unimplemented_method', function(done) {
-    interop_client.runTest(port, name_override, 'unimplemented_method',
-                           true, true, done);
-  });
-});
diff --git a/src/node/test/math/math_grpc_pb.js b/src/node/test/math/math_grpc_pb.js
deleted file mode 100644
index afd08a3..0000000
--- a/src/node/test/math/math_grpc_pb.js
+++ /dev/null
@@ -1,125 +0,0 @@
-// GENERATED CODE -- DO NOT EDIT!
-
-// Original file comments:
-// Copyright 2015 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-'use strict';
-var grpc = require('grpc');
-var math_math_pb = require('../math/math_pb.js');
-
-function serialize_DivArgs(arg) {
-  if (!(arg instanceof math_math_pb.DivArgs)) {
-    throw new Error('Expected argument of type DivArgs');
-  }
-  return new Buffer(arg.serializeBinary());
-}
-
-function deserialize_DivArgs(buffer_arg) {
-  return math_math_pb.DivArgs.deserializeBinary(new Uint8Array(buffer_arg));
-}
-
-function serialize_DivReply(arg) {
-  if (!(arg instanceof math_math_pb.DivReply)) {
-    throw new Error('Expected argument of type DivReply');
-  }
-  return new Buffer(arg.serializeBinary());
-}
-
-function deserialize_DivReply(buffer_arg) {
-  return math_math_pb.DivReply.deserializeBinary(new Uint8Array(buffer_arg));
-}
-
-function serialize_FibArgs(arg) {
-  if (!(arg instanceof math_math_pb.FibArgs)) {
-    throw new Error('Expected argument of type FibArgs');
-  }
-  return new Buffer(arg.serializeBinary());
-}
-
-function deserialize_FibArgs(buffer_arg) {
-  return math_math_pb.FibArgs.deserializeBinary(new Uint8Array(buffer_arg));
-}
-
-function serialize_Num(arg) {
-  if (!(arg instanceof math_math_pb.Num)) {
-    throw new Error('Expected argument of type Num');
-  }
-  return new Buffer(arg.serializeBinary());
-}
-
-function deserialize_Num(buffer_arg) {
-  return math_math_pb.Num.deserializeBinary(new Uint8Array(buffer_arg));
-}
-
-
-var MathService = exports.MathService = {
-  // Div divides args.dividend by args.divisor and returns the quotient and
-  // remainder.
-  div: {
-    path: '/math.Math/Div',
-    requestStream: false,
-    responseStream: false,
-    requestType: math_math_pb.DivArgs,
-    responseType: math_math_pb.DivReply,
-    requestSerialize: serialize_DivArgs,
-    requestDeserialize: deserialize_DivArgs,
-    responseSerialize: serialize_DivReply,
-    responseDeserialize: deserialize_DivReply,
-  },
-  // DivMany accepts an arbitrary number of division args from the client stream
-  // and sends back the results in the reply stream.  The stream continues until
-  // the client closes its end; the server does the same after sending all the
-  // replies.  The stream ends immediately if either end aborts.
-  divMany: {
-    path: '/math.Math/DivMany',
-    requestStream: true,
-    responseStream: true,
-    requestType: math_math_pb.DivArgs,
-    responseType: math_math_pb.DivReply,
-    requestSerialize: serialize_DivArgs,
-    requestDeserialize: deserialize_DivArgs,
-    responseSerialize: serialize_DivReply,
-    responseDeserialize: deserialize_DivReply,
-  },
-  // Fib generates numbers in the Fibonacci sequence.  If args.limit > 0, Fib
-  // generates up to limit numbers; otherwise it continues until the call is
-  // canceled.  Unlike Fib above, Fib has no final FibReply.
-  fib: {
-    path: '/math.Math/Fib',
-    requestStream: false,
-    responseStream: true,
-    requestType: math_math_pb.FibArgs,
-    responseType: math_math_pb.Num,
-    requestSerialize: serialize_FibArgs,
-    requestDeserialize: deserialize_FibArgs,
-    responseSerialize: serialize_Num,
-    responseDeserialize: deserialize_Num,
-  },
-  // Sum sums a stream of numbers, returning the final result once the stream
-  // is closed.
-  sum: {
-    path: '/math.Math/Sum',
-    requestStream: true,
-    responseStream: false,
-    requestType: math_math_pb.Num,
-    responseType: math_math_pb.Num,
-    requestSerialize: serialize_Num,
-    requestDeserialize: deserialize_Num,
-    responseSerialize: serialize_Num,
-    responseDeserialize: deserialize_Num,
-  },
-};
-
-exports.MathClient = grpc.makeGenericClientConstructor(MathService);
diff --git a/src/node/test/math/math_pb.js b/src/node/test/math/math_pb.js
deleted file mode 100644
index ccc05c6..0000000
--- a/src/node/test/math/math_pb.js
+++ /dev/null
@@ -1,866 +0,0 @@
-/**
- * @fileoverview
- * @enhanceable
- * @public
- */
-// GENERATED CODE -- DO NOT EDIT!
-
-var jspb = require('google-protobuf');
-var goog = jspb;
-var global = Function('return this')();
-
-goog.exportSymbol('proto.math.DivArgs', null, global);
-goog.exportSymbol('proto.math.DivReply', null, global);
-goog.exportSymbol('proto.math.FibArgs', null, global);
-goog.exportSymbol('proto.math.FibReply', null, global);
-goog.exportSymbol('proto.math.Num', null, global);
-
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.math.DivArgs = function(opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.math.DivArgs, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
-  proto.math.DivArgs.displayName = 'proto.math.DivArgs';
-}
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto suitable for use in Soy templates.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
- * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.math.DivArgs.prototype.toObject = function(opt_includeInstance) {
-  return proto.math.DivArgs.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
- *     http://goto/soy-param-migration
- * @param {!proto.math.DivArgs} msg The msg instance to transform.
- * @return {!Object}
- */
-proto.math.DivArgs.toObject = function(includeInstance, msg) {
-  var f, obj = {
-    dividend: msg.getDividend(),
-    divisor: msg.getDivisor()
-  };
-
-  if (includeInstance) {
-    obj.$jspbMessageInstance = msg;
-  }
-  return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.math.DivArgs}
- */
-proto.math.DivArgs.deserializeBinary = function(bytes) {
-  var reader = new jspb.BinaryReader(bytes);
-  var msg = new proto.math.DivArgs;
-  return proto.math.DivArgs.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.math.DivArgs} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.math.DivArgs}
- */
-proto.math.DivArgs.deserializeBinaryFromReader = function(msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break;
-    }
-    var field = reader.getFieldNumber();
-    switch (field) {
-    case 1:
-      var value = /** @type {number} */ (reader.readInt64());
-      msg.setDividend(value);
-      break;
-    case 2:
-      var value = /** @type {number} */ (reader.readInt64());
-      msg.setDivisor(value);
-      break;
-    default:
-      reader.skipField();
-      break;
-    }
-  }
-  return msg;
-};
-
-
-/**
- * Class method variant: serializes the given message to binary data
- * (in protobuf wire format), writing to the given BinaryWriter.
- * @param {!proto.math.DivArgs} message
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.DivArgs.serializeBinaryToWriter = function(message, writer) {
-  message.serializeBinaryToWriter(writer);
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.math.DivArgs.prototype.serializeBinary = function() {
-  var writer = new jspb.BinaryWriter();
-  this.serializeBinaryToWriter(writer);
-  return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format),
- * writing to the given BinaryWriter.
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.DivArgs.prototype.serializeBinaryToWriter = function (writer) {
-  var f = undefined;
-  f = this.getDividend();
-  if (f !== 0) {
-    writer.writeInt64(
-      1,
-      f
-    );
-  }
-  f = this.getDivisor();
-  if (f !== 0) {
-    writer.writeInt64(
-      2,
-      f
-    );
-  }
-};
-
-
-/**
- * Creates a deep clone of this proto. No data is shared with the original.
- * @return {!proto.math.DivArgs} The clone.
- */
-proto.math.DivArgs.prototype.cloneMessage = function() {
-  return /** @type {!proto.math.DivArgs} */ (jspb.Message.cloneMessage(this));
-};
-
-
-/**
- * optional int64 dividend = 1;
- * @return {number}
- */
-proto.math.DivArgs.prototype.getDividend = function() {
-  return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
-};
-
-
-/** @param {number} value  */
-proto.math.DivArgs.prototype.setDividend = function(value) {
-  jspb.Message.setField(this, 1, value);
-};
-
-
-/**
- * optional int64 divisor = 2;
- * @return {number}
- */
-proto.math.DivArgs.prototype.getDivisor = function() {
-  return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
-};
-
-
-/** @param {number} value  */
-proto.math.DivArgs.prototype.setDivisor = function(value) {
-  jspb.Message.setField(this, 2, value);
-};
-
-
-
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.math.DivReply = function(opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.math.DivReply, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
-  proto.math.DivReply.displayName = 'proto.math.DivReply';
-}
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto suitable for use in Soy templates.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
- * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.math.DivReply.prototype.toObject = function(opt_includeInstance) {
-  return proto.math.DivReply.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
- *     http://goto/soy-param-migration
- * @param {!proto.math.DivReply} msg The msg instance to transform.
- * @return {!Object}
- */
-proto.math.DivReply.toObject = function(includeInstance, msg) {
-  var f, obj = {
-    quotient: msg.getQuotient(),
-    remainder: msg.getRemainder()
-  };
-
-  if (includeInstance) {
-    obj.$jspbMessageInstance = msg;
-  }
-  return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.math.DivReply}
- */
-proto.math.DivReply.deserializeBinary = function(bytes) {
-  var reader = new jspb.BinaryReader(bytes);
-  var msg = new proto.math.DivReply;
-  return proto.math.DivReply.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.math.DivReply} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.math.DivReply}
- */
-proto.math.DivReply.deserializeBinaryFromReader = function(msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break;
-    }
-    var field = reader.getFieldNumber();
-    switch (field) {
-    case 1:
-      var value = /** @type {number} */ (reader.readInt64());
-      msg.setQuotient(value);
-      break;
-    case 2:
-      var value = /** @type {number} */ (reader.readInt64());
-      msg.setRemainder(value);
-      break;
-    default:
-      reader.skipField();
-      break;
-    }
-  }
-  return msg;
-};
-
-
-/**
- * Class method variant: serializes the given message to binary data
- * (in protobuf wire format), writing to the given BinaryWriter.
- * @param {!proto.math.DivReply} message
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.DivReply.serializeBinaryToWriter = function(message, writer) {
-  message.serializeBinaryToWriter(writer);
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.math.DivReply.prototype.serializeBinary = function() {
-  var writer = new jspb.BinaryWriter();
-  this.serializeBinaryToWriter(writer);
-  return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format),
- * writing to the given BinaryWriter.
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.DivReply.prototype.serializeBinaryToWriter = function (writer) {
-  var f = undefined;
-  f = this.getQuotient();
-  if (f !== 0) {
-    writer.writeInt64(
-      1,
-      f
-    );
-  }
-  f = this.getRemainder();
-  if (f !== 0) {
-    writer.writeInt64(
-      2,
-      f
-    );
-  }
-};
-
-
-/**
- * Creates a deep clone of this proto. No data is shared with the original.
- * @return {!proto.math.DivReply} The clone.
- */
-proto.math.DivReply.prototype.cloneMessage = function() {
-  return /** @type {!proto.math.DivReply} */ (jspb.Message.cloneMessage(this));
-};
-
-
-/**
- * optional int64 quotient = 1;
- * @return {number}
- */
-proto.math.DivReply.prototype.getQuotient = function() {
-  return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
-};
-
-
-/** @param {number} value  */
-proto.math.DivReply.prototype.setQuotient = function(value) {
-  jspb.Message.setField(this, 1, value);
-};
-
-
-/**
- * optional int64 remainder = 2;
- * @return {number}
- */
-proto.math.DivReply.prototype.getRemainder = function() {
-  return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
-};
-
-
-/** @param {number} value  */
-proto.math.DivReply.prototype.setRemainder = function(value) {
-  jspb.Message.setField(this, 2, value);
-};
-
-
-
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.math.FibArgs = function(opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.math.FibArgs, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
-  proto.math.FibArgs.displayName = 'proto.math.FibArgs';
-}
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto suitable for use in Soy templates.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
- * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.math.FibArgs.prototype.toObject = function(opt_includeInstance) {
-  return proto.math.FibArgs.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
- *     http://goto/soy-param-migration
- * @param {!proto.math.FibArgs} msg The msg instance to transform.
- * @return {!Object}
- */
-proto.math.FibArgs.toObject = function(includeInstance, msg) {
-  var f, obj = {
-    limit: msg.getLimit()
-  };
-
-  if (includeInstance) {
-    obj.$jspbMessageInstance = msg;
-  }
-  return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.math.FibArgs}
- */
-proto.math.FibArgs.deserializeBinary = function(bytes) {
-  var reader = new jspb.BinaryReader(bytes);
-  var msg = new proto.math.FibArgs;
-  return proto.math.FibArgs.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.math.FibArgs} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.math.FibArgs}
- */
-proto.math.FibArgs.deserializeBinaryFromReader = function(msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break;
-    }
-    var field = reader.getFieldNumber();
-    switch (field) {
-    case 1:
-      var value = /** @type {number} */ (reader.readInt64());
-      msg.setLimit(value);
-      break;
-    default:
-      reader.skipField();
-      break;
-    }
-  }
-  return msg;
-};
-
-
-/**
- * Class method variant: serializes the given message to binary data
- * (in protobuf wire format), writing to the given BinaryWriter.
- * @param {!proto.math.FibArgs} message
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.FibArgs.serializeBinaryToWriter = function(message, writer) {
-  message.serializeBinaryToWriter(writer);
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.math.FibArgs.prototype.serializeBinary = function() {
-  var writer = new jspb.BinaryWriter();
-  this.serializeBinaryToWriter(writer);
-  return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format),
- * writing to the given BinaryWriter.
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.FibArgs.prototype.serializeBinaryToWriter = function (writer) {
-  var f = undefined;
-  f = this.getLimit();
-  if (f !== 0) {
-    writer.writeInt64(
-      1,
-      f
-    );
-  }
-};
-
-
-/**
- * Creates a deep clone of this proto. No data is shared with the original.
- * @return {!proto.math.FibArgs} The clone.
- */
-proto.math.FibArgs.prototype.cloneMessage = function() {
-  return /** @type {!proto.math.FibArgs} */ (jspb.Message.cloneMessage(this));
-};
-
-
-/**
- * optional int64 limit = 1;
- * @return {number}
- */
-proto.math.FibArgs.prototype.getLimit = function() {
-  return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
-};
-
-
-/** @param {number} value  */
-proto.math.FibArgs.prototype.setLimit = function(value) {
-  jspb.Message.setField(this, 1, value);
-};
-
-
-
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.math.Num = function(opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.math.Num, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
-  proto.math.Num.displayName = 'proto.math.Num';
-}
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto suitable for use in Soy templates.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
- * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.math.Num.prototype.toObject = function(opt_includeInstance) {
-  return proto.math.Num.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
- *     http://goto/soy-param-migration
- * @param {!proto.math.Num} msg The msg instance to transform.
- * @return {!Object}
- */
-proto.math.Num.toObject = function(includeInstance, msg) {
-  var f, obj = {
-    num: msg.getNum()
-  };
-
-  if (includeInstance) {
-    obj.$jspbMessageInstance = msg;
-  }
-  return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.math.Num}
- */
-proto.math.Num.deserializeBinary = function(bytes) {
-  var reader = new jspb.BinaryReader(bytes);
-  var msg = new proto.math.Num;
-  return proto.math.Num.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.math.Num} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.math.Num}
- */
-proto.math.Num.deserializeBinaryFromReader = function(msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break;
-    }
-    var field = reader.getFieldNumber();
-    switch (field) {
-    case 1:
-      var value = /** @type {number} */ (reader.readInt64());
-      msg.setNum(value);
-      break;
-    default:
-      reader.skipField();
-      break;
-    }
-  }
-  return msg;
-};
-
-
-/**
- * Class method variant: serializes the given message to binary data
- * (in protobuf wire format), writing to the given BinaryWriter.
- * @param {!proto.math.Num} message
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.Num.serializeBinaryToWriter = function(message, writer) {
-  message.serializeBinaryToWriter(writer);
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.math.Num.prototype.serializeBinary = function() {
-  var writer = new jspb.BinaryWriter();
-  this.serializeBinaryToWriter(writer);
-  return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format),
- * writing to the given BinaryWriter.
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.Num.prototype.serializeBinaryToWriter = function (writer) {
-  var f = undefined;
-  f = this.getNum();
-  if (f !== 0) {
-    writer.writeInt64(
-      1,
-      f
-    );
-  }
-};
-
-
-/**
- * Creates a deep clone of this proto. No data is shared with the original.
- * @return {!proto.math.Num} The clone.
- */
-proto.math.Num.prototype.cloneMessage = function() {
-  return /** @type {!proto.math.Num} */ (jspb.Message.cloneMessage(this));
-};
-
-
-/**
- * optional int64 num = 1;
- * @return {number}
- */
-proto.math.Num.prototype.getNum = function() {
-  return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
-};
-
-
-/** @param {number} value  */
-proto.math.Num.prototype.setNum = function(value) {
-  jspb.Message.setField(this, 1, value);
-};
-
-
-
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.math.FibReply = function(opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.math.FibReply, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
-  proto.math.FibReply.displayName = 'proto.math.FibReply';
-}
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto suitable for use in Soy templates.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
- * For the list of reserved names please see:
- *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
- * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
- *     for transitional soy proto support: http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.math.FibReply.prototype.toObject = function(opt_includeInstance) {
-  return proto.math.FibReply.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Whether to include the JSPB
- *     instance for transitional soy proto support:
- *     http://goto/soy-param-migration
- * @param {!proto.math.FibReply} msg The msg instance to transform.
- * @return {!Object}
- */
-proto.math.FibReply.toObject = function(includeInstance, msg) {
-  var f, obj = {
-    count: msg.getCount()
-  };
-
-  if (includeInstance) {
-    obj.$jspbMessageInstance = msg;
-  }
-  return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.math.FibReply}
- */
-proto.math.FibReply.deserializeBinary = function(bytes) {
-  var reader = new jspb.BinaryReader(bytes);
-  var msg = new proto.math.FibReply;
-  return proto.math.FibReply.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.math.FibReply} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.math.FibReply}
- */
-proto.math.FibReply.deserializeBinaryFromReader = function(msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break;
-    }
-    var field = reader.getFieldNumber();
-    switch (field) {
-    case 1:
-      var value = /** @type {number} */ (reader.readInt64());
-      msg.setCount(value);
-      break;
-    default:
-      reader.skipField();
-      break;
-    }
-  }
-  return msg;
-};
-
-
-/**
- * Class method variant: serializes the given message to binary data
- * (in protobuf wire format), writing to the given BinaryWriter.
- * @param {!proto.math.FibReply} message
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.FibReply.serializeBinaryToWriter = function(message, writer) {
-  message.serializeBinaryToWriter(writer);
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.math.FibReply.prototype.serializeBinary = function() {
-  var writer = new jspb.BinaryWriter();
-  this.serializeBinaryToWriter(writer);
-  return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format),
- * writing to the given BinaryWriter.
- * @param {!jspb.BinaryWriter} writer
- */
-proto.math.FibReply.prototype.serializeBinaryToWriter = function (writer) {
-  var f = undefined;
-  f = this.getCount();
-  if (f !== 0) {
-    writer.writeInt64(
-      1,
-      f
-    );
-  }
-};
-
-
-/**
- * Creates a deep clone of this proto. No data is shared with the original.
- * @return {!proto.math.FibReply} The clone.
- */
-proto.math.FibReply.prototype.cloneMessage = function() {
-  return /** @type {!proto.math.FibReply} */ (jspb.Message.cloneMessage(this));
-};
-
-
-/**
- * optional int64 count = 1;
- * @return {number}
- */
-proto.math.FibReply.prototype.getCount = function() {
-  return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
-};
-
-
-/** @param {number} value  */
-proto.math.FibReply.prototype.setCount = function(value) {
-  jspb.Message.setField(this, 1, value);
-};
-
-
-goog.object.extend(exports, proto.math);
diff --git a/src/node/test/math/math_server.js b/src/node/test/math/math_server.js
deleted file mode 100644
index 4291ae1..0000000
--- a/src/node/test/math/math_server.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var grpc = require('../..');
-var grpcMath = require('./math_grpc_pb');
-var math = require('./math_pb');
-
-/**
- * Server function for division. Provides the /Math/DivMany and /Math/Div
- * functions (Div is just DivMany with only one stream element). For each
- * DivArgs parameter, responds with a DivReply with the results of the division
- * @param {Object} call The object containing request and cancellation info
- * @param {function(Error, *)} cb Response callback
- */
-function mathDiv(call, cb) {
-  var req = call.request;
-  var divisor = req.getDivisor();
-  var dividend = req.getDividend();
-  // Unary + is explicit coersion to integer
-  if (req.getDivisor() === 0) {
-    cb(new Error('cannot divide by zero'));
-  } else {
-    var response = new math.DivReply();
-    response.setQuotient(Math.floor(dividend / divisor));
-    response.setRemainder(dividend % divisor);
-    cb(null, response);
-  }
-}
-
-/**
- * Server function for Fibonacci numbers. Provides the /Math/Fib function. Reads
- * a single parameter that indicates the number of responses, and then responds
- * with a stream of that many Fibonacci numbers.
- * @param {stream} stream The stream for sending responses.
- */
-function mathFib(stream) {
-  // Here, call is a standard writable Node object Stream
-  var previous = 0, current = 1;
-  for (var i = 0; i < stream.request.getLimit(); i++) {
-    var response = new math.Num();
-    response.setNum(current);
-    stream.write(response);
-    var temp = current;
-    current += previous;
-    previous = temp;
-  }
-  stream.end();
-}
-
-/**
- * Server function for summation. Provides the /Math/Sum function. Reads a
- * stream of number parameters, then responds with their sum.
- * @param {stream} call The stream of arguments.
- * @param {function(Error, *)} cb Response callback
- */
-function mathSum(call, cb) {
-  // Here, call is a standard readable Node object Stream
-  var sum = 0;
-  call.on('data', function(data) {
-    sum += data.getNum();
-  });
-  call.on('end', function() {
-    var response = new math.Num();
-    response.setNum(sum);
-    cb(null, response);
-  });
-}
-
-function mathDivMany(stream) {
-  stream.on('data', function(div_args) {
-    var divisor = div_args.getDivisor();
-    var dividend = div_args.getDividend();
-    if (divisor === 0) {
-      stream.emit('error', new Error('cannot divide by zero'));
-    } else {
-      var response = new math.DivReply();
-      response.setQuotient(Math.floor(dividend / divisor));
-      response.setRemainder(dividend % divisor);
-      stream.write(response);
-    }
-  });
-  stream.on('end', function() {
-    stream.end();
-  });
-}
-
-function getMathServer() {
-  var server = new grpc.Server();
-  server.addService(grpcMath.MathService, {
-    div: mathDiv,
-    fib: mathFib,
-    sum: mathSum,
-    divMany: mathDivMany
-  });
-  return server;
-}
-
-if (require.main === module) {
-  var server = getMathServer();
-  server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
-  server.start();
-}
-
-/**
- * See docs for server
- */
-module.exports = getMathServer;
diff --git a/src/node/test/math/node_modules/grpc.js b/src/node/test/math/node_modules/grpc.js
deleted file mode 100644
index b824d8d..0000000
--- a/src/node/test/math/node_modules/grpc.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* This exists solely to allow the generated code to import the grpc module
- * without using a relative path */
-
-module.exports = require('../../..');
diff --git a/src/node/test/math_client_test.js b/src/node/test/math_client_test.js
deleted file mode 100644
index 11deda3..0000000
--- a/src/node/test/math_client_test.js
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-
-var grpc = require('..');
-var math = require('./math/math_pb');
-var MathClient = require('./math/math_grpc_pb').MathClient;
-
-/**
- * Client to use to make requests to a running server.
- */
-var math_client;
-
-/**
- * Server to test against
- */
-var getServer = require('./math/math_server.js');
-
-var server = getServer();
-
-describe('Math client', function() {
-  before(function(done) {
-    var port_num = server.bind('0.0.0.0:0',
-                               grpc.ServerCredentials.createInsecure());
-    server.start();
-    math_client = new MathClient('localhost:' + port_num,
-                                 grpc.credentials.createInsecure());
-    done();
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('should handle a single request', function(done) {
-    var arg = new math.DivArgs();
-    arg.setDividend(7);
-    arg.setDivisor(4);
-    math_client.div(arg, function handleDivResult(err, value) {
-      assert.ifError(err);
-      assert.equal(value.getQuotient(), 1);
-      assert.equal(value.getRemainder(), 3);
-      done();
-    });
-  });
-  it('should handle an error from a unary request', function(done) {
-    var arg = new math.DivArgs();
-    arg.setDividend(7);
-    arg.setDivisor(0);
-    math_client.div(arg, function handleDivResult(err, value) {
-      assert(err);
-      done();
-    });
-  });
-  it('should handle a server streaming request', function(done) {
-    var arg = new math.FibArgs();
-    arg.setLimit(7);
-    var call = math_client.fib(arg);
-    var expected_results = [1, 1, 2, 3, 5, 8, 13];
-    var next_expected = 0;
-    call.on('data', function checkResponse(value) {
-      assert.equal(value.getNum(), expected_results[next_expected]);
-      next_expected += 1;
-    });
-    call.on('status', function checkStatus(status) {
-      assert.strictEqual(status.code, grpc.status.OK);
-      done();
-    });
-  });
-  it('should handle a client streaming request', function(done) {
-    var call = math_client.sum(function handleSumResult(err, value) {
-      assert.ifError(err);
-      assert.equal(value.getNum(), 21);
-    });
-    for (var i = 0; i < 7; i++) {
-      var arg = new math.Num();
-      arg.setNum(i);
-      call.write(arg);
-    }
-    call.end();
-    call.on('status', function checkStatus(status) {
-      assert.strictEqual(status.code, grpc.status.OK);
-      done();
-    });
-  });
-  it('should handle a bidirectional streaming request', function(done) {
-    function checkResponse(index, value) {
-      assert.equal(value.getQuotient(), index);
-      assert.equal(value.getRemainder(), 1);
-    }
-    var call = math_client.divMany();
-    var response_index = 0;
-    call.on('data', function(value) {
-      checkResponse(response_index, value);
-      response_index += 1;
-    });
-    for (var i = 0; i < 7; i++) {
-      var arg = new math.DivArgs();
-      arg.setDividend(2 * i + 1);
-      arg.setDivisor(2);
-      call.write(arg);
-    }
-    call.end();
-    call.on('status', function checkStatus(status) {
-      assert.strictEqual(status.code, grpc.status.OK);
-      done();
-    });
-  });
-  it('should handle an error from a bidi request', function(done) {
-    var call = math_client.divMany();
-    call.on('data', function(value) {
-      assert.fail(value, undefined, 'Unexpected data response on failing call',
-                  '!=');
-    });
-    var arg = new math.DivArgs();
-    arg.setDividend(7);
-    arg.setDivisor(0);
-    call.write(arg);
-    call.end();
-    call.on('error', function checkStatus(status) {
-      done();
-    });
-  });
-});
diff --git a/src/node/test/metadata_test.js b/src/node/test/metadata_test.js
deleted file mode 100644
index 4ba54e0..0000000
--- a/src/node/test/metadata_test.js
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var Metadata = require('../src/metadata.js');
-
-var assert = require('assert');
-
-describe('Metadata', function() {
-  var metadata;
-  beforeEach(function() {
-    metadata = new Metadata();
-  });
-  describe('#set', function() {
-    it('Only accepts string values for non "-bin" keys', function() {
-      assert.throws(function() {
-        metadata.set('key', new Buffer('value'));
-      });
-      assert.doesNotThrow(function() {
-        metadata.set('key', 'value');
-      });
-    });
-    it('Only accepts Buffer values for "-bin" keys', function() {
-      assert.throws(function() {
-        metadata.set('key-bin', 'value');
-      });
-      assert.doesNotThrow(function() {
-        metadata.set('key-bin', new Buffer('value'));
-      });
-    });
-    it('Rejects invalid keys', function() {
-      assert.throws(function() {
-        metadata.set('key$', 'value');
-      });
-      assert.throws(function() {
-        metadata.set('', 'value');
-      });
-    });
-    it('Rejects values with non-ASCII characters', function() {
-      assert.throws(function() {
-        metadata.set('key', 'résumé');
-      });
-    });
-    it('Saves values that can be retrieved', function() {
-      metadata.set('key', 'value');
-      assert.deepEqual(metadata.get('key'), ['value']);
-    });
-    it('Overwrites previous values', function() {
-      metadata.set('key', 'value1');
-      metadata.set('key', 'value2');
-      assert.deepEqual(metadata.get('key'), ['value2']);
-    });
-    it('Normalizes keys', function() {
-      metadata.set('Key', 'value1');
-      assert.deepEqual(metadata.get('key'), ['value1']);
-      metadata.set('KEY', 'value2');
-      assert.deepEqual(metadata.get('key'), ['value2']);
-    });
-  });
-  describe('#add', function() {
-    it('Only accepts string values for non "-bin" keys', function() {
-      assert.throws(function() {
-        metadata.add('key', new Buffer('value'));
-      });
-      assert.doesNotThrow(function() {
-        metadata.add('key', 'value');
-      });
-    });
-    it('Only accepts Buffer values for "-bin" keys', function() {
-      assert.throws(function() {
-        metadata.add('key-bin', 'value');
-      });
-      assert.doesNotThrow(function() {
-        metadata.add('key-bin', new Buffer('value'));
-      });
-    });
-    it('Rejects invalid keys', function() {
-      assert.throws(function() {
-        metadata.add('key$', 'value');
-      });
-      assert.throws(function() {
-        metadata.add('', 'value');
-      });
-    });
-    it('Saves values that can be retrieved', function() {
-      metadata.add('key', 'value');
-      assert.deepEqual(metadata.get('key'), ['value']);
-    });
-    it('Combines with previous values', function() {
-      metadata.add('key', 'value1');
-      metadata.add('key', 'value2');
-      assert.deepEqual(metadata.get('key'), ['value1', 'value2']);
-    });
-    it('Normalizes keys', function() {
-      metadata.add('Key', 'value1');
-      assert.deepEqual(metadata.get('key'), ['value1']);
-      metadata.add('KEY', 'value2');
-      assert.deepEqual(metadata.get('key'), ['value1', 'value2']);
-    });
-  });
-  describe('#remove', function() {
-    it('clears values from a key', function() {
-      metadata.add('key', 'value');
-      metadata.remove('key');
-      assert.deepEqual(metadata.get('key'), []);
-    });
-    it('Normalizes keys', function() {
-      metadata.add('key', 'value');
-      metadata.remove('KEY');
-      assert.deepEqual(metadata.get('key'), []);
-    });
-  });
-  describe('#get', function() {
-    beforeEach(function() {
-      metadata.add('key', 'value1');
-      metadata.add('key', 'value2');
-      metadata.add('key-bin', new Buffer('value'));
-    });
-    it('gets all values associated with a key', function() {
-      assert.deepEqual(metadata.get('key'), ['value1', 'value2']);
-    });
-    it('Normalizes keys', function() {
-      assert.deepEqual(metadata.get('KEY'), ['value1', 'value2']);
-    });
-    it('returns an empty list for non-existent keys', function() {
-      assert.deepEqual(metadata.get('non-existent-key'), []);
-    });
-    it('returns Buffers for "-bin" keys', function() {
-      assert(metadata.get('key-bin')[0] instanceof Buffer);
-    });
-  });
-  describe('#getMap', function() {
-    it('gets a map of keys to values', function() {
-      metadata.add('key1', 'value1');
-      metadata.add('Key2', 'value2');
-      metadata.add('KEY3', 'value3');
-      assert.deepEqual(metadata.getMap(),
-                       {key1: 'value1',
-                        key2: 'value2',
-                        key3: 'value3'});
-    });
-  });
-  describe('#clone', function() {
-    it('retains values from the original', function() {
-      metadata.add('key', 'value');
-      var copy = metadata.clone();
-      assert.deepEqual(copy.get('key'), ['value']);
-    });
-    it('Does not see newly added values', function() {
-      metadata.add('key', 'value1');
-      var copy = metadata.clone();
-      metadata.add('key', 'value2');
-      assert.deepEqual(copy.get('key'), ['value1']);
-    });
-    it('Does not add new values to the original', function() {
-      metadata.add('key', 'value1');
-      var copy = metadata.clone();
-      copy.add('key', 'value2');
-      assert.deepEqual(metadata.get('key'), ['value1']);
-    });
-  });
-});
diff --git a/src/node/test/numbers.txt b/src/node/test/numbers.txt
deleted file mode 100644
index 4972919..0000000
--- a/src/node/test/numbers.txt
+++ /dev/null
@@ -1,496 +0,0 @@
-1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 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 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

diff --git a/src/node/test/server_test.js b/src/node/test/server_test.js
deleted file mode 100644
index 454acbd..0000000
--- a/src/node/test/server_test.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-var fs = require('fs');
-var path = require('path');
-var grpc = require('../src/grpc_extension');
-
-describe('server', function() {
-  describe('constructor', function() {
-    it('should work with no arguments', function() {
-      assert.doesNotThrow(function() {
-        new grpc.Server();
-      });
-    });
-    it('should work with an empty object argument', function() {
-      assert.doesNotThrow(function() {
-        new grpc.Server({});
-      });
-    });
-    it('should work without the new keyword', function() {
-      var server;
-      assert.doesNotThrow(function() {
-        server = grpc.Server();
-      });
-      assert(server instanceof grpc.Server);
-    });
-    it('should only accept objects with string or int values', function() {
-      assert.doesNotThrow(function() {
-        new grpc.Server({'key' : 'value'});
-      });
-      assert.doesNotThrow(function() {
-        new grpc.Server({'key' : 5});
-      });
-      assert.throws(function() {
-        new grpc.Server({'key' : null});
-      });
-      assert.throws(function() {
-        new grpc.Server({'key' : new Date()});
-      });
-    });
-  });
-  describe('addHttp2Port', function() {
-    var server;
-    before(function() {
-      server = new grpc.Server();
-    });
-    it('should bind to an unused port', function() {
-      var port;
-      assert.doesNotThrow(function() {
-        port = server.addHttp2Port('0.0.0.0:0',
-                                   grpc.ServerCredentials.createInsecure());
-      });
-      assert(port > 0);
-    });
-    it('should bind to an unused port with ssl credentials', function() {
-      var port;
-      var key_path = path.join(__dirname, '../test/data/server1.key');
-      var pem_path = path.join(__dirname, '../test/data/server1.pem');
-      var key_data = fs.readFileSync(key_path);
-      var pem_data = fs.readFileSync(pem_path);
-      var creds = grpc.ServerCredentials.createSsl(null,
-                                                   [{private_key: key_data,
-                                                     cert_chain: pem_data}]);
-      assert.doesNotThrow(function() {
-        port = server.addHttp2Port('0.0.0.0:0', creds);
-      });
-      assert(port > 0);
-    });
-  });
-  describe('addSecureHttp2Port', function() {
-    var server;
-    before(function() {
-      server = new grpc.Server();
-    });
-  });
-  describe('start', function() {
-    var server;
-    before(function() {
-      server = new grpc.Server();
-      server.addHttp2Port('0.0.0.0:0', grpc.ServerCredentials.createInsecure());
-    });
-    after(function() {
-      server.forceShutdown();
-    });
-    it('should start without error', function() {
-      assert.doesNotThrow(function() {
-        server.start();
-      });
-    });
-  });
-  describe('shutdown', function() {
-    var server;
-    beforeEach(function() {
-      server = new grpc.Server();
-      server.addHttp2Port('0.0.0.0:0', grpc.ServerCredentials.createInsecure());
-      server.start();
-    });
-    afterEach(function() {
-      server.forceShutdown();
-    });
-    it('tryShutdown should shutdown successfully', function(done) {
-      server.tryShutdown(done);
-    });
-    it('forceShutdown should shutdown successfully', function() {
-      server.forceShutdown();
-    });
-    it('tryShutdown should be idempotent', function(done) {
-      server.tryShutdown(done);
-      server.tryShutdown(function() {});
-    });
-    it('forceShutdown should be idempotent', function() {
-      server.forceShutdown();
-      server.forceShutdown();
-    });
-    it('forceShutdown should trigger tryShutdown', function(done) {
-      server.tryShutdown(done);
-      server.forceShutdown();
-    });
-  });
-});
diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js
deleted file mode 100644
index 0b0b393..0000000
--- a/src/node/test/surface_test.js
+++ /dev/null
@@ -1,1424 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-var assert = require('assert');
-var _ = require('lodash');
-
-var surface_client = require('../src/client.js');
-var common = require('../src/common');
-
-var ProtoBuf = require('protobufjs');
-
-var grpc = require('..');
-
-var math_proto = ProtoBuf.loadProtoFile(__dirname +
-    '/../../proto/math/math.proto');
-
-var mathService = math_proto.lookup('math.Math');
-var mathServiceAttrs = grpc.loadObject(
-    mathService, common.defaultGrpcOptions).service;
-
-/**
- * This is used for testing functions with multiple asynchronous calls that
- * can happen in different orders. This should be passed the number of async
- * function invocations that can occur last, and each of those should call this
- * function's return value
- * @param {function()} done The function that should be called when a test is
- *     complete.
- * @param {number} count The number of calls to the resulting function if the
- *     test passes.
- * @return {function()} The function that should be called at the end of each
- *     sequence of asynchronous functions.
- */
-function multiDone(done, count) {
-  return function() {
-    count -= 1;
-    if (count <= 0) {
-      done();
-    }
-  };
-}
-
-var server_insecure_creds = grpc.ServerCredentials.createInsecure();
-
-describe('File loader', function() {
-  it('Should load a proto file by default', function() {
-    assert.doesNotThrow(function() {
-      grpc.load(__dirname + '/test_service.proto');
-    });
-  });
-  it('Should load a proto file with the proto format', function() {
-    assert.doesNotThrow(function() {
-      grpc.load(__dirname + '/test_service.proto', 'proto');
-    });
-  });
-  it('Should load a json file with the json format', function() {
-    assert.doesNotThrow(function() {
-      grpc.load(__dirname + '/test_service.json', 'json');
-    });
-  });
-});
-describe('surface Server', function() {
-  var server;
-  beforeEach(function() {
-    server = new grpc.Server();
-  });
-  afterEach(function() {
-    server.forceShutdown();
-  });
-  it('should error if started twice', function() {
-    server.start();
-    assert.throws(function() {
-      server.start();
-    });
-  });
-  it('should error if a port is bound after the server starts', function() {
-    server.start();
-    assert.throws(function() {
-      server.bind('localhost:0', grpc.ServerCredentials.createInsecure());
-    });
-  });
-  it('should successfully shutdown if tryShutdown is called', function(done) {
-    server.start();
-    server.tryShutdown(done);
-  });
-});
-describe('Server.prototype.addProtoService', function() {
-  var server;
-  var dummyImpls = {
-    'div': function() {},
-    'divMany': function() {},
-    'fib': function() {},
-    'sum': function() {}
-  };
-  beforeEach(function() {
-    server = new grpc.Server();
-  });
-  afterEach(function() {
-    server.forceShutdown();
-  });
-  it('Should succeed with a single proto service', function() {
-    assert.doesNotThrow(function() {
-      server.addProtoService(mathService, dummyImpls);
-    });
-  });
-  it('Should succeed with a single service attributes object', function() {
-    assert.doesNotThrow(function() {
-      server.addProtoService(mathServiceAttrs, dummyImpls);
-    });
-  });
-});
-describe('Server.prototype.addService', function() {
-  var server;
-  var dummyImpls = {
-    'div': function() {},
-    'divMany': function() {},
-    'fib': function() {},
-    'sum': function() {}
-  };
-  beforeEach(function() {
-    server = new grpc.Server();
-  });
-  afterEach(function() {
-    server.forceShutdown();
-  });
-  it('Should succeed with a single service', function() {
-    assert.doesNotThrow(function() {
-      server.addService(mathServiceAttrs, dummyImpls);
-    });
-  });
-  it('Should fail with conflicting method names', function() {
-    server.addService(mathServiceAttrs, dummyImpls);
-    assert.throws(function() {
-      server.addService(mathServiceAttrs, dummyImpls);
-    });
-  });
-  it('Should allow method names as originally written', function() {
-    var altDummyImpls = {
-      'Div': function() {},
-      'DivMany': function() {},
-      'Fib': function() {},
-      'Sum': function() {}
-    };
-    assert.doesNotThrow(function() {
-      server.addProtoService(mathService, altDummyImpls);
-    });
-  });
-  it('Should have a conflict between name variations', function() {
-    /* This is really testing that both name variations are actually used,
-       by checking that the method actually gets registered, for the
-       corresponding function, in both cases */
-    var altDummyImpls = {
-      'Div': function() {},
-      'DivMany': function() {},
-      'Fib': function() {},
-      'Sum': function() {}
-    };
-    server.addProtoService(mathService, altDummyImpls);
-    assert.throws(function() {
-      server.addProtoService(mathService, dummyImpls);
-    });
-  });
-  it('Should fail if the server has been started', function() {
-    server.start();
-    assert.throws(function() {
-      server.addService(mathServiceAttrs, dummyImpls);
-    });
-  });
-  describe('Default handlers', function() {
-    var client;
-    beforeEach(function() {
-      server.addService(mathServiceAttrs, {});
-      var port = server.bind('localhost:0', server_insecure_creds);
-      var Client = grpc.loadObject(mathService);
-      client = new Client('localhost:' + port,
-                          grpc.credentials.createInsecure());
-      server.start();
-    });
-    it('should respond to a unary call with UNIMPLEMENTED', function(done) {
-      client.div({divisor: 4, dividend: 3}, function(error, response) {
-        assert(error);
-        assert.strictEqual(error.code, grpc.status.UNIMPLEMENTED);
-        done();
-      });
-    });
-    it('should respond to a client stream with UNIMPLEMENTED', function(done) {
-      var call = client.sum(function(error, respones) {
-        assert(error);
-        assert.strictEqual(error.code, grpc.status.UNIMPLEMENTED);
-        done();
-      });
-      call.end();
-    });
-    it('should respond to a server stream with UNIMPLEMENTED', function(done) {
-      var call = client.fib({limit: 5});
-      call.on('data', function(value) {
-        assert.fail('No messages expected');
-      });
-      call.on('error', function(err) {
-        assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED);
-        done();
-      });
-      call.on('error', function(status) { /* Do nothing */ });
-    });
-    it('should respond to a bidi call with UNIMPLEMENTED', function(done) {
-      var call = client.divMany();
-      call.on('data', function(value) {
-        assert.fail('No messages expected');
-      });
-      call.on('error', function(err) {
-        assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED);
-        done();
-      });
-      call.on('error', function(status) { /* Do nothing */ });
-      call.end();
-    });
-  });
-});
-describe('Client constructor building', function() {
-  var illegal_service_attrs = {
-    $method : {
-      path: '/illegal/$method',
-      requestStream: false,
-      responseStream: false,
-      requestSerialize: _.identity,
-      requestDeserialize: _.identity,
-      responseSerialize: _.identity,
-      responseDeserialize: _.identity
-    }
-  };
-  it('Should reject method names starting with $', function() {
-    assert.throws(function() {
-      grpc.makeGenericClientConstructor(illegal_service_attrs);
-    }, /\$/);
-  });
-});
-describe('waitForClientReady', function() {
-  var server;
-  var port;
-  var Client;
-  var client;
-  before(function() {
-    server = new grpc.Server();
-    port = server.bind('localhost:0', grpc.ServerCredentials.createInsecure());
-    server.start();
-    Client = grpc.loadObject(mathService);
-  });
-  beforeEach(function() {
-    client = new Client('localhost:' + port, grpc.credentials.createInsecure());
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('should complete when called alone', function(done) {
-    grpc.waitForClientReady(client, Infinity, function(error) {
-      assert.ifError(error);
-      done();
-    });
-  });
-  it('should complete when a call is initiated', function(done) {
-    grpc.waitForClientReady(client, Infinity, function(error) {
-      assert.ifError(error);
-      done();
-    });
-    var call = client.div({}, function(err, response) {});
-    call.cancel();
-  });
-  it('should complete if called more than once', function(done) {
-    done = multiDone(done, 2);
-    grpc.waitForClientReady(client, Infinity, function(error) {
-      assert.ifError(error);
-      done();
-    });
-    grpc.waitForClientReady(client, Infinity, function(error) {
-      assert.ifError(error);
-      done();
-    });
-  });
-  it('should complete if called when already ready', function(done) {
-    grpc.waitForClientReady(client, Infinity, function(error) {
-      assert.ifError(error);
-      grpc.waitForClientReady(client, Infinity, function(error) {
-        assert.ifError(error);
-        done();
-      });
-    });
-  });
-  it('should time out if the server does not exist', function(done) {
-    var bad_client = new Client('nonexistent_hostname',
-                                grpc.credentials.createInsecure());
-    var deadline = new Date();
-    deadline.setSeconds(deadline.getSeconds() + 1);
-    grpc.waitForClientReady(bad_client, deadline, function(error) {
-      assert(error);
-      done();
-    });
-  });
-});
-describe('Echo service', function() {
-  var server;
-  var client;
-  before(function() {
-    var test_proto = ProtoBuf.loadProtoFile(__dirname + '/echo_service.proto');
-    var echo_service = test_proto.lookup('EchoService');
-    var Client = grpc.loadObject(echo_service);
-    server = new grpc.Server();
-    server.addService(Client.service, {
-      echo: function(call, callback) {
-        callback(null, call.request);
-      }
-    });
-    var port = server.bind('localhost:0', server_insecure_creds);
-    client = new Client('localhost:' + port, grpc.credentials.createInsecure());
-    server.start();
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('should echo the recieved message directly', function(done) {
-    client.echo({value: 'test value', value2: 3}, function(error, response) {
-      assert.ifError(error);
-      assert.deepEqual(response, {value: 'test value', value2: 3});
-      done();
-    });
-  });
-  it('Should convert an undefined argument to default values', function(done) {
-    client.echo(undefined, function(error, response) {
-      assert.ifError(error);
-      assert.deepEqual(response, {value: '', value2: 0});
-      done();
-    });
-  });
-});
-describe('Generic client and server', function() {
-  function toString(val) {
-    return val.toString();
-  }
-  function toBuffer(str) {
-    return new Buffer(str);
-  }
-  var string_service_attrs = {
-    'capitalize' : {
-      path: '/string/capitalize',
-      requestStream: false,
-      responseStream: false,
-      requestSerialize: toBuffer,
-      requestDeserialize: toString,
-      responseSerialize: toBuffer,
-      responseDeserialize: toString
-    }
-  };
-  describe('String client and server', function() {
-    var client;
-    var server;
-    before(function() {
-      server = new grpc.Server();
-      server.addService(string_service_attrs, {
-        capitalize: function(call, callback) {
-          callback(null, _.capitalize(call.request));
-        }
-      });
-      var port = server.bind('localhost:0', server_insecure_creds);
-      server.start();
-      var Client = grpc.makeGenericClientConstructor(string_service_attrs);
-      client = new Client('localhost:' + port,
-                          grpc.credentials.createInsecure());
-    });
-    after(function() {
-      server.forceShutdown();
-    });
-    it('Should respond with a capitalized string', function(done) {
-      client.capitalize('abc', function(err, response) {
-        assert.ifError(err);
-        assert.strictEqual(response, 'Abc');
-        done();
-      });
-    });
-  });
-});
-describe('Server-side getPeer', function() {
-  function toString(val) {
-    return val.toString();
-  }
-  function toBuffer(str) {
-    return new Buffer(str);
-  }
-  var string_service_attrs = {
-    'getPeer' : {
-      path: '/string/getPeer',
-      requestStream: false,
-      responseStream: false,
-      requestSerialize: toBuffer,
-      requestDeserialize: toString,
-      responseSerialize: toBuffer,
-      responseDeserialize: toString
-    }
-  };
-  var client;
-  var server;
-  before(function() {
-    server = new grpc.Server();
-    server.addService(string_service_attrs, {
-      getPeer: function(call, callback) {
-        try {
-          callback(null, call.getPeer());
-        } catch (e) {
-          call.emit('error', e);
-        }
-      }
-    });
-    var port = server.bind('localhost:0', server_insecure_creds);
-    server.start();
-    var Client = grpc.makeGenericClientConstructor(string_service_attrs);
-    client = new Client('localhost:' + port,
-                        grpc.credentials.createInsecure());
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('should respond with a string representing the client', function(done) {
-    client.getPeer('', function(err, response) {
-      assert.ifError(err);
-      // We don't expect a specific value, just that it worked without error
-      done();
-    });
-  });
-});
-describe('Echo metadata', function() {
-  var client;
-  var server;
-  var metadata;
-  before(function() {
-    var test_proto = ProtoBuf.loadProtoFile(__dirname + '/test_service.proto');
-    var test_service = test_proto.lookup('TestService');
-    var Client = grpc.loadObject(test_service);
-    server = new grpc.Server();
-    server.addService(Client.service, {
-      unary: function(call, cb) {
-        call.sendMetadata(call.metadata);
-        cb(null, {});
-      },
-      clientStream: function(stream, cb){
-        stream.on('data', function(data) {});
-        stream.on('end', function() {
-          stream.sendMetadata(stream.metadata);
-          cb(null, {});
-        });
-      },
-      serverStream: function(stream) {
-        stream.sendMetadata(stream.metadata);
-        stream.end();
-      },
-      bidiStream: function(stream) {
-        stream.on('data', function(data) {});
-        stream.on('end', function() {
-          stream.sendMetadata(stream.metadata);
-          stream.end();
-        });
-      }
-    });
-    var port = server.bind('localhost:0', server_insecure_creds);
-    client = new Client('localhost:' + port, grpc.credentials.createInsecure());
-    server.start();
-    metadata = new grpc.Metadata();
-    metadata.set('key', 'value');
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('with unary call', function(done) {
-    var call = client.unary({}, metadata, function(err, data) {
-      assert.ifError(err);
-    });
-    call.on('metadata', function(metadata) {
-      assert.deepEqual(metadata.get('key'), ['value']);
-      done();
-    });
-  });
-  it('with client stream call', function(done) {
-    var call = client.clientStream(metadata, function(err, data) {
-      assert.ifError(err);
-    });
-    call.on('metadata', function(metadata) {
-      assert.deepEqual(metadata.get('key'), ['value']);
-      done();
-    });
-    call.end();
-  });
-  it('with server stream call', function(done) {
-    var call = client.serverStream({}, metadata);
-    call.on('data', function() {});
-    call.on('metadata', function(metadata) {
-      assert.deepEqual(metadata.get('key'), ['value']);
-      done();
-    });
-  });
-  it('with bidi stream call', function(done) {
-    var call = client.bidiStream(metadata);
-    call.on('data', function() {});
-    call.on('metadata', function(metadata) {
-      assert.deepEqual(metadata.get('key'), ['value']);
-      done();
-    });
-    call.end();
-  });
-  it('shows the correct user-agent string', function(done) {
-    var version = require('../../../package.json').version;
-    var call = client.unary({}, metadata,
-                            function(err, data) { assert.ifError(err); });
-    call.on('metadata', function(metadata) {
-      assert(_.startsWith(metadata.get('user-agent')[0],
-                          'grpc-node/' + version));
-      done();
-    });
-  });
-  it('properly handles duplicate values', function(done) {
-    var dup_metadata = metadata.clone();
-    dup_metadata.add('key', 'value2');
-    var call = client.unary({}, dup_metadata,
-                            function(err, data) {assert.ifError(err); });
-    call.on('metadata', function(resp_metadata) {
-      // Two arrays are equal iff their symmetric difference is empty
-      assert.deepEqual(_.xor(dup_metadata.get('key'), resp_metadata.get('key')),
-                       []);
-      done();
-    });
-  });
-});
-describe('Client malformed response handling', function() {
-  var server;
-  var client;
-  var badArg = new Buffer([0xFF]);
-  before(function() {
-    var test_proto = ProtoBuf.loadProtoFile(__dirname + '/test_service.proto');
-    var test_service = test_proto.lookup('TestService');
-    var malformed_test_service = {
-      unary: {
-        path: '/TestService/Unary',
-        requestStream: false,
-        responseStream: false,
-        requestDeserialize: _.identity,
-        responseSerialize: _.identity
-      },
-      clientStream: {
-        path: '/TestService/ClientStream',
-        requestStream: true,
-        responseStream: false,
-        requestDeserialize: _.identity,
-        responseSerialize: _.identity
-      },
-      serverStream: {
-        path: '/TestService/ServerStream',
-        requestStream: false,
-        responseStream: true,
-        requestDeserialize: _.identity,
-        responseSerialize: _.identity
-      },
-      bidiStream: {
-        path: '/TestService/BidiStream',
-        requestStream: true,
-        responseStream: true,
-        requestDeserialize: _.identity,
-        responseSerialize: _.identity
-      }
-    };
-    server = new grpc.Server();
-    server.addService(malformed_test_service, {
-      unary: function(call, cb) {
-        cb(null, badArg);
-      },
-      clientStream: function(stream, cb) {
-        stream.on('data', function() {/* Ignore requests */});
-        stream.on('end', function() {
-          cb(null, badArg);
-        });
-      },
-      serverStream: function(stream) {
-        stream.write(badArg);
-        stream.end();
-      },
-      bidiStream: function(stream) {
-        stream.on('data', function() {
-          // Ignore requests
-          stream.write(badArg);
-        });
-        stream.on('end', function() {
-          stream.end();
-        });
-      }
-    });
-    var port = server.bind('localhost:0', server_insecure_creds);
-    var Client = grpc.loadObject(test_service);
-    client = new Client('localhost:' + port, grpc.credentials.createInsecure());
-    server.start();
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('should get an INTERNAL status with a unary call', function(done) {
-    client.unary({}, function(err, data) {
-      assert(err);
-      assert.strictEqual(err.code, grpc.status.INTERNAL);
-      done();
-    });
-  });
-  it('should get an INTERNAL status with a client stream call', function(done) {
-    var call = client.clientStream(function(err, data) {
-      assert(err);
-      assert.strictEqual(err.code, grpc.status.INTERNAL);
-      done();
-    });
-    call.write({});
-    call.end();
-  });
-  it('should get an INTERNAL status with a server stream call', function(done) {
-    var call = client.serverStream({});
-    call.on('data', function(){});
-    call.on('error', function(err) {
-      assert.strictEqual(err.code, grpc.status.INTERNAL);
-      done();
-    });
-  });
-  it('should get an INTERNAL status with a bidi stream call', function(done) {
-    var call = client.bidiStream();
-    call.on('data', function(){});
-    call.on('error', function(err) {
-      assert.strictEqual(err.code, grpc.status.INTERNAL);
-      done();
-    });
-    call.write({});
-    call.end();
-  });
-});
-describe('Server serialization failure handling', function() {
-  function serializeFail(obj) {
-    throw new Error('Serialization failed');
-  }
-  var client;
-  var server;
-  before(function() {
-    var test_proto = ProtoBuf.loadProtoFile(__dirname + '/test_service.proto');
-    var test_service = test_proto.lookup('TestService');
-    var malformed_test_service = {
-      unary: {
-        path: '/TestService/Unary',
-        requestStream: false,
-        responseStream: false,
-        requestDeserialize: _.identity,
-        responseSerialize: serializeFail
-      },
-      clientStream: {
-        path: '/TestService/ClientStream',
-        requestStream: true,
-        responseStream: false,
-        requestDeserialize: _.identity,
-        responseSerialize: serializeFail
-      },
-      serverStream: {
-        path: '/TestService/ServerStream',
-        requestStream: false,
-        responseStream: true,
-        requestDeserialize: _.identity,
-        responseSerialize: serializeFail
-      },
-      bidiStream: {
-        path: '/TestService/BidiStream',
-        requestStream: true,
-        responseStream: true,
-        requestDeserialize: _.identity,
-        responseSerialize: serializeFail
-      }
-    };
-    server = new grpc.Server();
-    server.addService(malformed_test_service, {
-      unary: function(call, cb) {
-        cb(null, {});
-      },
-      clientStream: function(stream, cb) {
-        stream.on('data', function() {/* Ignore requests */});
-        stream.on('end', function() {
-          cb(null, {});
-        });
-      },
-      serverStream: function(stream) {
-        stream.write({});
-        stream.end();
-      },
-      bidiStream: function(stream) {
-        stream.on('data', function() {
-          // Ignore requests
-          stream.write({});
-        });
-        stream.on('end', function() {
-          stream.end();
-        });
-      }
-    });
-    var port = server.bind('localhost:0', server_insecure_creds);
-    var Client = grpc.loadObject(test_service);
-    client = new Client('localhost:' + port, grpc.credentials.createInsecure());
-    server.start();
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('should get an INTERNAL status with a unary call', function(done) {
-    client.unary({}, function(err, data) {
-      assert(err);
-      assert.strictEqual(err.code, grpc.status.INTERNAL);
-      done();
-    });
-  });
-  it('should get an INTERNAL status with a client stream call', function(done) {
-    var call = client.clientStream(function(err, data) {
-      assert(err);
-      assert.strictEqual(err.code, grpc.status.INTERNAL);
-      done();
-    });
-    call.write({});
-    call.end();
-  });
-  it('should get an INTERNAL status with a server stream call', function(done) {
-    var call = client.serverStream({});
-    call.on('data', function(){});
-    call.on('error', function(err) {
-      assert.strictEqual(err.code, grpc.status.INTERNAL);
-      done();
-    });
-  });
-  it('should get an INTERNAL status with a bidi stream call', function(done) {
-    var call = client.bidiStream();
-    call.on('data', function(){});
-    call.on('error', function(err) {
-      assert.strictEqual(err.code, grpc.status.INTERNAL);
-      done();
-    });
-    call.write({});
-    call.end();
-  });
-});
-describe('Other conditions', function() {
-  var Client;
-  var client;
-  var server;
-  var port;
-  before(function() {
-    var test_proto = ProtoBuf.loadProtoFile(__dirname + '/test_service.proto');
-    var test_service = test_proto.lookup('TestService');
-    Client = grpc.loadObject(test_service);
-    server = new grpc.Server();
-    var trailer_metadata = new grpc.Metadata();
-    trailer_metadata.add('trailer-present', 'yes');
-    server.addService(Client.service, {
-      unary: function(call, cb) {
-        var req = call.request;
-        if (req.error) {
-          cb({code: grpc.status.UNKNOWN,
-              details: 'Requested error'}, null, trailer_metadata);
-        } else {
-          cb(null, {count: 1}, trailer_metadata);
-        }
-      },
-      clientStream: function(stream, cb){
-        var count = 0;
-        var errored;
-        stream.on('data', function(data) {
-          if (data.error) {
-            errored = true;
-            cb(new Error('Requested error'), null, trailer_metadata);
-          } else {
-            count += 1;
-          }
-        });
-        stream.on('end', function() {
-          if (!errored) {
-            cb(null, {count: count}, trailer_metadata);
-          }
-        });
-      },
-      serverStream: function(stream) {
-        var req = stream.request;
-        if (req.error) {
-          var err = {code: grpc.status.UNKNOWN,
-                     details: 'Requested error'};
-          err.metadata = trailer_metadata;
-          stream.emit('error', err);
-        } else {
-          for (var i = 0; i < 5; i++) {
-            stream.write({count: i});
-          }
-          stream.end(trailer_metadata);
-        }
-      },
-      bidiStream: function(stream) {
-        var count = 0;
-        stream.on('data', function(data) {
-          if (data.error) {
-            var err = new Error('Requested error');
-            err.metadata = trailer_metadata.clone();
-            err.metadata.add('count', '' + count);
-            stream.emit('error', err);
-          } else {
-            stream.write({count: count});
-            count += 1;
-          }
-        });
-        stream.on('end', function() {
-          stream.end(trailer_metadata);
-        });
-      }
-    });
-    port = server.bind('localhost:0', server_insecure_creds);
-    client = new Client('localhost:' + port, grpc.credentials.createInsecure());
-    server.start();
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('channel.getTarget should be available', function() {
-    assert.strictEqual(typeof grpc.getClientChannel(client).getTarget(),
-                       'string');
-  });
-  it('client should be able to pause and resume a stream', function(done) {
-    var call = client.bidiStream();
-    call.on('data', function(data) {
-      assert(data.count < 3);
-      call.pause();
-      setTimeout(function() {
-        call.resume();
-      }, 10);
-    });
-    call.on('end', function() {
-      done();
-    });
-    call.write({});
-    call.write({});
-    call.write({});
-    call.end();
-  });
-  describe('Server recieving bad input', function() {
-    var misbehavingClient;
-    var badArg = new Buffer([0xFF]);
-    before(function() {
-      var test_service_attrs = {
-        unary: {
-          path: '/TestService/Unary',
-          requestStream: false,
-          responseStream: false,
-          requestSerialize: _.identity,
-          responseDeserialize: _.identity
-        },
-        clientStream: {
-          path: '/TestService/ClientStream',
-          requestStream: true,
-          responseStream: false,
-          requestSerialize: _.identity,
-          responseDeserialize: _.identity
-        },
-        serverStream: {
-          path: '/TestService/ServerStream',
-          requestStream: false,
-          responseStream: true,
-          requestSerialize: _.identity,
-          responseDeserialize: _.identity
-        },
-        bidiStream: {
-          path: '/TestService/BidiStream',
-          requestStream: true,
-          responseStream: true,
-          requestSerialize: _.identity,
-          responseDeserialize: _.identity
-        }
-      };
-      var Client = surface_client.makeClientConstructor(test_service_attrs,
-                                                        'TestService');
-      misbehavingClient = new Client('localhost:' + port,
-                                     grpc.credentials.createInsecure());
-    });
-    it('should respond correctly to a unary call', function(done) {
-      misbehavingClient.unary(badArg, function(err, data) {
-        assert(err);
-        assert.strictEqual(err.code, grpc.status.INTERNAL);
-        done();
-      });
-    });
-    it('should respond correctly to a client stream', function(done) {
-      var call = misbehavingClient.clientStream(function(err, data) {
-        assert(err);
-        assert.strictEqual(err.code, grpc.status.INTERNAL);
-        done();
-      });
-      call.write(badArg);
-      // TODO(mlumish): Remove call.end()
-      call.end();
-    });
-    it('should respond correctly to a server stream', function(done) {
-      var call = misbehavingClient.serverStream(badArg);
-      call.on('data', function(data) {
-        assert.fail(data, null, 'Unexpected data', '===');
-      });
-      call.on('error', function(err) {
-        assert.strictEqual(err.code, grpc.status.INTERNAL);
-        done();
-      });
-    });
-    it('should respond correctly to a bidi stream', function(done) {
-      var call = misbehavingClient.bidiStream();
-      call.on('data', function(data) {
-        assert.fail(data, null, 'Unexpected data', '===');
-      });
-      call.on('error', function(err) {
-        assert.strictEqual(err.code, grpc.status.INTERNAL);
-        done();
-      });
-      call.write(badArg);
-      // TODO(mlumish): Remove call.end()
-      call.end();
-    });
-  });
-  describe('Trailing metadata', function() {
-    it('should be present when a unary call succeeds', function(done) {
-      var call = client.unary({error: false}, function(err, data) {
-        assert.ifError(err);
-      });
-      call.on('status', function(status) {
-        assert.deepEqual(status.metadata.get('trailer-present'), ['yes']);
-        done();
-      });
-    });
-    it('should be present when a unary call fails', function(done) {
-      var call = client.unary({error: true}, function(err, data) {
-        assert(err);
-      });
-      call.on('status', function(status) {
-        assert.deepEqual(status.metadata.get('trailer-present'), ['yes']);
-        done();
-      });
-    });
-    it('should be present when a client stream call succeeds', function(done) {
-      var call = client.clientStream(function(err, data) {
-        assert.ifError(err);
-      });
-      call.write({error: false});
-      call.write({error: false});
-      call.end();
-      call.on('status', function(status) {
-        assert.deepEqual(status.metadata.get('trailer-present'), ['yes']);
-        done();
-      });
-    });
-    it('should be present when a client stream call fails', function(done) {
-      var call = client.clientStream(function(err, data) {
-        assert(err);
-      });
-      call.write({error: false});
-      call.write({error: true});
-      call.end();
-      call.on('status', function(status) {
-        assert.deepEqual(status.metadata.get('trailer-present'), ['yes']);
-        done();
-      });
-    });
-    it('should be present when a server stream call succeeds', function(done) {
-      var call = client.serverStream({error: false});
-      call.on('data', function(){});
-      call.on('status', function(status) {
-        assert.strictEqual(status.code, grpc.status.OK);
-        assert.deepEqual(status.metadata.get('trailer-present'), ['yes']);
-        done();
-      });
-    });
-    it('should be present when a server stream call fails', function(done) {
-      var call = client.serverStream({error: true});
-      call.on('data', function(){});
-      call.on('error', function(error) {
-        assert.deepEqual(error.metadata.get('trailer-present'), ['yes']);
-        done();
-      });
-    });
-    it('should be present when a bidi stream succeeds', function(done) {
-      var call = client.bidiStream();
-      call.write({error: false});
-      call.write({error: false});
-      call.end();
-      call.on('data', function(){});
-      call.on('status', function(status) {
-        assert.strictEqual(status.code, grpc.status.OK);
-        assert.deepEqual(status.metadata.get('trailer-present'), ['yes']);
-        done();
-      });
-    });
-    it('should be present when a bidi stream fails', function(done) {
-      var call = client.bidiStream();
-      call.write({error: false});
-      call.write({error: true});
-      call.end();
-      call.on('data', function(){});
-      call.on('error', function(error) {
-        assert.deepEqual(error.metadata.get('trailer-present'), ['yes']);
-        done();
-      });
-    });
-  });
-  describe('Error object should contain the status', function() {
-    it('for a unary call', function(done) {
-      client.unary({error: true}, function(err, data) {
-        assert(err);
-        assert.strictEqual(err.code, grpc.status.UNKNOWN);
-        assert.strictEqual(err.message, 'Requested error');
-        done();
-      });
-    });
-    it('for a client stream call', function(done) {
-      var call = client.clientStream(function(err, data) {
-        assert(err);
-        assert.strictEqual(err.code, grpc.status.UNKNOWN);
-        assert.strictEqual(err.message, 'Requested error');
-        done();
-      });
-      call.write({error: false});
-      call.write({error: true});
-      call.end();
-    });
-    it('for a server stream call', function(done) {
-      var call = client.serverStream({error: true});
-      call.on('data', function(){});
-      call.on('error', function(error) {
-        assert.strictEqual(error.code, grpc.status.UNKNOWN);
-        assert.strictEqual(error.message, 'Requested error');
-        done();
-      });
-    });
-    it('for a bidi stream call', function(done) {
-      var call = client.bidiStream();
-      call.write({error: false});
-      call.write({error: true});
-      call.end();
-      call.on('data', function(){});
-      call.on('error', function(error) {
-        assert.strictEqual(error.code, grpc.status.UNKNOWN);
-        assert.strictEqual(error.message, 'Requested error');
-        done();
-      });
-    });
-  });
-  describe('call.getPeer should return the peer', function() {
-    it('for a unary call', function(done) {
-      var call = client.unary({error: false}, function(err, data) {
-        assert.ifError(err);
-        done();
-      });
-      assert.strictEqual(typeof call.getPeer(), 'string');
-    });
-    it('for a client stream call', function(done) {
-      var call = client.clientStream(function(err, data) {
-        assert.ifError(err);
-        done();
-      });
-      assert.strictEqual(typeof call.getPeer(), 'string');
-      call.write({error: false});
-      call.end();
-    });
-    it('for a server stream call', function(done) {
-      var call = client.serverStream({error: false});
-      assert.strictEqual(typeof call.getPeer(), 'string');
-      call.on('data', function(){});
-      call.on('status', function(status) {
-        assert.strictEqual(status.code, grpc.status.OK);
-        done();
-      });
-    });
-    it('for a bidi stream call', function(done) {
-      var call = client.bidiStream();
-      assert.strictEqual(typeof call.getPeer(), 'string');
-      call.write({error: false});
-      call.end();
-      call.on('data', function(){});
-      call.on('status', function(status) {
-        done();
-      });
-    });
-    it('after the call has fully completed', function(done) {
-      var peer;
-      var call = client.unary({error: false}, function(err, data) {
-        assert.ifError(err);
-        setImmediate(function() {
-          assert.strictEqual(peer, call.getPeer());
-          done();
-        });
-      });
-      peer = call.getPeer();
-      assert.strictEqual(typeof peer, 'string');
-    });
-  });
-});
-describe('Call propagation', function() {
-  var proxy;
-  var proxy_impl;
-
-  var Client;
-  var client;
-  var server;
-  before(function() {
-    var test_proto = ProtoBuf.loadProtoFile(__dirname + '/test_service.proto');
-    var test_service = test_proto.lookup('TestService');
-    server = new grpc.Server();
-    Client = grpc.loadObject(test_service);
-    server.addService(Client.service, {
-      unary: function(call) {},
-      clientStream: function(stream) {},
-      serverStream: function(stream) {},
-      bidiStream: function(stream) {}
-    });
-    var port = server.bind('localhost:0', server_insecure_creds);
-    client = new Client('localhost:' + port, grpc.credentials.createInsecure());
-    server.start();
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  beforeEach(function() {
-    proxy = new grpc.Server();
-    proxy_impl = {
-      unary: function(call) {},
-      clientStream: function(stream) {},
-      serverStream: function(stream) {},
-      bidiStream: function(stream) {}
-    };
-  });
-  afterEach(function() {
-    proxy.forceShutdown();
-  });
-  describe('Cancellation', function() {
-    it('With a unary call', function(done) {
-      done = multiDone(done, 2);
-      var call;
-      proxy_impl.unary = function(parent, callback) {
-        client.unary(parent.request, {parent: parent}, function(err, value) {
-          try {
-            assert(err);
-            assert.strictEqual(err.code, grpc.status.CANCELLED);
-          } finally {
-            callback(err, value);
-            done();
-          }
-        });
-        call.cancel();
-      };
-      proxy.addService(Client.service, proxy_impl);
-      var proxy_port = proxy.bind('localhost:0', server_insecure_creds);
-      proxy.start();
-      var proxy_client = new Client('localhost:' + proxy_port,
-                                    grpc.credentials.createInsecure());
-      call = proxy_client.unary({}, function(err, value) { done(); });
-    });
-    it('With a client stream call', function(done) {
-      done = multiDone(done, 2);
-      var call;
-      proxy_impl.clientStream = function(parent, callback) {
-        client.clientStream({parent: parent}, function(err, value) {
-          try {
-            assert(err);
-            assert.strictEqual(err.code, grpc.status.CANCELLED);
-          } finally {
-            callback(err, value);
-            done();
-          }
-        });
-        call.cancel();
-      };
-      proxy.addService(Client.service, proxy_impl);
-      var proxy_port = proxy.bind('localhost:0', server_insecure_creds);
-      proxy.start();
-      var proxy_client = new Client('localhost:' + proxy_port,
-                                    grpc.credentials.createInsecure());
-      call = proxy_client.clientStream(function(err, value) { done(); });
-    });
-    it('With a server stream call', function(done) {
-      done = multiDone(done, 2);
-      var call;
-      proxy_impl.serverStream = function(parent) {
-        var child = client.serverStream(parent.request, {parent: parent});
-        child.on('data', function() {});
-        child.on('error', function(err) {
-          assert(err);
-          assert.strictEqual(err.code, grpc.status.CANCELLED);
-          done();
-        });
-        call.cancel();
-      };
-      proxy.addService(Client.service, proxy_impl);
-      var proxy_port = proxy.bind('localhost:0', server_insecure_creds);
-      proxy.start();
-      var proxy_client = new Client('localhost:' + proxy_port,
-                                    grpc.credentials.createInsecure());
-      call = proxy_client.serverStream({});
-      call.on('data', function() {});
-      call.on('error', function(err) {
-        done();
-      });
-    });
-    it('With a bidi stream call', function(done) {
-      done = multiDone(done, 2);
-      var call;
-      proxy_impl.bidiStream = function(parent) {
-        var child = client.bidiStream({parent: parent});
-        child.on('data', function() {});
-        child.on('error', function(err) {
-          assert(err);
-          assert.strictEqual(err.code, grpc.status.CANCELLED);
-          done();
-        });
-        call.cancel();
-      };
-      proxy.addService(Client.service, proxy_impl);
-      var proxy_port = proxy.bind('localhost:0', server_insecure_creds);
-      proxy.start();
-      var proxy_client = new Client('localhost:' + proxy_port,
-                                    grpc.credentials.createInsecure());
-      call = proxy_client.bidiStream();
-      call.on('data', function() {});
-      call.on('error', function(err) {
-        done();
-      });
-    });
-  });
-  describe('Deadline', function() {
-    /* jshint bitwise:false */
-    var deadline_flags = (grpc.propagate.DEFAULTS &
-        ~grpc.propagate.CANCELLATION);
-    it('With a client stream call', function(done) {
-      done = multiDone(done, 2);
-      proxy_impl.clientStream = function(parent, callback) {
-        var options = {parent: parent, propagate_flags: deadline_flags};
-        client.clientStream(options, function(err, value) {
-          try {
-            assert(err);
-            assert(err.code === grpc.status.DEADLINE_EXCEEDED ||
-                err.code === grpc.status.INTERNAL);
-          } finally {
-            callback(err, value);
-            done();
-          }
-        });
-      };
-      proxy.addService(Client.service, proxy_impl);
-      var proxy_port = proxy.bind('localhost:0', server_insecure_creds);
-      proxy.start();
-      var proxy_client = new Client('localhost:' + proxy_port,
-                                    grpc.credentials.createInsecure());
-      var deadline = new Date();
-      deadline.setSeconds(deadline.getSeconds() + 1);
-      proxy_client.clientStream({deadline: deadline}, function(err, value) {
-        done();
-      });
-    });
-    it('With a bidi stream call', function(done) {
-      done = multiDone(done, 2);
-      proxy_impl.bidiStream = function(parent) {
-        var child = client.bidiStream(
-            {parent: parent, propagate_flags: deadline_flags});
-        child.on('data', function() {});
-        child.on('error', function(err) {
-          assert(err);
-          assert(err.code === grpc.status.DEADLINE_EXCEEDED ||
-              err.code === grpc.status.INTERNAL);
-          done();
-        });
-      };
-      proxy.addService(Client.service, proxy_impl);
-      var proxy_port = proxy.bind('localhost:0', server_insecure_creds);
-      proxy.start();
-      var proxy_client = new Client('localhost:' + proxy_port,
-                                    grpc.credentials.createInsecure());
-      var deadline = new Date();
-      deadline.setSeconds(deadline.getSeconds() + 1);
-      var call = proxy_client.bidiStream({deadline: deadline});
-      call.on('data', function() {});
-      call.on('error', function(err) {
-        done();
-      });
-    });
-  });
-});
-describe('Cancelling surface client', function() {
-  var client;
-  var server;
-  before(function() {
-    server = new grpc.Server();
-    server.addService(mathServiceAttrs, {
-      'div': function(stream) {},
-      'divMany': function(stream) {},
-      'fib': function(stream) {},
-      'sum': function(stream) {}
-    });
-    var port = server.bind('localhost:0', server_insecure_creds);
-    var Client = surface_client.makeClientConstructor(mathServiceAttrs);
-    client = new Client('localhost:' + port, grpc.credentials.createInsecure());
-    server.start();
-  });
-  after(function() {
-    server.forceShutdown();
-  });
-  it('Should correctly cancel a unary call', function(done) {
-    var call = client.div({'divisor': 0, 'dividend': 0}, function(err, resp) {
-      assert.strictEqual(err.code, grpc.status.CANCELLED);
-      done();
-    });
-    call.cancel();
-  });
-  it('Should correctly cancel a client stream call', function(done) {
-    var call = client.sum(function(err, resp) {
-      assert.strictEqual(err.code, grpc.status.CANCELLED);
-      done();
-    });
-    call.cancel();
-  });
-  it('Should correctly cancel a server stream call', function(done) {
-    var call = client.fib({'limit': 5});
-    call.on('data', function() {});
-    call.on('error', function(error) {
-      assert.strictEqual(error.code, grpc.status.CANCELLED);
-      done();
-    });
-    call.cancel();
-  });
-  it('Should correctly cancel a bidi stream call', function(done) {
-    var call = client.divMany();
-    call.on('data', function() {});
-    call.on('error', function(error) {
-      assert.strictEqual(error.code, grpc.status.CANCELLED);
-      done();
-    });
-    call.cancel();
-  });
-  it('Should be idempotent', function(done) {
-    var call = client.div({'divisor': 0, 'dividend': 0}, function(err, resp) {
-      assert.strictEqual(err.code, grpc.status.CANCELLED);
-      // Call asynchronously to try cancelling after call is fully completed
-      setImmediate(function() {
-        assert.doesNotThrow(function() {
-          call.cancel();
-        });
-        done();
-      });
-    });
-    call.cancel();
-  });
-});
-describe('Client reconnect', function() {
-  var server;
-  var Client;
-  var client;
-  var port;
-  beforeEach(function() {
-    var test_proto = ProtoBuf.loadProtoFile(__dirname + '/echo_service.proto');
-    var echo_service = test_proto.lookup('EchoService');
-    Client = grpc.loadObject(echo_service);
-    server = new grpc.Server();
-    server.addService(Client.service, {
-      echo: function(call, callback) {
-        callback(null, call.request);
-      }
-    });
-    port = server.bind('localhost:0', server_insecure_creds);
-    client = new Client('localhost:' + port, grpc.credentials.createInsecure());
-    server.start();
-  });
-  afterEach(function() {
-    server.forceShutdown();
-  });
-  it('should reconnect after server restart', function(done) {
-    client.echo({value: 'test value', value2: 3}, function(error, response) {
-      assert.ifError(error);
-      assert.deepEqual(response, {value: 'test value', value2: 3});
-      server.tryShutdown(function() {
-        server = new grpc.Server();
-        server.addService(Client.service, {
-          echo: function(call, callback) {
-            callback(null, call.request);
-          }
-        });
-        server.bind('localhost:' + port, server_insecure_creds);
-        server.start();
-
-        /* We create a new client, that will not throw an error if the server
-         * is not immediately available. Instead, it will wait for the server
-         * to be available, then the call will complete. Once this happens, the
-         * original client should be able to make a new call and connect to the
-         * restarted server without having the call fail due to connection
-         * errors. */
-        var client2 = new Client('localhost:' + port,
-                                 grpc.credentials.createInsecure());
-        client2.echo({value: 'test', value2: 3}, function(error, response) {
-          assert.ifError(error);
-          client.echo(undefined, function(error, response) {
-            if (error) {
-              console.log(error);
-            }
-            assert.ifError(error);
-            assert.deepEqual(response, {value: '', value2: 0});
-            done();
-          });
-        });
-      });
-    });
-  });
-});
diff --git a/src/node/test/test_messages.proto b/src/node/test/test_messages.proto
deleted file mode 100644
index da1ef56..0000000
--- a/src/node/test/test_messages.proto
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2015 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-message LongValues {
-  int64 int_64 = 1;
-  uint64 uint_64 = 2;
-  sint64 sint_64 = 3;
-  fixed64 fixed_64 = 4;
-  sfixed64 sfixed_64 = 5;
-}
-
-message SequenceValues {
-  bytes bytes_field = 1;
-  repeated int32 repeated_field = 2;
-}
-
-message OneOfValues {
-  oneof oneof_choice {
-    int32 int_choice = 1;
-    string string_choice = 2;
-  }
-}
-
-enum TestEnum {
-  ZERO = 0;
-  ONE = 1;
-  TWO = 2;
-}
-
-message EnumValues {
-  TestEnum enum_value = 1;
-}
diff --git a/src/node/test/test_service.json b/src/node/test/test_service.json
deleted file mode 100644
index 6f952c6..0000000
--- a/src/node/test/test_service.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
-    "package": null,
-    "messages": [
-        {
-            "name": "Request",
-            "fields": [
-                {
-                    "rule": "optional",
-                    "type": "bool",
-                    "name": "error",
-                    "id": 1
-                }
-            ]
-        },
-        {
-            "name": "Response",
-            "fields": [
-                {
-                    "rule": "optional",
-                    "type": "int32",
-                    "name": "count",
-                    "id": 1
-                }
-            ]
-        }
-    ],
-    "services": [
-        {
-            "name": "TestService",
-            "options": {},
-            "rpc": {
-                "Unary": {
-                    "request": "Request",
-                    "response": "Response",
-                    "options": {}
-                },
-                "ClientStream": {
-                    "request": "Request",
-                    "response": "Response",
-                    "options": {}
-                },
-                "ServerStream": {
-                    "request": "Request",
-                    "response": "Response",
-                    "options": {}
-                },
-                "BidiStream": {
-                    "request": "Request",
-                    "response": "Response",
-                    "options": {}
-                }
-            }
-        }
-    ]
-}
\ No newline at end of file
diff --git a/src/node/test/test_service.proto b/src/node/test/test_service.proto
deleted file mode 100644
index b16dfec..0000000
--- a/src/node/test/test_service.proto
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-message Request {
-  bool error = 1;
-}
-
-message Response {
-  int32 count = 1;
-}
-
-service TestService {
-  rpc Unary (Request) returns (Response) {
-  }
-
-  rpc ClientStream (stream Request) returns (Response) {
-  }
-
-  rpc ServerStream (Request) returns (stream Response) {
-  }
-
-  rpc BidiStream (stream Request) returns (stream Response) {
-  }
-}
diff --git a/src/node/tools/bin/protoc.js b/src/node/tools/bin/protoc.js
deleted file mode 100755
index 490817b..0000000
--- a/src/node/tools/bin/protoc.js
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env node
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * This file is required because package.json cannot reference a file that
- * is not distributed with the package, and we use node-pre-gyp to distribute
- * the protoc binary
- */
-
-'use strict';
-
-var path = require('path');
-var execFile = require('child_process').execFile;
-
-var exe_ext = process.platform === 'win32' ? '.exe' : '';
-
-var protoc = path.resolve(__dirname, 'protoc' + exe_ext);
-
-var plugin = path.resolve(__dirname, 'grpc_node_plugin' + exe_ext);
-
-var args = ['--plugin=protoc-gen-grpc=' + plugin].concat(process.argv.slice(2));
-
-var child_process = execFile(protoc, args, function(error, stdout, stderr) {
-  if (error) {
-    throw error;
-  }
-});
-
-child_process.stdout.pipe(process.stdout);
-child_process.stderr.pipe(process.stderr);
diff --git a/src/node/tools/bin/protoc_plugin.js b/src/node/tools/bin/protoc_plugin.js
deleted file mode 100755
index fbdafff..0000000
--- a/src/node/tools/bin/protoc_plugin.js
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env node
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * This file is required because package.json cannot reference a file that
- * is not distributed with the package, and we use node-pre-gyp to distribute
- * the plugin binary
- */
-
-'use strict';
-
-var path = require('path');
-var execFile = require('child_process').execFile;
-
-var exe_ext = process.platform === 'win32' ? '.exe' : '';
-
-var plugin = path.resolve(__dirname, 'grpc_node_plugin' + exe_ext);
-
-var child_process = execFile(plugin, process.argv.slice(2), {encoding: 'buffer'}, function(error, stdout, stderr) {
-  if (error) {
-    throw error;
-  }
-});
-
-process.stdin.pipe(child_process.stdin);
-child_process.stdout.pipe(process.stdout);
-child_process.stderr.pipe(process.stderr);
diff --git a/src/node/tools/index.js b/src/node/tools/index.js
deleted file mode 100644
index b81d625..0000000
--- a/src/node/tools/index.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-'use strict';
-
-/**
- * package.json requires this file to be present. In the future, this can
- * export useful information about the included tools.
- */
-
-module.exports = {};
diff --git a/src/node/tools/package.json b/src/node/tools/package.json
deleted file mode 100644
index f88fc65..0000000
--- a/src/node/tools/package.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-  "name": "grpc-tools",
-  "version": "1.8.0-dev",
-  "author": "Google Inc.",
-  "description": "Tools for developing with gRPC on Node.js",
-  "homepage": "https://grpc.io/",
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/grpc/grpc.git"
-  },
-  "bugs": "https://github.com/grpc/grpc/issues",
-  "contributors": [
-    {
-      "name": "Michael Lumish",
-      "email": "mlumish@google.com"
-    }
-  ],
-  "bin": {
-    "grpc_tools_node_protoc": "./bin/protoc.js",
-    "grpc_tools_node_protoc_plugin": "./bin/protoc_plugin.js"
-  },
-  "scripts": {
-    "install": "./node_modules/.bin/node-pre-gyp install"
-  },
-  "bundledDependencies": ["node-pre-gyp"],
-  "binary": {
-    "module_name": "grpc_tools",
-    "host": "https://storage.googleapis.com/",
-    "remote_path": "grpc-precompiled-binaries/node/{name}/v{version}",
-    "package_name": "{platform}-{arch}.tar.gz",
-    "module_path": "bin"
-  },
-  "files": [
-    "index.js",
-    "bin/protoc.js",
-    "bin/protoc_plugin.js",
-    "bin/google/protobuf",
-    "LICENSE"
-  ],
-  "main": "index.js"
-}
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index d6c3a3c..b5ab611 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -112,10 +112,13 @@
 
 @synthesize state = _state;
 
-// TODO(jcanizales): If grpc_init is idempotent, this should be changed from load to initialize.
-+ (void)load {
-  grpc_init();
-  callFlags = [NSMutableDictionary dictionary];
++ (void)initialize {
+  // Guarantees the code in {} block is invoked only once. See ref at:
+  // https://developer.apple.com/documentation/objectivec/nsobject/1418639-initialize?language=objc
+  if (self == [GRPCCall self]) {
+    grpc_init();
+    callFlags = [NSMutableDictionary dictionary];
+  }
 }
 
 + (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path {
diff --git a/src/php/tests/unit_tests/ChannelTest.php b/src/php/tests/unit_tests/ChannelTest.php
index c375a16..13a770c 100644
--- a/src/php/tests/unit_tests/ChannelTest.php
+++ b/src/php/tests/unit_tests/ChannelTest.php
@@ -81,10 +81,14 @@
     {
         $this->channel = new Grpc\Channel('localhost:0',
              ['credentials' => Grpc\ChannelCredentials::createInsecure()]);
-        $time = new Grpc\Timeval(1000);
-        $state = $this->channel->watchConnectivityState(1, $time);
+        $now = Grpc\Timeval::now();
+        $deadline = $now->add(new Grpc\Timeval(100*1000));  // 100ms
+        // we act as if 'CONNECTING'(=1) was the last state
+        // we saw, so the default state of 'IDLE' should be delivered instantly
+        $state = $this->channel->watchConnectivityState(1, $deadline);
         $this->assertTrue($state);
-        unset($time);
+        unset($now);
+        unset($deadline);
     }
 
     public function testClose()
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index 140f4ce..bb7d990 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -254,6 +254,7 @@
   'src/core/tsi/transport_security_adapter.cc',
   'src/core/ext/transport/chttp2/server/chttp2_server.cc',
   'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc',
+  'src/core/ext/filters/client_channel/backup_poller.cc',
   'src/core/ext/filters/client_channel/channel_connectivity.cc',
   'src/core/ext/filters/client_channel/client_channel.cc',
   'src/core/ext/filters/client_channel/client_channel_factory.cc',
@@ -293,6 +294,7 @@
   'third_party/nanopb/pb_encode.c',
   'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
   'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
+  'src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc',
   'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
   'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
   'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
@@ -302,21 +304,7 @@
   'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
   'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc',
   'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc',
-  'src/core/ext/census/base_resources.cc',
-  'src/core/ext/census/context.cc',
-  'src/core/ext/census/gen/census.pb.c',
-  'src/core/ext/census/gen/trace_context.pb.c',
   'src/core/ext/census/grpc_context.cc',
-  'src/core/ext/census/grpc_filter.cc',
-  'src/core/ext/census/grpc_plugin.cc',
-  'src/core/ext/census/initialize.cc',
-  'src/core/ext/census/intrusive_hash_map.cc',
-  'src/core/ext/census/mlog.cc',
-  'src/core/ext/census/operation.cc',
-  'src/core/ext/census/placeholders.cc',
-  'src/core/ext/census/resource.cc',
-  'src/core/ext/census/trace_context.cc',
-  'src/core/ext/census/tracing.cc',
   'src/core/ext/filters/max_age/max_age_filter.cc',
   'src/core/ext/filters/message_size/message_size_filter.cc',
   'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
diff --git a/src/ruby/ext/grpc/rb_byte_buffer.c b/src/ruby/ext/grpc/rb_byte_buffer.c
index 8aa7a7e..e11c7e8 100644
--- a/src/ruby/ext/grpc/rb_byte_buffer.c
+++ b/src/ruby/ext/grpc/rb_byte_buffer.c
@@ -26,14 +26,14 @@
 #include <grpc/slice.h>
 #include "rb_grpc.h"
 
-grpc_byte_buffer *grpc_rb_s_to_byte_buffer(char *string, size_t length) {
+grpc_byte_buffer* grpc_rb_s_to_byte_buffer(char* string, size_t length) {
   grpc_slice slice = grpc_slice_from_copied_buffer(string, length);
-  grpc_byte_buffer *buffer = grpc_raw_byte_buffer_create(&slice, 1);
+  grpc_byte_buffer* buffer = grpc_raw_byte_buffer_create(&slice, 1);
   grpc_slice_unref(slice);
   return buffer;
 }
 
-VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer) {
+VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer* buffer) {
   VALUE rb_string;
   grpc_byte_buffer_reader reader;
   grpc_slice next;
@@ -46,7 +46,7 @@
     return Qnil;
   }
   while (grpc_byte_buffer_reader_next(&reader, &next) != 0) {
-    rb_str_cat(rb_string, (const char *)GRPC_SLICE_START_PTR(next),
+    rb_str_cat(rb_string, (const char*)GRPC_SLICE_START_PTR(next),
                GRPC_SLICE_LENGTH(next));
     grpc_slice_unref(next);
   }
@@ -59,6 +59,6 @@
     rb_raise(rb_eRuntimeError,
              "attempt to convert uninitialized grpc_slice to ruby string");
   }
-  return rb_str_new((char *)GRPC_SLICE_START_PTR(slice),
+  return rb_str_new((char*)GRPC_SLICE_START_PTR(slice),
                     GRPC_SLICE_LENGTH(slice));
 }
diff --git a/src/ruby/ext/grpc/rb_byte_buffer.h b/src/ruby/ext/grpc/rb_byte_buffer.h
index c64a990..9cb58aa 100644
--- a/src/ruby/ext/grpc/rb_byte_buffer.h
+++ b/src/ruby/ext/grpc/rb_byte_buffer.h
@@ -24,10 +24,10 @@
 #include <grpc/grpc.h>
 
 /* Converts a char* with a length to a grpc_byte_buffer */
-grpc_byte_buffer *grpc_rb_s_to_byte_buffer(char *string, size_t length);
+grpc_byte_buffer* grpc_rb_s_to_byte_buffer(char* string, size_t length);
 
 /* Converts a grpc_byte_buffer to a ruby string */
-VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer);
+VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer* buffer);
 
 /* Converts a grpc_slice to a ruby string */
 VALUE grpc_rb_slice_to_ruby_string(grpc_slice slice);
diff --git a/src/ruby/ext/grpc/rb_call.c b/src/ruby/ext/grpc/rb_call.c
index e920fc8..7f3ca2a 100644
--- a/src/ruby/ext/grpc/rb_call.c
+++ b/src/ruby/ext/grpc/rb_call.c
@@ -24,7 +24,6 @@
 #include <grpc/grpc.h>
 #include <grpc/impl/codegen/compression_types.h>
 #include <grpc/support/alloc.h>
-#include <grpc/support/alloc.h>
 #include <grpc/support/log.h>
 
 #include "rb_byte_buffer.h"
@@ -81,11 +80,11 @@
 static VALUE sym_cancelled;
 
 typedef struct grpc_rb_call {
-  grpc_call *wrapped;
-  grpc_completion_queue *queue;
+  grpc_call* wrapped;
+  grpc_completion_queue* queue;
 } grpc_rb_call;
 
-static void destroy_call(grpc_rb_call *call) {
+static void destroy_call(grpc_rb_call* call) {
   /* Ensure that we only try to destroy the call once */
   if (call->wrapped != NULL) {
     grpc_call_unref(call->wrapped);
@@ -96,19 +95,19 @@
 }
 
 /* Destroys a Call. */
-static void grpc_rb_call_destroy(void *p) {
+static void grpc_rb_call_destroy(void* p) {
   if (p == NULL) {
     return;
   }
-  destroy_call((grpc_rb_call *)p);
+  destroy_call((grpc_rb_call*)p);
   xfree(p);
 }
 
-static size_t md_ary_datasize(const void *p) {
-  const grpc_metadata_array *const ary = (grpc_metadata_array *)p;
+static size_t md_ary_datasize(const void* p) {
+  const grpc_metadata_array* const ary = (grpc_metadata_array*)p;
   size_t i, datasize = sizeof(grpc_metadata_array);
   for (i = 0; i < ary->count; ++i) {
-    const grpc_metadata *const md = &ary->metadata[i];
+    const grpc_metadata* const md = &ary->metadata[i];
     datasize += GRPC_SLICE_LENGTH(md->key);
     datasize += GRPC_SLICE_LENGTH(md->value);
   }
@@ -151,9 +150,9 @@
 VALUE rb_error_code_details;
 
 /* Obtains the error detail string for given error code */
-const char *grpc_call_error_detail_of(grpc_call_error err) {
+const char* grpc_call_error_detail_of(grpc_call_error err) {
   VALUE detail_ref = rb_hash_aref(rb_error_code_details, UINT2NUM(err));
-  const char *detail = "unknown error code!";
+  const char* detail = "unknown error code!";
   if (detail_ref != Qnil) {
     detail = StringValueCStr(detail_ref);
   }
@@ -163,7 +162,7 @@
 /* Called by clients to cancel an RPC on the server.
    Can be called multiple times, from any thread. */
 static VALUE grpc_rb_call_cancel(VALUE self) {
-  grpc_rb_call *call = NULL;
+  grpc_rb_call* call = NULL;
   grpc_call_error err;
   if (RTYPEDDATA_DATA(self) == NULL) {
     // This call has been closed
@@ -187,7 +186,7 @@
  * message. */
 static VALUE grpc_rb_call_cancel_with_status(VALUE self, VALUE status_code,
                                              VALUE details) {
-  grpc_rb_call *call = NULL;
+  grpc_rb_call* call = NULL;
   grpc_call_error err;
   if (RTYPEDDATA_DATA(self) == NULL) {
     // This call has been closed
@@ -217,7 +216,7 @@
    processed.
 */
 static VALUE grpc_rb_call_close(VALUE self) {
-  grpc_rb_call *call = NULL;
+  grpc_rb_call* call = NULL;
   TypedData_Get_Struct(self, grpc_rb_call, &grpc_call_data_type, call);
   if (call != NULL) {
     destroy_call(call);
@@ -230,8 +229,8 @@
 /* Called to obtain the peer that this call is connected to. */
 static VALUE grpc_rb_call_get_peer(VALUE self) {
   VALUE res = Qnil;
-  grpc_rb_call *call = NULL;
-  char *peer = NULL;
+  grpc_rb_call* call = NULL;
+  char* peer = NULL;
   if (RTYPEDDATA_DATA(self) == NULL) {
     rb_raise(grpc_rb_eCallError, "Cannot get peer value on closed call");
     return Qnil;
@@ -246,9 +245,9 @@
 
 /* Called to obtain the x509 cert of an authenticated peer. */
 static VALUE grpc_rb_call_get_peer_cert(VALUE self) {
-  grpc_rb_call *call = NULL;
+  grpc_rb_call* call = NULL;
   VALUE res = Qnil;
-  grpc_auth_context *ctx = NULL;
+  grpc_auth_context* ctx = NULL;
   if (RTYPEDDATA_DATA(self) == NULL) {
     rb_raise(grpc_rb_eCallError, "Cannot get peer cert on closed call");
     return Qnil;
@@ -264,7 +263,7 @@
   {
     grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
         ctx, GRPC_X509_PEM_CERT_PROPERTY_NAME);
-    const grpc_auth_property *prop = grpc_auth_property_iterator_next(&it);
+    const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
     if (prop == NULL) {
       return Qnil;
     }
@@ -379,8 +378,8 @@
 
   Sets credentials on a call */
 static VALUE grpc_rb_call_set_credentials(VALUE self, VALUE credentials) {
-  grpc_rb_call *call = NULL;
-  grpc_call_credentials *creds;
+  grpc_rb_call* call = NULL;
+  grpc_call_credentials* creds;
   grpc_call_error err;
   if (RTYPEDDATA_DATA(self) == NULL) {
     rb_raise(grpc_rb_eCallError, "Cannot set credentials of closed call");
@@ -407,12 +406,12 @@
    grpc_rb_md_ary_capacity_hash_cb
 */
 static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) {
-  grpc_metadata_array *md_ary = NULL;
+  grpc_metadata_array* md_ary = NULL;
   long array_length;
   long i;
   grpc_slice key_slice;
   grpc_slice value_slice;
-  char *tmp_str = NULL;
+  char* tmp_str = NULL;
 
   if (TYPE(key) == T_SYMBOL) {
     key_slice = grpc_slice_from_static_string(rb_id2name(SYM2ID(key)));
@@ -482,7 +481,7 @@
 */
 static int grpc_rb_md_ary_capacity_hash_cb(VALUE key, VALUE val,
                                            VALUE md_ary_obj) {
-  grpc_metadata_array *md_ary = NULL;
+  grpc_metadata_array* md_ary = NULL;
 
   (void)key;
 
@@ -503,7 +502,7 @@
 /* grpc_rb_md_ary_convert converts a ruby metadata hash into
    a grpc_metadata_array.
 */
-void grpc_rb_md_ary_convert(VALUE md_ary_hash, grpc_metadata_array *md_ary) {
+void grpc_rb_md_ary_convert(VALUE md_ary_hash, grpc_metadata_array* md_ary) {
   VALUE md_ary_obj = Qnil;
   if (md_ary_hash == Qnil) {
     return; /* Do nothing if the expected has value is nil */
@@ -524,7 +523,7 @@
 }
 
 /* Converts a metadata array to a hash. */
-VALUE grpc_rb_md_ary_to_h(grpc_metadata_array *md_ary) {
+VALUE grpc_rb_md_ary_to_h(grpc_metadata_array* md_ary) {
   VALUE key = Qnil;
   VALUE new_ary = Qnil;
   VALUE value = Qnil;
@@ -587,7 +586,7 @@
    struct to the 'send_status_from_server' portion of an op.
 */
 static void grpc_rb_op_update_status_from_server(
-    grpc_op *op, grpc_metadata_array *md_ary, grpc_slice *send_status_details,
+    grpc_op* op, grpc_metadata_array* md_ary, grpc_slice* send_status_details,
     VALUE status) {
   VALUE code = rb_struct_aref(status, sym_code);
   VALUE details = rb_struct_aref(status, sym_details);
@@ -627,7 +626,7 @@
   grpc_metadata_array send_trailing_metadata;
 
   /* Data being received */
-  grpc_byte_buffer *recv_message;
+  grpc_byte_buffer* recv_message;
   grpc_metadata_array recv_metadata;
   grpc_metadata_array recv_trailing_metadata;
   int recv_cancelled;
@@ -639,7 +638,7 @@
 
 /* grpc_run_batch_stack_init ensures the run_batch_stack is properly
  * initialized */
-static void grpc_run_batch_stack_init(run_batch_stack *st,
+static void grpc_run_batch_stack_init(run_batch_stack* st,
                                       unsigned write_flag) {
   MEMZERO(st, run_batch_stack, 1);
   grpc_metadata_array_init(&st->send_metadata);
@@ -651,7 +650,7 @@
 }
 
 void grpc_rb_metadata_array_destroy_including_entries(
-    grpc_metadata_array *array) {
+    grpc_metadata_array* array) {
   size_t i;
   if (array->metadata) {
     for (i = 0; i < array->count; i++) {
@@ -664,7 +663,7 @@
 
 /* grpc_run_batch_stack_cleanup ensures the run_batch_stack is properly
  * cleaned up */
-static void grpc_run_batch_stack_cleanup(run_batch_stack *st) {
+static void grpc_run_batch_stack_cleanup(run_batch_stack* st) {
   size_t i = 0;
 
   grpc_rb_metadata_array_destroy_including_entries(&st->send_metadata);
@@ -693,7 +692,7 @@
 
 /* grpc_run_batch_stack_fill_ops fills the run_batch_stack ops array from
  * ops_hash */
-static void grpc_run_batch_stack_fill_ops(run_batch_stack *st, VALUE ops_hash) {
+static void grpc_run_batch_stack_fill_ops(run_batch_stack* st, VALUE ops_hash) {
   VALUE this_op = Qnil;
   VALUE this_value = Qnil;
   VALUE ops_ary = rb_ary_new();
@@ -760,7 +759,7 @@
 
 /* grpc_run_batch_stack_build_result fills constructs a ruby BatchResult struct
    after the results have run */
-static VALUE grpc_run_batch_stack_build_result(run_batch_stack *st) {
+static VALUE grpc_run_batch_stack_build_result(run_batch_stack* st) {
   size_t i = 0;
   VALUE result = rb_struct_new(grpc_rb_sBatchResult, Qnil, Qnil, Qnil, Qnil,
                                Qnil, Qnil, Qnil, Qnil, NULL);
@@ -823,14 +822,14 @@
    Only one operation of each type can be active at once in any given
    batch */
 static VALUE grpc_rb_call_run_batch(VALUE self, VALUE ops_hash) {
-  run_batch_stack *st = NULL;
-  grpc_rb_call *call = NULL;
+  run_batch_stack* st = NULL;
+  grpc_rb_call* call = NULL;
   grpc_event ev;
   grpc_call_error err;
   VALUE result = Qnil;
   VALUE rb_write_flag = rb_ivar_get(self, id_write_flag);
   unsigned write_flag = 0;
-  void *tag = (void *)&st;
+  void* tag = (void*)&st;
 
   if (RTYPEDDATA_DATA(self) == NULL) {
     rb_raise(grpc_rb_eCallError, "Cannot run batch on closed call");
@@ -997,8 +996,8 @@
   rb_define_method(grpc_rb_cCall, "metadata=", grpc_rb_call_set_metadata, 1);
   rb_define_method(grpc_rb_cCall, "trailing_metadata",
                    grpc_rb_call_get_trailing_metadata, 0);
-  rb_define_method(grpc_rb_cCall, "trailing_metadata=",
-                   grpc_rb_call_set_trailing_metadata, 1);
+  rb_define_method(grpc_rb_cCall,
+                   "trailing_metadata=", grpc_rb_call_set_trailing_metadata, 1);
   rb_define_method(grpc_rb_cCall, "write_flag", grpc_rb_call_get_write_flag, 0);
   rb_define_method(grpc_rb_cCall, "write_flag=", grpc_rb_call_set_write_flag,
                    1);
@@ -1035,15 +1034,15 @@
 }
 
 /* Gets the call from the ruby object */
-grpc_call *grpc_rb_get_wrapped_call(VALUE v) {
-  grpc_rb_call *call = NULL;
+grpc_call* grpc_rb_get_wrapped_call(VALUE v) {
+  grpc_rb_call* call = NULL;
   TypedData_Get_Struct(v, grpc_rb_call, &grpc_call_data_type, call);
   return call->wrapped;
 }
 
 /* Obtains the wrapped object for a given call */
-VALUE grpc_rb_wrap_call(grpc_call *c, grpc_completion_queue *q) {
-  grpc_rb_call *wrapper;
+VALUE grpc_rb_wrap_call(grpc_call* c, grpc_completion_queue* q) {
+  grpc_rb_call* wrapper;
   if (c == NULL || q == NULL) {
     return Qnil;
   }
diff --git a/src/ruby/ext/grpc/rb_call.h b/src/ruby/ext/grpc/rb_call.h
index bfe8035..a2202eb 100644
--- a/src/ruby/ext/grpc/rb_call.h
+++ b/src/ruby/ext/grpc/rb_call.h
@@ -24,24 +24,24 @@
 #include <grpc/grpc.h>
 
 /* Gets the wrapped call from a VALUE. */
-grpc_call *grpc_rb_get_wrapped_call(VALUE v);
+grpc_call* grpc_rb_get_wrapped_call(VALUE v);
 
 /* Gets the VALUE corresponding to given grpc_call. */
-VALUE grpc_rb_wrap_call(grpc_call *c, grpc_completion_queue *q);
+VALUE grpc_rb_wrap_call(grpc_call* c, grpc_completion_queue* q);
 
 /* Provides the details of an call error */
-const char *grpc_call_error_detail_of(grpc_call_error err);
+const char* grpc_call_error_detail_of(grpc_call_error err);
 
 /* Converts a metadata array to a hash. */
-VALUE grpc_rb_md_ary_to_h(grpc_metadata_array *md_ary);
+VALUE grpc_rb_md_ary_to_h(grpc_metadata_array* md_ary);
 
 /* grpc_rb_md_ary_convert converts a ruby metadata hash into
    a grpc_metadata_array.
 */
-void grpc_rb_md_ary_convert(VALUE md_ary_hash, grpc_metadata_array *md_ary);
+void grpc_rb_md_ary_convert(VALUE md_ary_hash, grpc_metadata_array* md_ary);
 
 void grpc_rb_metadata_array_destroy_including_entries(
-    grpc_metadata_array *md_ary);
+    grpc_metadata_array* md_ary);
 
 /* grpc_rb_eCallError is the ruby class of the exception thrown during call
    operations. */
diff --git a/src/ruby/ext/grpc/rb_call_credentials.c b/src/ruby/ext/grpc/rb_call_credentials.c
index 4214a08..be32597 100644
--- a/src/ruby/ext/grpc/rb_call_credentials.c
+++ b/src/ruby/ext/grpc/rb_call_credentials.c
@@ -44,13 +44,13 @@
   VALUE mark;
 
   /* The actual credentials */
-  grpc_call_credentials *wrapped;
+  grpc_call_credentials* wrapped;
 } grpc_rb_call_credentials;
 
 typedef struct callback_params {
   VALUE get_metadata;
   grpc_auth_metadata_context context;
-  void *user_data;
+  void* user_data;
   grpc_credentials_plugin_metadata_cb callback;
 } callback_params;
 
@@ -82,8 +82,8 @@
   return result;
 }
 
-static void grpc_rb_call_credentials_callback_with_gil(void *param) {
-  callback_params *const params = (callback_params *)param;
+static void grpc_rb_call_credentials_callback_with_gil(void* param) {
+  callback_params* const params = (callback_params*)param;
   VALUE auth_uri = rb_str_new_cstr(params->context.service_url);
   /* Pass the arguments to the proc in a hash, which currently only has they key
      'auth_uri' */
@@ -93,7 +93,7 @@
   grpc_metadata_array md_ary;
   grpc_status_code status;
   VALUE details;
-  char *error_details;
+  char* error_details;
   grpc_metadata_array_init(&md_ary);
   rb_hash_aset(args, ID2SYM(rb_intern("jwt_aud_uri")), auth_uri);
   rb_ary_push(callback_args, params->get_metadata);
@@ -113,34 +113,34 @@
 }
 
 static int grpc_rb_call_credentials_plugin_get_metadata(
-    void *state, grpc_auth_metadata_context context,
-    grpc_credentials_plugin_metadata_cb cb, void *user_data,
+    void* state, grpc_auth_metadata_context context,
+    grpc_credentials_plugin_metadata_cb cb, void* user_data,
     grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
-    size_t *num_creds_md, grpc_status_code *status,
-    const char **error_details) {
-  callback_params *params = gpr_malloc(sizeof(callback_params));
+    size_t* num_creds_md, grpc_status_code* status,
+    const char** error_details) {
+  callback_params* params = gpr_malloc(sizeof(callback_params));
   params->get_metadata = (VALUE)state;
   params->context = context;
   params->user_data = user_data;
   params->callback = cb;
 
   grpc_rb_event_queue_enqueue(grpc_rb_call_credentials_callback_with_gil,
-                              (void *)(params));
+                              (void*)(params));
   return 0;  // Async return.
 }
 
-static void grpc_rb_call_credentials_plugin_destroy(void *state) {
+static void grpc_rb_call_credentials_plugin_destroy(void* state) {
   (void)state;
   // Not sure what needs to be done here
 }
 
 /* Destroys the credentials instances. */
-static void grpc_rb_call_credentials_free(void *p) {
-  grpc_rb_call_credentials *wrapper;
+static void grpc_rb_call_credentials_free(void* p) {
+  grpc_rb_call_credentials* wrapper;
   if (p == NULL) {
     return;
   }
-  wrapper = (grpc_rb_call_credentials *)p;
+  wrapper = (grpc_rb_call_credentials*)p;
   grpc_call_credentials_release(wrapper->wrapped);
   wrapper->wrapped = NULL;
 
@@ -148,12 +148,12 @@
 }
 
 /* Protects the mark object from GC */
-static void grpc_rb_call_credentials_mark(void *p) {
-  grpc_rb_call_credentials *wrapper = NULL;
+static void grpc_rb_call_credentials_mark(void* p) {
+  grpc_rb_call_credentials* wrapper = NULL;
   if (p == NULL) {
     return;
   }
-  wrapper = (grpc_rb_call_credentials *)p;
+  wrapper = (grpc_rb_call_credentials*)p;
   if (wrapper->mark != Qnil) {
     rb_gc_mark(wrapper->mark);
   }
@@ -175,7 +175,7 @@
 /* Allocates CallCredentials instances.
    Provides safe initial defaults for the instance fields. */
 static VALUE grpc_rb_call_credentials_alloc(VALUE cls) {
-  grpc_rb_call_credentials *wrapper = ALLOC(grpc_rb_call_credentials);
+  grpc_rb_call_credentials* wrapper = ALLOC(grpc_rb_call_credentials);
   wrapper->wrapped = NULL;
   wrapper->mark = Qnil;
   return TypedData_Wrap_Struct(cls, &grpc_rb_call_credentials_data_type,
@@ -185,9 +185,9 @@
 /* Creates a wrapping object for a given call credentials. This should only be
  * called with grpc_call_credentials objects that are not already associated
  * with any Ruby object */
-VALUE grpc_rb_wrap_call_credentials(grpc_call_credentials *c, VALUE mark) {
+VALUE grpc_rb_wrap_call_credentials(grpc_call_credentials* c, VALUE mark) {
   VALUE rb_wrapper;
-  grpc_rb_call_credentials *wrapper;
+  grpc_rb_call_credentials* wrapper;
   if (c == NULL) {
     return Qnil;
   }
@@ -208,8 +208,8 @@
   proc: (required) Proc that generates auth metadata
   Initializes CallCredential instances. */
 static VALUE grpc_rb_call_credentials_init(VALUE self, VALUE proc) {
-  grpc_rb_call_credentials *wrapper = NULL;
-  grpc_call_credentials *creds = NULL;
+  grpc_rb_call_credentials* wrapper = NULL;
+  grpc_call_credentials* creds = NULL;
   grpc_metadata_credentials_plugin plugin;
 
   grpc_ruby_once_init();
@@ -223,7 +223,7 @@
     rb_raise(rb_eTypeError, "Argument to CallCredentials#new must be a proc");
     return Qnil;
   }
-  plugin.state = (void *)proc;
+  plugin.state = (void*)proc;
   plugin.type = "";
 
   creds = grpc_metadata_credentials_create_from_plugin(plugin, NULL);
@@ -239,11 +239,11 @@
   return self;
 }
 
-static VALUE grpc_rb_call_credentials_compose(int argc, VALUE *argv,
+static VALUE grpc_rb_call_credentials_compose(int argc, VALUE* argv,
                                               VALUE self) {
-  grpc_call_credentials *creds;
-  grpc_call_credentials *other;
-  grpc_call_credentials *prev = NULL;
+  grpc_call_credentials* creds;
+  grpc_call_credentials* other;
+  grpc_call_credentials* prev = NULL;
   VALUE mark;
   if (argc == 0) {
     return self;
@@ -282,8 +282,8 @@
 }
 
 /* Gets the wrapped grpc_call_credentials from the ruby wrapper */
-grpc_call_credentials *grpc_rb_get_wrapped_call_credentials(VALUE v) {
-  grpc_rb_call_credentials *wrapper = NULL;
+grpc_call_credentials* grpc_rb_get_wrapped_call_credentials(VALUE v) {
+  grpc_rb_call_credentials* wrapper = NULL;
   TypedData_Get_Struct(v, grpc_rb_call_credentials,
                        &grpc_rb_call_credentials_data_type, wrapper);
   return wrapper->wrapped;
diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c
index f0af54d..1d11a53 100644
--- a/src/ruby/ext/grpc/rb_channel.c
+++ b/src/ruby/ext/grpc/rb_channel.c
@@ -54,9 +54,9 @@
 static VALUE grpc_rb_cChannelArgs;
 
 typedef struct bg_watched_channel {
-  grpc_channel *channel;
+  grpc_channel* channel;
   // these fields must only be accessed under global_connection_polling_mu
-  struct bg_watched_channel *next;
+  struct bg_watched_channel* next;
   int channel_destroyed;
   int refcount;
 } bg_watched_channel;
@@ -67,7 +67,7 @@
 
   /* The actual channel (protected in a wrapper to tell when it's safe to
    * destroy) */
-  bg_watched_channel *bg_wrapped;
+  bg_watched_channel* bg_wrapped;
 } grpc_rb_channel;
 
 typedef enum { CONTINUOUS_WATCH, WATCH_STATE_API } watch_state_op_type;
@@ -82,40 +82,40 @@
       int called_back;
     } api_callback_args;
     struct {
-      bg_watched_channel *bg;
+      bg_watched_channel* bg;
     } continuous_watch_callback_args;
   } op;
 } watch_state_op;
 
-static bg_watched_channel *bg_watched_channel_list_head = NULL;
+static bg_watched_channel* bg_watched_channel_list_head = NULL;
 
 static void grpc_rb_channel_try_register_connection_polling(
-    bg_watched_channel *bg);
-static void *wait_until_channel_polling_thread_started_no_gil(void *);
-static void wait_until_channel_polling_thread_started_unblocking_func(void *);
-static void *channel_init_try_register_connection_polling_without_gil(
-    void *arg);
+    bg_watched_channel* bg);
+static void* wait_until_channel_polling_thread_started_no_gil(void*);
+static void wait_until_channel_polling_thread_started_unblocking_func(void*);
+static void* channel_init_try_register_connection_polling_without_gil(
+    void* arg);
 
 typedef struct channel_init_try_register_stack {
-  grpc_channel *channel;
-  grpc_rb_channel *wrapper;
+  grpc_channel* channel;
+  grpc_rb_channel* wrapper;
 } channel_init_try_register_stack;
 
-static grpc_completion_queue *channel_polling_cq;
+static grpc_completion_queue* channel_polling_cq;
 static gpr_mu global_connection_polling_mu;
 static gpr_cv global_connection_polling_cv;
 static int abort_channel_polling = 0;
 static int channel_polling_thread_started = 0;
 
-static int bg_watched_channel_list_lookup(bg_watched_channel *bg);
-static bg_watched_channel *bg_watched_channel_list_create_and_add(
-    grpc_channel *channel);
-static void bg_watched_channel_list_free_and_remove(bg_watched_channel *bg);
-static void run_poll_channels_loop_unblocking_func(void *arg);
+static int bg_watched_channel_list_lookup(bg_watched_channel* bg);
+static bg_watched_channel* bg_watched_channel_list_create_and_add(
+    grpc_channel* channel);
+static void bg_watched_channel_list_free_and_remove(bg_watched_channel* bg);
+static void run_poll_channels_loop_unblocking_func(void* arg);
 
 // Needs to be called under global_connection_polling_mu
 static void grpc_rb_channel_watch_connection_state_op_complete(
-    watch_state_op *op, int success) {
+    watch_state_op* op, int success) {
   GPR_ASSERT(!op->op.api_callback_args.called_back);
   op->op.api_callback_args.called_back = 1;
   op->op.api_callback_args.success = success;
@@ -124,7 +124,7 @@
 }
 
 /* Avoids destroying a channel twice. */
-static void grpc_rb_channel_safe_destroy(bg_watched_channel *bg) {
+static void grpc_rb_channel_safe_destroy(bg_watched_channel* bg) {
   gpr_mu_lock(&global_connection_polling_mu);
   GPR_ASSERT(bg_watched_channel_list_lookup(bg));
   if (!bg->channel_destroyed) {
@@ -138,18 +138,18 @@
   gpr_mu_unlock(&global_connection_polling_mu);
 }
 
-static void *channel_safe_destroy_without_gil(void *arg) {
-  grpc_rb_channel_safe_destroy((bg_watched_channel *)arg);
+static void* channel_safe_destroy_without_gil(void* arg) {
+  grpc_rb_channel_safe_destroy((bg_watched_channel*)arg);
   return NULL;
 }
 
 /* Destroys Channel instances. */
-static void grpc_rb_channel_free(void *p) {
-  grpc_rb_channel *ch = NULL;
+static void grpc_rb_channel_free(void* p) {
+  grpc_rb_channel* ch = NULL;
   if (p == NULL) {
     return;
   };
-  ch = (grpc_rb_channel *)p;
+  ch = (grpc_rb_channel*)p;
 
   if (ch->bg_wrapped != NULL) {
     /* assumption made here: it's ok to directly gpr_mu_lock the global
@@ -164,12 +164,12 @@
 }
 
 /* Protects the mark object from GC */
-static void grpc_rb_channel_mark(void *p) {
-  grpc_rb_channel *channel = NULL;
+static void grpc_rb_channel_mark(void* p) {
+  grpc_rb_channel* channel = NULL;
   if (p == NULL) {
     return;
   }
-  channel = (grpc_rb_channel *)p;
+  channel = (grpc_rb_channel*)p;
   if (channel->credentials != Qnil) {
     rb_gc_mark(channel->credentials);
   }
@@ -189,7 +189,7 @@
 
 /* Allocates grpc_rb_channel instances. */
 static VALUE grpc_rb_channel_alloc(VALUE cls) {
-  grpc_rb_channel *wrapper = ALLOC(grpc_rb_channel);
+  grpc_rb_channel* wrapper = ALLOC(grpc_rb_channel);
   wrapper->bg_wrapped = NULL;
   wrapper->credentials = Qnil;
   return TypedData_Wrap_Struct(cls, &grpc_channel_data_type, wrapper);
@@ -203,14 +203,14 @@
     secure_channel = Channel:new("myhost:443", {'arg1': 'value1'}, creds)
 
   Creates channel instances. */
-static VALUE grpc_rb_channel_init(int argc, VALUE *argv, VALUE self) {
+static VALUE grpc_rb_channel_init(int argc, VALUE* argv, VALUE self) {
   VALUE channel_args = Qnil;
   VALUE credentials = Qnil;
   VALUE target = Qnil;
-  grpc_rb_channel *wrapper = NULL;
-  grpc_channel *ch = NULL;
-  grpc_channel_credentials *creds = NULL;
-  char *target_chars = NULL;
+  grpc_rb_channel* wrapper = NULL;
+  grpc_channel* ch = NULL;
+  grpc_channel_credentials* creds = NULL;
+  char* target_chars = NULL;
   grpc_channel_args args;
   channel_init_try_register_stack stack;
   int stop_waiting_for_thread_start = 0;
@@ -262,13 +262,13 @@
 }
 
 typedef struct get_state_stack {
-  bg_watched_channel *bg;
+  bg_watched_channel* bg;
   int try_to_connect;
   int out;
 } get_state_stack;
 
-static void *get_state_without_gil(void *arg) {
-  get_state_stack *stack = (get_state_stack *)arg;
+static void* get_state_without_gil(void* arg) {
+  get_state_stack* stack = (get_state_stack*)arg;
 
   gpr_mu_lock(&global_connection_polling_mu);
   GPR_ASSERT(abort_channel_polling || channel_polling_thread_started);
@@ -292,10 +292,10 @@
   constants defined in GRPC::Core::ConnectivityStates.
 
   It also tries to connect if the chennel is idle in the second form. */
-static VALUE grpc_rb_channel_get_connectivity_state(int argc, VALUE *argv,
+static VALUE grpc_rb_channel_get_connectivity_state(int argc, VALUE* argv,
                                                     VALUE self) {
   VALUE try_to_connect_param = Qfalse;
-  grpc_rb_channel *wrapper = NULL;
+  grpc_rb_channel* wrapper = NULL;
   get_state_stack stack;
 
   /* "01" == 0 mandatory args, 1 (try_to_connect) is optional */
@@ -315,22 +315,22 @@
 }
 
 typedef struct watch_state_stack {
-  grpc_channel *channel;
+  grpc_channel* channel;
   gpr_timespec deadline;
   int last_state;
 } watch_state_stack;
 
-static void *wait_for_watch_state_op_complete_without_gvl(void *arg) {
-  watch_state_stack *stack = (watch_state_stack *)arg;
-  watch_state_op *op = NULL;
-  void *success = (void *)0;
+static void* wait_for_watch_state_op_complete_without_gvl(void* arg) {
+  watch_state_stack* stack = (watch_state_stack*)arg;
+  watch_state_op* op = NULL;
+  void* success = (void*)0;
 
   gpr_mu_lock(&global_connection_polling_mu);
   // its unsafe to do a "watch" after "channel polling abort" because the cq has
   // been shut down.
   if (abort_channel_polling) {
     gpr_mu_unlock(&global_connection_polling_mu);
-    return (void *)0;
+    return (void*)0;
   }
   op = gpr_zalloc(sizeof(watch_state_op));
   op->op_type = WATCH_STATE_API;
@@ -343,15 +343,15 @@
                 gpr_inf_future(GPR_CLOCK_REALTIME));
   }
   if (op->op.api_callback_args.success) {
-    success = (void *)1;
+    success = (void*)1;
   }
   gpr_free(op);
   gpr_mu_unlock(&global_connection_polling_mu);
 
   return success;
 }
-static void wait_for_watch_state_op_complete_unblocking_func(void *arg) {
-  bg_watched_channel *bg = (bg_watched_channel *)arg;
+static void wait_for_watch_state_op_complete_unblocking_func(void* arg) {
+  bg_watched_channel* bg = (bg_watched_channel*)arg;
   gpr_mu_lock(&global_connection_polling_mu);
   if (!bg->channel_destroyed) {
     grpc_channel_destroy(bg->channel);
@@ -370,9 +370,9 @@
 static VALUE grpc_rb_channel_watch_connectivity_state(VALUE self,
                                                       VALUE last_state,
                                                       VALUE deadline) {
-  grpc_rb_channel *wrapper = NULL;
+  grpc_rb_channel* wrapper = NULL;
   watch_state_stack stack;
-  void *op_success = 0;
+  void* op_success = 0;
 
   TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper);
 
@@ -405,15 +405,15 @@
                                          VALUE method, VALUE host,
                                          VALUE deadline) {
   VALUE res = Qnil;
-  grpc_rb_channel *wrapper = NULL;
-  grpc_call *call = NULL;
-  grpc_call *parent_call = NULL;
-  grpc_completion_queue *cq = NULL;
+  grpc_rb_channel* wrapper = NULL;
+  grpc_call* call = NULL;
+  grpc_call* parent_call = NULL;
+  grpc_completion_queue* cq = NULL;
   int flags = GRPC_PROPAGATE_DEFAULTS;
   grpc_slice method_slice;
   grpc_slice host_slice;
-  grpc_slice *host_slice_ptr = NULL;
-  char *tmp_str = NULL;
+  grpc_slice* host_slice_ptr = NULL;
+  char* tmp_str = NULL;
 
   if (host != Qnil) {
     host_slice =
@@ -466,7 +466,7 @@
 /* Note this is an API-level call; a wrapped channel's finalizer doesn't call
  * this */
 static VALUE grpc_rb_channel_destroy(VALUE self) {
-  grpc_rb_channel *wrapper = NULL;
+  grpc_rb_channel* wrapper = NULL;
 
   TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper);
   if (wrapper->bg_wrapped != NULL) {
@@ -480,9 +480,9 @@
 
 /* Called to obtain the target that this channel accesses. */
 static VALUE grpc_rb_channel_get_target(VALUE self) {
-  grpc_rb_channel *wrapper = NULL;
+  grpc_rb_channel* wrapper = NULL;
   VALUE res = Qnil;
-  char *target = NULL;
+  char* target = NULL;
 
   TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper);
   target = grpc_channel_get_target(wrapper->bg_wrapped->channel);
@@ -493,8 +493,8 @@
 }
 
 /* Needs to be called under global_connection_polling_mu */
-static int bg_watched_channel_list_lookup(bg_watched_channel *target) {
-  bg_watched_channel *cur = bg_watched_channel_list_head;
+static int bg_watched_channel_list_lookup(bg_watched_channel* target) {
+  bg_watched_channel* cur = bg_watched_channel_list_head;
 
   while (cur != NULL) {
     if (cur == target) {
@@ -507,9 +507,9 @@
 }
 
 /* Needs to be called under global_connection_polling_mu */
-static bg_watched_channel *bg_watched_channel_list_create_and_add(
-    grpc_channel *channel) {
-  bg_watched_channel *watched = gpr_zalloc(sizeof(bg_watched_channel));
+static bg_watched_channel* bg_watched_channel_list_create_and_add(
+    grpc_channel* channel) {
+  bg_watched_channel* watched = gpr_zalloc(sizeof(bg_watched_channel));
 
   watched->channel = channel;
   watched->next = bg_watched_channel_list_head;
@@ -520,8 +520,8 @@
 
 /* Needs to be called under global_connection_polling_mu */
 static void bg_watched_channel_list_free_and_remove(
-    bg_watched_channel *target) {
-  bg_watched_channel *bg = NULL;
+    bg_watched_channel* target) {
+  bg_watched_channel* bg = NULL;
 
   GPR_ASSERT(bg_watched_channel_list_lookup(target));
   GPR_ASSERT(target->channel_destroyed && target->refcount == 0);
@@ -544,10 +544,10 @@
 
 /* Initialize a grpc_rb_channel's "protected grpc_channel" and try to push
  * it onto the background thread for constant watches. */
-static void *channel_init_try_register_connection_polling_without_gil(
-    void *arg) {
-  channel_init_try_register_stack *stack =
-      (channel_init_try_register_stack *)arg;
+static void* channel_init_try_register_connection_polling_without_gil(
+    void* arg) {
+  channel_init_try_register_stack* stack =
+      (channel_init_try_register_stack*)arg;
 
   gpr_mu_lock(&global_connection_polling_mu);
   stack->wrapper->bg_wrapped =
@@ -559,9 +559,9 @@
 
 // Needs to be called under global_connection_poolling_mu
 static void grpc_rb_channel_try_register_connection_polling(
-    bg_watched_channel *bg) {
+    bg_watched_channel* bg) {
   grpc_connectivity_state conn_state;
-  watch_state_op *op = NULL;
+  watch_state_op* op = NULL;
 
   GPR_ASSERT(channel_polling_thread_started || abort_channel_polling);
 
@@ -597,10 +597,10 @@
 // indicates process shutdown.
 // In the worst case, this stops polling channel connectivity
 // early and falls back to current behavior.
-static void *run_poll_channels_loop_no_gil(void *arg) {
+static void* run_poll_channels_loop_no_gil(void* arg) {
   grpc_event event;
-  watch_state_op *op = NULL;
-  bg_watched_channel *bg = NULL;
+  watch_state_op* op = NULL;
+  bg_watched_channel* bg = NULL;
   (void)arg;
   gpr_log(GPR_DEBUG, "GRPC_RUBY: run_poll_channels_loop_no_gil - begin");
 
@@ -618,15 +618,15 @@
     }
     gpr_mu_lock(&global_connection_polling_mu);
     if (event.type == GRPC_OP_COMPLETE) {
-      op = (watch_state_op *)event.tag;
+      op = (watch_state_op*)event.tag;
       if (op->op_type == CONTINUOUS_WATCH) {
-        bg = (bg_watched_channel *)op->op.continuous_watch_callback_args.bg;
+        bg = (bg_watched_channel*)op->op.continuous_watch_callback_args.bg;
         bg->refcount--;
         grpc_rb_channel_try_register_connection_polling(bg);
         gpr_free(op);
       } else if (op->op_type == WATCH_STATE_API) {
         grpc_rb_channel_watch_connection_state_op_complete(
-            (watch_state_op *)event.tag, event.success);
+            (watch_state_op*)event.tag, event.success);
       } else {
         GPR_ASSERT(0);
       }
@@ -641,8 +641,8 @@
 }
 
 // Notify the channel polling loop to cleanup and shutdown.
-static void run_poll_channels_loop_unblocking_func(void *arg) {
-  bg_watched_channel *bg = NULL;
+static void run_poll_channels_loop_unblocking_func(void* arg) {
+  bg_watched_channel* bg = NULL;
   (void)arg;
 
   gpr_mu_lock(&global_connection_polling_mu);
@@ -686,8 +686,8 @@
   return Qnil;
 }
 
-static void *wait_until_channel_polling_thread_started_no_gil(void *arg) {
-  int *stop_waiting = (int *)arg;
+static void* wait_until_channel_polling_thread_started_no_gil(void* arg) {
+  int* stop_waiting = (int*)arg;
   gpr_log(GPR_DEBUG, "GRPC_RUBY: wait for channel polling thread to start");
   gpr_mu_lock(&global_connection_polling_mu);
   while (!channel_polling_thread_started && !abort_channel_polling &&
@@ -701,8 +701,8 @@
 }
 
 static void wait_until_channel_polling_thread_started_unblocking_func(
-    void *arg) {
-  int *stop_waiting = (int *)arg;
+    void* arg) {
+  int* stop_waiting = (int*)arg;
   gpr_mu_lock(&global_connection_polling_mu);
   gpr_log(GPR_DEBUG,
           "GRPC_RUBY: interrupt wait for channel polling thread to start");
@@ -711,7 +711,7 @@
   gpr_mu_unlock(&global_connection_polling_mu);
 }
 
-static void *set_abort_channel_polling_without_gil(void *arg) {
+static void* set_abort_channel_polling_without_gil(void* arg) {
   (void)arg;
   gpr_mu_lock(&global_connection_polling_mu);
   abort_channel_polling = 1;
@@ -822,8 +822,8 @@
 }
 
 /* Gets the wrapped channel from the ruby wrapper */
-grpc_channel *grpc_rb_get_wrapped_channel(VALUE v) {
-  grpc_rb_channel *wrapper = NULL;
+grpc_channel* grpc_rb_get_wrapped_channel(VALUE v) {
+  grpc_rb_channel* wrapper = NULL;
   TypedData_Get_Struct(v, grpc_rb_channel, &grpc_channel_data_type, wrapper);
   return wrapper->bg_wrapped->channel;
 }
diff --git a/src/ruby/ext/grpc/rb_channel_credentials.c b/src/ruby/ext/grpc/rb_channel_credentials.c
index 83601ca..b23a32c 100644
--- a/src/ruby/ext/grpc/rb_channel_credentials.c
+++ b/src/ruby/ext/grpc/rb_channel_credentials.c
@@ -35,7 +35,7 @@
    grpc_channel_credentials. */
 static VALUE grpc_rb_cChannelCredentials = Qnil;
 
-static char *pem_root_certs = NULL;
+static char* pem_root_certs = NULL;
 
 /* grpc_rb_channel_credentials wraps a grpc_channel_credentials.  It provides a
  * mark object that is used to hold references to any objects used to create
@@ -45,16 +45,16 @@
   VALUE mark;
 
   /* The actual credentials */
-  grpc_channel_credentials *wrapped;
+  grpc_channel_credentials* wrapped;
 } grpc_rb_channel_credentials;
 
 /* Destroys the credentials instances. */
-static void grpc_rb_channel_credentials_free(void *p) {
-  grpc_rb_channel_credentials *wrapper = NULL;
+static void grpc_rb_channel_credentials_free(void* p) {
+  grpc_rb_channel_credentials* wrapper = NULL;
   if (p == NULL) {
     return;
   };
-  wrapper = (grpc_rb_channel_credentials *)p;
+  wrapper = (grpc_rb_channel_credentials*)p;
   grpc_channel_credentials_release(wrapper->wrapped);
   wrapper->wrapped = NULL;
 
@@ -62,12 +62,12 @@
 }
 
 /* Protects the mark object from GC */
-static void grpc_rb_channel_credentials_mark(void *p) {
-  grpc_rb_channel_credentials *wrapper = NULL;
+static void grpc_rb_channel_credentials_mark(void* p) {
+  grpc_rb_channel_credentials* wrapper = NULL;
   if (p == NULL) {
     return;
   }
-  wrapper = (grpc_rb_channel_credentials *)p;
+  wrapper = (grpc_rb_channel_credentials*)p;
 
   if (wrapper->mark != Qnil) {
     rb_gc_mark(wrapper->mark);
@@ -90,7 +90,7 @@
 /* Allocates ChannelCredential instances.
    Provides safe initial defaults for the instance fields. */
 static VALUE grpc_rb_channel_credentials_alloc(VALUE cls) {
-  grpc_rb_channel_credentials *wrapper = ALLOC(grpc_rb_channel_credentials);
+  grpc_rb_channel_credentials* wrapper = ALLOC(grpc_rb_channel_credentials);
   wrapper->wrapped = NULL;
   wrapper->mark = Qnil;
   return TypedData_Wrap_Struct(cls, &grpc_rb_channel_credentials_data_type,
@@ -100,10 +100,10 @@
 /* Creates a wrapping object for a given channel credentials. This should only
  * be called with grpc_channel_credentials objects that are not already
  * associated with any Ruby object. */
-VALUE grpc_rb_wrap_channel_credentials(grpc_channel_credentials *c,
+VALUE grpc_rb_wrap_channel_credentials(grpc_channel_credentials* c,
                                        VALUE mark) {
   VALUE rb_wrapper;
-  grpc_rb_channel_credentials *wrapper;
+  grpc_rb_channel_credentials* wrapper;
   if (c == NULL) {
     return Qnil;
   }
@@ -136,15 +136,15 @@
     pem_private_key: (optional) PEM encoding of the client's private key
     pem_cert_chain: (optional) PEM encoding of the client's cert chain
     Initializes Credential instances. */
-static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv,
+static VALUE grpc_rb_channel_credentials_init(int argc, VALUE* argv,
                                               VALUE self) {
   VALUE pem_root_certs = Qnil;
   VALUE pem_private_key = Qnil;
   VALUE pem_cert_chain = Qnil;
-  grpc_rb_channel_credentials *wrapper = NULL;
-  grpc_channel_credentials *creds = NULL;
+  grpc_rb_channel_credentials* wrapper = NULL;
+  grpc_channel_credentials* creds = NULL;
   grpc_ssl_pem_key_cert_pair key_cert_pair;
-  const char *pem_root_certs_cstr = NULL;
+  const char* pem_root_certs_cstr = NULL;
   MEMZERO(&key_cert_pair, grpc_ssl_pem_key_cert_pair, 1);
 
   grpc_ruby_once_init();
@@ -180,11 +180,11 @@
   return self;
 }
 
-static VALUE grpc_rb_channel_credentials_compose(int argc, VALUE *argv,
+static VALUE grpc_rb_channel_credentials_compose(int argc, VALUE* argv,
                                                  VALUE self) {
-  grpc_channel_credentials *creds;
-  grpc_call_credentials *other;
-  grpc_channel_credentials *prev = NULL;
+  grpc_channel_credentials* creds;
+  grpc_call_credentials* other;
+  grpc_channel_credentials* prev = NULL;
   VALUE mark;
   if (argc == 0) {
     return self;
@@ -210,7 +210,7 @@
 }
 
 static grpc_ssl_roots_override_result get_ssl_roots_override(
-    char **pem_root_certs_ptr) {
+    char** pem_root_certs_ptr) {
   *pem_root_certs_ptr = pem_root_certs;
   if (pem_root_certs == NULL) {
     return GRPC_SSL_ROOTS_OVERRIDE_FAIL;
@@ -220,7 +220,7 @@
 }
 
 static VALUE grpc_rb_set_default_roots_pem(VALUE self, VALUE roots) {
-  char *roots_ptr = StringValueCStr(roots);
+  char* roots_ptr = StringValueCStr(roots);
   size_t length = strlen(roots_ptr);
   (void)self;
   pem_root_certs = gpr_malloc((length + 1) * sizeof(char));
@@ -255,8 +255,8 @@
 }
 
 /* Gets the wrapped grpc_channel_credentials from the ruby wrapper */
-grpc_channel_credentials *grpc_rb_get_wrapped_channel_credentials(VALUE v) {
-  grpc_rb_channel_credentials *wrapper = NULL;
+grpc_channel_credentials* grpc_rb_get_wrapped_channel_credentials(VALUE v) {
+  grpc_rb_channel_credentials* wrapper = NULL;
   TypedData_Get_Struct(v, grpc_rb_channel_credentials,
                        &grpc_rb_channel_credentials_data_type, wrapper);
   return wrapper->wrapped;
diff --git a/src/ruby/ext/grpc/rb_completion_queue.c b/src/ruby/ext/grpc/rb_completion_queue.c
index 4283c27..64264f5 100644
--- a/src/ruby/ext/grpc/rb_completion_queue.c
+++ b/src/ruby/ext/grpc/rb_completion_queue.c
@@ -30,16 +30,16 @@
 
 /* Used to allow grpc_completion_queue_next call to release the GIL */
 typedef struct next_call_stack {
-  grpc_completion_queue *cq;
+  grpc_completion_queue* cq;
   grpc_event event;
   gpr_timespec timeout;
-  void *tag;
+  void* tag;
   volatile int interrupted;
 } next_call_stack;
 
 /* Calls grpc_completion_queue_pluck without holding the ruby GIL */
-static void *grpc_rb_completion_queue_pluck_no_gil(void *param) {
-  next_call_stack *const next_call = (next_call_stack *)param;
+static void* grpc_rb_completion_queue_pluck_no_gil(void* param) {
+  next_call_stack* const next_call = (next_call_stack*)param;
   gpr_timespec increment = gpr_time_from_millis(20, GPR_TIMESPAN);
   gpr_timespec deadline;
   do {
@@ -55,7 +55,7 @@
 }
 
 /* Helper function to free a completion queue. */
-void grpc_rb_completion_queue_destroy(grpc_completion_queue *cq) {
+void grpc_rb_completion_queue_destroy(grpc_completion_queue* cq) {
   /* Every function that adds an event to a queue also synchronously plucks
      that event from the queue, and holds a reference to the Ruby object that
      holds the queue, so we only get to this point if all of those functions
@@ -64,15 +64,15 @@
   grpc_completion_queue_destroy(cq);
 }
 
-static void unblock_func(void *param) {
-  next_call_stack *const next_call = (next_call_stack *)param;
+static void unblock_func(void* param) {
+  next_call_stack* const next_call = (next_call_stack*)param;
   next_call->interrupted = 1;
 }
 
 /* Does the same thing as grpc_completion_queue_pluck, while properly releasing
    the GVL and handling interrupts */
-grpc_event rb_completion_queue_pluck(grpc_completion_queue *queue, void *tag,
-                                     gpr_timespec deadline, void *reserved) {
+grpc_event rb_completion_queue_pluck(grpc_completion_queue* queue, void* tag,
+                                     gpr_timespec deadline, void* reserved) {
   next_call_stack next_call;
   MEMZERO(&next_call, next_call_stack, 1);
   next_call.cq = queue;
@@ -91,8 +91,8 @@
   do {
     next_call.interrupted = 0;
     rb_thread_call_without_gvl(grpc_rb_completion_queue_pluck_no_gil,
-                               (void *)&next_call, unblock_func,
-                               (void *)&next_call);
+                               (void*)&next_call, unblock_func,
+                               (void*)&next_call);
     /* If an interrupt prevented pluck from returning useful information, then
        any plucks that did complete must have timed out */
   } while (next_call.interrupted && next_call.event.type == GRPC_QUEUE_TIMEOUT);
diff --git a/src/ruby/ext/grpc/rb_completion_queue.h b/src/ruby/ext/grpc/rb_completion_queue.h
index 011b849..8c29089 100644
--- a/src/ruby/ext/grpc/rb_completion_queue.h
+++ b/src/ruby/ext/grpc/rb_completion_queue.h
@@ -23,14 +23,14 @@
 
 #include <grpc/grpc.h>
 
-void grpc_rb_completion_queue_destroy(grpc_completion_queue *cq);
+void grpc_rb_completion_queue_destroy(grpc_completion_queue* cq);
 
 /**
  * Makes the implementation of CompletionQueue#pluck available in other files
  *
  * This avoids having code that holds the GIL repeated at multiple sites.
  */
-grpc_event rb_completion_queue_pluck(grpc_completion_queue *queue, void *tag,
-                                     gpr_timespec deadline, void *reserved);
+grpc_event rb_completion_queue_pluck(grpc_completion_queue* queue, void* tag,
+                                     gpr_timespec deadline, void* reserved);
 
 #endif /* GRPC_RB_COMPLETION_QUEUE_H_ */
diff --git a/src/ruby/ext/grpc/rb_compression_options.c b/src/ruby/ext/grpc/rb_compression_options.c
index 3365b17..e24f20d 100644
--- a/src/ruby/ext/grpc/rb_compression_options.c
+++ b/src/ruby/ext/grpc/rb_compression_options.c
@@ -47,17 +47,17 @@
  * Ruby objects and don't have a mark for GC. */
 typedef struct grpc_rb_compression_options {
   /* The actual compression options that's being wrapped */
-  grpc_compression_options *wrapped;
+  grpc_compression_options* wrapped;
 } grpc_rb_compression_options;
 
 /* Destroys the compression options instances and free the
  * wrapped grpc compression options. */
-static void grpc_rb_compression_options_free(void *p) {
-  grpc_rb_compression_options *wrapper = NULL;
+static void grpc_rb_compression_options_free(void* p) {
+  grpc_rb_compression_options* wrapper = NULL;
   if (p == NULL) {
     return;
   };
-  wrapper = (grpc_rb_compression_options *)p;
+  wrapper = (grpc_rb_compression_options*)p;
 
   if (wrapper->wrapped != NULL) {
     gpr_free(wrapper->wrapped);
@@ -85,7 +85,7 @@
    Allocate the wrapped grpc compression options and
    initialize it here too. */
 static VALUE grpc_rb_compression_options_alloc(VALUE cls) {
-  grpc_rb_compression_options *wrapper = NULL;
+  grpc_rb_compression_options* wrapper = NULL;
 
   grpc_ruby_once_init();
 
@@ -103,7 +103,7 @@
 VALUE grpc_rb_compression_options_disable_compression_algorithm_internal(
     VALUE self, VALUE algorithm_to_disable) {
   grpc_compression_algorithm compression_algorithm = 0;
-  grpc_rb_compression_options *wrapper = NULL;
+  grpc_rb_compression_options* wrapper = NULL;
 
   TypedData_Get_Struct(self, grpc_rb_compression_options,
                        &grpc_rb_compression_options_data_type, wrapper);
@@ -145,7 +145,7 @@
 /* Sets the default compression level, given the name of a compression level.
  * Throws an error if no algorithm matched. */
 void grpc_rb_compression_options_set_default_level(
-    grpc_compression_options *options, VALUE new_level_name) {
+    grpc_compression_options* options, VALUE new_level_name) {
   options->default_level.level =
       grpc_rb_compression_options_level_name_to_value_internal(new_level_name);
   options->default_level.is_set = 1;
@@ -156,10 +156,10 @@
  * algorithm_value is an out parameter.
  * Raises an error if the name of the algorithm passed in is invalid. */
 void grpc_rb_compression_options_algorithm_name_to_value_internal(
-    grpc_compression_algorithm *algorithm_value, VALUE algorithm_name) {
+    grpc_compression_algorithm* algorithm_value, VALUE algorithm_name) {
   grpc_slice name_slice;
   VALUE algorithm_name_as_string = Qnil;
-  char *tmp_str = NULL;
+  char* tmp_str = NULL;
 
   Check_Type(algorithm_name, T_SYMBOL);
 
@@ -186,7 +186,7 @@
  * readable algorithm name. */
 VALUE grpc_rb_compression_options_is_algorithm_enabled(VALUE self,
                                                        VALUE algorithm_name) {
-  grpc_rb_compression_options *wrapper = NULL;
+  grpc_rb_compression_options* wrapper = NULL;
   grpc_compression_algorithm internal_algorithm_value;
 
   TypedData_Get_Struct(self, grpc_rb_compression_options,
@@ -204,7 +204,7 @@
 /* Sets the default algorithm to the name of the algorithm passed in.
  * Raises an error if the name is not a valid compression algorithm name. */
 void grpc_rb_compression_options_set_default_algorithm(
-    grpc_compression_options *options, VALUE algorithm_name) {
+    grpc_compression_options* options, VALUE algorithm_name) {
   grpc_rb_compression_options_algorithm_name_to_value_internal(
       &options->default_algorithm.algorithm, algorithm_name);
   options->default_algorithm.is_set = 1;
@@ -214,7 +214,7 @@
  * algorithm.
  * Fails if the algorithm name is invalid. */
 void grpc_rb_compression_options_disable_algorithm(
-    grpc_compression_options *compression_options, VALUE algorithm_name) {
+    grpc_compression_options* compression_options, VALUE algorithm_name) {
   grpc_compression_algorithm internal_algorithm_value;
 
   grpc_rb_compression_options_algorithm_name_to_value_internal(
@@ -226,8 +226,8 @@
 /* Provides a ruby hash of GRPC core channel argument key-values that
  * correspond to the compression settings on this instance. */
 VALUE grpc_rb_compression_options_to_hash(VALUE self) {
-  grpc_rb_compression_options *wrapper = NULL;
-  grpc_compression_options *compression_options = NULL;
+  grpc_rb_compression_options* wrapper = NULL;
+  grpc_compression_options* compression_options = NULL;
   VALUE channel_arg_hash = rb_hash_new();
   VALUE key = Qnil;
   VALUE value = Qnil;
@@ -284,7 +284,7 @@
  * Fails if the enum value is invalid. */
 VALUE grpc_rb_compression_options_algorithm_value_to_name_internal(
     grpc_compression_algorithm internal_value) {
-  char *algorithm_name = NULL;
+  char* algorithm_name = NULL;
 
   if (!grpc_compression_algorithm_name(internal_value, &algorithm_name)) {
     rb_raise(rb_eArgError, "Failed to convert algorithm value to name");
@@ -297,7 +297,7 @@
  * Returns nil if no algorithm has been set. */
 VALUE grpc_rb_compression_options_get_default_algorithm(VALUE self) {
   grpc_compression_algorithm internal_value;
-  grpc_rb_compression_options *wrapper = NULL;
+  grpc_rb_compression_options* wrapper = NULL;
 
   TypedData_Get_Struct(self, grpc_rb_compression_options,
                        &grpc_rb_compression_options_data_type, wrapper);
@@ -316,7 +316,7 @@
  * A nil return value means that it hasn't been set. */
 VALUE grpc_rb_compression_options_get_default_level(VALUE self) {
   grpc_compression_level internal_value;
-  grpc_rb_compression_options *wrapper = NULL;
+  grpc_rb_compression_options* wrapper = NULL;
 
   TypedData_Get_Struct(self, grpc_rb_compression_options,
                        &grpc_rb_compression_options_data_type, wrapper);
@@ -335,7 +335,7 @@
 VALUE grpc_rb_compression_options_get_disabled_algorithms(VALUE self) {
   VALUE disabled_algorithms = rb_ary_new();
   grpc_compression_algorithm internal_value;
-  grpc_rb_compression_options *wrapper = NULL;
+  grpc_rb_compression_options* wrapper = NULL;
 
   TypedData_Get_Struct(self, grpc_rb_compression_options,
                        &grpc_rb_compression_options_data_type, wrapper);
@@ -363,8 +363,8 @@
  *   channel_arg hash = Hash.new[...]
  *   channel_arg_hash_with_compression_options = channel_arg_hash.merge(options)
  */
-VALUE grpc_rb_compression_options_init(int argc, VALUE *argv, VALUE self) {
-  grpc_rb_compression_options *wrapper = NULL;
+VALUE grpc_rb_compression_options_init(int argc, VALUE* argv, VALUE self) {
+  grpc_rb_compression_options* wrapper = NULL;
   VALUE default_algorithm = Qnil;
   VALUE default_level = Qnil;
   VALUE disabled_algorithms = Qnil;
diff --git a/src/ruby/ext/grpc/rb_event_thread.c b/src/ruby/ext/grpc/rb_event_thread.c
index b0bcb6f..281e41c 100644
--- a/src/ruby/ext/grpc/rb_event_thread.c
+++ b/src/ruby/ext/grpc/rb_event_thread.c
@@ -31,15 +31,15 @@
 
 typedef struct grpc_rb_event {
   // callback will be called with argument while holding the GVL
-  void (*callback)(void *);
-  void *argument;
+  void (*callback)(void*);
+  void* argument;
 
-  struct grpc_rb_event *next;
+  struct grpc_rb_event* next;
 } grpc_rb_event;
 
 typedef struct grpc_rb_event_queue {
-  grpc_rb_event *head;
-  grpc_rb_event *tail;
+  grpc_rb_event* head;
+  grpc_rb_event* tail;
 
   gpr_mu mu;
   gpr_cv cv;
@@ -50,8 +50,8 @@
 
 static grpc_rb_event_queue event_queue;
 
-void grpc_rb_event_queue_enqueue(void (*callback)(void *), void *argument) {
-  grpc_rb_event *event = gpr_malloc(sizeof(grpc_rb_event));
+void grpc_rb_event_queue_enqueue(void (*callback)(void*), void* argument) {
+  grpc_rb_event* event = gpr_malloc(sizeof(grpc_rb_event));
   event->callback = callback;
   event->argument = argument;
   event->next = NULL;
@@ -66,8 +66,8 @@
   gpr_mu_unlock(&event_queue.mu);
 }
 
-static grpc_rb_event *grpc_rb_event_queue_dequeue() {
-  grpc_rb_event *event;
+static grpc_rb_event* grpc_rb_event_queue_dequeue() {
+  grpc_rb_event* event;
   if (event_queue.head == NULL) {
     event = NULL;
   } else {
@@ -86,8 +86,8 @@
   gpr_cv_destroy(&event_queue.cv);
 }
 
-static void *grpc_rb_wait_for_event_no_gil(void *param) {
-  grpc_rb_event *event = NULL;
+static void* grpc_rb_wait_for_event_no_gil(void* param) {
+  grpc_rb_event* event = NULL;
   (void)param;
   gpr_mu_lock(&event_queue.mu);
   while (!event_queue.abort) {
@@ -102,7 +102,7 @@
   return NULL;
 }
 
-static void grpc_rb_event_unblocking_func(void *arg) {
+static void grpc_rb_event_unblocking_func(void* arg) {
   (void)arg;
   gpr_mu_lock(&event_queue.mu);
   event_queue.abort = true;
@@ -113,10 +113,10 @@
 /* This is the implementation of the thread that handles auth metadata plugin
  * events */
 static VALUE grpc_rb_event_thread(VALUE arg) {
-  grpc_rb_event *event;
+  grpc_rb_event* event;
   (void)arg;
   while (true) {
-    event = (grpc_rb_event *)rb_thread_call_without_gvl(
+    event = (grpc_rb_event*)rb_thread_call_without_gvl(
         grpc_rb_wait_for_event_no_gil, NULL, grpc_rb_event_unblocking_func,
         NULL);
     if (event == NULL) {
diff --git a/src/ruby/ext/grpc/rb_event_thread.h b/src/ruby/ext/grpc/rb_event_thread.h
index 5bfecb9..fa9c14e 100644
--- a/src/ruby/ext/grpc/rb_event_thread.h
+++ b/src/ruby/ext/grpc/rb_event_thread.h
@@ -18,4 +18,4 @@
 
 void grpc_rb_event_queue_thread_start();
 
-void grpc_rb_event_queue_enqueue(void (*callback)(void *), void *argument);
+void grpc_rb_event_queue_enqueue(void (*callback)(void*), void* argument);
diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c
index b53f09e..f065a85 100644
--- a/src/ruby/ext/grpc/rb_grpc.c
+++ b/src/ruby/ext/grpc/rb_grpc.c
@@ -90,9 +90,9 @@
  */
 gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) {
   gpr_timespec t;
-  gpr_timespec *time_const;
-  const char *tstr = interval ? "time interval" : "time";
-  const char *want = " want <secs from epoch>|<Time>|<GRPC::TimeConst.*>";
+  gpr_timespec* time_const;
+  const char* tstr = interval ? "time interval" : "time";
+  const char* want = " want <secs from epoch>|<Time>|<GRPC::TimeConst.*>";
 
   t.clock_type = GPR_CLOCK_REALTIME;
   switch (TYPE(time)) {
@@ -201,7 +201,7 @@
 
 /* Converts a wrapped time constant to a standard time. */
 static VALUE grpc_rb_time_val_to_time(VALUE self) {
-  gpr_timespec *time_const = NULL;
+  gpr_timespec* time_const = NULL;
   gpr_timespec real_time;
   TypedData_Get_Struct(self, gpr_timespec, &grpc_rb_timespec_data_type,
                        time_const);
@@ -236,15 +236,15 @@
   rb_define_const(
       grpc_rb_mTimeConsts, "ZERO",
       TypedData_Wrap_Struct(grpc_rb_cTimeVal, &grpc_rb_timespec_data_type,
-                            (void *)&zero_realtime));
+                            (void*)&zero_realtime));
   rb_define_const(
       grpc_rb_mTimeConsts, "INFINITE_FUTURE",
       TypedData_Wrap_Struct(grpc_rb_cTimeVal, &grpc_rb_timespec_data_type,
-                            (void *)&inf_future_realtime));
+                            (void*)&inf_future_realtime));
   rb_define_const(
       grpc_rb_mTimeConsts, "INFINITE_PAST",
       TypedData_Wrap_Struct(grpc_rb_cTimeVal, &grpc_rb_timespec_data_type,
-                            (void *)&inf_past_realtime));
+                            (void*)&inf_past_realtime));
   rb_define_method(grpc_rb_cTimeVal, "to_time", grpc_rb_time_val_to_time, 0);
   rb_define_method(grpc_rb_cTimeVal, "inspect", grpc_rb_time_val_inspect, 0);
   rb_define_method(grpc_rb_cTimeVal, "to_s", grpc_rb_time_val_to_s, 0);
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
index 7083149..648d515 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
@@ -22,34 +22,6 @@
 
 #include "rb_grpc_imports.generated.h"
 
-census_initialize_type census_initialize_import;
-census_shutdown_type census_shutdown_import;
-census_supported_type census_supported_import;
-census_enabled_type census_enabled_import;
-census_context_create_type census_context_create_import;
-census_context_destroy_type census_context_destroy_import;
-census_context_get_status_type census_context_get_status_import;
-census_context_initialize_iterator_type census_context_initialize_iterator_import;
-census_context_next_tag_type census_context_next_tag_import;
-census_context_get_tag_type census_context_get_tag_import;
-census_context_encode_type census_context_encode_import;
-census_context_decode_type census_context_decode_import;
-census_trace_mask_type census_trace_mask_import;
-census_set_trace_mask_type census_set_trace_mask_import;
-census_start_rpc_op_timestamp_type census_start_rpc_op_timestamp_import;
-census_start_client_rpc_op_type census_start_client_rpc_op_import;
-census_set_rpc_client_peer_type census_set_rpc_client_peer_import;
-census_start_server_rpc_op_type census_start_server_rpc_op_import;
-census_start_op_type census_start_op_import;
-census_end_op_type census_end_op_import;
-census_trace_print_type census_trace_print_import;
-census_trace_scan_start_type census_trace_scan_start_import;
-census_get_trace_record_type census_get_trace_record_import;
-census_trace_scan_end_type census_trace_scan_end_import;
-census_define_resource_type census_define_resource_import;
-census_delete_resource_type census_delete_resource_import;
-census_resource_id_type census_resource_id_import;
-census_record_values_type census_record_values_import;
 grpc_compression_algorithm_parse_type grpc_compression_algorithm_parse_import;
 grpc_compression_algorithm_name_type grpc_compression_algorithm_name_import;
 grpc_stream_compression_algorithm_name_type grpc_stream_compression_algorithm_name_import;
@@ -77,6 +49,8 @@
 grpc_completion_queue_pluck_type grpc_completion_queue_pluck_import;
 grpc_completion_queue_shutdown_type grpc_completion_queue_shutdown_import;
 grpc_completion_queue_destroy_type grpc_completion_queue_destroy_import;
+grpc_completion_queue_thread_local_cache_init_type grpc_completion_queue_thread_local_cache_init_import;
+grpc_completion_queue_thread_local_cache_flush_type grpc_completion_queue_thread_local_cache_flush_import;
 grpc_alarm_create_type grpc_alarm_create_import;
 grpc_alarm_set_type grpc_alarm_set_import;
 grpc_alarm_cancel_type grpc_alarm_cancel_import;
@@ -153,8 +127,14 @@
 grpc_metadata_credentials_create_from_plugin_type grpc_metadata_credentials_create_from_plugin_import;
 grpc_secure_channel_create_type grpc_secure_channel_create_import;
 grpc_server_credentials_release_type grpc_server_credentials_release_import;
+grpc_ssl_server_certificate_config_create_type grpc_ssl_server_certificate_config_create_import;
+grpc_ssl_server_certificate_config_destroy_type grpc_ssl_server_certificate_config_destroy_import;
 grpc_ssl_server_credentials_create_type grpc_ssl_server_credentials_create_import;
 grpc_ssl_server_credentials_create_ex_type grpc_ssl_server_credentials_create_ex_import;
+grpc_ssl_server_credentials_create_options_using_config_type grpc_ssl_server_credentials_create_options_using_config_import;
+grpc_ssl_server_credentials_create_options_using_config_fetcher_type grpc_ssl_server_credentials_create_options_using_config_fetcher_import;
+grpc_ssl_server_credentials_options_destroy_type grpc_ssl_server_credentials_options_destroy_import;
+grpc_ssl_server_credentials_create_with_options_type grpc_ssl_server_credentials_create_with_options_import;
 grpc_server_add_secure_http2_port_type grpc_server_add_secure_http2_port_import;
 grpc_call_set_credentials_type grpc_call_set_credentials_import;
 grpc_server_credentials_set_auth_metadata_processor_type grpc_server_credentials_set_auth_metadata_processor_import;
@@ -192,7 +172,6 @@
 grpc_slice_eq_type grpc_slice_eq_import;
 grpc_slice_cmp_type grpc_slice_cmp_import;
 grpc_slice_str_cmp_type grpc_slice_str_cmp_import;
-grpc_slice_buf_cmp_type grpc_slice_buf_cmp_import;
 grpc_slice_buf_start_eq_type grpc_slice_buf_start_eq_import;
 grpc_slice_rchr_type grpc_slice_rchr_import;
 grpc_slice_chr_type grpc_slice_chr_import;
@@ -330,34 +309,6 @@
 gpr_timespec_to_micros_type gpr_timespec_to_micros_import;
 
 void grpc_rb_load_imports(HMODULE library) {
-  census_initialize_import = (census_initialize_type) GetProcAddress(library, "census_initialize");
-  census_shutdown_import = (census_shutdown_type) GetProcAddress(library, "census_shutdown");
-  census_supported_import = (census_supported_type) GetProcAddress(library, "census_supported");
-  census_enabled_import = (census_enabled_type) GetProcAddress(library, "census_enabled");
-  census_context_create_import = (census_context_create_type) GetProcAddress(library, "census_context_create");
-  census_context_destroy_import = (census_context_destroy_type) GetProcAddress(library, "census_context_destroy");
-  census_context_get_status_import = (census_context_get_status_type) GetProcAddress(library, "census_context_get_status");
-  census_context_initialize_iterator_import = (census_context_initialize_iterator_type) GetProcAddress(library, "census_context_initialize_iterator");
-  census_context_next_tag_import = (census_context_next_tag_type) GetProcAddress(library, "census_context_next_tag");
-  census_context_get_tag_import = (census_context_get_tag_type) GetProcAddress(library, "census_context_get_tag");
-  census_context_encode_import = (census_context_encode_type) GetProcAddress(library, "census_context_encode");
-  census_context_decode_import = (census_context_decode_type) GetProcAddress(library, "census_context_decode");
-  census_trace_mask_import = (census_trace_mask_type) GetProcAddress(library, "census_trace_mask");
-  census_set_trace_mask_import = (census_set_trace_mask_type) GetProcAddress(library, "census_set_trace_mask");
-  census_start_rpc_op_timestamp_import = (census_start_rpc_op_timestamp_type) GetProcAddress(library, "census_start_rpc_op_timestamp");
-  census_start_client_rpc_op_import = (census_start_client_rpc_op_type) GetProcAddress(library, "census_start_client_rpc_op");
-  census_set_rpc_client_peer_import = (census_set_rpc_client_peer_type) GetProcAddress(library, "census_set_rpc_client_peer");
-  census_start_server_rpc_op_import = (census_start_server_rpc_op_type) GetProcAddress(library, "census_start_server_rpc_op");
-  census_start_op_import = (census_start_op_type) GetProcAddress(library, "census_start_op");
-  census_end_op_import = (census_end_op_type) GetProcAddress(library, "census_end_op");
-  census_trace_print_import = (census_trace_print_type) GetProcAddress(library, "census_trace_print");
-  census_trace_scan_start_import = (census_trace_scan_start_type) GetProcAddress(library, "census_trace_scan_start");
-  census_get_trace_record_import = (census_get_trace_record_type) GetProcAddress(library, "census_get_trace_record");
-  census_trace_scan_end_import = (census_trace_scan_end_type) GetProcAddress(library, "census_trace_scan_end");
-  census_define_resource_import = (census_define_resource_type) GetProcAddress(library, "census_define_resource");
-  census_delete_resource_import = (census_delete_resource_type) GetProcAddress(library, "census_delete_resource");
-  census_resource_id_import = (census_resource_id_type) GetProcAddress(library, "census_resource_id");
-  census_record_values_import = (census_record_values_type) GetProcAddress(library, "census_record_values");
   grpc_compression_algorithm_parse_import = (grpc_compression_algorithm_parse_type) GetProcAddress(library, "grpc_compression_algorithm_parse");
   grpc_compression_algorithm_name_import = (grpc_compression_algorithm_name_type) GetProcAddress(library, "grpc_compression_algorithm_name");
   grpc_stream_compression_algorithm_name_import = (grpc_stream_compression_algorithm_name_type) GetProcAddress(library, "grpc_stream_compression_algorithm_name");
@@ -385,6 +336,8 @@
   grpc_completion_queue_pluck_import = (grpc_completion_queue_pluck_type) GetProcAddress(library, "grpc_completion_queue_pluck");
   grpc_completion_queue_shutdown_import = (grpc_completion_queue_shutdown_type) GetProcAddress(library, "grpc_completion_queue_shutdown");
   grpc_completion_queue_destroy_import = (grpc_completion_queue_destroy_type) GetProcAddress(library, "grpc_completion_queue_destroy");
+  grpc_completion_queue_thread_local_cache_init_import = (grpc_completion_queue_thread_local_cache_init_type) GetProcAddress(library, "grpc_completion_queue_thread_local_cache_init");
+  grpc_completion_queue_thread_local_cache_flush_import = (grpc_completion_queue_thread_local_cache_flush_type) GetProcAddress(library, "grpc_completion_queue_thread_local_cache_flush");
   grpc_alarm_create_import = (grpc_alarm_create_type) GetProcAddress(library, "grpc_alarm_create");
   grpc_alarm_set_import = (grpc_alarm_set_type) GetProcAddress(library, "grpc_alarm_set");
   grpc_alarm_cancel_import = (grpc_alarm_cancel_type) GetProcAddress(library, "grpc_alarm_cancel");
@@ -461,8 +414,14 @@
   grpc_metadata_credentials_create_from_plugin_import = (grpc_metadata_credentials_create_from_plugin_type) GetProcAddress(library, "grpc_metadata_credentials_create_from_plugin");
   grpc_secure_channel_create_import = (grpc_secure_channel_create_type) GetProcAddress(library, "grpc_secure_channel_create");
   grpc_server_credentials_release_import = (grpc_server_credentials_release_type) GetProcAddress(library, "grpc_server_credentials_release");
+  grpc_ssl_server_certificate_config_create_import = (grpc_ssl_server_certificate_config_create_type) GetProcAddress(library, "grpc_ssl_server_certificate_config_create");
+  grpc_ssl_server_certificate_config_destroy_import = (grpc_ssl_server_certificate_config_destroy_type) GetProcAddress(library, "grpc_ssl_server_certificate_config_destroy");
   grpc_ssl_server_credentials_create_import = (grpc_ssl_server_credentials_create_type) GetProcAddress(library, "grpc_ssl_server_credentials_create");
   grpc_ssl_server_credentials_create_ex_import = (grpc_ssl_server_credentials_create_ex_type) GetProcAddress(library, "grpc_ssl_server_credentials_create_ex");
+  grpc_ssl_server_credentials_create_options_using_config_import = (grpc_ssl_server_credentials_create_options_using_config_type) GetProcAddress(library, "grpc_ssl_server_credentials_create_options_using_config");
+  grpc_ssl_server_credentials_create_options_using_config_fetcher_import = (grpc_ssl_server_credentials_create_options_using_config_fetcher_type) GetProcAddress(library, "grpc_ssl_server_credentials_create_options_using_config_fetcher");
+  grpc_ssl_server_credentials_options_destroy_import = (grpc_ssl_server_credentials_options_destroy_type) GetProcAddress(library, "grpc_ssl_server_credentials_options_destroy");
+  grpc_ssl_server_credentials_create_with_options_import = (grpc_ssl_server_credentials_create_with_options_type) GetProcAddress(library, "grpc_ssl_server_credentials_create_with_options");
   grpc_server_add_secure_http2_port_import = (grpc_server_add_secure_http2_port_type) GetProcAddress(library, "grpc_server_add_secure_http2_port");
   grpc_call_set_credentials_import = (grpc_call_set_credentials_type) GetProcAddress(library, "grpc_call_set_credentials");
   grpc_server_credentials_set_auth_metadata_processor_import = (grpc_server_credentials_set_auth_metadata_processor_type) GetProcAddress(library, "grpc_server_credentials_set_auth_metadata_processor");
@@ -500,7 +459,6 @@
   grpc_slice_eq_import = (grpc_slice_eq_type) GetProcAddress(library, "grpc_slice_eq");
   grpc_slice_cmp_import = (grpc_slice_cmp_type) GetProcAddress(library, "grpc_slice_cmp");
   grpc_slice_str_cmp_import = (grpc_slice_str_cmp_type) GetProcAddress(library, "grpc_slice_str_cmp");
-  grpc_slice_buf_cmp_import = (grpc_slice_buf_cmp_type) GetProcAddress(library, "grpc_slice_buf_cmp");
   grpc_slice_buf_start_eq_import = (grpc_slice_buf_start_eq_type) GetProcAddress(library, "grpc_slice_buf_start_eq");
   grpc_slice_rchr_import = (grpc_slice_rchr_type) GetProcAddress(library, "grpc_slice_rchr");
   grpc_slice_chr_import = (grpc_slice_chr_type) GetProcAddress(library, "grpc_slice_chr");
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
index 868772c..ae1e1a0 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
@@ -25,7 +25,6 @@
 
 #include <windows.h>
 
-#include <grpc/census.h>
 #include <grpc/compression.h>
 #include <grpc/grpc.h>
 #include <grpc/grpc_posix.h>
@@ -47,97 +46,13 @@
 #include <grpc/support/thd.h>
 #include <grpc/support/time.h>
 
-typedef int(*census_initialize_type)(int features);
-extern census_initialize_type census_initialize_import;
-#define census_initialize census_initialize_import
-typedef void(*census_shutdown_type)(void);
-extern census_shutdown_type census_shutdown_import;
-#define census_shutdown census_shutdown_import
-typedef int(*census_supported_type)(void);
-extern census_supported_type census_supported_import;
-#define census_supported census_supported_import
-typedef int(*census_enabled_type)(void);
-extern census_enabled_type census_enabled_import;
-#define census_enabled census_enabled_import
-typedef census_context *(*census_context_create_type)(const census_context *base, const census_tag *tags, int ntags, census_context_status const **status);
-extern census_context_create_type census_context_create_import;
-#define census_context_create census_context_create_import
-typedef void(*census_context_destroy_type)(census_context *context);
-extern census_context_destroy_type census_context_destroy_import;
-#define census_context_destroy census_context_destroy_import
-typedef const census_context_status *(*census_context_get_status_type)(const census_context *context);
-extern census_context_get_status_type census_context_get_status_import;
-#define census_context_get_status census_context_get_status_import
-typedef void(*census_context_initialize_iterator_type)(const census_context *context, census_context_iterator *iterator);
-extern census_context_initialize_iterator_type census_context_initialize_iterator_import;
-#define census_context_initialize_iterator census_context_initialize_iterator_import
-typedef int(*census_context_next_tag_type)(census_context_iterator *iterator, census_tag *tag);
-extern census_context_next_tag_type census_context_next_tag_import;
-#define census_context_next_tag census_context_next_tag_import
-typedef int(*census_context_get_tag_type)(const census_context *context, const char *key, census_tag *tag);
-extern census_context_get_tag_type census_context_get_tag_import;
-#define census_context_get_tag census_context_get_tag_import
-typedef size_t(*census_context_encode_type)(const census_context *context, char *buffer, size_t buf_size);
-extern census_context_encode_type census_context_encode_import;
-#define census_context_encode census_context_encode_import
-typedef census_context *(*census_context_decode_type)(const char *buffer, size_t size);
-extern census_context_decode_type census_context_decode_import;
-#define census_context_decode census_context_decode_import
-typedef int(*census_trace_mask_type)(const census_context *context);
-extern census_trace_mask_type census_trace_mask_import;
-#define census_trace_mask census_trace_mask_import
-typedef void(*census_set_trace_mask_type)(int trace_mask);
-extern census_set_trace_mask_type census_set_trace_mask_import;
-#define census_set_trace_mask census_set_trace_mask_import
-typedef census_timestamp(*census_start_rpc_op_timestamp_type)(void);
-extern census_start_rpc_op_timestamp_type census_start_rpc_op_timestamp_import;
-#define census_start_rpc_op_timestamp census_start_rpc_op_timestamp_import
-typedef census_context *(*census_start_client_rpc_op_type)(const census_context *context, int64_t rpc_name_id, const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask, const census_timestamp *start_time);
-extern census_start_client_rpc_op_type census_start_client_rpc_op_import;
-#define census_start_client_rpc_op census_start_client_rpc_op_import
-typedef void(*census_set_rpc_client_peer_type)(census_context *context, const char *peer);
-extern census_set_rpc_client_peer_type census_set_rpc_client_peer_import;
-#define census_set_rpc_client_peer census_set_rpc_client_peer_import
-typedef census_context *(*census_start_server_rpc_op_type)(const char *buffer, int64_t rpc_name_id, const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask, census_timestamp *start_time);
-extern census_start_server_rpc_op_type census_start_server_rpc_op_import;
-#define census_start_server_rpc_op census_start_server_rpc_op_import
-typedef census_context *(*census_start_op_type)(census_context *context, const char *family, const char *name, int trace_mask);
-extern census_start_op_type census_start_op_import;
-#define census_start_op census_start_op_import
-typedef void(*census_end_op_type)(census_context *context, int status);
-extern census_end_op_type census_end_op_import;
-#define census_end_op census_end_op_import
-typedef void(*census_trace_print_type)(census_context *context, uint32_t type, const char *buffer, size_t n);
-extern census_trace_print_type census_trace_print_import;
-#define census_trace_print census_trace_print_import
-typedef int(*census_trace_scan_start_type)(int consume);
-extern census_trace_scan_start_type census_trace_scan_start_import;
-#define census_trace_scan_start census_trace_scan_start_import
-typedef int(*census_get_trace_record_type)(census_trace_record *trace_record);
-extern census_get_trace_record_type census_get_trace_record_import;
-#define census_get_trace_record census_get_trace_record_import
-typedef void(*census_trace_scan_end_type)();
-extern census_trace_scan_end_type census_trace_scan_end_import;
-#define census_trace_scan_end census_trace_scan_end_import
-typedef int32_t(*census_define_resource_type)(const uint8_t *resource_pb, size_t resource_pb_size);
-extern census_define_resource_type census_define_resource_import;
-#define census_define_resource census_define_resource_import
-typedef void(*census_delete_resource_type)(int32_t resource_id);
-extern census_delete_resource_type census_delete_resource_import;
-#define census_delete_resource census_delete_resource_import
-typedef int32_t(*census_resource_id_type)(const char *name);
-extern census_resource_id_type census_resource_id_import;
-#define census_resource_id census_resource_id_import
-typedef void(*census_record_values_type)(census_context *context, census_value *values, size_t nvalues);
-extern census_record_values_type census_record_values_import;
-#define census_record_values census_record_values_import
-typedef int(*grpc_compression_algorithm_parse_type)(grpc_slice value, grpc_compression_algorithm *algorithm);
+typedef int(*grpc_compression_algorithm_parse_type)(grpc_slice value, grpc_compression_algorithm* algorithm);
 extern grpc_compression_algorithm_parse_type grpc_compression_algorithm_parse_import;
 #define grpc_compression_algorithm_parse grpc_compression_algorithm_parse_import
-typedef int(*grpc_compression_algorithm_name_type)(grpc_compression_algorithm algorithm, const char **name);
+typedef int(*grpc_compression_algorithm_name_type)(grpc_compression_algorithm algorithm, const char** name);
 extern grpc_compression_algorithm_name_type grpc_compression_algorithm_name_import;
 #define grpc_compression_algorithm_name grpc_compression_algorithm_name_import
-typedef int(*grpc_stream_compression_algorithm_name_type)(grpc_stream_compression_algorithm algorithm, const char **name);
+typedef int(*grpc_stream_compression_algorithm_name_type)(grpc_stream_compression_algorithm algorithm, const char** name);
 extern grpc_stream_compression_algorithm_name_type grpc_stream_compression_algorithm_name_import;
 #define grpc_stream_compression_algorithm_name grpc_stream_compression_algorithm_name_import
 typedef grpc_compression_algorithm(*grpc_compression_algorithm_for_level_type)(grpc_compression_level level, uint32_t accepted_encodings);
@@ -146,31 +61,31 @@
 typedef grpc_stream_compression_algorithm(*grpc_stream_compression_algorithm_for_level_type)(grpc_stream_compression_level level, uint32_t accepted_stream_encodings);
 extern grpc_stream_compression_algorithm_for_level_type grpc_stream_compression_algorithm_for_level_import;
 #define grpc_stream_compression_algorithm_for_level grpc_stream_compression_algorithm_for_level_import
-typedef void(*grpc_compression_options_init_type)(grpc_compression_options *opts);
+typedef void(*grpc_compression_options_init_type)(grpc_compression_options* opts);
 extern grpc_compression_options_init_type grpc_compression_options_init_import;
 #define grpc_compression_options_init grpc_compression_options_init_import
-typedef void(*grpc_compression_options_enable_algorithm_type)(grpc_compression_options *opts, grpc_compression_algorithm algorithm);
+typedef void(*grpc_compression_options_enable_algorithm_type)(grpc_compression_options* opts, grpc_compression_algorithm algorithm);
 extern grpc_compression_options_enable_algorithm_type grpc_compression_options_enable_algorithm_import;
 #define grpc_compression_options_enable_algorithm grpc_compression_options_enable_algorithm_import
-typedef void(*grpc_compression_options_disable_algorithm_type)(grpc_compression_options *opts, grpc_compression_algorithm algorithm);
+typedef void(*grpc_compression_options_disable_algorithm_type)(grpc_compression_options* opts, grpc_compression_algorithm algorithm);
 extern grpc_compression_options_disable_algorithm_type grpc_compression_options_disable_algorithm_import;
 #define grpc_compression_options_disable_algorithm grpc_compression_options_disable_algorithm_import
-typedef int(*grpc_compression_options_is_algorithm_enabled_type)(const grpc_compression_options *opts, grpc_compression_algorithm algorithm);
+typedef int(*grpc_compression_options_is_algorithm_enabled_type)(const grpc_compression_options* opts, grpc_compression_algorithm algorithm);
 extern grpc_compression_options_is_algorithm_enabled_type grpc_compression_options_is_algorithm_enabled_import;
 #define grpc_compression_options_is_algorithm_enabled grpc_compression_options_is_algorithm_enabled_import
-typedef int(*grpc_compression_options_is_stream_compression_algorithm_enabled_type)(const grpc_compression_options *opts, grpc_stream_compression_algorithm algorithm);
+typedef int(*grpc_compression_options_is_stream_compression_algorithm_enabled_type)(const grpc_compression_options* opts, grpc_stream_compression_algorithm algorithm);
 extern grpc_compression_options_is_stream_compression_algorithm_enabled_type grpc_compression_options_is_stream_compression_algorithm_enabled_import;
 #define grpc_compression_options_is_stream_compression_algorithm_enabled grpc_compression_options_is_stream_compression_algorithm_enabled_import
-typedef void(*grpc_metadata_array_init_type)(grpc_metadata_array *array);
+typedef void(*grpc_metadata_array_init_type)(grpc_metadata_array* array);
 extern grpc_metadata_array_init_type grpc_metadata_array_init_import;
 #define grpc_metadata_array_init grpc_metadata_array_init_import
-typedef void(*grpc_metadata_array_destroy_type)(grpc_metadata_array *array);
+typedef void(*grpc_metadata_array_destroy_type)(grpc_metadata_array* array);
 extern grpc_metadata_array_destroy_type grpc_metadata_array_destroy_import;
 #define grpc_metadata_array_destroy grpc_metadata_array_destroy_import
-typedef void(*grpc_call_details_init_type)(grpc_call_details *details);
+typedef void(*grpc_call_details_init_type)(grpc_call_details* details);
 extern grpc_call_details_init_type grpc_call_details_init_import;
 #define grpc_call_details_init grpc_call_details_init_import
-typedef void(*grpc_call_details_destroy_type)(grpc_call_details *details);
+typedef void(*grpc_call_details_destroy_type)(grpc_call_details* details);
 extern grpc_call_details_destroy_type grpc_call_details_destroy_import;
 #define grpc_call_details_destroy grpc_call_details_destroy_import
 typedef void(*grpc_register_plugin_type)(void (*init)(void), void (*destroy)(void));
@@ -182,145 +97,151 @@
 typedef void(*grpc_shutdown_type)(void);
 extern grpc_shutdown_type grpc_shutdown_import;
 #define grpc_shutdown grpc_shutdown_import
-typedef const char *(*grpc_version_string_type)(void);
+typedef const char*(*grpc_version_string_type)(void);
 extern grpc_version_string_type grpc_version_string_import;
 #define grpc_version_string grpc_version_string_import
-typedef const char *(*grpc_g_stands_for_type)(void);
+typedef const char*(*grpc_g_stands_for_type)(void);
 extern grpc_g_stands_for_type grpc_g_stands_for_import;
 #define grpc_g_stands_for grpc_g_stands_for_import
-typedef const grpc_completion_queue_factory *(*grpc_completion_queue_factory_lookup_type)(const grpc_completion_queue_attributes *attributes);
+typedef const grpc_completion_queue_factory*(*grpc_completion_queue_factory_lookup_type)(const grpc_completion_queue_attributes* attributes);
 extern grpc_completion_queue_factory_lookup_type grpc_completion_queue_factory_lookup_import;
 #define grpc_completion_queue_factory_lookup grpc_completion_queue_factory_lookup_import
-typedef grpc_completion_queue *(*grpc_completion_queue_create_for_next_type)(void *reserved);
+typedef grpc_completion_queue*(*grpc_completion_queue_create_for_next_type)(void* reserved);
 extern grpc_completion_queue_create_for_next_type grpc_completion_queue_create_for_next_import;
 #define grpc_completion_queue_create_for_next grpc_completion_queue_create_for_next_import
-typedef grpc_completion_queue *(*grpc_completion_queue_create_for_pluck_type)(void *reserved);
+typedef grpc_completion_queue*(*grpc_completion_queue_create_for_pluck_type)(void* reserved);
 extern grpc_completion_queue_create_for_pluck_type grpc_completion_queue_create_for_pluck_import;
 #define grpc_completion_queue_create_for_pluck grpc_completion_queue_create_for_pluck_import
-typedef grpc_completion_queue *(*grpc_completion_queue_create_type)(const grpc_completion_queue_factory *factory, const grpc_completion_queue_attributes *attributes, void *reserved);
+typedef grpc_completion_queue*(*grpc_completion_queue_create_type)(const grpc_completion_queue_factory* factory, const grpc_completion_queue_attributes* attributes, void* reserved);
 extern grpc_completion_queue_create_type grpc_completion_queue_create_import;
 #define grpc_completion_queue_create grpc_completion_queue_create_import
-typedef grpc_event(*grpc_completion_queue_next_type)(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved);
+typedef grpc_event(*grpc_completion_queue_next_type)(grpc_completion_queue* cq, gpr_timespec deadline, void* reserved);
 extern grpc_completion_queue_next_type grpc_completion_queue_next_import;
 #define grpc_completion_queue_next grpc_completion_queue_next_import
-typedef grpc_event(*grpc_completion_queue_pluck_type)(grpc_completion_queue *cq, void *tag, gpr_timespec deadline, void *reserved);
+typedef grpc_event(*grpc_completion_queue_pluck_type)(grpc_completion_queue* cq, void* tag, gpr_timespec deadline, void* reserved);
 extern grpc_completion_queue_pluck_type grpc_completion_queue_pluck_import;
 #define grpc_completion_queue_pluck grpc_completion_queue_pluck_import
-typedef void(*grpc_completion_queue_shutdown_type)(grpc_completion_queue *cq);
+typedef void(*grpc_completion_queue_shutdown_type)(grpc_completion_queue* cq);
 extern grpc_completion_queue_shutdown_type grpc_completion_queue_shutdown_import;
 #define grpc_completion_queue_shutdown grpc_completion_queue_shutdown_import
-typedef void(*grpc_completion_queue_destroy_type)(grpc_completion_queue *cq);
+typedef void(*grpc_completion_queue_destroy_type)(grpc_completion_queue* cq);
 extern grpc_completion_queue_destroy_type grpc_completion_queue_destroy_import;
 #define grpc_completion_queue_destroy grpc_completion_queue_destroy_import
-typedef grpc_alarm *(*grpc_alarm_create_type)(void *reserved);
+typedef void(*grpc_completion_queue_thread_local_cache_init_type)(grpc_completion_queue* cq);
+extern grpc_completion_queue_thread_local_cache_init_type grpc_completion_queue_thread_local_cache_init_import;
+#define grpc_completion_queue_thread_local_cache_init grpc_completion_queue_thread_local_cache_init_import
+typedef int(*grpc_completion_queue_thread_local_cache_flush_type)(grpc_completion_queue* cq, void** tag, int* ok);
+extern grpc_completion_queue_thread_local_cache_flush_type grpc_completion_queue_thread_local_cache_flush_import;
+#define grpc_completion_queue_thread_local_cache_flush grpc_completion_queue_thread_local_cache_flush_import
+typedef grpc_alarm*(*grpc_alarm_create_type)(void* reserved);
 extern grpc_alarm_create_type grpc_alarm_create_import;
 #define grpc_alarm_create grpc_alarm_create_import
-typedef void(*grpc_alarm_set_type)(grpc_alarm *alarm, grpc_completion_queue *cq, gpr_timespec deadline, void *tag, void *reserved);
+typedef void(*grpc_alarm_set_type)(grpc_alarm* alarm, grpc_completion_queue* cq, gpr_timespec deadline, void* tag, void* reserved);
 extern grpc_alarm_set_type grpc_alarm_set_import;
 #define grpc_alarm_set grpc_alarm_set_import
-typedef void(*grpc_alarm_cancel_type)(grpc_alarm *alarm, void *reserved);
+typedef void(*grpc_alarm_cancel_type)(grpc_alarm* alarm, void* reserved);
 extern grpc_alarm_cancel_type grpc_alarm_cancel_import;
 #define grpc_alarm_cancel grpc_alarm_cancel_import
-typedef void(*grpc_alarm_destroy_type)(grpc_alarm *alarm, void *reserved);
+typedef void(*grpc_alarm_destroy_type)(grpc_alarm* alarm, void* reserved);
 extern grpc_alarm_destroy_type grpc_alarm_destroy_import;
 #define grpc_alarm_destroy grpc_alarm_destroy_import
-typedef grpc_connectivity_state(*grpc_channel_check_connectivity_state_type)(grpc_channel *channel, int try_to_connect);
+typedef grpc_connectivity_state(*grpc_channel_check_connectivity_state_type)(grpc_channel* channel, int try_to_connect);
 extern grpc_channel_check_connectivity_state_type grpc_channel_check_connectivity_state_import;
 #define grpc_channel_check_connectivity_state grpc_channel_check_connectivity_state_import
-typedef int(*grpc_channel_num_external_connectivity_watchers_type)(grpc_channel *channel);
+typedef int(*grpc_channel_num_external_connectivity_watchers_type)(grpc_channel* channel);
 extern grpc_channel_num_external_connectivity_watchers_type grpc_channel_num_external_connectivity_watchers_import;
 #define grpc_channel_num_external_connectivity_watchers grpc_channel_num_external_connectivity_watchers_import
-typedef void(*grpc_channel_watch_connectivity_state_type)(grpc_channel *channel, grpc_connectivity_state last_observed_state, gpr_timespec deadline, grpc_completion_queue *cq, void *tag);
+typedef void(*grpc_channel_watch_connectivity_state_type)(grpc_channel* channel, grpc_connectivity_state last_observed_state, gpr_timespec deadline, grpc_completion_queue* cq, void* tag);
 extern grpc_channel_watch_connectivity_state_type grpc_channel_watch_connectivity_state_import;
 #define grpc_channel_watch_connectivity_state grpc_channel_watch_connectivity_state_import
-typedef int(*grpc_channel_support_connectivity_watcher_type)(grpc_channel *channel);
+typedef int(*grpc_channel_support_connectivity_watcher_type)(grpc_channel* channel);
 extern grpc_channel_support_connectivity_watcher_type grpc_channel_support_connectivity_watcher_import;
 #define grpc_channel_support_connectivity_watcher grpc_channel_support_connectivity_watcher_import
-typedef grpc_call *(*grpc_channel_create_call_type)(grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_completion_queue *completion_queue, grpc_slice method, const grpc_slice *host, gpr_timespec deadline, void *reserved);
+typedef grpc_call*(*grpc_channel_create_call_type)(grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask, grpc_completion_queue* completion_queue, grpc_slice method, const grpc_slice* host, gpr_timespec deadline, void* reserved);
 extern grpc_channel_create_call_type grpc_channel_create_call_import;
 #define grpc_channel_create_call grpc_channel_create_call_import
-typedef void(*grpc_channel_ping_type)(grpc_channel *channel, grpc_completion_queue *cq, void *tag, void *reserved);
+typedef void(*grpc_channel_ping_type)(grpc_channel* channel, grpc_completion_queue* cq, void* tag, void* reserved);
 extern grpc_channel_ping_type grpc_channel_ping_import;
 #define grpc_channel_ping grpc_channel_ping_import
-typedef void *(*grpc_channel_register_call_type)(grpc_channel *channel, const char *method, const char *host, void *reserved);
+typedef void*(*grpc_channel_register_call_type)(grpc_channel* channel, const char* method, const char* host, void* reserved);
 extern grpc_channel_register_call_type grpc_channel_register_call_import;
 #define grpc_channel_register_call grpc_channel_register_call_import
-typedef grpc_call *(*grpc_channel_create_registered_call_type)(grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_completion_queue *completion_queue, void *registered_call_handle, gpr_timespec deadline, void *reserved);
+typedef grpc_call*(*grpc_channel_create_registered_call_type)(grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask, grpc_completion_queue* completion_queue, void* registered_call_handle, gpr_timespec deadline, void* reserved);
 extern grpc_channel_create_registered_call_type grpc_channel_create_registered_call_import;
 #define grpc_channel_create_registered_call grpc_channel_create_registered_call_import
-typedef void *(*grpc_call_arena_alloc_type)(grpc_call *call, size_t size);
+typedef void*(*grpc_call_arena_alloc_type)(grpc_call* call, size_t size);
 extern grpc_call_arena_alloc_type grpc_call_arena_alloc_import;
 #define grpc_call_arena_alloc grpc_call_arena_alloc_import
-typedef grpc_call_error(*grpc_call_start_batch_type)(grpc_call *call, const grpc_op *ops, size_t nops, void *tag, void *reserved);
+typedef grpc_call_error(*grpc_call_start_batch_type)(grpc_call* call, const grpc_op* ops, size_t nops, void* tag, void* reserved);
 extern grpc_call_start_batch_type grpc_call_start_batch_import;
 #define grpc_call_start_batch grpc_call_start_batch_import
-typedef char *(*grpc_call_get_peer_type)(grpc_call *call);
+typedef char*(*grpc_call_get_peer_type)(grpc_call* call);
 extern grpc_call_get_peer_type grpc_call_get_peer_import;
 #define grpc_call_get_peer grpc_call_get_peer_import
-typedef void(*grpc_census_call_set_context_type)(grpc_call *call, struct census_context *context);
+typedef void(*grpc_census_call_set_context_type)(grpc_call* call, struct census_context* context);
 extern grpc_census_call_set_context_type grpc_census_call_set_context_import;
 #define grpc_census_call_set_context grpc_census_call_set_context_import
-typedef struct census_context *(*grpc_census_call_get_context_type)(grpc_call *call);
+typedef struct census_context*(*grpc_census_call_get_context_type)(grpc_call* call);
 extern grpc_census_call_get_context_type grpc_census_call_get_context_import;
 #define grpc_census_call_get_context grpc_census_call_get_context_import
-typedef char *(*grpc_channel_get_target_type)(grpc_channel *channel);
+typedef char*(*grpc_channel_get_target_type)(grpc_channel* channel);
 extern grpc_channel_get_target_type grpc_channel_get_target_import;
 #define grpc_channel_get_target grpc_channel_get_target_import
-typedef void(*grpc_channel_get_info_type)(grpc_channel *channel, const grpc_channel_info *channel_info);
+typedef void(*grpc_channel_get_info_type)(grpc_channel* channel, const grpc_channel_info* channel_info);
 extern grpc_channel_get_info_type grpc_channel_get_info_import;
 #define grpc_channel_get_info grpc_channel_get_info_import
-typedef grpc_channel *(*grpc_insecure_channel_create_type)(const char *target, const grpc_channel_args *args, void *reserved);
+typedef grpc_channel*(*grpc_insecure_channel_create_type)(const char* target, const grpc_channel_args* args, void* reserved);
 extern grpc_insecure_channel_create_type grpc_insecure_channel_create_import;
 #define grpc_insecure_channel_create grpc_insecure_channel_create_import
-typedef grpc_channel *(*grpc_lame_client_channel_create_type)(const char *target, grpc_status_code error_code, const char *error_message);
+typedef grpc_channel*(*grpc_lame_client_channel_create_type)(const char* target, grpc_status_code error_code, const char* error_message);
 extern grpc_lame_client_channel_create_type grpc_lame_client_channel_create_import;
 #define grpc_lame_client_channel_create grpc_lame_client_channel_create_import
-typedef void(*grpc_channel_destroy_type)(grpc_channel *channel);
+typedef void(*grpc_channel_destroy_type)(grpc_channel* channel);
 extern grpc_channel_destroy_type grpc_channel_destroy_import;
 #define grpc_channel_destroy grpc_channel_destroy_import
-typedef grpc_call_error(*grpc_call_cancel_type)(grpc_call *call, void *reserved);
+typedef grpc_call_error(*grpc_call_cancel_type)(grpc_call* call, void* reserved);
 extern grpc_call_cancel_type grpc_call_cancel_import;
 #define grpc_call_cancel grpc_call_cancel_import
-typedef grpc_call_error(*grpc_call_cancel_with_status_type)(grpc_call *call, grpc_status_code status, const char *description, void *reserved);
+typedef grpc_call_error(*grpc_call_cancel_with_status_type)(grpc_call* call, grpc_status_code status, const char* description, void* reserved);
 extern grpc_call_cancel_with_status_type grpc_call_cancel_with_status_import;
 #define grpc_call_cancel_with_status grpc_call_cancel_with_status_import
-typedef void(*grpc_call_ref_type)(grpc_call *call);
+typedef void(*grpc_call_ref_type)(grpc_call* call);
 extern grpc_call_ref_type grpc_call_ref_import;
 #define grpc_call_ref grpc_call_ref_import
-typedef void(*grpc_call_unref_type)(grpc_call *call);
+typedef void(*grpc_call_unref_type)(grpc_call* call);
 extern grpc_call_unref_type grpc_call_unref_import;
 #define grpc_call_unref grpc_call_unref_import
-typedef grpc_call_error(*grpc_server_request_call_type)(grpc_server *server, grpc_call **call, grpc_call_details *details, grpc_metadata_array *request_metadata, grpc_completion_queue *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void *tag_new);
+typedef grpc_call_error(*grpc_server_request_call_type)(grpc_server* server, grpc_call** call, grpc_call_details* details, grpc_metadata_array* request_metadata, grpc_completion_queue* cq_bound_to_call, grpc_completion_queue* cq_for_notification, void* tag_new);
 extern grpc_server_request_call_type grpc_server_request_call_import;
 #define grpc_server_request_call grpc_server_request_call_import
-typedef void *(*grpc_server_register_method_type)(grpc_server *server, const char *method, const char *host, grpc_server_register_method_payload_handling payload_handling, uint32_t flags);
+typedef void*(*grpc_server_register_method_type)(grpc_server* server, const char* method, const char* host, grpc_server_register_method_payload_handling payload_handling, uint32_t flags);
 extern grpc_server_register_method_type grpc_server_register_method_import;
 #define grpc_server_register_method grpc_server_register_method_import
-typedef grpc_call_error(*grpc_server_request_registered_call_type)(grpc_server *server, void *registered_method, grpc_call **call, gpr_timespec *deadline, grpc_metadata_array *request_metadata, grpc_byte_buffer **optional_payload, grpc_completion_queue *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void *tag_new);
+typedef grpc_call_error(*grpc_server_request_registered_call_type)(grpc_server* server, void* registered_method, grpc_call** call, gpr_timespec* deadline, grpc_metadata_array* request_metadata, grpc_byte_buffer** optional_payload, grpc_completion_queue* cq_bound_to_call, grpc_completion_queue* cq_for_notification, void* tag_new);
 extern grpc_server_request_registered_call_type grpc_server_request_registered_call_import;
 #define grpc_server_request_registered_call grpc_server_request_registered_call_import
-typedef grpc_server *(*grpc_server_create_type)(const grpc_channel_args *args, void *reserved);
+typedef grpc_server*(*grpc_server_create_type)(const grpc_channel_args* args, void* reserved);
 extern grpc_server_create_type grpc_server_create_import;
 #define grpc_server_create grpc_server_create_import
-typedef void(*grpc_server_register_completion_queue_type)(grpc_server *server, grpc_completion_queue *cq, void *reserved);
+typedef void(*grpc_server_register_completion_queue_type)(grpc_server* server, grpc_completion_queue* cq, void* reserved);
 extern grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import;
 #define grpc_server_register_completion_queue grpc_server_register_completion_queue_import
-typedef int(*grpc_server_add_insecure_http2_port_type)(grpc_server *server, const char *addr);
+typedef int(*grpc_server_add_insecure_http2_port_type)(grpc_server* server, const char* addr);
 extern grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import;
 #define grpc_server_add_insecure_http2_port grpc_server_add_insecure_http2_port_import
-typedef void(*grpc_server_start_type)(grpc_server *server);
+typedef void(*grpc_server_start_type)(grpc_server* server);
 extern grpc_server_start_type grpc_server_start_import;
 #define grpc_server_start grpc_server_start_import
-typedef void(*grpc_server_shutdown_and_notify_type)(grpc_server *server, grpc_completion_queue *cq, void *tag);
+typedef void(*grpc_server_shutdown_and_notify_type)(grpc_server* server, grpc_completion_queue* cq, void* tag);
 extern grpc_server_shutdown_and_notify_type grpc_server_shutdown_and_notify_import;
 #define grpc_server_shutdown_and_notify grpc_server_shutdown_and_notify_import
-typedef void(*grpc_server_cancel_all_calls_type)(grpc_server *server);
+typedef void(*grpc_server_cancel_all_calls_type)(grpc_server* server);
 extern grpc_server_cancel_all_calls_type grpc_server_cancel_all_calls_import;
 #define grpc_server_cancel_all_calls grpc_server_cancel_all_calls_import
-typedef void(*grpc_server_destroy_type)(grpc_server *server);
+typedef void(*grpc_server_destroy_type)(grpc_server* server);
 extern grpc_server_destroy_type grpc_server_destroy_import;
 #define grpc_server_destroy grpc_server_destroy_import
-typedef int(*grpc_tracer_set_enabled_type)(const char *name, int enabled);
+typedef int(*grpc_tracer_set_enabled_type)(const char* name, int enabled);
 extern grpc_tracer_set_enabled_type grpc_tracer_set_enabled_import;
 #define grpc_tracer_set_enabled grpc_tracer_set_enabled_import
 typedef int(*grpc_header_key_is_legal_type)(grpc_slice slice);
@@ -332,157 +253,175 @@
 typedef int(*grpc_is_binary_header_type)(grpc_slice slice);
 extern grpc_is_binary_header_type grpc_is_binary_header_import;
 #define grpc_is_binary_header grpc_is_binary_header_import
-typedef const char *(*grpc_call_error_to_string_type)(grpc_call_error error);
+typedef const char*(*grpc_call_error_to_string_type)(grpc_call_error error);
 extern grpc_call_error_to_string_type grpc_call_error_to_string_import;
 #define grpc_call_error_to_string grpc_call_error_to_string_import
-typedef grpc_resource_quota *(*grpc_resource_quota_create_type)(const char *trace_name);
+typedef grpc_resource_quota*(*grpc_resource_quota_create_type)(const char* trace_name);
 extern grpc_resource_quota_create_type grpc_resource_quota_create_import;
 #define grpc_resource_quota_create grpc_resource_quota_create_import
-typedef void(*grpc_resource_quota_ref_type)(grpc_resource_quota *resource_quota);
+typedef void(*grpc_resource_quota_ref_type)(grpc_resource_quota* resource_quota);
 extern grpc_resource_quota_ref_type grpc_resource_quota_ref_import;
 #define grpc_resource_quota_ref grpc_resource_quota_ref_import
-typedef void(*grpc_resource_quota_unref_type)(grpc_resource_quota *resource_quota);
+typedef void(*grpc_resource_quota_unref_type)(grpc_resource_quota* resource_quota);
 extern grpc_resource_quota_unref_type grpc_resource_quota_unref_import;
 #define grpc_resource_quota_unref grpc_resource_quota_unref_import
-typedef void(*grpc_resource_quota_resize_type)(grpc_resource_quota *resource_quota, size_t new_size);
+typedef void(*grpc_resource_quota_resize_type)(grpc_resource_quota* resource_quota, size_t new_size);
 extern grpc_resource_quota_resize_type grpc_resource_quota_resize_import;
 #define grpc_resource_quota_resize grpc_resource_quota_resize_import
-typedef const grpc_arg_pointer_vtable *(*grpc_resource_quota_arg_vtable_type)(void);
+typedef const grpc_arg_pointer_vtable*(*grpc_resource_quota_arg_vtable_type)(void);
 extern grpc_resource_quota_arg_vtable_type grpc_resource_quota_arg_vtable_import;
 #define grpc_resource_quota_arg_vtable grpc_resource_quota_arg_vtable_import
-typedef grpc_channel *(*grpc_insecure_channel_create_from_fd_type)(const char *target, int fd, const grpc_channel_args *args);
+typedef grpc_channel*(*grpc_insecure_channel_create_from_fd_type)(const char* target, int fd, const grpc_channel_args* args);
 extern grpc_insecure_channel_create_from_fd_type grpc_insecure_channel_create_from_fd_import;
 #define grpc_insecure_channel_create_from_fd grpc_insecure_channel_create_from_fd_import
-typedef void(*grpc_server_add_insecure_channel_from_fd_type)(grpc_server *server, void *reserved, int fd);
+typedef void(*grpc_server_add_insecure_channel_from_fd_type)(grpc_server* server, void* reserved, int fd);
 extern grpc_server_add_insecure_channel_from_fd_type grpc_server_add_insecure_channel_from_fd_import;
 #define grpc_server_add_insecure_channel_from_fd grpc_server_add_insecure_channel_from_fd_import
 typedef void(*grpc_use_signal_type)(int signum);
 extern grpc_use_signal_type grpc_use_signal_import;
 #define grpc_use_signal grpc_use_signal_import
-typedef const grpc_auth_property *(*grpc_auth_property_iterator_next_type)(grpc_auth_property_iterator *it);
+typedef const grpc_auth_property*(*grpc_auth_property_iterator_next_type)(grpc_auth_property_iterator* it);
 extern grpc_auth_property_iterator_next_type grpc_auth_property_iterator_next_import;
 #define grpc_auth_property_iterator_next grpc_auth_property_iterator_next_import
-typedef grpc_auth_property_iterator(*grpc_auth_context_property_iterator_type)(const grpc_auth_context *ctx);
+typedef grpc_auth_property_iterator(*grpc_auth_context_property_iterator_type)(const grpc_auth_context* ctx);
 extern grpc_auth_context_property_iterator_type grpc_auth_context_property_iterator_import;
 #define grpc_auth_context_property_iterator grpc_auth_context_property_iterator_import
-typedef grpc_auth_property_iterator(*grpc_auth_context_peer_identity_type)(const grpc_auth_context *ctx);
+typedef grpc_auth_property_iterator(*grpc_auth_context_peer_identity_type)(const grpc_auth_context* ctx);
 extern grpc_auth_context_peer_identity_type grpc_auth_context_peer_identity_import;
 #define grpc_auth_context_peer_identity grpc_auth_context_peer_identity_import
-typedef grpc_auth_property_iterator(*grpc_auth_context_find_properties_by_name_type)(const grpc_auth_context *ctx, const char *name);
+typedef grpc_auth_property_iterator(*grpc_auth_context_find_properties_by_name_type)(const grpc_auth_context* ctx, const char* name);
 extern grpc_auth_context_find_properties_by_name_type grpc_auth_context_find_properties_by_name_import;
 #define grpc_auth_context_find_properties_by_name grpc_auth_context_find_properties_by_name_import
-typedef const char *(*grpc_auth_context_peer_identity_property_name_type)(const grpc_auth_context *ctx);
+typedef const char*(*grpc_auth_context_peer_identity_property_name_type)(const grpc_auth_context* ctx);
 extern grpc_auth_context_peer_identity_property_name_type grpc_auth_context_peer_identity_property_name_import;
 #define grpc_auth_context_peer_identity_property_name grpc_auth_context_peer_identity_property_name_import
-typedef int(*grpc_auth_context_peer_is_authenticated_type)(const grpc_auth_context *ctx);
+typedef int(*grpc_auth_context_peer_is_authenticated_type)(const grpc_auth_context* ctx);
 extern grpc_auth_context_peer_is_authenticated_type grpc_auth_context_peer_is_authenticated_import;
 #define grpc_auth_context_peer_is_authenticated grpc_auth_context_peer_is_authenticated_import
-typedef grpc_auth_context *(*grpc_call_auth_context_type)(grpc_call *call);
+typedef grpc_auth_context*(*grpc_call_auth_context_type)(grpc_call* call);
 extern grpc_call_auth_context_type grpc_call_auth_context_import;
 #define grpc_call_auth_context grpc_call_auth_context_import
-typedef void(*grpc_auth_context_release_type)(grpc_auth_context *context);
+typedef void(*grpc_auth_context_release_type)(grpc_auth_context* context);
 extern grpc_auth_context_release_type grpc_auth_context_release_import;
 #define grpc_auth_context_release grpc_auth_context_release_import
-typedef void(*grpc_auth_context_add_property_type)(grpc_auth_context *ctx, const char *name, const char *value, size_t value_length);
+typedef void(*grpc_auth_context_add_property_type)(grpc_auth_context* ctx, const char* name, const char* value, size_t value_length);
 extern grpc_auth_context_add_property_type grpc_auth_context_add_property_import;
 #define grpc_auth_context_add_property grpc_auth_context_add_property_import
-typedef void(*grpc_auth_context_add_cstring_property_type)(grpc_auth_context *ctx, const char *name, const char *value);
+typedef void(*grpc_auth_context_add_cstring_property_type)(grpc_auth_context* ctx, const char* name, const char* value);
 extern grpc_auth_context_add_cstring_property_type grpc_auth_context_add_cstring_property_import;
 #define grpc_auth_context_add_cstring_property grpc_auth_context_add_cstring_property_import
-typedef int(*grpc_auth_context_set_peer_identity_property_name_type)(grpc_auth_context *ctx, const char *name);
+typedef int(*grpc_auth_context_set_peer_identity_property_name_type)(grpc_auth_context* ctx, const char* name);
 extern grpc_auth_context_set_peer_identity_property_name_type grpc_auth_context_set_peer_identity_property_name_import;
 #define grpc_auth_context_set_peer_identity_property_name grpc_auth_context_set_peer_identity_property_name_import
-typedef void(*grpc_channel_credentials_release_type)(grpc_channel_credentials *creds);
+typedef void(*grpc_channel_credentials_release_type)(grpc_channel_credentials* creds);
 extern grpc_channel_credentials_release_type grpc_channel_credentials_release_import;
 #define grpc_channel_credentials_release grpc_channel_credentials_release_import
-typedef grpc_channel_credentials *(*grpc_google_default_credentials_create_type)(void);
+typedef grpc_channel_credentials*(*grpc_google_default_credentials_create_type)(void);
 extern grpc_google_default_credentials_create_type grpc_google_default_credentials_create_import;
 #define grpc_google_default_credentials_create grpc_google_default_credentials_create_import
 typedef void(*grpc_set_ssl_roots_override_callback_type)(grpc_ssl_roots_override_callback cb);
 extern grpc_set_ssl_roots_override_callback_type grpc_set_ssl_roots_override_callback_import;
 #define grpc_set_ssl_roots_override_callback grpc_set_ssl_roots_override_callback_import
-typedef grpc_channel_credentials *(*grpc_ssl_credentials_create_type)(const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, void *reserved);
+typedef grpc_channel_credentials*(*grpc_ssl_credentials_create_type)(const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair, void* reserved);
 extern grpc_ssl_credentials_create_type grpc_ssl_credentials_create_import;
 #define grpc_ssl_credentials_create grpc_ssl_credentials_create_import
-typedef void(*grpc_call_credentials_release_type)(grpc_call_credentials *creds);
+typedef void(*grpc_call_credentials_release_type)(grpc_call_credentials* creds);
 extern grpc_call_credentials_release_type grpc_call_credentials_release_import;
 #define grpc_call_credentials_release grpc_call_credentials_release_import
-typedef grpc_channel_credentials *(*grpc_composite_channel_credentials_create_type)(grpc_channel_credentials *channel_creds, grpc_call_credentials *call_creds, void *reserved);
+typedef grpc_channel_credentials*(*grpc_composite_channel_credentials_create_type)(grpc_channel_credentials* channel_creds, grpc_call_credentials* call_creds, void* reserved);
 extern grpc_composite_channel_credentials_create_type grpc_composite_channel_credentials_create_import;
 #define grpc_composite_channel_credentials_create grpc_composite_channel_credentials_create_import
-typedef grpc_call_credentials *(*grpc_composite_call_credentials_create_type)(grpc_call_credentials *creds1, grpc_call_credentials *creds2, void *reserved);
+typedef grpc_call_credentials*(*grpc_composite_call_credentials_create_type)(grpc_call_credentials* creds1, grpc_call_credentials* creds2, void* reserved);
 extern grpc_composite_call_credentials_create_type grpc_composite_call_credentials_create_import;
 #define grpc_composite_call_credentials_create grpc_composite_call_credentials_create_import
-typedef grpc_call_credentials *(*grpc_google_compute_engine_credentials_create_type)(void *reserved);
+typedef grpc_call_credentials*(*grpc_google_compute_engine_credentials_create_type)(void* reserved);
 extern grpc_google_compute_engine_credentials_create_type grpc_google_compute_engine_credentials_create_import;
 #define grpc_google_compute_engine_credentials_create grpc_google_compute_engine_credentials_create_import
 typedef gpr_timespec(*grpc_max_auth_token_lifetime_type)();
 extern grpc_max_auth_token_lifetime_type grpc_max_auth_token_lifetime_import;
 #define grpc_max_auth_token_lifetime grpc_max_auth_token_lifetime_import
-typedef grpc_call_credentials *(*grpc_service_account_jwt_access_credentials_create_type)(const char *json_key, gpr_timespec token_lifetime, void *reserved);
+typedef grpc_call_credentials*(*grpc_service_account_jwt_access_credentials_create_type)(const char* json_key, gpr_timespec token_lifetime, void* reserved);
 extern grpc_service_account_jwt_access_credentials_create_type grpc_service_account_jwt_access_credentials_create_import;
 #define grpc_service_account_jwt_access_credentials_create grpc_service_account_jwt_access_credentials_create_import
-typedef grpc_call_credentials *(*grpc_google_refresh_token_credentials_create_type)(const char *json_refresh_token, void *reserved);
+typedef grpc_call_credentials*(*grpc_google_refresh_token_credentials_create_type)(const char* json_refresh_token, void* reserved);
 extern grpc_google_refresh_token_credentials_create_type grpc_google_refresh_token_credentials_create_import;
 #define grpc_google_refresh_token_credentials_create grpc_google_refresh_token_credentials_create_import
-typedef grpc_call_credentials *(*grpc_access_token_credentials_create_type)(const char *access_token, void *reserved);
+typedef grpc_call_credentials*(*grpc_access_token_credentials_create_type)(const char* access_token, void* reserved);
 extern grpc_access_token_credentials_create_type grpc_access_token_credentials_create_import;
 #define grpc_access_token_credentials_create grpc_access_token_credentials_create_import
-typedef grpc_call_credentials *(*grpc_google_iam_credentials_create_type)(const char *authorization_token, const char *authority_selector, void *reserved);
+typedef grpc_call_credentials*(*grpc_google_iam_credentials_create_type)(const char* authorization_token, const char* authority_selector, void* reserved);
 extern grpc_google_iam_credentials_create_type grpc_google_iam_credentials_create_import;
 #define grpc_google_iam_credentials_create grpc_google_iam_credentials_create_import
-typedef grpc_call_credentials *(*grpc_metadata_credentials_create_from_plugin_type)(grpc_metadata_credentials_plugin plugin, void *reserved);
+typedef grpc_call_credentials*(*grpc_metadata_credentials_create_from_plugin_type)(grpc_metadata_credentials_plugin plugin, void* reserved);
 extern grpc_metadata_credentials_create_from_plugin_type grpc_metadata_credentials_create_from_plugin_import;
 #define grpc_metadata_credentials_create_from_plugin grpc_metadata_credentials_create_from_plugin_import
-typedef grpc_channel *(*grpc_secure_channel_create_type)(grpc_channel_credentials *creds, const char *target, const grpc_channel_args *args, void *reserved);
+typedef grpc_channel*(*grpc_secure_channel_create_type)(grpc_channel_credentials* creds, const char* target, const grpc_channel_args* args, void* reserved);
 extern grpc_secure_channel_create_type grpc_secure_channel_create_import;
 #define grpc_secure_channel_create grpc_secure_channel_create_import
-typedef void(*grpc_server_credentials_release_type)(grpc_server_credentials *creds);
+typedef void(*grpc_server_credentials_release_type)(grpc_server_credentials* creds);
 extern grpc_server_credentials_release_type grpc_server_credentials_release_import;
 #define grpc_server_credentials_release grpc_server_credentials_release_import
-typedef grpc_server_credentials *(*grpc_ssl_server_credentials_create_type)(const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs, size_t num_key_cert_pairs, int force_client_auth, void *reserved);
+typedef grpc_ssl_server_certificate_config*(*grpc_ssl_server_certificate_config_create_type)(const char* pem_root_certs, const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs, size_t num_key_cert_pairs);
+extern grpc_ssl_server_certificate_config_create_type grpc_ssl_server_certificate_config_create_import;
+#define grpc_ssl_server_certificate_config_create grpc_ssl_server_certificate_config_create_import
+typedef void(*grpc_ssl_server_certificate_config_destroy_type)(grpc_ssl_server_certificate_config* config);
+extern grpc_ssl_server_certificate_config_destroy_type grpc_ssl_server_certificate_config_destroy_import;
+#define grpc_ssl_server_certificate_config_destroy grpc_ssl_server_certificate_config_destroy_import
+typedef grpc_server_credentials*(*grpc_ssl_server_credentials_create_type)(const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs, size_t num_key_cert_pairs, int force_client_auth, void* reserved);
 extern grpc_ssl_server_credentials_create_type grpc_ssl_server_credentials_create_import;
 #define grpc_ssl_server_credentials_create grpc_ssl_server_credentials_create_import
-typedef grpc_server_credentials *(*grpc_ssl_server_credentials_create_ex_type)(const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs, size_t num_key_cert_pairs, grpc_ssl_client_certificate_request_type client_certificate_request, void *reserved);
+typedef grpc_server_credentials*(*grpc_ssl_server_credentials_create_ex_type)(const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs, size_t num_key_cert_pairs, grpc_ssl_client_certificate_request_type client_certificate_request, void* reserved);
 extern grpc_ssl_server_credentials_create_ex_type grpc_ssl_server_credentials_create_ex_import;
 #define grpc_ssl_server_credentials_create_ex grpc_ssl_server_credentials_create_ex_import
-typedef int(*grpc_server_add_secure_http2_port_type)(grpc_server *server, const char *addr, grpc_server_credentials *creds);
+typedef grpc_ssl_server_credentials_options*(*grpc_ssl_server_credentials_create_options_using_config_type)(grpc_ssl_client_certificate_request_type client_certificate_request, grpc_ssl_server_certificate_config* certificate_config);
+extern grpc_ssl_server_credentials_create_options_using_config_type grpc_ssl_server_credentials_create_options_using_config_import;
+#define grpc_ssl_server_credentials_create_options_using_config grpc_ssl_server_credentials_create_options_using_config_import
+typedef grpc_ssl_server_credentials_options*(*grpc_ssl_server_credentials_create_options_using_config_fetcher_type)(grpc_ssl_client_certificate_request_type client_certificate_request, grpc_ssl_server_certificate_config_callback cb, void* user_data);
+extern grpc_ssl_server_credentials_create_options_using_config_fetcher_type grpc_ssl_server_credentials_create_options_using_config_fetcher_import;
+#define grpc_ssl_server_credentials_create_options_using_config_fetcher grpc_ssl_server_credentials_create_options_using_config_fetcher_import
+typedef void(*grpc_ssl_server_credentials_options_destroy_type)(grpc_ssl_server_credentials_options* options);
+extern grpc_ssl_server_credentials_options_destroy_type grpc_ssl_server_credentials_options_destroy_import;
+#define grpc_ssl_server_credentials_options_destroy grpc_ssl_server_credentials_options_destroy_import
+typedef grpc_server_credentials*(*grpc_ssl_server_credentials_create_with_options_type)(grpc_ssl_server_credentials_options* options);
+extern grpc_ssl_server_credentials_create_with_options_type grpc_ssl_server_credentials_create_with_options_import;
+#define grpc_ssl_server_credentials_create_with_options grpc_ssl_server_credentials_create_with_options_import
+typedef int(*grpc_server_add_secure_http2_port_type)(grpc_server* server, const char* addr, grpc_server_credentials* creds);
 extern grpc_server_add_secure_http2_port_type grpc_server_add_secure_http2_port_import;
 #define grpc_server_add_secure_http2_port grpc_server_add_secure_http2_port_import
-typedef grpc_call_error(*grpc_call_set_credentials_type)(grpc_call *call, grpc_call_credentials *creds);
+typedef grpc_call_error(*grpc_call_set_credentials_type)(grpc_call* call, grpc_call_credentials* creds);
 extern grpc_call_set_credentials_type grpc_call_set_credentials_import;
 #define grpc_call_set_credentials grpc_call_set_credentials_import
-typedef void(*grpc_server_credentials_set_auth_metadata_processor_type)(grpc_server_credentials *creds, grpc_auth_metadata_processor processor);
+typedef void(*grpc_server_credentials_set_auth_metadata_processor_type)(grpc_server_credentials* creds, grpc_auth_metadata_processor processor);
 extern grpc_server_credentials_set_auth_metadata_processor_type grpc_server_credentials_set_auth_metadata_processor_import;
 #define grpc_server_credentials_set_auth_metadata_processor grpc_server_credentials_set_auth_metadata_processor_import
-typedef grpc_byte_buffer *(*grpc_raw_byte_buffer_create_type)(grpc_slice *slices, size_t nslices);
+typedef grpc_byte_buffer*(*grpc_raw_byte_buffer_create_type)(grpc_slice* slices, size_t nslices);
 extern grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import;
 #define grpc_raw_byte_buffer_create grpc_raw_byte_buffer_create_import
-typedef grpc_byte_buffer *(*grpc_raw_compressed_byte_buffer_create_type)(grpc_slice *slices, size_t nslices, grpc_compression_algorithm compression);
+typedef grpc_byte_buffer*(*grpc_raw_compressed_byte_buffer_create_type)(grpc_slice* slices, size_t nslices, grpc_compression_algorithm compression);
 extern grpc_raw_compressed_byte_buffer_create_type grpc_raw_compressed_byte_buffer_create_import;
 #define grpc_raw_compressed_byte_buffer_create grpc_raw_compressed_byte_buffer_create_import
-typedef grpc_byte_buffer *(*grpc_byte_buffer_copy_type)(grpc_byte_buffer *bb);
+typedef grpc_byte_buffer*(*grpc_byte_buffer_copy_type)(grpc_byte_buffer* bb);
 extern grpc_byte_buffer_copy_type grpc_byte_buffer_copy_import;
 #define grpc_byte_buffer_copy grpc_byte_buffer_copy_import
-typedef size_t(*grpc_byte_buffer_length_type)(grpc_byte_buffer *bb);
+typedef size_t(*grpc_byte_buffer_length_type)(grpc_byte_buffer* bb);
 extern grpc_byte_buffer_length_type grpc_byte_buffer_length_import;
 #define grpc_byte_buffer_length grpc_byte_buffer_length_import
-typedef void(*grpc_byte_buffer_destroy_type)(grpc_byte_buffer *byte_buffer);
+typedef void(*grpc_byte_buffer_destroy_type)(grpc_byte_buffer* byte_buffer);
 extern grpc_byte_buffer_destroy_type grpc_byte_buffer_destroy_import;
 #define grpc_byte_buffer_destroy grpc_byte_buffer_destroy_import
-typedef int(*grpc_byte_buffer_reader_init_type)(grpc_byte_buffer_reader *reader, grpc_byte_buffer *buffer);
+typedef int(*grpc_byte_buffer_reader_init_type)(grpc_byte_buffer_reader* reader, grpc_byte_buffer* buffer);
 extern grpc_byte_buffer_reader_init_type grpc_byte_buffer_reader_init_import;
 #define grpc_byte_buffer_reader_init grpc_byte_buffer_reader_init_import
-typedef void(*grpc_byte_buffer_reader_destroy_type)(grpc_byte_buffer_reader *reader);
+typedef void(*grpc_byte_buffer_reader_destroy_type)(grpc_byte_buffer_reader* reader);
 extern grpc_byte_buffer_reader_destroy_type grpc_byte_buffer_reader_destroy_import;
 #define grpc_byte_buffer_reader_destroy grpc_byte_buffer_reader_destroy_import
-typedef int(*grpc_byte_buffer_reader_next_type)(grpc_byte_buffer_reader *reader, grpc_slice *slice);
+typedef int(*grpc_byte_buffer_reader_next_type)(grpc_byte_buffer_reader* reader, grpc_slice* slice);
 extern grpc_byte_buffer_reader_next_type grpc_byte_buffer_reader_next_import;
 #define grpc_byte_buffer_reader_next grpc_byte_buffer_reader_next_import
-typedef grpc_slice(*grpc_byte_buffer_reader_readall_type)(grpc_byte_buffer_reader *reader);
+typedef grpc_slice(*grpc_byte_buffer_reader_readall_type)(grpc_byte_buffer_reader* reader);
 extern grpc_byte_buffer_reader_readall_type grpc_byte_buffer_reader_readall_import;
 #define grpc_byte_buffer_reader_readall grpc_byte_buffer_reader_readall_import
-typedef grpc_byte_buffer *(*grpc_raw_byte_buffer_from_reader_type)(grpc_byte_buffer_reader *reader);
+typedef grpc_byte_buffer*(*grpc_raw_byte_buffer_from_reader_type)(grpc_byte_buffer_reader* reader);
 extern grpc_raw_byte_buffer_from_reader_type grpc_raw_byte_buffer_from_reader_import;
 #define grpc_raw_byte_buffer_from_reader grpc_raw_byte_buffer_from_reader_import
 typedef grpc_slice(*grpc_slice_ref_type)(grpc_slice s);
@@ -494,13 +433,13 @@
 typedef grpc_slice(*grpc_slice_copy_type)(grpc_slice s);
 extern grpc_slice_copy_type grpc_slice_copy_import;
 #define grpc_slice_copy grpc_slice_copy_import
-typedef grpc_slice(*grpc_slice_new_type)(void *p, size_t len, void (*destroy)(void *));
+typedef grpc_slice(*grpc_slice_new_type)(void* p, size_t len, void (*destroy)(void*));
 extern grpc_slice_new_type grpc_slice_new_import;
 #define grpc_slice_new grpc_slice_new_import
-typedef grpc_slice(*grpc_slice_new_with_user_data_type)(void *p, size_t len, void (*destroy)(void *), void *user_data);
+typedef grpc_slice(*grpc_slice_new_with_user_data_type)(void* p, size_t len, void (*destroy)(void*), void* user_data);
 extern grpc_slice_new_with_user_data_type grpc_slice_new_with_user_data_import;
 #define grpc_slice_new_with_user_data grpc_slice_new_with_user_data_import
-typedef grpc_slice(*grpc_slice_new_with_len_type)(void *p, size_t len, void (*destroy)(void *, size_t));
+typedef grpc_slice(*grpc_slice_new_with_len_type)(void* p, size_t len, void (*destroy)(void*, size_t));
 extern grpc_slice_new_with_len_type grpc_slice_new_with_len_import;
 #define grpc_slice_new_with_len grpc_slice_new_with_len_import
 typedef grpc_slice(*grpc_slice_malloc_type)(size_t length);
@@ -512,16 +451,16 @@
 typedef grpc_slice(*grpc_slice_intern_type)(grpc_slice slice);
 extern grpc_slice_intern_type grpc_slice_intern_import;
 #define grpc_slice_intern grpc_slice_intern_import
-typedef grpc_slice(*grpc_slice_from_copied_string_type)(const char *source);
+typedef grpc_slice(*grpc_slice_from_copied_string_type)(const char* source);
 extern grpc_slice_from_copied_string_type grpc_slice_from_copied_string_import;
 #define grpc_slice_from_copied_string grpc_slice_from_copied_string_import
-typedef grpc_slice(*grpc_slice_from_copied_buffer_type)(const char *source, size_t len);
+typedef grpc_slice(*grpc_slice_from_copied_buffer_type)(const char* source, size_t len);
 extern grpc_slice_from_copied_buffer_type grpc_slice_from_copied_buffer_import;
 #define grpc_slice_from_copied_buffer grpc_slice_from_copied_buffer_import
-typedef grpc_slice(*grpc_slice_from_static_string_type)(const char *source);
+typedef grpc_slice(*grpc_slice_from_static_string_type)(const char* source);
 extern grpc_slice_from_static_string_type grpc_slice_from_static_string_import;
 #define grpc_slice_from_static_string grpc_slice_from_static_string_import
-typedef grpc_slice(*grpc_slice_from_static_buffer_type)(const void *source, size_t len);
+typedef grpc_slice(*grpc_slice_from_static_buffer_type)(const void* source, size_t len);
 extern grpc_slice_from_static_buffer_type grpc_slice_from_static_buffer_import;
 #define grpc_slice_from_static_buffer grpc_slice_from_static_buffer_import
 typedef grpc_slice(*grpc_slice_sub_type)(grpc_slice s, size_t begin, size_t end);
@@ -530,13 +469,13 @@
 typedef grpc_slice(*grpc_slice_sub_no_ref_type)(grpc_slice s, size_t begin, size_t end);
 extern grpc_slice_sub_no_ref_type grpc_slice_sub_no_ref_import;
 #define grpc_slice_sub_no_ref grpc_slice_sub_no_ref_import
-typedef grpc_slice(*grpc_slice_split_tail_type)(grpc_slice *s, size_t split);
+typedef grpc_slice(*grpc_slice_split_tail_type)(grpc_slice* s, size_t split);
 extern grpc_slice_split_tail_type grpc_slice_split_tail_import;
 #define grpc_slice_split_tail grpc_slice_split_tail_import
-typedef grpc_slice(*grpc_slice_split_tail_maybe_ref_type)(grpc_slice *s, size_t split, grpc_slice_ref_whom ref_whom);
+typedef grpc_slice(*grpc_slice_split_tail_maybe_ref_type)(grpc_slice* s, size_t split, grpc_slice_ref_whom ref_whom);
 extern grpc_slice_split_tail_maybe_ref_type grpc_slice_split_tail_maybe_ref_import;
 #define grpc_slice_split_tail_maybe_ref grpc_slice_split_tail_maybe_ref_import
-typedef grpc_slice(*grpc_slice_split_head_type)(grpc_slice *s, size_t split);
+typedef grpc_slice(*grpc_slice_split_head_type)(grpc_slice* s, size_t split);
 extern grpc_slice_split_head_type grpc_slice_split_head_import;
 #define grpc_slice_split_head grpc_slice_split_head_import
 typedef grpc_slice(*grpc_empty_slice_type)(void);
@@ -554,13 +493,10 @@
 typedef int(*grpc_slice_cmp_type)(grpc_slice a, grpc_slice b);
 extern grpc_slice_cmp_type grpc_slice_cmp_import;
 #define grpc_slice_cmp grpc_slice_cmp_import
-typedef int(*grpc_slice_str_cmp_type)(grpc_slice a, const char *b);
+typedef int(*grpc_slice_str_cmp_type)(grpc_slice a, const char* b);
 extern grpc_slice_str_cmp_type grpc_slice_str_cmp_import;
 #define grpc_slice_str_cmp grpc_slice_str_cmp_import
-typedef int(*grpc_slice_buf_cmp_type)(grpc_slice a, const void *b, size_t blen);
-extern grpc_slice_buf_cmp_type grpc_slice_buf_cmp_import;
-#define grpc_slice_buf_cmp grpc_slice_buf_cmp_import
-typedef int(*grpc_slice_buf_start_eq_type)(grpc_slice a, const void *b, size_t blen);
+typedef int(*grpc_slice_buf_start_eq_type)(grpc_slice a, const void* b, size_t blen);
 extern grpc_slice_buf_start_eq_type grpc_slice_buf_start_eq_import;
 #define grpc_slice_buf_start_eq grpc_slice_buf_start_eq_import
 typedef int(*grpc_slice_rchr_type)(grpc_slice s, char c);
@@ -581,73 +517,73 @@
 typedef grpc_slice(*grpc_slice_dup_type)(grpc_slice a);
 extern grpc_slice_dup_type grpc_slice_dup_import;
 #define grpc_slice_dup grpc_slice_dup_import
-typedef char *(*grpc_slice_to_c_string_type)(grpc_slice s);
+typedef char*(*grpc_slice_to_c_string_type)(grpc_slice s);
 extern grpc_slice_to_c_string_type grpc_slice_to_c_string_import;
 #define grpc_slice_to_c_string grpc_slice_to_c_string_import
-typedef void(*grpc_slice_buffer_init_type)(grpc_slice_buffer *sb);
+typedef void(*grpc_slice_buffer_init_type)(grpc_slice_buffer* sb);
 extern grpc_slice_buffer_init_type grpc_slice_buffer_init_import;
 #define grpc_slice_buffer_init grpc_slice_buffer_init_import
-typedef void(*grpc_slice_buffer_destroy_type)(grpc_slice_buffer *sb);
+typedef void(*grpc_slice_buffer_destroy_type)(grpc_slice_buffer* sb);
 extern grpc_slice_buffer_destroy_type grpc_slice_buffer_destroy_import;
 #define grpc_slice_buffer_destroy grpc_slice_buffer_destroy_import
-typedef void(*grpc_slice_buffer_add_type)(grpc_slice_buffer *sb, grpc_slice slice);
+typedef void(*grpc_slice_buffer_add_type)(grpc_slice_buffer* sb, grpc_slice slice);
 extern grpc_slice_buffer_add_type grpc_slice_buffer_add_import;
 #define grpc_slice_buffer_add grpc_slice_buffer_add_import
-typedef size_t(*grpc_slice_buffer_add_indexed_type)(grpc_slice_buffer *sb, grpc_slice slice);
+typedef size_t(*grpc_slice_buffer_add_indexed_type)(grpc_slice_buffer* sb, grpc_slice slice);
 extern grpc_slice_buffer_add_indexed_type grpc_slice_buffer_add_indexed_import;
 #define grpc_slice_buffer_add_indexed grpc_slice_buffer_add_indexed_import
-typedef void(*grpc_slice_buffer_addn_type)(grpc_slice_buffer *sb, grpc_slice *slices, size_t n);
+typedef void(*grpc_slice_buffer_addn_type)(grpc_slice_buffer* sb, grpc_slice* slices, size_t n);
 extern grpc_slice_buffer_addn_type grpc_slice_buffer_addn_import;
 #define grpc_slice_buffer_addn grpc_slice_buffer_addn_import
-typedef uint8_t *(*grpc_slice_buffer_tiny_add_type)(grpc_slice_buffer *sb, size_t len);
+typedef uint8_t*(*grpc_slice_buffer_tiny_add_type)(grpc_slice_buffer* sb, size_t len);
 extern grpc_slice_buffer_tiny_add_type grpc_slice_buffer_tiny_add_import;
 #define grpc_slice_buffer_tiny_add grpc_slice_buffer_tiny_add_import
-typedef void(*grpc_slice_buffer_pop_type)(grpc_slice_buffer *sb);
+typedef void(*grpc_slice_buffer_pop_type)(grpc_slice_buffer* sb);
 extern grpc_slice_buffer_pop_type grpc_slice_buffer_pop_import;
 #define grpc_slice_buffer_pop grpc_slice_buffer_pop_import
-typedef void(*grpc_slice_buffer_reset_and_unref_type)(grpc_slice_buffer *sb);
+typedef void(*grpc_slice_buffer_reset_and_unref_type)(grpc_slice_buffer* sb);
 extern grpc_slice_buffer_reset_and_unref_type grpc_slice_buffer_reset_and_unref_import;
 #define grpc_slice_buffer_reset_and_unref grpc_slice_buffer_reset_and_unref_import
-typedef void(*grpc_slice_buffer_swap_type)(grpc_slice_buffer *a, grpc_slice_buffer *b);
+typedef void(*grpc_slice_buffer_swap_type)(grpc_slice_buffer* a, grpc_slice_buffer* b);
 extern grpc_slice_buffer_swap_type grpc_slice_buffer_swap_import;
 #define grpc_slice_buffer_swap grpc_slice_buffer_swap_import
-typedef void(*grpc_slice_buffer_move_into_type)(grpc_slice_buffer *src, grpc_slice_buffer *dst);
+typedef void(*grpc_slice_buffer_move_into_type)(grpc_slice_buffer* src, grpc_slice_buffer* dst);
 extern grpc_slice_buffer_move_into_type grpc_slice_buffer_move_into_import;
 #define grpc_slice_buffer_move_into grpc_slice_buffer_move_into_import
-typedef void(*grpc_slice_buffer_trim_end_type)(grpc_slice_buffer *src, size_t n, grpc_slice_buffer *garbage);
+typedef void(*grpc_slice_buffer_trim_end_type)(grpc_slice_buffer* src, size_t n, grpc_slice_buffer* garbage);
 extern grpc_slice_buffer_trim_end_type grpc_slice_buffer_trim_end_import;
 #define grpc_slice_buffer_trim_end grpc_slice_buffer_trim_end_import
-typedef void(*grpc_slice_buffer_move_first_type)(grpc_slice_buffer *src, size_t n, grpc_slice_buffer *dst);
+typedef void(*grpc_slice_buffer_move_first_type)(grpc_slice_buffer* src, size_t n, grpc_slice_buffer* dst);
 extern grpc_slice_buffer_move_first_type grpc_slice_buffer_move_first_import;
 #define grpc_slice_buffer_move_first grpc_slice_buffer_move_first_import
-typedef void(*grpc_slice_buffer_move_first_no_ref_type)(grpc_slice_buffer *src, size_t n, grpc_slice_buffer *dst);
+typedef void(*grpc_slice_buffer_move_first_no_ref_type)(grpc_slice_buffer* src, size_t n, grpc_slice_buffer* dst);
 extern grpc_slice_buffer_move_first_no_ref_type grpc_slice_buffer_move_first_no_ref_import;
 #define grpc_slice_buffer_move_first_no_ref grpc_slice_buffer_move_first_no_ref_import
-typedef void(*grpc_slice_buffer_move_first_into_buffer_type)(grpc_exec_ctx *exec_ctx, grpc_slice_buffer *src, size_t n, void *dst);
+typedef void(*grpc_slice_buffer_move_first_into_buffer_type)(grpc_exec_ctx* exec_ctx, grpc_slice_buffer* src, size_t n, void* dst);
 extern grpc_slice_buffer_move_first_into_buffer_type grpc_slice_buffer_move_first_into_buffer_import;
 #define grpc_slice_buffer_move_first_into_buffer grpc_slice_buffer_move_first_into_buffer_import
-typedef grpc_slice(*grpc_slice_buffer_take_first_type)(grpc_slice_buffer *src);
+typedef grpc_slice(*grpc_slice_buffer_take_first_type)(grpc_slice_buffer* src);
 extern grpc_slice_buffer_take_first_type grpc_slice_buffer_take_first_import;
 #define grpc_slice_buffer_take_first grpc_slice_buffer_take_first_import
-typedef void(*grpc_slice_buffer_undo_take_first_type)(grpc_slice_buffer *src, grpc_slice slice);
+typedef void(*grpc_slice_buffer_undo_take_first_type)(grpc_slice_buffer* src, grpc_slice slice);
 extern grpc_slice_buffer_undo_take_first_type grpc_slice_buffer_undo_take_first_import;
 #define grpc_slice_buffer_undo_take_first grpc_slice_buffer_undo_take_first_import
-typedef void *(*gpr_malloc_type)(size_t size);
+typedef void*(*gpr_malloc_type)(size_t size);
 extern gpr_malloc_type gpr_malloc_import;
 #define gpr_malloc gpr_malloc_import
-typedef void *(*gpr_zalloc_type)(size_t size);
+typedef void*(*gpr_zalloc_type)(size_t size);
 extern gpr_zalloc_type gpr_zalloc_import;
 #define gpr_zalloc gpr_zalloc_import
-typedef void(*gpr_free_type)(void *ptr);
+typedef void(*gpr_free_type)(void* ptr);
 extern gpr_free_type gpr_free_import;
 #define gpr_free gpr_free_import
-typedef void *(*gpr_realloc_type)(void *p, size_t size);
+typedef void*(*gpr_realloc_type)(void* p, size_t size);
 extern gpr_realloc_type gpr_realloc_import;
 #define gpr_realloc gpr_realloc_import
-typedef void *(*gpr_malloc_aligned_type)(size_t size, size_t alignment_log);
+typedef void*(*gpr_malloc_aligned_type)(size_t size, size_t alignment_log);
 extern gpr_malloc_aligned_type gpr_malloc_aligned_import;
 #define gpr_malloc_aligned gpr_malloc_aligned_import
-typedef void(*gpr_free_aligned_type)(void *ptr);
+typedef void(*gpr_free_aligned_type)(void* ptr);
 extern gpr_free_aligned_type gpr_free_aligned_import;
 #define gpr_free_aligned gpr_free_aligned_import
 typedef void(*gpr_set_allocation_functions_type)(gpr_allocation_functions functions);
@@ -656,55 +592,55 @@
 typedef gpr_allocation_functions(*gpr_get_allocation_functions_type)();
 extern gpr_get_allocation_functions_type gpr_get_allocation_functions_import;
 #define gpr_get_allocation_functions gpr_get_allocation_functions_import
-typedef gpr_avl(*gpr_avl_create_type)(const gpr_avl_vtable *vtable);
+typedef gpr_avl(*gpr_avl_create_type)(const gpr_avl_vtable* vtable);
 extern gpr_avl_create_type gpr_avl_create_import;
 #define gpr_avl_create gpr_avl_create_import
-typedef gpr_avl(*gpr_avl_ref_type)(gpr_avl avl, void *user_data);
+typedef gpr_avl(*gpr_avl_ref_type)(gpr_avl avl, void* user_data);
 extern gpr_avl_ref_type gpr_avl_ref_import;
 #define gpr_avl_ref gpr_avl_ref_import
-typedef void(*gpr_avl_unref_type)(gpr_avl avl, void *user_data);
+typedef void(*gpr_avl_unref_type)(gpr_avl avl, void* user_data);
 extern gpr_avl_unref_type gpr_avl_unref_import;
 #define gpr_avl_unref gpr_avl_unref_import
-typedef gpr_avl(*gpr_avl_add_type)(gpr_avl avl, void *key, void *value, void *user_data);
+typedef gpr_avl(*gpr_avl_add_type)(gpr_avl avl, void* key, void* value, void* user_data);
 extern gpr_avl_add_type gpr_avl_add_import;
 #define gpr_avl_add gpr_avl_add_import
-typedef gpr_avl(*gpr_avl_remove_type)(gpr_avl avl, void *key, void *user_data);
+typedef gpr_avl(*gpr_avl_remove_type)(gpr_avl avl, void* key, void* user_data);
 extern gpr_avl_remove_type gpr_avl_remove_import;
 #define gpr_avl_remove gpr_avl_remove_import
-typedef void *(*gpr_avl_get_type)(gpr_avl avl, void *key, void *user_data);
+typedef void*(*gpr_avl_get_type)(gpr_avl avl, void* key, void* user_data);
 extern gpr_avl_get_type gpr_avl_get_import;
 #define gpr_avl_get gpr_avl_get_import
-typedef int(*gpr_avl_maybe_get_type)(gpr_avl avl, void *key, void **value, void *user_data);
+typedef int(*gpr_avl_maybe_get_type)(gpr_avl avl, void* key, void** value, void* user_data);
 extern gpr_avl_maybe_get_type gpr_avl_maybe_get_import;
 #define gpr_avl_maybe_get gpr_avl_maybe_get_import
 typedef int(*gpr_avl_is_empty_type)(gpr_avl avl);
 extern gpr_avl_is_empty_type gpr_avl_is_empty_import;
 #define gpr_avl_is_empty gpr_avl_is_empty_import
-typedef gpr_cmdline *(*gpr_cmdline_create_type)(const char *description);
+typedef gpr_cmdline*(*gpr_cmdline_create_type)(const char* description);
 extern gpr_cmdline_create_type gpr_cmdline_create_import;
 #define gpr_cmdline_create gpr_cmdline_create_import
-typedef void(*gpr_cmdline_add_int_type)(gpr_cmdline *cl, const char *name, const char *help, int *value);
+typedef void(*gpr_cmdline_add_int_type)(gpr_cmdline* cl, const char* name, const char* help, int* value);
 extern gpr_cmdline_add_int_type gpr_cmdline_add_int_import;
 #define gpr_cmdline_add_int gpr_cmdline_add_int_import
-typedef void(*gpr_cmdline_add_flag_type)(gpr_cmdline *cl, const char *name, const char *help, int *value);
+typedef void(*gpr_cmdline_add_flag_type)(gpr_cmdline* cl, const char* name, const char* help, int* value);
 extern gpr_cmdline_add_flag_type gpr_cmdline_add_flag_import;
 #define gpr_cmdline_add_flag gpr_cmdline_add_flag_import
-typedef void(*gpr_cmdline_add_string_type)(gpr_cmdline *cl, const char *name, const char *help, char **value);
+typedef void(*gpr_cmdline_add_string_type)(gpr_cmdline* cl, const char* name, const char* help, const char** value);
 extern gpr_cmdline_add_string_type gpr_cmdline_add_string_import;
 #define gpr_cmdline_add_string gpr_cmdline_add_string_import
-typedef void(*gpr_cmdline_on_extra_arg_type)(gpr_cmdline *cl, const char *name, const char *help, void (*on_extra_arg)(void *user_data, const char *arg), void *user_data);
+typedef void(*gpr_cmdline_on_extra_arg_type)(gpr_cmdline* cl, const char* name, const char* help, void (*on_extra_arg)(void* user_data, const char* arg), void* user_data);
 extern gpr_cmdline_on_extra_arg_type gpr_cmdline_on_extra_arg_import;
 #define gpr_cmdline_on_extra_arg gpr_cmdline_on_extra_arg_import
-typedef void(*gpr_cmdline_set_survive_failure_type)(gpr_cmdline *cl);
+typedef void(*gpr_cmdline_set_survive_failure_type)(gpr_cmdline* cl);
 extern gpr_cmdline_set_survive_failure_type gpr_cmdline_set_survive_failure_import;
 #define gpr_cmdline_set_survive_failure gpr_cmdline_set_survive_failure_import
-typedef int(*gpr_cmdline_parse_type)(gpr_cmdline *cl, int argc, char **argv);
+typedef int(*gpr_cmdline_parse_type)(gpr_cmdline* cl, int argc, char** argv);
 extern gpr_cmdline_parse_type gpr_cmdline_parse_import;
 #define gpr_cmdline_parse gpr_cmdline_parse_import
-typedef void(*gpr_cmdline_destroy_type)(gpr_cmdline *cl);
+typedef void(*gpr_cmdline_destroy_type)(gpr_cmdline* cl);
 extern gpr_cmdline_destroy_type gpr_cmdline_destroy_import;
 #define gpr_cmdline_destroy gpr_cmdline_destroy_import
-typedef char *(*gpr_cmdline_usage_string_type)(gpr_cmdline *cl, const char *argv0);
+typedef char*(*gpr_cmdline_usage_string_type)(gpr_cmdline* cl, const char* argv0);
 extern gpr_cmdline_usage_string_type gpr_cmdline_usage_string_import;
 #define gpr_cmdline_usage_string gpr_cmdline_usage_string_import
 typedef unsigned(*gpr_cpu_num_cores_type)(void);
@@ -713,64 +649,64 @@
 typedef unsigned(*gpr_cpu_current_cpu_type)(void);
 extern gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
 #define gpr_cpu_current_cpu gpr_cpu_current_cpu_import
-typedef gpr_histogram *(*gpr_histogram_create_type)(double resolution, double max_bucket_start);
+typedef gpr_histogram*(*gpr_histogram_create_type)(double resolution, double max_bucket_start);
 extern gpr_histogram_create_type gpr_histogram_create_import;
 #define gpr_histogram_create gpr_histogram_create_import
-typedef void(*gpr_histogram_destroy_type)(gpr_histogram *h);
+typedef void(*gpr_histogram_destroy_type)(gpr_histogram* h);
 extern gpr_histogram_destroy_type gpr_histogram_destroy_import;
 #define gpr_histogram_destroy gpr_histogram_destroy_import
-typedef void(*gpr_histogram_add_type)(gpr_histogram *h, double x);
+typedef void(*gpr_histogram_add_type)(gpr_histogram* h, double x);
 extern gpr_histogram_add_type gpr_histogram_add_import;
 #define gpr_histogram_add gpr_histogram_add_import
-typedef int(*gpr_histogram_merge_type)(gpr_histogram *dst, const gpr_histogram *src);
+typedef int(*gpr_histogram_merge_type)(gpr_histogram* dst, const gpr_histogram* src);
 extern gpr_histogram_merge_type gpr_histogram_merge_import;
 #define gpr_histogram_merge gpr_histogram_merge_import
-typedef double(*gpr_histogram_percentile_type)(gpr_histogram *histogram, double percentile);
+typedef double(*gpr_histogram_percentile_type)(gpr_histogram* histogram, double percentile);
 extern gpr_histogram_percentile_type gpr_histogram_percentile_import;
 #define gpr_histogram_percentile gpr_histogram_percentile_import
-typedef double(*gpr_histogram_mean_type)(gpr_histogram *histogram);
+typedef double(*gpr_histogram_mean_type)(gpr_histogram* histogram);
 extern gpr_histogram_mean_type gpr_histogram_mean_import;
 #define gpr_histogram_mean gpr_histogram_mean_import
-typedef double(*gpr_histogram_stddev_type)(gpr_histogram *histogram);
+typedef double(*gpr_histogram_stddev_type)(gpr_histogram* histogram);
 extern gpr_histogram_stddev_type gpr_histogram_stddev_import;
 #define gpr_histogram_stddev gpr_histogram_stddev_import
-typedef double(*gpr_histogram_variance_type)(gpr_histogram *histogram);
+typedef double(*gpr_histogram_variance_type)(gpr_histogram* histogram);
 extern gpr_histogram_variance_type gpr_histogram_variance_import;
 #define gpr_histogram_variance gpr_histogram_variance_import
-typedef double(*gpr_histogram_maximum_type)(gpr_histogram *histogram);
+typedef double(*gpr_histogram_maximum_type)(gpr_histogram* histogram);
 extern gpr_histogram_maximum_type gpr_histogram_maximum_import;
 #define gpr_histogram_maximum gpr_histogram_maximum_import
-typedef double(*gpr_histogram_minimum_type)(gpr_histogram *histogram);
+typedef double(*gpr_histogram_minimum_type)(gpr_histogram* histogram);
 extern gpr_histogram_minimum_type gpr_histogram_minimum_import;
 #define gpr_histogram_minimum gpr_histogram_minimum_import
-typedef double(*gpr_histogram_count_type)(gpr_histogram *histogram);
+typedef double(*gpr_histogram_count_type)(gpr_histogram* histogram);
 extern gpr_histogram_count_type gpr_histogram_count_import;
 #define gpr_histogram_count gpr_histogram_count_import
-typedef double(*gpr_histogram_sum_type)(gpr_histogram *histogram);
+typedef double(*gpr_histogram_sum_type)(gpr_histogram* histogram);
 extern gpr_histogram_sum_type gpr_histogram_sum_import;
 #define gpr_histogram_sum gpr_histogram_sum_import
-typedef double(*gpr_histogram_sum_of_squares_type)(gpr_histogram *histogram);
+typedef double(*gpr_histogram_sum_of_squares_type)(gpr_histogram* histogram);
 extern gpr_histogram_sum_of_squares_type gpr_histogram_sum_of_squares_import;
 #define gpr_histogram_sum_of_squares gpr_histogram_sum_of_squares_import
-typedef const uint32_t *(*gpr_histogram_get_contents_type)(gpr_histogram *histogram, size_t *count);
+typedef const uint32_t*(*gpr_histogram_get_contents_type)(gpr_histogram* histogram, size_t* count);
 extern gpr_histogram_get_contents_type gpr_histogram_get_contents_import;
 #define gpr_histogram_get_contents gpr_histogram_get_contents_import
-typedef void(*gpr_histogram_merge_contents_type)(gpr_histogram *histogram, const uint32_t *data, size_t data_count, double min_seen, double max_seen, double sum, double sum_of_squares, double count);
+typedef void(*gpr_histogram_merge_contents_type)(gpr_histogram* histogram, const uint32_t* data, size_t data_count, double min_seen, double max_seen, double sum, double sum_of_squares, double count);
 extern gpr_histogram_merge_contents_type gpr_histogram_merge_contents_import;
 #define gpr_histogram_merge_contents gpr_histogram_merge_contents_import
-typedef int(*gpr_join_host_port_type)(char **out, const char *host, int port);
+typedef int(*gpr_join_host_port_type)(char** out, const char* host, int port);
 extern gpr_join_host_port_type gpr_join_host_port_import;
 #define gpr_join_host_port gpr_join_host_port_import
-typedef int(*gpr_split_host_port_type)(const char *name, char **host, char **port);
+typedef int(*gpr_split_host_port_type)(const char* name, char** host, char** port);
 extern gpr_split_host_port_type gpr_split_host_port_import;
 #define gpr_split_host_port gpr_split_host_port_import
-typedef const char *(*gpr_log_severity_string_type)(gpr_log_severity severity);
+typedef const char*(*gpr_log_severity_string_type)(gpr_log_severity severity);
 extern gpr_log_severity_string_type gpr_log_severity_string_import;
 #define gpr_log_severity_string gpr_log_severity_string_import
-typedef void(*gpr_log_type)(const char *file, int line, gpr_log_severity severity, const char *format, ...) GPR_PRINT_FORMAT_CHECK(4, 5);
+typedef void(*gpr_log_type)(const char* file, int line, gpr_log_severity severity, const char* format, ...) GPR_PRINT_FORMAT_CHECK(4, 5);
 extern gpr_log_type gpr_log_import;
 #define gpr_log gpr_log_import
-typedef void(*gpr_log_message_type)(const char *file, int line, gpr_log_severity severity, const char *message);
+typedef void(*gpr_log_message_type)(const char* file, int line, gpr_log_severity severity, const char* message);
 extern gpr_log_message_type gpr_log_message_import;
 #define gpr_log_message gpr_log_message_import
 typedef void(*gpr_set_log_verbosity_type)(gpr_log_severity min_severity_to_print);
@@ -782,118 +718,118 @@
 typedef void(*gpr_set_log_function_type)(gpr_log_func func);
 extern gpr_set_log_function_type gpr_set_log_function_import;
 #define gpr_set_log_function gpr_set_log_function_import
-typedef char *(*gpr_format_message_type)(int messageid);
+typedef char*(*gpr_format_message_type)(int messageid);
 extern gpr_format_message_type gpr_format_message_import;
 #define gpr_format_message gpr_format_message_import
-typedef char *(*gpr_strdup_type)(const char *src);
+typedef char*(*gpr_strdup_type)(const char* src);
 extern gpr_strdup_type gpr_strdup_import;
 #define gpr_strdup gpr_strdup_import
-typedef int(*gpr_asprintf_type)(char **strp, const char *format, ...) GPR_PRINT_FORMAT_CHECK(2, 3);
+typedef int(*gpr_asprintf_type)(char** strp, const char* format, ...) GPR_PRINT_FORMAT_CHECK(2, 3);
 extern gpr_asprintf_type gpr_asprintf_import;
 #define gpr_asprintf gpr_asprintf_import
-typedef const char *(*gpr_subprocess_binary_extension_type)();
+typedef const char*(*gpr_subprocess_binary_extension_type)();
 extern gpr_subprocess_binary_extension_type gpr_subprocess_binary_extension_import;
 #define gpr_subprocess_binary_extension gpr_subprocess_binary_extension_import
-typedef gpr_subprocess *(*gpr_subprocess_create_type)(int argc, const char **argv);
+typedef gpr_subprocess*(*gpr_subprocess_create_type)(int argc, const char** argv);
 extern gpr_subprocess_create_type gpr_subprocess_create_import;
 #define gpr_subprocess_create gpr_subprocess_create_import
-typedef void(*gpr_subprocess_destroy_type)(gpr_subprocess *p);
+typedef void(*gpr_subprocess_destroy_type)(gpr_subprocess* p);
 extern gpr_subprocess_destroy_type gpr_subprocess_destroy_import;
 #define gpr_subprocess_destroy gpr_subprocess_destroy_import
-typedef int(*gpr_subprocess_join_type)(gpr_subprocess *p);
+typedef int(*gpr_subprocess_join_type)(gpr_subprocess* p);
 extern gpr_subprocess_join_type gpr_subprocess_join_import;
 #define gpr_subprocess_join gpr_subprocess_join_import
-typedef void(*gpr_subprocess_interrupt_type)(gpr_subprocess *p);
+typedef void(*gpr_subprocess_interrupt_type)(gpr_subprocess* p);
 extern gpr_subprocess_interrupt_type gpr_subprocess_interrupt_import;
 #define gpr_subprocess_interrupt gpr_subprocess_interrupt_import
-typedef void(*gpr_mu_init_type)(gpr_mu *mu);
+typedef void(*gpr_mu_init_type)(gpr_mu* mu);
 extern gpr_mu_init_type gpr_mu_init_import;
 #define gpr_mu_init gpr_mu_init_import
-typedef void(*gpr_mu_destroy_type)(gpr_mu *mu);
+typedef void(*gpr_mu_destroy_type)(gpr_mu* mu);
 extern gpr_mu_destroy_type gpr_mu_destroy_import;
 #define gpr_mu_destroy gpr_mu_destroy_import
-typedef void(*gpr_mu_lock_type)(gpr_mu *mu);
+typedef void(*gpr_mu_lock_type)(gpr_mu* mu);
 extern gpr_mu_lock_type gpr_mu_lock_import;
 #define gpr_mu_lock gpr_mu_lock_import
-typedef void(*gpr_mu_unlock_type)(gpr_mu *mu);
+typedef void(*gpr_mu_unlock_type)(gpr_mu* mu);
 extern gpr_mu_unlock_type gpr_mu_unlock_import;
 #define gpr_mu_unlock gpr_mu_unlock_import
-typedef int(*gpr_mu_trylock_type)(gpr_mu *mu);
+typedef int(*gpr_mu_trylock_type)(gpr_mu* mu);
 extern gpr_mu_trylock_type gpr_mu_trylock_import;
 #define gpr_mu_trylock gpr_mu_trylock_import
-typedef void(*gpr_cv_init_type)(gpr_cv *cv);
+typedef void(*gpr_cv_init_type)(gpr_cv* cv);
 extern gpr_cv_init_type gpr_cv_init_import;
 #define gpr_cv_init gpr_cv_init_import
-typedef void(*gpr_cv_destroy_type)(gpr_cv *cv);
+typedef void(*gpr_cv_destroy_type)(gpr_cv* cv);
 extern gpr_cv_destroy_type gpr_cv_destroy_import;
 #define gpr_cv_destroy gpr_cv_destroy_import
-typedef int(*gpr_cv_wait_type)(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline);
+typedef int(*gpr_cv_wait_type)(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline);
 extern gpr_cv_wait_type gpr_cv_wait_import;
 #define gpr_cv_wait gpr_cv_wait_import
-typedef void(*gpr_cv_signal_type)(gpr_cv *cv);
+typedef void(*gpr_cv_signal_type)(gpr_cv* cv);
 extern gpr_cv_signal_type gpr_cv_signal_import;
 #define gpr_cv_signal gpr_cv_signal_import
-typedef void(*gpr_cv_broadcast_type)(gpr_cv *cv);
+typedef void(*gpr_cv_broadcast_type)(gpr_cv* cv);
 extern gpr_cv_broadcast_type gpr_cv_broadcast_import;
 #define gpr_cv_broadcast gpr_cv_broadcast_import
-typedef void(*gpr_once_init_type)(gpr_once *once, void (*init_routine)(void));
+typedef void(*gpr_once_init_type)(gpr_once* once, void (*init_routine)(void));
 extern gpr_once_init_type gpr_once_init_import;
 #define gpr_once_init gpr_once_init_import
-typedef void(*gpr_event_init_type)(gpr_event *ev);
+typedef void(*gpr_event_init_type)(gpr_event* ev);
 extern gpr_event_init_type gpr_event_init_import;
 #define gpr_event_init gpr_event_init_import
-typedef void(*gpr_event_set_type)(gpr_event *ev, void *value);
+typedef void(*gpr_event_set_type)(gpr_event* ev, void* value);
 extern gpr_event_set_type gpr_event_set_import;
 #define gpr_event_set gpr_event_set_import
-typedef void *(*gpr_event_get_type)(gpr_event *ev);
+typedef void*(*gpr_event_get_type)(gpr_event* ev);
 extern gpr_event_get_type gpr_event_get_import;
 #define gpr_event_get gpr_event_get_import
-typedef void *(*gpr_event_wait_type)(gpr_event *ev, gpr_timespec abs_deadline);
+typedef void*(*gpr_event_wait_type)(gpr_event* ev, gpr_timespec abs_deadline);
 extern gpr_event_wait_type gpr_event_wait_import;
 #define gpr_event_wait gpr_event_wait_import
-typedef void(*gpr_ref_init_type)(gpr_refcount *r, int n);
+typedef void(*gpr_ref_init_type)(gpr_refcount* r, int n);
 extern gpr_ref_init_type gpr_ref_init_import;
 #define gpr_ref_init gpr_ref_init_import
-typedef void(*gpr_ref_type)(gpr_refcount *r);
+typedef void(*gpr_ref_type)(gpr_refcount* r);
 extern gpr_ref_type gpr_ref_import;
 #define gpr_ref gpr_ref_import
-typedef void(*gpr_ref_non_zero_type)(gpr_refcount *r);
+typedef void(*gpr_ref_non_zero_type)(gpr_refcount* r);
 extern gpr_ref_non_zero_type gpr_ref_non_zero_import;
 #define gpr_ref_non_zero gpr_ref_non_zero_import
-typedef void(*gpr_refn_type)(gpr_refcount *r, int n);
+typedef void(*gpr_refn_type)(gpr_refcount* r, int n);
 extern gpr_refn_type gpr_refn_import;
 #define gpr_refn gpr_refn_import
-typedef int(*gpr_unref_type)(gpr_refcount *r);
+typedef int(*gpr_unref_type)(gpr_refcount* r);
 extern gpr_unref_type gpr_unref_import;
 #define gpr_unref gpr_unref_import
-typedef int(*gpr_ref_is_unique_type)(gpr_refcount *r);
+typedef int(*gpr_ref_is_unique_type)(gpr_refcount* r);
 extern gpr_ref_is_unique_type gpr_ref_is_unique_import;
 #define gpr_ref_is_unique gpr_ref_is_unique_import
-typedef void(*gpr_stats_init_type)(gpr_stats_counter *c, intptr_t n);
+typedef void(*gpr_stats_init_type)(gpr_stats_counter* c, intptr_t n);
 extern gpr_stats_init_type gpr_stats_init_import;
 #define gpr_stats_init gpr_stats_init_import
-typedef void(*gpr_stats_inc_type)(gpr_stats_counter *c, intptr_t inc);
+typedef void(*gpr_stats_inc_type)(gpr_stats_counter* c, intptr_t inc);
 extern gpr_stats_inc_type gpr_stats_inc_import;
 #define gpr_stats_inc gpr_stats_inc_import
-typedef intptr_t(*gpr_stats_read_type)(const gpr_stats_counter *c);
+typedef intptr_t(*gpr_stats_read_type)(const gpr_stats_counter* c);
 extern gpr_stats_read_type gpr_stats_read_import;
 #define gpr_stats_read gpr_stats_read_import
-typedef int(*gpr_thd_new_type)(gpr_thd_id *t, void (*thd_body)(void *arg), void *arg, const gpr_thd_options *options);
+typedef int(*gpr_thd_new_type)(gpr_thd_id* t, void (*thd_body)(void* arg), void* arg, const gpr_thd_options* options);
 extern gpr_thd_new_type gpr_thd_new_import;
 #define gpr_thd_new gpr_thd_new_import
 typedef gpr_thd_options(*gpr_thd_options_default_type)(void);
 extern gpr_thd_options_default_type gpr_thd_options_default_import;
 #define gpr_thd_options_default gpr_thd_options_default_import
-typedef void(*gpr_thd_options_set_detached_type)(gpr_thd_options *options);
+typedef void(*gpr_thd_options_set_detached_type)(gpr_thd_options* options);
 extern gpr_thd_options_set_detached_type gpr_thd_options_set_detached_import;
 #define gpr_thd_options_set_detached gpr_thd_options_set_detached_import
-typedef void(*gpr_thd_options_set_joinable_type)(gpr_thd_options *options);
+typedef void(*gpr_thd_options_set_joinable_type)(gpr_thd_options* options);
 extern gpr_thd_options_set_joinable_type gpr_thd_options_set_joinable_import;
 #define gpr_thd_options_set_joinable gpr_thd_options_set_joinable_import
-typedef int(*gpr_thd_options_is_detached_type)(const gpr_thd_options *options);
+typedef int(*gpr_thd_options_is_detached_type)(const gpr_thd_options* options);
 extern gpr_thd_options_is_detached_type gpr_thd_options_is_detached_import;
 #define gpr_thd_options_is_detached gpr_thd_options_is_detached_import
-typedef int(*gpr_thd_options_is_joinable_type)(const gpr_thd_options *options);
+typedef int(*gpr_thd_options_is_joinable_type)(const gpr_thd_options* options);
 extern gpr_thd_options_is_joinable_type gpr_thd_options_is_joinable_import;
 #define gpr_thd_options_is_joinable gpr_thd_options_is_joinable_import
 typedef gpr_thd_id(*gpr_thd_currentid_type)(void);
diff --git a/src/ruby/ext/grpc/rb_server.c b/src/ruby/ext/grpc/rb_server.c
index e96de4f..160c153 100644
--- a/src/ruby/ext/grpc/rb_server.c
+++ b/src/ruby/ext/grpc/rb_server.c
@@ -44,12 +44,12 @@
 /* grpc_rb_server wraps a grpc_server. */
 typedef struct grpc_rb_server {
   /* The actual server */
-  grpc_server *wrapped;
-  grpc_completion_queue *queue;
+  grpc_server* wrapped;
+  grpc_completion_queue* queue;
   gpr_atm shutdown_started;
 } grpc_rb_server;
 
-static void destroy_server(grpc_rb_server *server, gpr_timespec deadline) {
+static void destroy_server(grpc_rb_server* server, gpr_timespec deadline) {
   grpc_event ev;
   // This can be started by app or implicitly by GC. Avoid a race between these.
   if (gpr_atm_full_fetch_add(&server->shutdown_started, (gpr_atm)1) == 0) {
@@ -70,13 +70,13 @@
 }
 
 /* Destroys server instances. */
-static void grpc_rb_server_free(void *p) {
-  grpc_rb_server *svr = NULL;
+static void grpc_rb_server_free(void* p) {
+  grpc_rb_server* svr = NULL;
   gpr_timespec deadline;
   if (p == NULL) {
     return;
   };
-  svr = (grpc_rb_server *)p;
+  svr = (grpc_rb_server*)p;
 
   deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
                           gpr_time_from_seconds(2, GPR_TIMESPAN));
@@ -105,7 +105,7 @@
 
 /* Allocates grpc_rb_server instances. */
 static VALUE grpc_rb_server_alloc(VALUE cls) {
-  grpc_rb_server *wrapper = ALLOC(grpc_rb_server);
+  grpc_rb_server* wrapper = ALLOC(grpc_rb_server);
   wrapper->wrapped = NULL;
   wrapper->shutdown_started = (gpr_atm)0;
   return TypedData_Wrap_Struct(cls, &grpc_rb_server_data_type, wrapper);
@@ -117,9 +117,9 @@
 
   Initializes server instances. */
 static VALUE grpc_rb_server_init(VALUE self, VALUE channel_args) {
-  grpc_completion_queue *cq = NULL;
-  grpc_rb_server *wrapper = NULL;
-  grpc_server *srv = NULL;
+  grpc_completion_queue* cq = NULL;
+  grpc_rb_server* wrapper = NULL;
+  grpc_server* srv = NULL;
   grpc_channel_args args;
   MEMZERO(&args, grpc_channel_args, 1);
 
@@ -153,7 +153,7 @@
 
 /* grpc_request_call_stack_init ensures the request_call_stack is properly
  * initialized */
-static void grpc_request_call_stack_init(request_call_stack *st) {
+static void grpc_request_call_stack_init(request_call_stack* st) {
   MEMZERO(st, request_call_stack, 1);
   grpc_metadata_array_init(&st->md_ary);
   grpc_call_details_init(&st->details);
@@ -161,7 +161,7 @@
 
 /* grpc_request_call_stack_cleanup ensures the request_call_stack is properly
  * cleaned up */
-static void grpc_request_call_stack_cleanup(request_call_stack *st) {
+static void grpc_request_call_stack_cleanup(request_call_stack* st) {
   grpc_metadata_array_destroy(&st->md_ary);
   grpc_call_details_destroy(&st->details);
 }
@@ -171,14 +171,14 @@
 
    Requests notification of a new call on a server. */
 static VALUE grpc_rb_server_request_call(VALUE self) {
-  grpc_rb_server *s = NULL;
-  grpc_call *call = NULL;
+  grpc_rb_server* s = NULL;
+  grpc_call* call = NULL;
   grpc_event ev;
   grpc_call_error err;
   request_call_stack st;
   VALUE result;
-  void *tag = (void *)&st;
-  grpc_completion_queue *call_queue =
+  void* tag = (void*)&st;
+  grpc_completion_queue* call_queue =
       grpc_completion_queue_create_for_pluck(NULL);
   gpr_timespec deadline;
 
@@ -222,7 +222,7 @@
 }
 
 static VALUE grpc_rb_server_start(VALUE self) {
-  grpc_rb_server *s = NULL;
+  grpc_rb_server* s = NULL;
   TypedData_Get_Struct(self, grpc_rb_server, &grpc_rb_server_data_type, s);
   if (s->wrapped == NULL) {
     rb_raise(rb_eRuntimeError, "destroyed!");
@@ -244,10 +244,10 @@
     server.destroy(timeout)
 
   Destroys server instances. */
-static VALUE grpc_rb_server_destroy(int argc, VALUE *argv, VALUE self) {
+static VALUE grpc_rb_server_destroy(int argc, VALUE* argv, VALUE self) {
   VALUE timeout = Qnil;
   gpr_timespec deadline;
-  grpc_rb_server *s = NULL;
+  grpc_rb_server* s = NULL;
 
   /* "01" == 0 mandatory args, 1 (timeout) is optional */
   rb_scan_args(argc, argv, "01", &timeout);
@@ -277,8 +277,8 @@
     Adds a http2 port to server */
 static VALUE grpc_rb_server_add_http2_port(VALUE self, VALUE port,
                                            VALUE rb_creds) {
-  grpc_rb_server *s = NULL;
-  grpc_server_credentials *creds = NULL;
+  grpc_rb_server* s = NULL;
+  grpc_server_credentials* creds = NULL;
   int recvd_port = 0;
 
   TypedData_Get_Struct(self, grpc_rb_server, &grpc_rb_server_data_type, s);
@@ -335,8 +335,8 @@
 }
 
 /* Gets the wrapped server from the ruby wrapper */
-grpc_server *grpc_rb_get_wrapped_server(VALUE v) {
-  grpc_rb_server *wrapper = NULL;
+grpc_server* grpc_rb_get_wrapped_server(VALUE v) {
+  grpc_rb_server* wrapper = NULL;
   TypedData_Get_Struct(v, grpc_rb_server, &grpc_rb_server_data_type, wrapper);
   return wrapper->wrapped;
 }
diff --git a/src/ruby/ext/grpc/rb_server_credentials.c b/src/ruby/ext/grpc/rb_server_credentials.c
index 6d7b54c..368d5c2 100644
--- a/src/ruby/ext/grpc/rb_server_credentials.c
+++ b/src/ruby/ext/grpc/rb_server_credentials.c
@@ -38,16 +38,16 @@
   /* Holder of ruby objects involved in constructing the server credentials */
   VALUE mark;
   /* The actual server credentials */
-  grpc_server_credentials *wrapped;
+  grpc_server_credentials* wrapped;
 } grpc_rb_server_credentials;
 
 /* Destroys the server credentials instances. */
-static void grpc_rb_server_credentials_free(void *p) {
-  grpc_rb_server_credentials *wrapper = NULL;
+static void grpc_rb_server_credentials_free(void* p) {
+  grpc_rb_server_credentials* wrapper = NULL;
   if (p == NULL) {
     return;
   };
-  wrapper = (grpc_rb_server_credentials *)p;
+  wrapper = (grpc_rb_server_credentials*)p;
 
   /* Delete the wrapped object if the mark object is Qnil, which indicates that
      no other object is the actual owner. */
@@ -60,12 +60,12 @@
 }
 
 /* Protects the mark object from GC */
-static void grpc_rb_server_credentials_mark(void *p) {
-  grpc_rb_server_credentials *wrapper = NULL;
+static void grpc_rb_server_credentials_mark(void* p) {
+  grpc_rb_server_credentials* wrapper = NULL;
   if (p == NULL) {
     return;
   }
-  wrapper = (grpc_rb_server_credentials *)p;
+  wrapper = (grpc_rb_server_credentials*)p;
 
   /* If it's not already cleaned up, mark the mark object */
   if (wrapper->mark != Qnil) {
@@ -90,7 +90,7 @@
 
    Provides safe initial defaults for the instance fields. */
 static VALUE grpc_rb_server_credentials_alloc(VALUE cls) {
-  grpc_rb_server_credentials *wrapper = ALLOC(grpc_rb_server_credentials);
+  grpc_rb_server_credentials* wrapper = ALLOC(grpc_rb_server_credentials);
   wrapper->wrapped = NULL;
   wrapper->mark = Qnil;
   return TypedData_Wrap_Struct(cls, &grpc_rb_server_credentials_data_type,
@@ -128,9 +128,9 @@
 static VALUE grpc_rb_server_credentials_init(VALUE self, VALUE pem_root_certs,
                                              VALUE pem_key_certs,
                                              VALUE force_client_auth) {
-  grpc_rb_server_credentials *wrapper = NULL;
-  grpc_server_credentials *creds = NULL;
-  grpc_ssl_pem_key_cert_pair *key_cert_pairs = NULL;
+  grpc_rb_server_credentials* wrapper = NULL;
+  grpc_server_credentials* creds = NULL;
+  grpc_ssl_pem_key_cert_pair* key_cert_pairs = NULL;
   VALUE cert = Qnil;
   VALUE key = Qnil;
   VALUE key_cert = Qnil;
@@ -235,8 +235,8 @@
 }
 
 /* Gets the wrapped grpc_server_credentials from the ruby wrapper */
-grpc_server_credentials *grpc_rb_get_wrapped_server_credentials(VALUE v) {
-  grpc_rb_server_credentials *wrapper = NULL;
+grpc_server_credentials* grpc_rb_get_wrapped_server_credentials(VALUE v) {
+  grpc_rb_server_credentials* wrapper = NULL;
   TypedData_Get_Struct(v, grpc_rb_server_credentials,
                        &grpc_rb_server_credentials_data_type, wrapper);
   return wrapper->wrapped;
diff --git a/src/ruby/qps/proxy-worker.rb b/src/ruby/qps/proxy-worker.rb
index fc5db50..4c7c510 100755
--- a/src/ruby/qps/proxy-worker.rb
+++ b/src/ruby/qps/proxy-worker.rb
@@ -31,9 +31,10 @@
 require 'src/proto/grpc/testing/proxy-service_services_pb'
 
 class ProxyBenchmarkClientServiceImpl < Grpc::Testing::ProxyClientService::Service
-  def initialize(port, c_ext)
+  def initialize(port, c_ext, php_client_bin)
     @mytarget = "localhost:" + port.to_s
     @use_c_ext = c_ext
+    @php_client_bin = php_client_bin
   end
   def setup(config)
     @config = config
@@ -49,11 +50,11 @@
           command = "php -d extension=" + File.expand_path(File.dirname(__FILE__)) +
             "/../../php/tests/qps/vendor/google/protobuf/php/ext/google/protobuf/modules/protobuf.so " +
             "-d extension=" + File.expand_path(File.dirname(__FILE__)) + "/../../php/ext/grpc/modules/grpc.so " +
-            File.expand_path(File.dirname(__FILE__)) + "/../../php/tests/qps/client.php " + @mytarget + " #{chan%@config.server_targets.length}"
+            File.expand_path(File.dirname(__FILE__)) + "/" + @php_client_bin + " " + @mytarget + " #{chan%@config.server_targets.length}"
         else
           puts "Use protobuf php extension"
           command = "php -d extension=" + File.expand_path(File.dirname(__FILE__)) + "/../../php/ext/grpc/modules/grpc.so " +
-            File.expand_path(File.dirname(__FILE__)) + "/../../php/tests/qps/client.php " + @mytarget + " #{chan%@config.server_targets.length}"
+            File.expand_path(File.dirname(__FILE__)) + "/" + @php_client_bin + " " + @mytarget + " #{chan%@config.server_targets.length}"
         end
         puts "[ruby proxy] Starting #{chan}th php-client command use c protobuf #{@use_c_ext}: " + command
         @php_pid[chan] = spawn(command)
@@ -145,7 +146,8 @@
 
 def proxymain
   options = {
-    'driver_port' => 0
+    'driver_port' => 0,
+    'php_client_bin' => '../../php/tests/qps/client.php'
   }
   OptionParser.new do |opts|
     opts.banner = 'Usage: [--driver_port <port>]'
@@ -155,6 +157,10 @@
     opts.on("-c", "--[no-]use_protobuf_c_extension", "Use protobuf C-extention") do |c|
       options[:c_ext] = c
     end
+    opts.on("-b", "--php_client_bin [FILE]",
+      "PHP client to execute; path relative to this script") do |c|
+      options['php_client_bin'] = c
+    end
   end.parse!
 
   # Configure any errors with client or server child threads to surface
@@ -164,7 +170,7 @@
   s = GRPC::RpcServer.new(pool_size: 1024)
   port = s.add_http2_port("0.0.0.0:" + options['driver_port'].to_s,
                           :this_port_is_insecure)
-  bmc = ProxyBenchmarkClientServiceImpl.new(port, options[:c_ext])
+  bmc = ProxyBenchmarkClientServiceImpl.new(port, options[:c_ext], options['php_client_bin'])
   s.handle(bmc)
   s.handle(ProxyWorkerServiceImpl.new(s, bmc))
   s.run
diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template
deleted file mode 100644
index adb7d9f..0000000
--- a/templates/binding.gyp.template
+++ /dev/null
@@ -1,371 +0,0 @@
-%YAML 1.2
---- |
-  # GRPC Node gyp file
-  # This currently builds the Node extension and dependencies
-  # This file has been automatically generated from a template file.
-  # Please look at the templates directory instead.
-  # This file can be regenerated from the template by running
-  # tools/buildgen/generate_projects.sh
-
-  # Copyright 2015 gRPC authors.
-  #
-  # Licensed under the Apache License, Version 2.0 (the "License");
-  # you may not use this file except in compliance with the License.
-  # You may obtain a copy of the License at
-  #
-  #     http://www.apache.org/licenses/LICENSE-2.0
-  #
-  # Unless required by applicable law or agreed to in writing, software
-  # distributed under the License is distributed on an "AS IS" BASIS,
-  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  # See the License for the specific language governing permissions and
-  # limitations under the License.
-
-  # Some of this file is built with the help of
-  # https://n8.io/converting-a-c-library-to-gyp/
-  {
-    'variables': {
-      'runtime%': 'node',
-      # Some Node installations use the system installation of OpenSSL, and on
-      # some systems, the system OpenSSL still does not have ALPN support. This
-      # will let users recompile gRPC to work without ALPN.
-      'grpc_alpn%': 'true',
-      # Indicates that the library should be built with gcov.
-      'grpc_gcov%': 'false',
-      # Indicates that the library should be built with compatibility for musl
-      # libc, so that it can run on Alpine Linux. This is only necessary if not
-      # building on Alpine Linux
-      'grpc_alpine%': 'false'
-    },
-    'target_defaults': {
-      'configurations': {
-        % for name, args in configs.iteritems():
-        %  if name in ['dbg', 'opt']:
-        '${{'dbg':'Debug', 'opt': 'Release'}[name]}': {
-          % for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines')]:
-          %  if args.get(arg, None) is not None:
-          '${prop}': [
-            % for item in args.get(arg).split():
-              '${item}',
-            % endfor
-          ],
-          %  endif
-          % endfor
-        },
-        %  endif
-        % endfor
-      },
-      % for arg, prop in [('CPPFLAGS', 'cflags'), ('LDFLAGS', 'ldflags')]:
-      %  if defaults['global'].get(arg, None) is not None:
-      '${prop}': [
-        % for item in defaults['global'].get(arg).split():
-          '${item}',
-        % endfor
-      ],
-      %  endif
-      % endfor
-      'cflags_c': [
-        '-Werror',
-        '-std=c99'
-      ],
-      'cflags_cc': [
-        '-Werror',
-        '-std=c++11'
-      ],
-      'include_dirs': [
-        '.',
-        'include'
-      ],
-      'defines': [
-        'GPR_BACKWARDS_COMPATIBILITY_MODE',
-        'GRPC_ARES=0',
-        'GRPC_UV'
-      ],
-      'conditions': [
-        ['grpc_gcov=="true"', {
-          % for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines'), ('LDFLAGS', 'ldflags')]:
-          %  if configs['gcov'].get(arg, None) is not None:
-          '${prop}': [
-            % for item in configs['gcov'].get(arg).split():
-              '${item}',
-            % endfor
-          ],
-          %  endif
-          % endfor
-        }],
-        ['grpc_alpine=="true"', {
-          'defines': [
-            'GPR_MUSL_LIBC_COMPAT'
-          ]
-        }],
-        ['OS!="win" and runtime=="electron"', {
-          "defines": [
-            'OPENSSL_NO_THREADS'
-          ]
-        }],
-        # This is the condition for using boringssl
-        ['OS=="win" or runtime=="electron"', {
-          "include_dirs": [
-            "third_party/boringssl/include"
-          ],
-          "defines": [
-            'OPENSSL_NO_ASM'
-          ]
-        }, {
-          'conditions': [
-            ["target_arch=='ia32'", {
-               "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
-            }],
-            ["target_arch=='x64'", {
-               "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
-            }],
-            ["target_arch=='arm'", {
-               "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
-            }],
-            ['grpc_alpn=="true"', {
-              'defines': [
-                'TSI_OPENSSL_ALPN_SUPPORT=1'
-              ],
-            }, {
-              'defines': [
-                'TSI_OPENSSL_ALPN_SUPPORT=0'
-              ],
-            }]
-          ],
-          'include_dirs': [
-            '<(node_root_dir)/deps/openssl/openssl/include',
-          ]
-        }],
-        ['OS == "win"', {
-          "include_dirs": [
-            "third_party/zlib",
-            "third_party/cares/cares"
-          ],
-          "defines": [
-            '_WIN32_WINNT=0x0600',
-            'WIN32_LEAN_AND_MEAN',
-            '_HAS_EXCEPTIONS=0',
-            'UNICODE',
-            '_UNICODE',
-            'NOMINMAX',
-          ],
-          "msvs_settings": {
-            'VCCLCompilerTool': {
-              'RuntimeLibrary': 1, # static debug
-            }
-          },
-          "libraries": [
-            "ws2_32"
-          ]
-        }, { # OS != "win"
-          'include_dirs': [
-            '<(node_root_dir)/deps/zlib',
-            '<(node_root_dir)/deps/cares/include'
-          ]
-        }],
-        ['OS == "mac"', {
-          'xcode_settings': {
-            % if defaults['global'].get('CPPFLAGS', None) is not None:
-            'OTHER_CFLAGS': [
-              % for item in defaults['global'].get('CPPFLAGS').split():
-                '${item}',
-              % endfor
-            ],
-            'OTHER_CPLUSPLUSFLAGS': [
-              % for item in defaults['global'].get('CPPFLAGS').split():
-                '${item}',
-              % endfor
-              '-stdlib=libc++',
-              '-std=c++11',
-              '-Wno-error=deprecated-declarations'
-            ],
-            % endif
-          },
-        }]
-      ]
-    },
-    'conditions': [
-      ['OS=="win" or runtime=="electron"', {
-        'targets': [
-          % for module in node_modules:
-          % for lib in libs:
-          % if lib.name in module.transitive_deps and lib.name == 'boringssl':
-          {
-            'target_name': '${lib.name}',
-            'product_prefix': 'lib',
-            'type': 'static_library',
-            'dependencies': [
-              % for dep in getattr(lib, 'deps', []):
-              '${dep}',
-              % endfor
-            ],
-            'sources': [
-              % for source in lib.src:
-              '${source}',
-              % endfor
-            ],
-            'conditions': [
-              ['OS == "mac"', {
-                'xcode_settings': {
-                  'MACOSX_DEPLOYMENT_TARGET': '10.9'
-                }
-              }]
-            ]
-          },
-          % endif
-          % endfor
-          % endfor
-        ],
-      }],
-      ['OS == "win" and runtime!="electron"', {
-        'targets': [
-          {
-            # IMPORTANT WINDOWS BUILD INFORMATION
-            # This library does not build on Windows without modifying the Node
-            # development packages that node-gyp downloads in order to build.
-            # Due to https://github.com/nodejs/node/issues/4932, the headers for
-            # BoringSSL conflict with the OpenSSL headers included by default
-            # when including the Node headers. The remedy for this is to remove
-            # the OpenSSL headers, from the downloaded Node development package,
-            # which is typically located in `.node-gyp` in your home directory.
-            #
-            # This is not true of Electron, which does not have OpenSSL headers.
-            'target_name': 'WINDOWS_BUILD_WARNING',
-            'rules': [
-              {
-                'rule_name': 'WINDOWS_BUILD_WARNING',
-                'extension': 'S',
-                'inputs': [
-                  'package.json'
-                ],
-                'outputs': [
-                  'ignore_this_part'
-                ],
-                'action': ['echo', 'IMPORTANT: Due to https://github.com/nodejs/node/issues/4932, to build this library on Windows, you must first remove <(node_root_dir)/include/node/openssl/']
-              }
-            ]
-          },
-        ]
-      }],
-      ['OS == "win"', {
-        'targets': [
-          # Only want to compile zlib under Windows
-          % for module in node_modules:
-          % for lib in libs:
-          % if lib.name in module.transitive_deps and lib.name == 'z':
-          {
-            'target_name': '${lib.name}',
-            'product_prefix': 'lib',
-            'type': 'static_library',
-            'dependencies': [
-              % for dep in getattr(lib, 'deps', []):
-              '${dep}',
-              % endfor
-            ],
-            'sources': [
-              % for source in lib.src:
-              '${source}',
-              % endfor
-            ]
-          },
-          % endif
-          % endfor
-          % endfor
-        ]
-      }]
-    ],
-    'targets': [
-      % for module in node_modules:
-      % for lib in libs:
-      % if lib.name in module.transitive_deps and lib.name not in ('boringssl', 'z'):
-      {
-        'target_name': '${lib.name}',
-        'product_prefix': 'lib',
-        'type': 'static_library',
-        'dependencies': [
-          % for dep in getattr(lib, 'deps', []):
-          '${dep}',
-          % endfor
-        ],
-        'sources': [
-          % for source in lib.src:
-          '${source}',
-          % endfor
-        ],
-        'conditions': [
-          ['OS == "mac"', {
-            'xcode_settings': {
-              'MACOSX_DEPLOYMENT_TARGET': '10.9'
-            }
-          }]
-        ]
-      },
-      % endif
-      % endfor
-      {
-        'include_dirs': [
-          "<!(node -e \"require('nan')\")"
-        ],
-        'cflags': [
-          '-pthread',
-          '-zdefs',
-          '-Wno-error=deprecated-declarations'
-        ],
-        "conditions": [
-          ['OS=="win" or runtime=="electron"', {
-            'dependencies': [
-              % for dep in getattr(module, 'deps', []):
-              % if dep == 'boringssl':
-              "${dep}",
-              % endif
-              % endfor
-            ]
-          }],
-          ['OS=="win"', {
-            'dependencies': [
-              % for dep in getattr(module, 'deps', []):
-              % if dep == 'z':
-              "${dep}",
-              % endif
-              % endfor
-            ]
-          }],
-          ['OS=="linux"', {
-            'ldflags': [
-              '-Wl,-wrap,memcpy'
-            ]
-          }],
-          ['OS == "mac"', {
-            'xcode_settings': {
-              'MACOSX_DEPLOYMENT_TARGET': '10.9'
-            }
-          }]
-        ],
-        "target_name": "${module.name}",
-        "sources": [
-          % for source in module.src:
-          "${source}",
-          % endfor
-        ],
-        "dependencies": [
-          % for dep in getattr(module, 'deps', []):
-          % if dep not in ('boringssl', 'z'):
-          "${dep}",
-          % endif
-          % endfor
-        ]
-      },
-      % endfor
-      {
-        "target_name": "action_after_build",
-        "type": "none",
-        "dependencies": [ "<(module_name)" ],
-        "copies": [
-          {
-            "files": [ "<(PRODUCT_DIR)/<(module_name).node"],
-            "destination": "<(module_path)"
-          }
-        ]
-      }
-    ]
-  }
diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template
index 5657df8..3b935e9 100644
--- a/templates/gRPC-Core.podspec.template
+++ b/templates/gRPC-Core.podspec.template
@@ -116,6 +116,7 @@
 
     s.default_subspecs = 'Interface', 'Implementation'
     s.compiler_flags = '-DGRPC_ARES=0'
+    s.libraries = 'c++'
 
     # Like many other C libraries, gRPC-Core has its public headers under `include/<libname>/` and its
     # sources and private headers in other directories outside `include/`. Cocoapods' linter doesn't
@@ -168,17 +169,17 @@
       ss.dependency "#{s.name}/Interface", version
       ss.dependency "#{s.name}/Implementation", version
 
-      ss.source_files = 'test/core/end2end/cq_verifier.{c,h}',
-                        'test/core/end2end/end2end_tests.{c,h}',
-                        'test/core/end2end/end2end_test_utils.c',
-                        'test/core/end2end/tests/*.{c,h}',
+      ss.source_files = 'test/core/end2end/cq_verifier.{cc,h}',
+                        'test/core/end2end/end2end_tests.{cc,h}',
+                        'test/core/end2end/end2end_test_utils.cc',
+                        'test/core/end2end/tests/*.{cc,h}',
                         'test/core/end2end/fixtures/*.h',
-                        'test/core/end2end/data/*.{c,h}',
-                        'test/core/util/debugger_macros.{c,h}',
-                        'test/core/util/test_config.{c,h}',
+                        'test/core/end2end/data/*.{cc,h}',
+                        'test/core/util/debugger_macros.{cc,h}',
+                        'test/core/util/test_config.{cc,h}',
                         'test/core/util/port.h',
-                        'test/core/util/port.c',
-                        'test/core/util/port_server_client.{c,h}'
+                        'test/core/util/port.cc',
+                        'test/core/util/port_server_client.{cc,h}'
     end
 
     # TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
diff --git a/templates/grpc.gemspec.template b/templates/grpc.gemspec.template
index 215d5f9..fb54de1 100644
--- a/templates/grpc.gemspec.template
+++ b/templates/grpc.gemspec.template
@@ -30,7 +30,7 @@
     s.platform      = Gem::Platform::RUBY
 
     s.add_dependency 'google-protobuf', '~> 3.1'
-    s.add_dependency 'googleauth',      '~> 0.5.1'
+    s.add_dependency 'googleauth',      '>= 0.5.1', '< 0.7'
     s.add_dependency 'googleapis-common-protos-types', '~> 1.0.0'
 
     s.add_development_dependency 'bundler',            '~> 1.9'
diff --git a/templates/package.json.template b/templates/package.json.template
deleted file mode 100644
index 50893d3..0000000
--- a/templates/package.json.template
+++ /dev/null
@@ -1,105 +0,0 @@
-%YAML 1.2
---- |
-  {
-    "name": "grpc",
-    "version": "${settings.node_version}",
-    "author": "Google Inc.",
-    "description": "gRPC Library for Node",
-    "homepage": "https://grpc.io/",
-    "repository": {
-      "type": "git",
-      "url": "https://github.com/grpc/grpc.git"
-    },
-    "bugs": "https://github.com/grpc/grpc/issues",
-    "contributors": [
-      {
-        "name": "Michael Lumish",
-        "email": "mlumish@google.com"
-      }
-    ],
-    "directories": {
-      "lib": "src/node/src"
-    },
-    "scripts": {
-      "lint": "node ./node_modules/jshint/bin/jshint src/node/src src/node/test src/node/interop src/node/index.js --exclude-path=src/node/.jshintignore",
-      "test": "./node_modules/.bin/mocha src/node/test && npm run-script lint",
-      "electron-build": "./node_modules/.bin/node-pre-gyp configure build --runtime=electron --disturl=https://atom.io/download/atom-shell",
-      "gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json",
-      "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test",
-      "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library"
-    },
-    "bundledDependencies": [
-      "node-pre-gyp"
-    ],
-    "dependencies": {
-      "arguejs": "^0.2.3",
-      "lodash": "^4.15.0",
-      "nan": "^2.0.0",
-      "node-pre-gyp": "^0.6.35",
-      "protobufjs": "^5.0.0"
-    },
-    "devDependencies": {
-      "async": "^2.0.1",
-      "body-parser": "^1.15.2",
-      "electron-mocha": "^3.1.1",
-      "express": "^4.14.0",
-      "google-auth-library": "^0.9.2",
-      "google-protobuf": "^3.0.0",
-      "istanbul": "^0.4.4",
-      "jsdoc": "^3.3.2",
-      "jshint": "^2.5.0",
-      "minimist": "^1.1.0",
-      "mocha": "^3.0.2",
-      "mocha-jenkins-reporter": "^0.2.3",
-      "poisson-process": "^0.2.1"
-    },
-    "engines": {
-      "node": ">=4"
-    },
-    "binary": {
-      "module_name": "grpc_node",
-      "module_path": "src/node/extension_binary/{node_abi}-{platform}-{arch}",
-      "host": "https://storage.googleapis.com/",
-      "remote_path": "grpc-precompiled-binaries/node/{name}/v{version}",
-      "package_name": "{node_abi}-{platform}-{arch}.tar.gz"
-    },
-    "files": [
-      "LICENSE",
-      "src/node/README.md",
-      "src/proto",
-      "etc",
-      "src/node/index.js",
-      "src/node/src",
-      "src/node/ext",
-      "include/grpc",
-      "src/core",
-      "src/boringssl",
-      "src/zlib",
-      "third_party/nanopb",
-      "third_party/zlib",
-      "third_party/boringssl",
-      "binding.gyp"
-    ],
-    "main": "src/node/index.js",
-    "license": "Apache-2.0",
-    "jshintConfig": {
-      "bitwise": true,
-      "curly": true,
-      "eqeqeq": true,
-      "esnext": true,
-      "freeze": true,
-      "immed": true,
-      "indent": 2,
-      "latedef": "nofunc",
-      "maxlen": 80,
-      "mocha": true,
-      "newcap": true,
-      "node": true,
-      "noarg": true,
-      "quotmark": "single",
-      "strict": true,
-      "trailing": true,
-      "undef": true,
-      "unused": "vars"
-    }
-  }
diff --git a/templates/src/core/lib/surface/version.cc.template b/templates/src/core/lib/surface/version.cc.template
index d2efa56..d9fa447 100644
--- a/templates/src/core/lib/surface/version.cc.template
+++ b/templates/src/core/lib/surface/version.cc.template
@@ -23,6 +23,6 @@
 
   #include <grpc/grpc.h>
 
-  const char *grpc_version_string(void) { return "${settings.core_version}"; }
+  const char* grpc_version_string(void) { return "${settings.core_version}"; }
 
-  const char *grpc_g_stands_for(void) { return "${settings.g_stands_for}"; }
+  const char* grpc_g_stands_for(void) { return "${settings.g_stands_for}"; }
diff --git a/templates/src/cpp/common/version_cc.cc.template b/templates/src/cpp/common/version_cc.cc.template
index d2e19fe..9882878 100644
--- a/templates/src/cpp/common/version_cc.cc.template
+++ b/templates/src/cpp/common/version_cc.cc.template
@@ -25,4 +25,4 @@
 
   namespace grpc {
   grpc::string Version() { return "${settings.cpp_version}"; }
-  }
+  }  // namespace grpc
diff --git a/templates/src/node/health_check/package.json.template b/templates/src/node/health_check/package.json.template
deleted file mode 100644
index 2bc6b13..0000000
--- a/templates/src/node/health_check/package.json.template
+++ /dev/null
@@ -1,31 +0,0 @@
-%YAML 1.2
---- |
-  {
-    "name": "grpc-health-check",
-    "version": "${settings.node_version}",
-    "author": "Google Inc.",
-    "description": "Health check service for use with gRPC",
-    "repository": {
-      "type": "git",
-      "url": "https://github.com/grpc/grpc.git"
-    },
-    "bugs": "https://github.com/grpc/grpc/issues",
-    "contributors": [
-      {
-        "name": "Michael Lumish",
-        "email": "mlumish@google.com"
-      }
-    ],
-    "dependencies": {
-      "grpc": "^${settings.node_version}",
-      "lodash": "^3.9.3",
-      "google-protobuf": "^3.0.0"
-    },
-    "files": [
-      "LICENSE",
-      "health.js",
-      "v1"
-    ],
-    "main": "src/node/index.js",
-    "license": "Apache-2.0"
-  }
diff --git a/templates/src/node/tools/package.json.template b/templates/src/node/tools/package.json.template
deleted file mode 100644
index 74f68e4..0000000
--- a/templates/src/node/tools/package.json.template
+++ /dev/null
@@ -1,43 +0,0 @@
-%YAML 1.2
---- |
-  {
-    "name": "grpc-tools",
-    "version": "${settings.node_version}",
-    "author": "Google Inc.",
-    "description": "Tools for developing with gRPC on Node.js",
-    "homepage": "https://grpc.io/",
-    "repository": {
-      "type": "git",
-      "url": "https://github.com/grpc/grpc.git"
-    },
-    "bugs": "https://github.com/grpc/grpc/issues",
-    "contributors": [
-      {
-        "name": "Michael Lumish",
-        "email": "mlumish@google.com"
-      }
-    ],
-    "bin": {
-      "grpc_tools_node_protoc": "./bin/protoc.js",
-      "grpc_tools_node_protoc_plugin": "./bin/protoc_plugin.js"
-    },
-    "scripts": {
-      "install": "./node_modules/.bin/node-pre-gyp install"
-    },
-    "bundledDependencies": ["node-pre-gyp"],
-    "binary": {
-      "module_name": "grpc_tools",
-      "host": "https://storage.googleapis.com/",
-      "remote_path": "grpc-precompiled-binaries/node/{name}/v{version}",
-      "package_name": "{platform}-{arch}.tar.gz",
-      "module_path": "bin"
-    },
-    "files": [
-      "index.js",
-      "bin/protoc.js",
-      "bin/protoc_plugin.js",
-      "bin/google/protobuf",
-      "LICENSE"
-    ],
-    "main": "index.js"
-  }
diff --git a/templates/test/core/end2end/end2end_nosec_tests.c.template b/templates/test/core/end2end/end2end_nosec_tests.cc.template
similarity index 100%
rename from templates/test/core/end2end/end2end_nosec_tests.c.template
rename to templates/test/core/end2end/end2end_nosec_tests.cc.template
diff --git a/templates/test/core/end2end/end2end_tests.c.template b/templates/test/core/end2end/end2end_tests.cc.template
similarity index 100%
rename from templates/test/core/end2end/end2end_tests.c.template
rename to templates/test/core/end2end/end2end_tests.cc.template
diff --git a/templates/test/core/surface/public_headers_must_be_c89.c.template b/templates/test/core/surface/public_headers_must_be_c89.c.template
index dcaa59b..e2d3b18 100644
--- a/templates/test/core/surface/public_headers_must_be_c89.c.template
+++ b/templates/test/core/surface/public_headers_must_be_c89.c.template
@@ -35,9 +35,23 @@
       assert(hdr[0:len(pfx)] == pfx)
       hdrs.add(hdr[len(pfx):])
   hdrs = sorted(list(hdrs))
+  fns = list()
+  for api in c_apis:
+    if is_platform_header(api.header):
+      continue
+    fns.append(api.name)
   %>\
   % for hdr in hdrs:
   #include <${hdr}>
   % endfor
 
-  int main(int argc, char **argv) { return 0; }
+  #include <stdio.h>
+
+  int main(int argc, char **argv) {
+    if(argc == 12345678) {
+      % for fn in fns:
+      printf("%lx", (unsigned long) ${fn});
+      % endfor
+    }
+    return 0;
+  }
diff --git a/templates/tools/dockerfile/clang_format.include b/templates/tools/dockerfile/clang_format.include
index 81bd2be..79d0ff2 100644
--- a/templates/tools/dockerfile/clang_format.include
+++ b/templates/tools/dockerfile/clang_format.include
@@ -1,5 +1,5 @@
-RUN apt-get update && apt-get -y install wget
-RUN echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN echo "deb-src http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
-RUN apt-get update && apt-get -y install clang-format-3.8
+RUN apt-get update && apt-get -y install wget xz-utils
+RUN wget http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN tar xf clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-format /usr/local/bin/clang-format
+ENV CLANG_FORMAT=clang-format
diff --git a/templates/tools/dockerfile/csharp_build_interop.sh.include b/templates/tools/dockerfile/csharp_build_interop.sh.include
new file mode 100755
index 0000000..d36e81c
--- /dev/null
+++ b/templates/tools/dockerfile/csharp_build_interop.sh.include
@@ -0,0 +1,32 @@
+#!/bin/bash
+# Copyright 2015 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Builds C# interop server and client in a base image.
+set -e
+
+mkdir -p /var/local/git
+git clone /var/local/jenkins/grpc /var/local/git/grpc
+# clone gRPC submodules, use data from locally cloned submodules where possible
+(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc ${'\\'}
+&& git submodule update --init --reference /var/local/jenkins/grpc/<%text>${name}</%text> ${'\\'}
+<%text>${name}</%text>')
+
+# copy service account keys if available
+cp -r /var/local/jenkins/service_account $HOME || true
+
+cd /var/local/git/grpc
+
+# build C# interop client & server
+tools/run_tests/run_tests.py -l csharp -c dbg --build_only
diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh.template b/templates/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh.template
new file mode 100644
index 0000000..71aae5b
--- /dev/null
+++ b/templates/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh.template
@@ -0,0 +1,3 @@
+%YAML 1.2
+--- |
+  <%include file="../../csharp_build_interop.sh.include"/>
\ No newline at end of file
diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile.template
new file mode 100644
index 0000000..a1f1283
--- /dev/null
+++ b/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile.template
@@ -0,0 +1,26 @@
+%YAML 1.2
+--- |
+  # Copyright 2015 gRPC authors.
+  #
+  # Licensed under the Apache License, Version 2.0 (the "License");
+  # you may not use this file except in compliance with the License.
+  # You may obtain a copy of the License at
+  #
+  #     http://www.apache.org/licenses/LICENSE-2.0
+  #
+  # Unless required by applicable law or agreed to in writing, software
+  # distributed under the License is distributed on an "AS IS" BASIS,
+  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  # See the License for the specific language governing permissions and
+  # limitations under the License.
+  
+  FROM debian:jessie
+  
+  <%include file="../../apt_get_basic.include"/>
+  <%include file="../../python_deps.include"/>
+  <%include file="../../csharp_deps.include"/>
+  <%include file="../../csharp_dotnetcli_deps.include"/>
+  <%include file="../../run_tests_addons.include"/>
+  # Define the default command.
+  CMD ["bash"]
+  
diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh.template b/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh.template
new file mode 100644
index 0000000..71aae5b
--- /dev/null
+++ b/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh.template
@@ -0,0 +1,3 @@
+%YAML 1.2
+--- |
+  <%include file="../../csharp_build_interop.sh.include"/>
\ No newline at end of file
diff --git a/test/core/backoff/BUILD b/test/core/backoff/BUILD
index 4ae7620..4cd7acf 100644
--- a/test/core/backoff/BUILD
+++ b/test/core/backoff/BUILD
@@ -25,8 +25,8 @@
 
 grpc_cc_test(
     name = "backoff_test",
-    srcs = ["backoff_test.c"],
-    language = "C",
+    srcs = ["backoff_test.cc"],
+    language = "C++",
     deps = [
         "//:grpc",
         "//test/core/util:grpc_test_util",
diff --git a/test/core/backoff/backoff_test.c b/test/core/backoff/backoff_test.c
deleted file mode 100644
index a29cce6..0000000
--- a/test/core/backoff/backoff_test.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/backoff/backoff.h"
-
-#include <grpc/support/log.h>
-
-#include "test/core/util/test_config.h"
-
-static void test_constant_backoff(void) {
-  grpc_backoff backoff;
-  grpc_backoff_init(&backoff, 200 /* initial timeout */, 1.0 /* multiplier */,
-                    0.0 /* jitter */, 100 /* min timeout */,
-                    1000 /* max timeout */);
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_millis next = grpc_backoff_begin(&exec_ctx, &backoff);
-  GPR_ASSERT(next - grpc_exec_ctx_now(&exec_ctx) == 200);
-  for (int i = 0; i < 10000; i++) {
-    next = grpc_backoff_step(&exec_ctx, &backoff);
-    GPR_ASSERT(next - grpc_exec_ctx_now(&exec_ctx) == 200);
-    exec_ctx.now = next;
-  }
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_min_connect(void) {
-  grpc_backoff backoff;
-  grpc_backoff_init(&backoff, 100 /* initial timeout */, 1.0 /* multiplier */,
-                    0.0 /* jitter */, 200 /* min timeout */,
-                    1000 /* max timeout */);
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_millis next = grpc_backoff_begin(&exec_ctx, &backoff);
-  GPR_ASSERT(next - grpc_exec_ctx_now(&exec_ctx) == 200);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_jitter_backoff(void) {
-  grpc_backoff backoff;
-  grpc_backoff_init(&backoff, 2 /* initial timeout */, 2.0 /* multiplier */,
-                    0.0 /* jitter */, 1 /* min timeout */,
-                    513 /* max timeout */);
-  // x_1 = 2
-  // x_n = 2**i + x_{i-1} ( = 2**(n+1) - 2 )
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  exec_ctx.now = 0;
-  exec_ctx.now_is_valid = true;
-  grpc_millis next = grpc_backoff_begin(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 2);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 6);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 14);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 30);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 62);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 126);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 254);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 510);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 1022);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  // Hit the maximum timeout. From this point onwards, retries will increase
-  // only by max timeout.
-  GPR_ASSERT(next == 1535);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 2048);
-  exec_ctx.now = next;
-  next = grpc_backoff_step(&exec_ctx, &backoff);
-  GPR_ASSERT(next == 2561);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_jitter_backoff(void) {
-  const int64_t initial_timeout = 500;
-  const double jitter = 0.1;
-  grpc_backoff backoff;
-  grpc_backoff_init(&backoff, (grpc_millis)initial_timeout,
-                    1.0 /* multiplier */, jitter, 100 /* min timeout */,
-                    1000 /* max timeout */);
-
-  backoff.rng_state = 0;  // force consistent PRNG
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_millis next = grpc_backoff_begin(&exec_ctx, &backoff);
-  GPR_ASSERT(next - grpc_exec_ctx_now(&exec_ctx) == 500);
-
-  int64_t expected_next_lower_bound =
-      (int64_t)((double)initial_timeout * (1 - jitter));
-  int64_t expected_next_upper_bound =
-      (int64_t)((double)initial_timeout * (1 + jitter));
-
-  for (int i = 0; i < 10000; i++) {
-    next = grpc_backoff_step(&exec_ctx, &backoff);
-
-    // next-now must be within (jitter*100)% of the previous timeout.
-    const int64_t timeout_millis = next - grpc_exec_ctx_now(&exec_ctx);
-    GPR_ASSERT(timeout_millis >= expected_next_lower_bound);
-    GPR_ASSERT(timeout_millis <= expected_next_upper_bound);
-
-    expected_next_lower_bound =
-        (int64_t)((double)timeout_millis * (1 - jitter));
-    expected_next_upper_bound =
-        (int64_t)((double)timeout_millis * (1 + jitter));
-    exec_ctx.now = next;
-  }
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  gpr_time_init();
-
-  test_constant_backoff();
-  test_min_connect();
-  test_no_jitter_backoff();
-  test_jitter_backoff();
-
-  return 0;
-}
diff --git a/test/core/backoff/backoff_test.cc b/test/core/backoff/backoff_test.cc
new file mode 100644
index 0000000..ef2de8d
--- /dev/null
+++ b/test/core/backoff/backoff_test.cc
@@ -0,0 +1,187 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/backoff/backoff.h"
+
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/util/test_config.h"
+
+static void test_constant_backoff(void) {
+  grpc_backoff backoff;
+  const grpc_millis initial_backoff = 200;
+  const double multiplier = 1.0;
+  const double jitter = 0.0;
+  const grpc_millis min_connect_timeout = 100;
+  const grpc_millis max_backoff = 1000;
+  grpc_backoff_init(&backoff, initial_backoff, multiplier, jitter,
+                    min_connect_timeout, max_backoff);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_backoff_result next_deadlines = grpc_backoff_begin(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline - grpc_exec_ctx_now(&exec_ctx) ==
+             initial_backoff);
+  GPR_ASSERT(next_deadlines.next_attempt_start_time -
+                 grpc_exec_ctx_now(&exec_ctx) ==
+             initial_backoff);
+  for (int i = 0; i < 10000; i++) {
+    next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+    GPR_ASSERT(next_deadlines.current_deadline - grpc_exec_ctx_now(&exec_ctx) ==
+               initial_backoff);
+    GPR_ASSERT(next_deadlines.next_attempt_start_time -
+                   grpc_exec_ctx_now(&exec_ctx) ==
+               initial_backoff);
+    exec_ctx.now = next_deadlines.current_deadline;
+  }
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_min_connect(void) {
+  grpc_backoff backoff;
+  const grpc_millis initial_backoff = 100;
+  const double multiplier = 1.0;
+  const double jitter = 0.0;
+  const grpc_millis min_connect_timeout = 200;
+  const grpc_millis max_backoff = 1000;
+  grpc_backoff_init(&backoff, initial_backoff, multiplier, jitter,
+                    min_connect_timeout, max_backoff);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_backoff_result next = grpc_backoff_begin(&exec_ctx, &backoff);
+  // Because the min_connect_timeout > initial_backoff, current_deadline is used
+  // as the deadline for the current attempt.
+  GPR_ASSERT(next.current_deadline - grpc_exec_ctx_now(&exec_ctx) ==
+             min_connect_timeout);
+  // ... while, if the current attempt fails, the next one will happen after
+  // initial_backoff.
+  GPR_ASSERT(next.next_attempt_start_time - grpc_exec_ctx_now(&exec_ctx) ==
+             initial_backoff);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_jitter_backoff(void) {
+  grpc_backoff backoff;
+  const grpc_millis initial_backoff = 2;
+  const double multiplier = 2.0;
+  const double jitter = 0.0;
+  const grpc_millis min_connect_timeout = 1;
+  const grpc_millis max_backoff = 513;
+  grpc_backoff_init(&backoff, initial_backoff, multiplier, jitter,
+                    min_connect_timeout, max_backoff);
+  // x_1 = 2
+  // x_n = 2**i + x_{i-1} ( = 2**(n+1) - 2 )
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  exec_ctx.now = 0;
+  exec_ctx.now_is_valid = true;
+  grpc_backoff_result next_deadlines = grpc_backoff_begin(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline ==
+             next_deadlines.next_attempt_start_time);
+  GPR_ASSERT(next_deadlines.current_deadline == 2);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 6);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 14);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 30);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 62);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 126);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 254);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 510);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 1022);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  // Hit the maximum timeout. From this point onwards, retries will increase
+  // only by max timeout.
+  GPR_ASSERT(next_deadlines.current_deadline == 1535);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 2048);
+  exec_ctx.now = next_deadlines.current_deadline;
+  next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline == 2561);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_jitter_backoff(void) {
+  const grpc_millis initial_backoff = 500;
+  grpc_millis current_backoff = initial_backoff;
+  const grpc_millis max_backoff = 1000;
+  const grpc_millis min_connect_timeout = 100;
+  const double multiplier = 1.0;
+  const double jitter = 0.1;
+  grpc_backoff backoff;
+  grpc_backoff_init(&backoff, initial_backoff, multiplier, jitter,
+                    min_connect_timeout, max_backoff);
+
+  backoff.rng_state = 0;  // force consistent PRNG
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_backoff_result next_deadlines = grpc_backoff_begin(&exec_ctx, &backoff);
+  GPR_ASSERT(next_deadlines.current_deadline - grpc_exec_ctx_now(&exec_ctx) ==
+             initial_backoff);
+  GPR_ASSERT(next_deadlines.next_attempt_start_time -
+                 grpc_exec_ctx_now(&exec_ctx) ==
+             initial_backoff);
+
+  grpc_millis expected_next_lower_bound =
+      (grpc_millis)((double)current_backoff * (1 - jitter));
+  grpc_millis expected_next_upper_bound =
+      (grpc_millis)((double)current_backoff * (1 + jitter));
+
+  for (int i = 0; i < 10000; i++) {
+    next_deadlines = grpc_backoff_step(&exec_ctx, &backoff);
+    // next-now must be within (jitter*100)% of the current backoff (which
+    // increases by * multiplier up to max_backoff).
+    const grpc_millis timeout_millis =
+        next_deadlines.current_deadline - grpc_exec_ctx_now(&exec_ctx);
+    GPR_ASSERT(timeout_millis >= expected_next_lower_bound);
+    GPR_ASSERT(timeout_millis <= expected_next_upper_bound);
+    current_backoff = GPR_MIN(
+        (grpc_millis)((double)current_backoff * multiplier), max_backoff);
+    expected_next_lower_bound =
+        (grpc_millis)((double)current_backoff * (1 - jitter));
+    expected_next_upper_bound =
+        (grpc_millis)((double)current_backoff * (1 + jitter));
+    exec_ctx.now = next_deadlines.current_deadline;
+  }
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  gpr_time_init();
+
+  test_constant_backoff();
+  test_min_connect();
+  test_no_jitter_backoff();
+  test_jitter_backoff();
+
+  return 0;
+}
diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c
deleted file mode 100644
index b7b28a9..0000000
--- a/test/core/bad_client/bad_client.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/bad_client/bad_client.h"
-
-#include <stdio.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/support/murmur_hash.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/surface/completion_queue.h"
-#include "src/core/lib/surface/server.h"
-
-typedef struct {
-  grpc_server *server;
-  grpc_completion_queue *cq;
-  grpc_bad_client_server_side_validator validator;
-  void *registered_method;
-  gpr_event done_thd;
-  gpr_event done_write;
-} thd_args;
-
-static void thd_func(void *arg) {
-  thd_args *a = (thd_args *)arg;
-  a->validator(a->server, a->cq, a->registered_method);
-  gpr_event_set(&a->done_thd, (void *)1);
-}
-
-static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  thd_args *a = (thd_args *)arg;
-  gpr_event_set(&a->done_write, (void *)1);
-}
-
-static void server_setup_transport(void *ts, grpc_transport *transport) {
-  thd_args *a = (thd_args *)ts;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_server_setup_transport(&exec_ctx, a->server, transport, NULL,
-                              grpc_server_get_channel_args(a->server));
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void read_done(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  gpr_event *read_done = (gpr_event *)arg;
-  gpr_event_set(read_done, (void *)1);
-}
-
-void grpc_run_bad_client_test(
-    grpc_bad_client_server_side_validator server_validator,
-    grpc_bad_client_client_stream_validator client_validator,
-    const char *client_payload, size_t client_payload_length, uint32_t flags) {
-  grpc_endpoint_pair sfd;
-  thd_args a;
-  gpr_thd_id id;
-  char *hex;
-  grpc_transport *transport;
-  grpc_slice slice =
-      grpc_slice_from_copied_buffer(client_payload, client_payload_length);
-  grpc_slice_buffer outgoing;
-  grpc_closure done_write_closure;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_completion_queue *shutdown_cq;
-
-  if (client_payload_length < 4 * 1024) {
-    hex = gpr_dump(client_payload, client_payload_length,
-                   GPR_DUMP_HEX | GPR_DUMP_ASCII);
-
-    /* Add a debug log */
-    gpr_log(GPR_INFO, "TEST: %s", hex);
-
-    gpr_free(hex);
-  } else {
-    gpr_log(GPR_INFO, "TEST: (%" PRIdPTR " byte long string)",
-            client_payload_length);
-  }
-
-  /* Init grpc */
-  grpc_init();
-
-  /* Create endpoints */
-  sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);
-
-  /* Create server, completion events */
-  a.server = grpc_server_create(NULL, NULL);
-  a.cq = grpc_completion_queue_create_for_next(NULL);
-  gpr_event_init(&a.done_thd);
-  gpr_event_init(&a.done_write);
-  a.validator = server_validator;
-  grpc_server_register_completion_queue(a.server, a.cq, NULL);
-  a.registered_method =
-      grpc_server_register_method(a.server, GRPC_BAD_CLIENT_REGISTERED_METHOD,
-                                  GRPC_BAD_CLIENT_REGISTERED_HOST,
-                                  GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER, 0);
-  grpc_server_start(a.server);
-  transport = grpc_create_chttp2_transport(&exec_ctx, NULL, sfd.server, 0);
-  server_setup_transport(&a, transport);
-  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  /* Bind everything into the same pollset */
-  grpc_endpoint_add_to_pollset(&exec_ctx, sfd.client, grpc_cq_pollset(a.cq));
-  grpc_endpoint_add_to_pollset(&exec_ctx, sfd.server, grpc_cq_pollset(a.cq));
-
-  /* Check a ground truth */
-  GPR_ASSERT(grpc_server_has_open_connections(a.server));
-
-  /* Start validator */
-  gpr_thd_new(&id, thd_func, &a, NULL);
-
-  grpc_slice_buffer_init(&outgoing);
-  grpc_slice_buffer_add(&outgoing, slice);
-  GRPC_CLOSURE_INIT(&done_write_closure, done_write, &a,
-                    grpc_schedule_on_exec_ctx);
-
-  /* Write data */
-  grpc_endpoint_write(&exec_ctx, sfd.client, &outgoing, &done_write_closure);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  /* Await completion, unless the request is large and write may not finish
-   * before the peer shuts down. */
-  if (!(flags & GRPC_BAD_CLIENT_LARGE_REQUEST)) {
-    GPR_ASSERT(
-        gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(5)));
-  }
-
-  if (flags & GRPC_BAD_CLIENT_DISCONNECT) {
-    grpc_endpoint_shutdown(
-        &exec_ctx, sfd.client,
-        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Disconnect"));
-    grpc_endpoint_destroy(&exec_ctx, sfd.client);
-    grpc_exec_ctx_finish(&exec_ctx);
-    sfd.client = NULL;
-  }
-
-  GPR_ASSERT(gpr_event_wait(&a.done_thd, grpc_timeout_seconds_to_deadline(5)));
-
-  if (sfd.client != NULL) {
-    // Validate client stream, if requested.
-    if (client_validator != NULL) {
-      gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
-      grpc_slice_buffer incoming;
-      grpc_slice_buffer_init(&incoming);
-      // We may need to do multiple reads to read the complete server response.
-      while (true) {
-        gpr_event read_done_event;
-        gpr_event_init(&read_done_event);
-        grpc_closure read_done_closure;
-        GRPC_CLOSURE_INIT(&read_done_closure, read_done, &read_done_event,
-                          grpc_schedule_on_exec_ctx);
-        grpc_endpoint_read(&exec_ctx, sfd.client, &incoming,
-                           &read_done_closure);
-        grpc_exec_ctx_finish(&exec_ctx);
-        do {
-          GPR_ASSERT(gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) > 0);
-          GPR_ASSERT(grpc_completion_queue_next(
-                         a.cq, grpc_timeout_milliseconds_to_deadline(100), NULL)
-                         .type == GRPC_QUEUE_TIMEOUT);
-        } while (!gpr_event_get(&read_done_event));
-        if (client_validator(&incoming)) break;
-        gpr_log(GPR_INFO,
-                "client validator failed; trying additional read "
-                "in case we didn't get all the data");
-      }
-      grpc_slice_buffer_destroy_internal(&exec_ctx, &incoming);
-    }
-    // Shutdown.
-    grpc_endpoint_shutdown(
-        &exec_ctx, sfd.client,
-        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
-    grpc_endpoint_destroy(&exec_ctx, sfd.client);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  GPR_ASSERT(
-      gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(1)));
-  shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-  grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL);
-  GPR_ASSERT(grpc_completion_queue_pluck(
-                 shutdown_cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_completion_queue_destroy(shutdown_cq);
-  grpc_server_destroy(a.server);
-  grpc_completion_queue_destroy(a.cq);
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &outgoing);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-}
diff --git a/test/core/bad_client/bad_client.cc b/test/core/bad_client/bad_client.cc
new file mode 100644
index 0000000..b194442
--- /dev/null
+++ b/test/core/bad_client/bad_client.cc
@@ -0,0 +1,211 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/bad_client/bad_client.h"
+
+#include <stdio.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/support/murmur_hash.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/surface/completion_queue.h"
+#include "src/core/lib/surface/server.h"
+
+typedef struct {
+  grpc_server* server;
+  grpc_completion_queue* cq;
+  grpc_bad_client_server_side_validator validator;
+  void* registered_method;
+  gpr_event done_thd;
+  gpr_event done_write;
+} thd_args;
+
+static void thd_func(void* arg) {
+  thd_args* a = (thd_args*)arg;
+  a->validator(a->server, a->cq, a->registered_method);
+  gpr_event_set(&a->done_thd, (void*)1);
+}
+
+static void done_write(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  thd_args* a = (thd_args*)arg;
+  gpr_event_set(&a->done_write, (void*)1);
+}
+
+static void server_setup_transport(void* ts, grpc_transport* transport) {
+  thd_args* a = (thd_args*)ts;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_server_setup_transport(&exec_ctx, a->server, transport, NULL,
+                              grpc_server_get_channel_args(a->server));
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void read_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  gpr_event* read_done = (gpr_event*)arg;
+  gpr_event_set(read_done, (void*)1);
+}
+
+void grpc_run_bad_client_test(
+    grpc_bad_client_server_side_validator server_validator,
+    grpc_bad_client_client_stream_validator client_validator,
+    const char* client_payload, size_t client_payload_length, uint32_t flags) {
+  grpc_endpoint_pair sfd;
+  thd_args a;
+  gpr_thd_id id;
+  char* hex;
+  grpc_transport* transport;
+  grpc_slice slice =
+      grpc_slice_from_copied_buffer(client_payload, client_payload_length);
+  grpc_slice_buffer outgoing;
+  grpc_closure done_write_closure;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_completion_queue* shutdown_cq;
+
+  if (client_payload_length < 4 * 1024) {
+    hex = gpr_dump(client_payload, client_payload_length,
+                   GPR_DUMP_HEX | GPR_DUMP_ASCII);
+
+    /* Add a debug log */
+    gpr_log(GPR_INFO, "TEST: %s", hex);
+
+    gpr_free(hex);
+  } else {
+    gpr_log(GPR_INFO, "TEST: (%" PRIdPTR " byte long string)",
+            client_payload_length);
+  }
+
+  /* Init grpc */
+  grpc_init();
+
+  /* Create endpoints */
+  sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);
+
+  /* Create server, completion events */
+  a.server = grpc_server_create(NULL, NULL);
+  a.cq = grpc_completion_queue_create_for_next(NULL);
+  gpr_event_init(&a.done_thd);
+  gpr_event_init(&a.done_write);
+  a.validator = server_validator;
+  grpc_server_register_completion_queue(a.server, a.cq, NULL);
+  a.registered_method =
+      grpc_server_register_method(a.server, GRPC_BAD_CLIENT_REGISTERED_METHOD,
+                                  GRPC_BAD_CLIENT_REGISTERED_HOST,
+                                  GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER, 0);
+  grpc_server_start(a.server);
+  transport = grpc_create_chttp2_transport(&exec_ctx, NULL, sfd.server, 0);
+  server_setup_transport(&a, transport);
+  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  /* Bind everything into the same pollset */
+  grpc_endpoint_add_to_pollset(&exec_ctx, sfd.client, grpc_cq_pollset(a.cq));
+  grpc_endpoint_add_to_pollset(&exec_ctx, sfd.server, grpc_cq_pollset(a.cq));
+
+  /* Check a ground truth */
+  GPR_ASSERT(grpc_server_has_open_connections(a.server));
+
+  /* Start validator */
+  gpr_thd_new(&id, thd_func, &a, NULL);
+
+  grpc_slice_buffer_init(&outgoing);
+  grpc_slice_buffer_add(&outgoing, slice);
+  GRPC_CLOSURE_INIT(&done_write_closure, done_write, &a,
+                    grpc_schedule_on_exec_ctx);
+
+  /* Write data */
+  grpc_endpoint_write(&exec_ctx, sfd.client, &outgoing, &done_write_closure);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  /* Await completion, unless the request is large and write may not finish
+   * before the peer shuts down. */
+  if (!(flags & GRPC_BAD_CLIENT_LARGE_REQUEST)) {
+    GPR_ASSERT(
+        gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(5)));
+  }
+
+  if (flags & GRPC_BAD_CLIENT_DISCONNECT) {
+    grpc_endpoint_shutdown(
+        &exec_ctx, sfd.client,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Disconnect"));
+    grpc_endpoint_destroy(&exec_ctx, sfd.client);
+    grpc_exec_ctx_finish(&exec_ctx);
+    sfd.client = NULL;
+  }
+
+  GPR_ASSERT(gpr_event_wait(&a.done_thd, grpc_timeout_seconds_to_deadline(5)));
+
+  if (sfd.client != NULL) {
+    // Validate client stream, if requested.
+    if (client_validator != NULL) {
+      gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
+      grpc_slice_buffer incoming;
+      grpc_slice_buffer_init(&incoming);
+      // We may need to do multiple reads to read the complete server response.
+      while (true) {
+        gpr_event read_done_event;
+        gpr_event_init(&read_done_event);
+        grpc_closure read_done_closure;
+        GRPC_CLOSURE_INIT(&read_done_closure, read_done, &read_done_event,
+                          grpc_schedule_on_exec_ctx);
+        grpc_endpoint_read(&exec_ctx, sfd.client, &incoming,
+                           &read_done_closure);
+        grpc_exec_ctx_finish(&exec_ctx);
+        do {
+          GPR_ASSERT(gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) > 0);
+          GPR_ASSERT(grpc_completion_queue_next(
+                         a.cq, grpc_timeout_milliseconds_to_deadline(100), NULL)
+                         .type == GRPC_QUEUE_TIMEOUT);
+        } while (!gpr_event_get(&read_done_event));
+        if (client_validator(&incoming)) break;
+        gpr_log(GPR_INFO,
+                "client validator failed; trying additional read "
+                "in case we didn't get all the data");
+      }
+      grpc_slice_buffer_destroy_internal(&exec_ctx, &incoming);
+    }
+    // Shutdown.
+    grpc_endpoint_shutdown(
+        &exec_ctx, sfd.client,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
+    grpc_endpoint_destroy(&exec_ctx, sfd.client);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  GPR_ASSERT(
+      gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(1)));
+  shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+  grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL);
+  GPR_ASSERT(grpc_completion_queue_pluck(
+                 shutdown_cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_completion_queue_destroy(shutdown_cq);
+  grpc_server_destroy(a.server);
+  grpc_completion_queue_destroy(a.cq);
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &outgoing);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+}
diff --git a/test/core/bad_client/bad_client.h b/test/core/bad_client/bad_client.h
index a5b01f7..d3abfac 100644
--- a/test/core/bad_client/bad_client.h
+++ b/test/core/bad_client/bad_client.h
@@ -28,13 +28,13 @@
 #define GRPC_BAD_CLIENT_REGISTERED_METHOD "/registered/bar"
 #define GRPC_BAD_CLIENT_REGISTERED_HOST "localhost"
 
-typedef void (*grpc_bad_client_server_side_validator)(grpc_server *server,
-                                                      grpc_completion_queue *cq,
-                                                      void *registered_method);
+typedef void (*grpc_bad_client_server_side_validator)(grpc_server* server,
+                                                      grpc_completion_queue* cq,
+                                                      void* registered_method);
 
 // Returns false if we need to read more data.
 typedef bool (*grpc_bad_client_client_stream_validator)(
-    grpc_slice_buffer *incoming);
+    grpc_slice_buffer* incoming);
 
 #define GRPC_BAD_CLIENT_DISCONNECT 1
 #define GRPC_BAD_CLIENT_LARGE_REQUEST 2
@@ -47,7 +47,7 @@
 void grpc_run_bad_client_test(
     grpc_bad_client_server_side_validator server_validator,
     grpc_bad_client_client_stream_validator client_validator,
-    const char *client_payload, size_t client_payload_length, uint32_t flags);
+    const char* client_payload, size_t client_payload_length, uint32_t flags);
 
 #define GRPC_RUN_BAD_CLIENT_TEST(server_validator, client_validator, payload, \
                                  flags)                                       \
diff --git a/test/core/bad_client/gen_build_yaml.py b/test/core/bad_client/gen_build_yaml.py
index 61cf1f7..14c8a27 100755
--- a/test/core/bad_client/gen_build_yaml.py
+++ b/test/core/bad_client/gen_build_yaml.py
@@ -46,7 +46,7 @@
             'build': 'private',
             'language': 'c',
             'src': [
-              'test/core/bad_client/bad_client.c'
+              'test/core/bad_client/bad_client.cc'
             ],
             'headers': [
               'test/core/bad_client/bad_client.h'
@@ -66,7 +66,7 @@
               'build': 'test',
               'language': 'c',
               'secure': 'no',
-              'src': ['test/core/bad_client/tests/%s.c' % t],
+              'src': ['test/core/bad_client/tests/%s.cc' % t],
               'vs_proj_dir': 'test',
               'exclude_iomgrs': ['uv'],
               'deps': [
diff --git a/test/core/bad_client/generate_tests.bzl b/test/core/bad_client/generate_tests.bzl
index 58b48d6..022edf3 100755
--- a/test/core/bad_client/generate_tests.bzl
+++ b/test/core/bad_client/generate_tests.bzl
@@ -38,16 +38,14 @@
 def grpc_bad_client_tests():
   native.cc_library(
       name = 'bad_client_test',
-      srcs = ['bad_client.c'],
+      srcs = ['bad_client.cc'],
       hdrs = ['bad_client.h'],
-      copts = ['-std=c99'],
       deps = ['//test/core/util:grpc_test_util', '//:grpc', '//:gpr', '//test/core/end2end:cq_verifier']
   )
   for t, topt in BAD_CLIENT_TESTS.items():
     native.cc_test(
         name = '%s_bad_client_test' % t,
-        srcs = ['tests/%s.c' % t],
+        srcs = ['tests/%s.cc' % t],
         deps = [':bad_client_test'],
-        copts = ['-std=c99'],
     )
 
diff --git a/test/core/bad_client/tests/badreq.c b/test/core/bad_client/tests/badreq.c
deleted file mode 100644
index 7d9a103..0000000
--- a/test/core/bad_client/tests/badreq.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/bad_client/bad_client.h"
-
-#include <string.h>
-
-#include "src/core/lib/surface/server.h"
-#include "test/core/end2end/cq_verifier.h"
-
-#define PFX_STR                      \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */
-
-static void verifier(grpc_server *server, grpc_completion_queue *cq,
-                     void *registered_method) {
-  while (grpc_server_has_open_connections(server)) {
-    GPR_ASSERT(grpc_completion_queue_next(
-                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
-                   .type == GRPC_QUEUE_TIMEOUT);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  /* invalid content type */
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier, NULL, PFX_STR
-      "\x00\x00\xc2\x01\x04\x00\x00\x00\x01"
-      "\x10\x05:path\x08/foo/bar"
-      "\x10\x07:scheme\x04http"
-      "\x10\x07:method\x04POST"
-      "\x10\x0a:authority\x09localhost"
-      "\x10\x0c"
-      "content-type\x09text/html"
-      "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
-      "\x10\x02te\x08trailers"
-      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
-      GRPC_BAD_CLIENT_DISCONNECT);
-
-  /* invalid te */
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier, NULL, PFX_STR
-      "\x00\x00\xcb\x01\x04\x00\x00\x00\x01"
-      "\x10\x05:path\x08/foo/bar"
-      "\x10\x07:scheme\x04http"
-      "\x10\x07:method\x04POST"
-      "\x10\x0a:authority\x09localhost"
-      "\x10\x0c"
-      "content-type\x10"
-      "application/grpc"
-      "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
-      "\x10\x02te\x0a"
-      "frobnicate"
-      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
-      GRPC_BAD_CLIENT_DISCONNECT);
-
-  /* two path headers */
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier, NULL, PFX_STR
-      "\x00\x00\xd9\x01\x04\x00\x00\x00\x01"
-      "\x10\x05:path\x08/foo/bar"
-      "\x10\x05:path\x08/foo/bah"
-      "\x10\x07:scheme\x04http"
-      "\x10\x07:method\x04POST"
-      "\x10\x0a:authority\x09localhost"
-      "\x10\x0c"
-      "content-type\x10"
-      "application/grpc"
-      "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
-      "\x10\x02te\x08trailers"
-      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
-      GRPC_BAD_CLIENT_DISCONNECT);
-
-  /* bad accept-encoding algorithm */
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier, NULL, PFX_STR
-      "\x00\x00\xd2\x01\x04\x00\x00\x00\x01"
-      "\x10\x05:path\x08/foo/bar"
-      "\x10\x07:scheme\x04http"
-      "\x10\x07:method\x04POST"
-      "\x10\x0a:authority\x09localhost"
-      "\x10\x0c"
-      "content-type\x10"
-      "application/grpc"
-      "\x10\x14grpc-accept-encoding\x1enobody-knows-the-trouble-i-see"
-      "\x10\x02te\x08trailers"
-      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
-      GRPC_BAD_CLIENT_DISCONNECT);
-
-  /* bad grpc-encoding algorithm */
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier, NULL, PFX_STR
-      "\x00\x00\xf5\x01\x04\x00\x00\x00\x01"
-      "\x10\x05:path\x08/foo/bar"
-      "\x10\x07:scheme\x04http"
-      "\x10\x07:method\x04POST"
-      "\x10\x0a:authority\x09localhost"
-      "\x10\x0c"
-      "content-type\x10"
-      "application/grpc"
-      "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
-      "\x10\x0dgrpc-encoding\x1cyou-dont-know-how-to-do-this"
-      "\x10\x02te\x08trailers"
-      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
-      GRPC_BAD_CLIENT_DISCONNECT);
-
-  return 0;
-}
diff --git a/test/core/bad_client/tests/badreq.cc b/test/core/bad_client/tests/badreq.cc
new file mode 100644
index 0000000..5273c83
--- /dev/null
+++ b/test/core/bad_client/tests/badreq.cc
@@ -0,0 +1,130 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/bad_client/bad_client.h"
+
+#include <string.h>
+
+#include "src/core/lib/surface/server.h"
+#include "test/core/end2end/cq_verifier.h"
+
+#define PFX_STR                      \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */
+
+static void verifier(grpc_server* server, grpc_completion_queue* cq,
+                     void* registered_method) {
+  while (grpc_server_has_open_connections(server)) {
+    GPR_ASSERT(grpc_completion_queue_next(
+                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
+                   .type == GRPC_QUEUE_TIMEOUT);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  /* invalid content type */
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier, NULL,
+      PFX_STR
+      "\x00\x00\xc2\x01\x04\x00\x00\x00\x01"
+      "\x10\x05:path\x08/foo/bar"
+      "\x10\x07:scheme\x04http"
+      "\x10\x07:method\x04POST"
+      "\x10\x0a:authority\x09localhost"
+      "\x10\x0c"
+      "content-type\x09text/html"
+      "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
+      "\x10\x02te\x08trailers"
+      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
+      GRPC_BAD_CLIENT_DISCONNECT);
+
+  /* invalid te */
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier, NULL,
+      PFX_STR
+      "\x00\x00\xcb\x01\x04\x00\x00\x00\x01"
+      "\x10\x05:path\x08/foo/bar"
+      "\x10\x07:scheme\x04http"
+      "\x10\x07:method\x04POST"
+      "\x10\x0a:authority\x09localhost"
+      "\x10\x0c"
+      "content-type\x10"
+      "application/grpc"
+      "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
+      "\x10\x02te\x0a"
+      "frobnicate"
+      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
+      GRPC_BAD_CLIENT_DISCONNECT);
+
+  /* two path headers */
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier, NULL,
+      PFX_STR
+      "\x00\x00\xd9\x01\x04\x00\x00\x00\x01"
+      "\x10\x05:path\x08/foo/bar"
+      "\x10\x05:path\x08/foo/bah"
+      "\x10\x07:scheme\x04http"
+      "\x10\x07:method\x04POST"
+      "\x10\x0a:authority\x09localhost"
+      "\x10\x0c"
+      "content-type\x10"
+      "application/grpc"
+      "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
+      "\x10\x02te\x08trailers"
+      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
+      GRPC_BAD_CLIENT_DISCONNECT);
+
+  /* bad accept-encoding algorithm */
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier, NULL,
+      PFX_STR
+      "\x00\x00\xd2\x01\x04\x00\x00\x00\x01"
+      "\x10\x05:path\x08/foo/bar"
+      "\x10\x07:scheme\x04http"
+      "\x10\x07:method\x04POST"
+      "\x10\x0a:authority\x09localhost"
+      "\x10\x0c"
+      "content-type\x10"
+      "application/grpc"
+      "\x10\x14grpc-accept-encoding\x1enobody-knows-the-trouble-i-see"
+      "\x10\x02te\x08trailers"
+      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
+      GRPC_BAD_CLIENT_DISCONNECT);
+
+  /* bad grpc-encoding algorithm */
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier, NULL,
+      PFX_STR
+      "\x00\x00\xf5\x01\x04\x00\x00\x00\x01"
+      "\x10\x05:path\x08/foo/bar"
+      "\x10\x07:scheme\x04http"
+      "\x10\x07:method\x04POST"
+      "\x10\x0a:authority\x09localhost"
+      "\x10\x0c"
+      "content-type\x10"
+      "application/grpc"
+      "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
+      "\x10\x0dgrpc-encoding\x1cyou-dont-know-how-to-do-this"
+      "\x10\x02te\x08trailers"
+      "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)",
+      GRPC_BAD_CLIENT_DISCONNECT);
+
+  return 0;
+}
diff --git a/test/core/bad_client/tests/connection_prefix.c b/test/core/bad_client/tests/connection_prefix.c
deleted file mode 100644
index 6cc4b72..0000000
--- a/test/core/bad_client/tests/connection_prefix.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/surface/server.h"
-#include "test/core/bad_client/bad_client.h"
-
-static void verifier(grpc_server *server, grpc_completion_queue *cq,
-                     void *registered_method) {
-  while (grpc_server_has_open_connections(server)) {
-    GPR_ASSERT(grpc_completion_queue_next(
-                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
-                   .type == GRPC_QUEUE_TIMEOUT);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "X", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRIX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI X", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI *X", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * X", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTPX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/X", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2X", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.X", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0X", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\rX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\nX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\rX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSMX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSM\rX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSM\r\nX", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSM\r\n\rX",
-                           0);
-  return 0;
-}
diff --git a/test/core/bad_client/tests/connection_prefix.cc b/test/core/bad_client/tests/connection_prefix.cc
new file mode 100644
index 0000000..a4fd734
--- /dev/null
+++ b/test/core/bad_client/tests/connection_prefix.cc
@@ -0,0 +1,60 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/surface/server.h"
+#include "test/core/bad_client/bad_client.h"
+
+static void verifier(grpc_server* server, grpc_completion_queue* cq,
+                     void* registered_method) {
+  while (grpc_server_has_open_connections(server)) {
+    GPR_ASSERT(grpc_completion_queue_next(
+                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
+                   .type == GRPC_QUEUE_TIMEOUT);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "X", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRIX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI X", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI *X", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * X", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTPX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/X", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2X", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.X", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0X", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\rX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\nX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\rX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSMX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSM\rX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSM\r\nX", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, "PRI * HTTP/2.0\r\n\r\nSM\r\n\rX",
+                           0);
+  return 0;
+}
diff --git a/test/core/bad_client/tests/head_of_line_blocking.c b/test/core/bad_client/tests/head_of_line_blocking.c
deleted file mode 100644
index 04485d5..0000000
--- a/test/core/bad_client/tests/head_of_line_blocking.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/bad_client/bad_client.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/lib/surface/server.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static const char prefix[] =
-    "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
-    // settings frame
-    "\x00\x00\x00\x04\x00\x00\x00\x00\x00"
-    // stream 1 headers: generated from server_registered_method.headers in this
-    // directory
-    "\x00\x00\xd0\x01\x04\x00\x00\x00\x01"
-    "\x10\x05:path\x0f/registered/bar"
-    "\x10\x07:scheme\x04http"
-    "\x10\x07:method\x04POST"
-    "\x10\x0a:authority\x09localhost"
-    "\x10\x0c"
-    "content-type\x10"
-    "application/grpc"
-    "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
-    "\x10\x02te\x08trailers"
-    "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
-    // data frame for stream 1: advertise a 10000 byte payload (that we won't
-    // fulfill)
-    "\x00\x00\x05\x00\x00\x00\x00\x00\x01"
-    "\x01\x00\x00\x27\x10"
-    // stream 3 headers: generated from server_registered_method.headers in this
-    // directory
-    "\x00\x00\xd0\x01\x04\x00\x00\x00\x03"
-    "\x10\x05:path\x0f/registered/bar"
-    "\x10\x07:scheme\x04http"
-    "\x10\x07:method\x04POST"
-    "\x10\x0a:authority\x09localhost"
-    "\x10\x0c"
-    "content-type\x10"
-    "application/grpc"
-    "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
-    "\x10\x02te\x08trailers"
-    "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
-    // data frame for stream 3: advertise a 10000 byte payload (that we will
-    // fulfill)
-    "\x00\x00\x05\x00\x00\x00\x00\x00\x03"
-    "\x01\x00\x00\x27\x10"
-    "";
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void verifier(grpc_server *server, grpc_completion_queue *cq,
-                     void *registered_method) {
-  grpc_call_error error;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(cq);
-  grpc_metadata_array request_metadata_recv;
-  gpr_timespec deadline;
-  grpc_byte_buffer *payload = NULL;
-
-  grpc_metadata_array_init(&request_metadata_recv);
-
-  error = grpc_server_request_registered_call(server, registered_method, &s,
-                                              &deadline, &request_metadata_recv,
-                                              &payload, cq, cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(payload != NULL);
-
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_unref(s);
-  grpc_byte_buffer_destroy(payload);
-  cq_verifier_destroy(cqv);
-}
-
-char *g_buffer;
-size_t g_cap = 0;
-size_t g_count = 0;
-
-static void addbuf(const void *data, size_t len) {
-  if (g_count + len > g_cap) {
-    g_cap = GPR_MAX(g_count + len, g_cap * 2);
-    g_buffer = gpr_realloc(g_buffer, g_cap);
-  }
-  memcpy(g_buffer + g_count, data, len);
-  g_count += len;
-}
-
-int main(int argc, char **argv) {
-  int i;
-  grpc_test_init(argc, argv);
-
-#define NUM_FRAMES 10
-#define FRAME_SIZE 1000
-
-  addbuf(prefix, sizeof(prefix) - 1);
-  for (i = 0; i < NUM_FRAMES; i++) {
-    uint8_t hdr[9] = {(uint8_t)(FRAME_SIZE >> 16),
-                      (uint8_t)(FRAME_SIZE >> 8),
-                      (uint8_t)FRAME_SIZE,
-                      0,
-                      0,
-                      0,
-                      0,
-                      0,
-                      3};
-    uint8_t msg[FRAME_SIZE];
-    memset(msg, 'a', sizeof(msg));
-    addbuf(hdr, sizeof(hdr));
-    addbuf(msg, FRAME_SIZE);
-  }
-  grpc_run_bad_client_test(verifier, NULL, g_buffer, g_count, 0);
-  gpr_free(g_buffer);
-
-  return 0;
-}
diff --git a/test/core/bad_client/tests/head_of_line_blocking.cc b/test/core/bad_client/tests/head_of_line_blocking.cc
new file mode 100644
index 0000000..aad335c
--- /dev/null
+++ b/test/core/bad_client/tests/head_of_line_blocking.cc
@@ -0,0 +1,136 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/bad_client/bad_client.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/lib/surface/server.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static const char prefix[] =
+    "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
+    // settings frame
+    "\x00\x00\x00\x04\x00\x00\x00\x00\x00"
+    // stream 1 headers: generated from server_registered_method.headers in this
+    // directory
+    "\x00\x00\xd0\x01\x04\x00\x00\x00\x01"
+    "\x10\x05:path\x0f/registered/bar"
+    "\x10\x07:scheme\x04http"
+    "\x10\x07:method\x04POST"
+    "\x10\x0a:authority\x09localhost"
+    "\x10\x0c"
+    "content-type\x10"
+    "application/grpc"
+    "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
+    "\x10\x02te\x08trailers"
+    "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
+    // data frame for stream 1: advertise a 10000 byte payload (that we won't
+    // fulfill)
+    "\x00\x00\x05\x00\x00\x00\x00\x00\x01"
+    "\x01\x00\x00\x27\x10"
+    // stream 3 headers: generated from server_registered_method.headers in this
+    // directory
+    "\x00\x00\xd0\x01\x04\x00\x00\x00\x03"
+    "\x10\x05:path\x0f/registered/bar"
+    "\x10\x07:scheme\x04http"
+    "\x10\x07:method\x04POST"
+    "\x10\x0a:authority\x09localhost"
+    "\x10\x0c"
+    "content-type\x10"
+    "application/grpc"
+    "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"
+    "\x10\x02te\x08trailers"
+    "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
+    // data frame for stream 3: advertise a 10000 byte payload (that we will
+    // fulfill)
+    "\x00\x00\x05\x00\x00\x00\x00\x00\x03"
+    "\x01\x00\x00\x27\x10"
+    "";
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void verifier(grpc_server* server, grpc_completion_queue* cq,
+                     void* registered_method) {
+  grpc_call_error error;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(cq);
+  grpc_metadata_array request_metadata_recv;
+  gpr_timespec deadline;
+  grpc_byte_buffer* payload = NULL;
+
+  grpc_metadata_array_init(&request_metadata_recv);
+
+  error = grpc_server_request_registered_call(server, registered_method, &s,
+                                              &deadline, &request_metadata_recv,
+                                              &payload, cq, cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(payload != NULL);
+
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_unref(s);
+  grpc_byte_buffer_destroy(payload);
+  cq_verifier_destroy(cqv);
+}
+
+char* g_buffer;
+size_t g_cap = 0;
+size_t g_count = 0;
+
+static void addbuf(const void* data, size_t len) {
+  if (g_count + len > g_cap) {
+    g_cap = GPR_MAX(g_count + len, g_cap * 2);
+    g_buffer = static_cast<char*>(gpr_realloc(g_buffer, g_cap));
+  }
+  memcpy(g_buffer + g_count, data, len);
+  g_count += len;
+}
+
+int main(int argc, char** argv) {
+  int i;
+  grpc_test_init(argc, argv);
+
+#define NUM_FRAMES 10
+#define FRAME_SIZE 1000
+
+  addbuf(prefix, sizeof(prefix) - 1);
+  for (i = 0; i < NUM_FRAMES; i++) {
+    uint8_t hdr[9] = {(uint8_t)(FRAME_SIZE >> 16),
+                      (uint8_t)(FRAME_SIZE >> 8),
+                      (uint8_t)FRAME_SIZE,
+                      0,
+                      0,
+                      0,
+                      0,
+                      0,
+                      3};
+    uint8_t msg[FRAME_SIZE];
+    memset(msg, 'a', sizeof(msg));
+    addbuf(hdr, sizeof(hdr));
+    addbuf(msg, FRAME_SIZE);
+  }
+  grpc_run_bad_client_test(verifier, NULL, g_buffer, g_count, 0);
+  gpr_free(g_buffer);
+
+  return 0;
+}
diff --git a/test/core/bad_client/tests/headers.c b/test/core/bad_client/tests/headers.c
deleted file mode 100644
index c704dbb..0000000
--- a/test/core/bad_client/tests/headers.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/surface/server.h"
-#include "test/core/bad_client/bad_client.h"
-
-#define PFX_STR                      \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00"
-
-static void verifier(grpc_server *server, grpc_completion_queue *cq,
-                     void *registered_method) {
-  while (grpc_server_has_open_connections(server)) {
-    GPR_ASSERT(grpc_completion_queue_next(
-                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
-                   .type == GRPC_QUEUE_TIMEOUT);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  /* partial http2 header prefixes */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01\x04",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01\x05",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01\x04\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x01\x04\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x01\x04\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x01\x04\x00\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x01\x04\x00\x00\x00\x01",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-
-  /* test adding prioritization data */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x01\x01\x24\x00\x00\x00\x01"
-                           "\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x02\x01\x24\x00\x00\x00\x01"
-                           "\x00\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x03\x01\x24\x00\x00\x00\x01"
-                           "\x00\x00\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x04\x01\x24\x00\x00\x00\x01"
-                           "\x00\x00\x00\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
-                           "",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
-                           "\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
-                           "\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
-                           "\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
-                           "\x00\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
-                           "\x00\x00\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-
-  /* test looking up an invalid index */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x01\x01\x04\x00\x00\x00\x01"
-                           "\xfe",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
-                           "\x7f\x7f\x01"
-                           "a",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
-                           "\x0f\x7f\x01"
-                           "a",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
-                           "\x1f\x7f\x01"
-                           "a",
-                           0);
-  /* test nvr, not indexed in static table */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
-                           "\x01\x01"
-                           "a",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
-                           "\x11\x01"
-                           "a",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* illegal op code */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x01\x01\x04\x00\x00\x00\x01"
-                           "\x80",
-                           0);
-  /* parse some long indices */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x02\x01\x04\x00\x00\x00\x01"
-                           "\xff\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x05\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x06\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80\x80\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x07\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80\x80\x80\x00",
-                           0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
-                           "\xff",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80\x80",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80\x80\x80",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80\x80\x80\x80",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80\x80\x80\x80\x00",
-                           0);
-  /* overflow on byte 4 */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x06\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80\x80\x7f",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x06\x01\x04\x00\x00\x00\x01"
-                           "\xff\xff\xff\xff\xff\x0f",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* overflow after byte 4 */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
-                           "\xff\x80\x80\x80\x80\x80\x80\x02",
-                           0);
-  /* end of headers mid-opcode */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x01\x01\x04\x00\x00\x00\x01"
-                           "\x01",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-
-  /* dynamic table size update: set to default */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
-                           "\x3f\xe1\x1f",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* dynamic table size update: set too large */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
-                           "\x3f\xf1\x1f",
-                           0);
-  /* dynamic table size update: set twice */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
-                           "\x20\x3f\xe1\x1f",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* dynamic table size update: set thrice */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
-                           "\x20\x20\x20",
-                           0);
-
-  /* non-ending header followed by continuation frame */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x00\x01\x00\x00\x00\x00\x01"
-                           "\x00\x00\x00\x09\x04\x00\x00\x00\x01",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* non-ending header followed by non-continuation frame */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x00\x01\x00\x00\x00\x00\x01"
-                           "\x00\x00\x00\x00\x04\x00\x00\x00\x01",
-                           0);
-  /* non-ending header followed by a continuation frame for a different stream
-   */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x00\x01\x04\x00\x00\x00\x01"
-                           "\x00\x00\x00\x01\x00\x00\x00\x00\x03"
-                           "\x00\x00\x00\x09\x04\x00\x00\x00\x01",
-                           0);
-  /* opening with a continuation frame */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x09\x04\x00\x00\x00\x01", 0);
-  /* three header frames */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x00\x01\x04\x00\x00\x00\x01"
-                           "\x00\x00\x00\x01\x04\x00\x00\x00\x01"
-                           "\x00\x00\x00\x01\x04\x00\x00\x00\x01",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-
-  /* an invalid header found with fuzzing */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x01\x39\x67\xed\x1d\x64",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-
-  /* a badly encoded timeout value */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x19\x01\x04\x00\x00\x00\x01"
-                           "\x10\x0cgrpc-timeout\x0a"
-                           "15 seconds",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* a badly encoded timeout value: twice (catches caching) */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x19\x01\x04\x00\x00\x00\x01"
-                           "\x10\x0cgrpc-timeout\x0a"
-                           "15 seconds"
-                           "\x00\x00\x19\x01\x04\x00\x00\x00\x03"
-                           "\x10\x0cgrpc-timeout\x0a"
-                           "15 seconds",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-
-  return 0;
-}
diff --git a/test/core/bad_client/tests/headers.cc b/test/core/bad_client/tests/headers.cc
new file mode 100644
index 0000000..f96c6f0
--- /dev/null
+++ b/test/core/bad_client/tests/headers.cc
@@ -0,0 +1,338 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/surface/server.h"
+#include "test/core/bad_client/bad_client.h"
+
+#define PFX_STR                      \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00"
+
+static void verifier(grpc_server* server, grpc_completion_queue* cq,
+                     void* registered_method) {
+  while (grpc_server_has_open_connections(server)) {
+    GPR_ASSERT(grpc_completion_queue_next(
+                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
+                   .type == GRPC_QUEUE_TIMEOUT);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  /* partial http2 header prefixes */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01\x04",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01\x05",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x01\x04\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x01\x04\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x01\x04\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x01\x04\x00\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x01\x04\x00\x00\x00\x01",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+
+  /* test adding prioritization data */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x01\x01\x24\x00\x00\x00\x01"
+                           "\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x02\x01\x24\x00\x00\x00\x01"
+                           "\x00\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x03\x01\x24\x00\x00\x00\x01"
+                           "\x00\x00\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x04\x01\x24\x00\x00\x00\x01"
+                           "\x00\x00\x00\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
+                           "",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
+                           "\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
+                           "\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
+                           "\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
+                           "\x00\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x05\x01\x24\x00\x00\x00\x01"
+                           "\x00\x00\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+
+  /* test looking up an invalid index */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x01\x01\x04\x00\x00\x00\x01"
+                           "\xfe",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
+                           "\x7f\x7f\x01"
+                           "a",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
+                           "\x0f\x7f\x01"
+                           "a",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
+                           "\x1f\x7f\x01"
+                           "a",
+                           0);
+  /* test nvr, not indexed in static table */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
+                           "\x01\x01"
+                           "a",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
+                           "\x11\x01"
+                           "a",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* illegal op code */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x01\x01\x04\x00\x00\x00\x01"
+                           "\x80",
+                           0);
+  /* parse some long indices */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x02\x01\x04\x00\x00\x00\x01"
+                           "\xff\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x05\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x06\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80\x80\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x07\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80\x80\x80\x00",
+                           0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
+                           "\xff",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80\x80",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80\x80\x80",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80\x80\x80\x80",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80\x80\x80\x80\x00",
+                           0);
+  /* overflow on byte 4 */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x06\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80\x80\x7f",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x06\x01\x04\x00\x00\x00\x01"
+                           "\xff\xff\xff\xff\xff\x0f",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* overflow after byte 4 */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x08\x01\x04\x00\x00\x00\x01"
+                           "\xff\x80\x80\x80\x80\x80\x80\x02",
+                           0);
+  /* end of headers mid-opcode */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x01\x01\x04\x00\x00\x00\x01"
+                           "\x01",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+
+  /* dynamic table size update: set to default */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
+                           "\x3f\xe1\x1f",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* dynamic table size update: set too large */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
+                           "\x3f\xf1\x1f",
+                           0);
+  /* dynamic table size update: set twice */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x04\x01\x04\x00\x00\x00\x01"
+                           "\x20\x3f\xe1\x1f",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* dynamic table size update: set thrice */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x03\x01\x04\x00\x00\x00\x01"
+                           "\x20\x20\x20",
+                           0);
+
+  /* non-ending header followed by continuation frame */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x00\x01\x00\x00\x00\x00\x01"
+                           "\x00\x00\x00\x09\x04\x00\x00\x00\x01",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* non-ending header followed by non-continuation frame */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x00\x01\x00\x00\x00\x00\x01"
+                           "\x00\x00\x00\x00\x04\x00\x00\x00\x01",
+                           0);
+  /* non-ending header followed by a continuation frame for a different stream
+   */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x00\x01\x04\x00\x00\x00\x01"
+                           "\x00\x00\x00\x01\x00\x00\x00\x00\x03"
+                           "\x00\x00\x00\x09\x04\x00\x00\x00\x01",
+                           0);
+  /* opening with a continuation frame */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x09\x04\x00\x00\x00\x01", 0);
+  /* three header frames */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x00\x01\x04\x00\x00\x00\x01"
+                           "\x00\x00\x00\x01\x04\x00\x00\x00\x01"
+                           "\x00\x00\x00\x01\x04\x00\x00\x00\x01",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+
+  /* an invalid header found with fuzzing */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x01\x39\x67\xed\x1d\x64",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+
+  /* a badly encoded timeout value */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x19\x01\x04\x00\x00\x00\x01"
+                           "\x10\x0cgrpc-timeout\x0a"
+                           "15 seconds",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* a badly encoded timeout value: twice (catches caching) */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x19\x01\x04\x00\x00\x00\x01"
+                           "\x10\x0cgrpc-timeout\x0a"
+                           "15 seconds"
+                           "\x00\x00\x19\x01\x04\x00\x00\x00\x03"
+                           "\x10\x0cgrpc-timeout\x0a"
+                           "15 seconds",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+
+  return 0;
+}
diff --git a/test/core/bad_client/tests/initial_settings_frame.c b/test/core/bad_client/tests/initial_settings_frame.c
deleted file mode 100644
index 0696ef9..0000000
--- a/test/core/bad_client/tests/initial_settings_frame.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/surface/server.h"
-#include "test/core/bad_client/bad_client.h"
-
-#define PFX_STR "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
-#define ONE_SETTING_HDR "\x00\x00\x06\x04\x00\x00\x00\x00\x00"
-
-static void verifier(grpc_server *server, grpc_completion_queue *cq,
-                     void *registered_method) {
-  while (grpc_server_has_open_connections(server)) {
-    GPR_ASSERT(grpc_completion_queue_next(
-                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
-                   .type == GRPC_QUEUE_TIMEOUT);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  /* various partial prefixes */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x06",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x06",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x06",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04\x01",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04\xff",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x04\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x04\x00\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* must not send frames with stream id != 0 */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x04\x00\x00\x00\x00\x01", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x04\x00\x40\x00\x00\x00", 0);
-  /* settings frame must be a multiple of six bytes long */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x01\x04\x00\x00\x00\x00\x00", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x02\x04\x00\x00\x00\x00\x00", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x03\x04\x00\x00\x00\x00\x00", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x04\x04\x00\x00\x00\x00\x00", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x05\x04\x00\x00\x00\x00\x00", 0);
-  /* some settings values are illegal */
-  /* max frame size = 0 */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR ONE_SETTING_HDR "\x00\x05\x00\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR ONE_SETTING_HDR "\x00\x06\xff\xff\xff\xff",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* update intiial window size */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR ONE_SETTING_HDR "\x00\x04\x00\x01\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* ack with data */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x00\x04\x00\x00\x00\x00\x00"
-                           "\x00\x00\x01\x04\x01\x00\x00\x00\x00",
-                           0);
-  /* settings frame with invalid flags */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x04\x10\x00\x00\x00\x00", 0);
-  /* unknown settings should be ignored */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR ONE_SETTING_HDR "\x00\x99\x00\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-
-  return 0;
-}
diff --git a/test/core/bad_client/tests/initial_settings_frame.cc b/test/core/bad_client/tests/initial_settings_frame.cc
new file mode 100644
index 0000000..dde9d4b
--- /dev/null
+++ b/test/core/bad_client/tests/initial_settings_frame.cc
@@ -0,0 +1,109 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/surface/server.h"
+#include "test/core/bad_client/bad_client.h"
+
+#define PFX_STR "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
+#define ONE_SETTING_HDR "\x00\x00\x06\x04\x00\x00\x00\x00\x00"
+
+static void verifier(grpc_server* server, grpc_completion_queue* cq,
+                     void* registered_method) {
+  while (grpc_server_has_open_connections(server)) {
+    GPR_ASSERT(grpc_completion_queue_next(
+                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
+                   .type == GRPC_QUEUE_TIMEOUT);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  /* various partial prefixes */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x06",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x06",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x06",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04\x01",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04\xff",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR "\x00\x00\x00\x04\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x04\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x04\x00\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* must not send frames with stream id != 0 */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x04\x00\x00\x00\x00\x01", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x04\x00\x40\x00\x00\x00", 0);
+  /* settings frame must be a multiple of six bytes long */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x01\x04\x00\x00\x00\x00\x00", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x02\x04\x00\x00\x00\x00\x00", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x03\x04\x00\x00\x00\x00\x00", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x04\x04\x00\x00\x00\x00\x00", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x05\x04\x00\x00\x00\x00\x00", 0);
+  /* some settings values are illegal */
+  /* max frame size = 0 */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR ONE_SETTING_HDR "\x00\x05\x00\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR ONE_SETTING_HDR "\x00\x06\xff\xff\xff\xff",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* update intiial window size */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR ONE_SETTING_HDR "\x00\x04\x00\x01\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* ack with data */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x00\x04\x00\x00\x00\x00\x00"
+                           "\x00\x00\x01\x04\x01\x00\x00\x00\x00",
+                           0);
+  /* settings frame with invalid flags */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x04\x10\x00\x00\x00\x00", 0);
+  /* unknown settings should be ignored */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR ONE_SETTING_HDR "\x00\x99\x00\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+
+  return 0;
+}
diff --git a/test/core/bad_client/tests/large_metadata.c b/test/core/bad_client/tests/large_metadata.c
deleted file mode 100644
index ca3d234..0000000
--- a/test/core/bad_client/tests/large_metadata.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/bad_client/bad_client.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/end2end/cq_verifier.h"
-
-// The large-metadata headers that we're adding for this test are not
-// actually appended to this in a single string, since the string would
-// be longer than the C99 string literal limit.  Instead, we dynamically
-// construct it by adding the large headers one at a time.
-
-#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_PREFIX_STR                       \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"     /* settings frame */              \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* headers: generated from        \
-                                            large_metadata.headers in this \
-                                            directory */                   \
-  "\x00\x00\x00\x04\x01\x00\x00\x00\x00"                                   \
-  "\x00"                                                                   \
-  "5{\x01\x05\x00\x00\x00\x01"                                             \
-  "\x10\x05:path\x08/foo/bar"                                              \
-  "\x10\x07:scheme\x04http"                                                \
-  "\x10\x07:method\x04POST"                                                \
-  "\x10\x0a:authority\x09localhost"                                        \
-  "\x10\x0c"                                                               \
-  "content-type\x10"                                                       \
-  "application/grpc"                                                       \
-  "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"                  \
-  "\x10\x02te\x08trailers"                                                 \
-  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
-
-// Each large-metadata header is constructed from these start and end
-// strings, with a two-digit number in between.
-#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_START_STR "\x10\x0duser-header"
-#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_END_STR                   \
-  "~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-
-// The size of each large-metadata header string.
-#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_SIZE                     \
-  ((sizeof(PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_START_STR) - 1) + 2 + \
-   (sizeof(PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_END_STR) - 1))
-
-// The number of headers we're adding and the total size of the client
-// payload.
-#define NUM_HEADERS 46
-#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_PAYLOAD_SIZE          \
-  ((sizeof(PFX_TOO_MUCH_METADATA_FROM_CLIENT_PREFIX_STR) - 1) + \
-   (NUM_HEADERS * PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_SIZE) + 1)
-
-#define PFX_TOO_MUCH_METADATA_FROM_SERVER_STR                                              \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" /* settings frame: sets                               \
-                                        MAX_HEADER_LIST_SIZE to 8K */                      \
-  "\x00\x00\x06\x04\x00\x00\x00\x00\x00\x00\x06\x00\x00\x20\x00" /* headers:               \
-                                                                    generated              \
-                                                                    from                   \
-                                                                    simple_request.headers \
-                                                                    in this                \
-                                                                    directory              \
-                                                                    */                     \
-  "\x00\x00\x00\x04\x01\x00\x00\x00\x00"                                                   \
-  "\x00\x00\xc9\x01\x04\x00\x00\x00\x01"                                                   \
-  "\x10\x05:path\x08/foo/bar"                                                              \
-  "\x10\x07:scheme\x04http"                                                                \
-  "\x10\x07:method\x04POST"                                                                \
-  "\x10\x0a:authority\x09localhost"                                                        \
-  "\x10\x0c"                                                                               \
-  "content-type\x10"                                                                       \
-  "application/grpc"                                                                       \
-  "\x10\x14grpc-accept-encoding\x15"                                                       \
-  "deflate,identity,gzip"                                                                  \
-  "\x10\x02te\x08trailers"                                                                 \
-  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void server_verifier(grpc_server *server, grpc_completion_queue *cq,
-                            void *registered_method) {
-  grpc_call_error error;
-  grpc_call *s;
-  grpc_call_details call_details;
-  cq_verifier *cqv = cq_verifier_create(cq);
-  grpc_metadata_array request_metadata_recv;
-
-  grpc_call_details_init(&call_details);
-  grpc_metadata_array_init(&request_metadata_recv);
-
-  error = grpc_server_request_call(server, &s, &call_details,
-                                   &request_metadata_recv, cq, cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.host, "localhost"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo/bar"));
-
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_call_unref(s);
-  cq_verifier_destroy(cqv);
-}
-
-static void server_verifier_sends_too_much_metadata(grpc_server *server,
-                                                    grpc_completion_queue *cq,
-                                                    void *registered_method) {
-  grpc_call_error error;
-  grpc_call *s;
-  grpc_call_details call_details;
-  cq_verifier *cqv = cq_verifier_create(cq);
-  grpc_metadata_array request_metadata_recv;
-
-  grpc_call_details_init(&call_details);
-  grpc_metadata_array_init(&request_metadata_recv);
-
-  error = grpc_server_request_call(server, &s, &call_details,
-                                   &request_metadata_recv, cq, cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.host, "localhost"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo/bar"));
-
-  const size_t metadata_value_size = 8 * 1024;
-  grpc_metadata meta;
-  meta.key = grpc_slice_from_static_string("key");
-  meta.value = grpc_slice_malloc(metadata_value_size);
-  memset(GRPC_SLICE_START_PTR(meta.value), 'a', metadata_value_size);
-
-  grpc_op op;
-  memset(&op, 0, sizeof(op));
-  op.op = GRPC_OP_SEND_INITIAL_METADATA;
-  op.data.send_initial_metadata.count = 1;
-  op.data.send_initial_metadata.metadata = &meta;
-  op.flags = 0;
-  op.reserved = NULL;
-  error = grpc_call_start_batch(s, &op, 1, tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 0);  // Operation fails.
-  cq_verify(cqv);
-
-  grpc_slice_unref(meta.value);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_call_unref(s);
-  cq_verifier_destroy(cqv);
-}
-
-static bool client_validator(grpc_slice_buffer *incoming) {
-  for (size_t i = 0; i < incoming->count; ++i) {
-    const char *s = (const char *)GRPC_SLICE_START_PTR(incoming->slices[i]);
-    char *hex = gpr_dump(s, GRPC_SLICE_LENGTH(incoming->slices[i]),
-                         GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    gpr_log(GPR_INFO, "RESPONSE SLICE %" PRIdPTR ": %s", i, hex);
-    gpr_free(hex);
-  }
-
-  // Get last frame from incoming slice buffer.
-  grpc_slice_buffer last_frame_buffer;
-  grpc_slice_buffer_init(&last_frame_buffer);
-  grpc_slice_buffer_trim_end(incoming, 13, &last_frame_buffer);
-  GPR_ASSERT(last_frame_buffer.count == 1);
-  grpc_slice last_frame = last_frame_buffer.slices[0];
-
-  const uint8_t *p = GRPC_SLICE_START_PTR(last_frame);
-  bool success =
-      // Length == 4
-      *p++ != 0 || *p++ != 0 || *p++ != 4 ||
-      // Frame type (RST_STREAM)
-      *p++ != 3 ||
-      // Flags
-      *p++ != 0 ||
-      // Stream ID.
-      *p++ != 0 || *p++ != 0 || *p++ != 0 || *p++ != 1 ||
-      // Payload (error code)
-      *p++ == 0 || *p++ == 0 || *p++ == 0 || *p == 0 || *p == 11;
-
-  if (!success) {
-    gpr_log(GPR_INFO, "client expected RST_STREAM frame, not found");
-  }
-
-  grpc_slice_buffer_destroy(&last_frame_buffer);
-  return success;
-}
-
-int main(int argc, char **argv) {
-  int i;
-
-  grpc_test_init(argc, argv);
-
-  // Test sending more metadata than the server will accept.
-  gpr_strvec headers;
-  gpr_strvec_init(&headers);
-  for (i = 0; i < NUM_HEADERS; ++i) {
-    char *str;
-    gpr_asprintf(&str, "%s%02d%s",
-                 PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_START_STR, i,
-                 PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_END_STR);
-    gpr_strvec_add(&headers, str);
-  }
-  size_t headers_len;
-  const char *client_headers = gpr_strvec_flatten(&headers, &headers_len);
-  gpr_strvec_destroy(&headers);
-  char client_payload[PFX_TOO_MUCH_METADATA_FROM_CLIENT_PAYLOAD_SIZE] =
-      PFX_TOO_MUCH_METADATA_FROM_CLIENT_PREFIX_STR;
-  memcpy(
-      client_payload + sizeof(PFX_TOO_MUCH_METADATA_FROM_CLIENT_PREFIX_STR) - 1,
-      client_headers, headers_len);
-  GRPC_RUN_BAD_CLIENT_TEST(server_verifier, client_validator, client_payload,
-                           0);
-  gpr_free((void *)client_headers);
-
-  // Test sending more metadata than the client will accept.
-  GRPC_RUN_BAD_CLIENT_TEST(server_verifier_sends_too_much_metadata,
-                           client_validator,
-                           PFX_TOO_MUCH_METADATA_FROM_SERVER_STR, 0);
-
-  return 0;
-}
diff --git a/test/core/bad_client/tests/large_metadata.cc b/test/core/bad_client/tests/large_metadata.cc
new file mode 100644
index 0000000..df7dd8f
--- /dev/null
+++ b/test/core/bad_client/tests/large_metadata.cc
@@ -0,0 +1,240 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/bad_client/bad_client.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/end2end/cq_verifier.h"
+
+// The large-metadata headers that we're adding for this test are not
+// actually appended to this in a single string, since the string would
+// be longer than the C99 string literal limit.  Instead, we dynamically
+// construct it by adding the large headers one at a time.
+
+#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_PREFIX_STR                       \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"     /* settings frame */              \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* headers: generated from        \
+                                            large_metadata.headers in this \
+                                            directory */                   \
+  "\x00\x00\x00\x04\x01\x00\x00\x00\x00"                                   \
+  "\x00"                                                                   \
+  "5{\x01\x05\x00\x00\x00\x01"                                             \
+  "\x10\x05:path\x08/foo/bar"                                              \
+  "\x10\x07:scheme\x04http"                                                \
+  "\x10\x07:method\x04POST"                                                \
+  "\x10\x0a:authority\x09localhost"                                        \
+  "\x10\x0c"                                                               \
+  "content-type\x10"                                                       \
+  "application/grpc"                                                       \
+  "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"                  \
+  "\x10\x02te\x08trailers"                                                 \
+  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
+
+// Each large-metadata header is constructed from these start and end
+// strings, with a two-digit number in between.
+#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_START_STR "\x10\x0duser-header"
+#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_END_STR                   \
+  "~aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+
+// The size of each large-metadata header string.
+#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_SIZE                     \
+  ((sizeof(PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_START_STR) - 1) + 2 + \
+   (sizeof(PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_END_STR) - 1))
+
+// The number of headers we're adding and the total size of the client
+// payload.
+#define NUM_HEADERS 46
+#define PFX_TOO_MUCH_METADATA_FROM_CLIENT_PAYLOAD_SIZE          \
+  ((sizeof(PFX_TOO_MUCH_METADATA_FROM_CLIENT_PREFIX_STR) - 1) + \
+   (NUM_HEADERS * PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_SIZE) + 1)
+
+#define PFX_TOO_MUCH_METADATA_FROM_SERVER_STR                                              \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" /* settings frame: sets                               \
+                                        MAX_HEADER_LIST_SIZE to 8K */                      \
+  "\x00\x00\x06\x04\x00\x00\x00\x00\x00\x00\x06\x00\x00\x20\x00" /* headers:               \
+                                                                    generated              \
+                                                                    from                   \
+                                                                    simple_request.headers \
+                                                                    in this                \
+                                                                    directory              \
+                                                                    */                     \
+  "\x00\x00\x00\x04\x01\x00\x00\x00\x00"                                                   \
+  "\x00\x00\xc9\x01\x04\x00\x00\x00\x01"                                                   \
+  "\x10\x05:path\x08/foo/bar"                                                              \
+  "\x10\x07:scheme\x04http"                                                                \
+  "\x10\x07:method\x04POST"                                                                \
+  "\x10\x0a:authority\x09localhost"                                                        \
+  "\x10\x0c"                                                                               \
+  "content-type\x10"                                                                       \
+  "application/grpc"                                                                       \
+  "\x10\x14grpc-accept-encoding\x15"                                                       \
+  "deflate,identity,gzip"                                                                  \
+  "\x10\x02te\x08trailers"                                                                 \
+  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void server_verifier(grpc_server* server, grpc_completion_queue* cq,
+                            void* registered_method) {
+  grpc_call_error error;
+  grpc_call* s;
+  grpc_call_details call_details;
+  cq_verifier* cqv = cq_verifier_create(cq);
+  grpc_metadata_array request_metadata_recv;
+
+  grpc_call_details_init(&call_details);
+  grpc_metadata_array_init(&request_metadata_recv);
+
+  error = grpc_server_request_call(server, &s, &call_details,
+                                   &request_metadata_recv, cq, cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.host, "localhost"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo/bar"));
+
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_call_unref(s);
+  cq_verifier_destroy(cqv);
+}
+
+static void server_verifier_sends_too_much_metadata(grpc_server* server,
+                                                    grpc_completion_queue* cq,
+                                                    void* registered_method) {
+  grpc_call_error error;
+  grpc_call* s;
+  grpc_call_details call_details;
+  cq_verifier* cqv = cq_verifier_create(cq);
+  grpc_metadata_array request_metadata_recv;
+
+  grpc_call_details_init(&call_details);
+  grpc_metadata_array_init(&request_metadata_recv);
+
+  error = grpc_server_request_call(server, &s, &call_details,
+                                   &request_metadata_recv, cq, cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.host, "localhost"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo/bar"));
+
+  const size_t metadata_value_size = 8 * 1024;
+  grpc_metadata meta;
+  meta.key = grpc_slice_from_static_string("key");
+  meta.value = grpc_slice_malloc(metadata_value_size);
+  memset(GRPC_SLICE_START_PTR(meta.value), 'a', metadata_value_size);
+
+  grpc_op op;
+  memset(&op, 0, sizeof(op));
+  op.op = GRPC_OP_SEND_INITIAL_METADATA;
+  op.data.send_initial_metadata.count = 1;
+  op.data.send_initial_metadata.metadata = &meta;
+  op.flags = 0;
+  op.reserved = NULL;
+  error = grpc_call_start_batch(s, &op, 1, tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 0);  // Operation fails.
+  cq_verify(cqv);
+
+  grpc_slice_unref(meta.value);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_call_unref(s);
+  cq_verifier_destroy(cqv);
+}
+
+static bool client_validator(grpc_slice_buffer* incoming) {
+  for (size_t i = 0; i < incoming->count; ++i) {
+    const char* s = (const char*)GRPC_SLICE_START_PTR(incoming->slices[i]);
+    char* hex = gpr_dump(s, GRPC_SLICE_LENGTH(incoming->slices[i]),
+                         GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    gpr_log(GPR_INFO, "RESPONSE SLICE %" PRIdPTR ": %s", i, hex);
+    gpr_free(hex);
+  }
+
+  // Get last frame from incoming slice buffer.
+  grpc_slice_buffer last_frame_buffer;
+  grpc_slice_buffer_init(&last_frame_buffer);
+  grpc_slice_buffer_trim_end(incoming, 13, &last_frame_buffer);
+  GPR_ASSERT(last_frame_buffer.count == 1);
+  grpc_slice last_frame = last_frame_buffer.slices[0];
+
+  const uint8_t* p = GRPC_SLICE_START_PTR(last_frame);
+  bool success =
+      // Length == 4
+      *p++ != 0 || *p++ != 0 || *p++ != 4 ||
+      // Frame type (RST_STREAM)
+      *p++ != 3 ||
+      // Flags
+      *p++ != 0 ||
+      // Stream ID.
+      *p++ != 0 || *p++ != 0 || *p++ != 0 || *p++ != 1 ||
+      // Payload (error code)
+      *p++ == 0 || *p++ == 0 || *p++ == 0 || *p == 0 || *p == 11;
+
+  if (!success) {
+    gpr_log(GPR_INFO, "client expected RST_STREAM frame, not found");
+  }
+
+  grpc_slice_buffer_destroy(&last_frame_buffer);
+  return success;
+}
+
+int main(int argc, char** argv) {
+  int i;
+
+  grpc_test_init(argc, argv);
+
+  // Test sending more metadata than the server will accept.
+  gpr_strvec headers;
+  gpr_strvec_init(&headers);
+  for (i = 0; i < NUM_HEADERS; ++i) {
+    char* str;
+    gpr_asprintf(&str, "%s%02d%s",
+                 PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_START_STR, i,
+                 PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_END_STR);
+    gpr_strvec_add(&headers, str);
+  }
+  size_t headers_len;
+  const char* client_headers = gpr_strvec_flatten(&headers, &headers_len);
+  gpr_strvec_destroy(&headers);
+  char client_payload[PFX_TOO_MUCH_METADATA_FROM_CLIENT_PAYLOAD_SIZE] =
+      PFX_TOO_MUCH_METADATA_FROM_CLIENT_PREFIX_STR;
+  memcpy(
+      client_payload + sizeof(PFX_TOO_MUCH_METADATA_FROM_CLIENT_PREFIX_STR) - 1,
+      client_headers, headers_len);
+  GRPC_RUN_BAD_CLIENT_TEST(server_verifier, client_validator, client_payload,
+                           0);
+  gpr_free((void*)client_headers);
+
+  // Test sending more metadata than the client will accept.
+  GRPC_RUN_BAD_CLIENT_TEST(server_verifier_sends_too_much_metadata,
+                           client_validator,
+                           PFX_TOO_MUCH_METADATA_FROM_SERVER_STR, 0);
+
+  return 0;
+}
diff --git a/test/core/bad_client/tests/server_registered_method.c b/test/core/bad_client/tests/server_registered_method.c
deleted file mode 100644
index f523503..0000000
--- a/test/core/bad_client/tests/server_registered_method.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/bad_client/bad_client.h"
-
-#include <string.h>
-
-#include "src/core/lib/surface/server.h"
-#include "test/core/end2end/cq_verifier.h"
-
-#define PFX_STR                                               \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                          \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */ \
-  "\x00\x00\xd0\x01\x04\x00\x00\x00\x01"                      \
-  "\x10\x05:path\x0f/registered/bar"                          \
-  "\x10\x07:scheme\x04http"                                   \
-  "\x10\x07:method\x04POST"                                   \
-  "\x10\x0a:authority\x09localhost"                           \
-  "\x10\x0c"                                                  \
-  "content-type\x10"                                          \
-  "application/grpc"                                          \
-  "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"     \
-  "\x10\x02te\x08trailers"                                    \
-  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void verifier_succeeds(grpc_server *server, grpc_completion_queue *cq,
-                              void *registered_method) {
-  grpc_call_error error;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(cq);
-  grpc_metadata_array request_metadata_recv;
-  gpr_timespec deadline;
-  grpc_byte_buffer *payload = NULL;
-
-  grpc_metadata_array_init(&request_metadata_recv);
-
-  error = grpc_server_request_registered_call(server, registered_method, &s,
-                                              &deadline, &request_metadata_recv,
-                                              &payload, cq, cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(payload != NULL);
-
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_unref(s);
-  grpc_byte_buffer_destroy(payload);
-  cq_verifier_destroy(cqv);
-}
-
-static void verifier_fails(grpc_server *server, grpc_completion_queue *cq,
-                           void *registered_method) {
-  while (grpc_server_has_open_connections(server)) {
-    GPR_ASSERT(grpc_completion_queue_next(
-                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
-                   .type == GRPC_QUEUE_TIMEOUT);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  /* body generated with
-   * tools/codegen/core/gen_server_registered_method_bad_client_test_body.py */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier_fails, NULL,
-                           PFX_STR "\x00\x00\x00\x00\x00\x00\x00\x00\x01",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier_fails, NULL,
-                           PFX_STR "\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier_fails, NULL, PFX_STR
-                           "\x00\x00\x02\x00\x00\x00\x00\x00\x01\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier_fails, NULL, PFX_STR
-                           "\x00\x00\x03\x00\x00\x00\x00\x00\x01\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier_fails, NULL,
-      PFX_STR "\x00\x00\x04\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00",
-      GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier_succeeds, NULL,
-      PFX_STR "\x00\x00\x05\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00", 0);
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier_fails, NULL,
-      PFX_STR "\x00\x00\x05\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01",
-      GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier_succeeds, NULL,
-      PFX_STR "\x00\x00\x06\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00",
-      0);
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier_fails, NULL,
-      PFX_STR "\x00\x00\x05\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x02",
-      GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier_fails, NULL,
-      PFX_STR "\x00\x00\x06\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x02\x00",
-      GRPC_BAD_CLIENT_DISCONNECT);
-  GRPC_RUN_BAD_CLIENT_TEST(
-      verifier_succeeds, NULL, PFX_STR
-      "\x00\x00\x07\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x02\x00\x00",
-      0);
-
-  return 0;
-}
diff --git a/test/core/bad_client/tests/server_registered_method.cc b/test/core/bad_client/tests/server_registered_method.cc
new file mode 100644
index 0000000..b1b1123
--- /dev/null
+++ b/test/core/bad_client/tests/server_registered_method.cc
@@ -0,0 +1,127 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/bad_client/bad_client.h"
+
+#include <string.h>
+
+#include "src/core/lib/surface/server.h"
+#include "test/core/end2end/cq_verifier.h"
+
+#define PFX_STR                                               \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                          \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */ \
+  "\x00\x00\xd0\x01\x04\x00\x00\x00\x01"                      \
+  "\x10\x05:path\x0f/registered/bar"                          \
+  "\x10\x07:scheme\x04http"                                   \
+  "\x10\x07:method\x04POST"                                   \
+  "\x10\x0a:authority\x09localhost"                           \
+  "\x10\x0c"                                                  \
+  "content-type\x10"                                          \
+  "application/grpc"                                          \
+  "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"     \
+  "\x10\x02te\x08trailers"                                    \
+  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void verifier_succeeds(grpc_server* server, grpc_completion_queue* cq,
+                              void* registered_method) {
+  grpc_call_error error;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(cq);
+  grpc_metadata_array request_metadata_recv;
+  gpr_timespec deadline;
+  grpc_byte_buffer* payload = NULL;
+
+  grpc_metadata_array_init(&request_metadata_recv);
+
+  error = grpc_server_request_registered_call(server, registered_method, &s,
+                                              &deadline, &request_metadata_recv,
+                                              &payload, cq, cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(payload != NULL);
+
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_unref(s);
+  grpc_byte_buffer_destroy(payload);
+  cq_verifier_destroy(cqv);
+}
+
+static void verifier_fails(grpc_server* server, grpc_completion_queue* cq,
+                           void* registered_method) {
+  while (grpc_server_has_open_connections(server)) {
+    GPR_ASSERT(grpc_completion_queue_next(
+                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
+                   .type == GRPC_QUEUE_TIMEOUT);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  /* body generated with
+   * tools/codegen/core/gen_server_registered_method_bad_client_test_body.py */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier_fails, NULL,
+                           PFX_STR "\x00\x00\x00\x00\x00\x00\x00\x00\x01",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier_fails, NULL,
+                           PFX_STR "\x00\x00\x01\x00\x00\x00\x00\x00\x01\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier_fails, NULL,
+                           PFX_STR
+                           "\x00\x00\x02\x00\x00\x00\x00\x00\x01\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier_fails, NULL,
+                           PFX_STR
+                           "\x00\x00\x03\x00\x00\x00\x00\x00\x01\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier_fails, NULL,
+      PFX_STR "\x00\x00\x04\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00",
+      GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier_succeeds, NULL,
+      PFX_STR "\x00\x00\x05\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00", 0);
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier_fails, NULL,
+      PFX_STR "\x00\x00\x05\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01",
+      GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier_succeeds, NULL,
+      PFX_STR "\x00\x00\x06\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00",
+      0);
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier_fails, NULL,
+      PFX_STR "\x00\x00\x05\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x02",
+      GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier_fails, NULL,
+      PFX_STR "\x00\x00\x06\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x02\x00",
+      GRPC_BAD_CLIENT_DISCONNECT);
+  GRPC_RUN_BAD_CLIENT_TEST(
+      verifier_succeeds, NULL,
+      PFX_STR
+      "\x00\x00\x07\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x02\x00\x00",
+      0);
+
+  return 0;
+}
diff --git a/test/core/bad_client/tests/simple_request.c b/test/core/bad_client/tests/simple_request.c
deleted file mode 100644
index a516632..0000000
--- a/test/core/bad_client/tests/simple_request.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/bad_client/bad_client.h"
-
-#include <string.h>
-
-#include "src/core/lib/surface/server.h"
-#include "test/core/end2end/cq_verifier.h"
-
-#define PFX_STR                                                            \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                                       \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */              \
-  "\x00\x00\xc9\x01\x04\x00\x00\x00\x01" /* headers: generated from        \
-                                            simple_request.headers in this \
-                                            directory */                   \
-  "\x10\x05:path\x08/foo/bar"                                              \
-  "\x10\x07:scheme\x04http"                                                \
-  "\x10\x07:method\x04POST"                                                \
-  "\x10\x0a:authority\x09localhost"                                        \
-  "\x10\x0c"                                                               \
-  "content-type\x10"                                                       \
-  "application/grpc"                                                       \
-  "\x10\x14grpc-accept-encoding\x15"                                       \
-  "deflate,identity,gzip"                                                  \
-  "\x10\x02te\x08trailers"                                                 \
-  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
-
-#define PFX_STR_UNUSUAL                                                    \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                                       \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */              \
-  "\x00\x00\xf4\x01\x04\x00\x00\x00\x01" /* headers: generated from        \
-                                            simple_request_unusual.headers \
-                                            in this directory */           \
-  "\x10\x05:path\x08/foo/bar"                                              \
-  "\x10\x07:scheme\x04http"                                                \
-  "\x10\x07:method\x04POST"                                                \
-  "\x10\x04host\x09localhost"                                              \
-  "\x10\x0c"                                                               \
-  "content-type\x1e"                                                       \
-  "application/grpc+this-is-valid"                                         \
-  "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"                  \
-  "\x10\x02te\x08trailers"                                                 \
-  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"                 \
-  "\x10\x0cgrpc-timeout\x03"                                               \
-  "10S"                                                                    \
-  "\x10\x0cgrpc-timeout\x02"                                               \
-  "5S"
-
-#define PFX_STR_UNUSUAL2                                                    \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                                        \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */               \
-  "\x00\x00\xf4\x01\x04\x00\x00\x00\x01" /* headers: generated from         \
-                                            simple_request_unusual2.headers \
-                                            in this directory */            \
-  "\x10\x05:path\x08/foo/bar"                                               \
-  "\x10\x07:scheme\x04http"                                                 \
-  "\x10\x07:method\x04POST"                                                 \
-  "\x10\x04host\x09localhost"                                               \
-  "\x10\x0c"                                                                \
-  "content-type\x1e"                                                        \
-  "application/grpc;this-is-valid"                                          \
-  "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"                   \
-  "\x10\x02te\x08trailers"                                                  \
-  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"                  \
-  "\x10\x0cgrpc-timeout\x03"                                                \
-  "10S"                                                                     \
-  "\x10\x0cgrpc-timeout\x02"                                                \
-  "5S"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void verifier(grpc_server *server, grpc_completion_queue *cq,
-                     void *registered_method) {
-  grpc_call_error error;
-  grpc_call *s;
-  grpc_call_details call_details;
-  cq_verifier *cqv = cq_verifier_create(cq);
-  grpc_metadata_array request_metadata_recv;
-
-  grpc_call_details_init(&call_details);
-  grpc_metadata_array_init(&request_metadata_recv);
-
-  error = grpc_server_request_call(server, &s, &call_details,
-                                   &request_metadata_recv, cq, cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.host, "localhost"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo/bar"));
-
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_call_unref(s);
-  cq_verifier_destroy(cqv);
-}
-
-static void failure_verifier(grpc_server *server, grpc_completion_queue *cq,
-                             void *registered_method) {
-  while (grpc_server_has_open_connections(server)) {
-    GPR_ASSERT(grpc_completion_queue_next(
-                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
-                   .type == GRPC_QUEUE_TIMEOUT);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  /* basic request: check that things are working */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR, 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR_UNUSUAL, 0);
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR_UNUSUAL2, 0);
-
-  /* push an illegal data frame */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR
-                           "\x00\x00\x05\x00\x00\x00\x00\x00\x01"
-                           "\x34\x00\x00\x00\x00",
-                           0);
-
-  /* push a data frame with bad flags */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x00\x02\x00\x00\x00\x01", 0);
-  /* push a window update with a bad length */
-  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
-                           PFX_STR "\x00\x00\x01\x08\x00\x00\x00\x00\x01", 0);
-  /* push a window update with bad flags */
-  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x08\x10\x00\x00\x00\x01", 0);
-  /* push a window update with bad data */
-  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL, PFX_STR
-                           "\x00\x00\x04\x08\x00\x00\x00\x00\x01"
-                           "\xff\xff\xff\xff",
-                           0);
-  /* push a short goaway */
-  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
-                           PFX_STR "\x00\x00\x04\x07\x00\x00\x00\x00\x00", 0);
-  /* disconnect before sending goaway */
-  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
-                           PFX_STR "\x00\x01\x12\x07\x00\x00\x00\x00\x00",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-  /* push a rst_stream with a bad length */
-  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
-                           PFX_STR "\x00\x00\x01\x03\x00\x00\x00\x00\x01", 0);
-  /* push a rst_stream with bad flags */
-  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x03\x10\x00\x00\x00\x01", 0);
-
-  return 0;
-}
diff --git a/test/core/bad_client/tests/simple_request.cc b/test/core/bad_client/tests/simple_request.cc
new file mode 100644
index 0000000..b9cc1e3
--- /dev/null
+++ b/test/core/bad_client/tests/simple_request.cc
@@ -0,0 +1,168 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/bad_client/bad_client.h"
+
+#include <string.h>
+
+#include "src/core/lib/surface/server.h"
+#include "test/core/end2end/cq_verifier.h"
+
+#define PFX_STR                                                            \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                                       \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */              \
+  "\x00\x00\xc9\x01\x04\x00\x00\x00\x01" /* headers: generated from        \
+                                            simple_request.headers in this \
+                                            directory */                   \
+  "\x10\x05:path\x08/foo/bar"                                              \
+  "\x10\x07:scheme\x04http"                                                \
+  "\x10\x07:method\x04POST"                                                \
+  "\x10\x0a:authority\x09localhost"                                        \
+  "\x10\x0c"                                                               \
+  "content-type\x10"                                                       \
+  "application/grpc"                                                       \
+  "\x10\x14grpc-accept-encoding\x15"                                       \
+  "deflate,identity,gzip"                                                  \
+  "\x10\x02te\x08trailers"                                                 \
+  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
+
+#define PFX_STR_UNUSUAL                                                    \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                                       \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */              \
+  "\x00\x00\xf4\x01\x04\x00\x00\x00\x01" /* headers: generated from        \
+                                            simple_request_unusual.headers \
+                                            in this directory */           \
+  "\x10\x05:path\x08/foo/bar"                                              \
+  "\x10\x07:scheme\x04http"                                                \
+  "\x10\x07:method\x04POST"                                                \
+  "\x10\x04host\x09localhost"                                              \
+  "\x10\x0c"                                                               \
+  "content-type\x1e"                                                       \
+  "application/grpc+this-is-valid"                                         \
+  "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"                  \
+  "\x10\x02te\x08trailers"                                                 \
+  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"                 \
+  "\x10\x0cgrpc-timeout\x03"                                               \
+  "10S"                                                                    \
+  "\x10\x0cgrpc-timeout\x02"                                               \
+  "5S"
+
+#define PFX_STR_UNUSUAL2                                                    \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                                        \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */               \
+  "\x00\x00\xf4\x01\x04\x00\x00\x00\x01" /* headers: generated from         \
+                                            simple_request_unusual2.headers \
+                                            in this directory */            \
+  "\x10\x05:path\x08/foo/bar"                                               \
+  "\x10\x07:scheme\x04http"                                                 \
+  "\x10\x07:method\x04POST"                                                 \
+  "\x10\x04host\x09localhost"                                               \
+  "\x10\x0c"                                                                \
+  "content-type\x1e"                                                        \
+  "application/grpc;this-is-valid"                                          \
+  "\x10\x14grpc-accept-encoding\x15identity,deflate,gzip"                   \
+  "\x10\x02te\x08trailers"                                                  \
+  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"                  \
+  "\x10\x0cgrpc-timeout\x03"                                                \
+  "10S"                                                                     \
+  "\x10\x0cgrpc-timeout\x02"                                                \
+  "5S"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void verifier(grpc_server* server, grpc_completion_queue* cq,
+                     void* registered_method) {
+  grpc_call_error error;
+  grpc_call* s;
+  grpc_call_details call_details;
+  cq_verifier* cqv = cq_verifier_create(cq);
+  grpc_metadata_array request_metadata_recv;
+
+  grpc_call_details_init(&call_details);
+  grpc_metadata_array_init(&request_metadata_recv);
+
+  error = grpc_server_request_call(server, &s, &call_details,
+                                   &request_metadata_recv, cq, cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.host, "localhost"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo/bar"));
+
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_call_unref(s);
+  cq_verifier_destroy(cqv);
+}
+
+static void failure_verifier(grpc_server* server, grpc_completion_queue* cq,
+                             void* registered_method) {
+  while (grpc_server_has_open_connections(server)) {
+    GPR_ASSERT(grpc_completion_queue_next(
+                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
+                   .type == GRPC_QUEUE_TIMEOUT);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  /* basic request: check that things are working */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR, 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR_UNUSUAL, 0);
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL, PFX_STR_UNUSUAL2, 0);
+
+  /* push an illegal data frame */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x05\x00\x00\x00\x00\x00\x01"
+                           "\x34\x00\x00\x00\x00",
+                           0);
+
+  /* push a data frame with bad flags */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x00\x02\x00\x00\x00\x01", 0);
+  /* push a window update with a bad length */
+  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
+                           PFX_STR "\x00\x00\x01\x08\x00\x00\x00\x00\x01", 0);
+  /* push a window update with bad flags */
+  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x08\x10\x00\x00\x00\x01", 0);
+  /* push a window update with bad data */
+  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
+                           PFX_STR
+                           "\x00\x00\x04\x08\x00\x00\x00\x00\x01"
+                           "\xff\xff\xff\xff",
+                           0);
+  /* push a short goaway */
+  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
+                           PFX_STR "\x00\x00\x04\x07\x00\x00\x00\x00\x00", 0);
+  /* disconnect before sending goaway */
+  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
+                           PFX_STR "\x00\x01\x12\x07\x00\x00\x00\x00\x00",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+  /* push a rst_stream with a bad length */
+  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
+                           PFX_STR "\x00\x00\x01\x03\x00\x00\x00\x00\x01", 0);
+  /* push a rst_stream with bad flags */
+  GRPC_RUN_BAD_CLIENT_TEST(failure_verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x03\x10\x00\x00\x00\x01", 0);
+
+  return 0;
+}
diff --git a/test/core/bad_client/tests/unknown_frame.c b/test/core/bad_client/tests/unknown_frame.c
deleted file mode 100644
index 448803d..0000000
--- a/test/core/bad_client/tests/unknown_frame.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/surface/server.h"
-#include "test/core/bad_client/bad_client.h"
-
-#define PFX_STR                      \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00"
-
-static void verifier(grpc_server *server, grpc_completion_queue *cq,
-                     void *registered_method) {
-  while (grpc_server_has_open_connections(server)) {
-    GPR_ASSERT(grpc_completion_queue_next(
-                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
-                   .type == GRPC_QUEUE_TIMEOUT);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  /* test adding prioritization data */
-  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
-                           PFX_STR "\x00\x00\x00\x88\x00\x00\x00\x00\x01",
-                           GRPC_BAD_CLIENT_DISCONNECT);
-
-  return 0;
-}
diff --git a/test/core/bad_client/tests/unknown_frame.cc b/test/core/bad_client/tests/unknown_frame.cc
new file mode 100644
index 0000000..b8367a2
--- /dev/null
+++ b/test/core/bad_client/tests/unknown_frame.cc
@@ -0,0 +1,44 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/surface/server.h"
+#include "test/core/bad_client/bad_client.h"
+
+#define PFX_STR                      \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00"
+
+static void verifier(grpc_server* server, grpc_completion_queue* cq,
+                     void* registered_method) {
+  while (grpc_server_has_open_connections(server)) {
+    GPR_ASSERT(grpc_completion_queue_next(
+                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
+                   .type == GRPC_QUEUE_TIMEOUT);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  /* test adding prioritization data */
+  GRPC_RUN_BAD_CLIENT_TEST(verifier, NULL,
+                           PFX_STR "\x00\x00\x00\x88\x00\x00\x00\x00\x01",
+                           GRPC_BAD_CLIENT_DISCONNECT);
+
+  return 0;
+}
diff --git a/test/core/bad_client/tests/window_overflow.c b/test/core/bad_client/tests/window_overflow.c
deleted file mode 100644
index e4b5f97..0000000
--- a/test/core/bad_client/tests/window_overflow.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/bad_client/bad_client.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/lib/surface/server.h"
-
-#define PFX_STR                                                            \
-  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                                       \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */              \
-  "\x00\x00\xc9\x01\x04\x00\x00\x00\x01" /* headers: generated from        \
-                                            simple_request.headers in this \
-                                            directory */                   \
-  "\x10\x05:path\x08/foo/bar"                                              \
-  "\x10\x07:scheme\x04http"                                                \
-  "\x10\x07:method\x04POST"                                                \
-  "\x10\x0a:authority\x09localhost"                                        \
-  "\x10\x0c"                                                               \
-  "content-type\x10"                                                       \
-  "application/grpc"                                                       \
-  "\x10\x14grpc-accept-encoding\x15"                                       \
-  "deflate,identity,gzip"                                                  \
-  "\x10\x02te\x08trailers"                                                 \
-  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
-
-static void verifier(grpc_server *server, grpc_completion_queue *cq,
-                     void *registered_method) {
-  while (grpc_server_has_open_connections(server)) {
-    GPR_ASSERT(grpc_completion_queue_next(
-                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
-                   .type == GRPC_QUEUE_TIMEOUT);
-  }
-}
-
-char *g_buffer;
-size_t g_cap = 0;
-size_t g_count = 0;
-
-static void addbuf(const void *data, size_t len) {
-  if (g_count + len > g_cap) {
-    g_cap = GPR_MAX(g_count + len, g_cap * 2);
-    g_buffer = gpr_realloc(g_buffer, g_cap);
-  }
-  memcpy(g_buffer + g_count, data, len);
-  g_count += len;
-}
-
-int main(int argc, char **argv) {
-  int i, j;
-#define MAX_FRAME_SIZE 16384
-#define MESSAGES_PER_FRAME (MAX_FRAME_SIZE / 5)
-#define FRAME_SIZE (MESSAGES_PER_FRAME * 5)
-#define SEND_SIZE (6 * 1024 * 1024)
-#define NUM_FRAMES (SEND_SIZE / FRAME_SIZE + 1)
-  grpc_test_init(argc, argv);
-
-  addbuf(PFX_STR, sizeof(PFX_STR) - 1);
-  for (i = 0; i < NUM_FRAMES; i++) {
-    uint8_t hdr[9] = {(uint8_t)(FRAME_SIZE >> 16),
-                      (uint8_t)(FRAME_SIZE >> 8),
-                      (uint8_t)FRAME_SIZE,
-                      0,
-                      0,
-                      0,
-                      0,
-                      0,
-                      1};
-    addbuf(hdr, sizeof(hdr));
-    for (j = 0; j < MESSAGES_PER_FRAME; j++) {
-      uint8_t message[5] = {0, 0, 0, 0, 0};
-      addbuf(message, sizeof(message));
-    }
-  }
-  grpc_run_bad_client_test(verifier, NULL, g_buffer, g_count,
-                           GRPC_BAD_CLIENT_LARGE_REQUEST);
-  gpr_free(g_buffer);
-
-  return 0;
-}
diff --git a/test/core/bad_client/tests/window_overflow.cc b/test/core/bad_client/tests/window_overflow.cc
new file mode 100644
index 0000000..cb4b790
--- /dev/null
+++ b/test/core/bad_client/tests/window_overflow.cc
@@ -0,0 +1,98 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/bad_client/bad_client.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/lib/surface/server.h"
+
+#define PFX_STR                                                            \
+  "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"                                       \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */              \
+  "\x00\x00\xc9\x01\x04\x00\x00\x00\x01" /* headers: generated from        \
+                                            simple_request.headers in this \
+                                            directory */                   \
+  "\x10\x05:path\x08/foo/bar"                                              \
+  "\x10\x07:scheme\x04http"                                                \
+  "\x10\x07:method\x04POST"                                                \
+  "\x10\x0a:authority\x09localhost"                                        \
+  "\x10\x0c"                                                               \
+  "content-type\x10"                                                       \
+  "application/grpc"                                                       \
+  "\x10\x14grpc-accept-encoding\x15"                                       \
+  "deflate,identity,gzip"                                                  \
+  "\x10\x02te\x08trailers"                                                 \
+  "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)"
+
+static void verifier(grpc_server* server, grpc_completion_queue* cq,
+                     void* registered_method) {
+  while (grpc_server_has_open_connections(server)) {
+    GPR_ASSERT(grpc_completion_queue_next(
+                   cq, grpc_timeout_milliseconds_to_deadline(20), NULL)
+                   .type == GRPC_QUEUE_TIMEOUT);
+  }
+}
+
+char* g_buffer;
+size_t g_cap = 0;
+size_t g_count = 0;
+
+static void addbuf(const void* data, size_t len) {
+  if (g_count + len > g_cap) {
+    g_cap = GPR_MAX(g_count + len, g_cap * 2);
+    g_buffer = static_cast<char*>(gpr_realloc(g_buffer, g_cap));
+  }
+  memcpy(g_buffer + g_count, data, len);
+  g_count += len;
+}
+
+int main(int argc, char** argv) {
+  int i, j;
+#define MAX_FRAME_SIZE 16384
+#define MESSAGES_PER_FRAME (MAX_FRAME_SIZE / 5)
+#define FRAME_SIZE (MESSAGES_PER_FRAME * 5)
+#define SEND_SIZE (6 * 1024 * 1024)
+#define NUM_FRAMES (SEND_SIZE / FRAME_SIZE + 1)
+  grpc_test_init(argc, argv);
+
+  addbuf(PFX_STR, sizeof(PFX_STR) - 1);
+  for (i = 0; i < NUM_FRAMES; i++) {
+    uint8_t hdr[9] = {(uint8_t)(FRAME_SIZE >> 16),
+                      (uint8_t)(FRAME_SIZE >> 8),
+                      (uint8_t)FRAME_SIZE,
+                      0,
+                      0,
+                      0,
+                      0,
+                      0,
+                      1};
+    addbuf(hdr, sizeof(hdr));
+    for (j = 0; j < MESSAGES_PER_FRAME; j++) {
+      uint8_t message[5] = {0, 0, 0, 0, 0};
+      addbuf(message, sizeof(message));
+    }
+  }
+  grpc_run_bad_client_test(verifier, NULL, g_buffer, g_count,
+                           GRPC_BAD_CLIENT_LARGE_REQUEST);
+  gpr_free(g_buffer);
+
+  return 0;
+}
diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c
deleted file mode 100644
index 793627b..0000000
--- a/test/core/bad_ssl/bad_ssl_test.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/subprocess.h>
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void run_test(const char *target, size_t nops) {
-  grpc_channel_credentials *ssl_creds =
-      grpc_ssl_credentials_create(NULL, NULL, NULL);
-  grpc_channel *channel;
-  grpc_call *c;
-
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_slice details;
-  grpc_status_code status;
-  grpc_call_error error;
-  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-  cq_verifier *cqv = cq_verifier_create(cq);
-
-  grpc_op ops[6];
-  grpc_op *op;
-
-  grpc_arg ssl_name_override = {GRPC_ARG_STRING,
-                                GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
-                                {"foo.test.google.fr"}};
-  grpc_channel_args args;
-
-  args.num_args = 1;
-  args.args = &ssl_name_override;
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-
-  channel = grpc_secure_channel_create(ssl_creds, target, &args, NULL);
-  grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr:1234");
-  c = grpc_channel_create_call(channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-                               grpc_slice_from_static_string("/foo"), &host,
-                               deadline, NULL);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, nops, tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status != GRPC_STATUS_OK);
-
-  grpc_call_unref(c);
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-
-  grpc_channel_destroy(channel);
-  grpc_completion_queue_destroy(cq);
-  cq_verifier_destroy(cqv);
-  grpc_channel_credentials_release(ssl_creds);
-}
-
-int main(int argc, char **argv) {
-  char *me = argv[0];
-  char *lslash = strrchr(me, '/');
-  char *lunder = strrchr(me, '_');
-  char *tmp;
-  char root[1024];
-  char test[64];
-  int port = grpc_pick_unused_port_or_die();
-  char *args[10];
-  int status;
-  size_t i;
-  gpr_subprocess *svr;
-  /* figure out where we are */
-  if (lslash) {
-    memcpy(root, me, (size_t)(lslash - me));
-    root[lslash - me] = 0;
-  } else {
-    strcpy(root, ".");
-  }
-  if (argc == 2) {
-    gpr_setenv("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", argv[1]);
-  }
-  /* figure out our test name */
-  tmp = lunder - 1;
-  while (*tmp != '_') tmp--;
-  tmp++;
-  memcpy(test, tmp, (size_t)(lunder - tmp));
-  /* start the server */
-  gpr_asprintf(&args[0], "%s/bad_ssl_%s_server%s", root, test,
-               gpr_subprocess_binary_extension());
-  args[1] = "--bind";
-  gpr_join_host_port(&args[2], "::", port);
-  svr = gpr_subprocess_create(4, (const char **)args);
-  gpr_free(args[0]);
-
-  for (i = 3; i <= 4; i++) {
-    grpc_init();
-    run_test(args[2], i);
-    grpc_shutdown();
-  }
-  gpr_free(args[2]);
-
-  gpr_subprocess_interrupt(svr);
-  status = gpr_subprocess_join(svr);
-  gpr_subprocess_destroy(svr);
-  return status;
-}
diff --git a/test/core/bad_ssl/bad_ssl_test.cc b/test/core/bad_ssl/bad_ssl_test.cc
new file mode 100644
index 0000000..3cfa2a4
--- /dev/null
+++ b/test/core/bad_ssl/bad_ssl_test.cc
@@ -0,0 +1,161 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/subprocess.h>
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void run_test(const char* target, size_t nops) {
+  grpc_channel_credentials* ssl_creds =
+      grpc_ssl_credentials_create(NULL, NULL, NULL);
+  grpc_channel* channel;
+  grpc_call* c;
+
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_slice details;
+  grpc_status_code status;
+  grpc_call_error error;
+  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+  cq_verifier* cqv = cq_verifier_create(cq);
+
+  grpc_op ops[6];
+  grpc_op* op;
+
+  grpc_arg ssl_name_override = {
+      GRPC_ARG_STRING,
+      const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
+      {const_cast<char*>("foo.test.google.fr")}};
+  grpc_channel_args args;
+
+  args.num_args = 1;
+  args.args = &ssl_name_override;
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+
+  channel = grpc_secure_channel_create(ssl_creds, target, &args, NULL);
+  grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr:1234");
+  c = grpc_channel_create_call(channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+                               grpc_slice_from_static_string("/foo"), &host,
+                               deadline, NULL);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, nops, tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status != GRPC_STATUS_OK);
+
+  grpc_call_unref(c);
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+
+  grpc_channel_destroy(channel);
+  grpc_completion_queue_destroy(cq);
+  cq_verifier_destroy(cqv);
+  grpc_channel_credentials_release(ssl_creds);
+}
+
+int main(int argc, char** argv) {
+  char* me = argv[0];
+  char* lslash = strrchr(me, '/');
+  char* lunder = strrchr(me, '_');
+  char* tmp;
+  char root[1024];
+  char test[64];
+  int port = grpc_pick_unused_port_or_die();
+  char* args[10];
+  int status;
+  size_t i;
+  gpr_subprocess* svr;
+  /* figure out where we are */
+  if (lslash) {
+    memcpy(root, me, (size_t)(lslash - me));
+    root[lslash - me] = 0;
+  } else {
+    strcpy(root, ".");
+  }
+  if (argc == 2) {
+    gpr_setenv("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", argv[1]);
+  }
+  /* figure out our test name */
+  tmp = lunder - 1;
+  while (*tmp != '_') tmp--;
+  tmp++;
+  memcpy(test, tmp, (size_t)(lunder - tmp));
+  /* start the server */
+  gpr_asprintf(&args[0], "%s/bad_ssl_%s_server%s", root, test,
+               gpr_subprocess_binary_extension());
+  args[1] = const_cast<char*>("--bind");
+  gpr_join_host_port(&args[2], "::", port);
+  svr = gpr_subprocess_create(4, (const char**)args);
+  gpr_free(args[0]);
+
+  for (i = 3; i <= 4; i++) {
+    grpc_init();
+    run_test(args[2], i);
+    grpc_shutdown();
+  }
+  gpr_free(args[2]);
+
+  gpr_subprocess_interrupt(svr);
+  status = gpr_subprocess_join(svr);
+  gpr_subprocess_destroy(svr);
+  return status;
+}
diff --git a/test/core/bad_ssl/gen_build_yaml.py b/test/core/bad_ssl/gen_build_yaml.py
index 30fdb5e..6b78e9c 100755
--- a/test/core/bad_ssl/gen_build_yaml.py
+++ b/test/core/bad_ssl/gen_build_yaml.py
@@ -38,7 +38,7 @@
               'name': 'bad_ssl_test_server',
               'build': 'private',
               'language': 'c',
-              'src': ['test/core/bad_ssl/server_common.c'],
+              'src': ['test/core/bad_ssl/server_common.cc'],
               'headers': ['test/core/bad_ssl/server_common.h'],
               'vs_proj_dir': 'test',
               'platforms': ['linux', 'posix', 'mac'],
@@ -56,7 +56,7 @@
               'build': 'test',
               'language': 'c',
               'run': False,
-              'src': ['test/core/bad_ssl/servers/%s.c' % t],
+              'src': ['test/core/bad_ssl/servers/%s.cc' % t],
               'vs_proj_dir': 'test/bad_ssl',
               'platforms': ['linux', 'posix', 'mac'],
               'deps': [
@@ -73,7 +73,7 @@
               'cpu_cost': BAD_CLIENT_TESTS[t].cpu_cost,
               'build': 'test',
               'language': 'c',
-              'src': ['test/core/bad_ssl/bad_ssl_test.c'],
+              'src': ['test/core/bad_ssl/bad_ssl_test.cc'],
               'vs_proj_dir': 'test',
               'platforms': ['linux', 'posix', 'mac'],
               'deps': [
diff --git a/test/core/bad_ssl/generate_tests.bzl b/test/core/bad_ssl/generate_tests.bzl
index b61fabc..b7cb8f8 100755
--- a/test/core/bad_ssl/generate_tests.bzl
+++ b/test/core/bad_ssl/generate_tests.bzl
@@ -24,14 +24,14 @@
 def grpc_bad_ssl_tests():
   native.cc_library(
       name = 'bad_ssl_test_server',
-      srcs = ['server_common.c'],
+      srcs = ['server_common.cc'],
       hdrs = ['server_common.h'],
       deps = ['//test/core/util:grpc_test_util', '//:grpc', '//test/core/end2end:ssl_test_data']
   )
   for t in BAD_SSL_TESTS:
     native.cc_test(
         name = 'bad_ssl_%s_server' % t,
-        srcs = ['servers/%s.c' % t],
+        srcs = ['servers/%s.cc' % t],
         deps = [':bad_ssl_test_server'],
     )
 
diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c
deleted file mode 100644
index 0588d43..0000000
--- a/test/core/bad_ssl/server_common.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/cmdline.h>
-#include <grpc/support/log.h>
-#include <signal.h>
-
-#include "test/core/bad_ssl/server_common.h"
-#include "test/core/util/test_config.h"
-
-/* Common server implementation details for all servers in servers/.
- * There's nothing *wrong* with these servers per-se, but they are
- * configured to cause some failure case in the SSL connection path.
- */
-
-static int got_sigint = 0;
-
-static void sigint_handler(int x) { got_sigint = 1; }
-
-const char *bad_ssl_addr(int argc, char **argv) {
-  gpr_cmdline *cl;
-  char *addr = NULL;
-  cl = gpr_cmdline_create("test server");
-  gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr);
-  gpr_cmdline_parse(cl, argc, argv);
-  gpr_cmdline_destroy(cl);
-  GPR_ASSERT(addr);
-  return addr;
-}
-
-void bad_ssl_run(grpc_server *server) {
-  int shutdown_started = 0;
-  int shutdown_finished = 0;
-  grpc_event ev;
-  grpc_call_error error;
-  grpc_call *s = NULL;
-  grpc_call_details call_details;
-  grpc_metadata_array request_metadata_recv;
-
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-  grpc_completion_queue *shutdown_cq;
-
-  grpc_call_details_init(&call_details);
-  grpc_metadata_array_init(&request_metadata_recv);
-
-  grpc_server_register_completion_queue(server, cq, NULL);
-  grpc_server_start(server);
-
-  error = grpc_server_request_call(server, &s, &call_details,
-                                   &request_metadata_recv, cq, cq, (void *)1);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  signal(SIGINT, sigint_handler);
-  while (!shutdown_finished) {
-    if (got_sigint && !shutdown_started) {
-      gpr_log(GPR_INFO, "Shutting down due to SIGINT");
-      shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-      grpc_server_shutdown_and_notify(server, shutdown_cq, NULL);
-      GPR_ASSERT(
-          grpc_completion_queue_pluck(shutdown_cq, NULL,
-                                      grpc_timeout_seconds_to_deadline(5), NULL)
-              .type == GRPC_OP_COMPLETE);
-      grpc_completion_queue_destroy(shutdown_cq);
-      grpc_completion_queue_shutdown(cq);
-      shutdown_started = 1;
-    }
-    ev = grpc_completion_queue_next(
-        cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                         gpr_time_from_micros(1000000, GPR_TIMESPAN)),
-        NULL);
-    switch (ev.type) {
-      case GRPC_OP_COMPLETE:
-        GPR_ASSERT(ev.tag == (void *)1);
-        GPR_ASSERT(ev.success == 0);
-        break;
-      case GRPC_QUEUE_SHUTDOWN:
-        GPR_ASSERT(shutdown_started);
-        shutdown_finished = 1;
-        break;
-      case GRPC_QUEUE_TIMEOUT:
-        break;
-    }
-  }
-
-  GPR_ASSERT(s == NULL);
-  grpc_call_details_destroy(&call_details);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-}
diff --git a/test/core/bad_ssl/server_common.cc b/test/core/bad_ssl/server_common.cc
new file mode 100644
index 0000000..0110ed5
--- /dev/null
+++ b/test/core/bad_ssl/server_common.cc
@@ -0,0 +1,104 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/cmdline.h>
+#include <grpc/support/log.h>
+#include <signal.h>
+
+#include "test/core/bad_ssl/server_common.h"
+#include "test/core/util/test_config.h"
+
+/* Common server implementation details for all servers in servers/.
+ * There's nothing *wrong* with these servers per-se, but they are
+ * configured to cause some failure case in the SSL connection path.
+ */
+
+static int got_sigint = 0;
+
+static void sigint_handler(int x) { got_sigint = 1; }
+
+const char* bad_ssl_addr(int argc, char** argv) {
+  gpr_cmdline* cl;
+  const char* addr = NULL;
+  cl = gpr_cmdline_create("test server");
+  gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr);
+  gpr_cmdline_parse(cl, argc, argv);
+  gpr_cmdline_destroy(cl);
+  GPR_ASSERT(addr);
+  return addr;
+}
+
+void bad_ssl_run(grpc_server* server) {
+  int shutdown_started = 0;
+  int shutdown_finished = 0;
+  grpc_event ev;
+  grpc_call_error error;
+  grpc_call* s = NULL;
+  grpc_call_details call_details;
+  grpc_metadata_array request_metadata_recv;
+
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+  grpc_completion_queue* shutdown_cq;
+
+  grpc_call_details_init(&call_details);
+  grpc_metadata_array_init(&request_metadata_recv);
+
+  grpc_server_register_completion_queue(server, cq, NULL);
+  grpc_server_start(server);
+
+  error = grpc_server_request_call(server, &s, &call_details,
+                                   &request_metadata_recv, cq, cq, (void*)1);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  signal(SIGINT, sigint_handler);
+  while (!shutdown_finished) {
+    if (got_sigint && !shutdown_started) {
+      gpr_log(GPR_INFO, "Shutting down due to SIGINT");
+      shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+      grpc_server_shutdown_and_notify(server, shutdown_cq, NULL);
+      GPR_ASSERT(
+          grpc_completion_queue_pluck(shutdown_cq, NULL,
+                                      grpc_timeout_seconds_to_deadline(5), NULL)
+              .type == GRPC_OP_COMPLETE);
+      grpc_completion_queue_destroy(shutdown_cq);
+      grpc_completion_queue_shutdown(cq);
+      shutdown_started = 1;
+    }
+    ev = grpc_completion_queue_next(
+        cq,
+        gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                     gpr_time_from_micros(1000000, GPR_TIMESPAN)),
+        NULL);
+    switch (ev.type) {
+      case GRPC_OP_COMPLETE:
+        GPR_ASSERT(ev.tag == (void*)1);
+        GPR_ASSERT(ev.success == 0);
+        break;
+      case GRPC_QUEUE_SHUTDOWN:
+        GPR_ASSERT(shutdown_started);
+        shutdown_finished = 1;
+        break;
+      case GRPC_QUEUE_TIMEOUT:
+        break;
+    }
+  }
+
+  GPR_ASSERT(s == NULL);
+  grpc_call_details_destroy(&call_details);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+}
diff --git a/test/core/bad_ssl/server_common.h b/test/core/bad_ssl/server_common.h
index 35d51b1..e1933b9 100644
--- a/test/core/bad_ssl/server_common.h
+++ b/test/core/bad_ssl/server_common.h
@@ -21,7 +21,7 @@
 
 #include <grpc/grpc.h>
 
-const char *bad_ssl_addr(int argc, char **argv);
-void bad_ssl_run(grpc_server *server);
+const char* bad_ssl_addr(int argc, char** argv);
+void bad_ssl_run(grpc_server* server);
 
 #endif /* GRPC_TEST_CORE_BAD_SSL_SERVER_H */
diff --git a/test/core/bad_ssl/servers/alpn.c b/test/core/bad_ssl/servers/alpn.c
deleted file mode 100644
index 3179054..0000000
--- a/test/core/bad_ssl/servers/alpn.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/ext/transport/chttp2/alpn/alpn.h"
-#include "test/core/bad_ssl/server_common.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-
-/* This test starts a server that is configured to advertise (via alpn and npn)
- * a protocol that the connecting client does not support. It does this by
- * overriding the functions declared in alpn.c from the core library. */
-
-static const char *const fake_versions[] = {"not-h2"};
-
-int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size) {
-  size_t i;
-  for (i = 0; i < GPR_ARRAY_SIZE(fake_versions); i++) {
-    if (!strncmp(version, fake_versions[i], size)) return 1;
-  }
-  return 0;
-}
-
-size_t grpc_chttp2_num_alpn_versions(void) {
-  return GPR_ARRAY_SIZE(fake_versions);
-}
-
-const char *grpc_chttp2_get_alpn_version_index(size_t i) {
-  GPR_ASSERT(i < GPR_ARRAY_SIZE(fake_versions));
-  return fake_versions[i];
-}
-
-int main(int argc, char **argv) {
-  const char *addr = bad_ssl_addr(argc, argv);
-  grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
-                                                  test_server1_cert};
-  grpc_server_credentials *ssl_creds;
-  grpc_server *server;
-
-  grpc_init();
-  ssl_creds =
-      grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL);
-  server = grpc_server_create(NULL, NULL);
-  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
-  grpc_server_credentials_release(ssl_creds);
-
-  bad_ssl_run(server);
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/bad_ssl/servers/alpn.cc b/test/core/bad_ssl/servers/alpn.cc
new file mode 100644
index 0000000..a207516
--- /dev/null
+++ b/test/core/bad_ssl/servers/alpn.cc
@@ -0,0 +1,71 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/ext/transport/chttp2/alpn/alpn.h"
+#include "test/core/bad_ssl/server_common.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+
+/* This test starts a server that is configured to advertise (via alpn and npn)
+ * a protocol that the connecting client does not support. It does this by
+ * overriding the functions declared in alpn.c from the core library. */
+
+static const char* const fake_versions[] = {"not-h2"};
+
+int grpc_chttp2_is_alpn_version_supported(const char* version, size_t size) {
+  size_t i;
+  for (i = 0; i < GPR_ARRAY_SIZE(fake_versions); i++) {
+    if (!strncmp(version, fake_versions[i], size)) return 1;
+  }
+  return 0;
+}
+
+size_t grpc_chttp2_num_alpn_versions(void) {
+  return GPR_ARRAY_SIZE(fake_versions);
+}
+
+const char* grpc_chttp2_get_alpn_version_index(size_t i) {
+  GPR_ASSERT(i < GPR_ARRAY_SIZE(fake_versions));
+  return fake_versions[i];
+}
+
+int main(int argc, char** argv) {
+  const char* addr = bad_ssl_addr(argc, argv);
+  grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
+                                                  test_server1_cert};
+  grpc_server_credentials* ssl_creds;
+  grpc_server* server;
+
+  grpc_init();
+  ssl_creds =
+      grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL);
+  server = grpc_server_create(NULL, NULL);
+  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
+  grpc_server_credentials_release(ssl_creds);
+
+  bad_ssl_run(server);
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/bad_ssl/servers/cert.c b/test/core/bad_ssl/servers/cert.c
deleted file mode 100644
index a1f3048..0000000
--- a/test/core/bad_ssl/servers/cert.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/iomgr/load_file.h"
-
-#include "test/core/bad_ssl/server_common.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-
-/* This server will present an untrusted cert to the connecting client,
- * causing the SSL handshake to fail */
-
-int main(int argc, char **argv) {
-  const char *addr = bad_ssl_addr(argc, argv);
-  grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
-  grpc_server_credentials *ssl_creds;
-  grpc_server *server;
-  grpc_slice cert_slice, key_slice;
-
-  grpc_init();
-
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "load_file",
-      grpc_load_file("src/core/tsi/test_creds/badserver.pem", 1, &cert_slice)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "load_file",
-      grpc_load_file("src/core/tsi/test_creds/badserver.key", 1, &key_slice)));
-  pem_key_cert_pair.private_key = (const char *)GRPC_SLICE_START_PTR(key_slice);
-  pem_key_cert_pair.cert_chain = (const char *)GRPC_SLICE_START_PTR(cert_slice);
-
-  ssl_creds =
-      grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL);
-  server = grpc_server_create(NULL, NULL);
-  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
-  grpc_server_credentials_release(ssl_creds);
-
-  grpc_slice_unref(cert_slice);
-  grpc_slice_unref(key_slice);
-
-  bad_ssl_run(server);
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/bad_ssl/servers/cert.cc b/test/core/bad_ssl/servers/cert.cc
new file mode 100644
index 0000000..4a8ac93
--- /dev/null
+++ b/test/core/bad_ssl/servers/cert.cc
@@ -0,0 +1,65 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/iomgr/load_file.h"
+
+#include "test/core/bad_ssl/server_common.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+
+/* This server will present an untrusted cert to the connecting client,
+ * causing the SSL handshake to fail */
+
+int main(int argc, char** argv) {
+  const char* addr = bad_ssl_addr(argc, argv);
+  grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
+  grpc_server_credentials* ssl_creds;
+  grpc_server* server;
+  grpc_slice cert_slice, key_slice;
+
+  grpc_init();
+
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "load_file",
+      grpc_load_file("src/core/tsi/test_creds/badserver.pem", 1, &cert_slice)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "load_file",
+      grpc_load_file("src/core/tsi/test_creds/badserver.key", 1, &key_slice)));
+  pem_key_cert_pair.private_key = (const char*)GRPC_SLICE_START_PTR(key_slice);
+  pem_key_cert_pair.cert_chain = (const char*)GRPC_SLICE_START_PTR(cert_slice);
+
+  ssl_creds =
+      grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL);
+  server = grpc_server_create(NULL, NULL);
+  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
+  grpc_server_credentials_release(ssl_creds);
+
+  grpc_slice_unref(cert_slice);
+  grpc_slice_unref(key_slice);
+
+  bad_ssl_run(server);
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/census/BUILD b/test/core/census/BUILD
deleted file mode 100644
index 24fd280..0000000
--- a/test/core/census/BUILD
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
-
-grpc_package(name = "test/core/census")
-
-licenses(["notice"])  # Apache v2
-
-grpc_cc_test(
-    name = "context_test",
-    srcs = ["context_test.c"],
-    language = "C",
-    deps = [
-        "//:gpr",
-        "//:grpc",
-        "//test/core/util:gpr_test_util",
-        "//test/core/util:grpc_test_util",
-    ],
-)
-
-grpc_cc_test(
-    name = "mlog_test",
-    srcs = ["mlog_test.c"],
-    language = "C",
-    deps = [
-        "//:gpr",
-        "//:grpc",
-        "//test/core/util:gpr_test_util",
-        "//test/core/util:grpc_test_util",
-    ],
-)
-
-grpc_cc_test(
-    name = "resource_test",
-    srcs = ["resource_test.c"],
-    language = "C",
-    data = [
-        ":data/resource_empty_name.pb",
-        ":data/resource_full.pb",
-        ":data/resource_minimal_good.pb",
-        ":data/resource_no_name.pb",
-        ":data/resource_no_numerator.pb",
-        ":data/resource_no_unit.pb",
-    ],
-    deps = [
-        "//:gpr",
-        "//:grpc",
-        "//test/core/util:gpr_test_util",
-        "//test/core/util:grpc_test_util",
-    ],
-)
-
-grpc_cc_test(
-    name = "trace_context_test",
-    srcs = ["trace_context_test.c"],
-    language = "C",
-    data = [
-        ":data/context_empty.pb",
-        ":data/context_full.pb",
-        ":data/context_no_span_options.pb",
-        ":data/context_span_only.pb",
-        ":data/context_trace_only.pb",
-    ],
-    deps = [
-        "//:gpr",
-        "//:grpc",
-        "//test/core/util:gpr_test_util",
-        "//test/core/util:grpc_test_util",
-    ],
-)
diff --git a/test/core/census/README b/test/core/census/README
deleted file mode 100644
index d5363b7..0000000
--- a/test/core/census/README
+++ /dev/null
@@ -1,7 +0,0 @@
-Test source and data files for Census.
-
-binary proto files (*.pb) in data directory are generated from the *.txt file,
-via:
-
-BASE="filename"
-cat $BASE.txt | protoc --encode=google.census.Resource census.proto > $BASE.pb
diff --git a/test/core/census/context_test.c b/test/core/census/context_test.c
deleted file mode 100644
index ca5a6ec..0000000
--- a/test/core/census/context_test.c
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// Test census_context functions, including encoding/decoding
-
-#include <grpc/census.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "test/core/util/test_config.h"
-
-// A set of tags Used to create a basic context for testing. Note that
-// replace_add_delete_test() relies on specific offsets into this array - if
-// you add or delete entries, you will also need to change the test.
-#define BASIC_TAG_COUNT 8
-static census_tag basic_tags[BASIC_TAG_COUNT] = {
-    /* 0 */ {"key0", "tag value", 0},
-    /* 1 */ {"k1", "a", CENSUS_TAG_PROPAGATE},
-    /* 2 */ {"k2", "a longer tag value supercalifragilisticexpialiadocious",
-             CENSUS_TAG_STATS},
-    /* 3 */ {"key_three", "", 0},
-    /* 4 */ {"a_really_really_really_really_long_key_4", "random",
-             CENSUS_TAG_PROPAGATE | CENSUS_TAG_STATS},
-    /* 5 */ {"k5", "v5", CENSUS_TAG_PROPAGATE},
-    /* 6 */ {"k6", "v6", CENSUS_TAG_STATS},
-    /* 7 */ {"k7", "v7", CENSUS_TAG_PROPAGATE | CENSUS_TAG_STATS}};
-
-// Set of tags used to modify the basic context. Note that
-// replace_add_delete_test() relies on specific offsets into this array - if
-// you add or delete entries, you will also need to change the test. Other
-// tests that rely on specific instances have XXX_XXX_OFFSET definitions (also
-// change the defines below if you add/delete entires).
-#define MODIFY_TAG_COUNT 10
-static census_tag modify_tags[MODIFY_TAG_COUNT] = {
-#define REPLACE_VALUE_OFFSET 0
-    /* 0 */ {"key0", "replace key0", 0},  // replaces tag value only
-#define ADD_TAG_OFFSET 1
-    /* 1 */ {"new_key", "xyzzy", CENSUS_TAG_STATS},  // new tag
-#define DELETE_TAG_OFFSET 2
-    /* 2 */ {"k5", NULL, 0},            // should delete tag
-    /* 3 */ {"k5", NULL, 0},            // try deleting already-deleted tag
-    /* 4 */ {"non-existent", NULL, 0},  // delete non-existent tag
-#define REPLACE_FLAG_OFFSET 5
-    /* 5 */ {"k1", "a", 0},                    // change flags only
-    /* 6 */ {"k7", "bar", CENSUS_TAG_STATS},   // change flags and value
-    /* 7 */ {"k2", "", CENSUS_TAG_PROPAGATE},  // more value and flags change
-    /* 8 */ {"k5", "bar", 0},  // add back tag, with different value
-    /* 9 */ {"foo", "bar", CENSUS_TAG_PROPAGATE},  // another new tag
-};
-
-// Utility function to compare tags. Returns true if all fields match.
-static bool compare_tag(const census_tag *t1, const census_tag *t2) {
-  return (strcmp(t1->key, t2->key) == 0 && strcmp(t1->value, t2->value) == 0 &&
-          t1->flags == t2->flags);
-}
-
-// Utility function to validate a tag exists in context.
-static bool validate_tag(const census_context *context, const census_tag *tag) {
-  census_tag tag2;
-  if (census_context_get_tag(context, tag->key, &tag2) != 1) return false;
-  return compare_tag(tag, &tag2);
-}
-
-// Create an empty context.
-static void empty_test(void) {
-  struct census_context *context = census_context_create(NULL, NULL, 0, NULL);
-  GPR_ASSERT(context != NULL);
-  const census_context_status *status = census_context_get_status(context);
-  census_context_status expected = {0, 0, 0, 0, 0, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_context_destroy(context);
-}
-
-// Test create and iteration over basic context.
-static void basic_test(void) {
-  const census_context_status *status;
-  struct census_context *context =
-      census_context_create(NULL, basic_tags, BASIC_TAG_COUNT, &status);
-  census_context_status expected = {4, 4, 0, 8, 0, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_context_iterator it;
-  census_context_initialize_iterator(context, &it);
-  census_tag tag;
-  while (census_context_next_tag(&it, &tag)) {
-    // can't rely on tag return order: make sure it matches exactly one.
-    int matches = 0;
-    for (int i = 0; i < BASIC_TAG_COUNT; i++) {
-      if (compare_tag(&tag, &basic_tags[i])) matches++;
-    }
-    GPR_ASSERT(matches == 1);
-  }
-  census_context_destroy(context);
-}
-
-// Test census_context_get_tag().
-static void lookup_by_key_test(void) {
-  struct census_context *context =
-      census_context_create(NULL, basic_tags, BASIC_TAG_COUNT, NULL);
-  census_tag tag;
-  for (int i = 0; i < BASIC_TAG_COUNT; i++) {
-    GPR_ASSERT(census_context_get_tag(context, basic_tags[i].key, &tag) == 1);
-    GPR_ASSERT(compare_tag(&tag, &basic_tags[i]));
-  }
-  // non-existent keys
-  GPR_ASSERT(census_context_get_tag(context, "key", &tag) == 0);
-  GPR_ASSERT(census_context_get_tag(context, "key01", &tag) == 0);
-  GPR_ASSERT(census_context_get_tag(context, "k9", &tag) == 0);
-  GPR_ASSERT(census_context_get_tag(context, "random", &tag) == 0);
-  GPR_ASSERT(census_context_get_tag(context, "", &tag) == 0);
-  census_context_destroy(context);
-}
-
-// Try creating context with invalid entries.
-static void invalid_test(void) {
-  char key[300];
-  memset(key, 'k', 299);
-  key[299] = 0;
-  char value[300];
-  memset(value, 'v', 299);
-  value[299] = 0;
-  census_tag tag = {key, value, 0};
-  // long keys, short value. Key lengths (including terminator) should be
-  // <= 255 (CENSUS_MAX_TAG_KV_LEN)
-  value[3] = 0;
-  GPR_ASSERT(strlen(value) == 3);
-  GPR_ASSERT(strlen(key) == 299);
-  const census_context_status *status;
-  struct census_context *context =
-      census_context_create(NULL, &tag, 1, &status);
-  census_context_status expected = {0, 0, 0, 0, 0, 1, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_context_destroy(context);
-  key[CENSUS_MAX_TAG_KV_LEN] = 0;
-  GPR_ASSERT(strlen(key) == CENSUS_MAX_TAG_KV_LEN);
-  context = census_context_create(NULL, &tag, 1, &status);
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_context_destroy(context);
-  key[CENSUS_MAX_TAG_KV_LEN - 1] = 0;
-  GPR_ASSERT(strlen(key) == CENSUS_MAX_TAG_KV_LEN - 1);
-  context = census_context_create(NULL, &tag, 1, &status);
-  census_context_status expected2 = {0, 1, 0, 1, 0, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected2, sizeof(expected2)) == 0);
-  census_context_destroy(context);
-  // now try with long values
-  value[3] = 'v';
-  GPR_ASSERT(strlen(value) == 299);
-  context = census_context_create(NULL, &tag, 1, &status);
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_context_destroy(context);
-  value[CENSUS_MAX_TAG_KV_LEN] = 0;
-  GPR_ASSERT(strlen(value) == CENSUS_MAX_TAG_KV_LEN);
-  context = census_context_create(NULL, &tag, 1, &status);
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_context_destroy(context);
-  value[CENSUS_MAX_TAG_KV_LEN - 1] = 0;
-  GPR_ASSERT(strlen(value) == CENSUS_MAX_TAG_KV_LEN - 1);
-  context = census_context_create(NULL, &tag, 1, &status);
-  GPR_ASSERT(memcmp(status, &expected2, sizeof(expected2)) == 0);
-  census_context_destroy(context);
-  // 0 length key.
-  key[0] = 0;
-  GPR_ASSERT(strlen(key) == 0);
-  context = census_context_create(NULL, &tag, 1, &status);
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_context_destroy(context);
-  // invalid key character
-  key[0] = 31;  // 32 (' ') is the first valid character value
-  key[1] = 0;
-  GPR_ASSERT(strlen(key) == 1);
-  context = census_context_create(NULL, &tag, 1, &status);
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_context_destroy(context);
-  // invalid value character
-  key[0] = ' ';
-  value[5] = 127;  // 127 (DEL) is ('~' + 1)
-  value[8] = 0;
-  GPR_ASSERT(strlen(key) == 1);
-  GPR_ASSERT(strlen(value) == 8);
-  context = census_context_create(NULL, &tag, 1, &status);
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_context_destroy(context);
-}
-
-// Make a copy of a context
-static void copy_test(void) {
-  struct census_context *context =
-      census_context_create(NULL, basic_tags, BASIC_TAG_COUNT, NULL);
-  const census_context_status *status;
-  struct census_context *context2 =
-      census_context_create(context, NULL, 0, &status);
-  census_context_status expected = {4, 4, 0, 0, 0, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  for (int i = 0; i < BASIC_TAG_COUNT; i++) {
-    census_tag tag;
-    GPR_ASSERT(census_context_get_tag(context2, basic_tags[i].key, &tag) == 1);
-    GPR_ASSERT(compare_tag(&tag, &basic_tags[i]));
-  }
-  census_context_destroy(context);
-  census_context_destroy(context2);
-}
-
-// replace a single tag value
-static void replace_value_test(void) {
-  struct census_context *context =
-      census_context_create(NULL, basic_tags, BASIC_TAG_COUNT, NULL);
-  const census_context_status *status;
-  struct census_context *context2 = census_context_create(
-      context, modify_tags + REPLACE_VALUE_OFFSET, 1, &status);
-  census_context_status expected = {4, 4, 0, 0, 1, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_tag tag;
-  GPR_ASSERT(census_context_get_tag(
-                 context2, modify_tags[REPLACE_VALUE_OFFSET].key, &tag) == 1);
-  GPR_ASSERT(compare_tag(&tag, &modify_tags[REPLACE_VALUE_OFFSET]));
-  census_context_destroy(context);
-  census_context_destroy(context2);
-}
-
-// replace a single tags flags
-static void replace_flags_test(void) {
-  struct census_context *context =
-      census_context_create(NULL, basic_tags, BASIC_TAG_COUNT, NULL);
-  const census_context_status *status;
-  struct census_context *context2 = census_context_create(
-      context, modify_tags + REPLACE_FLAG_OFFSET, 1, &status);
-  census_context_status expected = {3, 5, 0, 0, 1, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_tag tag;
-  GPR_ASSERT(census_context_get_tag(
-                 context2, modify_tags[REPLACE_FLAG_OFFSET].key, &tag) == 1);
-  GPR_ASSERT(compare_tag(&tag, &modify_tags[REPLACE_FLAG_OFFSET]));
-  census_context_destroy(context);
-  census_context_destroy(context2);
-}
-
-// delete a single tag.
-static void delete_tag_test(void) {
-  struct census_context *context =
-      census_context_create(NULL, basic_tags, BASIC_TAG_COUNT, NULL);
-  const census_context_status *status;
-  struct census_context *context2 = census_context_create(
-      context, modify_tags + DELETE_TAG_OFFSET, 1, &status);
-  census_context_status expected = {3, 4, 1, 0, 0, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_tag tag;
-  GPR_ASSERT(census_context_get_tag(
-                 context2, modify_tags[DELETE_TAG_OFFSET].key, &tag) == 0);
-  census_context_destroy(context);
-  census_context_destroy(context2);
-}
-
-// add a single new tag.
-static void add_tag_test(void) {
-  struct census_context *context =
-      census_context_create(NULL, basic_tags, BASIC_TAG_COUNT, NULL);
-  const census_context_status *status;
-  struct census_context *context2 =
-      census_context_create(context, modify_tags + ADD_TAG_OFFSET, 1, &status);
-  census_context_status expected = {4, 5, 0, 1, 0, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  census_tag tag;
-  GPR_ASSERT(census_context_get_tag(context2, modify_tags[ADD_TAG_OFFSET].key,
-                                    &tag) == 1);
-  GPR_ASSERT(compare_tag(&tag, &modify_tags[ADD_TAG_OFFSET]));
-  census_context_destroy(context);
-  census_context_destroy(context2);
-}
-
-// test many changes at once.
-static void replace_add_delete_test(void) {
-  struct census_context *context =
-      census_context_create(NULL, basic_tags, BASIC_TAG_COUNT, NULL);
-  const census_context_status *status;
-  struct census_context *context2 =
-      census_context_create(context, modify_tags, MODIFY_TAG_COUNT, &status);
-  census_context_status expected = {3, 7, 1, 3, 4, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  // validate context contents. Use specific indices into the two arrays
-  // holding tag values.
-  GPR_ASSERT(validate_tag(context2, &basic_tags[3]));
-  GPR_ASSERT(validate_tag(context2, &basic_tags[4]));
-  GPR_ASSERT(validate_tag(context2, &basic_tags[6]));
-  GPR_ASSERT(validate_tag(context2, &modify_tags[0]));
-  GPR_ASSERT(validate_tag(context2, &modify_tags[1]));
-  GPR_ASSERT(validate_tag(context2, &modify_tags[5]));
-  GPR_ASSERT(validate_tag(context2, &modify_tags[6]));
-  GPR_ASSERT(validate_tag(context2, &modify_tags[7]));
-  GPR_ASSERT(validate_tag(context2, &modify_tags[8]));
-  GPR_ASSERT(validate_tag(context2, &modify_tags[9]));
-  GPR_ASSERT(!validate_tag(context2, &basic_tags[0]));
-  GPR_ASSERT(!validate_tag(context2, &basic_tags[1]));
-  GPR_ASSERT(!validate_tag(context2, &basic_tags[2]));
-  GPR_ASSERT(!validate_tag(context2, &basic_tags[5]));
-  GPR_ASSERT(!validate_tag(context2, &basic_tags[7]));
-  census_context_destroy(context);
-  census_context_destroy(context2);
-}
-
-#define BUF_SIZE 200
-
-// test encode/decode.
-static void encode_decode_test(void) {
-  char buffer[BUF_SIZE];
-  struct census_context *context =
-      census_context_create(NULL, basic_tags, BASIC_TAG_COUNT, NULL);
-  // Test with too small a buffer
-  GPR_ASSERT(census_context_encode(context, buffer, 2) == 0);
-  // Test with sufficient buffer
-  size_t buf_used = census_context_encode(context, buffer, BUF_SIZE);
-  GPR_ASSERT(buf_used != 0);
-  census_context *context2 = census_context_decode(buffer, buf_used);
-  GPR_ASSERT(context2 != NULL);
-  const census_context_status *status = census_context_get_status(context2);
-  census_context_status expected = {4, 0, 0, 0, 0, 0, 0};
-  GPR_ASSERT(memcmp(status, &expected, sizeof(expected)) == 0);
-  for (int i = 0; i < BASIC_TAG_COUNT; i++) {
-    census_tag tag;
-    if (CENSUS_TAG_IS_PROPAGATED(basic_tags[i].flags)) {
-      GPR_ASSERT(census_context_get_tag(context2, basic_tags[i].key, &tag) ==
-                 1);
-      GPR_ASSERT(compare_tag(&tag, &basic_tags[i]));
-    } else {
-      GPR_ASSERT(census_context_get_tag(context2, basic_tags[i].key, &tag) ==
-                 0);
-    }
-  }
-  census_context_destroy(context2);
-  census_context_destroy(context);
-}
-
-int main(int argc, char *argv[]) {
-  grpc_test_init(argc, argv);
-  empty_test();
-  basic_test();
-  lookup_by_key_test();
-  invalid_test();
-  copy_test();
-  replace_value_test();
-  replace_flags_test();
-  delete_tag_test();
-  add_tag_test();
-  replace_add_delete_test();
-  encode_decode_test();
-  return 0;
-}
diff --git a/test/core/census/data/context_empty.pb b/test/core/census/data/context_empty.pb
deleted file mode 100644
index e69de29..0000000
--- a/test/core/census/data/context_empty.pb
+++ /dev/null
diff --git a/test/core/census/data/context_empty.txt b/test/core/census/data/context_empty.txt
deleted file mode 100644
index e69de29..0000000
--- a/test/core/census/data/context_empty.txt
+++ /dev/null
diff --git a/test/core/census/data/context_full.pb b/test/core/census/data/context_full.pb
deleted file mode 100644
index 7b5895c..0000000
--- a/test/core/census/data/context_full.pb
+++ /dev/null
Binary files differ
diff --git a/test/core/census/data/context_full.txt b/test/core/census/data/context_full.txt
deleted file mode 100644
index 7d8df37..0000000
--- a/test/core/census/data/context_full.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-trace_id_hi : 5
-trace_id_lo : 1
-span_id : 7
-span_options : 1
diff --git a/test/core/census/data/context_no_span_options.pb b/test/core/census/data/context_no_span_options.pb
deleted file mode 100644
index 4b3425a..0000000
--- a/test/core/census/data/context_no_span_options.pb
+++ /dev/null
Binary files differ
diff --git a/test/core/census/data/context_no_span_options.txt b/test/core/census/data/context_no_span_options.txt
deleted file mode 100644
index 4c8398f..0000000
--- a/test/core/census/data/context_no_span_options.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-trace_id_hi : 5
-trace_id_lo : 1
-span_id : 7
diff --git a/test/core/census/data/context_span_only.pb b/test/core/census/data/context_span_only.pb
deleted file mode 100644
index a9315be..0000000
--- a/test/core/census/data/context_span_only.pb
+++ /dev/null
Binary files differ
diff --git a/test/core/census/data/context_span_only.txt b/test/core/census/data/context_span_only.txt
deleted file mode 100644
index 4e473fc..0000000
--- a/test/core/census/data/context_span_only.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-span_id : 7
-span_options : 1
diff --git a/test/core/census/data/context_trace_only.pb b/test/core/census/data/context_trace_only.pb
deleted file mode 100644
index aabb325..0000000
--- a/test/core/census/data/context_trace_only.pb
+++ /dev/null
Binary files differ
diff --git a/test/core/census/data/context_trace_only.txt b/test/core/census/data/context_trace_only.txt
deleted file mode 100644
index e48a6d7..0000000
--- a/test/core/census/data/context_trace_only.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-trace_id_hi : 5
-trace_id_lo : 1
-span_options : 1
diff --git a/test/core/census/data/resource_empty_name.pb b/test/core/census/data/resource_empty_name.pb
deleted file mode 100644
index 4d54744..0000000
--- a/test/core/census/data/resource_empty_name.pb
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/test/core/census/data/resource_empty_name.txt b/test/core/census/data/resource_empty_name.txt
deleted file mode 100644
index 271fd32..0000000
--- a/test/core/census/data/resource_empty_name.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Name is present, but empty.
-name : ''
-unit {
-  numerator : SECS
-}
diff --git a/test/core/census/data/resource_full.pb b/test/core/census/data/resource_full.pb
deleted file mode 100644
index e4c6a2a..0000000
--- a/test/core/census/data/resource_full.pb
+++ /dev/null
Binary files differ
diff --git a/test/core/census/data/resource_full.txt b/test/core/census/data/resource_full.txt
deleted file mode 100644
index 1aa2faf..0000000
--- a/test/core/census/data/resource_full.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# A full resource definition - all fields filled out.
-name : 'full_resource'
-description : 'A resource with everything defined'
-unit {
-  # Megabits per second.
-  prefix : 6
-  numerator : BITS
-  denominator : SECS
-}
diff --git a/test/core/census/data/resource_minimal_good.pb b/test/core/census/data/resource_minimal_good.pb
deleted file mode 100644
index 7100c46..0000000
--- a/test/core/census/data/resource_minimal_good.pb
+++ /dev/null
@@ -1,2 +0,0 @@
-
-minimal_good
\ No newline at end of file
diff --git a/test/core/census/data/resource_minimal_good.txt b/test/core/census/data/resource_minimal_good.txt
deleted file mode 100644
index a7a7e71..0000000
--- a/test/core/census/data/resource_minimal_good.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# A minimal "good" Resource definition: has a name and numerator/unit.
-name : 'minimal_good'
-unit {
-  numerator : SECS
-}
diff --git a/test/core/census/data/resource_no_name.pb b/test/core/census/data/resource_no_name.pb
deleted file mode 100644
index 4d54744..0000000
--- a/test/core/census/data/resource_no_name.pb
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/test/core/census/data/resource_no_name.txt b/test/core/census/data/resource_no_name.txt
deleted file mode 100644
index 8f12a91..0000000
--- a/test/core/census/data/resource_no_name.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# The minimal good Resource without a name.
-unit {
-  numerator : SECS
-}
diff --git a/test/core/census/data/resource_no_numerator.pb b/test/core/census/data/resource_no_numerator.pb
deleted file mode 100644
index 2a5ccee..0000000
--- a/test/core/census/data/resource_no_numerator.pb
+++ /dev/null
@@ -1,2 +0,0 @@
-
-resource_no_numeratorýÿÿÿÿÿÿÿÿ
\ No newline at end of file
diff --git a/test/core/census/data/resource_no_numerator.txt b/test/core/census/data/resource_no_numerator.txt
deleted file mode 100644
index fc1fec7..0000000
--- a/test/core/census/data/resource_no_numerator.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# Resource without a numerator
-name : 'resource_no_numerator'
-unit {
-  prefix : -3
-  denominator : SECS
-}
diff --git a/test/core/census/data/resource_no_unit.pb b/test/core/census/data/resource_no_unit.pb
deleted file mode 100644
index 9dca262..0000000
--- a/test/core/census/data/resource_no_unit.pb
+++ /dev/null
@@ -1,2 +0,0 @@
-
-resource_no_unit
\ No newline at end of file
diff --git a/test/core/census/data/resource_no_unit.txt b/test/core/census/data/resource_no_unit.txt
deleted file mode 100644
index c5d5115..0000000
--- a/test/core/census/data/resource_no_unit.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-# The minimal good resource without a unit
-name : 'resource_no_unit'
diff --git a/test/core/census/intrusive_hash_map_test.c b/test/core/census/intrusive_hash_map_test.c
deleted file mode 100644
index 0826b55..0000000
--- a/test/core/census/intrusive_hash_map_test.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/intrusive_hash_map.h"
-
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-#include "test/core/util/test_config.h"
-
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* The initial size of an intrusive hash map will be 2 to this power. */
-static const uint32_t kInitialLog2Size = 4;
-
-/* Simple object used for testing intrusive_hash_map. */
-typedef struct object { uint64_t val; } object;
-
-/* Helper function to allocate and initialize object. */
-static __inline object *make_new_object(uint64_t val) {
-  object *obj = (object *)gpr_malloc(sizeof(object));
-  obj->val = val;
-  return obj;
-}
-
-/* Wrapper struct for object. */
-typedef struct ptr_item {
-  INTRUSIVE_HASH_MAP_HEADER;
-  object *obj;
-} ptr_item;
-
-/* Helper function that creates a new hash map item.  It is up to the user to
- * free the item that was allocated. */
-static __inline ptr_item *make_ptr_item(uint64_t key, uint64_t value) {
-  ptr_item *new_item = (ptr_item *)gpr_malloc(sizeof(ptr_item));
-  new_item->IHM_key = key;
-  new_item->IHM_hash_link = NULL;
-  new_item->obj = make_new_object(value);
-  return new_item;
-}
-
-/* Helper function to deallocate ptr_item. */
-static void free_ptr_item(void *ptr) { gpr_free(((ptr_item *)ptr)->obj); }
-
-/* Simple string object used for testing intrusive_hash_map. */
-typedef struct string_item {
-  INTRUSIVE_HASH_MAP_HEADER;
-  // User data.
-  char buf[32];
-  uint16_t len;
-} string_item;
-
-/* Helper function to allocate and initialize string object. */
-static string_item *make_string_item(uint64_t key, const char *buf,
-                                     uint16_t len) {
-  string_item *item = (string_item *)gpr_malloc(sizeof(string_item));
-  item->IHM_key = key;
-  item->IHM_hash_link = NULL;
-  item->len = len;
-  memcpy(item->buf, buf, sizeof(char) * len);
-  return item;
-}
-
-/* Helper function for comparing two string objects. */
-static bool compare_string_item(const string_item *A, const string_item *B) {
-  if (A->IHM_key != B->IHM_key || A->len != B->len)
-    return false;
-  else {
-    for (int i = 0; i < A->len; ++i) {
-      if (A->buf[i] != B->buf[i]) return false;
-    }
-  }
-
-  return true;
-}
-
-void test_empty() {
-  intrusive_hash_map hash_map;
-  intrusive_hash_map_init(&hash_map, kInitialLog2Size);
-  GPR_ASSERT(0 == intrusive_hash_map_size(&hash_map));
-  GPR_ASSERT(intrusive_hash_map_empty(&hash_map));
-  intrusive_hash_map_free(&hash_map, NULL);
-}
-
-void test_single_item() {
-  intrusive_hash_map hash_map;
-  intrusive_hash_map_init(&hash_map, kInitialLog2Size);
-
-  ptr_item *new_item = make_ptr_item(10, 20);
-  bool ok = intrusive_hash_map_insert(&hash_map, (hm_item *)new_item);
-  GPR_ASSERT(ok);
-
-  ptr_item *item1 =
-      (ptr_item *)intrusive_hash_map_find(&hash_map, (uint64_t)10);
-  GPR_ASSERT(item1->obj->val == 20);
-  GPR_ASSERT(item1 == new_item);
-
-  ptr_item *item2 =
-      (ptr_item *)intrusive_hash_map_erase(&hash_map, (uint64_t)10);
-  GPR_ASSERT(item2 == new_item);
-
-  gpr_free(new_item->obj);
-  gpr_free(new_item);
-  GPR_ASSERT(0 == intrusive_hash_map_size(&hash_map));
-  intrusive_hash_map_free(&hash_map, &free_ptr_item);
-}
-
-void test_two_items() {
-  intrusive_hash_map hash_map;
-  intrusive_hash_map_init(&hash_map, kInitialLog2Size);
-
-  string_item *new_item1 = make_string_item(10, "test1", 5);
-  bool ok = intrusive_hash_map_insert(&hash_map, (hm_item *)new_item1);
-  GPR_ASSERT(ok);
-  string_item *new_item2 = make_string_item(20, "test2", 5);
-  ok = intrusive_hash_map_insert(&hash_map, (hm_item *)new_item2);
-  GPR_ASSERT(ok);
-
-  string_item *item1 =
-      (string_item *)intrusive_hash_map_find(&hash_map, (uint64_t)10);
-  GPR_ASSERT(compare_string_item(new_item1, item1));
-  GPR_ASSERT(item1 == new_item1);
-  string_item *item2 =
-      (string_item *)intrusive_hash_map_find(&hash_map, (uint64_t)20);
-  GPR_ASSERT(compare_string_item(new_item2, item2));
-  GPR_ASSERT(item2 == new_item2);
-
-  item1 = (string_item *)intrusive_hash_map_erase(&hash_map, (uint64_t)10);
-  GPR_ASSERT(item1 == new_item1);
-  item2 = (string_item *)intrusive_hash_map_erase(&hash_map, (uint64_t)20);
-  GPR_ASSERT(item2 == new_item2);
-
-  gpr_free(new_item1);
-  gpr_free(new_item2);
-  GPR_ASSERT(0 == intrusive_hash_map_size(&hash_map));
-  intrusive_hash_map_free(&hash_map, NULL);
-}
-
-// Test resetting and clearing the hash map.
-void test_reset_clear() {
-  intrusive_hash_map hash_map;
-  intrusive_hash_map_init(&hash_map, kInitialLog2Size);
-
-  // Add some data to the hash_map.
-  for (uint64_t i = 0; i < 3; ++i) {
-    intrusive_hash_map_insert(&hash_map, (hm_item *)make_ptr_item(i, i));
-  }
-  GPR_ASSERT(3 == intrusive_hash_map_size(&hash_map));
-
-  // Test find.
-  for (uint64_t i = 0; i < 3; ++i) {
-    ptr_item *item = (ptr_item *)intrusive_hash_map_find(&hash_map, i);
-    GPR_ASSERT(item != NULL);
-    GPR_ASSERT(item->IHM_key == i && item->obj->val == i);
-  }
-
-  intrusive_hash_map_clear(&hash_map, &free_ptr_item);
-  GPR_ASSERT(intrusive_hash_map_empty(&hash_map));
-  intrusive_hash_map_free(&hash_map, &free_ptr_item);
-}
-
-// Check that the hash_map contains every key between [min_value, max_value]
-// (inclusive).
-void check_hash_map_values(intrusive_hash_map *hash_map, uint64_t min_value,
-                           uint64_t max_value) {
-  GPR_ASSERT(intrusive_hash_map_size(hash_map) == max_value - min_value + 1);
-
-  for (uint64_t i = min_value; i <= max_value; ++i) {
-    ptr_item *item = (ptr_item *)intrusive_hash_map_find(hash_map, i);
-    GPR_ASSERT(item != NULL);
-    GPR_ASSERT(item->obj->val == i);
-  }
-}
-
-// Add many items and cause the hash_map to extend.
-void test_extend() {
-  intrusive_hash_map hash_map;
-  intrusive_hash_map_init(&hash_map, kInitialLog2Size);
-
-  const uint64_t kNumValues = (1 << 16);
-
-  for (uint64_t i = 0; i < kNumValues; ++i) {
-    ptr_item *item = make_ptr_item(i, i);
-    bool ok = intrusive_hash_map_insert(&hash_map, (hm_item *)item);
-    GPR_ASSERT(ok);
-    if (i % 1000 == 0) {
-      check_hash_map_values(&hash_map, 0, i);
-    }
-  }
-
-  for (uint64_t i = 0; i < kNumValues; ++i) {
-    ptr_item *item = (ptr_item *)intrusive_hash_map_find(&hash_map, i);
-    GPR_ASSERT(item != NULL);
-    GPR_ASSERT(item->IHM_key == i && item->obj->val == i);
-    ptr_item *item2 = (ptr_item *)intrusive_hash_map_erase(&hash_map, i);
-    GPR_ASSERT(item == item2);
-    gpr_free(item->obj);
-    gpr_free(item);
-  }
-
-  GPR_ASSERT(intrusive_hash_map_empty(&hash_map));
-  intrusive_hash_map_free(&hash_map, &free_ptr_item);
-}
-
-void test_stress() {
-  intrusive_hash_map hash_map;
-  intrusive_hash_map_init(&hash_map, kInitialLog2Size);
-  size_t n = 0;
-
-  // Randomly add and insert entries 1000000 times.
-  for (uint64_t i = 0; i < 1000000; ++i) {
-    int op = rand() & 0x1;
-
-    switch (op) {
-      // Case 0 is insertion of entry.
-      case 0: {
-        uint64_t key = (uint64_t)(rand() % 10000);
-        ptr_item *item = make_ptr_item(key, key);
-        bool ok = intrusive_hash_map_insert(&hash_map, (hm_item *)item);
-        if (ok) {
-          n++;
-        } else {
-          gpr_free(item->obj);
-          gpr_free(item);
-        }
-        break;
-      }
-      // Case 1 is removal of entry.
-      case 1: {
-        uint64_t key = (uint64_t)(rand() % 10000);
-        ptr_item *item = (ptr_item *)intrusive_hash_map_find(&hash_map, key);
-        if (item != NULL) {
-          n--;
-          GPR_ASSERT(key == item->obj->val);
-          ptr_item *item2 =
-              (ptr_item *)intrusive_hash_map_erase(&hash_map, key);
-          GPR_ASSERT(item == item2);
-          gpr_free(item->obj);
-          gpr_free(item);
-        }
-        break;
-      }
-    }
-  }
-  // Check size
-  GPR_ASSERT(n == intrusive_hash_map_size(&hash_map));
-
-  // Clean the hash_map up.
-  intrusive_hash_map_clear(&hash_map, &free_ptr_item);
-  GPR_ASSERT(intrusive_hash_map_empty(&hash_map));
-  intrusive_hash_map_free(&hash_map, &free_ptr_item);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  gpr_time_init();
-  srand((unsigned)gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
-
-  test_empty();
-  test_single_item();
-  test_two_items();
-  test_reset_clear();
-  test_extend();
-  test_stress();
-
-  return 0;
-}
diff --git a/test/core/census/mlog_test.c b/test/core/census/mlog_test.c
deleted file mode 100644
index 968fd91..0000000
--- a/test/core/census/mlog_test.c
+++ /dev/null
@@ -1,574 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/mlog.h"
-#include <grpc/support/cpu.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "test/core/util/test_config.h"
-
-// Change this to non-zero if you want more output.
-#define VERBOSE 0
-
-// Log size to use for all tests.
-#define LOG_SIZE_IN_MB 1
-#define LOG_SIZE_IN_BYTES (LOG_SIZE_IN_MB << 20)
-
-// Fills in 'record' of size 'size'. Each byte in record is filled in with the
-// same value. The value is extracted from 'record' pointer.
-static void write_record(char* record, size_t size) {
-  char data = (char)((uintptr_t)record % 255);
-  memset(record, data, size);
-}
-
-// Reads fixed size records. Returns the number of records read in
-// 'num_records'.
-static void read_records(size_t record_size, const char* buffer,
-                         size_t buffer_size, int* num_records) {
-  GPR_ASSERT(buffer_size >= record_size);
-  GPR_ASSERT(buffer_size % record_size == 0);
-  *num_records = (int)(buffer_size / record_size);
-  for (int i = 0; i < *num_records; ++i) {
-    const char* record = buffer + (record_size * (size_t)i);
-    char data = (char)((uintptr_t)record % 255);
-    for (size_t j = 0; j < record_size; ++j) {
-      GPR_ASSERT(data == record[j]);
-    }
-  }
-}
-
-// Tries to write the specified number of records. Stops when the log gets
-// full. Returns the number of records written. Spins for random
-// number of times, up to 'max_spin_count', between writes.
-static int write_records_to_log(int writer_id, size_t record_size,
-                                int num_records, int max_spin_count) {
-  int counter = 0;
-  for (int i = 0; i < num_records; ++i) {
-    int spin_count = max_spin_count ? rand() % max_spin_count : 0;
-    if (VERBOSE && (counter++ == num_records / 10)) {
-      printf("   Writer %d: %d out of %d written\n", writer_id, i, num_records);
-      counter = 0;
-    }
-    char* record = (char*)(census_log_start_write(record_size));
-    if (record == NULL) {
-      return i;
-    }
-    write_record(record, record_size);
-    census_log_end_write(record, record_size);
-    for (int j = 0; j < spin_count; ++j) {
-      GPR_ASSERT(j >= 0);
-    }
-  }
-  return num_records;
-}
-
-// Performs a single read iteration. Returns the number of records read.
-static int perform_read_iteration(size_t record_size) {
-  const void* read_buffer = NULL;
-  size_t bytes_available;
-  int records_read = 0;
-  census_log_init_reader();
-  while ((read_buffer = census_log_read_next(&bytes_available))) {
-    int num_records = 0;
-    read_records(record_size, (const char*)read_buffer, bytes_available,
-                 &num_records);
-    records_read += num_records;
-  }
-  return records_read;
-}
-
-// Asserts that the log is empty.
-static void assert_log_empty(void) {
-  census_log_init_reader();
-  size_t bytes_available;
-  GPR_ASSERT(census_log_read_next(&bytes_available) == NULL);
-}
-
-// Fills the log and verifies data. If 'no fragmentation' is true, records
-// are sized such that CENSUS_LOG_2_MAX_RECORD_SIZE is a multiple of record
-// size. If not a circular log, verifies that the number of records written
-// match the number of records read.
-static void fill_log(size_t log_size, int no_fragmentation, int circular_log) {
-  size_t size;
-  if (no_fragmentation) {
-    int log2size = rand() % (CENSUS_LOG_2_MAX_RECORD_SIZE + 1);
-    size = ((size_t)1 << log2size);
-  } else {
-    while (1) {
-      size = 1 + ((size_t)rand() % CENSUS_LOG_MAX_RECORD_SIZE);
-      if (CENSUS_LOG_MAX_RECORD_SIZE % size) {
-        break;
-      }
-    }
-  }
-  int records_written =
-      write_records_to_log(0 /* writer id */, size,
-                           (int)((log_size / size) * 2), 0 /* spin count */);
-  int records_read = perform_read_iteration(size);
-  if (!circular_log) {
-    GPR_ASSERT(records_written == records_read);
-  }
-  assert_log_empty();
-}
-
-// Structure to pass args to writer_thread
-typedef struct writer_thread_args {
-  // Index of this thread in the writers vector.
-  int index;
-  // Record size.
-  size_t record_size;
-  // Number of records to write.
-  int num_records;
-  // Used to signal when writer is complete
-  gpr_cv* done;
-  gpr_mu* mu;
-  int* count;
-} writer_thread_args;
-
-// Writes the given number of records of random size (up to kMaxRecordSize) and
-// random data to the specified log.
-static void writer_thread(void* arg) {
-  writer_thread_args* args = (writer_thread_args*)arg;
-  // Maximum number of times to spin between writes.
-  static const int MAX_SPIN_COUNT = 50;
-  int records_written = 0;
-  if (VERBOSE) {
-    printf("   Writer %d starting\n", args->index);
-  }
-  while (records_written < args->num_records) {
-    records_written += write_records_to_log(args->index, args->record_size,
-                                            args->num_records - records_written,
-                                            MAX_SPIN_COUNT);
-    if (records_written < args->num_records) {
-      // Ran out of log space. Sleep for a bit and let the reader catch up.
-      // This should never happen for circular logs.
-      if (VERBOSE) {
-        printf(
-            "   Writer %d stalled due to out-of-space: %d out of %d "
-            "written\n",
-            args->index, records_written, args->num_records);
-      }
-      gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(10));
-    }
-  }
-  // Done. Decrement count and signal.
-  gpr_mu_lock(args->mu);
-  (*args->count)--;
-  gpr_cv_signal(args->done);
-  if (VERBOSE) {
-    printf("   Writer %d done\n", args->index);
-  }
-  gpr_mu_unlock(args->mu);
-}
-
-// struct to pass args to reader_thread
-typedef struct reader_thread_args {
-  // Record size.
-  size_t record_size;
-  // Interval between read iterations.
-  int read_iteration_interval_in_msec;
-  // Total number of records.
-  int total_records;
-  // Signalled when reader should stop.
-  gpr_cv stop;
-  int stop_flag;
-  // Used to signal when reader has finished
-  gpr_cv* done;
-  gpr_mu* mu;
-  int running;
-} reader_thread_args;
-
-// Reads and verifies the specified number of records. Reader can also be
-// stopped via gpr_cv_signal(&args->stop). Sleeps for 'read_interval_in_msec'
-// between read iterations.
-static void reader_thread(void* arg) {
-  reader_thread_args* args = (reader_thread_args*)arg;
-  if (VERBOSE) {
-    printf("   Reader starting\n");
-  }
-  gpr_timespec interval = gpr_time_from_micros(
-      args->read_iteration_interval_in_msec * 1000, GPR_TIMESPAN);
-  gpr_mu_lock(args->mu);
-  int records_read = 0;
-  int num_iterations = 0;
-  int counter = 0;
-  while (!args->stop_flag && records_read < args->total_records) {
-    gpr_cv_wait(&args->stop, args->mu, interval);
-    if (!args->stop_flag) {
-      records_read += perform_read_iteration(args->record_size);
-      GPR_ASSERT(records_read <= args->total_records);
-      if (VERBOSE && (counter++ == 100000)) {
-        printf("   Reader: %d out of %d read\n", records_read,
-               args->total_records);
-        counter = 0;
-      }
-      ++num_iterations;
-    }
-  }
-  // Done
-  args->running = 0;
-  gpr_cv_signal(args->done);
-  if (VERBOSE) {
-    printf("   Reader: records: %d, iterations: %d\n", records_read,
-           num_iterations);
-  }
-  gpr_mu_unlock(args->mu);
-}
-
-// Creates NUM_WRITERS writers where each writer writes NUM_RECORDS_PER_WRITER
-// records. Also, starts a reader that iterates over and reads blocks every
-// READ_ITERATION_INTERVAL_IN_MSEC.
-// Number of writers.
-#define NUM_WRITERS 5
-static void multiple_writers_single_reader(int circular_log) {
-  // Sleep interval between read iterations.
-  static const int READ_ITERATION_INTERVAL_IN_MSEC = 10;
-  // Maximum record size.
-  static const size_t MAX_RECORD_SIZE = 20;
-  // Number of records written by each writer. This is sized such that we
-  // will write through the entire log ~10 times.
-  const int NUM_RECORDS_PER_WRITER =
-      (int)((10 * census_log_remaining_space()) / (MAX_RECORD_SIZE / 2)) /
-      NUM_WRITERS;
-  size_t record_size = ((size_t)rand() % MAX_RECORD_SIZE) + 1;
-  // Create and start writers.
-  writer_thread_args writers[NUM_WRITERS];
-  int writers_count = NUM_WRITERS;
-  gpr_cv writers_done;
-  gpr_mu writers_mu;  // protects writers_done and writers_count
-  gpr_cv_init(&writers_done);
-  gpr_mu_init(&writers_mu);
-  gpr_thd_id id;
-  for (int i = 0; i < NUM_WRITERS; ++i) {
-    writers[i].index = i;
-    writers[i].record_size = record_size;
-    writers[i].num_records = NUM_RECORDS_PER_WRITER;
-    writers[i].done = &writers_done;
-    writers[i].count = &writers_count;
-    writers[i].mu = &writers_mu;
-    gpr_thd_new(&id, &writer_thread, &writers[i], NULL);
-  }
-  // Start reader.
-  gpr_cv reader_done;
-  gpr_mu reader_mu;  // protects reader_done and reader.running
-  reader_thread_args reader;
-  reader.record_size = record_size;
-  reader.read_iteration_interval_in_msec = READ_ITERATION_INTERVAL_IN_MSEC;
-  reader.total_records = NUM_WRITERS * NUM_RECORDS_PER_WRITER;
-  reader.stop_flag = 0;
-  gpr_cv_init(&reader.stop);
-  gpr_cv_init(&reader_done);
-  reader.done = &reader_done;
-  gpr_mu_init(&reader_mu);
-  reader.mu = &reader_mu;
-  reader.running = 1;
-  gpr_thd_new(&id, &reader_thread, &reader, NULL);
-  // Wait for writers to finish.
-  gpr_mu_lock(&writers_mu);
-  while (writers_count != 0) {
-    gpr_cv_wait(&writers_done, &writers_mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  gpr_mu_unlock(&writers_mu);
-  gpr_mu_destroy(&writers_mu);
-  gpr_cv_destroy(&writers_done);
-  gpr_mu_lock(&reader_mu);
-  if (circular_log) {
-    // Stop reader.
-    reader.stop_flag = 1;
-    gpr_cv_signal(&reader.stop);
-  }
-  // wait for reader to finish
-  while (reader.running) {
-    gpr_cv_wait(&reader_done, &reader_mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  if (circular_log) {
-    // Assert that there were no out-of-space errors.
-    GPR_ASSERT(0 == census_log_out_of_space_count());
-  }
-  gpr_mu_unlock(&reader_mu);
-  gpr_mu_destroy(&reader_mu);
-  gpr_cv_destroy(&reader_done);
-  if (VERBOSE) {
-    printf("   Reader: finished\n");
-  }
-}
-
-static void setup_test(int circular_log) {
-  census_log_initialize(LOG_SIZE_IN_MB, circular_log);
-  //  GPR_ASSERT(census_log_remaining_space() == LOG_SIZE_IN_BYTES);
-}
-
-// Attempts to create a record of invalid size (size >
-// CENSUS_LOG_MAX_RECORD_SIZE).
-void test_invalid_record_size(void) {
-  static const size_t INVALID_SIZE = CENSUS_LOG_MAX_RECORD_SIZE + 1;
-  static const size_t VALID_SIZE = 1;
-  printf("Starting test: invalid record size\n");
-  setup_test(0);
-  void* record = census_log_start_write(INVALID_SIZE);
-  GPR_ASSERT(record == NULL);
-  // Now try writing a valid record.
-  record = census_log_start_write(VALID_SIZE);
-  GPR_ASSERT(record != NULL);
-  census_log_end_write(record, VALID_SIZE);
-  // Verifies that available space went down by one block. In theory, this
-  // check can fail if the thread is context switched to a new CPU during the
-  // start_write execution (multiple blocks get allocated), but this has not
-  // been observed in practice.
-  //  GPR_ASSERT(LOG_SIZE_IN_BYTES - CENSUS_LOG_MAX_RECORD_SIZE ==
-  //             census_log_remaining_space());
-  census_log_shutdown();
-}
-
-// Tests end_write() with a different size than what was specified in
-// start_write().
-void test_end_write_with_different_size(void) {
-  static const size_t START_WRITE_SIZE = 10;
-  static const size_t END_WRITE_SIZE = 7;
-  printf("Starting test: end write with different size\n");
-  setup_test(0);
-  void* record_written = census_log_start_write(START_WRITE_SIZE);
-  GPR_ASSERT(record_written != NULL);
-  census_log_end_write(record_written, END_WRITE_SIZE);
-  census_log_init_reader();
-  size_t bytes_available;
-  const void* record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_written == record_read);
-  GPR_ASSERT(END_WRITE_SIZE == bytes_available);
-  assert_log_empty();
-  census_log_shutdown();
-}
-
-// Verifies that pending records are not available via read_next().
-void test_read_pending_record(void) {
-  static const size_t PR_RECORD_SIZE = 1024;
-  printf("Starting test: read pending record\n");
-  setup_test(0);
-  // Start a write.
-  void* record_written = census_log_start_write(PR_RECORD_SIZE);
-  GPR_ASSERT(record_written != NULL);
-  // As write is pending, read should fail.
-  census_log_init_reader();
-  size_t bytes_available;
-  const void* record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_read == NULL);
-  // A read followed by end_write() should succeed.
-  census_log_end_write(record_written, PR_RECORD_SIZE);
-  census_log_init_reader();
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_written == record_read);
-  GPR_ASSERT(PR_RECORD_SIZE == bytes_available);
-  assert_log_empty();
-  census_log_shutdown();
-}
-
-// Tries reading beyond pending write.
-void test_read_beyond_pending_record(void) {
-  printf("Starting test: read beyond pending record\n");
-  setup_test(0);
-  // Start a write.
-  const size_t incomplete_record_size = 10;
-  void* incomplete_record = census_log_start_write(incomplete_record_size);
-  GPR_ASSERT(incomplete_record != NULL);
-  const size_t complete_record_size = 20;
-  void* complete_record = census_log_start_write(complete_record_size);
-  GPR_ASSERT(complete_record != NULL);
-  GPR_ASSERT(complete_record != incomplete_record);
-  census_log_end_write(complete_record, complete_record_size);
-  // Now iterate over blocks to read completed records.
-  census_log_init_reader();
-  size_t bytes_available;
-  const void* record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(complete_record == record_read);
-  GPR_ASSERT(complete_record_size == bytes_available);
-  // Complete first record.
-  census_log_end_write(incomplete_record, incomplete_record_size);
-  // Have read past the incomplete record, so read_next() should return NULL.
-  // NB: this test also assumes our thread did not get switched to a different
-  // CPU between the two start_write calls
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_read == NULL);
-  // Reset reader to get the newly completed record.
-  census_log_init_reader();
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(incomplete_record == record_read);
-  GPR_ASSERT(incomplete_record_size == bytes_available);
-  assert_log_empty();
-  census_log_shutdown();
-}
-
-// Tests scenario where block being read is detached from a core and put on the
-// dirty list.
-void test_detached_while_reading(void) {
-  printf("Starting test: detached while reading\n");
-  setup_test(0);
-  // Start a write.
-  static const size_t DWR_RECORD_SIZE = 10;
-  void* record_written = census_log_start_write(DWR_RECORD_SIZE);
-  GPR_ASSERT(record_written != NULL);
-  census_log_end_write(record_written, DWR_RECORD_SIZE);
-  // Read this record.
-  census_log_init_reader();
-  size_t bytes_available;
-  const void* record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_read != NULL);
-  GPR_ASSERT(DWR_RECORD_SIZE == bytes_available);
-  // Now fill the log. This will move the block being read from core-local
-  // array to the dirty list.
-  while ((record_written = census_log_start_write(DWR_RECORD_SIZE))) {
-    census_log_end_write(record_written, DWR_RECORD_SIZE);
-  }
-
-  // In this iteration, read_next() should only traverse blocks in the
-  // core-local array. Therefore, we expect at most gpr_cpu_num_cores() more
-  // blocks. As log is full, if read_next() is traversing the dirty list, we
-  // will get more than gpr_cpu_num_cores() blocks.
-  int block_read = 0;
-  while ((record_read = census_log_read_next(&bytes_available))) {
-    ++block_read;
-    GPR_ASSERT(block_read <= (int)gpr_cpu_num_cores());
-  }
-  census_log_shutdown();
-}
-
-// Fills non-circular log with records sized such that size is a multiple of
-// CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation).
-void test_fill_log_no_fragmentation(void) {
-  printf("Starting test: fill log no fragmentation\n");
-  const int circular = 0;
-  setup_test(circular);
-  fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular);
-  census_log_shutdown();
-}
-
-// Fills circular log with records sized such that size is a multiple of
-// CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation).
-void test_fill_circular_log_no_fragmentation(void) {
-  printf("Starting test: fill circular log no fragmentation\n");
-  const int circular = 1;
-  setup_test(circular);
-  fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular);
-  census_log_shutdown();
-}
-
-// Fills non-circular log with records that may straddle end of a block.
-void test_fill_log_with_straddling_records(void) {
-  printf("Starting test: fill log with straddling records\n");
-  const int circular = 0;
-  setup_test(circular);
-  fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular);
-  census_log_shutdown();
-}
-
-// Fills circular log with records that may straddle end of a block.
-void test_fill_circular_log_with_straddling_records(void) {
-  printf("Starting test: fill circular log with straddling records\n");
-  const int circular = 1;
-  setup_test(circular);
-  fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular);
-  census_log_shutdown();
-}
-
-// Tests scenario where multiple writers and a single reader are using a log
-// that is configured to discard old records.
-void test_multiple_writers_circular_log(void) {
-  printf("Starting test: multiple writers circular log\n");
-  const int circular = 1;
-  setup_test(circular);
-  multiple_writers_single_reader(circular);
-  census_log_shutdown();
-}
-
-// Tests scenario where multiple writers and a single reader are using a log
-// that is configured to discard old records.
-void test_multiple_writers(void) {
-  printf("Starting test: multiple writers\n");
-  const int circular = 0;
-  setup_test(circular);
-  multiple_writers_single_reader(circular);
-  census_log_shutdown();
-}
-
-// Repeat the straddling records and multiple writers tests with a small log.
-void test_small_log(void) {
-  printf("Starting test: small log\n");
-  const int circular = 0;
-  census_log_initialize(0, circular);
-  size_t log_size = census_log_remaining_space();
-  GPR_ASSERT(log_size > 0);
-  fill_log(log_size, 0, circular);
-  census_log_shutdown();
-  census_log_initialize(0, circular);
-  multiple_writers_single_reader(circular);
-  census_log_shutdown();
-}
-
-void test_performance(void) {
-  for (size_t write_size = 1; write_size < CENSUS_LOG_MAX_RECORD_SIZE;
-       write_size *= 2) {
-    setup_test(0);
-    gpr_timespec start_time = gpr_now(GPR_CLOCK_REALTIME);
-    int nrecords = 0;
-    while (1) {
-      void* record = census_log_start_write(write_size);
-      if (record == NULL) {
-        break;
-      }
-      census_log_end_write(record, write_size);
-      nrecords++;
-    }
-    gpr_timespec write_time =
-        gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start_time);
-    double write_time_micro =
-        (double)write_time.tv_sec * 1000000 + (double)write_time.tv_nsec / 1000;
-    census_log_shutdown();
-    printf(
-        "Wrote %d %d byte records in %.3g microseconds: %g records/us "
-        "(%g ns/record), %g gigabytes/s\n",
-        nrecords, (int)write_size, write_time_micro,
-        nrecords / write_time_micro, 1000 * write_time_micro / nrecords,
-        (double)((int)write_size * nrecords) / write_time_micro / 1000);
-  }
-}
-
-int main(int argc, char** argv) {
-  grpc_test_init(argc, argv);
-  gpr_time_init();
-  srand((unsigned)gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
-  test_invalid_record_size();
-  test_end_write_with_different_size();
-  test_read_pending_record();
-  test_read_beyond_pending_record();
-  test_detached_while_reading();
-  test_fill_log_no_fragmentation();
-  test_fill_circular_log_no_fragmentation();
-  test_fill_log_with_straddling_records();
-  test_fill_circular_log_with_straddling_records();
-  test_small_log();
-  test_multiple_writers();
-  test_multiple_writers_circular_log();
-  test_performance();
-  return 0;
-}
diff --git a/test/core/census/resource_test.c b/test/core/census/resource_test.c
deleted file mode 100644
index 48fc43e..0000000
--- a/test/core/census/resource_test.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/resource.h"
-#include <grpc/census.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/useful.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "src/core/ext/census/base_resources.h"
-#include "test/core/util/test_config.h"
-
-// Test all the functionality for dealing with Resources.
-
-// Just startup and shutdown resources subsystem.
-static void test_enable_disable() {
-  initialize_resources();
-  shutdown_resources();
-}
-
-// A blank/empty initialization should not work.
-static void test_empty_definition() {
-  initialize_resources();
-  int32_t rid = census_define_resource(NULL, 0);
-  GPR_ASSERT(rid == -1);
-  uint8_t buffer[50] = {0};
-  rid = census_define_resource(buffer, 50);
-  GPR_ASSERT(rid == -1);
-  shutdown_resources();
-}
-
-// Given a file name, read raw proto and define the resource included within.
-// Returns resource id from census_define_resource().
-static int32_t define_resource_from_file(const char *file) {
-#define BUF_SIZE 512
-  uint8_t buffer[BUF_SIZE];
-  FILE *input = fopen(file, "rb");
-  GPR_ASSERT(input != NULL);
-  size_t nbytes = fread(buffer, 1, BUF_SIZE, input);
-  GPR_ASSERT(nbytes != 0 && nbytes < BUF_SIZE && feof(input) && !ferror(input));
-  int32_t rid = census_define_resource(buffer, nbytes);
-  GPR_ASSERT(fclose(input) == 0);
-  return rid;
-}
-
-// Test definition of a single resource, using a proto read from a file. The
-// `succeed` parameter indicates whether we expect the definition to succeed or
-// fail. `name` is used to check that the returned resource can be looked up by
-// name.
-static void test_define_single_resource(const char *file, const char *name,
-                                        bool succeed) {
-  gpr_log(GPR_INFO, "Test defining resource \"%s\"\n", name);
-  initialize_resources();
-  int32_t rid = define_resource_from_file(file);
-  if (succeed) {
-    GPR_ASSERT(rid >= 0);
-    int32_t rid2 = census_resource_id(name);
-    GPR_ASSERT(rid == rid2);
-  } else {
-    GPR_ASSERT(rid < 0);
-  }
-  shutdown_resources();
-}
-
-// Try deleting various resources (both those that exist and those that don't).
-static void test_delete_resource(const char *minimal_good, const char *full) {
-  initialize_resources();
-  // Try deleting resource before any are defined.
-  census_delete_resource(0);
-  // Create and check a couple of resources.
-  int32_t rid1 = define_resource_from_file(minimal_good);
-  int32_t rid2 = define_resource_from_file(full);
-  GPR_ASSERT(rid1 >= 0 && rid2 >= 0 && rid1 != rid2);
-  int32_t rid3 = census_resource_id("minimal_good");
-  int32_t rid4 = census_resource_id("full_resource");
-  GPR_ASSERT(rid1 == rid3 && rid2 == rid4);
-  // Try deleting non-existant resources.
-  census_delete_resource(-1);
-  census_delete_resource(rid1 + rid2 + 1);
-  census_delete_resource(10000000);
-  // Delete one of the previously defined resources and check for deletion.
-  census_delete_resource(rid1);
-  rid3 = census_resource_id("minimal_good");
-  GPR_ASSERT(rid3 < 0);
-  // Check that re-adding works.
-  rid1 = define_resource_from_file(minimal_good);
-  GPR_ASSERT(rid1 >= 0);
-  rid3 = census_resource_id("minimal_good");
-  GPR_ASSERT(rid1 == rid3);
-  shutdown_resources();
-}
-
-// Test define base resources.
-static void test_base_resources() {
-  initialize_resources();
-  define_base_resources();
-  int32_t rid1 = census_resource_id("client_rpc_latency");
-  int32_t rid2 = census_resource_id("server_rpc_latency");
-  GPR_ASSERT(rid1 >= 0 && rid2 >= 0 && rid1 != rid2);
-  shutdown_resources();
-}
-
-int main(int argc, char **argv) {
-  const char *resource_empty_name_pb, *resource_full_pb,
-      *resource_minimal_good_pb, *resource_no_name_pb,
-      *resource_no_numerator_pb, *resource_no_unit_pb;
-  if (argc == 7) {
-    resource_empty_name_pb = argv[1];
-    resource_full_pb = argv[2];
-    resource_minimal_good_pb = argv[3];
-    resource_no_name_pb = argv[4];
-    resource_no_numerator_pb = argv[5];
-    resource_no_unit_pb = argv[6];
-  } else {
-    GPR_ASSERT(argc == 1);
-    resource_empty_name_pb = "test/core/census/data/resource_empty_name.pb";
-    resource_full_pb = "test/core/census/data/resource_full.pb";
-    resource_minimal_good_pb = "test/core/census/data/resource_minimal_good.pb";
-    resource_no_name_pb = "test/core/census/data/resource_no_name.pb";
-    resource_no_numerator_pb = "test/core/census/data/resource_no_numerator.pb";
-    resource_no_unit_pb = "test/core/census/data/resource_no_unit.pb";
-  }
-  grpc_test_init(argc, argv);
-  test_enable_disable();
-  test_empty_definition();
-  test_define_single_resource(resource_minimal_good_pb, "minimal_good", true);
-  test_define_single_resource(resource_full_pb, "full_resource", true);
-  test_define_single_resource(resource_no_name_pb, "resource_no_name", false);
-  test_define_single_resource(resource_no_numerator_pb, "resource_no_numerator",
-                              false);
-  test_define_single_resource(resource_no_unit_pb, "resource_no_unit", false);
-  test_define_single_resource(resource_empty_name_pb, "resource_empty_name",
-                              false);
-  test_delete_resource(resource_minimal_good_pb, resource_full_pb);
-  test_base_resources();
-  return 0;
-}
diff --git a/test/core/census/trace_context_test.c b/test/core/census/trace_context_test.c
deleted file mode 100644
index 6eb831a..0000000
--- a/test/core/census/trace_context_test.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/census.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/useful.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "src/core/ext/census/base_resources.h"
-#include "src/core/ext/census/resource.h"
-#include "test/core/util/test_config.h"
-
-#include "src/core/ext/census/gen/trace_context.pb.h"
-#include "src/core/ext/census/trace_context.h"
-#include "third_party/nanopb/pb_decode.h"
-#include "third_party/nanopb/pb_encode.h"
-
-#define BUF_SIZE 256
-
-/* Encodes a TraceContext structure (ctxt1) to a buffer, and then decodes it
-to a second TraceContext (ctxt2).  Validates that the resulting TraceContext
-has a span_id, trace_id, and that the values are equal to those in initial
-TraceContext. On success, returns true.  If encode_trace_context returns 0,
-decode_trace_context fails, or the resulting TraceContext is missing a trace_id
-or span_id, it will return false. */
-bool validate_encode_decode_context(google_trace_TraceContext *ctxt1,
-                                    uint8_t *buffer, size_t buf_size) {
-  google_trace_TraceContext ctxt2 = google_trace_TraceContext_init_zero;
-  size_t msg_length;
-
-  msg_length = encode_trace_context(ctxt1, buffer, buf_size);
-  if (msg_length == 0) {
-    return false;
-  }
-
-  if (!decode_trace_context(&ctxt2, buffer, msg_length)) {
-    return false;
-  }
-
-  if (!ctxt2.has_trace_id_hi || !ctxt2.has_trace_id_lo || !ctxt2.has_span_id) {
-    return false;
-  }
-
-  GPR_ASSERT(ctxt1->trace_id_hi == ctxt2.trace_id_hi &&
-             ctxt1->trace_id_lo == ctxt2.trace_id_lo &&
-             ctxt1->span_id == ctxt2.span_id &&
-             ctxt1->has_span_options == ctxt2.has_span_options &&
-             (ctxt1->has_span_options
-                  ? ctxt1->span_options == ctxt2.span_options
-                  : true));
-
-  return true;
-}
-
-/* Decodes a proto-encoded TraceContext from a buffer.  If decode_trace_context
-fails or the resulting TraceContext is missing a trace_id or span_id it will
-return false, otherwise returns true. */
-bool validate_decode_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
-                             size_t msg_length) {
-  // Validate the decoding of a context written to buffer.
-  if (!decode_trace_context(ctxt, buffer, msg_length)) {
-    return false;
-  }
-
-  if (!ctxt->has_trace_id_hi || !ctxt->has_trace_id_lo || !ctxt->has_span_id) {
-    return false;
-  }
-
-  return true;
-}
-
-/* Read an encoded trace context from a file.  Validates that the decoding
-gives the expected result (succeed). */
-static void read_and_validate_context_from_file(google_trace_TraceContext *ctxt,
-                                                const char *file,
-                                                const bool succeed) {
-  uint8_t buffer[BUF_SIZE];
-  FILE *input = fopen(file, "rb");
-  GPR_ASSERT(input != NULL);
-  size_t nbytes = fread(buffer, 1, BUF_SIZE, input);
-  GPR_ASSERT(nbytes <= BUF_SIZE && feof(input) && !ferror(input));
-  bool res = validate_decode_context(ctxt, buffer, nbytes);
-  GPR_ASSERT(res == succeed);
-  GPR_ASSERT(fclose(input) == 0);
-}
-
-// Test full proto-buffer.
-static void test_full() {
-  google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
-  read_and_validate_context_from_file(
-      &ctxt, "test/core/census/data/context_full.pb", true);
-}
-
-// Test empty proto-buffer.
-static void test_empty() {
-  google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
-  read_and_validate_context_from_file(
-      &ctxt, "test/core/census/data/context_empty.pb", false);
-}
-
-// Test proto-buffer with only trace_id.
-static void test_trace_only() {
-  google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
-  read_and_validate_context_from_file(
-      &ctxt, "test/core/census/data/context_trace_only.pb", false);
-}
-
-// Test proto-buffer with only span_id.
-static void test_span_only() {
-  google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
-  read_and_validate_context_from_file(
-      &ctxt, "test/core/census/data/context_span_only.pb", false);
-}
-
-// Test proto-buffer without span_options value.
-static void test_no_span_options() {
-  google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
-  read_and_validate_context_from_file(
-      &ctxt, "test/core/census/data/context_no_span_options.pb", true);
-  GPR_ASSERT(ctxt.has_span_options == false && ctxt.span_options == 0);
-}
-
-static void test_encode_decode() {
-  uint8_t buffer[BUF_SIZE] = {0};
-
-  google_trace_TraceContext ctxt1 = google_trace_TraceContext_init_zero;
-  ctxt1.has_trace_id_hi = true;
-  ctxt1.has_trace_id_lo = true;
-  ctxt1.trace_id_lo = 1;
-  ctxt1.trace_id_hi = 2;
-  ctxt1.has_span_id = true;
-  ctxt1.span_id = 3;
-  validate_encode_decode_context(&ctxt1, buffer, sizeof(buffer));
-
-  // Missing trace_id. This should fail.
-  google_trace_TraceContext ctxt2 = google_trace_TraceContext_init_zero;
-  ctxt2.has_trace_id_hi = false;
-  ctxt2.has_trace_id_lo = false;
-  ctxt2.has_span_id = true;
-  validate_encode_decode_context(&ctxt2, buffer, sizeof(buffer));
-}
-
-// Test a corrupted proto-buffer. This should fail.
-static void test_corrupt() {
-  uint8_t buffer[BUF_SIZE] = {0};
-  google_trace_TraceContext ctxt1 = google_trace_TraceContext_init_zero;
-  size_t msg_length;
-
-  ctxt1.has_trace_id_hi = true;
-  ctxt1.has_trace_id_lo = true;
-  ctxt1.trace_id_lo = 1;
-  ctxt1.trace_id_hi = 2;
-  ctxt1.has_span_id = true;
-  ctxt1.span_id = 3;
-  ctxt1.has_span_options = true;
-  ctxt1.span_options = SPAN_OPTIONS_IS_SAMPLED;
-  msg_length = encode_trace_context(&ctxt1, buffer, sizeof(buffer));
-
-  /* Corrupt some bytes.  255 (0xFF) should be illegal for the first byte of the
-  proto encoded object. */
-  buffer[0] = 255;
-
-  bool res = validate_decode_context(&ctxt1, buffer, msg_length);
-  GPR_ASSERT(res == false);
-}
-
-static void test_buffer_size() {
-  // This buffer is too small. This should fail.
-  uint8_t buffer[16] = {0};
-  google_trace_TraceContext ctxt1 = google_trace_TraceContext_init_zero;
-  size_t msg_length;
-
-  ctxt1.has_trace_id_hi = true;
-  ctxt1.has_trace_id_lo = true;
-  ctxt1.trace_id_lo = 1;
-  ctxt1.trace_id_hi = 2;
-  ctxt1.has_span_id = true;
-  ctxt1.span_id = 3;
-  ctxt1.has_span_options = true;
-  ctxt1.span_options = SPAN_OPTIONS_IS_SAMPLED;
-  msg_length = encode_trace_context(&ctxt1, buffer, sizeof(buffer));
-
-  GPR_ASSERT(msg_length == 0);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_full();
-  test_empty();
-  test_trace_only();
-  test_span_only();
-  test_encode_decode();
-  test_corrupt();
-  test_no_span_options();
-  test_buffer_size();
-
-  return 0;
-}
diff --git a/test/core/channel/BUILD b/test/core/channel/BUILD
index 5ac77c4..92f5907 100644
--- a/test/core/channel/BUILD
+++ b/test/core/channel/BUILD
@@ -20,8 +20,8 @@
 
 grpc_cc_test(
     name = "channel_args_test",
-    srcs = ["channel_args_test.c"],
-    language = "C",
+    srcs = ["channel_args_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -32,8 +32,8 @@
 
 grpc_cc_test(
     name = "channel_stack_test",
-    srcs = ["channel_stack_test.c"],
-    language = "C",
+    srcs = ["channel_stack_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -44,8 +44,8 @@
 
 grpc_cc_test(
     name = "channel_stack_builder_test",
-    srcs = ["channel_stack_builder_test.c"],
-    language = "C",
+    srcs = ["channel_stack_builder_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/channel/channel_args_test.c b/test/core/channel/channel_args_test.c
deleted file mode 100644
index deaf293..0000000
--- a/test/core/channel/channel_args_test.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "test/core/util/test_config.h"
-
-static void test_create(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  grpc_arg arg_int;
-  grpc_arg arg_string;
-  grpc_arg to_add[2];
-  grpc_channel_args *ch_args;
-
-  arg_int.key = "int_arg";
-  arg_int.type = GRPC_ARG_INTEGER;
-  arg_int.value.integer = 123;
-
-  arg_string.key = "str key";
-  arg_string.type = GRPC_ARG_STRING;
-  arg_string.value.string = "str value";
-
-  to_add[0] = arg_int;
-  to_add[1] = arg_string;
-  ch_args = grpc_channel_args_copy_and_add(NULL, to_add, 2);
-
-  GPR_ASSERT(ch_args->num_args == 2);
-  GPR_ASSERT(strcmp(ch_args->args[0].key, arg_int.key) == 0);
-  GPR_ASSERT(ch_args->args[0].type == arg_int.type);
-  GPR_ASSERT(ch_args->args[0].value.integer == arg_int.value.integer);
-
-  GPR_ASSERT(strcmp(ch_args->args[1].key, arg_string.key) == 0);
-  GPR_ASSERT(ch_args->args[1].type == arg_string.type);
-  GPR_ASSERT(strcmp(ch_args->args[1].value.string, arg_string.value.string) ==
-             0);
-
-  grpc_channel_args_destroy(&exec_ctx, ch_args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_set_compression_algorithm(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_channel_args *ch_args;
-
-  ch_args =
-      grpc_channel_args_set_compression_algorithm(NULL, GRPC_COMPRESS_GZIP);
-  GPR_ASSERT(ch_args->num_args == 1);
-  GPR_ASSERT(strcmp(ch_args->args[0].key,
-                    GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM) == 0);
-  GPR_ASSERT(ch_args->args[0].type == GRPC_ARG_INTEGER);
-
-  grpc_channel_args_destroy(&exec_ctx, ch_args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_compression_algorithm_states(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_channel_args *ch_args, *ch_args_wo_gzip, *ch_args_wo_gzip_deflate;
-  unsigned states_bitset;
-  size_t i;
-
-  ch_args = grpc_channel_args_copy_and_add(NULL, NULL, 0);
-  /* by default, all enabled */
-  states_bitset =
-      (unsigned)grpc_channel_args_compression_algorithm_get_states(ch_args);
-
-  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
-    GPR_ASSERT(GPR_BITGET(states_bitset, i));
-  }
-
-  /* disable gzip and deflate */
-  ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state(
-      &exec_ctx, &ch_args, GRPC_COMPRESS_GZIP, 0);
-  GPR_ASSERT(ch_args == ch_args_wo_gzip);
-  ch_args_wo_gzip_deflate = grpc_channel_args_compression_algorithm_set_state(
-      &exec_ctx, &ch_args_wo_gzip, GRPC_COMPRESS_DEFLATE, 0);
-  GPR_ASSERT(ch_args_wo_gzip == ch_args_wo_gzip_deflate);
-
-  states_bitset = (unsigned)grpc_channel_args_compression_algorithm_get_states(
-      ch_args_wo_gzip_deflate);
-  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
-    if (i == GRPC_COMPRESS_GZIP || i == GRPC_COMPRESS_DEFLATE) {
-      GPR_ASSERT(GPR_BITGET(states_bitset, i) == 0);
-    } else {
-      GPR_ASSERT(GPR_BITGET(states_bitset, i) != 0);
-    }
-  }
-
-  /* re-enabled gzip only */
-  ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state(
-      &exec_ctx, &ch_args_wo_gzip_deflate, GRPC_COMPRESS_GZIP, 1);
-  GPR_ASSERT(ch_args_wo_gzip == ch_args_wo_gzip_deflate);
-
-  states_bitset = (unsigned)grpc_channel_args_compression_algorithm_get_states(
-      ch_args_wo_gzip);
-  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
-    if (i == GRPC_COMPRESS_DEFLATE) {
-      GPR_ASSERT(GPR_BITGET(states_bitset, i) == 0);
-    } else {
-      GPR_ASSERT(GPR_BITGET(states_bitset, i) != 0);
-    }
-  }
-
-  grpc_channel_args_destroy(&exec_ctx, ch_args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_set_socket_mutator(void) {
-  grpc_channel_args *ch_args;
-  grpc_socket_mutator mutator;
-  grpc_socket_mutator_init(&mutator, NULL);
-
-  ch_args = grpc_channel_args_set_socket_mutator(NULL, &mutator);
-  GPR_ASSERT(ch_args->num_args == 1);
-  GPR_ASSERT(strcmp(ch_args->args[0].key, GRPC_ARG_SOCKET_MUTATOR) == 0);
-  GPR_ASSERT(ch_args->args[0].type == GRPC_ARG_POINTER);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, ch_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_create();
-  test_set_compression_algorithm();
-  test_compression_algorithm_states();
-  test_set_socket_mutator();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/channel/channel_args_test.cc b/test/core/channel/channel_args_test.cc
new file mode 100644
index 0000000..4b4bd3e
--- /dev/null
+++ b/test/core/channel/channel_args_test.cc
@@ -0,0 +1,155 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "test/core/util/test_config.h"
+
+static void test_create(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  grpc_arg arg_int;
+  grpc_arg arg_string;
+  grpc_arg to_add[2];
+  grpc_channel_args* ch_args;
+
+  arg_int.key = const_cast<char*>("int_arg");
+  arg_int.type = GRPC_ARG_INTEGER;
+  arg_int.value.integer = 123;
+
+  arg_string.key = const_cast<char*>("str key");
+  arg_string.type = GRPC_ARG_STRING;
+  arg_string.value.string = const_cast<char*>("str value");
+
+  to_add[0] = arg_int;
+  to_add[1] = arg_string;
+  ch_args = grpc_channel_args_copy_and_add(NULL, to_add, 2);
+
+  GPR_ASSERT(ch_args->num_args == 2);
+  GPR_ASSERT(strcmp(ch_args->args[0].key, arg_int.key) == 0);
+  GPR_ASSERT(ch_args->args[0].type == arg_int.type);
+  GPR_ASSERT(ch_args->args[0].value.integer == arg_int.value.integer);
+
+  GPR_ASSERT(strcmp(ch_args->args[1].key, arg_string.key) == 0);
+  GPR_ASSERT(ch_args->args[1].type == arg_string.type);
+  GPR_ASSERT(strcmp(ch_args->args[1].value.string, arg_string.value.string) ==
+             0);
+
+  grpc_channel_args_destroy(&exec_ctx, ch_args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_set_compression_algorithm(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_channel_args* ch_args;
+
+  ch_args =
+      grpc_channel_args_set_compression_algorithm(NULL, GRPC_COMPRESS_GZIP);
+  GPR_ASSERT(ch_args->num_args == 1);
+  GPR_ASSERT(strcmp(ch_args->args[0].key,
+                    GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM) == 0);
+  GPR_ASSERT(ch_args->args[0].type == GRPC_ARG_INTEGER);
+
+  grpc_channel_args_destroy(&exec_ctx, ch_args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_compression_algorithm_states(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_channel_args *ch_args, *ch_args_wo_gzip, *ch_args_wo_gzip_deflate;
+  unsigned states_bitset;
+  size_t i;
+
+  ch_args = grpc_channel_args_copy_and_add(NULL, NULL, 0);
+  /* by default, all enabled */
+  states_bitset =
+      (unsigned)grpc_channel_args_compression_algorithm_get_states(ch_args);
+
+  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
+    GPR_ASSERT(GPR_BITGET(states_bitset, i));
+  }
+
+  /* disable gzip and deflate */
+  ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state(
+      &exec_ctx, &ch_args, GRPC_COMPRESS_GZIP, 0);
+  GPR_ASSERT(ch_args == ch_args_wo_gzip);
+  ch_args_wo_gzip_deflate = grpc_channel_args_compression_algorithm_set_state(
+      &exec_ctx, &ch_args_wo_gzip, GRPC_COMPRESS_DEFLATE, 0);
+  GPR_ASSERT(ch_args_wo_gzip == ch_args_wo_gzip_deflate);
+
+  states_bitset = (unsigned)grpc_channel_args_compression_algorithm_get_states(
+      ch_args_wo_gzip_deflate);
+  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
+    if (i == GRPC_COMPRESS_GZIP || i == GRPC_COMPRESS_DEFLATE) {
+      GPR_ASSERT(GPR_BITGET(states_bitset, i) == 0);
+    } else {
+      GPR_ASSERT(GPR_BITGET(states_bitset, i) != 0);
+    }
+  }
+
+  /* re-enabled gzip only */
+  ch_args_wo_gzip = grpc_channel_args_compression_algorithm_set_state(
+      &exec_ctx, &ch_args_wo_gzip_deflate, GRPC_COMPRESS_GZIP, 1);
+  GPR_ASSERT(ch_args_wo_gzip == ch_args_wo_gzip_deflate);
+
+  states_bitset = (unsigned)grpc_channel_args_compression_algorithm_get_states(
+      ch_args_wo_gzip);
+  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
+    if (i == GRPC_COMPRESS_DEFLATE) {
+      GPR_ASSERT(GPR_BITGET(states_bitset, i) == 0);
+    } else {
+      GPR_ASSERT(GPR_BITGET(states_bitset, i) != 0);
+    }
+  }
+
+  grpc_channel_args_destroy(&exec_ctx, ch_args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_set_socket_mutator(void) {
+  grpc_channel_args* ch_args;
+  grpc_socket_mutator mutator;
+  grpc_socket_mutator_init(&mutator, NULL);
+
+  ch_args = grpc_channel_args_set_socket_mutator(NULL, &mutator);
+  GPR_ASSERT(ch_args->num_args == 1);
+  GPR_ASSERT(strcmp(ch_args->args[0].key, GRPC_ARG_SOCKET_MUTATOR) == 0);
+  GPR_ASSERT(ch_args->args[0].type == GRPC_ARG_POINTER);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, ch_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_create();
+  test_set_compression_algorithm();
+  test_compression_algorithm_states();
+  test_set_socket_mutator();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/channel/channel_stack_builder_test.c b/test/core/channel/channel_stack_builder_test.c
deleted file mode 100644
index 682efd1..0000000
--- a/test/core/channel/channel_stack_builder_test.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/channel/channel_stack_builder.h"
-
-#include <limits.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "test/core/util/test_config.h"
-
-static grpc_error *channel_init_func(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  return GRPC_ERROR_NONE;
-}
-
-static grpc_error *call_init_func(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  return GRPC_ERROR_NONE;
-}
-
-static void channel_destroy_func(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {}
-
-static void call_destroy_func(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {}
-
-static void call_func(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                      grpc_transport_stream_op_batch *op) {}
-
-static void channel_func(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                         grpc_transport_op *op) {
-  if (op->disconnect_with_error != GRPC_ERROR_NONE) {
-    GRPC_ERROR_UNREF(op->disconnect_with_error);
-  }
-  GRPC_CLOSURE_SCHED(exec_ctx, op->on_consumed, GRPC_ERROR_NONE);
-}
-
-bool g_replacement_fn_called = false;
-bool g_original_fn_called = false;
-void set_arg_once_fn(grpc_channel_stack *channel_stack,
-                     grpc_channel_element *elem, void *arg) {
-  bool *called = arg;
-  // Make sure this function is only called once per arg.
-  GPR_ASSERT(*called == false);
-  *called = true;
-}
-
-static void test_channel_stack_builder_filter_replace(void) {
-  grpc_channel *channel =
-      grpc_insecure_channel_create("target name isn't used", NULL, NULL);
-  GPR_ASSERT(channel != NULL);
-  // Make sure the high priority filter has been created.
-  GPR_ASSERT(g_replacement_fn_called);
-  // ... and that the low priority one hasn't.
-  GPR_ASSERT(!g_original_fn_called);
-  grpc_channel_destroy(channel);
-}
-
-const grpc_channel_filter replacement_filter = {
-    call_func,
-    channel_func,
-    0,
-    call_init_func,
-    grpc_call_stack_ignore_set_pollset_or_pollset_set,
-    call_destroy_func,
-    0,
-    channel_init_func,
-    channel_destroy_func,
-    grpc_channel_next_get_info,
-    "filter_name"};
-
-const grpc_channel_filter original_filter = {
-    call_func,
-    channel_func,
-    0,
-    call_init_func,
-    grpc_call_stack_ignore_set_pollset_or_pollset_set,
-    call_destroy_func,
-    0,
-    channel_init_func,
-    channel_destroy_func,
-    grpc_channel_next_get_info,
-    "filter_name"};
-
-static bool add_replacement_filter(grpc_exec_ctx *exec_ctx,
-                                   grpc_channel_stack_builder *builder,
-                                   void *arg) {
-  const grpc_channel_filter *filter = arg;
-  // Get rid of any other version of the filter, as determined by having the
-  // same name.
-  GPR_ASSERT(grpc_channel_stack_builder_remove_filter(builder, filter->name));
-  return grpc_channel_stack_builder_prepend_filter(
-      builder, filter, set_arg_once_fn, &g_replacement_fn_called);
-}
-
-static bool add_original_filter(grpc_exec_ctx *exec_ctx,
-                                grpc_channel_stack_builder *builder,
-                                void *arg) {
-  return grpc_channel_stack_builder_prepend_filter(
-      builder, (const grpc_channel_filter *)arg, set_arg_once_fn,
-      &g_original_fn_called);
-}
-
-static void init_plugin(void) {
-  grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX,
-                                   add_original_filter,
-                                   (void *)&original_filter);
-  grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX,
-                                   add_replacement_filter,
-                                   (void *)&replacement_filter);
-}
-
-static void destroy_plugin(void) {}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_register_plugin(init_plugin, destroy_plugin);
-  grpc_init();
-  test_channel_stack_builder_filter_replace();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/channel/channel_stack_builder_test.cc b/test/core/channel/channel_stack_builder_test.cc
new file mode 100644
index 0000000..1571f6e
--- /dev/null
+++ b/test/core/channel/channel_stack_builder_test.cc
@@ -0,0 +1,147 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/channel/channel_stack_builder.h"
+
+#include <limits.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/channel_init.h"
+#include "test/core/util/test_config.h"
+
+static grpc_error* channel_init_func(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  return GRPC_ERROR_NONE;
+}
+
+static grpc_error* call_init_func(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  return GRPC_ERROR_NONE;
+}
+
+static void channel_destroy_func(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {}
+
+static void call_destroy_func(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {}
+
+static void call_func(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                      grpc_transport_stream_op_batch* op) {}
+
+static void channel_func(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                         grpc_transport_op* op) {
+  if (op->disconnect_with_error != GRPC_ERROR_NONE) {
+    GRPC_ERROR_UNREF(op->disconnect_with_error);
+  }
+  GRPC_CLOSURE_SCHED(exec_ctx, op->on_consumed, GRPC_ERROR_NONE);
+}
+
+bool g_replacement_fn_called = false;
+bool g_original_fn_called = false;
+void set_arg_once_fn(grpc_channel_stack* channel_stack,
+                     grpc_channel_element* elem, void* arg) {
+  bool* called = static_cast<bool*>(arg);
+  // Make sure this function is only called once per arg.
+  GPR_ASSERT(*called == false);
+  *called = true;
+}
+
+static void test_channel_stack_builder_filter_replace(void) {
+  grpc_channel* channel =
+      grpc_insecure_channel_create("target name isn't used", NULL, NULL);
+  GPR_ASSERT(channel != NULL);
+  // Make sure the high priority filter has been created.
+  GPR_ASSERT(g_replacement_fn_called);
+  // ... and that the low priority one hasn't.
+  GPR_ASSERT(!g_original_fn_called);
+  grpc_channel_destroy(channel);
+}
+
+const grpc_channel_filter replacement_filter = {
+    call_func,
+    channel_func,
+    0,
+    call_init_func,
+    grpc_call_stack_ignore_set_pollset_or_pollset_set,
+    call_destroy_func,
+    0,
+    channel_init_func,
+    channel_destroy_func,
+    grpc_channel_next_get_info,
+    "filter_name"};
+
+const grpc_channel_filter original_filter = {
+    call_func,
+    channel_func,
+    0,
+    call_init_func,
+    grpc_call_stack_ignore_set_pollset_or_pollset_set,
+    call_destroy_func,
+    0,
+    channel_init_func,
+    channel_destroy_func,
+    grpc_channel_next_get_info,
+    "filter_name"};
+
+static bool add_replacement_filter(grpc_exec_ctx* exec_ctx,
+                                   grpc_channel_stack_builder* builder,
+                                   void* arg) {
+  const grpc_channel_filter* filter =
+      static_cast<const grpc_channel_filter*>(arg);
+  // Get rid of any other version of the filter, as determined by having the
+  // same name.
+  GPR_ASSERT(grpc_channel_stack_builder_remove_filter(builder, filter->name));
+  return grpc_channel_stack_builder_prepend_filter(
+      builder, filter, set_arg_once_fn, &g_replacement_fn_called);
+}
+
+static bool add_original_filter(grpc_exec_ctx* exec_ctx,
+                                grpc_channel_stack_builder* builder,
+                                void* arg) {
+  return grpc_channel_stack_builder_prepend_filter(
+      builder, (const grpc_channel_filter*)arg, set_arg_once_fn,
+      &g_original_fn_called);
+}
+
+static void init_plugin(void) {
+  grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX,
+                                   add_original_filter,
+                                   (void*)&original_filter);
+  grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX,
+                                   add_replacement_filter,
+                                   (void*)&replacement_filter);
+}
+
+static void destroy_plugin(void) {}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_register_plugin(init_plugin, destroy_plugin);
+  grpc_init();
+  test_channel_stack_builder_filter_replace();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c
deleted file mode 100644
index a07ef89..0000000
--- a/test/core/channel/channel_stack_test.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/channel/channel_stack.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-#include "test/core/util/test_config.h"
-
-static grpc_error *channel_init_func(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  GPR_ASSERT(args->channel_args->num_args == 1);
-  GPR_ASSERT(args->channel_args->args[0].type == GRPC_ARG_INTEGER);
-  GPR_ASSERT(0 == strcmp(args->channel_args->args[0].key, "test_key"));
-  GPR_ASSERT(args->channel_args->args[0].value.integer == 42);
-  GPR_ASSERT(args->is_first);
-  GPR_ASSERT(args->is_last);
-  *(int *)(elem->channel_data) = 0;
-  return GRPC_ERROR_NONE;
-}
-
-static grpc_error *call_init_func(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  ++*(int *)(elem->channel_data);
-  *(int *)(elem->call_data) = 0;
-  return GRPC_ERROR_NONE;
-}
-
-static void channel_destroy_func(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {}
-
-static void call_destroy_func(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {
-  ++*(int *)(elem->channel_data);
-}
-
-static void call_func(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                      grpc_transport_stream_op_batch *op) {
-  ++*(int *)(elem->call_data);
-}
-
-static void channel_func(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                         grpc_transport_op *op) {
-  ++*(int *)(elem->channel_data);
-}
-
-static void free_channel(grpc_exec_ctx *exec_ctx, void *arg,
-                         grpc_error *error) {
-  grpc_channel_stack_destroy(exec_ctx, arg);
-  gpr_free(arg);
-}
-
-static void free_call(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  grpc_call_stack_destroy(exec_ctx, arg, NULL, NULL);
-  gpr_free(arg);
-}
-
-static void test_create_channel_stack(void) {
-  const grpc_channel_filter filter = {
-      call_func,
-      channel_func,
-      sizeof(int),
-      call_init_func,
-      grpc_call_stack_ignore_set_pollset_or_pollset_set,
-      call_destroy_func,
-      sizeof(int),
-      channel_init_func,
-      channel_destroy_func,
-      grpc_channel_next_get_info,
-      "some_test_filter"};
-  const grpc_channel_filter *filters = &filter;
-  grpc_channel_stack *channel_stack;
-  grpc_call_stack *call_stack;
-  grpc_channel_element *channel_elem;
-  grpc_call_element *call_elem;
-  grpc_arg arg;
-  grpc_channel_args chan_args;
-  int *channel_data;
-  int *call_data;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_slice path = grpc_slice_from_static_string("/service/method");
-
-  arg.type = GRPC_ARG_INTEGER;
-  arg.key = "test_key";
-  arg.value.integer = 42;
-
-  chan_args.num_args = 1;
-  chan_args.args = &arg;
-
-  channel_stack = gpr_malloc(grpc_channel_stack_size(&filters, 1));
-  grpc_channel_stack_init(&exec_ctx, 1, free_channel, channel_stack, &filters,
-                          1, &chan_args, NULL, "test", channel_stack);
-  GPR_ASSERT(channel_stack->count == 1);
-  channel_elem = grpc_channel_stack_element(channel_stack, 0);
-  channel_data = (int *)channel_elem->channel_data;
-  GPR_ASSERT(*channel_data == 0);
-
-  call_stack = gpr_malloc(channel_stack->call_stack_size);
-  const grpc_call_element_args args = {
-      .call_stack = call_stack,
-      .server_transport_data = NULL,
-      .context = NULL,
-      .path = path,
-      .start_time = gpr_now(GPR_CLOCK_MONOTONIC),
-      .deadline = GRPC_MILLIS_INF_FUTURE,
-      .arena = NULL};
-  grpc_error *error = grpc_call_stack_init(&exec_ctx, channel_stack, 1,
-                                           free_call, call_stack, &args);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(call_stack->count == 1);
-  call_elem = grpc_call_stack_element(call_stack, 0);
-  GPR_ASSERT(call_elem->filter == channel_elem->filter);
-  GPR_ASSERT(call_elem->channel_data == channel_elem->channel_data);
-  call_data = (int *)call_elem->call_data;
-  GPR_ASSERT(*call_data == 0);
-  GPR_ASSERT(*channel_data == 1);
-
-  GRPC_CALL_STACK_UNREF(&exec_ctx, call_stack, "done");
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(*channel_data == 2);
-
-  GRPC_CHANNEL_STACK_UNREF(&exec_ctx, channel_stack, "done");
-
-  grpc_slice_unref_internal(&exec_ctx, path);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_create_channel_stack();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/channel/channel_stack_test.cc b/test/core/channel/channel_stack_test.cc
new file mode 100644
index 0000000..1b661ac
--- /dev/null
+++ b/test/core/channel/channel_stack_test.cc
@@ -0,0 +1,162 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/channel/channel_stack.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+#include "test/core/util/test_config.h"
+
+static grpc_error* channel_init_func(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  GPR_ASSERT(args->channel_args->num_args == 1);
+  GPR_ASSERT(args->channel_args->args[0].type == GRPC_ARG_INTEGER);
+  GPR_ASSERT(0 == strcmp(args->channel_args->args[0].key, "test_key"));
+  GPR_ASSERT(args->channel_args->args[0].value.integer == 42);
+  GPR_ASSERT(args->is_first);
+  GPR_ASSERT(args->is_last);
+  *(int*)(elem->channel_data) = 0;
+  return GRPC_ERROR_NONE;
+}
+
+static grpc_error* call_init_func(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  ++*(int*)(elem->channel_data);
+  *(int*)(elem->call_data) = 0;
+  return GRPC_ERROR_NONE;
+}
+
+static void channel_destroy_func(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {}
+
+static void call_destroy_func(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {
+  ++*(int*)(elem->channel_data);
+}
+
+static void call_func(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                      grpc_transport_stream_op_batch* op) {
+  ++*(int*)(elem->call_data);
+}
+
+static void channel_func(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                         grpc_transport_op* op) {
+  ++*(int*)(elem->channel_data);
+}
+
+static void free_channel(grpc_exec_ctx* exec_ctx, void* arg,
+                         grpc_error* error) {
+  grpc_channel_stack_destroy(exec_ctx, static_cast<grpc_channel_stack*>(arg));
+  gpr_free(arg);
+}
+
+static void free_call(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  grpc_call_stack_destroy(exec_ctx, static_cast<grpc_call_stack*>(arg), NULL,
+                          NULL);
+  gpr_free(arg);
+}
+
+static void test_create_channel_stack(void) {
+  const grpc_channel_filter filter = {
+      call_func,
+      channel_func,
+      sizeof(int),
+      call_init_func,
+      grpc_call_stack_ignore_set_pollset_or_pollset_set,
+      call_destroy_func,
+      sizeof(int),
+      channel_init_func,
+      channel_destroy_func,
+      grpc_channel_next_get_info,
+      "some_test_filter"};
+  const grpc_channel_filter* filters = &filter;
+  grpc_channel_stack* channel_stack;
+  grpc_call_stack* call_stack;
+  grpc_channel_element* channel_elem;
+  grpc_call_element* call_elem;
+  grpc_arg arg;
+  grpc_channel_args chan_args;
+  int* channel_data;
+  int* call_data;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_slice path = grpc_slice_from_static_string("/service/method");
+
+  arg.type = GRPC_ARG_INTEGER;
+  arg.key = const_cast<char*>("test_key");
+  arg.value.integer = 42;
+
+  chan_args.num_args = 1;
+  chan_args.args = &arg;
+
+  channel_stack = static_cast<grpc_channel_stack*>(
+      gpr_malloc(grpc_channel_stack_size(&filters, 1)));
+  grpc_channel_stack_init(&exec_ctx, 1, free_channel, channel_stack, &filters,
+                          1, &chan_args, NULL, "test", channel_stack);
+  GPR_ASSERT(channel_stack->count == 1);
+  channel_elem = grpc_channel_stack_element(channel_stack, 0);
+  channel_data = (int*)channel_elem->channel_data;
+  GPR_ASSERT(*channel_data == 0);
+
+  call_stack =
+      static_cast<grpc_call_stack*>(gpr_malloc(channel_stack->call_stack_size));
+  const grpc_call_element_args args = {
+      call_stack,                   /* call_stack */
+      nullptr,                      /* server_transport_data */
+      nullptr,                      /* context */
+      path,                         /* path */
+      gpr_now(GPR_CLOCK_MONOTONIC), /* start_time */
+      GRPC_MILLIS_INF_FUTURE,       /* deadline */
+      nullptr,                      /* arena */
+      nullptr                       /* call_combiner */
+  };
+  grpc_error* error = grpc_call_stack_init(&exec_ctx, channel_stack, 1,
+                                           free_call, call_stack, &args);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(call_stack->count == 1);
+  call_elem = grpc_call_stack_element(call_stack, 0);
+  GPR_ASSERT(call_elem->filter == channel_elem->filter);
+  GPR_ASSERT(call_elem->channel_data == channel_elem->channel_data);
+  call_data = (int*)call_elem->call_data;
+  GPR_ASSERT(*call_data == 0);
+  GPR_ASSERT(*channel_data == 1);
+
+  GRPC_CALL_STACK_UNREF(&exec_ctx, call_stack, "done");
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(*channel_data == 2);
+
+  GRPC_CHANNEL_STACK_UNREF(&exec_ctx, channel_stack, "done");
+
+  grpc_slice_unref_internal(&exec_ctx, path);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_create_channel_stack();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/channel/minimal_stack_is_minimal_test.c b/test/core/channel/minimal_stack_is_minimal_test.c
deleted file mode 100644
index b452834..0000000
--- a/test/core/channel/minimal_stack_is_minimal_test.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/*******************************************************************************
- * This test verifies that various stack configurations result in the set of
- * filters that we expect.
- *
- * This is akin to a golden-file test, and suffers the same disadvantages and
- * advantages: it reflects that the code as written has not been modified - and
- * valid code modifications WILL break this test and it will need updating.
- *
- * The intent therefore is to allow code reviewers to more easily catch changes
- * that perturb the generated list of channel filters in different
- * configurations and assess whether such a change is correct and desirable.
- */
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-#include <string.h>
-
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "src/core/lib/surface/channel_stack_type.h"
-#include "src/core/lib/transport/transport_impl.h"
-#include "test/core/util/test_config.h"
-
-// use CHECK_STACK instead
-static int check_stack(const char *file, int line, const char *transport_name,
-                       grpc_channel_args *init_args,
-                       unsigned channel_stack_type, ...);
-
-// arguments: const char *transport_name   - the name of the transport type to
-//                                           simulate
-//            grpc_channel_args *init_args - channel args to pass down
-//            grpc_channel_stack_type channel_stack_type - the archetype of
-//                                           channel stack to create
-//            variadic arguments - the (in-order) expected list of channel
-//                                 filters to instantiate, terminated with NULL
-#define CHECK_STACK(...) check_stack(__FILE__, __LINE__, __VA_ARGS__)
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  int errors = 0;
-
-  // tests with a minimal stack
-  grpc_arg minimal_stack_arg = {.type = GRPC_ARG_INTEGER,
-                                .key = GRPC_ARG_MINIMAL_STACK,
-                                .value.integer = 1};
-  grpc_channel_args minimal_stack_args = {.num_args = 1,
-                                          .args = &minimal_stack_arg};
-  errors += CHECK_STACK("unknown", &minimal_stack_args,
-                        GRPC_CLIENT_DIRECT_CHANNEL, "connected", NULL);
-  errors += CHECK_STACK("unknown", &minimal_stack_args, GRPC_CLIENT_SUBCHANNEL,
-                        "connected", NULL);
-  errors += CHECK_STACK("unknown", &minimal_stack_args, GRPC_SERVER_CHANNEL,
-                        "server", "connected", NULL);
-  errors +=
-      CHECK_STACK("chttp2", &minimal_stack_args, GRPC_CLIENT_DIRECT_CHANNEL,
-                  "http-client", "connected", NULL);
-  errors += CHECK_STACK("chttp2", &minimal_stack_args, GRPC_CLIENT_SUBCHANNEL,
-                        "http-client", "connected", NULL);
-  errors += CHECK_STACK("chttp2", &minimal_stack_args, GRPC_SERVER_CHANNEL,
-                        "server", "http-server", "connected", NULL);
-  errors += CHECK_STACK(NULL, &minimal_stack_args, GRPC_CLIENT_CHANNEL,
-                        "client-channel", NULL);
-
-  // tests with a default stack
-  errors += CHECK_STACK("unknown", NULL, GRPC_CLIENT_DIRECT_CHANNEL,
-                        "message_size", "deadline", "connected", NULL);
-  errors += CHECK_STACK("unknown", NULL, GRPC_CLIENT_SUBCHANNEL, "message_size",
-                        "connected", NULL);
-  errors += CHECK_STACK("unknown", NULL, GRPC_SERVER_CHANNEL, "server",
-                        "message_size", "deadline", "connected", NULL);
-  errors += CHECK_STACK("chttp2", NULL, GRPC_CLIENT_DIRECT_CHANNEL,
-                        "message_size", "deadline", "http-client",
-                        "message_compress", "connected", NULL);
-  errors += CHECK_STACK("chttp2", NULL, GRPC_CLIENT_SUBCHANNEL, "message_size",
-                        "http-client", "message_compress", "connected", NULL);
-  errors += CHECK_STACK("chttp2", NULL, GRPC_SERVER_CHANNEL, "server",
-                        "message_size", "deadline", "http-server",
-                        "message_compress", "connected", NULL);
-  errors +=
-      CHECK_STACK(NULL, NULL, GRPC_CLIENT_CHANNEL, "client-channel", NULL);
-
-  GPR_ASSERT(errors == 0);
-  grpc_shutdown();
-  return 0;
-}
-
-/*******************************************************************************
- * End of tests definitions, start of test infrastructure
- */
-
-static int check_stack(const char *file, int line, const char *transport_name,
-                       grpc_channel_args *init_args,
-                       unsigned channel_stack_type, ...) {
-  // create dummy channel stack
-  grpc_channel_stack_builder *builder = grpc_channel_stack_builder_create();
-  grpc_transport_vtable fake_transport_vtable = {.name = transport_name};
-  grpc_transport fake_transport = {.vtable = &fake_transport_vtable};
-  grpc_channel_stack_builder_set_target(builder, "foo.test.google.fr");
-  grpc_channel_args *channel_args = grpc_channel_args_copy(init_args);
-  if (transport_name != NULL) {
-    grpc_channel_stack_builder_set_transport(builder, &fake_transport);
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_stack_builder_set_channel_arguments(&exec_ctx, builder,
-                                                     channel_args);
-    GPR_ASSERT(grpc_channel_init_create_stack(
-        &exec_ctx, builder, (grpc_channel_stack_type)channel_stack_type));
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  // build up our expectation list
-  gpr_strvec v;
-  gpr_strvec_init(&v);
-  va_list args;
-  va_start(args, channel_stack_type);
-  for (;;) {
-    char *a = va_arg(args, char *);
-    if (a == NULL) break;
-    if (v.count != 0) gpr_strvec_add(&v, gpr_strdup(", "));
-    gpr_strvec_add(&v, gpr_strdup(a));
-  }
-  va_end(args);
-  char *expect = gpr_strvec_flatten(&v, NULL);
-  gpr_strvec_destroy(&v);
-
-  // build up our "got" list
-  gpr_strvec_init(&v);
-  grpc_channel_stack_builder_iterator *it =
-      grpc_channel_stack_builder_create_iterator_at_first(builder);
-  while (grpc_channel_stack_builder_move_next(it)) {
-    const char *name = grpc_channel_stack_builder_iterator_filter_name(it);
-    if (name == NULL) continue;
-    if (v.count != 0) gpr_strvec_add(&v, gpr_strdup(", "));
-    gpr_strvec_add(&v, gpr_strdup(name));
-  }
-  char *got = gpr_strvec_flatten(&v, NULL);
-  gpr_strvec_destroy(&v);
-  grpc_channel_stack_builder_iterator_destroy(it);
-
-  // figure out result, log if there's an error
-  int result = 0;
-  if (0 != strcmp(got, expect)) {
-    gpr_strvec_init(&v);
-    gpr_strvec_add(&v, gpr_strdup("{"));
-    for (size_t i = 0; i < channel_args->num_args; i++) {
-      if (i > 0) gpr_strvec_add(&v, gpr_strdup(", "));
-      gpr_strvec_add(&v, gpr_strdup(channel_args->args[i].key));
-      gpr_strvec_add(&v, gpr_strdup("="));
-      switch (channel_args->args[i].type) {
-        case GRPC_ARG_INTEGER: {
-          char *tmp;
-          gpr_asprintf(&tmp, "%d", channel_args->args[i].value.integer);
-          gpr_strvec_add(&v, tmp);
-          break;
-        }
-        case GRPC_ARG_STRING:
-          gpr_strvec_add(&v, gpr_strdup(channel_args->args[i].value.string));
-          break;
-        case GRPC_ARG_POINTER: {
-          char *tmp;
-          gpr_asprintf(&tmp, "%p", channel_args->args[i].value.pointer.p);
-          gpr_strvec_add(&v, tmp);
-          break;
-        }
-      }
-    }
-    gpr_strvec_add(&v, gpr_strdup("}"));
-    char *args_str = gpr_strvec_flatten(&v, NULL);
-    gpr_strvec_destroy(&v);
-
-    gpr_log(file, line, GPR_LOG_SEVERITY_ERROR,
-            "**************************************************");
-    gpr_log(file, line, GPR_LOG_SEVERITY_ERROR,
-            "FAILED transport=%s; stack_type=%s; channel_args=%s:",
-            transport_name, grpc_channel_stack_type_string(channel_stack_type),
-            args_str);
-    gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "EXPECTED: %s", expect);
-    gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "GOT:      %s", got);
-    result = 1;
-
-    gpr_free(args_str);
-  }
-
-  gpr_free(got);
-  gpr_free(expect);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_stack_builder_destroy(&exec_ctx, builder);
-    grpc_channel_args_destroy(&exec_ctx, channel_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  return result;
-}
diff --git a/test/core/channel/minimal_stack_is_minimal_test.cc b/test/core/channel/minimal_stack_is_minimal_test.cc
new file mode 100644
index 0000000..c54ff2e
--- /dev/null
+++ b/test/core/channel/minimal_stack_is_minimal_test.cc
@@ -0,0 +1,221 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/*******************************************************************************
+ * This test verifies that various stack configurations result in the set of
+ * filters that we expect.
+ *
+ * This is akin to a golden-file test, and suffers the same disadvantages and
+ * advantages: it reflects that the code as written has not been modified - and
+ * valid code modifications WILL break this test and it will need updating.
+ *
+ * The intent therefore is to allow code reviewers to more easily catch changes
+ * that perturb the generated list of channel filters in different
+ * configurations and assess whether such a change is correct and desirable.
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+#include <string.h>
+
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/surface/channel_init.h"
+#include "src/core/lib/surface/channel_stack_type.h"
+#include "src/core/lib/transport/transport_impl.h"
+#include "test/core/util/test_config.h"
+
+// use CHECK_STACK instead
+static int check_stack(const char* file, int line, const char* transport_name,
+                       grpc_channel_args* init_args,
+                       unsigned channel_stack_type, ...);
+
+// arguments: const char *transport_name   - the name of the transport type to
+//                                           simulate
+//            grpc_channel_args *init_args - channel args to pass down
+//            grpc_channel_stack_type channel_stack_type - the archetype of
+//                                           channel stack to create
+//            variadic arguments - the (in-order) expected list of channel
+//                                 filters to instantiate, terminated with NULL
+#define CHECK_STACK(...) check_stack(__FILE__, __LINE__, __VA_ARGS__)
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  int errors = 0;
+
+  // tests with a minimal stack
+  grpc_arg minimal_stack_arg;
+  minimal_stack_arg.type = GRPC_ARG_INTEGER;
+  minimal_stack_arg.key = const_cast<char*>(GRPC_ARG_MINIMAL_STACK);
+  minimal_stack_arg.value.integer = 1;
+  grpc_channel_args minimal_stack_args = {1, &minimal_stack_arg};
+  errors += CHECK_STACK("unknown", &minimal_stack_args,
+                        GRPC_CLIENT_DIRECT_CHANNEL, "connected", NULL);
+  errors += CHECK_STACK("unknown", &minimal_stack_args, GRPC_CLIENT_SUBCHANNEL,
+                        "connected", NULL);
+  errors += CHECK_STACK("unknown", &minimal_stack_args, GRPC_SERVER_CHANNEL,
+                        "server", "connected", NULL);
+  errors +=
+      CHECK_STACK("chttp2", &minimal_stack_args, GRPC_CLIENT_DIRECT_CHANNEL,
+                  "http-client", "connected", NULL);
+  errors += CHECK_STACK("chttp2", &minimal_stack_args, GRPC_CLIENT_SUBCHANNEL,
+                        "http-client", "connected", NULL);
+  errors += CHECK_STACK("chttp2", &minimal_stack_args, GRPC_SERVER_CHANNEL,
+                        "server", "http-server", "connected", NULL);
+  errors += CHECK_STACK(NULL, &minimal_stack_args, GRPC_CLIENT_CHANNEL,
+                        "client-channel", NULL);
+
+  // tests with a default stack
+  errors += CHECK_STACK("unknown", NULL, GRPC_CLIENT_DIRECT_CHANNEL,
+                        "message_size", "deadline", "connected", NULL);
+  errors += CHECK_STACK("unknown", NULL, GRPC_CLIENT_SUBCHANNEL, "message_size",
+                        "connected", NULL);
+  errors += CHECK_STACK("unknown", NULL, GRPC_SERVER_CHANNEL, "server",
+                        "message_size", "deadline", "connected", NULL);
+  errors += CHECK_STACK("chttp2", NULL, GRPC_CLIENT_DIRECT_CHANNEL,
+                        "message_size", "deadline", "http-client",
+                        "message_compress", "connected", NULL);
+  errors += CHECK_STACK("chttp2", NULL, GRPC_CLIENT_SUBCHANNEL, "message_size",
+                        "http-client", "message_compress", "connected", NULL);
+  errors += CHECK_STACK("chttp2", NULL, GRPC_SERVER_CHANNEL, "server",
+                        "message_size", "deadline", "http-server",
+                        "message_compress", "connected", NULL);
+  errors +=
+      CHECK_STACK(NULL, NULL, GRPC_CLIENT_CHANNEL, "client-channel", NULL);
+
+  GPR_ASSERT(errors == 0);
+  grpc_shutdown();
+  return 0;
+}
+
+/*******************************************************************************
+ * End of tests definitions, start of test infrastructure
+ */
+
+static int check_stack(const char* file, int line, const char* transport_name,
+                       grpc_channel_args* init_args,
+                       unsigned channel_stack_type, ...) {
+  // create dummy channel stack
+  grpc_channel_stack_builder* builder = grpc_channel_stack_builder_create();
+  grpc_transport_vtable fake_transport_vtable;
+  memset(&fake_transport_vtable, 0, sizeof(grpc_transport_vtable));
+  fake_transport_vtable.name = transport_name;
+  grpc_transport fake_transport = {&fake_transport_vtable};
+  grpc_channel_stack_builder_set_target(builder, "foo.test.google.fr");
+  grpc_channel_args* channel_args = grpc_channel_args_copy(init_args);
+  if (transport_name != NULL) {
+    grpc_channel_stack_builder_set_transport(builder, &fake_transport);
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_stack_builder_set_channel_arguments(&exec_ctx, builder,
+                                                     channel_args);
+    GPR_ASSERT(grpc_channel_init_create_stack(
+        &exec_ctx, builder, (grpc_channel_stack_type)channel_stack_type));
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  // build up our expectation list
+  gpr_strvec v;
+  gpr_strvec_init(&v);
+  va_list args;
+  va_start(args, channel_stack_type);
+  for (;;) {
+    char* a = va_arg(args, char*);
+    if (a == NULL) break;
+    if (v.count != 0) gpr_strvec_add(&v, gpr_strdup(", "));
+    gpr_strvec_add(&v, gpr_strdup(a));
+  }
+  va_end(args);
+  char* expect = gpr_strvec_flatten(&v, NULL);
+  gpr_strvec_destroy(&v);
+
+  // build up our "got" list
+  gpr_strvec_init(&v);
+  grpc_channel_stack_builder_iterator* it =
+      grpc_channel_stack_builder_create_iterator_at_first(builder);
+  while (grpc_channel_stack_builder_move_next(it)) {
+    const char* name = grpc_channel_stack_builder_iterator_filter_name(it);
+    if (name == NULL) continue;
+    if (v.count != 0) gpr_strvec_add(&v, gpr_strdup(", "));
+    gpr_strvec_add(&v, gpr_strdup(name));
+  }
+  char* got = gpr_strvec_flatten(&v, NULL);
+  gpr_strvec_destroy(&v);
+  grpc_channel_stack_builder_iterator_destroy(it);
+
+  // figure out result, log if there's an error
+  int result = 0;
+  if (0 != strcmp(got, expect)) {
+    gpr_strvec_init(&v);
+    gpr_strvec_add(&v, gpr_strdup("{"));
+    for (size_t i = 0; i < channel_args->num_args; i++) {
+      if (i > 0) gpr_strvec_add(&v, gpr_strdup(", "));
+      gpr_strvec_add(&v, gpr_strdup(channel_args->args[i].key));
+      gpr_strvec_add(&v, gpr_strdup("="));
+      switch (channel_args->args[i].type) {
+        case GRPC_ARG_INTEGER: {
+          char* tmp;
+          gpr_asprintf(&tmp, "%d", channel_args->args[i].value.integer);
+          gpr_strvec_add(&v, tmp);
+          break;
+        }
+        case GRPC_ARG_STRING:
+          gpr_strvec_add(&v, gpr_strdup(channel_args->args[i].value.string));
+          break;
+        case GRPC_ARG_POINTER: {
+          char* tmp;
+          gpr_asprintf(&tmp, "%p", channel_args->args[i].value.pointer.p);
+          gpr_strvec_add(&v, tmp);
+          break;
+        }
+      }
+    }
+    gpr_strvec_add(&v, gpr_strdup("}"));
+    char* args_str = gpr_strvec_flatten(&v, NULL);
+    gpr_strvec_destroy(&v);
+
+    gpr_log(file, line, GPR_LOG_SEVERITY_ERROR,
+            "**************************************************");
+    gpr_log(
+        file, line, GPR_LOG_SEVERITY_ERROR,
+        "FAILED transport=%s; stack_type=%s; channel_args=%s:", transport_name,
+        grpc_channel_stack_type_string(
+            static_cast<grpc_channel_stack_type>(channel_stack_type)),
+        args_str);
+    gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "EXPECTED: %s", expect);
+    gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "GOT:      %s", got);
+    result = 1;
+
+    gpr_free(args_str);
+  }
+
+  gpr_free(got);
+  gpr_free(expect);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_stack_builder_destroy(&exec_ctx, builder);
+    grpc_channel_args_destroy(&exec_ctx, channel_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  return result;
+}
diff --git a/test/core/client_channel/BUILD b/test/core/client_channel/BUILD
index c4a9323..ec72e0e 100644
--- a/test/core/client_channel/BUILD
+++ b/test/core/client_channel/BUILD
@@ -22,8 +22,8 @@
 
 grpc_fuzzer(
     name = "uri_fuzzer_test",
-    srcs = ["uri_fuzzer_test.c"],
-    language = "C",
+    srcs = ["uri_fuzzer_test.cc"],
+    language = "C++",
     corpus = "uri_corpus",
     deps = [
         "//:gpr",
@@ -34,8 +34,8 @@
 
 grpc_cc_test(
     name = "lb_policies_test",
-    srcs = ["lb_policies_test.c"],
-    language = "C",
+    srcs = ["lb_policies_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/client_channel/lb_policies_test.c b/test/core/client_channel/lb_policies_test.c
deleted file mode 100644
index ba37cd6..0000000
--- a/test/core/client_channel/lb_policies_test.c
+++ /dev/null
@@ -1,1009 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdarg.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-#define RETRY_TIMEOUT 300
-
-typedef struct servers_fixture {
-  size_t num_servers;
-  grpc_server **servers;
-  grpc_call **server_calls;
-  grpc_completion_queue *cq;
-  grpc_completion_queue *shutdown_cq;
-  char **servers_hostports;
-  grpc_metadata_array *request_metadata_recv;
-} servers_fixture;
-
-typedef struct request_sequences {
-  size_t n;         /* number of iterations */
-  int *connections; /* indexed by the interation number, value is the index of
-                       the server it connected to or -1 if none */
-  int *connectivity_states; /* indexed by the interation number, value is the
-                               client connectivity state */
-} request_sequences;
-
-typedef void (*verifier_fn)(const servers_fixture *, grpc_channel *,
-                            const request_sequences *, const size_t);
-
-typedef struct test_spec {
-  size_t num_iters;
-  size_t num_servers;
-
-  int **kill_at;
-  int **revive_at;
-
-  const char *description;
-
-  verifier_fn verifier;
-
-} test_spec;
-
-static void test_spec_reset(test_spec *spec) {
-  size_t i, j;
-
-  for (i = 0; i < spec->num_iters; i++) {
-    for (j = 0; j < spec->num_servers; j++) {
-      spec->kill_at[i][j] = 0;
-      spec->revive_at[i][j] = 0;
-    }
-  }
-}
-
-static test_spec *test_spec_create(size_t num_iters, size_t num_servers) {
-  test_spec *spec;
-  size_t i;
-
-  spec = gpr_malloc(sizeof(test_spec));
-  spec->num_iters = num_iters;
-  spec->num_servers = num_servers;
-  spec->kill_at = gpr_malloc(sizeof(int *) * num_iters);
-  spec->revive_at = gpr_malloc(sizeof(int *) * num_iters);
-  for (i = 0; i < num_iters; i++) {
-    spec->kill_at[i] = gpr_malloc(sizeof(int) * num_servers);
-    spec->revive_at[i] = gpr_malloc(sizeof(int) * num_servers);
-  }
-
-  test_spec_reset(spec);
-  return spec;
-}
-
-static void test_spec_destroy(test_spec *spec) {
-  size_t i;
-  for (i = 0; i < spec->num_iters; i++) {
-    gpr_free(spec->kill_at[i]);
-    gpr_free(spec->revive_at[i]);
-  }
-
-  gpr_free(spec->kill_at);
-  gpr_free(spec->revive_at);
-
-  gpr_free(spec);
-}
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static gpr_timespec n_millis_time(int n) {
-  return gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                      gpr_time_from_millis(n, GPR_TIMESPAN));
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, n_millis_time(5000), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void kill_server(const servers_fixture *f, size_t i) {
-  gpr_log(GPR_INFO, "KILLING SERVER %" PRIuPTR, i);
-  GPR_ASSERT(f->servers[i] != NULL);
-  grpc_server_shutdown_and_notify(f->servers[i], f->shutdown_cq, tag(10000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(10000),
-                                         n_millis_time(5000), NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->servers[i]);
-  f->servers[i] = NULL;
-}
-
-typedef struct request_data {
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_slice details;
-  grpc_status_code status;
-  grpc_call_details *call_details;
-} request_data;
-
-static void revive_server(const servers_fixture *f, request_data *rdata,
-                          size_t i) {
-  int got_port;
-  gpr_log(GPR_INFO, "RAISE AGAIN SERVER %" PRIuPTR, i);
-  GPR_ASSERT(f->servers[i] == NULL);
-
-  gpr_log(GPR_DEBUG, "revive: %s", f->servers_hostports[i]);
-
-  f->servers[i] = grpc_server_create(NULL, NULL);
-  grpc_server_register_completion_queue(f->servers[i], f->cq, NULL);
-  GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port(
-                  f->servers[i], f->servers_hostports[i])) > 0);
-  grpc_server_start(f->servers[i]);
-
-  GPR_ASSERT(GRPC_CALL_OK ==
-             grpc_server_request_call(f->servers[i], &f->server_calls[i],
-                                      &rdata->call_details[i],
-                                      &f->request_metadata_recv[i], f->cq,
-                                      f->cq, tag(1000 + (int)i)));
-}
-
-static servers_fixture *setup_servers(const char *server_host,
-                                      request_data *rdata,
-                                      const size_t num_servers) {
-  servers_fixture *f = gpr_malloc(sizeof(servers_fixture));
-  size_t i;
-
-  f->num_servers = num_servers;
-  f->server_calls = gpr_malloc(sizeof(grpc_call *) * num_servers);
-  f->request_metadata_recv =
-      gpr_malloc(sizeof(grpc_metadata_array) * num_servers);
-  /* Create servers. */
-  f->servers = gpr_malloc(sizeof(grpc_server *) * num_servers);
-  f->servers_hostports = gpr_malloc(sizeof(char *) * num_servers);
-  f->cq = grpc_completion_queue_create_for_next(NULL);
-  f->shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-  for (i = 0; i < num_servers; i++) {
-    grpc_metadata_array_init(&f->request_metadata_recv[i]);
-    gpr_join_host_port(&f->servers_hostports[i], server_host,
-                       grpc_pick_unused_port_or_die());
-    f->servers[i] = 0;
-    revive_server(f, rdata, i);
-  }
-  return f;
-}
-
-static void teardown_servers(servers_fixture *f) {
-  size_t i;
-  /* Destroy server. */
-  for (i = 0; i < f->num_servers; i++) {
-    if (f->servers[i] == NULL) continue;
-    grpc_server_shutdown_and_notify(f->servers[i], f->shutdown_cq, tag(10000));
-    GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(10000),
-                                           n_millis_time(5000), NULL)
-                   .type == GRPC_OP_COMPLETE);
-    grpc_server_destroy(f->servers[i]);
-  }
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-
-  gpr_free(f->servers);
-
-  for (i = 0; i < f->num_servers; i++) {
-    gpr_free(f->servers_hostports[i]);
-    grpc_metadata_array_destroy(&f->request_metadata_recv[i]);
-  }
-
-  gpr_free(f->servers_hostports);
-  gpr_free(f->request_metadata_recv);
-  gpr_free(f->server_calls);
-  gpr_free(f);
-}
-
-static request_sequences request_sequences_create(size_t n) {
-  request_sequences res;
-  res.n = n;
-  res.connections = gpr_malloc(sizeof(*res.connections) * n);
-  res.connectivity_states = gpr_malloc(sizeof(*res.connectivity_states) * n);
-  memset(res.connections, 0, sizeof(*res.connections) * n);
-  memset(res.connectivity_states, 0, sizeof(*res.connectivity_states) * n);
-  return res;
-}
-
-static void request_sequences_destroy(const request_sequences *rseqs) {
-  gpr_free(rseqs->connections);
-  gpr_free(rseqs->connectivity_states);
-}
-
-/** Returns connection sequence (server indices), which must be freed */
-static request_sequences perform_request(servers_fixture *f,
-                                         grpc_channel *client,
-                                         request_data *rdata,
-                                         const test_spec *spec) {
-  grpc_call *c;
-  int s_idx;
-  int *s_valid;
-  grpc_op ops[6];
-  grpc_op *op;
-  int was_cancelled;
-  size_t i, iter_num;
-  grpc_event ev;
-  int read_tag;
-  int completed_client;
-  const request_sequences sequences = request_sequences_create(spec->num_iters);
-
-  s_valid = gpr_malloc(sizeof(int) * f->num_servers);
-
-  for (iter_num = 0; iter_num < spec->num_iters; iter_num++) {
-    cq_verifier *cqv = cq_verifier_create(f->cq);
-    was_cancelled = 2;
-
-    for (i = 0; i < f->num_servers; i++) {
-      if (spec->kill_at[iter_num][i] != 0) {
-        kill_server(f, i);
-      } else if (spec->revive_at[iter_num][i] != 0) {
-        /* killing takes precedence */
-        revive_server(f, rdata, i);
-      }
-    }
-
-    sequences.connections[iter_num] = -1;
-    grpc_metadata_array_init(&rdata->initial_metadata_recv);
-    grpc_metadata_array_init(&rdata->trailing_metadata_recv);
-
-    for (i = 0; i < f->num_servers; i++) {
-      grpc_call_details_init(&rdata->call_details[i]);
-    }
-    memset(s_valid, 0, f->num_servers * sizeof(int));
-
-    grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr");
-    c = grpc_channel_create_call(client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
-                                 grpc_slice_from_static_string("/foo"), &host,
-                                 gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(c);
-    completed_client = 0;
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_INITIAL_METADATA;
-    op->data.send_initial_metadata.count = 0;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_RECV_INITIAL_METADATA;
-    op->data.recv_initial_metadata.recv_initial_metadata =
-        &rdata->initial_metadata_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-    op->data.recv_status_on_client.trailing_metadata =
-        &rdata->trailing_metadata_recv;
-    op->data.recv_status_on_client.status = &rdata->status;
-    op->data.recv_status_on_client.status_details = &rdata->details;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    GPR_ASSERT(GRPC_CALL_OK ==
-               grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL));
-
-    s_idx = -1;
-    while (
-        (ev = grpc_completion_queue_next(
-             f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), NULL))
-            .type != GRPC_QUEUE_TIMEOUT) {
-      GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-      read_tag = ((int)(intptr_t)ev.tag);
-      const grpc_connectivity_state conn_state =
-          grpc_channel_check_connectivity_state(client, 0);
-      sequences.connectivity_states[iter_num] = conn_state;
-      gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%" PRIuPTR,
-              ev.success, ev.type, read_tag, iter_num);
-      if (ev.success && read_tag >= 1000) {
-        GPR_ASSERT(s_idx == -1); /* only one server must reply */
-        /* only server notifications for non-shutdown events */
-        s_idx = read_tag - 1000;
-        s_valid[s_idx] = 1;
-        sequences.connections[iter_num] = s_idx;
-        break;
-      } else if (read_tag == 1) {
-        gpr_log(GPR_DEBUG, "client timed out");
-        GPR_ASSERT(ev.success);
-        completed_client = 1;
-      }
-    }
-
-    if (s_idx >= 0) {
-      memset(ops, 0, sizeof(ops));
-      op = ops;
-      op->op = GRPC_OP_SEND_INITIAL_METADATA;
-      op->data.send_initial_metadata.count = 0;
-      op->flags = 0;
-      op->reserved = NULL;
-      op++;
-      op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-      op->data.send_status_from_server.trailing_metadata_count = 0;
-      op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-      grpc_slice status_details = grpc_slice_from_static_string("xyz");
-      op->data.send_status_from_server.status_details = &status_details;
-      op->flags = 0;
-      op->reserved = NULL;
-      op++;
-      op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-      op->data.recv_close_on_server.cancelled = &was_cancelled;
-      op->flags = 0;
-      op->reserved = NULL;
-      op++;
-      GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(f->server_calls[s_idx],
-                                                       ops, (size_t)(op - ops),
-                                                       tag(102), NULL));
-
-      CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-      if (!completed_client) {
-        CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-      }
-      cq_verify(cqv);
-
-      GPR_ASSERT(rdata->status == GRPC_STATUS_UNIMPLEMENTED);
-      GPR_ASSERT(0 == grpc_slice_str_cmp(rdata->details, "xyz"));
-      GPR_ASSERT(0 ==
-                 grpc_slice_str_cmp(rdata->call_details[s_idx].method, "/foo"));
-      GPR_ASSERT(0 == grpc_slice_str_cmp(rdata->call_details[s_idx].host,
-                                         "foo.test.google.fr"));
-      GPR_ASSERT(was_cancelled == 1);
-
-      grpc_call_unref(f->server_calls[s_idx]);
-
-      /* ask for the next request on this server */
-      GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                     f->servers[s_idx], &f->server_calls[s_idx],
-                                     &rdata->call_details[s_idx],
-                                     &f->request_metadata_recv[s_idx], f->cq,
-                                     f->cq, tag(1000 + (int)s_idx)));
-    } else { /* no response from server */
-      grpc_call_cancel(c, NULL);
-      if (!completed_client) {
-        CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-        cq_verify(cqv);
-      }
-    }
-
-    GPR_ASSERT(
-        grpc_completion_queue_next(
-            f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), NULL)
-            .type == GRPC_QUEUE_TIMEOUT);
-
-    grpc_metadata_array_destroy(&rdata->initial_metadata_recv);
-    grpc_metadata_array_destroy(&rdata->trailing_metadata_recv);
-
-    cq_verifier_destroy(cqv);
-
-    grpc_call_unref(c);
-
-    for (i = 0; i < f->num_servers; i++) {
-      grpc_call_details_destroy(&rdata->call_details[i]);
-    }
-    grpc_slice_unref(rdata->details);
-  }
-
-  gpr_free(s_valid);
-
-  return sequences;
-}
-
-static grpc_call **perform_multirequest(servers_fixture *f,
-                                        grpc_channel *client,
-                                        size_t concurrent_calls) {
-  grpc_call **calls;
-  grpc_op ops[6];
-  grpc_op *op;
-  size_t i;
-
-  calls = gpr_malloc(sizeof(grpc_call *) * concurrent_calls);
-  for (i = 0; i < f->num_servers; i++) {
-    kill_server(f, i);
-  }
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-
-  grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr");
-  for (i = 0; i < concurrent_calls; i++) {
-    calls[i] =
-        grpc_channel_create_call(client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
-                                 grpc_slice_from_static_string("/foo"), &host,
-                                 gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(calls[i]);
-    GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(calls[i], ops,
-                                                     (size_t)(op - ops), tag(1),
-                                                     NULL));
-  }
-
-  return calls;
-}
-
-void run_spec(const test_spec *spec) {
-  grpc_channel *client;
-  char *client_hostport;
-  char *servers_hostports_str;
-  request_data rdata;
-  servers_fixture *f;
-  grpc_channel_args args;
-  grpc_arg arg_array[2];
-  rdata.call_details =
-      gpr_malloc(sizeof(grpc_call_details) * spec->num_servers);
-  f = setup_servers("127.0.0.1", &rdata, spec->num_servers);
-
-  /* Create client. */
-  servers_hostports_str = gpr_strjoin_sep((const char **)f->servers_hostports,
-                                          f->num_servers, ",", NULL);
-  gpr_asprintf(&client_hostport, "ipv4:%s", servers_hostports_str);
-
-  arg_array[0].type = GRPC_ARG_INTEGER;
-  arg_array[0].key = "grpc.testing.fixed_reconnect_backoff_ms";
-  arg_array[0].value.integer = RETRY_TIMEOUT;
-  arg_array[1].type = GRPC_ARG_STRING;
-  arg_array[1].key = GRPC_ARG_LB_POLICY_NAME;
-  arg_array[1].value.string = "round_robin";
-  args.num_args = 2;
-  args.args = arg_array;
-
-  client = grpc_insecure_channel_create(client_hostport, &args, NULL);
-
-  gpr_log(GPR_INFO, "Testing '%s' with servers=%s client=%s", spec->description,
-          servers_hostports_str, client_hostport);
-
-  const request_sequences sequences = perform_request(f, client, &rdata, spec);
-
-  spec->verifier(f, client, &sequences, spec->num_iters);
-
-  gpr_free(client_hostport);
-  gpr_free(servers_hostports_str);
-  gpr_free(rdata.call_details);
-  request_sequences_destroy(&sequences);
-
-  grpc_channel_destroy(client); /* calls the LB's shutdown func */
-  teardown_servers(f);
-}
-
-static grpc_channel *create_client(const servers_fixture *f) {
-  grpc_channel *client;
-  char *client_hostport;
-  char *servers_hostports_str;
-  grpc_arg arg_array[3];
-  grpc_channel_args args;
-
-  servers_hostports_str = gpr_strjoin_sep((const char **)f->servers_hostports,
-                                          f->num_servers, ",", NULL);
-  gpr_asprintf(&client_hostport, "ipv4:%s", servers_hostports_str);
-
-  arg_array[0].type = GRPC_ARG_INTEGER;
-  arg_array[0].key = "grpc.testing.fixed_reconnect_backoff_ms";
-  arg_array[0].value.integer = RETRY_TIMEOUT;
-  arg_array[1].type = GRPC_ARG_STRING;
-  arg_array[1].key = GRPC_ARG_LB_POLICY_NAME;
-  arg_array[1].value.string = "ROUND_ROBIN";
-  arg_array[2].type = GRPC_ARG_INTEGER;
-  arg_array[2].key = GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS;
-  arg_array[2].value.integer = 0;
-  args.num_args = GPR_ARRAY_SIZE(arg_array);
-  args.args = arg_array;
-
-  client = grpc_insecure_channel_create(client_hostport, &args, NULL);
-  gpr_free(client_hostport);
-  gpr_free(servers_hostports_str);
-
-  return client;
-}
-
-static void test_ping() {
-  grpc_channel *client;
-  request_data rdata;
-  servers_fixture *f;
-  cq_verifier *cqv;
-  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
-  const size_t num_servers = 1;
-  int i;
-
-  rdata.call_details = gpr_malloc(sizeof(grpc_call_details) * num_servers);
-  f = setup_servers("127.0.0.1", &rdata, num_servers);
-  cqv = cq_verifier_create(f->cq);
-
-  client = create_client(f);
-
-  grpc_channel_ping(client, f->cq, tag(0), NULL);
-  CQ_EXPECT_COMPLETION(cqv, tag(0), 0);
-
-  /* check that we're still in idle, and start connecting */
-  GPR_ASSERT(grpc_channel_check_connectivity_state(client, 1) ==
-             GRPC_CHANNEL_IDLE);
-  /* we'll go through some set of transitions (some might be missed), until
-     READY is reached */
-  while (state != GRPC_CHANNEL_READY) {
-    grpc_channel_watch_connectivity_state(
-        client, state, grpc_timeout_seconds_to_deadline(3), f->cq, tag(99));
-    CQ_EXPECT_COMPLETION(cqv, tag(99), 1);
-    cq_verify(cqv);
-    state = grpc_channel_check_connectivity_state(client, 0);
-    GPR_ASSERT(state == GRPC_CHANNEL_READY ||
-               state == GRPC_CHANNEL_CONNECTING ||
-               state == GRPC_CHANNEL_TRANSIENT_FAILURE);
-  }
-
-  for (i = 1; i <= 5; i++) {
-    grpc_channel_ping(client, f->cq, tag(i), NULL);
-    CQ_EXPECT_COMPLETION(cqv, tag(i), 1);
-    cq_verify(cqv);
-  }
-  gpr_free(rdata.call_details);
-
-  grpc_channel_destroy(client);
-  teardown_servers(f);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_pending_calls(size_t concurrent_calls) {
-  size_t i;
-  grpc_call **calls;
-  grpc_channel *client;
-  request_data rdata;
-  servers_fixture *f;
-  test_spec *spec = test_spec_create(0, 4);
-  rdata.call_details =
-      gpr_malloc(sizeof(grpc_call_details) * spec->num_servers);
-  f = setup_servers("127.0.0.1", &rdata, spec->num_servers);
-
-  client = create_client(f);
-  calls = perform_multirequest(f, client, concurrent_calls);
-  grpc_call_cancel(
-      calls[0],
-      NULL); /* exercise the cancel pick path whilst there are pending picks */
-
-  gpr_free(rdata.call_details);
-
-  grpc_channel_destroy(client); /* calls the LB's shutdown func */
-  /* destroy the calls after the channel so that they are still around for the
-   * LB's shutdown func to process */
-  for (i = 0; i < concurrent_calls; i++) {
-    grpc_call_unref(calls[i]);
-  }
-  gpr_free(calls);
-  teardown_servers(f);
-  test_spec_destroy(spec);
-}
-
-static void test_get_channel_info() {
-  grpc_channel *channel =
-      grpc_insecure_channel_create("ipv4:127.0.0.1:1234", NULL, NULL);
-  // Ensures that resolver returns.
-  grpc_channel_check_connectivity_state(channel, true /* try_to_connect */);
-  // First, request no fields.  This is a no-op.
-  grpc_channel_info channel_info;
-  memset(&channel_info, 0, sizeof(channel_info));
-  grpc_channel_get_info(channel, &channel_info);
-  // Request LB policy name.
-  char *lb_policy_name = NULL;
-  channel_info.lb_policy_name = &lb_policy_name;
-  grpc_channel_get_info(channel, &channel_info);
-  GPR_ASSERT(lb_policy_name != NULL);
-  GPR_ASSERT(strcmp(lb_policy_name, "pick_first") == 0);
-  gpr_free(lb_policy_name);
-  // Request service config, which does not exist, so we'll get nothing back.
-  memset(&channel_info, 0, sizeof(channel_info));
-  char *service_config_json = "dummy_string";
-  channel_info.service_config_json = &service_config_json;
-  grpc_channel_get_info(channel, &channel_info);
-  GPR_ASSERT(service_config_json == NULL);
-  // Recreate the channel such that it has a service config.
-  grpc_channel_destroy(channel);
-  grpc_arg arg;
-  arg.type = GRPC_ARG_STRING;
-  arg.key = GRPC_ARG_SERVICE_CONFIG;
-  arg.value.string = "{\"loadBalancingPolicy\": \"ROUND_ROBIN\"}";
-  grpc_channel_args *args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
-  channel = grpc_insecure_channel_create("ipv4:127.0.0.1:1234", args, NULL);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  // Ensures that resolver returns.
-  grpc_channel_check_connectivity_state(channel, true /* try_to_connect */);
-  // Now request the service config again.
-  grpc_channel_get_info(channel, &channel_info);
-  GPR_ASSERT(service_config_json != NULL);
-  GPR_ASSERT(strcmp(service_config_json, arg.value.string) == 0);
-  gpr_free(service_config_json);
-  // Clean up.
-  grpc_channel_destroy(channel);
-}
-
-static void print_failed_expectations(const int *expected_connection_sequence,
-                                      const int *actual_connection_sequence,
-                                      const size_t expected_seq_length,
-                                      const size_t num_iters) {
-  size_t i;
-  for (i = 0; i < num_iters; i++) {
-    gpr_log(GPR_ERROR,
-            "FAILURE: Iter (expected, actual): %" PRIuPTR " (%d, %d)", i,
-            expected_connection_sequence[i % expected_seq_length],
-            actual_connection_sequence[i]);
-  }
-}
-
-static void verify_vanilla_round_robin(const servers_fixture *f,
-                                       grpc_channel *client,
-                                       const request_sequences *sequences,
-                                       const size_t num_iters) {
-  const size_t expected_seq_length = f->num_servers;
-
-  /* verify conn. seq. expectation */
-  /* get the first sequence of "num_servers" elements */
-  int *expected_connection_sequence =
-      gpr_malloc(sizeof(int) * expected_seq_length);
-  memcpy(expected_connection_sequence, sequences->connections,
-         sizeof(int) * expected_seq_length);
-
-  for (size_t i = 0; i < num_iters; i++) {
-    const int actual = sequences->connections[i];
-    const int expected = expected_connection_sequence[i % expected_seq_length];
-    if (actual != expected) {
-      gpr_log(
-          GPR_ERROR,
-          "CONNECTION SEQUENCE FAILURE: expected %d, got %d at iteration #%d",
-          expected, actual, (int)i);
-      abort();
-    }
-  }
-
-  /* All servers are available, therefore all client subchannels are READY, even
-   * when we only need one for the client channel state to be READY */
-  for (size_t i = 0; i < sequences->n; i++) {
-    const grpc_connectivity_state actual = sequences->connectivity_states[i];
-    const grpc_connectivity_state expected = GRPC_CHANNEL_READY;
-    if (actual != expected) {
-      gpr_log(GPR_ERROR,
-              "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
-              "at iteration #%d",
-              grpc_connectivity_state_name(expected),
-              grpc_connectivity_state_name(actual), (int)i);
-      abort();
-    }
-  }
-
-  gpr_free(expected_connection_sequence);
-}
-
-/* At the start of the second iteration, all but the first and last servers (as
- * given in "f") are killed */
-static void verify_vanishing_floor_round_robin(
-    const servers_fixture *f, grpc_channel *client,
-    const request_sequences *sequences, const size_t num_iters) {
-  int *expected_connection_sequence;
-  const size_t expected_seq_length = 2;
-  size_t i;
-
-  /* verify conn. seq. expectation */
-  /* copy the first full sequence (without -1s) */
-  expected_connection_sequence = gpr_malloc(sizeof(int) * expected_seq_length);
-  memcpy(expected_connection_sequence, sequences->connections + 2,
-         expected_seq_length * sizeof(int));
-
-  /* first two elements of the sequence should be [0 (1st server), -1 (failure)]
-   */
-  GPR_ASSERT(sequences->connections[0] == 0);
-  GPR_ASSERT(sequences->connections[1] == -1);
-
-  /* the next two element must be [3, 0], repeating from that point: the 3 is
-   * brought forth by servers 1 and 2 disappearing after the intial pick of 0 */
-  GPR_ASSERT(sequences->connections[2] == 3);
-  GPR_ASSERT(sequences->connections[3] == 0);
-
-  /* make sure that the expectation obliges */
-  for (i = 2; i < num_iters; i++) {
-    const int actual = sequences->connections[i];
-    const int expected = expected_connection_sequence[i % expected_seq_length];
-    if (actual != expected) {
-      print_failed_expectations(expected_connection_sequence,
-                                sequences->connections, expected_seq_length,
-                                num_iters);
-      abort();
-    }
-  }
-
-  /* There's always at least one subchannel READY (connected), therefore the
-   * overall state of the client channel is READY at all times. */
-  for (i = 0; i < sequences->n; i++) {
-    const grpc_connectivity_state actual = sequences->connectivity_states[i];
-    const grpc_connectivity_state expected = GRPC_CHANNEL_READY;
-    if (actual != expected) {
-      gpr_log(GPR_ERROR,
-              "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
-              "at iteration #%d",
-              grpc_connectivity_state_name(expected),
-              grpc_connectivity_state_name(actual), (int)i);
-      abort();
-    }
-  }
-
-  gpr_free(expected_connection_sequence);
-}
-
-static void verify_total_carnage_round_robin(const servers_fixture *f,
-                                             grpc_channel *client,
-                                             const request_sequences *sequences,
-                                             const size_t num_iters) {
-  for (size_t i = 0; i < num_iters; i++) {
-    const int actual = sequences->connections[i];
-    const int expected = -1;
-    if (actual != expected) {
-      gpr_log(
-          GPR_ERROR,
-          "CONNECTION SEQUENCE FAILURE: expected %d, got %d at iteration #%d",
-          expected, actual, (int)i);
-      abort();
-    }
-  }
-
-  /* No server is ever available. There should be no READY states (or SHUTDOWN).
-   * Note that all other states (IDLE, CONNECTING, TRANSIENT_FAILURE) are still
-   * possible, as the policy transitions while attempting to reconnect. */
-  for (size_t i = 0; i < sequences->n; i++) {
-    const grpc_connectivity_state actual = sequences->connectivity_states[i];
-    if (actual == GRPC_CHANNEL_READY || actual == GRPC_CHANNEL_SHUTDOWN) {
-      gpr_log(GPR_ERROR,
-              "CONNECTIVITY STATUS SEQUENCE FAILURE: got unexpected state "
-              "'%s' at iteration #%d.",
-              grpc_connectivity_state_name(actual), (int)i);
-      abort();
-    }
-  }
-}
-
-static void verify_partial_carnage_round_robin(
-    const servers_fixture *f, grpc_channel *client,
-    const request_sequences *sequences, const size_t num_iters) {
-  int *expected_connection_sequence;
-  size_t i;
-  const size_t expected_seq_length = f->num_servers;
-
-  /* verify conn. seq. expectation */
-  /* get the first sequence of "num_servers" elements */
-  expected_connection_sequence = gpr_malloc(sizeof(int) * expected_seq_length);
-  memcpy(expected_connection_sequence, sequences->connections,
-         sizeof(int) * expected_seq_length);
-
-  for (i = 0; i < num_iters / 2; i++) {
-    const int actual = sequences->connections[i];
-    const int expected = expected_connection_sequence[i % expected_seq_length];
-    if (actual != expected) {
-      print_failed_expectations(expected_connection_sequence,
-                                sequences->connections, expected_seq_length,
-                                num_iters);
-      abort();
-    }
-  }
-
-  /* second half of the iterations go without response */
-  for (; i < num_iters; i++) {
-    GPR_ASSERT(sequences->connections[i] == -1);
-  }
-
-  /* We can assert that the first client channel state should be READY, when all
-   * servers were available */
-  grpc_connectivity_state actual = sequences->connectivity_states[0];
-  grpc_connectivity_state expected = GRPC_CHANNEL_READY;
-  if (actual != expected) {
-    gpr_log(GPR_ERROR,
-            "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
-            "at iteration #%d",
-            grpc_connectivity_state_name(expected),
-            grpc_connectivity_state_name(actual), 0);
-    abort();
-  }
-
-  /* ... and that the last one shouldn't be READY (or SHUTDOWN): all servers are
-   * gone. It may be all other states (IDLE, CONNECTING, TRANSIENT_FAILURE), as
-   * the policy transitions while attempting to reconnect. */
-  actual = sequences->connectivity_states[num_iters - 1];
-  for (i = 0; i < sequences->n; i++) {
-    if (actual == GRPC_CHANNEL_READY || actual == GRPC_CHANNEL_SHUTDOWN) {
-      gpr_log(GPR_ERROR,
-              "CONNECTIVITY STATUS SEQUENCE FAILURE: got unexpected state "
-              "'%s' at iteration #%d.",
-              grpc_connectivity_state_name(actual), (int)i);
-      abort();
-    }
-  }
-  gpr_free(expected_connection_sequence);
-}
-
-static void dump_array(const char *desc, const int *data, const size_t count) {
-  gpr_strvec s;
-  char *tmp;
-  size_t i;
-  gpr_strvec_init(&s);
-  gpr_strvec_add(&s, gpr_strdup(desc));
-  gpr_strvec_add(&s, gpr_strdup(":"));
-  for (i = 0; i < count; i++) {
-    gpr_asprintf(&tmp, " %d", data[i]);
-    gpr_strvec_add(&s, tmp);
-  }
-  tmp = gpr_strvec_flatten(&s, NULL);
-  gpr_strvec_destroy(&s);
-  gpr_log(GPR_DEBUG, "%s", tmp);
-  gpr_free(tmp);
-}
-
-static void verify_rebirth_round_robin(const servers_fixture *f,
-                                       grpc_channel *client,
-                                       const request_sequences *sequences,
-                                       const size_t num_iters) {
-  dump_array("actual_connection_sequence", sequences->connections, num_iters);
-
-  /* first iteration succeeds */
-  GPR_ASSERT(sequences->connections[0] != -1);
-  /* then we fail for a while... */
-  GPR_ASSERT(sequences->connections[1] == -1);
-  /* ... but should be up eventually */
-  size_t first_iter_back_up = ~0ul;
-  for (size_t i = 2; i < sequences->n; ++i) {
-    if (sequences->connections[i] != -1) {
-      first_iter_back_up = i;
-      break;
-    }
-  }
-  GPR_ASSERT(first_iter_back_up != ~0ul);
-
-  /* We can assert that the first client channel state should be READY, when all
-   * servers were available; same thing for the last one. In the middle
-   * somewhere there must exist at least one TRANSIENT_FAILURE */
-  grpc_connectivity_state actual = sequences->connectivity_states[0];
-  grpc_connectivity_state expected = GRPC_CHANNEL_READY;
-  if (actual != expected) {
-    gpr_log(GPR_ERROR,
-            "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
-            "at iteration #%d",
-            grpc_connectivity_state_name(expected),
-            grpc_connectivity_state_name(actual), 0);
-    abort();
-  }
-
-  actual = sequences->connectivity_states[num_iters - 1];
-  expected = GRPC_CHANNEL_READY;
-  if (actual != expected) {
-    gpr_log(GPR_ERROR,
-            "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
-            "at iteration #%d",
-            grpc_connectivity_state_name(expected),
-            grpc_connectivity_state_name(actual), (int)num_iters - 1);
-    abort();
-  }
-
-  bool found_failure_status = false;
-  for (size_t i = 1; i < sequences->n - 1; i++) {
-    if (sequences->connectivity_states[i] == GRPC_CHANNEL_TRANSIENT_FAILURE) {
-      found_failure_status = true;
-      break;
-    }
-  }
-  if (!found_failure_status) {
-    gpr_log(
-        GPR_ERROR,
-        "CONNECTIVITY STATUS SEQUENCE FAILURE: "
-        "GRPC_CHANNEL_TRANSIENT_FAILURE status not found. Got the following "
-        "instead:");
-    for (size_t i = 0; i < num_iters; i++) {
-      gpr_log(GPR_ERROR, "[%d]: %s", (int)i,
-              grpc_connectivity_state_name(sequences->connectivity_states[i]));
-    }
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  test_spec *spec;
-  size_t i;
-  const size_t NUM_ITERS = 10;
-  const size_t NUM_SERVERS = 4;
-
-  grpc_init();
-  grpc_test_init(argc, argv);
-  grpc_tracer_set_enabled("round_robin", 1);
-
-  GPR_ASSERT(grpc_lb_policy_create(&exec_ctx, "this-lb-policy-does-not-exist",
-                                   NULL) == NULL);
-  GPR_ASSERT(grpc_lb_policy_create(&exec_ctx, NULL, NULL) == NULL);
-
-  spec = test_spec_create(NUM_ITERS, NUM_SERVERS);
-  /* everything is fine, all servers stay up the whole time and life's peachy
-   */
-  spec->verifier = verify_vanilla_round_robin;
-  spec->description = "test_all_server_up";
-  run_spec(spec);
-
-  /* Kill all servers first thing in the morning */
-  test_spec_reset(spec);
-  spec->verifier = verify_total_carnage_round_robin;
-  spec->description = "test_kill_all_server";
-  for (i = 0; i < NUM_SERVERS; i++) {
-    spec->kill_at[0][i] = 1;
-  }
-  run_spec(spec);
-
-  /* at the start of the 2nd iteration, kill all but the first and last
-   * servers.
-   * This should knock down the server bound to be selected next */
-  test_spec_reset(spec);
-  spec->verifier = verify_vanishing_floor_round_robin;
-  spec->description = "test_kill_middle_servers_at_2nd_iteration";
-  for (i = 1; i < NUM_SERVERS - 1; i++) {
-    spec->kill_at[1][i] = 1;
-  }
-  run_spec(spec);
-
-  /* Midway, kill all servers. */
-  test_spec_reset(spec);
-  spec->verifier = verify_partial_carnage_round_robin;
-  spec->description = "test_kill_all_server_midway";
-  for (i = 0; i < NUM_SERVERS; i++) {
-    spec->kill_at[spec->num_iters / 2][i] = 1;
-  }
-  run_spec(spec);
-
-  /* After first iteration, kill all servers. On the third one, bring them all
-   * back up. */
-  test_spec_reset(spec);
-  spec->verifier = verify_rebirth_round_robin;
-  spec->description = "test_kill_all_server_after_1st_resurrect_at_3rd";
-  for (i = 0; i < NUM_SERVERS; i++) {
-    spec->kill_at[1][i] = 1;
-    spec->revive_at[3][i] = 1;
-  }
-  run_spec(spec);
-  test_spec_destroy(spec);
-
-  test_pending_calls(4);
-  test_ping();
-  test_get_channel_info();
-
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/client_channel/lb_policies_test.cc b/test/core/client_channel/lb_policies_test.cc
new file mode 100644
index 0000000..3b90748
--- /dev/null
+++ b/test/core/client_channel/lb_policies_test.cc
@@ -0,0 +1,1031 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdarg.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+#define RETRY_TIMEOUT 300
+
+typedef struct servers_fixture {
+  size_t num_servers;
+  grpc_server** servers;
+  grpc_call** server_calls;
+  grpc_completion_queue* cq;
+  grpc_completion_queue* shutdown_cq;
+  char** servers_hostports;
+  grpc_metadata_array* request_metadata_recv;
+} servers_fixture;
+
+typedef struct request_sequences {
+  size_t n;         /* number of iterations */
+  int* connections; /* indexed by the interation number, value is the index of
+                       the server it connected to or -1 if none */
+  /* indexed by the interation number, value is the client connectivity state */
+  grpc_connectivity_state* connectivity_states;
+} request_sequences;
+
+typedef void (*verifier_fn)(const servers_fixture*, grpc_channel*,
+                            const request_sequences*, const size_t);
+
+typedef struct test_spec {
+  size_t num_iters;
+  size_t num_servers;
+
+  int** kill_at;
+  int** revive_at;
+
+  const char* description;
+
+  verifier_fn verifier;
+
+} test_spec;
+
+static void test_spec_reset(test_spec* spec) {
+  size_t i, j;
+
+  for (i = 0; i < spec->num_iters; i++) {
+    for (j = 0; j < spec->num_servers; j++) {
+      spec->kill_at[i][j] = 0;
+      spec->revive_at[i][j] = 0;
+    }
+  }
+}
+
+static test_spec* test_spec_create(size_t num_iters, size_t num_servers) {
+  test_spec* spec;
+  size_t i;
+
+  spec = static_cast<test_spec*>(gpr_malloc(sizeof(test_spec)));
+  spec->num_iters = num_iters;
+  spec->num_servers = num_servers;
+  spec->kill_at = static_cast<int**>(gpr_malloc(sizeof(int*) * num_iters));
+  spec->revive_at = static_cast<int**>(gpr_malloc(sizeof(int*) * num_iters));
+  for (i = 0; i < num_iters; i++) {
+    spec->kill_at[i] = static_cast<int*>(gpr_malloc(sizeof(int) * num_servers));
+    spec->revive_at[i] =
+        static_cast<int*>(gpr_malloc(sizeof(int) * num_servers));
+  }
+
+  test_spec_reset(spec);
+  return spec;
+}
+
+static void test_spec_destroy(test_spec* spec) {
+  size_t i;
+  for (i = 0; i < spec->num_iters; i++) {
+    gpr_free(spec->kill_at[i]);
+    gpr_free(spec->revive_at[i]);
+  }
+
+  gpr_free(spec->kill_at);
+  gpr_free(spec->revive_at);
+
+  gpr_free(spec);
+}
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static gpr_timespec n_millis_time(int n) {
+  return gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                      gpr_time_from_millis(n, GPR_TIMESPAN));
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, n_millis_time(5000), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void kill_server(const servers_fixture* f, size_t i) {
+  gpr_log(GPR_INFO, "KILLING SERVER %" PRIuPTR, i);
+  GPR_ASSERT(f->servers[i] != NULL);
+  grpc_server_shutdown_and_notify(f->servers[i], f->shutdown_cq, tag(10000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(10000),
+                                         n_millis_time(5000), NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->servers[i]);
+  f->servers[i] = NULL;
+}
+
+typedef struct request_data {
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_slice details;
+  grpc_status_code status;
+  grpc_call_details* call_details;
+} request_data;
+
+static void revive_server(const servers_fixture* f, request_data* rdata,
+                          size_t i) {
+  int got_port;
+  gpr_log(GPR_INFO, "RAISE AGAIN SERVER %" PRIuPTR, i);
+  GPR_ASSERT(f->servers[i] == NULL);
+
+  gpr_log(GPR_DEBUG, "revive: %s", f->servers_hostports[i]);
+
+  f->servers[i] = grpc_server_create(NULL, NULL);
+  grpc_server_register_completion_queue(f->servers[i], f->cq, NULL);
+  GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port(
+                  f->servers[i], f->servers_hostports[i])) > 0);
+  grpc_server_start(f->servers[i]);
+
+  GPR_ASSERT(GRPC_CALL_OK ==
+             grpc_server_request_call(f->servers[i], &f->server_calls[i],
+                                      &rdata->call_details[i],
+                                      &f->request_metadata_recv[i], f->cq,
+                                      f->cq, tag(1000 + (int)i)));
+}
+
+static servers_fixture* setup_servers(const char* server_host,
+                                      request_data* rdata,
+                                      const size_t num_servers) {
+  servers_fixture* f =
+      static_cast<servers_fixture*>(gpr_malloc(sizeof(servers_fixture)));
+  size_t i;
+
+  f->num_servers = num_servers;
+  f->server_calls =
+      static_cast<grpc_call**>(gpr_malloc(sizeof(grpc_call*) * num_servers));
+  f->request_metadata_recv = static_cast<grpc_metadata_array*>(
+      gpr_malloc(sizeof(grpc_metadata_array) * num_servers));
+  /* Create servers. */
+  f->servers = static_cast<grpc_server**>(
+      gpr_malloc(sizeof(grpc_server*) * num_servers));
+  f->servers_hostports =
+      static_cast<char**>(gpr_malloc(sizeof(char*) * num_servers));
+  f->cq = grpc_completion_queue_create_for_next(NULL);
+  f->shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+  for (i = 0; i < num_servers; i++) {
+    grpc_metadata_array_init(&f->request_metadata_recv[i]);
+    gpr_join_host_port(&f->servers_hostports[i], server_host,
+                       grpc_pick_unused_port_or_die());
+    f->servers[i] = 0;
+    revive_server(f, rdata, i);
+  }
+  return f;
+}
+
+static void teardown_servers(servers_fixture* f) {
+  size_t i;
+  /* Destroy server. */
+  for (i = 0; i < f->num_servers; i++) {
+    if (f->servers[i] == NULL) continue;
+    grpc_server_shutdown_and_notify(f->servers[i], f->shutdown_cq, tag(10000));
+    GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(10000),
+                                           n_millis_time(5000), NULL)
+                   .type == GRPC_OP_COMPLETE);
+    grpc_server_destroy(f->servers[i]);
+  }
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+
+  gpr_free(f->servers);
+
+  for (i = 0; i < f->num_servers; i++) {
+    gpr_free(f->servers_hostports[i]);
+    grpc_metadata_array_destroy(&f->request_metadata_recv[i]);
+  }
+
+  gpr_free(f->servers_hostports);
+  gpr_free(f->request_metadata_recv);
+  gpr_free(f->server_calls);
+  gpr_free(f);
+}
+
+static request_sequences request_sequences_create(size_t n) {
+  request_sequences res;
+  res.n = n;
+  res.connections = static_cast<int*>(gpr_malloc(sizeof(*res.connections) * n));
+  res.connectivity_states = static_cast<grpc_connectivity_state*>(
+      gpr_malloc(sizeof(*res.connectivity_states) * n));
+  memset(res.connections, 0, sizeof(*res.connections) * n);
+  memset(res.connectivity_states, 0, sizeof(*res.connectivity_states) * n);
+  return res;
+}
+
+static void request_sequences_destroy(const request_sequences* rseqs) {
+  gpr_free(rseqs->connections);
+  gpr_free(rseqs->connectivity_states);
+}
+
+/** Returns connection sequence (server indices), which must be freed */
+static request_sequences perform_request(servers_fixture* f,
+                                         grpc_channel* client,
+                                         request_data* rdata,
+                                         const test_spec* spec) {
+  grpc_call* c;
+  int s_idx;
+  int* s_valid;
+  grpc_op ops[6];
+  grpc_op* op;
+  int was_cancelled;
+  size_t i, iter_num;
+  grpc_event ev;
+  int read_tag;
+  int completed_client;
+  const request_sequences sequences = request_sequences_create(spec->num_iters);
+
+  s_valid = static_cast<int*>(gpr_malloc(sizeof(int) * f->num_servers));
+
+  for (iter_num = 0; iter_num < spec->num_iters; iter_num++) {
+    cq_verifier* cqv = cq_verifier_create(f->cq);
+    was_cancelled = 2;
+
+    for (i = 0; i < f->num_servers; i++) {
+      if (spec->kill_at[iter_num][i] != 0) {
+        kill_server(f, i);
+      } else if (spec->revive_at[iter_num][i] != 0) {
+        /* killing takes precedence */
+        revive_server(f, rdata, i);
+      }
+    }
+
+    sequences.connections[iter_num] = -1;
+    grpc_metadata_array_init(&rdata->initial_metadata_recv);
+    grpc_metadata_array_init(&rdata->trailing_metadata_recv);
+
+    for (i = 0; i < f->num_servers; i++) {
+      grpc_call_details_init(&rdata->call_details[i]);
+    }
+    memset(s_valid, 0, f->num_servers * sizeof(int));
+
+    grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr");
+    c = grpc_channel_create_call(client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
+                                 grpc_slice_from_static_string("/foo"), &host,
+                                 gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(c);
+    completed_client = 0;
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_INITIAL_METADATA;
+    op->data.send_initial_metadata.count = 0;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_RECV_INITIAL_METADATA;
+    op->data.recv_initial_metadata.recv_initial_metadata =
+        &rdata->initial_metadata_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+    op->data.recv_status_on_client.trailing_metadata =
+        &rdata->trailing_metadata_recv;
+    op->data.recv_status_on_client.status = &rdata->status;
+    op->data.recv_status_on_client.status_details = &rdata->details;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    GPR_ASSERT(GRPC_CALL_OK ==
+               grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL));
+
+    s_idx = -1;
+    while (
+        (ev = grpc_completion_queue_next(
+             f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), NULL))
+            .type != GRPC_QUEUE_TIMEOUT) {
+      GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+      read_tag = ((int)(intptr_t)ev.tag);
+      const grpc_connectivity_state conn_state =
+          grpc_channel_check_connectivity_state(client, 0);
+      sequences.connectivity_states[iter_num] = conn_state;
+      gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%" PRIuPTR,
+              ev.success, ev.type, read_tag, iter_num);
+      if (ev.success && read_tag >= 1000) {
+        GPR_ASSERT(s_idx == -1); /* only one server must reply */
+        /* only server notifications for non-shutdown events */
+        s_idx = read_tag - 1000;
+        s_valid[s_idx] = 1;
+        sequences.connections[iter_num] = s_idx;
+        break;
+      } else if (read_tag == 1) {
+        gpr_log(GPR_DEBUG, "client timed out");
+        GPR_ASSERT(ev.success);
+        completed_client = 1;
+      }
+    }
+
+    if (s_idx >= 0) {
+      memset(ops, 0, sizeof(ops));
+      op = ops;
+      op->op = GRPC_OP_SEND_INITIAL_METADATA;
+      op->data.send_initial_metadata.count = 0;
+      op->flags = 0;
+      op->reserved = NULL;
+      op++;
+      op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+      op->data.send_status_from_server.trailing_metadata_count = 0;
+      op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+      grpc_slice status_details = grpc_slice_from_static_string("xyz");
+      op->data.send_status_from_server.status_details = &status_details;
+      op->flags = 0;
+      op->reserved = NULL;
+      op++;
+      op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+      op->data.recv_close_on_server.cancelled = &was_cancelled;
+      op->flags = 0;
+      op->reserved = NULL;
+      op++;
+      GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(f->server_calls[s_idx],
+                                                       ops, (size_t)(op - ops),
+                                                       tag(102), NULL));
+
+      CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+      if (!completed_client) {
+        CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+      }
+      cq_verify(cqv);
+
+      GPR_ASSERT(rdata->status == GRPC_STATUS_UNIMPLEMENTED);
+      GPR_ASSERT(0 == grpc_slice_str_cmp(rdata->details, "xyz"));
+      GPR_ASSERT(0 ==
+                 grpc_slice_str_cmp(rdata->call_details[s_idx].method, "/foo"));
+      GPR_ASSERT(0 == grpc_slice_str_cmp(rdata->call_details[s_idx].host,
+                                         "foo.test.google.fr"));
+      GPR_ASSERT(was_cancelled == 1);
+
+      grpc_call_unref(f->server_calls[s_idx]);
+
+      /* ask for the next request on this server */
+      GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                     f->servers[s_idx], &f->server_calls[s_idx],
+                                     &rdata->call_details[s_idx],
+                                     &f->request_metadata_recv[s_idx], f->cq,
+                                     f->cq, tag(1000 + (int)s_idx)));
+    } else { /* no response from server */
+      grpc_call_cancel(c, NULL);
+      if (!completed_client) {
+        CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+        cq_verify(cqv);
+      }
+    }
+
+    GPR_ASSERT(
+        grpc_completion_queue_next(
+            f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), NULL)
+            .type == GRPC_QUEUE_TIMEOUT);
+
+    grpc_metadata_array_destroy(&rdata->initial_metadata_recv);
+    grpc_metadata_array_destroy(&rdata->trailing_metadata_recv);
+
+    cq_verifier_destroy(cqv);
+
+    grpc_call_unref(c);
+
+    for (i = 0; i < f->num_servers; i++) {
+      grpc_call_details_destroy(&rdata->call_details[i]);
+    }
+    grpc_slice_unref(rdata->details);
+  }
+
+  gpr_free(s_valid);
+
+  return sequences;
+}
+
+static grpc_call** perform_multirequest(servers_fixture* f,
+                                        grpc_channel* client,
+                                        size_t concurrent_calls) {
+  grpc_call** calls;
+  grpc_op ops[6];
+  grpc_op* op;
+  size_t i;
+
+  calls = static_cast<grpc_call**>(
+      gpr_malloc(sizeof(grpc_call*) * concurrent_calls));
+  for (i = 0; i < f->num_servers; i++) {
+    kill_server(f, i);
+  }
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+
+  grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr");
+  for (i = 0; i < concurrent_calls; i++) {
+    calls[i] =
+        grpc_channel_create_call(client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
+                                 grpc_slice_from_static_string("/foo"), &host,
+                                 gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(calls[i]);
+    GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(calls[i], ops,
+                                                     (size_t)(op - ops), tag(1),
+                                                     NULL));
+  }
+
+  return calls;
+}
+
+void run_spec(const test_spec* spec) {
+  grpc_channel* client;
+  char* client_hostport;
+  char* servers_hostports_str;
+  request_data rdata;
+  servers_fixture* f;
+  grpc_channel_args args;
+  grpc_arg arg_array[2];
+  rdata.call_details = static_cast<grpc_call_details*>(
+      gpr_malloc(sizeof(grpc_call_details) * spec->num_servers));
+  f = setup_servers("127.0.0.1", &rdata, spec->num_servers);
+
+  /* Create client. */
+  servers_hostports_str = gpr_strjoin_sep((const char**)f->servers_hostports,
+                                          f->num_servers, ",", NULL);
+  gpr_asprintf(&client_hostport, "ipv4:%s", servers_hostports_str);
+
+  arg_array[0].type = GRPC_ARG_INTEGER;
+  arg_array[0].key =
+      const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms");
+  arg_array[0].value.integer = RETRY_TIMEOUT;
+  arg_array[1].type = GRPC_ARG_STRING;
+  arg_array[1].key = const_cast<char*>(GRPC_ARG_LB_POLICY_NAME);
+  arg_array[1].value.string = const_cast<char*>("round_robin");
+  args.num_args = 2;
+  args.args = arg_array;
+
+  client = grpc_insecure_channel_create(client_hostport, &args, NULL);
+
+  gpr_log(GPR_INFO, "Testing '%s' with servers=%s client=%s", spec->description,
+          servers_hostports_str, client_hostport);
+
+  const request_sequences sequences = perform_request(f, client, &rdata, spec);
+
+  spec->verifier(f, client, &sequences, spec->num_iters);
+
+  gpr_free(client_hostport);
+  gpr_free(servers_hostports_str);
+  gpr_free(rdata.call_details);
+  request_sequences_destroy(&sequences);
+
+  grpc_channel_destroy(client); /* calls the LB's shutdown func */
+  teardown_servers(f);
+}
+
+static grpc_channel* create_client(const servers_fixture* f) {
+  grpc_channel* client;
+  char* client_hostport;
+  char* servers_hostports_str;
+  grpc_arg arg_array[3];
+  grpc_channel_args args;
+
+  servers_hostports_str = gpr_strjoin_sep((const char**)f->servers_hostports,
+                                          f->num_servers, ",", NULL);
+  gpr_asprintf(&client_hostport, "ipv4:%s", servers_hostports_str);
+
+  arg_array[0].type = GRPC_ARG_INTEGER;
+  arg_array[0].key =
+      const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms");
+  arg_array[0].value.integer = RETRY_TIMEOUT;
+  arg_array[1].type = GRPC_ARG_STRING;
+  arg_array[1].key = const_cast<char*>(GRPC_ARG_LB_POLICY_NAME);
+  arg_array[1].value.string = const_cast<char*>("ROUND_ROBIN");
+  arg_array[2].type = GRPC_ARG_INTEGER;
+  arg_array[2].key =
+      const_cast<char*>(GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS);
+  arg_array[2].value.integer = 0;
+  args.num_args = GPR_ARRAY_SIZE(arg_array);
+  args.args = arg_array;
+
+  client = grpc_insecure_channel_create(client_hostport, &args, NULL);
+  gpr_free(client_hostport);
+  gpr_free(servers_hostports_str);
+
+  return client;
+}
+
+static void test_ping() {
+  grpc_channel* client;
+  request_data rdata;
+  servers_fixture* f;
+  cq_verifier* cqv;
+  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+  const size_t num_servers = 1;
+  int i;
+
+  rdata.call_details = static_cast<grpc_call_details*>(
+      gpr_malloc(sizeof(grpc_call_details) * num_servers));
+  f = setup_servers("127.0.0.1", &rdata, num_servers);
+  cqv = cq_verifier_create(f->cq);
+
+  client = create_client(f);
+
+  grpc_channel_ping(client, f->cq, tag(0), NULL);
+  CQ_EXPECT_COMPLETION(cqv, tag(0), 0);
+
+  /* check that we're still in idle, and start connecting */
+  GPR_ASSERT(grpc_channel_check_connectivity_state(client, 1) ==
+             GRPC_CHANNEL_IDLE);
+  /* we'll go through some set of transitions (some might be missed), until
+     READY is reached */
+  while (state != GRPC_CHANNEL_READY) {
+    grpc_channel_watch_connectivity_state(
+        client, state, grpc_timeout_seconds_to_deadline(3), f->cq, tag(99));
+    CQ_EXPECT_COMPLETION(cqv, tag(99), 1);
+    cq_verify(cqv);
+    state = grpc_channel_check_connectivity_state(client, 0);
+    GPR_ASSERT(state == GRPC_CHANNEL_READY ||
+               state == GRPC_CHANNEL_CONNECTING ||
+               state == GRPC_CHANNEL_TRANSIENT_FAILURE);
+  }
+
+  for (i = 1; i <= 5; i++) {
+    grpc_channel_ping(client, f->cq, tag(i), NULL);
+    CQ_EXPECT_COMPLETION(cqv, tag(i), 1);
+    cq_verify(cqv);
+  }
+  gpr_free(rdata.call_details);
+
+  grpc_channel_destroy(client);
+  teardown_servers(f);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_pending_calls(size_t concurrent_calls) {
+  size_t i;
+  grpc_call** calls;
+  grpc_channel* client;
+  request_data rdata;
+  servers_fixture* f;
+  test_spec* spec = test_spec_create(0, 4);
+  rdata.call_details = static_cast<grpc_call_details*>(
+      gpr_malloc(sizeof(grpc_call_details) * spec->num_servers));
+  f = setup_servers("127.0.0.1", &rdata, spec->num_servers);
+
+  client = create_client(f);
+  calls = perform_multirequest(f, client, concurrent_calls);
+  grpc_call_cancel(
+      calls[0],
+      NULL); /* exercise the cancel pick path whilst there are pending picks */
+
+  gpr_free(rdata.call_details);
+
+  grpc_channel_destroy(client); /* calls the LB's shutdown func */
+  /* destroy the calls after the channel so that they are still around for the
+   * LB's shutdown func to process */
+  for (i = 0; i < concurrent_calls; i++) {
+    grpc_call_unref(calls[i]);
+  }
+  gpr_free(calls);
+  teardown_servers(f);
+  test_spec_destroy(spec);
+}
+
+static void test_get_channel_info() {
+  grpc_channel* channel =
+      grpc_insecure_channel_create("ipv4:127.0.0.1:1234", NULL, NULL);
+  // Ensures that resolver returns.
+  grpc_channel_check_connectivity_state(channel, true /* try_to_connect */);
+  // First, request no fields.  This is a no-op.
+  grpc_channel_info channel_info;
+  memset(&channel_info, 0, sizeof(channel_info));
+  grpc_channel_get_info(channel, &channel_info);
+  // Request LB policy name.
+  char* lb_policy_name = NULL;
+  channel_info.lb_policy_name = &lb_policy_name;
+  grpc_channel_get_info(channel, &channel_info);
+  GPR_ASSERT(lb_policy_name != NULL);
+  GPR_ASSERT(strcmp(lb_policy_name, "pick_first") == 0);
+  gpr_free(lb_policy_name);
+  // Request service config, which does not exist, so we'll get nothing back.
+  memset(&channel_info, 0, sizeof(channel_info));
+  char* service_config_json = const_cast<char*>("dummy_string");
+  channel_info.service_config_json = &service_config_json;
+  grpc_channel_get_info(channel, &channel_info);
+  GPR_ASSERT(service_config_json == NULL);
+  // Recreate the channel such that it has a service config.
+  grpc_channel_destroy(channel);
+  grpc_arg arg;
+  arg.type = GRPC_ARG_STRING;
+  arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG);
+  arg.value.string =
+      const_cast<char*>("{\"loadBalancingPolicy\": \"ROUND_ROBIN\"}");
+  grpc_channel_args* args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
+  channel = grpc_insecure_channel_create("ipv4:127.0.0.1:1234", args, NULL);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  // Ensures that resolver returns.
+  grpc_channel_check_connectivity_state(channel, true /* try_to_connect */);
+  // Now request the service config again.
+  grpc_channel_get_info(channel, &channel_info);
+  GPR_ASSERT(service_config_json != NULL);
+  GPR_ASSERT(strcmp(service_config_json, arg.value.string) == 0);
+  gpr_free(service_config_json);
+  // Clean up.
+  grpc_channel_destroy(channel);
+}
+
+static void print_failed_expectations(const int* expected_connection_sequence,
+                                      const int* actual_connection_sequence,
+                                      const size_t expected_seq_length,
+                                      const size_t num_iters) {
+  size_t i;
+  for (i = 0; i < num_iters; i++) {
+    gpr_log(GPR_ERROR,
+            "FAILURE: Iter (expected, actual): %" PRIuPTR " (%d, %d)", i,
+            expected_connection_sequence[i % expected_seq_length],
+            actual_connection_sequence[i]);
+  }
+}
+
+static void verify_vanilla_round_robin(const servers_fixture* f,
+                                       grpc_channel* client,
+                                       const request_sequences* sequences,
+                                       const size_t num_iters) {
+  const size_t expected_seq_length = f->num_servers;
+
+  /* verify conn. seq. expectation */
+  /* get the first sequence of "num_servers" elements */
+  int* expected_connection_sequence =
+      static_cast<int*>(gpr_malloc(sizeof(int) * expected_seq_length));
+  memcpy(expected_connection_sequence, sequences->connections,
+         sizeof(int) * expected_seq_length);
+
+  for (size_t i = 0; i < num_iters; i++) {
+    const int actual = sequences->connections[i];
+    const int expected = expected_connection_sequence[i % expected_seq_length];
+    if (actual != expected) {
+      gpr_log(
+          GPR_ERROR,
+          "CONNECTION SEQUENCE FAILURE: expected %d, got %d at iteration #%d",
+          expected, actual, (int)i);
+      abort();
+    }
+  }
+
+  /* All servers are available, therefore all client subchannels are READY, even
+   * when we only need one for the client channel state to be READY */
+  for (size_t i = 0; i < sequences->n; i++) {
+    const grpc_connectivity_state actual =
+        static_cast<grpc_connectivity_state>(sequences->connectivity_states[i]);
+    const grpc_connectivity_state expected = GRPC_CHANNEL_READY;
+    if (actual != expected) {
+      gpr_log(GPR_ERROR,
+              "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
+              "at iteration #%d",
+              grpc_connectivity_state_name(expected),
+              grpc_connectivity_state_name(actual), (int)i);
+      abort();
+    }
+  }
+
+  gpr_free(expected_connection_sequence);
+}
+
+/* At the start of the second iteration, all but the first and last servers (as
+ * given in "f") are killed */
+static void verify_vanishing_floor_round_robin(
+    const servers_fixture* f, grpc_channel* client,
+    const request_sequences* sequences, const size_t num_iters) {
+  int* expected_connection_sequence;
+  const size_t expected_seq_length = 2;
+  size_t i;
+
+  /* verify conn. seq. expectation */
+  /* copy the first full sequence (without -1s) */
+  expected_connection_sequence =
+      static_cast<int*>(gpr_malloc(sizeof(int) * expected_seq_length));
+  memcpy(expected_connection_sequence, sequences->connections + 2,
+         expected_seq_length * sizeof(int));
+
+  /* first two elements of the sequence should be [0 (1st server), -1 (failure)]
+   */
+  GPR_ASSERT(sequences->connections[0] == 0);
+  GPR_ASSERT(sequences->connections[1] == -1);
+
+  /* the next two element must be [3, 0], repeating from that point: the 3 is
+   * brought forth by servers 1 and 2 disappearing after the intial pick of 0 */
+  GPR_ASSERT(sequences->connections[2] == 3);
+  GPR_ASSERT(sequences->connections[3] == 0);
+
+  /* make sure that the expectation obliges */
+  for (i = 2; i < num_iters; i++) {
+    const int actual = sequences->connections[i];
+    const int expected = expected_connection_sequence[i % expected_seq_length];
+    if (actual != expected) {
+      print_failed_expectations(expected_connection_sequence,
+                                sequences->connections, expected_seq_length,
+                                num_iters);
+      abort();
+    }
+  }
+
+  /* There's always at least one subchannel READY (connected), therefore the
+   * overall state of the client channel is READY at all times. */
+  for (i = 0; i < sequences->n; i++) {
+    const grpc_connectivity_state actual =
+        static_cast<grpc_connectivity_state>(sequences->connectivity_states[i]);
+    const grpc_connectivity_state expected = GRPC_CHANNEL_READY;
+    if (actual != expected) {
+      gpr_log(GPR_ERROR,
+              "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
+              "at iteration #%d",
+              grpc_connectivity_state_name(expected),
+              grpc_connectivity_state_name(actual), (int)i);
+      abort();
+    }
+  }
+
+  gpr_free(expected_connection_sequence);
+}
+
+static void verify_total_carnage_round_robin(const servers_fixture* f,
+                                             grpc_channel* client,
+                                             const request_sequences* sequences,
+                                             const size_t num_iters) {
+  for (size_t i = 0; i < num_iters; i++) {
+    const int actual = sequences->connections[i];
+    const int expected = -1;
+    if (actual != expected) {
+      gpr_log(
+          GPR_ERROR,
+          "CONNECTION SEQUENCE FAILURE: expected %d, got %d at iteration #%d",
+          expected, actual, (int)i);
+      abort();
+    }
+  }
+
+  /* No server is ever available. There should be no READY states (or SHUTDOWN).
+   * Note that all other states (IDLE, CONNECTING, TRANSIENT_FAILURE) are still
+   * possible, as the policy transitions while attempting to reconnect. */
+  for (size_t i = 0; i < sequences->n; i++) {
+    const grpc_connectivity_state actual =
+        static_cast<grpc_connectivity_state>(sequences->connectivity_states[i]);
+    if (actual == GRPC_CHANNEL_READY || actual == GRPC_CHANNEL_SHUTDOWN) {
+      gpr_log(GPR_ERROR,
+              "CONNECTIVITY STATUS SEQUENCE FAILURE: got unexpected state "
+              "'%s' at iteration #%d.",
+              grpc_connectivity_state_name(actual), (int)i);
+      abort();
+    }
+  }
+}
+
+static void verify_partial_carnage_round_robin(
+    const servers_fixture* f, grpc_channel* client,
+    const request_sequences* sequences, const size_t num_iters) {
+  int* expected_connection_sequence;
+  size_t i;
+  const size_t expected_seq_length = f->num_servers;
+
+  /* verify conn. seq. expectation */
+  /* get the first sequence of "num_servers" elements */
+  expected_connection_sequence =
+      static_cast<int*>(gpr_malloc(sizeof(int) * expected_seq_length));
+  memcpy(expected_connection_sequence, sequences->connections,
+         sizeof(int) * expected_seq_length);
+
+  for (i = 0; i < num_iters / 2; i++) {
+    const int actual = sequences->connections[i];
+    const int expected = expected_connection_sequence[i % expected_seq_length];
+    if (actual != expected) {
+      print_failed_expectations(expected_connection_sequence,
+                                sequences->connections, expected_seq_length,
+                                num_iters);
+      abort();
+    }
+  }
+
+  /* second half of the iterations go without response */
+  for (; i < num_iters; i++) {
+    GPR_ASSERT(sequences->connections[i] == -1);
+  }
+
+  /* We can assert that the first client channel state should be READY, when all
+   * servers were available */
+  grpc_connectivity_state actual =
+      static_cast<grpc_connectivity_state>(sequences->connectivity_states[0]);
+  grpc_connectivity_state expected = GRPC_CHANNEL_READY;
+  if (actual != expected) {
+    gpr_log(GPR_ERROR,
+            "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
+            "at iteration #%d",
+            grpc_connectivity_state_name(expected),
+            grpc_connectivity_state_name(actual), 0);
+    abort();
+  }
+
+  /* ... and that the last one shouldn't be READY (or SHUTDOWN): all servers are
+   * gone. It may be all other states (IDLE, CONNECTING, TRANSIENT_FAILURE), as
+   * the policy transitions while attempting to reconnect. */
+  actual = static_cast<grpc_connectivity_state>(
+      sequences->connectivity_states[num_iters - 1]);
+  for (i = 0; i < sequences->n; i++) {
+    if (actual == GRPC_CHANNEL_READY || actual == GRPC_CHANNEL_SHUTDOWN) {
+      gpr_log(GPR_ERROR,
+              "CONNECTIVITY STATUS SEQUENCE FAILURE: got unexpected state "
+              "'%s' at iteration #%d.",
+              grpc_connectivity_state_name(actual), (int)i);
+      abort();
+    }
+  }
+  gpr_free(expected_connection_sequence);
+}
+
+static void dump_array(const char* desc, const int* data, const size_t count) {
+  gpr_strvec s;
+  char* tmp;
+  size_t i;
+  gpr_strvec_init(&s);
+  gpr_strvec_add(&s, gpr_strdup(desc));
+  gpr_strvec_add(&s, gpr_strdup(":"));
+  for (i = 0; i < count; i++) {
+    gpr_asprintf(&tmp, " %d", data[i]);
+    gpr_strvec_add(&s, tmp);
+  }
+  tmp = gpr_strvec_flatten(&s, NULL);
+  gpr_strvec_destroy(&s);
+  gpr_log(GPR_DEBUG, "%s", tmp);
+  gpr_free(tmp);
+}
+
+static void verify_rebirth_round_robin(const servers_fixture* f,
+                                       grpc_channel* client,
+                                       const request_sequences* sequences,
+                                       const size_t num_iters) {
+  dump_array("actual_connection_sequence", sequences->connections, num_iters);
+
+  /* first iteration succeeds */
+  GPR_ASSERT(sequences->connections[0] != -1);
+  /* then we fail for a while... */
+  GPR_ASSERT(sequences->connections[1] == -1);
+  /* ... but should be up eventually */
+  size_t first_iter_back_up = ~0ul;
+  for (size_t i = 2; i < sequences->n; ++i) {
+    if (sequences->connections[i] != -1) {
+      first_iter_back_up = i;
+      break;
+    }
+  }
+  GPR_ASSERT(first_iter_back_up != ~0ul);
+
+  /* We can assert that the first client channel state should be READY, when all
+   * servers were available; same thing for the last one. In the middle
+   * somewhere there must exist at least one TRANSIENT_FAILURE */
+  grpc_connectivity_state actual =
+      static_cast<grpc_connectivity_state>(sequences->connectivity_states[0]);
+  grpc_connectivity_state expected = GRPC_CHANNEL_READY;
+  if (actual != expected) {
+    gpr_log(GPR_ERROR,
+            "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
+            "at iteration #%d",
+            grpc_connectivity_state_name(expected),
+            grpc_connectivity_state_name(actual), 0);
+    abort();
+  }
+
+  actual = static_cast<grpc_connectivity_state>(
+      sequences->connectivity_states[num_iters - 1]);
+  expected = GRPC_CHANNEL_READY;
+  if (actual != expected) {
+    gpr_log(GPR_ERROR,
+            "CONNECTIVITY STATUS SEQUENCE FAILURE: expected '%s', got '%s' "
+            "at iteration #%d",
+            grpc_connectivity_state_name(expected),
+            grpc_connectivity_state_name(actual), (int)num_iters - 1);
+    abort();
+  }
+
+  bool found_failure_status = false;
+  for (size_t i = 1; i < sequences->n - 1; i++) {
+    if (sequences->connectivity_states[i] == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+      found_failure_status = true;
+      break;
+    }
+  }
+  if (!found_failure_status) {
+    gpr_log(
+        GPR_ERROR,
+        "CONNECTIVITY STATUS SEQUENCE FAILURE: "
+        "GRPC_CHANNEL_TRANSIENT_FAILURE status not found. Got the following "
+        "instead:");
+    for (size_t i = 0; i < num_iters; i++) {
+      gpr_log(GPR_ERROR, "[%d]: %s", (int)i,
+              grpc_connectivity_state_name(static_cast<grpc_connectivity_state>(
+                  sequences->connectivity_states[i])));
+    }
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  test_spec* spec;
+  size_t i;
+  const size_t NUM_ITERS = 10;
+  const size_t NUM_SERVERS = 4;
+
+  grpc_init();
+  grpc_test_init(argc, argv);
+  grpc_tracer_set_enabled("round_robin", 1);
+
+  GPR_ASSERT(grpc_lb_policy_create(&exec_ctx, "this-lb-policy-does-not-exist",
+                                   NULL) == NULL);
+  GPR_ASSERT(grpc_lb_policy_create(&exec_ctx, NULL, NULL) == NULL);
+
+  spec = test_spec_create(NUM_ITERS, NUM_SERVERS);
+  /* everything is fine, all servers stay up the whole time and life's peachy
+   */
+  spec->verifier = verify_vanilla_round_robin;
+  spec->description = "test_all_server_up";
+  run_spec(spec);
+
+  /* Kill all servers first thing in the morning */
+  test_spec_reset(spec);
+  spec->verifier = verify_total_carnage_round_robin;
+  spec->description = "test_kill_all_server";
+  for (i = 0; i < NUM_SERVERS; i++) {
+    spec->kill_at[0][i] = 1;
+  }
+  run_spec(spec);
+
+  /* at the start of the 2nd iteration, kill all but the first and last
+   * servers.
+   * This should knock down the server bound to be selected next */
+  test_spec_reset(spec);
+  spec->verifier = verify_vanishing_floor_round_robin;
+  spec->description = "test_kill_middle_servers_at_2nd_iteration";
+  for (i = 1; i < NUM_SERVERS - 1; i++) {
+    spec->kill_at[1][i] = 1;
+  }
+  run_spec(spec);
+
+  /* Midway, kill all servers. */
+  test_spec_reset(spec);
+  spec->verifier = verify_partial_carnage_round_robin;
+  spec->description = "test_kill_all_server_midway";
+  for (i = 0; i < NUM_SERVERS; i++) {
+    spec->kill_at[spec->num_iters / 2][i] = 1;
+  }
+  run_spec(spec);
+
+  /* After first iteration, kill all servers. On the third one, bring them all
+   * back up. */
+  test_spec_reset(spec);
+  spec->verifier = verify_rebirth_round_robin;
+  spec->description = "test_kill_all_server_after_1st_resurrect_at_3rd";
+  for (i = 0; i < NUM_SERVERS; i++) {
+    spec->kill_at[1][i] = 1;
+    spec->revive_at[3][i] = 1;
+  }
+  run_spec(spec);
+  test_spec_destroy(spec);
+
+  test_pending_calls(4);
+  test_ping();
+  test_get_channel_info();
+
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/client_channel/parse_address_test.c b/test/core/client_channel/parse_address_test.c
deleted file mode 100644
index d011176..0000000
--- a/test/core/client_channel/parse_address_test.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/filters/client_channel/parse_address.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include <string.h>
-#ifdef GRPC_HAVE_UNIX_SOCKET
-#include <sys/un.h>
-#endif
-
-#include <grpc/support/log.h>
-
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/socket_utils.h"
-#include "test/core/util/test_config.h"
-
-#ifdef GRPC_HAVE_UNIX_SOCKET
-
-static void test_grpc_parse_unix(const char *uri_text, const char *pathname) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
-  grpc_resolved_address addr;
-
-  GPR_ASSERT(1 == grpc_parse_unix(uri, &addr));
-  struct sockaddr_un *addr_un = (struct sockaddr_un *)addr.addr;
-  GPR_ASSERT(AF_UNIX == addr_un->sun_family);
-  GPR_ASSERT(0 == strcmp(addr_un->sun_path, pathname));
-
-  grpc_uri_destroy(uri);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-#else /* GRPC_HAVE_UNIX_SOCKET */
-
-static void test_grpc_parse_unix(const char *uri_text, const char *pathname) {}
-
-#endif /* GRPC_HAVE_UNIX_SOCKET */
-
-static void test_grpc_parse_ipv4(const char *uri_text, const char *host,
-                                 unsigned short port) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
-  grpc_resolved_address addr;
-  char ntop_buf[INET_ADDRSTRLEN];
-
-  GPR_ASSERT(1 == grpc_parse_ipv4(uri, &addr));
-  struct sockaddr_in *addr_in = (struct sockaddr_in *)addr.addr;
-  GPR_ASSERT(AF_INET == addr_in->sin_family);
-  GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET, &addr_in->sin_addr, ntop_buf,
-                                    sizeof(ntop_buf)));
-  GPR_ASSERT(0 == strcmp(ntop_buf, host));
-  GPR_ASSERT(ntohs(addr_in->sin_port) == port);
-
-  grpc_uri_destroy(uri);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_grpc_parse_ipv6(const char *uri_text, const char *host,
-                                 unsigned short port, uint32_t scope_id) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
-  grpc_resolved_address addr;
-  char ntop_buf[INET6_ADDRSTRLEN];
-
-  GPR_ASSERT(1 == grpc_parse_ipv6(uri, &addr));
-  struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addr.addr;
-  GPR_ASSERT(AF_INET6 == addr_in6->sin6_family);
-  GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET6, &addr_in6->sin6_addr, ntop_buf,
-                                    sizeof(ntop_buf)));
-  GPR_ASSERT(0 == strcmp(ntop_buf, host));
-  GPR_ASSERT(ntohs(addr_in6->sin6_port) == port);
-  GPR_ASSERT(addr_in6->sin6_scope_id == scope_id);
-
-  grpc_uri_destroy(uri);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  test_grpc_parse_unix("unix:/path/name", "/path/name");
-  test_grpc_parse_ipv4("ipv4:192.0.2.1:12345", "192.0.2.1", 12345);
-  test_grpc_parse_ipv6("ipv6:[2001:db8::1]:12345", "2001:db8::1", 12345, 0);
-  test_grpc_parse_ipv6("ipv6:[2001:db8::1%252]:12345", "2001:db8::1", 12345, 2);
-}
diff --git a/test/core/client_channel/parse_address_test.cc b/test/core/client_channel/parse_address_test.cc
new file mode 100644
index 0000000..5ad6c6d
--- /dev/null
+++ b/test/core/client_channel/parse_address_test.cc
@@ -0,0 +1,101 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/filters/client_channel/parse_address.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include <string.h>
+#ifdef GRPC_HAVE_UNIX_SOCKET
+#include <sys/un.h>
+#endif
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/socket_utils.h"
+#include "test/core/util/test_config.h"
+
+#ifdef GRPC_HAVE_UNIX_SOCKET
+
+static void test_grpc_parse_unix(const char* uri_text, const char* pathname) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_uri* uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
+  grpc_resolved_address addr;
+
+  GPR_ASSERT(1 == grpc_parse_unix(uri, &addr));
+  struct sockaddr_un* addr_un = (struct sockaddr_un*)addr.addr;
+  GPR_ASSERT(AF_UNIX == addr_un->sun_family);
+  GPR_ASSERT(0 == strcmp(addr_un->sun_path, pathname));
+
+  grpc_uri_destroy(uri);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+#else /* GRPC_HAVE_UNIX_SOCKET */
+
+static void test_grpc_parse_unix(const char* uri_text, const char* pathname) {}
+
+#endif /* GRPC_HAVE_UNIX_SOCKET */
+
+static void test_grpc_parse_ipv4(const char* uri_text, const char* host,
+                                 unsigned short port) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_uri* uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
+  grpc_resolved_address addr;
+  char ntop_buf[INET_ADDRSTRLEN];
+
+  GPR_ASSERT(1 == grpc_parse_ipv4(uri, &addr));
+  struct sockaddr_in* addr_in = (struct sockaddr_in*)addr.addr;
+  GPR_ASSERT(AF_INET == addr_in->sin_family);
+  GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET, &addr_in->sin_addr, ntop_buf,
+                                    sizeof(ntop_buf)));
+  GPR_ASSERT(0 == strcmp(ntop_buf, host));
+  GPR_ASSERT(ntohs(addr_in->sin_port) == port);
+
+  grpc_uri_destroy(uri);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_grpc_parse_ipv6(const char* uri_text, const char* host,
+                                 unsigned short port, uint32_t scope_id) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_uri* uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
+  grpc_resolved_address addr;
+  char ntop_buf[INET6_ADDRSTRLEN];
+
+  GPR_ASSERT(1 == grpc_parse_ipv6(uri, &addr));
+  struct sockaddr_in6* addr_in6 = (struct sockaddr_in6*)addr.addr;
+  GPR_ASSERT(AF_INET6 == addr_in6->sin6_family);
+  GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET6, &addr_in6->sin6_addr, ntop_buf,
+                                    sizeof(ntop_buf)));
+  GPR_ASSERT(0 == strcmp(ntop_buf, host));
+  GPR_ASSERT(ntohs(addr_in6->sin6_port) == port);
+  GPR_ASSERT(addr_in6->sin6_scope_id == scope_id);
+
+  grpc_uri_destroy(uri);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  test_grpc_parse_unix("unix:/path/name", "/path/name");
+  test_grpc_parse_ipv4("ipv4:192.0.2.1:12345", "192.0.2.1", 12345);
+  test_grpc_parse_ipv6("ipv6:[2001:db8::1]:12345", "2001:db8::1", 12345, 0);
+  test_grpc_parse_ipv6("ipv6:[2001:db8::1%252]:12345", "2001:db8::1", 12345, 2);
+}
diff --git a/test/core/client_channel/resolvers/BUILD b/test/core/client_channel/resolvers/BUILD
index 0907e06..b5269c7 100644
--- a/test/core/client_channel/resolvers/BUILD
+++ b/test/core/client_channel/resolvers/BUILD
@@ -20,8 +20,8 @@
 
 grpc_cc_test(
     name = "dns_resolver_connectivity_test",
-    srcs = ["dns_resolver_connectivity_test.c"],
-    language = "C",
+    srcs = ["dns_resolver_connectivity_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -32,8 +32,8 @@
 
 grpc_cc_test(
     name = "dns_resolver_test",
-    srcs = ["dns_resolver_test.c"],
-    language = "C",
+    srcs = ["dns_resolver_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -44,8 +44,8 @@
 
 grpc_cc_test(
     name = "sockaddr_resolver_test",
-    srcs = ["sockaddr_resolver_test.c"],
-    language = "C",
+    srcs = ["sockaddr_resolver_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -56,8 +56,8 @@
 
 grpc_cc_test(
     name = "fake_resolver_test",
-    srcs = ["fake_resolver_test.c"],
-    language = "C",
+    srcs = ["fake_resolver_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c
deleted file mode 100644
index 4597285..0000000
--- a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#include "src/core/ext/filters/client_channel/resolver.h"
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/combiner.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "test/core/util/test_config.h"
-
-static gpr_mu g_mu;
-static bool g_fail_resolution = true;
-static grpc_combiner *g_combiner;
-
-static void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr,
-                               const char *default_port,
-                               grpc_pollset_set *interested_parties,
-                               grpc_closure *on_done,
-                               grpc_resolved_addresses **addrs) {
-  gpr_mu_lock(&g_mu);
-  GPR_ASSERT(0 == strcmp("test", addr));
-  grpc_error *error = GRPC_ERROR_NONE;
-  if (g_fail_resolution) {
-    g_fail_resolution = false;
-    gpr_mu_unlock(&g_mu);
-    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Failure");
-  } else {
-    gpr_mu_unlock(&g_mu);
-    *addrs = gpr_malloc(sizeof(**addrs));
-    (*addrs)->naddrs = 1;
-    (*addrs)->addrs = gpr_malloc(sizeof(*(*addrs)->addrs));
-    (*addrs)->addrs[0].len = 123;
-  }
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, error);
-}
-
-static grpc_ares_request *my_dns_lookup_ares(
-    grpc_exec_ctx *exec_ctx, const char *dns_server, const char *addr,
-    const char *default_port, grpc_pollset_set *interested_parties,
-    grpc_closure *on_done, grpc_lb_addresses **lb_addrs, bool check_grpclb,
-    char **service_config_json) {
-  gpr_mu_lock(&g_mu);
-  GPR_ASSERT(0 == strcmp("test", addr));
-  grpc_error *error = GRPC_ERROR_NONE;
-  if (g_fail_resolution) {
-    g_fail_resolution = false;
-    gpr_mu_unlock(&g_mu);
-    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Failure");
-  } else {
-    gpr_mu_unlock(&g_mu);
-    *lb_addrs = grpc_lb_addresses_create(1, NULL);
-    grpc_lb_addresses_set_address(*lb_addrs, 0, NULL, 0, false, NULL, NULL);
-  }
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, error);
-  return NULL;
-}
-
-static grpc_resolver *create_resolver(grpc_exec_ctx *exec_ctx,
-                                      const char *name) {
-  grpc_resolver_factory *factory = grpc_resolver_factory_lookup("dns");
-  grpc_uri *uri = grpc_uri_parse(exec_ctx, name, 0);
-  GPR_ASSERT(uri);
-  grpc_resolver_args args;
-  memset(&args, 0, sizeof(args));
-  args.uri = uri;
-  args.combiner = g_combiner;
-  grpc_resolver *resolver =
-      grpc_resolver_factory_create_resolver(exec_ctx, factory, &args);
-  grpc_resolver_factory_unref(factory);
-  grpc_uri_destroy(uri);
-  return resolver;
-}
-
-static void on_done(grpc_exec_ctx *exec_ctx, void *ev, grpc_error *error) {
-  gpr_event_set(ev, (void *)1);
-}
-
-// interleave waiting for an event with a timer check
-static bool wait_loop(int deadline_seconds, gpr_event *ev) {
-  while (deadline_seconds) {
-    gpr_log(GPR_DEBUG, "Test: waiting for %d more seconds", deadline_seconds);
-    if (gpr_event_wait(ev, grpc_timeout_seconds_to_deadline(1))) return true;
-    deadline_seconds--;
-
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_timer_check(&exec_ctx, NULL);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  return false;
-}
-
-typedef struct next_args {
-  grpc_resolver *resolver;
-  grpc_channel_args **result;
-  grpc_closure *on_complete;
-} next_args;
-
-static void call_resolver_next_now_lock_taken(grpc_exec_ctx *exec_ctx,
-                                              void *arg,
-                                              grpc_error *error_unused) {
-  next_args *a = arg;
-  grpc_resolver_next_locked(exec_ctx, a->resolver, a->result, a->on_complete);
-  gpr_free(a);
-}
-
-static void call_resolver_next_after_locking(grpc_exec_ctx *exec_ctx,
-                                             grpc_resolver *resolver,
-                                             grpc_channel_args **result,
-                                             grpc_closure *on_complete) {
-  next_args *a = gpr_malloc(sizeof(*a));
-  a->resolver = resolver;
-  a->result = result;
-  a->on_complete = on_complete;
-  GRPC_CLOSURE_SCHED(exec_ctx, GRPC_CLOSURE_CREATE(
-                                   call_resolver_next_now_lock_taken, a,
-                                   grpc_combiner_scheduler(resolver->combiner)),
-                     GRPC_ERROR_NONE);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  grpc_init();
-  gpr_mu_init(&g_mu);
-  g_combiner = grpc_combiner_create();
-  grpc_resolve_address = my_resolve_address;
-  grpc_dns_lookup_ares = my_dns_lookup_ares;
-  grpc_channel_args *result = (grpc_channel_args *)1;
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolver *resolver = create_resolver(&exec_ctx, "dns:test");
-  gpr_event ev1;
-  gpr_event_init(&ev1);
-  call_resolver_next_after_locking(
-      &exec_ctx, resolver, &result,
-      GRPC_CLOSURE_CREATE(on_done, &ev1, grpc_schedule_on_exec_ctx));
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(wait_loop(5, &ev1));
-  GPR_ASSERT(result == NULL);
-
-  gpr_event ev2;
-  gpr_event_init(&ev2);
-  call_resolver_next_after_locking(
-      &exec_ctx, resolver, &result,
-      GRPC_CLOSURE_CREATE(on_done, &ev2, grpc_schedule_on_exec_ctx));
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(wait_loop(30, &ev2));
-  GPR_ASSERT(result != NULL);
-
-  grpc_channel_args_destroy(&exec_ctx, result);
-  GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test");
-  GRPC_COMBINER_UNREF(&exec_ctx, g_combiner, "test");
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  grpc_shutdown();
-  gpr_mu_destroy(&g_mu);
-}
diff --git a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
new file mode 100644
index 0000000..a388b82
--- /dev/null
+++ b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
@@ -0,0 +1,182 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/resolver.h"
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/combiner.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "test/core/util/test_config.h"
+
+static gpr_mu g_mu;
+static bool g_fail_resolution = true;
+static grpc_combiner* g_combiner;
+
+static void my_resolve_address(grpc_exec_ctx* exec_ctx, const char* addr,
+                               const char* default_port,
+                               grpc_pollset_set* interested_parties,
+                               grpc_closure* on_done,
+                               grpc_resolved_addresses** addrs) {
+  gpr_mu_lock(&g_mu);
+  GPR_ASSERT(0 == strcmp("test", addr));
+  grpc_error* error = GRPC_ERROR_NONE;
+  if (g_fail_resolution) {
+    g_fail_resolution = false;
+    gpr_mu_unlock(&g_mu);
+    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Failure");
+  } else {
+    gpr_mu_unlock(&g_mu);
+    *addrs = static_cast<grpc_resolved_addresses*>(gpr_malloc(sizeof(**addrs)));
+    (*addrs)->naddrs = 1;
+    (*addrs)->addrs = static_cast<grpc_resolved_address*>(
+        gpr_malloc(sizeof(*(*addrs)->addrs)));
+    (*addrs)->addrs[0].len = 123;
+  }
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, error);
+}
+
+static grpc_ares_request* my_dns_lookup_ares(
+    grpc_exec_ctx* exec_ctx, const char* dns_server, const char* addr,
+    const char* default_port, grpc_pollset_set* interested_parties,
+    grpc_closure* on_done, grpc_lb_addresses** lb_addrs, bool check_grpclb,
+    char** service_config_json) {
+  gpr_mu_lock(&g_mu);
+  GPR_ASSERT(0 == strcmp("test", addr));
+  grpc_error* error = GRPC_ERROR_NONE;
+  if (g_fail_resolution) {
+    g_fail_resolution = false;
+    gpr_mu_unlock(&g_mu);
+    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Failure");
+  } else {
+    gpr_mu_unlock(&g_mu);
+    *lb_addrs = grpc_lb_addresses_create(1, NULL);
+    grpc_lb_addresses_set_address(*lb_addrs, 0, NULL, 0, false, NULL, NULL);
+  }
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, error);
+  return NULL;
+}
+
+static grpc_resolver* create_resolver(grpc_exec_ctx* exec_ctx,
+                                      const char* name) {
+  grpc_resolver_factory* factory = grpc_resolver_factory_lookup("dns");
+  grpc_uri* uri = grpc_uri_parse(exec_ctx, name, 0);
+  GPR_ASSERT(uri);
+  grpc_resolver_args args;
+  memset(&args, 0, sizeof(args));
+  args.uri = uri;
+  args.combiner = g_combiner;
+  grpc_resolver* resolver =
+      grpc_resolver_factory_create_resolver(exec_ctx, factory, &args);
+  grpc_resolver_factory_unref(factory);
+  grpc_uri_destroy(uri);
+  return resolver;
+}
+
+static void on_done(grpc_exec_ctx* exec_ctx, void* ev, grpc_error* error) {
+  gpr_event_set((gpr_event*)ev, (void*)1);
+}
+
+// interleave waiting for an event with a timer check
+static bool wait_loop(int deadline_seconds, gpr_event* ev) {
+  while (deadline_seconds) {
+    gpr_log(GPR_DEBUG, "Test: waiting for %d more seconds", deadline_seconds);
+    if (gpr_event_wait(ev, grpc_timeout_seconds_to_deadline(1))) return true;
+    deadline_seconds--;
+
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_timer_check(&exec_ctx, NULL);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  return false;
+}
+
+typedef struct next_args {
+  grpc_resolver* resolver;
+  grpc_channel_args** result;
+  grpc_closure* on_complete;
+} next_args;
+
+static void call_resolver_next_now_lock_taken(grpc_exec_ctx* exec_ctx,
+                                              void* arg,
+                                              grpc_error* error_unused) {
+  next_args* a = static_cast<next_args*>(arg);
+  grpc_resolver_next_locked(exec_ctx, a->resolver, a->result, a->on_complete);
+  gpr_free(a);
+}
+
+static void call_resolver_next_after_locking(grpc_exec_ctx* exec_ctx,
+                                             grpc_resolver* resolver,
+                                             grpc_channel_args** result,
+                                             grpc_closure* on_complete) {
+  next_args* a = static_cast<next_args*>(gpr_malloc(sizeof(*a)));
+  a->resolver = resolver;
+  a->result = result;
+  a->on_complete = on_complete;
+  GRPC_CLOSURE_SCHED(
+      exec_ctx,
+      GRPC_CLOSURE_CREATE(call_resolver_next_now_lock_taken, a,
+                          grpc_combiner_scheduler(resolver->combiner)),
+      GRPC_ERROR_NONE);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  grpc_init();
+  gpr_mu_init(&g_mu);
+  g_combiner = grpc_combiner_create();
+  grpc_resolve_address = my_resolve_address;
+  grpc_dns_lookup_ares = my_dns_lookup_ares;
+  grpc_channel_args* result = (grpc_channel_args*)1;
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolver* resolver = create_resolver(&exec_ctx, "dns:test");
+  gpr_event ev1;
+  gpr_event_init(&ev1);
+  call_resolver_next_after_locking(
+      &exec_ctx, resolver, &result,
+      GRPC_CLOSURE_CREATE(on_done, &ev1, grpc_schedule_on_exec_ctx));
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(wait_loop(5, &ev1));
+  GPR_ASSERT(result == NULL);
+
+  gpr_event ev2;
+  gpr_event_init(&ev2);
+  call_resolver_next_after_locking(
+      &exec_ctx, resolver, &result,
+      GRPC_CLOSURE_CREATE(on_done, &ev2, grpc_schedule_on_exec_ctx));
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(wait_loop(30, &ev2));
+  GPR_ASSERT(result != NULL);
+
+  grpc_channel_args_destroy(&exec_ctx, result);
+  GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test");
+  GRPC_COMBINER_UNREF(&exec_ctx, g_combiner, "test");
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  grpc_shutdown();
+  gpr_mu_destroy(&g_mu);
+}
diff --git a/test/core/client_channel/resolvers/dns_resolver_test.c b/test/core/client_channel/resolvers/dns_resolver_test.c
deleted file mode 100644
index a14926f..0000000
--- a/test/core/client_channel/resolvers/dns_resolver_test.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/support/log.h>
-
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/lib/iomgr/combiner.h"
-#include "test/core/util/test_config.h"
-
-static grpc_combiner *g_combiner;
-
-static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_uri *uri = grpc_uri_parse(&exec_ctx, string, 0);
-  grpc_resolver_args args;
-  grpc_resolver *resolver;
-  gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", string,
-          factory->vtable->scheme);
-  GPR_ASSERT(uri);
-  memset(&args, 0, sizeof(args));
-  args.uri = uri;
-  args.combiner = g_combiner;
-  resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args);
-  GPR_ASSERT(resolver != NULL);
-  GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds");
-  grpc_uri_destroy(uri);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_fails(grpc_resolver_factory *factory, const char *string) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_uri *uri = grpc_uri_parse(&exec_ctx, string, 0);
-  grpc_resolver_args args;
-  grpc_resolver *resolver;
-  gpr_log(GPR_DEBUG, "test: '%s' should be invalid for '%s'", string,
-          factory->vtable->scheme);
-  GPR_ASSERT(uri);
-  memset(&args, 0, sizeof(args));
-  args.uri = uri;
-  args.combiner = g_combiner;
-  resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args);
-  GPR_ASSERT(resolver == NULL);
-  grpc_uri_destroy(uri);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_resolver_factory *dns;
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  g_combiner = grpc_combiner_create();
-
-  dns = grpc_resolver_factory_lookup("dns");
-
-  test_succeeds(dns, "dns:10.2.1.1");
-  test_succeeds(dns, "dns:10.2.1.1:1234");
-  test_succeeds(dns, "ipv4:www.google.com");
-  if (grpc_resolve_address == grpc_resolve_address_ares) {
-    test_succeeds(dns, "ipv4://8.8.8.8/8.8.8.8:8888");
-  } else {
-    test_fails(dns, "ipv4://8.8.8.8/8.8.8.8:8888");
-  }
-
-  grpc_resolver_factory_unref(dns);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    GRPC_COMBINER_UNREF(&exec_ctx, g_combiner, "test");
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/client_channel/resolvers/dns_resolver_test.cc b/test/core/client_channel/resolvers/dns_resolver_test.cc
new file mode 100644
index 0000000..ef3c1b8
--- /dev/null
+++ b/test/core/client_channel/resolvers/dns_resolver_test.cc
@@ -0,0 +1,92 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/lib/iomgr/combiner.h"
+#include "test/core/util/test_config.h"
+
+static grpc_combiner* g_combiner;
+
+static void test_succeeds(grpc_resolver_factory* factory, const char* string) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_uri* uri = grpc_uri_parse(&exec_ctx, string, 0);
+  grpc_resolver_args args;
+  grpc_resolver* resolver;
+  gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", string,
+          factory->vtable->scheme);
+  GPR_ASSERT(uri);
+  memset(&args, 0, sizeof(args));
+  args.uri = uri;
+  args.combiner = g_combiner;
+  resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args);
+  GPR_ASSERT(resolver != NULL);
+  GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds");
+  grpc_uri_destroy(uri);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_fails(grpc_resolver_factory* factory, const char* string) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_uri* uri = grpc_uri_parse(&exec_ctx, string, 0);
+  grpc_resolver_args args;
+  grpc_resolver* resolver;
+  gpr_log(GPR_DEBUG, "test: '%s' should be invalid for '%s'", string,
+          factory->vtable->scheme);
+  GPR_ASSERT(uri);
+  memset(&args, 0, sizeof(args));
+  args.uri = uri;
+  args.combiner = g_combiner;
+  resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args);
+  GPR_ASSERT(resolver == NULL);
+  grpc_uri_destroy(uri);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_resolver_factory* dns;
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  g_combiner = grpc_combiner_create();
+
+  dns = grpc_resolver_factory_lookup("dns");
+
+  test_succeeds(dns, "dns:10.2.1.1");
+  test_succeeds(dns, "dns:10.2.1.1:1234");
+  test_succeeds(dns, "ipv4:www.google.com");
+  if (grpc_resolve_address == grpc_resolve_address_ares) {
+    test_succeeds(dns, "ipv4://8.8.8.8/8.8.8.8:8888");
+  } else {
+    test_fails(dns, "ipv4://8.8.8.8/8.8.8.8:8888");
+  }
+
+  grpc_resolver_factory_unref(dns);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    GRPC_COMBINER_UNREF(&exec_ctx, g_combiner, "test");
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/client_channel/resolvers/fake_resolver_test.c b/test/core/client_channel/resolvers/fake_resolver_test.c
deleted file mode 100644
index 9b0854d..0000000
--- a/test/core/client_channel/resolvers/fake_resolver_test.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#include "src/core/ext/filters/client_channel/parse_address.h"
-#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/combiner.h"
-#include "src/core/lib/security/credentials/fake/fake_credentials.h"
-
-#include "test/core/util/test_config.h"
-
-static grpc_resolver *build_fake_resolver(
-    grpc_exec_ctx *exec_ctx, grpc_combiner *combiner,
-    grpc_fake_resolver_response_generator *response_generator) {
-  grpc_resolver_factory *factory = grpc_resolver_factory_lookup("fake");
-  grpc_arg generator_arg =
-      grpc_fake_resolver_response_generator_arg(response_generator);
-  grpc_resolver_args args;
-  memset(&args, 0, sizeof(args));
-  grpc_channel_args channel_args = {1, &generator_arg};
-  args.args = &channel_args;
-  args.combiner = combiner;
-  grpc_resolver *resolver =
-      grpc_resolver_factory_create_resolver(exec_ctx, factory, &args);
-  grpc_resolver_factory_unref(factory);
-  return resolver;
-}
-
-typedef struct on_resolution_arg {
-  grpc_channel_args *resolver_result;
-  grpc_channel_args *expected_resolver_result;
-  gpr_event ev;
-} on_resolution_arg;
-
-void on_resolution_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  on_resolution_arg *res = arg;
-  // We only check the addresses channel arg because that's the only one
-  // explicitly set by the test via
-  // grpc_fake_resolver_response_generator_set_response.
-  const grpc_lb_addresses *actual_lb_addresses =
-      grpc_lb_addresses_find_channel_arg(res->resolver_result);
-  const grpc_lb_addresses *expected_lb_addresses =
-      grpc_lb_addresses_find_channel_arg(res->expected_resolver_result);
-  GPR_ASSERT(
-      grpc_lb_addresses_cmp(actual_lb_addresses, expected_lb_addresses) == 0);
-  grpc_channel_args_destroy(exec_ctx, res->resolver_result);
-  grpc_channel_args_destroy(exec_ctx, res->expected_resolver_result);
-  gpr_event_set(&res->ev, (void *)1);
-}
-
-static void test_fake_resolver() {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_combiner *combiner = grpc_combiner_create();
-  // Create resolver.
-  grpc_fake_resolver_response_generator *response_generator =
-      grpc_fake_resolver_response_generator_create();
-  grpc_resolver *resolver =
-      build_fake_resolver(&exec_ctx, combiner, response_generator);
-  GPR_ASSERT(resolver != NULL);
-
-  // Setup expectations.
-  grpc_uri *uris[] = {grpc_uri_parse(&exec_ctx, "ipv4:10.2.1.1:1234", true),
-                      grpc_uri_parse(&exec_ctx, "ipv4:127.0.0.1:4321", true)};
-  char *balancer_names[] = {"name1", "name2"};
-  const bool is_balancer[] = {true, false};
-  grpc_lb_addresses *addresses = grpc_lb_addresses_create(3, NULL);
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(uris); ++i) {
-    grpc_lb_addresses_set_address_from_uri(
-        addresses, i, uris[i], is_balancer[i], balancer_names[i], NULL);
-    grpc_uri_destroy(uris[i]);
-  }
-  const grpc_arg addresses_arg =
-      grpc_lb_addresses_create_channel_arg(addresses);
-  grpc_channel_args *results =
-      grpc_channel_args_copy_and_add(NULL, &addresses_arg, 1);
-  grpc_lb_addresses_destroy(&exec_ctx, addresses);
-  on_resolution_arg on_res_arg;
-  memset(&on_res_arg, 0, sizeof(on_res_arg));
-  on_res_arg.expected_resolver_result = results;
-  gpr_event_init(&on_res_arg.ev);
-  grpc_closure *on_resolution = GRPC_CLOSURE_CREATE(
-      on_resolution_cb, &on_res_arg, grpc_combiner_scheduler(combiner));
-
-  // Set resolver results and trigger first resolution. on_resolution_cb
-  // performs the checks.
-  grpc_fake_resolver_response_generator_set_response(
-      &exec_ctx, response_generator, results);
-  grpc_resolver_next_locked(&exec_ctx, resolver, &on_res_arg.resolver_result,
-                            on_resolution);
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(gpr_event_wait(&on_res_arg.ev,
-                            grpc_timeout_seconds_to_deadline(5)) != NULL);
-
-  // Setup update.
-  grpc_uri *uris_update[] = {
-      grpc_uri_parse(&exec_ctx, "ipv4:192.168.1.0:31416", true)};
-  char *balancer_names_update[] = {"name3"};
-  const bool is_balancer_update[] = {false};
-  grpc_lb_addresses *addresses_update = grpc_lb_addresses_create(1, NULL);
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(uris_update); ++i) {
-    grpc_lb_addresses_set_address_from_uri(addresses_update, i, uris_update[i],
-                                           is_balancer_update[i],
-                                           balancer_names_update[i], NULL);
-    grpc_uri_destroy(uris_update[i]);
-  }
-
-  grpc_arg addresses_update_arg =
-      grpc_lb_addresses_create_channel_arg(addresses_update);
-  grpc_channel_args *results_update =
-      grpc_channel_args_copy_and_add(NULL, &addresses_update_arg, 1);
-  grpc_lb_addresses_destroy(&exec_ctx, addresses_update);
-
-  // Setup expectations for the update.
-  on_resolution_arg on_res_arg_update;
-  memset(&on_res_arg_update, 0, sizeof(on_res_arg_update));
-  on_res_arg_update.expected_resolver_result = results_update;
-  gpr_event_init(&on_res_arg_update.ev);
-  on_resolution = GRPC_CLOSURE_CREATE(on_resolution_cb, &on_res_arg_update,
-                                      grpc_combiner_scheduler(combiner));
-
-  // Set updated resolver results and trigger a second resolution.
-  grpc_fake_resolver_response_generator_set_response(
-      &exec_ctx, response_generator, results_update);
-  grpc_resolver_next_locked(&exec_ctx, resolver,
-                            &on_res_arg_update.resolver_result, on_resolution);
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(gpr_event_wait(&on_res_arg_update.ev,
-                            grpc_timeout_seconds_to_deadline(5)) != NULL);
-
-  // Requesting a new resolution without re-senting the response shouldn't
-  // trigger the resolution callback.
-  memset(&on_res_arg, 0, sizeof(on_res_arg));
-  grpc_resolver_next_locked(&exec_ctx, resolver, &on_res_arg.resolver_result,
-                            on_resolution);
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(gpr_event_wait(&on_res_arg.ev,
-                            grpc_timeout_milliseconds_to_deadline(100)) ==
-             NULL);
-
-  GRPC_COMBINER_UNREF(&exec_ctx, combiner, "test_fake_resolver");
-  GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_fake_resolver");
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_fake_resolver_response_generator_unref(response_generator);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  test_fake_resolver();
-
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/client_channel/resolvers/fake_resolver_test.cc b/test/core/client_channel/resolvers/fake_resolver_test.cc
new file mode 100644
index 0000000..06e8ebd
--- /dev/null
+++ b/test/core/client_channel/resolvers/fake_resolver_test.cc
@@ -0,0 +1,177 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/parse_address.h"
+#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/combiner.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+
+#include "test/core/util/test_config.h"
+
+static grpc_resolver* build_fake_resolver(
+    grpc_exec_ctx* exec_ctx, grpc_combiner* combiner,
+    grpc_fake_resolver_response_generator* response_generator) {
+  grpc_resolver_factory* factory = grpc_resolver_factory_lookup("fake");
+  grpc_arg generator_arg =
+      grpc_fake_resolver_response_generator_arg(response_generator);
+  grpc_resolver_args args;
+  memset(&args, 0, sizeof(args));
+  grpc_channel_args channel_args = {1, &generator_arg};
+  args.args = &channel_args;
+  args.combiner = combiner;
+  grpc_resolver* resolver =
+      grpc_resolver_factory_create_resolver(exec_ctx, factory, &args);
+  grpc_resolver_factory_unref(factory);
+  return resolver;
+}
+
+typedef struct on_resolution_arg {
+  grpc_channel_args* resolver_result;
+  grpc_channel_args* expected_resolver_result;
+  gpr_event ev;
+} on_resolution_arg;
+
+void on_resolution_cb(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  on_resolution_arg* res = static_cast<on_resolution_arg*>(arg);
+  // We only check the addresses channel arg because that's the only one
+  // explicitly set by the test via
+  // grpc_fake_resolver_response_generator_set_response.
+  const grpc_lb_addresses* actual_lb_addresses =
+      grpc_lb_addresses_find_channel_arg(res->resolver_result);
+  const grpc_lb_addresses* expected_lb_addresses =
+      grpc_lb_addresses_find_channel_arg(res->expected_resolver_result);
+  GPR_ASSERT(
+      grpc_lb_addresses_cmp(actual_lb_addresses, expected_lb_addresses) == 0);
+  grpc_channel_args_destroy(exec_ctx, res->resolver_result);
+  grpc_channel_args_destroy(exec_ctx, res->expected_resolver_result);
+  gpr_event_set(&res->ev, (void*)1);
+}
+
+static void test_fake_resolver() {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_combiner* combiner = grpc_combiner_create();
+  // Create resolver.
+  grpc_fake_resolver_response_generator* response_generator =
+      grpc_fake_resolver_response_generator_create();
+  grpc_resolver* resolver =
+      build_fake_resolver(&exec_ctx, combiner, response_generator);
+  GPR_ASSERT(resolver != NULL);
+
+  // Setup expectations.
+  grpc_uri* uris[] = {grpc_uri_parse(&exec_ctx, "ipv4:10.2.1.1:1234", true),
+                      grpc_uri_parse(&exec_ctx, "ipv4:127.0.0.1:4321", true)};
+  const char* balancer_names[] = {"name1", "name2"};
+  const bool is_balancer[] = {true, false};
+  grpc_lb_addresses* addresses = grpc_lb_addresses_create(3, NULL);
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(uris); ++i) {
+    grpc_lb_addresses_set_address_from_uri(
+        addresses, i, uris[i], is_balancer[i], balancer_names[i], NULL);
+    grpc_uri_destroy(uris[i]);
+  }
+  const grpc_arg addresses_arg =
+      grpc_lb_addresses_create_channel_arg(addresses);
+  grpc_channel_args* results =
+      grpc_channel_args_copy_and_add(NULL, &addresses_arg, 1);
+  grpc_lb_addresses_destroy(&exec_ctx, addresses);
+  on_resolution_arg on_res_arg;
+  memset(&on_res_arg, 0, sizeof(on_res_arg));
+  on_res_arg.expected_resolver_result = results;
+  gpr_event_init(&on_res_arg.ev);
+  grpc_closure* on_resolution = GRPC_CLOSURE_CREATE(
+      on_resolution_cb, &on_res_arg, grpc_combiner_scheduler(combiner));
+
+  // Set resolver results and trigger first resolution. on_resolution_cb
+  // performs the checks.
+  grpc_fake_resolver_response_generator_set_response(
+      &exec_ctx, response_generator, results);
+  grpc_resolver_next_locked(&exec_ctx, resolver, &on_res_arg.resolver_result,
+                            on_resolution);
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(gpr_event_wait(&on_res_arg.ev,
+                            grpc_timeout_seconds_to_deadline(5)) != NULL);
+
+  // Setup update.
+  grpc_uri* uris_update[] = {
+      grpc_uri_parse(&exec_ctx, "ipv4:192.168.1.0:31416", true)};
+  const char* balancer_names_update[] = {"name3"};
+  const bool is_balancer_update[] = {false};
+  grpc_lb_addresses* addresses_update = grpc_lb_addresses_create(1, NULL);
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(uris_update); ++i) {
+    grpc_lb_addresses_set_address_from_uri(addresses_update, i, uris_update[i],
+                                           is_balancer_update[i],
+                                           balancer_names_update[i], NULL);
+    grpc_uri_destroy(uris_update[i]);
+  }
+
+  grpc_arg addresses_update_arg =
+      grpc_lb_addresses_create_channel_arg(addresses_update);
+  grpc_channel_args* results_update =
+      grpc_channel_args_copy_and_add(NULL, &addresses_update_arg, 1);
+  grpc_lb_addresses_destroy(&exec_ctx, addresses_update);
+
+  // Setup expectations for the update.
+  on_resolution_arg on_res_arg_update;
+  memset(&on_res_arg_update, 0, sizeof(on_res_arg_update));
+  on_res_arg_update.expected_resolver_result = results_update;
+  gpr_event_init(&on_res_arg_update.ev);
+  on_resolution = GRPC_CLOSURE_CREATE(on_resolution_cb, &on_res_arg_update,
+                                      grpc_combiner_scheduler(combiner));
+
+  // Set updated resolver results and trigger a second resolution.
+  grpc_fake_resolver_response_generator_set_response(
+      &exec_ctx, response_generator, results_update);
+  grpc_resolver_next_locked(&exec_ctx, resolver,
+                            &on_res_arg_update.resolver_result, on_resolution);
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(gpr_event_wait(&on_res_arg_update.ev,
+                            grpc_timeout_seconds_to_deadline(5)) != NULL);
+
+  // Requesting a new resolution without re-senting the response shouldn't
+  // trigger the resolution callback.
+  memset(&on_res_arg, 0, sizeof(on_res_arg));
+  grpc_resolver_next_locked(&exec_ctx, resolver, &on_res_arg.resolver_result,
+                            on_resolution);
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(gpr_event_wait(&on_res_arg.ev,
+                            grpc_timeout_milliseconds_to_deadline(100)) ==
+             NULL);
+
+  GRPC_COMBINER_UNREF(&exec_ctx, combiner, "test_fake_resolver");
+  GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_fake_resolver");
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_fake_resolver_response_generator_unref(response_generator);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  test_fake_resolver();
+
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.c b/test/core/client_channel/resolvers/sockaddr_resolver_test.c
deleted file mode 100644
index 8b88619..0000000
--- a/test/core/client_channel/resolvers/sockaddr_resolver_test.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/combiner.h"
-
-#include "test/core/util/test_config.h"
-
-static grpc_combiner *g_combiner;
-
-typedef struct on_resolution_arg {
-  char *expected_server_name;
-  grpc_channel_args *resolver_result;
-} on_resolution_arg;
-
-void on_resolution_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  on_resolution_arg *res = arg;
-  grpc_channel_args_destroy(exec_ctx, res->resolver_result);
-}
-
-static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_uri *uri = grpc_uri_parse(&exec_ctx, string, 0);
-  grpc_resolver_args args;
-  grpc_resolver *resolver;
-  gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", string,
-          factory->vtable->scheme);
-  GPR_ASSERT(uri);
-  memset(&args, 0, sizeof(args));
-  args.uri = uri;
-  args.combiner = g_combiner;
-  resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args);
-  GPR_ASSERT(resolver != NULL);
-
-  on_resolution_arg on_res_arg;
-  memset(&on_res_arg, 0, sizeof(on_res_arg));
-  on_res_arg.expected_server_name = uri->path;
-  grpc_closure *on_resolution = GRPC_CLOSURE_CREATE(
-      on_resolution_cb, &on_res_arg, grpc_schedule_on_exec_ctx);
-
-  grpc_resolver_next_locked(&exec_ctx, resolver, &on_res_arg.resolver_result,
-                            on_resolution);
-  GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds");
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_uri_destroy(uri);
-}
-
-static void test_fails(grpc_resolver_factory *factory, const char *string) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_uri *uri = grpc_uri_parse(&exec_ctx, string, 0);
-  grpc_resolver_args args;
-  grpc_resolver *resolver;
-  gpr_log(GPR_DEBUG, "test: '%s' should be invalid for '%s'", string,
-          factory->vtable->scheme);
-  GPR_ASSERT(uri);
-  memset(&args, 0, sizeof(args));
-  args.uri = uri;
-  args.combiner = g_combiner;
-  resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args);
-  GPR_ASSERT(resolver == NULL);
-  grpc_uri_destroy(uri);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_resolver_factory *ipv4, *ipv6;
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  g_combiner = grpc_combiner_create();
-
-  ipv4 = grpc_resolver_factory_lookup("ipv4");
-  ipv6 = grpc_resolver_factory_lookup("ipv6");
-
-  test_fails(ipv4, "ipv4:10.2.1.1");
-  test_succeeds(ipv4, "ipv4:10.2.1.1:1234");
-  test_succeeds(ipv4, "ipv4:10.2.1.1:1234,127.0.0.1:4321");
-  test_fails(ipv4, "ipv4:10.2.1.1:123456");
-  test_fails(ipv4, "ipv4:www.google.com");
-  test_fails(ipv4, "ipv4:[");
-  test_fails(ipv4, "ipv4://8.8.8.8/8.8.8.8:8888");
-
-  test_fails(ipv6, "ipv6:[");
-  test_fails(ipv6, "ipv6:[::]");
-  test_succeeds(ipv6, "ipv6:[::]:1234");
-  test_fails(ipv6, "ipv6:[::]:123456");
-  test_fails(ipv6, "ipv6:www.google.com");
-
-  grpc_resolver_factory_unref(ipv4);
-  grpc_resolver_factory_unref(ipv6);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    GRPC_COMBINER_UNREF(&exec_ctx, g_combiner, "test");
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc
new file mode 100644
index 0000000..028a786
--- /dev/null
+++ b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc
@@ -0,0 +1,122 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/combiner.h"
+
+#include "test/core/util/test_config.h"
+
+static grpc_combiner* g_combiner;
+
+typedef struct on_resolution_arg {
+  char* expected_server_name;
+  grpc_channel_args* resolver_result;
+} on_resolution_arg;
+
+void on_resolution_cb(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  on_resolution_arg* res = static_cast<on_resolution_arg*>(arg);
+  grpc_channel_args_destroy(exec_ctx, res->resolver_result);
+}
+
+static void test_succeeds(grpc_resolver_factory* factory, const char* string) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_uri* uri = grpc_uri_parse(&exec_ctx, string, 0);
+  grpc_resolver_args args;
+  grpc_resolver* resolver;
+  gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", string,
+          factory->vtable->scheme);
+  GPR_ASSERT(uri);
+  memset(&args, 0, sizeof(args));
+  args.uri = uri;
+  args.combiner = g_combiner;
+  resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args);
+  GPR_ASSERT(resolver != NULL);
+
+  on_resolution_arg on_res_arg;
+  memset(&on_res_arg, 0, sizeof(on_res_arg));
+  on_res_arg.expected_server_name = uri->path;
+  grpc_closure* on_resolution = GRPC_CLOSURE_CREATE(
+      on_resolution_cb, &on_res_arg, grpc_schedule_on_exec_ctx);
+
+  grpc_resolver_next_locked(&exec_ctx, resolver, &on_res_arg.resolver_result,
+                            on_resolution);
+  GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds");
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_uri_destroy(uri);
+}
+
+static void test_fails(grpc_resolver_factory* factory, const char* string) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_uri* uri = grpc_uri_parse(&exec_ctx, string, 0);
+  grpc_resolver_args args;
+  grpc_resolver* resolver;
+  gpr_log(GPR_DEBUG, "test: '%s' should be invalid for '%s'", string,
+          factory->vtable->scheme);
+  GPR_ASSERT(uri);
+  memset(&args, 0, sizeof(args));
+  args.uri = uri;
+  args.combiner = g_combiner;
+  resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args);
+  GPR_ASSERT(resolver == NULL);
+  grpc_uri_destroy(uri);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_resolver_factory *ipv4, *ipv6;
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  g_combiner = grpc_combiner_create();
+
+  ipv4 = grpc_resolver_factory_lookup("ipv4");
+  ipv6 = grpc_resolver_factory_lookup("ipv6");
+
+  test_fails(ipv4, "ipv4:10.2.1.1");
+  test_succeeds(ipv4, "ipv4:10.2.1.1:1234");
+  test_succeeds(ipv4, "ipv4:10.2.1.1:1234,127.0.0.1:4321");
+  test_fails(ipv4, "ipv4:10.2.1.1:123456");
+  test_fails(ipv4, "ipv4:www.google.com");
+  test_fails(ipv4, "ipv4:[");
+  test_fails(ipv4, "ipv4://8.8.8.8/8.8.8.8:8888");
+
+  test_fails(ipv6, "ipv6:[");
+  test_fails(ipv6, "ipv6:[::]");
+  test_succeeds(ipv6, "ipv6:[::]:1234");
+  test_fails(ipv6, "ipv6:[::]:123456");
+  test_fails(ipv6, "ipv6:www.google.com");
+
+  grpc_resolver_factory_unref(ipv4);
+  grpc_resolver_factory_unref(ipv6);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    GRPC_COMBINER_UNREF(&exec_ctx, g_combiner, "test");
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/client_channel/uri_fuzzer_test.c b/test/core/client_channel/uri_fuzzer_test.c
deleted file mode 100644
index e51d003..0000000
--- a/test/core/client_channel/uri_fuzzer_test.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/ext/filters/client_channel/uri_parser.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  char *s = gpr_malloc(size + 1);
-  memcpy(s, data, size);
-  s[size] = 0;
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_uri *x;
-  if ((x = grpc_uri_parse(&exec_ctx, s, 1))) {
-    grpc_uri_destroy(x);
-  }
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(s);
-  return 0;
-}
diff --git a/test/core/client_channel/uri_fuzzer_test.cc b/test/core/client_channel/uri_fuzzer_test.cc
new file mode 100644
index 0000000..ba31793
--- /dev/null
+++ b/test/core/client_channel/uri_fuzzer_test.cc
@@ -0,0 +1,44 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/ext/filters/client_channel/uri_parser.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  char* s = static_cast<char*>(gpr_malloc(size + 1));
+  memcpy(s, data, size);
+  s[size] = 0;
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_uri* x;
+  if ((x = grpc_uri_parse(&exec_ctx, s, 1))) {
+    grpc_uri_destroy(x);
+  }
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(s);
+  return 0;
+}
diff --git a/test/core/client_channel/uri_parser_test.c b/test/core/client_channel/uri_parser_test.c
deleted file mode 100644
index f53cae1..0000000
--- a/test/core/client_channel/uri_parser_test.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/filters/client_channel/uri_parser.h"
-
-#include <string.h>
-
-#include <grpc/support/log.h>
-
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "test/core/util/test_config.h"
-
-static void test_succeeds(const char *uri_text, const char *scheme,
-                          const char *authority, const char *path,
-                          const char *query, const char *fragment) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
-  GPR_ASSERT(uri);
-  GPR_ASSERT(0 == strcmp(scheme, uri->scheme));
-  GPR_ASSERT(0 == strcmp(authority, uri->authority));
-  GPR_ASSERT(0 == strcmp(path, uri->path));
-  GPR_ASSERT(0 == strcmp(query, uri->query));
-  GPR_ASSERT(0 == strcmp(fragment, uri->fragment));
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_uri_destroy(uri);
-}
-
-static void test_fails(const char *uri_text) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GPR_ASSERT(NULL == grpc_uri_parse(&exec_ctx, uri_text, 0));
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_query_parts() {
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    const char *uri_text = "http://foo/path?a&b=B&c=&#frag";
-    grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
-    GPR_ASSERT(uri);
-
-    GPR_ASSERT(0 == strcmp("http", uri->scheme));
-    GPR_ASSERT(0 == strcmp("foo", uri->authority));
-    GPR_ASSERT(0 == strcmp("/path", uri->path));
-    GPR_ASSERT(0 == strcmp("a&b=B&c=&", uri->query));
-    GPR_ASSERT(4 == uri->num_query_parts);
-
-    GPR_ASSERT(0 == strcmp("a", uri->query_parts[0]));
-    GPR_ASSERT(NULL == uri->query_parts_values[0]);
-
-    GPR_ASSERT(0 == strcmp("b", uri->query_parts[1]));
-    GPR_ASSERT(0 == strcmp("B", uri->query_parts_values[1]));
-
-    GPR_ASSERT(0 == strcmp("c", uri->query_parts[2]));
-    GPR_ASSERT(0 == strcmp("", uri->query_parts_values[2]));
-
-    GPR_ASSERT(0 == strcmp("", uri->query_parts[3]));
-    GPR_ASSERT(NULL == uri->query_parts_values[3]);
-
-    GPR_ASSERT(NULL == grpc_uri_get_query_arg(uri, "a"));
-    GPR_ASSERT(0 == strcmp("B", grpc_uri_get_query_arg(uri, "b")));
-    GPR_ASSERT(0 == strcmp("", grpc_uri_get_query_arg(uri, "c")));
-    GPR_ASSERT(NULL == grpc_uri_get_query_arg(uri, ""));
-
-    GPR_ASSERT(0 == strcmp("frag", uri->fragment));
-    grpc_exec_ctx_finish(&exec_ctx);
-    grpc_uri_destroy(uri);
-  }
-  {
-    /* test the current behavior of multiple query part values */
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    const char *uri_text = "http://auth/path?foo=bar=baz&foobar==";
-    grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
-    GPR_ASSERT(uri);
-
-    GPR_ASSERT(0 == strcmp("http", uri->scheme));
-    GPR_ASSERT(0 == strcmp("auth", uri->authority));
-    GPR_ASSERT(0 == strcmp("/path", uri->path));
-    GPR_ASSERT(0 == strcmp("foo=bar=baz&foobar==", uri->query));
-    GPR_ASSERT(2 == uri->num_query_parts);
-
-    GPR_ASSERT(0 == strcmp("bar", grpc_uri_get_query_arg(uri, "foo")));
-    GPR_ASSERT(0 == strcmp("", grpc_uri_get_query_arg(uri, "foobar")));
-
-    grpc_exec_ctx_finish(&exec_ctx);
-    grpc_uri_destroy(uri);
-  }
-  {
-    /* empty query */
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    const char *uri_text = "http://foo/path";
-    grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
-    GPR_ASSERT(uri);
-
-    GPR_ASSERT(0 == strcmp("http", uri->scheme));
-    GPR_ASSERT(0 == strcmp("foo", uri->authority));
-    GPR_ASSERT(0 == strcmp("/path", uri->path));
-    GPR_ASSERT(0 == strcmp("", uri->query));
-    GPR_ASSERT(0 == uri->num_query_parts);
-    GPR_ASSERT(NULL == uri->query_parts);
-    GPR_ASSERT(NULL == uri->query_parts_values);
-    GPR_ASSERT(0 == strcmp("", uri->fragment));
-    grpc_exec_ctx_finish(&exec_ctx);
-    grpc_uri_destroy(uri);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_succeeds("http://www.google.com", "http", "www.google.com", "", "", "");
-  test_succeeds("dns:///foo", "dns", "", "/foo", "", "");
-  test_succeeds("http://www.google.com:90", "http", "www.google.com:90", "", "",
-                "");
-  test_succeeds("a192.4-df:foo.coom", "a192.4-df", "", "foo.coom", "", "");
-  test_succeeds("a+b:foo.coom", "a+b", "", "foo.coom", "", "");
-  test_succeeds("zookeeper://127.0.0.1:2181/foo/bar", "zookeeper",
-                "127.0.0.1:2181", "/foo/bar", "", "");
-  test_succeeds("http://www.google.com?yay-i'm-using-queries", "http",
-                "www.google.com", "", "yay-i'm-using-queries", "");
-  test_succeeds("dns:foo.com#fragment-all-the-things", "dns", "", "foo.com", "",
-                "fragment-all-the-things");
-  test_succeeds("http:?legit", "http", "", "", "legit", "");
-  test_succeeds("unix:#this-is-ok-too", "unix", "", "", "", "this-is-ok-too");
-  test_succeeds("http:?legit#twice", "http", "", "", "legit", "twice");
-  test_succeeds("http://foo?bar#lol?", "http", "foo", "", "bar", "lol?");
-  test_succeeds("http://foo?bar#lol?/", "http", "foo", "", "bar", "lol?/");
-  test_succeeds("ipv6:[2001:db8::1%252]:12345", "ipv6", "",
-                "[2001:db8::1%2]:12345", "", "");
-
-  test_fails("xyz");
-  test_fails("http:?dangling-pct-%0");
-  test_fails("http://foo?[bar]");
-  test_fails("http://foo?x[bar]");
-  test_fails("http://foo?bar#lol#");
-
-  test_query_parts();
-  return 0;
-}
diff --git a/test/core/client_channel/uri_parser_test.cc b/test/core/client_channel/uri_parser_test.cc
new file mode 100644
index 0000000..0bdf57c
--- /dev/null
+++ b/test/core/client_channel/uri_parser_test.cc
@@ -0,0 +1,152 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/filters/client_channel/uri_parser.h"
+
+#include <string.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "test/core/util/test_config.h"
+
+static void test_succeeds(const char* uri_text, const char* scheme,
+                          const char* authority, const char* path,
+                          const char* query, const char* fragment) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_uri* uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
+  GPR_ASSERT(uri);
+  GPR_ASSERT(0 == strcmp(scheme, uri->scheme));
+  GPR_ASSERT(0 == strcmp(authority, uri->authority));
+  GPR_ASSERT(0 == strcmp(path, uri->path));
+  GPR_ASSERT(0 == strcmp(query, uri->query));
+  GPR_ASSERT(0 == strcmp(fragment, uri->fragment));
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_uri_destroy(uri);
+}
+
+static void test_fails(const char* uri_text) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GPR_ASSERT(NULL == grpc_uri_parse(&exec_ctx, uri_text, 0));
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_query_parts() {
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    const char* uri_text = "http://foo/path?a&b=B&c=&#frag";
+    grpc_uri* uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
+    GPR_ASSERT(uri);
+
+    GPR_ASSERT(0 == strcmp("http", uri->scheme));
+    GPR_ASSERT(0 == strcmp("foo", uri->authority));
+    GPR_ASSERT(0 == strcmp("/path", uri->path));
+    GPR_ASSERT(0 == strcmp("a&b=B&c=&", uri->query));
+    GPR_ASSERT(4 == uri->num_query_parts);
+
+    GPR_ASSERT(0 == strcmp("a", uri->query_parts[0]));
+    GPR_ASSERT(NULL == uri->query_parts_values[0]);
+
+    GPR_ASSERT(0 == strcmp("b", uri->query_parts[1]));
+    GPR_ASSERT(0 == strcmp("B", uri->query_parts_values[1]));
+
+    GPR_ASSERT(0 == strcmp("c", uri->query_parts[2]));
+    GPR_ASSERT(0 == strcmp("", uri->query_parts_values[2]));
+
+    GPR_ASSERT(0 == strcmp("", uri->query_parts[3]));
+    GPR_ASSERT(NULL == uri->query_parts_values[3]);
+
+    GPR_ASSERT(NULL == grpc_uri_get_query_arg(uri, "a"));
+    GPR_ASSERT(0 == strcmp("B", grpc_uri_get_query_arg(uri, "b")));
+    GPR_ASSERT(0 == strcmp("", grpc_uri_get_query_arg(uri, "c")));
+    GPR_ASSERT(NULL == grpc_uri_get_query_arg(uri, ""));
+
+    GPR_ASSERT(0 == strcmp("frag", uri->fragment));
+    grpc_exec_ctx_finish(&exec_ctx);
+    grpc_uri_destroy(uri);
+  }
+  {
+    /* test the current behavior of multiple query part values */
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    const char* uri_text = "http://auth/path?foo=bar=baz&foobar==";
+    grpc_uri* uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
+    GPR_ASSERT(uri);
+
+    GPR_ASSERT(0 == strcmp("http", uri->scheme));
+    GPR_ASSERT(0 == strcmp("auth", uri->authority));
+    GPR_ASSERT(0 == strcmp("/path", uri->path));
+    GPR_ASSERT(0 == strcmp("foo=bar=baz&foobar==", uri->query));
+    GPR_ASSERT(2 == uri->num_query_parts);
+
+    GPR_ASSERT(0 == strcmp("bar", grpc_uri_get_query_arg(uri, "foo")));
+    GPR_ASSERT(0 == strcmp("", grpc_uri_get_query_arg(uri, "foobar")));
+
+    grpc_exec_ctx_finish(&exec_ctx);
+    grpc_uri_destroy(uri);
+  }
+  {
+    /* empty query */
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    const char* uri_text = "http://foo/path";
+    grpc_uri* uri = grpc_uri_parse(&exec_ctx, uri_text, 0);
+    GPR_ASSERT(uri);
+
+    GPR_ASSERT(0 == strcmp("http", uri->scheme));
+    GPR_ASSERT(0 == strcmp("foo", uri->authority));
+    GPR_ASSERT(0 == strcmp("/path", uri->path));
+    GPR_ASSERT(0 == strcmp("", uri->query));
+    GPR_ASSERT(0 == uri->num_query_parts);
+    GPR_ASSERT(NULL == uri->query_parts);
+    GPR_ASSERT(NULL == uri->query_parts_values);
+    GPR_ASSERT(0 == strcmp("", uri->fragment));
+    grpc_exec_ctx_finish(&exec_ctx);
+    grpc_uri_destroy(uri);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_succeeds("http://www.google.com", "http", "www.google.com", "", "", "");
+  test_succeeds("dns:///foo", "dns", "", "/foo", "", "");
+  test_succeeds("http://www.google.com:90", "http", "www.google.com:90", "", "",
+                "");
+  test_succeeds("a192.4-df:foo.coom", "a192.4-df", "", "foo.coom", "", "");
+  test_succeeds("a+b:foo.coom", "a+b", "", "foo.coom", "", "");
+  test_succeeds("zookeeper://127.0.0.1:2181/foo/bar", "zookeeper",
+                "127.0.0.1:2181", "/foo/bar", "", "");
+  test_succeeds("http://www.google.com?yay-i'm-using-queries", "http",
+                "www.google.com", "", "yay-i'm-using-queries", "");
+  test_succeeds("dns:foo.com#fragment-all-the-things", "dns", "", "foo.com", "",
+                "fragment-all-the-things");
+  test_succeeds("http:?legit", "http", "", "", "legit", "");
+  test_succeeds("unix:#this-is-ok-too", "unix", "", "", "", "this-is-ok-too");
+  test_succeeds("http:?legit#twice", "http", "", "", "legit", "twice");
+  test_succeeds("http://foo?bar#lol?", "http", "foo", "", "bar", "lol?");
+  test_succeeds("http://foo?bar#lol?/", "http", "foo", "", "bar", "lol?/");
+  test_succeeds("ipv6:[2001:db8::1%252]:12345", "ipv6", "",
+                "[2001:db8::1%2]:12345", "", "");
+
+  test_fails("xyz");
+  test_fails("http:?dangling-pct-%0");
+  test_fails("http://foo?[bar]");
+  test_fails("http://foo?x[bar]");
+  test_fails("http://foo?bar#lol#");
+
+  test_query_parts();
+  return 0;
+}
diff --git a/test/core/compression/BUILD b/test/core/compression/BUILD
index 1ab6e35..ee71eec 100644
--- a/test/core/compression/BUILD
+++ b/test/core/compression/BUILD
@@ -20,8 +20,8 @@
 
 grpc_cc_test(
     name = "algorithm_test",
-    srcs = ["algorithm_test.c"],
-    language = "C",
+    srcs = ["algorithm_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -32,8 +32,8 @@
 
 grpc_cc_test(
     name = "compression_test",
-    srcs = ["compression_test.c"],
-    language = "C",
+    srcs = ["compression_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -44,8 +44,8 @@
 
 grpc_cc_test(
     name = "message_compress_test",
-    srcs = ["message_compress_test.c"],
-    language = "C",
+    srcs = ["message_compress_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/compression/algorithm_test.c b/test/core/compression/algorithm_test.c
deleted file mode 100644
index a11e6e9..0000000
--- a/test/core/compression/algorithm_test.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/compression/algorithm_metadata.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/transport/static_metadata.h"
-#include "test/core/util/test_config.h"
-
-static void test_algorithm_mesh(void) {
-  int i;
-
-  gpr_log(GPR_DEBUG, "test_algorithm_mesh");
-
-  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
-    const char *name;
-    grpc_compression_algorithm parsed;
-    grpc_slice mdstr;
-    grpc_mdelem mdelem;
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    GPR_ASSERT(
-        grpc_compression_algorithm_name((grpc_compression_algorithm)i, &name));
-    GPR_ASSERT(grpc_compression_algorithm_parse(
-        grpc_slice_from_static_string(name), &parsed));
-    GPR_ASSERT((int)parsed == i);
-    mdstr = grpc_slice_from_copied_string(name);
-    GPR_ASSERT(grpc_slice_eq(mdstr, grpc_compression_algorithm_slice(parsed)));
-    GPR_ASSERT(parsed == grpc_compression_algorithm_from_slice(mdstr));
-    mdelem = grpc_compression_encoding_mdelem(parsed);
-    GPR_ASSERT(grpc_slice_eq(GRPC_MDVALUE(mdelem), mdstr));
-    GPR_ASSERT(grpc_slice_eq(GRPC_MDKEY(mdelem), GRPC_MDSTR_GRPC_ENCODING));
-    grpc_slice_unref_internal(&exec_ctx, mdstr);
-    GRPC_MDELEM_UNREF(&exec_ctx, mdelem);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  /* test failure */
-  GPR_ASSERT(GRPC_MDISNULL(
-      grpc_compression_encoding_mdelem(GRPC_COMPRESS_ALGORITHMS_COUNT)));
-}
-
-static void test_algorithm_failure(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_slice mdstr;
-
-  gpr_log(GPR_DEBUG, "test_algorithm_failure");
-
-  GPR_ASSERT(grpc_compression_algorithm_name(GRPC_COMPRESS_ALGORITHMS_COUNT,
-                                             NULL) == 0);
-  GPR_ASSERT(grpc_compression_algorithm_name(GRPC_COMPRESS_ALGORITHMS_COUNT + 1,
-                                             NULL) == 0);
-  mdstr = grpc_slice_from_static_string("this-is-an-invalid-algorithm");
-  GPR_ASSERT(grpc_compression_algorithm_from_slice(mdstr) ==
-             GRPC_COMPRESS_ALGORITHMS_COUNT);
-  GPR_ASSERT(grpc_slice_eq(
-      grpc_compression_algorithm_slice(GRPC_COMPRESS_ALGORITHMS_COUNT),
-      grpc_empty_slice()));
-  GPR_ASSERT(grpc_slice_eq(
-      grpc_compression_algorithm_slice(GRPC_COMPRESS_ALGORITHMS_COUNT + 1),
-      grpc_empty_slice()));
-  grpc_slice_unref_internal(&exec_ctx, mdstr);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  test_algorithm_mesh();
-  test_algorithm_failure();
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/compression/algorithm_test.cc b/test/core/compression/algorithm_test.cc
new file mode 100644
index 0000000..bc3af41
--- /dev/null
+++ b/test/core/compression/algorithm_test.cc
@@ -0,0 +1,100 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/compression/algorithm_metadata.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/static_metadata.h"
+#include "test/core/util/test_config.h"
+
+static void test_algorithm_mesh(void) {
+  int i;
+
+  gpr_log(GPR_DEBUG, "test_algorithm_mesh");
+
+  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
+    const char* name;
+    grpc_compression_algorithm parsed;
+    grpc_slice mdstr;
+    grpc_mdelem mdelem;
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    GPR_ASSERT(
+        grpc_compression_algorithm_name((grpc_compression_algorithm)i, &name));
+    GPR_ASSERT(grpc_compression_algorithm_parse(
+        grpc_slice_from_static_string(name), &parsed));
+    GPR_ASSERT((int)parsed == i);
+    mdstr = grpc_slice_from_copied_string(name);
+    GPR_ASSERT(grpc_slice_eq(mdstr, grpc_compression_algorithm_slice(parsed)));
+    GPR_ASSERT(parsed == grpc_compression_algorithm_from_slice(mdstr));
+    mdelem = grpc_compression_encoding_mdelem(parsed);
+    GPR_ASSERT(grpc_slice_eq(GRPC_MDVALUE(mdelem), mdstr));
+    GPR_ASSERT(grpc_slice_eq(GRPC_MDKEY(mdelem), GRPC_MDSTR_GRPC_ENCODING));
+    grpc_slice_unref_internal(&exec_ctx, mdstr);
+    GRPC_MDELEM_UNREF(&exec_ctx, mdelem);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  /* test failure */
+  GPR_ASSERT(GRPC_MDISNULL(
+      grpc_compression_encoding_mdelem(GRPC_COMPRESS_ALGORITHMS_COUNT)));
+}
+
+static void test_algorithm_failure(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_slice mdstr;
+
+  gpr_log(GPR_DEBUG, "test_algorithm_failure");
+
+  GPR_ASSERT(grpc_compression_algorithm_name(GRPC_COMPRESS_ALGORITHMS_COUNT,
+                                             NULL) == 0);
+  GPR_ASSERT(
+      grpc_compression_algorithm_name(static_cast<grpc_compression_algorithm>(
+                                          GRPC_COMPRESS_ALGORITHMS_COUNT + 1),
+                                      NULL) == 0);
+  mdstr = grpc_slice_from_static_string("this-is-an-invalid-algorithm");
+  GPR_ASSERT(grpc_compression_algorithm_from_slice(mdstr) ==
+             GRPC_COMPRESS_ALGORITHMS_COUNT);
+  GPR_ASSERT(grpc_slice_eq(
+      grpc_compression_algorithm_slice(GRPC_COMPRESS_ALGORITHMS_COUNT),
+      grpc_empty_slice()));
+  GPR_ASSERT(grpc_slice_eq(
+      grpc_compression_algorithm_slice(static_cast<grpc_compression_algorithm>(
+          static_cast<int>(GRPC_COMPRESS_ALGORITHMS_COUNT) + 1)),
+      grpc_empty_slice()));
+  grpc_slice_unref_internal(&exec_ctx, mdstr);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  test_algorithm_mesh();
+  test_algorithm_failure();
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/compression/compression_test.c b/test/core/compression/compression_test.c
deleted file mode 100644
index 326a800..0000000
--- a/test/core/compression/compression_test.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <grpc/compression.h>
-#include <grpc/grpc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "test/core/util/test_config.h"
-
-static void test_compression_algorithm_parse(void) {
-  size_t i;
-  const char *valid_names[] = {"identity", "gzip", "deflate"};
-  const grpc_compression_algorithm valid_algorithms[] = {
-      GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE};
-  const char *invalid_names[] = {"gzip2", "foo", "", "2gzip"};
-
-  gpr_log(GPR_DEBUG, "test_compression_algorithm_parse");
-
-  for (i = 0; i < GPR_ARRAY_SIZE(valid_names); i++) {
-    const char *valid_name = valid_names[i];
-    grpc_compression_algorithm algorithm;
-    const int success = grpc_compression_algorithm_parse(
-        grpc_slice_from_static_string(valid_name), &algorithm);
-    GPR_ASSERT(success != 0);
-    GPR_ASSERT(algorithm == valid_algorithms[i]);
-  }
-
-  for (i = 0; i < GPR_ARRAY_SIZE(invalid_names); i++) {
-    const char *invalid_name = invalid_names[i];
-    grpc_compression_algorithm algorithm;
-    int success;
-    success = grpc_compression_algorithm_parse(
-        grpc_slice_from_static_string(invalid_name), &algorithm);
-    GPR_ASSERT(success == 0);
-    /* the value of "algorithm" is undefined upon failure */
-  }
-}
-
-static void test_compression_algorithm_name(void) {
-  int success;
-  const char *name;
-  size_t i;
-  const char *valid_names[] = {"identity", "gzip", "deflate"};
-  const grpc_compression_algorithm valid_algorithms[] = {
-      GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE};
-
-  gpr_log(GPR_DEBUG, "test_compression_algorithm_name");
-
-  for (i = 0; i < GPR_ARRAY_SIZE(valid_algorithms); i++) {
-    success = grpc_compression_algorithm_name(valid_algorithms[i], &name);
-    GPR_ASSERT(success != 0);
-    GPR_ASSERT(strcmp(name, valid_names[i]) == 0);
-  }
-
-  success =
-      grpc_compression_algorithm_name(GRPC_COMPRESS_ALGORITHMS_COUNT, &name);
-  GPR_ASSERT(success == 0);
-  /* the value of "name" is undefined upon failure */
-}
-
-static void test_compression_algorithm_for_level(void) {
-  gpr_log(GPR_DEBUG, "test_compression_algorithm_for_level");
-
-  {
-    /* accept only identity (aka none) */
-    uint32_t accepted_encodings = 0;
-    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
-
-    GPR_ASSERT(GRPC_COMPRESS_NONE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_NONE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_NONE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_NONE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
-                                                    accepted_encodings));
-  }
-
-  {
-    /* accept only gzip */
-    uint32_t accepted_encodings = 0;
-    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
-    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP);
-
-    GPR_ASSERT(GRPC_COMPRESS_NONE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_GZIP ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_GZIP ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_GZIP ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
-                                                    accepted_encodings));
-  }
-
-  {
-    /* accept only deflate */
-    uint32_t accepted_encodings = 0;
-    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
-    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE);
-
-    GPR_ASSERT(GRPC_COMPRESS_NONE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
-                                                    accepted_encodings));
-  }
-
-  {
-    /* accept gzip and deflate */
-    uint32_t accepted_encodings = 0;
-    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
-    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP);
-    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE);
-
-    GPR_ASSERT(GRPC_COMPRESS_NONE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_GZIP ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
-                                                    accepted_encodings));
-
-    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
-               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
-                                                    accepted_encodings));
-  }
-}
-
-static void test_compression_enable_disable_algorithm(void) {
-  grpc_compression_options options;
-  grpc_compression_algorithm algorithm;
-
-  gpr_log(GPR_DEBUG, "test_compression_enable_disable_algorithm");
-
-  grpc_compression_options_init(&options);
-  for (algorithm = GRPC_COMPRESS_NONE;
-       algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT; algorithm++) {
-    /* all algorithms are enabled by default */
-    GPR_ASSERT(grpc_compression_options_is_algorithm_enabled(&options,
-                                                             algorithm) != 0);
-  }
-  /* disable one by one */
-  for (algorithm = GRPC_COMPRESS_NONE;
-       algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT; algorithm++) {
-    grpc_compression_options_disable_algorithm(&options, algorithm);
-    GPR_ASSERT(grpc_compression_options_is_algorithm_enabled(&options,
-                                                             algorithm) == 0);
-  }
-  /* re-enable one by one */
-  for (algorithm = GRPC_COMPRESS_NONE;
-       algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT; algorithm++) {
-    grpc_compression_options_enable_algorithm(&options, algorithm);
-    GPR_ASSERT(grpc_compression_options_is_algorithm_enabled(&options,
-                                                             algorithm) != 0);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_init();
-  test_compression_algorithm_parse();
-  test_compression_algorithm_name();
-  test_compression_algorithm_for_level();
-  test_compression_enable_disable_algorithm();
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/compression/compression_test.cc b/test/core/compression/compression_test.cc
new file mode 100644
index 0000000..a1a9441
--- /dev/null
+++ b/test/core/compression/compression_test.cc
@@ -0,0 +1,220 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/compression.h>
+#include <grpc/grpc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/util/test_config.h"
+
+static void test_compression_algorithm_parse(void) {
+  size_t i;
+  const char* valid_names[] = {"identity", "gzip", "deflate"};
+  const grpc_compression_algorithm valid_algorithms[] = {
+      GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE};
+  const char* invalid_names[] = {"gzip2", "foo", "", "2gzip"};
+
+  gpr_log(GPR_DEBUG, "test_compression_algorithm_parse");
+
+  for (i = 0; i < GPR_ARRAY_SIZE(valid_names); i++) {
+    const char* valid_name = valid_names[i];
+    grpc_compression_algorithm algorithm;
+    const int success = grpc_compression_algorithm_parse(
+        grpc_slice_from_static_string(valid_name), &algorithm);
+    GPR_ASSERT(success != 0);
+    GPR_ASSERT(algorithm == valid_algorithms[i]);
+  }
+
+  for (i = 0; i < GPR_ARRAY_SIZE(invalid_names); i++) {
+    const char* invalid_name = invalid_names[i];
+    grpc_compression_algorithm algorithm;
+    int success;
+    success = grpc_compression_algorithm_parse(
+        grpc_slice_from_static_string(invalid_name), &algorithm);
+    GPR_ASSERT(success == 0);
+    /* the value of "algorithm" is undefined upon failure */
+  }
+}
+
+static void test_compression_algorithm_name(void) {
+  int success;
+  const char* name;
+  size_t i;
+  const char* valid_names[] = {"identity", "gzip", "deflate"};
+  const grpc_compression_algorithm valid_algorithms[] = {
+      GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE};
+
+  gpr_log(GPR_DEBUG, "test_compression_algorithm_name");
+
+  for (i = 0; i < GPR_ARRAY_SIZE(valid_algorithms); i++) {
+    success = grpc_compression_algorithm_name(valid_algorithms[i], &name);
+    GPR_ASSERT(success != 0);
+    GPR_ASSERT(strcmp(name, valid_names[i]) == 0);
+  }
+
+  success =
+      grpc_compression_algorithm_name(GRPC_COMPRESS_ALGORITHMS_COUNT, &name);
+  GPR_ASSERT(success == 0);
+  /* the value of "name" is undefined upon failure */
+}
+
+static void test_compression_algorithm_for_level(void) {
+  gpr_log(GPR_DEBUG, "test_compression_algorithm_for_level");
+
+  {
+    /* accept only identity (aka none) */
+    uint32_t accepted_encodings = 0;
+    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
+
+    GPR_ASSERT(GRPC_COMPRESS_NONE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_NONE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_NONE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_NONE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
+                                                    accepted_encodings));
+  }
+
+  {
+    /* accept only gzip */
+    uint32_t accepted_encodings = 0;
+    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
+    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP);
+
+    GPR_ASSERT(GRPC_COMPRESS_NONE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_GZIP ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_GZIP ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_GZIP ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
+                                                    accepted_encodings));
+  }
+
+  {
+    /* accept only deflate */
+    uint32_t accepted_encodings = 0;
+    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
+    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE);
+
+    GPR_ASSERT(GRPC_COMPRESS_NONE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
+                                                    accepted_encodings));
+  }
+
+  {
+    /* accept gzip and deflate */
+    uint32_t accepted_encodings = 0;
+    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */
+    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_GZIP);
+    GPR_BITSET(&accepted_encodings, GRPC_COMPRESS_DEFLATE);
+
+    GPR_ASSERT(GRPC_COMPRESS_NONE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_GZIP ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_LOW,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_MED,
+                                                    accepted_encodings));
+
+    GPR_ASSERT(GRPC_COMPRESS_DEFLATE ==
+               grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_HIGH,
+                                                    accepted_encodings));
+  }
+}
+
+static void test_compression_enable_disable_algorithm(void) {
+  grpc_compression_options options;
+  grpc_compression_algorithm algorithm;
+
+  gpr_log(GPR_DEBUG, "test_compression_enable_disable_algorithm");
+
+  grpc_compression_options_init(&options);
+  for (algorithm = GRPC_COMPRESS_NONE;
+       algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT;
+       algorithm = static_cast<grpc_compression_algorithm>(
+           static_cast<int>(algorithm) + 1)) {
+    /* all algorithms are enabled by default */
+    GPR_ASSERT(grpc_compression_options_is_algorithm_enabled(&options,
+                                                             algorithm) != 0);
+  }
+  /* disable one by one */
+  for (algorithm = GRPC_COMPRESS_NONE;
+       algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT;
+       algorithm = static_cast<grpc_compression_algorithm>(
+           static_cast<int>(algorithm) + 1)) {
+    grpc_compression_options_disable_algorithm(&options, algorithm);
+    GPR_ASSERT(grpc_compression_options_is_algorithm_enabled(&options,
+                                                             algorithm) == 0);
+  }
+  /* re-enable one by one */
+  for (algorithm = GRPC_COMPRESS_NONE;
+       algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT;
+       algorithm = static_cast<grpc_compression_algorithm>(
+           static_cast<int>(algorithm) + 1)) {
+    grpc_compression_options_enable_algorithm(&options, algorithm);
+    GPR_ASSERT(grpc_compression_options_is_algorithm_enabled(&options,
+                                                             algorithm) != 0);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_init();
+  test_compression_algorithm_parse();
+  test_compression_algorithm_name();
+  test_compression_algorithm_for_level();
+  test_compression_enable_disable_algorithm();
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c
deleted file mode 100644
index f7f4893..0000000
--- a/test/core/compression/message_compress_test.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/compression/message_compress.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/support/murmur_hash.h"
-#include "test/core/util/slice_splitter.h"
-#include "test/core/util/test_config.h"
-
-typedef enum { ONE_A = 0, ONE_KB_A, ONE_MB_A, TEST_VALUE_COUNT } test_value;
-
-typedef enum {
-  SHOULD_NOT_COMPRESS,
-  SHOULD_COMPRESS,
-  MAYBE_COMPRESSES
-} compressability;
-
-static void assert_passthrough(grpc_slice value,
-                               grpc_compression_algorithm algorithm,
-                               grpc_slice_split_mode uncompressed_split_mode,
-                               grpc_slice_split_mode compressed_split_mode,
-                               compressability compress_result_check) {
-  grpc_slice_buffer input;
-  grpc_slice_buffer compressed_raw;
-  grpc_slice_buffer compressed;
-  grpc_slice_buffer output;
-  grpc_slice final;
-  int was_compressed;
-  const char *algorithm_name;
-
-  GPR_ASSERT(grpc_compression_algorithm_name(algorithm, &algorithm_name) != 0);
-  gpr_log(
-      GPR_INFO, "assert_passthrough: value_length=%" PRIuPTR
-                " value_hash=0x%08x "
-                "algorithm='%s' uncompressed_split='%s' compressed_split='%s'",
-      GRPC_SLICE_LENGTH(value), gpr_murmur_hash3(GRPC_SLICE_START_PTR(value),
-                                                 GRPC_SLICE_LENGTH(value), 0),
-      algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode),
-      grpc_slice_split_mode_name(compressed_split_mode));
-
-  grpc_slice_buffer_init(&input);
-  grpc_slice_buffer_init(&compressed_raw);
-  grpc_slice_buffer_init(&compressed);
-  grpc_slice_buffer_init(&output);
-
-  grpc_split_slices_to_buffer(uncompressed_split_mode, &value, 1, &input);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    was_compressed =
-        grpc_msg_compress(&exec_ctx, algorithm, &input, &compressed_raw);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  GPR_ASSERT(input.count > 0);
-
-  switch (compress_result_check) {
-    case SHOULD_NOT_COMPRESS:
-      GPR_ASSERT(was_compressed == 0);
-      break;
-    case SHOULD_COMPRESS:
-      GPR_ASSERT(was_compressed == 1);
-      break;
-    case MAYBE_COMPRESSES:
-      /* no check */
-      break;
-  }
-
-  grpc_split_slice_buffer(compressed_split_mode, &compressed_raw, &compressed);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    GPR_ASSERT(grpc_msg_decompress(
-        &exec_ctx, was_compressed ? algorithm : GRPC_COMPRESS_NONE, &compressed,
-        &output));
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  final = grpc_slice_merge(output.slices, output.count);
-  GPR_ASSERT(grpc_slice_eq(value, final));
-
-  grpc_slice_buffer_destroy(&input);
-  grpc_slice_buffer_destroy(&compressed);
-  grpc_slice_buffer_destroy(&compressed_raw);
-  grpc_slice_buffer_destroy(&output);
-  grpc_slice_unref(final);
-}
-
-static grpc_slice repeated(char c, size_t length) {
-  grpc_slice out = grpc_slice_malloc(length);
-  memset(GRPC_SLICE_START_PTR(out), c, length);
-  return out;
-}
-
-static compressability get_compressability(
-    test_value id, grpc_compression_algorithm algorithm) {
-  if (algorithm == GRPC_COMPRESS_NONE) return SHOULD_NOT_COMPRESS;
-  switch (id) {
-    case ONE_A:
-      return SHOULD_NOT_COMPRESS;
-    case ONE_KB_A:
-    case ONE_MB_A:
-      return SHOULD_COMPRESS;
-    case TEST_VALUE_COUNT:
-      abort();
-      break;
-  }
-  return MAYBE_COMPRESSES;
-}
-
-static grpc_slice create_test_value(test_value id) {
-  switch (id) {
-    case ONE_A:
-      return grpc_slice_from_copied_string("a");
-    case ONE_KB_A:
-      return repeated('a', 1024);
-    case ONE_MB_A:
-      return repeated('a', 1024 * 1024);
-    case TEST_VALUE_COUNT:
-      abort();
-      break;
-  }
-  return grpc_slice_from_copied_string("bad value");
-}
-
-static void test_tiny_data_compress(void) {
-  grpc_slice_buffer input;
-  grpc_slice_buffer output;
-  grpc_compression_algorithm i;
-
-  grpc_slice_buffer_init(&input);
-  grpc_slice_buffer_init(&output);
-  grpc_slice_buffer_add(&input, create_test_value(ONE_A));
-
-  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
-    if (i == GRPC_COMPRESS_NONE) continue;
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    GPR_ASSERT(0 == grpc_msg_compress(&exec_ctx, i, &input, &output));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(1 == output.count);
-  }
-
-  grpc_slice_buffer_destroy(&input);
-  grpc_slice_buffer_destroy(&output);
-}
-
-static void test_bad_decompression_data_crc(void) {
-  grpc_slice_buffer input;
-  grpc_slice_buffer corrupted;
-  grpc_slice_buffer output;
-  size_t idx;
-  const uint32_t bad = 0xdeadbeef;
-
-  grpc_slice_buffer_init(&input);
-  grpc_slice_buffer_init(&corrupted);
-  grpc_slice_buffer_init(&output);
-  grpc_slice_buffer_add(&input, create_test_value(ONE_MB_A));
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  /* compress it */
-  grpc_msg_compress(&exec_ctx, GRPC_COMPRESS_GZIP, &input, &corrupted);
-  /* corrupt the output by smashing the CRC */
-  GPR_ASSERT(corrupted.count > 1);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(corrupted.slices[1]) > 8);
-  idx = GRPC_SLICE_LENGTH(corrupted.slices[1]) - 8;
-  memcpy(GRPC_SLICE_START_PTR(corrupted.slices[1]) + idx, &bad, 4);
-
-  /* try (and fail) to decompress the corrupted compresed buffer */
-  GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_COMPRESS_GZIP, &corrupted,
-                                      &output));
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  grpc_slice_buffer_destroy(&input);
-  grpc_slice_buffer_destroy(&corrupted);
-  grpc_slice_buffer_destroy(&output);
-}
-
-static void test_bad_decompression_data_trailing_garbage(void) {
-  grpc_slice_buffer input;
-  grpc_slice_buffer output;
-
-  grpc_slice_buffer_init(&input);
-  grpc_slice_buffer_init(&output);
-  /* append 0x99 to the end of an otherwise valid stream */
-  grpc_slice_buffer_add(
-      &input, grpc_slice_from_copied_buffer(
-                  "\x78\xda\x63\x60\x60\x60\x00\x00\x00\x04\x00\x01\x99", 13));
-
-  /* try (and fail) to decompress the invalid compresed buffer */
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_COMPRESS_DEFLATE, &input,
-                                      &output));
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  grpc_slice_buffer_destroy(&input);
-  grpc_slice_buffer_destroy(&output);
-}
-
-static void test_bad_decompression_data_stream(void) {
-  grpc_slice_buffer input;
-  grpc_slice_buffer output;
-
-  grpc_slice_buffer_init(&input);
-  grpc_slice_buffer_init(&output);
-  grpc_slice_buffer_add(&input,
-                        grpc_slice_from_copied_buffer("\x78\xda\xff\xff", 4));
-
-  /* try (and fail) to decompress the invalid compresed buffer */
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_COMPRESS_DEFLATE, &input,
-                                      &output));
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  grpc_slice_buffer_destroy(&input);
-  grpc_slice_buffer_destroy(&output);
-}
-
-static void test_bad_compression_algorithm(void) {
-  grpc_slice_buffer input;
-  grpc_slice_buffer output;
-  int was_compressed;
-
-  grpc_slice_buffer_init(&input);
-  grpc_slice_buffer_init(&output);
-  grpc_slice_buffer_add(
-      &input, grpc_slice_from_copied_string("Never gonna give you up"));
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  was_compressed = grpc_msg_compress(&exec_ctx, GRPC_COMPRESS_ALGORITHMS_COUNT,
-                                     &input, &output);
-  GPR_ASSERT(0 == was_compressed);
-
-  was_compressed = grpc_msg_compress(
-      &exec_ctx, GRPC_COMPRESS_ALGORITHMS_COUNT + 123, &input, &output);
-  GPR_ASSERT(0 == was_compressed);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  grpc_slice_buffer_destroy(&input);
-  grpc_slice_buffer_destroy(&output);
-}
-
-static void test_bad_decompression_algorithm(void) {
-  grpc_slice_buffer input;
-  grpc_slice_buffer output;
-  int was_decompressed;
-
-  grpc_slice_buffer_init(&input);
-  grpc_slice_buffer_init(&output);
-  grpc_slice_buffer_add(&input,
-                        grpc_slice_from_copied_string(
-                            "I'm not really compressed but it doesn't matter"));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  was_decompressed = grpc_msg_decompress(
-      &exec_ctx, GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output);
-  GPR_ASSERT(0 == was_decompressed);
-
-  was_decompressed = grpc_msg_decompress(
-      &exec_ctx, GRPC_COMPRESS_ALGORITHMS_COUNT + 123, &input, &output);
-  GPR_ASSERT(0 == was_decompressed);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  grpc_slice_buffer_destroy(&input);
-  grpc_slice_buffer_destroy(&output);
-}
-
-int main(int argc, char **argv) {
-  unsigned i, j, k, m;
-  grpc_slice_split_mode uncompressed_split_modes[] = {
-      GRPC_SLICE_SPLIT_IDENTITY, GRPC_SLICE_SPLIT_ONE_BYTE};
-  grpc_slice_split_mode compressed_split_modes[] = {GRPC_SLICE_SPLIT_MERGE_ALL,
-                                                    GRPC_SLICE_SPLIT_IDENTITY,
-                                                    GRPC_SLICE_SPLIT_ONE_BYTE};
-
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
-    for (j = 0; j < GPR_ARRAY_SIZE(uncompressed_split_modes); j++) {
-      for (k = 0; k < GPR_ARRAY_SIZE(compressed_split_modes); k++) {
-        for (m = 0; m < TEST_VALUE_COUNT; m++) {
-          grpc_slice slice = create_test_value(m);
-          assert_passthrough(slice, i, j, k, get_compressability(m, i));
-          grpc_slice_unref(slice);
-        }
-      }
-    }
-  }
-
-  test_tiny_data_compress();
-  test_bad_decompression_data_crc();
-  test_bad_decompression_data_stream();
-  test_bad_decompression_data_trailing_garbage();
-  test_bad_compression_algorithm();
-  test_bad_decompression_algorithm();
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/compression/message_compress_test.cc b/test/core/compression/message_compress_test.cc
new file mode 100644
index 0000000..676415b
--- /dev/null
+++ b/test/core/compression/message_compress_test.cc
@@ -0,0 +1,332 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/compression/message_compress.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/support/murmur_hash.h"
+#include "test/core/util/slice_splitter.h"
+#include "test/core/util/test_config.h"
+
+typedef enum { ONE_A = 0, ONE_KB_A, ONE_MB_A, TEST_VALUE_COUNT } test_value;
+
+typedef enum {
+  SHOULD_NOT_COMPRESS,
+  SHOULD_COMPRESS,
+  MAYBE_COMPRESSES
+} compressability;
+
+static void assert_passthrough(grpc_slice value,
+                               grpc_compression_algorithm algorithm,
+                               grpc_slice_split_mode uncompressed_split_mode,
+                               grpc_slice_split_mode compressed_split_mode,
+                               compressability compress_result_check) {
+  grpc_slice_buffer input;
+  grpc_slice_buffer compressed_raw;
+  grpc_slice_buffer compressed;
+  grpc_slice_buffer output;
+  grpc_slice final;
+  int was_compressed;
+  const char* algorithm_name;
+
+  GPR_ASSERT(grpc_compression_algorithm_name(algorithm, &algorithm_name) != 0);
+  gpr_log(GPR_INFO,
+          "assert_passthrough: value_length=%" PRIuPTR
+          " value_hash=0x%08x "
+          "algorithm='%s' uncompressed_split='%s' compressed_split='%s'",
+          GRPC_SLICE_LENGTH(value),
+          gpr_murmur_hash3(GRPC_SLICE_START_PTR(value),
+                           GRPC_SLICE_LENGTH(value), 0),
+          algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode),
+          grpc_slice_split_mode_name(compressed_split_mode));
+
+  grpc_slice_buffer_init(&input);
+  grpc_slice_buffer_init(&compressed_raw);
+  grpc_slice_buffer_init(&compressed);
+  grpc_slice_buffer_init(&output);
+
+  grpc_split_slices_to_buffer(uncompressed_split_mode, &value, 1, &input);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    was_compressed =
+        grpc_msg_compress(&exec_ctx, algorithm, &input, &compressed_raw);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  GPR_ASSERT(input.count > 0);
+
+  switch (compress_result_check) {
+    case SHOULD_NOT_COMPRESS:
+      GPR_ASSERT(was_compressed == 0);
+      break;
+    case SHOULD_COMPRESS:
+      GPR_ASSERT(was_compressed == 1);
+      break;
+    case MAYBE_COMPRESSES:
+      /* no check */
+      break;
+  }
+
+  grpc_split_slice_buffer(compressed_split_mode, &compressed_raw, &compressed);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    GPR_ASSERT(grpc_msg_decompress(
+        &exec_ctx, was_compressed ? algorithm : GRPC_COMPRESS_NONE, &compressed,
+        &output));
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  final = grpc_slice_merge(output.slices, output.count);
+  GPR_ASSERT(grpc_slice_eq(value, final));
+
+  grpc_slice_buffer_destroy(&input);
+  grpc_slice_buffer_destroy(&compressed);
+  grpc_slice_buffer_destroy(&compressed_raw);
+  grpc_slice_buffer_destroy(&output);
+  grpc_slice_unref(final);
+}
+
+static grpc_slice repeated(char c, size_t length) {
+  grpc_slice out = grpc_slice_malloc(length);
+  memset(GRPC_SLICE_START_PTR(out), c, length);
+  return out;
+}
+
+static compressability get_compressability(
+    test_value id, grpc_compression_algorithm algorithm) {
+  if (algorithm == GRPC_COMPRESS_NONE) return SHOULD_NOT_COMPRESS;
+  switch (id) {
+    case ONE_A:
+      return SHOULD_NOT_COMPRESS;
+    case ONE_KB_A:
+    case ONE_MB_A:
+      return SHOULD_COMPRESS;
+    case TEST_VALUE_COUNT:
+      abort();
+      break;
+  }
+  return MAYBE_COMPRESSES;
+}
+
+static grpc_slice create_test_value(test_value id) {
+  switch (id) {
+    case ONE_A:
+      return grpc_slice_from_copied_string("a");
+    case ONE_KB_A:
+      return repeated('a', 1024);
+    case ONE_MB_A:
+      return repeated('a', 1024 * 1024);
+    case TEST_VALUE_COUNT:
+      abort();
+      break;
+  }
+  return grpc_slice_from_copied_string("bad value");
+}
+
+static void test_tiny_data_compress(void) {
+  grpc_slice_buffer input;
+  grpc_slice_buffer output;
+
+  grpc_slice_buffer_init(&input);
+  grpc_slice_buffer_init(&output);
+  grpc_slice_buffer_add(&input, create_test_value(ONE_A));
+
+  for (int i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
+    if (i == GRPC_COMPRESS_NONE) continue;
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    GPR_ASSERT(0 == grpc_msg_compress(
+                        &exec_ctx, static_cast<grpc_compression_algorithm>(i),
+                        &input, &output));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(1 == output.count);
+  }
+
+  grpc_slice_buffer_destroy(&input);
+  grpc_slice_buffer_destroy(&output);
+}
+
+static void test_bad_decompression_data_crc(void) {
+  grpc_slice_buffer input;
+  grpc_slice_buffer corrupted;
+  grpc_slice_buffer output;
+  size_t idx;
+  const uint32_t bad = 0xdeadbeef;
+
+  grpc_slice_buffer_init(&input);
+  grpc_slice_buffer_init(&corrupted);
+  grpc_slice_buffer_init(&output);
+  grpc_slice_buffer_add(&input, create_test_value(ONE_MB_A));
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  /* compress it */
+  grpc_msg_compress(&exec_ctx, GRPC_COMPRESS_GZIP, &input, &corrupted);
+  /* corrupt the output by smashing the CRC */
+  GPR_ASSERT(corrupted.count > 1);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(corrupted.slices[1]) > 8);
+  idx = GRPC_SLICE_LENGTH(corrupted.slices[1]) - 8;
+  memcpy(GRPC_SLICE_START_PTR(corrupted.slices[1]) + idx, &bad, 4);
+
+  /* try (and fail) to decompress the corrupted compresed buffer */
+  GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_COMPRESS_GZIP, &corrupted,
+                                      &output));
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  grpc_slice_buffer_destroy(&input);
+  grpc_slice_buffer_destroy(&corrupted);
+  grpc_slice_buffer_destroy(&output);
+}
+
+static void test_bad_decompression_data_trailing_garbage(void) {
+  grpc_slice_buffer input;
+  grpc_slice_buffer output;
+
+  grpc_slice_buffer_init(&input);
+  grpc_slice_buffer_init(&output);
+  /* append 0x99 to the end of an otherwise valid stream */
+  grpc_slice_buffer_add(
+      &input, grpc_slice_from_copied_buffer(
+                  "\x78\xda\x63\x60\x60\x60\x00\x00\x00\x04\x00\x01\x99", 13));
+
+  /* try (and fail) to decompress the invalid compresed buffer */
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_COMPRESS_DEFLATE, &input,
+                                      &output));
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  grpc_slice_buffer_destroy(&input);
+  grpc_slice_buffer_destroy(&output);
+}
+
+static void test_bad_decompression_data_stream(void) {
+  grpc_slice_buffer input;
+  grpc_slice_buffer output;
+
+  grpc_slice_buffer_init(&input);
+  grpc_slice_buffer_init(&output);
+  grpc_slice_buffer_add(&input,
+                        grpc_slice_from_copied_buffer("\x78\xda\xff\xff", 4));
+
+  /* try (and fail) to decompress the invalid compresed buffer */
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GPR_ASSERT(0 == grpc_msg_decompress(&exec_ctx, GRPC_COMPRESS_DEFLATE, &input,
+                                      &output));
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  grpc_slice_buffer_destroy(&input);
+  grpc_slice_buffer_destroy(&output);
+}
+
+static void test_bad_compression_algorithm(void) {
+  grpc_slice_buffer input;
+  grpc_slice_buffer output;
+  int was_compressed;
+
+  grpc_slice_buffer_init(&input);
+  grpc_slice_buffer_init(&output);
+  grpc_slice_buffer_add(
+      &input, grpc_slice_from_copied_string("Never gonna give you up"));
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  was_compressed = grpc_msg_compress(&exec_ctx, GRPC_COMPRESS_ALGORITHMS_COUNT,
+                                     &input, &output);
+  GPR_ASSERT(0 == was_compressed);
+
+  was_compressed = grpc_msg_compress(&exec_ctx,
+                                     static_cast<grpc_compression_algorithm>(
+                                         GRPC_COMPRESS_ALGORITHMS_COUNT + 123),
+                                     &input, &output);
+  GPR_ASSERT(0 == was_compressed);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  grpc_slice_buffer_destroy(&input);
+  grpc_slice_buffer_destroy(&output);
+}
+
+static void test_bad_decompression_algorithm(void) {
+  grpc_slice_buffer input;
+  grpc_slice_buffer output;
+  int was_decompressed;
+
+  grpc_slice_buffer_init(&input);
+  grpc_slice_buffer_init(&output);
+  grpc_slice_buffer_add(&input,
+                        grpc_slice_from_copied_string(
+                            "I'm not really compressed but it doesn't matter"));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  was_decompressed = grpc_msg_decompress(
+      &exec_ctx, GRPC_COMPRESS_ALGORITHMS_COUNT, &input, &output);
+  GPR_ASSERT(0 == was_decompressed);
+
+  was_decompressed =
+      grpc_msg_decompress(&exec_ctx,
+                          static_cast<grpc_compression_algorithm>(
+                              GRPC_COMPRESS_ALGORITHMS_COUNT + 123),
+                          &input, &output);
+  GPR_ASSERT(0 == was_decompressed);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  grpc_slice_buffer_destroy(&input);
+  grpc_slice_buffer_destroy(&output);
+}
+
+int main(int argc, char** argv) {
+  unsigned i, j, k, m;
+  grpc_slice_split_mode uncompressed_split_modes[] = {
+      GRPC_SLICE_SPLIT_IDENTITY, GRPC_SLICE_SPLIT_ONE_BYTE};
+  grpc_slice_split_mode compressed_split_modes[] = {GRPC_SLICE_SPLIT_MERGE_ALL,
+                                                    GRPC_SLICE_SPLIT_IDENTITY,
+                                                    GRPC_SLICE_SPLIT_ONE_BYTE};
+
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  for (i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
+    for (j = 0; j < GPR_ARRAY_SIZE(uncompressed_split_modes); j++) {
+      for (k = 0; k < GPR_ARRAY_SIZE(compressed_split_modes); k++) {
+        for (m = 0; m < TEST_VALUE_COUNT; m++) {
+          grpc_slice slice = create_test_value(static_cast<test_value>(m));
+          assert_passthrough(
+              slice, static_cast<grpc_compression_algorithm>(i),
+              static_cast<grpc_slice_split_mode>(j),
+              static_cast<grpc_slice_split_mode>(k),
+              get_compressability(static_cast<test_value>(m),
+                                  static_cast<grpc_compression_algorithm>(i)));
+          grpc_slice_unref(slice);
+        }
+      }
+    }
+  }
+
+  test_tiny_data_compress();
+  test_bad_decompression_data_crc();
+  test_bad_decompression_data_stream();
+  test_bad_decompression_data_trailing_garbage();
+  test_bad_compression_algorithm();
+  test_bad_decompression_algorithm();
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/compression/stream_compression_test.c b/test/core/compression/stream_compression_test.c
deleted file mode 100644
index afed6cd..0000000
--- a/test/core/compression/stream_compression_test.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/slice_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/compression/stream_compression.h"
-
-static void generate_random_payload(char *payload, size_t size) {
-  size_t i;
-  static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
-  for (i = 0; i < size - 1; ++i) {
-    payload[i] = chars[rand() % (int)(sizeof(chars) - 1)];
-  }
-  payload[size - 1] = '\0';
-}
-
-static bool slice_buffer_equals_string(grpc_slice_buffer *buf,
-                                       const char *str) {
-  size_t i;
-  if (buf->length != strlen(str)) {
-    return false;
-  }
-  size_t pointer = 0;
-  for (i = 0; i < buf->count; i++) {
-    size_t slice_len = GRPC_SLICE_LENGTH(buf->slices[i]);
-    if (0 != strncmp(str + pointer,
-                     (char *)GRPC_SLICE_START_PTR(buf->slices[i]), slice_len)) {
-      return false;
-    }
-    pointer += slice_len;
-  }
-  return true;
-}
-
-static void test_stream_compression_simple_compress_decompress() {
-  const char test_str[] = "aaaaaaabbbbbbbccccccctesttesttest";
-  grpc_slice_buffer source, relay, sink;
-  grpc_slice_buffer_init(&source);
-  grpc_slice_buffer_init(&relay);
-  grpc_slice_buffer_init(&sink);
-  grpc_stream_compression_context *compress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
-  grpc_stream_compression_context *decompress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
-  grpc_slice slice = grpc_slice_from_static_string(test_str);
-  grpc_slice_buffer_add(&source, slice);
-  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
-                                  ~(size_t)0,
-                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
-  bool end_of_context;
-  size_t output_size;
-  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
-                                    ~(size_t)0, &end_of_context));
-  GPR_ASSERT(output_size == sizeof(test_str) - 1);
-  grpc_stream_compression_context_destroy(compress_ctx);
-  grpc_stream_compression_context_destroy(decompress_ctx);
-
-  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str));
-
-  grpc_slice_buffer_destroy(&source);
-  grpc_slice_buffer_destroy(&relay);
-  grpc_slice_buffer_destroy(&sink);
-}
-
-static void
-test_stream_compression_simple_compress_decompress_with_output_size_constraint() {
-  const char test_str[] = "aaaaaaabbbbbbbccccccctesttesttest";
-  grpc_slice_buffer source, relay, sink;
-  grpc_slice_buffer_init(&source);
-  grpc_slice_buffer_init(&relay);
-  grpc_slice_buffer_init(&sink);
-  grpc_stream_compression_context *compress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
-  grpc_stream_compression_context *decompress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
-  grpc_slice slice = grpc_slice_from_static_string(test_str);
-  grpc_slice_buffer_add(&source, slice);
-  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
-                                  ~(size_t)0,
-                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
-  grpc_stream_compression_context_destroy(compress_ctx);
-
-  bool end_of_context;
-  size_t output_size;
-  size_t max_output_size = 2;
-  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
-                                    max_output_size, &end_of_context));
-  GPR_ASSERT(output_size == max_output_size);
-  GPR_ASSERT(end_of_context == false);
-  grpc_slice slice_recv = grpc_slice_buffer_take_first(&sink);
-  char *str_recv = (char *)GRPC_SLICE_START_PTR(slice_recv);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_recv) == max_output_size);
-  GPR_ASSERT(0 == strncmp(test_str, str_recv, max_output_size));
-  grpc_slice_unref(slice_recv);
-
-  size_t remaining_size = sizeof(test_str) - 1 - max_output_size;
-  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
-                                    remaining_size, &end_of_context));
-  GPR_ASSERT(output_size == remaining_size);
-  GPR_ASSERT(end_of_context == true);
-
-  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str + max_output_size));
-
-  grpc_stream_compression_context_destroy(decompress_ctx);
-  grpc_slice_buffer_destroy(&source);
-  grpc_slice_buffer_destroy(&relay);
-  grpc_slice_buffer_destroy(&sink);
-}
-
-#define LARGE_DATA_SIZE (1024 * 1024)
-static void
-test_stream_compression_simple_compress_decompress_with_large_data() {
-  char *test_str = gpr_malloc(LARGE_DATA_SIZE * sizeof(char));
-  generate_random_payload(test_str, LARGE_DATA_SIZE);
-  grpc_slice_buffer source, relay, sink;
-  grpc_slice_buffer_init(&source);
-  grpc_slice_buffer_init(&relay);
-  grpc_slice_buffer_init(&sink);
-  grpc_stream_compression_context *compress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
-  grpc_stream_compression_context *decompress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
-  grpc_slice slice = grpc_slice_from_static_string(test_str);
-  grpc_slice_buffer_add(&source, slice);
-  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
-                                  ~(size_t)0,
-                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
-  bool end_of_context;
-  size_t output_size;
-  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
-                                    ~(size_t)0, &end_of_context));
-  GPR_ASSERT(output_size == LARGE_DATA_SIZE - 1);
-  grpc_stream_compression_context_destroy(compress_ctx);
-  grpc_stream_compression_context_destroy(decompress_ctx);
-
-  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str));
-
-  grpc_slice_buffer_destroy(&source);
-  grpc_slice_buffer_destroy(&relay);
-  grpc_slice_buffer_destroy(&sink);
-  gpr_free(test_str);
-}
-
-static void test_stream_compression_drop_context() {
-  const char test_str[] = "aaaaaaabbbbbbbccccccc";
-  const char test_str2[] = "dddddddeeeeeeefffffffggggg";
-  grpc_slice_buffer source, relay, sink;
-  grpc_slice_buffer_init(&source);
-  grpc_slice_buffer_init(&relay);
-  grpc_slice_buffer_init(&sink);
-  grpc_stream_compression_context *compress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
-  grpc_slice slice = grpc_slice_from_static_string(test_str);
-  grpc_slice_buffer_add(&source, slice);
-  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
-                                  ~(size_t)0,
-                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
-  grpc_stream_compression_context_destroy(compress_ctx);
-
-  compress_ctx = grpc_stream_compression_context_create(
-      GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
-  slice = grpc_slice_from_static_string(test_str2);
-  grpc_slice_buffer_add(&source, slice);
-  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
-                                  ~(size_t)0,
-                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
-  grpc_stream_compression_context_destroy(compress_ctx);
-
-  /* Concatenate the two compressed sliced into one to test decompressing two
-   * contexts */
-  grpc_slice slice1 = grpc_slice_buffer_take_first(&relay);
-  grpc_slice slice2 = grpc_slice_buffer_take_first(&relay);
-  grpc_slice slice3 =
-      grpc_slice_malloc(GRPC_SLICE_LENGTH(slice1) + GRPC_SLICE_LENGTH(slice2));
-  memcpy(GRPC_SLICE_START_PTR(slice3), GRPC_SLICE_START_PTR(slice1),
-         GRPC_SLICE_LENGTH(slice1));
-  memcpy(GRPC_SLICE_START_PTR(slice3) + GRPC_SLICE_LENGTH(slice1),
-         GRPC_SLICE_START_PTR(slice2), GRPC_SLICE_LENGTH(slice2));
-  grpc_slice_unref(slice1);
-  grpc_slice_unref(slice2);
-  grpc_slice_buffer_add(&relay, slice3);
-
-  grpc_stream_compression_context *decompress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
-  bool end_of_context;
-  size_t output_size;
-  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
-                                    ~(size_t)0, &end_of_context));
-  GPR_ASSERT(end_of_context == true);
-  GPR_ASSERT(output_size == sizeof(test_str) - 1);
-
-  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str));
-  grpc_stream_compression_context_destroy(decompress_ctx);
-  grpc_slice_buffer_destroy(&sink);
-
-  grpc_slice_buffer_init(&sink);
-  decompress_ctx = grpc_stream_compression_context_create(
-      GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
-  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
-                                    ~(size_t)0, &end_of_context));
-  GPR_ASSERT(end_of_context == true);
-  GPR_ASSERT(output_size == sizeof(test_str2) - 1);
-  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str2));
-  grpc_stream_compression_context_destroy(decompress_ctx);
-
-  grpc_slice_buffer_destroy(&source);
-  grpc_slice_buffer_destroy(&relay);
-  grpc_slice_buffer_destroy(&sink);
-}
-
-static void test_stream_compression_sync_flush() {
-  const char test_str[] = "aaaaaaabbbbbbbccccccc";
-  const char test_str2[] = "dddddddeeeeeeefffffffggggg";
-  grpc_slice_buffer source, relay, sink;
-  grpc_slice_buffer_init(&source);
-  grpc_slice_buffer_init(&relay);
-  grpc_slice_buffer_init(&sink);
-  grpc_stream_compression_context *compress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
-  grpc_slice slice = grpc_slice_from_static_string(test_str);
-  grpc_slice_buffer_add(&source, slice);
-  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
-                                  ~(size_t)0,
-                                  GRPC_STREAM_COMPRESSION_FLUSH_SYNC));
-
-  grpc_stream_compression_context *decompress_ctx =
-      grpc_stream_compression_context_create(
-          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
-  bool end_of_context;
-  size_t output_size;
-  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
-                                    ~(size_t)0, &end_of_context));
-  GPR_ASSERT(end_of_context == false);
-  GPR_ASSERT(output_size == sizeof(test_str) - 1);
-  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str));
-  grpc_slice_buffer_destroy(&sink);
-
-  grpc_slice_buffer_init(&sink);
-  slice = grpc_slice_from_static_string(test_str2);
-  grpc_slice_buffer_add(&source, slice);
-  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
-                                  ~(size_t)0,
-                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
-  grpc_stream_compression_context_destroy(compress_ctx);
-
-  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
-                                    ~(size_t)0, &end_of_context));
-  GPR_ASSERT(end_of_context == true);
-  GPR_ASSERT(output_size == sizeof(test_str2) - 1);
-  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str2));
-  grpc_stream_compression_context_destroy(decompress_ctx);
-
-  grpc_slice_buffer_destroy(&source);
-  grpc_slice_buffer_destroy(&relay);
-  grpc_slice_buffer_destroy(&sink);
-}
-
-int main(int argc, char **argv) {
-  grpc_init();
-  test_stream_compression_simple_compress_decompress();
-  test_stream_compression_simple_compress_decompress_with_output_size_constraint();
-  test_stream_compression_simple_compress_decompress_with_large_data();
-  test_stream_compression_sync_flush();
-  test_stream_compression_drop_context();
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/compression/stream_compression_test.cc b/test/core/compression/stream_compression_test.cc
new file mode 100644
index 0000000..7cb583b
--- /dev/null
+++ b/test/core/compression/stream_compression_test.cc
@@ -0,0 +1,298 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/slice_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/compression/stream_compression.h"
+
+static void generate_random_payload(char* payload, size_t size) {
+  size_t i;
+  static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
+  for (i = 0; i < size - 1; ++i) {
+    payload[i] = chars[rand() % (int)(sizeof(chars) - 1)];
+  }
+  payload[size - 1] = '\0';
+}
+
+static bool slice_buffer_equals_string(grpc_slice_buffer* buf,
+                                       const char* str) {
+  size_t i;
+  if (buf->length != strlen(str)) {
+    return false;
+  }
+  size_t pointer = 0;
+  for (i = 0; i < buf->count; i++) {
+    size_t slice_len = GRPC_SLICE_LENGTH(buf->slices[i]);
+    if (0 != strncmp(str + pointer, (char*)GRPC_SLICE_START_PTR(buf->slices[i]),
+                     slice_len)) {
+      return false;
+    }
+    pointer += slice_len;
+  }
+  return true;
+}
+
+static void test_stream_compression_simple_compress_decompress() {
+  const char test_str[] = "aaaaaaabbbbbbbccccccctesttesttest";
+  grpc_slice_buffer source, relay, sink;
+  grpc_slice_buffer_init(&source);
+  grpc_slice_buffer_init(&relay);
+  grpc_slice_buffer_init(&sink);
+  grpc_stream_compression_context* compress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
+  grpc_stream_compression_context* decompress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
+  grpc_slice slice = grpc_slice_from_static_string(test_str);
+  grpc_slice_buffer_add(&source, slice);
+  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
+                                  ~(size_t)0,
+                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
+  bool end_of_context;
+  size_t output_size;
+  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
+                                    ~(size_t)0, &end_of_context));
+  GPR_ASSERT(output_size == sizeof(test_str) - 1);
+  grpc_stream_compression_context_destroy(compress_ctx);
+  grpc_stream_compression_context_destroy(decompress_ctx);
+
+  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str));
+
+  grpc_slice_buffer_destroy(&source);
+  grpc_slice_buffer_destroy(&relay);
+  grpc_slice_buffer_destroy(&sink);
+}
+
+static void
+test_stream_compression_simple_compress_decompress_with_output_size_constraint() {
+  const char test_str[] = "aaaaaaabbbbbbbccccccctesttesttest";
+  grpc_slice_buffer source, relay, sink;
+  grpc_slice_buffer_init(&source);
+  grpc_slice_buffer_init(&relay);
+  grpc_slice_buffer_init(&sink);
+  grpc_stream_compression_context* compress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
+  grpc_stream_compression_context* decompress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
+  grpc_slice slice = grpc_slice_from_static_string(test_str);
+  grpc_slice_buffer_add(&source, slice);
+  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
+                                  ~(size_t)0,
+                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
+  grpc_stream_compression_context_destroy(compress_ctx);
+
+  bool end_of_context;
+  size_t output_size;
+  size_t max_output_size = 2;
+  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
+                                    max_output_size, &end_of_context));
+  GPR_ASSERT(output_size == max_output_size);
+  GPR_ASSERT(end_of_context == false);
+  grpc_slice slice_recv = grpc_slice_buffer_take_first(&sink);
+  char* str_recv = (char*)GRPC_SLICE_START_PTR(slice_recv);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_recv) == max_output_size);
+  GPR_ASSERT(0 == strncmp(test_str, str_recv, max_output_size));
+  grpc_slice_unref(slice_recv);
+
+  size_t remaining_size = sizeof(test_str) - 1 - max_output_size;
+  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
+                                    remaining_size, &end_of_context));
+  GPR_ASSERT(output_size == remaining_size);
+  GPR_ASSERT(end_of_context == true);
+
+  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str + max_output_size));
+
+  grpc_stream_compression_context_destroy(decompress_ctx);
+  grpc_slice_buffer_destroy(&source);
+  grpc_slice_buffer_destroy(&relay);
+  grpc_slice_buffer_destroy(&sink);
+}
+
+#define LARGE_DATA_SIZE (1024 * 1024)
+static void
+test_stream_compression_simple_compress_decompress_with_large_data() {
+  char* test_str =
+      static_cast<char*>(gpr_malloc(LARGE_DATA_SIZE * sizeof(char)));
+  generate_random_payload(test_str, LARGE_DATA_SIZE);
+  grpc_slice_buffer source, relay, sink;
+  grpc_slice_buffer_init(&source);
+  grpc_slice_buffer_init(&relay);
+  grpc_slice_buffer_init(&sink);
+  grpc_stream_compression_context* compress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
+  grpc_stream_compression_context* decompress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
+  grpc_slice slice = grpc_slice_from_static_string(test_str);
+  grpc_slice_buffer_add(&source, slice);
+  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
+                                  ~(size_t)0,
+                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
+  bool end_of_context;
+  size_t output_size;
+  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
+                                    ~(size_t)0, &end_of_context));
+  GPR_ASSERT(output_size == LARGE_DATA_SIZE - 1);
+  grpc_stream_compression_context_destroy(compress_ctx);
+  grpc_stream_compression_context_destroy(decompress_ctx);
+
+  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str));
+
+  grpc_slice_buffer_destroy(&source);
+  grpc_slice_buffer_destroy(&relay);
+  grpc_slice_buffer_destroy(&sink);
+  gpr_free(test_str);
+}
+
+static void test_stream_compression_drop_context() {
+  const char test_str[] = "aaaaaaabbbbbbbccccccc";
+  const char test_str2[] = "dddddddeeeeeeefffffffggggg";
+  grpc_slice_buffer source, relay, sink;
+  grpc_slice_buffer_init(&source);
+  grpc_slice_buffer_init(&relay);
+  grpc_slice_buffer_init(&sink);
+  grpc_stream_compression_context* compress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
+  grpc_slice slice = grpc_slice_from_static_string(test_str);
+  grpc_slice_buffer_add(&source, slice);
+  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
+                                  ~(size_t)0,
+                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
+  grpc_stream_compression_context_destroy(compress_ctx);
+
+  compress_ctx = grpc_stream_compression_context_create(
+      GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
+  slice = grpc_slice_from_static_string(test_str2);
+  grpc_slice_buffer_add(&source, slice);
+  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
+                                  ~(size_t)0,
+                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
+  grpc_stream_compression_context_destroy(compress_ctx);
+
+  /* Concatenate the two compressed sliced into one to test decompressing two
+   * contexts */
+  grpc_slice slice1 = grpc_slice_buffer_take_first(&relay);
+  grpc_slice slice2 = grpc_slice_buffer_take_first(&relay);
+  grpc_slice slice3 =
+      grpc_slice_malloc(GRPC_SLICE_LENGTH(slice1) + GRPC_SLICE_LENGTH(slice2));
+  memcpy(GRPC_SLICE_START_PTR(slice3), GRPC_SLICE_START_PTR(slice1),
+         GRPC_SLICE_LENGTH(slice1));
+  memcpy(GRPC_SLICE_START_PTR(slice3) + GRPC_SLICE_LENGTH(slice1),
+         GRPC_SLICE_START_PTR(slice2), GRPC_SLICE_LENGTH(slice2));
+  grpc_slice_unref(slice1);
+  grpc_slice_unref(slice2);
+  grpc_slice_buffer_add(&relay, slice3);
+
+  grpc_stream_compression_context* decompress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
+  bool end_of_context;
+  size_t output_size;
+  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
+                                    ~(size_t)0, &end_of_context));
+  GPR_ASSERT(end_of_context == true);
+  GPR_ASSERT(output_size == sizeof(test_str) - 1);
+
+  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str));
+  grpc_stream_compression_context_destroy(decompress_ctx);
+  grpc_slice_buffer_destroy(&sink);
+
+  grpc_slice_buffer_init(&sink);
+  decompress_ctx = grpc_stream_compression_context_create(
+      GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
+  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
+                                    ~(size_t)0, &end_of_context));
+  GPR_ASSERT(end_of_context == true);
+  GPR_ASSERT(output_size == sizeof(test_str2) - 1);
+  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str2));
+  grpc_stream_compression_context_destroy(decompress_ctx);
+
+  grpc_slice_buffer_destroy(&source);
+  grpc_slice_buffer_destroy(&relay);
+  grpc_slice_buffer_destroy(&sink);
+}
+
+static void test_stream_compression_sync_flush() {
+  const char test_str[] = "aaaaaaabbbbbbbccccccc";
+  const char test_str2[] = "dddddddeeeeeeefffffffggggg";
+  grpc_slice_buffer source, relay, sink;
+  grpc_slice_buffer_init(&source);
+  grpc_slice_buffer_init(&relay);
+  grpc_slice_buffer_init(&sink);
+  grpc_stream_compression_context* compress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_COMPRESS);
+  grpc_slice slice = grpc_slice_from_static_string(test_str);
+  grpc_slice_buffer_add(&source, slice);
+  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
+                                  ~(size_t)0,
+                                  GRPC_STREAM_COMPRESSION_FLUSH_SYNC));
+
+  grpc_stream_compression_context* decompress_ctx =
+      grpc_stream_compression_context_create(
+          GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
+  bool end_of_context;
+  size_t output_size;
+  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
+                                    ~(size_t)0, &end_of_context));
+  GPR_ASSERT(end_of_context == false);
+  GPR_ASSERT(output_size == sizeof(test_str) - 1);
+  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str));
+  grpc_slice_buffer_destroy(&sink);
+
+  grpc_slice_buffer_init(&sink);
+  slice = grpc_slice_from_static_string(test_str2);
+  grpc_slice_buffer_add(&source, slice);
+  GPR_ASSERT(grpc_stream_compress(compress_ctx, &source, &relay, NULL,
+                                  ~(size_t)0,
+                                  GRPC_STREAM_COMPRESSION_FLUSH_FINISH));
+  grpc_stream_compression_context_destroy(compress_ctx);
+
+  GPR_ASSERT(grpc_stream_decompress(decompress_ctx, &relay, &sink, &output_size,
+                                    ~(size_t)0, &end_of_context));
+  GPR_ASSERT(end_of_context == true);
+  GPR_ASSERT(output_size == sizeof(test_str2) - 1);
+  GPR_ASSERT(slice_buffer_equals_string(&sink, test_str2));
+  grpc_stream_compression_context_destroy(decompress_ctx);
+
+  grpc_slice_buffer_destroy(&source);
+  grpc_slice_buffer_destroy(&relay);
+  grpc_slice_buffer_destroy(&sink);
+}
+
+int main(int argc, char** argv) {
+  grpc_init();
+  test_stream_compression_simple_compress_decompress();
+  test_stream_compression_simple_compress_decompress_with_output_size_constraint();
+  test_stream_compression_simple_compress_decompress_with_large_data();
+  test_stream_compression_sync_flush();
+  test_stream_compression_drop_context();
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/debug/stats_test.cc b/test/core/debug/stats_test.cc
index 5015819..c4b0d50 100644
--- a/test/core/debug/stats_test.cc
+++ b/test/core/debug/stats_test.cc
@@ -16,9 +16,7 @@
  *
  */
 
-extern "C" {
 #include "src/core/lib/debug/stats.h"
-}
 
 #include <mutex>
 #include <thread>
@@ -112,11 +110,9 @@
   };
   std::vector<int> test_values;
   for (int j = -1000;
-       j <
-       grpc_stats_histo_bucket_boundaries[kHistogram]
-                                         [grpc_stats_histo_buckets[kHistogram] -
-                                          1] +
-           1000;
+       j < grpc_stats_histo_bucket_boundaries
+                   [kHistogram][grpc_stats_histo_buckets[kHistogram] - 1] +
+               1000;
        j++) {
     int expected_bucket = FindExpectedBucket(kHistogram, j);
     if (cur_bucket != expected_bucket) {
diff --git a/test/core/end2end/BUILD b/test/core/end2end/BUILD
index 49bfc43..f8281bf 100644
--- a/test/core/end2end/BUILD
+++ b/test/core/end2end/BUILD
@@ -22,9 +22,9 @@
 
 grpc_cc_library(
     name = "cq_verifier",
-    srcs = ["cq_verifier.c"],
+    srcs = ["cq_verifier.cc"],
     hdrs = ["cq_verifier.h"],
-    language = "C",
+    language = "C++",
     visibility = ["//test:__subpackages__"],
     deps = [
         "//:gpr",
@@ -36,22 +36,22 @@
 grpc_cc_library(
     name = "ssl_test_data",
     srcs = [
-        "data/client_certs.c",
-        "data/server1_cert.c",
-        "data/server1_key.c",
-        "data/test_root_cert.c",
+        "data/client_certs.cc",
+        "data/server1_cert.cc",
+        "data/server1_key.cc",
+        "data/test_root_cert.cc",
     ],
     hdrs = ["data/ssl_test_data.h"],
-    language = "C",
+    language = "C++",
     visibility = ["//test:__subpackages__"],
 )
 
 
 grpc_cc_library(
     name = "http_proxy",
-    srcs = ["fixtures/http_proxy_fixture.c"],
+    srcs = ["fixtures/http_proxy_fixture.cc"],
     hdrs = ["fixtures/http_proxy_fixture.h"],
-    language = "C",
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -61,9 +61,9 @@
 
 grpc_cc_library(
     name = "proxy",
-    srcs = ["fixtures/proxy.c"],
+    srcs = ["fixtures/proxy.cc"],
     hdrs = ["fixtures/proxy.h"],
-    language = "C",
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/end2end/bad_server_response_test.c b/test/core/end2end/bad_server_response_test.c
deleted file mode 100644
index 2070fa5..0000000
--- a/test/core/end2end/bad_server_response_test.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
-   using that endpoint. Because of various transitive includes in uv.h,
-   including windows.h on Windows, uv.h must be included before other system
-   headers. Therefore, sockaddr.h must always be included first */
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-#include "test/core/util/test_tcp_server.h"
-
-#define HTTP1_RESP                           \
-  "HTTP/1.0 400 Bad Request\n"               \
-  "Content-Type: text/html; charset=UTF-8\n" \
-  "Content-Length: 0\n"                      \
-  "Date: Tue, 07 Jun 2016 17:43:20 GMT\n\n"
-
-#define HTTP2_RESP(STATUS_CODE)          \
-  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" \
-  "\x00\x00>\x01\x04\x00\x00\x00\x01"    \
-  "\x10\x0e"                             \
-  "content-length\x01"                   \
-  "0"                                    \
-  "\x10\x0c"                             \
-  "content-type\x10"                     \
-  "application/grpc"                     \
-  "\x10\x07:status\x03" #STATUS_CODE
-
-#define UNPARSEABLE_RESP "Bad Request\n"
-
-#define HTTP2_DETAIL_MSG(STATUS_CODE) \
-  "Received http2 header with status: " #STATUS_CODE
-
-#define HTTP1_DETAIL_MSG "Trying to connect an http1.x server"
-
-/* TODO(zyc) Check the content of incomming data instead of using this length */
-/* The 'bad' server will start sending responses after reading this amount of
- * data from the client. */
-#define SERVER_INCOMING_DATA_LENGTH_LOWER_THRESHOLD (size_t)200
-
-struct rpc_state {
-  char *target;
-  grpc_completion_queue *cq;
-  grpc_channel *channel;
-  grpc_call *call;
-  size_t incoming_data_length;
-  grpc_slice_buffer temp_incoming_buffer;
-  grpc_slice_buffer outgoing_buffer;
-  grpc_endpoint *tcp;
-  gpr_atm done_atm;
-  bool write_done;
-  const char *response_payload;
-  size_t response_payload_length;
-};
-
-static int server_port;
-static struct rpc_state state;
-static grpc_closure on_read;
-static grpc_closure on_write;
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void done_write(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-
-  gpr_atm_rel_store(&state.done_atm, 1);
-}
-
-static void handle_write(grpc_exec_ctx *exec_ctx) {
-  grpc_slice slice = grpc_slice_from_copied_buffer(
-      state.response_payload, state.response_payload_length);
-
-  grpc_slice_buffer_reset_and_unref(&state.outgoing_buffer);
-  grpc_slice_buffer_add(&state.outgoing_buffer, slice);
-  grpc_endpoint_write(exec_ctx, state.tcp, &state.outgoing_buffer, &on_write);
-}
-
-static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  state.incoming_data_length += state.temp_incoming_buffer.length;
-
-  size_t i;
-  for (i = 0; i < state.temp_incoming_buffer.count; i++) {
-    char *dump = grpc_dump_slice(state.temp_incoming_buffer.slices[i],
-                                 GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    gpr_log(GPR_DEBUG, "Server received: %s", dump);
-    gpr_free(dump);
-  }
-
-  gpr_log(GPR_DEBUG, "got %" PRIuPTR " bytes, expected %" PRIuPTR " bytes",
-          state.incoming_data_length,
-          SERVER_INCOMING_DATA_LENGTH_LOWER_THRESHOLD);
-  if (state.incoming_data_length >=
-      SERVER_INCOMING_DATA_LENGTH_LOWER_THRESHOLD) {
-    handle_write(exec_ctx);
-  } else {
-    grpc_endpoint_read(exec_ctx, state.tcp, &state.temp_incoming_buffer,
-                       &on_read);
-  }
-}
-
-static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp,
-                       grpc_pollset *accepting_pollset,
-                       grpc_tcp_server_acceptor *acceptor) {
-  gpr_free(acceptor);
-  test_tcp_server *server = (test_tcp_server *)arg;
-  GRPC_CLOSURE_INIT(&on_read, handle_read, NULL, grpc_schedule_on_exec_ctx);
-  GRPC_CLOSURE_INIT(&on_write, done_write, NULL, grpc_schedule_on_exec_ctx);
-  grpc_slice_buffer_init(&state.temp_incoming_buffer);
-  grpc_slice_buffer_init(&state.outgoing_buffer);
-  state.tcp = tcp;
-  state.incoming_data_length = 0;
-  grpc_endpoint_add_to_pollset(exec_ctx, tcp, server->pollset);
-  grpc_endpoint_read(exec_ctx, tcp, &state.temp_incoming_buffer, &on_read);
-}
-
-static gpr_timespec n_sec_deadline(int seconds) {
-  return gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                      gpr_time_from_seconds(seconds, GPR_TIMESPAN));
-}
-
-static void start_rpc(int target_port, grpc_status_code expected_status,
-                      const char *expected_detail) {
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_status_code status;
-  grpc_call_error error;
-  cq_verifier *cqv;
-  grpc_slice details;
-
-  state.cq = grpc_completion_queue_create_for_next(NULL);
-  cqv = cq_verifier_create(state.cq);
-  gpr_join_host_port(&state.target, "127.0.0.1", target_port);
-  state.channel = grpc_insecure_channel_create(state.target, NULL, NULL);
-  grpc_slice host = grpc_slice_from_static_string("localhost");
-  state.call = grpc_channel_create_call(
-      state.channel, NULL, GRPC_PROPAGATE_DEFAULTS, state.cq,
-      grpc_slice_from_static_string("/Service/Method"), &host,
-      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error =
-      grpc_call_start_batch(state.call, ops, (size_t)(op - ops), tag(1), NULL);
-
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == expected_status);
-  if (expected_detail != NULL) {
-    GPR_ASSERT(-1 != grpc_slice_slice(details, grpc_slice_from_static_string(
-                                                   expected_detail)));
-  }
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_slice_unref(details);
-  cq_verifier_destroy(cqv);
-}
-
-static void cleanup_rpc(grpc_exec_ctx *exec_ctx) {
-  grpc_event ev;
-  grpc_slice_buffer_destroy_internal(exec_ctx, &state.temp_incoming_buffer);
-  grpc_slice_buffer_destroy_internal(exec_ctx, &state.outgoing_buffer);
-  grpc_call_unref(state.call);
-  grpc_completion_queue_shutdown(state.cq);
-  do {
-    ev = grpc_completion_queue_next(state.cq, n_sec_deadline(1), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-  grpc_completion_queue_destroy(state.cq);
-  grpc_channel_destroy(state.channel);
-  gpr_free(state.target);
-}
-
-typedef struct {
-  test_tcp_server *server;
-  gpr_event *signal_when_done;
-} poll_args;
-
-static void actually_poll_server(void *arg) {
-  poll_args *pa = (poll_args *)arg;
-  gpr_timespec deadline = n_sec_deadline(10);
-  while (true) {
-    bool done = gpr_atm_acq_load(&state.done_atm) != 0;
-    gpr_timespec time_left =
-        gpr_time_sub(deadline, gpr_now(GPR_CLOCK_REALTIME));
-    gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRId64 ".%09d", done,
-            time_left.tv_sec, time_left.tv_nsec);
-    if (done || gpr_time_cmp(time_left, gpr_time_0(GPR_TIMESPAN)) < 0) {
-      break;
-    }
-    test_tcp_server_poll(pa->server, 1);
-  }
-  gpr_event_set(pa->signal_when_done, (void *)1);
-  gpr_free(pa);
-}
-
-static void poll_server_until_read_done(test_tcp_server *server,
-                                        gpr_event *signal_when_done) {
-  gpr_atm_rel_store(&state.done_atm, 0);
-  state.write_done = 0;
-  gpr_thd_id id;
-  poll_args *pa = (poll_args *)gpr_malloc(sizeof(*pa));
-  pa->server = server;
-  pa->signal_when_done = signal_when_done;
-  gpr_thd_new(&id, actually_poll_server, pa, NULL);
-}
-
-static void run_test(const char *response_payload,
-                     size_t response_payload_length,
-                     grpc_status_code expected_status,
-                     const char *expected_detail) {
-  test_tcp_server test_server;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  gpr_event ev;
-
-  grpc_init();
-  gpr_event_init(&ev);
-  server_port = grpc_pick_unused_port_or_die();
-  test_tcp_server_init(&test_server, on_connect, &test_server);
-  test_tcp_server_start(&test_server, server_port);
-  state.response_payload = response_payload;
-  state.response_payload_length = response_payload_length;
-
-  /* poll server until sending out the response */
-  poll_server_until_read_done(&test_server, &ev);
-  start_rpc(server_port, expected_status, expected_detail);
-  gpr_event_wait(&ev, gpr_inf_future(GPR_CLOCK_REALTIME));
-
-  /* clean up */
-  grpc_endpoint_shutdown(&exec_ctx, state.tcp,
-                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
-  grpc_endpoint_destroy(&exec_ctx, state.tcp);
-  cleanup_rpc(&exec_ctx);
-  grpc_exec_ctx_finish(&exec_ctx);
-  test_tcp_server_destroy(&test_server);
-
-  grpc_shutdown();
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  /* status defined in hpack static table */
-  run_test(HTTP2_RESP(204), sizeof(HTTP2_RESP(204)) - 1, GRPC_STATUS_CANCELLED,
-           HTTP2_DETAIL_MSG(204));
-
-  run_test(HTTP2_RESP(206), sizeof(HTTP2_RESP(206)) - 1, GRPC_STATUS_CANCELLED,
-           HTTP2_DETAIL_MSG(206));
-
-  run_test(HTTP2_RESP(304), sizeof(HTTP2_RESP(304)) - 1, GRPC_STATUS_CANCELLED,
-           HTTP2_DETAIL_MSG(304));
-
-  run_test(HTTP2_RESP(400), sizeof(HTTP2_RESP(400)) - 1, GRPC_STATUS_CANCELLED,
-           HTTP2_DETAIL_MSG(400));
-
-  run_test(HTTP2_RESP(404), sizeof(HTTP2_RESP(404)) - 1, GRPC_STATUS_CANCELLED,
-           HTTP2_DETAIL_MSG(404));
-
-  run_test(HTTP2_RESP(500), sizeof(HTTP2_RESP(500)) - 1, GRPC_STATUS_CANCELLED,
-           HTTP2_DETAIL_MSG(500));
-
-  /* status not defined in hpack static table */
-  run_test(HTTP2_RESP(401), sizeof(HTTP2_RESP(401)) - 1, GRPC_STATUS_CANCELLED,
-           HTTP2_DETAIL_MSG(401));
-
-  run_test(HTTP2_RESP(403), sizeof(HTTP2_RESP(403)) - 1, GRPC_STATUS_CANCELLED,
-           HTTP2_DETAIL_MSG(403));
-
-  run_test(HTTP2_RESP(502), sizeof(HTTP2_RESP(502)) - 1, GRPC_STATUS_CANCELLED,
-           HTTP2_DETAIL_MSG(502));
-
-  /* unparseable response */
-  run_test(UNPARSEABLE_RESP, sizeof(UNPARSEABLE_RESP) - 1, GRPC_STATUS_UNKNOWN,
-           NULL);
-
-  /* http1 response */
-  run_test(HTTP1_RESP, sizeof(HTTP1_RESP) - 1, GRPC_STATUS_UNAVAILABLE,
-           HTTP1_DETAIL_MSG);
-
-  return 0;
-}
diff --git a/test/core/end2end/bad_server_response_test.cc b/test/core/end2end/bad_server_response_test.cc
new file mode 100644
index 0000000..ea7857d
--- /dev/null
+++ b/test/core/end2end/bad_server_response_test.cc
@@ -0,0 +1,341 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
+   using that endpoint. Because of various transitive includes in uv.h,
+   including windows.h on Windows, uv.h must be included before other system
+   headers. Therefore, sockaddr.h must always be included first */
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+#include "test/core/util/test_tcp_server.h"
+
+#define HTTP1_RESP                           \
+  "HTTP/1.0 400 Bad Request\n"               \
+  "Content-Type: text/html; charset=UTF-8\n" \
+  "Content-Length: 0\n"                      \
+  "Date: Tue, 07 Jun 2016 17:43:20 GMT\n\n"
+
+#define HTTP2_RESP(STATUS_CODE)          \
+  "\x00\x00\x00\x04\x00\x00\x00\x00\x00" \
+  "\x00\x00>\x01\x04\x00\x00\x00\x01"    \
+  "\x10\x0e"                             \
+  "content-length\x01"                   \
+  "0"                                    \
+  "\x10\x0c"                             \
+  "content-type\x10"                     \
+  "application/grpc"                     \
+  "\x10\x07:status\x03" #STATUS_CODE
+
+#define UNPARSEABLE_RESP "Bad Request\n"
+
+#define HTTP2_DETAIL_MSG(STATUS_CODE) \
+  "Received http2 header with status: " #STATUS_CODE
+
+#define HTTP1_DETAIL_MSG "Trying to connect an http1.x server"
+
+/* TODO(zyc) Check the content of incomming data instead of using this length */
+/* The 'bad' server will start sending responses after reading this amount of
+ * data from the client. */
+#define SERVER_INCOMING_DATA_LENGTH_LOWER_THRESHOLD (size_t)200
+
+struct rpc_state {
+  char* target;
+  grpc_completion_queue* cq;
+  grpc_channel* channel;
+  grpc_call* call;
+  size_t incoming_data_length;
+  grpc_slice_buffer temp_incoming_buffer;
+  grpc_slice_buffer outgoing_buffer;
+  grpc_endpoint* tcp;
+  gpr_atm done_atm;
+  bool write_done;
+  const char* response_payload;
+  size_t response_payload_length;
+};
+
+static int server_port;
+static struct rpc_state state;
+static grpc_closure on_read;
+static grpc_closure on_write;
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void done_write(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+
+  gpr_atm_rel_store(&state.done_atm, 1);
+}
+
+static void handle_write(grpc_exec_ctx* exec_ctx) {
+  grpc_slice slice = grpc_slice_from_copied_buffer(
+      state.response_payload, state.response_payload_length);
+
+  grpc_slice_buffer_reset_and_unref(&state.outgoing_buffer);
+  grpc_slice_buffer_add(&state.outgoing_buffer, slice);
+  grpc_endpoint_write(exec_ctx, state.tcp, &state.outgoing_buffer, &on_write);
+}
+
+static void handle_read(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  state.incoming_data_length += state.temp_incoming_buffer.length;
+
+  size_t i;
+  for (i = 0; i < state.temp_incoming_buffer.count; i++) {
+    char* dump = grpc_dump_slice(state.temp_incoming_buffer.slices[i],
+                                 GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    gpr_log(GPR_DEBUG, "Server received: %s", dump);
+    gpr_free(dump);
+  }
+
+  gpr_log(GPR_DEBUG, "got %" PRIuPTR " bytes, expected %" PRIuPTR " bytes",
+          state.incoming_data_length,
+          SERVER_INCOMING_DATA_LENGTH_LOWER_THRESHOLD);
+  if (state.incoming_data_length >=
+      SERVER_INCOMING_DATA_LENGTH_LOWER_THRESHOLD) {
+    handle_write(exec_ctx);
+  } else {
+    grpc_endpoint_read(exec_ctx, state.tcp, &state.temp_incoming_buffer,
+                       &on_read);
+  }
+}
+
+static void on_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* tcp,
+                       grpc_pollset* accepting_pollset,
+                       grpc_tcp_server_acceptor* acceptor) {
+  gpr_free(acceptor);
+  test_tcp_server* server = (test_tcp_server*)arg;
+  GRPC_CLOSURE_INIT(&on_read, handle_read, NULL, grpc_schedule_on_exec_ctx);
+  GRPC_CLOSURE_INIT(&on_write, done_write, NULL, grpc_schedule_on_exec_ctx);
+  grpc_slice_buffer_init(&state.temp_incoming_buffer);
+  grpc_slice_buffer_init(&state.outgoing_buffer);
+  state.tcp = tcp;
+  state.incoming_data_length = 0;
+  grpc_endpoint_add_to_pollset(exec_ctx, tcp, server->pollset);
+  grpc_endpoint_read(exec_ctx, tcp, &state.temp_incoming_buffer, &on_read);
+}
+
+static gpr_timespec n_sec_deadline(int seconds) {
+  return gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                      gpr_time_from_seconds(seconds, GPR_TIMESPAN));
+}
+
+static void start_rpc(int target_port, grpc_status_code expected_status,
+                      const char* expected_detail) {
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_status_code status;
+  grpc_call_error error;
+  cq_verifier* cqv;
+  grpc_slice details;
+
+  state.cq = grpc_completion_queue_create_for_next(NULL);
+  cqv = cq_verifier_create(state.cq);
+  gpr_join_host_port(&state.target, "127.0.0.1", target_port);
+  state.channel = grpc_insecure_channel_create(state.target, NULL, NULL);
+  grpc_slice host = grpc_slice_from_static_string("localhost");
+  state.call = grpc_channel_create_call(
+      state.channel, NULL, GRPC_PROPAGATE_DEFAULTS, state.cq,
+      grpc_slice_from_static_string("/Service/Method"), &host,
+      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error =
+      grpc_call_start_batch(state.call, ops, (size_t)(op - ops), tag(1), NULL);
+
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == expected_status);
+  if (expected_detail != NULL) {
+    GPR_ASSERT(-1 != grpc_slice_slice(details, grpc_slice_from_static_string(
+                                                   expected_detail)));
+  }
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_slice_unref(details);
+  cq_verifier_destroy(cqv);
+}
+
+static void cleanup_rpc(grpc_exec_ctx* exec_ctx) {
+  grpc_event ev;
+  grpc_slice_buffer_destroy_internal(exec_ctx, &state.temp_incoming_buffer);
+  grpc_slice_buffer_destroy_internal(exec_ctx, &state.outgoing_buffer);
+  grpc_call_unref(state.call);
+  grpc_completion_queue_shutdown(state.cq);
+  do {
+    ev = grpc_completion_queue_next(state.cq, n_sec_deadline(1), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+  grpc_completion_queue_destroy(state.cq);
+  grpc_channel_destroy(state.channel);
+  gpr_free(state.target);
+}
+
+typedef struct {
+  test_tcp_server* server;
+  gpr_event* signal_when_done;
+} poll_args;
+
+static void actually_poll_server(void* arg) {
+  poll_args* pa = (poll_args*)arg;
+  gpr_timespec deadline = n_sec_deadline(10);
+  while (true) {
+    bool done = gpr_atm_acq_load(&state.done_atm) != 0;
+    gpr_timespec time_left =
+        gpr_time_sub(deadline, gpr_now(GPR_CLOCK_REALTIME));
+    gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRId64 ".%09d", done,
+            time_left.tv_sec, time_left.tv_nsec);
+    if (done || gpr_time_cmp(time_left, gpr_time_0(GPR_TIMESPAN)) < 0) {
+      break;
+    }
+    test_tcp_server_poll(pa->server, 1);
+  }
+  gpr_event_set(pa->signal_when_done, (void*)1);
+  gpr_free(pa);
+}
+
+static void poll_server_until_read_done(test_tcp_server* server,
+                                        gpr_event* signal_when_done) {
+  gpr_atm_rel_store(&state.done_atm, 0);
+  state.write_done = 0;
+  gpr_thd_id id;
+  poll_args* pa = (poll_args*)gpr_malloc(sizeof(*pa));
+  pa->server = server;
+  pa->signal_when_done = signal_when_done;
+  gpr_thd_new(&id, actually_poll_server, pa, NULL);
+}
+
+static void run_test(const char* response_payload,
+                     size_t response_payload_length,
+                     grpc_status_code expected_status,
+                     const char* expected_detail) {
+  test_tcp_server test_server;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  gpr_event ev;
+
+  grpc_init();
+  gpr_event_init(&ev);
+  server_port = grpc_pick_unused_port_or_die();
+  test_tcp_server_init(&test_server, on_connect, &test_server);
+  test_tcp_server_start(&test_server, server_port);
+  state.response_payload = response_payload;
+  state.response_payload_length = response_payload_length;
+
+  /* poll server until sending out the response */
+  poll_server_until_read_done(&test_server, &ev);
+  start_rpc(server_port, expected_status, expected_detail);
+  gpr_event_wait(&ev, gpr_inf_future(GPR_CLOCK_REALTIME));
+
+  /* clean up */
+  grpc_endpoint_shutdown(&exec_ctx, state.tcp,
+                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
+  grpc_endpoint_destroy(&exec_ctx, state.tcp);
+  cleanup_rpc(&exec_ctx);
+  grpc_exec_ctx_finish(&exec_ctx);
+  test_tcp_server_destroy(&test_server);
+
+  grpc_shutdown();
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  /* status defined in hpack static table */
+  run_test(HTTP2_RESP(204), sizeof(HTTP2_RESP(204)) - 1, GRPC_STATUS_CANCELLED,
+           HTTP2_DETAIL_MSG(204));
+
+  run_test(HTTP2_RESP(206), sizeof(HTTP2_RESP(206)) - 1, GRPC_STATUS_CANCELLED,
+           HTTP2_DETAIL_MSG(206));
+
+  run_test(HTTP2_RESP(304), sizeof(HTTP2_RESP(304)) - 1, GRPC_STATUS_CANCELLED,
+           HTTP2_DETAIL_MSG(304));
+
+  run_test(HTTP2_RESP(400), sizeof(HTTP2_RESP(400)) - 1, GRPC_STATUS_CANCELLED,
+           HTTP2_DETAIL_MSG(400));
+
+  run_test(HTTP2_RESP(404), sizeof(HTTP2_RESP(404)) - 1, GRPC_STATUS_CANCELLED,
+           HTTP2_DETAIL_MSG(404));
+
+  run_test(HTTP2_RESP(500), sizeof(HTTP2_RESP(500)) - 1, GRPC_STATUS_CANCELLED,
+           HTTP2_DETAIL_MSG(500));
+
+  /* status not defined in hpack static table */
+  run_test(HTTP2_RESP(401), sizeof(HTTP2_RESP(401)) - 1, GRPC_STATUS_CANCELLED,
+           HTTP2_DETAIL_MSG(401));
+
+  run_test(HTTP2_RESP(403), sizeof(HTTP2_RESP(403)) - 1, GRPC_STATUS_CANCELLED,
+           HTTP2_DETAIL_MSG(403));
+
+  run_test(HTTP2_RESP(502), sizeof(HTTP2_RESP(502)) - 1, GRPC_STATUS_CANCELLED,
+           HTTP2_DETAIL_MSG(502));
+
+  /* unparseable response */
+  run_test(UNPARSEABLE_RESP, sizeof(UNPARSEABLE_RESP) - 1, GRPC_STATUS_UNKNOWN,
+           NULL);
+
+  /* http1 response */
+  run_test(HTTP1_RESP, sizeof(HTTP1_RESP) - 1, GRPC_STATUS_UNAVAILABLE,
+           HTTP1_DETAIL_MSG);
+
+  return 0;
+}
diff --git a/test/core/end2end/connection_refused_test.c b/test/core/end2end/connection_refused_test.c
deleted file mode 100644
index 40227de..0000000
--- a/test/core/end2end/connection_refused_test.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/service_config.h"
-
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static void *tag(intptr_t i) { return (void *)i; }
-
-static void run_test(bool wait_for_ready, bool use_service_config) {
-  grpc_channel *chan;
-  grpc_call *call;
-  grpc_completion_queue *cq;
-  cq_verifier *cqv;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_status_code status;
-  grpc_slice details;
-
-  gpr_log(GPR_INFO, "TEST: wait_for_ready=%d use_service_config=%d",
-          wait_for_ready, use_service_config);
-
-  grpc_init();
-
-  grpc_metadata_array_init(&trailing_metadata_recv);
-
-  cq = grpc_completion_queue_create_for_next(NULL);
-  cqv = cq_verifier_create(cq);
-
-  /* if using service config, create channel args */
-  grpc_channel_args *args = NULL;
-  if (use_service_config) {
-    GPR_ASSERT(wait_for_ready);
-    grpc_arg arg;
-    arg.type = GRPC_ARG_STRING;
-    arg.key = GRPC_ARG_SERVICE_CONFIG;
-    arg.value.string =
-        "{\n"
-        "  \"methodConfig\": [ {\n"
-        "    \"name\": [\n"
-        "      { \"service\": \"service\", \"method\": \"method\" }\n"
-        "    ],\n"
-        "    \"waitForReady\": true\n"
-        "  } ]\n"
-        "}";
-    args = grpc_channel_args_copy_and_add(args, &arg, 1);
-  }
-
-  /* create a call, channel to a port which will refuse connection */
-  int port = grpc_pick_unused_port_or_die();
-  char *addr;
-  gpr_join_host_port(&addr, "127.0.0.1", port);
-  gpr_log(GPR_INFO, "server: %s", addr);
-  chan = grpc_insecure_channel_create(addr, args, NULL);
-  grpc_slice host = grpc_slice_from_static_string("nonexistant");
-  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(2);
-  call = grpc_channel_create_call(
-      chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-      grpc_slice_from_static_string("/service/method"), &host, deadline, NULL);
-
-  gpr_free(addr);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = (wait_for_ready && !use_service_config)
-                  ? GRPC_INITIAL_METADATA_WAIT_FOR_READY
-                  : 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(
-                                 call, ops, (size_t)(op - ops), tag(1), NULL));
-  /* verify that all tags get completed */
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  if (wait_for_ready) {
-    GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED);
-  } else {
-    GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
-  }
-
-  grpc_completion_queue_shutdown(cq);
-  while (
-      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
-          .type != GRPC_QUEUE_SHUTDOWN)
-    ;
-  grpc_completion_queue_destroy(cq);
-  grpc_call_unref(call);
-  grpc_channel_destroy(chan);
-  cq_verifier_destroy(cqv);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    if (args != NULL) grpc_channel_args_destroy(&exec_ctx, args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  grpc_shutdown();
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  run_test(false /* wait_for_ready */, false /* use_service_config */);
-  run_test(true /* wait_for_ready */, false /* use_service_config */);
-  run_test(true /* wait_for_ready */, true /* use_service_config */);
-  return 0;
-}
diff --git a/test/core/end2end/connection_refused_test.cc b/test/core/end2end/connection_refused_test.cc
new file mode 100644
index 0000000..cea06ae
--- /dev/null
+++ b/test/core/end2end/connection_refused_test.cc
@@ -0,0 +1,148 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/metadata.h"
+#include "src/core/lib/transport/service_config.h"
+
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static void* tag(intptr_t i) { return (void*)i; }
+
+static void run_test(bool wait_for_ready, bool use_service_config) {
+  grpc_channel* chan;
+  grpc_call* call;
+  grpc_completion_queue* cq;
+  cq_verifier* cqv;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_status_code status;
+  grpc_slice details;
+
+  gpr_log(GPR_INFO, "TEST: wait_for_ready=%d use_service_config=%d",
+          wait_for_ready, use_service_config);
+
+  grpc_init();
+
+  grpc_metadata_array_init(&trailing_metadata_recv);
+
+  cq = grpc_completion_queue_create_for_next(NULL);
+  cqv = cq_verifier_create(cq);
+
+  /* if using service config, create channel args */
+  grpc_channel_args* args = NULL;
+  if (use_service_config) {
+    GPR_ASSERT(wait_for_ready);
+    grpc_arg arg;
+    arg.type = GRPC_ARG_STRING;
+    arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG);
+    arg.value.string = const_cast<char*>(
+        "{\n"
+        "  \"methodConfig\": [ {\n"
+        "    \"name\": [\n"
+        "      { \"service\": \"service\", \"method\": \"method\" }\n"
+        "    ],\n"
+        "    \"waitForReady\": true\n"
+        "  } ]\n"
+        "}");
+    args = grpc_channel_args_copy_and_add(args, &arg, 1);
+  }
+
+  /* create a call, channel to a port which will refuse connection */
+  int port = grpc_pick_unused_port_or_die();
+  char* addr;
+  gpr_join_host_port(&addr, "127.0.0.1", port);
+  gpr_log(GPR_INFO, "server: %s", addr);
+  chan = grpc_insecure_channel_create(addr, args, NULL);
+  grpc_slice host = grpc_slice_from_static_string("nonexistant");
+  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(2);
+  call = grpc_channel_create_call(
+      chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+      grpc_slice_from_static_string("/service/method"), &host, deadline, NULL);
+
+  gpr_free(addr);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = (wait_for_ready && !use_service_config)
+                  ? GRPC_INITIAL_METADATA_WAIT_FOR_READY
+                  : 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(
+                                 call, ops, (size_t)(op - ops), tag(1), NULL));
+  /* verify that all tags get completed */
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  if (wait_for_ready) {
+    GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED);
+  } else {
+    GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
+  }
+
+  grpc_completion_queue_shutdown(cq);
+  while (
+      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
+          .type != GRPC_QUEUE_SHUTDOWN)
+    ;
+  grpc_completion_queue_destroy(cq);
+  grpc_call_unref(call);
+  grpc_channel_destroy(chan);
+  cq_verifier_destroy(cqv);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    if (args != NULL) grpc_channel_args_destroy(&exec_ctx, args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  grpc_shutdown();
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  run_test(false /* wait_for_ready */, false /* use_service_config */);
+  run_test(true /* wait_for_ready */, false /* use_service_config */);
+  run_test(true /* wait_for_ready */, true /* use_service_config */);
+  return 0;
+}
diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c
deleted file mode 100644
index bb97892..0000000
--- a/test/core/end2end/cq_verifier.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/cq_verifier.h"
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/byte_buffer_reader.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/surface/event_string.h"
-
-#define ROOT_EXPECTATION 1000
-
-/* a set of metadata we expect to find on an event */
-typedef struct metadata {
-  size_t count;
-  size_t cap;
-  char **keys;
-  char **values;
-} metadata;
-
-/* details what we expect to find on a single event - and forms a linked
-   list to detail other expectations */
-typedef struct expectation {
-  struct expectation *next;
-  const char *file;
-  int line;
-  grpc_completion_type type;
-  void *tag;
-  int success;
-} expectation;
-
-/* the verifier itself */
-struct cq_verifier {
-  /* bound completion queue */
-  grpc_completion_queue *cq;
-  /* start of expectation list */
-  expectation *first_expectation;
-};
-
-cq_verifier *cq_verifier_create(grpc_completion_queue *cq) {
-  cq_verifier *v = (cq_verifier *)gpr_malloc(sizeof(cq_verifier));
-  v->cq = cq;
-  v->first_expectation = NULL;
-  return v;
-}
-
-void cq_verifier_destroy(cq_verifier *v) {
-  cq_verify(v);
-  gpr_free(v);
-}
-
-static int has_metadata(const grpc_metadata *md, size_t count, const char *key,
-                        const char *value) {
-  size_t i;
-  for (i = 0; i < count; i++) {
-    if (0 == grpc_slice_str_cmp(md[i].key, key) &&
-        0 == grpc_slice_str_cmp(md[i].value, value)) {
-      return 1;
-    }
-  }
-  return 0;
-}
-
-int contains_metadata(grpc_metadata_array *array, const char *key,
-                      const char *value) {
-  return has_metadata(array->metadata, array->count, key, value);
-}
-
-static int has_metadata_slices(const grpc_metadata *md, size_t count,
-                               grpc_slice key, grpc_slice value) {
-  size_t i;
-  for (i = 0; i < count; i++) {
-    if (grpc_slice_eq(md[i].key, key) && grpc_slice_eq(md[i].value, value)) {
-      return 1;
-    }
-  }
-  return 0;
-}
-
-int contains_metadata_slices(grpc_metadata_array *array, grpc_slice key,
-                             grpc_slice value) {
-  return has_metadata_slices(array->metadata, array->count, key, value);
-}
-
-static grpc_slice merge_slices(grpc_slice *slices, size_t nslices) {
-  size_t i;
-  size_t len = 0;
-  uint8_t *cursor;
-  grpc_slice out;
-
-  for (i = 0; i < nslices; i++) {
-    len += GRPC_SLICE_LENGTH(slices[i]);
-  }
-
-  out = grpc_slice_malloc(len);
-  cursor = GRPC_SLICE_START_PTR(out);
-
-  for (i = 0; i < nslices; i++) {
-    memcpy(cursor, GRPC_SLICE_START_PTR(slices[i]),
-           GRPC_SLICE_LENGTH(slices[i]));
-    cursor += GRPC_SLICE_LENGTH(slices[i]);
-  }
-
-  return out;
-}
-
-int raw_byte_buffer_eq_slice(grpc_byte_buffer *rbb, grpc_slice b) {
-  grpc_slice a;
-  int ok;
-
-  if (!rbb) return 0;
-
-  a = merge_slices(rbb->data.raw.slice_buffer.slices,
-                   rbb->data.raw.slice_buffer.count);
-  ok = GRPC_SLICE_LENGTH(a) == GRPC_SLICE_LENGTH(b) &&
-       0 == memcmp(GRPC_SLICE_START_PTR(a), GRPC_SLICE_START_PTR(b),
-                   GRPC_SLICE_LENGTH(a));
-  grpc_slice_unref(a);
-  grpc_slice_unref(b);
-  return ok;
-}
-
-int byte_buffer_eq_slice(grpc_byte_buffer *bb, grpc_slice b) {
-  grpc_byte_buffer_reader reader;
-  grpc_byte_buffer *rbb;
-  int res;
-
-  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, bb) &&
-             "Couldn't init byte buffer reader");
-  rbb = grpc_raw_byte_buffer_from_reader(&reader);
-  res = raw_byte_buffer_eq_slice(rbb, b);
-  grpc_byte_buffer_reader_destroy(&reader);
-  grpc_byte_buffer_destroy(rbb);
-
-  return res;
-}
-
-int byte_buffer_eq_string(grpc_byte_buffer *bb, const char *str) {
-  grpc_byte_buffer_reader reader;
-  grpc_byte_buffer *rbb;
-  int res;
-
-  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, bb) &&
-             "Couldn't init byte buffer reader");
-  rbb = grpc_raw_byte_buffer_from_reader(&reader);
-  res = raw_byte_buffer_eq_slice(rbb, grpc_slice_from_copied_string(str));
-  grpc_byte_buffer_reader_destroy(&reader);
-  grpc_byte_buffer_destroy(rbb);
-
-  return res;
-}
-
-static bool is_probably_integer(void *p) { return ((uintptr_t)p) < 1000000; }
-
-static void expectation_to_strvec(gpr_strvec *buf, expectation *e) {
-  char *tmp;
-
-  if (is_probably_integer(e->tag)) {
-    gpr_asprintf(&tmp, "tag(%" PRIdPTR ") ", (intptr_t)e->tag);
-  } else {
-    gpr_asprintf(&tmp, "%p ", e->tag);
-  }
-  gpr_strvec_add(buf, tmp);
-
-  switch (e->type) {
-    case GRPC_OP_COMPLETE:
-      gpr_asprintf(&tmp, "GRPC_OP_COMPLETE success=%d %s:%d", e->success,
-                   e->file, e->line);
-      gpr_strvec_add(buf, tmp);
-      break;
-    case GRPC_QUEUE_TIMEOUT:
-    case GRPC_QUEUE_SHUTDOWN:
-      gpr_log(GPR_ERROR, "not implemented");
-      abort();
-      break;
-  }
-}
-
-static void expectations_to_strvec(gpr_strvec *buf, cq_verifier *v) {
-  expectation *e;
-
-  for (e = v->first_expectation; e != NULL; e = e->next) {
-    expectation_to_strvec(buf, e);
-    gpr_strvec_add(buf, gpr_strdup("\n"));
-  }
-}
-
-static void fail_no_event_received(cq_verifier *v) {
-  gpr_strvec buf;
-  char *msg;
-  gpr_strvec_init(&buf);
-  gpr_strvec_add(&buf, gpr_strdup("no event received, but expected:\n"));
-  expectations_to_strvec(&buf, v);
-  msg = gpr_strvec_flatten(&buf, NULL);
-  gpr_log(GPR_ERROR, "%s", msg);
-  gpr_strvec_destroy(&buf);
-  gpr_free(msg);
-  abort();
-}
-
-static void verify_matches(expectation *e, grpc_event *ev) {
-  GPR_ASSERT(e->type == ev->type);
-  switch (e->type) {
-    case GRPC_OP_COMPLETE:
-      if (e->success != ev->success) {
-        gpr_strvec expected;
-        gpr_strvec_init(&expected);
-        expectation_to_strvec(&expected, e);
-        char *s = gpr_strvec_flatten(&expected, NULL);
-        gpr_strvec_destroy(&expected);
-        gpr_log(GPR_ERROR, "actual success does not match expected: %s", s);
-        gpr_free(s);
-        abort();
-      }
-      break;
-    case GRPC_QUEUE_SHUTDOWN:
-      gpr_log(GPR_ERROR, "premature queue shutdown");
-      abort();
-      break;
-    case GRPC_QUEUE_TIMEOUT:
-      gpr_log(GPR_ERROR, "not implemented");
-      abort();
-      break;
-  }
-}
-
-void cq_verify(cq_verifier *v) {
-  const gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10);
-  while (v->first_expectation != NULL) {
-    grpc_event ev = grpc_completion_queue_next(v->cq, deadline, NULL);
-    if (ev.type == GRPC_QUEUE_TIMEOUT) {
-      fail_no_event_received(v);
-      break;
-    }
-    expectation *e;
-    expectation *prev = NULL;
-    for (e = v->first_expectation; e != NULL; e = e->next) {
-      if (e->tag == ev.tag) {
-        verify_matches(e, &ev);
-        if (e == v->first_expectation) v->first_expectation = e->next;
-        if (prev != NULL) prev->next = e->next;
-        gpr_free(e);
-        break;
-      }
-      prev = e;
-    }
-    if (e == NULL) {
-      char *s = grpc_event_string(&ev);
-      gpr_log(GPR_ERROR, "cq returned unexpected event: %s", s);
-      gpr_free(s);
-      gpr_strvec expectations;
-      gpr_strvec_init(&expectations);
-      expectations_to_strvec(&expectations, v);
-      s = gpr_strvec_flatten(&expectations, NULL);
-      gpr_strvec_destroy(&expectations);
-      gpr_log(GPR_ERROR, "expected tags:\n%s", s);
-      gpr_free(s);
-      abort();
-    }
-  }
-}
-
-void cq_verify_empty_timeout(cq_verifier *v, int timeout_sec) {
-  gpr_timespec deadline =
-      gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                   gpr_time_from_seconds(timeout_sec, GPR_TIMESPAN));
-  grpc_event ev;
-
-  GPR_ASSERT(v->first_expectation == NULL && "expectation queue must be empty");
-
-  ev = grpc_completion_queue_next(v->cq, deadline, NULL);
-  if (ev.type != GRPC_QUEUE_TIMEOUT) {
-    char *s = grpc_event_string(&ev);
-    gpr_log(GPR_ERROR, "unexpected event (expected nothing): %s", s);
-    gpr_free(s);
-    abort();
-  }
-}
-
-void cq_verify_empty(cq_verifier *v) { cq_verify_empty_timeout(v, 1); }
-
-static void add(cq_verifier *v, const char *file, int line,
-                grpc_completion_type type, void *tag, bool success) {
-  expectation *e = (expectation *)gpr_malloc(sizeof(expectation));
-  e->type = type;
-  e->file = file;
-  e->line = line;
-  e->tag = tag;
-  e->success = success;
-  e->next = v->first_expectation;
-  v->first_expectation = e;
-}
-
-void cq_expect_completion(cq_verifier *v, const char *file, int line, void *tag,
-                          bool success) {
-  add(v, file, line, GRPC_OP_COMPLETE, tag, success);
-}
diff --git a/test/core/end2end/cq_verifier.cc b/test/core/end2end/cq_verifier.cc
new file mode 100644
index 0000000..fd5193f
--- /dev/null
+++ b/test/core/end2end/cq_verifier.cc
@@ -0,0 +1,321 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/cq_verifier.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/surface/event_string.h"
+
+#define ROOT_EXPECTATION 1000
+
+/* a set of metadata we expect to find on an event */
+typedef struct metadata {
+  size_t count;
+  size_t cap;
+  char** keys;
+  char** values;
+} metadata;
+
+/* details what we expect to find on a single event - and forms a linked
+   list to detail other expectations */
+typedef struct expectation {
+  struct expectation* next;
+  const char* file;
+  int line;
+  grpc_completion_type type;
+  void* tag;
+  int success;
+} expectation;
+
+/* the verifier itself */
+struct cq_verifier {
+  /* bound completion queue */
+  grpc_completion_queue* cq;
+  /* start of expectation list */
+  expectation* first_expectation;
+};
+
+cq_verifier* cq_verifier_create(grpc_completion_queue* cq) {
+  cq_verifier* v = (cq_verifier*)gpr_malloc(sizeof(cq_verifier));
+  v->cq = cq;
+  v->first_expectation = NULL;
+  return v;
+}
+
+void cq_verifier_destroy(cq_verifier* v) {
+  cq_verify(v);
+  gpr_free(v);
+}
+
+static int has_metadata(const grpc_metadata* md, size_t count, const char* key,
+                        const char* value) {
+  size_t i;
+  for (i = 0; i < count; i++) {
+    if (0 == grpc_slice_str_cmp(md[i].key, key) &&
+        0 == grpc_slice_str_cmp(md[i].value, value)) {
+      return 1;
+    }
+  }
+  return 0;
+}
+
+int contains_metadata(grpc_metadata_array* array, const char* key,
+                      const char* value) {
+  return has_metadata(array->metadata, array->count, key, value);
+}
+
+static int has_metadata_slices(const grpc_metadata* md, size_t count,
+                               grpc_slice key, grpc_slice value) {
+  size_t i;
+  for (i = 0; i < count; i++) {
+    if (grpc_slice_eq(md[i].key, key) && grpc_slice_eq(md[i].value, value)) {
+      return 1;
+    }
+  }
+  return 0;
+}
+
+int contains_metadata_slices(grpc_metadata_array* array, grpc_slice key,
+                             grpc_slice value) {
+  return has_metadata_slices(array->metadata, array->count, key, value);
+}
+
+static grpc_slice merge_slices(grpc_slice* slices, size_t nslices) {
+  size_t i;
+  size_t len = 0;
+  uint8_t* cursor;
+  grpc_slice out;
+
+  for (i = 0; i < nslices; i++) {
+    len += GRPC_SLICE_LENGTH(slices[i]);
+  }
+
+  out = grpc_slice_malloc(len);
+  cursor = GRPC_SLICE_START_PTR(out);
+
+  for (i = 0; i < nslices; i++) {
+    memcpy(cursor, GRPC_SLICE_START_PTR(slices[i]),
+           GRPC_SLICE_LENGTH(slices[i]));
+    cursor += GRPC_SLICE_LENGTH(slices[i]);
+  }
+
+  return out;
+}
+
+int raw_byte_buffer_eq_slice(grpc_byte_buffer* rbb, grpc_slice b) {
+  grpc_slice a;
+  int ok;
+
+  if (!rbb) return 0;
+
+  a = merge_slices(rbb->data.raw.slice_buffer.slices,
+                   rbb->data.raw.slice_buffer.count);
+  ok = GRPC_SLICE_LENGTH(a) == GRPC_SLICE_LENGTH(b) &&
+       0 == memcmp(GRPC_SLICE_START_PTR(a), GRPC_SLICE_START_PTR(b),
+                   GRPC_SLICE_LENGTH(a));
+  grpc_slice_unref(a);
+  grpc_slice_unref(b);
+  return ok;
+}
+
+int byte_buffer_eq_slice(grpc_byte_buffer* bb, grpc_slice b) {
+  grpc_byte_buffer_reader reader;
+  grpc_byte_buffer* rbb;
+  int res;
+
+  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, bb) &&
+             "Couldn't init byte buffer reader");
+  rbb = grpc_raw_byte_buffer_from_reader(&reader);
+  res = raw_byte_buffer_eq_slice(rbb, b);
+  grpc_byte_buffer_reader_destroy(&reader);
+  grpc_byte_buffer_destroy(rbb);
+
+  return res;
+}
+
+int byte_buffer_eq_string(grpc_byte_buffer* bb, const char* str) {
+  grpc_byte_buffer_reader reader;
+  grpc_byte_buffer* rbb;
+  int res;
+
+  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, bb) &&
+             "Couldn't init byte buffer reader");
+  rbb = grpc_raw_byte_buffer_from_reader(&reader);
+  res = raw_byte_buffer_eq_slice(rbb, grpc_slice_from_copied_string(str));
+  grpc_byte_buffer_reader_destroy(&reader);
+  grpc_byte_buffer_destroy(rbb);
+
+  return res;
+}
+
+static bool is_probably_integer(void* p) { return ((uintptr_t)p) < 1000000; }
+
+static void expectation_to_strvec(gpr_strvec* buf, expectation* e) {
+  char* tmp;
+
+  if (is_probably_integer(e->tag)) {
+    gpr_asprintf(&tmp, "tag(%" PRIdPTR ") ", (intptr_t)e->tag);
+  } else {
+    gpr_asprintf(&tmp, "%p ", e->tag);
+  }
+  gpr_strvec_add(buf, tmp);
+
+  switch (e->type) {
+    case GRPC_OP_COMPLETE:
+      gpr_asprintf(&tmp, "GRPC_OP_COMPLETE success=%d %s:%d", e->success,
+                   e->file, e->line);
+      gpr_strvec_add(buf, tmp);
+      break;
+    case GRPC_QUEUE_TIMEOUT:
+    case GRPC_QUEUE_SHUTDOWN:
+      gpr_log(GPR_ERROR, "not implemented");
+      abort();
+      break;
+  }
+}
+
+static void expectations_to_strvec(gpr_strvec* buf, cq_verifier* v) {
+  expectation* e;
+
+  for (e = v->first_expectation; e != NULL; e = e->next) {
+    expectation_to_strvec(buf, e);
+    gpr_strvec_add(buf, gpr_strdup("\n"));
+  }
+}
+
+static void fail_no_event_received(cq_verifier* v) {
+  gpr_strvec buf;
+  char* msg;
+  gpr_strvec_init(&buf);
+  gpr_strvec_add(&buf, gpr_strdup("no event received, but expected:\n"));
+  expectations_to_strvec(&buf, v);
+  msg = gpr_strvec_flatten(&buf, NULL);
+  gpr_log(GPR_ERROR, "%s", msg);
+  gpr_strvec_destroy(&buf);
+  gpr_free(msg);
+  abort();
+}
+
+static void verify_matches(expectation* e, grpc_event* ev) {
+  GPR_ASSERT(e->type == ev->type);
+  switch (e->type) {
+    case GRPC_OP_COMPLETE:
+      if (e->success != ev->success) {
+        gpr_strvec expected;
+        gpr_strvec_init(&expected);
+        expectation_to_strvec(&expected, e);
+        char* s = gpr_strvec_flatten(&expected, NULL);
+        gpr_strvec_destroy(&expected);
+        gpr_log(GPR_ERROR, "actual success does not match expected: %s", s);
+        gpr_free(s);
+        abort();
+      }
+      break;
+    case GRPC_QUEUE_SHUTDOWN:
+      gpr_log(GPR_ERROR, "premature queue shutdown");
+      abort();
+      break;
+    case GRPC_QUEUE_TIMEOUT:
+      gpr_log(GPR_ERROR, "not implemented");
+      abort();
+      break;
+  }
+}
+
+void cq_verify(cq_verifier* v) {
+  const gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10);
+  while (v->first_expectation != NULL) {
+    grpc_event ev = grpc_completion_queue_next(v->cq, deadline, NULL);
+    if (ev.type == GRPC_QUEUE_TIMEOUT) {
+      fail_no_event_received(v);
+      break;
+    }
+    expectation* e;
+    expectation* prev = NULL;
+    for (e = v->first_expectation; e != NULL; e = e->next) {
+      if (e->tag == ev.tag) {
+        verify_matches(e, &ev);
+        if (e == v->first_expectation) v->first_expectation = e->next;
+        if (prev != NULL) prev->next = e->next;
+        gpr_free(e);
+        break;
+      }
+      prev = e;
+    }
+    if (e == NULL) {
+      char* s = grpc_event_string(&ev);
+      gpr_log(GPR_ERROR, "cq returned unexpected event: %s", s);
+      gpr_free(s);
+      gpr_strvec expectations;
+      gpr_strvec_init(&expectations);
+      expectations_to_strvec(&expectations, v);
+      s = gpr_strvec_flatten(&expectations, NULL);
+      gpr_strvec_destroy(&expectations);
+      gpr_log(GPR_ERROR, "expected tags:\n%s", s);
+      gpr_free(s);
+      abort();
+    }
+  }
+}
+
+void cq_verify_empty_timeout(cq_verifier* v, int timeout_sec) {
+  gpr_timespec deadline =
+      gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                   gpr_time_from_seconds(timeout_sec, GPR_TIMESPAN));
+  grpc_event ev;
+
+  GPR_ASSERT(v->first_expectation == NULL && "expectation queue must be empty");
+
+  ev = grpc_completion_queue_next(v->cq, deadline, NULL);
+  if (ev.type != GRPC_QUEUE_TIMEOUT) {
+    char* s = grpc_event_string(&ev);
+    gpr_log(GPR_ERROR, "unexpected event (expected nothing): %s", s);
+    gpr_free(s);
+    abort();
+  }
+}
+
+void cq_verify_empty(cq_verifier* v) { cq_verify_empty_timeout(v, 1); }
+
+static void add(cq_verifier* v, const char* file, int line,
+                grpc_completion_type type, void* tag, bool success) {
+  expectation* e = (expectation*)gpr_malloc(sizeof(expectation));
+  e->type = type;
+  e->file = file;
+  e->line = line;
+  e->tag = tag;
+  e->success = success;
+  e->next = v->first_expectation;
+  v->first_expectation = e;
+}
+
+void cq_expect_completion(cq_verifier* v, const char* file, int line, void* tag,
+                          bool success) {
+  add(v, file, line, GRPC_OP_COMPLETE, tag, success);
+}
diff --git a/test/core/end2end/cq_verifier.h b/test/core/end2end/cq_verifier.h
index cc80b58..0b3b3fb 100644
--- a/test/core/end2end/cq_verifier.h
+++ b/test/core/end2end/cq_verifier.h
@@ -24,39 +24,47 @@
 #include <grpc/grpc.h>
 #include "test/core/util/test_config.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* A cq_verifier can verify that expected events arrive in a timely fashion
    on a single completion queue */
 
 typedef struct cq_verifier cq_verifier;
 
 /* construct/destroy a cq_verifier */
-cq_verifier *cq_verifier_create(grpc_completion_queue *cq);
-void cq_verifier_destroy(cq_verifier *v);
+cq_verifier* cq_verifier_create(grpc_completion_queue* cq);
+void cq_verifier_destroy(cq_verifier* v);
 
 /* ensure all expected events (and only those events) are present on the
    bound completion queue */
-void cq_verify(cq_verifier *v);
+void cq_verify(cq_verifier* v);
 
 /* ensure that the completion queue is empty */
-void cq_verify_empty(cq_verifier *v);
+void cq_verify_empty(cq_verifier* v);
 
 /* ensure that the completion queue is empty, waiting up to \a timeout secs. */
-void cq_verify_empty_timeout(cq_verifier *v, int timeout_sec);
+void cq_verify_empty_timeout(cq_verifier* v, int timeout_sec);
 
 /* Various expectation matchers
    Any functions taking ... expect a NULL terminated list of key/value pairs
    (each pair using two parameter slots) of metadata that MUST be present in
    the event. */
-void cq_expect_completion(cq_verifier *v, const char *file, int line, void *tag,
+void cq_expect_completion(cq_verifier* v, const char* file, int line, void* tag,
                           bool success);
 #define CQ_EXPECT_COMPLETION(v, tag, success) \
   cq_expect_completion(v, __FILE__, __LINE__, tag, success)
 
-int byte_buffer_eq_slice(grpc_byte_buffer *bb, grpc_slice b);
-int byte_buffer_eq_string(grpc_byte_buffer *byte_buffer, const char *string);
-int contains_metadata(grpc_metadata_array *array, const char *key,
-                      const char *value);
-int contains_metadata_slices(grpc_metadata_array *array, grpc_slice key,
+int byte_buffer_eq_slice(grpc_byte_buffer* bb, grpc_slice b);
+int byte_buffer_eq_string(grpc_byte_buffer* byte_buffer, const char* string);
+int contains_metadata(grpc_metadata_array* array, const char* key,
+                      const char* value);
+int contains_metadata_slices(grpc_metadata_array* array, grpc_slice key,
                              grpc_slice value);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GRPC_TEST_CORE_END2END_CQ_VERIFIER_H */
diff --git a/test/core/end2end/cq_verifier_internal.h b/test/core/end2end/cq_verifier_internal.h
index 0aa8dc6..0629e0e 100644
--- a/test/core/end2end/cq_verifier_internal.h
+++ b/test/core/end2end/cq_verifier_internal.h
@@ -23,10 +23,10 @@
 
 typedef struct expectation expectation;
 
-expectation *cq_verifier_get_first_expectation(cq_verifier *v);
+expectation* cq_verifier_get_first_expectation(cq_verifier* v);
 
-void cq_verifier_set_first_expectation(cq_verifier *v, expectation *e);
+void cq_verifier_set_first_expectation(cq_verifier* v, expectation* e);
 
-grpc_event cq_verifier_next_event(cq_verifier *v, int timeout_seconds);
+grpc_event cq_verifier_next_event(cq_verifier* v, int timeout_seconds);
 
 #endif /* GRPC_TEST_CORE_END2END_CQ_VERIFIER_INTERNAL_H */
diff --git a/test/core/end2end/cq_verifier_native.c b/test/core/end2end/cq_verifier_native.c
deleted file mode 100644
index f19b15c..0000000
--- a/test/core/end2end/cq_verifier_native.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* This check is for testing only. */
-#ifndef GRPC_UV
-
-#include "test/core/end2end/cq_verifier_internal.h"
-
-/* the verifier itself */
-struct cq_verifier {
-  /* bound completion queue */
-  grpc_completion_queue *cq;
-  /* start of expectation list */
-  expectation *first_expectation;
-  uv_timer_t timer;
-};
-
-cq_verifier *cq_verifier_create(grpc_completion_queue *cq) {
-  cq_verifier *v = gpr_malloc(sizeof(cq_verifier));
-  v->cq = cq;
-  cq_verifier_set_first_expectation(v, NULL);
-  return v;
-}
-
-void cq_verifier_destroy(cq_verifier *v) {
-  cq_verify(v);
-  gpr_free(v);
-}
-
-expectation *cq_verifier_get_first_expectation(cq_verifier *v) {
-  return v->first_expectation;
-}
-
-void cq_verifier_set_first_expectation(cq_verifier *v, expectation *e) {
-  v->first_expectation = e;
-}
-
-grpc_event cq_verifier_next_event(cq_verifier *v, int timeout_seconds) {
-  const gpr_timespec deadline =
-      grpc_timeout_seconds_to_deadline(timeout_seconds);
-  return grpc_completion_queue_next(v->cq, deadline, NULL);
-}
-
-#endif /* GRPC_UV */
diff --git a/test/core/end2end/cq_verifier_native.cc b/test/core/end2end/cq_verifier_native.cc
new file mode 100644
index 0000000..a0a7c83
--- /dev/null
+++ b/test/core/end2end/cq_verifier_native.cc
@@ -0,0 +1,59 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* This check is for testing only. */
+#ifndef GRPC_UV
+
+#include "test/core/end2end/cq_verifier_internal.h"
+
+/* the verifier itself */
+struct cq_verifier {
+  /* bound completion queue */
+  grpc_completion_queue* cq;
+  /* start of expectation list */
+  expectation* first_expectation;
+  uv_timer_t timer;
+};
+
+cq_verifier* cq_verifier_create(grpc_completion_queue* cq) {
+  cq_verifier* v = static_cast<cq_verifier*>(gpr_malloc(sizeof(cq_verifier)));
+  v->cq = cq;
+  cq_verifier_set_first_expectation(v, NULL);
+  return v;
+}
+
+void cq_verifier_destroy(cq_verifier* v) {
+  cq_verify(v);
+  gpr_free(v);
+}
+
+expectation* cq_verifier_get_first_expectation(cq_verifier* v) {
+  return v->first_expectation;
+}
+
+void cq_verifier_set_first_expectation(cq_verifier* v, expectation* e) {
+  v->first_expectation = e;
+}
+
+grpc_event cq_verifier_next_event(cq_verifier* v, int timeout_seconds) {
+  const gpr_timespec deadline =
+      grpc_timeout_seconds_to_deadline(timeout_seconds);
+  return grpc_completion_queue_next(v->cq, deadline, NULL);
+}
+
+#endif /* GRPC_UV */
diff --git a/test/core/end2end/cq_verifier_uv.c b/test/core/end2end/cq_verifier_uv.c
deleted file mode 100644
index fc873b7..0000000
--- a/test/core/end2end/cq_verifier_uv.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#ifdef GRPC_UV
-
-#include <uv.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "test/core/end2end/cq_verifier_internal.h"
-
-typedef enum timer_state {
-  TIMER_STARTED,
-  TIMER_TRIGGERED,
-  TIMER_CLOSED
-} timer_state;
-
-/* the verifier itself */
-struct cq_verifier {
-  /* bound completion queue */
-  grpc_completion_queue *cq;
-  /* start of expectation list */
-  expectation *first_expectation;
-  uv_timer_t timer;
-};
-
-cq_verifier *cq_verifier_create(grpc_completion_queue *cq) {
-  cq_verifier *v = gpr_malloc(sizeof(cq_verifier));
-  v->cq = cq;
-  v->first_expectation = NULL;
-  uv_timer_init(uv_default_loop(), &v->timer);
-  v->timer.data = (void *)TIMER_STARTED;
-  return v;
-}
-
-static void timer_close_cb(uv_handle_t *handle) {
-  handle->data = (void *)TIMER_CLOSED;
-}
-
-void cq_verifier_destroy(cq_verifier *v) {
-  cq_verify(v);
-  uv_close((uv_handle_t *)&v->timer, timer_close_cb);
-  while ((timer_state)v->timer.data != TIMER_CLOSED) {
-    uv_run(uv_default_loop(), UV_RUN_NOWAIT);
-  }
-  gpr_free(v);
-}
-
-expectation *cq_verifier_get_first_expectation(cq_verifier *v) {
-  return v->first_expectation;
-}
-
-void cq_verifier_set_first_expectation(cq_verifier *v, expectation *e) {
-  v->first_expectation = e;
-}
-
-static void timer_run_cb(uv_timer_t *timer) {
-  timer->data = (void *)TIMER_TRIGGERED;
-}
-
-grpc_event cq_verifier_next_event(cq_verifier *v, int timeout_seconds) {
-  uint64_t timeout_ms =
-      timeout_seconds < 0 ? 0 : (uint64_t)timeout_seconds * 1000;
-  grpc_event ev;
-  v->timer.data = (void *)TIMER_STARTED;
-  uv_timer_start(&v->timer, timer_run_cb, timeout_ms, 0);
-  ev = grpc_completion_queue_next(v->cq, gpr_inf_past(GPR_CLOCK_MONOTONIC),
-                                  NULL);
-  // Stop the loop if the timer goes off or we get a non-timeout event
-  while (((timer_state)v->timer.data != TIMER_TRIGGERED) &&
-         ev.type == GRPC_QUEUE_TIMEOUT) {
-    uv_run(uv_default_loop(), UV_RUN_ONCE);
-    ev = grpc_completion_queue_next(v->cq, gpr_inf_past(GPR_CLOCK_MONOTONIC),
-                                    NULL);
-  }
-  return ev;
-}
-
-#endif /* GRPC_UV */
diff --git a/test/core/end2end/cq_verifier_uv.cc b/test/core/end2end/cq_verifier_uv.cc
new file mode 100644
index 0000000..e23b3ae
--- /dev/null
+++ b/test/core/end2end/cq_verifier_uv.cc
@@ -0,0 +1,97 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_UV
+
+#include <uv.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "test/core/end2end/cq_verifier_internal.h"
+
+typedef enum timer_state {
+  TIMER_STARTED,
+  TIMER_TRIGGERED,
+  TIMER_CLOSED
+} timer_state;
+
+/* the verifier itself */
+struct cq_verifier {
+  /* bound completion queue */
+  grpc_completion_queue* cq;
+  /* start of expectation list */
+  expectation* first_expectation;
+  uv_timer_t timer;
+};
+
+cq_verifier* cq_verifier_create(grpc_completion_queue* cq) {
+  cq_verifier* v = static_cast<cq_verifier*>(gpr_malloc(sizeof(cq_verifier)));
+  v->cq = cq;
+  v->first_expectation = NULL;
+  uv_timer_init(uv_default_loop(), &v->timer);
+  v->timer.data = (void*)TIMER_STARTED;
+  return v;
+}
+
+static void timer_close_cb(uv_handle_t* handle) {
+  handle->data = (void*)TIMER_CLOSED;
+}
+
+void cq_verifier_destroy(cq_verifier* v) {
+  cq_verify(v);
+  uv_close((uv_handle_t*)&v->timer, timer_close_cb);
+  while (reinterpret_cast<timer_state>(v->timer.data) != TIMER_CLOSED) {
+    uv_run(uv_default_loop(), UV_RUN_NOWAIT);
+  }
+  gpr_free(v);
+}
+
+expectation* cq_verifier_get_first_expectation(cq_verifier* v) {
+  return v->first_expectation;
+}
+
+void cq_verifier_set_first_expectation(cq_verifier* v, expectation* e) {
+  v->first_expectation = e;
+}
+
+static void timer_run_cb(uv_timer_t* timer) {
+  timer->data = (void*)TIMER_TRIGGERED;
+}
+
+grpc_event cq_verifier_next_event(cq_verifier* v, int timeout_seconds) {
+  uint64_t timeout_ms =
+      timeout_seconds < 0 ? 0 : (uint64_t)timeout_seconds * 1000;
+  grpc_event ev;
+  v->timer.data = (void*)TIMER_STARTED;
+  uv_timer_start(&v->timer, timer_run_cb, timeout_ms, 0);
+  ev = grpc_completion_queue_next(v->cq, gpr_inf_past(GPR_CLOCK_MONOTONIC),
+                                  NULL);
+  // Stop the loop if the timer goes off or we get a non-timeout event
+  while ((reinterpret_cast<timer_state>(v->timer.data) != TIMER_TRIGGERED) &&
+         ev.type == GRPC_QUEUE_TIMEOUT) {
+    uv_run(uv_default_loop(), UV_RUN_ONCE);
+    ev = grpc_completion_queue_next(v->cq, gpr_inf_past(GPR_CLOCK_MONOTONIC),
+                                    NULL);
+  }
+  return ev;
+}
+
+#endif /* GRPC_UV */
diff --git a/test/core/end2end/data/client_certs.c b/test/core/end2end/data/client_certs.c
deleted file mode 100644
index 7877067..0000000
--- a/test/core/end2end/data/client_certs.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-const char test_self_signed_client_cert[] = {
-    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
-    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
-    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x6f, 0x44, 0x43, 0x43,
-    0x41, 0x67, 0x6d, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4a,
-    0x41, 0x4e, 0x49, 0x7a, 0x32, 0x2f, 0x7a, 0x6f, 0x52, 0x69, 0x61, 0x70,
-    0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33,
-    0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x4d, 0x47, 0x6b, 0x78,
-    0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x59,
-    0x54, 0x41, 0x6b, 0x46, 0x56, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59,
-    0x44, 0x56, 0x51, 0x51, 0x49, 0x44, 0x41, 0x70, 0x54, 0x62, 0x32, 0x31,
-    0x6c, 0x4c, 0x56, 0x4e, 0x30, 0x59, 0x58, 0x52, 0x6c, 0x4d, 0x53, 0x45,
-    0x77, 0x48, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x42, 0x68,
-    0x4a, 0x62, 0x6e, 0x52, 0x6c, 0x63, 0x6d, 0x35, 0x6c, 0x64, 0x43, 0x42,
-    0x58, 0x0a, 0x61, 0x57, 0x52, 0x6e, 0x61, 0x58, 0x52, 0x7a, 0x49, 0x46,
-    0x42, 0x30, 0x65, 0x53, 0x42, 0x4d, 0x64, 0x47, 0x51, 0x78, 0x49, 0x6a,
-    0x41, 0x67, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x47, 0x57,
-    0x4a, 0x68, 0x5a, 0x47, 0x4e, 0x73, 0x61, 0x57, 0x56, 0x75, 0x64, 0x43,
-    0x35, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x4c, 0x6d, 0x64, 0x76, 0x62, 0x32,
-    0x64, 0x73, 0x5a, 0x53, 0x35, 0x6a, 0x0a, 0x62, 0x32, 0x30, 0x77, 0x48,
-    0x68, 0x63, 0x4e, 0x4d, 0x54, 0x51, 0x77, 0x4e, 0x7a, 0x49, 0x34, 0x4d,
-    0x6a, 0x41, 0x77, 0x4f, 0x44, 0x49, 0x31, 0x57, 0x68, 0x63, 0x4e, 0x4d,
-    0x6a, 0x51, 0x77, 0x4e, 0x7a, 0x49, 0x31, 0x4d, 0x6a, 0x41, 0x77, 0x4f,
-    0x44, 0x49, 0x31, 0x57, 0x6a, 0x42, 0x70, 0x4d, 0x51, 0x73, 0x77, 0x43,
-    0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x42, 0x0a,
-    0x56, 0x54, 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45,
-    0x43, 0x41, 0x77, 0x4b, 0x55, 0x32, 0x39, 0x74, 0x5a, 0x53, 0x31, 0x54,
-    0x64, 0x47, 0x46, 0x30, 0x5a, 0x54, 0x45, 0x68, 0x4d, 0x42, 0x38, 0x47,
-    0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x59, 0x53, 0x57, 0x35, 0x30,
-    0x5a, 0x58, 0x4a, 0x75, 0x5a, 0x58, 0x51, 0x67, 0x56, 0x32, 0x6c, 0x6b,
-    0x5a, 0x32, 0x6c, 0x30, 0x0a, 0x63, 0x79, 0x42, 0x51, 0x64, 0x48, 0x6b,
-    0x67, 0x54, 0x48, 0x52, 0x6b, 0x4d, 0x53, 0x49, 0x77, 0x49, 0x41, 0x59,
-    0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, 0x6c, 0x69, 0x59, 0x57, 0x52,
-    0x6a, 0x62, 0x47, 0x6c, 0x6c, 0x62, 0x6e, 0x51, 0x75, 0x64, 0x47, 0x56,
-    0x7a, 0x64, 0x43, 0x35, 0x6e, 0x62, 0x32, 0x39, 0x6e, 0x62, 0x47, 0x55,
-    0x75, 0x59, 0x32, 0x39, 0x74, 0x4d, 0x49, 0x47, 0x66, 0x0a, 0x4d, 0x41,
-    0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51,
-    0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x47, 0x4e, 0x41, 0x44,
-    0x43, 0x42, 0x69, 0x51, 0x4b, 0x42, 0x67, 0x51, 0x43, 0x79, 0x58, 0x32,
-    0x4a, 0x78, 0x5a, 0x2b, 0x4a, 0x35, 0x49, 0x2b, 0x64, 0x6c, 0x68, 0x52,
-    0x4f, 0x56, 0x74, 0x71, 0x6c, 0x4d, 0x51, 0x6e, 0x34, 0x37, 0x42, 0x42,
-    0x63, 0x72, 0x0a, 0x6c, 0x32, 0x47, 0x43, 0x6b, 0x76, 0x39, 0x4f, 0x31,
-    0x44, 0x31, 0x72, 0x4c, 0x39, 0x34, 0x4b, 0x57, 0x59, 0x62, 0x59, 0x31,
-    0x34, 0x48, 0x58, 0x68, 0x69, 0x2f, 0x6e, 0x61, 0x63, 0x42, 0x41, 0x51,
-    0x74, 0x43, 0x45, 0x51, 0x77, 0x58, 0x78, 0x70, 0x35, 0x44, 0x4b, 0x65,
-    0x6d, 0x47, 0x4f, 0x55, 0x6a, 0x75, 0x36, 0x35, 0x78, 0x4d, 0x39, 0x46,
-    0x39, 0x36, 0x2f, 0x33, 0x37, 0x34, 0x47, 0x0a, 0x4d, 0x76, 0x6e, 0x52,
-    0x4a, 0x64, 0x6f, 0x35, 0x32, 0x67, 0x4f, 0x73, 0x34, 0x48, 0x4f, 0x30,
-    0x63, 0x7a, 0x42, 0x70, 0x66, 0x56, 0x4e, 0x64, 0x58, 0x65, 0x65, 0x6f,
-    0x44, 0x2f, 0x52, 0x59, 0x67, 0x77, 0x74, 0x74, 0x66, 0x64, 0x4a, 0x72,
-    0x7a, 0x2f, 0x34, 0x61, 0x61, 0x74, 0x73, 0x53, 0x32, 0x51, 0x6b, 0x32,
-    0x79, 0x4d, 0x59, 0x70, 0x71, 0x5a, 0x6d, 0x71, 0x45, 0x4d, 0x73, 0x62,
-    0x0a, 0x72, 0x68, 0x39, 0x57, 0x32, 0x32, 0x4c, 0x70, 0x33, 0x72, 0x43,
-    0x42, 0x76, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x31, 0x41,
-    0x77, 0x54, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34,
-    0x45, 0x46, 0x67, 0x51, 0x55, 0x35, 0x32, 0x33, 0x41, 0x4a, 0x4d, 0x52,
-    0x38, 0x44, 0x73, 0x39, 0x56, 0x38, 0x66, 0x68, 0x66, 0x37, 0x67, 0x75,
-    0x31, 0x69, 0x30, 0x4d, 0x4d, 0x0a, 0x55, 0x71, 0x41, 0x77, 0x48, 0x77,
-    0x59, 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, 0x77, 0x46, 0x6f,
-    0x41, 0x55, 0x35, 0x32, 0x33, 0x41, 0x4a, 0x4d, 0x52, 0x38, 0x44, 0x73,
-    0x39, 0x56, 0x38, 0x66, 0x68, 0x66, 0x37, 0x67, 0x75, 0x31, 0x69, 0x30,
-    0x4d, 0x4d, 0x55, 0x71, 0x41, 0x77, 0x44, 0x41, 0x59, 0x44, 0x56, 0x52,
-    0x30, 0x54, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x0a, 0x2f,
-    0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39,
-    0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x42, 0x67,
-    0x51, 0x43, 0x49, 0x2f, 0x74, 0x76, 0x53, 0x42, 0x59, 0x48, 0x31, 0x69,
-    0x79, 0x66, 0x4c, 0x61, 0x43, 0x54, 0x42, 0x4b, 0x77, 0x70, 0x64, 0x6a,
-    0x33, 0x36, 0x2b, 0x4d, 0x6b, 0x52, 0x39, 0x45, 0x65, 0x4a, 0x4a, 0x6d,
-    0x49, 0x6d, 0x78, 0x0a, 0x58, 0x2b, 0x62, 0x6a, 0x68, 0x4b, 0x57, 0x58,
-    0x77, 0x73, 0x42, 0x58, 0x34, 0x50, 0x44, 0x4d, 0x57, 0x76, 0x64, 0x75,
-    0x73, 0x72, 0x2b, 0x2b, 0x51, 0x47, 0x55, 0x59, 0x74, 0x79, 0x6f, 0x79,
-    0x61, 0x2b, 0x68, 0x66, 0x59, 0x4d, 0x58, 0x52, 0x68, 0x58, 0x75, 0x61,
-    0x33, 0x39, 0x6d, 0x44, 0x35, 0x34, 0x78, 0x67, 0x6c, 0x6f, 0x51, 0x4e,
-    0x75, 0x75, 0x39, 0x52, 0x45, 0x44, 0x77, 0x58, 0x0a, 0x46, 0x66, 0x74,
-    0x6f, 0x2b, 0x61, 0x4f, 0x77, 0x33, 0x42, 0x63, 0x59, 0x64, 0x75, 0x63,
-    0x7a, 0x36, 0x6f, 0x66, 0x78, 0x69, 0x63, 0x46, 0x4b, 0x2f, 0x59, 0x32,
-    0x56, 0x65, 0x58, 0x44, 0x75, 0x72, 0x53, 0x4d, 0x70, 0x52, 0x76, 0x35,
-    0x54, 0x66, 0x47, 0x66, 0x32, 0x51, 0x72, 0x36, 0x65, 0x4f, 0x4f, 0x64,
-    0x61, 0x52, 0x68, 0x6a, 0x36, 0x65, 0x64, 0x37, 0x42, 0x69, 0x62, 0x48,
-    0x6b, 0x0a, 0x58, 0x31, 0x56, 0x47, 0x5a, 0x41, 0x3d, 0x3d, 0x0a, 0x2d,
-    0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54,
-    0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
-    0x0a, 0x00};
-
-const char test_self_signed_client_key[] = {
-    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x50,
-    0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d,
-    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x64, 0x77, 0x49, 0x42,
-    0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47,
-    0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x53, 0x43,
-    0x41, 0x6d, 0x45, 0x77, 0x67, 0x67, 0x4a, 0x64, 0x41, 0x67, 0x45, 0x41,
-    0x41, 0x6f, 0x47, 0x42, 0x41, 0x4c, 0x4a, 0x66, 0x59, 0x6e, 0x46, 0x6e,
-    0x34, 0x6e, 0x6b, 0x6a, 0x35, 0x32, 0x57, 0x46, 0x0a, 0x45, 0x35, 0x57,
-    0x32, 0x71, 0x55, 0x78, 0x43, 0x66, 0x6a, 0x73, 0x45, 0x46, 0x79, 0x75,
-    0x58, 0x59, 0x59, 0x4b, 0x53, 0x2f, 0x30, 0x37, 0x55, 0x50, 0x57, 0x73,
-    0x76, 0x33, 0x67, 0x70, 0x5a, 0x68, 0x74, 0x6a, 0x58, 0x67, 0x64, 0x65,
-    0x47, 0x4c, 0x2b, 0x64, 0x70, 0x77, 0x45, 0x42, 0x43, 0x30, 0x49, 0x52,
-    0x44, 0x42, 0x66, 0x47, 0x6e, 0x6b, 0x4d, 0x70, 0x36, 0x59, 0x59, 0x35,
-    0x53, 0x0a, 0x4f, 0x37, 0x72, 0x6e, 0x45, 0x7a, 0x30, 0x58, 0x33, 0x72,
-    0x2f, 0x66, 0x76, 0x67, 0x59, 0x79, 0x2b, 0x64, 0x45, 0x6c, 0x32, 0x6a,
-    0x6e, 0x61, 0x41, 0x36, 0x7a, 0x67, 0x63, 0x37, 0x52, 0x7a, 0x4d, 0x47,
-    0x6c, 0x39, 0x55, 0x31, 0x31, 0x64, 0x35, 0x36, 0x67, 0x50, 0x39, 0x46,
-    0x69, 0x44, 0x43, 0x32, 0x31, 0x39, 0x30, 0x6d, 0x76, 0x50, 0x2f, 0x68,
-    0x70, 0x71, 0x32, 0x78, 0x4c, 0x5a, 0x0a, 0x43, 0x54, 0x62, 0x49, 0x78,
-    0x69, 0x6d, 0x70, 0x6d, 0x61, 0x6f, 0x51, 0x79, 0x78, 0x75, 0x75, 0x48,
-    0x31, 0x62, 0x62, 0x59, 0x75, 0x6e, 0x65, 0x73, 0x49, 0x47, 0x2f, 0x41,
-    0x67, 0x4d, 0x42, 0x41, 0x41, 0x45, 0x43, 0x67, 0x59, 0x41, 0x64, 0x71,
-    0x4a, 0x43, 0x45, 0x7a, 0x4d, 0x49, 0x79, 0x5a, 0x45, 0x37, 0x6f, 0x61,
-    0x57, 0x30, 0x74, 0x4f, 0x70, 0x63, 0x42, 0x30, 0x42, 0x69, 0x50, 0x0a,
-    0x46, 0x59, 0x6f, 0x49, 0x76, 0x48, 0x34, 0x42, 0x4b, 0x52, 0x48, 0x38,
-    0x65, 0x48, 0x76, 0x52, 0x34, 0x37, 0x36, 0x6d, 0x74, 0x2b, 0x59, 0x64,
-    0x44, 0x68, 0x42, 0x50, 0x31, 0x73, 0x63, 0x47, 0x55, 0x6d, 0x59, 0x65,
-    0x43, 0x54, 0x34, 0x45, 0x6a, 0x2b, 0x52, 0x67, 0x48, 0x76, 0x32, 0x4c,
-    0x50, 0x54, 0x67, 0x56, 0x59, 0x77, 0x54, 0x39, 0x65, 0x63, 0x69, 0x50,
-    0x32, 0x2b, 0x45, 0x2f, 0x0a, 0x43, 0x42, 0x43, 0x4e, 0x52, 0x65, 0x6c,
-    0x30, 0x53, 0x77, 0x39, 0x4a, 0x65, 0x70, 0x77, 0x57, 0x30, 0x72, 0x2b,
-    0x6a, 0x57, 0x4a, 0x74, 0x44, 0x59, 0x31, 0x70, 0x70, 0x36, 0x59, 0x58,
-    0x41, 0x67, 0x4e, 0x52, 0x47, 0x58, 0x32, 0x55, 0x66, 0x6c, 0x76, 0x55,
-    0x73, 0x54, 0x2b, 0x6f, 0x39, 0x6c, 0x5a, 0x76, 0x61, 0x67, 0x66, 0x39,
-    0x6d, 0x6f, 0x4c, 0x54, 0x4d, 0x79, 0x47, 0x76, 0x55, 0x0a, 0x75, 0x4c,
-    0x46, 0x6e, 0x73, 0x79, 0x66, 0x4c, 0x69, 0x6d, 0x31, 0x42, 0x34, 0x76,
-    0x58, 0x76, 0x57, 0x51, 0x4a, 0x42, 0x41, 0x4e, 0x6f, 0x75, 0x5a, 0x6c,
-    0x6c, 0x58, 0x47, 0x5a, 0x6f, 0x53, 0x72, 0x5a, 0x4c, 0x74, 0x52, 0x33,
-    0x56, 0x67, 0x56, 0x34, 0x74, 0x7a, 0x52, 0x51, 0x76, 0x4a, 0x78, 0x75,
-    0x38, 0x34, 0x6b, 0x4c, 0x65, 0x49, 0x6b, 0x36, 0x34, 0x4f, 0x76, 0x34,
-    0x37, 0x58, 0x0a, 0x70, 0x48, 0x56, 0x42, 0x4d, 0x54, 0x52, 0x42, 0x66,
-    0x7a, 0x50, 0x45, 0x68, 0x62, 0x42, 0x6f, 0x64, 0x6a, 0x72, 0x31, 0x6d,
-    0x35, 0x4f, 0x4c, 0x61, 0x56, 0x4c, 0x71, 0x6b, 0x46, 0x63, 0x58, 0x66,
-    0x74, 0x7a, 0x52, 0x43, 0x72, 0x62, 0x57, 0x6f, 0x4b, 0x73, 0x43, 0x51,
-    0x51, 0x44, 0x52, 0x53, 0x6f, 0x4c, 0x4c, 0x58, 0x4f, 0x69, 0x4c, 0x72,
-    0x74, 0x4a, 0x33, 0x44, 0x4c, 0x4a, 0x43, 0x0a, 0x72, 0x58, 0x37, 0x59,
-    0x38, 0x77, 0x72, 0x48, 0x5a, 0x72, 0x71, 0x6b, 0x35, 0x62, 0x4d, 0x64,
-    0x5a, 0x4c, 0x47, 0x61, 0x2f, 0x55, 0x58, 0x38, 0x52, 0x61, 0x6e, 0x68,
-    0x56, 0x77, 0x33, 0x2b, 0x58, 0x70, 0x2b, 0x75, 0x72, 0x64, 0x31, 0x37,
-    0x31, 0x31, 0x75, 0x6d, 0x65, 0x4e, 0x4a, 0x66, 0x7a, 0x75, 0x2f, 0x4d,
-    0x43, 0x6b, 0x34, 0x61, 0x31, 0x4b, 0x6b, 0x47, 0x2f, 0x43, 0x55, 0x30,
-    0x0a, 0x72, 0x71, 0x73, 0x39, 0x41, 0x6b, 0x41, 0x34, 0x63, 0x53, 0x78,
-    0x31, 0x44, 0x44, 0x31, 0x4a, 0x53, 0x47, 0x2b, 0x79, 0x78, 0x4d, 0x4e,
-    0x70, 0x73, 0x41, 0x53, 0x31, 0x78, 0x4a, 0x6f, 0x6d, 0x46, 0x49, 0x72,
-    0x73, 0x4d, 0x39, 0x76, 0x73, 0x50, 0x74, 0x37, 0x46, 0x64, 0x6e, 0x64,
-    0x44, 0x77, 0x72, 0x46, 0x2b, 0x79, 0x2b, 0x43, 0x6f, 0x76, 0x68, 0x44,
-    0x6b, 0x47, 0x59, 0x44, 0x6b, 0x0a, 0x52, 0x41, 0x48, 0x68, 0x2b, 0x73,
-    0x76, 0x47, 0x66, 0x5a, 0x67, 0x2f, 0x70, 0x51, 0x4b, 0x32, 0x4a, 0x52,
-    0x50, 0x69, 0x6d, 0x41, 0x6d, 0x48, 0x68, 0x7a, 0x71, 0x46, 0x41, 0x6b,
-    0x45, 0x41, 0x75, 0x36, 0x59, 0x61, 0x37, 0x30, 0x73, 0x32, 0x46, 0x55,
-    0x65, 0x42, 0x33, 0x4d, 0x75, 0x39, 0x61, 0x4a, 0x73, 0x32, 0x43, 0x44,
-    0x36, 0x68, 0x67, 0x33, 0x64, 0x51, 0x45, 0x56, 0x6b, 0x42, 0x0a, 0x35,
-    0x33, 0x44, 0x49, 0x37, 0x54, 0x58, 0x34, 0x38, 0x64, 0x39, 0x6b, 0x47,
-    0x57, 0x35, 0x38, 0x56, 0x58, 0x31, 0x78, 0x6e, 0x71, 0x53, 0x30, 0x32,
-    0x4c, 0x79, 0x57, 0x71, 0x41, 0x50, 0x63, 0x57, 0x35, 0x71, 0x6d, 0x31,
-    0x6b, 0x4c, 0x48, 0x46, 0x4c, 0x64, 0x6e, 0x64, 0x61, 0x50, 0x4e, 0x6d,
-    0x42, 0x61, 0x6a, 0x34, 0x51, 0x4a, 0x42, 0x41, 0x4a, 0x75, 0x67, 0x6c,
-    0x33, 0x36, 0x37, 0x0a, 0x39, 0x64, 0x39, 0x74, 0x2f, 0x51, 0x4c, 0x54,
-    0x53, 0x75, 0x55, 0x4c, 0x4c, 0x61, 0x6f, 0x59, 0x76, 0x32, 0x76, 0x4a,
-    0x54, 0x33, 0x73, 0x31, 0x79, 0x39, 0x48, 0x4e, 0x38, 0x39, 0x45, 0x6f,
-    0x61, 0x44, 0x44, 0x45, 0x6b, 0x50, 0x56, 0x66, 0x51, 0x75, 0x36, 0x47,
-    0x56, 0x45, 0x58, 0x67, 0x49, 0x42, 0x74, 0x69, 0x6d, 0x31, 0x73, 0x49,
-    0x2f, 0x56, 0x50, 0x53, 0x7a, 0x49, 0x38, 0x48, 0x0a, 0x61, 0x58, 0x76,
-    0x61, 0x54, 0x55, 0x77, 0x62, 0x6c, 0x46, 0x57, 0x53, 0x4d, 0x37, 0x30,
-    0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x50,
-    0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d,
-    0x2d, 0x2d, 0x2d, 0x0a, 0x00};
-
-const char test_signed_client_cert[] = {
-    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
-    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
-    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x48, 0x7a, 0x43, 0x43,
-    0x41, 0x59, 0x67, 0x43, 0x41, 0x51, 0x45, 0x77, 0x44, 0x51, 0x59, 0x4a,
-    0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46,
-    0x42, 0x51, 0x41, 0x77, 0x56, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47,
-    0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x51, 0x56, 0x55, 0x78,
-    0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x67,
-    0x4d, 0x43, 0x6c, 0x4e, 0x76, 0x62, 0x57, 0x55, 0x74, 0x55, 0x33, 0x52,
-    0x68, 0x64, 0x47, 0x55, 0x78, 0x49, 0x54, 0x41, 0x66, 0x42, 0x67, 0x4e,
-    0x56, 0x42, 0x41, 0x6f, 0x4d, 0x47, 0x45, 0x6c, 0x75, 0x64, 0x47, 0x56,
-    0x79, 0x62, 0x6d, 0x56, 0x30, 0x49, 0x46, 0x64, 0x70, 0x5a, 0x47, 0x64,
-    0x70, 0x64, 0x48, 0x4d, 0x67, 0x55, 0x48, 0x52, 0x35, 0x49, 0x45, 0x78,
-    0x30, 0x0a, 0x5a, 0x44, 0x45, 0x50, 0x4d, 0x41, 0x30, 0x47, 0x41, 0x31,
-    0x55, 0x45, 0x41, 0x77, 0x77, 0x47, 0x64, 0x47, 0x56, 0x7a, 0x64, 0x47,
-    0x4e, 0x68, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x30, 0x4d, 0x44,
-    0x63, 0x78, 0x4e, 0x7a, 0x49, 0x7a, 0x4e, 0x54, 0x59, 0x77, 0x4d, 0x6c,
-    0x6f, 0x58, 0x44, 0x54, 0x49, 0x30, 0x4d, 0x44, 0x63, 0x78, 0x4e, 0x44,
-    0x49, 0x7a, 0x4e, 0x54, 0x59, 0x77, 0x0a, 0x4d, 0x6c, 0x6f, 0x77, 0x57,
-    0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42,
-    0x68, 0x4d, 0x43, 0x51, 0x56, 0x55, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42,
-    0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, 0x43, 0x6c, 0x4e, 0x76, 0x62,
-    0x57, 0x55, 0x74, 0x55, 0x33, 0x52, 0x68, 0x64, 0x47, 0x55, 0x78, 0x49,
-    0x54, 0x41, 0x66, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x0a,
-    0x47, 0x45, 0x6c, 0x75, 0x64, 0x47, 0x56, 0x79, 0x62, 0x6d, 0x56, 0x30,
-    0x49, 0x46, 0x64, 0x70, 0x5a, 0x47, 0x64, 0x70, 0x64, 0x48, 0x4d, 0x67,
-    0x55, 0x48, 0x52, 0x35, 0x49, 0x45, 0x78, 0x30, 0x5a, 0x44, 0x45, 0x54,
-    0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x4b,
-    0x64, 0x47, 0x56, 0x7a, 0x64, 0x47, 0x4e, 0x73, 0x61, 0x57, 0x56, 0x75,
-    0x64, 0x44, 0x43, 0x42, 0x0a, 0x6e, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b,
-    0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45,
-    0x46, 0x41, 0x41, 0x4f, 0x42, 0x6a, 0x51, 0x41, 0x77, 0x67, 0x59, 0x6b,
-    0x43, 0x67, 0x59, 0x45, 0x41, 0x37, 0x46, 0x52, 0x48, 0x32, 0x36, 0x47,
-    0x2b, 0x46, 0x74, 0x35, 0x56, 0x51, 0x67, 0x79, 0x7a, 0x6c, 0x5a, 0x73,
-    0x66, 0x53, 0x6e, 0x48, 0x53, 0x5a, 0x36, 0x47, 0x58, 0x0a, 0x62, 0x37,
-    0x71, 0x78, 0x6d, 0x6b, 0x32, 0x50, 0x4f, 0x38, 0x54, 0x59, 0x71, 0x4b,
-    0x5a, 0x6d, 0x6b, 0x66, 0x4d, 0x77, 0x6b, 0x65, 0x36, 0x52, 0x55, 0x66,
-    0x51, 0x56, 0x2b, 0x53, 0x2b, 0x47, 0x7a, 0x52, 0x76, 0x7a, 0x35, 0x4c,
-    0x6c, 0x53, 0x33, 0x31, 0x55, 0x31, 0x51, 0x43, 0x70, 0x33, 0x63, 0x67,
-    0x77, 0x6b, 0x49, 0x49, 0x41, 0x51, 0x61, 0x31, 0x45, 0x32, 0x68, 0x43,
-    0x45, 0x7a, 0x0a, 0x57, 0x33, 0x31, 0x69, 0x76, 0x62, 0x4d, 0x42, 0x79,
-    0x52, 0x4b, 0x39, 0x74, 0x46, 0x70, 0x79, 0x6e, 0x34, 0x55, 0x76, 0x38,
-    0x4b, 0x50, 0x31, 0x34, 0x4f, 0x62, 0x4b, 0x6a, 0x54, 0x51, 0x71, 0x78,
-    0x55, 0x5a, 0x70, 0x35, 0x35, 0x38, 0x44, 0x67, 0x4f, 0x48, 0x67, 0x35,
-    0x62, 0x35, 0x6d, 0x47, 0x52, 0x4d, 0x30, 0x70, 0x79, 0x56, 0x31, 0x65,
-    0x71, 0x52, 0x4b, 0x36, 0x50, 0x57, 0x77, 0x0a, 0x52, 0x2f, 0x62, 0x6a,
-    0x67, 0x6c, 0x6c, 0x69, 0x36, 0x70, 0x6d, 0x6e, 0x72, 0x2b, 0x30, 0x43,
-    0x41, 0x77, 0x45, 0x41, 0x41, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71,
-    0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46,
-    0x41, 0x41, 0x4f, 0x42, 0x67, 0x51, 0x41, 0x53, 0x74, 0x53, 0x6d, 0x35,
-    0x50, 0x4d, 0x37, 0x75, 0x62, 0x52, 0x4f, 0x69, 0x4b, 0x4b, 0x36, 0x2f,
-    0x0a, 0x54, 0x32, 0x46, 0x6b, 0x4b, 0x6c, 0x68, 0x69, 0x54, 0x4f, 0x78,
-    0x2b, 0x52, 0x79, 0x65, 0x6e, 0x6d, 0x33, 0x45, 0x69, 0x6f, 0x35, 0x39,
-    0x65, 0x6d, 0x71, 0x2b, 0x6a, 0x58, 0x6c, 0x2b, 0x31, 0x6e, 0x68, 0x50,
-    0x79, 0x53, 0x58, 0x35, 0x47, 0x32, 0x50, 0x51, 0x7a, 0x53, 0x52, 0x35,
-    0x76, 0x64, 0x31, 0x64, 0x49, 0x68, 0x77, 0x67, 0x5a, 0x53, 0x52, 0x34,
-    0x47, 0x79, 0x74, 0x74, 0x6b, 0x0a, 0x74, 0x52, 0x5a, 0x35, 0x37, 0x6b,
-    0x2f, 0x4e, 0x49, 0x31, 0x62, 0x72, 0x55, 0x57, 0x38, 0x6a, 0x6f, 0x69,
-    0x45, 0x4f, 0x4d, 0x4a, 0x41, 0x2f, 0x4d, 0x72, 0x37, 0x48, 0x37, 0x61,
-    0x73, 0x78, 0x37, 0x77, 0x49, 0x52, 0x59, 0x44, 0x45, 0x39, 0x31, 0x46,
-    0x73, 0x38, 0x47, 0x6b, 0x4b, 0x57, 0x64, 0x35, 0x4c, 0x68, 0x6f, 0x50,
-    0x41, 0x51, 0x6a, 0x2b, 0x71, 0x64, 0x47, 0x33, 0x35, 0x43, 0x0a, 0x4f,
-    0x4f, 0x2b, 0x73, 0x76, 0x64, 0x6b, 0x6d, 0x71, 0x48, 0x30, 0x4b, 0x5a,
-    0x6f, 0x33, 0x32, 0x30, 0x5a, 0x55, 0x71, 0x64, 0x6c, 0x32, 0x6f, 0x6f,
-    0x51, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44,
-    0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45,
-    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00};
-
-const char test_signed_client_key[] = {
-    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x50,
-    0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d,
-    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x65, 0x51, 0x49, 0x42,
-    0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47,
-    0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x53, 0x43,
-    0x41, 0x6d, 0x4d, 0x77, 0x67, 0x67, 0x4a, 0x66, 0x41, 0x67, 0x45, 0x41,
-    0x41, 0x6f, 0x47, 0x42, 0x41, 0x4f, 0x78, 0x55, 0x52, 0x39, 0x75, 0x68,
-    0x76, 0x68, 0x62, 0x65, 0x56, 0x55, 0x49, 0x4d, 0x0a, 0x73, 0x35, 0x57,
-    0x62, 0x48, 0x30, 0x70, 0x78, 0x30, 0x6d, 0x65, 0x68, 0x6c, 0x32, 0x2b,
-    0x36, 0x73, 0x5a, 0x70, 0x4e, 0x6a, 0x7a, 0x76, 0x45, 0x32, 0x4b, 0x69,
-    0x6d, 0x5a, 0x70, 0x48, 0x7a, 0x4d, 0x4a, 0x48, 0x75, 0x6b, 0x56, 0x48,
-    0x30, 0x46, 0x66, 0x6b, 0x76, 0x68, 0x73, 0x30, 0x62, 0x38, 0x2b, 0x53,
-    0x35, 0x55, 0x74, 0x39, 0x56, 0x4e, 0x55, 0x41, 0x71, 0x64, 0x33, 0x49,
-    0x4d, 0x0a, 0x4a, 0x43, 0x43, 0x41, 0x45, 0x47, 0x74, 0x52, 0x4e, 0x6f,
-    0x51, 0x68, 0x4d, 0x31, 0x74, 0x39, 0x59, 0x72, 0x32, 0x7a, 0x41, 0x63,
-    0x6b, 0x53, 0x76, 0x62, 0x52, 0x61, 0x63, 0x70, 0x2b, 0x46, 0x4c, 0x2f,
-    0x43, 0x6a, 0x39, 0x65, 0x44, 0x6d, 0x79, 0x6f, 0x30, 0x30, 0x4b, 0x73,
-    0x56, 0x47, 0x61, 0x65, 0x65, 0x66, 0x41, 0x34, 0x44, 0x68, 0x34, 0x4f,
-    0x57, 0x2b, 0x5a, 0x68, 0x6b, 0x54, 0x0a, 0x4e, 0x4b, 0x63, 0x6c, 0x64,
-    0x58, 0x71, 0x6b, 0x53, 0x75, 0x6a, 0x31, 0x73, 0x45, 0x66, 0x32, 0x34,
-    0x34, 0x4a, 0x5a, 0x59, 0x75, 0x71, 0x5a, 0x70, 0x36, 0x2f, 0x74, 0x41,
-    0x67, 0x4d, 0x42, 0x41, 0x41, 0x45, 0x43, 0x67, 0x59, 0x45, 0x41, 0x69,
-    0x32, 0x4e, 0x53, 0x56, 0x71, 0x70, 0x5a, 0x4d, 0x61, 0x66, 0x45, 0x35,
-    0x59, 0x59, 0x55, 0x54, 0x63, 0x4d, 0x47, 0x65, 0x36, 0x51, 0x53, 0x0a,
-    0x6b, 0x32, 0x6a, 0x74, 0x70, 0x73, 0x71, 0x59, 0x67, 0x67, 0x67, 0x49,
-    0x32, 0x52, 0x6e, 0x4c, 0x4a, 0x2f, 0x32, 0x74, 0x4e, 0x5a, 0x77, 0x59,
-    0x49, 0x35, 0x70, 0x77, 0x50, 0x38, 0x51, 0x56, 0x53, 0x62, 0x6e, 0x4d,
-    0x61, 0x69, 0x46, 0x34, 0x67, 0x6f, 0x6b, 0x44, 0x35, 0x68, 0x47, 0x64,
-    0x72, 0x4e, 0x44, 0x66, 0x54, 0x6e, 0x62, 0x32, 0x76, 0x2b, 0x79, 0x49,
-    0x77, 0x59, 0x45, 0x48, 0x0a, 0x30, 0x77, 0x38, 0x2b, 0x6f, 0x47, 0x37,
-    0x5a, 0x38, 0x31, 0x4b, 0x6f, 0x64, 0x73, 0x69, 0x5a, 0x53, 0x49, 0x44,
-    0x4a, 0x66, 0x54, 0x47, 0x73, 0x41, 0x5a, 0x68, 0x56, 0x4e, 0x77, 0x4f,
-    0x7a, 0x39, 0x79, 0x30, 0x56, 0x44, 0x38, 0x42, 0x42, 0x5a, 0x5a, 0x31,
-    0x2f, 0x32, 0x37, 0x34, 0x5a, 0x68, 0x35, 0x32, 0x41, 0x55, 0x4b, 0x4c,
-    0x6a, 0x5a, 0x53, 0x2f, 0x5a, 0x77, 0x49, 0x62, 0x53, 0x0a, 0x57, 0x32,
-    0x79, 0x77, 0x79, 0x61, 0x38, 0x35, 0x35, 0x64, 0x50, 0x6e, 0x48, 0x2f,
-    0x77, 0x6a, 0x2b, 0x30, 0x45, 0x43, 0x51, 0x51, 0x44, 0x39, 0x58, 0x38,
-    0x44, 0x39, 0x32, 0x30, 0x6b, 0x42, 0x79, 0x54, 0x4e, 0x48, 0x68, 0x42,
-    0x47, 0x31, 0x38, 0x62, 0x69, 0x41, 0x45, 0x5a, 0x34, 0x70, 0x78, 0x73,
-    0x39, 0x66, 0x30, 0x4f, 0x41, 0x47, 0x38, 0x33, 0x33, 0x33, 0x65, 0x56,
-    0x63, 0x49, 0x0a, 0x77, 0x32, 0x6c, 0x4a, 0x44, 0x4c, 0x73, 0x59, 0x44,
-    0x5a, 0x72, 0x43, 0x42, 0x32, 0x6f, 0x63, 0x67, 0x41, 0x33, 0x6c, 0x55,
-    0x64, 0x6f, 0x7a, 0x6c, 0x7a, 0x50, 0x43, 0x37, 0x59, 0x44, 0x59, 0x77,
-    0x38, 0x72, 0x65, 0x67, 0x30, 0x74, 0x6b, 0x69, 0x52, 0x59, 0x35, 0x41,
-    0x6b, 0x45, 0x41, 0x37, 0x73, 0x64, 0x4e, 0x7a, 0x4f, 0x65, 0x51, 0x73,
-    0x51, 0x52, 0x6e, 0x37, 0x2b, 0x2b, 0x35, 0x0a, 0x30, 0x62, 0x50, 0x39,
-    0x44, 0x74, 0x54, 0x2f, 0x69, 0x4f, 0x4e, 0x31, 0x67, 0x62, 0x66, 0x78,
-    0x52, 0x7a, 0x43, 0x66, 0x43, 0x66, 0x58, 0x64, 0x6f, 0x4f, 0x74, 0x66,
-    0x51, 0x57, 0x49, 0x7a, 0x54, 0x65, 0x50, 0x57, 0x74, 0x55, 0x52, 0x74,
-    0x39, 0x58, 0x2f, 0x35, 0x44, 0x39, 0x4e, 0x6f, 0x66, 0x49, 0x30, 0x52,
-    0x67, 0x35, 0x57, 0x32, 0x6f, 0x47, 0x79, 0x2f, 0x4d, 0x4c, 0x65, 0x35,
-    0x0a, 0x2f, 0x73, 0x58, 0x48, 0x56, 0x51, 0x4a, 0x42, 0x41, 0x49, 0x75,
-    0x70, 0x35, 0x58, 0x72, 0x4a, 0x44, 0x6b, 0x51, 0x79, 0x77, 0x4e, 0x5a,
-    0x79, 0x41, 0x55, 0x55, 0x32, 0x65, 0x63, 0x6e, 0x32, 0x62, 0x43, 0x57,
-    0x42, 0x46, 0x6a, 0x77, 0x74, 0x71, 0x64, 0x2b, 0x4c, 0x42, 0x6d, 0x75,
-    0x4d, 0x63, 0x69, 0x49, 0x39, 0x66, 0x4f, 0x4b, 0x73, 0x5a, 0x74, 0x45,
-    0x4b, 0x5a, 0x72, 0x7a, 0x2f, 0x0a, 0x55, 0x30, 0x6c, 0x6b, 0x65, 0x4d,
-    0x52, 0x6f, 0x53, 0x77, 0x76, 0x58, 0x45, 0x38, 0x77, 0x6d, 0x47, 0x4c,
-    0x6a, 0x6a, 0x72, 0x41, 0x62, 0x64, 0x66, 0x6f, 0x68, 0x72, 0x58, 0x46,
-    0x6b, 0x43, 0x51, 0x51, 0x44, 0x5a, 0x45, 0x78, 0x2f, 0x4c, 0x74, 0x49,
-    0x6c, 0x36, 0x4a, 0x49, 0x4e, 0x4a, 0x51, 0x69, 0x73, 0x77, 0x56, 0x65,
-    0x30, 0x74, 0x57, 0x72, 0x36, 0x6b, 0x2b, 0x41, 0x53, 0x50, 0x0a, 0x31,
-    0x57, 0x58, 0x6f, 0x54, 0x6d, 0x2b, 0x48, 0x59, 0x70, 0x6f, 0x46, 0x2f,
-    0x58, 0x55, 0x76, 0x76, 0x39, 0x4c, 0x63, 0x63, 0x4e, 0x46, 0x31, 0x49,
-    0x61, 0x7a, 0x46, 0x6a, 0x33, 0x34, 0x68, 0x77, 0x52, 0x51, 0x77, 0x68,
-    0x78, 0x37, 0x77, 0x2f, 0x56, 0x35, 0x32, 0x49, 0x65, 0x62, 0x2b, 0x70,
-    0x30, 0x6a, 0x55, 0x4d, 0x59, 0x47, 0x78, 0x41, 0x6b, 0x45, 0x41, 0x6a,
-    0x44, 0x68, 0x64, 0x0a, 0x39, 0x70, 0x42, 0x4f, 0x31, 0x66, 0x4b, 0x58,
-    0x57, 0x69, 0x58, 0x7a, 0x69, 0x39, 0x5a, 0x4b, 0x66, 0x6f, 0x79, 0x54,
-    0x4e, 0x63, 0x55, 0x71, 0x33, 0x65, 0x42, 0x53, 0x56, 0x4b, 0x77, 0x50,
-    0x47, 0x32, 0x6e, 0x49, 0x74, 0x67, 0x35, 0x79, 0x63, 0x58, 0x65, 0x6e,
-    0x67, 0x6a, 0x54, 0x35, 0x73, 0x67, 0x63, 0x57, 0x44, 0x6e, 0x63, 0x69,
-    0x49, 0x7a, 0x57, 0x37, 0x42, 0x49, 0x56, 0x49, 0x0a, 0x4a, 0x69, 0x71,
-    0x4f, 0x73, 0x7a, 0x71, 0x39, 0x47, 0x57, 0x45, 0x53, 0x45, 0x72, 0x41,
-    0x61, 0x74, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45,
-    0x4e, 0x44, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
-    0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00};
diff --git a/test/core/end2end/data/client_certs.cc b/test/core/end2end/data/client_certs.cc
new file mode 100644
index 0000000..7e0b10d
--- /dev/null
+++ b/test/core/end2end/data/client_certs.cc
@@ -0,0 +1,328 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+extern "C" const char test_self_signed_client_cert[] = {
+    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
+    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
+    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x6f, 0x44, 0x43, 0x43,
+    0x41, 0x67, 0x6d, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4a,
+    0x41, 0x4e, 0x49, 0x7a, 0x32, 0x2f, 0x7a, 0x6f, 0x52, 0x69, 0x61, 0x70,
+    0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33,
+    0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x4d, 0x47, 0x6b, 0x78,
+    0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x59,
+    0x54, 0x41, 0x6b, 0x46, 0x56, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59,
+    0x44, 0x56, 0x51, 0x51, 0x49, 0x44, 0x41, 0x70, 0x54, 0x62, 0x32, 0x31,
+    0x6c, 0x4c, 0x56, 0x4e, 0x30, 0x59, 0x58, 0x52, 0x6c, 0x4d, 0x53, 0x45,
+    0x77, 0x48, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x42, 0x68,
+    0x4a, 0x62, 0x6e, 0x52, 0x6c, 0x63, 0x6d, 0x35, 0x6c, 0x64, 0x43, 0x42,
+    0x58, 0x0a, 0x61, 0x57, 0x52, 0x6e, 0x61, 0x58, 0x52, 0x7a, 0x49, 0x46,
+    0x42, 0x30, 0x65, 0x53, 0x42, 0x4d, 0x64, 0x47, 0x51, 0x78, 0x49, 0x6a,
+    0x41, 0x67, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x47, 0x57,
+    0x4a, 0x68, 0x5a, 0x47, 0x4e, 0x73, 0x61, 0x57, 0x56, 0x75, 0x64, 0x43,
+    0x35, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x4c, 0x6d, 0x64, 0x76, 0x62, 0x32,
+    0x64, 0x73, 0x5a, 0x53, 0x35, 0x6a, 0x0a, 0x62, 0x32, 0x30, 0x77, 0x48,
+    0x68, 0x63, 0x4e, 0x4d, 0x54, 0x51, 0x77, 0x4e, 0x7a, 0x49, 0x34, 0x4d,
+    0x6a, 0x41, 0x77, 0x4f, 0x44, 0x49, 0x31, 0x57, 0x68, 0x63, 0x4e, 0x4d,
+    0x6a, 0x51, 0x77, 0x4e, 0x7a, 0x49, 0x31, 0x4d, 0x6a, 0x41, 0x77, 0x4f,
+    0x44, 0x49, 0x31, 0x57, 0x6a, 0x42, 0x70, 0x4d, 0x51, 0x73, 0x77, 0x43,
+    0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x42, 0x0a,
+    0x56, 0x54, 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45,
+    0x43, 0x41, 0x77, 0x4b, 0x55, 0x32, 0x39, 0x74, 0x5a, 0x53, 0x31, 0x54,
+    0x64, 0x47, 0x46, 0x30, 0x5a, 0x54, 0x45, 0x68, 0x4d, 0x42, 0x38, 0x47,
+    0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x59, 0x53, 0x57, 0x35, 0x30,
+    0x5a, 0x58, 0x4a, 0x75, 0x5a, 0x58, 0x51, 0x67, 0x56, 0x32, 0x6c, 0x6b,
+    0x5a, 0x32, 0x6c, 0x30, 0x0a, 0x63, 0x79, 0x42, 0x51, 0x64, 0x48, 0x6b,
+    0x67, 0x54, 0x48, 0x52, 0x6b, 0x4d, 0x53, 0x49, 0x77, 0x49, 0x41, 0x59,
+    0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, 0x6c, 0x69, 0x59, 0x57, 0x52,
+    0x6a, 0x62, 0x47, 0x6c, 0x6c, 0x62, 0x6e, 0x51, 0x75, 0x64, 0x47, 0x56,
+    0x7a, 0x64, 0x43, 0x35, 0x6e, 0x62, 0x32, 0x39, 0x6e, 0x62, 0x47, 0x55,
+    0x75, 0x59, 0x32, 0x39, 0x74, 0x4d, 0x49, 0x47, 0x66, 0x0a, 0x4d, 0x41,
+    0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51,
+    0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x47, 0x4e, 0x41, 0x44,
+    0x43, 0x42, 0x69, 0x51, 0x4b, 0x42, 0x67, 0x51, 0x43, 0x79, 0x58, 0x32,
+    0x4a, 0x78, 0x5a, 0x2b, 0x4a, 0x35, 0x49, 0x2b, 0x64, 0x6c, 0x68, 0x52,
+    0x4f, 0x56, 0x74, 0x71, 0x6c, 0x4d, 0x51, 0x6e, 0x34, 0x37, 0x42, 0x42,
+    0x63, 0x72, 0x0a, 0x6c, 0x32, 0x47, 0x43, 0x6b, 0x76, 0x39, 0x4f, 0x31,
+    0x44, 0x31, 0x72, 0x4c, 0x39, 0x34, 0x4b, 0x57, 0x59, 0x62, 0x59, 0x31,
+    0x34, 0x48, 0x58, 0x68, 0x69, 0x2f, 0x6e, 0x61, 0x63, 0x42, 0x41, 0x51,
+    0x74, 0x43, 0x45, 0x51, 0x77, 0x58, 0x78, 0x70, 0x35, 0x44, 0x4b, 0x65,
+    0x6d, 0x47, 0x4f, 0x55, 0x6a, 0x75, 0x36, 0x35, 0x78, 0x4d, 0x39, 0x46,
+    0x39, 0x36, 0x2f, 0x33, 0x37, 0x34, 0x47, 0x0a, 0x4d, 0x76, 0x6e, 0x52,
+    0x4a, 0x64, 0x6f, 0x35, 0x32, 0x67, 0x4f, 0x73, 0x34, 0x48, 0x4f, 0x30,
+    0x63, 0x7a, 0x42, 0x70, 0x66, 0x56, 0x4e, 0x64, 0x58, 0x65, 0x65, 0x6f,
+    0x44, 0x2f, 0x52, 0x59, 0x67, 0x77, 0x74, 0x74, 0x66, 0x64, 0x4a, 0x72,
+    0x7a, 0x2f, 0x34, 0x61, 0x61, 0x74, 0x73, 0x53, 0x32, 0x51, 0x6b, 0x32,
+    0x79, 0x4d, 0x59, 0x70, 0x71, 0x5a, 0x6d, 0x71, 0x45, 0x4d, 0x73, 0x62,
+    0x0a, 0x72, 0x68, 0x39, 0x57, 0x32, 0x32, 0x4c, 0x70, 0x33, 0x72, 0x43,
+    0x42, 0x76, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x31, 0x41,
+    0x77, 0x54, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34,
+    0x45, 0x46, 0x67, 0x51, 0x55, 0x35, 0x32, 0x33, 0x41, 0x4a, 0x4d, 0x52,
+    0x38, 0x44, 0x73, 0x39, 0x56, 0x38, 0x66, 0x68, 0x66, 0x37, 0x67, 0x75,
+    0x31, 0x69, 0x30, 0x4d, 0x4d, 0x0a, 0x55, 0x71, 0x41, 0x77, 0x48, 0x77,
+    0x59, 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, 0x77, 0x46, 0x6f,
+    0x41, 0x55, 0x35, 0x32, 0x33, 0x41, 0x4a, 0x4d, 0x52, 0x38, 0x44, 0x73,
+    0x39, 0x56, 0x38, 0x66, 0x68, 0x66, 0x37, 0x67, 0x75, 0x31, 0x69, 0x30,
+    0x4d, 0x4d, 0x55, 0x71, 0x41, 0x77, 0x44, 0x41, 0x59, 0x44, 0x56, 0x52,
+    0x30, 0x54, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x0a, 0x2f,
+    0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39,
+    0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x42, 0x67,
+    0x51, 0x43, 0x49, 0x2f, 0x74, 0x76, 0x53, 0x42, 0x59, 0x48, 0x31, 0x69,
+    0x79, 0x66, 0x4c, 0x61, 0x43, 0x54, 0x42, 0x4b, 0x77, 0x70, 0x64, 0x6a,
+    0x33, 0x36, 0x2b, 0x4d, 0x6b, 0x52, 0x39, 0x45, 0x65, 0x4a, 0x4a, 0x6d,
+    0x49, 0x6d, 0x78, 0x0a, 0x58, 0x2b, 0x62, 0x6a, 0x68, 0x4b, 0x57, 0x58,
+    0x77, 0x73, 0x42, 0x58, 0x34, 0x50, 0x44, 0x4d, 0x57, 0x76, 0x64, 0x75,
+    0x73, 0x72, 0x2b, 0x2b, 0x51, 0x47, 0x55, 0x59, 0x74, 0x79, 0x6f, 0x79,
+    0x61, 0x2b, 0x68, 0x66, 0x59, 0x4d, 0x58, 0x52, 0x68, 0x58, 0x75, 0x61,
+    0x33, 0x39, 0x6d, 0x44, 0x35, 0x34, 0x78, 0x67, 0x6c, 0x6f, 0x51, 0x4e,
+    0x75, 0x75, 0x39, 0x52, 0x45, 0x44, 0x77, 0x58, 0x0a, 0x46, 0x66, 0x74,
+    0x6f, 0x2b, 0x61, 0x4f, 0x77, 0x33, 0x42, 0x63, 0x59, 0x64, 0x75, 0x63,
+    0x7a, 0x36, 0x6f, 0x66, 0x78, 0x69, 0x63, 0x46, 0x4b, 0x2f, 0x59, 0x32,
+    0x56, 0x65, 0x58, 0x44, 0x75, 0x72, 0x53, 0x4d, 0x70, 0x52, 0x76, 0x35,
+    0x54, 0x66, 0x47, 0x66, 0x32, 0x51, 0x72, 0x36, 0x65, 0x4f, 0x4f, 0x64,
+    0x61, 0x52, 0x68, 0x6a, 0x36, 0x65, 0x64, 0x37, 0x42, 0x69, 0x62, 0x48,
+    0x6b, 0x0a, 0x58, 0x31, 0x56, 0x47, 0x5a, 0x41, 0x3d, 0x3d, 0x0a, 0x2d,
+    0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54,
+    0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
+    0x0a, 0x00};
+
+extern "C" const char test_self_signed_client_key[] = {
+    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x50,
+    0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d,
+    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x64, 0x77, 0x49, 0x42,
+    0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47,
+    0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x53, 0x43,
+    0x41, 0x6d, 0x45, 0x77, 0x67, 0x67, 0x4a, 0x64, 0x41, 0x67, 0x45, 0x41,
+    0x41, 0x6f, 0x47, 0x42, 0x41, 0x4c, 0x4a, 0x66, 0x59, 0x6e, 0x46, 0x6e,
+    0x34, 0x6e, 0x6b, 0x6a, 0x35, 0x32, 0x57, 0x46, 0x0a, 0x45, 0x35, 0x57,
+    0x32, 0x71, 0x55, 0x78, 0x43, 0x66, 0x6a, 0x73, 0x45, 0x46, 0x79, 0x75,
+    0x58, 0x59, 0x59, 0x4b, 0x53, 0x2f, 0x30, 0x37, 0x55, 0x50, 0x57, 0x73,
+    0x76, 0x33, 0x67, 0x70, 0x5a, 0x68, 0x74, 0x6a, 0x58, 0x67, 0x64, 0x65,
+    0x47, 0x4c, 0x2b, 0x64, 0x70, 0x77, 0x45, 0x42, 0x43, 0x30, 0x49, 0x52,
+    0x44, 0x42, 0x66, 0x47, 0x6e, 0x6b, 0x4d, 0x70, 0x36, 0x59, 0x59, 0x35,
+    0x53, 0x0a, 0x4f, 0x37, 0x72, 0x6e, 0x45, 0x7a, 0x30, 0x58, 0x33, 0x72,
+    0x2f, 0x66, 0x76, 0x67, 0x59, 0x79, 0x2b, 0x64, 0x45, 0x6c, 0x32, 0x6a,
+    0x6e, 0x61, 0x41, 0x36, 0x7a, 0x67, 0x63, 0x37, 0x52, 0x7a, 0x4d, 0x47,
+    0x6c, 0x39, 0x55, 0x31, 0x31, 0x64, 0x35, 0x36, 0x67, 0x50, 0x39, 0x46,
+    0x69, 0x44, 0x43, 0x32, 0x31, 0x39, 0x30, 0x6d, 0x76, 0x50, 0x2f, 0x68,
+    0x70, 0x71, 0x32, 0x78, 0x4c, 0x5a, 0x0a, 0x43, 0x54, 0x62, 0x49, 0x78,
+    0x69, 0x6d, 0x70, 0x6d, 0x61, 0x6f, 0x51, 0x79, 0x78, 0x75, 0x75, 0x48,
+    0x31, 0x62, 0x62, 0x59, 0x75, 0x6e, 0x65, 0x73, 0x49, 0x47, 0x2f, 0x41,
+    0x67, 0x4d, 0x42, 0x41, 0x41, 0x45, 0x43, 0x67, 0x59, 0x41, 0x64, 0x71,
+    0x4a, 0x43, 0x45, 0x7a, 0x4d, 0x49, 0x79, 0x5a, 0x45, 0x37, 0x6f, 0x61,
+    0x57, 0x30, 0x74, 0x4f, 0x70, 0x63, 0x42, 0x30, 0x42, 0x69, 0x50, 0x0a,
+    0x46, 0x59, 0x6f, 0x49, 0x76, 0x48, 0x34, 0x42, 0x4b, 0x52, 0x48, 0x38,
+    0x65, 0x48, 0x76, 0x52, 0x34, 0x37, 0x36, 0x6d, 0x74, 0x2b, 0x59, 0x64,
+    0x44, 0x68, 0x42, 0x50, 0x31, 0x73, 0x63, 0x47, 0x55, 0x6d, 0x59, 0x65,
+    0x43, 0x54, 0x34, 0x45, 0x6a, 0x2b, 0x52, 0x67, 0x48, 0x76, 0x32, 0x4c,
+    0x50, 0x54, 0x67, 0x56, 0x59, 0x77, 0x54, 0x39, 0x65, 0x63, 0x69, 0x50,
+    0x32, 0x2b, 0x45, 0x2f, 0x0a, 0x43, 0x42, 0x43, 0x4e, 0x52, 0x65, 0x6c,
+    0x30, 0x53, 0x77, 0x39, 0x4a, 0x65, 0x70, 0x77, 0x57, 0x30, 0x72, 0x2b,
+    0x6a, 0x57, 0x4a, 0x74, 0x44, 0x59, 0x31, 0x70, 0x70, 0x36, 0x59, 0x58,
+    0x41, 0x67, 0x4e, 0x52, 0x47, 0x58, 0x32, 0x55, 0x66, 0x6c, 0x76, 0x55,
+    0x73, 0x54, 0x2b, 0x6f, 0x39, 0x6c, 0x5a, 0x76, 0x61, 0x67, 0x66, 0x39,
+    0x6d, 0x6f, 0x4c, 0x54, 0x4d, 0x79, 0x47, 0x76, 0x55, 0x0a, 0x75, 0x4c,
+    0x46, 0x6e, 0x73, 0x79, 0x66, 0x4c, 0x69, 0x6d, 0x31, 0x42, 0x34, 0x76,
+    0x58, 0x76, 0x57, 0x51, 0x4a, 0x42, 0x41, 0x4e, 0x6f, 0x75, 0x5a, 0x6c,
+    0x6c, 0x58, 0x47, 0x5a, 0x6f, 0x53, 0x72, 0x5a, 0x4c, 0x74, 0x52, 0x33,
+    0x56, 0x67, 0x56, 0x34, 0x74, 0x7a, 0x52, 0x51, 0x76, 0x4a, 0x78, 0x75,
+    0x38, 0x34, 0x6b, 0x4c, 0x65, 0x49, 0x6b, 0x36, 0x34, 0x4f, 0x76, 0x34,
+    0x37, 0x58, 0x0a, 0x70, 0x48, 0x56, 0x42, 0x4d, 0x54, 0x52, 0x42, 0x66,
+    0x7a, 0x50, 0x45, 0x68, 0x62, 0x42, 0x6f, 0x64, 0x6a, 0x72, 0x31, 0x6d,
+    0x35, 0x4f, 0x4c, 0x61, 0x56, 0x4c, 0x71, 0x6b, 0x46, 0x63, 0x58, 0x66,
+    0x74, 0x7a, 0x52, 0x43, 0x72, 0x62, 0x57, 0x6f, 0x4b, 0x73, 0x43, 0x51,
+    0x51, 0x44, 0x52, 0x53, 0x6f, 0x4c, 0x4c, 0x58, 0x4f, 0x69, 0x4c, 0x72,
+    0x74, 0x4a, 0x33, 0x44, 0x4c, 0x4a, 0x43, 0x0a, 0x72, 0x58, 0x37, 0x59,
+    0x38, 0x77, 0x72, 0x48, 0x5a, 0x72, 0x71, 0x6b, 0x35, 0x62, 0x4d, 0x64,
+    0x5a, 0x4c, 0x47, 0x61, 0x2f, 0x55, 0x58, 0x38, 0x52, 0x61, 0x6e, 0x68,
+    0x56, 0x77, 0x33, 0x2b, 0x58, 0x70, 0x2b, 0x75, 0x72, 0x64, 0x31, 0x37,
+    0x31, 0x31, 0x75, 0x6d, 0x65, 0x4e, 0x4a, 0x66, 0x7a, 0x75, 0x2f, 0x4d,
+    0x43, 0x6b, 0x34, 0x61, 0x31, 0x4b, 0x6b, 0x47, 0x2f, 0x43, 0x55, 0x30,
+    0x0a, 0x72, 0x71, 0x73, 0x39, 0x41, 0x6b, 0x41, 0x34, 0x63, 0x53, 0x78,
+    0x31, 0x44, 0x44, 0x31, 0x4a, 0x53, 0x47, 0x2b, 0x79, 0x78, 0x4d, 0x4e,
+    0x70, 0x73, 0x41, 0x53, 0x31, 0x78, 0x4a, 0x6f, 0x6d, 0x46, 0x49, 0x72,
+    0x73, 0x4d, 0x39, 0x76, 0x73, 0x50, 0x74, 0x37, 0x46, 0x64, 0x6e, 0x64,
+    0x44, 0x77, 0x72, 0x46, 0x2b, 0x79, 0x2b, 0x43, 0x6f, 0x76, 0x68, 0x44,
+    0x6b, 0x47, 0x59, 0x44, 0x6b, 0x0a, 0x52, 0x41, 0x48, 0x68, 0x2b, 0x73,
+    0x76, 0x47, 0x66, 0x5a, 0x67, 0x2f, 0x70, 0x51, 0x4b, 0x32, 0x4a, 0x52,
+    0x50, 0x69, 0x6d, 0x41, 0x6d, 0x48, 0x68, 0x7a, 0x71, 0x46, 0x41, 0x6b,
+    0x45, 0x41, 0x75, 0x36, 0x59, 0x61, 0x37, 0x30, 0x73, 0x32, 0x46, 0x55,
+    0x65, 0x42, 0x33, 0x4d, 0x75, 0x39, 0x61, 0x4a, 0x73, 0x32, 0x43, 0x44,
+    0x36, 0x68, 0x67, 0x33, 0x64, 0x51, 0x45, 0x56, 0x6b, 0x42, 0x0a, 0x35,
+    0x33, 0x44, 0x49, 0x37, 0x54, 0x58, 0x34, 0x38, 0x64, 0x39, 0x6b, 0x47,
+    0x57, 0x35, 0x38, 0x56, 0x58, 0x31, 0x78, 0x6e, 0x71, 0x53, 0x30, 0x32,
+    0x4c, 0x79, 0x57, 0x71, 0x41, 0x50, 0x63, 0x57, 0x35, 0x71, 0x6d, 0x31,
+    0x6b, 0x4c, 0x48, 0x46, 0x4c, 0x64, 0x6e, 0x64, 0x61, 0x50, 0x4e, 0x6d,
+    0x42, 0x61, 0x6a, 0x34, 0x51, 0x4a, 0x42, 0x41, 0x4a, 0x75, 0x67, 0x6c,
+    0x33, 0x36, 0x37, 0x0a, 0x39, 0x64, 0x39, 0x74, 0x2f, 0x51, 0x4c, 0x54,
+    0x53, 0x75, 0x55, 0x4c, 0x4c, 0x61, 0x6f, 0x59, 0x76, 0x32, 0x76, 0x4a,
+    0x54, 0x33, 0x73, 0x31, 0x79, 0x39, 0x48, 0x4e, 0x38, 0x39, 0x45, 0x6f,
+    0x61, 0x44, 0x44, 0x45, 0x6b, 0x50, 0x56, 0x66, 0x51, 0x75, 0x36, 0x47,
+    0x56, 0x45, 0x58, 0x67, 0x49, 0x42, 0x74, 0x69, 0x6d, 0x31, 0x73, 0x49,
+    0x2f, 0x56, 0x50, 0x53, 0x7a, 0x49, 0x38, 0x48, 0x0a, 0x61, 0x58, 0x76,
+    0x61, 0x54, 0x55, 0x77, 0x62, 0x6c, 0x46, 0x57, 0x53, 0x4d, 0x37, 0x30,
+    0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x50,
+    0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d,
+    0x2d, 0x2d, 0x2d, 0x0a, 0x00};
+
+extern "C" const char test_signed_client_cert[] = {
+    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
+    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
+    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x48, 0x7a, 0x43, 0x43,
+    0x41, 0x59, 0x67, 0x43, 0x41, 0x51, 0x45, 0x77, 0x44, 0x51, 0x59, 0x4a,
+    0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46,
+    0x42, 0x51, 0x41, 0x77, 0x56, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47,
+    0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x51, 0x56, 0x55, 0x78,
+    0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x67,
+    0x4d, 0x43, 0x6c, 0x4e, 0x76, 0x62, 0x57, 0x55, 0x74, 0x55, 0x33, 0x52,
+    0x68, 0x64, 0x47, 0x55, 0x78, 0x49, 0x54, 0x41, 0x66, 0x42, 0x67, 0x4e,
+    0x56, 0x42, 0x41, 0x6f, 0x4d, 0x47, 0x45, 0x6c, 0x75, 0x64, 0x47, 0x56,
+    0x79, 0x62, 0x6d, 0x56, 0x30, 0x49, 0x46, 0x64, 0x70, 0x5a, 0x47, 0x64,
+    0x70, 0x64, 0x48, 0x4d, 0x67, 0x55, 0x48, 0x52, 0x35, 0x49, 0x45, 0x78,
+    0x30, 0x0a, 0x5a, 0x44, 0x45, 0x50, 0x4d, 0x41, 0x30, 0x47, 0x41, 0x31,
+    0x55, 0x45, 0x41, 0x77, 0x77, 0x47, 0x64, 0x47, 0x56, 0x7a, 0x64, 0x47,
+    0x4e, 0x68, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x30, 0x4d, 0x44,
+    0x63, 0x78, 0x4e, 0x7a, 0x49, 0x7a, 0x4e, 0x54, 0x59, 0x77, 0x4d, 0x6c,
+    0x6f, 0x58, 0x44, 0x54, 0x49, 0x30, 0x4d, 0x44, 0x63, 0x78, 0x4e, 0x44,
+    0x49, 0x7a, 0x4e, 0x54, 0x59, 0x77, 0x0a, 0x4d, 0x6c, 0x6f, 0x77, 0x57,
+    0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42,
+    0x68, 0x4d, 0x43, 0x51, 0x56, 0x55, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42,
+    0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, 0x43, 0x6c, 0x4e, 0x76, 0x62,
+    0x57, 0x55, 0x74, 0x55, 0x33, 0x52, 0x68, 0x64, 0x47, 0x55, 0x78, 0x49,
+    0x54, 0x41, 0x66, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x0a,
+    0x47, 0x45, 0x6c, 0x75, 0x64, 0x47, 0x56, 0x79, 0x62, 0x6d, 0x56, 0x30,
+    0x49, 0x46, 0x64, 0x70, 0x5a, 0x47, 0x64, 0x70, 0x64, 0x48, 0x4d, 0x67,
+    0x55, 0x48, 0x52, 0x35, 0x49, 0x45, 0x78, 0x30, 0x5a, 0x44, 0x45, 0x54,
+    0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x4b,
+    0x64, 0x47, 0x56, 0x7a, 0x64, 0x47, 0x4e, 0x73, 0x61, 0x57, 0x56, 0x75,
+    0x64, 0x44, 0x43, 0x42, 0x0a, 0x6e, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b,
+    0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45,
+    0x46, 0x41, 0x41, 0x4f, 0x42, 0x6a, 0x51, 0x41, 0x77, 0x67, 0x59, 0x6b,
+    0x43, 0x67, 0x59, 0x45, 0x41, 0x37, 0x46, 0x52, 0x48, 0x32, 0x36, 0x47,
+    0x2b, 0x46, 0x74, 0x35, 0x56, 0x51, 0x67, 0x79, 0x7a, 0x6c, 0x5a, 0x73,
+    0x66, 0x53, 0x6e, 0x48, 0x53, 0x5a, 0x36, 0x47, 0x58, 0x0a, 0x62, 0x37,
+    0x71, 0x78, 0x6d, 0x6b, 0x32, 0x50, 0x4f, 0x38, 0x54, 0x59, 0x71, 0x4b,
+    0x5a, 0x6d, 0x6b, 0x66, 0x4d, 0x77, 0x6b, 0x65, 0x36, 0x52, 0x55, 0x66,
+    0x51, 0x56, 0x2b, 0x53, 0x2b, 0x47, 0x7a, 0x52, 0x76, 0x7a, 0x35, 0x4c,
+    0x6c, 0x53, 0x33, 0x31, 0x55, 0x31, 0x51, 0x43, 0x70, 0x33, 0x63, 0x67,
+    0x77, 0x6b, 0x49, 0x49, 0x41, 0x51, 0x61, 0x31, 0x45, 0x32, 0x68, 0x43,
+    0x45, 0x7a, 0x0a, 0x57, 0x33, 0x31, 0x69, 0x76, 0x62, 0x4d, 0x42, 0x79,
+    0x52, 0x4b, 0x39, 0x74, 0x46, 0x70, 0x79, 0x6e, 0x34, 0x55, 0x76, 0x38,
+    0x4b, 0x50, 0x31, 0x34, 0x4f, 0x62, 0x4b, 0x6a, 0x54, 0x51, 0x71, 0x78,
+    0x55, 0x5a, 0x70, 0x35, 0x35, 0x38, 0x44, 0x67, 0x4f, 0x48, 0x67, 0x35,
+    0x62, 0x35, 0x6d, 0x47, 0x52, 0x4d, 0x30, 0x70, 0x79, 0x56, 0x31, 0x65,
+    0x71, 0x52, 0x4b, 0x36, 0x50, 0x57, 0x77, 0x0a, 0x52, 0x2f, 0x62, 0x6a,
+    0x67, 0x6c, 0x6c, 0x69, 0x36, 0x70, 0x6d, 0x6e, 0x72, 0x2b, 0x30, 0x43,
+    0x41, 0x77, 0x45, 0x41, 0x41, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71,
+    0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46,
+    0x41, 0x41, 0x4f, 0x42, 0x67, 0x51, 0x41, 0x53, 0x74, 0x53, 0x6d, 0x35,
+    0x50, 0x4d, 0x37, 0x75, 0x62, 0x52, 0x4f, 0x69, 0x4b, 0x4b, 0x36, 0x2f,
+    0x0a, 0x54, 0x32, 0x46, 0x6b, 0x4b, 0x6c, 0x68, 0x69, 0x54, 0x4f, 0x78,
+    0x2b, 0x52, 0x79, 0x65, 0x6e, 0x6d, 0x33, 0x45, 0x69, 0x6f, 0x35, 0x39,
+    0x65, 0x6d, 0x71, 0x2b, 0x6a, 0x58, 0x6c, 0x2b, 0x31, 0x6e, 0x68, 0x50,
+    0x79, 0x53, 0x58, 0x35, 0x47, 0x32, 0x50, 0x51, 0x7a, 0x53, 0x52, 0x35,
+    0x76, 0x64, 0x31, 0x64, 0x49, 0x68, 0x77, 0x67, 0x5a, 0x53, 0x52, 0x34,
+    0x47, 0x79, 0x74, 0x74, 0x6b, 0x0a, 0x74, 0x52, 0x5a, 0x35, 0x37, 0x6b,
+    0x2f, 0x4e, 0x49, 0x31, 0x62, 0x72, 0x55, 0x57, 0x38, 0x6a, 0x6f, 0x69,
+    0x45, 0x4f, 0x4d, 0x4a, 0x41, 0x2f, 0x4d, 0x72, 0x37, 0x48, 0x37, 0x61,
+    0x73, 0x78, 0x37, 0x77, 0x49, 0x52, 0x59, 0x44, 0x45, 0x39, 0x31, 0x46,
+    0x73, 0x38, 0x47, 0x6b, 0x4b, 0x57, 0x64, 0x35, 0x4c, 0x68, 0x6f, 0x50,
+    0x41, 0x51, 0x6a, 0x2b, 0x71, 0x64, 0x47, 0x33, 0x35, 0x43, 0x0a, 0x4f,
+    0x4f, 0x2b, 0x73, 0x76, 0x64, 0x6b, 0x6d, 0x71, 0x48, 0x30, 0x4b, 0x5a,
+    0x6f, 0x33, 0x32, 0x30, 0x5a, 0x55, 0x71, 0x64, 0x6c, 0x32, 0x6f, 0x6f,
+    0x51, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44,
+    0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45,
+    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00};
+
+extern "C" const char test_signed_client_key[] = {
+    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x50,
+    0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d,
+    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x65, 0x51, 0x49, 0x42,
+    0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47,
+    0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x53, 0x43,
+    0x41, 0x6d, 0x4d, 0x77, 0x67, 0x67, 0x4a, 0x66, 0x41, 0x67, 0x45, 0x41,
+    0x41, 0x6f, 0x47, 0x42, 0x41, 0x4f, 0x78, 0x55, 0x52, 0x39, 0x75, 0x68,
+    0x76, 0x68, 0x62, 0x65, 0x56, 0x55, 0x49, 0x4d, 0x0a, 0x73, 0x35, 0x57,
+    0x62, 0x48, 0x30, 0x70, 0x78, 0x30, 0x6d, 0x65, 0x68, 0x6c, 0x32, 0x2b,
+    0x36, 0x73, 0x5a, 0x70, 0x4e, 0x6a, 0x7a, 0x76, 0x45, 0x32, 0x4b, 0x69,
+    0x6d, 0x5a, 0x70, 0x48, 0x7a, 0x4d, 0x4a, 0x48, 0x75, 0x6b, 0x56, 0x48,
+    0x30, 0x46, 0x66, 0x6b, 0x76, 0x68, 0x73, 0x30, 0x62, 0x38, 0x2b, 0x53,
+    0x35, 0x55, 0x74, 0x39, 0x56, 0x4e, 0x55, 0x41, 0x71, 0x64, 0x33, 0x49,
+    0x4d, 0x0a, 0x4a, 0x43, 0x43, 0x41, 0x45, 0x47, 0x74, 0x52, 0x4e, 0x6f,
+    0x51, 0x68, 0x4d, 0x31, 0x74, 0x39, 0x59, 0x72, 0x32, 0x7a, 0x41, 0x63,
+    0x6b, 0x53, 0x76, 0x62, 0x52, 0x61, 0x63, 0x70, 0x2b, 0x46, 0x4c, 0x2f,
+    0x43, 0x6a, 0x39, 0x65, 0x44, 0x6d, 0x79, 0x6f, 0x30, 0x30, 0x4b, 0x73,
+    0x56, 0x47, 0x61, 0x65, 0x65, 0x66, 0x41, 0x34, 0x44, 0x68, 0x34, 0x4f,
+    0x57, 0x2b, 0x5a, 0x68, 0x6b, 0x54, 0x0a, 0x4e, 0x4b, 0x63, 0x6c, 0x64,
+    0x58, 0x71, 0x6b, 0x53, 0x75, 0x6a, 0x31, 0x73, 0x45, 0x66, 0x32, 0x34,
+    0x34, 0x4a, 0x5a, 0x59, 0x75, 0x71, 0x5a, 0x70, 0x36, 0x2f, 0x74, 0x41,
+    0x67, 0x4d, 0x42, 0x41, 0x41, 0x45, 0x43, 0x67, 0x59, 0x45, 0x41, 0x69,
+    0x32, 0x4e, 0x53, 0x56, 0x71, 0x70, 0x5a, 0x4d, 0x61, 0x66, 0x45, 0x35,
+    0x59, 0x59, 0x55, 0x54, 0x63, 0x4d, 0x47, 0x65, 0x36, 0x51, 0x53, 0x0a,
+    0x6b, 0x32, 0x6a, 0x74, 0x70, 0x73, 0x71, 0x59, 0x67, 0x67, 0x67, 0x49,
+    0x32, 0x52, 0x6e, 0x4c, 0x4a, 0x2f, 0x32, 0x74, 0x4e, 0x5a, 0x77, 0x59,
+    0x49, 0x35, 0x70, 0x77, 0x50, 0x38, 0x51, 0x56, 0x53, 0x62, 0x6e, 0x4d,
+    0x61, 0x69, 0x46, 0x34, 0x67, 0x6f, 0x6b, 0x44, 0x35, 0x68, 0x47, 0x64,
+    0x72, 0x4e, 0x44, 0x66, 0x54, 0x6e, 0x62, 0x32, 0x76, 0x2b, 0x79, 0x49,
+    0x77, 0x59, 0x45, 0x48, 0x0a, 0x30, 0x77, 0x38, 0x2b, 0x6f, 0x47, 0x37,
+    0x5a, 0x38, 0x31, 0x4b, 0x6f, 0x64, 0x73, 0x69, 0x5a, 0x53, 0x49, 0x44,
+    0x4a, 0x66, 0x54, 0x47, 0x73, 0x41, 0x5a, 0x68, 0x56, 0x4e, 0x77, 0x4f,
+    0x7a, 0x39, 0x79, 0x30, 0x56, 0x44, 0x38, 0x42, 0x42, 0x5a, 0x5a, 0x31,
+    0x2f, 0x32, 0x37, 0x34, 0x5a, 0x68, 0x35, 0x32, 0x41, 0x55, 0x4b, 0x4c,
+    0x6a, 0x5a, 0x53, 0x2f, 0x5a, 0x77, 0x49, 0x62, 0x53, 0x0a, 0x57, 0x32,
+    0x79, 0x77, 0x79, 0x61, 0x38, 0x35, 0x35, 0x64, 0x50, 0x6e, 0x48, 0x2f,
+    0x77, 0x6a, 0x2b, 0x30, 0x45, 0x43, 0x51, 0x51, 0x44, 0x39, 0x58, 0x38,
+    0x44, 0x39, 0x32, 0x30, 0x6b, 0x42, 0x79, 0x54, 0x4e, 0x48, 0x68, 0x42,
+    0x47, 0x31, 0x38, 0x62, 0x69, 0x41, 0x45, 0x5a, 0x34, 0x70, 0x78, 0x73,
+    0x39, 0x66, 0x30, 0x4f, 0x41, 0x47, 0x38, 0x33, 0x33, 0x33, 0x65, 0x56,
+    0x63, 0x49, 0x0a, 0x77, 0x32, 0x6c, 0x4a, 0x44, 0x4c, 0x73, 0x59, 0x44,
+    0x5a, 0x72, 0x43, 0x42, 0x32, 0x6f, 0x63, 0x67, 0x41, 0x33, 0x6c, 0x55,
+    0x64, 0x6f, 0x7a, 0x6c, 0x7a, 0x50, 0x43, 0x37, 0x59, 0x44, 0x59, 0x77,
+    0x38, 0x72, 0x65, 0x67, 0x30, 0x74, 0x6b, 0x69, 0x52, 0x59, 0x35, 0x41,
+    0x6b, 0x45, 0x41, 0x37, 0x73, 0x64, 0x4e, 0x7a, 0x4f, 0x65, 0x51, 0x73,
+    0x51, 0x52, 0x6e, 0x37, 0x2b, 0x2b, 0x35, 0x0a, 0x30, 0x62, 0x50, 0x39,
+    0x44, 0x74, 0x54, 0x2f, 0x69, 0x4f, 0x4e, 0x31, 0x67, 0x62, 0x66, 0x78,
+    0x52, 0x7a, 0x43, 0x66, 0x43, 0x66, 0x58, 0x64, 0x6f, 0x4f, 0x74, 0x66,
+    0x51, 0x57, 0x49, 0x7a, 0x54, 0x65, 0x50, 0x57, 0x74, 0x55, 0x52, 0x74,
+    0x39, 0x58, 0x2f, 0x35, 0x44, 0x39, 0x4e, 0x6f, 0x66, 0x49, 0x30, 0x52,
+    0x67, 0x35, 0x57, 0x32, 0x6f, 0x47, 0x79, 0x2f, 0x4d, 0x4c, 0x65, 0x35,
+    0x0a, 0x2f, 0x73, 0x58, 0x48, 0x56, 0x51, 0x4a, 0x42, 0x41, 0x49, 0x75,
+    0x70, 0x35, 0x58, 0x72, 0x4a, 0x44, 0x6b, 0x51, 0x79, 0x77, 0x4e, 0x5a,
+    0x79, 0x41, 0x55, 0x55, 0x32, 0x65, 0x63, 0x6e, 0x32, 0x62, 0x43, 0x57,
+    0x42, 0x46, 0x6a, 0x77, 0x74, 0x71, 0x64, 0x2b, 0x4c, 0x42, 0x6d, 0x75,
+    0x4d, 0x63, 0x69, 0x49, 0x39, 0x66, 0x4f, 0x4b, 0x73, 0x5a, 0x74, 0x45,
+    0x4b, 0x5a, 0x72, 0x7a, 0x2f, 0x0a, 0x55, 0x30, 0x6c, 0x6b, 0x65, 0x4d,
+    0x52, 0x6f, 0x53, 0x77, 0x76, 0x58, 0x45, 0x38, 0x77, 0x6d, 0x47, 0x4c,
+    0x6a, 0x6a, 0x72, 0x41, 0x62, 0x64, 0x66, 0x6f, 0x68, 0x72, 0x58, 0x46,
+    0x6b, 0x43, 0x51, 0x51, 0x44, 0x5a, 0x45, 0x78, 0x2f, 0x4c, 0x74, 0x49,
+    0x6c, 0x36, 0x4a, 0x49, 0x4e, 0x4a, 0x51, 0x69, 0x73, 0x77, 0x56, 0x65,
+    0x30, 0x74, 0x57, 0x72, 0x36, 0x6b, 0x2b, 0x41, 0x53, 0x50, 0x0a, 0x31,
+    0x57, 0x58, 0x6f, 0x54, 0x6d, 0x2b, 0x48, 0x59, 0x70, 0x6f, 0x46, 0x2f,
+    0x58, 0x55, 0x76, 0x76, 0x39, 0x4c, 0x63, 0x63, 0x4e, 0x46, 0x31, 0x49,
+    0x61, 0x7a, 0x46, 0x6a, 0x33, 0x34, 0x68, 0x77, 0x52, 0x51, 0x77, 0x68,
+    0x78, 0x37, 0x77, 0x2f, 0x56, 0x35, 0x32, 0x49, 0x65, 0x62, 0x2b, 0x70,
+    0x30, 0x6a, 0x55, 0x4d, 0x59, 0x47, 0x78, 0x41, 0x6b, 0x45, 0x41, 0x6a,
+    0x44, 0x68, 0x64, 0x0a, 0x39, 0x70, 0x42, 0x4f, 0x31, 0x66, 0x4b, 0x58,
+    0x57, 0x69, 0x58, 0x7a, 0x69, 0x39, 0x5a, 0x4b, 0x66, 0x6f, 0x79, 0x54,
+    0x4e, 0x63, 0x55, 0x71, 0x33, 0x65, 0x42, 0x53, 0x56, 0x4b, 0x77, 0x50,
+    0x47, 0x32, 0x6e, 0x49, 0x74, 0x67, 0x35, 0x79, 0x63, 0x58, 0x65, 0x6e,
+    0x67, 0x6a, 0x54, 0x35, 0x73, 0x67, 0x63, 0x57, 0x44, 0x6e, 0x63, 0x69,
+    0x49, 0x7a, 0x57, 0x37, 0x42, 0x49, 0x56, 0x49, 0x0a, 0x4a, 0x69, 0x71,
+    0x4f, 0x73, 0x7a, 0x71, 0x39, 0x47, 0x57, 0x45, 0x53, 0x45, 0x72, 0x41,
+    0x61, 0x74, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45,
+    0x4e, 0x44, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
+    0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00};
diff --git a/test/core/end2end/data/server1_cert.c b/test/core/end2end/data/server1_cert.c
deleted file mode 100644
index 8d14960..0000000
--- a/test/core/end2end/data/server1_cert.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-const char test_server1_cert[] = {
-    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
-    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
-    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x6e, 0x44, 0x43, 0x43,
-    0x41, 0x67, 0x57, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42,
-    0x42, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47,
-    0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x57,
-    0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47,
-    0x45, 0x77, 0x4a, 0x42, 0x56, 0x54, 0x45, 0x54, 0x0a, 0x4d, 0x42, 0x45,
-    0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x42, 0x4d, 0x4b, 0x55, 0x32, 0x39,
-    0x74, 0x5a, 0x53, 0x31, 0x54, 0x64, 0x47, 0x46, 0x30, 0x5a, 0x54, 0x45,
-    0x68, 0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d,
-    0x59, 0x53, 0x57, 0x35, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x5a, 0x58, 0x51,
-    0x67, 0x56, 0x32, 0x6c, 0x6b, 0x5a, 0x32, 0x6c, 0x30, 0x63, 0x79, 0x42,
-    0x51, 0x0a, 0x64, 0x48, 0x6b, 0x67, 0x54, 0x48, 0x52, 0x6b, 0x4d, 0x51,
-    0x38, 0x77, 0x44, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x77,
-    0x5a, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x59, 0x32, 0x45, 0x77, 0x48, 0x68,
-    0x63, 0x4e, 0x4d, 0x54, 0x55, 0x78, 0x4d, 0x54, 0x41, 0x30, 0x4d, 0x44,
-    0x49, 0x79, 0x4d, 0x44, 0x49, 0x30, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a,
-    0x55, 0x78, 0x4d, 0x54, 0x41, 0x78, 0x0a, 0x4d, 0x44, 0x49, 0x79, 0x4d,
-    0x44, 0x49, 0x30, 0x57, 0x6a, 0x42, 0x6c, 0x4d, 0x51, 0x73, 0x77, 0x43,
-    0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55,
-    0x7a, 0x45, 0x52, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43,
-    0x42, 0x4d, 0x49, 0x53, 0x57, 0x78, 0x73, 0x61, 0x57, 0x35, 0x76, 0x61,
-    0x58, 0x4d, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x0a,
-    0x42, 0x41, 0x63, 0x54, 0x42, 0x30, 0x4e, 0x6f, 0x61, 0x57, 0x4e, 0x68,
-    0x5a, 0x32, 0x38, 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56,
-    0x42, 0x41, 0x6f, 0x54, 0x44, 0x45, 0x56, 0x34, 0x59, 0x57, 0x31, 0x77,
-    0x62, 0x47, 0x55, 0x73, 0x49, 0x45, 0x4e, 0x76, 0x4c, 0x6a, 0x45, 0x61,
-    0x4d, 0x42, 0x67, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x51, 0x52,
-    0x4b, 0x69, 0x35, 0x30, 0x0a, 0x5a, 0x58, 0x4e, 0x30, 0x4c, 0x6d, 0x64,
-    0x76, 0x62, 0x32, 0x64, 0x73, 0x5a, 0x53, 0x35, 0x6a, 0x62, 0x32, 0x30,
-    0x77, 0x67, 0x5a, 0x38, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a,
-    0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41,
-    0x44, 0x67, 0x59, 0x30, 0x41, 0x4d, 0x49, 0x47, 0x4a, 0x41, 0x6f, 0x47,
-    0x42, 0x41, 0x4f, 0x48, 0x44, 0x46, 0x53, 0x63, 0x6f, 0x0a, 0x4c, 0x43,
-    0x56, 0x4a, 0x70, 0x59, 0x44, 0x44, 0x4d, 0x34, 0x48, 0x59, 0x74, 0x49,
-    0x64, 0x56, 0x36, 0x41, 0x6b, 0x65, 0x2f, 0x73, 0x4d, 0x4e, 0x61, 0x61,
-    0x4b, 0x64, 0x4f, 0x44, 0x6a, 0x44, 0x4d, 0x73, 0x75, 0x78, 0x2f, 0x34,
-    0x74, 0x44, 0x79, 0x64, 0x6c, 0x75, 0x6d, 0x4e, 0x2b, 0x66, 0x6d, 0x2b,
-    0x41, 0x6a, 0x50, 0x45, 0x4b, 0x35, 0x47, 0x48, 0x68, 0x47, 0x6e, 0x31,
-    0x42, 0x67, 0x0a, 0x7a, 0x6b, 0x57, 0x46, 0x2b, 0x73, 0x6c, 0x66, 0x33,
-    0x42, 0x78, 0x68, 0x72, 0x41, 0x2f, 0x38, 0x64, 0x4e, 0x73, 0x6e, 0x75,
-    0x6e, 0x73, 0x74, 0x56, 0x41, 0x37, 0x5a, 0x42, 0x67, 0x41, 0x2f, 0x35,
-    0x71, 0x51, 0x78, 0x4d, 0x66, 0x47, 0x41, 0x71, 0x34, 0x77, 0x48, 0x4e,
-    0x56, 0x58, 0x37, 0x37, 0x66, 0x42, 0x5a, 0x4f, 0x67, 0x70, 0x39, 0x56,
-    0x6c, 0x53, 0x4d, 0x56, 0x66, 0x79, 0x64, 0x0a, 0x39, 0x4e, 0x38, 0x59,
-    0x77, 0x62, 0x42, 0x59, 0x41, 0x63, 0x6b, 0x4f, 0x65, 0x55, 0x51, 0x61,
-    0x64, 0x54, 0x69, 0x32, 0x58, 0x31, 0x53, 0x36, 0x4f, 0x67, 0x4a, 0x58,
-    0x67, 0x51, 0x30, 0x6d, 0x33, 0x4d, 0x57, 0x68, 0x41, 0x67, 0x4d, 0x42,
-    0x41, 0x41, 0x47, 0x6a, 0x61, 0x7a, 0x42, 0x70, 0x4d, 0x41, 0x6b, 0x47,
-    0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x51, 0x43, 0x4d, 0x41, 0x41, 0x77,
-    0x0a, 0x43, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x42, 0x41, 0x51,
-    0x44, 0x41, 0x67, 0x58, 0x67, 0x4d, 0x45, 0x38, 0x47, 0x41, 0x31, 0x55,
-    0x64, 0x45, 0x51, 0x52, 0x49, 0x4d, 0x45, 0x61, 0x43, 0x45, 0x43, 0x6f,
-    0x75, 0x64, 0x47, 0x56, 0x7a, 0x64, 0x43, 0x35, 0x6e, 0x62, 0x32, 0x39,
-    0x6e, 0x62, 0x47, 0x55, 0x75, 0x5a, 0x6e, 0x4b, 0x43, 0x47, 0x48, 0x64,
-    0x68, 0x64, 0x47, 0x56, 0x79, 0x0a, 0x65, 0x6d, 0x39, 0x76, 0x61, 0x53,
-    0x35, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x4c, 0x6d, 0x64, 0x76, 0x62, 0x32,
-    0x64, 0x73, 0x5a, 0x53, 0x35, 0x69, 0x5a, 0x59, 0x49, 0x53, 0x4b, 0x69,
-    0x35, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x4c, 0x6e, 0x6c, 0x76, 0x64, 0x58,
-    0x52, 0x31, 0x59, 0x6d, 0x55, 0x75, 0x59, 0x32, 0x39, 0x74, 0x68, 0x77,
-    0x54, 0x41, 0x71, 0x41, 0x45, 0x44, 0x4d, 0x41, 0x30, 0x47, 0x0a, 0x43,
-    0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43,
-    0x77, 0x55, 0x41, 0x41, 0x34, 0x47, 0x42, 0x41, 0x4a, 0x46, 0x58, 0x56,
-    0x69, 0x66, 0x51, 0x4e, 0x75, 0x62, 0x31, 0x4c, 0x55, 0x50, 0x34, 0x4a,
-    0x6c, 0x6e, 0x58, 0x35, 0x6c, 0x58, 0x4e, 0x6c, 0x6f, 0x38, 0x46, 0x78,
-    0x5a, 0x32, 0x61, 0x31, 0x32, 0x41, 0x46, 0x51, 0x73, 0x2b, 0x62, 0x7a,
-    0x6f, 0x4a, 0x36, 0x0a, 0x68, 0x4d, 0x30, 0x34, 0x34, 0x45, 0x44, 0x6a,
-    0x71, 0x79, 0x78, 0x55, 0x71, 0x53, 0x62, 0x56, 0x65, 0x50, 0x4b, 0x30,
-    0x6e, 0x69, 0x33, 0x77, 0x31, 0x66, 0x48, 0x51, 0x42, 0x35, 0x72, 0x59,
-    0x39, 0x79, 0x59, 0x43, 0x35, 0x66, 0x38, 0x47, 0x37, 0x61, 0x71, 0x71,
-    0x54, 0x59, 0x31, 0x51, 0x4f, 0x68, 0x6f, 0x55, 0x6b, 0x38, 0x5a, 0x54,
-    0x53, 0x54, 0x52, 0x70, 0x6e, 0x6b, 0x54, 0x68, 0x0a, 0x79, 0x34, 0x6a,
-    0x6a, 0x64, 0x76, 0x54, 0x5a, 0x65, 0x4c, 0x44, 0x56, 0x42, 0x6c, 0x75,
-    0x65, 0x5a, 0x55, 0x54, 0x44, 0x52, 0x6d, 0x79, 0x32, 0x66, 0x65, 0x59,
-    0x35, 0x61, 0x5a, 0x49, 0x55, 0x31, 0x38, 0x76, 0x46, 0x44, 0x4b, 0x30,
-    0x38, 0x64, 0x54, 0x47, 0x30, 0x41, 0x38, 0x37, 0x70, 0x70, 0x70, 0x75,
-    0x76, 0x31, 0x4c, 0x4e, 0x49, 0x52, 0x33, 0x6c, 0x6f, 0x76, 0x65, 0x55,
-    0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43,
-    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
-    0x2d, 0x2d, 0x2d, 0x0a, 0x00};
diff --git a/test/core/end2end/data/server1_cert.cc b/test/core/end2end/data/server1_cert.cc
new file mode 100644
index 0000000..dd09810
--- /dev/null
+++ b/test/core/end2end/data/server1_cert.cc
@@ -0,0 +1,100 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+extern "C" const char test_server1_cert[] = {
+    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
+    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
+    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x6e, 0x44, 0x43, 0x43,
+    0x41, 0x67, 0x57, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42,
+    0x42, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47,
+    0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x57,
+    0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47,
+    0x45, 0x77, 0x4a, 0x42, 0x56, 0x54, 0x45, 0x54, 0x0a, 0x4d, 0x42, 0x45,
+    0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x42, 0x4d, 0x4b, 0x55, 0x32, 0x39,
+    0x74, 0x5a, 0x53, 0x31, 0x54, 0x64, 0x47, 0x46, 0x30, 0x5a, 0x54, 0x45,
+    0x68, 0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d,
+    0x59, 0x53, 0x57, 0x35, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x5a, 0x58, 0x51,
+    0x67, 0x56, 0x32, 0x6c, 0x6b, 0x5a, 0x32, 0x6c, 0x30, 0x63, 0x79, 0x42,
+    0x51, 0x0a, 0x64, 0x48, 0x6b, 0x67, 0x54, 0x48, 0x52, 0x6b, 0x4d, 0x51,
+    0x38, 0x77, 0x44, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x77,
+    0x5a, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x59, 0x32, 0x45, 0x77, 0x48, 0x68,
+    0x63, 0x4e, 0x4d, 0x54, 0x55, 0x78, 0x4d, 0x54, 0x41, 0x30, 0x4d, 0x44,
+    0x49, 0x79, 0x4d, 0x44, 0x49, 0x30, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a,
+    0x55, 0x78, 0x4d, 0x54, 0x41, 0x78, 0x0a, 0x4d, 0x44, 0x49, 0x79, 0x4d,
+    0x44, 0x49, 0x30, 0x57, 0x6a, 0x42, 0x6c, 0x4d, 0x51, 0x73, 0x77, 0x43,
+    0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55,
+    0x7a, 0x45, 0x52, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43,
+    0x42, 0x4d, 0x49, 0x53, 0x57, 0x78, 0x73, 0x61, 0x57, 0x35, 0x76, 0x61,
+    0x58, 0x4d, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x0a,
+    0x42, 0x41, 0x63, 0x54, 0x42, 0x30, 0x4e, 0x6f, 0x61, 0x57, 0x4e, 0x68,
+    0x5a, 0x32, 0x38, 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56,
+    0x42, 0x41, 0x6f, 0x54, 0x44, 0x45, 0x56, 0x34, 0x59, 0x57, 0x31, 0x77,
+    0x62, 0x47, 0x55, 0x73, 0x49, 0x45, 0x4e, 0x76, 0x4c, 0x6a, 0x45, 0x61,
+    0x4d, 0x42, 0x67, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x51, 0x52,
+    0x4b, 0x69, 0x35, 0x30, 0x0a, 0x5a, 0x58, 0x4e, 0x30, 0x4c, 0x6d, 0x64,
+    0x76, 0x62, 0x32, 0x64, 0x73, 0x5a, 0x53, 0x35, 0x6a, 0x62, 0x32, 0x30,
+    0x77, 0x67, 0x5a, 0x38, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a,
+    0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41,
+    0x44, 0x67, 0x59, 0x30, 0x41, 0x4d, 0x49, 0x47, 0x4a, 0x41, 0x6f, 0x47,
+    0x42, 0x41, 0x4f, 0x48, 0x44, 0x46, 0x53, 0x63, 0x6f, 0x0a, 0x4c, 0x43,
+    0x56, 0x4a, 0x70, 0x59, 0x44, 0x44, 0x4d, 0x34, 0x48, 0x59, 0x74, 0x49,
+    0x64, 0x56, 0x36, 0x41, 0x6b, 0x65, 0x2f, 0x73, 0x4d, 0x4e, 0x61, 0x61,
+    0x4b, 0x64, 0x4f, 0x44, 0x6a, 0x44, 0x4d, 0x73, 0x75, 0x78, 0x2f, 0x34,
+    0x74, 0x44, 0x79, 0x64, 0x6c, 0x75, 0x6d, 0x4e, 0x2b, 0x66, 0x6d, 0x2b,
+    0x41, 0x6a, 0x50, 0x45, 0x4b, 0x35, 0x47, 0x48, 0x68, 0x47, 0x6e, 0x31,
+    0x42, 0x67, 0x0a, 0x7a, 0x6b, 0x57, 0x46, 0x2b, 0x73, 0x6c, 0x66, 0x33,
+    0x42, 0x78, 0x68, 0x72, 0x41, 0x2f, 0x38, 0x64, 0x4e, 0x73, 0x6e, 0x75,
+    0x6e, 0x73, 0x74, 0x56, 0x41, 0x37, 0x5a, 0x42, 0x67, 0x41, 0x2f, 0x35,
+    0x71, 0x51, 0x78, 0x4d, 0x66, 0x47, 0x41, 0x71, 0x34, 0x77, 0x48, 0x4e,
+    0x56, 0x58, 0x37, 0x37, 0x66, 0x42, 0x5a, 0x4f, 0x67, 0x70, 0x39, 0x56,
+    0x6c, 0x53, 0x4d, 0x56, 0x66, 0x79, 0x64, 0x0a, 0x39, 0x4e, 0x38, 0x59,
+    0x77, 0x62, 0x42, 0x59, 0x41, 0x63, 0x6b, 0x4f, 0x65, 0x55, 0x51, 0x61,
+    0x64, 0x54, 0x69, 0x32, 0x58, 0x31, 0x53, 0x36, 0x4f, 0x67, 0x4a, 0x58,
+    0x67, 0x51, 0x30, 0x6d, 0x33, 0x4d, 0x57, 0x68, 0x41, 0x67, 0x4d, 0x42,
+    0x41, 0x41, 0x47, 0x6a, 0x61, 0x7a, 0x42, 0x70, 0x4d, 0x41, 0x6b, 0x47,
+    0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x51, 0x43, 0x4d, 0x41, 0x41, 0x77,
+    0x0a, 0x43, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x42, 0x41, 0x51,
+    0x44, 0x41, 0x67, 0x58, 0x67, 0x4d, 0x45, 0x38, 0x47, 0x41, 0x31, 0x55,
+    0x64, 0x45, 0x51, 0x52, 0x49, 0x4d, 0x45, 0x61, 0x43, 0x45, 0x43, 0x6f,
+    0x75, 0x64, 0x47, 0x56, 0x7a, 0x64, 0x43, 0x35, 0x6e, 0x62, 0x32, 0x39,
+    0x6e, 0x62, 0x47, 0x55, 0x75, 0x5a, 0x6e, 0x4b, 0x43, 0x47, 0x48, 0x64,
+    0x68, 0x64, 0x47, 0x56, 0x79, 0x0a, 0x65, 0x6d, 0x39, 0x76, 0x61, 0x53,
+    0x35, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x4c, 0x6d, 0x64, 0x76, 0x62, 0x32,
+    0x64, 0x73, 0x5a, 0x53, 0x35, 0x69, 0x5a, 0x59, 0x49, 0x53, 0x4b, 0x69,
+    0x35, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x4c, 0x6e, 0x6c, 0x76, 0x64, 0x58,
+    0x52, 0x31, 0x59, 0x6d, 0x55, 0x75, 0x59, 0x32, 0x39, 0x74, 0x68, 0x77,
+    0x54, 0x41, 0x71, 0x41, 0x45, 0x44, 0x4d, 0x41, 0x30, 0x47, 0x0a, 0x43,
+    0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43,
+    0x77, 0x55, 0x41, 0x41, 0x34, 0x47, 0x42, 0x41, 0x4a, 0x46, 0x58, 0x56,
+    0x69, 0x66, 0x51, 0x4e, 0x75, 0x62, 0x31, 0x4c, 0x55, 0x50, 0x34, 0x4a,
+    0x6c, 0x6e, 0x58, 0x35, 0x6c, 0x58, 0x4e, 0x6c, 0x6f, 0x38, 0x46, 0x78,
+    0x5a, 0x32, 0x61, 0x31, 0x32, 0x41, 0x46, 0x51, 0x73, 0x2b, 0x62, 0x7a,
+    0x6f, 0x4a, 0x36, 0x0a, 0x68, 0x4d, 0x30, 0x34, 0x34, 0x45, 0x44, 0x6a,
+    0x71, 0x79, 0x78, 0x55, 0x71, 0x53, 0x62, 0x56, 0x65, 0x50, 0x4b, 0x30,
+    0x6e, 0x69, 0x33, 0x77, 0x31, 0x66, 0x48, 0x51, 0x42, 0x35, 0x72, 0x59,
+    0x39, 0x79, 0x59, 0x43, 0x35, 0x66, 0x38, 0x47, 0x37, 0x61, 0x71, 0x71,
+    0x54, 0x59, 0x31, 0x51, 0x4f, 0x68, 0x6f, 0x55, 0x6b, 0x38, 0x5a, 0x54,
+    0x53, 0x54, 0x52, 0x70, 0x6e, 0x6b, 0x54, 0x68, 0x0a, 0x79, 0x34, 0x6a,
+    0x6a, 0x64, 0x76, 0x54, 0x5a, 0x65, 0x4c, 0x44, 0x56, 0x42, 0x6c, 0x75,
+    0x65, 0x5a, 0x55, 0x54, 0x44, 0x52, 0x6d, 0x79, 0x32, 0x66, 0x65, 0x59,
+    0x35, 0x61, 0x5a, 0x49, 0x55, 0x31, 0x38, 0x76, 0x46, 0x44, 0x4b, 0x30,
+    0x38, 0x64, 0x54, 0x47, 0x30, 0x41, 0x38, 0x37, 0x70, 0x70, 0x70, 0x75,
+    0x76, 0x31, 0x4c, 0x4e, 0x49, 0x52, 0x33, 0x6c, 0x6f, 0x76, 0x65, 0x55,
+    0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43,
+    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
+    0x2d, 0x2d, 0x2d, 0x0a, 0x00};
diff --git a/test/core/end2end/data/server1_key.c b/test/core/end2end/data/server1_key.c
deleted file mode 100644
index eee5cc6..0000000
--- a/test/core/end2end/data/server1_key.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-const char test_server1_key[] = {
-    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52,
-    0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
-    0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43,
-    0x57, 0x77, 0x49, 0x42, 0x41, 0x41, 0x4b, 0x42, 0x67, 0x51, 0x44, 0x68,
-    0x77, 0x78, 0x55, 0x6e, 0x4b, 0x43, 0x77, 0x6c, 0x53, 0x61, 0x57, 0x41,
-    0x77, 0x7a, 0x4f, 0x42, 0x32, 0x4c, 0x53, 0x48, 0x56, 0x65, 0x67, 0x4a,
-    0x48, 0x76, 0x37, 0x44, 0x44, 0x57, 0x6d, 0x69, 0x6e, 0x54, 0x67, 0x34,
-    0x77, 0x7a, 0x4c, 0x4c, 0x73, 0x66, 0x2b, 0x4c, 0x51, 0x38, 0x6e, 0x5a,
-    0x0a, 0x62, 0x70, 0x6a, 0x66, 0x6e, 0x35, 0x76, 0x67, 0x49, 0x7a, 0x78,
-    0x43, 0x75, 0x52, 0x68, 0x34, 0x52, 0x70, 0x39, 0x51, 0x59, 0x4d, 0x35,
-    0x46, 0x68, 0x66, 0x72, 0x4a, 0x58, 0x39, 0x77, 0x63, 0x59, 0x61, 0x77,
-    0x50, 0x2f, 0x48, 0x54, 0x62, 0x4a, 0x37, 0x70, 0x37, 0x4c, 0x56, 0x51,
-    0x4f, 0x32, 0x51, 0x59, 0x41, 0x50, 0x2b, 0x61, 0x6b, 0x4d, 0x54, 0x48,
-    0x78, 0x67, 0x4b, 0x75, 0x4d, 0x0a, 0x42, 0x7a, 0x56, 0x56, 0x2b, 0x2b,
-    0x33, 0x77, 0x57, 0x54, 0x6f, 0x4b, 0x66, 0x56, 0x5a, 0x55, 0x6a, 0x46,
-    0x58, 0x38, 0x6e, 0x66, 0x54, 0x66, 0x47, 0x4d, 0x47, 0x77, 0x57, 0x41,
-    0x48, 0x4a, 0x44, 0x6e, 0x6c, 0x45, 0x47, 0x6e, 0x55, 0x34, 0x74, 0x6c,
-    0x39, 0x55, 0x75, 0x6a, 0x6f, 0x43, 0x56, 0x34, 0x45, 0x4e, 0x4a, 0x74,
-    0x7a, 0x46, 0x6f, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x0a, 0x41,
-    0x6f, 0x47, 0x41, 0x4a, 0x2b, 0x36, 0x68, 0x70, 0x7a, 0x4e, 0x72, 0x32,
-    0x34, 0x79, 0x54, 0x51, 0x5a, 0x74, 0x46, 0x57, 0x51, 0x70, 0x44, 0x70,
-    0x45, 0x79, 0x46, 0x70, 0x6c, 0x64, 0x64, 0x4b, 0x4a, 0x4d, 0x4f, 0x78,
-    0x44, 0x79, 0x61, 0x33, 0x53, 0x39, 0x70, 0x70, 0x4b, 0x33, 0x76, 0x54,
-    0x57, 0x72, 0x49, 0x49, 0x54, 0x56, 0x32, 0x78, 0x4e, 0x63, 0x75, 0x63,
-    0x77, 0x37, 0x49, 0x0a, 0x63, 0x65, 0x54, 0x62, 0x64, 0x79, 0x72, 0x47,
-    0x73, 0x79, 0x6a, 0x73, 0x55, 0x30, 0x2f, 0x48, 0x64, 0x43, 0x63, 0x49,
-    0x66, 0x39, 0x79, 0x6d, 0x32, 0x6a, 0x66, 0x6d, 0x47, 0x4c, 0x55, 0x77,
-    0x6d, 0x79, 0x68, 0x6c, 0x74, 0x4b, 0x56, 0x77, 0x30, 0x51, 0x59, 0x63,
-    0x46, 0x42, 0x30, 0x58, 0x4c, 0x6b, 0x63, 0x30, 0x6e, 0x49, 0x35, 0x59,
-    0x76, 0x45, 0x59, 0x6f, 0x65, 0x56, 0x44, 0x67, 0x0a, 0x6f, 0x6d, 0x5a,
-    0x49, 0x58, 0x6e, 0x31, 0x45, 0x33, 0x45, 0x57, 0x2b, 0x73, 0x53, 0x49,
-    0x57, 0x53, 0x62, 0x6b, 0x4d, 0x75, 0x39, 0x62, 0x59, 0x32, 0x6b, 0x73,
-    0x74, 0x4b, 0x58, 0x52, 0x32, 0x55, 0x5a, 0x6d, 0x4d, 0x67, 0x57, 0x44,
-    0x74, 0x6d, 0x42, 0x45, 0x50, 0x4d, 0x61, 0x45, 0x43, 0x51, 0x51, 0x44,
-    0x36, 0x79, 0x54, 0x34, 0x54, 0x41, 0x5a, 0x4d, 0x35, 0x68, 0x47, 0x42,
-    0x62, 0x0a, 0x63, 0x69, 0x42, 0x4b, 0x67, 0x4d, 0x55, 0x50, 0x36, 0x50,
-    0x77, 0x4f, 0x68, 0x50, 0x68, 0x4f, 0x4d, 0x50, 0x49, 0x76, 0x69, 0x6a,
-    0x4f, 0x35, 0x30, 0x41, 0x69, 0x75, 0x36, 0x69, 0x75, 0x43, 0x56, 0x38,
-    0x38, 0x6c, 0x31, 0x51, 0x49, 0x79, 0x33, 0x38, 0x67, 0x57, 0x56, 0x68,
-    0x78, 0x6a, 0x4e, 0x72, 0x71, 0x36, 0x50, 0x33, 0x34, 0x36, 0x6a, 0x34,
-    0x49, 0x42, 0x67, 0x2b, 0x6b, 0x42, 0x0a, 0x39, 0x61, 0x6c, 0x77, 0x70,
-    0x43, 0x4f, 0x44, 0x41, 0x6b, 0x45, 0x41, 0x35, 0x6e, 0x53, 0x6e, 0x6d,
-    0x39, 0x6b, 0x36, 0x79, 0x6b, 0x59, 0x65, 0x51, 0x57, 0x4e, 0x53, 0x30,
-    0x66, 0x4e, 0x57, 0x69, 0x52, 0x69, 0x6e, 0x43, 0x64, 0x6c, 0x32, 0x33,
-    0x41, 0x37, 0x75, 0x73, 0x44, 0x47, 0x53, 0x75, 0x4b, 0x4b, 0x6c, 0x6d,
-    0x30, 0x31, 0x39, 0x69, 0x6f, 0x6d, 0x4a, 0x2f, 0x52, 0x67, 0x64, 0x0a,
-    0x4d, 0x4b, 0x44, 0x4f, 0x70, 0x30, 0x71, 0x2f, 0x32, 0x4f, 0x6f, 0x73,
-    0x74, 0x62, 0x74, 0x65, 0x4f, 0x57, 0x4d, 0x32, 0x4d, 0x52, 0x46, 0x66,
-    0x34, 0x6a, 0x4d, 0x48, 0x33, 0x77, 0x79, 0x56, 0x43, 0x77, 0x4a, 0x41,
-    0x66, 0x41, 0x64, 0x6a, 0x4a, 0x38, 0x73, 0x7a, 0x6f, 0x4e, 0x4b, 0x54,
-    0x52, 0x53, 0x61, 0x67, 0x53, 0x62, 0x68, 0x39, 0x76, 0x57, 0x79, 0x67,
-    0x6e, 0x42, 0x32, 0x76, 0x0a, 0x49, 0x42, 0x79, 0x63, 0x36, 0x6c, 0x34,
-    0x54, 0x54, 0x75, 0x5a, 0x51, 0x4a, 0x52, 0x47, 0x7a, 0x43, 0x76, 0x65,
-    0x61, 0x66, 0x7a, 0x39, 0x6c, 0x6f, 0x76, 0x75, 0x42, 0x33, 0x57, 0x6f,
-    0x68, 0x43, 0x41, 0x42, 0x64, 0x51, 0x52, 0x64, 0x39, 0x75, 0x6b, 0x43,
-    0x58, 0x4c, 0x32, 0x43, 0x70, 0x73, 0x45, 0x70, 0x71, 0x7a, 0x6b, 0x61,
-    0x66, 0x4f, 0x51, 0x4a, 0x41, 0x4a, 0x55, 0x6a, 0x63, 0x0a, 0x55, 0x53,
-    0x65, 0x64, 0x44, 0x6c, 0x71, 0x33, 0x7a, 0x47, 0x5a, 0x77, 0x59, 0x4d,
-    0x31, 0x59, 0x77, 0x38, 0x64, 0x38, 0x52, 0x75, 0x69, 0x72, 0x42, 0x55,
-    0x46, 0x5a, 0x4e, 0x71, 0x4a, 0x65, 0x6c, 0x59, 0x61, 0x69, 0x2b, 0x6e,
-    0x52, 0x59, 0x43, 0x6c, 0x44, 0x6b, 0x52, 0x56, 0x46, 0x67, 0x62, 0x35,
-    0x79, 0x6b, 0x73, 0x6f, 0x59, 0x79, 0x63, 0x62, 0x71, 0x35, 0x54, 0x78,
-    0x47, 0x6f, 0x0a, 0x56, 0x65, 0x71, 0x4b, 0x4f, 0x76, 0x67, 0x50, 0x70,
-    0x6a, 0x34, 0x52, 0x57, 0x50, 0x48, 0x6c, 0x4c, 0x77, 0x4a, 0x41, 0x47,
-    0x55, 0x4d, 0x6b, 0x33, 0x62, 0x71, 0x54, 0x39, 0x31, 0x78, 0x42, 0x55,
-    0x43, 0x6e, 0x4c, 0x52, 0x73, 0x2f, 0x76, 0x66, 0x6f, 0x43, 0x70, 0x48,
-    0x70, 0x67, 0x36, 0x65, 0x79, 0x77, 0x51, 0x54, 0x42, 0x44, 0x41, 0x56,
-    0x36, 0x78, 0x6b, 0x79, 0x7a, 0x34, 0x61, 0x0a, 0x52, 0x48, 0x33, 0x49,
-    0x37, 0x2f, 0x2b, 0x79, 0x6a, 0x33, 0x5a, 0x78, 0x52, 0x32, 0x4a, 0x6f,
-    0x57, 0x48, 0x67, 0x55, 0x77, 0x5a, 0x37, 0x6c, 0x5a, 0x6b, 0x31, 0x56,
-    0x6e, 0x68, 0x66, 0x66, 0x46, 0x79, 0x65, 0x37, 0x53, 0x42, 0x58, 0x79,
-    0x61, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e,
-    0x44, 0x20, 0x52, 0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54,
-    0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00};
diff --git a/test/core/end2end/data/server1_key.cc b/test/core/end2end/data/server1_key.cc
new file mode 100644
index 0000000..59dcaf6
--- /dev/null
+++ b/test/core/end2end/data/server1_key.cc
@@ -0,0 +1,93 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+extern "C" const char test_server1_key[] = {
+    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52,
+    0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
+    0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43,
+    0x57, 0x77, 0x49, 0x42, 0x41, 0x41, 0x4b, 0x42, 0x67, 0x51, 0x44, 0x68,
+    0x77, 0x78, 0x55, 0x6e, 0x4b, 0x43, 0x77, 0x6c, 0x53, 0x61, 0x57, 0x41,
+    0x77, 0x7a, 0x4f, 0x42, 0x32, 0x4c, 0x53, 0x48, 0x56, 0x65, 0x67, 0x4a,
+    0x48, 0x76, 0x37, 0x44, 0x44, 0x57, 0x6d, 0x69, 0x6e, 0x54, 0x67, 0x34,
+    0x77, 0x7a, 0x4c, 0x4c, 0x73, 0x66, 0x2b, 0x4c, 0x51, 0x38, 0x6e, 0x5a,
+    0x0a, 0x62, 0x70, 0x6a, 0x66, 0x6e, 0x35, 0x76, 0x67, 0x49, 0x7a, 0x78,
+    0x43, 0x75, 0x52, 0x68, 0x34, 0x52, 0x70, 0x39, 0x51, 0x59, 0x4d, 0x35,
+    0x46, 0x68, 0x66, 0x72, 0x4a, 0x58, 0x39, 0x77, 0x63, 0x59, 0x61, 0x77,
+    0x50, 0x2f, 0x48, 0x54, 0x62, 0x4a, 0x37, 0x70, 0x37, 0x4c, 0x56, 0x51,
+    0x4f, 0x32, 0x51, 0x59, 0x41, 0x50, 0x2b, 0x61, 0x6b, 0x4d, 0x54, 0x48,
+    0x78, 0x67, 0x4b, 0x75, 0x4d, 0x0a, 0x42, 0x7a, 0x56, 0x56, 0x2b, 0x2b,
+    0x33, 0x77, 0x57, 0x54, 0x6f, 0x4b, 0x66, 0x56, 0x5a, 0x55, 0x6a, 0x46,
+    0x58, 0x38, 0x6e, 0x66, 0x54, 0x66, 0x47, 0x4d, 0x47, 0x77, 0x57, 0x41,
+    0x48, 0x4a, 0x44, 0x6e, 0x6c, 0x45, 0x47, 0x6e, 0x55, 0x34, 0x74, 0x6c,
+    0x39, 0x55, 0x75, 0x6a, 0x6f, 0x43, 0x56, 0x34, 0x45, 0x4e, 0x4a, 0x74,
+    0x7a, 0x46, 0x6f, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x0a, 0x41,
+    0x6f, 0x47, 0x41, 0x4a, 0x2b, 0x36, 0x68, 0x70, 0x7a, 0x4e, 0x72, 0x32,
+    0x34, 0x79, 0x54, 0x51, 0x5a, 0x74, 0x46, 0x57, 0x51, 0x70, 0x44, 0x70,
+    0x45, 0x79, 0x46, 0x70, 0x6c, 0x64, 0x64, 0x4b, 0x4a, 0x4d, 0x4f, 0x78,
+    0x44, 0x79, 0x61, 0x33, 0x53, 0x39, 0x70, 0x70, 0x4b, 0x33, 0x76, 0x54,
+    0x57, 0x72, 0x49, 0x49, 0x54, 0x56, 0x32, 0x78, 0x4e, 0x63, 0x75, 0x63,
+    0x77, 0x37, 0x49, 0x0a, 0x63, 0x65, 0x54, 0x62, 0x64, 0x79, 0x72, 0x47,
+    0x73, 0x79, 0x6a, 0x73, 0x55, 0x30, 0x2f, 0x48, 0x64, 0x43, 0x63, 0x49,
+    0x66, 0x39, 0x79, 0x6d, 0x32, 0x6a, 0x66, 0x6d, 0x47, 0x4c, 0x55, 0x77,
+    0x6d, 0x79, 0x68, 0x6c, 0x74, 0x4b, 0x56, 0x77, 0x30, 0x51, 0x59, 0x63,
+    0x46, 0x42, 0x30, 0x58, 0x4c, 0x6b, 0x63, 0x30, 0x6e, 0x49, 0x35, 0x59,
+    0x76, 0x45, 0x59, 0x6f, 0x65, 0x56, 0x44, 0x67, 0x0a, 0x6f, 0x6d, 0x5a,
+    0x49, 0x58, 0x6e, 0x31, 0x45, 0x33, 0x45, 0x57, 0x2b, 0x73, 0x53, 0x49,
+    0x57, 0x53, 0x62, 0x6b, 0x4d, 0x75, 0x39, 0x62, 0x59, 0x32, 0x6b, 0x73,
+    0x74, 0x4b, 0x58, 0x52, 0x32, 0x55, 0x5a, 0x6d, 0x4d, 0x67, 0x57, 0x44,
+    0x74, 0x6d, 0x42, 0x45, 0x50, 0x4d, 0x61, 0x45, 0x43, 0x51, 0x51, 0x44,
+    0x36, 0x79, 0x54, 0x34, 0x54, 0x41, 0x5a, 0x4d, 0x35, 0x68, 0x47, 0x42,
+    0x62, 0x0a, 0x63, 0x69, 0x42, 0x4b, 0x67, 0x4d, 0x55, 0x50, 0x36, 0x50,
+    0x77, 0x4f, 0x68, 0x50, 0x68, 0x4f, 0x4d, 0x50, 0x49, 0x76, 0x69, 0x6a,
+    0x4f, 0x35, 0x30, 0x41, 0x69, 0x75, 0x36, 0x69, 0x75, 0x43, 0x56, 0x38,
+    0x38, 0x6c, 0x31, 0x51, 0x49, 0x79, 0x33, 0x38, 0x67, 0x57, 0x56, 0x68,
+    0x78, 0x6a, 0x4e, 0x72, 0x71, 0x36, 0x50, 0x33, 0x34, 0x36, 0x6a, 0x34,
+    0x49, 0x42, 0x67, 0x2b, 0x6b, 0x42, 0x0a, 0x39, 0x61, 0x6c, 0x77, 0x70,
+    0x43, 0x4f, 0x44, 0x41, 0x6b, 0x45, 0x41, 0x35, 0x6e, 0x53, 0x6e, 0x6d,
+    0x39, 0x6b, 0x36, 0x79, 0x6b, 0x59, 0x65, 0x51, 0x57, 0x4e, 0x53, 0x30,
+    0x66, 0x4e, 0x57, 0x69, 0x52, 0x69, 0x6e, 0x43, 0x64, 0x6c, 0x32, 0x33,
+    0x41, 0x37, 0x75, 0x73, 0x44, 0x47, 0x53, 0x75, 0x4b, 0x4b, 0x6c, 0x6d,
+    0x30, 0x31, 0x39, 0x69, 0x6f, 0x6d, 0x4a, 0x2f, 0x52, 0x67, 0x64, 0x0a,
+    0x4d, 0x4b, 0x44, 0x4f, 0x70, 0x30, 0x71, 0x2f, 0x32, 0x4f, 0x6f, 0x73,
+    0x74, 0x62, 0x74, 0x65, 0x4f, 0x57, 0x4d, 0x32, 0x4d, 0x52, 0x46, 0x66,
+    0x34, 0x6a, 0x4d, 0x48, 0x33, 0x77, 0x79, 0x56, 0x43, 0x77, 0x4a, 0x41,
+    0x66, 0x41, 0x64, 0x6a, 0x4a, 0x38, 0x73, 0x7a, 0x6f, 0x4e, 0x4b, 0x54,
+    0x52, 0x53, 0x61, 0x67, 0x53, 0x62, 0x68, 0x39, 0x76, 0x57, 0x79, 0x67,
+    0x6e, 0x42, 0x32, 0x76, 0x0a, 0x49, 0x42, 0x79, 0x63, 0x36, 0x6c, 0x34,
+    0x54, 0x54, 0x75, 0x5a, 0x51, 0x4a, 0x52, 0x47, 0x7a, 0x43, 0x76, 0x65,
+    0x61, 0x66, 0x7a, 0x39, 0x6c, 0x6f, 0x76, 0x75, 0x42, 0x33, 0x57, 0x6f,
+    0x68, 0x43, 0x41, 0x42, 0x64, 0x51, 0x52, 0x64, 0x39, 0x75, 0x6b, 0x43,
+    0x58, 0x4c, 0x32, 0x43, 0x70, 0x73, 0x45, 0x70, 0x71, 0x7a, 0x6b, 0x61,
+    0x66, 0x4f, 0x51, 0x4a, 0x41, 0x4a, 0x55, 0x6a, 0x63, 0x0a, 0x55, 0x53,
+    0x65, 0x64, 0x44, 0x6c, 0x71, 0x33, 0x7a, 0x47, 0x5a, 0x77, 0x59, 0x4d,
+    0x31, 0x59, 0x77, 0x38, 0x64, 0x38, 0x52, 0x75, 0x69, 0x72, 0x42, 0x55,
+    0x46, 0x5a, 0x4e, 0x71, 0x4a, 0x65, 0x6c, 0x59, 0x61, 0x69, 0x2b, 0x6e,
+    0x52, 0x59, 0x43, 0x6c, 0x44, 0x6b, 0x52, 0x56, 0x46, 0x67, 0x62, 0x35,
+    0x79, 0x6b, 0x73, 0x6f, 0x59, 0x79, 0x63, 0x62, 0x71, 0x35, 0x54, 0x78,
+    0x47, 0x6f, 0x0a, 0x56, 0x65, 0x71, 0x4b, 0x4f, 0x76, 0x67, 0x50, 0x70,
+    0x6a, 0x34, 0x52, 0x57, 0x50, 0x48, 0x6c, 0x4c, 0x77, 0x4a, 0x41, 0x47,
+    0x55, 0x4d, 0x6b, 0x33, 0x62, 0x71, 0x54, 0x39, 0x31, 0x78, 0x42, 0x55,
+    0x43, 0x6e, 0x4c, 0x52, 0x73, 0x2f, 0x76, 0x66, 0x6f, 0x43, 0x70, 0x48,
+    0x70, 0x67, 0x36, 0x65, 0x79, 0x77, 0x51, 0x54, 0x42, 0x44, 0x41, 0x56,
+    0x36, 0x78, 0x6b, 0x79, 0x7a, 0x34, 0x61, 0x0a, 0x52, 0x48, 0x33, 0x49,
+    0x37, 0x2f, 0x2b, 0x79, 0x6a, 0x33, 0x5a, 0x78, 0x52, 0x32, 0x4a, 0x6f,
+    0x57, 0x48, 0x67, 0x55, 0x77, 0x5a, 0x37, 0x6c, 0x5a, 0x6b, 0x31, 0x56,
+    0x6e, 0x68, 0x66, 0x66, 0x46, 0x79, 0x65, 0x37, 0x53, 0x42, 0x58, 0x79,
+    0x61, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e,
+    0x44, 0x20, 0x52, 0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54,
+    0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00};
diff --git a/test/core/end2end/data/test_root_cert.c b/test/core/end2end/data/test_root_cert.c
deleted file mode 100644
index ef39ca5..0000000
--- a/test/core/end2end/data/test_root_cert.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-const char test_root_cert[] = {
-    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
-    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
-    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x7a, 0x43, 0x43,
-    0x41, 0x59, 0x77, 0x43, 0x43, 0x51, 0x43, 0x46, 0x54, 0x62, 0x46, 0x37,
-    0x58, 0x4e, 0x53, 0x76, 0x76, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71,
-    0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46,
-    0x41, 0x44, 0x42, 0x57, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44,
-    0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x42, 0x0a, 0x56, 0x54, 0x45,
-    0x54, 0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x41, 0x77,
-    0x4b, 0x55, 0x32, 0x39, 0x74, 0x5a, 0x53, 0x31, 0x54, 0x64, 0x47, 0x46,
-    0x30, 0x5a, 0x54, 0x45, 0x68, 0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55,
-    0x45, 0x43, 0x67, 0x77, 0x59, 0x53, 0x57, 0x35, 0x30, 0x5a, 0x58, 0x4a,
-    0x75, 0x5a, 0x58, 0x51, 0x67, 0x56, 0x32, 0x6c, 0x6b, 0x5a, 0x32, 0x6c,
-    0x30, 0x0a, 0x63, 0x79, 0x42, 0x51, 0x64, 0x48, 0x6b, 0x67, 0x54, 0x48,
-    0x52, 0x6b, 0x4d, 0x51, 0x38, 0x77, 0x44, 0x51, 0x59, 0x44, 0x56, 0x51,
-    0x51, 0x44, 0x44, 0x41, 0x5a, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x59, 0x32,
-    0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x51, 0x77, 0x4e, 0x7a,
-    0x45, 0x33, 0x4d, 0x6a, 0x4d, 0x78, 0x4e, 0x7a, 0x55, 0x78, 0x57, 0x68,
-    0x63, 0x4e, 0x4d, 0x6a, 0x51, 0x77, 0x0a, 0x4e, 0x7a, 0x45, 0x30, 0x4d,
-    0x6a, 0x4d, 0x78, 0x4e, 0x7a, 0x55, 0x78, 0x57, 0x6a, 0x42, 0x57, 0x4d,
-    0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45,
-    0x77, 0x4a, 0x42, 0x56, 0x54, 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x41,
-    0x31, 0x55, 0x45, 0x43, 0x41, 0x77, 0x4b, 0x55, 0x32, 0x39, 0x74, 0x5a,
-    0x53, 0x31, 0x54, 0x64, 0x47, 0x46, 0x30, 0x5a, 0x54, 0x45, 0x68, 0x0a,
-    0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x59,
-    0x53, 0x57, 0x35, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x5a, 0x58, 0x51, 0x67,
-    0x56, 0x32, 0x6c, 0x6b, 0x5a, 0x32, 0x6c, 0x30, 0x63, 0x79, 0x42, 0x51,
-    0x64, 0x48, 0x6b, 0x67, 0x54, 0x48, 0x52, 0x6b, 0x4d, 0x51, 0x38, 0x77,
-    0x44, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x41, 0x5a, 0x30,
-    0x5a, 0x58, 0x4e, 0x30, 0x0a, 0x59, 0x32, 0x45, 0x77, 0x67, 0x5a, 0x38,
-    0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63,
-    0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x59, 0x30,
-    0x41, 0x4d, 0x49, 0x47, 0x4a, 0x41, 0x6f, 0x47, 0x42, 0x41, 0x4d, 0x42,
-    0x41, 0x33, 0x77, 0x56, 0x65, 0x54, 0x47, 0x48, 0x5a, 0x52, 0x31, 0x52,
-    0x79, 0x65, 0x2f, 0x69, 0x2b, 0x4a, 0x38, 0x61, 0x32, 0x0a, 0x63, 0x75,
-    0x35, 0x67, 0x58, 0x77, 0x46, 0x56, 0x36, 0x54, 0x6e, 0x4f, 0x62, 0x7a,
-    0x47, 0x4d, 0x37, 0x62, 0x4c, 0x46, 0x43, 0x4f, 0x35, 0x69, 0x39, 0x76,
-    0x34, 0x6d, 0x4c, 0x6f, 0x34, 0x69, 0x46, 0x7a, 0x50, 0x73, 0x48, 0x6d,
-    0x57, 0x44, 0x55, 0x78, 0x4b, 0x53, 0x33, 0x59, 0x38, 0x69, 0x58, 0x62,
-    0x75, 0x30, 0x65, 0x59, 0x42, 0x6c, 0x4c, 0x6f, 0x4e, 0x59, 0x30, 0x6c,
-    0x53, 0x76, 0x0a, 0x78, 0x44, 0x78, 0x33, 0x33, 0x4f, 0x2b, 0x44, 0x75,
-    0x77, 0x4d, 0x6d, 0x56, 0x4e, 0x2b, 0x44, 0x7a, 0x53, 0x44, 0x2b, 0x45,
-    0x6f, 0x64, 0x39, 0x7a, 0x66, 0x76, 0x77, 0x4f, 0x57, 0x48, 0x73, 0x61,
-    0x7a, 0x59, 0x43, 0x5a, 0x54, 0x32, 0x50, 0x68, 0x4e, 0x78, 0x6e, 0x56,
-    0x57, 0x49, 0x75, 0x4a, 0x58, 0x56, 0x69, 0x59, 0x34, 0x4a, 0x41, 0x48,
-    0x55, 0x47, 0x6f, 0x64, 0x6a, 0x78, 0x2b, 0x0a, 0x51, 0x41, 0x69, 0x36,
-    0x79, 0x43, 0x41, 0x75, 0x72, 0x55, 0x5a, 0x47, 0x76, 0x59, 0x58, 0x47,
-    0x67, 0x5a, 0x53, 0x42, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x45, 0x77,
-    0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e,
-    0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x59, 0x45, 0x41,
-    0x51, 0x6f, 0x51, 0x56, 0x44, 0x38, 0x62, 0x77, 0x64, 0x74, 0x57, 0x4a,
-    0x0a, 0x41, 0x6e, 0x69, 0x47, 0x42, 0x77, 0x63, 0x43, 0x66, 0x71, 0x59,
-    0x79, 0x48, 0x2b, 0x2f, 0x4b, 0x70, 0x41, 0x31, 0x30, 0x41, 0x63, 0x65,
-    0x62, 0x4a, 0x56, 0x56, 0x54, 0x79, 0x59, 0x62, 0x59, 0x76, 0x49, 0x39,
-    0x51, 0x38, 0x64, 0x36, 0x52, 0x53, 0x56, 0x75, 0x34, 0x50, 0x5a, 0x79,
-    0x39, 0x4f, 0x41, 0x4c, 0x48, 0x52, 0x2f, 0x51, 0x72, 0x57, 0x42, 0x64,
-    0x59, 0x54, 0x41, 0x79, 0x7a, 0x0a, 0x66, 0x4e, 0x41, 0x6d, 0x63, 0x32,
-    0x63, 0x6d, 0x64, 0x6b, 0x53, 0x52, 0x4a, 0x7a, 0x6a, 0x68, 0x49, 0x61,
-    0x4f, 0x73, 0x74, 0x6e, 0x51, 0x79, 0x31, 0x4a, 0x2b, 0x46, 0x6b, 0x30,
-    0x54, 0x39, 0x58, 0x79, 0x76, 0x51, 0x74, 0x71, 0x34, 0x39, 0x39, 0x79,
-    0x46, 0x62, 0x71, 0x39, 0x78, 0x6f, 0x67, 0x55, 0x56, 0x6c, 0x45, 0x47,
-    0x48, 0x36, 0x32, 0x78, 0x50, 0x36, 0x76, 0x48, 0x30, 0x59, 0x0a, 0x35,
-    0x75, 0x6b, 0x4b, 0x2f, 0x2f, 0x64, 0x43, 0x50, 0x41, 0x7a, 0x41, 0x31,
-    0x31, 0x59, 0x75, 0x58, 0x32, 0x72, 0x6e, 0x65, 0x78, 0x30, 0x4a, 0x68,
-    0x75, 0x54, 0x51, 0x66, 0x63, 0x49, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d,
-    0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49,
-    0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00};
diff --git a/test/core/end2end/data/test_root_cert.cc b/test/core/end2end/data/test_root_cert.cc
new file mode 100644
index 0000000..36fca2e
--- /dev/null
+++ b/test/core/end2end/data/test_root_cert.cc
@@ -0,0 +1,86 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+extern "C" const char test_root_cert[] = {
+    0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
+    0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
+    0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x7a, 0x43, 0x43,
+    0x41, 0x59, 0x77, 0x43, 0x43, 0x51, 0x43, 0x46, 0x54, 0x62, 0x46, 0x37,
+    0x58, 0x4e, 0x53, 0x76, 0x76, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71,
+    0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46,
+    0x41, 0x44, 0x42, 0x57, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44,
+    0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x42, 0x0a, 0x56, 0x54, 0x45,
+    0x54, 0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x41, 0x77,
+    0x4b, 0x55, 0x32, 0x39, 0x74, 0x5a, 0x53, 0x31, 0x54, 0x64, 0x47, 0x46,
+    0x30, 0x5a, 0x54, 0x45, 0x68, 0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55,
+    0x45, 0x43, 0x67, 0x77, 0x59, 0x53, 0x57, 0x35, 0x30, 0x5a, 0x58, 0x4a,
+    0x75, 0x5a, 0x58, 0x51, 0x67, 0x56, 0x32, 0x6c, 0x6b, 0x5a, 0x32, 0x6c,
+    0x30, 0x0a, 0x63, 0x79, 0x42, 0x51, 0x64, 0x48, 0x6b, 0x67, 0x54, 0x48,
+    0x52, 0x6b, 0x4d, 0x51, 0x38, 0x77, 0x44, 0x51, 0x59, 0x44, 0x56, 0x51,
+    0x51, 0x44, 0x44, 0x41, 0x5a, 0x30, 0x5a, 0x58, 0x4e, 0x30, 0x59, 0x32,
+    0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x51, 0x77, 0x4e, 0x7a,
+    0x45, 0x33, 0x4d, 0x6a, 0x4d, 0x78, 0x4e, 0x7a, 0x55, 0x78, 0x57, 0x68,
+    0x63, 0x4e, 0x4d, 0x6a, 0x51, 0x77, 0x0a, 0x4e, 0x7a, 0x45, 0x30, 0x4d,
+    0x6a, 0x4d, 0x78, 0x4e, 0x7a, 0x55, 0x78, 0x57, 0x6a, 0x42, 0x57, 0x4d,
+    0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45,
+    0x77, 0x4a, 0x42, 0x56, 0x54, 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x41,
+    0x31, 0x55, 0x45, 0x43, 0x41, 0x77, 0x4b, 0x55, 0x32, 0x39, 0x74, 0x5a,
+    0x53, 0x31, 0x54, 0x64, 0x47, 0x46, 0x30, 0x5a, 0x54, 0x45, 0x68, 0x0a,
+    0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x59,
+    0x53, 0x57, 0x35, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x5a, 0x58, 0x51, 0x67,
+    0x56, 0x32, 0x6c, 0x6b, 0x5a, 0x32, 0x6c, 0x30, 0x63, 0x79, 0x42, 0x51,
+    0x64, 0x48, 0x6b, 0x67, 0x54, 0x48, 0x52, 0x6b, 0x4d, 0x51, 0x38, 0x77,
+    0x44, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x41, 0x5a, 0x30,
+    0x5a, 0x58, 0x4e, 0x30, 0x0a, 0x59, 0x32, 0x45, 0x77, 0x67, 0x5a, 0x38,
+    0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63,
+    0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x59, 0x30,
+    0x41, 0x4d, 0x49, 0x47, 0x4a, 0x41, 0x6f, 0x47, 0x42, 0x41, 0x4d, 0x42,
+    0x41, 0x33, 0x77, 0x56, 0x65, 0x54, 0x47, 0x48, 0x5a, 0x52, 0x31, 0x52,
+    0x79, 0x65, 0x2f, 0x69, 0x2b, 0x4a, 0x38, 0x61, 0x32, 0x0a, 0x63, 0x75,
+    0x35, 0x67, 0x58, 0x77, 0x46, 0x56, 0x36, 0x54, 0x6e, 0x4f, 0x62, 0x7a,
+    0x47, 0x4d, 0x37, 0x62, 0x4c, 0x46, 0x43, 0x4f, 0x35, 0x69, 0x39, 0x76,
+    0x34, 0x6d, 0x4c, 0x6f, 0x34, 0x69, 0x46, 0x7a, 0x50, 0x73, 0x48, 0x6d,
+    0x57, 0x44, 0x55, 0x78, 0x4b, 0x53, 0x33, 0x59, 0x38, 0x69, 0x58, 0x62,
+    0x75, 0x30, 0x65, 0x59, 0x42, 0x6c, 0x4c, 0x6f, 0x4e, 0x59, 0x30, 0x6c,
+    0x53, 0x76, 0x0a, 0x78, 0x44, 0x78, 0x33, 0x33, 0x4f, 0x2b, 0x44, 0x75,
+    0x77, 0x4d, 0x6d, 0x56, 0x4e, 0x2b, 0x44, 0x7a, 0x53, 0x44, 0x2b, 0x45,
+    0x6f, 0x64, 0x39, 0x7a, 0x66, 0x76, 0x77, 0x4f, 0x57, 0x48, 0x73, 0x61,
+    0x7a, 0x59, 0x43, 0x5a, 0x54, 0x32, 0x50, 0x68, 0x4e, 0x78, 0x6e, 0x56,
+    0x57, 0x49, 0x75, 0x4a, 0x58, 0x56, 0x69, 0x59, 0x34, 0x4a, 0x41, 0x48,
+    0x55, 0x47, 0x6f, 0x64, 0x6a, 0x78, 0x2b, 0x0a, 0x51, 0x41, 0x69, 0x36,
+    0x79, 0x43, 0x41, 0x75, 0x72, 0x55, 0x5a, 0x47, 0x76, 0x59, 0x58, 0x47,
+    0x67, 0x5a, 0x53, 0x42, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x45, 0x77,
+    0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e,
+    0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x59, 0x45, 0x41,
+    0x51, 0x6f, 0x51, 0x56, 0x44, 0x38, 0x62, 0x77, 0x64, 0x74, 0x57, 0x4a,
+    0x0a, 0x41, 0x6e, 0x69, 0x47, 0x42, 0x77, 0x63, 0x43, 0x66, 0x71, 0x59,
+    0x79, 0x48, 0x2b, 0x2f, 0x4b, 0x70, 0x41, 0x31, 0x30, 0x41, 0x63, 0x65,
+    0x62, 0x4a, 0x56, 0x56, 0x54, 0x79, 0x59, 0x62, 0x59, 0x76, 0x49, 0x39,
+    0x51, 0x38, 0x64, 0x36, 0x52, 0x53, 0x56, 0x75, 0x34, 0x50, 0x5a, 0x79,
+    0x39, 0x4f, 0x41, 0x4c, 0x48, 0x52, 0x2f, 0x51, 0x72, 0x57, 0x42, 0x64,
+    0x59, 0x54, 0x41, 0x79, 0x7a, 0x0a, 0x66, 0x4e, 0x41, 0x6d, 0x63, 0x32,
+    0x63, 0x6d, 0x64, 0x6b, 0x53, 0x52, 0x4a, 0x7a, 0x6a, 0x68, 0x49, 0x61,
+    0x4f, 0x73, 0x74, 0x6e, 0x51, 0x79, 0x31, 0x4a, 0x2b, 0x46, 0x6b, 0x30,
+    0x54, 0x39, 0x58, 0x79, 0x76, 0x51, 0x74, 0x71, 0x34, 0x39, 0x39, 0x79,
+    0x46, 0x62, 0x71, 0x39, 0x78, 0x6f, 0x67, 0x55, 0x56, 0x6c, 0x45, 0x47,
+    0x48, 0x36, 0x32, 0x78, 0x50, 0x36, 0x76, 0x48, 0x30, 0x59, 0x0a, 0x35,
+    0x75, 0x6b, 0x4b, 0x2f, 0x2f, 0x64, 0x43, 0x50, 0x41, 0x7a, 0x41, 0x31,
+    0x31, 0x59, 0x75, 0x58, 0x32, 0x72, 0x6e, 0x65, 0x78, 0x30, 0x4a, 0x68,
+    0x75, 0x54, 0x51, 0x66, 0x63, 0x49, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d,
+    0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49,
+    0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x00};
diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c
deleted file mode 100644
index f9150f1..0000000
--- a/test/core/end2end/dualstack_socket_test.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with posix sockets enabled
-#ifdef GRPC_POSIX_SOCKET
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-/* This test exercises IPv4, IPv6, and dualstack sockets in various ways. */
-
-static void *tag(intptr_t i) { return (void *)i; }
-
-static gpr_timespec ms_from_now(int ms) {
-  return grpc_timeout_milliseconds_to_deadline(ms);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, ms_from_now(5000), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void do_nothing(void *ignored) {}
-
-void test_connect(const char *server_host, const char *client_host, int port,
-                  int expect_ok) {
-  char *client_hostport;
-  char *server_hostport;
-  grpc_channel *client;
-  grpc_server *server;
-  grpc_completion_queue *cq;
-  grpc_completion_queue *shutdown_cq;
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv;
-  gpr_timespec deadline;
-  int got_port;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  grpc_call_details call_details;
-  char *peer;
-  int picked_port = 0;
-
-  if (port == 0) {
-    port = grpc_pick_unused_port_or_die();
-    picked_port = 1;
-  }
-
-  gpr_join_host_port(&server_hostport, server_host, port);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  /* Create server. */
-  cq = grpc_completion_queue_create_for_next(NULL);
-  server = grpc_server_create(NULL, NULL);
-  grpc_server_register_completion_queue(server, cq, NULL);
-  GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port(
-                  server, server_hostport)) > 0);
-  if (port == 0) {
-    port = got_port;
-  } else {
-    GPR_ASSERT(port == got_port);
-  }
-  grpc_server_start(server);
-  cqv = cq_verifier_create(cq);
-
-  /* Create client. */
-  if (client_host[0] == 'i') {
-    /* for ipv4:/ipv6: addresses, concatenate the port to each of the parts */
-    size_t i;
-    grpc_slice uri_slice;
-    grpc_slice_buffer uri_parts;
-    char **hosts_with_port;
-
-    uri_slice =
-        grpc_slice_new((char *)client_host, strlen(client_host), do_nothing);
-    grpc_slice_buffer_init(&uri_parts);
-    grpc_slice_split(uri_slice, ",", &uri_parts);
-    hosts_with_port = gpr_malloc(sizeof(char *) * uri_parts.count);
-    for (i = 0; i < uri_parts.count; i++) {
-      char *uri_part_str = grpc_slice_to_c_string(uri_parts.slices[i]);
-      gpr_asprintf(&hosts_with_port[i], "%s:%d", uri_part_str, port);
-      gpr_free(uri_part_str);
-    }
-    client_hostport = gpr_strjoin_sep((const char **)hosts_with_port,
-                                      uri_parts.count, ",", NULL);
-    for (i = 0; i < uri_parts.count; i++) {
-      gpr_free(hosts_with_port[i]);
-    }
-    gpr_free(hosts_with_port);
-    grpc_slice_buffer_destroy(&uri_parts);
-    grpc_slice_unref(uri_slice);
-  } else {
-    gpr_join_host_port(&client_hostport, client_host, port);
-  }
-  client = grpc_insecure_channel_create(client_hostport, NULL, NULL);
-
-  gpr_log(GPR_INFO, "Testing with server=%s client=%s (expecting %s)",
-          server_hostport, client_hostport, expect_ok ? "success" : "failure");
-
-  gpr_free(client_hostport);
-  gpr_free(server_hostport);
-
-  if (expect_ok) {
-    /* Normal deadline, shouldn't be reached. */
-    deadline = ms_from_now(60000);
-  } else {
-    /* Give up faster when failure is expected.
-       BUG: Setting this to 1000 reveals a memory leak (b/18608927). */
-    deadline = ms_from_now(1500);
-  }
-
-  /* Send a trivial request. */
-  grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr");
-  c = grpc_channel_create_call(client, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-                               grpc_slice_from_static_string("/foo"), &host,
-                               deadline, NULL);
-  GPR_ASSERT(c);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = expect_ok ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  if (expect_ok) {
-    /* Check for a successful request. */
-    error = grpc_server_request_call(server, &s, &call_details,
-                                     &request_metadata_recv, cq, cq, tag(101));
-    GPR_ASSERT(GRPC_CALL_OK == error);
-    CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-    cq_verify(cqv);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_INITIAL_METADATA;
-    op->data.send_initial_metadata.count = 0;
-    op->flags = 0;
-    op++;
-    op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-    op->data.send_status_from_server.trailing_metadata_count = 0;
-    op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-    grpc_slice status_details = grpc_slice_from_static_string("xyz");
-    op->data.send_status_from_server.status_details = &status_details;
-    op->flags = 0;
-    op++;
-    op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-    op->data.recv_close_on_server.cancelled = &was_cancelled;
-    op->flags = 0;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-    cq_verify(cqv);
-
-    peer = grpc_call_get_peer(c);
-    gpr_log(GPR_DEBUG, "got peer: '%s'", peer);
-    gpr_free(peer);
-
-    GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-    GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-    GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-    GPR_ASSERT(0 ==
-               grpc_slice_str_cmp(call_details.host, "foo.test.google.fr"));
-    GPR_ASSERT(was_cancelled == 1);
-
-    grpc_call_unref(s);
-  } else {
-    /* Check for a failed connection. */
-    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-    cq_verify(cqv);
-
-    GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
-  }
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-
-  /* Destroy client. */
-  grpc_channel_destroy(client);
-
-  /* Destroy server. */
-  shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-  grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(server);
-  grpc_completion_queue_destroy(shutdown_cq);
-  grpc_completion_queue_shutdown(cq);
-  drain_cq(cq);
-  grpc_completion_queue_destroy(cq);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-
-  grpc_call_details_destroy(&call_details);
-  grpc_slice_unref(details);
-  if (picked_port) {
-    grpc_recycle_unused_port(port);
-  }
-}
-
-int external_dns_works(const char *host) {
-  grpc_resolved_addresses *res = NULL;
-  grpc_error *error = grpc_blocking_resolve_address(host, "80", &res);
-  GRPC_ERROR_UNREF(error);
-  if (res != NULL) {
-    grpc_resolved_addresses_destroy(res);
-    return 1;
-  }
-  return 0;
-}
-
-int main(int argc, char **argv) {
-  int do_ipv6 = 1;
-
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  if (!grpc_ipv6_loopback_available()) {
-    gpr_log(GPR_INFO, "Can't bind to ::1.  Skipping IPv6 tests.");
-    do_ipv6 = 0;
-  }
-
-  /* For coverage, test with and without dualstack sockets. */
-  for (grpc_forbid_dualstack_sockets_for_testing = 0;
-       grpc_forbid_dualstack_sockets_for_testing <= 1;
-       grpc_forbid_dualstack_sockets_for_testing++) {
-    /* :: and 0.0.0.0 are handled identically. */
-    test_connect("::", "127.0.0.1", 0, 1);
-    test_connect("::", "::ffff:127.0.0.1", 0, 1);
-    test_connect("::", "ipv4:127.0.0.1", 0, 1);
-    test_connect("::", "ipv6:[::ffff:127.0.0.1]", 0, 1);
-    test_connect("::", "localhost", 0, 1);
-    test_connect("0.0.0.0", "127.0.0.1", 0, 1);
-    test_connect("0.0.0.0", "::ffff:127.0.0.1", 0, 1);
-    test_connect("0.0.0.0", "ipv4:127.0.0.1", 0, 1);
-    test_connect("0.0.0.0", "ipv4:127.0.0.1,127.0.0.2,127.0.0.3", 0, 1);
-    test_connect("0.0.0.0", "ipv6:[::ffff:127.0.0.1],[::ffff:127.0.0.2]", 0, 1);
-    test_connect("0.0.0.0", "localhost", 0, 1);
-    if (do_ipv6) {
-      test_connect("::", "::1", 0, 1);
-      test_connect("0.0.0.0", "::1", 0, 1);
-      test_connect("::", "ipv6:[::1]", 0, 1);
-      test_connect("0.0.0.0", "ipv6:[::1]", 0, 1);
-    }
-
-    /* These only work when the families agree. */
-    test_connect("127.0.0.1", "127.0.0.1", 0, 1);
-    test_connect("127.0.0.1", "ipv4:127.0.0.1", 0, 1);
-    if (do_ipv6) {
-      test_connect("::1", "::1", 0, 1);
-      test_connect("::1", "127.0.0.1", 0, 0);
-      test_connect("127.0.0.1", "::1", 0, 0);
-      test_connect("::1", "ipv6:[::1]", 0, 1);
-      test_connect("::1", "ipv4:127.0.0.1", 0, 0);
-      test_connect("127.0.0.1", "ipv6:[::1]", 0, 0);
-    }
-
-    if (!external_dns_works("loopback46.unittest.grpc.io")) {
-      gpr_log(GPR_INFO, "Skipping tests that depend on *.unittest.grpc.io.");
-    } else {
-      test_connect("loopback46.unittest.grpc.io", "loopback4.unittest.grpc.io",
-                   0, 1);
-      test_connect("loopback4.unittest.grpc.io", "loopback46.unittest.grpc.io",
-                   0, 1);
-      if (do_ipv6) {
-        test_connect("loopback46.unittest.grpc.io",
-                     "loopback6.unittest.grpc.io", 0, 1);
-        test_connect("loopback6.unittest.grpc.io",
-                     "loopback46.unittest.grpc.io", 0, 1);
-        test_connect("loopback4.unittest.grpc.io", "loopback6.unittest.grpc.io",
-                     0, 0);
-        test_connect("loopback6.unittest.grpc.io", "loopback4.unittest.grpc.io",
-                     0, 0);
-      }
-    }
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/end2end/dualstack_socket_test.cc b/test/core/end2end/dualstack_socket_test.cc
new file mode 100644
index 0000000..1e02116
--- /dev/null
+++ b/test/core/end2end/dualstack_socket_test.cc
@@ -0,0 +1,358 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+/* This test exercises IPv4, IPv6, and dualstack sockets in various ways. */
+
+static void* tag(intptr_t i) { return (void*)i; }
+
+static gpr_timespec ms_from_now(int ms) {
+  return grpc_timeout_milliseconds_to_deadline(ms);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, ms_from_now(5000), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void do_nothing(void* ignored) {}
+
+void test_connect(const char* server_host, const char* client_host, int port,
+                  int expect_ok) {
+  char* client_hostport;
+  char* server_hostport;
+  grpc_channel* client;
+  grpc_server* server;
+  grpc_completion_queue* cq;
+  grpc_completion_queue* shutdown_cq;
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv;
+  gpr_timespec deadline;
+  int got_port;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  grpc_call_details call_details;
+  char* peer;
+  int picked_port = 0;
+
+  if (port == 0) {
+    port = grpc_pick_unused_port_or_die();
+    picked_port = 1;
+  }
+
+  gpr_join_host_port(&server_hostport, server_host, port);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  /* Create server. */
+  cq = grpc_completion_queue_create_for_next(NULL);
+  server = grpc_server_create(NULL, NULL);
+  grpc_server_register_completion_queue(server, cq, NULL);
+  GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port(
+                  server, server_hostport)) > 0);
+  if (port == 0) {
+    port = got_port;
+  } else {
+    GPR_ASSERT(port == got_port);
+  }
+  grpc_server_start(server);
+  cqv = cq_verifier_create(cq);
+
+  /* Create client. */
+  if (client_host[0] == 'i') {
+    /* for ipv4:/ipv6: addresses, concatenate the port to each of the parts */
+    size_t i;
+    grpc_slice uri_slice;
+    grpc_slice_buffer uri_parts;
+    char** hosts_with_port;
+
+    uri_slice =
+        grpc_slice_new((char*)client_host, strlen(client_host), do_nothing);
+    grpc_slice_buffer_init(&uri_parts);
+    grpc_slice_split(uri_slice, ",", &uri_parts);
+    hosts_with_port =
+        static_cast<char**>(gpr_malloc(sizeof(char*) * uri_parts.count));
+    for (i = 0; i < uri_parts.count; i++) {
+      char* uri_part_str = grpc_slice_to_c_string(uri_parts.slices[i]);
+      gpr_asprintf(&hosts_with_port[i], "%s:%d", uri_part_str, port);
+      gpr_free(uri_part_str);
+    }
+    client_hostport = gpr_strjoin_sep((const char**)hosts_with_port,
+                                      uri_parts.count, ",", NULL);
+    for (i = 0; i < uri_parts.count; i++) {
+      gpr_free(hosts_with_port[i]);
+    }
+    gpr_free(hosts_with_port);
+    grpc_slice_buffer_destroy(&uri_parts);
+    grpc_slice_unref(uri_slice);
+  } else {
+    gpr_join_host_port(&client_hostport, client_host, port);
+  }
+  client = grpc_insecure_channel_create(client_hostport, NULL, NULL);
+
+  gpr_log(GPR_INFO, "Testing with server=%s client=%s (expecting %s)",
+          server_hostport, client_hostport, expect_ok ? "success" : "failure");
+
+  gpr_free(client_hostport);
+  gpr_free(server_hostport);
+
+  if (expect_ok) {
+    /* Normal deadline, shouldn't be reached. */
+    deadline = ms_from_now(60000);
+  } else {
+    /* Give up faster when failure is expected.
+       BUG: Setting this to 1000 reveals a memory leak (b/18608927). */
+    deadline = ms_from_now(1500);
+  }
+
+  /* Send a trivial request. */
+  grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr");
+  c = grpc_channel_create_call(client, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+                               grpc_slice_from_static_string("/foo"), &host,
+                               deadline, NULL);
+  GPR_ASSERT(c);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = expect_ok ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  if (expect_ok) {
+    /* Check for a successful request. */
+    error = grpc_server_request_call(server, &s, &call_details,
+                                     &request_metadata_recv, cq, cq, tag(101));
+    GPR_ASSERT(GRPC_CALL_OK == error);
+    CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+    cq_verify(cqv);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_INITIAL_METADATA;
+    op->data.send_initial_metadata.count = 0;
+    op->flags = 0;
+    op++;
+    op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+    op->data.send_status_from_server.trailing_metadata_count = 0;
+    op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+    grpc_slice status_details = grpc_slice_from_static_string("xyz");
+    op->data.send_status_from_server.status_details = &status_details;
+    op->flags = 0;
+    op++;
+    op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+    op->data.recv_close_on_server.cancelled = &was_cancelled;
+    op->flags = 0;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+    cq_verify(cqv);
+
+    peer = grpc_call_get_peer(c);
+    gpr_log(GPR_DEBUG, "got peer: '%s'", peer);
+    gpr_free(peer);
+
+    GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+    GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+    GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+    GPR_ASSERT(0 ==
+               grpc_slice_str_cmp(call_details.host, "foo.test.google.fr"));
+    GPR_ASSERT(was_cancelled == 1);
+
+    grpc_call_unref(s);
+  } else {
+    /* Check for a failed connection. */
+    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+    cq_verify(cqv);
+
+    GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
+  }
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+
+  /* Destroy client. */
+  grpc_channel_destroy(client);
+
+  /* Destroy server. */
+  shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+  grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(server);
+  grpc_completion_queue_destroy(shutdown_cq);
+  grpc_completion_queue_shutdown(cq);
+  drain_cq(cq);
+  grpc_completion_queue_destroy(cq);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+
+  grpc_call_details_destroy(&call_details);
+  grpc_slice_unref(details);
+  if (picked_port) {
+    grpc_recycle_unused_port(port);
+  }
+}
+
+int external_dns_works(const char* host) {
+  grpc_resolved_addresses* res = NULL;
+  grpc_error* error = grpc_blocking_resolve_address(host, "80", &res);
+  GRPC_ERROR_UNREF(error);
+  if (res != NULL) {
+    grpc_resolved_addresses_destroy(res);
+    return 1;
+  }
+  return 0;
+}
+
+int main(int argc, char** argv) {
+  int do_ipv6 = 1;
+
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  if (!grpc_ipv6_loopback_available()) {
+    gpr_log(GPR_INFO, "Can't bind to ::1.  Skipping IPv6 tests.");
+    do_ipv6 = 0;
+  }
+
+  /* For coverage, test with and without dualstack sockets. */
+  for (grpc_forbid_dualstack_sockets_for_testing = 0;
+       grpc_forbid_dualstack_sockets_for_testing <= 1;
+       grpc_forbid_dualstack_sockets_for_testing++) {
+    /* :: and 0.0.0.0 are handled identically. */
+    test_connect("::", "127.0.0.1", 0, 1);
+    test_connect("::", "::ffff:127.0.0.1", 0, 1);
+    test_connect("::", "ipv4:127.0.0.1", 0, 1);
+    test_connect("::", "ipv6:[::ffff:127.0.0.1]", 0, 1);
+    test_connect("::", "localhost", 0, 1);
+    test_connect("0.0.0.0", "127.0.0.1", 0, 1);
+    test_connect("0.0.0.0", "::ffff:127.0.0.1", 0, 1);
+    test_connect("0.0.0.0", "ipv4:127.0.0.1", 0, 1);
+    test_connect("0.0.0.0", "ipv4:127.0.0.1,127.0.0.2,127.0.0.3", 0, 1);
+    test_connect("0.0.0.0", "ipv6:[::ffff:127.0.0.1],[::ffff:127.0.0.2]", 0, 1);
+    test_connect("0.0.0.0", "localhost", 0, 1);
+    if (do_ipv6) {
+      test_connect("::", "::1", 0, 1);
+      test_connect("0.0.0.0", "::1", 0, 1);
+      test_connect("::", "ipv6:[::1]", 0, 1);
+      test_connect("0.0.0.0", "ipv6:[::1]", 0, 1);
+    }
+
+    /* These only work when the families agree. */
+    test_connect("127.0.0.1", "127.0.0.1", 0, 1);
+    test_connect("127.0.0.1", "ipv4:127.0.0.1", 0, 1);
+    if (do_ipv6) {
+      test_connect("::1", "::1", 0, 1);
+      test_connect("::1", "127.0.0.1", 0, 0);
+      test_connect("127.0.0.1", "::1", 0, 0);
+      test_connect("::1", "ipv6:[::1]", 0, 1);
+      test_connect("::1", "ipv4:127.0.0.1", 0, 0);
+      test_connect("127.0.0.1", "ipv6:[::1]", 0, 0);
+    }
+
+    if (!external_dns_works("loopback46.unittest.grpc.io")) {
+      gpr_log(GPR_INFO, "Skipping tests that depend on *.unittest.grpc.io.");
+    } else {
+      test_connect("loopback46.unittest.grpc.io", "loopback4.unittest.grpc.io",
+                   0, 1);
+      test_connect("loopback4.unittest.grpc.io", "loopback46.unittest.grpc.io",
+                   0, 1);
+      if (do_ipv6) {
+        test_connect("loopback46.unittest.grpc.io",
+                     "loopback6.unittest.grpc.io", 0, 1);
+        test_connect("loopback6.unittest.grpc.io",
+                     "loopback46.unittest.grpc.io", 0, 1);
+        test_connect("loopback4.unittest.grpc.io", "loopback6.unittest.grpc.io",
+                     0, 0);
+        test_connect("loopback6.unittest.grpc.io", "loopback4.unittest.grpc.io",
+                     0, 0);
+      }
+    }
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/end2end/end2end_nosec_tests.c b/test/core/end2end/end2end_nosec_tests.cc
similarity index 100%
rename from test/core/end2end/end2end_nosec_tests.c
rename to test/core/end2end/end2end_nosec_tests.cc
diff --git a/test/core/end2end/end2end_test_utils.c b/test/core/end2end/end2end_test_utils.c
deleted file mode 100644
index c1f1195..0000000
--- a/test/core/end2end/end2end_test_utils.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/log.h>
-
-const char *get_host_override_string(const char *str,
-                                     grpc_end2end_test_config config) {
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) {
-    return str;
-  } else {
-    return NULL;
-  }
-}
-
-const grpc_slice *get_host_override_slice(const char *str,
-                                          grpc_end2end_test_config config) {
-  const char *r = get_host_override_string(str, config);
-  if (r != NULL) {
-    static grpc_slice ret;
-    ret = grpc_slice_from_static_string(r);
-    return &ret;
-  }
-  return NULL;
-}
-
-void validate_host_override_string(const char *pattern, grpc_slice str,
-                                   grpc_end2end_test_config config) {
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) {
-    GPR_ASSERT(0 == grpc_slice_str_cmp(str, pattern));
-  }
-}
diff --git a/test/core/end2end/end2end_test_utils.cc b/test/core/end2end/end2end_test_utils.cc
new file mode 100644
index 0000000..35f086a
--- /dev/null
+++ b/test/core/end2end/end2end_test_utils.cc
@@ -0,0 +1,50 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/log.h>
+
+const char* get_host_override_string(const char* str,
+                                     grpc_end2end_test_config config) {
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) {
+    return str;
+  } else {
+    return NULL;
+  }
+}
+
+const grpc_slice* get_host_override_slice(const char* str,
+                                          grpc_end2end_test_config config) {
+  const char* r = get_host_override_string(str, config);
+  if (r != NULL) {
+    static grpc_slice ret;
+    ret = grpc_slice_from_static_string(r);
+    return &ret;
+  }
+  return NULL;
+}
+
+void validate_host_override_string(const char* pattern, grpc_slice str,
+                                   grpc_end2end_test_config config) {
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) {
+    GPR_ASSERT(0 == grpc_slice_str_cmp(str, pattern));
+  }
+}
diff --git a/test/core/end2end/end2end_tests.c b/test/core/end2end/end2end_tests.cc
similarity index 100%
rename from test/core/end2end/end2end_tests.c
rename to test/core/end2end/end2end_tests.cc
diff --git a/test/core/end2end/end2end_tests.h b/test/core/end2end/end2end_tests.h
index 87269ec..33943a7 100644
--- a/test/core/end2end/end2end_tests.h
+++ b/test/core/end2end/end2end_tests.h
@@ -21,6 +21,10 @@
 
 #include <grpc/grpc.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct grpc_end2end_test_fixture grpc_end2end_test_fixture;
 typedef struct grpc_end2end_test_config grpc_end2end_test_config;
 
@@ -38,40 +42,44 @@
 #define FAIL_AUTH_CHECK_SERVER_ARG_NAME "fail_auth_check"
 
 struct grpc_end2end_test_fixture {
-  grpc_completion_queue *cq;
-  grpc_completion_queue *shutdown_cq;
-  grpc_server *server;
-  grpc_channel *client;
-  void *fixture_data;
+  grpc_completion_queue* cq;
+  grpc_completion_queue* shutdown_cq;
+  grpc_server* server;
+  grpc_channel* client;
+  void* fixture_data;
 };
 
 struct grpc_end2end_test_config {
   /* A descriptive name for this test fixture. */
-  const char *name;
+  const char* name;
 
   /* Which features are supported by this fixture. See feature flags above. */
   uint32_t feature_mask;
 
-  grpc_end2end_test_fixture (*create_fixture)(grpc_channel_args *client_args,
-                                              grpc_channel_args *server_args);
-  void (*init_client)(grpc_end2end_test_fixture *f,
-                      grpc_channel_args *client_args);
-  void (*init_server)(grpc_end2end_test_fixture *f,
-                      grpc_channel_args *server_args);
-  void (*tear_down_data)(grpc_end2end_test_fixture *f);
+  grpc_end2end_test_fixture (*create_fixture)(grpc_channel_args* client_args,
+                                              grpc_channel_args* server_args);
+  void (*init_client)(grpc_end2end_test_fixture* f,
+                      grpc_channel_args* client_args);
+  void (*init_server)(grpc_end2end_test_fixture* f,
+                      grpc_channel_args* server_args);
+  void (*tear_down_data)(grpc_end2end_test_fixture* f);
 };
 
 void grpc_end2end_tests_pre_init(void);
-void grpc_end2end_tests(int argc, char **argv, grpc_end2end_test_config config);
+void grpc_end2end_tests(int argc, char** argv, grpc_end2end_test_config config);
 
-const char *get_host_override_string(const char *str,
+const char* get_host_override_string(const char* str,
                                      grpc_end2end_test_config config);
 /* Returns a pointer to a statically allocated slice: future invocations
    overwrite past invocations, not threadsafe, etc... */
-const grpc_slice *get_host_override_slice(const char *str,
+const grpc_slice* get_host_override_slice(const char* str,
                                           grpc_end2end_test_config config);
 
-void validate_host_override_string(const char *pattern, grpc_slice str,
+void validate_host_override_string(const char* pattern, grpc_slice str,
                                    grpc_end2end_test_config config);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GRPC_TEST_CORE_END2END_END2END_TESTS_H */
diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.c
deleted file mode 100644
index 9870ccb..0000000
--- a/test/core/end2end/fixtures/h2_census.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_fixture_data {
-  char *localaddr;
-} fullstack_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-static grpc_arg make_census_enable_arg(void) {
-  grpc_arg arg;
-  arg.type = GRPC_ARG_INTEGER;
-  arg.key = GRPC_ARG_ENABLE_CENSUS;
-  arg.value.integer = 1;
-  return arg;
-}
-
-void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *client_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  grpc_arg arg = make_census_enable_arg();
-  client_args = grpc_channel_args_copy_and_add(client_args, &arg, 1);
-  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
-  GPR_ASSERT(f->client);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, client_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *server_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  grpc_arg arg = make_census_enable_arg();
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1);
-  f->server = grpc_server_create(server_args, NULL);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack+census", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-                                    FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-                                    FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
-     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_census.cc b/test/core/end2end/fixtures/h2_census.cc
new file mode 100644
index 0000000..4213140
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_census.cc
@@ -0,0 +1,134 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_fixture_data {
+  char* localaddr;
+} fullstack_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>(
+      gpr_malloc(sizeof(fullstack_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+static grpc_arg make_census_enable_arg(void) {
+  grpc_arg arg;
+  arg.type = GRPC_ARG_INTEGER;
+  arg.key = const_cast<char*>(GRPC_ARG_ENABLE_CENSUS);
+  arg.value.integer = 1;
+  return arg;
+}
+
+void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* client_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  grpc_arg arg = make_census_enable_arg();
+  client_args = grpc_channel_args_copy_and_add(client_args, &arg, 1);
+  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
+  GPR_ASSERT(f->client);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, client_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* server_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  grpc_arg arg = make_census_enable_arg();
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1);
+  f->server = grpc_server_create(server_args, NULL);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack+census",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
+     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_compress.c b/test/core/end2end/fixtures/h2_compress.c
deleted file mode 100644
index 9866dea..0000000
--- a/test/core/end2end/fixtures/h2_compress.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_compression_fixture_data {
-  char *localaddr;
-  grpc_channel_args *client_args_compression;
-  grpc_channel_args *server_args_compression;
-} fullstack_compression_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  fullstack_compression_fixture_data *ffd =
-      gpr_malloc(sizeof(fullstack_compression_fixture_data));
-  memset(ffd, 0, sizeof(fullstack_compression_fixture_data));
-
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  memset(&f, 0, sizeof(f));
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture *f,
-                                              grpc_channel_args *client_args) {
-  fullstack_compression_fixture_data *ffd = f->fixture_data;
-  if (ffd->client_args_compression != NULL) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, ffd->client_args_compression);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  ffd->client_args_compression = grpc_channel_args_set_compression_algorithm(
-      client_args, GRPC_COMPRESS_GZIP);
-  f->client = grpc_insecure_channel_create(ffd->localaddr,
-                                           ffd->client_args_compression, NULL);
-}
-
-void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture *f,
-                                              grpc_channel_args *server_args) {
-  fullstack_compression_fixture_data *ffd = f->fixture_data;
-  if (ffd->server_args_compression != NULL) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, ffd->server_args_compression);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  ffd->server_args_compression = grpc_channel_args_set_compression_algorithm(
-      server_args, GRPC_COMPRESS_GZIP);
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(ffd->server_args_compression, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture *f) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  fullstack_compression_fixture_data *ffd = f->fixture_data;
-  grpc_channel_args_destroy(&exec_ctx, ffd->client_args_compression);
-  grpc_channel_args_destroy(&exec_ctx, ffd->server_args_compression);
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack_compression", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-                                         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-                                         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_fullstack_compression,
-     chttp2_init_client_fullstack_compression,
-     chttp2_init_server_fullstack_compression,
-     chttp2_tear_down_fullstack_compression},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_compress.cc b/test/core/end2end/fixtures/h2_compress.cc
new file mode 100644
index 0000000..64e028b
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_compress.cc
@@ -0,0 +1,136 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_compression_fixture_data {
+  char* localaddr;
+  grpc_channel_args* client_args_compression;
+  grpc_channel_args* server_args_compression;
+} fullstack_compression_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  fullstack_compression_fixture_data* ffd =
+      static_cast<fullstack_compression_fixture_data*>(
+          gpr_malloc(sizeof(fullstack_compression_fixture_data)));
+  memset(ffd, 0, sizeof(fullstack_compression_fixture_data));
+
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  memset(&f, 0, sizeof(f));
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture* f,
+                                              grpc_channel_args* client_args) {
+  fullstack_compression_fixture_data* ffd =
+      static_cast<fullstack_compression_fixture_data*>(f->fixture_data);
+  if (ffd->client_args_compression != NULL) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, ffd->client_args_compression);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  ffd->client_args_compression = grpc_channel_args_set_compression_algorithm(
+      client_args, GRPC_COMPRESS_GZIP);
+  f->client = grpc_insecure_channel_create(ffd->localaddr,
+                                           ffd->client_args_compression, NULL);
+}
+
+void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture* f,
+                                              grpc_channel_args* server_args) {
+  fullstack_compression_fixture_data* ffd =
+      static_cast<fullstack_compression_fixture_data*>(f->fixture_data);
+  if (ffd->server_args_compression != NULL) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, ffd->server_args_compression);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  ffd->server_args_compression = grpc_channel_args_set_compression_algorithm(
+      server_args, GRPC_COMPRESS_GZIP);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(ffd->server_args_compression, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture* f) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  fullstack_compression_fixture_data* ffd =
+      static_cast<fullstack_compression_fixture_data*>(f->fixture_data);
+  grpc_channel_args_destroy(&exec_ctx, ffd->client_args_compression);
+  grpc_channel_args_destroy(&exec_ctx, ffd->server_args_compression);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack_compression",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_fullstack_compression,
+     chttp2_init_client_fullstack_compression,
+     chttp2_init_server_fullstack_compression,
+     chttp2_tear_down_fullstack_compression},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_fakesec.c b/test/core/end2end/fixtures/h2_fakesec.c
deleted file mode 100644
index e622d95..0000000
--- a/test/core/end2end/fixtures/h2_fakesec.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/security/credentials/fake/fake_credentials.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_secure_fixture_data {
-  char *localaddr;
-} fullstack_secure_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  fullstack_secure_fixture_data *ffd =
-      gpr_malloc(sizeof(fullstack_secure_fixture_data));
-
-  memset(&f, 0, sizeof(f));
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-static void process_auth_failure(void *state, grpc_auth_context *ctx,
-                                 const grpc_metadata *md, size_t md_count,
-                                 grpc_process_auth_metadata_done_cb cb,
-                                 void *user_data) {
-  GPR_ASSERT(state == NULL);
-  cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
-}
-
-static void chttp2_init_client_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *client_args,
-    grpc_channel_credentials *creds) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  f->client =
-      grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL);
-  GPR_ASSERT(f->client != NULL);
-  grpc_channel_credentials_release(creds);
-}
-
-static void chttp2_init_server_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *server_args,
-    grpc_server_credentials *server_creds) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
-                                               server_creds));
-  grpc_server_credentials_release(server_creds);
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-static void chttp2_init_client_fake_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *client_args) {
-  grpc_channel_credentials *fake_ts_creds =
-      grpc_fake_transport_security_credentials_create();
-  chttp2_init_client_secure_fullstack(f, client_args, fake_ts_creds);
-}
-
-static int fail_server_auth_check(grpc_channel_args *server_args) {
-  size_t i;
-  if (server_args == NULL) return 0;
-  for (i = 0; i < server_args->num_args; i++) {
-    if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
-        0) {
-      return 1;
-    }
-  }
-  return 0;
-}
-
-static void chttp2_init_server_fake_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *server_args) {
-  grpc_server_credentials *fake_ts_creds =
-      grpc_fake_transport_security_server_credentials_create();
-  if (fail_server_auth_check(server_args)) {
-    grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL};
-    grpc_server_credentials_set_auth_metadata_processor(fake_ts_creds,
-                                                        processor);
-  }
-  chttp2_init_server_secure_fullstack(f, server_args, fake_ts_creds);
-}
-
-/* All test configurations */
-
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fake_secure_fullstack",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_secure_fullstack,
-     chttp2_init_client_fake_secure_fullstack,
-     chttp2_init_server_fake_secure_fullstack,
-     chttp2_tear_down_secure_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_fakesec.cc b/test/core/end2end/fixtures/h2_fakesec.cc
new file mode 100644
index 0000000..fbf2f49
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_fakesec.cc
@@ -0,0 +1,155 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_secure_fixture_data {
+  char* localaddr;
+} fullstack_secure_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(
+          gpr_malloc(sizeof(fullstack_secure_fixture_data)));
+
+  memset(&f, 0, sizeof(f));
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+static void process_auth_failure(void* state, grpc_auth_context* ctx,
+                                 const grpc_metadata* md, size_t md_count,
+                                 grpc_process_auth_metadata_done_cb cb,
+                                 void* user_data) {
+  GPR_ASSERT(state == NULL);
+  cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
+}
+
+static void chttp2_init_client_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* client_args,
+    grpc_channel_credentials* creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  f->client =
+      grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL);
+  GPR_ASSERT(f->client != NULL);
+  grpc_channel_credentials_release(creds);
+}
+
+static void chttp2_init_server_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* server_args,
+    grpc_server_credentials* server_creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
+                                               server_creds));
+  grpc_server_credentials_release(server_creds);
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+static void chttp2_init_client_fake_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* client_args) {
+  grpc_channel_credentials* fake_ts_creds =
+      grpc_fake_transport_security_credentials_create();
+  chttp2_init_client_secure_fullstack(f, client_args, fake_ts_creds);
+}
+
+static int fail_server_auth_check(grpc_channel_args* server_args) {
+  size_t i;
+  if (server_args == NULL) return 0;
+  for (i = 0; i < server_args->num_args; i++) {
+    if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
+        0) {
+      return 1;
+    }
+  }
+  return 0;
+}
+
+static void chttp2_init_server_fake_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* server_args) {
+  grpc_server_credentials* fake_ts_creds =
+      grpc_fake_transport_security_server_credentials_create();
+  if (fail_server_auth_check(server_args)) {
+    grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL};
+    grpc_server_credentials_set_auth_metadata_processor(fake_ts_creds,
+                                                        processor);
+  }
+  chttp2_init_server_secure_fullstack(f, server_args, fake_ts_creds);
+}
+
+/* All test configurations */
+
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fake_secure_fullstack",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_secure_fullstack,
+     chttp2_init_client_fake_secure_fullstack,
+     chttp2_init_server_fake_secure_fullstack,
+     chttp2_tear_down_secure_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_fd.c b/test/core/end2end/fixtures/h2_fd.c
deleted file mode 100644
index e82c120..0000000
--- a/test/core/end2end/fixtures/h2_fd.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with posix sockets enabled
-#ifdef GRPC_POSIX_SOCKET
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <fcntl.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_posix.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-#include "src/core/lib/iomgr/unix_sockets_posix.h"
-#include "test/core/util/test_config.h"
-
-typedef struct { int fd_pair[2]; } sp_fixture_data;
-
-static void create_sockets(int sv[2]) {
-  int flags;
-  grpc_create_socketpair_if_unix(sv);
-  flags = fcntl(sv[0], F_GETFL, 0);
-  GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
-  flags = fcntl(sv[1], F_GETFL, 0);
-  GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
-  GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[0]) == GRPC_ERROR_NONE);
-  GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[1]) == GRPC_ERROR_NONE);
-}
-
-static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  sp_fixture_data *fixture_data = gpr_malloc(sizeof(*fixture_data));
-
-  grpc_end2end_test_fixture f;
-  memset(&f, 0, sizeof(f));
-  f.fixture_data = fixture_data;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  create_sockets(fixture_data->fd_pair);
-
-  return f;
-}
-
-static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f,
-                                          grpc_channel_args *client_args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  sp_fixture_data *sfd = f->fixture_data;
-
-  GPR_ASSERT(!f->client);
-  f->client = grpc_insecure_channel_create_from_fd(
-      "fixture_client", sfd->fd_pair[0], client_args);
-  GPR_ASSERT(f->client);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f,
-                                          grpc_channel_args *server_args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  sp_fixture_data *sfd = f->fixture_data;
-  GPR_ASSERT(!f->server);
-  f->server = grpc_server_create(server_args, NULL);
-  GPR_ASSERT(f->server);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  grpc_server_start(f->server);
-
-  grpc_server_add_insecure_channel_from_fd(f->server, NULL, sfd->fd_pair[1]);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) {
-  gpr_free(f->fixture_data);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fd", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_socketpair, chttp2_init_client_socketpair,
-     chttp2_init_server_socketpair, chttp2_tear_down_socketpair},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/end2end/fixtures/h2_fd.cc b/test/core/end2end/fixtures/h2_fd.cc
new file mode 100644
index 0000000..7005b96
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_fd.cc
@@ -0,0 +1,128 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <fcntl.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_posix.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "test/core/util/test_config.h"
+
+typedef struct {
+  int fd_pair[2];
+} sp_fixture_data;
+
+static void create_sockets(int sv[2]) {
+  int flags;
+  grpc_create_socketpair_if_unix(sv);
+  flags = fcntl(sv[0], F_GETFL, 0);
+  GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
+  flags = fcntl(sv[1], F_GETFL, 0);
+  GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
+  GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[0]) == GRPC_ERROR_NONE);
+  GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[1]) == GRPC_ERROR_NONE);
+}
+
+static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  sp_fixture_data* fixture_data =
+      static_cast<sp_fixture_data*>(gpr_malloc(sizeof(*fixture_data)));
+
+  grpc_end2end_test_fixture f;
+  memset(&f, 0, sizeof(f));
+  f.fixture_data = fixture_data;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  create_sockets(fixture_data->fd_pair);
+
+  return f;
+}
+
+static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f,
+                                          grpc_channel_args* client_args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  sp_fixture_data* sfd = static_cast<sp_fixture_data*>(f->fixture_data);
+
+  GPR_ASSERT(!f->client);
+  f->client = grpc_insecure_channel_create_from_fd(
+      "fixture_client", sfd->fd_pair[0], client_args);
+  GPR_ASSERT(f->client);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f,
+                                          grpc_channel_args* server_args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  sp_fixture_data* sfd = static_cast<sp_fixture_data*>(f->fixture_data);
+  GPR_ASSERT(!f->server);
+  f->server = grpc_server_create(server_args, NULL);
+  GPR_ASSERT(f->server);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  grpc_server_start(f->server);
+
+  grpc_server_add_insecure_channel_from_fd(f->server, NULL, sfd->fd_pair[1]);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) {
+  gpr_free(f->fixture_data);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fd", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_socketpair, chttp2_init_client_socketpair,
+     chttp2_init_server_socketpair, chttp2_tear_down_socketpair},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/end2end/fixtures/h2_full+pipe.c b/test/core/end2end/fixtures/h2_full+pipe.c
deleted file mode 100644
index c764bd7..0000000
--- a/test/core/end2end/fixtures/h2_full+pipe.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test requires posix wakeup fds
-#ifdef GRPC_POSIX_WAKEUP_FD
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/iomgr/wakeup_fd_posix.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_fixture_data {
-  char *localaddr;
-} fullstack_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *client_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
-  GPR_ASSERT(f->client);
-}
-
-void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *server_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-                             FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-                             FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
-     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_allow_specialized_wakeup_fd = 0;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
-
-#else /* GRPC_POSIX_WAKEUP_FD */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_WAKEUP_FD */
diff --git a/test/core/end2end/fixtures/h2_full+pipe.cc b/test/core/end2end/fixtures/h2_full+pipe.cc
new file mode 100644
index 0000000..0dd650b
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_full+pipe.cc
@@ -0,0 +1,125 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test requires posix wakeup fds
+#ifdef GRPC_POSIX_WAKEUP_FD
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/iomgr/wakeup_fd_posix.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_fixture_data {
+  char* localaddr;
+} fullstack_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>(
+      gpr_malloc(sizeof(fullstack_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* client_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
+  GPR_ASSERT(f->client);
+}
+
+void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* server_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
+     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_allow_specialized_wakeup_fd = 0;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
+
+#else /* GRPC_POSIX_WAKEUP_FD */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_WAKEUP_FD */
diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.c
deleted file mode 100644
index 7eb29e0..0000000
--- a/test/core/end2end/fixtures/h2_full+trace.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-#ifdef GRPC_POSIX_SOCKET
-#include <unistd.h>
-#endif
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_fixture_data {
-  char *localaddr;
-} fullstack_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *client_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
-  GPR_ASSERT(f->client);
-}
-
-void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *server_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-                             FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-                             FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
-     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  /* force tracing on, with a value to force many
-     code paths in trace.c to be taken */
-  gpr_setenv("GRPC_TRACE", "doesnt-exist,http,all");
-
-#ifdef GRPC_POSIX_SOCKET
-  g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10 : 1;
-#else
-  g_fixture_slowdown_factor = 10;
-#endif
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  GPR_ASSERT(0 == grpc_tracer_set_enabled("also-doesnt-exist", 0));
-  GPR_ASSERT(1 == grpc_tracer_set_enabled("http", 1));
-  GPR_ASSERT(1 == grpc_tracer_set_enabled("all", 1));
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_full+trace.cc b/test/core/end2end/fixtures/h2_full+trace.cc
new file mode 100644
index 0000000..21372c6
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_full+trace.cc
@@ -0,0 +1,131 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+#ifdef GRPC_POSIX_SOCKET
+#include <unistd.h>
+#endif
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_fixture_data {
+  char* localaddr;
+} fullstack_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>(
+      gpr_malloc(sizeof(fullstack_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* client_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
+  GPR_ASSERT(f->client);
+}
+
+void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* server_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
+     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  /* force tracing on, with a value to force many
+     code paths in trace.c to be taken */
+  gpr_setenv("GRPC_TRACE", "doesnt-exist,http,all");
+
+#ifdef GRPC_POSIX_SOCKET
+  g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10 : 1;
+#else
+  g_fixture_slowdown_factor = 10;
+#endif
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  GPR_ASSERT(0 == grpc_tracer_set_enabled("also-doesnt-exist", 0));
+  GPR_ASSERT(1 == grpc_tracer_set_enabled("http", 1));
+  GPR_ASSERT(1 == grpc_tracer_set_enabled("all", 1));
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_full+workarounds.c b/test/core/end2end/fixtures/h2_full+workarounds.c
deleted file mode 100644
index a98e5ad..0000000
--- a/test/core/end2end/fixtures/h2_full+workarounds.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include <grpc/support/workaround_list.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static char *workarounds_arg[GRPC_MAX_WORKAROUND_ID] = {
-    GRPC_ARG_WORKAROUND_CRONET_COMPRESSION};
-
-typedef struct fullstack_fixture_data {
-  char *localaddr;
-} fullstack_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *client_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
-  GPR_ASSERT(f->client);
-}
-
-void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *server_args) {
-  int i;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  fullstack_fixture_data *ffd = f->fixture_data;
-  grpc_arg args[GRPC_MAX_WORKAROUND_ID];
-  for (i = 0; i < GRPC_MAX_WORKAROUND_ID; i++) {
-    args[i].key = workarounds_arg[i];
-    args[i].type = GRPC_ARG_INTEGER;
-    args[i].value.integer = 1;
-  }
-  grpc_channel_args *server_args_new =
-      grpc_channel_args_copy_and_add(server_args, args, GRPC_MAX_WORKAROUND_ID);
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args_new, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
-  grpc_server_start(f->server);
-  grpc_channel_args_destroy(&exec_ctx, server_args_new);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-                             FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-                             FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER |
-                             FEATURE_MASK_SUPPORTS_WORKAROUNDS,
-     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
-     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_full+workarounds.cc b/test/core/end2end/fixtures/h2_full+workarounds.cc
new file mode 100644
index 0000000..ebffe21
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_full+workarounds.cc
@@ -0,0 +1,128 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include <grpc/support/workaround_list.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static char* workarounds_arg[GRPC_MAX_WORKAROUND_ID] = {
+    const_cast<char*>(GRPC_ARG_WORKAROUND_CRONET_COMPRESSION)};
+
+typedef struct fullstack_fixture_data {
+  char* localaddr;
+} fullstack_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>(
+      gpr_malloc(sizeof(fullstack_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* client_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
+  GPR_ASSERT(f->client);
+}
+
+void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* server_args) {
+  int i;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  grpc_arg args[GRPC_MAX_WORKAROUND_ID];
+  for (i = 0; i < GRPC_MAX_WORKAROUND_ID; i++) {
+    args[i].key = workarounds_arg[i];
+    args[i].type = GRPC_ARG_INTEGER;
+    args[i].value.integer = 1;
+  }
+  grpc_channel_args* server_args_new =
+      grpc_channel_args_copy_and_add(server_args, args, GRPC_MAX_WORKAROUND_ID);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args_new, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
+  grpc_server_start(f->server);
+  grpc_channel_args_destroy(&exec_ctx, server_args_new);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER |
+         FEATURE_MASK_SUPPORTS_WORKAROUNDS,
+     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
+     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_full.c b/test/core/end2end/fixtures/h2_full.c
deleted file mode 100644
index ae68bd9..0000000
--- a/test/core/end2end/fixtures/h2_full.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_fixture_data {
-  char *localaddr;
-} fullstack_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *client_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
-  GPR_ASSERT(f->client);
-}
-
-void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *server_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-                             FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-                             FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
-     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_full.cc b/test/core/end2end/fixtures/h2_full.cc
new file mode 100644
index 0000000..895af67
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_full.cc
@@ -0,0 +1,111 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_fixture_data {
+  char* localaddr;
+} fullstack_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>(
+      gpr_malloc(sizeof(fullstack_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* client_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
+  GPR_ASSERT(f->client);
+}
+
+void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* server_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
+     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_http_proxy.c b/test/core/end2end/fixtures/h2_http_proxy.c
deleted file mode 100644
index 6145892..0000000
--- a/test/core/end2end/fixtures/h2_http_proxy.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/end2end/fixtures/http_proxy_fixture.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_fixture_data {
-  char *server_addr;
-  grpc_end2end_http_proxy *proxy;
-} fullstack_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  memset(&f, 0, sizeof(f));
-  fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data));
-  const int server_port = grpc_pick_unused_port_or_die();
-  gpr_join_host_port(&ffd->server_addr, "localhost", server_port);
-
-  /* Passing client_args to proxy_create for the case of checking for proxy auth
-   */
-  ffd->proxy = grpc_end2end_http_proxy_create(client_args);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *client_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  char *proxy_uri;
-
-  /* If testing for proxy auth, add credentials to proxy uri */
-  const grpc_arg *proxy_auth_arg =
-      grpc_channel_args_find(client_args, GRPC_ARG_HTTP_PROXY_AUTH_CREDS);
-  if (proxy_auth_arg == NULL || proxy_auth_arg->type != GRPC_ARG_STRING) {
-    gpr_asprintf(&proxy_uri, "http://%s",
-                 grpc_end2end_http_proxy_get_proxy_name(ffd->proxy));
-  } else {
-    gpr_asprintf(&proxy_uri, "http://%s@%s", proxy_auth_arg->value.string,
-                 grpc_end2end_http_proxy_get_proxy_name(ffd->proxy));
-  }
-  gpr_setenv("http_proxy", proxy_uri);
-  gpr_free(proxy_uri);
-  f->client = grpc_insecure_channel_create(ffd->server_addr, client_args, NULL);
-  GPR_ASSERT(f->client);
-}
-
-void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *server_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->server_addr));
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->server_addr);
-  grpc_end2end_http_proxy_destroy(ffd->proxy);
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-                             FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-                             FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
-     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_http_proxy.cc b/test/core/end2end/fixtures/h2_http_proxy.cc
new file mode 100644
index 0000000..a67ce82
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_http_proxy.cc
@@ -0,0 +1,133 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/end2end/fixtures/http_proxy_fixture.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_fixture_data {
+  char* server_addr;
+  grpc_end2end_http_proxy* proxy;
+} fullstack_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  memset(&f, 0, sizeof(f));
+  fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>(
+      gpr_malloc(sizeof(fullstack_fixture_data)));
+  const int server_port = grpc_pick_unused_port_or_die();
+  gpr_join_host_port(&ffd->server_addr, "localhost", server_port);
+
+  /* Passing client_args to proxy_create for the case of checking for proxy auth
+   */
+  ffd->proxy = grpc_end2end_http_proxy_create(client_args);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* client_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  char* proxy_uri;
+
+  /* If testing for proxy auth, add credentials to proxy uri */
+  const grpc_arg* proxy_auth_arg =
+      grpc_channel_args_find(client_args, GRPC_ARG_HTTP_PROXY_AUTH_CREDS);
+  if (proxy_auth_arg == NULL || proxy_auth_arg->type != GRPC_ARG_STRING) {
+    gpr_asprintf(&proxy_uri, "http://%s",
+                 grpc_end2end_http_proxy_get_proxy_name(ffd->proxy));
+  } else {
+    gpr_asprintf(&proxy_uri, "http://%s@%s", proxy_auth_arg->value.string,
+                 grpc_end2end_http_proxy_get_proxy_name(ffd->proxy));
+  }
+  gpr_setenv("http_proxy", proxy_uri);
+  gpr_free(proxy_uri);
+  f->client = grpc_insecure_channel_create(ffd->server_addr, client_args, NULL);
+  GPR_ASSERT(f->client);
+}
+
+void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* server_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->server_addr));
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->server_addr);
+  grpc_end2end_http_proxy_destroy(ffd->proxy);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
+     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_load_reporting.c b/test/core/end2end/fixtures/h2_load_reporting.c
deleted file mode 100644
index 8a05bb7..0000000
--- a/test/core/end2end/fixtures/h2_load_reporting.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct load_reporting_fixture_data {
-  char *localaddr;
-} load_reporting_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  load_reporting_fixture_data *ffd =
-      gpr_malloc(sizeof(load_reporting_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void chttp2_init_client_load_reporting(grpc_end2end_test_fixture *f,
-                                       grpc_channel_args *client_args) {
-  load_reporting_fixture_data *ffd = f->fixture_data;
-  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
-  GPR_ASSERT(f->client);
-}
-
-void chttp2_init_server_load_reporting(grpc_end2end_test_fixture *f,
-                                       grpc_channel_args *server_args) {
-  load_reporting_fixture_data *ffd = f->fixture_data;
-  grpc_arg arg = grpc_load_reporting_enable_arg();
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1);
-  f->server = grpc_server_create(server_args, NULL);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture *f) {
-  load_reporting_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack+load_reporting",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_load_reporting, chttp2_init_client_load_reporting,
-     chttp2_init_server_load_reporting, chttp2_tear_down_load_reporting},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_load_reporting.cc b/test/core/end2end/fixtures/h2_load_reporting.cc
new file mode 100644
index 0000000..b402fc5
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_load_reporting.cc
@@ -0,0 +1,120 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct load_reporting_fixture_data {
+  char* localaddr;
+} load_reporting_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  load_reporting_fixture_data* ffd = static_cast<load_reporting_fixture_data*>(
+      gpr_malloc(sizeof(load_reporting_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void chttp2_init_client_load_reporting(grpc_end2end_test_fixture* f,
+                                       grpc_channel_args* client_args) {
+  load_reporting_fixture_data* ffd =
+      static_cast<load_reporting_fixture_data*>(f->fixture_data);
+  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
+  GPR_ASSERT(f->client);
+}
+
+void chttp2_init_server_load_reporting(grpc_end2end_test_fixture* f,
+                                       grpc_channel_args* server_args) {
+  load_reporting_fixture_data* ffd =
+      static_cast<load_reporting_fixture_data*>(f->fixture_data);
+  grpc_arg arg = grpc_load_reporting_enable_arg();
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1);
+  f->server = grpc_server_create(server_args, NULL);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture* f) {
+  load_reporting_fixture_data* ffd =
+      static_cast<load_reporting_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack+load_reporting",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_load_reporting, chttp2_init_client_load_reporting,
+     chttp2_init_server_load_reporting, chttp2_tear_down_load_reporting},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_oauth2.c b/test/core/end2end/fixtures/h2_oauth2.c
deleted file mode 100644
index ee1d0b1..0000000
--- a/test/core/end2end/fixtures/h2_oauth2.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static const char oauth2_md[] = "Bearer aaslkfjs424535asdf";
-static const char *client_identity_property_name = "smurf_name";
-static const char *client_identity = "Brainy Smurf";
-
-typedef struct fullstack_secure_fixture_data {
-  char *localaddr;
-} fullstack_secure_fixture_data;
-
-static const grpc_metadata *find_metadata(const grpc_metadata *md,
-                                          size_t md_count, const char *key,
-                                          const char *value) {
-  size_t i;
-  for (i = 0; i < md_count; i++) {
-    if (grpc_slice_str_cmp(md[i].key, key) == 0 &&
-        grpc_slice_str_cmp(md[i].value, value) == 0) {
-      return &md[i];
-    }
-  }
-  return NULL;
-}
-
-typedef struct { size_t pseudo_refcount; } test_processor_state;
-
-static void process_oauth2_success(void *state, grpc_auth_context *ctx,
-                                   const grpc_metadata *md, size_t md_count,
-                                   grpc_process_auth_metadata_done_cb cb,
-                                   void *user_data) {
-  const grpc_metadata *oauth2 =
-      find_metadata(md, md_count, "authorization", oauth2_md);
-  test_processor_state *s;
-
-  GPR_ASSERT(state != NULL);
-  s = (test_processor_state *)state;
-  GPR_ASSERT(s->pseudo_refcount == 1);
-  GPR_ASSERT(oauth2 != NULL);
-  grpc_auth_context_add_cstring_property(ctx, client_identity_property_name,
-                                         client_identity);
-  GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(
-                 ctx, client_identity_property_name) == 1);
-  cb(user_data, oauth2, 1, NULL, 0, GRPC_STATUS_OK, NULL);
-}
-
-static void process_oauth2_failure(void *state, grpc_auth_context *ctx,
-                                   const grpc_metadata *md, size_t md_count,
-                                   grpc_process_auth_metadata_done_cb cb,
-                                   void *user_data) {
-  const grpc_metadata *oauth2 =
-      find_metadata(md, md_count, "authorization", oauth2_md);
-  test_processor_state *s;
-  GPR_ASSERT(state != NULL);
-  s = (test_processor_state *)state;
-  GPR_ASSERT(s->pseudo_refcount == 1);
-  GPR_ASSERT(oauth2 != NULL);
-  cb(user_data, oauth2, 1, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
-}
-
-static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  fullstack_secure_fixture_data *ffd =
-      gpr_malloc(sizeof(fullstack_secure_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-static void chttp2_init_client_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *client_args,
-    grpc_channel_credentials *creds) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  f->client =
-      grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL);
-  GPR_ASSERT(f->client != NULL);
-  grpc_channel_credentials_release(creds);
-}
-
-static void chttp2_init_server_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *server_args,
-    grpc_server_credentials *server_creds) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
-                                               server_creds));
-  grpc_server_credentials_release(server_creds);
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *client_args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_channel_credentials *ssl_creds =
-      grpc_ssl_credentials_create(test_root_cert, NULL, NULL);
-  grpc_call_credentials *oauth2_creds = grpc_md_only_test_credentials_create(
-      &exec_ctx, "authorization", oauth2_md, true /* is_async */);
-  grpc_channel_credentials *ssl_oauth2_creds =
-      grpc_composite_channel_credentials_create(ssl_creds, oauth2_creds, NULL);
-  grpc_arg ssl_name_override = {GRPC_ARG_STRING,
-                                GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
-                                {"foo.test.google.fr"}};
-  grpc_channel_args *new_client_args =
-      grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1);
-  chttp2_init_client_secure_fullstack(f, new_client_args, ssl_oauth2_creds);
-  grpc_channel_args_destroy(&exec_ctx, new_client_args);
-  grpc_channel_credentials_release(ssl_creds);
-  grpc_call_credentials_release(oauth2_creds);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static int fail_server_auth_check(grpc_channel_args *server_args) {
-  size_t i;
-  if (server_args == NULL) return 0;
-  for (i = 0; i < server_args->num_args; i++) {
-    if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
-        0) {
-      return 1;
-    }
-  }
-  return 0;
-}
-
-static void processor_destroy(void *state) {
-  test_processor_state *s = (test_processor_state *)state;
-  GPR_ASSERT((s->pseudo_refcount--) == 1);
-  gpr_free(s);
-}
-
-static grpc_auth_metadata_processor test_processor_create(int failing) {
-  test_processor_state *s = gpr_malloc(sizeof(*s));
-  grpc_auth_metadata_processor result;
-  s->pseudo_refcount = 1;
-  result.state = s;
-  result.destroy = processor_destroy;
-  if (failing) {
-    result.process = process_oauth2_failure;
-  } else {
-    result.process = process_oauth2_success;
-  }
-  return result;
-}
-
-static void chttp2_init_server_simple_ssl_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *server_args) {
-  grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
-                                                  test_server1_cert};
-  grpc_server_credentials *ssl_creds =
-      grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL);
-  grpc_server_credentials_set_auth_metadata_processor(
-      ssl_creds, test_processor_create(fail_server_auth_check(server_args)));
-  chttp2_init_server_secure_fullstack(f, server_args, ssl_creds);
-}
-
-/* All test configurations */
-
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/simple_ssl_with_oauth2_fullstack",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_secure_fullstack,
-     chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack,
-     chttp2_init_server_simple_ssl_secure_fullstack,
-     chttp2_tear_down_secure_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_oauth2.cc b/test/core/end2end/fixtures/h2_oauth2.cc
new file mode 100644
index 0000000..88e590a
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_oauth2.cc
@@ -0,0 +1,237 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static const char oauth2_md[] = "Bearer aaslkfjs424535asdf";
+static const char* client_identity_property_name = "smurf_name";
+static const char* client_identity = "Brainy Smurf";
+
+typedef struct fullstack_secure_fixture_data {
+  char* localaddr;
+} fullstack_secure_fixture_data;
+
+static const grpc_metadata* find_metadata(const grpc_metadata* md,
+                                          size_t md_count, const char* key,
+                                          const char* value) {
+  size_t i;
+  for (i = 0; i < md_count; i++) {
+    if (grpc_slice_str_cmp(md[i].key, key) == 0 &&
+        grpc_slice_str_cmp(md[i].value, value) == 0) {
+      return &md[i];
+    }
+  }
+  return NULL;
+}
+
+typedef struct {
+  size_t pseudo_refcount;
+} test_processor_state;
+
+static void process_oauth2_success(void* state, grpc_auth_context* ctx,
+                                   const grpc_metadata* md, size_t md_count,
+                                   grpc_process_auth_metadata_done_cb cb,
+                                   void* user_data) {
+  const grpc_metadata* oauth2 =
+      find_metadata(md, md_count, "authorization", oauth2_md);
+  test_processor_state* s;
+
+  GPR_ASSERT(state != NULL);
+  s = (test_processor_state*)state;
+  GPR_ASSERT(s->pseudo_refcount == 1);
+  GPR_ASSERT(oauth2 != NULL);
+  grpc_auth_context_add_cstring_property(ctx, client_identity_property_name,
+                                         client_identity);
+  GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(
+                 ctx, client_identity_property_name) == 1);
+  cb(user_data, oauth2, 1, NULL, 0, GRPC_STATUS_OK, NULL);
+}
+
+static void process_oauth2_failure(void* state, grpc_auth_context* ctx,
+                                   const grpc_metadata* md, size_t md_count,
+                                   grpc_process_auth_metadata_done_cb cb,
+                                   void* user_data) {
+  const grpc_metadata* oauth2 =
+      find_metadata(md, md_count, "authorization", oauth2_md);
+  test_processor_state* s;
+  GPR_ASSERT(state != NULL);
+  s = (test_processor_state*)state;
+  GPR_ASSERT(s->pseudo_refcount == 1);
+  GPR_ASSERT(oauth2 != NULL);
+  cb(user_data, oauth2, 1, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
+}
+
+static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(
+          gpr_malloc(sizeof(fullstack_secure_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+static void chttp2_init_client_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* client_args,
+    grpc_channel_credentials* creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  f->client =
+      grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL);
+  GPR_ASSERT(f->client != NULL);
+  grpc_channel_credentials_release(creds);
+}
+
+static void chttp2_init_server_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* server_args,
+    grpc_server_credentials* server_creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
+                                               server_creds));
+  grpc_server_credentials_release(server_creds);
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* client_args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_channel_credentials* ssl_creds =
+      grpc_ssl_credentials_create(test_root_cert, NULL, NULL);
+  grpc_call_credentials* oauth2_creds = grpc_md_only_test_credentials_create(
+      &exec_ctx, "authorization", oauth2_md, true /* is_async */);
+  grpc_channel_credentials* ssl_oauth2_creds =
+      grpc_composite_channel_credentials_create(ssl_creds, oauth2_creds, NULL);
+  grpc_arg ssl_name_override = {
+      GRPC_ARG_STRING,
+      const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
+      {const_cast<char*>("foo.test.google.fr")}};
+  grpc_channel_args* new_client_args =
+      grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1);
+  chttp2_init_client_secure_fullstack(f, new_client_args, ssl_oauth2_creds);
+  grpc_channel_args_destroy(&exec_ctx, new_client_args);
+  grpc_channel_credentials_release(ssl_creds);
+  grpc_call_credentials_release(oauth2_creds);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static int fail_server_auth_check(grpc_channel_args* server_args) {
+  size_t i;
+  if (server_args == NULL) return 0;
+  for (i = 0; i < server_args->num_args; i++) {
+    if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
+        0) {
+      return 1;
+    }
+  }
+  return 0;
+}
+
+static void processor_destroy(void* state) {
+  test_processor_state* s = (test_processor_state*)state;
+  GPR_ASSERT((s->pseudo_refcount--) == 1);
+  gpr_free(s);
+}
+
+static grpc_auth_metadata_processor test_processor_create(int failing) {
+  test_processor_state* s =
+      static_cast<test_processor_state*>(gpr_malloc(sizeof(*s)));
+  grpc_auth_metadata_processor result;
+  s->pseudo_refcount = 1;
+  result.state = s;
+  result.destroy = processor_destroy;
+  if (failing) {
+    result.process = process_oauth2_failure;
+  } else {
+    result.process = process_oauth2_success;
+  }
+  return result;
+}
+
+static void chttp2_init_server_simple_ssl_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* server_args) {
+  grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
+                                                  test_server1_cert};
+  grpc_server_credentials* ssl_creds =
+      grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1, 0, NULL);
+  grpc_server_credentials_set_auth_metadata_processor(
+      ssl_creds, test_processor_create(fail_server_auth_check(server_args)));
+  chttp2_init_server_secure_fullstack(f, server_args, ssl_creds);
+}
+
+/* All test configurations */
+
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/simple_ssl_with_oauth2_fullstack",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_secure_fullstack,
+     chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack,
+     chttp2_init_server_simple_ssl_secure_fullstack,
+     chttp2_tear_down_secure_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_proxy.c b/test/core/end2end/fixtures/h2_proxy.c
deleted file mode 100644
index 069130b..0000000
--- a/test/core/end2end/fixtures/h2_proxy.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/end2end/fixtures/proxy.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_fixture_data {
-  grpc_end2end_proxy *proxy;
-} fullstack_fixture_data;
-
-static grpc_server *create_proxy_server(const char *port,
-                                        grpc_channel_args *server_args) {
-  grpc_server *s = grpc_server_create(server_args, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(s, port));
-  return s;
-}
-
-static grpc_channel *create_proxy_client(const char *target,
-                                         grpc_channel_args *client_args) {
-  return grpc_insecure_channel_create(target, client_args, NULL);
-}
-
-static const grpc_end2end_proxy_def proxy_def = {create_proxy_server,
-                                                 create_proxy_client};
-
-static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *client_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  f->client = grpc_insecure_channel_create(
-      grpc_end2end_proxy_get_client_target(ffd->proxy), client_args, NULL);
-  GPR_ASSERT(f->client);
-}
-
-void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *server_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(
-      f->server, grpc_end2end_proxy_get_server_port(ffd->proxy)));
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  grpc_end2end_proxy_destroy(ffd->proxy);
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack+proxy", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-                                   FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
-                                   FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-                                   FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
-     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_proxy.cc b/test/core/end2end/fixtures/h2_proxy.cc
new file mode 100644
index 0000000..03ffa02
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_proxy.cc
@@ -0,0 +1,129 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/end2end/fixtures/proxy.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_fixture_data {
+  grpc_end2end_proxy* proxy;
+} fullstack_fixture_data;
+
+static grpc_server* create_proxy_server(const char* port,
+                                        grpc_channel_args* server_args) {
+  grpc_server* s = grpc_server_create(server_args, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(s, port));
+  return s;
+}
+
+static grpc_channel* create_proxy_client(const char* target,
+                                         grpc_channel_args* client_args) {
+  return grpc_insecure_channel_create(target, client_args, NULL);
+}
+
+static const grpc_end2end_proxy_def proxy_def = {create_proxy_server,
+                                                 create_proxy_client};
+
+static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>(
+      gpr_malloc(sizeof(fullstack_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* client_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  f->client = grpc_insecure_channel_create(
+      grpc_end2end_proxy_get_client_target(ffd->proxy), client_args, NULL);
+  GPR_ASSERT(f->client);
+}
+
+void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* server_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(
+      f->server, grpc_end2end_proxy_get_server_port(ffd->proxy)));
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  grpc_end2end_proxy_destroy(ffd->proxy);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack+proxy",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
+     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c
deleted file mode 100644
index 39ccb84..0000000
--- a/test/core/end2end/fixtures/h2_sockpair+trace.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-#ifdef GRPC_POSIX_SOCKET
-#include <unistd.h>
-#endif
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/client/http_client_filter.h"
-#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/completion_queue.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-/* chttp2 transport that is immediately available (used for testing
-   connected_channel without a client_channel */
-
-static void server_setup_transport(void *ts, grpc_transport *transport) {
-  grpc_end2end_test_fixture *f = ts;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_pair *sfd = f->fixture_data;
-  grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
-  grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL,
-                              grpc_server_get_channel_args(f->server));
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-typedef struct {
-  grpc_end2end_test_fixture *f;
-  grpc_channel_args *client_args;
-} sp_client_setup;
-
-static void client_setup_transport(grpc_exec_ctx *exec_ctx, void *ts,
-                                   grpc_transport *transport) {
-  sp_client_setup *cs = ts;
-
-  cs->f->client =
-      grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args,
-                          GRPC_CLIENT_DIRECT_CHANNEL, transport);
-}
-
-static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_endpoint_pair *sfd = gpr_malloc(sizeof(grpc_endpoint_pair));
-
-  grpc_end2end_test_fixture f;
-  memset(&f, 0, sizeof(f));
-  f.fixture_data = sfd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);
-
-  return f;
-}
-
-static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f,
-                                          grpc_channel_args *client_args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_pair *sfd = f->fixture_data;
-  grpc_transport *transport;
-  sp_client_setup cs;
-  cs.client_args = client_args;
-  cs.f = f;
-  transport =
-      grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
-  client_setup_transport(&exec_ctx, &cs, transport);
-  GPR_ASSERT(f->client);
-  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f,
-                                          grpc_channel_args *server_args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_pair *sfd = f->fixture_data;
-  grpc_transport *transport;
-  GPR_ASSERT(!f->server);
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  grpc_server_start(f->server);
-  transport =
-      grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
-  server_setup_transport(f, transport);
-  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) {
-  gpr_free(f->fixture_data);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/socketpair", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_socketpair, chttp2_init_client_socketpair,
-     chttp2_init_server_socketpair, chttp2_tear_down_socketpair},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  /* force tracing on, with a value to force many
-     code paths in trace.c to be taken */
-  gpr_setenv("GRPC_TRACE", "doesnt-exist,http,all");
-#ifdef GRPC_POSIX_SOCKET
-  g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10 : 1;
-#else
-  g_fixture_slowdown_factor = 10;
-#endif
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  GPR_ASSERT(0 == grpc_tracer_set_enabled("also-doesnt-exist", 0));
-  GPR_ASSERT(1 == grpc_tracer_set_enabled("http", 1));
-  GPR_ASSERT(1 == grpc_tracer_set_enabled("all", 1));
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.cc b/test/core/end2end/fixtures/h2_sockpair+trace.cc
new file mode 100644
index 0000000..c5dfe40
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_sockpair+trace.cc
@@ -0,0 +1,163 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+#ifdef GRPC_POSIX_SOCKET
+#include <unistd.h>
+#endif
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/client/http_client_filter.h"
+#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/completion_queue.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+/* chttp2 transport that is immediately available (used for testing
+   connected_channel without a client_channel */
+
+static void server_setup_transport(void* ts, grpc_transport* transport) {
+  grpc_end2end_test_fixture* f = static_cast<grpc_end2end_test_fixture*>(ts);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+  grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
+  grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL,
+                              grpc_server_get_channel_args(f->server));
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+typedef struct {
+  grpc_end2end_test_fixture* f;
+  grpc_channel_args* client_args;
+} sp_client_setup;
+
+static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts,
+                                   grpc_transport* transport) {
+  sp_client_setup* cs = static_cast<sp_client_setup*>(ts);
+
+  cs->f->client =
+      grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args,
+                          GRPC_CLIENT_DIRECT_CHANNEL, transport);
+}
+
+static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_endpoint_pair* sfd =
+      static_cast<grpc_endpoint_pair*>(gpr_malloc(sizeof(grpc_endpoint_pair)));
+
+  grpc_end2end_test_fixture f;
+  memset(&f, 0, sizeof(f));
+  f.fixture_data = sfd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);
+
+  return f;
+}
+
+static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f,
+                                          grpc_channel_args* client_args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+  grpc_transport* transport;
+  sp_client_setup cs;
+  cs.client_args = client_args;
+  cs.f = f;
+  transport =
+      grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
+  client_setup_transport(&exec_ctx, &cs, transport);
+  GPR_ASSERT(f->client);
+  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f,
+                                          grpc_channel_args* server_args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+  grpc_transport* transport;
+  GPR_ASSERT(!f->server);
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  grpc_server_start(f->server);
+  transport =
+      grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
+  server_setup_transport(f, transport);
+  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) {
+  gpr_free(f->fixture_data);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/socketpair", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_socketpair, chttp2_init_client_socketpair,
+     chttp2_init_server_socketpair, chttp2_tear_down_socketpair},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  /* force tracing on, with a value to force many
+     code paths in trace.c to be taken */
+  gpr_setenv("GRPC_TRACE", "doesnt-exist,http,all");
+#ifdef GRPC_POSIX_SOCKET
+  g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10 : 1;
+#else
+  g_fixture_slowdown_factor = 10;
+#endif
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  GPR_ASSERT(0 == grpc_tracer_set_enabled("also-doesnt-exist", 0));
+  GPR_ASSERT(1 == grpc_tracer_set_enabled("http", 1));
+  GPR_ASSERT(1 == grpc_tracer_set_enabled("all", 1));
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_sockpair.c b/test/core/end2end/fixtures/h2_sockpair.c
deleted file mode 100644
index 03566ea..0000000
--- a/test/core/end2end/fixtures/h2_sockpair.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/client/http_client_filter.h"
-#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/completion_queue.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-/* chttp2 transport that is immediately available (used for testing
-   connected_channel without a client_channel */
-
-static void server_setup_transport(void *ts, grpc_transport *transport) {
-  grpc_end2end_test_fixture *f = ts;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_pair *sfd = f->fixture_data;
-  grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
-  grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL,
-                              grpc_server_get_channel_args(f->server));
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-typedef struct {
-  grpc_end2end_test_fixture *f;
-  grpc_channel_args *client_args;
-} sp_client_setup;
-
-static void client_setup_transport(grpc_exec_ctx *exec_ctx, void *ts,
-                                   grpc_transport *transport) {
-  sp_client_setup *cs = ts;
-
-  cs->f->client =
-      grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args,
-                          GRPC_CLIENT_DIRECT_CHANNEL, transport);
-}
-
-static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_endpoint_pair *sfd = gpr_malloc(sizeof(grpc_endpoint_pair));
-
-  grpc_end2end_test_fixture f;
-  memset(&f, 0, sizeof(f));
-  f.fixture_data = sfd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);
-
-  return f;
-}
-
-static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f,
-                                          grpc_channel_args *client_args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_pair *sfd = f->fixture_data;
-  grpc_transport *transport;
-  sp_client_setup cs;
-  cs.client_args = client_args;
-  cs.f = f;
-  transport =
-      grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
-  client_setup_transport(&exec_ctx, &cs, transport);
-  GPR_ASSERT(f->client);
-  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f,
-                                          grpc_channel_args *server_args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_pair *sfd = f->fixture_data;
-  grpc_transport *transport;
-  GPR_ASSERT(!f->server);
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  grpc_server_start(f->server);
-  transport =
-      grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
-  server_setup_transport(f, transport);
-  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) {
-  gpr_free(f->fixture_data);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/socketpair", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_socketpair, chttp2_init_client_socketpair,
-     chttp2_init_server_socketpair, chttp2_tear_down_socketpair},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_sockpair.cc b/test/core/end2end/fixtures/h2_sockpair.cc
new file mode 100644
index 0000000..f07722e
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_sockpair.cc
@@ -0,0 +1,142 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/client/http_client_filter.h"
+#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/completion_queue.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+/* chttp2 transport that is immediately available (used for testing
+   connected_channel without a client_channel */
+
+static void server_setup_transport(void* ts, grpc_transport* transport) {
+  grpc_end2end_test_fixture* f = static_cast<grpc_end2end_test_fixture*>(ts);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+  grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
+  grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL,
+                              grpc_server_get_channel_args(f->server));
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+typedef struct {
+  grpc_end2end_test_fixture* f;
+  grpc_channel_args* client_args;
+} sp_client_setup;
+
+static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts,
+                                   grpc_transport* transport) {
+  sp_client_setup* cs = static_cast<sp_client_setup*>(ts);
+
+  cs->f->client =
+      grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args,
+                          GRPC_CLIENT_DIRECT_CHANNEL, transport);
+}
+
+static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_endpoint_pair* sfd =
+      static_cast<grpc_endpoint_pair*>(gpr_malloc(sizeof(grpc_endpoint_pair)));
+
+  grpc_end2end_test_fixture f;
+  memset(&f, 0, sizeof(f));
+  f.fixture_data = sfd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);
+
+  return f;
+}
+
+static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f,
+                                          grpc_channel_args* client_args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+  grpc_transport* transport;
+  sp_client_setup cs;
+  cs.client_args = client_args;
+  cs.f = f;
+  transport =
+      grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
+  client_setup_transport(&exec_ctx, &cs, transport);
+  GPR_ASSERT(f->client);
+  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f,
+                                          grpc_channel_args* server_args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+  grpc_transport* transport;
+  GPR_ASSERT(!f->server);
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  grpc_server_start(f->server);
+  transport =
+      grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
+  server_setup_transport(f, transport);
+  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) {
+  gpr_free(f->fixture_data);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/socketpair", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_socketpair, chttp2_init_client_socketpair,
+     chttp2_init_server_socketpair, chttp2_tear_down_socketpair},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c
deleted file mode 100644
index c75a387..0000000
--- a/test/core/end2end/fixtures/h2_sockpair_1byte.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/client/http_client_filter.h"
-#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/completion_queue.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-/* chttp2 transport that is immediately available (used for testing
-   connected_channel without a client_channel */
-
-static void server_setup_transport(void *ts, grpc_transport *transport) {
-  grpc_end2end_test_fixture *f = ts;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_pair *sfd = f->fixture_data;
-  grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
-  grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL,
-                              grpc_server_get_channel_args(f->server));
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-typedef struct {
-  grpc_end2end_test_fixture *f;
-  grpc_channel_args *client_args;
-} sp_client_setup;
-
-static void client_setup_transport(grpc_exec_ctx *exec_ctx, void *ts,
-                                   grpc_transport *transport) {
-  sp_client_setup *cs = ts;
-
-  cs->f->client =
-      grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args,
-                          GRPC_CLIENT_DIRECT_CHANNEL, transport);
-}
-
-static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_endpoint_pair *sfd = gpr_malloc(sizeof(grpc_endpoint_pair));
-
-  grpc_end2end_test_fixture f;
-  memset(&f, 0, sizeof(f));
-  f.fixture_data = sfd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = 1},
-                  {.key = GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = 1},
-                  {.key = GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = 1}};
-  grpc_channel_args args = {.num_args = GPR_ARRAY_SIZE(a), .args = a};
-  *sfd = grpc_iomgr_create_endpoint_pair("fixture", &args);
-
-  return f;
-}
-
-static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f,
-                                          grpc_channel_args *client_args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_pair *sfd = f->fixture_data;
-  grpc_transport *transport;
-  sp_client_setup cs;
-  cs.client_args = client_args;
-  cs.f = f;
-  transport =
-      grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
-  client_setup_transport(&exec_ctx, &cs, transport);
-  GPR_ASSERT(f->client);
-  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f,
-                                          grpc_channel_args *server_args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_pair *sfd = f->fixture_data;
-  grpc_transport *transport;
-  GPR_ASSERT(!f->server);
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  grpc_server_start(f->server);
-  transport =
-      grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
-  server_setup_transport(f, transport);
-  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture *f) {
-  gpr_free(f->fixture_data);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/socketpair_one_byte_at_a_time",
-     FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_socketpair,
-     chttp2_init_client_socketpair, chttp2_init_server_socketpair,
-     chttp2_tear_down_socketpair},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  g_fixture_slowdown_factor = 2;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.cc b/test/core/end2end/fixtures/h2_sockpair_1byte.cc
new file mode 100644
index 0000000..7d00c69
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_sockpair_1byte.cc
@@ -0,0 +1,156 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/client/http_client_filter.h"
+#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/completion_queue.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+/* chttp2 transport that is immediately available (used for testing
+   connected_channel without a client_channel */
+
+static void server_setup_transport(void* ts, grpc_transport* transport) {
+  grpc_end2end_test_fixture* f = static_cast<grpc_end2end_test_fixture*>(ts);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+  grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
+  grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL,
+                              grpc_server_get_channel_args(f->server));
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+typedef struct {
+  grpc_end2end_test_fixture* f;
+  grpc_channel_args* client_args;
+} sp_client_setup;
+
+static void client_setup_transport(grpc_exec_ctx* exec_ctx, void* ts,
+                                   grpc_transport* transport) {
+  sp_client_setup* cs = static_cast<sp_client_setup*>(ts);
+
+  cs->f->client =
+      grpc_channel_create(exec_ctx, "socketpair-target", cs->client_args,
+                          GRPC_CLIENT_DIRECT_CHANNEL, transport);
+}
+
+static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_endpoint_pair* sfd =
+      static_cast<grpc_endpoint_pair*>(gpr_malloc(sizeof(grpc_endpoint_pair)));
+
+  grpc_end2end_test_fixture f;
+  memset(&f, 0, sizeof(f));
+  f.fixture_data = sfd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  grpc_arg a[3];
+  a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
+  a[0].type = GRPC_ARG_INTEGER;
+  a[0].value.integer = 1;
+  a[1].key = const_cast<char*>(GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE);
+  a[1].type = GRPC_ARG_INTEGER;
+  a[1].value.integer = 1;
+  a[2].key = const_cast<char*>(GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE);
+  a[2].type = GRPC_ARG_INTEGER;
+  a[2].value.integer = 1;
+  grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
+  *sfd = grpc_iomgr_create_endpoint_pair("fixture", &args);
+
+  return f;
+}
+
+static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f,
+                                          grpc_channel_args* client_args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+  grpc_transport* transport;
+  sp_client_setup cs;
+  cs.client_args = client_args;
+  cs.f = f;
+  transport =
+      grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
+  client_setup_transport(&exec_ctx, &cs, transport);
+  GPR_ASSERT(f->client);
+  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f,
+                                          grpc_channel_args* server_args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data);
+  grpc_transport* transport;
+  GPR_ASSERT(!f->server);
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  grpc_server_start(f->server);
+  transport =
+      grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
+  server_setup_transport(f, transport);
+  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) {
+  gpr_free(f->fixture_data);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/socketpair_one_byte_at_a_time",
+     FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_socketpair,
+     chttp2_init_client_socketpair, chttp2_init_server_socketpair,
+     chttp2_tear_down_socketpair},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  g_fixture_slowdown_factor = 2;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_ssl.c b/test/core/end2end/fixtures/h2_ssl.c
deleted file mode 100644
index 0bac464..0000000
--- a/test/core/end2end/fixtures/h2_ssl.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/support/tmpfile.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_secure_fixture_data {
-  char *localaddr;
-} fullstack_secure_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  int port = grpc_pick_unused_port_or_die();
-  fullstack_secure_fixture_data *ffd =
-      gpr_malloc(sizeof(fullstack_secure_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-static void process_auth_failure(void *state, grpc_auth_context *ctx,
-                                 const grpc_metadata *md, size_t md_count,
-                                 grpc_process_auth_metadata_done_cb cb,
-                                 void *user_data) {
-  GPR_ASSERT(state == NULL);
-  cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
-}
-
-static void chttp2_init_client_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *client_args,
-    grpc_channel_credentials *creds) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  f->client =
-      grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL);
-  GPR_ASSERT(f->client != NULL);
-  grpc_channel_credentials_release(creds);
-}
-
-static void chttp2_init_server_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *server_args,
-    grpc_server_credentials *server_creds) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
-                                               server_creds));
-  grpc_server_credentials_release(server_creds);
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-static void chttp2_init_client_simple_ssl_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *client_args) {
-  grpc_channel_credentials *ssl_creds =
-      grpc_ssl_credentials_create(NULL, NULL, NULL);
-  grpc_arg ssl_name_override = {GRPC_ARG_STRING,
-                                GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
-                                {"foo.test.google.fr"}};
-  grpc_channel_args *new_client_args =
-      grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1);
-  chttp2_init_client_secure_fullstack(f, new_client_args, ssl_creds);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, new_client_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static int fail_server_auth_check(grpc_channel_args *server_args) {
-  size_t i;
-  if (server_args == NULL) return 0;
-  for (i = 0; i < server_args->num_args; i++) {
-    if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
-        0) {
-      return 1;
-    }
-  }
-  return 0;
-}
-
-static void chttp2_init_server_simple_ssl_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *server_args) {
-  grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,
-                                                  test_server1_cert};
-  grpc_server_credentials *ssl_creds =
-      grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
-  if (fail_server_auth_check(server_args)) {
-    grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL};
-    grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor);
-  }
-  chttp2_init_server_secure_fullstack(f, server_args, ssl_creds);
-}
-
-/* All test configurations */
-
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/simple_ssl_fullstack",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_secure_fullstack,
-     chttp2_init_client_simple_ssl_secure_fullstack,
-     chttp2_init_server_simple_ssl_secure_fullstack,
-     chttp2_tear_down_secure_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-  FILE *roots_file;
-  size_t roots_size = strlen(test_root_cert);
-  char *roots_filename;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-
-  /* Set the SSL roots env var. */
-  roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename);
-  GPR_ASSERT(roots_filename != NULL);
-  GPR_ASSERT(roots_file != NULL);
-  GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size);
-  fclose(roots_file);
-  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_filename);
-
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  /* Cleanup. */
-  remove(roots_filename);
-  gpr_free(roots_filename);
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_ssl.cc b/test/core/end2end/fixtures/h2_ssl.cc
new file mode 100644
index 0000000..70daefd
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_ssl.cc
@@ -0,0 +1,188 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/support/tmpfile.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_secure_fixture_data {
+  char* localaddr;
+} fullstack_secure_fixture_data;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  int port = grpc_pick_unused_port_or_die();
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(
+          gpr_malloc(sizeof(fullstack_secure_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  gpr_join_host_port(&ffd->localaddr, "localhost", port);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+static void process_auth_failure(void* state, grpc_auth_context* ctx,
+                                 const grpc_metadata* md, size_t md_count,
+                                 grpc_process_auth_metadata_done_cb cb,
+                                 void* user_data) {
+  GPR_ASSERT(state == NULL);
+  cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
+}
+
+static void chttp2_init_client_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* client_args,
+    grpc_channel_credentials* creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  f->client =
+      grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL);
+  GPR_ASSERT(f->client != NULL);
+  grpc_channel_credentials_release(creds);
+}
+
+static void chttp2_init_server_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* server_args,
+    grpc_server_credentials* server_creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
+                                               server_creds));
+  grpc_server_credentials_release(server_creds);
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+static void chttp2_init_client_simple_ssl_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* client_args) {
+  grpc_channel_credentials* ssl_creds =
+      grpc_ssl_credentials_create(NULL, NULL, NULL);
+  grpc_arg ssl_name_override = {
+      GRPC_ARG_STRING,
+      const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
+      {const_cast<char*>("foo.test.google.fr")}};
+  grpc_channel_args* new_client_args =
+      grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1);
+  chttp2_init_client_secure_fullstack(f, new_client_args, ssl_creds);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, new_client_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static int fail_server_auth_check(grpc_channel_args* server_args) {
+  size_t i;
+  if (server_args == NULL) return 0;
+  for (i = 0; i < server_args->num_args; i++) {
+    if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
+        0) {
+      return 1;
+    }
+  }
+  return 0;
+}
+
+static void chttp2_init_server_simple_ssl_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* server_args) {
+  grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,
+                                                  test_server1_cert};
+  grpc_server_credentials* ssl_creds =
+      grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
+  if (fail_server_auth_check(server_args)) {
+    grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL};
+    grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor);
+  }
+  chttp2_init_server_secure_fullstack(f, server_args, ssl_creds);
+}
+
+/* All test configurations */
+
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/simple_ssl_fullstack",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_secure_fullstack,
+     chttp2_init_client_simple_ssl_secure_fullstack,
+     chttp2_init_server_simple_ssl_secure_fullstack,
+     chttp2_tear_down_secure_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+  FILE* roots_file;
+  size_t roots_size = strlen(test_root_cert);
+  char* roots_filename;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+
+  /* Set the SSL roots env var. */
+  roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename);
+  GPR_ASSERT(roots_filename != NULL);
+  GPR_ASSERT(roots_file != NULL);
+  GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size);
+  fclose(roots_file);
+  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_filename);
+
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  /* Cleanup. */
+  remove(roots_filename);
+  gpr_free(roots_filename);
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.c
deleted file mode 100644
index 8bc7183..0000000
--- a/test/core/end2end/fixtures/h2_ssl_proxy.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/support/tmpfile.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/end2end/fixtures/proxy.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_secure_fixture_data {
-  grpc_end2end_proxy *proxy;
-} fullstack_secure_fixture_data;
-
-static grpc_server *create_proxy_server(const char *port,
-                                        grpc_channel_args *server_args) {
-  grpc_server *s = grpc_server_create(server_args, NULL);
-  grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,
-                                                  test_server1_cert};
-  grpc_server_credentials *ssl_creds =
-      grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
-  GPR_ASSERT(grpc_server_add_secure_http2_port(s, port, ssl_creds));
-  grpc_server_credentials_release(ssl_creds);
-  return s;
-}
-
-static grpc_channel *create_proxy_client(const char *target,
-                                         grpc_channel_args *client_args) {
-  grpc_channel *channel;
-  grpc_channel_credentials *ssl_creds =
-      grpc_ssl_credentials_create(NULL, NULL, NULL);
-  grpc_arg ssl_name_override = {GRPC_ARG_STRING,
-                                GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
-                                {"foo.test.google.fr"}};
-  grpc_channel_args *new_client_args =
-      grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1);
-  channel =
-      grpc_secure_channel_create(ssl_creds, target, new_client_args, NULL);
-  grpc_channel_credentials_release(ssl_creds);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, new_client_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  return channel;
-}
-
-static const grpc_end2end_proxy_def proxy_def = {create_proxy_server,
-                                                 create_proxy_client};
-
-static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  fullstack_secure_fixture_data *ffd =
-      gpr_malloc(sizeof(fullstack_secure_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-static void process_auth_failure(void *state, grpc_auth_context *ctx,
-                                 const grpc_metadata *md, size_t md_count,
-                                 grpc_process_auth_metadata_done_cb cb,
-                                 void *user_data) {
-  GPR_ASSERT(state == NULL);
-  cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
-}
-
-static void chttp2_init_client_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *client_args,
-    grpc_channel_credentials *creds) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  f->client = grpc_secure_channel_create(
-      creds, grpc_end2end_proxy_get_client_target(ffd->proxy), client_args,
-      NULL);
-  GPR_ASSERT(f->client != NULL);
-  grpc_channel_credentials_release(creds);
-}
-
-static void chttp2_init_server_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *server_args,
-    grpc_server_credentials *server_creds) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_secure_http2_port(
-      f->server, grpc_end2end_proxy_get_server_port(ffd->proxy), server_creds));
-  grpc_server_credentials_release(server_creds);
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_secure_fixture_data *ffd = f->fixture_data;
-  grpc_end2end_proxy_destroy(ffd->proxy);
-  gpr_free(ffd);
-}
-
-static void chttp2_init_client_simple_ssl_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *client_args) {
-  grpc_channel_credentials *ssl_creds =
-      grpc_ssl_credentials_create(NULL, NULL, NULL);
-  grpc_arg ssl_name_override = {GRPC_ARG_STRING,
-                                GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
-                                {"foo.test.google.fr"}};
-  grpc_channel_args *new_client_args =
-      grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1);
-  chttp2_init_client_secure_fullstack(f, new_client_args, ssl_creds);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, new_client_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static int fail_server_auth_check(grpc_channel_args *server_args) {
-  size_t i;
-  if (server_args == NULL) return 0;
-  for (i = 0; i < server_args->num_args; i++) {
-    if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
-        0) {
-      return 1;
-    }
-  }
-  return 0;
-}
-
-static void chttp2_init_server_simple_ssl_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *server_args) {
-  grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,
-                                                  test_server1_cert};
-  grpc_server_credentials *ssl_creds =
-      grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
-  if (fail_server_auth_check(server_args)) {
-    grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL};
-    grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor);
-  }
-  chttp2_init_server_secure_fullstack(f, server_args, ssl_creds);
-}
-
-/* All test configurations */
-
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/simple_ssl_fullstack",
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-         FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
-         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_secure_fullstack,
-     chttp2_init_client_simple_ssl_secure_fullstack,
-     chttp2_init_server_simple_ssl_secure_fullstack,
-     chttp2_tear_down_secure_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-  FILE *roots_file;
-  size_t roots_size = strlen(test_root_cert);
-  char *roots_filename;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-
-  /* Set the SSL roots env var. */
-  roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename);
-  GPR_ASSERT(roots_filename != NULL);
-  GPR_ASSERT(roots_file != NULL);
-  GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size);
-  fclose(roots_file);
-  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_filename);
-
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  /* Cleanup. */
-  remove(roots_filename);
-  gpr_free(roots_filename);
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.cc b/test/core/end2end/fixtures/h2_ssl_proxy.cc
new file mode 100644
index 0000000..b3488a2
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_ssl_proxy.cc
@@ -0,0 +1,227 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/support/tmpfile.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/end2end/fixtures/proxy.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_secure_fixture_data {
+  grpc_end2end_proxy* proxy;
+} fullstack_secure_fixture_data;
+
+static grpc_server* create_proxy_server(const char* port,
+                                        grpc_channel_args* server_args) {
+  grpc_server* s = grpc_server_create(server_args, NULL);
+  grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,
+                                                  test_server1_cert};
+  grpc_server_credentials* ssl_creds =
+      grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
+  GPR_ASSERT(grpc_server_add_secure_http2_port(s, port, ssl_creds));
+  grpc_server_credentials_release(ssl_creds);
+  return s;
+}
+
+static grpc_channel* create_proxy_client(const char* target,
+                                         grpc_channel_args* client_args) {
+  grpc_channel* channel;
+  grpc_channel_credentials* ssl_creds =
+      grpc_ssl_credentials_create(NULL, NULL, NULL);
+  grpc_arg ssl_name_override = {
+      GRPC_ARG_STRING,
+      const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
+      {const_cast<char*>("foo.test.google.fr")}};
+  grpc_channel_args* new_client_args =
+      grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1);
+  channel =
+      grpc_secure_channel_create(ssl_creds, target, new_client_args, NULL);
+  grpc_channel_credentials_release(ssl_creds);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, new_client_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  return channel;
+}
+
+static const grpc_end2end_proxy_def proxy_def = {create_proxy_server,
+                                                 create_proxy_client};
+
+static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(
+          gpr_malloc(sizeof(fullstack_secure_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+static void process_auth_failure(void* state, grpc_auth_context* ctx,
+                                 const grpc_metadata* md, size_t md_count,
+                                 grpc_process_auth_metadata_done_cb cb,
+                                 void* user_data) {
+  GPR_ASSERT(state == NULL);
+  cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
+}
+
+static void chttp2_init_client_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* client_args,
+    grpc_channel_credentials* creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  f->client = grpc_secure_channel_create(
+      creds, grpc_end2end_proxy_get_client_target(ffd->proxy), client_args,
+      NULL);
+  GPR_ASSERT(f->client != NULL);
+  grpc_channel_credentials_release(creds);
+}
+
+static void chttp2_init_server_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* server_args,
+    grpc_server_credentials* server_creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_secure_http2_port(
+      f->server, grpc_end2end_proxy_get_server_port(ffd->proxy), server_creds));
+  grpc_server_credentials_release(server_creds);
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
+  grpc_end2end_proxy_destroy(ffd->proxy);
+  gpr_free(ffd);
+}
+
+static void chttp2_init_client_simple_ssl_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* client_args) {
+  grpc_channel_credentials* ssl_creds =
+      grpc_ssl_credentials_create(NULL, NULL, NULL);
+  grpc_arg ssl_name_override = {
+      GRPC_ARG_STRING,
+      const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
+      {const_cast<char*>("foo.test.google.fr")}};
+  grpc_channel_args* new_client_args =
+      grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1);
+  chttp2_init_client_secure_fullstack(f, new_client_args, ssl_creds);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, new_client_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static int fail_server_auth_check(grpc_channel_args* server_args) {
+  size_t i;
+  if (server_args == NULL) return 0;
+  for (i = 0; i < server_args->num_args; i++) {
+    if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) ==
+        0) {
+      return 1;
+    }
+  }
+  return 0;
+}
+
+static void chttp2_init_server_simple_ssl_secure_fullstack(
+    grpc_end2end_test_fixture* f, grpc_channel_args* server_args) {
+  grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,
+                                                  test_server1_cert};
+  grpc_server_credentials* ssl_creds =
+      grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
+  if (fail_server_auth_check(server_args)) {
+    grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL};
+    grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor);
+  }
+  chttp2_init_server_secure_fullstack(f, server_args, ssl_creds);
+}
+
+/* All test configurations */
+
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/simple_ssl_fullstack",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_REQUEST_PROXYING |
+         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_secure_fullstack,
+     chttp2_init_client_simple_ssl_secure_fullstack,
+     chttp2_init_server_simple_ssl_secure_fullstack,
+     chttp2_tear_down_secure_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+  FILE* roots_file;
+  size_t roots_size = strlen(test_root_cert);
+  char* roots_filename;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+
+  /* Set the SSL roots env var. */
+  roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename);
+  GPR_ASSERT(roots_filename != NULL);
+  GPR_ASSERT(roots_file != NULL);
+  GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size);
+  fclose(roots_file);
+  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_filename);
+
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  /* Cleanup. */
+  remove(roots_filename);
+  gpr_free(roots_filename);
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.c
deleted file mode 100644
index 05a3198..0000000
--- a/test/core/end2end/fixtures/h2_uds.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct fullstack_fixture_data {
-  char *localaddr;
-} fullstack_fixture_data;
-
-static int unique = 1;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  gpr_asprintf(&ffd->localaddr, "unix:/tmp/grpc_fullstack_test.%d.%d", getpid(),
-               unique++);
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *client_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
-}
-
-void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
-                                  grpc_channel_args *server_args) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
-  grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd->localaddr);
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
-                                 FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
-                                 FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
-     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
-     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/h2_uds.cc b/test/core/end2end/fixtures/h2_uds.cc
new file mode 100644
index 0000000..ba433df
--- /dev/null
+++ b/test/core/end2end/fixtures/h2_uds.cc
@@ -0,0 +1,116 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct fullstack_fixture_data {
+  char* localaddr;
+} fullstack_fixture_data;
+
+static int unique = 1;
+
+static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  fullstack_fixture_data* ffd = static_cast<fullstack_fixture_data*>(
+      gpr_malloc(sizeof(fullstack_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  gpr_asprintf(&ffd->localaddr, "unix:/tmp/grpc_fullstack_test.%d.%d", getpid(),
+               unique++);
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* client_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
+}
+
+void chttp2_init_server_fullstack(grpc_end2end_test_fixture* f,
+                                  grpc_channel_args* server_args) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
+  grpc_server_start(f->server);
+}
+
+void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_fixture_data* ffd =
+      static_cast<fullstack_fixture_data*>(f->fixture_data);
+  gpr_free(ffd->localaddr);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"chttp2/fullstack_uds",
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
+         FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
+     chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
+     chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/http_proxy_fixture.c b/test/core/end2end/fixtures/http_proxy_fixture.cc
similarity index 100%
rename from test/core/end2end/fixtures/http_proxy_fixture.c
rename to test/core/end2end/fixtures/http_proxy_fixture.cc
diff --git a/test/core/end2end/fixtures/inproc.c b/test/core/end2end/fixtures/inproc.c
deleted file mode 100644
index 6f742f0..0000000
--- a/test/core/end2end/fixtures/inproc.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/transport/inproc/inproc_transport.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct inproc_fixture_data {
-  bool dummy;  // reserved for future expansion. Struct can't be empty
-} inproc_fixture_data;
-
-static grpc_end2end_test_fixture inproc_create_fixture(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  inproc_fixture_data *ffd = gpr_malloc(sizeof(inproc_fixture_data));
-  memset(&f, 0, sizeof(f));
-
-  f.fixture_data = ffd;
-  f.cq = grpc_completion_queue_create_for_next(NULL);
-  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-
-  return f;
-}
-
-void inproc_init_client(grpc_end2end_test_fixture *f,
-                        grpc_channel_args *client_args) {
-  f->client = grpc_inproc_channel_create(f->server, client_args, NULL);
-  GPR_ASSERT(f->client);
-}
-
-void inproc_init_server(grpc_end2end_test_fixture *f,
-                        grpc_channel_args *server_args) {
-  if (f->server) {
-    grpc_server_destroy(f->server);
-  }
-  f->server = grpc_server_create(server_args, NULL);
-  grpc_server_register_completion_queue(f->server, f->cq, NULL);
-  grpc_server_start(f->server);
-}
-
-void inproc_tear_down(grpc_end2end_test_fixture *f) {
-  inproc_fixture_data *ffd = f->fixture_data;
-  gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
-    {"inproc", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, inproc_create_fixture,
-     inproc_init_client, inproc_init_server, inproc_tear_down},
-};
-
-int main(int argc, char **argv) {
-  size_t i;
-
-  grpc_test_init(argc, argv);
-  grpc_end2end_tests_pre_init();
-  grpc_init();
-
-  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
-    grpc_end2end_tests(argc, argv, configs[i]);
-  }
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/fixtures/inproc.cc b/test/core/end2end/fixtures/inproc.cc
new file mode 100644
index 0000000..5107ed2
--- /dev/null
+++ b/test/core/end2end/fixtures/inproc.cc
@@ -0,0 +1,97 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include "src/core/ext/transport/inproc/inproc_transport.h"
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct inproc_fixture_data {
+  bool dummy;  // reserved for future expansion. Struct can't be empty
+} inproc_fixture_data;
+
+static grpc_end2end_test_fixture inproc_create_fixture(
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  inproc_fixture_data* ffd = static_cast<inproc_fixture_data*>(
+      gpr_malloc(sizeof(inproc_fixture_data)));
+  memset(&f, 0, sizeof(f));
+
+  f.fixture_data = ffd;
+  f.cq = grpc_completion_queue_create_for_next(NULL);
+  f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+
+  return f;
+}
+
+void inproc_init_client(grpc_end2end_test_fixture* f,
+                        grpc_channel_args* client_args) {
+  f->client = grpc_inproc_channel_create(f->server, client_args, NULL);
+  GPR_ASSERT(f->client);
+}
+
+void inproc_init_server(grpc_end2end_test_fixture* f,
+                        grpc_channel_args* server_args) {
+  if (f->server) {
+    grpc_server_destroy(f->server);
+  }
+  f->server = grpc_server_create(server_args, NULL);
+  grpc_server_register_completion_queue(f->server, f->cq, NULL);
+  grpc_server_start(f->server);
+}
+
+void inproc_tear_down(grpc_end2end_test_fixture* f) {
+  inproc_fixture_data* ffd = static_cast<inproc_fixture_data*>(f->fixture_data);
+  gpr_free(ffd);
+}
+
+/* All test configurations */
+static grpc_end2end_test_config configs[] = {
+    {"inproc", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, inproc_create_fixture,
+     inproc_init_client, inproc_init_server, inproc_tear_down},
+};
+
+int main(int argc, char** argv) {
+  size_t i;
+
+  grpc_test_init(argc, argv);
+  grpc_end2end_tests_pre_init();
+  grpc_init();
+
+  for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
+    grpc_end2end_tests(argc, argv, configs[i]);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.c
deleted file mode 100644
index 6a2d75d..0000000
--- a/test/core/end2end/fixtures/proxy.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/fixtures/proxy.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-
-#include "test/core/util/port.h"
-
-struct grpc_end2end_proxy {
-  gpr_thd_id thd;
-  char *proxy_port;
-  char *server_port;
-  grpc_completion_queue *cq;
-  grpc_server *server;
-  grpc_channel *client;
-
-  int shutdown;
-
-  /* requested call */
-  grpc_call *new_call;
-  grpc_call_details new_call_details;
-  grpc_metadata_array new_call_metadata;
-};
-
-typedef struct {
-  void (*func)(void *arg, int success);
-  void *arg;
-} closure;
-
-typedef struct {
-  gpr_refcount refs;
-  grpc_end2end_proxy *proxy;
-
-  grpc_call *c2p;
-  grpc_call *p2s;
-
-  grpc_metadata_array c2p_initial_metadata;
-  grpc_metadata_array p2s_initial_metadata;
-
-  grpc_byte_buffer *c2p_msg;
-  grpc_byte_buffer *p2s_msg;
-
-  grpc_metadata_array p2s_trailing_metadata;
-  grpc_status_code p2s_status;
-  grpc_slice p2s_status_details;
-
-  int c2p_server_cancelled;
-} proxy_call;
-
-static void thread_main(void *arg);
-static void request_call(grpc_end2end_proxy *proxy);
-
-grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def,
-                                              grpc_channel_args *client_args,
-                                              grpc_channel_args *server_args) {
-  gpr_thd_options opt = gpr_thd_options_default();
-  int proxy_port = grpc_pick_unused_port_or_die();
-  int server_port = grpc_pick_unused_port_or_die();
-
-  grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)gpr_malloc(sizeof(*proxy));
-  memset(proxy, 0, sizeof(*proxy));
-
-  gpr_join_host_port(&proxy->proxy_port, "localhost", proxy_port);
-  gpr_join_host_port(&proxy->server_port, "localhost", server_port);
-
-  gpr_log(GPR_DEBUG, "PROXY ADDR:%s BACKEND:%s", proxy->proxy_port,
-          proxy->server_port);
-
-  proxy->cq = grpc_completion_queue_create_for_next(NULL);
-  proxy->server = def->create_server(proxy->proxy_port, server_args);
-  proxy->client = def->create_client(proxy->server_port, client_args);
-
-  grpc_server_register_completion_queue(proxy->server, proxy->cq, NULL);
-  grpc_server_start(proxy->server);
-
-  grpc_call_details_init(&proxy->new_call_details);
-  gpr_thd_options_set_joinable(&opt);
-  GPR_ASSERT(gpr_thd_new(&proxy->thd, thread_main, proxy, &opt));
-
-  request_call(proxy);
-
-  return proxy;
-}
-
-static closure *new_closure(void (*func)(void *arg, int success), void *arg) {
-  closure *cl = (closure *)gpr_malloc(sizeof(*cl));
-  cl->func = func;
-  cl->arg = arg;
-  return cl;
-}
-
-static void shutdown_complete(void *arg, int success) {
-  grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)arg;
-  proxy->shutdown = 1;
-  grpc_completion_queue_shutdown(proxy->cq);
-}
-
-void grpc_end2end_proxy_destroy(grpc_end2end_proxy *proxy) {
-  grpc_server_shutdown_and_notify(proxy->server, proxy->cq,
-                                  new_closure(shutdown_complete, proxy));
-  gpr_thd_join(proxy->thd);
-  gpr_free(proxy->proxy_port);
-  gpr_free(proxy->server_port);
-  grpc_server_destroy(proxy->server);
-  grpc_channel_destroy(proxy->client);
-  grpc_completion_queue_destroy(proxy->cq);
-  grpc_call_details_destroy(&proxy->new_call_details);
-  gpr_free(proxy);
-}
-
-static void unrefpc(proxy_call *pc, const char *reason) {
-  if (gpr_unref(&pc->refs)) {
-    grpc_call_unref(pc->c2p);
-    grpc_call_unref(pc->p2s);
-    grpc_metadata_array_destroy(&pc->c2p_initial_metadata);
-    grpc_metadata_array_destroy(&pc->p2s_initial_metadata);
-    grpc_metadata_array_destroy(&pc->p2s_trailing_metadata);
-    grpc_slice_unref(pc->p2s_status_details);
-    gpr_free(pc);
-  }
-}
-
-static void refpc(proxy_call *pc, const char *reason) { gpr_ref(&pc->refs); }
-
-static void on_c2p_sent_initial_metadata(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  unrefpc(pc, "on_c2p_sent_initial_metadata");
-}
-
-static void on_p2s_recv_initial_metadata(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  grpc_op op;
-  grpc_call_error err;
-
-  memset(&op, 0, sizeof(op));
-  if (!pc->proxy->shutdown) {
-    op.op = GRPC_OP_SEND_INITIAL_METADATA;
-    op.flags = 0;
-    op.reserved = NULL;
-    op.data.send_initial_metadata.count = pc->p2s_initial_metadata.count;
-    op.data.send_initial_metadata.metadata = pc->p2s_initial_metadata.metadata;
-    refpc(pc, "on_c2p_sent_initial_metadata");
-    err = grpc_call_start_batch(
-        pc->c2p, &op, 1, new_closure(on_c2p_sent_initial_metadata, pc), NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-  }
-
-  unrefpc(pc, "on_p2s_recv_initial_metadata");
-}
-
-static void on_p2s_sent_initial_metadata(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  unrefpc(pc, "on_p2s_sent_initial_metadata");
-}
-
-static void on_c2p_recv_msg(void *arg, int success);
-
-static void on_p2s_sent_message(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  grpc_op op;
-  grpc_call_error err;
-
-  grpc_byte_buffer_destroy(pc->c2p_msg);
-  if (!pc->proxy->shutdown && success) {
-    op.op = GRPC_OP_RECV_MESSAGE;
-    op.flags = 0;
-    op.reserved = NULL;
-    op.data.recv_message.recv_message = &pc->c2p_msg;
-    refpc(pc, "on_c2p_recv_msg");
-    err = grpc_call_start_batch(pc->c2p, &op, 1,
-                                new_closure(on_c2p_recv_msg, pc), NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-  }
-
-  unrefpc(pc, "on_p2s_sent_message");
-}
-
-static void on_p2s_sent_close(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  unrefpc(pc, "on_p2s_sent_close");
-}
-
-static void on_c2p_recv_msg(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  grpc_op op;
-  grpc_call_error err;
-
-  if (!pc->proxy->shutdown && success) {
-    if (pc->c2p_msg != NULL) {
-      op.op = GRPC_OP_SEND_MESSAGE;
-      op.flags = 0;
-      op.reserved = NULL;
-      op.data.send_message.send_message = pc->c2p_msg;
-      refpc(pc, "on_p2s_sent_message");
-      err = grpc_call_start_batch(pc->p2s, &op, 1,
-                                  new_closure(on_p2s_sent_message, pc), NULL);
-      GPR_ASSERT(err == GRPC_CALL_OK);
-    } else {
-      op.op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-      op.flags = 0;
-      op.reserved = NULL;
-      refpc(pc, "on_p2s_sent_close");
-      err = grpc_call_start_batch(pc->p2s, &op, 1,
-                                  new_closure(on_p2s_sent_close, pc), NULL);
-      GPR_ASSERT(err == GRPC_CALL_OK);
-    }
-  } else {
-    if (pc->c2p_msg != NULL) {
-      grpc_byte_buffer_destroy(pc->c2p_msg);
-    }
-  }
-
-  unrefpc(pc, "on_c2p_recv_msg");
-}
-
-static void on_p2s_recv_msg(void *arg, int success);
-
-static void on_c2p_sent_message(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  grpc_op op;
-  grpc_call_error err;
-
-  grpc_byte_buffer_destroy(pc->p2s_msg);
-  if (!pc->proxy->shutdown && success) {
-    op.op = GRPC_OP_RECV_MESSAGE;
-    op.flags = 0;
-    op.reserved = NULL;
-    op.data.recv_message.recv_message = &pc->p2s_msg;
-    refpc(pc, "on_p2s_recv_msg");
-    err = grpc_call_start_batch(pc->p2s, &op, 1,
-                                new_closure(on_p2s_recv_msg, pc), NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-  }
-
-  unrefpc(pc, "on_c2p_sent_message");
-}
-
-static void on_p2s_recv_msg(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  grpc_op op;
-  grpc_call_error err;
-
-  if (!pc->proxy->shutdown && success && pc->p2s_msg) {
-    op.op = GRPC_OP_SEND_MESSAGE;
-    op.flags = 0;
-    op.reserved = NULL;
-    op.data.send_message.send_message = pc->p2s_msg;
-    refpc(pc, "on_c2p_sent_message");
-    err = grpc_call_start_batch(pc->c2p, &op, 1,
-                                new_closure(on_c2p_sent_message, pc), NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-  } else {
-    grpc_byte_buffer_destroy(pc->p2s_msg);
-  }
-  unrefpc(pc, "on_p2s_recv_msg");
-}
-
-static void on_c2p_sent_status(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  unrefpc(pc, "on_c2p_sent_status");
-}
-
-static void on_p2s_status(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  grpc_op op;
-  grpc_call_error err;
-
-  if (!pc->proxy->shutdown) {
-    GPR_ASSERT(success);
-    op.op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-    op.flags = 0;
-    op.reserved = NULL;
-    op.data.send_status_from_server.trailing_metadata_count =
-        pc->p2s_trailing_metadata.count;
-    op.data.send_status_from_server.trailing_metadata =
-        pc->p2s_trailing_metadata.metadata;
-    op.data.send_status_from_server.status = pc->p2s_status;
-    op.data.send_status_from_server.status_details = &pc->p2s_status_details;
-    refpc(pc, "on_c2p_sent_status");
-    err = grpc_call_start_batch(pc->c2p, &op, 1,
-                                new_closure(on_c2p_sent_status, pc), NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-  }
-
-  unrefpc(pc, "on_p2s_status");
-}
-
-static void on_c2p_closed(void *arg, int success) {
-  proxy_call *pc = (proxy_call *)arg;
-  unrefpc(pc, "on_c2p_closed");
-}
-
-static void on_new_call(void *arg, int success) {
-  grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)arg;
-  grpc_call_error err;
-
-  if (success) {
-    grpc_op op;
-    memset(&op, 0, sizeof(op));
-    proxy_call *pc = (proxy_call *)gpr_malloc(sizeof(*pc));
-    memset(pc, 0, sizeof(*pc));
-    pc->proxy = proxy;
-    GPR_SWAP(grpc_metadata_array, pc->c2p_initial_metadata,
-             proxy->new_call_metadata);
-    pc->c2p = proxy->new_call;
-    pc->p2s = grpc_channel_create_call(
-        proxy->client, pc->c2p, GRPC_PROPAGATE_DEFAULTS, proxy->cq,
-        proxy->new_call_details.method, &proxy->new_call_details.host,
-        proxy->new_call_details.deadline, NULL);
-    gpr_ref_init(&pc->refs, 1);
-
-    op.reserved = NULL;
-
-    op.op = GRPC_OP_RECV_INITIAL_METADATA;
-    op.flags = 0;
-    op.data.recv_initial_metadata.recv_initial_metadata =
-        &pc->p2s_initial_metadata;
-    refpc(pc, "on_p2s_recv_initial_metadata");
-    err = grpc_call_start_batch(
-        pc->p2s, &op, 1, new_closure(on_p2s_recv_initial_metadata, pc), NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-
-    op.op = GRPC_OP_SEND_INITIAL_METADATA;
-    op.flags = proxy->new_call_details.flags;
-    op.data.send_initial_metadata.count = pc->c2p_initial_metadata.count;
-    op.data.send_initial_metadata.metadata = pc->c2p_initial_metadata.metadata;
-    refpc(pc, "on_p2s_sent_initial_metadata");
-    err = grpc_call_start_batch(
-        pc->p2s, &op, 1, new_closure(on_p2s_sent_initial_metadata, pc), NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-
-    op.op = GRPC_OP_RECV_MESSAGE;
-    op.flags = 0;
-    op.data.recv_message.recv_message = &pc->c2p_msg;
-    refpc(pc, "on_c2p_recv_msg");
-    err = grpc_call_start_batch(pc->c2p, &op, 1,
-                                new_closure(on_c2p_recv_msg, pc), NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-
-    op.op = GRPC_OP_RECV_MESSAGE;
-    op.flags = 0;
-    op.data.recv_message.recv_message = &pc->p2s_msg;
-    refpc(pc, "on_p2s_recv_msg");
-    err = grpc_call_start_batch(pc->p2s, &op, 1,
-                                new_closure(on_p2s_recv_msg, pc), NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-
-    op.op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-    op.flags = 0;
-    op.data.recv_status_on_client.trailing_metadata =
-        &pc->p2s_trailing_metadata;
-    op.data.recv_status_on_client.status = &pc->p2s_status;
-    op.data.recv_status_on_client.status_details = &pc->p2s_status_details;
-    refpc(pc, "on_p2s_status");
-    err = grpc_call_start_batch(pc->p2s, &op, 1, new_closure(on_p2s_status, pc),
-                                NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-
-    op.op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-    op.flags = 0;
-    op.data.recv_close_on_server.cancelled = &pc->c2p_server_cancelled;
-    refpc(pc, "on_c2p_closed");
-    err = grpc_call_start_batch(pc->c2p, &op, 1, new_closure(on_c2p_closed, pc),
-                                NULL);
-    GPR_ASSERT(err == GRPC_CALL_OK);
-
-    request_call(proxy);
-
-    grpc_call_details_destroy(&proxy->new_call_details);
-    grpc_call_details_init(&proxy->new_call_details);
-
-    unrefpc(pc, "init");
-  } else {
-    GPR_ASSERT(proxy->new_call == NULL);
-  }
-}
-
-static void request_call(grpc_end2end_proxy *proxy) {
-  proxy->new_call = NULL;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 proxy->server, &proxy->new_call,
-                                 &proxy->new_call_details,
-                                 &proxy->new_call_metadata, proxy->cq,
-                                 proxy->cq, new_closure(on_new_call, proxy)));
-}
-
-static void thread_main(void *arg) {
-  grpc_end2end_proxy *proxy = (grpc_end2end_proxy *)arg;
-  closure *cl;
-  for (;;) {
-    grpc_event ev = grpc_completion_queue_next(
-        proxy->cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
-    switch (ev.type) {
-      case GRPC_QUEUE_TIMEOUT:
-        gpr_log(GPR_ERROR, "Should never reach here");
-        abort();
-      case GRPC_QUEUE_SHUTDOWN:
-        return;
-      case GRPC_OP_COMPLETE:
-        cl = (closure *)ev.tag;
-        cl->func(cl->arg, ev.success);
-        gpr_free(cl);
-        break;
-    }
-  }
-}
-
-const char *grpc_end2end_proxy_get_client_target(grpc_end2end_proxy *proxy) {
-  return proxy->proxy_port;
-}
-
-const char *grpc_end2end_proxy_get_server_port(grpc_end2end_proxy *proxy) {
-  return proxy->server_port;
-}
diff --git a/test/core/end2end/fixtures/proxy.cc b/test/core/end2end/fixtures/proxy.cc
new file mode 100644
index 0000000..01c9e13
--- /dev/null
+++ b/test/core/end2end/fixtures/proxy.cc
@@ -0,0 +1,437 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/fixtures/proxy.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/util/port.h"
+
+struct grpc_end2end_proxy {
+  gpr_thd_id thd;
+  char* proxy_port;
+  char* server_port;
+  grpc_completion_queue* cq;
+  grpc_server* server;
+  grpc_channel* client;
+
+  int shutdown;
+
+  /* requested call */
+  grpc_call* new_call;
+  grpc_call_details new_call_details;
+  grpc_metadata_array new_call_metadata;
+};
+
+typedef struct {
+  void (*func)(void* arg, int success);
+  void* arg;
+} closure;
+
+typedef struct {
+  gpr_refcount refs;
+  grpc_end2end_proxy* proxy;
+
+  grpc_call* c2p;
+  grpc_call* p2s;
+
+  grpc_metadata_array c2p_initial_metadata;
+  grpc_metadata_array p2s_initial_metadata;
+
+  grpc_byte_buffer* c2p_msg;
+  grpc_byte_buffer* p2s_msg;
+
+  grpc_metadata_array p2s_trailing_metadata;
+  grpc_status_code p2s_status;
+  grpc_slice p2s_status_details;
+
+  int c2p_server_cancelled;
+} proxy_call;
+
+static void thread_main(void* arg);
+static void request_call(grpc_end2end_proxy* proxy);
+
+grpc_end2end_proxy* grpc_end2end_proxy_create(const grpc_end2end_proxy_def* def,
+                                              grpc_channel_args* client_args,
+                                              grpc_channel_args* server_args) {
+  gpr_thd_options opt = gpr_thd_options_default();
+  int proxy_port = grpc_pick_unused_port_or_die();
+  int server_port = grpc_pick_unused_port_or_die();
+
+  grpc_end2end_proxy* proxy = (grpc_end2end_proxy*)gpr_malloc(sizeof(*proxy));
+  memset(proxy, 0, sizeof(*proxy));
+
+  gpr_join_host_port(&proxy->proxy_port, "localhost", proxy_port);
+  gpr_join_host_port(&proxy->server_port, "localhost", server_port);
+
+  gpr_log(GPR_DEBUG, "PROXY ADDR:%s BACKEND:%s", proxy->proxy_port,
+          proxy->server_port);
+
+  proxy->cq = grpc_completion_queue_create_for_next(NULL);
+  proxy->server = def->create_server(proxy->proxy_port, server_args);
+  proxy->client = def->create_client(proxy->server_port, client_args);
+
+  grpc_server_register_completion_queue(proxy->server, proxy->cq, NULL);
+  grpc_server_start(proxy->server);
+
+  grpc_call_details_init(&proxy->new_call_details);
+  gpr_thd_options_set_joinable(&opt);
+  GPR_ASSERT(gpr_thd_new(&proxy->thd, thread_main, proxy, &opt));
+
+  request_call(proxy);
+
+  return proxy;
+}
+
+static closure* new_closure(void (*func)(void* arg, int success), void* arg) {
+  closure* cl = (closure*)gpr_malloc(sizeof(*cl));
+  cl->func = func;
+  cl->arg = arg;
+  return cl;
+}
+
+static void shutdown_complete(void* arg, int success) {
+  grpc_end2end_proxy* proxy = (grpc_end2end_proxy*)arg;
+  proxy->shutdown = 1;
+  grpc_completion_queue_shutdown(proxy->cq);
+}
+
+void grpc_end2end_proxy_destroy(grpc_end2end_proxy* proxy) {
+  grpc_server_shutdown_and_notify(proxy->server, proxy->cq,
+                                  new_closure(shutdown_complete, proxy));
+  gpr_thd_join(proxy->thd);
+  gpr_free(proxy->proxy_port);
+  gpr_free(proxy->server_port);
+  grpc_server_destroy(proxy->server);
+  grpc_channel_destroy(proxy->client);
+  grpc_completion_queue_destroy(proxy->cq);
+  grpc_call_details_destroy(&proxy->new_call_details);
+  gpr_free(proxy);
+}
+
+static void unrefpc(proxy_call* pc, const char* reason) {
+  if (gpr_unref(&pc->refs)) {
+    grpc_call_unref(pc->c2p);
+    grpc_call_unref(pc->p2s);
+    grpc_metadata_array_destroy(&pc->c2p_initial_metadata);
+    grpc_metadata_array_destroy(&pc->p2s_initial_metadata);
+    grpc_metadata_array_destroy(&pc->p2s_trailing_metadata);
+    grpc_slice_unref(pc->p2s_status_details);
+    gpr_free(pc);
+  }
+}
+
+static void refpc(proxy_call* pc, const char* reason) { gpr_ref(&pc->refs); }
+
+static void on_c2p_sent_initial_metadata(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  unrefpc(pc, "on_c2p_sent_initial_metadata");
+}
+
+static void on_p2s_recv_initial_metadata(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  grpc_op op;
+  grpc_call_error err;
+
+  memset(&op, 0, sizeof(op));
+  if (!pc->proxy->shutdown) {
+    op.op = GRPC_OP_SEND_INITIAL_METADATA;
+    op.flags = 0;
+    op.reserved = NULL;
+    op.data.send_initial_metadata.count = pc->p2s_initial_metadata.count;
+    op.data.send_initial_metadata.metadata = pc->p2s_initial_metadata.metadata;
+    refpc(pc, "on_c2p_sent_initial_metadata");
+    err = grpc_call_start_batch(
+        pc->c2p, &op, 1, new_closure(on_c2p_sent_initial_metadata, pc), NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+  }
+
+  unrefpc(pc, "on_p2s_recv_initial_metadata");
+}
+
+static void on_p2s_sent_initial_metadata(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  unrefpc(pc, "on_p2s_sent_initial_metadata");
+}
+
+static void on_c2p_recv_msg(void* arg, int success);
+
+static void on_p2s_sent_message(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  grpc_op op;
+  grpc_call_error err;
+
+  grpc_byte_buffer_destroy(pc->c2p_msg);
+  if (!pc->proxy->shutdown && success) {
+    op.op = GRPC_OP_RECV_MESSAGE;
+    op.flags = 0;
+    op.reserved = NULL;
+    op.data.recv_message.recv_message = &pc->c2p_msg;
+    refpc(pc, "on_c2p_recv_msg");
+    err = grpc_call_start_batch(pc->c2p, &op, 1,
+                                new_closure(on_c2p_recv_msg, pc), NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+  }
+
+  unrefpc(pc, "on_p2s_sent_message");
+}
+
+static void on_p2s_sent_close(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  unrefpc(pc, "on_p2s_sent_close");
+}
+
+static void on_c2p_recv_msg(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  grpc_op op;
+  grpc_call_error err;
+
+  if (!pc->proxy->shutdown && success) {
+    if (pc->c2p_msg != NULL) {
+      op.op = GRPC_OP_SEND_MESSAGE;
+      op.flags = 0;
+      op.reserved = NULL;
+      op.data.send_message.send_message = pc->c2p_msg;
+      refpc(pc, "on_p2s_sent_message");
+      err = grpc_call_start_batch(pc->p2s, &op, 1,
+                                  new_closure(on_p2s_sent_message, pc), NULL);
+      GPR_ASSERT(err == GRPC_CALL_OK);
+    } else {
+      op.op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+      op.flags = 0;
+      op.reserved = NULL;
+      refpc(pc, "on_p2s_sent_close");
+      err = grpc_call_start_batch(pc->p2s, &op, 1,
+                                  new_closure(on_p2s_sent_close, pc), NULL);
+      GPR_ASSERT(err == GRPC_CALL_OK);
+    }
+  } else {
+    if (pc->c2p_msg != NULL) {
+      grpc_byte_buffer_destroy(pc->c2p_msg);
+    }
+  }
+
+  unrefpc(pc, "on_c2p_recv_msg");
+}
+
+static void on_p2s_recv_msg(void* arg, int success);
+
+static void on_c2p_sent_message(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  grpc_op op;
+  grpc_call_error err;
+
+  grpc_byte_buffer_destroy(pc->p2s_msg);
+  if (!pc->proxy->shutdown && success) {
+    op.op = GRPC_OP_RECV_MESSAGE;
+    op.flags = 0;
+    op.reserved = NULL;
+    op.data.recv_message.recv_message = &pc->p2s_msg;
+    refpc(pc, "on_p2s_recv_msg");
+    err = grpc_call_start_batch(pc->p2s, &op, 1,
+                                new_closure(on_p2s_recv_msg, pc), NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+  }
+
+  unrefpc(pc, "on_c2p_sent_message");
+}
+
+static void on_p2s_recv_msg(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  grpc_op op;
+  grpc_call_error err;
+
+  if (!pc->proxy->shutdown && success && pc->p2s_msg) {
+    op.op = GRPC_OP_SEND_MESSAGE;
+    op.flags = 0;
+    op.reserved = NULL;
+    op.data.send_message.send_message = pc->p2s_msg;
+    refpc(pc, "on_c2p_sent_message");
+    err = grpc_call_start_batch(pc->c2p, &op, 1,
+                                new_closure(on_c2p_sent_message, pc), NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+  } else {
+    grpc_byte_buffer_destroy(pc->p2s_msg);
+  }
+  unrefpc(pc, "on_p2s_recv_msg");
+}
+
+static void on_c2p_sent_status(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  unrefpc(pc, "on_c2p_sent_status");
+}
+
+static void on_p2s_status(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  grpc_op op;
+  grpc_call_error err;
+
+  if (!pc->proxy->shutdown) {
+    GPR_ASSERT(success);
+    op.op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+    op.flags = 0;
+    op.reserved = NULL;
+    op.data.send_status_from_server.trailing_metadata_count =
+        pc->p2s_trailing_metadata.count;
+    op.data.send_status_from_server.trailing_metadata =
+        pc->p2s_trailing_metadata.metadata;
+    op.data.send_status_from_server.status = pc->p2s_status;
+    op.data.send_status_from_server.status_details = &pc->p2s_status_details;
+    refpc(pc, "on_c2p_sent_status");
+    err = grpc_call_start_batch(pc->c2p, &op, 1,
+                                new_closure(on_c2p_sent_status, pc), NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+  }
+
+  unrefpc(pc, "on_p2s_status");
+}
+
+static void on_c2p_closed(void* arg, int success) {
+  proxy_call* pc = (proxy_call*)arg;
+  unrefpc(pc, "on_c2p_closed");
+}
+
+static void on_new_call(void* arg, int success) {
+  grpc_end2end_proxy* proxy = (grpc_end2end_proxy*)arg;
+  grpc_call_error err;
+
+  if (success) {
+    grpc_op op;
+    memset(&op, 0, sizeof(op));
+    proxy_call* pc = (proxy_call*)gpr_malloc(sizeof(*pc));
+    memset(pc, 0, sizeof(*pc));
+    pc->proxy = proxy;
+    GPR_SWAP(grpc_metadata_array, pc->c2p_initial_metadata,
+             proxy->new_call_metadata);
+    pc->c2p = proxy->new_call;
+    pc->p2s = grpc_channel_create_call(
+        proxy->client, pc->c2p, GRPC_PROPAGATE_DEFAULTS, proxy->cq,
+        proxy->new_call_details.method, &proxy->new_call_details.host,
+        proxy->new_call_details.deadline, NULL);
+    gpr_ref_init(&pc->refs, 1);
+
+    op.reserved = NULL;
+
+    op.op = GRPC_OP_RECV_INITIAL_METADATA;
+    op.flags = 0;
+    op.data.recv_initial_metadata.recv_initial_metadata =
+        &pc->p2s_initial_metadata;
+    refpc(pc, "on_p2s_recv_initial_metadata");
+    err = grpc_call_start_batch(
+        pc->p2s, &op, 1, new_closure(on_p2s_recv_initial_metadata, pc), NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+
+    op.op = GRPC_OP_SEND_INITIAL_METADATA;
+    op.flags = proxy->new_call_details.flags;
+    op.data.send_initial_metadata.count = pc->c2p_initial_metadata.count;
+    op.data.send_initial_metadata.metadata = pc->c2p_initial_metadata.metadata;
+    refpc(pc, "on_p2s_sent_initial_metadata");
+    err = grpc_call_start_batch(
+        pc->p2s, &op, 1, new_closure(on_p2s_sent_initial_metadata, pc), NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+
+    op.op = GRPC_OP_RECV_MESSAGE;
+    op.flags = 0;
+    op.data.recv_message.recv_message = &pc->c2p_msg;
+    refpc(pc, "on_c2p_recv_msg");
+    err = grpc_call_start_batch(pc->c2p, &op, 1,
+                                new_closure(on_c2p_recv_msg, pc), NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+
+    op.op = GRPC_OP_RECV_MESSAGE;
+    op.flags = 0;
+    op.data.recv_message.recv_message = &pc->p2s_msg;
+    refpc(pc, "on_p2s_recv_msg");
+    err = grpc_call_start_batch(pc->p2s, &op, 1,
+                                new_closure(on_p2s_recv_msg, pc), NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+
+    op.op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+    op.flags = 0;
+    op.data.recv_status_on_client.trailing_metadata =
+        &pc->p2s_trailing_metadata;
+    op.data.recv_status_on_client.status = &pc->p2s_status;
+    op.data.recv_status_on_client.status_details = &pc->p2s_status_details;
+    refpc(pc, "on_p2s_status");
+    err = grpc_call_start_batch(pc->p2s, &op, 1, new_closure(on_p2s_status, pc),
+                                NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+
+    op.op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+    op.flags = 0;
+    op.data.recv_close_on_server.cancelled = &pc->c2p_server_cancelled;
+    refpc(pc, "on_c2p_closed");
+    err = grpc_call_start_batch(pc->c2p, &op, 1, new_closure(on_c2p_closed, pc),
+                                NULL);
+    GPR_ASSERT(err == GRPC_CALL_OK);
+
+    request_call(proxy);
+
+    grpc_call_details_destroy(&proxy->new_call_details);
+    grpc_call_details_init(&proxy->new_call_details);
+
+    unrefpc(pc, "init");
+  } else {
+    GPR_ASSERT(proxy->new_call == NULL);
+  }
+}
+
+static void request_call(grpc_end2end_proxy* proxy) {
+  proxy->new_call = NULL;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 proxy->server, &proxy->new_call,
+                                 &proxy->new_call_details,
+                                 &proxy->new_call_metadata, proxy->cq,
+                                 proxy->cq, new_closure(on_new_call, proxy)));
+}
+
+static void thread_main(void* arg) {
+  grpc_end2end_proxy* proxy = (grpc_end2end_proxy*)arg;
+  closure* cl;
+  for (;;) {
+    grpc_event ev = grpc_completion_queue_next(
+        proxy->cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
+    switch (ev.type) {
+      case GRPC_QUEUE_TIMEOUT:
+        gpr_log(GPR_ERROR, "Should never reach here");
+        abort();
+      case GRPC_QUEUE_SHUTDOWN:
+        return;
+      case GRPC_OP_COMPLETE:
+        cl = (closure*)ev.tag;
+        cl->func(cl->arg, ev.success);
+        gpr_free(cl);
+        break;
+    }
+  }
+}
+
+const char* grpc_end2end_proxy_get_client_target(grpc_end2end_proxy* proxy) {
+  return proxy->proxy_port;
+}
+
+const char* grpc_end2end_proxy_get_server_port(grpc_end2end_proxy* proxy) {
+  return proxy->server_port;
+}
diff --git a/test/core/end2end/fixtures/proxy.h b/test/core/end2end/fixtures/proxy.h
index 89b965c..18ad763 100644
--- a/test/core/end2end/fixtures/proxy.h
+++ b/test/core/end2end/fixtures/proxy.h
@@ -26,18 +26,18 @@
 typedef struct grpc_end2end_proxy grpc_end2end_proxy;
 
 typedef struct grpc_end2end_proxy_def {
-  grpc_server *(*create_server)(const char *port,
-                                grpc_channel_args *server_args);
-  grpc_channel *(*create_client)(const char *target,
-                                 grpc_channel_args *client_args);
+  grpc_server* (*create_server)(const char* port,
+                                grpc_channel_args* server_args);
+  grpc_channel* (*create_client)(const char* target,
+                                 grpc_channel_args* client_args);
 } grpc_end2end_proxy_def;
 
-grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def,
-                                              grpc_channel_args *client_args,
-                                              grpc_channel_args *server_args);
-void grpc_end2end_proxy_destroy(grpc_end2end_proxy *proxy);
+grpc_end2end_proxy* grpc_end2end_proxy_create(const grpc_end2end_proxy_def* def,
+                                              grpc_channel_args* client_args,
+                                              grpc_channel_args* server_args);
+void grpc_end2end_proxy_destroy(grpc_end2end_proxy* proxy);
 
-const char *grpc_end2end_proxy_get_client_target(grpc_end2end_proxy *proxy);
-const char *grpc_end2end_proxy_get_server_port(grpc_end2end_proxy *proxy);
+const char* grpc_end2end_proxy_get_client_target(grpc_end2end_proxy* proxy);
+const char* grpc_end2end_proxy_get_server_port(grpc_end2end_proxy* proxy);
 
 #endif /* GRPC_TEST_CORE_END2END_FIXTURES_PROXY_H */
diff --git a/test/core/end2end/fuzzers/BUILD b/test/core/end2end/fuzzers/BUILD
index 4ed9a70..d33e2b0 100644
--- a/test/core/end2end/fuzzers/BUILD
+++ b/test/core/end2end/fuzzers/BUILD
@@ -22,8 +22,8 @@
 
 grpc_fuzzer(
     name = "api_fuzzer",
-    srcs = ["api_fuzzer.c"],
-    language = "C",
+    srcs = ["api_fuzzer.cc"],
+    language = "C++",
     corpus = "api_fuzzer_corpus",
     deps = [
         "//:gpr",
@@ -35,8 +35,8 @@
 
 grpc_fuzzer(
     name = "client_fuzzer",
-    srcs = ["client_fuzzer.c"],
-    language = "C",
+    srcs = ["client_fuzzer.cc"],
+    language = "C++",
     corpus = "client_fuzzer_corpus",
     deps = [
         "//:gpr",
@@ -47,8 +47,8 @@
 
 grpc_fuzzer(
     name = "server_fuzzer",
-    srcs = ["server_fuzzer.c"],
-    language = "C",
+    srcs = ["server_fuzzer.cc"],
+    language = "C++",
     corpus = "server_fuzzer_corpus",
     deps = [
         "//:gpr",
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c
deleted file mode 100644
index 0a787bb..0000000
--- a/test/core/end2end/fuzzers/api_fuzzer.c
+++ /dev/null
@@ -1,1220 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/tcp_client.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/timer_manager.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/surface/server.h"
-#include "src/core/lib/transport/metadata.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/util/passthru_endpoint.h"
-
-////////////////////////////////////////////////////////////////////////////////
-// logging
-
-bool squelch = true;
-bool leak_check = true;
-
-static void dont_log(gpr_log_func_args *args) {}
-
-////////////////////////////////////////////////////////////////////////////////
-// global state
-
-static gpr_timespec g_now;
-static grpc_server *g_server;
-static grpc_channel *g_channel;
-static grpc_resource_quota *g_resource_quota;
-
-extern gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type);
-
-static gpr_timespec now_impl(gpr_clock_type clock_type) {
-  GPR_ASSERT(clock_type != GPR_TIMESPAN);
-  gpr_timespec ts = g_now;
-  ts.clock_type = clock_type;
-  return ts;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// input_stream: allows easy access to input bytes, and allows reading a little
-//               past the end (avoiding needing to check everywhere)
-
-typedef struct {
-  const uint8_t *cur;
-  const uint8_t *end;
-} input_stream;
-
-static uint8_t next_byte(input_stream *inp) {
-  if (inp->cur == inp->end) {
-    return 0;
-  }
-  return *inp->cur++;
-}
-
-static void end(input_stream *inp) { inp->cur = inp->end; }
-
-static char *read_string(input_stream *inp, bool *special) {
-  char *str = NULL;
-  size_t cap = 0;
-  size_t sz = 0;
-  char c;
-  do {
-    if (cap == sz) {
-      cap = GPR_MAX(3 * cap / 2, cap + 8);
-      str = gpr_realloc(str, cap);
-    }
-    c = (char)next_byte(inp);
-    str[sz++] = c;
-  } while (c != 0 && c != 1);
-  if (special != NULL) {
-    *special = (c == 1);
-  }
-  if (c == 1) {
-    str[sz - 1] = 0;
-  }
-  return str;
-}
-
-static void read_buffer(input_stream *inp, char **buffer, size_t *length,
-                        bool *special) {
-  *length = next_byte(inp);
-  if (*length == 255) {
-    if (special != NULL) *special = true;
-    *length = next_byte(inp);
-  } else {
-    if (special != NULL) *special = false;
-  }
-  *buffer = gpr_malloc(*length);
-  for (size_t i = 0; i < *length; i++) {
-    (*buffer)[i] = (char)next_byte(inp);
-  }
-}
-
-static grpc_slice maybe_intern(grpc_slice s, bool intern) {
-  grpc_slice r = intern ? grpc_slice_intern(s) : grpc_slice_ref(s);
-  grpc_slice_unref(s);
-  return r;
-}
-
-static grpc_slice read_string_like_slice(input_stream *inp) {
-  bool special;
-  char *s = read_string(inp, &special);
-  grpc_slice r = maybe_intern(grpc_slice_from_copied_string(s), special);
-  gpr_free(s);
-  return r;
-}
-
-static grpc_slice read_buffer_like_slice(input_stream *inp) {
-  char *buffer;
-  size_t length;
-  bool special;
-  read_buffer(inp, &buffer, &length, &special);
-  grpc_slice r =
-      maybe_intern(grpc_slice_from_copied_buffer(buffer, length), special);
-  gpr_free(buffer);
-  return r;
-}
-
-static uint32_t read_uint22(input_stream *inp) {
-  uint8_t b = next_byte(inp);
-  uint32_t x = b & 0x7f;
-  if (b & 0x80) {
-    x <<= 7;
-    b = next_byte(inp);
-    x |= b & 0x7f;
-    if (b & 0x80) {
-      x <<= 8;
-      x |= next_byte(inp);
-    }
-  }
-  return x;
-}
-
-static uint32_t read_uint32(input_stream *inp) {
-  uint8_t b = next_byte(inp);
-  uint32_t x = b & 0x7f;
-  if (b & 0x80) {
-    x <<= 7;
-    b = next_byte(inp);
-    x |= b & 0x7f;
-    if (b & 0x80) {
-      x <<= 7;
-      b = next_byte(inp);
-      x |= b & 0x7f;
-      if (b & 0x80) {
-        x <<= 7;
-        b = next_byte(inp);
-        x |= b & 0x7f;
-        if (b & 0x80) {
-          x = (x << 4) | (next_byte(inp) & 0x0f);
-        }
-      }
-    }
-  }
-  return x;
-}
-
-static grpc_byte_buffer *read_message(input_stream *inp) {
-  grpc_slice slice = grpc_slice_malloc(read_uint22(inp));
-  memset(GRPC_SLICE_START_PTR(slice), 0, GRPC_SLICE_LENGTH(slice));
-  grpc_byte_buffer *out = grpc_raw_byte_buffer_create(&slice, 1);
-  grpc_slice_unref(slice);
-  return out;
-}
-
-static int read_int(input_stream *inp) { return (int)read_uint32(inp); }
-
-static grpc_channel_args *read_args(input_stream *inp) {
-  size_t n = next_byte(inp);
-  grpc_arg *args = gpr_malloc(sizeof(*args) * n);
-  for (size_t i = 0; i < n; i++) {
-    switch (next_byte(inp)) {
-      case 1:
-        args[i].type = GRPC_ARG_STRING;
-        args[i].key = read_string(inp, NULL);
-        args[i].value.string = read_string(inp, NULL);
-        break;
-      case 2:
-        args[i].type = GRPC_ARG_INTEGER;
-        args[i].key = read_string(inp, NULL);
-        args[i].value.integer = read_int(inp);
-        break;
-      case 3:
-        args[i].type = GRPC_ARG_POINTER;
-        args[i].key = gpr_strdup(GRPC_ARG_RESOURCE_QUOTA);
-        args[i].value.pointer.vtable = grpc_resource_quota_arg_vtable();
-        args[i].value.pointer.p = g_resource_quota;
-        grpc_resource_quota_ref(g_resource_quota);
-        break;
-      default:
-        end(inp);
-        n = i;
-        break;
-    }
-  }
-  grpc_channel_args *a = gpr_malloc(sizeof(*a));
-  a->args = args;
-  a->num_args = n;
-  return a;
-}
-
-typedef struct cred_artifact_ctx {
-  int num_release;
-  char *release[3];
-} cred_artifact_ctx;
-#define CRED_ARTIFACT_CTX_INIT \
-  {                            \
-    0, { 0 }                   \
-  }
-
-static void cred_artifact_ctx_finish(cred_artifact_ctx *ctx) {
-  for (int i = 0; i < ctx->num_release; i++) {
-    gpr_free(ctx->release[i]);
-  }
-}
-
-static const char *read_cred_artifact(cred_artifact_ctx *ctx, input_stream *inp,
-                                      const char **builtins,
-                                      size_t num_builtins) {
-  uint8_t b = next_byte(inp);
-  if (b == 0) return NULL;
-  if (b == 1) return ctx->release[ctx->num_release++] = read_string(inp, NULL);
-  if (b >= num_builtins + 1) {
-    end(inp);
-    return NULL;
-  }
-  return builtins[b - 1];
-}
-
-static grpc_channel_credentials *read_ssl_channel_creds(input_stream *inp) {
-  cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
-  static const char *builtin_root_certs[] = {test_root_cert};
-  static const char *builtin_private_keys[] = {
-      test_server1_key, test_self_signed_client_key, test_signed_client_key};
-  static const char *builtin_cert_chains[] = {
-      test_server1_cert, test_self_signed_client_cert, test_signed_client_cert};
-  const char *root_certs = read_cred_artifact(
-      &ctx, inp, builtin_root_certs, GPR_ARRAY_SIZE(builtin_root_certs));
-  const char *private_key = read_cred_artifact(
-      &ctx, inp, builtin_private_keys, GPR_ARRAY_SIZE(builtin_private_keys));
-  const char *certs = read_cred_artifact(&ctx, inp, builtin_cert_chains,
-                                         GPR_ARRAY_SIZE(builtin_cert_chains));
-  grpc_ssl_pem_key_cert_pair key_cert_pair = {private_key, certs};
-  grpc_channel_credentials *creds = grpc_ssl_credentials_create(
-      root_certs, private_key != NULL && certs != NULL ? &key_cert_pair : NULL,
-      NULL);
-  cred_artifact_ctx_finish(&ctx);
-  return creds;
-}
-
-static grpc_call_credentials *read_call_creds(input_stream *inp) {
-  switch (next_byte(inp)) {
-    default:
-      end(inp);
-      return NULL;
-    case 0:
-      return NULL;
-    case 1: {
-      grpc_call_credentials *c1 = read_call_creds(inp);
-      grpc_call_credentials *c2 = read_call_creds(inp);
-      if (c1 != NULL && c2 != NULL) {
-        grpc_call_credentials *out =
-            grpc_composite_call_credentials_create(c1, c2, NULL);
-        grpc_call_credentials_release(c1);
-        grpc_call_credentials_release(c2);
-        return out;
-      } else if (c1 != NULL) {
-        return c1;
-      } else if (c2 != NULL) {
-        return c2;
-      } else {
-        return NULL;
-      }
-      GPR_UNREACHABLE_CODE(return NULL);
-    }
-    case 2: {
-      cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
-      const char *access_token = read_cred_artifact(&ctx, inp, NULL, 0);
-      grpc_call_credentials *out =
-          access_token == NULL ? NULL : grpc_access_token_credentials_create(
-                                            access_token, NULL);
-      cred_artifact_ctx_finish(&ctx);
-      return out;
-    }
-    case 3: {
-      cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
-      const char *auth_token = read_cred_artifact(&ctx, inp, NULL, 0);
-      const char *auth_selector = read_cred_artifact(&ctx, inp, NULL, 0);
-      grpc_call_credentials *out = auth_token == NULL || auth_selector == NULL
-                                       ? NULL
-                                       : grpc_google_iam_credentials_create(
-                                             auth_token, auth_selector, NULL);
-      cred_artifact_ctx_finish(&ctx);
-      return out;
-    }
-      /* TODO(ctiller): more cred types here */
-  }
-}
-
-static grpc_channel_credentials *read_channel_creds(input_stream *inp) {
-  switch (next_byte(inp)) {
-    case 0:
-      return read_ssl_channel_creds(inp);
-      break;
-    case 1: {
-      grpc_channel_credentials *c1 = read_channel_creds(inp);
-      grpc_call_credentials *c2 = read_call_creds(inp);
-      if (c1 != NULL && c2 != NULL) {
-        grpc_channel_credentials *out =
-            grpc_composite_channel_credentials_create(c1, c2, NULL);
-        grpc_channel_credentials_release(c1);
-        grpc_call_credentials_release(c2);
-        return out;
-      } else if (c1) {
-        return c1;
-      } else if (c2) {
-        grpc_call_credentials_release(c2);
-        return NULL;
-      } else {
-        return NULL;
-      }
-      GPR_UNREACHABLE_CODE(return NULL);
-    }
-    case 2:
-      return NULL;
-    default:
-      end(inp);
-      return NULL;
-  }
-}
-
-static bool is_eof(input_stream *inp) { return inp->cur == inp->end; }
-
-////////////////////////////////////////////////////////////////////////////////
-// dns resolution
-
-typedef struct addr_req {
-  grpc_timer timer;
-  char *addr;
-  grpc_closure *on_done;
-  grpc_resolved_addresses **addrs;
-  grpc_lb_addresses **lb_addrs;
-} addr_req;
-
-static void finish_resolve(grpc_exec_ctx *exec_ctx, void *arg,
-                           grpc_error *error) {
-  addr_req *r = arg;
-
-  if (error == GRPC_ERROR_NONE && 0 == strcmp(r->addr, "server")) {
-    if (r->addrs != NULL) {
-      grpc_resolved_addresses *addrs = gpr_malloc(sizeof(*addrs));
-      addrs->naddrs = 1;
-      addrs->addrs = gpr_malloc(sizeof(*addrs->addrs));
-      addrs->addrs[0].len = 0;
-      *r->addrs = addrs;
-    } else if (r->lb_addrs != NULL) {
-      grpc_lb_addresses *lb_addrs = grpc_lb_addresses_create(1, NULL);
-      grpc_lb_addresses_set_address(lb_addrs, 0, NULL, 0, NULL, NULL, NULL);
-      *r->lb_addrs = lb_addrs;
-    }
-    GRPC_CLOSURE_SCHED(exec_ctx, r->on_done, GRPC_ERROR_NONE);
-  } else {
-    GRPC_CLOSURE_SCHED(exec_ctx, r->on_done,
-                       GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
-                           "Resolution failed", &error, 1));
-  }
-
-  gpr_free(r->addr);
-  gpr_free(r);
-}
-
-void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr,
-                        const char *default_port,
-                        grpc_pollset_set *interested_parties,
-                        grpc_closure *on_done,
-                        grpc_resolved_addresses **addresses) {
-  addr_req *r = gpr_malloc(sizeof(*r));
-  r->addr = gpr_strdup(addr);
-  r->on_done = on_done;
-  r->addrs = addresses;
-  r->lb_addrs = NULL;
-  grpc_timer_init(
-      exec_ctx, &r->timer, GPR_MS_PER_SEC + grpc_exec_ctx_now(exec_ctx),
-      GRPC_CLOSURE_CREATE(finish_resolve, r, grpc_schedule_on_exec_ctx));
-}
-
-grpc_ares_request *my_dns_lookup_ares(
-    grpc_exec_ctx *exec_ctx, const char *dns_server, const char *addr,
-    const char *default_port, grpc_pollset_set *interested_parties,
-    grpc_closure *on_done, grpc_lb_addresses **lb_addrs, bool check_grpclb,
-    char **service_config_json) {
-  addr_req *r = gpr_malloc(sizeof(*r));
-  r->addr = gpr_strdup(addr);
-  r->on_done = on_done;
-  r->addrs = NULL;
-  r->lb_addrs = lb_addrs;
-  grpc_timer_init(
-      exec_ctx, &r->timer, GPR_MS_PER_SEC + grpc_exec_ctx_now(exec_ctx),
-      GRPC_CLOSURE_CREATE(finish_resolve, r, grpc_schedule_on_exec_ctx));
-  return NULL;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// client connection
-
-// defined in tcp_client_posix.c
-extern void (*grpc_tcp_client_connect_impl)(
-    grpc_exec_ctx *exec_ctx, grpc_closure *closure, grpc_endpoint **ep,
-    grpc_pollset_set *interested_parties, const grpc_channel_args *channel_args,
-    const grpc_resolved_address *addr, gpr_timespec deadline);
-
-static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                          grpc_endpoint **ep, gpr_timespec deadline);
-
-typedef struct {
-  grpc_timer timer;
-  grpc_closure *closure;
-  grpc_endpoint **ep;
-  gpr_timespec deadline;
-} future_connect;
-
-static void do_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  future_connect *fc = arg;
-  if (error != GRPC_ERROR_NONE) {
-    *fc->ep = NULL;
-    GRPC_CLOSURE_SCHED(exec_ctx, fc->closure, GRPC_ERROR_REF(error));
-  } else if (g_server != NULL) {
-    grpc_endpoint *client;
-    grpc_endpoint *server;
-    grpc_passthru_endpoint_create(&client, &server, g_resource_quota, NULL);
-    *fc->ep = client;
-
-    grpc_transport *transport =
-        grpc_create_chttp2_transport(exec_ctx, NULL, server, 0);
-    grpc_server_setup_transport(exec_ctx, g_server, transport, NULL, NULL);
-    grpc_chttp2_transport_start_reading(exec_ctx, transport, NULL);
-
-    GRPC_CLOSURE_SCHED(exec_ctx, fc->closure, GRPC_ERROR_NONE);
-  } else {
-    sched_connect(exec_ctx, fc->closure, fc->ep, fc->deadline);
-  }
-  gpr_free(fc);
-}
-
-static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure,
-                          grpc_endpoint **ep, gpr_timespec deadline) {
-  if (gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) < 0) {
-    *ep = NULL;
-    GRPC_CLOSURE_SCHED(exec_ctx, closure, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-                                              "Connect deadline exceeded"));
-    return;
-  }
-
-  future_connect *fc = gpr_malloc(sizeof(*fc));
-  fc->closure = closure;
-  fc->ep = ep;
-  fc->deadline = deadline;
-  grpc_timer_init(
-      exec_ctx, &fc->timer, GPR_MS_PER_SEC + grpc_exec_ctx_now(exec_ctx),
-      GRPC_CLOSURE_CREATE(do_connect, fc, grpc_schedule_on_exec_ctx));
-}
-
-static void my_tcp_client_connect(grpc_exec_ctx *exec_ctx,
-                                  grpc_closure *closure, grpc_endpoint **ep,
-                                  grpc_pollset_set *interested_parties,
-                                  const grpc_channel_args *channel_args,
-                                  const grpc_resolved_address *addr,
-                                  gpr_timespec deadline) {
-  sched_connect(exec_ctx, closure, ep, deadline);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// test driver
-
-typedef struct validator {
-  void (*validate)(void *arg, bool success);
-  void *arg;
-} validator;
-
-static validator *create_validator(void (*validate)(void *arg, bool success),
-                                   void *arg) {
-  validator *v = gpr_malloc(sizeof(*v));
-  v->validate = validate;
-  v->arg = arg;
-  return v;
-}
-
-static void assert_success_and_decrement(void *counter, bool success) {
-  GPR_ASSERT(success);
-  --*(int *)counter;
-}
-
-static void decrement(void *counter, bool success) { --*(int *)counter; }
-
-typedef struct connectivity_watch {
-  int *counter;
-  gpr_timespec deadline;
-} connectivity_watch;
-
-static connectivity_watch *make_connectivity_watch(gpr_timespec s,
-                                                   int *counter) {
-  connectivity_watch *o = gpr_malloc(sizeof(*o));
-  o->deadline = s;
-  o->counter = counter;
-  return o;
-}
-
-static void validate_connectivity_watch(void *p, bool success) {
-  connectivity_watch *w = p;
-  if (!success) {
-    GPR_ASSERT(gpr_time_cmp(gpr_now(w->deadline.clock_type), w->deadline) >= 0);
-  }
-  --*w->counter;
-  gpr_free(w);
-}
-
-static void free_non_null(void *p) {
-  GPR_ASSERT(p != NULL);
-  gpr_free(p);
-}
-
-typedef enum { ROOT, CLIENT, SERVER, PENDING_SERVER } call_state_type;
-
-#define DONE_FLAG_CALL_CLOSED ((uint64_t)(1 << 0))
-
-typedef struct call_state {
-  call_state_type type;
-  grpc_call *call;
-  grpc_byte_buffer *recv_message;
-  grpc_status_code status;
-  grpc_metadata_array recv_initial_metadata;
-  grpc_metadata_array recv_trailing_metadata;
-  grpc_slice recv_status_details;
-  int cancelled;
-  int pending_ops;
-  grpc_call_details call_details;
-  grpc_byte_buffer *send_message;
-  // starts at 0, individual flags from DONE_FLAG_xxx are set
-  // as different operations are completed
-  uint64_t done_flags;
-
-  // array of pointers to free later
-  size_t num_to_free;
-  size_t cap_to_free;
-  void **to_free;
-
-  // array of slices to unref
-  size_t num_slices_to_unref;
-  size_t cap_slices_to_unref;
-  grpc_slice **slices_to_unref;
-
-  struct call_state *next;
-  struct call_state *prev;
-} call_state;
-
-static call_state *g_active_call;
-
-static call_state *new_call(call_state *sibling, call_state_type type) {
-  call_state *c = gpr_malloc(sizeof(*c));
-  memset(c, 0, sizeof(*c));
-  if (sibling != NULL) {
-    c->next = sibling;
-    c->prev = sibling->prev;
-    c->next->prev = c->prev->next = c;
-  } else {
-    c->next = c->prev = c;
-  }
-  c->type = type;
-  return c;
-}
-
-static call_state *maybe_delete_call_state(call_state *call) {
-  call_state *next = call->next;
-
-  if (call->call != NULL) return next;
-  if (call->pending_ops != 0) return next;
-
-  if (call == g_active_call) {
-    g_active_call = call->next;
-    GPR_ASSERT(call != g_active_call);
-  }
-
-  call->prev->next = call->next;
-  call->next->prev = call->prev;
-  grpc_metadata_array_destroy(&call->recv_initial_metadata);
-  grpc_metadata_array_destroy(&call->recv_trailing_metadata);
-  grpc_slice_unref(call->recv_status_details);
-  grpc_call_details_destroy(&call->call_details);
-
-  for (size_t i = 0; i < call->num_slices_to_unref; i++) {
-    grpc_slice_unref(*call->slices_to_unref[i]);
-    gpr_free(call->slices_to_unref[i]);
-  }
-  for (size_t i = 0; i < call->num_to_free; i++) {
-    gpr_free(call->to_free[i]);
-  }
-  gpr_free(call->to_free);
-  gpr_free(call->slices_to_unref);
-
-  gpr_free(call);
-
-  return next;
-}
-
-static void add_to_free(call_state *call, void *p) {
-  if (call->num_to_free == call->cap_to_free) {
-    call->cap_to_free = GPR_MAX(8, 2 * call->cap_to_free);
-    call->to_free =
-        gpr_realloc(call->to_free, sizeof(*call->to_free) * call->cap_to_free);
-  }
-  call->to_free[call->num_to_free++] = p;
-}
-
-static grpc_slice *add_slice_to_unref(call_state *call, grpc_slice s) {
-  if (call->num_slices_to_unref == call->cap_slices_to_unref) {
-    call->cap_slices_to_unref = GPR_MAX(8, 2 * call->cap_slices_to_unref);
-    call->slices_to_unref =
-        gpr_realloc(call->slices_to_unref,
-                    sizeof(*call->slices_to_unref) * call->cap_slices_to_unref);
-  }
-  call->slices_to_unref[call->num_slices_to_unref] =
-      gpr_malloc(sizeof(grpc_slice));
-  *call->slices_to_unref[call->num_slices_to_unref++] = s;
-  return call->slices_to_unref[call->num_slices_to_unref - 1];
-}
-
-static void read_metadata(input_stream *inp, size_t *count,
-                          grpc_metadata **metadata, call_state *cs) {
-  *count = next_byte(inp);
-  if (*count) {
-    *metadata = gpr_malloc(*count * sizeof(**metadata));
-    memset(*metadata, 0, *count * sizeof(**metadata));
-    for (size_t i = 0; i < *count; i++) {
-      (*metadata)[i].key = read_string_like_slice(inp);
-      (*metadata)[i].value = read_buffer_like_slice(inp);
-      (*metadata)[i].flags = read_uint32(inp);
-      add_slice_to_unref(cs, (*metadata)[i].key);
-      add_slice_to_unref(cs, (*metadata)[i].value);
-    }
-  } else {
-    *metadata = gpr_malloc(1);
-  }
-  add_to_free(cs, *metadata);
-}
-
-static call_state *destroy_call(call_state *call) {
-  grpc_call_unref(call->call);
-  call->call = NULL;
-  return maybe_delete_call_state(call);
-}
-
-static void finished_request_call(void *csp, bool success) {
-  call_state *cs = csp;
-  GPR_ASSERT(cs->pending_ops > 0);
-  --cs->pending_ops;
-  if (success) {
-    GPR_ASSERT(cs->call != NULL);
-    cs->type = SERVER;
-  } else {
-    maybe_delete_call_state(cs);
-  }
-}
-
-typedef struct {
-  call_state *cs;
-  uint8_t has_ops;
-} batch_info;
-
-static void finished_batch(void *p, bool success) {
-  batch_info *bi = p;
-  --bi->cs->pending_ops;
-  if ((bi->has_ops & (1u << GRPC_OP_RECV_MESSAGE)) &&
-      (bi->cs->done_flags & DONE_FLAG_CALL_CLOSED)) {
-    GPR_ASSERT(bi->cs->recv_message == NULL);
-  }
-  if ((bi->has_ops & (1u << GRPC_OP_RECV_MESSAGE) &&
-       bi->cs->recv_message != NULL)) {
-    grpc_byte_buffer_destroy(bi->cs->recv_message);
-    bi->cs->recv_message = NULL;
-  }
-  if ((bi->has_ops & (1u << GRPC_OP_SEND_MESSAGE))) {
-    grpc_byte_buffer_destroy(bi->cs->send_message);
-    bi->cs->send_message = NULL;
-  }
-  if ((bi->has_ops & (1u << GRPC_OP_RECV_STATUS_ON_CLIENT)) ||
-      (bi->has_ops & (1u << GRPC_OP_RECV_CLOSE_ON_SERVER))) {
-    bi->cs->done_flags |= DONE_FLAG_CALL_CLOSED;
-  }
-  maybe_delete_call_state(bi->cs);
-  gpr_free(bi);
-}
-
-static validator *make_finished_batch_validator(call_state *cs,
-                                                uint8_t has_ops) {
-  batch_info *bi = gpr_malloc(sizeof(*bi));
-  bi->cs = cs;
-  bi->has_ops = has_ops;
-  return create_validator(finished_batch, bi);
-}
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  grpc_test_only_set_slice_hash_seed(0);
-  char *grpc_trace_fuzzer = gpr_getenv("GRPC_TRACE_FUZZER");
-  if (squelch && grpc_trace_fuzzer == NULL) gpr_set_log_function(dont_log);
-  gpr_free(grpc_trace_fuzzer);
-  input_stream inp = {data, data + size};
-  grpc_tcp_client_connect_impl = my_tcp_client_connect;
-  gpr_now_impl = now_impl;
-  grpc_init();
-  grpc_timer_manager_set_threading(false);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_executor_set_threading(&exec_ctx, false);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resolve_address = my_resolve_address;
-  grpc_dns_lookup_ares = my_dns_lookup_ares;
-
-  GPR_ASSERT(g_channel == NULL);
-  GPR_ASSERT(g_server == NULL);
-
-  bool server_shutdown = false;
-  int pending_server_shutdowns = 0;
-  int pending_channel_watches = 0;
-  int pending_pings = 0;
-
-  g_active_call = new_call(NULL, ROOT);
-  g_resource_quota = grpc_resource_quota_create("api_fuzzer");
-
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-
-  while (!is_eof(&inp) || g_channel != NULL || g_server != NULL ||
-         pending_channel_watches > 0 || pending_pings > 0 ||
-         g_active_call->type != ROOT || g_active_call->next != g_active_call) {
-    if (is_eof(&inp)) {
-      if (g_channel != NULL) {
-        grpc_channel_destroy(g_channel);
-        g_channel = NULL;
-      }
-      if (g_server != NULL) {
-        if (!server_shutdown) {
-          grpc_server_shutdown_and_notify(
-              g_server, cq, create_validator(assert_success_and_decrement,
-                                             &pending_server_shutdowns));
-          server_shutdown = true;
-          pending_server_shutdowns++;
-        } else if (pending_server_shutdowns == 0) {
-          grpc_server_destroy(g_server);
-          g_server = NULL;
-        }
-      }
-      call_state *s = g_active_call;
-      do {
-        if (s->type != PENDING_SERVER && s->call != NULL) {
-          s = destroy_call(s);
-        } else {
-          s = s->next;
-        }
-      } while (s != g_active_call);
-
-      g_now = gpr_time_add(g_now, gpr_time_from_seconds(1, GPR_TIMESPAN));
-    }
-
-    grpc_timer_manager_tick();
-
-    switch (next_byte(&inp)) {
-      // terminate on bad bytes
-      default:
-        end(&inp);
-        break;
-      // tickle completion queue
-      case 0: {
-        grpc_event ev = grpc_completion_queue_next(
-            cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-        switch (ev.type) {
-          case GRPC_OP_COMPLETE: {
-            validator *v = ev.tag;
-            v->validate(v->arg, ev.success);
-            gpr_free(v);
-            break;
-          }
-          case GRPC_QUEUE_TIMEOUT:
-            break;
-          case GRPC_QUEUE_SHUTDOWN:
-            abort();
-            break;
-        }
-        break;
-      }
-      // increment global time
-      case 1: {
-        g_now = gpr_time_add(
-            g_now, gpr_time_from_micros(read_uint32(&inp), GPR_TIMESPAN));
-        break;
-      }
-      // create an insecure channel
-      case 2: {
-        if (g_channel == NULL) {
-          char *target = read_string(&inp, NULL);
-          char *target_uri;
-          gpr_asprintf(&target_uri, "dns:%s", target);
-          grpc_channel_args *args = read_args(&inp);
-          g_channel = grpc_insecure_channel_create(target_uri, args, NULL);
-          GPR_ASSERT(g_channel != NULL);
-          {
-            grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-            grpc_channel_args_destroy(&exec_ctx, args);
-            grpc_exec_ctx_finish(&exec_ctx);
-          }
-          gpr_free(target_uri);
-          gpr_free(target);
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // destroy a channel
-      case 3: {
-        if (g_channel != NULL) {
-          grpc_channel_destroy(g_channel);
-          g_channel = NULL;
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // bring up a server
-      case 4: {
-        if (g_server == NULL) {
-          grpc_channel_args *args = read_args(&inp);
-          g_server = grpc_server_create(args, NULL);
-          GPR_ASSERT(g_server != NULL);
-          {
-            grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-            grpc_channel_args_destroy(&exec_ctx, args);
-            grpc_exec_ctx_finish(&exec_ctx);
-          }
-          grpc_server_register_completion_queue(g_server, cq, NULL);
-          grpc_server_start(g_server);
-          server_shutdown = false;
-          GPR_ASSERT(pending_server_shutdowns == 0);
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // begin server shutdown
-      case 5: {
-        if (g_server != NULL) {
-          grpc_server_shutdown_and_notify(
-              g_server, cq, create_validator(assert_success_and_decrement,
-                                             &pending_server_shutdowns));
-          pending_server_shutdowns++;
-          server_shutdown = true;
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // cancel all calls if shutdown
-      case 6: {
-        if (g_server != NULL && server_shutdown) {
-          grpc_server_cancel_all_calls(g_server);
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // destroy server
-      case 7: {
-        if (g_server != NULL && server_shutdown &&
-            pending_server_shutdowns == 0) {
-          grpc_server_destroy(g_server);
-          g_server = NULL;
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // check connectivity
-      case 8: {
-        if (g_channel != NULL) {
-          uint8_t try_to_connect = next_byte(&inp);
-          if (try_to_connect == 0 || try_to_connect == 1) {
-            grpc_channel_check_connectivity_state(g_channel, try_to_connect);
-          } else {
-            end(&inp);
-          }
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // watch connectivity
-      case 9: {
-        if (g_channel != NULL) {
-          grpc_connectivity_state st =
-              grpc_channel_check_connectivity_state(g_channel, 0);
-          if (st != GRPC_CHANNEL_SHUTDOWN) {
-            gpr_timespec deadline = gpr_time_add(
-                gpr_now(GPR_CLOCK_REALTIME),
-                gpr_time_from_micros(read_uint32(&inp), GPR_TIMESPAN));
-            grpc_channel_watch_connectivity_state(
-                g_channel, st, deadline, cq,
-                create_validator(validate_connectivity_watch,
-                                 make_connectivity_watch(
-                                     deadline, &pending_channel_watches)));
-            pending_channel_watches++;
-          }
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // create a call
-      case 10: {
-        bool ok = true;
-        if (g_channel == NULL) ok = false;
-        grpc_call *parent_call = NULL;
-        if (g_active_call->type != ROOT) {
-          if (g_active_call->call == NULL || g_active_call->type == CLIENT) {
-            end(&inp);
-            break;
-          }
-          parent_call = g_active_call->call;
-        }
-        uint32_t propagation_mask = read_uint32(&inp);
-        grpc_slice method = read_string_like_slice(&inp);
-        if (GRPC_SLICE_LENGTH(method) == 0) {
-          ok = false;
-        }
-        grpc_slice host = read_string_like_slice(&inp);
-        gpr_timespec deadline =
-            gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                         gpr_time_from_micros(read_uint32(&inp), GPR_TIMESPAN));
-
-        if (ok) {
-          call_state *cs = new_call(g_active_call, CLIENT);
-          cs->call =
-              grpc_channel_create_call(g_channel, parent_call, propagation_mask,
-                                       cq, method, &host, deadline, NULL);
-        } else {
-          end(&inp);
-        }
-        grpc_slice_unref(method);
-        grpc_slice_unref(host);
-        break;
-      }
-      // switch the 'current' call
-      case 11: {
-        g_active_call = g_active_call->next;
-        break;
-      }
-      // queue some ops on a call
-      case 12: {
-        if (g_active_call->type == PENDING_SERVER ||
-            g_active_call->type == ROOT || g_active_call->call == NULL) {
-          end(&inp);
-          break;
-        }
-        size_t num_ops = next_byte(&inp);
-        if (num_ops > 6) {
-          end(&inp);
-          break;
-        }
-        grpc_op *ops = gpr_malloc(sizeof(grpc_op) * num_ops);
-        if (num_ops > 0) memset(ops, 0, sizeof(grpc_op) * num_ops);
-        bool ok = true;
-        size_t i;
-        grpc_op *op;
-        uint8_t has_ops = 0;
-        for (i = 0; i < num_ops; i++) {
-          op = &ops[i];
-          switch (next_byte(&inp)) {
-            default:
-              /* invalid value */
-              op->op = (grpc_op_type)-1;
-              ok = false;
-              break;
-            case GRPC_OP_SEND_INITIAL_METADATA:
-              op->op = GRPC_OP_SEND_INITIAL_METADATA;
-              has_ops |= 1 << GRPC_OP_SEND_INITIAL_METADATA;
-              read_metadata(&inp, &op->data.send_initial_metadata.count,
-                            &op->data.send_initial_metadata.metadata,
-                            g_active_call);
-              break;
-            case GRPC_OP_SEND_MESSAGE:
-              op->op = GRPC_OP_SEND_MESSAGE;
-              if (g_active_call->send_message != NULL) {
-                ok = false;
-              } else {
-                has_ops |= 1 << GRPC_OP_SEND_MESSAGE;
-                g_active_call->send_message =
-                    op->data.send_message.send_message = read_message(&inp);
-              }
-              break;
-            case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
-              op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-              has_ops |= 1 << GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-              break;
-            case GRPC_OP_SEND_STATUS_FROM_SERVER:
-              op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-              has_ops |= 1 << GRPC_OP_SEND_STATUS_FROM_SERVER;
-              read_metadata(
-                  &inp,
-                  &op->data.send_status_from_server.trailing_metadata_count,
-                  &op->data.send_status_from_server.trailing_metadata,
-                  g_active_call);
-              op->data.send_status_from_server.status = next_byte(&inp);
-              op->data.send_status_from_server.status_details =
-                  add_slice_to_unref(g_active_call,
-                                     read_buffer_like_slice(&inp));
-              break;
-            case GRPC_OP_RECV_INITIAL_METADATA:
-              op->op = GRPC_OP_RECV_INITIAL_METADATA;
-              has_ops |= 1 << GRPC_OP_RECV_INITIAL_METADATA;
-              op->data.recv_initial_metadata.recv_initial_metadata =
-                  &g_active_call->recv_initial_metadata;
-              break;
-            case GRPC_OP_RECV_MESSAGE:
-              op->op = GRPC_OP_RECV_MESSAGE;
-              has_ops |= 1 << GRPC_OP_RECV_MESSAGE;
-              op->data.recv_message.recv_message = &g_active_call->recv_message;
-              break;
-            case GRPC_OP_RECV_STATUS_ON_CLIENT:
-              op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-              op->data.recv_status_on_client.status = &g_active_call->status;
-              op->data.recv_status_on_client.trailing_metadata =
-                  &g_active_call->recv_trailing_metadata;
-              op->data.recv_status_on_client.status_details =
-                  &g_active_call->recv_status_details;
-              break;
-            case GRPC_OP_RECV_CLOSE_ON_SERVER:
-              op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-              has_ops |= 1 << GRPC_OP_RECV_CLOSE_ON_SERVER;
-              op->data.recv_close_on_server.cancelled =
-                  &g_active_call->cancelled;
-              break;
-          }
-          op->reserved = NULL;
-          op->flags = read_uint32(&inp);
-        }
-        if (ok) {
-          validator *v = make_finished_batch_validator(g_active_call, has_ops);
-          g_active_call->pending_ops++;
-          grpc_call_error error =
-              grpc_call_start_batch(g_active_call->call, ops, num_ops, v, NULL);
-          if (error != GRPC_CALL_OK) {
-            v->validate(v->arg, false);
-            gpr_free(v);
-          }
-        } else {
-          end(&inp);
-        }
-        if (!ok && (has_ops & (1 << GRPC_OP_SEND_MESSAGE))) {
-          grpc_byte_buffer_destroy(g_active_call->send_message);
-          g_active_call->send_message = NULL;
-        }
-        gpr_free(ops);
-
-        break;
-      }
-      // cancel current call
-      case 13: {
-        if (g_active_call->type != ROOT && g_active_call->call != NULL) {
-          grpc_call_cancel(g_active_call->call, NULL);
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // get a calls peer
-      case 14: {
-        if (g_active_call->type != ROOT && g_active_call->call != NULL) {
-          free_non_null(grpc_call_get_peer(g_active_call->call));
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // get a channels target
-      case 15: {
-        if (g_channel != NULL) {
-          free_non_null(grpc_channel_get_target(g_channel));
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // send a ping on a channel
-      case 16: {
-        if (g_channel != NULL) {
-          pending_pings++;
-          grpc_channel_ping(g_channel, cq,
-                            create_validator(decrement, &pending_pings), NULL);
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // enable a tracer
-      case 17: {
-        char *tracer = read_string(&inp, NULL);
-        grpc_tracer_set_enabled(tracer, 1);
-        gpr_free(tracer);
-        break;
-      }
-      // disable a tracer
-      case 18: {
-        char *tracer = read_string(&inp, NULL);
-        grpc_tracer_set_enabled(tracer, 0);
-        gpr_free(tracer);
-        break;
-      }
-      // request a server call
-      case 19: {
-        if (g_server == NULL) {
-          end(&inp);
-          break;
-        }
-        call_state *cs = new_call(g_active_call, PENDING_SERVER);
-        cs->pending_ops++;
-        validator *v = create_validator(finished_request_call, cs);
-        grpc_call_error error =
-            grpc_server_request_call(g_server, &cs->call, &cs->call_details,
-                                     &cs->recv_initial_metadata, cq, cq, v);
-        if (error != GRPC_CALL_OK) {
-          v->validate(v->arg, false);
-          gpr_free(v);
-        }
-        break;
-      }
-      // destroy a call
-      case 20: {
-        if (g_active_call->type != ROOT &&
-            g_active_call->type != PENDING_SERVER &&
-            g_active_call->call != NULL) {
-          destroy_call(g_active_call);
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-      // resize the buffer pool
-      case 21: {
-        grpc_resource_quota_resize(g_resource_quota, read_uint22(&inp));
-        break;
-      }
-      // create a secure channel
-      case 22: {
-        if (g_channel == NULL) {
-          char *target = read_string(&inp, NULL);
-          char *target_uri;
-          gpr_asprintf(&target_uri, "dns:%s", target);
-          grpc_channel_args *args = read_args(&inp);
-          grpc_channel_credentials *creds = read_channel_creds(&inp);
-          g_channel = grpc_secure_channel_create(creds, target_uri, args, NULL);
-          GPR_ASSERT(g_channel != NULL);
-          {
-            grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-            grpc_channel_args_destroy(&exec_ctx, args);
-            grpc_exec_ctx_finish(&exec_ctx);
-          }
-          gpr_free(target_uri);
-          gpr_free(target);
-          grpc_channel_credentials_release(creds);
-        } else {
-          end(&inp);
-        }
-        break;
-      }
-    }
-  }
-
-  GPR_ASSERT(g_channel == NULL);
-  GPR_ASSERT(g_server == NULL);
-  GPR_ASSERT(g_active_call->type == ROOT);
-  GPR_ASSERT(g_active_call->next == g_active_call);
-  gpr_free(g_active_call);
-
-  grpc_completion_queue_shutdown(cq);
-  GPR_ASSERT(
-      grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL)
-          .type == GRPC_QUEUE_SHUTDOWN);
-  grpc_completion_queue_destroy(cq);
-
-  grpc_resource_quota_unref(g_resource_quota);
-
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/end2end/fuzzers/api_fuzzer.cc b/test/core/end2end/fuzzers/api_fuzzer.cc
new file mode 100644
index 0000000..69a5670
--- /dev/null
+++ b/test/core/end2end/fuzzers/api_fuzzer.cc
@@ -0,0 +1,1232 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/iomgr/timer_manager.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/surface/server.h"
+#include "src/core/lib/transport/metadata.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/util/passthru_endpoint.h"
+
+////////////////////////////////////////////////////////////////////////////////
+// logging
+
+bool squelch = true;
+bool leak_check = true;
+
+static void dont_log(gpr_log_func_args* args) {}
+
+////////////////////////////////////////////////////////////////////////////////
+// global state
+
+static gpr_timespec g_now;
+static grpc_server* g_server;
+static grpc_channel* g_channel;
+static grpc_resource_quota* g_resource_quota;
+
+extern "C" gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type);
+
+static gpr_timespec now_impl(gpr_clock_type clock_type) {
+  GPR_ASSERT(clock_type != GPR_TIMESPAN);
+  gpr_timespec ts = g_now;
+  ts.clock_type = clock_type;
+  return ts;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// input_stream: allows easy access to input bytes, and allows reading a little
+//               past the end (avoiding needing to check everywhere)
+
+typedef struct {
+  const uint8_t* cur;
+  const uint8_t* end;
+} input_stream;
+
+static uint8_t next_byte(input_stream* inp) {
+  if (inp->cur == inp->end) {
+    return 0;
+  }
+  return *inp->cur++;
+}
+
+static void end(input_stream* inp) { inp->cur = inp->end; }
+
+static char* read_string(input_stream* inp, bool* special) {
+  char* str = NULL;
+  size_t cap = 0;
+  size_t sz = 0;
+  char c;
+  do {
+    if (cap == sz) {
+      cap = GPR_MAX(3 * cap / 2, cap + 8);
+      str = static_cast<char*>(gpr_realloc(str, cap));
+    }
+    c = (char)next_byte(inp);
+    str[sz++] = c;
+  } while (c != 0 && c != 1);
+  if (special != NULL) {
+    *special = (c == 1);
+  }
+  if (c == 1) {
+    str[sz - 1] = 0;
+  }
+  return str;
+}
+
+static void read_buffer(input_stream* inp, char** buffer, size_t* length,
+                        bool* special) {
+  *length = next_byte(inp);
+  if (*length == 255) {
+    if (special != NULL) *special = true;
+    *length = next_byte(inp);
+  } else {
+    if (special != NULL) *special = false;
+  }
+  *buffer = static_cast<char*>(gpr_malloc(*length));
+  for (size_t i = 0; i < *length; i++) {
+    (*buffer)[i] = (char)next_byte(inp);
+  }
+}
+
+static grpc_slice maybe_intern(grpc_slice s, bool intern) {
+  grpc_slice r = intern ? grpc_slice_intern(s) : grpc_slice_ref(s);
+  grpc_slice_unref(s);
+  return r;
+}
+
+static grpc_slice read_string_like_slice(input_stream* inp) {
+  bool special;
+  char* s = read_string(inp, &special);
+  grpc_slice r = maybe_intern(grpc_slice_from_copied_string(s), special);
+  gpr_free(s);
+  return r;
+}
+
+static grpc_slice read_buffer_like_slice(input_stream* inp) {
+  char* buffer;
+  size_t length;
+  bool special;
+  read_buffer(inp, &buffer, &length, &special);
+  grpc_slice r =
+      maybe_intern(grpc_slice_from_copied_buffer(buffer, length), special);
+  gpr_free(buffer);
+  return r;
+}
+
+static uint32_t read_uint22(input_stream* inp) {
+  uint8_t b = next_byte(inp);
+  uint32_t x = b & 0x7f;
+  if (b & 0x80) {
+    x <<= 7;
+    b = next_byte(inp);
+    x |= b & 0x7f;
+    if (b & 0x80) {
+      x <<= 8;
+      x |= next_byte(inp);
+    }
+  }
+  return x;
+}
+
+static uint32_t read_uint32(input_stream* inp) {
+  uint8_t b = next_byte(inp);
+  uint32_t x = b & 0x7f;
+  if (b & 0x80) {
+    x <<= 7;
+    b = next_byte(inp);
+    x |= b & 0x7f;
+    if (b & 0x80) {
+      x <<= 7;
+      b = next_byte(inp);
+      x |= b & 0x7f;
+      if (b & 0x80) {
+        x <<= 7;
+        b = next_byte(inp);
+        x |= b & 0x7f;
+        if (b & 0x80) {
+          x = (x << 4) | (next_byte(inp) & 0x0f);
+        }
+      }
+    }
+  }
+  return x;
+}
+
+static grpc_byte_buffer* read_message(input_stream* inp) {
+  grpc_slice slice = grpc_slice_malloc(read_uint22(inp));
+  memset(GRPC_SLICE_START_PTR(slice), 0, GRPC_SLICE_LENGTH(slice));
+  grpc_byte_buffer* out = grpc_raw_byte_buffer_create(&slice, 1);
+  grpc_slice_unref(slice);
+  return out;
+}
+
+static int read_int(input_stream* inp) { return (int)read_uint32(inp); }
+
+static grpc_channel_args* read_args(input_stream* inp) {
+  size_t n = next_byte(inp);
+  grpc_arg* args = static_cast<grpc_arg*>(gpr_malloc(sizeof(*args) * n));
+  for (size_t i = 0; i < n; i++) {
+    switch (next_byte(inp)) {
+      case 1:
+        args[i].type = GRPC_ARG_STRING;
+        args[i].key = read_string(inp, NULL);
+        args[i].value.string = read_string(inp, NULL);
+        break;
+      case 2:
+        args[i].type = GRPC_ARG_INTEGER;
+        args[i].key = read_string(inp, NULL);
+        args[i].value.integer = read_int(inp);
+        break;
+      case 3:
+        args[i].type = GRPC_ARG_POINTER;
+        args[i].key = gpr_strdup(GRPC_ARG_RESOURCE_QUOTA);
+        args[i].value.pointer.vtable = grpc_resource_quota_arg_vtable();
+        args[i].value.pointer.p = g_resource_quota;
+        grpc_resource_quota_ref(g_resource_quota);
+        break;
+      default:
+        end(inp);
+        n = i;
+        break;
+    }
+  }
+  grpc_channel_args* a =
+      static_cast<grpc_channel_args*>(gpr_malloc(sizeof(*a)));
+  a->args = args;
+  a->num_args = n;
+  return a;
+}
+
+typedef struct cred_artifact_ctx {
+  int num_release;
+  char* release[3];
+} cred_artifact_ctx;
+#define CRED_ARTIFACT_CTX_INIT \
+  {                            \
+    0, { 0 }                   \
+  }
+
+static void cred_artifact_ctx_finish(cred_artifact_ctx* ctx) {
+  for (int i = 0; i < ctx->num_release; i++) {
+    gpr_free(ctx->release[i]);
+  }
+}
+
+static const char* read_cred_artifact(cred_artifact_ctx* ctx, input_stream* inp,
+                                      const char** builtins,
+                                      size_t num_builtins) {
+  uint8_t b = next_byte(inp);
+  if (b == 0) return NULL;
+  if (b == 1) return ctx->release[ctx->num_release++] = read_string(inp, NULL);
+  if (b >= num_builtins + 1) {
+    end(inp);
+    return NULL;
+  }
+  return builtins[b - 1];
+}
+
+static grpc_channel_credentials* read_ssl_channel_creds(input_stream* inp) {
+  cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
+  static const char* builtin_root_certs[] = {test_root_cert};
+  static const char* builtin_private_keys[] = {
+      test_server1_key, test_self_signed_client_key, test_signed_client_key};
+  static const char* builtin_cert_chains[] = {
+      test_server1_cert, test_self_signed_client_cert, test_signed_client_cert};
+  const char* root_certs = read_cred_artifact(
+      &ctx, inp, builtin_root_certs, GPR_ARRAY_SIZE(builtin_root_certs));
+  const char* private_key = read_cred_artifact(
+      &ctx, inp, builtin_private_keys, GPR_ARRAY_SIZE(builtin_private_keys));
+  const char* certs = read_cred_artifact(&ctx, inp, builtin_cert_chains,
+                                         GPR_ARRAY_SIZE(builtin_cert_chains));
+  grpc_ssl_pem_key_cert_pair key_cert_pair = {private_key, certs};
+  grpc_channel_credentials* creds = grpc_ssl_credentials_create(
+      root_certs, private_key != NULL && certs != NULL ? &key_cert_pair : NULL,
+      NULL);
+  cred_artifact_ctx_finish(&ctx);
+  return creds;
+}
+
+static grpc_call_credentials* read_call_creds(input_stream* inp) {
+  switch (next_byte(inp)) {
+    default:
+      end(inp);
+      return NULL;
+    case 0:
+      return NULL;
+    case 1: {
+      grpc_call_credentials* c1 = read_call_creds(inp);
+      grpc_call_credentials* c2 = read_call_creds(inp);
+      if (c1 != NULL && c2 != NULL) {
+        grpc_call_credentials* out =
+            grpc_composite_call_credentials_create(c1, c2, NULL);
+        grpc_call_credentials_release(c1);
+        grpc_call_credentials_release(c2);
+        return out;
+      } else if (c1 != NULL) {
+        return c1;
+      } else if (c2 != NULL) {
+        return c2;
+      } else {
+        return NULL;
+      }
+      GPR_UNREACHABLE_CODE(return NULL);
+    }
+    case 2: {
+      cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
+      const char* access_token = read_cred_artifact(&ctx, inp, NULL, 0);
+      grpc_call_credentials* out =
+          access_token == NULL
+              ? NULL
+              : grpc_access_token_credentials_create(access_token, NULL);
+      cred_artifact_ctx_finish(&ctx);
+      return out;
+    }
+    case 3: {
+      cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT;
+      const char* auth_token = read_cred_artifact(&ctx, inp, NULL, 0);
+      const char* auth_selector = read_cred_artifact(&ctx, inp, NULL, 0);
+      grpc_call_credentials* out = auth_token == NULL || auth_selector == NULL
+                                       ? NULL
+                                       : grpc_google_iam_credentials_create(
+                                             auth_token, auth_selector, NULL);
+      cred_artifact_ctx_finish(&ctx);
+      return out;
+    }
+      /* TODO(ctiller): more cred types here */
+  }
+}
+
+static grpc_channel_credentials* read_channel_creds(input_stream* inp) {
+  switch (next_byte(inp)) {
+    case 0:
+      return read_ssl_channel_creds(inp);
+      break;
+    case 1: {
+      grpc_channel_credentials* c1 = read_channel_creds(inp);
+      grpc_call_credentials* c2 = read_call_creds(inp);
+      if (c1 != NULL && c2 != NULL) {
+        grpc_channel_credentials* out =
+            grpc_composite_channel_credentials_create(c1, c2, NULL);
+        grpc_channel_credentials_release(c1);
+        grpc_call_credentials_release(c2);
+        return out;
+      } else if (c1) {
+        return c1;
+      } else if (c2) {
+        grpc_call_credentials_release(c2);
+        return NULL;
+      } else {
+        return NULL;
+      }
+      GPR_UNREACHABLE_CODE(return NULL);
+    }
+    case 2:
+      return NULL;
+    default:
+      end(inp);
+      return NULL;
+  }
+}
+
+static bool is_eof(input_stream* inp) { return inp->cur == inp->end; }
+
+////////////////////////////////////////////////////////////////////////////////
+// dns resolution
+
+typedef struct addr_req {
+  grpc_timer timer;
+  char* addr;
+  grpc_closure* on_done;
+  grpc_resolved_addresses** addrs;
+  grpc_lb_addresses** lb_addrs;
+} addr_req;
+
+static void finish_resolve(grpc_exec_ctx* exec_ctx, void* arg,
+                           grpc_error* error) {
+  addr_req* r = static_cast<addr_req*>(arg);
+
+  if (error == GRPC_ERROR_NONE && 0 == strcmp(r->addr, "server")) {
+    if (r->addrs != NULL) {
+      grpc_resolved_addresses* addrs =
+          static_cast<grpc_resolved_addresses*>(gpr_malloc(sizeof(*addrs)));
+      addrs->naddrs = 1;
+      addrs->addrs = static_cast<grpc_resolved_address*>(
+          gpr_malloc(sizeof(*addrs->addrs)));
+      addrs->addrs[0].len = 0;
+      *r->addrs = addrs;
+    } else if (r->lb_addrs != NULL) {
+      grpc_lb_addresses* lb_addrs = grpc_lb_addresses_create(1, NULL);
+      grpc_lb_addresses_set_address(lb_addrs, 0, NULL, 0, false, NULL, NULL);
+      *r->lb_addrs = lb_addrs;
+    }
+    GRPC_CLOSURE_SCHED(exec_ctx, r->on_done, GRPC_ERROR_NONE);
+  } else {
+    GRPC_CLOSURE_SCHED(exec_ctx, r->on_done,
+                       GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+                           "Resolution failed", &error, 1));
+  }
+
+  gpr_free(r->addr);
+  gpr_free(r);
+}
+
+void my_resolve_address(grpc_exec_ctx* exec_ctx, const char* addr,
+                        const char* default_port,
+                        grpc_pollset_set* interested_parties,
+                        grpc_closure* on_done,
+                        grpc_resolved_addresses** addresses) {
+  addr_req* r = static_cast<addr_req*>(gpr_malloc(sizeof(*r)));
+  r->addr = gpr_strdup(addr);
+  r->on_done = on_done;
+  r->addrs = addresses;
+  r->lb_addrs = NULL;
+  grpc_timer_init(
+      exec_ctx, &r->timer, GPR_MS_PER_SEC + grpc_exec_ctx_now(exec_ctx),
+      GRPC_CLOSURE_CREATE(finish_resolve, r, grpc_schedule_on_exec_ctx));
+}
+
+grpc_ares_request* my_dns_lookup_ares(
+    grpc_exec_ctx* exec_ctx, const char* dns_server, const char* addr,
+    const char* default_port, grpc_pollset_set* interested_parties,
+    grpc_closure* on_done, grpc_lb_addresses** lb_addrs, bool check_grpclb,
+    char** service_config_json) {
+  addr_req* r = static_cast<addr_req*>(gpr_malloc(sizeof(*r)));
+  r->addr = gpr_strdup(addr);
+  r->on_done = on_done;
+  r->addrs = NULL;
+  r->lb_addrs = lb_addrs;
+  grpc_timer_init(
+      exec_ctx, &r->timer, GPR_MS_PER_SEC + grpc_exec_ctx_now(exec_ctx),
+      GRPC_CLOSURE_CREATE(finish_resolve, r, grpc_schedule_on_exec_ctx));
+  return NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// client connection
+
+// defined in tcp_client_posix.c
+extern "C" void (*grpc_tcp_client_connect_impl)(
+    grpc_exec_ctx* exec_ctx, grpc_closure* closure, grpc_endpoint** ep,
+    grpc_pollset_set* interested_parties, const grpc_channel_args* channel_args,
+    const grpc_resolved_address* addr, grpc_millis deadline);
+
+static void sched_connect(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                          grpc_endpoint** ep, gpr_timespec deadline);
+
+typedef struct {
+  grpc_timer timer;
+  grpc_closure* closure;
+  grpc_endpoint** ep;
+  gpr_timespec deadline;
+} future_connect;
+
+static void do_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  future_connect* fc = static_cast<future_connect*>(arg);
+  if (error != GRPC_ERROR_NONE) {
+    *fc->ep = NULL;
+    GRPC_CLOSURE_SCHED(exec_ctx, fc->closure, GRPC_ERROR_REF(error));
+  } else if (g_server != NULL) {
+    grpc_endpoint* client;
+    grpc_endpoint* server;
+    grpc_passthru_endpoint_create(&client, &server, g_resource_quota, NULL);
+    *fc->ep = client;
+
+    grpc_transport* transport =
+        grpc_create_chttp2_transport(exec_ctx, NULL, server, 0);
+    grpc_server_setup_transport(exec_ctx, g_server, transport, NULL, NULL);
+    grpc_chttp2_transport_start_reading(exec_ctx, transport, NULL);
+
+    GRPC_CLOSURE_SCHED(exec_ctx, fc->closure, GRPC_ERROR_NONE);
+  } else {
+    sched_connect(exec_ctx, fc->closure, fc->ep, fc->deadline);
+  }
+  gpr_free(fc);
+}
+
+static void sched_connect(grpc_exec_ctx* exec_ctx, grpc_closure* closure,
+                          grpc_endpoint** ep, gpr_timespec deadline) {
+  if (gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) < 0) {
+    *ep = NULL;
+    GRPC_CLOSURE_SCHED(
+        exec_ctx, closure,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connect deadline exceeded"));
+    return;
+  }
+
+  future_connect* fc = static_cast<future_connect*>(gpr_malloc(sizeof(*fc)));
+  fc->closure = closure;
+  fc->ep = ep;
+  fc->deadline = deadline;
+  grpc_timer_init(
+      exec_ctx, &fc->timer, GPR_MS_PER_SEC + grpc_exec_ctx_now(exec_ctx),
+      GRPC_CLOSURE_CREATE(do_connect, fc, grpc_schedule_on_exec_ctx));
+}
+
+static void my_tcp_client_connect(grpc_exec_ctx* exec_ctx,
+                                  grpc_closure* closure, grpc_endpoint** ep,
+                                  grpc_pollset_set* interested_parties,
+                                  const grpc_channel_args* channel_args,
+                                  const grpc_resolved_address* addr,
+                                  grpc_millis deadline) {
+  sched_connect(exec_ctx, closure, ep,
+                grpc_millis_to_timespec(deadline, GPR_CLOCK_MONOTONIC));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// test driver
+
+typedef struct validator {
+  void (*validate)(void* arg, bool success);
+  void* arg;
+} validator;
+
+static validator* create_validator(void (*validate)(void* arg, bool success),
+                                   void* arg) {
+  validator* v = static_cast<validator*>(gpr_malloc(sizeof(*v)));
+  v->validate = validate;
+  v->arg = arg;
+  return v;
+}
+
+static void assert_success_and_decrement(void* counter, bool success) {
+  GPR_ASSERT(success);
+  --*(int*)counter;
+}
+
+static void decrement(void* counter, bool success) { --*(int*)counter; }
+
+typedef struct connectivity_watch {
+  int* counter;
+  gpr_timespec deadline;
+} connectivity_watch;
+
+static connectivity_watch* make_connectivity_watch(gpr_timespec s,
+                                                   int* counter) {
+  connectivity_watch* o =
+      static_cast<connectivity_watch*>(gpr_malloc(sizeof(*o)));
+  o->deadline = s;
+  o->counter = counter;
+  return o;
+}
+
+static void validate_connectivity_watch(void* p, bool success) {
+  connectivity_watch* w = static_cast<connectivity_watch*>(p);
+  if (!success) {
+    GPR_ASSERT(gpr_time_cmp(gpr_now(w->deadline.clock_type), w->deadline) >= 0);
+  }
+  --*w->counter;
+  gpr_free(w);
+}
+
+static void free_non_null(void* p) {
+  GPR_ASSERT(p != NULL);
+  gpr_free(p);
+}
+
+typedef enum { ROOT, CLIENT, SERVER, PENDING_SERVER } call_state_type;
+
+#define DONE_FLAG_CALL_CLOSED ((uint64_t)(1 << 0))
+
+typedef struct call_state {
+  call_state_type type;
+  grpc_call* call;
+  grpc_byte_buffer* recv_message;
+  grpc_status_code status;
+  grpc_metadata_array recv_initial_metadata;
+  grpc_metadata_array recv_trailing_metadata;
+  grpc_slice recv_status_details;
+  int cancelled;
+  int pending_ops;
+  grpc_call_details call_details;
+  grpc_byte_buffer* send_message;
+  // starts at 0, individual flags from DONE_FLAG_xxx are set
+  // as different operations are completed
+  uint64_t done_flags;
+
+  // array of pointers to free later
+  size_t num_to_free;
+  size_t cap_to_free;
+  void** to_free;
+
+  // array of slices to unref
+  size_t num_slices_to_unref;
+  size_t cap_slices_to_unref;
+  grpc_slice** slices_to_unref;
+
+  struct call_state* next;
+  struct call_state* prev;
+} call_state;
+
+static call_state* g_active_call;
+
+static call_state* new_call(call_state* sibling, call_state_type type) {
+  call_state* c = static_cast<call_state*>(gpr_malloc(sizeof(*c)));
+  memset(c, 0, sizeof(*c));
+  if (sibling != NULL) {
+    c->next = sibling;
+    c->prev = sibling->prev;
+    c->next->prev = c->prev->next = c;
+  } else {
+    c->next = c->prev = c;
+  }
+  c->type = type;
+  return c;
+}
+
+static call_state* maybe_delete_call_state(call_state* call) {
+  call_state* next = call->next;
+
+  if (call->call != NULL) return next;
+  if (call->pending_ops != 0) return next;
+
+  if (call == g_active_call) {
+    g_active_call = call->next;
+    GPR_ASSERT(call != g_active_call);
+  }
+
+  call->prev->next = call->next;
+  call->next->prev = call->prev;
+  grpc_metadata_array_destroy(&call->recv_initial_metadata);
+  grpc_metadata_array_destroy(&call->recv_trailing_metadata);
+  grpc_slice_unref(call->recv_status_details);
+  grpc_call_details_destroy(&call->call_details);
+
+  for (size_t i = 0; i < call->num_slices_to_unref; i++) {
+    grpc_slice_unref(*call->slices_to_unref[i]);
+    gpr_free(call->slices_to_unref[i]);
+  }
+  for (size_t i = 0; i < call->num_to_free; i++) {
+    gpr_free(call->to_free[i]);
+  }
+  gpr_free(call->to_free);
+  gpr_free(call->slices_to_unref);
+
+  gpr_free(call);
+
+  return next;
+}
+
+static void add_to_free(call_state* call, void* p) {
+  if (call->num_to_free == call->cap_to_free) {
+    call->cap_to_free = GPR_MAX(8, 2 * call->cap_to_free);
+    call->to_free = static_cast<void**>(
+        gpr_realloc(call->to_free, sizeof(*call->to_free) * call->cap_to_free));
+  }
+  call->to_free[call->num_to_free++] = p;
+}
+
+static grpc_slice* add_slice_to_unref(call_state* call, grpc_slice s) {
+  if (call->num_slices_to_unref == call->cap_slices_to_unref) {
+    call->cap_slices_to_unref = GPR_MAX(8, 2 * call->cap_slices_to_unref);
+    call->slices_to_unref = static_cast<grpc_slice**>(gpr_realloc(
+        call->slices_to_unref,
+        sizeof(*call->slices_to_unref) * call->cap_slices_to_unref));
+  }
+  call->slices_to_unref[call->num_slices_to_unref] =
+      static_cast<grpc_slice*>(gpr_malloc(sizeof(grpc_slice)));
+  *call->slices_to_unref[call->num_slices_to_unref++] = s;
+  return call->slices_to_unref[call->num_slices_to_unref - 1];
+}
+
+static void read_metadata(input_stream* inp, size_t* count,
+                          grpc_metadata** metadata, call_state* cs) {
+  *count = next_byte(inp);
+  if (*count) {
+    *metadata =
+        static_cast<grpc_metadata*>(gpr_malloc(*count * sizeof(**metadata)));
+    memset(*metadata, 0, *count * sizeof(**metadata));
+    for (size_t i = 0; i < *count; i++) {
+      (*metadata)[i].key = read_string_like_slice(inp);
+      (*metadata)[i].value = read_buffer_like_slice(inp);
+      (*metadata)[i].flags = read_uint32(inp);
+      add_slice_to_unref(cs, (*metadata)[i].key);
+      add_slice_to_unref(cs, (*metadata)[i].value);
+    }
+  } else {
+    *metadata = static_cast<grpc_metadata*>(gpr_malloc(1));
+  }
+  add_to_free(cs, *metadata);
+}
+
+static call_state* destroy_call(call_state* call) {
+  grpc_call_unref(call->call);
+  call->call = NULL;
+  return maybe_delete_call_state(call);
+}
+
+static void finished_request_call(void* csp, bool success) {
+  call_state* cs = static_cast<call_state*>(csp);
+  GPR_ASSERT(cs->pending_ops > 0);
+  --cs->pending_ops;
+  if (success) {
+    GPR_ASSERT(cs->call != NULL);
+    cs->type = SERVER;
+  } else {
+    maybe_delete_call_state(cs);
+  }
+}
+
+typedef struct {
+  call_state* cs;
+  uint8_t has_ops;
+} batch_info;
+
+static void finished_batch(void* p, bool success) {
+  batch_info* bi = static_cast<batch_info*>(p);
+  --bi->cs->pending_ops;
+  if ((bi->has_ops & (1u << GRPC_OP_RECV_MESSAGE)) &&
+      (bi->cs->done_flags & DONE_FLAG_CALL_CLOSED)) {
+    GPR_ASSERT(bi->cs->recv_message == NULL);
+  }
+  if ((bi->has_ops & (1u << GRPC_OP_RECV_MESSAGE) &&
+       bi->cs->recv_message != NULL)) {
+    grpc_byte_buffer_destroy(bi->cs->recv_message);
+    bi->cs->recv_message = NULL;
+  }
+  if ((bi->has_ops & (1u << GRPC_OP_SEND_MESSAGE))) {
+    grpc_byte_buffer_destroy(bi->cs->send_message);
+    bi->cs->send_message = NULL;
+  }
+  if ((bi->has_ops & (1u << GRPC_OP_RECV_STATUS_ON_CLIENT)) ||
+      (bi->has_ops & (1u << GRPC_OP_RECV_CLOSE_ON_SERVER))) {
+    bi->cs->done_flags |= DONE_FLAG_CALL_CLOSED;
+  }
+  maybe_delete_call_state(bi->cs);
+  gpr_free(bi);
+}
+
+static validator* make_finished_batch_validator(call_state* cs,
+                                                uint8_t has_ops) {
+  batch_info* bi = static_cast<batch_info*>(gpr_malloc(sizeof(*bi)));
+  bi->cs = cs;
+  bi->has_ops = has_ops;
+  return create_validator(finished_batch, bi);
+}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  grpc_test_only_set_slice_hash_seed(0);
+  char* grpc_trace_fuzzer = gpr_getenv("GRPC_TRACE_FUZZER");
+  if (squelch && grpc_trace_fuzzer == NULL) gpr_set_log_function(dont_log);
+  gpr_free(grpc_trace_fuzzer);
+  input_stream inp = {data, data + size};
+  grpc_tcp_client_connect_impl = my_tcp_client_connect;
+  gpr_now_impl = now_impl;
+  grpc_init();
+  grpc_timer_manager_set_threading(false);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_executor_set_threading(&exec_ctx, false);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resolve_address = my_resolve_address;
+  grpc_dns_lookup_ares = my_dns_lookup_ares;
+
+  GPR_ASSERT(g_channel == NULL);
+  GPR_ASSERT(g_server == NULL);
+
+  bool server_shutdown = false;
+  int pending_server_shutdowns = 0;
+  int pending_channel_watches = 0;
+  int pending_pings = 0;
+
+  g_active_call = new_call(NULL, ROOT);
+  g_resource_quota = grpc_resource_quota_create("api_fuzzer");
+
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+
+  while (!is_eof(&inp) || g_channel != NULL || g_server != NULL ||
+         pending_channel_watches > 0 || pending_pings > 0 ||
+         g_active_call->type != ROOT || g_active_call->next != g_active_call) {
+    if (is_eof(&inp)) {
+      if (g_channel != NULL) {
+        grpc_channel_destroy(g_channel);
+        g_channel = NULL;
+      }
+      if (g_server != NULL) {
+        if (!server_shutdown) {
+          grpc_server_shutdown_and_notify(
+              g_server, cq,
+              create_validator(assert_success_and_decrement,
+                               &pending_server_shutdowns));
+          server_shutdown = true;
+          pending_server_shutdowns++;
+        } else if (pending_server_shutdowns == 0) {
+          grpc_server_destroy(g_server);
+          g_server = NULL;
+        }
+      }
+      call_state* s = g_active_call;
+      do {
+        if (s->type != PENDING_SERVER && s->call != NULL) {
+          s = destroy_call(s);
+        } else {
+          s = s->next;
+        }
+      } while (s != g_active_call);
+
+      g_now = gpr_time_add(g_now, gpr_time_from_seconds(1, GPR_TIMESPAN));
+    }
+
+    grpc_timer_manager_tick();
+
+    switch (next_byte(&inp)) {
+      // terminate on bad bytes
+      default:
+        end(&inp);
+        break;
+      // tickle completion queue
+      case 0: {
+        grpc_event ev = grpc_completion_queue_next(
+            cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+        switch (ev.type) {
+          case GRPC_OP_COMPLETE: {
+            validator* v = static_cast<validator*>(ev.tag);
+            v->validate(v->arg, ev.success);
+            gpr_free(v);
+            break;
+          }
+          case GRPC_QUEUE_TIMEOUT:
+            break;
+          case GRPC_QUEUE_SHUTDOWN:
+            abort();
+            break;
+        }
+        break;
+      }
+      // increment global time
+      case 1: {
+        g_now = gpr_time_add(
+            g_now, gpr_time_from_micros(read_uint32(&inp), GPR_TIMESPAN));
+        break;
+      }
+      // create an insecure channel
+      case 2: {
+        if (g_channel == NULL) {
+          char* target = read_string(&inp, NULL);
+          char* target_uri;
+          gpr_asprintf(&target_uri, "dns:%s", target);
+          grpc_channel_args* args = read_args(&inp);
+          g_channel = grpc_insecure_channel_create(target_uri, args, NULL);
+          GPR_ASSERT(g_channel != NULL);
+          {
+            grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+            grpc_channel_args_destroy(&exec_ctx, args);
+            grpc_exec_ctx_finish(&exec_ctx);
+          }
+          gpr_free(target_uri);
+          gpr_free(target);
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // destroy a channel
+      case 3: {
+        if (g_channel != NULL) {
+          grpc_channel_destroy(g_channel);
+          g_channel = NULL;
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // bring up a server
+      case 4: {
+        if (g_server == NULL) {
+          grpc_channel_args* args = read_args(&inp);
+          g_server = grpc_server_create(args, NULL);
+          GPR_ASSERT(g_server != NULL);
+          {
+            grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+            grpc_channel_args_destroy(&exec_ctx, args);
+            grpc_exec_ctx_finish(&exec_ctx);
+          }
+          grpc_server_register_completion_queue(g_server, cq, NULL);
+          grpc_server_start(g_server);
+          server_shutdown = false;
+          GPR_ASSERT(pending_server_shutdowns == 0);
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // begin server shutdown
+      case 5: {
+        if (g_server != NULL) {
+          grpc_server_shutdown_and_notify(
+              g_server, cq,
+              create_validator(assert_success_and_decrement,
+                               &pending_server_shutdowns));
+          pending_server_shutdowns++;
+          server_shutdown = true;
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // cancel all calls if shutdown
+      case 6: {
+        if (g_server != NULL && server_shutdown) {
+          grpc_server_cancel_all_calls(g_server);
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // destroy server
+      case 7: {
+        if (g_server != NULL && server_shutdown &&
+            pending_server_shutdowns == 0) {
+          grpc_server_destroy(g_server);
+          g_server = NULL;
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // check connectivity
+      case 8: {
+        if (g_channel != NULL) {
+          uint8_t try_to_connect = next_byte(&inp);
+          if (try_to_connect == 0 || try_to_connect == 1) {
+            grpc_channel_check_connectivity_state(g_channel, try_to_connect);
+          } else {
+            end(&inp);
+          }
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // watch connectivity
+      case 9: {
+        if (g_channel != NULL) {
+          grpc_connectivity_state st =
+              grpc_channel_check_connectivity_state(g_channel, 0);
+          if (st != GRPC_CHANNEL_SHUTDOWN) {
+            gpr_timespec deadline = gpr_time_add(
+                gpr_now(GPR_CLOCK_REALTIME),
+                gpr_time_from_micros(read_uint32(&inp), GPR_TIMESPAN));
+            grpc_channel_watch_connectivity_state(
+                g_channel, st, deadline, cq,
+                create_validator(validate_connectivity_watch,
+                                 make_connectivity_watch(
+                                     deadline, &pending_channel_watches)));
+            pending_channel_watches++;
+          }
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // create a call
+      case 10: {
+        bool ok = true;
+        if (g_channel == NULL) ok = false;
+        grpc_call* parent_call = NULL;
+        if (g_active_call->type != ROOT) {
+          if (g_active_call->call == NULL || g_active_call->type == CLIENT) {
+            end(&inp);
+            break;
+          }
+          parent_call = g_active_call->call;
+        }
+        uint32_t propagation_mask = read_uint32(&inp);
+        grpc_slice method = read_string_like_slice(&inp);
+        if (GRPC_SLICE_LENGTH(method) == 0) {
+          ok = false;
+        }
+        grpc_slice host = read_string_like_slice(&inp);
+        gpr_timespec deadline =
+            gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                         gpr_time_from_micros(read_uint32(&inp), GPR_TIMESPAN));
+
+        if (ok) {
+          call_state* cs = new_call(g_active_call, CLIENT);
+          cs->call =
+              grpc_channel_create_call(g_channel, parent_call, propagation_mask,
+                                       cq, method, &host, deadline, NULL);
+        } else {
+          end(&inp);
+        }
+        grpc_slice_unref(method);
+        grpc_slice_unref(host);
+        break;
+      }
+      // switch the 'current' call
+      case 11: {
+        g_active_call = g_active_call->next;
+        break;
+      }
+      // queue some ops on a call
+      case 12: {
+        if (g_active_call->type == PENDING_SERVER ||
+            g_active_call->type == ROOT || g_active_call->call == NULL) {
+          end(&inp);
+          break;
+        }
+        size_t num_ops = next_byte(&inp);
+        if (num_ops > 6) {
+          end(&inp);
+          break;
+        }
+        grpc_op* ops =
+            static_cast<grpc_op*>(gpr_malloc(sizeof(grpc_op) * num_ops));
+        if (num_ops > 0) memset(ops, 0, sizeof(grpc_op) * num_ops);
+        bool ok = true;
+        size_t i;
+        grpc_op* op;
+        uint8_t has_ops = 0;
+        for (i = 0; i < num_ops; i++) {
+          op = &ops[i];
+          switch (next_byte(&inp)) {
+            default:
+              /* invalid value */
+              op->op = (grpc_op_type)-1;
+              ok = false;
+              break;
+            case GRPC_OP_SEND_INITIAL_METADATA:
+              op->op = GRPC_OP_SEND_INITIAL_METADATA;
+              has_ops |= 1 << GRPC_OP_SEND_INITIAL_METADATA;
+              read_metadata(&inp, &op->data.send_initial_metadata.count,
+                            &op->data.send_initial_metadata.metadata,
+                            g_active_call);
+              break;
+            case GRPC_OP_SEND_MESSAGE:
+              op->op = GRPC_OP_SEND_MESSAGE;
+              if (g_active_call->send_message != NULL) {
+                ok = false;
+              } else {
+                has_ops |= 1 << GRPC_OP_SEND_MESSAGE;
+                g_active_call->send_message =
+                    op->data.send_message.send_message = read_message(&inp);
+              }
+              break;
+            case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
+              op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+              has_ops |= 1 << GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+              break;
+            case GRPC_OP_SEND_STATUS_FROM_SERVER:
+              op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+              has_ops |= 1 << GRPC_OP_SEND_STATUS_FROM_SERVER;
+              read_metadata(
+                  &inp,
+                  &op->data.send_status_from_server.trailing_metadata_count,
+                  &op->data.send_status_from_server.trailing_metadata,
+                  g_active_call);
+              op->data.send_status_from_server.status =
+                  static_cast<grpc_status_code>(next_byte(&inp));
+              op->data.send_status_from_server.status_details =
+                  add_slice_to_unref(g_active_call,
+                                     read_buffer_like_slice(&inp));
+              break;
+            case GRPC_OP_RECV_INITIAL_METADATA:
+              op->op = GRPC_OP_RECV_INITIAL_METADATA;
+              has_ops |= 1 << GRPC_OP_RECV_INITIAL_METADATA;
+              op->data.recv_initial_metadata.recv_initial_metadata =
+                  &g_active_call->recv_initial_metadata;
+              break;
+            case GRPC_OP_RECV_MESSAGE:
+              op->op = GRPC_OP_RECV_MESSAGE;
+              has_ops |= 1 << GRPC_OP_RECV_MESSAGE;
+              op->data.recv_message.recv_message = &g_active_call->recv_message;
+              break;
+            case GRPC_OP_RECV_STATUS_ON_CLIENT:
+              op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+              op->data.recv_status_on_client.status = &g_active_call->status;
+              op->data.recv_status_on_client.trailing_metadata =
+                  &g_active_call->recv_trailing_metadata;
+              op->data.recv_status_on_client.status_details =
+                  &g_active_call->recv_status_details;
+              break;
+            case GRPC_OP_RECV_CLOSE_ON_SERVER:
+              op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+              has_ops |= 1 << GRPC_OP_RECV_CLOSE_ON_SERVER;
+              op->data.recv_close_on_server.cancelled =
+                  &g_active_call->cancelled;
+              break;
+          }
+          op->reserved = NULL;
+          op->flags = read_uint32(&inp);
+        }
+        if (ok) {
+          validator* v = make_finished_batch_validator(g_active_call, has_ops);
+          g_active_call->pending_ops++;
+          grpc_call_error error =
+              grpc_call_start_batch(g_active_call->call, ops, num_ops, v, NULL);
+          if (error != GRPC_CALL_OK) {
+            v->validate(v->arg, false);
+            gpr_free(v);
+          }
+        } else {
+          end(&inp);
+        }
+        if (!ok && (has_ops & (1 << GRPC_OP_SEND_MESSAGE))) {
+          grpc_byte_buffer_destroy(g_active_call->send_message);
+          g_active_call->send_message = NULL;
+        }
+        gpr_free(ops);
+
+        break;
+      }
+      // cancel current call
+      case 13: {
+        if (g_active_call->type != ROOT && g_active_call->call != NULL) {
+          grpc_call_cancel(g_active_call->call, NULL);
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // get a calls peer
+      case 14: {
+        if (g_active_call->type != ROOT && g_active_call->call != NULL) {
+          free_non_null(grpc_call_get_peer(g_active_call->call));
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // get a channels target
+      case 15: {
+        if (g_channel != NULL) {
+          free_non_null(grpc_channel_get_target(g_channel));
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // send a ping on a channel
+      case 16: {
+        if (g_channel != NULL) {
+          pending_pings++;
+          grpc_channel_ping(g_channel, cq,
+                            create_validator(decrement, &pending_pings), NULL);
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // enable a tracer
+      case 17: {
+        char* tracer = read_string(&inp, NULL);
+        grpc_tracer_set_enabled(tracer, 1);
+        gpr_free(tracer);
+        break;
+      }
+      // disable a tracer
+      case 18: {
+        char* tracer = read_string(&inp, NULL);
+        grpc_tracer_set_enabled(tracer, 0);
+        gpr_free(tracer);
+        break;
+      }
+      // request a server call
+      case 19: {
+        if (g_server == NULL) {
+          end(&inp);
+          break;
+        }
+        call_state* cs = new_call(g_active_call, PENDING_SERVER);
+        cs->pending_ops++;
+        validator* v = create_validator(finished_request_call, cs);
+        grpc_call_error error =
+            grpc_server_request_call(g_server, &cs->call, &cs->call_details,
+                                     &cs->recv_initial_metadata, cq, cq, v);
+        if (error != GRPC_CALL_OK) {
+          v->validate(v->arg, false);
+          gpr_free(v);
+        }
+        break;
+      }
+      // destroy a call
+      case 20: {
+        if (g_active_call->type != ROOT &&
+            g_active_call->type != PENDING_SERVER &&
+            g_active_call->call != NULL) {
+          destroy_call(g_active_call);
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+      // resize the buffer pool
+      case 21: {
+        grpc_resource_quota_resize(g_resource_quota, read_uint22(&inp));
+        break;
+      }
+      // create a secure channel
+      case 22: {
+        if (g_channel == NULL) {
+          char* target = read_string(&inp, NULL);
+          char* target_uri;
+          gpr_asprintf(&target_uri, "dns:%s", target);
+          grpc_channel_args* args = read_args(&inp);
+          grpc_channel_credentials* creds = read_channel_creds(&inp);
+          g_channel = grpc_secure_channel_create(creds, target_uri, args, NULL);
+          GPR_ASSERT(g_channel != NULL);
+          {
+            grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+            grpc_channel_args_destroy(&exec_ctx, args);
+            grpc_exec_ctx_finish(&exec_ctx);
+          }
+          gpr_free(target_uri);
+          gpr_free(target);
+          grpc_channel_credentials_release(creds);
+        } else {
+          end(&inp);
+        }
+        break;
+      }
+    }
+  }
+
+  GPR_ASSERT(g_channel == NULL);
+  GPR_ASSERT(g_server == NULL);
+  GPR_ASSERT(g_active_call->type == ROOT);
+  GPR_ASSERT(g_active_call->next == g_active_call);
+  gpr_free(g_active_call);
+
+  grpc_completion_queue_shutdown(cq);
+  GPR_ASSERT(
+      grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL)
+          .type == GRPC_QUEUE_SHUTDOWN);
+  grpc_completion_queue_destroy(cq);
+
+  grpc_resource_quota_unref(g_resource_quota);
+
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/end2end/fuzzers/client_fuzzer.c b/test/core/end2end/fuzzers/client_fuzzer.c
deleted file mode 100644
index 88ba6ba..0000000
--- a/test/core/end2end/fuzzers/client_fuzzer.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/surface/channel.h"
-#include "test/core/util/memory_counters.h"
-#include "test/core/util/mock_endpoint.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-static void discard_write(grpc_slice slice) {}
-
-static void *tag(int n) { return (void *)(uintptr_t)n; }
-
-static void dont_log(gpr_log_func_args *args) {}
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  grpc_test_only_set_slice_hash_seed(0);
-  struct grpc_memory_counters counters;
-  if (squelch) gpr_set_log_function(dont_log);
-  if (leak_check) grpc_memory_counters_init();
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_executor_set_threading(&exec_ctx, false);
-
-  grpc_resource_quota *resource_quota =
-      grpc_resource_quota_create("client_fuzzer");
-  grpc_endpoint *mock_endpoint =
-      grpc_mock_endpoint_create(discard_write, resource_quota);
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-  grpc_transport *transport =
-      grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 1);
-  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
-
-  grpc_channel *channel = grpc_channel_create(
-      &exec_ctx, "test-target", NULL, GRPC_CLIENT_DIRECT_CHANNEL, transport);
-  grpc_slice host = grpc_slice_from_static_string("localhost");
-  grpc_call *call = grpc_channel_create_call(
-      channel, NULL, 0, cq, grpc_slice_from_static_string("/foo"), &host,
-      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_status_code status;
-  grpc_slice details = grpc_empty_slice();
-
-  grpc_op ops[6];
-  memset(ops, 0, sizeof(ops));
-  grpc_op *op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  grpc_call_error error =
-      grpc_call_start_batch(call, ops, (size_t)(op - ops), tag(1), NULL);
-  int requested_calls = 1;
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  grpc_mock_endpoint_put_read(
-      &exec_ctx, mock_endpoint,
-      grpc_slice_from_copied_buffer((const char *)data, size));
-
-  grpc_event ev;
-  while (1) {
-    grpc_exec_ctx_flush(&exec_ctx);
-    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-    switch (ev.type) {
-      case GRPC_QUEUE_TIMEOUT:
-        goto done;
-      case GRPC_QUEUE_SHUTDOWN:
-        break;
-      case GRPC_OP_COMPLETE:
-        requested_calls--;
-        break;
-    }
-  }
-
-done:
-  if (requested_calls) {
-    grpc_call_cancel(call, NULL);
-  }
-  for (int i = 0; i < requested_calls; i++) {
-    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  }
-  grpc_completion_queue_shutdown(cq);
-  for (int i = 0; i < requested_calls; i++) {
-    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
-  }
-  grpc_call_unref(call);
-  grpc_completion_queue_destroy(cq);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_slice_unref(details);
-  grpc_channel_destroy(channel);
-  if (response_payload_recv != NULL) {
-    grpc_byte_buffer_destroy(response_payload_recv);
-  }
-  grpc_shutdown();
-  if (leak_check) {
-    counters = grpc_memory_counters_snapshot();
-    grpc_memory_counters_destroy();
-    GPR_ASSERT(counters.total_size_relative == 0);
-  }
-  return 0;
-}
diff --git a/test/core/end2end/fuzzers/client_fuzzer.cc b/test/core/end2end/fuzzers/client_fuzzer.cc
new file mode 100644
index 0000000..d90ec40
--- /dev/null
+++ b/test/core/end2end/fuzzers/client_fuzzer.cc
@@ -0,0 +1,157 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/channel.h"
+#include "test/core/util/memory_counters.h"
+#include "test/core/util/mock_endpoint.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+static void discard_write(grpc_slice slice) {}
+
+static void* tag(int n) { return (void*)(uintptr_t)n; }
+
+static void dont_log(gpr_log_func_args* args) {}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  grpc_test_only_set_slice_hash_seed(0);
+  struct grpc_memory_counters counters;
+  if (squelch) gpr_set_log_function(dont_log);
+  if (leak_check) grpc_memory_counters_init();
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_executor_set_threading(&exec_ctx, false);
+
+  grpc_resource_quota* resource_quota =
+      grpc_resource_quota_create("client_fuzzer");
+  grpc_endpoint* mock_endpoint =
+      grpc_mock_endpoint_create(discard_write, resource_quota);
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+  grpc_transport* transport =
+      grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 1);
+  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+
+  grpc_channel* channel = grpc_channel_create(
+      &exec_ctx, "test-target", NULL, GRPC_CLIENT_DIRECT_CHANNEL, transport);
+  grpc_slice host = grpc_slice_from_static_string("localhost");
+  grpc_call* call = grpc_channel_create_call(
+      channel, NULL, 0, cq, grpc_slice_from_static_string("/foo"), &host,
+      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_status_code status;
+  grpc_slice details = grpc_empty_slice();
+
+  grpc_op ops[6];
+  memset(ops, 0, sizeof(ops));
+  grpc_op* op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  grpc_call_error error =
+      grpc_call_start_batch(call, ops, (size_t)(op - ops), tag(1), NULL);
+  int requested_calls = 1;
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  grpc_mock_endpoint_put_read(
+      &exec_ctx, mock_endpoint,
+      grpc_slice_from_copied_buffer((const char*)data, size));
+
+  grpc_event ev;
+  while (1) {
+    grpc_exec_ctx_flush(&exec_ctx);
+    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    switch (ev.type) {
+      case GRPC_QUEUE_TIMEOUT:
+        goto done;
+      case GRPC_QUEUE_SHUTDOWN:
+        break;
+      case GRPC_OP_COMPLETE:
+        requested_calls--;
+        break;
+    }
+  }
+
+done:
+  if (requested_calls) {
+    grpc_call_cancel(call, NULL);
+  }
+  for (int i = 0; i < requested_calls; i++) {
+    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  }
+  grpc_completion_queue_shutdown(cq);
+  for (int i = 0; i < requested_calls; i++) {
+    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
+  }
+  grpc_call_unref(call);
+  grpc_completion_queue_destroy(cq);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_slice_unref(details);
+  grpc_channel_destroy(channel);
+  if (response_payload_recv != NULL) {
+    grpc_byte_buffer_destroy(response_payload_recv);
+  }
+  grpc_shutdown();
+  if (leak_check) {
+    counters = grpc_memory_counters_snapshot();
+    grpc_memory_counters_destroy();
+    GPR_ASSERT(counters.total_size_relative == 0);
+  }
+  return 0;
+}
diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c
deleted file mode 100644
index ef4c0a4..0000000
--- a/test/core/end2end/fuzzers/server_fuzzer.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/memory_counters.h"
-#include "test/core/util/mock_endpoint.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-static void discard_write(grpc_slice slice) {}
-
-static void *tag(int n) { return (void *)(uintptr_t)n; }
-static int detag(void *p) { return (int)(uintptr_t)p; }
-
-static void dont_log(gpr_log_func_args *args) {}
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  grpc_test_only_set_slice_hash_seed(0);
-  struct grpc_memory_counters counters;
-  if (squelch) gpr_set_log_function(dont_log);
-  if (leak_check) grpc_memory_counters_init();
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_executor_set_threading(&exec_ctx, false);
-
-  grpc_resource_quota *resource_quota =
-      grpc_resource_quota_create("server_fuzzer");
-  grpc_endpoint *mock_endpoint =
-      grpc_mock_endpoint_create(discard_write, resource_quota);
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-  grpc_mock_endpoint_put_read(
-      &exec_ctx, mock_endpoint,
-      grpc_slice_from_copied_buffer((const char *)data, size));
-
-  grpc_server *server = grpc_server_create(NULL, NULL);
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-  grpc_server_register_completion_queue(server, cq, NULL);
-  // TODO(ctiller): add registered methods (one for POST, one for PUT)
-  // void *registered_method =
-  //    grpc_server_register_method(server, "/reg", NULL, 0);
-  grpc_server_start(server);
-  grpc_transport *transport =
-      grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 0);
-  grpc_server_setup_transport(&exec_ctx, server, transport, NULL, NULL);
-  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
-
-  grpc_call *call1 = NULL;
-  grpc_call_details call_details1;
-  grpc_metadata_array request_metadata1;
-  grpc_call_details_init(&call_details1);
-  grpc_metadata_array_init(&request_metadata1);
-  int requested_calls = 0;
-
-  GPR_ASSERT(GRPC_CALL_OK ==
-             grpc_server_request_call(server, &call1, &call_details1,
-                                      &request_metadata1, cq, cq, tag(1)));
-  requested_calls++;
-
-  grpc_event ev;
-  while (1) {
-    grpc_exec_ctx_flush(&exec_ctx);
-    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-    switch (ev.type) {
-      case GRPC_QUEUE_TIMEOUT:
-        goto done;
-      case GRPC_QUEUE_SHUTDOWN:
-        break;
-      case GRPC_OP_COMPLETE:
-        switch (detag(ev.tag)) {
-          case 1:
-            requested_calls--;
-            // TODO(ctiller): keep reading that call!
-            break;
-        }
-    }
-  }
-
-done:
-  if (call1 != NULL) grpc_call_unref(call1);
-  grpc_call_details_destroy(&call_details1);
-  grpc_metadata_array_destroy(&request_metadata1);
-  grpc_server_shutdown_and_notify(server, cq, tag(0xdead));
-  grpc_server_cancel_all_calls(server);
-  for (int i = 0; i <= requested_calls; i++) {
-    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  }
-  grpc_completion_queue_shutdown(cq);
-  for (int i = 0; i <= requested_calls; i++) {
-    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
-  }
-  grpc_server_destroy(server);
-  grpc_completion_queue_destroy(cq);
-  grpc_shutdown();
-  if (leak_check) {
-    counters = grpc_memory_counters_snapshot();
-    grpc_memory_counters_destroy();
-    GPR_ASSERT(counters.total_size_relative == 0);
-  }
-  return 0;
-}
diff --git a/test/core/end2end/fuzzers/server_fuzzer.cc b/test/core/end2end/fuzzers/server_fuzzer.cc
new file mode 100644
index 0000000..87bccc7
--- /dev/null
+++ b/test/core/end2end/fuzzers/server_fuzzer.cc
@@ -0,0 +1,123 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/server.h"
+#include "test/core/util/memory_counters.h"
+#include "test/core/util/mock_endpoint.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+static void discard_write(grpc_slice slice) {}
+
+static void* tag(int n) { return (void*)(uintptr_t)n; }
+static int detag(void* p) { return (int)(uintptr_t)p; }
+
+static void dont_log(gpr_log_func_args* args) {}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  grpc_test_only_set_slice_hash_seed(0);
+  struct grpc_memory_counters counters;
+  if (squelch) gpr_set_log_function(dont_log);
+  if (leak_check) grpc_memory_counters_init();
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_executor_set_threading(&exec_ctx, false);
+
+  grpc_resource_quota* resource_quota =
+      grpc_resource_quota_create("server_fuzzer");
+  grpc_endpoint* mock_endpoint =
+      grpc_mock_endpoint_create(discard_write, resource_quota);
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+  grpc_mock_endpoint_put_read(
+      &exec_ctx, mock_endpoint,
+      grpc_slice_from_copied_buffer((const char*)data, size));
+
+  grpc_server* server = grpc_server_create(NULL, NULL);
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+  grpc_server_register_completion_queue(server, cq, NULL);
+  // TODO(ctiller): add registered methods (one for POST, one for PUT)
+  // void *registered_method =
+  //    grpc_server_register_method(server, "/reg", NULL, 0);
+  grpc_server_start(server);
+  grpc_transport* transport =
+      grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 0);
+  grpc_server_setup_transport(&exec_ctx, server, transport, NULL, NULL);
+  grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
+
+  grpc_call* call1 = NULL;
+  grpc_call_details call_details1;
+  grpc_metadata_array request_metadata1;
+  grpc_call_details_init(&call_details1);
+  grpc_metadata_array_init(&request_metadata1);
+  int requested_calls = 0;
+
+  GPR_ASSERT(GRPC_CALL_OK ==
+             grpc_server_request_call(server, &call1, &call_details1,
+                                      &request_metadata1, cq, cq, tag(1)));
+  requested_calls++;
+
+  grpc_event ev;
+  while (1) {
+    grpc_exec_ctx_flush(&exec_ctx);
+    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    switch (ev.type) {
+      case GRPC_QUEUE_TIMEOUT:
+        goto done;
+      case GRPC_QUEUE_SHUTDOWN:
+        break;
+      case GRPC_OP_COMPLETE:
+        switch (detag(ev.tag)) {
+          case 1:
+            requested_calls--;
+            // TODO(ctiller): keep reading that call!
+            break;
+        }
+    }
+  }
+
+done:
+  if (call1 != NULL) grpc_call_unref(call1);
+  grpc_call_details_destroy(&call_details1);
+  grpc_metadata_array_destroy(&request_metadata1);
+  grpc_server_shutdown_and_notify(server, cq, tag(0xdead));
+  grpc_server_cancel_all_calls(server);
+  for (int i = 0; i <= requested_calls; i++) {
+    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  }
+  grpc_completion_queue_shutdown(cq);
+  for (int i = 0; i <= requested_calls; i++) {
+    ev = grpc_completion_queue_next(cq, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
+  }
+  grpc_server_destroy(server);
+  grpc_completion_queue_destroy(cq);
+  grpc_shutdown();
+  if (leak_check) {
+    counters = grpc_memory_counters_snapshot();
+    grpc_memory_counters_destroy();
+    GPR_ASSERT(counters.total_size_relative == 0);
+  }
+  return 0;
+}
diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py
index f7f996d..7c8e7f4 100755
--- a/test/core/end2end/gen_build_yaml.py
+++ b/test/core/end2end/gen_build_yaml.py
@@ -220,9 +220,9 @@
               'build': 'private',
               'language': 'c',
               'secure': True,
-              'src': ['test/core/end2end/end2end_tests.c',
-                      'test/core/end2end/end2end_test_utils.c'] + [
-                  'test/core/end2end/tests/%s.c' % t
+              'src': ['test/core/end2end/end2end_tests.cc',
+                      'test/core/end2end/end2end_test_utils.cc'] + [
+                  'test/core/end2end/tests/%s.cc' % t
                   for t in sorted(END2END_TESTS.keys())],
               'headers': ['test/core/end2end/tests/cancel_test_helpers.h',
                           'test/core/end2end/end2end_tests.h'],
@@ -235,9 +235,9 @@
               'build': 'private',
               'language': 'c',
               'secure': False,
-              'src': ['test/core/end2end/end2end_nosec_tests.c',
-                      'test/core/end2end/end2end_test_utils.c'] + [
-                  'test/core/end2end/tests/%s.c' % t
+              'src': ['test/core/end2end/end2end_nosec_tests.cc',
+                      'test/core/end2end/end2end_test_utils.cc'] + [
+                  'test/core/end2end/tests/%s.cc' % t
                   for t in sorted(END2END_TESTS.keys())
                   if not END2END_TESTS[t].secure],
               'headers': ['test/core/end2end/tests/cancel_test_helpers.h',
@@ -252,7 +252,7 @@
               'build': 'test',
               'language': 'c',
               'run': False,
-              'src': ['test/core/end2end/fixtures/%s.c' % f],
+              'src': ['test/core/end2end/fixtures/%s.cc' % f],
               'platforms': END2END_FIXTURES[f].platforms,
               'ci_platforms': (END2END_FIXTURES[f].platforms
                                if END2END_FIXTURES[f].ci_mac else without(
@@ -269,7 +269,7 @@
               'build': 'test',
               'language': 'c',
               'secure': False,
-              'src': ['test/core/end2end/fixtures/%s.c' % f],
+              'src': ['test/core/end2end/fixtures/%s.cc' % f],
               'run': False,
               'platforms': END2END_FIXTURES[f].platforms,
               'ci_platforms': (END2END_FIXTURES[f].platforms
diff --git a/test/core/end2end/generate_tests.bzl b/test/core/end2end/generate_tests.bzl
index 89a95ed..b9a42bd 100755
--- a/test/core/end2end/generate_tests.bzl
+++ b/test/core/end2end/generate_tests.bzl
@@ -186,14 +186,14 @@
 def grpc_end2end_tests():
   grpc_cc_library(
     name = 'end2end_tests',
-    srcs = ['end2end_tests.c', 'end2end_test_utils.c'] + [
-             'tests/%s.c' % t
+    srcs = ['end2end_tests.cc', 'end2end_test_utils.cc'] + [
+             'tests/%s.cc' % t
              for t in sorted(END2END_TESTS.keys())],
     hdrs = [
       'tests/cancel_test_helpers.h',
       'end2end_tests.h'
     ],
-    language = "C",
+    language = "C++",
     deps = [
       ':cq_verifier',
       ':ssl_test_data',
@@ -205,8 +205,8 @@
   for f, fopt in END2END_FIXTURES.items():
     grpc_cc_binary(
       name = '%s_test' % f,
-      srcs = ['fixtures/%s.c' % f],
-      language = "C",
+      srcs = ['fixtures/%s.cc' % f],
+      language = "C++",
       deps = [
         ':end2end_tests',
         '//test/core/util:grpc_test_util',
diff --git a/test/core/end2end/goaway_server_test.c b/test/core/end2end/goaway_server_test.c
deleted file mode 100644
index c3aca13..0000000
--- a/test/core/end2end/goaway_server_test.c
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
-   using that endpoint. Because of various transitive includes in uv.h,
-   including windows.h on Windows, uv.h must be included before other system
-   headers. Therefore, sockaddr.h must always be included first */
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <string.h>
-#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static void *tag(intptr_t i) { return (void *)i; }
-
-static gpr_mu g_mu;
-static int g_resolve_port = -1;
-static void (*iomgr_resolve_address)(grpc_exec_ctx *exec_ctx, const char *addr,
-                                     const char *default_port,
-                                     grpc_pollset_set *interested_parties,
-                                     grpc_closure *on_done,
-                                     grpc_resolved_addresses **addresses);
-
-static grpc_ares_request *(*iomgr_dns_lookup_ares)(
-    grpc_exec_ctx *exec_ctx, const char *dns_server, const char *addr,
-    const char *default_port, grpc_pollset_set *interested_parties,
-    grpc_closure *on_done, grpc_lb_addresses **addresses, bool check_grpclb,
-    char **service_config_json);
-
-static void set_resolve_port(int port) {
-  gpr_mu_lock(&g_mu);
-  g_resolve_port = port;
-  gpr_mu_unlock(&g_mu);
-}
-
-static void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr,
-                               const char *default_port,
-                               grpc_pollset_set *interested_parties,
-                               grpc_closure *on_done,
-                               grpc_resolved_addresses **addrs) {
-  if (0 != strcmp(addr, "test")) {
-    iomgr_resolve_address(exec_ctx, addr, default_port, interested_parties,
-                          on_done, addrs);
-    return;
-  }
-
-  grpc_error *error = GRPC_ERROR_NONE;
-  gpr_mu_lock(&g_mu);
-  if (g_resolve_port < 0) {
-    gpr_mu_unlock(&g_mu);
-    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Failure");
-  } else {
-    *addrs = gpr_malloc(sizeof(**addrs));
-    (*addrs)->naddrs = 1;
-    (*addrs)->addrs = gpr_malloc(sizeof(*(*addrs)->addrs));
-    memset((*addrs)->addrs, 0, sizeof(*(*addrs)->addrs));
-    struct sockaddr_in *sa = (struct sockaddr_in *)(*addrs)->addrs[0].addr;
-    sa->sin_family = AF_INET;
-    sa->sin_addr.s_addr = htonl(0x7f000001);
-    sa->sin_port = htons((uint16_t)g_resolve_port);
-    (*addrs)->addrs[0].len = sizeof(*sa);
-    gpr_mu_unlock(&g_mu);
-  }
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, error);
-}
-
-static grpc_ares_request *my_dns_lookup_ares(
-    grpc_exec_ctx *exec_ctx, const char *dns_server, const char *addr,
-    const char *default_port, grpc_pollset_set *interested_parties,
-    grpc_closure *on_done, grpc_lb_addresses **lb_addrs, bool check_grpclb,
-    char **service_config_json) {
-  if (0 != strcmp(addr, "test")) {
-    return iomgr_dns_lookup_ares(exec_ctx, dns_server, addr, default_port,
-                                 interested_parties, on_done, lb_addrs,
-                                 check_grpclb, service_config_json);
-  }
-
-  grpc_error *error = GRPC_ERROR_NONE;
-  gpr_mu_lock(&g_mu);
-  if (g_resolve_port < 0) {
-    gpr_mu_unlock(&g_mu);
-    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Failure");
-  } else {
-    *lb_addrs = grpc_lb_addresses_create(1, NULL);
-    struct sockaddr_in *sa = gpr_zalloc(sizeof(struct sockaddr_in));
-    sa->sin_family = AF_INET;
-    sa->sin_addr.s_addr = htonl(0x7f000001);
-    sa->sin_port = htons((uint16_t)g_resolve_port);
-    grpc_lb_addresses_set_address(*lb_addrs, 0, sa, sizeof(*sa), false, NULL,
-                                  NULL);
-    gpr_free(sa);
-    gpr_mu_unlock(&g_mu);
-  }
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, error);
-  return NULL;
-}
-
-int main(int argc, char **argv) {
-  grpc_completion_queue *cq;
-  cq_verifier *cqv;
-  grpc_op ops[6];
-  grpc_op *op;
-
-  grpc_test_init(argc, argv);
-
-  gpr_mu_init(&g_mu);
-  grpc_init();
-  iomgr_resolve_address = grpc_resolve_address;
-  iomgr_dns_lookup_ares = grpc_dns_lookup_ares;
-  grpc_resolve_address = my_resolve_address;
-  grpc_dns_lookup_ares = my_dns_lookup_ares;
-
-  int was_cancelled1;
-  int was_cancelled2;
-
-  grpc_metadata_array trailing_metadata_recv1;
-  grpc_metadata_array request_metadata1;
-  grpc_call_details request_details1;
-  grpc_status_code status1;
-  grpc_slice details1;
-  grpc_metadata_array_init(&trailing_metadata_recv1);
-  grpc_metadata_array_init(&request_metadata1);
-  grpc_call_details_init(&request_details1);
-
-  grpc_metadata_array trailing_metadata_recv2;
-  grpc_metadata_array request_metadata2;
-  grpc_call_details request_details2;
-  grpc_status_code status2;
-  grpc_slice details2;
-  grpc_metadata_array_init(&trailing_metadata_recv2);
-  grpc_metadata_array_init(&request_metadata2);
-  grpc_call_details_init(&request_details2);
-
-  cq = grpc_completion_queue_create_for_next(NULL);
-  cqv = cq_verifier_create(cq);
-
-  /* reserve two ports */
-  int port1 = grpc_pick_unused_port_or_die();
-  int port2 = grpc_pick_unused_port_or_die();
-
-  char *addr;
-
-  grpc_channel_args client_args;
-  grpc_arg arg_array[1];
-  arg_array[0].type = GRPC_ARG_INTEGER;
-  arg_array[0].key = "grpc.testing.fixed_reconnect_backoff_ms";
-  arg_array[0].value.integer = 1000;
-  client_args.args = arg_array;
-  client_args.num_args = 1;
-
-  /* create a channel that picks first amongst the servers */
-  grpc_channel *chan = grpc_insecure_channel_create("test", &client_args, NULL);
-  /* and an initial call to them */
-  grpc_slice host = grpc_slice_from_static_string("127.0.0.1");
-  grpc_call *call1 =
-      grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-                               grpc_slice_from_static_string("/foo"), &host,
-                               grpc_timeout_seconds_to_deadline(20), NULL);
-  /* send initial metadata to probe connectivity */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call1, ops,
-                                                   (size_t)(op - ops),
-                                                   tag(0x101), NULL));
-  /* and receive status to probe termination */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1;
-  op->data.recv_status_on_client.status = &status1;
-  op->data.recv_status_on_client.status_details = &details1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call1, ops,
-                                                   (size_t)(op - ops),
-                                                   tag(0x102), NULL));
-
-  /* bring a server up on the first port */
-  grpc_server *server1 = grpc_server_create(NULL, NULL);
-  gpr_asprintf(&addr, "127.0.0.1:%d", port1);
-  grpc_server_add_insecure_http2_port(server1, addr);
-  grpc_server_register_completion_queue(server1, cq, NULL);
-  gpr_free(addr);
-  grpc_server_start(server1);
-
-  /* request a call to the server */
-  grpc_call *server_call1;
-  GPR_ASSERT(GRPC_CALL_OK ==
-             grpc_server_request_call(server1, &server_call1, &request_details1,
-                                      &request_metadata1, cq, cq, tag(0x301)));
-
-  set_resolve_port(port1);
-
-  /* first call should now start */
-  CQ_EXPECT_COMPLETION(cqv, tag(0x101), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(0x301), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(GRPC_CHANNEL_READY ==
-             grpc_channel_check_connectivity_state(chan, 0));
-  grpc_channel_watch_connectivity_state(chan, GRPC_CHANNEL_READY,
-                                        gpr_inf_future(GPR_CLOCK_REALTIME), cq,
-                                        tag(0x9999));
-
-  /* listen for close on the server call to probe for finishing */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled1;
-  op->flags = 0;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(server_call1, ops,
-                                                   (size_t)(op - ops),
-                                                   tag(0x302), NULL));
-
-  /* shutdown first server:
-   * we should see a connectivity change and then nothing */
-  set_resolve_port(-1);
-  grpc_server_shutdown_and_notify(server1, cq, tag(0xdead1));
-  CQ_EXPECT_COMPLETION(cqv, tag(0x9999), 1);
-  cq_verify(cqv);
-  cq_verify_empty(cqv);
-
-  /* and a new call: should go through to server2 when we start it */
-  grpc_call *call2 =
-      grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-                               grpc_slice_from_static_string("/foo"), &host,
-                               grpc_timeout_seconds_to_deadline(20), NULL);
-  /* send initial metadata to probe connectivity */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call2, ops,
-                                                   (size_t)(op - ops),
-                                                   tag(0x201), NULL));
-  /* and receive status to probe termination */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2;
-  op->data.recv_status_on_client.status = &status2;
-  op->data.recv_status_on_client.status_details = &details2;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call2, ops,
-                                                   (size_t)(op - ops),
-                                                   tag(0x202), NULL));
-
-  /* and bring up second server */
-  set_resolve_port(port2);
-  grpc_server *server2 = grpc_server_create(NULL, NULL);
-  gpr_asprintf(&addr, "127.0.0.1:%d", port2);
-  grpc_server_add_insecure_http2_port(server2, addr);
-  grpc_server_register_completion_queue(server2, cq, NULL);
-  gpr_free(addr);
-  grpc_server_start(server2);
-
-  /* request a call to the server */
-  grpc_call *server_call2;
-  GPR_ASSERT(GRPC_CALL_OK ==
-             grpc_server_request_call(server2, &server_call2, &request_details2,
-                                      &request_metadata2, cq, cq, tag(0x401)));
-
-  /* second call should now start */
-  CQ_EXPECT_COMPLETION(cqv, tag(0x201), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(0x401), 1);
-  cq_verify(cqv);
-
-  /* listen for close on the server call to probe for finishing */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled2;
-  op->flags = 0;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(server_call2, ops,
-                                                   (size_t)(op - ops),
-                                                   tag(0x402), NULL));
-
-  /* shutdown second server: we should see nothing */
-  grpc_server_shutdown_and_notify(server2, cq, tag(0xdead2));
-  cq_verify_empty(cqv);
-
-  grpc_call_cancel(call1, NULL);
-  grpc_call_cancel(call2, NULL);
-
-  /* now everything else should finish */
-  CQ_EXPECT_COMPLETION(cqv, tag(0x102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(0x202), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(0x302), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(0x402), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(0xdead1), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(0xdead2), 1);
-  cq_verify(cqv);
-
-  grpc_call_unref(call1);
-  grpc_call_unref(call2);
-  grpc_call_unref(server_call1);
-  grpc_call_unref(server_call2);
-  grpc_server_destroy(server1);
-  grpc_server_destroy(server2);
-  grpc_channel_destroy(chan);
-
-  grpc_metadata_array_destroy(&trailing_metadata_recv1);
-  grpc_metadata_array_destroy(&request_metadata1);
-  grpc_call_details_destroy(&request_details1);
-  grpc_slice_unref(details1);
-  grpc_metadata_array_destroy(&trailing_metadata_recv2);
-  grpc_metadata_array_destroy(&request_metadata2);
-  grpc_call_details_destroy(&request_details2);
-  grpc_slice_unref(details2);
-
-  cq_verifier_destroy(cqv);
-  grpc_completion_queue_destroy(cq);
-
-  grpc_shutdown();
-  gpr_mu_destroy(&g_mu);
-
-  return 0;
-}
diff --git a/test/core/end2end/goaway_server_test.cc b/test/core/end2end/goaway_server_test.cc
new file mode 100644
index 0000000..12a966d
--- /dev/null
+++ b/test/core/end2end/goaway_server_test.cc
@@ -0,0 +1,358 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
+   using that endpoint. Because of various transitive includes in uv.h,
+   including windows.h on Windows, uv.h must be included before other system
+   headers. Therefore, sockaddr.h must always be included first */
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <string.h>
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static void* tag(intptr_t i) { return (void*)i; }
+
+static gpr_mu g_mu;
+static int g_resolve_port = -1;
+static void (*iomgr_resolve_address)(grpc_exec_ctx* exec_ctx, const char* addr,
+                                     const char* default_port,
+                                     grpc_pollset_set* interested_parties,
+                                     grpc_closure* on_done,
+                                     grpc_resolved_addresses** addresses);
+
+static grpc_ares_request* (*iomgr_dns_lookup_ares)(
+    grpc_exec_ctx* exec_ctx, const char* dns_server, const char* addr,
+    const char* default_port, grpc_pollset_set* interested_parties,
+    grpc_closure* on_done, grpc_lb_addresses** addresses, bool check_grpclb,
+    char** service_config_json);
+
+static void set_resolve_port(int port) {
+  gpr_mu_lock(&g_mu);
+  g_resolve_port = port;
+  gpr_mu_unlock(&g_mu);
+}
+
+static void my_resolve_address(grpc_exec_ctx* exec_ctx, const char* addr,
+                               const char* default_port,
+                               grpc_pollset_set* interested_parties,
+                               grpc_closure* on_done,
+                               grpc_resolved_addresses** addrs) {
+  if (0 != strcmp(addr, "test")) {
+    iomgr_resolve_address(exec_ctx, addr, default_port, interested_parties,
+                          on_done, addrs);
+    return;
+  }
+
+  grpc_error* error = GRPC_ERROR_NONE;
+  gpr_mu_lock(&g_mu);
+  if (g_resolve_port < 0) {
+    gpr_mu_unlock(&g_mu);
+    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Failure");
+  } else {
+    *addrs = static_cast<grpc_resolved_addresses*>(gpr_malloc(sizeof(**addrs)));
+    (*addrs)->naddrs = 1;
+    (*addrs)->addrs = static_cast<grpc_resolved_address*>(
+        gpr_malloc(sizeof(*(*addrs)->addrs)));
+    memset((*addrs)->addrs, 0, sizeof(*(*addrs)->addrs));
+    struct sockaddr_in* sa = (struct sockaddr_in*)(*addrs)->addrs[0].addr;
+    sa->sin_family = AF_INET;
+    sa->sin_addr.s_addr = htonl(0x7f000001);
+    sa->sin_port = htons((uint16_t)g_resolve_port);
+    (*addrs)->addrs[0].len = sizeof(*sa);
+    gpr_mu_unlock(&g_mu);
+  }
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, error);
+}
+
+static grpc_ares_request* my_dns_lookup_ares(
+    grpc_exec_ctx* exec_ctx, const char* dns_server, const char* addr,
+    const char* default_port, grpc_pollset_set* interested_parties,
+    grpc_closure* on_done, grpc_lb_addresses** lb_addrs, bool check_grpclb,
+    char** service_config_json) {
+  if (0 != strcmp(addr, "test")) {
+    return iomgr_dns_lookup_ares(exec_ctx, dns_server, addr, default_port,
+                                 interested_parties, on_done, lb_addrs,
+                                 check_grpclb, service_config_json);
+  }
+
+  grpc_error* error = GRPC_ERROR_NONE;
+  gpr_mu_lock(&g_mu);
+  if (g_resolve_port < 0) {
+    gpr_mu_unlock(&g_mu);
+    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Failure");
+  } else {
+    *lb_addrs = grpc_lb_addresses_create(1, NULL);
+    struct sockaddr_in* sa = static_cast<struct sockaddr_in*>(
+        gpr_zalloc(sizeof(struct sockaddr_in)));
+    sa->sin_family = AF_INET;
+    sa->sin_addr.s_addr = htonl(0x7f000001);
+    sa->sin_port = htons((uint16_t)g_resolve_port);
+    grpc_lb_addresses_set_address(*lb_addrs, 0, sa, sizeof(*sa), false, NULL,
+                                  NULL);
+    gpr_free(sa);
+    gpr_mu_unlock(&g_mu);
+  }
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, error);
+  return NULL;
+}
+
+int main(int argc, char** argv) {
+  grpc_completion_queue* cq;
+  cq_verifier* cqv;
+  grpc_op ops[6];
+  grpc_op* op;
+
+  grpc_test_init(argc, argv);
+
+  gpr_mu_init(&g_mu);
+  grpc_init();
+  iomgr_resolve_address = grpc_resolve_address;
+  iomgr_dns_lookup_ares = grpc_dns_lookup_ares;
+  grpc_resolve_address = my_resolve_address;
+  grpc_dns_lookup_ares = my_dns_lookup_ares;
+
+  int was_cancelled1;
+  int was_cancelled2;
+
+  grpc_metadata_array trailing_metadata_recv1;
+  grpc_metadata_array request_metadata1;
+  grpc_call_details request_details1;
+  grpc_status_code status1;
+  grpc_slice details1;
+  grpc_metadata_array_init(&trailing_metadata_recv1);
+  grpc_metadata_array_init(&request_metadata1);
+  grpc_call_details_init(&request_details1);
+
+  grpc_metadata_array trailing_metadata_recv2;
+  grpc_metadata_array request_metadata2;
+  grpc_call_details request_details2;
+  grpc_status_code status2;
+  grpc_slice details2;
+  grpc_metadata_array_init(&trailing_metadata_recv2);
+  grpc_metadata_array_init(&request_metadata2);
+  grpc_call_details_init(&request_details2);
+
+  cq = grpc_completion_queue_create_for_next(NULL);
+  cqv = cq_verifier_create(cq);
+
+  /* reserve two ports */
+  int port1 = grpc_pick_unused_port_or_die();
+  int port2 = grpc_pick_unused_port_or_die();
+
+  char* addr;
+
+  grpc_channel_args client_args;
+  grpc_arg arg_array[1];
+  arg_array[0].type = GRPC_ARG_INTEGER;
+  arg_array[0].key =
+      const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms");
+  arg_array[0].value.integer = 1000;
+  client_args.args = arg_array;
+  client_args.num_args = 1;
+
+  /* create a channel that picks first amongst the servers */
+  grpc_channel* chan = grpc_insecure_channel_create("test", &client_args, NULL);
+  /* and an initial call to them */
+  grpc_slice host = grpc_slice_from_static_string("127.0.0.1");
+  grpc_call* call1 =
+      grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+                               grpc_slice_from_static_string("/foo"), &host,
+                               grpc_timeout_seconds_to_deadline(20), NULL);
+  /* send initial metadata to probe connectivity */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call1, ops,
+                                                   (size_t)(op - ops),
+                                                   tag(0x101), NULL));
+  /* and receive status to probe termination */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1;
+  op->data.recv_status_on_client.status = &status1;
+  op->data.recv_status_on_client.status_details = &details1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call1, ops,
+                                                   (size_t)(op - ops),
+                                                   tag(0x102), NULL));
+
+  /* bring a server up on the first port */
+  grpc_server* server1 = grpc_server_create(NULL, NULL);
+  gpr_asprintf(&addr, "127.0.0.1:%d", port1);
+  grpc_server_add_insecure_http2_port(server1, addr);
+  grpc_server_register_completion_queue(server1, cq, NULL);
+  gpr_free(addr);
+  grpc_server_start(server1);
+
+  /* request a call to the server */
+  grpc_call* server_call1;
+  GPR_ASSERT(GRPC_CALL_OK ==
+             grpc_server_request_call(server1, &server_call1, &request_details1,
+                                      &request_metadata1, cq, cq, tag(0x301)));
+
+  set_resolve_port(port1);
+
+  /* first call should now start */
+  CQ_EXPECT_COMPLETION(cqv, tag(0x101), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(0x301), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(GRPC_CHANNEL_READY ==
+             grpc_channel_check_connectivity_state(chan, 0));
+  grpc_channel_watch_connectivity_state(chan, GRPC_CHANNEL_READY,
+                                        gpr_inf_future(GPR_CLOCK_REALTIME), cq,
+                                        tag(0x9999));
+
+  /* listen for close on the server call to probe for finishing */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled1;
+  op->flags = 0;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(server_call1, ops,
+                                                   (size_t)(op - ops),
+                                                   tag(0x302), NULL));
+
+  /* shutdown first server:
+   * we should see a connectivity change and then nothing */
+  set_resolve_port(-1);
+  grpc_server_shutdown_and_notify(server1, cq, tag(0xdead1));
+  CQ_EXPECT_COMPLETION(cqv, tag(0x9999), 1);
+  cq_verify(cqv);
+  cq_verify_empty(cqv);
+
+  /* and a new call: should go through to server2 when we start it */
+  grpc_call* call2 =
+      grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+                               grpc_slice_from_static_string("/foo"), &host,
+                               grpc_timeout_seconds_to_deadline(20), NULL);
+  /* send initial metadata to probe connectivity */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call2, ops,
+                                                   (size_t)(op - ops),
+                                                   tag(0x201), NULL));
+  /* and receive status to probe termination */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2;
+  op->data.recv_status_on_client.status = &status2;
+  op->data.recv_status_on_client.status_details = &details2;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call2, ops,
+                                                   (size_t)(op - ops),
+                                                   tag(0x202), NULL));
+
+  /* and bring up second server */
+  set_resolve_port(port2);
+  grpc_server* server2 = grpc_server_create(NULL, NULL);
+  gpr_asprintf(&addr, "127.0.0.1:%d", port2);
+  grpc_server_add_insecure_http2_port(server2, addr);
+  grpc_server_register_completion_queue(server2, cq, NULL);
+  gpr_free(addr);
+  grpc_server_start(server2);
+
+  /* request a call to the server */
+  grpc_call* server_call2;
+  GPR_ASSERT(GRPC_CALL_OK ==
+             grpc_server_request_call(server2, &server_call2, &request_details2,
+                                      &request_metadata2, cq, cq, tag(0x401)));
+
+  /* second call should now start */
+  CQ_EXPECT_COMPLETION(cqv, tag(0x201), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(0x401), 1);
+  cq_verify(cqv);
+
+  /* listen for close on the server call to probe for finishing */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled2;
+  op->flags = 0;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(server_call2, ops,
+                                                   (size_t)(op - ops),
+                                                   tag(0x402), NULL));
+
+  /* shutdown second server: we should see nothing */
+  grpc_server_shutdown_and_notify(server2, cq, tag(0xdead2));
+  cq_verify_empty(cqv);
+
+  grpc_call_cancel(call1, NULL);
+  grpc_call_cancel(call2, NULL);
+
+  /* now everything else should finish */
+  CQ_EXPECT_COMPLETION(cqv, tag(0x102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(0x202), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(0x302), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(0x402), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(0xdead1), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(0xdead2), 1);
+  cq_verify(cqv);
+
+  grpc_call_unref(call1);
+  grpc_call_unref(call2);
+  grpc_call_unref(server_call1);
+  grpc_call_unref(server_call2);
+  grpc_server_destroy(server1);
+  grpc_server_destroy(server2);
+  grpc_channel_destroy(chan);
+
+  grpc_metadata_array_destroy(&trailing_metadata_recv1);
+  grpc_metadata_array_destroy(&request_metadata1);
+  grpc_call_details_destroy(&request_details1);
+  grpc_slice_unref(details1);
+  grpc_metadata_array_destroy(&trailing_metadata_recv2);
+  grpc_metadata_array_destroy(&request_metadata2);
+  grpc_call_details_destroy(&request_details2);
+  grpc_slice_unref(details2);
+
+  cq_verifier_destroy(cqv);
+  grpc_completion_queue_destroy(cq);
+
+  grpc_shutdown();
+  gpr_mu_destroy(&g_mu);
+
+  return 0;
+}
diff --git a/test/core/end2end/h2_ssl_cert_test.cc b/test/core/end2end/h2_ssl_cert_test.cc
index 6da5e83..8994b63 100644
--- a/test/core/end2end/h2_ssl_cert_test.cc
+++ b/test/core/end2end/h2_ssl_cert_test.cc
@@ -16,9 +16,7 @@
  *
  */
 
-extern "C" {
 #include "test/core/end2end/end2end_tests.h"
-}
 
 #include <stdio.h>
 #include <string.h>
@@ -27,7 +25,6 @@
 #include <grpc/support/host_port.h>
 #include <grpc/support/log.h>
 
-extern "C" {
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/security/credentials/credentials.h"
 #include "src/core/lib/support/env.h"
@@ -37,7 +34,6 @@
 #include "test/core/end2end/data/ssl_test_data.h"
 #include "test/core/util/port.h"
 #include "test/core/util/test_config.h"
-}
 
 #include <gtest/gtest.h>
 
@@ -45,15 +41,15 @@
 namespace testing {
 
 typedef struct fullstack_secure_fixture_data {
-  char *localaddr;
+  char* localaddr;
 } fullstack_secure_fixture_data;
 
 static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
-    grpc_channel_args *client_args, grpc_channel_args *server_args) {
+    grpc_channel_args* client_args, grpc_channel_args* server_args) {
   grpc_end2end_test_fixture f;
   int port = grpc_pick_unused_port_or_die();
-  fullstack_secure_fixture_data *ffd =
-      static_cast<fullstack_secure_fixture_data *>(
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(
           gpr_malloc(sizeof(fullstack_secure_fixture_data)));
   memset(&f, 0, sizeof(f));
 
@@ -66,19 +62,19 @@
   return f;
 }
 
-static void process_auth_failure(void *state, grpc_auth_context *ctx,
-                                 const grpc_metadata *md, size_t md_count,
+static void process_auth_failure(void* state, grpc_auth_context* ctx,
+                                 const grpc_metadata* md, size_t md_count,
                                  grpc_process_auth_metadata_done_cb cb,
-                                 void *user_data) {
+                                 void* user_data) {
   GPR_ASSERT(state == NULL);
   cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL);
 }
 
 static void chttp2_init_client_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *client_args,
-    grpc_channel_credentials *creds) {
-  fullstack_secure_fixture_data *ffd =
-      static_cast<fullstack_secure_fixture_data *>(f->fixture_data);
+    grpc_end2end_test_fixture* f, grpc_channel_args* client_args,
+    grpc_channel_credentials* creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
   f->client =
       grpc_secure_channel_create(creds, ffd->localaddr, client_args, NULL);
   GPR_ASSERT(f->client != NULL);
@@ -86,10 +82,10 @@
 }
 
 static void chttp2_init_server_secure_fullstack(
-    grpc_end2end_test_fixture *f, grpc_channel_args *server_args,
-    grpc_server_credentials *server_creds) {
-  fullstack_secure_fixture_data *ffd =
-      static_cast<fullstack_secure_fixture_data *>(f->fixture_data);
+    grpc_end2end_test_fixture* f, grpc_channel_args* server_args,
+    grpc_server_credentials* server_creds) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
   if (f->server) {
     grpc_server_destroy(f->server);
   }
@@ -101,14 +97,14 @@
   grpc_server_start(f->server);
 }
 
-void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) {
-  fullstack_secure_fixture_data *ffd =
-      static_cast<fullstack_secure_fixture_data *>(f->fixture_data);
+void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture* f) {
+  fullstack_secure_fixture_data* ffd =
+      static_cast<fullstack_secure_fixture_data*>(f->fixture_data);
   gpr_free(ffd->localaddr);
   gpr_free(ffd);
 }
 
-static int fail_server_auth_check(grpc_channel_args *server_args) {
+static int fail_server_auth_check(grpc_channel_args* server_args) {
   size_t i;
   if (server_args == NULL) return 0;
   for (i = 0; i < server_args->num_args; i++) {
@@ -128,7 +124,7 @@
       grpc_end2end_test_fixture * f, grpc_channel_args * server_args) {     \
     grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,       \
                                                     test_server1_cert};     \
-    grpc_server_credentials *ssl_creds =                                    \
+    grpc_server_credentials* ssl_creds =                                    \
         grpc_ssl_server_credentials_create_ex(                              \
             test_root_cert, &pem_cert_key_pair, 1, REQUEST_TYPE, NULL);     \
     if (fail_server_auth_check(server_args)) {                              \
@@ -154,14 +150,14 @@
 #define CLIENT_INIT(cert_type)                                               \
   static void CLIENT_INIT_NAME(cert_type)(grpc_end2end_test_fixture * f,     \
                                           grpc_channel_args * client_args) { \
-    grpc_channel_credentials *ssl_creds = NULL;                              \
+    grpc_channel_credentials* ssl_creds = NULL;                              \
     grpc_ssl_pem_key_cert_pair self_signed_client_key_cert_pair = {          \
         test_self_signed_client_key, test_self_signed_client_cert};          \
     grpc_ssl_pem_key_cert_pair signed_client_key_cert_pair = {               \
         test_signed_client_key, test_signed_client_cert};                    \
     grpc_ssl_pem_key_cert_pair bad_client_key_cert_pair = {                  \
         test_self_signed_client_key, test_signed_client_cert};               \
-    grpc_ssl_pem_key_cert_pair *key_cert_pair = NULL;                        \
+    grpc_ssl_pem_key_cert_pair* key_cert_pair = NULL;                        \
     switch (cert_type) {                                                     \
       case SELF_SIGNED:                                                      \
         key_cert_pair = &self_signed_client_key_cert_pair;                   \
@@ -179,9 +175,9 @@
         grpc_ssl_credentials_create(test_root_cert, key_cert_pair, NULL);    \
     grpc_arg ssl_name_override = {                                           \
         GRPC_ARG_STRING,                                                     \
-        const_cast<char *>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),               \
-        {const_cast<char *>("foo.test.google.fr")}};                         \
-    grpc_channel_args *new_client_args =                                     \
+        const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),                \
+        {const_cast<char*>("foo.test.google.fr")}};                          \
+    grpc_channel_args* new_client_args =                                     \
         grpc_channel_args_copy_and_add(client_args, &ssl_name_override, 1);  \
     chttp2_init_client_secure_fullstack(f, new_client_args, ssl_creds);      \
     {                                                                        \
@@ -201,15 +197,17 @@
 
 typedef enum { SUCCESS, FAIL } test_result;
 
-#define SSL_TEST(request_type, cert_type, result)                         \
-  {                                                                       \
-    {TEST_NAME(request_type, cert_type, result),                          \
-     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |                           \
-         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS |                     \
-         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL,                            \
-     chttp2_create_fixture_secure_fullstack, CLIENT_INIT_NAME(cert_type), \
-     SERVER_INIT_NAME(request_type), chttp2_tear_down_secure_fullstack},  \
-        result                                                            \
+#define SSL_TEST(request_type, cert_type, result)     \
+  {                                                   \
+    {TEST_NAME(request_type, cert_type, result),      \
+     FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |       \
+         FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \
+         FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL,        \
+     chttp2_create_fixture_secure_fullstack,          \
+     CLIENT_INIT_NAME(cert_type),                     \
+     SERVER_INIT_NAME(request_type),                  \
+     chttp2_tear_down_secure_fullstack},              \
+        result                                        \
   }
 
 /* All test configurations */
@@ -258,7 +256,7 @@
              BAD_CERT_PAIR, FAIL),
 };
 
-static void *tag(intptr_t t) { return (void *)t; }
+static void* tag(intptr_t t) { return (void*)t; }
 
 static gpr_timespec n_seconds_time(int n) {
   return grpc_timeout_seconds_to_deadline(n);
@@ -266,14 +264,14 @@
 
 static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
 
-static void drain_cq(grpc_completion_queue *cq) {
+static void drain_cq(grpc_completion_queue* cq) {
   grpc_event ev;
   do {
     ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL);
   } while (ev.type != GRPC_QUEUE_SHUTDOWN);
 }
 
-static void shutdown_server(grpc_end2end_test_fixture *f) {
+static void shutdown_server(grpc_end2end_test_fixture* f) {
   if (!f->server) return;
   grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
   GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
@@ -284,13 +282,13 @@
   f->server = NULL;
 }
 
-static void shutdown_client(grpc_end2end_test_fixture *f) {
+static void shutdown_client(grpc_end2end_test_fixture* f) {
   if (!f->client) return;
   grpc_channel_destroy(f->client);
   f->client = NULL;
 }
 
-static void end_test(grpc_end2end_test_fixture *f) {
+static void end_test(grpc_end2end_test_fixture* f) {
   shutdown_server(f);
   shutdown_client(f);
 
@@ -302,11 +300,11 @@
 
 static void simple_request_body(grpc_end2end_test_fixture f,
                                 test_result expected_result) {
-  grpc_call *c;
+  grpc_call* c;
   gpr_timespec deadline = five_seconds_time();
-  cq_verifier *cqv = cq_verifier_create(f.cq);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
   grpc_op ops[6];
-  grpc_op *op;
+  grpc_op* op;
   grpc_call_error error;
 
   grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr:1234");
@@ -360,10 +358,10 @@
 }  // namespace testing
 }  // namespace grpc
 
-int main(int argc, char **argv) {
-  FILE *roots_file;
+int main(int argc, char** argv) {
+  FILE* roots_file;
   size_t roots_size = strlen(test_root_cert);
-  char *roots_filename;
+  char* roots_filename;
 
   grpc_test_init(argc, argv);
   /* Set the SSL roots env var. */
diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c
deleted file mode 100644
index e3fd5a8..0000000
--- a/test/core/end2end/invalid_call_argument_test.c
+++ /dev/null
@@ -1,615 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/impl/codegen/port_platform.h>
-
-#include <limits.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static void *tag(intptr_t i) { return (void *)i; }
-
-struct test_state {
-  int is_client;
-  grpc_channel *chan;
-  grpc_call *call;
-  gpr_timespec deadline;
-  grpc_completion_queue *cq;
-  cq_verifier *cqv;
-  grpc_op ops[6];
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_status_code status;
-  grpc_slice details;
-  grpc_call *server_call;
-  grpc_server *server;
-  grpc_metadata_array server_initial_metadata_recv;
-  grpc_call_details call_details;
-};
-
-static struct test_state g_state;
-
-static void prepare_test(int is_client) {
-  int port = grpc_pick_unused_port_or_die();
-  char *server_hostport;
-  grpc_op *op;
-  g_state.is_client = is_client;
-  grpc_metadata_array_init(&g_state.initial_metadata_recv);
-  grpc_metadata_array_init(&g_state.trailing_metadata_recv);
-  g_state.deadline = grpc_timeout_seconds_to_deadline(5);
-  g_state.cq = grpc_completion_queue_create_for_next(NULL);
-  g_state.cqv = cq_verifier_create(g_state.cq);
-  g_state.details = grpc_empty_slice();
-  memset(g_state.ops, 0, sizeof(g_state.ops));
-
-  if (is_client) {
-    /* create a call, channel to a non existant server */
-    g_state.chan =
-        grpc_insecure_channel_create("nonexistant:54321", NULL, NULL);
-    grpc_slice host = grpc_slice_from_static_string("nonexistant");
-    g_state.call = grpc_channel_create_call(
-        g_state.chan, NULL, GRPC_PROPAGATE_DEFAULTS, g_state.cq,
-        grpc_slice_from_static_string("/Foo"), &host, g_state.deadline, NULL);
-  } else {
-    g_state.server = grpc_server_create(NULL, NULL);
-    grpc_server_register_completion_queue(g_state.server, g_state.cq, NULL);
-    gpr_join_host_port(&server_hostport, "0.0.0.0", port);
-    grpc_server_add_insecure_http2_port(g_state.server, server_hostport);
-    grpc_server_start(g_state.server);
-    gpr_free(server_hostport);
-    gpr_join_host_port(&server_hostport, "localhost", port);
-    g_state.chan = grpc_insecure_channel_create(server_hostport, NULL, NULL);
-    gpr_free(server_hostport);
-    grpc_slice host = grpc_slice_from_static_string("bar");
-    g_state.call = grpc_channel_create_call(
-        g_state.chan, NULL, GRPC_PROPAGATE_DEFAULTS, g_state.cq,
-        grpc_slice_from_static_string("/Foo"), &host, g_state.deadline, NULL);
-    grpc_metadata_array_init(&g_state.server_initial_metadata_recv);
-    grpc_call_details_init(&g_state.call_details);
-    op = g_state.ops;
-    op->op = GRPC_OP_SEND_INITIAL_METADATA;
-    op->data.send_initial_metadata.count = 0;
-    op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
-    op->reserved = NULL;
-    op++;
-    GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(g_state.call, g_state.ops,
-                                                     (size_t)(op - g_state.ops),
-                                                     tag(1), NULL));
-    GPR_ASSERT(GRPC_CALL_OK ==
-               grpc_server_request_call(g_state.server, &g_state.server_call,
-                                        &g_state.call_details,
-                                        &g_state.server_initial_metadata_recv,
-                                        g_state.cq, g_state.cq, tag(101)));
-    CQ_EXPECT_COMPLETION(g_state.cqv, tag(101), 1);
-    CQ_EXPECT_COMPLETION(g_state.cqv, tag(1), 1);
-    cq_verify(g_state.cqv);
-  }
-}
-
-static void cleanup_test() {
-  grpc_completion_queue *shutdown_cq;
-  grpc_call_unref(g_state.call);
-  cq_verifier_destroy(g_state.cqv);
-  grpc_channel_destroy(g_state.chan);
-  grpc_slice_unref(g_state.details);
-  grpc_metadata_array_destroy(&g_state.initial_metadata_recv);
-  grpc_metadata_array_destroy(&g_state.trailing_metadata_recv);
-
-  if (!g_state.is_client) {
-    shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-    grpc_call_unref(g_state.server_call);
-    grpc_server_shutdown_and_notify(g_state.server, shutdown_cq, tag(1000));
-    GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000),
-                                           grpc_timeout_seconds_to_deadline(5),
-                                           NULL)
-                   .type == GRPC_OP_COMPLETE);
-    grpc_completion_queue_destroy(shutdown_cq);
-    grpc_server_destroy(g_state.server);
-    grpc_call_details_destroy(&g_state.call_details);
-    grpc_metadata_array_destroy(&g_state.server_initial_metadata_recv);
-  }
-  grpc_completion_queue_shutdown(g_state.cq);
-  while (grpc_completion_queue_next(g_state.cq,
-                                    gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
-             .type != GRPC_QUEUE_SHUTDOWN)
-    ;
-  grpc_completion_queue_destroy(g_state.cq);
-}
-
-static void test_non_null_reserved_on_start_batch() {
-  gpr_log(GPR_INFO, "test_non_null_reserved_on_start_batch");
-
-  prepare_test(1);
-  GPR_ASSERT(GRPC_CALL_ERROR ==
-             grpc_call_start_batch(g_state.call, NULL, 0, NULL, tag(1)));
-  cleanup_test();
-}
-
-static void test_non_null_reserved_on_op() {
-  gpr_log(GPR_INFO, "test_non_null_reserved_on_op");
-
-  grpc_op *op;
-  prepare_test(1);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = tag(2);
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_send_initial_metadata_more_than_once() {
-  gpr_log(GPR_INFO, "test_send_initial_metadata_more_than_once");
-
-  grpc_op *op;
-  prepare_test(1);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(g_state.call, g_state.ops,
-                                                   (size_t)(op - g_state.ops),
-                                                   tag(1), NULL));
-  CQ_EXPECT_COMPLETION(g_state.cqv, tag(1), 0);
-  cq_verify(g_state.cqv);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_too_many_metadata() {
-  gpr_log(GPR_INFO, "test_too_many_metadata");
-
-  grpc_op *op;
-  prepare_test(1);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = (size_t)INT_MAX + 1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_send_null_message() {
-  gpr_log(GPR_INFO, "test_send_null_message");
-
-  grpc_op *op;
-  prepare_test(1);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_MESSAGE ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_send_messages_at_the_same_time() {
-  gpr_log(GPR_INFO, "test_send_messages_at_the_same_time");
-
-  grpc_op *op;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  prepare_test(1);
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = tag(2);
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  grpc_byte_buffer_destroy(request_payload);
-  cleanup_test();
-}
-
-static void test_send_server_status_from_client() {
-  gpr_log(GPR_INFO, "test_send_server_status_from_client");
-
-  grpc_op *op;
-  prepare_test(1);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_CLIENT ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_receive_initial_metadata_twice_at_client() {
-  gpr_log(GPR_INFO, "test_receive_initial_metadata_twice_at_client");
-
-  grpc_op *op;
-  prepare_test(1);
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &g_state.initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(g_state.call, g_state.ops,
-                                                   (size_t)(op - g_state.ops),
-                                                   tag(1), NULL));
-  CQ_EXPECT_COMPLETION(g_state.cqv, tag(1), 0);
-  cq_verify(g_state.cqv);
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &g_state.initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_receive_message_with_invalid_flags() {
-  gpr_log(GPR_INFO, "test_receive_message_with_invalid_flags");
-
-  grpc_op *op;
-  grpc_byte_buffer *payload = NULL;
-  prepare_test(1);
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &payload;
-  op->flags = 1;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_FLAGS ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_receive_two_messages_at_the_same_time() {
-  gpr_log(GPR_INFO, "test_receive_two_messages_at_the_same_time");
-
-  grpc_op *op;
-  grpc_byte_buffer *payload = NULL;
-  prepare_test(1);
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_recv_close_on_server_from_client() {
-  gpr_log(GPR_INFO, "test_recv_close_on_server_from_client");
-
-  grpc_op *op;
-  prepare_test(1);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_CLIENT ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_recv_status_on_client_twice() {
-  gpr_log(GPR_INFO, "test_recv_status_on_client_twice");
-
-  grpc_op *op;
-  prepare_test(1);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata =
-      &g_state.trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &g_state.status;
-  op->data.recv_status_on_client.status_details = &g_state.details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(g_state.call, g_state.ops,
-                                                   (size_t)(op - g_state.ops),
-                                                   tag(1), NULL));
-  CQ_EXPECT_COMPLETION(g_state.cqv, tag(1), 1);
-  cq_verify(g_state.cqv);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = NULL;
-  op->data.recv_status_on_client.status = NULL;
-  op->data.recv_status_on_client.status_details = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-static void test_send_close_from_client_on_server() {
-  gpr_log(GPR_INFO, "test_send_close_from_client_on_server");
-
-  grpc_op *op;
-  prepare_test(0);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_SERVER ==
-             grpc_call_start_batch(g_state.server_call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(2), NULL));
-  cleanup_test();
-}
-
-static void test_recv_status_on_client_from_server() {
-  gpr_log(GPR_INFO, "test_recv_status_on_client_from_server");
-
-  grpc_op *op;
-  prepare_test(0);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata =
-      &g_state.trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &g_state.status;
-  op->data.recv_status_on_client.status_details = &g_state.details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_SERVER ==
-             grpc_call_start_batch(g_state.server_call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(2), NULL));
-  cleanup_test();
-}
-
-static void test_send_status_from_server_with_invalid_flags() {
-  gpr_log(GPR_INFO, "test_send_status_from_server_with_invalid_flags");
-
-  grpc_op *op;
-  prepare_test(0);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 1;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_FLAGS ==
-             grpc_call_start_batch(g_state.server_call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(2), NULL));
-  cleanup_test();
-}
-
-static void test_too_many_trailing_metadata() {
-  gpr_log(GPR_INFO, "test_too_many_trailing_metadata");
-
-  grpc_op *op;
-  prepare_test(0);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count =
-      (size_t)INT_MAX + 1;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA ==
-             grpc_call_start_batch(g_state.server_call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(2), NULL));
-  cleanup_test();
-}
-
-static void test_send_server_status_twice() {
-  gpr_log(GPR_INFO, "test_send_server_status_twice");
-
-  grpc_op *op;
-  prepare_test(0);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
-             grpc_call_start_batch(g_state.server_call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(2), NULL));
-  cleanup_test();
-}
-
-static void test_recv_close_on_server_with_invalid_flags() {
-  gpr_log(GPR_INFO, "test_recv_close_on_server_with_invalid_flags");
-
-  grpc_op *op;
-  prepare_test(0);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = NULL;
-  op->flags = 1;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_FLAGS ==
-             grpc_call_start_batch(g_state.server_call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(2), NULL));
-  cleanup_test();
-}
-
-static void test_recv_close_on_server_twice() {
-  gpr_log(GPR_INFO, "test_recv_close_on_server_twice");
-
-  grpc_op *op;
-  prepare_test(0);
-
-  op = g_state.ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
-             grpc_call_start_batch(g_state.server_call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(2), NULL));
-  cleanup_test();
-}
-
-static void test_invalid_initial_metadata_reserved_key() {
-  gpr_log(GPR_INFO, "test_invalid_initial_metadata_reserved_key");
-
-  grpc_metadata metadata;
-  metadata.key = grpc_slice_from_static_string(":start_with_colon");
-  metadata.value = grpc_slice_from_static_string("value");
-
-  grpc_op *op;
-  prepare_test(1);
-  op = g_state.ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 1;
-  op->data.send_initial_metadata.metadata = &metadata;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA ==
-             grpc_call_start_batch(g_state.call, g_state.ops,
-                                   (size_t)(op - g_state.ops), tag(1), NULL));
-  cleanup_test();
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_invalid_initial_metadata_reserved_key();
-  test_non_null_reserved_on_start_batch();
-  test_non_null_reserved_on_op();
-  test_send_initial_metadata_more_than_once();
-  test_too_many_metadata();
-  test_send_null_message();
-  test_send_messages_at_the_same_time();
-  test_send_server_status_from_client();
-  test_receive_initial_metadata_twice_at_client();
-  test_receive_message_with_invalid_flags();
-  test_receive_two_messages_at_the_same_time();
-  test_recv_close_on_server_from_client();
-  test_recv_status_on_client_twice();
-  test_send_close_from_client_on_server();
-  test_recv_status_on_client_from_server();
-  test_send_status_from_server_with_invalid_flags();
-  test_too_many_trailing_metadata();
-  test_send_server_status_twice();
-  test_recv_close_on_server_with_invalid_flags();
-  test_recv_close_on_server_twice();
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/invalid_call_argument_test.cc b/test/core/end2end/invalid_call_argument_test.cc
new file mode 100644
index 0000000..c310a0e
--- /dev/null
+++ b/test/core/end2end/invalid_call_argument_test.cc
@@ -0,0 +1,615 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <limits.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static void* tag(intptr_t i) { return (void*)i; }
+
+struct test_state {
+  int is_client;
+  grpc_channel* chan;
+  grpc_call* call;
+  gpr_timespec deadline;
+  grpc_completion_queue* cq;
+  cq_verifier* cqv;
+  grpc_op ops[6];
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_status_code status;
+  grpc_slice details;
+  grpc_call* server_call;
+  grpc_server* server;
+  grpc_metadata_array server_initial_metadata_recv;
+  grpc_call_details call_details;
+};
+
+static struct test_state g_state;
+
+static void prepare_test(int is_client) {
+  int port = grpc_pick_unused_port_or_die();
+  char* server_hostport;
+  grpc_op* op;
+  g_state.is_client = is_client;
+  grpc_metadata_array_init(&g_state.initial_metadata_recv);
+  grpc_metadata_array_init(&g_state.trailing_metadata_recv);
+  g_state.deadline = grpc_timeout_seconds_to_deadline(5);
+  g_state.cq = grpc_completion_queue_create_for_next(NULL);
+  g_state.cqv = cq_verifier_create(g_state.cq);
+  g_state.details = grpc_empty_slice();
+  memset(g_state.ops, 0, sizeof(g_state.ops));
+
+  if (is_client) {
+    /* create a call, channel to a non existant server */
+    g_state.chan =
+        grpc_insecure_channel_create("nonexistant:54321", NULL, NULL);
+    grpc_slice host = grpc_slice_from_static_string("nonexistant");
+    g_state.call = grpc_channel_create_call(
+        g_state.chan, NULL, GRPC_PROPAGATE_DEFAULTS, g_state.cq,
+        grpc_slice_from_static_string("/Foo"), &host, g_state.deadline, NULL);
+  } else {
+    g_state.server = grpc_server_create(NULL, NULL);
+    grpc_server_register_completion_queue(g_state.server, g_state.cq, NULL);
+    gpr_join_host_port(&server_hostport, "0.0.0.0", port);
+    grpc_server_add_insecure_http2_port(g_state.server, server_hostport);
+    grpc_server_start(g_state.server);
+    gpr_free(server_hostport);
+    gpr_join_host_port(&server_hostport, "localhost", port);
+    g_state.chan = grpc_insecure_channel_create(server_hostport, NULL, NULL);
+    gpr_free(server_hostport);
+    grpc_slice host = grpc_slice_from_static_string("bar");
+    g_state.call = grpc_channel_create_call(
+        g_state.chan, NULL, GRPC_PROPAGATE_DEFAULTS, g_state.cq,
+        grpc_slice_from_static_string("/Foo"), &host, g_state.deadline, NULL);
+    grpc_metadata_array_init(&g_state.server_initial_metadata_recv);
+    grpc_call_details_init(&g_state.call_details);
+    op = g_state.ops;
+    op->op = GRPC_OP_SEND_INITIAL_METADATA;
+    op->data.send_initial_metadata.count = 0;
+    op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
+    op->reserved = NULL;
+    op++;
+    GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(g_state.call, g_state.ops,
+                                                     (size_t)(op - g_state.ops),
+                                                     tag(1), NULL));
+    GPR_ASSERT(GRPC_CALL_OK ==
+               grpc_server_request_call(g_state.server, &g_state.server_call,
+                                        &g_state.call_details,
+                                        &g_state.server_initial_metadata_recv,
+                                        g_state.cq, g_state.cq, tag(101)));
+    CQ_EXPECT_COMPLETION(g_state.cqv, tag(101), 1);
+    CQ_EXPECT_COMPLETION(g_state.cqv, tag(1), 1);
+    cq_verify(g_state.cqv);
+  }
+}
+
+static void cleanup_test() {
+  grpc_completion_queue* shutdown_cq;
+  grpc_call_unref(g_state.call);
+  cq_verifier_destroy(g_state.cqv);
+  grpc_channel_destroy(g_state.chan);
+  grpc_slice_unref(g_state.details);
+  grpc_metadata_array_destroy(&g_state.initial_metadata_recv);
+  grpc_metadata_array_destroy(&g_state.trailing_metadata_recv);
+
+  if (!g_state.is_client) {
+    shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+    grpc_call_unref(g_state.server_call);
+    grpc_server_shutdown_and_notify(g_state.server, shutdown_cq, tag(1000));
+    GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000),
+                                           grpc_timeout_seconds_to_deadline(5),
+                                           NULL)
+                   .type == GRPC_OP_COMPLETE);
+    grpc_completion_queue_destroy(shutdown_cq);
+    grpc_server_destroy(g_state.server);
+    grpc_call_details_destroy(&g_state.call_details);
+    grpc_metadata_array_destroy(&g_state.server_initial_metadata_recv);
+  }
+  grpc_completion_queue_shutdown(g_state.cq);
+  while (grpc_completion_queue_next(g_state.cq,
+                                    gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
+             .type != GRPC_QUEUE_SHUTDOWN)
+    ;
+  grpc_completion_queue_destroy(g_state.cq);
+}
+
+static void test_non_null_reserved_on_start_batch() {
+  gpr_log(GPR_INFO, "test_non_null_reserved_on_start_batch");
+
+  prepare_test(1);
+  GPR_ASSERT(GRPC_CALL_ERROR ==
+             grpc_call_start_batch(g_state.call, NULL, 0, NULL, tag(1)));
+  cleanup_test();
+}
+
+static void test_non_null_reserved_on_op() {
+  gpr_log(GPR_INFO, "test_non_null_reserved_on_op");
+
+  grpc_op* op;
+  prepare_test(1);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = tag(2);
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_send_initial_metadata_more_than_once() {
+  gpr_log(GPR_INFO, "test_send_initial_metadata_more_than_once");
+
+  grpc_op* op;
+  prepare_test(1);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(g_state.call, g_state.ops,
+                                                   (size_t)(op - g_state.ops),
+                                                   tag(1), NULL));
+  CQ_EXPECT_COMPLETION(g_state.cqv, tag(1), 0);
+  cq_verify(g_state.cqv);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_too_many_metadata() {
+  gpr_log(GPR_INFO, "test_too_many_metadata");
+
+  grpc_op* op;
+  prepare_test(1);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = (size_t)INT_MAX + 1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_send_null_message() {
+  gpr_log(GPR_INFO, "test_send_null_message");
+
+  grpc_op* op;
+  prepare_test(1);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_MESSAGE ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_send_messages_at_the_same_time() {
+  gpr_log(GPR_INFO, "test_send_messages_at_the_same_time");
+
+  grpc_op* op;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  prepare_test(1);
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = static_cast<grpc_byte_buffer*>(tag(2));
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  grpc_byte_buffer_destroy(request_payload);
+  cleanup_test();
+}
+
+static void test_send_server_status_from_client() {
+  gpr_log(GPR_INFO, "test_send_server_status_from_client");
+
+  grpc_op* op;
+  prepare_test(1);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_CLIENT ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_receive_initial_metadata_twice_at_client() {
+  gpr_log(GPR_INFO, "test_receive_initial_metadata_twice_at_client");
+
+  grpc_op* op;
+  prepare_test(1);
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &g_state.initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(g_state.call, g_state.ops,
+                                                   (size_t)(op - g_state.ops),
+                                                   tag(1), NULL));
+  CQ_EXPECT_COMPLETION(g_state.cqv, tag(1), 0);
+  cq_verify(g_state.cqv);
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &g_state.initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_receive_message_with_invalid_flags() {
+  gpr_log(GPR_INFO, "test_receive_message_with_invalid_flags");
+
+  grpc_op* op;
+  grpc_byte_buffer* payload = NULL;
+  prepare_test(1);
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &payload;
+  op->flags = 1;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_FLAGS ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_receive_two_messages_at_the_same_time() {
+  gpr_log(GPR_INFO, "test_receive_two_messages_at_the_same_time");
+
+  grpc_op* op;
+  grpc_byte_buffer* payload = NULL;
+  prepare_test(1);
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_recv_close_on_server_from_client() {
+  gpr_log(GPR_INFO, "test_recv_close_on_server_from_client");
+
+  grpc_op* op;
+  prepare_test(1);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_CLIENT ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_recv_status_on_client_twice() {
+  gpr_log(GPR_INFO, "test_recv_status_on_client_twice");
+
+  grpc_op* op;
+  prepare_test(1);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata =
+      &g_state.trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &g_state.status;
+  op->data.recv_status_on_client.status_details = &g_state.details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(g_state.call, g_state.ops,
+                                                   (size_t)(op - g_state.ops),
+                                                   tag(1), NULL));
+  CQ_EXPECT_COMPLETION(g_state.cqv, tag(1), 1);
+  cq_verify(g_state.cqv);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = NULL;
+  op->data.recv_status_on_client.status = NULL;
+  op->data.recv_status_on_client.status_details = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+static void test_send_close_from_client_on_server() {
+  gpr_log(GPR_INFO, "test_send_close_from_client_on_server");
+
+  grpc_op* op;
+  prepare_test(0);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_SERVER ==
+             grpc_call_start_batch(g_state.server_call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(2), NULL));
+  cleanup_test();
+}
+
+static void test_recv_status_on_client_from_server() {
+  gpr_log(GPR_INFO, "test_recv_status_on_client_from_server");
+
+  grpc_op* op;
+  prepare_test(0);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata =
+      &g_state.trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &g_state.status;
+  op->data.recv_status_on_client.status_details = &g_state.details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_NOT_ON_SERVER ==
+             grpc_call_start_batch(g_state.server_call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(2), NULL));
+  cleanup_test();
+}
+
+static void test_send_status_from_server_with_invalid_flags() {
+  gpr_log(GPR_INFO, "test_send_status_from_server_with_invalid_flags");
+
+  grpc_op* op;
+  prepare_test(0);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 1;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_FLAGS ==
+             grpc_call_start_batch(g_state.server_call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(2), NULL));
+  cleanup_test();
+}
+
+static void test_too_many_trailing_metadata() {
+  gpr_log(GPR_INFO, "test_too_many_trailing_metadata");
+
+  grpc_op* op;
+  prepare_test(0);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count =
+      (size_t)INT_MAX + 1;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA ==
+             grpc_call_start_batch(g_state.server_call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(2), NULL));
+  cleanup_test();
+}
+
+static void test_send_server_status_twice() {
+  gpr_log(GPR_INFO, "test_send_server_status_twice");
+
+  grpc_op* op;
+  prepare_test(0);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
+             grpc_call_start_batch(g_state.server_call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(2), NULL));
+  cleanup_test();
+}
+
+static void test_recv_close_on_server_with_invalid_flags() {
+  gpr_log(GPR_INFO, "test_recv_close_on_server_with_invalid_flags");
+
+  grpc_op* op;
+  prepare_test(0);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = NULL;
+  op->flags = 1;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_FLAGS ==
+             grpc_call_start_batch(g_state.server_call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(2), NULL));
+  cleanup_test();
+}
+
+static void test_recv_close_on_server_twice() {
+  gpr_log(GPR_INFO, "test_recv_close_on_server_twice");
+
+  grpc_op* op;
+  prepare_test(0);
+
+  op = g_state.ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_TOO_MANY_OPERATIONS ==
+             grpc_call_start_batch(g_state.server_call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(2), NULL));
+  cleanup_test();
+}
+
+static void test_invalid_initial_metadata_reserved_key() {
+  gpr_log(GPR_INFO, "test_invalid_initial_metadata_reserved_key");
+
+  grpc_metadata metadata;
+  metadata.key = grpc_slice_from_static_string(":start_with_colon");
+  metadata.value = grpc_slice_from_static_string("value");
+
+  grpc_op* op;
+  prepare_test(1);
+  op = g_state.ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 1;
+  op->data.send_initial_metadata.metadata = &metadata;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_ERROR_INVALID_METADATA ==
+             grpc_call_start_batch(g_state.call, g_state.ops,
+                                   (size_t)(op - g_state.ops), tag(1), NULL));
+  cleanup_test();
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_invalid_initial_metadata_reserved_key();
+  test_non_null_reserved_on_start_batch();
+  test_non_null_reserved_on_op();
+  test_send_initial_metadata_more_than_once();
+  test_too_many_metadata();
+  test_send_null_message();
+  test_send_messages_at_the_same_time();
+  test_send_server_status_from_client();
+  test_receive_initial_metadata_twice_at_client();
+  test_receive_message_with_invalid_flags();
+  test_receive_two_messages_at_the_same_time();
+  test_recv_close_on_server_from_client();
+  test_recv_status_on_client_twice();
+  test_send_close_from_client_on_server();
+  test_recv_status_on_client_from_server();
+  test_send_status_from_server_with_invalid_flags();
+  test_too_many_trailing_metadata();
+  test_send_server_status_twice();
+  test_recv_close_on_server_with_invalid_flags();
+  test_recv_close_on_server_twice();
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/multiple_server_queues_test.c b/test/core/end2end/multiple_server_queues_test.c
deleted file mode 100644
index f231c62..0000000
--- a/test/core/end2end/multiple_server_queues_test.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char **argv) {
-  grpc_completion_queue *cq1;
-  grpc_completion_queue *cq2;
-  grpc_completion_queue *cq3;
-  grpc_completion_queue_attributes attr;
-
-  grpc_server *server;
-
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  attr.version = 1;
-  attr.cq_completion_type = GRPC_CQ_NEXT;
-  attr.cq_polling_type = GRPC_CQ_DEFAULT_POLLING;
-  cq1 = grpc_completion_queue_create(
-      grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-
-  attr.cq_polling_type = GRPC_CQ_NON_LISTENING;
-  cq2 = grpc_completion_queue_create(
-      grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-
-  attr.cq_polling_type = GRPC_CQ_NON_POLLING;
-  cq3 = grpc_completion_queue_create(
-      grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-
-  server = grpc_server_create(NULL, NULL);
-  grpc_server_register_completion_queue(server, cq1, NULL);
-  grpc_server_add_insecure_http2_port(server, "[::]:0");
-  grpc_server_register_completion_queue(server, cq2, NULL);
-  grpc_server_register_completion_queue(server, cq3, NULL);
-
-  grpc_server_start(server);
-  grpc_server_shutdown_and_notify(server, cq2, NULL);
-  grpc_completion_queue_next(cq2, gpr_inf_future(GPR_CLOCK_REALTIME),
-                             NULL); /* cue queue hang */
-  grpc_completion_queue_shutdown(cq1);
-  grpc_completion_queue_shutdown(cq2);
-  grpc_completion_queue_shutdown(cq3);
-
-  grpc_completion_queue_next(cq1, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  grpc_completion_queue_next(cq2, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  grpc_completion_queue_next(cq3, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-
-  grpc_server_destroy(server);
-  grpc_completion_queue_destroy(cq1);
-  grpc_completion_queue_destroy(cq2);
-  grpc_completion_queue_destroy(cq3);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/end2end/multiple_server_queues_test.cc b/test/core/end2end/multiple_server_queues_test.cc
new file mode 100644
index 0000000..8036ca5
--- /dev/null
+++ b/test/core/end2end/multiple_server_queues_test.cc
@@ -0,0 +1,71 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include "test/core/util/test_config.h"
+
+int main(int argc, char** argv) {
+  grpc_completion_queue* cq1;
+  grpc_completion_queue* cq2;
+  grpc_completion_queue* cq3;
+  grpc_completion_queue_attributes attr;
+
+  grpc_server* server;
+
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  attr.version = 1;
+  attr.cq_completion_type = GRPC_CQ_NEXT;
+  attr.cq_polling_type = GRPC_CQ_DEFAULT_POLLING;
+  cq1 = grpc_completion_queue_create(
+      grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+
+  attr.cq_polling_type = GRPC_CQ_NON_LISTENING;
+  cq2 = grpc_completion_queue_create(
+      grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+
+  attr.cq_polling_type = GRPC_CQ_NON_POLLING;
+  cq3 = grpc_completion_queue_create(
+      grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+
+  server = grpc_server_create(NULL, NULL);
+  grpc_server_register_completion_queue(server, cq1, NULL);
+  grpc_server_add_insecure_http2_port(server, "[::]:0");
+  grpc_server_register_completion_queue(server, cq2, NULL);
+  grpc_server_register_completion_queue(server, cq3, NULL);
+
+  grpc_server_start(server);
+  grpc_server_shutdown_and_notify(server, cq2, NULL);
+  grpc_completion_queue_next(cq2, gpr_inf_future(GPR_CLOCK_REALTIME),
+                             NULL); /* cue queue hang */
+  grpc_completion_queue_shutdown(cq1);
+  grpc_completion_queue_shutdown(cq2);
+  grpc_completion_queue_shutdown(cq3);
+
+  grpc_completion_queue_next(cq1, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  grpc_completion_queue_next(cq2, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  grpc_completion_queue_next(cq3, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+
+  grpc_server_destroy(server);
+  grpc_completion_queue_destroy(cq1);
+  grpc_completion_queue_destroy(cq2);
+  grpc_completion_queue_destroy(cq3);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/end2end/no_server_test.c b/test/core/end2end/no_server_test.c
deleted file mode 100644
index 962499b..0000000
--- a/test/core/end2end/no_server_test.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/util/test_config.h"
-
-static void *tag(intptr_t i) { return (void *)i; }
-
-int main(int argc, char **argv) {
-  grpc_channel *chan;
-  grpc_call *call;
-  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(2);
-  grpc_completion_queue *cq;
-  cq_verifier *cqv;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_status_code status;
-  grpc_slice details;
-
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  grpc_metadata_array_init(&trailing_metadata_recv);
-
-  cq = grpc_completion_queue_create_for_next(NULL);
-  cqv = cq_verifier_create(cq);
-
-  /* create a call, channel to a non existant server */
-  chan = grpc_insecure_channel_create("nonexistant:54321", NULL, NULL);
-  grpc_slice host = grpc_slice_from_static_string("nonexistant");
-  call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-                                  grpc_slice_from_static_string("/Foo"), &host,
-                                  deadline, NULL);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(
-                                 call, ops, (size_t)(op - ops), tag(1), NULL));
-  /* verify that all tags get completed */
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED);
-
-  grpc_completion_queue_shutdown(cq);
-  while (
-      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
-          .type != GRPC_QUEUE_SHUTDOWN)
-    ;
-  grpc_completion_queue_destroy(cq);
-  grpc_call_unref(call);
-  grpc_channel_destroy(chan);
-  cq_verifier_destroy(cqv);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/end2end/no_server_test.cc b/test/core/end2end/no_server_test.cc
new file mode 100644
index 0000000..a69b7bc
--- /dev/null
+++ b/test/core/end2end/no_server_test.cc
@@ -0,0 +1,95 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/test_config.h"
+
+static void* tag(intptr_t i) { return (void*)i; }
+
+int main(int argc, char** argv) {
+  grpc_channel* chan;
+  grpc_call* call;
+  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(2);
+  grpc_completion_queue* cq;
+  cq_verifier* cqv;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_status_code status;
+  grpc_slice details;
+
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  grpc_metadata_array_init(&trailing_metadata_recv);
+
+  cq = grpc_completion_queue_create_for_next(NULL);
+  cqv = cq_verifier_create(cq);
+
+  /* create a call, channel to a non existant server */
+  chan = grpc_insecure_channel_create("nonexistant:54321", NULL, NULL);
+  grpc_slice host = grpc_slice_from_static_string("nonexistant");
+  call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+                                  grpc_slice_from_static_string("/Foo"), &host,
+                                  deadline, NULL);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(
+                                 call, ops, (size_t)(op - ops), tag(1), NULL));
+  /* verify that all tags get completed */
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED);
+
+  grpc_completion_queue_shutdown(cq);
+  while (
+      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
+          .type != GRPC_QUEUE_SHUTDOWN)
+    ;
+  grpc_completion_queue_destroy(cq);
+  grpc_call_unref(call);
+  grpc_channel_destroy(chan);
+  cq_verifier_destroy(cqv);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/end2end/tests/authority_not_supported.c b/test/core/end2end/tests/authority_not_supported.c
deleted file mode 100644
index b54d6d0..0000000
--- a/test/core/end2end/tests/authority_not_supported.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Request/response with metadata and payload.*/
-static void test_with_authority_header(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
-                              grpc_slice_from_static_string("val1"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}},
-                             {grpc_slice_from_static_string("key2"),
-                              grpc_slice_from_static_string("val2"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}}};
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_with_authority_header", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-
-  grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr");
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-                               grpc_slice_from_static_string("/foo"), &host,
-                               deadline, NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 2;
-  op->data.send_initial_metadata.metadata = meta_c;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_CANCELLED);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void authority_not_supported(grpc_end2end_test_config config) {
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) {
-    return;
-  }
-  test_with_authority_header(config);
-}
-
-void authority_not_supported_pre_init(void) {}
diff --git a/test/core/end2end/tests/authority_not_supported.cc b/test/core/end2end/tests/authority_not_supported.cc
new file mode 100644
index 0000000..62fb02a
--- /dev/null
+++ b/test/core/end2end/tests/authority_not_supported.cc
@@ -0,0 +1,188 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Request/response with metadata and payload.*/
+static void test_with_authority_header(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
+                              grpc_slice_from_static_string("val1"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}},
+                             {grpc_slice_from_static_string("key2"),
+                              grpc_slice_from_static_string("val2"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}}};
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_with_authority_header", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+
+  grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr");
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+                               grpc_slice_from_static_string("/foo"), &host,
+                               deadline, NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 2;
+  op->data.send_initial_metadata.metadata = meta_c;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_CANCELLED);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void authority_not_supported(grpc_end2end_test_config config) {
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) {
+    return;
+  }
+  test_with_authority_header(config);
+}
+
+void authority_not_supported_pre_init(void) {}
diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.c
deleted file mode 100644
index 32093f2..0000000
--- a/test/core/end2end/tests/bad_hostname.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_client(&f, client_args);
-  config.init_server(&f, server_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-
-  grpc_slice host = grpc_slice_from_static_string("slartibartfast.local");
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-                               grpc_slice_from_static_string("/foo"), &host,
-                               deadline, NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_INTERNAL);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_simple_request(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-
-  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
-  simple_request_body(f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void bad_hostname(grpc_end2end_test_config config) {
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_HOSTNAME_VERIFICATION) {
-    test_invoke_simple_request(config);
-  }
-}
-
-void bad_hostname_pre_init(void) {}
diff --git a/test/core/end2end/tests/bad_hostname.cc b/test/core/end2end/tests/bad_hostname.cc
new file mode 100644
index 0000000..c54cb8e
--- /dev/null
+++ b/test/core/end2end/tests/bad_hostname.cc
@@ -0,0 +1,171 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_client(&f, client_args);
+  config.init_server(&f, server_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+
+  grpc_slice host = grpc_slice_from_static_string("slartibartfast.local");
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+                               grpc_slice_from_static_string("/foo"), &host,
+                               deadline, NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_INTERNAL);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_simple_request(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+
+  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
+  simple_request_body(f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void bad_hostname(grpc_end2end_test_config config) {
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_HOSTNAME_VERIFICATION) {
+    test_invoke_simple_request(config);
+  }
+}
+
+void bad_hostname_pre_init(void) {}
diff --git a/test/core/end2end/tests/bad_ping.c b/test/core/end2end/tests/bad_ping.c
deleted file mode 100644
index 34cc8e7..0000000
--- a/test/core/end2end/tests/bad_ping.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "test/core/end2end/cq_verifier.h"
-
-#define MAX_PING_STRIKES 1
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5),
-                                    NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void test_bad_ping(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_arg client_a[] = {
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS,
-       .value.integer = 10},
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA,
-       .value.integer = 0},
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_HTTP2_BDP_PROBE,
-       .value.integer = 0}};
-  grpc_arg server_a[] = {
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS,
-       .value.integer = 300000 /* 5 minutes */},
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_HTTP2_MAX_PING_STRIKES,
-       .value.integer = MAX_PING_STRIKES},
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_HTTP2_BDP_PROBE,
-       .value.integer = 0}};
-  grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(client_a),
-                                   .args = client_a};
-  grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a),
-                                   .args = server_a};
-
-  config.init_client(&f, &client_args);
-  config.init_server(&f, &server_args);
-
-  grpc_call *c;
-  grpc_call *s;
-  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  // Send too many pings to the server to trigger the punishment:
-  // Each ping will trigger a ping strike, and we need at least MAX_PING_STRIKES
-  // strikes to trigger the punishment. So (MAX_PING_STRIKES + 1) pings are
-  // needed here.
-  int i;
-  for (i = 1; i <= MAX_PING_STRIKES + 1; i++) {
-    grpc_channel_ping(f.client, f.cq, tag(200 + i), NULL);
-    CQ_EXPECT_COMPLETION(cqv, tag(200 + i), 1);
-    if (i == MAX_PING_STRIKES + 1) {
-      CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-    }
-    cq_verify(cqv);
-  }
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
-  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
-  cq_verify(cqv);
-
-  grpc_call_unref(s);
-
-  // The connection should be closed immediately after the misbehaved pings,
-  // the in-progress RPC should fail.
-  GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_call_unref(c);
-  cq_verifier_destroy(cqv);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void bad_ping(grpc_end2end_test_config config) {
-  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
-  test_bad_ping(config);
-}
-
-void bad_ping_pre_init(void) {}
diff --git a/test/core/end2end/tests/bad_ping.cc b/test/core/end2end/tests/bad_ping.cc
new file mode 100644
index 0000000..6480615
--- /dev/null
+++ b/test/core/end2end/tests/bad_ping.cc
@@ -0,0 +1,227 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/end2end/cq_verifier.h"
+
+#define MAX_PING_STRIKES 1
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5),
+                                    NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void test_bad_ping(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_arg client_a[3];
+  client_a[0].type = GRPC_ARG_INTEGER;
+  client_a[0].key =
+      const_cast<char*>(GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS);
+  client_a[0].value.integer = 10;
+  client_a[1].type = GRPC_ARG_INTEGER;
+  client_a[1].key = const_cast<char*>(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA);
+  client_a[1].value.integer = 0;
+  client_a[2].type = GRPC_ARG_INTEGER;
+  client_a[2].key = const_cast<char*>(GRPC_ARG_HTTP2_BDP_PROBE);
+  client_a[2].value.integer = 0;
+  grpc_arg server_a[3];
+  server_a[0].type = GRPC_ARG_INTEGER;
+  server_a[0].key =
+      const_cast<char*>(GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS);
+  server_a[0].value.integer = 300000 /* 5 minutes */;
+  server_a[1].type = GRPC_ARG_INTEGER;
+  server_a[1].key = const_cast<char*>(GRPC_ARG_HTTP2_MAX_PING_STRIKES);
+  server_a[1].value.integer = MAX_PING_STRIKES;
+  server_a[2].type = GRPC_ARG_INTEGER;
+  server_a[2].key = const_cast<char*>(GRPC_ARG_HTTP2_BDP_PROBE);
+  server_a[2].value.integer = 0;
+  grpc_channel_args client_args = {GPR_ARRAY_SIZE(client_a), client_a};
+  grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a};
+
+  config.init_client(&f, &client_args);
+  config.init_server(&f, &server_args);
+
+  grpc_call* c;
+  grpc_call* s;
+  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  // Send too many pings to the server to trigger the punishment:
+  // Each ping will trigger a ping strike, and we need at least MAX_PING_STRIKES
+  // strikes to trigger the punishment. So (MAX_PING_STRIKES + 1) pings are
+  // needed here.
+  int i;
+  for (i = 1; i <= MAX_PING_STRIKES + 1; i++) {
+    grpc_channel_ping(f.client, f.cq, tag(200 + i), NULL);
+    CQ_EXPECT_COMPLETION(cqv, tag(200 + i), 1);
+    if (i == MAX_PING_STRIKES + 1) {
+      CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+    }
+    cq_verify(cqv);
+  }
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
+  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
+  cq_verify(cqv);
+
+  grpc_call_unref(s);
+
+  // The connection should be closed immediately after the misbehaved pings,
+  // the in-progress RPC should fail.
+  GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_call_unref(c);
+  cq_verifier_destroy(cqv);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void bad_ping(grpc_end2end_test_config config) {
+  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
+  test_bad_ping(config);
+}
+
+void bad_ping_pre_init(void) {}
diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.c
deleted file mode 100644
index e949dae..0000000
--- a/test/core/end2end/tests/binary_metadata.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Request/response with metadata and payload.*/
-static void test_request_response_with_metadata_and_payload(
-    grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  grpc_metadata meta_c[2] = {
-      {grpc_slice_from_static_string("key1-bin"),
-       grpc_slice_from_static_string(
-           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc"),
-       0,
-       {{NULL, NULL, NULL, NULL}}},
-      {grpc_slice_from_static_string("key2-bin"),
-       grpc_slice_from_static_string(
-           "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d"),
-       0,
-       {{NULL, NULL, NULL, NULL}}}};
-  grpc_metadata meta_s[2] = {
-      {grpc_slice_from_static_string("key3-bin"),
-       grpc_slice_from_static_string(
-           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee"),
-       0,
-       {{NULL, NULL, NULL, NULL}}},
-      {grpc_slice_from_static_string("key4-bin"),
-       grpc_slice_from_static_string(
-           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"),
-       0,
-       {{NULL, NULL, NULL, NULL}}}};
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_request_response_with_metadata_and_payload", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 2;
-  op->data.send_initial_metadata.metadata = meta_c;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 2;
-  op->data.send_initial_metadata.metadata = meta_s;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_string = grpc_slice_from_static_string(
-      "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12"
-      "\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24"
-      "\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36"
-      "\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48"
-      "\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a"
-      "\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c"
-      "\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e"
-      "\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
-      "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2"
-      "\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4"
-      "\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6"
-      "\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8"
-      "\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea"
-      "\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc"
-      "\xfd\xfe\xff");
-  op->data.send_status_from_server.status_details = &status_string;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(
-      0 ==
-      grpc_slice_str_cmp(
-          details,
-          "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
-          "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
-          "\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30"
-          "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40"
-          "\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50"
-          "\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60"
-          "\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70"
-          "\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80"
-          "\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
-          "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0"
-          "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0"
-          "\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0"
-          "\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0"
-          "\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
-          "\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0"
-          "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
-  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
-  GPR_ASSERT(contains_metadata(
-      &request_metadata_recv, "key1-bin",
-      "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc"));
-  GPR_ASSERT(contains_metadata(
-      &request_metadata_recv, "key2-bin",
-      "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d"));
-  GPR_ASSERT(contains_metadata(
-      &initial_metadata_recv, "key3-bin",
-      "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee"));
-  GPR_ASSERT(contains_metadata(
-      &initial_metadata_recv, "key4-bin",
-      "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void binary_metadata(grpc_end2end_test_config config) {
-  test_request_response_with_metadata_and_payload(config);
-}
-
-void binary_metadata_pre_init(void) {}
diff --git a/test/core/end2end/tests/binary_metadata.cc b/test/core/end2end/tests/binary_metadata.cc
new file mode 100644
index 0000000..52f0c70
--- /dev/null
+++ b/test/core/end2end/tests/binary_metadata.cc
@@ -0,0 +1,320 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Request/response with metadata and payload.*/
+static void test_request_response_with_metadata_and_payload(
+    grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  grpc_metadata meta_c[2] = {
+      {grpc_slice_from_static_string("key1-bin"),
+       grpc_slice_from_static_string(
+           "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc"),
+       0,
+       {{NULL, NULL, NULL, NULL}}},
+      {grpc_slice_from_static_string("key2-bin"),
+       grpc_slice_from_static_string(
+           "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d"),
+       0,
+       {{NULL, NULL, NULL, NULL}}}};
+  grpc_metadata meta_s[2] = {
+      {grpc_slice_from_static_string("key3-bin"),
+       grpc_slice_from_static_string(
+           "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee"),
+       0,
+       {{NULL, NULL, NULL, NULL}}},
+      {grpc_slice_from_static_string("key4-bin"),
+       grpc_slice_from_static_string(
+           "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"),
+       0,
+       {{NULL, NULL, NULL, NULL}}}};
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_request_response_with_metadata_and_payload", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 2;
+  op->data.send_initial_metadata.metadata = meta_c;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 2;
+  op->data.send_initial_metadata.metadata = meta_s;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_string = grpc_slice_from_static_string(
+      "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12"
+      "\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24"
+      "\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36"
+      "\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48"
+      "\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a"
+      "\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c"
+      "\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e"
+      "\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
+      "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2"
+      "\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4"
+      "\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6"
+      "\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8"
+      "\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea"
+      "\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc"
+      "\xfd\xfe\xff");
+  op->data.send_status_from_server.status_details = &status_string;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(
+      0 ==
+      grpc_slice_str_cmp(
+          details,
+          "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10"
+          "\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20"
+          "\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30"
+          "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40"
+          "\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50"
+          "\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60"
+          "\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70"
+          "\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80"
+          "\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90"
+          "\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0"
+          "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0"
+          "\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0"
+          "\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0"
+          "\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0"
+          "\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0"
+          "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
+  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
+  GPR_ASSERT(contains_metadata(
+      &request_metadata_recv, "key1-bin",
+      "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc"));
+  GPR_ASSERT(contains_metadata(
+      &request_metadata_recv, "key2-bin",
+      "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d"));
+  GPR_ASSERT(contains_metadata(
+      &initial_metadata_recv, "key3-bin",
+      "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee"));
+  GPR_ASSERT(contains_metadata(
+      &initial_metadata_recv, "key4-bin",
+      "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void binary_metadata(grpc_end2end_test_config config) {
+  test_request_response_with_metadata_and_payload(config);
+}
+
+void binary_metadata_pre_init(void) {}
diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c
deleted file mode 100644
index 600005c..0000000
--- a/test/core/end2end/tests/call_creds.c
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static const char iam_token[] = "token";
-static const char iam_selector[] = "selector";
-static const char overridden_iam_token[] = "overridden_token";
-static const char overridden_iam_selector[] = "overridden_selector";
-
-typedef enum { NONE, OVERRIDE, DESTROY } override_mode;
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            int fail_server_auth_check) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(NULL, NULL);
-  config.init_client(&f, NULL);
-  if (fail_server_auth_check) {
-    grpc_arg fail_auth_arg = {
-        GRPC_ARG_STRING, FAIL_AUTH_CHECK_SERVER_ARG_NAME, {NULL}};
-    grpc_channel_args args;
-    args.num_args = 1;
-    args.args = &fail_auth_arg;
-    config.init_server(&f, &args);
-  } else {
-    config.init_server(&f, NULL);
-  }
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void print_auth_context(int is_client, const grpc_auth_context *ctx) {
-  const grpc_auth_property *p;
-  grpc_auth_property_iterator it;
-  gpr_log(GPR_INFO, "%s peer:", is_client ? "client" : "server");
-  gpr_log(GPR_INFO, "\tauthenticated: %s",
-          grpc_auth_context_peer_is_authenticated(ctx) ? "YES" : "NO");
-  it = grpc_auth_context_peer_identity(ctx);
-  while ((p = grpc_auth_property_iterator_next(&it)) != NULL) {
-    gpr_log(GPR_INFO, "\t\t%s: %s", p->name, p->value);
-  }
-  gpr_log(GPR_INFO, "\tall properties:");
-  it = grpc_auth_context_property_iterator(ctx);
-  while ((p = grpc_auth_property_iterator_next(&it)) != NULL) {
-    gpr_log(GPR_INFO, "\t\t%s: %s", p->name, p->value);
-  }
-}
-
-static void request_response_with_payload_and_call_creds(
-    const char *test_name, grpc_end2end_test_config config,
-    override_mode mode) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  grpc_end2end_test_fixture f;
-  cq_verifier *cqv;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  grpc_call_credentials *creds = NULL;
-  grpc_auth_context *s_auth_context = NULL;
-  grpc_auth_context *c_auth_context = NULL;
-
-  f = begin_test(config, test_name, 0);
-  cqv = cq_verifier_create(f.cq);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-  creds = grpc_google_iam_credentials_create(iam_token, iam_selector, NULL);
-  GPR_ASSERT(creds != NULL);
-  GPR_ASSERT(grpc_call_set_credentials(c, creds) == GRPC_CALL_OK);
-  switch (mode) {
-    case NONE:
-      break;
-    case OVERRIDE:
-      grpc_call_credentials_release(creds);
-      creds = grpc_google_iam_credentials_create(overridden_iam_token,
-                                                 overridden_iam_selector, NULL);
-      GPR_ASSERT(creds != NULL);
-      GPR_ASSERT(grpc_call_set_credentials(c, creds) == GRPC_CALL_OK);
-      break;
-    case DESTROY:
-      GPR_ASSERT(grpc_call_set_credentials(c, NULL) == GRPC_CALL_OK);
-      break;
-  }
-  grpc_call_credentials_release(creds);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-  s_auth_context = grpc_call_auth_context(s);
-  GPR_ASSERT(s_auth_context != NULL);
-  print_auth_context(0, s_auth_context);
-  grpc_auth_context_release(s_auth_context);
-
-  c_auth_context = grpc_call_auth_context(c);
-  GPR_ASSERT(c_auth_context != NULL);
-  print_auth_context(1, c_auth_context);
-  grpc_auth_context_release(c_auth_context);
-
-  /* Cannot set creds on the server call object. */
-  GPR_ASSERT(grpc_call_set_credentials(s, NULL) != GRPC_CALL_OK);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
-  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
-
-  switch (mode) {
-    case NONE:
-      GPR_ASSERT(contains_metadata(&request_metadata_recv,
-                                   GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
-                                   iam_token));
-      GPR_ASSERT(contains_metadata(&request_metadata_recv,
-                                   GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
-                                   iam_selector));
-      break;
-    case OVERRIDE:
-      GPR_ASSERT(contains_metadata(&request_metadata_recv,
-                                   GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
-                                   overridden_iam_token));
-      GPR_ASSERT(contains_metadata(&request_metadata_recv,
-                                   GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
-                                   overridden_iam_selector));
-      break;
-    case DESTROY:
-      GPR_ASSERT(!contains_metadata(&request_metadata_recv,
-                                    GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
-                                    iam_token));
-      GPR_ASSERT(!contains_metadata(&request_metadata_recv,
-                                    GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
-                                    iam_selector));
-      GPR_ASSERT(!contains_metadata(&request_metadata_recv,
-                                    GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
-                                    overridden_iam_token));
-      GPR_ASSERT(!contains_metadata(&request_metadata_recv,
-                                    GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
-                                    overridden_iam_selector));
-      break;
-  }
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_request_response_with_payload_and_call_creds(
-    grpc_end2end_test_config config) {
-  request_response_with_payload_and_call_creds(
-      "test_request_response_with_payload_and_call_creds", config, NONE);
-}
-
-static void test_request_response_with_payload_and_overridden_call_creds(
-    grpc_end2end_test_config config) {
-  request_response_with_payload_and_call_creds(
-      "test_request_response_with_payload_and_overridden_call_creds", config,
-      OVERRIDE);
-}
-
-static void test_request_response_with_payload_and_deleted_call_creds(
-    grpc_end2end_test_config config) {
-  request_response_with_payload_and_call_creds(
-      "test_request_response_with_payload_and_deleted_call_creds", config,
-      DESTROY);
-}
-
-static void test_request_with_server_rejecting_client_creds(
-    grpc_end2end_test_config config) {
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_call *c;
-  grpc_end2end_test_fixture f;
-  gpr_timespec deadline = five_seconds_from_now();
-  cq_verifier *cqv;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_call_credentials *creds;
-
-  f = begin_test(config, "test_request_with_server_rejecting_client_creds", 1);
-  cqv = cq_verifier_create(f.cq);
-
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  creds = grpc_google_iam_credentials_create(iam_token, iam_selector, NULL);
-  GPR_ASSERT(creds != NULL);
-  GPR_ASSERT(grpc_call_set_credentials(c, creds) == GRPC_CALL_OK);
-  grpc_call_credentials_release(creds);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(error == GRPC_CALL_OK);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNAUTHENTICATED);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  grpc_slice_unref(details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void call_creds(grpc_end2end_test_config config) {
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS) {
-    test_request_response_with_payload_and_call_creds(config);
-    test_request_response_with_payload_and_overridden_call_creds(config);
-    test_request_response_with_payload_and_deleted_call_creds(config);
-    test_request_with_server_rejecting_client_creds(config);
-  }
-}
-
-void call_creds_pre_init(void) {}
diff --git a/test/core/end2end/tests/call_creds.cc b/test/core/end2end/tests/call_creds.cc
new file mode 100644
index 0000000..fc550b7
--- /dev/null
+++ b/test/core/end2end/tests/call_creds.cc
@@ -0,0 +1,479 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static const char iam_token[] = "token";
+static const char iam_selector[] = "selector";
+static const char overridden_iam_token[] = "overridden_token";
+static const char overridden_iam_selector[] = "overridden_selector";
+
+typedef enum { NONE, OVERRIDE, DESTROY } override_mode;
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            int fail_server_auth_check) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(NULL, NULL);
+  config.init_client(&f, NULL);
+  if (fail_server_auth_check) {
+    grpc_arg fail_auth_arg = {
+        GRPC_ARG_STRING,
+        const_cast<char*>(FAIL_AUTH_CHECK_SERVER_ARG_NAME),
+        {NULL}};
+    grpc_channel_args args;
+    args.num_args = 1;
+    args.args = &fail_auth_arg;
+    config.init_server(&f, &args);
+  } else {
+    config.init_server(&f, NULL);
+  }
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void print_auth_context(int is_client, const grpc_auth_context* ctx) {
+  const grpc_auth_property* p;
+  grpc_auth_property_iterator it;
+  gpr_log(GPR_INFO, "%s peer:", is_client ? "client" : "server");
+  gpr_log(GPR_INFO, "\tauthenticated: %s",
+          grpc_auth_context_peer_is_authenticated(ctx) ? "YES" : "NO");
+  it = grpc_auth_context_peer_identity(ctx);
+  while ((p = grpc_auth_property_iterator_next(&it)) != NULL) {
+    gpr_log(GPR_INFO, "\t\t%s: %s", p->name, p->value);
+  }
+  gpr_log(GPR_INFO, "\tall properties:");
+  it = grpc_auth_context_property_iterator(ctx);
+  while ((p = grpc_auth_property_iterator_next(&it)) != NULL) {
+    gpr_log(GPR_INFO, "\t\t%s: %s", p->name, p->value);
+  }
+}
+
+static void request_response_with_payload_and_call_creds(
+    const char* test_name, grpc_end2end_test_config config,
+    override_mode mode) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  grpc_end2end_test_fixture f;
+  cq_verifier* cqv;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  grpc_call_credentials* creds = NULL;
+  grpc_auth_context* s_auth_context = NULL;
+  grpc_auth_context* c_auth_context = NULL;
+
+  f = begin_test(config, test_name, 0);
+  cqv = cq_verifier_create(f.cq);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+  creds = grpc_google_iam_credentials_create(iam_token, iam_selector, NULL);
+  GPR_ASSERT(creds != NULL);
+  GPR_ASSERT(grpc_call_set_credentials(c, creds) == GRPC_CALL_OK);
+  switch (mode) {
+    case NONE:
+      break;
+    case OVERRIDE:
+      grpc_call_credentials_release(creds);
+      creds = grpc_google_iam_credentials_create(overridden_iam_token,
+                                                 overridden_iam_selector, NULL);
+      GPR_ASSERT(creds != NULL);
+      GPR_ASSERT(grpc_call_set_credentials(c, creds) == GRPC_CALL_OK);
+      break;
+    case DESTROY:
+      GPR_ASSERT(grpc_call_set_credentials(c, NULL) == GRPC_CALL_OK);
+      break;
+  }
+  grpc_call_credentials_release(creds);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+  s_auth_context = grpc_call_auth_context(s);
+  GPR_ASSERT(s_auth_context != NULL);
+  print_auth_context(0, s_auth_context);
+  grpc_auth_context_release(s_auth_context);
+
+  c_auth_context = grpc_call_auth_context(c);
+  GPR_ASSERT(c_auth_context != NULL);
+  print_auth_context(1, c_auth_context);
+  grpc_auth_context_release(c_auth_context);
+
+  /* Cannot set creds on the server call object. */
+  GPR_ASSERT(grpc_call_set_credentials(s, NULL) != GRPC_CALL_OK);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
+  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
+
+  switch (mode) {
+    case NONE:
+      GPR_ASSERT(contains_metadata(&request_metadata_recv,
+                                   GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
+                                   iam_token));
+      GPR_ASSERT(contains_metadata(&request_metadata_recv,
+                                   GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
+                                   iam_selector));
+      break;
+    case OVERRIDE:
+      GPR_ASSERT(contains_metadata(&request_metadata_recv,
+                                   GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
+                                   overridden_iam_token));
+      GPR_ASSERT(contains_metadata(&request_metadata_recv,
+                                   GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
+                                   overridden_iam_selector));
+      break;
+    case DESTROY:
+      GPR_ASSERT(!contains_metadata(&request_metadata_recv,
+                                    GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
+                                    iam_token));
+      GPR_ASSERT(!contains_metadata(&request_metadata_recv,
+                                    GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
+                                    iam_selector));
+      GPR_ASSERT(!contains_metadata(&request_metadata_recv,
+                                    GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
+                                    overridden_iam_token));
+      GPR_ASSERT(!contains_metadata(&request_metadata_recv,
+                                    GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
+                                    overridden_iam_selector));
+      break;
+  }
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_request_response_with_payload_and_call_creds(
+    grpc_end2end_test_config config) {
+  request_response_with_payload_and_call_creds(
+      "test_request_response_with_payload_and_call_creds", config, NONE);
+}
+
+static void test_request_response_with_payload_and_overridden_call_creds(
+    grpc_end2end_test_config config) {
+  request_response_with_payload_and_call_creds(
+      "test_request_response_with_payload_and_overridden_call_creds", config,
+      OVERRIDE);
+}
+
+static void test_request_response_with_payload_and_deleted_call_creds(
+    grpc_end2end_test_config config) {
+  request_response_with_payload_and_call_creds(
+      "test_request_response_with_payload_and_deleted_call_creds", config,
+      DESTROY);
+}
+
+static void test_request_with_server_rejecting_client_creds(
+    grpc_end2end_test_config config) {
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_call* c;
+  grpc_end2end_test_fixture f;
+  gpr_timespec deadline = five_seconds_from_now();
+  cq_verifier* cqv;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_call_credentials* creds;
+
+  f = begin_test(config, "test_request_with_server_rejecting_client_creds", 1);
+  cqv = cq_verifier_create(f.cq);
+
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  creds = grpc_google_iam_credentials_create(iam_token, iam_selector, NULL);
+  GPR_ASSERT(creds != NULL);
+  GPR_ASSERT(grpc_call_set_credentials(c, creds) == GRPC_CALL_OK);
+  grpc_call_credentials_release(creds);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(error == GRPC_CALL_OK);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNAUTHENTICATED);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  grpc_slice_unref(details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void call_creds(grpc_end2end_test_config config) {
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS) {
+    test_request_response_with_payload_and_call_creds(config);
+    test_request_response_with_payload_and_overridden_call_creds(config);
+    test_request_response_with_payload_and_deleted_call_creds(config);
+    test_request_with_server_rejecting_client_creds(config);
+  }
+}
+
+void call_creds_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c
deleted file mode 100644
index c3ac0c3..0000000
--- a/test/core/end2end/tests/cancel_after_accept.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/service_config.h"
-
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/end2end/tests/cancel_test_helpers.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            cancellation_mode mode,
-                                            bool use_service_config,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s/%s/%s", test_name, config.name,
-          mode.name, use_service_config ? "service_config" : "client_api");
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Cancel after accept, no payload */
-static void test_cancel_after_accept(grpc_end2end_test_config config,
-                                     cancellation_mode mode,
-                                     bool use_service_config) {
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_call *c;
-  grpc_call *s;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  int was_cancelled = 2;
-
-  grpc_channel_args *args = NULL;
-  if (use_service_config) {
-    grpc_arg arg;
-    arg.type = GRPC_ARG_STRING;
-    arg.key = GRPC_ARG_SERVICE_CONFIG;
-    arg.value.string =
-        "{\n"
-        "  \"methodConfig\": [ {\n"
-        "    \"name\": [\n"
-        "      { \"service\": \"service\", \"method\": \"method\" }\n"
-        "    ],\n"
-        "    \"timeout\": \"5s\"\n"
-        "  } ]\n"
-        "}";
-    args = grpc_channel_args_copy_and_add(args, &arg, 1);
-  }
-
-  grpc_end2end_test_fixture f = begin_test(config, "cancel_after_accept", mode,
-                                           use_service_config, args, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-
-  gpr_timespec deadline = use_service_config
-                              ? gpr_inf_future(GPR_CLOCK_MONOTONIC)
-                              : five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/service/method"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error = grpc_server_request_call(f.server, &s, &call_details,
-                                   &request_metadata_recv, f.cq, f.cq, tag(2));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(3), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
-
-  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == mode.expect_status || status == GRPC_STATUS_INTERNAL);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  grpc_slice_unref(details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  if (args != NULL) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  cq_verifier_destroy(cqv);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void cancel_after_accept(grpc_end2end_test_config config) {
-  unsigned i;
-
-  for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
-    test_cancel_after_accept(config, cancellation_modes[i],
-                             false /* use_service_config */);
-    if (config.feature_mask & FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL &&
-        cancellation_modes[i].expect_status == GRPC_STATUS_DEADLINE_EXCEEDED) {
-      test_cancel_after_accept(config, cancellation_modes[i],
-                               true /* use_service_config */);
-    }
-  }
-}
-
-void cancel_after_accept_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_after_accept.cc b/test/core/end2end/tests/cancel_after_accept.cc
new file mode 100644
index 0000000..e2ad5bd
--- /dev/null
+++ b/test/core/end2end/tests/cancel_after_accept.cc
@@ -0,0 +1,272 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/metadata.h"
+#include "src/core/lib/transport/service_config.h"
+
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/end2end/tests/cancel_test_helpers.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            cancellation_mode mode,
+                                            bool use_service_config,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s/%s/%s", test_name, config.name,
+          mode.name, use_service_config ? "service_config" : "client_api");
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Cancel after accept, no payload */
+static void test_cancel_after_accept(grpc_end2end_test_config config,
+                                     cancellation_mode mode,
+                                     bool use_service_config) {
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_call* c;
+  grpc_call* s;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  int was_cancelled = 2;
+
+  grpc_channel_args* args = NULL;
+  if (use_service_config) {
+    grpc_arg arg;
+    arg.type = GRPC_ARG_STRING;
+    arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG);
+    arg.value.string = const_cast<char*>(
+        "{\n"
+        "  \"methodConfig\": [ {\n"
+        "    \"name\": [\n"
+        "      { \"service\": \"service\", \"method\": \"method\" },\n"
+        "      { \"service\": \"unused\" }\n"
+        "    ],\n"
+        "    \"timeout\": \"5s\"\n"
+        "  } ]\n"
+        "}");
+    args = grpc_channel_args_copy_and_add(args, &arg, 1);
+  }
+
+  grpc_end2end_test_fixture f = begin_test(config, "cancel_after_accept", mode,
+                                           use_service_config, args, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+
+  gpr_timespec deadline = use_service_config
+                              ? gpr_inf_future(GPR_CLOCK_MONOTONIC)
+                              : five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/service/method"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error = grpc_server_request_call(f.server, &s, &call_details,
+                                   &request_metadata_recv, f.cq, f.cq, tag(2));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(3), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
+
+  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == mode.expect_status || status == GRPC_STATUS_INTERNAL);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  grpc_slice_unref(details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  if (args != NULL) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  cq_verifier_destroy(cqv);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void cancel_after_accept(grpc_end2end_test_config config) {
+  unsigned i;
+
+  for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
+    test_cancel_after_accept(config, cancellation_modes[i],
+                             false /* use_service_config */);
+    if (config.feature_mask & FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL &&
+        cancellation_modes[i].expect_status == GRPC_STATUS_DEADLINE_EXCEEDED) {
+      test_cancel_after_accept(config, cancellation_modes[i],
+                               true /* use_service_config */);
+    }
+  }
+}
+
+void cancel_after_accept_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.c
deleted file mode 100644
index 0e2a751..0000000
--- a/test/core/end2end/tests/cancel_after_client_done.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/end2end/tests/cancel_test_helpers.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            cancellation_mode mode,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s/%s", test_name, config.name,
-          mode.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Cancel after accept with a writes closed, no payload */
-static void test_cancel_after_accept_and_writes_closed(
-    grpc_end2end_test_config config, cancellation_mode mode) {
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_call *c;
-  grpc_call *s;
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_cancel_after_accept_and_writes_closed", mode, NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error = grpc_server_request_call(f.server, &s, &call_details,
-                                   &request_metadata_recv, f.cq, f.cq, tag(2));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(3), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
-
-  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == mode.expect_status || status == GRPC_STATUS_INTERNAL);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  grpc_slice_unref(details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void cancel_after_client_done(grpc_end2end_test_config config) {
-  unsigned i;
-
-  for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
-    test_cancel_after_accept_and_writes_closed(config, cancellation_modes[i]);
-  }
-}
-
-void cancel_after_client_done_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_after_client_done.cc b/test/core/end2end/tests/cancel_after_client_done.cc
new file mode 100644
index 0000000..90db7f5
--- /dev/null
+++ b/test/core/end2end/tests/cancel_after_client_done.cc
@@ -0,0 +1,235 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/end2end/tests/cancel_test_helpers.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            cancellation_mode mode,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s/%s", test_name, config.name,
+          mode.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Cancel after accept with a writes closed, no payload */
+static void test_cancel_after_accept_and_writes_closed(
+    grpc_end2end_test_config config, cancellation_mode mode) {
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_call* c;
+  grpc_call* s;
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_cancel_after_accept_and_writes_closed", mode, NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error = grpc_server_request_call(f.server, &s, &call_details,
+                                   &request_metadata_recv, f.cq, f.cq, tag(2));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(3), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
+
+  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == mode.expect_status || status == GRPC_STATUS_INTERNAL);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  grpc_slice_unref(details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void cancel_after_client_done(grpc_end2end_test_config config) {
+  unsigned i;
+
+  for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
+    test_cancel_after_accept_and_writes_closed(config, cancellation_modes[i]);
+  }
+}
+
+void cancel_after_client_done_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c
deleted file mode 100644
index aad9fdb..0000000
--- a/test/core/end2end/tests/cancel_after_invoke.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/end2end/tests/cancel_test_helpers.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            cancellation_mode mode,
-                                            size_t test_ops,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s/%s [%" PRIdPTR " ops]", test_name,
-          config.name, mode.name, test_ops);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
-  grpc_event ev = grpc_completion_queue_next(
-      f->cq, grpc_timeout_seconds_to_deadline(5), NULL);
-  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  GPR_ASSERT(ev.tag == tag(1000));
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Cancel after invoke, no payload */
-static void test_cancel_after_invoke(grpc_end2end_test_config config,
-                                     cancellation_mode mode, size_t test_ops) {
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_call *c;
-  grpc_end2end_test_fixture f = begin_test(config, "test_cancel_after_invoke",
-                                           mode, test_ops, NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, test_ops, tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == mode.expect_status || status == GRPC_STATUS_INTERNAL);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  grpc_slice_unref(details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void cancel_after_invoke(grpc_end2end_test_config config) {
-  unsigned i, j;
-
-  for (j = 3; j < 6; j++) {
-    for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
-      test_cancel_after_invoke(config, cancellation_modes[i], j);
-    }
-  }
-}
-
-void cancel_after_invoke_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_after_invoke.cc b/test/core/end2end/tests/cancel_after_invoke.cc
new file mode 100644
index 0000000..7f0c4e7
--- /dev/null
+++ b/test/core/end2end/tests/cancel_after_invoke.cc
@@ -0,0 +1,195 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/end2end/tests/cancel_test_helpers.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            cancellation_mode mode,
+                                            size_t test_ops,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s/%s [%" PRIdPTR " ops]", test_name,
+          config.name, mode.name, test_ops);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+  grpc_event ev = grpc_completion_queue_next(
+      f->cq, grpc_timeout_seconds_to_deadline(5), NULL);
+  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  GPR_ASSERT(ev.tag == tag(1000));
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Cancel after invoke, no payload */
+static void test_cancel_after_invoke(grpc_end2end_test_config config,
+                                     cancellation_mode mode, size_t test_ops) {
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_call* c;
+  grpc_end2end_test_fixture f = begin_test(config, "test_cancel_after_invoke",
+                                           mode, test_ops, NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, test_ops, tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == mode.expect_status || status == GRPC_STATUS_INTERNAL);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  grpc_slice_unref(details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void cancel_after_invoke(grpc_end2end_test_config config) {
+  unsigned i, j;
+
+  for (j = 3; j < 6; j++) {
+    for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
+      test_cancel_after_invoke(config, cancellation_modes[i], j);
+    }
+  }
+}
+
+void cancel_after_invoke_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_after_round_trip.c b/test/core/end2end/tests/cancel_after_round_trip.c
deleted file mode 100644
index bc41bd3..0000000
--- a/test/core/end2end/tests/cancel_after_round_trip.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/service_config.h"
-
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/end2end/tests/cancel_test_helpers.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            cancellation_mode mode,
-                                            bool use_service_config,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s/%s/%s", test_name, config.name,
-          mode.name, use_service_config ? "service_config" : "client_api");
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Cancel after accept, no payload */
-static void test_cancel_after_round_trip(grpc_end2end_test_config config,
-                                         cancellation_mode mode,
-                                         bool use_service_config) {
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_call *c;
-  grpc_call *s;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload1 =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  grpc_byte_buffer *response_payload2 =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  int was_cancelled = 2;
-
-  grpc_channel_args *args = NULL;
-  if (use_service_config) {
-    grpc_arg arg;
-    arg.type = GRPC_ARG_STRING;
-    arg.key = GRPC_ARG_SERVICE_CONFIG;
-    arg.value.string =
-        "{\n"
-        "  \"methodConfig\": [ {\n"
-        "    \"name\": [\n"
-        "      { \"service\": \"service\", \"method\": \"method\" }\n"
-        "    ],\n"
-        "    \"timeout\": \"5s\"\n"
-        "  } ]\n"
-        "}";
-    args = grpc_channel_args_copy_and_add(args, &arg, 1);
-  }
-
-  grpc_end2end_test_fixture f = begin_test(
-      config, "cancel_after_round_trip", mode, use_service_config, args, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-
-  gpr_timespec deadline = use_service_config
-                              ? gpr_inf_future(GPR_CLOCK_MONOTONIC)
-                              : five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/service/method"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  request_payload_recv = NULL;
-  response_payload_recv = NULL;
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload2;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == mode.expect_status || status == GRPC_STATUS_INTERNAL);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload1);
-  grpc_byte_buffer_destroy(response_payload2);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  grpc_slice_unref(details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  if (args != NULL) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  cq_verifier_destroy(cqv);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void cancel_after_round_trip(grpc_end2end_test_config config) {
-  unsigned i;
-
-  for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
-    test_cancel_after_round_trip(config, cancellation_modes[i],
-                                 false /* use_service_config */);
-    if (config.feature_mask & FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL &&
-        cancellation_modes[i].expect_status == GRPC_STATUS_DEADLINE_EXCEEDED) {
-      test_cancel_after_round_trip(config, cancellation_modes[i],
-                                   true /* use_service_config */);
-    }
-  }
-}
-
-void cancel_after_round_trip_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_after_round_trip.cc b/test/core/end2end/tests/cancel_after_round_trip.cc
new file mode 100644
index 0000000..35b5214
--- /dev/null
+++ b/test/core/end2end/tests/cancel_after_round_trip.cc
@@ -0,0 +1,304 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/metadata.h"
+#include "src/core/lib/transport/service_config.h"
+
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/end2end/tests/cancel_test_helpers.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            cancellation_mode mode,
+                                            bool use_service_config,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s/%s/%s", test_name, config.name,
+          mode.name, use_service_config ? "service_config" : "client_api");
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Cancel after accept, no payload */
+static void test_cancel_after_round_trip(grpc_end2end_test_config config,
+                                         cancellation_mode mode,
+                                         bool use_service_config) {
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_call* c;
+  grpc_call* s;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload1 =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  grpc_byte_buffer* response_payload2 =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  int was_cancelled = 2;
+
+  grpc_channel_args* args = NULL;
+  if (use_service_config) {
+    grpc_arg arg;
+    arg.type = GRPC_ARG_STRING;
+    arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG);
+    arg.value.string = const_cast<char*>(
+        "{\n"
+        "  \"methodConfig\": [ {\n"
+        "    \"name\": [\n"
+        "      { \"service\": \"service\", \"method\": \"method\" }\n"
+        "    ],\n"
+        "    \"timeout\": \"5s\"\n"
+        "  } ]\n"
+        "}");
+    args = grpc_channel_args_copy_and_add(args, &arg, 1);
+  }
+
+  grpc_end2end_test_fixture f = begin_test(
+      config, "cancel_after_round_trip", mode, use_service_config, args, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+
+  gpr_timespec deadline = use_service_config
+                              ? gpr_inf_future(GPR_CLOCK_MONOTONIC)
+                              : five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/service/method"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  request_payload_recv = NULL;
+  response_payload_recv = NULL;
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload2;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == mode.expect_status || status == GRPC_STATUS_INTERNAL);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload1);
+  grpc_byte_buffer_destroy(response_payload2);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  grpc_slice_unref(details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  if (args != NULL) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  cq_verifier_destroy(cqv);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void cancel_after_round_trip(grpc_end2end_test_config config) {
+  unsigned i;
+
+  for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
+    test_cancel_after_round_trip(config, cancellation_modes[i],
+                                 false /* use_service_config */);
+    if (config.feature_mask & FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL &&
+        cancellation_modes[i].expect_status == GRPC_STATUS_DEADLINE_EXCEEDED) {
+      test_cancel_after_round_trip(config, cancellation_modes[i],
+                                   true /* use_service_config */);
+    }
+  }
+}
+
+void cancel_after_round_trip_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c
deleted file mode 100644
index 397e8b8..0000000
--- a/test/core/end2end/tests/cancel_before_invoke.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            size_t num_ops,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s [%" PRIdPTR " ops]", test_name,
-          config.name, num_ops);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Cancel before invoke */
-static void test_cancel_before_invoke(grpc_end2end_test_config config,
-                                      size_t test_ops) {
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_call *c;
-  grpc_end2end_test_fixture f =
-      begin_test(config, "cancel_before_invoke", test_ops, NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c, NULL));
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, test_ops, tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_CANCELLED);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  grpc_slice_unref(details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void cancel_before_invoke(grpc_end2end_test_config config) {
-  size_t i;
-  for (i = 1; i <= 6; i++) {
-    test_cancel_before_invoke(config, i);
-  }
-}
-
-void cancel_before_invoke_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_before_invoke.cc b/test/core/end2end/tests/cancel_before_invoke.cc
new file mode 100644
index 0000000..9504aae
--- /dev/null
+++ b/test/core/end2end/tests/cancel_before_invoke.cc
@@ -0,0 +1,190 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            size_t num_ops,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s [%" PRIdPTR " ops]", test_name,
+          config.name, num_ops);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Cancel before invoke */
+static void test_cancel_before_invoke(grpc_end2end_test_config config,
+                                      size_t test_ops) {
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_call* c;
+  grpc_end2end_test_fixture f =
+      begin_test(config, "cancel_before_invoke", test_ops, NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c, NULL));
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, test_ops, tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_CANCELLED);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  grpc_slice_unref(details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void cancel_before_invoke(grpc_end2end_test_config config) {
+  size_t i;
+  for (i = 1; i <= 6; i++) {
+    test_cancel_before_invoke(config, i);
+  }
+}
+
+void cancel_before_invoke_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c
deleted file mode 100644
index cd9551b..0000000
--- a/test/core/end2end/tests/cancel_in_a_vacuum.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/end2end/tests/cancel_test_helpers.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            cancellation_mode mode,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s/%s", test_name, config.name,
-          mode.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Cancel and do nothing */
-static void test_cancel_in_a_vacuum(grpc_end2end_test_config config,
-                                    cancellation_mode mode) {
-  grpc_call *c;
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_cancel_in_a_vacuum", mode, NULL, NULL);
-  cq_verifier *v_client = cq_verifier_create(f.cq);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(v_client);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void cancel_in_a_vacuum(grpc_end2end_test_config config) {
-  unsigned i;
-
-  for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
-    test_cancel_in_a_vacuum(config, cancellation_modes[i]);
-  }
-}
-
-void cancel_in_a_vacuum_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.cc b/test/core/end2end/tests/cancel_in_a_vacuum.cc
new file mode 100644
index 0000000..090ee2f
--- /dev/null
+++ b/test/core/end2end/tests/cancel_in_a_vacuum.cc
@@ -0,0 +1,123 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/end2end/tests/cancel_test_helpers.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            cancellation_mode mode,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s/%s", test_name, config.name,
+          mode.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Cancel and do nothing */
+static void test_cancel_in_a_vacuum(grpc_end2end_test_config config,
+                                    cancellation_mode mode) {
+  grpc_call* c;
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_cancel_in_a_vacuum", mode, NULL, NULL);
+  cq_verifier* v_client = cq_verifier_create(f.cq);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c, NULL));
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(v_client);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void cancel_in_a_vacuum(grpc_end2end_test_config config) {
+  unsigned i;
+
+  for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
+    test_cancel_in_a_vacuum(config, cancellation_modes[i]);
+  }
+}
+
+void cancel_in_a_vacuum_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_test_helpers.h b/test/core/end2end/tests/cancel_test_helpers.h
index d85616b..477d199 100644
--- a/test/core/end2end/tests/cancel_test_helpers.h
+++ b/test/core/end2end/tests/cancel_test_helpers.h
@@ -20,13 +20,13 @@
 #define GRPC_TEST_CORE_END2END_TESTS_CANCEL_TEST_HELPERS_H
 
 typedef struct {
-  const char *name;
-  grpc_call_error (*initiate_cancel)(grpc_call *call, void *reserved);
+  const char* name;
+  grpc_call_error (*initiate_cancel)(grpc_call* call, void* reserved);
   grpc_status_code expect_status;
-  const char *expect_details;
+  const char* expect_details;
 } cancellation_mode;
 
-static grpc_call_error wait_for_deadline(grpc_call *call, void *reserved) {
+static grpc_call_error wait_for_deadline(grpc_call* call, void* reserved) {
   (void)reserved;
   return GRPC_CALL_OK;
 }
diff --git a/test/core/end2end/tests/cancel_with_status.c b/test/core/end2end/tests/cancel_with_status.c
deleted file mode 100644
index ab8c4f4..0000000
--- a/test/core/end2end/tests/cancel_with_status.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            size_t num_ops,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s [%" PRIdPTR " ops]", test_name,
-          config.name, num_ops);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
-  grpc_event ev = grpc_completion_queue_next(
-      f->cq, grpc_timeout_seconds_to_deadline(5), NULL);
-  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  GPR_ASSERT(ev.tag == tag(1000));
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f, size_t num_ops) {
-  grpc_call *c;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-
-  gpr_log(GPR_DEBUG, "test with %" PRIuPTR " ops", num_ops);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(num_ops <= (size_t)(op - ops));
-  error = grpc_call_start_batch(c, ops, num_ops, tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  char *dynamic_string = gpr_strdup("xyz");
-  grpc_call_cancel_with_status(c, GRPC_STATUS_UNIMPLEMENTED,
-                               (const char *)dynamic_string, NULL);
-  // The API of \a description allows for it to be a dynamic/non-const
-  // string, test this guarantee.
-  gpr_free(dynamic_string);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_simple_request(grpc_end2end_test_config config,
-                                       size_t num_ops) {
-  grpc_end2end_test_fixture f;
-
-  f = begin_test(config, "test_invoke_simple_request", num_ops, NULL, NULL);
-  simple_request_body(config, f, num_ops);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void cancel_with_status(grpc_end2end_test_config config) {
-  size_t i;
-  for (i = 1; i <= 4; i++) {
-    test_invoke_simple_request(config, i);
-  }
-}
-
-void cancel_with_status_pre_init(void) {}
diff --git a/test/core/end2end/tests/cancel_with_status.cc b/test/core/end2end/tests/cancel_with_status.cc
new file mode 100644
index 0000000..bc3c4c3
--- /dev/null
+++ b/test/core/end2end/tests/cancel_with_status.cc
@@ -0,0 +1,183 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            size_t num_ops,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s [%" PRIdPTR " ops]", test_name,
+          config.name, num_ops);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+  grpc_event ev = grpc_completion_queue_next(
+      f->cq, grpc_timeout_seconds_to_deadline(5), NULL);
+  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  GPR_ASSERT(ev.tag == tag(1000));
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f, size_t num_ops) {
+  grpc_call* c;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+
+  gpr_log(GPR_DEBUG, "test with %" PRIuPTR " ops", num_ops);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(num_ops <= (size_t)(op - ops));
+  error = grpc_call_start_batch(c, ops, num_ops, tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  char* dynamic_string = gpr_strdup("xyz");
+  grpc_call_cancel_with_status(c, GRPC_STATUS_UNIMPLEMENTED,
+                               (const char*)dynamic_string, NULL);
+  // The API of \a description allows for it to be a dynamic/non-const
+  // string, test this guarantee.
+  gpr_free(dynamic_string);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_simple_request(grpc_end2end_test_config config,
+                                       size_t num_ops) {
+  grpc_end2end_test_fixture f;
+
+  f = begin_test(config, "test_invoke_simple_request", num_ops, NULL, NULL);
+  simple_request_body(config, f, num_ops);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void cancel_with_status(grpc_end2end_test_config config) {
+  size_t i;
+  for (i = 1; i <= 4; i++) {
+    test_invoke_simple_request(config, i);
+  }
+}
+
+void cancel_with_status_pre_init(void) {}
diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c
deleted file mode 100644
index ba03773..0000000
--- a/test/core/end2end/tests/compressed_payload.c
+++ /dev/null
@@ -1,648 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/byte_buffer_reader.h>
-#include <grpc/compression.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/call_test_only.h"
-#include "src/core/lib/transport/static_metadata.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void request_for_disabled_algorithm(
-    grpc_end2end_test_config config, const char *test_name,
-    uint32_t send_flags_bitmask,
-    grpc_compression_algorithm algorithm_to_disable,
-    grpc_compression_algorithm requested_client_compression_algorithm,
-    grpc_status_code expected_error, grpc_metadata *client_metadata) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice;
-  grpc_byte_buffer *request_payload;
-  grpc_channel_args *client_args;
-  grpc_channel_args *server_args;
-  grpc_end2end_test_fixture f;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  cq_verifier *cqv;
-  char str[1024];
-
-  memset(str, 'x', 1023);
-  str[1023] = '\0';
-  request_payload_slice = grpc_slice_from_copied_string(str);
-  request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-
-  client_args = grpc_channel_args_set_compression_algorithm(
-      NULL, requested_client_compression_algorithm);
-  server_args =
-      grpc_channel_args_set_compression_algorithm(NULL, GRPC_COMPRESS_NONE);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    server_args = grpc_channel_args_compression_algorithm_set_state(
-        &exec_ctx, &server_args, algorithm_to_disable, false);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  f = begin_test(config, test_name, client_args, server_args);
-  cqv = cq_verifier_create(f.cq);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  if (client_metadata != NULL) {
-    op->data.send_initial_metadata.count = 1;
-    op->data.send_initial_metadata.metadata = client_metadata;
-  } else {
-    op->data.send_initial_metadata.count = 0;
-  }
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = send_flags_bitmask;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), true);
-  cq_verify(cqv);
-
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), false);
-
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), true);
-  cq_verify(cqv);
-
-  /* call was cancelled (closed) ... */
-  GPR_ASSERT(was_cancelled != 0);
-  /* with a certain error */
-  GPR_ASSERT(status == expected_error);
-
-  const char *algo_name = NULL;
-  GPR_ASSERT(grpc_compression_algorithm_name(algorithm_to_disable, &algo_name));
-  char *expected_details = NULL;
-  gpr_asprintf(&expected_details, "Compression algorithm '%s' is disabled.",
-               algo_name);
-  /* and we expect a specific reason for it */
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, expected_details));
-  gpr_free(expected_details);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_slice_unref(request_payload_slice);
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, client_args);
-    grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void request_with_payload_template(
-    grpc_end2end_test_config config, const char *test_name,
-    uint32_t client_send_flags_bitmask,
-    grpc_compression_algorithm default_client_channel_compression_algorithm,
-    grpc_compression_algorithm default_server_channel_compression_algorithm,
-    grpc_compression_algorithm expected_algorithm_from_client,
-    grpc_compression_algorithm expected_algorithm_from_server,
-    grpc_metadata *client_init_metadata, bool set_server_level,
-    grpc_compression_level server_compression_level,
-    bool send_message_before_initial_metadata) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice;
-  grpc_byte_buffer *request_payload = NULL;
-  grpc_channel_args *client_args;
-  grpc_channel_args *server_args;
-  grpc_end2end_test_fixture f;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload;
-  grpc_byte_buffer *response_payload_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  cq_verifier *cqv;
-  char request_str[1024];
-  char response_str[1024];
-
-  memset(request_str, 'x', 1023);
-  request_str[1023] = '\0';
-
-  memset(response_str, 'y', 1023);
-  response_str[1023] = '\0';
-
-  request_payload_slice = grpc_slice_from_copied_string(request_str);
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string(response_str);
-
-  client_args = grpc_channel_args_set_compression_algorithm(
-      NULL, default_client_channel_compression_algorithm);
-  server_args = grpc_channel_args_set_compression_algorithm(
-      NULL, default_server_channel_compression_algorithm);
-
-  f = begin_test(config, test_name, client_args, server_args);
-  cqv = cq_verifier_create(f.cq);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  if (send_message_before_initial_metadata) {
-    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = request_payload;
-    op->flags = client_send_flags_bitmask;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-    CQ_EXPECT_COMPLETION(cqv, tag(2), true);
-  }
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  if (client_init_metadata != NULL) {
-    op->data.send_initial_metadata.count = 1;
-    op->data.send_initial_metadata.metadata = client_init_metadata;
-  } else {
-    op->data.send_initial_metadata.count = 0;
-  }
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(100));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(100), true);
-  cq_verify(cqv);
-
-  GPR_ASSERT(GPR_BITCOUNT(grpc_call_test_only_get_encodings_accepted_by_peer(
-                 s)) == GRPC_COMPRESS_ALGORITHMS_COUNT);
-  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
-                        GRPC_COMPRESS_NONE) != 0);
-  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
-                        GRPC_COMPRESS_DEFLATE) != 0);
-  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
-                        GRPC_COMPRESS_GZIP) != 0);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  if (set_server_level) {
-    op->data.send_initial_metadata.maybe_compression_level.is_set = true;
-    op->data.send_initial_metadata.maybe_compression_level.level =
-        server_compression_level;
-  }
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  for (int i = 0; i < 2; i++) {
-    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-
-    if (i > 0 || !send_message_before_initial_metadata) {
-      request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-      memset(ops, 0, sizeof(ops));
-      op = ops;
-      op->op = GRPC_OP_SEND_MESSAGE;
-      op->data.send_message.send_message = request_payload;
-      op->flags = client_send_flags_bitmask;
-      op->reserved = NULL;
-      op++;
-      error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-      GPR_ASSERT(GRPC_CALL_OK == error);
-      CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-    }
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &request_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-    cq_verify(cqv);
-
-    GPR_ASSERT(request_payload_recv->type == GRPC_BB_RAW);
-    GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, request_str));
-    GPR_ASSERT(request_payload_recv->data.raw.compression ==
-               expected_algorithm_from_client);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = response_payload;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &response_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-    CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-    cq_verify(cqv);
-
-    GPR_ASSERT(response_payload_recv->type == GRPC_BB_RAW);
-    GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, response_str));
-    if (server_compression_level > GRPC_COMPRESS_LEVEL_NONE) {
-      const grpc_compression_algorithm algo_for_server_level =
-          grpc_call_compression_for_level(s, server_compression_level);
-      GPR_ASSERT(response_payload_recv->data.raw.compression ==
-                 algo_for_server_level);
-    } else {
-      GPR_ASSERT(response_payload_recv->data.raw.compression ==
-                 expected_algorithm_from_server);
-    }
-
-    grpc_byte_buffer_destroy(request_payload);
-    grpc_byte_buffer_destroy(response_payload);
-    grpc_byte_buffer_destroy(request_payload_recv);
-    grpc_byte_buffer_destroy(response_payload_recv);
-  }
-
-  grpc_slice_unref(request_payload_slice);
-  grpc_slice_unref(response_payload_slice);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, client_args);
-    grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_invoke_request_with_exceptionally_uncompressed_payload(
-    grpc_end2end_test_config config) {
-  request_with_payload_template(
-      config, "test_invoke_request_with_exceptionally_uncompressed_payload",
-      GRPC_WRITE_NO_COMPRESS, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP,
-      GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, NULL, false,
-      /* ignored */ GRPC_COMPRESS_LEVEL_NONE, false);
-}
-
-static void test_invoke_request_with_uncompressed_payload(
-    grpc_end2end_test_config config) {
-  request_with_payload_template(
-      config, "test_invoke_request_with_uncompressed_payload", 0,
-      GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE,
-      GRPC_COMPRESS_NONE, NULL, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE,
-      false);
-}
-
-static void test_invoke_request_with_compressed_payload(
-    grpc_end2end_test_config config) {
-  request_with_payload_template(
-      config, "test_invoke_request_with_compressed_payload", 0,
-      GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP,
-      GRPC_COMPRESS_GZIP, NULL, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE,
-      false);
-}
-
-static void test_invoke_request_with_send_message_before_initial_metadata(
-    grpc_end2end_test_config config) {
-  request_with_payload_template(
-      config, "test_invoke_request_with_compressed_payload", 0,
-      GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP,
-      GRPC_COMPRESS_GZIP, NULL, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE,
-      true);
-}
-
-static void test_invoke_request_with_server_level(
-    grpc_end2end_test_config config) {
-  request_with_payload_template(
-      config, "test_invoke_request_with_server_level", 0, GRPC_COMPRESS_NONE,
-      GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE /* ignored */,
-      NULL, true, GRPC_COMPRESS_LEVEL_HIGH, false);
-}
-
-static void test_invoke_request_with_compressed_payload_md_override(
-    grpc_end2end_test_config config) {
-  grpc_metadata gzip_compression_override;
-  grpc_metadata identity_compression_override;
-
-  gzip_compression_override.key = GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST;
-  gzip_compression_override.value = grpc_slice_from_static_string("gzip");
-  memset(&gzip_compression_override.internal_data, 0,
-         sizeof(gzip_compression_override.internal_data));
-
-  identity_compression_override.key = GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST;
-  identity_compression_override.value =
-      grpc_slice_from_static_string("identity");
-  memset(&identity_compression_override.internal_data, 0,
-         sizeof(identity_compression_override.internal_data));
-
-  /* Channel default NONE (aka IDENTITY), call override to GZIP */
-  request_with_payload_template(
-      config, "test_invoke_request_with_compressed_payload_md_override_1", 0,
-      GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP,
-      GRPC_COMPRESS_NONE, &gzip_compression_override, false,
-      /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false);
-
-  /* Channel default DEFLATE, call override to GZIP */
-  request_with_payload_template(
-      config, "test_invoke_request_with_compressed_payload_md_override_2", 0,
-      GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP,
-      GRPC_COMPRESS_NONE, &gzip_compression_override, false,
-      /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false);
-
-  /* Channel default DEFLATE, call override to NONE (aka IDENTITY) */
-  request_with_payload_template(
-      config, "test_invoke_request_with_compressed_payload_md_override_3", 0,
-      GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE,
-      GRPC_COMPRESS_NONE, &identity_compression_override, false,
-      /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false);
-}
-
-static void test_invoke_request_with_disabled_algorithm(
-    grpc_end2end_test_config config) {
-  request_for_disabled_algorithm(
-      config, "test_invoke_request_with_disabled_algorithm", 0,
-      GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_STATUS_UNIMPLEMENTED, NULL);
-}
-
-void compressed_payload(grpc_end2end_test_config config) {
-  test_invoke_request_with_exceptionally_uncompressed_payload(config);
-  test_invoke_request_with_uncompressed_payload(config);
-  test_invoke_request_with_compressed_payload(config);
-  test_invoke_request_with_send_message_before_initial_metadata(config);
-  test_invoke_request_with_server_level(config);
-  test_invoke_request_with_compressed_payload_md_override(config);
-  test_invoke_request_with_disabled_algorithm(config);
-}
-
-void compressed_payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc
new file mode 100644
index 0000000..b5fc189
--- /dev/null
+++ b/test/core/end2end/tests/compressed_payload.cc
@@ -0,0 +1,648 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
+#include <grpc/compression.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/surface/call.h"
+#include "src/core/lib/surface/call_test_only.h"
+#include "src/core/lib/transport/static_metadata.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void request_for_disabled_algorithm(
+    grpc_end2end_test_config config, const char* test_name,
+    uint32_t send_flags_bitmask,
+    grpc_compression_algorithm algorithm_to_disable,
+    grpc_compression_algorithm requested_client_compression_algorithm,
+    grpc_status_code expected_error, grpc_metadata* client_metadata) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice;
+  grpc_byte_buffer* request_payload;
+  grpc_channel_args* client_args;
+  grpc_channel_args* server_args;
+  grpc_end2end_test_fixture f;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  cq_verifier* cqv;
+  char str[1024];
+
+  memset(str, 'x', 1023);
+  str[1023] = '\0';
+  request_payload_slice = grpc_slice_from_copied_string(str);
+  request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+
+  client_args = grpc_channel_args_set_compression_algorithm(
+      NULL, requested_client_compression_algorithm);
+  server_args =
+      grpc_channel_args_set_compression_algorithm(NULL, GRPC_COMPRESS_NONE);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    server_args = grpc_channel_args_compression_algorithm_set_state(
+        &exec_ctx, &server_args, algorithm_to_disable, false);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  f = begin_test(config, test_name, client_args, server_args);
+  cqv = cq_verifier_create(f.cq);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  if (client_metadata != NULL) {
+    op->data.send_initial_metadata.count = 1;
+    op->data.send_initial_metadata.metadata = client_metadata;
+  } else {
+    op->data.send_initial_metadata.count = 0;
+  }
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = send_flags_bitmask;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), true);
+  cq_verify(cqv);
+
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), false);
+
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), true);
+  cq_verify(cqv);
+
+  /* call was cancelled (closed) ... */
+  GPR_ASSERT(was_cancelled != 0);
+  /* with a certain error */
+  GPR_ASSERT(status == expected_error);
+
+  const char* algo_name = NULL;
+  GPR_ASSERT(grpc_compression_algorithm_name(algorithm_to_disable, &algo_name));
+  char* expected_details = NULL;
+  gpr_asprintf(&expected_details, "Compression algorithm '%s' is disabled.",
+               algo_name);
+  /* and we expect a specific reason for it */
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, expected_details));
+  gpr_free(expected_details);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_slice_unref(request_payload_slice);
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, client_args);
+    grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void request_with_payload_template(
+    grpc_end2end_test_config config, const char* test_name,
+    uint32_t client_send_flags_bitmask,
+    grpc_compression_algorithm default_client_channel_compression_algorithm,
+    grpc_compression_algorithm default_server_channel_compression_algorithm,
+    grpc_compression_algorithm expected_algorithm_from_client,
+    grpc_compression_algorithm expected_algorithm_from_server,
+    grpc_metadata* client_init_metadata, bool set_server_level,
+    grpc_compression_level server_compression_level,
+    bool send_message_before_initial_metadata) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice;
+  grpc_byte_buffer* request_payload = NULL;
+  grpc_channel_args* client_args;
+  grpc_channel_args* server_args;
+  grpc_end2end_test_fixture f;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload;
+  grpc_byte_buffer* response_payload_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  cq_verifier* cqv;
+  char request_str[1024];
+  char response_str[1024];
+
+  memset(request_str, 'x', 1023);
+  request_str[1023] = '\0';
+
+  memset(response_str, 'y', 1023);
+  response_str[1023] = '\0';
+
+  request_payload_slice = grpc_slice_from_copied_string(request_str);
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string(response_str);
+
+  client_args = grpc_channel_args_set_compression_algorithm(
+      NULL, default_client_channel_compression_algorithm);
+  server_args = grpc_channel_args_set_compression_algorithm(
+      NULL, default_server_channel_compression_algorithm);
+
+  f = begin_test(config, test_name, client_args, server_args);
+  cqv = cq_verifier_create(f.cq);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  if (send_message_before_initial_metadata) {
+    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = request_payload;
+    op->flags = client_send_flags_bitmask;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+    CQ_EXPECT_COMPLETION(cqv, tag(2), true);
+  }
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  if (client_init_metadata != NULL) {
+    op->data.send_initial_metadata.count = 1;
+    op->data.send_initial_metadata.metadata = client_init_metadata;
+  } else {
+    op->data.send_initial_metadata.count = 0;
+  }
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(100));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(100), true);
+  cq_verify(cqv);
+
+  GPR_ASSERT(GPR_BITCOUNT(grpc_call_test_only_get_encodings_accepted_by_peer(
+                 s)) == GRPC_COMPRESS_ALGORITHMS_COUNT);
+  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
+                        GRPC_COMPRESS_NONE) != 0);
+  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
+                        GRPC_COMPRESS_DEFLATE) != 0);
+  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
+                        GRPC_COMPRESS_GZIP) != 0);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  if (set_server_level) {
+    op->data.send_initial_metadata.maybe_compression_level.is_set = true;
+    op->data.send_initial_metadata.maybe_compression_level.level =
+        server_compression_level;
+  }
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  for (int i = 0; i < 2; i++) {
+    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+
+    if (i > 0 || !send_message_before_initial_metadata) {
+      request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+      memset(ops, 0, sizeof(ops));
+      op = ops;
+      op->op = GRPC_OP_SEND_MESSAGE;
+      op->data.send_message.send_message = request_payload;
+      op->flags = client_send_flags_bitmask;
+      op->reserved = NULL;
+      op++;
+      error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+      GPR_ASSERT(GRPC_CALL_OK == error);
+      CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+    }
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &request_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+    cq_verify(cqv);
+
+    GPR_ASSERT(request_payload_recv->type == GRPC_BB_RAW);
+    GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, request_str));
+    GPR_ASSERT(request_payload_recv->data.raw.compression ==
+               expected_algorithm_from_client);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = response_payload;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &response_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+    CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+    cq_verify(cqv);
+
+    GPR_ASSERT(response_payload_recv->type == GRPC_BB_RAW);
+    GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, response_str));
+    if (server_compression_level > GRPC_COMPRESS_LEVEL_NONE) {
+      const grpc_compression_algorithm algo_for_server_level =
+          grpc_call_compression_for_level(s, server_compression_level);
+      GPR_ASSERT(response_payload_recv->data.raw.compression ==
+                 algo_for_server_level);
+    } else {
+      GPR_ASSERT(response_payload_recv->data.raw.compression ==
+                 expected_algorithm_from_server);
+    }
+
+    grpc_byte_buffer_destroy(request_payload);
+    grpc_byte_buffer_destroy(response_payload);
+    grpc_byte_buffer_destroy(request_payload_recv);
+    grpc_byte_buffer_destroy(response_payload_recv);
+  }
+
+  grpc_slice_unref(request_payload_slice);
+  grpc_slice_unref(response_payload_slice);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, client_args);
+    grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_invoke_request_with_exceptionally_uncompressed_payload(
+    grpc_end2end_test_config config) {
+  request_with_payload_template(
+      config, "test_invoke_request_with_exceptionally_uncompressed_payload",
+      GRPC_WRITE_NO_COMPRESS, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP,
+      GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, NULL, false,
+      /* ignored */ GRPC_COMPRESS_LEVEL_NONE, false);
+}
+
+static void test_invoke_request_with_uncompressed_payload(
+    grpc_end2end_test_config config) {
+  request_with_payload_template(
+      config, "test_invoke_request_with_uncompressed_payload", 0,
+      GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE,
+      GRPC_COMPRESS_NONE, NULL, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE,
+      false);
+}
+
+static void test_invoke_request_with_compressed_payload(
+    grpc_end2end_test_config config) {
+  request_with_payload_template(
+      config, "test_invoke_request_with_compressed_payload", 0,
+      GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP,
+      GRPC_COMPRESS_GZIP, NULL, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE,
+      false);
+}
+
+static void test_invoke_request_with_send_message_before_initial_metadata(
+    grpc_end2end_test_config config) {
+  request_with_payload_template(
+      config, "test_invoke_request_with_compressed_payload", 0,
+      GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP,
+      GRPC_COMPRESS_GZIP, NULL, false, /* ignored */ GRPC_COMPRESS_LEVEL_NONE,
+      true);
+}
+
+static void test_invoke_request_with_server_level(
+    grpc_end2end_test_config config) {
+  request_with_payload_template(
+      config, "test_invoke_request_with_server_level", 0, GRPC_COMPRESS_NONE,
+      GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE /* ignored */,
+      NULL, true, GRPC_COMPRESS_LEVEL_HIGH, false);
+}
+
+static void test_invoke_request_with_compressed_payload_md_override(
+    grpc_end2end_test_config config) {
+  grpc_metadata gzip_compression_override;
+  grpc_metadata identity_compression_override;
+
+  gzip_compression_override.key = GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST;
+  gzip_compression_override.value = grpc_slice_from_static_string("gzip");
+  memset(&gzip_compression_override.internal_data, 0,
+         sizeof(gzip_compression_override.internal_data));
+
+  identity_compression_override.key = GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST;
+  identity_compression_override.value =
+      grpc_slice_from_static_string("identity");
+  memset(&identity_compression_override.internal_data, 0,
+         sizeof(identity_compression_override.internal_data));
+
+  /* Channel default NONE (aka IDENTITY), call override to GZIP */
+  request_with_payload_template(
+      config, "test_invoke_request_with_compressed_payload_md_override_1", 0,
+      GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP,
+      GRPC_COMPRESS_NONE, &gzip_compression_override, false,
+      /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false);
+
+  /* Channel default DEFLATE, call override to GZIP */
+  request_with_payload_template(
+      config, "test_invoke_request_with_compressed_payload_md_override_2", 0,
+      GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP,
+      GRPC_COMPRESS_NONE, &gzip_compression_override, false,
+      /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false);
+
+  /* Channel default DEFLATE, call override to NONE (aka IDENTITY) */
+  request_with_payload_template(
+      config, "test_invoke_request_with_compressed_payload_md_override_3", 0,
+      GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE,
+      GRPC_COMPRESS_NONE, &identity_compression_override, false,
+      /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false);
+}
+
+static void test_invoke_request_with_disabled_algorithm(
+    grpc_end2end_test_config config) {
+  request_for_disabled_algorithm(
+      config, "test_invoke_request_with_disabled_algorithm", 0,
+      GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_STATUS_UNIMPLEMENTED, NULL);
+}
+
+void compressed_payload(grpc_end2end_test_config config) {
+  test_invoke_request_with_exceptionally_uncompressed_payload(config);
+  test_invoke_request_with_uncompressed_payload(config);
+  test_invoke_request_with_compressed_payload(config);
+  test_invoke_request_with_send_message_before_initial_metadata(config);
+  test_invoke_request_with_server_level(config);
+  test_invoke_request_with_compressed_payload_md_override(config);
+  test_invoke_request_with_disabled_algorithm(config);
+}
+
+void compressed_payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/connectivity.c b/test/core/end2end/tests/connectivity.c
deleted file mode 100644
index 610243e..0000000
--- a/test/core/end2end/tests/connectivity.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-typedef struct {
-  gpr_event started;
-  grpc_channel *channel;
-  grpc_completion_queue *cq;
-} child_events;
-
-static void child_thread(void *arg) {
-  child_events *ce = (child_events *)arg;
-  grpc_event ev;
-  gpr_event_set(&ce->started, (void *)1);
-  gpr_log(GPR_DEBUG, "verifying");
-  ev = grpc_completion_queue_next(ce->cq, gpr_inf_future(GPR_CLOCK_MONOTONIC),
-                                  NULL);
-  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  GPR_ASSERT(ev.tag == tag(1));
-  GPR_ASSERT(ev.success == 0);
-}
-
-static void test_connectivity(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
-  grpc_connectivity_state state;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  child_events ce;
-  gpr_thd_options thdopt = gpr_thd_options_default();
-  gpr_thd_id thdid;
-
-  grpc_channel_args client_args;
-  grpc_arg arg_array[1];
-  arg_array[0].type = GRPC_ARG_INTEGER;
-  arg_array[0].key = "grpc.testing.fixed_reconnect_backoff_ms";
-  arg_array[0].value.integer = 1000;
-  client_args.args = arg_array;
-  client_args.num_args = 1;
-
-  config.init_client(&f, &client_args);
-
-  ce.channel = f.client;
-  ce.cq = f.cq;
-  gpr_event_init(&ce.started);
-  gpr_thd_options_set_joinable(&thdopt);
-  GPR_ASSERT(gpr_thd_new(&thdid, child_thread, &ce, &thdopt));
-
-  gpr_event_wait(&ce.started, gpr_inf_future(GPR_CLOCK_MONOTONIC));
-
-  /* channels should start life in IDLE, and stay there */
-  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) ==
-             GRPC_CHANNEL_IDLE);
-  gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100));
-  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) ==
-             GRPC_CHANNEL_IDLE);
-
-  /* start watching for a change */
-  gpr_log(GPR_DEBUG, "watching");
-  grpc_channel_watch_connectivity_state(
-      f.client, GRPC_CHANNEL_IDLE, gpr_now(GPR_CLOCK_MONOTONIC), f.cq, tag(1));
-
-  /* eventually the child thread completion should trigger */
-  gpr_thd_join(thdid);
-
-  /* check that we're still in idle, and start connecting */
-  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) ==
-             GRPC_CHANNEL_IDLE);
-  /* start watching for a change */
-  grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_IDLE,
-                                        grpc_timeout_seconds_to_deadline(3),
-                                        f.cq, tag(2));
-
-  /* and now the watch should trigger */
-  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-  cq_verify(cqv);
-  state = grpc_channel_check_connectivity_state(f.client, 0);
-  GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
-             state == GRPC_CHANNEL_CONNECTING);
-
-  /* quickly followed by a transition to TRANSIENT_FAILURE */
-  grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_CONNECTING,
-                                        grpc_timeout_seconds_to_deadline(3),
-                                        f.cq, tag(3));
-  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-  cq_verify(cqv);
-  state = grpc_channel_check_connectivity_state(f.client, 0);
-  GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
-             state == GRPC_CHANNEL_CONNECTING);
-
-  gpr_log(GPR_DEBUG, "*** STARTING SERVER ***");
-
-  /* now let's bring up a server to connect to */
-  config.init_server(&f, NULL);
-
-  gpr_log(GPR_DEBUG, "*** STARTED SERVER ***");
-
-  /* we'll go through some set of transitions (some might be missed), until
-     READY is reached */
-  while (state != GRPC_CHANNEL_READY) {
-    grpc_channel_watch_connectivity_state(
-        f.client, state, grpc_timeout_seconds_to_deadline(3), f.cq, tag(4));
-    CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
-    cq_verify(cqv);
-    state = grpc_channel_check_connectivity_state(f.client, 0);
-    GPR_ASSERT(state == GRPC_CHANNEL_READY ||
-               state == GRPC_CHANNEL_CONNECTING ||
-               state == GRPC_CHANNEL_TRANSIENT_FAILURE);
-  }
-
-  /* bring down the server again */
-  /* we should go immediately to TRANSIENT_FAILURE */
-  gpr_log(GPR_DEBUG, "*** SHUTTING DOWN SERVER ***");
-
-  grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_READY,
-                                        grpc_timeout_seconds_to_deadline(3),
-                                        f.cq, tag(5));
-
-  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
-
-  CQ_EXPECT_COMPLETION(cqv, tag(5), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
-  cq_verify(cqv);
-  state = grpc_channel_check_connectivity_state(f.client, 0);
-  GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
-             state == GRPC_CHANNEL_CONNECTING || state == GRPC_CHANNEL_IDLE);
-
-  /* cleanup server */
-  grpc_server_destroy(f.server);
-
-  gpr_log(GPR_DEBUG, "*** SHUTDOWN SERVER ***");
-
-  grpc_channel_destroy(f.client);
-  grpc_completion_queue_shutdown(f.cq);
-  grpc_completion_queue_destroy(f.cq);
-
-  /* shutdown_cq is not used in this test */
-  grpc_completion_queue_destroy(f.shutdown_cq);
-  config.tear_down_data(&f);
-
-  cq_verifier_destroy(cqv);
-}
-
-void connectivity(grpc_end2end_test_config config) {
-  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
-  test_connectivity(config);
-}
-
-void connectivity_pre_init(void) {}
diff --git a/test/core/end2end/tests/connectivity.cc b/test/core/end2end/tests/connectivity.cc
new file mode 100644
index 0000000..4f302d1
--- /dev/null
+++ b/test/core/end2end/tests/connectivity.cc
@@ -0,0 +1,173 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+typedef struct {
+  gpr_event started;
+  grpc_channel* channel;
+  grpc_completion_queue* cq;
+} child_events;
+
+static void child_thread(void* arg) {
+  child_events* ce = (child_events*)arg;
+  grpc_event ev;
+  gpr_event_set(&ce->started, (void*)1);
+  gpr_log(GPR_DEBUG, "verifying");
+  ev = grpc_completion_queue_next(ce->cq, gpr_inf_future(GPR_CLOCK_MONOTONIC),
+                                  NULL);
+  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  GPR_ASSERT(ev.tag == tag(1));
+  GPR_ASSERT(ev.success == 0);
+}
+
+static void test_connectivity(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
+  grpc_connectivity_state state;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  child_events ce;
+  gpr_thd_options thdopt = gpr_thd_options_default();
+  gpr_thd_id thdid;
+
+  grpc_channel_args client_args;
+  grpc_arg arg_array[1];
+  arg_array[0].type = GRPC_ARG_INTEGER;
+  arg_array[0].key =
+      const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms");
+  arg_array[0].value.integer = 1000;
+  client_args.args = arg_array;
+  client_args.num_args = 1;
+
+  config.init_client(&f, &client_args);
+
+  ce.channel = f.client;
+  ce.cq = f.cq;
+  gpr_event_init(&ce.started);
+  gpr_thd_options_set_joinable(&thdopt);
+  GPR_ASSERT(gpr_thd_new(&thdid, child_thread, &ce, &thdopt));
+
+  gpr_event_wait(&ce.started, gpr_inf_future(GPR_CLOCK_MONOTONIC));
+
+  /* channels should start life in IDLE, and stay there */
+  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) ==
+             GRPC_CHANNEL_IDLE);
+  gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100));
+  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) ==
+             GRPC_CHANNEL_IDLE);
+
+  /* start watching for a change */
+  gpr_log(GPR_DEBUG, "watching");
+  grpc_channel_watch_connectivity_state(
+      f.client, GRPC_CHANNEL_IDLE, gpr_now(GPR_CLOCK_MONOTONIC), f.cq, tag(1));
+
+  /* eventually the child thread completion should trigger */
+  gpr_thd_join(thdid);
+
+  /* check that we're still in idle, and start connecting */
+  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) ==
+             GRPC_CHANNEL_IDLE);
+  /* start watching for a change */
+  grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_IDLE,
+                                        grpc_timeout_seconds_to_deadline(3),
+                                        f.cq, tag(2));
+
+  /* and now the watch should trigger */
+  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+  cq_verify(cqv);
+  state = grpc_channel_check_connectivity_state(f.client, 0);
+  GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
+             state == GRPC_CHANNEL_CONNECTING);
+
+  /* quickly followed by a transition to TRANSIENT_FAILURE */
+  grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_CONNECTING,
+                                        grpc_timeout_seconds_to_deadline(3),
+                                        f.cq, tag(3));
+  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+  cq_verify(cqv);
+  state = grpc_channel_check_connectivity_state(f.client, 0);
+  GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
+             state == GRPC_CHANNEL_CONNECTING);
+
+  gpr_log(GPR_DEBUG, "*** STARTING SERVER ***");
+
+  /* now let's bring up a server to connect to */
+  config.init_server(&f, NULL);
+
+  gpr_log(GPR_DEBUG, "*** STARTED SERVER ***");
+
+  /* we'll go through some set of transitions (some might be missed), until
+     READY is reached */
+  while (state != GRPC_CHANNEL_READY) {
+    grpc_channel_watch_connectivity_state(
+        f.client, state, grpc_timeout_seconds_to_deadline(3), f.cq, tag(4));
+    CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
+    cq_verify(cqv);
+    state = grpc_channel_check_connectivity_state(f.client, 0);
+    GPR_ASSERT(state == GRPC_CHANNEL_READY ||
+               state == GRPC_CHANNEL_CONNECTING ||
+               state == GRPC_CHANNEL_TRANSIENT_FAILURE);
+  }
+
+  /* bring down the server again */
+  /* we should go immediately to TRANSIENT_FAILURE */
+  gpr_log(GPR_DEBUG, "*** SHUTTING DOWN SERVER ***");
+
+  grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_READY,
+                                        grpc_timeout_seconds_to_deadline(3),
+                                        f.cq, tag(5));
+
+  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
+
+  CQ_EXPECT_COMPLETION(cqv, tag(5), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
+  cq_verify(cqv);
+  state = grpc_channel_check_connectivity_state(f.client, 0);
+  GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
+             state == GRPC_CHANNEL_CONNECTING || state == GRPC_CHANNEL_IDLE);
+
+  /* cleanup server */
+  grpc_server_destroy(f.server);
+
+  gpr_log(GPR_DEBUG, "*** SHUTDOWN SERVER ***");
+
+  grpc_channel_destroy(f.client);
+  grpc_completion_queue_shutdown(f.cq);
+  grpc_completion_queue_destroy(f.cq);
+
+  /* shutdown_cq is not used in this test */
+  grpc_completion_queue_destroy(f.shutdown_cq);
+  config.tear_down_data(&f);
+
+  cq_verifier_destroy(cqv);
+}
+
+void connectivity(grpc_end2end_test_config config) {
+  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
+  test_connectivity(config);
+}
+
+void connectivity_pre_init(void) {}
diff --git a/test/core/end2end/tests/default_host.c b/test/core/end2end/tests/default_host.c
deleted file mode 100644
index d1db9b3..0000000
--- a/test/core/end2end/tests/default_host.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_client(&f, client_args);
-  config.init_server(&f, server_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  char *peer;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-                               grpc_slice_from_static_string("/foo"), NULL,
-                               deadline, NULL);
-  GPR_ASSERT(c);
-
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
-  gpr_free(peer);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(error == GRPC_CALL_OK);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(error == GRPC_CALL_OK);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  peer = grpc_call_get_peer(s);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
-  gpr_free(peer);
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
-  gpr_free(peer);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(error == GRPC_CALL_OK);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  GPR_ASSERT(grpc_slice_buf_start_eq(call_details.host, "localhost", 9));
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_simple_request(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-
-  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
-  simple_request_body(f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void default_host(grpc_end2end_test_config config) {
-  if ((config.feature_mask & FEATURE_MASK_SUPPORTS_HOSTNAME_VERIFICATION) == 0)
-    return;
-  if ((config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION) == 0)
-    return;
-  test_invoke_simple_request(config);
-}
-
-void default_host_pre_init(void) {}
diff --git a/test/core/end2end/tests/default_host.cc b/test/core/end2end/tests/default_host.cc
new file mode 100644
index 0000000..166f22a
--- /dev/null
+++ b/test/core/end2end/tests/default_host.cc
@@ -0,0 +1,225 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_client(&f, client_args);
+  config.init_server(&f, server_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  char* peer;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+                               grpc_slice_from_static_string("/foo"), NULL,
+                               deadline, NULL);
+  GPR_ASSERT(c);
+
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
+  gpr_free(peer);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(error == GRPC_CALL_OK);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(error == GRPC_CALL_OK);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  peer = grpc_call_get_peer(s);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
+  gpr_free(peer);
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
+  gpr_free(peer);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(error == GRPC_CALL_OK);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  GPR_ASSERT(grpc_slice_buf_start_eq(call_details.host, "localhost", 9));
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_simple_request(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+
+  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
+  simple_request_body(f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void default_host(grpc_end2end_test_config config) {
+  if ((config.feature_mask & FEATURE_MASK_SUPPORTS_HOSTNAME_VERIFICATION) == 0)
+    return;
+  if ((config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION) == 0)
+    return;
+  test_invoke_simple_request(config);
+}
+
+void default_host_pre_init(void) {}
diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c
deleted file mode 100644
index 19e4c05..0000000
--- a/test/core/end2end/tests/disappearing_server.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-
-  /* Note: shutdown_cq was unused in this test */
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void do_request_and_shutdown_server(grpc_end2end_test_config config,
-                                           grpc_end2end_test_fixture *f,
-                                           cq_verifier *cqv) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f->client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f->server, &s, &call_details,
-                               &request_metadata_recv, f->cq, f->cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  /* should be able to shut down the server early
-     - and still complete the request */
-  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1000), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-}
-
-static void disappearing_server_test(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-
-  gpr_log(GPR_INFO, "Running test: %s/%s", "disappearing_server_test",
-          config.name);
-
-  config.init_client(&f, NULL);
-  config.init_server(&f, NULL);
-
-  do_request_and_shutdown_server(config, &f, cqv);
-
-  /* now destroy and recreate the server */
-  config.init_server(&f, NULL);
-
-  do_request_and_shutdown_server(config, &f, cqv);
-
-  cq_verifier_destroy(cqv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void disappearing_server(grpc_end2end_test_config config) {
-  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
-  disappearing_server_test(config);
-}
-
-void disappearing_server_pre_init(void) {}
diff --git a/test/core/end2end/tests/disappearing_server.cc b/test/core/end2end/tests/disappearing_server.cc
new file mode 100644
index 0000000..a0b34dd
--- /dev/null
+++ b/test/core/end2end/tests/disappearing_server.cc
@@ -0,0 +1,211 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+
+  /* Note: shutdown_cq was unused in this test */
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void do_request_and_shutdown_server(grpc_end2end_test_config config,
+                                           grpc_end2end_test_fixture* f,
+                                           cq_verifier* cqv) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f->client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f->server, &s, &call_details,
+                               &request_metadata_recv, f->cq, f->cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  /* should be able to shut down the server early
+     - and still complete the request */
+  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1000), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+}
+
+static void disappearing_server_test(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+
+  gpr_log(GPR_INFO, "Running test: %s/%s", "disappearing_server_test",
+          config.name);
+
+  config.init_client(&f, NULL);
+  config.init_server(&f, NULL);
+
+  do_request_and_shutdown_server(config, &f, cqv);
+
+  /* now destroy and recreate the server */
+  config.init_server(&f, NULL);
+
+  do_request_and_shutdown_server(config, &f, cqv);
+
+  cq_verifier_destroy(cqv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void disappearing_server(grpc_end2end_test_config config) {
+  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
+  disappearing_server_test(config);
+}
+
+void disappearing_server_pre_init(void) {}
diff --git a/test/core/end2end/tests/empty_batch.c b/test/core/end2end/tests/empty_batch.c
deleted file mode 100644
index ee57c16..0000000
--- a/test/core/end2end/tests/empty_batch.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void empty_batch_body(grpc_end2end_test_config config,
-                             grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_call_error error;
-  grpc_op *op = NULL;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  error = grpc_call_start_batch(c, op, 0, tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_empty_body(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-
-  f = begin_test(config, "test_invoke_empty_body", NULL, NULL);
-  empty_batch_body(config, f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void empty_batch(grpc_end2end_test_config config) {
-  test_invoke_empty_body(config);
-}
-
-void empty_batch_pre_init(void) {}
diff --git a/test/core/end2end/tests/empty_batch.cc b/test/core/end2end/tests/empty_batch.cc
new file mode 100644
index 0000000..59d0025
--- /dev/null
+++ b/test/core/end2end/tests/empty_batch.cc
@@ -0,0 +1,127 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void empty_batch_body(grpc_end2end_test_config config,
+                             grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_call_error error;
+  grpc_op* op = NULL;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  error = grpc_call_start_batch(c, op, 0, tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_empty_body(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+
+  f = begin_test(config, "test_invoke_empty_body", NULL, NULL);
+  empty_batch_body(config, f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void empty_batch(grpc_end2end_test_config config) {
+  test_invoke_empty_body(config);
+}
+
+void empty_batch_pre_init(void) {}
diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c
deleted file mode 100644
index 09e9dbc..0000000
--- a/test/core/end2end/tests/filter_call_init_fails.c
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <limits.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "test/core/end2end/cq_verifier.h"
-
-enum { TIMEOUT = 200000 };
-
-static bool g_enable_server_channel_filter = false;
-static bool g_enable_client_channel_filter = false;
-static bool g_enable_client_subchannel_filter = false;
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-// Simple request via a SERVER_CHANNEL filter that always fails to
-// initialize the call.
-static void test_server_channel_filter(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "filter_call_init_fails", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "access denied"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-// Simple request via a CLIENT_CHANNEL or CLIENT_DIRECT_CHANNEL filter
-// that always fails to initialize the call.
-static void test_client_channel_filter(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  gpr_timespec deadline = five_seconds_from_now();
-  grpc_end2end_test_fixture f =
-      begin_test(config, "filter_call_init_fails", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "access denied"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-// Simple request via a CLIENT_SUBCHANNEL filter that always fails to
-// initialize the call.
-static void test_client_subchannel_filter(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  gpr_timespec deadline = five_seconds_from_now();
-  grpc_end2end_test_fixture f =
-      begin_test(config, "filter_call_init_fails", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "access denied"));
-
-  // Reset and create a new call.  (The first call uses a different code
-  // path in client_channel.c than subsequent calls on the same channel,
-  // and we need to test both.)
-  grpc_call_unref(c);
-  status = GRPC_STATUS_OK;
-  grpc_slice_unref(details);
-  details = grpc_empty_slice();
-
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "access denied"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-/*******************************************************************************
- * Test filter - always fails to initialize a call
- */
-
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  return grpc_error_set_int(
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING("access denied"),
-      GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_PERMISSION_DENIED);
-}
-
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {}
-
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  return GRPC_ERROR_NONE;
-}
-
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {}
-
-static const grpc_channel_filter test_filter = {
-    grpc_call_next_op,
-    grpc_channel_next_op,
-    0,
-    init_call_elem,
-    grpc_call_stack_ignore_set_pollset_or_pollset_set,
-    destroy_call_elem,
-    0,
-    init_channel_elem,
-    destroy_channel_elem,
-    grpc_channel_next_get_info,
-    "filter_call_init_fails"};
-
-/*******************************************************************************
- * Registration
- */
-
-static bool maybe_add_server_channel_filter(grpc_exec_ctx *exec_ctx,
-                                            grpc_channel_stack_builder *builder,
-                                            void *arg) {
-  if (g_enable_server_channel_filter) {
-    // Want to add the filter as close to the end as possible, to make
-    // sure that all of the filters work well together.  However, we
-    // can't add it at the very end, because the connected channel filter
-    // must be the last one.  So we add it right before the last one.
-    grpc_channel_stack_builder_iterator *it =
-        grpc_channel_stack_builder_create_iterator_at_last(builder);
-    GPR_ASSERT(grpc_channel_stack_builder_move_prev(it));
-    const bool retval = grpc_channel_stack_builder_add_filter_before(
-        it, &test_filter, NULL, NULL);
-    grpc_channel_stack_builder_iterator_destroy(it);
-    return retval;
-  } else {
-    return true;
-  }
-}
-
-static bool maybe_add_client_channel_filter(grpc_exec_ctx *exec_ctx,
-                                            grpc_channel_stack_builder *builder,
-                                            void *arg) {
-  if (g_enable_client_channel_filter) {
-    // Want to add the filter as close to the end as possible, to make
-    // sure that all of the filters work well together.  However, we
-    // can't add it at the very end, because the connected channel filter
-    // must be the last one.  So we add it right before the last one.
-    grpc_channel_stack_builder_iterator *it =
-        grpc_channel_stack_builder_create_iterator_at_last(builder);
-    GPR_ASSERT(grpc_channel_stack_builder_move_prev(it));
-    const bool retval = grpc_channel_stack_builder_add_filter_before(
-        it, &test_filter, NULL, NULL);
-    grpc_channel_stack_builder_iterator_destroy(it);
-    return retval;
-  } else {
-    return true;
-  }
-}
-
-static bool maybe_add_client_subchannel_filter(
-    grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder, void *arg) {
-  if (g_enable_client_subchannel_filter) {
-    // Want to add the filter as close to the end as possible, to make
-    // sure that all of the filters work well together.  However, we
-    // can't add it at the very end, because the client channel filter
-    // must be the last one.  So we add it right before the last one.
-    grpc_channel_stack_builder_iterator *it =
-        grpc_channel_stack_builder_create_iterator_at_last(builder);
-    GPR_ASSERT(grpc_channel_stack_builder_move_prev(it));
-    const bool retval = grpc_channel_stack_builder_add_filter_before(
-        it, &test_filter, NULL, NULL);
-    grpc_channel_stack_builder_iterator_destroy(it);
-    return retval;
-  } else {
-    return true;
-  }
-}
-
-static void init_plugin(void) {
-  grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
-                                   maybe_add_server_channel_filter, NULL);
-  grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX,
-                                   maybe_add_client_channel_filter, NULL);
-  grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX,
-                                   maybe_add_client_subchannel_filter, NULL);
-  grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
-                                   maybe_add_client_channel_filter, NULL);
-}
-
-static void destroy_plugin(void) {}
-
-void filter_call_init_fails(grpc_end2end_test_config config) {
-  gpr_log(GPR_INFO, "Testing SERVER_CHANNEL filter.");
-  g_enable_server_channel_filter = true;
-  test_server_channel_filter(config);
-  g_enable_server_channel_filter = false;
-  gpr_log(GPR_INFO, "Testing CLIENT_CHANNEL / CLIENT_DIRECT_CHANNEL filter.");
-  g_enable_client_channel_filter = true;
-  test_client_channel_filter(config);
-  g_enable_client_channel_filter = false;
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL) {
-    gpr_log(GPR_INFO, "Testing CLIENT_SUBCHANNEL filter.");
-    g_enable_client_subchannel_filter = true;
-    test_client_subchannel_filter(config);
-    g_enable_client_subchannel_filter = false;
-  }
-}
-
-void filter_call_init_fails_pre_init(void) {
-  grpc_register_plugin(init_plugin, destroy_plugin);
-}
diff --git a/test/core/end2end/tests/filter_call_init_fails.cc b/test/core/end2end/tests/filter_call_init_fails.cc
new file mode 100644
index 0000000..ecf0cc3
--- /dev/null
+++ b/test/core/end2end/tests/filter_call_init_fails.cc
@@ -0,0 +1,531 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <limits.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/surface/channel_init.h"
+#include "test/core/end2end/cq_verifier.h"
+
+enum { TIMEOUT = 200000 };
+
+static bool g_enable_server_channel_filter = false;
+static bool g_enable_client_channel_filter = false;
+static bool g_enable_client_subchannel_filter = false;
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+// Simple request via a SERVER_CHANNEL filter that always fails to
+// initialize the call.
+static void test_server_channel_filter(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "filter_call_init_fails", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "access denied"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+// Simple request via a CLIENT_CHANNEL or CLIENT_DIRECT_CHANNEL filter
+// that always fails to initialize the call.
+static void test_client_channel_filter(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  gpr_timespec deadline = five_seconds_from_now();
+  grpc_end2end_test_fixture f =
+      begin_test(config, "filter_call_init_fails", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "access denied"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+// Simple request via a CLIENT_SUBCHANNEL filter that always fails to
+// initialize the call.
+static void test_client_subchannel_filter(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  gpr_timespec deadline = five_seconds_from_now();
+  grpc_end2end_test_fixture f =
+      begin_test(config, "filter_call_init_fails", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "access denied"));
+
+  // Reset and create a new call.  (The first call uses a different code
+  // path in client_channel.c than subsequent calls on the same channel,
+  // and we need to test both.)
+  grpc_call_unref(c);
+  status = GRPC_STATUS_OK;
+  grpc_slice_unref(details);
+  details = grpc_empty_slice();
+
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "access denied"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+/*******************************************************************************
+ * Test filter - always fails to initialize a call
+ */
+
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  return grpc_error_set_int(
+      GRPC_ERROR_CREATE_FROM_STATIC_STRING("access denied"),
+      GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_PERMISSION_DENIED);
+}
+
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {}
+
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  return GRPC_ERROR_NONE;
+}
+
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {}
+
+static const grpc_channel_filter test_filter = {
+    grpc_call_next_op,
+    grpc_channel_next_op,
+    0,
+    init_call_elem,
+    grpc_call_stack_ignore_set_pollset_or_pollset_set,
+    destroy_call_elem,
+    0,
+    init_channel_elem,
+    destroy_channel_elem,
+    grpc_channel_next_get_info,
+    "filter_call_init_fails"};
+
+/*******************************************************************************
+ * Registration
+ */
+
+static bool maybe_add_server_channel_filter(grpc_exec_ctx* exec_ctx,
+                                            grpc_channel_stack_builder* builder,
+                                            void* arg) {
+  if (g_enable_server_channel_filter) {
+    // Want to add the filter as close to the end as possible, to make
+    // sure that all of the filters work well together.  However, we
+    // can't add it at the very end, because the connected channel filter
+    // must be the last one.  So we add it right before the last one.
+    grpc_channel_stack_builder_iterator* it =
+        grpc_channel_stack_builder_create_iterator_at_last(builder);
+    GPR_ASSERT(grpc_channel_stack_builder_move_prev(it));
+    const bool retval = grpc_channel_stack_builder_add_filter_before(
+        it, &test_filter, NULL, NULL);
+    grpc_channel_stack_builder_iterator_destroy(it);
+    return retval;
+  } else {
+    return true;
+  }
+}
+
+static bool maybe_add_client_channel_filter(grpc_exec_ctx* exec_ctx,
+                                            grpc_channel_stack_builder* builder,
+                                            void* arg) {
+  if (g_enable_client_channel_filter) {
+    // Want to add the filter as close to the end as possible, to make
+    // sure that all of the filters work well together.  However, we
+    // can't add it at the very end, because the connected channel filter
+    // must be the last one.  So we add it right before the last one.
+    grpc_channel_stack_builder_iterator* it =
+        grpc_channel_stack_builder_create_iterator_at_last(builder);
+    GPR_ASSERT(grpc_channel_stack_builder_move_prev(it));
+    const bool retval = grpc_channel_stack_builder_add_filter_before(
+        it, &test_filter, NULL, NULL);
+    grpc_channel_stack_builder_iterator_destroy(it);
+    return retval;
+  } else {
+    return true;
+  }
+}
+
+static bool maybe_add_client_subchannel_filter(
+    grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder, void* arg) {
+  if (g_enable_client_subchannel_filter) {
+    // Want to add the filter as close to the end as possible, to make
+    // sure that all of the filters work well together.  However, we
+    // can't add it at the very end, because the client channel filter
+    // must be the last one.  So we add it right before the last one.
+    grpc_channel_stack_builder_iterator* it =
+        grpc_channel_stack_builder_create_iterator_at_last(builder);
+    GPR_ASSERT(grpc_channel_stack_builder_move_prev(it));
+    const bool retval = grpc_channel_stack_builder_add_filter_before(
+        it, &test_filter, NULL, NULL);
+    grpc_channel_stack_builder_iterator_destroy(it);
+    return retval;
+  } else {
+    return true;
+  }
+}
+
+static void init_plugin(void) {
+  grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
+                                   maybe_add_server_channel_filter, NULL);
+  grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX,
+                                   maybe_add_client_channel_filter, NULL);
+  grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX,
+                                   maybe_add_client_subchannel_filter, NULL);
+  grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
+                                   maybe_add_client_channel_filter, NULL);
+}
+
+static void destroy_plugin(void) {}
+
+void filter_call_init_fails(grpc_end2end_test_config config) {
+  gpr_log(GPR_INFO, "Testing SERVER_CHANNEL filter.");
+  g_enable_server_channel_filter = true;
+  test_server_channel_filter(config);
+  g_enable_server_channel_filter = false;
+  gpr_log(GPR_INFO, "Testing CLIENT_CHANNEL / CLIENT_DIRECT_CHANNEL filter.");
+  g_enable_client_channel_filter = true;
+  test_client_channel_filter(config);
+  g_enable_client_channel_filter = false;
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL) {
+    gpr_log(GPR_INFO, "Testing CLIENT_SUBCHANNEL filter.");
+    g_enable_client_subchannel_filter = true;
+    test_client_subchannel_filter(config);
+    g_enable_client_subchannel_filter = false;
+  }
+}
+
+void filter_call_init_fails_pre_init(void) {
+  grpc_register_plugin(init_plugin, destroy_plugin);
+}
diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c
deleted file mode 100644
index ee7aeb3..0000000
--- a/test/core/end2end/tests/filter_causes_close.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static bool g_enable_filter = false;
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Simple request via a server filter that always closes the stream.*/
-static void test_request(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "filter_causes_close", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
-  GPR_ASSERT(0 ==
-             grpc_slice_str_cmp(details, "Failure that's not preventable."));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-/*******************************************************************************
- * Test filter - always closes incoming requests
- */
-
-typedef struct { grpc_closure *recv_im_ready; } call_data;
-
-typedef struct { uint8_t unused; } channel_data;
-
-static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg,
-                          grpc_error *error) {
-  grpc_call_element *elem = (grpc_call_element *)arg;
-  call_data *calld = (call_data *)elem->call_data;
-  GRPC_CLOSURE_RUN(
-      exec_ctx, calld->recv_im_ready,
-      grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
-                             "Failure that's not preventable.", &error, 1),
-                         GRPC_ERROR_INT_GRPC_STATUS,
-                         GRPC_STATUS_PERMISSION_DENIED));
-}
-
-static void start_transport_stream_op_batch(
-    grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-    grpc_transport_stream_op_batch *op) {
-  call_data *calld = (call_data *)elem->call_data;
-  if (op->recv_initial_metadata) {
-    calld->recv_im_ready =
-        op->payload->recv_initial_metadata.recv_initial_metadata_ready;
-    op->payload->recv_initial_metadata.recv_initial_metadata_ready =
-        GRPC_CLOSURE_CREATE(recv_im_ready, elem, grpc_schedule_on_exec_ctx);
-  }
-  grpc_call_next_op(exec_ctx, elem, op);
-}
-
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  return GRPC_ERROR_NONE;
-}
-
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                              const grpc_call_final_info *final_info,
-                              grpc_closure *ignored) {}
-
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  return GRPC_ERROR_NONE;
-}
-
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {}
-
-static const grpc_channel_filter test_filter = {
-    start_transport_stream_op_batch,
-    grpc_channel_next_op,
-    sizeof(call_data),
-    init_call_elem,
-    grpc_call_stack_ignore_set_pollset_or_pollset_set,
-    destroy_call_elem,
-    sizeof(channel_data),
-    init_channel_elem,
-    destroy_channel_elem,
-    grpc_channel_next_get_info,
-    "filter_causes_close"};
-
-/*******************************************************************************
- * Registration
- */
-
-static bool maybe_add_filter(grpc_exec_ctx *exec_ctx,
-                             grpc_channel_stack_builder *builder, void *arg) {
-  if (g_enable_filter) {
-    return grpc_channel_stack_builder_prepend_filter(builder, &test_filter,
-                                                     NULL, NULL);
-  } else {
-    return true;
-  }
-}
-
-static void init_plugin(void) {
-  grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, 0, maybe_add_filter,
-                                   NULL);
-}
-
-static void destroy_plugin(void) {}
-
-void filter_causes_close(grpc_end2end_test_config config) {
-  g_enable_filter = true;
-  test_request(config);
-  g_enable_filter = false;
-}
-
-void filter_causes_close_pre_init(void) {
-  grpc_register_plugin(init_plugin, destroy_plugin);
-}
diff --git a/test/core/end2end/tests/filter_causes_close.cc b/test/core/end2end/tests/filter_causes_close.cc
new file mode 100644
index 0000000..b6cceab
--- /dev/null
+++ b/test/core/end2end/tests/filter_causes_close.cc
@@ -0,0 +1,286 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/surface/channel_init.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static bool g_enable_filter = false;
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Simple request via a server filter that always closes the stream.*/
+static void test_request(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "filter_causes_close", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_PERMISSION_DENIED);
+  GPR_ASSERT(0 ==
+             grpc_slice_str_cmp(details, "Failure that's not preventable."));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+/*******************************************************************************
+ * Test filter - always closes incoming requests
+ */
+
+typedef struct {
+  grpc_closure* recv_im_ready;
+} call_data;
+
+typedef struct {
+  uint8_t unused;
+} channel_data;
+
+static void recv_im_ready(grpc_exec_ctx* exec_ctx, void* arg,
+                          grpc_error* error) {
+  grpc_call_element* elem = (grpc_call_element*)arg;
+  call_data* calld = (call_data*)elem->call_data;
+  GRPC_CLOSURE_RUN(
+      exec_ctx, calld->recv_im_ready,
+      grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+                             "Failure that's not preventable.", &error, 1),
+                         GRPC_ERROR_INT_GRPC_STATUS,
+                         GRPC_STATUS_PERMISSION_DENIED));
+}
+
+static void start_transport_stream_op_batch(
+    grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+    grpc_transport_stream_op_batch* op) {
+  call_data* calld = (call_data*)elem->call_data;
+  if (op->recv_initial_metadata) {
+    calld->recv_im_ready =
+        op->payload->recv_initial_metadata.recv_initial_metadata_ready;
+    op->payload->recv_initial_metadata.recv_initial_metadata_ready =
+        GRPC_CLOSURE_CREATE(recv_im_ready, elem, grpc_schedule_on_exec_ctx);
+  }
+  grpc_call_next_op(exec_ctx, elem, op);
+}
+
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  return GRPC_ERROR_NONE;
+}
+
+static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                              const grpc_call_final_info* final_info,
+                              grpc_closure* ignored) {}
+
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  return GRPC_ERROR_NONE;
+}
+
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {}
+
+static const grpc_channel_filter test_filter = {
+    start_transport_stream_op_batch,
+    grpc_channel_next_op,
+    sizeof(call_data),
+    init_call_elem,
+    grpc_call_stack_ignore_set_pollset_or_pollset_set,
+    destroy_call_elem,
+    sizeof(channel_data),
+    init_channel_elem,
+    destroy_channel_elem,
+    grpc_channel_next_get_info,
+    "filter_causes_close"};
+
+/*******************************************************************************
+ * Registration
+ */
+
+static bool maybe_add_filter(grpc_exec_ctx* exec_ctx,
+                             grpc_channel_stack_builder* builder, void* arg) {
+  if (g_enable_filter) {
+    return grpc_channel_stack_builder_prepend_filter(builder, &test_filter,
+                                                     NULL, NULL);
+  } else {
+    return true;
+  }
+}
+
+static void init_plugin(void) {
+  grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, 0, maybe_add_filter,
+                                   NULL);
+}
+
+static void destroy_plugin(void) {}
+
+void filter_causes_close(grpc_end2end_test_config config) {
+  g_enable_filter = true;
+  test_request(config);
+  g_enable_filter = false;
+}
+
+void filter_causes_close_pre_init(void) {
+  grpc_register_plugin(init_plugin, destroy_plugin);
+}
diff --git a/test/core/end2end/tests/filter_latency.c b/test/core/end2end/tests/filter_latency.c
deleted file mode 100644
index c24934f..0000000
--- a/test/core/end2end/tests/filter_latency.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <limits.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "test/core/end2end/cq_verifier.h"
-
-enum { TIMEOUT = 200000 };
-
-static bool g_enable_filter = false;
-static gpr_mu g_mu;
-static gpr_timespec g_client_latency;
-static gpr_timespec g_server_latency;
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-// Simple request via a server filter that saves the reported latency value.
-static void test_request(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "filter_latency", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_mu_lock(&g_mu);
-  g_client_latency = gpr_time_0(GPR_TIMESPAN);
-  g_server_latency = gpr_time_0(GPR_TIMESPAN);
-  gpr_mu_unlock(&g_mu);
-  const gpr_timespec start_time = gpr_now(GPR_CLOCK_MONOTONIC);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr", config), deadline, NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_string = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_string;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(s);
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-
-  const gpr_timespec end_time = gpr_now(GPR_CLOCK_MONOTONIC);
-  const gpr_timespec max_latency = gpr_time_sub(end_time, start_time);
-
-  // Perform checks after test tear-down
-  // Guards against the case that there's outstanding channel-related work on a
-  // call prior to verification
-  gpr_mu_lock(&g_mu);
-  GPR_ASSERT(gpr_time_cmp(max_latency, g_client_latency) >= 0);
-  GPR_ASSERT(gpr_time_cmp(gpr_time_0(GPR_TIMESPAN), g_client_latency) <= 0);
-  GPR_ASSERT(gpr_time_cmp(max_latency, g_server_latency) >= 0);
-  GPR_ASSERT(gpr_time_cmp(gpr_time_0(GPR_TIMESPAN), g_server_latency) <= 0);
-  // Server latency should always be smaller than client latency, however since
-  // we only calculate latency at destruction time, and that might mean that we
-  // need to wait for outstanding channel-related work, this isn't verifiable
-  // right now (the server MAY hold on to the call for longer than the client).
-  // GPR_ASSERT(gpr_time_cmp(g_server_latency, g_client_latency) < 0);
-  gpr_mu_unlock(&g_mu);
-}
-
-/*******************************************************************************
- * Test latency filter
- */
-
-static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
-                                  grpc_call_element *elem,
-                                  const grpc_call_element_args *args) {
-  return GRPC_ERROR_NONE;
-}
-
-static void client_destroy_call_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_element *elem,
-                                     const grpc_call_final_info *final_info,
-                                     grpc_closure *ignored) {
-  gpr_mu_lock(&g_mu);
-  g_client_latency = final_info->stats.latency;
-  gpr_mu_unlock(&g_mu);
-}
-
-static void server_destroy_call_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_call_element *elem,
-                                     const grpc_call_final_info *final_info,
-                                     grpc_closure *ignored) {
-  gpr_mu_lock(&g_mu);
-  g_server_latency = final_info->stats.latency;
-  gpr_mu_unlock(&g_mu);
-}
-
-static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
-                                     grpc_channel_element *elem,
-                                     grpc_channel_element_args *args) {
-  return GRPC_ERROR_NONE;
-}
-
-static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
-                                 grpc_channel_element *elem) {}
-
-static const grpc_channel_filter test_client_filter = {
-    grpc_call_next_op,
-    grpc_channel_next_op,
-    0,
-    init_call_elem,
-    grpc_call_stack_ignore_set_pollset_or_pollset_set,
-    client_destroy_call_elem,
-    0,
-    init_channel_elem,
-    destroy_channel_elem,
-    grpc_channel_next_get_info,
-    "client_filter_latency"};
-
-static const grpc_channel_filter test_server_filter = {
-    grpc_call_next_op,
-    grpc_channel_next_op,
-    0,
-    init_call_elem,
-    grpc_call_stack_ignore_set_pollset_or_pollset_set,
-    server_destroy_call_elem,
-    0,
-    init_channel_elem,
-    destroy_channel_elem,
-    grpc_channel_next_get_info,
-    "server_filter_latency"};
-
-/*******************************************************************************
- * Registration
- */
-
-static bool maybe_add_filter(grpc_exec_ctx *exec_ctx,
-                             grpc_channel_stack_builder *builder, void *arg) {
-  grpc_channel_filter *filter = (grpc_channel_filter *)arg;
-  if (g_enable_filter) {
-    // Want to add the filter as close to the end as possible, to make
-    // sure that all of the filters work well together.  However, we
-    // can't add it at the very end, because the connected channel filter
-    // must be the last one.  So we add it right before the last one.
-    grpc_channel_stack_builder_iterator *it =
-        grpc_channel_stack_builder_create_iterator_at_last(builder);
-    GPR_ASSERT(grpc_channel_stack_builder_move_prev(it));
-    const bool retval =
-        grpc_channel_stack_builder_add_filter_before(it, filter, NULL, NULL);
-    grpc_channel_stack_builder_iterator_destroy(it);
-    return retval;
-  } else {
-    return true;
-  }
-}
-
-static void init_plugin(void) {
-  gpr_mu_init(&g_mu);
-  grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX,
-                                   maybe_add_filter,
-                                   (void *)&test_client_filter);
-  grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
-                                   maybe_add_filter,
-                                   (void *)&test_client_filter);
-  grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
-                                   maybe_add_filter,
-                                   (void *)&test_server_filter);
-}
-
-static void destroy_plugin(void) { gpr_mu_destroy(&g_mu); }
-
-void filter_latency(grpc_end2end_test_config config) {
-  g_enable_filter = true;
-  test_request(config);
-  g_enable_filter = false;
-}
-
-void filter_latency_pre_init(void) {
-  grpc_register_plugin(init_plugin, destroy_plugin);
-}
diff --git a/test/core/end2end/tests/filter_latency.cc b/test/core/end2end/tests/filter_latency.cc
new file mode 100644
index 0000000..e8ec188
--- /dev/null
+++ b/test/core/end2end/tests/filter_latency.cc
@@ -0,0 +1,356 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <limits.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/surface/channel_init.h"
+#include "test/core/end2end/cq_verifier.h"
+
+enum { TIMEOUT = 200000 };
+
+static bool g_enable_filter = false;
+static gpr_mu g_mu;
+static gpr_timespec g_client_latency;
+static gpr_timespec g_server_latency;
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+// Simple request via a server filter that saves the reported latency value.
+static void test_request(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "filter_latency", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_mu_lock(&g_mu);
+  g_client_latency = gpr_time_0(GPR_TIMESPAN);
+  g_server_latency = gpr_time_0(GPR_TIMESPAN);
+  gpr_mu_unlock(&g_mu);
+  const gpr_timespec start_time = gpr_now(GPR_CLOCK_MONOTONIC);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr", config), deadline, NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_string = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_string;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(s);
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+
+  const gpr_timespec end_time = gpr_now(GPR_CLOCK_MONOTONIC);
+  const gpr_timespec max_latency = gpr_time_sub(end_time, start_time);
+
+  // Perform checks after test tear-down
+  // Guards against the case that there's outstanding channel-related work on a
+  // call prior to verification
+  gpr_mu_lock(&g_mu);
+  GPR_ASSERT(gpr_time_cmp(max_latency, g_client_latency) >= 0);
+  GPR_ASSERT(gpr_time_cmp(gpr_time_0(GPR_TIMESPAN), g_client_latency) <= 0);
+  GPR_ASSERT(gpr_time_cmp(max_latency, g_server_latency) >= 0);
+  GPR_ASSERT(gpr_time_cmp(gpr_time_0(GPR_TIMESPAN), g_server_latency) <= 0);
+  // Server latency should always be smaller than client latency, however since
+  // we only calculate latency at destruction time, and that might mean that we
+  // need to wait for outstanding channel-related work, this isn't verifiable
+  // right now (the server MAY hold on to the call for longer than the client).
+  // GPR_ASSERT(gpr_time_cmp(g_server_latency, g_client_latency) < 0);
+  gpr_mu_unlock(&g_mu);
+}
+
+/*******************************************************************************
+ * Test latency filter
+ */
+
+static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
+                                  grpc_call_element* elem,
+                                  const grpc_call_element_args* args) {
+  return GRPC_ERROR_NONE;
+}
+
+static void client_destroy_call_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_call_element* elem,
+                                     const grpc_call_final_info* final_info,
+                                     grpc_closure* ignored) {
+  gpr_mu_lock(&g_mu);
+  g_client_latency = final_info->stats.latency;
+  gpr_mu_unlock(&g_mu);
+}
+
+static void server_destroy_call_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_call_element* elem,
+                                     const grpc_call_final_info* final_info,
+                                     grpc_closure* ignored) {
+  gpr_mu_lock(&g_mu);
+  g_server_latency = final_info->stats.latency;
+  gpr_mu_unlock(&g_mu);
+}
+
+static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
+                                     grpc_channel_element* elem,
+                                     grpc_channel_element_args* args) {
+  return GRPC_ERROR_NONE;
+}
+
+static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
+                                 grpc_channel_element* elem) {}
+
+static const grpc_channel_filter test_client_filter = {
+    grpc_call_next_op,
+    grpc_channel_next_op,
+    0,
+    init_call_elem,
+    grpc_call_stack_ignore_set_pollset_or_pollset_set,
+    client_destroy_call_elem,
+    0,
+    init_channel_elem,
+    destroy_channel_elem,
+    grpc_channel_next_get_info,
+    "client_filter_latency"};
+
+static const grpc_channel_filter test_server_filter = {
+    grpc_call_next_op,
+    grpc_channel_next_op,
+    0,
+    init_call_elem,
+    grpc_call_stack_ignore_set_pollset_or_pollset_set,
+    server_destroy_call_elem,
+    0,
+    init_channel_elem,
+    destroy_channel_elem,
+    grpc_channel_next_get_info,
+    "server_filter_latency"};
+
+/*******************************************************************************
+ * Registration
+ */
+
+static bool maybe_add_filter(grpc_exec_ctx* exec_ctx,
+                             grpc_channel_stack_builder* builder, void* arg) {
+  grpc_channel_filter* filter = (grpc_channel_filter*)arg;
+  if (g_enable_filter) {
+    // Want to add the filter as close to the end as possible, to make
+    // sure that all of the filters work well together.  However, we
+    // can't add it at the very end, because the connected channel filter
+    // must be the last one.  So we add it right before the last one.
+    grpc_channel_stack_builder_iterator* it =
+        grpc_channel_stack_builder_create_iterator_at_last(builder);
+    GPR_ASSERT(grpc_channel_stack_builder_move_prev(it));
+    const bool retval =
+        grpc_channel_stack_builder_add_filter_before(it, filter, NULL, NULL);
+    grpc_channel_stack_builder_iterator_destroy(it);
+    return retval;
+  } else {
+    return true;
+  }
+}
+
+static void init_plugin(void) {
+  gpr_mu_init(&g_mu);
+  grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX,
+                                   maybe_add_filter,
+                                   (void*)&test_client_filter);
+  grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
+                                   maybe_add_filter,
+                                   (void*)&test_client_filter);
+  grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
+                                   maybe_add_filter,
+                                   (void*)&test_server_filter);
+}
+
+static void destroy_plugin(void) { gpr_mu_destroy(&g_mu); }
+
+void filter_latency(grpc_end2end_test_config config) {
+  g_enable_filter = true;
+  test_request(config);
+  g_enable_filter = false;
+}
+
+void filter_latency_pre_init(void) {
+  grpc_register_plugin(init_plugin, destroy_plugin);
+}
diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c
deleted file mode 100644
index 9b3ff98..0000000
--- a/test/core/end2end/tests/graceful_server_shutdown.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  /* Note: shutdown_cq is not used in this test */
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void test_early_server_shutdown_finishes_inflight_calls(
-    grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = n_seconds_from_now(10);
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  /* shutdown and destroy the server */
-  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
-  cq_verify_empty(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  grpc_call_unref(s);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void graceful_server_shutdown(grpc_end2end_test_config config) {
-  test_early_server_shutdown_finishes_inflight_calls(config);
-}
-
-void graceful_server_shutdown_pre_init(void) {}
diff --git a/test/core/end2end/tests/graceful_server_shutdown.cc b/test/core/end2end/tests/graceful_server_shutdown.cc
new file mode 100644
index 0000000..22bdac4
--- /dev/null
+++ b/test/core/end2end/tests/graceful_server_shutdown.cc
@@ -0,0 +1,206 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  /* Note: shutdown_cq is not used in this test */
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void test_early_server_shutdown_finishes_inflight_calls(
+    grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = n_seconds_from_now(10);
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  /* shutdown and destroy the server */
+  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
+  cq_verify_empty(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  grpc_call_unref(s);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void graceful_server_shutdown(grpc_end2end_test_config config) {
+  test_early_server_shutdown_finishes_inflight_calls(config);
+}
+
+void graceful_server_shutdown_pre_init(void) {}
diff --git a/test/core/end2end/tests/high_initial_seqno.c b/test/core/end2end/tests/high_initial_seqno.c
deleted file mode 100644
index 04b9483..0000000
--- a/test/core/end2end/tests/high_initial_seqno.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  /* TODO(ctiller): this rate limits the test, and it should be removed when
-                    retry has been implemented; until then cross-thread chatter
-                    may result in some requests needing to be cancelled due to
-                    seqno exhaustion. */
-  cq_verify_empty(cqv);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_10_simple_requests(grpc_end2end_test_config config,
-                                           int initial_sequence_number) {
-  int i;
-  grpc_end2end_test_fixture f;
-  grpc_arg client_arg;
-  grpc_channel_args client_args;
-  char *name;
-
-  client_arg.type = GRPC_ARG_INTEGER;
-  client_arg.key = GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER;
-  client_arg.value.integer = initial_sequence_number;
-
-  client_args.num_args = 1;
-  client_args.args = &client_arg;
-
-  gpr_asprintf(&name, "test_invoke_requests first_seqno=%d",
-               initial_sequence_number);
-  f = begin_test(config, name, &client_args, NULL);
-  for (i = 0; i < 10; i++) {
-    simple_request_body(config, f);
-    gpr_log(GPR_INFO, "Running test: Passed simple request %d", i);
-  }
-  end_test(&f);
-  config.tear_down_data(&f);
-  gpr_free(name);
-}
-
-void high_initial_seqno(grpc_end2end_test_config config) {
-  test_invoke_10_simple_requests(config, 16777213);
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION) {
-    test_invoke_10_simple_requests(config, 2147483645);
-  }
-}
-
-void high_initial_seqno_pre_init(void) {}
diff --git a/test/core/end2end/tests/high_initial_seqno.cc b/test/core/end2end/tests/high_initial_seqno.cc
new file mode 100644
index 0000000..72f1d0f
--- /dev/null
+++ b/test/core/end2end/tests/high_initial_seqno.cc
@@ -0,0 +1,239 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  /* TODO(ctiller): this rate limits the test, and it should be removed when
+                    retry has been implemented; until then cross-thread chatter
+                    may result in some requests needing to be cancelled due to
+                    seqno exhaustion. */
+  cq_verify_empty(cqv);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_10_simple_requests(grpc_end2end_test_config config,
+                                           int initial_sequence_number) {
+  int i;
+  grpc_end2end_test_fixture f;
+  grpc_arg client_arg;
+  grpc_channel_args client_args;
+  char* name;
+
+  client_arg.type = GRPC_ARG_INTEGER;
+  client_arg.key = const_cast<char*>(GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER);
+  client_arg.value.integer = initial_sequence_number;
+
+  client_args.num_args = 1;
+  client_args.args = &client_arg;
+
+  gpr_asprintf(&name, "test_invoke_requests first_seqno=%d",
+               initial_sequence_number);
+  f = begin_test(config, name, &client_args, NULL);
+  for (i = 0; i < 10; i++) {
+    simple_request_body(config, f);
+    gpr_log(GPR_INFO, "Running test: Passed simple request %d", i);
+  }
+  end_test(&f);
+  config.tear_down_data(&f);
+  gpr_free(name);
+}
+
+void high_initial_seqno(grpc_end2end_test_config config) {
+  test_invoke_10_simple_requests(config, 16777213);
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION) {
+    test_invoke_10_simple_requests(config, 2147483645);
+  }
+}
+
+void high_initial_seqno_pre_init(void) {}
diff --git a/test/core/end2end/tests/hpack_size.c b/test/core/end2end/tests/hpack_size.c
deleted file mode 100644
index 9358c11..0000000
--- a/test/core/end2end/tests/hpack_size.c
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-const char *hobbits[][2] = {
-    {"Adaldrida", "Brandybuck"}, {"Adamanta", "Took"},
-    {"Adalgrim", "Took"},        {"Adelard", "Took"},
-    {"Amaranth", "Brandybuck"},  {"Andwise", "Roper"},
-    {"Angelica", "Baggins"},     {"Asphodel", "Burrows"},
-    {"Balbo", "Baggins"},        {"Bandobras", "Took"},
-    {"Belba", "Bolger"},         {"Bell", "Gamgee"},
-    {"Belladonna", "Baggins"},   {"Berylla", "Baggins"},
-    {"Bilbo", "Baggins"},        {"Bilbo", "Gardner"},
-    {"Bill", "Butcher"},         {"Bingo", "Baggins"},
-    {"Bodo", "Proudfoot"},       {"Bowman", "Cotton"},
-    {"Bungo", "Baggins"},        {"Camellia", "Sackville"},
-    {"Carl", "Cotton"},          {"Celandine", "Brandybuck"},
-    {"Chica", "Baggins"},        {"Daddy", "Twofoot"},
-    {"Daisy", "Boffin"},         {"Diamond", "Took"},
-    {"Dinodas", "Brandybuck"},   {"Doderic", "Brandybuck"},
-    {"Dodinas", "Brandybuck"},   {"Donnamira", "Boffin"},
-    {"Dora", "Baggins"},         {"Drogo", "Baggins"},
-    {"Dudo", "Baggins"},         {"Eglantine", "Took"},
-    {"Elanor", "Fairbairn"},     {"Elfstan", "Fairbairn"},
-    {"Esmeralda", "Brandybuck"}, {"Estella", "Brandybuck"},
-    {"Everard", "Took"},         {"Falco", "Chubb-Baggins"},
-    {"Faramir", "Took"},         {"Farmer", "Maggot"},
-    {"Fastolph", "Bolger"},      {"Ferdibrand", "Took"},
-    {"Ferdinand", "Took"},       {"Ferumbras", "Took"},
-    {"Ferumbras", "Took"},       {"Filibert", "Bolger"},
-    {"Firiel", "Fairbairn"},     {"Flambard", "Took"},
-    {"Folco", "Boffin"},         {"Fortinbras", "Took"},
-    {"Fortinbras", "Took"},      {"Fosco", "Baggins"},
-    {"Fredegar", "Bolger"},      {"Frodo", "Baggins"},
-    {"Frodo", "Gardner"},        {"Gerontius", "Took"},
-    {"Gilly", "Baggins"},        {"Goldilocks", "Took"},
-    {"Gorbadoc", "Brandybuck"},  {"Gorbulas", "Brandybuck"},
-    {"Gorhendad", "Brandybuck"}, {"Gormadoc", "Brandybuck"},
-    {"Griffo", "Boffin"},        {"Halfast", "Gamgee"},
-    {"Halfred", "Gamgee"},       {"Halfred", "Greenhand"},
-    {"Hanna", "Brandybuck"},     {"Hamfast", "Gamgee"},
-    {"Hamfast", "Gardner"},      {"Hamson", "Gamgee"},
-    {"Harding", "Gardner"},      {"Hilda", "Brandybuck"},
-    {"Hildibrand", "Took"},      {"Hildifons", "Took"},
-    {"Hildigard", "Took"},       {"Hildigrim", "Took"},
-    {"Hob", "Gammidge"},         {"Hob", "Hayward"},
-    {"Hobson", "Gamgee"},        {"Holfast", "Gardner"},
-    {"Holman", "Cotton"},        {"Holman", "Greenhand"},
-    {"Hugo", "Boffin"},          {"Hugo", "Bracegirdle"},
-    {"Ilberic", "Brandybuck"},   {"Isembard", "Took"},
-    {"Isembold", "Took"},        {"Isengar", "Took"},
-    {"Isengrim", "Took"},        {"Isengrim", "Took"},
-    {"Isumbras", "Took"},        {"Isumbras", "Took"},
-    {"Jolly", "Cotton"},
-    /*
-    {"Lalia", "Took"},
-    {"Largo", "Baggins"},
-    {"Laura", "Baggins"},
-    {"Lily", "Goodbody"},
-    {"Lily", "Cotton"},
-    {"Linda", "Proudfoot"},
-    {"Lobelia", "Sackville-Baggins"},
-    {"Longo", "Baggins"},
-    {"Lotho", "Sackville-Baggins"},
-    {"Madoc", "Brandybuck"},
-    {"Malva", "Brandybuck"},
-    {"Marigold", "Cotton"},
-    {"Marmadas", "Brandybuck"},
-    {"Marmadoc", "Brandybuck"},
-    {"Marroc", "Brandybuck"},
-    {"May", "Gamgee"},
-    {"Melilot", "Brandybuck"},
-    {"Menegilda", "Brandybuck"},
-    {"Mentha", "Brandybuck"},
-    {"Meriadoc", "Brandybuck"},
-    {"Merimac", "Brandybuck"},
-    {"Merimas", "Brandybuck"},
-    {"Merry", "Gardner"},
-    {"Milo", "Burrows"},
-    {"Mimosa", "Baggins"},
-    {"Minto", "Burrows"},
-    {"Mirabella", "Brandybuck"},
-    {"Moro", "Burrows"},
-    {"Mosco", "Burrows"},
-    {"Mungo", "Baggins"},
-    {"Myrtle", "Burrows"},
-    {"Odo", "Proudfoot"},
-    {"Odovacar", "Bolger"},
-    {"Olo", "Proudfoot"},
-    {"Orgulas", "Brandybuck"},
-    {"Otho", "Sackville-Baggins"},
-    {"Paladin", "Took"},
-    {"Pansy", "Bolger"},
-    {"Pearl", "Took"},
-    {"Peony", "Burrows"},
-    {"Peregrin", "Took"},
-    {"Pervinca", "Took"},
-    {"Pimpernel", "Took"},
-    {"Pippin", "Gardner"},
-    {"Polo", "Baggins"},
-    {"Ponto", "Baggins"},
-    {"Porto", "Baggins"},
-    {"Posco", "Baggins"},
-    {"Poppy", "Bolger"},
-    {"Primrose", "Gardner"},
-    {"Primula", "Baggins"},
-    {"Prisca", "Bolger"},
-    {"Reginard", "Took"},
-    {"Robin", "Smallburrow"},
-    {"Robin", "Gardner"},
-    {"Rorimac", "Brandybuck"},
-    {"Rosa", "Took"},
-    {"Rosamunda", "Bolger"},
-    {"Rose", "Gardner"},
-    {"Ruby", "Baggins"},
-    {"Ruby", "Gardner"},
-    {"Rudigar", "Bolger"},
-    {"Rufus", "Burrows"},
-    {"Sadoc", "Brandybuck"},
-    {"Salvia", "Bolger"},
-    {"Samwise", "Gamgee"},
-    {"Sancho", "Proudfoot"},
-    {"Saradas", "Brandybuck"},
-    {"Saradoc", "Brandybuck"},
-    {"Seredic", "Brandybuck"},
-    {"Sigismond", "Took"},
-    {"Smeagol", "Gollum"},
-    {"Tanta", "Baggins"},
-    {"Ted", "Sandyman"},
-    {"Tobold", "Hornblower"},
-    {"Togo", "Goodbody"},
-    {"Tolman", "Cotton"},
-    {"Tolman", "Gardner"},
-    {"Widow", "Rumble"},
-    {"Wilcome", "Cotton"},
-    {"Wilcome", "Cotton"},
-    {"Wilibald", "Bolger"},
-    {"Will", "Whitfoot"},
-    {"Wiseman", "Gamwich"}*/
-};
-
-const char *dragons[] = {"Ancalagon", "Glaurung", "Scatha",
-                         "Smaug the Magnificent"};
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f, size_t index) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_metadata extra_metadata[3];
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  memset(extra_metadata, 0, sizeof(extra_metadata));
-  extra_metadata[0].key = grpc_slice_from_static_string("hobbit-first-name");
-  extra_metadata[0].value = grpc_slice_from_static_string(
-      hobbits[index % GPR_ARRAY_SIZE(hobbits)][0]);
-  extra_metadata[1].key = grpc_slice_from_static_string("hobbit-second-name");
-  extra_metadata[1].value = grpc_slice_from_static_string(
-      hobbits[index % GPR_ARRAY_SIZE(hobbits)][1]);
-  extra_metadata[2].key = grpc_slice_from_static_string("dragon");
-  extra_metadata[2].value =
-      grpc_slice_from_static_string(dragons[index % GPR_ARRAY_SIZE(dragons)]);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = GPR_ARRAY_SIZE(extra_metadata);
-  op->data.send_initial_metadata.metadata = extra_metadata;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_size(grpc_end2end_test_config config, int encode_size,
-                      int decode_size) {
-  size_t i;
-  grpc_end2end_test_fixture f;
-  grpc_arg server_arg;
-  grpc_channel_args server_args;
-  grpc_arg client_arg;
-  grpc_channel_args client_args;
-  char *name;
-
-  server_arg.type = GRPC_ARG_INTEGER;
-  server_arg.key = GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER;
-  server_arg.value.integer = decode_size;
-  server_args.num_args = 1;
-  server_args.args = &server_arg;
-
-  client_arg.type = GRPC_ARG_INTEGER;
-  client_arg.key = GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER;
-  client_arg.value.integer = encode_size;
-  client_args.num_args = 1;
-  client_args.args = &client_arg;
-
-  gpr_asprintf(&name, "test_size:e=%d:d=%d", encode_size, decode_size);
-  f = begin_test(config, name, encode_size != 4096 ? &client_args : NULL,
-                 decode_size != 4096 ? &server_args : NULL);
-  for (i = 0; i < 4 * GPR_ARRAY_SIZE(hobbits); i++) {
-    simple_request_body(config, f, i);
-  }
-  end_test(&f);
-  config.tear_down_data(&f);
-  gpr_free(name);
-}
-
-void hpack_size(grpc_end2end_test_config config) {
-  static const int interesting_sizes[] = {4096, 0,     100,
-                                          1000, 32768, 4 * 1024 * 1024};
-  size_t i, j;
-
-  for (i = 0; i < GPR_ARRAY_SIZE(interesting_sizes); i++) {
-    for (j = 0; j < GPR_ARRAY_SIZE(interesting_sizes); j++) {
-      test_size(config, interesting_sizes[i], interesting_sizes[j]);
-    }
-  }
-}
-
-void hpack_size_pre_init(void) {}
diff --git a/test/core/end2end/tests/hpack_size.cc b/test/core/end2end/tests/hpack_size.cc
new file mode 100644
index 0000000..b2c683e
--- /dev/null
+++ b/test/core/end2end/tests/hpack_size.cc
@@ -0,0 +1,397 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+const char* hobbits[][2] = {
+    {"Adaldrida", "Brandybuck"}, {"Adamanta", "Took"},
+    {"Adalgrim", "Took"},        {"Adelard", "Took"},
+    {"Amaranth", "Brandybuck"},  {"Andwise", "Roper"},
+    {"Angelica", "Baggins"},     {"Asphodel", "Burrows"},
+    {"Balbo", "Baggins"},        {"Bandobras", "Took"},
+    {"Belba", "Bolger"},         {"Bell", "Gamgee"},
+    {"Belladonna", "Baggins"},   {"Berylla", "Baggins"},
+    {"Bilbo", "Baggins"},        {"Bilbo", "Gardner"},
+    {"Bill", "Butcher"},         {"Bingo", "Baggins"},
+    {"Bodo", "Proudfoot"},       {"Bowman", "Cotton"},
+    {"Bungo", "Baggins"},        {"Camellia", "Sackville"},
+    {"Carl", "Cotton"},          {"Celandine", "Brandybuck"},
+    {"Chica", "Baggins"},        {"Daddy", "Twofoot"},
+    {"Daisy", "Boffin"},         {"Diamond", "Took"},
+    {"Dinodas", "Brandybuck"},   {"Doderic", "Brandybuck"},
+    {"Dodinas", "Brandybuck"},   {"Donnamira", "Boffin"},
+    {"Dora", "Baggins"},         {"Drogo", "Baggins"},
+    {"Dudo", "Baggins"},         {"Eglantine", "Took"},
+    {"Elanor", "Fairbairn"},     {"Elfstan", "Fairbairn"},
+    {"Esmeralda", "Brandybuck"}, {"Estella", "Brandybuck"},
+    {"Everard", "Took"},         {"Falco", "Chubb-Baggins"},
+    {"Faramir", "Took"},         {"Farmer", "Maggot"},
+    {"Fastolph", "Bolger"},      {"Ferdibrand", "Took"},
+    {"Ferdinand", "Took"},       {"Ferumbras", "Took"},
+    {"Ferumbras", "Took"},       {"Filibert", "Bolger"},
+    {"Firiel", "Fairbairn"},     {"Flambard", "Took"},
+    {"Folco", "Boffin"},         {"Fortinbras", "Took"},
+    {"Fortinbras", "Took"},      {"Fosco", "Baggins"},
+    {"Fredegar", "Bolger"},      {"Frodo", "Baggins"},
+    {"Frodo", "Gardner"},        {"Gerontius", "Took"},
+    {"Gilly", "Baggins"},        {"Goldilocks", "Took"},
+    {"Gorbadoc", "Brandybuck"},  {"Gorbulas", "Brandybuck"},
+    {"Gorhendad", "Brandybuck"}, {"Gormadoc", "Brandybuck"},
+    {"Griffo", "Boffin"},        {"Halfast", "Gamgee"},
+    {"Halfred", "Gamgee"},       {"Halfred", "Greenhand"},
+    {"Hanna", "Brandybuck"},     {"Hamfast", "Gamgee"},
+    {"Hamfast", "Gardner"},      {"Hamson", "Gamgee"},
+    {"Harding", "Gardner"},      {"Hilda", "Brandybuck"},
+    {"Hildibrand", "Took"},      {"Hildifons", "Took"},
+    {"Hildigard", "Took"},       {"Hildigrim", "Took"},
+    {"Hob", "Gammidge"},         {"Hob", "Hayward"},
+    {"Hobson", "Gamgee"},        {"Holfast", "Gardner"},
+    {"Holman", "Cotton"},        {"Holman", "Greenhand"},
+    {"Hugo", "Boffin"},          {"Hugo", "Bracegirdle"},
+    {"Ilberic", "Brandybuck"},   {"Isembard", "Took"},
+    {"Isembold", "Took"},        {"Isengar", "Took"},
+    {"Isengrim", "Took"},        {"Isengrim", "Took"},
+    {"Isumbras", "Took"},        {"Isumbras", "Took"},
+    {"Jolly", "Cotton"},
+    /*
+    {"Lalia", "Took"},
+    {"Largo", "Baggins"},
+    {"Laura", "Baggins"},
+    {"Lily", "Goodbody"},
+    {"Lily", "Cotton"},
+    {"Linda", "Proudfoot"},
+    {"Lobelia", "Sackville-Baggins"},
+    {"Longo", "Baggins"},
+    {"Lotho", "Sackville-Baggins"},
+    {"Madoc", "Brandybuck"},
+    {"Malva", "Brandybuck"},
+    {"Marigold", "Cotton"},
+    {"Marmadas", "Brandybuck"},
+    {"Marmadoc", "Brandybuck"},
+    {"Marroc", "Brandybuck"},
+    {"May", "Gamgee"},
+    {"Melilot", "Brandybuck"},
+    {"Menegilda", "Brandybuck"},
+    {"Mentha", "Brandybuck"},
+    {"Meriadoc", "Brandybuck"},
+    {"Merimac", "Brandybuck"},
+    {"Merimas", "Brandybuck"},
+    {"Merry", "Gardner"},
+    {"Milo", "Burrows"},
+    {"Mimosa", "Baggins"},
+    {"Minto", "Burrows"},
+    {"Mirabella", "Brandybuck"},
+    {"Moro", "Burrows"},
+    {"Mosco", "Burrows"},
+    {"Mungo", "Baggins"},
+    {"Myrtle", "Burrows"},
+    {"Odo", "Proudfoot"},
+    {"Odovacar", "Bolger"},
+    {"Olo", "Proudfoot"},
+    {"Orgulas", "Brandybuck"},
+    {"Otho", "Sackville-Baggins"},
+    {"Paladin", "Took"},
+    {"Pansy", "Bolger"},
+    {"Pearl", "Took"},
+    {"Peony", "Burrows"},
+    {"Peregrin", "Took"},
+    {"Pervinca", "Took"},
+    {"Pimpernel", "Took"},
+    {"Pippin", "Gardner"},
+    {"Polo", "Baggins"},
+    {"Ponto", "Baggins"},
+    {"Porto", "Baggins"},
+    {"Posco", "Baggins"},
+    {"Poppy", "Bolger"},
+    {"Primrose", "Gardner"},
+    {"Primula", "Baggins"},
+    {"Prisca", "Bolger"},
+    {"Reginard", "Took"},
+    {"Robin", "Smallburrow"},
+    {"Robin", "Gardner"},
+    {"Rorimac", "Brandybuck"},
+    {"Rosa", "Took"},
+    {"Rosamunda", "Bolger"},
+    {"Rose", "Gardner"},
+    {"Ruby", "Baggins"},
+    {"Ruby", "Gardner"},
+    {"Rudigar", "Bolger"},
+    {"Rufus", "Burrows"},
+    {"Sadoc", "Brandybuck"},
+    {"Salvia", "Bolger"},
+    {"Samwise", "Gamgee"},
+    {"Sancho", "Proudfoot"},
+    {"Saradas", "Brandybuck"},
+    {"Saradoc", "Brandybuck"},
+    {"Seredic", "Brandybuck"},
+    {"Sigismond", "Took"},
+    {"Smeagol", "Gollum"},
+    {"Tanta", "Baggins"},
+    {"Ted", "Sandyman"},
+    {"Tobold", "Hornblower"},
+    {"Togo", "Goodbody"},
+    {"Tolman", "Cotton"},
+    {"Tolman", "Gardner"},
+    {"Widow", "Rumble"},
+    {"Wilcome", "Cotton"},
+    {"Wilcome", "Cotton"},
+    {"Wilibald", "Bolger"},
+    {"Will", "Whitfoot"},
+    {"Wiseman", "Gamwich"}*/
+};
+
+const char* dragons[] = {"Ancalagon", "Glaurung", "Scatha",
+                         "Smaug the Magnificent"};
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f, size_t index) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_metadata extra_metadata[3];
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  memset(extra_metadata, 0, sizeof(extra_metadata));
+  extra_metadata[0].key = grpc_slice_from_static_string("hobbit-first-name");
+  extra_metadata[0].value = grpc_slice_from_static_string(
+      hobbits[index % GPR_ARRAY_SIZE(hobbits)][0]);
+  extra_metadata[1].key = grpc_slice_from_static_string("hobbit-second-name");
+  extra_metadata[1].value = grpc_slice_from_static_string(
+      hobbits[index % GPR_ARRAY_SIZE(hobbits)][1]);
+  extra_metadata[2].key = grpc_slice_from_static_string("dragon");
+  extra_metadata[2].value =
+      grpc_slice_from_static_string(dragons[index % GPR_ARRAY_SIZE(dragons)]);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = GPR_ARRAY_SIZE(extra_metadata);
+  op->data.send_initial_metadata.metadata = extra_metadata;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_size(grpc_end2end_test_config config, int encode_size,
+                      int decode_size) {
+  size_t i;
+  grpc_end2end_test_fixture f;
+  grpc_arg server_arg;
+  grpc_channel_args server_args;
+  grpc_arg client_arg;
+  grpc_channel_args client_args;
+  char* name;
+
+  server_arg.type = GRPC_ARG_INTEGER;
+  server_arg.key = const_cast<char*>(GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER);
+  server_arg.value.integer = decode_size;
+  server_args.num_args = 1;
+  server_args.args = &server_arg;
+
+  client_arg.type = GRPC_ARG_INTEGER;
+  client_arg.key = const_cast<char*>(GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER);
+  client_arg.value.integer = encode_size;
+  client_args.num_args = 1;
+  client_args.args = &client_arg;
+
+  gpr_asprintf(&name, "test_size:e=%d:d=%d", encode_size, decode_size);
+  f = begin_test(config, name, encode_size != 4096 ? &client_args : NULL,
+                 decode_size != 4096 ? &server_args : NULL);
+  for (i = 0; i < 4 * GPR_ARRAY_SIZE(hobbits); i++) {
+    simple_request_body(config, f, i);
+  }
+  end_test(&f);
+  config.tear_down_data(&f);
+  gpr_free(name);
+}
+
+void hpack_size(grpc_end2end_test_config config) {
+  static const int interesting_sizes[] = {4096, 0,     100,
+                                          1000, 32768, 4 * 1024 * 1024};
+  size_t i, j;
+
+  for (i = 0; i < GPR_ARRAY_SIZE(interesting_sizes); i++) {
+    for (j = 0; j < GPR_ARRAY_SIZE(interesting_sizes); j++) {
+      test_size(config, interesting_sizes[i], interesting_sizes[j]);
+    }
+  }
+}
+
+void hpack_size_pre_init(void) {}
diff --git a/test/core/end2end/tests/idempotent_request.c b/test/core/end2end/tests/idempotent_request.c
deleted file mode 100644
index 829ece6..0000000
--- a/test/core/end2end/tests/idempotent_request.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  char *peer;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
-  gpr_free(peer);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  peer = grpc_call_get_peer(s);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
-  gpr_free(peer);
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
-  gpr_free(peer);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST == call_details.flags);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_simple_request(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-
-  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
-  simple_request_body(config, f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
-  int i;
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
-  for (i = 0; i < 10; i++) {
-    simple_request_body(config, f);
-    gpr_log(GPR_INFO, "Passed simple request %d", i);
-  }
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void idempotent_request(grpc_end2end_test_config config) {
-  int i;
-  for (i = 0; i < 10; i++) {
-    test_invoke_simple_request(config);
-  }
-  test_invoke_10_simple_requests(config);
-}
-
-void idempotent_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/idempotent_request.cc b/test/core/end2end/tests/idempotent_request.cc
new file mode 100644
index 0000000..4f61caa
--- /dev/null
+++ b/test/core/end2end/tests/idempotent_request.cc
@@ -0,0 +1,242 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  char* peer;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
+  gpr_free(peer);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  peer = grpc_call_get_peer(s);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
+  gpr_free(peer);
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
+  gpr_free(peer);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST == call_details.flags);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_simple_request(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+
+  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
+  simple_request_body(config, f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
+  int i;
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
+  for (i = 0; i < 10; i++) {
+    simple_request_body(config, f);
+    gpr_log(GPR_INFO, "Passed simple request %d", i);
+  }
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void idempotent_request(grpc_end2end_test_config config) {
+  int i;
+  for (i = 0; i < 10; i++) {
+    test_invoke_simple_request(config);
+  }
+  test_invoke_10_simple_requests(config);
+}
+
+void idempotent_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c
deleted file mode 100644
index ff269fa..0000000
--- a/test/core/end2end/tests/invoke_large_request.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, n_seconds_from_now(5), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static grpc_slice large_slice(void) {
-  grpc_slice slice = grpc_slice_malloc(1000000);
-  memset(GRPC_SLICE_START_PTR(slice), 'x', GRPC_SLICE_LENGTH(slice));
-  return slice;
-}
-
-static void test_invoke_large_request(grpc_end2end_test_config config,
-                                      int max_frame_size, int lookahead_bytes) {
-  char *name;
-  gpr_asprintf(&name,
-               "test_invoke_large_request:max_frame_size=%d:lookahead_bytes=%d",
-               max_frame_size, lookahead_bytes);
-
-  grpc_arg args[2];
-  args[0].type = GRPC_ARG_INTEGER;
-  args[0].key = GRPC_ARG_HTTP2_MAX_FRAME_SIZE;
-  args[0].value.integer = max_frame_size;
-  args[1].type = GRPC_ARG_INTEGER;
-  args[1].key = GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES;
-  args[1].value.integer = lookahead_bytes;
-  grpc_channel_args channel_args = {GPR_ARRAY_SIZE(args), args};
-
-  grpc_end2end_test_fixture f =
-      begin_test(config, name, &channel_args, &channel_args);
-  gpr_free(name);
-
-  grpc_slice request_payload_slice = large_slice();
-  grpc_slice response_payload_slice = large_slice();
-  grpc_call *c;
-  grpc_call *s;
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = n_seconds_from_now(30);
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  grpc_slice_unref(request_payload_slice);
-  grpc_slice_unref(response_payload_slice);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void invoke_large_request(grpc_end2end_test_config config) {
-  test_invoke_large_request(config, 16384, 65536);
-  test_invoke_large_request(config, 32768, 65536);
-
-  test_invoke_large_request(config, 1000000 - 1, 65536);
-  test_invoke_large_request(config, 1000000, 65536);
-  test_invoke_large_request(config, 1000000 + 1, 65536);
-  test_invoke_large_request(config, 1000000 + 2, 65536);
-  test_invoke_large_request(config, 1000000 + 3, 65536);
-  test_invoke_large_request(config, 1000000 + 4, 65536);
-  test_invoke_large_request(config, 1000000 + 5, 65536);
-  test_invoke_large_request(config, 1000000 + 6, 65536);
-
-  test_invoke_large_request(config, 1000000 - 1, 2000000);
-  test_invoke_large_request(config, 1000000, 2000000);
-  test_invoke_large_request(config, 1000000 + 1, 2000000);
-  test_invoke_large_request(config, 1000000 + 2, 2000000);
-  test_invoke_large_request(config, 1000000 + 3, 2000000);
-  test_invoke_large_request(config, 1000000 + 4, 2000000);
-  test_invoke_large_request(config, 1000000 + 5, 2000000);
-  test_invoke_large_request(config, 1000000 + 6, 2000000);
-}
-
-void invoke_large_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/invoke_large_request.cc b/test/core/end2end/tests/invoke_large_request.cc
new file mode 100644
index 0000000..ade61ac
--- /dev/null
+++ b/test/core/end2end/tests/invoke_large_request.cc
@@ -0,0 +1,285 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, n_seconds_from_now(5), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static grpc_slice large_slice(void) {
+  grpc_slice slice = grpc_slice_malloc(1000000);
+  memset(GRPC_SLICE_START_PTR(slice), 'x', GRPC_SLICE_LENGTH(slice));
+  return slice;
+}
+
+static void test_invoke_large_request(grpc_end2end_test_config config,
+                                      int max_frame_size, int lookahead_bytes) {
+  char* name;
+  gpr_asprintf(&name,
+               "test_invoke_large_request:max_frame_size=%d:lookahead_bytes=%d",
+               max_frame_size, lookahead_bytes);
+
+  grpc_arg args[2];
+  args[0].type = GRPC_ARG_INTEGER;
+  args[0].key = const_cast<char*>(GRPC_ARG_HTTP2_MAX_FRAME_SIZE);
+  args[0].value.integer = max_frame_size;
+  args[1].type = GRPC_ARG_INTEGER;
+  args[1].key = const_cast<char*>(GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES);
+  args[1].value.integer = lookahead_bytes;
+  grpc_channel_args channel_args = {GPR_ARRAY_SIZE(args), args};
+
+  grpc_end2end_test_fixture f =
+      begin_test(config, name, &channel_args, &channel_args);
+  gpr_free(name);
+
+  grpc_slice request_payload_slice = large_slice();
+  grpc_slice response_payload_slice = large_slice();
+  grpc_call* c;
+  grpc_call* s;
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = n_seconds_from_now(30);
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  grpc_slice_unref(request_payload_slice);
+  grpc_slice_unref(response_payload_slice);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void invoke_large_request(grpc_end2end_test_config config) {
+  test_invoke_large_request(config, 16384, 65536);
+  test_invoke_large_request(config, 32768, 65536);
+
+  test_invoke_large_request(config, 1000000 - 1, 65536);
+  test_invoke_large_request(config, 1000000, 65536);
+  test_invoke_large_request(config, 1000000 + 1, 65536);
+  test_invoke_large_request(config, 1000000 + 2, 65536);
+  test_invoke_large_request(config, 1000000 + 3, 65536);
+  test_invoke_large_request(config, 1000000 + 4, 65536);
+  test_invoke_large_request(config, 1000000 + 5, 65536);
+  test_invoke_large_request(config, 1000000 + 6, 65536);
+
+  test_invoke_large_request(config, 1000000 - 1, 2000000);
+  test_invoke_large_request(config, 1000000, 2000000);
+  test_invoke_large_request(config, 1000000 + 1, 2000000);
+  test_invoke_large_request(config, 1000000 + 2, 2000000);
+  test_invoke_large_request(config, 1000000 + 3, 2000000);
+  test_invoke_large_request(config, 1000000 + 4, 2000000);
+  test_invoke_large_request(config, 1000000 + 5, 2000000);
+  test_invoke_large_request(config, 1000000 + 6, 2000000);
+}
+
+void invoke_large_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/keepalive_timeout.c b/test/core/end2end/tests/keepalive_timeout.c
deleted file mode 100644
index 0053368..0000000
--- a/test/core/end2end/tests/keepalive_timeout.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/transport/chttp2/transport/frame_ping.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/support/env.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "%s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         five_seconds_from_now(), NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Client sends a request, server replies with a payload, then waits for the
-   keepalive watchdog timeouts before returning status. */
-static void test_keepalive_timeout(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-
-  grpc_arg keepalive_arg_elems[] = {{.type = GRPC_ARG_INTEGER,
-                                     .key = GRPC_ARG_KEEPALIVE_TIME_MS,
-                                     .value.integer = 1500},
-                                    {.type = GRPC_ARG_INTEGER,
-                                     .key = GRPC_ARG_KEEPALIVE_TIMEOUT_MS,
-                                     .value.integer = 0},
-                                    {.type = GRPC_ARG_INTEGER,
-                                     .key = GRPC_ARG_HTTP2_BDP_PROBE,
-                                     .value.integer = 0}};
-  grpc_channel_args keepalive_args = {
-      .num_args = GPR_ARRAY_SIZE(keepalive_arg_elems),
-      .args = keepalive_arg_elems};
-
-  grpc_end2end_test_fixture f =
-      begin_test(config, "keepalive_timeout", &keepalive_args, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-
-  /* Disable ping ack to trigger the keepalive timeout */
-  grpc_set_disable_ping_ack(true);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-  cq_verify(cqv);
-
-  char *details_str = grpc_slice_to_c_string(details);
-  char *method_str = grpc_slice_to_c_string(call_details.method);
-  GPR_ASSERT(status == GRPC_STATUS_INTERNAL);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "keepalive watchdog timeout"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-
-  gpr_free(details_str);
-  gpr_free(method_str);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(response_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void keepalive_timeout(grpc_end2end_test_config config) {
-  test_keepalive_timeout(config);
-}
-
-void keepalive_timeout_pre_init(void) {}
diff --git a/test/core/end2end/tests/keepalive_timeout.cc b/test/core/end2end/tests/keepalive_timeout.cc
new file mode 100644
index 0000000..d071254
--- /dev/null
+++ b/test/core/end2end/tests/keepalive_timeout.cc
@@ -0,0 +1,227 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/transport/chttp2/transport/frame_ping.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/support/env.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "%s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         five_seconds_from_now(), NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Client sends a request, server replies with a payload, then waits for the
+   keepalive watchdog timeouts before returning status. */
+static void test_keepalive_timeout(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+
+  grpc_arg keepalive_arg_elems[3];
+  keepalive_arg_elems[0].type = GRPC_ARG_INTEGER;
+  keepalive_arg_elems[0].key = const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS);
+  keepalive_arg_elems[0].value.integer = 1500;
+  keepalive_arg_elems[1].type = GRPC_ARG_INTEGER;
+  keepalive_arg_elems[1].key = const_cast<char*>(GRPC_ARG_KEEPALIVE_TIMEOUT_MS);
+  keepalive_arg_elems[1].value.integer = 0;
+  keepalive_arg_elems[2].type = GRPC_ARG_INTEGER;
+  keepalive_arg_elems[2].key = const_cast<char*>(GRPC_ARG_HTTP2_BDP_PROBE);
+  keepalive_arg_elems[2].value.integer = 0;
+  grpc_channel_args keepalive_args = {GPR_ARRAY_SIZE(keepalive_arg_elems),
+                                      keepalive_arg_elems};
+
+  grpc_end2end_test_fixture f =
+      begin_test(config, "keepalive_timeout", &keepalive_args, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+
+  /* Disable ping ack to trigger the keepalive timeout */
+  grpc_set_disable_ping_ack(true);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+  cq_verify(cqv);
+
+  char* details_str = grpc_slice_to_c_string(details);
+  char* method_str = grpc_slice_to_c_string(call_details.method);
+  GPR_ASSERT(status == GRPC_STATUS_INTERNAL);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "keepalive watchdog timeout"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+
+  gpr_free(details_str);
+  gpr_free(method_str);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(response_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void keepalive_timeout(grpc_end2end_test_config config) {
+  test_keepalive_timeout(config);
+}
+
+void keepalive_timeout_pre_init(void) {}
diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c
deleted file mode 100644
index 81a45d8..0000000
--- a/test/core/end2end/tests/large_metadata.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-// Request with a large amount of metadata.
-static void test_request_with_large_metadata(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_metadata meta;
-  const size_t large_size = 64 * 1024;
-  grpc_arg arg = {GRPC_ARG_INTEGER,
-                  GRPC_ARG_MAX_METADATA_SIZE,
-                  {.integer = (int)large_size + 1024}};
-  grpc_channel_args args = {1, &arg};
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_request_with_large_metadata", &args, &args);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  meta.key = grpc_slice_from_static_string("key");
-  meta.value = grpc_slice_malloc(large_size);
-  memset(GRPC_SLICE_START_PTR(meta.value), 'a', large_size);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  // Client: send request.
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 1;
-  op->data.send_initial_metadata.metadata = &meta;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  // Server: send initial metadata and receive request.
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  // Server: receive close and send status.  This should trigger
-  // completion of request on client.
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
-  GPR_ASSERT(contains_metadata_slices(&request_metadata_recv,
-                                      grpc_slice_from_static_string("key"),
-                                      meta.value));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  grpc_slice_unref(meta.value);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void large_metadata(grpc_end2end_test_config config) {
-  test_request_with_large_metadata(config);
-}
-
-void large_metadata_pre_init(void) {}
diff --git a/test/core/end2end/tests/large_metadata.cc b/test/core/end2end/tests/large_metadata.cc
new file mode 100644
index 0000000..4afd9f3
--- /dev/null
+++ b/test/core/end2end/tests/large_metadata.cc
@@ -0,0 +1,253 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+// Request with a large amount of metadata.
+static void test_request_with_large_metadata(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_metadata meta;
+  const size_t large_size = 64 * 1024;
+  grpc_arg arg;
+  arg.type = GRPC_ARG_INTEGER;
+  arg.key = const_cast<char*>(GRPC_ARG_MAX_METADATA_SIZE);
+  arg.value.integer = (int)large_size + 1024;
+  grpc_channel_args args = {1, &arg};
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_request_with_large_metadata", &args, &args);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  meta.key = grpc_slice_from_static_string("key");
+  meta.value = grpc_slice_malloc(large_size);
+  memset(GRPC_SLICE_START_PTR(meta.value), 'a', large_size);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  // Client: send request.
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 1;
+  op->data.send_initial_metadata.metadata = &meta;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  // Server: send initial metadata and receive request.
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  // Server: receive close and send status.  This should trigger
+  // completion of request on client.
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
+  GPR_ASSERT(contains_metadata_slices(&request_metadata_recv,
+                                      grpc_slice_from_static_string("key"),
+                                      meta.value));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  grpc_slice_unref(meta.value);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void large_metadata(grpc_end2end_test_config config) {
+  test_request_with_large_metadata(config);
+}
+
+void large_metadata_pre_init(void) {}
diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c
deleted file mode 100644
index 7b50379..0000000
--- a/test/core/end2end/tests/load_reporting_hook.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/load_reporting.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/ext/filters/load_reporting/server_load_reporting_filter.h"
-#include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/end2end/end2end_tests.h"
-
-enum { TIMEOUT = 200000 };
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-typedef struct {
-  gpr_mu mu;
-  intptr_t channel_id;
-  intptr_t call_id;
-
-  char *initial_md_str;
-  char *trailing_md_str;
-  char *method_name;
-
-  uint64_t incoming_bytes;
-  uint64_t outgoing_bytes;
-
-  grpc_status_code call_final_status;
-
-  bool fully_processed;
-} load_reporting_data;
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void request_response_with_payload(
-    grpc_end2end_test_config config, grpc_end2end_test_fixture f,
-    const char *method_name, const char *request_msg, const char *response_msg,
-    grpc_metadata *initial_lr_metadata, grpc_metadata *trailing_lr_metadata) {
-  grpc_slice request_payload_slice = grpc_slice_from_static_string(request_msg);
-  grpc_slice response_payload_slice =
-      grpc_slice_from_static_string(response_msg);
-  grpc_call *c;
-  grpc_call *s;
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string(method_name),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  GPR_ASSERT(initial_lr_metadata != NULL);
-  op->data.send_initial_metadata.count = 1;
-  op->data.send_initial_metadata.metadata = initial_lr_metadata;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  GPR_ASSERT(trailing_lr_metadata != NULL);
-  op->data.send_status_from_server.trailing_metadata_count = 1;
-  op->data.send_status_from_server.trailing_metadata = trailing_lr_metadata;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-}
-
-/* override the default for testing purposes */
-extern void (*g_load_reporting_fn)(
-    const grpc_load_reporting_call_data *call_data);
-
-static void test_load_reporting_hook(grpc_end2end_test_config config) {
-  /* TODO(dgq): this test is currently a noop until LR is fully defined.
-   * Leaving the rest here, as it'll likely be reusable. */
-
-  /* Introduce load reporting for the server through its arguments */
-  grpc_arg arg = grpc_load_reporting_enable_arg();
-  grpc_channel_args *lr_server_args =
-      grpc_channel_args_copy_and_add(NULL, &arg, 1);
-
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_load_reporting_hook", NULL, lr_server_args);
-
-  const char *method_name = "/gRPCFTW";
-  const char *request_msg = "the msg from the client";
-  const char *response_msg = "... and the response from the server";
-
-  grpc_metadata initial_lr_metadata;
-  grpc_metadata trailing_lr_metadata;
-
-  initial_lr_metadata.key = GRPC_MDSTR_LB_TOKEN;
-  initial_lr_metadata.value = grpc_slice_from_static_string("client-token");
-  memset(&initial_lr_metadata.internal_data, 0,
-         sizeof(initial_lr_metadata.internal_data));
-
-  trailing_lr_metadata.key = GRPC_MDSTR_LB_COST_BIN;
-  trailing_lr_metadata.value = grpc_slice_from_static_string("server-token");
-  memset(&trailing_lr_metadata.internal_data, 0,
-         sizeof(trailing_lr_metadata.internal_data));
-
-  request_response_with_payload(config, f, method_name, request_msg,
-                                response_msg, &initial_lr_metadata,
-                                &trailing_lr_metadata);
-  end_test(&f);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, lr_server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  config.tear_down_data(&f);
-}
-
-void load_reporting_hook(grpc_end2end_test_config config) {
-  test_load_reporting_hook(config);
-}
-
-void load_reporting_hook_pre_init(void) {}
diff --git a/test/core/end2end/tests/load_reporting_hook.cc b/test/core/end2end/tests/load_reporting_hook.cc
new file mode 100644
index 0000000..5c2c3b4
--- /dev/null
+++ b/test/core/end2end/tests/load_reporting_hook.cc
@@ -0,0 +1,314 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/load_reporting.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/ext/filters/load_reporting/server_load_reporting_filter.h"
+#include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/transport/static_metadata.h"
+
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/end2end/end2end_tests.h"
+
+enum { TIMEOUT = 200000 };
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+typedef struct {
+  gpr_mu mu;
+  intptr_t channel_id;
+  intptr_t call_id;
+
+  char* initial_md_str;
+  char* trailing_md_str;
+  char* method_name;
+
+  uint64_t incoming_bytes;
+  uint64_t outgoing_bytes;
+
+  grpc_status_code call_final_status;
+
+  bool fully_processed;
+} load_reporting_data;
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void request_response_with_payload(
+    grpc_end2end_test_config config, grpc_end2end_test_fixture f,
+    const char* method_name, const char* request_msg, const char* response_msg,
+    grpc_metadata* initial_lr_metadata, grpc_metadata* trailing_lr_metadata) {
+  grpc_slice request_payload_slice = grpc_slice_from_static_string(request_msg);
+  grpc_slice response_payload_slice =
+      grpc_slice_from_static_string(response_msg);
+  grpc_call* c;
+  grpc_call* s;
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string(method_name),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  GPR_ASSERT(initial_lr_metadata != NULL);
+  op->data.send_initial_metadata.count = 1;
+  op->data.send_initial_metadata.metadata = initial_lr_metadata;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  GPR_ASSERT(trailing_lr_metadata != NULL);
+  op->data.send_status_from_server.trailing_metadata_count = 1;
+  op->data.send_status_from_server.trailing_metadata = trailing_lr_metadata;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+}
+
+/* override the default for testing purposes */
+extern void (*g_load_reporting_fn)(
+    const grpc_load_reporting_call_data* call_data);
+
+static void test_load_reporting_hook(grpc_end2end_test_config config) {
+  /* TODO(dgq): this test is currently a noop until LR is fully defined.
+   * Leaving the rest here, as it'll likely be reusable. */
+
+  /* Introduce load reporting for the server through its arguments */
+  grpc_arg arg = grpc_load_reporting_enable_arg();
+  grpc_channel_args* lr_server_args =
+      grpc_channel_args_copy_and_add(NULL, &arg, 1);
+
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_load_reporting_hook", NULL, lr_server_args);
+
+  const char* method_name = "/gRPCFTW";
+  const char* request_msg = "the msg from the client";
+  const char* response_msg = "... and the response from the server";
+
+  grpc_metadata initial_lr_metadata;
+  grpc_metadata trailing_lr_metadata;
+
+  initial_lr_metadata.key = GRPC_MDSTR_LB_TOKEN;
+  initial_lr_metadata.value = grpc_slice_from_static_string("client-token");
+  memset(&initial_lr_metadata.internal_data, 0,
+         sizeof(initial_lr_metadata.internal_data));
+
+  trailing_lr_metadata.key = GRPC_MDSTR_LB_COST_BIN;
+  trailing_lr_metadata.value = grpc_slice_from_static_string("server-token");
+  memset(&trailing_lr_metadata.internal_data, 0,
+         sizeof(trailing_lr_metadata.internal_data));
+
+  request_response_with_payload(config, f, method_name, request_msg,
+                                response_msg, &initial_lr_metadata,
+                                &trailing_lr_metadata);
+  end_test(&f);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, lr_server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  config.tear_down_data(&f);
+}
+
+void load_reporting_hook(grpc_end2end_test_config config) {
+  test_load_reporting_hook(config);
+}
+
+void load_reporting_hook_pre_init(void) {}
diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c
deleted file mode 100644
index d18c139..0000000
--- a/test/core/end2end/tests/max_concurrent_streams.c
+++ /dev/null
@@ -1,831 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_max_concurrent_streams(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-  grpc_arg server_arg;
-  grpc_channel_args server_args;
-  grpc_call *c1;
-  grpc_call *c2;
-  grpc_call *s1;
-  grpc_call *s2;
-  int live_call;
-  gpr_timespec deadline;
-  cq_verifier *cqv;
-  grpc_event ev;
-  grpc_call_details call_details;
-  grpc_metadata_array request_metadata_recv;
-  grpc_metadata_array initial_metadata_recv1;
-  grpc_metadata_array trailing_metadata_recv1;
-  grpc_metadata_array initial_metadata_recv2;
-  grpc_metadata_array trailing_metadata_recv2;
-  grpc_status_code status1;
-  grpc_call_error error;
-  grpc_slice details1;
-  grpc_status_code status2;
-  grpc_slice details2;
-  grpc_op ops[6];
-  grpc_op *op;
-  int was_cancelled;
-  int got_client_start;
-  int got_server_start;
-
-  server_arg.key = GRPC_ARG_MAX_CONCURRENT_STREAMS;
-  server_arg.type = GRPC_ARG_INTEGER;
-  server_arg.value.integer = 1;
-
-  server_args.num_args = 1;
-  server_args.args = &server_arg;
-
-  f = begin_test(config, "test_max_concurrent_streams", NULL, &server_args);
-  cqv = cq_verifier_create(f.cq);
-
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_metadata_array_init(&initial_metadata_recv1);
-  grpc_metadata_array_init(&trailing_metadata_recv1);
-  grpc_metadata_array_init(&initial_metadata_recv2);
-  grpc_metadata_array_init(&trailing_metadata_recv2);
-  grpc_call_details_init(&call_details);
-
-  /* perform a ping-pong to ensure that settings have had a chance to round
-     trip */
-  simple_request_body(config, f);
-  /* perform another one to make sure that the one stream case still works */
-  simple_request_body(config, f);
-
-  /* start two requests - ensuring that the second is not accepted until
-     the first completes */
-  deadline = n_seconds_from_now(1000);
-  c1 = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/alpha"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c1);
-  c2 = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/beta"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c2);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s1, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1;
-  op->data.recv_status_on_client.status = &status1;
-  op->data.recv_status_on_client.status_details = &details1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &initial_metadata_recv1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2;
-  op->data.recv_status_on_client.status = &status2;
-  op->data.recv_status_on_client.status_details = &details2;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &initial_metadata_recv1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(402), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  got_client_start = 0;
-  got_server_start = 0;
-  live_call = -1;
-  while (!got_client_start || !got_server_start) {
-    ev = grpc_completion_queue_next(f.cq, grpc_timeout_seconds_to_deadline(3),
-                                    NULL);
-    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-    GPR_ASSERT(ev.success);
-    if (ev.tag == tag(101)) {
-      GPR_ASSERT(!got_server_start);
-      got_server_start = 1;
-    } else {
-      GPR_ASSERT(!got_client_start);
-      GPR_ASSERT(ev.tag == tag(301) || ev.tag == tag(401));
-      /* The /alpha or /beta calls started above could be invoked (but NOT
-       * both);
-       * check this here */
-      /* We'll get tag 303 or 403, we want 300, 400 */
-      live_call = ((int)(intptr_t)ev.tag) - 1;
-      got_client_start = 1;
-    }
-  }
-  GPR_ASSERT(live_call == 300 || live_call == 400);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s1, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(live_call + 2), 1);
-  /* first request is finished, we should be able to start the second */
-  live_call = (live_call == 300) ? 400 : 300;
-  CQ_EXPECT_COMPLETION(cqv, tag(live_call + 1), 1);
-  cq_verify(cqv);
-
-  grpc_call_details_destroy(&call_details);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s2, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(201)));
-  CQ_EXPECT_COMPLETION(cqv, tag(201), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s2, ops, (size_t)(op - ops), tag(202), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(live_call + 2), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(202), 1);
-  cq_verify(cqv);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_call_unref(c1);
-  grpc_call_unref(s1);
-  grpc_call_unref(c2);
-  grpc_call_unref(s2);
-
-  grpc_slice_unref(details1);
-  grpc_slice_unref(details2);
-  grpc_metadata_array_destroy(&initial_metadata_recv1);
-  grpc_metadata_array_destroy(&trailing_metadata_recv1);
-  grpc_metadata_array_destroy(&initial_metadata_recv2);
-  grpc_metadata_array_destroy(&trailing_metadata_recv2);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_max_concurrent_streams_with_timeout_on_first(
-    grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-  grpc_arg server_arg;
-  grpc_channel_args server_args;
-  grpc_call *c1;
-  grpc_call *c2;
-  grpc_call *s1;
-  grpc_call *s2;
-  cq_verifier *cqv;
-  grpc_call_details call_details;
-  grpc_metadata_array request_metadata_recv;
-  grpc_metadata_array initial_metadata_recv1;
-  grpc_metadata_array trailing_metadata_recv1;
-  grpc_metadata_array initial_metadata_recv2;
-  grpc_metadata_array trailing_metadata_recv2;
-  grpc_status_code status1;
-  grpc_call_error error;
-  grpc_slice details1 = grpc_empty_slice();
-  grpc_status_code status2;
-  grpc_slice details2 = grpc_empty_slice();
-  grpc_op ops[6];
-  grpc_op *op;
-  int was_cancelled;
-
-  server_arg.key = GRPC_ARG_MAX_CONCURRENT_STREAMS;
-  server_arg.type = GRPC_ARG_INTEGER;
-  server_arg.value.integer = 1;
-
-  server_args.num_args = 1;
-  server_args.args = &server_arg;
-
-  f = begin_test(config, "test_max_concurrent_streams_with_timeout_on_first",
-                 NULL, &server_args);
-  cqv = cq_verifier_create(f.cq);
-
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_metadata_array_init(&initial_metadata_recv1);
-  grpc_metadata_array_init(&trailing_metadata_recv1);
-  grpc_metadata_array_init(&initial_metadata_recv2);
-  grpc_metadata_array_init(&trailing_metadata_recv2);
-  grpc_call_details_init(&call_details);
-
-  /* perform a ping-pong to ensure that settings have had a chance to round
-     trip */
-  simple_request_body(config, f);
-  /* perform another one to make sure that the one stream case still works */
-  simple_request_body(config, f);
-
-  /* start two requests - ensuring that the second is not accepted until
-     the first completes */
-  c1 = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/alpha"),
-      get_host_override_slice("foo.test.google.fr:1234", config),
-      n_seconds_from_now(3), NULL);
-  GPR_ASSERT(c1);
-  c2 = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/beta"),
-      get_host_override_slice("foo.test.google.fr:1234", config),
-      n_seconds_from_now(1000), NULL);
-  GPR_ASSERT(c2);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s1, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1;
-  op->data.recv_status_on_client.status = &status1;
-  op->data.recv_status_on_client.status_details = &details1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &initial_metadata_recv1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(301), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2;
-  op->data.recv_status_on_client.status = &status2;
-  op->data.recv_status_on_client.status_details = &details2;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &initial_metadata_recv2;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(402), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  grpc_call_details_destroy(&call_details);
-  grpc_call_details_init(&call_details);
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s2, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(201)));
-
-  CQ_EXPECT_COMPLETION(cqv, tag(302), 1);
-  /* first request is finished, we should be able to start the second */
-  CQ_EXPECT_COMPLETION(cqv, tag(401), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(201), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s2, ops, (size_t)(op - ops), tag(202), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(402), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(202), 1);
-  cq_verify(cqv);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_call_unref(c1);
-  grpc_call_unref(s1);
-  grpc_call_unref(c2);
-  grpc_call_unref(s2);
-
-  grpc_slice_unref(details1);
-  grpc_slice_unref(details2);
-  grpc_metadata_array_destroy(&initial_metadata_recv1);
-  grpc_metadata_array_destroy(&trailing_metadata_recv1);
-  grpc_metadata_array_destroy(&initial_metadata_recv2);
-  grpc_metadata_array_destroy(&trailing_metadata_recv2);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_max_concurrent_streams_with_timeout_on_second(
-    grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-  grpc_arg server_arg;
-  grpc_channel_args server_args;
-  grpc_call *c1;
-  grpc_call *c2;
-  grpc_call *s1;
-  cq_verifier *cqv;
-  grpc_call_details call_details;
-  grpc_metadata_array request_metadata_recv;
-  grpc_metadata_array initial_metadata_recv1;
-  grpc_metadata_array trailing_metadata_recv1;
-  grpc_metadata_array initial_metadata_recv2;
-  grpc_metadata_array trailing_metadata_recv2;
-  grpc_status_code status1;
-  grpc_call_error error;
-  grpc_slice details1 = grpc_empty_slice();
-  grpc_status_code status2;
-  grpc_slice details2 = grpc_empty_slice();
-  grpc_op ops[6];
-  grpc_op *op;
-  int was_cancelled;
-
-  server_arg.key = GRPC_ARG_MAX_CONCURRENT_STREAMS;
-  server_arg.type = GRPC_ARG_INTEGER;
-  server_arg.value.integer = 1;
-
-  server_args.num_args = 1;
-  server_args.args = &server_arg;
-
-  f = begin_test(config, "test_max_concurrent_streams_with_timeout_on_second",
-                 NULL, &server_args);
-  cqv = cq_verifier_create(f.cq);
-
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_metadata_array_init(&initial_metadata_recv1);
-  grpc_metadata_array_init(&trailing_metadata_recv1);
-  grpc_metadata_array_init(&initial_metadata_recv2);
-  grpc_metadata_array_init(&trailing_metadata_recv2);
-  grpc_call_details_init(&call_details);
-
-  /* perform a ping-pong to ensure that settings have had a chance to round
-     trip */
-  simple_request_body(config, f);
-  /* perform another one to make sure that the one stream case still works */
-  simple_request_body(config, f);
-
-  /* start two requests - ensuring that the second is not accepted until
-     the first completes , and the second request will timeout in the
-     concurrent_list */
-  c1 = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/alpha"),
-      get_host_override_slice("foo.test.google.fr:1234", config),
-      n_seconds_from_now(1000), NULL);
-  GPR_ASSERT(c1);
-  c2 = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/beta"),
-      get_host_override_slice("foo.test.google.fr:1234", config),
-      n_seconds_from_now(3), NULL);
-  GPR_ASSERT(c2);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s1, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1;
-  op->data.recv_status_on_client.status = &status1;
-  op->data.recv_status_on_client.status_details = &details1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &initial_metadata_recv1;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(301), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2;
-  op->data.recv_status_on_client.status = &status2;
-  op->data.recv_status_on_client.status_details = &details2;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &initial_metadata_recv2;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(402), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  /* the second request is time out*/
-  CQ_EXPECT_COMPLETION(cqv, tag(401), 0);
-  CQ_EXPECT_COMPLETION(cqv, tag(402), 1);
-  cq_verify(cqv);
-
-  /* second request is finished because of time out, so destroy the second call
-   */
-  grpc_call_unref(c2);
-
-  /* now reply the first call */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s1, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(302), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_call_unref(c1);
-  grpc_call_unref(s1);
-
-  grpc_slice_unref(details1);
-  grpc_slice_unref(details2);
-  grpc_metadata_array_destroy(&initial_metadata_recv1);
-  grpc_metadata_array_destroy(&trailing_metadata_recv1);
-  grpc_metadata_array_destroy(&initial_metadata_recv2);
-  grpc_metadata_array_destroy(&trailing_metadata_recv2);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void max_concurrent_streams(grpc_end2end_test_config config) {
-  test_max_concurrent_streams_with_timeout_on_first(config);
-  test_max_concurrent_streams_with_timeout_on_second(config);
-  test_max_concurrent_streams(config);
-}
-
-void max_concurrent_streams_pre_init(void) {}
diff --git a/test/core/end2end/tests/max_concurrent_streams.cc b/test/core/end2end/tests/max_concurrent_streams.cc
new file mode 100644
index 0000000..b8b49d6
--- /dev/null
+++ b/test/core/end2end/tests/max_concurrent_streams.cc
@@ -0,0 +1,831 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_max_concurrent_streams(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+  grpc_arg server_arg;
+  grpc_channel_args server_args;
+  grpc_call* c1;
+  grpc_call* c2;
+  grpc_call* s1;
+  grpc_call* s2;
+  int live_call;
+  gpr_timespec deadline;
+  cq_verifier* cqv;
+  grpc_event ev;
+  grpc_call_details call_details;
+  grpc_metadata_array request_metadata_recv;
+  grpc_metadata_array initial_metadata_recv1;
+  grpc_metadata_array trailing_metadata_recv1;
+  grpc_metadata_array initial_metadata_recv2;
+  grpc_metadata_array trailing_metadata_recv2;
+  grpc_status_code status1;
+  grpc_call_error error;
+  grpc_slice details1;
+  grpc_status_code status2;
+  grpc_slice details2;
+  grpc_op ops[6];
+  grpc_op* op;
+  int was_cancelled;
+  int got_client_start;
+  int got_server_start;
+
+  server_arg.key = const_cast<char*>(GRPC_ARG_MAX_CONCURRENT_STREAMS);
+  server_arg.type = GRPC_ARG_INTEGER;
+  server_arg.value.integer = 1;
+
+  server_args.num_args = 1;
+  server_args.args = &server_arg;
+
+  f = begin_test(config, "test_max_concurrent_streams", NULL, &server_args);
+  cqv = cq_verifier_create(f.cq);
+
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_metadata_array_init(&initial_metadata_recv1);
+  grpc_metadata_array_init(&trailing_metadata_recv1);
+  grpc_metadata_array_init(&initial_metadata_recv2);
+  grpc_metadata_array_init(&trailing_metadata_recv2);
+  grpc_call_details_init(&call_details);
+
+  /* perform a ping-pong to ensure that settings have had a chance to round
+     trip */
+  simple_request_body(config, f);
+  /* perform another one to make sure that the one stream case still works */
+  simple_request_body(config, f);
+
+  /* start two requests - ensuring that the second is not accepted until
+     the first completes */
+  deadline = n_seconds_from_now(1000);
+  c1 = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/alpha"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c1);
+  c2 = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/beta"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c2);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s1, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1;
+  op->data.recv_status_on_client.status = &status1;
+  op->data.recv_status_on_client.status_details = &details1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &initial_metadata_recv1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2;
+  op->data.recv_status_on_client.status = &status2;
+  op->data.recv_status_on_client.status_details = &details2;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &initial_metadata_recv1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(402), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  got_client_start = 0;
+  got_server_start = 0;
+  live_call = -1;
+  while (!got_client_start || !got_server_start) {
+    ev = grpc_completion_queue_next(f.cq, grpc_timeout_seconds_to_deadline(3),
+                                    NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+    GPR_ASSERT(ev.success);
+    if (ev.tag == tag(101)) {
+      GPR_ASSERT(!got_server_start);
+      got_server_start = 1;
+    } else {
+      GPR_ASSERT(!got_client_start);
+      GPR_ASSERT(ev.tag == tag(301) || ev.tag == tag(401));
+      /* The /alpha or /beta calls started above could be invoked (but NOT
+       * both);
+       * check this here */
+      /* We'll get tag 303 or 403, we want 300, 400 */
+      live_call = ((int)(intptr_t)ev.tag) - 1;
+      got_client_start = 1;
+    }
+  }
+  GPR_ASSERT(live_call == 300 || live_call == 400);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s1, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(live_call + 2), 1);
+  /* first request is finished, we should be able to start the second */
+  live_call = (live_call == 300) ? 400 : 300;
+  CQ_EXPECT_COMPLETION(cqv, tag(live_call + 1), 1);
+  cq_verify(cqv);
+
+  grpc_call_details_destroy(&call_details);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s2, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(201)));
+  CQ_EXPECT_COMPLETION(cqv, tag(201), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s2, ops, (size_t)(op - ops), tag(202), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(live_call + 2), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(202), 1);
+  cq_verify(cqv);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_call_unref(c1);
+  grpc_call_unref(s1);
+  grpc_call_unref(c2);
+  grpc_call_unref(s2);
+
+  grpc_slice_unref(details1);
+  grpc_slice_unref(details2);
+  grpc_metadata_array_destroy(&initial_metadata_recv1);
+  grpc_metadata_array_destroy(&trailing_metadata_recv1);
+  grpc_metadata_array_destroy(&initial_metadata_recv2);
+  grpc_metadata_array_destroy(&trailing_metadata_recv2);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_max_concurrent_streams_with_timeout_on_first(
+    grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+  grpc_arg server_arg;
+  grpc_channel_args server_args;
+  grpc_call* c1;
+  grpc_call* c2;
+  grpc_call* s1;
+  grpc_call* s2;
+  cq_verifier* cqv;
+  grpc_call_details call_details;
+  grpc_metadata_array request_metadata_recv;
+  grpc_metadata_array initial_metadata_recv1;
+  grpc_metadata_array trailing_metadata_recv1;
+  grpc_metadata_array initial_metadata_recv2;
+  grpc_metadata_array trailing_metadata_recv2;
+  grpc_status_code status1;
+  grpc_call_error error;
+  grpc_slice details1 = grpc_empty_slice();
+  grpc_status_code status2;
+  grpc_slice details2 = grpc_empty_slice();
+  grpc_op ops[6];
+  grpc_op* op;
+  int was_cancelled;
+
+  server_arg.key = const_cast<char*>(GRPC_ARG_MAX_CONCURRENT_STREAMS);
+  server_arg.type = GRPC_ARG_INTEGER;
+  server_arg.value.integer = 1;
+
+  server_args.num_args = 1;
+  server_args.args = &server_arg;
+
+  f = begin_test(config, "test_max_concurrent_streams_with_timeout_on_first",
+                 NULL, &server_args);
+  cqv = cq_verifier_create(f.cq);
+
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_metadata_array_init(&initial_metadata_recv1);
+  grpc_metadata_array_init(&trailing_metadata_recv1);
+  grpc_metadata_array_init(&initial_metadata_recv2);
+  grpc_metadata_array_init(&trailing_metadata_recv2);
+  grpc_call_details_init(&call_details);
+
+  /* perform a ping-pong to ensure that settings have had a chance to round
+     trip */
+  simple_request_body(config, f);
+  /* perform another one to make sure that the one stream case still works */
+  simple_request_body(config, f);
+
+  /* start two requests - ensuring that the second is not accepted until
+     the first completes */
+  c1 = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/alpha"),
+      get_host_override_slice("foo.test.google.fr:1234", config),
+      n_seconds_from_now(3), NULL);
+  GPR_ASSERT(c1);
+  c2 = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/beta"),
+      get_host_override_slice("foo.test.google.fr:1234", config),
+      n_seconds_from_now(1000), NULL);
+  GPR_ASSERT(c2);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s1, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1;
+  op->data.recv_status_on_client.status = &status1;
+  op->data.recv_status_on_client.status_details = &details1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &initial_metadata_recv1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(301), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2;
+  op->data.recv_status_on_client.status = &status2;
+  op->data.recv_status_on_client.status_details = &details2;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &initial_metadata_recv2;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(402), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  grpc_call_details_destroy(&call_details);
+  grpc_call_details_init(&call_details);
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s2, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(201)));
+
+  CQ_EXPECT_COMPLETION(cqv, tag(302), 1);
+  /* first request is finished, we should be able to start the second */
+  CQ_EXPECT_COMPLETION(cqv, tag(401), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(201), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s2, ops, (size_t)(op - ops), tag(202), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(402), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(202), 1);
+  cq_verify(cqv);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_call_unref(c1);
+  grpc_call_unref(s1);
+  grpc_call_unref(c2);
+  grpc_call_unref(s2);
+
+  grpc_slice_unref(details1);
+  grpc_slice_unref(details2);
+  grpc_metadata_array_destroy(&initial_metadata_recv1);
+  grpc_metadata_array_destroy(&trailing_metadata_recv1);
+  grpc_metadata_array_destroy(&initial_metadata_recv2);
+  grpc_metadata_array_destroy(&trailing_metadata_recv2);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_max_concurrent_streams_with_timeout_on_second(
+    grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+  grpc_arg server_arg;
+  grpc_channel_args server_args;
+  grpc_call* c1;
+  grpc_call* c2;
+  grpc_call* s1;
+  cq_verifier* cqv;
+  grpc_call_details call_details;
+  grpc_metadata_array request_metadata_recv;
+  grpc_metadata_array initial_metadata_recv1;
+  grpc_metadata_array trailing_metadata_recv1;
+  grpc_metadata_array initial_metadata_recv2;
+  grpc_metadata_array trailing_metadata_recv2;
+  grpc_status_code status1;
+  grpc_call_error error;
+  grpc_slice details1 = grpc_empty_slice();
+  grpc_status_code status2;
+  grpc_slice details2 = grpc_empty_slice();
+  grpc_op ops[6];
+  grpc_op* op;
+  int was_cancelled;
+
+  server_arg.key = const_cast<char*>(GRPC_ARG_MAX_CONCURRENT_STREAMS);
+  server_arg.type = GRPC_ARG_INTEGER;
+  server_arg.value.integer = 1;
+
+  server_args.num_args = 1;
+  server_args.args = &server_arg;
+
+  f = begin_test(config, "test_max_concurrent_streams_with_timeout_on_second",
+                 NULL, &server_args);
+  cqv = cq_verifier_create(f.cq);
+
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_metadata_array_init(&initial_metadata_recv1);
+  grpc_metadata_array_init(&trailing_metadata_recv1);
+  grpc_metadata_array_init(&initial_metadata_recv2);
+  grpc_metadata_array_init(&trailing_metadata_recv2);
+  grpc_call_details_init(&call_details);
+
+  /* perform a ping-pong to ensure that settings have had a chance to round
+     trip */
+  simple_request_body(config, f);
+  /* perform another one to make sure that the one stream case still works */
+  simple_request_body(config, f);
+
+  /* start two requests - ensuring that the second is not accepted until
+     the first completes , and the second request will timeout in the
+     concurrent_list */
+  c1 = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/alpha"),
+      get_host_override_slice("foo.test.google.fr:1234", config),
+      n_seconds_from_now(1000), NULL);
+  GPR_ASSERT(c1);
+  c2 = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/beta"),
+      get_host_override_slice("foo.test.google.fr:1234", config),
+      n_seconds_from_now(3), NULL);
+  GPR_ASSERT(c2);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s1, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(301), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv1;
+  op->data.recv_status_on_client.status = &status1;
+  op->data.recv_status_on_client.status_details = &details1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &initial_metadata_recv1;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c1, ops, (size_t)(op - ops), tag(302), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(301), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(401), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv2;
+  op->data.recv_status_on_client.status = &status2;
+  op->data.recv_status_on_client.status_details = &details2;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &initial_metadata_recv2;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c2, ops, (size_t)(op - ops), tag(402), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  /* the second request is time out*/
+  CQ_EXPECT_COMPLETION(cqv, tag(401), 0);
+  CQ_EXPECT_COMPLETION(cqv, tag(402), 1);
+  cq_verify(cqv);
+
+  /* second request is finished because of time out, so destroy the second call
+   */
+  grpc_call_unref(c2);
+
+  /* now reply the first call */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s1, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(302), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_call_unref(c1);
+  grpc_call_unref(s1);
+
+  grpc_slice_unref(details1);
+  grpc_slice_unref(details2);
+  grpc_metadata_array_destroy(&initial_metadata_recv1);
+  grpc_metadata_array_destroy(&trailing_metadata_recv1);
+  grpc_metadata_array_destroy(&initial_metadata_recv2);
+  grpc_metadata_array_destroy(&trailing_metadata_recv2);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void max_concurrent_streams(grpc_end2end_test_config config) {
+  test_max_concurrent_streams_with_timeout_on_first(config);
+  test_max_concurrent_streams_with_timeout_on_second(config);
+  test_max_concurrent_streams(config);
+}
+
+void max_concurrent_streams_pre_init(void) {}
diff --git a/test/core/end2end/tests/max_connection_age.c b/test/core/end2end/tests/max_connection_age.c
deleted file mode 100644
index b6daa59..0000000
--- a/test/core/end2end/tests/max_connection_age.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <limits.h>
-#include <string.h>
-
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "test/core/end2end/cq_verifier.h"
-
-#define MAX_CONNECTION_AGE_MS 500
-#define MAX_CONNECTION_AGE_GRACE_MS 1000
-#define MAX_CONNECTION_IDLE_MS 9999
-
-#define MAX_CONNECTION_AGE_JITTER_MULTIPLIER 1.1
-#define CALL_DEADLINE_S 10
-/* The amount of time we wait for the connection to time out, but after it the
-   connection should not use up its grace period. It should be a number between
-   MAX_CONNECTION_AGE_MS and MAX_CONNECTION_AGE_MS +
-   MAX_CONNECTION_AGE_GRACE_MS */
-#define CQ_MAX_CONNECTION_AGE_WAIT_TIME_S 1
-/* The amount of time we wait after the connection reaches its max age, it
-   should be shorter than CALL_DEADLINE_S - CQ_MAX_CONNECTION_AGE_WAIT_TIME_S */
-#define CQ_MAX_CONNECTION_AGE_GRACE_WAIT_TIME_S 2
-/* The grace period for the test to observe the channel shutdown process */
-#define IMMEDIATE_SHUTDOWN_GRACE_TIME_MS 3000
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5),
-                                    NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void test_max_age_forcibly_close(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_arg server_a[] = {{.type = GRPC_ARG_INTEGER,
-                          .key = GRPC_ARG_MAX_CONNECTION_AGE_MS,
-                          .value.integer = MAX_CONNECTION_AGE_MS},
-                         {.type = GRPC_ARG_INTEGER,
-                          .key = GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS,
-                          .value.integer = MAX_CONNECTION_AGE_GRACE_MS},
-                         {.type = GRPC_ARG_INTEGER,
-                          .key = GRPC_ARG_MAX_CONNECTION_IDLE_MS,
-                          .value.integer = MAX_CONNECTION_IDLE_MS}};
-  grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a),
-                                   .args = server_a};
-
-  config.init_client(&f, NULL);
-  config.init_server(&f, &server_args);
-
-  grpc_call *c;
-  grpc_call *s;
-  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(CALL_DEADLINE_S);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
-  cq_verify(cqv);
-
-  gpr_timespec expect_shutdown_time = grpc_timeout_milliseconds_to_deadline(
-      (int)(MAX_CONNECTION_AGE_MS * MAX_CONNECTION_AGE_JITTER_MULTIPLIER) +
-      MAX_CONNECTION_AGE_GRACE_MS + IMMEDIATE_SHUTDOWN_GRACE_TIME_MS);
-
-  /* Wait for the channel to reach its max age */
-  cq_verify_empty_timeout(cqv, CQ_MAX_CONNECTION_AGE_WAIT_TIME_S);
-
-  /* After the channel reaches its max age, we still do nothing here. And wait
-     for it to use up its max age grace period. */
-  CQ_EXPECT_COMPLETION(cqv, tag(1), true);
-  cq_verify(cqv);
-
-  gpr_timespec channel_shutdown_time = gpr_now(GPR_CLOCK_MONOTONIC);
-  GPR_ASSERT(gpr_time_cmp(channel_shutdown_time, expect_shutdown_time) < 0);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(102), true);
-  cq_verify(cqv);
-
-  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
-  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), true);
-  cq_verify(cqv);
-
-  grpc_call_unref(s);
-
-  /* The connection should be closed immediately after the max age grace period,
-     the in-progress RPC should fail. */
-  GPR_ASSERT(status == GRPC_STATUS_INTERNAL);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_call_unref(c);
-  cq_verifier_destroy(cqv);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_max_age_gracefully_close(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_arg server_a[] = {{.type = GRPC_ARG_INTEGER,
-                          .key = GRPC_ARG_MAX_CONNECTION_AGE_MS,
-                          .value.integer = MAX_CONNECTION_AGE_MS},
-                         {.type = GRPC_ARG_INTEGER,
-                          .key = GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS,
-                          .value.integer = INT_MAX},
-                         {.type = GRPC_ARG_INTEGER,
-                          .key = GRPC_ARG_MAX_CONNECTION_IDLE_MS,
-                          .value.integer = MAX_CONNECTION_IDLE_MS}};
-  grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a),
-                                   .args = server_a};
-
-  config.init_client(&f, NULL);
-  config.init_server(&f, &server_args);
-
-  grpc_call *c;
-  grpc_call *s;
-  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(CALL_DEADLINE_S);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
-  cq_verify(cqv);
-
-  /* Wait for the channel to reach its max age */
-  cq_verify_empty_timeout(cqv, CQ_MAX_CONNECTION_AGE_WAIT_TIME_S);
-
-  /* The connection is shutting down gracefully. In-progress rpc should not be
-     closed, hence the completion queue should see nothing here. */
-  cq_verify_empty_timeout(cqv, CQ_MAX_CONNECTION_AGE_GRACE_WAIT_TIME_S);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), true);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), true);
-  cq_verify(cqv);
-
-  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
-  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), true);
-  cq_verify(cqv);
-
-  grpc_call_unref(s);
-
-  /* The connection is closed gracefully with goaway, the rpc should still be
-     completed. */
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_call_unref(c);
-  cq_verifier_destroy(cqv);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void max_connection_age(grpc_end2end_test_config config) {
-  test_max_age_forcibly_close(config);
-  test_max_age_gracefully_close(config);
-}
-
-void max_connection_age_pre_init(void) {}
diff --git a/test/core/end2end/tests/max_connection_age.cc b/test/core/end2end/tests/max_connection_age.cc
new file mode 100644
index 0000000..b5d4dcf
--- /dev/null
+++ b/test/core/end2end/tests/max_connection_age.cc
@@ -0,0 +1,366 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <limits.h>
+#include <string.h>
+
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/end2end/cq_verifier.h"
+
+#define MAX_CONNECTION_AGE_MS 500
+#define MAX_CONNECTION_AGE_GRACE_MS 1000
+#define MAX_CONNECTION_IDLE_MS 9999
+
+#define MAX_CONNECTION_AGE_JITTER_MULTIPLIER 1.1
+#define CALL_DEADLINE_S 10
+/* The amount of time we wait for the connection to time out, but after it the
+   connection should not use up its grace period. It should be a number between
+   MAX_CONNECTION_AGE_MS and MAX_CONNECTION_AGE_MS +
+   MAX_CONNECTION_AGE_GRACE_MS */
+#define CQ_MAX_CONNECTION_AGE_WAIT_TIME_S 1
+/* The amount of time we wait after the connection reaches its max age, it
+   should be shorter than CALL_DEADLINE_S - CQ_MAX_CONNECTION_AGE_WAIT_TIME_S */
+#define CQ_MAX_CONNECTION_AGE_GRACE_WAIT_TIME_S 2
+/* The grace period for the test to observe the channel shutdown process */
+#define IMMEDIATE_SHUTDOWN_GRACE_TIME_MS 3000
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5),
+                                    NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void test_max_age_forcibly_close(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_arg server_a[3];
+  server_a[0].type = GRPC_ARG_INTEGER;
+  server_a[0].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_MS);
+  server_a[0].value.integer = MAX_CONNECTION_AGE_MS;
+  server_a[1].type = GRPC_ARG_INTEGER;
+  server_a[1].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS);
+  server_a[1].value.integer = MAX_CONNECTION_AGE_GRACE_MS;
+  server_a[2].type = GRPC_ARG_INTEGER;
+  server_a[2].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_IDLE_MS);
+  server_a[2].value.integer = MAX_CONNECTION_IDLE_MS;
+  grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a};
+
+  config.init_client(&f, NULL);
+  config.init_server(&f, &server_args);
+
+  grpc_call* c;
+  grpc_call* s;
+  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(CALL_DEADLINE_S);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
+  cq_verify(cqv);
+
+  gpr_timespec expect_shutdown_time = grpc_timeout_milliseconds_to_deadline(
+      (int)(MAX_CONNECTION_AGE_MS * MAX_CONNECTION_AGE_JITTER_MULTIPLIER) +
+      MAX_CONNECTION_AGE_GRACE_MS + IMMEDIATE_SHUTDOWN_GRACE_TIME_MS);
+
+  /* Wait for the channel to reach its max age */
+  cq_verify_empty_timeout(cqv, CQ_MAX_CONNECTION_AGE_WAIT_TIME_S);
+
+  /* After the channel reaches its max age, we still do nothing here. And wait
+     for it to use up its max age grace period. */
+  CQ_EXPECT_COMPLETION(cqv, tag(1), true);
+  cq_verify(cqv);
+
+  gpr_timespec channel_shutdown_time = gpr_now(GPR_CLOCK_MONOTONIC);
+  GPR_ASSERT(gpr_time_cmp(channel_shutdown_time, expect_shutdown_time) < 0);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(102), true);
+  cq_verify(cqv);
+
+  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
+  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), true);
+  cq_verify(cqv);
+
+  grpc_call_unref(s);
+
+  /* The connection should be closed immediately after the max age grace period,
+     the in-progress RPC should fail. */
+  GPR_ASSERT(status == GRPC_STATUS_INTERNAL);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_call_unref(c);
+  cq_verifier_destroy(cqv);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_max_age_gracefully_close(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_arg server_a[3];
+  server_a[0].type = GRPC_ARG_INTEGER;
+  server_a[0].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_MS);
+  server_a[0].value.integer = MAX_CONNECTION_AGE_MS;
+  server_a[1].type = GRPC_ARG_INTEGER;
+  server_a[1].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS);
+  server_a[1].value.integer = INT_MAX;
+  server_a[2].type = GRPC_ARG_INTEGER;
+  server_a[2].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_IDLE_MS);
+  server_a[2].value.integer = MAX_CONNECTION_IDLE_MS;
+  grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a};
+
+  config.init_client(&f, NULL);
+  config.init_server(&f, &server_args);
+
+  grpc_call* c;
+  grpc_call* s;
+  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(CALL_DEADLINE_S);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
+  cq_verify(cqv);
+
+  /* Wait for the channel to reach its max age */
+  cq_verify_empty_timeout(cqv, CQ_MAX_CONNECTION_AGE_WAIT_TIME_S);
+
+  /* The connection is shutting down gracefully. In-progress rpc should not be
+     closed, hence the completion queue should see nothing here. */
+  cq_verify_empty_timeout(cqv, CQ_MAX_CONNECTION_AGE_GRACE_WAIT_TIME_S);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), true);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), true);
+  cq_verify(cqv);
+
+  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
+  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), true);
+  cq_verify(cqv);
+
+  grpc_call_unref(s);
+
+  /* The connection is closed gracefully with goaway, the rpc should still be
+     completed. */
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_call_unref(c);
+  cq_verifier_destroy(cqv);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void max_connection_age(grpc_end2end_test_config config) {
+  test_max_age_forcibly_close(config);
+  test_max_age_gracefully_close(config);
+}
+
+void max_connection_age_pre_init(void) {}
diff --git a/test/core/end2end/tests/max_connection_idle.c b/test/core/end2end/tests/max_connection_idle.c
deleted file mode 100644
index f26b0be..0000000
--- a/test/core/end2end/tests/max_connection_idle.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <limits.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "test/core/end2end/cq_verifier.h"
-
-#define MAX_CONNECTION_IDLE_MS 500
-#define MAX_CONNECTION_AGE_MS 9999
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5),
-                                    NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture *f) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f->cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  char *peer;
-
-  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
-  c = grpc_channel_create_call(
-      f->client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
-  gpr_free(peer);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f->server, &s, &call_details,
-                               &request_metadata_recv, f->cq, f->cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  peer = grpc_call_get_peer(s);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
-  gpr_free(peer);
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
-  gpr_free(peer);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(0 == call_details.flags);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_max_connection_idle(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
-  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-
-  grpc_arg client_a[] = {{.type = GRPC_ARG_INTEGER,
-                          .key = "grpc.testing.fixed_reconnect_backoff_ms",
-                          .value.integer = 1000}};
-  grpc_arg server_a[] = {{.type = GRPC_ARG_INTEGER,
-                          .key = GRPC_ARG_MAX_CONNECTION_IDLE_MS,
-                          .value.integer = MAX_CONNECTION_IDLE_MS},
-                         {.type = GRPC_ARG_INTEGER,
-                          .key = GRPC_ARG_MAX_CONNECTION_AGE_MS,
-                          .value.integer = MAX_CONNECTION_AGE_MS}};
-  grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(client_a),
-                                   .args = client_a};
-  grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a),
-                                   .args = server_a};
-
-  config.init_client(&f, &client_args);
-  config.init_server(&f, &server_args);
-
-  /* check that we're still in idle, and start connecting */
-  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) ==
-             GRPC_CHANNEL_IDLE);
-  /* we'll go through some set of transitions (some might be missed), until
-     READY is reached */
-  while (state != GRPC_CHANNEL_READY) {
-    grpc_channel_watch_connectivity_state(
-        f.client, state, grpc_timeout_seconds_to_deadline(3), f.cq, tag(99));
-    CQ_EXPECT_COMPLETION(cqv, tag(99), 1);
-    cq_verify(cqv);
-    state = grpc_channel_check_connectivity_state(f.client, 0);
-    GPR_ASSERT(state == GRPC_CHANNEL_READY ||
-               state == GRPC_CHANNEL_CONNECTING ||
-               state == GRPC_CHANNEL_TRANSIENT_FAILURE);
-  }
-
-  /* Use a simple request to cancel and reset the max idle timer */
-  simple_request_body(config, &f);
-
-  /* wait for the channel to reach its maximum idle time */
-  grpc_channel_watch_connectivity_state(
-      f.client, GRPC_CHANNEL_READY,
-      grpc_timeout_milliseconds_to_deadline(MAX_CONNECTION_IDLE_MS + 3000),
-      f.cq, tag(99));
-  CQ_EXPECT_COMPLETION(cqv, tag(99), 1);
-  cq_verify(cqv);
-  state = grpc_channel_check_connectivity_state(f.client, 0);
-  GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
-             state == GRPC_CHANNEL_CONNECTING || state == GRPC_CHANNEL_IDLE);
-
-  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
-  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
-  cq_verify(cqv);
-
-  grpc_server_destroy(f.server);
-  grpc_channel_destroy(f.client);
-  grpc_completion_queue_shutdown(f.cq);
-  drain_cq(f.cq);
-  grpc_completion_queue_destroy(f.cq);
-  grpc_completion_queue_destroy(f.shutdown_cq);
-  config.tear_down_data(&f);
-
-  cq_verifier_destroy(cqv);
-}
-
-void max_connection_idle(grpc_end2end_test_config config) {
-  test_max_connection_idle(config);
-}
-
-void max_connection_idle_pre_init(void) {}
diff --git a/test/core/end2end/tests/max_connection_idle.cc b/test/core/end2end/tests/max_connection_idle.cc
new file mode 100644
index 0000000..d850e42
--- /dev/null
+++ b/test/core/end2end/tests/max_connection_idle.cc
@@ -0,0 +1,241 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <limits.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/end2end/cq_verifier.h"
+
+#define MAX_CONNECTION_IDLE_MS 500
+#define MAX_CONNECTION_AGE_MS 9999
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5),
+                                    NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture* f) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f->cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  char* peer;
+
+  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
+  c = grpc_channel_create_call(
+      f->client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
+  gpr_free(peer);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f->server, &s, &call_details,
+                               &request_metadata_recv, f->cq, f->cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  peer = grpc_call_get_peer(s);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
+  gpr_free(peer);
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
+  gpr_free(peer);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(0 == call_details.flags);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_max_connection_idle(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
+  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+
+  grpc_arg client_a[1];
+  client_a[0].type = GRPC_ARG_INTEGER;
+  client_a[0].key =
+      const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms");
+  client_a[0].value.integer = 1000;
+  grpc_arg server_a[2];
+  server_a[0].type = GRPC_ARG_INTEGER;
+  server_a[0].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_IDLE_MS);
+  server_a[0].value.integer = MAX_CONNECTION_IDLE_MS;
+  server_a[1].type = GRPC_ARG_INTEGER;
+  server_a[1].key = const_cast<char*>(GRPC_ARG_MAX_CONNECTION_AGE_MS);
+  server_a[1].value.integer = MAX_CONNECTION_AGE_MS;
+  grpc_channel_args client_args = {GPR_ARRAY_SIZE(client_a), client_a};
+  grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a};
+
+  config.init_client(&f, &client_args);
+  config.init_server(&f, &server_args);
+
+  /* check that we're still in idle, and start connecting */
+  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) ==
+             GRPC_CHANNEL_IDLE);
+  /* we'll go through some set of transitions (some might be missed), until
+     READY is reached */
+  while (state != GRPC_CHANNEL_READY) {
+    grpc_channel_watch_connectivity_state(
+        f.client, state, grpc_timeout_seconds_to_deadline(3), f.cq, tag(99));
+    CQ_EXPECT_COMPLETION(cqv, tag(99), 1);
+    cq_verify(cqv);
+    state = grpc_channel_check_connectivity_state(f.client, 0);
+    GPR_ASSERT(state == GRPC_CHANNEL_READY ||
+               state == GRPC_CHANNEL_CONNECTING ||
+               state == GRPC_CHANNEL_TRANSIENT_FAILURE);
+  }
+
+  /* Use a simple request to cancel and reset the max idle timer */
+  simple_request_body(config, &f);
+
+  /* wait for the channel to reach its maximum idle time */
+  grpc_channel_watch_connectivity_state(
+      f.client, GRPC_CHANNEL_READY,
+      grpc_timeout_milliseconds_to_deadline(MAX_CONNECTION_IDLE_MS + 3000),
+      f.cq, tag(99));
+  CQ_EXPECT_COMPLETION(cqv, tag(99), 1);
+  cq_verify(cqv);
+  state = grpc_channel_check_connectivity_state(f.client, 0);
+  GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
+             state == GRPC_CHANNEL_CONNECTING || state == GRPC_CHANNEL_IDLE);
+
+  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
+  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
+  cq_verify(cqv);
+
+  grpc_server_destroy(f.server);
+  grpc_channel_destroy(f.client);
+  grpc_completion_queue_shutdown(f.cq);
+  drain_cq(f.cq);
+  grpc_completion_queue_destroy(f.cq);
+  grpc_completion_queue_destroy(f.shutdown_cq);
+  config.tear_down_data(&f);
+
+  cq_verifier_destroy(cqv);
+}
+
+void max_connection_idle(grpc_end2end_test_config config) {
+  test_max_connection_idle(config);
+}
+
+void max_connection_idle_pre_init(void) {}
diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c
deleted file mode 100644
index 01eb8d3..0000000
--- a/test/core/end2end/tests/max_message_length.c
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/service_config.h"
-
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  // We intentionally do not pass the client and server args to
-  // create_fixture(), since we don't want the limit enforced on the
-  // proxy, only on the backend server.
-  f = config.create_fixture(NULL, NULL);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
-  grpc_event ev = grpc_completion_queue_next(
-      f->cq, grpc_timeout_seconds_to_deadline(5), NULL);
-  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  GPR_ASSERT(ev.tag == tag(1000));
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-// Test with request larger than the limit.
-// If send_limit is true, applies send limit on client; otherwise, applies
-// recv limit on server.
-static void test_max_message_length_on_request(grpc_end2end_test_config config,
-                                               bool send_limit,
-                                               bool use_service_config,
-                                               bool use_string_json_value) {
-  gpr_log(GPR_INFO,
-          "testing request with send_limit=%d use_service_config=%d "
-          "use_string_json_value=%d",
-          send_limit, use_service_config, use_string_json_value);
-
-  grpc_end2end_test_fixture f;
-  grpc_call *c = NULL;
-  grpc_call *s = NULL;
-  cq_verifier *cqv;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *recv_payload = NULL;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  grpc_channel_args *client_args = NULL;
-  grpc_channel_args *server_args = NULL;
-  if (use_service_config) {
-    // We don't currently support service configs on the server side.
-    GPR_ASSERT(send_limit);
-    grpc_arg arg;
-    arg.type = GRPC_ARG_STRING;
-    arg.key = GRPC_ARG_SERVICE_CONFIG;
-    arg.value.string =
-        use_string_json_value
-            ? "{\n"
-              "  \"methodConfig\": [ {\n"
-              "    \"name\": [\n"
-              "      { \"service\": \"service\", \"method\": \"method\" }\n"
-              "    ],\n"
-              "    \"maxRequestMessageBytes\": \"5\"\n"
-              "  } ]\n"
-              "}"
-            : "{\n"
-              "  \"methodConfig\": [ {\n"
-              "    \"name\": [\n"
-              "      { \"service\": \"service\", \"method\": \"method\" }\n"
-              "    ],\n"
-              "    \"maxRequestMessageBytes\": 5\n"
-              "  } ]\n"
-              "}";
-    client_args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
-  } else {
-    // Set limit via channel args.
-    grpc_arg arg;
-    arg.key = send_limit ? GRPC_ARG_MAX_SEND_MESSAGE_LENGTH
-                         : GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH;
-    arg.type = GRPC_ARG_INTEGER;
-    arg.value.integer = 5;
-    grpc_channel_args *args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
-    if (send_limit) {
-      client_args = args;
-    } else {
-      server_args = args;
-    }
-  }
-
-  f = begin_test(config, "test_max_request_message_length", client_args,
-                 server_args);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    if (client_args != NULL) grpc_channel_args_destroy(&exec_ctx, client_args);
-    if (server_args != NULL) grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  cqv = cq_verifier_create(f.cq);
-
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/service/method"),
-      get_host_override_slice("foo.test.google.fr:1234", config),
-      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  if (send_limit) {
-    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-    cq_verify(cqv);
-    goto done;
-  }
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &recv_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/service/method"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-done:
-  GPR_ASSERT(status == GRPC_STATUS_RESOURCE_EXHAUSTED);
-  GPR_ASSERT(
-      grpc_slice_str_cmp(
-          details, send_limit
-                       ? "Sent message larger than max (11 vs. 5)"
-                       : "Received message larger than max (11 vs. 5)") == 0);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(recv_payload);
-
-  grpc_call_unref(c);
-  if (s != NULL) grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-// Test with response larger than the limit.
-// If send_limit is true, applies send limit on server; otherwise, applies
-// recv limit on client.
-static void test_max_message_length_on_response(grpc_end2end_test_config config,
-                                                bool send_limit,
-                                                bool use_service_config,
-                                                bool use_string_json_value) {
-  gpr_log(GPR_INFO,
-          "testing response with send_limit=%d use_service_config=%d "
-          "use_string_json_value=%d",
-          send_limit, use_service_config, use_string_json_value);
-
-  grpc_end2end_test_fixture f;
-  grpc_call *c = NULL;
-  grpc_call *s = NULL;
-  cq_verifier *cqv;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  grpc_byte_buffer *recv_payload = NULL;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  grpc_channel_args *client_args = NULL;
-  grpc_channel_args *server_args = NULL;
-  if (use_service_config) {
-    // We don't currently support service configs on the server side.
-    GPR_ASSERT(!send_limit);
-    grpc_arg arg;
-    arg.type = GRPC_ARG_STRING;
-    arg.key = GRPC_ARG_SERVICE_CONFIG;
-    arg.value.string =
-        use_string_json_value
-            ? "{\n"
-              "  \"methodConfig\": [ {\n"
-              "    \"name\": [\n"
-              "      { \"service\": \"service\", \"method\": \"method\" }\n"
-              "    ],\n"
-              "    \"maxResponseMessageBytes\": \"5\"\n"
-              "  } ]\n"
-              "}"
-            : "{\n"
-              "  \"methodConfig\": [ {\n"
-              "    \"name\": [\n"
-              "      { \"service\": \"service\", \"method\": \"method\" }\n"
-              "    ],\n"
-              "    \"maxResponseMessageBytes\": 5\n"
-              "  } ]\n"
-              "}";
-    client_args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
-  } else {
-    // Set limit via channel args.
-    grpc_arg arg;
-    arg.key = send_limit ? GRPC_ARG_MAX_SEND_MESSAGE_LENGTH
-                         : GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH;
-    arg.type = GRPC_ARG_INTEGER;
-    arg.value.integer = 5;
-    grpc_channel_args *args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
-    if (send_limit) {
-      server_args = args;
-    } else {
-      client_args = args;
-    }
-  }
-
-  f = begin_test(config, "test_max_response_message_length", client_args,
-                 server_args);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    if (client_args != NULL) grpc_channel_args_destroy(&exec_ctx, client_args);
-    if (server_args != NULL) grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  cqv = cq_verifier_create(f.cq);
-
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/service/method"),
-      get_host_override_slice("foo.test.google.fr:1234", config),
-      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &recv_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/service/method"));
-  GPR_ASSERT(0 ==
-             grpc_slice_str_cmp(call_details.host, "foo.test.google.fr:1234"));
-
-  GPR_ASSERT(status == GRPC_STATUS_RESOURCE_EXHAUSTED);
-  GPR_ASSERT(
-      grpc_slice_str_cmp(
-          details, send_limit
-                       ? "Sent message larger than max (11 vs. 5)"
-                       : "Received message larger than max (11 vs. 5)") == 0);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(recv_payload);
-
-  grpc_call_unref(c);
-  if (s != NULL) grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void max_message_length(grpc_end2end_test_config config) {
-  test_max_message_length_on_request(config, false /* send_limit */,
-                                     false /* use_service_config */,
-                                     false /* use_string_json_value */);
-  test_max_message_length_on_request(config, true /* send_limit */,
-                                     false /* use_service_config */,
-                                     false /* use_string_json_value */);
-  test_max_message_length_on_response(config, false /* send_limit */,
-                                      false /* use_service_config */,
-                                      false /* use_string_json_value */);
-  test_max_message_length_on_response(config, true /* send_limit */,
-                                      false /* use_service_config */,
-                                      false /* use_string_json_value */);
-  test_max_message_length_on_request(config, true /* send_limit */,
-                                     true /* use_service_config */,
-                                     false /* use_string_json_value */);
-  test_max_message_length_on_request(config, true /* send_limit */,
-                                     true /* use_service_config */,
-                                     true /* use_string_json_value */);
-  test_max_message_length_on_response(config, false /* send_limit */,
-                                      true /* use_service_config */,
-                                      false /* use_string_json_value */);
-  test_max_message_length_on_response(config, false /* send_limit */,
-                                      true /* use_service_config */,
-                                      true /* use_string_json_value */);
-}
-
-void max_message_length_pre_init(void) {}
diff --git a/test/core/end2end/tests/max_message_length.cc b/test/core/end2end/tests/max_message_length.cc
new file mode 100644
index 0000000..3d677f1
--- /dev/null
+++ b/test/core/end2end/tests/max_message_length.cc
@@ -0,0 +1,511 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/metadata.h"
+#include "src/core/lib/transport/service_config.h"
+
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  // We intentionally do not pass the client and server args to
+  // create_fixture(), since we don't want the limit enforced on the
+  // proxy, only on the backend server.
+  f = config.create_fixture(NULL, NULL);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+  grpc_event ev = grpc_completion_queue_next(
+      f->cq, grpc_timeout_seconds_to_deadline(5), NULL);
+  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  GPR_ASSERT(ev.tag == tag(1000));
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+// Test with request larger than the limit.
+// If send_limit is true, applies send limit on client; otherwise, applies
+// recv limit on server.
+static void test_max_message_length_on_request(grpc_end2end_test_config config,
+                                               bool send_limit,
+                                               bool use_service_config,
+                                               bool use_string_json_value) {
+  gpr_log(GPR_INFO,
+          "testing request with send_limit=%d use_service_config=%d "
+          "use_string_json_value=%d",
+          send_limit, use_service_config, use_string_json_value);
+
+  grpc_end2end_test_fixture f;
+  grpc_call* c = NULL;
+  grpc_call* s = NULL;
+  cq_verifier* cqv;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* recv_payload = NULL;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  grpc_channel_args* client_args = NULL;
+  grpc_channel_args* server_args = NULL;
+  if (use_service_config) {
+    // We don't currently support service configs on the server side.
+    GPR_ASSERT(send_limit);
+    grpc_arg arg;
+    arg.type = GRPC_ARG_STRING;
+    arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG);
+    arg.value.string =
+        use_string_json_value
+            ? const_cast<char*>(
+                  "{\n"
+                  "  \"methodConfig\": [ {\n"
+                  "    \"name\": [\n"
+                  "      { \"service\": \"service\", \"method\": \"method\" }\n"
+                  "    ],\n"
+                  "    \"maxRequestMessageBytes\": \"5\"\n"
+                  "  } ]\n"
+                  "}")
+            : const_cast<char*>(
+                  "{\n"
+                  "  \"methodConfig\": [ {\n"
+                  "    \"name\": [\n"
+                  "      { \"service\": \"service\", \"method\": \"method\" }\n"
+                  "    ],\n"
+                  "    \"maxRequestMessageBytes\": 5\n"
+                  "  } ]\n"
+                  "}");
+    client_args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
+  } else {
+    // Set limit via channel args.
+    grpc_arg arg;
+    arg.key = send_limit
+                  ? const_cast<char*>(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH)
+                  : const_cast<char*>(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH);
+    arg.type = GRPC_ARG_INTEGER;
+    arg.value.integer = 5;
+    grpc_channel_args* args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
+    if (send_limit) {
+      client_args = args;
+    } else {
+      server_args = args;
+    }
+  }
+
+  f = begin_test(config, "test_max_request_message_length", client_args,
+                 server_args);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    if (client_args != NULL) grpc_channel_args_destroy(&exec_ctx, client_args);
+    if (server_args != NULL) grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  cqv = cq_verifier_create(f.cq);
+
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/service/method"),
+      get_host_override_slice("foo.test.google.fr:1234", config),
+      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  if (send_limit) {
+    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+    cq_verify(cqv);
+    goto done;
+  }
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &recv_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/service/method"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+done:
+  GPR_ASSERT(status == GRPC_STATUS_RESOURCE_EXHAUSTED);
+  GPR_ASSERT(
+      grpc_slice_str_cmp(
+          details, send_limit
+                       ? "Sent message larger than max (11 vs. 5)"
+                       : "Received message larger than max (11 vs. 5)") == 0);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(recv_payload);
+
+  grpc_call_unref(c);
+  if (s != NULL) grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+// Test with response larger than the limit.
+// If send_limit is true, applies send limit on server; otherwise, applies
+// recv limit on client.
+static void test_max_message_length_on_response(grpc_end2end_test_config config,
+                                                bool send_limit,
+                                                bool use_service_config,
+                                                bool use_string_json_value) {
+  gpr_log(GPR_INFO,
+          "testing response with send_limit=%d use_service_config=%d "
+          "use_string_json_value=%d",
+          send_limit, use_service_config, use_string_json_value);
+
+  grpc_end2end_test_fixture f;
+  grpc_call* c = NULL;
+  grpc_call* s = NULL;
+  cq_verifier* cqv;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  grpc_byte_buffer* recv_payload = NULL;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  grpc_channel_args* client_args = NULL;
+  grpc_channel_args* server_args = NULL;
+  if (use_service_config) {
+    // We don't currently support service configs on the server side.
+    GPR_ASSERT(!send_limit);
+    grpc_arg arg;
+    arg.type = GRPC_ARG_STRING;
+    arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG);
+    arg.value.string = const_cast<char*>(
+        use_string_json_value
+            ? "{\n"
+              "  \"methodConfig\": [ {\n"
+              "    \"name\": [\n"
+              "      { \"service\": \"service\", \"method\": \"method\" }\n"
+              "    ],\n"
+              "    \"maxResponseMessageBytes\": \"5\"\n"
+              "  } ]\n"
+              "}"
+            : "{\n"
+              "  \"methodConfig\": [ {\n"
+              "    \"name\": [\n"
+              "      { \"service\": \"service\", \"method\": \"method\" }\n"
+              "    ],\n"
+              "    \"maxResponseMessageBytes\": 5\n"
+              "  } ]\n"
+              "}");
+    client_args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
+  } else {
+    // Set limit via channel args.
+    grpc_arg arg;
+    arg.key = send_limit
+                  ? const_cast<char*>(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH)
+                  : const_cast<char*>(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH);
+    arg.type = GRPC_ARG_INTEGER;
+    arg.value.integer = 5;
+    grpc_channel_args* args = grpc_channel_args_copy_and_add(NULL, &arg, 1);
+    if (send_limit) {
+      server_args = args;
+    } else {
+      client_args = args;
+    }
+  }
+
+  f = begin_test(config, "test_max_response_message_length", client_args,
+                 server_args);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    if (client_args != NULL) grpc_channel_args_destroy(&exec_ctx, client_args);
+    if (server_args != NULL) grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  cqv = cq_verifier_create(f.cq);
+
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/service/method"),
+      get_host_override_slice("foo.test.google.fr:1234", config),
+      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &recv_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/service/method"));
+  GPR_ASSERT(0 ==
+             grpc_slice_str_cmp(call_details.host, "foo.test.google.fr:1234"));
+
+  GPR_ASSERT(status == GRPC_STATUS_RESOURCE_EXHAUSTED);
+  GPR_ASSERT(
+      grpc_slice_str_cmp(
+          details, send_limit
+                       ? "Sent message larger than max (11 vs. 5)"
+                       : "Received message larger than max (11 vs. 5)") == 0);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(recv_payload);
+
+  grpc_call_unref(c);
+  if (s != NULL) grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void max_message_length(grpc_end2end_test_config config) {
+  test_max_message_length_on_request(config, false /* send_limit */,
+                                     false /* use_service_config */,
+                                     false /* use_string_json_value */);
+  test_max_message_length_on_request(config, true /* send_limit */,
+                                     false /* use_service_config */,
+                                     false /* use_string_json_value */);
+  test_max_message_length_on_response(config, false /* send_limit */,
+                                      false /* use_service_config */,
+                                      false /* use_string_json_value */);
+  test_max_message_length_on_response(config, true /* send_limit */,
+                                      false /* use_service_config */,
+                                      false /* use_string_json_value */);
+  test_max_message_length_on_request(config, true /* send_limit */,
+                                     true /* use_service_config */,
+                                     false /* use_string_json_value */);
+  test_max_message_length_on_request(config, true /* send_limit */,
+                                     true /* use_service_config */,
+                                     true /* use_string_json_value */);
+  test_max_message_length_on_response(config, false /* send_limit */,
+                                      true /* use_service_config */,
+                                      false /* use_string_json_value */);
+  test_max_message_length_on_response(config, false /* send_limit */,
+                                      true /* use_service_config */,
+                                      true /* use_string_json_value */);
+}
+
+void max_message_length_pre_init(void) {}
diff --git a/test/core/end2end/tests/negative_deadline.c b/test/core/end2end/tests/negative_deadline.c
deleted file mode 100644
index c8667f4..0000000
--- a/test/core/end2end/tests/negative_deadline.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f, size_t num_ops) {
-  grpc_call *c;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-
-  gpr_log(GPR_DEBUG, "test with %" PRIuPTR " ops", num_ops);
-
-  gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_REALTIME);
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  GPR_ASSERT(num_ops <= (size_t)(op - ops));
-  error = grpc_call_start_batch(c, ops, num_ops, tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_simple_request(grpc_end2end_test_config config,
-                                       size_t num_ops) {
-  grpc_end2end_test_fixture f;
-
-  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
-  simple_request_body(config, f, num_ops);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void negative_deadline(grpc_end2end_test_config config) {
-  size_t i;
-  for (i = 1; i <= 4; i++) {
-    test_invoke_simple_request(config, i);
-  }
-}
-
-void negative_deadline_pre_init(void) {}
diff --git a/test/core/end2end/tests/negative_deadline.cc b/test/core/end2end/tests/negative_deadline.cc
new file mode 100644
index 0000000..0d56038
--- /dev/null
+++ b/test/core/end2end/tests/negative_deadline.cc
@@ -0,0 +1,172 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f, size_t num_ops) {
+  grpc_call* c;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+
+  gpr_log(GPR_DEBUG, "test with %" PRIuPTR " ops", num_ops);
+
+  gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_REALTIME);
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  GPR_ASSERT(num_ops <= (size_t)(op - ops));
+  error = grpc_call_start_batch(c, ops, num_ops, tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_simple_request(grpc_end2end_test_config config,
+                                       size_t num_ops) {
+  grpc_end2end_test_fixture f;
+
+  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
+  simple_request_body(config, f, num_ops);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void negative_deadline(grpc_end2end_test_config config) {
+  size_t i;
+  for (i = 1; i <= 4; i++) {
+    test_invoke_simple_request(config, i);
+  }
+}
+
+void negative_deadline_pre_init(void) {}
diff --git a/test/core/end2end/tests/network_status_change.c b/test/core/end2end/tests/network_status_change.c
deleted file mode 100644
index 4d77174..0000000
--- a/test/core/end2end/tests/network_status_change.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-/* this is a private API but exposed here for testing*/
-extern void grpc_network_status_shutdown_all_endpoints();
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(500);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Client sends a request with payload, server reads then returns status. */
-static void test_invoke_network_status_change(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  // Simulate the network loss event
-  grpc_network_status_shutdown_all_endpoints();
-
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  // TODO(makdharma) Update this when the shutdown_all_endpoints is implemented.
-  // Expected behavior of a RPC when network is lost.
-  // GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void network_status_change(grpc_end2end_test_config config) {
-  if (config.feature_mask &
-      FEATURE_MASK_DOES_NOT_SUPPORT_NETWORK_STATUS_CHANGE) {
-    return;
-  }
-  test_invoke_network_status_change(config);
-}
-
-void network_status_change_pre_init(void) {}
diff --git a/test/core/end2end/tests/network_status_change.cc b/test/core/end2end/tests/network_status_change.cc
new file mode 100644
index 0000000..088563c
--- /dev/null
+++ b/test/core/end2end/tests/network_status_change.cc
@@ -0,0 +1,239 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+/* this is a private API but exposed here for testing*/
+extern void grpc_network_status_shutdown_all_endpoints();
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(500);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Client sends a request with payload, server reads then returns status. */
+static void test_invoke_network_status_change(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  // Simulate the network loss event
+  grpc_network_status_shutdown_all_endpoints();
+
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  // TODO(makdharma) Update this when the shutdown_all_endpoints is implemented.
+  // Expected behavior of a RPC when network is lost.
+  // GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void network_status_change(grpc_end2end_test_config config) {
+  if (config.feature_mask &
+      FEATURE_MASK_DOES_NOT_SUPPORT_NETWORK_STATUS_CHANGE) {
+    return;
+  }
+  test_invoke_network_status_change(config);
+}
+
+void network_status_change_pre_init(void) {}
diff --git a/test/core/end2end/tests/no_logging.c b/test/core/end2end/tests/no_logging.c
deleted file mode 100644
index f7d50c2..0000000
--- a/test/core/end2end/tests/no_logging.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-enum { TIMEOUT = 200000 };
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-extern void gpr_default_log(gpr_log_func_args *args);
-
-static void test_no_log(gpr_log_func_args *args) {
-  char *message = NULL;
-  gpr_asprintf(&message, "Unwanted log: %s", args->message);
-  args->message = message;
-  gpr_default_log(args);
-  gpr_free(message);
-  abort();
-}
-
-static void test_no_error_log(gpr_log_func_args *args) {
-  if (args->severity == GPR_LOG_SEVERITY_ERROR) {
-    test_no_log(args);
-  }
-}
-
-static gpr_atm g_log_func = (gpr_atm)gpr_default_log;
-
-static void log_dispatcher_func(gpr_log_func_args *args) {
-  gpr_log_func log_func = (gpr_log_func)gpr_atm_no_barrier_load(&g_log_func);
-  log_func(args);
-}
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  char *peer;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_free(peer);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  peer = grpc_call_get_peer(s);
-  GPR_ASSERT(peer != NULL);
-  gpr_free(peer);
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_free(peer);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(0 == call_details.flags);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_simple_request(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-
-  f = begin_test(config, "test_invoke_simple_request_with_no_error_logging",
-                 NULL, NULL);
-  simple_request_body(config, f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
-  int i;
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_10_simple_requests_with_no_error_logging",
-                 NULL, NULL);
-  for (i = 0; i < 10; i++) {
-    simple_request_body(config, f);
-    gpr_log(GPR_INFO, "Passed simple request %d", i);
-  }
-  simple_request_body(config, f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_no_error_logging_in_entire_process(
-    grpc_end2end_test_config config) {
-  int i;
-  gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)test_no_error_log);
-  for (i = 0; i < 10; i++) {
-    test_invoke_simple_request(config);
-  }
-  test_invoke_10_simple_requests(config);
-  gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)gpr_default_log);
-}
-
-static void test_no_logging_in_one_request(grpc_end2end_test_config config) {
-  int i;
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_no_logging_in_last_request", NULL, NULL);
-  for (i = 0; i < 10; i++) {
-    simple_request_body(config, f);
-  }
-  gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)test_no_log);
-  simple_request_body(config, f);
-  gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)gpr_default_log);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void no_logging(grpc_end2end_test_config config) {
-  gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
-  grpc_tracer_set_enabled("all", 0);
-  gpr_set_log_function(log_dispatcher_func);
-  test_no_logging_in_one_request(config);
-  test_no_error_logging_in_entire_process(config);
-  gpr_set_log_function(gpr_default_log);
-}
-
-void no_logging_pre_init(void) {}
diff --git a/test/core/end2end/tests/no_logging.cc b/test/core/end2end/tests/no_logging.cc
new file mode 100644
index 0000000..1a7b57c
--- /dev/null
+++ b/test/core/end2end/tests/no_logging.cc
@@ -0,0 +1,296 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+enum { TIMEOUT = 200000 };
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+extern "C" void gpr_default_log(gpr_log_func_args* args);
+
+static void test_no_log(gpr_log_func_args* args) {
+  char* message = NULL;
+  gpr_asprintf(&message, "Unwanted log: %s", args->message);
+  args->message = message;
+  gpr_default_log(args);
+  gpr_free(message);
+  abort();
+}
+
+static void test_no_error_log(gpr_log_func_args* args) {
+  if (args->severity == GPR_LOG_SEVERITY_ERROR) {
+    test_no_log(args);
+  }
+}
+
+static gpr_atm g_log_func = (gpr_atm)gpr_default_log;
+
+static void log_dispatcher_func(gpr_log_func_args* args) {
+  gpr_log_func log_func = (gpr_log_func)gpr_atm_no_barrier_load(&g_log_func);
+  log_func(args);
+}
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  char* peer;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_free(peer);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  peer = grpc_call_get_peer(s);
+  GPR_ASSERT(peer != NULL);
+  gpr_free(peer);
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_free(peer);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(0 == call_details.flags);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_simple_request(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+
+  f = begin_test(config, "test_invoke_simple_request_with_no_error_logging",
+                 NULL, NULL);
+  simple_request_body(config, f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
+  int i;
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_10_simple_requests_with_no_error_logging",
+                 NULL, NULL);
+  for (i = 0; i < 10; i++) {
+    simple_request_body(config, f);
+    gpr_log(GPR_INFO, "Passed simple request %d", i);
+  }
+  simple_request_body(config, f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_no_error_logging_in_entire_process(
+    grpc_end2end_test_config config) {
+  int i;
+  gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)test_no_error_log);
+  for (i = 0; i < 10; i++) {
+    test_invoke_simple_request(config);
+  }
+  test_invoke_10_simple_requests(config);
+  gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)gpr_default_log);
+}
+
+static void test_no_logging_in_one_request(grpc_end2end_test_config config) {
+  int i;
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_no_logging_in_last_request", NULL, NULL);
+  for (i = 0; i < 10; i++) {
+    simple_request_body(config, f);
+  }
+  gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)test_no_log);
+  simple_request_body(config, f);
+  gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)gpr_default_log);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void no_logging(grpc_end2end_test_config config) {
+  gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
+  grpc_tracer_set_enabled("all", 0);
+  gpr_set_log_function(log_dispatcher_func);
+  test_no_logging_in_one_request(config);
+  test_no_error_logging_in_entire_process(config);
+  gpr_set_log_function(gpr_default_log);
+}
+
+void no_logging_pre_init(void) {}
diff --git a/test/core/end2end/tests/no_op.c b/test/core/end2end/tests/no_op.c
deleted file mode 100644
index 8400c27..0000000
--- a/test/core/end2end/tests/no_op.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void test_no_op(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f = begin_test(config, "no-op", NULL, NULL);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void no_op(grpc_end2end_test_config config) { test_no_op(config); }
-
-void no_op_pre_init(void) {}
diff --git a/test/core/end2end/tests/no_op.cc b/test/core/end2end/tests/no_op.cc
new file mode 100644
index 0000000..98cf5eb
--- /dev/null
+++ b/test/core/end2end/tests/no_op.cc
@@ -0,0 +1,95 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void test_no_op(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f = begin_test(config, "no-op", NULL, NULL);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void no_op(grpc_end2end_test_config config) { test_no_op(config); }
+
+void no_op_pre_init(void) {}
diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c
deleted file mode 100644
index d98eed6..0000000
--- a/test/core/end2end/tests/payload.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Creates and returns a grpc_slice containing random alphanumeric characters.
- */
-static grpc_slice generate_random_slice() {
-  size_t i;
-  static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
-  char *output;
-  const size_t output_size = 1024 * 1024;
-  output = (char *)gpr_malloc(output_size);
-  for (i = 0; i < output_size - 1; ++i) {
-    output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
-  }
-  output[output_size - 1] = '\0';
-  grpc_slice out = grpc_slice_from_copied_string(output);
-  gpr_free(output);
-  return out;
-}
-
-static void request_response_with_payload(grpc_end2end_test_config config,
-                                          grpc_end2end_test_fixture f) {
-  /* Create large request and response bodies. These are big enough to require
-   * multiple round trips to deliver to the peer, and their exact contents of
-   * will be verified on completion. */
-  grpc_slice request_payload_slice = generate_random_slice();
-  grpc_slice response_payload_slice = generate_random_slice();
-
-  grpc_call *c;
-  grpc_call *s;
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = n_seconds_from_now(60);
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_slice(request_payload_recv, request_payload_slice));
-  GPR_ASSERT(
-      byte_buffer_eq_slice(response_payload_recv, response_payload_slice));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-}
-
-/* Client sends a request with payload, server reads then returns a response
-   payload and status. */
-static void test_invoke_request_response_with_payload(
-    grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_invoke_request_response_with_payload", NULL, NULL);
-  request_response_with_payload(config, f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_invoke_10_request_response_with_payload(
-    grpc_end2end_test_config config) {
-  int i;
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_invoke_10_request_response_with_payload", NULL, NULL);
-  for (i = 0; i < 10; i++) {
-    request_response_with_payload(config, f);
-  }
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void payload(grpc_end2end_test_config config) {
-  test_invoke_request_response_with_payload(config);
-  test_invoke_10_request_response_with_payload(config);
-}
-
-void payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/payload.cc b/test/core/end2end/tests/payload.cc
new file mode 100644
index 0000000..0ff9461
--- /dev/null
+++ b/test/core/end2end/tests/payload.cc
@@ -0,0 +1,288 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Creates and returns a grpc_slice containing random alphanumeric characters.
+ */
+static grpc_slice generate_random_slice() {
+  size_t i;
+  static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
+  char* output;
+  const size_t output_size = 1024 * 1024;
+  output = (char*)gpr_malloc(output_size);
+  for (i = 0; i < output_size - 1; ++i) {
+    output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
+  }
+  output[output_size - 1] = '\0';
+  grpc_slice out = grpc_slice_from_copied_string(output);
+  gpr_free(output);
+  return out;
+}
+
+static void request_response_with_payload(grpc_end2end_test_config config,
+                                          grpc_end2end_test_fixture f) {
+  /* Create large request and response bodies. These are big enough to require
+   * multiple round trips to deliver to the peer, and their exact contents of
+   * will be verified on completion. */
+  grpc_slice request_payload_slice = generate_random_slice();
+  grpc_slice response_payload_slice = generate_random_slice();
+
+  grpc_call* c;
+  grpc_call* s;
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = n_seconds_from_now(60);
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_slice(request_payload_recv, request_payload_slice));
+  GPR_ASSERT(
+      byte_buffer_eq_slice(response_payload_recv, response_payload_slice));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+}
+
+/* Client sends a request with payload, server reads then returns a response
+   payload and status. */
+static void test_invoke_request_response_with_payload(
+    grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_invoke_request_response_with_payload", NULL, NULL);
+  request_response_with_payload(config, f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_invoke_10_request_response_with_payload(
+    grpc_end2end_test_config config) {
+  int i;
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_invoke_10_request_response_with_payload", NULL, NULL);
+  for (i = 0; i < 10; i++) {
+    request_response_with_payload(config, f);
+  }
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void payload(grpc_end2end_test_config config) {
+  test_invoke_request_response_with_payload(config);
+  test_invoke_10_request_response_with_payload(config);
+}
+
+void payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/ping.c b/test/core/end2end/tests/ping.c
deleted file mode 100644
index 23c8256..0000000
--- a/test/core/end2end/tests/ping.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "test/core/end2end/cq_verifier.h"
-
-#define PING_NUM 5
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static void test_ping(grpc_end2end_test_config config,
-                      int min_time_between_pings_ms) {
-  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
-  int i;
-
-  grpc_arg client_a[] = {
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS,
-       .value.integer = 10},
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA,
-       .value.integer = 0},
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS,
-       .value.integer = 1}};
-  grpc_arg server_a[] = {
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS,
-       .value.integer = 0},
-      {.type = GRPC_ARG_INTEGER,
-       .key = GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS,
-       .value.integer = 1}};
-  grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(client_a),
-                                   .args = client_a};
-  grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a),
-                                   .args = server_a};
-
-  config.init_client(&f, &client_args);
-  config.init_server(&f, &server_args);
-
-  grpc_channel_ping(f.client, f.cq, tag(0), NULL);
-  CQ_EXPECT_COMPLETION(cqv, tag(0), 0);
-
-  /* check that we're still in idle, and start connecting */
-  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) ==
-             GRPC_CHANNEL_IDLE);
-  /* we'll go through some set of transitions (some might be missed), until
-     READY is reached */
-  while (state != GRPC_CHANNEL_READY) {
-    grpc_channel_watch_connectivity_state(
-        f.client, state,
-        gpr_time_add(grpc_timeout_seconds_to_deadline(3),
-                     gpr_time_from_millis(min_time_between_pings_ms * PING_NUM,
-                                          GPR_TIMESPAN)),
-        f.cq, tag(99));
-    CQ_EXPECT_COMPLETION(cqv, tag(99), 1);
-    cq_verify(cqv);
-    state = grpc_channel_check_connectivity_state(f.client, 0);
-    GPR_ASSERT(state == GRPC_CHANNEL_READY ||
-               state == GRPC_CHANNEL_CONNECTING ||
-               state == GRPC_CHANNEL_TRANSIENT_FAILURE);
-  }
-
-  for (i = 1; i <= PING_NUM; i++) {
-    grpc_channel_ping(f.client, f.cq, tag(i), NULL);
-    CQ_EXPECT_COMPLETION(cqv, tag(i), 1);
-    cq_verify(cqv);
-  }
-
-  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
-  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
-  cq_verify(cqv);
-
-  /* cleanup server */
-  grpc_server_destroy(f.server);
-
-  grpc_channel_destroy(f.client);
-  grpc_completion_queue_shutdown(f.cq);
-  grpc_completion_queue_destroy(f.cq);
-
-  /* f.shutdown_cq is not used in this test */
-  grpc_completion_queue_destroy(f.shutdown_cq);
-  config.tear_down_data(&f);
-
-  cq_verifier_destroy(cqv);
-}
-
-void ping(grpc_end2end_test_config config) {
-  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
-  test_ping(config, 0);
-  test_ping(config, 100);
-}
-
-void ping_pre_init(void) {}
diff --git a/test/core/end2end/tests/ping.cc b/test/core/end2end/tests/ping.cc
new file mode 100644
index 0000000..88f62c0
--- /dev/null
+++ b/test/core/end2end/tests/ping.cc
@@ -0,0 +1,118 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/end2end/cq_verifier.h"
+
+#define PING_NUM 5
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static void test_ping(grpc_end2end_test_config config,
+                      int min_time_between_pings_ms) {
+  grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+  int i;
+
+  grpc_arg client_a[3];
+  client_a[0].type = GRPC_ARG_INTEGER;
+  client_a[0].key =
+      const_cast<char*>(GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS);
+  client_a[0].value.integer = 10;
+  client_a[1].type = GRPC_ARG_INTEGER;
+  client_a[1].key = const_cast<char*>(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA);
+  client_a[1].value.integer = 0;
+  client_a[2].type = GRPC_ARG_INTEGER;
+  client_a[2].key = const_cast<char*>(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS);
+  client_a[2].value.integer = 1;
+  grpc_arg server_a[2];
+  server_a[0].type = GRPC_ARG_INTEGER;
+  server_a[0].key =
+      const_cast<char*>(GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS);
+  server_a[0].value.integer = 0;
+  server_a[1].type = GRPC_ARG_INTEGER;
+  server_a[1].key = const_cast<char*>(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS);
+  server_a[1].value.integer = 1;
+  grpc_channel_args client_args = {GPR_ARRAY_SIZE(client_a), client_a};
+  grpc_channel_args server_args = {GPR_ARRAY_SIZE(server_a), server_a};
+
+  config.init_client(&f, &client_args);
+  config.init_server(&f, &server_args);
+
+  grpc_channel_ping(f.client, f.cq, tag(0), NULL);
+  CQ_EXPECT_COMPLETION(cqv, tag(0), 0);
+
+  /* check that we're still in idle, and start connecting */
+  GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) ==
+             GRPC_CHANNEL_IDLE);
+  /* we'll go through some set of transitions (some might be missed), until
+     READY is reached */
+  while (state != GRPC_CHANNEL_READY) {
+    grpc_channel_watch_connectivity_state(
+        f.client, state,
+        gpr_time_add(grpc_timeout_seconds_to_deadline(3),
+                     gpr_time_from_millis(min_time_between_pings_ms * PING_NUM,
+                                          GPR_TIMESPAN)),
+        f.cq, tag(99));
+    CQ_EXPECT_COMPLETION(cqv, tag(99), 1);
+    cq_verify(cqv);
+    state = grpc_channel_check_connectivity_state(f.client, 0);
+    GPR_ASSERT(state == GRPC_CHANNEL_READY ||
+               state == GRPC_CHANNEL_CONNECTING ||
+               state == GRPC_CHANNEL_TRANSIENT_FAILURE);
+  }
+
+  for (i = 1; i <= PING_NUM; i++) {
+    grpc_channel_ping(f.client, f.cq, tag(i), NULL);
+    CQ_EXPECT_COMPLETION(cqv, tag(i), 1);
+    cq_verify(cqv);
+  }
+
+  grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
+  CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1);
+  cq_verify(cqv);
+
+  /* cleanup server */
+  grpc_server_destroy(f.server);
+
+  grpc_channel_destroy(f.client);
+  grpc_completion_queue_shutdown(f.cq);
+  grpc_completion_queue_destroy(f.cq);
+
+  /* f.shutdown_cq is not used in this test */
+  grpc_completion_queue_destroy(f.shutdown_cq);
+  config.tear_down_data(&f);
+
+  cq_verifier_destroy(cqv);
+}
+
+void ping(grpc_end2end_test_config config) {
+  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
+  test_ping(config, 0);
+  test_ping(config, 100);
+}
+
+void ping_pre_init(void) {}
diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c
deleted file mode 100644
index 1c44262..0000000
--- a/test/core/end2end/tests/ping_pong_streaming.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Client pings and server pongs. Repeat messages rounds before finishing. */
-static void test_pingpong_streaming(grpc_end2end_test_config config,
-                                    int messages) {
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_pingpong_streaming", NULL, NULL);
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  grpc_byte_buffer *request_payload;
-  grpc_byte_buffer *request_payload_recv;
-  grpc_byte_buffer *response_payload;
-  grpc_byte_buffer *response_payload_recv;
-  int i;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(100));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(100), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  for (i = 0; i < messages; i++) {
-    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = request_payload;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &response_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &request_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-    cq_verify(cqv);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = response_payload;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-    CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-    cq_verify(cqv);
-
-    grpc_byte_buffer_destroy(request_payload);
-    grpc_byte_buffer_destroy(response_payload);
-    grpc_byte_buffer_destroy(request_payload_recv);
-    grpc_byte_buffer_destroy(response_payload_recv);
-  }
-
-  grpc_slice_unref(request_payload_slice);
-  grpc_slice_unref(response_payload_slice);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
-  cq_verify(cqv);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_slice_unref(details);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void ping_pong_streaming(grpc_end2end_test_config config) {
-  int i;
-
-  for (i = 1; i < 10; i++) {
-    test_pingpong_streaming(config, i);
-  }
-}
-
-void ping_pong_streaming_pre_init(void) {}
diff --git a/test/core/end2end/tests/ping_pong_streaming.cc b/test/core/end2end/tests/ping_pong_streaming.cc
new file mode 100644
index 0000000..3c2e76b
--- /dev/null
+++ b/test/core/end2end/tests/ping_pong_streaming.cc
@@ -0,0 +1,276 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Client pings and server pongs. Repeat messages rounds before finishing. */
+static void test_pingpong_streaming(grpc_end2end_test_config config,
+                                    int messages) {
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_pingpong_streaming", NULL, NULL);
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  grpc_byte_buffer* request_payload;
+  grpc_byte_buffer* request_payload_recv;
+  grpc_byte_buffer* response_payload;
+  grpc_byte_buffer* response_payload_recv;
+  int i;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(100));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(100), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  for (i = 0; i < messages; i++) {
+    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = request_payload;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &response_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &request_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+    cq_verify(cqv);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = response_payload;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+    CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+    cq_verify(cqv);
+
+    grpc_byte_buffer_destroy(request_payload);
+    grpc_byte_buffer_destroy(response_payload);
+    grpc_byte_buffer_destroy(request_payload_recv);
+    grpc_byte_buffer_destroy(response_payload_recv);
+  }
+
+  grpc_slice_unref(request_payload_slice);
+  grpc_slice_unref(response_payload_slice);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
+  cq_verify(cqv);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_slice_unref(details);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void ping_pong_streaming(grpc_end2end_test_config config) {
+  int i;
+
+  for (i = 1; i < 10; i++) {
+    test_pingpong_streaming(config, i);
+  }
+}
+
+void ping_pong_streaming_pre_init(void) {}
diff --git a/test/core/end2end/tests/proxy_auth.c b/test/core/end2end/tests/proxy_auth.c
deleted file mode 100644
index d922049..0000000
--- a/test/core/end2end/tests/proxy_auth.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * This test is for checking whether proxy authentication is working with HTTP
- * Connect.
- */
-#include "test/core/end2end/end2end_tests.h"
-#include "test/core/end2end/fixtures/http_proxy_fixture.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  char *peer;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
-  gpr_free(peer);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  peer = grpc_call_get_peer(s);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
-  gpr_free(peer);
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
-  gpr_free(peer);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(0 == call_details.flags);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_proxy_auth(grpc_end2end_test_config config) {
-  /* Indicate that the proxy requires user auth */
-  grpc_arg client_arg = {.type = GRPC_ARG_STRING,
-                         .key = GRPC_ARG_HTTP_PROXY_AUTH_CREDS,
-                         .value.string = GRPC_TEST_HTTP_PROXY_AUTH_CREDS};
-  grpc_channel_args client_args = {.num_args = 1, .args = &client_arg};
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_proxy_auth", &client_args, NULL);
-  simple_request_body(config, f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void proxy_auth(grpc_end2end_test_config config) {
-  test_invoke_proxy_auth(config);
-}
-
-void proxy_auth_pre_init(void) {}
diff --git a/test/core/end2end/tests/proxy_auth.cc b/test/core/end2end/tests/proxy_auth.cc
new file mode 100644
index 0000000..d5dce7c
--- /dev/null
+++ b/test/core/end2end/tests/proxy_auth.cc
@@ -0,0 +1,236 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * This test is for checking whether proxy authentication is working with HTTP
+ * Connect.
+ */
+#include "test/core/end2end/end2end_tests.h"
+#include "test/core/end2end/fixtures/http_proxy_fixture.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  char* peer;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
+  gpr_free(peer);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  peer = grpc_call_get_peer(s);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
+  gpr_free(peer);
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
+  gpr_free(peer);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(0 == call_details.flags);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_proxy_auth(grpc_end2end_test_config config) {
+  /* Indicate that the proxy requires user auth */
+  grpc_arg client_arg;
+  client_arg.type = GRPC_ARG_STRING;
+  client_arg.key = const_cast<char*>(GRPC_ARG_HTTP_PROXY_AUTH_CREDS);
+  client_arg.value.string = const_cast<char*>(GRPC_TEST_HTTP_PROXY_AUTH_CREDS);
+  grpc_channel_args client_args = {1, &client_arg};
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_proxy_auth", &client_args, NULL);
+  simple_request_body(config, f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void proxy_auth(grpc_end2end_test_config config) {
+  test_invoke_proxy_auth(config);
+}
+
+void proxy_auth_pre_init(void) {}
diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c
deleted file mode 100644
index 4598029..0000000
--- a/test/core/end2end/tests/registered_call.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f, void *rc) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_registered_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, rc, deadline, NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_simple_request(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_simple_request", NULL, NULL);
-  void *rc = grpc_channel_register_call(
-      f.client, "/foo",
-      get_host_override_string("foo.test.google.fr:1234", config), NULL);
-
-  simple_request_body(config, f, rc);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
-  int i;
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
-  void *rc = grpc_channel_register_call(
-      f.client, "/foo",
-      get_host_override_string("foo.test.google.fr:1234", config), NULL);
-
-  for (i = 0; i < 10; i++) {
-    simple_request_body(config, f, rc);
-    gpr_log(GPR_INFO, "Passed simple request %d", i);
-  }
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void registered_call(grpc_end2end_test_config config) {
-  test_invoke_simple_request(config);
-  test_invoke_10_simple_requests(config);
-}
-
-void registered_call_pre_init(void) {}
diff --git a/test/core/end2end/tests/registered_call.cc b/test/core/end2end/tests/registered_call.cc
new file mode 100644
index 0000000..b43ca04
--- /dev/null
+++ b/test/core/end2end/tests/registered_call.cc
@@ -0,0 +1,227 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f, void* rc) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_registered_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, rc, deadline, NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_simple_request(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_simple_request", NULL, NULL);
+  void* rc = grpc_channel_register_call(
+      f.client, "/foo",
+      get_host_override_string("foo.test.google.fr:1234", config), NULL);
+
+  simple_request_body(config, f, rc);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
+  int i;
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
+  void* rc = grpc_channel_register_call(
+      f.client, "/foo",
+      get_host_override_string("foo.test.google.fr:1234", config), NULL);
+
+  for (i = 0; i < 10; i++) {
+    simple_request_body(config, f, rc);
+    gpr_log(GPR_INFO, "Passed simple request %d", i);
+  }
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void registered_call(grpc_end2end_test_config config) {
+  test_invoke_simple_request(config);
+  test_invoke_10_simple_requests(config);
+}
+
+void registered_call_pre_init(void) {}
diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c
deleted file mode 100644
index dfb7d58..0000000
--- a/test/core/end2end/tests/request_with_flags.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/transport/byte_stream.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void test_invoke_request_with_flags(
-    grpc_end2end_test_config config, uint32_t *flags_for_op,
-    grpc_call_error call_start_batch_expected_result) {
-  grpc_call *c;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_request_with_flags", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  grpc_call_error expectation;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = flags_for_op[op->op];
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = flags_for_op[op->op];
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = flags_for_op[op->op];
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = flags_for_op[op->op];
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = flags_for_op[op->op];
-  op->reserved = NULL;
-  op++;
-  expectation = call_start_batch_expected_result;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(expectation == error);
-
-  if (expectation == GRPC_CALL_OK) {
-    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-    cq_verify(cqv);
-    grpc_slice_unref(details);
-  }
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void request_with_flags(grpc_end2end_test_config config) {
-  size_t i;
-  uint32_t flags_for_op[GRPC_OP_RECV_CLOSE_ON_SERVER + 1];
-
-  {
-    /* check that all grpc_op_types fail when their flag value is set to an
-     * invalid value */
-    int indices[] = {GRPC_OP_SEND_INITIAL_METADATA, GRPC_OP_SEND_MESSAGE,
-                     GRPC_OP_SEND_CLOSE_FROM_CLIENT,
-                     GRPC_OP_RECV_INITIAL_METADATA,
-                     GRPC_OP_RECV_STATUS_ON_CLIENT};
-    for (i = 0; i < GPR_ARRAY_SIZE(indices); ++i) {
-      memset(flags_for_op, 0, sizeof(flags_for_op));
-      flags_for_op[indices[i]] = 0xDEADBEEF;
-      test_invoke_request_with_flags(config, flags_for_op,
-                                     GRPC_CALL_ERROR_INVALID_FLAGS);
-    }
-  }
-  {
-    /* check valid operation with allowed flags for GRPC_OP_SEND_BUFFER */
-    uint32_t flags[] = {GRPC_WRITE_BUFFER_HINT, GRPC_WRITE_NO_COMPRESS,
-                        GRPC_WRITE_INTERNAL_COMPRESS};
-    for (i = 0; i < GPR_ARRAY_SIZE(flags); ++i) {
-      memset(flags_for_op, 0, sizeof(flags_for_op));
-      flags_for_op[GRPC_OP_SEND_MESSAGE] = flags[i];
-      test_invoke_request_with_flags(config, flags_for_op, GRPC_CALL_OK);
-    }
-  }
-}
-
-void request_with_flags_pre_init(void) {}
diff --git a/test/core/end2end/tests/request_with_flags.cc b/test/core/end2end/tests/request_with_flags.cc
new file mode 100644
index 0000000..77c9318
--- /dev/null
+++ b/test/core/end2end/tests/request_with_flags.cc
@@ -0,0 +1,208 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/transport/byte_stream.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void test_invoke_request_with_flags(
+    grpc_end2end_test_config config, uint32_t* flags_for_op,
+    grpc_call_error call_start_batch_expected_result) {
+  grpc_call* c;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_request_with_flags", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  grpc_call_error expectation;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = flags_for_op[op->op];
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = flags_for_op[op->op];
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = flags_for_op[op->op];
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = flags_for_op[op->op];
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = flags_for_op[op->op];
+  op->reserved = NULL;
+  op++;
+  expectation = call_start_batch_expected_result;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(expectation == error);
+
+  if (expectation == GRPC_CALL_OK) {
+    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+    cq_verify(cqv);
+    grpc_slice_unref(details);
+  }
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void request_with_flags(grpc_end2end_test_config config) {
+  size_t i;
+  uint32_t flags_for_op[GRPC_OP_RECV_CLOSE_ON_SERVER + 1];
+
+  {
+    /* check that all grpc_op_types fail when their flag value is set to an
+     * invalid value */
+    int indices[] = {GRPC_OP_SEND_INITIAL_METADATA, GRPC_OP_SEND_MESSAGE,
+                     GRPC_OP_SEND_CLOSE_FROM_CLIENT,
+                     GRPC_OP_RECV_INITIAL_METADATA,
+                     GRPC_OP_RECV_STATUS_ON_CLIENT};
+    for (i = 0; i < GPR_ARRAY_SIZE(indices); ++i) {
+      memset(flags_for_op, 0, sizeof(flags_for_op));
+      flags_for_op[indices[i]] = 0xDEADBEEF;
+      test_invoke_request_with_flags(config, flags_for_op,
+                                     GRPC_CALL_ERROR_INVALID_FLAGS);
+    }
+  }
+  {
+    /* check valid operation with allowed flags for GRPC_OP_SEND_BUFFER */
+    uint32_t flags[] = {GRPC_WRITE_BUFFER_HINT, GRPC_WRITE_NO_COMPRESS,
+                        GRPC_WRITE_INTERNAL_COMPRESS};
+    for (i = 0; i < GPR_ARRAY_SIZE(flags); ++i) {
+      memset(flags_for_op, 0, sizeof(flags_for_op));
+      flags_for_op[GRPC_OP_SEND_MESSAGE] = flags[i];
+      test_invoke_request_with_flags(config, flags_for_op, GRPC_CALL_OK);
+    }
+  }
+}
+
+void request_with_flags_pre_init(void) {}
diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c
deleted file mode 100644
index 575e54c..0000000
--- a/test/core/end2end/tests/request_with_payload.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Client sends a request with payload, server reads then returns status. */
-static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void request_with_payload(grpc_end2end_test_config config) {
-  test_invoke_request_with_payload(config);
-}
-
-void request_with_payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/request_with_payload.cc b/test/core/end2end/tests/request_with_payload.cc
new file mode 100644
index 0000000..9461442
--- /dev/null
+++ b/test/core/end2end/tests/request_with_payload.cc
@@ -0,0 +1,230 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Client sends a request with payload, server reads then returns status. */
+static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void request_with_payload(grpc_end2end_test_config config) {
+  test_invoke_request_with_payload(config);
+}
+
+void request_with_payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c
deleted file mode 100644
index 93befee..0000000
--- a/test/core/end2end/tests/resource_quota_server.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Creates and returns a grpc_slice containing random alphanumeric characters.
- */
-static grpc_slice generate_random_slice() {
-  size_t i;
-  static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
-  char *output;
-  const size_t output_size = 1024 * 1024;
-  output = (char *)gpr_malloc(output_size);
-  for (i = 0; i < output_size - 1; ++i) {
-    output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
-  }
-  output[output_size - 1] = '\0';
-  grpc_slice out = grpc_slice_from_copied_string(output);
-  gpr_free(output);
-  return out;
-}
-
-void resource_quota_server(grpc_end2end_test_config config) {
-  if (config.feature_mask &
-      FEATURE_MASK_DOES_NOT_SUPPORT_RESOURCE_QUOTA_SERVER) {
-    return;
-  }
-  grpc_resource_quota *resource_quota =
-      grpc_resource_quota_create("test_server");
-  grpc_resource_quota_resize(resource_quota, 5 * 1024 * 1024);
-
-#define NUM_CALLS 100
-#define CLIENT_BASE_TAG 0x1000
-#define SERVER_START_BASE_TAG 0x2000
-#define SERVER_RECV_BASE_TAG 0x3000
-#define SERVER_END_BASE_TAG 0x4000
-
-  grpc_arg arg;
-  arg.key = GRPC_ARG_RESOURCE_QUOTA;
-  arg.type = GRPC_ARG_POINTER;
-  arg.value.pointer.p = resource_quota;
-  arg.value.pointer.vtable = grpc_resource_quota_arg_vtable();
-  grpc_channel_args args = {1, &arg};
-
-  grpc_end2end_test_fixture f =
-      begin_test(config, "resource_quota_server", NULL, &args);
-
-  /* Create large request and response bodies. These are big enough to require
-   * multiple round trips to deliver to the peer, and their exact contents of
-   * will be verified on completion. */
-  grpc_slice request_payload_slice = generate_random_slice();
-
-  grpc_call **client_calls =
-      (grpc_call **)malloc(sizeof(grpc_call *) * NUM_CALLS);
-  grpc_call **server_calls =
-      (grpc_call **)malloc(sizeof(grpc_call *) * NUM_CALLS);
-  grpc_metadata_array *initial_metadata_recv =
-      (grpc_metadata_array *)malloc(sizeof(grpc_metadata_array) * NUM_CALLS);
-  grpc_metadata_array *trailing_metadata_recv =
-      (grpc_metadata_array *)malloc(sizeof(grpc_metadata_array) * NUM_CALLS);
-  grpc_metadata_array *request_metadata_recv =
-      (grpc_metadata_array *)malloc(sizeof(grpc_metadata_array) * NUM_CALLS);
-  grpc_call_details *call_details =
-      (grpc_call_details *)malloc(sizeof(grpc_call_details) * NUM_CALLS);
-  grpc_status_code *status =
-      (grpc_status_code *)malloc(sizeof(grpc_status_code) * NUM_CALLS);
-  grpc_slice *details = (grpc_slice *)malloc(sizeof(grpc_slice) * NUM_CALLS);
-  grpc_byte_buffer **request_payload =
-      (grpc_byte_buffer **)malloc(sizeof(grpc_byte_buffer *) * NUM_CALLS);
-  grpc_byte_buffer **request_payload_recv =
-      (grpc_byte_buffer **)malloc(sizeof(grpc_byte_buffer *) * NUM_CALLS);
-  int *was_cancelled = (int *)malloc(sizeof(int) * NUM_CALLS);
-  grpc_call_error error;
-  int pending_client_calls = 0;
-  int pending_server_start_calls = 0;
-  int pending_server_recv_calls = 0;
-  int pending_server_end_calls = 0;
-  int cancelled_calls_on_client = 0;
-  int cancelled_calls_on_server = 0;
-  int deadline_exceeded = 0;
-  int unavailable = 0;
-
-  grpc_op ops[6];
-  grpc_op *op;
-
-  for (int i = 0; i < NUM_CALLS; i++) {
-    grpc_metadata_array_init(&initial_metadata_recv[i]);
-    grpc_metadata_array_init(&trailing_metadata_recv[i]);
-    grpc_metadata_array_init(&request_metadata_recv[i]);
-    grpc_call_details_init(&call_details[i]);
-    request_payload[i] = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-    request_payload_recv[i] = NULL;
-    was_cancelled[i] = 0;
-  }
-
-  for (int i = 0; i < NUM_CALLS; i++) {
-    error = grpc_server_request_call(
-        f.server, &server_calls[i], &call_details[i], &request_metadata_recv[i],
-        f.cq, f.cq, tag(SERVER_START_BASE_TAG + i));
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    pending_server_start_calls++;
-  }
-
-  for (int i = 0; i < NUM_CALLS; i++) {
-    client_calls[i] = grpc_channel_create_call(
-        f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-        grpc_slice_from_static_string("/foo"),
-        get_host_override_slice("foo.test.google.fr", config),
-        n_seconds_from_now(60), NULL);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_INITIAL_METADATA;
-    op->data.send_initial_metadata.count = 0;
-    op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = request_payload[i];
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_RECV_INITIAL_METADATA;
-    op->data.recv_initial_metadata.recv_initial_metadata =
-        &initial_metadata_recv[i];
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-    op->data.recv_status_on_client.trailing_metadata =
-        &trailing_metadata_recv[i];
-    op->data.recv_status_on_client.status = &status[i];
-    op->data.recv_status_on_client.status_details = &details[i];
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(client_calls[i], ops, (size_t)(op - ops),
-                                  tag(CLIENT_BASE_TAG + i), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    pending_client_calls++;
-  }
-
-  while (pending_client_calls + pending_server_recv_calls +
-             pending_server_end_calls >
-         0) {
-    grpc_event ev =
-        grpc_completion_queue_next(f.cq, n_seconds_from_now(60), NULL);
-    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-
-    int ev_tag = (int)(intptr_t)ev.tag;
-    if (ev_tag < CLIENT_BASE_TAG) {
-      abort(); /* illegal tag */
-    } else if (ev_tag < SERVER_START_BASE_TAG) {
-      /* client call finished */
-      int call_id = ev_tag - CLIENT_BASE_TAG;
-      GPR_ASSERT(call_id >= 0);
-      GPR_ASSERT(call_id < NUM_CALLS);
-      switch (status[call_id]) {
-        case GRPC_STATUS_RESOURCE_EXHAUSTED:
-          cancelled_calls_on_client++;
-          break;
-        case GRPC_STATUS_DEADLINE_EXCEEDED:
-          deadline_exceeded++;
-          break;
-        case GRPC_STATUS_UNAVAILABLE:
-          unavailable++;
-          break;
-        case GRPC_STATUS_OK:
-          break;
-        default:
-          gpr_log(GPR_ERROR, "Unexpected status code: %d", status[call_id]);
-          abort();
-      }
-      GPR_ASSERT(pending_client_calls > 0);
-
-      grpc_metadata_array_destroy(&initial_metadata_recv[call_id]);
-      grpc_metadata_array_destroy(&trailing_metadata_recv[call_id]);
-      grpc_call_unref(client_calls[call_id]);
-      grpc_slice_unref(details[call_id]);
-      grpc_byte_buffer_destroy(request_payload[call_id]);
-
-      pending_client_calls--;
-    } else if (ev_tag < SERVER_RECV_BASE_TAG) {
-      /* new incoming call to the server */
-      int call_id = ev_tag - SERVER_START_BASE_TAG;
-      GPR_ASSERT(call_id >= 0);
-      GPR_ASSERT(call_id < NUM_CALLS);
-
-      memset(ops, 0, sizeof(ops));
-      op = ops;
-      op->op = GRPC_OP_SEND_INITIAL_METADATA;
-      op->data.send_initial_metadata.count = 0;
-      op->flags = 0;
-      op->reserved = NULL;
-      op++;
-      op->op = GRPC_OP_RECV_MESSAGE;
-      op->data.recv_message.recv_message = &request_payload_recv[call_id];
-      op->flags = 0;
-      op->reserved = NULL;
-      op++;
-      error =
-          grpc_call_start_batch(server_calls[call_id], ops, (size_t)(op - ops),
-                                tag(SERVER_RECV_BASE_TAG + call_id), NULL);
-      GPR_ASSERT(GRPC_CALL_OK == error);
-
-      GPR_ASSERT(pending_server_start_calls > 0);
-      pending_server_start_calls--;
-      pending_server_recv_calls++;
-
-      grpc_call_details_destroy(&call_details[call_id]);
-      grpc_metadata_array_destroy(&request_metadata_recv[call_id]);
-    } else if (ev_tag < SERVER_END_BASE_TAG) {
-      /* finished read on the server */
-      int call_id = ev_tag - SERVER_RECV_BASE_TAG;
-      GPR_ASSERT(call_id >= 0);
-      GPR_ASSERT(call_id < NUM_CALLS);
-
-      if (ev.success) {
-        if (request_payload_recv[call_id] != NULL) {
-          grpc_byte_buffer_destroy(request_payload_recv[call_id]);
-          request_payload_recv[call_id] = NULL;
-        }
-      } else {
-        GPR_ASSERT(request_payload_recv[call_id] == NULL);
-      }
-
-      memset(ops, 0, sizeof(ops));
-      op = ops;
-      op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-      op->data.recv_close_on_server.cancelled = &was_cancelled[call_id];
-      op->flags = 0;
-      op->reserved = NULL;
-      op++;
-      op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-      op->data.send_status_from_server.trailing_metadata_count = 0;
-      op->data.send_status_from_server.status = GRPC_STATUS_OK;
-      grpc_slice status_details = grpc_slice_from_static_string("xyz");
-      op->data.send_status_from_server.status_details = &status_details;
-      op->flags = 0;
-      op->reserved = NULL;
-      op++;
-      error =
-          grpc_call_start_batch(server_calls[call_id], ops, (size_t)(op - ops),
-                                tag(SERVER_END_BASE_TAG + call_id), NULL);
-      GPR_ASSERT(GRPC_CALL_OK == error);
-
-      GPR_ASSERT(pending_server_recv_calls > 0);
-      pending_server_recv_calls--;
-      pending_server_end_calls++;
-    } else {
-      int call_id = ev_tag - SERVER_END_BASE_TAG;
-      GPR_ASSERT(call_id >= 0);
-      GPR_ASSERT(call_id < NUM_CALLS);
-
-      if (was_cancelled[call_id]) {
-        cancelled_calls_on_server++;
-      }
-      GPR_ASSERT(pending_server_end_calls > 0);
-      pending_server_end_calls--;
-
-      grpc_call_unref(server_calls[call_id]);
-    }
-  }
-
-  gpr_log(GPR_INFO,
-          "Done. %d total calls: %d cancelled at server, %d cancelled at "
-          "client, %d timed out, %d unavailable.",
-          NUM_CALLS, cancelled_calls_on_server, cancelled_calls_on_client,
-          deadline_exceeded, unavailable);
-
-  grpc_slice_unref(request_payload_slice);
-  grpc_resource_quota_unref(resource_quota);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-
-  free(client_calls);
-  free(server_calls);
-  free(initial_metadata_recv);
-  free(trailing_metadata_recv);
-  free(request_metadata_recv);
-  free(call_details);
-  free(status);
-  free(details);
-  free(request_payload);
-  free(request_payload_recv);
-  free(was_cancelled);
-}
-
-void resource_quota_server_pre_init(void) {}
diff --git a/test/core/end2end/tests/resource_quota_server.cc b/test/core/end2end/tests/resource_quota_server.cc
new file mode 100644
index 0000000..dd00c98
--- /dev/null
+++ b/test/core/end2end/tests/resource_quota_server.cc
@@ -0,0 +1,377 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Creates and returns a grpc_slice containing random alphanumeric characters.
+ */
+static grpc_slice generate_random_slice() {
+  size_t i;
+  static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
+  char* output;
+  const size_t output_size = 1024 * 1024;
+  output = (char*)gpr_malloc(output_size);
+  for (i = 0; i < output_size - 1; ++i) {
+    output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
+  }
+  output[output_size - 1] = '\0';
+  grpc_slice out = grpc_slice_from_copied_string(output);
+  gpr_free(output);
+  return out;
+}
+
+void resource_quota_server(grpc_end2end_test_config config) {
+  if (config.feature_mask &
+      FEATURE_MASK_DOES_NOT_SUPPORT_RESOURCE_QUOTA_SERVER) {
+    return;
+  }
+  grpc_resource_quota* resource_quota =
+      grpc_resource_quota_create("test_server");
+  grpc_resource_quota_resize(resource_quota, 5 * 1024 * 1024);
+
+#define NUM_CALLS 100
+#define CLIENT_BASE_TAG 0x1000
+#define SERVER_START_BASE_TAG 0x2000
+#define SERVER_RECV_BASE_TAG 0x3000
+#define SERVER_END_BASE_TAG 0x4000
+
+  grpc_arg arg;
+  arg.key = const_cast<char*>(GRPC_ARG_RESOURCE_QUOTA);
+  arg.type = GRPC_ARG_POINTER;
+  arg.value.pointer.p = resource_quota;
+  arg.value.pointer.vtable = grpc_resource_quota_arg_vtable();
+  grpc_channel_args args = {1, &arg};
+
+  grpc_end2end_test_fixture f =
+      begin_test(config, "resource_quota_server", NULL, &args);
+
+  /* Create large request and response bodies. These are big enough to require
+   * multiple round trips to deliver to the peer, and their exact contents of
+   * will be verified on completion. */
+  grpc_slice request_payload_slice = generate_random_slice();
+
+  grpc_call** client_calls =
+      (grpc_call**)malloc(sizeof(grpc_call*) * NUM_CALLS);
+  grpc_call** server_calls =
+      (grpc_call**)malloc(sizeof(grpc_call*) * NUM_CALLS);
+  grpc_metadata_array* initial_metadata_recv =
+      (grpc_metadata_array*)malloc(sizeof(grpc_metadata_array) * NUM_CALLS);
+  grpc_metadata_array* trailing_metadata_recv =
+      (grpc_metadata_array*)malloc(sizeof(grpc_metadata_array) * NUM_CALLS);
+  grpc_metadata_array* request_metadata_recv =
+      (grpc_metadata_array*)malloc(sizeof(grpc_metadata_array) * NUM_CALLS);
+  grpc_call_details* call_details =
+      (grpc_call_details*)malloc(sizeof(grpc_call_details) * NUM_CALLS);
+  grpc_status_code* status =
+      (grpc_status_code*)malloc(sizeof(grpc_status_code) * NUM_CALLS);
+  grpc_slice* details = (grpc_slice*)malloc(sizeof(grpc_slice) * NUM_CALLS);
+  grpc_byte_buffer** request_payload =
+      (grpc_byte_buffer**)malloc(sizeof(grpc_byte_buffer*) * NUM_CALLS);
+  grpc_byte_buffer** request_payload_recv =
+      (grpc_byte_buffer**)malloc(sizeof(grpc_byte_buffer*) * NUM_CALLS);
+  int* was_cancelled = (int*)malloc(sizeof(int) * NUM_CALLS);
+  grpc_call_error error;
+  int pending_client_calls = 0;
+  int pending_server_start_calls = 0;
+  int pending_server_recv_calls = 0;
+  int pending_server_end_calls = 0;
+  int cancelled_calls_on_client = 0;
+  int cancelled_calls_on_server = 0;
+  int deadline_exceeded = 0;
+  int unavailable = 0;
+
+  grpc_op ops[6];
+  grpc_op* op;
+
+  for (int i = 0; i < NUM_CALLS; i++) {
+    grpc_metadata_array_init(&initial_metadata_recv[i]);
+    grpc_metadata_array_init(&trailing_metadata_recv[i]);
+    grpc_metadata_array_init(&request_metadata_recv[i]);
+    grpc_call_details_init(&call_details[i]);
+    request_payload[i] = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+    request_payload_recv[i] = NULL;
+    was_cancelled[i] = 0;
+  }
+
+  for (int i = 0; i < NUM_CALLS; i++) {
+    error = grpc_server_request_call(
+        f.server, &server_calls[i], &call_details[i], &request_metadata_recv[i],
+        f.cq, f.cq, tag(SERVER_START_BASE_TAG + i));
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    pending_server_start_calls++;
+  }
+
+  for (int i = 0; i < NUM_CALLS; i++) {
+    client_calls[i] = grpc_channel_create_call(
+        f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+        grpc_slice_from_static_string("/foo"),
+        get_host_override_slice("foo.test.google.fr", config),
+        n_seconds_from_now(60), NULL);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_INITIAL_METADATA;
+    op->data.send_initial_metadata.count = 0;
+    op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = request_payload[i];
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_RECV_INITIAL_METADATA;
+    op->data.recv_initial_metadata.recv_initial_metadata =
+        &initial_metadata_recv[i];
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+    op->data.recv_status_on_client.trailing_metadata =
+        &trailing_metadata_recv[i];
+    op->data.recv_status_on_client.status = &status[i];
+    op->data.recv_status_on_client.status_details = &details[i];
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(client_calls[i], ops, (size_t)(op - ops),
+                                  tag(CLIENT_BASE_TAG + i), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    pending_client_calls++;
+  }
+
+  while (pending_client_calls + pending_server_recv_calls +
+             pending_server_end_calls >
+         0) {
+    grpc_event ev =
+        grpc_completion_queue_next(f.cq, n_seconds_from_now(60), NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+
+    int ev_tag = (int)(intptr_t)ev.tag;
+    if (ev_tag < CLIENT_BASE_TAG) {
+      abort(); /* illegal tag */
+    } else if (ev_tag < SERVER_START_BASE_TAG) {
+      /* client call finished */
+      int call_id = ev_tag - CLIENT_BASE_TAG;
+      GPR_ASSERT(call_id >= 0);
+      GPR_ASSERT(call_id < NUM_CALLS);
+      switch (status[call_id]) {
+        case GRPC_STATUS_RESOURCE_EXHAUSTED:
+          cancelled_calls_on_client++;
+          break;
+        case GRPC_STATUS_DEADLINE_EXCEEDED:
+          deadline_exceeded++;
+          break;
+        case GRPC_STATUS_UNAVAILABLE:
+          unavailable++;
+          break;
+        case GRPC_STATUS_OK:
+          break;
+        default:
+          gpr_log(GPR_ERROR, "Unexpected status code: %d", status[call_id]);
+          abort();
+      }
+      GPR_ASSERT(pending_client_calls > 0);
+
+      grpc_metadata_array_destroy(&initial_metadata_recv[call_id]);
+      grpc_metadata_array_destroy(&trailing_metadata_recv[call_id]);
+      grpc_call_unref(client_calls[call_id]);
+      grpc_slice_unref(details[call_id]);
+      grpc_byte_buffer_destroy(request_payload[call_id]);
+
+      pending_client_calls--;
+    } else if (ev_tag < SERVER_RECV_BASE_TAG) {
+      /* new incoming call to the server */
+      int call_id = ev_tag - SERVER_START_BASE_TAG;
+      GPR_ASSERT(call_id >= 0);
+      GPR_ASSERT(call_id < NUM_CALLS);
+
+      memset(ops, 0, sizeof(ops));
+      op = ops;
+      op->op = GRPC_OP_SEND_INITIAL_METADATA;
+      op->data.send_initial_metadata.count = 0;
+      op->flags = 0;
+      op->reserved = NULL;
+      op++;
+      op->op = GRPC_OP_RECV_MESSAGE;
+      op->data.recv_message.recv_message = &request_payload_recv[call_id];
+      op->flags = 0;
+      op->reserved = NULL;
+      op++;
+      error =
+          grpc_call_start_batch(server_calls[call_id], ops, (size_t)(op - ops),
+                                tag(SERVER_RECV_BASE_TAG + call_id), NULL);
+      GPR_ASSERT(GRPC_CALL_OK == error);
+
+      GPR_ASSERT(pending_server_start_calls > 0);
+      pending_server_start_calls--;
+      pending_server_recv_calls++;
+
+      grpc_call_details_destroy(&call_details[call_id]);
+      grpc_metadata_array_destroy(&request_metadata_recv[call_id]);
+    } else if (ev_tag < SERVER_END_BASE_TAG) {
+      /* finished read on the server */
+      int call_id = ev_tag - SERVER_RECV_BASE_TAG;
+      GPR_ASSERT(call_id >= 0);
+      GPR_ASSERT(call_id < NUM_CALLS);
+
+      if (ev.success) {
+        if (request_payload_recv[call_id] != NULL) {
+          grpc_byte_buffer_destroy(request_payload_recv[call_id]);
+          request_payload_recv[call_id] = NULL;
+        }
+      } else {
+        GPR_ASSERT(request_payload_recv[call_id] == NULL);
+      }
+
+      memset(ops, 0, sizeof(ops));
+      op = ops;
+      op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+      op->data.recv_close_on_server.cancelled = &was_cancelled[call_id];
+      op->flags = 0;
+      op->reserved = NULL;
+      op++;
+      op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+      op->data.send_status_from_server.trailing_metadata_count = 0;
+      op->data.send_status_from_server.status = GRPC_STATUS_OK;
+      grpc_slice status_details = grpc_slice_from_static_string("xyz");
+      op->data.send_status_from_server.status_details = &status_details;
+      op->flags = 0;
+      op->reserved = NULL;
+      op++;
+      error =
+          grpc_call_start_batch(server_calls[call_id], ops, (size_t)(op - ops),
+                                tag(SERVER_END_BASE_TAG + call_id), NULL);
+      GPR_ASSERT(GRPC_CALL_OK == error);
+
+      GPR_ASSERT(pending_server_recv_calls > 0);
+      pending_server_recv_calls--;
+      pending_server_end_calls++;
+    } else {
+      int call_id = ev_tag - SERVER_END_BASE_TAG;
+      GPR_ASSERT(call_id >= 0);
+      GPR_ASSERT(call_id < NUM_CALLS);
+
+      if (was_cancelled[call_id]) {
+        cancelled_calls_on_server++;
+      }
+      GPR_ASSERT(pending_server_end_calls > 0);
+      pending_server_end_calls--;
+
+      grpc_call_unref(server_calls[call_id]);
+    }
+  }
+
+  gpr_log(GPR_INFO,
+          "Done. %d total calls: %d cancelled at server, %d cancelled at "
+          "client, %d timed out, %d unavailable.",
+          NUM_CALLS, cancelled_calls_on_server, cancelled_calls_on_client,
+          deadline_exceeded, unavailable);
+
+  grpc_slice_unref(request_payload_slice);
+  grpc_resource_quota_unref(resource_quota);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+
+  free(client_calls);
+  free(server_calls);
+  free(initial_metadata_recv);
+  free(trailing_metadata_recv);
+  free(request_metadata_recv);
+  free(call_details);
+  free(status);
+  free(details);
+  free(request_payload);
+  free(request_payload_recv);
+  free(was_cancelled);
+}
+
+void resource_quota_server_pre_init(void) {}
diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c
deleted file mode 100644
index 49b9f27..0000000
--- a/test/core/end2end/tests/server_finishes_request.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_invoke_simple_request(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-
-  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
-  simple_request_body(config, f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void server_finishes_request(grpc_end2end_test_config config) {
-  test_invoke_simple_request(config);
-}
-
-void server_finishes_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/server_finishes_request.cc b/test/core/end2end/tests/server_finishes_request.cc
new file mode 100644
index 0000000..50544a6
--- /dev/null
+++ b/test/core/end2end/tests/server_finishes_request.cc
@@ -0,0 +1,206 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_invoke_simple_request(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+
+  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
+  simple_request_body(config, f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void server_finishes_request(grpc_end2end_test_config config) {
+  test_invoke_simple_request(config);
+}
+
+void server_finishes_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/shutdown_finishes_calls.c b/test/core/end2end/tests/shutdown_finishes_calls.c
deleted file mode 100644
index f90359f..0000000
--- a/test/core/end2end/tests/shutdown_finishes_calls.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  /* f->shutdown_cq is not used in this test */
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void test_early_server_shutdown_finishes_inflight_calls(
-    grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->data.send_initial_metadata.metadata = NULL;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  /* shutdown and destroy the server */
-  grpc_server_shutdown_and_notify(f.server, f.cq, tag(1000));
-  grpc_server_cancel_all_calls(f.server);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1000), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  grpc_server_destroy(f.server);
-
-  // new code should give INTERNAL, some older code will give UNAVAILABLE
-  GPR_ASSERT(status == GRPC_STATUS_INTERNAL ||
-             status == GRPC_STATUS_UNAVAILABLE);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void shutdown_finishes_calls(grpc_end2end_test_config config) {
-  test_early_server_shutdown_finishes_inflight_calls(config);
-}
-
-void shutdown_finishes_calls_pre_init(void) {}
diff --git a/test/core/end2end/tests/shutdown_finishes_calls.cc b/test/core/end2end/tests/shutdown_finishes_calls.cc
new file mode 100644
index 0000000..26a53e5
--- /dev/null
+++ b/test/core/end2end/tests/shutdown_finishes_calls.cc
@@ -0,0 +1,189 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  /* f->shutdown_cq is not used in this test */
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void test_early_server_shutdown_finishes_inflight_calls(
+    grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->data.send_initial_metadata.metadata = NULL;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  /* shutdown and destroy the server */
+  grpc_server_shutdown_and_notify(f.server, f.cq, tag(1000));
+  grpc_server_cancel_all_calls(f.server);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1000), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  grpc_server_destroy(f.server);
+
+  // new code should give INTERNAL, some older code will give UNAVAILABLE
+  GPR_ASSERT(status == GRPC_STATUS_INTERNAL ||
+             status == GRPC_STATUS_UNAVAILABLE);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void shutdown_finishes_calls(grpc_end2end_test_config config) {
+  test_early_server_shutdown_finishes_inflight_calls(config);
+}
+
+void shutdown_finishes_calls_pre_init(void) {}
diff --git a/test/core/end2end/tests/shutdown_finishes_tags.c b/test/core/end2end/tests/shutdown_finishes_tags.c
deleted file mode 100644
index 7914cc9..0000000
--- a/test/core/end2end/tests/shutdown_finishes_tags.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  /* f->shutdown_cq is not used in this test */
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void test_early_server_shutdown_finishes_tags(
-    grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_early_server_shutdown_finishes_tags", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_call *s = (grpc_call *)(uintptr_t)1;
-  grpc_call_details call_details;
-  grpc_metadata_array request_metadata_recv;
-
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  /* upon shutdown, the server should finish all requested calls indicating
-     no new call */
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-  grpc_server_shutdown_and_notify(f.server, f.cq, tag(1000));
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 0);
-  CQ_EXPECT_COMPLETION(cqv, tag(1000), 1);
-  cq_verify(cqv);
-  GPR_ASSERT(s == NULL);
-
-  grpc_server_destroy(f.server);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-  cq_verifier_destroy(cqv);
-}
-
-void shutdown_finishes_tags(grpc_end2end_test_config config) {
-  test_early_server_shutdown_finishes_tags(config);
-}
-
-void shutdown_finishes_tags_pre_init(void) {}
diff --git a/test/core/end2end/tests/shutdown_finishes_tags.cc b/test/core/end2end/tests/shutdown_finishes_tags.cc
new file mode 100644
index 0000000..0275a1e
--- /dev/null
+++ b/test/core/end2end/tests/shutdown_finishes_tags.cc
@@ -0,0 +1,110 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  /* f->shutdown_cq is not used in this test */
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void test_early_server_shutdown_finishes_tags(
+    grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_early_server_shutdown_finishes_tags", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_call* s = (grpc_call*)(uintptr_t)1;
+  grpc_call_details call_details;
+  grpc_metadata_array request_metadata_recv;
+
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  /* upon shutdown, the server should finish all requested calls indicating
+     no new call */
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+  grpc_server_shutdown_and_notify(f.server, f.cq, tag(1000));
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 0);
+  CQ_EXPECT_COMPLETION(cqv, tag(1000), 1);
+  cq_verify(cqv);
+  GPR_ASSERT(s == NULL);
+
+  grpc_server_destroy(f.server);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+  cq_verifier_destroy(cqv);
+}
+
+void shutdown_finishes_tags(grpc_end2end_test_config config) {
+  test_early_server_shutdown_finishes_tags(config);
+}
+
+void shutdown_finishes_tags_pre_init(void) {}
diff --git a/test/core/end2end/tests/simple_cacheable_request.c b/test/core/end2end/tests/simple_cacheable_request.c
deleted file mode 100644
index faa5c19..0000000
--- a/test/core/end2end/tests/simple_cacheable_request.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-enum { TIMEOUT = 200000 };
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Request/response with metadata and payload.*/
-static void test_cacheable_request_response_with_metadata_and_payload(
-    grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
-                              grpc_slice_from_static_string("val1"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}},
-                             {grpc_slice_from_static_string("key2"),
-                              grpc_slice_from_static_string("val2"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}}};
-  grpc_metadata meta_s[2] = {{grpc_slice_from_static_string("key3"),
-                              grpc_slice_from_static_string("val3"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}},
-                             {grpc_slice_from_static_string("key4"),
-                              grpc_slice_from_static_string("val4"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}}};
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_cacheable_request_response_with_metadata_and_payload", NULL,
-      NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 2;
-  op->data.send_initial_metadata.metadata = meta_c;
-  op->flags = GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 2;
-  op->data.send_initial_metadata.metadata = meta_s;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_REQUEST_PROXYING) {
-    // Our simple proxy does not support cacheable requests
-  } else {
-    GPR_ASSERT(GRPC_INITIAL_METADATA_CACHEABLE_REQUEST & call_details.flags);
-  }
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
-  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
-  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key1", "val1"));
-  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key2", "val2"));
-  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key3", "val3"));
-  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key4", "val4"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void simple_cacheable_request(grpc_end2end_test_config config) {
-  test_cacheable_request_response_with_metadata_and_payload(config);
-}
-
-void simple_cacheable_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/simple_cacheable_request.cc b/test/core/end2end/tests/simple_cacheable_request.cc
new file mode 100644
index 0000000..e2ee7bf
--- /dev/null
+++ b/test/core/end2end/tests/simple_cacheable_request.cc
@@ -0,0 +1,280 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+enum { TIMEOUT = 200000 };
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Request/response with metadata and payload.*/
+static void test_cacheable_request_response_with_metadata_and_payload(
+    grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
+                              grpc_slice_from_static_string("val1"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}},
+                             {grpc_slice_from_static_string("key2"),
+                              grpc_slice_from_static_string("val2"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}}};
+  grpc_metadata meta_s[2] = {{grpc_slice_from_static_string("key3"),
+                              grpc_slice_from_static_string("val3"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}},
+                             {grpc_slice_from_static_string("key4"),
+                              grpc_slice_from_static_string("val4"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}}};
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_cacheable_request_response_with_metadata_and_payload", NULL,
+      NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 2;
+  op->data.send_initial_metadata.metadata = meta_c;
+  op->flags = GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 2;
+  op->data.send_initial_metadata.metadata = meta_s;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_REQUEST_PROXYING) {
+    // Our simple proxy does not support cacheable requests
+  } else {
+    GPR_ASSERT(GRPC_INITIAL_METADATA_CACHEABLE_REQUEST & call_details.flags);
+  }
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
+  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
+  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key1", "val1"));
+  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key2", "val2"));
+  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key3", "val3"));
+  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key4", "val4"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void simple_cacheable_request(grpc_end2end_test_config config) {
+  test_cacheable_request_response_with_metadata_and_payload(config);
+}
+
+void simple_cacheable_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c
deleted file mode 100644
index c3f66a0..0000000
--- a/test/core/end2end/tests/simple_delayed_request.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_delayed_request_body(grpc_end2end_test_config config,
-                                        grpc_end2end_test_fixture *f,
-                                        grpc_channel_args *client_args,
-                                        grpc_channel_args *server_args,
-                                        long delay_us) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f->cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  config.init_client(f, client_args);
-  config.init_server(f, server_args);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f->client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f->server, &s, &call_details,
-                               &request_metadata_recv, f->cq, f->cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-}
-
-static void test_simple_delayed_request_short(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-  grpc_channel_args client_args;
-  grpc_arg arg_array[1];
-  arg_array[0].type = GRPC_ARG_INTEGER;
-  arg_array[0].key = "grpc.testing.fixed_reconnect_backoff_ms";
-  arg_array[0].value.integer = 1000;
-  client_args.args = arg_array;
-  client_args.num_args = 1;
-
-  gpr_log(GPR_INFO, "Running test: %s/%s", "test_simple_delayed_request_short",
-          config.name);
-  f = config.create_fixture(NULL, NULL);
-
-  simple_delayed_request_body(config, &f, &client_args, NULL, 100000);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_simple_delayed_request_long(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-  grpc_channel_args client_args;
-  grpc_arg arg_array[1];
-  arg_array[0].type = GRPC_ARG_INTEGER;
-  arg_array[0].key = "grpc.testing.fixed_reconnect_backoff_ms";
-  arg_array[0].value.integer = 1000;
-  client_args.args = arg_array;
-  client_args.num_args = 1;
-
-  gpr_log(GPR_INFO, "Running test: %s/%s", "test_simple_delayed_request_long",
-          config.name);
-  f = config.create_fixture(NULL, NULL);
-  /* This timeout should be longer than a single retry */
-  simple_delayed_request_body(config, &f, &client_args, NULL, 1500000);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void simple_delayed_request(grpc_end2end_test_config config) {
-  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
-  test_simple_delayed_request_short(config);
-  test_simple_delayed_request_long(config);
-}
-
-void simple_delayed_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/simple_delayed_request.cc b/test/core/end2end/tests/simple_delayed_request.cc
new file mode 100644
index 0000000..eef36c9
--- /dev/null
+++ b/test/core/end2end/tests/simple_delayed_request.cc
@@ -0,0 +1,235 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_delayed_request_body(grpc_end2end_test_config config,
+                                        grpc_end2end_test_fixture* f,
+                                        grpc_channel_args* client_args,
+                                        grpc_channel_args* server_args,
+                                        long delay_us) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f->cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  config.init_client(f, client_args);
+  config.init_server(f, server_args);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f->client, NULL, GRPC_PROPAGATE_DEFAULTS, f->cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f->server, &s, &call_details,
+                               &request_metadata_recv, f->cq, f->cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+}
+
+static void test_simple_delayed_request_short(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+  grpc_channel_args client_args;
+  grpc_arg arg_array[1];
+  arg_array[0].type = GRPC_ARG_INTEGER;
+  arg_array[0].key =
+      const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms");
+  arg_array[0].value.integer = 1000;
+  client_args.args = arg_array;
+  client_args.num_args = 1;
+
+  gpr_log(GPR_INFO, "Running test: %s/%s", "test_simple_delayed_request_short",
+          config.name);
+  f = config.create_fixture(NULL, NULL);
+
+  simple_delayed_request_body(config, &f, &client_args, NULL, 100000);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_simple_delayed_request_long(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+  grpc_channel_args client_args;
+  grpc_arg arg_array[1];
+  arg_array[0].type = GRPC_ARG_INTEGER;
+  arg_array[0].key =
+      const_cast<char*>("grpc.testing.fixed_reconnect_backoff_ms");
+  arg_array[0].value.integer = 1000;
+  client_args.args = arg_array;
+  client_args.num_args = 1;
+
+  gpr_log(GPR_INFO, "Running test: %s/%s", "test_simple_delayed_request_long",
+          config.name);
+  f = config.create_fixture(NULL, NULL);
+  /* This timeout should be longer than a single retry */
+  simple_delayed_request_body(config, &f, &client_args, NULL, 1500000);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void simple_delayed_request(grpc_end2end_test_config config) {
+  GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION);
+  test_simple_delayed_request_short(config);
+  test_simple_delayed_request_long(config);
+}
+
+void simple_delayed_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c
deleted file mode 100644
index 17e7f69..0000000
--- a/test/core/end2end/tests/simple_metadata.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Request/response with metadata and payload.*/
-static void test_request_response_with_metadata_and_payload(
-    grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
-                              grpc_slice_from_static_string("val1"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}},
-                             {grpc_slice_from_static_string("key2"),
-                              grpc_slice_from_static_string("val2"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}}};
-  grpc_metadata meta_s[2] = {{grpc_slice_from_static_string("key3"),
-                              grpc_slice_from_static_string("val3"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}},
-                             {grpc_slice_from_static_string("key4"),
-                              grpc_slice_from_static_string("val4"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}}};
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_request_response_with_metadata_and_payload", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 2;
-  op->data.send_initial_metadata.metadata = meta_c;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 2;
-  op->data.send_initial_metadata.metadata = meta_s;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
-  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
-  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key1", "val1"));
-  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key2", "val2"));
-  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key3", "val3"));
-  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key4", "val4"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void simple_metadata(grpc_end2end_test_config config) {
-  test_request_response_with_metadata_and_payload(config);
-}
-
-void simple_metadata_pre_init(void) {}
diff --git a/test/core/end2end/tests/simple_metadata.cc b/test/core/end2end/tests/simple_metadata.cc
new file mode 100644
index 0000000..3b3d5ad
--- /dev/null
+++ b/test/core/end2end/tests/simple_metadata.cc
@@ -0,0 +1,272 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Request/response with metadata and payload.*/
+static void test_request_response_with_metadata_and_payload(
+    grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
+                              grpc_slice_from_static_string("val1"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}},
+                             {grpc_slice_from_static_string("key2"),
+                              grpc_slice_from_static_string("val2"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}}};
+  grpc_metadata meta_s[2] = {{grpc_slice_from_static_string("key3"),
+                              grpc_slice_from_static_string("val3"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}},
+                             {grpc_slice_from_static_string("key4"),
+                              grpc_slice_from_static_string("val4"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}}};
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_request_response_with_metadata_and_payload", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 2;
+  op->data.send_initial_metadata.metadata = meta_c;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 2;
+  op->data.send_initial_metadata.metadata = meta_s;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
+  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
+  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key1", "val1"));
+  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key2", "val2"));
+  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key3", "val3"));
+  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key4", "val4"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void simple_metadata(grpc_end2end_test_config config) {
+  test_request_response_with_metadata_and_payload(config);
+}
+
+void simple_metadata_pre_init(void) {}
diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c
deleted file mode 100644
index 7ce7e1f..0000000
--- a/test/core/end2end/tests/simple_request.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/debug/stats.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void simple_request_body(grpc_end2end_test_config config,
-                                grpc_end2end_test_fixture f) {
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  char *peer;
-  grpc_stats_data *before = gpr_malloc(sizeof(grpc_stats_data));
-  grpc_stats_data *after = gpr_malloc(sizeof(grpc_stats_data));
-
-  grpc_stats_collect(before);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
-  gpr_free(peer);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  peer = grpc_call_get_peer(s);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
-  gpr_free(peer);
-  peer = grpc_call_get_peer(c);
-  GPR_ASSERT(peer != NULL);
-  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
-  gpr_free(peer);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(0 == call_details.flags);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_stats_collect(after);
-
-  char *stats = grpc_stats_data_as_json(after);
-  gpr_log(GPR_DEBUG, "%s", stats);
-  gpr_free(stats);
-
-  int expected_calls = 1;
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_REQUEST_PROXYING) {
-    expected_calls *= 2;
-  }
-  GPR_ASSERT(after->counters[GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED] -
-                 before->counters[GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED] ==
-             expected_calls);
-  GPR_ASSERT(after->counters[GRPC_STATS_COUNTER_SERVER_CALLS_CREATED] -
-                 before->counters[GRPC_STATS_COUNTER_SERVER_CALLS_CREATED] ==
-             expected_calls);
-  gpr_free(before);
-  gpr_free(after);
-}
-
-static void test_invoke_simple_request(grpc_end2end_test_config config) {
-  grpc_end2end_test_fixture f;
-
-  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
-  simple_request_body(config, f);
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
-  int i;
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
-  for (i = 0; i < 10; i++) {
-    simple_request_body(config, f);
-    gpr_log(GPR_INFO, "Running test: Passed simple request %d", i);
-  }
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void simple_request(grpc_end2end_test_config config) {
-  int i;
-  for (i = 0; i < 10; i++) {
-    test_invoke_simple_request(config);
-  }
-  test_invoke_10_simple_requests(config);
-}
-
-void simple_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/simple_request.cc b/test/core/end2end/tests/simple_request.cc
new file mode 100644
index 0000000..d48010b
--- /dev/null
+++ b/test/core/end2end/tests/simple_request.cc
@@ -0,0 +1,268 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/debug/stats.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void simple_request_body(grpc_end2end_test_config config,
+                                grpc_end2end_test_fixture f) {
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  char* peer;
+  grpc_stats_data* before =
+      static_cast<grpc_stats_data*>(gpr_malloc(sizeof(grpc_stats_data)));
+  grpc_stats_data* after =
+      static_cast<grpc_stats_data*>(gpr_malloc(sizeof(grpc_stats_data)));
+
+  grpc_stats_collect(before);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer_before_call=%s", peer);
+  gpr_free(peer);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  peer = grpc_call_get_peer(s);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "server_peer=%s", peer);
+  gpr_free(peer);
+  peer = grpc_call_get_peer(c);
+  GPR_ASSERT(peer != NULL);
+  gpr_log(GPR_DEBUG, "client_peer=%s", peer);
+  gpr_free(peer);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(0 == call_details.flags);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_stats_collect(after);
+
+  char* stats = grpc_stats_data_as_json(after);
+  gpr_log(GPR_DEBUG, "%s", stats);
+  gpr_free(stats);
+
+  int expected_calls = 1;
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_REQUEST_PROXYING) {
+    expected_calls *= 2;
+  }
+  GPR_ASSERT(after->counters[GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED] -
+                 before->counters[GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED] ==
+             expected_calls);
+  GPR_ASSERT(after->counters[GRPC_STATS_COUNTER_SERVER_CALLS_CREATED] -
+                 before->counters[GRPC_STATS_COUNTER_SERVER_CALLS_CREATED] ==
+             expected_calls);
+  gpr_free(before);
+  gpr_free(after);
+}
+
+static void test_invoke_simple_request(grpc_end2end_test_config config) {
+  grpc_end2end_test_fixture f;
+
+  f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
+  simple_request_body(config, f);
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
+  int i;
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
+  for (i = 0; i < 10; i++) {
+    simple_request_body(config, f);
+    gpr_log(GPR_INFO, "Running test: Passed simple request %d", i);
+  }
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void simple_request(grpc_end2end_test_config config) {
+  int i;
+  for (i = 0; i < 10; i++) {
+    test_invoke_simple_request(config);
+  }
+  test_invoke_10_simple_requests(config);
+}
+
+void simple_request_pre_init(void) {}
diff --git a/test/core/end2end/tests/stream_compression_compressed_payload.c b/test/core/end2end/tests/stream_compression_compressed_payload.c
deleted file mode 100644
index 8b47741..0000000
--- a/test/core/end2end/tests/stream_compression_compressed_payload.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/byte_buffer_reader.h>
-#include <grpc/compression.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/call_test_only.h"
-#include "src/core/lib/transport/static_metadata.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void request_for_disabled_algorithm(
-    grpc_end2end_test_config config, const char *test_name,
-    uint32_t send_flags_bitmask,
-    grpc_stream_compression_algorithm algorithm_to_disable,
-    grpc_stream_compression_algorithm requested_client_compression_algorithm,
-    grpc_status_code expected_error, grpc_metadata *client_metadata) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice;
-  grpc_byte_buffer *request_payload;
-  grpc_channel_args *client_args;
-  grpc_channel_args *server_args;
-  grpc_end2end_test_fixture f;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  cq_verifier *cqv;
-  char str[1024];
-
-  memset(str, 'x', 1023);
-  str[1023] = '\0';
-  request_payload_slice = grpc_slice_from_copied_string(str);
-  request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-
-  client_args = grpc_channel_args_set_stream_compression_algorithm(
-      NULL, requested_client_compression_algorithm);
-  server_args = grpc_channel_args_set_stream_compression_algorithm(
-      NULL, GRPC_STREAM_COMPRESS_NONE);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    server_args = grpc_channel_args_stream_compression_algorithm_set_state(
-        &exec_ctx, &server_args, algorithm_to_disable, false);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  f = begin_test(config, test_name, client_args, server_args);
-  cqv = cq_verifier_create(f.cq);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  if (client_metadata != NULL) {
-    op->data.send_initial_metadata.count = 1;
-    op->data.send_initial_metadata.metadata = client_metadata;
-  } else {
-    op->data.send_initial_metadata.count = 0;
-  }
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = send_flags_bitmask;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), true);
-  cq_verify(cqv);
-
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), false);
-
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), true);
-  cq_verify(cqv);
-
-  /* call was cancelled (closed) ... */
-  GPR_ASSERT(was_cancelled != 0);
-  /* with a certain error */
-  GPR_ASSERT(status == expected_error);
-
-  const char *algo_name = NULL;
-  GPR_ASSERT(
-      grpc_stream_compression_algorithm_name(algorithm_to_disable, &algo_name));
-  char *expected_details = NULL;
-  gpr_asprintf(&expected_details,
-               "Stream compression algorithm '%s' is disabled.", algo_name);
-  /* and we expect a specific reason for it */
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, expected_details));
-  gpr_free(expected_details);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_slice_unref(request_payload_slice);
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, client_args);
-    grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void request_with_payload_template(
-    grpc_end2end_test_config config, const char *test_name,
-    uint32_t client_send_flags_bitmask,
-    grpc_stream_compression_algorithm
-        default_client_channel_compression_algorithm,
-    grpc_stream_compression_algorithm
-        default_server_channel_compression_algorithm,
-    grpc_stream_compression_algorithm expected_client_compression_algorithm,
-    grpc_stream_compression_algorithm expected_server_compression_algorithm,
-    grpc_metadata *client_init_metadata, bool set_server_level,
-    grpc_stream_compression_level server_compression_level,
-    bool send_message_before_initial_metadata,
-    bool set_default_server_message_compression_algorithm,
-    grpc_compression_algorithm default_server_message_compression_algorithm) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice;
-  grpc_byte_buffer *request_payload = NULL;
-  grpc_channel_args *client_args;
-  grpc_channel_args *server_args;
-  grpc_end2end_test_fixture f;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload;
-  grpc_byte_buffer *response_payload_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  cq_verifier *cqv;
-  char request_str[1024];
-  char response_str[1024];
-
-  memset(request_str, 'x', 1023);
-  request_str[1023] = '\0';
-
-  memset(response_str, 'y', 1023);
-  response_str[1023] = '\0';
-
-  request_payload_slice = grpc_slice_from_copied_string(request_str);
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string(response_str);
-
-  client_args = grpc_channel_args_set_stream_compression_algorithm(
-      NULL, default_client_channel_compression_algorithm);
-  if (set_default_server_message_compression_algorithm) {
-    server_args = grpc_channel_args_set_compression_algorithm(
-        NULL, default_server_message_compression_algorithm);
-  } else {
-    server_args = grpc_channel_args_set_stream_compression_algorithm(
-        NULL, default_server_channel_compression_algorithm);
-  }
-
-  f = begin_test(config, test_name, client_args, server_args);
-  cqv = cq_verifier_create(f.cq);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  if (send_message_before_initial_metadata) {
-    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = request_payload;
-    op->flags = client_send_flags_bitmask;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-    CQ_EXPECT_COMPLETION(cqv, tag(2), true);
-  }
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  if (client_init_metadata != NULL) {
-    op->data.send_initial_metadata.count = 1;
-    op->data.send_initial_metadata.metadata = client_init_metadata;
-  } else {
-    op->data.send_initial_metadata.count = 0;
-  }
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(100));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(100), true);
-  cq_verify(cqv);
-
-  GPR_ASSERT(GPR_BITCOUNT(grpc_call_test_only_get_encodings_accepted_by_peer(
-                 s)) == GRPC_COMPRESS_ALGORITHMS_COUNT);
-  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
-                        GRPC_COMPRESS_NONE) != 0);
-  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
-                        GRPC_COMPRESS_DEFLATE) != 0);
-  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
-                        GRPC_COMPRESS_GZIP) != 0);
-  GPR_ASSERT(
-      GPR_BITCOUNT(grpc_call_test_only_get_stream_encodings_accepted_by_peer(
-          s)) == GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT);
-  GPR_ASSERT(
-      GPR_BITGET(grpc_call_test_only_get_stream_encodings_accepted_by_peer(s),
-                 GRPC_STREAM_COMPRESS_NONE) != 0);
-  GPR_ASSERT(
-      GPR_BITGET(grpc_call_test_only_get_stream_encodings_accepted_by_peer(s),
-                 GRPC_STREAM_COMPRESS_GZIP) != 0);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  if (set_server_level) {
-    op->data.send_initial_metadata.maybe_stream_compression_level.is_set = true;
-    op->data.send_initial_metadata.maybe_stream_compression_level.level =
-        server_compression_level;
-  }
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  for (int i = 0; i < 2; i++) {
-    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-
-    if (i > 0 || !send_message_before_initial_metadata) {
-      request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-      memset(ops, 0, sizeof(ops));
-      op = ops;
-      op->op = GRPC_OP_SEND_MESSAGE;
-      op->data.send_message.send_message = request_payload;
-      op->flags = client_send_flags_bitmask;
-      op->reserved = NULL;
-      op++;
-      error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-      GPR_ASSERT(GRPC_CALL_OK == error);
-      CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-    }
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &request_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-    cq_verify(cqv);
-
-    GPR_ASSERT(request_payload_recv->type == GRPC_BB_RAW);
-    GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, request_str));
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = response_payload;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &response_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-    CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-    cq_verify(cqv);
-
-    GPR_ASSERT(response_payload_recv->type == GRPC_BB_RAW);
-    GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, response_str));
-
-    grpc_byte_buffer_destroy(request_payload);
-    grpc_byte_buffer_destroy(response_payload);
-    grpc_byte_buffer_destroy(request_payload_recv);
-    grpc_byte_buffer_destroy(response_payload_recv);
-  }
-
-  grpc_slice_unref(request_payload_slice);
-  grpc_slice_unref(response_payload_slice);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, client_args);
-    grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-static void test_invoke_request_with_compressed_payload(
-    grpc_end2end_test_config config) {
-  request_with_payload_template(
-      config, "test_invoke_request_with_compressed_payload", 0,
-      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP,
-      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, NULL,
-      false, /* ignored */
-      GRPC_STREAM_COMPRESS_LEVEL_NONE, false, false, GRPC_COMPRESS_NONE);
-}
-
-static void test_invoke_request_with_send_message_before_initial_metadata(
-    grpc_end2end_test_config config) {
-  request_with_payload_template(
-      config, "test_invoke_request_with_send_message_before_initial_metadata",
-      0, GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP,
-      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, NULL,
-      false, /* ignored */
-      GRPC_STREAM_COMPRESS_LEVEL_NONE, true, false, GRPC_COMPRESS_NONE);
-}
-
-static void test_invoke_request_with_server_level(
-    grpc_end2end_test_config config) {
-  request_with_payload_template(
-      config, "test_invoke_request_with_server_level", 0,
-      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
-      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_GZIP,
-      /* ignored */ NULL, true, GRPC_STREAM_COMPRESS_LEVEL_HIGH, false, false,
-      GRPC_COMPRESS_NONE);
-}
-
-static void test_invoke_request_with_compressed_payload_md_override(
-    grpc_end2end_test_config config) {
-  grpc_metadata gzip_compression_override;
-  grpc_metadata identity_compression_override;
-
-  gzip_compression_override.key =
-      GRPC_MDSTR_GRPC_INTERNAL_STREAM_ENCODING_REQUEST;
-  gzip_compression_override.value = grpc_slice_from_static_string("gzip");
-  memset(&gzip_compression_override.internal_data, 0,
-         sizeof(gzip_compression_override.internal_data));
-
-  identity_compression_override.key =
-      GRPC_MDSTR_GRPC_INTERNAL_STREAM_ENCODING_REQUEST;
-  identity_compression_override.value =
-      grpc_slice_from_static_string("identity");
-  memset(&identity_compression_override.internal_data, 0,
-         sizeof(identity_compression_override.internal_data));
-
-  /* Channel default NONE (aka IDENTITY), call override to stream GZIP */
-  request_with_payload_template(
-      config, "test_invoke_request_with_compressed_payload_md_override_1", 0,
-      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
-      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_NONE,
-      &gzip_compression_override, false,
-      /*ignored*/ GRPC_STREAM_COMPRESS_LEVEL_NONE, false, false,
-      GRPC_COMPRESS_NONE);
-
-  /* Channel default stream GZIP, call override to NONE (aka IDENTITY) */
-  request_with_payload_template(
-      config, "test_invoke_request_with_compressed_payload_md_override_3", 0,
-      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_NONE,
-      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
-      &identity_compression_override, false,
-      /*ignored*/ GRPC_STREAM_COMPRESS_LEVEL_NONE, false, false,
-      GRPC_COMPRESS_NONE);
-}
-
-static void test_invoke_request_with_disabled_algorithm(
-    grpc_end2end_test_config config) {
-  request_for_disabled_algorithm(
-      config, "test_invoke_request_with_disabled_algorithm", 0,
-      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP,
-      GRPC_STATUS_UNIMPLEMENTED, NULL);
-}
-
-static void test_stream_compression_override_message_compression(
-    grpc_end2end_test_config config) {
-  grpc_stream_compression_level level = GRPC_STREAM_COMPRESS_LEVEL_MED;
-  request_with_payload_template(
-      config, "test_stream_compression_override_message_compression", 0,
-      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
-      GRPC_STREAM_COMPRESS_NONE,
-      grpc_stream_compression_algorithm_for_level(
-          level, (1u << GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT) - 1),
-      /* ignored */ NULL, true, level, false, true, GRPC_COMPRESS_GZIP);
-}
-
-void stream_compression_compressed_payload(grpc_end2end_test_config config) {
-  test_invoke_request_with_compressed_payload(config);
-  test_invoke_request_with_send_message_before_initial_metadata(config);
-  test_invoke_request_with_server_level(config);
-  test_invoke_request_with_compressed_payload_md_override(config);
-  test_invoke_request_with_disabled_algorithm(config);
-  test_stream_compression_override_message_compression(config);
-}
-
-void stream_compression_compressed_payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/stream_compression_compressed_payload.cc b/test/core/end2end/tests/stream_compression_compressed_payload.cc
new file mode 100644
index 0000000..3fe5200
--- /dev/null
+++ b/test/core/end2end/tests/stream_compression_compressed_payload.cc
@@ -0,0 +1,653 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
+#include <grpc/compression.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/surface/call.h"
+#include "src/core/lib/surface/call_test_only.h"
+#include "src/core/lib/transport/static_metadata.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void request_for_disabled_algorithm(
+    grpc_end2end_test_config config, const char* test_name,
+    uint32_t send_flags_bitmask,
+    grpc_stream_compression_algorithm algorithm_to_disable,
+    grpc_stream_compression_algorithm requested_client_compression_algorithm,
+    grpc_status_code expected_error, grpc_metadata* client_metadata) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice;
+  grpc_byte_buffer* request_payload;
+  grpc_channel_args* client_args;
+  grpc_channel_args* server_args;
+  grpc_end2end_test_fixture f;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  cq_verifier* cqv;
+  char str[1024];
+
+  memset(str, 'x', 1023);
+  str[1023] = '\0';
+  request_payload_slice = grpc_slice_from_copied_string(str);
+  request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+
+  client_args = grpc_channel_args_set_stream_compression_algorithm(
+      NULL, requested_client_compression_algorithm);
+  server_args = grpc_channel_args_set_stream_compression_algorithm(
+      NULL, GRPC_STREAM_COMPRESS_NONE);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    server_args = grpc_channel_args_stream_compression_algorithm_set_state(
+        &exec_ctx, &server_args, algorithm_to_disable, false);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  f = begin_test(config, test_name, client_args, server_args);
+  cqv = cq_verifier_create(f.cq);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  if (client_metadata != NULL) {
+    op->data.send_initial_metadata.count = 1;
+    op->data.send_initial_metadata.metadata = client_metadata;
+  } else {
+    op->data.send_initial_metadata.count = 0;
+  }
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = send_flags_bitmask;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), true);
+  cq_verify(cqv);
+
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), false);
+
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), true);
+  cq_verify(cqv);
+
+  /* call was cancelled (closed) ... */
+  GPR_ASSERT(was_cancelled != 0);
+  /* with a certain error */
+  GPR_ASSERT(status == expected_error);
+
+  const char* algo_name = NULL;
+  GPR_ASSERT(
+      grpc_stream_compression_algorithm_name(algorithm_to_disable, &algo_name));
+  char* expected_details = NULL;
+  gpr_asprintf(&expected_details,
+               "Stream compression algorithm '%s' is disabled.", algo_name);
+  /* and we expect a specific reason for it */
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, expected_details));
+  gpr_free(expected_details);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_slice_unref(request_payload_slice);
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, client_args);
+    grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void request_with_payload_template(
+    grpc_end2end_test_config config, const char* test_name,
+    uint32_t client_send_flags_bitmask,
+    grpc_stream_compression_algorithm
+        default_client_channel_compression_algorithm,
+    grpc_stream_compression_algorithm
+        default_server_channel_compression_algorithm,
+    grpc_stream_compression_algorithm expected_client_compression_algorithm,
+    grpc_stream_compression_algorithm expected_server_compression_algorithm,
+    grpc_metadata* client_init_metadata, bool set_server_level,
+    grpc_stream_compression_level server_compression_level,
+    bool send_message_before_initial_metadata,
+    bool set_default_server_message_compression_algorithm,
+    grpc_compression_algorithm default_server_message_compression_algorithm) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice;
+  grpc_byte_buffer* request_payload = NULL;
+  grpc_channel_args* client_args;
+  grpc_channel_args* server_args;
+  grpc_end2end_test_fixture f;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload;
+  grpc_byte_buffer* response_payload_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  cq_verifier* cqv;
+  char request_str[1024];
+  char response_str[1024];
+
+  memset(request_str, 'x', 1023);
+  request_str[1023] = '\0';
+
+  memset(response_str, 'y', 1023);
+  response_str[1023] = '\0';
+
+  request_payload_slice = grpc_slice_from_copied_string(request_str);
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string(response_str);
+
+  client_args = grpc_channel_args_set_stream_compression_algorithm(
+      NULL, default_client_channel_compression_algorithm);
+  if (set_default_server_message_compression_algorithm) {
+    server_args = grpc_channel_args_set_compression_algorithm(
+        NULL, default_server_message_compression_algorithm);
+  } else {
+    server_args = grpc_channel_args_set_stream_compression_algorithm(
+        NULL, default_server_channel_compression_algorithm);
+  }
+
+  f = begin_test(config, test_name, client_args, server_args);
+  cqv = cq_verifier_create(f.cq);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  if (send_message_before_initial_metadata) {
+    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = request_payload;
+    op->flags = client_send_flags_bitmask;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+    CQ_EXPECT_COMPLETION(cqv, tag(2), true);
+  }
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  if (client_init_metadata != NULL) {
+    op->data.send_initial_metadata.count = 1;
+    op->data.send_initial_metadata.metadata = client_init_metadata;
+  } else {
+    op->data.send_initial_metadata.count = 0;
+  }
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(100));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(100), true);
+  cq_verify(cqv);
+
+  GPR_ASSERT(GPR_BITCOUNT(grpc_call_test_only_get_encodings_accepted_by_peer(
+                 s)) == GRPC_COMPRESS_ALGORITHMS_COUNT);
+  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
+                        GRPC_COMPRESS_NONE) != 0);
+  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
+                        GRPC_COMPRESS_DEFLATE) != 0);
+  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
+                        GRPC_COMPRESS_GZIP) != 0);
+  GPR_ASSERT(
+      GPR_BITCOUNT(grpc_call_test_only_get_stream_encodings_accepted_by_peer(
+          s)) == GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT);
+  GPR_ASSERT(
+      GPR_BITGET(grpc_call_test_only_get_stream_encodings_accepted_by_peer(s),
+                 GRPC_STREAM_COMPRESS_NONE) != 0);
+  GPR_ASSERT(
+      GPR_BITGET(grpc_call_test_only_get_stream_encodings_accepted_by_peer(s),
+                 GRPC_STREAM_COMPRESS_GZIP) != 0);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  if (set_server_level) {
+    op->data.send_initial_metadata.maybe_stream_compression_level.is_set = true;
+    op->data.send_initial_metadata.maybe_stream_compression_level.level =
+        server_compression_level;
+  }
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  for (int i = 0; i < 2; i++) {
+    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+
+    if (i > 0 || !send_message_before_initial_metadata) {
+      request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+      memset(ops, 0, sizeof(ops));
+      op = ops;
+      op->op = GRPC_OP_SEND_MESSAGE;
+      op->data.send_message.send_message = request_payload;
+      op->flags = client_send_flags_bitmask;
+      op->reserved = NULL;
+      op++;
+      error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+      GPR_ASSERT(GRPC_CALL_OK == error);
+      CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+    }
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &request_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+    cq_verify(cqv);
+
+    GPR_ASSERT(request_payload_recv->type == GRPC_BB_RAW);
+    GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, request_str));
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = response_payload;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &response_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+    CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+    cq_verify(cqv);
+
+    GPR_ASSERT(response_payload_recv->type == GRPC_BB_RAW);
+    GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, response_str));
+
+    grpc_byte_buffer_destroy(request_payload);
+    grpc_byte_buffer_destroy(response_payload);
+    grpc_byte_buffer_destroy(request_payload_recv);
+    grpc_byte_buffer_destroy(response_payload_recv);
+  }
+
+  grpc_slice_unref(request_payload_slice);
+  grpc_slice_unref(response_payload_slice);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, client_args);
+    grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+static void test_invoke_request_with_compressed_payload(
+    grpc_end2end_test_config config) {
+  request_with_payload_template(
+      config, "test_invoke_request_with_compressed_payload", 0,
+      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP,
+      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, NULL,
+      false, /* ignored */
+      GRPC_STREAM_COMPRESS_LEVEL_NONE, false, false, GRPC_COMPRESS_NONE);
+}
+
+static void test_invoke_request_with_send_message_before_initial_metadata(
+    grpc_end2end_test_config config) {
+  request_with_payload_template(
+      config, "test_invoke_request_with_send_message_before_initial_metadata",
+      0, GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP,
+      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, NULL,
+      false, /* ignored */
+      GRPC_STREAM_COMPRESS_LEVEL_NONE, true, false, GRPC_COMPRESS_NONE);
+}
+
+static void test_invoke_request_with_server_level(
+    grpc_end2end_test_config config) {
+  request_with_payload_template(
+      config, "test_invoke_request_with_server_level", 0,
+      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
+      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_GZIP,
+      /* ignored */ NULL, true, GRPC_STREAM_COMPRESS_LEVEL_HIGH, false, false,
+      GRPC_COMPRESS_NONE);
+}
+
+static void test_invoke_request_with_compressed_payload_md_override(
+    grpc_end2end_test_config config) {
+  grpc_metadata gzip_compression_override;
+  grpc_metadata identity_compression_override;
+
+  gzip_compression_override.key =
+      GRPC_MDSTR_GRPC_INTERNAL_STREAM_ENCODING_REQUEST;
+  gzip_compression_override.value = grpc_slice_from_static_string("gzip");
+  memset(&gzip_compression_override.internal_data, 0,
+         sizeof(gzip_compression_override.internal_data));
+
+  identity_compression_override.key =
+      GRPC_MDSTR_GRPC_INTERNAL_STREAM_ENCODING_REQUEST;
+  identity_compression_override.value =
+      grpc_slice_from_static_string("identity");
+  memset(&identity_compression_override.internal_data, 0,
+         sizeof(identity_compression_override.internal_data));
+
+  /* Channel default NONE (aka IDENTITY), call override to stream GZIP */
+  request_with_payload_template(
+      config, "test_invoke_request_with_compressed_payload_md_override_1", 0,
+      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
+      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_NONE,
+      &gzip_compression_override, false,
+      /*ignored*/ GRPC_STREAM_COMPRESS_LEVEL_NONE, false, false,
+      GRPC_COMPRESS_NONE);
+
+  /* Channel default stream GZIP, call override to NONE (aka IDENTITY) */
+  request_with_payload_template(
+      config, "test_invoke_request_with_compressed_payload_md_override_3", 0,
+      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_NONE,
+      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
+      &identity_compression_override, false,
+      /*ignored*/ GRPC_STREAM_COMPRESS_LEVEL_NONE, false, false,
+      GRPC_COMPRESS_NONE);
+}
+
+static void test_invoke_request_with_disabled_algorithm(
+    grpc_end2end_test_config config) {
+  request_for_disabled_algorithm(
+      config, "test_invoke_request_with_disabled_algorithm", 0,
+      GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP,
+      GRPC_STATUS_UNIMPLEMENTED, NULL);
+}
+
+static void test_stream_compression_override_message_compression(
+    grpc_end2end_test_config config) {
+  grpc_stream_compression_level level = GRPC_STREAM_COMPRESS_LEVEL_MED;
+  request_with_payload_template(
+      config, "test_stream_compression_override_message_compression", 0,
+      GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
+      GRPC_STREAM_COMPRESS_NONE,
+      grpc_stream_compression_algorithm_for_level(
+          level, (1u << GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT) - 1),
+      /* ignored */ NULL, true, level, false, true, GRPC_COMPRESS_GZIP);
+}
+
+void stream_compression_compressed_payload(grpc_end2end_test_config config) {
+  test_invoke_request_with_compressed_payload(config);
+  test_invoke_request_with_send_message_before_initial_metadata(config);
+  test_invoke_request_with_server_level(config);
+  test_invoke_request_with_compressed_payload_md_override(config);
+  test_invoke_request_with_disabled_algorithm(config);
+  test_stream_compression_override_message_compression(config);
+}
+
+void stream_compression_compressed_payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/stream_compression_payload.c b/test/core/end2end/tests/stream_compression_payload.c
deleted file mode 100644
index e47d2aa..0000000
--- a/test/core/end2end/tests/stream_compression_payload.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/compression.h>
-#include <grpc/compression.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/surface/call.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Creates and returns a grpc_slice containing random alphanumeric characters.
- */
-static grpc_slice generate_random_slice() {
-  size_t i;
-  static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
-  char *output;
-  const size_t output_size = 1024 * 1024;
-  output = (char *)gpr_malloc(output_size);
-  for (i = 0; i < output_size - 1; ++i) {
-    output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
-  }
-  output[output_size - 1] = '\0';
-  grpc_slice out = grpc_slice_from_copied_string(output);
-  gpr_free(output);
-  return out;
-}
-
-static void request_response_with_payload(grpc_end2end_test_config config,
-                                          grpc_end2end_test_fixture f) {
-  /* Create large request and response bodies. These are big enough to require
-   * multiple round trips to deliver to the peer, and their exact contents of
-   * will be verified on completion. */
-  grpc_slice request_payload_slice = generate_random_slice();
-  grpc_slice response_payload_slice = generate_random_slice();
-
-  grpc_call *c;
-  grpc_call *s;
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = n_seconds_from_now(60);
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_slice(request_payload_recv, request_payload_slice));
-  GPR_ASSERT(
-      byte_buffer_eq_slice(response_payload_recv, response_payload_slice));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-}
-
-/* Client sends a request with payload, server reads then returns a response
-   payload and status. */
-static void test_invoke_request_response_with_payload(
-    grpc_end2end_test_config config) {
-  grpc_channel_args *client_args =
-      grpc_channel_args_set_stream_compression_algorithm(
-          NULL, GRPC_STREAM_COMPRESS_GZIP);
-  grpc_channel_args *server_args =
-      grpc_channel_args_set_stream_compression_algorithm(
-          NULL, GRPC_STREAM_COMPRESS_GZIP);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_request_response_with_payload",
-                 client_args, server_args);
-  request_response_with_payload(config, f);
-  end_test(&f);
-  config.tear_down_data(&f);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, client_args);
-    grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static void test_invoke_10_request_response_with_payload(
-    grpc_end2end_test_config config) {
-  int i;
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_invoke_10_request_response_with_payload", NULL, NULL);
-  for (i = 0; i < 10; i++) {
-    request_response_with_payload(config, f);
-  }
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void stream_compression_payload(grpc_end2end_test_config config) {
-  test_invoke_request_response_with_payload(config);
-  test_invoke_10_request_response_with_payload(config);
-}
-
-void stream_compression_payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/stream_compression_payload.cc b/test/core/end2end/tests/stream_compression_payload.cc
new file mode 100644
index 0000000..038f0be
--- /dev/null
+++ b/test/core/end2end/tests/stream_compression_payload.cc
@@ -0,0 +1,304 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/compression.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/surface/call.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Creates and returns a grpc_slice containing random alphanumeric characters.
+ */
+static grpc_slice generate_random_slice() {
+  size_t i;
+  static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
+  char* output;
+  const size_t output_size = 1024 * 1024;
+  output = (char*)gpr_malloc(output_size);
+  for (i = 0; i < output_size - 1; ++i) {
+    output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
+  }
+  output[output_size - 1] = '\0';
+  grpc_slice out = grpc_slice_from_copied_string(output);
+  gpr_free(output);
+  return out;
+}
+
+static void request_response_with_payload(grpc_end2end_test_config config,
+                                          grpc_end2end_test_fixture f) {
+  /* Create large request and response bodies. These are big enough to require
+   * multiple round trips to deliver to the peer, and their exact contents of
+   * will be verified on completion. */
+  grpc_slice request_payload_slice = generate_random_slice();
+  grpc_slice response_payload_slice = generate_random_slice();
+
+  grpc_call* c;
+  grpc_call* s;
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = n_seconds_from_now(60);
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_slice(request_payload_recv, request_payload_slice));
+  GPR_ASSERT(
+      byte_buffer_eq_slice(response_payload_recv, response_payload_slice));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+}
+
+/* Client sends a request with payload, server reads then returns a response
+   payload and status. */
+static void test_invoke_request_response_with_payload(
+    grpc_end2end_test_config config) {
+  grpc_channel_args* client_args =
+      grpc_channel_args_set_stream_compression_algorithm(
+          NULL, GRPC_STREAM_COMPRESS_GZIP);
+  grpc_channel_args* server_args =
+      grpc_channel_args_set_stream_compression_algorithm(
+          NULL, GRPC_STREAM_COMPRESS_GZIP);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_request_response_with_payload",
+                 client_args, server_args);
+  request_response_with_payload(config, f);
+  end_test(&f);
+  config.tear_down_data(&f);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, client_args);
+    grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_invoke_10_request_response_with_payload(
+    grpc_end2end_test_config config) {
+  int i;
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_invoke_10_request_response_with_payload", NULL, NULL);
+  for (i = 0; i < 10; i++) {
+    request_response_with_payload(config, f);
+  }
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void stream_compression_payload(grpc_end2end_test_config config) {
+  test_invoke_request_response_with_payload(config);
+  test_invoke_10_request_response_with_payload(config);
+}
+
+void stream_compression_payload_pre_init(void) {}
diff --git a/test/core/end2end/tests/stream_compression_ping_pong_streaming.c b/test/core/end2end/tests/stream_compression_ping_pong_streaming.c
deleted file mode 100644
index 4c1a34c..0000000
--- a/test/core/end2end/tests/stream_compression_ping_pong_streaming.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/compression.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/surface/call.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Client pings and server pongs. Repeat messages rounds before finishing. */
-static void test_pingpong_streaming(grpc_end2end_test_config config,
-                                    int messages) {
-  grpc_channel_args *client_args =
-      grpc_channel_args_set_stream_compression_algorithm(
-          NULL, GRPC_STREAM_COMPRESS_GZIP);
-  grpc_channel_args *server_args =
-      grpc_channel_args_set_stream_compression_algorithm(
-          NULL, GRPC_STREAM_COMPRESS_GZIP);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_pingpong_streaming", client_args, server_args);
-  grpc_call *c;
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  grpc_byte_buffer *request_payload;
-  grpc_byte_buffer *request_payload_recv;
-  grpc_byte_buffer *response_payload;
-  grpc_byte_buffer *response_payload_recv;
-  int i;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(100));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(100), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  for (i = 0; i < messages; i++) {
-    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = request_payload;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &response_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &request_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-    cq_verify(cqv);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = response_payload;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-    CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-    cq_verify(cqv);
-
-    grpc_byte_buffer_destroy(request_payload);
-    grpc_byte_buffer_destroy(response_payload);
-    grpc_byte_buffer_destroy(request_payload_recv);
-    grpc_byte_buffer_destroy(response_payload_recv);
-  }
-
-  grpc_slice_unref(request_payload_slice);
-  grpc_slice_unref(response_payload_slice);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
-  cq_verify(cqv);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-  grpc_slice_unref(details);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, client_args);
-    grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-void stream_compression_ping_pong_streaming(grpc_end2end_test_config config) {
-  int i;
-
-  for (i = 1; i < 10; i++) {
-    test_pingpong_streaming(config, i);
-  }
-}
-
-void stream_compression_ping_pong_streaming_pre_init(void) {}
diff --git a/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc
new file mode 100644
index 0000000..a5321bf
--- /dev/null
+++ b/test/core/end2end/tests/stream_compression_ping_pong_streaming.cc
@@ -0,0 +1,291 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/compression.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/surface/call.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Client pings and server pongs. Repeat messages rounds before finishing. */
+static void test_pingpong_streaming(grpc_end2end_test_config config,
+                                    int messages) {
+  grpc_channel_args* client_args =
+      grpc_channel_args_set_stream_compression_algorithm(
+          NULL, GRPC_STREAM_COMPRESS_GZIP);
+  grpc_channel_args* server_args =
+      grpc_channel_args_set_stream_compression_algorithm(
+          NULL, GRPC_STREAM_COMPRESS_GZIP);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_pingpong_streaming", client_args, server_args);
+  grpc_call* c;
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  grpc_byte_buffer* request_payload;
+  grpc_byte_buffer* request_payload_recv;
+  grpc_byte_buffer* response_payload;
+  grpc_byte_buffer* response_payload_recv;
+  int i;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(100));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(100), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  for (i = 0; i < messages; i++) {
+    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = request_payload;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &response_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &request_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+    cq_verify(cqv);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = response_payload;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+    CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+    cq_verify(cqv);
+
+    grpc_byte_buffer_destroy(request_payload);
+    grpc_byte_buffer_destroy(response_payload);
+    grpc_byte_buffer_destroy(request_payload_recv);
+    grpc_byte_buffer_destroy(response_payload_recv);
+  }
+
+  grpc_slice_unref(request_payload_slice);
+  grpc_slice_unref(response_payload_slice);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
+  cq_verify(cqv);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+  grpc_slice_unref(details);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, client_args);
+    grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+void stream_compression_ping_pong_streaming(grpc_end2end_test_config config) {
+  int i;
+
+  for (i = 1; i < 10; i++) {
+    test_pingpong_streaming(config, i);
+  }
+}
+
+void stream_compression_ping_pong_streaming_pre_init(void) {}
diff --git a/test/core/end2end/tests/streaming_error_response.c b/test/core/end2end/tests/streaming_error_response.c
deleted file mode 100644
index 8891b86..0000000
--- a/test/core/end2end/tests/streaming_error_response.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** \file Verify that status ordering rules are obeyed.
-    \ref doc/status_ordering.md */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args,
-                                            bool request_status_early) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s/request_status_early=%s", test_name,
-          config.name, request_status_early ? "true" : "false");
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Client sends a request with payload, server reads then returns status. */
-static void test(grpc_end2end_test_config config, bool request_status_early) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice response_payload1_slice = grpc_slice_from_copied_string("hello");
-  grpc_byte_buffer *response_payload1 =
-      grpc_raw_byte_buffer_create(&response_payload1_slice, 1);
-  grpc_slice response_payload2_slice = grpc_slice_from_copied_string("world");
-  grpc_byte_buffer *response_payload2 =
-      grpc_raw_byte_buffer_create(&response_payload2_slice, 1);
-  grpc_end2end_test_fixture f = begin_test(config, "streaming_error_response",
-                                           NULL, NULL, request_status_early);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *response_payload1_recv = NULL;
-  grpc_byte_buffer *response_payload2_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload1_recv;
-  op++;
-  if (request_status_early) {
-    op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-    op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-    op->data.recv_status_on_client.status = &status;
-    op->data.recv_status_on_client.status_details = &details;
-    op++;
-  }
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload1;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  if (!request_status_early) {
-    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  }
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload2;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-
-  if (!request_status_early) {
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &response_payload2_recv;
-    op++;
-    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-    cq_verify(cqv);
-  }
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_FAILED_PRECONDITION;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
-  if (request_status_early) {
-    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  }
-  cq_verify(cqv);
-
-  if (!request_status_early) {
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-    op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-    op->data.recv_status_on_client.status = &status;
-    op->data.recv_status_on_client.status_details = &details;
-    op++;
-    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-    cq_verify(cqv);
-
-    GPR_ASSERT(response_payload1_recv != NULL);
-    GPR_ASSERT(response_payload2_recv != NULL);
-  }
-
-  GPR_ASSERT(status == GRPC_STATUS_FAILED_PRECONDITION);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 1);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(response_payload1);
-  grpc_byte_buffer_destroy(response_payload2);
-  grpc_byte_buffer_destroy(response_payload1_recv);
-  grpc_byte_buffer_destroy(response_payload2_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void streaming_error_response(grpc_end2end_test_config config) {
-  test(config, false);
-  test(config, true);
-}
-
-void streaming_error_response_pre_init(void) {}
diff --git a/test/core/end2end/tests/streaming_error_response.cc b/test/core/end2end/tests/streaming_error_response.cc
new file mode 100644
index 0000000..f87fd2c
--- /dev/null
+++ b/test/core/end2end/tests/streaming_error_response.cc
@@ -0,0 +1,270 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** \file Verify that status ordering rules are obeyed.
+    \ref doc/status_ordering.md */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args,
+                                            bool request_status_early) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s/request_status_early=%s", test_name,
+          config.name, request_status_early ? "true" : "false");
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Client sends a request with payload, server reads then returns status. */
+static void test(grpc_end2end_test_config config, bool request_status_early) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice response_payload1_slice = grpc_slice_from_copied_string("hello");
+  grpc_byte_buffer* response_payload1 =
+      grpc_raw_byte_buffer_create(&response_payload1_slice, 1);
+  grpc_slice response_payload2_slice = grpc_slice_from_copied_string("world");
+  grpc_byte_buffer* response_payload2 =
+      grpc_raw_byte_buffer_create(&response_payload2_slice, 1);
+  grpc_end2end_test_fixture f = begin_test(config, "streaming_error_response",
+                                           NULL, NULL, request_status_early);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* response_payload1_recv = NULL;
+  grpc_byte_buffer* response_payload2_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload1_recv;
+  op++;
+  if (request_status_early) {
+    op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+    op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+    op->data.recv_status_on_client.status = &status;
+    op->data.recv_status_on_client.status_details = &details;
+    op++;
+  }
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload1;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  if (!request_status_early) {
+    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  }
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload2;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+
+  if (!request_status_early) {
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &response_payload2_recv;
+    op++;
+    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+    cq_verify(cqv);
+  }
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_FAILED_PRECONDITION;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
+  if (request_status_early) {
+    CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  }
+  cq_verify(cqv);
+
+  if (!request_status_early) {
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+    op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+    op->data.recv_status_on_client.status = &status;
+    op->data.recv_status_on_client.status_details = &details;
+    op++;
+    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+    cq_verify(cqv);
+
+    GPR_ASSERT(response_payload1_recv != NULL);
+    GPR_ASSERT(response_payload2_recv != NULL);
+  }
+
+  GPR_ASSERT(status == GRPC_STATUS_FAILED_PRECONDITION);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 1);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(response_payload1);
+  grpc_byte_buffer_destroy(response_payload2);
+  grpc_byte_buffer_destroy(response_payload1_recv);
+  grpc_byte_buffer_destroy(response_payload2_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void streaming_error_response(grpc_end2end_test_config config) {
+  test(config, false);
+  test(config, true);
+}
+
+void streaming_error_response_pre_init(void) {}
diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.c
deleted file mode 100644
index 7aa78a0..0000000
--- a/test/core/end2end/tests/trailing_metadata.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Request/response with metadata and payload.*/
-static void test_request_response_with_metadata_and_payload(
-    grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string("hello you");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_byte_buffer *response_payload =
-      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-  grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
-                              grpc_slice_from_static_string("val1"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}},
-                             {grpc_slice_from_static_string("key2"),
-                              grpc_slice_from_static_string("val2"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}}};
-  grpc_metadata meta_s[2] = {{grpc_slice_from_static_string("key3"),
-                              grpc_slice_from_static_string("val3"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}},
-                             {grpc_slice_from_static_string("key4"),
-                              grpc_slice_from_static_string("val4"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}}};
-  grpc_metadata meta_t[2] = {{grpc_slice_from_static_string("key5"),
-                              grpc_slice_from_static_string("val5"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}},
-                             {grpc_slice_from_static_string("key6"),
-                              grpc_slice_from_static_string("val6"),
-                              0,
-                              {{NULL, NULL, NULL, NULL}}}};
-  grpc_end2end_test_fixture f = begin_test(
-      config, "test_request_response_with_metadata_and_payload", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload_recv = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 2;
-  op->data.send_initial_metadata.metadata = meta_c;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(101));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 2;
-  op->data.send_initial_metadata.metadata = meta_s;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = response_payload;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 2;
-  op->data.send_status_from_server.trailing_metadata = meta_t;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
-  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
-  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key1", "val1"));
-  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key2", "val2"));
-  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key3", "val3"));
-  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key4", "val4"));
-  GPR_ASSERT(contains_metadata(&trailing_metadata_recv, "key5", "val5"));
-  GPR_ASSERT(contains_metadata(&trailing_metadata_recv, "key6", "val6"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(response_payload);
-  grpc_byte_buffer_destroy(request_payload_recv);
-  grpc_byte_buffer_destroy(response_payload_recv);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void trailing_metadata(grpc_end2end_test_config config) {
-  test_request_response_with_metadata_and_payload(config);
-}
-
-void trailing_metadata_pre_init(void) {}
diff --git a/test/core/end2end/tests/trailing_metadata.cc b/test/core/end2end/tests/trailing_metadata.cc
new file mode 100644
index 0000000..0da02a5
--- /dev/null
+++ b/test/core/end2end/tests/trailing_metadata.cc
@@ -0,0 +1,282 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Request/response with metadata and payload.*/
+static void test_request_response_with_metadata_and_payload(
+    grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string("hello you");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_byte_buffer* response_payload =
+      grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+  grpc_metadata meta_c[2] = {{grpc_slice_from_static_string("key1"),
+                              grpc_slice_from_static_string("val1"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}},
+                             {grpc_slice_from_static_string("key2"),
+                              grpc_slice_from_static_string("val2"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}}};
+  grpc_metadata meta_s[2] = {{grpc_slice_from_static_string("key3"),
+                              grpc_slice_from_static_string("val3"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}},
+                             {grpc_slice_from_static_string("key4"),
+                              grpc_slice_from_static_string("val4"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}}};
+  grpc_metadata meta_t[2] = {{grpc_slice_from_static_string("key5"),
+                              grpc_slice_from_static_string("val5"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}},
+                             {grpc_slice_from_static_string("key6"),
+                              grpc_slice_from_static_string("val6"),
+                              0,
+                              {{NULL, NULL, NULL, NULL}}}};
+  grpc_end2end_test_fixture f = begin_test(
+      config, "test_request_response_with_metadata_and_payload", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 2;
+  op->data.send_initial_metadata.metadata = meta_c;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(101));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 2;
+  op->data.send_initial_metadata.metadata = meta_s;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = response_payload;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 2;
+  op->data.send_status_from_server.trailing_metadata = meta_t;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
+  GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));
+  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key1", "val1"));
+  GPR_ASSERT(contains_metadata(&request_metadata_recv, "key2", "val2"));
+  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key3", "val3"));
+  GPR_ASSERT(contains_metadata(&initial_metadata_recv, "key4", "val4"));
+  GPR_ASSERT(contains_metadata(&trailing_metadata_recv, "key5", "val5"));
+  GPR_ASSERT(contains_metadata(&trailing_metadata_recv, "key6", "val6"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(response_payload);
+  grpc_byte_buffer_destroy(request_payload_recv);
+  grpc_byte_buffer_destroy(response_payload_recv);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void trailing_metadata(grpc_end2end_test_config config) {
+  test_request_response_with_metadata_and_payload(config);
+}
+
+void trailing_metadata_pre_init(void) {}
diff --git a/test/core/end2end/tests/workaround_cronet_compression.c b/test/core/end2end/tests/workaround_cronet_compression.c
deleted file mode 100644
index 44e8e04..0000000
--- a/test/core/end2end/tests/workaround_cronet_compression.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/byte_buffer_reader.h>
-#include <grpc/compression.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/call_test_only.h"
-#include "src/core/lib/transport/static_metadata.h"
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-static void request_with_payload_template(
-    grpc_end2end_test_config config, const char *test_name,
-    uint32_t client_send_flags_bitmask,
-    grpc_compression_algorithm default_client_channel_compression_algorithm,
-    grpc_compression_algorithm default_server_channel_compression_algorithm,
-    grpc_compression_algorithm expected_algorithm_from_client,
-    grpc_compression_algorithm expected_algorithm_from_server,
-    grpc_metadata *client_init_metadata, bool set_server_level,
-    grpc_compression_level server_compression_level,
-    char *user_agent_override) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice;
-  grpc_byte_buffer *request_payload;
-  grpc_channel_args *client_args;
-  grpc_channel_args *server_args;
-  grpc_end2end_test_fixture f;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv = NULL;
-  grpc_byte_buffer *response_payload;
-  grpc_byte_buffer *response_payload_recv;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  int was_cancelled = 2;
-  cq_verifier *cqv;
-  char request_str[1024];
-  char response_str[1024];
-
-  memset(request_str, 'x', 1023);
-  request_str[1023] = '\0';
-
-  memset(response_str, 'y', 1023);
-  response_str[1023] = '\0';
-
-  request_payload_slice = grpc_slice_from_copied_string(request_str);
-  grpc_slice response_payload_slice =
-      grpc_slice_from_copied_string(response_str);
-
-  client_args = grpc_channel_args_set_compression_algorithm(
-      NULL, default_client_channel_compression_algorithm);
-  server_args = grpc_channel_args_set_compression_algorithm(
-      NULL, default_server_channel_compression_algorithm);
-
-  if (user_agent_override) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args *client_args_old = client_args;
-    grpc_arg arg;
-    arg.key = GRPC_ARG_PRIMARY_USER_AGENT_STRING;
-    arg.type = GRPC_ARG_STRING;
-    arg.value.string = user_agent_override;
-    client_args = grpc_channel_args_copy_and_add(client_args_old, &arg, 1);
-    grpc_channel_args_destroy(&exec_ctx, client_args_old);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  f = begin_test(config, test_name, client_args, server_args);
-  cqv = cq_verifier_create(f.cq);
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  if (client_init_metadata != NULL) {
-    op->data.send_initial_metadata.count = 1;
-    op->data.send_initial_metadata.metadata = client_init_metadata;
-  } else {
-    op->data.send_initial_metadata.count = 0;
-  }
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  error =
-      grpc_server_request_call(f.server, &s, &call_details,
-                               &request_metadata_recv, f.cq, f.cq, tag(100));
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  CQ_EXPECT_COMPLETION(cqv, tag(100), true);
-  cq_verify(cqv);
-
-  GPR_ASSERT(GPR_BITCOUNT(grpc_call_test_only_get_encodings_accepted_by_peer(
-                 s)) == GRPC_COMPRESS_ALGORITHMS_COUNT);
-  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
-                        GRPC_COMPRESS_NONE) != 0);
-  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
-                        GRPC_COMPRESS_DEFLATE) != 0);
-  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
-                        GRPC_COMPRESS_GZIP) != 0);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  if (set_server_level) {
-    op->data.send_initial_metadata.maybe_compression_level.is_set = true;
-    op->data.send_initial_metadata.maybe_compression_level.level =
-        server_compression_level;
-  }
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  for (int i = 0; i < 2; i++) {
-    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = request_payload;
-    op->flags = client_send_flags_bitmask;
-    op->reserved = NULL;
-    op++;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &response_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_RECV_MESSAGE;
-    op->data.recv_message.recv_message = &request_payload_recv;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
-    cq_verify(cqv);
-
-    GPR_ASSERT(request_payload_recv->type == GRPC_BB_RAW);
-    GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, request_str));
-    GPR_ASSERT(request_payload_recv->data.raw.compression ==
-               expected_algorithm_from_client);
-
-    memset(ops, 0, sizeof(ops));
-    op = ops;
-    op->op = GRPC_OP_SEND_MESSAGE;
-    op->data.send_message.send_message = response_payload;
-    op->flags = 0;
-    op->reserved = NULL;
-    op++;
-    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-    GPR_ASSERT(GRPC_CALL_OK == error);
-    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
-    CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-    cq_verify(cqv);
-
-    GPR_ASSERT(response_payload_recv->type == GRPC_BB_RAW);
-    GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, response_str));
-    if (server_compression_level > GRPC_COMPRESS_LEVEL_NONE) {
-      const grpc_compression_algorithm algo_for_server_level =
-          grpc_call_compression_for_level(s, server_compression_level);
-      GPR_ASSERT(response_payload_recv->data.raw.compression ==
-                 algo_for_server_level);
-    } else {
-      GPR_ASSERT(response_payload_recv->data.raw.compression ==
-                 expected_algorithm_from_server);
-    }
-
-    grpc_byte_buffer_destroy(request_payload);
-    grpc_byte_buffer_destroy(response_payload);
-    grpc_byte_buffer_destroy(request_payload_recv);
-    grpc_byte_buffer_destroy(response_payload_recv);
-  }
-
-  grpc_slice_unref(request_payload_slice);
-  grpc_slice_unref(response_payload_slice);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, client_args);
-    grpc_channel_args_destroy(&exec_ctx, server_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-typedef struct workaround_cronet_compression_config {
-  char *user_agent_override;
-  grpc_compression_algorithm expected_algorithm_from_server;
-} workaround_cronet_compression_config;
-
-static workaround_cronet_compression_config workaround_configs[] = {
-    {NULL, GRPC_COMPRESS_GZIP},
-    {"grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; cronet_http; gentle)",
-     GRPC_COMPRESS_NONE},
-    {"grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; chttp2; gentle)",
-     GRPC_COMPRESS_GZIP},
-    {"grpc-objc/1.4.0 grpc-c/3.0.0-dev (ios; cronet_http; gentle)",
-     GRPC_COMPRESS_GZIP}};
-static const size_t workaround_configs_num =
-    sizeof(workaround_configs) / sizeof(*workaround_configs);
-
-static void test_workaround_cronet_compression(
-    grpc_end2end_test_config config) {
-  for (uint32_t i = 0; i < workaround_configs_num; i++) {
-    request_with_payload_template(
-        config, "test_invoke_request_with_compressed_payload", 0,
-        GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP,
-        workaround_configs[i].expected_algorithm_from_server, NULL, false,
-        /* ignored */ GRPC_COMPRESS_LEVEL_NONE,
-        workaround_configs[i].user_agent_override);
-  }
-}
-
-void workaround_cronet_compression(grpc_end2end_test_config config) {
-  if (config.feature_mask & FEATURE_MASK_SUPPORTS_WORKAROUNDS) {
-    test_workaround_cronet_compression(config);
-  }
-}
-
-void workaround_cronet_compression_pre_init(void) {}
diff --git a/test/core/end2end/tests/workaround_cronet_compression.cc b/test/core/end2end/tests/workaround_cronet_compression.cc
new file mode 100644
index 0000000..8f8ca16
--- /dev/null
+++ b/test/core/end2end/tests/workaround_cronet_compression.cc
@@ -0,0 +1,399 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
+#include <grpc/compression.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/surface/call.h"
+#include "src/core/lib/surface/call_test_only.h"
+#include "src/core/lib/transport/static_metadata.h"
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+static void request_with_payload_template(
+    grpc_end2end_test_config config, const char* test_name,
+    uint32_t client_send_flags_bitmask,
+    grpc_compression_algorithm default_client_channel_compression_algorithm,
+    grpc_compression_algorithm default_server_channel_compression_algorithm,
+    grpc_compression_algorithm expected_algorithm_from_client,
+    grpc_compression_algorithm expected_algorithm_from_server,
+    grpc_metadata* client_init_metadata, bool set_server_level,
+    grpc_compression_level server_compression_level,
+    char* user_agent_override) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice;
+  grpc_byte_buffer* request_payload;
+  grpc_channel_args* client_args;
+  grpc_channel_args* server_args;
+  grpc_end2end_test_fixture f;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv = NULL;
+  grpc_byte_buffer* response_payload;
+  grpc_byte_buffer* response_payload_recv;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  int was_cancelled = 2;
+  cq_verifier* cqv;
+  char request_str[1024];
+  char response_str[1024];
+
+  memset(request_str, 'x', 1023);
+  request_str[1023] = '\0';
+
+  memset(response_str, 'y', 1023);
+  response_str[1023] = '\0';
+
+  request_payload_slice = grpc_slice_from_copied_string(request_str);
+  grpc_slice response_payload_slice =
+      grpc_slice_from_copied_string(response_str);
+
+  client_args = grpc_channel_args_set_compression_algorithm(
+      NULL, default_client_channel_compression_algorithm);
+  server_args = grpc_channel_args_set_compression_algorithm(
+      NULL, default_server_channel_compression_algorithm);
+
+  if (user_agent_override) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args* client_args_old = client_args;
+    grpc_arg arg;
+    arg.key = const_cast<char*>(GRPC_ARG_PRIMARY_USER_AGENT_STRING);
+    arg.type = GRPC_ARG_STRING;
+    arg.value.string = user_agent_override;
+    client_args = grpc_channel_args_copy_and_add(client_args_old, &arg, 1);
+    grpc_channel_args_destroy(&exec_ctx, client_args_old);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  f = begin_test(config, test_name, client_args, server_args);
+  cqv = cq_verifier_create(f.cq);
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  if (client_init_metadata != NULL) {
+    op->data.send_initial_metadata.count = 1;
+    op->data.send_initial_metadata.metadata = client_init_metadata;
+  } else {
+    op->data.send_initial_metadata.count = 0;
+  }
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  error =
+      grpc_server_request_call(f.server, &s, &call_details,
+                               &request_metadata_recv, f.cq, f.cq, tag(100));
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  CQ_EXPECT_COMPLETION(cqv, tag(100), true);
+  cq_verify(cqv);
+
+  GPR_ASSERT(GPR_BITCOUNT(grpc_call_test_only_get_encodings_accepted_by_peer(
+                 s)) == GRPC_COMPRESS_ALGORITHMS_COUNT);
+  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
+                        GRPC_COMPRESS_NONE) != 0);
+  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
+                        GRPC_COMPRESS_DEFLATE) != 0);
+  GPR_ASSERT(GPR_BITGET(grpc_call_test_only_get_encodings_accepted_by_peer(s),
+                        GRPC_COMPRESS_GZIP) != 0);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  if (set_server_level) {
+    op->data.send_initial_metadata.maybe_compression_level.is_set = true;
+    op->data.send_initial_metadata.maybe_compression_level.level =
+        server_compression_level;
+  }
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(101), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  for (int i = 0; i < 2; i++) {
+    request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+    response_payload = grpc_raw_byte_buffer_create(&response_payload_slice, 1);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = request_payload;
+    op->flags = client_send_flags_bitmask;
+    op->reserved = NULL;
+    op++;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &response_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_RECV_MESSAGE;
+    op->data.recv_message.recv_message = &request_payload_recv;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+    CQ_EXPECT_COMPLETION(cqv, tag(102), 1);
+    cq_verify(cqv);
+
+    GPR_ASSERT(request_payload_recv->type == GRPC_BB_RAW);
+    GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, request_str));
+    GPR_ASSERT(request_payload_recv->data.raw.compression ==
+               expected_algorithm_from_client);
+
+    memset(ops, 0, sizeof(ops));
+    op = ops;
+    op->op = GRPC_OP_SEND_MESSAGE;
+    op->data.send_message.send_message = response_payload;
+    op->flags = 0;
+    op->reserved = NULL;
+    op++;
+    error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+    GPR_ASSERT(GRPC_CALL_OK == error);
+    CQ_EXPECT_COMPLETION(cqv, tag(103), 1);
+    CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+    cq_verify(cqv);
+
+    GPR_ASSERT(response_payload_recv->type == GRPC_BB_RAW);
+    GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, response_str));
+    if (server_compression_level > GRPC_COMPRESS_LEVEL_NONE) {
+      const grpc_compression_algorithm algo_for_server_level =
+          grpc_call_compression_for_level(s, server_compression_level);
+      GPR_ASSERT(response_payload_recv->data.raw.compression ==
+                 algo_for_server_level);
+    } else {
+      GPR_ASSERT(response_payload_recv->data.raw.compression ==
+                 expected_algorithm_from_server);
+    }
+
+    grpc_byte_buffer_destroy(request_payload);
+    grpc_byte_buffer_destroy(response_payload);
+    grpc_byte_buffer_destroy(request_payload_recv);
+    grpc_byte_buffer_destroy(response_payload_recv);
+  }
+
+  grpc_slice_unref(request_payload_slice);
+  grpc_slice_unref(response_payload_slice);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(3), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(101), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(104), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, client_args);
+    grpc_channel_args_destroy(&exec_ctx, server_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+typedef struct workaround_cronet_compression_config {
+  char* user_agent_override;
+  grpc_compression_algorithm expected_algorithm_from_server;
+} workaround_cronet_compression_config;
+
+static workaround_cronet_compression_config workaround_configs[] = {
+    {NULL, GRPC_COMPRESS_GZIP},
+    {const_cast<char*>(
+         "grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; cronet_http; gentle)"),
+     GRPC_COMPRESS_NONE},
+    {const_cast<char*>(
+         "grpc-objc/1.3.0-dev grpc-c/3.0.0-dev (ios; chttp2; gentle)"),
+     GRPC_COMPRESS_GZIP},
+    {const_cast<char*>(
+         "grpc-objc/1.4.0 grpc-c/3.0.0-dev (ios; cronet_http; gentle)"),
+     GRPC_COMPRESS_GZIP}};
+static const size_t workaround_configs_num =
+    sizeof(workaround_configs) / sizeof(*workaround_configs);
+
+static void test_workaround_cronet_compression(
+    grpc_end2end_test_config config) {
+  for (uint32_t i = 0; i < workaround_configs_num; i++) {
+    request_with_payload_template(
+        config, "test_invoke_request_with_compressed_payload", 0,
+        GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_GZIP,
+        workaround_configs[i].expected_algorithm_from_server, NULL, false,
+        /* ignored */ GRPC_COMPRESS_LEVEL_NONE,
+        workaround_configs[i].user_agent_override);
+  }
+}
+
+void workaround_cronet_compression(grpc_end2end_test_config config) {
+  if (config.feature_mask & FEATURE_MASK_SUPPORTS_WORKAROUNDS) {
+    test_workaround_cronet_compression(config);
+  }
+}
+
+void workaround_cronet_compression_pre_init(void) {}
diff --git a/test/core/end2end/tests/write_buffering.c b/test/core/end2end/tests/write_buffering.c
deleted file mode 100644
index d7d1e5f..0000000
--- a/test/core/end2end/tests/write_buffering.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Client sends a request with payload, server reads then returns status. */
-static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice1 =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload1 =
-      grpc_raw_byte_buffer_create(&request_payload_slice1, 1);
-  grpc_slice request_payload_slice2 = grpc_slice_from_copied_string("abc123");
-  grpc_byte_buffer *request_payload2 =
-      grpc_raw_byte_buffer_create(&request_payload_slice2, 1);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv1 = NULL;
-  grpc_byte_buffer *request_payload_recv2 = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details = grpc_empty_slice();
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-  CQ_EXPECT_COMPLETION(cqv, tag(1), true); /* send message is buffered */
-  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload1;
-  op->flags = GRPC_WRITE_BUFFER_HINT;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  /* recv message should not succeed yet - it's buffered at the client still */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv1;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(2), true);
-  CQ_EXPECT_COMPLETION(cqv, tag(3), true);
-  CQ_EXPECT_COMPLETION(cqv, tag(102), true);
-  cq_verify(cqv);
-
-  /* send another message, this time not buffered */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload2;
-  op->flags = 0;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  /* now the first send should match up with the first recv */
-  CQ_EXPECT_COMPLETION(cqv, tag(103), true);
-  CQ_EXPECT_COMPLETION(cqv, tag(4), true);
-  cq_verify(cqv);
-
-  /* and the next recv should be ready immediately also */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv2;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(104), true);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(105), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(105), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv1, "hello world"));
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv2, "abc123"));
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload1);
-  grpc_byte_buffer_destroy(request_payload_recv1);
-  grpc_byte_buffer_destroy(request_payload2);
-  grpc_byte_buffer_destroy(request_payload_recv2);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void write_buffering(grpc_end2end_test_config config) {
-  test_invoke_request_with_payload(config);
-}
-
-void write_buffering_pre_init(void) {}
diff --git a/test/core/end2end/tests/write_buffering.cc b/test/core/end2end/tests/write_buffering.cc
new file mode 100644
index 0000000..5e92e59
--- /dev/null
+++ b/test/core/end2end/tests/write_buffering.cc
@@ -0,0 +1,280 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Client sends a request with payload, server reads then returns status. */
+static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice1 =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload1 =
+      grpc_raw_byte_buffer_create(&request_payload_slice1, 1);
+  grpc_slice request_payload_slice2 = grpc_slice_from_copied_string("abc123");
+  grpc_byte_buffer* request_payload2 =
+      grpc_raw_byte_buffer_create(&request_payload_slice2, 1);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv1 = NULL;
+  grpc_byte_buffer* request_payload_recv2 = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details = grpc_empty_slice();
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+  CQ_EXPECT_COMPLETION(cqv, tag(1), true); /* send message is buffered */
+  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload1;
+  op->flags = GRPC_WRITE_BUFFER_HINT;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  /* recv message should not succeed yet - it's buffered at the client still */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv1;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(2), true);
+  CQ_EXPECT_COMPLETION(cqv, tag(3), true);
+  CQ_EXPECT_COMPLETION(cqv, tag(102), true);
+  cq_verify(cqv);
+
+  /* send another message, this time not buffered */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload2;
+  op->flags = 0;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  /* now the first send should match up with the first recv */
+  CQ_EXPECT_COMPLETION(cqv, tag(103), true);
+  CQ_EXPECT_COMPLETION(cqv, tag(4), true);
+  cq_verify(cqv);
+
+  /* and the next recv should be ready immediately also */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv2;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(104), true);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(105), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(105), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv1, "hello world"));
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv2, "abc123"));
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload1);
+  grpc_byte_buffer_destroy(request_payload_recv1);
+  grpc_byte_buffer_destroy(request_payload2);
+  grpc_byte_buffer_destroy(request_payload_recv2);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void write_buffering(grpc_end2end_test_config config) {
+  test_invoke_request_with_payload(config);
+}
+
+void write_buffering_pre_init(void) {}
diff --git a/test/core/end2end/tests/write_buffering_at_end.c b/test/core/end2end/tests/write_buffering_at_end.c
deleted file mode 100644
index 6113843..0000000
--- a/test/core/end2end/tests/write_buffering_at_end.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/end2end/cq_verifier.h"
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
-                                            const char *test_name,
-                                            grpc_channel_args *client_args,
-                                            grpc_channel_args *server_args) {
-  grpc_end2end_test_fixture f;
-  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
-  f = config.create_fixture(client_args, server_args);
-  config.init_server(&f, server_args);
-  config.init_client(&f, client_args);
-  return f;
-}
-
-static gpr_timespec n_seconds_from_now(int n) {
-  return grpc_timeout_seconds_to_deadline(n);
-}
-
-static gpr_timespec five_seconds_from_now(void) {
-  return n_seconds_from_now(5);
-}
-
-static void drain_cq(grpc_completion_queue *cq) {
-  grpc_event ev;
-  do {
-    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
-  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
-}
-
-static void shutdown_server(grpc_end2end_test_fixture *f) {
-  if (!f->server) return;
-  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
-  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
-                                         grpc_timeout_seconds_to_deadline(5),
-                                         NULL)
-                 .type == GRPC_OP_COMPLETE);
-  grpc_server_destroy(f->server);
-  f->server = NULL;
-}
-
-static void shutdown_client(grpc_end2end_test_fixture *f) {
-  if (!f->client) return;
-  grpc_channel_destroy(f->client);
-  f->client = NULL;
-}
-
-static void end_test(grpc_end2end_test_fixture *f) {
-  shutdown_server(f);
-  shutdown_client(f);
-
-  grpc_completion_queue_shutdown(f->cq);
-  drain_cq(f->cq);
-  grpc_completion_queue_destroy(f->cq);
-  grpc_completion_queue_destroy(f->shutdown_cq);
-}
-
-/* Client sends a request with payload, server reads then returns status. */
-static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
-  grpc_call *c;
-  grpc_call *s;
-  grpc_slice request_payload_slice =
-      grpc_slice_from_copied_string("hello world");
-  grpc_byte_buffer *request_payload =
-      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
-  grpc_end2end_test_fixture f =
-      begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
-  cq_verifier *cqv = cq_verifier_create(f.cq);
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_metadata_array request_metadata_recv;
-  grpc_byte_buffer *request_payload_recv1 = NULL;
-  grpc_byte_buffer *request_payload_recv2 = NULL;
-  grpc_call_details call_details;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details = grpc_empty_slice();
-  int was_cancelled = 2;
-
-  gpr_timespec deadline = five_seconds_from_now();
-  c = grpc_channel_create_call(
-      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
-      grpc_slice_from_static_string("/foo"),
-      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
-      NULL);
-  GPR_ASSERT(c);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-  grpc_metadata_array_init(&request_metadata_recv);
-  grpc_call_details_init(&call_details);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
-                                 f.server, &s, &call_details,
-                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
-  CQ_EXPECT_COMPLETION(cqv, tag(1), true); /* send message is buffered */
-  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = request_payload;
-  op->flags = GRPC_WRITE_BUFFER_HINT;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  /* recv message should not succeed yet - it's buffered at the client still */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv1;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(2), true);
-  CQ_EXPECT_COMPLETION(cqv, tag(3), true);
-  CQ_EXPECT_COMPLETION(cqv, tag(102), true);
-  cq_verify(cqv);
-
-  /* send end of stream: should release the buffering */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  /* now the first send should match up with the first recv */
-  CQ_EXPECT_COMPLETION(cqv, tag(103), true);
-  CQ_EXPECT_COMPLETION(cqv, tag(4), true);
-  cq_verify(cqv);
-
-  /* and the next recv should be ready immediately also (and empty) */
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &request_payload_recv2;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(104), true);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  grpc_slice status_details = grpc_slice_from_static_string("xyz");
-  op->data.send_status_from_server.status_details = &status_details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(105), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  CQ_EXPECT_COMPLETION(cqv, tag(105), 1);
-  CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
-  cq_verify(cqv);
-
-  GPR_ASSERT(status == GRPC_STATUS_OK);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
-  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
-                                config);
-  GPR_ASSERT(was_cancelled == 0);
-  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv1, "hello world"));
-  GPR_ASSERT(request_payload_recv2 == NULL);
-
-  grpc_slice_unref(details);
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_metadata_array_destroy(&request_metadata_recv);
-  grpc_call_details_destroy(&call_details);
-
-  grpc_call_unref(c);
-  grpc_call_unref(s);
-
-  cq_verifier_destroy(cqv);
-
-  grpc_byte_buffer_destroy(request_payload);
-  grpc_byte_buffer_destroy(request_payload_recv1);
-
-  end_test(&f);
-  config.tear_down_data(&f);
-}
-
-void write_buffering_at_end(grpc_end2end_test_config config) {
-  test_invoke_request_with_payload(config);
-}
-
-void write_buffering_at_end_pre_init(void) {}
diff --git a/test/core/end2end/tests/write_buffering_at_end.cc b/test/core/end2end/tests/write_buffering_at_end.cc
new file mode 100644
index 0000000..01dacdf
--- /dev/null
+++ b/test/core/end2end/tests/write_buffering_at_end.cc
@@ -0,0 +1,269 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/end2end/end2end_tests.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/end2end/cq_verifier.h"
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
+                                            const char* test_name,
+                                            grpc_channel_args* client_args,
+                                            grpc_channel_args* server_args) {
+  grpc_end2end_test_fixture f;
+  gpr_log(GPR_INFO, "Running test: %s/%s", test_name, config.name);
+  f = config.create_fixture(client_args, server_args);
+  config.init_server(&f, server_args);
+  config.init_client(&f, client_args);
+  return f;
+}
+
+static gpr_timespec n_seconds_from_now(int n) {
+  return grpc_timeout_seconds_to_deadline(n);
+}
+
+static gpr_timespec five_seconds_from_now(void) {
+  return n_seconds_from_now(5);
+}
+
+static void drain_cq(grpc_completion_queue* cq) {
+  grpc_event ev;
+  do {
+    ev = grpc_completion_queue_next(cq, five_seconds_from_now(), NULL);
+  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
+}
+
+static void shutdown_server(grpc_end2end_test_fixture* f) {
+  if (!f->server) return;
+  grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
+  GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
+                                         grpc_timeout_seconds_to_deadline(5),
+                                         NULL)
+                 .type == GRPC_OP_COMPLETE);
+  grpc_server_destroy(f->server);
+  f->server = NULL;
+}
+
+static void shutdown_client(grpc_end2end_test_fixture* f) {
+  if (!f->client) return;
+  grpc_channel_destroy(f->client);
+  f->client = NULL;
+}
+
+static void end_test(grpc_end2end_test_fixture* f) {
+  shutdown_server(f);
+  shutdown_client(f);
+
+  grpc_completion_queue_shutdown(f->cq);
+  drain_cq(f->cq);
+  grpc_completion_queue_destroy(f->cq);
+  grpc_completion_queue_destroy(f->shutdown_cq);
+}
+
+/* Client sends a request with payload, server reads then returns status. */
+static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
+  grpc_call* c;
+  grpc_call* s;
+  grpc_slice request_payload_slice =
+      grpc_slice_from_copied_string("hello world");
+  grpc_byte_buffer* request_payload =
+      grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+  grpc_end2end_test_fixture f =
+      begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
+  cq_verifier* cqv = cq_verifier_create(f.cq);
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_metadata_array request_metadata_recv;
+  grpc_byte_buffer* request_payload_recv1 = NULL;
+  grpc_byte_buffer* request_payload_recv2 = NULL;
+  grpc_call_details call_details;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details = grpc_empty_slice();
+  int was_cancelled = 2;
+
+  gpr_timespec deadline = five_seconds_from_now();
+  c = grpc_channel_create_call(
+      f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
+      grpc_slice_from_static_string("/foo"),
+      get_host_override_slice("foo.test.google.fr:1234", config), deadline,
+      NULL);
+  GPR_ASSERT(c);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+  grpc_metadata_array_init(&request_metadata_recv);
+  grpc_call_details_init(&call_details);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+                                 f.server, &s, &call_details,
+                                 &request_metadata_recv, f.cq, f.cq, tag(101)));
+  CQ_EXPECT_COMPLETION(cqv, tag(1), true); /* send message is buffered */
+  CQ_EXPECT_COMPLETION(cqv, tag(101), true);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = request_payload;
+  op->flags = GRPC_WRITE_BUFFER_HINT;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(3), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  /* recv message should not succeed yet - it's buffered at the client still */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv1;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(2), true);
+  CQ_EXPECT_COMPLETION(cqv, tag(3), true);
+  CQ_EXPECT_COMPLETION(cqv, tag(102), true);
+  cq_verify(cqv);
+
+  /* send end of stream: should release the buffering */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  /* now the first send should match up with the first recv */
+  CQ_EXPECT_COMPLETION(cqv, tag(103), true);
+  CQ_EXPECT_COMPLETION(cqv, tag(4), true);
+  cq_verify(cqv);
+
+  /* and the next recv should be ready immediately also (and empty) */
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &request_payload_recv2;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(104), true);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(4), NULL);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  grpc_slice status_details = grpc_slice_from_static_string("xyz");
+  op->data.send_status_from_server.status_details = &status_details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(105), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  CQ_EXPECT_COMPLETION(cqv, tag(105), 1);
+  CQ_EXPECT_COMPLETION(cqv, tag(4), 1);
+  cq_verify(cqv);
+
+  GPR_ASSERT(status == GRPC_STATUS_OK);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));
+  validate_host_override_string("foo.test.google.fr:1234", call_details.host,
+                                config);
+  GPR_ASSERT(was_cancelled == 0);
+  GPR_ASSERT(byte_buffer_eq_string(request_payload_recv1, "hello world"));
+  GPR_ASSERT(request_payload_recv2 == NULL);
+
+  grpc_slice_unref(details);
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_metadata_array_destroy(&request_metadata_recv);
+  grpc_call_details_destroy(&call_details);
+
+  grpc_call_unref(c);
+  grpc_call_unref(s);
+
+  cq_verifier_destroy(cqv);
+
+  grpc_byte_buffer_destroy(request_payload);
+  grpc_byte_buffer_destroy(request_payload_recv1);
+
+  end_test(&f);
+  config.tear_down_data(&f);
+}
+
+void write_buffering_at_end(grpc_end2end_test_config config) {
+  test_invoke_request_with_payload(config);
+}
+
+void write_buffering_at_end_pre_init(void) {}
diff --git a/test/core/fling/BUILD b/test/core/fling/BUILD
index 27b2b5b..268e94a 100644
--- a/test/core/fling/BUILD
+++ b/test/core/fling/BUILD
@@ -23,8 +23,8 @@
 grpc_cc_binary(
     name = "client",
     testonly = 1,
-    srcs = ["client.c"],
-    language = "C",
+    srcs = ["client.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -37,8 +37,8 @@
 grpc_cc_binary(
     name = "server",
     testonly = 1,
-    srcs = ["server.c"],
-    language = "C",
+    srcs = ["server.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -50,7 +50,7 @@
 
 grpc_cc_test(
     name = "fling",
-    srcs = ["fling_test.c"],
+    srcs = ["fling_test.cc"],
     data = [
         ":client",
         ":server",
@@ -66,7 +66,7 @@
 
 grpc_cc_test(
     name = "fling_stream",
-    srcs = ["fling_stream_test.c"],
+    srcs = ["fling_stream_test.cc"],
     data = [
         ":client",
         ":server",
diff --git a/test/core/fling/client.c b/test/core/fling/client.c
deleted file mode 100644
index be7bfc2..0000000
--- a/test/core/fling/client.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/cmdline.h>
-#include <grpc/support/histogram.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/profiling/timers.h"
-#include "test/core/util/grpc_profiler.h"
-#include "test/core/util/test_config.h"
-
-static gpr_histogram *histogram;
-static grpc_byte_buffer *the_buffer;
-static grpc_channel *channel;
-static grpc_completion_queue *cq;
-static grpc_call *call;
-static grpc_op ops[6];
-static grpc_op stream_init_ops[2];
-static grpc_op stream_step_ops[2];
-static grpc_metadata_array initial_metadata_recv;
-static grpc_metadata_array trailing_metadata_recv;
-static grpc_byte_buffer *response_payload_recv = NULL;
-static grpc_status_code status;
-static grpc_slice details;
-static grpc_op *op;
-
-static void init_ping_pong_request(void) {
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  op->data.send_message.send_message = the_buffer;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op++;
-}
-
-static void step_ping_pong_request(void) {
-  GPR_TIMER_BEGIN("ping_pong", 1);
-  grpc_slice host = grpc_slice_from_static_string("localhost");
-  call = grpc_channel_create_call(
-      channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-      grpc_slice_from_static_string("/Reflector/reflectUnary"), &host,
-      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops,
-                                                   (size_t)(op - ops),
-                                                   (void *)1, NULL));
-  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  grpc_call_unref(call);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  call = NULL;
-  GPR_TIMER_END("ping_pong", 1);
-}
-
-static void init_ping_pong_stream(void) {
-  grpc_metadata_array_init(&initial_metadata_recv);
-
-  grpc_call_error error;
-  grpc_slice host = grpc_slice_from_static_string("localhost");
-  call = grpc_channel_create_call(
-      channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-      grpc_slice_from_static_string("/Reflector/reflectStream"), &host,
-      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  stream_init_ops[0].op = GRPC_OP_SEND_INITIAL_METADATA;
-  stream_init_ops[0].data.send_initial_metadata.count = 0;
-  stream_init_ops[1].op = GRPC_OP_RECV_INITIAL_METADATA;
-  stream_init_ops[1].data.recv_initial_metadata.recv_initial_metadata =
-      &initial_metadata_recv;
-  error = grpc_call_start_batch(call, stream_init_ops, 2, (void *)1, NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-
-  stream_step_ops[0].op = GRPC_OP_SEND_MESSAGE;
-  stream_step_ops[0].data.send_message.send_message = the_buffer;
-  stream_step_ops[1].op = GRPC_OP_RECV_MESSAGE;
-  stream_step_ops[1].data.recv_message.recv_message = &response_payload_recv;
-}
-
-static void step_ping_pong_stream(void) {
-  grpc_call_error error;
-  GPR_TIMER_BEGIN("ping_pong", 1);
-  error = grpc_call_start_batch(call, stream_step_ops, 2, (void *)1, NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  GPR_TIMER_END("ping_pong", 1);
-}
-
-static double now(void) {
-  gpr_timespec tv = gpr_now(GPR_CLOCK_REALTIME);
-  return 1e9 * (double)tv.tv_sec + tv.tv_nsec;
-}
-
-typedef struct {
-  const char *name;
-  void (*init)();
-  void (*do_one_step)();
-} scenario;
-
-static const scenario scenarios[] = {
-    {"ping-pong-request", init_ping_pong_request, step_ping_pong_request},
-    {"ping-pong-stream", init_ping_pong_stream, step_ping_pong_stream},
-};
-
-int main(int argc, char **argv) {
-  grpc_slice slice = grpc_slice_from_copied_string("x");
-  double start, stop;
-  unsigned i;
-
-  char *fake_argv[1];
-
-  int payload_size = 1;
-  int secure = 0;
-  char *target = "localhost:443";
-  gpr_cmdline *cl;
-  grpc_event event;
-  char *scenario_name = "ping-pong-request";
-  scenario sc = {NULL, NULL, NULL};
-
-  gpr_timers_set_log_filename("latency_trace.fling_client.txt");
-
-  grpc_init();
-
-  GPR_ASSERT(argc >= 1);
-  fake_argv[0] = argv[0];
-  grpc_test_init(1, fake_argv);
-
-  int warmup_seconds = 1;
-  int benchmark_seconds = 5;
-
-  cl = gpr_cmdline_create("fling client");
-  gpr_cmdline_add_int(cl, "payload_size", "Size of the payload to send",
-                      &payload_size);
-  gpr_cmdline_add_string(cl, "target", "Target host:port", &target);
-  gpr_cmdline_add_flag(cl, "secure", "Run with security?", &secure);
-  gpr_cmdline_add_string(cl, "scenario", "Scenario", &scenario_name);
-  gpr_cmdline_add_int(cl, "warmup", "Warmup seconds", &warmup_seconds);
-  gpr_cmdline_add_int(cl, "benchmark", "Benchmark seconds", &benchmark_seconds);
-  gpr_cmdline_parse(cl, argc, argv);
-  gpr_cmdline_destroy(cl);
-
-  for (i = 0; i < GPR_ARRAY_SIZE(scenarios); i++) {
-    if (0 == strcmp(scenarios[i].name, scenario_name)) {
-      sc = scenarios[i];
-    }
-  }
-  if (!sc.name) {
-    fprintf(stderr, "unsupported scenario '%s'. Valid are:", scenario_name);
-    for (i = 0; i < GPR_ARRAY_SIZE(scenarios); i++) {
-      fprintf(stderr, " %s", scenarios[i].name);
-    }
-    return 1;
-  }
-
-  channel = grpc_insecure_channel_create(target, NULL, NULL);
-  cq = grpc_completion_queue_create_for_next(NULL);
-  the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size);
-  histogram = gpr_histogram_create(0.01, 60e9);
-
-  sc.init();
-
-  gpr_timespec end_warmup = grpc_timeout_seconds_to_deadline(warmup_seconds);
-  gpr_timespec end_profiling =
-      grpc_timeout_seconds_to_deadline(warmup_seconds + benchmark_seconds);
-
-  while (gpr_time_cmp(gpr_now(end_warmup.clock_type), end_warmup) < 0) {
-    sc.do_one_step();
-  }
-
-  gpr_log(GPR_INFO, "start profiling");
-  grpc_profiler_start("client.prof");
-  while (gpr_time_cmp(gpr_now(end_profiling.clock_type), end_profiling) < 0) {
-    start = now();
-    sc.do_one_step();
-    stop = now();
-    gpr_histogram_add(histogram, stop - start);
-  }
-  grpc_profiler_stop();
-
-  if (call) {
-    grpc_call_unref(call);
-  }
-
-  grpc_channel_destroy(channel);
-  grpc_completion_queue_shutdown(cq);
-  do {
-    event = grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME),
-                                       NULL);
-  } while (event.type != GRPC_QUEUE_SHUTDOWN);
-  grpc_completion_queue_destroy(cq);
-  grpc_byte_buffer_destroy(the_buffer);
-  grpc_slice_unref(slice);
-
-  gpr_log(GPR_INFO, "latency (50/95/99/99.9): %f/%f/%f/%f",
-          gpr_histogram_percentile(histogram, 50),
-          gpr_histogram_percentile(histogram, 95),
-          gpr_histogram_percentile(histogram, 99),
-          gpr_histogram_percentile(histogram, 99.9));
-  gpr_histogram_destroy(histogram);
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/fling/client.cc b/test/core/fling/client.cc
new file mode 100644
index 0000000..64d1dc5
--- /dev/null
+++ b/test/core/fling/client.cc
@@ -0,0 +1,244 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/cmdline.h>
+#include <grpc/support/histogram.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/profiling/timers.h"
+#include "test/core/util/grpc_profiler.h"
+#include "test/core/util/test_config.h"
+
+static gpr_histogram* histogram;
+static grpc_byte_buffer* the_buffer;
+static grpc_channel* channel;
+static grpc_completion_queue* cq;
+static grpc_call* call;
+static grpc_op ops[6];
+static grpc_op stream_init_ops[2];
+static grpc_op stream_step_ops[2];
+static grpc_metadata_array initial_metadata_recv;
+static grpc_metadata_array trailing_metadata_recv;
+static grpc_byte_buffer* response_payload_recv = NULL;
+static grpc_status_code status;
+static grpc_slice details;
+static grpc_op* op;
+
+static void init_ping_pong_request(void) {
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  op->data.send_message.send_message = the_buffer;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op++;
+}
+
+static void step_ping_pong_request(void) {
+  GPR_TIMER_BEGIN("ping_pong", 1);
+  grpc_slice host = grpc_slice_from_static_string("localhost");
+  call = grpc_channel_create_call(
+      channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+      grpc_slice_from_static_string("/Reflector/reflectUnary"), &host,
+      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops,
+                                                   (size_t)(op - ops), (void*)1,
+                                                   NULL));
+  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  grpc_call_unref(call);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  call = NULL;
+  GPR_TIMER_END("ping_pong", 1);
+}
+
+static void init_ping_pong_stream(void) {
+  grpc_metadata_array_init(&initial_metadata_recv);
+
+  grpc_call_error error;
+  grpc_slice host = grpc_slice_from_static_string("localhost");
+  call = grpc_channel_create_call(
+      channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+      grpc_slice_from_static_string("/Reflector/reflectStream"), &host,
+      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  stream_init_ops[0].op = GRPC_OP_SEND_INITIAL_METADATA;
+  stream_init_ops[0].data.send_initial_metadata.count = 0;
+  stream_init_ops[1].op = GRPC_OP_RECV_INITIAL_METADATA;
+  stream_init_ops[1].data.recv_initial_metadata.recv_initial_metadata =
+      &initial_metadata_recv;
+  error = grpc_call_start_batch(call, stream_init_ops, 2, (void*)1, NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+
+  stream_step_ops[0].op = GRPC_OP_SEND_MESSAGE;
+  stream_step_ops[0].data.send_message.send_message = the_buffer;
+  stream_step_ops[1].op = GRPC_OP_RECV_MESSAGE;
+  stream_step_ops[1].data.recv_message.recv_message = &response_payload_recv;
+}
+
+static void step_ping_pong_stream(void) {
+  grpc_call_error error;
+  GPR_TIMER_BEGIN("ping_pong", 1);
+  error = grpc_call_start_batch(call, stream_step_ops, 2, (void*)1, NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  GPR_TIMER_END("ping_pong", 1);
+}
+
+static double now(void) {
+  gpr_timespec tv = gpr_now(GPR_CLOCK_REALTIME);
+  return 1e9 * (double)tv.tv_sec + tv.tv_nsec;
+}
+
+typedef struct {
+  const char* name;
+  void (*init)();
+  void (*do_one_step)();
+} scenario;
+
+static const scenario scenarios[] = {
+    {"ping-pong-request", init_ping_pong_request, step_ping_pong_request},
+    {"ping-pong-stream", init_ping_pong_stream, step_ping_pong_stream},
+};
+
+int main(int argc, char** argv) {
+  grpc_slice slice = grpc_slice_from_copied_string("x");
+  double start, stop;
+  unsigned i;
+
+  char* fake_argv[1];
+
+  int payload_size = 1;
+  int secure = 0;
+  const char* target = "localhost:443";
+  gpr_cmdline* cl;
+  grpc_event event;
+  const char* scenario_name = "ping-pong-request";
+  scenario sc = {NULL, NULL, NULL};
+
+  gpr_timers_set_log_filename("latency_trace.fling_client.txt");
+
+  grpc_init();
+
+  GPR_ASSERT(argc >= 1);
+  fake_argv[0] = argv[0];
+  grpc_test_init(1, fake_argv);
+
+  int warmup_seconds = 1;
+  int benchmark_seconds = 5;
+
+  cl = gpr_cmdline_create("fling client");
+  gpr_cmdline_add_int(cl, "payload_size", "Size of the payload to send",
+                      &payload_size);
+  gpr_cmdline_add_string(cl, "target", "Target host:port", &target);
+  gpr_cmdline_add_flag(cl, "secure", "Run with security?", &secure);
+  gpr_cmdline_add_string(cl, "scenario", "Scenario", &scenario_name);
+  gpr_cmdline_add_int(cl, "warmup", "Warmup seconds", &warmup_seconds);
+  gpr_cmdline_add_int(cl, "benchmark", "Benchmark seconds", &benchmark_seconds);
+  gpr_cmdline_parse(cl, argc, argv);
+  gpr_cmdline_destroy(cl);
+
+  for (i = 0; i < GPR_ARRAY_SIZE(scenarios); i++) {
+    if (0 == strcmp(scenarios[i].name, scenario_name)) {
+      sc = scenarios[i];
+    }
+  }
+  if (!sc.name) {
+    fprintf(stderr, "unsupported scenario '%s'. Valid are:", scenario_name);
+    for (i = 0; i < GPR_ARRAY_SIZE(scenarios); i++) {
+      fprintf(stderr, " %s", scenarios[i].name);
+    }
+    return 1;
+  }
+
+  channel = grpc_insecure_channel_create(target, NULL, NULL);
+  cq = grpc_completion_queue_create_for_next(NULL);
+  the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size);
+  histogram = gpr_histogram_create(0.01, 60e9);
+
+  sc.init();
+
+  gpr_timespec end_warmup = grpc_timeout_seconds_to_deadline(warmup_seconds);
+  gpr_timespec end_profiling =
+      grpc_timeout_seconds_to_deadline(warmup_seconds + benchmark_seconds);
+
+  while (gpr_time_cmp(gpr_now(end_warmup.clock_type), end_warmup) < 0) {
+    sc.do_one_step();
+  }
+
+  gpr_log(GPR_INFO, "start profiling");
+  grpc_profiler_start("client.prof");
+  while (gpr_time_cmp(gpr_now(end_profiling.clock_type), end_profiling) < 0) {
+    start = now();
+    sc.do_one_step();
+    stop = now();
+    gpr_histogram_add(histogram, stop - start);
+  }
+  grpc_profiler_stop();
+
+  if (call) {
+    grpc_call_unref(call);
+  }
+
+  grpc_channel_destroy(channel);
+  grpc_completion_queue_shutdown(cq);
+  do {
+    event = grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME),
+                                       NULL);
+  } while (event.type != GRPC_QUEUE_SHUTDOWN);
+  grpc_completion_queue_destroy(cq);
+  grpc_byte_buffer_destroy(the_buffer);
+  grpc_slice_unref(slice);
+
+  gpr_log(GPR_INFO, "latency (50/95/99/99.9): %f/%f/%f/%f",
+          gpr_histogram_percentile(histogram, 50),
+          gpr_histogram_percentile(histogram, 95),
+          gpr_histogram_percentile(histogram, 99),
+          gpr_histogram_percentile(histogram, 99.9));
+  gpr_histogram_destroy(histogram);
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/fling/fling_stream_test.c b/test/core/fling/fling_stream_test.c
deleted file mode 100644
index 566d9ae..0000000
--- a/test/core/fling/fling_stream_test.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/subprocess.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/util/port.h"
-
-int main(int argc, char **argv) {
-  char *me = argv[0];
-  char *lslash = strrchr(me, '/');
-  char root[1024];
-  int port = grpc_pick_unused_port_or_die();
-  char *args[10];
-  int status;
-  gpr_subprocess *svr, *cli;
-  /* figure out where we are */
-  if (lslash) {
-    memcpy(root, me, (size_t)(lslash - me));
-    root[lslash - me] = 0;
-  } else {
-    strcpy(root, ".");
-  }
-  /* start the server */
-  gpr_asprintf(&args[0], "%s/fling_server%s", root,
-               gpr_subprocess_binary_extension());
-  args[1] = "--bind";
-  gpr_join_host_port(&args[2], "::", port);
-  args[3] = "--no-secure";
-  svr = gpr_subprocess_create(4, (const char **)args);
-  gpr_free(args[0]);
-  gpr_free(args[2]);
-
-  /* start the client */
-  gpr_asprintf(&args[0], "%s/fling_client%s", root,
-               gpr_subprocess_binary_extension());
-  args[1] = "--target";
-  gpr_join_host_port(&args[2], "127.0.0.1", port);
-  args[3] = "--scenario=ping-pong-stream";
-  args[4] = "--no-secure";
-  args[5] = 0;
-  cli = gpr_subprocess_create(6, (const char **)args);
-  gpr_free(args[0]);
-  gpr_free(args[2]);
-
-  /* wait for completion */
-  printf("waiting for client\n");
-  if ((status = gpr_subprocess_join(cli))) {
-    gpr_subprocess_destroy(cli);
-    gpr_subprocess_destroy(svr);
-    return status;
-  }
-  gpr_subprocess_destroy(cli);
-
-  gpr_subprocess_interrupt(svr);
-  status = gpr_subprocess_join(svr);
-  gpr_subprocess_destroy(svr);
-  return status;
-}
diff --git a/test/core/fling/fling_stream_test.cc b/test/core/fling/fling_stream_test.cc
new file mode 100644
index 0000000..620427e
--- /dev/null
+++ b/test/core/fling/fling_stream_test.cc
@@ -0,0 +1,79 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/subprocess.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/util/port.h"
+
+int main(int argc, char** argv) {
+  char* me = argv[0];
+  char* lslash = strrchr(me, '/');
+  char root[1024];
+  int port = grpc_pick_unused_port_or_die();
+  char* args[10];
+  int status;
+  gpr_subprocess *svr, *cli;
+  /* figure out where we are */
+  if (lslash) {
+    memcpy(root, me, (size_t)(lslash - me));
+    root[lslash - me] = 0;
+  } else {
+    strcpy(root, ".");
+  }
+  /* start the server */
+  gpr_asprintf(&args[0], "%s/fling_server%s", root,
+               gpr_subprocess_binary_extension());
+  args[1] = const_cast<char*>("--bind");
+  gpr_join_host_port(&args[2], "::", port);
+  args[3] = const_cast<char*>("--no-secure");
+  svr = gpr_subprocess_create(4, (const char**)args);
+  gpr_free(args[0]);
+  gpr_free(args[2]);
+
+  /* start the client */
+  gpr_asprintf(&args[0], "%s/fling_client%s", root,
+               gpr_subprocess_binary_extension());
+  args[1] = const_cast<char*>("--target");
+  gpr_join_host_port(&args[2], "127.0.0.1", port);
+  args[3] = const_cast<char*>("--scenario=ping-pong-stream");
+  args[4] = const_cast<char*>("--no-secure");
+  args[5] = 0;
+  cli = gpr_subprocess_create(6, (const char**)args);
+  gpr_free(args[0]);
+  gpr_free(args[2]);
+
+  /* wait for completion */
+  printf("waiting for client\n");
+  if ((status = gpr_subprocess_join(cli))) {
+    gpr_subprocess_destroy(cli);
+    gpr_subprocess_destroy(svr);
+    return status;
+  }
+  gpr_subprocess_destroy(cli);
+
+  gpr_subprocess_interrupt(svr);
+  status = gpr_subprocess_join(svr);
+  gpr_subprocess_destroy(svr);
+  return status;
+}
diff --git a/test/core/fling/fling_test.c b/test/core/fling/fling_test.c
deleted file mode 100644
index 90b48e7..0000000
--- a/test/core/fling/fling_test.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/subprocess.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/util/port.h"
-
-int main(int argc, char **argv) {
-  char *me = argv[0];
-  char *lslash = strrchr(me, '/');
-  char root[1024];
-  int port = grpc_pick_unused_port_or_die();
-  char *args[10];
-  int status;
-  gpr_subprocess *svr, *cli;
-  /* figure out where we are */
-  if (lslash) {
-    memcpy(root, me, (size_t)(lslash - me));
-    root[lslash - me] = 0;
-  } else {
-    strcpy(root, ".");
-  }
-  /* start the server */
-  gpr_asprintf(&args[0], "%s/fling_server%s", root,
-               gpr_subprocess_binary_extension());
-  args[1] = "--bind";
-  gpr_join_host_port(&args[2], "::", port);
-  args[3] = "--no-secure";
-  svr = gpr_subprocess_create(4, (const char **)args);
-  gpr_free(args[0]);
-  gpr_free(args[2]);
-
-  /* start the client */
-  gpr_asprintf(&args[0], "%s/fling_client%s", root,
-               gpr_subprocess_binary_extension());
-  args[1] = "--target";
-  gpr_join_host_port(&args[2], "127.0.0.1", port);
-  args[3] = "--scenario=ping-pong-request";
-  args[4] = "--no-secure";
-  args[5] = 0;
-  cli = gpr_subprocess_create(6, (const char **)args);
-  gpr_free(args[0]);
-  gpr_free(args[2]);
-
-  /* wait for completion */
-  printf("waiting for client\n");
-  if ((status = gpr_subprocess_join(cli))) {
-    gpr_subprocess_destroy(cli);
-    gpr_subprocess_destroy(svr);
-    return status;
-  }
-  gpr_subprocess_destroy(cli);
-
-  gpr_subprocess_interrupt(svr);
-  status = gpr_subprocess_join(svr);
-  gpr_subprocess_destroy(svr);
-  return status;
-}
diff --git a/test/core/fling/fling_test.cc b/test/core/fling/fling_test.cc
new file mode 100644
index 0000000..1d4263a
--- /dev/null
+++ b/test/core/fling/fling_test.cc
@@ -0,0 +1,79 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/subprocess.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/util/port.h"
+
+int main(int argc, const char** argv) {
+  const char* me = argv[0];
+  const char* lslash = strrchr(me, '/');
+  char root[1024];
+  int port = grpc_pick_unused_port_or_die();
+  char* args[10];
+  int status;
+  gpr_subprocess *svr, *cli;
+  /* figure out where we are */
+  if (lslash) {
+    memcpy(root, me, (size_t)(lslash - me));
+    root[lslash - me] = 0;
+  } else {
+    strcpy(root, ".");
+  }
+  /* start the server */
+  gpr_asprintf(&args[0], "%s/fling_server%s", root,
+               gpr_subprocess_binary_extension());
+  args[1] = const_cast<char*>("--bind");
+  gpr_join_host_port(&args[2], "::", port);
+  args[3] = const_cast<char*>("--no-secure");
+  svr = gpr_subprocess_create(4, (const char**)args);
+  gpr_free(args[0]);
+  gpr_free(args[2]);
+
+  /* start the client */
+  gpr_asprintf(&args[0], "%s/fling_client%s", root,
+               gpr_subprocess_binary_extension());
+  args[1] = const_cast<char*>("--target");
+  gpr_join_host_port(&args[2], "127.0.0.1", port);
+  args[3] = const_cast<char*>("--scenario=ping-pong-request");
+  args[4] = const_cast<char*>("--no-secure");
+  args[5] = 0;
+  cli = gpr_subprocess_create(6, (const char**)args);
+  gpr_free(args[0]);
+  gpr_free(args[2]);
+
+  /* wait for completion */
+  printf("waiting for client\n");
+  if ((status = gpr_subprocess_join(cli))) {
+    gpr_subprocess_destroy(cli);
+    gpr_subprocess_destroy(svr);
+    return status;
+  }
+  gpr_subprocess_destroy(cli);
+
+  gpr_subprocess_interrupt(svr);
+  status = gpr_subprocess_join(svr);
+  gpr_subprocess_destroy(svr);
+  return status;
+}
diff --git a/test/core/fling/server.c b/test/core/fling/server.c
deleted file mode 100644
index b3a7fa2..0000000
--- a/test/core/fling/server.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#ifndef _WIN32
-/* This is for _exit() below, which is temporary. */
-#include <unistd.h>
-#endif
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/cmdline.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include "src/core/lib/profiling/timers.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/util/grpc_profiler.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static grpc_completion_queue *cq;
-static grpc_server *server;
-static grpc_call *call;
-static grpc_call_details call_details;
-static grpc_metadata_array request_metadata_recv;
-static grpc_metadata_array initial_metadata_send;
-static grpc_byte_buffer *payload_buffer = NULL;
-/* Used to drain the terminal read in unary calls. */
-static grpc_byte_buffer *terminal_buffer = NULL;
-
-static grpc_op read_op;
-static grpc_op metadata_send_op;
-static grpc_op write_op;
-static grpc_op status_op[2];
-static int was_cancelled = 2;
-static grpc_op unary_ops[6];
-static int got_sigint = 0;
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-typedef enum {
-  FLING_SERVER_NEW_REQUEST = 1,
-  FLING_SERVER_READ_FOR_UNARY,
-  FLING_SERVER_BATCH_OPS_FOR_UNARY,
-  FLING_SERVER_SEND_INIT_METADATA_FOR_STREAMING,
-  FLING_SERVER_READ_FOR_STREAMING,
-  FLING_SERVER_WRITE_FOR_STREAMING,
-  FLING_SERVER_SEND_STATUS_FOR_STREAMING
-} fling_server_tags;
-
-typedef struct {
-  gpr_refcount pending_ops;
-  uint32_t flags;
-} call_state;
-
-static void request_call(void) {
-  grpc_metadata_array_init(&request_metadata_recv);
-  GPR_ASSERT(GRPC_CALL_OK ==
-             grpc_server_request_call(server, &call, &call_details,
-                                      &request_metadata_recv, cq, cq,
-                                      tag(FLING_SERVER_NEW_REQUEST)));
-}
-
-static void handle_unary_method(void) {
-  grpc_op *op;
-  grpc_call_error error;
-
-  grpc_metadata_array_init(&initial_metadata_send);
-
-  op = unary_ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &terminal_buffer;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  if (payload_buffer == NULL) {
-    gpr_log(GPR_INFO, "NULL payload buffer !!!");
-  }
-  op->data.send_message.send_message = payload_buffer;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  op->data.send_status_from_server.status_details = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op++;
-
-  error = grpc_call_start_batch(call, unary_ops, (size_t)(op - unary_ops),
-                                tag(FLING_SERVER_BATCH_OPS_FOR_UNARY), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-}
-
-static void send_initial_metadata(void) {
-  grpc_call_error error;
-  void *tagarg = tag(FLING_SERVER_SEND_INIT_METADATA_FOR_STREAMING);
-  grpc_metadata_array_init(&initial_metadata_send);
-  metadata_send_op.op = GRPC_OP_SEND_INITIAL_METADATA;
-  metadata_send_op.data.send_initial_metadata.count = 0;
-  error = grpc_call_start_batch(call, &metadata_send_op, 1, tagarg, NULL);
-
-  GPR_ASSERT(GRPC_CALL_OK == error);
-}
-
-static void start_read_op(int t) {
-  grpc_call_error error;
-  /* Starting read at server */
-  read_op.op = GRPC_OP_RECV_MESSAGE;
-  read_op.data.recv_message.recv_message = &payload_buffer;
-  error = grpc_call_start_batch(call, &read_op, 1, tag(t), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-}
-
-static void start_write_op(void) {
-  grpc_call_error error;
-  void *tagarg = tag(FLING_SERVER_WRITE_FOR_STREAMING);
-  /* Starting write at server */
-  write_op.op = GRPC_OP_SEND_MESSAGE;
-  if (payload_buffer == NULL) {
-    gpr_log(GPR_INFO, "NULL payload buffer !!!");
-  }
-  write_op.data.send_message.send_message = payload_buffer;
-  error = grpc_call_start_batch(call, &write_op, 1, tagarg, NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-}
-
-static void start_send_status(void) {
-  grpc_call_error error;
-  void *tagarg = tag(FLING_SERVER_SEND_STATUS_FOR_STREAMING);
-  status_op[0].op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  status_op[0].data.send_status_from_server.status = GRPC_STATUS_OK;
-  status_op[0].data.send_status_from_server.trailing_metadata_count = 0;
-  status_op[0].data.send_status_from_server.status_details = NULL;
-  status_op[1].op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  status_op[1].data.recv_close_on_server.cancelled = &was_cancelled;
-
-  error = grpc_call_start_batch(call, status_op, 2, tagarg, NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-}
-
-/* We have some sort of deadlock, so let's not exit gracefully for now.
-   When that is resolved, please remove the #include <unistd.h> above. */
-static void sigint_handler(int x) { _exit(0); }
-
-int main(int argc, char **argv) {
-  grpc_event ev;
-  call_state *s;
-  char *addr_buf = NULL;
-  gpr_cmdline *cl;
-  grpc_completion_queue *shutdown_cq;
-  int shutdown_started = 0;
-  int shutdown_finished = 0;
-
-  int secure = 0;
-  char *addr = NULL;
-
-  char *fake_argv[1];
-
-  gpr_timers_set_log_filename("latency_trace.fling_server.txt");
-
-  GPR_ASSERT(argc >= 1);
-  fake_argv[0] = argv[0];
-  grpc_test_init(1, fake_argv);
-
-  grpc_init();
-  srand((unsigned)clock());
-
-  cl = gpr_cmdline_create("fling server");
-  gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr);
-  gpr_cmdline_add_flag(cl, "secure", "Run with security?", &secure);
-  gpr_cmdline_parse(cl, argc, argv);
-  gpr_cmdline_destroy(cl);
-
-  if (addr == NULL) {
-    gpr_join_host_port(&addr_buf, "::", grpc_pick_unused_port_or_die());
-    addr = addr_buf;
-  }
-  gpr_log(GPR_INFO, "creating server on: %s", addr);
-
-  cq = grpc_completion_queue_create_for_next(NULL);
-  if (secure) {
-    grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
-                                                    test_server1_cert};
-    grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(
-        NULL, &pem_key_cert_pair, 1, 0, NULL);
-    server = grpc_server_create(NULL, NULL);
-    GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
-    grpc_server_credentials_release(ssl_creds);
-  } else {
-    server = grpc_server_create(NULL, NULL);
-    GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr));
-  }
-  grpc_server_register_completion_queue(server, cq, NULL);
-  grpc_server_start(server);
-
-  gpr_free(addr_buf);
-  addr = addr_buf = NULL;
-
-  grpc_call_details_init(&call_details);
-
-  request_call();
-
-  grpc_profiler_start("server.prof");
-  signal(SIGINT, sigint_handler);
-  while (!shutdown_finished) {
-    if (got_sigint && !shutdown_started) {
-      gpr_log(GPR_INFO, "Shutting down due to SIGINT");
-
-      shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-      grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
-
-      GPR_ASSERT(
-          grpc_completion_queue_pluck(shutdown_cq, tag(1000),
-                                      grpc_timeout_seconds_to_deadline(5), NULL)
-              .type == GRPC_OP_COMPLETE);
-      grpc_completion_queue_destroy(shutdown_cq);
-
-      grpc_completion_queue_shutdown(cq);
-      shutdown_started = 1;
-    }
-    ev = grpc_completion_queue_next(
-        cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                         gpr_time_from_micros(1000000, GPR_TIMESPAN)),
-        NULL);
-    s = ev.tag;
-    switch (ev.type) {
-      case GRPC_OP_COMPLETE:
-        switch ((intptr_t)s) {
-          case FLING_SERVER_NEW_REQUEST:
-            if (call != NULL) {
-              if (0 == grpc_slice_str_cmp(call_details.method,
-                                          "/Reflector/reflectStream")) {
-                /* Received streaming call. Send metadata here. */
-                start_read_op(FLING_SERVER_READ_FOR_STREAMING);
-                send_initial_metadata();
-              } else {
-                /* Received unary call. Can do all ops in one batch. */
-                start_read_op(FLING_SERVER_READ_FOR_UNARY);
-              }
-            } else {
-              GPR_ASSERT(shutdown_started);
-            }
-            /*      request_call();
-             */
-            break;
-          case FLING_SERVER_READ_FOR_STREAMING:
-            if (payload_buffer != NULL) {
-              /* Received payload from client. */
-              start_write_op();
-            } else {
-              /* Received end of stream from client. */
-              start_send_status();
-            }
-            break;
-          case FLING_SERVER_WRITE_FOR_STREAMING:
-            /* Write completed at server  */
-            grpc_byte_buffer_destroy(payload_buffer);
-            payload_buffer = NULL;
-            start_read_op(FLING_SERVER_READ_FOR_STREAMING);
-            break;
-          case FLING_SERVER_SEND_INIT_METADATA_FOR_STREAMING:
-            /* Metadata send completed at server */
-            break;
-          case FLING_SERVER_SEND_STATUS_FOR_STREAMING:
-            /* Send status and close completed at server */
-            grpc_call_unref(call);
-            if (!shutdown_started) request_call();
-            break;
-          case FLING_SERVER_READ_FOR_UNARY:
-            /* Finished payload read for unary. Start all reamaining
-             *  unary ops in a batch.
-             */
-            handle_unary_method();
-            break;
-          case FLING_SERVER_BATCH_OPS_FOR_UNARY:
-            /* Finished unary call. */
-            grpc_byte_buffer_destroy(payload_buffer);
-            payload_buffer = NULL;
-            grpc_call_unref(call);
-            if (!shutdown_started) request_call();
-            break;
-        }
-        break;
-      case GRPC_QUEUE_SHUTDOWN:
-        GPR_ASSERT(shutdown_started);
-        shutdown_finished = 1;
-        break;
-      case GRPC_QUEUE_TIMEOUT:
-        break;
-    }
-  }
-  grpc_profiler_stop();
-  grpc_call_details_destroy(&call_details);
-
-  grpc_server_destroy(server);
-  grpc_completion_queue_destroy(cq);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/fling/server.cc b/test/core/fling/server.cc
new file mode 100644
index 0000000..4dfb30f
--- /dev/null
+++ b/test/core/fling/server.cc
@@ -0,0 +1,325 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#ifndef _WIN32
+/* This is for _exit() below, which is temporary. */
+#include <unistd.h>
+#endif
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include "src/core/lib/profiling/timers.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/util/grpc_profiler.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static grpc_completion_queue* cq;
+static grpc_server* server;
+static grpc_call* call;
+static grpc_call_details call_details;
+static grpc_metadata_array request_metadata_recv;
+static grpc_metadata_array initial_metadata_send;
+static grpc_byte_buffer* payload_buffer = NULL;
+/* Used to drain the terminal read in unary calls. */
+static grpc_byte_buffer* terminal_buffer = NULL;
+
+static grpc_op read_op;
+static grpc_op metadata_send_op;
+static grpc_op write_op;
+static grpc_op status_op[2];
+static int was_cancelled = 2;
+static grpc_op unary_ops[6];
+static int got_sigint = 0;
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+typedef enum {
+  FLING_SERVER_NEW_REQUEST = 1,
+  FLING_SERVER_READ_FOR_UNARY,
+  FLING_SERVER_BATCH_OPS_FOR_UNARY,
+  FLING_SERVER_SEND_INIT_METADATA_FOR_STREAMING,
+  FLING_SERVER_READ_FOR_STREAMING,
+  FLING_SERVER_WRITE_FOR_STREAMING,
+  FLING_SERVER_SEND_STATUS_FOR_STREAMING
+} fling_server_tags;
+
+typedef struct {
+  gpr_refcount pending_ops;
+  uint32_t flags;
+} call_state;
+
+static void request_call(void) {
+  grpc_metadata_array_init(&request_metadata_recv);
+  GPR_ASSERT(GRPC_CALL_OK ==
+             grpc_server_request_call(server, &call, &call_details,
+                                      &request_metadata_recv, cq, cq,
+                                      tag(FLING_SERVER_NEW_REQUEST)));
+}
+
+static void handle_unary_method(void) {
+  grpc_op* op;
+  grpc_call_error error;
+
+  grpc_metadata_array_init(&initial_metadata_send);
+
+  op = unary_ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &terminal_buffer;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  if (payload_buffer == NULL) {
+    gpr_log(GPR_INFO, "NULL payload buffer !!!");
+  }
+  op->data.send_message.send_message = payload_buffer;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  op->data.send_status_from_server.status_details = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op++;
+
+  error = grpc_call_start_batch(call, unary_ops, (size_t)(op - unary_ops),
+                                tag(FLING_SERVER_BATCH_OPS_FOR_UNARY), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+}
+
+static void send_initial_metadata(void) {
+  grpc_call_error error;
+  void* tagarg = tag(FLING_SERVER_SEND_INIT_METADATA_FOR_STREAMING);
+  grpc_metadata_array_init(&initial_metadata_send);
+  metadata_send_op.op = GRPC_OP_SEND_INITIAL_METADATA;
+  metadata_send_op.data.send_initial_metadata.count = 0;
+  error = grpc_call_start_batch(call, &metadata_send_op, 1, tagarg, NULL);
+
+  GPR_ASSERT(GRPC_CALL_OK == error);
+}
+
+static void start_read_op(int t) {
+  grpc_call_error error;
+  /* Starting read at server */
+  read_op.op = GRPC_OP_RECV_MESSAGE;
+  read_op.data.recv_message.recv_message = &payload_buffer;
+  error = grpc_call_start_batch(call, &read_op, 1, tag(t), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+}
+
+static void start_write_op(void) {
+  grpc_call_error error;
+  void* tagarg = tag(FLING_SERVER_WRITE_FOR_STREAMING);
+  /* Starting write at server */
+  write_op.op = GRPC_OP_SEND_MESSAGE;
+  if (payload_buffer == NULL) {
+    gpr_log(GPR_INFO, "NULL payload buffer !!!");
+  }
+  write_op.data.send_message.send_message = payload_buffer;
+  error = grpc_call_start_batch(call, &write_op, 1, tagarg, NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+}
+
+static void start_send_status(void) {
+  grpc_call_error error;
+  void* tagarg = tag(FLING_SERVER_SEND_STATUS_FOR_STREAMING);
+  status_op[0].op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  status_op[0].data.send_status_from_server.status = GRPC_STATUS_OK;
+  status_op[0].data.send_status_from_server.trailing_metadata_count = 0;
+  status_op[0].data.send_status_from_server.status_details = NULL;
+  status_op[1].op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  status_op[1].data.recv_close_on_server.cancelled = &was_cancelled;
+
+  error = grpc_call_start_batch(call, status_op, 2, tagarg, NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+}
+
+/* We have some sort of deadlock, so let's not exit gracefully for now.
+   When that is resolved, please remove the #include <unistd.h> above. */
+static void sigint_handler(int x) { _exit(0); }
+
+int main(int argc, char** argv) {
+  grpc_event ev;
+  call_state* s;
+  char* addr_buf = NULL;
+  gpr_cmdline* cl;
+  grpc_completion_queue* shutdown_cq;
+  int shutdown_started = 0;
+  int shutdown_finished = 0;
+
+  int secure = 0;
+  const char* addr = NULL;
+
+  char* fake_argv[1];
+
+  gpr_timers_set_log_filename("latency_trace.fling_server.txt");
+
+  GPR_ASSERT(argc >= 1);
+  fake_argv[0] = argv[0];
+  grpc_test_init(1, fake_argv);
+
+  grpc_init();
+  srand((unsigned)clock());
+
+  cl = gpr_cmdline_create("fling server");
+  gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr);
+  gpr_cmdline_add_flag(cl, "secure", "Run with security?", &secure);
+  gpr_cmdline_parse(cl, argc, argv);
+  gpr_cmdline_destroy(cl);
+
+  if (addr == NULL) {
+    gpr_join_host_port(&addr_buf, "::", grpc_pick_unused_port_or_die());
+    addr = addr_buf;
+  }
+  gpr_log(GPR_INFO, "creating server on: %s", addr);
+
+  cq = grpc_completion_queue_create_for_next(NULL);
+  if (secure) {
+    grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
+                                                    test_server1_cert};
+    grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(
+        NULL, &pem_key_cert_pair, 1, 0, NULL);
+    server = grpc_server_create(NULL, NULL);
+    GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
+    grpc_server_credentials_release(ssl_creds);
+  } else {
+    server = grpc_server_create(NULL, NULL);
+    GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr));
+  }
+  grpc_server_register_completion_queue(server, cq, NULL);
+  grpc_server_start(server);
+
+  gpr_free(addr_buf);
+  addr = addr_buf = NULL;
+
+  grpc_call_details_init(&call_details);
+
+  request_call();
+
+  grpc_profiler_start("server.prof");
+  signal(SIGINT, sigint_handler);
+  while (!shutdown_finished) {
+    if (got_sigint && !shutdown_started) {
+      gpr_log(GPR_INFO, "Shutting down due to SIGINT");
+
+      shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+      grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
+
+      GPR_ASSERT(
+          grpc_completion_queue_pluck(shutdown_cq, tag(1000),
+                                      grpc_timeout_seconds_to_deadline(5), NULL)
+              .type == GRPC_OP_COMPLETE);
+      grpc_completion_queue_destroy(shutdown_cq);
+
+      grpc_completion_queue_shutdown(cq);
+      shutdown_started = 1;
+    }
+    ev = grpc_completion_queue_next(
+        cq,
+        gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                     gpr_time_from_micros(1000000, GPR_TIMESPAN)),
+        NULL);
+    s = static_cast<call_state*>(ev.tag);
+    switch (ev.type) {
+      case GRPC_OP_COMPLETE:
+        switch ((intptr_t)s) {
+          case FLING_SERVER_NEW_REQUEST:
+            if (call != NULL) {
+              if (0 == grpc_slice_str_cmp(call_details.method,
+                                          "/Reflector/reflectStream")) {
+                /* Received streaming call. Send metadata here. */
+                start_read_op(FLING_SERVER_READ_FOR_STREAMING);
+                send_initial_metadata();
+              } else {
+                /* Received unary call. Can do all ops in one batch. */
+                start_read_op(FLING_SERVER_READ_FOR_UNARY);
+              }
+            } else {
+              GPR_ASSERT(shutdown_started);
+            }
+            /*      request_call();
+             */
+            break;
+          case FLING_SERVER_READ_FOR_STREAMING:
+            if (payload_buffer != NULL) {
+              /* Received payload from client. */
+              start_write_op();
+            } else {
+              /* Received end of stream from client. */
+              start_send_status();
+            }
+            break;
+          case FLING_SERVER_WRITE_FOR_STREAMING:
+            /* Write completed at server  */
+            grpc_byte_buffer_destroy(payload_buffer);
+            payload_buffer = NULL;
+            start_read_op(FLING_SERVER_READ_FOR_STREAMING);
+            break;
+          case FLING_SERVER_SEND_INIT_METADATA_FOR_STREAMING:
+            /* Metadata send completed at server */
+            break;
+          case FLING_SERVER_SEND_STATUS_FOR_STREAMING:
+            /* Send status and close completed at server */
+            grpc_call_unref(call);
+            if (!shutdown_started) request_call();
+            break;
+          case FLING_SERVER_READ_FOR_UNARY:
+            /* Finished payload read for unary. Start all reamaining
+             *  unary ops in a batch.
+             */
+            handle_unary_method();
+            break;
+          case FLING_SERVER_BATCH_OPS_FOR_UNARY:
+            /* Finished unary call. */
+            grpc_byte_buffer_destroy(payload_buffer);
+            payload_buffer = NULL;
+            grpc_call_unref(call);
+            if (!shutdown_started) request_call();
+            break;
+        }
+        break;
+      case GRPC_QUEUE_SHUTDOWN:
+        GPR_ASSERT(shutdown_started);
+        shutdown_finished = 1;
+        break;
+      case GRPC_QUEUE_TIMEOUT:
+        break;
+    }
+  }
+  grpc_profiler_stop();
+  grpc_call_details_destroy(&call_details);
+
+  grpc_server_destroy(server);
+  grpc_completion_queue_destroy(cq);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/handshake/BUILD b/test/core/handshake/BUILD
index 8e462cf..aea4a27 100644
--- a/test/core/handshake/BUILD
+++ b/test/core/handshake/BUILD
@@ -20,8 +20,8 @@
 
 grpc_cc_test(
     name = "client_ssl",
-    srcs = ["client_ssl.c"],
-    language = "C",
+    srcs = ["client_ssl.cc"],
+    language = "C++",
     data = [
         "//src/core/tsi/test_creds:ca.pem",
         "//src/core/tsi/test_creds:server1.key",
@@ -37,8 +37,8 @@
 
 grpc_cc_test(
     name = "server_ssl",
-    srcs = ["server_ssl.c"],
-    language = "C",
+    srcs = ["server_ssl.cc"],
+    language = "C++",
     data = [
         "//src/core/tsi/test_creds:ca.pem",
         "//src/core/tsi/test_creds:server1.key",
diff --git a/test/core/handshake/client_ssl.c b/test/core/handshake/client_ssl.c
deleted file mode 100644
index de660fe..0000000
--- a/test/core/handshake/client_ssl.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with posix sockets enabled
-#ifdef GRPC_POSIX_SOCKET
-
-#include <arpa/inet.h>
-#include <openssl/err.h>
-#include <openssl/ssl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/thd.h>
-#include "src/core/lib/iomgr/load_file.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-#define SSL_CERT_PATH "src/core/tsi/test_creds/server1.pem"
-#define SSL_KEY_PATH "src/core/tsi/test_creds/server1.key"
-#define SSL_CA_PATH "src/core/tsi/test_creds/ca.pem"
-
-// Arguments for TLS server thread.
-typedef struct {
-  int socket;
-  char *alpn_preferred;
-} server_args;
-
-// Based on https://wiki.openssl.org/index.php/Simple_TLS_Server.
-// Pick an arbitrary unused port and return it in *out_port. Return
-// an fd>=0 on success.
-static int create_socket(int *out_port) {
-  int s;
-  struct sockaddr_in addr;
-  socklen_t addr_len;
-  *out_port = -1;
-
-  addr.sin_family = AF_INET;
-  addr.sin_port = 0;
-  addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
-  s = socket(AF_INET, SOCK_STREAM, 0);
-  if (s < 0) {
-    perror("Unable to create socket");
-    return -1;
-  }
-
-  if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-    perror("Unable to bind");
-    gpr_log(GPR_ERROR, "%s", "Unable to bind to any port");
-    close(s);
-    return -1;
-  }
-
-  if (listen(s, 1) < 0) {
-    perror("Unable to listen");
-    close(s);
-    return -1;
-  }
-
-  addr_len = sizeof(addr);
-  if (getsockname(s, (struct sockaddr *)&addr, &addr_len) != 0 ||
-      addr_len > sizeof(addr)) {
-    perror("getsockname");
-    gpr_log(GPR_ERROR, "%s", "Unable to get socket local address");
-    close(s);
-    return -1;
-  }
-
-  *out_port = ntohs(addr.sin_port);
-  return s;
-}
-
-// Server callback during ALPN negotiation. See man page for
-// SSL_CTX_set_alpn_select_cb.
-static int alpn_select_cb(SSL *ssl, const uint8_t **out, uint8_t *out_len,
-                          const uint8_t *in, unsigned in_len, void *arg) {
-  const uint8_t *alpn_preferred = (const uint8_t *)arg;
-
-  *out = alpn_preferred;
-  *out_len = (uint8_t)strlen((char *)alpn_preferred);
-
-  // Validate that the ALPN list includes "h2" and "grpc-exp", that "grpc-exp"
-  // precedes "h2".
-  bool grpc_exp_seen = false;
-  bool h2_seen = false;
-  const char *inp = (const char *)in;
-  const char *in_end = inp + in_len;
-  while (inp < in_end) {
-    const size_t length = (size_t)*inp++;
-    if (length == strlen("grpc-exp") && strncmp(inp, "grpc-exp", length) == 0) {
-      grpc_exp_seen = true;
-      GPR_ASSERT(!h2_seen);
-    }
-    if (length == strlen("h2") && strncmp(inp, "h2", length) == 0) {
-      h2_seen = true;
-      GPR_ASSERT(grpc_exp_seen);
-    }
-    inp += length;
-  }
-
-  GPR_ASSERT(inp == in_end);
-  GPR_ASSERT(grpc_exp_seen);
-  GPR_ASSERT(h2_seen);
-
-  return SSL_TLSEXT_ERR_OK;
-}
-
-// Minimal TLS server. This is largely based on the example at
-// https://wiki.openssl.org/index.php/Simple_TLS_Server and the gRPC core
-// internals in src/core/tsi/ssl_transport_security.c.
-static void server_thread(void *arg) {
-  const server_args *args = (server_args *)arg;
-
-  SSL_load_error_strings();
-  OpenSSL_add_ssl_algorithms();
-
-  const SSL_METHOD *method = TLSv1_2_server_method();
-  SSL_CTX *ctx = SSL_CTX_new(method);
-  if (!ctx) {
-    perror("Unable to create SSL context");
-    ERR_print_errors_fp(stderr);
-    abort();
-  }
-
-  // Load key pair.
-  if (SSL_CTX_use_certificate_file(ctx, SSL_CERT_PATH, SSL_FILETYPE_PEM) < 0) {
-    ERR_print_errors_fp(stderr);
-    abort();
-  }
-  if (SSL_CTX_use_PrivateKey_file(ctx, SSL_KEY_PATH, SSL_FILETYPE_PEM) < 0) {
-    ERR_print_errors_fp(stderr);
-    abort();
-  }
-
-  // Set the cipher list to match the one expressed in
-  // src/core/tsi/ssl_transport_security.c.
-  const char *cipher_list =
-      "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-"
-      "SHA384:ECDHE-RSA-AES256-GCM-SHA384";
-  if (!SSL_CTX_set_cipher_list(ctx, cipher_list)) {
-    ERR_print_errors_fp(stderr);
-    gpr_log(GPR_ERROR, "Couldn't set server cipher list.");
-    abort();
-  }
-
-  // Register the ALPN selection callback.
-  SSL_CTX_set_alpn_select_cb(ctx, alpn_select_cb, args->alpn_preferred);
-
-  // bind/listen/accept at TCP layer.
-  const int sock = args->socket;
-  gpr_log(GPR_INFO, "Server listening");
-  struct sockaddr_in addr;
-  socklen_t len = sizeof(addr);
-  const int client = accept(sock, (struct sockaddr *)&addr, &len);
-  if (client < 0) {
-    perror("Unable to accept");
-    abort();
-  }
-
-  // Establish a SSL* and accept at SSL layer.
-  SSL *ssl = SSL_new(ctx);
-  GPR_ASSERT(ssl);
-  SSL_set_fd(ssl, client);
-  if (SSL_accept(ssl) <= 0) {
-    ERR_print_errors_fp(stderr);
-    gpr_log(GPR_ERROR, "Handshake failed.");
-  } else {
-    gpr_log(GPR_INFO, "Handshake successful.");
-  }
-
-  // Wait until the client drops its connection.
-  char buf;
-  while (SSL_read(ssl, &buf, sizeof(buf)) > 0)
-    ;
-
-  SSL_free(ssl);
-  close(client);
-  close(sock);
-  SSL_CTX_free(ctx);
-  EVP_cleanup();
-}
-
-// This test launches a minimal TLS server on a separate thread and then
-// establishes a TLS handshake via the core library to the server. The TLS
-// server validates ALPN aspects of the handshake and supplies the protocol
-// specified in the server_alpn_preferred argument to the client.
-static bool client_ssl_test(char *server_alpn_preferred) {
-  bool success = true;
-
-  grpc_init();
-
-  // Find a port we can bind to. Retries added to handle flakes in port server
-  // and port picking.
-  int port = -1;
-  int server_socket = -1;
-  int socket_retries = 30;
-  while (server_socket == -1 && socket_retries-- > 0) {
-    server_socket = create_socket(&port);
-    if (server_socket == -1) {
-      sleep(1);
-    }
-  }
-  GPR_ASSERT(server_socket > 0 && port > 0);
-
-  // Launch the TLS server thread.
-  gpr_thd_options thdopt = gpr_thd_options_default();
-  gpr_thd_id thdid;
-  gpr_thd_options_set_joinable(&thdopt);
-  server_args args = {.socket = server_socket,
-                      .alpn_preferred = server_alpn_preferred};
-  GPR_ASSERT(gpr_thd_new(&thdid, server_thread, &args, &thdopt));
-
-  // Load key pair and establish client SSL credentials.
-  grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
-  grpc_slice ca_slice, cert_slice, key_slice;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
-                               grpc_load_file(SSL_CA_PATH, 1, &ca_slice)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
-                               grpc_load_file(SSL_CERT_PATH, 1, &cert_slice)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
-                               grpc_load_file(SSL_KEY_PATH, 1, &key_slice)));
-  const char *ca_cert = (const char *)GRPC_SLICE_START_PTR(ca_slice);
-  pem_key_cert_pair.private_key = (const char *)GRPC_SLICE_START_PTR(key_slice);
-  pem_key_cert_pair.cert_chain = (const char *)GRPC_SLICE_START_PTR(cert_slice);
-  grpc_channel_credentials *ssl_creds =
-      grpc_ssl_credentials_create(ca_cert, &pem_key_cert_pair, NULL);
-
-  // Establish a channel pointing at the TLS server. Since the gRPC runtime is
-  // lazy, this won't necessarily establish a connection yet.
-  char *target;
-  gpr_asprintf(&target, "127.0.0.1:%d", port);
-  grpc_arg ssl_name_override = {GRPC_ARG_STRING,
-                                GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
-                                {"foo.test.google.fr"}};
-  grpc_channel_args grpc_args;
-  grpc_args.num_args = 1;
-  grpc_args.args = &ssl_name_override;
-  grpc_channel *channel =
-      grpc_secure_channel_create(ssl_creds, target, &grpc_args, NULL);
-  GPR_ASSERT(channel);
-  gpr_free(target);
-
-  // Initially the channel will be idle, the
-  // grpc_channel_check_connectivity_state triggers an attempt to connect.
-  GPR_ASSERT(grpc_channel_check_connectivity_state(
-                 channel, 1 /* try_to_connect */) == GRPC_CHANNEL_IDLE);
-
-  // Wait a bounded number of times for the channel to be ready. When the
-  // channel is ready, the initial TLS handshake will have successfully
-  // completed and we know that the client's ALPN list satisfied the server.
-  int retries = 10;
-  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-
-  while (state != GRPC_CHANNEL_READY && retries-- > 0) {
-    grpc_channel_watch_connectivity_state(
-        channel, state, grpc_timeout_seconds_to_deadline(3), cq, NULL);
-    gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(5);
-    grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, NULL);
-    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-    state =
-        grpc_channel_check_connectivity_state(channel, 0 /* try_to_connect */);
-  }
-  grpc_completion_queue_destroy(cq);
-  if (retries < 0) {
-    success = false;
-  }
-
-  grpc_channel_destroy(channel);
-  grpc_channel_credentials_release(ssl_creds);
-  grpc_slice_unref(cert_slice);
-  grpc_slice_unref(key_slice);
-  grpc_slice_unref(ca_slice);
-
-  gpr_thd_join(thdid);
-
-  grpc_shutdown();
-
-  return success;
-}
-
-int main(int argc, char *argv[]) {
-  // Handshake succeeeds when the server has grpc-exp as the ALPN preference.
-  GPR_ASSERT(client_ssl_test("grpc-exp"));
-  // Handshake succeeeds when the server has h2 as the ALPN preference. This
-  // covers legacy gRPC servers which don't support grpc-exp.
-  GPR_ASSERT(client_ssl_test("h2"));
-  // Handshake fails when the server uses a fake protocol as its ALPN
-  // preference. This validates the client is correctly validating ALPN returns
-  // and sanity checks the client_ssl_test.
-  GPR_ASSERT(!client_ssl_test("foo"));
-  return 0;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/handshake/client_ssl.cc b/test/core/handshake/client_ssl.cc
new file mode 100644
index 0000000..b8cfd62
--- /dev/null
+++ b/test/core/handshake/client_ssl.cc
@@ -0,0 +1,323 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include <arpa/inet.h>
+#include <openssl/err.h>
+#include <openssl/ssl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/thd.h>
+#include "src/core/lib/iomgr/load_file.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+#define SSL_CERT_PATH "src/core/tsi/test_creds/server1.pem"
+#define SSL_KEY_PATH "src/core/tsi/test_creds/server1.key"
+#define SSL_CA_PATH "src/core/tsi/test_creds/ca.pem"
+
+// Arguments for TLS server thread.
+typedef struct {
+  int socket;
+  char* alpn_preferred;
+} server_args;
+
+// Based on https://wiki.openssl.org/index.php/Simple_TLS_Server.
+// Pick an arbitrary unused port and return it in *out_port. Return
+// an fd>=0 on success.
+static int create_socket(int* out_port) {
+  int s;
+  struct sockaddr_in addr;
+  socklen_t addr_len;
+  *out_port = -1;
+
+  addr.sin_family = AF_INET;
+  addr.sin_port = 0;
+  addr.sin_addr.s_addr = htonl(INADDR_ANY);
+
+  s = socket(AF_INET, SOCK_STREAM, 0);
+  if (s < 0) {
+    perror("Unable to create socket");
+    return -1;
+  }
+
+  if (bind(s, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
+    perror("Unable to bind");
+    gpr_log(GPR_ERROR, "%s", "Unable to bind to any port");
+    close(s);
+    return -1;
+  }
+
+  if (listen(s, 1) < 0) {
+    perror("Unable to listen");
+    close(s);
+    return -1;
+  }
+
+  addr_len = sizeof(addr);
+  if (getsockname(s, (struct sockaddr*)&addr, &addr_len) != 0 ||
+      addr_len > sizeof(addr)) {
+    perror("getsockname");
+    gpr_log(GPR_ERROR, "%s", "Unable to get socket local address");
+    close(s);
+    return -1;
+  }
+
+  *out_port = ntohs(addr.sin_port);
+  return s;
+}
+
+// Server callback during ALPN negotiation. See man page for
+// SSL_CTX_set_alpn_select_cb.
+static int alpn_select_cb(SSL* ssl, const uint8_t** out, uint8_t* out_len,
+                          const uint8_t* in, unsigned in_len, void* arg) {
+  const uint8_t* alpn_preferred = (const uint8_t*)arg;
+
+  *out = alpn_preferred;
+  *out_len = (uint8_t)strlen((char*)alpn_preferred);
+
+  // Validate that the ALPN list includes "h2" and "grpc-exp", that "grpc-exp"
+  // precedes "h2".
+  bool grpc_exp_seen = false;
+  bool h2_seen = false;
+  const char* inp = (const char*)in;
+  const char* in_end = inp + in_len;
+  while (inp < in_end) {
+    const size_t length = (size_t)*inp++;
+    if (length == strlen("grpc-exp") && strncmp(inp, "grpc-exp", length) == 0) {
+      grpc_exp_seen = true;
+      GPR_ASSERT(!h2_seen);
+    }
+    if (length == strlen("h2") && strncmp(inp, "h2", length) == 0) {
+      h2_seen = true;
+      GPR_ASSERT(grpc_exp_seen);
+    }
+    inp += length;
+  }
+
+  GPR_ASSERT(inp == in_end);
+  GPR_ASSERT(grpc_exp_seen);
+  GPR_ASSERT(h2_seen);
+
+  return SSL_TLSEXT_ERR_OK;
+}
+
+// Minimal TLS server. This is largely based on the example at
+// https://wiki.openssl.org/index.php/Simple_TLS_Server and the gRPC core
+// internals in src/core/tsi/ssl_transport_security.c.
+static void server_thread(void* arg) {
+  const server_args* args = (server_args*)arg;
+
+  SSL_load_error_strings();
+  OpenSSL_add_ssl_algorithms();
+
+  const SSL_METHOD* method = TLSv1_2_server_method();
+  SSL_CTX* ctx = SSL_CTX_new(method);
+  if (!ctx) {
+    perror("Unable to create SSL context");
+    ERR_print_errors_fp(stderr);
+    abort();
+  }
+
+  // Load key pair.
+  if (SSL_CTX_use_certificate_file(ctx, SSL_CERT_PATH, SSL_FILETYPE_PEM) < 0) {
+    ERR_print_errors_fp(stderr);
+    abort();
+  }
+  if (SSL_CTX_use_PrivateKey_file(ctx, SSL_KEY_PATH, SSL_FILETYPE_PEM) < 0) {
+    ERR_print_errors_fp(stderr);
+    abort();
+  }
+
+  // Set the cipher list to match the one expressed in
+  // src/core/tsi/ssl_transport_security.c.
+  const char* cipher_list =
+      "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-"
+      "SHA384:ECDHE-RSA-AES256-GCM-SHA384";
+  if (!SSL_CTX_set_cipher_list(ctx, cipher_list)) {
+    ERR_print_errors_fp(stderr);
+    gpr_log(GPR_ERROR, "Couldn't set server cipher list.");
+    abort();
+  }
+
+  // Register the ALPN selection callback.
+  SSL_CTX_set_alpn_select_cb(ctx, alpn_select_cb, args->alpn_preferred);
+
+  // bind/listen/accept at TCP layer.
+  const int sock = args->socket;
+  gpr_log(GPR_INFO, "Server listening");
+  struct sockaddr_in addr;
+  socklen_t len = sizeof(addr);
+  const int client = accept(sock, (struct sockaddr*)&addr, &len);
+  if (client < 0) {
+    perror("Unable to accept");
+    abort();
+  }
+
+  // Establish a SSL* and accept at SSL layer.
+  SSL* ssl = SSL_new(ctx);
+  GPR_ASSERT(ssl);
+  SSL_set_fd(ssl, client);
+  if (SSL_accept(ssl) <= 0) {
+    ERR_print_errors_fp(stderr);
+    gpr_log(GPR_ERROR, "Handshake failed.");
+  } else {
+    gpr_log(GPR_INFO, "Handshake successful.");
+  }
+
+  // Wait until the client drops its connection.
+  char buf;
+  while (SSL_read(ssl, &buf, sizeof(buf)) > 0)
+    ;
+
+  SSL_free(ssl);
+  close(client);
+  close(sock);
+  SSL_CTX_free(ctx);
+  EVP_cleanup();
+}
+
+// This test launches a minimal TLS server on a separate thread and then
+// establishes a TLS handshake via the core library to the server. The TLS
+// server validates ALPN aspects of the handshake and supplies the protocol
+// specified in the server_alpn_preferred argument to the client.
+static bool client_ssl_test(char* server_alpn_preferred) {
+  bool success = true;
+
+  grpc_init();
+
+  // Find a port we can bind to. Retries added to handle flakes in port server
+  // and port picking.
+  int port = -1;
+  int server_socket = -1;
+  int socket_retries = 30;
+  while (server_socket == -1 && socket_retries-- > 0) {
+    server_socket = create_socket(&port);
+    if (server_socket == -1) {
+      sleep(1);
+    }
+  }
+  GPR_ASSERT(server_socket > 0 && port > 0);
+
+  // Launch the TLS server thread.
+  gpr_thd_options thdopt = gpr_thd_options_default();
+  gpr_thd_id thdid;
+  gpr_thd_options_set_joinable(&thdopt);
+  server_args args = {server_socket, server_alpn_preferred};
+  GPR_ASSERT(gpr_thd_new(&thdid, server_thread, &args, &thdopt));
+
+  // Load key pair and establish client SSL credentials.
+  grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
+  grpc_slice ca_slice, cert_slice, key_slice;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+                               grpc_load_file(SSL_CA_PATH, 1, &ca_slice)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+                               grpc_load_file(SSL_CERT_PATH, 1, &cert_slice)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+                               grpc_load_file(SSL_KEY_PATH, 1, &key_slice)));
+  const char* ca_cert = (const char*)GRPC_SLICE_START_PTR(ca_slice);
+  pem_key_cert_pair.private_key = (const char*)GRPC_SLICE_START_PTR(key_slice);
+  pem_key_cert_pair.cert_chain = (const char*)GRPC_SLICE_START_PTR(cert_slice);
+  grpc_channel_credentials* ssl_creds =
+      grpc_ssl_credentials_create(ca_cert, &pem_key_cert_pair, NULL);
+
+  // Establish a channel pointing at the TLS server. Since the gRPC runtime is
+  // lazy, this won't necessarily establish a connection yet.
+  char* target;
+  gpr_asprintf(&target, "127.0.0.1:%d", port);
+  grpc_arg ssl_name_override = {
+      GRPC_ARG_STRING,
+      const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
+      {const_cast<char*>("foo.test.google.fr")}};
+  grpc_channel_args grpc_args;
+  grpc_args.num_args = 1;
+  grpc_args.args = &ssl_name_override;
+  grpc_channel* channel =
+      grpc_secure_channel_create(ssl_creds, target, &grpc_args, NULL);
+  GPR_ASSERT(channel);
+  gpr_free(target);
+
+  // Initially the channel will be idle, the
+  // grpc_channel_check_connectivity_state triggers an attempt to connect.
+  GPR_ASSERT(grpc_channel_check_connectivity_state(
+                 channel, 1 /* try_to_connect */) == GRPC_CHANNEL_IDLE);
+
+  // Wait a bounded number of times for the channel to be ready. When the
+  // channel is ready, the initial TLS handshake will have successfully
+  // completed and we know that the client's ALPN list satisfied the server.
+  int retries = 10;
+  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+
+  while (state != GRPC_CHANNEL_READY && retries-- > 0) {
+    grpc_channel_watch_connectivity_state(
+        channel, state, grpc_timeout_seconds_to_deadline(3), cq, NULL);
+    gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(5);
+    grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+    state =
+        grpc_channel_check_connectivity_state(channel, 0 /* try_to_connect */);
+  }
+  grpc_completion_queue_destroy(cq);
+  if (retries < 0) {
+    success = false;
+  }
+
+  grpc_channel_destroy(channel);
+  grpc_channel_credentials_release(ssl_creds);
+  grpc_slice_unref(cert_slice);
+  grpc_slice_unref(key_slice);
+  grpc_slice_unref(ca_slice);
+
+  gpr_thd_join(thdid);
+
+  grpc_shutdown();
+
+  return success;
+}
+
+int main(int argc, char* argv[]) {
+  // Handshake succeeeds when the server has grpc-exp as the ALPN preference.
+  GPR_ASSERT(client_ssl_test(const_cast<char*>("grpc-exp")));
+  // Handshake succeeeds when the server has h2 as the ALPN preference. This
+  // covers legacy gRPC servers which don't support grpc-exp.
+  GPR_ASSERT(client_ssl_test(const_cast<char*>("h2")));
+  // Handshake fails when the server uses a fake protocol as its ALPN
+  // preference. This validates the client is correctly validating ALPN returns
+  // and sanity checks the client_ssl_test.
+  GPR_ASSERT(!client_ssl_test(const_cast<char*>("foo")));
+  return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/handshake/server_ssl.c b/test/core/handshake/server_ssl.c
deleted file mode 100644
index 85a8b4d..0000000
--- a/test/core/handshake/server_ssl.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <arpa/inet.h>
-#include <openssl/err.h>
-#include <openssl/ssl.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include "src/core/lib/iomgr/load_file.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-#define SSL_CERT_PATH "src/core/tsi/test_creds/server1.pem"
-#define SSL_KEY_PATH "src/core/tsi/test_creds/server1.key"
-#define SSL_CA_PATH "src/core/tsi/test_creds/ca.pem"
-
-// Handshake completed signal to server thread.
-static gpr_event client_handshake_complete;
-
-static int create_socket(int port) {
-  int s;
-  struct sockaddr_in addr;
-
-  addr.sin_family = AF_INET;
-  addr.sin_port = htons((uint16_t)port);
-  addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
-  s = socket(AF_INET, SOCK_STREAM, 0);
-  if (s < 0) {
-    perror("Unable to create socket");
-    return -1;
-  }
-
-  if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-    perror("Unable to connect");
-    return -1;
-  }
-
-  return s;
-}
-
-// Simple gRPC server. This listens until client_handshake_complete occurs.
-static void server_thread(void *arg) {
-  const int port = *(int *)arg;
-
-  // Load key pair and establish server SSL credentials.
-  grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
-  grpc_slice ca_slice, cert_slice, key_slice;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
-                               grpc_load_file(SSL_CA_PATH, 1, &ca_slice)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
-                               grpc_load_file(SSL_CERT_PATH, 1, &cert_slice)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
-                               grpc_load_file(SSL_KEY_PATH, 1, &key_slice)));
-  const char *ca_cert = (const char *)GRPC_SLICE_START_PTR(ca_slice);
-  pem_key_cert_pair.private_key = (const char *)GRPC_SLICE_START_PTR(key_slice);
-  pem_key_cert_pair.cert_chain = (const char *)GRPC_SLICE_START_PTR(cert_slice);
-  grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(
-      ca_cert, &pem_key_cert_pair, 1, 0, NULL);
-
-  // Start server listening on local port.
-  char *addr;
-  gpr_asprintf(&addr, "127.0.0.1:%d", port);
-  grpc_server *server = grpc_server_create(NULL, NULL);
-  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
-  free(addr);
-
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-
-  grpc_server_register_completion_queue(server, cq, NULL);
-  grpc_server_start(server);
-
-  // Wait a bounded number of time until client_handshake_complete is set,
-  // sleeping between polls.
-  int retries = 10;
-  while (!gpr_event_get(&client_handshake_complete) && retries-- > 0) {
-    const gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(1);
-    grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, NULL);
-    GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT);
-  }
-
-  gpr_log(GPR_INFO, "Shutting down server");
-  grpc_server_shutdown_and_notify(server, cq, NULL);
-  grpc_completion_queue_shutdown(cq);
-
-  const gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(5);
-  grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, NULL);
-  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-
-  grpc_server_destroy(server);
-  grpc_completion_queue_destroy(cq);
-  grpc_server_credentials_release(ssl_creds);
-  grpc_slice_unref(cert_slice);
-  grpc_slice_unref(key_slice);
-  grpc_slice_unref(ca_slice);
-}
-
-// This test launches a gRPC server on a separate thread and then establishes a
-// TLS handshake via a minimal TLS client. The TLS client has configurable (via
-// alpn_list) ALPN settings and can probe at the supported ALPN preferences
-// using this (via alpn_expected).
-static bool server_ssl_test(const char *alpn_list[], unsigned int alpn_list_len,
-                            const char *alpn_expected) {
-  bool success = true;
-
-  grpc_init();
-  int port = grpc_pick_unused_port_or_die();
-  gpr_event_init(&client_handshake_complete);
-
-  // Launch the gRPC server thread.
-  gpr_thd_options thdopt = gpr_thd_options_default();
-  gpr_thd_id thdid;
-  gpr_thd_options_set_joinable(&thdopt);
-  GPR_ASSERT(gpr_thd_new(&thdid, server_thread, &port, &thdopt));
-
-  SSL_load_error_strings();
-  OpenSSL_add_ssl_algorithms();
-
-  const SSL_METHOD *method = TLSv1_2_client_method();
-  SSL_CTX *ctx = SSL_CTX_new(method);
-  if (!ctx) {
-    perror("Unable to create SSL context");
-    ERR_print_errors_fp(stderr);
-    abort();
-  }
-
-  // Load key pair.
-  if (SSL_CTX_use_certificate_file(ctx, SSL_CERT_PATH, SSL_FILETYPE_PEM) < 0) {
-    ERR_print_errors_fp(stderr);
-    abort();
-  }
-  if (SSL_CTX_use_PrivateKey_file(ctx, SSL_KEY_PATH, SSL_FILETYPE_PEM) < 0) {
-    ERR_print_errors_fp(stderr);
-    abort();
-  }
-
-  // Set the cipher list to match the one expressed in
-  // src/core/tsi/ssl_transport_security.c.
-  const char *cipher_list =
-      "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-"
-      "SHA384:ECDHE-RSA-AES256-GCM-SHA384";
-  if (!SSL_CTX_set_cipher_list(ctx, cipher_list)) {
-    ERR_print_errors_fp(stderr);
-    gpr_log(GPR_ERROR, "Couldn't set server cipher list.");
-    abort();
-  }
-
-  // Configure ALPN list the client will send to the server. This must match the
-  // wire format, see documentation for SSL_CTX_set_alpn_protos.
-  unsigned int alpn_protos_len = alpn_list_len;
-  for (unsigned int i = 0; i < alpn_list_len; ++i) {
-    alpn_protos_len += (unsigned int)strlen(alpn_list[i]);
-  }
-  unsigned char *alpn_protos = gpr_malloc(alpn_protos_len);
-  unsigned char *p = alpn_protos;
-  for (unsigned int i = 0; i < alpn_list_len; ++i) {
-    const uint8_t len = (uint8_t)strlen(alpn_list[i]);
-    *p++ = len;
-    memcpy(p, alpn_list[i], len);
-    p += len;
-  }
-  GPR_ASSERT(SSL_CTX_set_alpn_protos(ctx, alpn_protos, alpn_protos_len) == 0);
-
-  // Try and connect to server. We allow a bounded number of retries as we might
-  // be racing with the server setup on its separate thread.
-  int retries = 10;
-  int sock = -1;
-  while (sock == -1 && retries-- > 0) {
-    sock = create_socket(port);
-    if (sock < 0) {
-      sleep(1);
-    }
-  }
-  GPR_ASSERT(sock > 0);
-  gpr_log(GPR_INFO, "Connected to server on port %d", port);
-
-  // Establish a SSL* and connect at SSL layer.
-  SSL *ssl = SSL_new(ctx);
-  GPR_ASSERT(ssl);
-  SSL_set_fd(ssl, sock);
-  if (SSL_connect(ssl) <= 0) {
-    ERR_print_errors_fp(stderr);
-    gpr_log(GPR_ERROR, "Handshake failed.");
-    success = false;
-  } else {
-    gpr_log(GPR_INFO, "Handshake successful.");
-    // Validate ALPN preferred by server matches alpn_expected.
-    const unsigned char *alpn_selected;
-    unsigned int alpn_selected_len;
-    SSL_get0_alpn_selected(ssl, &alpn_selected, &alpn_selected_len);
-    if (strlen(alpn_expected) != alpn_selected_len ||
-        strncmp((const char *)alpn_selected, alpn_expected,
-                alpn_selected_len) != 0) {
-      gpr_log(GPR_ERROR, "Unexpected ALPN protocol preference");
-      success = false;
-    }
-  }
-  gpr_event_set(&client_handshake_complete, &client_handshake_complete);
-
-  SSL_free(ssl);
-  gpr_free(alpn_protos);
-  SSL_CTX_free(ctx);
-  EVP_cleanup();
-  close(sock);
-
-  gpr_thd_join(thdid);
-
-  grpc_shutdown();
-
-  return success;
-}
-
-int main(int argc, char *argv[]) {
-  // Handshake succeeeds when the client supplies the standard ALPN list.
-  const char *full_alpn_list[] = {"grpc-exp", "h2"};
-  GPR_ASSERT(server_ssl_test(full_alpn_list, 2, "grpc-exp"));
-  // Handshake succeeeds when the client supplies only h2 as the ALPN list. This
-  // covers legacy gRPC clients which don't support grpc-exp.
-  const char *h2_only_alpn_list[] = {"h2"};
-  GPR_ASSERT(server_ssl_test(h2_only_alpn_list, 1, "h2"));
-  // Handshake succeeds when the client supplies superfluous ALPN entries and
-  // also when h2 precedes gprc-exp.
-  const char *extra_alpn_list[] = {"foo", "h2", "bar", "grpc-exp"};
-  GPR_ASSERT(server_ssl_test(extra_alpn_list, 4, "h2"));
-  // Handshake fails when the client uses a fake protocol as its only ALPN
-  // preference. This validates the server is correctly validating ALPN
-  // and sanity checks the server_ssl_test.
-  const char *fake_alpn_list[] = {"foo"};
-  GPR_ASSERT(!server_ssl_test(fake_alpn_list, 1, "foo"));
-  return 0;
-}
diff --git a/test/core/handshake/server_ssl.cc b/test/core/handshake/server_ssl.cc
new file mode 100644
index 0000000..bb92c84
--- /dev/null
+++ b/test/core/handshake/server_ssl.cc
@@ -0,0 +1,256 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <arpa/inet.h>
+#include <openssl/err.h>
+#include <openssl/ssl.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include "src/core/lib/iomgr/load_file.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+#define SSL_CERT_PATH "src/core/tsi/test_creds/server1.pem"
+#define SSL_KEY_PATH "src/core/tsi/test_creds/server1.key"
+#define SSL_CA_PATH "src/core/tsi/test_creds/ca.pem"
+
+// Handshake completed signal to server thread.
+static gpr_event client_handshake_complete;
+
+static int create_socket(int port) {
+  int s;
+  struct sockaddr_in addr;
+
+  addr.sin_family = AF_INET;
+  addr.sin_port = htons((uint16_t)port);
+  addr.sin_addr.s_addr = htonl(INADDR_ANY);
+
+  s = socket(AF_INET, SOCK_STREAM, 0);
+  if (s < 0) {
+    perror("Unable to create socket");
+    return -1;
+  }
+
+  if (connect(s, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
+    perror("Unable to connect");
+    return -1;
+  }
+
+  return s;
+}
+
+// Simple gRPC server. This listens until client_handshake_complete occurs.
+static void server_thread(void* arg) {
+  const int port = *(int*)arg;
+
+  // Load key pair and establish server SSL credentials.
+  grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
+  grpc_slice ca_slice, cert_slice, key_slice;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+                               grpc_load_file(SSL_CA_PATH, 1, &ca_slice)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+                               grpc_load_file(SSL_CERT_PATH, 1, &cert_slice)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file",
+                               grpc_load_file(SSL_KEY_PATH, 1, &key_slice)));
+  const char* ca_cert = (const char*)GRPC_SLICE_START_PTR(ca_slice);
+  pem_key_cert_pair.private_key = (const char*)GRPC_SLICE_START_PTR(key_slice);
+  pem_key_cert_pair.cert_chain = (const char*)GRPC_SLICE_START_PTR(cert_slice);
+  grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(
+      ca_cert, &pem_key_cert_pair, 1, 0, NULL);
+
+  // Start server listening on local port.
+  char* addr;
+  gpr_asprintf(&addr, "127.0.0.1:%d", port);
+  grpc_server* server = grpc_server_create(NULL, NULL);
+  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
+  free(addr);
+
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+
+  grpc_server_register_completion_queue(server, cq, NULL);
+  grpc_server_start(server);
+
+  // Wait a bounded number of time until client_handshake_complete is set,
+  // sleeping between polls.
+  int retries = 10;
+  while (!gpr_event_get(&client_handshake_complete) && retries-- > 0) {
+    const gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(1);
+    grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, NULL);
+    GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT);
+  }
+
+  gpr_log(GPR_INFO, "Shutting down server");
+  grpc_server_shutdown_and_notify(server, cq, NULL);
+  grpc_completion_queue_shutdown(cq);
+
+  const gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(5);
+  grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, NULL);
+  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+
+  grpc_server_destroy(server);
+  grpc_completion_queue_destroy(cq);
+  grpc_server_credentials_release(ssl_creds);
+  grpc_slice_unref(cert_slice);
+  grpc_slice_unref(key_slice);
+  grpc_slice_unref(ca_slice);
+}
+
+// This test launches a gRPC server on a separate thread and then establishes a
+// TLS handshake via a minimal TLS client. The TLS client has configurable (via
+// alpn_list) ALPN settings and can probe at the supported ALPN preferences
+// using this (via alpn_expected).
+static bool server_ssl_test(const char* alpn_list[], unsigned int alpn_list_len,
+                            const char* alpn_expected) {
+  bool success = true;
+
+  grpc_init();
+  int port = grpc_pick_unused_port_or_die();
+  gpr_event_init(&client_handshake_complete);
+
+  // Launch the gRPC server thread.
+  gpr_thd_options thdopt = gpr_thd_options_default();
+  gpr_thd_id thdid;
+  gpr_thd_options_set_joinable(&thdopt);
+  GPR_ASSERT(gpr_thd_new(&thdid, server_thread, &port, &thdopt));
+
+  SSL_load_error_strings();
+  OpenSSL_add_ssl_algorithms();
+
+  const SSL_METHOD* method = TLSv1_2_client_method();
+  SSL_CTX* ctx = SSL_CTX_new(method);
+  if (!ctx) {
+    perror("Unable to create SSL context");
+    ERR_print_errors_fp(stderr);
+    abort();
+  }
+
+  // Load key pair.
+  if (SSL_CTX_use_certificate_file(ctx, SSL_CERT_PATH, SSL_FILETYPE_PEM) < 0) {
+    ERR_print_errors_fp(stderr);
+    abort();
+  }
+  if (SSL_CTX_use_PrivateKey_file(ctx, SSL_KEY_PATH, SSL_FILETYPE_PEM) < 0) {
+    ERR_print_errors_fp(stderr);
+    abort();
+  }
+
+  // Set the cipher list to match the one expressed in
+  // src/core/tsi/ssl_transport_security.c.
+  const char* cipher_list =
+      "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-"
+      "SHA384:ECDHE-RSA-AES256-GCM-SHA384";
+  if (!SSL_CTX_set_cipher_list(ctx, cipher_list)) {
+    ERR_print_errors_fp(stderr);
+    gpr_log(GPR_ERROR, "Couldn't set server cipher list.");
+    abort();
+  }
+
+  // Configure ALPN list the client will send to the server. This must match the
+  // wire format, see documentation for SSL_CTX_set_alpn_protos.
+  unsigned int alpn_protos_len = alpn_list_len;
+  for (unsigned int i = 0; i < alpn_list_len; ++i) {
+    alpn_protos_len += (unsigned int)strlen(alpn_list[i]);
+  }
+  unsigned char* alpn_protos =
+      static_cast<unsigned char*>(gpr_malloc(alpn_protos_len));
+  unsigned char* p = alpn_protos;
+  for (unsigned int i = 0; i < alpn_list_len; ++i) {
+    const uint8_t len = (uint8_t)strlen(alpn_list[i]);
+    *p++ = len;
+    memcpy(p, alpn_list[i], len);
+    p += len;
+  }
+  GPR_ASSERT(SSL_CTX_set_alpn_protos(ctx, alpn_protos, alpn_protos_len) == 0);
+
+  // Try and connect to server. We allow a bounded number of retries as we might
+  // be racing with the server setup on its separate thread.
+  int retries = 10;
+  int sock = -1;
+  while (sock == -1 && retries-- > 0) {
+    sock = create_socket(port);
+    if (sock < 0) {
+      sleep(1);
+    }
+  }
+  GPR_ASSERT(sock > 0);
+  gpr_log(GPR_INFO, "Connected to server on port %d", port);
+
+  // Establish a SSL* and connect at SSL layer.
+  SSL* ssl = SSL_new(ctx);
+  GPR_ASSERT(ssl);
+  SSL_set_fd(ssl, sock);
+  if (SSL_connect(ssl) <= 0) {
+    ERR_print_errors_fp(stderr);
+    gpr_log(GPR_ERROR, "Handshake failed.");
+    success = false;
+  } else {
+    gpr_log(GPR_INFO, "Handshake successful.");
+    // Validate ALPN preferred by server matches alpn_expected.
+    const unsigned char* alpn_selected;
+    unsigned int alpn_selected_len;
+    SSL_get0_alpn_selected(ssl, &alpn_selected, &alpn_selected_len);
+    if (strlen(alpn_expected) != alpn_selected_len ||
+        strncmp((const char*)alpn_selected, alpn_expected, alpn_selected_len) !=
+            0) {
+      gpr_log(GPR_ERROR, "Unexpected ALPN protocol preference");
+      success = false;
+    }
+  }
+  gpr_event_set(&client_handshake_complete, &client_handshake_complete);
+
+  SSL_free(ssl);
+  gpr_free(alpn_protos);
+  SSL_CTX_free(ctx);
+  EVP_cleanup();
+  close(sock);
+
+  gpr_thd_join(thdid);
+
+  grpc_shutdown();
+
+  return success;
+}
+
+int main(int argc, char* argv[]) {
+  // Handshake succeeeds when the client supplies the standard ALPN list.
+  const char* full_alpn_list[] = {"grpc-exp", "h2"};
+  GPR_ASSERT(server_ssl_test(full_alpn_list, 2, "grpc-exp"));
+  // Handshake succeeeds when the client supplies only h2 as the ALPN list. This
+  // covers legacy gRPC clients which don't support grpc-exp.
+  const char* h2_only_alpn_list[] = {"h2"};
+  GPR_ASSERT(server_ssl_test(h2_only_alpn_list, 1, "h2"));
+  // Handshake succeeds when the client supplies superfluous ALPN entries and
+  // also when h2 precedes gprc-exp.
+  const char* extra_alpn_list[] = {"foo", "h2", "bar", "grpc-exp"};
+  GPR_ASSERT(server_ssl_test(extra_alpn_list, 4, "h2"));
+  // Handshake fails when the client uses a fake protocol as its only ALPN
+  // preference. This validates the server is correctly validating ALPN
+  // and sanity checks the server_ssl_test.
+  const char* fake_alpn_list[] = {"foo"};
+  GPR_ASSERT(!server_ssl_test(fake_alpn_list, 1, "foo"));
+  return 0;
+}
diff --git a/test/core/http/BUILD b/test/core/http/BUILD
index fffdac5..a5ae627 100644
--- a/test/core/http/BUILD
+++ b/test/core/http/BUILD
@@ -22,8 +22,8 @@
 
 grpc_fuzzer(
     name = "response_fuzzer",
-    srcs = ["response_fuzzer.c"],
-    language = "C",
+    srcs = ["response_fuzzer.cc"],
+    language = "C++",
     corpus = "response_corpus",
     deps = [
         "//:gpr",
@@ -34,8 +34,8 @@
 
 grpc_fuzzer(
     name = "request_fuzzer",
-    srcs = ["request_fuzzer.c"],
-    language = "C",
+    srcs = ["request_fuzzer.cc"],
+    language = "C++",
     corpus = "request_corpus",
     deps = [
         "//:gpr",
@@ -64,8 +64,8 @@
 
 grpc_cc_test(
     name = "httpcli_test",
-    srcs = ["httpcli_test.c"],
-    language = "C",
+    srcs = ["httpcli_test.cc"],
+    language = "C++",
     data = ["test_server.py"],
     deps = [
         "//:gpr",
@@ -78,8 +78,8 @@
 
 grpc_cc_test(
     name = "httpscli_test",
-    srcs = ["httpscli_test.c"],
-    language = "C",
+    srcs = ["httpscli_test.cc"],
+    language = "C++",
     data = ["test_server.py"],
     deps = [
         "//:gpr",
@@ -92,8 +92,8 @@
 
 grpc_cc_test(
     name = "parser_test",
-    srcs = ["parser_test.c"],
-    language = "C",
+    srcs = ["parser_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/http/format_request_test.c b/test/core/http/format_request_test.c
deleted file mode 100644
index 0279a1b..0000000
--- a/test/core/http/format_request_test.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/http/format_request.h"
-
-#include <string.h>
-
-#include <grpc/support/log.h>
-#include "test/core/util/test_config.h"
-
-static void test_format_get_request(void) {
-  grpc_http_header hdr = {"x-yz", "abc"};
-  grpc_httpcli_request req;
-  grpc_slice slice;
-
-  memset(&req, 0, sizeof(req));
-  req.host = "example.com";
-  req.http.path = "/index.html";
-  req.http.hdr_count = 1;
-  req.http.hdrs = &hdr;
-
-  slice = grpc_httpcli_format_get_request(&req);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(slice,
-                                     "GET /index.html HTTP/1.0\r\n"
-                                     "Host: example.com\r\n"
-                                     "Connection: close\r\n"
-                                     "User-Agent: " GRPC_HTTPCLI_USER_AGENT
-                                     "\r\n"
-                                     "x-yz: abc\r\n"
-                                     "\r\n"));
-
-  grpc_slice_unref(slice);
-}
-
-static void test_format_post_request(void) {
-  grpc_http_header hdr = {"x-yz", "abc"};
-  grpc_httpcli_request req;
-  grpc_slice slice;
-  char body_bytes[] = "fake body";
-  size_t body_len = 9;
-
-  memset(&req, 0, sizeof(req));
-  req.host = "example.com";
-  req.http.path = "/index.html";
-  req.http.hdr_count = 1;
-  req.http.hdrs = &hdr;
-
-  slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(slice,
-                                     "POST /index.html HTTP/1.0\r\n"
-                                     "Host: example.com\r\n"
-                                     "Connection: close\r\n"
-                                     "User-Agent: " GRPC_HTTPCLI_USER_AGENT
-                                     "\r\n"
-                                     "x-yz: abc\r\n"
-                                     "Content-Type: text/plain\r\n"
-                                     "Content-Length: 9\r\n"
-                                     "\r\n"
-                                     "fake body"));
-
-  grpc_slice_unref(slice);
-}
-
-static void test_format_post_request_no_body(void) {
-  grpc_http_header hdr = {"x-yz", "abc"};
-  grpc_httpcli_request req;
-  grpc_slice slice;
-
-  memset(&req, 0, sizeof(req));
-  req.host = "example.com";
-  req.http.path = "/index.html";
-  req.http.hdr_count = 1;
-  req.http.hdrs = &hdr;
-
-  slice = grpc_httpcli_format_post_request(&req, NULL, 0);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(slice,
-                                     "POST /index.html HTTP/1.0\r\n"
-                                     "Host: example.com\r\n"
-                                     "Connection: close\r\n"
-                                     "User-Agent: " GRPC_HTTPCLI_USER_AGENT
-                                     "\r\n"
-                                     "x-yz: abc\r\n"
-                                     "\r\n"));
-
-  grpc_slice_unref(slice);
-}
-
-static void test_format_post_request_content_type_override(void) {
-  grpc_http_header hdrs[2];
-  grpc_httpcli_request req;
-  grpc_slice slice;
-  char body_bytes[] = "fake%20body";
-  size_t body_len = 11;
-
-  hdrs[0].key = "x-yz";
-  hdrs[0].value = "abc";
-  hdrs[1].key = "Content-Type";
-  hdrs[1].value = "application/x-www-form-urlencoded";
-  memset(&req, 0, sizeof(req));
-  req.host = "example.com";
-  req.http.path = "/index.html";
-  req.http.hdr_count = 2;
-  req.http.hdrs = hdrs;
-
-  slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);
-
-  GPR_ASSERT(0 == grpc_slice_str_cmp(
-                      slice,
-                      "POST /index.html HTTP/1.0\r\n"
-                      "Host: example.com\r\n"
-                      "Connection: close\r\n"
-                      "User-Agent: " GRPC_HTTPCLI_USER_AGENT "\r\n"
-                      "x-yz: abc\r\n"
-                      "Content-Type: application/x-www-form-urlencoded\r\n"
-                      "Content-Length: 11\r\n"
-                      "\r\n"
-                      "fake%20body"));
-
-  grpc_slice_unref(slice);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  test_format_get_request();
-  test_format_post_request();
-  test_format_post_request_no_body();
-  test_format_post_request_content_type_override();
-
-  return 0;
-}
diff --git a/test/core/http/format_request_test.cc b/test/core/http/format_request_test.cc
new file mode 100644
index 0000000..253e591
--- /dev/null
+++ b/test/core/http/format_request_test.cc
@@ -0,0 +1,149 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/http/format_request.h"
+
+#include <string.h>
+
+#include <grpc/support/log.h>
+#include "test/core/util/test_config.h"
+
+static void test_format_get_request(void) {
+  grpc_http_header hdr = {const_cast<char*>("x-yz"), const_cast<char*>("abc")};
+  grpc_httpcli_request req;
+  grpc_slice slice;
+
+  memset(&req, 0, sizeof(req));
+  req.host = const_cast<char*>("example.com");
+  req.http.path = const_cast<char*>("/index.html");
+  req.http.hdr_count = 1;
+  req.http.hdrs = &hdr;
+
+  slice = grpc_httpcli_format_get_request(&req);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(slice,
+                                     "GET /index.html HTTP/1.0\r\n"
+                                     "Host: example.com\r\n"
+                                     "Connection: close\r\n"
+                                     "User-Agent: " GRPC_HTTPCLI_USER_AGENT
+                                     "\r\n"
+                                     "x-yz: abc\r\n"
+                                     "\r\n"));
+
+  grpc_slice_unref(slice);
+}
+
+static void test_format_post_request(void) {
+  grpc_http_header hdr = {const_cast<char*>("x-yz"), const_cast<char*>("abc")};
+  grpc_httpcli_request req;
+  grpc_slice slice;
+  char body_bytes[] = "fake body";
+  size_t body_len = 9;
+
+  memset(&req, 0, sizeof(req));
+  req.host = const_cast<char*>("example.com");
+  req.http.path = const_cast<char*>("/index.html");
+  req.http.hdr_count = 1;
+  req.http.hdrs = &hdr;
+
+  slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(slice,
+                                     "POST /index.html HTTP/1.0\r\n"
+                                     "Host: example.com\r\n"
+                                     "Connection: close\r\n"
+                                     "User-Agent: " GRPC_HTTPCLI_USER_AGENT
+                                     "\r\n"
+                                     "x-yz: abc\r\n"
+                                     "Content-Type: text/plain\r\n"
+                                     "Content-Length: 9\r\n"
+                                     "\r\n"
+                                     "fake body"));
+
+  grpc_slice_unref(slice);
+}
+
+static void test_format_post_request_no_body(void) {
+  grpc_http_header hdr = {const_cast<char*>("x-yz"), const_cast<char*>("abc")};
+  grpc_httpcli_request req;
+  grpc_slice slice;
+
+  memset(&req, 0, sizeof(req));
+  req.host = const_cast<char*>("example.com");
+  req.http.path = const_cast<char*>("/index.html");
+  req.http.hdr_count = 1;
+  req.http.hdrs = &hdr;
+
+  slice = grpc_httpcli_format_post_request(&req, NULL, 0);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(slice,
+                                     "POST /index.html HTTP/1.0\r\n"
+                                     "Host: example.com\r\n"
+                                     "Connection: close\r\n"
+                                     "User-Agent: " GRPC_HTTPCLI_USER_AGENT
+                                     "\r\n"
+                                     "x-yz: abc\r\n"
+                                     "\r\n"));
+
+  grpc_slice_unref(slice);
+}
+
+static void test_format_post_request_content_type_override(void) {
+  grpc_http_header hdrs[2];
+  grpc_httpcli_request req;
+  grpc_slice slice;
+  char body_bytes[] = "fake%20body";
+  size_t body_len = 11;
+
+  hdrs[0].key = const_cast<char*>("x-yz");
+  hdrs[0].value = const_cast<char*>("abc");
+  hdrs[1].key = const_cast<char*>("Content-Type");
+  hdrs[1].value = const_cast<char*>("application/x-www-form-urlencoded");
+  memset(&req, 0, sizeof(req));
+  req.host = const_cast<char*>("example.com");
+  req.http.path = const_cast<char*>("/index.html");
+  req.http.hdr_count = 2;
+  req.http.hdrs = hdrs;
+
+  slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);
+
+  GPR_ASSERT(0 == grpc_slice_str_cmp(
+                      slice,
+                      "POST /index.html HTTP/1.0\r\n"
+                      "Host: example.com\r\n"
+                      "Connection: close\r\n"
+                      "User-Agent: " GRPC_HTTPCLI_USER_AGENT "\r\n"
+                      "x-yz: abc\r\n"
+                      "Content-Type: application/x-www-form-urlencoded\r\n"
+                      "Content-Length: 11\r\n"
+                      "\r\n"
+                      "fake%20body"));
+
+  grpc_slice_unref(slice);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  test_format_get_request();
+  test_format_post_request();
+  test_format_post_request_no_body();
+  test_format_post_request_content_type_override();
+
+  return 0;
+}
diff --git a/test/core/http/httpcli_test.c b/test/core/http/httpcli_test.c
deleted file mode 100644
index cc1c16d..0000000
--- a/test/core/http/httpcli_test.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/http/httpcli.h"
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/subprocess.h>
-#include <grpc/support/sync.h>
-#include "src/core/lib/iomgr/iomgr.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static int g_done = 0;
-static grpc_httpcli_context g_context;
-static gpr_mu *g_mu;
-static grpc_polling_entity g_pops;
-
-static grpc_millis n_seconds_time(int seconds) {
-  return grpc_timespec_to_millis_round_up(
-      grpc_timeout_seconds_to_deadline(seconds));
-}
-
-static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  const char *expect =
-      "<html><head><title>Hello world!</title></head>"
-      "<body><p>This is a test</p></body></html>";
-  grpc_http_response *response = arg;
-  GPR_ASSERT(response);
-  GPR_ASSERT(response->status == 200);
-  GPR_ASSERT(response->body_length == strlen(expect));
-  GPR_ASSERT(0 == memcmp(expect, response->body, response->body_length));
-  gpr_mu_lock(g_mu);
-  g_done = 1;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "pollset_kick",
-      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&g_pops), NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-static void test_get(int port) {
-  grpc_httpcli_request req;
-  char *host;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  g_done = 0;
-  gpr_log(GPR_INFO, "test_get");
-
-  gpr_asprintf(&host, "localhost:%d", port);
-  gpr_log(GPR_INFO, "requesting from %s", host);
-
-  memset(&req, 0, sizeof(req));
-  req.host = host;
-  req.http.path = "/get";
-  req.handshaker = &grpc_httpcli_plaintext;
-
-  grpc_http_response response;
-  memset(&response, 0, sizeof(response));
-  grpc_resource_quota *resource_quota = grpc_resource_quota_create("test_get");
-  grpc_httpcli_get(
-      &exec_ctx, &g_context, &g_pops, resource_quota, &req, n_seconds_time(15),
-      GRPC_CLOSURE_CREATE(on_finish, &response, grpc_schedule_on_exec_ctx),
-      &response);
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-  gpr_mu_lock(g_mu);
-  while (!g_done) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
-                          &worker, n_seconds_time(1))));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  gpr_mu_unlock(g_mu);
-  gpr_free(host);
-  grpc_http_response_destroy(&response);
-}
-
-static void test_post(int port) {
-  grpc_httpcli_request req;
-  char *host;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  g_done = 0;
-  gpr_log(GPR_INFO, "test_post");
-
-  gpr_asprintf(&host, "localhost:%d", port);
-  gpr_log(GPR_INFO, "posting to %s", host);
-
-  memset(&req, 0, sizeof(req));
-  req.host = host;
-  req.http.path = "/post";
-  req.handshaker = &grpc_httpcli_plaintext;
-
-  grpc_http_response response;
-  memset(&response, 0, sizeof(response));
-  grpc_resource_quota *resource_quota = grpc_resource_quota_create("test_post");
-  grpc_httpcli_post(
-      &exec_ctx, &g_context, &g_pops, resource_quota, &req, "hello", 5,
-      n_seconds_time(15),
-      GRPC_CLOSURE_CREATE(on_finish, &response, grpc_schedule_on_exec_ctx),
-      &response);
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-  gpr_mu_lock(g_mu);
-  while (!g_done) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
-                          &worker, n_seconds_time(1))));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  gpr_mu_unlock(g_mu);
-  gpr_free(host);
-  grpc_http_response_destroy(&response);
-}
-
-static void destroy_pops(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, grpc_polling_entity_pollset(p));
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  gpr_subprocess *server;
-  char *me = argv[0];
-  char *lslash = strrchr(me, '/');
-  char *args[4];
-  int port = grpc_pick_unused_port_or_die();
-  int arg_shift = 0;
-  /* figure out where we are */
-  char *root;
-  if (lslash) {
-    root = gpr_malloc((size_t)(lslash - me + 1));
-    memcpy(root, me, (size_t)(lslash - me));
-    root[lslash - me] = 0;
-  } else {
-    root = gpr_strdup(".");
-  }
-
-  GPR_ASSERT(argc <= 2);
-  if (argc == 2) {
-    args[0] = gpr_strdup(argv[1]);
-  } else {
-    arg_shift = 1;
-    gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root);
-    gpr_asprintf(&args[1], "%s/../../test/core/http/test_server.py", root);
-  }
-
-  /* start the server */
-  args[1 + arg_shift] = "--port";
-  gpr_asprintf(&args[2 + arg_shift], "%d", port);
-  server = gpr_subprocess_create(3 + arg_shift, (const char **)args);
-  GPR_ASSERT(server);
-  gpr_free(args[0]);
-  if (arg_shift) gpr_free(args[1]);
-  gpr_free(args[2 + arg_shift]);
-  gpr_free(root);
-
-  gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                               gpr_time_from_seconds(5, GPR_TIMESPAN)));
-
-  grpc_test_init(argc, argv);
-  grpc_init();
-  grpc_httpcli_context_init(&g_context);
-  grpc_pollset *pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(pollset, &g_mu);
-  g_pops = grpc_polling_entity_create_from_pollset(pollset);
-
-  test_get(port);
-  test_post(port);
-
-  grpc_httpcli_context_destroy(&exec_ctx, &g_context);
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pops, &g_pops,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
-                        &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-
-  gpr_free(grpc_polling_entity_pollset(&g_pops));
-
-  gpr_subprocess_destroy(server);
-
-  return 0;
-}
diff --git a/test/core/http/httpcli_test.cc b/test/core/http/httpcli_test.cc
new file mode 100644
index 0000000..ac3c6a2
--- /dev/null
+++ b/test/core/http/httpcli_test.cc
@@ -0,0 +1,211 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/http/httpcli.h"
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/subprocess.h>
+#include <grpc/support/sync.h>
+#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static int g_done = 0;
+static grpc_httpcli_context g_context;
+static gpr_mu* g_mu;
+static grpc_polling_entity g_pops;
+
+static grpc_millis n_seconds_time(int seconds) {
+  return grpc_timespec_to_millis_round_up(
+      grpc_timeout_seconds_to_deadline(seconds));
+}
+
+static void on_finish(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  const char* expect =
+      "<html><head><title>Hello world!</title></head>"
+      "<body><p>This is a test</p></body></html>";
+  grpc_http_response* response = static_cast<grpc_http_response*>(arg);
+  GPR_ASSERT(response);
+  GPR_ASSERT(response->status == 200);
+  GPR_ASSERT(response->body_length == strlen(expect));
+  GPR_ASSERT(0 == memcmp(expect, response->body, response->body_length));
+  gpr_mu_lock(g_mu);
+  g_done = 1;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "pollset_kick",
+      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&g_pops), NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+static void test_get(int port) {
+  grpc_httpcli_request req;
+  char* host;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  g_done = 0;
+  gpr_log(GPR_INFO, "test_get");
+
+  gpr_asprintf(&host, "localhost:%d", port);
+  gpr_log(GPR_INFO, "requesting from %s", host);
+
+  memset(&req, 0, sizeof(req));
+  req.host = host;
+  req.http.path = const_cast<char*>("/get");
+  req.handshaker = &grpc_httpcli_plaintext;
+
+  grpc_http_response response;
+  memset(&response, 0, sizeof(response));
+  grpc_resource_quota* resource_quota = grpc_resource_quota_create("test_get");
+  grpc_httpcli_get(
+      &exec_ctx, &g_context, &g_pops, resource_quota, &req, n_seconds_time(15),
+      GRPC_CLOSURE_CREATE(on_finish, &response, grpc_schedule_on_exec_ctx),
+      &response);
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+  gpr_mu_lock(g_mu);
+  while (!g_done) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
+                          &worker, n_seconds_time(1))));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  gpr_mu_unlock(g_mu);
+  gpr_free(host);
+  grpc_http_response_destroy(&response);
+}
+
+static void test_post(int port) {
+  grpc_httpcli_request req;
+  char* host;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  g_done = 0;
+  gpr_log(GPR_INFO, "test_post");
+
+  gpr_asprintf(&host, "localhost:%d", port);
+  gpr_log(GPR_INFO, "posting to %s", host);
+
+  memset(&req, 0, sizeof(req));
+  req.host = host;
+  req.http.path = const_cast<char*>("/post");
+  req.handshaker = &grpc_httpcli_plaintext;
+
+  grpc_http_response response;
+  memset(&response, 0, sizeof(response));
+  grpc_resource_quota* resource_quota = grpc_resource_quota_create("test_post");
+  grpc_httpcli_post(
+      &exec_ctx, &g_context, &g_pops, resource_quota, &req, "hello", 5,
+      n_seconds_time(15),
+      GRPC_CLOSURE_CREATE(on_finish, &response, grpc_schedule_on_exec_ctx),
+      &response);
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+  gpr_mu_lock(g_mu);
+  while (!g_done) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
+                          &worker, n_seconds_time(1))));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  gpr_mu_unlock(g_mu);
+  gpr_free(host);
+  grpc_http_response_destroy(&response);
+}
+
+static void destroy_pops(grpc_exec_ctx* exec_ctx, void* p, grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, grpc_polling_entity_pollset(
+                                     static_cast<grpc_polling_entity*>(p)));
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  gpr_subprocess* server;
+  char* me = argv[0];
+  char* lslash = strrchr(me, '/');
+  char* args[4];
+  int port = grpc_pick_unused_port_or_die();
+  int arg_shift = 0;
+  /* figure out where we are */
+  char* root;
+  if (lslash) {
+    root = static_cast<char*>(gpr_malloc((size_t)(lslash - me + 1)));
+    memcpy(root, me, (size_t)(lslash - me));
+    root[lslash - me] = 0;
+  } else {
+    root = gpr_strdup(".");
+  }
+
+  GPR_ASSERT(argc <= 2);
+  if (argc == 2) {
+    args[0] = gpr_strdup(argv[1]);
+  } else {
+    arg_shift = 1;
+    gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root);
+    gpr_asprintf(&args[1], "%s/../../test/core/http/test_server.py", root);
+  }
+
+  /* start the server */
+  args[1 + arg_shift] = const_cast<char*>("--port");
+  gpr_asprintf(&args[2 + arg_shift], "%d", port);
+  server = gpr_subprocess_create(3 + arg_shift, (const char**)args);
+  GPR_ASSERT(server);
+  gpr_free(args[0]);
+  if (arg_shift) gpr_free(args[1]);
+  gpr_free(args[2 + arg_shift]);
+  gpr_free(root);
+
+  gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                               gpr_time_from_seconds(5, GPR_TIMESPAN)));
+
+  grpc_test_init(argc, argv);
+  grpc_init();
+  grpc_httpcli_context_init(&g_context);
+  grpc_pollset* pollset =
+      static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(pollset, &g_mu);
+  g_pops = grpc_polling_entity_create_from_pollset(pollset);
+
+  test_get(port);
+  test_post(port);
+
+  grpc_httpcli_context_destroy(&exec_ctx, &g_context);
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pops, &g_pops,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
+                        &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+
+  gpr_free(grpc_polling_entity_pollset(&g_pops));
+
+  gpr_subprocess_destroy(server);
+
+  return 0;
+}
diff --git a/test/core/http/httpscli_test.c b/test/core/http/httpscli_test.c
deleted file mode 100644
index f8a3cfd..0000000
--- a/test/core/http/httpscli_test.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/http/httpcli.h"
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/subprocess.h>
-#include <grpc/support/sync.h>
-#include "src/core/lib/iomgr/iomgr.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static int g_done = 0;
-static grpc_httpcli_context g_context;
-static gpr_mu *g_mu;
-static grpc_polling_entity g_pops;
-
-static grpc_millis n_seconds_time(int seconds) {
-  return grpc_timespec_to_millis_round_up(
-      grpc_timeout_seconds_to_deadline(seconds));
-}
-
-static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  const char *expect =
-      "<html><head><title>Hello world!</title></head>"
-      "<body><p>This is a test</p></body></html>";
-  grpc_http_response *response = arg;
-  GPR_ASSERT(response);
-  GPR_ASSERT(response->status == 200);
-  GPR_ASSERT(response->body_length == strlen(expect));
-  GPR_ASSERT(0 == memcmp(expect, response->body, response->body_length));
-  gpr_mu_lock(g_mu);
-  g_done = 1;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "pollset_kick",
-      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&g_pops), NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-static void test_get(int port) {
-  grpc_httpcli_request req;
-  char *host;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  g_done = 0;
-  gpr_log(GPR_INFO, "test_get");
-
-  gpr_asprintf(&host, "localhost:%d", port);
-  gpr_log(GPR_INFO, "requesting from %s", host);
-
-  memset(&req, 0, sizeof(req));
-  req.host = host;
-  req.ssl_host_override = "foo.test.google.fr";
-  req.http.path = "/get";
-  req.handshaker = &grpc_httpcli_ssl;
-
-  grpc_http_response response;
-  memset(&response, 0, sizeof(response));
-  grpc_resource_quota *resource_quota = grpc_resource_quota_create("test_get");
-  grpc_httpcli_get(
-      &exec_ctx, &g_context, &g_pops, resource_quota, &req, n_seconds_time(15),
-      GRPC_CLOSURE_CREATE(on_finish, &response, grpc_schedule_on_exec_ctx),
-      &response);
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-  gpr_mu_lock(g_mu);
-  while (!g_done) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
-                          &worker, n_seconds_time(1))));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  gpr_mu_unlock(g_mu);
-  gpr_free(host);
-  grpc_http_response_destroy(&response);
-}
-
-static void test_post(int port) {
-  grpc_httpcli_request req;
-  char *host;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  g_done = 0;
-  gpr_log(GPR_INFO, "test_post");
-
-  gpr_asprintf(&host, "localhost:%d", port);
-  gpr_log(GPR_INFO, "posting to %s", host);
-
-  memset(&req, 0, sizeof(req));
-  req.host = host;
-  req.ssl_host_override = "foo.test.google.fr";
-  req.http.path = "/post";
-  req.handshaker = &grpc_httpcli_ssl;
-
-  grpc_http_response response;
-  memset(&response, 0, sizeof(response));
-  grpc_resource_quota *resource_quota = grpc_resource_quota_create("test_post");
-  grpc_httpcli_post(
-      &exec_ctx, &g_context, &g_pops, resource_quota, &req, "hello", 5,
-      n_seconds_time(15),
-      GRPC_CLOSURE_CREATE(on_finish, &response, grpc_schedule_on_exec_ctx),
-      &response);
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-  gpr_mu_lock(g_mu);
-  while (!g_done) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
-                          &worker, n_seconds_time(1))));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  gpr_mu_unlock(g_mu);
-  gpr_free(host);
-  grpc_http_response_destroy(&response);
-}
-
-static void destroy_pops(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, grpc_polling_entity_pollset(p));
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  gpr_subprocess *server;
-  char *me = argv[0];
-  char *lslash = strrchr(me, '/');
-  char *args[5];
-  int port = grpc_pick_unused_port_or_die();
-  int arg_shift = 0;
-  /* figure out where we are */
-  char *root;
-  if (lslash) {
-    root = gpr_malloc((size_t)(lslash - me + 1));
-    memcpy(root, me, (size_t)(lslash - me));
-    root[lslash - me] = 0;
-  } else {
-    root = gpr_strdup(".");
-  }
-
-  GPR_ASSERT(argc <= 2);
-  if (argc == 2) {
-    args[0] = gpr_strdup(argv[1]);
-  } else {
-    arg_shift = 1;
-    gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root);
-    gpr_asprintf(&args[1], "%s/../../test/core/http/test_server.py", root);
-  }
-
-  /* start the server */
-  args[1 + arg_shift] = "--port";
-  gpr_asprintf(&args[2 + arg_shift], "%d", port);
-  args[3 + arg_shift] = "--ssl";
-  server = gpr_subprocess_create(4 + arg_shift, (const char **)args);
-  GPR_ASSERT(server);
-  gpr_free(args[0]);
-  if (arg_shift) gpr_free(args[1]);
-  gpr_free(args[2 + arg_shift]);
-  gpr_free(root);
-
-  gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                               gpr_time_from_seconds(5, GPR_TIMESPAN)));
-
-  grpc_test_init(argc, argv);
-  grpc_init();
-  grpc_httpcli_context_init(&g_context);
-  grpc_pollset *pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(pollset, &g_mu);
-  g_pops = grpc_polling_entity_create_from_pollset(pollset);
-
-  test_get(port);
-  test_post(port);
-
-  grpc_httpcli_context_destroy(&exec_ctx, &g_context);
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pops, &g_pops,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
-                        &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-
-  gpr_free(grpc_polling_entity_pollset(&g_pops));
-
-  gpr_subprocess_destroy(server);
-
-  return 0;
-}
diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc
new file mode 100644
index 0000000..bf851b1
--- /dev/null
+++ b/test/core/http/httpscli_test.cc
@@ -0,0 +1,214 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/http/httpcli.h"
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/subprocess.h>
+#include <grpc/support/sync.h>
+#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static int g_done = 0;
+static grpc_httpcli_context g_context;
+static gpr_mu* g_mu;
+static grpc_polling_entity g_pops;
+
+static grpc_millis n_seconds_time(int seconds) {
+  return grpc_timespec_to_millis_round_up(
+      grpc_timeout_seconds_to_deadline(seconds));
+}
+
+static void on_finish(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  const char* expect =
+      "<html><head><title>Hello world!</title></head>"
+      "<body><p>This is a test</p></body></html>";
+  grpc_http_response* response = static_cast<grpc_http_response*>(arg);
+  GPR_ASSERT(response);
+  GPR_ASSERT(response->status == 200);
+  GPR_ASSERT(response->body_length == strlen(expect));
+  GPR_ASSERT(0 == memcmp(expect, response->body, response->body_length));
+  gpr_mu_lock(g_mu);
+  g_done = 1;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "pollset_kick",
+      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&g_pops), NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+static void test_get(int port) {
+  grpc_httpcli_request req;
+  char* host;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  g_done = 0;
+  gpr_log(GPR_INFO, "test_get");
+
+  gpr_asprintf(&host, "localhost:%d", port);
+  gpr_log(GPR_INFO, "requesting from %s", host);
+
+  memset(&req, 0, sizeof(req));
+  req.host = host;
+  req.ssl_host_override = const_cast<char*>("foo.test.google.fr");
+  req.http.path = const_cast<char*>("/get");
+  req.handshaker = &grpc_httpcli_ssl;
+
+  grpc_http_response response;
+  memset(&response, 0, sizeof(response));
+  grpc_resource_quota* resource_quota = grpc_resource_quota_create("test_get");
+  grpc_httpcli_get(
+      &exec_ctx, &g_context, &g_pops, resource_quota, &req, n_seconds_time(15),
+      GRPC_CLOSURE_CREATE(on_finish, &response, grpc_schedule_on_exec_ctx),
+      &response);
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+  gpr_mu_lock(g_mu);
+  while (!g_done) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
+                          &worker, n_seconds_time(1))));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  gpr_mu_unlock(g_mu);
+  gpr_free(host);
+  grpc_http_response_destroy(&response);
+}
+
+static void test_post(int port) {
+  grpc_httpcli_request req;
+  char* host;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  g_done = 0;
+  gpr_log(GPR_INFO, "test_post");
+
+  gpr_asprintf(&host, "localhost:%d", port);
+  gpr_log(GPR_INFO, "posting to %s", host);
+
+  memset(&req, 0, sizeof(req));
+  req.host = host;
+  req.ssl_host_override = const_cast<char*>("foo.test.google.fr");
+  req.http.path = const_cast<char*>("/post");
+  req.handshaker = &grpc_httpcli_ssl;
+
+  grpc_http_response response;
+  memset(&response, 0, sizeof(response));
+  grpc_resource_quota* resource_quota = grpc_resource_quota_create("test_post");
+  grpc_httpcli_post(
+      &exec_ctx, &g_context, &g_pops, resource_quota, &req, "hello", 5,
+      n_seconds_time(15),
+      GRPC_CLOSURE_CREATE(on_finish, &response, grpc_schedule_on_exec_ctx),
+      &response);
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+  gpr_mu_lock(g_mu);
+  while (!g_done) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
+                          &worker, n_seconds_time(1))));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  gpr_mu_unlock(g_mu);
+  gpr_free(host);
+  grpc_http_response_destroy(&response);
+}
+
+static void destroy_pops(grpc_exec_ctx* exec_ctx, void* p, grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, grpc_polling_entity_pollset(
+                                     static_cast<grpc_polling_entity*>(p)));
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  gpr_subprocess* server;
+  char* me = argv[0];
+  char* lslash = strrchr(me, '/');
+  char* args[5];
+  int port = grpc_pick_unused_port_or_die();
+  int arg_shift = 0;
+  /* figure out where we are */
+  char* root;
+  if (lslash) {
+    root = static_cast<char*>(gpr_malloc((size_t)(lslash - me + 1)));
+    memcpy(root, me, (size_t)(lslash - me));
+    root[lslash - me] = 0;
+  } else {
+    root = gpr_strdup(".");
+  }
+
+  GPR_ASSERT(argc <= 2);
+  if (argc == 2) {
+    args[0] = gpr_strdup(argv[1]);
+  } else {
+    arg_shift = 1;
+    gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root);
+    gpr_asprintf(&args[1], "%s/../../test/core/http/test_server.py", root);
+  }
+
+  /* start the server */
+  args[1 + arg_shift] = const_cast<char*>("--port");
+  gpr_asprintf(&args[2 + arg_shift], "%d", port);
+  args[3 + arg_shift] = const_cast<char*>("--ssl");
+  server = gpr_subprocess_create(4 + arg_shift, (const char**)args);
+  GPR_ASSERT(server);
+  gpr_free(args[0]);
+  if (arg_shift) gpr_free(args[1]);
+  gpr_free(args[2 + arg_shift]);
+  gpr_free(root);
+
+  gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                               gpr_time_from_seconds(5, GPR_TIMESPAN)));
+
+  grpc_test_init(argc, argv);
+  grpc_init();
+  grpc_httpcli_context_init(&g_context);
+  grpc_pollset* pollset =
+      static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(pollset, &g_mu);
+  g_pops = grpc_polling_entity_create_from_pollset(pollset);
+
+  test_get(port);
+  test_post(port);
+
+  grpc_httpcli_context_destroy(&exec_ctx, &g_context);
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pops, &g_pops,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&g_pops),
+                        &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+
+  gpr_free(grpc_polling_entity_pollset(&g_pops));
+
+  gpr_subprocess_destroy(server);
+
+  return 0;
+}
diff --git a/test/core/http/parser_test.c b/test/core/http/parser_test.c
deleted file mode 100644
index a7044c0..0000000
--- a/test/core/http/parser_test.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/http/parser.h"
-
-#include <stdarg.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/useful.h>
-#include "test/core/util/slice_splitter.h"
-#include "test/core/util/test_config.h"
-
-static void test_request_succeeds(grpc_slice_split_mode split_mode,
-                                  char *request_text, char *expect_method,
-                                  grpc_http_version expect_version,
-                                  char *expect_path, char *expect_body, ...) {
-  grpc_http_parser parser;
-  grpc_slice input_slice = grpc_slice_from_copied_string(request_text);
-  size_t num_slices;
-  size_t i;
-  grpc_slice *slices;
-  va_list args;
-  grpc_http_request request;
-  memset(&request, 0, sizeof(request));
-
-  grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
-  grpc_slice_unref(input_slice);
-
-  grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request);
-
-  for (i = 0; i < num_slices; i++) {
-    GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL) ==
-               GRPC_ERROR_NONE);
-    grpc_slice_unref(slices[i]);
-  }
-  GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE);
-
-  GPR_ASSERT(GRPC_HTTP_REQUEST == parser.type);
-  GPR_ASSERT(0 == strcmp(expect_method, request.method));
-  GPR_ASSERT(0 == strcmp(expect_path, request.path));
-  GPR_ASSERT(expect_version == request.version);
-
-  if (expect_body != NULL) {
-    GPR_ASSERT(strlen(expect_body) == request.body_length);
-    GPR_ASSERT(0 == memcmp(expect_body, request.body, request.body_length));
-  } else {
-    GPR_ASSERT(request.body_length == 0);
-  }
-
-  va_start(args, expect_body);
-  i = 0;
-  for (;;) {
-    char *expect_key;
-    char *expect_value;
-    expect_key = va_arg(args, char *);
-    if (!expect_key) break;
-    GPR_ASSERT(i < request.hdr_count);
-    expect_value = va_arg(args, char *);
-    GPR_ASSERT(expect_value);
-    GPR_ASSERT(0 == strcmp(expect_key, request.hdrs[i].key));
-    GPR_ASSERT(0 == strcmp(expect_value, request.hdrs[i].value));
-    i++;
-  }
-  va_end(args);
-  GPR_ASSERT(i == request.hdr_count);
-
-  grpc_http_request_destroy(&request);
-  grpc_http_parser_destroy(&parser);
-  gpr_free(slices);
-}
-
-static void test_succeeds(grpc_slice_split_mode split_mode, char *response_text,
-                          int expect_status, char *expect_body, ...) {
-  grpc_http_parser parser;
-  grpc_slice input_slice = grpc_slice_from_copied_string(response_text);
-  size_t num_slices;
-  size_t i;
-  grpc_slice *slices;
-  va_list args;
-  grpc_http_response response;
-  memset(&response, 0, sizeof(response));
-
-  grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
-  grpc_slice_unref(input_slice);
-
-  grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
-
-  for (i = 0; i < num_slices; i++) {
-    GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL) ==
-               GRPC_ERROR_NONE);
-    grpc_slice_unref(slices[i]);
-  }
-  GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE);
-
-  GPR_ASSERT(GRPC_HTTP_RESPONSE == parser.type);
-  GPR_ASSERT(expect_status == response.status);
-  if (expect_body != NULL) {
-    GPR_ASSERT(strlen(expect_body) == response.body_length);
-    GPR_ASSERT(0 == memcmp(expect_body, response.body, response.body_length));
-  } else {
-    GPR_ASSERT(response.body_length == 0);
-  }
-
-  va_start(args, expect_body);
-  i = 0;
-  for (;;) {
-    char *expect_key;
-    char *expect_value;
-    expect_key = va_arg(args, char *);
-    if (!expect_key) break;
-    GPR_ASSERT(i < response.hdr_count);
-    expect_value = va_arg(args, char *);
-    GPR_ASSERT(expect_value);
-    GPR_ASSERT(0 == strcmp(expect_key, response.hdrs[i].key));
-    GPR_ASSERT(0 == strcmp(expect_value, response.hdrs[i].value));
-    i++;
-  }
-  va_end(args);
-  GPR_ASSERT(i == response.hdr_count);
-
-  grpc_http_response_destroy(&response);
-  grpc_http_parser_destroy(&parser);
-  gpr_free(slices);
-}
-
-static void test_fails(grpc_slice_split_mode split_mode, char *response_text) {
-  grpc_http_parser parser;
-  grpc_slice input_slice = grpc_slice_from_copied_string(response_text);
-  size_t num_slices;
-  size_t i;
-  grpc_slice *slices;
-  grpc_error *error = GRPC_ERROR_NONE;
-  grpc_http_response response;
-  memset(&response, 0, sizeof(response));
-
-  grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
-  grpc_slice_unref(input_slice);
-
-  grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
-
-  for (i = 0; i < num_slices; i++) {
-    if (GRPC_ERROR_NONE == error) {
-      error = grpc_http_parser_parse(&parser, slices[i], NULL);
-    }
-    grpc_slice_unref(slices[i]);
-  }
-  if (GRPC_ERROR_NONE == error) {
-    error = grpc_http_parser_eof(&parser);
-  }
-  GPR_ASSERT(error != GRPC_ERROR_NONE);
-  GRPC_ERROR_UNREF(error);
-
-  grpc_http_response_destroy(&response);
-  grpc_http_parser_destroy(&parser);
-  gpr_free(slices);
-}
-
-static void test_request_fails(grpc_slice_split_mode split_mode,
-                               char *request_text) {
-  grpc_http_parser parser;
-  grpc_slice input_slice = grpc_slice_from_copied_string(request_text);
-  size_t num_slices;
-  size_t i;
-  grpc_slice *slices;
-  grpc_error *error = GRPC_ERROR_NONE;
-  grpc_http_request request;
-  memset(&request, 0, sizeof(request));
-
-  grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
-  grpc_slice_unref(input_slice);
-
-  grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request);
-
-  for (i = 0; i < num_slices; i++) {
-    if (error == GRPC_ERROR_NONE) {
-      error = grpc_http_parser_parse(&parser, slices[i], NULL);
-    }
-    grpc_slice_unref(slices[i]);
-  }
-  if (error == GRPC_ERROR_NONE) {
-    error = grpc_http_parser_eof(&parser);
-  }
-  GPR_ASSERT(error != GRPC_ERROR_NONE);
-  GRPC_ERROR_UNREF(error);
-
-  grpc_http_request_destroy(&request);
-  grpc_http_parser_destroy(&parser);
-  gpr_free(slices);
-}
-
-int main(int argc, char **argv) {
-  size_t i;
-  const grpc_slice_split_mode split_modes[] = {GRPC_SLICE_SPLIT_IDENTITY,
-                                               GRPC_SLICE_SPLIT_ONE_BYTE};
-  char *tmp1, *tmp2;
-
-  grpc_test_init(argc, argv);
-
-  for (i = 0; i < GPR_ARRAY_SIZE(split_modes); i++) {
-    test_succeeds(split_modes[i],
-                  "HTTP/1.0 200 OK\r\n"
-                  "xyz: abc\r\n"
-                  "\r\n"
-                  "hello world!",
-                  200, "hello world!", "xyz", "abc", NULL);
-    test_succeeds(split_modes[i],
-                  "HTTP/1.0 404 Not Found\r\n"
-                  "\r\n",
-                  404, NULL, NULL);
-    test_succeeds(split_modes[i],
-                  "HTTP/1.1 200 OK\r\n"
-                  "xyz: abc\r\n"
-                  "\r\n"
-                  "hello world!",
-                  200, "hello world!", "xyz", "abc", NULL);
-    test_succeeds(split_modes[i],
-                  "HTTP/1.1 200 OK\n"
-                  "\n"
-                  "abc",
-                  200, "abc", NULL);
-    test_request_succeeds(split_modes[i],
-                          "GET / HTTP/1.0\r\n"
-                          "\r\n",
-                          "GET", GRPC_HTTP_HTTP10, "/", NULL, NULL);
-    test_request_succeeds(split_modes[i],
-                          "GET / HTTP/1.0\r\n"
-                          "\r\n"
-                          "xyz",
-                          "GET", GRPC_HTTP_HTTP10, "/", "xyz", NULL);
-    test_request_succeeds(split_modes[i],
-                          "GET / HTTP/1.1\r\n"
-                          "\r\n"
-                          "xyz",
-                          "GET", GRPC_HTTP_HTTP11, "/", "xyz", NULL);
-    test_request_succeeds(split_modes[i],
-                          "GET / HTTP/2.0\r\n"
-                          "\r\n"
-                          "xyz",
-                          "GET", GRPC_HTTP_HTTP20, "/", "xyz", NULL);
-    test_request_succeeds(split_modes[i],
-                          "GET / HTTP/1.0\r\n"
-                          "xyz: abc\r\n"
-                          "\r\n"
-                          "xyz",
-                          "GET", GRPC_HTTP_HTTP10, "/", "xyz", "xyz", "abc",
-                          NULL);
-    test_request_succeeds(split_modes[i],
-                          "GET / HTTP/1.0\n"
-                          "\n"
-                          "xyz",
-                          "GET", GRPC_HTTP_HTTP10, "/", "xyz", NULL);
-    test_fails(split_modes[i], "HTTP/1.0\r\n");
-    test_fails(split_modes[i], "HTTP/1.2\r\n");
-    test_fails(split_modes[i], "HTTP/1.0 000 XYX\r\n");
-    test_fails(split_modes[i], "HTTP/1.0 200 OK\n");
-    test_fails(split_modes[i], "HTTP/1.0 200 OK\r\n");
-    test_fails(split_modes[i], "HTTP/1.0 200 OK\r\nFoo x\r\n");
-    test_fails(split_modes[i],
-               "HTTP/1.0 200 OK\r\n"
-               "xyz: abc\r\n"
-               "  def\r\n"
-               "\r\n"
-               "hello world!");
-    test_request_fails(split_modes[i], "GET\r\n");
-    test_request_fails(split_modes[i], "GET /\r\n");
-    test_request_fails(split_modes[i], "GET / HTTP/0.0\r\n");
-    test_request_fails(split_modes[i], "GET / ____/1.0\r\n");
-    test_request_fails(split_modes[i], "GET / HTTP/1.2\r\n");
-    test_request_fails(split_modes[i], "GET / HTTP/1.0\n");
-
-    tmp1 = gpr_malloc(2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH);
-    memset(tmp1, 'a', 2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1);
-    tmp1[2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1] = 0;
-    gpr_asprintf(&tmp2, "HTTP/1.0 200 OK\r\nxyz: %s\r\n\r\n", tmp1);
-    test_fails(split_modes[i], tmp2);
-    gpr_free(tmp1);
-    gpr_free(tmp2);
-  }
-
-  return 0;
-}
diff --git a/test/core/http/parser_test.cc b/test/core/http/parser_test.cc
new file mode 100644
index 0000000..d0d2559
--- /dev/null
+++ b/test/core/http/parser_test.cc
@@ -0,0 +1,304 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/http/parser.h"
+
+#include <stdarg.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/slice_splitter.h"
+#include "test/core/util/test_config.h"
+
+static void test_request_succeeds(grpc_slice_split_mode split_mode,
+                                  const char* request_text,
+                                  const char* expect_method,
+                                  grpc_http_version expect_version,
+                                  const char* expect_path,
+                                  const char* expect_body, ...) {
+  grpc_http_parser parser;
+  grpc_slice input_slice = grpc_slice_from_copied_string(request_text);
+  size_t num_slices;
+  size_t i;
+  grpc_slice* slices;
+  va_list args;
+  grpc_http_request request;
+  memset(&request, 0, sizeof(request));
+
+  grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
+  grpc_slice_unref(input_slice);
+
+  grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request);
+
+  for (i = 0; i < num_slices; i++) {
+    GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL) ==
+               GRPC_ERROR_NONE);
+    grpc_slice_unref(slices[i]);
+  }
+  GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE);
+
+  GPR_ASSERT(GRPC_HTTP_REQUEST == parser.type);
+  GPR_ASSERT(0 == strcmp(expect_method, request.method));
+  GPR_ASSERT(0 == strcmp(expect_path, request.path));
+  GPR_ASSERT(expect_version == request.version);
+
+  if (expect_body != NULL) {
+    GPR_ASSERT(strlen(expect_body) == request.body_length);
+    GPR_ASSERT(0 == memcmp(expect_body, request.body, request.body_length));
+  } else {
+    GPR_ASSERT(request.body_length == 0);
+  }
+
+  va_start(args, expect_body);
+  i = 0;
+  for (;;) {
+    char* expect_key;
+    char* expect_value;
+    expect_key = va_arg(args, char*);
+    if (!expect_key) break;
+    GPR_ASSERT(i < request.hdr_count);
+    expect_value = va_arg(args, char*);
+    GPR_ASSERT(expect_value);
+    GPR_ASSERT(0 == strcmp(expect_key, request.hdrs[i].key));
+    GPR_ASSERT(0 == strcmp(expect_value, request.hdrs[i].value));
+    i++;
+  }
+  va_end(args);
+  GPR_ASSERT(i == request.hdr_count);
+
+  grpc_http_request_destroy(&request);
+  grpc_http_parser_destroy(&parser);
+  gpr_free(slices);
+}
+
+static void test_succeeds(grpc_slice_split_mode split_mode,
+                          const char* response_text, int expect_status,
+                          const char* expect_body, ...) {
+  grpc_http_parser parser;
+  grpc_slice input_slice = grpc_slice_from_copied_string(response_text);
+  size_t num_slices;
+  size_t i;
+  grpc_slice* slices;
+  va_list args;
+  grpc_http_response response;
+  memset(&response, 0, sizeof(response));
+
+  grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
+  grpc_slice_unref(input_slice);
+
+  grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
+
+  for (i = 0; i < num_slices; i++) {
+    GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i], NULL) ==
+               GRPC_ERROR_NONE);
+    grpc_slice_unref(slices[i]);
+  }
+  GPR_ASSERT(grpc_http_parser_eof(&parser) == GRPC_ERROR_NONE);
+
+  GPR_ASSERT(GRPC_HTTP_RESPONSE == parser.type);
+  GPR_ASSERT(expect_status == response.status);
+  if (expect_body != NULL) {
+    GPR_ASSERT(strlen(expect_body) == response.body_length);
+    GPR_ASSERT(0 == memcmp(expect_body, response.body, response.body_length));
+  } else {
+    GPR_ASSERT(response.body_length == 0);
+  }
+
+  va_start(args, expect_body);
+  i = 0;
+  for (;;) {
+    char* expect_key;
+    char* expect_value;
+    expect_key = va_arg(args, char*);
+    if (!expect_key) break;
+    GPR_ASSERT(i < response.hdr_count);
+    expect_value = va_arg(args, char*);
+    GPR_ASSERT(expect_value);
+    GPR_ASSERT(0 == strcmp(expect_key, response.hdrs[i].key));
+    GPR_ASSERT(0 == strcmp(expect_value, response.hdrs[i].value));
+    i++;
+  }
+  va_end(args);
+  GPR_ASSERT(i == response.hdr_count);
+
+  grpc_http_response_destroy(&response);
+  grpc_http_parser_destroy(&parser);
+  gpr_free(slices);
+}
+
+static void test_fails(grpc_slice_split_mode split_mode,
+                       const char* response_text) {
+  grpc_http_parser parser;
+  grpc_slice input_slice = grpc_slice_from_copied_string(response_text);
+  size_t num_slices;
+  size_t i;
+  grpc_slice* slices;
+  grpc_error* error = GRPC_ERROR_NONE;
+  grpc_http_response response;
+  memset(&response, 0, sizeof(response));
+
+  grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
+  grpc_slice_unref(input_slice);
+
+  grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
+
+  for (i = 0; i < num_slices; i++) {
+    if (GRPC_ERROR_NONE == error) {
+      error = grpc_http_parser_parse(&parser, slices[i], NULL);
+    }
+    grpc_slice_unref(slices[i]);
+  }
+  if (GRPC_ERROR_NONE == error) {
+    error = grpc_http_parser_eof(&parser);
+  }
+  GPR_ASSERT(error != GRPC_ERROR_NONE);
+  GRPC_ERROR_UNREF(error);
+
+  grpc_http_response_destroy(&response);
+  grpc_http_parser_destroy(&parser);
+  gpr_free(slices);
+}
+
+static void test_request_fails(grpc_slice_split_mode split_mode,
+                               const char* request_text) {
+  grpc_http_parser parser;
+  grpc_slice input_slice = grpc_slice_from_copied_string(request_text);
+  size_t num_slices;
+  size_t i;
+  grpc_slice* slices;
+  grpc_error* error = GRPC_ERROR_NONE;
+  grpc_http_request request;
+  memset(&request, 0, sizeof(request));
+
+  grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
+  grpc_slice_unref(input_slice);
+
+  grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request);
+
+  for (i = 0; i < num_slices; i++) {
+    if (error == GRPC_ERROR_NONE) {
+      error = grpc_http_parser_parse(&parser, slices[i], NULL);
+    }
+    grpc_slice_unref(slices[i]);
+  }
+  if (error == GRPC_ERROR_NONE) {
+    error = grpc_http_parser_eof(&parser);
+  }
+  GPR_ASSERT(error != GRPC_ERROR_NONE);
+  GRPC_ERROR_UNREF(error);
+
+  grpc_http_request_destroy(&request);
+  grpc_http_parser_destroy(&parser);
+  gpr_free(slices);
+}
+
+int main(int argc, char** argv) {
+  size_t i;
+  const grpc_slice_split_mode split_modes[] = {GRPC_SLICE_SPLIT_IDENTITY,
+                                               GRPC_SLICE_SPLIT_ONE_BYTE};
+  char *tmp1, *tmp2;
+
+  grpc_test_init(argc, argv);
+
+  for (i = 0; i < GPR_ARRAY_SIZE(split_modes); i++) {
+    test_succeeds(split_modes[i],
+                  "HTTP/1.0 200 OK\r\n"
+                  "xyz: abc\r\n"
+                  "\r\n"
+                  "hello world!",
+                  200, "hello world!", "xyz", "abc", NULL);
+    test_succeeds(split_modes[i],
+                  "HTTP/1.0 404 Not Found\r\n"
+                  "\r\n",
+                  404, NULL, NULL);
+    test_succeeds(split_modes[i],
+                  "HTTP/1.1 200 OK\r\n"
+                  "xyz: abc\r\n"
+                  "\r\n"
+                  "hello world!",
+                  200, "hello world!", "xyz", "abc", NULL);
+    test_succeeds(split_modes[i],
+                  "HTTP/1.1 200 OK\n"
+                  "\n"
+                  "abc",
+                  200, "abc", NULL);
+    test_request_succeeds(split_modes[i],
+                          "GET / HTTP/1.0\r\n"
+                          "\r\n",
+                          "GET", GRPC_HTTP_HTTP10, "/", NULL, NULL);
+    test_request_succeeds(split_modes[i],
+                          "GET / HTTP/1.0\r\n"
+                          "\r\n"
+                          "xyz",
+                          "GET", GRPC_HTTP_HTTP10, "/", "xyz", NULL);
+    test_request_succeeds(split_modes[i],
+                          "GET / HTTP/1.1\r\n"
+                          "\r\n"
+                          "xyz",
+                          "GET", GRPC_HTTP_HTTP11, "/", "xyz", NULL);
+    test_request_succeeds(split_modes[i],
+                          "GET / HTTP/2.0\r\n"
+                          "\r\n"
+                          "xyz",
+                          "GET", GRPC_HTTP_HTTP20, "/", "xyz", NULL);
+    test_request_succeeds(split_modes[i],
+                          "GET / HTTP/1.0\r\n"
+                          "xyz: abc\r\n"
+                          "\r\n"
+                          "xyz",
+                          "GET", GRPC_HTTP_HTTP10, "/", "xyz", "xyz", "abc",
+                          NULL);
+    test_request_succeeds(split_modes[i],
+                          "GET / HTTP/1.0\n"
+                          "\n"
+                          "xyz",
+                          "GET", GRPC_HTTP_HTTP10, "/", "xyz", NULL);
+    test_fails(split_modes[i], "HTTP/1.0\r\n");
+    test_fails(split_modes[i], "HTTP/1.2\r\n");
+    test_fails(split_modes[i], "HTTP/1.0 000 XYX\r\n");
+    test_fails(split_modes[i], "HTTP/1.0 200 OK\n");
+    test_fails(split_modes[i], "HTTP/1.0 200 OK\r\n");
+    test_fails(split_modes[i], "HTTP/1.0 200 OK\r\nFoo x\r\n");
+    test_fails(split_modes[i],
+               "HTTP/1.0 200 OK\r\n"
+               "xyz: abc\r\n"
+               "  def\r\n"
+               "\r\n"
+               "hello world!");
+    test_request_fails(split_modes[i], "GET\r\n");
+    test_request_fails(split_modes[i], "GET /\r\n");
+    test_request_fails(split_modes[i], "GET / HTTP/0.0\r\n");
+    test_request_fails(split_modes[i], "GET / ____/1.0\r\n");
+    test_request_fails(split_modes[i], "GET / HTTP/1.2\r\n");
+    test_request_fails(split_modes[i], "GET / HTTP/1.0\n");
+
+    tmp1 =
+        static_cast<char*>(gpr_malloc(2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH));
+    memset(tmp1, 'a', 2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1);
+    tmp1[2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1] = 0;
+    gpr_asprintf(&tmp2, "HTTP/1.0 200 OK\r\nxyz: %s\r\n\r\n", tmp1);
+    test_fails(split_modes[i], tmp2);
+    gpr_free(tmp1);
+    gpr_free(tmp2);
+  }
+
+  return 0;
+}
diff --git a/test/core/http/request_fuzzer.c b/test/core/http/request_fuzzer.c
deleted file mode 100644
index aefe9eb..0000000
--- a/test/core/http/request_fuzzer.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/lib/http/parser.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  grpc_http_parser parser;
-  grpc_http_request request;
-  memset(&request, 0, sizeof(request));
-  grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request);
-  grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size);
-  GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice, NULL));
-  GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser));
-  grpc_slice_unref(slice);
-  grpc_http_parser_destroy(&parser);
-  grpc_http_request_destroy(&request);
-  return 0;
-}
diff --git a/test/core/http/request_fuzzer.cc b/test/core/http/request_fuzzer.cc
new file mode 100644
index 0000000..dfdb579
--- /dev/null
+++ b/test/core/http/request_fuzzer.cc
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/lib/http/parser.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  grpc_http_parser parser;
+  grpc_http_request request;
+  memset(&request, 0, sizeof(request));
+  grpc_http_parser_init(&parser, GRPC_HTTP_REQUEST, &request);
+  grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size);
+  GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice, NULL));
+  GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser));
+  grpc_slice_unref(slice);
+  grpc_http_parser_destroy(&parser);
+  grpc_http_request_destroy(&request);
+  return 0;
+}
diff --git a/test/core/http/response_fuzzer.c b/test/core/http/response_fuzzer.c
deleted file mode 100644
index d5bb675..0000000
--- a/test/core/http/response_fuzzer.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/lib/http/parser.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  grpc_http_parser parser;
-  grpc_http_response response;
-  memset(&response, 0, sizeof(response));
-  grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
-  grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size);
-  GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice, NULL));
-  GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser));
-  grpc_slice_unref(slice);
-  grpc_http_parser_destroy(&parser);
-  grpc_http_response_destroy(&response);
-  return 0;
-}
diff --git a/test/core/http/response_fuzzer.cc b/test/core/http/response_fuzzer.cc
new file mode 100644
index 0000000..89ee676
--- /dev/null
+++ b/test/core/http/response_fuzzer.cc
@@ -0,0 +1,41 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/lib/http/parser.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  grpc_http_parser parser;
+  grpc_http_response response;
+  memset(&response, 0, sizeof(response));
+  grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
+  grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size);
+  GRPC_ERROR_UNREF(grpc_http_parser_parse(&parser, slice, NULL));
+  GRPC_ERROR_UNREF(grpc_http_parser_eof(&parser));
+  grpc_slice_unref(slice);
+  grpc_http_parser_destroy(&parser);
+  grpc_http_response_destroy(&response);
+  return 0;
+}
diff --git a/test/core/iomgr/BUILD b/test/core/iomgr/BUILD
index 7620d1d..41e2607 100644
--- a/test/core/iomgr/BUILD
+++ b/test/core/iomgr/BUILD
@@ -22,9 +22,9 @@
 
 grpc_cc_library(
     name = "endpoint_tests",
-    srcs = ["endpoint_tests.c"],
+    srcs = ["endpoint_tests.cc"],
     hdrs = ["endpoint_tests.h"],
-    language = "C",
+    language = "C++",
     visibility = ["//test:__subpackages__"],
     deps = [
         "//:gpr",
@@ -36,8 +36,8 @@
 
 grpc_cc_test(
     name = "combiner_test",
-    srcs = ["combiner_test.c"],
-    language = "C",
+    srcs = ["combiner_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -48,8 +48,8 @@
 
 grpc_cc_test(
     name = "endpoint_pair_test",
-    srcs = ["endpoint_pair_test.c"],
-    language = "C",
+    srcs = ["endpoint_pair_test.cc"],
+    language = "C++",
     deps = [
         ":endpoint_tests",
         "//:gpr",
@@ -61,20 +61,20 @@
 
 grpc_cc_test(
     name = "ev_epollsig_linux_test",
-    srcs = ["ev_epollsig_linux_test.c"],
+    srcs = ["ev_epollsig_linux_test.cc"],
     deps = [
         "//:gpr",
         "//:grpc",
         "//test/core/util:gpr_test_util",
         "//test/core/util:grpc_test_util",
     ],
-    language = "C",
+    language = "C++",
 )
 
 grpc_cc_test(
     name = "fd_conservation_posix_test",
-    srcs = ["fd_conservation_posix_test.c"],
-    language = "C",
+    srcs = ["fd_conservation_posix_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -85,8 +85,8 @@
 
 grpc_cc_test(
     name = "fd_posix_test",
-    srcs = ["fd_posix_test.c"],
-    language = "C",
+    srcs = ["fd_posix_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -97,8 +97,8 @@
 
 grpc_cc_test(
     name = "load_file_test",
-    srcs = ["load_file_test.c"],
-    language = "C",
+    srcs = ["load_file_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -109,8 +109,8 @@
 
 grpc_cc_test(
     name = "pollset_set_test",
-    srcs = ["pollset_set_test.c"],
-    language = "C",
+    srcs = ["pollset_set_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -121,8 +121,8 @@
 
 grpc_cc_test(
     name = "resolve_address_posix_test",
-    srcs = ["resolve_address_posix_test.c"],
-    language = "C",
+    srcs = ["resolve_address_posix_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -133,8 +133,8 @@
 
 grpc_cc_test(
     name = "resolve_address_test",
-    srcs = ["resolve_address_test.c"],
-    language = "C",
+    srcs = ["resolve_address_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -145,8 +145,8 @@
 
 grpc_cc_test(
     name = "resource_quota_test",
-    srcs = ["resource_quota_test.c"],
-    language = "C",
+    srcs = ["resource_quota_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -157,8 +157,8 @@
 
 grpc_cc_test(
     name = "sockaddr_utils_test",
-    srcs = ["sockaddr_utils_test.c"],
-    language = "C",
+    srcs = ["sockaddr_utils_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -169,8 +169,8 @@
 
 grpc_cc_test(
     name = "socket_utils_test",
-    srcs = ["socket_utils_test.c"],
-    language = "C",
+    srcs = ["socket_utils_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -181,8 +181,8 @@
 
 grpc_cc_test(
     name = "tcp_client_posix_test",
-    srcs = ["tcp_client_posix_test.c"],
-    language = "C",
+    srcs = ["tcp_client_posix_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -193,8 +193,8 @@
 
 grpc_cc_test(
     name = "tcp_posix_test",
-    srcs = ["tcp_posix_test.c"],
-    language = "C",
+    srcs = ["tcp_posix_test.cc"],
+    language = "C++",
     deps = [
         ":endpoint_tests",
         "//:gpr",
@@ -206,8 +206,8 @@
 
 grpc_cc_test(
     name = "tcp_server_posix_test",
-    srcs = ["tcp_server_posix_test.c"],
-    language = "C",
+    srcs = ["tcp_server_posix_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -218,8 +218,8 @@
 
 grpc_cc_test(
     name = "time_averaged_stats_test",
-    srcs = ["time_averaged_stats_test.c"],
-    language = "C",
+    srcs = ["time_averaged_stats_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -230,8 +230,8 @@
 
 grpc_cc_test(
     name = "timer_heap_test",
-    srcs = ["timer_heap_test.c"],
-    language = "C",
+    srcs = ["timer_heap_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -242,8 +242,8 @@
 
 grpc_cc_test(
     name = "timer_list_test",
-    srcs = ["timer_list_test.c"],
-    language = "C",
+    srcs = ["timer_list_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -254,8 +254,8 @@
 
 grpc_cc_test(
     name = "udp_server_test",
-    srcs = ["udp_server_test.c"],
-    language = "C",
+    srcs = ["udp_server_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -266,8 +266,8 @@
 
 grpc_cc_test(
     name = "wakeup_fd_cv_test",
-    srcs = ["wakeup_fd_cv_test.c"],
-    language = "C",
+    srcs = ["wakeup_fd_cv_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/iomgr/combiner_test.c b/test/core/iomgr/combiner_test.c
deleted file mode 100644
index 38f512d..0000000
--- a/test/core/iomgr/combiner_test.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/combiner.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-
-#include "test/core/util/test_config.h"
-
-static void test_no_op(void) {
-  gpr_log(GPR_DEBUG, "test_no_op");
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GRPC_COMBINER_UNREF(&exec_ctx, grpc_combiner_create(), "test_no_op");
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void set_event_to_true(grpc_exec_ctx *exec_ctx, void *value,
-                              grpc_error *error) {
-  gpr_event_set(value, (void *)1);
-}
-
-static void test_execute_one(void) {
-  gpr_log(GPR_DEBUG, "test_execute_one");
-
-  grpc_combiner *lock = grpc_combiner_create();
-  gpr_event done;
-  gpr_event_init(&done);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GRPC_CLOSURE_SCHED(&exec_ctx,
-                     GRPC_CLOSURE_CREATE(set_event_to_true, &done,
-                                         grpc_combiner_scheduler(lock)),
-                     GRPC_ERROR_NONE);
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(gpr_event_wait(&done, grpc_timeout_seconds_to_deadline(5)) !=
-             NULL);
-  GRPC_COMBINER_UNREF(&exec_ctx, lock, "test_execute_one");
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-typedef struct {
-  size_t ctr;
-  grpc_combiner *lock;
-  gpr_event done;
-} thd_args;
-
-typedef struct {
-  size_t *ctr;
-  size_t value;
-} ex_args;
-
-static void check_one(grpc_exec_ctx *exec_ctx, void *a, grpc_error *error) {
-  ex_args *args = a;
-  GPR_ASSERT(*args->ctr == args->value - 1);
-  *args->ctr = args->value;
-  gpr_free(a);
-}
-
-static void execute_many_loop(void *a) {
-  thd_args *args = a;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  size_t n = 1;
-  for (size_t i = 0; i < 10; i++) {
-    for (size_t j = 0; j < 10000; j++) {
-      ex_args *c = gpr_malloc(sizeof(*c));
-      c->ctr = &args->ctr;
-      c->value = n++;
-      GRPC_CLOSURE_SCHED(&exec_ctx,
-                         GRPC_CLOSURE_CREATE(
-                             check_one, c, grpc_combiner_scheduler(args->lock)),
-                         GRPC_ERROR_NONE);
-      grpc_exec_ctx_flush(&exec_ctx);
-    }
-    // sleep for a little bit, to test a combiner draining and another thread
-    // picking it up
-    gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100));
-  }
-  GRPC_CLOSURE_SCHED(&exec_ctx,
-                     GRPC_CLOSURE_CREATE(set_event_to_true, &args->done,
-                                         grpc_combiner_scheduler(args->lock)),
-                     GRPC_ERROR_NONE);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_execute_many(void) {
-  gpr_log(GPR_DEBUG, "test_execute_many");
-
-  grpc_combiner *lock = grpc_combiner_create();
-  gpr_thd_id thds[100];
-  thd_args ta[GPR_ARRAY_SIZE(thds)];
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
-    gpr_thd_options options = gpr_thd_options_default();
-    gpr_thd_options_set_joinable(&options);
-    ta[i].ctr = 0;
-    ta[i].lock = lock;
-    gpr_event_init(&ta[i].done);
-    GPR_ASSERT(gpr_thd_new(&thds[i], execute_many_loop, &ta[i], &options));
-  }
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
-    GPR_ASSERT(gpr_event_wait(&ta[i].done,
-                              gpr_inf_future(GPR_CLOCK_REALTIME)) != NULL);
-    gpr_thd_join(thds[i]);
-  }
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GRPC_COMBINER_UNREF(&exec_ctx, lock, "test_execute_many");
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static gpr_event got_in_finally;
-
-static void in_finally(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  gpr_event_set(&got_in_finally, (void *)1);
-}
-
-static void add_finally(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  GRPC_CLOSURE_SCHED(exec_ctx,
-                     GRPC_CLOSURE_CREATE(in_finally, arg,
-                                         grpc_combiner_finally_scheduler(arg)),
-                     GRPC_ERROR_NONE);
-}
-
-static void test_execute_finally(void) {
-  gpr_log(GPR_DEBUG, "test_execute_finally");
-
-  grpc_combiner *lock = grpc_combiner_create();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  gpr_event_init(&got_in_finally);
-  GRPC_CLOSURE_SCHED(
-      &exec_ctx,
-      GRPC_CLOSURE_CREATE(add_finally, lock, grpc_combiner_scheduler(lock)),
-      GRPC_ERROR_NONE);
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(gpr_event_wait(&got_in_finally,
-                            grpc_timeout_seconds_to_deadline(5)) != NULL);
-  GRPC_COMBINER_UNREF(&exec_ctx, lock, "test_execute_finally");
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_no_op();
-  test_execute_one();
-  test_execute_finally();
-  test_execute_many();
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/iomgr/combiner_test.cc b/test/core/iomgr/combiner_test.cc
new file mode 100644
index 0000000..5a82536
--- /dev/null
+++ b/test/core/iomgr/combiner_test.cc
@@ -0,0 +1,168 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/combiner.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/util/test_config.h"
+
+static void test_no_op(void) {
+  gpr_log(GPR_DEBUG, "test_no_op");
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GRPC_COMBINER_UNREF(&exec_ctx, grpc_combiner_create(), "test_no_op");
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void set_event_to_true(grpc_exec_ctx* exec_ctx, void* value,
+                              grpc_error* error) {
+  gpr_event_set(static_cast<gpr_event*>(value), (void*)1);
+}
+
+static void test_execute_one(void) {
+  gpr_log(GPR_DEBUG, "test_execute_one");
+
+  grpc_combiner* lock = grpc_combiner_create();
+  gpr_event done;
+  gpr_event_init(&done);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GRPC_CLOSURE_SCHED(&exec_ctx,
+                     GRPC_CLOSURE_CREATE(set_event_to_true, &done,
+                                         grpc_combiner_scheduler(lock)),
+                     GRPC_ERROR_NONE);
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(gpr_event_wait(&done, grpc_timeout_seconds_to_deadline(5)) !=
+             NULL);
+  GRPC_COMBINER_UNREF(&exec_ctx, lock, "test_execute_one");
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+typedef struct {
+  size_t ctr;
+  grpc_combiner* lock;
+  gpr_event done;
+} thd_args;
+
+typedef struct {
+  size_t* ctr;
+  size_t value;
+} ex_args;
+
+static void check_one(grpc_exec_ctx* exec_ctx, void* a, grpc_error* error) {
+  ex_args* args = static_cast<ex_args*>(a);
+  GPR_ASSERT(*args->ctr == args->value - 1);
+  *args->ctr = args->value;
+  gpr_free(a);
+}
+
+static void execute_many_loop(void* a) {
+  thd_args* args = static_cast<thd_args*>(a);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  size_t n = 1;
+  for (size_t i = 0; i < 10; i++) {
+    for (size_t j = 0; j < 10000; j++) {
+      ex_args* c = static_cast<ex_args*>(gpr_malloc(sizeof(*c)));
+      c->ctr = &args->ctr;
+      c->value = n++;
+      GRPC_CLOSURE_SCHED(&exec_ctx,
+                         GRPC_CLOSURE_CREATE(
+                             check_one, c, grpc_combiner_scheduler(args->lock)),
+                         GRPC_ERROR_NONE);
+      grpc_exec_ctx_flush(&exec_ctx);
+    }
+    // sleep for a little bit, to test a combiner draining and another thread
+    // picking it up
+    gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100));
+  }
+  GRPC_CLOSURE_SCHED(&exec_ctx,
+                     GRPC_CLOSURE_CREATE(set_event_to_true, &args->done,
+                                         grpc_combiner_scheduler(args->lock)),
+                     GRPC_ERROR_NONE);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_execute_many(void) {
+  gpr_log(GPR_DEBUG, "test_execute_many");
+
+  grpc_combiner* lock = grpc_combiner_create();
+  gpr_thd_id thds[100];
+  thd_args ta[GPR_ARRAY_SIZE(thds)];
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
+    gpr_thd_options options = gpr_thd_options_default();
+    gpr_thd_options_set_joinable(&options);
+    ta[i].ctr = 0;
+    ta[i].lock = lock;
+    gpr_event_init(&ta[i].done);
+    GPR_ASSERT(gpr_thd_new(&thds[i], execute_many_loop, &ta[i], &options));
+  }
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
+    GPR_ASSERT(gpr_event_wait(&ta[i].done,
+                              gpr_inf_future(GPR_CLOCK_REALTIME)) != NULL);
+    gpr_thd_join(thds[i]);
+  }
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GRPC_COMBINER_UNREF(&exec_ctx, lock, "test_execute_many");
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static gpr_event got_in_finally;
+
+static void in_finally(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  gpr_event_set(&got_in_finally, (void*)1);
+}
+
+static void add_finally(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  GRPC_CLOSURE_SCHED(exec_ctx,
+                     GRPC_CLOSURE_CREATE(in_finally, arg,
+                                         grpc_combiner_finally_scheduler(
+                                             static_cast<grpc_combiner*>(arg))),
+                     GRPC_ERROR_NONE);
+}
+
+static void test_execute_finally(void) {
+  gpr_log(GPR_DEBUG, "test_execute_finally");
+
+  grpc_combiner* lock = grpc_combiner_create();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  gpr_event_init(&got_in_finally);
+  GRPC_CLOSURE_SCHED(
+      &exec_ctx,
+      GRPC_CLOSURE_CREATE(add_finally, lock, grpc_combiner_scheduler(lock)),
+      GRPC_ERROR_NONE);
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(gpr_event_wait(&got_in_finally,
+                            grpc_timeout_seconds_to_deadline(5)) != NULL);
+  GRPC_COMBINER_UNREF(&exec_ctx, lock, "test_execute_finally");
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_no_op();
+  test_execute_one();
+  test_execute_finally();
+  test_execute_many();
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/iomgr/endpoint_pair_test.c b/test/core/iomgr/endpoint_pair_test.c
deleted file mode 100644
index f2ce3d0..0000000
--- a/test/core/iomgr/endpoint_pair_test.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/iomgr/endpoint_tests.h"
-#include "test/core/util/test_config.h"
-
-static gpr_mu *g_mu;
-static grpc_pollset *g_pollset;
-
-static void clean_up(void) {}
-
-static grpc_endpoint_test_fixture create_fixture_endpoint_pair(
-    size_t slice_size) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_test_fixture f;
-  grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = (int)slice_size}};
-  grpc_channel_args args = {.num_args = GPR_ARRAY_SIZE(a), .args = a};
-  grpc_endpoint_pair p = grpc_iomgr_create_endpoint_pair("test", &args);
-
-  f.client_ep = p.client;
-  f.server_ep = p.server;
-  grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset);
-  grpc_endpoint_add_to_pollset(&exec_ctx, f.server_ep, g_pollset);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  return f;
-}
-
-static grpc_endpoint_test_config configs[] = {
-    {"tcp/tcp_socketpair", create_fixture_endpoint_pair, clean_up},
-};
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, p);
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_test_init(argc, argv);
-  grpc_init();
-  g_pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(g_pollset, &g_mu);
-  grpc_endpoint_tests(configs[0], g_pollset, g_mu);
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  gpr_free(g_pollset);
-
-  return 0;
-}
diff --git a/test/core/iomgr/endpoint_pair_test.cc b/test/core/iomgr/endpoint_pair_test.cc
new file mode 100644
index 0000000..30a0cb5
--- /dev/null
+++ b/test/core/iomgr/endpoint_pair_test.cc
@@ -0,0 +1,78 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/iomgr/endpoint_tests.h"
+#include "test/core/util/test_config.h"
+
+static gpr_mu* g_mu;
+static grpc_pollset* g_pollset;
+
+static void clean_up(void) {}
+
+static grpc_endpoint_test_fixture create_fixture_endpoint_pair(
+    size_t slice_size) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_test_fixture f;
+  grpc_arg a[1];
+  a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
+  a[0].type = GRPC_ARG_INTEGER;
+  a[0].value.integer = (int)slice_size;
+  grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
+  grpc_endpoint_pair p = grpc_iomgr_create_endpoint_pair("test", &args);
+
+  f.client_ep = p.client;
+  f.server_ep = p.server;
+  grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset);
+  grpc_endpoint_add_to_pollset(&exec_ctx, f.server_ep, g_pollset);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  return f;
+}
+
+static grpc_endpoint_test_config configs[] = {
+    {"tcp/tcp_socketpair", create_fixture_endpoint_pair, clean_up},
+};
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(p));
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_test_init(argc, argv);
+  grpc_init();
+  g_pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(g_pollset, &g_mu);
+  grpc_endpoint_tests(configs[0], g_pollset, g_mu);
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  gpr_free(g_pollset);
+
+  return 0;
+}
diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c
deleted file mode 100644
index 61e901f..0000000
--- a/test/core/iomgr/endpoint_tests.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/iomgr/endpoint_tests.h"
-
-#include <stdbool.h>
-#include <sys/types.h>
-
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-#include "test/core/util/test_config.h"
-
-/*
-   General test notes:
-
-   All tests which write data into an endpoint write i%256 into byte i, which
-   is verified by readers.
-
-   In general there are a few interesting things to vary which may lead to
-   exercising different codepaths in an implementation:
-   1. Total amount of data written to the endpoint
-   2. Size of slice allocations
-   3. Amount of data we read from or write to the endpoint at once
-
-   The tests here tend to parameterize these where applicable.
-
-*/
-
-static gpr_mu *g_mu;
-static grpc_pollset *g_pollset;
-
-size_t count_slices(grpc_slice *slices, size_t nslices, int *current_data) {
-  size_t num_bytes = 0;
-  size_t i;
-  size_t j;
-  unsigned char *buf;
-  for (i = 0; i < nslices; ++i) {
-    buf = GRPC_SLICE_START_PTR(slices[i]);
-    for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
-      GPR_ASSERT(buf[j] == *current_data);
-      *current_data = (*current_data + 1) % 256;
-    }
-    num_bytes += GRPC_SLICE_LENGTH(slices[i]);
-  }
-  return num_bytes;
-}
-
-static grpc_endpoint_test_fixture begin_test(grpc_endpoint_test_config config,
-                                             const char *test_name,
-                                             size_t slice_size) {
-  gpr_log(GPR_INFO, "%s/%s", test_name, config.name);
-  return config.create_fixture(slice_size);
-}
-
-static void end_test(grpc_endpoint_test_config config) { config.clean_up(); }
-
-static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
-                                   size_t *num_blocks, uint8_t *current_data) {
-  size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0);
-  grpc_slice *slices = (grpc_slice *)gpr_malloc(sizeof(grpc_slice) * nslices);
-  size_t num_bytes_left = num_bytes;
-  size_t i;
-  size_t j;
-  unsigned char *buf;
-  *num_blocks = nslices;
-
-  for (i = 0; i < nslices; ++i) {
-    slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
-                                                              : slice_size);
-    num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]);
-    buf = GRPC_SLICE_START_PTR(slices[i]);
-    for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
-      buf[j] = *current_data;
-      (*current_data)++;
-    }
-  }
-  GPR_ASSERT(num_bytes_left == 0);
-  return slices;
-}
-
-struct read_and_write_test_state {
-  grpc_endpoint *read_ep;
-  grpc_endpoint *write_ep;
-  size_t target_bytes;
-  size_t bytes_read;
-  size_t current_write_size;
-  size_t bytes_written;
-  int current_read_data;
-  uint8_t current_write_data;
-  int read_done;
-  int write_done;
-  grpc_slice_buffer incoming;
-  grpc_slice_buffer outgoing;
-  grpc_closure done_read;
-  grpc_closure done_write;
-};
-
-static void read_and_write_test_read_handler(grpc_exec_ctx *exec_ctx,
-                                             void *data, grpc_error *error) {
-  struct read_and_write_test_state *state =
-      (struct read_and_write_test_state *)data;
-
-  state->bytes_read += count_slices(
-      state->incoming.slices, state->incoming.count, &state->current_read_data);
-  if (state->bytes_read == state->target_bytes || error != GRPC_ERROR_NONE) {
-    gpr_log(GPR_INFO, "Read handler done");
-    gpr_mu_lock(g_mu);
-    state->read_done = 1 + (error == GRPC_ERROR_NONE);
-    GRPC_LOG_IF_ERROR("pollset_kick",
-                      grpc_pollset_kick(exec_ctx, g_pollset, NULL));
-    gpr_mu_unlock(g_mu);
-  } else if (error == GRPC_ERROR_NONE) {
-    grpc_endpoint_read(exec_ctx, state->read_ep, &state->incoming,
-                       &state->done_read);
-  }
-}
-
-static void read_and_write_test_write_handler(grpc_exec_ctx *exec_ctx,
-                                              void *data, grpc_error *error) {
-  struct read_and_write_test_state *state =
-      (struct read_and_write_test_state *)data;
-  grpc_slice *slices = NULL;
-  size_t nslices;
-
-  if (error == GRPC_ERROR_NONE) {
-    state->bytes_written += state->current_write_size;
-    if (state->target_bytes - state->bytes_written <
-        state->current_write_size) {
-      state->current_write_size = state->target_bytes - state->bytes_written;
-    }
-    if (state->current_write_size != 0) {
-      slices = allocate_blocks(state->current_write_size, 8192, &nslices,
-                               &state->current_write_data);
-      grpc_slice_buffer_reset_and_unref(&state->outgoing);
-      grpc_slice_buffer_addn(&state->outgoing, slices, nslices);
-      grpc_endpoint_write(exec_ctx, state->write_ep, &state->outgoing,
-                          &state->done_write);
-      gpr_free(slices);
-      return;
-    }
-  }
-
-  gpr_log(GPR_INFO, "Write handler done");
-  gpr_mu_lock(g_mu);
-  state->write_done = 1 + (error == GRPC_ERROR_NONE);
-  GRPC_LOG_IF_ERROR("pollset_kick",
-                    grpc_pollset_kick(exec_ctx, g_pollset, NULL));
-  gpr_mu_unlock(g_mu);
-}
-
-/* Do both reading and writing using the grpc_endpoint API.
-
-   This also includes a test of the shutdown behavior.
- */
-static void read_and_write_test(grpc_endpoint_test_config config,
-                                size_t num_bytes, size_t write_size,
-                                size_t slice_size, bool shutdown) {
-  struct read_and_write_test_state state;
-  grpc_endpoint_test_fixture f =
-      begin_test(config, "read_and_write_test", slice_size);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_millis deadline =
-      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
-  gpr_log(GPR_DEBUG, "num_bytes=%" PRIuPTR " write_size=%" PRIuPTR
-                     " slice_size=%" PRIuPTR " shutdown=%d",
-          num_bytes, write_size, slice_size, shutdown);
-
-  if (shutdown) {
-    gpr_log(GPR_INFO, "Start read and write shutdown test");
-  } else {
-    gpr_log(GPR_INFO, "Start read and write test with %" PRIuPTR
-                      " bytes, slice size %" PRIuPTR,
-            num_bytes, slice_size);
-  }
-
-  state.read_ep = f.client_ep;
-  state.write_ep = f.server_ep;
-  state.target_bytes = num_bytes;
-  state.bytes_read = 0;
-  state.current_write_size = write_size;
-  state.bytes_written = 0;
-  state.read_done = 0;
-  state.write_done = 0;
-  state.current_read_data = 0;
-  state.current_write_data = 0;
-  GRPC_CLOSURE_INIT(&state.done_read, read_and_write_test_read_handler, &state,
-                    grpc_schedule_on_exec_ctx);
-  GRPC_CLOSURE_INIT(&state.done_write, read_and_write_test_write_handler,
-                    &state, grpc_schedule_on_exec_ctx);
-  grpc_slice_buffer_init(&state.outgoing);
-  grpc_slice_buffer_init(&state.incoming);
-
-  /* Get started by pretending an initial write completed */
-  /* NOTE: Sets up initial conditions so we can have the same write handler
-     for the first iteration as for later iterations. It does the right thing
-     even when bytes_written is unsigned. */
-  state.bytes_written -= state.current_write_size;
-  read_and_write_test_write_handler(&exec_ctx, &state, GRPC_ERROR_NONE);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  grpc_endpoint_read(&exec_ctx, state.read_ep, &state.incoming,
-                     &state.done_read);
-
-  if (shutdown) {
-    gpr_log(GPR_DEBUG, "shutdown read");
-    grpc_endpoint_shutdown(
-        &exec_ctx, state.read_ep,
-        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
-    gpr_log(GPR_DEBUG, "shutdown write");
-    grpc_endpoint_shutdown(
-        &exec_ctx, state.write_ep,
-        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
-  }
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  gpr_mu_lock(g_mu);
-  while (!state.read_done || !state.write_done) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(grpc_exec_ctx_now(&exec_ctx) < deadline);
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
-  }
-  gpr_mu_unlock(g_mu);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  end_test(config);
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.outgoing);
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.incoming);
-  grpc_endpoint_destroy(&exec_ctx, state.read_ep);
-  grpc_endpoint_destroy(&exec_ctx, state.write_ep);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void inc_on_failure(grpc_exec_ctx *exec_ctx, void *arg,
-                           grpc_error *error) {
-  gpr_mu_lock(g_mu);
-  *(int *)arg += (error != GRPC_ERROR_NONE);
-  GPR_ASSERT(
-      GRPC_LOG_IF_ERROR("kick", grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-static void wait_for_fail_count(grpc_exec_ctx *exec_ctx, int *fail_count,
-                                int want_fail_count) {
-  grpc_exec_ctx_flush(exec_ctx);
-  gpr_mu_lock(g_mu);
-  grpc_millis deadline =
-      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
-  while (grpc_exec_ctx_now(exec_ctx) < deadline &&
-         *fail_count < want_fail_count) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(exec_ctx, g_pollset, &worker, deadline)));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_flush(exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  GPR_ASSERT(*fail_count == want_fail_count);
-  gpr_mu_unlock(g_mu);
-}
-
-static void multiple_shutdown_test(grpc_endpoint_test_config config) {
-  grpc_endpoint_test_fixture f =
-      begin_test(config, "multiple_shutdown_test", 128);
-  int fail_count = 0;
-
-  grpc_slice_buffer slice_buffer;
-  grpc_slice_buffer_init(&slice_buffer);
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset);
-  grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer,
-                     GRPC_CLOSURE_CREATE(inc_on_failure, &fail_count,
-                                         grpc_schedule_on_exec_ctx));
-  wait_for_fail_count(&exec_ctx, &fail_count, 0);
-  grpc_endpoint_shutdown(&exec_ctx, f.client_ep,
-                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
-  wait_for_fail_count(&exec_ctx, &fail_count, 1);
-  grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer,
-                     GRPC_CLOSURE_CREATE(inc_on_failure, &fail_count,
-                                         grpc_schedule_on_exec_ctx));
-  wait_for_fail_count(&exec_ctx, &fail_count, 2);
-  grpc_slice_buffer_add(&slice_buffer, grpc_slice_from_copied_string("a"));
-  grpc_endpoint_write(&exec_ctx, f.client_ep, &slice_buffer,
-                      GRPC_CLOSURE_CREATE(inc_on_failure, &fail_count,
-                                          grpc_schedule_on_exec_ctx));
-  wait_for_fail_count(&exec_ctx, &fail_count, 3);
-  grpc_endpoint_shutdown(&exec_ctx, f.client_ep,
-                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
-  wait_for_fail_count(&exec_ctx, &fail_count, 3);
-
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &slice_buffer);
-
-  grpc_endpoint_destroy(&exec_ctx, f.client_ep);
-  grpc_endpoint_destroy(&exec_ctx, f.server_ep);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-void grpc_endpoint_tests(grpc_endpoint_test_config config,
-                         grpc_pollset *pollset, gpr_mu *mu) {
-  size_t i;
-  g_pollset = pollset;
-  g_mu = mu;
-  multiple_shutdown_test(config);
-  read_and_write_test(config, 10000000, 100000, 8192, false);
-  read_and_write_test(config, 1000000, 100000, 1, false);
-  read_and_write_test(config, 100000000, 100000, 1, true);
-  for (i = 1; i < 1000; i = GPR_MAX(i + 1, i * 5 / 4)) {
-    read_and_write_test(config, 40320, i, i, false);
-  }
-  g_pollset = NULL;
-  g_mu = NULL;
-}
diff --git a/test/core/iomgr/endpoint_tests.cc b/test/core/iomgr/endpoint_tests.cc
new file mode 100644
index 0000000..8e859ba
--- /dev/null
+++ b/test/core/iomgr/endpoint_tests.cc
@@ -0,0 +1,337 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/iomgr/endpoint_tests.h"
+
+#include <stdbool.h>
+#include <sys/types.h>
+
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+#include "test/core/util/test_config.h"
+
+/*
+   General test notes:
+
+   All tests which write data into an endpoint write i%256 into byte i, which
+   is verified by readers.
+
+   In general there are a few interesting things to vary which may lead to
+   exercising different codepaths in an implementation:
+   1. Total amount of data written to the endpoint
+   2. Size of slice allocations
+   3. Amount of data we read from or write to the endpoint at once
+
+   The tests here tend to parameterize these where applicable.
+
+*/
+
+static gpr_mu* g_mu;
+static grpc_pollset* g_pollset;
+
+size_t count_slices(grpc_slice* slices, size_t nslices, int* current_data) {
+  size_t num_bytes = 0;
+  size_t i;
+  size_t j;
+  unsigned char* buf;
+  for (i = 0; i < nslices; ++i) {
+    buf = GRPC_SLICE_START_PTR(slices[i]);
+    for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
+      GPR_ASSERT(buf[j] == *current_data);
+      *current_data = (*current_data + 1) % 256;
+    }
+    num_bytes += GRPC_SLICE_LENGTH(slices[i]);
+  }
+  return num_bytes;
+}
+
+static grpc_endpoint_test_fixture begin_test(grpc_endpoint_test_config config,
+                                             const char* test_name,
+                                             size_t slice_size) {
+  gpr_log(GPR_INFO, "%s/%s", test_name, config.name);
+  return config.create_fixture(slice_size);
+}
+
+static void end_test(grpc_endpoint_test_config config) { config.clean_up(); }
+
+static grpc_slice* allocate_blocks(size_t num_bytes, size_t slice_size,
+                                   size_t* num_blocks, uint8_t* current_data) {
+  size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1 : 0);
+  grpc_slice* slices = (grpc_slice*)gpr_malloc(sizeof(grpc_slice) * nslices);
+  size_t num_bytes_left = num_bytes;
+  size_t i;
+  size_t j;
+  unsigned char* buf;
+  *num_blocks = nslices;
+
+  for (i = 0; i < nslices; ++i) {
+    slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
+                                                              : slice_size);
+    num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]);
+    buf = GRPC_SLICE_START_PTR(slices[i]);
+    for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
+      buf[j] = *current_data;
+      (*current_data)++;
+    }
+  }
+  GPR_ASSERT(num_bytes_left == 0);
+  return slices;
+}
+
+struct read_and_write_test_state {
+  grpc_endpoint* read_ep;
+  grpc_endpoint* write_ep;
+  size_t target_bytes;
+  size_t bytes_read;
+  size_t current_write_size;
+  size_t bytes_written;
+  int current_read_data;
+  uint8_t current_write_data;
+  int read_done;
+  int write_done;
+  grpc_slice_buffer incoming;
+  grpc_slice_buffer outgoing;
+  grpc_closure done_read;
+  grpc_closure done_write;
+};
+
+static void read_and_write_test_read_handler(grpc_exec_ctx* exec_ctx,
+                                             void* data, grpc_error* error) {
+  struct read_and_write_test_state* state =
+      (struct read_and_write_test_state*)data;
+
+  state->bytes_read += count_slices(
+      state->incoming.slices, state->incoming.count, &state->current_read_data);
+  if (state->bytes_read == state->target_bytes || error != GRPC_ERROR_NONE) {
+    gpr_log(GPR_INFO, "Read handler done");
+    gpr_mu_lock(g_mu);
+    state->read_done = 1 + (error == GRPC_ERROR_NONE);
+    GRPC_LOG_IF_ERROR("pollset_kick",
+                      grpc_pollset_kick(exec_ctx, g_pollset, NULL));
+    gpr_mu_unlock(g_mu);
+  } else if (error == GRPC_ERROR_NONE) {
+    grpc_endpoint_read(exec_ctx, state->read_ep, &state->incoming,
+                       &state->done_read);
+  }
+}
+
+static void read_and_write_test_write_handler(grpc_exec_ctx* exec_ctx,
+                                              void* data, grpc_error* error) {
+  struct read_and_write_test_state* state =
+      (struct read_and_write_test_state*)data;
+  grpc_slice* slices = NULL;
+  size_t nslices;
+
+  if (error == GRPC_ERROR_NONE) {
+    state->bytes_written += state->current_write_size;
+    if (state->target_bytes - state->bytes_written <
+        state->current_write_size) {
+      state->current_write_size = state->target_bytes - state->bytes_written;
+    }
+    if (state->current_write_size != 0) {
+      slices = allocate_blocks(state->current_write_size, 8192, &nslices,
+                               &state->current_write_data);
+      grpc_slice_buffer_reset_and_unref(&state->outgoing);
+      grpc_slice_buffer_addn(&state->outgoing, slices, nslices);
+      grpc_endpoint_write(exec_ctx, state->write_ep, &state->outgoing,
+                          &state->done_write);
+      gpr_free(slices);
+      return;
+    }
+  }
+
+  gpr_log(GPR_INFO, "Write handler done");
+  gpr_mu_lock(g_mu);
+  state->write_done = 1 + (error == GRPC_ERROR_NONE);
+  GRPC_LOG_IF_ERROR("pollset_kick",
+                    grpc_pollset_kick(exec_ctx, g_pollset, NULL));
+  gpr_mu_unlock(g_mu);
+}
+
+/* Do both reading and writing using the grpc_endpoint API.
+
+   This also includes a test of the shutdown behavior.
+ */
+static void read_and_write_test(grpc_endpoint_test_config config,
+                                size_t num_bytes, size_t write_size,
+                                size_t slice_size, bool shutdown) {
+  struct read_and_write_test_state state;
+  grpc_endpoint_test_fixture f =
+      begin_test(config, "read_and_write_test", slice_size);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_millis deadline =
+      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
+  gpr_log(GPR_DEBUG,
+          "num_bytes=%" PRIuPTR " write_size=%" PRIuPTR " slice_size=%" PRIuPTR
+          " shutdown=%d",
+          num_bytes, write_size, slice_size, shutdown);
+
+  if (shutdown) {
+    gpr_log(GPR_INFO, "Start read and write shutdown test");
+  } else {
+    gpr_log(GPR_INFO,
+            "Start read and write test with %" PRIuPTR
+            " bytes, slice size %" PRIuPTR,
+            num_bytes, slice_size);
+  }
+
+  state.read_ep = f.client_ep;
+  state.write_ep = f.server_ep;
+  state.target_bytes = num_bytes;
+  state.bytes_read = 0;
+  state.current_write_size = write_size;
+  state.bytes_written = 0;
+  state.read_done = 0;
+  state.write_done = 0;
+  state.current_read_data = 0;
+  state.current_write_data = 0;
+  GRPC_CLOSURE_INIT(&state.done_read, read_and_write_test_read_handler, &state,
+                    grpc_schedule_on_exec_ctx);
+  GRPC_CLOSURE_INIT(&state.done_write, read_and_write_test_write_handler,
+                    &state, grpc_schedule_on_exec_ctx);
+  grpc_slice_buffer_init(&state.outgoing);
+  grpc_slice_buffer_init(&state.incoming);
+
+  /* Get started by pretending an initial write completed */
+  /* NOTE: Sets up initial conditions so we can have the same write handler
+     for the first iteration as for later iterations. It does the right thing
+     even when bytes_written is unsigned. */
+  state.bytes_written -= state.current_write_size;
+  read_and_write_test_write_handler(&exec_ctx, &state, GRPC_ERROR_NONE);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  grpc_endpoint_read(&exec_ctx, state.read_ep, &state.incoming,
+                     &state.done_read);
+
+  if (shutdown) {
+    gpr_log(GPR_DEBUG, "shutdown read");
+    grpc_endpoint_shutdown(
+        &exec_ctx, state.read_ep,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
+    gpr_log(GPR_DEBUG, "shutdown write");
+    grpc_endpoint_shutdown(
+        &exec_ctx, state.write_ep,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
+  }
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  gpr_mu_lock(g_mu);
+  while (!state.read_done || !state.write_done) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(grpc_exec_ctx_now(&exec_ctx) < deadline);
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
+  }
+  gpr_mu_unlock(g_mu);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  end_test(config);
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.outgoing);
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.incoming);
+  grpc_endpoint_destroy(&exec_ctx, state.read_ep);
+  grpc_endpoint_destroy(&exec_ctx, state.write_ep);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void inc_on_failure(grpc_exec_ctx* exec_ctx, void* arg,
+                           grpc_error* error) {
+  gpr_mu_lock(g_mu);
+  *(int*)arg += (error != GRPC_ERROR_NONE);
+  GPR_ASSERT(
+      GRPC_LOG_IF_ERROR("kick", grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+static void wait_for_fail_count(grpc_exec_ctx* exec_ctx, int* fail_count,
+                                int want_fail_count) {
+  grpc_exec_ctx_flush(exec_ctx);
+  gpr_mu_lock(g_mu);
+  grpc_millis deadline =
+      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
+  while (grpc_exec_ctx_now(exec_ctx) < deadline &&
+         *fail_count < want_fail_count) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(exec_ctx, g_pollset, &worker, deadline)));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_flush(exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  GPR_ASSERT(*fail_count == want_fail_count);
+  gpr_mu_unlock(g_mu);
+}
+
+static void multiple_shutdown_test(grpc_endpoint_test_config config) {
+  grpc_endpoint_test_fixture f =
+      begin_test(config, "multiple_shutdown_test", 128);
+  int fail_count = 0;
+
+  grpc_slice_buffer slice_buffer;
+  grpc_slice_buffer_init(&slice_buffer);
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset);
+  grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer,
+                     GRPC_CLOSURE_CREATE(inc_on_failure, &fail_count,
+                                         grpc_schedule_on_exec_ctx));
+  wait_for_fail_count(&exec_ctx, &fail_count, 0);
+  grpc_endpoint_shutdown(&exec_ctx, f.client_ep,
+                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
+  wait_for_fail_count(&exec_ctx, &fail_count, 1);
+  grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer,
+                     GRPC_CLOSURE_CREATE(inc_on_failure, &fail_count,
+                                         grpc_schedule_on_exec_ctx));
+  wait_for_fail_count(&exec_ctx, &fail_count, 2);
+  grpc_slice_buffer_add(&slice_buffer, grpc_slice_from_copied_string("a"));
+  grpc_endpoint_write(&exec_ctx, f.client_ep, &slice_buffer,
+                      GRPC_CLOSURE_CREATE(inc_on_failure, &fail_count,
+                                          grpc_schedule_on_exec_ctx));
+  wait_for_fail_count(&exec_ctx, &fail_count, 3);
+  grpc_endpoint_shutdown(&exec_ctx, f.client_ep,
+                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
+  wait_for_fail_count(&exec_ctx, &fail_count, 3);
+
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &slice_buffer);
+
+  grpc_endpoint_destroy(&exec_ctx, f.client_ep);
+  grpc_endpoint_destroy(&exec_ctx, f.server_ep);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+void grpc_endpoint_tests(grpc_endpoint_test_config config,
+                         grpc_pollset* pollset, gpr_mu* mu) {
+  size_t i;
+  g_pollset = pollset;
+  g_mu = mu;
+  multiple_shutdown_test(config);
+  read_and_write_test(config, 10000000, 100000, 8192, false);
+  read_and_write_test(config, 1000000, 100000, 1, false);
+  read_and_write_test(config, 100000000, 100000, 1, true);
+  for (i = 1; i < 1000; i = GPR_MAX(i + 1, i * 5 / 4)) {
+    read_and_write_test(config, 40320, i, i, false);
+  }
+  g_pollset = NULL;
+  g_mu = NULL;
+}
diff --git a/test/core/iomgr/endpoint_tests.h b/test/core/iomgr/endpoint_tests.h
index def29d3..227eeb9 100644
--- a/test/core/iomgr/endpoint_tests.h
+++ b/test/core/iomgr/endpoint_tests.h
@@ -27,17 +27,17 @@
 typedef struct grpc_endpoint_test_fixture grpc_endpoint_test_fixture;
 
 struct grpc_endpoint_test_fixture {
-  grpc_endpoint *client_ep;
-  grpc_endpoint *server_ep;
+  grpc_endpoint* client_ep;
+  grpc_endpoint* server_ep;
 };
 
 struct grpc_endpoint_test_config {
-  const char *name;
+  const char* name;
   grpc_endpoint_test_fixture (*create_fixture)(size_t slice_size);
   void (*clean_up)();
 };
 
 void grpc_endpoint_tests(grpc_endpoint_test_config config,
-                         grpc_pollset *pollset, gpr_mu *mu);
+                         grpc_pollset* pollset, gpr_mu* mu);
 
 #endif /* GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H */
diff --git a/test/core/iomgr/error_test.c b/test/core/iomgr/error_test.cc
similarity index 100%
rename from test/core/iomgr/error_test.c
rename to test/core/iomgr/error_test.cc
diff --git a/test/core/iomgr/ev_epollsig_linux_test.c b/test/core/iomgr/ev_epollsig_linux_test.c
deleted file mode 100644
index 37aadac..0000000
--- a/test/core/iomgr/ev_epollsig_linux_test.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include "src/core/lib/iomgr/port.h"
-
-/* This test only relevant on linux systems where epoll() is available */
-#ifdef GRPC_LINUX_EPOLL
-#include "src/core/lib/iomgr/ev_epollsig_linux.h"
-#include "src/core/lib/iomgr/ev_posix.h"
-
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/iomgr/iomgr.h"
-#include "test/core/util/test_config.h"
-
-typedef struct test_pollset {
-  grpc_pollset *pollset;
-  gpr_mu *mu;
-} test_pollset;
-
-typedef struct test_fd {
-  int inner_fd;
-  grpc_fd *fd;
-} test_fd;
-
-/* num_fds should be an even number */
-static void test_fd_init(test_fd *tfds, int *fds, int num_fds) {
-  int i;
-  int r;
-
-  /* Create some dummy file descriptors. Currently using pipe file descriptors
-   * for this test but we could use any other type of file descriptors. Also,
-   * since pipe() used in this test creates two fds in each call, num_fds should
-   * be an even number */
-  GPR_ASSERT((num_fds % 2) == 0);
-  for (i = 0; i < num_fds; i = i + 2) {
-    r = pipe(fds + i);
-    if (r != 0) {
-      gpr_log(GPR_ERROR, "Error in creating pipe. %d (%s)", errno,
-              strerror(errno));
-      return;
-    }
-  }
-
-  for (i = 0; i < num_fds; i++) {
-    tfds[i].inner_fd = fds[i];
-    tfds[i].fd = grpc_fd_create(fds[i], "test_fd");
-  }
-}
-
-static void test_fd_cleanup(grpc_exec_ctx *exec_ctx, test_fd *tfds,
-                            int num_fds) {
-  int release_fd;
-  int i;
-
-  for (i = 0; i < num_fds; i++) {
-    grpc_fd_shutdown(exec_ctx, tfds[i].fd,
-                     GRPC_ERROR_CREATE_FROM_STATIC_STRING("test_fd_cleanup"));
-    grpc_exec_ctx_flush(exec_ctx);
-
-    grpc_fd_orphan(exec_ctx, tfds[i].fd, NULL, &release_fd,
-                   false /* already_closed */, "test_fd_cleanup");
-    grpc_exec_ctx_flush(exec_ctx);
-
-    GPR_ASSERT(release_fd == tfds[i].inner_fd);
-    close(tfds[i].inner_fd);
-  }
-}
-
-static void test_pollset_init(test_pollset *pollsets, int num_pollsets) {
-  int i;
-  for (i = 0; i < num_pollsets; i++) {
-    pollsets[i].pollset = gpr_zalloc(grpc_pollset_size());
-    grpc_pollset_init(pollsets[i].pollset, &pollsets[i].mu);
-  }
-}
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, p);
-}
-
-static void test_pollset_cleanup(grpc_exec_ctx *exec_ctx,
-                                 test_pollset *pollsets, int num_pollsets) {
-  grpc_closure destroyed;
-  int i;
-
-  for (i = 0; i < num_pollsets; i++) {
-    GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, pollsets[i].pollset,
-                      grpc_schedule_on_exec_ctx);
-    grpc_pollset_shutdown(exec_ctx, pollsets[i].pollset, &destroyed);
-
-    grpc_exec_ctx_flush(exec_ctx);
-    gpr_free(pollsets[i].pollset);
-  }
-}
-
-/*
- * Cases to test:
- *  case 1) Polling islands of both fd and pollset are NULL
- *  case 2) Polling island of fd is NULL but that of pollset is not-NULL
- *  case 3) Polling island of fd is not-NULL but that of pollset is NULL
- *  case 4) Polling islands of both fd and pollset are not-NULL and:
- *     case 4.1) Polling islands of fd and pollset are equal
- *     case 4.2) Polling islands of fd and pollset are NOT-equal (This results
- *     in a merge)
- * */
-
-#define NUM_FDS 8
-#define NUM_POLLSETS 4
-
-static void test_add_fd_to_pollset() {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  test_fd tfds[NUM_FDS];
-  int fds[NUM_FDS];
-  test_pollset pollsets[NUM_POLLSETS];
-  void *expected_pi = NULL;
-  int i;
-
-  test_fd_init(tfds, fds, NUM_FDS);
-  test_pollset_init(pollsets, NUM_POLLSETS);
-
-  /*Step 1.
-   * Create three polling islands (This will exercise test case 1 and 2) with
-   * the following configuration:
-   *   polling island 0 = { fds:0,1,2, pollsets:0}
-   *   polling island 1 = { fds:3,4,   pollsets:1}
-   *   polling island 2 = { fds:5,6,7  pollsets:2}
-   *
-   *Step 2.
-   * Add pollset 3 to polling island 0 (by adding fds 0 and 1 to pollset 3)
-   * (This will exercise test cases 3 and 4.1). The configuration becomes:
-   *   polling island 0 = { fds:0,1,2, pollsets:0,3} <<< pollset 3 added here
-   *   polling island 1 = { fds:3,4,   pollsets:1}
-   *   polling island 2 = { fds:5,6,7  pollsets:2}
-   *
-   *Step 3.
-   * Merge polling islands 0 and 1 by adding fd 0 to pollset 1 (This will
-   * exercise test case 4.2). The configuration becomes:
-   *   polling island (merged) = {fds: 0,1,2,3,4, pollsets: 0,1,3}
-   *   polling island 2 = {fds: 5,6,7 pollsets: 2}
-   *
-   *Step 4.
-   * Finally do one more merge by adding fd 3 to pollset 2.
-   *   polling island (merged) = {fds: 0,1,2,3,4,5,6,7, pollsets: 0,1,2,3}
-   */
-
-  /* == Step 1 == */
-  for (i = 0; i <= 2; i++) {
-    grpc_pollset_add_fd(&exec_ctx, pollsets[0].pollset, tfds[i].fd);
-    grpc_exec_ctx_flush(&exec_ctx);
-  }
-
-  for (i = 3; i <= 4; i++) {
-    grpc_pollset_add_fd(&exec_ctx, pollsets[1].pollset, tfds[i].fd);
-    grpc_exec_ctx_flush(&exec_ctx);
-  }
-
-  for (i = 5; i <= 7; i++) {
-    grpc_pollset_add_fd(&exec_ctx, pollsets[2].pollset, tfds[i].fd);
-    grpc_exec_ctx_flush(&exec_ctx);
-  }
-
-  /* == Step 2 == */
-  for (i = 0; i <= 1; i++) {
-    grpc_pollset_add_fd(&exec_ctx, pollsets[3].pollset, tfds[i].fd);
-    grpc_exec_ctx_flush(&exec_ctx);
-  }
-
-  /* == Step 3 == */
-  grpc_pollset_add_fd(&exec_ctx, pollsets[1].pollset, tfds[0].fd);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* == Step 4 == */
-  grpc_pollset_add_fd(&exec_ctx, pollsets[2].pollset, tfds[3].fd);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* All polling islands are merged at this point */
-
-  /* Compare Fd:0's polling island with that of all other Fds */
-  expected_pi = grpc_fd_get_polling_island(tfds[0].fd);
-  for (i = 1; i < NUM_FDS; i++) {
-    GPR_ASSERT(grpc_are_polling_islands_equal(
-        expected_pi, grpc_fd_get_polling_island(tfds[i].fd)));
-  }
-
-  /* Compare Fd:0's polling island with that of all other pollsets */
-  for (i = 0; i < NUM_POLLSETS; i++) {
-    GPR_ASSERT(grpc_are_polling_islands_equal(
-        expected_pi, grpc_pollset_get_polling_island(pollsets[i].pollset)));
-  }
-
-  test_fd_cleanup(&exec_ctx, tfds, NUM_FDS);
-  test_pollset_cleanup(&exec_ctx, pollsets, NUM_POLLSETS);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-#undef NUM_FDS
-#undef NUM_POLLSETS
-
-typedef struct threading_shared {
-  gpr_mu *mu;
-  grpc_pollset *pollset;
-  grpc_wakeup_fd *wakeup_fd;
-  grpc_fd *wakeup_desc;
-  grpc_closure on_wakeup;
-  int wakeups;
-} threading_shared;
-
-static __thread int thread_wakeups = 0;
-
-static void test_threading_loop(void *arg) {
-  threading_shared *shared = arg;
-  while (thread_wakeups < 1000000) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_pollset_worker *worker;
-    gpr_mu_lock(shared->mu);
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work", grpc_pollset_work(&exec_ctx, shared->pollset, &worker,
-                                          GRPC_MILLIS_INF_FUTURE)));
-    gpr_mu_unlock(shared->mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static void test_threading_wakeup(grpc_exec_ctx *exec_ctx, void *arg,
-                                  grpc_error *error) {
-  threading_shared *shared = arg;
-  ++shared->wakeups;
-  ++thread_wakeups;
-  if (error == GRPC_ERROR_NONE) {
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "consume_wakeup", grpc_wakeup_fd_consume_wakeup(shared->wakeup_fd)));
-    grpc_fd_notify_on_read(exec_ctx, shared->wakeup_desc, &shared->on_wakeup);
-    GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_next",
-                                 grpc_wakeup_fd_wakeup(shared->wakeup_fd)));
-  }
-}
-
-static void test_threading(void) {
-  threading_shared shared;
-  shared.pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(shared.pollset, &shared.mu);
-
-  gpr_thd_id thds[10];
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
-    gpr_thd_options opt = gpr_thd_options_default();
-    gpr_thd_options_set_joinable(&opt);
-    gpr_thd_new(&thds[i], test_threading_loop, &shared, &opt);
-  }
-  grpc_wakeup_fd fd;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_fd_init", grpc_wakeup_fd_init(&fd)));
-  shared.wakeup_fd = &fd;
-  shared.wakeup_desc = grpc_fd_create(fd.read_fd, "wakeup");
-  shared.wakeups = 0;
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_pollset_add_fd(&exec_ctx, shared.pollset, shared.wakeup_desc);
-    grpc_fd_notify_on_read(
-        &exec_ctx, shared.wakeup_desc,
-        GRPC_CLOSURE_INIT(&shared.on_wakeup, test_threading_wakeup, &shared,
-                          grpc_schedule_on_exec_ctx));
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_first",
-                               grpc_wakeup_fd_wakeup(shared.wakeup_fd)));
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
-    gpr_thd_join(thds[i]);
-  }
-  fd.read_fd = 0;
-  grpc_wakeup_fd_destroy(&fd);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_fd_shutdown(&exec_ctx, shared.wakeup_desc, GRPC_ERROR_CANCELLED);
-    grpc_fd_orphan(&exec_ctx, shared.wakeup_desc, NULL, NULL,
-                   false /* already_closed */, "done");
-    grpc_pollset_shutdown(&exec_ctx, shared.pollset,
-                          GRPC_CLOSURE_CREATE(destroy_pollset, shared.pollset,
-                                              grpc_schedule_on_exec_ctx));
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  gpr_free(shared.pollset);
-}
-
-int main(int argc, char **argv) {
-  const char *poll_strategy = NULL;
-  grpc_test_init(argc, argv);
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  poll_strategy = grpc_get_poll_strategy_name();
-  if (poll_strategy != NULL && strcmp(poll_strategy, "epollsig") == 0) {
-    test_add_fd_to_pollset();
-    test_threading();
-  } else {
-    gpr_log(GPR_INFO,
-            "Skipping the test. The test is only relevant for 'epollsig' "
-            "strategy. and the current strategy is: '%s'",
-            poll_strategy);
-  }
-
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  return 0;
-}
-#else /* defined(GRPC_LINUX_EPOLL) */
-int main(int argc, char **argv) { return 0; }
-#endif /* !defined(GRPC_LINUX_EPOLL) */
diff --git a/test/core/iomgr/ev_epollsig_linux_test.cc b/test/core/iomgr/ev_epollsig_linux_test.cc
new file mode 100644
index 0000000..3ee607d
--- /dev/null
+++ b/test/core/iomgr/ev_epollsig_linux_test.cc
@@ -0,0 +1,331 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "src/core/lib/iomgr/port.h"
+
+/* This test only relevant on linux systems where epoll() is available */
+#ifdef GRPC_LINUX_EPOLL
+#include "src/core/lib/iomgr/ev_epollsig_linux.h"
+#include "src/core/lib/iomgr/ev_posix.h"
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/test_config.h"
+
+typedef struct test_pollset {
+  grpc_pollset* pollset;
+  gpr_mu* mu;
+} test_pollset;
+
+typedef struct test_fd {
+  int inner_fd;
+  grpc_fd* fd;
+} test_fd;
+
+/* num_fds should be an even number */
+static void test_fd_init(test_fd* tfds, int* fds, int num_fds) {
+  int i;
+  int r;
+
+  /* Create some dummy file descriptors. Currently using pipe file descriptors
+   * for this test but we could use any other type of file descriptors. Also,
+   * since pipe() used in this test creates two fds in each call, num_fds should
+   * be an even number */
+  GPR_ASSERT((num_fds % 2) == 0);
+  for (i = 0; i < num_fds; i = i + 2) {
+    r = pipe(fds + i);
+    if (r != 0) {
+      gpr_log(GPR_ERROR, "Error in creating pipe. %d (%s)", errno,
+              strerror(errno));
+      return;
+    }
+  }
+
+  for (i = 0; i < num_fds; i++) {
+    tfds[i].inner_fd = fds[i];
+    tfds[i].fd = grpc_fd_create(fds[i], "test_fd");
+  }
+}
+
+static void test_fd_cleanup(grpc_exec_ctx* exec_ctx, test_fd* tfds,
+                            int num_fds) {
+  int release_fd;
+  int i;
+
+  for (i = 0; i < num_fds; i++) {
+    grpc_fd_shutdown(exec_ctx, tfds[i].fd,
+                     GRPC_ERROR_CREATE_FROM_STATIC_STRING("test_fd_cleanup"));
+    grpc_exec_ctx_flush(exec_ctx);
+
+    grpc_fd_orphan(exec_ctx, tfds[i].fd, NULL, &release_fd,
+                   false /* already_closed */, "test_fd_cleanup");
+    grpc_exec_ctx_flush(exec_ctx);
+
+    GPR_ASSERT(release_fd == tfds[i].inner_fd);
+    close(tfds[i].inner_fd);
+  }
+}
+
+static void test_pollset_init(test_pollset* pollsets, int num_pollsets) {
+  int i;
+  for (i = 0; i < num_pollsets; i++) {
+    pollsets[i].pollset =
+        static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+    grpc_pollset_init(pollsets[i].pollset, &pollsets[i].mu);
+  }
+}
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, (grpc_pollset*)p);
+}
+
+static void test_pollset_cleanup(grpc_exec_ctx* exec_ctx,
+                                 test_pollset* pollsets, int num_pollsets) {
+  grpc_closure destroyed;
+  int i;
+
+  for (i = 0; i < num_pollsets; i++) {
+    GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, pollsets[i].pollset,
+                      grpc_schedule_on_exec_ctx);
+    grpc_pollset_shutdown(exec_ctx, pollsets[i].pollset, &destroyed);
+
+    grpc_exec_ctx_flush(exec_ctx);
+    gpr_free(pollsets[i].pollset);
+  }
+}
+
+  /*
+   * Cases to test:
+   *  case 1) Polling islands of both fd and pollset are NULL
+   *  case 2) Polling island of fd is NULL but that of pollset is not-NULL
+   *  case 3) Polling island of fd is not-NULL but that of pollset is NULL
+   *  case 4) Polling islands of both fd and pollset are not-NULL and:
+   *     case 4.1) Polling islands of fd and pollset are equal
+   *     case 4.2) Polling islands of fd and pollset are NOT-equal (This results
+   *     in a merge)
+   * */
+
+#define NUM_FDS 8
+#define NUM_POLLSETS 4
+
+static void test_add_fd_to_pollset() {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  test_fd tfds[NUM_FDS];
+  int fds[NUM_FDS];
+  test_pollset pollsets[NUM_POLLSETS];
+  void* expected_pi = NULL;
+  int i;
+
+  test_fd_init(tfds, fds, NUM_FDS);
+  test_pollset_init(pollsets, NUM_POLLSETS);
+
+  /*Step 1.
+   * Create three polling islands (This will exercise test case 1 and 2) with
+   * the following configuration:
+   *   polling island 0 = { fds:0,1,2, pollsets:0}
+   *   polling island 1 = { fds:3,4,   pollsets:1}
+   *   polling island 2 = { fds:5,6,7  pollsets:2}
+   *
+   *Step 2.
+   * Add pollset 3 to polling island 0 (by adding fds 0 and 1 to pollset 3)
+   * (This will exercise test cases 3 and 4.1). The configuration becomes:
+   *   polling island 0 = { fds:0,1,2, pollsets:0,3} <<< pollset 3 added here
+   *   polling island 1 = { fds:3,4,   pollsets:1}
+   *   polling island 2 = { fds:5,6,7  pollsets:2}
+   *
+   *Step 3.
+   * Merge polling islands 0 and 1 by adding fd 0 to pollset 1 (This will
+   * exercise test case 4.2). The configuration becomes:
+   *   polling island (merged) = {fds: 0,1,2,3,4, pollsets: 0,1,3}
+   *   polling island 2 = {fds: 5,6,7 pollsets: 2}
+   *
+   *Step 4.
+   * Finally do one more merge by adding fd 3 to pollset 2.
+   *   polling island (merged) = {fds: 0,1,2,3,4,5,6,7, pollsets: 0,1,2,3}
+   */
+
+  /* == Step 1 == */
+  for (i = 0; i <= 2; i++) {
+    grpc_pollset_add_fd(&exec_ctx, pollsets[0].pollset, tfds[i].fd);
+    grpc_exec_ctx_flush(&exec_ctx);
+  }
+
+  for (i = 3; i <= 4; i++) {
+    grpc_pollset_add_fd(&exec_ctx, pollsets[1].pollset, tfds[i].fd);
+    grpc_exec_ctx_flush(&exec_ctx);
+  }
+
+  for (i = 5; i <= 7; i++) {
+    grpc_pollset_add_fd(&exec_ctx, pollsets[2].pollset, tfds[i].fd);
+    grpc_exec_ctx_flush(&exec_ctx);
+  }
+
+  /* == Step 2 == */
+  for (i = 0; i <= 1; i++) {
+    grpc_pollset_add_fd(&exec_ctx, pollsets[3].pollset, tfds[i].fd);
+    grpc_exec_ctx_flush(&exec_ctx);
+  }
+
+  /* == Step 3 == */
+  grpc_pollset_add_fd(&exec_ctx, pollsets[1].pollset, tfds[0].fd);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* == Step 4 == */
+  grpc_pollset_add_fd(&exec_ctx, pollsets[2].pollset, tfds[3].fd);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* All polling islands are merged at this point */
+
+  /* Compare Fd:0's polling island with that of all other Fds */
+  expected_pi = grpc_fd_get_polling_island(tfds[0].fd);
+  for (i = 1; i < NUM_FDS; i++) {
+    GPR_ASSERT(grpc_are_polling_islands_equal(
+        expected_pi, grpc_fd_get_polling_island(tfds[i].fd)));
+  }
+
+  /* Compare Fd:0's polling island with that of all other pollsets */
+  for (i = 0; i < NUM_POLLSETS; i++) {
+    GPR_ASSERT(grpc_are_polling_islands_equal(
+        expected_pi, grpc_pollset_get_polling_island(pollsets[i].pollset)));
+  }
+
+  test_fd_cleanup(&exec_ctx, tfds, NUM_FDS);
+  test_pollset_cleanup(&exec_ctx, pollsets, NUM_POLLSETS);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+#undef NUM_FDS
+#undef NUM_POLLSETS
+
+typedef struct threading_shared {
+  gpr_mu* mu;
+  grpc_pollset* pollset;
+  grpc_wakeup_fd* wakeup_fd;
+  grpc_fd* wakeup_desc;
+  grpc_closure on_wakeup;
+  int wakeups;
+} threading_shared;
+
+static __thread int thread_wakeups = 0;
+
+static void test_threading_loop(void* arg) {
+  threading_shared* shared = static_cast<threading_shared*>(arg);
+  while (thread_wakeups < 1000000) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_pollset_worker* worker;
+    gpr_mu_lock(shared->mu);
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work", grpc_pollset_work(&exec_ctx, shared->pollset, &worker,
+                                          GRPC_MILLIS_INF_FUTURE)));
+    gpr_mu_unlock(shared->mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_threading_wakeup(grpc_exec_ctx* exec_ctx, void* arg,
+                                  grpc_error* error) {
+  threading_shared* shared = static_cast<threading_shared*>(arg);
+  ++shared->wakeups;
+  ++thread_wakeups;
+  if (error == GRPC_ERROR_NONE) {
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "consume_wakeup", grpc_wakeup_fd_consume_wakeup(shared->wakeup_fd)));
+    grpc_fd_notify_on_read(exec_ctx, shared->wakeup_desc, &shared->on_wakeup);
+    GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_next",
+                                 grpc_wakeup_fd_wakeup(shared->wakeup_fd)));
+  }
+}
+
+static void test_threading(void) {
+  threading_shared shared;
+  shared.pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(shared.pollset, &shared.mu);
+
+  gpr_thd_id thds[10];
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
+    gpr_thd_options opt = gpr_thd_options_default();
+    gpr_thd_options_set_joinable(&opt);
+    gpr_thd_new(&thds[i], test_threading_loop, &shared, &opt);
+  }
+  grpc_wakeup_fd fd;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_fd_init", grpc_wakeup_fd_init(&fd)));
+  shared.wakeup_fd = &fd;
+  shared.wakeup_desc = grpc_fd_create(fd.read_fd, "wakeup");
+  shared.wakeups = 0;
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_pollset_add_fd(&exec_ctx, shared.pollset, shared.wakeup_desc);
+    grpc_fd_notify_on_read(
+        &exec_ctx, shared.wakeup_desc,
+        GRPC_CLOSURE_INIT(&shared.on_wakeup, test_threading_wakeup, &shared,
+                          grpc_schedule_on_exec_ctx));
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_first",
+                               grpc_wakeup_fd_wakeup(shared.wakeup_fd)));
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
+    gpr_thd_join(thds[i]);
+  }
+  fd.read_fd = 0;
+  grpc_wakeup_fd_destroy(&fd);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_fd_shutdown(&exec_ctx, shared.wakeup_desc, GRPC_ERROR_CANCELLED);
+    grpc_fd_orphan(&exec_ctx, shared.wakeup_desc, NULL, NULL,
+                   false /* already_closed */, "done");
+    grpc_pollset_shutdown(&exec_ctx, shared.pollset,
+                          GRPC_CLOSURE_CREATE(destroy_pollset, shared.pollset,
+                                              grpc_schedule_on_exec_ctx));
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  gpr_free(shared.pollset);
+}
+
+int main(int argc, char** argv) {
+  const char* poll_strategy = NULL;
+  grpc_test_init(argc, argv);
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  poll_strategy = grpc_get_poll_strategy_name();
+  if (poll_strategy != NULL && strcmp(poll_strategy, "epollsig") == 0) {
+    test_add_fd_to_pollset();
+    test_threading();
+  } else {
+    gpr_log(GPR_INFO,
+            "Skipping the test. The test is only relevant for 'epollsig' "
+            "strategy. and the current strategy is: '%s'",
+            poll_strategy);
+  }
+
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  return 0;
+}
+#else  /* defined(GRPC_LINUX_EPOLL) */
+int main(int argc, char** argv) { return 0; }
+#endif /* !defined(GRPC_LINUX_EPOLL) */
diff --git a/test/core/iomgr/fd_conservation_posix_test.c b/test/core/iomgr/fd_conservation_posix_test.c
deleted file mode 100644
index d29b1e8..0000000
--- a/test/core/iomgr/fd_conservation_posix_test.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <sys/resource.h>
-
-#include <grpc/support/log.h>
-
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "test/core/util/test_config.h"
-
-int main(int argc, char **argv) {
-  int i;
-  struct rlimit rlim;
-  grpc_endpoint_pair p;
-
-  grpc_test_init(argc, argv);
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  /* set max # of file descriptors to a low value, and
-     verify we can create and destroy many more than this number
-     of descriptors */
-  rlim.rlim_cur = rlim.rlim_max = 10;
-  GPR_ASSERT(0 == setrlimit(RLIMIT_NOFILE, &rlim));
-  grpc_resource_quota *resource_quota =
-      grpc_resource_quota_create("fd_conservation_posix_test");
-
-  for (i = 0; i < 100; i++) {
-    p = grpc_iomgr_create_endpoint_pair("test", NULL);
-    grpc_endpoint_destroy(&exec_ctx, p.client);
-    grpc_endpoint_destroy(&exec_ctx, p.server);
-    grpc_exec_ctx_flush(&exec_ctx);
-  }
-
-  grpc_resource_quota_unref(resource_quota);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/iomgr/fd_conservation_posix_test.cc b/test/core/iomgr/fd_conservation_posix_test.cc
new file mode 100644
index 0000000..b76c247
--- /dev/null
+++ b/test/core/iomgr/fd_conservation_posix_test.cc
@@ -0,0 +1,56 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <sys/resource.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/test_config.h"
+
+int main(int argc, char** argv) {
+  int i;
+  struct rlimit rlim;
+  grpc_endpoint_pair p;
+
+  grpc_test_init(argc, argv);
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  /* set max # of file descriptors to a low value, and
+     verify we can create and destroy many more than this number
+     of descriptors */
+  rlim.rlim_cur = rlim.rlim_max = 10;
+  GPR_ASSERT(0 == setrlimit(RLIMIT_NOFILE, &rlim));
+  grpc_resource_quota* resource_quota =
+      grpc_resource_quota_create("fd_conservation_posix_test");
+
+  for (i = 0; i < 100; i++) {
+    p = grpc_iomgr_create_endpoint_pair("test", NULL);
+    grpc_endpoint_destroy(&exec_ctx, p.client);
+    grpc_endpoint_destroy(&exec_ctx, p.server);
+    grpc_exec_ctx_flush(&exec_ctx);
+  }
+
+  grpc_resource_quota_unref(resource_quota);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c
deleted file mode 100644
index 1c62f34..0000000
--- a/test/core/iomgr/fd_posix_test.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with posix sockets enabled
-#ifdef GRPC_POSIX_SOCKET
-
-#include "src/core/lib/iomgr/ev_posix.h"
-
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <netinet/in.h>
-#include <poll.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <unistd.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/iomgr/ev_posix.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-#include "test/core/util/test_config.h"
-
-static gpr_mu *g_mu;
-static grpc_pollset *g_pollset;
-
-/* buffer size used to send and receive data.
-   1024 is the minimal value to set TCP send and receive buffer. */
-#define BUF_SIZE 1024
-
-/* Create a test socket with the right properties for testing.
-   port is the TCP port to listen or connect to.
-   Return a socket FD and sockaddr_in. */
-static void create_test_socket(int port, int *socket_fd,
-                               struct sockaddr_in *sin) {
-  int fd;
-  int one = 1;
-  int buffer_size_bytes = BUF_SIZE;
-  int flags;
-
-  fd = socket(AF_INET, SOCK_STREAM, 0);
-  setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
-  /* Reset the size of socket send buffer to the minimal value to facilitate
-     buffer filling up and triggering notify_on_write  */
-  GPR_ASSERT(grpc_set_socket_sndbuf(fd, buffer_size_bytes) == GRPC_ERROR_NONE);
-  GPR_ASSERT(grpc_set_socket_rcvbuf(fd, buffer_size_bytes) == GRPC_ERROR_NONE);
-  /* Make fd non-blocking */
-  flags = fcntl(fd, F_GETFL, 0);
-  GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
-  *socket_fd = fd;
-
-  /* Use local address for test */
-  sin->sin_family = AF_INET;
-  sin->sin_addr.s_addr = htonl(0x7f000001);
-  GPR_ASSERT(port >= 0 && port < 65536);
-  sin->sin_port = htons((uint16_t)port);
-}
-
-/* Dummy gRPC callback */
-void no_op_cb(void *arg, int success) {}
-
-/* =======An upload server to test notify_on_read===========
-   The server simply reads and counts a stream of bytes. */
-
-/* An upload server. */
-typedef struct {
-  grpc_fd *em_fd;           /* listening fd */
-  ssize_t read_bytes_total; /* total number of received bytes */
-  int done;                 /* set to 1 when a server finishes serving */
-  grpc_closure listen_closure;
-} server;
-
-static void server_init(server *sv) {
-  sv->read_bytes_total = 0;
-  sv->done = 0;
-}
-
-/* An upload session.
-   Created when a new upload request arrives in the server. */
-typedef struct {
-  server *sv;              /* not owned by a single session */
-  grpc_fd *em_fd;          /* fd to read upload bytes */
-  char read_buf[BUF_SIZE]; /* buffer to store upload bytes */
-  grpc_closure session_read_closure;
-} session;
-
-/* Called when an upload session can be safely shutdown.
-   Close session FD and start to shutdown listen FD. */
-static void session_shutdown_cb(grpc_exec_ctx *exec_ctx, void *arg, /*session */
-                                bool success) {
-  session *se = arg;
-  server *sv = se->sv;
-  grpc_fd_orphan(exec_ctx, se->em_fd, NULL, NULL, false /* already_closed */,
-                 "a");
-  gpr_free(se);
-  /* Start to shutdown listen fd. */
-  grpc_fd_shutdown(exec_ctx, sv->em_fd,
-                   GRPC_ERROR_CREATE_FROM_STATIC_STRING("session_shutdown_cb"));
-}
-
-/* Called when data become readable in a session. */
-static void session_read_cb(grpc_exec_ctx *exec_ctx, void *arg, /*session */
-                            grpc_error *error) {
-  session *se = arg;
-  int fd = grpc_fd_wrapped_fd(se->em_fd);
-
-  ssize_t read_once = 0;
-  ssize_t read_total = 0;
-
-  if (error != GRPC_ERROR_NONE) {
-    session_shutdown_cb(exec_ctx, arg, 1);
-    return;
-  }
-
-  do {
-    read_once = read(fd, se->read_buf, BUF_SIZE);
-    if (read_once > 0) read_total += read_once;
-  } while (read_once > 0);
-  se->sv->read_bytes_total += read_total;
-
-  /* read() returns 0 to indicate the TCP connection was closed by the client.
-     read(fd, read_buf, 0) also returns 0 which should never be called as such.
-     It is possible to read nothing due to spurious edge event or data has
-     been drained, In such a case, read() returns -1 and set errno to EAGAIN. */
-  if (read_once == 0) {
-    session_shutdown_cb(exec_ctx, arg, 1);
-  } else if (read_once == -1) {
-    if (errno == EAGAIN) {
-      /* An edge triggered event is cached in the kernel until next poll.
-         In the current single thread implementation, session_read_cb is called
-         in the polling thread, such that polling only happens after this
-         callback, and will catch read edge event if data is available again
-         before notify_on_read.
-         TODO(chenw): in multi-threaded version, callback and polling can be
-         run in different threads. polling may catch a persist read edge event
-         before notify_on_read is called.  */
-      grpc_fd_notify_on_read(exec_ctx, se->em_fd, &se->session_read_closure);
-    } else {
-      gpr_log(GPR_ERROR, "Unhandled read error %s", strerror(errno));
-      abort();
-    }
-  }
-}
-
-/* Called when the listen FD can be safely shutdown.
-   Close listen FD and signal that server can be shutdown. */
-static void listen_shutdown_cb(grpc_exec_ctx *exec_ctx, void *arg /*server */,
-                               int success) {
-  server *sv = arg;
-
-  grpc_fd_orphan(exec_ctx, sv->em_fd, NULL, NULL, false /* already_closed */,
-                 "b");
-
-  gpr_mu_lock(g_mu);
-  sv->done = 1;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-/* Called when a new TCP connection request arrives in the listening port. */
-static void listen_cb(grpc_exec_ctx *exec_ctx, void *arg, /*=sv_arg*/
-                      grpc_error *error) {
-  server *sv = arg;
-  int fd;
-  int flags;
-  session *se;
-  struct sockaddr_storage ss;
-  socklen_t slen = sizeof(ss);
-  grpc_fd *listen_em_fd = sv->em_fd;
-
-  if (error != GRPC_ERROR_NONE) {
-    listen_shutdown_cb(exec_ctx, arg, 1);
-    return;
-  }
-
-  fd = accept(grpc_fd_wrapped_fd(listen_em_fd), (struct sockaddr *)&ss, &slen);
-  GPR_ASSERT(fd >= 0);
-  GPR_ASSERT(fd < FD_SETSIZE);
-  flags = fcntl(fd, F_GETFL, 0);
-  fcntl(fd, F_SETFL, flags | O_NONBLOCK);
-  se = gpr_malloc(sizeof(*se));
-  se->sv = sv;
-  se->em_fd = grpc_fd_create(fd, "listener");
-  grpc_pollset_add_fd(exec_ctx, g_pollset, se->em_fd);
-  GRPC_CLOSURE_INIT(&se->session_read_closure, session_read_cb, se,
-                    grpc_schedule_on_exec_ctx);
-  grpc_fd_notify_on_read(exec_ctx, se->em_fd, &se->session_read_closure);
-
-  grpc_fd_notify_on_read(exec_ctx, listen_em_fd, &sv->listen_closure);
-}
-
-/* Max number of connections pending to be accepted by listen(). */
-#define MAX_NUM_FD 1024
-
-/* Start a test server, return the TCP listening port bound to listen_fd.
-   listen_cb() is registered to be interested in reading from listen_fd.
-   When connection request arrives, listen_cb() is called to accept the
-   connection request. */
-static int server_start(grpc_exec_ctx *exec_ctx, server *sv) {
-  int port = 0;
-  int fd;
-  struct sockaddr_in sin;
-  socklen_t addr_len;
-
-  create_test_socket(port, &fd, &sin);
-  addr_len = sizeof(sin);
-  GPR_ASSERT(bind(fd, (struct sockaddr *)&sin, addr_len) == 0);
-  GPR_ASSERT(getsockname(fd, (struct sockaddr *)&sin, &addr_len) == 0);
-  port = ntohs(sin.sin_port);
-  GPR_ASSERT(listen(fd, MAX_NUM_FD) == 0);
-
-  sv->em_fd = grpc_fd_create(fd, "server");
-  grpc_pollset_add_fd(exec_ctx, g_pollset, sv->em_fd);
-  /* Register to be interested in reading from listen_fd. */
-  GRPC_CLOSURE_INIT(&sv->listen_closure, listen_cb, sv,
-                    grpc_schedule_on_exec_ctx);
-  grpc_fd_notify_on_read(exec_ctx, sv->em_fd, &sv->listen_closure);
-
-  return port;
-}
-
-/* Wait and shutdown a sever. */
-static void server_wait_and_shutdown(server *sv) {
-  gpr_mu_lock(g_mu);
-  while (!sv->done) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
-                                          GRPC_MILLIS_INF_FUTURE)));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  gpr_mu_unlock(g_mu);
-}
-
-/* ===An upload client to test notify_on_write=== */
-
-/* Client write buffer size */
-#define CLIENT_WRITE_BUF_SIZE 10
-/* Total number of times that the client fills up the write buffer */
-#define CLIENT_TOTAL_WRITE_CNT 3
-
-/* An upload client. */
-typedef struct {
-  grpc_fd *em_fd;
-  char write_buf[CLIENT_WRITE_BUF_SIZE];
-  ssize_t write_bytes_total;
-  /* Number of times that the client fills up the write buffer and calls
-     notify_on_write to schedule another write. */
-  int client_write_cnt;
-
-  int done; /* set to 1 when a client finishes sending */
-  grpc_closure write_closure;
-} client;
-
-static void client_init(client *cl) {
-  memset(cl->write_buf, 0, sizeof(cl->write_buf));
-  cl->write_bytes_total = 0;
-  cl->client_write_cnt = 0;
-  cl->done = 0;
-}
-
-/* Called when a client upload session is ready to shutdown. */
-static void client_session_shutdown_cb(grpc_exec_ctx *exec_ctx,
-                                       void *arg /*client */, int success) {
-  client *cl = arg;
-  grpc_fd_orphan(exec_ctx, cl->em_fd, NULL, NULL, false /* already_closed */,
-                 "c");
-  cl->done = 1;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-}
-
-/* Write as much as possible, then register notify_on_write. */
-static void client_session_write(grpc_exec_ctx *exec_ctx, void *arg, /*client */
-                                 grpc_error *error) {
-  client *cl = arg;
-  int fd = grpc_fd_wrapped_fd(cl->em_fd);
-  ssize_t write_once = 0;
-
-  if (error != GRPC_ERROR_NONE) {
-    gpr_mu_lock(g_mu);
-    client_session_shutdown_cb(exec_ctx, arg, 1);
-    gpr_mu_unlock(g_mu);
-    return;
-  }
-
-  do {
-    write_once = write(fd, cl->write_buf, CLIENT_WRITE_BUF_SIZE);
-    if (write_once > 0) cl->write_bytes_total += write_once;
-  } while (write_once > 0);
-
-  if (errno == EAGAIN) {
-    gpr_mu_lock(g_mu);
-    if (cl->client_write_cnt < CLIENT_TOTAL_WRITE_CNT) {
-      GRPC_CLOSURE_INIT(&cl->write_closure, client_session_write, cl,
-                        grpc_schedule_on_exec_ctx);
-      grpc_fd_notify_on_write(exec_ctx, cl->em_fd, &cl->write_closure);
-      cl->client_write_cnt++;
-    } else {
-      client_session_shutdown_cb(exec_ctx, arg, 1);
-    }
-    gpr_mu_unlock(g_mu);
-  } else {
-    gpr_log(GPR_ERROR, "unknown errno %s", strerror(errno));
-    abort();
-  }
-}
-
-/* Start a client to send a stream of bytes. */
-static void client_start(grpc_exec_ctx *exec_ctx, client *cl, int port) {
-  int fd;
-  struct sockaddr_in sin;
-  create_test_socket(port, &fd, &sin);
-  if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
-    if (errno == EINPROGRESS) {
-      struct pollfd pfd;
-      pfd.fd = fd;
-      pfd.events = POLLOUT;
-      pfd.revents = 0;
-      if (poll(&pfd, 1, -1) == -1) {
-        gpr_log(GPR_ERROR, "poll() failed during connect; errno=%d", errno);
-        abort();
-      }
-    } else {
-      gpr_log(GPR_ERROR, "Failed to connect to the server (errno=%d)", errno);
-      abort();
-    }
-  }
-
-  cl->em_fd = grpc_fd_create(fd, "client");
-  grpc_pollset_add_fd(exec_ctx, g_pollset, cl->em_fd);
-
-  client_session_write(exec_ctx, cl, GRPC_ERROR_NONE);
-}
-
-/* Wait for the signal to shutdown a client. */
-static void client_wait_and_shutdown(client *cl) {
-  gpr_mu_lock(g_mu);
-  while (!cl->done) {
-    grpc_pollset_worker *worker = NULL;
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
-                                          GRPC_MILLIS_INF_FUTURE)));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  gpr_mu_unlock(g_mu);
-}
-
-/* Test grpc_fd. Start an upload server and client, upload a stream of
-   bytes from the client to the server, and verify that the total number of
-   sent bytes is equal to the total number of received bytes. */
-static void test_grpc_fd(void) {
-  server sv;
-  client cl;
-  int port;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  server_init(&sv);
-  port = server_start(&exec_ctx, &sv);
-  client_init(&cl);
-  client_start(&exec_ctx, &cl, port);
-  grpc_exec_ctx_finish(&exec_ctx);
-  client_wait_and_shutdown(&cl);
-  server_wait_and_shutdown(&sv);
-  GPR_ASSERT(sv.read_bytes_total == cl.write_bytes_total);
-  gpr_log(GPR_INFO, "Total read bytes %" PRIdPTR, sv.read_bytes_total);
-}
-
-typedef struct fd_change_data {
-  grpc_iomgr_cb_func cb_that_ran;
-} fd_change_data;
-
-void init_change_data(fd_change_data *fdc) { fdc->cb_that_ran = NULL; }
-
-void destroy_change_data(fd_change_data *fdc) {}
-
-static void first_read_callback(grpc_exec_ctx *exec_ctx,
-                                void *arg /* fd_change_data */,
-                                grpc_error *error) {
-  fd_change_data *fdc = arg;
-
-  gpr_mu_lock(g_mu);
-  fdc->cb_that_ran = first_read_callback;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-static void second_read_callback(grpc_exec_ctx *exec_ctx,
-                                 void *arg /* fd_change_data */,
-                                 grpc_error *error) {
-  fd_change_data *fdc = arg;
-
-  gpr_mu_lock(g_mu);
-  fdc->cb_that_ran = second_read_callback;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-/* Test that changing the callback we use for notify_on_read actually works.
-   Note that we have two different but almost identical callbacks above -- the
-   point is to have two different function pointers and two different data
-   pointers and make sure that changing both really works. */
-static void test_grpc_fd_change(void) {
-  grpc_fd *em_fd;
-  fd_change_data a, b;
-  int flags;
-  int sv[2];
-  char data;
-  ssize_t result;
-  grpc_closure first_closure;
-  grpc_closure second_closure;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  GRPC_CLOSURE_INIT(&first_closure, first_read_callback, &a,
-                    grpc_schedule_on_exec_ctx);
-  GRPC_CLOSURE_INIT(&second_closure, second_read_callback, &b,
-                    grpc_schedule_on_exec_ctx);
-
-  init_change_data(&a);
-  init_change_data(&b);
-
-  GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
-  flags = fcntl(sv[0], F_GETFL, 0);
-  GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
-  flags = fcntl(sv[1], F_GETFL, 0);
-  GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
-
-  em_fd = grpc_fd_create(sv[0], "test_grpc_fd_change");
-  grpc_pollset_add_fd(&exec_ctx, g_pollset, em_fd);
-
-  /* Register the first callback, then make its FD readable */
-  grpc_fd_notify_on_read(&exec_ctx, em_fd, &first_closure);
-  data = 0;
-  result = write(sv[1], &data, 1);
-  GPR_ASSERT(result == 1);
-
-  /* And now wait for it to run. */
-  gpr_mu_lock(g_mu);
-  while (a.cb_that_ran == NULL) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
-                                          GRPC_MILLIS_INF_FUTURE)));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  GPR_ASSERT(a.cb_that_ran == first_read_callback);
-  gpr_mu_unlock(g_mu);
-
-  /* And drain the socket so we can generate a new read edge */
-  result = read(sv[0], &data, 1);
-  GPR_ASSERT(result == 1);
-
-  /* Now register a second callback with distinct change data, and do the same
-     thing again. */
-  grpc_fd_notify_on_read(&exec_ctx, em_fd, &second_closure);
-  data = 0;
-  result = write(sv[1], &data, 1);
-  GPR_ASSERT(result == 1);
-
-  gpr_mu_lock(g_mu);
-  while (b.cb_that_ran == NULL) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
-                                          GRPC_MILLIS_INF_FUTURE)));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  /* Except now we verify that second_read_callback ran instead */
-  GPR_ASSERT(b.cb_that_ran == second_read_callback);
-  gpr_mu_unlock(g_mu);
-
-  grpc_fd_orphan(&exec_ctx, em_fd, NULL, NULL, false /* already_closed */, "d");
-  grpc_exec_ctx_finish(&exec_ctx);
-  destroy_change_data(&a);
-  destroy_change_data(&b);
-  close(sv[1]);
-}
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, p);
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_test_init(argc, argv);
-  grpc_init();
-  g_pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(g_pollset, &g_mu);
-  test_grpc_fd();
-  test_grpc_fd_change();
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
-  grpc_exec_ctx_flush(&exec_ctx);
-  gpr_free(g_pollset);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  return 0;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/fd_posix_test.cc b/test/core/iomgr/fd_posix_test.cc
new file mode 100644
index 0000000..c70187c
--- /dev/null
+++ b/test/core/iomgr/fd_posix_test.cc
@@ -0,0 +1,545 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include "src/core/lib/iomgr/ev_posix.h"
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <poll.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "test/core/util/test_config.h"
+
+static gpr_mu* g_mu;
+static grpc_pollset* g_pollset;
+
+/* buffer size used to send and receive data.
+   1024 is the minimal value to set TCP send and receive buffer. */
+#define BUF_SIZE 1024
+
+/* Create a test socket with the right properties for testing.
+   port is the TCP port to listen or connect to.
+   Return a socket FD and sockaddr_in. */
+static void create_test_socket(int port, int* socket_fd,
+                               struct sockaddr_in* sin) {
+  int fd;
+  int one = 1;
+  int buffer_size_bytes = BUF_SIZE;
+  int flags;
+
+  fd = socket(AF_INET, SOCK_STREAM, 0);
+  setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
+  /* Reset the size of socket send buffer to the minimal value to facilitate
+     buffer filling up and triggering notify_on_write  */
+  GPR_ASSERT(grpc_set_socket_sndbuf(fd, buffer_size_bytes) == GRPC_ERROR_NONE);
+  GPR_ASSERT(grpc_set_socket_rcvbuf(fd, buffer_size_bytes) == GRPC_ERROR_NONE);
+  /* Make fd non-blocking */
+  flags = fcntl(fd, F_GETFL, 0);
+  GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
+  *socket_fd = fd;
+
+  /* Use local address for test */
+  sin->sin_family = AF_INET;
+  sin->sin_addr.s_addr = htonl(0x7f000001);
+  GPR_ASSERT(port >= 0 && port < 65536);
+  sin->sin_port = htons((uint16_t)port);
+}
+
+/* Dummy gRPC callback */
+void no_op_cb(void* arg, int success) {}
+
+/* =======An upload server to test notify_on_read===========
+   The server simply reads and counts a stream of bytes. */
+
+/* An upload server. */
+typedef struct {
+  grpc_fd* em_fd;           /* listening fd */
+  ssize_t read_bytes_total; /* total number of received bytes */
+  int done;                 /* set to 1 when a server finishes serving */
+  grpc_closure listen_closure;
+} server;
+
+static void server_init(server* sv) {
+  sv->read_bytes_total = 0;
+  sv->done = 0;
+}
+
+/* An upload session.
+   Created when a new upload request arrives in the server. */
+typedef struct {
+  server* sv;              /* not owned by a single session */
+  grpc_fd* em_fd;          /* fd to read upload bytes */
+  char read_buf[BUF_SIZE]; /* buffer to store upload bytes */
+  grpc_closure session_read_closure;
+} session;
+
+/* Called when an upload session can be safely shutdown.
+   Close session FD and start to shutdown listen FD. */
+static void session_shutdown_cb(grpc_exec_ctx* exec_ctx, void* arg, /*session */
+                                bool success) {
+  session* se = static_cast<session*>(arg);
+  server* sv = se->sv;
+  grpc_fd_orphan(exec_ctx, se->em_fd, NULL, NULL, false /* already_closed */,
+                 "a");
+  gpr_free(se);
+  /* Start to shutdown listen fd. */
+  grpc_fd_shutdown(exec_ctx, sv->em_fd,
+                   GRPC_ERROR_CREATE_FROM_STATIC_STRING("session_shutdown_cb"));
+}
+
+/* Called when data become readable in a session. */
+static void session_read_cb(grpc_exec_ctx* exec_ctx, void* arg, /*session */
+                            grpc_error* error) {
+  session* se = static_cast<session*>(arg);
+  int fd = grpc_fd_wrapped_fd(se->em_fd);
+
+  ssize_t read_once = 0;
+  ssize_t read_total = 0;
+
+  if (error != GRPC_ERROR_NONE) {
+    session_shutdown_cb(exec_ctx, arg, 1);
+    return;
+  }
+
+  do {
+    read_once = read(fd, se->read_buf, BUF_SIZE);
+    if (read_once > 0) read_total += read_once;
+  } while (read_once > 0);
+  se->sv->read_bytes_total += read_total;
+
+  /* read() returns 0 to indicate the TCP connection was closed by the client.
+     read(fd, read_buf, 0) also returns 0 which should never be called as such.
+     It is possible to read nothing due to spurious edge event or data has
+     been drained, In such a case, read() returns -1 and set errno to EAGAIN. */
+  if (read_once == 0) {
+    session_shutdown_cb(exec_ctx, arg, 1);
+  } else if (read_once == -1) {
+    if (errno == EAGAIN) {
+      /* An edge triggered event is cached in the kernel until next poll.
+         In the current single thread implementation, session_read_cb is called
+         in the polling thread, such that polling only happens after this
+         callback, and will catch read edge event if data is available again
+         before notify_on_read.
+         TODO(chenw): in multi-threaded version, callback and polling can be
+         run in different threads. polling may catch a persist read edge event
+         before notify_on_read is called.  */
+      grpc_fd_notify_on_read(exec_ctx, se->em_fd, &se->session_read_closure);
+    } else {
+      gpr_log(GPR_ERROR, "Unhandled read error %s", strerror(errno));
+      abort();
+    }
+  }
+}
+
+/* Called when the listen FD can be safely shutdown.
+   Close listen FD and signal that server can be shutdown. */
+static void listen_shutdown_cb(grpc_exec_ctx* exec_ctx, void* arg /*server */,
+                               int success) {
+  server* sv = static_cast<server*>(arg);
+
+  grpc_fd_orphan(exec_ctx, sv->em_fd, NULL, NULL, false /* already_closed */,
+                 "b");
+
+  gpr_mu_lock(g_mu);
+  sv->done = 1;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+/* Called when a new TCP connection request arrives in the listening port. */
+static void listen_cb(grpc_exec_ctx* exec_ctx, void* arg, /*=sv_arg*/
+                      grpc_error* error) {
+  server* sv = static_cast<server*>(arg);
+  int fd;
+  int flags;
+  session* se;
+  struct sockaddr_storage ss;
+  socklen_t slen = sizeof(ss);
+  grpc_fd* listen_em_fd = sv->em_fd;
+
+  if (error != GRPC_ERROR_NONE) {
+    listen_shutdown_cb(exec_ctx, arg, 1);
+    return;
+  }
+
+  fd = accept(grpc_fd_wrapped_fd(listen_em_fd), (struct sockaddr*)&ss, &slen);
+  GPR_ASSERT(fd >= 0);
+  GPR_ASSERT(fd < FD_SETSIZE);
+  flags = fcntl(fd, F_GETFL, 0);
+  fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+  se = static_cast<session*>(gpr_malloc(sizeof(*se)));
+  se->sv = sv;
+  se->em_fd = grpc_fd_create(fd, "listener");
+  grpc_pollset_add_fd(exec_ctx, g_pollset, se->em_fd);
+  GRPC_CLOSURE_INIT(&se->session_read_closure, session_read_cb, se,
+                    grpc_schedule_on_exec_ctx);
+  grpc_fd_notify_on_read(exec_ctx, se->em_fd, &se->session_read_closure);
+
+  grpc_fd_notify_on_read(exec_ctx, listen_em_fd, &sv->listen_closure);
+}
+
+/* Max number of connections pending to be accepted by listen(). */
+#define MAX_NUM_FD 1024
+
+/* Start a test server, return the TCP listening port bound to listen_fd.
+   listen_cb() is registered to be interested in reading from listen_fd.
+   When connection request arrives, listen_cb() is called to accept the
+   connection request. */
+static int server_start(grpc_exec_ctx* exec_ctx, server* sv) {
+  int port = 0;
+  int fd;
+  struct sockaddr_in sin;
+  socklen_t addr_len;
+
+  create_test_socket(port, &fd, &sin);
+  addr_len = sizeof(sin);
+  GPR_ASSERT(bind(fd, (struct sockaddr*)&sin, addr_len) == 0);
+  GPR_ASSERT(getsockname(fd, (struct sockaddr*)&sin, &addr_len) == 0);
+  port = ntohs(sin.sin_port);
+  GPR_ASSERT(listen(fd, MAX_NUM_FD) == 0);
+
+  sv->em_fd = grpc_fd_create(fd, "server");
+  grpc_pollset_add_fd(exec_ctx, g_pollset, sv->em_fd);
+  /* Register to be interested in reading from listen_fd. */
+  GRPC_CLOSURE_INIT(&sv->listen_closure, listen_cb, sv,
+                    grpc_schedule_on_exec_ctx);
+  grpc_fd_notify_on_read(exec_ctx, sv->em_fd, &sv->listen_closure);
+
+  return port;
+}
+
+/* Wait and shutdown a sever. */
+static void server_wait_and_shutdown(server* sv) {
+  gpr_mu_lock(g_mu);
+  while (!sv->done) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
+                                          GRPC_MILLIS_INF_FUTURE)));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  gpr_mu_unlock(g_mu);
+}
+
+/* ===An upload client to test notify_on_write=== */
+
+/* Client write buffer size */
+#define CLIENT_WRITE_BUF_SIZE 10
+/* Total number of times that the client fills up the write buffer */
+#define CLIENT_TOTAL_WRITE_CNT 3
+
+/* An upload client. */
+typedef struct {
+  grpc_fd* em_fd;
+  char write_buf[CLIENT_WRITE_BUF_SIZE];
+  ssize_t write_bytes_total;
+  /* Number of times that the client fills up the write buffer and calls
+     notify_on_write to schedule another write. */
+  int client_write_cnt;
+
+  int done; /* set to 1 when a client finishes sending */
+  grpc_closure write_closure;
+} client;
+
+static void client_init(client* cl) {
+  memset(cl->write_buf, 0, sizeof(cl->write_buf));
+  cl->write_bytes_total = 0;
+  cl->client_write_cnt = 0;
+  cl->done = 0;
+}
+
+/* Called when a client upload session is ready to shutdown. */
+static void client_session_shutdown_cb(grpc_exec_ctx* exec_ctx,
+                                       void* arg /*client */, int success) {
+  client* cl = static_cast<client*>(arg);
+  grpc_fd_orphan(exec_ctx, cl->em_fd, NULL, NULL, false /* already_closed */,
+                 "c");
+  cl->done = 1;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+}
+
+/* Write as much as possible, then register notify_on_write. */
+static void client_session_write(grpc_exec_ctx* exec_ctx, void* arg, /*client */
+                                 grpc_error* error) {
+  client* cl = static_cast<client*>(arg);
+  int fd = grpc_fd_wrapped_fd(cl->em_fd);
+  ssize_t write_once = 0;
+
+  if (error != GRPC_ERROR_NONE) {
+    gpr_mu_lock(g_mu);
+    client_session_shutdown_cb(exec_ctx, arg, 1);
+    gpr_mu_unlock(g_mu);
+    return;
+  }
+
+  do {
+    write_once = write(fd, cl->write_buf, CLIENT_WRITE_BUF_SIZE);
+    if (write_once > 0) cl->write_bytes_total += write_once;
+  } while (write_once > 0);
+
+  if (errno == EAGAIN) {
+    gpr_mu_lock(g_mu);
+    if (cl->client_write_cnt < CLIENT_TOTAL_WRITE_CNT) {
+      GRPC_CLOSURE_INIT(&cl->write_closure, client_session_write, cl,
+                        grpc_schedule_on_exec_ctx);
+      grpc_fd_notify_on_write(exec_ctx, cl->em_fd, &cl->write_closure);
+      cl->client_write_cnt++;
+    } else {
+      client_session_shutdown_cb(exec_ctx, arg, 1);
+    }
+    gpr_mu_unlock(g_mu);
+  } else {
+    gpr_log(GPR_ERROR, "unknown errno %s", strerror(errno));
+    abort();
+  }
+}
+
+/* Start a client to send a stream of bytes. */
+static void client_start(grpc_exec_ctx* exec_ctx, client* cl, int port) {
+  int fd;
+  struct sockaddr_in sin;
+  create_test_socket(port, &fd, &sin);
+  if (connect(fd, (struct sockaddr*)&sin, sizeof(sin)) == -1) {
+    if (errno == EINPROGRESS) {
+      struct pollfd pfd;
+      pfd.fd = fd;
+      pfd.events = POLLOUT;
+      pfd.revents = 0;
+      if (poll(&pfd, 1, -1) == -1) {
+        gpr_log(GPR_ERROR, "poll() failed during connect; errno=%d", errno);
+        abort();
+      }
+    } else {
+      gpr_log(GPR_ERROR, "Failed to connect to the server (errno=%d)", errno);
+      abort();
+    }
+  }
+
+  cl->em_fd = grpc_fd_create(fd, "client");
+  grpc_pollset_add_fd(exec_ctx, g_pollset, cl->em_fd);
+
+  client_session_write(exec_ctx, cl, GRPC_ERROR_NONE);
+}
+
+/* Wait for the signal to shutdown a client. */
+static void client_wait_and_shutdown(client* cl) {
+  gpr_mu_lock(g_mu);
+  while (!cl->done) {
+    grpc_pollset_worker* worker = NULL;
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
+                                          GRPC_MILLIS_INF_FUTURE)));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  gpr_mu_unlock(g_mu);
+}
+
+/* Test grpc_fd. Start an upload server and client, upload a stream of
+   bytes from the client to the server, and verify that the total number of
+   sent bytes is equal to the total number of received bytes. */
+static void test_grpc_fd(void) {
+  server sv;
+  client cl;
+  int port;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  server_init(&sv);
+  port = server_start(&exec_ctx, &sv);
+  client_init(&cl);
+  client_start(&exec_ctx, &cl, port);
+  grpc_exec_ctx_finish(&exec_ctx);
+  client_wait_and_shutdown(&cl);
+  server_wait_and_shutdown(&sv);
+  GPR_ASSERT(sv.read_bytes_total == cl.write_bytes_total);
+  gpr_log(GPR_INFO, "Total read bytes %" PRIdPTR, sv.read_bytes_total);
+}
+
+typedef struct fd_change_data {
+  grpc_iomgr_cb_func cb_that_ran;
+} fd_change_data;
+
+void init_change_data(fd_change_data* fdc) { fdc->cb_that_ran = NULL; }
+
+void destroy_change_data(fd_change_data* fdc) {}
+
+static void first_read_callback(grpc_exec_ctx* exec_ctx,
+                                void* arg /* fd_change_data */,
+                                grpc_error* error) {
+  fd_change_data* fdc = static_cast<fd_change_data*>(arg);
+
+  gpr_mu_lock(g_mu);
+  fdc->cb_that_ran = first_read_callback;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+static void second_read_callback(grpc_exec_ctx* exec_ctx,
+                                 void* arg /* fd_change_data */,
+                                 grpc_error* error) {
+  fd_change_data* fdc = static_cast<fd_change_data*>(arg);
+
+  gpr_mu_lock(g_mu);
+  fdc->cb_that_ran = second_read_callback;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+/* Test that changing the callback we use for notify_on_read actually works.
+   Note that we have two different but almost identical callbacks above -- the
+   point is to have two different function pointers and two different data
+   pointers and make sure that changing both really works. */
+static void test_grpc_fd_change(void) {
+  grpc_fd* em_fd;
+  fd_change_data a, b;
+  int flags;
+  int sv[2];
+  char data;
+  ssize_t result;
+  grpc_closure first_closure;
+  grpc_closure second_closure;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  GRPC_CLOSURE_INIT(&first_closure, first_read_callback, &a,
+                    grpc_schedule_on_exec_ctx);
+  GRPC_CLOSURE_INIT(&second_closure, second_read_callback, &b,
+                    grpc_schedule_on_exec_ctx);
+
+  init_change_data(&a);
+  init_change_data(&b);
+
+  GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
+  flags = fcntl(sv[0], F_GETFL, 0);
+  GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
+  flags = fcntl(sv[1], F_GETFL, 0);
+  GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
+
+  em_fd = grpc_fd_create(sv[0], "test_grpc_fd_change");
+  grpc_pollset_add_fd(&exec_ctx, g_pollset, em_fd);
+
+  /* Register the first callback, then make its FD readable */
+  grpc_fd_notify_on_read(&exec_ctx, em_fd, &first_closure);
+  data = 0;
+  result = write(sv[1], &data, 1);
+  GPR_ASSERT(result == 1);
+
+  /* And now wait for it to run. */
+  gpr_mu_lock(g_mu);
+  while (a.cb_that_ran == NULL) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
+                                          GRPC_MILLIS_INF_FUTURE)));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  GPR_ASSERT(a.cb_that_ran == first_read_callback);
+  gpr_mu_unlock(g_mu);
+
+  /* And drain the socket so we can generate a new read edge */
+  result = read(sv[0], &data, 1);
+  GPR_ASSERT(result == 1);
+
+  /* Now register a second callback with distinct change data, and do the same
+     thing again. */
+  grpc_fd_notify_on_read(&exec_ctx, em_fd, &second_closure);
+  data = 0;
+  result = write(sv[1], &data, 1);
+  GPR_ASSERT(result == 1);
+
+  gpr_mu_lock(g_mu);
+  while (b.cb_that_ran == NULL) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
+                                          GRPC_MILLIS_INF_FUTURE)));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  /* Except now we verify that second_read_callback ran instead */
+  GPR_ASSERT(b.cb_that_ran == second_read_callback);
+  gpr_mu_unlock(g_mu);
+
+  grpc_fd_orphan(&exec_ctx, em_fd, NULL, NULL, false /* already_closed */, "d");
+  grpc_exec_ctx_finish(&exec_ctx);
+  destroy_change_data(&a);
+  destroy_change_data(&b);
+  close(sv[1]);
+}
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(p));
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_test_init(argc, argv);
+  grpc_init();
+  g_pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(g_pollset, &g_mu);
+  test_grpc_fd();
+  test_grpc_fd_change();
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
+  grpc_exec_ctx_flush(&exec_ctx);
+  gpr_free(g_pollset);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/load_file_test.c b/test/core/iomgr/load_file_test.c
deleted file mode 100644
index 537c343..0000000
--- a/test/core/iomgr/load_file_test.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/iomgr/load_file.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/support/tmpfile.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x)
-
-static const char prefix[] = "file_test";
-
-static void test_load_empty_file(void) {
-  FILE *tmp = NULL;
-  grpc_slice slice;
-  grpc_slice slice_with_null_term;
-  grpc_error *error;
-  char *tmp_name;
-
-  LOG_TEST_NAME("test_load_empty_file");
-
-  tmp = gpr_tmpfile(prefix, &tmp_name);
-  GPR_ASSERT(tmp_name != NULL);
-  GPR_ASSERT(tmp != NULL);
-  fclose(tmp);
-
-  error = grpc_load_file(tmp_name, 0, &slice);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == 0);
-
-  error = grpc_load_file(tmp_name, 1, &slice_with_null_term);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_with_null_term) == 1);
-  GPR_ASSERT(GRPC_SLICE_START_PTR(slice_with_null_term)[0] == 0);
-
-  remove(tmp_name);
-  gpr_free(tmp_name);
-  grpc_slice_unref(slice);
-  grpc_slice_unref(slice_with_null_term);
-}
-
-static void test_load_failure(void) {
-  FILE *tmp = NULL;
-  grpc_slice slice;
-  grpc_error *error;
-  char *tmp_name;
-
-  LOG_TEST_NAME("test_load_failure");
-
-  tmp = gpr_tmpfile(prefix, &tmp_name);
-  GPR_ASSERT(tmp_name != NULL);
-  GPR_ASSERT(tmp != NULL);
-  fclose(tmp);
-  remove(tmp_name);
-
-  error = grpc_load_file(tmp_name, 0, &slice);
-  GPR_ASSERT(error != GRPC_ERROR_NONE);
-  GRPC_ERROR_UNREF(error);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == 0);
-  gpr_free(tmp_name);
-  grpc_slice_unref(slice);
-}
-
-static void test_load_small_file(void) {
-  FILE *tmp = NULL;
-  grpc_slice slice;
-  grpc_slice slice_with_null_term;
-  grpc_error *error;
-  char *tmp_name;
-  const char *blah = "blah";
-
-  LOG_TEST_NAME("test_load_small_file");
-
-  tmp = gpr_tmpfile(prefix, &tmp_name);
-  GPR_ASSERT(tmp_name != NULL);
-  GPR_ASSERT(tmp != NULL);
-  GPR_ASSERT(fwrite(blah, 1, strlen(blah), tmp) == strlen(blah));
-  fclose(tmp);
-
-  error = grpc_load_file(tmp_name, 0, &slice);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == strlen(blah));
-  GPR_ASSERT(!memcmp(GRPC_SLICE_START_PTR(slice), blah, strlen(blah)));
-
-  error = grpc_load_file(tmp_name, 1, &slice_with_null_term);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_with_null_term) == (strlen(blah) + 1));
-  GPR_ASSERT(strcmp((const char *)GRPC_SLICE_START_PTR(slice_with_null_term),
-                    blah) == 0);
-
-  remove(tmp_name);
-  gpr_free(tmp_name);
-  grpc_slice_unref(slice);
-  grpc_slice_unref(slice_with_null_term);
-}
-
-static void test_load_big_file(void) {
-  FILE *tmp = NULL;
-  grpc_slice slice;
-  grpc_error *error;
-  char *tmp_name;
-  static const size_t buffer_size = 124631;
-  unsigned char *buffer = gpr_malloc(buffer_size);
-  unsigned char *current;
-  size_t i;
-
-  LOG_TEST_NAME("test_load_big_file");
-
-  memset(buffer, 42, buffer_size);
-
-  tmp = gpr_tmpfile(prefix, &tmp_name);
-  GPR_ASSERT(tmp != NULL);
-  GPR_ASSERT(tmp_name != NULL);
-  GPR_ASSERT(fwrite(buffer, 1, buffer_size, tmp) == buffer_size);
-  fclose(tmp);
-
-  error = grpc_load_file(tmp_name, 0, &slice);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == buffer_size);
-  current = GRPC_SLICE_START_PTR(slice);
-  for (i = 0; i < buffer_size; i++) {
-    GPR_ASSERT(current[i] == 42);
-  }
-
-  remove(tmp_name);
-  gpr_free(tmp_name);
-  grpc_slice_unref(slice);
-  gpr_free(buffer);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_load_empty_file();
-  test_load_failure();
-  test_load_small_file();
-  test_load_big_file();
-  return 0;
-}
diff --git a/test/core/iomgr/load_file_test.cc b/test/core/iomgr/load_file_test.cc
new file mode 100644
index 0000000..2c9e7c3
--- /dev/null
+++ b/test/core/iomgr/load_file_test.cc
@@ -0,0 +1,160 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/support/tmpfile.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x)
+
+static const char prefix[] = "file_test";
+
+static void test_load_empty_file(void) {
+  FILE* tmp = NULL;
+  grpc_slice slice;
+  grpc_slice slice_with_null_term;
+  grpc_error* error;
+  char* tmp_name;
+
+  LOG_TEST_NAME("test_load_empty_file");
+
+  tmp = gpr_tmpfile(prefix, &tmp_name);
+  GPR_ASSERT(tmp_name != NULL);
+  GPR_ASSERT(tmp != NULL);
+  fclose(tmp);
+
+  error = grpc_load_file(tmp_name, 0, &slice);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == 0);
+
+  error = grpc_load_file(tmp_name, 1, &slice_with_null_term);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_with_null_term) == 1);
+  GPR_ASSERT(GRPC_SLICE_START_PTR(slice_with_null_term)[0] == 0);
+
+  remove(tmp_name);
+  gpr_free(tmp_name);
+  grpc_slice_unref(slice);
+  grpc_slice_unref(slice_with_null_term);
+}
+
+static void test_load_failure(void) {
+  FILE* tmp = NULL;
+  grpc_slice slice;
+  grpc_error* error;
+  char* tmp_name;
+
+  LOG_TEST_NAME("test_load_failure");
+
+  tmp = gpr_tmpfile(prefix, &tmp_name);
+  GPR_ASSERT(tmp_name != NULL);
+  GPR_ASSERT(tmp != NULL);
+  fclose(tmp);
+  remove(tmp_name);
+
+  error = grpc_load_file(tmp_name, 0, &slice);
+  GPR_ASSERT(error != GRPC_ERROR_NONE);
+  GRPC_ERROR_UNREF(error);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == 0);
+  gpr_free(tmp_name);
+  grpc_slice_unref(slice);
+}
+
+static void test_load_small_file(void) {
+  FILE* tmp = NULL;
+  grpc_slice slice;
+  grpc_slice slice_with_null_term;
+  grpc_error* error;
+  char* tmp_name;
+  const char* blah = "blah";
+
+  LOG_TEST_NAME("test_load_small_file");
+
+  tmp = gpr_tmpfile(prefix, &tmp_name);
+  GPR_ASSERT(tmp_name != NULL);
+  GPR_ASSERT(tmp != NULL);
+  GPR_ASSERT(fwrite(blah, 1, strlen(blah), tmp) == strlen(blah));
+  fclose(tmp);
+
+  error = grpc_load_file(tmp_name, 0, &slice);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == strlen(blah));
+  GPR_ASSERT(!memcmp(GRPC_SLICE_START_PTR(slice), blah, strlen(blah)));
+
+  error = grpc_load_file(tmp_name, 1, &slice_with_null_term);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_with_null_term) == (strlen(blah) + 1));
+  GPR_ASSERT(strcmp((const char*)GRPC_SLICE_START_PTR(slice_with_null_term),
+                    blah) == 0);
+
+  remove(tmp_name);
+  gpr_free(tmp_name);
+  grpc_slice_unref(slice);
+  grpc_slice_unref(slice_with_null_term);
+}
+
+static void test_load_big_file(void) {
+  FILE* tmp = NULL;
+  grpc_slice slice;
+  grpc_error* error;
+  char* tmp_name;
+  static const size_t buffer_size = 124631;
+  unsigned char* buffer = static_cast<unsigned char*>(gpr_malloc(buffer_size));
+  unsigned char* current;
+  size_t i;
+
+  LOG_TEST_NAME("test_load_big_file");
+
+  memset(buffer, 42, buffer_size);
+
+  tmp = gpr_tmpfile(prefix, &tmp_name);
+  GPR_ASSERT(tmp != NULL);
+  GPR_ASSERT(tmp_name != NULL);
+  GPR_ASSERT(fwrite(buffer, 1, buffer_size, tmp) == buffer_size);
+  fclose(tmp);
+
+  error = grpc_load_file(tmp_name, 0, &slice);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == buffer_size);
+  current = GRPC_SLICE_START_PTR(slice);
+  for (i = 0; i < buffer_size; i++) {
+    GPR_ASSERT(current[i] == 42);
+  }
+
+  remove(tmp_name);
+  gpr_free(tmp_name);
+  grpc_slice_unref(slice);
+  gpr_free(buffer);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_load_empty_file();
+  test_load_failure();
+  test_load_small_file();
+  test_load_big_file();
+  return 0;
+}
diff --git a/test/core/iomgr/pollset_set_test.c b/test/core/iomgr/pollset_set_test.c
deleted file mode 100644
index cddc146..0000000
--- a/test/core/iomgr/pollset_set_test.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include "src/core/lib/iomgr/port.h"
-
-/* This test only relevant on linux systems where epoll is available */
-#ifdef GRPC_LINUX_EPOLL
-
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/iomgr/ev_posix.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "test/core/util/test_config.h"
-
-/*******************************************************************************
- * test_pollset_set
- */
-
-typedef struct test_pollset_set { grpc_pollset_set *pss; } test_pollset_set;
-
-void init_test_pollset_sets(test_pollset_set *pollset_sets, const int num_pss) {
-  for (int i = 0; i < num_pss; i++) {
-    pollset_sets[i].pss = grpc_pollset_set_create();
-  }
-}
-
-void cleanup_test_pollset_sets(grpc_exec_ctx *exec_ctx,
-                               test_pollset_set *pollset_sets,
-                               const int num_pss) {
-  for (int i = 0; i < num_pss; i++) {
-    grpc_pollset_set_destroy(exec_ctx, pollset_sets[i].pss);
-    pollset_sets[i].pss = NULL;
-  }
-}
-
-/*******************************************************************************
- * test_pollset
- */
-
-typedef struct test_pollset {
-  grpc_pollset *ps;
-  gpr_mu *mu;
-} test_pollset;
-
-static void init_test_pollsets(test_pollset *pollsets, const int num_pollsets) {
-  for (int i = 0; i < num_pollsets; i++) {
-    pollsets[i].ps = gpr_zalloc(grpc_pollset_size());
-    grpc_pollset_init(pollsets[i].ps, &pollsets[i].mu);
-  }
-}
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, p);
-}
-
-static void cleanup_test_pollsets(grpc_exec_ctx *exec_ctx,
-                                  test_pollset *pollsets,
-                                  const int num_pollsets) {
-  grpc_closure destroyed;
-  for (int i = 0; i < num_pollsets; i++) {
-    GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, pollsets[i].ps,
-                      grpc_schedule_on_exec_ctx);
-    grpc_pollset_shutdown(exec_ctx, pollsets[i].ps, &destroyed);
-
-    grpc_exec_ctx_flush(exec_ctx);
-    gpr_free(pollsets[i].ps);
-    pollsets[i].ps = NULL;
-  }
-}
-
-/*******************************************************************************
- * test_fd
- */
-
-typedef struct test_fd {
-  grpc_fd *fd;
-  grpc_wakeup_fd wakeup_fd;
-
-  bool is_on_readable_called; /* Is on_readable closure is called ? */
-  grpc_closure on_readable;   /* Closure to call when this fd is readable */
-} test_fd;
-
-void on_readable(grpc_exec_ctx *exec_ctx, void *tfd, grpc_error *error) {
-  ((test_fd *)tfd)->is_on_readable_called = true;
-}
-
-static void reset_test_fd(grpc_exec_ctx *exec_ctx, test_fd *tfd) {
-  tfd->is_on_readable_called = false;
-
-  GRPC_CLOSURE_INIT(&tfd->on_readable, on_readable, tfd,
-                    grpc_schedule_on_exec_ctx);
-  grpc_fd_notify_on_read(exec_ctx, tfd->fd, &tfd->on_readable);
-}
-
-static void init_test_fds(grpc_exec_ctx *exec_ctx, test_fd *tfds,
-                          const int num_fds) {
-  for (int i = 0; i < num_fds; i++) {
-    GPR_ASSERT(GRPC_ERROR_NONE == grpc_wakeup_fd_init(&tfds[i].wakeup_fd));
-    tfds[i].fd = grpc_fd_create(GRPC_WAKEUP_FD_GET_READ_FD(&tfds[i].wakeup_fd),
-                                "test_fd");
-    reset_test_fd(exec_ctx, &tfds[i]);
-  }
-}
-
-static void cleanup_test_fds(grpc_exec_ctx *exec_ctx, test_fd *tfds,
-                             const int num_fds) {
-  int release_fd;
-
-  for (int i = 0; i < num_fds; i++) {
-    grpc_fd_shutdown(exec_ctx, tfds[i].fd,
-                     GRPC_ERROR_CREATE_FROM_STATIC_STRING("fd cleanup"));
-    grpc_exec_ctx_flush(exec_ctx);
-
-    /* grpc_fd_orphan frees the memory allocated for grpc_fd. Normally it also
-     * calls close() on the underlying fd. In our case, we are using
-     * grpc_wakeup_fd and we would like to destroy it ourselves (by calling
-     * grpc_wakeup_fd_destroy). To prevent grpc_fd from calling close() on the
-     * underlying fd, call it with a non-NULL 'release_fd' parameter */
-    grpc_fd_orphan(exec_ctx, tfds[i].fd, NULL, &release_fd,
-                   false /* already_closed */, "test_fd_cleanup");
-    grpc_exec_ctx_flush(exec_ctx);
-
-    grpc_wakeup_fd_destroy(&tfds[i].wakeup_fd);
-  }
-}
-
-static void make_test_fds_readable(test_fd *tfds, const int num_fds) {
-  for (int i = 0; i < num_fds; i++) {
-    GPR_ASSERT(GRPC_ERROR_NONE == grpc_wakeup_fd_wakeup(&tfds[i].wakeup_fd));
-  }
-}
-
-static void verify_readable_and_reset(grpc_exec_ctx *exec_ctx, test_fd *tfds,
-                                      const int num_fds) {
-  for (int i = 0; i < num_fds; i++) {
-    /* Verify that the on_readable callback was called */
-    GPR_ASSERT(tfds[i].is_on_readable_called);
-
-    /* Reset the tfd[i] structure */
-    GPR_ASSERT(GRPC_ERROR_NONE ==
-               grpc_wakeup_fd_consume_wakeup(&tfds[i].wakeup_fd));
-    reset_test_fd(exec_ctx, &tfds[i]);
-  }
-}
-
-/*******************************************************************************
- * Main tests
- */
-
-/* Test some typical scenarios in pollset_set */
-static void pollset_set_test_basic() {
-  /* We construct the following structure for this test:
-   *
-   *        +---> FD0 (Added before PSS1, PS1 and PS2 are added to PSS0)
-   *        |
-   *        +---> FD5 (Added after PSS1, PS1 and PS2 are added to PSS0)
-   *        |
-   *        |
-   *        |           +---> FD1 (Added before PSS1 is added to PSS0)
-   *        |           |
-   *        |           +---> FD6 (Added after PSS1 is added to PSS0)
-   *        |           |
-   *        +---> PSS1--+           +--> FD2 (Added before PS0 is added to PSS1)
-   *        |           |           |
-   *        |           +---> PS0---+
-   *        |                       |
-   * PSS0---+                       +--> FD7 (Added after PS0 is added to PSS1)
-   *        |
-   *        |
-   *        |           +---> FD3 (Added before PS1 is added to PSS0)
-   *        |           |
-   *        +---> PS1---+
-   *        |           |
-   *        |           +---> FD8 (Added after PS1 added to PSS0)
-   *        |
-   *        |
-   *        |           +---> FD4 (Added before PS2 is added to PSS0)
-   *        |           |
-   *        +---> PS2---+
-   *                    |
-   *                    +---> FD9 (Added after PS2 is added to PSS0)
-   */
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_pollset_worker *worker;
-  grpc_millis deadline;
-
-  test_fd tfds[10];
-  test_pollset pollsets[3];
-  test_pollset_set pollset_sets[2];
-  const int num_fds = GPR_ARRAY_SIZE(tfds);
-  const int num_ps = GPR_ARRAY_SIZE(pollsets);
-  const int num_pss = GPR_ARRAY_SIZE(pollset_sets);
-
-  init_test_fds(&exec_ctx, tfds, num_fds);
-  init_test_pollsets(pollsets, num_ps);
-  init_test_pollset_sets(pollset_sets, num_pss);
-
-  /* Construct the pollset_set/pollset/fd tree (see diagram above) */
-
-  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[0].pss, tfds[0].fd);
-  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[1].pss, tfds[1].fd);
-
-  grpc_pollset_add_fd(&exec_ctx, pollsets[0].ps, tfds[2].fd);
-  grpc_pollset_add_fd(&exec_ctx, pollsets[1].ps, tfds[3].fd);
-  grpc_pollset_add_fd(&exec_ctx, pollsets[2].ps, tfds[4].fd);
-
-  grpc_pollset_set_add_pollset_set(&exec_ctx, pollset_sets[0].pss,
-                                   pollset_sets[1].pss);
-
-  grpc_pollset_set_add_pollset(&exec_ctx, pollset_sets[1].pss, pollsets[0].ps);
-  grpc_pollset_set_add_pollset(&exec_ctx, pollset_sets[0].pss, pollsets[1].ps);
-  grpc_pollset_set_add_pollset(&exec_ctx, pollset_sets[0].pss, pollsets[2].ps);
-
-  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[0].pss, tfds[5].fd);
-  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[1].pss, tfds[6].fd);
-
-  grpc_pollset_add_fd(&exec_ctx, pollsets[0].ps, tfds[7].fd);
-  grpc_pollset_add_fd(&exec_ctx, pollsets[1].ps, tfds[8].fd);
-  grpc_pollset_add_fd(&exec_ctx, pollsets[2].ps, tfds[9].fd);
-
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* Test that if any FD in the above structure is readable, it is observable by
-   * doing grpc_pollset_work on any pollset
-   *
-   *   For every pollset, do the following:
-   *     - (Ensure that all FDs are in reset state)
-   *     - Make all FDs readable
-   *     - Call grpc_pollset_work() on the pollset
-   *     - Flush the exec_ctx
-   *     - Verify that on_readable call back was called for all FDs (and
-   *       reset the FDs)
-   * */
-  for (int i = 0; i < num_ps; i++) {
-    make_test_fds_readable(tfds, num_fds);
-
-    gpr_mu_lock(pollsets[i].mu);
-    deadline = grpc_timespec_to_millis_round_up(
-        grpc_timeout_milliseconds_to_deadline(2));
-    GPR_ASSERT(GRPC_ERROR_NONE ==
-               grpc_pollset_work(&exec_ctx, pollsets[i].ps, &worker, deadline));
-    gpr_mu_unlock(pollsets[i].mu);
-
-    grpc_exec_ctx_flush(&exec_ctx);
-
-    verify_readable_and_reset(&exec_ctx, tfds, num_fds);
-    grpc_exec_ctx_flush(&exec_ctx);
-  }
-
-  /* Test tear down */
-  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[0].pss, tfds[0].fd);
-  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[0].pss, tfds[5].fd);
-  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[1].pss, tfds[1].fd);
-  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[1].pss, tfds[6].fd);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  grpc_pollset_set_del_pollset(&exec_ctx, pollset_sets[1].pss, pollsets[0].ps);
-  grpc_pollset_set_del_pollset(&exec_ctx, pollset_sets[0].pss, pollsets[1].ps);
-  grpc_pollset_set_del_pollset(&exec_ctx, pollset_sets[0].pss, pollsets[2].ps);
-
-  grpc_pollset_set_del_pollset_set(&exec_ctx, pollset_sets[0].pss,
-                                   pollset_sets[1].pss);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  cleanup_test_fds(&exec_ctx, tfds, num_fds);
-  cleanup_test_pollsets(&exec_ctx, pollsets, num_ps);
-  cleanup_test_pollset_sets(&exec_ctx, pollset_sets, num_pss);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-/* Same FD added multiple times to the pollset_set tree */
-void pollset_set_test_dup_fds() {
-  /* We construct the following structure for this test:
-   *
-   *        +---> FD0
-   *        |
-   *        |
-   * PSS0---+
-   *        |           +---> FD0 (also under PSS0)
-   *        |           |
-   *        +---> PSS1--+           +--> FD1 (also under PSS1)
-   *                    |           |
-   *                    +---> PS ---+
-   *                    |           |
-   *                    |           +--> FD2
-   *                    +---> FD1
-   */
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_pollset_worker *worker;
-  grpc_millis deadline;
-
-  test_fd tfds[3];
-  test_pollset pollset;
-  test_pollset_set pollset_sets[2];
-  const int num_fds = GPR_ARRAY_SIZE(tfds);
-  const int num_ps = 1;
-  const int num_pss = GPR_ARRAY_SIZE(pollset_sets);
-
-  init_test_fds(&exec_ctx, tfds, num_fds);
-  init_test_pollsets(&pollset, num_ps);
-  init_test_pollset_sets(pollset_sets, num_pss);
-
-  /* Construct the structure */
-  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[0].pss, tfds[0].fd);
-  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[1].pss, tfds[0].fd);
-  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[1].pss, tfds[1].fd);
-
-  grpc_pollset_add_fd(&exec_ctx, pollset.ps, tfds[1].fd);
-  grpc_pollset_add_fd(&exec_ctx, pollset.ps, tfds[2].fd);
-
-  grpc_pollset_set_add_pollset(&exec_ctx, pollset_sets[1].pss, pollset.ps);
-  grpc_pollset_set_add_pollset_set(&exec_ctx, pollset_sets[0].pss,
-                                   pollset_sets[1].pss);
-
-  /* Test. Make all FDs readable and make sure that can be observed by doing a
-   * grpc_pollset_work on the pollset 'PS' */
-  make_test_fds_readable(tfds, num_fds);
-
-  gpr_mu_lock(pollset.mu);
-  deadline = grpc_timespec_to_millis_round_up(
-      grpc_timeout_milliseconds_to_deadline(2));
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_pollset_work(&exec_ctx, pollset.ps, &worker, deadline));
-  gpr_mu_unlock(pollset.mu);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  verify_readable_and_reset(&exec_ctx, tfds, num_fds);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* Tear down */
-  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[0].pss, tfds[0].fd);
-  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[1].pss, tfds[0].fd);
-  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[1].pss, tfds[1].fd);
-
-  grpc_pollset_set_del_pollset(&exec_ctx, pollset_sets[1].pss, pollset.ps);
-  grpc_pollset_set_del_pollset_set(&exec_ctx, pollset_sets[0].pss,
-                                   pollset_sets[1].pss);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  cleanup_test_fds(&exec_ctx, tfds, num_fds);
-  cleanup_test_pollsets(&exec_ctx, &pollset, num_ps);
-  cleanup_test_pollset_sets(&exec_ctx, pollset_sets, num_pss);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-/* Pollset_set with an empty pollset */
-void pollset_set_test_empty_pollset() {
-  /* We construct the following structure for this test:
-   *
-   *        +---> PS0 (EMPTY)
-   *        |
-   *        +---> FD0
-   *        |
-   * PSS0---+
-   *        |          +---> FD1
-   *        |          |
-   *        +---> PS1--+
-   *                   |
-   *                   +---> FD2
-   */
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_pollset_worker *worker;
-  grpc_millis deadline;
-
-  test_fd tfds[3];
-  test_pollset pollsets[2];
-  test_pollset_set pollset_set;
-  const int num_fds = GPR_ARRAY_SIZE(tfds);
-  const int num_ps = GPR_ARRAY_SIZE(pollsets);
-  const int num_pss = 1;
-
-  init_test_fds(&exec_ctx, tfds, num_fds);
-  init_test_pollsets(pollsets, num_ps);
-  init_test_pollset_sets(&pollset_set, num_pss);
-
-  /* Construct the structure */
-  grpc_pollset_set_add_fd(&exec_ctx, pollset_set.pss, tfds[0].fd);
-  grpc_pollset_add_fd(&exec_ctx, pollsets[1].ps, tfds[1].fd);
-  grpc_pollset_add_fd(&exec_ctx, pollsets[1].ps, tfds[2].fd);
-
-  grpc_pollset_set_add_pollset(&exec_ctx, pollset_set.pss, pollsets[0].ps);
-  grpc_pollset_set_add_pollset(&exec_ctx, pollset_set.pss, pollsets[1].ps);
-
-  /* Test. Make all FDs readable and make sure that can be observed by doing
-   * grpc_pollset_work on the empty pollset 'PS0' */
-  make_test_fds_readable(tfds, num_fds);
-
-  gpr_mu_lock(pollsets[0].mu);
-  deadline = grpc_timespec_to_millis_round_up(
-      grpc_timeout_milliseconds_to_deadline(2));
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_pollset_work(&exec_ctx, pollsets[0].ps, &worker, deadline));
-  gpr_mu_unlock(pollsets[0].mu);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  verify_readable_and_reset(&exec_ctx, tfds, num_fds);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* Tear down */
-  grpc_pollset_set_del_fd(&exec_ctx, pollset_set.pss, tfds[0].fd);
-  grpc_pollset_set_del_pollset(&exec_ctx, pollset_set.pss, pollsets[0].ps);
-  grpc_pollset_set_del_pollset(&exec_ctx, pollset_set.pss, pollsets[1].ps);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  cleanup_test_fds(&exec_ctx, tfds, num_fds);
-  cleanup_test_pollsets(&exec_ctx, pollsets, num_ps);
-  cleanup_test_pollset_sets(&exec_ctx, &pollset_set, num_pss);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_test_init(argc, argv);
-  grpc_init();
-  const char *poll_strategy = grpc_get_poll_strategy_name();
-
-  if (poll_strategy != NULL &&
-      (strcmp(poll_strategy, "epollsig") == 0 ||
-       strcmp(poll_strategy, "epoll-threadpool") == 0)) {
-    pollset_set_test_basic();
-    pollset_set_test_dup_fds();
-    pollset_set_test_empty_pollset();
-  } else {
-    gpr_log(GPR_INFO,
-            "Skipping the test. The test is only relevant for 'epoll' "
-            "strategy. and the current strategy is: '%s'",
-            poll_strategy);
-  }
-
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  return 0;
-}
-#else /* defined(GRPC_LINUX_EPOLL) */
-int main(int argc, char **argv) { return 0; }
-#endif /* !defined(GRPC_LINUX_EPOLL) */
diff --git a/test/core/iomgr/pollset_set_test.cc b/test/core/iomgr/pollset_set_test.cc
new file mode 100644
index 0000000..8d0198c
--- /dev/null
+++ b/test/core/iomgr/pollset_set_test.cc
@@ -0,0 +1,461 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "src/core/lib/iomgr/port.h"
+
+/* This test only relevant on linux systems where epoll is available */
+#ifdef GRPC_LINUX_EPOLL
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/test_config.h"
+
+/*******************************************************************************
+ * test_pollset_set
+ */
+
+typedef struct test_pollset_set {
+  grpc_pollset_set* pss;
+} test_pollset_set;
+
+void init_test_pollset_sets(test_pollset_set* pollset_sets, const int num_pss) {
+  for (int i = 0; i < num_pss; i++) {
+    pollset_sets[i].pss = grpc_pollset_set_create();
+  }
+}
+
+void cleanup_test_pollset_sets(grpc_exec_ctx* exec_ctx,
+                               test_pollset_set* pollset_sets,
+                               const int num_pss) {
+  for (int i = 0; i < num_pss; i++) {
+    grpc_pollset_set_destroy(exec_ctx, pollset_sets[i].pss);
+    pollset_sets[i].pss = NULL;
+  }
+}
+
+/*******************************************************************************
+ * test_pollset
+ */
+
+typedef struct test_pollset {
+  grpc_pollset* ps;
+  gpr_mu* mu;
+} test_pollset;
+
+static void init_test_pollsets(test_pollset* pollsets, const int num_pollsets) {
+  for (int i = 0; i < num_pollsets; i++) {
+    pollsets[i].ps =
+        static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+    grpc_pollset_init(pollsets[i].ps, &pollsets[i].mu);
+  }
+}
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(p));
+}
+
+static void cleanup_test_pollsets(grpc_exec_ctx* exec_ctx,
+                                  test_pollset* pollsets,
+                                  const int num_pollsets) {
+  grpc_closure destroyed;
+  for (int i = 0; i < num_pollsets; i++) {
+    GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, pollsets[i].ps,
+                      grpc_schedule_on_exec_ctx);
+    grpc_pollset_shutdown(exec_ctx, pollsets[i].ps, &destroyed);
+
+    grpc_exec_ctx_flush(exec_ctx);
+    gpr_free(pollsets[i].ps);
+    pollsets[i].ps = NULL;
+  }
+}
+
+/*******************************************************************************
+ * test_fd
+ */
+
+typedef struct test_fd {
+  grpc_fd* fd;
+  grpc_wakeup_fd wakeup_fd;
+
+  bool is_on_readable_called; /* Is on_readable closure is called ? */
+  grpc_closure on_readable;   /* Closure to call when this fd is readable */
+} test_fd;
+
+void on_readable(grpc_exec_ctx* exec_ctx, void* tfd, grpc_error* error) {
+  ((test_fd*)tfd)->is_on_readable_called = true;
+}
+
+static void reset_test_fd(grpc_exec_ctx* exec_ctx, test_fd* tfd) {
+  tfd->is_on_readable_called = false;
+
+  GRPC_CLOSURE_INIT(&tfd->on_readable, on_readable, tfd,
+                    grpc_schedule_on_exec_ctx);
+  grpc_fd_notify_on_read(exec_ctx, tfd->fd, &tfd->on_readable);
+}
+
+static void init_test_fds(grpc_exec_ctx* exec_ctx, test_fd* tfds,
+                          const int num_fds) {
+  for (int i = 0; i < num_fds; i++) {
+    GPR_ASSERT(GRPC_ERROR_NONE == grpc_wakeup_fd_init(&tfds[i].wakeup_fd));
+    tfds[i].fd = grpc_fd_create(GRPC_WAKEUP_FD_GET_READ_FD(&tfds[i].wakeup_fd),
+                                "test_fd");
+    reset_test_fd(exec_ctx, &tfds[i]);
+  }
+}
+
+static void cleanup_test_fds(grpc_exec_ctx* exec_ctx, test_fd* tfds,
+                             const int num_fds) {
+  int release_fd;
+
+  for (int i = 0; i < num_fds; i++) {
+    grpc_fd_shutdown(exec_ctx, tfds[i].fd,
+                     GRPC_ERROR_CREATE_FROM_STATIC_STRING("fd cleanup"));
+    grpc_exec_ctx_flush(exec_ctx);
+
+    /* grpc_fd_orphan frees the memory allocated for grpc_fd. Normally it also
+     * calls close() on the underlying fd. In our case, we are using
+     * grpc_wakeup_fd and we would like to destroy it ourselves (by calling
+     * grpc_wakeup_fd_destroy). To prevent grpc_fd from calling close() on the
+     * underlying fd, call it with a non-NULL 'release_fd' parameter */
+    grpc_fd_orphan(exec_ctx, tfds[i].fd, NULL, &release_fd,
+                   false /* already_closed */, "test_fd_cleanup");
+    grpc_exec_ctx_flush(exec_ctx);
+
+    grpc_wakeup_fd_destroy(&tfds[i].wakeup_fd);
+  }
+}
+
+static void make_test_fds_readable(test_fd* tfds, const int num_fds) {
+  for (int i = 0; i < num_fds; i++) {
+    GPR_ASSERT(GRPC_ERROR_NONE == grpc_wakeup_fd_wakeup(&tfds[i].wakeup_fd));
+  }
+}
+
+static void verify_readable_and_reset(grpc_exec_ctx* exec_ctx, test_fd* tfds,
+                                      const int num_fds) {
+  for (int i = 0; i < num_fds; i++) {
+    /* Verify that the on_readable callback was called */
+    GPR_ASSERT(tfds[i].is_on_readable_called);
+
+    /* Reset the tfd[i] structure */
+    GPR_ASSERT(GRPC_ERROR_NONE ==
+               grpc_wakeup_fd_consume_wakeup(&tfds[i].wakeup_fd));
+    reset_test_fd(exec_ctx, &tfds[i]);
+  }
+}
+
+/*******************************************************************************
+ * Main tests
+ */
+
+/* Test some typical scenarios in pollset_set */
+static void pollset_set_test_basic() {
+  /* We construct the following structure for this test:
+   *
+   *        +---> FD0 (Added before PSS1, PS1 and PS2 are added to PSS0)
+   *        |
+   *        +---> FD5 (Added after PSS1, PS1 and PS2 are added to PSS0)
+   *        |
+   *        |
+   *        |           +---> FD1 (Added before PSS1 is added to PSS0)
+   *        |           |
+   *        |           +---> FD6 (Added after PSS1 is added to PSS0)
+   *        |           |
+   *        +---> PSS1--+           +--> FD2 (Added before PS0 is added to PSS1)
+   *        |           |           |
+   *        |           +---> PS0---+
+   *        |                       |
+   * PSS0---+                       +--> FD7 (Added after PS0 is added to PSS1)
+   *        |
+   *        |
+   *        |           +---> FD3 (Added before PS1 is added to PSS0)
+   *        |           |
+   *        +---> PS1---+
+   *        |           |
+   *        |           +---> FD8 (Added after PS1 added to PSS0)
+   *        |
+   *        |
+   *        |           +---> FD4 (Added before PS2 is added to PSS0)
+   *        |           |
+   *        +---> PS2---+
+   *                    |
+   *                    +---> FD9 (Added after PS2 is added to PSS0)
+   */
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_pollset_worker* worker;
+  grpc_millis deadline;
+
+  test_fd tfds[10];
+  test_pollset pollsets[3];
+  test_pollset_set pollset_sets[2];
+  const int num_fds = GPR_ARRAY_SIZE(tfds);
+  const int num_ps = GPR_ARRAY_SIZE(pollsets);
+  const int num_pss = GPR_ARRAY_SIZE(pollset_sets);
+
+  init_test_fds(&exec_ctx, tfds, num_fds);
+  init_test_pollsets(pollsets, num_ps);
+  init_test_pollset_sets(pollset_sets, num_pss);
+
+  /* Construct the pollset_set/pollset/fd tree (see diagram above) */
+
+  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[0].pss, tfds[0].fd);
+  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[1].pss, tfds[1].fd);
+
+  grpc_pollset_add_fd(&exec_ctx, pollsets[0].ps, tfds[2].fd);
+  grpc_pollset_add_fd(&exec_ctx, pollsets[1].ps, tfds[3].fd);
+  grpc_pollset_add_fd(&exec_ctx, pollsets[2].ps, tfds[4].fd);
+
+  grpc_pollset_set_add_pollset_set(&exec_ctx, pollset_sets[0].pss,
+                                   pollset_sets[1].pss);
+
+  grpc_pollset_set_add_pollset(&exec_ctx, pollset_sets[1].pss, pollsets[0].ps);
+  grpc_pollset_set_add_pollset(&exec_ctx, pollset_sets[0].pss, pollsets[1].ps);
+  grpc_pollset_set_add_pollset(&exec_ctx, pollset_sets[0].pss, pollsets[2].ps);
+
+  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[0].pss, tfds[5].fd);
+  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[1].pss, tfds[6].fd);
+
+  grpc_pollset_add_fd(&exec_ctx, pollsets[0].ps, tfds[7].fd);
+  grpc_pollset_add_fd(&exec_ctx, pollsets[1].ps, tfds[8].fd);
+  grpc_pollset_add_fd(&exec_ctx, pollsets[2].ps, tfds[9].fd);
+
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* Test that if any FD in the above structure is readable, it is observable by
+   * doing grpc_pollset_work on any pollset
+   *
+   *   For every pollset, do the following:
+   *     - (Ensure that all FDs are in reset state)
+   *     - Make all FDs readable
+   *     - Call grpc_pollset_work() on the pollset
+   *     - Flush the exec_ctx
+   *     - Verify that on_readable call back was called for all FDs (and
+   *       reset the FDs)
+   * */
+  for (int i = 0; i < num_ps; i++) {
+    make_test_fds_readable(tfds, num_fds);
+
+    gpr_mu_lock(pollsets[i].mu);
+    deadline = grpc_timespec_to_millis_round_up(
+        grpc_timeout_milliseconds_to_deadline(2));
+    GPR_ASSERT(GRPC_ERROR_NONE ==
+               grpc_pollset_work(&exec_ctx, pollsets[i].ps, &worker, deadline));
+    gpr_mu_unlock(pollsets[i].mu);
+
+    grpc_exec_ctx_flush(&exec_ctx);
+
+    verify_readable_and_reset(&exec_ctx, tfds, num_fds);
+    grpc_exec_ctx_flush(&exec_ctx);
+  }
+
+  /* Test tear down */
+  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[0].pss, tfds[0].fd);
+  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[0].pss, tfds[5].fd);
+  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[1].pss, tfds[1].fd);
+  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[1].pss, tfds[6].fd);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  grpc_pollset_set_del_pollset(&exec_ctx, pollset_sets[1].pss, pollsets[0].ps);
+  grpc_pollset_set_del_pollset(&exec_ctx, pollset_sets[0].pss, pollsets[1].ps);
+  grpc_pollset_set_del_pollset(&exec_ctx, pollset_sets[0].pss, pollsets[2].ps);
+
+  grpc_pollset_set_del_pollset_set(&exec_ctx, pollset_sets[0].pss,
+                                   pollset_sets[1].pss);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  cleanup_test_fds(&exec_ctx, tfds, num_fds);
+  cleanup_test_pollsets(&exec_ctx, pollsets, num_ps);
+  cleanup_test_pollset_sets(&exec_ctx, pollset_sets, num_pss);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+/* Same FD added multiple times to the pollset_set tree */
+void pollset_set_test_dup_fds() {
+  /* We construct the following structure for this test:
+   *
+   *        +---> FD0
+   *        |
+   *        |
+   * PSS0---+
+   *        |           +---> FD0 (also under PSS0)
+   *        |           |
+   *        +---> PSS1--+           +--> FD1 (also under PSS1)
+   *                    |           |
+   *                    +---> PS ---+
+   *                    |           |
+   *                    |           +--> FD2
+   *                    +---> FD1
+   */
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_pollset_worker* worker;
+  grpc_millis deadline;
+
+  test_fd tfds[3];
+  test_pollset pollset;
+  test_pollset_set pollset_sets[2];
+  const int num_fds = GPR_ARRAY_SIZE(tfds);
+  const int num_ps = 1;
+  const int num_pss = GPR_ARRAY_SIZE(pollset_sets);
+
+  init_test_fds(&exec_ctx, tfds, num_fds);
+  init_test_pollsets(&pollset, num_ps);
+  init_test_pollset_sets(pollset_sets, num_pss);
+
+  /* Construct the structure */
+  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[0].pss, tfds[0].fd);
+  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[1].pss, tfds[0].fd);
+  grpc_pollset_set_add_fd(&exec_ctx, pollset_sets[1].pss, tfds[1].fd);
+
+  grpc_pollset_add_fd(&exec_ctx, pollset.ps, tfds[1].fd);
+  grpc_pollset_add_fd(&exec_ctx, pollset.ps, tfds[2].fd);
+
+  grpc_pollset_set_add_pollset(&exec_ctx, pollset_sets[1].pss, pollset.ps);
+  grpc_pollset_set_add_pollset_set(&exec_ctx, pollset_sets[0].pss,
+                                   pollset_sets[1].pss);
+
+  /* Test. Make all FDs readable and make sure that can be observed by doing a
+   * grpc_pollset_work on the pollset 'PS' */
+  make_test_fds_readable(tfds, num_fds);
+
+  gpr_mu_lock(pollset.mu);
+  deadline = grpc_timespec_to_millis_round_up(
+      grpc_timeout_milliseconds_to_deadline(2));
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_pollset_work(&exec_ctx, pollset.ps, &worker, deadline));
+  gpr_mu_unlock(pollset.mu);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  verify_readable_and_reset(&exec_ctx, tfds, num_fds);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* Tear down */
+  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[0].pss, tfds[0].fd);
+  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[1].pss, tfds[0].fd);
+  grpc_pollset_set_del_fd(&exec_ctx, pollset_sets[1].pss, tfds[1].fd);
+
+  grpc_pollset_set_del_pollset(&exec_ctx, pollset_sets[1].pss, pollset.ps);
+  grpc_pollset_set_del_pollset_set(&exec_ctx, pollset_sets[0].pss,
+                                   pollset_sets[1].pss);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  cleanup_test_fds(&exec_ctx, tfds, num_fds);
+  cleanup_test_pollsets(&exec_ctx, &pollset, num_ps);
+  cleanup_test_pollset_sets(&exec_ctx, pollset_sets, num_pss);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+/* Pollset_set with an empty pollset */
+void pollset_set_test_empty_pollset() {
+  /* We construct the following structure for this test:
+   *
+   *        +---> PS0 (EMPTY)
+   *        |
+   *        +---> FD0
+   *        |
+   * PSS0---+
+   *        |          +---> FD1
+   *        |          |
+   *        +---> PS1--+
+   *                   |
+   *                   +---> FD2
+   */
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_pollset_worker* worker;
+  grpc_millis deadline;
+
+  test_fd tfds[3];
+  test_pollset pollsets[2];
+  test_pollset_set pollset_set;
+  const int num_fds = GPR_ARRAY_SIZE(tfds);
+  const int num_ps = GPR_ARRAY_SIZE(pollsets);
+  const int num_pss = 1;
+
+  init_test_fds(&exec_ctx, tfds, num_fds);
+  init_test_pollsets(pollsets, num_ps);
+  init_test_pollset_sets(&pollset_set, num_pss);
+
+  /* Construct the structure */
+  grpc_pollset_set_add_fd(&exec_ctx, pollset_set.pss, tfds[0].fd);
+  grpc_pollset_add_fd(&exec_ctx, pollsets[1].ps, tfds[1].fd);
+  grpc_pollset_add_fd(&exec_ctx, pollsets[1].ps, tfds[2].fd);
+
+  grpc_pollset_set_add_pollset(&exec_ctx, pollset_set.pss, pollsets[0].ps);
+  grpc_pollset_set_add_pollset(&exec_ctx, pollset_set.pss, pollsets[1].ps);
+
+  /* Test. Make all FDs readable and make sure that can be observed by doing
+   * grpc_pollset_work on the empty pollset 'PS0' */
+  make_test_fds_readable(tfds, num_fds);
+
+  gpr_mu_lock(pollsets[0].mu);
+  deadline = grpc_timespec_to_millis_round_up(
+      grpc_timeout_milliseconds_to_deadline(2));
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_pollset_work(&exec_ctx, pollsets[0].ps, &worker, deadline));
+  gpr_mu_unlock(pollsets[0].mu);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  verify_readable_and_reset(&exec_ctx, tfds, num_fds);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* Tear down */
+  grpc_pollset_set_del_fd(&exec_ctx, pollset_set.pss, tfds[0].fd);
+  grpc_pollset_set_del_pollset(&exec_ctx, pollset_set.pss, pollsets[0].ps);
+  grpc_pollset_set_del_pollset(&exec_ctx, pollset_set.pss, pollsets[1].ps);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  cleanup_test_fds(&exec_ctx, tfds, num_fds);
+  cleanup_test_pollsets(&exec_ctx, pollsets, num_ps);
+  cleanup_test_pollset_sets(&exec_ctx, &pollset_set, num_pss);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_test_init(argc, argv);
+  grpc_init();
+  const char* poll_strategy = grpc_get_poll_strategy_name();
+
+  if (poll_strategy != NULL &&
+      (strcmp(poll_strategy, "epollsig") == 0 ||
+       strcmp(poll_strategy, "epoll-threadpool") == 0)) {
+    pollset_set_test_basic();
+    pollset_set_test_dup_fds();
+    pollset_set_test_empty_pollset();
+  } else {
+    gpr_log(GPR_INFO,
+            "Skipping the test. The test is only relevant for 'epoll' "
+            "strategy. and the current strategy is: '%s'",
+            poll_strategy);
+  }
+
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  return 0;
+}
+#else  /* defined(GRPC_LINUX_EPOLL) */
+int main(int argc, char** argv) { return 0; }
+#endif /* !defined(GRPC_LINUX_EPOLL) */
diff --git a/test/core/iomgr/resolve_address_posix_test.c b/test/core/iomgr/resolve_address_posix_test.c
deleted file mode 100644
index cb9d608..0000000
--- a/test/core/iomgr/resolve_address_posix_test.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/resolve_address.h"
-
-#include <string.h>
-#include <sys/un.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "test/core/util/test_config.h"
-
-static gpr_timespec test_deadline(void) {
-  return grpc_timeout_seconds_to_deadline(100);
-}
-
-typedef struct args_struct {
-  gpr_event ev;
-  grpc_resolved_addresses *addrs;
-  gpr_atm done_atm;
-  gpr_mu *mu;
-  grpc_pollset *pollset;
-  grpc_pollset_set *pollset_set;
-} args_struct;
-
-static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
-
-void args_init(grpc_exec_ctx *exec_ctx, args_struct *args) {
-  gpr_event_init(&args->ev);
-  args->pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(args->pollset, &args->mu);
-  args->pollset_set = grpc_pollset_set_create();
-  grpc_pollset_set_add_pollset(exec_ctx, args->pollset_set, args->pollset);
-  args->addrs = NULL;
-}
-
-void args_finish(grpc_exec_ctx *exec_ctx, args_struct *args) {
-  GPR_ASSERT(gpr_event_wait(&args->ev, test_deadline()));
-  grpc_resolved_addresses_destroy(args->addrs);
-  grpc_pollset_set_del_pollset(exec_ctx, args->pollset_set, args->pollset);
-  grpc_pollset_set_destroy(exec_ctx, args->pollset_set);
-  grpc_closure do_nothing_cb;
-  GRPC_CLOSURE_INIT(&do_nothing_cb, do_nothing, NULL,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(exec_ctx, args->pollset, &do_nothing_cb);
-  // exec_ctx needs to be flushed before calling grpc_pollset_destroy()
-  grpc_exec_ctx_flush(exec_ctx);
-  grpc_pollset_destroy(exec_ctx, args->pollset);
-  gpr_free(args->pollset);
-}
-
-static grpc_millis n_sec_deadline(int seconds) {
-  return grpc_timespec_to_millis_round_up(
-      grpc_timeout_seconds_to_deadline(seconds));
-}
-
-static void actually_poll(void *argsp) {
-  args_struct *args = argsp;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_millis deadline = n_sec_deadline(10);
-  while (true) {
-    bool done = gpr_atm_acq_load(&args->done_atm) != 0;
-    if (done) {
-      break;
-    }
-    grpc_millis time_left = deadline - grpc_exec_ctx_now(&exec_ctx);
-    gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRIdPTR, done, time_left);
-    GPR_ASSERT(time_left >= 0);
-    grpc_pollset_worker *worker = NULL;
-    gpr_mu_lock(args->mu);
-    GRPC_LOG_IF_ERROR("pollset_work",
-                      grpc_pollset_work(&exec_ctx, args->pollset, &worker,
-                                        n_sec_deadline(1)));
-    gpr_mu_unlock(args->mu);
-    grpc_exec_ctx_flush(&exec_ctx);
-  }
-  gpr_event_set(&args->ev, (void *)1);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void poll_pollset_until_request_done(args_struct *args) {
-  gpr_atm_rel_store(&args->done_atm, 0);
-  gpr_thd_id id;
-  gpr_thd_new(&id, actually_poll, args, NULL);
-}
-
-static void must_succeed(grpc_exec_ctx *exec_ctx, void *argsp,
-                         grpc_error *err) {
-  args_struct *args = argsp;
-  GPR_ASSERT(err == GRPC_ERROR_NONE);
-  GPR_ASSERT(args->addrs != NULL);
-  GPR_ASSERT(args->addrs->naddrs > 0);
-  gpr_atm_rel_store(&args->done_atm, 1);
-}
-
-static void must_fail(grpc_exec_ctx *exec_ctx, void *argsp, grpc_error *err) {
-  args_struct *args = argsp;
-  GPR_ASSERT(err != GRPC_ERROR_NONE);
-  gpr_atm_rel_store(&args->done_atm, 1);
-}
-
-static void test_unix_socket(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  args_struct args;
-  args_init(&exec_ctx, &args);
-  poll_pollset_until_request_done(&args);
-  grpc_resolve_address(
-      &exec_ctx, "unix:/path/name", NULL, args.pollset_set,
-      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
-      &args.addrs);
-  args_finish(&exec_ctx, &args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_unix_socket_path_name_too_long(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  args_struct args;
-  args_init(&exec_ctx, &args);
-  const char prefix[] = "unix:/path/name";
-  size_t path_name_length =
-      GPR_ARRAY_SIZE(((struct sockaddr_un *)0)->sun_path) + 6;
-  char *path_name = gpr_malloc(sizeof(char) * path_name_length);
-  memset(path_name, 'a', path_name_length);
-  memcpy(path_name, prefix, strlen(prefix) - 1);
-  path_name[path_name_length - 1] = '\0';
-
-  poll_pollset_until_request_done(&args);
-  grpc_resolve_address(
-      &exec_ctx, path_name, NULL, args.pollset_set,
-      GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
-      &args.addrs);
-  gpr_free(path_name);
-  args_finish(&exec_ctx, &args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  test_unix_socket();
-  test_unix_socket_path_name_too_long();
-  grpc_executor_shutdown(&exec_ctx);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/iomgr/resolve_address_posix_test.cc b/test/core/iomgr/resolve_address_posix_test.cc
new file mode 100644
index 0000000..ba89fc8
--- /dev/null
+++ b/test/core/iomgr/resolve_address_posix_test.cc
@@ -0,0 +1,171 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/resolve_address.h"
+
+#include <string.h>
+#include <sys/un.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/test_config.h"
+
+static gpr_timespec test_deadline(void) {
+  return grpc_timeout_seconds_to_deadline(100);
+}
+
+typedef struct args_struct {
+  gpr_event ev;
+  grpc_resolved_addresses* addrs;
+  gpr_atm done_atm;
+  gpr_mu* mu;
+  grpc_pollset* pollset;
+  grpc_pollset_set* pollset_set;
+} args_struct;
+
+static void do_nothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
+
+void args_init(grpc_exec_ctx* exec_ctx, args_struct* args) {
+  gpr_event_init(&args->ev);
+  args->pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(args->pollset, &args->mu);
+  args->pollset_set = grpc_pollset_set_create();
+  grpc_pollset_set_add_pollset(exec_ctx, args->pollset_set, args->pollset);
+  args->addrs = NULL;
+}
+
+void args_finish(grpc_exec_ctx* exec_ctx, args_struct* args) {
+  GPR_ASSERT(gpr_event_wait(&args->ev, test_deadline()));
+  grpc_resolved_addresses_destroy(args->addrs);
+  grpc_pollset_set_del_pollset(exec_ctx, args->pollset_set, args->pollset);
+  grpc_pollset_set_destroy(exec_ctx, args->pollset_set);
+  grpc_closure do_nothing_cb;
+  GRPC_CLOSURE_INIT(&do_nothing_cb, do_nothing, NULL,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(exec_ctx, args->pollset, &do_nothing_cb);
+  // exec_ctx needs to be flushed before calling grpc_pollset_destroy()
+  grpc_exec_ctx_flush(exec_ctx);
+  grpc_pollset_destroy(exec_ctx, args->pollset);
+  gpr_free(args->pollset);
+}
+
+static grpc_millis n_sec_deadline(int seconds) {
+  return grpc_timespec_to_millis_round_up(
+      grpc_timeout_seconds_to_deadline(seconds));
+}
+
+static void actually_poll(void* argsp) {
+  args_struct* args = static_cast<args_struct*>(argsp);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_millis deadline = n_sec_deadline(10);
+  while (true) {
+    bool done = gpr_atm_acq_load(&args->done_atm) != 0;
+    if (done) {
+      break;
+    }
+    grpc_millis time_left = deadline - grpc_exec_ctx_now(&exec_ctx);
+    gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRIdPTR, done, time_left);
+    GPR_ASSERT(time_left >= 0);
+    grpc_pollset_worker* worker = NULL;
+    gpr_mu_lock(args->mu);
+    GRPC_LOG_IF_ERROR("pollset_work",
+                      grpc_pollset_work(&exec_ctx, args->pollset, &worker,
+                                        n_sec_deadline(1)));
+    gpr_mu_unlock(args->mu);
+    grpc_exec_ctx_flush(&exec_ctx);
+  }
+  gpr_event_set(&args->ev, (void*)1);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void poll_pollset_until_request_done(args_struct* args) {
+  gpr_atm_rel_store(&args->done_atm, 0);
+  gpr_thd_id id;
+  gpr_thd_new(&id, actually_poll, args, NULL);
+}
+
+static void must_succeed(grpc_exec_ctx* exec_ctx, void* argsp,
+                         grpc_error* err) {
+  args_struct* args = static_cast<args_struct*>(argsp);
+  GPR_ASSERT(err == GRPC_ERROR_NONE);
+  GPR_ASSERT(args->addrs != NULL);
+  GPR_ASSERT(args->addrs->naddrs > 0);
+  gpr_atm_rel_store(&args->done_atm, 1);
+}
+
+static void must_fail(grpc_exec_ctx* exec_ctx, void* argsp, grpc_error* err) {
+  args_struct* args = static_cast<args_struct*>(argsp);
+  GPR_ASSERT(err != GRPC_ERROR_NONE);
+  gpr_atm_rel_store(&args->done_atm, 1);
+}
+
+static void test_unix_socket(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  args_struct args;
+  args_init(&exec_ctx, &args);
+  poll_pollset_until_request_done(&args);
+  grpc_resolve_address(
+      &exec_ctx, "unix:/path/name", NULL, args.pollset_set,
+      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
+      &args.addrs);
+  args_finish(&exec_ctx, &args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_unix_socket_path_name_too_long(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  args_struct args;
+  args_init(&exec_ctx, &args);
+  const char prefix[] = "unix:/path/name";
+  size_t path_name_length =
+      GPR_ARRAY_SIZE(((struct sockaddr_un*)0)->sun_path) + 6;
+  char* path_name =
+      static_cast<char*>(gpr_malloc(sizeof(char) * path_name_length));
+  memset(path_name, 'a', path_name_length);
+  memcpy(path_name, prefix, strlen(prefix) - 1);
+  path_name[path_name_length - 1] = '\0';
+
+  poll_pollset_until_request_done(&args);
+  grpc_resolve_address(
+      &exec_ctx, path_name, NULL, args.pollset_set,
+      GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
+      &args.addrs);
+  gpr_free(path_name);
+  args_finish(&exec_ctx, &args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  test_unix_socket();
+  test_unix_socket_path_name_too_long();
+  grpc_executor_shutdown(&exec_ctx);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c
deleted file mode 100644
index 178bbbb..0000000
--- a/test/core/iomgr/resolve_address_test.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/resolve_address.h"
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "test/core/util/test_config.h"
-
-static gpr_timespec test_deadline(void) {
-  return grpc_timeout_seconds_to_deadline(100);
-}
-
-typedef struct args_struct {
-  gpr_event ev;
-  grpc_resolved_addresses *addrs;
-  gpr_atm done_atm;
-  gpr_mu *mu;
-  grpc_pollset *pollset;
-  grpc_pollset_set *pollset_set;
-} args_struct;
-
-static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
-
-void args_init(grpc_exec_ctx *exec_ctx, args_struct *args) {
-  gpr_event_init(&args->ev);
-  args->pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(args->pollset, &args->mu);
-  args->pollset_set = grpc_pollset_set_create();
-  grpc_pollset_set_add_pollset(exec_ctx, args->pollset_set, args->pollset);
-  args->addrs = NULL;
-  gpr_atm_rel_store(&args->done_atm, 0);
-}
-
-void args_finish(grpc_exec_ctx *exec_ctx, args_struct *args) {
-  GPR_ASSERT(gpr_event_wait(&args->ev, test_deadline()));
-  grpc_resolved_addresses_destroy(args->addrs);
-  grpc_pollset_set_del_pollset(exec_ctx, args->pollset_set, args->pollset);
-  grpc_pollset_set_destroy(exec_ctx, args->pollset_set);
-  grpc_closure do_nothing_cb;
-  GRPC_CLOSURE_INIT(&do_nothing_cb, do_nothing, NULL,
-                    grpc_schedule_on_exec_ctx);
-  gpr_mu_lock(args->mu);
-  grpc_pollset_shutdown(exec_ctx, args->pollset, &do_nothing_cb);
-  gpr_mu_unlock(args->mu);
-  // exec_ctx needs to be flushed before calling grpc_pollset_destroy()
-  grpc_exec_ctx_flush(exec_ctx);
-  grpc_pollset_destroy(exec_ctx, args->pollset);
-  gpr_free(args->pollset);
-}
-
-static grpc_millis n_sec_deadline(int seconds) {
-  return grpc_timespec_to_millis_round_up(
-      grpc_timeout_seconds_to_deadline(seconds));
-}
-
-static void poll_pollset_until_request_done(args_struct *args) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_millis deadline = n_sec_deadline(10);
-  while (true) {
-    bool done = gpr_atm_acq_load(&args->done_atm) != 0;
-    if (done) {
-      break;
-    }
-    grpc_millis time_left = deadline - grpc_exec_ctx_now(&exec_ctx);
-    gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRIdPTR, done, time_left);
-    GPR_ASSERT(time_left >= 0);
-    grpc_pollset_worker *worker = NULL;
-    gpr_mu_lock(args->mu);
-    GRPC_LOG_IF_ERROR("pollset_work",
-                      grpc_pollset_work(&exec_ctx, args->pollset, &worker,
-                                        n_sec_deadline(1)));
-    gpr_mu_unlock(args->mu);
-    grpc_exec_ctx_flush(&exec_ctx);
-  }
-  gpr_event_set(&args->ev, (void *)1);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void must_succeed(grpc_exec_ctx *exec_ctx, void *argsp,
-                         grpc_error *err) {
-  args_struct *args = argsp;
-  GPR_ASSERT(err == GRPC_ERROR_NONE);
-  GPR_ASSERT(args->addrs != NULL);
-  GPR_ASSERT(args->addrs->naddrs > 0);
-  gpr_atm_rel_store(&args->done_atm, 1);
-  gpr_mu_lock(args->mu);
-  GRPC_LOG_IF_ERROR("pollset_kick",
-                    grpc_pollset_kick(exec_ctx, args->pollset, NULL));
-  gpr_mu_unlock(args->mu);
-}
-
-static void must_fail(grpc_exec_ctx *exec_ctx, void *argsp, grpc_error *err) {
-  args_struct *args = argsp;
-  GPR_ASSERT(err != GRPC_ERROR_NONE);
-  gpr_atm_rel_store(&args->done_atm, 1);
-  gpr_mu_lock(args->mu);
-  GRPC_LOG_IF_ERROR("pollset_kick",
-                    grpc_pollset_kick(exec_ctx, args->pollset, NULL));
-  gpr_mu_unlock(args->mu);
-}
-
-static void test_localhost(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  args_struct args;
-  args_init(&exec_ctx, &args);
-  grpc_resolve_address(
-      &exec_ctx, "localhost:1", NULL, args.pollset_set,
-      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
-      &args.addrs);
-  grpc_exec_ctx_flush(&exec_ctx);
-  poll_pollset_until_request_done(&args);
-  args_finish(&exec_ctx, &args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_default_port(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  args_struct args;
-  args_init(&exec_ctx, &args);
-  grpc_resolve_address(
-      &exec_ctx, "localhost", "1", args.pollset_set,
-      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
-      &args.addrs);
-  grpc_exec_ctx_flush(&exec_ctx);
-  poll_pollset_until_request_done(&args);
-  args_finish(&exec_ctx, &args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_non_numeric_default_port(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  args_struct args;
-  args_init(&exec_ctx, &args);
-  grpc_resolve_address(
-      &exec_ctx, "localhost", "https", args.pollset_set,
-      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
-      &args.addrs);
-  grpc_exec_ctx_flush(&exec_ctx);
-  poll_pollset_until_request_done(&args);
-  args_finish(&exec_ctx, &args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_missing_default_port(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  args_struct args;
-  args_init(&exec_ctx, &args);
-  grpc_resolve_address(
-      &exec_ctx, "localhost", NULL, args.pollset_set,
-      GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
-      &args.addrs);
-  grpc_exec_ctx_flush(&exec_ctx);
-  poll_pollset_until_request_done(&args);
-  args_finish(&exec_ctx, &args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_ipv6_with_port(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  args_struct args;
-  args_init(&exec_ctx, &args);
-  grpc_resolve_address(
-      &exec_ctx, "[2001:db8::1]:1", NULL, args.pollset_set,
-      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
-      &args.addrs);
-  grpc_exec_ctx_flush(&exec_ctx);
-  poll_pollset_until_request_done(&args);
-  args_finish(&exec_ctx, &args);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_ipv6_without_port(void) {
-  const char *const kCases[] = {
-      "2001:db8::1", "2001:db8::1.2.3.4", "[2001:db8::1]",
-  };
-  unsigned i;
-  for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    args_struct args;
-    args_init(&exec_ctx, &args);
-    grpc_resolve_address(
-        &exec_ctx, kCases[i], "80", args.pollset_set,
-        GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
-        &args.addrs);
-    grpc_exec_ctx_flush(&exec_ctx);
-    poll_pollset_until_request_done(&args);
-    args_finish(&exec_ctx, &args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static void test_invalid_ip_addresses(void) {
-  const char *const kCases[] = {
-      "293.283.1238.3:1", "[2001:db8::11111]:1",
-  };
-  unsigned i;
-  for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    args_struct args;
-    args_init(&exec_ctx, &args);
-    grpc_resolve_address(
-        &exec_ctx, kCases[i], NULL, args.pollset_set,
-        GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
-        &args.addrs);
-    grpc_exec_ctx_flush(&exec_ctx);
-    poll_pollset_until_request_done(&args);
-    args_finish(&exec_ctx, &args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static void test_unparseable_hostports(void) {
-  const char *const kCases[] = {
-      "[", "[::1", "[::1]bad", "[1.2.3.4]", "[localhost]", "[localhost]:1",
-  };
-  unsigned i;
-  for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    args_struct args;
-    args_init(&exec_ctx, &args);
-    grpc_resolve_address(
-        &exec_ctx, kCases[i], "1", args.pollset_set,
-        GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
-        &args.addrs);
-    grpc_exec_ctx_flush(&exec_ctx);
-    poll_pollset_until_request_done(&args);
-    args_finish(&exec_ctx, &args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  test_localhost();
-  test_default_port();
-  test_non_numeric_default_port();
-  test_missing_default_port();
-  test_ipv6_with_port();
-  test_ipv6_without_port();
-  test_invalid_ip_addresses();
-  test_unparseable_hostports();
-  grpc_executor_shutdown(&exec_ctx);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/iomgr/resolve_address_test.cc b/test/core/iomgr/resolve_address_test.cc
new file mode 100644
index 0000000..0aa3e5f
--- /dev/null
+++ b/test/core/iomgr/resolve_address_test.cc
@@ -0,0 +1,271 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/resolve_address.h"
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/test_config.h"
+
+static gpr_timespec test_deadline(void) {
+  return grpc_timeout_seconds_to_deadline(100);
+}
+
+typedef struct args_struct {
+  gpr_event ev;
+  grpc_resolved_addresses* addrs;
+  gpr_atm done_atm;
+  gpr_mu* mu;
+  grpc_pollset* pollset;
+  grpc_pollset_set* pollset_set;
+} args_struct;
+
+static void do_nothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
+
+void args_init(grpc_exec_ctx* exec_ctx, args_struct* args) {
+  gpr_event_init(&args->ev);
+  args->pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(args->pollset, &args->mu);
+  args->pollset_set = grpc_pollset_set_create();
+  grpc_pollset_set_add_pollset(exec_ctx, args->pollset_set, args->pollset);
+  args->addrs = NULL;
+  gpr_atm_rel_store(&args->done_atm, 0);
+}
+
+void args_finish(grpc_exec_ctx* exec_ctx, args_struct* args) {
+  GPR_ASSERT(gpr_event_wait(&args->ev, test_deadline()));
+  grpc_resolved_addresses_destroy(args->addrs);
+  grpc_pollset_set_del_pollset(exec_ctx, args->pollset_set, args->pollset);
+  grpc_pollset_set_destroy(exec_ctx, args->pollset_set);
+  grpc_closure do_nothing_cb;
+  GRPC_CLOSURE_INIT(&do_nothing_cb, do_nothing, NULL,
+                    grpc_schedule_on_exec_ctx);
+  gpr_mu_lock(args->mu);
+  grpc_pollset_shutdown(exec_ctx, args->pollset, &do_nothing_cb);
+  gpr_mu_unlock(args->mu);
+  // exec_ctx needs to be flushed before calling grpc_pollset_destroy()
+  grpc_exec_ctx_flush(exec_ctx);
+  grpc_pollset_destroy(exec_ctx, args->pollset);
+  gpr_free(args->pollset);
+}
+
+static grpc_millis n_sec_deadline(int seconds) {
+  return grpc_timespec_to_millis_round_up(
+      grpc_timeout_seconds_to_deadline(seconds));
+}
+
+static void poll_pollset_until_request_done(args_struct* args) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_millis deadline = n_sec_deadline(10);
+  while (true) {
+    bool done = gpr_atm_acq_load(&args->done_atm) != 0;
+    if (done) {
+      break;
+    }
+    grpc_millis time_left = deadline - grpc_exec_ctx_now(&exec_ctx);
+    gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRIdPTR, done, time_left);
+    GPR_ASSERT(time_left >= 0);
+    grpc_pollset_worker* worker = NULL;
+    gpr_mu_lock(args->mu);
+    GRPC_LOG_IF_ERROR("pollset_work",
+                      grpc_pollset_work(&exec_ctx, args->pollset, &worker,
+                                        n_sec_deadline(1)));
+    gpr_mu_unlock(args->mu);
+    grpc_exec_ctx_flush(&exec_ctx);
+  }
+  gpr_event_set(&args->ev, (void*)1);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void must_succeed(grpc_exec_ctx* exec_ctx, void* argsp,
+                         grpc_error* err) {
+  args_struct* args = static_cast<args_struct*>(argsp);
+  GPR_ASSERT(err == GRPC_ERROR_NONE);
+  GPR_ASSERT(args->addrs != NULL);
+  GPR_ASSERT(args->addrs->naddrs > 0);
+  gpr_atm_rel_store(&args->done_atm, 1);
+  gpr_mu_lock(args->mu);
+  GRPC_LOG_IF_ERROR("pollset_kick",
+                    grpc_pollset_kick(exec_ctx, args->pollset, NULL));
+  gpr_mu_unlock(args->mu);
+}
+
+static void must_fail(grpc_exec_ctx* exec_ctx, void* argsp, grpc_error* err) {
+  args_struct* args = static_cast<args_struct*>(argsp);
+  GPR_ASSERT(err != GRPC_ERROR_NONE);
+  gpr_atm_rel_store(&args->done_atm, 1);
+  gpr_mu_lock(args->mu);
+  GRPC_LOG_IF_ERROR("pollset_kick",
+                    grpc_pollset_kick(exec_ctx, args->pollset, NULL));
+  gpr_mu_unlock(args->mu);
+}
+
+static void test_localhost(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  args_struct args;
+  args_init(&exec_ctx, &args);
+  grpc_resolve_address(
+      &exec_ctx, "localhost:1", NULL, args.pollset_set,
+      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
+      &args.addrs);
+  grpc_exec_ctx_flush(&exec_ctx);
+  poll_pollset_until_request_done(&args);
+  args_finish(&exec_ctx, &args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_default_port(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  args_struct args;
+  args_init(&exec_ctx, &args);
+  grpc_resolve_address(
+      &exec_ctx, "localhost", "1", args.pollset_set,
+      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
+      &args.addrs);
+  grpc_exec_ctx_flush(&exec_ctx);
+  poll_pollset_until_request_done(&args);
+  args_finish(&exec_ctx, &args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_non_numeric_default_port(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  args_struct args;
+  args_init(&exec_ctx, &args);
+  grpc_resolve_address(
+      &exec_ctx, "localhost", "https", args.pollset_set,
+      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
+      &args.addrs);
+  grpc_exec_ctx_flush(&exec_ctx);
+  poll_pollset_until_request_done(&args);
+  args_finish(&exec_ctx, &args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_missing_default_port(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  args_struct args;
+  args_init(&exec_ctx, &args);
+  grpc_resolve_address(
+      &exec_ctx, "localhost", NULL, args.pollset_set,
+      GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
+      &args.addrs);
+  grpc_exec_ctx_flush(&exec_ctx);
+  poll_pollset_until_request_done(&args);
+  args_finish(&exec_ctx, &args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_ipv6_with_port(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  args_struct args;
+  args_init(&exec_ctx, &args);
+  grpc_resolve_address(
+      &exec_ctx, "[2001:db8::1]:1", NULL, args.pollset_set,
+      GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
+      &args.addrs);
+  grpc_exec_ctx_flush(&exec_ctx);
+  poll_pollset_until_request_done(&args);
+  args_finish(&exec_ctx, &args);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_ipv6_without_port(void) {
+  const char* const kCases[] = {
+      "2001:db8::1",
+      "2001:db8::1.2.3.4",
+      "[2001:db8::1]",
+  };
+  unsigned i;
+  for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    args_struct args;
+    args_init(&exec_ctx, &args);
+    grpc_resolve_address(
+        &exec_ctx, kCases[i], "80", args.pollset_set,
+        GRPC_CLOSURE_CREATE(must_succeed, &args, grpc_schedule_on_exec_ctx),
+        &args.addrs);
+    grpc_exec_ctx_flush(&exec_ctx);
+    poll_pollset_until_request_done(&args);
+    args_finish(&exec_ctx, &args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_invalid_ip_addresses(void) {
+  const char* const kCases[] = {
+      "293.283.1238.3:1",
+      "[2001:db8::11111]:1",
+  };
+  unsigned i;
+  for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    args_struct args;
+    args_init(&exec_ctx, &args);
+    grpc_resolve_address(
+        &exec_ctx, kCases[i], NULL, args.pollset_set,
+        GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
+        &args.addrs);
+    grpc_exec_ctx_flush(&exec_ctx);
+    poll_pollset_until_request_done(&args);
+    args_finish(&exec_ctx, &args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_unparseable_hostports(void) {
+  const char* const kCases[] = {
+      "[", "[::1", "[::1]bad", "[1.2.3.4]", "[localhost]", "[localhost]:1",
+  };
+  unsigned i;
+  for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    args_struct args;
+    args_init(&exec_ctx, &args);
+    grpc_resolve_address(
+        &exec_ctx, kCases[i], "1", args.pollset_set,
+        GRPC_CLOSURE_CREATE(must_fail, &args, grpc_schedule_on_exec_ctx),
+        &args.addrs);
+    grpc_exec_ctx_flush(&exec_ctx);
+    poll_pollset_until_request_done(&args);
+    args_finish(&exec_ctx, &args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  test_localhost();
+  test_default_port();
+  test_non_numeric_default_port();
+  test_missing_default_port();
+  test_ipv6_with_port();
+  test_ipv6_without_port();
+  test_invalid_ip_addresses();
+  test_unparseable_hostports();
+  grpc_executor_shutdown(&exec_ctx);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/iomgr/resource_quota_test.c b/test/core/iomgr/resource_quota_test.c
deleted file mode 100644
index b588f3d..0000000
--- a/test/core/iomgr/resource_quota_test.c
+++ /dev/null
@@ -1,864 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/resource_quota.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-#include "test/core/util/test_config.h"
-
-gpr_mu g_mu;
-gpr_cv g_cv;
-
-static void inc_int_cb(grpc_exec_ctx *exec_ctx, void *a, grpc_error *error) {
-  gpr_mu_lock(&g_mu);
-  ++*(int *)a;
-  gpr_cv_signal(&g_cv);
-  gpr_mu_unlock(&g_mu);
-}
-
-static void assert_counter_becomes(int *ctr, int value) {
-  gpr_mu_lock(&g_mu);
-  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
-  while (*ctr != value) {
-    GPR_ASSERT(!gpr_cv_wait(&g_cv, &g_mu, deadline));
-  }
-  gpr_mu_unlock(&g_mu);
-}
-
-static void set_event_cb(grpc_exec_ctx *exec_ctx, void *a, grpc_error *error) {
-  gpr_event_set((gpr_event *)a, (void *)1);
-}
-grpc_closure *set_event(gpr_event *ev) {
-  return GRPC_CLOSURE_CREATE(set_event_cb, ev, grpc_schedule_on_exec_ctx);
-}
-
-typedef struct {
-  size_t size;
-  grpc_resource_user *resource_user;
-  grpc_closure *then;
-} reclaimer_args;
-static void reclaimer_cb(grpc_exec_ctx *exec_ctx, void *args,
-                         grpc_error *error) {
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  reclaimer_args *a = args;
-  grpc_resource_user_free(exec_ctx, a->resource_user, a->size);
-  grpc_resource_user_finish_reclamation(exec_ctx, a->resource_user);
-  GRPC_CLOSURE_RUN(exec_ctx, a->then, GRPC_ERROR_NONE);
-  gpr_free(a);
-}
-grpc_closure *make_reclaimer(grpc_resource_user *resource_user, size_t size,
-                             grpc_closure *then) {
-  reclaimer_args *a = gpr_malloc(sizeof(*a));
-  a->size = size;
-  a->resource_user = resource_user;
-  a->then = then;
-  return GRPC_CLOSURE_CREATE(reclaimer_cb, a, grpc_schedule_on_exec_ctx);
-}
-
-static void unused_reclaimer_cb(grpc_exec_ctx *exec_ctx, void *arg,
-                                grpc_error *error) {
-  GPR_ASSERT(error == GRPC_ERROR_CANCELLED);
-  GRPC_CLOSURE_RUN(exec_ctx, arg, GRPC_ERROR_NONE);
-}
-grpc_closure *make_unused_reclaimer(grpc_closure *then) {
-  return GRPC_CLOSURE_CREATE(unused_reclaimer_cb, then,
-                             grpc_schedule_on_exec_ctx);
-}
-
-static void destroy_user(grpc_resource_user *usr) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resource_user_unref(&exec_ctx, usr);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_op(void) {
-  gpr_log(GPR_INFO, "** test_no_op **");
-  grpc_resource_quota_unref(grpc_resource_quota_create("test_no_op"));
-}
-
-static void test_resize_then_destroy(void) {
-  gpr_log(GPR_INFO, "** test_resize_then_destroy **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_resize_then_destroy");
-  grpc_resource_quota_resize(q, 1024 * 1024);
-  grpc_resource_quota_unref(q);
-}
-
-static void test_resource_user_no_op(void) {
-  gpr_log(GPR_INFO, "** test_resource_user_no_op **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_resource_user_no_op");
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-}
-
-static void test_instant_alloc_then_free(void) {
-  gpr_log(GPR_INFO, "** test_instant_alloc_then_free **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_instant_alloc_then_free");
-  grpc_resource_quota_resize(q, 1024 * 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, NULL);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-}
-
-static void test_instant_alloc_free_pair(void) {
-  gpr_log(GPR_INFO, "** test_instant_alloc_free_pair **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_instant_alloc_free_pair");
-  grpc_resource_quota_resize(q, 1024 * 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, NULL);
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-}
-
-static void test_simple_async_alloc(void) {
-  gpr_log(GPR_INFO, "** test_simple_async_alloc **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_simple_async_alloc");
-  grpc_resource_quota_resize(q, 1024 * 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-}
-
-static void test_async_alloc_blocked_by_size(void) {
-  gpr_log(GPR_INFO, "** test_async_alloc_blocked_by_size **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_async_alloc_blocked_by_size");
-  grpc_resource_quota_resize(q, 1);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  gpr_event ev;
-  gpr_event_init(&ev);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(
-                   &ev, grpc_timeout_milliseconds_to_deadline(100)) == NULL);
-  }
-  grpc_resource_quota_resize(q, 1024);
-  GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != NULL);
-  ;
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-}
-
-static void test_scavenge(void) {
-  gpr_log(GPR_INFO, "** test_scavenge **");
-  grpc_resource_quota *q = grpc_resource_quota_create("test_scavenge");
-  grpc_resource_quota_resize(q, 1024);
-  grpc_resource_user *usr1 = grpc_resource_user_create(q, "usr1");
-  grpc_resource_user *usr2 = grpc_resource_user_create(q, "usr2");
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr1, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr1, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr2, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr2, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr1);
-  destroy_user(usr2);
-}
-
-static void test_scavenge_blocked(void) {
-  gpr_log(GPR_INFO, "** test_scavenge_blocked **");
-  grpc_resource_quota *q = grpc_resource_quota_create("test_scavenge_blocked");
-  grpc_resource_quota_resize(q, 1024);
-  grpc_resource_user *usr1 = grpc_resource_user_create(q, "usr1");
-  grpc_resource_user *usr2 = grpc_resource_user_create(q, "usr2");
-  gpr_event ev;
-  {
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr1, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr2, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(
-                   &ev, grpc_timeout_milliseconds_to_deadline(100)) == NULL);
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr1, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr2, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr1);
-  destroy_user(usr2);
-}
-
-static void test_blocked_until_scheduled_reclaim(void) {
-  gpr_log(GPR_INFO, "** test_blocked_until_scheduled_reclaim **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_blocked_until_scheduled_reclaim");
-  grpc_resource_quota_resize(q, 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  gpr_event reclaim_done;
-  gpr_event_init(&reclaim_done);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_post_reclaimer(
-        &exec_ctx, usr, false,
-        make_reclaimer(usr, 1024, set_event(&reclaim_done)));
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&reclaim_done,
-                              grpc_timeout_seconds_to_deadline(5)) != NULL);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-}
-
-static void test_blocked_until_scheduled_reclaim_and_scavenge(void) {
-  gpr_log(GPR_INFO, "** test_blocked_until_scheduled_reclaim_and_scavenge **");
-  grpc_resource_quota *q = grpc_resource_quota_create(
-      "test_blocked_until_scheduled_reclaim_and_scavenge");
-  grpc_resource_quota_resize(q, 1024);
-  grpc_resource_user *usr1 = grpc_resource_user_create(q, "usr1");
-  grpc_resource_user *usr2 = grpc_resource_user_create(q, "usr2");
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr1, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  gpr_event reclaim_done;
-  gpr_event_init(&reclaim_done);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_post_reclaimer(
-        &exec_ctx, usr1, false,
-        make_reclaimer(usr1, 1024, set_event(&reclaim_done)));
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr2, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&reclaim_done,
-                              grpc_timeout_seconds_to_deadline(5)) != NULL);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr2, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr1);
-  destroy_user(usr2);
-}
-
-static void test_blocked_until_scheduled_destructive_reclaim(void) {
-  gpr_log(GPR_INFO, "** test_blocked_until_scheduled_destructive_reclaim **");
-  grpc_resource_quota *q = grpc_resource_quota_create(
-      "test_blocked_until_scheduled_destructive_reclaim");
-  grpc_resource_quota_resize(q, 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  gpr_event reclaim_done;
-  gpr_event_init(&reclaim_done);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_post_reclaimer(
-        &exec_ctx, usr, true,
-        make_reclaimer(usr, 1024, set_event(&reclaim_done)));
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&reclaim_done,
-                              grpc_timeout_seconds_to_deadline(5)) != NULL);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-}
-
-static void test_unused_reclaim_is_cancelled(void) {
-  gpr_log(GPR_INFO, "** test_unused_reclaim_is_cancelled **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_unused_reclaim_is_cancelled");
-  grpc_resource_quota_resize(q, 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  gpr_event benign_done;
-  gpr_event_init(&benign_done);
-  gpr_event destructive_done;
-  gpr_event_init(&destructive_done);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_post_reclaimer(
-        &exec_ctx, usr, false, make_unused_reclaimer(set_event(&benign_done)));
-    grpc_resource_user_post_reclaimer(
-        &exec_ctx, usr, true,
-        make_unused_reclaimer(set_event(&destructive_done)));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&benign_done,
-                              grpc_timeout_milliseconds_to_deadline(100)) ==
-               NULL);
-    GPR_ASSERT(gpr_event_wait(&destructive_done,
-                              grpc_timeout_milliseconds_to_deadline(100)) ==
-               NULL);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-  GPR_ASSERT(gpr_event_wait(&benign_done,
-                            grpc_timeout_seconds_to_deadline(5)) != NULL);
-  GPR_ASSERT(gpr_event_wait(&destructive_done,
-                            grpc_timeout_seconds_to_deadline(5)) != NULL);
-}
-
-static void test_benign_reclaim_is_preferred(void) {
-  gpr_log(GPR_INFO, "** test_benign_reclaim_is_preferred **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_benign_reclaim_is_preferred");
-  grpc_resource_quota_resize(q, 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  gpr_event benign_done;
-  gpr_event_init(&benign_done);
-  gpr_event destructive_done;
-  gpr_event_init(&destructive_done);
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_post_reclaimer(
-        &exec_ctx, usr, false,
-        make_reclaimer(usr, 1024, set_event(&benign_done)));
-    grpc_resource_user_post_reclaimer(
-        &exec_ctx, usr, true,
-        make_unused_reclaimer(set_event(&destructive_done)));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&benign_done,
-                              grpc_timeout_milliseconds_to_deadline(100)) ==
-               NULL);
-    GPR_ASSERT(gpr_event_wait(&destructive_done,
-                              grpc_timeout_milliseconds_to_deadline(100)) ==
-               NULL);
-  }
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&benign_done,
-                              grpc_timeout_seconds_to_deadline(5)) != NULL);
-    GPR_ASSERT(gpr_event_wait(&destructive_done,
-                              grpc_timeout_milliseconds_to_deadline(100)) ==
-               NULL);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-  GPR_ASSERT(gpr_event_wait(&benign_done,
-                            grpc_timeout_seconds_to_deadline(5)) != NULL);
-  GPR_ASSERT(gpr_event_wait(&destructive_done,
-                            grpc_timeout_seconds_to_deadline(5)) != NULL);
-}
-
-static void test_multiple_reclaims_can_be_triggered(void) {
-  gpr_log(GPR_INFO, "** test_multiple_reclaims_can_be_triggered **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_multiple_reclaims_can_be_triggered");
-  grpc_resource_quota_resize(q, 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  gpr_event benign_done;
-  gpr_event_init(&benign_done);
-  gpr_event destructive_done;
-  gpr_event_init(&destructive_done);
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_post_reclaimer(
-        &exec_ctx, usr, false,
-        make_reclaimer(usr, 512, set_event(&benign_done)));
-    grpc_resource_user_post_reclaimer(
-        &exec_ctx, usr, true,
-        make_reclaimer(usr, 512, set_event(&destructive_done)));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&benign_done,
-                              grpc_timeout_milliseconds_to_deadline(100)) ==
-               NULL);
-    GPR_ASSERT(gpr_event_wait(&destructive_done,
-                              grpc_timeout_milliseconds_to_deadline(100)) ==
-               NULL);
-  }
-  {
-    gpr_event ev;
-    gpr_event_init(&ev);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&benign_done,
-                              grpc_timeout_seconds_to_deadline(5)) != NULL);
-    GPR_ASSERT(gpr_event_wait(&destructive_done,
-                              grpc_timeout_seconds_to_deadline(5)) != NULL);
-    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
-               NULL);
-    ;
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_resource_quota_unref(q);
-  destroy_user(usr);
-  GPR_ASSERT(gpr_event_wait(&benign_done,
-                            grpc_timeout_seconds_to_deadline(5)) != NULL);
-  GPR_ASSERT(gpr_event_wait(&destructive_done,
-                            grpc_timeout_seconds_to_deadline(5)) != NULL);
-}
-
-static void test_resource_user_stays_allocated_until_memory_released(void) {
-  gpr_log(GPR_INFO,
-          "** test_resource_user_stays_allocated_until_memory_released **");
-  grpc_resource_quota *q = grpc_resource_quota_create(
-      "test_resource_user_stays_allocated_until_memory_released");
-  grpc_resource_quota_resize(q, 1024 * 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, NULL);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_quota_unref(q);
-    grpc_resource_user_unref(&exec_ctx, usr);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static void
-test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released(
-    void) {
-  gpr_log(GPR_INFO,
-          "** "
-          "test_resource_user_stays_allocated_and_reclaimers_unrun_until_"
-          "memory_released **");
-  grpc_resource_quota *q = grpc_resource_quota_create(
-      "test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_"
-      "released");
-  grpc_resource_quota_resize(q, 1024);
-  for (int i = 0; i < 10; i++) {
-    grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-    gpr_event reclaimer_cancelled;
-    gpr_event_init(&reclaimer_cancelled);
-    {
-      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-      grpc_resource_user_post_reclaimer(
-          &exec_ctx, usr, false,
-          make_unused_reclaimer(set_event(&reclaimer_cancelled)));
-      grpc_exec_ctx_finish(&exec_ctx);
-      GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled,
-                                grpc_timeout_milliseconds_to_deadline(100)) ==
-                 NULL);
-    }
-    {
-      gpr_event allocated;
-      gpr_event_init(&allocated);
-      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-      grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated));
-      grpc_exec_ctx_finish(&exec_ctx);
-      GPR_ASSERT(gpr_event_wait(&allocated,
-                                grpc_timeout_seconds_to_deadline(5)) != NULL);
-      GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled,
-                                grpc_timeout_milliseconds_to_deadline(100)) ==
-                 NULL);
-    }
-    {
-      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-      grpc_resource_user_unref(&exec_ctx, usr);
-      grpc_exec_ctx_finish(&exec_ctx);
-      GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled,
-                                grpc_timeout_milliseconds_to_deadline(100)) ==
-                 NULL);
-    }
-    {
-      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-      grpc_resource_user_free(&exec_ctx, usr, 1024);
-      grpc_exec_ctx_finish(&exec_ctx);
-      GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled,
-                                grpc_timeout_seconds_to_deadline(5)) != NULL);
-    }
-  }
-  grpc_resource_quota_unref(q);
-}
-
-static void test_reclaimers_can_be_posted_repeatedly(void) {
-  gpr_log(GPR_INFO, "** test_reclaimers_can_be_posted_repeatedly **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_reclaimers_can_be_posted_repeatedly");
-  grpc_resource_quota_resize(q, 1024);
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-  {
-    gpr_event allocated;
-    gpr_event_init(&allocated);
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated));
-    grpc_exec_ctx_finish(&exec_ctx);
-    GPR_ASSERT(gpr_event_wait(&allocated,
-                              grpc_timeout_seconds_to_deadline(5)) != NULL);
-  }
-  for (int i = 0; i < 10; i++) {
-    gpr_event reclaimer_done;
-    gpr_event_init(&reclaimer_done);
-    {
-      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-      grpc_resource_user_post_reclaimer(
-          &exec_ctx, usr, false,
-          make_reclaimer(usr, 1024, set_event(&reclaimer_done)));
-      grpc_exec_ctx_finish(&exec_ctx);
-      GPR_ASSERT(gpr_event_wait(&reclaimer_done,
-                                grpc_timeout_milliseconds_to_deadline(100)) ==
-                 NULL);
-    }
-    {
-      gpr_event allocated;
-      gpr_event_init(&allocated);
-      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-      grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated));
-      grpc_exec_ctx_finish(&exec_ctx);
-      GPR_ASSERT(gpr_event_wait(&allocated,
-                                grpc_timeout_seconds_to_deadline(5)) != NULL);
-      GPR_ASSERT(gpr_event_wait(&reclaimer_done,
-                                grpc_timeout_seconds_to_deadline(5)) != NULL);
-    }
-  }
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_free(&exec_ctx, usr, 1024);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  destroy_user(usr);
-  grpc_resource_quota_unref(q);
-}
-
-static void test_one_slice(void) {
-  gpr_log(GPR_INFO, "** test_one_slice **");
-
-  grpc_resource_quota *q = grpc_resource_quota_create("test_one_slice");
-  grpc_resource_quota_resize(q, 1024);
-
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-
-  grpc_resource_user_slice_allocator alloc;
-  int num_allocs = 0;
-  grpc_resource_user_slice_allocator_init(&alloc, usr, inc_int_cb, &num_allocs);
-
-  grpc_slice_buffer buffer;
-  grpc_slice_buffer_init(&buffer);
-
-  {
-    const int start_allocs = num_allocs;
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc_slices(&exec_ctx, &alloc, 1024, 1, &buffer);
-    grpc_exec_ctx_finish(&exec_ctx);
-    assert_counter_becomes(&num_allocs, start_allocs + 1);
-  }
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  destroy_user(usr);
-  grpc_resource_quota_unref(q);
-}
-
-static void test_one_slice_deleted_late(void) {
-  gpr_log(GPR_INFO, "** test_one_slice_deleted_late **");
-
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_one_slice_deleted_late");
-  grpc_resource_quota_resize(q, 1024);
-
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-
-  grpc_resource_user_slice_allocator alloc;
-  int num_allocs = 0;
-  grpc_resource_user_slice_allocator_init(&alloc, usr, inc_int_cb, &num_allocs);
-
-  grpc_slice_buffer buffer;
-  grpc_slice_buffer_init(&buffer);
-
-  {
-    const int start_allocs = num_allocs;
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc_slices(&exec_ctx, &alloc, 1024, 1, &buffer);
-    grpc_exec_ctx_finish(&exec_ctx);
-    assert_counter_becomes(&num_allocs, start_allocs + 1);
-  }
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_unref(&exec_ctx, usr);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  grpc_resource_quota_unref(q);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static void test_resize_to_zero(void) {
-  gpr_log(GPR_INFO, "** test_resize_to_zero **");
-  grpc_resource_quota *q = grpc_resource_quota_create("test_resize_to_zero");
-  grpc_resource_quota_resize(q, 0);
-  grpc_resource_quota_unref(q);
-}
-
-static void test_negative_rq_free_pool(void) {
-  gpr_log(GPR_INFO, "** test_negative_rq_free_pool **");
-  grpc_resource_quota *q =
-      grpc_resource_quota_create("test_negative_rq_free_pool");
-  grpc_resource_quota_resize(q, 1024);
-
-  grpc_resource_user *usr = grpc_resource_user_create(q, "usr");
-
-  grpc_resource_user_slice_allocator alloc;
-  int num_allocs = 0;
-  grpc_resource_user_slice_allocator_init(&alloc, usr, inc_int_cb, &num_allocs);
-
-  grpc_slice_buffer buffer;
-  grpc_slice_buffer_init(&buffer);
-
-  {
-    const int start_allocs = num_allocs;
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_alloc_slices(&exec_ctx, &alloc, 1024, 1, &buffer);
-    grpc_exec_ctx_finish(&exec_ctx);
-    assert_counter_becomes(&num_allocs, start_allocs + 1);
-  }
-
-  grpc_resource_quota_resize(q, 512);
-
-  double eps = 0.0001;
-  GPR_ASSERT(grpc_resource_quota_get_memory_pressure(q) < 1 + eps);
-  GPR_ASSERT(grpc_resource_quota_get_memory_pressure(q) > 1 - eps);
-
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_resource_user_unref(&exec_ctx, usr);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  grpc_resource_quota_unref(q);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  gpr_mu_init(&g_mu);
-  gpr_cv_init(&g_cv);
-  test_no_op();
-  test_resize_then_destroy();
-  test_resource_user_no_op();
-  test_instant_alloc_then_free();
-  test_instant_alloc_free_pair();
-  test_simple_async_alloc();
-  test_async_alloc_blocked_by_size();
-  test_scavenge();
-  test_scavenge_blocked();
-  test_blocked_until_scheduled_reclaim();
-  test_blocked_until_scheduled_reclaim_and_scavenge();
-  test_blocked_until_scheduled_destructive_reclaim();
-  test_unused_reclaim_is_cancelled();
-  test_benign_reclaim_is_preferred();
-  test_multiple_reclaims_can_be_triggered();
-  test_resource_user_stays_allocated_until_memory_released();
-  test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released();
-  test_reclaimers_can_be_posted_repeatedly();
-  test_one_slice();
-  test_one_slice_deleted_late();
-  test_resize_to_zero();
-  test_negative_rq_free_pool();
-  gpr_mu_destroy(&g_mu);
-  gpr_cv_destroy(&g_cv);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/iomgr/resource_quota_test.cc b/test/core/iomgr/resource_quota_test.cc
new file mode 100644
index 0000000..8a2faae
--- /dev/null
+++ b/test/core/iomgr/resource_quota_test.cc
@@ -0,0 +1,866 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/resource_quota.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+#include "test/core/util/test_config.h"
+
+gpr_mu g_mu;
+gpr_cv g_cv;
+
+static void inc_int_cb(grpc_exec_ctx* exec_ctx, void* a, grpc_error* error) {
+  gpr_mu_lock(&g_mu);
+  ++*(int*)a;
+  gpr_cv_signal(&g_cv);
+  gpr_mu_unlock(&g_mu);
+}
+
+static void assert_counter_becomes(int* ctr, int value) {
+  gpr_mu_lock(&g_mu);
+  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
+  while (*ctr != value) {
+    GPR_ASSERT(!gpr_cv_wait(&g_cv, &g_mu, deadline));
+  }
+  gpr_mu_unlock(&g_mu);
+}
+
+static void set_event_cb(grpc_exec_ctx* exec_ctx, void* a, grpc_error* error) {
+  gpr_event_set((gpr_event*)a, (void*)1);
+}
+grpc_closure* set_event(gpr_event* ev) {
+  return GRPC_CLOSURE_CREATE(set_event_cb, ev, grpc_schedule_on_exec_ctx);
+}
+
+typedef struct {
+  size_t size;
+  grpc_resource_user* resource_user;
+  grpc_closure* then;
+} reclaimer_args;
+
+static void reclaimer_cb(grpc_exec_ctx* exec_ctx, void* args,
+                         grpc_error* error) {
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  reclaimer_args* a = static_cast<reclaimer_args*>(args);
+  grpc_resource_user_free(exec_ctx, a->resource_user, a->size);
+  grpc_resource_user_finish_reclamation(exec_ctx, a->resource_user);
+  GRPC_CLOSURE_RUN(exec_ctx, a->then, GRPC_ERROR_NONE);
+  gpr_free(a);
+}
+
+grpc_closure* make_reclaimer(grpc_resource_user* resource_user, size_t size,
+                             grpc_closure* then) {
+  reclaimer_args* a = static_cast<reclaimer_args*>(gpr_malloc(sizeof(*a)));
+  a->size = size;
+  a->resource_user = resource_user;
+  a->then = then;
+  return GRPC_CLOSURE_CREATE(reclaimer_cb, a, grpc_schedule_on_exec_ctx);
+}
+
+static void unused_reclaimer_cb(grpc_exec_ctx* exec_ctx, void* arg,
+                                grpc_error* error) {
+  GPR_ASSERT(error == GRPC_ERROR_CANCELLED);
+  GRPC_CLOSURE_RUN(exec_ctx, static_cast<grpc_closure*>(arg), GRPC_ERROR_NONE);
+}
+grpc_closure* make_unused_reclaimer(grpc_closure* then) {
+  return GRPC_CLOSURE_CREATE(unused_reclaimer_cb, then,
+                             grpc_schedule_on_exec_ctx);
+}
+
+static void destroy_user(grpc_resource_user* usr) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resource_user_unref(&exec_ctx, usr);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_op(void) {
+  gpr_log(GPR_INFO, "** test_no_op **");
+  grpc_resource_quota_unref(grpc_resource_quota_create("test_no_op"));
+}
+
+static void test_resize_then_destroy(void) {
+  gpr_log(GPR_INFO, "** test_resize_then_destroy **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_resize_then_destroy");
+  grpc_resource_quota_resize(q, 1024 * 1024);
+  grpc_resource_quota_unref(q);
+}
+
+static void test_resource_user_no_op(void) {
+  gpr_log(GPR_INFO, "** test_resource_user_no_op **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_resource_user_no_op");
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+}
+
+static void test_instant_alloc_then_free(void) {
+  gpr_log(GPR_INFO, "** test_instant_alloc_then_free **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_instant_alloc_then_free");
+  grpc_resource_quota_resize(q, 1024 * 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, NULL);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+}
+
+static void test_instant_alloc_free_pair(void) {
+  gpr_log(GPR_INFO, "** test_instant_alloc_free_pair **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_instant_alloc_free_pair");
+  grpc_resource_quota_resize(q, 1024 * 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, NULL);
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+}
+
+static void test_simple_async_alloc(void) {
+  gpr_log(GPR_INFO, "** test_simple_async_alloc **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_simple_async_alloc");
+  grpc_resource_quota_resize(q, 1024 * 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+}
+
+static void test_async_alloc_blocked_by_size(void) {
+  gpr_log(GPR_INFO, "** test_async_alloc_blocked_by_size **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_async_alloc_blocked_by_size");
+  grpc_resource_quota_resize(q, 1);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  gpr_event ev;
+  gpr_event_init(&ev);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(
+                   &ev, grpc_timeout_milliseconds_to_deadline(100)) == NULL);
+  }
+  grpc_resource_quota_resize(q, 1024);
+  GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != NULL);
+  ;
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+}
+
+static void test_scavenge(void) {
+  gpr_log(GPR_INFO, "** test_scavenge **");
+  grpc_resource_quota* q = grpc_resource_quota_create("test_scavenge");
+  grpc_resource_quota_resize(q, 1024);
+  grpc_resource_user* usr1 = grpc_resource_user_create(q, "usr1");
+  grpc_resource_user* usr2 = grpc_resource_user_create(q, "usr2");
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr1, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr1, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr2, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr2, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr1);
+  destroy_user(usr2);
+}
+
+static void test_scavenge_blocked(void) {
+  gpr_log(GPR_INFO, "** test_scavenge_blocked **");
+  grpc_resource_quota* q = grpc_resource_quota_create("test_scavenge_blocked");
+  grpc_resource_quota_resize(q, 1024);
+  grpc_resource_user* usr1 = grpc_resource_user_create(q, "usr1");
+  grpc_resource_user* usr2 = grpc_resource_user_create(q, "usr2");
+  gpr_event ev;
+  {
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr1, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr2, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(
+                   &ev, grpc_timeout_milliseconds_to_deadline(100)) == NULL);
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr1, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr2, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr1);
+  destroy_user(usr2);
+}
+
+static void test_blocked_until_scheduled_reclaim(void) {
+  gpr_log(GPR_INFO, "** test_blocked_until_scheduled_reclaim **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_blocked_until_scheduled_reclaim");
+  grpc_resource_quota_resize(q, 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  gpr_event reclaim_done;
+  gpr_event_init(&reclaim_done);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_post_reclaimer(
+        &exec_ctx, usr, false,
+        make_reclaimer(usr, 1024, set_event(&reclaim_done)));
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&reclaim_done,
+                              grpc_timeout_seconds_to_deadline(5)) != NULL);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+}
+
+static void test_blocked_until_scheduled_reclaim_and_scavenge(void) {
+  gpr_log(GPR_INFO, "** test_blocked_until_scheduled_reclaim_and_scavenge **");
+  grpc_resource_quota* q = grpc_resource_quota_create(
+      "test_blocked_until_scheduled_reclaim_and_scavenge");
+  grpc_resource_quota_resize(q, 1024);
+  grpc_resource_user* usr1 = grpc_resource_user_create(q, "usr1");
+  grpc_resource_user* usr2 = grpc_resource_user_create(q, "usr2");
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr1, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  gpr_event reclaim_done;
+  gpr_event_init(&reclaim_done);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_post_reclaimer(
+        &exec_ctx, usr1, false,
+        make_reclaimer(usr1, 1024, set_event(&reclaim_done)));
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr2, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&reclaim_done,
+                              grpc_timeout_seconds_to_deadline(5)) != NULL);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr2, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr1);
+  destroy_user(usr2);
+}
+
+static void test_blocked_until_scheduled_destructive_reclaim(void) {
+  gpr_log(GPR_INFO, "** test_blocked_until_scheduled_destructive_reclaim **");
+  grpc_resource_quota* q = grpc_resource_quota_create(
+      "test_blocked_until_scheduled_destructive_reclaim");
+  grpc_resource_quota_resize(q, 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  gpr_event reclaim_done;
+  gpr_event_init(&reclaim_done);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_post_reclaimer(
+        &exec_ctx, usr, true,
+        make_reclaimer(usr, 1024, set_event(&reclaim_done)));
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&reclaim_done,
+                              grpc_timeout_seconds_to_deadline(5)) != NULL);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+}
+
+static void test_unused_reclaim_is_cancelled(void) {
+  gpr_log(GPR_INFO, "** test_unused_reclaim_is_cancelled **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_unused_reclaim_is_cancelled");
+  grpc_resource_quota_resize(q, 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  gpr_event benign_done;
+  gpr_event_init(&benign_done);
+  gpr_event destructive_done;
+  gpr_event_init(&destructive_done);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_post_reclaimer(
+        &exec_ctx, usr, false, make_unused_reclaimer(set_event(&benign_done)));
+    grpc_resource_user_post_reclaimer(
+        &exec_ctx, usr, true,
+        make_unused_reclaimer(set_event(&destructive_done)));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&benign_done,
+                              grpc_timeout_milliseconds_to_deadline(100)) ==
+               NULL);
+    GPR_ASSERT(gpr_event_wait(&destructive_done,
+                              grpc_timeout_milliseconds_to_deadline(100)) ==
+               NULL);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+  GPR_ASSERT(gpr_event_wait(&benign_done,
+                            grpc_timeout_seconds_to_deadline(5)) != NULL);
+  GPR_ASSERT(gpr_event_wait(&destructive_done,
+                            grpc_timeout_seconds_to_deadline(5)) != NULL);
+}
+
+static void test_benign_reclaim_is_preferred(void) {
+  gpr_log(GPR_INFO, "** test_benign_reclaim_is_preferred **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_benign_reclaim_is_preferred");
+  grpc_resource_quota_resize(q, 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  gpr_event benign_done;
+  gpr_event_init(&benign_done);
+  gpr_event destructive_done;
+  gpr_event_init(&destructive_done);
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_post_reclaimer(
+        &exec_ctx, usr, false,
+        make_reclaimer(usr, 1024, set_event(&benign_done)));
+    grpc_resource_user_post_reclaimer(
+        &exec_ctx, usr, true,
+        make_unused_reclaimer(set_event(&destructive_done)));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&benign_done,
+                              grpc_timeout_milliseconds_to_deadline(100)) ==
+               NULL);
+    GPR_ASSERT(gpr_event_wait(&destructive_done,
+                              grpc_timeout_milliseconds_to_deadline(100)) ==
+               NULL);
+  }
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&benign_done,
+                              grpc_timeout_seconds_to_deadline(5)) != NULL);
+    GPR_ASSERT(gpr_event_wait(&destructive_done,
+                              grpc_timeout_milliseconds_to_deadline(100)) ==
+               NULL);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+  GPR_ASSERT(gpr_event_wait(&benign_done,
+                            grpc_timeout_seconds_to_deadline(5)) != NULL);
+  GPR_ASSERT(gpr_event_wait(&destructive_done,
+                            grpc_timeout_seconds_to_deadline(5)) != NULL);
+}
+
+static void test_multiple_reclaims_can_be_triggered(void) {
+  gpr_log(GPR_INFO, "** test_multiple_reclaims_can_be_triggered **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_multiple_reclaims_can_be_triggered");
+  grpc_resource_quota_resize(q, 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  gpr_event benign_done;
+  gpr_event_init(&benign_done);
+  gpr_event destructive_done;
+  gpr_event_init(&destructive_done);
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_post_reclaimer(
+        &exec_ctx, usr, false,
+        make_reclaimer(usr, 512, set_event(&benign_done)));
+    grpc_resource_user_post_reclaimer(
+        &exec_ctx, usr, true,
+        make_reclaimer(usr, 512, set_event(&destructive_done)));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&benign_done,
+                              grpc_timeout_milliseconds_to_deadline(100)) ==
+               NULL);
+    GPR_ASSERT(gpr_event_wait(&destructive_done,
+                              grpc_timeout_milliseconds_to_deadline(100)) ==
+               NULL);
+  }
+  {
+    gpr_event ev;
+    gpr_event_init(&ev);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&ev));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&benign_done,
+                              grpc_timeout_seconds_to_deadline(5)) != NULL);
+    GPR_ASSERT(gpr_event_wait(&destructive_done,
+                              grpc_timeout_seconds_to_deadline(5)) != NULL);
+    GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) !=
+               NULL);
+    ;
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_resource_quota_unref(q);
+  destroy_user(usr);
+  GPR_ASSERT(gpr_event_wait(&benign_done,
+                            grpc_timeout_seconds_to_deadline(5)) != NULL);
+  GPR_ASSERT(gpr_event_wait(&destructive_done,
+                            grpc_timeout_seconds_to_deadline(5)) != NULL);
+}
+
+static void test_resource_user_stays_allocated_until_memory_released(void) {
+  gpr_log(GPR_INFO,
+          "** test_resource_user_stays_allocated_until_memory_released **");
+  grpc_resource_quota* q = grpc_resource_quota_create(
+      "test_resource_user_stays_allocated_until_memory_released");
+  grpc_resource_quota_resize(q, 1024 * 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, NULL);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_quota_unref(q);
+    grpc_resource_user_unref(&exec_ctx, usr);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void
+test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released(
+    void) {
+  gpr_log(GPR_INFO,
+          "** "
+          "test_resource_user_stays_allocated_and_reclaimers_unrun_until_"
+          "memory_released **");
+  grpc_resource_quota* q = grpc_resource_quota_create(
+      "test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_"
+      "released");
+  grpc_resource_quota_resize(q, 1024);
+  for (int i = 0; i < 10; i++) {
+    grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+    gpr_event reclaimer_cancelled;
+    gpr_event_init(&reclaimer_cancelled);
+    {
+      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+      grpc_resource_user_post_reclaimer(
+          &exec_ctx, usr, false,
+          make_unused_reclaimer(set_event(&reclaimer_cancelled)));
+      grpc_exec_ctx_finish(&exec_ctx);
+      GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled,
+                                grpc_timeout_milliseconds_to_deadline(100)) ==
+                 NULL);
+    }
+    {
+      gpr_event allocated;
+      gpr_event_init(&allocated);
+      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+      grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated));
+      grpc_exec_ctx_finish(&exec_ctx);
+      GPR_ASSERT(gpr_event_wait(&allocated,
+                                grpc_timeout_seconds_to_deadline(5)) != NULL);
+      GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled,
+                                grpc_timeout_milliseconds_to_deadline(100)) ==
+                 NULL);
+    }
+    {
+      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+      grpc_resource_user_unref(&exec_ctx, usr);
+      grpc_exec_ctx_finish(&exec_ctx);
+      GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled,
+                                grpc_timeout_milliseconds_to_deadline(100)) ==
+                 NULL);
+    }
+    {
+      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+      grpc_resource_user_free(&exec_ctx, usr, 1024);
+      grpc_exec_ctx_finish(&exec_ctx);
+      GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled,
+                                grpc_timeout_seconds_to_deadline(5)) != NULL);
+    }
+  }
+  grpc_resource_quota_unref(q);
+}
+
+static void test_reclaimers_can_be_posted_repeatedly(void) {
+  gpr_log(GPR_INFO, "** test_reclaimers_can_be_posted_repeatedly **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_reclaimers_can_be_posted_repeatedly");
+  grpc_resource_quota_resize(q, 1024);
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+  {
+    gpr_event allocated;
+    gpr_event_init(&allocated);
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated));
+    grpc_exec_ctx_finish(&exec_ctx);
+    GPR_ASSERT(gpr_event_wait(&allocated,
+                              grpc_timeout_seconds_to_deadline(5)) != NULL);
+  }
+  for (int i = 0; i < 10; i++) {
+    gpr_event reclaimer_done;
+    gpr_event_init(&reclaimer_done);
+    {
+      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+      grpc_resource_user_post_reclaimer(
+          &exec_ctx, usr, false,
+          make_reclaimer(usr, 1024, set_event(&reclaimer_done)));
+      grpc_exec_ctx_finish(&exec_ctx);
+      GPR_ASSERT(gpr_event_wait(&reclaimer_done,
+                                grpc_timeout_milliseconds_to_deadline(100)) ==
+                 NULL);
+    }
+    {
+      gpr_event allocated;
+      gpr_event_init(&allocated);
+      grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+      grpc_resource_user_alloc(&exec_ctx, usr, 1024, set_event(&allocated));
+      grpc_exec_ctx_finish(&exec_ctx);
+      GPR_ASSERT(gpr_event_wait(&allocated,
+                                grpc_timeout_seconds_to_deadline(5)) != NULL);
+      GPR_ASSERT(gpr_event_wait(&reclaimer_done,
+                                grpc_timeout_seconds_to_deadline(5)) != NULL);
+    }
+  }
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_free(&exec_ctx, usr, 1024);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  destroy_user(usr);
+  grpc_resource_quota_unref(q);
+}
+
+static void test_one_slice(void) {
+  gpr_log(GPR_INFO, "** test_one_slice **");
+
+  grpc_resource_quota* q = grpc_resource_quota_create("test_one_slice");
+  grpc_resource_quota_resize(q, 1024);
+
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+
+  grpc_resource_user_slice_allocator alloc;
+  int num_allocs = 0;
+  grpc_resource_user_slice_allocator_init(&alloc, usr, inc_int_cb, &num_allocs);
+
+  grpc_slice_buffer buffer;
+  grpc_slice_buffer_init(&buffer);
+
+  {
+    const int start_allocs = num_allocs;
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc_slices(&exec_ctx, &alloc, 1024, 1, &buffer);
+    grpc_exec_ctx_finish(&exec_ctx);
+    assert_counter_becomes(&num_allocs, start_allocs + 1);
+  }
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  destroy_user(usr);
+  grpc_resource_quota_unref(q);
+}
+
+static void test_one_slice_deleted_late(void) {
+  gpr_log(GPR_INFO, "** test_one_slice_deleted_late **");
+
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_one_slice_deleted_late");
+  grpc_resource_quota_resize(q, 1024);
+
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+
+  grpc_resource_user_slice_allocator alloc;
+  int num_allocs = 0;
+  grpc_resource_user_slice_allocator_init(&alloc, usr, inc_int_cb, &num_allocs);
+
+  grpc_slice_buffer buffer;
+  grpc_slice_buffer_init(&buffer);
+
+  {
+    const int start_allocs = num_allocs;
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc_slices(&exec_ctx, &alloc, 1024, 1, &buffer);
+    grpc_exec_ctx_finish(&exec_ctx);
+    assert_counter_becomes(&num_allocs, start_allocs + 1);
+  }
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_unref(&exec_ctx, usr);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  grpc_resource_quota_unref(q);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_resize_to_zero(void) {
+  gpr_log(GPR_INFO, "** test_resize_to_zero **");
+  grpc_resource_quota* q = grpc_resource_quota_create("test_resize_to_zero");
+  grpc_resource_quota_resize(q, 0);
+  grpc_resource_quota_unref(q);
+}
+
+static void test_negative_rq_free_pool(void) {
+  gpr_log(GPR_INFO, "** test_negative_rq_free_pool **");
+  grpc_resource_quota* q =
+      grpc_resource_quota_create("test_negative_rq_free_pool");
+  grpc_resource_quota_resize(q, 1024);
+
+  grpc_resource_user* usr = grpc_resource_user_create(q, "usr");
+
+  grpc_resource_user_slice_allocator alloc;
+  int num_allocs = 0;
+  grpc_resource_user_slice_allocator_init(&alloc, usr, inc_int_cb, &num_allocs);
+
+  grpc_slice_buffer buffer;
+  grpc_slice_buffer_init(&buffer);
+
+  {
+    const int start_allocs = num_allocs;
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_alloc_slices(&exec_ctx, &alloc, 1024, 1, &buffer);
+    grpc_exec_ctx_finish(&exec_ctx);
+    assert_counter_becomes(&num_allocs, start_allocs + 1);
+  }
+
+  grpc_resource_quota_resize(q, 512);
+
+  double eps = 0.0001;
+  GPR_ASSERT(grpc_resource_quota_get_memory_pressure(q) < 1 + eps);
+  GPR_ASSERT(grpc_resource_quota_get_memory_pressure(q) > 1 - eps);
+
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_resource_user_unref(&exec_ctx, usr);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  grpc_resource_quota_unref(q);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  gpr_mu_init(&g_mu);
+  gpr_cv_init(&g_cv);
+  test_no_op();
+  test_resize_then_destroy();
+  test_resource_user_no_op();
+  test_instant_alloc_then_free();
+  test_instant_alloc_free_pair();
+  test_simple_async_alloc();
+  test_async_alloc_blocked_by_size();
+  test_scavenge();
+  test_scavenge_blocked();
+  test_blocked_until_scheduled_reclaim();
+  test_blocked_until_scheduled_reclaim_and_scavenge();
+  test_blocked_until_scheduled_destructive_reclaim();
+  test_unused_reclaim_is_cancelled();
+  test_benign_reclaim_is_preferred();
+  test_multiple_reclaims_can_be_triggered();
+  test_resource_user_stays_allocated_until_memory_released();
+  test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released();
+  test_reclaimers_can_be_posted_repeatedly();
+  test_one_slice();
+  test_one_slice_deleted_late();
+  test_resize_to_zero();
+  test_negative_rq_free_pool();
+  gpr_mu_destroy(&g_mu);
+  gpr_cv_destroy(&g_cv);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/iomgr/sockaddr_utils_test.c b/test/core/iomgr/sockaddr_utils_test.c
deleted file mode 100644
index e4a4dda..0000000
--- a/test/core/iomgr/sockaddr_utils_test.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
-   using that endpoint. Because of various transitive includes in uv.h,
-   including windows.h on Windows, uv.h must be included before other system
-   headers. Therefore, sockaddr.h must always be included first */
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-
-#include <errno.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include "test/core/util/test_config.h"
-
-static grpc_resolved_address make_addr4(const uint8_t *data, size_t data_len) {
-  grpc_resolved_address resolved_addr4;
-  struct sockaddr_in *addr4 = (struct sockaddr_in *)resolved_addr4.addr;
-  memset(&resolved_addr4, 0, sizeof(resolved_addr4));
-  addr4->sin_family = AF_INET;
-  GPR_ASSERT(data_len == sizeof(addr4->sin_addr.s_addr));
-  memcpy(&addr4->sin_addr.s_addr, data, data_len);
-  addr4->sin_port = htons(12345);
-  resolved_addr4.len = sizeof(struct sockaddr_in);
-  return resolved_addr4;
-}
-
-static grpc_resolved_address make_addr6(const uint8_t *data, size_t data_len) {
-  grpc_resolved_address resolved_addr6;
-  struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)resolved_addr6.addr;
-  memset(&resolved_addr6, 0, sizeof(resolved_addr6));
-  addr6->sin6_family = AF_INET6;
-  GPR_ASSERT(data_len == sizeof(addr6->sin6_addr.s6_addr));
-  memcpy(&addr6->sin6_addr.s6_addr, data, data_len);
-  addr6->sin6_port = htons(12345);
-  resolved_addr6.len = sizeof(struct sockaddr_in6);
-  return resolved_addr6;
-}
-
-static void set_addr6_scope_id(grpc_resolved_address *addr, uint32_t scope_id) {
-  struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr->addr;
-  GPR_ASSERT(addr6->sin6_family == AF_INET6);
-  addr6->sin6_scope_id = scope_id;
-}
-
-static const uint8_t kMapped[] = {0, 0, 0,    0,    0,   0, 0, 0,
-                                  0, 0, 0xff, 0xff, 192, 0, 2, 1};
-
-static const uint8_t kNotQuiteMapped[] = {0, 0, 0,    0,    0,   0, 0, 0,
-                                          0, 0, 0xff, 0xfe, 192, 0, 2, 99};
-static const uint8_t kIPv4[] = {192, 0, 2, 1};
-
-static const uint8_t kIPv6[] = {0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
-                                0,    0,    0,    0,    0, 0, 0, 1};
-
-static void test_sockaddr_is_v4mapped(void) {
-  grpc_resolved_address input4;
-  grpc_resolved_address input6;
-  grpc_resolved_address output4;
-  grpc_resolved_address expect4;
-
-  gpr_log(GPR_INFO, "%s", "test_sockaddr_is_v4mapped");
-
-  /* v4mapped input should succeed. */
-  input6 = make_addr6(kMapped, sizeof(kMapped));
-  GPR_ASSERT(grpc_sockaddr_is_v4mapped(&input6, NULL));
-  GPR_ASSERT(grpc_sockaddr_is_v4mapped(&input6, &output4));
-  expect4 = make_addr4(kIPv4, sizeof(kIPv4));
-  GPR_ASSERT(memcmp(&expect4, &output4, sizeof(expect4)) == 0);
-
-  /* Non-v4mapped input should fail. */
-  input6 = make_addr6(kNotQuiteMapped, sizeof(kNotQuiteMapped));
-  GPR_ASSERT(!grpc_sockaddr_is_v4mapped(&input6, NULL));
-  GPR_ASSERT(!grpc_sockaddr_is_v4mapped(&input6, &output4));
-  /* Output is unchanged. */
-  GPR_ASSERT(memcmp(&expect4, &output4, sizeof(expect4)) == 0);
-
-  /* Plain IPv4 input should also fail. */
-  input4 = make_addr4(kIPv4, sizeof(kIPv4));
-  GPR_ASSERT(!grpc_sockaddr_is_v4mapped(&input4, NULL));
-}
-
-static void test_sockaddr_to_v4mapped(void) {
-  grpc_resolved_address input4;
-  grpc_resolved_address input6;
-  grpc_resolved_address output6;
-  grpc_resolved_address expect6;
-
-  gpr_log(GPR_INFO, "%s", "test_sockaddr_to_v4mapped");
-
-  /* IPv4 input should succeed. */
-  input4 = make_addr4(kIPv4, sizeof(kIPv4));
-  GPR_ASSERT(grpc_sockaddr_to_v4mapped(&input4, &output6));
-  expect6 = make_addr6(kMapped, sizeof(kMapped));
-  GPR_ASSERT(memcmp(&expect6, &output6, sizeof(output6)) == 0);
-
-  /* IPv6 input should fail. */
-  input6 = make_addr6(kIPv6, sizeof(kIPv6));
-  GPR_ASSERT(!grpc_sockaddr_to_v4mapped(&input6, &output6));
-  /* Output is unchanged. */
-  GPR_ASSERT(memcmp(&expect6, &output6, sizeof(output6)) == 0);
-
-  /* Already-v4mapped input should also fail. */
-  input6 = make_addr6(kMapped, sizeof(kMapped));
-  GPR_ASSERT(!grpc_sockaddr_to_v4mapped(&input6, &output6));
-}
-
-static void test_sockaddr_is_wildcard(void) {
-  grpc_resolved_address wild4;
-  grpc_resolved_address wild6;
-  grpc_resolved_address wild_mapped;
-  grpc_resolved_address dummy;
-  struct sockaddr_in *wild4_addr;
-  struct sockaddr_in6 *wild6_addr;
-  struct sockaddr_in6 *wild_mapped_addr;
-  int port;
-
-  gpr_log(GPR_INFO, "%s", "test_sockaddr_is_wildcard");
-
-  /* Generate wildcards. */
-  grpc_sockaddr_make_wildcards(555, &wild4, &wild6);
-  GPR_ASSERT(grpc_sockaddr_to_v4mapped(&wild4, &wild_mapped));
-
-  /* Test 0.0.0.0:555 */
-  port = -1;
-  GPR_ASSERT(grpc_sockaddr_is_wildcard(&wild4, &port));
-  GPR_ASSERT(port == 555);
-  wild4_addr = (struct sockaddr_in *)&wild4.addr;
-  memset(&wild4_addr->sin_addr.s_addr, 0xbd, 1);
-  GPR_ASSERT(!grpc_sockaddr_is_wildcard(&wild4, &port));
-
-  /* Test [::]:555 */
-  port = -1;
-  GPR_ASSERT(grpc_sockaddr_is_wildcard(&wild6, &port));
-  GPR_ASSERT(port == 555);
-  wild6_addr = (struct sockaddr_in6 *)&wild6.addr;
-  memset(&wild6_addr->sin6_addr.s6_addr, 0xbd, 1);
-  GPR_ASSERT(!grpc_sockaddr_is_wildcard(&wild6, &port));
-
-  /* Test [::ffff:0.0.0.0]:555 */
-  port = -1;
-  GPR_ASSERT(grpc_sockaddr_is_wildcard(&wild_mapped, &port));
-  GPR_ASSERT(port == 555);
-  wild_mapped_addr = (struct sockaddr_in6 *)&wild_mapped.addr;
-  memset(&wild_mapped_addr->sin6_addr.s6_addr, 0xbd, 1);
-  GPR_ASSERT(!grpc_sockaddr_is_wildcard(&wild_mapped, &port));
-
-  /* Test AF_UNSPEC. */
-  port = -1;
-  memset(&dummy, 0, sizeof(dummy));
-  GPR_ASSERT(!grpc_sockaddr_is_wildcard(&dummy, &port));
-  GPR_ASSERT(port == -1);
-}
-
-static void expect_sockaddr_str(const char *expected,
-                                grpc_resolved_address *addr, int normalize) {
-  int result;
-  char *str;
-  gpr_log(GPR_INFO, "  expect_sockaddr_str(%s)", expected);
-  result = grpc_sockaddr_to_string(&str, addr, normalize);
-  GPR_ASSERT(str != NULL);
-  GPR_ASSERT(result >= 0);
-  GPR_ASSERT((size_t)result == strlen(str));
-  GPR_ASSERT(strcmp(expected, str) == 0);
-  gpr_free(str);
-}
-
-static void expect_sockaddr_uri(const char *expected,
-                                grpc_resolved_address *addr) {
-  char *str;
-  gpr_log(GPR_INFO, "  expect_sockaddr_uri(%s)", expected);
-  str = grpc_sockaddr_to_uri(addr);
-  GPR_ASSERT(str != NULL);
-  GPR_ASSERT(strcmp(expected, str) == 0);
-  gpr_free(str);
-}
-
-static void test_sockaddr_to_string(void) {
-  grpc_resolved_address input4;
-  grpc_resolved_address input6;
-  grpc_resolved_address dummy;
-  struct sockaddr *dummy_addr;
-
-  gpr_log(GPR_INFO, "%s", "test_sockaddr_to_string");
-
-  errno = 0x7EADBEEF;
-
-  input4 = make_addr4(kIPv4, sizeof(kIPv4));
-  expect_sockaddr_str("192.0.2.1:12345", &input4, 0);
-  expect_sockaddr_str("192.0.2.1:12345", &input4, 1);
-  expect_sockaddr_uri("ipv4:192.0.2.1:12345", &input4);
-
-  input6 = make_addr6(kIPv6, sizeof(kIPv6));
-  expect_sockaddr_str("[2001:db8::1]:12345", &input6, 0);
-  expect_sockaddr_str("[2001:db8::1]:12345", &input6, 1);
-  expect_sockaddr_uri("ipv6:[2001:db8::1]:12345", &input6);
-
-  set_addr6_scope_id(&input6, 2);
-  expect_sockaddr_str("[2001:db8::1%252]:12345", &input6, 0);
-  expect_sockaddr_str("[2001:db8::1%252]:12345", &input6, 1);
-  expect_sockaddr_uri("ipv6:[2001:db8::1%252]:12345", &input6);
-
-  set_addr6_scope_id(&input6, 101);
-  expect_sockaddr_str("[2001:db8::1%25101]:12345", &input6, 0);
-  expect_sockaddr_str("[2001:db8::1%25101]:12345", &input6, 1);
-  expect_sockaddr_uri("ipv6:[2001:db8::1%25101]:12345", &input6);
-
-  input6 = make_addr6(kMapped, sizeof(kMapped));
-  expect_sockaddr_str("[::ffff:192.0.2.1]:12345", &input6, 0);
-  expect_sockaddr_str("192.0.2.1:12345", &input6, 1);
-  expect_sockaddr_uri("ipv4:192.0.2.1:12345", &input6);
-
-  input6 = make_addr6(kNotQuiteMapped, sizeof(kNotQuiteMapped));
-  expect_sockaddr_str("[::fffe:c000:263]:12345", &input6, 0);
-  expect_sockaddr_str("[::fffe:c000:263]:12345", &input6, 1);
-  expect_sockaddr_uri("ipv6:[::fffe:c000:263]:12345", &input6);
-
-  memset(&dummy, 0, sizeof(dummy));
-  dummy_addr = (struct sockaddr *)dummy.addr;
-  dummy_addr->sa_family = 123;
-  expect_sockaddr_str("(sockaddr family=123)", &dummy, 0);
-  expect_sockaddr_str("(sockaddr family=123)", &dummy, 1);
-  GPR_ASSERT(grpc_sockaddr_to_uri(&dummy) == NULL);
-}
-
-static void test_sockaddr_set_get_port(void) {
-  grpc_resolved_address input4;
-  grpc_resolved_address input6;
-  grpc_resolved_address dummy;
-  struct sockaddr *dummy_addr;
-
-  gpr_log(GPR_DEBUG, "test_sockaddr_set_get_port");
-
-  input4 = make_addr4(kIPv4, sizeof(kIPv4));
-  GPR_ASSERT(grpc_sockaddr_get_port(&input4) == 12345);
-  GPR_ASSERT(grpc_sockaddr_set_port(&input4, 54321));
-  GPR_ASSERT(grpc_sockaddr_get_port(&input4) == 54321);
-
-  input6 = make_addr6(kIPv6, sizeof(kIPv6));
-  GPR_ASSERT(grpc_sockaddr_get_port(&input6) == 12345);
-  GPR_ASSERT(grpc_sockaddr_set_port(&input6, 54321));
-  GPR_ASSERT(grpc_sockaddr_get_port(&input6) == 54321);
-
-  memset(&dummy, 0, sizeof(dummy));
-  dummy_addr = (struct sockaddr *)dummy.addr;
-  dummy_addr->sa_family = 123;
-  GPR_ASSERT(grpc_sockaddr_get_port(&dummy) == 0);
-  GPR_ASSERT(grpc_sockaddr_set_port(&dummy, 1234) == 0);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  test_sockaddr_is_v4mapped();
-  test_sockaddr_to_v4mapped();
-  test_sockaddr_is_wildcard();
-  test_sockaddr_to_string();
-  test_sockaddr_set_get_port();
-
-  return 0;
-}
diff --git a/test/core/iomgr/sockaddr_utils_test.cc b/test/core/iomgr/sockaddr_utils_test.cc
new file mode 100644
index 0000000..40f2157
--- /dev/null
+++ b/test/core/iomgr/sockaddr_utils_test.cc
@@ -0,0 +1,279 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
+   using that endpoint. Because of various transitive includes in uv.h,
+   including windows.h on Windows, uv.h must be included before other system
+   headers. Therefore, sockaddr.h must always be included first */
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include <errno.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/port_platform.h>
+#include "test/core/util/test_config.h"
+
+static grpc_resolved_address make_addr4(const uint8_t* data, size_t data_len) {
+  grpc_resolved_address resolved_addr4;
+  struct sockaddr_in* addr4 = (struct sockaddr_in*)resolved_addr4.addr;
+  memset(&resolved_addr4, 0, sizeof(resolved_addr4));
+  addr4->sin_family = AF_INET;
+  GPR_ASSERT(data_len == sizeof(addr4->sin_addr.s_addr));
+  memcpy(&addr4->sin_addr.s_addr, data, data_len);
+  addr4->sin_port = htons(12345);
+  resolved_addr4.len = sizeof(struct sockaddr_in);
+  return resolved_addr4;
+}
+
+static grpc_resolved_address make_addr6(const uint8_t* data, size_t data_len) {
+  grpc_resolved_address resolved_addr6;
+  struct sockaddr_in6* addr6 = (struct sockaddr_in6*)resolved_addr6.addr;
+  memset(&resolved_addr6, 0, sizeof(resolved_addr6));
+  addr6->sin6_family = AF_INET6;
+  GPR_ASSERT(data_len == sizeof(addr6->sin6_addr.s6_addr));
+  memcpy(&addr6->sin6_addr.s6_addr, data, data_len);
+  addr6->sin6_port = htons(12345);
+  resolved_addr6.len = sizeof(struct sockaddr_in6);
+  return resolved_addr6;
+}
+
+static void set_addr6_scope_id(grpc_resolved_address* addr, uint32_t scope_id) {
+  struct sockaddr_in6* addr6 = (struct sockaddr_in6*)addr->addr;
+  GPR_ASSERT(addr6->sin6_family == AF_INET6);
+  addr6->sin6_scope_id = scope_id;
+}
+
+static const uint8_t kMapped[] = {0, 0, 0,    0,    0,   0, 0, 0,
+                                  0, 0, 0xff, 0xff, 192, 0, 2, 1};
+
+static const uint8_t kNotQuiteMapped[] = {0, 0, 0,    0,    0,   0, 0, 0,
+                                          0, 0, 0xff, 0xfe, 192, 0, 2, 99};
+static const uint8_t kIPv4[] = {192, 0, 2, 1};
+
+static const uint8_t kIPv6[] = {0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
+                                0,    0,    0,    0,    0, 0, 0, 1};
+
+static void test_sockaddr_is_v4mapped(void) {
+  grpc_resolved_address input4;
+  grpc_resolved_address input6;
+  grpc_resolved_address output4;
+  grpc_resolved_address expect4;
+
+  gpr_log(GPR_INFO, "%s", "test_sockaddr_is_v4mapped");
+
+  /* v4mapped input should succeed. */
+  input6 = make_addr6(kMapped, sizeof(kMapped));
+  GPR_ASSERT(grpc_sockaddr_is_v4mapped(&input6, NULL));
+  GPR_ASSERT(grpc_sockaddr_is_v4mapped(&input6, &output4));
+  expect4 = make_addr4(kIPv4, sizeof(kIPv4));
+  GPR_ASSERT(memcmp(&expect4, &output4, sizeof(expect4)) == 0);
+
+  /* Non-v4mapped input should fail. */
+  input6 = make_addr6(kNotQuiteMapped, sizeof(kNotQuiteMapped));
+  GPR_ASSERT(!grpc_sockaddr_is_v4mapped(&input6, NULL));
+  GPR_ASSERT(!grpc_sockaddr_is_v4mapped(&input6, &output4));
+  /* Output is unchanged. */
+  GPR_ASSERT(memcmp(&expect4, &output4, sizeof(expect4)) == 0);
+
+  /* Plain IPv4 input should also fail. */
+  input4 = make_addr4(kIPv4, sizeof(kIPv4));
+  GPR_ASSERT(!grpc_sockaddr_is_v4mapped(&input4, NULL));
+}
+
+static void test_sockaddr_to_v4mapped(void) {
+  grpc_resolved_address input4;
+  grpc_resolved_address input6;
+  grpc_resolved_address output6;
+  grpc_resolved_address expect6;
+
+  gpr_log(GPR_INFO, "%s", "test_sockaddr_to_v4mapped");
+
+  /* IPv4 input should succeed. */
+  input4 = make_addr4(kIPv4, sizeof(kIPv4));
+  GPR_ASSERT(grpc_sockaddr_to_v4mapped(&input4, &output6));
+  expect6 = make_addr6(kMapped, sizeof(kMapped));
+  GPR_ASSERT(memcmp(&expect6, &output6, sizeof(output6)) == 0);
+
+  /* IPv6 input should fail. */
+  input6 = make_addr6(kIPv6, sizeof(kIPv6));
+  GPR_ASSERT(!grpc_sockaddr_to_v4mapped(&input6, &output6));
+  /* Output is unchanged. */
+  GPR_ASSERT(memcmp(&expect6, &output6, sizeof(output6)) == 0);
+
+  /* Already-v4mapped input should also fail. */
+  input6 = make_addr6(kMapped, sizeof(kMapped));
+  GPR_ASSERT(!grpc_sockaddr_to_v4mapped(&input6, &output6));
+}
+
+static void test_sockaddr_is_wildcard(void) {
+  grpc_resolved_address wild4;
+  grpc_resolved_address wild6;
+  grpc_resolved_address wild_mapped;
+  grpc_resolved_address dummy;
+  struct sockaddr_in* wild4_addr;
+  struct sockaddr_in6* wild6_addr;
+  struct sockaddr_in6* wild_mapped_addr;
+  int port;
+
+  gpr_log(GPR_INFO, "%s", "test_sockaddr_is_wildcard");
+
+  /* Generate wildcards. */
+  grpc_sockaddr_make_wildcards(555, &wild4, &wild6);
+  GPR_ASSERT(grpc_sockaddr_to_v4mapped(&wild4, &wild_mapped));
+
+  /* Test 0.0.0.0:555 */
+  port = -1;
+  GPR_ASSERT(grpc_sockaddr_is_wildcard(&wild4, &port));
+  GPR_ASSERT(port == 555);
+  wild4_addr = (struct sockaddr_in*)&wild4.addr;
+  memset(&wild4_addr->sin_addr.s_addr, 0xbd, 1);
+  GPR_ASSERT(!grpc_sockaddr_is_wildcard(&wild4, &port));
+
+  /* Test [::]:555 */
+  port = -1;
+  GPR_ASSERT(grpc_sockaddr_is_wildcard(&wild6, &port));
+  GPR_ASSERT(port == 555);
+  wild6_addr = (struct sockaddr_in6*)&wild6.addr;
+  memset(&wild6_addr->sin6_addr.s6_addr, 0xbd, 1);
+  GPR_ASSERT(!grpc_sockaddr_is_wildcard(&wild6, &port));
+
+  /* Test [::ffff:0.0.0.0]:555 */
+  port = -1;
+  GPR_ASSERT(grpc_sockaddr_is_wildcard(&wild_mapped, &port));
+  GPR_ASSERT(port == 555);
+  wild_mapped_addr = (struct sockaddr_in6*)&wild_mapped.addr;
+  memset(&wild_mapped_addr->sin6_addr.s6_addr, 0xbd, 1);
+  GPR_ASSERT(!grpc_sockaddr_is_wildcard(&wild_mapped, &port));
+
+  /* Test AF_UNSPEC. */
+  port = -1;
+  memset(&dummy, 0, sizeof(dummy));
+  GPR_ASSERT(!grpc_sockaddr_is_wildcard(&dummy, &port));
+  GPR_ASSERT(port == -1);
+}
+
+static void expect_sockaddr_str(const char* expected,
+                                grpc_resolved_address* addr, int normalize) {
+  int result;
+  char* str;
+  gpr_log(GPR_INFO, "  expect_sockaddr_str(%s)", expected);
+  result = grpc_sockaddr_to_string(&str, addr, normalize);
+  GPR_ASSERT(str != NULL);
+  GPR_ASSERT(result >= 0);
+  GPR_ASSERT((size_t)result == strlen(str));
+  GPR_ASSERT(strcmp(expected, str) == 0);
+  gpr_free(str);
+}
+
+static void expect_sockaddr_uri(const char* expected,
+                                grpc_resolved_address* addr) {
+  char* str;
+  gpr_log(GPR_INFO, "  expect_sockaddr_uri(%s)", expected);
+  str = grpc_sockaddr_to_uri(addr);
+  GPR_ASSERT(str != NULL);
+  GPR_ASSERT(strcmp(expected, str) == 0);
+  gpr_free(str);
+}
+
+static void test_sockaddr_to_string(void) {
+  grpc_resolved_address input4;
+  grpc_resolved_address input6;
+  grpc_resolved_address dummy;
+  struct sockaddr* dummy_addr;
+
+  gpr_log(GPR_INFO, "%s", "test_sockaddr_to_string");
+
+  errno = 0x7EADBEEF;
+
+  input4 = make_addr4(kIPv4, sizeof(kIPv4));
+  expect_sockaddr_str("192.0.2.1:12345", &input4, 0);
+  expect_sockaddr_str("192.0.2.1:12345", &input4, 1);
+  expect_sockaddr_uri("ipv4:192.0.2.1:12345", &input4);
+
+  input6 = make_addr6(kIPv6, sizeof(kIPv6));
+  expect_sockaddr_str("[2001:db8::1]:12345", &input6, 0);
+  expect_sockaddr_str("[2001:db8::1]:12345", &input6, 1);
+  expect_sockaddr_uri("ipv6:[2001:db8::1]:12345", &input6);
+
+  set_addr6_scope_id(&input6, 2);
+  expect_sockaddr_str("[2001:db8::1%252]:12345", &input6, 0);
+  expect_sockaddr_str("[2001:db8::1%252]:12345", &input6, 1);
+  expect_sockaddr_uri("ipv6:[2001:db8::1%252]:12345", &input6);
+
+  set_addr6_scope_id(&input6, 101);
+  expect_sockaddr_str("[2001:db8::1%25101]:12345", &input6, 0);
+  expect_sockaddr_str("[2001:db8::1%25101]:12345", &input6, 1);
+  expect_sockaddr_uri("ipv6:[2001:db8::1%25101]:12345", &input6);
+
+  input6 = make_addr6(kMapped, sizeof(kMapped));
+  expect_sockaddr_str("[::ffff:192.0.2.1]:12345", &input6, 0);
+  expect_sockaddr_str("192.0.2.1:12345", &input6, 1);
+  expect_sockaddr_uri("ipv4:192.0.2.1:12345", &input6);
+
+  input6 = make_addr6(kNotQuiteMapped, sizeof(kNotQuiteMapped));
+  expect_sockaddr_str("[::fffe:c000:263]:12345", &input6, 0);
+  expect_sockaddr_str("[::fffe:c000:263]:12345", &input6, 1);
+  expect_sockaddr_uri("ipv6:[::fffe:c000:263]:12345", &input6);
+
+  memset(&dummy, 0, sizeof(dummy));
+  dummy_addr = (struct sockaddr*)dummy.addr;
+  dummy_addr->sa_family = 123;
+  expect_sockaddr_str("(sockaddr family=123)", &dummy, 0);
+  expect_sockaddr_str("(sockaddr family=123)", &dummy, 1);
+  GPR_ASSERT(grpc_sockaddr_to_uri(&dummy) == NULL);
+}
+
+static void test_sockaddr_set_get_port(void) {
+  grpc_resolved_address input4;
+  grpc_resolved_address input6;
+  grpc_resolved_address dummy;
+  struct sockaddr* dummy_addr;
+
+  gpr_log(GPR_DEBUG, "test_sockaddr_set_get_port");
+
+  input4 = make_addr4(kIPv4, sizeof(kIPv4));
+  GPR_ASSERT(grpc_sockaddr_get_port(&input4) == 12345);
+  GPR_ASSERT(grpc_sockaddr_set_port(&input4, 54321));
+  GPR_ASSERT(grpc_sockaddr_get_port(&input4) == 54321);
+
+  input6 = make_addr6(kIPv6, sizeof(kIPv6));
+  GPR_ASSERT(grpc_sockaddr_get_port(&input6) == 12345);
+  GPR_ASSERT(grpc_sockaddr_set_port(&input6, 54321));
+  GPR_ASSERT(grpc_sockaddr_get_port(&input6) == 54321);
+
+  memset(&dummy, 0, sizeof(dummy));
+  dummy_addr = (struct sockaddr*)dummy.addr;
+  dummy_addr->sa_family = 123;
+  GPR_ASSERT(grpc_sockaddr_get_port(&dummy) == 0);
+  GPR_ASSERT(grpc_sockaddr_set_port(&dummy, 1234) == 0);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  test_sockaddr_is_v4mapped();
+  test_sockaddr_to_v4mapped();
+  test_sockaddr_is_wildcard();
+  test_sockaddr_to_string();
+  test_sockaddr_set_get_port();
+
+  return 0;
+}
diff --git a/test/core/iomgr/socket_utils_test.c b/test/core/iomgr/socket_utils_test.c
deleted file mode 100644
index 30f0c94..0000000
--- a/test/core/iomgr/socket_utils_test.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with posix sockets enabled
-#ifdef GRPC_POSIX_SOCKET
-
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-
-#include <errno.h>
-#include <netinet/ip.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/iomgr/socket_mutator.h"
-#include "test/core/util/test_config.h"
-
-struct test_socket_mutator {
-  grpc_socket_mutator base;
-  int option_value;
-};
-
-static bool mutate_fd(int fd, grpc_socket_mutator *mutator) {
-  int newval;
-  socklen_t intlen = sizeof(newval);
-  struct test_socket_mutator *m = (struct test_socket_mutator *)mutator;
-
-  if (0 != setsockopt(fd, IPPROTO_IP, IP_TOS, &m->option_value,
-                      sizeof(m->option_value))) {
-    return false;
-  }
-  if (0 != getsockopt(fd, IPPROTO_IP, IP_TOS, &newval, &intlen)) {
-    return false;
-  }
-  if (newval != m->option_value) {
-    return false;
-  }
-  return true;
-}
-
-static void destroy_test_mutator(grpc_socket_mutator *mutator) {
-  struct test_socket_mutator *m = (struct test_socket_mutator *)mutator;
-  gpr_free(m);
-}
-
-static int compare_test_mutator(grpc_socket_mutator *a,
-                                grpc_socket_mutator *b) {
-  struct test_socket_mutator *ma = (struct test_socket_mutator *)a;
-  struct test_socket_mutator *mb = (struct test_socket_mutator *)b;
-  return GPR_ICMP(ma->option_value, mb->option_value);
-}
-
-static const grpc_socket_mutator_vtable mutator_vtable = {
-    mutate_fd, compare_test_mutator, destroy_test_mutator};
-
-int main(int argc, char **argv) {
-  int sock;
-  grpc_error *err;
-  grpc_test_init(argc, argv);
-
-  sock = socket(PF_INET, SOCK_STREAM, 0);
-  GPR_ASSERT(sock > 0);
-
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_nonblocking",
-                               grpc_set_socket_nonblocking(sock, 1)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_nonblocking",
-                               grpc_set_socket_nonblocking(sock, 0)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_cloexec",
-                               grpc_set_socket_cloexec(sock, 1)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_cloexec",
-                               grpc_set_socket_cloexec(sock, 0)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_reuse_addr",
-                               grpc_set_socket_reuse_addr(sock, 1)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_reuse_addr",
-                               grpc_set_socket_reuse_addr(sock, 0)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_low_latency",
-                               grpc_set_socket_low_latency(sock, 1)));
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_low_latency",
-                               grpc_set_socket_low_latency(sock, 0)));
-
-  struct test_socket_mutator mutator;
-  grpc_socket_mutator_init(&mutator.base, &mutator_vtable);
-
-  mutator.option_value = IPTOS_LOWDELAY;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "set_socket_with_mutator",
-      grpc_set_socket_with_mutator(sock, (grpc_socket_mutator *)&mutator)));
-
-  mutator.option_value = IPTOS_THROUGHPUT;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "set_socket_with_mutator",
-      grpc_set_socket_with_mutator(sock, (grpc_socket_mutator *)&mutator)));
-
-  mutator.option_value = IPTOS_RELIABILITY;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "set_socket_with_mutator",
-      grpc_set_socket_with_mutator(sock, (grpc_socket_mutator *)&mutator)));
-
-  mutator.option_value = -1;
-  err = grpc_set_socket_with_mutator(sock, (grpc_socket_mutator *)&mutator);
-  GPR_ASSERT(err != GRPC_ERROR_NONE);
-  GRPC_ERROR_UNREF(err);
-
-  close(sock);
-
-  return 0;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/socket_utils_test.cc b/test/core/iomgr/socket_utils_test.cc
new file mode 100644
index 0000000..49c6f79
--- /dev/null
+++ b/test/core/iomgr/socket_utils_test.cc
@@ -0,0 +1,132 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include "src/core/lib/iomgr/socket_utils_posix.h"
+
+#include <errno.h>
+#include <netinet/ip.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/iomgr/socket_mutator.h"
+#include "test/core/util/test_config.h"
+
+struct test_socket_mutator {
+  grpc_socket_mutator base;
+  int option_value;
+};
+
+static bool mutate_fd(int fd, grpc_socket_mutator* mutator) {
+  int newval;
+  socklen_t intlen = sizeof(newval);
+  struct test_socket_mutator* m = (struct test_socket_mutator*)mutator;
+
+  if (0 != setsockopt(fd, IPPROTO_IP, IP_TOS, &m->option_value,
+                      sizeof(m->option_value))) {
+    return false;
+  }
+  if (0 != getsockopt(fd, IPPROTO_IP, IP_TOS, &newval, &intlen)) {
+    return false;
+  }
+  if (newval != m->option_value) {
+    return false;
+  }
+  return true;
+}
+
+static void destroy_test_mutator(grpc_socket_mutator* mutator) {
+  struct test_socket_mutator* m = (struct test_socket_mutator*)mutator;
+  gpr_free(m);
+}
+
+static int compare_test_mutator(grpc_socket_mutator* a,
+                                grpc_socket_mutator* b) {
+  struct test_socket_mutator* ma = (struct test_socket_mutator*)a;
+  struct test_socket_mutator* mb = (struct test_socket_mutator*)b;
+  return GPR_ICMP(ma->option_value, mb->option_value);
+}
+
+static const grpc_socket_mutator_vtable mutator_vtable = {
+    mutate_fd, compare_test_mutator, destroy_test_mutator};
+
+int main(int argc, char** argv) {
+  int sock;
+  grpc_error* err;
+  grpc_test_init(argc, argv);
+
+  sock = socket(PF_INET, SOCK_STREAM, 0);
+  GPR_ASSERT(sock > 0);
+
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_nonblocking",
+                               grpc_set_socket_nonblocking(sock, 1)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_nonblocking",
+                               grpc_set_socket_nonblocking(sock, 0)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_cloexec",
+                               grpc_set_socket_cloexec(sock, 1)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_cloexec",
+                               grpc_set_socket_cloexec(sock, 0)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_reuse_addr",
+                               grpc_set_socket_reuse_addr(sock, 1)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_reuse_addr",
+                               grpc_set_socket_reuse_addr(sock, 0)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_low_latency",
+                               grpc_set_socket_low_latency(sock, 1)));
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("set_socket_low_latency",
+                               grpc_set_socket_low_latency(sock, 0)));
+
+  struct test_socket_mutator mutator;
+  grpc_socket_mutator_init(&mutator.base, &mutator_vtable);
+
+  mutator.option_value = IPTOS_LOWDELAY;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "set_socket_with_mutator",
+      grpc_set_socket_with_mutator(sock, (grpc_socket_mutator*)&mutator)));
+
+  mutator.option_value = IPTOS_THROUGHPUT;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "set_socket_with_mutator",
+      grpc_set_socket_with_mutator(sock, (grpc_socket_mutator*)&mutator)));
+
+  mutator.option_value = IPTOS_RELIABILITY;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "set_socket_with_mutator",
+      grpc_set_socket_with_mutator(sock, (grpc_socket_mutator*)&mutator)));
+
+  mutator.option_value = -1;
+  err = grpc_set_socket_with_mutator(sock, (grpc_socket_mutator*)&mutator);
+  GPR_ASSERT(err != GRPC_ERROR_NONE);
+  GRPC_ERROR_UNREF(err);
+
+  close(sock);
+
+  return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c
deleted file mode 100644
index b8b76d1..0000000
--- a/test/core/iomgr/tcp_client_posix_test.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with posix sockets enabled
-#ifdef GRPC_POSIX_SOCKET
-
-#include "src/core/lib/iomgr/tcp_client.h"
-
-#include <errno.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/pollset_set.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "test/core/util/test_config.h"
-
-static grpc_pollset_set *g_pollset_set;
-static gpr_mu *g_mu;
-static grpc_pollset *g_pollset;
-static int g_connections_complete = 0;
-static grpc_endpoint *g_connecting = NULL;
-
-static grpc_millis test_deadline(void) {
-  return grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
-}
-
-static void finish_connection() {
-  gpr_mu_lock(g_mu);
-  g_connections_complete++;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(&exec_ctx, g_pollset, NULL)));
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_mu_unlock(g_mu);
-}
-
-static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg,
-                         grpc_error *error) {
-  GPR_ASSERT(g_connecting != NULL);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  grpc_endpoint_shutdown(
-      exec_ctx, g_connecting,
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING("must_succeed called"));
-  grpc_endpoint_destroy(exec_ctx, g_connecting);
-  g_connecting = NULL;
-  finish_connection();
-}
-
-static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  GPR_ASSERT(g_connecting == NULL);
-  GPR_ASSERT(error != GRPC_ERROR_NONE);
-  finish_connection();
-}
-
-void test_succeeds(void) {
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  int svr_fd;
-  int r;
-  int connections_complete_before;
-  grpc_closure done;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_DEBUG, "test_succeeds");
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-
-  /* create a dummy server */
-  svr_fd = socket(AF_INET, SOCK_STREAM, 0);
-  GPR_ASSERT(svr_fd >= 0);
-  GPR_ASSERT(
-      0 == bind(svr_fd, (struct sockaddr *)addr, (socklen_t)resolved_addr.len));
-  GPR_ASSERT(0 == listen(svr_fd, 1));
-
-  gpr_mu_lock(g_mu);
-  connections_complete_before = g_connections_complete;
-  gpr_mu_unlock(g_mu);
-
-  /* connect to it */
-  GPR_ASSERT(getsockname(svr_fd, (struct sockaddr *)addr,
-                         (socklen_t *)&resolved_addr.len) == 0);
-  GRPC_CLOSURE_INIT(&done, must_succeed, NULL, grpc_schedule_on_exec_ctx);
-  grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, NULL,
-                          &resolved_addr, GRPC_MILLIS_INF_FUTURE);
-
-  /* await the connection */
-  do {
-    resolved_addr.len = sizeof(addr);
-    r = accept(svr_fd, (struct sockaddr *)addr,
-               (socklen_t *)&resolved_addr.len);
-  } while (r == -1 && errno == EINTR);
-  GPR_ASSERT(r >= 0);
-  close(r);
-
-  gpr_mu_lock(g_mu);
-
-  while (g_connections_complete == connections_complete_before) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, g_pollset, &worker,
-                          grpc_timespec_to_millis_round_up(
-                              grpc_timeout_seconds_to_deadline(5)))));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_flush(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-
-  gpr_mu_unlock(g_mu);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-void test_fails(void) {
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  int connections_complete_before;
-  grpc_closure done;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_DEBUG, "test_fails");
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-
-  gpr_mu_lock(g_mu);
-  connections_complete_before = g_connections_complete;
-  gpr_mu_unlock(g_mu);
-
-  /* connect to a broken address */
-  GRPC_CLOSURE_INIT(&done, must_fail, NULL, grpc_schedule_on_exec_ctx);
-  grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, NULL,
-                          &resolved_addr, GRPC_MILLIS_INF_FUTURE);
-
-  gpr_mu_lock(g_mu);
-
-  /* wait for the connection callback to finish */
-  while (g_connections_complete == connections_complete_before) {
-    grpc_pollset_worker *worker = NULL;
-    grpc_millis polling_deadline = test_deadline();
-    switch (grpc_timer_check(&exec_ctx, &polling_deadline)) {
-      case GRPC_TIMERS_FIRED:
-        break;
-      case GRPC_TIMERS_NOT_CHECKED:
-        polling_deadline = 0;
-      /* fall through */
-      case GRPC_TIMERS_CHECKED_AND_EMPTY:
-        GPR_ASSERT(GRPC_LOG_IF_ERROR(
-            "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
-                                              polling_deadline)));
-        break;
-    }
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_flush(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-
-  gpr_mu_unlock(g_mu);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, p);
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_test_init(argc, argv);
-  grpc_init();
-  g_pollset_set = grpc_pollset_set_create();
-  g_pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(g_pollset, &g_mu);
-  grpc_pollset_set_add_pollset(&exec_ctx, g_pollset_set, g_pollset);
-  grpc_exec_ctx_finish(&exec_ctx);
-  test_succeeds();
-  gpr_log(GPR_ERROR, "End of first test");
-  test_fails();
-  grpc_pollset_set_destroy(&exec_ctx, g_pollset_set);
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  gpr_free(g_pollset);
-  return 0;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/tcp_client_posix_test.cc b/test/core/iomgr/tcp_client_posix_test.cc
new file mode 100644
index 0000000..206fa5d
--- /dev/null
+++ b/test/core/iomgr/tcp_client_posix_test.cc
@@ -0,0 +1,222 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include "src/core/lib/iomgr/tcp_client.h"
+
+#include <errno.h>
+#include <netinet/in.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "test/core/util/test_config.h"
+
+static grpc_pollset_set* g_pollset_set;
+static gpr_mu* g_mu;
+static grpc_pollset* g_pollset;
+static int g_connections_complete = 0;
+static grpc_endpoint* g_connecting = NULL;
+
+static grpc_millis test_deadline(void) {
+  return grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
+}
+
+static void finish_connection() {
+  gpr_mu_lock(g_mu);
+  g_connections_complete++;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(&exec_ctx, g_pollset, NULL)));
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_mu_unlock(g_mu);
+}
+
+static void must_succeed(grpc_exec_ctx* exec_ctx, void* arg,
+                         grpc_error* error) {
+  GPR_ASSERT(g_connecting != NULL);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  grpc_endpoint_shutdown(
+      exec_ctx, g_connecting,
+      GRPC_ERROR_CREATE_FROM_STATIC_STRING("must_succeed called"));
+  grpc_endpoint_destroy(exec_ctx, g_connecting);
+  g_connecting = NULL;
+  finish_connection();
+}
+
+static void must_fail(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  GPR_ASSERT(g_connecting == NULL);
+  GPR_ASSERT(error != GRPC_ERROR_NONE);
+  finish_connection();
+}
+
+void test_succeeds(void) {
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  int svr_fd;
+  int r;
+  int connections_complete_before;
+  grpc_closure done;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_DEBUG, "test_succeeds");
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+
+  /* create a dummy server */
+  svr_fd = socket(AF_INET, SOCK_STREAM, 0);
+  GPR_ASSERT(svr_fd >= 0);
+  GPR_ASSERT(
+      0 == bind(svr_fd, (struct sockaddr*)addr, (socklen_t)resolved_addr.len));
+  GPR_ASSERT(0 == listen(svr_fd, 1));
+
+  gpr_mu_lock(g_mu);
+  connections_complete_before = g_connections_complete;
+  gpr_mu_unlock(g_mu);
+
+  /* connect to it */
+  GPR_ASSERT(getsockname(svr_fd, (struct sockaddr*)addr,
+                         (socklen_t*)&resolved_addr.len) == 0);
+  GRPC_CLOSURE_INIT(&done, must_succeed, NULL, grpc_schedule_on_exec_ctx);
+  grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, NULL,
+                          &resolved_addr, GRPC_MILLIS_INF_FUTURE);
+
+  /* await the connection */
+  do {
+    resolved_addr.len = sizeof(addr);
+    r = accept(svr_fd, (struct sockaddr*)addr, (socklen_t*)&resolved_addr.len);
+  } while (r == -1 && errno == EINTR);
+  GPR_ASSERT(r >= 0);
+  close(r);
+
+  gpr_mu_lock(g_mu);
+
+  while (g_connections_complete == connections_complete_before) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, g_pollset, &worker,
+                          grpc_timespec_to_millis_round_up(
+                              grpc_timeout_seconds_to_deadline(5)))));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_flush(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+
+  gpr_mu_unlock(g_mu);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+void test_fails(void) {
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  int connections_complete_before;
+  grpc_closure done;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_DEBUG, "test_fails");
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+
+  gpr_mu_lock(g_mu);
+  connections_complete_before = g_connections_complete;
+  gpr_mu_unlock(g_mu);
+
+  /* connect to a broken address */
+  GRPC_CLOSURE_INIT(&done, must_fail, NULL, grpc_schedule_on_exec_ctx);
+  grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, g_pollset_set, NULL,
+                          &resolved_addr, GRPC_MILLIS_INF_FUTURE);
+
+  gpr_mu_lock(g_mu);
+
+  /* wait for the connection callback to finish */
+  while (g_connections_complete == connections_complete_before) {
+    grpc_pollset_worker* worker = NULL;
+    grpc_millis polling_deadline = test_deadline();
+    switch (grpc_timer_check(&exec_ctx, &polling_deadline)) {
+      case GRPC_TIMERS_FIRED:
+        break;
+      case GRPC_TIMERS_NOT_CHECKED:
+        polling_deadline = 0;
+      /* fall through */
+      case GRPC_TIMERS_CHECKED_AND_EMPTY:
+        GPR_ASSERT(GRPC_LOG_IF_ERROR(
+            "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
+                                              polling_deadline)));
+        break;
+    }
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_flush(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+
+  gpr_mu_unlock(g_mu);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(p));
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_test_init(argc, argv);
+  grpc_init();
+  g_pollset_set = grpc_pollset_set_create();
+  g_pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(g_pollset, &g_mu);
+  grpc_pollset_set_add_pollset(&exec_ctx, g_pollset_set, g_pollset);
+  grpc_exec_ctx_finish(&exec_ctx);
+  test_succeeds();
+  gpr_log(GPR_ERROR, "End of first test");
+  test_fails();
+  grpc_pollset_set_destroy(&exec_ctx, g_pollset_set);
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  gpr_free(g_pollset);
+  return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/tcp_client_uv_test.c b/test/core/iomgr/tcp_client_uv_test.c
deleted file mode 100644
index edfccbe..0000000
--- a/test/core/iomgr/tcp_client_uv_test.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with libuv
-#ifdef GRPC_UV
-
-#include <uv.h>
-
-#include <string.h>
-
-#include "src/core/lib/iomgr/tcp_client.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/pollset.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "test/core/util/test_config.h"
-
-static gpr_mu *g_mu;
-static grpc_pollset *g_pollset;
-static int g_connections_complete = 0;
-static grpc_endpoint *g_connecting = NULL;
-
-static grpc_millis test_deadline(void) {
-  return grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
-}
-
-static void finish_connection(grpc_exec_ctx *exec_ctx) {
-  gpr_mu_lock(g_mu);
-  g_connections_complete++;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg,
-                         grpc_error *error) {
-  GPR_ASSERT(g_connecting != NULL);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  grpc_endpoint_shutdown(
-      exec_ctx, g_connecting,
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING("must_succeed called"));
-  grpc_endpoint_destroy(exec_ctx, g_connecting);
-  g_connecting = NULL;
-  finish_connection(exec_ctx);
-}
-
-static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  GPR_ASSERT(g_connecting == NULL);
-  GPR_ASSERT(error != GRPC_ERROR_NONE);
-  finish_connection(exec_ctx);
-}
-
-static void close_cb(uv_handle_t *handle) { gpr_free(handle); }
-
-static void connection_cb(uv_stream_t *server, int status) {
-  uv_tcp_t *client_handle = gpr_malloc(sizeof(uv_tcp_t));
-  GPR_ASSERT(0 == status);
-  GPR_ASSERT(0 == uv_tcp_init(uv_default_loop(), client_handle));
-  GPR_ASSERT(0 == uv_accept(server, (uv_stream_t *)client_handle));
-  uv_close((uv_handle_t *)client_handle, close_cb);
-}
-
-void test_succeeds(void) {
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  uv_tcp_t *svr_handle = gpr_malloc(sizeof(uv_tcp_t));
-  int connections_complete_before;
-  grpc_closure done;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_DEBUG, "test_succeeds");
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-
-  /* create a dummy server */
-  GPR_ASSERT(0 == uv_tcp_init(uv_default_loop(), svr_handle));
-  GPR_ASSERT(0 == uv_tcp_bind(svr_handle, (struct sockaddr *)addr, 0));
-  GPR_ASSERT(0 == uv_listen((uv_stream_t *)svr_handle, 1, connection_cb));
-
-  gpr_mu_lock(g_mu);
-  connections_complete_before = g_connections_complete;
-  gpr_mu_unlock(g_mu);
-
-  /* connect to it */
-  GPR_ASSERT(uv_tcp_getsockname(svr_handle, (struct sockaddr *)addr,
-                                (int *)&resolved_addr.len) == 0);
-  GRPC_CLOSURE_INIT(&done, must_succeed, NULL, grpc_schedule_on_exec_ctx);
-  grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, NULL, NULL,
-                          &resolved_addr, GRPC_MILLIS_INF_FUTURE);
-
-  gpr_mu_lock(g_mu);
-
-  while (g_connections_complete == connections_complete_before) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, g_pollset, &worker,
-                          grpc_timespec_to_millis_round_up(
-                              grpc_timeout_seconds_to_deadline(5)))));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_flush(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-
-  // This will get cleaned up when the pollset runs again or gets shutdown
-  uv_close((uv_handle_t *)svr_handle, close_cb);
-
-  gpr_mu_unlock(g_mu);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-void test_fails(void) {
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  int connections_complete_before;
-  grpc_closure done;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_DEBUG, "test_fails");
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-
-  gpr_mu_lock(g_mu);
-  connections_complete_before = g_connections_complete;
-  gpr_mu_unlock(g_mu);
-
-  /* connect to a broken address */
-  GRPC_CLOSURE_INIT(&done, must_fail, NULL, grpc_schedule_on_exec_ctx);
-  grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, NULL, NULL,
-                          &resolved_addr, GRPC_MILLIS_INF_FUTURE);
-
-  gpr_mu_lock(g_mu);
-
-  /* wait for the connection callback to finish */
-  while (g_connections_complete == connections_complete_before) {
-    grpc_pollset_worker *worker = NULL;
-    gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
-    grpc_millis polling_deadline = test_deadline();
-    switch (grpc_timer_check(&exec_ctx, &polling_deadline)) {
-      case GRPC_TIMERS_FIRED:
-        break;
-      case GRPC_TIMERS_NOT_CHECKED:
-        polling_deadline = grpc_timespec_to_millis_round_up(now);
-      /* fall through */
-      case GRPC_TIMERS_CHECKED_AND_EMPTY:
-        GPR_ASSERT(GRPC_LOG_IF_ERROR(
-            "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
-                                              polling_deadline)));
-        break;
-    }
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_flush(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-
-  gpr_mu_unlock(g_mu);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, p);
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_test_init(argc, argv);
-  grpc_init();
-  g_pollset = gpr_malloc(grpc_pollset_size());
-  grpc_pollset_init(g_pollset, &g_mu);
-  grpc_exec_ctx_finish(&exec_ctx);
-  test_succeeds();
-  gpr_log(GPR_ERROR, "End of first test");
-  test_fails();
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  gpr_free(g_pollset);
-  return 0;
-}
-
-#else /* GRPC_UV */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_UV */
diff --git a/test/core/iomgr/tcp_client_uv_test.cc b/test/core/iomgr/tcp_client_uv_test.cc
new file mode 100644
index 0000000..101d7bf
--- /dev/null
+++ b/test/core/iomgr/tcp_client_uv_test.cc
@@ -0,0 +1,217 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with libuv
+#ifdef GRPC_UV
+
+#include <uv.h>
+
+#include <string.h>
+
+#include "src/core/lib/iomgr/tcp_client.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "test/core/util/test_config.h"
+
+static gpr_mu* g_mu;
+static grpc_pollset* g_pollset;
+static int g_connections_complete = 0;
+static grpc_endpoint* g_connecting = NULL;
+
+static grpc_millis test_deadline(void) {
+  return grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
+}
+
+static void finish_connection(grpc_exec_ctx* exec_ctx) {
+  gpr_mu_lock(g_mu);
+  g_connections_complete++;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+static void must_succeed(grpc_exec_ctx* exec_ctx, void* arg,
+                         grpc_error* error) {
+  GPR_ASSERT(g_connecting != NULL);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  grpc_endpoint_shutdown(
+      exec_ctx, g_connecting,
+      GRPC_ERROR_CREATE_FROM_STATIC_STRING("must_succeed called"));
+  grpc_endpoint_destroy(exec_ctx, g_connecting);
+  g_connecting = NULL;
+  finish_connection(exec_ctx);
+}
+
+static void must_fail(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  GPR_ASSERT(g_connecting == NULL);
+  GPR_ASSERT(error != GRPC_ERROR_NONE);
+  finish_connection(exec_ctx);
+}
+
+static void close_cb(uv_handle_t* handle) { gpr_free(handle); }
+
+static void connection_cb(uv_stream_t* server, int status) {
+  uv_tcp_t* client_handle =
+      static_cast<uv_tcp_t*>(gpr_malloc(sizeof(uv_tcp_t)));
+  GPR_ASSERT(0 == status);
+  GPR_ASSERT(0 == uv_tcp_init(uv_default_loop(), client_handle));
+  GPR_ASSERT(0 == uv_accept(server, (uv_stream_t*)client_handle));
+  uv_close((uv_handle_t*)client_handle, close_cb);
+}
+
+void test_succeeds(void) {
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  uv_tcp_t* svr_handle = static_cast<uv_tcp_t*>(gpr_malloc(sizeof(uv_tcp_t)));
+  int connections_complete_before;
+  grpc_closure done;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_DEBUG, "test_succeeds");
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+
+  /* create a dummy server */
+  GPR_ASSERT(0 == uv_tcp_init(uv_default_loop(), svr_handle));
+  GPR_ASSERT(0 == uv_tcp_bind(svr_handle, (struct sockaddr*)addr, 0));
+  GPR_ASSERT(0 == uv_listen((uv_stream_t*)svr_handle, 1, connection_cb));
+
+  gpr_mu_lock(g_mu);
+  connections_complete_before = g_connections_complete;
+  gpr_mu_unlock(g_mu);
+
+  /* connect to it */
+  GPR_ASSERT(uv_tcp_getsockname(svr_handle, (struct sockaddr*)addr,
+                                (int*)&resolved_addr.len) == 0);
+  GRPC_CLOSURE_INIT(&done, must_succeed, NULL, grpc_schedule_on_exec_ctx);
+  grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, NULL, NULL,
+                          &resolved_addr, GRPC_MILLIS_INF_FUTURE);
+
+  gpr_mu_lock(g_mu);
+
+  while (g_connections_complete == connections_complete_before) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, g_pollset, &worker,
+                          grpc_timespec_to_millis_round_up(
+                              grpc_timeout_seconds_to_deadline(5)))));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_flush(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+
+  // This will get cleaned up when the pollset runs again or gets shutdown
+  uv_close((uv_handle_t*)svr_handle, close_cb);
+
+  gpr_mu_unlock(g_mu);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+void test_fails(void) {
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  int connections_complete_before;
+  grpc_closure done;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_DEBUG, "test_fails");
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+
+  gpr_mu_lock(g_mu);
+  connections_complete_before = g_connections_complete;
+  gpr_mu_unlock(g_mu);
+
+  /* connect to a broken address */
+  GRPC_CLOSURE_INIT(&done, must_fail, NULL, grpc_schedule_on_exec_ctx);
+  grpc_tcp_client_connect(&exec_ctx, &done, &g_connecting, NULL, NULL,
+                          &resolved_addr, GRPC_MILLIS_INF_FUTURE);
+
+  gpr_mu_lock(g_mu);
+
+  /* wait for the connection callback to finish */
+  while (g_connections_complete == connections_complete_before) {
+    grpc_pollset_worker* worker = NULL;
+    gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
+    grpc_millis polling_deadline = test_deadline();
+    switch (grpc_timer_check(&exec_ctx, &polling_deadline)) {
+      case GRPC_TIMERS_FIRED:
+        break;
+      case GRPC_TIMERS_NOT_CHECKED:
+        polling_deadline = grpc_timespec_to_millis_round_up(now);
+      /* fall through */
+      case GRPC_TIMERS_CHECKED_AND_EMPTY:
+        GPR_ASSERT(GRPC_LOG_IF_ERROR(
+            "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker,
+                                              polling_deadline)));
+        break;
+    }
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_flush(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+
+  gpr_mu_unlock(g_mu);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(p));
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_test_init(argc, argv);
+  grpc_init();
+  g_pollset = static_cast<grpc_pollset*>(gpr_malloc(grpc_pollset_size()));
+  grpc_pollset_init(g_pollset, &g_mu);
+  grpc_exec_ctx_finish(&exec_ctx);
+  test_succeeds();
+  gpr_log(GPR_ERROR, "End of first test");
+  test_fails();
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  gpr_free(g_pollset);
+  return 0;
+}
+
+#else /* GRPC_UV */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_UV */
diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c
deleted file mode 100644
index 6501160..0000000
--- a/test/core/iomgr/tcp_posix_test.c
+++ /dev/null
@@ -1,577 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with posix sockets enabled
-#ifdef GRPC_POSIX_SOCKET
-
-#include "src/core/lib/iomgr/tcp_posix.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-#include "test/core/iomgr/endpoint_tests.h"
-#include "test/core/util/test_config.h"
-
-static gpr_mu *g_mu;
-static grpc_pollset *g_pollset;
-
-/*
-   General test notes:
-
-   All tests which write data into a socket write i%256 into byte i, which is
-   verified by readers.
-
-   In general there are a few interesting things to vary which may lead to
-   exercising different codepaths in an implementation:
-   1. Total amount of data written to the socket
-   2. Size of slice allocations
-   3. Amount of data we read from or write to the socket at once
-
-   The tests here tend to parameterize these where applicable.
-
- */
-
-static void create_sockets(int sv[2]) {
-  int flags;
-  GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
-  flags = fcntl(sv[0], F_GETFL, 0);
-  GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
-  flags = fcntl(sv[1], F_GETFL, 0);
-  GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
-}
-
-static ssize_t fill_socket(int fd) {
-  ssize_t write_bytes;
-  ssize_t total_bytes = 0;
-  int i;
-  unsigned char buf[256];
-  for (i = 0; i < 256; ++i) {
-    buf[i] = (uint8_t)i;
-  }
-  do {
-    write_bytes = write(fd, buf, 256);
-    if (write_bytes > 0) {
-      total_bytes += write_bytes;
-    }
-  } while (write_bytes >= 0 || errno == EINTR);
-  GPR_ASSERT(errno == EAGAIN);
-  return total_bytes;
-}
-
-static size_t fill_socket_partial(int fd, size_t bytes) {
-  ssize_t write_bytes;
-  size_t total_bytes = 0;
-  unsigned char *buf = (unsigned char *)gpr_malloc(bytes);
-  unsigned i;
-  for (i = 0; i < bytes; ++i) {
-    buf[i] = (uint8_t)(i % 256);
-  }
-
-  do {
-    write_bytes = write(fd, buf, bytes - total_bytes);
-    if (write_bytes > 0) {
-      total_bytes += (size_t)write_bytes;
-    }
-  } while ((write_bytes >= 0 || errno == EINTR) && bytes > total_bytes);
-
-  gpr_free(buf);
-
-  return total_bytes;
-}
-
-struct read_socket_state {
-  grpc_endpoint *ep;
-  size_t read_bytes;
-  size_t target_read_bytes;
-  grpc_slice_buffer incoming;
-  grpc_closure read_cb;
-};
-
-static size_t count_slices(grpc_slice *slices, size_t nslices,
-                           int *current_data) {
-  size_t num_bytes = 0;
-  unsigned i, j;
-  unsigned char *buf;
-  for (i = 0; i < nslices; ++i) {
-    buf = GRPC_SLICE_START_PTR(slices[i]);
-    for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
-      GPR_ASSERT(buf[j] == *current_data);
-      *current_data = (*current_data + 1) % 256;
-    }
-    num_bytes += GRPC_SLICE_LENGTH(slices[i]);
-  }
-  return num_bytes;
-}
-
-static void read_cb(grpc_exec_ctx *exec_ctx, void *user_data,
-                    grpc_error *error) {
-  struct read_socket_state *state = (struct read_socket_state *)user_data;
-  size_t read_bytes;
-  int current_data;
-
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-
-  gpr_mu_lock(g_mu);
-  current_data = state->read_bytes % 256;
-  read_bytes = count_slices(state->incoming.slices, state->incoming.count,
-                            &current_data);
-  state->read_bytes += read_bytes;
-  gpr_log(GPR_INFO, "Read %" PRIuPTR " bytes of %" PRIuPTR, read_bytes,
-          state->target_read_bytes);
-  if (state->read_bytes >= state->target_read_bytes) {
-    GPR_ASSERT(GRPC_LOG_IF_ERROR("kick",
-                                 grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-    gpr_mu_unlock(g_mu);
-  } else {
-    grpc_endpoint_read(exec_ctx, state->ep, &state->incoming, &state->read_cb);
-    gpr_mu_unlock(g_mu);
-  }
-}
-
-/* Write to a socket, then read from it using the grpc_tcp API. */
-static void read_test(size_t num_bytes, size_t slice_size) {
-  int sv[2];
-  grpc_endpoint *ep;
-  struct read_socket_state state;
-  size_t written_bytes;
-  grpc_millis deadline =
-      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_INFO, "Read test of size %" PRIuPTR ", slice size %" PRIuPTR,
-          num_bytes, slice_size);
-
-  create_sockets(sv);
-
-  grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = (int)slice_size}};
-  grpc_channel_args args = {.num_args = GPR_ARRAY_SIZE(a), .args = a};
-  ep = grpc_tcp_create(&exec_ctx, grpc_fd_create(sv[1], "read_test"), &args,
-                       "test");
-  grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset);
-
-  written_bytes = fill_socket_partial(sv[0], num_bytes);
-  gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes);
-
-  state.ep = ep;
-  state.read_bytes = 0;
-  state.target_read_bytes = written_bytes;
-  grpc_slice_buffer_init(&state.incoming);
-  GRPC_CLOSURE_INIT(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
-
-  grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
-
-  gpr_mu_lock(g_mu);
-  while (state.read_bytes < state.target_read_bytes) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  GPR_ASSERT(state.read_bytes == state.target_read_bytes);
-  gpr_mu_unlock(g_mu);
-
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.incoming);
-  grpc_endpoint_destroy(&exec_ctx, ep);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-/* Write to a socket until it fills up, then read from it using the grpc_tcp
-   API. */
-static void large_read_test(size_t slice_size) {
-  int sv[2];
-  grpc_endpoint *ep;
-  struct read_socket_state state;
-  ssize_t written_bytes;
-  grpc_millis deadline =
-      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_INFO, "Start large read test, slice size %" PRIuPTR, slice_size);
-
-  create_sockets(sv);
-
-  grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = (int)slice_size}};
-  grpc_channel_args args = {.num_args = GPR_ARRAY_SIZE(a), .args = a};
-  ep = grpc_tcp_create(&exec_ctx, grpc_fd_create(sv[1], "large_read_test"),
-                       &args, "test");
-  grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset);
-
-  written_bytes = fill_socket(sv[0]);
-  gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes);
-
-  state.ep = ep;
-  state.read_bytes = 0;
-  state.target_read_bytes = (size_t)written_bytes;
-  grpc_slice_buffer_init(&state.incoming);
-  GRPC_CLOSURE_INIT(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
-
-  grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
-
-  gpr_mu_lock(g_mu);
-  while (state.read_bytes < state.target_read_bytes) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  GPR_ASSERT(state.read_bytes == state.target_read_bytes);
-  gpr_mu_unlock(g_mu);
-
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.incoming);
-  grpc_endpoint_destroy(&exec_ctx, ep);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-struct write_socket_state {
-  grpc_endpoint *ep;
-  int write_done;
-};
-
-static grpc_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
-                                   size_t *num_blocks, uint8_t *current_data) {
-  size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1u : 0u);
-  grpc_slice *slices = (grpc_slice *)gpr_malloc(sizeof(grpc_slice) * nslices);
-  size_t num_bytes_left = num_bytes;
-  unsigned i, j;
-  unsigned char *buf;
-  *num_blocks = nslices;
-
-  for (i = 0; i < nslices; ++i) {
-    slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
-                                                              : slice_size);
-    num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]);
-    buf = GRPC_SLICE_START_PTR(slices[i]);
-    for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
-      buf[j] = *current_data;
-      (*current_data)++;
-    }
-  }
-  GPR_ASSERT(num_bytes_left == 0);
-  return slices;
-}
-
-static void write_done(grpc_exec_ctx *exec_ctx,
-                       void *user_data /* write_socket_state */,
-                       grpc_error *error) {
-  struct write_socket_state *state = (struct write_socket_state *)user_data;
-  gpr_log(GPR_INFO, "Write done callback called");
-  gpr_mu_lock(g_mu);
-  gpr_log(GPR_INFO, "Signalling write done");
-  state->write_done = 1;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-void drain_socket_blocking(int fd, size_t num_bytes, size_t read_size) {
-  unsigned char *buf = (unsigned char *)gpr_malloc(read_size);
-  ssize_t bytes_read;
-  size_t bytes_left = num_bytes;
-  int flags;
-  int current = 0;
-  int i;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  flags = fcntl(fd, F_GETFL, 0);
-  GPR_ASSERT(fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) == 0);
-
-  for (;;) {
-    grpc_pollset_worker *worker = NULL;
-    gpr_mu_lock(g_mu);
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, g_pollset, &worker,
-                          grpc_timespec_to_millis_round_up(
-                              grpc_timeout_milliseconds_to_deadline(10)))));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    do {
-      bytes_read =
-          read(fd, buf, bytes_left > read_size ? read_size : bytes_left);
-    } while (bytes_read < 0 && errno == EINTR);
-    GPR_ASSERT(bytes_read >= 0);
-    for (i = 0; i < bytes_read; ++i) {
-      GPR_ASSERT(buf[i] == current);
-      current = (current + 1) % 256;
-    }
-    bytes_left -= (size_t)bytes_read;
-    if (bytes_left == 0) break;
-  }
-  flags = fcntl(fd, F_GETFL, 0);
-  GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
-
-  gpr_free(buf);
-}
-
-/* Write to a socket using the grpc_tcp API, then drain it directly.
-   Note that if the write does not complete immediately we need to drain the
-   socket in parallel with the read. */
-static void write_test(size_t num_bytes, size_t slice_size) {
-  int sv[2];
-  grpc_endpoint *ep;
-  struct write_socket_state state;
-  size_t num_blocks;
-  grpc_slice *slices;
-  uint8_t current_data = 0;
-  grpc_slice_buffer outgoing;
-  grpc_closure write_done_closure;
-  grpc_millis deadline =
-      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_INFO,
-          "Start write test with %" PRIuPTR " bytes, slice size %" PRIuPTR,
-          num_bytes, slice_size);
-
-  create_sockets(sv);
-
-  grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = (int)slice_size}};
-  grpc_channel_args args = {.num_args = GPR_ARRAY_SIZE(a), .args = a};
-  ep = grpc_tcp_create(&exec_ctx, grpc_fd_create(sv[1], "write_test"), &args,
-                       "test");
-  grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset);
-
-  state.ep = ep;
-  state.write_done = 0;
-
-  slices = allocate_blocks(num_bytes, slice_size, &num_blocks, &current_data);
-
-  grpc_slice_buffer_init(&outgoing);
-  grpc_slice_buffer_addn(&outgoing, slices, num_blocks);
-  GRPC_CLOSURE_INIT(&write_done_closure, write_done, &state,
-                    grpc_schedule_on_exec_ctx);
-
-  grpc_endpoint_write(&exec_ctx, ep, &outgoing, &write_done_closure);
-  drain_socket_blocking(sv[0], num_bytes, num_bytes);
-  gpr_mu_lock(g_mu);
-  for (;;) {
-    grpc_pollset_worker *worker = NULL;
-    if (state.write_done) {
-      break;
-    }
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  gpr_mu_unlock(g_mu);
-
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &outgoing);
-  grpc_endpoint_destroy(&exec_ctx, ep);
-  gpr_free(slices);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-void on_fd_released(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *errors) {
-  int *done = (int *)arg;
-  *done = 1;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-}
-
-/* Do a read_test, then release fd and try to read/write again. Verify that
-   grpc_tcp_fd() is available before the fd is released. */
-static void release_fd_test(size_t num_bytes, size_t slice_size) {
-  int sv[2];
-  grpc_endpoint *ep;
-  struct read_socket_state state;
-  size_t written_bytes;
-  int fd;
-  grpc_millis deadline =
-      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_closure fd_released_cb;
-  int fd_released_done = 0;
-  GRPC_CLOSURE_INIT(&fd_released_cb, &on_fd_released, &fd_released_done,
-                    grpc_schedule_on_exec_ctx);
-
-  gpr_log(GPR_INFO,
-          "Release fd read_test of size %" PRIuPTR ", slice size %" PRIuPTR,
-          num_bytes, slice_size);
-
-  create_sockets(sv);
-
-  grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = (int)slice_size}};
-  grpc_channel_args args = {.num_args = GPR_ARRAY_SIZE(a), .args = a};
-  ep = grpc_tcp_create(&exec_ctx, grpc_fd_create(sv[1], "read_test"), &args,
-                       "test");
-  GPR_ASSERT(grpc_tcp_fd(ep) == sv[1] && sv[1] >= 0);
-  grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset);
-
-  written_bytes = fill_socket_partial(sv[0], num_bytes);
-  gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes);
-
-  state.ep = ep;
-  state.read_bytes = 0;
-  state.target_read_bytes = written_bytes;
-  grpc_slice_buffer_init(&state.incoming);
-  GRPC_CLOSURE_INIT(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
-
-  grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
-
-  gpr_mu_lock(g_mu);
-  while (state.read_bytes < state.target_read_bytes) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
-    gpr_log(GPR_DEBUG, "wakeup: read=%" PRIdPTR " target=%" PRIdPTR,
-            state.read_bytes, state.target_read_bytes);
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_flush(&exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  GPR_ASSERT(state.read_bytes == state.target_read_bytes);
-  gpr_mu_unlock(g_mu);
-
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.incoming);
-  grpc_tcp_destroy_and_release_fd(&exec_ctx, ep, &fd, &fd_released_cb);
-  grpc_exec_ctx_flush(&exec_ctx);
-  gpr_mu_lock(g_mu);
-  while (!fd_released_done) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
-    gpr_log(GPR_DEBUG, "wakeup: fd_released_done=%d", fd_released_done);
-  }
-  gpr_mu_unlock(g_mu);
-  GPR_ASSERT(fd_released_done == 1);
-  GPR_ASSERT(fd == sv[1]);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  written_bytes = fill_socket_partial(sv[0], num_bytes);
-  drain_socket_blocking(fd, written_bytes, written_bytes);
-  written_bytes = fill_socket_partial(fd, num_bytes);
-  drain_socket_blocking(sv[0], written_bytes, written_bytes);
-  close(fd);
-}
-
-void run_tests(void) {
-  size_t i = 0;
-
-  read_test(100, 8192);
-  read_test(10000, 8192);
-  read_test(10000, 137);
-  read_test(10000, 1);
-  large_read_test(8192);
-  large_read_test(1);
-
-  write_test(100, 8192);
-  write_test(100, 1);
-  write_test(100000, 8192);
-  write_test(100000, 1);
-  write_test(100000, 137);
-
-  for (i = 1; i < 1000; i = GPR_MAX(i + 1, i * 5 / 4)) {
-    write_test(40320, i);
-  }
-
-  release_fd_test(100, 8192);
-}
-
-static void clean_up(void) {}
-
-static grpc_endpoint_test_fixture create_fixture_tcp_socketpair(
-    size_t slice_size) {
-  int sv[2];
-  grpc_endpoint_test_fixture f;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  create_sockets(sv);
-  grpc_resource_quota *resource_quota =
-      grpc_resource_quota_create("tcp_posix_test_socketpair");
-  grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = (int)slice_size}};
-  grpc_channel_args args = {.num_args = GPR_ARRAY_SIZE(a), .args = a};
-  f.client_ep = grpc_tcp_create(
-      &exec_ctx, grpc_fd_create(sv[0], "fixture:client"), &args, "test");
-  f.server_ep = grpc_tcp_create(
-      &exec_ctx, grpc_fd_create(sv[1], "fixture:server"), &args, "test");
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-  grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset);
-  grpc_endpoint_add_to_pollset(&exec_ctx, f.server_ep, g_pollset);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  return f;
-}
-
-static grpc_endpoint_test_config configs[] = {
-    {"tcp/tcp_socketpair", create_fixture_tcp_socketpair, clean_up},
-};
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, (grpc_pollset *)p);
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_test_init(argc, argv);
-  grpc_init();
-  g_pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(g_pollset, &g_mu);
-  grpc_endpoint_tests(configs[0], g_pollset, g_mu);
-  run_tests();
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  gpr_free(g_pollset);
-
-  return 0;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/tcp_posix_test.cc b/test/core/iomgr/tcp_posix_test.cc
new file mode 100644
index 0000000..51ab0bf
--- /dev/null
+++ b/test/core/iomgr/tcp_posix_test.cc
@@ -0,0 +1,580 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include "src/core/lib/iomgr/tcp_posix.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+#include "test/core/iomgr/endpoint_tests.h"
+#include "test/core/util/test_config.h"
+
+static gpr_mu* g_mu;
+static grpc_pollset* g_pollset;
+
+/*
+   General test notes:
+
+   All tests which write data into a socket write i%256 into byte i, which is
+   verified by readers.
+
+   In general there are a few interesting things to vary which may lead to
+   exercising different codepaths in an implementation:
+   1. Total amount of data written to the socket
+   2. Size of slice allocations
+   3. Amount of data we read from or write to the socket at once
+
+   The tests here tend to parameterize these where applicable.
+
+ */
+
+static void create_sockets(int sv[2]) {
+  int flags;
+  GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
+  flags = fcntl(sv[0], F_GETFL, 0);
+  GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
+  flags = fcntl(sv[1], F_GETFL, 0);
+  GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
+}
+
+static ssize_t fill_socket(int fd) {
+  ssize_t write_bytes;
+  ssize_t total_bytes = 0;
+  int i;
+  unsigned char buf[256];
+  for (i = 0; i < 256; ++i) {
+    buf[i] = (uint8_t)i;
+  }
+  do {
+    write_bytes = write(fd, buf, 256);
+    if (write_bytes > 0) {
+      total_bytes += write_bytes;
+    }
+  } while (write_bytes >= 0 || errno == EINTR);
+  GPR_ASSERT(errno == EAGAIN);
+  return total_bytes;
+}
+
+static size_t fill_socket_partial(int fd, size_t bytes) {
+  ssize_t write_bytes;
+  size_t total_bytes = 0;
+  unsigned char* buf = (unsigned char*)gpr_malloc(bytes);
+  unsigned i;
+  for (i = 0; i < bytes; ++i) {
+    buf[i] = (uint8_t)(i % 256);
+  }
+
+  do {
+    write_bytes = write(fd, buf, bytes - total_bytes);
+    if (write_bytes > 0) {
+      total_bytes += (size_t)write_bytes;
+    }
+  } while ((write_bytes >= 0 || errno == EINTR) && bytes > total_bytes);
+
+  gpr_free(buf);
+
+  return total_bytes;
+}
+
+struct read_socket_state {
+  grpc_endpoint* ep;
+  size_t read_bytes;
+  size_t target_read_bytes;
+  grpc_slice_buffer incoming;
+  grpc_closure read_cb;
+};
+
+static size_t count_slices(grpc_slice* slices, size_t nslices,
+                           int* current_data) {
+  size_t num_bytes = 0;
+  unsigned i, j;
+  unsigned char* buf;
+  for (i = 0; i < nslices; ++i) {
+    buf = GRPC_SLICE_START_PTR(slices[i]);
+    for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
+      GPR_ASSERT(buf[j] == *current_data);
+      *current_data = (*current_data + 1) % 256;
+    }
+    num_bytes += GRPC_SLICE_LENGTH(slices[i]);
+  }
+  return num_bytes;
+}
+
+static void read_cb(grpc_exec_ctx* exec_ctx, void* user_data,
+                    grpc_error* error) {
+  struct read_socket_state* state = (struct read_socket_state*)user_data;
+  size_t read_bytes;
+  int current_data;
+
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+
+  gpr_mu_lock(g_mu);
+  current_data = state->read_bytes % 256;
+  read_bytes = count_slices(state->incoming.slices, state->incoming.count,
+                            &current_data);
+  state->read_bytes += read_bytes;
+  gpr_log(GPR_INFO, "Read %" PRIuPTR " bytes of %" PRIuPTR, read_bytes,
+          state->target_read_bytes);
+  if (state->read_bytes >= state->target_read_bytes) {
+    GPR_ASSERT(GRPC_LOG_IF_ERROR("kick",
+                                 grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+    gpr_mu_unlock(g_mu);
+  } else {
+    grpc_endpoint_read(exec_ctx, state->ep, &state->incoming, &state->read_cb);
+    gpr_mu_unlock(g_mu);
+  }
+}
+
+/* Write to a socket, then read from it using the grpc_tcp API. */
+static void read_test(size_t num_bytes, size_t slice_size) {
+  int sv[2];
+  grpc_endpoint* ep;
+  struct read_socket_state state;
+  size_t written_bytes;
+  grpc_millis deadline =
+      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_INFO, "Read test of size %" PRIuPTR ", slice size %" PRIuPTR,
+          num_bytes, slice_size);
+
+  create_sockets(sv);
+
+  grpc_arg a[1];
+  a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
+  a[0].type = GRPC_ARG_INTEGER, a[0].value.integer = (int)slice_size;
+  grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
+  ep = grpc_tcp_create(&exec_ctx, grpc_fd_create(sv[1], "read_test"), &args,
+                       "test");
+  grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset);
+
+  written_bytes = fill_socket_partial(sv[0], num_bytes);
+  gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes);
+
+  state.ep = ep;
+  state.read_bytes = 0;
+  state.target_read_bytes = written_bytes;
+  grpc_slice_buffer_init(&state.incoming);
+  GRPC_CLOSURE_INIT(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
+
+  grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
+
+  gpr_mu_lock(g_mu);
+  while (state.read_bytes < state.target_read_bytes) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  GPR_ASSERT(state.read_bytes == state.target_read_bytes);
+  gpr_mu_unlock(g_mu);
+
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.incoming);
+  grpc_endpoint_destroy(&exec_ctx, ep);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+/* Write to a socket until it fills up, then read from it using the grpc_tcp
+   API. */
+static void large_read_test(size_t slice_size) {
+  int sv[2];
+  grpc_endpoint* ep;
+  struct read_socket_state state;
+  ssize_t written_bytes;
+  grpc_millis deadline =
+      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_INFO, "Start large read test, slice size %" PRIuPTR, slice_size);
+
+  create_sockets(sv);
+
+  grpc_arg a[1];
+  a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
+  a[0].type = GRPC_ARG_INTEGER;
+  a[0].value.integer = (int)slice_size;
+  grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
+  ep = grpc_tcp_create(&exec_ctx, grpc_fd_create(sv[1], "large_read_test"),
+                       &args, "test");
+  grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset);
+
+  written_bytes = fill_socket(sv[0]);
+  gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes);
+
+  state.ep = ep;
+  state.read_bytes = 0;
+  state.target_read_bytes = (size_t)written_bytes;
+  grpc_slice_buffer_init(&state.incoming);
+  GRPC_CLOSURE_INIT(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
+
+  grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
+
+  gpr_mu_lock(g_mu);
+  while (state.read_bytes < state.target_read_bytes) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  GPR_ASSERT(state.read_bytes == state.target_read_bytes);
+  gpr_mu_unlock(g_mu);
+
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.incoming);
+  grpc_endpoint_destroy(&exec_ctx, ep);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+struct write_socket_state {
+  grpc_endpoint* ep;
+  int write_done;
+};
+
+static grpc_slice* allocate_blocks(size_t num_bytes, size_t slice_size,
+                                   size_t* num_blocks, uint8_t* current_data) {
+  size_t nslices = num_bytes / slice_size + (num_bytes % slice_size ? 1u : 0u);
+  grpc_slice* slices = (grpc_slice*)gpr_malloc(sizeof(grpc_slice) * nslices);
+  size_t num_bytes_left = num_bytes;
+  unsigned i, j;
+  unsigned char* buf;
+  *num_blocks = nslices;
+
+  for (i = 0; i < nslices; ++i) {
+    slices[i] = grpc_slice_malloc(slice_size > num_bytes_left ? num_bytes_left
+                                                              : slice_size);
+    num_bytes_left -= GRPC_SLICE_LENGTH(slices[i]);
+    buf = GRPC_SLICE_START_PTR(slices[i]);
+    for (j = 0; j < GRPC_SLICE_LENGTH(slices[i]); ++j) {
+      buf[j] = *current_data;
+      (*current_data)++;
+    }
+  }
+  GPR_ASSERT(num_bytes_left == 0);
+  return slices;
+}
+
+static void write_done(grpc_exec_ctx* exec_ctx,
+                       void* user_data /* write_socket_state */,
+                       grpc_error* error) {
+  struct write_socket_state* state = (struct write_socket_state*)user_data;
+  gpr_log(GPR_INFO, "Write done callback called");
+  gpr_mu_lock(g_mu);
+  gpr_log(GPR_INFO, "Signalling write done");
+  state->write_done = 1;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+void drain_socket_blocking(int fd, size_t num_bytes, size_t read_size) {
+  unsigned char* buf = (unsigned char*)gpr_malloc(read_size);
+  ssize_t bytes_read;
+  size_t bytes_left = num_bytes;
+  int flags;
+  int current = 0;
+  int i;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  flags = fcntl(fd, F_GETFL, 0);
+  GPR_ASSERT(fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) == 0);
+
+  for (;;) {
+    grpc_pollset_worker* worker = NULL;
+    gpr_mu_lock(g_mu);
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, g_pollset, &worker,
+                          grpc_timespec_to_millis_round_up(
+                              grpc_timeout_milliseconds_to_deadline(10)))));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    do {
+      bytes_read =
+          read(fd, buf, bytes_left > read_size ? read_size : bytes_left);
+    } while (bytes_read < 0 && errno == EINTR);
+    GPR_ASSERT(bytes_read >= 0);
+    for (i = 0; i < bytes_read; ++i) {
+      GPR_ASSERT(buf[i] == current);
+      current = (current + 1) % 256;
+    }
+    bytes_left -= (size_t)bytes_read;
+    if (bytes_left == 0) break;
+  }
+  flags = fcntl(fd, F_GETFL, 0);
+  GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
+
+  gpr_free(buf);
+}
+
+/* Write to a socket using the grpc_tcp API, then drain it directly.
+   Note that if the write does not complete immediately we need to drain the
+   socket in parallel with the read. */
+static void write_test(size_t num_bytes, size_t slice_size) {
+  int sv[2];
+  grpc_endpoint* ep;
+  struct write_socket_state state;
+  size_t num_blocks;
+  grpc_slice* slices;
+  uint8_t current_data = 0;
+  grpc_slice_buffer outgoing;
+  grpc_closure write_done_closure;
+  grpc_millis deadline =
+      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_INFO,
+          "Start write test with %" PRIuPTR " bytes, slice size %" PRIuPTR,
+          num_bytes, slice_size);
+
+  create_sockets(sv);
+
+  grpc_arg a[1];
+  a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
+  a[0].type = GRPC_ARG_INTEGER, a[0].value.integer = (int)slice_size;
+  grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
+  ep = grpc_tcp_create(&exec_ctx, grpc_fd_create(sv[1], "write_test"), &args,
+                       "test");
+  grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset);
+
+  state.ep = ep;
+  state.write_done = 0;
+
+  slices = allocate_blocks(num_bytes, slice_size, &num_blocks, &current_data);
+
+  grpc_slice_buffer_init(&outgoing);
+  grpc_slice_buffer_addn(&outgoing, slices, num_blocks);
+  GRPC_CLOSURE_INIT(&write_done_closure, write_done, &state,
+                    grpc_schedule_on_exec_ctx);
+
+  grpc_endpoint_write(&exec_ctx, ep, &outgoing, &write_done_closure);
+  drain_socket_blocking(sv[0], num_bytes, num_bytes);
+  gpr_mu_lock(g_mu);
+  for (;;) {
+    grpc_pollset_worker* worker = NULL;
+    if (state.write_done) {
+      break;
+    }
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  gpr_mu_unlock(g_mu);
+
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &outgoing);
+  grpc_endpoint_destroy(&exec_ctx, ep);
+  gpr_free(slices);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+void on_fd_released(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* errors) {
+  int* done = (int*)arg;
+  *done = 1;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+}
+
+/* Do a read_test, then release fd and try to read/write again. Verify that
+   grpc_tcp_fd() is available before the fd is released. */
+static void release_fd_test(size_t num_bytes, size_t slice_size) {
+  int sv[2];
+  grpc_endpoint* ep;
+  struct read_socket_state state;
+  size_t written_bytes;
+  int fd;
+  grpc_millis deadline =
+      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_closure fd_released_cb;
+  int fd_released_done = 0;
+  GRPC_CLOSURE_INIT(&fd_released_cb, &on_fd_released, &fd_released_done,
+                    grpc_schedule_on_exec_ctx);
+
+  gpr_log(GPR_INFO,
+          "Release fd read_test of size %" PRIuPTR ", slice size %" PRIuPTR,
+          num_bytes, slice_size);
+
+  create_sockets(sv);
+
+  grpc_arg a[1];
+  a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
+  a[0].type = GRPC_ARG_INTEGER;
+  a[0].value.integer = (int)slice_size;
+  grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
+  ep = grpc_tcp_create(&exec_ctx, grpc_fd_create(sv[1], "read_test"), &args,
+                       "test");
+  GPR_ASSERT(grpc_tcp_fd(ep) == sv[1] && sv[1] >= 0);
+  grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset);
+
+  written_bytes = fill_socket_partial(sv[0], num_bytes);
+  gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes);
+
+  state.ep = ep;
+  state.read_bytes = 0;
+  state.target_read_bytes = written_bytes;
+  grpc_slice_buffer_init(&state.incoming);
+  GRPC_CLOSURE_INIT(&state.read_cb, read_cb, &state, grpc_schedule_on_exec_ctx);
+
+  grpc_endpoint_read(&exec_ctx, ep, &state.incoming, &state.read_cb);
+
+  gpr_mu_lock(g_mu);
+  while (state.read_bytes < state.target_read_bytes) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
+    gpr_log(GPR_DEBUG, "wakeup: read=%" PRIdPTR " target=%" PRIdPTR,
+            state.read_bytes, state.target_read_bytes);
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_flush(&exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  GPR_ASSERT(state.read_bytes == state.target_read_bytes);
+  gpr_mu_unlock(g_mu);
+
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &state.incoming);
+  grpc_tcp_destroy_and_release_fd(&exec_ctx, ep, &fd, &fd_released_cb);
+  grpc_exec_ctx_flush(&exec_ctx);
+  gpr_mu_lock(g_mu);
+  while (!fd_released_done) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
+    gpr_log(GPR_DEBUG, "wakeup: fd_released_done=%d", fd_released_done);
+  }
+  gpr_mu_unlock(g_mu);
+  GPR_ASSERT(fd_released_done == 1);
+  GPR_ASSERT(fd == sv[1]);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  written_bytes = fill_socket_partial(sv[0], num_bytes);
+  drain_socket_blocking(fd, written_bytes, written_bytes);
+  written_bytes = fill_socket_partial(fd, num_bytes);
+  drain_socket_blocking(sv[0], written_bytes, written_bytes);
+  close(fd);
+}
+
+void run_tests(void) {
+  size_t i = 0;
+
+  read_test(100, 8192);
+  read_test(10000, 8192);
+  read_test(10000, 137);
+  read_test(10000, 1);
+  large_read_test(8192);
+  large_read_test(1);
+
+  write_test(100, 8192);
+  write_test(100, 1);
+  write_test(100000, 8192);
+  write_test(100000, 1);
+  write_test(100000, 137);
+
+  for (i = 1; i < 1000; i = GPR_MAX(i + 1, i * 5 / 4)) {
+    write_test(40320, i);
+  }
+
+  release_fd_test(100, 8192);
+}
+
+static void clean_up(void) {}
+
+static grpc_endpoint_test_fixture create_fixture_tcp_socketpair(
+    size_t slice_size) {
+  int sv[2];
+  grpc_endpoint_test_fixture f;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  create_sockets(sv);
+  grpc_resource_quota* resource_quota =
+      grpc_resource_quota_create("tcp_posix_test_socketpair");
+  grpc_arg a[1];
+  a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
+  a[0].type = GRPC_ARG_INTEGER;
+  a[0].value.integer = (int)slice_size;
+  grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
+  f.client_ep = grpc_tcp_create(
+      &exec_ctx, grpc_fd_create(sv[0], "fixture:client"), &args, "test");
+  f.server_ep = grpc_tcp_create(
+      &exec_ctx, grpc_fd_create(sv[1], "fixture:server"), &args, "test");
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+  grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset);
+  grpc_endpoint_add_to_pollset(&exec_ctx, f.server_ep, g_pollset);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  return f;
+}
+
+static grpc_endpoint_test_config configs[] = {
+    {"tcp/tcp_socketpair", create_fixture_tcp_socketpair, clean_up},
+};
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, (grpc_pollset*)p);
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_test_init(argc, argv);
+  grpc_init();
+  g_pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+  grpc_pollset_init(g_pollset, &g_mu);
+  grpc_endpoint_tests(configs[0], g_pollset, g_mu);
+  run_tests();
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  gpr_free(g_pollset);
+
+  return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c
deleted file mode 100644
index 782dfb4..0000000
--- a/test/core/iomgr/tcp_server_posix_test.c
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with posix sockets enabled
-#ifdef GRPC_POSIX_SOCKET
-
-#include "src/core/lib/iomgr/tcp_server.h"
-
-#include <errno.h>
-#include <ifaddrs.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x)
-
-static gpr_mu *g_mu;
-static grpc_pollset *g_pollset;
-static int g_nconnects = 0;
-
-typedef struct {
-  /* Owns a ref to server. */
-  grpc_tcp_server *server;
-  unsigned port_index;
-  unsigned fd_index;
-  int server_fd;
-} on_connect_result;
-
-typedef struct {
-  grpc_tcp_server *server;
-
-  /* arg is this server_weak_ref. */
-  grpc_closure server_shutdown;
-} server_weak_ref;
-
-#define MAX_URI 1024
-typedef struct {
-  grpc_resolved_address addr;
-  char str[MAX_URI];
-} test_addr;
-
-#define MAX_ADDRS 100
-typedef struct {
-  size_t naddrs;
-  test_addr addrs[MAX_ADDRS];
-} test_addrs;
-
-static on_connect_result g_result = {NULL, 0, 0, -1};
-
-static char family_name_buf[1024];
-static const char *sock_family_name(int family) {
-  if (family == AF_INET) {
-    return "AF_INET";
-  } else if (family == AF_INET6) {
-    return "AF_INET6";
-  } else if (family == AF_UNSPEC) {
-    return "AF_UNSPEC";
-  } else {
-    sprintf(family_name_buf, "%d", family);
-    return family_name_buf;
-  }
-}
-
-static void on_connect_result_init(on_connect_result *result) {
-  result->server = NULL;
-  result->port_index = 0;
-  result->fd_index = 0;
-  result->server_fd = -1;
-}
-
-static void on_connect_result_set(on_connect_result *result,
-                                  const grpc_tcp_server_acceptor *acceptor) {
-  result->server = grpc_tcp_server_ref(acceptor->from_server);
-  result->port_index = acceptor->port_index;
-  result->fd_index = acceptor->fd_index;
-  result->server_fd = grpc_tcp_server_port_fd(
-      result->server, acceptor->port_index, acceptor->fd_index);
-}
-
-static void server_weak_ref_shutdown(grpc_exec_ctx *exec_ctx, void *arg,
-                                     grpc_error *error) {
-  server_weak_ref *weak_ref = arg;
-  weak_ref->server = NULL;
-}
-
-static void server_weak_ref_init(server_weak_ref *weak_ref) {
-  weak_ref->server = NULL;
-  GRPC_CLOSURE_INIT(&weak_ref->server_shutdown, server_weak_ref_shutdown,
-                    weak_ref, grpc_schedule_on_exec_ctx);
-}
-
-/* Make weak_ref->server_shutdown a shutdown_starting cb on server.
-   grpc_tcp_server promises that the server object will live until
-   weak_ref->server_shutdown has returned. A strong ref on grpc_tcp_server
-   should be held until server_weak_ref_set() returns to avoid a race where the
-   server is deleted before the shutdown_starting cb is added. */
-static void server_weak_ref_set(server_weak_ref *weak_ref,
-                                grpc_tcp_server *server) {
-  grpc_tcp_server_shutdown_starting_add(server, &weak_ref->server_shutdown);
-  weak_ref->server = server;
-}
-
-static void test_addr_init_str(test_addr *addr) {
-  char *str = NULL;
-  if (grpc_sockaddr_to_string(&str, &addr->addr, 0) != -1) {
-    size_t str_len;
-    memcpy(addr->str, str, (str_len = strnlen(str, sizeof(addr->str) - 1)));
-    addr->str[str_len] = '\0';
-    gpr_free(str);
-  } else {
-    addr->str[0] = '\0';
-  }
-}
-
-static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp,
-                       grpc_pollset *pollset,
-                       grpc_tcp_server_acceptor *acceptor) {
-  grpc_endpoint_shutdown(exec_ctx, tcp,
-                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected"));
-  grpc_endpoint_destroy(exec_ctx, tcp);
-
-  on_connect_result temp_result;
-  on_connect_result_set(&temp_result, acceptor);
-  gpr_free(acceptor);
-
-  gpr_mu_lock(g_mu);
-  g_result = temp_result;
-  g_nconnects++;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-static void test_no_op(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_tcp_server *s;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_op_with_start(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_tcp_server *s;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
-  LOG_TEST("test_no_op_with_start");
-  grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL);
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_op_with_port(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  grpc_tcp_server *s;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
-  LOG_TEST("test_no_op_with_port");
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-  int port = -1;
-  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr, &port) ==
-                 GRPC_ERROR_NONE &&
-             port > 0);
-
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_op_with_port_and_start(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  grpc_tcp_server *s;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
-  LOG_TEST("test_no_op_with_port_and_start");
-  int port = -1;
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr, &port) ==
-                 GRPC_ERROR_NONE &&
-             port > 0);
-
-  grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL);
-
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static grpc_error *tcp_connect(grpc_exec_ctx *exec_ctx, const test_addr *remote,
-                               on_connect_result *result) {
-  grpc_millis deadline =
-      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
-  int clifd;
-  int nconnects_before;
-  const struct sockaddr *remote_addr =
-      (const struct sockaddr *)remote->addr.addr;
-
-  gpr_log(GPR_INFO, "Connecting to %s", remote->str);
-  gpr_mu_lock(g_mu);
-  nconnects_before = g_nconnects;
-  on_connect_result_init(&g_result);
-  clifd = socket(remote_addr->sa_family, SOCK_STREAM, 0);
-  if (clifd < 0) {
-    gpr_mu_unlock(g_mu);
-    return GRPC_OS_ERROR(errno, "Failed to create socket");
-  }
-  gpr_log(GPR_DEBUG, "start connect to %s", remote->str);
-  if (connect(clifd, remote_addr, (socklen_t)remote->addr.len) != 0) {
-    gpr_mu_unlock(g_mu);
-    close(clifd);
-    return GRPC_OS_ERROR(errno, "connect");
-  }
-  gpr_log(GPR_DEBUG, "wait");
-  while (g_nconnects == nconnects_before &&
-         deadline > grpc_exec_ctx_now(exec_ctx)) {
-    grpc_pollset_worker *worker = NULL;
-    grpc_error *err;
-    if ((err = grpc_pollset_work(exec_ctx, g_pollset, &worker, deadline)) !=
-        GRPC_ERROR_NONE) {
-      gpr_mu_unlock(g_mu);
-      close(clifd);
-      return err;
-    }
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  gpr_log(GPR_DEBUG, "wait done");
-  if (g_nconnects != nconnects_before + 1) {
-    gpr_mu_unlock(g_mu);
-    close(clifd);
-    return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Didn't connect");
-  }
-  close(clifd);
-  *result = g_result;
-
-  gpr_mu_unlock(g_mu);
-  gpr_log(GPR_INFO, "Result (%d, %d) fd %d", result->port_index,
-          result->fd_index, result->server_fd);
-  grpc_tcp_server_unref(exec_ctx, result->server);
-  return GRPC_ERROR_NONE;
-}
-
-/* Tests a tcp server on "::" listeners with multiple ports. If channel_args is
-   non-NULL, pass them to the server. If dst_addrs is non-NULL, use valid addrs
-   as destination addrs (port is not set). If dst_addrs is NULL, use listener
-   addrs as destination addrs. If test_dst_addrs is true, test connectivity with
-   each destination address, set grpc_resolved_address::len=0 for failures, but
-   don't fail the overall unitest. */
-static void test_connect(size_t num_connects,
-                         const grpc_channel_args *channel_args,
-                         test_addrs *dst_addrs, bool test_dst_addrs) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  grpc_resolved_address resolved_addr1;
-  struct sockaddr_storage *const addr =
-      (struct sockaddr_storage *)resolved_addr.addr;
-  struct sockaddr_storage *const addr1 =
-      (struct sockaddr_storage *)resolved_addr1.addr;
-  unsigned svr_fd_count;
-  int port;
-  int svr_port;
-  unsigned svr1_fd_count;
-  int svr1_port;
-  grpc_tcp_server *s;
-  const unsigned num_ports = 2;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, channel_args, &s));
-  unsigned port_num;
-  server_weak_ref weak_ref;
-  server_weak_ref_init(&weak_ref);
-  server_weak_ref_set(&weak_ref, s);
-  LOG_TEST("test_connect");
-  gpr_log(GPR_INFO,
-          "clients=%lu, num chan args=%lu, remote IP=%s, test_dst_addrs=%d",
-          (unsigned long)num_connects,
-          (unsigned long)(channel_args != NULL ? channel_args->num_args : 0),
-          dst_addrs != NULL ? "<specific>" : "::", test_dst_addrs);
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  memset(&resolved_addr1, 0, sizeof(resolved_addr1));
-  resolved_addr.len = sizeof(struct sockaddr_storage);
-  resolved_addr1.len = sizeof(struct sockaddr_storage);
-  addr->ss_family = addr1->ss_family = AF_INET;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "grpc_tcp_server_add_port",
-      grpc_tcp_server_add_port(s, &resolved_addr, &svr_port)));
-  gpr_log(GPR_INFO, "Allocated port %d", svr_port);
-  GPR_ASSERT(svr_port > 0);
-  /* Cannot use wildcard (port==0), because add_port() will try to reuse the
-     same port as a previous add_port(). */
-  svr1_port = grpc_pick_unused_port_or_die();
-  GPR_ASSERT(svr1_port > 0);
-  gpr_log(GPR_INFO, "Picked unused port %d", svr1_port);
-  grpc_sockaddr_set_port(&resolved_addr1, svr1_port);
-  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr1, &port) ==
-                 GRPC_ERROR_NONE &&
-             port == svr1_port);
-
-  /* Bad port_index. */
-  GPR_ASSERT(grpc_tcp_server_port_fd_count(s, 2) == 0);
-  GPR_ASSERT(grpc_tcp_server_port_fd(s, 2, 0) < 0);
-
-  /* Bad fd_index. */
-  GPR_ASSERT(grpc_tcp_server_port_fd(s, 0, 100) < 0);
-  GPR_ASSERT(grpc_tcp_server_port_fd(s, 1, 100) < 0);
-
-  /* Got at least one fd per port. */
-  svr_fd_count = grpc_tcp_server_port_fd_count(s, 0);
-  GPR_ASSERT(svr_fd_count >= 1);
-  svr1_fd_count = grpc_tcp_server_port_fd_count(s, 1);
-  GPR_ASSERT(svr1_fd_count >= 1);
-
-  grpc_tcp_server_start(&exec_ctx, s, &g_pollset, 1, on_connect, NULL);
-
-  if (dst_addrs != NULL) {
-    int ports[] = {svr_port, svr1_port};
-    for (port_num = 0; port_num < num_ports; ++port_num) {
-      size_t dst_idx;
-      size_t num_tested = 0;
-      for (dst_idx = 0; dst_idx < dst_addrs->naddrs; ++dst_idx) {
-        test_addr dst = dst_addrs->addrs[dst_idx];
-        on_connect_result result;
-        grpc_error *err;
-        if (dst.addr.len == 0) {
-          gpr_log(GPR_DEBUG, "Skipping test of non-functional local IP %s",
-                  dst.str);
-          continue;
-        }
-        GPR_ASSERT(grpc_sockaddr_set_port(&dst.addr, ports[port_num]));
-        test_addr_init_str(&dst);
-        ++num_tested;
-        on_connect_result_init(&result);
-        if ((err = tcp_connect(&exec_ctx, &dst, &result)) == GRPC_ERROR_NONE &&
-            result.server_fd >= 0 && result.server == s) {
-          continue;
-        }
-        gpr_log(GPR_ERROR, "Failed to connect to %s: %s", dst.str,
-                grpc_error_string(err));
-        GPR_ASSERT(test_dst_addrs);
-        dst_addrs->addrs[dst_idx].addr.len = 0;
-        GRPC_ERROR_UNREF(err);
-      }
-      GPR_ASSERT(num_tested > 0);
-    }
-  } else {
-    for (port_num = 0; port_num < num_ports; ++port_num) {
-      const unsigned num_fds = grpc_tcp_server_port_fd_count(s, port_num);
-      unsigned fd_num;
-      for (fd_num = 0; fd_num < num_fds; ++fd_num) {
-        int fd = grpc_tcp_server_port_fd(s, port_num, fd_num);
-        size_t connect_num;
-        test_addr dst;
-        GPR_ASSERT(fd >= 0);
-        dst.addr.len = sizeof(dst.addr.addr);
-        GPR_ASSERT(getsockname(fd, (struct sockaddr *)dst.addr.addr,
-                               (socklen_t *)&dst.addr.len) == 0);
-        GPR_ASSERT(dst.addr.len <= sizeof(dst.addr.addr));
-        test_addr_init_str(&dst);
-        gpr_log(GPR_INFO, "(%d, %d) fd %d family %s listening on %s", port_num,
-                fd_num, fd, sock_family_name(addr->ss_family), dst.str);
-        for (connect_num = 0; connect_num < num_connects; ++connect_num) {
-          on_connect_result result;
-          on_connect_result_init(&result);
-          GPR_ASSERT(GRPC_LOG_IF_ERROR("tcp_connect",
-                                       tcp_connect(&exec_ctx, &dst, &result)));
-          GPR_ASSERT(result.server_fd == fd);
-          GPR_ASSERT(result.port_index == port_num);
-          GPR_ASSERT(result.fd_index == fd_num);
-          GPR_ASSERT(result.server == s);
-          GPR_ASSERT(
-              grpc_tcp_server_port_fd(s, result.port_index, result.fd_index) ==
-              result.server_fd);
-        }
-      }
-    }
-  }
-  /* Weak ref to server valid until final unref. */
-  GPR_ASSERT(weak_ref.server != NULL);
-  GPR_ASSERT(grpc_tcp_server_port_fd(s, 0, 0) >= 0);
-
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  /* Weak ref lost. */
-  GPR_ASSERT(weak_ref.server == NULL);
-}
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, p);
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_arg chan_args[] = {
-      {GRPC_ARG_INTEGER, GRPC_ARG_EXPAND_WILDCARD_ADDRS, {.integer = 1}}};
-  const grpc_channel_args channel_args = {1, chan_args};
-  struct ifaddrs *ifa = NULL;
-  struct ifaddrs *ifa_it;
-  // Zalloc dst_addrs to avoid oversized frames.
-  test_addrs *dst_addrs = gpr_zalloc(sizeof(*dst_addrs));
-  grpc_test_init(argc, argv);
-  grpc_init();
-  g_pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(g_pollset, &g_mu);
-
-  test_no_op();
-  test_no_op_with_start();
-  test_no_op_with_port();
-  test_no_op_with_port_and_start();
-
-  if (getifaddrs(&ifa) != 0 || ifa == NULL) {
-    gpr_log(GPR_ERROR, "getifaddrs: %s", strerror(errno));
-    return EXIT_FAILURE;
-  }
-  dst_addrs->naddrs = 0;
-  for (ifa_it = ifa; ifa_it != NULL && dst_addrs->naddrs < MAX_ADDRS;
-       ifa_it = ifa_it->ifa_next) {
-    if (ifa_it->ifa_addr == NULL) {
-      continue;
-    } else if (ifa_it->ifa_addr->sa_family == AF_INET) {
-      dst_addrs->addrs[dst_addrs->naddrs].addr.len = sizeof(struct sockaddr_in);
-    } else if (ifa_it->ifa_addr->sa_family == AF_INET6) {
-      dst_addrs->addrs[dst_addrs->naddrs].addr.len =
-          sizeof(struct sockaddr_in6);
-    } else {
-      continue;
-    }
-    memcpy(dst_addrs->addrs[dst_addrs->naddrs].addr.addr, ifa_it->ifa_addr,
-           dst_addrs->addrs[dst_addrs->naddrs].addr.len);
-    GPR_ASSERT(
-        grpc_sockaddr_set_port(&dst_addrs->addrs[dst_addrs->naddrs].addr, 0));
-    test_addr_init_str(&dst_addrs->addrs[dst_addrs->naddrs]);
-    ++dst_addrs->naddrs;
-  }
-  freeifaddrs(ifa);
-  ifa = NULL;
-
-  /* Connect to same addresses as listeners. */
-  test_connect(1, NULL, NULL, false);
-  test_connect(10, NULL, NULL, false);
-
-  /* Set dst_addrs->addrs[i].len=0 for dst_addrs that are unreachable with a
-     "::" listener. */
-  test_connect(1, NULL, dst_addrs, true);
-
-  /* Test connect(2) with dst_addrs. */
-  test_connect(1, &channel_args, dst_addrs, false);
-  /* Test connect(2) with dst_addrs. */
-  test_connect(10, &channel_args, dst_addrs, false);
-
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  gpr_free(dst_addrs);
-  gpr_free(g_pollset);
-  return EXIT_SUCCESS;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/tcp_server_posix_test.cc b/test/core/iomgr/tcp_server_posix_test.cc
new file mode 100644
index 0000000..6efa74c
--- /dev/null
+++ b/test/core/iomgr/tcp_server_posix_test.cc
@@ -0,0 +1,512 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include "src/core/lib/iomgr/tcp_server.h"
+
+#include <errno.h>
+#include <ifaddrs.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x)
+
+static gpr_mu* g_mu;
+static grpc_pollset* g_pollset;
+static int g_nconnects = 0;
+
+typedef struct {
+  /* Owns a ref to server. */
+  grpc_tcp_server* server;
+  unsigned port_index;
+  unsigned fd_index;
+  int server_fd;
+} on_connect_result;
+
+typedef struct {
+  grpc_tcp_server* server;
+
+  /* arg is this server_weak_ref. */
+  grpc_closure server_shutdown;
+} server_weak_ref;
+
+#define MAX_URI 1024
+typedef struct {
+  grpc_resolved_address addr;
+  char str[MAX_URI];
+} test_addr;
+
+#define MAX_ADDRS 100
+typedef struct {
+  size_t naddrs;
+  test_addr addrs[MAX_ADDRS];
+} test_addrs;
+
+static on_connect_result g_result = {NULL, 0, 0, -1};
+
+static char family_name_buf[1024];
+static const char* sock_family_name(int family) {
+  if (family == AF_INET) {
+    return "AF_INET";
+  } else if (family == AF_INET6) {
+    return "AF_INET6";
+  } else if (family == AF_UNSPEC) {
+    return "AF_UNSPEC";
+  } else {
+    sprintf(family_name_buf, "%d", family);
+    return family_name_buf;
+  }
+}
+
+static void on_connect_result_init(on_connect_result* result) {
+  result->server = NULL;
+  result->port_index = 0;
+  result->fd_index = 0;
+  result->server_fd = -1;
+}
+
+static void on_connect_result_set(on_connect_result* result,
+                                  const grpc_tcp_server_acceptor* acceptor) {
+  result->server = grpc_tcp_server_ref(acceptor->from_server);
+  result->port_index = acceptor->port_index;
+  result->fd_index = acceptor->fd_index;
+  result->server_fd = grpc_tcp_server_port_fd(
+      result->server, acceptor->port_index, acceptor->fd_index);
+}
+
+static void server_weak_ref_shutdown(grpc_exec_ctx* exec_ctx, void* arg,
+                                     grpc_error* error) {
+  server_weak_ref* weak_ref = static_cast<server_weak_ref*>(arg);
+  weak_ref->server = NULL;
+}
+
+static void server_weak_ref_init(server_weak_ref* weak_ref) {
+  weak_ref->server = NULL;
+  GRPC_CLOSURE_INIT(&weak_ref->server_shutdown, server_weak_ref_shutdown,
+                    weak_ref, grpc_schedule_on_exec_ctx);
+}
+
+/* Make weak_ref->server_shutdown a shutdown_starting cb on server.
+   grpc_tcp_server promises that the server object will live until
+   weak_ref->server_shutdown has returned. A strong ref on grpc_tcp_server
+   should be held until server_weak_ref_set() returns to avoid a race where the
+   server is deleted before the shutdown_starting cb is added. */
+static void server_weak_ref_set(server_weak_ref* weak_ref,
+                                grpc_tcp_server* server) {
+  grpc_tcp_server_shutdown_starting_add(server, &weak_ref->server_shutdown);
+  weak_ref->server = server;
+}
+
+static void test_addr_init_str(test_addr* addr) {
+  char* str = NULL;
+  if (grpc_sockaddr_to_string(&str, &addr->addr, 0) != -1) {
+    size_t str_len;
+    memcpy(addr->str, str, (str_len = strnlen(str, sizeof(addr->str) - 1)));
+    addr->str[str_len] = '\0';
+    gpr_free(str);
+  } else {
+    addr->str[0] = '\0';
+  }
+}
+
+static void on_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* tcp,
+                       grpc_pollset* pollset,
+                       grpc_tcp_server_acceptor* acceptor) {
+  grpc_endpoint_shutdown(exec_ctx, tcp,
+                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected"));
+  grpc_endpoint_destroy(exec_ctx, tcp);
+
+  on_connect_result temp_result;
+  on_connect_result_set(&temp_result, acceptor);
+  gpr_free(acceptor);
+
+  gpr_mu_lock(g_mu);
+  g_result = temp_result;
+  g_nconnects++;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+static void test_no_op(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_tcp_server* s;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_op_with_start(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_tcp_server* s;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
+  LOG_TEST("test_no_op_with_start");
+  grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL);
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_op_with_port(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  grpc_tcp_server* s;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
+  LOG_TEST("test_no_op_with_port");
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+  int port = -1;
+  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr, &port) ==
+                 GRPC_ERROR_NONE &&
+             port > 0);
+
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_op_with_port_and_start(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  grpc_tcp_server* s;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
+  LOG_TEST("test_no_op_with_port_and_start");
+  int port = -1;
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr, &port) ==
+                 GRPC_ERROR_NONE &&
+             port > 0);
+
+  grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL);
+
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static grpc_error* tcp_connect(grpc_exec_ctx* exec_ctx, const test_addr* remote,
+                               on_connect_result* result) {
+  grpc_millis deadline =
+      grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
+  int clifd;
+  int nconnects_before;
+  const struct sockaddr* remote_addr =
+      (const struct sockaddr*)remote->addr.addr;
+
+  gpr_log(GPR_INFO, "Connecting to %s", remote->str);
+  gpr_mu_lock(g_mu);
+  nconnects_before = g_nconnects;
+  on_connect_result_init(&g_result);
+  clifd = socket(remote_addr->sa_family, SOCK_STREAM, 0);
+  if (clifd < 0) {
+    gpr_mu_unlock(g_mu);
+    return GRPC_OS_ERROR(errno, "Failed to create socket");
+  }
+  gpr_log(GPR_DEBUG, "start connect to %s", remote->str);
+  if (connect(clifd, remote_addr, (socklen_t)remote->addr.len) != 0) {
+    gpr_mu_unlock(g_mu);
+    close(clifd);
+    return GRPC_OS_ERROR(errno, "connect");
+  }
+  gpr_log(GPR_DEBUG, "wait");
+  while (g_nconnects == nconnects_before &&
+         deadline > grpc_exec_ctx_now(exec_ctx)) {
+    grpc_pollset_worker* worker = NULL;
+    grpc_error* err;
+    if ((err = grpc_pollset_work(exec_ctx, g_pollset, &worker, deadline)) !=
+        GRPC_ERROR_NONE) {
+      gpr_mu_unlock(g_mu);
+      close(clifd);
+      return err;
+    }
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  gpr_log(GPR_DEBUG, "wait done");
+  if (g_nconnects != nconnects_before + 1) {
+    gpr_mu_unlock(g_mu);
+    close(clifd);
+    return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Didn't connect");
+  }
+  close(clifd);
+  *result = g_result;
+
+  gpr_mu_unlock(g_mu);
+  gpr_log(GPR_INFO, "Result (%d, %d) fd %d", result->port_index,
+          result->fd_index, result->server_fd);
+  grpc_tcp_server_unref(exec_ctx, result->server);
+  return GRPC_ERROR_NONE;
+}
+
+/* Tests a tcp server on "::" listeners with multiple ports. If channel_args is
+   non-NULL, pass them to the server. If dst_addrs is non-NULL, use valid addrs
+   as destination addrs (port is not set). If dst_addrs is NULL, use listener
+   addrs as destination addrs. If test_dst_addrs is true, test connectivity with
+   each destination address, set grpc_resolved_address::len=0 for failures, but
+   don't fail the overall unitest. */
+static void test_connect(size_t num_connects,
+                         const grpc_channel_args* channel_args,
+                         test_addrs* dst_addrs, bool test_dst_addrs) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  grpc_resolved_address resolved_addr1;
+  struct sockaddr_storage* const addr =
+      (struct sockaddr_storage*)resolved_addr.addr;
+  struct sockaddr_storage* const addr1 =
+      (struct sockaddr_storage*)resolved_addr1.addr;
+  unsigned svr_fd_count;
+  int port;
+  int svr_port;
+  unsigned svr1_fd_count;
+  int svr1_port;
+  grpc_tcp_server* s;
+  const unsigned num_ports = 2;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, channel_args, &s));
+  unsigned port_num;
+  server_weak_ref weak_ref;
+  server_weak_ref_init(&weak_ref);
+  server_weak_ref_set(&weak_ref, s);
+  LOG_TEST("test_connect");
+  gpr_log(GPR_INFO,
+          "clients=%lu, num chan args=%lu, remote IP=%s, test_dst_addrs=%d",
+          (unsigned long)num_connects,
+          (unsigned long)(channel_args != NULL ? channel_args->num_args : 0),
+          dst_addrs != NULL ? "<specific>" : "::", test_dst_addrs);
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  memset(&resolved_addr1, 0, sizeof(resolved_addr1));
+  resolved_addr.len = sizeof(struct sockaddr_storage);
+  resolved_addr1.len = sizeof(struct sockaddr_storage);
+  addr->ss_family = addr1->ss_family = AF_INET;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "grpc_tcp_server_add_port",
+      grpc_tcp_server_add_port(s, &resolved_addr, &svr_port)));
+  gpr_log(GPR_INFO, "Allocated port %d", svr_port);
+  GPR_ASSERT(svr_port > 0);
+  /* Cannot use wildcard (port==0), because add_port() will try to reuse the
+     same port as a previous add_port(). */
+  svr1_port = grpc_pick_unused_port_or_die();
+  GPR_ASSERT(svr1_port > 0);
+  gpr_log(GPR_INFO, "Picked unused port %d", svr1_port);
+  grpc_sockaddr_set_port(&resolved_addr1, svr1_port);
+  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr1, &port) ==
+                 GRPC_ERROR_NONE &&
+             port == svr1_port);
+
+  /* Bad port_index. */
+  GPR_ASSERT(grpc_tcp_server_port_fd_count(s, 2) == 0);
+  GPR_ASSERT(grpc_tcp_server_port_fd(s, 2, 0) < 0);
+
+  /* Bad fd_index. */
+  GPR_ASSERT(grpc_tcp_server_port_fd(s, 0, 100) < 0);
+  GPR_ASSERT(grpc_tcp_server_port_fd(s, 1, 100) < 0);
+
+  /* Got at least one fd per port. */
+  svr_fd_count = grpc_tcp_server_port_fd_count(s, 0);
+  GPR_ASSERT(svr_fd_count >= 1);
+  svr1_fd_count = grpc_tcp_server_port_fd_count(s, 1);
+  GPR_ASSERT(svr1_fd_count >= 1);
+
+  grpc_tcp_server_start(&exec_ctx, s, &g_pollset, 1, on_connect, NULL);
+
+  if (dst_addrs != NULL) {
+    int ports[] = {svr_port, svr1_port};
+    for (port_num = 0; port_num < num_ports; ++port_num) {
+      size_t dst_idx;
+      size_t num_tested = 0;
+      for (dst_idx = 0; dst_idx < dst_addrs->naddrs; ++dst_idx) {
+        test_addr dst = dst_addrs->addrs[dst_idx];
+        on_connect_result result;
+        grpc_error* err;
+        if (dst.addr.len == 0) {
+          gpr_log(GPR_DEBUG, "Skipping test of non-functional local IP %s",
+                  dst.str);
+          continue;
+        }
+        GPR_ASSERT(grpc_sockaddr_set_port(&dst.addr, ports[port_num]));
+        test_addr_init_str(&dst);
+        ++num_tested;
+        on_connect_result_init(&result);
+        if ((err = tcp_connect(&exec_ctx, &dst, &result)) == GRPC_ERROR_NONE &&
+            result.server_fd >= 0 && result.server == s) {
+          continue;
+        }
+        gpr_log(GPR_ERROR, "Failed to connect to %s: %s", dst.str,
+                grpc_error_string(err));
+        GPR_ASSERT(test_dst_addrs);
+        dst_addrs->addrs[dst_idx].addr.len = 0;
+        GRPC_ERROR_UNREF(err);
+      }
+      GPR_ASSERT(num_tested > 0);
+    }
+  } else {
+    for (port_num = 0; port_num < num_ports; ++port_num) {
+      const unsigned num_fds = grpc_tcp_server_port_fd_count(s, port_num);
+      unsigned fd_num;
+      for (fd_num = 0; fd_num < num_fds; ++fd_num) {
+        int fd = grpc_tcp_server_port_fd(s, port_num, fd_num);
+        size_t connect_num;
+        test_addr dst;
+        GPR_ASSERT(fd >= 0);
+        dst.addr.len = sizeof(dst.addr.addr);
+        GPR_ASSERT(getsockname(fd, (struct sockaddr*)dst.addr.addr,
+                               (socklen_t*)&dst.addr.len) == 0);
+        GPR_ASSERT(dst.addr.len <= sizeof(dst.addr.addr));
+        test_addr_init_str(&dst);
+        gpr_log(GPR_INFO, "(%d, %d) fd %d family %s listening on %s", port_num,
+                fd_num, fd, sock_family_name(addr->ss_family), dst.str);
+        for (connect_num = 0; connect_num < num_connects; ++connect_num) {
+          on_connect_result result;
+          on_connect_result_init(&result);
+          GPR_ASSERT(GRPC_LOG_IF_ERROR("tcp_connect",
+                                       tcp_connect(&exec_ctx, &dst, &result)));
+          GPR_ASSERT(result.server_fd == fd);
+          GPR_ASSERT(result.port_index == port_num);
+          GPR_ASSERT(result.fd_index == fd_num);
+          GPR_ASSERT(result.server == s);
+          GPR_ASSERT(
+              grpc_tcp_server_port_fd(s, result.port_index, result.fd_index) ==
+              result.server_fd);
+        }
+      }
+    }
+  }
+  /* Weak ref to server valid until final unref. */
+  GPR_ASSERT(weak_ref.server != NULL);
+  GPR_ASSERT(grpc_tcp_server_port_fd(s, 0, 0) >= 0);
+
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  /* Weak ref lost. */
+  GPR_ASSERT(weak_ref.server == NULL);
+}
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(p));
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_arg chan_args[1];
+  chan_args[0].type = GRPC_ARG_INTEGER;
+  chan_args[0].key = const_cast<char*>(GRPC_ARG_EXPAND_WILDCARD_ADDRS);
+  chan_args[0].value.integer = 1;
+  const grpc_channel_args channel_args = {1, chan_args};
+  struct ifaddrs* ifa = NULL;
+  struct ifaddrs* ifa_it;
+  // Zalloc dst_addrs to avoid oversized frames.
+  test_addrs* dst_addrs =
+      static_cast<test_addrs*>(gpr_zalloc(sizeof(*dst_addrs)));
+  grpc_test_init(argc, argv);
+  grpc_init();
+  g_pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(g_pollset, &g_mu);
+
+  test_no_op();
+  test_no_op_with_start();
+  test_no_op_with_port();
+  test_no_op_with_port_and_start();
+
+  if (getifaddrs(&ifa) != 0 || ifa == NULL) {
+    gpr_log(GPR_ERROR, "getifaddrs: %s", strerror(errno));
+    return EXIT_FAILURE;
+  }
+  dst_addrs->naddrs = 0;
+  for (ifa_it = ifa; ifa_it != NULL && dst_addrs->naddrs < MAX_ADDRS;
+       ifa_it = ifa_it->ifa_next) {
+    if (ifa_it->ifa_addr == NULL) {
+      continue;
+    } else if (ifa_it->ifa_addr->sa_family == AF_INET) {
+      dst_addrs->addrs[dst_addrs->naddrs].addr.len = sizeof(struct sockaddr_in);
+    } else if (ifa_it->ifa_addr->sa_family == AF_INET6) {
+      dst_addrs->addrs[dst_addrs->naddrs].addr.len =
+          sizeof(struct sockaddr_in6);
+    } else {
+      continue;
+    }
+    memcpy(dst_addrs->addrs[dst_addrs->naddrs].addr.addr, ifa_it->ifa_addr,
+           dst_addrs->addrs[dst_addrs->naddrs].addr.len);
+    GPR_ASSERT(
+        grpc_sockaddr_set_port(&dst_addrs->addrs[dst_addrs->naddrs].addr, 0));
+    test_addr_init_str(&dst_addrs->addrs[dst_addrs->naddrs]);
+    ++dst_addrs->naddrs;
+  }
+  freeifaddrs(ifa);
+  ifa = NULL;
+
+  /* Connect to same addresses as listeners. */
+  test_connect(1, NULL, NULL, false);
+  test_connect(10, NULL, NULL, false);
+
+  /* Set dst_addrs->addrs[i].len=0 for dst_addrs that are unreachable with a
+     "::" listener. */
+  test_connect(1, NULL, dst_addrs, true);
+
+  /* Test connect(2) with dst_addrs. */
+  test_connect(1, &channel_args, dst_addrs, false);
+  /* Test connect(2) with dst_addrs. */
+  test_connect(10, &channel_args, dst_addrs, false);
+
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  gpr_free(dst_addrs);
+  gpr_free(g_pollset);
+  return EXIT_SUCCESS;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/tcp_server_uv_test.c b/test/core/iomgr/tcp_server_uv_test.c
deleted file mode 100644
index 9fafd31..0000000
--- a/test/core/iomgr/tcp_server_uv_test.c
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with libuv
-#ifdef GRPC_UV
-
-#include <uv.h>
-
-#include "src/core/lib/iomgr/tcp_server.h"
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x)
-
-static gpr_mu *g_mu;
-static grpc_pollset *g_pollset;
-static int g_nconnects = 0;
-
-typedef struct on_connect_result {
-  /* Owns a ref to server. */
-  grpc_tcp_server *server;
-  unsigned port_index;
-  unsigned fd_index;
-} on_connect_result;
-
-typedef struct server_weak_ref {
-  grpc_tcp_server *server;
-
-  /* arg is this server_weak_ref. */
-  grpc_closure server_shutdown;
-} server_weak_ref;
-
-static on_connect_result g_result = {NULL, 0, 0};
-
-static void on_connect_result_init(on_connect_result *result) {
-  result->server = NULL;
-  result->port_index = 0;
-  result->fd_index = 0;
-}
-
-static void on_connect_result_set(on_connect_result *result,
-                                  const grpc_tcp_server_acceptor *acceptor) {
-  result->server = grpc_tcp_server_ref(acceptor->from_server);
-  result->port_index = acceptor->port_index;
-  result->fd_index = acceptor->fd_index;
-}
-
-static void server_weak_ref_shutdown(grpc_exec_ctx *exec_ctx, void *arg,
-                                     grpc_error *error) {
-  server_weak_ref *weak_ref = arg;
-  weak_ref->server = NULL;
-}
-
-static void server_weak_ref_init(server_weak_ref *weak_ref) {
-  weak_ref->server = NULL;
-  GRPC_CLOSURE_INIT(&weak_ref->server_shutdown, server_weak_ref_shutdown,
-                    weak_ref, grpc_schedule_on_exec_ctx);
-}
-
-/* Make weak_ref->server_shutdown a shutdown_starting cb on server.
-   grpc_tcp_server promises that the server object will live until
-   weak_ref->server_shutdown has returned. A strong ref on grpc_tcp_server
-   should be held until server_weak_ref_set() returns to avoid a race where the
-   server is deleted before the shutdown_starting cb is added. */
-static void server_weak_ref_set(server_weak_ref *weak_ref,
-                                grpc_tcp_server *server) {
-  grpc_tcp_server_shutdown_starting_add(server, &weak_ref->server_shutdown);
-  weak_ref->server = server;
-}
-
-static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp,
-                       grpc_pollset *pollset,
-                       grpc_tcp_server_acceptor *acceptor) {
-  grpc_endpoint_shutdown(exec_ctx, tcp,
-                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected"));
-  grpc_endpoint_destroy(exec_ctx, tcp);
-
-  on_connect_result temp_result;
-  on_connect_result_set(&temp_result, acceptor);
-  gpr_free(acceptor);
-
-  gpr_mu_lock(g_mu);
-  g_result = temp_result;
-  g_nconnects++;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-static void test_no_op(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_tcp_server *s;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_op_with_start(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_tcp_server *s;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
-  LOG_TEST("test_no_op_with_start");
-  grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL);
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_op_with_port(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  grpc_tcp_server *s;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
-  LOG_TEST("test_no_op_with_port");
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-  int port;
-  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr, &port) ==
-                 GRPC_ERROR_NONE &&
-             port > 0);
-
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_op_with_port_and_start(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  grpc_tcp_server *s;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
-  LOG_TEST("test_no_op_with_port_and_start");
-  int port;
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr, &port) ==
-                 GRPC_ERROR_NONE &&
-             port > 0);
-
-  grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL);
-
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void connect_cb(uv_connect_t *req, int status) {
-  GPR_ASSERT(status == 0);
-  gpr_free(req);
-}
-
-static void close_cb(uv_handle_t *handle) { gpr_free(handle); }
-
-static void tcp_connect(grpc_exec_ctx *exec_ctx, const struct sockaddr *remote,
-                        socklen_t remote_len, on_connect_result *result) {
-  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10);
-  uv_tcp_t *client_handle = gpr_malloc(sizeof(uv_tcp_t));
-  uv_connect_t *req = gpr_malloc(sizeof(uv_connect_t));
-  int nconnects_before;
-
-  gpr_mu_lock(g_mu);
-  nconnects_before = g_nconnects;
-  on_connect_result_init(&g_result);
-  GPR_ASSERT(uv_tcp_init(uv_default_loop(), client_handle) == 0);
-  gpr_log(GPR_DEBUG, "start connect");
-  GPR_ASSERT(uv_tcp_connect(req, client_handle, remote, connect_cb) == 0);
-  gpr_log(GPR_DEBUG, "wait");
-  while (g_nconnects == nconnects_before &&
-         gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) > 0) {
-    grpc_pollset_worker *worker = NULL;
-    GPR_ASSERT(GRPC_LOG_IF_ERROR(
-        "pollset_work",
-        grpc_pollset_work(exec_ctx, g_pollset, &worker,
-                          grpc_timespec_to_millis_round_up(deadline))));
-    gpr_mu_unlock(g_mu);
-    grpc_exec_ctx_finish(exec_ctx);
-    gpr_mu_lock(g_mu);
-  }
-  gpr_log(GPR_DEBUG, "wait done");
-  GPR_ASSERT(g_nconnects == nconnects_before + 1);
-  uv_close((uv_handle_t *)client_handle, close_cb);
-  *result = g_result;
-
-  gpr_mu_unlock(g_mu);
-}
-
-/* Tests a tcp server with multiple ports. */
-static void test_connect(unsigned n) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  grpc_resolved_address resolved_addr1;
-  struct sockaddr_storage *addr = (struct sockaddr_storage *)resolved_addr.addr;
-  struct sockaddr_storage *addr1 =
-      (struct sockaddr_storage *)resolved_addr1.addr;
-  int svr_port;
-  int svr1_port;
-  grpc_tcp_server *s;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
-  unsigned i;
-  server_weak_ref weak_ref;
-  server_weak_ref_init(&weak_ref);
-  LOG_TEST("test_connect");
-  gpr_log(GPR_INFO, "clients=%d", n);
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  memset(&resolved_addr1, 0, sizeof(resolved_addr1));
-  resolved_addr.len = sizeof(struct sockaddr_storage);
-  resolved_addr1.len = sizeof(struct sockaddr_storage);
-  addr->ss_family = addr1->ss_family = AF_INET;
-  GPR_ASSERT(GRPC_ERROR_NONE ==
-             grpc_tcp_server_add_port(s, &resolved_addr, &svr_port));
-  GPR_ASSERT(svr_port > 0);
-  GPR_ASSERT((uv_ip6_addr("::", svr_port, (struct sockaddr_in6 *)addr)) == 0);
-  /* Cannot use wildcard (port==0), because add_port() will try to reuse the
-     same port as a previous add_port(). */
-  svr1_port = grpc_pick_unused_port_or_die();
-  grpc_sockaddr_set_port(&resolved_addr1, svr1_port);
-  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr1, &svr_port) ==
-                 GRPC_ERROR_NONE &&
-             svr_port == svr1_port);
-
-  grpc_tcp_server_start(&exec_ctx, s, &g_pollset, 1, on_connect, NULL);
-
-  GPR_ASSERT(uv_ip6_addr("::", svr_port, (struct sockaddr_in6 *)addr1) == 0);
-
-  for (i = 0; i < n; i++) {
-    on_connect_result result;
-    on_connect_result_init(&result);
-    tcp_connect(&exec_ctx, (struct sockaddr *)addr,
-                (socklen_t)resolved_addr.len, &result);
-    GPR_ASSERT(result.port_index == 0);
-    GPR_ASSERT(result.server == s);
-    if (weak_ref.server == NULL) {
-      server_weak_ref_set(&weak_ref, result.server);
-    }
-    grpc_tcp_server_unref(&exec_ctx, result.server);
-
-    on_connect_result_init(&result);
-    tcp_connect(&exec_ctx, (struct sockaddr *)addr1,
-                (socklen_t)resolved_addr1.len, &result);
-    GPR_ASSERT(result.port_index == 1);
-    GPR_ASSERT(result.server == s);
-    grpc_tcp_server_unref(&exec_ctx, result.server);
-  }
-
-  /* Weak ref to server valid until final unref. */
-  GPR_ASSERT(weak_ref.server != NULL);
-
-  grpc_tcp_server_unref(&exec_ctx, s);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  /* Weak ref lost. */
-  GPR_ASSERT(weak_ref.server == NULL);
-}
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, p);
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_test_init(argc, argv);
-  grpc_init();
-  g_pollset = gpr_malloc(grpc_pollset_size());
-  grpc_pollset_init(g_pollset, &g_mu);
-
-  test_no_op();
-  test_no_op_with_start();
-  test_no_op_with_port();
-  test_no_op_with_port_and_start();
-  test_connect(1);
-  test_connect(10);
-
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  gpr_free(g_pollset);
-  return 0;
-}
-
-#else /* GRPC_UV */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_UV */
diff --git a/test/core/iomgr/tcp_server_uv_test.cc b/test/core/iomgr/tcp_server_uv_test.cc
new file mode 100644
index 0000000..dd047a0
--- /dev/null
+++ b/test/core/iomgr/tcp_server_uv_test.cc
@@ -0,0 +1,327 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with libuv
+#ifdef GRPC_UV
+
+#include <uv.h>
+
+#include "src/core/lib/iomgr/tcp_server.h"
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x)
+
+static gpr_mu* g_mu;
+static grpc_pollset* g_pollset;
+static int g_nconnects = 0;
+
+typedef struct on_connect_result {
+  /* Owns a ref to server. */
+  grpc_tcp_server* server;
+  unsigned port_index;
+  unsigned fd_index;
+} on_connect_result;
+
+typedef struct server_weak_ref {
+  grpc_tcp_server* server;
+
+  /* arg is this server_weak_ref. */
+  grpc_closure server_shutdown;
+} server_weak_ref;
+
+static on_connect_result g_result = {NULL, 0, 0};
+
+static void on_connect_result_init(on_connect_result* result) {
+  result->server = NULL;
+  result->port_index = 0;
+  result->fd_index = 0;
+}
+
+static void on_connect_result_set(on_connect_result* result,
+                                  const grpc_tcp_server_acceptor* acceptor) {
+  result->server = grpc_tcp_server_ref(acceptor->from_server);
+  result->port_index = acceptor->port_index;
+  result->fd_index = acceptor->fd_index;
+}
+
+static void server_weak_ref_shutdown(grpc_exec_ctx* exec_ctx, void* arg,
+                                     grpc_error* error) {
+  server_weak_ref* weak_ref = static_cast<server_weak_ref*>(arg);
+  weak_ref->server = NULL;
+}
+
+static void server_weak_ref_init(server_weak_ref* weak_ref) {
+  weak_ref->server = NULL;
+  GRPC_CLOSURE_INIT(&weak_ref->server_shutdown, server_weak_ref_shutdown,
+                    weak_ref, grpc_schedule_on_exec_ctx);
+}
+
+/* Make weak_ref->server_shutdown a shutdown_starting cb on server.
+   grpc_tcp_server promises that the server object will live until
+   weak_ref->server_shutdown has returned. A strong ref on grpc_tcp_server
+   should be held until server_weak_ref_set() returns to avoid a race where the
+   server is deleted before the shutdown_starting cb is added. */
+static void server_weak_ref_set(server_weak_ref* weak_ref,
+                                grpc_tcp_server* server) {
+  grpc_tcp_server_shutdown_starting_add(server, &weak_ref->server_shutdown);
+  weak_ref->server = server;
+}
+
+static void on_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* tcp,
+                       grpc_pollset* pollset,
+                       grpc_tcp_server_acceptor* acceptor) {
+  grpc_endpoint_shutdown(exec_ctx, tcp,
+                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected"));
+  grpc_endpoint_destroy(exec_ctx, tcp);
+
+  on_connect_result temp_result;
+  on_connect_result_set(&temp_result, acceptor);
+  gpr_free(acceptor);
+
+  gpr_mu_lock(g_mu);
+  g_result = temp_result;
+  g_nconnects++;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+static void test_no_op(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_tcp_server* s;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_op_with_start(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_tcp_server* s;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
+  LOG_TEST("test_no_op_with_start");
+  grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL);
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_op_with_port(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  grpc_tcp_server* s;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
+  LOG_TEST("test_no_op_with_port");
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+  int port;
+  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr, &port) ==
+                 GRPC_ERROR_NONE &&
+             port > 0);
+
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_op_with_port_and_start(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  grpc_tcp_server* s;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
+  LOG_TEST("test_no_op_with_port_and_start");
+  int port;
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr, &port) ==
+                 GRPC_ERROR_NONE &&
+             port > 0);
+
+  grpc_tcp_server_start(&exec_ctx, s, NULL, 0, on_connect, NULL);
+
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void connect_cb(uv_connect_t* req, int status) {
+  GPR_ASSERT(status == 0);
+  gpr_free(req);
+}
+
+static void close_cb(uv_handle_t* handle) { gpr_free(handle); }
+
+static void tcp_connect(grpc_exec_ctx* exec_ctx, const struct sockaddr* remote,
+                        socklen_t remote_len, on_connect_result* result) {
+  gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10);
+  uv_tcp_t* client_handle =
+      static_cast<uv_tcp_t*>(gpr_malloc(sizeof(uv_tcp_t)));
+  uv_connect_t* req =
+      static_cast<uv_connect_t*>(gpr_malloc(sizeof(uv_connect_t)));
+  int nconnects_before;
+
+  gpr_mu_lock(g_mu);
+  nconnects_before = g_nconnects;
+  on_connect_result_init(&g_result);
+  GPR_ASSERT(uv_tcp_init(uv_default_loop(), client_handle) == 0);
+  gpr_log(GPR_DEBUG, "start connect");
+  GPR_ASSERT(uv_tcp_connect(req, client_handle, remote, connect_cb) == 0);
+  gpr_log(GPR_DEBUG, "wait");
+  while (g_nconnects == nconnects_before &&
+         gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) > 0) {
+    grpc_pollset_worker* worker = NULL;
+    GPR_ASSERT(GRPC_LOG_IF_ERROR(
+        "pollset_work",
+        grpc_pollset_work(exec_ctx, g_pollset, &worker,
+                          grpc_timespec_to_millis_round_up(deadline))));
+    gpr_mu_unlock(g_mu);
+    grpc_exec_ctx_finish(exec_ctx);
+    gpr_mu_lock(g_mu);
+  }
+  gpr_log(GPR_DEBUG, "wait done");
+  GPR_ASSERT(g_nconnects == nconnects_before + 1);
+  uv_close((uv_handle_t*)client_handle, close_cb);
+  *result = g_result;
+
+  gpr_mu_unlock(g_mu);
+}
+
+/* Tests a tcp server with multiple ports. */
+static void test_connect(unsigned n) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  grpc_resolved_address resolved_addr1;
+  struct sockaddr_storage* addr = (struct sockaddr_storage*)resolved_addr.addr;
+  struct sockaddr_storage* addr1 =
+      (struct sockaddr_storage*)resolved_addr1.addr;
+  int svr_port;
+  int svr1_port;
+  grpc_tcp_server* s;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s));
+  unsigned i;
+  server_weak_ref weak_ref;
+  server_weak_ref_init(&weak_ref);
+  LOG_TEST("test_connect");
+  gpr_log(GPR_INFO, "clients=%d", n);
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  memset(&resolved_addr1, 0, sizeof(resolved_addr1));
+  resolved_addr.len = sizeof(struct sockaddr_storage);
+  resolved_addr1.len = sizeof(struct sockaddr_storage);
+  addr->ss_family = addr1->ss_family = AF_INET;
+  GPR_ASSERT(GRPC_ERROR_NONE ==
+             grpc_tcp_server_add_port(s, &resolved_addr, &svr_port));
+  GPR_ASSERT(svr_port > 0);
+  GPR_ASSERT((uv_ip6_addr("::", svr_port, (struct sockaddr_in6*)addr)) == 0);
+  /* Cannot use wildcard (port==0), because add_port() will try to reuse the
+     same port as a previous add_port(). */
+  svr1_port = grpc_pick_unused_port_or_die();
+  grpc_sockaddr_set_port(&resolved_addr1, svr1_port);
+  GPR_ASSERT(grpc_tcp_server_add_port(s, &resolved_addr1, &svr_port) ==
+                 GRPC_ERROR_NONE &&
+             svr_port == svr1_port);
+
+  grpc_tcp_server_start(&exec_ctx, s, &g_pollset, 1, on_connect, NULL);
+
+  GPR_ASSERT(uv_ip6_addr("::", svr_port, (struct sockaddr_in6*)addr1) == 0);
+
+  for (i = 0; i < n; i++) {
+    on_connect_result result;
+    on_connect_result_init(&result);
+    tcp_connect(&exec_ctx, (struct sockaddr*)addr, (socklen_t)resolved_addr.len,
+                &result);
+    GPR_ASSERT(result.port_index == 0);
+    GPR_ASSERT(result.server == s);
+    if (weak_ref.server == NULL) {
+      server_weak_ref_set(&weak_ref, result.server);
+    }
+    grpc_tcp_server_unref(&exec_ctx, result.server);
+
+    on_connect_result_init(&result);
+    tcp_connect(&exec_ctx, (struct sockaddr*)addr1,
+                (socklen_t)resolved_addr1.len, &result);
+    GPR_ASSERT(result.port_index == 1);
+    GPR_ASSERT(result.server == s);
+    grpc_tcp_server_unref(&exec_ctx, result.server);
+  }
+
+  /* Weak ref to server valid until final unref. */
+  GPR_ASSERT(weak_ref.server != NULL);
+
+  grpc_tcp_server_unref(&exec_ctx, s);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  /* Weak ref lost. */
+  GPR_ASSERT(weak_ref.server == NULL);
+}
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(p));
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_test_init(argc, argv);
+  grpc_init();
+  g_pollset = static_cast<grpc_pollset*>(gpr_malloc(grpc_pollset_size()));
+  grpc_pollset_init(g_pollset, &g_mu);
+
+  test_no_op();
+  test_no_op_with_start();
+  test_no_op_with_port();
+  test_no_op_with_port_and_start();
+  test_connect(1);
+  test_connect(10);
+
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  gpr_free(g_pollset);
+  return 0;
+}
+
+#else /* GRPC_UV */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_UV */
diff --git a/test/core/iomgr/time_averaged_stats_test.c b/test/core/iomgr/time_averaged_stats_test.c
deleted file mode 100644
index 508e3c5..0000000
--- a/test/core/iomgr/time_averaged_stats_test.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/time_averaged_stats.h"
-
-#include <math.h>
-
-#include <grpc/support/log.h>
-#include "test/core/util/test_config.h"
-
-#define EXPECT_EQ(a, b) GPR_ASSERT((a) == (b))
-#define EXPECT_DOUBLE_EQ(a, b) GPR_ASSERT(fabs((a) - (b)) < 1e-9)
-
-static void no_regress_no_persist_test_1(void) {
-  grpc_time_averaged_stats tas;
-  grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0);
-  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(0, tas.aggregate_total_weight);
-
-  /* Should have no effect */
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(0, tas.aggregate_total_weight);
-
-  /* Should replace old average */
-  grpc_time_averaged_stats_add_sample(&tas, 2000);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(2000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
-}
-
-static void no_regress_no_persist_test_2(void) {
-  grpc_time_averaged_stats tas;
-  grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0);
-  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
-  /* Should replace init value */
-  grpc_time_averaged_stats_add_sample(&tas, 2000);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(2000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
-
-  grpc_time_averaged_stats_add_sample(&tas, 3000);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(3000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
-}
-
-static void no_regress_no_persist_test_3(void) {
-  grpc_time_averaged_stats tas;
-  grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0);
-  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
-  /* Should replace init value */
-  grpc_time_averaged_stats_add_sample(&tas, 2500);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(2500, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
-
-  grpc_time_averaged_stats_add_sample(&tas, 3500);
-  grpc_time_averaged_stats_add_sample(&tas, 4500);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(4000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
-}
-
-static void some_regress_no_persist_test(void) {
-  grpc_time_averaged_stats tas;
-  grpc_time_averaged_stats_init(&tas, 1000, 0.5, 0.0);
-  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(0, tas.aggregate_total_weight);
-  grpc_time_averaged_stats_add_sample(&tas, 2000);
-  grpc_time_averaged_stats_add_sample(&tas, 2000);
-  grpc_time_averaged_stats_update_average(&tas);
-  /* (2 * 2000 + 0.5 * 1000) / 2.5 */
-  EXPECT_DOUBLE_EQ(1800, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight);
-}
-
-static void some_decay_test(void) {
-  grpc_time_averaged_stats tas;
-  grpc_time_averaged_stats_init(&tas, 1000, 1, 0.0);
-  EXPECT_EQ(1000, tas.aggregate_weighted_avg);
-  /* Should avg with init value */
-  grpc_time_averaged_stats_add_sample(&tas, 2000);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(1500, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
-
-  grpc_time_averaged_stats_add_sample(&tas, 2000);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(1500, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
-
-  grpc_time_averaged_stats_add_sample(&tas, 2000);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(1500, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
-}
-
-static void no_regress_full_persist_test(void) {
-  grpc_time_averaged_stats tas;
-  grpc_time_averaged_stats_init(&tas, 1000, 0, 1.0);
-  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(0, tas.aggregate_total_weight);
-
-  /* Should replace init value */
-  grpc_time_averaged_stats_add_sample(&tas, 2000);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_EQ(2000, tas.aggregate_weighted_avg);
-  EXPECT_EQ(1, tas.aggregate_total_weight);
-
-  /* Will result in average of the 3 samples. */
-  grpc_time_averaged_stats_add_sample(&tas, 2300);
-  grpc_time_averaged_stats_add_sample(&tas, 2300);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(2200, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(3, tas.aggregate_total_weight);
-}
-
-static void no_regress_some_persist_test(void) {
-  grpc_time_averaged_stats tas;
-  grpc_time_averaged_stats_init(&tas, 1000, 0, 0.5);
-  /* Should replace init value */
-  grpc_time_averaged_stats_add_sample(&tas, 2000);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(2000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
-
-  grpc_time_averaged_stats_add_sample(&tas, 2500);
-  grpc_time_averaged_stats_add_sample(&tas, 4000);
-  grpc_time_averaged_stats_update_average(&tas);
-  EXPECT_DOUBLE_EQ(3000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight);
-}
-
-static void some_regress_some_persist_test(void) {
-  grpc_time_averaged_stats tas;
-  grpc_time_averaged_stats_init(&tas, 1000, 0.4, 0.6);
-  /* Sample weight = 0 */
-  EXPECT_EQ(1000, tas.aggregate_weighted_avg);
-  EXPECT_EQ(0, tas.aggregate_total_weight);
-
-  grpc_time_averaged_stats_update_average(&tas);
-  /* (0.6 * 0 * 1000 + 0.4 * 1000 / 0.4) */
-  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(0.4, tas.aggregate_total_weight);
-
-  grpc_time_averaged_stats_add_sample(&tas, 2640);
-  grpc_time_averaged_stats_update_average(&tas);
-  /* (1 * 2640 + 0.6 * 0.4 * 1000 + 0.4 * 1000 / (1 + 0.6 * 0.4 + 0.4) */
-  EXPECT_DOUBLE_EQ(2000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(1.64, tas.aggregate_total_weight);
-
-  grpc_time_averaged_stats_add_sample(&tas, 2876.8);
-  grpc_time_averaged_stats_update_average(&tas);
-  /* (1 * 2876.8 + 0.6 * 1.64 * 2000 + 0.4 * 1000 / (1 + 0.6 * 1.64 + 0.4) */
-  EXPECT_DOUBLE_EQ(2200, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(2.384, tas.aggregate_total_weight);
-
-  grpc_time_averaged_stats_add_sample(&tas, 4944.32);
-  grpc_time_averaged_stats_update_average(&tas);
-  /* (1 * 4944.32 + 0.6 * 2.384 * 2200 + 0.4 * 1000) /
-     (1 + 0.6 * 2.384 + 0.4) */
-  EXPECT_DOUBLE_EQ(3000, tas.aggregate_weighted_avg);
-  EXPECT_DOUBLE_EQ(2.8304, tas.aggregate_total_weight);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  no_regress_no_persist_test_1();
-  no_regress_no_persist_test_2();
-  no_regress_no_persist_test_3();
-  some_regress_no_persist_test();
-  some_decay_test();
-  no_regress_full_persist_test();
-  no_regress_some_persist_test();
-  some_regress_some_persist_test();
-  return 0;
-}
diff --git a/test/core/iomgr/time_averaged_stats_test.cc b/test/core/iomgr/time_averaged_stats_test.cc
new file mode 100644
index 0000000..b932e62
--- /dev/null
+++ b/test/core/iomgr/time_averaged_stats_test.cc
@@ -0,0 +1,193 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/time_averaged_stats.h"
+
+#include <math.h>
+
+#include <grpc/support/log.h>
+#include "test/core/util/test_config.h"
+
+#define EXPECT_EQ(a, b) GPR_ASSERT((a) == (b))
+#define EXPECT_DOUBLE_EQ(a, b) GPR_ASSERT(fabs((a) - (b)) < 1e-9)
+
+static void no_regress_no_persist_test_1(void) {
+  grpc_time_averaged_stats tas;
+  grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0);
+  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(0, tas.aggregate_total_weight);
+
+  /* Should have no effect */
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(0, tas.aggregate_total_weight);
+
+  /* Should replace old average */
+  grpc_time_averaged_stats_add_sample(&tas, 2000);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(2000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
+}
+
+static void no_regress_no_persist_test_2(void) {
+  grpc_time_averaged_stats tas;
+  grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0);
+  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
+  /* Should replace init value */
+  grpc_time_averaged_stats_add_sample(&tas, 2000);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(2000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
+
+  grpc_time_averaged_stats_add_sample(&tas, 3000);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(3000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
+}
+
+static void no_regress_no_persist_test_3(void) {
+  grpc_time_averaged_stats tas;
+  grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0);
+  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
+  /* Should replace init value */
+  grpc_time_averaged_stats_add_sample(&tas, 2500);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(2500, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
+
+  grpc_time_averaged_stats_add_sample(&tas, 3500);
+  grpc_time_averaged_stats_add_sample(&tas, 4500);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(4000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
+}
+
+static void some_regress_no_persist_test(void) {
+  grpc_time_averaged_stats tas;
+  grpc_time_averaged_stats_init(&tas, 1000, 0.5, 0.0);
+  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(0, tas.aggregate_total_weight);
+  grpc_time_averaged_stats_add_sample(&tas, 2000);
+  grpc_time_averaged_stats_add_sample(&tas, 2000);
+  grpc_time_averaged_stats_update_average(&tas);
+  /* (2 * 2000 + 0.5 * 1000) / 2.5 */
+  EXPECT_DOUBLE_EQ(1800, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight);
+}
+
+static void some_decay_test(void) {
+  grpc_time_averaged_stats tas;
+  grpc_time_averaged_stats_init(&tas, 1000, 1, 0.0);
+  EXPECT_EQ(1000, tas.aggregate_weighted_avg);
+  /* Should avg with init value */
+  grpc_time_averaged_stats_add_sample(&tas, 2000);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(1500, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
+
+  grpc_time_averaged_stats_add_sample(&tas, 2000);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(1500, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
+
+  grpc_time_averaged_stats_add_sample(&tas, 2000);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(1500, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
+}
+
+static void no_regress_full_persist_test(void) {
+  grpc_time_averaged_stats tas;
+  grpc_time_averaged_stats_init(&tas, 1000, 0, 1.0);
+  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(0, tas.aggregate_total_weight);
+
+  /* Should replace init value */
+  grpc_time_averaged_stats_add_sample(&tas, 2000);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_EQ(2000, tas.aggregate_weighted_avg);
+  EXPECT_EQ(1, tas.aggregate_total_weight);
+
+  /* Will result in average of the 3 samples. */
+  grpc_time_averaged_stats_add_sample(&tas, 2300);
+  grpc_time_averaged_stats_add_sample(&tas, 2300);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(2200, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(3, tas.aggregate_total_weight);
+}
+
+static void no_regress_some_persist_test(void) {
+  grpc_time_averaged_stats tas;
+  grpc_time_averaged_stats_init(&tas, 1000, 0, 0.5);
+  /* Should replace init value */
+  grpc_time_averaged_stats_add_sample(&tas, 2000);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(2000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
+
+  grpc_time_averaged_stats_add_sample(&tas, 2500);
+  grpc_time_averaged_stats_add_sample(&tas, 4000);
+  grpc_time_averaged_stats_update_average(&tas);
+  EXPECT_DOUBLE_EQ(3000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight);
+}
+
+static void some_regress_some_persist_test(void) {
+  grpc_time_averaged_stats tas;
+  grpc_time_averaged_stats_init(&tas, 1000, 0.4, 0.6);
+  /* Sample weight = 0 */
+  EXPECT_EQ(1000, tas.aggregate_weighted_avg);
+  EXPECT_EQ(0, tas.aggregate_total_weight);
+
+  grpc_time_averaged_stats_update_average(&tas);
+  /* (0.6 * 0 * 1000 + 0.4 * 1000 / 0.4) */
+  EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(0.4, tas.aggregate_total_weight);
+
+  grpc_time_averaged_stats_add_sample(&tas, 2640);
+  grpc_time_averaged_stats_update_average(&tas);
+  /* (1 * 2640 + 0.6 * 0.4 * 1000 + 0.4 * 1000 / (1 + 0.6 * 0.4 + 0.4) */
+  EXPECT_DOUBLE_EQ(2000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(1.64, tas.aggregate_total_weight);
+
+  grpc_time_averaged_stats_add_sample(&tas, 2876.8);
+  grpc_time_averaged_stats_update_average(&tas);
+  /* (1 * 2876.8 + 0.6 * 1.64 * 2000 + 0.4 * 1000 / (1 + 0.6 * 1.64 + 0.4) */
+  EXPECT_DOUBLE_EQ(2200, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(2.384, tas.aggregate_total_weight);
+
+  grpc_time_averaged_stats_add_sample(&tas, 4944.32);
+  grpc_time_averaged_stats_update_average(&tas);
+  /* (1 * 4944.32 + 0.6 * 2.384 * 2200 + 0.4 * 1000) /
+     (1 + 0.6 * 2.384 + 0.4) */
+  EXPECT_DOUBLE_EQ(3000, tas.aggregate_weighted_avg);
+  EXPECT_DOUBLE_EQ(2.8304, tas.aggregate_total_weight);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  no_regress_no_persist_test_1();
+  no_regress_no_persist_test_2();
+  no_regress_no_persist_test_3();
+  some_regress_no_persist_test();
+  some_decay_test();
+  no_regress_full_persist_test();
+  no_regress_some_persist_test();
+  some_regress_some_persist_test();
+  return 0;
+}
diff --git a/test/core/iomgr/timer_heap_test.c b/test/core/iomgr/timer_heap_test.c
deleted file mode 100644
index ee5a474..0000000
--- a/test/core/iomgr/timer_heap_test.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test only works with the generic timer implementation
-#ifdef GRPC_TIMER_USE_GENERIC
-
-#include "src/core/lib/iomgr/timer_heap.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "test/core/util/test_config.h"
-
-static gpr_atm random_deadline(void) { return rand(); }
-
-static grpc_timer *create_test_elements(size_t num_elements) {
-  grpc_timer *elems = gpr_malloc(num_elements * sizeof(grpc_timer));
-  size_t i;
-  for (i = 0; i < num_elements; i++) {
-    elems[i].deadline = random_deadline();
-  }
-  return elems;
-}
-
-static int contains(grpc_timer_heap *pq, grpc_timer *el) {
-  size_t i;
-  for (i = 0; i < pq->timer_count; i++) {
-    if (pq->timers[i] == el) return 1;
-  }
-  return 0;
-}
-
-static void check_valid(grpc_timer_heap *pq) {
-  size_t i;
-  for (i = 0; i < pq->timer_count; ++i) {
-    size_t left_child = 1u + 2u * i;
-    size_t right_child = left_child + 1u;
-    if (left_child < pq->timer_count) {
-      GPR_ASSERT(pq->timers[i]->deadline <= pq->timers[left_child]->deadline);
-    }
-    if (right_child < pq->timer_count) {
-      GPR_ASSERT(pq->timers[i]->deadline <= pq->timers[right_child]->deadline);
-    }
-  }
-}
-
-/*******************************************************************************
- * test1
- */
-
-static void test1(void) {
-  grpc_timer_heap pq;
-  const size_t num_test_elements = 200;
-  const size_t num_test_operations = 10000;
-  size_t i;
-  grpc_timer *test_elements = create_test_elements(num_test_elements);
-  uint8_t *inpq = gpr_malloc(num_test_elements);
-
-  gpr_log(GPR_INFO, "test1");
-
-  grpc_timer_heap_init(&pq);
-  memset(inpq, 0, num_test_elements);
-  GPR_ASSERT(grpc_timer_heap_is_empty(&pq));
-  check_valid(&pq);
-  for (i = 0; i < num_test_elements; ++i) {
-    GPR_ASSERT(!contains(&pq, &test_elements[i]));
-    grpc_timer_heap_add(&pq, &test_elements[i]);
-    check_valid(&pq);
-    GPR_ASSERT(contains(&pq, &test_elements[i]));
-    inpq[i] = 1;
-  }
-  for (i = 0; i < num_test_elements; ++i) {
-    /* Test that check still succeeds even for element that wasn't just
-       inserted. */
-    GPR_ASSERT(contains(&pq, &test_elements[i]));
-  }
-
-  GPR_ASSERT(pq.timer_count == num_test_elements);
-
-  check_valid(&pq);
-
-  for (i = 0; i < num_test_operations; ++i) {
-    size_t elem_num = (size_t)rand() % num_test_elements;
-    grpc_timer *el = &test_elements[elem_num];
-    if (!inpq[elem_num]) { /* not in pq */
-      GPR_ASSERT(!contains(&pq, el));
-      el->deadline = random_deadline();
-      grpc_timer_heap_add(&pq, el);
-      GPR_ASSERT(contains(&pq, el));
-      inpq[elem_num] = 1;
-      check_valid(&pq);
-    } else {
-      GPR_ASSERT(contains(&pq, el));
-      grpc_timer_heap_remove(&pq, el);
-      GPR_ASSERT(!contains(&pq, el));
-      inpq[elem_num] = 0;
-      check_valid(&pq);
-    }
-  }
-
-  grpc_timer_heap_destroy(&pq);
-  gpr_free(test_elements);
-  gpr_free(inpq);
-}
-
-/*******************************************************************************
- * test2
- */
-
-typedef struct {
-  grpc_timer elem;
-  bool inserted;
-} elem_struct;
-
-static elem_struct *search_elems(elem_struct *elems, size_t count,
-                                 bool inserted) {
-  size_t *search_order = gpr_malloc(count * sizeof(*search_order));
-  for (size_t i = 0; i < count; i++) {
-    search_order[i] = i;
-  }
-  for (size_t i = 0; i < count * 2; i++) {
-    size_t a = (size_t)rand() % count;
-    size_t b = (size_t)rand() % count;
-    GPR_SWAP(size_t, search_order[a], search_order[b]);
-  }
-  elem_struct *out = NULL;
-  for (size_t i = 0; out == NULL && i < count; i++) {
-    if (elems[search_order[i]].inserted == inserted) {
-      out = &elems[search_order[i]];
-    }
-  }
-  gpr_free(search_order);
-  return out;
-}
-
-static void test2(void) {
-  gpr_log(GPR_INFO, "test2");
-
-  grpc_timer_heap pq;
-
-  static const size_t elems_size = 1000;
-  elem_struct *elems = gpr_malloc(elems_size * sizeof(elem_struct));
-  size_t num_inserted = 0;
-
-  grpc_timer_heap_init(&pq);
-  memset(elems, 0, elems_size);
-
-  for (size_t round = 0; round < 10000; round++) {
-    int r = rand() % 1000;
-    if (r <= 550) {
-      /* 55% of the time we try to add something */
-      elem_struct *el = search_elems(elems, GPR_ARRAY_SIZE(elems), false);
-      if (el != NULL) {
-        el->elem.deadline = random_deadline();
-        grpc_timer_heap_add(&pq, &el->elem);
-        el->inserted = true;
-        num_inserted++;
-        check_valid(&pq);
-      }
-    } else if (r <= 650) {
-      /* 10% of the time we try to remove something */
-      elem_struct *el = search_elems(elems, GPR_ARRAY_SIZE(elems), true);
-      if (el != NULL) {
-        grpc_timer_heap_remove(&pq, &el->elem);
-        el->inserted = false;
-        num_inserted--;
-        check_valid(&pq);
-      }
-    } else {
-      /* the remaining times we pop */
-      if (num_inserted > 0) {
-        grpc_timer *top = grpc_timer_heap_top(&pq);
-        grpc_timer_heap_pop(&pq);
-        for (size_t i = 0; i < elems_size; i++) {
-          if (top == &elems[i].elem) {
-            GPR_ASSERT(elems[i].inserted);
-            elems[i].inserted = false;
-          }
-        }
-        num_inserted--;
-        check_valid(&pq);
-      }
-    }
-
-    if (num_inserted) {
-      gpr_atm *min_deadline = NULL;
-      for (size_t i = 0; i < elems_size; i++) {
-        if (elems[i].inserted) {
-          if (min_deadline == NULL) {
-            min_deadline = &elems[i].elem.deadline;
-          } else {
-            if (elems[i].elem.deadline < *min_deadline) {
-              min_deadline = &elems[i].elem.deadline;
-            }
-          }
-        }
-      }
-      GPR_ASSERT(grpc_timer_heap_top(&pq)->deadline == *min_deadline);
-    }
-  }
-
-  grpc_timer_heap_destroy(&pq);
-  gpr_free(elems);
-}
-
-static void shrink_test(void) {
-  gpr_log(GPR_INFO, "shrink_test");
-
-  grpc_timer_heap pq;
-  size_t i;
-  size_t expected_size;
-
-  /* A large random number to allow for multiple shrinkages, at least 512. */
-  const size_t num_elements = (size_t)rand() % 2000 + 512;
-
-  grpc_timer_heap_init(&pq);
-
-  /* Create a priority queue with many elements.  Make sure the Size() is
-     correct. */
-  for (i = 0; i < num_elements; ++i) {
-    GPR_ASSERT(i == pq.timer_count);
-    grpc_timer_heap_add(&pq, create_test_elements(1));
-  }
-  GPR_ASSERT(num_elements == pq.timer_count);
-
-  /* Remove elements until the Size is 1/4 the original size. */
-  while (pq.timer_count > num_elements / 4) {
-    grpc_timer *const te = pq.timers[pq.timer_count - 1];
-    grpc_timer_heap_remove(&pq, te);
-    gpr_free(te);
-  }
-  GPR_ASSERT(num_elements / 4 == pq.timer_count);
-
-  /* Expect that Capacity is in the right range:
-     Size * 2 <= Capacity <= Size * 4 */
-  GPR_ASSERT(pq.timer_count * 2 <= pq.timer_capacity);
-  GPR_ASSERT(pq.timer_capacity <= pq.timer_count * 4);
-  check_valid(&pq);
-
-  /* Remove the rest of the elements.  Check that the Capacity is not more than
-     4 times the Size and not less than 2 times, but never goes below 16. */
-  expected_size = pq.timer_count;
-  while (pq.timer_count > 0) {
-    const size_t which = (size_t)rand() % pq.timer_count;
-    grpc_timer *te = pq.timers[which];
-    grpc_timer_heap_remove(&pq, te);
-    gpr_free(te);
-    expected_size--;
-    GPR_ASSERT(expected_size == pq.timer_count);
-    GPR_ASSERT(pq.timer_count * 2 <= pq.timer_capacity);
-    if (pq.timer_count >= 8) {
-      GPR_ASSERT(pq.timer_capacity <= pq.timer_count * 4);
-    } else {
-      GPR_ASSERT(16 <= pq.timer_capacity);
-    }
-    check_valid(&pq);
-  }
-
-  GPR_ASSERT(0 == pq.timer_count);
-  GPR_ASSERT(pq.timer_capacity >= 16 && pq.timer_capacity < 32);
-
-  grpc_timer_heap_destroy(&pq);
-}
-
-int main(int argc, char **argv) {
-  int i;
-
-  grpc_test_init(argc, argv);
-
-  for (i = 0; i < 5; i++) {
-    test1();
-    test2();
-    shrink_test();
-  }
-
-  return 0;
-}
-
-#else /* GRPC_TIMER_USE_GENERIC */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_TIMER_USE_GENERIC */
diff --git a/test/core/iomgr/timer_heap_test.cc b/test/core/iomgr/timer_heap_test.cc
new file mode 100644
index 0000000..20a3833
--- /dev/null
+++ b/test/core/iomgr/timer_heap_test.cc
@@ -0,0 +1,307 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test only works with the generic timer implementation
+#ifdef GRPC_TIMER_USE_GENERIC
+
+#include "src/core/lib/iomgr/timer_heap.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/util/test_config.h"
+
+static gpr_atm random_deadline(void) { return rand(); }
+
+static grpc_timer* create_test_elements(size_t num_elements) {
+  grpc_timer* elems =
+      static_cast<grpc_timer*>(gpr_malloc(num_elements * sizeof(grpc_timer)));
+  size_t i;
+  for (i = 0; i < num_elements; i++) {
+    elems[i].deadline = random_deadline();
+  }
+  return elems;
+}
+
+static int contains(grpc_timer_heap* pq, grpc_timer* el) {
+  size_t i;
+  for (i = 0; i < pq->timer_count; i++) {
+    if (pq->timers[i] == el) return 1;
+  }
+  return 0;
+}
+
+static void check_valid(grpc_timer_heap* pq) {
+  size_t i;
+  for (i = 0; i < pq->timer_count; ++i) {
+    size_t left_child = 1u + 2u * i;
+    size_t right_child = left_child + 1u;
+    if (left_child < pq->timer_count) {
+      GPR_ASSERT(pq->timers[i]->deadline <= pq->timers[left_child]->deadline);
+    }
+    if (right_child < pq->timer_count) {
+      GPR_ASSERT(pq->timers[i]->deadline <= pq->timers[right_child]->deadline);
+    }
+  }
+}
+
+/*******************************************************************************
+ * test1
+ */
+
+static void test1(void) {
+  grpc_timer_heap pq;
+  const size_t num_test_elements = 200;
+  const size_t num_test_operations = 10000;
+  size_t i;
+  grpc_timer* test_elements = create_test_elements(num_test_elements);
+  uint8_t* inpq = static_cast<uint8_t*>(gpr_malloc(num_test_elements));
+
+  gpr_log(GPR_INFO, "test1");
+
+  grpc_timer_heap_init(&pq);
+  memset(inpq, 0, num_test_elements);
+  GPR_ASSERT(grpc_timer_heap_is_empty(&pq));
+  check_valid(&pq);
+  for (i = 0; i < num_test_elements; ++i) {
+    GPR_ASSERT(!contains(&pq, &test_elements[i]));
+    grpc_timer_heap_add(&pq, &test_elements[i]);
+    check_valid(&pq);
+    GPR_ASSERT(contains(&pq, &test_elements[i]));
+    inpq[i] = 1;
+  }
+  for (i = 0; i < num_test_elements; ++i) {
+    /* Test that check still succeeds even for element that wasn't just
+       inserted. */
+    GPR_ASSERT(contains(&pq, &test_elements[i]));
+  }
+
+  GPR_ASSERT(pq.timer_count == num_test_elements);
+
+  check_valid(&pq);
+
+  for (i = 0; i < num_test_operations; ++i) {
+    size_t elem_num = (size_t)rand() % num_test_elements;
+    grpc_timer* el = &test_elements[elem_num];
+    if (!inpq[elem_num]) { /* not in pq */
+      GPR_ASSERT(!contains(&pq, el));
+      el->deadline = random_deadline();
+      grpc_timer_heap_add(&pq, el);
+      GPR_ASSERT(contains(&pq, el));
+      inpq[elem_num] = 1;
+      check_valid(&pq);
+    } else {
+      GPR_ASSERT(contains(&pq, el));
+      grpc_timer_heap_remove(&pq, el);
+      GPR_ASSERT(!contains(&pq, el));
+      inpq[elem_num] = 0;
+      check_valid(&pq);
+    }
+  }
+
+  grpc_timer_heap_destroy(&pq);
+  gpr_free(test_elements);
+  gpr_free(inpq);
+}
+
+/*******************************************************************************
+ * test2
+ */
+
+typedef struct {
+  grpc_timer elem;
+  bool inserted;
+} elem_struct;
+
+static elem_struct* search_elems(elem_struct* elems, size_t count,
+                                 bool inserted) {
+  size_t* search_order =
+      static_cast<size_t*>(gpr_malloc(count * sizeof(*search_order)));
+  for (size_t i = 0; i < count; i++) {
+    search_order[i] = i;
+  }
+  for (size_t i = 0; i < count * 2; i++) {
+    size_t a = (size_t)rand() % count;
+    size_t b = (size_t)rand() % count;
+    GPR_SWAP(size_t, search_order[a], search_order[b]);
+  }
+  elem_struct* out = NULL;
+  for (size_t i = 0; out == NULL && i < count; i++) {
+    if (elems[search_order[i]].inserted == inserted) {
+      out = &elems[search_order[i]];
+    }
+  }
+  gpr_free(search_order);
+  return out;
+}
+
+static void test2(void) {
+  gpr_log(GPR_INFO, "test2");
+
+  grpc_timer_heap pq;
+
+  static const size_t elems_size = 1000;
+  elem_struct* elems =
+      static_cast<elem_struct*>(gpr_malloc(elems_size * sizeof(elem_struct)));
+  size_t num_inserted = 0;
+
+  grpc_timer_heap_init(&pq);
+  memset(elems, 0, elems_size);
+
+  for (size_t round = 0; round < 10000; round++) {
+    int r = rand() % 1000;
+    if (r <= 550) {
+      /* 55% of the time we try to add something */
+      elem_struct* el = search_elems(elems, GPR_ARRAY_SIZE(elems), false);
+      if (el != NULL) {
+        el->elem.deadline = random_deadline();
+        grpc_timer_heap_add(&pq, &el->elem);
+        el->inserted = true;
+        num_inserted++;
+        check_valid(&pq);
+      }
+    } else if (r <= 650) {
+      /* 10% of the time we try to remove something */
+      elem_struct* el = search_elems(elems, GPR_ARRAY_SIZE(elems), true);
+      if (el != NULL) {
+        grpc_timer_heap_remove(&pq, &el->elem);
+        el->inserted = false;
+        num_inserted--;
+        check_valid(&pq);
+      }
+    } else {
+      /* the remaining times we pop */
+      if (num_inserted > 0) {
+        grpc_timer* top = grpc_timer_heap_top(&pq);
+        grpc_timer_heap_pop(&pq);
+        for (size_t i = 0; i < elems_size; i++) {
+          if (top == &elems[i].elem) {
+            GPR_ASSERT(elems[i].inserted);
+            elems[i].inserted = false;
+          }
+        }
+        num_inserted--;
+        check_valid(&pq);
+      }
+    }
+
+    if (num_inserted) {
+      gpr_atm* min_deadline = NULL;
+      for (size_t i = 0; i < elems_size; i++) {
+        if (elems[i].inserted) {
+          if (min_deadline == NULL) {
+            min_deadline = &elems[i].elem.deadline;
+          } else {
+            if (elems[i].elem.deadline < *min_deadline) {
+              min_deadline = &elems[i].elem.deadline;
+            }
+          }
+        }
+      }
+      GPR_ASSERT(grpc_timer_heap_top(&pq)->deadline == *min_deadline);
+    }
+  }
+
+  grpc_timer_heap_destroy(&pq);
+  gpr_free(elems);
+}
+
+static void shrink_test(void) {
+  gpr_log(GPR_INFO, "shrink_test");
+
+  grpc_timer_heap pq;
+  size_t i;
+  size_t expected_size;
+
+  /* A large random number to allow for multiple shrinkages, at least 512. */
+  const size_t num_elements = (size_t)rand() % 2000 + 512;
+
+  grpc_timer_heap_init(&pq);
+
+  /* Create a priority queue with many elements.  Make sure the Size() is
+     correct. */
+  for (i = 0; i < num_elements; ++i) {
+    GPR_ASSERT(i == pq.timer_count);
+    grpc_timer_heap_add(&pq, create_test_elements(1));
+  }
+  GPR_ASSERT(num_elements == pq.timer_count);
+
+  /* Remove elements until the Size is 1/4 the original size. */
+  while (pq.timer_count > num_elements / 4) {
+    grpc_timer* const te = pq.timers[pq.timer_count - 1];
+    grpc_timer_heap_remove(&pq, te);
+    gpr_free(te);
+  }
+  GPR_ASSERT(num_elements / 4 == pq.timer_count);
+
+  /* Expect that Capacity is in the right range:
+     Size * 2 <= Capacity <= Size * 4 */
+  GPR_ASSERT(pq.timer_count * 2 <= pq.timer_capacity);
+  GPR_ASSERT(pq.timer_capacity <= pq.timer_count * 4);
+  check_valid(&pq);
+
+  /* Remove the rest of the elements.  Check that the Capacity is not more than
+     4 times the Size and not less than 2 times, but never goes below 16. */
+  expected_size = pq.timer_count;
+  while (pq.timer_count > 0) {
+    const size_t which = (size_t)rand() % pq.timer_count;
+    grpc_timer* te = pq.timers[which];
+    grpc_timer_heap_remove(&pq, te);
+    gpr_free(te);
+    expected_size--;
+    GPR_ASSERT(expected_size == pq.timer_count);
+    GPR_ASSERT(pq.timer_count * 2 <= pq.timer_capacity);
+    if (pq.timer_count >= 8) {
+      GPR_ASSERT(pq.timer_capacity <= pq.timer_count * 4);
+    } else {
+      GPR_ASSERT(16 <= pq.timer_capacity);
+    }
+    check_valid(&pq);
+  }
+
+  GPR_ASSERT(0 == pq.timer_count);
+  GPR_ASSERT(pq.timer_capacity >= 16 && pq.timer_capacity < 32);
+
+  grpc_timer_heap_destroy(&pq);
+}
+
+int main(int argc, char** argv) {
+  int i;
+
+  grpc_test_init(argc, argv);
+
+  for (i = 0; i < 5; i++) {
+    test1();
+    test2();
+    shrink_test();
+  }
+
+  return 0;
+}
+
+#else /* GRPC_TIMER_USE_GENERIC */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_TIMER_USE_GENERIC */
diff --git a/test/core/iomgr/timer_list_test.c b/test/core/iomgr/timer_list_test.c
deleted file mode 100644
index f63a388..0000000
--- a/test/core/iomgr/timer_list_test.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test only works with the generic timer implementation
-#ifdef GRPC_TIMER_USE_GENERIC
-
-#include "src/core/lib/iomgr/timer.h"
-
-#include <string.h>
-
-#include <grpc/support/log.h>
-#include "src/core/lib/debug/trace.h"
-#include "test/core/util/test_config.h"
-
-#define MAX_CB 30
-
-extern grpc_core::Tracer grpc_timer_trace;
-extern grpc_core::Tracer grpc_timer_check_trace;
-
-static int cb_called[MAX_CB][2];
-
-static void cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  cb_called[(intptr_t)arg][error == GRPC_ERROR_NONE]++;
-}
-
-static void add_test(void) {
-  int i;
-  grpc_timer timers[20];
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_INFO, "add_test");
-
-  grpc_timer_list_init(&exec_ctx);
-  grpc_timer_trace.value = 1;
-  grpc_timer_check_trace.value = 1;
-  memset(cb_called, 0, sizeof(cb_called));
-
-  grpc_millis start = grpc_exec_ctx_now(&exec_ctx);
-
-  /* 10 ms timers.  will expire in the current epoch */
-  for (i = 0; i < 10; i++) {
-    grpc_timer_init(&exec_ctx, &timers[i], start + 10,
-                    GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)i,
-                                        grpc_schedule_on_exec_ctx));
-  }
-
-  /* 1010 ms timers.  will expire in the next epoch */
-  for (i = 10; i < 20; i++) {
-    grpc_timer_init(&exec_ctx, &timers[i], start + 1010,
-                    GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)i,
-                                        grpc_schedule_on_exec_ctx));
-  }
-
-  /* collect timers.  Only the first batch should be ready. */
-  exec_ctx.now = start + 500;
-  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) == GRPC_TIMERS_FIRED);
-  grpc_exec_ctx_finish(&exec_ctx);
-  for (i = 0; i < 20; i++) {
-    GPR_ASSERT(cb_called[i][1] == (i < 10));
-    GPR_ASSERT(cb_called[i][0] == 0);
-  }
-
-  exec_ctx.now = start + 600;
-  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) ==
-             GRPC_TIMERS_CHECKED_AND_EMPTY);
-  grpc_exec_ctx_finish(&exec_ctx);
-  for (i = 0; i < 30; i++) {
-    GPR_ASSERT(cb_called[i][1] == (i < 10));
-    GPR_ASSERT(cb_called[i][0] == 0);
-  }
-
-  /* collect the rest of the timers */
-  exec_ctx.now = start + 1500;
-  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) == GRPC_TIMERS_FIRED);
-  grpc_exec_ctx_finish(&exec_ctx);
-  for (i = 0; i < 30; i++) {
-    GPR_ASSERT(cb_called[i][1] == (i < 20));
-    GPR_ASSERT(cb_called[i][0] == 0);
-  }
-
-  exec_ctx.now = start + 1600;
-  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) ==
-             GRPC_TIMERS_CHECKED_AND_EMPTY);
-  for (i = 0; i < 30; i++) {
-    GPR_ASSERT(cb_called[i][1] == (i < 20));
-    GPR_ASSERT(cb_called[i][0] == 0);
-  }
-
-  grpc_timer_list_shutdown(&exec_ctx);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-/* Cleaning up a list with pending timers. */
-void destruction_test(void) {
-  grpc_timer timers[5];
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_INFO, "destruction_test");
-
-  exec_ctx.now_is_valid = true;
-  exec_ctx.now = 0;
-  grpc_timer_list_init(&exec_ctx);
-  grpc_timer_trace.value = 1;
-  grpc_timer_check_trace.value = 1;
-  memset(cb_called, 0, sizeof(cb_called));
-
-  grpc_timer_init(
-      &exec_ctx, &timers[0], 100,
-      GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)0, grpc_schedule_on_exec_ctx));
-  grpc_timer_init(
-      &exec_ctx, &timers[1], 3,
-      GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)1, grpc_schedule_on_exec_ctx));
-  grpc_timer_init(
-      &exec_ctx, &timers[2], 100,
-      GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)2, grpc_schedule_on_exec_ctx));
-  grpc_timer_init(
-      &exec_ctx, &timers[3], 3,
-      GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)3, grpc_schedule_on_exec_ctx));
-  grpc_timer_init(
-      &exec_ctx, &timers[4], 1,
-      GRPC_CLOSURE_CREATE(cb, (void *)(intptr_t)4, grpc_schedule_on_exec_ctx));
-  exec_ctx.now = 2;
-  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) == GRPC_TIMERS_FIRED);
-  grpc_exec_ctx_finish(&exec_ctx);
-  GPR_ASSERT(1 == cb_called[4][1]);
-  grpc_timer_cancel(&exec_ctx, &timers[0]);
-  grpc_timer_cancel(&exec_ctx, &timers[3]);
-  grpc_exec_ctx_finish(&exec_ctx);
-  GPR_ASSERT(1 == cb_called[0][0]);
-  GPR_ASSERT(1 == cb_called[3][0]);
-
-  grpc_timer_list_shutdown(&exec_ctx);
-  grpc_exec_ctx_finish(&exec_ctx);
-  GPR_ASSERT(1 == cb_called[1][0]);
-  GPR_ASSERT(1 == cb_called[2][0]);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
-  add_test();
-  destruction_test();
-  return 0;
-}
-
-#else /* GRPC_TIMER_USE_GENERIC */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_TIMER_USE_GENERIC */
diff --git a/test/core/iomgr/timer_list_test.cc b/test/core/iomgr/timer_list_test.cc
new file mode 100644
index 0000000..4d92cc6
--- /dev/null
+++ b/test/core/iomgr/timer_list_test.cc
@@ -0,0 +1,167 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test only works with the generic timer implementation
+#ifdef GRPC_TIMER_USE_GENERIC
+
+#include "src/core/lib/iomgr/timer.h"
+
+#include <string.h>
+
+#include <grpc/support/log.h>
+#include "src/core/lib/debug/trace.h"
+#include "test/core/util/test_config.h"
+
+#define MAX_CB 30
+
+grpc_core::TraceFlag grpc_timer_trace;
+grpc_core::TraceFlag grpc_timer_check_trace;
+
+static int cb_called[MAX_CB][2];
+
+static void cb(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  cb_called[(intptr_t)arg][error == GRPC_ERROR_NONE]++;
+}
+
+static void add_test(void) {
+  int i;
+  grpc_timer timers[20];
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_INFO, "add_test");
+
+  grpc_timer_list_init(&exec_ctx);
+  grpc_timer_trace.value = 1;
+  grpc_timer_check_trace.value = 1;
+  memset(cb_called, 0, sizeof(cb_called));
+
+  grpc_millis start = grpc_exec_ctx_now(&exec_ctx);
+
+  /* 10 ms timers.  will expire in the current epoch */
+  for (i = 0; i < 10; i++) {
+    grpc_timer_init(
+        &exec_ctx, &timers[i], start + 10,
+        GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)i, grpc_schedule_on_exec_ctx));
+  }
+
+  /* 1010 ms timers.  will expire in the next epoch */
+  for (i = 10; i < 20; i++) {
+    grpc_timer_init(
+        &exec_ctx, &timers[i], start + 1010,
+        GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)i, grpc_schedule_on_exec_ctx));
+  }
+
+  /* collect timers.  Only the first batch should be ready. */
+  exec_ctx.now = start + 500;
+  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) == GRPC_TIMERS_FIRED);
+  grpc_exec_ctx_finish(&exec_ctx);
+  for (i = 0; i < 20; i++) {
+    GPR_ASSERT(cb_called[i][1] == (i < 10));
+    GPR_ASSERT(cb_called[i][0] == 0);
+  }
+
+  exec_ctx.now = start + 600;
+  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) ==
+             GRPC_TIMERS_CHECKED_AND_EMPTY);
+  grpc_exec_ctx_finish(&exec_ctx);
+  for (i = 0; i < 30; i++) {
+    GPR_ASSERT(cb_called[i][1] == (i < 10));
+    GPR_ASSERT(cb_called[i][0] == 0);
+  }
+
+  /* collect the rest of the timers */
+  exec_ctx.now = start + 1500;
+  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) == GRPC_TIMERS_FIRED);
+  grpc_exec_ctx_finish(&exec_ctx);
+  for (i = 0; i < 30; i++) {
+    GPR_ASSERT(cb_called[i][1] == (i < 20));
+    GPR_ASSERT(cb_called[i][0] == 0);
+  }
+
+  exec_ctx.now = start + 1600;
+  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) ==
+             GRPC_TIMERS_CHECKED_AND_EMPTY);
+  for (i = 0; i < 30; i++) {
+    GPR_ASSERT(cb_called[i][1] == (i < 20));
+    GPR_ASSERT(cb_called[i][0] == 0);
+  }
+
+  grpc_timer_list_shutdown(&exec_ctx);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+/* Cleaning up a list with pending timers. */
+void destruction_test(void) {
+  grpc_timer timers[5];
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_INFO, "destruction_test");
+
+  exec_ctx.now_is_valid = true;
+  exec_ctx.now = 0;
+  grpc_timer_list_init(&exec_ctx);
+  grpc_timer_trace.value = 1;
+  grpc_timer_check_trace.value = 1;
+  memset(cb_called, 0, sizeof(cb_called));
+
+  grpc_timer_init(
+      &exec_ctx, &timers[0], 100,
+      GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)0, grpc_schedule_on_exec_ctx));
+  grpc_timer_init(
+      &exec_ctx, &timers[1], 3,
+      GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)1, grpc_schedule_on_exec_ctx));
+  grpc_timer_init(
+      &exec_ctx, &timers[2], 100,
+      GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)2, grpc_schedule_on_exec_ctx));
+  grpc_timer_init(
+      &exec_ctx, &timers[3], 3,
+      GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)3, grpc_schedule_on_exec_ctx));
+  grpc_timer_init(
+      &exec_ctx, &timers[4], 1,
+      GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)4, grpc_schedule_on_exec_ctx));
+  exec_ctx.now = 2;
+  GPR_ASSERT(grpc_timer_check(&exec_ctx, NULL) == GRPC_TIMERS_FIRED);
+  grpc_exec_ctx_finish(&exec_ctx);
+  GPR_ASSERT(1 == cb_called[4][1]);
+  grpc_timer_cancel(&exec_ctx, &timers[0]);
+  grpc_timer_cancel(&exec_ctx, &timers[3]);
+  grpc_exec_ctx_finish(&exec_ctx);
+  GPR_ASSERT(1 == cb_called[0][0]);
+  GPR_ASSERT(1 == cb_called[3][0]);
+
+  grpc_timer_list_shutdown(&exec_ctx);
+  grpc_exec_ctx_finish(&exec_ctx);
+  GPR_ASSERT(1 == cb_called[1][0]);
+  GPR_ASSERT(1 == cb_called[2][0]);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
+  add_test();
+  destruction_test();
+  return 0;
+}
+
+#else /* GRPC_TIMER_USE_GENERIC */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_TIMER_USE_GENERIC */
diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c
deleted file mode 100644
index 2e44d0a..0000000
--- a/test/core/iomgr/udp_server_test.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-// This test won't work except with posix sockets enabled
-#ifdef GRPC_POSIX_SOCKET
-
-#include "src/core/lib/iomgr/udp_server.h"
-
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/ev_posix.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/socket_factory_posix.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x)
-
-static grpc_pollset *g_pollset;
-static gpr_mu *g_mu;
-static int g_number_of_reads = 0;
-static int g_number_of_writes = 0;
-static int g_number_of_bytes_read = 0;
-static int g_number_of_orphan_calls = 0;
-
-static void on_read(grpc_exec_ctx *exec_ctx, grpc_fd *emfd, void *user_data) {
-  char read_buffer[512];
-  ssize_t byte_count;
-
-  gpr_mu_lock(g_mu);
-  byte_count =
-      recv(grpc_fd_wrapped_fd(emfd), read_buffer, sizeof(read_buffer), 0);
-
-  g_number_of_reads++;
-  g_number_of_bytes_read += (int)byte_count;
-
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-static void on_write(grpc_exec_ctx *exec_ctx, grpc_fd *emfd, void *user_data) {
-  gpr_mu_lock(g_mu);
-  g_number_of_writes++;
-
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
-                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
-  gpr_mu_unlock(g_mu);
-}
-
-static void on_fd_orphaned(grpc_exec_ctx *exec_ctx, grpc_fd *emfd,
-                           grpc_closure *closure, void *user_data) {
-  gpr_log(GPR_INFO, "gRPC FD about to be orphaned: %d",
-          grpc_fd_wrapped_fd(emfd));
-  g_number_of_orphan_calls++;
-}
-
-struct test_socket_factory {
-  grpc_socket_factory base;
-  int number_of_socket_calls;
-  int number_of_bind_calls;
-};
-typedef struct test_socket_factory test_socket_factory;
-
-static int test_socket_factory_socket(grpc_socket_factory *factory, int domain,
-                                      int type, int protocol) {
-  test_socket_factory *f = (test_socket_factory *)factory;
-  f->number_of_socket_calls++;
-  return socket(domain, type, protocol);
-}
-
-static int test_socket_factory_bind(grpc_socket_factory *factory, int sockfd,
-                                    const grpc_resolved_address *addr) {
-  test_socket_factory *f = (test_socket_factory *)factory;
-  f->number_of_bind_calls++;
-  return bind(sockfd, (struct sockaddr *)addr->addr, (socklen_t)addr->len);
-}
-
-static int test_socket_factory_compare(grpc_socket_factory *a,
-                                       grpc_socket_factory *b) {
-  return GPR_ICMP(a, b);
-}
-
-static void test_socket_factory_destroy(grpc_socket_factory *factory) {
-  test_socket_factory *f = (test_socket_factory *)factory;
-  gpr_free(f);
-}
-
-static const grpc_socket_factory_vtable test_socket_factory_vtable = {
-    test_socket_factory_socket, test_socket_factory_bind,
-    test_socket_factory_compare, test_socket_factory_destroy};
-
-static test_socket_factory *test_socket_factory_create(void) {
-  test_socket_factory *factory = gpr_malloc(sizeof(test_socket_factory));
-  grpc_socket_factory_init(&factory->base, &test_socket_factory_vtable);
-  factory->number_of_socket_calls = 0;
-  factory->number_of_bind_calls = 0;
-  return factory;
-}
-
-static void test_no_op(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_udp_server *s = grpc_udp_server_create(NULL);
-  grpc_udp_server_destroy(&exec_ctx, s, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_op_with_start(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_udp_server *s = grpc_udp_server_create(NULL);
-  LOG_TEST("test_no_op_with_start");
-  grpc_udp_server_start(&exec_ctx, s, NULL, 0, NULL);
-  grpc_udp_server_destroy(&exec_ctx, s, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_no_op_with_port(void) {
-  g_number_of_orphan_calls = 0;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  grpc_udp_server *s = grpc_udp_server_create(NULL);
-  LOG_TEST("test_no_op_with_port");
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-  GPR_ASSERT(grpc_udp_server_add_port(s, &resolved_addr, on_read, on_write,
-                                      on_fd_orphaned));
-
-  grpc_udp_server_destroy(&exec_ctx, s, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  /* The server had a single FD, which should have been orphaned. */
-  GPR_ASSERT(g_number_of_orphan_calls == 1);
-}
-
-static void test_no_op_with_port_and_socket_factory(void) {
-  g_number_of_orphan_calls = 0;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-
-  test_socket_factory *socket_factory = test_socket_factory_create();
-  grpc_arg socket_factory_arg =
-      grpc_socket_factory_to_arg(&socket_factory->base);
-  grpc_channel_args *channel_args =
-      grpc_channel_args_copy_and_add(NULL, &socket_factory_arg, 1);
-  grpc_udp_server *s = grpc_udp_server_create(channel_args);
-  grpc_channel_args_destroy(&exec_ctx, channel_args);
-
-  LOG_TEST("test_no_op_with_port_and_socket_factory");
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-  GPR_ASSERT(grpc_udp_server_add_port(s, &resolved_addr, on_read, on_write,
-                                      on_fd_orphaned));
-  GPR_ASSERT(socket_factory->number_of_socket_calls == 1);
-  GPR_ASSERT(socket_factory->number_of_bind_calls == 1);
-
-  grpc_udp_server_destroy(&exec_ctx, s, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_socket_factory_unref(&socket_factory->base);
-
-  /* The server had a single FD, which should have been orphaned. */
-  GPR_ASSERT(g_number_of_orphan_calls == 1);
-}
-
-static void test_no_op_with_port_and_start(void) {
-  g_number_of_orphan_calls = 0;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  grpc_udp_server *s = grpc_udp_server_create(NULL);
-  LOG_TEST("test_no_op_with_port_and_start");
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_in);
-  addr->sin_family = AF_INET;
-  GPR_ASSERT(grpc_udp_server_add_port(s, &resolved_addr, on_read, on_write,
-                                      on_fd_orphaned));
-
-  grpc_udp_server_start(&exec_ctx, s, NULL, 0, NULL);
-
-  grpc_udp_server_destroy(&exec_ctx, s, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  /* The server had a single FD, which is orphaned exactly once in *
-   * grpc_udp_server_destroy. */
-  GPR_ASSERT(g_number_of_orphan_calls == 1);
-}
-
-static void test_receive(int number_of_clients) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_storage *addr = (struct sockaddr_storage *)resolved_addr.addr;
-  int clifd, svrfd;
-  grpc_udp_server *s = grpc_udp_server_create(NULL);
-  int i;
-  int number_of_reads_before;
-  grpc_millis deadline;
-  grpc_pollset *pollsets[1];
-  LOG_TEST("test_receive");
-  gpr_log(GPR_INFO, "clients=%d", number_of_clients);
-
-  g_number_of_bytes_read = 0;
-  g_number_of_orphan_calls = 0;
-
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  resolved_addr.len = sizeof(struct sockaddr_storage);
-  addr->ss_family = AF_INET;
-  GPR_ASSERT(grpc_udp_server_add_port(s, &resolved_addr, on_read, on_write,
-                                      on_fd_orphaned));
-
-  svrfd = grpc_udp_server_get_fd(s, 0);
-  GPR_ASSERT(svrfd >= 0);
-  GPR_ASSERT(getsockname(svrfd, (struct sockaddr *)addr,
-                         (socklen_t *)&resolved_addr.len) == 0);
-  GPR_ASSERT(resolved_addr.len <= sizeof(struct sockaddr_storage));
-
-  pollsets[0] = g_pollset;
-  grpc_udp_server_start(&exec_ctx, s, pollsets, 1, NULL);
-
-  gpr_mu_lock(g_mu);
-
-  for (i = 0; i < number_of_clients; i++) {
-    deadline =
-        grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
-
-    number_of_reads_before = g_number_of_reads;
-    /* Create a socket, send a packet to the UDP server. */
-    clifd = socket(addr->ss_family, SOCK_DGRAM, 0);
-    GPR_ASSERT(clifd >= 0);
-    GPR_ASSERT(connect(clifd, (struct sockaddr *)addr,
-                       (socklen_t)resolved_addr.len) == 0);
-    GPR_ASSERT(5 == write(clifd, "hello", 5));
-    while (g_number_of_reads == number_of_reads_before &&
-           deadline > grpc_exec_ctx_now(&exec_ctx)) {
-      grpc_pollset_worker *worker = NULL;
-      GPR_ASSERT(GRPC_LOG_IF_ERROR(
-          "pollset_work",
-          grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
-      gpr_mu_unlock(g_mu);
-      grpc_exec_ctx_flush(&exec_ctx);
-      gpr_mu_lock(g_mu);
-    }
-    GPR_ASSERT(g_number_of_reads == number_of_reads_before + 1);
-    close(clifd);
-  }
-  GPR_ASSERT(g_number_of_bytes_read == 5 * number_of_clients);
-
-  gpr_mu_unlock(g_mu);
-
-  grpc_udp_server_destroy(&exec_ctx, s, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  /* The server had a single FD, which is orphaned exactly once in *
-   * grpc_udp_server_destroy. */
-  GPR_ASSERT(g_number_of_orphan_calls == 1);
-
-  /* The write callback should have fired a few times. */
-  GPR_ASSERT(g_number_of_writes > 0);
-}
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, p);
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_test_init(argc, argv);
-  grpc_init();
-  g_pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(g_pollset, &g_mu);
-
-  test_no_op();
-  test_no_op_with_start();
-  test_no_op_with_port();
-  test_no_op_with_port_and_socket_factory();
-  test_no_op_with_port_and_start();
-  test_receive(1);
-  test_receive(10);
-
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(g_pollset);
-  grpc_shutdown();
-  return 0;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/udp_server_test.cc b/test/core/iomgr/udp_server_test.cc
new file mode 100644
index 0000000..4e8f234
--- /dev/null
+++ b/test/core/iomgr/udp_server_test.cc
@@ -0,0 +1,328 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+// This test won't work except with posix sockets enabled
+#ifdef GRPC_POSIX_SOCKET
+
+#include "src/core/lib/iomgr/udp_server.h"
+
+#include <netinet/in.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/socket_factory_posix.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x)
+
+static grpc_pollset* g_pollset;
+static gpr_mu* g_mu;
+static int g_number_of_reads = 0;
+static int g_number_of_writes = 0;
+static int g_number_of_bytes_read = 0;
+static int g_number_of_orphan_calls = 0;
+
+static void on_read(grpc_exec_ctx* exec_ctx, grpc_fd* emfd, void* user_data) {
+  char read_buffer[512];
+  ssize_t byte_count;
+
+  gpr_mu_lock(g_mu);
+  byte_count =
+      recv(grpc_fd_wrapped_fd(emfd), read_buffer, sizeof(read_buffer), 0);
+
+  g_number_of_reads++;
+  g_number_of_bytes_read += (int)byte_count;
+
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+static void on_write(grpc_exec_ctx* exec_ctx, grpc_fd* emfd, void* user_data) {
+  gpr_mu_lock(g_mu);
+  g_number_of_writes++;
+
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("pollset_kick",
+                               grpc_pollset_kick(exec_ctx, g_pollset, NULL)));
+  gpr_mu_unlock(g_mu);
+}
+
+static void on_fd_orphaned(grpc_exec_ctx* exec_ctx, grpc_fd* emfd,
+                           grpc_closure* closure, void* user_data) {
+  gpr_log(GPR_INFO, "gRPC FD about to be orphaned: %d",
+          grpc_fd_wrapped_fd(emfd));
+  g_number_of_orphan_calls++;
+}
+
+struct test_socket_factory {
+  grpc_socket_factory base;
+  int number_of_socket_calls;
+  int number_of_bind_calls;
+};
+typedef struct test_socket_factory test_socket_factory;
+
+static int test_socket_factory_socket(grpc_socket_factory* factory, int domain,
+                                      int type, int protocol) {
+  test_socket_factory* f = (test_socket_factory*)factory;
+  f->number_of_socket_calls++;
+  return socket(domain, type, protocol);
+}
+
+static int test_socket_factory_bind(grpc_socket_factory* factory, int sockfd,
+                                    const grpc_resolved_address* addr) {
+  test_socket_factory* f = (test_socket_factory*)factory;
+  f->number_of_bind_calls++;
+  return bind(sockfd, (struct sockaddr*)addr->addr, (socklen_t)addr->len);
+}
+
+static int test_socket_factory_compare(grpc_socket_factory* a,
+                                       grpc_socket_factory* b) {
+  return GPR_ICMP(a, b);
+}
+
+static void test_socket_factory_destroy(grpc_socket_factory* factory) {
+  test_socket_factory* f = (test_socket_factory*)factory;
+  gpr_free(f);
+}
+
+static const grpc_socket_factory_vtable test_socket_factory_vtable = {
+    test_socket_factory_socket, test_socket_factory_bind,
+    test_socket_factory_compare, test_socket_factory_destroy};
+
+static test_socket_factory* test_socket_factory_create(void) {
+  test_socket_factory* factory = static_cast<test_socket_factory*>(
+      gpr_malloc(sizeof(test_socket_factory)));
+  grpc_socket_factory_init(&factory->base, &test_socket_factory_vtable);
+  factory->number_of_socket_calls = 0;
+  factory->number_of_bind_calls = 0;
+  return factory;
+}
+
+static void test_no_op(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_udp_server* s = grpc_udp_server_create(NULL);
+  grpc_udp_server_destroy(&exec_ctx, s, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_op_with_start(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_udp_server* s = grpc_udp_server_create(NULL);
+  LOG_TEST("test_no_op_with_start");
+  grpc_udp_server_start(&exec_ctx, s, NULL, 0, NULL);
+  grpc_udp_server_destroy(&exec_ctx, s, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_no_op_with_port(void) {
+  g_number_of_orphan_calls = 0;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  grpc_udp_server* s = grpc_udp_server_create(NULL);
+  LOG_TEST("test_no_op_with_port");
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+  GPR_ASSERT(grpc_udp_server_add_port(s, &resolved_addr, on_read, on_write,
+                                      on_fd_orphaned));
+
+  grpc_udp_server_destroy(&exec_ctx, s, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  /* The server had a single FD, which should have been orphaned. */
+  GPR_ASSERT(g_number_of_orphan_calls == 1);
+}
+
+static void test_no_op_with_port_and_socket_factory(void) {
+  g_number_of_orphan_calls = 0;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+
+  test_socket_factory* socket_factory = test_socket_factory_create();
+  grpc_arg socket_factory_arg =
+      grpc_socket_factory_to_arg(&socket_factory->base);
+  grpc_channel_args* channel_args =
+      grpc_channel_args_copy_and_add(NULL, &socket_factory_arg, 1);
+  grpc_udp_server* s = grpc_udp_server_create(channel_args);
+  grpc_channel_args_destroy(&exec_ctx, channel_args);
+
+  LOG_TEST("test_no_op_with_port_and_socket_factory");
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+  GPR_ASSERT(grpc_udp_server_add_port(s, &resolved_addr, on_read, on_write,
+                                      on_fd_orphaned));
+  GPR_ASSERT(socket_factory->number_of_socket_calls == 1);
+  GPR_ASSERT(socket_factory->number_of_bind_calls == 1);
+
+  grpc_udp_server_destroy(&exec_ctx, s, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_socket_factory_unref(&socket_factory->base);
+
+  /* The server had a single FD, which should have been orphaned. */
+  GPR_ASSERT(g_number_of_orphan_calls == 1);
+}
+
+static void test_no_op_with_port_and_start(void) {
+  g_number_of_orphan_calls = 0;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  grpc_udp_server* s = grpc_udp_server_create(NULL);
+  LOG_TEST("test_no_op_with_port_and_start");
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_in);
+  addr->sin_family = AF_INET;
+  GPR_ASSERT(grpc_udp_server_add_port(s, &resolved_addr, on_read, on_write,
+                                      on_fd_orphaned));
+
+  grpc_udp_server_start(&exec_ctx, s, NULL, 0, NULL);
+
+  grpc_udp_server_destroy(&exec_ctx, s, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  /* The server had a single FD, which is orphaned exactly once in *
+   * grpc_udp_server_destroy. */
+  GPR_ASSERT(g_number_of_orphan_calls == 1);
+}
+
+static void test_receive(int number_of_clients) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_storage* addr = (struct sockaddr_storage*)resolved_addr.addr;
+  int clifd, svrfd;
+  grpc_udp_server* s = grpc_udp_server_create(NULL);
+  int i;
+  int number_of_reads_before;
+  grpc_millis deadline;
+  grpc_pollset* pollsets[1];
+  LOG_TEST("test_receive");
+  gpr_log(GPR_INFO, "clients=%d", number_of_clients);
+
+  g_number_of_bytes_read = 0;
+  g_number_of_orphan_calls = 0;
+
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  resolved_addr.len = sizeof(struct sockaddr_storage);
+  addr->ss_family = AF_INET;
+  GPR_ASSERT(grpc_udp_server_add_port(s, &resolved_addr, on_read, on_write,
+                                      on_fd_orphaned));
+
+  svrfd = grpc_udp_server_get_fd(s, 0);
+  GPR_ASSERT(svrfd >= 0);
+  GPR_ASSERT(getsockname(svrfd, (struct sockaddr*)addr,
+                         (socklen_t*)&resolved_addr.len) == 0);
+  GPR_ASSERT(resolved_addr.len <= sizeof(struct sockaddr_storage));
+
+  pollsets[0] = g_pollset;
+  grpc_udp_server_start(&exec_ctx, s, pollsets, 1, NULL);
+
+  gpr_mu_lock(g_mu);
+
+  for (i = 0; i < number_of_clients; i++) {
+    deadline =
+        grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10));
+
+    number_of_reads_before = g_number_of_reads;
+    /* Create a socket, send a packet to the UDP server. */
+    clifd = socket(addr->ss_family, SOCK_DGRAM, 0);
+    GPR_ASSERT(clifd >= 0);
+    GPR_ASSERT(connect(clifd, (struct sockaddr*)addr,
+                       (socklen_t)resolved_addr.len) == 0);
+    GPR_ASSERT(5 == write(clifd, "hello", 5));
+    while (g_number_of_reads == number_of_reads_before &&
+           deadline > grpc_exec_ctx_now(&exec_ctx)) {
+      grpc_pollset_worker* worker = NULL;
+      GPR_ASSERT(GRPC_LOG_IF_ERROR(
+          "pollset_work",
+          grpc_pollset_work(&exec_ctx, g_pollset, &worker, deadline)));
+      gpr_mu_unlock(g_mu);
+      grpc_exec_ctx_flush(&exec_ctx);
+      gpr_mu_lock(g_mu);
+    }
+    GPR_ASSERT(g_number_of_reads == number_of_reads_before + 1);
+    close(clifd);
+  }
+  GPR_ASSERT(g_number_of_bytes_read == 5 * number_of_clients);
+
+  gpr_mu_unlock(g_mu);
+
+  grpc_udp_server_destroy(&exec_ctx, s, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  /* The server had a single FD, which is orphaned exactly once in *
+   * grpc_udp_server_destroy. */
+  GPR_ASSERT(g_number_of_orphan_calls == 1);
+
+  /* The write callback should have fired a few times. */
+  GPR_ASSERT(g_number_of_writes > 0);
+}
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(p));
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_test_init(argc, argv);
+  grpc_init();
+  g_pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(g_pollset, &g_mu);
+
+  test_no_op();
+  test_no_op_with_start();
+  test_no_op_with_port();
+  test_no_op_with_port_and_socket_factory();
+  test_no_op_with_port_and_start();
+  test_receive(1);
+  test_receive(10);
+
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(g_pollset);
+  grpc_shutdown();
+  return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/wakeup_fd_cv_test.c b/test/core/iomgr/wakeup_fd_cv_test.c
deleted file mode 100644
index 0b21127..0000000
--- a/test/core/iomgr/wakeup_fd_cv_test.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_POSIX_SOCKET
-
-#include <pthread.h>
-
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/iomgr/ev_posix.h"
-#include "src/core/lib/iomgr/iomgr_posix.h"
-#include "src/core/lib/support/env.h"
-
-typedef struct poll_args {
-  struct pollfd *fds;
-  nfds_t nfds;
-  int timeout;
-  int result;
-} poll_args;
-
-gpr_cv poll_cv;
-gpr_mu poll_mu;
-static int socket_event = 0;
-
-// Trigger a "socket" POLLIN in mock_poll()
-void trigger_socket_event() {
-  gpr_mu_lock(&poll_mu);
-  socket_event = 1;
-  gpr_cv_broadcast(&poll_cv);
-  gpr_mu_unlock(&poll_mu);
-}
-
-void reset_socket_event() {
-  gpr_mu_lock(&poll_mu);
-  socket_event = 0;
-  gpr_mu_unlock(&poll_mu);
-}
-
-// Mocks posix poll() function
-int mock_poll(struct pollfd *fds, nfds_t nfds, int timeout) {
-  int res = 0;
-  gpr_timespec poll_time;
-  gpr_mu_lock(&poll_mu);
-  GPR_ASSERT(nfds == 3);
-  GPR_ASSERT(fds[0].fd == 20);
-  GPR_ASSERT(fds[1].fd == 30);
-  GPR_ASSERT(fds[2].fd == 50);
-  GPR_ASSERT(fds[0].events == (POLLIN | POLLHUP));
-  GPR_ASSERT(fds[1].events == (POLLIN | POLLHUP));
-  GPR_ASSERT(fds[2].events == POLLIN);
-
-  if (timeout < 0) {
-    poll_time = gpr_inf_future(GPR_CLOCK_REALTIME);
-  } else {
-    poll_time = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                             gpr_time_from_millis(timeout, GPR_TIMESPAN));
-  }
-
-  if (socket_event || !gpr_cv_wait(&poll_cv, &poll_mu, poll_time)) {
-    fds[0].revents = POLLIN;
-    res = 1;
-  }
-  gpr_mu_unlock(&poll_mu);
-  return res;
-}
-
-void background_poll(void *args) {
-  poll_args *pargs = (poll_args *)args;
-  pargs->result = grpc_poll_function(pargs->fds, pargs->nfds, pargs->timeout);
-}
-
-void test_many_fds(void) {
-  int i;
-  grpc_wakeup_fd fd[1000];
-  for (i = 0; i < 1000; i++) {
-    GPR_ASSERT(grpc_wakeup_fd_init(&fd[i]) == GRPC_ERROR_NONE);
-  }
-  for (i = 0; i < 1000; i++) {
-    grpc_wakeup_fd_destroy(&fd[i]);
-  }
-}
-
-void test_poll_cv_trigger(void) {
-  grpc_wakeup_fd cvfd1, cvfd2, cvfd3;
-  struct pollfd pfds[6];
-  poll_args pargs;
-  gpr_thd_id t_id;
-  gpr_thd_options opt;
-
-  GPR_ASSERT(grpc_wakeup_fd_init(&cvfd1) == GRPC_ERROR_NONE);
-  GPR_ASSERT(grpc_wakeup_fd_init(&cvfd2) == GRPC_ERROR_NONE);
-  GPR_ASSERT(grpc_wakeup_fd_init(&cvfd3) == GRPC_ERROR_NONE);
-  GPR_ASSERT(cvfd1.read_fd < 0);
-  GPR_ASSERT(cvfd2.read_fd < 0);
-  GPR_ASSERT(cvfd3.read_fd < 0);
-  GPR_ASSERT(cvfd1.read_fd != cvfd2.read_fd);
-  GPR_ASSERT(cvfd2.read_fd != cvfd3.read_fd);
-  GPR_ASSERT(cvfd1.read_fd != cvfd3.read_fd);
-
-  pfds[0].fd = cvfd1.read_fd;
-  pfds[1].fd = cvfd2.read_fd;
-  pfds[2].fd = 20;
-  pfds[3].fd = 30;
-  pfds[4].fd = cvfd3.read_fd;
-  pfds[5].fd = 50;
-
-  pfds[0].events = 0;
-  pfds[1].events = POLLIN;
-  pfds[2].events = POLLIN | POLLHUP;
-  pfds[3].events = POLLIN | POLLHUP;
-  pfds[4].events = POLLIN;
-  pfds[5].events = POLLIN;
-
-  pargs.fds = pfds;
-  pargs.nfds = 6;
-  pargs.timeout = 1000;
-  pargs.result = -2;
-
-  opt = gpr_thd_options_default();
-  gpr_thd_options_set_joinable(&opt);
-  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
-
-  // Wakeup wakeup_fd not listening for events
-  GPR_ASSERT(grpc_wakeup_fd_wakeup(&cvfd1) == GRPC_ERROR_NONE);
-  gpr_thd_join(t_id);
-  GPR_ASSERT(pargs.result == 0);
-  GPR_ASSERT(pfds[0].revents == 0);
-  GPR_ASSERT(pfds[1].revents == 0);
-  GPR_ASSERT(pfds[2].revents == 0);
-  GPR_ASSERT(pfds[3].revents == 0);
-  GPR_ASSERT(pfds[4].revents == 0);
-  GPR_ASSERT(pfds[5].revents == 0);
-
-  // Pollin on socket fd
-  pargs.timeout = -1;
-  pargs.result = -2;
-  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
-  trigger_socket_event();
-  gpr_thd_join(t_id);
-  GPR_ASSERT(pargs.result == 1);
-  GPR_ASSERT(pfds[0].revents == 0);
-  GPR_ASSERT(pfds[1].revents == 0);
-  GPR_ASSERT(pfds[2].revents == POLLIN);
-  GPR_ASSERT(pfds[3].revents == 0);
-  GPR_ASSERT(pfds[4].revents == 0);
-  GPR_ASSERT(pfds[5].revents == 0);
-
-  // Pollin on wakeup fd
-  reset_socket_event();
-  pargs.result = -2;
-  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
-  GPR_ASSERT(grpc_wakeup_fd_wakeup(&cvfd2) == GRPC_ERROR_NONE);
-  gpr_thd_join(t_id);
-
-  GPR_ASSERT(pargs.result == 1);
-  GPR_ASSERT(pfds[0].revents == 0);
-  GPR_ASSERT(pfds[1].revents == POLLIN);
-  GPR_ASSERT(pfds[2].revents == 0);
-  GPR_ASSERT(pfds[3].revents == 0);
-  GPR_ASSERT(pfds[4].revents == 0);
-  GPR_ASSERT(pfds[5].revents == 0);
-
-  // Pollin on wakeupfd before poll()
-  pargs.result = -2;
-  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
-  gpr_thd_join(t_id);
-
-  GPR_ASSERT(pargs.result == 1);
-  GPR_ASSERT(pfds[0].revents == 0);
-  GPR_ASSERT(pfds[1].revents == POLLIN);
-  GPR_ASSERT(pfds[2].revents == 0);
-  GPR_ASSERT(pfds[3].revents == 0);
-  GPR_ASSERT(pfds[4].revents == 0);
-  GPR_ASSERT(pfds[5].revents == 0);
-
-  // No Events
-  pargs.result = -2;
-  pargs.timeout = 1000;
-  reset_socket_event();
-  GPR_ASSERT(grpc_wakeup_fd_consume_wakeup(&cvfd1) == GRPC_ERROR_NONE);
-  GPR_ASSERT(grpc_wakeup_fd_consume_wakeup(&cvfd2) == GRPC_ERROR_NONE);
-  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
-  gpr_thd_join(t_id);
-
-  GPR_ASSERT(pargs.result == 0);
-  GPR_ASSERT(pfds[0].revents == 0);
-  GPR_ASSERT(pfds[1].revents == 0);
-  GPR_ASSERT(pfds[2].revents == 0);
-  GPR_ASSERT(pfds[3].revents == 0);
-  GPR_ASSERT(pfds[4].revents == 0);
-  GPR_ASSERT(pfds[5].revents == 0);
-}
-
-int main(int argc, char **argv) {
-  gpr_setenv("GRPC_POLL_STRATEGY", "poll-cv");
-  grpc_poll_function = &mock_poll;
-  gpr_mu_init(&poll_mu);
-  gpr_cv_init(&poll_cv);
-
-  grpc_iomgr_platform_init();
-  test_many_fds();
-  grpc_iomgr_platform_shutdown();
-
-  grpc_iomgr_platform_init();
-  test_poll_cv_trigger();
-  grpc_iomgr_platform_shutdown();
-  return 0;
-}
-
-#else /* GRPC_POSIX_SOCKET */
-
-int main(int argc, char **argv) { return 1; }
-
-#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/iomgr/wakeup_fd_cv_test.cc b/test/core/iomgr/wakeup_fd_cv_test.cc
new file mode 100644
index 0000000..dc1d77a
--- /dev/null
+++ b/test/core/iomgr/wakeup_fd_cv_test.cc
@@ -0,0 +1,234 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_POSIX_SOCKET
+
+#include <pthread.h>
+
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/iomgr_posix.h"
+#include "src/core/lib/support/env.h"
+
+typedef struct poll_args {
+  struct pollfd* fds;
+  nfds_t nfds;
+  int timeout;
+  int result;
+} poll_args;
+
+gpr_cv poll_cv;
+gpr_mu poll_mu;
+static int socket_event = 0;
+
+// Trigger a "socket" POLLIN in mock_poll()
+void trigger_socket_event() {
+  gpr_mu_lock(&poll_mu);
+  socket_event = 1;
+  gpr_cv_broadcast(&poll_cv);
+  gpr_mu_unlock(&poll_mu);
+}
+
+void reset_socket_event() {
+  gpr_mu_lock(&poll_mu);
+  socket_event = 0;
+  gpr_mu_unlock(&poll_mu);
+}
+
+// Mocks posix poll() function
+int mock_poll(struct pollfd* fds, nfds_t nfds, int timeout) {
+  int res = 0;
+  gpr_timespec poll_time;
+  gpr_mu_lock(&poll_mu);
+  GPR_ASSERT(nfds == 3);
+  GPR_ASSERT(fds[0].fd == 20);
+  GPR_ASSERT(fds[1].fd == 30);
+  GPR_ASSERT(fds[2].fd == 50);
+  GPR_ASSERT(fds[0].events == (POLLIN | POLLHUP));
+  GPR_ASSERT(fds[1].events == (POLLIN | POLLHUP));
+  GPR_ASSERT(fds[2].events == POLLIN);
+
+  if (timeout < 0) {
+    poll_time = gpr_inf_future(GPR_CLOCK_REALTIME);
+  } else {
+    poll_time = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                             gpr_time_from_millis(timeout, GPR_TIMESPAN));
+  }
+
+  if (socket_event || !gpr_cv_wait(&poll_cv, &poll_mu, poll_time)) {
+    fds[0].revents = POLLIN;
+    res = 1;
+  }
+  gpr_mu_unlock(&poll_mu);
+  return res;
+}
+
+void background_poll(void* args) {
+  poll_args* pargs = (poll_args*)args;
+  pargs->result = grpc_poll_function(pargs->fds, pargs->nfds, pargs->timeout);
+}
+
+void test_many_fds(void) {
+  int i;
+  grpc_wakeup_fd fd[1000];
+  for (i = 0; i < 1000; i++) {
+    GPR_ASSERT(grpc_wakeup_fd_init(&fd[i]) == GRPC_ERROR_NONE);
+  }
+  for (i = 0; i < 1000; i++) {
+    grpc_wakeup_fd_destroy(&fd[i]);
+  }
+}
+
+void test_poll_cv_trigger(void) {
+  grpc_wakeup_fd cvfd1, cvfd2, cvfd3;
+  struct pollfd pfds[6];
+  poll_args pargs;
+  gpr_thd_id t_id;
+  gpr_thd_options opt;
+
+  GPR_ASSERT(grpc_wakeup_fd_init(&cvfd1) == GRPC_ERROR_NONE);
+  GPR_ASSERT(grpc_wakeup_fd_init(&cvfd2) == GRPC_ERROR_NONE);
+  GPR_ASSERT(grpc_wakeup_fd_init(&cvfd3) == GRPC_ERROR_NONE);
+  GPR_ASSERT(cvfd1.read_fd < 0);
+  GPR_ASSERT(cvfd2.read_fd < 0);
+  GPR_ASSERT(cvfd3.read_fd < 0);
+  GPR_ASSERT(cvfd1.read_fd != cvfd2.read_fd);
+  GPR_ASSERT(cvfd2.read_fd != cvfd3.read_fd);
+  GPR_ASSERT(cvfd1.read_fd != cvfd3.read_fd);
+
+  pfds[0].fd = cvfd1.read_fd;
+  pfds[1].fd = cvfd2.read_fd;
+  pfds[2].fd = 20;
+  pfds[3].fd = 30;
+  pfds[4].fd = cvfd3.read_fd;
+  pfds[5].fd = 50;
+
+  pfds[0].events = 0;
+  pfds[1].events = POLLIN;
+  pfds[2].events = POLLIN | POLLHUP;
+  pfds[3].events = POLLIN | POLLHUP;
+  pfds[4].events = POLLIN;
+  pfds[5].events = POLLIN;
+
+  pargs.fds = pfds;
+  pargs.nfds = 6;
+  pargs.timeout = 1000;
+  pargs.result = -2;
+
+  opt = gpr_thd_options_default();
+  gpr_thd_options_set_joinable(&opt);
+  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
+
+  // Wakeup wakeup_fd not listening for events
+  GPR_ASSERT(grpc_wakeup_fd_wakeup(&cvfd1) == GRPC_ERROR_NONE);
+  gpr_thd_join(t_id);
+  GPR_ASSERT(pargs.result == 0);
+  GPR_ASSERT(pfds[0].revents == 0);
+  GPR_ASSERT(pfds[1].revents == 0);
+  GPR_ASSERT(pfds[2].revents == 0);
+  GPR_ASSERT(pfds[3].revents == 0);
+  GPR_ASSERT(pfds[4].revents == 0);
+  GPR_ASSERT(pfds[5].revents == 0);
+
+  // Pollin on socket fd
+  pargs.timeout = -1;
+  pargs.result = -2;
+  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
+  trigger_socket_event();
+  gpr_thd_join(t_id);
+  GPR_ASSERT(pargs.result == 1);
+  GPR_ASSERT(pfds[0].revents == 0);
+  GPR_ASSERT(pfds[1].revents == 0);
+  GPR_ASSERT(pfds[2].revents == POLLIN);
+  GPR_ASSERT(pfds[3].revents == 0);
+  GPR_ASSERT(pfds[4].revents == 0);
+  GPR_ASSERT(pfds[5].revents == 0);
+
+  // Pollin on wakeup fd
+  reset_socket_event();
+  pargs.result = -2;
+  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
+  GPR_ASSERT(grpc_wakeup_fd_wakeup(&cvfd2) == GRPC_ERROR_NONE);
+  gpr_thd_join(t_id);
+
+  GPR_ASSERT(pargs.result == 1);
+  GPR_ASSERT(pfds[0].revents == 0);
+  GPR_ASSERT(pfds[1].revents == POLLIN);
+  GPR_ASSERT(pfds[2].revents == 0);
+  GPR_ASSERT(pfds[3].revents == 0);
+  GPR_ASSERT(pfds[4].revents == 0);
+  GPR_ASSERT(pfds[5].revents == 0);
+
+  // Pollin on wakeupfd before poll()
+  pargs.result = -2;
+  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
+  gpr_thd_join(t_id);
+
+  GPR_ASSERT(pargs.result == 1);
+  GPR_ASSERT(pfds[0].revents == 0);
+  GPR_ASSERT(pfds[1].revents == POLLIN);
+  GPR_ASSERT(pfds[2].revents == 0);
+  GPR_ASSERT(pfds[3].revents == 0);
+  GPR_ASSERT(pfds[4].revents == 0);
+  GPR_ASSERT(pfds[5].revents == 0);
+
+  // No Events
+  pargs.result = -2;
+  pargs.timeout = 1000;
+  reset_socket_event();
+  GPR_ASSERT(grpc_wakeup_fd_consume_wakeup(&cvfd1) == GRPC_ERROR_NONE);
+  GPR_ASSERT(grpc_wakeup_fd_consume_wakeup(&cvfd2) == GRPC_ERROR_NONE);
+  gpr_thd_new(&t_id, &background_poll, &pargs, &opt);
+  gpr_thd_join(t_id);
+
+  GPR_ASSERT(pargs.result == 0);
+  GPR_ASSERT(pfds[0].revents == 0);
+  GPR_ASSERT(pfds[1].revents == 0);
+  GPR_ASSERT(pfds[2].revents == 0);
+  GPR_ASSERT(pfds[3].revents == 0);
+  GPR_ASSERT(pfds[4].revents == 0);
+  GPR_ASSERT(pfds[5].revents == 0);
+}
+
+int main(int argc, char** argv) {
+  gpr_setenv("GRPC_POLL_STRATEGY", "poll-cv");
+  grpc_poll_function = &mock_poll;
+  gpr_mu_init(&poll_mu);
+  gpr_cv_init(&poll_cv);
+
+  grpc_iomgr_platform_init();
+  test_many_fds();
+  grpc_iomgr_platform_shutdown();
+
+  grpc_iomgr_platform_init();
+  test_poll_cv_trigger();
+  grpc_iomgr_platform_shutdown();
+  return 0;
+}
+
+#else /* GRPC_POSIX_SOCKET */
+
+int main(int argc, char** argv) { return 1; }
+
+#endif /* GRPC_POSIX_SOCKET */
diff --git a/test/core/json/BUILD b/test/core/json/BUILD
index 3ff7918..b8b36c0 100644
--- a/test/core/json/BUILD
+++ b/test/core/json/BUILD
@@ -22,8 +22,8 @@
 
 grpc_fuzzer(
     name = "json_fuzzer",
-    srcs = ["fuzzer.c"],
-    language = "C",
+    srcs = ["fuzzer.cc"],
+    language = "C++",
     corpus = "corpus",
     deps = [
         "//:gpr",
@@ -35,8 +35,8 @@
 grpc_cc_binary(
     name = "json_rewrite",
     testonly = 1,
-    srcs = ["json_rewrite.c"],
-    language = "C",
+    srcs = ["json_rewrite.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -47,8 +47,8 @@
 
 grpc_cc_test(
     name = "json_rewrite_test",
-    srcs = ["json_rewrite_test.c"],
-    language = "C",
+    srcs = ["json_rewrite_test.cc"],
+    language = "C++",
     data = [
         "rewrite_test_input.json",
         "rewrite_test_output_condensed.json",
@@ -65,8 +65,8 @@
 
 grpc_cc_test(
     name = "json_stream_error_test",
-    srcs = ["json_stream_error_test.c"],
-    language = "C",
+    srcs = ["json_stream_error_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -77,8 +77,8 @@
 
 grpc_cc_test(
     name = "json_test",
-    srcs = ["json_test.c"],
-    language = "C",
+    srcs = ["json_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/json/fuzzer.c b/test/core/json/fuzzer.c
deleted file mode 100644
index b825904..0000000
--- a/test/core/json/fuzzer.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/json/json.h"
-#include "test/core/util/memory_counters.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  char *s;
-  struct grpc_memory_counters counters;
-  grpc_memory_counters_init();
-  s = gpr_malloc(size);
-  memcpy(s, data, size);
-  grpc_json *x;
-  if ((x = grpc_json_parse_string_with_len(s, size))) {
-    grpc_json_destroy(x);
-  }
-  gpr_free(s);
-  counters = grpc_memory_counters_snapshot();
-  grpc_memory_counters_destroy();
-  GPR_ASSERT(counters.total_size_relative == 0);
-  return 0;
-}
diff --git a/test/core/json/fuzzer.cc b/test/core/json/fuzzer.cc
new file mode 100644
index 0000000..6dafabb
--- /dev/null
+++ b/test/core/json/fuzzer.cc
@@ -0,0 +1,47 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/json/json.h"
+#include "test/core/util/memory_counters.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  char* s;
+  struct grpc_memory_counters counters;
+  grpc_memory_counters_init();
+  s = static_cast<char*>(gpr_malloc(size));
+  memcpy(s, data, size);
+  grpc_json* x;
+  if ((x = grpc_json_parse_string_with_len(s, size))) {
+    grpc_json_destroy(x);
+  }
+  gpr_free(s);
+  counters = grpc_memory_counters_snapshot();
+  grpc_memory_counters_destroy();
+  GPR_ASSERT(counters.total_size_relative == 0);
+  return 0;
+}
diff --git a/test/core/json/json_rewrite.c b/test/core/json/json_rewrite.c
deleted file mode 100644
index dfe32f5..0000000
--- a/test/core/json/json_rewrite.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/cmdline.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/json/json_reader.h"
-#include "src/core/lib/json/json_writer.h"
-
-typedef struct json_writer_userdata { FILE *out; } json_writer_userdata;
-
-typedef struct stacked_container {
-  grpc_json_type type;
-  struct stacked_container *next;
-} stacked_container;
-
-typedef struct json_reader_userdata {
-  FILE *in;
-  grpc_json_writer *writer;
-  char *scratchpad;
-  char *ptr;
-  size_t free_space;
-  size_t allocated;
-  size_t string_len;
-  stacked_container *top;
-} json_reader_userdata;
-
-static void json_writer_output_char(void *userdata, char c) {
-  json_writer_userdata *state = userdata;
-  fputc(c, state->out);
-}
-
-static void json_writer_output_string(void *userdata, const char *str) {
-  json_writer_userdata *state = userdata;
-  fputs(str, state->out);
-}
-
-static void json_writer_output_string_with_len(void *userdata, const char *str,
-                                               size_t len) {
-  json_writer_userdata *state = userdata;
-  fwrite(str, len, 1, state->out);
-}
-
-grpc_json_writer_vtable writer_vtable = {json_writer_output_char,
-                                         json_writer_output_string,
-                                         json_writer_output_string_with_len};
-
-static void check_string(json_reader_userdata *state, size_t needed) {
-  if (state->free_space >= needed) return;
-  needed -= state->free_space;
-  needed = (needed + 0xffu) & ~0xffu;
-  state->scratchpad = gpr_realloc(state->scratchpad, state->allocated + needed);
-  state->free_space += needed;
-  state->allocated += needed;
-}
-
-static void json_reader_string_clear(void *userdata) {
-  json_reader_userdata *state = userdata;
-  state->free_space = state->allocated;
-  state->string_len = 0;
-}
-
-static void json_reader_string_add_char(void *userdata, uint32_t c) {
-  json_reader_userdata *state = userdata;
-  check_string(state, 1);
-  GPR_ASSERT(c < 256);
-  state->scratchpad[state->string_len++] = (char)c;
-}
-
-static void json_reader_string_add_utf32(void *userdata, uint32_t c) {
-  if (c <= 0x7f) {
-    json_reader_string_add_char(userdata, c);
-  } else if (c <= 0x7ff) {
-    uint32_t b1 = 0xc0u | ((c >> 6u) & 0x1fu);
-    uint32_t b2 = 0x80u | (c & 0x3fu);
-    json_reader_string_add_char(userdata, b1);
-    json_reader_string_add_char(userdata, b2);
-  } else if (c <= 0xffffu) {
-    uint32_t b1 = 0xe0u | ((c >> 12u) & 0x0fu);
-    uint32_t b2 = 0x80u | ((c >> 6u) & 0x3fu);
-    uint32_t b3 = 0x80u | (c & 0x3fu);
-    json_reader_string_add_char(userdata, b1);
-    json_reader_string_add_char(userdata, b2);
-    json_reader_string_add_char(userdata, b3);
-  } else if (c <= 0x1fffffu) {
-    uint32_t b1 = 0xf0u | ((c >> 18u) & 0x07u);
-    uint32_t b2 = 0x80u | ((c >> 12u) & 0x3fu);
-    uint32_t b3 = 0x80u | ((c >> 6u) & 0x3fu);
-    uint32_t b4 = 0x80u | (c & 0x3fu);
-    json_reader_string_add_char(userdata, b1);
-    json_reader_string_add_char(userdata, b2);
-    json_reader_string_add_char(userdata, b3);
-    json_reader_string_add_char(userdata, b4);
-  }
-}
-
-static uint32_t json_reader_read_char(void *userdata) {
-  int r;
-  json_reader_userdata *state = userdata;
-
-  r = fgetc(state->in);
-  if (r == EOF) r = GRPC_JSON_READ_CHAR_EOF;
-  return (uint32_t)r;
-}
-
-static void json_reader_container_begins(void *userdata, grpc_json_type type) {
-  json_reader_userdata *state = userdata;
-  stacked_container *container = gpr_malloc(sizeof(stacked_container));
-
-  container->type = type;
-  container->next = state->top;
-  state->top = container;
-
-  grpc_json_writer_container_begins(state->writer, type);
-}
-
-static grpc_json_type json_reader_container_ends(void *userdata) {
-  json_reader_userdata *state = userdata;
-  stacked_container *container = state->top;
-
-  grpc_json_writer_container_ends(state->writer, container->type);
-  state->top = container->next;
-  gpr_free(container);
-  return state->top ? state->top->type : GRPC_JSON_TOP_LEVEL;
-}
-
-static void json_reader_set_key(void *userdata) {
-  json_reader_userdata *state = userdata;
-  json_reader_string_add_char(userdata, 0);
-
-  grpc_json_writer_object_key(state->writer, state->scratchpad);
-}
-
-static void json_reader_set_string(void *userdata) {
-  json_reader_userdata *state = userdata;
-  json_reader_string_add_char(userdata, 0);
-
-  grpc_json_writer_value_string(state->writer, state->scratchpad);
-}
-
-static int json_reader_set_number(void *userdata) {
-  json_reader_userdata *state = userdata;
-
-  grpc_json_writer_value_raw_with_len(state->writer, state->scratchpad,
-                                      state->string_len);
-
-  return 1;
-}
-
-static void json_reader_set_true(void *userdata) {
-  json_reader_userdata *state = userdata;
-
-  grpc_json_writer_value_raw_with_len(state->writer, "true", 4);
-}
-
-static void json_reader_set_false(void *userdata) {
-  json_reader_userdata *state = userdata;
-
-  grpc_json_writer_value_raw_with_len(state->writer, "false", 5);
-}
-
-static void json_reader_set_null(void *userdata) {
-  json_reader_userdata *state = userdata;
-
-  grpc_json_writer_value_raw_with_len(state->writer, "null", 4);
-}
-
-static grpc_json_reader_vtable reader_vtable = {
-    json_reader_string_clear,     json_reader_string_add_char,
-    json_reader_string_add_utf32, json_reader_read_char,
-    json_reader_container_begins, json_reader_container_ends,
-    json_reader_set_key,          json_reader_set_string,
-    json_reader_set_number,       json_reader_set_true,
-    json_reader_set_false,        json_reader_set_null};
-
-int rewrite(FILE *in, FILE *out, int indent) {
-  grpc_json_writer writer;
-  grpc_json_reader reader;
-  grpc_json_reader_status status;
-  json_writer_userdata writer_user;
-  json_reader_userdata reader_user;
-
-  reader_user.writer = &writer;
-  reader_user.in = in;
-  reader_user.top = NULL;
-  reader_user.scratchpad = NULL;
-  reader_user.string_len = 0;
-  reader_user.free_space = 0;
-  reader_user.allocated = 0;
-
-  writer_user.out = out;
-
-  grpc_json_writer_init(&writer, indent, &writer_vtable, &writer_user);
-  grpc_json_reader_init(&reader, &reader_vtable, &reader_user);
-
-  status = grpc_json_reader_run(&reader);
-
-  free(reader_user.scratchpad);
-  while (reader_user.top) {
-    stacked_container *container = reader_user.top;
-    reader_user.top = container->next;
-    free(container);
-  }
-
-  return status == GRPC_JSON_DONE;
-}
-
-int main(int argc, char **argv) {
-  int indent = 2;
-  gpr_cmdline *cl;
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_int(cl, "indent", NULL, &indent);
-  gpr_cmdline_parse(cl, argc, argv);
-  gpr_cmdline_destroy(cl);
-
-  return rewrite(stdin, stdout, indent) ? 0 : 1;
-}
diff --git a/test/core/json/json_rewrite.cc b/test/core/json/json_rewrite.cc
new file mode 100644
index 0000000..98e76e9
--- /dev/null
+++ b/test/core/json/json_rewrite.cc
@@ -0,0 +1,241 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/json/json_reader.h"
+#include "src/core/lib/json/json_writer.h"
+
+typedef struct json_writer_userdata {
+  FILE* out;
+} json_writer_userdata;
+
+typedef struct stacked_container {
+  grpc_json_type type;
+  struct stacked_container* next;
+} stacked_container;
+
+typedef struct json_reader_userdata {
+  FILE* in;
+  grpc_json_writer* writer;
+  char* scratchpad;
+  char* ptr;
+  size_t free_space;
+  size_t allocated;
+  size_t string_len;
+  stacked_container* top;
+} json_reader_userdata;
+
+static void json_writer_output_char(void* userdata, char c) {
+  json_writer_userdata* state = static_cast<json_writer_userdata*>(userdata);
+  fputc(c, state->out);
+}
+
+static void json_writer_output_string(void* userdata, const char* str) {
+  json_writer_userdata* state = static_cast<json_writer_userdata*>(userdata);
+  fputs(str, state->out);
+}
+
+static void json_writer_output_string_with_len(void* userdata, const char* str,
+                                               size_t len) {
+  json_writer_userdata* state = static_cast<json_writer_userdata*>(userdata);
+  fwrite(str, len, 1, state->out);
+}
+
+grpc_json_writer_vtable writer_vtable = {json_writer_output_char,
+                                         json_writer_output_string,
+                                         json_writer_output_string_with_len};
+
+static void check_string(json_reader_userdata* state, size_t needed) {
+  if (state->free_space >= needed) return;
+  needed -= state->free_space;
+  needed = (needed + 0xffu) & ~0xffu;
+  state->scratchpad = static_cast<char*>(
+      gpr_realloc(state->scratchpad, state->allocated + needed));
+  state->free_space += needed;
+  state->allocated += needed;
+}
+
+static void json_reader_string_clear(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  state->free_space = state->allocated;
+  state->string_len = 0;
+}
+
+static void json_reader_string_add_char(void* userdata, uint32_t c) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  check_string(state, 1);
+  GPR_ASSERT(c < 256);
+  state->scratchpad[state->string_len++] = (char)c;
+}
+
+static void json_reader_string_add_utf32(void* userdata, uint32_t c) {
+  if (c <= 0x7f) {
+    json_reader_string_add_char(userdata, c);
+  } else if (c <= 0x7ff) {
+    uint32_t b1 = 0xc0u | ((c >> 6u) & 0x1fu);
+    uint32_t b2 = 0x80u | (c & 0x3fu);
+    json_reader_string_add_char(userdata, b1);
+    json_reader_string_add_char(userdata, b2);
+  } else if (c <= 0xffffu) {
+    uint32_t b1 = 0xe0u | ((c >> 12u) & 0x0fu);
+    uint32_t b2 = 0x80u | ((c >> 6u) & 0x3fu);
+    uint32_t b3 = 0x80u | (c & 0x3fu);
+    json_reader_string_add_char(userdata, b1);
+    json_reader_string_add_char(userdata, b2);
+    json_reader_string_add_char(userdata, b3);
+  } else if (c <= 0x1fffffu) {
+    uint32_t b1 = 0xf0u | ((c >> 18u) & 0x07u);
+    uint32_t b2 = 0x80u | ((c >> 12u) & 0x3fu);
+    uint32_t b3 = 0x80u | ((c >> 6u) & 0x3fu);
+    uint32_t b4 = 0x80u | (c & 0x3fu);
+    json_reader_string_add_char(userdata, b1);
+    json_reader_string_add_char(userdata, b2);
+    json_reader_string_add_char(userdata, b3);
+    json_reader_string_add_char(userdata, b4);
+  }
+}
+
+static uint32_t json_reader_read_char(void* userdata) {
+  int r;
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  r = fgetc(state->in);
+  if (r == EOF) r = GRPC_JSON_READ_CHAR_EOF;
+  return (uint32_t)r;
+}
+
+static void json_reader_container_begins(void* userdata, grpc_json_type type) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  stacked_container* container =
+      static_cast<stacked_container*>(gpr_malloc(sizeof(stacked_container)));
+
+  container->type = type;
+  container->next = state->top;
+  state->top = container;
+
+  grpc_json_writer_container_begins(state->writer, type);
+}
+
+static grpc_json_type json_reader_container_ends(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  stacked_container* container = state->top;
+
+  grpc_json_writer_container_ends(state->writer, container->type);
+  state->top = container->next;
+  gpr_free(container);
+  return state->top ? state->top->type : GRPC_JSON_TOP_LEVEL;
+}
+
+static void json_reader_set_key(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  json_reader_string_add_char(userdata, 0);
+
+  grpc_json_writer_object_key(state->writer, state->scratchpad);
+}
+
+static void json_reader_set_string(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  json_reader_string_add_char(userdata, 0);
+
+  grpc_json_writer_value_string(state->writer, state->scratchpad);
+}
+
+static int json_reader_set_number(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  grpc_json_writer_value_raw_with_len(state->writer, state->scratchpad,
+                                      state->string_len);
+
+  return 1;
+}
+
+static void json_reader_set_true(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  grpc_json_writer_value_raw_with_len(state->writer, "true", 4);
+}
+
+static void json_reader_set_false(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  grpc_json_writer_value_raw_with_len(state->writer, "false", 5);
+}
+
+static void json_reader_set_null(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  grpc_json_writer_value_raw_with_len(state->writer, "null", 4);
+}
+
+static grpc_json_reader_vtable reader_vtable = {
+    json_reader_string_clear,     json_reader_string_add_char,
+    json_reader_string_add_utf32, json_reader_read_char,
+    json_reader_container_begins, json_reader_container_ends,
+    json_reader_set_key,          json_reader_set_string,
+    json_reader_set_number,       json_reader_set_true,
+    json_reader_set_false,        json_reader_set_null};
+
+int rewrite(FILE* in, FILE* out, int indent) {
+  grpc_json_writer writer;
+  grpc_json_reader reader;
+  grpc_json_reader_status status;
+  json_writer_userdata writer_user;
+  json_reader_userdata reader_user;
+
+  reader_user.writer = &writer;
+  reader_user.in = in;
+  reader_user.top = NULL;
+  reader_user.scratchpad = NULL;
+  reader_user.string_len = 0;
+  reader_user.free_space = 0;
+  reader_user.allocated = 0;
+
+  writer_user.out = out;
+
+  grpc_json_writer_init(&writer, indent, &writer_vtable, &writer_user);
+  grpc_json_reader_init(&reader, &reader_vtable, &reader_user);
+
+  status = grpc_json_reader_run(&reader);
+
+  free(reader_user.scratchpad);
+  while (reader_user.top) {
+    stacked_container* container = reader_user.top;
+    reader_user.top = container->next;
+    free(container);
+  }
+
+  return status == GRPC_JSON_DONE;
+}
+
+int main(int argc, char** argv) {
+  int indent = 2;
+  gpr_cmdline* cl;
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_int(cl, "indent", NULL, &indent);
+  gpr_cmdline_parse(cl, argc, argv);
+  gpr_cmdline_destroy(cl);
+
+  return rewrite(stdin, stdout, indent) ? 0 : 1;
+}
diff --git a/test/core/json/json_rewrite_test.c b/test/core/json/json_rewrite_test.c
deleted file mode 100644
index a654971..0000000
--- a/test/core/json/json_rewrite_test.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-#include "test/core/util/test_config.h"
-
-#include "src/core/lib/json/json_reader.h"
-#include "src/core/lib/json/json_writer.h"
-
-typedef struct json_writer_userdata { FILE *cmp; } json_writer_userdata;
-
-typedef struct stacked_container {
-  grpc_json_type type;
-  struct stacked_container *next;
-} stacked_container;
-
-typedef struct json_reader_userdata {
-  FILE *in;
-  grpc_json_writer *writer;
-  char *scratchpad;
-  char *ptr;
-  size_t free_space;
-  size_t allocated;
-  size_t string_len;
-  stacked_container *top;
-  int did_eagain;
-} json_reader_userdata;
-
-static void json_writer_output_char(void *userdata, char c) {
-  json_writer_userdata *state = userdata;
-  int cmp = fgetc(state->cmp);
-
-  /* treat CRLF as LF */
-  if (cmp == '\r' && c == '\n') {
-    cmp = fgetc(state->cmp);
-  }
-  GPR_ASSERT(cmp == c);
-}
-
-static void json_writer_output_string(void *userdata, const char *str) {
-  while (*str) {
-    json_writer_output_char(userdata, *str++);
-  }
-}
-
-static void json_writer_output_string_with_len(void *userdata, const char *str,
-                                               size_t len) {
-  size_t i;
-  for (i = 0; i < len; i++) {
-    json_writer_output_char(userdata, str[i]);
-  }
-}
-
-grpc_json_writer_vtable writer_vtable = {json_writer_output_char,
-                                         json_writer_output_string,
-                                         json_writer_output_string_with_len};
-
-static void check_string(json_reader_userdata *state, size_t needed) {
-  if (state->free_space >= needed) return;
-  needed -= state->free_space;
-  needed = (needed + 0xffu) & ~0xffu;
-  state->scratchpad = gpr_realloc(state->scratchpad, state->allocated + needed);
-  state->free_space += needed;
-  state->allocated += needed;
-}
-
-static void json_reader_string_clear(void *userdata) {
-  json_reader_userdata *state = userdata;
-  state->free_space = state->allocated;
-  state->string_len = 0;
-}
-
-static void json_reader_string_add_char(void *userdata, uint32_t c) {
-  json_reader_userdata *state = userdata;
-  check_string(state, 1);
-  GPR_ASSERT(c <= 256);
-  state->scratchpad[state->string_len++] = (char)c;
-}
-
-static void json_reader_string_add_utf32(void *userdata, uint32_t c) {
-  if (c <= 0x7f) {
-    json_reader_string_add_char(userdata, c);
-  } else if (c <= 0x7ffu) {
-    uint32_t b1 = 0xc0u | ((c >> 6u) & 0x1fu);
-    uint32_t b2 = 0x80u | (c & 0x3fu);
-    json_reader_string_add_char(userdata, b1);
-    json_reader_string_add_char(userdata, b2);
-  } else if (c <= 0xffffu) {
-    uint32_t b1 = 0xe0u | ((c >> 12u) & 0x0fu);
-    uint32_t b2 = 0x80u | ((c >> 6u) & 0x3fu);
-    uint32_t b3 = 0x80u | (c & 0x3fu);
-    json_reader_string_add_char(userdata, b1);
-    json_reader_string_add_char(userdata, b2);
-    json_reader_string_add_char(userdata, b3);
-  } else if (c <= 0x1fffffu) {
-    uint32_t b1 = 0xf0u | ((c >> 18u) & 0x07u);
-    uint32_t b2 = 0x80u | ((c >> 12u) & 0x3fu);
-    uint32_t b3 = 0x80u | ((c >> 6u) & 0x3fu);
-    uint32_t b4 = 0x80u | (c & 0x3fu);
-    json_reader_string_add_char(userdata, b1);
-    json_reader_string_add_char(userdata, b2);
-    json_reader_string_add_char(userdata, b3);
-    json_reader_string_add_char(userdata, b4);
-  }
-}
-
-static uint32_t json_reader_read_char(void *userdata) {
-  int r;
-  json_reader_userdata *state = userdata;
-
-  if (!state->did_eagain) {
-    state->did_eagain = 1;
-    return GRPC_JSON_READ_CHAR_EAGAIN;
-  }
-
-  state->did_eagain = 0;
-
-  r = fgetc(state->in);
-  if (r == EOF) r = GRPC_JSON_READ_CHAR_EOF;
-  return (uint32_t)r;
-}
-
-static void json_reader_container_begins(void *userdata, grpc_json_type type) {
-  json_reader_userdata *state = userdata;
-  stacked_container *container = gpr_malloc(sizeof(stacked_container));
-
-  container->type = type;
-  container->next = state->top;
-  state->top = container;
-
-  grpc_json_writer_container_begins(state->writer, type);
-}
-
-static grpc_json_type json_reader_container_ends(void *userdata) {
-  json_reader_userdata *state = userdata;
-  stacked_container *container = state->top;
-
-  grpc_json_writer_container_ends(state->writer, container->type);
-  state->top = container->next;
-  gpr_free(container);
-  return state->top ? state->top->type : GRPC_JSON_TOP_LEVEL;
-}
-
-static void json_reader_set_key(void *userdata) {
-  json_reader_userdata *state = userdata;
-  json_reader_string_add_char(userdata, 0);
-
-  grpc_json_writer_object_key(state->writer, state->scratchpad);
-}
-
-static void json_reader_set_string(void *userdata) {
-  json_reader_userdata *state = userdata;
-  json_reader_string_add_char(userdata, 0);
-
-  grpc_json_writer_value_string(state->writer, state->scratchpad);
-}
-
-static int json_reader_set_number(void *userdata) {
-  json_reader_userdata *state = userdata;
-
-  grpc_json_writer_value_raw_with_len(state->writer, state->scratchpad,
-                                      state->string_len);
-
-  return 1;
-}
-
-static void json_reader_set_true(void *userdata) {
-  json_reader_userdata *state = userdata;
-
-  grpc_json_writer_value_raw_with_len(state->writer, "true", 4);
-}
-
-static void json_reader_set_false(void *userdata) {
-  json_reader_userdata *state = userdata;
-
-  grpc_json_writer_value_raw_with_len(state->writer, "false", 5);
-}
-
-static void json_reader_set_null(void *userdata) {
-  json_reader_userdata *state = userdata;
-
-  grpc_json_writer_value_raw_with_len(state->writer, "null", 4);
-}
-
-static grpc_json_reader_vtable reader_vtable = {
-    json_reader_string_clear,     json_reader_string_add_char,
-    json_reader_string_add_utf32, json_reader_read_char,
-    json_reader_container_begins, json_reader_container_ends,
-    json_reader_set_key,          json_reader_set_string,
-    json_reader_set_number,       json_reader_set_true,
-    json_reader_set_false,        json_reader_set_null};
-
-int rewrite_and_compare(FILE *in, FILE *cmp, int indent) {
-  grpc_json_writer writer;
-  grpc_json_reader reader;
-  grpc_json_reader_status status;
-  json_writer_userdata writer_user;
-  json_reader_userdata reader_user;
-
-  GPR_ASSERT(in);
-  GPR_ASSERT(cmp);
-
-  reader_user.writer = &writer;
-  reader_user.in = in;
-  reader_user.top = NULL;
-  reader_user.scratchpad = NULL;
-  reader_user.string_len = 0;
-  reader_user.free_space = 0;
-  reader_user.allocated = 0;
-  reader_user.did_eagain = 0;
-
-  writer_user.cmp = cmp;
-
-  grpc_json_writer_init(&writer, indent, &writer_vtable, &writer_user);
-  grpc_json_reader_init(&reader, &reader_vtable, &reader_user);
-
-  do {
-    status = grpc_json_reader_run(&reader);
-  } while (status == GRPC_JSON_EAGAIN);
-
-  free(reader_user.scratchpad);
-  while (reader_user.top) {
-    stacked_container *container = reader_user.top;
-    reader_user.top = container->next;
-    free(container);
-  }
-
-  return status == GRPC_JSON_DONE;
-}
-
-typedef struct test_file {
-  const char *input;
-  const char *cmp;
-  int indent;
-} test_file;
-
-static test_file test_files[] = {
-    {"test/core/json/rewrite_test_input.json",
-     "test/core/json/rewrite_test_output_condensed.json", 0},
-    {"test/core/json/rewrite_test_input.json",
-     "test/core/json/rewrite_test_output_indented.json", 2},
-    {"test/core/json/rewrite_test_output_indented.json",
-     "test/core/json/rewrite_test_output_condensed.json", 0},
-    {"test/core/json/rewrite_test_output_condensed.json",
-     "test/core/json/rewrite_test_output_indented.json", 2},
-};
-
-void test_rewrites() {
-  unsigned i;
-
-  for (i = 0; i < GPR_ARRAY_SIZE(test_files); i++) {
-    test_file *test = test_files + i;
-    FILE *input = fopen(test->input, "rb");
-    FILE *cmp = fopen(test->cmp, "rb");
-    int status;
-    gpr_log(GPR_INFO, "Testing file %s against %s using indent=%i", test->input,
-            test->cmp, test->indent);
-    status = rewrite_and_compare(input, cmp, test->indent);
-    GPR_ASSERT(status);
-    fclose(input);
-    fclose(cmp);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_rewrites();
-  gpr_log(GPR_INFO, "json_rewrite_test success");
-  return 0;
-}
diff --git a/test/core/json/json_rewrite_test.cc b/test/core/json/json_rewrite_test.cc
new file mode 100644
index 0000000..47b4f01
--- /dev/null
+++ b/test/core/json/json_rewrite_test.cc
@@ -0,0 +1,294 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/test_config.h"
+
+#include "src/core/lib/json/json_reader.h"
+#include "src/core/lib/json/json_writer.h"
+
+typedef struct json_writer_userdata {
+  FILE* cmp;
+} json_writer_userdata;
+
+typedef struct stacked_container {
+  grpc_json_type type;
+  struct stacked_container* next;
+} stacked_container;
+
+typedef struct json_reader_userdata {
+  FILE* in;
+  grpc_json_writer* writer;
+  char* scratchpad;
+  char* ptr;
+  size_t free_space;
+  size_t allocated;
+  size_t string_len;
+  stacked_container* top;
+  int did_eagain;
+} json_reader_userdata;
+
+static void json_writer_output_char(void* userdata, char c) {
+  json_writer_userdata* state = static_cast<json_writer_userdata*>(userdata);
+  int cmp = fgetc(state->cmp);
+
+  /* treat CRLF as LF */
+  if (cmp == '\r' && c == '\n') {
+    cmp = fgetc(state->cmp);
+  }
+  GPR_ASSERT(cmp == c);
+}
+
+static void json_writer_output_string(void* userdata, const char* str) {
+  while (*str) {
+    json_writer_output_char(userdata, *str++);
+  }
+}
+
+static void json_writer_output_string_with_len(void* userdata, const char* str,
+                                               size_t len) {
+  size_t i;
+  for (i = 0; i < len; i++) {
+    json_writer_output_char(userdata, str[i]);
+  }
+}
+
+grpc_json_writer_vtable writer_vtable = {json_writer_output_char,
+                                         json_writer_output_string,
+                                         json_writer_output_string_with_len};
+
+static void check_string(json_reader_userdata* state, size_t needed) {
+  if (state->free_space >= needed) return;
+  needed -= state->free_space;
+  needed = (needed + 0xffu) & ~0xffu;
+  state->scratchpad = static_cast<char*>(
+      gpr_realloc(state->scratchpad, state->allocated + needed));
+  state->free_space += needed;
+  state->allocated += needed;
+}
+
+static void json_reader_string_clear(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  state->free_space = state->allocated;
+  state->string_len = 0;
+}
+
+static void json_reader_string_add_char(void* userdata, uint32_t c) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  check_string(state, 1);
+  GPR_ASSERT(c <= 256);
+  state->scratchpad[state->string_len++] = (char)c;
+}
+
+static void json_reader_string_add_utf32(void* userdata, uint32_t c) {
+  if (c <= 0x7f) {
+    json_reader_string_add_char(userdata, c);
+  } else if (c <= 0x7ffu) {
+    uint32_t b1 = 0xc0u | ((c >> 6u) & 0x1fu);
+    uint32_t b2 = 0x80u | (c & 0x3fu);
+    json_reader_string_add_char(userdata, b1);
+    json_reader_string_add_char(userdata, b2);
+  } else if (c <= 0xffffu) {
+    uint32_t b1 = 0xe0u | ((c >> 12u) & 0x0fu);
+    uint32_t b2 = 0x80u | ((c >> 6u) & 0x3fu);
+    uint32_t b3 = 0x80u | (c & 0x3fu);
+    json_reader_string_add_char(userdata, b1);
+    json_reader_string_add_char(userdata, b2);
+    json_reader_string_add_char(userdata, b3);
+  } else if (c <= 0x1fffffu) {
+    uint32_t b1 = 0xf0u | ((c >> 18u) & 0x07u);
+    uint32_t b2 = 0x80u | ((c >> 12u) & 0x3fu);
+    uint32_t b3 = 0x80u | ((c >> 6u) & 0x3fu);
+    uint32_t b4 = 0x80u | (c & 0x3fu);
+    json_reader_string_add_char(userdata, b1);
+    json_reader_string_add_char(userdata, b2);
+    json_reader_string_add_char(userdata, b3);
+    json_reader_string_add_char(userdata, b4);
+  }
+}
+
+static uint32_t json_reader_read_char(void* userdata) {
+  int r;
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  if (!state->did_eagain) {
+    state->did_eagain = 1;
+    return GRPC_JSON_READ_CHAR_EAGAIN;
+  }
+
+  state->did_eagain = 0;
+
+  r = fgetc(state->in);
+  if (r == EOF) r = GRPC_JSON_READ_CHAR_EOF;
+  return (uint32_t)r;
+}
+
+static void json_reader_container_begins(void* userdata, grpc_json_type type) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  stacked_container* container =
+      static_cast<stacked_container*>(gpr_malloc(sizeof(stacked_container)));
+
+  container->type = type;
+  container->next = state->top;
+  state->top = container;
+
+  grpc_json_writer_container_begins(state->writer, type);
+}
+
+static grpc_json_type json_reader_container_ends(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  stacked_container* container = state->top;
+
+  grpc_json_writer_container_ends(state->writer, container->type);
+  state->top = container->next;
+  gpr_free(container);
+  return state->top ? state->top->type : GRPC_JSON_TOP_LEVEL;
+}
+
+static void json_reader_set_key(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  json_reader_string_add_char(userdata, 0);
+
+  grpc_json_writer_object_key(state->writer, state->scratchpad);
+}
+
+static void json_reader_set_string(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+  json_reader_string_add_char(userdata, 0);
+
+  grpc_json_writer_value_string(state->writer, state->scratchpad);
+}
+
+static int json_reader_set_number(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  grpc_json_writer_value_raw_with_len(state->writer, state->scratchpad,
+                                      state->string_len);
+
+  return 1;
+}
+
+static void json_reader_set_true(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  grpc_json_writer_value_raw_with_len(state->writer, "true", 4);
+}
+
+static void json_reader_set_false(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  grpc_json_writer_value_raw_with_len(state->writer, "false", 5);
+}
+
+static void json_reader_set_null(void* userdata) {
+  json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
+
+  grpc_json_writer_value_raw_with_len(state->writer, "null", 4);
+}
+
+static grpc_json_reader_vtable reader_vtable = {
+    json_reader_string_clear,     json_reader_string_add_char,
+    json_reader_string_add_utf32, json_reader_read_char,
+    json_reader_container_begins, json_reader_container_ends,
+    json_reader_set_key,          json_reader_set_string,
+    json_reader_set_number,       json_reader_set_true,
+    json_reader_set_false,        json_reader_set_null};
+
+int rewrite_and_compare(FILE* in, FILE* cmp, int indent) {
+  grpc_json_writer writer;
+  grpc_json_reader reader;
+  grpc_json_reader_status status;
+  json_writer_userdata writer_user;
+  json_reader_userdata reader_user;
+
+  GPR_ASSERT(in);
+  GPR_ASSERT(cmp);
+
+  reader_user.writer = &writer;
+  reader_user.in = in;
+  reader_user.top = NULL;
+  reader_user.scratchpad = NULL;
+  reader_user.string_len = 0;
+  reader_user.free_space = 0;
+  reader_user.allocated = 0;
+  reader_user.did_eagain = 0;
+
+  writer_user.cmp = cmp;
+
+  grpc_json_writer_init(&writer, indent, &writer_vtable, &writer_user);
+  grpc_json_reader_init(&reader, &reader_vtable, &reader_user);
+
+  do {
+    status = grpc_json_reader_run(&reader);
+  } while (status == GRPC_JSON_EAGAIN);
+
+  free(reader_user.scratchpad);
+  while (reader_user.top) {
+    stacked_container* container = reader_user.top;
+    reader_user.top = container->next;
+    free(container);
+  }
+
+  return status == GRPC_JSON_DONE;
+}
+
+typedef struct test_file {
+  const char* input;
+  const char* cmp;
+  int indent;
+} test_file;
+
+static test_file test_files[] = {
+    {"test/core/json/rewrite_test_input.json",
+     "test/core/json/rewrite_test_output_condensed.json", 0},
+    {"test/core/json/rewrite_test_input.json",
+     "test/core/json/rewrite_test_output_indented.json", 2},
+    {"test/core/json/rewrite_test_output_indented.json",
+     "test/core/json/rewrite_test_output_condensed.json", 0},
+    {"test/core/json/rewrite_test_output_condensed.json",
+     "test/core/json/rewrite_test_output_indented.json", 2},
+};
+
+void test_rewrites() {
+  unsigned i;
+
+  for (i = 0; i < GPR_ARRAY_SIZE(test_files); i++) {
+    test_file* test = test_files + i;
+    FILE* input = fopen(test->input, "rb");
+    FILE* cmp = fopen(test->cmp, "rb");
+    int status;
+    gpr_log(GPR_INFO, "Testing file %s against %s using indent=%i", test->input,
+            test->cmp, test->indent);
+    status = rewrite_and_compare(input, cmp, test->indent);
+    GPR_ASSERT(status);
+    fclose(input);
+    fclose(cmp);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_rewrites();
+  gpr_log(GPR_INFO, "json_rewrite_test success");
+  return 0;
+}
diff --git a/test/core/json/json_stream_error_test.c b/test/core/json/json_stream_error_test.c
deleted file mode 100644
index 379cd5d..0000000
--- a/test/core/json/json_stream_error_test.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-#include "test/core/util/test_config.h"
-
-#include "src/core/lib/json/json_reader.h"
-#include "src/core/lib/json/json_writer.h"
-
-static int g_string_clear_once = 0;
-
-static void string_clear(void *userdata) {
-  GPR_ASSERT(!g_string_clear_once);
-  g_string_clear_once = 1;
-}
-
-static uint32_t read_char(void *userdata) { return GRPC_JSON_READ_CHAR_ERROR; }
-
-static grpc_json_reader_vtable reader_vtable = {
-    string_clear, NULL, NULL, read_char, NULL, NULL,
-    NULL,         NULL, NULL, NULL,      NULL, NULL};
-
-static void read_error() {
-  grpc_json_reader reader;
-  grpc_json_reader_status status;
-  grpc_json_reader_init(&reader, &reader_vtable, NULL);
-
-  status = grpc_json_reader_run(&reader);
-  GPR_ASSERT(status == GRPC_JSON_READ_ERROR);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  read_error();
-  gpr_log(GPR_INFO, "json_stream_error success");
-  return 0;
-}
diff --git a/test/core/json/json_stream_error_test.cc b/test/core/json/json_stream_error_test.cc
new file mode 100644
index 0000000..975ccd2
--- /dev/null
+++ b/test/core/json/json_stream_error_test.cc
@@ -0,0 +1,57 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/test_config.h"
+
+#include "src/core/lib/json/json_reader.h"
+#include "src/core/lib/json/json_writer.h"
+
+static int g_string_clear_once = 0;
+
+static void string_clear(void* userdata) {
+  GPR_ASSERT(!g_string_clear_once);
+  g_string_clear_once = 1;
+}
+
+static uint32_t read_char(void* userdata) { return GRPC_JSON_READ_CHAR_ERROR; }
+
+static grpc_json_reader_vtable reader_vtable = {
+    string_clear, NULL, NULL, read_char, NULL, NULL,
+    NULL,         NULL, NULL, NULL,      NULL, NULL};
+
+static void read_error() {
+  grpc_json_reader reader;
+  grpc_json_reader_status status;
+  grpc_json_reader_init(&reader, &reader_vtable, NULL);
+
+  status = grpc_json_reader_run(&reader);
+  GPR_ASSERT(status == GRPC_JSON_READ_ERROR);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  read_error();
+  gpr_log(GPR_INFO, "json_stream_error success");
+  return 0;
+}
diff --git a/test/core/json/json_test.c b/test/core/json/json_test.c
deleted file mode 100644
index bbc6f7a..0000000
--- a/test/core/json/json_test.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- *
- * Copyright 2015-2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/json/json.h"
-#include "src/core/lib/support/string.h"
-
-#include "test/core/util/test_config.h"
-
-typedef struct testing_pair {
-  const char *input;
-  const char *output;
-} testing_pair;
-
-static testing_pair testing_pairs[] = {
-    /* Testing valid parsing. */
-    /* Testing trivial parses, with de-indentation. */
-    {" 0 ", "0"},
-    {" 1 ", "1"},
-    {" \"    \" ", "\"    \""},
-    {" \"a\" ", "\"a\""},
-    {" true ", "true"},
-    /* Testing the parser's ability to decode trivial UTF-16. */
-    {"\"\\u0020\\\\\\u0010\\u000a\\u000D\"", "\" \\\\\\u0010\\n\\r\""},
-    /* Testing various UTF-8 sequences. */
-    {"\"ßâñć௵⇒\"", "\"\\u00df\\u00e2\\u00f1\\u0107\\u0bf5\\u21d2\""},
-    {"\"\\u00df\\u00e2\\u00f1\\u0107\\u0bf5\\u21d2\"",
-     "\"\\u00df\\u00e2\\u00f1\\u0107\\u0bf5\\u21d2\""},
-    /* Testing UTF-8 character "𝄞", U+11D1E. */
-    {"\"\xf0\x9d\x84\x9e\"", "\"\\ud834\\udd1e\""},
-    {"\"\\ud834\\udd1e\"", "\"\\ud834\\udd1e\""},
-    {"{\"\\ud834\\udd1e\":0}", "{\"\\ud834\\udd1e\":0}"},
-    /* Testing nested empty containers. */
-    {
-        " [ [ ] , { } , [ ] ] ", "[[],{},[]]",
-    },
-    /* Testing escapes and control chars in key strings. */
-    {" { \"\\u007f\x7f\\n\\r\\\"\\f\\b\\\\a , b\": 1, \"\": 0 } ",
-     "{\"\\u007f\\u007f\\n\\r\\\"\\f\\b\\\\a , b\":1,\"\":0}"},
-    /* Testing the writer's ability to cut off invalid UTF-8 sequences. */
-    {"\"abc\xf0\x9d\x24\"", "\"abc\""},
-    {"\"\xff\"", "\"\""},
-    /* Testing valid number parsing. */
-    {"[0, 42 , 0.0123, 123.456]", "[0,42,0.0123,123.456]"},
-    {"[1e4,-53.235e-31, 0.3e+3]", "[1e4,-53.235e-31,0.3e+3]"},
-    /* Testing keywords parsing. */
-    {"[true, false, null]", "[true,false,null]"},
-
-    /* Testing invalid parsing. */
-
-    /* Testing plain invalid things, exercising the state machine. */
-    {"\\", NULL},
-    {"nu ll", NULL},
-    {"{\"foo\": bar}", NULL},
-    {"{\"foo\": bar\"x\"}", NULL},
-    {"fals", NULL},
-    {"0,0 ", NULL},
-    {"\"foo\",[]", NULL},
-    /* Testing unterminated string. */
-    {"\"\\x", NULL},
-    /* Testing invalid UTF-16 number. */
-    {"\"\\u123x", NULL},
-    {"{\"\\u123x", NULL},
-    /* Testing imbalanced surrogate pairs. */
-    {"\"\\ud834f", NULL},
-    {"{\"\\ud834f\":0}", NULL},
-    {"\"\\ud834\\n", NULL},
-    {"{\"\\ud834\\n\":0}", NULL},
-    {"\"\\udd1ef", NULL},
-    {"{\"\\udd1ef\":0}", NULL},
-    {"\"\\ud834\\ud834\"", NULL},
-    {"{\"\\ud834\\ud834\"\":0}", NULL},
-    {"\"\\ud834\\u1234\"", NULL},
-    {"{\"\\ud834\\u1234\"\":0}", NULL},
-    {"\"\\ud834]\"", NULL},
-    {"{\"\\ud834]\"\":0}", NULL},
-    {"\"\\ud834 \"", NULL},
-    {"{\"\\ud834 \"\":0}", NULL},
-    {"\"\\ud834\\\\\"", NULL},
-    {"{\"\\ud834\\\\\"\":0}", NULL},
-    /* Testing embedded invalid whitechars. */
-    {"\"\n\"", NULL},
-    {"\"\t\"", NULL},
-    /* Testing empty json data. */
-    {"", NULL},
-    /* Testing extra characters after end of parsing. */
-    {"{},", NULL},
-    /* Testing imbalanced containers. */
-    {"{}}", NULL},
-    {"[]]", NULL},
-    {"{{}", NULL},
-    {"[[]", NULL},
-    {"[}", NULL},
-    {"{]", NULL},
-    /* Testing bad containers. */
-    {"{x}", NULL},
-    {"{x=0,y}", NULL},
-    /* Testing trailing comma. */
-    {"{,}", NULL},
-    {"[1,2,3,4,]", NULL},
-    {"{\"a\": 1, }", NULL},
-    /* Testing after-ending characters. */
-    {"{}x", NULL},
-    /* Testing having a key syntax in an array. */
-    {"[\"x\":0]", NULL},
-    /* Testing invalid numbers. */
-    {"1.", NULL},
-    {"1e", NULL},
-    {".12", NULL},
-    {"1.x", NULL},
-    {"1.12x", NULL},
-    {"1ex", NULL},
-    {"1e12x", NULL},
-    {".12x", NULL},
-    {"000", NULL},
-};
-
-static void test_pairs() {
-  unsigned i;
-
-  for (i = 0; i < GPR_ARRAY_SIZE(testing_pairs); i++) {
-    testing_pair *pair = testing_pairs + i;
-    char *scratchpad = gpr_strdup(pair->input);
-    grpc_json *json;
-
-    gpr_log(GPR_INFO, "parsing string %i - should %s", i,
-            pair->output ? "succeed" : "fail");
-    json = grpc_json_parse_string(scratchpad);
-
-    if (pair->output) {
-      char *output;
-
-      GPR_ASSERT(json);
-      output = grpc_json_dump_to_string(json, 0);
-      GPR_ASSERT(output);
-      gpr_log(GPR_INFO, "succeeded with output = %s", output);
-      GPR_ASSERT(strcmp(output, pair->output) == 0);
-
-      grpc_json_destroy(json);
-      gpr_free(output);
-    } else {
-      gpr_log(GPR_INFO, "failed");
-      GPR_ASSERT(!json);
-    }
-
-    gpr_free(scratchpad);
-  }
-}
-
-static void test_atypical() {
-  char *scratchpad = gpr_strdup("[[],[],[]]");
-  grpc_json *json = grpc_json_parse_string(scratchpad);
-  grpc_json *brother;
-
-  GPR_ASSERT(json);
-  GPR_ASSERT(json->child);
-  brother = json->child->next;
-  grpc_json_destroy(json->child);
-  GPR_ASSERT(json->child == brother);
-  grpc_json_destroy(json->child->next);
-  grpc_json_destroy(json);
-  gpr_free(scratchpad);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_pairs();
-  test_atypical();
-  gpr_log(GPR_INFO, "json_test success");
-  return 0;
-}
diff --git a/test/core/json/json_test.cc b/test/core/json/json_test.cc
new file mode 100644
index 0000000..9e4d351
--- /dev/null
+++ b/test/core/json/json_test.cc
@@ -0,0 +1,192 @@
+/*
+ *
+ * Copyright 2015-2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/support/string.h"
+
+#include "test/core/util/test_config.h"
+
+typedef struct testing_pair {
+  const char* input;
+  const char* output;
+} testing_pair;
+
+static testing_pair testing_pairs[] = {
+    /* Testing valid parsing. */
+    /* Testing trivial parses, with de-indentation. */
+    {" 0 ", "0"},
+    {" 1 ", "1"},
+    {" \"    \" ", "\"    \""},
+    {" \"a\" ", "\"a\""},
+    {" true ", "true"},
+    /* Testing the parser's ability to decode trivial UTF-16. */
+    {"\"\\u0020\\\\\\u0010\\u000a\\u000D\"", "\" \\\\\\u0010\\n\\r\""},
+    /* Testing various UTF-8 sequences. */
+    {"\"ßâñć௵⇒\"", "\"\\u00df\\u00e2\\u00f1\\u0107\\u0bf5\\u21d2\""},
+    {"\"\\u00df\\u00e2\\u00f1\\u0107\\u0bf5\\u21d2\"",
+     "\"\\u00df\\u00e2\\u00f1\\u0107\\u0bf5\\u21d2\""},
+    /* Testing UTF-8 character "𝄞", U+11D1E. */
+    {"\"\xf0\x9d\x84\x9e\"", "\"\\ud834\\udd1e\""},
+    {"\"\\ud834\\udd1e\"", "\"\\ud834\\udd1e\""},
+    {"{\"\\ud834\\udd1e\":0}", "{\"\\ud834\\udd1e\":0}"},
+    /* Testing nested empty containers. */
+    {
+        " [ [ ] , { } , [ ] ] ",
+        "[[],{},[]]",
+    },
+    /* Testing escapes and control chars in key strings. */
+    {" { \"\\u007f\x7f\\n\\r\\\"\\f\\b\\\\a , b\": 1, \"\": 0 } ",
+     "{\"\\u007f\\u007f\\n\\r\\\"\\f\\b\\\\a , b\":1,\"\":0}"},
+    /* Testing the writer's ability to cut off invalid UTF-8 sequences. */
+    {"\"abc\xf0\x9d\x24\"", "\"abc\""},
+    {"\"\xff\"", "\"\""},
+    /* Testing valid number parsing. */
+    {"[0, 42 , 0.0123, 123.456]", "[0,42,0.0123,123.456]"},
+    {"[1e4,-53.235e-31, 0.3e+3]", "[1e4,-53.235e-31,0.3e+3]"},
+    /* Testing keywords parsing. */
+    {"[true, false, null]", "[true,false,null]"},
+
+    /* Testing invalid parsing. */
+
+    /* Testing plain invalid things, exercising the state machine. */
+    {"\\", NULL},
+    {"nu ll", NULL},
+    {"{\"foo\": bar}", NULL},
+    {"{\"foo\": bar\"x\"}", NULL},
+    {"fals", NULL},
+    {"0,0 ", NULL},
+    {"\"foo\",[]", NULL},
+    /* Testing unterminated string. */
+    {"\"\\x", NULL},
+    /* Testing invalid UTF-16 number. */
+    {"\"\\u123x", NULL},
+    {"{\"\\u123x", NULL},
+    /* Testing imbalanced surrogate pairs. */
+    {"\"\\ud834f", NULL},
+    {"{\"\\ud834f\":0}", NULL},
+    {"\"\\ud834\\n", NULL},
+    {"{\"\\ud834\\n\":0}", NULL},
+    {"\"\\udd1ef", NULL},
+    {"{\"\\udd1ef\":0}", NULL},
+    {"\"\\ud834\\ud834\"", NULL},
+    {"{\"\\ud834\\ud834\"\":0}", NULL},
+    {"\"\\ud834\\u1234\"", NULL},
+    {"{\"\\ud834\\u1234\"\":0}", NULL},
+    {"\"\\ud834]\"", NULL},
+    {"{\"\\ud834]\"\":0}", NULL},
+    {"\"\\ud834 \"", NULL},
+    {"{\"\\ud834 \"\":0}", NULL},
+    {"\"\\ud834\\\\\"", NULL},
+    {"{\"\\ud834\\\\\"\":0}", NULL},
+    /* Testing embedded invalid whitechars. */
+    {"\"\n\"", NULL},
+    {"\"\t\"", NULL},
+    /* Testing empty json data. */
+    {"", NULL},
+    /* Testing extra characters after end of parsing. */
+    {"{},", NULL},
+    /* Testing imbalanced containers. */
+    {"{}}", NULL},
+    {"[]]", NULL},
+    {"{{}", NULL},
+    {"[[]", NULL},
+    {"[}", NULL},
+    {"{]", NULL},
+    /* Testing bad containers. */
+    {"{x}", NULL},
+    {"{x=0,y}", NULL},
+    /* Testing trailing comma. */
+    {"{,}", NULL},
+    {"[1,2,3,4,]", NULL},
+    {"{\"a\": 1, }", NULL},
+    /* Testing after-ending characters. */
+    {"{}x", NULL},
+    /* Testing having a key syntax in an array. */
+    {"[\"x\":0]", NULL},
+    /* Testing invalid numbers. */
+    {"1.", NULL},
+    {"1e", NULL},
+    {".12", NULL},
+    {"1.x", NULL},
+    {"1.12x", NULL},
+    {"1ex", NULL},
+    {"1e12x", NULL},
+    {".12x", NULL},
+    {"000", NULL},
+};
+
+static void test_pairs() {
+  unsigned i;
+
+  for (i = 0; i < GPR_ARRAY_SIZE(testing_pairs); i++) {
+    testing_pair* pair = testing_pairs + i;
+    char* scratchpad = gpr_strdup(pair->input);
+    grpc_json* json;
+
+    gpr_log(GPR_INFO, "parsing string %i - should %s", i,
+            pair->output ? "succeed" : "fail");
+    json = grpc_json_parse_string(scratchpad);
+
+    if (pair->output) {
+      char* output;
+
+      GPR_ASSERT(json);
+      output = grpc_json_dump_to_string(json, 0);
+      GPR_ASSERT(output);
+      gpr_log(GPR_INFO, "succeeded with output = %s", output);
+      GPR_ASSERT(strcmp(output, pair->output) == 0);
+
+      grpc_json_destroy(json);
+      gpr_free(output);
+    } else {
+      gpr_log(GPR_INFO, "failed");
+      GPR_ASSERT(!json);
+    }
+
+    gpr_free(scratchpad);
+  }
+}
+
+static void test_atypical() {
+  char* scratchpad = gpr_strdup("[[],[],[]]");
+  grpc_json* json = grpc_json_parse_string(scratchpad);
+  grpc_json* brother;
+
+  GPR_ASSERT(json);
+  GPR_ASSERT(json->child);
+  brother = json->child->next;
+  grpc_json_destroy(json->child);
+  GPR_ASSERT(json->child == brother);
+  grpc_json_destroy(json->child->next);
+  grpc_json_destroy(json);
+  gpr_free(scratchpad);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_pairs();
+  test_atypical();
+  gpr_log(GPR_INFO, "json_test success");
+  return 0;
+}
diff --git a/test/core/memory_usage/client.c b/test/core/memory_usage/client.c
deleted file mode 100644
index 6392554..0000000
--- a/test/core/memory_usage/client.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/byte_buffer.h>
-#include <grpc/byte_buffer_reader.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/cmdline.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/util/memory_counters.h"
-#include "test/core/util/test_config.h"
-
-static grpc_channel *channel;
-static grpc_completion_queue *cq;
-static grpc_op metadata_ops[2];
-static grpc_op status_ops[2];
-static grpc_op snapshot_ops[6];
-static grpc_op *op;
-
-typedef struct {
-  grpc_call *call;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_status_code status;
-  grpc_slice details;
-  grpc_metadata_array trailing_metadata_recv;
-} fling_call;
-
-// Statically allocate call data structs. Enough to accomodate 10000 ping-pong
-// calls and 1 extra for the snapshot calls.
-static fling_call calls[10001];
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-// A call is intentionally divided into two steps. First step is to initiate a
-// call (i.e send and recv metadata). A call is outstanding after we initated,
-// so we can measure the call memory usage.
-static void init_ping_pong_request(int call_idx) {
-  grpc_metadata_array_init(&calls[call_idx].initial_metadata_recv);
-
-  memset(metadata_ops, 0, sizeof(metadata_ops));
-  op = metadata_ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &calls[call_idx].initial_metadata_recv;
-  op++;
-
-  grpc_slice hostname = grpc_slice_from_static_string("localhost");
-  calls[call_idx].call = grpc_channel_create_call(
-      channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-      grpc_slice_from_static_string("/Reflector/reflectUnary"), &hostname,
-      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(calls[call_idx].call,
-                                                   metadata_ops,
-                                                   (size_t)(op - metadata_ops),
-                                                   tag(call_idx), NULL));
-  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-}
-
-// Second step is to finish the call (i.e recv status) and destroy the call.
-static void finish_ping_pong_request(int call_idx) {
-  grpc_metadata_array_init(&calls[call_idx].trailing_metadata_recv);
-
-  memset(status_ops, 0, sizeof(status_ops));
-  op = status_ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata =
-      &calls[call_idx].trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &calls[call_idx].status;
-  op->data.recv_status_on_client.status_details = &calls[call_idx].details;
-  op++;
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(calls[call_idx].call,
-                                                   status_ops,
-                                                   (size_t)(op - status_ops),
-                                                   tag(call_idx), NULL));
-  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  grpc_metadata_array_destroy(&calls[call_idx].initial_metadata_recv);
-  grpc_metadata_array_destroy(&calls[call_idx].trailing_metadata_recv);
-  grpc_slice_unref(calls[call_idx].details);
-  grpc_call_unref(calls[call_idx].call);
-  calls[call_idx].call = NULL;
-}
-
-static struct grpc_memory_counters send_snapshot_request(int call_idx,
-                                                         grpc_slice call_type) {
-  grpc_metadata_array_init(&calls[call_idx].initial_metadata_recv);
-  grpc_metadata_array_init(&calls[call_idx].trailing_metadata_recv);
-
-  grpc_byte_buffer *response_payload_recv = NULL;
-  memset(snapshot_ops, 0, sizeof(snapshot_ops));
-  op = snapshot_ops;
-
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
-  op++;
-  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata =
-      &calls[call_idx].initial_metadata_recv;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &response_payload_recv;
-  op++;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata =
-      &calls[call_idx].trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &calls[call_idx].status;
-  op->data.recv_status_on_client.status_details = &calls[call_idx].details;
-  op++;
-
-  grpc_slice hostname = grpc_slice_from_static_string("localhost");
-  calls[call_idx].call = grpc_channel_create_call(
-      channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq, call_type, &hostname,
-      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(
-                                 calls[call_idx].call, snapshot_ops,
-                                 (size_t)(op - snapshot_ops), (void *)0, NULL));
-  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-
-  grpc_byte_buffer_reader reader;
-  grpc_byte_buffer_reader_init(&reader, response_payload_recv);
-  grpc_slice response = grpc_byte_buffer_reader_readall(&reader);
-
-  struct grpc_memory_counters snapshot;
-  snapshot.total_size_absolute =
-      ((struct grpc_memory_counters *)GRPC_SLICE_START_PTR(response))
-          ->total_size_absolute;
-  snapshot.total_allocs_absolute =
-      ((struct grpc_memory_counters *)GRPC_SLICE_START_PTR(response))
-          ->total_allocs_absolute;
-  snapshot.total_size_relative =
-      ((struct grpc_memory_counters *)GRPC_SLICE_START_PTR(response))
-          ->total_size_relative;
-  snapshot.total_allocs_relative =
-      ((struct grpc_memory_counters *)GRPC_SLICE_START_PTR(response))
-          ->total_allocs_relative;
-
-  grpc_metadata_array_destroy(&calls[call_idx].initial_metadata_recv);
-  grpc_metadata_array_destroy(&calls[call_idx].trailing_metadata_recv);
-  grpc_slice_unref(response);
-  grpc_byte_buffer_reader_destroy(&reader);
-  grpc_byte_buffer_destroy(response_payload_recv);
-  grpc_slice_unref(calls[call_idx].details);
-  calls[call_idx].details = grpc_empty_slice();
-  grpc_call_unref(calls[call_idx].call);
-  calls[call_idx].call = NULL;
-
-  return snapshot;
-}
-
-int main(int argc, char **argv) {
-  grpc_memory_counters_init();
-  grpc_slice slice = grpc_slice_from_copied_string("x");
-  char *fake_argv[1];
-
-  char *target = "localhost:443";
-  gpr_cmdline *cl;
-  grpc_event event;
-
-  grpc_init();
-
-  GPR_ASSERT(argc >= 1);
-  fake_argv[0] = argv[0];
-  grpc_test_init(1, fake_argv);
-
-  int warmup_iterations = 100;
-  int benchmark_iterations = 1000;
-
-  cl = gpr_cmdline_create("memory profiling client");
-  gpr_cmdline_add_string(cl, "target", "Target host:port", &target);
-  gpr_cmdline_add_int(cl, "warmup", "Warmup iterations", &warmup_iterations);
-  gpr_cmdline_add_int(cl, "benchmark", "Benchmark iterations",
-                      &benchmark_iterations);
-  gpr_cmdline_parse(cl, argc, argv);
-  gpr_cmdline_destroy(cl);
-
-  for (size_t k = 0; k < GPR_ARRAY_SIZE(calls); k++) {
-    calls[k].details = grpc_empty_slice();
-  }
-
-  cq = grpc_completion_queue_create_for_next(NULL);
-
-  struct grpc_memory_counters client_channel_start =
-      grpc_memory_counters_snapshot();
-  channel = grpc_insecure_channel_create(target, NULL, NULL);
-
-  int call_idx = 0;
-
-  struct grpc_memory_counters before_server_create = send_snapshot_request(
-      0, grpc_slice_from_static_string("Reflector/GetBeforeSvrCreation"));
-  struct grpc_memory_counters after_server_create = send_snapshot_request(
-      0, grpc_slice_from_static_string("Reflector/GetAfterSvrCreation"));
-
-  // warmup period
-  for (int i = 0; i < warmup_iterations; i++) {
-    send_snapshot_request(
-        0, grpc_slice_from_static_string("Reflector/SimpleSnapshot"));
-  }
-
-  for (call_idx = 0; call_idx < warmup_iterations; ++call_idx) {
-    init_ping_pong_request(call_idx + 1);
-  }
-
-  struct grpc_memory_counters server_benchmark_calls_start =
-      send_snapshot_request(
-          0, grpc_slice_from_static_string("Reflector/SimpleSnapshot"));
-
-  struct grpc_memory_counters client_benchmark_calls_start =
-      grpc_memory_counters_snapshot();
-
-  // benchmark period
-  for (; call_idx < warmup_iterations + benchmark_iterations; ++call_idx) {
-    init_ping_pong_request(call_idx + 1);
-  }
-
-  struct grpc_memory_counters client_calls_inflight =
-      grpc_memory_counters_snapshot();
-
-  struct grpc_memory_counters server_calls_inflight = send_snapshot_request(
-      0, grpc_slice_from_static_string("Reflector/DestroyCalls"));
-
-  do {
-    event = grpc_completion_queue_next(
-        cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                         gpr_time_from_micros(10000, GPR_TIMESPAN)),
-        NULL);
-  } while (event.type != GRPC_QUEUE_TIMEOUT);
-
-  // second step - recv status and destroy call
-  for (call_idx = 0; call_idx < warmup_iterations + benchmark_iterations;
-       ++call_idx) {
-    finish_ping_pong_request(call_idx + 1);
-  }
-
-  struct grpc_memory_counters server_calls_end = send_snapshot_request(
-      0, grpc_slice_from_static_string("Reflector/SimpleSnapshot"));
-
-  struct grpc_memory_counters client_channel_end =
-      grpc_memory_counters_snapshot();
-
-  grpc_channel_destroy(channel);
-  grpc_completion_queue_shutdown(cq);
-
-  do {
-    event = grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME),
-                                       NULL);
-  } while (event.type != GRPC_QUEUE_SHUTDOWN);
-  grpc_slice_unref(slice);
-
-  grpc_completion_queue_destroy(cq);
-  grpc_shutdown();
-
-  gpr_log(GPR_INFO, "---------client stats--------");
-  gpr_log(GPR_INFO, "client call memory usage: %f bytes per call",
-          (double)(client_calls_inflight.total_size_relative -
-                   client_benchmark_calls_start.total_size_relative) /
-              benchmark_iterations);
-  gpr_log(GPR_INFO, "client channel memory usage %zi bytes",
-          client_channel_end.total_size_relative -
-              client_channel_start.total_size_relative);
-
-  gpr_log(GPR_INFO, "---------server stats--------");
-  gpr_log(GPR_INFO, "server create: %zi bytes",
-          after_server_create.total_size_relative -
-              before_server_create.total_size_relative);
-  gpr_log(GPR_INFO, "server call memory usage: %f bytes per call",
-          (double)(server_calls_inflight.total_size_relative -
-                   server_benchmark_calls_start.total_size_relative) /
-              benchmark_iterations);
-  gpr_log(GPR_INFO, "server channel memory usage %zi bytes",
-          server_calls_end.total_size_relative -
-              after_server_create.total_size_relative);
-
-  const char *csv_file = "memory_usage.csv";
-  FILE *csv = fopen(csv_file, "w");
-  if (csv) {
-    char *env_build = gpr_getenv("BUILD_NUMBER");
-    char *env_job = gpr_getenv("JOB_NAME");
-    fprintf(csv, "%f,%zi,%zi,%f,%zi,%s,%s\n",
-            (double)(client_calls_inflight.total_size_relative -
-                     client_benchmark_calls_start.total_size_relative) /
-                benchmark_iterations,
-            client_channel_end.total_size_relative -
-                client_channel_start.total_size_relative,
-            after_server_create.total_size_relative -
-                before_server_create.total_size_relative,
-            (double)(server_calls_inflight.total_size_relative -
-                     server_benchmark_calls_start.total_size_relative) /
-                benchmark_iterations,
-            server_calls_end.total_size_relative -
-                after_server_create.total_size_relative,
-            env_build == NULL ? "" : env_build, env_job == NULL ? "" : env_job);
-    fclose(csv);
-    gpr_log(GPR_INFO, "Summary written to %s", csv_file);
-  }
-
-  grpc_memory_counters_destroy();
-  return 0;
-}
diff --git a/test/core/memory_usage/client.cc b/test/core/memory_usage/client.cc
new file mode 100644
index 0000000..74ec4b0
--- /dev/null
+++ b/test/core/memory_usage/client.cc
@@ -0,0 +1,330 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/util/memory_counters.h"
+#include "test/core/util/test_config.h"
+
+static grpc_channel* channel;
+static grpc_completion_queue* cq;
+static grpc_op metadata_ops[2];
+static grpc_op status_ops[2];
+static grpc_op snapshot_ops[6];
+static grpc_op* op;
+
+typedef struct {
+  grpc_call* call;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_status_code status;
+  grpc_slice details;
+  grpc_metadata_array trailing_metadata_recv;
+} fling_call;
+
+// Statically allocate call data structs. Enough to accomodate 10000 ping-pong
+// calls and 1 extra for the snapshot calls.
+static fling_call calls[10001];
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+// A call is intentionally divided into two steps. First step is to initiate a
+// call (i.e send and recv metadata). A call is outstanding after we initated,
+// so we can measure the call memory usage.
+static void init_ping_pong_request(int call_idx) {
+  grpc_metadata_array_init(&calls[call_idx].initial_metadata_recv);
+
+  memset(metadata_ops, 0, sizeof(metadata_ops));
+  op = metadata_ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &calls[call_idx].initial_metadata_recv;
+  op++;
+
+  grpc_slice hostname = grpc_slice_from_static_string("localhost");
+  calls[call_idx].call = grpc_channel_create_call(
+      channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+      grpc_slice_from_static_string("/Reflector/reflectUnary"), &hostname,
+      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(calls[call_idx].call,
+                                                   metadata_ops,
+                                                   (size_t)(op - metadata_ops),
+                                                   tag(call_idx), NULL));
+  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+}
+
+// Second step is to finish the call (i.e recv status) and destroy the call.
+static void finish_ping_pong_request(int call_idx) {
+  grpc_metadata_array_init(&calls[call_idx].trailing_metadata_recv);
+
+  memset(status_ops, 0, sizeof(status_ops));
+  op = status_ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata =
+      &calls[call_idx].trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &calls[call_idx].status;
+  op->data.recv_status_on_client.status_details = &calls[call_idx].details;
+  op++;
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(calls[call_idx].call,
+                                                   status_ops,
+                                                   (size_t)(op - status_ops),
+                                                   tag(call_idx), NULL));
+  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  grpc_metadata_array_destroy(&calls[call_idx].initial_metadata_recv);
+  grpc_metadata_array_destroy(&calls[call_idx].trailing_metadata_recv);
+  grpc_slice_unref(calls[call_idx].details);
+  grpc_call_unref(calls[call_idx].call);
+  calls[call_idx].call = NULL;
+}
+
+static struct grpc_memory_counters send_snapshot_request(int call_idx,
+                                                         grpc_slice call_type) {
+  grpc_metadata_array_init(&calls[call_idx].initial_metadata_recv);
+  grpc_metadata_array_init(&calls[call_idx].trailing_metadata_recv);
+
+  grpc_byte_buffer* response_payload_recv = NULL;
+  memset(snapshot_ops, 0, sizeof(snapshot_ops));
+  op = snapshot_ops;
+
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY;
+  op++;
+  op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata =
+      &calls[call_idx].initial_metadata_recv;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &response_payload_recv;
+  op++;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata =
+      &calls[call_idx].trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &calls[call_idx].status;
+  op->data.recv_status_on_client.status_details = &calls[call_idx].details;
+  op++;
+
+  grpc_slice hostname = grpc_slice_from_static_string("localhost");
+  calls[call_idx].call = grpc_channel_create_call(
+      channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq, call_type, &hostname,
+      gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(
+                                 calls[call_idx].call, snapshot_ops,
+                                 (size_t)(op - snapshot_ops), (void*)0, NULL));
+  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+
+  grpc_byte_buffer_reader reader;
+  grpc_byte_buffer_reader_init(&reader, response_payload_recv);
+  grpc_slice response = grpc_byte_buffer_reader_readall(&reader);
+
+  struct grpc_memory_counters snapshot;
+  snapshot.total_size_absolute =
+      ((struct grpc_memory_counters*)GRPC_SLICE_START_PTR(response))
+          ->total_size_absolute;
+  snapshot.total_allocs_absolute =
+      ((struct grpc_memory_counters*)GRPC_SLICE_START_PTR(response))
+          ->total_allocs_absolute;
+  snapshot.total_size_relative =
+      ((struct grpc_memory_counters*)GRPC_SLICE_START_PTR(response))
+          ->total_size_relative;
+  snapshot.total_allocs_relative =
+      ((struct grpc_memory_counters*)GRPC_SLICE_START_PTR(response))
+          ->total_allocs_relative;
+
+  grpc_metadata_array_destroy(&calls[call_idx].initial_metadata_recv);
+  grpc_metadata_array_destroy(&calls[call_idx].trailing_metadata_recv);
+  grpc_slice_unref(response);
+  grpc_byte_buffer_reader_destroy(&reader);
+  grpc_byte_buffer_destroy(response_payload_recv);
+  grpc_slice_unref(calls[call_idx].details);
+  calls[call_idx].details = grpc_empty_slice();
+  grpc_call_unref(calls[call_idx].call);
+  calls[call_idx].call = NULL;
+
+  return snapshot;
+}
+
+int main(int argc, char** argv) {
+  grpc_memory_counters_init();
+  grpc_slice slice = grpc_slice_from_copied_string("x");
+  char* fake_argv[1];
+
+  const char* target = "localhost:443";
+  gpr_cmdline* cl;
+  grpc_event event;
+
+  grpc_init();
+
+  GPR_ASSERT(argc >= 1);
+  fake_argv[0] = argv[0];
+  grpc_test_init(1, fake_argv);
+
+  int warmup_iterations = 100;
+  int benchmark_iterations = 1000;
+
+  cl = gpr_cmdline_create("memory profiling client");
+  gpr_cmdline_add_string(cl, "target", "Target host:port", &target);
+  gpr_cmdline_add_int(cl, "warmup", "Warmup iterations", &warmup_iterations);
+  gpr_cmdline_add_int(cl, "benchmark", "Benchmark iterations",
+                      &benchmark_iterations);
+  gpr_cmdline_parse(cl, argc, argv);
+  gpr_cmdline_destroy(cl);
+
+  for (size_t k = 0; k < GPR_ARRAY_SIZE(calls); k++) {
+    calls[k].details = grpc_empty_slice();
+  }
+
+  cq = grpc_completion_queue_create_for_next(NULL);
+
+  struct grpc_memory_counters client_channel_start =
+      grpc_memory_counters_snapshot();
+  channel = grpc_insecure_channel_create(target, NULL, NULL);
+
+  int call_idx = 0;
+
+  struct grpc_memory_counters before_server_create = send_snapshot_request(
+      0, grpc_slice_from_static_string("Reflector/GetBeforeSvrCreation"));
+  struct grpc_memory_counters after_server_create = send_snapshot_request(
+      0, grpc_slice_from_static_string("Reflector/GetAfterSvrCreation"));
+
+  // warmup period
+  for (int i = 0; i < warmup_iterations; i++) {
+    send_snapshot_request(
+        0, grpc_slice_from_static_string("Reflector/SimpleSnapshot"));
+  }
+
+  for (call_idx = 0; call_idx < warmup_iterations; ++call_idx) {
+    init_ping_pong_request(call_idx + 1);
+  }
+
+  struct grpc_memory_counters server_benchmark_calls_start =
+      send_snapshot_request(
+          0, grpc_slice_from_static_string("Reflector/SimpleSnapshot"));
+
+  struct grpc_memory_counters client_benchmark_calls_start =
+      grpc_memory_counters_snapshot();
+
+  // benchmark period
+  for (; call_idx < warmup_iterations + benchmark_iterations; ++call_idx) {
+    init_ping_pong_request(call_idx + 1);
+  }
+
+  struct grpc_memory_counters client_calls_inflight =
+      grpc_memory_counters_snapshot();
+
+  struct grpc_memory_counters server_calls_inflight = send_snapshot_request(
+      0, grpc_slice_from_static_string("Reflector/DestroyCalls"));
+
+  do {
+    event = grpc_completion_queue_next(
+        cq,
+        gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                     gpr_time_from_micros(10000, GPR_TIMESPAN)),
+        NULL);
+  } while (event.type != GRPC_QUEUE_TIMEOUT);
+
+  // second step - recv status and destroy call
+  for (call_idx = 0; call_idx < warmup_iterations + benchmark_iterations;
+       ++call_idx) {
+    finish_ping_pong_request(call_idx + 1);
+  }
+
+  struct grpc_memory_counters server_calls_end = send_snapshot_request(
+      0, grpc_slice_from_static_string("Reflector/SimpleSnapshot"));
+
+  struct grpc_memory_counters client_channel_end =
+      grpc_memory_counters_snapshot();
+
+  grpc_channel_destroy(channel);
+  grpc_completion_queue_shutdown(cq);
+
+  do {
+    event = grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME),
+                                       NULL);
+  } while (event.type != GRPC_QUEUE_SHUTDOWN);
+  grpc_slice_unref(slice);
+
+  grpc_completion_queue_destroy(cq);
+  grpc_shutdown();
+
+  gpr_log(GPR_INFO, "---------client stats--------");
+  gpr_log(GPR_INFO, "client call memory usage: %f bytes per call",
+          (double)(client_calls_inflight.total_size_relative -
+                   client_benchmark_calls_start.total_size_relative) /
+              benchmark_iterations);
+  gpr_log(GPR_INFO, "client channel memory usage %zi bytes",
+          client_channel_end.total_size_relative -
+              client_channel_start.total_size_relative);
+
+  gpr_log(GPR_INFO, "---------server stats--------");
+  gpr_log(GPR_INFO, "server create: %zi bytes",
+          after_server_create.total_size_relative -
+              before_server_create.total_size_relative);
+  gpr_log(GPR_INFO, "server call memory usage: %f bytes per call",
+          (double)(server_calls_inflight.total_size_relative -
+                   server_benchmark_calls_start.total_size_relative) /
+              benchmark_iterations);
+  gpr_log(GPR_INFO, "server channel memory usage %zi bytes",
+          server_calls_end.total_size_relative -
+              after_server_create.total_size_relative);
+
+  const char* csv_file = "memory_usage.csv";
+  FILE* csv = fopen(csv_file, "w");
+  if (csv) {
+    char* env_build = gpr_getenv("BUILD_NUMBER");
+    char* env_job = gpr_getenv("JOB_NAME");
+    fprintf(csv, "%f,%zi,%zi,%f,%zi,%s,%s\n",
+            (double)(client_calls_inflight.total_size_relative -
+                     client_benchmark_calls_start.total_size_relative) /
+                benchmark_iterations,
+            client_channel_end.total_size_relative -
+                client_channel_start.total_size_relative,
+            after_server_create.total_size_relative -
+                before_server_create.total_size_relative,
+            (double)(server_calls_inflight.total_size_relative -
+                     server_benchmark_calls_start.total_size_relative) /
+                benchmark_iterations,
+            server_calls_end.total_size_relative -
+                after_server_create.total_size_relative,
+            env_build == NULL ? "" : env_build, env_job == NULL ? "" : env_job);
+    fclose(csv);
+    gpr_log(GPR_INFO, "Summary written to %s", csv_file);
+  }
+
+  grpc_memory_counters_destroy();
+  return 0;
+}
diff --git a/test/core/memory_usage/memory_usage_test.c b/test/core/memory_usage/memory_usage_test.c
deleted file mode 100644
index f4ee6c6..0000000
--- a/test/core/memory_usage/memory_usage_test.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/subprocess.h>
-#include "src/core/lib/support/string.h"
-#include "test/core/util/port.h"
-
-int main(int argc, char **argv) {
-  char *me = argv[0];
-  char *lslash = strrchr(me, '/');
-  char root[1024];
-  int port = grpc_pick_unused_port_or_die();
-  char *args[10];
-  int status;
-  gpr_subprocess *svr, *cli;
-  /* figure out where we are */
-  if (lslash) {
-    memcpy(root, me, (size_t)(lslash - me));
-    root[lslash - me] = 0;
-  } else {
-    strcpy(root, ".");
-  }
-  /* start the server */
-  gpr_asprintf(&args[0], "%s/memory_profile_server%s", root,
-               gpr_subprocess_binary_extension());
-  args[1] = "--bind";
-  gpr_join_host_port(&args[2], "::", port);
-  args[3] = "--no-secure";
-  svr = gpr_subprocess_create(4, (const char **)args);
-  gpr_free(args[0]);
-  gpr_free(args[2]);
-
-  /* start the client */
-  gpr_asprintf(&args[0], "%s/memory_profile_client%s", root,
-               gpr_subprocess_binary_extension());
-  args[1] = "--target";
-  gpr_join_host_port(&args[2], "127.0.0.1", port);
-  args[3] = "--warmup=1000";
-  args[4] = "--benchmark=9000";
-  cli = gpr_subprocess_create(5, (const char **)args);
-  gpr_free(args[0]);
-  gpr_free(args[2]);
-
-  /* wait for completion */
-  printf("waiting for client\n");
-  if ((status = gpr_subprocess_join(cli))) {
-    gpr_subprocess_destroy(cli);
-    gpr_subprocess_destroy(svr);
-    return status;
-  }
-  gpr_subprocess_destroy(cli);
-
-  gpr_subprocess_interrupt(svr);
-  status = gpr_subprocess_join(svr);
-  gpr_subprocess_destroy(svr);
-  return status;
-}
diff --git a/test/core/memory_usage/memory_usage_test.cc b/test/core/memory_usage/memory_usage_test.cc
new file mode 100644
index 0000000..58e31c9
--- /dev/null
+++ b/test/core/memory_usage/memory_usage_test.cc
@@ -0,0 +1,78 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/subprocess.h>
+#include "src/core/lib/support/string.h"
+#include "test/core/util/port.h"
+
+int main(int argc, char** argv) {
+  char* me = argv[0];
+  char* lslash = strrchr(me, '/');
+  char root[1024];
+  int port = grpc_pick_unused_port_or_die();
+  char* args[10];
+  int status;
+  gpr_subprocess *svr, *cli;
+  /* figure out where we are */
+  if (lslash) {
+    memcpy(root, me, (size_t)(lslash - me));
+    root[lslash - me] = 0;
+  } else {
+    strcpy(root, ".");
+  }
+  /* start the server */
+  gpr_asprintf(&args[0], "%s/memory_profile_server%s", root,
+               gpr_subprocess_binary_extension());
+  args[1] = const_cast<char*>("--bind");
+  gpr_join_host_port(&args[2], "::", port);
+  args[3] = const_cast<char*>("--no-secure");
+  svr = gpr_subprocess_create(4, (const char**)args);
+  gpr_free(args[0]);
+  gpr_free(args[2]);
+
+  /* start the client */
+  gpr_asprintf(&args[0], "%s/memory_profile_client%s", root,
+               gpr_subprocess_binary_extension());
+  args[1] = const_cast<char*>("--target");
+  gpr_join_host_port(&args[2], "127.0.0.1", port);
+  args[3] = const_cast<char*>("--warmup=1000");
+  args[4] = const_cast<char*>("--benchmark=9000");
+  cli = gpr_subprocess_create(5, (const char**)args);
+  gpr_free(args[0]);
+  gpr_free(args[2]);
+
+  /* wait for completion */
+  printf("waiting for client\n");
+  if ((status = gpr_subprocess_join(cli))) {
+    gpr_subprocess_destroy(cli);
+    gpr_subprocess_destroy(svr);
+    return status;
+  }
+  gpr_subprocess_destroy(cli);
+
+  gpr_subprocess_interrupt(svr);
+  status = gpr_subprocess_join(svr);
+  gpr_subprocess_destroy(svr);
+  return status;
+}
diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c
deleted file mode 100644
index b25341e..0000000
--- a/test/core/memory_usage/server.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#ifndef _WIN32
-/* This is for _exit() below, which is temporary. */
-#include <unistd.h>
-#endif
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/cmdline.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/util/memory_counters.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static grpc_completion_queue *cq;
-static grpc_server *server;
-static grpc_op metadata_ops[2];
-static grpc_op snapshot_ops[5];
-static grpc_op status_op;
-static int got_sigint = 0;
-static grpc_byte_buffer *payload_buffer = NULL;
-static grpc_byte_buffer *terminal_buffer = NULL;
-static int was_cancelled = 2;
-
-static void *tag(intptr_t t) { return (void *)t; }
-
-typedef enum {
-  FLING_SERVER_NEW_REQUEST = 1,
-  FLING_SERVER_SEND_INIT_METADATA,
-  FLING_SERVER_WAIT_FOR_DESTROY,
-  FLING_SERVER_SEND_STATUS_FLING_CALL,
-  FLING_SERVER_SEND_STATUS_SNAPSHOT,
-  FLING_SERVER_BATCH_SEND_STATUS_FLING_CALL
-} fling_server_tags;
-
-typedef struct {
-  fling_server_tags state;
-  grpc_call *call;
-  grpc_call_details call_details;
-  grpc_metadata_array request_metadata_recv;
-  grpc_metadata_array initial_metadata_send;
-} fling_call;
-
-// hold up to 10000 calls and 6 snaphost calls
-static fling_call calls[100006];
-
-static void request_call_unary(int call_idx) {
-  if (call_idx == (int)(sizeof(calls) / sizeof(fling_call))) {
-    gpr_log(GPR_INFO, "Used all call slots (10000) on server. Server exit.");
-    _exit(0);
-  }
-  grpc_metadata_array_init(&calls[call_idx].request_metadata_recv);
-  grpc_server_request_call(
-      server, &calls[call_idx].call, &calls[call_idx].call_details,
-      &calls[call_idx].request_metadata_recv, cq, cq, &calls[call_idx]);
-}
-
-static void send_initial_metadata_unary(void *tag) {
-  grpc_metadata_array_init(&(*(fling_call *)tag).initial_metadata_send);
-  metadata_ops[0].op = GRPC_OP_SEND_INITIAL_METADATA;
-  metadata_ops[0].data.send_initial_metadata.count = 0;
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch((*(fling_call *)tag).call,
-                                                   metadata_ops, 1, tag, NULL));
-}
-
-static void send_status(void *tag) {
-  status_op.op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  status_op.data.send_status_from_server.status = GRPC_STATUS_OK;
-  status_op.data.send_status_from_server.trailing_metadata_count = 0;
-  grpc_slice details = grpc_slice_from_static_string("");
-  status_op.data.send_status_from_server.status_details = &details;
-
-  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch((*(fling_call *)tag).call,
-                                                   &status_op, 1, tag, NULL));
-}
-
-static void send_snapshot(void *tag, struct grpc_memory_counters *snapshot) {
-  grpc_op *op;
-
-  grpc_slice snapshot_slice =
-      grpc_slice_new(snapshot, sizeof(*snapshot), gpr_free);
-  payload_buffer = grpc_raw_byte_buffer_create(&snapshot_slice, 1);
-  grpc_metadata_array_init(&(*(fling_call *)tag).initial_metadata_send);
-
-  op = snapshot_ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op++;
-  op->op = GRPC_OP_RECV_MESSAGE;
-  op->data.recv_message.recv_message = &terminal_buffer;
-  op++;
-  op->op = GRPC_OP_SEND_MESSAGE;
-  if (payload_buffer == NULL) {
-    gpr_log(GPR_INFO, "NULL payload buffer !!!");
-  }
-  op->data.send_message.send_message = payload_buffer;
-  op++;
-  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
-  op->data.send_status_from_server.status = GRPC_STATUS_OK;
-  op->data.send_status_from_server.trailing_metadata_count = 0;
-  grpc_slice details = grpc_slice_from_static_string("");
-  op->data.send_status_from_server.status_details = &details;
-  op++;
-  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
-  op->data.recv_close_on_server.cancelled = &was_cancelled;
-  op++;
-
-  GPR_ASSERT(GRPC_CALL_OK ==
-             grpc_call_start_batch((*(fling_call *)tag).call, snapshot_ops,
-                                   (size_t)(op - snapshot_ops), tag, NULL));
-}
-/* We have some sort of deadlock, so let's not exit gracefully for now.
-   When that is resolved, please remove the #include <unistd.h> above. */
-static void sigint_handler(int x) { _exit(0); }
-
-int main(int argc, char **argv) {
-  grpc_memory_counters_init();
-  grpc_event ev;
-  char *addr_buf = NULL;
-  gpr_cmdline *cl;
-  grpc_completion_queue *shutdown_cq;
-  int shutdown_started = 0;
-  int shutdown_finished = 0;
-
-  int secure = 0;
-  char *addr = NULL;
-
-  char *fake_argv[1];
-
-  GPR_ASSERT(argc >= 1);
-  fake_argv[0] = argv[0];
-  grpc_test_init(1, fake_argv);
-
-  grpc_init();
-  srand((unsigned)clock());
-
-  cl = gpr_cmdline_create("fling server");
-  gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr);
-  gpr_cmdline_add_flag(cl, "secure", "Run with security?", &secure);
-  gpr_cmdline_parse(cl, argc, argv);
-  gpr_cmdline_destroy(cl);
-
-  if (addr == NULL) {
-    gpr_join_host_port(&addr_buf, "::", grpc_pick_unused_port_or_die());
-    addr = addr_buf;
-  }
-  gpr_log(GPR_INFO, "creating server on: %s", addr);
-
-  cq = grpc_completion_queue_create_for_next(NULL);
-
-  struct grpc_memory_counters before_server_create =
-      grpc_memory_counters_snapshot();
-  if (secure) {
-    grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
-                                                    test_server1_cert};
-    grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(
-        NULL, &pem_key_cert_pair, 1, 0, NULL);
-    server = grpc_server_create(NULL, NULL);
-    GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
-    grpc_server_credentials_release(ssl_creds);
-  } else {
-    server = grpc_server_create(NULL, NULL);
-    GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr));
-  }
-
-  grpc_server_register_completion_queue(server, cq, NULL);
-  grpc_server_start(server);
-
-  struct grpc_memory_counters after_server_create =
-      grpc_memory_counters_snapshot();
-
-  gpr_free(addr_buf);
-  addr = addr_buf = NULL;
-
-  // initialize call instances
-  for (int i = 0; i < (int)(sizeof(calls) / sizeof(fling_call)); i++) {
-    grpc_call_details_init(&calls[i].call_details);
-    calls[i].state = FLING_SERVER_NEW_REQUEST;
-  }
-
-  int next_call_idx = 0;
-  struct grpc_memory_counters current_snapshot;
-
-  request_call_unary(next_call_idx);
-
-  signal(SIGINT, sigint_handler);
-
-  while (!shutdown_finished) {
-    if (got_sigint && !shutdown_started) {
-      gpr_log(GPR_INFO, "Shutting down due to SIGINT");
-
-      shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
-      grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
-      GPR_ASSERT(
-          grpc_completion_queue_pluck(shutdown_cq, tag(1000),
-                                      grpc_timeout_seconds_to_deadline(5), NULL)
-              .type == GRPC_OP_COMPLETE);
-      grpc_completion_queue_destroy(shutdown_cq);
-      grpc_completion_queue_shutdown(cq);
-      shutdown_started = 1;
-    }
-    ev = grpc_completion_queue_next(
-        cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                         gpr_time_from_micros(1000000, GPR_TIMESPAN)),
-        NULL);
-    fling_call *s = ev.tag;
-    switch (ev.type) {
-      case GRPC_OP_COMPLETE:
-        switch (s->state) {
-          case FLING_SERVER_NEW_REQUEST:
-            request_call_unary(++next_call_idx);
-            if (0 == grpc_slice_str_cmp(s->call_details.method,
-                                        "/Reflector/reflectUnary")) {
-              s->state = FLING_SERVER_SEND_INIT_METADATA;
-              send_initial_metadata_unary(s);
-            } else if (0 ==
-                       grpc_slice_str_cmp(s->call_details.method,
-                                          "Reflector/GetBeforeSvrCreation")) {
-              s->state = FLING_SERVER_SEND_STATUS_SNAPSHOT;
-              send_snapshot(s, &before_server_create);
-            } else if (0 ==
-                       grpc_slice_str_cmp(s->call_details.method,
-                                          "Reflector/GetAfterSvrCreation")) {
-              s->state = FLING_SERVER_SEND_STATUS_SNAPSHOT;
-              send_snapshot(s, &after_server_create);
-            } else if (0 == grpc_slice_str_cmp(s->call_details.method,
-                                               "Reflector/SimpleSnapshot")) {
-              s->state = FLING_SERVER_SEND_STATUS_SNAPSHOT;
-              current_snapshot = grpc_memory_counters_snapshot();
-              send_snapshot(s, &current_snapshot);
-            } else if (0 == grpc_slice_str_cmp(s->call_details.method,
-                                               "Reflector/DestroyCalls")) {
-              s->state = FLING_SERVER_BATCH_SEND_STATUS_FLING_CALL;
-              current_snapshot = grpc_memory_counters_snapshot();
-              send_snapshot(s, &current_snapshot);
-            } else {
-              gpr_log(GPR_ERROR, "Wrong call method");
-            }
-            break;
-          case FLING_SERVER_SEND_INIT_METADATA:
-            s->state = FLING_SERVER_WAIT_FOR_DESTROY;
-            break;
-          case FLING_SERVER_WAIT_FOR_DESTROY:
-            break;
-          case FLING_SERVER_SEND_STATUS_FLING_CALL:
-            grpc_call_unref(s->call);
-            grpc_call_details_destroy(&s->call_details);
-            grpc_metadata_array_destroy(&s->initial_metadata_send);
-            grpc_metadata_array_destroy(&s->request_metadata_recv);
-            break;
-          case FLING_SERVER_BATCH_SEND_STATUS_FLING_CALL:
-            for (int k = 0; k < (int)(sizeof(calls) / sizeof(fling_call));
-                 ++k) {
-              if (calls[k].state == FLING_SERVER_WAIT_FOR_DESTROY) {
-                calls[k].state = FLING_SERVER_SEND_STATUS_FLING_CALL;
-                send_status(&calls[k]);
-              }
-            }
-          // no break here since we want to continue to case
-          // FLING_SERVER_SEND_STATUS_SNAPSHOT to destroy the snapshot call
-          case FLING_SERVER_SEND_STATUS_SNAPSHOT:
-            grpc_byte_buffer_destroy(payload_buffer);
-            grpc_byte_buffer_destroy(terminal_buffer);
-            grpc_call_unref(s->call);
-            grpc_call_details_destroy(&s->call_details);
-            grpc_metadata_array_destroy(&s->initial_metadata_send);
-            grpc_metadata_array_destroy(&s->request_metadata_recv);
-            terminal_buffer = NULL;
-            payload_buffer = NULL;
-            break;
-        }
-        break;
-      case GRPC_QUEUE_SHUTDOWN:
-        GPR_ASSERT(shutdown_started);
-        shutdown_finished = 1;
-        break;
-      case GRPC_QUEUE_TIMEOUT:
-        break;
-    }
-  }
-
-  grpc_server_destroy(server);
-  grpc_completion_queue_destroy(cq);
-  grpc_shutdown();
-  grpc_memory_counters_destroy();
-  return 0;
-}
diff --git a/test/core/memory_usage/server.cc b/test/core/memory_usage/server.cc
new file mode 100644
index 0000000..04e55db
--- /dev/null
+++ b/test/core/memory_usage/server.cc
@@ -0,0 +1,316 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#ifndef _WIN32
+/* This is for _exit() below, which is temporary. */
+#include <unistd.h>
+#endif
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/util/memory_counters.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static grpc_completion_queue* cq;
+static grpc_server* server;
+static grpc_op metadata_ops[2];
+static grpc_op snapshot_ops[5];
+static grpc_op status_op;
+static int got_sigint = 0;
+static grpc_byte_buffer* payload_buffer = NULL;
+static grpc_byte_buffer* terminal_buffer = NULL;
+static int was_cancelled = 2;
+
+static void* tag(intptr_t t) { return (void*)t; }
+
+typedef enum {
+  FLING_SERVER_NEW_REQUEST = 1,
+  FLING_SERVER_SEND_INIT_METADATA,
+  FLING_SERVER_WAIT_FOR_DESTROY,
+  FLING_SERVER_SEND_STATUS_FLING_CALL,
+  FLING_SERVER_SEND_STATUS_SNAPSHOT,
+  FLING_SERVER_BATCH_SEND_STATUS_FLING_CALL
+} fling_server_tags;
+
+typedef struct {
+  fling_server_tags state;
+  grpc_call* call;
+  grpc_call_details call_details;
+  grpc_metadata_array request_metadata_recv;
+  grpc_metadata_array initial_metadata_send;
+} fling_call;
+
+// hold up to 10000 calls and 6 snaphost calls
+static fling_call calls[100006];
+
+static void request_call_unary(int call_idx) {
+  if (call_idx == (int)(sizeof(calls) / sizeof(fling_call))) {
+    gpr_log(GPR_INFO, "Used all call slots (10000) on server. Server exit.");
+    _exit(0);
+  }
+  grpc_metadata_array_init(&calls[call_idx].request_metadata_recv);
+  grpc_server_request_call(
+      server, &calls[call_idx].call, &calls[call_idx].call_details,
+      &calls[call_idx].request_metadata_recv, cq, cq, &calls[call_idx]);
+}
+
+static void send_initial_metadata_unary(void* tag) {
+  grpc_metadata_array_init(&(*(fling_call*)tag).initial_metadata_send);
+  metadata_ops[0].op = GRPC_OP_SEND_INITIAL_METADATA;
+  metadata_ops[0].data.send_initial_metadata.count = 0;
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch((*(fling_call*)tag).call,
+                                                   metadata_ops, 1, tag, NULL));
+}
+
+static void send_status(void* tag) {
+  status_op.op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  status_op.data.send_status_from_server.status = GRPC_STATUS_OK;
+  status_op.data.send_status_from_server.trailing_metadata_count = 0;
+  grpc_slice details = grpc_slice_from_static_string("");
+  status_op.data.send_status_from_server.status_details = &details;
+
+  GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch((*(fling_call*)tag).call,
+                                                   &status_op, 1, tag, NULL));
+}
+
+static void send_snapshot(void* tag, struct grpc_memory_counters* snapshot) {
+  grpc_op* op;
+
+  grpc_slice snapshot_slice =
+      grpc_slice_new(snapshot, sizeof(*snapshot), gpr_free);
+  payload_buffer = grpc_raw_byte_buffer_create(&snapshot_slice, 1);
+  grpc_metadata_array_init(&(*(fling_call*)tag).initial_metadata_send);
+
+  op = snapshot_ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op++;
+  op->op = GRPC_OP_RECV_MESSAGE;
+  op->data.recv_message.recv_message = &terminal_buffer;
+  op++;
+  op->op = GRPC_OP_SEND_MESSAGE;
+  if (payload_buffer == NULL) {
+    gpr_log(GPR_INFO, "NULL payload buffer !!!");
+  }
+  op->data.send_message.send_message = payload_buffer;
+  op++;
+  op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+  op->data.send_status_from_server.status = GRPC_STATUS_OK;
+  op->data.send_status_from_server.trailing_metadata_count = 0;
+  grpc_slice details = grpc_slice_from_static_string("");
+  op->data.send_status_from_server.status_details = &details;
+  op++;
+  op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+  op->data.recv_close_on_server.cancelled = &was_cancelled;
+  op++;
+
+  GPR_ASSERT(GRPC_CALL_OK ==
+             grpc_call_start_batch((*(fling_call*)tag).call, snapshot_ops,
+                                   (size_t)(op - snapshot_ops), tag, NULL));
+}
+/* We have some sort of deadlock, so let's not exit gracefully for now.
+   When that is resolved, please remove the #include <unistd.h> above. */
+static void sigint_handler(int x) { _exit(0); }
+
+int main(int argc, char** argv) {
+  grpc_memory_counters_init();
+  grpc_event ev;
+  char* addr_buf = NULL;
+  gpr_cmdline* cl;
+  grpc_completion_queue* shutdown_cq;
+  int shutdown_started = 0;
+  int shutdown_finished = 0;
+
+  int secure = 0;
+  const char* addr = NULL;
+
+  char* fake_argv[1];
+
+  GPR_ASSERT(argc >= 1);
+  fake_argv[0] = argv[0];
+  grpc_test_init(1, fake_argv);
+
+  grpc_init();
+  srand((unsigned)clock());
+
+  cl = gpr_cmdline_create("fling server");
+  gpr_cmdline_add_string(cl, "bind", "Bind host:port", &addr);
+  gpr_cmdline_add_flag(cl, "secure", "Run with security?", &secure);
+  gpr_cmdline_parse(cl, argc, argv);
+  gpr_cmdline_destroy(cl);
+
+  if (addr == NULL) {
+    gpr_join_host_port(&addr_buf, "::", grpc_pick_unused_port_or_die());
+    addr = addr_buf;
+  }
+  gpr_log(GPR_INFO, "creating server on: %s", addr);
+
+  cq = grpc_completion_queue_create_for_next(NULL);
+
+  struct grpc_memory_counters before_server_create =
+      grpc_memory_counters_snapshot();
+  if (secure) {
+    grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
+                                                    test_server1_cert};
+    grpc_server_credentials* ssl_creds = grpc_ssl_server_credentials_create(
+        NULL, &pem_key_cert_pair, 1, 0, NULL);
+    server = grpc_server_create(NULL, NULL);
+    GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
+    grpc_server_credentials_release(ssl_creds);
+  } else {
+    server = grpc_server_create(NULL, NULL);
+    GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr));
+  }
+
+  grpc_server_register_completion_queue(server, cq, NULL);
+  grpc_server_start(server);
+
+  struct grpc_memory_counters after_server_create =
+      grpc_memory_counters_snapshot();
+
+  gpr_free(addr_buf);
+  addr = addr_buf = NULL;
+
+  // initialize call instances
+  for (int i = 0; i < (int)(sizeof(calls) / sizeof(fling_call)); i++) {
+    grpc_call_details_init(&calls[i].call_details);
+    calls[i].state = FLING_SERVER_NEW_REQUEST;
+  }
+
+  int next_call_idx = 0;
+  struct grpc_memory_counters current_snapshot;
+
+  request_call_unary(next_call_idx);
+
+  signal(SIGINT, sigint_handler);
+
+  while (!shutdown_finished) {
+    if (got_sigint && !shutdown_started) {
+      gpr_log(GPR_INFO, "Shutting down due to SIGINT");
+
+      shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
+      grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
+      GPR_ASSERT(
+          grpc_completion_queue_pluck(shutdown_cq, tag(1000),
+                                      grpc_timeout_seconds_to_deadline(5), NULL)
+              .type == GRPC_OP_COMPLETE);
+      grpc_completion_queue_destroy(shutdown_cq);
+      grpc_completion_queue_shutdown(cq);
+      shutdown_started = 1;
+    }
+    ev = grpc_completion_queue_next(
+        cq,
+        gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                     gpr_time_from_micros(1000000, GPR_TIMESPAN)),
+        NULL);
+    fling_call* s = static_cast<fling_call*>(ev.tag);
+    switch (ev.type) {
+      case GRPC_OP_COMPLETE:
+        switch (s->state) {
+          case FLING_SERVER_NEW_REQUEST:
+            request_call_unary(++next_call_idx);
+            if (0 == grpc_slice_str_cmp(s->call_details.method,
+                                        "/Reflector/reflectUnary")) {
+              s->state = FLING_SERVER_SEND_INIT_METADATA;
+              send_initial_metadata_unary(s);
+            } else if (0 ==
+                       grpc_slice_str_cmp(s->call_details.method,
+                                          "Reflector/GetBeforeSvrCreation")) {
+              s->state = FLING_SERVER_SEND_STATUS_SNAPSHOT;
+              send_snapshot(s, &before_server_create);
+            } else if (0 ==
+                       grpc_slice_str_cmp(s->call_details.method,
+                                          "Reflector/GetAfterSvrCreation")) {
+              s->state = FLING_SERVER_SEND_STATUS_SNAPSHOT;
+              send_snapshot(s, &after_server_create);
+            } else if (0 == grpc_slice_str_cmp(s->call_details.method,
+                                               "Reflector/SimpleSnapshot")) {
+              s->state = FLING_SERVER_SEND_STATUS_SNAPSHOT;
+              current_snapshot = grpc_memory_counters_snapshot();
+              send_snapshot(s, &current_snapshot);
+            } else if (0 == grpc_slice_str_cmp(s->call_details.method,
+                                               "Reflector/DestroyCalls")) {
+              s->state = FLING_SERVER_BATCH_SEND_STATUS_FLING_CALL;
+              current_snapshot = grpc_memory_counters_snapshot();
+              send_snapshot(s, &current_snapshot);
+            } else {
+              gpr_log(GPR_ERROR, "Wrong call method");
+            }
+            break;
+          case FLING_SERVER_SEND_INIT_METADATA:
+            s->state = FLING_SERVER_WAIT_FOR_DESTROY;
+            break;
+          case FLING_SERVER_WAIT_FOR_DESTROY:
+            break;
+          case FLING_SERVER_SEND_STATUS_FLING_CALL:
+            grpc_call_unref(s->call);
+            grpc_call_details_destroy(&s->call_details);
+            grpc_metadata_array_destroy(&s->initial_metadata_send);
+            grpc_metadata_array_destroy(&s->request_metadata_recv);
+            break;
+          case FLING_SERVER_BATCH_SEND_STATUS_FLING_CALL:
+            for (int k = 0; k < (int)(sizeof(calls) / sizeof(fling_call));
+                 ++k) {
+              if (calls[k].state == FLING_SERVER_WAIT_FOR_DESTROY) {
+                calls[k].state = FLING_SERVER_SEND_STATUS_FLING_CALL;
+                send_status(&calls[k]);
+              }
+            }
+          // no break here since we want to continue to case
+          // FLING_SERVER_SEND_STATUS_SNAPSHOT to destroy the snapshot call
+          case FLING_SERVER_SEND_STATUS_SNAPSHOT:
+            grpc_byte_buffer_destroy(payload_buffer);
+            grpc_byte_buffer_destroy(terminal_buffer);
+            grpc_call_unref(s->call);
+            grpc_call_details_destroy(&s->call_details);
+            grpc_metadata_array_destroy(&s->initial_metadata_send);
+            grpc_metadata_array_destroy(&s->request_metadata_recv);
+            terminal_buffer = NULL;
+            payload_buffer = NULL;
+            break;
+        }
+        break;
+      case GRPC_QUEUE_SHUTDOWN:
+        GPR_ASSERT(shutdown_started);
+        shutdown_finished = 1;
+        break;
+      case GRPC_QUEUE_TIMEOUT:
+        break;
+    }
+  }
+
+  grpc_server_destroy(server);
+  grpc_completion_queue_destroy(cq);
+  grpc_shutdown();
+  grpc_memory_counters_destroy();
+  return 0;
+}
diff --git a/test/core/nanopb/BUILD b/test/core/nanopb/BUILD
index f332207..1497f82 100644
--- a/test/core/nanopb/BUILD
+++ b/test/core/nanopb/BUILD
@@ -22,8 +22,8 @@
 
 grpc_fuzzer(
     name = "fuzzer_response",
-    srcs = ["fuzzer_response.c"],
-    language = "C",
+    srcs = ["fuzzer_response.cc"],
+    language = "C++",
     corpus = "corpus_response",
     deps = [
         "//:gpr",
@@ -34,8 +34,8 @@
 
 grpc_fuzzer(
     name = "fuzzer_serverlist",
-    srcs = ["fuzzer_serverlist.c"],
-    language = "C",
+    srcs = ["fuzzer_serverlist.cc"],
+    language = "C++",
     corpus = "corpus_serverlist",
     deps = [
         "//:gpr",
diff --git a/test/core/nanopb/fuzzer_response.c b/test/core/nanopb/fuzzer_response.c
deleted file mode 100644
index c9b6397..0000000
--- a/test/core/nanopb/fuzzer_response.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-static void dont_log(gpr_log_func_args *args) {}
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  if (squelch) gpr_set_log_function(dont_log);
-  grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size);
-  grpc_grpclb_initial_response *response;
-  if ((response = grpc_grpclb_initial_response_parse(slice))) {
-    grpc_grpclb_initial_response_destroy(response);
-  }
-  grpc_slice_unref(slice);
-  return 0;
-}
diff --git a/test/core/nanopb/fuzzer_response.cc b/test/core/nanopb/fuzzer_response.cc
new file mode 100644
index 0000000..7039c80
--- /dev/null
+++ b/test/core/nanopb/fuzzer_response.cc
@@ -0,0 +1,40 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+static void dont_log(gpr_log_func_args* args) {}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  if (squelch) gpr_set_log_function(dont_log);
+  grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size);
+  grpc_grpclb_initial_response* response;
+  if ((response = grpc_grpclb_initial_response_parse(slice))) {
+    grpc_grpclb_initial_response_destroy(response);
+  }
+  grpc_slice_unref(slice);
+  return 0;
+}
diff --git a/test/core/nanopb/fuzzer_serverlist.c b/test/core/nanopb/fuzzer_serverlist.c
deleted file mode 100644
index dd70f0c..0000000
--- a/test/core/nanopb/fuzzer_serverlist.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-static void dont_log(gpr_log_func_args *args) {}
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  if (squelch) gpr_set_log_function(dont_log);
-  grpc_slice slice = grpc_slice_from_copied_buffer((const char *)data, size);
-  grpc_grpclb_serverlist *serverlist;
-  if ((serverlist = grpc_grpclb_response_parse_serverlist(slice))) {
-    grpc_grpclb_destroy_serverlist(serverlist);
-  }
-  grpc_slice_unref(slice);
-  return 0;
-}
diff --git a/test/core/nanopb/fuzzer_serverlist.cc b/test/core/nanopb/fuzzer_serverlist.cc
new file mode 100644
index 0000000..0a6b176
--- /dev/null
+++ b/test/core/nanopb/fuzzer_serverlist.cc
@@ -0,0 +1,40 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+static void dont_log(gpr_log_func_args* args) {}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  if (squelch) gpr_set_log_function(dont_log);
+  grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size);
+  grpc_grpclb_serverlist* serverlist;
+  if ((serverlist = grpc_grpclb_response_parse_serverlist(slice))) {
+    grpc_grpclb_destroy_serverlist(serverlist);
+  }
+  grpc_slice_unref(slice);
+  return 0;
+}
diff --git a/test/core/network_benchmarks/BUILD b/test/core/network_benchmarks/BUILD
index 0e15393..e1b4953 100644
--- a/test/core/network_benchmarks/BUILD
+++ b/test/core/network_benchmarks/BUILD
@@ -22,8 +22,8 @@
 
 grpc_cc_binary(
     name = "low_level_ping_pong",
-    srcs = ["low_level_ping_pong.c"],
-    language = "C",
+    srcs = ["low_level_ping_pong.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/network_benchmarks/low_level_ping_pong.c b/test/core/network_benchmarks/low_level_ping_pong.c
deleted file mode 100644
index 1550003..0000000
--- a/test/core/network_benchmarks/low_level_ping_pong.c
+++ /dev/null
@@ -1,684 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/*
-   Basic I/O ping-pong benchmarks.
-
-   The goal here is to establish lower bounds on how fast the stack could get by
-   measuring the cost of using various I/O strategies to do a basic
-   request-response loop.
- */
-
-#include <errno.h>
-#include <netinet/ip.h>
-#include <poll.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef __linux__
-#include <sys/epoll.h>
-#endif
-#include <sys/socket.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/cmdline.h>
-#include <grpc/support/histogram.h>
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-
-typedef struct fd_pair {
-  int read_fd;
-  int write_fd;
-} fd_pair;
-
-typedef struct thread_args {
-  fd_pair fds;
-  size_t msg_size;
-  int (*read_bytes)(struct thread_args *args, char *buf);
-  int (*write_bytes)(struct thread_args *args, char *buf);
-  int (*setup)(struct thread_args *args);
-  int epoll_fd;
-  char *strategy_name;
-} thread_args;
-
-/*
-   Read strategies
-
-   There are a number of read strategies, each of which has a blocking and
-   non-blocking version.
- */
-
-/* Basic call to read() */
-static int read_bytes(int fd, char *buf, size_t read_size, int spin) {
-  size_t bytes_read = 0;
-  ssize_t err;
-  do {
-    err = read(fd, buf + bytes_read, read_size - bytes_read);
-    if (err < 0) {
-      if (errno == EINTR) {
-        continue;
-      } else {
-        if (errno == EAGAIN && spin == 1) {
-          continue;
-        }
-        gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
-        return -1;
-      }
-    } else {
-      bytes_read += (size_t)err;
-    }
-  } while (bytes_read < read_size);
-  return 0;
-}
-
-static int blocking_read_bytes(thread_args *args, char *buf) {
-  return read_bytes(args->fds.read_fd, buf, args->msg_size, 0);
-}
-
-static int spin_read_bytes(thread_args *args, char *buf) {
-  return read_bytes(args->fds.read_fd, buf, args->msg_size, 1);
-}
-
-/* Call poll() to monitor a non-blocking fd */
-static int poll_read_bytes(int fd, char *buf, size_t read_size, int spin) {
-  struct pollfd pfd;
-  size_t bytes_read = 0;
-  int err;
-  ssize_t err2;
-
-  pfd.fd = fd;
-  pfd.events = POLLIN;
-  do {
-    err = poll(&pfd, 1, spin ? 0 : -1);
-    if (err < 0) {
-      if (errno == EINTR) {
-        continue;
-      } else {
-        gpr_log(GPR_ERROR, "Poll failed: %s", strerror(errno));
-        return -1;
-      }
-    }
-    if (err == 0 && spin) continue;
-    GPR_ASSERT(err == 1);
-    GPR_ASSERT(pfd.revents == POLLIN);
-    do {
-      err2 = read(fd, buf + bytes_read, read_size - bytes_read);
-    } while (err2 < 0 && errno == EINTR);
-    if (err2 < 0 && errno != EAGAIN) {
-      gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
-      return -1;
-    }
-    bytes_read += (size_t)err2;
-  } while (bytes_read < read_size);
-  return 0;
-}
-
-static int poll_read_bytes_blocking(struct thread_args *args, char *buf) {
-  return poll_read_bytes(args->fds.read_fd, buf, args->msg_size, 0);
-}
-
-static int poll_read_bytes_spin(struct thread_args *args, char *buf) {
-  return poll_read_bytes(args->fds.read_fd, buf, args->msg_size, 1);
-}
-
-#ifdef __linux__
-/* Call epoll_wait() to monitor a non-blocking fd */
-static int epoll_read_bytes(struct thread_args *args, char *buf, int spin) {
-  struct epoll_event ev;
-  size_t bytes_read = 0;
-  int err;
-  ssize_t err2;
-  size_t read_size = args->msg_size;
-
-  do {
-    err = epoll_wait(args->epoll_fd, &ev, 1, spin ? 0 : -1);
-    if (err < 0) {
-      if (errno == EINTR) continue;
-      gpr_log(GPR_ERROR, "epoll_wait failed: %s", strerror(errno));
-      return -1;
-    }
-    if (err == 0 && spin) continue;
-    GPR_ASSERT(err == 1);
-    GPR_ASSERT(ev.events & EPOLLIN);
-    GPR_ASSERT(ev.data.fd == args->fds.read_fd);
-    do {
-      do {
-        err2 =
-            read(args->fds.read_fd, buf + bytes_read, read_size - bytes_read);
-      } while (err2 < 0 && errno == EINTR);
-      if (errno == EAGAIN) break;
-      bytes_read += (size_t)err2;
-      /* TODO(klempner): This should really be doing an extra call after we are
-         done to ensure we see an EAGAIN */
-    } while (bytes_read < read_size);
-  } while (bytes_read < read_size);
-  GPR_ASSERT(bytes_read == read_size);
-  return 0;
-}
-
-static int epoll_read_bytes_blocking(struct thread_args *args, char *buf) {
-  return epoll_read_bytes(args, buf, 0);
-}
-
-static int epoll_read_bytes_spin(struct thread_args *args, char *buf) {
-  return epoll_read_bytes(args, buf, 1);
-}
-#endif /* __linux__ */
-
-/* Write out bytes.
-   At this point we only have one strategy, since in the common case these
-   writes go directly out to the kernel.
- */
-static int blocking_write_bytes(struct thread_args *args, char *buf) {
-  size_t bytes_written = 0;
-  ssize_t err;
-  size_t write_size = args->msg_size;
-  do {
-    err = write(args->fds.write_fd, buf + bytes_written,
-                write_size - bytes_written);
-    if (err < 0) {
-      if (errno == EINTR) {
-        continue;
-      } else {
-        gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
-        return -1;
-      }
-    } else {
-      bytes_written += (size_t)err;
-    }
-  } while (bytes_written < write_size);
-  return 0;
-}
-
-/*
-   Initialization code
-
-   These are called at the beginning of the client and server thread, depending
-   on the scenario we're using.
- */
-static int set_socket_nonblocking(thread_args *args) {
-  if (!GRPC_LOG_IF_ERROR("Unable to set read socket nonblocking",
-                         grpc_set_socket_nonblocking(args->fds.read_fd, 1))) {
-    return -1;
-  }
-  if (!GRPC_LOG_IF_ERROR("Unable to set write socket nonblocking",
-                         grpc_set_socket_nonblocking(args->fds.write_fd, 1))) {
-    return -1;
-  }
-  return 0;
-}
-
-static int do_nothing(thread_args *args) { return 0; }
-
-#ifdef __linux__
-/* Special case for epoll, where we need to create the fd ahead of time. */
-static int epoll_setup(thread_args *args) {
-  int epoll_fd;
-  struct epoll_event ev;
-  set_socket_nonblocking(args);
-  epoll_fd = epoll_create(1);
-  if (epoll_fd < 0) {
-    gpr_log(GPR_ERROR, "epoll_create: %s", strerror(errno));
-    return -1;
-  }
-
-  args->epoll_fd = epoll_fd;
-
-  ev.events = EPOLLIN | EPOLLET;
-  ev.data.fd = args->fds.read_fd;
-  if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, args->fds.read_fd, &ev) < 0) {
-    gpr_log(GPR_ERROR, "epoll_ctl: %s", strerror(errno));
-  }
-  return 0;
-}
-#endif
-
-static void server_thread(thread_args *args) {
-  char *buf = gpr_malloc(args->msg_size);
-  if (args->setup(args) < 0) {
-    gpr_log(GPR_ERROR, "Setup failed");
-  }
-  for (;;) {
-    if (args->read_bytes(args, buf) < 0) {
-      gpr_log(GPR_ERROR, "Server read failed");
-      gpr_free(buf);
-      return;
-    }
-    if (args->write_bytes(args, buf) < 0) {
-      gpr_log(GPR_ERROR, "Server write failed");
-      gpr_free(buf);
-      return;
-    }
-  }
-}
-
-static void server_thread_wrap(void *arg) {
-  thread_args *args = arg;
-  server_thread(args);
-}
-
-static void print_histogram(gpr_histogram *histogram) {
-  /* TODO(klempner): Print more detailed information, such as detailed histogram
-     buckets */
-  gpr_log(GPR_INFO, "latency (50/95/99/99.9): %f/%f/%f/%f",
-          gpr_histogram_percentile(histogram, 50),
-          gpr_histogram_percentile(histogram, 95),
-          gpr_histogram_percentile(histogram, 99),
-          gpr_histogram_percentile(histogram, 99.9));
-}
-
-static double now(void) {
-  gpr_timespec tv = gpr_now(GPR_CLOCK_REALTIME);
-  return 1e9 * (double)tv.tv_sec + (double)tv.tv_nsec;
-}
-
-static void client_thread(thread_args *args) {
-  char *buf = gpr_malloc(args->msg_size * sizeof(char));
-  memset(buf, 0, args->msg_size * sizeof(char));
-  gpr_histogram *histogram = gpr_histogram_create(0.01, 60e9);
-  double start_time;
-  double end_time;
-  double interval;
-  const int kNumIters = 100000;
-  int i;
-
-  if (args->setup(args) < 0) {
-    gpr_log(GPR_ERROR, "Setup failed");
-  }
-  for (i = 0; i < kNumIters; ++i) {
-    start_time = now();
-    if (args->write_bytes(args, buf) < 0) {
-      gpr_log(GPR_ERROR, "Client write failed");
-      goto error;
-    }
-    if (args->read_bytes(args, buf) < 0) {
-      gpr_log(GPR_ERROR, "Client read failed");
-      goto error;
-    }
-    end_time = now();
-    if (i > kNumIters / 2) {
-      interval = end_time - start_time;
-      gpr_histogram_add(histogram, interval);
-    }
-  }
-  print_histogram(histogram);
-error:
-  gpr_free(buf);
-  gpr_histogram_destroy(histogram);
-}
-
-/* This roughly matches tcp_server's create_listening_socket */
-static int create_listening_socket(struct sockaddr *port, socklen_t len) {
-  int fd = socket(port->sa_family, SOCK_STREAM, 0);
-  if (fd < 0) {
-    gpr_log(GPR_ERROR, "Unable to create socket: %s", strerror(errno));
-    goto error;
-  }
-
-  if (!GRPC_LOG_IF_ERROR("Failed to set listening socket cloexec",
-                         grpc_set_socket_cloexec(fd, 1))) {
-    goto error;
-  }
-  if (!GRPC_LOG_IF_ERROR("Failed to set listening socket low latency",
-                         grpc_set_socket_low_latency(fd, 1))) {
-    goto error;
-  }
-  if (!GRPC_LOG_IF_ERROR("Failed to set listening socket reuse addr",
-                         grpc_set_socket_reuse_addr(fd, 1))) {
-    goto error;
-  }
-
-  if (bind(fd, port, len) < 0) {
-    gpr_log(GPR_ERROR, "bind: %s", strerror(errno));
-    goto error;
-  }
-
-  if (listen(fd, 1) < 0) {
-    gpr_log(GPR_ERROR, "listen: %s", strerror(errno));
-    goto error;
-  }
-
-  if (getsockname(fd, port, &len) < 0) {
-    gpr_log(GPR_ERROR, "getsockname: %s", strerror(errno));
-    goto error;
-  }
-
-  return fd;
-
-error:
-  if (fd >= 0) {
-    close(fd);
-  }
-  return -1;
-}
-
-static int connect_client(struct sockaddr *addr, socklen_t len) {
-  int fd = socket(addr->sa_family, SOCK_STREAM, 0);
-  int err;
-  if (fd < 0) {
-    gpr_log(GPR_ERROR, "Unable to create socket: %s", strerror(errno));
-    goto error;
-  }
-
-  if (!GRPC_LOG_IF_ERROR("Failed to set connecting socket cloexec",
-                         grpc_set_socket_cloexec(fd, 1))) {
-    goto error;
-  }
-  if (!GRPC_LOG_IF_ERROR("Failed to set connecting socket low latency",
-                         grpc_set_socket_low_latency(fd, 1))) {
-    goto error;
-  }
-
-  do {
-    err = connect(fd, addr, len);
-  } while (err < 0 && errno == EINTR);
-
-  if (err < 0) {
-    gpr_log(GPR_ERROR, "connect error: %s", strerror(errno));
-    goto error;
-  }
-  return fd;
-
-error:
-  if (fd >= 0) {
-    close(fd);
-  }
-  return -1;
-}
-
-static int accept_server(int listen_fd) {
-  int fd = accept(listen_fd, NULL, NULL);
-  if (fd < 0) {
-    gpr_log(GPR_ERROR, "Accept failed: %s", strerror(errno));
-    return -1;
-  }
-  return fd;
-}
-
-static int create_sockets_tcp(fd_pair *client_fds, fd_pair *server_fds) {
-  int listen_fd = -1;
-  int client_fd = -1;
-  int server_fd = -1;
-
-  struct sockaddr_in port;
-  struct sockaddr *sa_port = (struct sockaddr *)&port;
-
-  port.sin_family = AF_INET;
-  port.sin_port = 0;
-  port.sin_addr.s_addr = INADDR_ANY;
-
-  listen_fd = create_listening_socket(sa_port, sizeof(port));
-  if (listen_fd == -1) {
-    gpr_log(GPR_ERROR, "Listen failed");
-    goto error;
-  }
-
-  client_fd = connect_client(sa_port, sizeof(port));
-  if (client_fd == -1) {
-    gpr_log(GPR_ERROR, "Connect failed");
-    goto error;
-  }
-
-  server_fd = accept_server(listen_fd);
-  if (server_fd == -1) {
-    gpr_log(GPR_ERROR, "Accept failed");
-    goto error;
-  }
-
-  client_fds->read_fd = client_fd;
-  client_fds->write_fd = client_fd;
-  server_fds->read_fd = server_fd;
-  server_fds->write_fd = server_fd;
-  close(listen_fd);
-  return 0;
-
-error:
-  if (listen_fd != -1) {
-    close(listen_fd);
-  }
-  if (client_fd != -1) {
-    close(client_fd);
-  }
-  if (server_fd != -1) {
-    close(server_fd);
-  }
-  return -1;
-}
-
-static int create_sockets_socketpair(fd_pair *client_fds, fd_pair *server_fds) {
-  int fds[2];
-  if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
-    gpr_log(GPR_ERROR, "socketpair: %s", strerror(errno));
-    return -1;
-  }
-
-  client_fds->read_fd = fds[0];
-  client_fds->write_fd = fds[0];
-  server_fds->read_fd = fds[1];
-  server_fds->write_fd = fds[1];
-  return 0;
-}
-
-static int create_sockets_pipe(fd_pair *client_fds, fd_pair *server_fds) {
-  int cfds[2];
-  int sfds[2];
-  if (pipe(cfds) < 0) {
-    gpr_log(GPR_ERROR, "pipe: %s", strerror(errno));
-    return -1;
-  }
-
-  if (pipe(sfds) < 0) {
-    gpr_log(GPR_ERROR, "pipe: %s", strerror(errno));
-    return -1;
-  }
-
-  client_fds->read_fd = cfds[0];
-  client_fds->write_fd = cfds[1];
-  server_fds->read_fd = sfds[0];
-  server_fds->write_fd = sfds[1];
-  return 0;
-}
-
-static const char *read_strategy_usage =
-    "Strategy for doing reads, which is one of:\n"
-    "  blocking: blocking read calls\n"
-    "  same_thread_poll: poll() call on same thread \n"
-#ifdef __linux__
-    "  same_thread_epoll: epoll_wait() on same thread \n"
-#endif
-    "  spin_read: spinning non-blocking read() calls \n"
-    "  spin_poll: spinning 0 timeout poll() calls \n"
-#ifdef __linux__
-    "  spin_epoll: spinning 0 timeout epoll_wait() calls \n"
-#endif
-    "";
-
-static const char *socket_type_usage =
-    "Type of socket used, one of:\n"
-    "  tcp: fds are endpoints of a TCP connection\n"
-    "  socketpair: fds come from socketpair()\n"
-    "  pipe: fds come from pipe()\n";
-
-void print_usage(char *argv0) {
-  fprintf(stderr, "%s usage:\n\n", argv0);
-  fprintf(stderr, "%s read_strategy socket_type msg_size\n\n", argv0);
-  fprintf(stderr, "where read_strategy is one of:\n");
-  fprintf(stderr, "  blocking: blocking read calls\n");
-  fprintf(stderr, "  same_thread_poll: poll() call on same thread \n");
-#ifdef __linux__
-  fprintf(stderr, "  same_thread_epoll: epoll_wait() on same thread \n");
-#endif
-  fprintf(stderr, "  spin_read: spinning non-blocking read() calls \n");
-  fprintf(stderr, "  spin_poll: spinning 0 timeout poll() calls \n");
-#ifdef __linux__
-  fprintf(stderr, "  spin_epoll: spinning 0 timeout epoll_wait() calls \n");
-#endif
-  fprintf(stderr, "and socket_type is one of:\n");
-  fprintf(stderr, "  tcp: fds are endpoints of a TCP connection\n");
-  fprintf(stderr, "  socketpair: fds come from socketpair()\n");
-  fprintf(stderr, "  pipe: fds come from pipe()\n");
-}
-
-typedef struct test_strategy {
-  char *name;
-  int (*read_strategy)(struct thread_args *args, char *buf);
-  int (*setup)(struct thread_args *args);
-} test_strategy;
-
-static test_strategy test_strategies[] = {
-    {"blocking", blocking_read_bytes, do_nothing},
-    {"same_thread_poll", poll_read_bytes_blocking, set_socket_nonblocking},
-#ifdef __linux__
-    {"same_thread_epoll", epoll_read_bytes_blocking, epoll_setup},
-    {"spin_epoll", epoll_read_bytes_spin, epoll_setup},
-#endif /* __linux__ */
-    {"spin_read", spin_read_bytes, set_socket_nonblocking},
-    {"spin_poll", poll_read_bytes_spin, set_socket_nonblocking}};
-
-static char *socket_types[] = {"tcp", "socketpair", "pipe"};
-
-int create_socket(char *socket_type, fd_pair *client_fds, fd_pair *server_fds) {
-  if (strcmp(socket_type, "tcp") == 0) {
-    create_sockets_tcp(client_fds, server_fds);
-  } else if (strcmp(socket_type, "socketpair") == 0) {
-    create_sockets_socketpair(client_fds, server_fds);
-  } else if (strcmp(socket_type, "pipe") == 0) {
-    create_sockets_pipe(client_fds, server_fds);
-  } else {
-    fprintf(stderr, "Invalid socket type %s\n", socket_type);
-    return -1;
-  }
-  return 0;
-}
-
-static int run_benchmark(char *socket_type, thread_args *client_args,
-                         thread_args *server_args) {
-  gpr_thd_id tid;
-  int rv = 0;
-
-  rv = create_socket(socket_type, &client_args->fds, &server_args->fds);
-  if (rv < 0) {
-    return rv;
-  }
-
-  gpr_log(GPR_INFO, "Starting test %s %s %zu", client_args->strategy_name,
-          socket_type, client_args->msg_size);
-
-  gpr_thd_new(&tid, server_thread_wrap, server_args, NULL);
-  client_thread(client_args);
-  return 0;
-}
-
-static int run_all_benchmarks(size_t msg_size) {
-  int error = 0;
-  size_t i;
-  for (i = 0; i < GPR_ARRAY_SIZE(test_strategies); ++i) {
-    test_strategy *strategy = &test_strategies[i];
-    size_t j;
-    for (j = 0; j < GPR_ARRAY_SIZE(socket_types); ++j) {
-      thread_args *client_args = gpr_malloc(sizeof(thread_args));
-      thread_args *server_args = gpr_malloc(sizeof(thread_args));
-      char *socket_type = socket_types[j];
-
-      client_args->read_bytes = strategy->read_strategy;
-      client_args->write_bytes = blocking_write_bytes;
-      client_args->setup = strategy->setup;
-      client_args->msg_size = msg_size;
-      client_args->strategy_name = strategy->name;
-      server_args->read_bytes = strategy->read_strategy;
-      server_args->write_bytes = blocking_write_bytes;
-      server_args->setup = strategy->setup;
-      server_args->msg_size = msg_size;
-      server_args->strategy_name = strategy->name;
-      error = run_benchmark(socket_type, client_args, server_args);
-      if (error < 0) {
-        return error;
-      }
-    }
-  }
-  return error;
-}
-
-int main(int argc, char **argv) {
-  thread_args *client_args = gpr_malloc(sizeof(thread_args));
-  thread_args *server_args = gpr_malloc(sizeof(thread_args));
-  int msg_size = -1;
-  char *read_strategy = NULL;
-  char *socket_type = NULL;
-  size_t i;
-  const test_strategy *strategy = NULL;
-  int error = 0;
-
-  gpr_cmdline *cmdline =
-      gpr_cmdline_create("low_level_ping_pong network benchmarking tool");
-
-  gpr_cmdline_add_int(cmdline, "msg_size", "Size of sent messages", &msg_size);
-  gpr_cmdline_add_string(cmdline, "read_strategy", read_strategy_usage,
-                         &read_strategy);
-  gpr_cmdline_add_string(cmdline, "socket_type", socket_type_usage,
-                         &socket_type);
-
-  gpr_cmdline_parse(cmdline, argc, argv);
-
-  if (msg_size == -1) {
-    msg_size = 50;
-  }
-
-  if (read_strategy == NULL) {
-    gpr_log(GPR_INFO, "No strategy specified, running all benchmarks");
-    return run_all_benchmarks((size_t)msg_size);
-  }
-
-  if (socket_type == NULL) {
-    socket_type = "tcp";
-  }
-  if (msg_size <= 0) {
-    fprintf(stderr, "msg_size must be > 0\n");
-    print_usage(argv[0]);
-    return -1;
-  }
-
-  for (i = 0; i < GPR_ARRAY_SIZE(test_strategies); ++i) {
-    if (strcmp(test_strategies[i].name, read_strategy) == 0) {
-      strategy = &test_strategies[i];
-    }
-  }
-  if (strategy == NULL) {
-    fprintf(stderr, "Invalid read strategy %s\n", read_strategy);
-    return -1;
-  }
-
-  client_args->read_bytes = strategy->read_strategy;
-  client_args->write_bytes = blocking_write_bytes;
-  client_args->setup = strategy->setup;
-  client_args->msg_size = (size_t)msg_size;
-  client_args->strategy_name = read_strategy;
-  server_args->read_bytes = strategy->read_strategy;
-  server_args->write_bytes = blocking_write_bytes;
-  server_args->setup = strategy->setup;
-  server_args->msg_size = (size_t)msg_size;
-  server_args->strategy_name = read_strategy;
-
-  error = run_benchmark(socket_type, client_args, server_args);
-
-  gpr_cmdline_destroy(cmdline);
-  return error;
-}
diff --git a/test/core/network_benchmarks/low_level_ping_pong.cc b/test/core/network_benchmarks/low_level_ping_pong.cc
new file mode 100644
index 0000000..7226521
--- /dev/null
+++ b/test/core/network_benchmarks/low_level_ping_pong.cc
@@ -0,0 +1,689 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/*
+   Basic I/O ping-pong benchmarks.
+
+   The goal here is to establish lower bounds on how fast the stack could get by
+   measuring the cost of using various I/O strategies to do a basic
+   request-response loop.
+ */
+
+#include <errno.h>
+#include <netinet/ip.h>
+#include <poll.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef __linux__
+#include <sys/epoll.h>
+#endif
+#include <sys/socket.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/histogram.h>
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
+
+typedef struct fd_pair {
+  int read_fd;
+  int write_fd;
+} fd_pair;
+
+typedef struct thread_args {
+  fd_pair fds;
+  size_t msg_size;
+  int (*read_bytes)(struct thread_args* args, char* buf);
+  int (*write_bytes)(struct thread_args* args, char* buf);
+  int (*setup)(struct thread_args* args);
+  int epoll_fd;
+  const char* strategy_name;
+} thread_args;
+
+/*
+   Read strategies
+
+   There are a number of read strategies, each of which has a blocking and
+   non-blocking version.
+ */
+
+/* Basic call to read() */
+static int read_bytes(int fd, char* buf, size_t read_size, int spin) {
+  size_t bytes_read = 0;
+  ssize_t err;
+  do {
+    err = read(fd, buf + bytes_read, read_size - bytes_read);
+    if (err < 0) {
+      if (errno == EINTR) {
+        continue;
+      } else {
+        if (errno == EAGAIN && spin == 1) {
+          continue;
+        }
+        gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
+        return -1;
+      }
+    } else {
+      bytes_read += (size_t)err;
+    }
+  } while (bytes_read < read_size);
+  return 0;
+}
+
+static int blocking_read_bytes(thread_args* args, char* buf) {
+  return read_bytes(args->fds.read_fd, buf, args->msg_size, 0);
+}
+
+static int spin_read_bytes(thread_args* args, char* buf) {
+  return read_bytes(args->fds.read_fd, buf, args->msg_size, 1);
+}
+
+/* Call poll() to monitor a non-blocking fd */
+static int poll_read_bytes(int fd, char* buf, size_t read_size, int spin) {
+  struct pollfd pfd;
+  size_t bytes_read = 0;
+  int err;
+  ssize_t err2;
+
+  pfd.fd = fd;
+  pfd.events = POLLIN;
+  do {
+    err = poll(&pfd, 1, spin ? 0 : -1);
+    if (err < 0) {
+      if (errno == EINTR) {
+        continue;
+      } else {
+        gpr_log(GPR_ERROR, "Poll failed: %s", strerror(errno));
+        return -1;
+      }
+    }
+    if (err == 0 && spin) continue;
+    GPR_ASSERT(err == 1);
+    GPR_ASSERT(pfd.revents == POLLIN);
+    do {
+      err2 = read(fd, buf + bytes_read, read_size - bytes_read);
+    } while (err2 < 0 && errno == EINTR);
+    if (err2 < 0 && errno != EAGAIN) {
+      gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
+      return -1;
+    }
+    bytes_read += (size_t)err2;
+  } while (bytes_read < read_size);
+  return 0;
+}
+
+static int poll_read_bytes_blocking(struct thread_args* args, char* buf) {
+  return poll_read_bytes(args->fds.read_fd, buf, args->msg_size, 0);
+}
+
+static int poll_read_bytes_spin(struct thread_args* args, char* buf) {
+  return poll_read_bytes(args->fds.read_fd, buf, args->msg_size, 1);
+}
+
+#ifdef __linux__
+/* Call epoll_wait() to monitor a non-blocking fd */
+static int epoll_read_bytes(struct thread_args* args, char* buf, int spin) {
+  struct epoll_event ev;
+  size_t bytes_read = 0;
+  int err;
+  ssize_t err2;
+  size_t read_size = args->msg_size;
+
+  do {
+    err = epoll_wait(args->epoll_fd, &ev, 1, spin ? 0 : -1);
+    if (err < 0) {
+      if (errno == EINTR) continue;
+      gpr_log(GPR_ERROR, "epoll_wait failed: %s", strerror(errno));
+      return -1;
+    }
+    if (err == 0 && spin) continue;
+    GPR_ASSERT(err == 1);
+    GPR_ASSERT(ev.events & EPOLLIN);
+    GPR_ASSERT(ev.data.fd == args->fds.read_fd);
+    do {
+      do {
+        err2 =
+            read(args->fds.read_fd, buf + bytes_read, read_size - bytes_read);
+      } while (err2 < 0 && errno == EINTR);
+      if (errno == EAGAIN) break;
+      bytes_read += (size_t)err2;
+      /* TODO(klempner): This should really be doing an extra call after we are
+         done to ensure we see an EAGAIN */
+    } while (bytes_read < read_size);
+  } while (bytes_read < read_size);
+  GPR_ASSERT(bytes_read == read_size);
+  return 0;
+}
+
+static int epoll_read_bytes_blocking(struct thread_args* args, char* buf) {
+  return epoll_read_bytes(args, buf, 0);
+}
+
+static int epoll_read_bytes_spin(struct thread_args* args, char* buf) {
+  return epoll_read_bytes(args, buf, 1);
+}
+#endif /* __linux__ */
+
+/* Write out bytes.
+   At this point we only have one strategy, since in the common case these
+   writes go directly out to the kernel.
+ */
+static int blocking_write_bytes(struct thread_args* args, char* buf) {
+  size_t bytes_written = 0;
+  ssize_t err;
+  size_t write_size = args->msg_size;
+  do {
+    err = write(args->fds.write_fd, buf + bytes_written,
+                write_size - bytes_written);
+    if (err < 0) {
+      if (errno == EINTR) {
+        continue;
+      } else {
+        gpr_log(GPR_ERROR, "Read failed: %s", strerror(errno));
+        return -1;
+      }
+    } else {
+      bytes_written += (size_t)err;
+    }
+  } while (bytes_written < write_size);
+  return 0;
+}
+
+/*
+   Initialization code
+
+   These are called at the beginning of the client and server thread, depending
+   on the scenario we're using.
+ */
+static int set_socket_nonblocking(thread_args* args) {
+  if (!GRPC_LOG_IF_ERROR("Unable to set read socket nonblocking",
+                         grpc_set_socket_nonblocking(args->fds.read_fd, 1))) {
+    return -1;
+  }
+  if (!GRPC_LOG_IF_ERROR("Unable to set write socket nonblocking",
+                         grpc_set_socket_nonblocking(args->fds.write_fd, 1))) {
+    return -1;
+  }
+  return 0;
+}
+
+static int do_nothing(thread_args* args) { return 0; }
+
+#ifdef __linux__
+/* Special case for epoll, where we need to create the fd ahead of time. */
+static int epoll_setup(thread_args* args) {
+  int epoll_fd;
+  struct epoll_event ev;
+  set_socket_nonblocking(args);
+  epoll_fd = epoll_create(1);
+  if (epoll_fd < 0) {
+    gpr_log(GPR_ERROR, "epoll_create: %s", strerror(errno));
+    return -1;
+  }
+
+  args->epoll_fd = epoll_fd;
+
+  ev.events = EPOLLIN | EPOLLET;
+  ev.data.fd = args->fds.read_fd;
+  if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, args->fds.read_fd, &ev) < 0) {
+    gpr_log(GPR_ERROR, "epoll_ctl: %s", strerror(errno));
+  }
+  return 0;
+}
+#endif
+
+static void server_thread(thread_args* args) {
+  char* buf = static_cast<char*>(gpr_malloc(args->msg_size));
+  if (args->setup(args) < 0) {
+    gpr_log(GPR_ERROR, "Setup failed");
+  }
+  for (;;) {
+    if (args->read_bytes(args, buf) < 0) {
+      gpr_log(GPR_ERROR, "Server read failed");
+      gpr_free(buf);
+      return;
+    }
+    if (args->write_bytes(args, buf) < 0) {
+      gpr_log(GPR_ERROR, "Server write failed");
+      gpr_free(buf);
+      return;
+    }
+  }
+}
+
+static void server_thread_wrap(void* arg) {
+  thread_args* args = static_cast<thread_args*>(arg);
+  server_thread(args);
+}
+
+static void print_histogram(gpr_histogram* histogram) {
+  /* TODO(klempner): Print more detailed information, such as detailed histogram
+     buckets */
+  gpr_log(GPR_INFO, "latency (50/95/99/99.9): %f/%f/%f/%f",
+          gpr_histogram_percentile(histogram, 50),
+          gpr_histogram_percentile(histogram, 95),
+          gpr_histogram_percentile(histogram, 99),
+          gpr_histogram_percentile(histogram, 99.9));
+}
+
+static double now(void) {
+  gpr_timespec tv = gpr_now(GPR_CLOCK_REALTIME);
+  return 1e9 * (double)tv.tv_sec + (double)tv.tv_nsec;
+}
+
+static void client_thread(thread_args* args) {
+  char* buf = static_cast<char*>(gpr_malloc(args->msg_size * sizeof(char)));
+  memset(buf, 0, args->msg_size * sizeof(char));
+  gpr_histogram* histogram = gpr_histogram_create(0.01, 60e9);
+  double start_time;
+  double end_time;
+  double interval;
+  const int kNumIters = 100000;
+  int i;
+
+  if (args->setup(args) < 0) {
+    gpr_log(GPR_ERROR, "Setup failed");
+  }
+  for (i = 0; i < kNumIters; ++i) {
+    start_time = now();
+    if (args->write_bytes(args, buf) < 0) {
+      gpr_log(GPR_ERROR, "Client write failed");
+      goto error;
+    }
+    if (args->read_bytes(args, buf) < 0) {
+      gpr_log(GPR_ERROR, "Client read failed");
+      goto error;
+    }
+    end_time = now();
+    if (i > kNumIters / 2) {
+      interval = end_time - start_time;
+      gpr_histogram_add(histogram, interval);
+    }
+  }
+  print_histogram(histogram);
+error:
+  gpr_free(buf);
+  gpr_histogram_destroy(histogram);
+}
+
+/* This roughly matches tcp_server's create_listening_socket */
+static int create_listening_socket(struct sockaddr* port, socklen_t len) {
+  int fd = socket(port->sa_family, SOCK_STREAM, 0);
+  if (fd < 0) {
+    gpr_log(GPR_ERROR, "Unable to create socket: %s", strerror(errno));
+    goto error;
+  }
+
+  if (!GRPC_LOG_IF_ERROR("Failed to set listening socket cloexec",
+                         grpc_set_socket_cloexec(fd, 1))) {
+    goto error;
+  }
+  if (!GRPC_LOG_IF_ERROR("Failed to set listening socket low latency",
+                         grpc_set_socket_low_latency(fd, 1))) {
+    goto error;
+  }
+  if (!GRPC_LOG_IF_ERROR("Failed to set listening socket reuse addr",
+                         grpc_set_socket_reuse_addr(fd, 1))) {
+    goto error;
+  }
+
+  if (bind(fd, port, len) < 0) {
+    gpr_log(GPR_ERROR, "bind: %s", strerror(errno));
+    goto error;
+  }
+
+  if (listen(fd, 1) < 0) {
+    gpr_log(GPR_ERROR, "listen: %s", strerror(errno));
+    goto error;
+  }
+
+  if (getsockname(fd, port, &len) < 0) {
+    gpr_log(GPR_ERROR, "getsockname: %s", strerror(errno));
+    goto error;
+  }
+
+  return fd;
+
+error:
+  if (fd >= 0) {
+    close(fd);
+  }
+  return -1;
+}
+
+static int connect_client(struct sockaddr* addr, socklen_t len) {
+  int fd = socket(addr->sa_family, SOCK_STREAM, 0);
+  int err;
+  if (fd < 0) {
+    gpr_log(GPR_ERROR, "Unable to create socket: %s", strerror(errno));
+    goto error;
+  }
+
+  if (!GRPC_LOG_IF_ERROR("Failed to set connecting socket cloexec",
+                         grpc_set_socket_cloexec(fd, 1))) {
+    goto error;
+  }
+  if (!GRPC_LOG_IF_ERROR("Failed to set connecting socket low latency",
+                         grpc_set_socket_low_latency(fd, 1))) {
+    goto error;
+  }
+
+  do {
+    err = connect(fd, addr, len);
+  } while (err < 0 && errno == EINTR);
+
+  if (err < 0) {
+    gpr_log(GPR_ERROR, "connect error: %s", strerror(errno));
+    goto error;
+  }
+  return fd;
+
+error:
+  if (fd >= 0) {
+    close(fd);
+  }
+  return -1;
+}
+
+static int accept_server(int listen_fd) {
+  int fd = accept(listen_fd, NULL, NULL);
+  if (fd < 0) {
+    gpr_log(GPR_ERROR, "Accept failed: %s", strerror(errno));
+    return -1;
+  }
+  return fd;
+}
+
+static int create_sockets_tcp(fd_pair* client_fds, fd_pair* server_fds) {
+  int listen_fd = -1;
+  int client_fd = -1;
+  int server_fd = -1;
+
+  struct sockaddr_in port;
+  struct sockaddr* sa_port = (struct sockaddr*)&port;
+
+  port.sin_family = AF_INET;
+  port.sin_port = 0;
+  port.sin_addr.s_addr = INADDR_ANY;
+
+  listen_fd = create_listening_socket(sa_port, sizeof(port));
+  if (listen_fd == -1) {
+    gpr_log(GPR_ERROR, "Listen failed");
+    goto error;
+  }
+
+  client_fd = connect_client(sa_port, sizeof(port));
+  if (client_fd == -1) {
+    gpr_log(GPR_ERROR, "Connect failed");
+    goto error;
+  }
+
+  server_fd = accept_server(listen_fd);
+  if (server_fd == -1) {
+    gpr_log(GPR_ERROR, "Accept failed");
+    goto error;
+  }
+
+  client_fds->read_fd = client_fd;
+  client_fds->write_fd = client_fd;
+  server_fds->read_fd = server_fd;
+  server_fds->write_fd = server_fd;
+  close(listen_fd);
+  return 0;
+
+error:
+  if (listen_fd != -1) {
+    close(listen_fd);
+  }
+  if (client_fd != -1) {
+    close(client_fd);
+  }
+  if (server_fd != -1) {
+    close(server_fd);
+  }
+  return -1;
+}
+
+static int create_sockets_socketpair(fd_pair* client_fds, fd_pair* server_fds) {
+  int fds[2];
+  if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
+    gpr_log(GPR_ERROR, "socketpair: %s", strerror(errno));
+    return -1;
+  }
+
+  client_fds->read_fd = fds[0];
+  client_fds->write_fd = fds[0];
+  server_fds->read_fd = fds[1];
+  server_fds->write_fd = fds[1];
+  return 0;
+}
+
+static int create_sockets_pipe(fd_pair* client_fds, fd_pair* server_fds) {
+  int cfds[2];
+  int sfds[2];
+  if (pipe(cfds) < 0) {
+    gpr_log(GPR_ERROR, "pipe: %s", strerror(errno));
+    return -1;
+  }
+
+  if (pipe(sfds) < 0) {
+    gpr_log(GPR_ERROR, "pipe: %s", strerror(errno));
+    return -1;
+  }
+
+  client_fds->read_fd = cfds[0];
+  client_fds->write_fd = cfds[1];
+  server_fds->read_fd = sfds[0];
+  server_fds->write_fd = sfds[1];
+  return 0;
+}
+
+static const char* read_strategy_usage =
+    "Strategy for doing reads, which is one of:\n"
+    "  blocking: blocking read calls\n"
+    "  same_thread_poll: poll() call on same thread \n"
+#ifdef __linux__
+    "  same_thread_epoll: epoll_wait() on same thread \n"
+#endif
+    "  spin_read: spinning non-blocking read() calls \n"
+    "  spin_poll: spinning 0 timeout poll() calls \n"
+#ifdef __linux__
+    "  spin_epoll: spinning 0 timeout epoll_wait() calls \n"
+#endif
+    "";
+
+static const char* socket_type_usage =
+    "Type of socket used, one of:\n"
+    "  tcp: fds are endpoints of a TCP connection\n"
+    "  socketpair: fds come from socketpair()\n"
+    "  pipe: fds come from pipe()\n";
+
+void print_usage(char* argv0) {
+  fprintf(stderr, "%s usage:\n\n", argv0);
+  fprintf(stderr, "%s read_strategy socket_type msg_size\n\n", argv0);
+  fprintf(stderr, "where read_strategy is one of:\n");
+  fprintf(stderr, "  blocking: blocking read calls\n");
+  fprintf(stderr, "  same_thread_poll: poll() call on same thread \n");
+#ifdef __linux__
+  fprintf(stderr, "  same_thread_epoll: epoll_wait() on same thread \n");
+#endif
+  fprintf(stderr, "  spin_read: spinning non-blocking read() calls \n");
+  fprintf(stderr, "  spin_poll: spinning 0 timeout poll() calls \n");
+#ifdef __linux__
+  fprintf(stderr, "  spin_epoll: spinning 0 timeout epoll_wait() calls \n");
+#endif
+  fprintf(stderr, "and socket_type is one of:\n");
+  fprintf(stderr, "  tcp: fds are endpoints of a TCP connection\n");
+  fprintf(stderr, "  socketpair: fds come from socketpair()\n");
+  fprintf(stderr, "  pipe: fds come from pipe()\n");
+}
+
+typedef struct test_strategy {
+  const char* name;
+  int (*read_strategy)(struct thread_args* args, char* buf);
+  int (*setup)(struct thread_args* args);
+} test_strategy;
+
+static test_strategy test_strategies[] = {
+    {"blocking", blocking_read_bytes, do_nothing},
+    {"same_thread_poll", poll_read_bytes_blocking, set_socket_nonblocking},
+#ifdef __linux__
+    {"same_thread_epoll", epoll_read_bytes_blocking, epoll_setup},
+    {"spin_epoll", epoll_read_bytes_spin, epoll_setup},
+#endif /* __linux__ */
+    {"spin_read", spin_read_bytes, set_socket_nonblocking},
+    {"spin_poll", poll_read_bytes_spin, set_socket_nonblocking}};
+
+static const char* socket_types[] = {"tcp", "socketpair", "pipe"};
+
+int create_socket(const char* socket_type, fd_pair* client_fds,
+                  fd_pair* server_fds) {
+  if (strcmp(socket_type, "tcp") == 0) {
+    create_sockets_tcp(client_fds, server_fds);
+  } else if (strcmp(socket_type, "socketpair") == 0) {
+    create_sockets_socketpair(client_fds, server_fds);
+  } else if (strcmp(socket_type, "pipe") == 0) {
+    create_sockets_pipe(client_fds, server_fds);
+  } else {
+    fprintf(stderr, "Invalid socket type %s\n", socket_type);
+    return -1;
+  }
+  return 0;
+}
+
+static int run_benchmark(const char* socket_type, thread_args* client_args,
+                         thread_args* server_args) {
+  gpr_thd_id tid;
+  int rv = 0;
+
+  rv = create_socket(socket_type, &client_args->fds, &server_args->fds);
+  if (rv < 0) {
+    return rv;
+  }
+
+  gpr_log(GPR_INFO, "Starting test %s %s %zu", client_args->strategy_name,
+          socket_type, client_args->msg_size);
+
+  gpr_thd_new(&tid, server_thread_wrap, server_args, NULL);
+  client_thread(client_args);
+  return 0;
+}
+
+static int run_all_benchmarks(size_t msg_size) {
+  int error = 0;
+  size_t i;
+  for (i = 0; i < GPR_ARRAY_SIZE(test_strategies); ++i) {
+    test_strategy* strategy = &test_strategies[i];
+    size_t j;
+    for (j = 0; j < GPR_ARRAY_SIZE(socket_types); ++j) {
+      thread_args* client_args =
+          static_cast<thread_args*>(gpr_malloc(sizeof(thread_args)));
+      thread_args* server_args =
+          static_cast<thread_args*>(gpr_malloc(sizeof(thread_args)));
+      const char* socket_type = socket_types[j];
+
+      client_args->read_bytes = strategy->read_strategy;
+      client_args->write_bytes = blocking_write_bytes;
+      client_args->setup = strategy->setup;
+      client_args->msg_size = msg_size;
+      client_args->strategy_name = strategy->name;
+      server_args->read_bytes = strategy->read_strategy;
+      server_args->write_bytes = blocking_write_bytes;
+      server_args->setup = strategy->setup;
+      server_args->msg_size = msg_size;
+      server_args->strategy_name = strategy->name;
+      error = run_benchmark(socket_type, client_args, server_args);
+      if (error < 0) {
+        return error;
+      }
+    }
+  }
+  return error;
+}
+
+int main(int argc, char** argv) {
+  thread_args* client_args =
+      static_cast<thread_args*>(gpr_malloc(sizeof(thread_args)));
+  thread_args* server_args =
+      static_cast<thread_args*>(gpr_malloc(sizeof(thread_args)));
+  int msg_size = -1;
+  const char* read_strategy = NULL;
+  const char* socket_type = NULL;
+  size_t i;
+  const test_strategy* strategy = NULL;
+  int error = 0;
+
+  gpr_cmdline* cmdline =
+      gpr_cmdline_create("low_level_ping_pong network benchmarking tool");
+
+  gpr_cmdline_add_int(cmdline, "msg_size", "Size of sent messages", &msg_size);
+  gpr_cmdline_add_string(cmdline, "read_strategy", read_strategy_usage,
+                         &read_strategy);
+  gpr_cmdline_add_string(cmdline, "socket_type", socket_type_usage,
+                         &socket_type);
+
+  gpr_cmdline_parse(cmdline, argc, argv);
+
+  if (msg_size == -1) {
+    msg_size = 50;
+  }
+
+  if (read_strategy == NULL) {
+    gpr_log(GPR_INFO, "No strategy specified, running all benchmarks");
+    return run_all_benchmarks((size_t)msg_size);
+  }
+
+  if (socket_type == NULL) {
+    socket_type = "tcp";
+  }
+  if (msg_size <= 0) {
+    fprintf(stderr, "msg_size must be > 0\n");
+    print_usage(argv[0]);
+    return -1;
+  }
+
+  for (i = 0; i < GPR_ARRAY_SIZE(test_strategies); ++i) {
+    if (strcmp(test_strategies[i].name, read_strategy) == 0) {
+      strategy = &test_strategies[i];
+    }
+  }
+  if (strategy == NULL) {
+    fprintf(stderr, "Invalid read strategy %s\n", read_strategy);
+    return -1;
+  }
+
+  client_args->read_bytes = strategy->read_strategy;
+  client_args->write_bytes = blocking_write_bytes;
+  client_args->setup = strategy->setup;
+  client_args->msg_size = (size_t)msg_size;
+  client_args->strategy_name = read_strategy;
+  server_args->read_bytes = strategy->read_strategy;
+  server_args->write_bytes = blocking_write_bytes;
+  server_args->setup = strategy->setup;
+  server_args->msg_size = (size_t)msg_size;
+  server_args->strategy_name = read_strategy;
+
+  error = run_benchmark(socket_type, client_args, server_args);
+
+  gpr_cmdline_destroy(cmdline);
+  return error;
+}
diff --git a/test/core/security/BUILD b/test/core/security/BUILD
index dc41759..7cd3ae5 100644
--- a/test/core/security/BUILD
+++ b/test/core/security/BUILD
@@ -22,8 +22,8 @@
 
 grpc_fuzzer(
     name = "ssl_server_fuzzer",
-    srcs = ["ssl_server_fuzzer.c"],
-    language = "C",
+    srcs = ["ssl_server_fuzzer.cc"],
+    language = "C++",
     corpus = "corpus",
     deps = [
         "//:gpr",
@@ -35,17 +35,17 @@
 
 grpc_cc_library(
     name = "oauth2_utils",
-    srcs = ["oauth2_utils.c"],
+    srcs = ["oauth2_utils.cc"],
     hdrs = ["oauth2_utils.h"],
-    language = "C",
+    language = "C++",
     deps = ["//:grpc"],
     visibility = ["//test/cpp:__subpackages__"],
 )
 
 grpc_cc_test(
     name = "auth_context_test",
-    srcs = ["auth_context_test.c"],
-    language = "C",
+    srcs = ["auth_context_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -56,8 +56,8 @@
 
 grpc_cc_test(
     name = "credentials_test",
-    srcs = ["credentials_test.c"],
-    language = "C",
+    srcs = ["credentials_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -68,8 +68,8 @@
 
 grpc_cc_test(
     name = "secure_endpoint_test",
-    srcs = ["secure_endpoint_test.c"],
-    language = "C",
+    srcs = ["secure_endpoint_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -81,8 +81,8 @@
 
 grpc_cc_test(
     name = "security_connector_test",
-    srcs = ["security_connector_test.c"],
-    language = "C",
+    srcs = ["security_connector_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -91,10 +91,22 @@
     ],
 )
 
+grpc_cc_test(
+    name = "ssl_credentials_test",
+    srcs = ["ssl_credentials_test.cc"],
+    language = "C++",
+    deps = [
+        "//:gpr",
+        "//:grpc",
+        "//test/core/util:gpr_test_util",
+        "//test/core/util:grpc_test_util",
+    ]
+)
+
 grpc_cc_binary(
     name = "create_jwt",
-    srcs = ["create_jwt.c"],
-    language = "C",
+    srcs = ["create_jwt.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -103,8 +115,8 @@
 
 grpc_cc_binary(
     name = "fetch_oauth2",
-    srcs = ["fetch_oauth2.c"],
-    language = "C",
+    srcs = ["fetch_oauth2.cc"],
+    language = "C++",
     deps = [
         ":oauth2_utils",
         "//:gpr",
@@ -114,8 +126,8 @@
 
 grpc_cc_binary(
     name = "verify_jwt",
-    srcs = ["verify_jwt.c"],
-    language = "C",
+    srcs = ["verify_jwt.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/security/auth_context_test.c b/test/core/security/auth_context_test.c
deleted file mode 100644
index 88daf28..0000000
--- a/test/core/security/auth_context_test.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include "src/core/lib/security/context/security_context.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/util/test_config.h"
-
-#include <grpc/support/log.h>
-
-static void test_empty_context(void) {
-  grpc_auth_context *ctx = grpc_auth_context_create(NULL);
-  grpc_auth_property_iterator it;
-
-  gpr_log(GPR_INFO, "test_empty_context");
-  GPR_ASSERT(ctx != NULL);
-  GPR_ASSERT(grpc_auth_context_peer_identity_property_name(ctx) == NULL);
-  it = grpc_auth_context_peer_identity(ctx);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
-  it = grpc_auth_context_property_iterator(ctx);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
-  it = grpc_auth_context_find_properties_by_name(ctx, "foo");
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
-  GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(ctx, "bar") ==
-             0);
-  GPR_ASSERT(grpc_auth_context_peer_identity_property_name(ctx) == NULL);
-  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
-}
-
-static void test_simple_context(void) {
-  grpc_auth_context *ctx = grpc_auth_context_create(NULL);
-  grpc_auth_property_iterator it;
-  size_t i;
-
-  gpr_log(GPR_INFO, "test_simple_context");
-  GPR_ASSERT(ctx != NULL);
-  grpc_auth_context_add_cstring_property(ctx, "name", "chapi");
-  grpc_auth_context_add_cstring_property(ctx, "name", "chapo");
-  grpc_auth_context_add_cstring_property(ctx, "foo", "bar");
-  GPR_ASSERT(ctx->properties.count == 3);
-  GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(ctx, "name") ==
-             1);
-
-  GPR_ASSERT(
-      strcmp(grpc_auth_context_peer_identity_property_name(ctx), "name") == 0);
-  it = grpc_auth_context_property_iterator(ctx);
-  for (i = 0; i < ctx->properties.count; i++) {
-    const grpc_auth_property *p = grpc_auth_property_iterator_next(&it);
-    GPR_ASSERT(p == &ctx->properties.array[i]);
-  }
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
-
-  it = grpc_auth_context_find_properties_by_name(ctx, "foo");
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
-             &ctx->properties.array[2]);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
-
-  it = grpc_auth_context_peer_identity(ctx);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
-             &ctx->properties.array[0]);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
-             &ctx->properties.array[1]);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
-
-  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
-}
-
-static void test_chained_context(void) {
-  grpc_auth_context *chained = grpc_auth_context_create(NULL);
-  grpc_auth_context *ctx = grpc_auth_context_create(chained);
-  grpc_auth_property_iterator it;
-  size_t i;
-
-  gpr_log(GPR_INFO, "test_chained_context");
-  GRPC_AUTH_CONTEXT_UNREF(chained, "chained");
-  grpc_auth_context_add_cstring_property(chained, "name", "padapo");
-  grpc_auth_context_add_cstring_property(chained, "foo", "baz");
-  grpc_auth_context_add_cstring_property(ctx, "name", "chapi");
-  grpc_auth_context_add_cstring_property(ctx, "name", "chap0");
-  grpc_auth_context_add_cstring_property(ctx, "foo", "bar");
-  GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(ctx, "name") ==
-             1);
-
-  GPR_ASSERT(
-      strcmp(grpc_auth_context_peer_identity_property_name(ctx), "name") == 0);
-  it = grpc_auth_context_property_iterator(ctx);
-  for (i = 0; i < ctx->properties.count; i++) {
-    const grpc_auth_property *p = grpc_auth_property_iterator_next(&it);
-    GPR_ASSERT(p == &ctx->properties.array[i]);
-  }
-  for (i = 0; i < chained->properties.count; i++) {
-    const grpc_auth_property *p = grpc_auth_property_iterator_next(&it);
-    GPR_ASSERT(p == &chained->properties.array[i]);
-  }
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
-
-  it = grpc_auth_context_find_properties_by_name(ctx, "foo");
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
-             &ctx->properties.array[2]);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
-             &chained->properties.array[1]);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
-
-  it = grpc_auth_context_peer_identity(ctx);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
-             &ctx->properties.array[0]);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
-             &ctx->properties.array[1]);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
-             &chained->properties.array[0]);
-  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
-
-  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_empty_context();
-  test_simple_context();
-  test_chained_context();
-  return 0;
-}
diff --git a/test/core/security/auth_context_test.cc b/test/core/security/auth_context_test.cc
new file mode 100644
index 0000000..3ab9190
--- /dev/null
+++ b/test/core/security/auth_context_test.cc
@@ -0,0 +1,138 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include "src/core/lib/security/context/security_context.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/util/test_config.h"
+
+#include <grpc/support/log.h>
+
+static void test_empty_context(void) {
+  grpc_auth_context* ctx = grpc_auth_context_create(NULL);
+  grpc_auth_property_iterator it;
+
+  gpr_log(GPR_INFO, "test_empty_context");
+  GPR_ASSERT(ctx != NULL);
+  GPR_ASSERT(grpc_auth_context_peer_identity_property_name(ctx) == NULL);
+  it = grpc_auth_context_peer_identity(ctx);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
+  it = grpc_auth_context_property_iterator(ctx);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
+  it = grpc_auth_context_find_properties_by_name(ctx, "foo");
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
+  GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(ctx, "bar") ==
+             0);
+  GPR_ASSERT(grpc_auth_context_peer_identity_property_name(ctx) == NULL);
+  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static void test_simple_context(void) {
+  grpc_auth_context* ctx = grpc_auth_context_create(NULL);
+  grpc_auth_property_iterator it;
+  size_t i;
+
+  gpr_log(GPR_INFO, "test_simple_context");
+  GPR_ASSERT(ctx != NULL);
+  grpc_auth_context_add_cstring_property(ctx, "name", "chapi");
+  grpc_auth_context_add_cstring_property(ctx, "name", "chapo");
+  grpc_auth_context_add_cstring_property(ctx, "foo", "bar");
+  GPR_ASSERT(ctx->properties.count == 3);
+  GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(ctx, "name") ==
+             1);
+
+  GPR_ASSERT(
+      strcmp(grpc_auth_context_peer_identity_property_name(ctx), "name") == 0);
+  it = grpc_auth_context_property_iterator(ctx);
+  for (i = 0; i < ctx->properties.count; i++) {
+    const grpc_auth_property* p = grpc_auth_property_iterator_next(&it);
+    GPR_ASSERT(p == &ctx->properties.array[i]);
+  }
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
+
+  it = grpc_auth_context_find_properties_by_name(ctx, "foo");
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
+             &ctx->properties.array[2]);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
+
+  it = grpc_auth_context_peer_identity(ctx);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
+             &ctx->properties.array[0]);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
+             &ctx->properties.array[1]);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
+
+  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static void test_chained_context(void) {
+  grpc_auth_context* chained = grpc_auth_context_create(NULL);
+  grpc_auth_context* ctx = grpc_auth_context_create(chained);
+  grpc_auth_property_iterator it;
+  size_t i;
+
+  gpr_log(GPR_INFO, "test_chained_context");
+  GRPC_AUTH_CONTEXT_UNREF(chained, "chained");
+  grpc_auth_context_add_cstring_property(chained, "name", "padapo");
+  grpc_auth_context_add_cstring_property(chained, "foo", "baz");
+  grpc_auth_context_add_cstring_property(ctx, "name", "chapi");
+  grpc_auth_context_add_cstring_property(ctx, "name", "chap0");
+  grpc_auth_context_add_cstring_property(ctx, "foo", "bar");
+  GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(ctx, "name") ==
+             1);
+
+  GPR_ASSERT(
+      strcmp(grpc_auth_context_peer_identity_property_name(ctx), "name") == 0);
+  it = grpc_auth_context_property_iterator(ctx);
+  for (i = 0; i < ctx->properties.count; i++) {
+    const grpc_auth_property* p = grpc_auth_property_iterator_next(&it);
+    GPR_ASSERT(p == &ctx->properties.array[i]);
+  }
+  for (i = 0; i < chained->properties.count; i++) {
+    const grpc_auth_property* p = grpc_auth_property_iterator_next(&it);
+    GPR_ASSERT(p == &chained->properties.array[i]);
+  }
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
+
+  it = grpc_auth_context_find_properties_by_name(ctx, "foo");
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
+             &ctx->properties.array[2]);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
+             &chained->properties.array[1]);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
+
+  it = grpc_auth_context_peer_identity(ctx);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
+             &ctx->properties.array[0]);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
+             &ctx->properties.array[1]);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) ==
+             &chained->properties.array[0]);
+  GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
+
+  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_empty_context();
+  test_simple_context();
+  test_chained_context();
+  return 0;
+}
diff --git a/test/core/security/create_jwt.c b/test/core/security/create_jwt.c
deleted file mode 100644
index 93ea27f..0000000
--- a/test/core/security/create_jwt.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "src/core/lib/iomgr/load_file.h"
-#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
-
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/cmdline.h>
-#include <grpc/support/log.h>
-
-void create_jwt(const char *json_key_file_path, const char *service_url,
-                const char *scope) {
-  grpc_auth_json_key key;
-  char *jwt;
-  grpc_slice json_key_data;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "load_file", grpc_load_file(json_key_file_path, 1, &json_key_data)));
-  key = grpc_auth_json_key_create_from_string(
-      (const char *)GRPC_SLICE_START_PTR(json_key_data));
-  grpc_slice_unref(json_key_data);
-  if (!grpc_auth_json_key_is_valid(&key)) {
-    fprintf(stderr, "Could not parse json key.\n");
-    exit(1);
-  }
-  jwt = grpc_jwt_encode_and_sign(
-      &key, service_url == NULL ? GRPC_JWT_OAUTH2_AUDIENCE : service_url,
-      grpc_max_auth_token_lifetime(), scope);
-  grpc_auth_json_key_destruct(&key);
-  if (jwt == NULL) {
-    fprintf(stderr, "Could not create JWT.\n");
-    exit(1);
-  }
-  fprintf(stdout, "%s\n", jwt);
-  gpr_free(jwt);
-}
-
-int main(int argc, char **argv) {
-  char *scope = NULL;
-  char *json_key_file_path = NULL;
-  char *service_url = NULL;
-  grpc_init();
-  gpr_cmdline *cl = gpr_cmdline_create("create_jwt");
-  gpr_cmdline_add_string(cl, "json_key", "File path of the json key.",
-                         &json_key_file_path);
-  gpr_cmdline_add_string(cl, "scope",
-                         "OPTIONAL Space delimited permissions. Mutually "
-                         "exclusive with service_url",
-                         &scope);
-  gpr_cmdline_add_string(cl, "service_url",
-                         "OPTIONAL service URL. Mutually exclusive with scope.",
-                         &service_url);
-  gpr_cmdline_parse(cl, argc, argv);
-
-  if (json_key_file_path == NULL) {
-    fprintf(stderr, "Missing --json_key option.\n");
-    exit(1);
-  }
-  if (scope != NULL) {
-    if (service_url != NULL) {
-      fprintf(stderr,
-              "Options --scope and --service_url are mutually exclusive.\n");
-      exit(1);
-    }
-  } else if (service_url == NULL) {
-    fprintf(stderr, "Need one of --service_url or --scope options.\n");
-    exit(1);
-  }
-
-  create_jwt(json_key_file_path, service_url, scope);
-
-  gpr_cmdline_destroy(cl);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/security/create_jwt.cc b/test/core/security/create_jwt.cc
new file mode 100644
index 0000000..95f3615
--- /dev/null
+++ b/test/core/security/create_jwt.cc
@@ -0,0 +1,93 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
+
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/log.h>
+
+void create_jwt(const char* json_key_file_path, const char* service_url,
+                const char* scope) {
+  grpc_auth_json_key key;
+  char* jwt;
+  grpc_slice json_key_data;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "load_file", grpc_load_file(json_key_file_path, 1, &json_key_data)));
+  key = grpc_auth_json_key_create_from_string(
+      (const char*)GRPC_SLICE_START_PTR(json_key_data));
+  grpc_slice_unref(json_key_data);
+  if (!grpc_auth_json_key_is_valid(&key)) {
+    fprintf(stderr, "Could not parse json key.\n");
+    exit(1);
+  }
+  jwt = grpc_jwt_encode_and_sign(
+      &key, service_url == NULL ? GRPC_JWT_OAUTH2_AUDIENCE : service_url,
+      grpc_max_auth_token_lifetime(), scope);
+  grpc_auth_json_key_destruct(&key);
+  if (jwt == NULL) {
+    fprintf(stderr, "Could not create JWT.\n");
+    exit(1);
+  }
+  fprintf(stdout, "%s\n", jwt);
+  gpr_free(jwt);
+}
+
+int main(int argc, char** argv) {
+  const char* scope = NULL;
+  const char* json_key_file_path = NULL;
+  const char* service_url = NULL;
+  grpc_init();
+  gpr_cmdline* cl = gpr_cmdline_create("create_jwt");
+  gpr_cmdline_add_string(cl, "json_key", "File path of the json key.",
+                         &json_key_file_path);
+  gpr_cmdline_add_string(cl, "scope",
+                         "OPTIONAL Space delimited permissions. Mutually "
+                         "exclusive with service_url",
+                         &scope);
+  gpr_cmdline_add_string(cl, "service_url",
+                         "OPTIONAL service URL. Mutually exclusive with scope.",
+                         &service_url);
+  gpr_cmdline_parse(cl, argc, argv);
+
+  if (json_key_file_path == NULL) {
+    fprintf(stderr, "Missing --json_key option.\n");
+    exit(1);
+  }
+  if (scope != NULL) {
+    if (service_url != NULL) {
+      fprintf(stderr,
+              "Options --scope and --service_url are mutually exclusive.\n");
+      exit(1);
+    }
+  } else if (service_url == NULL) {
+    fprintf(stderr, "Need one of --service_url or --scope options.\n");
+    exit(1);
+  }
+
+  create_jwt(json_key_file_path, service_url, scope);
+
+  gpr_cmdline_destroy(cl);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c
deleted file mode 100644
index 34f3101..0000000
--- a/test/core/security/credentials_test.c
+++ /dev/null
@@ -1,1216 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/security/credentials/credentials.h"
-
-#include <openssl/rsa.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/http/httpcli.h"
-#include "src/core/lib/security/credentials/composite/composite_credentials.h"
-#include "src/core/lib/security/credentials/fake/fake_credentials.h"
-#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
-#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
-#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/support/tmpfile.h"
-#include "test/core/util/test_config.h"
-
-/* -- Mock channel credentials. -- */
-
-static grpc_channel_credentials *grpc_mock_channel_credentials_create(
-    const grpc_channel_credentials_vtable *vtable) {
-  grpc_channel_credentials *c = gpr_malloc(sizeof(*c));
-  memset(c, 0, sizeof(*c));
-  c->type = "mock";
-  c->vtable = vtable;
-  gpr_ref_init(&c->refcount, 1);
-  return c;
-}
-
-/* -- Constants. -- */
-
-static const char test_google_iam_authorization_token[] = "blahblahblhahb";
-static const char test_google_iam_authority_selector[] = "respectmyauthoritah";
-static const char test_oauth2_bearer_token[] =
-    "Bearer blaaslkdjfaslkdfasdsfasf";
-
-/* This JSON key was generated with the GCE console and revoked immediately.
-   The identifiers have been changed as well.
-   Maximum size for a string literal is 509 chars in C89, yay!  */
-static const char test_json_key_str_part1[] =
-    "{ \"private_key\": \"-----BEGIN PRIVATE KEY-----"
-    "\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE"
-    "qg"
-    "WGjiw71NfXByguekSKho65FxaGbsnSM9SMQAqVk7Q2rG+I0OpsT0LrWQtZ\\nyjSeg/"
-    "rWBQvS4hle4LfijkP3J5BG+"
-    "IXDMP8RfziNRQsenAXDNPkY4kJCvKux2xdD\\nOnVF6N7dL3nTYZg+"
-    "uQrNsMTz9UxVAgMBAAECgYEAzbLewe1xe9vy+2GoSsfib+28\\nDZgSE6Bu/"
-    "zuFoPrRc6qL9p2SsnV7txrunTyJkkOnPLND9ABAXybRTlcVKP/sGgza\\n/"
-    "8HpCqFYM9V8f34SBWfD4fRFT+n/"
-    "73cfRUtGXdXpseva2lh8RilIQfPhNZAncenU\\ngqXjDvpkypEusgXAykECQQD+";
-static const char test_json_key_str_part2[] =
-    "53XxNVnxBHsYb+AYEfklR96yVi8HywjVHP34+OQZ\\nCslxoHQM8s+"
-    "dBnjfScLu22JqkPv04xyxmt0QAKm9+vTdAkEA4ib7YvEAn2jXzcCI\\nEkoy2L/"
-    "XydR1GCHoacdfdAwiL2npOdnbvi4ZmdYRPY1LSTO058tQHKVXV7NLeCa3\\nAARh2QJBAMKeDA"
-    "G"
-    "W303SQv2cZTdbeaLKJbB5drz3eo3j7dDKjrTD9JupixFbzcGw\\n8FZi5c8idxiwC36kbAL6Hz"
-    "A"
-    "ZoX+ofI0CQE6KCzPJTtYNqyShgKAZdJ8hwOcvCZtf\\n6z8RJm0+"
-    "6YBd38lfh5j8mZd7aHFf6I17j5AQY7oPEc47TjJj/"
-    "5nZ68ECQQDvYuI3\\nLyK5fS8g0SYbmPOL9TlcHDOqwG0mrX9qpg5DC2fniXNSrrZ64GTDKdzZ"
-    "Y"
-    "Ap6LI9W\\nIqv4vr6y38N79TTC\\n-----END PRIVATE KEY-----\\n\", ";
-static const char test_json_key_str_part3[] =
-    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-    "\"client_email\": "
-    "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
-    "com\", \"client_id\": "
-    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-    "com\", \"type\": \"service_account\" }";
-
-/* Test refresh token. */
-static const char test_refresh_token_str[] =
-    "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
-    "  \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
-    "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\","
-    "  \"type\": \"authorized_user\"}";
-
-static const char valid_oauth2_json_response[] =
-    "{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
-    " \"expires_in\":3599, "
-    " \"token_type\":\"Bearer\"}";
-
-static const char test_scope[] = "perm1 perm2";
-
-static const char test_signed_jwt[] =
-    "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0OTRkN2M1YWU2MGRmOTcyNmM4YW"
-    "U0MDcyZTViYTdmZDkwODg2YzcifQ";
-
-static const char test_service_url[] = "https://foo.com/foo.v1";
-static const char other_test_service_url[] = "https://bar.com/bar.v1";
-
-static const char test_method[] = "ThisIsNotAMethod";
-
-/* -- Utils. -- */
-
-static char *test_json_key_str(void) {
-  size_t result_len = strlen(test_json_key_str_part1) +
-                      strlen(test_json_key_str_part2) +
-                      strlen(test_json_key_str_part3);
-  char *result = gpr_malloc(result_len + 1);
-  char *current = result;
-  strcpy(result, test_json_key_str_part1);
-  current += strlen(test_json_key_str_part1);
-  strcpy(current, test_json_key_str_part2);
-  current += strlen(test_json_key_str_part2);
-  strcpy(current, test_json_key_str_part3);
-  return result;
-}
-
-static grpc_httpcli_response http_response(int status, const char *body) {
-  grpc_httpcli_response response;
-  memset(&response, 0, sizeof(grpc_httpcli_response));
-  response.status = status;
-  response.body = gpr_strdup((char *)body);
-  response.body_length = strlen(body);
-  return response;
-}
-
-/* -- Tests. -- */
-
-static void test_empty_md_array(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_credentials_mdelem_array md_array;
-  memset(&md_array, 0, sizeof(md_array));
-  GPR_ASSERT(md_array.md == NULL);
-  GPR_ASSERT(md_array.size == 0);
-  grpc_credentials_mdelem_array_destroy(&exec_ctx, &md_array);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_add_to_empty_md_array(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_credentials_mdelem_array md_array;
-  memset(&md_array, 0, sizeof(md_array));
-  const char *key = "hello";
-  const char *value = "there blah blah blah blah blah blah blah";
-  grpc_mdelem md =
-      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_copied_string(key),
-                              grpc_slice_from_copied_string(value));
-  grpc_credentials_mdelem_array_add(&md_array, md);
-  GPR_ASSERT(md_array.size == 1);
-  GPR_ASSERT(grpc_mdelem_eq(md, md_array.md[0]));
-  GRPC_MDELEM_UNREF(&exec_ctx, md);
-  grpc_credentials_mdelem_array_destroy(&exec_ctx, &md_array);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_add_abunch_to_md_array(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_credentials_mdelem_array md_array;
-  memset(&md_array, 0, sizeof(md_array));
-  const char *key = "hello";
-  const char *value = "there blah blah blah blah blah blah blah";
-  grpc_mdelem md =
-      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_copied_string(key),
-                              grpc_slice_from_copied_string(value));
-  size_t num_entries = 1000;
-  for (size_t i = 0; i < num_entries; ++i) {
-    grpc_credentials_mdelem_array_add(&md_array, md);
-  }
-  for (size_t i = 0; i < num_entries; ++i) {
-    GPR_ASSERT(grpc_mdelem_eq(md_array.md[i], md));
-  }
-  GRPC_MDELEM_UNREF(&exec_ctx, md);
-  grpc_credentials_mdelem_array_destroy(&exec_ctx, &md_array);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_oauth2_token_fetcher_creds_parsing_ok(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem token_md = GRPC_MDNULL;
-  grpc_millis token_lifetime;
-  grpc_httpcli_response response =
-      http_response(200, valid_oauth2_json_response);
-  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
-                 &exec_ctx, &response, &token_md, &token_lifetime) ==
-             GRPC_CREDENTIALS_OK);
-  GPR_ASSERT(token_lifetime == 3599 * GPR_MS_PER_SEC);
-  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDKEY(token_md), "authorization") == 0);
-  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(token_md),
-                                "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") ==
-             0);
-  GRPC_MDELEM_UNREF(&exec_ctx, token_md);
-  grpc_http_response_destroy(&response);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_oauth2_token_fetcher_creds_parsing_bad_http_status(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem token_md = GRPC_MDNULL;
-  grpc_millis token_lifetime;
-  grpc_httpcli_response response =
-      http_response(401, valid_oauth2_json_response);
-  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
-                 &exec_ctx, &response, &token_md, &token_lifetime) ==
-             GRPC_CREDENTIALS_ERROR);
-  grpc_http_response_destroy(&response);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_oauth2_token_fetcher_creds_parsing_empty_http_body(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem token_md = GRPC_MDNULL;
-  grpc_millis token_lifetime;
-  grpc_httpcli_response response = http_response(200, "");
-  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
-                 &exec_ctx, &response, &token_md, &token_lifetime) ==
-             GRPC_CREDENTIALS_ERROR);
-  grpc_http_response_destroy(&response);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_oauth2_token_fetcher_creds_parsing_invalid_json(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem token_md = GRPC_MDNULL;
-  grpc_millis token_lifetime;
-  grpc_httpcli_response response =
-      http_response(200,
-                    "{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
-                    " \"expires_in\":3599, "
-                    " \"token_type\":\"Bearer\"");
-  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
-                 &exec_ctx, &response, &token_md, &token_lifetime) ==
-             GRPC_CREDENTIALS_ERROR);
-  grpc_http_response_destroy(&response);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_oauth2_token_fetcher_creds_parsing_missing_token(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem token_md = GRPC_MDNULL;
-  grpc_millis token_lifetime;
-  grpc_httpcli_response response = http_response(200,
-                                                 "{"
-                                                 " \"expires_in\":3599, "
-                                                 " \"token_type\":\"Bearer\"}");
-  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
-                 &exec_ctx, &response, &token_md, &token_lifetime) ==
-             GRPC_CREDENTIALS_ERROR);
-  grpc_http_response_destroy(&response);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_oauth2_token_fetcher_creds_parsing_missing_token_type(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem token_md = GRPC_MDNULL;
-  grpc_millis token_lifetime;
-  grpc_httpcli_response response =
-      http_response(200,
-                    "{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
-                    " \"expires_in\":3599, "
-                    "}");
-  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
-                 &exec_ctx, &response, &token_md, &token_lifetime) ==
-             GRPC_CREDENTIALS_ERROR);
-  grpc_http_response_destroy(&response);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_oauth2_token_fetcher_creds_parsing_missing_token_lifetime(
-    void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem token_md = GRPC_MDNULL;
-  grpc_millis token_lifetime;
-  grpc_httpcli_response response =
-      http_response(200,
-                    "{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
-                    " \"token_type\":\"Bearer\"}");
-  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
-                 &exec_ctx, &response, &token_md, &token_lifetime) ==
-             GRPC_CREDENTIALS_ERROR);
-  grpc_http_response_destroy(&response);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-typedef struct {
-  const char *key;
-  const char *value;
-} expected_md;
-
-typedef struct {
-  grpc_error *expected_error;
-  const expected_md *expected;
-  size_t expected_size;
-  grpc_credentials_mdelem_array md_array;
-  grpc_closure on_request_metadata;
-  grpc_call_credentials *creds;
-  grpc_polling_entity pollent;
-} request_metadata_state;
-
-static void check_metadata(const expected_md *expected,
-                           grpc_credentials_mdelem_array *md_array) {
-  for (size_t i = 0; i < md_array->size; ++i) {
-    size_t j;
-    for (j = 0; j < md_array->size; ++j) {
-      if (0 ==
-          grpc_slice_str_cmp(GRPC_MDKEY(md_array->md[j]), expected[i].key)) {
-        GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(md_array->md[j]),
-                                      expected[i].value) == 0);
-        break;
-      }
-    }
-    if (j == md_array->size) {
-      gpr_log(GPR_ERROR, "key %s not found", expected[i].key);
-      GPR_ASSERT(0);
-    }
-  }
-}
-
-static void check_request_metadata(grpc_exec_ctx *exec_ctx, void *arg,
-                                   grpc_error *error) {
-  request_metadata_state *state = (request_metadata_state *)arg;
-  gpr_log(GPR_INFO, "expected_error: %s",
-          grpc_error_string(state->expected_error));
-  gpr_log(GPR_INFO, "actual_error: %s", grpc_error_string(error));
-  if (state->expected_error == GRPC_ERROR_NONE) {
-    GPR_ASSERT(error == GRPC_ERROR_NONE);
-  } else {
-    grpc_slice expected_error;
-    GPR_ASSERT(grpc_error_get_str(state->expected_error,
-                                  GRPC_ERROR_STR_DESCRIPTION, &expected_error));
-    grpc_slice actual_error;
-    GPR_ASSERT(
-        grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &actual_error));
-    GPR_ASSERT(grpc_slice_cmp(expected_error, actual_error) == 0);
-    GRPC_ERROR_UNREF(state->expected_error);
-  }
-  gpr_log(GPR_INFO, "expected_size=%" PRIdPTR " actual_size=%" PRIdPTR,
-          state->expected_size, state->md_array.size);
-  GPR_ASSERT(state->md_array.size == state->expected_size);
-  check_metadata(state->expected, &state->md_array);
-  grpc_credentials_mdelem_array_destroy(exec_ctx, &state->md_array);
-  grpc_pollset_set_destroy(exec_ctx,
-                           grpc_polling_entity_pollset_set(&state->pollent));
-  gpr_free(state);
-}
-
-static request_metadata_state *make_request_metadata_state(
-    grpc_error *expected_error, const expected_md *expected,
-    size_t expected_size) {
-  request_metadata_state *state = gpr_zalloc(sizeof(*state));
-  state->expected_error = expected_error;
-  state->expected = expected;
-  state->expected_size = expected_size;
-  state->pollent =
-      grpc_polling_entity_create_from_pollset_set(grpc_pollset_set_create());
-  GRPC_CLOSURE_INIT(&state->on_request_metadata, check_request_metadata, state,
-                    grpc_schedule_on_exec_ctx);
-  return state;
-}
-
-static void run_request_metadata_test(grpc_exec_ctx *exec_ctx,
-                                      grpc_call_credentials *creds,
-                                      grpc_auth_metadata_context auth_md_ctx,
-                                      request_metadata_state *state) {
-  grpc_error *error = GRPC_ERROR_NONE;
-  if (grpc_call_credentials_get_request_metadata(
-          exec_ctx, creds, &state->pollent, auth_md_ctx, &state->md_array,
-          &state->on_request_metadata, &error)) {
-    // Synchronous result.  Invoke the callback directly.
-    check_request_metadata(exec_ctx, state, error);
-    GRPC_ERROR_UNREF(error);
-  }
-}
-
-static void test_google_iam_creds(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  expected_md emd[] = {{GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
-                        test_google_iam_authorization_token},
-                       {GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
-                        test_google_iam_authority_selector}};
-  request_metadata_state *state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_call_credentials *creds = grpc_google_iam_credentials_create(
-      test_google_iam_authorization_token, test_google_iam_authority_selector,
-      NULL);
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_access_token_creds(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  expected_md emd[] = {{GRPC_AUTHORIZATION_METADATA_KEY, "Bearer blah"}};
-  request_metadata_state *state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_call_credentials *creds =
-      grpc_access_token_credentials_create("blah", NULL);
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  GPR_ASSERT(strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static grpc_security_status check_channel_oauth2_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_channel_credentials *c,
-    grpc_call_credentials *call_creds, const char *target,
-    const grpc_channel_args *args, grpc_channel_security_connector **sc,
-    grpc_channel_args **new_args) {
-  GPR_ASSERT(strcmp(c->type, "mock") == 0);
-  GPR_ASSERT(call_creds != NULL);
-  GPR_ASSERT(strcmp(call_creds->type, GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
-  return GRPC_SECURITY_OK;
-}
-
-static void test_channel_oauth2_composite_creds(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_channel_args *new_args;
-  grpc_channel_credentials_vtable vtable = {
-      NULL, check_channel_oauth2_create_security_connector, NULL};
-  grpc_channel_credentials *channel_creds =
-      grpc_mock_channel_credentials_create(&vtable);
-  grpc_call_credentials *oauth2_creds =
-      grpc_access_token_credentials_create("blah", NULL);
-  grpc_channel_credentials *channel_oauth2_creds =
-      grpc_composite_channel_credentials_create(channel_creds, oauth2_creds,
-                                                NULL);
-  grpc_channel_credentials_release(channel_creds);
-  grpc_call_credentials_release(oauth2_creds);
-  GPR_ASSERT(grpc_channel_credentials_create_security_connector(
-                 &exec_ctx, channel_oauth2_creds, NULL, NULL, NULL,
-                 &new_args) == GRPC_SECURITY_OK);
-  grpc_channel_credentials_release(channel_oauth2_creds);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_oauth2_google_iam_composite_creds(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  expected_md emd[] = {
-      {GRPC_AUTHORIZATION_METADATA_KEY, test_oauth2_bearer_token},
-      {GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
-       test_google_iam_authorization_token},
-      {GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
-       test_google_iam_authority_selector}};
-  request_metadata_state *state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  grpc_call_credentials *oauth2_creds = grpc_md_only_test_credentials_create(
-      &exec_ctx, "authorization", test_oauth2_bearer_token, 0);
-  grpc_call_credentials *google_iam_creds = grpc_google_iam_credentials_create(
-      test_google_iam_authorization_token, test_google_iam_authority_selector,
-      NULL);
-  grpc_call_credentials *composite_creds =
-      grpc_composite_call_credentials_create(oauth2_creds, google_iam_creds,
-                                             NULL);
-  grpc_call_credentials_unref(&exec_ctx, oauth2_creds);
-  grpc_call_credentials_unref(&exec_ctx, google_iam_creds);
-  GPR_ASSERT(
-      strcmp(composite_creds->type, GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) == 0);
-  const grpc_call_credentials_array *creds_array =
-      grpc_composite_call_credentials_get_credentials(composite_creds);
-  GPR_ASSERT(creds_array->num_creds == 2);
-  GPR_ASSERT(strcmp(creds_array->creds_array[0]->type,
-                    GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
-  GPR_ASSERT(strcmp(creds_array->creds_array[1]->type,
-                    GRPC_CALL_CREDENTIALS_TYPE_IAM) == 0);
-  run_request_metadata_test(&exec_ctx, composite_creds, auth_md_ctx, state);
-  grpc_call_credentials_unref(&exec_ctx, composite_creds);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static grpc_security_status
-check_channel_oauth2_google_iam_create_security_connector(
-    grpc_exec_ctx *exec_ctx, grpc_channel_credentials *c,
-    grpc_call_credentials *call_creds, const char *target,
-    const grpc_channel_args *args, grpc_channel_security_connector **sc,
-    grpc_channel_args **new_args) {
-  const grpc_call_credentials_array *creds_array;
-  GPR_ASSERT(strcmp(c->type, "mock") == 0);
-  GPR_ASSERT(call_creds != NULL);
-  GPR_ASSERT(strcmp(call_creds->type, GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) ==
-             0);
-  creds_array = grpc_composite_call_credentials_get_credentials(call_creds);
-  GPR_ASSERT(strcmp(creds_array->creds_array[0]->type,
-                    GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
-  GPR_ASSERT(strcmp(creds_array->creds_array[1]->type,
-                    GRPC_CALL_CREDENTIALS_TYPE_IAM) == 0);
-  return GRPC_SECURITY_OK;
-}
-
-static void test_channel_oauth2_google_iam_composite_creds(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_channel_args *new_args;
-  grpc_channel_credentials_vtable vtable = {
-      NULL, check_channel_oauth2_google_iam_create_security_connector, NULL};
-  grpc_channel_credentials *channel_creds =
-      grpc_mock_channel_credentials_create(&vtable);
-  grpc_call_credentials *oauth2_creds =
-      grpc_access_token_credentials_create("blah", NULL);
-  grpc_channel_credentials *channel_oauth2_creds =
-      grpc_composite_channel_credentials_create(channel_creds, oauth2_creds,
-                                                NULL);
-  grpc_call_credentials *google_iam_creds = grpc_google_iam_credentials_create(
-      test_google_iam_authorization_token, test_google_iam_authority_selector,
-      NULL);
-  grpc_channel_credentials *channel_oauth2_iam_creds =
-      grpc_composite_channel_credentials_create(channel_oauth2_creds,
-                                                google_iam_creds, NULL);
-  grpc_channel_credentials_release(channel_creds);
-  grpc_call_credentials_release(oauth2_creds);
-  grpc_channel_credentials_release(channel_oauth2_creds);
-  grpc_call_credentials_release(google_iam_creds);
-
-  GPR_ASSERT(grpc_channel_credentials_create_security_connector(
-                 &exec_ctx, channel_oauth2_iam_creds, NULL, NULL, NULL,
-                 &new_args) == GRPC_SECURITY_OK);
-
-  grpc_channel_credentials_release(channel_oauth2_iam_creds);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void validate_compute_engine_http_request(
-    const grpc_httpcli_request *request) {
-  GPR_ASSERT(request->handshaker != &grpc_httpcli_ssl);
-  GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
-  GPR_ASSERT(
-      strcmp(request->http.path,
-             "/computeMetadata/v1/instance/service-accounts/default/token") ==
-      0);
-  GPR_ASSERT(request->http.hdr_count == 1);
-  GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Metadata-Flavor") == 0);
-  GPR_ASSERT(strcmp(request->http.hdrs[0].value, "Google") == 0);
-}
-
-static int compute_engine_httpcli_get_success_override(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    grpc_millis deadline, grpc_closure *on_done,
-    grpc_httpcli_response *response) {
-  validate_compute_engine_http_request(request);
-  *response = http_response(200, valid_oauth2_json_response);
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static int compute_engine_httpcli_get_failure_override(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    grpc_millis deadline, grpc_closure *on_done,
-    grpc_httpcli_response *response) {
-  validate_compute_engine_http_request(request);
-  *response = http_response(403, "Not Authorized.");
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static int httpcli_post_should_not_be_called(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    const char *body_bytes, size_t body_size, grpc_millis deadline,
-    grpc_closure *on_done, grpc_httpcli_response *response) {
-  GPR_ASSERT("HTTP POST should not be called" == NULL);
-  return 1;
-}
-
-static int httpcli_get_should_not_be_called(grpc_exec_ctx *exec_ctx,
-                                            const grpc_httpcli_request *request,
-                                            grpc_millis deadline,
-                                            grpc_closure *on_done,
-                                            grpc_httpcli_response *response) {
-  GPR_ASSERT("HTTP GET should not be called" == NULL);
-  return 1;
-}
-
-static void test_compute_engine_creds_success(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  expected_md emd[] = {
-      {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
-  grpc_call_credentials *creds =
-      grpc_google_compute_engine_credentials_create(NULL);
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-
-  /* First request: http get should be called. */
-  request_metadata_state *state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_httpcli_set_override(compute_engine_httpcli_get_success_override,
-                            httpcli_post_should_not_be_called);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* Second request: the cached token should be served directly. */
-  state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
-                            httpcli_post_should_not_be_called);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  grpc_httpcli_set_override(NULL, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_compute_engine_creds_failure(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  request_metadata_state *state = make_request_metadata_state(
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-          "Error occured when fetching oauth2 token."),
-      NULL, 0);
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  grpc_call_credentials *creds =
-      grpc_google_compute_engine_credentials_create(NULL);
-  grpc_httpcli_set_override(compute_engine_httpcli_get_failure_override,
-                            httpcli_post_should_not_be_called);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  grpc_httpcli_set_override(NULL, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void validate_refresh_token_http_request(
-    const grpc_httpcli_request *request, const char *body, size_t body_size) {
-  /* The content of the assertion is tested extensively in json_token_test. */
-  char *expected_body = NULL;
-  GPR_ASSERT(body != NULL);
-  GPR_ASSERT(body_size != 0);
-  gpr_asprintf(&expected_body, GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING,
-               "32555999999.apps.googleusercontent.com",
-               "EmssLNjJy1332hD4KFsecret",
-               "1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42");
-  GPR_ASSERT(strlen(expected_body) == body_size);
-  GPR_ASSERT(memcmp(expected_body, body, body_size) == 0);
-  gpr_free(expected_body);
-  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
-  GPR_ASSERT(strcmp(request->host, GRPC_GOOGLE_OAUTH2_SERVICE_HOST) == 0);
-  GPR_ASSERT(
-      strcmp(request->http.path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
-  GPR_ASSERT(request->http.hdr_count == 1);
-  GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
-  GPR_ASSERT(strcmp(request->http.hdrs[0].value,
-                    "application/x-www-form-urlencoded") == 0);
-}
-
-static int refresh_token_httpcli_post_success(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    const char *body, size_t body_size, grpc_millis deadline,
-    grpc_closure *on_done, grpc_httpcli_response *response) {
-  validate_refresh_token_http_request(request, body, body_size);
-  *response = http_response(200, valid_oauth2_json_response);
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static int refresh_token_httpcli_post_failure(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    const char *body, size_t body_size, grpc_millis deadline,
-    grpc_closure *on_done, grpc_httpcli_response *response) {
-  validate_refresh_token_http_request(request, body, body_size);
-  *response = http_response(403, "Not Authorized.");
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static void test_refresh_token_creds_success(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  expected_md emd[] = {
-      {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  grpc_call_credentials *creds = grpc_google_refresh_token_credentials_create(
-      test_refresh_token_str, NULL);
-
-  /* First request: http get should be called. */
-  request_metadata_state *state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
-                            refresh_token_httpcli_post_success);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* Second request: the cached token should be served directly. */
-  state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
-                            httpcli_post_should_not_be_called);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  grpc_httpcli_set_override(NULL, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_refresh_token_creds_failure(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  request_metadata_state *state = make_request_metadata_state(
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-          "Error occured when fetching oauth2 token."),
-      NULL, 0);
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  grpc_call_credentials *creds = grpc_google_refresh_token_credentials_create(
-      test_refresh_token_str, NULL);
-  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
-                            refresh_token_httpcli_post_failure);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  grpc_httpcli_set_override(NULL, NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void validate_jwt_encode_and_sign_params(
-    const grpc_auth_json_key *json_key, const char *scope,
-    gpr_timespec token_lifetime) {
-  GPR_ASSERT(grpc_auth_json_key_is_valid(json_key));
-  GPR_ASSERT(json_key->private_key != NULL);
-  GPR_ASSERT(RSA_check_key(json_key->private_key));
-  GPR_ASSERT(json_key->type != NULL &&
-             strcmp(json_key->type, "service_account") == 0);
-  GPR_ASSERT(json_key->private_key_id != NULL &&
-             strcmp(json_key->private_key_id,
-                    "e6b5137873db8d2ef81e06a47289e6434ec8a165") == 0);
-  GPR_ASSERT(json_key->client_id != NULL &&
-             strcmp(json_key->client_id,
-                    "777-abaslkan11hlb6nmim3bpspl31ud.apps."
-                    "googleusercontent.com") == 0);
-  GPR_ASSERT(json_key->client_email != NULL &&
-             strcmp(json_key->client_email,
-                    "777-abaslkan11hlb6nmim3bpspl31ud@developer."
-                    "gserviceaccount.com") == 0);
-  if (scope != NULL) GPR_ASSERT(strcmp(scope, test_scope) == 0);
-  GPR_ASSERT(!gpr_time_cmp(token_lifetime, grpc_max_auth_token_lifetime()));
-}
-
-static char *encode_and_sign_jwt_success(const grpc_auth_json_key *json_key,
-                                         const char *audience,
-                                         gpr_timespec token_lifetime,
-                                         const char *scope) {
-  validate_jwt_encode_and_sign_params(json_key, scope, token_lifetime);
-  return gpr_strdup(test_signed_jwt);
-}
-
-static char *encode_and_sign_jwt_failure(const grpc_auth_json_key *json_key,
-                                         const char *audience,
-                                         gpr_timespec token_lifetime,
-                                         const char *scope) {
-  validate_jwt_encode_and_sign_params(json_key, scope, token_lifetime);
-  return NULL;
-}
-
-static char *encode_and_sign_jwt_should_not_be_called(
-    const grpc_auth_json_key *json_key, const char *audience,
-    gpr_timespec token_lifetime, const char *scope) {
-  GPR_ASSERT("grpc_jwt_encode_and_sign should not be called" == NULL);
-  return NULL;
-}
-
-static grpc_service_account_jwt_access_credentials *creds_as_jwt(
-    grpc_call_credentials *creds) {
-  GPR_ASSERT(creds != NULL);
-  GPR_ASSERT(strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_JWT) == 0);
-  return (grpc_service_account_jwt_access_credentials *)creds;
-}
-
-static void test_jwt_creds_lifetime(void) {
-  char *json_key_string = test_json_key_str();
-
-  // Max lifetime.
-  grpc_call_credentials *jwt_creds =
-      grpc_service_account_jwt_access_credentials_create(
-          json_key_string, grpc_max_auth_token_lifetime(), NULL);
-  GPR_ASSERT(gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime,
-                          grpc_max_auth_token_lifetime()) == 0);
-  grpc_call_credentials_release(jwt_creds);
-
-  // Shorter lifetime.
-  gpr_timespec token_lifetime = {10, 0, GPR_TIMESPAN};
-  GPR_ASSERT(gpr_time_cmp(grpc_max_auth_token_lifetime(), token_lifetime) > 0);
-  jwt_creds = grpc_service_account_jwt_access_credentials_create(
-      json_key_string, token_lifetime, NULL);
-  GPR_ASSERT(
-      gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime, token_lifetime) == 0);
-  grpc_call_credentials_release(jwt_creds);
-
-  // Cropped lifetime.
-  gpr_timespec add_to_max = {10, 0, GPR_TIMESPAN};
-  token_lifetime = gpr_time_add(grpc_max_auth_token_lifetime(), add_to_max);
-  jwt_creds = grpc_service_account_jwt_access_credentials_create(
-      json_key_string, token_lifetime, NULL);
-  GPR_ASSERT(gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime,
-                          grpc_max_auth_token_lifetime()) == 0);
-  grpc_call_credentials_release(jwt_creds);
-
-  gpr_free(json_key_string);
-}
-
-static void test_jwt_creds_success(void) {
-  char *json_key_string = test_json_key_str();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  char *expected_md_value;
-  gpr_asprintf(&expected_md_value, "Bearer %s", test_signed_jwt);
-  expected_md emd[] = {{"authorization", expected_md_value}};
-  grpc_call_credentials *creds =
-      grpc_service_account_jwt_access_credentials_create(
-          json_key_string, grpc_max_auth_token_lifetime(), NULL);
-
-  /* First request: jwt_encode_and_sign should be called. */
-  request_metadata_state *state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* Second request: the cached token should be served directly. */
-  state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_jwt_encode_and_sign_set_override(
-      encode_and_sign_jwt_should_not_be_called);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* Third request: Different service url so jwt_encode_and_sign should be
-     called again (no caching). */
-  state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  auth_md_ctx.service_url = other_test_service_url;
-  grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  gpr_free(json_key_string);
-  gpr_free(expected_md_value);
-  grpc_jwt_encode_and_sign_set_override(NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_jwt_creds_signing_failure(void) {
-  char *json_key_string = test_json_key_str();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  request_metadata_state *state = make_request_metadata_state(
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING("Could not generate JWT."), NULL, 0);
-  grpc_call_credentials *creds =
-      grpc_service_account_jwt_access_credentials_create(
-          json_key_string, grpc_max_auth_token_lifetime(), NULL);
-
-  grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_failure);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
-
-  gpr_free(json_key_string);
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  grpc_jwt_encode_and_sign_set_override(NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void set_google_default_creds_env_var_with_file_contents(
-    const char *file_prefix, const char *contents) {
-  size_t contents_len = strlen(contents);
-  char *creds_file_name;
-  FILE *creds_file = gpr_tmpfile(file_prefix, &creds_file_name);
-  GPR_ASSERT(creds_file_name != NULL);
-  GPR_ASSERT(creds_file != NULL);
-  GPR_ASSERT(fwrite(contents, 1, contents_len, creds_file) == contents_len);
-  fclose(creds_file);
-  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, creds_file_name);
-  gpr_free(creds_file_name);
-}
-
-static void test_google_default_creds_auth_key(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_service_account_jwt_access_credentials *jwt;
-  grpc_composite_channel_credentials *creds;
-  char *json_key = test_json_key_str();
-  grpc_flush_cached_google_default_credentials();
-  set_google_default_creds_env_var_with_file_contents(
-      "json_key_google_default_creds", json_key);
-  gpr_free(json_key);
-  creds = (grpc_composite_channel_credentials *)
-      grpc_google_default_credentials_create();
-  GPR_ASSERT(creds != NULL);
-  jwt = (grpc_service_account_jwt_access_credentials *)creds->call_creds;
-  GPR_ASSERT(
-      strcmp(jwt->key.client_id,
-             "777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent.com") ==
-      0);
-  grpc_channel_credentials_unref(&exec_ctx, &creds->base);
-  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_google_default_creds_refresh_token(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_google_refresh_token_credentials *refresh;
-  grpc_composite_channel_credentials *creds;
-  grpc_flush_cached_google_default_credentials();
-  set_google_default_creds_env_var_with_file_contents(
-      "refresh_token_google_default_creds", test_refresh_token_str);
-  creds = (grpc_composite_channel_credentials *)
-      grpc_google_default_credentials_create();
-  GPR_ASSERT(creds != NULL);
-  refresh = (grpc_google_refresh_token_credentials *)creds->call_creds;
-  GPR_ASSERT(strcmp(refresh->refresh_token.client_id,
-                    "32555999999.apps.googleusercontent.com") == 0);
-  grpc_channel_credentials_unref(&exec_ctx, &creds->base);
-  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static int default_creds_gce_detection_httpcli_get_success_override(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    grpc_millis deadline, grpc_closure *on_done,
-    grpc_httpcli_response *response) {
-  *response = http_response(200, "");
-  grpc_http_header *headers = gpr_malloc(sizeof(*headers) * 1);
-  headers[0].key = gpr_strdup("Metadata-Flavor");
-  headers[0].value = gpr_strdup("Google");
-  response->hdr_count = 1;
-  response->hdrs = headers;
-  GPR_ASSERT(strcmp(request->http.path, "/") == 0);
-  GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static char *null_well_known_creds_path_getter(void) { return NULL; }
-
-static void test_google_default_creds_gce(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  expected_md emd[] = {
-      {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
-  request_metadata_state *state =
-      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  grpc_flush_cached_google_default_credentials();
-  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
-  grpc_override_well_known_credentials_path_getter(
-      null_well_known_creds_path_getter);
-
-  /* Simulate a successful detection of GCE. */
-  grpc_httpcli_set_override(
-      default_creds_gce_detection_httpcli_get_success_override,
-      httpcli_post_should_not_be_called);
-  grpc_composite_channel_credentials *creds =
-      (grpc_composite_channel_credentials *)
-          grpc_google_default_credentials_create();
-
-  /* Verify that the default creds actually embeds a GCE creds. */
-  GPR_ASSERT(creds != NULL);
-  GPR_ASSERT(creds->call_creds != NULL);
-  grpc_httpcli_set_override(compute_engine_httpcli_get_success_override,
-                            httpcli_post_should_not_be_called);
-  run_request_metadata_test(&exec_ctx, creds->call_creds, auth_md_ctx, state);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  /* Check that we get a cached creds if we call
-     grpc_google_default_credentials_create again.
-     GCE detection should not occur anymore either. */
-  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
-                            httpcli_post_should_not_be_called);
-  grpc_channel_credentials *cached_creds =
-      grpc_google_default_credentials_create();
-  GPR_ASSERT(cached_creds == &creds->base);
-
-  /* Cleanup. */
-  grpc_channel_credentials_unref(&exec_ctx, cached_creds);
-  grpc_channel_credentials_unref(&exec_ctx, &creds->base);
-  grpc_httpcli_set_override(NULL, NULL);
-  grpc_override_well_known_credentials_path_getter(NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static int default_creds_gce_detection_httpcli_get_failure_override(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    grpc_millis deadline, grpc_closure *on_done,
-    grpc_httpcli_response *response) {
-  /* No magic header. */
-  GPR_ASSERT(strcmp(request->http.path, "/") == 0);
-  GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
-  *response = http_response(200, "");
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static void test_no_google_default_creds(void) {
-  grpc_flush_cached_google_default_credentials();
-  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
-  grpc_override_well_known_credentials_path_getter(
-      null_well_known_creds_path_getter);
-
-  /* Simulate a successful detection of GCE. */
-  grpc_httpcli_set_override(
-      default_creds_gce_detection_httpcli_get_failure_override,
-      httpcli_post_should_not_be_called);
-  GPR_ASSERT(grpc_google_default_credentials_create() == NULL);
-
-  /* Try a cached one. GCE detection should not occur anymore. */
-  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
-                            httpcli_post_should_not_be_called);
-  GPR_ASSERT(grpc_google_default_credentials_create() == NULL);
-
-  /* Cleanup. */
-  grpc_httpcli_set_override(NULL, NULL);
-  grpc_override_well_known_credentials_path_getter(NULL);
-}
-
-typedef enum {
-  PLUGIN_INITIAL_STATE,
-  PLUGIN_GET_METADATA_CALLED_STATE,
-  PLUGIN_DESTROY_CALLED_STATE
-} plugin_state;
-
-static const expected_md plugin_md[] = {{"foo", "bar"}, {"hi", "there"}};
-
-static int plugin_get_metadata_success(
-    void *state, grpc_auth_metadata_context context,
-    grpc_credentials_plugin_metadata_cb cb, void *user_data,
-    grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
-    size_t *num_creds_md, grpc_status_code *status,
-    const char **error_details) {
-  GPR_ASSERT(strcmp(context.service_url, test_service_url) == 0);
-  GPR_ASSERT(strcmp(context.method_name, test_method) == 0);
-  GPR_ASSERT(context.channel_auth_context == NULL);
-  GPR_ASSERT(context.reserved == NULL);
-  GPR_ASSERT(GPR_ARRAY_SIZE(plugin_md) <
-             GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX);
-  plugin_state *s = (plugin_state *)state;
-  *s = PLUGIN_GET_METADATA_CALLED_STATE;
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(plugin_md); ++i) {
-    memset(&creds_md[i], 0, sizeof(grpc_metadata));
-    creds_md[i].key = grpc_slice_from_copied_string(plugin_md[i].key);
-    creds_md[i].value = grpc_slice_from_copied_string(plugin_md[i].value);
-  }
-  *num_creds_md = GPR_ARRAY_SIZE(plugin_md);
-  return true;  // Synchronous return.
-}
-
-static const char *plugin_error_details = "Could not get metadata for plugin.";
-
-static int plugin_get_metadata_failure(
-    void *state, grpc_auth_metadata_context context,
-    grpc_credentials_plugin_metadata_cb cb, void *user_data,
-    grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
-    size_t *num_creds_md, grpc_status_code *status,
-    const char **error_details) {
-  GPR_ASSERT(strcmp(context.service_url, test_service_url) == 0);
-  GPR_ASSERT(strcmp(context.method_name, test_method) == 0);
-  GPR_ASSERT(context.channel_auth_context == NULL);
-  GPR_ASSERT(context.reserved == NULL);
-  plugin_state *s = (plugin_state *)state;
-  *s = PLUGIN_GET_METADATA_CALLED_STATE;
-  *status = GRPC_STATUS_UNAUTHENTICATED;
-  *error_details = gpr_strdup(plugin_error_details);
-  return true;  // Synchronous return.
-}
-
-static void plugin_destroy(void *state) {
-  plugin_state *s = (plugin_state *)state;
-  *s = PLUGIN_DESTROY_CALLED_STATE;
-}
-
-static void test_metadata_plugin_success(void) {
-  plugin_state state = PLUGIN_INITIAL_STATE;
-  grpc_metadata_credentials_plugin plugin;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  request_metadata_state *md_state = make_request_metadata_state(
-      GRPC_ERROR_NONE, plugin_md, GPR_ARRAY_SIZE(plugin_md));
-
-  plugin.state = &state;
-  plugin.get_metadata = plugin_get_metadata_success;
-  plugin.destroy = plugin_destroy;
-
-  grpc_call_credentials *creds =
-      grpc_metadata_credentials_create_from_plugin(plugin, NULL);
-  GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, md_state);
-  GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  grpc_exec_ctx_finish(&exec_ctx);
-  GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
-}
-
-static void test_metadata_plugin_failure(void) {
-  plugin_state state = PLUGIN_INITIAL_STATE;
-  grpc_metadata_credentials_plugin plugin;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
-                                            NULL};
-  char *expected_error;
-  gpr_asprintf(&expected_error,
-               "Getting metadata from plugin failed with error: %s",
-               plugin_error_details);
-  request_metadata_state *md_state = make_request_metadata_state(
-      GRPC_ERROR_CREATE_FROM_COPIED_STRING(expected_error), NULL, 0);
-  gpr_free(expected_error);
-
-  plugin.state = &state;
-  plugin.get_metadata = plugin_get_metadata_failure;
-  plugin.destroy = plugin_destroy;
-
-  grpc_call_credentials *creds =
-      grpc_metadata_credentials_create_from_plugin(plugin, NULL);
-  GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
-  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, md_state);
-  GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
-  grpc_call_credentials_unref(&exec_ctx, creds);
-  grpc_exec_ctx_finish(&exec_ctx);
-  GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
-}
-
-static void test_get_well_known_google_credentials_file_path(void) {
-  char *path;
-  char *home = gpr_getenv("HOME");
-  path = grpc_get_well_known_google_credentials_file_path();
-  GPR_ASSERT(path != NULL);
-  gpr_free(path);
-#if defined(GPR_POSIX_ENV) || defined(GPR_LINUX_ENV)
-  unsetenv("HOME");
-  path = grpc_get_well_known_google_credentials_file_path();
-  GPR_ASSERT(path == NULL);
-  gpr_setenv("HOME", home);
-  gpr_free(path);
-#endif /* GPR_POSIX_ENV || GPR_LINUX_ENV */
-  gpr_free(home);
-}
-
-static void test_channel_creds_duplicate_without_call_creds(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  grpc_channel_credentials *channel_creds =
-      grpc_fake_transport_security_credentials_create();
-
-  grpc_channel_credentials *dup =
-      grpc_channel_credentials_duplicate_without_call_credentials(
-          channel_creds);
-  GPR_ASSERT(dup == channel_creds);
-  grpc_channel_credentials_unref(&exec_ctx, dup);
-
-  grpc_call_credentials *call_creds =
-      grpc_access_token_credentials_create("blah", NULL);
-  grpc_channel_credentials *composite_creds =
-      grpc_composite_channel_credentials_create(channel_creds, call_creds,
-                                                NULL);
-  grpc_call_credentials_unref(&exec_ctx, call_creds);
-  dup = grpc_channel_credentials_duplicate_without_call_credentials(
-      composite_creds);
-  GPR_ASSERT(dup == channel_creds);
-  grpc_channel_credentials_unref(&exec_ctx, dup);
-
-  grpc_channel_credentials_unref(&exec_ctx, channel_creds);
-  grpc_channel_credentials_unref(&exec_ctx, composite_creds);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_empty_md_array();
-  test_add_to_empty_md_array();
-  test_add_abunch_to_md_array();
-  test_oauth2_token_fetcher_creds_parsing_ok();
-  test_oauth2_token_fetcher_creds_parsing_bad_http_status();
-  test_oauth2_token_fetcher_creds_parsing_empty_http_body();
-  test_oauth2_token_fetcher_creds_parsing_invalid_json();
-  test_oauth2_token_fetcher_creds_parsing_missing_token();
-  test_oauth2_token_fetcher_creds_parsing_missing_token_type();
-  test_oauth2_token_fetcher_creds_parsing_missing_token_lifetime();
-  test_google_iam_creds();
-  test_access_token_creds();
-  test_channel_oauth2_composite_creds();
-  test_oauth2_google_iam_composite_creds();
-  test_channel_oauth2_google_iam_composite_creds();
-  test_compute_engine_creds_success();
-  test_compute_engine_creds_failure();
-  test_refresh_token_creds_success();
-  test_refresh_token_creds_failure();
-  test_jwt_creds_lifetime();
-  test_jwt_creds_success();
-  test_jwt_creds_signing_failure();
-  test_google_default_creds_auth_key();
-  test_google_default_creds_refresh_token();
-  test_google_default_creds_gce();
-  test_no_google_default_creds();
-  test_metadata_plugin_success();
-  test_metadata_plugin_failure();
-  test_get_well_known_google_credentials_file_path();
-  test_channel_creds_duplicate_without_call_creds();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/security/credentials_test.cc b/test/core/security/credentials_test.cc
new file mode 100644
index 0000000..9b575c4
--- /dev/null
+++ b/test/core/security/credentials_test.cc
@@ -0,0 +1,1294 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/credentials/credentials.h"
+
+#include <openssl/rsa.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/slice.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/http/httpcli.h"
+#include "src/core/lib/security/credentials/composite/composite_credentials.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
+#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
+#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
+#include "src/core/lib/security/transport/auth_filters.h"
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/support/tmpfile.h"
+#include "test/core/util/test_config.h"
+
+/* -- Mock channel credentials. -- */
+
+static grpc_channel_credentials* grpc_mock_channel_credentials_create(
+    const grpc_channel_credentials_vtable* vtable) {
+  grpc_channel_credentials* c =
+      static_cast<grpc_channel_credentials*>(gpr_malloc(sizeof(*c)));
+  memset(c, 0, sizeof(*c));
+  c->type = "mock";
+  c->vtable = vtable;
+  gpr_ref_init(&c->refcount, 1);
+  return c;
+}
+
+/* -- Constants. -- */
+
+static const char test_google_iam_authorization_token[] = "blahblahblhahb";
+static const char test_google_iam_authority_selector[] = "respectmyauthoritah";
+static const char test_oauth2_bearer_token[] =
+    "Bearer blaaslkdjfaslkdfasdsfasf";
+
+/* This JSON key was generated with the GCE console and revoked immediately.
+   The identifiers have been changed as well.
+   Maximum size for a string literal is 509 chars in C89, yay!  */
+static const char test_json_key_str_part1[] =
+    "{ \"private_key\": \"-----BEGIN PRIVATE KEY-----"
+    "\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE"
+    "qg"
+    "WGjiw71NfXByguekSKho65FxaGbsnSM9SMQAqVk7Q2rG+I0OpsT0LrWQtZ\\nyjSeg/"
+    "rWBQvS4hle4LfijkP3J5BG+"
+    "IXDMP8RfziNRQsenAXDNPkY4kJCvKux2xdD\\nOnVF6N7dL3nTYZg+"
+    "uQrNsMTz9UxVAgMBAAECgYEAzbLewe1xe9vy+2GoSsfib+28\\nDZgSE6Bu/"
+    "zuFoPrRc6qL9p2SsnV7txrunTyJkkOnPLND9ABAXybRTlcVKP/sGgza\\n/"
+    "8HpCqFYM9V8f34SBWfD4fRFT+n/"
+    "73cfRUtGXdXpseva2lh8RilIQfPhNZAncenU\\ngqXjDvpkypEusgXAykECQQD+";
+static const char test_json_key_str_part2[] =
+    "53XxNVnxBHsYb+AYEfklR96yVi8HywjVHP34+OQZ\\nCslxoHQM8s+"
+    "dBnjfScLu22JqkPv04xyxmt0QAKm9+vTdAkEA4ib7YvEAn2jXzcCI\\nEkoy2L/"
+    "XydR1GCHoacdfdAwiL2npOdnbvi4ZmdYRPY1LSTO058tQHKVXV7NLeCa3\\nAARh2QJBAMKeDA"
+    "G"
+    "W303SQv2cZTdbeaLKJbB5drz3eo3j7dDKjrTD9JupixFbzcGw\\n8FZi5c8idxiwC36kbAL6Hz"
+    "A"
+    "ZoX+ofI0CQE6KCzPJTtYNqyShgKAZdJ8hwOcvCZtf\\n6z8RJm0+"
+    "6YBd38lfh5j8mZd7aHFf6I17j5AQY7oPEc47TjJj/"
+    "5nZ68ECQQDvYuI3\\nLyK5fS8g0SYbmPOL9TlcHDOqwG0mrX9qpg5DC2fniXNSrrZ64GTDKdzZ"
+    "Y"
+    "Ap6LI9W\\nIqv4vr6y38N79TTC\\n-----END PRIVATE KEY-----\\n\", ";
+static const char test_json_key_str_part3[] =
+    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+    "\"client_email\": "
+    "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
+    "com\", \"client_id\": "
+    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+    "com\", \"type\": \"service_account\" }";
+
+/* Test refresh token. */
+static const char test_refresh_token_str[] =
+    "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
+    "  \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
+    "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\","
+    "  \"type\": \"authorized_user\"}";
+
+static const char valid_oauth2_json_response[] =
+    "{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
+    " \"expires_in\":3599, "
+    " \"token_type\":\"Bearer\"}";
+
+static const char test_scope[] = "perm1 perm2";
+
+static const char test_signed_jwt[] =
+    "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0OTRkN2M1YWU2MGRmOTcyNmM4YW"
+    "U0MDcyZTViYTdmZDkwODg2YzcifQ";
+
+static const char test_service_url[] = "https://foo.com/foo.v1";
+static const char other_test_service_url[] = "https://bar.com/bar.v1";
+
+static const char test_method[] = "ThisIsNotAMethod";
+
+/* -- Utils. -- */
+
+static char* test_json_key_str(void) {
+  size_t result_len = strlen(test_json_key_str_part1) +
+                      strlen(test_json_key_str_part2) +
+                      strlen(test_json_key_str_part3);
+  char* result = static_cast<char*>(gpr_malloc(result_len + 1));
+  char* current = result;
+  strcpy(result, test_json_key_str_part1);
+  current += strlen(test_json_key_str_part1);
+  strcpy(current, test_json_key_str_part2);
+  current += strlen(test_json_key_str_part2);
+  strcpy(current, test_json_key_str_part3);
+  return result;
+}
+
+static grpc_httpcli_response http_response(int status, const char* body) {
+  grpc_httpcli_response response;
+  memset(&response, 0, sizeof(grpc_httpcli_response));
+  response.status = status;
+  response.body = gpr_strdup((char*)body);
+  response.body_length = strlen(body);
+  return response;
+}
+
+/* -- Tests. -- */
+
+static void test_empty_md_array(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_credentials_mdelem_array md_array;
+  memset(&md_array, 0, sizeof(md_array));
+  GPR_ASSERT(md_array.md == NULL);
+  GPR_ASSERT(md_array.size == 0);
+  grpc_credentials_mdelem_array_destroy(&exec_ctx, &md_array);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_add_to_empty_md_array(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_credentials_mdelem_array md_array;
+  memset(&md_array, 0, sizeof(md_array));
+  const char* key = "hello";
+  const char* value = "there blah blah blah blah blah blah blah";
+  grpc_mdelem md =
+      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_copied_string(key),
+                              grpc_slice_from_copied_string(value));
+  grpc_credentials_mdelem_array_add(&md_array, md);
+  GPR_ASSERT(md_array.size == 1);
+  GPR_ASSERT(grpc_mdelem_eq(md, md_array.md[0]));
+  GRPC_MDELEM_UNREF(&exec_ctx, md);
+  grpc_credentials_mdelem_array_destroy(&exec_ctx, &md_array);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_add_abunch_to_md_array(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_credentials_mdelem_array md_array;
+  memset(&md_array, 0, sizeof(md_array));
+  const char* key = "hello";
+  const char* value = "there blah blah blah blah blah blah blah";
+  grpc_mdelem md =
+      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_copied_string(key),
+                              grpc_slice_from_copied_string(value));
+  size_t num_entries = 1000;
+  for (size_t i = 0; i < num_entries; ++i) {
+    grpc_credentials_mdelem_array_add(&md_array, md);
+  }
+  for (size_t i = 0; i < num_entries; ++i) {
+    GPR_ASSERT(grpc_mdelem_eq(md_array.md[i], md));
+  }
+  GRPC_MDELEM_UNREF(&exec_ctx, md);
+  grpc_credentials_mdelem_array_destroy(&exec_ctx, &md_array);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_oauth2_token_fetcher_creds_parsing_ok(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem token_md = GRPC_MDNULL;
+  grpc_millis token_lifetime;
+  grpc_httpcli_response response =
+      http_response(200, valid_oauth2_json_response);
+  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
+                 &exec_ctx, &response, &token_md, &token_lifetime) ==
+             GRPC_CREDENTIALS_OK);
+  GPR_ASSERT(token_lifetime == 3599 * GPR_MS_PER_SEC);
+  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDKEY(token_md), "authorization") == 0);
+  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(token_md),
+                                "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") ==
+             0);
+  GRPC_MDELEM_UNREF(&exec_ctx, token_md);
+  grpc_http_response_destroy(&response);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_oauth2_token_fetcher_creds_parsing_bad_http_status(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem token_md = GRPC_MDNULL;
+  grpc_millis token_lifetime;
+  grpc_httpcli_response response =
+      http_response(401, valid_oauth2_json_response);
+  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
+                 &exec_ctx, &response, &token_md, &token_lifetime) ==
+             GRPC_CREDENTIALS_ERROR);
+  grpc_http_response_destroy(&response);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_oauth2_token_fetcher_creds_parsing_empty_http_body(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem token_md = GRPC_MDNULL;
+  grpc_millis token_lifetime;
+  grpc_httpcli_response response = http_response(200, "");
+  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
+                 &exec_ctx, &response, &token_md, &token_lifetime) ==
+             GRPC_CREDENTIALS_ERROR);
+  grpc_http_response_destroy(&response);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_oauth2_token_fetcher_creds_parsing_invalid_json(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem token_md = GRPC_MDNULL;
+  grpc_millis token_lifetime;
+  grpc_httpcli_response response =
+      http_response(200,
+                    "{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
+                    " \"expires_in\":3599, "
+                    " \"token_type\":\"Bearer\"");
+  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
+                 &exec_ctx, &response, &token_md, &token_lifetime) ==
+             GRPC_CREDENTIALS_ERROR);
+  grpc_http_response_destroy(&response);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_oauth2_token_fetcher_creds_parsing_missing_token(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem token_md = GRPC_MDNULL;
+  grpc_millis token_lifetime;
+  grpc_httpcli_response response = http_response(200,
+                                                 "{"
+                                                 " \"expires_in\":3599, "
+                                                 " \"token_type\":\"Bearer\"}");
+  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
+                 &exec_ctx, &response, &token_md, &token_lifetime) ==
+             GRPC_CREDENTIALS_ERROR);
+  grpc_http_response_destroy(&response);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_oauth2_token_fetcher_creds_parsing_missing_token_type(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem token_md = GRPC_MDNULL;
+  grpc_millis token_lifetime;
+  grpc_httpcli_response response =
+      http_response(200,
+                    "{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
+                    " \"expires_in\":3599, "
+                    "}");
+  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
+                 &exec_ctx, &response, &token_md, &token_lifetime) ==
+             GRPC_CREDENTIALS_ERROR);
+  grpc_http_response_destroy(&response);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_oauth2_token_fetcher_creds_parsing_missing_token_lifetime(
+    void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem token_md = GRPC_MDNULL;
+  grpc_millis token_lifetime;
+  grpc_httpcli_response response =
+      http_response(200,
+                    "{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
+                    " \"token_type\":\"Bearer\"}");
+  GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
+                 &exec_ctx, &response, &token_md, &token_lifetime) ==
+             GRPC_CREDENTIALS_ERROR);
+  grpc_http_response_destroy(&response);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+typedef struct {
+  const char* key;
+  const char* value;
+} expected_md;
+
+typedef struct {
+  grpc_error* expected_error;
+  const expected_md* expected;
+  size_t expected_size;
+  grpc_credentials_mdelem_array md_array;
+  grpc_closure on_request_metadata;
+  grpc_call_credentials* creds;
+  grpc_polling_entity pollent;
+} request_metadata_state;
+
+static void check_metadata(const expected_md* expected,
+                           grpc_credentials_mdelem_array* md_array) {
+  for (size_t i = 0; i < md_array->size; ++i) {
+    size_t j;
+    for (j = 0; j < md_array->size; ++j) {
+      if (0 ==
+          grpc_slice_str_cmp(GRPC_MDKEY(md_array->md[j]), expected[i].key)) {
+        GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(md_array->md[j]),
+                                      expected[i].value) == 0);
+        break;
+      }
+    }
+    if (j == md_array->size) {
+      gpr_log(GPR_ERROR, "key %s not found", expected[i].key);
+      GPR_ASSERT(0);
+    }
+  }
+}
+
+static void check_request_metadata(grpc_exec_ctx* exec_ctx, void* arg,
+                                   grpc_error* error) {
+  request_metadata_state* state = (request_metadata_state*)arg;
+  gpr_log(GPR_INFO, "expected_error: %s",
+          grpc_error_string(state->expected_error));
+  gpr_log(GPR_INFO, "actual_error: %s", grpc_error_string(error));
+  if (state->expected_error == GRPC_ERROR_NONE) {
+    GPR_ASSERT(error == GRPC_ERROR_NONE);
+  } else {
+    grpc_slice expected_error;
+    GPR_ASSERT(grpc_error_get_str(state->expected_error,
+                                  GRPC_ERROR_STR_DESCRIPTION, &expected_error));
+    grpc_slice actual_error;
+    GPR_ASSERT(
+        grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &actual_error));
+    GPR_ASSERT(grpc_slice_cmp(expected_error, actual_error) == 0);
+    GRPC_ERROR_UNREF(state->expected_error);
+  }
+  gpr_log(GPR_INFO, "expected_size=%" PRIdPTR " actual_size=%" PRIdPTR,
+          state->expected_size, state->md_array.size);
+  GPR_ASSERT(state->md_array.size == state->expected_size);
+  check_metadata(state->expected, &state->md_array);
+  grpc_credentials_mdelem_array_destroy(exec_ctx, &state->md_array);
+  grpc_pollset_set_destroy(exec_ctx,
+                           grpc_polling_entity_pollset_set(&state->pollent));
+  gpr_free(state);
+}
+
+static request_metadata_state* make_request_metadata_state(
+    grpc_error* expected_error, const expected_md* expected,
+    size_t expected_size) {
+  request_metadata_state* state =
+      static_cast<request_metadata_state*>(gpr_zalloc(sizeof(*state)));
+  state->expected_error = expected_error;
+  state->expected = expected;
+  state->expected_size = expected_size;
+  state->pollent =
+      grpc_polling_entity_create_from_pollset_set(grpc_pollset_set_create());
+  GRPC_CLOSURE_INIT(&state->on_request_metadata, check_request_metadata, state,
+                    grpc_schedule_on_exec_ctx);
+  return state;
+}
+
+static void run_request_metadata_test(grpc_exec_ctx* exec_ctx,
+                                      grpc_call_credentials* creds,
+                                      grpc_auth_metadata_context auth_md_ctx,
+                                      request_metadata_state* state) {
+  grpc_error* error = GRPC_ERROR_NONE;
+  if (grpc_call_credentials_get_request_metadata(
+          exec_ctx, creds, &state->pollent, auth_md_ctx, &state->md_array,
+          &state->on_request_metadata, &error)) {
+    // Synchronous result.  Invoke the callback directly.
+    check_request_metadata(exec_ctx, state, error);
+    GRPC_ERROR_UNREF(error);
+  }
+}
+
+static void test_google_iam_creds(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  expected_md emd[] = {{GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
+                        test_google_iam_authorization_token},
+                       {GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
+                        test_google_iam_authority_selector}};
+  request_metadata_state* state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_call_credentials* creds = grpc_google_iam_credentials_create(
+      test_google_iam_authorization_token, test_google_iam_authority_selector,
+      NULL);
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_access_token_creds(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  expected_md emd[] = {{GRPC_AUTHORIZATION_METADATA_KEY, "Bearer blah"}};
+  request_metadata_state* state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_call_credentials* creds =
+      grpc_access_token_credentials_create("blah", NULL);
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  GPR_ASSERT(strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static grpc_security_status check_channel_oauth2_create_security_connector(
+    grpc_exec_ctx* exec_ctx, grpc_channel_credentials* c,
+    grpc_call_credentials* call_creds, const char* target,
+    const grpc_channel_args* args, grpc_channel_security_connector** sc,
+    grpc_channel_args** new_args) {
+  GPR_ASSERT(strcmp(c->type, "mock") == 0);
+  GPR_ASSERT(call_creds != NULL);
+  GPR_ASSERT(strcmp(call_creds->type, GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
+  return GRPC_SECURITY_OK;
+}
+
+static void test_channel_oauth2_composite_creds(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_channel_args* new_args;
+  grpc_channel_credentials_vtable vtable = {
+      NULL, check_channel_oauth2_create_security_connector, NULL};
+  grpc_channel_credentials* channel_creds =
+      grpc_mock_channel_credentials_create(&vtable);
+  grpc_call_credentials* oauth2_creds =
+      grpc_access_token_credentials_create("blah", NULL);
+  grpc_channel_credentials* channel_oauth2_creds =
+      grpc_composite_channel_credentials_create(channel_creds, oauth2_creds,
+                                                NULL);
+  grpc_channel_credentials_release(channel_creds);
+  grpc_call_credentials_release(oauth2_creds);
+  GPR_ASSERT(grpc_channel_credentials_create_security_connector(
+                 &exec_ctx, channel_oauth2_creds, NULL, NULL, NULL,
+                 &new_args) == GRPC_SECURITY_OK);
+  grpc_channel_credentials_release(channel_oauth2_creds);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_oauth2_google_iam_composite_creds(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  expected_md emd[] = {
+      {GRPC_AUTHORIZATION_METADATA_KEY, test_oauth2_bearer_token},
+      {GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
+       test_google_iam_authorization_token},
+      {GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
+       test_google_iam_authority_selector}};
+  request_metadata_state* state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  grpc_call_credentials* oauth2_creds = grpc_md_only_test_credentials_create(
+      &exec_ctx, "authorization", test_oauth2_bearer_token, 0);
+  grpc_call_credentials* google_iam_creds = grpc_google_iam_credentials_create(
+      test_google_iam_authorization_token, test_google_iam_authority_selector,
+      NULL);
+  grpc_call_credentials* composite_creds =
+      grpc_composite_call_credentials_create(oauth2_creds, google_iam_creds,
+                                             NULL);
+  grpc_call_credentials_unref(&exec_ctx, oauth2_creds);
+  grpc_call_credentials_unref(&exec_ctx, google_iam_creds);
+  GPR_ASSERT(
+      strcmp(composite_creds->type, GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) == 0);
+  const grpc_call_credentials_array* creds_array =
+      grpc_composite_call_credentials_get_credentials(composite_creds);
+  GPR_ASSERT(creds_array->num_creds == 2);
+  GPR_ASSERT(strcmp(creds_array->creds_array[0]->type,
+                    GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
+  GPR_ASSERT(strcmp(creds_array->creds_array[1]->type,
+                    GRPC_CALL_CREDENTIALS_TYPE_IAM) == 0);
+  run_request_metadata_test(&exec_ctx, composite_creds, auth_md_ctx, state);
+  grpc_call_credentials_unref(&exec_ctx, composite_creds);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static grpc_security_status
+check_channel_oauth2_google_iam_create_security_connector(
+    grpc_exec_ctx* exec_ctx, grpc_channel_credentials* c,
+    grpc_call_credentials* call_creds, const char* target,
+    const grpc_channel_args* args, grpc_channel_security_connector** sc,
+    grpc_channel_args** new_args) {
+  const grpc_call_credentials_array* creds_array;
+  GPR_ASSERT(strcmp(c->type, "mock") == 0);
+  GPR_ASSERT(call_creds != NULL);
+  GPR_ASSERT(strcmp(call_creds->type, GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) ==
+             0);
+  creds_array = grpc_composite_call_credentials_get_credentials(call_creds);
+  GPR_ASSERT(strcmp(creds_array->creds_array[0]->type,
+                    GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
+  GPR_ASSERT(strcmp(creds_array->creds_array[1]->type,
+                    GRPC_CALL_CREDENTIALS_TYPE_IAM) == 0);
+  return GRPC_SECURITY_OK;
+}
+
+static void test_channel_oauth2_google_iam_composite_creds(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_channel_args* new_args;
+  grpc_channel_credentials_vtable vtable = {
+      NULL, check_channel_oauth2_google_iam_create_security_connector, NULL};
+  grpc_channel_credentials* channel_creds =
+      grpc_mock_channel_credentials_create(&vtable);
+  grpc_call_credentials* oauth2_creds =
+      grpc_access_token_credentials_create("blah", NULL);
+  grpc_channel_credentials* channel_oauth2_creds =
+      grpc_composite_channel_credentials_create(channel_creds, oauth2_creds,
+                                                NULL);
+  grpc_call_credentials* google_iam_creds = grpc_google_iam_credentials_create(
+      test_google_iam_authorization_token, test_google_iam_authority_selector,
+      NULL);
+  grpc_channel_credentials* channel_oauth2_iam_creds =
+      grpc_composite_channel_credentials_create(channel_oauth2_creds,
+                                                google_iam_creds, NULL);
+  grpc_channel_credentials_release(channel_creds);
+  grpc_call_credentials_release(oauth2_creds);
+  grpc_channel_credentials_release(channel_oauth2_creds);
+  grpc_call_credentials_release(google_iam_creds);
+
+  GPR_ASSERT(grpc_channel_credentials_create_security_connector(
+                 &exec_ctx, channel_oauth2_iam_creds, NULL, NULL, NULL,
+                 &new_args) == GRPC_SECURITY_OK);
+
+  grpc_channel_credentials_release(channel_oauth2_iam_creds);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void validate_compute_engine_http_request(
+    const grpc_httpcli_request* request) {
+  GPR_ASSERT(request->handshaker != &grpc_httpcli_ssl);
+  GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
+  GPR_ASSERT(
+      strcmp(request->http.path,
+             "/computeMetadata/v1/instance/service-accounts/default/token") ==
+      0);
+  GPR_ASSERT(request->http.hdr_count == 1);
+  GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Metadata-Flavor") == 0);
+  GPR_ASSERT(strcmp(request->http.hdrs[0].value, "Google") == 0);
+}
+
+static int compute_engine_httpcli_get_success_override(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    grpc_millis deadline, grpc_closure* on_done,
+    grpc_httpcli_response* response) {
+  validate_compute_engine_http_request(request);
+  *response = http_response(200, valid_oauth2_json_response);
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static int compute_engine_httpcli_get_failure_override(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    grpc_millis deadline, grpc_closure* on_done,
+    grpc_httpcli_response* response) {
+  validate_compute_engine_http_request(request);
+  *response = http_response(403, "Not Authorized.");
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static int httpcli_post_should_not_be_called(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    const char* body_bytes, size_t body_size, grpc_millis deadline,
+    grpc_closure* on_done, grpc_httpcli_response* response) {
+  GPR_ASSERT("HTTP POST should not be called" == NULL);
+  return 1;
+}
+
+static int httpcli_get_should_not_be_called(grpc_exec_ctx* exec_ctx,
+                                            const grpc_httpcli_request* request,
+                                            grpc_millis deadline,
+                                            grpc_closure* on_done,
+                                            grpc_httpcli_response* response) {
+  GPR_ASSERT("HTTP GET should not be called" == NULL);
+  return 1;
+}
+
+static void test_compute_engine_creds_success(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  expected_md emd[] = {
+      {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
+  grpc_call_credentials* creds =
+      grpc_google_compute_engine_credentials_create(NULL);
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+
+  /* First request: http get should be called. */
+  request_metadata_state* state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_httpcli_set_override(compute_engine_httpcli_get_success_override,
+                            httpcli_post_should_not_be_called);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* Second request: the cached token should be served directly. */
+  state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
+                            httpcli_post_should_not_be_called);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  grpc_httpcli_set_override(NULL, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_compute_engine_creds_failure(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  request_metadata_state* state = make_request_metadata_state(
+      GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+          "Error occured when fetching oauth2 token."),
+      NULL, 0);
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  grpc_call_credentials* creds =
+      grpc_google_compute_engine_credentials_create(NULL);
+  grpc_httpcli_set_override(compute_engine_httpcli_get_failure_override,
+                            httpcli_post_should_not_be_called);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  grpc_httpcli_set_override(NULL, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void validate_refresh_token_http_request(
+    const grpc_httpcli_request* request, const char* body, size_t body_size) {
+  /* The content of the assertion is tested extensively in json_token_test. */
+  char* expected_body = NULL;
+  GPR_ASSERT(body != NULL);
+  GPR_ASSERT(body_size != 0);
+  gpr_asprintf(&expected_body, GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING,
+               "32555999999.apps.googleusercontent.com",
+               "EmssLNjJy1332hD4KFsecret",
+               "1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42");
+  GPR_ASSERT(strlen(expected_body) == body_size);
+  GPR_ASSERT(memcmp(expected_body, body, body_size) == 0);
+  gpr_free(expected_body);
+  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
+  GPR_ASSERT(strcmp(request->host, GRPC_GOOGLE_OAUTH2_SERVICE_HOST) == 0);
+  GPR_ASSERT(
+      strcmp(request->http.path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
+  GPR_ASSERT(request->http.hdr_count == 1);
+  GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
+  GPR_ASSERT(strcmp(request->http.hdrs[0].value,
+                    "application/x-www-form-urlencoded") == 0);
+}
+
+static int refresh_token_httpcli_post_success(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    const char* body, size_t body_size, grpc_millis deadline,
+    grpc_closure* on_done, grpc_httpcli_response* response) {
+  validate_refresh_token_http_request(request, body, body_size);
+  *response = http_response(200, valid_oauth2_json_response);
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static int refresh_token_httpcli_post_failure(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    const char* body, size_t body_size, grpc_millis deadline,
+    grpc_closure* on_done, grpc_httpcli_response* response) {
+  validate_refresh_token_http_request(request, body, body_size);
+  *response = http_response(403, "Not Authorized.");
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static void test_refresh_token_creds_success(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  expected_md emd[] = {
+      {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  grpc_call_credentials* creds = grpc_google_refresh_token_credentials_create(
+      test_refresh_token_str, NULL);
+
+  /* First request: http get should be called. */
+  request_metadata_state* state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
+                            refresh_token_httpcli_post_success);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* Second request: the cached token should be served directly. */
+  state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
+                            httpcli_post_should_not_be_called);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  grpc_httpcli_set_override(NULL, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_refresh_token_creds_failure(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  request_metadata_state* state = make_request_metadata_state(
+      GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+          "Error occured when fetching oauth2 token."),
+      NULL, 0);
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  grpc_call_credentials* creds = grpc_google_refresh_token_credentials_create(
+      test_refresh_token_str, NULL);
+  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
+                            refresh_token_httpcli_post_failure);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  grpc_httpcli_set_override(NULL, NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void validate_jwt_encode_and_sign_params(
+    const grpc_auth_json_key* json_key, const char* scope,
+    gpr_timespec token_lifetime) {
+  GPR_ASSERT(grpc_auth_json_key_is_valid(json_key));
+  GPR_ASSERT(json_key->private_key != NULL);
+  GPR_ASSERT(RSA_check_key(json_key->private_key));
+  GPR_ASSERT(json_key->type != NULL &&
+             strcmp(json_key->type, "service_account") == 0);
+  GPR_ASSERT(json_key->private_key_id != NULL &&
+             strcmp(json_key->private_key_id,
+                    "e6b5137873db8d2ef81e06a47289e6434ec8a165") == 0);
+  GPR_ASSERT(json_key->client_id != NULL &&
+             strcmp(json_key->client_id,
+                    "777-abaslkan11hlb6nmim3bpspl31ud.apps."
+                    "googleusercontent.com") == 0);
+  GPR_ASSERT(json_key->client_email != NULL &&
+             strcmp(json_key->client_email,
+                    "777-abaslkan11hlb6nmim3bpspl31ud@developer."
+                    "gserviceaccount.com") == 0);
+  if (scope != NULL) GPR_ASSERT(strcmp(scope, test_scope) == 0);
+  GPR_ASSERT(!gpr_time_cmp(token_lifetime, grpc_max_auth_token_lifetime()));
+}
+
+static char* encode_and_sign_jwt_success(const grpc_auth_json_key* json_key,
+                                         const char* audience,
+                                         gpr_timespec token_lifetime,
+                                         const char* scope) {
+  validate_jwt_encode_and_sign_params(json_key, scope, token_lifetime);
+  return gpr_strdup(test_signed_jwt);
+}
+
+static char* encode_and_sign_jwt_failure(const grpc_auth_json_key* json_key,
+                                         const char* audience,
+                                         gpr_timespec token_lifetime,
+                                         const char* scope) {
+  validate_jwt_encode_and_sign_params(json_key, scope, token_lifetime);
+  return NULL;
+}
+
+static char* encode_and_sign_jwt_should_not_be_called(
+    const grpc_auth_json_key* json_key, const char* audience,
+    gpr_timespec token_lifetime, const char* scope) {
+  GPR_ASSERT("grpc_jwt_encode_and_sign should not be called" == NULL);
+  return NULL;
+}
+
+static grpc_service_account_jwt_access_credentials* creds_as_jwt(
+    grpc_call_credentials* creds) {
+  GPR_ASSERT(creds != NULL);
+  GPR_ASSERT(strcmp(creds->type, GRPC_CALL_CREDENTIALS_TYPE_JWT) == 0);
+  return (grpc_service_account_jwt_access_credentials*)creds;
+}
+
+static void test_jwt_creds_lifetime(void) {
+  char* json_key_string = test_json_key_str();
+
+  // Max lifetime.
+  grpc_call_credentials* jwt_creds =
+      grpc_service_account_jwt_access_credentials_create(
+          json_key_string, grpc_max_auth_token_lifetime(), NULL);
+  GPR_ASSERT(gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime,
+                          grpc_max_auth_token_lifetime()) == 0);
+  grpc_call_credentials_release(jwt_creds);
+
+  // Shorter lifetime.
+  gpr_timespec token_lifetime = {10, 0, GPR_TIMESPAN};
+  GPR_ASSERT(gpr_time_cmp(grpc_max_auth_token_lifetime(), token_lifetime) > 0);
+  jwt_creds = grpc_service_account_jwt_access_credentials_create(
+      json_key_string, token_lifetime, NULL);
+  GPR_ASSERT(
+      gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime, token_lifetime) == 0);
+  grpc_call_credentials_release(jwt_creds);
+
+  // Cropped lifetime.
+  gpr_timespec add_to_max = {10, 0, GPR_TIMESPAN};
+  token_lifetime = gpr_time_add(grpc_max_auth_token_lifetime(), add_to_max);
+  jwt_creds = grpc_service_account_jwt_access_credentials_create(
+      json_key_string, token_lifetime, NULL);
+  GPR_ASSERT(gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime,
+                          grpc_max_auth_token_lifetime()) == 0);
+  grpc_call_credentials_release(jwt_creds);
+
+  gpr_free(json_key_string);
+}
+
+static void test_jwt_creds_success(void) {
+  char* json_key_string = test_json_key_str();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  char* expected_md_value;
+  gpr_asprintf(&expected_md_value, "Bearer %s", test_signed_jwt);
+  expected_md emd[] = {{"authorization", expected_md_value}};
+  grpc_call_credentials* creds =
+      grpc_service_account_jwt_access_credentials_create(
+          json_key_string, grpc_max_auth_token_lifetime(), NULL);
+
+  /* First request: jwt_encode_and_sign should be called. */
+  request_metadata_state* state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* Second request: the cached token should be served directly. */
+  state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_jwt_encode_and_sign_set_override(
+      encode_and_sign_jwt_should_not_be_called);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* Third request: Different service url so jwt_encode_and_sign should be
+     called again (no caching). */
+  state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  auth_md_ctx.service_url = other_test_service_url;
+  grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  gpr_free(json_key_string);
+  gpr_free(expected_md_value);
+  grpc_jwt_encode_and_sign_set_override(NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_jwt_creds_signing_failure(void) {
+  char* json_key_string = test_json_key_str();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  request_metadata_state* state = make_request_metadata_state(
+      GRPC_ERROR_CREATE_FROM_STATIC_STRING("Could not generate JWT."), NULL, 0);
+  grpc_call_credentials* creds =
+      grpc_service_account_jwt_access_credentials_create(
+          json_key_string, grpc_max_auth_token_lifetime(), NULL);
+
+  grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_failure);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, state);
+
+  gpr_free(json_key_string);
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  grpc_jwt_encode_and_sign_set_override(NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void set_google_default_creds_env_var_with_file_contents(
+    const char* file_prefix, const char* contents) {
+  size_t contents_len = strlen(contents);
+  char* creds_file_name;
+  FILE* creds_file = gpr_tmpfile(file_prefix, &creds_file_name);
+  GPR_ASSERT(creds_file_name != NULL);
+  GPR_ASSERT(creds_file != NULL);
+  GPR_ASSERT(fwrite(contents, 1, contents_len, creds_file) == contents_len);
+  fclose(creds_file);
+  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, creds_file_name);
+  gpr_free(creds_file_name);
+}
+
+static void test_google_default_creds_auth_key(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_service_account_jwt_access_credentials* jwt;
+  grpc_composite_channel_credentials* creds;
+  char* json_key = test_json_key_str();
+  grpc_flush_cached_google_default_credentials();
+  set_google_default_creds_env_var_with_file_contents(
+      "json_key_google_default_creds", json_key);
+  gpr_free(json_key);
+  creds = (grpc_composite_channel_credentials*)
+      grpc_google_default_credentials_create();
+  GPR_ASSERT(creds != NULL);
+  jwt = (grpc_service_account_jwt_access_credentials*)creds->call_creds;
+  GPR_ASSERT(
+      strcmp(jwt->key.client_id,
+             "777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent.com") ==
+      0);
+  grpc_channel_credentials_unref(&exec_ctx, &creds->base);
+  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_google_default_creds_refresh_token(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_google_refresh_token_credentials* refresh;
+  grpc_composite_channel_credentials* creds;
+  grpc_flush_cached_google_default_credentials();
+  set_google_default_creds_env_var_with_file_contents(
+      "refresh_token_google_default_creds", test_refresh_token_str);
+  creds = (grpc_composite_channel_credentials*)
+      grpc_google_default_credentials_create();
+  GPR_ASSERT(creds != NULL);
+  refresh = (grpc_google_refresh_token_credentials*)creds->call_creds;
+  GPR_ASSERT(strcmp(refresh->refresh_token.client_id,
+                    "32555999999.apps.googleusercontent.com") == 0);
+  grpc_channel_credentials_unref(&exec_ctx, &creds->base);
+  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static int default_creds_gce_detection_httpcli_get_success_override(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    grpc_millis deadline, grpc_closure* on_done,
+    grpc_httpcli_response* response) {
+  *response = http_response(200, "");
+  grpc_http_header* headers =
+      static_cast<grpc_http_header*>(gpr_malloc(sizeof(*headers) * 1));
+  headers[0].key = gpr_strdup("Metadata-Flavor");
+  headers[0].value = gpr_strdup("Google");
+  response->hdr_count = 1;
+  response->hdrs = headers;
+  GPR_ASSERT(strcmp(request->http.path, "/") == 0);
+  GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static char* null_well_known_creds_path_getter(void) { return NULL; }
+
+static void test_google_default_creds_gce(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  expected_md emd[] = {
+      {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
+  request_metadata_state* state =
+      make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  grpc_flush_cached_google_default_credentials();
+  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
+  grpc_override_well_known_credentials_path_getter(
+      null_well_known_creds_path_getter);
+
+  /* Simulate a successful detection of GCE. */
+  grpc_httpcli_set_override(
+      default_creds_gce_detection_httpcli_get_success_override,
+      httpcli_post_should_not_be_called);
+  grpc_composite_channel_credentials* creds =
+      (grpc_composite_channel_credentials*)
+          grpc_google_default_credentials_create();
+
+  /* Verify that the default creds actually embeds a GCE creds. */
+  GPR_ASSERT(creds != NULL);
+  GPR_ASSERT(creds->call_creds != NULL);
+  grpc_httpcli_set_override(compute_engine_httpcli_get_success_override,
+                            httpcli_post_should_not_be_called);
+  run_request_metadata_test(&exec_ctx, creds->call_creds, auth_md_ctx, state);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  /* Check that we get a cached creds if we call
+     grpc_google_default_credentials_create again.
+     GCE detection should not occur anymore either. */
+  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
+                            httpcli_post_should_not_be_called);
+  grpc_channel_credentials* cached_creds =
+      grpc_google_default_credentials_create();
+  GPR_ASSERT(cached_creds == &creds->base);
+
+  /* Cleanup. */
+  grpc_channel_credentials_unref(&exec_ctx, cached_creds);
+  grpc_channel_credentials_unref(&exec_ctx, &creds->base);
+  grpc_httpcli_set_override(NULL, NULL);
+  grpc_override_well_known_credentials_path_getter(NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static int default_creds_gce_detection_httpcli_get_failure_override(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    grpc_millis deadline, grpc_closure* on_done,
+    grpc_httpcli_response* response) {
+  /* No magic header. */
+  GPR_ASSERT(strcmp(request->http.path, "/") == 0);
+  GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
+  *response = http_response(200, "");
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static void test_no_google_default_creds(void) {
+  grpc_flush_cached_google_default_credentials();
+  gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
+  grpc_override_well_known_credentials_path_getter(
+      null_well_known_creds_path_getter);
+
+  /* Simulate a successful detection of GCE. */
+  grpc_httpcli_set_override(
+      default_creds_gce_detection_httpcli_get_failure_override,
+      httpcli_post_should_not_be_called);
+  GPR_ASSERT(grpc_google_default_credentials_create() == NULL);
+
+  /* Try a cached one. GCE detection should not occur anymore. */
+  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
+                            httpcli_post_should_not_be_called);
+  GPR_ASSERT(grpc_google_default_credentials_create() == NULL);
+
+  /* Cleanup. */
+  grpc_httpcli_set_override(NULL, NULL);
+  grpc_override_well_known_credentials_path_getter(NULL);
+}
+
+typedef enum {
+  PLUGIN_INITIAL_STATE,
+  PLUGIN_GET_METADATA_CALLED_STATE,
+  PLUGIN_DESTROY_CALLED_STATE
+} plugin_state;
+
+static const expected_md plugin_md[] = {{"foo", "bar"}, {"hi", "there"}};
+
+static int plugin_get_metadata_success(
+    void* state, grpc_auth_metadata_context context,
+    grpc_credentials_plugin_metadata_cb cb, void* user_data,
+    grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
+    size_t* num_creds_md, grpc_status_code* status,
+    const char** error_details) {
+  GPR_ASSERT(strcmp(context.service_url, test_service_url) == 0);
+  GPR_ASSERT(strcmp(context.method_name, test_method) == 0);
+  GPR_ASSERT(context.channel_auth_context == NULL);
+  GPR_ASSERT(context.reserved == NULL);
+  GPR_ASSERT(GPR_ARRAY_SIZE(plugin_md) <
+             GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX);
+  plugin_state* s = (plugin_state*)state;
+  *s = PLUGIN_GET_METADATA_CALLED_STATE;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(plugin_md); ++i) {
+    memset(&creds_md[i], 0, sizeof(grpc_metadata));
+    creds_md[i].key = grpc_slice_from_copied_string(plugin_md[i].key);
+    creds_md[i].value = grpc_slice_from_copied_string(plugin_md[i].value);
+  }
+  *num_creds_md = GPR_ARRAY_SIZE(plugin_md);
+  return true;  // Synchronous return.
+}
+
+static const char* plugin_error_details = "Could not get metadata for plugin.";
+
+static int plugin_get_metadata_failure(
+    void* state, grpc_auth_metadata_context context,
+    grpc_credentials_plugin_metadata_cb cb, void* user_data,
+    grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
+    size_t* num_creds_md, grpc_status_code* status,
+    const char** error_details) {
+  GPR_ASSERT(strcmp(context.service_url, test_service_url) == 0);
+  GPR_ASSERT(strcmp(context.method_name, test_method) == 0);
+  GPR_ASSERT(context.channel_auth_context == NULL);
+  GPR_ASSERT(context.reserved == NULL);
+  plugin_state* s = (plugin_state*)state;
+  *s = PLUGIN_GET_METADATA_CALLED_STATE;
+  *status = GRPC_STATUS_UNAUTHENTICATED;
+  *error_details = gpr_strdup(plugin_error_details);
+  return true;  // Synchronous return.
+}
+
+static void plugin_destroy(void* state) {
+  plugin_state* s = (plugin_state*)state;
+  *s = PLUGIN_DESTROY_CALLED_STATE;
+}
+
+static void test_metadata_plugin_success(void) {
+  plugin_state state = PLUGIN_INITIAL_STATE;
+  grpc_metadata_credentials_plugin plugin;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  request_metadata_state* md_state = make_request_metadata_state(
+      GRPC_ERROR_NONE, plugin_md, GPR_ARRAY_SIZE(plugin_md));
+
+  plugin.state = &state;
+  plugin.get_metadata = plugin_get_metadata_success;
+  plugin.destroy = plugin_destroy;
+
+  grpc_call_credentials* creds =
+      grpc_metadata_credentials_create_from_plugin(plugin, NULL);
+  GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, md_state);
+  GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  grpc_exec_ctx_finish(&exec_ctx);
+  GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
+}
+
+static void test_metadata_plugin_failure(void) {
+  plugin_state state = PLUGIN_INITIAL_STATE;
+  grpc_metadata_credentials_plugin plugin;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method, NULL,
+                                            NULL};
+  char* expected_error;
+  gpr_asprintf(&expected_error,
+               "Getting metadata from plugin failed with error: %s",
+               plugin_error_details);
+  request_metadata_state* md_state = make_request_metadata_state(
+      GRPC_ERROR_CREATE_FROM_COPIED_STRING(expected_error), NULL, 0);
+  gpr_free(expected_error);
+
+  plugin.state = &state;
+  plugin.get_metadata = plugin_get_metadata_failure;
+  plugin.destroy = plugin_destroy;
+
+  grpc_call_credentials* creds =
+      grpc_metadata_credentials_create_from_plugin(plugin, NULL);
+  GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
+  run_request_metadata_test(&exec_ctx, creds, auth_md_ctx, md_state);
+  GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
+  grpc_call_credentials_unref(&exec_ctx, creds);
+  grpc_exec_ctx_finish(&exec_ctx);
+  GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
+}
+
+static void test_get_well_known_google_credentials_file_path(void) {
+  char* path;
+  char* home = gpr_getenv("HOME");
+  path = grpc_get_well_known_google_credentials_file_path();
+  GPR_ASSERT(path != NULL);
+  gpr_free(path);
+#if defined(GPR_POSIX_ENV) || defined(GPR_LINUX_ENV)
+  unsetenv("HOME");
+  path = grpc_get_well_known_google_credentials_file_path();
+  GPR_ASSERT(path == NULL);
+  gpr_setenv("HOME", home);
+  gpr_free(path);
+#endif /* GPR_POSIX_ENV || GPR_LINUX_ENV */
+  gpr_free(home);
+}
+
+static void test_channel_creds_duplicate_without_call_creds(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  grpc_channel_credentials* channel_creds =
+      grpc_fake_transport_security_credentials_create();
+
+  grpc_channel_credentials* dup =
+      grpc_channel_credentials_duplicate_without_call_credentials(
+          channel_creds);
+  GPR_ASSERT(dup == channel_creds);
+  grpc_channel_credentials_unref(&exec_ctx, dup);
+
+  grpc_call_credentials* call_creds =
+      grpc_access_token_credentials_create("blah", NULL);
+  grpc_channel_credentials* composite_creds =
+      grpc_composite_channel_credentials_create(channel_creds, call_creds,
+                                                NULL);
+  grpc_call_credentials_unref(&exec_ctx, call_creds);
+  dup = grpc_channel_credentials_duplicate_without_call_credentials(
+      composite_creds);
+  GPR_ASSERT(dup == channel_creds);
+  grpc_channel_credentials_unref(&exec_ctx, dup);
+
+  grpc_channel_credentials_unref(&exec_ctx, channel_creds);
+  grpc_channel_credentials_unref(&exec_ctx, composite_creds);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+typedef struct {
+  const char* url_scheme;
+  const char* call_host;
+  const char* call_method;
+  const char* desired_service_url;
+  const char* desired_method_name;
+} auth_metadata_context_test_case;
+
+static void test_auth_metadata_context(void) {
+  auth_metadata_context_test_case test_cases[] = {
+      // No service nor method.
+      {"https", "www.foo.com", "", "https://www.foo.com", ""},
+      // No method.
+      {"https", "www.foo.com", "/Service", "https://www.foo.com/Service", ""},
+      // Empty service and method.
+      {"https", "www.foo.com", "//", "https://www.foo.com/", ""},
+      // Empty method.
+      {"https", "www.foo.com", "/Service/", "https://www.foo.com/Service", ""},
+      // Malformed url.
+      {"https", "www.foo.com:", "/Service/", "https://www.foo.com:/Service",
+       ""},
+      // https, default explicit port.
+      {"https", "www.foo.com:443", "/Service/FooMethod",
+       "https://www.foo.com/Service", "FooMethod"},
+      // https, default implicit port.
+      {"https", "www.foo.com", "/Service/FooMethod",
+       "https://www.foo.com/Service", "FooMethod"},
+      // https with ipv6 literal, default explicit port.
+      {"https", "[1080:0:0:0:8:800:200C:417A]:443", "/Service/FooMethod",
+       "https://[1080:0:0:0:8:800:200C:417A]/Service", "FooMethod"},
+      // https with ipv6 literal, default implicit port.
+      {"https", "[1080:0:0:0:8:800:200C:443]", "/Service/FooMethod",
+       "https://[1080:0:0:0:8:800:200C:443]/Service", "FooMethod"},
+      // https, custom port.
+      {"https", "www.foo.com:8888", "/Service/FooMethod",
+       "https://www.foo.com:8888/Service", "FooMethod"},
+      // https with ipv6 literal, custom port.
+      {"https", "[1080:0:0:0:8:800:200C:417A]:8888", "/Service/FooMethod",
+       "https://[1080:0:0:0:8:800:200C:417A]:8888/Service", "FooMethod"},
+      // custom url scheme, https default port.
+      {"blah", "www.foo.com:443", "/Service/FooMethod",
+       "blah://www.foo.com:443/Service", "FooMethod"}};
+  for (uint32_t i = 0; i < GPR_ARRAY_SIZE(test_cases); i++) {
+    const char* url_scheme = test_cases[i].url_scheme;
+    grpc_slice call_host =
+        grpc_slice_from_copied_string(test_cases[i].call_host);
+    grpc_slice call_method =
+        grpc_slice_from_copied_string(test_cases[i].call_method);
+    grpc_auth_metadata_context auth_md_context;
+    memset(&auth_md_context, 0, sizeof(auth_md_context));
+    grpc_auth_metadata_context_build(url_scheme, call_host, call_method, NULL,
+                                     &auth_md_context);
+    if (strcmp(auth_md_context.service_url,
+               test_cases[i].desired_service_url) != 0) {
+      gpr_log(GPR_ERROR, "Invalid service url, want: %s, got %s.",
+              test_cases[i].desired_service_url, auth_md_context.service_url);
+      GPR_ASSERT(false);
+    }
+    if (strcmp(auth_md_context.method_name,
+               test_cases[i].desired_method_name) != 0) {
+      gpr_log(GPR_ERROR, "Invalid method name, want: %s, got %s.",
+              test_cases[i].desired_method_name, auth_md_context.method_name);
+      GPR_ASSERT(false);
+    }
+    GPR_ASSERT(auth_md_context.channel_auth_context == NULL);
+    grpc_slice_unref(call_host);
+    grpc_slice_unref(call_method);
+    grpc_auth_metadata_context_reset(&auth_md_context);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_empty_md_array();
+  test_add_to_empty_md_array();
+  test_add_abunch_to_md_array();
+  test_oauth2_token_fetcher_creds_parsing_ok();
+  test_oauth2_token_fetcher_creds_parsing_bad_http_status();
+  test_oauth2_token_fetcher_creds_parsing_empty_http_body();
+  test_oauth2_token_fetcher_creds_parsing_invalid_json();
+  test_oauth2_token_fetcher_creds_parsing_missing_token();
+  test_oauth2_token_fetcher_creds_parsing_missing_token_type();
+  test_oauth2_token_fetcher_creds_parsing_missing_token_lifetime();
+  test_google_iam_creds();
+  test_access_token_creds();
+  test_channel_oauth2_composite_creds();
+  test_oauth2_google_iam_composite_creds();
+  test_channel_oauth2_google_iam_composite_creds();
+  test_compute_engine_creds_success();
+  test_compute_engine_creds_failure();
+  test_refresh_token_creds_success();
+  test_refresh_token_creds_failure();
+  test_jwt_creds_lifetime();
+  test_jwt_creds_success();
+  test_jwt_creds_signing_failure();
+  test_google_default_creds_auth_key();
+  test_google_default_creds_refresh_token();
+  test_google_default_creds_gce();
+  test_no_google_default_creds();
+  test_metadata_plugin_success();
+  test_metadata_plugin_failure();
+  test_get_well_known_google_credentials_file_path();
+  test_channel_creds_duplicate_without_call_creds();
+  test_auth_metadata_context();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/security/fetch_oauth2.c b/test/core/security/fetch_oauth2.c
deleted file mode 100644
index 3998cb5..0000000
--- a/test/core/security/fetch_oauth2.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/cmdline.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#include "src/core/lib/iomgr/load_file.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "test/core/security/oauth2_utils.h"
-
-static grpc_call_credentials *create_refresh_token_creds(
-    const char *json_refresh_token_file_path) {
-  grpc_slice refresh_token;
-  GPR_ASSERT(GRPC_LOG_IF_ERROR(
-      "load_file",
-      grpc_load_file(json_refresh_token_file_path, 1, &refresh_token)));
-  return grpc_google_refresh_token_credentials_create(
-      (const char *)GRPC_SLICE_START_PTR(refresh_token), NULL);
-}
-
-int main(int argc, char **argv) {
-  grpc_call_credentials *creds = NULL;
-  char *json_key_file_path = NULL;
-  char *json_refresh_token_file_path = NULL;
-  char *token = NULL;
-  int use_gce = 0;
-  char *scope = NULL;
-  gpr_cmdline *cl = gpr_cmdline_create("fetch_oauth2");
-  gpr_cmdline_add_string(cl, "json_refresh_token",
-                         "File path of the json refresh token.",
-                         &json_refresh_token_file_path);
-  gpr_cmdline_add_flag(
-      cl, "gce",
-      "Get a token from the GCE metadata server (only works in GCE).",
-      &use_gce);
-  gpr_cmdline_parse(cl, argc, argv);
-
-  grpc_init();
-
-  if (json_key_file_path != NULL && json_refresh_token_file_path != NULL) {
-    gpr_log(GPR_ERROR,
-            "--json_key and --json_refresh_token are mutually exclusive.");
-    exit(1);
-  }
-
-  if (use_gce) {
-    if (json_key_file_path != NULL || scope != NULL) {
-      gpr_log(GPR_INFO,
-              "Ignoring json key and scope to get a token from the GCE "
-              "metadata server.");
-    }
-    creds = grpc_google_compute_engine_credentials_create(NULL);
-    if (creds == NULL) {
-      gpr_log(GPR_ERROR, "Could not create gce credentials.");
-      exit(1);
-    }
-  } else if (json_refresh_token_file_path != NULL) {
-    creds = create_refresh_token_creds(json_refresh_token_file_path);
-    if (creds == NULL) {
-      gpr_log(GPR_ERROR,
-              "Could not create refresh token creds. %s does probably not "
-              "contain a valid json refresh token.",
-              json_refresh_token_file_path);
-      exit(1);
-    }
-  } else {
-    gpr_log(GPR_ERROR, "Missing --gce or --json_refresh_token option.");
-    exit(1);
-  }
-  GPR_ASSERT(creds != NULL);
-
-  token = grpc_test_fetch_oauth2_token_with_credentials(creds);
-  if (token != NULL) {
-    printf("Got token: %s.\n", token);
-    gpr_free(token);
-  }
-  grpc_call_credentials_release(creds);
-  gpr_cmdline_destroy(cl);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/security/fetch_oauth2.cc b/test/core/security/fetch_oauth2.cc
new file mode 100644
index 0000000..fa8036e
--- /dev/null
+++ b/test/core/security/fetch_oauth2.cc
@@ -0,0 +1,104 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "test/core/security/oauth2_utils.h"
+
+static grpc_call_credentials* create_refresh_token_creds(
+    const char* json_refresh_token_file_path) {
+  grpc_slice refresh_token;
+  GPR_ASSERT(GRPC_LOG_IF_ERROR(
+      "load_file",
+      grpc_load_file(json_refresh_token_file_path, 1, &refresh_token)));
+  return grpc_google_refresh_token_credentials_create(
+      (const char*)GRPC_SLICE_START_PTR(refresh_token), NULL);
+}
+
+int main(int argc, char** argv) {
+  grpc_call_credentials* creds = NULL;
+  char* json_key_file_path = NULL;
+  const char* json_refresh_token_file_path = NULL;
+  char* token = NULL;
+  int use_gce = 0;
+  char* scope = NULL;
+  gpr_cmdline* cl = gpr_cmdline_create("fetch_oauth2");
+  gpr_cmdline_add_string(cl, "json_refresh_token",
+                         "File path of the json refresh token.",
+                         &json_refresh_token_file_path);
+  gpr_cmdline_add_flag(
+      cl, "gce",
+      "Get a token from the GCE metadata server (only works in GCE).",
+      &use_gce);
+  gpr_cmdline_parse(cl, argc, argv);
+
+  grpc_init();
+
+  if (json_key_file_path != NULL && json_refresh_token_file_path != NULL) {
+    gpr_log(GPR_ERROR,
+            "--json_key and --json_refresh_token are mutually exclusive.");
+    exit(1);
+  }
+
+  if (use_gce) {
+    if (json_key_file_path != NULL || scope != NULL) {
+      gpr_log(GPR_INFO,
+              "Ignoring json key and scope to get a token from the GCE "
+              "metadata server.");
+    }
+    creds = grpc_google_compute_engine_credentials_create(NULL);
+    if (creds == NULL) {
+      gpr_log(GPR_ERROR, "Could not create gce credentials.");
+      exit(1);
+    }
+  } else if (json_refresh_token_file_path != NULL) {
+    creds = create_refresh_token_creds(json_refresh_token_file_path);
+    if (creds == NULL) {
+      gpr_log(GPR_ERROR,
+              "Could not create refresh token creds. %s does probably not "
+              "contain a valid json refresh token.",
+              json_refresh_token_file_path);
+      exit(1);
+    }
+  } else {
+    gpr_log(GPR_ERROR, "Missing --gce or --json_refresh_token option.");
+    exit(1);
+  }
+  GPR_ASSERT(creds != NULL);
+
+  token = grpc_test_fetch_oauth2_token_with_credentials(creds);
+  if (token != NULL) {
+    printf("Got token: %s.\n", token);
+    gpr_free(token);
+  }
+  grpc_call_credentials_release(creds);
+  gpr_cmdline_destroy(cl);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/security/json_token_test.c b/test/core/security/json_token_test.c
deleted file mode 100644
index 6573f70..0000000
--- a/test/core/security/json_token_test.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/security/credentials/jwt/json_token.h"
-
-#include <openssl/evp.h>
-#include <string.h>
-
-#include <grpc/grpc_security.h>
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/json/json.h"
-#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
-#include "src/core/lib/slice/b64.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "test/core/util/test_config.h"
-
-/* This JSON key was generated with the GCE console and revoked immediately.
-   The identifiers have been changed as well.
-   Maximum size for a string literal is 509 chars in C89, yay!  */
-static const char test_json_key_str_part1[] =
-    "{ \"private_key\": \"-----BEGIN PRIVATE KEY-----"
-    "\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE"
-    "qg"
-    "WGjiw71NfXByguekSKho65FxaGbsnSM9SMQAqVk7Q2rG+I0OpsT0LrWQtZ\\nyjSeg/"
-    "rWBQvS4hle4LfijkP3J5BG+"
-    "IXDMP8RfziNRQsenAXDNPkY4kJCvKux2xdD\\nOnVF6N7dL3nTYZg+"
-    "uQrNsMTz9UxVAgMBAAECgYEAzbLewe1xe9vy+2GoSsfib+28\\nDZgSE6Bu/"
-    "zuFoPrRc6qL9p2SsnV7txrunTyJkkOnPLND9ABAXybRTlcVKP/sGgza\\n/"
-    "8HpCqFYM9V8f34SBWfD4fRFT+n/"
-    "73cfRUtGXdXpseva2lh8RilIQfPhNZAncenU\\ngqXjDvpkypEusgXAykECQQD+";
-static const char test_json_key_str_part2[] =
-    "53XxNVnxBHsYb+AYEfklR96yVi8HywjVHP34+OQZ\\nCslxoHQM8s+"
-    "dBnjfScLu22JqkPv04xyxmt0QAKm9+vTdAkEA4ib7YvEAn2jXzcCI\\nEkoy2L/"
-    "XydR1GCHoacdfdAwiL2npOdnbvi4ZmdYRPY1LSTO058tQHKVXV7NLeCa3\\nAARh2QJBAMKeDA"
-    "G"
-    "W303SQv2cZTdbeaLKJbB5drz3eo3j7dDKjrTD9JupixFbzcGw\\n8FZi5c8idxiwC36kbAL6Hz"
-    "A"
-    "ZoX+ofI0CQE6KCzPJTtYNqyShgKAZdJ8hwOcvCZtf\\n6z8RJm0+"
-    "6YBd38lfh5j8mZd7aHFf6I17j5AQY7oPEc47TjJj/"
-    "5nZ68ECQQDvYuI3\\nLyK5fS8g0SYbmPOL9TlcHDOqwG0mrX9qpg5DC2fniXNSrrZ64GTDKdzZ"
-    "Y"
-    "Ap6LI9W\\nIqv4vr6y38N79TTC\\n-----END PRIVATE KEY-----\\n\", ";
-static const char test_json_key_str_part3[] =
-    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-    "\"client_email\": "
-    "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
-    "com\", \"client_id\": "
-    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-    "com\", \"type\": \"service_account\" }";
-
-/* Test refresh token. */
-static const char test_refresh_token_str[] =
-    "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
-    "  \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
-    "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\","
-    "  \"type\": \"authorized_user\"}";
-
-static const char test_scope[] = "myperm1 myperm2";
-
-static const char test_service_url[] = "https://foo.com/foo.v1";
-
-static char *test_json_key_str(const char *bad_part3) {
-  const char *part3 = bad_part3 != NULL ? bad_part3 : test_json_key_str_part3;
-  size_t result_len = strlen(test_json_key_str_part1) +
-                      strlen(test_json_key_str_part2) + strlen(part3);
-  char *result = gpr_malloc(result_len + 1);
-  char *current = result;
-  strcpy(result, test_json_key_str_part1);
-  current += strlen(test_json_key_str_part1);
-  strcpy(current, test_json_key_str_part2);
-  current += strlen(test_json_key_str_part2);
-  strcpy(current, part3);
-  return result;
-}
-
-static void test_parse_json_key_success(void) {
-  char *json_string = test_json_key_str(NULL);
-  grpc_auth_json_key json_key =
-      grpc_auth_json_key_create_from_string(json_string);
-  GPR_ASSERT(grpc_auth_json_key_is_valid(&json_key));
-  GPR_ASSERT(json_key.type != NULL &&
-             strcmp(json_key.type, "service_account") == 0);
-  GPR_ASSERT(json_key.private_key_id != NULL &&
-             strcmp(json_key.private_key_id,
-                    "e6b5137873db8d2ef81e06a47289e6434ec8a165") == 0);
-  GPR_ASSERT(json_key.client_id != NULL &&
-             strcmp(json_key.client_id,
-                    "777-abaslkan11hlb6nmim3bpspl31ud.apps."
-                    "googleusercontent.com") == 0);
-  GPR_ASSERT(json_key.client_email != NULL &&
-             strcmp(json_key.client_email,
-                    "777-abaslkan11hlb6nmim3bpspl31ud@developer."
-                    "gserviceaccount.com") == 0);
-  GPR_ASSERT(json_key.private_key != NULL);
-  gpr_free(json_string);
-  grpc_auth_json_key_destruct(&json_key);
-}
-
-static void test_parse_json_key_failure_bad_json(void) {
-  const char non_closing_part3[] =
-      "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-      "\"client_email\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
-      "com\", \"client_id\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-      "com\", \"type\": \"service_account\" ";
-  char *json_string = test_json_key_str(non_closing_part3);
-  grpc_auth_json_key json_key =
-      grpc_auth_json_key_create_from_string(json_string);
-  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
-  gpr_free(json_string);
-  grpc_auth_json_key_destruct(&json_key);
-}
-
-static void test_parse_json_key_failure_no_type(void) {
-  const char no_type_part3[] =
-      "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-      "\"client_email\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
-      "com\", \"client_id\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-      "com\" }";
-  char *json_string = test_json_key_str(no_type_part3);
-  grpc_auth_json_key json_key =
-      grpc_auth_json_key_create_from_string(json_string);
-  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
-  gpr_free(json_string);
-  grpc_auth_json_key_destruct(&json_key);
-}
-
-static void test_parse_json_key_failure_no_client_id(void) {
-  const char no_client_id_part3[] =
-      "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-      "\"client_email\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
-      "com\", "
-      "\"type\": \"service_account\" }";
-  char *json_string = test_json_key_str(no_client_id_part3);
-  grpc_auth_json_key json_key =
-      grpc_auth_json_key_create_from_string(json_string);
-  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
-  gpr_free(json_string);
-  grpc_auth_json_key_destruct(&json_key);
-}
-
-static void test_parse_json_key_failure_no_client_email(void) {
-  const char no_client_email_part3[] =
-      "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-      "\"client_id\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-      "com\", \"type\": \"service_account\" }";
-  char *json_string = test_json_key_str(no_client_email_part3);
-  grpc_auth_json_key json_key =
-      grpc_auth_json_key_create_from_string(json_string);
-  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
-  gpr_free(json_string);
-  grpc_auth_json_key_destruct(&json_key);
-}
-
-static void test_parse_json_key_failure_no_private_key_id(void) {
-  const char no_private_key_id_part3[] =
-      "\"client_email\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
-      "com\", \"client_id\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-      "com\", \"type\": \"service_account\" }";
-  char *json_string = test_json_key_str(no_private_key_id_part3);
-  grpc_auth_json_key json_key =
-      grpc_auth_json_key_create_from_string(json_string);
-  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
-  gpr_free(json_string);
-  grpc_auth_json_key_destruct(&json_key);
-}
-
-static void test_parse_json_key_failure_no_private_key(void) {
-  const char no_private_key_json_string[] =
-      "{ \"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-      "\"client_email\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
-      "com\", \"client_id\": "
-      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-      "com\", \"type\": \"service_account\" }";
-  grpc_auth_json_key json_key =
-      grpc_auth_json_key_create_from_string(no_private_key_json_string);
-  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
-  grpc_auth_json_key_destruct(&json_key);
-}
-
-static grpc_json *parse_json_part_from_jwt(const char *str, size_t len,
-                                           char **scratchpad) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  char *b64;
-  char *decoded;
-  grpc_json *json;
-  grpc_slice slice;
-  b64 = gpr_malloc(len + 1);
-  strncpy(b64, str, len);
-  b64[len] = '\0';
-  slice = grpc_base64_decode(&exec_ctx, b64, 1);
-  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(slice));
-  decoded = gpr_malloc(GRPC_SLICE_LENGTH(slice) + 1);
-  strncpy(decoded, (const char *)GRPC_SLICE_START_PTR(slice),
-          GRPC_SLICE_LENGTH(slice));
-  decoded[GRPC_SLICE_LENGTH(slice)] = '\0';
-  json = grpc_json_parse_string(decoded);
-  gpr_free(b64);
-  *scratchpad = decoded;
-  grpc_slice_unref(slice);
-  grpc_exec_ctx_finish(&exec_ctx);
-  return json;
-}
-
-static void check_jwt_header(grpc_json *header) {
-  grpc_json *ptr;
-  grpc_json *alg = NULL;
-  grpc_json *typ = NULL;
-  grpc_json *kid = NULL;
-
-  for (ptr = header->child; ptr; ptr = ptr->next) {
-    if (strcmp(ptr->key, "alg") == 0) {
-      alg = ptr;
-    } else if (strcmp(ptr->key, "typ") == 0) {
-      typ = ptr;
-    } else if (strcmp(ptr->key, "kid") == 0) {
-      kid = ptr;
-    }
-  }
-  GPR_ASSERT(alg != NULL);
-  GPR_ASSERT(alg->type == GRPC_JSON_STRING);
-  GPR_ASSERT(strcmp(alg->value, "RS256") == 0);
-
-  GPR_ASSERT(typ != NULL);
-  GPR_ASSERT(typ->type == GRPC_JSON_STRING);
-  GPR_ASSERT(strcmp(typ->value, "JWT") == 0);
-
-  GPR_ASSERT(kid != NULL);
-  GPR_ASSERT(kid->type == GRPC_JSON_STRING);
-  GPR_ASSERT(strcmp(kid->value, "e6b5137873db8d2ef81e06a47289e6434ec8a165") ==
-             0);
-}
-
-static void check_jwt_claim(grpc_json *claim, const char *expected_audience,
-                            const char *expected_scope) {
-  gpr_timespec expiration = gpr_time_0(GPR_CLOCK_REALTIME);
-  gpr_timespec issue_time = gpr_time_0(GPR_CLOCK_REALTIME);
-  gpr_timespec parsed_lifetime;
-  grpc_json *iss = NULL;
-  grpc_json *scope = NULL;
-  grpc_json *aud = NULL;
-  grpc_json *exp = NULL;
-  grpc_json *iat = NULL;
-  grpc_json *sub = NULL;
-  grpc_json *ptr;
-
-  for (ptr = claim->child; ptr; ptr = ptr->next) {
-    if (strcmp(ptr->key, "iss") == 0) {
-      iss = ptr;
-    } else if (strcmp(ptr->key, "sub") == 0) {
-      sub = ptr;
-    } else if (strcmp(ptr->key, "scope") == 0) {
-      scope = ptr;
-    } else if (strcmp(ptr->key, "aud") == 0) {
-      aud = ptr;
-    } else if (strcmp(ptr->key, "exp") == 0) {
-      exp = ptr;
-    } else if (strcmp(ptr->key, "iat") == 0) {
-      iat = ptr;
-    }
-  }
-
-  GPR_ASSERT(iss != NULL);
-  GPR_ASSERT(iss->type == GRPC_JSON_STRING);
-  GPR_ASSERT(
-      strcmp(
-          iss->value,
-          "777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount.com") ==
-      0);
-
-  if (expected_scope != NULL) {
-    GPR_ASSERT(scope != NULL);
-    GPR_ASSERT(sub == NULL);
-    GPR_ASSERT(scope->type == GRPC_JSON_STRING);
-    GPR_ASSERT(strcmp(scope->value, expected_scope) == 0);
-  } else {
-    /* Claims without scope must have a sub. */
-    GPR_ASSERT(scope == NULL);
-    GPR_ASSERT(sub != NULL);
-    GPR_ASSERT(sub->type == GRPC_JSON_STRING);
-    GPR_ASSERT(strcmp(iss->value, sub->value) == 0);
-  }
-
-  GPR_ASSERT(aud != NULL);
-  GPR_ASSERT(aud->type == GRPC_JSON_STRING);
-  GPR_ASSERT(strcmp(aud->value, expected_audience) == 0);
-
-  GPR_ASSERT(exp != NULL);
-  GPR_ASSERT(exp->type == GRPC_JSON_NUMBER);
-  expiration.tv_sec = strtol(exp->value, NULL, 10);
-
-  GPR_ASSERT(iat != NULL);
-  GPR_ASSERT(iat->type == GRPC_JSON_NUMBER);
-  issue_time.tv_sec = strtol(iat->value, NULL, 10);
-
-  parsed_lifetime = gpr_time_sub(expiration, issue_time);
-  GPR_ASSERT(parsed_lifetime.tv_sec == grpc_max_auth_token_lifetime().tv_sec);
-}
-
-static void check_jwt_signature(const char *b64_signature, RSA *rsa_key,
-                                const char *signed_data,
-                                size_t signed_data_size) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  EVP_MD_CTX *md_ctx = EVP_MD_CTX_create();
-  EVP_PKEY *key = EVP_PKEY_new();
-
-  grpc_slice sig = grpc_base64_decode(&exec_ctx, b64_signature, 1);
-  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(sig));
-  GPR_ASSERT(GRPC_SLICE_LENGTH(sig) == 128);
-
-  GPR_ASSERT(md_ctx != NULL);
-  GPR_ASSERT(key != NULL);
-  EVP_PKEY_set1_RSA(key, rsa_key);
-
-  GPR_ASSERT(EVP_DigestVerifyInit(md_ctx, NULL, EVP_sha256(), NULL, key) == 1);
-  GPR_ASSERT(EVP_DigestVerifyUpdate(md_ctx, signed_data, signed_data_size) ==
-             1);
-  GPR_ASSERT(EVP_DigestVerifyFinal(md_ctx, GRPC_SLICE_START_PTR(sig),
-                                   GRPC_SLICE_LENGTH(sig)) == 1);
-
-  grpc_slice_unref_internal(&exec_ctx, sig);
-  if (key != NULL) EVP_PKEY_free(key);
-  if (md_ctx != NULL) EVP_MD_CTX_destroy(md_ctx);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static char *service_account_creds_jwt_encode_and_sign(
-    const grpc_auth_json_key *key) {
-  return grpc_jwt_encode_and_sign(key, GRPC_JWT_OAUTH2_AUDIENCE,
-                                  grpc_max_auth_token_lifetime(), test_scope);
-}
-
-static char *jwt_creds_jwt_encode_and_sign(const grpc_auth_json_key *key) {
-  return grpc_jwt_encode_and_sign(key, test_service_url,
-                                  grpc_max_auth_token_lifetime(), NULL);
-}
-
-static void service_account_creds_check_jwt_claim(grpc_json *claim) {
-  check_jwt_claim(claim, GRPC_JWT_OAUTH2_AUDIENCE, test_scope);
-}
-
-static void jwt_creds_check_jwt_claim(grpc_json *claim) {
-  check_jwt_claim(claim, test_service_url, NULL);
-}
-
-static void test_jwt_encode_and_sign(
-    char *(*jwt_encode_and_sign_func)(const grpc_auth_json_key *),
-    void (*check_jwt_claim_func)(grpc_json *)) {
-  char *json_string = test_json_key_str(NULL);
-  grpc_json *parsed_header = NULL;
-  grpc_json *parsed_claim = NULL;
-  char *scratchpad;
-  grpc_auth_json_key json_key =
-      grpc_auth_json_key_create_from_string(json_string);
-  const char *b64_signature;
-  size_t offset = 0;
-  char *jwt = jwt_encode_and_sign_func(&json_key);
-  const char *dot = strchr(jwt, '.');
-  GPR_ASSERT(dot != NULL);
-  parsed_header =
-      parse_json_part_from_jwt(jwt, (size_t)(dot - jwt), &scratchpad);
-  GPR_ASSERT(parsed_header != NULL);
-  check_jwt_header(parsed_header);
-  offset = (size_t)(dot - jwt) + 1;
-  grpc_json_destroy(parsed_header);
-  gpr_free(scratchpad);
-
-  dot = strchr(jwt + offset, '.');
-  GPR_ASSERT(dot != NULL);
-  parsed_claim = parse_json_part_from_jwt(
-      jwt + offset, (size_t)(dot - (jwt + offset)), &scratchpad);
-  GPR_ASSERT(parsed_claim != NULL);
-  check_jwt_claim_func(parsed_claim);
-  offset = (size_t)(dot - jwt) + 1;
-  grpc_json_destroy(parsed_claim);
-  gpr_free(scratchpad);
-
-  dot = strchr(jwt + offset, '.');
-  GPR_ASSERT(dot == NULL); /* no more part. */
-  b64_signature = jwt + offset;
-  check_jwt_signature(b64_signature, json_key.private_key, jwt, offset - 1);
-
-  gpr_free(json_string);
-  grpc_auth_json_key_destruct(&json_key);
-  gpr_free(jwt);
-}
-
-static void test_service_account_creds_jwt_encode_and_sign(void) {
-  test_jwt_encode_and_sign(service_account_creds_jwt_encode_and_sign,
-                           service_account_creds_check_jwt_claim);
-}
-
-static void test_jwt_creds_jwt_encode_and_sign(void) {
-  test_jwt_encode_and_sign(jwt_creds_jwt_encode_and_sign,
-                           jwt_creds_check_jwt_claim);
-}
-
-static void test_parse_refresh_token_success(void) {
-  grpc_auth_refresh_token refresh_token =
-      grpc_auth_refresh_token_create_from_string(test_refresh_token_str);
-  GPR_ASSERT(grpc_auth_refresh_token_is_valid(&refresh_token));
-  GPR_ASSERT(refresh_token.type != NULL &&
-             (strcmp(refresh_token.type, "authorized_user") == 0));
-  GPR_ASSERT(refresh_token.client_id != NULL &&
-             (strcmp(refresh_token.client_id,
-                     "32555999999.apps.googleusercontent.com") == 0));
-  GPR_ASSERT(
-      refresh_token.client_secret != NULL &&
-      (strcmp(refresh_token.client_secret, "EmssLNjJy1332hD4KFsecret") == 0));
-  GPR_ASSERT(refresh_token.refresh_token != NULL &&
-             (strcmp(refresh_token.refresh_token,
-                     "1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42") == 0));
-  grpc_auth_refresh_token_destruct(&refresh_token);
-}
-
-static void test_parse_refresh_token_failure_no_type(void) {
-  const char refresh_token_str[] =
-      "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
-      "  \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
-      "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\"}";
-  grpc_auth_refresh_token refresh_token =
-      grpc_auth_refresh_token_create_from_string(refresh_token_str);
-  GPR_ASSERT(!grpc_auth_refresh_token_is_valid(&refresh_token));
-}
-
-static void test_parse_refresh_token_failure_no_client_id(void) {
-  const char refresh_token_str[] =
-      "{ \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
-      "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\","
-      "  \"type\": \"authorized_user\"}";
-  grpc_auth_refresh_token refresh_token =
-      grpc_auth_refresh_token_create_from_string(refresh_token_str);
-  GPR_ASSERT(!grpc_auth_refresh_token_is_valid(&refresh_token));
-}
-
-static void test_parse_refresh_token_failure_no_client_secret(void) {
-  const char refresh_token_str[] =
-      "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
-      "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\","
-      "  \"type\": \"authorized_user\"}";
-  grpc_auth_refresh_token refresh_token =
-      grpc_auth_refresh_token_create_from_string(refresh_token_str);
-  GPR_ASSERT(!grpc_auth_refresh_token_is_valid(&refresh_token));
-}
-
-static void test_parse_refresh_token_failure_no_refresh_token(void) {
-  const char refresh_token_str[] =
-      "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
-      "  \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
-      "  \"type\": \"authorized_user\"}";
-  grpc_auth_refresh_token refresh_token =
-      grpc_auth_refresh_token_create_from_string(refresh_token_str);
-  GPR_ASSERT(!grpc_auth_refresh_token_is_valid(&refresh_token));
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_parse_json_key_success();
-  test_parse_json_key_failure_bad_json();
-  test_parse_json_key_failure_no_type();
-  test_parse_json_key_failure_no_client_id();
-  test_parse_json_key_failure_no_client_email();
-  test_parse_json_key_failure_no_private_key_id();
-  test_parse_json_key_failure_no_private_key();
-  test_service_account_creds_jwt_encode_and_sign();
-  test_jwt_creds_jwt_encode_and_sign();
-  test_parse_refresh_token_success();
-  test_parse_refresh_token_failure_no_type();
-  test_parse_refresh_token_failure_no_client_id();
-  test_parse_refresh_token_failure_no_client_secret();
-  test_parse_refresh_token_failure_no_refresh_token();
-  return 0;
-}
diff --git a/test/core/security/json_token_test.cc b/test/core/security/json_token_test.cc
new file mode 100644
index 0000000..a06e1d0
--- /dev/null
+++ b/test/core/security/json_token_test.cc
@@ -0,0 +1,501 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/security/credentials/jwt/json_token.h"
+
+#include <openssl/evp.h>
+#include <string.h>
+
+#include <grpc/grpc_security.h>
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
+#include "src/core/lib/slice/b64.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "test/core/util/test_config.h"
+
+/* This JSON key was generated with the GCE console and revoked immediately.
+   The identifiers have been changed as well.
+   Maximum size for a string literal is 509 chars in C89, yay!  */
+static const char test_json_key_str_part1[] =
+    "{ \"private_key\": \"-----BEGIN PRIVATE KEY-----"
+    "\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE"
+    "qg"
+    "WGjiw71NfXByguekSKho65FxaGbsnSM9SMQAqVk7Q2rG+I0OpsT0LrWQtZ\\nyjSeg/"
+    "rWBQvS4hle4LfijkP3J5BG+"
+    "IXDMP8RfziNRQsenAXDNPkY4kJCvKux2xdD\\nOnVF6N7dL3nTYZg+"
+    "uQrNsMTz9UxVAgMBAAECgYEAzbLewe1xe9vy+2GoSsfib+28\\nDZgSE6Bu/"
+    "zuFoPrRc6qL9p2SsnV7txrunTyJkkOnPLND9ABAXybRTlcVKP/sGgza\\n/"
+    "8HpCqFYM9V8f34SBWfD4fRFT+n/"
+    "73cfRUtGXdXpseva2lh8RilIQfPhNZAncenU\\ngqXjDvpkypEusgXAykECQQD+";
+static const char test_json_key_str_part2[] =
+    "53XxNVnxBHsYb+AYEfklR96yVi8HywjVHP34+OQZ\\nCslxoHQM8s+"
+    "dBnjfScLu22JqkPv04xyxmt0QAKm9+vTdAkEA4ib7YvEAn2jXzcCI\\nEkoy2L/"
+    "XydR1GCHoacdfdAwiL2npOdnbvi4ZmdYRPY1LSTO058tQHKVXV7NLeCa3\\nAARh2QJBAMKeDA"
+    "G"
+    "W303SQv2cZTdbeaLKJbB5drz3eo3j7dDKjrTD9JupixFbzcGw\\n8FZi5c8idxiwC36kbAL6Hz"
+    "A"
+    "ZoX+ofI0CQE6KCzPJTtYNqyShgKAZdJ8hwOcvCZtf\\n6z8RJm0+"
+    "6YBd38lfh5j8mZd7aHFf6I17j5AQY7oPEc47TjJj/"
+    "5nZ68ECQQDvYuI3\\nLyK5fS8g0SYbmPOL9TlcHDOqwG0mrX9qpg5DC2fniXNSrrZ64GTDKdzZ"
+    "Y"
+    "Ap6LI9W\\nIqv4vr6y38N79TTC\\n-----END PRIVATE KEY-----\\n\", ";
+static const char test_json_key_str_part3[] =
+    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+    "\"client_email\": "
+    "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
+    "com\", \"client_id\": "
+    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+    "com\", \"type\": \"service_account\" }";
+
+/* Test refresh token. */
+static const char test_refresh_token_str[] =
+    "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
+    "  \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
+    "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\","
+    "  \"type\": \"authorized_user\"}";
+
+static const char test_scope[] = "myperm1 myperm2";
+
+static const char test_service_url[] = "https://foo.com/foo.v1";
+
+static char* test_json_key_str(const char* bad_part3) {
+  const char* part3 = bad_part3 != NULL ? bad_part3 : test_json_key_str_part3;
+  size_t result_len = strlen(test_json_key_str_part1) +
+                      strlen(test_json_key_str_part2) + strlen(part3);
+  char* result = static_cast<char*>(gpr_malloc(result_len + 1));
+  char* current = result;
+  strcpy(result, test_json_key_str_part1);
+  current += strlen(test_json_key_str_part1);
+  strcpy(current, test_json_key_str_part2);
+  current += strlen(test_json_key_str_part2);
+  strcpy(current, part3);
+  return result;
+}
+
+static void test_parse_json_key_success(void) {
+  char* json_string = test_json_key_str(NULL);
+  grpc_auth_json_key json_key =
+      grpc_auth_json_key_create_from_string(json_string);
+  GPR_ASSERT(grpc_auth_json_key_is_valid(&json_key));
+  GPR_ASSERT(json_key.type != NULL &&
+             strcmp(json_key.type, "service_account") == 0);
+  GPR_ASSERT(json_key.private_key_id != NULL &&
+             strcmp(json_key.private_key_id,
+                    "e6b5137873db8d2ef81e06a47289e6434ec8a165") == 0);
+  GPR_ASSERT(json_key.client_id != NULL &&
+             strcmp(json_key.client_id,
+                    "777-abaslkan11hlb6nmim3bpspl31ud.apps."
+                    "googleusercontent.com") == 0);
+  GPR_ASSERT(json_key.client_email != NULL &&
+             strcmp(json_key.client_email,
+                    "777-abaslkan11hlb6nmim3bpspl31ud@developer."
+                    "gserviceaccount.com") == 0);
+  GPR_ASSERT(json_key.private_key != NULL);
+  gpr_free(json_string);
+  grpc_auth_json_key_destruct(&json_key);
+}
+
+static void test_parse_json_key_failure_bad_json(void) {
+  const char non_closing_part3[] =
+      "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+      "\"client_email\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
+      "com\", \"client_id\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+      "com\", \"type\": \"service_account\" ";
+  char* json_string = test_json_key_str(non_closing_part3);
+  grpc_auth_json_key json_key =
+      grpc_auth_json_key_create_from_string(json_string);
+  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
+  gpr_free(json_string);
+  grpc_auth_json_key_destruct(&json_key);
+}
+
+static void test_parse_json_key_failure_no_type(void) {
+  const char no_type_part3[] =
+      "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+      "\"client_email\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
+      "com\", \"client_id\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+      "com\" }";
+  char* json_string = test_json_key_str(no_type_part3);
+  grpc_auth_json_key json_key =
+      grpc_auth_json_key_create_from_string(json_string);
+  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
+  gpr_free(json_string);
+  grpc_auth_json_key_destruct(&json_key);
+}
+
+static void test_parse_json_key_failure_no_client_id(void) {
+  const char no_client_id_part3[] =
+      "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+      "\"client_email\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
+      "com\", "
+      "\"type\": \"service_account\" }";
+  char* json_string = test_json_key_str(no_client_id_part3);
+  grpc_auth_json_key json_key =
+      grpc_auth_json_key_create_from_string(json_string);
+  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
+  gpr_free(json_string);
+  grpc_auth_json_key_destruct(&json_key);
+}
+
+static void test_parse_json_key_failure_no_client_email(void) {
+  const char no_client_email_part3[] =
+      "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+      "\"client_id\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+      "com\", \"type\": \"service_account\" }";
+  char* json_string = test_json_key_str(no_client_email_part3);
+  grpc_auth_json_key json_key =
+      grpc_auth_json_key_create_from_string(json_string);
+  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
+  gpr_free(json_string);
+  grpc_auth_json_key_destruct(&json_key);
+}
+
+static void test_parse_json_key_failure_no_private_key_id(void) {
+  const char no_private_key_id_part3[] =
+      "\"client_email\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
+      "com\", \"client_id\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+      "com\", \"type\": \"service_account\" }";
+  char* json_string = test_json_key_str(no_private_key_id_part3);
+  grpc_auth_json_key json_key =
+      grpc_auth_json_key_create_from_string(json_string);
+  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
+  gpr_free(json_string);
+  grpc_auth_json_key_destruct(&json_key);
+}
+
+static void test_parse_json_key_failure_no_private_key(void) {
+  const char no_private_key_json_string[] =
+      "{ \"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+      "\"client_email\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
+      "com\", \"client_id\": "
+      "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+      "com\", \"type\": \"service_account\" }";
+  grpc_auth_json_key json_key =
+      grpc_auth_json_key_create_from_string(no_private_key_json_string);
+  GPR_ASSERT(!grpc_auth_json_key_is_valid(&json_key));
+  grpc_auth_json_key_destruct(&json_key);
+}
+
+static grpc_json* parse_json_part_from_jwt(const char* str, size_t len,
+                                           char** scratchpad) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  char* b64;
+  char* decoded;
+  grpc_json* json;
+  grpc_slice slice;
+  b64 = static_cast<char*>(gpr_malloc(len + 1));
+  strncpy(b64, str, len);
+  b64[len] = '\0';
+  slice = grpc_base64_decode(&exec_ctx, b64, 1);
+  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(slice));
+  decoded = static_cast<char*>(gpr_malloc(GRPC_SLICE_LENGTH(slice) + 1));
+  strncpy(decoded, (const char*)GRPC_SLICE_START_PTR(slice),
+          GRPC_SLICE_LENGTH(slice));
+  decoded[GRPC_SLICE_LENGTH(slice)] = '\0';
+  json = grpc_json_parse_string(decoded);
+  gpr_free(b64);
+  *scratchpad = decoded;
+  grpc_slice_unref(slice);
+  grpc_exec_ctx_finish(&exec_ctx);
+  return json;
+}
+
+static void check_jwt_header(grpc_json* header) {
+  grpc_json* ptr;
+  grpc_json* alg = NULL;
+  grpc_json* typ = NULL;
+  grpc_json* kid = NULL;
+
+  for (ptr = header->child; ptr; ptr = ptr->next) {
+    if (strcmp(ptr->key, "alg") == 0) {
+      alg = ptr;
+    } else if (strcmp(ptr->key, "typ") == 0) {
+      typ = ptr;
+    } else if (strcmp(ptr->key, "kid") == 0) {
+      kid = ptr;
+    }
+  }
+  GPR_ASSERT(alg != NULL);
+  GPR_ASSERT(alg->type == GRPC_JSON_STRING);
+  GPR_ASSERT(strcmp(alg->value, "RS256") == 0);
+
+  GPR_ASSERT(typ != NULL);
+  GPR_ASSERT(typ->type == GRPC_JSON_STRING);
+  GPR_ASSERT(strcmp(typ->value, "JWT") == 0);
+
+  GPR_ASSERT(kid != NULL);
+  GPR_ASSERT(kid->type == GRPC_JSON_STRING);
+  GPR_ASSERT(strcmp(kid->value, "e6b5137873db8d2ef81e06a47289e6434ec8a165") ==
+             0);
+}
+
+static void check_jwt_claim(grpc_json* claim, const char* expected_audience,
+                            const char* expected_scope) {
+  gpr_timespec expiration = gpr_time_0(GPR_CLOCK_REALTIME);
+  gpr_timespec issue_time = gpr_time_0(GPR_CLOCK_REALTIME);
+  gpr_timespec parsed_lifetime;
+  grpc_json* iss = NULL;
+  grpc_json* scope = NULL;
+  grpc_json* aud = NULL;
+  grpc_json* exp = NULL;
+  grpc_json* iat = NULL;
+  grpc_json* sub = NULL;
+  grpc_json* ptr;
+
+  for (ptr = claim->child; ptr; ptr = ptr->next) {
+    if (strcmp(ptr->key, "iss") == 0) {
+      iss = ptr;
+    } else if (strcmp(ptr->key, "sub") == 0) {
+      sub = ptr;
+    } else if (strcmp(ptr->key, "scope") == 0) {
+      scope = ptr;
+    } else if (strcmp(ptr->key, "aud") == 0) {
+      aud = ptr;
+    } else if (strcmp(ptr->key, "exp") == 0) {
+      exp = ptr;
+    } else if (strcmp(ptr->key, "iat") == 0) {
+      iat = ptr;
+    }
+  }
+
+  GPR_ASSERT(iss != NULL);
+  GPR_ASSERT(iss->type == GRPC_JSON_STRING);
+  GPR_ASSERT(
+      strcmp(
+          iss->value,
+          "777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount.com") ==
+      0);
+
+  if (expected_scope != NULL) {
+    GPR_ASSERT(scope != NULL);
+    GPR_ASSERT(sub == NULL);
+    GPR_ASSERT(scope->type == GRPC_JSON_STRING);
+    GPR_ASSERT(strcmp(scope->value, expected_scope) == 0);
+  } else {
+    /* Claims without scope must have a sub. */
+    GPR_ASSERT(scope == NULL);
+    GPR_ASSERT(sub != NULL);
+    GPR_ASSERT(sub->type == GRPC_JSON_STRING);
+    GPR_ASSERT(strcmp(iss->value, sub->value) == 0);
+  }
+
+  GPR_ASSERT(aud != NULL);
+  GPR_ASSERT(aud->type == GRPC_JSON_STRING);
+  GPR_ASSERT(strcmp(aud->value, expected_audience) == 0);
+
+  GPR_ASSERT(exp != NULL);
+  GPR_ASSERT(exp->type == GRPC_JSON_NUMBER);
+  expiration.tv_sec = strtol(exp->value, NULL, 10);
+
+  GPR_ASSERT(iat != NULL);
+  GPR_ASSERT(iat->type == GRPC_JSON_NUMBER);
+  issue_time.tv_sec = strtol(iat->value, NULL, 10);
+
+  parsed_lifetime = gpr_time_sub(expiration, issue_time);
+  GPR_ASSERT(parsed_lifetime.tv_sec == grpc_max_auth_token_lifetime().tv_sec);
+}
+
+static void check_jwt_signature(const char* b64_signature, RSA* rsa_key,
+                                const char* signed_data,
+                                size_t signed_data_size) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  EVP_MD_CTX* md_ctx = EVP_MD_CTX_create();
+  EVP_PKEY* key = EVP_PKEY_new();
+
+  grpc_slice sig = grpc_base64_decode(&exec_ctx, b64_signature, 1);
+  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(sig));
+  GPR_ASSERT(GRPC_SLICE_LENGTH(sig) == 128);
+
+  GPR_ASSERT(md_ctx != NULL);
+  GPR_ASSERT(key != NULL);
+  EVP_PKEY_set1_RSA(key, rsa_key);
+
+  GPR_ASSERT(EVP_DigestVerifyInit(md_ctx, NULL, EVP_sha256(), NULL, key) == 1);
+  GPR_ASSERT(EVP_DigestVerifyUpdate(md_ctx, signed_data, signed_data_size) ==
+             1);
+  GPR_ASSERT(EVP_DigestVerifyFinal(md_ctx, GRPC_SLICE_START_PTR(sig),
+                                   GRPC_SLICE_LENGTH(sig)) == 1);
+
+  grpc_slice_unref_internal(&exec_ctx, sig);
+  if (key != NULL) EVP_PKEY_free(key);
+  if (md_ctx != NULL) EVP_MD_CTX_destroy(md_ctx);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static char* service_account_creds_jwt_encode_and_sign(
+    const grpc_auth_json_key* key) {
+  return grpc_jwt_encode_and_sign(key, GRPC_JWT_OAUTH2_AUDIENCE,
+                                  grpc_max_auth_token_lifetime(), test_scope);
+}
+
+static char* jwt_creds_jwt_encode_and_sign(const grpc_auth_json_key* key) {
+  return grpc_jwt_encode_and_sign(key, test_service_url,
+                                  grpc_max_auth_token_lifetime(), NULL);
+}
+
+static void service_account_creds_check_jwt_claim(grpc_json* claim) {
+  check_jwt_claim(claim, GRPC_JWT_OAUTH2_AUDIENCE, test_scope);
+}
+
+static void jwt_creds_check_jwt_claim(grpc_json* claim) {
+  check_jwt_claim(claim, test_service_url, NULL);
+}
+
+static void test_jwt_encode_and_sign(
+    char* (*jwt_encode_and_sign_func)(const grpc_auth_json_key*),
+    void (*check_jwt_claim_func)(grpc_json*)) {
+  char* json_string = test_json_key_str(NULL);
+  grpc_json* parsed_header = NULL;
+  grpc_json* parsed_claim = NULL;
+  char* scratchpad;
+  grpc_auth_json_key json_key =
+      grpc_auth_json_key_create_from_string(json_string);
+  const char* b64_signature;
+  size_t offset = 0;
+  char* jwt = jwt_encode_and_sign_func(&json_key);
+  const char* dot = strchr(jwt, '.');
+  GPR_ASSERT(dot != NULL);
+  parsed_header =
+      parse_json_part_from_jwt(jwt, (size_t)(dot - jwt), &scratchpad);
+  GPR_ASSERT(parsed_header != NULL);
+  check_jwt_header(parsed_header);
+  offset = (size_t)(dot - jwt) + 1;
+  grpc_json_destroy(parsed_header);
+  gpr_free(scratchpad);
+
+  dot = strchr(jwt + offset, '.');
+  GPR_ASSERT(dot != NULL);
+  parsed_claim = parse_json_part_from_jwt(
+      jwt + offset, (size_t)(dot - (jwt + offset)), &scratchpad);
+  GPR_ASSERT(parsed_claim != NULL);
+  check_jwt_claim_func(parsed_claim);
+  offset = (size_t)(dot - jwt) + 1;
+  grpc_json_destroy(parsed_claim);
+  gpr_free(scratchpad);
+
+  dot = strchr(jwt + offset, '.');
+  GPR_ASSERT(dot == NULL); /* no more part. */
+  b64_signature = jwt + offset;
+  check_jwt_signature(b64_signature, json_key.private_key, jwt, offset - 1);
+
+  gpr_free(json_string);
+  grpc_auth_json_key_destruct(&json_key);
+  gpr_free(jwt);
+}
+
+static void test_service_account_creds_jwt_encode_and_sign(void) {
+  test_jwt_encode_and_sign(service_account_creds_jwt_encode_and_sign,
+                           service_account_creds_check_jwt_claim);
+}
+
+static void test_jwt_creds_jwt_encode_and_sign(void) {
+  test_jwt_encode_and_sign(jwt_creds_jwt_encode_and_sign,
+                           jwt_creds_check_jwt_claim);
+}
+
+static void test_parse_refresh_token_success(void) {
+  grpc_auth_refresh_token refresh_token =
+      grpc_auth_refresh_token_create_from_string(test_refresh_token_str);
+  GPR_ASSERT(grpc_auth_refresh_token_is_valid(&refresh_token));
+  GPR_ASSERT(refresh_token.type != NULL &&
+             (strcmp(refresh_token.type, "authorized_user") == 0));
+  GPR_ASSERT(refresh_token.client_id != NULL &&
+             (strcmp(refresh_token.client_id,
+                     "32555999999.apps.googleusercontent.com") == 0));
+  GPR_ASSERT(
+      refresh_token.client_secret != NULL &&
+      (strcmp(refresh_token.client_secret, "EmssLNjJy1332hD4KFsecret") == 0));
+  GPR_ASSERT(refresh_token.refresh_token != NULL &&
+             (strcmp(refresh_token.refresh_token,
+                     "1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42") == 0));
+  grpc_auth_refresh_token_destruct(&refresh_token);
+}
+
+static void test_parse_refresh_token_failure_no_type(void) {
+  const char refresh_token_str[] =
+      "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
+      "  \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
+      "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\"}";
+  grpc_auth_refresh_token refresh_token =
+      grpc_auth_refresh_token_create_from_string(refresh_token_str);
+  GPR_ASSERT(!grpc_auth_refresh_token_is_valid(&refresh_token));
+}
+
+static void test_parse_refresh_token_failure_no_client_id(void) {
+  const char refresh_token_str[] =
+      "{ \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
+      "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\","
+      "  \"type\": \"authorized_user\"}";
+  grpc_auth_refresh_token refresh_token =
+      grpc_auth_refresh_token_create_from_string(refresh_token_str);
+  GPR_ASSERT(!grpc_auth_refresh_token_is_valid(&refresh_token));
+}
+
+static void test_parse_refresh_token_failure_no_client_secret(void) {
+  const char refresh_token_str[] =
+      "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
+      "  \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\","
+      "  \"type\": \"authorized_user\"}";
+  grpc_auth_refresh_token refresh_token =
+      grpc_auth_refresh_token_create_from_string(refresh_token_str);
+  GPR_ASSERT(!grpc_auth_refresh_token_is_valid(&refresh_token));
+}
+
+static void test_parse_refresh_token_failure_no_refresh_token(void) {
+  const char refresh_token_str[] =
+      "{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
+      "  \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
+      "  \"type\": \"authorized_user\"}";
+  grpc_auth_refresh_token refresh_token =
+      grpc_auth_refresh_token_create_from_string(refresh_token_str);
+  GPR_ASSERT(!grpc_auth_refresh_token_is_valid(&refresh_token));
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_parse_json_key_success();
+  test_parse_json_key_failure_bad_json();
+  test_parse_json_key_failure_no_type();
+  test_parse_json_key_failure_no_client_id();
+  test_parse_json_key_failure_no_client_email();
+  test_parse_json_key_failure_no_private_key_id();
+  test_parse_json_key_failure_no_private_key();
+  test_service_account_creds_jwt_encode_and_sign();
+  test_jwt_creds_jwt_encode_and_sign();
+  test_parse_refresh_token_success();
+  test_parse_refresh_token_failure_no_type();
+  test_parse_refresh_token_failure_no_client_id();
+  test_parse_refresh_token_failure_no_client_secret();
+  test_parse_refresh_token_failure_no_refresh_token();
+  return 0;
+}
diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c
deleted file mode 100644
index a4bfe01..0000000
--- a/test/core/security/jwt_verifier_test.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/security/credentials/jwt/jwt_verifier.h"
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/http/httpcli.h"
-#include "src/core/lib/security/credentials/jwt/json_token.h"
-#include "src/core/lib/slice/b64.h"
-#include "test/core/util/test_config.h"
-
-/* This JSON key was generated with the GCE console and revoked immediately.
-   The identifiers have been changed as well.
-   Maximum size for a string literal is 509 chars in C89, yay!  */
-static const char json_key_str_part1[] =
-    "{ \"private_key\": \"-----BEGIN PRIVATE KEY-----"
-    "\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE"
-    "qg"
-    "WGjiw71NfXByguekSKho65FxaGbsnSM9SMQAqVk7Q2rG+I0OpsT0LrWQtZ\\nyjSeg/"
-    "rWBQvS4hle4LfijkP3J5BG+"
-    "IXDMP8RfziNRQsenAXDNPkY4kJCvKux2xdD\\nOnVF6N7dL3nTYZg+"
-    "uQrNsMTz9UxVAgMBAAECgYEAzbLewe1xe9vy+2GoSsfib+28\\nDZgSE6Bu/"
-    "zuFoPrRc6qL9p2SsnV7txrunTyJkkOnPLND9ABAXybRTlcVKP/sGgza\\n/"
-    "8HpCqFYM9V8f34SBWfD4fRFT+n/"
-    "73cfRUtGXdXpseva2lh8RilIQfPhNZAncenU\\ngqXjDvpkypEusgXAykECQQD+";
-static const char json_key_str_part2[] =
-    "53XxNVnxBHsYb+AYEfklR96yVi8HywjVHP34+OQZ\\nCslxoHQM8s+"
-    "dBnjfScLu22JqkPv04xyxmt0QAKm9+vTdAkEA4ib7YvEAn2jXzcCI\\nEkoy2L/"
-    "XydR1GCHoacdfdAwiL2npOdnbvi4ZmdYRPY1LSTO058tQHKVXV7NLeCa3\\nAARh2QJBAMKeDA"
-    "G"
-    "W303SQv2cZTdbeaLKJbB5drz3eo3j7dDKjrTD9JupixFbzcGw\\n8FZi5c8idxiwC36kbAL6Hz"
-    "A"
-    "ZoX+ofI0CQE6KCzPJTtYNqyShgKAZdJ8hwOcvCZtf\\n6z8RJm0+"
-    "6YBd38lfh5j8mZd7aHFf6I17j5AQY7oPEc47TjJj/"
-    "5nZ68ECQQDvYuI3\\nLyK5fS8g0SYbmPOL9TlcHDOqwG0mrX9qpg5DC2fniXNSrrZ64GTDKdzZ"
-    "Y"
-    "Ap6LI9W\\nIqv4vr6y38N79TTC\\n-----END PRIVATE KEY-----\\n\", ";
-static const char json_key_str_part3_for_google_email_issuer[] =
-    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-    "\"client_email\": "
-    "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
-    "com\", \"client_id\": "
-    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-    "com\", \"type\": \"service_account\" }";
-/* Trick our JWT library into issuing a JWT with iss=accounts.google.com. */
-static const char json_key_str_part3_for_url_issuer[] =
-    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-    "\"client_email\": \"accounts.google.com\", "
-    "\"client_id\": "
-    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-    "com\", \"type\": \"service_account\" }";
-static const char json_key_str_part3_for_custom_email_issuer[] =
-    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
-    "\"client_email\": "
-    "\"foo@bar.com\", \"client_id\": "
-    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
-    "com\", \"type\": \"service_account\" }";
-
-static grpc_jwt_verifier_email_domain_key_url_mapping custom_mapping = {
-    "bar.com", "keys.bar.com/jwk"};
-
-static const char expected_user_data[] = "user data";
-
-static const char good_jwk_set[] =
-    "{"
-    " \"keys\": ["
-    "  {"
-    "   \"kty\": \"RSA\","
-    "   \"alg\": \"RS256\","
-    "   \"use\": \"sig\","
-    "   \"kid\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\","
-    "   \"n\": "
-    "\"4S8myegefIeRdynuYkSqBYaOLDvU19cHKC56RIqGjrkXFoZuydIz1IxACpWTtDasb4jQ6mxP"
-    "QutZC1nKNJ6D-tYFC9LiGV7gt-KOQ_cnkEb4hcMw_xF_OI1FCx6cBcM0-"
-    "RjiQkK8q7HbF0M6dUXo3t0vedNhmD65Cs2wxPP1TFU=\","
-    "   \"e\": \"AQAB\""
-    "  }"
-    " ]"
-    "}";
-
-static gpr_timespec expected_lifetime = {3600, 0, GPR_TIMESPAN};
-
-static const char good_google_email_keys_part1[] =
-    "{\"e6b5137873db8d2ef81e06a47289e6434ec8a165\": \"-----BEGIN "
-    "CERTIFICATE-----"
-    "\\nMIICATCCAWoCCQDEywLhxvHjnDANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB\\nVTET"
-    "MBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0\\ncyBQdHkgTHR"
-    "kMB4XDTE1MDYyOTA4Mzk1MFoXDTI1MDYyNjA4Mzk1MFowRTELMAkG\\nA1UEBhMCQVUxEzARBg"
-    "NVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0\\nIFdpZGdpdHMgUHR5IEx0ZDCBn"
-    "zANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA4S8m\\nyegefIeRdynuYkSqBYaOLDvU19cHKC56"
-    "RIqGjrkXFoZuydIz1IxACpWTtDasb4jQ\\n6mxPQutZC1nKNJ6D+tYFC9LiGV7gt+KOQ/";
-
-static const char good_google_email_keys_part2[] =
-    "cnkEb4hcMw/xF/OI1FCx6cBcM0+"
-    "Rji\\nQkK8q7HbF0M6dUXo3t0vedNhmD65Cs2wxPP1TFUCAwEAATANBgkqhkiG9w0BAQsF\\nA"
-    "AOBgQBfu69FkPmBknbKNFgurPz78kbs3VNN+k/"
-    "PUgO5DHKskJmgK2TbtvX2VMpx\\nkftmHGzgzMzUlOtigCaGMgHWjfqjpP9uuDbahXrZBJzB8c"
-    "Oq7MrQF8r17qVvo3Ue\\nPjTKQMAsU8uxTEMmeuz9L6yExs0rfd6bPOrQkAoVfFfiYB3/"
-    "pA==\\n-----END CERTIFICATE-----\\n\"}";
-
-static const char expected_audience[] = "https://foo.com";
-
-static const char good_openid_config[] =
-    "{"
-    " \"issuer\": \"https://accounts.google.com\","
-    " \"authorization_endpoint\": "
-    "\"https://accounts.google.com/o/oauth2/v2/auth\","
-    " \"token_endpoint\": \"https://www.googleapis.com/oauth2/v4/token\","
-    " \"userinfo_endpoint\": \"https://www.googleapis.com/oauth2/v3/userinfo\","
-    " \"revocation_endpoint\": \"https://accounts.google.com/o/oauth2/revoke\","
-    " \"jwks_uri\": \"https://www.googleapis.com/oauth2/v3/certs\""
-    "}";
-
-static const char expired_claims[] =
-    "{ \"aud\": \"https://foo.com\","
-    "  \"iss\": \"blah.foo.com\","
-    "  \"sub\": \"juju@blah.foo.com\","
-    "  \"jti\": \"jwtuniqueid\","
-    "  \"iat\": 100," /* Way back in the past... */
-    "  \"exp\": 120,"
-    "  \"nbf\": 60,"
-    "  \"foo\": \"bar\"}";
-
-static const char claims_without_time_constraint[] =
-    "{ \"aud\": \"https://foo.com\","
-    "  \"iss\": \"blah.foo.com\","
-    "  \"sub\": \"juju@blah.foo.com\","
-    "  \"jti\": \"jwtuniqueid\","
-    "  \"foo\": \"bar\"}";
-
-static const char claims_with_bad_subject[] =
-    "{ \"aud\": \"https://foo.com\","
-    "  \"iss\": \"evil@blah.foo.com\","
-    "  \"sub\": \"juju@blah.foo.com\","
-    "  \"jti\": \"jwtuniqueid\","
-    "  \"foo\": \"bar\"}";
-
-static const char invalid_claims[] =
-    "{ \"aud\": \"https://foo.com\","
-    "  \"iss\": 46," /* Issuer cannot be a number. */
-    "  \"sub\": \"juju@blah.foo.com\","
-    "  \"jti\": \"jwtuniqueid\","
-    "  \"foo\": \"bar\"}";
-
-typedef struct {
-  grpc_jwt_verifier_status expected_status;
-  const char *expected_issuer;
-  const char *expected_subject;
-} verifier_test_config;
-
-static void test_jwt_issuer_email_domain(void) {
-  const char *d = grpc_jwt_issuer_email_domain("https://foo.com");
-  GPR_ASSERT(d == NULL);
-  d = grpc_jwt_issuer_email_domain("foo.com");
-  GPR_ASSERT(d == NULL);
-  d = grpc_jwt_issuer_email_domain("");
-  GPR_ASSERT(d == NULL);
-  d = grpc_jwt_issuer_email_domain("@");
-  GPR_ASSERT(d == NULL);
-  d = grpc_jwt_issuer_email_domain("bar@foo");
-  GPR_ASSERT(strcmp(d, "foo") == 0);
-  d = grpc_jwt_issuer_email_domain("bar@foo.com");
-  GPR_ASSERT(strcmp(d, "foo.com") == 0);
-  d = grpc_jwt_issuer_email_domain("bar@blah.foo.com");
-  GPR_ASSERT(strcmp(d, "foo.com") == 0);
-  d = grpc_jwt_issuer_email_domain("bar.blah@blah.foo.com");
-  GPR_ASSERT(strcmp(d, "foo.com") == 0);
-  d = grpc_jwt_issuer_email_domain("bar.blah@baz.blah.foo.com");
-  GPR_ASSERT(strcmp(d, "foo.com") == 0);
-
-  /* This is not a very good parser but make sure we do not crash on these weird
-     inputs. */
-  d = grpc_jwt_issuer_email_domain("@foo");
-  GPR_ASSERT(strcmp(d, "foo") == 0);
-  d = grpc_jwt_issuer_email_domain("bar@.");
-  GPR_ASSERT(d != NULL);
-  d = grpc_jwt_issuer_email_domain("bar@..");
-  GPR_ASSERT(d != NULL);
-  d = grpc_jwt_issuer_email_domain("bar@...");
-  GPR_ASSERT(d != NULL);
-}
-
-static void test_claims_success(void) {
-  grpc_jwt_claims *claims;
-  grpc_slice s = grpc_slice_from_copied_string(claims_without_time_constraint);
-  grpc_json *json = grpc_json_parse_string_with_len(
-      (char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
-  GPR_ASSERT(json != NULL);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  claims = grpc_jwt_claims_from_json(&exec_ctx, json, s);
-  GPR_ASSERT(claims != NULL);
-  GPR_ASSERT(grpc_jwt_claims_json(claims) == json);
-  GPR_ASSERT(strcmp(grpc_jwt_claims_audience(claims), "https://foo.com") == 0);
-  GPR_ASSERT(strcmp(grpc_jwt_claims_issuer(claims), "blah.foo.com") == 0);
-  GPR_ASSERT(strcmp(grpc_jwt_claims_subject(claims), "juju@blah.foo.com") == 0);
-  GPR_ASSERT(strcmp(grpc_jwt_claims_id(claims), "jwtuniqueid") == 0);
-  GPR_ASSERT(grpc_jwt_claims_check(claims, "https://foo.com") ==
-             GRPC_JWT_VERIFIER_OK);
-  grpc_jwt_claims_destroy(&exec_ctx, claims);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_expired_claims_failure(void) {
-  grpc_jwt_claims *claims;
-  grpc_slice s = grpc_slice_from_copied_string(expired_claims);
-  grpc_json *json = grpc_json_parse_string_with_len(
-      (char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
-  gpr_timespec exp_iat = {100, 0, GPR_CLOCK_REALTIME};
-  gpr_timespec exp_exp = {120, 0, GPR_CLOCK_REALTIME};
-  gpr_timespec exp_nbf = {60, 0, GPR_CLOCK_REALTIME};
-  GPR_ASSERT(json != NULL);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  claims = grpc_jwt_claims_from_json(&exec_ctx, json, s);
-  GPR_ASSERT(claims != NULL);
-  GPR_ASSERT(grpc_jwt_claims_json(claims) == json);
-  GPR_ASSERT(strcmp(grpc_jwt_claims_audience(claims), "https://foo.com") == 0);
-  GPR_ASSERT(strcmp(grpc_jwt_claims_issuer(claims), "blah.foo.com") == 0);
-  GPR_ASSERT(strcmp(grpc_jwt_claims_subject(claims), "juju@blah.foo.com") == 0);
-  GPR_ASSERT(strcmp(grpc_jwt_claims_id(claims), "jwtuniqueid") == 0);
-  GPR_ASSERT(gpr_time_cmp(grpc_jwt_claims_issued_at(claims), exp_iat) == 0);
-  GPR_ASSERT(gpr_time_cmp(grpc_jwt_claims_expires_at(claims), exp_exp) == 0);
-  GPR_ASSERT(gpr_time_cmp(grpc_jwt_claims_not_before(claims), exp_nbf) == 0);
-
-  GPR_ASSERT(grpc_jwt_claims_check(claims, "https://foo.com") ==
-             GRPC_JWT_VERIFIER_TIME_CONSTRAINT_FAILURE);
-  grpc_jwt_claims_destroy(&exec_ctx, claims);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_invalid_claims_failure(void) {
-  grpc_slice s = grpc_slice_from_copied_string(invalid_claims);
-  grpc_json *json = grpc_json_parse_string_with_len(
-      (char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GPR_ASSERT(grpc_jwt_claims_from_json(&exec_ctx, json, s) == NULL);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_bad_audience_claims_failure(void) {
-  grpc_jwt_claims *claims;
-  grpc_slice s = grpc_slice_from_copied_string(claims_without_time_constraint);
-  grpc_json *json = grpc_json_parse_string_with_len(
-      (char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
-  GPR_ASSERT(json != NULL);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  claims = grpc_jwt_claims_from_json(&exec_ctx, json, s);
-  GPR_ASSERT(claims != NULL);
-  GPR_ASSERT(grpc_jwt_claims_check(claims, "https://bar.com") ==
-             GRPC_JWT_VERIFIER_BAD_AUDIENCE);
-  grpc_jwt_claims_destroy(&exec_ctx, claims);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_bad_subject_claims_failure(void) {
-  grpc_jwt_claims *claims;
-  grpc_slice s = grpc_slice_from_copied_string(claims_with_bad_subject);
-  grpc_json *json = grpc_json_parse_string_with_len(
-      (char *)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
-  GPR_ASSERT(json != NULL);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  claims = grpc_jwt_claims_from_json(&exec_ctx, json, s);
-  GPR_ASSERT(claims != NULL);
-  GPR_ASSERT(grpc_jwt_claims_check(claims, "https://foo.com") ==
-             GRPC_JWT_VERIFIER_BAD_SUBJECT);
-  grpc_jwt_claims_destroy(&exec_ctx, claims);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static char *json_key_str(const char *last_part) {
-  size_t result_len = strlen(json_key_str_part1) + strlen(json_key_str_part2) +
-                      strlen(last_part);
-  char *result = gpr_malloc(result_len + 1);
-  char *current = result;
-  strcpy(result, json_key_str_part1);
-  current += strlen(json_key_str_part1);
-  strcpy(current, json_key_str_part2);
-  current += strlen(json_key_str_part2);
-  strcpy(current, last_part);
-  return result;
-}
-
-static char *good_google_email_keys(void) {
-  size_t result_len = strlen(good_google_email_keys_part1) +
-                      strlen(good_google_email_keys_part2);
-  char *result = gpr_malloc(result_len + 1);
-  char *current = result;
-  strcpy(result, good_google_email_keys_part1);
-  current += strlen(good_google_email_keys_part1);
-  strcpy(current, good_google_email_keys_part2);
-  return result;
-}
-
-static grpc_httpcli_response http_response(int status, char *body) {
-  grpc_httpcli_response response;
-  memset(&response, 0, sizeof(grpc_httpcli_response));
-  response.status = status;
-  response.body = body;
-  response.body_length = strlen(body);
-  return response;
-}
-
-static int httpcli_post_should_not_be_called(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    const char *body_bytes, size_t body_size, grpc_millis deadline,
-    grpc_closure *on_done, grpc_httpcli_response *response) {
-  GPR_ASSERT("HTTP POST should not be called" == NULL);
-  return 1;
-}
-
-static int httpcli_get_google_keys_for_email(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    grpc_millis deadline, grpc_closure *on_done,
-    grpc_httpcli_response *response) {
-  *response = http_response(200, good_google_email_keys());
-  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
-  GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
-  GPR_ASSERT(strcmp(request->http.path,
-                    "/robot/v1/metadata/x509/"
-                    "777-abaslkan11hlb6nmim3bpspl31ud@developer."
-                    "gserviceaccount.com") == 0);
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static void on_verification_success(grpc_exec_ctx *exec_ctx, void *user_data,
-                                    grpc_jwt_verifier_status status,
-                                    grpc_jwt_claims *claims) {
-  GPR_ASSERT(status == GRPC_JWT_VERIFIER_OK);
-  GPR_ASSERT(claims != NULL);
-  GPR_ASSERT(user_data == (void *)expected_user_data);
-  GPR_ASSERT(strcmp(grpc_jwt_claims_audience(claims), expected_audience) == 0);
-  grpc_jwt_claims_destroy(exec_ctx, claims);
-}
-
-static void test_jwt_verifier_google_email_issuer_success(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_jwt_verifier *verifier = grpc_jwt_verifier_create(NULL, 0);
-  char *jwt = NULL;
-  char *key_str = json_key_str(json_key_str_part3_for_google_email_issuer);
-  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
-  gpr_free(key_str);
-  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
-  grpc_httpcli_set_override(httpcli_get_google_keys_for_email,
-                            httpcli_post_should_not_be_called);
-  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
-                                 NULL);
-  grpc_auth_json_key_destruct(&key);
-  GPR_ASSERT(jwt != NULL);
-  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
-                           on_verification_success, (void *)expected_user_data);
-  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(jwt);
-  grpc_httpcli_set_override(NULL, NULL);
-}
-
-static int httpcli_get_custom_keys_for_email(
-    grpc_exec_ctx *exec_ctx, const grpc_httpcli_request *request,
-    grpc_millis deadline, grpc_closure *on_done,
-    grpc_httpcli_response *response) {
-  *response = http_response(200, gpr_strdup(good_jwk_set));
-  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
-  GPR_ASSERT(strcmp(request->host, "keys.bar.com") == 0);
-  GPR_ASSERT(strcmp(request->http.path, "/jwk/foo@bar.com") == 0);
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static void test_jwt_verifier_custom_email_issuer_success(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_jwt_verifier *verifier = grpc_jwt_verifier_create(&custom_mapping, 1);
-  char *jwt = NULL;
-  char *key_str = json_key_str(json_key_str_part3_for_custom_email_issuer);
-  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
-  gpr_free(key_str);
-  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
-  grpc_httpcli_set_override(httpcli_get_custom_keys_for_email,
-                            httpcli_post_should_not_be_called);
-  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
-                                 NULL);
-  grpc_auth_json_key_destruct(&key);
-  GPR_ASSERT(jwt != NULL);
-  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
-                           on_verification_success, (void *)expected_user_data);
-  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(jwt);
-  grpc_httpcli_set_override(NULL, NULL);
-}
-
-static int httpcli_get_jwk_set(grpc_exec_ctx *exec_ctx,
-                               const grpc_httpcli_request *request,
-                               grpc_millis deadline, grpc_closure *on_done,
-                               grpc_httpcli_response *response) {
-  *response = http_response(200, gpr_strdup(good_jwk_set));
-  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
-  GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
-  GPR_ASSERT(strcmp(request->http.path, "/oauth2/v3/certs") == 0);
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static int httpcli_get_openid_config(grpc_exec_ctx *exec_ctx,
-                                     const grpc_httpcli_request *request,
-                                     grpc_millis deadline,
-                                     grpc_closure *on_done,
-                                     grpc_httpcli_response *response) {
-  *response = http_response(200, gpr_strdup(good_openid_config));
-  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
-  GPR_ASSERT(strcmp(request->host, "accounts.google.com") == 0);
-  GPR_ASSERT(strcmp(request->http.path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0);
-  grpc_httpcli_set_override(httpcli_get_jwk_set,
-                            httpcli_post_should_not_be_called);
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static void test_jwt_verifier_url_issuer_success(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_jwt_verifier *verifier = grpc_jwt_verifier_create(NULL, 0);
-  char *jwt = NULL;
-  char *key_str = json_key_str(json_key_str_part3_for_url_issuer);
-  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
-  gpr_free(key_str);
-  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
-  grpc_httpcli_set_override(httpcli_get_openid_config,
-                            httpcli_post_should_not_be_called);
-  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
-                                 NULL);
-  grpc_auth_json_key_destruct(&key);
-  GPR_ASSERT(jwt != NULL);
-  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
-                           on_verification_success, (void *)expected_user_data);
-  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(jwt);
-  grpc_httpcli_set_override(NULL, NULL);
-}
-
-static void on_verification_key_retrieval_error(grpc_exec_ctx *exec_ctx,
-                                                void *user_data,
-                                                grpc_jwt_verifier_status status,
-                                                grpc_jwt_claims *claims) {
-  GPR_ASSERT(status == GRPC_JWT_VERIFIER_KEY_RETRIEVAL_ERROR);
-  GPR_ASSERT(claims == NULL);
-  GPR_ASSERT(user_data == (void *)expected_user_data);
-}
-
-static int httpcli_get_bad_json(grpc_exec_ctx *exec_ctx,
-                                const grpc_httpcli_request *request,
-                                grpc_millis deadline, grpc_closure *on_done,
-                                grpc_httpcli_response *response) {
-  *response = http_response(200, gpr_strdup("{\"bad\": \"stuff\"}"));
-  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
-  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
-  return 1;
-}
-
-static void test_jwt_verifier_url_issuer_bad_config(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_jwt_verifier *verifier = grpc_jwt_verifier_create(NULL, 0);
-  char *jwt = NULL;
-  char *key_str = json_key_str(json_key_str_part3_for_url_issuer);
-  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
-  gpr_free(key_str);
-  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
-  grpc_httpcli_set_override(httpcli_get_bad_json,
-                            httpcli_post_should_not_be_called);
-  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
-                                 NULL);
-  grpc_auth_json_key_destruct(&key);
-  GPR_ASSERT(jwt != NULL);
-  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
-                           on_verification_key_retrieval_error,
-                           (void *)expected_user_data);
-  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(jwt);
-  grpc_httpcli_set_override(NULL, NULL);
-}
-
-static void test_jwt_verifier_bad_json_key(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_jwt_verifier *verifier = grpc_jwt_verifier_create(NULL, 0);
-  char *jwt = NULL;
-  char *key_str = json_key_str(json_key_str_part3_for_google_email_issuer);
-  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
-  gpr_free(key_str);
-  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
-  grpc_httpcli_set_override(httpcli_get_bad_json,
-                            httpcli_post_should_not_be_called);
-  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
-                                 NULL);
-  grpc_auth_json_key_destruct(&key);
-  GPR_ASSERT(jwt != NULL);
-  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
-                           on_verification_key_retrieval_error,
-                           (void *)expected_user_data);
-  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(jwt);
-  grpc_httpcli_set_override(NULL, NULL);
-}
-
-static void corrupt_jwt_sig(char *jwt) {
-  grpc_slice sig;
-  char *bad_b64_sig;
-  uint8_t *sig_bytes;
-  char *last_dot = strrchr(jwt, '.');
-  GPR_ASSERT(last_dot != NULL);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    sig = grpc_base64_decode(&exec_ctx, last_dot + 1, 1);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(sig));
-  sig_bytes = GRPC_SLICE_START_PTR(sig);
-  (*sig_bytes)++; /* Corrupt first byte. */
-  bad_b64_sig = grpc_base64_encode(GRPC_SLICE_START_PTR(sig),
-                                   GRPC_SLICE_LENGTH(sig), 1, 0);
-  memcpy(last_dot + 1, bad_b64_sig, strlen(bad_b64_sig));
-  gpr_free(bad_b64_sig);
-  grpc_slice_unref(sig);
-}
-
-static void on_verification_bad_signature(grpc_exec_ctx *exec_ctx,
-                                          void *user_data,
-                                          grpc_jwt_verifier_status status,
-                                          grpc_jwt_claims *claims) {
-  GPR_ASSERT(status == GRPC_JWT_VERIFIER_BAD_SIGNATURE);
-  GPR_ASSERT(claims == NULL);
-  GPR_ASSERT(user_data == (void *)expected_user_data);
-}
-
-static void test_jwt_verifier_bad_signature(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_jwt_verifier *verifier = grpc_jwt_verifier_create(NULL, 0);
-  char *jwt = NULL;
-  char *key_str = json_key_str(json_key_str_part3_for_url_issuer);
-  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
-  gpr_free(key_str);
-  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
-  grpc_httpcli_set_override(httpcli_get_openid_config,
-                            httpcli_post_should_not_be_called);
-  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
-                                 NULL);
-  grpc_auth_json_key_destruct(&key);
-  corrupt_jwt_sig(jwt);
-  GPR_ASSERT(jwt != NULL);
-  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
-                           on_verification_bad_signature,
-                           (void *)expected_user_data);
-  gpr_free(jwt);
-  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_httpcli_set_override(NULL, NULL);
-}
-
-static int httpcli_get_should_not_be_called(grpc_exec_ctx *exec_ctx,
-                                            const grpc_httpcli_request *request,
-                                            grpc_millis deadline,
-                                            grpc_closure *on_done,
-                                            grpc_httpcli_response *response) {
-  GPR_ASSERT(0);
-  return 1;
-}
-
-static void on_verification_bad_format(grpc_exec_ctx *exec_ctx, void *user_data,
-                                       grpc_jwt_verifier_status status,
-                                       grpc_jwt_claims *claims) {
-  GPR_ASSERT(status == GRPC_JWT_VERIFIER_BAD_FORMAT);
-  GPR_ASSERT(claims == NULL);
-  GPR_ASSERT(user_data == (void *)expected_user_data);
-}
-
-static void test_jwt_verifier_bad_format(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_jwt_verifier *verifier = grpc_jwt_verifier_create(NULL, 0);
-  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
-                            httpcli_post_should_not_be_called);
-  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, "bad jwt",
-                           expected_audience, on_verification_bad_format,
-                           (void *)expected_user_data);
-  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_httpcli_set_override(NULL, NULL);
-}
-
-/* find verification key: bad jks, cannot find key in jks */
-/* bad signature custom provided email*/
-/* bad key */
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_jwt_issuer_email_domain();
-  test_claims_success();
-  test_expired_claims_failure();
-  test_invalid_claims_failure();
-  test_bad_audience_claims_failure();
-  test_bad_subject_claims_failure();
-  test_jwt_verifier_google_email_issuer_success();
-  test_jwt_verifier_custom_email_issuer_success();
-  test_jwt_verifier_url_issuer_success();
-  test_jwt_verifier_url_issuer_bad_config();
-  test_jwt_verifier_bad_json_key();
-  test_jwt_verifier_bad_signature();
-  test_jwt_verifier_bad_format();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/security/jwt_verifier_test.cc b/test/core/security/jwt_verifier_test.cc
new file mode 100644
index 0000000..6858b36
--- /dev/null
+++ b/test/core/security/jwt_verifier_test.cc
@@ -0,0 +1,634 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/security/credentials/jwt/jwt_verifier.h"
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/http/httpcli.h"
+#include "src/core/lib/security/credentials/jwt/json_token.h"
+#include "src/core/lib/slice/b64.h"
+#include "test/core/util/test_config.h"
+
+/* This JSON key was generated with the GCE console and revoked immediately.
+   The identifiers have been changed as well.
+   Maximum size for a string literal is 509 chars in C89, yay!  */
+static const char json_key_str_part1[] =
+    "{ \"private_key\": \"-----BEGIN PRIVATE KEY-----"
+    "\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE"
+    "qg"
+    "WGjiw71NfXByguekSKho65FxaGbsnSM9SMQAqVk7Q2rG+I0OpsT0LrWQtZ\\nyjSeg/"
+    "rWBQvS4hle4LfijkP3J5BG+"
+    "IXDMP8RfziNRQsenAXDNPkY4kJCvKux2xdD\\nOnVF6N7dL3nTYZg+"
+    "uQrNsMTz9UxVAgMBAAECgYEAzbLewe1xe9vy+2GoSsfib+28\\nDZgSE6Bu/"
+    "zuFoPrRc6qL9p2SsnV7txrunTyJkkOnPLND9ABAXybRTlcVKP/sGgza\\n/"
+    "8HpCqFYM9V8f34SBWfD4fRFT+n/"
+    "73cfRUtGXdXpseva2lh8RilIQfPhNZAncenU\\ngqXjDvpkypEusgXAykECQQD+";
+static const char json_key_str_part2[] =
+    "53XxNVnxBHsYb+AYEfklR96yVi8HywjVHP34+OQZ\\nCslxoHQM8s+"
+    "dBnjfScLu22JqkPv04xyxmt0QAKm9+vTdAkEA4ib7YvEAn2jXzcCI\\nEkoy2L/"
+    "XydR1GCHoacdfdAwiL2npOdnbvi4ZmdYRPY1LSTO058tQHKVXV7NLeCa3\\nAARh2QJBAMKeDA"
+    "G"
+    "W303SQv2cZTdbeaLKJbB5drz3eo3j7dDKjrTD9JupixFbzcGw\\n8FZi5c8idxiwC36kbAL6Hz"
+    "A"
+    "ZoX+ofI0CQE6KCzPJTtYNqyShgKAZdJ8hwOcvCZtf\\n6z8RJm0+"
+    "6YBd38lfh5j8mZd7aHFf6I17j5AQY7oPEc47TjJj/"
+    "5nZ68ECQQDvYuI3\\nLyK5fS8g0SYbmPOL9TlcHDOqwG0mrX9qpg5DC2fniXNSrrZ64GTDKdzZ"
+    "Y"
+    "Ap6LI9W\\nIqv4vr6y38N79TTC\\n-----END PRIVATE KEY-----\\n\", ";
+static const char json_key_str_part3_for_google_email_issuer[] =
+    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+    "\"client_email\": "
+    "\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
+    "com\", \"client_id\": "
+    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+    "com\", \"type\": \"service_account\" }";
+/* Trick our JWT library into issuing a JWT with iss=accounts.google.com. */
+static const char json_key_str_part3_for_url_issuer[] =
+    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+    "\"client_email\": \"accounts.google.com\", "
+    "\"client_id\": "
+    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+    "com\", \"type\": \"service_account\" }";
+static const char json_key_str_part3_for_custom_email_issuer[] =
+    "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
+    "\"client_email\": "
+    "\"foo@bar.com\", \"client_id\": "
+    "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent."
+    "com\", \"type\": \"service_account\" }";
+
+static grpc_jwt_verifier_email_domain_key_url_mapping custom_mapping = {
+    "bar.com", "keys.bar.com/jwk"};
+
+static const char expected_user_data[] = "user data";
+
+static const char good_jwk_set[] =
+    "{"
+    " \"keys\": ["
+    "  {"
+    "   \"kty\": \"RSA\","
+    "   \"alg\": \"RS256\","
+    "   \"use\": \"sig\","
+    "   \"kid\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\","
+    "   \"n\": "
+    "\"4S8myegefIeRdynuYkSqBYaOLDvU19cHKC56RIqGjrkXFoZuydIz1IxACpWTtDasb4jQ6mxP"
+    "QutZC1nKNJ6D-tYFC9LiGV7gt-KOQ_cnkEb4hcMw_xF_OI1FCx6cBcM0-"
+    "RjiQkK8q7HbF0M6dUXo3t0vedNhmD65Cs2wxPP1TFU=\","
+    "   \"e\": \"AQAB\""
+    "  }"
+    " ]"
+    "}";
+
+static gpr_timespec expected_lifetime = {3600, 0, GPR_TIMESPAN};
+
+static const char good_google_email_keys_part1[] =
+    "{\"e6b5137873db8d2ef81e06a47289e6434ec8a165\": \"-----BEGIN "
+    "CERTIFICATE-----"
+    "\\nMIICATCCAWoCCQDEywLhxvHjnDANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB\\nVTET"
+    "MBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0\\ncyBQdHkgTHR"
+    "kMB4XDTE1MDYyOTA4Mzk1MFoXDTI1MDYyNjA4Mzk1MFowRTELMAkG\\nA1UEBhMCQVUxEzARBg"
+    "NVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0\\nIFdpZGdpdHMgUHR5IEx0ZDCBn"
+    "zANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA4S8m\\nyegefIeRdynuYkSqBYaOLDvU19cHKC56"
+    "RIqGjrkXFoZuydIz1IxACpWTtDasb4jQ\\n6mxPQutZC1nKNJ6D+tYFC9LiGV7gt+KOQ/";
+
+static const char good_google_email_keys_part2[] =
+    "cnkEb4hcMw/xF/OI1FCx6cBcM0+"
+    "Rji\\nQkK8q7HbF0M6dUXo3t0vedNhmD65Cs2wxPP1TFUCAwEAATANBgkqhkiG9w0BAQsF\\nA"
+    "AOBgQBfu69FkPmBknbKNFgurPz78kbs3VNN+k/"
+    "PUgO5DHKskJmgK2TbtvX2VMpx\\nkftmHGzgzMzUlOtigCaGMgHWjfqjpP9uuDbahXrZBJzB8c"
+    "Oq7MrQF8r17qVvo3Ue\\nPjTKQMAsU8uxTEMmeuz9L6yExs0rfd6bPOrQkAoVfFfiYB3/"
+    "pA==\\n-----END CERTIFICATE-----\\n\"}";
+
+static const char expected_audience[] = "https://foo.com";
+
+static const char good_openid_config[] =
+    "{"
+    " \"issuer\": \"https://accounts.google.com\","
+    " \"authorization_endpoint\": "
+    "\"https://accounts.google.com/o/oauth2/v2/auth\","
+    " \"token_endpoint\": \"https://www.googleapis.com/oauth2/v4/token\","
+    " \"userinfo_endpoint\": \"https://www.googleapis.com/oauth2/v3/userinfo\","
+    " \"revocation_endpoint\": \"https://accounts.google.com/o/oauth2/revoke\","
+    " \"jwks_uri\": \"https://www.googleapis.com/oauth2/v3/certs\""
+    "}";
+
+static const char expired_claims[] =
+    "{ \"aud\": \"https://foo.com\","
+    "  \"iss\": \"blah.foo.com\","
+    "  \"sub\": \"juju@blah.foo.com\","
+    "  \"jti\": \"jwtuniqueid\","
+    "  \"iat\": 100," /* Way back in the past... */
+    "  \"exp\": 120,"
+    "  \"nbf\": 60,"
+    "  \"foo\": \"bar\"}";
+
+static const char claims_without_time_constraint[] =
+    "{ \"aud\": \"https://foo.com\","
+    "  \"iss\": \"blah.foo.com\","
+    "  \"sub\": \"juju@blah.foo.com\","
+    "  \"jti\": \"jwtuniqueid\","
+    "  \"foo\": \"bar\"}";
+
+static const char claims_with_bad_subject[] =
+    "{ \"aud\": \"https://foo.com\","
+    "  \"iss\": \"evil@blah.foo.com\","
+    "  \"sub\": \"juju@blah.foo.com\","
+    "  \"jti\": \"jwtuniqueid\","
+    "  \"foo\": \"bar\"}";
+
+static const char invalid_claims[] =
+    "{ \"aud\": \"https://foo.com\","
+    "  \"iss\": 46," /* Issuer cannot be a number. */
+    "  \"sub\": \"juju@blah.foo.com\","
+    "  \"jti\": \"jwtuniqueid\","
+    "  \"foo\": \"bar\"}";
+
+typedef struct {
+  grpc_jwt_verifier_status expected_status;
+  const char* expected_issuer;
+  const char* expected_subject;
+} verifier_test_config;
+
+static void test_jwt_issuer_email_domain(void) {
+  const char* d = grpc_jwt_issuer_email_domain("https://foo.com");
+  GPR_ASSERT(d == NULL);
+  d = grpc_jwt_issuer_email_domain("foo.com");
+  GPR_ASSERT(d == NULL);
+  d = grpc_jwt_issuer_email_domain("");
+  GPR_ASSERT(d == NULL);
+  d = grpc_jwt_issuer_email_domain("@");
+  GPR_ASSERT(d == NULL);
+  d = grpc_jwt_issuer_email_domain("bar@foo");
+  GPR_ASSERT(strcmp(d, "foo") == 0);
+  d = grpc_jwt_issuer_email_domain("bar@foo.com");
+  GPR_ASSERT(strcmp(d, "foo.com") == 0);
+  d = grpc_jwt_issuer_email_domain("bar@blah.foo.com");
+  GPR_ASSERT(strcmp(d, "foo.com") == 0);
+  d = grpc_jwt_issuer_email_domain("bar.blah@blah.foo.com");
+  GPR_ASSERT(strcmp(d, "foo.com") == 0);
+  d = grpc_jwt_issuer_email_domain("bar.blah@baz.blah.foo.com");
+  GPR_ASSERT(strcmp(d, "foo.com") == 0);
+
+  /* This is not a very good parser but make sure we do not crash on these weird
+     inputs. */
+  d = grpc_jwt_issuer_email_domain("@foo");
+  GPR_ASSERT(strcmp(d, "foo") == 0);
+  d = grpc_jwt_issuer_email_domain("bar@.");
+  GPR_ASSERT(d != NULL);
+  d = grpc_jwt_issuer_email_domain("bar@..");
+  GPR_ASSERT(d != NULL);
+  d = grpc_jwt_issuer_email_domain("bar@...");
+  GPR_ASSERT(d != NULL);
+}
+
+static void test_claims_success(void) {
+  grpc_jwt_claims* claims;
+  grpc_slice s = grpc_slice_from_copied_string(claims_without_time_constraint);
+  grpc_json* json = grpc_json_parse_string_with_len(
+      (char*)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
+  GPR_ASSERT(json != NULL);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  claims = grpc_jwt_claims_from_json(&exec_ctx, json, s);
+  GPR_ASSERT(claims != NULL);
+  GPR_ASSERT(grpc_jwt_claims_json(claims) == json);
+  GPR_ASSERT(strcmp(grpc_jwt_claims_audience(claims), "https://foo.com") == 0);
+  GPR_ASSERT(strcmp(grpc_jwt_claims_issuer(claims), "blah.foo.com") == 0);
+  GPR_ASSERT(strcmp(grpc_jwt_claims_subject(claims), "juju@blah.foo.com") == 0);
+  GPR_ASSERT(strcmp(grpc_jwt_claims_id(claims), "jwtuniqueid") == 0);
+  GPR_ASSERT(grpc_jwt_claims_check(claims, "https://foo.com") ==
+             GRPC_JWT_VERIFIER_OK);
+  grpc_jwt_claims_destroy(&exec_ctx, claims);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_expired_claims_failure(void) {
+  grpc_jwt_claims* claims;
+  grpc_slice s = grpc_slice_from_copied_string(expired_claims);
+  grpc_json* json = grpc_json_parse_string_with_len(
+      (char*)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
+  gpr_timespec exp_iat = {100, 0, GPR_CLOCK_REALTIME};
+  gpr_timespec exp_exp = {120, 0, GPR_CLOCK_REALTIME};
+  gpr_timespec exp_nbf = {60, 0, GPR_CLOCK_REALTIME};
+  GPR_ASSERT(json != NULL);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  claims = grpc_jwt_claims_from_json(&exec_ctx, json, s);
+  GPR_ASSERT(claims != NULL);
+  GPR_ASSERT(grpc_jwt_claims_json(claims) == json);
+  GPR_ASSERT(strcmp(grpc_jwt_claims_audience(claims), "https://foo.com") == 0);
+  GPR_ASSERT(strcmp(grpc_jwt_claims_issuer(claims), "blah.foo.com") == 0);
+  GPR_ASSERT(strcmp(grpc_jwt_claims_subject(claims), "juju@blah.foo.com") == 0);
+  GPR_ASSERT(strcmp(grpc_jwt_claims_id(claims), "jwtuniqueid") == 0);
+  GPR_ASSERT(gpr_time_cmp(grpc_jwt_claims_issued_at(claims), exp_iat) == 0);
+  GPR_ASSERT(gpr_time_cmp(grpc_jwt_claims_expires_at(claims), exp_exp) == 0);
+  GPR_ASSERT(gpr_time_cmp(grpc_jwt_claims_not_before(claims), exp_nbf) == 0);
+
+  GPR_ASSERT(grpc_jwt_claims_check(claims, "https://foo.com") ==
+             GRPC_JWT_VERIFIER_TIME_CONSTRAINT_FAILURE);
+  grpc_jwt_claims_destroy(&exec_ctx, claims);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_invalid_claims_failure(void) {
+  grpc_slice s = grpc_slice_from_copied_string(invalid_claims);
+  grpc_json* json = grpc_json_parse_string_with_len(
+      (char*)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GPR_ASSERT(grpc_jwt_claims_from_json(&exec_ctx, json, s) == NULL);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_bad_audience_claims_failure(void) {
+  grpc_jwt_claims* claims;
+  grpc_slice s = grpc_slice_from_copied_string(claims_without_time_constraint);
+  grpc_json* json = grpc_json_parse_string_with_len(
+      (char*)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
+  GPR_ASSERT(json != NULL);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  claims = grpc_jwt_claims_from_json(&exec_ctx, json, s);
+  GPR_ASSERT(claims != NULL);
+  GPR_ASSERT(grpc_jwt_claims_check(claims, "https://bar.com") ==
+             GRPC_JWT_VERIFIER_BAD_AUDIENCE);
+  grpc_jwt_claims_destroy(&exec_ctx, claims);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_bad_subject_claims_failure(void) {
+  grpc_jwt_claims* claims;
+  grpc_slice s = grpc_slice_from_copied_string(claims_with_bad_subject);
+  grpc_json* json = grpc_json_parse_string_with_len(
+      (char*)GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s));
+  GPR_ASSERT(json != NULL);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  claims = grpc_jwt_claims_from_json(&exec_ctx, json, s);
+  GPR_ASSERT(claims != NULL);
+  GPR_ASSERT(grpc_jwt_claims_check(claims, "https://foo.com") ==
+             GRPC_JWT_VERIFIER_BAD_SUBJECT);
+  grpc_jwt_claims_destroy(&exec_ctx, claims);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static char* json_key_str(const char* last_part) {
+  size_t result_len = strlen(json_key_str_part1) + strlen(json_key_str_part2) +
+                      strlen(last_part);
+  char* result = static_cast<char*>(gpr_malloc(result_len + 1));
+  char* current = result;
+  strcpy(result, json_key_str_part1);
+  current += strlen(json_key_str_part1);
+  strcpy(current, json_key_str_part2);
+  current += strlen(json_key_str_part2);
+  strcpy(current, last_part);
+  return result;
+}
+
+static char* good_google_email_keys(void) {
+  size_t result_len = strlen(good_google_email_keys_part1) +
+                      strlen(good_google_email_keys_part2);
+  char* result = static_cast<char*>(gpr_malloc(result_len + 1));
+  char* current = result;
+  strcpy(result, good_google_email_keys_part1);
+  current += strlen(good_google_email_keys_part1);
+  strcpy(current, good_google_email_keys_part2);
+  return result;
+}
+
+static grpc_httpcli_response http_response(int status, char* body) {
+  grpc_httpcli_response response;
+  memset(&response, 0, sizeof(grpc_httpcli_response));
+  response.status = status;
+  response.body = body;
+  response.body_length = strlen(body);
+  return response;
+}
+
+static int httpcli_post_should_not_be_called(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    const char* body_bytes, size_t body_size, grpc_millis deadline,
+    grpc_closure* on_done, grpc_httpcli_response* response) {
+  GPR_ASSERT("HTTP POST should not be called" == NULL);
+  return 1;
+}
+
+static int httpcli_get_google_keys_for_email(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    grpc_millis deadline, grpc_closure* on_done,
+    grpc_httpcli_response* response) {
+  *response = http_response(200, good_google_email_keys());
+  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
+  GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
+  GPR_ASSERT(strcmp(request->http.path,
+                    "/robot/v1/metadata/x509/"
+                    "777-abaslkan11hlb6nmim3bpspl31ud@developer."
+                    "gserviceaccount.com") == 0);
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static void on_verification_success(grpc_exec_ctx* exec_ctx, void* user_data,
+                                    grpc_jwt_verifier_status status,
+                                    grpc_jwt_claims* claims) {
+  GPR_ASSERT(status == GRPC_JWT_VERIFIER_OK);
+  GPR_ASSERT(claims != NULL);
+  GPR_ASSERT(user_data == (void*)expected_user_data);
+  GPR_ASSERT(strcmp(grpc_jwt_claims_audience(claims), expected_audience) == 0);
+  grpc_jwt_claims_destroy(exec_ctx, claims);
+}
+
+static void test_jwt_verifier_google_email_issuer_success(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_jwt_verifier* verifier = grpc_jwt_verifier_create(NULL, 0);
+  char* jwt = NULL;
+  char* key_str = json_key_str(json_key_str_part3_for_google_email_issuer);
+  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
+  gpr_free(key_str);
+  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
+  grpc_httpcli_set_override(httpcli_get_google_keys_for_email,
+                            httpcli_post_should_not_be_called);
+  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+                                 NULL);
+  grpc_auth_json_key_destruct(&key);
+  GPR_ASSERT(jwt != NULL);
+  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
+                           on_verification_success, (void*)expected_user_data);
+  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(jwt);
+  grpc_httpcli_set_override(NULL, NULL);
+}
+
+static int httpcli_get_custom_keys_for_email(
+    grpc_exec_ctx* exec_ctx, const grpc_httpcli_request* request,
+    grpc_millis deadline, grpc_closure* on_done,
+    grpc_httpcli_response* response) {
+  *response = http_response(200, gpr_strdup(good_jwk_set));
+  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
+  GPR_ASSERT(strcmp(request->host, "keys.bar.com") == 0);
+  GPR_ASSERT(strcmp(request->http.path, "/jwk/foo@bar.com") == 0);
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static void test_jwt_verifier_custom_email_issuer_success(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_jwt_verifier* verifier = grpc_jwt_verifier_create(&custom_mapping, 1);
+  char* jwt = NULL;
+  char* key_str = json_key_str(json_key_str_part3_for_custom_email_issuer);
+  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
+  gpr_free(key_str);
+  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
+  grpc_httpcli_set_override(httpcli_get_custom_keys_for_email,
+                            httpcli_post_should_not_be_called);
+  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+                                 NULL);
+  grpc_auth_json_key_destruct(&key);
+  GPR_ASSERT(jwt != NULL);
+  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
+                           on_verification_success, (void*)expected_user_data);
+  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(jwt);
+  grpc_httpcli_set_override(NULL, NULL);
+}
+
+static int httpcli_get_jwk_set(grpc_exec_ctx* exec_ctx,
+                               const grpc_httpcli_request* request,
+                               grpc_millis deadline, grpc_closure* on_done,
+                               grpc_httpcli_response* response) {
+  *response = http_response(200, gpr_strdup(good_jwk_set));
+  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
+  GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
+  GPR_ASSERT(strcmp(request->http.path, "/oauth2/v3/certs") == 0);
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static int httpcli_get_openid_config(grpc_exec_ctx* exec_ctx,
+                                     const grpc_httpcli_request* request,
+                                     grpc_millis deadline,
+                                     grpc_closure* on_done,
+                                     grpc_httpcli_response* response) {
+  *response = http_response(200, gpr_strdup(good_openid_config));
+  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
+  GPR_ASSERT(strcmp(request->host, "accounts.google.com") == 0);
+  GPR_ASSERT(strcmp(request->http.path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0);
+  grpc_httpcli_set_override(httpcli_get_jwk_set,
+                            httpcli_post_should_not_be_called);
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static void test_jwt_verifier_url_issuer_success(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_jwt_verifier* verifier = grpc_jwt_verifier_create(NULL, 0);
+  char* jwt = NULL;
+  char* key_str = json_key_str(json_key_str_part3_for_url_issuer);
+  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
+  gpr_free(key_str);
+  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
+  grpc_httpcli_set_override(httpcli_get_openid_config,
+                            httpcli_post_should_not_be_called);
+  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+                                 NULL);
+  grpc_auth_json_key_destruct(&key);
+  GPR_ASSERT(jwt != NULL);
+  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
+                           on_verification_success, (void*)expected_user_data);
+  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(jwt);
+  grpc_httpcli_set_override(NULL, NULL);
+}
+
+static void on_verification_key_retrieval_error(grpc_exec_ctx* exec_ctx,
+                                                void* user_data,
+                                                grpc_jwt_verifier_status status,
+                                                grpc_jwt_claims* claims) {
+  GPR_ASSERT(status == GRPC_JWT_VERIFIER_KEY_RETRIEVAL_ERROR);
+  GPR_ASSERT(claims == NULL);
+  GPR_ASSERT(user_data == (void*)expected_user_data);
+}
+
+static int httpcli_get_bad_json(grpc_exec_ctx* exec_ctx,
+                                const grpc_httpcli_request* request,
+                                grpc_millis deadline, grpc_closure* on_done,
+                                grpc_httpcli_response* response) {
+  *response = http_response(200, gpr_strdup("{\"bad\": \"stuff\"}"));
+  GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
+  GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_NONE);
+  return 1;
+}
+
+static void test_jwt_verifier_url_issuer_bad_config(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_jwt_verifier* verifier = grpc_jwt_verifier_create(NULL, 0);
+  char* jwt = NULL;
+  char* key_str = json_key_str(json_key_str_part3_for_url_issuer);
+  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
+  gpr_free(key_str);
+  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
+  grpc_httpcli_set_override(httpcli_get_bad_json,
+                            httpcli_post_should_not_be_called);
+  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+                                 NULL);
+  grpc_auth_json_key_destruct(&key);
+  GPR_ASSERT(jwt != NULL);
+  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
+                           on_verification_key_retrieval_error,
+                           (void*)expected_user_data);
+  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(jwt);
+  grpc_httpcli_set_override(NULL, NULL);
+}
+
+static void test_jwt_verifier_bad_json_key(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_jwt_verifier* verifier = grpc_jwt_verifier_create(NULL, 0);
+  char* jwt = NULL;
+  char* key_str = json_key_str(json_key_str_part3_for_google_email_issuer);
+  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
+  gpr_free(key_str);
+  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
+  grpc_httpcli_set_override(httpcli_get_bad_json,
+                            httpcli_post_should_not_be_called);
+  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+                                 NULL);
+  grpc_auth_json_key_destruct(&key);
+  GPR_ASSERT(jwt != NULL);
+  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
+                           on_verification_key_retrieval_error,
+                           (void*)expected_user_data);
+  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(jwt);
+  grpc_httpcli_set_override(NULL, NULL);
+}
+
+static void corrupt_jwt_sig(char* jwt) {
+  grpc_slice sig;
+  char* bad_b64_sig;
+  uint8_t* sig_bytes;
+  char* last_dot = strrchr(jwt, '.');
+  GPR_ASSERT(last_dot != NULL);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    sig = grpc_base64_decode(&exec_ctx, last_dot + 1, 1);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(sig));
+  sig_bytes = GRPC_SLICE_START_PTR(sig);
+  (*sig_bytes)++; /* Corrupt first byte. */
+  bad_b64_sig = grpc_base64_encode(GRPC_SLICE_START_PTR(sig),
+                                   GRPC_SLICE_LENGTH(sig), 1, 0);
+  memcpy(last_dot + 1, bad_b64_sig, strlen(bad_b64_sig));
+  gpr_free(bad_b64_sig);
+  grpc_slice_unref(sig);
+}
+
+static void on_verification_bad_signature(grpc_exec_ctx* exec_ctx,
+                                          void* user_data,
+                                          grpc_jwt_verifier_status status,
+                                          grpc_jwt_claims* claims) {
+  GPR_ASSERT(status == GRPC_JWT_VERIFIER_BAD_SIGNATURE);
+  GPR_ASSERT(claims == NULL);
+  GPR_ASSERT(user_data == (void*)expected_user_data);
+}
+
+static void test_jwt_verifier_bad_signature(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_jwt_verifier* verifier = grpc_jwt_verifier_create(NULL, 0);
+  char* jwt = NULL;
+  char* key_str = json_key_str(json_key_str_part3_for_url_issuer);
+  grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
+  gpr_free(key_str);
+  GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
+  grpc_httpcli_set_override(httpcli_get_openid_config,
+                            httpcli_post_should_not_be_called);
+  jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
+                                 NULL);
+  grpc_auth_json_key_destruct(&key);
+  corrupt_jwt_sig(jwt);
+  GPR_ASSERT(jwt != NULL);
+  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, jwt, expected_audience,
+                           on_verification_bad_signature,
+                           (void*)expected_user_data);
+  gpr_free(jwt);
+  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_httpcli_set_override(NULL, NULL);
+}
+
+static int httpcli_get_should_not_be_called(grpc_exec_ctx* exec_ctx,
+                                            const grpc_httpcli_request* request,
+                                            grpc_millis deadline,
+                                            grpc_closure* on_done,
+                                            grpc_httpcli_response* response) {
+  GPR_ASSERT(0);
+  return 1;
+}
+
+static void on_verification_bad_format(grpc_exec_ctx* exec_ctx, void* user_data,
+                                       grpc_jwt_verifier_status status,
+                                       grpc_jwt_claims* claims) {
+  GPR_ASSERT(status == GRPC_JWT_VERIFIER_BAD_FORMAT);
+  GPR_ASSERT(claims == NULL);
+  GPR_ASSERT(user_data == (void*)expected_user_data);
+}
+
+static void test_jwt_verifier_bad_format(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_jwt_verifier* verifier = grpc_jwt_verifier_create(NULL, 0);
+  grpc_httpcli_set_override(httpcli_get_should_not_be_called,
+                            httpcli_post_should_not_be_called);
+  grpc_jwt_verifier_verify(&exec_ctx, verifier, NULL, "bad jwt",
+                           expected_audience, on_verification_bad_format,
+                           (void*)expected_user_data);
+  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_httpcli_set_override(NULL, NULL);
+}
+
+/* find verification key: bad jks, cannot find key in jks */
+/* bad signature custom provided email*/
+/* bad key */
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_jwt_issuer_email_domain();
+  test_claims_success();
+  test_expired_claims_failure();
+  test_invalid_claims_failure();
+  test_bad_audience_claims_failure();
+  test_bad_subject_claims_failure();
+  test_jwt_verifier_google_email_issuer_success();
+  test_jwt_verifier_custom_email_issuer_success();
+  test_jwt_verifier_url_issuer_success();
+  test_jwt_verifier_url_issuer_bad_config();
+  test_jwt_verifier_bad_json_key();
+  test_jwt_verifier_bad_signature();
+  test_jwt_verifier_bad_format();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c
deleted file mode 100644
index 73d6c5b..0000000
--- a/test/core/security/oauth2_utils.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/security/oauth2_utils.h"
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#include "src/core/lib/security/credentials/credentials.h"
-
-typedef struct {
-  gpr_mu *mu;
-  grpc_polling_entity pops;
-  bool is_done;
-  char *token;
-
-  grpc_credentials_mdelem_array md_array;
-  grpc_closure closure;
-} oauth2_request;
-
-static void on_oauth2_response(grpc_exec_ctx *exec_ctx, void *arg,
-                               grpc_error *error) {
-  oauth2_request *request = (oauth2_request *)arg;
-  char *token = NULL;
-  grpc_slice token_slice;
-  if (error != GRPC_ERROR_NONE) {
-    gpr_log(GPR_ERROR, "Fetching token failed: %s", grpc_error_string(error));
-  } else {
-    GPR_ASSERT(request->md_array.size == 1);
-    token_slice = GRPC_MDVALUE(request->md_array.md[0]);
-    token = (char *)gpr_malloc(GRPC_SLICE_LENGTH(token_slice) + 1);
-    memcpy(token, GRPC_SLICE_START_PTR(token_slice),
-           GRPC_SLICE_LENGTH(token_slice));
-    token[GRPC_SLICE_LENGTH(token_slice)] = '\0';
-  }
-  grpc_credentials_mdelem_array_destroy(exec_ctx, &request->md_array);
-  gpr_mu_lock(request->mu);
-  request->is_done = true;
-  request->token = token;
-  GRPC_LOG_IF_ERROR(
-      "pollset_kick",
-      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&request->pops),
-                        NULL));
-  gpr_mu_unlock(request->mu);
-}
-
-static void do_nothing(grpc_exec_ctx *exec_ctx, void *unused,
-                       grpc_error *error) {}
-
-char *grpc_test_fetch_oauth2_token_with_credentials(
-    grpc_call_credentials *creds) {
-  oauth2_request request;
-  memset(&request, 0, sizeof(request));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_closure do_nothing_closure;
-  grpc_auth_metadata_context null_ctx = {"", "", NULL, NULL};
-
-  grpc_pollset *pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(pollset, &request.mu);
-  request.pops = grpc_polling_entity_create_from_pollset(pollset);
-  request.is_done = false;
-
-  GRPC_CLOSURE_INIT(&do_nothing_closure, do_nothing, NULL,
-                    grpc_schedule_on_exec_ctx);
-
-  GRPC_CLOSURE_INIT(&request.closure, on_oauth2_response, &request,
-                    grpc_schedule_on_exec_ctx);
-
-  grpc_error *error = GRPC_ERROR_NONE;
-  if (grpc_call_credentials_get_request_metadata(
-          &exec_ctx, creds, &request.pops, null_ctx, &request.md_array,
-          &request.closure, &error)) {
-    // Synchronous result; invoke callback directly.
-    on_oauth2_response(&exec_ctx, &request, error);
-    GRPC_ERROR_UNREF(error);
-  }
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  gpr_mu_lock(request.mu);
-  while (!request.is_done) {
-    grpc_pollset_worker *worker = NULL;
-    if (!GRPC_LOG_IF_ERROR(
-            "pollset_work",
-            grpc_pollset_work(&exec_ctx,
-                              grpc_polling_entity_pollset(&request.pops),
-                              &worker, GRPC_MILLIS_INF_FUTURE))) {
-      request.is_done = true;
-    }
-  }
-  gpr_mu_unlock(request.mu);
-
-  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&request.pops),
-                        &do_nothing_closure);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(grpc_polling_entity_pollset(&request.pops));
-  return request.token;
-}
diff --git a/test/core/security/oauth2_utils.cc b/test/core/security/oauth2_utils.cc
new file mode 100644
index 0000000..fda3d96
--- /dev/null
+++ b/test/core/security/oauth2_utils.cc
@@ -0,0 +1,118 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/security/oauth2_utils.h"
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/security/credentials/credentials.h"
+
+typedef struct {
+  gpr_mu* mu;
+  grpc_polling_entity pops;
+  bool is_done;
+  char* token;
+
+  grpc_credentials_mdelem_array md_array;
+  grpc_closure closure;
+} oauth2_request;
+
+static void on_oauth2_response(grpc_exec_ctx* exec_ctx, void* arg,
+                               grpc_error* error) {
+  oauth2_request* request = (oauth2_request*)arg;
+  char* token = NULL;
+  grpc_slice token_slice;
+  if (error != GRPC_ERROR_NONE) {
+    gpr_log(GPR_ERROR, "Fetching token failed: %s", grpc_error_string(error));
+  } else {
+    GPR_ASSERT(request->md_array.size == 1);
+    token_slice = GRPC_MDVALUE(request->md_array.md[0]);
+    token = (char*)gpr_malloc(GRPC_SLICE_LENGTH(token_slice) + 1);
+    memcpy(token, GRPC_SLICE_START_PTR(token_slice),
+           GRPC_SLICE_LENGTH(token_slice));
+    token[GRPC_SLICE_LENGTH(token_slice)] = '\0';
+  }
+  grpc_credentials_mdelem_array_destroy(exec_ctx, &request->md_array);
+  gpr_mu_lock(request->mu);
+  request->is_done = true;
+  request->token = token;
+  GRPC_LOG_IF_ERROR(
+      "pollset_kick",
+      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&request->pops),
+                        NULL));
+  gpr_mu_unlock(request->mu);
+}
+
+static void do_nothing(grpc_exec_ctx* exec_ctx, void* unused,
+                       grpc_error* error) {}
+
+char* grpc_test_fetch_oauth2_token_with_credentials(
+    grpc_call_credentials* creds) {
+  oauth2_request request;
+  memset(&request, 0, sizeof(request));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_closure do_nothing_closure;
+  grpc_auth_metadata_context null_ctx = {"", "", NULL, NULL};
+
+  grpc_pollset* pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+  grpc_pollset_init(pollset, &request.mu);
+  request.pops = grpc_polling_entity_create_from_pollset(pollset);
+  request.is_done = false;
+
+  GRPC_CLOSURE_INIT(&do_nothing_closure, do_nothing, NULL,
+                    grpc_schedule_on_exec_ctx);
+
+  GRPC_CLOSURE_INIT(&request.closure, on_oauth2_response, &request,
+                    grpc_schedule_on_exec_ctx);
+
+  grpc_error* error = GRPC_ERROR_NONE;
+  if (grpc_call_credentials_get_request_metadata(
+          &exec_ctx, creds, &request.pops, null_ctx, &request.md_array,
+          &request.closure, &error)) {
+    // Synchronous result; invoke callback directly.
+    on_oauth2_response(&exec_ctx, &request, error);
+    GRPC_ERROR_UNREF(error);
+  }
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  gpr_mu_lock(request.mu);
+  while (!request.is_done) {
+    grpc_pollset_worker* worker = NULL;
+    if (!GRPC_LOG_IF_ERROR(
+            "pollset_work",
+            grpc_pollset_work(&exec_ctx,
+                              grpc_polling_entity_pollset(&request.pops),
+                              &worker, GRPC_MILLIS_INF_FUTURE))) {
+      request.is_done = true;
+    }
+  }
+  gpr_mu_unlock(request.mu);
+
+  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&request.pops),
+                        &do_nothing_closure);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(grpc_polling_entity_pollset(&request.pops));
+  return request.token;
+}
diff --git a/test/core/security/oauth2_utils.h b/test/core/security/oauth2_utils.h
index 15f68bd..5ad2e39 100644
--- a/test/core/security/oauth2_utils.h
+++ b/test/core/security/oauth2_utils.h
@@ -21,17 +21,9 @@
 
 #include "src/core/lib/security/credentials/credentials.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Fetch oauth2 access token with a credentials object. Does not take ownership.
    Returns NULL on a failure. The caller should call gpr_free on the token. */
-char *grpc_test_fetch_oauth2_token_with_credentials(
-    grpc_call_credentials *creds);
-
-#ifdef __cplusplus
-}
-#endif
+char* grpc_test_fetch_oauth2_token_with_credentials(
+    grpc_call_credentials* creds);
 
 #endif /* GRPC_TEST_CORE_SECURITY_OAUTH2_UTILS_H */
diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c
deleted file mode 100644
index 29c38df..0000000
--- a/test/core/security/print_google_default_creds_token.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/cmdline.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#include "src/core/lib/security/credentials/composite/composite_credentials.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/support/string.h"
-
-typedef struct {
-  gpr_mu *mu;
-  grpc_polling_entity pops;
-  bool is_done;
-
-  grpc_credentials_mdelem_array md_array;
-  grpc_closure on_request_metadata;
-} synchronizer;
-
-static void on_metadata_response(grpc_exec_ctx *exec_ctx, void *arg,
-                                 grpc_error *error) {
-  synchronizer *sync = arg;
-  if (error != GRPC_ERROR_NONE) {
-    fprintf(stderr, "Fetching token failed: %s\n", grpc_error_string(error));
-  } else {
-    char *token;
-    GPR_ASSERT(sync->md_array.size == 1);
-    token = grpc_slice_to_c_string(GRPC_MDVALUE(sync->md_array.md[0]));
-    printf("\nGot token: %s\n\n", token);
-    gpr_free(token);
-  }
-  gpr_mu_lock(sync->mu);
-  sync->is_done = true;
-  GRPC_LOG_IF_ERROR(
-      "pollset_kick",
-      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&sync->pops),
-                        NULL));
-  gpr_mu_unlock(sync->mu);
-}
-
-int main(int argc, char **argv) {
-  int result = 0;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  synchronizer sync;
-  grpc_channel_credentials *creds = NULL;
-  char *service_url = "https://test.foo.google.com/Foo";
-  grpc_auth_metadata_context context;
-  gpr_cmdline *cl = gpr_cmdline_create("print_google_default_creds_token");
-  gpr_cmdline_add_string(cl, "service_url",
-                         "Service URL for the token request.", &service_url);
-  gpr_cmdline_parse(cl, argc, argv);
-  memset(&context, 0, sizeof(context));
-  context.service_url = service_url;
-
-  grpc_init();
-
-  creds = grpc_google_default_credentials_create();
-  if (creds == NULL) {
-    fprintf(stderr, "\nCould not find default credentials.\n\n");
-    result = 1;
-    goto end;
-  }
-
-  memset(&sync, 0, sizeof(sync));
-  grpc_pollset *pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(pollset, &sync.mu);
-  sync.pops = grpc_polling_entity_create_from_pollset(pollset);
-  sync.is_done = false;
-  GRPC_CLOSURE_INIT(&sync.on_request_metadata, on_metadata_response, &sync,
-                    grpc_schedule_on_exec_ctx);
-
-  grpc_error *error = GRPC_ERROR_NONE;
-  if (grpc_call_credentials_get_request_metadata(
-          &exec_ctx, ((grpc_composite_channel_credentials *)creds)->call_creds,
-          &sync.pops, context, &sync.md_array, &sync.on_request_metadata,
-          &error)) {
-    // Synchronous response.  Invoke callback directly.
-    on_metadata_response(&exec_ctx, &sync, error);
-    GRPC_ERROR_UNREF(error);
-  }
-
-  gpr_mu_lock(sync.mu);
-  while (!sync.is_done) {
-    grpc_pollset_worker *worker = NULL;
-    if (!GRPC_LOG_IF_ERROR(
-            "pollset_work",
-            grpc_pollset_work(&exec_ctx,
-                              grpc_polling_entity_pollset(&sync.pops), &worker,
-                              GRPC_MILLIS_INF_FUTURE)))
-      sync.is_done = true;
-    gpr_mu_unlock(sync.mu);
-    grpc_exec_ctx_flush(&exec_ctx);
-    gpr_mu_lock(sync.mu);
-  }
-  gpr_mu_unlock(sync.mu);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  grpc_channel_credentials_release(creds);
-  gpr_free(grpc_polling_entity_pollset(&sync.pops));
-
-end:
-  gpr_cmdline_destroy(cl);
-  grpc_shutdown();
-  return result;
-}
diff --git a/test/core/security/print_google_default_creds_token.cc b/test/core/security/print_google_default_creds_token.cc
new file mode 100644
index 0000000..a57180b
--- /dev/null
+++ b/test/core/security/print_google_default_creds_token.cc
@@ -0,0 +1,132 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/security/credentials/composite/composite_credentials.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/support/string.h"
+
+typedef struct {
+  gpr_mu* mu;
+  grpc_polling_entity pops;
+  bool is_done;
+
+  grpc_credentials_mdelem_array md_array;
+  grpc_closure on_request_metadata;
+} synchronizer;
+
+static void on_metadata_response(grpc_exec_ctx* exec_ctx, void* arg,
+                                 grpc_error* error) {
+  synchronizer* sync = static_cast<synchronizer*>(arg);
+  if (error != GRPC_ERROR_NONE) {
+    fprintf(stderr, "Fetching token failed: %s\n", grpc_error_string(error));
+  } else {
+    char* token;
+    GPR_ASSERT(sync->md_array.size == 1);
+    token = grpc_slice_to_c_string(GRPC_MDVALUE(sync->md_array.md[0]));
+    printf("\nGot token: %s\n\n", token);
+    gpr_free(token);
+  }
+  gpr_mu_lock(sync->mu);
+  sync->is_done = true;
+  GRPC_LOG_IF_ERROR(
+      "pollset_kick",
+      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&sync->pops),
+                        NULL));
+  gpr_mu_unlock(sync->mu);
+}
+
+int main(int argc, char** argv) {
+  int result = 0;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  synchronizer sync;
+  grpc_channel_credentials* creds = NULL;
+  const char* service_url = "https://test.foo.google.com/Foo";
+  grpc_auth_metadata_context context;
+  gpr_cmdline* cl = gpr_cmdline_create("print_google_default_creds_token");
+  grpc_pollset* pollset = nullptr;
+  grpc_error* error = nullptr;
+  gpr_cmdline_add_string(cl, "service_url",
+                         "Service URL for the token request.", &service_url);
+  gpr_cmdline_parse(cl, argc, argv);
+  memset(&context, 0, sizeof(context));
+  context.service_url = service_url;
+
+  grpc_init();
+
+  creds = grpc_google_default_credentials_create();
+  if (creds == NULL) {
+    fprintf(stderr, "\nCould not find default credentials.\n\n");
+    result = 1;
+    goto end;
+  }
+
+  memset(&sync, 0, sizeof(sync));
+  pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+  grpc_pollset_init(pollset, &sync.mu);
+  sync.pops = grpc_polling_entity_create_from_pollset(pollset);
+  sync.is_done = false;
+  GRPC_CLOSURE_INIT(&sync.on_request_metadata, on_metadata_response, &sync,
+                    grpc_schedule_on_exec_ctx);
+
+  error = GRPC_ERROR_NONE;
+  if (grpc_call_credentials_get_request_metadata(
+          &exec_ctx, ((grpc_composite_channel_credentials*)creds)->call_creds,
+          &sync.pops, context, &sync.md_array, &sync.on_request_metadata,
+          &error)) {
+    // Synchronous response.  Invoke callback directly.
+    on_metadata_response(&exec_ctx, &sync, error);
+    GRPC_ERROR_UNREF(error);
+  }
+
+  gpr_mu_lock(sync.mu);
+  while (!sync.is_done) {
+    grpc_pollset_worker* worker = NULL;
+    if (!GRPC_LOG_IF_ERROR(
+            "pollset_work",
+            grpc_pollset_work(&exec_ctx,
+                              grpc_polling_entity_pollset(&sync.pops), &worker,
+                              GRPC_MILLIS_INF_FUTURE)))
+      sync.is_done = true;
+    gpr_mu_unlock(sync.mu);
+    grpc_exec_ctx_flush(&exec_ctx);
+    gpr_mu_lock(sync.mu);
+  }
+  gpr_mu_unlock(sync.mu);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  grpc_channel_credentials_release(creds);
+  gpr_free(grpc_polling_entity_pollset(&sync.pops));
+
+end:
+  gpr_cmdline_destroy(cl);
+  grpc_shutdown();
+  return result;
+}
diff --git a/test/core/security/secure_endpoint_test.c b/test/core/security/secure_endpoint_test.c
deleted file mode 100644
index 839a05f..0000000
--- a/test/core/security/secure_endpoint_test.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/iomgr/endpoint_tests.h"
-
-#include <fcntl.h>
-#include <sys/types.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/security/transport/secure_endpoint.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/tsi/fake_transport_security.h"
-#include "test/core/util/test_config.h"
-
-static gpr_mu *g_mu;
-static grpc_pollset *g_pollset;
-
-static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
-    size_t slice_size, grpc_slice *leftover_slices, size_t leftover_nslices,
-    bool use_zero_copy_protector) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  tsi_frame_protector *fake_read_protector =
-      tsi_create_fake_frame_protector(NULL);
-  tsi_frame_protector *fake_write_protector =
-      tsi_create_fake_frame_protector(NULL);
-  tsi_zero_copy_grpc_protector *fake_read_zero_copy_protector =
-      use_zero_copy_protector ? tsi_create_fake_zero_copy_grpc_protector(NULL)
-                              : NULL;
-  tsi_zero_copy_grpc_protector *fake_write_zero_copy_protector =
-      use_zero_copy_protector ? tsi_create_fake_zero_copy_grpc_protector(NULL)
-                              : NULL;
-  grpc_endpoint_test_fixture f;
-  grpc_endpoint_pair tcp;
-
-  grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE,
-                   .type = GRPC_ARG_INTEGER,
-                   .value.integer = (int)slice_size}};
-  grpc_channel_args args = {.num_args = GPR_ARRAY_SIZE(a), .args = a};
-  tcp = grpc_iomgr_create_endpoint_pair("fixture", &args);
-  grpc_endpoint_add_to_pollset(&exec_ctx, tcp.client, g_pollset);
-  grpc_endpoint_add_to_pollset(&exec_ctx, tcp.server, g_pollset);
-
-  if (leftover_nslices == 0) {
-    f.client_ep = grpc_secure_endpoint_create(fake_read_protector,
-                                              fake_read_zero_copy_protector,
-                                              tcp.client, NULL, 0);
-  } else {
-    unsigned i;
-    tsi_result result;
-    size_t still_pending_size;
-    size_t total_buffer_size = 8192;
-    size_t buffer_size = total_buffer_size;
-    uint8_t *encrypted_buffer = (uint8_t *)gpr_malloc(buffer_size);
-    uint8_t *cur = encrypted_buffer;
-    grpc_slice encrypted_leftover;
-    for (i = 0; i < leftover_nslices; i++) {
-      grpc_slice plain = leftover_slices[i];
-      uint8_t *message_bytes = GRPC_SLICE_START_PTR(plain);
-      size_t message_size = GRPC_SLICE_LENGTH(plain);
-      while (message_size > 0) {
-        size_t protected_buffer_size_to_send = buffer_size;
-        size_t processed_message_size = message_size;
-        result = tsi_frame_protector_protect(
-            fake_write_protector, message_bytes, &processed_message_size, cur,
-            &protected_buffer_size_to_send);
-        GPR_ASSERT(result == TSI_OK);
-        message_bytes += processed_message_size;
-        message_size -= processed_message_size;
-        cur += protected_buffer_size_to_send;
-        GPR_ASSERT(buffer_size >= protected_buffer_size_to_send);
-        buffer_size -= protected_buffer_size_to_send;
-      }
-      grpc_slice_unref(plain);
-    }
-    do {
-      size_t protected_buffer_size_to_send = buffer_size;
-      result = tsi_frame_protector_protect_flush(fake_write_protector, cur,
-                                                 &protected_buffer_size_to_send,
-                                                 &still_pending_size);
-      GPR_ASSERT(result == TSI_OK);
-      cur += protected_buffer_size_to_send;
-      GPR_ASSERT(buffer_size >= protected_buffer_size_to_send);
-      buffer_size -= protected_buffer_size_to_send;
-    } while (still_pending_size > 0);
-    encrypted_leftover = grpc_slice_from_copied_buffer(
-        (const char *)encrypted_buffer, total_buffer_size - buffer_size);
-    f.client_ep = grpc_secure_endpoint_create(
-        fake_read_protector, fake_read_zero_copy_protector, tcp.client,
-        &encrypted_leftover, 1);
-    grpc_slice_unref(encrypted_leftover);
-    gpr_free(encrypted_buffer);
-  }
-
-  f.server_ep = grpc_secure_endpoint_create(fake_write_protector,
-                                            fake_write_zero_copy_protector,
-                                            tcp.server, NULL, 0);
-  grpc_exec_ctx_finish(&exec_ctx);
-  return f;
-}
-
-static grpc_endpoint_test_fixture
-secure_endpoint_create_fixture_tcp_socketpair_noleftover(size_t slice_size) {
-  return secure_endpoint_create_fixture_tcp_socketpair(slice_size, NULL, 0,
-                                                       false);
-}
-
-static grpc_endpoint_test_fixture
-secure_endpoint_create_fixture_tcp_socketpair_noleftover_zero_copy(
-    size_t slice_size) {
-  return secure_endpoint_create_fixture_tcp_socketpair(slice_size, NULL, 0,
-                                                       true);
-}
-
-static grpc_endpoint_test_fixture
-secure_endpoint_create_fixture_tcp_socketpair_leftover(size_t slice_size) {
-  grpc_slice s =
-      grpc_slice_from_copied_string("hello world 12345678900987654321");
-  return secure_endpoint_create_fixture_tcp_socketpair(slice_size, &s, 1,
-                                                       false);
-}
-
-static grpc_endpoint_test_fixture
-secure_endpoint_create_fixture_tcp_socketpair_leftover_zero_copy(
-    size_t slice_size) {
-  grpc_slice s =
-      grpc_slice_from_copied_string("hello world 12345678900987654321");
-  return secure_endpoint_create_fixture_tcp_socketpair(slice_size, &s, 1, true);
-}
-
-static void clean_up(void) {}
-
-static grpc_endpoint_test_config configs[] = {
-    {"secure_ep/tcp_socketpair",
-     secure_endpoint_create_fixture_tcp_socketpair_noleftover, clean_up},
-    {"secure_ep/tcp_socketpair_zero_copy",
-     secure_endpoint_create_fixture_tcp_socketpair_noleftover_zero_copy,
-     clean_up},
-    {"secure_ep/tcp_socketpair_leftover",
-     secure_endpoint_create_fixture_tcp_socketpair_leftover, clean_up},
-    {"secure_ep/tcp_socketpair_leftover_zero_copy",
-     secure_endpoint_create_fixture_tcp_socketpair_leftover_zero_copy,
-     clean_up},
-};
-
-static void inc_call_ctr(grpc_exec_ctx *exec_ctx, void *arg,
-                         grpc_error *error) {
-  ++*(int *)arg;
-}
-
-static void test_leftover(grpc_endpoint_test_config config, size_t slice_size) {
-  grpc_endpoint_test_fixture f = config.create_fixture(slice_size);
-  grpc_slice_buffer incoming;
-  grpc_slice s =
-      grpc_slice_from_copied_string("hello world 12345678900987654321");
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  int n = 0;
-  grpc_closure done_closure;
-  gpr_log(GPR_INFO, "Start test left over");
-
-  grpc_slice_buffer_init(&incoming);
-  GRPC_CLOSURE_INIT(&done_closure, inc_call_ctr, &n, grpc_schedule_on_exec_ctx);
-  grpc_endpoint_read(&exec_ctx, f.client_ep, &incoming, &done_closure);
-  grpc_exec_ctx_finish(&exec_ctx);
-  GPR_ASSERT(n == 1);
-  GPR_ASSERT(incoming.count == 1);
-  GPR_ASSERT(grpc_slice_eq(s, incoming.slices[0]));
-
-  grpc_endpoint_shutdown(
-      &exec_ctx, f.client_ep,
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING("test_leftover end"));
-  grpc_endpoint_shutdown(
-      &exec_ctx, f.server_ep,
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING("test_leftover end"));
-  grpc_endpoint_destroy(&exec_ctx, f.client_ep);
-  grpc_endpoint_destroy(&exec_ctx, f.server_ep);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_slice_unref_internal(&exec_ctx, s);
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &incoming);
-
-  clean_up();
-}
-
-static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p,
-                            grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, (grpc_pollset *)p);
-}
-
-int main(int argc, char **argv) {
-  grpc_closure destroyed;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_test_init(argc, argv);
-
-  grpc_init();
-  g_pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(g_pollset, &g_mu);
-  grpc_endpoint_tests(configs[0], g_pollset, g_mu);
-  grpc_endpoint_tests(configs[1], g_pollset, g_mu);
-  test_leftover(configs[2], 1);
-  test_leftover(configs[3], 1);
-  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
-                    grpc_schedule_on_exec_ctx);
-  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-
-  gpr_free(g_pollset);
-
-  return 0;
-}
diff --git a/test/core/security/secure_endpoint_test.cc b/test/core/security/secure_endpoint_test.cc
new file mode 100644
index 0000000..11d1e5f
--- /dev/null
+++ b/test/core/security/secure_endpoint_test.cc
@@ -0,0 +1,230 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/iomgr/endpoint_tests.h"
+
+#include <fcntl.h>
+#include <sys/types.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/security/transport/secure_endpoint.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/tsi/fake_transport_security.h"
+#include "test/core/util/test_config.h"
+
+static gpr_mu* g_mu;
+static grpc_pollset* g_pollset;
+
+static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
+    size_t slice_size, grpc_slice* leftover_slices, size_t leftover_nslices,
+    bool use_zero_copy_protector) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  tsi_frame_protector* fake_read_protector =
+      tsi_create_fake_frame_protector(NULL);
+  tsi_frame_protector* fake_write_protector =
+      tsi_create_fake_frame_protector(NULL);
+  tsi_zero_copy_grpc_protector* fake_read_zero_copy_protector =
+      use_zero_copy_protector ? tsi_create_fake_zero_copy_grpc_protector(NULL)
+                              : NULL;
+  tsi_zero_copy_grpc_protector* fake_write_zero_copy_protector =
+      use_zero_copy_protector ? tsi_create_fake_zero_copy_grpc_protector(NULL)
+                              : NULL;
+  grpc_endpoint_test_fixture f;
+  grpc_endpoint_pair tcp;
+
+  grpc_arg a[1];
+  a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
+  a[0].type = GRPC_ARG_INTEGER;
+  a[0].value.integer = (int)slice_size;
+  grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
+  tcp = grpc_iomgr_create_endpoint_pair("fixture", &args);
+  grpc_endpoint_add_to_pollset(&exec_ctx, tcp.client, g_pollset);
+  grpc_endpoint_add_to_pollset(&exec_ctx, tcp.server, g_pollset);
+
+  if (leftover_nslices == 0) {
+    f.client_ep = grpc_secure_endpoint_create(fake_read_protector,
+                                              fake_read_zero_copy_protector,
+                                              tcp.client, NULL, 0);
+  } else {
+    unsigned i;
+    tsi_result result;
+    size_t still_pending_size;
+    size_t total_buffer_size = 8192;
+    size_t buffer_size = total_buffer_size;
+    uint8_t* encrypted_buffer = (uint8_t*)gpr_malloc(buffer_size);
+    uint8_t* cur = encrypted_buffer;
+    grpc_slice encrypted_leftover;
+    for (i = 0; i < leftover_nslices; i++) {
+      grpc_slice plain = leftover_slices[i];
+      uint8_t* message_bytes = GRPC_SLICE_START_PTR(plain);
+      size_t message_size = GRPC_SLICE_LENGTH(plain);
+      while (message_size > 0) {
+        size_t protected_buffer_size_to_send = buffer_size;
+        size_t processed_message_size = message_size;
+        result = tsi_frame_protector_protect(
+            fake_write_protector, message_bytes, &processed_message_size, cur,
+            &protected_buffer_size_to_send);
+        GPR_ASSERT(result == TSI_OK);
+        message_bytes += processed_message_size;
+        message_size -= processed_message_size;
+        cur += protected_buffer_size_to_send;
+        GPR_ASSERT(buffer_size >= protected_buffer_size_to_send);
+        buffer_size -= protected_buffer_size_to_send;
+      }
+      grpc_slice_unref(plain);
+    }
+    do {
+      size_t protected_buffer_size_to_send = buffer_size;
+      result = tsi_frame_protector_protect_flush(fake_write_protector, cur,
+                                                 &protected_buffer_size_to_send,
+                                                 &still_pending_size);
+      GPR_ASSERT(result == TSI_OK);
+      cur += protected_buffer_size_to_send;
+      GPR_ASSERT(buffer_size >= protected_buffer_size_to_send);
+      buffer_size -= protected_buffer_size_to_send;
+    } while (still_pending_size > 0);
+    encrypted_leftover = grpc_slice_from_copied_buffer(
+        (const char*)encrypted_buffer, total_buffer_size - buffer_size);
+    f.client_ep = grpc_secure_endpoint_create(
+        fake_read_protector, fake_read_zero_copy_protector, tcp.client,
+        &encrypted_leftover, 1);
+    grpc_slice_unref(encrypted_leftover);
+    gpr_free(encrypted_buffer);
+  }
+
+  f.server_ep = grpc_secure_endpoint_create(fake_write_protector,
+                                            fake_write_zero_copy_protector,
+                                            tcp.server, NULL, 0);
+  grpc_exec_ctx_finish(&exec_ctx);
+  return f;
+}
+
+static grpc_endpoint_test_fixture
+secure_endpoint_create_fixture_tcp_socketpair_noleftover(size_t slice_size) {
+  return secure_endpoint_create_fixture_tcp_socketpair(slice_size, NULL, 0,
+                                                       false);
+}
+
+static grpc_endpoint_test_fixture
+secure_endpoint_create_fixture_tcp_socketpair_noleftover_zero_copy(
+    size_t slice_size) {
+  return secure_endpoint_create_fixture_tcp_socketpair(slice_size, NULL, 0,
+                                                       true);
+}
+
+static grpc_endpoint_test_fixture
+secure_endpoint_create_fixture_tcp_socketpair_leftover(size_t slice_size) {
+  grpc_slice s =
+      grpc_slice_from_copied_string("hello world 12345678900987654321");
+  return secure_endpoint_create_fixture_tcp_socketpair(slice_size, &s, 1,
+                                                       false);
+}
+
+static grpc_endpoint_test_fixture
+secure_endpoint_create_fixture_tcp_socketpair_leftover_zero_copy(
+    size_t slice_size) {
+  grpc_slice s =
+      grpc_slice_from_copied_string("hello world 12345678900987654321");
+  return secure_endpoint_create_fixture_tcp_socketpair(slice_size, &s, 1, true);
+}
+
+static void clean_up(void) {}
+
+static grpc_endpoint_test_config configs[] = {
+    {"secure_ep/tcp_socketpair",
+     secure_endpoint_create_fixture_tcp_socketpair_noleftover, clean_up},
+    {"secure_ep/tcp_socketpair_zero_copy",
+     secure_endpoint_create_fixture_tcp_socketpair_noleftover_zero_copy,
+     clean_up},
+    {"secure_ep/tcp_socketpair_leftover",
+     secure_endpoint_create_fixture_tcp_socketpair_leftover, clean_up},
+    {"secure_ep/tcp_socketpair_leftover_zero_copy",
+     secure_endpoint_create_fixture_tcp_socketpair_leftover_zero_copy,
+     clean_up},
+};
+
+static void inc_call_ctr(grpc_exec_ctx* exec_ctx, void* arg,
+                         grpc_error* error) {
+  ++*(int*)arg;
+}
+
+static void test_leftover(grpc_endpoint_test_config config, size_t slice_size) {
+  grpc_endpoint_test_fixture f = config.create_fixture(slice_size);
+  grpc_slice_buffer incoming;
+  grpc_slice s =
+      grpc_slice_from_copied_string("hello world 12345678900987654321");
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  int n = 0;
+  grpc_closure done_closure;
+  gpr_log(GPR_INFO, "Start test left over");
+
+  grpc_slice_buffer_init(&incoming);
+  GRPC_CLOSURE_INIT(&done_closure, inc_call_ctr, &n, grpc_schedule_on_exec_ctx);
+  grpc_endpoint_read(&exec_ctx, f.client_ep, &incoming, &done_closure);
+  grpc_exec_ctx_finish(&exec_ctx);
+  GPR_ASSERT(n == 1);
+  GPR_ASSERT(incoming.count == 1);
+  GPR_ASSERT(grpc_slice_eq(s, incoming.slices[0]));
+
+  grpc_endpoint_shutdown(
+      &exec_ctx, f.client_ep,
+      GRPC_ERROR_CREATE_FROM_STATIC_STRING("test_leftover end"));
+  grpc_endpoint_shutdown(
+      &exec_ctx, f.server_ep,
+      GRPC_ERROR_CREATE_FROM_STATIC_STRING("test_leftover end"));
+  grpc_endpoint_destroy(&exec_ctx, f.client_ep);
+  grpc_endpoint_destroy(&exec_ctx, f.server_ep);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_slice_unref_internal(&exec_ctx, s);
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &incoming);
+
+  clean_up();
+}
+
+static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* p,
+                            grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, (grpc_pollset*)p);
+}
+
+int main(int argc, char** argv) {
+  grpc_closure destroyed;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_test_init(argc, argv);
+
+  grpc_init();
+  g_pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+  grpc_pollset_init(g_pollset, &g_mu);
+  grpc_endpoint_tests(configs[0], g_pollset, g_mu);
+  grpc_endpoint_tests(configs[1], g_pollset, g_mu);
+  test_leftover(configs[2], 1);
+  test_leftover(configs[3], 1);
+  GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+                    grpc_schedule_on_exec_ctx);
+  grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+
+  gpr_free(g_pollset);
+
+  return 0;
+}
diff --git a/test/core/security/security_connector_test.c b/test/core/security/security_connector_test.c
deleted file mode 100644
index eecf0f4..0000000
--- a/test/core/security/security_connector_test.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/security/context/security_context.h"
-#include "src/core/lib/security/transport/security_connector.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/support/tmpfile.h"
-#include "src/core/tsi/ssl_transport_security.h"
-#include "src/core/tsi/transport_security.h"
-#include "test/core/util/test_config.h"
-
-static int check_transport_security_type(const grpc_auth_context *ctx) {
-  grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
-      ctx, GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME);
-  const grpc_auth_property *prop = grpc_auth_property_iterator_next(&it);
-  if (prop == NULL) return 0;
-  if (strncmp(prop->value, GRPC_SSL_TRANSPORT_SECURITY_TYPE,
-              prop->value_length) != 0) {
-    return 0;
-  }
-  /* Check that we have only one property with this name. */
-  if (grpc_auth_property_iterator_next(&it) != NULL) return 0;
-  return 1;
-}
-
-static int check_peer_property(const tsi_peer *peer,
-                               const tsi_peer_property *expected) {
-  size_t i;
-  for (i = 0; i < peer->property_count; i++) {
-    const tsi_peer_property *prop = &peer->properties[i];
-    if ((strcmp(prop->name, expected->name) == 0) &&
-        (prop->value.length == expected->value.length) &&
-        (memcmp(prop->value.data, expected->value.data,
-                expected->value.length) == 0)) {
-      return 1;
-    }
-  }
-  return 0; /* Not found... */
-}
-
-static int check_ssl_peer_equivalence(const tsi_peer *original,
-                                      const tsi_peer *reconstructed) {
-  /* The reconstructed peer only has CN, SAN and pem cert properties. */
-  size_t i;
-  for (i = 0; i < original->property_count; i++) {
-    const tsi_peer_property *prop = &original->properties[i];
-    if ((strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) ||
-        (strcmp(prop->name, TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) ==
-         0) ||
-        (strcmp(prop->name, TSI_X509_PEM_CERT_PROPERTY) == 0)) {
-      if (!check_peer_property(reconstructed, prop)) return 0;
-    }
-  }
-  return 1;
-}
-
-static void test_unauthenticated_ssl_peer(void) {
-  tsi_peer peer;
-  tsi_peer rpeer;
-  grpc_auth_context *ctx;
-  GPR_ASSERT(tsi_construct_peer(1, &peer) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
-                 &peer.properties[0]) == TSI_OK);
-  ctx = tsi_ssl_peer_to_auth_context(&peer);
-  GPR_ASSERT(ctx != NULL);
-  GPR_ASSERT(!grpc_auth_context_peer_is_authenticated(ctx));
-  GPR_ASSERT(check_transport_security_type(ctx));
-
-  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
-  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
-
-  tsi_shallow_peer_destruct(&rpeer);
-  tsi_peer_destruct(&peer);
-  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
-}
-
-static int check_identity(const grpc_auth_context *ctx,
-                          const char *expected_property_name,
-                          const char **expected_identities,
-                          size_t num_identities) {
-  grpc_auth_property_iterator it;
-  const grpc_auth_property *prop;
-  size_t i;
-  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
-  it = grpc_auth_context_peer_identity(ctx);
-  for (i = 0; i < num_identities; i++) {
-    prop = grpc_auth_property_iterator_next(&it);
-    if (prop == NULL) {
-      gpr_log(GPR_ERROR, "Expected identity value %s not found.",
-              expected_identities[i]);
-      return 0;
-    }
-    if (strcmp(prop->name, expected_property_name) != 0) {
-      gpr_log(GPR_ERROR, "Expected peer identity property name %s and got %s.",
-              expected_property_name, prop->name);
-      return 0;
-    }
-    if (strncmp(prop->value, expected_identities[i], prop->value_length) != 0) {
-      gpr_log(GPR_ERROR, "Expected peer identity %s and got %s.",
-              expected_identities[i], prop->value);
-      return 0;
-    }
-  }
-  return 1;
-}
-
-static int check_x509_cn(const grpc_auth_context *ctx,
-                         const char *expected_cn) {
-  grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
-      ctx, GRPC_X509_CN_PROPERTY_NAME);
-  const grpc_auth_property *prop = grpc_auth_property_iterator_next(&it);
-  if (prop == NULL) {
-    gpr_log(GPR_ERROR, "CN property not found.");
-    return 0;
-  }
-  if (strncmp(prop->value, expected_cn, prop->value_length) != 0) {
-    gpr_log(GPR_ERROR, "Expected CN %s and got %s", expected_cn, prop->value);
-    return 0;
-  }
-  if (grpc_auth_property_iterator_next(&it) != NULL) {
-    gpr_log(GPR_ERROR, "Expected only one property for CN.");
-    return 0;
-  }
-  return 1;
-}
-
-static int check_x509_pem_cert(const grpc_auth_context *ctx,
-                               const char *expected_pem_cert) {
-  grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
-      ctx, GRPC_X509_PEM_CERT_PROPERTY_NAME);
-  const grpc_auth_property *prop = grpc_auth_property_iterator_next(&it);
-  if (prop == NULL) {
-    gpr_log(GPR_ERROR, "Pem certificate property not found.");
-    return 0;
-  }
-  if (strncmp(prop->value, expected_pem_cert, prop->value_length) != 0) {
-    gpr_log(GPR_ERROR, "Expected pem cert %s and got %s", expected_pem_cert,
-            prop->value);
-    return 0;
-  }
-  if (grpc_auth_property_iterator_next(&it) != NULL) {
-    gpr_log(GPR_ERROR, "Expected only one property for pem cert.");
-    return 0;
-  }
-  return 1;
-}
-
-static void test_cn_only_ssl_peer_to_auth_context(void) {
-  tsi_peer peer;
-  tsi_peer rpeer;
-  grpc_auth_context *ctx;
-  const char *expected_cn = "cn1";
-  const char *expected_pem_cert = "pem_cert1";
-  GPR_ASSERT(tsi_construct_peer(3, &peer) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
-                 &peer.properties[0]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
-                 &peer.properties[1]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert,
-                 &peer.properties[2]) == TSI_OK);
-  ctx = tsi_ssl_peer_to_auth_context(&peer);
-  GPR_ASSERT(ctx != NULL);
-  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
-  GPR_ASSERT(check_identity(ctx, GRPC_X509_CN_PROPERTY_NAME, &expected_cn, 1));
-  GPR_ASSERT(check_transport_security_type(ctx));
-  GPR_ASSERT(check_x509_cn(ctx, expected_cn));
-  GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert));
-
-  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
-  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
-
-  tsi_shallow_peer_destruct(&rpeer);
-  tsi_peer_destruct(&peer);
-  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
-}
-
-static void test_cn_and_one_san_ssl_peer_to_auth_context(void) {
-  tsi_peer peer;
-  tsi_peer rpeer;
-  grpc_auth_context *ctx;
-  const char *expected_cn = "cn1";
-  const char *expected_san = "san1";
-  const char *expected_pem_cert = "pem_cert1";
-  GPR_ASSERT(tsi_construct_peer(4, &peer) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
-                 &peer.properties[0]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
-                 &peer.properties[1]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, expected_san,
-                 &peer.properties[2]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert,
-                 &peer.properties[3]) == TSI_OK);
-  ctx = tsi_ssl_peer_to_auth_context(&peer);
-  GPR_ASSERT(ctx != NULL);
-  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
-  GPR_ASSERT(
-      check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, &expected_san, 1));
-  GPR_ASSERT(check_transport_security_type(ctx));
-  GPR_ASSERT(check_x509_cn(ctx, expected_cn));
-  GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert));
-
-  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
-  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
-
-  tsi_shallow_peer_destruct(&rpeer);
-  tsi_peer_destruct(&peer);
-  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
-}
-
-static void test_cn_and_multiple_sans_ssl_peer_to_auth_context(void) {
-  tsi_peer peer;
-  tsi_peer rpeer;
-  grpc_auth_context *ctx;
-  const char *expected_cn = "cn1";
-  const char *expected_sans[] = {"san1", "san2", "san3"};
-  const char *expected_pem_cert = "pem_cert1";
-  size_t i;
-  GPR_ASSERT(tsi_construct_peer(3 + GPR_ARRAY_SIZE(expected_sans), &peer) ==
-             TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
-                 &peer.properties[0]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
-                 &peer.properties[1]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert,
-                 &peer.properties[2]) == TSI_OK);
-  for (i = 0; i < GPR_ARRAY_SIZE(expected_sans); i++) {
-    GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                   TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
-                   expected_sans[i], &peer.properties[3 + i]) == TSI_OK);
-  }
-  ctx = tsi_ssl_peer_to_auth_context(&peer);
-  GPR_ASSERT(ctx != NULL);
-  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
-  GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, expected_sans,
-                            GPR_ARRAY_SIZE(expected_sans)));
-  GPR_ASSERT(check_transport_security_type(ctx));
-  GPR_ASSERT(check_x509_cn(ctx, expected_cn));
-  GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert));
-
-  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
-  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
-
-  tsi_shallow_peer_destruct(&rpeer);
-  tsi_peer_destruct(&peer);
-  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
-}
-
-static void test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context(
-    void) {
-  tsi_peer peer;
-  tsi_peer rpeer;
-  grpc_auth_context *ctx;
-  const char *expected_cn = "cn1";
-  const char *expected_pem_cert = "pem_cert1";
-  const char *expected_sans[] = {"san1", "san2", "san3"};
-  size_t i;
-  GPR_ASSERT(tsi_construct_peer(5 + GPR_ARRAY_SIZE(expected_sans), &peer) ==
-             TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
-                 &peer.properties[0]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 "foo", "bar", &peer.properties[1]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
-                 &peer.properties[2]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 "chapi", "chapo", &peer.properties[3]) == TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert,
-                 &peer.properties[4]) == TSI_OK);
-  for (i = 0; i < GPR_ARRAY_SIZE(expected_sans); i++) {
-    GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                   TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
-                   expected_sans[i], &peer.properties[5 + i]) == TSI_OK);
-  }
-  ctx = tsi_ssl_peer_to_auth_context(&peer);
-  GPR_ASSERT(ctx != NULL);
-  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
-  GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, expected_sans,
-                            GPR_ARRAY_SIZE(expected_sans)));
-  GPR_ASSERT(check_transport_security_type(ctx));
-  GPR_ASSERT(check_x509_cn(ctx, expected_cn));
-  GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert));
-
-  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
-  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
-
-  tsi_shallow_peer_destruct(&rpeer);
-  tsi_peer_destruct(&peer);
-  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
-}
-
-static const char *roots_for_override_api = "roots for override api";
-
-static grpc_ssl_roots_override_result override_roots_success(
-    char **pem_root_certs) {
-  *pem_root_certs = gpr_strdup(roots_for_override_api);
-  return GRPC_SSL_ROOTS_OVERRIDE_OK;
-}
-
-static grpc_ssl_roots_override_result override_roots_permanent_failure(
-    char **pem_root_certs) {
-  return GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY;
-}
-
-static void test_default_ssl_roots(void) {
-  const char *roots_for_env_var = "roots for env var";
-
-  char *roots_env_var_file_path;
-  FILE *roots_env_var_file =
-      gpr_tmpfile("test_roots_for_env_var", &roots_env_var_file_path);
-  fwrite(roots_for_env_var, 1, strlen(roots_for_env_var), roots_env_var_file);
-  fclose(roots_env_var_file);
-
-  /* First let's get the root through the override: set the env to an invalid
-     value. */
-  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, "");
-  grpc_set_ssl_roots_override_callback(override_roots_success);
-  grpc_slice roots = grpc_get_default_ssl_roots_for_testing();
-  char *roots_contents = grpc_slice_to_c_string(roots);
-  grpc_slice_unref(roots);
-  GPR_ASSERT(strcmp(roots_contents, roots_for_override_api) == 0);
-  gpr_free(roots_contents);
-
-  /* Now let's set the env var: We should get the contents pointed value
-     instead. */
-  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_env_var_file_path);
-  roots = grpc_get_default_ssl_roots_for_testing();
-  roots_contents = grpc_slice_to_c_string(roots);
-  grpc_slice_unref(roots);
-  GPR_ASSERT(strcmp(roots_contents, roots_for_env_var) == 0);
-  gpr_free(roots_contents);
-
-  /* Now reset the env var. We should fall back to the value overridden using
-     the api. */
-  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, "");
-  roots = grpc_get_default_ssl_roots_for_testing();
-  roots_contents = grpc_slice_to_c_string(roots);
-  grpc_slice_unref(roots);
-  GPR_ASSERT(strcmp(roots_contents, roots_for_override_api) == 0);
-  gpr_free(roots_contents);
-
-  /* Now setup a permanent failure for the overridden roots and we should get
-     an empty slice. */
-  grpc_set_ssl_roots_override_callback(override_roots_permanent_failure);
-  roots = grpc_get_default_ssl_roots_for_testing();
-  GPR_ASSERT(GRPC_SLICE_IS_EMPTY(roots));
-
-  /* Cleanup. */
-  remove(roots_env_var_file_path);
-  gpr_free(roots_env_var_file_path);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  test_unauthenticated_ssl_peer();
-  test_cn_only_ssl_peer_to_auth_context();
-  test_cn_and_one_san_ssl_peer_to_auth_context();
-  test_cn_and_multiple_sans_ssl_peer_to_auth_context();
-  test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context();
-  test_default_ssl_roots();
-
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/security/security_connector_test.cc b/test/core/security/security_connector_test.cc
new file mode 100644
index 0000000..a0c1e93
--- /dev/null
+++ b/test/core/security/security_connector_test.cc
@@ -0,0 +1,405 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/security/context/security_context.h"
+#include "src/core/lib/security/transport/security_connector.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/support/tmpfile.h"
+#include "src/core/tsi/ssl_transport_security.h"
+#include "src/core/tsi/transport_security.h"
+#include "test/core/util/test_config.h"
+
+static int check_transport_security_type(const grpc_auth_context* ctx) {
+  grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
+      ctx, GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME);
+  const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+  if (prop == NULL) return 0;
+  if (strncmp(prop->value, GRPC_SSL_TRANSPORT_SECURITY_TYPE,
+              prop->value_length) != 0) {
+    return 0;
+  }
+  /* Check that we have only one property with this name. */
+  if (grpc_auth_property_iterator_next(&it) != NULL) return 0;
+  return 1;
+}
+
+static int check_peer_property(const tsi_peer* peer,
+                               const tsi_peer_property* expected) {
+  size_t i;
+  for (i = 0; i < peer->property_count; i++) {
+    const tsi_peer_property* prop = &peer->properties[i];
+    if ((strcmp(prop->name, expected->name) == 0) &&
+        (prop->value.length == expected->value.length) &&
+        (memcmp(prop->value.data, expected->value.data,
+                expected->value.length) == 0)) {
+      return 1;
+    }
+  }
+  return 0; /* Not found... */
+}
+
+static int check_ssl_peer_equivalence(const tsi_peer* original,
+                                      const tsi_peer* reconstructed) {
+  /* The reconstructed peer only has CN, SAN and pem cert properties. */
+  size_t i;
+  for (i = 0; i < original->property_count; i++) {
+    const tsi_peer_property* prop = &original->properties[i];
+    if ((strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) ||
+        (strcmp(prop->name, TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) ==
+         0) ||
+        (strcmp(prop->name, TSI_X509_PEM_CERT_PROPERTY) == 0)) {
+      if (!check_peer_property(reconstructed, prop)) return 0;
+    }
+  }
+  return 1;
+}
+
+static void test_unauthenticated_ssl_peer(void) {
+  tsi_peer peer;
+  tsi_peer rpeer;
+  grpc_auth_context* ctx;
+  GPR_ASSERT(tsi_construct_peer(1, &peer) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+                 &peer.properties[0]) == TSI_OK);
+  ctx = tsi_ssl_peer_to_auth_context(&peer);
+  GPR_ASSERT(ctx != NULL);
+  GPR_ASSERT(!grpc_auth_context_peer_is_authenticated(ctx));
+  GPR_ASSERT(check_transport_security_type(ctx));
+
+  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
+  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
+
+  tsi_shallow_peer_destruct(&rpeer);
+  tsi_peer_destruct(&peer);
+  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static int check_identity(const grpc_auth_context* ctx,
+                          const char* expected_property_name,
+                          const char** expected_identities,
+                          size_t num_identities) {
+  grpc_auth_property_iterator it;
+  const grpc_auth_property* prop;
+  size_t i;
+  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+  it = grpc_auth_context_peer_identity(ctx);
+  for (i = 0; i < num_identities; i++) {
+    prop = grpc_auth_property_iterator_next(&it);
+    if (prop == NULL) {
+      gpr_log(GPR_ERROR, "Expected identity value %s not found.",
+              expected_identities[i]);
+      return 0;
+    }
+    if (strcmp(prop->name, expected_property_name) != 0) {
+      gpr_log(GPR_ERROR, "Expected peer identity property name %s and got %s.",
+              expected_property_name, prop->name);
+      return 0;
+    }
+    if (strncmp(prop->value, expected_identities[i], prop->value_length) != 0) {
+      gpr_log(GPR_ERROR, "Expected peer identity %s and got %s.",
+              expected_identities[i], prop->value);
+      return 0;
+    }
+  }
+  return 1;
+}
+
+static int check_x509_cn(const grpc_auth_context* ctx,
+                         const char* expected_cn) {
+  grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
+      ctx, GRPC_X509_CN_PROPERTY_NAME);
+  const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+  if (prop == NULL) {
+    gpr_log(GPR_ERROR, "CN property not found.");
+    return 0;
+  }
+  if (strncmp(prop->value, expected_cn, prop->value_length) != 0) {
+    gpr_log(GPR_ERROR, "Expected CN %s and got %s", expected_cn, prop->value);
+    return 0;
+  }
+  if (grpc_auth_property_iterator_next(&it) != NULL) {
+    gpr_log(GPR_ERROR, "Expected only one property for CN.");
+    return 0;
+  }
+  return 1;
+}
+
+static int check_x509_pem_cert(const grpc_auth_context* ctx,
+                               const char* expected_pem_cert) {
+  grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
+      ctx, GRPC_X509_PEM_CERT_PROPERTY_NAME);
+  const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+  if (prop == NULL) {
+    gpr_log(GPR_ERROR, "Pem certificate property not found.");
+    return 0;
+  }
+  if (strncmp(prop->value, expected_pem_cert, prop->value_length) != 0) {
+    gpr_log(GPR_ERROR, "Expected pem cert %s and got %s", expected_pem_cert,
+            prop->value);
+    return 0;
+  }
+  if (grpc_auth_property_iterator_next(&it) != NULL) {
+    gpr_log(GPR_ERROR, "Expected only one property for pem cert.");
+    return 0;
+  }
+  return 1;
+}
+
+static void test_cn_only_ssl_peer_to_auth_context(void) {
+  tsi_peer peer;
+  tsi_peer rpeer;
+  grpc_auth_context* ctx;
+  const char* expected_cn = "cn1";
+  const char* expected_pem_cert = "pem_cert1";
+  GPR_ASSERT(tsi_construct_peer(3, &peer) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+                 &peer.properties[0]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
+                 &peer.properties[1]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert,
+                 &peer.properties[2]) == TSI_OK);
+  ctx = tsi_ssl_peer_to_auth_context(&peer);
+  GPR_ASSERT(ctx != NULL);
+  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+  GPR_ASSERT(check_identity(ctx, GRPC_X509_CN_PROPERTY_NAME, &expected_cn, 1));
+  GPR_ASSERT(check_transport_security_type(ctx));
+  GPR_ASSERT(check_x509_cn(ctx, expected_cn));
+  GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert));
+
+  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
+  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
+
+  tsi_shallow_peer_destruct(&rpeer);
+  tsi_peer_destruct(&peer);
+  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static void test_cn_and_one_san_ssl_peer_to_auth_context(void) {
+  tsi_peer peer;
+  tsi_peer rpeer;
+  grpc_auth_context* ctx;
+  const char* expected_cn = "cn1";
+  const char* expected_san = "san1";
+  const char* expected_pem_cert = "pem_cert1";
+  GPR_ASSERT(tsi_construct_peer(4, &peer) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+                 &peer.properties[0]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
+                 &peer.properties[1]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, expected_san,
+                 &peer.properties[2]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert,
+                 &peer.properties[3]) == TSI_OK);
+  ctx = tsi_ssl_peer_to_auth_context(&peer);
+  GPR_ASSERT(ctx != NULL);
+  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+  GPR_ASSERT(
+      check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, &expected_san, 1));
+  GPR_ASSERT(check_transport_security_type(ctx));
+  GPR_ASSERT(check_x509_cn(ctx, expected_cn));
+  GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert));
+
+  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
+  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
+
+  tsi_shallow_peer_destruct(&rpeer);
+  tsi_peer_destruct(&peer);
+  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static void test_cn_and_multiple_sans_ssl_peer_to_auth_context(void) {
+  tsi_peer peer;
+  tsi_peer rpeer;
+  grpc_auth_context* ctx;
+  const char* expected_cn = "cn1";
+  const char* expected_sans[] = {"san1", "san2", "san3"};
+  const char* expected_pem_cert = "pem_cert1";
+  size_t i;
+  GPR_ASSERT(tsi_construct_peer(3 + GPR_ARRAY_SIZE(expected_sans), &peer) ==
+             TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+                 &peer.properties[0]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
+                 &peer.properties[1]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert,
+                 &peer.properties[2]) == TSI_OK);
+  for (i = 0; i < GPR_ARRAY_SIZE(expected_sans); i++) {
+    GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                   TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
+                   expected_sans[i], &peer.properties[3 + i]) == TSI_OK);
+  }
+  ctx = tsi_ssl_peer_to_auth_context(&peer);
+  GPR_ASSERT(ctx != NULL);
+  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+  GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, expected_sans,
+                            GPR_ARRAY_SIZE(expected_sans)));
+  GPR_ASSERT(check_transport_security_type(ctx));
+  GPR_ASSERT(check_x509_cn(ctx, expected_cn));
+  GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert));
+
+  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
+  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
+
+  tsi_shallow_peer_destruct(&rpeer);
+  tsi_peer_destruct(&peer);
+  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static void test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context(
+    void) {
+  tsi_peer peer;
+  tsi_peer rpeer;
+  grpc_auth_context* ctx;
+  const char* expected_cn = "cn1";
+  const char* expected_pem_cert = "pem_cert1";
+  const char* expected_sans[] = {"san1", "san2", "san3"};
+  size_t i;
+  GPR_ASSERT(tsi_construct_peer(5 + GPR_ARRAY_SIZE(expected_sans), &peer) ==
+             TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+                 &peer.properties[0]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 "foo", "bar", &peer.properties[1]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
+                 &peer.properties[2]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 "chapi", "chapo", &peer.properties[3]) == TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert,
+                 &peer.properties[4]) == TSI_OK);
+  for (i = 0; i < GPR_ARRAY_SIZE(expected_sans); i++) {
+    GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                   TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
+                   expected_sans[i], &peer.properties[5 + i]) == TSI_OK);
+  }
+  ctx = tsi_ssl_peer_to_auth_context(&peer);
+  GPR_ASSERT(ctx != NULL);
+  GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+  GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, expected_sans,
+                            GPR_ARRAY_SIZE(expected_sans)));
+  GPR_ASSERT(check_transport_security_type(ctx));
+  GPR_ASSERT(check_x509_cn(ctx, expected_cn));
+  GPR_ASSERT(check_x509_pem_cert(ctx, expected_pem_cert));
+
+  rpeer = tsi_shallow_peer_from_ssl_auth_context(ctx);
+  GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
+
+  tsi_shallow_peer_destruct(&rpeer);
+  tsi_peer_destruct(&peer);
+  GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static const char* roots_for_override_api = "roots for override api";
+
+static grpc_ssl_roots_override_result override_roots_success(
+    char** pem_root_certs) {
+  *pem_root_certs = gpr_strdup(roots_for_override_api);
+  return GRPC_SSL_ROOTS_OVERRIDE_OK;
+}
+
+static grpc_ssl_roots_override_result override_roots_permanent_failure(
+    char** pem_root_certs) {
+  return GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY;
+}
+
+static void test_default_ssl_roots(void) {
+  const char* roots_for_env_var = "roots for env var";
+
+  char* roots_env_var_file_path;
+  FILE* roots_env_var_file =
+      gpr_tmpfile("test_roots_for_env_var", &roots_env_var_file_path);
+  fwrite(roots_for_env_var, 1, strlen(roots_for_env_var), roots_env_var_file);
+  fclose(roots_env_var_file);
+
+  /* First let's get the root through the override: set the env to an invalid
+     value. */
+  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, "");
+  grpc_set_ssl_roots_override_callback(override_roots_success);
+  grpc_slice roots = grpc_get_default_ssl_roots_for_testing();
+  char* roots_contents = grpc_slice_to_c_string(roots);
+  grpc_slice_unref(roots);
+  GPR_ASSERT(strcmp(roots_contents, roots_for_override_api) == 0);
+  gpr_free(roots_contents);
+
+  /* Now let's set the env var: We should get the contents pointed value
+     instead. */
+  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_env_var_file_path);
+  roots = grpc_get_default_ssl_roots_for_testing();
+  roots_contents = grpc_slice_to_c_string(roots);
+  grpc_slice_unref(roots);
+  GPR_ASSERT(strcmp(roots_contents, roots_for_env_var) == 0);
+  gpr_free(roots_contents);
+
+  /* Now reset the env var. We should fall back to the value overridden using
+     the api. */
+  gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, "");
+  roots = grpc_get_default_ssl_roots_for_testing();
+  roots_contents = grpc_slice_to_c_string(roots);
+  grpc_slice_unref(roots);
+  GPR_ASSERT(strcmp(roots_contents, roots_for_override_api) == 0);
+  gpr_free(roots_contents);
+
+  /* Now setup a permanent failure for the overridden roots and we should get
+     an empty slice. */
+  grpc_set_ssl_roots_override_callback(override_roots_permanent_failure);
+  roots = grpc_get_default_ssl_roots_for_testing();
+  GPR_ASSERT(GRPC_SLICE_IS_EMPTY(roots));
+
+  /* Cleanup. */
+  remove(roots_env_var_file_path);
+  gpr_free(roots_env_var_file_path);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  test_unauthenticated_ssl_peer();
+  test_cn_only_ssl_peer_to_auth_context();
+  test_cn_and_one_san_ssl_peer_to_auth_context();
+  test_cn_and_multiple_sans_ssl_peer_to_auth_context();
+  test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context();
+  test_default_ssl_roots();
+
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/security/ssl_credentials_test.cc b/test/core/security/ssl_credentials_test.cc
new file mode 100644
index 0000000..76ee32b
--- /dev/null
+++ b/test/core/security/ssl_credentials_test.cc
@@ -0,0 +1,66 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/security/credentials/ssl/ssl_credentials.h"
+#include "src/core/tsi/ssl_transport_security.h"
+#include "test/core/util/test_config.h"
+
+static void test_convert_grpc_to_tsi_cert_pairs() {
+  grpc_ssl_pem_key_cert_pair grpc_pairs[] = {{"private_key1", "cert_chain1"},
+                                             {"private_key2", "cert_chain2"},
+                                             {"private_key3", "cert_chain3"}};
+  const size_t num_pairs = 3;
+
+  {
+    tsi_ssl_pem_key_cert_pair* tsi_pairs =
+        grpc_convert_grpc_to_tsi_cert_pairs(grpc_pairs, 0);
+    GPR_ASSERT(tsi_pairs == NULL);
+  }
+
+  {
+    tsi_ssl_pem_key_cert_pair* tsi_pairs =
+        grpc_convert_grpc_to_tsi_cert_pairs(grpc_pairs, num_pairs);
+
+    GPR_ASSERT(tsi_pairs != NULL);
+    for (size_t i = 0; i < num_pairs; i++) {
+      GPR_ASSERT(strncmp(grpc_pairs[i].private_key, tsi_pairs[i].private_key,
+                         strlen(grpc_pairs[i].private_key)) == 0);
+      GPR_ASSERT(strncmp(grpc_pairs[i].cert_chain, tsi_pairs[i].cert_chain,
+                         strlen(grpc_pairs[i].cert_chain)) == 0);
+    }
+
+    grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_pairs, num_pairs);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  test_convert_grpc_to_tsi_cert_pairs();
+
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/security/ssl_server_fuzzer.c b/test/core/security/ssl_server_fuzzer.c
deleted file mode 100644
index f9b754b..0000000
--- a/test/core/security/ssl_server_fuzzer.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/iomgr/load_file.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/security/transport/security_connector.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/util/memory_counters.h"
-#include "test/core/util/mock_endpoint.h"
-
-bool squelch = true;
-// ssl has an array of global gpr_mu's that are never released.
-// Turning this on will fail the leak check.
-bool leak_check = false;
-
-static void discard_write(grpc_slice slice) {}
-
-static void dont_log(gpr_log_func_args *args) {}
-
-struct handshake_state {
-  bool done_callback_called;
-};
-
-static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
-                              grpc_error *error) {
-  grpc_handshaker_args *args = arg;
-  struct handshake_state *state = args->user_data;
-  GPR_ASSERT(state->done_callback_called == false);
-  state->done_callback_called = true;
-  // The fuzzer should not pass the handshake.
-  GPR_ASSERT(error != GRPC_ERROR_NONE);
-}
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  struct grpc_memory_counters counters;
-  if (squelch) gpr_set_log_function(dont_log);
-  if (leak_check) grpc_memory_counters_init();
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  grpc_resource_quota *resource_quota =
-      grpc_resource_quota_create("ssl_server_fuzzer");
-  grpc_endpoint *mock_endpoint =
-      grpc_mock_endpoint_create(discard_write, resource_quota);
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-
-  grpc_mock_endpoint_put_read(
-      &exec_ctx, mock_endpoint,
-      grpc_slice_from_copied_buffer((const char *)data, size));
-
-  // Load key pair and establish server SSL credentials.
-  grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
-  grpc_slice ca_slice, cert_slice, key_slice;
-  ca_slice = grpc_slice_from_static_string(test_root_cert);
-  cert_slice = grpc_slice_from_static_string(test_server1_cert);
-  key_slice = grpc_slice_from_static_string(test_server1_key);
-  const char *ca_cert = (const char *)GRPC_SLICE_START_PTR(ca_slice);
-  pem_key_cert_pair.private_key = (const char *)GRPC_SLICE_START_PTR(key_slice);
-  pem_key_cert_pair.cert_chain = (const char *)GRPC_SLICE_START_PTR(cert_slice);
-  grpc_server_credentials *creds = grpc_ssl_server_credentials_create(
-      ca_cert, &pem_key_cert_pair, 1, 0, NULL);
-
-  // Create security connector
-  grpc_server_security_connector *sc = NULL;
-  grpc_security_status status =
-      grpc_server_credentials_create_security_connector(&exec_ctx, creds, &sc);
-  GPR_ASSERT(status == GRPC_SECURITY_OK);
-  grpc_millis deadline = GPR_MS_PER_SEC + grpc_exec_ctx_now(&exec_ctx);
-
-  struct handshake_state state;
-  state.done_callback_called = false;
-  grpc_handshake_manager *handshake_mgr = grpc_handshake_manager_create();
-  grpc_server_security_connector_add_handshakers(&exec_ctx, sc, handshake_mgr);
-  grpc_handshake_manager_do_handshake(
-      &exec_ctx, handshake_mgr, mock_endpoint, NULL /* channel_args */,
-      deadline, NULL /* acceptor */, on_handshake_done, &state);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  // If the given string happens to be part of the correct client hello, the
-  // server will wait for more data. Explicitly fail the server by shutting down
-  // the endpoint.
-  if (!state.done_callback_called) {
-    grpc_endpoint_shutdown(
-        &exec_ctx, mock_endpoint,
-        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Explicit close"));
-    grpc_exec_ctx_flush(&exec_ctx);
-  }
-
-  GPR_ASSERT(state.done_callback_called);
-
-  grpc_handshake_manager_destroy(&exec_ctx, handshake_mgr);
-  GRPC_SECURITY_CONNECTOR_UNREF(&exec_ctx, &sc->base, "test");
-  grpc_server_credentials_release(creds);
-  grpc_slice_unref(cert_slice);
-  grpc_slice_unref(key_slice);
-  grpc_slice_unref(ca_slice);
-  grpc_exec_ctx_flush(&exec_ctx);
-
-  grpc_shutdown();
-  if (leak_check) {
-    counters = grpc_memory_counters_snapshot();
-    grpc_memory_counters_destroy();
-    GPR_ASSERT(counters.total_size_relative == 0);
-  }
-  return 0;
-}
diff --git a/test/core/security/ssl_server_fuzzer.cc b/test/core/security/ssl_server_fuzzer.cc
new file mode 100644
index 0000000..5c5153b
--- /dev/null
+++ b/test/core/security/ssl_server_fuzzer.cc
@@ -0,0 +1,126 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/transport/security_connector.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/util/memory_counters.h"
+#include "test/core/util/mock_endpoint.h"
+
+bool squelch = true;
+// ssl has an array of global gpr_mu's that are never released.
+// Turning this on will fail the leak check.
+bool leak_check = false;
+
+static void discard_write(grpc_slice slice) {}
+
+static void dont_log(gpr_log_func_args* args) {}
+
+struct handshake_state {
+  bool done_callback_called;
+};
+
+static void on_handshake_done(grpc_exec_ctx* exec_ctx, void* arg,
+                              grpc_error* error) {
+  grpc_handshaker_args* args = static_cast<grpc_handshaker_args*>(arg);
+  struct handshake_state* state =
+      static_cast<struct handshake_state*>(args->user_data);
+  GPR_ASSERT(state->done_callback_called == false);
+  state->done_callback_called = true;
+  // The fuzzer should not pass the handshake.
+  GPR_ASSERT(error != GRPC_ERROR_NONE);
+}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  struct grpc_memory_counters counters;
+  if (squelch) gpr_set_log_function(dont_log);
+  if (leak_check) grpc_memory_counters_init();
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  grpc_resource_quota* resource_quota =
+      grpc_resource_quota_create("ssl_server_fuzzer");
+  grpc_endpoint* mock_endpoint =
+      grpc_mock_endpoint_create(discard_write, resource_quota);
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+
+  grpc_mock_endpoint_put_read(
+      &exec_ctx, mock_endpoint,
+      grpc_slice_from_copied_buffer((const char*)data, size));
+
+  // Load key pair and establish server SSL credentials.
+  grpc_ssl_pem_key_cert_pair pem_key_cert_pair;
+  grpc_slice ca_slice, cert_slice, key_slice;
+  ca_slice = grpc_slice_from_static_string(test_root_cert);
+  cert_slice = grpc_slice_from_static_string(test_server1_cert);
+  key_slice = grpc_slice_from_static_string(test_server1_key);
+  const char* ca_cert = (const char*)GRPC_SLICE_START_PTR(ca_slice);
+  pem_key_cert_pair.private_key = (const char*)GRPC_SLICE_START_PTR(key_slice);
+  pem_key_cert_pair.cert_chain = (const char*)GRPC_SLICE_START_PTR(cert_slice);
+  grpc_server_credentials* creds = grpc_ssl_server_credentials_create(
+      ca_cert, &pem_key_cert_pair, 1, 0, NULL);
+
+  // Create security connector
+  grpc_server_security_connector* sc = NULL;
+  grpc_security_status status =
+      grpc_server_credentials_create_security_connector(&exec_ctx, creds, &sc);
+  GPR_ASSERT(status == GRPC_SECURITY_OK);
+  grpc_millis deadline = GPR_MS_PER_SEC + grpc_exec_ctx_now(&exec_ctx);
+
+  struct handshake_state state;
+  state.done_callback_called = false;
+  grpc_handshake_manager* handshake_mgr = grpc_handshake_manager_create();
+  grpc_server_security_connector_add_handshakers(&exec_ctx, sc, handshake_mgr);
+  grpc_handshake_manager_do_handshake(
+      &exec_ctx, handshake_mgr, mock_endpoint, NULL /* channel_args */,
+      deadline, NULL /* acceptor */, on_handshake_done, &state);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  // If the given string happens to be part of the correct client hello, the
+  // server will wait for more data. Explicitly fail the server by shutting down
+  // the endpoint.
+  if (!state.done_callback_called) {
+    grpc_endpoint_shutdown(
+        &exec_ctx, mock_endpoint,
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Explicit close"));
+    grpc_exec_ctx_flush(&exec_ctx);
+  }
+
+  GPR_ASSERT(state.done_callback_called);
+
+  grpc_handshake_manager_destroy(&exec_ctx, handshake_mgr);
+  GRPC_SECURITY_CONNECTOR_UNREF(&exec_ctx, &sc->base, "test");
+  grpc_server_credentials_release(creds);
+  grpc_slice_unref(cert_slice);
+  grpc_slice_unref(key_slice);
+  grpc_slice_unref(ca_slice);
+  grpc_exec_ctx_flush(&exec_ctx);
+
+  grpc_shutdown();
+  if (leak_check) {
+    counters = grpc_memory_counters_snapshot();
+    grpc_memory_counters_destroy();
+    GPR_ASSERT(counters.total_size_relative == 0);
+  }
+  return 0;
+}
diff --git a/test/core/security/verify_jwt.c b/test/core/security/verify_jwt.c
deleted file mode 100644
index cec6fb9..0000000
--- a/test/core/security/verify_jwt.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/cmdline.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#include "src/core/lib/security/credentials/jwt/jwt_verifier.h"
-
-typedef struct {
-  grpc_pollset *pollset;
-  gpr_mu *mu;
-  int is_done;
-  int success;
-} synchronizer;
-
-static void print_usage_and_exit(gpr_cmdline *cl, const char *argv0) {
-  char *usage = gpr_cmdline_usage_string(cl, argv0);
-  fprintf(stderr, "%s", usage);
-  gpr_free(usage);
-  gpr_cmdline_destroy(cl);
-  exit(1);
-}
-
-static void on_jwt_verification_done(grpc_exec_ctx *exec_ctx, void *user_data,
-                                     grpc_jwt_verifier_status status,
-                                     grpc_jwt_claims *claims) {
-  synchronizer *sync = user_data;
-
-  sync->success = (status == GRPC_JWT_VERIFIER_OK);
-  if (sync->success) {
-    char *claims_str;
-    GPR_ASSERT(claims != NULL);
-    claims_str =
-        grpc_json_dump_to_string((grpc_json *)grpc_jwt_claims_json(claims), 2);
-    printf("Claims: \n\n%s\n", claims_str);
-    gpr_free(claims_str);
-    grpc_jwt_claims_destroy(exec_ctx, claims);
-  } else {
-    GPR_ASSERT(claims == NULL);
-    fprintf(stderr, "Verification failed with error %s\n",
-            grpc_jwt_verifier_status_to_string(status));
-  }
-
-  gpr_mu_lock(sync->mu);
-  sync->is_done = 1;
-  GRPC_LOG_IF_ERROR("pollset_kick",
-                    grpc_pollset_kick(exec_ctx, sync->pollset, NULL));
-  gpr_mu_unlock(sync->mu);
-}
-
-int main(int argc, char **argv) {
-  synchronizer sync;
-  grpc_jwt_verifier *verifier;
-  gpr_cmdline *cl;
-  char *jwt = NULL;
-  char *aud = NULL;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  grpc_init();
-  cl = gpr_cmdline_create("JWT verifier tool");
-  gpr_cmdline_add_string(cl, "jwt", "JSON web token to verify", &jwt);
-  gpr_cmdline_add_string(cl, "aud", "Audience for the JWT", &aud);
-  gpr_cmdline_parse(cl, argc, argv);
-  if (jwt == NULL || aud == NULL) {
-    print_usage_and_exit(cl, argv[0]);
-  }
-
-  verifier = grpc_jwt_verifier_create(NULL, 0);
-
-  grpc_init();
-
-  sync.pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(sync.pollset, &sync.mu);
-  sync.is_done = 0;
-
-  grpc_jwt_verifier_verify(&exec_ctx, verifier, sync.pollset, jwt, aud,
-                           on_jwt_verification_done, &sync);
-
-  gpr_mu_lock(sync.mu);
-  while (!sync.is_done) {
-    grpc_pollset_worker *worker = NULL;
-    if (!GRPC_LOG_IF_ERROR("pollset_work",
-                           grpc_pollset_work(&exec_ctx, sync.pollset, &worker,
-                                             GRPC_MILLIS_INF_FUTURE)))
-      sync.is_done = true;
-    gpr_mu_unlock(sync.mu);
-    grpc_exec_ctx_flush(&exec_ctx);
-    gpr_mu_lock(sync.mu);
-  }
-  gpr_mu_unlock(sync.mu);
-
-  gpr_free(sync.pollset);
-
-  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_cmdline_destroy(cl);
-  grpc_shutdown();
-  return !sync.success;
-}
diff --git a/test/core/security/verify_jwt.cc b/test/core/security/verify_jwt.cc
new file mode 100644
index 0000000..e0e22d1
--- /dev/null
+++ b/test/core/security/verify_jwt.cc
@@ -0,0 +1,122 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/cmdline.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/security/credentials/jwt/jwt_verifier.h"
+
+typedef struct {
+  grpc_pollset* pollset;
+  gpr_mu* mu;
+  int is_done;
+  int success;
+} synchronizer;
+
+static void print_usage_and_exit(gpr_cmdline* cl, const char* argv0) {
+  char* usage = gpr_cmdline_usage_string(cl, argv0);
+  fprintf(stderr, "%s", usage);
+  gpr_free(usage);
+  gpr_cmdline_destroy(cl);
+  exit(1);
+}
+
+static void on_jwt_verification_done(grpc_exec_ctx* exec_ctx, void* user_data,
+                                     grpc_jwt_verifier_status status,
+                                     grpc_jwt_claims* claims) {
+  synchronizer* sync = static_cast<synchronizer*>(user_data);
+
+  sync->success = (status == GRPC_JWT_VERIFIER_OK);
+  if (sync->success) {
+    char* claims_str;
+    GPR_ASSERT(claims != NULL);
+    claims_str =
+        grpc_json_dump_to_string((grpc_json*)grpc_jwt_claims_json(claims), 2);
+    printf("Claims: \n\n%s\n", claims_str);
+    gpr_free(claims_str);
+    grpc_jwt_claims_destroy(exec_ctx, claims);
+  } else {
+    GPR_ASSERT(claims == NULL);
+    fprintf(stderr, "Verification failed with error %s\n",
+            grpc_jwt_verifier_status_to_string(status));
+  }
+
+  gpr_mu_lock(sync->mu);
+  sync->is_done = 1;
+  GRPC_LOG_IF_ERROR("pollset_kick",
+                    grpc_pollset_kick(exec_ctx, sync->pollset, NULL));
+  gpr_mu_unlock(sync->mu);
+}
+
+int main(int argc, char** argv) {
+  synchronizer sync;
+  grpc_jwt_verifier* verifier;
+  gpr_cmdline* cl;
+  const char* jwt = NULL;
+  const char* aud = NULL;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  grpc_init();
+  cl = gpr_cmdline_create("JWT verifier tool");
+  gpr_cmdline_add_string(cl, "jwt", "JSON web token to verify", &jwt);
+  gpr_cmdline_add_string(cl, "aud", "Audience for the JWT", &aud);
+  gpr_cmdline_parse(cl, argc, argv);
+  if (jwt == NULL || aud == NULL) {
+    print_usage_and_exit(cl, argv[0]);
+  }
+
+  verifier = grpc_jwt_verifier_create(NULL, 0);
+
+  grpc_init();
+
+  sync.pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(sync.pollset, &sync.mu);
+  sync.is_done = 0;
+
+  grpc_jwt_verifier_verify(&exec_ctx, verifier, sync.pollset, jwt, aud,
+                           on_jwt_verification_done, &sync);
+
+  gpr_mu_lock(sync.mu);
+  while (!sync.is_done) {
+    grpc_pollset_worker* worker = NULL;
+    if (!GRPC_LOG_IF_ERROR("pollset_work",
+                           grpc_pollset_work(&exec_ctx, sync.pollset, &worker,
+                                             GRPC_MILLIS_INF_FUTURE)))
+      sync.is_done = true;
+    gpr_mu_unlock(sync.mu);
+    grpc_exec_ctx_flush(&exec_ctx);
+    gpr_mu_lock(sync.mu);
+  }
+  gpr_mu_unlock(sync.mu);
+
+  gpr_free(sync.pollset);
+
+  grpc_jwt_verifier_destroy(&exec_ctx, verifier);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_cmdline_destroy(cl);
+  grpc_shutdown();
+  return !sync.success;
+}
diff --git a/test/core/slice/BUILD b/test/core/slice/BUILD
index ad2308a..ba2b553 100644
--- a/test/core/slice/BUILD
+++ b/test/core/slice/BUILD
@@ -22,8 +22,8 @@
 
 grpc_fuzzer(
     name = "percent_encode_fuzzer",
-    srcs = ["percent_encode_fuzzer.c"],
-    language = "C",
+    srcs = ["percent_encode_fuzzer.cc"],
+    language = "C++",
     corpus = "percent_encode_corpus",
     deps = [
         "//:gpr",
@@ -34,8 +34,8 @@
 
 grpc_fuzzer(
     name = "percent_decode_fuzzer",
-    srcs = ["percent_decode_fuzzer.c"],
-    language = "C",
+    srcs = ["percent_decode_fuzzer.cc"],
+    language = "C++",
     corpus = "percent_decode_corpus",
     deps = [
         "//:gpr",
@@ -46,8 +46,8 @@
 
 grpc_cc_test(
     name = "percent_encoding_test",
-    srcs = ["percent_encoding_test.c"],
-    language = "C",
+    srcs = ["percent_encoding_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -58,15 +58,15 @@
 
 grpc_cc_test(
     name = "slice_test",
-    srcs = ["slice_test.c"],
+    srcs = ["slice_test.cc"],
     deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
-    language = "C",
+    language = "C++",
 )
 
 grpc_cc_test(
     name = "slice_string_helpers_test",
-    srcs = ["slice_string_helpers_test.c"],
-    language = "C",
+    srcs = ["slice_string_helpers_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -77,22 +77,22 @@
 
 grpc_cc_test(
     name = "slice_buffer_test",
-    srcs = ["slice_buffer_test.c"],
+    srcs = ["slice_buffer_test.cc"],
     deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
-    language = "C",
+    language = "C++",
 )
 
 grpc_cc_test(
     name = "slice_hash_table_test",
-    srcs = ["slice_hash_table_test.c"],
+    srcs = ["slice_hash_table_test.cc"],
     deps = ["//:grpc", "//test/core/util:grpc_test_util", "//:gpr", "//test/core/util:gpr_test_util"],
-    language = "C",
+    language = "C++",
 )
 
 grpc_cc_test(
     name = "b64_test",
-    srcs = ["b64_test.c"],
-    language = "C",
+    srcs = ["b64_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/slice/b64_test.c b/test/core/slice/b64_test.c
deleted file mode 100644
index bd375aa..0000000
--- a/test/core/slice/b64_test.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/slice/b64.h"
-
-#include <string.h>
-
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "test/core/util/test_config.h"
-
-static int buffers_are_equal(const unsigned char *buf1,
-                             const unsigned char *buf2, size_t size) {
-  size_t i;
-  for (i = 0; i < size; i++) {
-    if (buf1[i] != buf2[i]) {
-      gpr_log(GPR_ERROR, "buf1 and buf2 differ: buf1[%d] = %x vs buf2[%d] = %x",
-              (int)i, buf1[i], (int)i, buf2[i]);
-      return 0;
-    }
-  }
-  return 1;
-}
-
-static void test_simple_encode_decode_b64(int url_safe, int multiline) {
-  const char *hello = "hello";
-  char *hello_b64 =
-      grpc_base64_encode(hello, strlen(hello), url_safe, multiline);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_slice hello_slice = grpc_base64_decode(&exec_ctx, hello_b64, url_safe);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(hello_slice) == strlen(hello));
-  GPR_ASSERT(strncmp((const char *)GRPC_SLICE_START_PTR(hello_slice), hello,
-                     GRPC_SLICE_LENGTH(hello_slice)) == 0);
-
-  grpc_slice_unref_internal(&exec_ctx, hello_slice);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(hello_b64);
-}
-
-static void test_full_range_encode_decode_b64(int url_safe, int multiline) {
-  unsigned char orig[256];
-  size_t i;
-  char *b64;
-  grpc_slice orig_decoded;
-  for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i;
-
-  /* Try all the different paddings. */
-  for (i = 0; i < 3; i++) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    b64 = grpc_base64_encode(orig, sizeof(orig) - i, url_safe, multiline);
-    orig_decoded = grpc_base64_decode(&exec_ctx, b64, url_safe);
-    GPR_ASSERT(GRPC_SLICE_LENGTH(orig_decoded) == (sizeof(orig) - i));
-    GPR_ASSERT(buffers_are_equal(orig, GRPC_SLICE_START_PTR(orig_decoded),
-                                 sizeof(orig) - i));
-    grpc_slice_unref_internal(&exec_ctx, orig_decoded);
-    gpr_free(b64);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static void test_simple_encode_decode_b64_no_multiline(void) {
-  test_simple_encode_decode_b64(0, 0);
-}
-
-static void test_simple_encode_decode_b64_multiline(void) {
-  test_simple_encode_decode_b64(0, 1);
-}
-
-static void test_simple_encode_decode_b64_urlsafe_no_multiline(void) {
-  test_simple_encode_decode_b64(1, 0);
-}
-
-static void test_simple_encode_decode_b64_urlsafe_multiline(void) {
-  test_simple_encode_decode_b64(1, 1);
-}
-
-static void test_full_range_encode_decode_b64_no_multiline(void) {
-  test_full_range_encode_decode_b64(0, 0);
-}
-
-static void test_full_range_encode_decode_b64_multiline(void) {
-  test_full_range_encode_decode_b64(0, 1);
-}
-
-static void test_full_range_encode_decode_b64_urlsafe_no_multiline(void) {
-  test_full_range_encode_decode_b64(1, 0);
-}
-
-static void test_full_range_encode_decode_b64_urlsafe_multiline(void) {
-  test_full_range_encode_decode_b64(1, 1);
-}
-
-static void test_url_safe_unsafe_mismatch_failure(void) {
-  unsigned char orig[256];
-  size_t i;
-  char *b64;
-  grpc_slice orig_decoded;
-  int url_safe = 1;
-  for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i;
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  b64 = grpc_base64_encode(orig, sizeof(orig), url_safe, 0);
-  orig_decoded = grpc_base64_decode(&exec_ctx, b64, !url_safe);
-  GPR_ASSERT(GRPC_SLICE_IS_EMPTY(orig_decoded));
-  gpr_free(b64);
-  grpc_slice_unref_internal(&exec_ctx, orig_decoded);
-
-  b64 = grpc_base64_encode(orig, sizeof(orig), !url_safe, 0);
-  orig_decoded = grpc_base64_decode(&exec_ctx, b64, url_safe);
-  GPR_ASSERT(GRPC_SLICE_IS_EMPTY(orig_decoded));
-  gpr_free(b64);
-  grpc_slice_unref_internal(&exec_ctx, orig_decoded);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_rfc4648_test_vectors(void) {
-  char *b64;
-
-  b64 = grpc_base64_encode("", 0, 0, 0);
-  GPR_ASSERT(strcmp("", b64) == 0);
-  gpr_free(b64);
-
-  b64 = grpc_base64_encode("f", 1, 0, 0);
-  GPR_ASSERT(strcmp("Zg==", b64) == 0);
-  gpr_free(b64);
-
-  b64 = grpc_base64_encode("fo", 2, 0, 0);
-  GPR_ASSERT(strcmp("Zm8=", b64) == 0);
-  gpr_free(b64);
-
-  b64 = grpc_base64_encode("foo", 3, 0, 0);
-  GPR_ASSERT(strcmp("Zm9v", b64) == 0);
-  gpr_free(b64);
-
-  b64 = grpc_base64_encode("foob", 4, 0, 0);
-  GPR_ASSERT(strcmp("Zm9vYg==", b64) == 0);
-  gpr_free(b64);
-
-  b64 = grpc_base64_encode("fooba", 5, 0, 0);
-  GPR_ASSERT(strcmp("Zm9vYmE=", b64) == 0);
-  gpr_free(b64);
-
-  b64 = grpc_base64_encode("foobar", 6, 0, 0);
-  GPR_ASSERT(strcmp("Zm9vYmFy", b64) == 0);
-  gpr_free(b64);
-}
-
-static void test_unpadded_decode(void) {
-  grpc_slice decoded;
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  decoded = grpc_base64_decode(&exec_ctx, "Zm9vYmFy", 0);
-  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
-  GPR_ASSERT(grpc_slice_str_cmp(decoded, "foobar") == 0);
-  grpc_slice_unref(decoded);
-
-  decoded = grpc_base64_decode(&exec_ctx, "Zm9vYmE", 0);
-  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
-  GPR_ASSERT(grpc_slice_str_cmp(decoded, "fooba") == 0);
-  grpc_slice_unref(decoded);
-
-  decoded = grpc_base64_decode(&exec_ctx, "Zm9vYg", 0);
-  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
-  GPR_ASSERT(grpc_slice_str_cmp(decoded, "foob") == 0);
-  grpc_slice_unref(decoded);
-
-  decoded = grpc_base64_decode(&exec_ctx, "Zm9v", 0);
-  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
-  GPR_ASSERT(grpc_slice_str_cmp(decoded, "foo") == 0);
-  grpc_slice_unref(decoded);
-
-  decoded = grpc_base64_decode(&exec_ctx, "Zm8", 0);
-  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
-  GPR_ASSERT(grpc_slice_str_cmp(decoded, "fo") == 0);
-  grpc_slice_unref(decoded);
-
-  decoded = grpc_base64_decode(&exec_ctx, "Zg", 0);
-  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
-  GPR_ASSERT(grpc_slice_str_cmp(decoded, "f") == 0);
-  grpc_slice_unref(decoded);
-
-  decoded = grpc_base64_decode(&exec_ctx, "", 0);
-  GPR_ASSERT(GRPC_SLICE_IS_EMPTY(decoded));
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_simple_encode_decode_b64_no_multiline();
-  test_simple_encode_decode_b64_multiline();
-  test_simple_encode_decode_b64_urlsafe_no_multiline();
-  test_simple_encode_decode_b64_urlsafe_multiline();
-  test_full_range_encode_decode_b64_no_multiline();
-  test_full_range_encode_decode_b64_multiline();
-  test_full_range_encode_decode_b64_urlsafe_no_multiline();
-  test_full_range_encode_decode_b64_urlsafe_multiline();
-  test_url_safe_unsafe_mismatch_failure();
-  test_rfc4648_test_vectors();
-  test_unpadded_decode();
-  return 0;
-}
diff --git a/test/core/slice/b64_test.cc b/test/core/slice/b64_test.cc
new file mode 100644
index 0000000..479198f
--- /dev/null
+++ b/test/core/slice/b64_test.cc
@@ -0,0 +1,219 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/slice/b64.h"
+
+#include <string.h>
+
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "test/core/util/test_config.h"
+
+static int buffers_are_equal(const unsigned char* buf1,
+                             const unsigned char* buf2, size_t size) {
+  size_t i;
+  for (i = 0; i < size; i++) {
+    if (buf1[i] != buf2[i]) {
+      gpr_log(GPR_ERROR, "buf1 and buf2 differ: buf1[%d] = %x vs buf2[%d] = %x",
+              (int)i, buf1[i], (int)i, buf2[i]);
+      return 0;
+    }
+  }
+  return 1;
+}
+
+static void test_simple_encode_decode_b64(int url_safe, int multiline) {
+  const char* hello = "hello";
+  char* hello_b64 =
+      grpc_base64_encode(hello, strlen(hello), url_safe, multiline);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_slice hello_slice = grpc_base64_decode(&exec_ctx, hello_b64, url_safe);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(hello_slice) == strlen(hello));
+  GPR_ASSERT(strncmp((const char*)GRPC_SLICE_START_PTR(hello_slice), hello,
+                     GRPC_SLICE_LENGTH(hello_slice)) == 0);
+
+  grpc_slice_unref_internal(&exec_ctx, hello_slice);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(hello_b64);
+}
+
+static void test_full_range_encode_decode_b64(int url_safe, int multiline) {
+  unsigned char orig[256];
+  size_t i;
+  char* b64;
+  grpc_slice orig_decoded;
+  for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i;
+
+  /* Try all the different paddings. */
+  for (i = 0; i < 3; i++) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    b64 = grpc_base64_encode(orig, sizeof(orig) - i, url_safe, multiline);
+    orig_decoded = grpc_base64_decode(&exec_ctx, b64, url_safe);
+    GPR_ASSERT(GRPC_SLICE_LENGTH(orig_decoded) == (sizeof(orig) - i));
+    GPR_ASSERT(buffers_are_equal(orig, GRPC_SLICE_START_PTR(orig_decoded),
+                                 sizeof(orig) - i));
+    grpc_slice_unref_internal(&exec_ctx, orig_decoded);
+    gpr_free(b64);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_simple_encode_decode_b64_no_multiline(void) {
+  test_simple_encode_decode_b64(0, 0);
+}
+
+static void test_simple_encode_decode_b64_multiline(void) {
+  test_simple_encode_decode_b64(0, 1);
+}
+
+static void test_simple_encode_decode_b64_urlsafe_no_multiline(void) {
+  test_simple_encode_decode_b64(1, 0);
+}
+
+static void test_simple_encode_decode_b64_urlsafe_multiline(void) {
+  test_simple_encode_decode_b64(1, 1);
+}
+
+static void test_full_range_encode_decode_b64_no_multiline(void) {
+  test_full_range_encode_decode_b64(0, 0);
+}
+
+static void test_full_range_encode_decode_b64_multiline(void) {
+  test_full_range_encode_decode_b64(0, 1);
+}
+
+static void test_full_range_encode_decode_b64_urlsafe_no_multiline(void) {
+  test_full_range_encode_decode_b64(1, 0);
+}
+
+static void test_full_range_encode_decode_b64_urlsafe_multiline(void) {
+  test_full_range_encode_decode_b64(1, 1);
+}
+
+static void test_url_safe_unsafe_mismatch_failure(void) {
+  unsigned char orig[256];
+  size_t i;
+  char* b64;
+  grpc_slice orig_decoded;
+  int url_safe = 1;
+  for (i = 0; i < sizeof(orig); i++) orig[i] = (uint8_t)i;
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  b64 = grpc_base64_encode(orig, sizeof(orig), url_safe, 0);
+  orig_decoded = grpc_base64_decode(&exec_ctx, b64, !url_safe);
+  GPR_ASSERT(GRPC_SLICE_IS_EMPTY(orig_decoded));
+  gpr_free(b64);
+  grpc_slice_unref_internal(&exec_ctx, orig_decoded);
+
+  b64 = grpc_base64_encode(orig, sizeof(orig), !url_safe, 0);
+  orig_decoded = grpc_base64_decode(&exec_ctx, b64, url_safe);
+  GPR_ASSERT(GRPC_SLICE_IS_EMPTY(orig_decoded));
+  gpr_free(b64);
+  grpc_slice_unref_internal(&exec_ctx, orig_decoded);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_rfc4648_test_vectors(void) {
+  char* b64;
+
+  b64 = grpc_base64_encode("", 0, 0, 0);
+  GPR_ASSERT(strcmp("", b64) == 0);
+  gpr_free(b64);
+
+  b64 = grpc_base64_encode("f", 1, 0, 0);
+  GPR_ASSERT(strcmp("Zg==", b64) == 0);
+  gpr_free(b64);
+
+  b64 = grpc_base64_encode("fo", 2, 0, 0);
+  GPR_ASSERT(strcmp("Zm8=", b64) == 0);
+  gpr_free(b64);
+
+  b64 = grpc_base64_encode("foo", 3, 0, 0);
+  GPR_ASSERT(strcmp("Zm9v", b64) == 0);
+  gpr_free(b64);
+
+  b64 = grpc_base64_encode("foob", 4, 0, 0);
+  GPR_ASSERT(strcmp("Zm9vYg==", b64) == 0);
+  gpr_free(b64);
+
+  b64 = grpc_base64_encode("fooba", 5, 0, 0);
+  GPR_ASSERT(strcmp("Zm9vYmE=", b64) == 0);
+  gpr_free(b64);
+
+  b64 = grpc_base64_encode("foobar", 6, 0, 0);
+  GPR_ASSERT(strcmp("Zm9vYmFy", b64) == 0);
+  gpr_free(b64);
+}
+
+static void test_unpadded_decode(void) {
+  grpc_slice decoded;
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  decoded = grpc_base64_decode(&exec_ctx, "Zm9vYmFy", 0);
+  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
+  GPR_ASSERT(grpc_slice_str_cmp(decoded, "foobar") == 0);
+  grpc_slice_unref(decoded);
+
+  decoded = grpc_base64_decode(&exec_ctx, "Zm9vYmE", 0);
+  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
+  GPR_ASSERT(grpc_slice_str_cmp(decoded, "fooba") == 0);
+  grpc_slice_unref(decoded);
+
+  decoded = grpc_base64_decode(&exec_ctx, "Zm9vYg", 0);
+  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
+  GPR_ASSERT(grpc_slice_str_cmp(decoded, "foob") == 0);
+  grpc_slice_unref(decoded);
+
+  decoded = grpc_base64_decode(&exec_ctx, "Zm9v", 0);
+  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
+  GPR_ASSERT(grpc_slice_str_cmp(decoded, "foo") == 0);
+  grpc_slice_unref(decoded);
+
+  decoded = grpc_base64_decode(&exec_ctx, "Zm8", 0);
+  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
+  GPR_ASSERT(grpc_slice_str_cmp(decoded, "fo") == 0);
+  grpc_slice_unref(decoded);
+
+  decoded = grpc_base64_decode(&exec_ctx, "Zg", 0);
+  GPR_ASSERT(!GRPC_SLICE_IS_EMPTY(decoded));
+  GPR_ASSERT(grpc_slice_str_cmp(decoded, "f") == 0);
+  grpc_slice_unref(decoded);
+
+  decoded = grpc_base64_decode(&exec_ctx, "", 0);
+  GPR_ASSERT(GRPC_SLICE_IS_EMPTY(decoded));
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_simple_encode_decode_b64_no_multiline();
+  test_simple_encode_decode_b64_multiline();
+  test_simple_encode_decode_b64_urlsafe_no_multiline();
+  test_simple_encode_decode_b64_urlsafe_multiline();
+  test_full_range_encode_decode_b64_no_multiline();
+  test_full_range_encode_decode_b64_multiline();
+  test_full_range_encode_decode_b64_urlsafe_no_multiline();
+  test_full_range_encode_decode_b64_urlsafe_multiline();
+  test_url_safe_unsafe_mismatch_failure();
+  test_rfc4648_test_vectors();
+  test_unpadded_decode();
+  return 0;
+}
diff --git a/test/core/slice/percent_decode_fuzzer.c b/test/core/slice/percent_decode_fuzzer.c
deleted file mode 100644
index ad4e3fe..0000000
--- a/test/core/slice/percent_decode_fuzzer.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/slice/percent_encoding.h"
-#include "test/core/util/memory_counters.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  struct grpc_memory_counters counters;
-  grpc_memory_counters_init();
-  grpc_slice input = grpc_slice_from_copied_buffer((const char *)data, size);
-  grpc_slice output;
-  if (grpc_strict_percent_decode_slice(
-          input, grpc_url_percent_encoding_unreserved_bytes, &output)) {
-    grpc_slice_unref(output);
-  }
-  if (grpc_strict_percent_decode_slice(
-          input, grpc_compatible_percent_encoding_unreserved_bytes, &output)) {
-    grpc_slice_unref(output);
-  }
-  grpc_slice_unref(grpc_permissive_percent_decode_slice(input));
-  grpc_slice_unref(input);
-  counters = grpc_memory_counters_snapshot();
-  grpc_memory_counters_destroy();
-  GPR_ASSERT(counters.total_size_relative == 0);
-  return 0;
-}
diff --git a/test/core/slice/percent_decode_fuzzer.cc b/test/core/slice/percent_decode_fuzzer.cc
new file mode 100644
index 0000000..3603177
--- /dev/null
+++ b/test/core/slice/percent_decode_fuzzer.cc
@@ -0,0 +1,51 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/slice/percent_encoding.h"
+#include "test/core/util/memory_counters.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  struct grpc_memory_counters counters;
+  grpc_memory_counters_init();
+  grpc_slice input = grpc_slice_from_copied_buffer((const char*)data, size);
+  grpc_slice output;
+  if (grpc_strict_percent_decode_slice(
+          input, grpc_url_percent_encoding_unreserved_bytes, &output)) {
+    grpc_slice_unref(output);
+  }
+  if (grpc_strict_percent_decode_slice(
+          input, grpc_compatible_percent_encoding_unreserved_bytes, &output)) {
+    grpc_slice_unref(output);
+  }
+  grpc_slice_unref(grpc_permissive_percent_decode_slice(input));
+  grpc_slice_unref(input);
+  counters = grpc_memory_counters_snapshot();
+  grpc_memory_counters_destroy();
+  GPR_ASSERT(counters.total_size_relative == 0);
+  return 0;
+}
diff --git a/test/core/slice/percent_encode_fuzzer.c b/test/core/slice/percent_encode_fuzzer.c
deleted file mode 100644
index db3dc3b..0000000
--- a/test/core/slice/percent_encode_fuzzer.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/slice/percent_encoding.h"
-#include "test/core/util/memory_counters.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-static void test(const uint8_t *data, size_t size, const uint8_t *dict) {
-  struct grpc_memory_counters counters;
-  grpc_memory_counters_init();
-  grpc_slice input = grpc_slice_from_copied_buffer((const char *)data, size);
-  grpc_slice output = grpc_percent_encode_slice(input, dict);
-  grpc_slice decoded_output;
-  // encoder must always produce decodable output
-  GPR_ASSERT(grpc_strict_percent_decode_slice(output, dict, &decoded_output));
-  grpc_slice permissive_decoded_output =
-      grpc_permissive_percent_decode_slice(output);
-  // and decoded output must always match the input
-  GPR_ASSERT(grpc_slice_eq(input, decoded_output));
-  GPR_ASSERT(grpc_slice_eq(input, permissive_decoded_output));
-  grpc_slice_unref(input);
-  grpc_slice_unref(output);
-  grpc_slice_unref(decoded_output);
-  grpc_slice_unref(permissive_decoded_output);
-  counters = grpc_memory_counters_snapshot();
-  grpc_memory_counters_destroy();
-  GPR_ASSERT(counters.total_size_relative == 0);
-}
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  test(data, size, grpc_url_percent_encoding_unreserved_bytes);
-  test(data, size, grpc_compatible_percent_encoding_unreserved_bytes);
-  return 0;
-}
diff --git a/test/core/slice/percent_encode_fuzzer.cc b/test/core/slice/percent_encode_fuzzer.cc
new file mode 100644
index 0000000..c8e3849
--- /dev/null
+++ b/test/core/slice/percent_encode_fuzzer.cc
@@ -0,0 +1,58 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/slice/percent_encoding.h"
+#include "test/core/util/memory_counters.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+static void test(const uint8_t* data, size_t size, const uint8_t* dict) {
+  struct grpc_memory_counters counters;
+  grpc_memory_counters_init();
+  grpc_slice input = grpc_slice_from_copied_buffer((const char*)data, size);
+  grpc_slice output = grpc_percent_encode_slice(input, dict);
+  grpc_slice decoded_output;
+  // encoder must always produce decodable output
+  GPR_ASSERT(grpc_strict_percent_decode_slice(output, dict, &decoded_output));
+  grpc_slice permissive_decoded_output =
+      grpc_permissive_percent_decode_slice(output);
+  // and decoded output must always match the input
+  GPR_ASSERT(grpc_slice_eq(input, decoded_output));
+  GPR_ASSERT(grpc_slice_eq(input, permissive_decoded_output));
+  grpc_slice_unref(input);
+  grpc_slice_unref(output);
+  grpc_slice_unref(decoded_output);
+  grpc_slice_unref(permissive_decoded_output);
+  counters = grpc_memory_counters_snapshot();
+  grpc_memory_counters_destroy();
+  GPR_ASSERT(counters.total_size_relative == 0);
+}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  test(data, size, grpc_url_percent_encoding_unreserved_bytes);
+  test(data, size, grpc_compatible_percent_encoding_unreserved_bytes);
+  return 0;
+}
diff --git a/test/core/slice/percent_encoding_test.c b/test/core/slice/percent_encoding_test.c
deleted file mode 100644
index fcc8d33..0000000
--- a/test/core/slice/percent_encoding_test.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/slice/percent_encoding.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/util/test_config.h"
-
-#define TEST_VECTOR(raw, encoded, dict) \
-  test_vector(raw, sizeof(raw) - 1, encoded, sizeof(encoded) - 1, dict)
-
-#define TEST_NONCONFORMANT_VECTOR(encoded, permissive_unencoded, dict) \
-  test_nonconformant_vector(encoded, sizeof(encoded) - 1,              \
-                            permissive_unencoded,                      \
-                            sizeof(permissive_unencoded) - 1, dict)
-
-static void test_vector(const char *raw, size_t raw_length, const char *encoded,
-                        size_t encoded_length, const uint8_t *dict) {
-  char *raw_msg = gpr_dump(raw, raw_length, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-  char *encoded_msg =
-      gpr_dump(encoded, encoded_length, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-  gpr_log(GPR_DEBUG, "Trial:\nraw = %s\nencoded = %s", raw_msg, encoded_msg);
-  gpr_free(raw_msg);
-  gpr_free(encoded_msg);
-
-  grpc_slice raw_slice = grpc_slice_from_copied_buffer(raw, raw_length);
-  grpc_slice encoded_slice =
-      grpc_slice_from_copied_buffer(encoded, encoded_length);
-  grpc_slice raw2encoded_slice = grpc_percent_encode_slice(raw_slice, dict);
-  grpc_slice encoded2raw_slice;
-  GPR_ASSERT(grpc_strict_percent_decode_slice(encoded_slice, dict,
-                                              &encoded2raw_slice));
-  grpc_slice encoded2raw_permissive_slice =
-      grpc_permissive_percent_decode_slice(encoded_slice);
-
-  char *raw2encoded_msg =
-      grpc_dump_slice(raw2encoded_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-  char *encoded2raw_msg =
-      grpc_dump_slice(encoded2raw_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-  char *encoded2raw_permissive_msg = grpc_dump_slice(
-      encoded2raw_permissive_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-  gpr_log(GPR_DEBUG,
-          "Result:\nraw2encoded = %s\nencoded2raw = %s\nencoded2raw_permissive "
-          "= %s",
-          raw2encoded_msg, encoded2raw_msg, encoded2raw_permissive_msg);
-  gpr_free(raw2encoded_msg);
-  gpr_free(encoded2raw_msg);
-  gpr_free(encoded2raw_permissive_msg);
-
-  GPR_ASSERT(grpc_slice_eq(raw_slice, encoded2raw_slice));
-  GPR_ASSERT(grpc_slice_eq(raw_slice, encoded2raw_permissive_slice));
-  GPR_ASSERT(grpc_slice_eq(encoded_slice, raw2encoded_slice));
-
-  grpc_slice_unref(encoded2raw_slice);
-  grpc_slice_unref(encoded2raw_permissive_slice);
-  grpc_slice_unref(raw2encoded_slice);
-  grpc_slice_unref(raw_slice);
-  grpc_slice_unref(encoded_slice);
-}
-
-static void test_nonconformant_vector(const char *encoded,
-                                      size_t encoded_length,
-                                      const char *permissive_unencoded,
-                                      size_t permissive_unencoded_length,
-                                      const uint8_t *dict) {
-  char *permissive_unencoded_msg =
-      gpr_dump(permissive_unencoded, permissive_unencoded_length,
-               GPR_DUMP_HEX | GPR_DUMP_ASCII);
-  char *encoded_msg =
-      gpr_dump(encoded, encoded_length, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-  gpr_log(GPR_DEBUG, "Trial:\nraw = %s\nencoded = %s", permissive_unencoded_msg,
-          encoded_msg);
-  gpr_free(permissive_unencoded_msg);
-  gpr_free(encoded_msg);
-
-  grpc_slice permissive_unencoded_slice = grpc_slice_from_copied_buffer(
-      permissive_unencoded, permissive_unencoded_length);
-  grpc_slice encoded_slice =
-      grpc_slice_from_copied_buffer(encoded, encoded_length);
-  grpc_slice encoded2raw_slice;
-  GPR_ASSERT(!grpc_strict_percent_decode_slice(encoded_slice, dict,
-                                               &encoded2raw_slice));
-  grpc_slice encoded2raw_permissive_slice =
-      grpc_permissive_percent_decode_slice(encoded_slice);
-
-  char *encoded2raw_permissive_msg = grpc_dump_slice(
-      encoded2raw_permissive_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-  gpr_log(GPR_DEBUG, "Result:\nencoded2raw_permissive = %s",
-          encoded2raw_permissive_msg);
-  gpr_free(encoded2raw_permissive_msg);
-
-  GPR_ASSERT(
-      grpc_slice_eq(permissive_unencoded_slice, encoded2raw_permissive_slice));
-
-  grpc_slice_unref(permissive_unencoded_slice);
-  grpc_slice_unref(encoded2raw_permissive_slice);
-  grpc_slice_unref(encoded_slice);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  TEST_VECTOR(
-      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~",
-      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~",
-      grpc_url_percent_encoding_unreserved_bytes);
-  TEST_VECTOR("\x00", "%00", grpc_url_percent_encoding_unreserved_bytes);
-  TEST_VECTOR("\x01", "%01", grpc_url_percent_encoding_unreserved_bytes);
-  TEST_VECTOR("a b", "a%20b", grpc_url_percent_encoding_unreserved_bytes);
-  TEST_VECTOR(" b", "%20b", grpc_url_percent_encoding_unreserved_bytes);
-  TEST_VECTOR("a b", "a b", grpc_compatible_percent_encoding_unreserved_bytes);
-  TEST_VECTOR(" b", " b", grpc_compatible_percent_encoding_unreserved_bytes);
-  TEST_VECTOR("\x0f", "%0F", grpc_url_percent_encoding_unreserved_bytes);
-  TEST_VECTOR("\xff", "%FF", grpc_url_percent_encoding_unreserved_bytes);
-  TEST_VECTOR("\xee", "%EE", grpc_url_percent_encoding_unreserved_bytes);
-  TEST_VECTOR("%2", "%252", grpc_url_percent_encoding_unreserved_bytes);
-  TEST_NONCONFORMANT_VECTOR("%", "%",
-                            grpc_url_percent_encoding_unreserved_bytes);
-  TEST_NONCONFORMANT_VECTOR("%A", "%A",
-                            grpc_url_percent_encoding_unreserved_bytes);
-  TEST_NONCONFORMANT_VECTOR("%AG", "%AG",
-                            grpc_url_percent_encoding_unreserved_bytes);
-  TEST_NONCONFORMANT_VECTOR("\0", "\0",
-                            grpc_url_percent_encoding_unreserved_bytes);
-  return 0;
-}
diff --git a/test/core/slice/percent_encoding_test.cc b/test/core/slice/percent_encoding_test.cc
new file mode 100644
index 0000000..253240f
--- /dev/null
+++ b/test/core/slice/percent_encoding_test.cc
@@ -0,0 +1,144 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/slice/percent_encoding.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/util/test_config.h"
+
+#define TEST_VECTOR(raw, encoded, dict) \
+  test_vector(raw, sizeof(raw) - 1, encoded, sizeof(encoded) - 1, dict)
+
+#define TEST_NONCONFORMANT_VECTOR(encoded, permissive_unencoded, dict) \
+  test_nonconformant_vector(encoded, sizeof(encoded) - 1,              \
+                            permissive_unencoded,                      \
+                            sizeof(permissive_unencoded) - 1, dict)
+
+static void test_vector(const char* raw, size_t raw_length, const char* encoded,
+                        size_t encoded_length, const uint8_t* dict) {
+  char* raw_msg = gpr_dump(raw, raw_length, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+  char* encoded_msg =
+      gpr_dump(encoded, encoded_length, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+  gpr_log(GPR_DEBUG, "Trial:\nraw = %s\nencoded = %s", raw_msg, encoded_msg);
+  gpr_free(raw_msg);
+  gpr_free(encoded_msg);
+
+  grpc_slice raw_slice = grpc_slice_from_copied_buffer(raw, raw_length);
+  grpc_slice encoded_slice =
+      grpc_slice_from_copied_buffer(encoded, encoded_length);
+  grpc_slice raw2encoded_slice = grpc_percent_encode_slice(raw_slice, dict);
+  grpc_slice encoded2raw_slice;
+  GPR_ASSERT(grpc_strict_percent_decode_slice(encoded_slice, dict,
+                                              &encoded2raw_slice));
+  grpc_slice encoded2raw_permissive_slice =
+      grpc_permissive_percent_decode_slice(encoded_slice);
+
+  char* raw2encoded_msg =
+      grpc_dump_slice(raw2encoded_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+  char* encoded2raw_msg =
+      grpc_dump_slice(encoded2raw_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+  char* encoded2raw_permissive_msg = grpc_dump_slice(
+      encoded2raw_permissive_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+  gpr_log(GPR_DEBUG,
+          "Result:\nraw2encoded = %s\nencoded2raw = %s\nencoded2raw_permissive "
+          "= %s",
+          raw2encoded_msg, encoded2raw_msg, encoded2raw_permissive_msg);
+  gpr_free(raw2encoded_msg);
+  gpr_free(encoded2raw_msg);
+  gpr_free(encoded2raw_permissive_msg);
+
+  GPR_ASSERT(grpc_slice_eq(raw_slice, encoded2raw_slice));
+  GPR_ASSERT(grpc_slice_eq(raw_slice, encoded2raw_permissive_slice));
+  GPR_ASSERT(grpc_slice_eq(encoded_slice, raw2encoded_slice));
+
+  grpc_slice_unref(encoded2raw_slice);
+  grpc_slice_unref(encoded2raw_permissive_slice);
+  grpc_slice_unref(raw2encoded_slice);
+  grpc_slice_unref(raw_slice);
+  grpc_slice_unref(encoded_slice);
+}
+
+static void test_nonconformant_vector(const char* encoded,
+                                      size_t encoded_length,
+                                      const char* permissive_unencoded,
+                                      size_t permissive_unencoded_length,
+                                      const uint8_t* dict) {
+  char* permissive_unencoded_msg =
+      gpr_dump(permissive_unencoded, permissive_unencoded_length,
+               GPR_DUMP_HEX | GPR_DUMP_ASCII);
+  char* encoded_msg =
+      gpr_dump(encoded, encoded_length, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+  gpr_log(GPR_DEBUG, "Trial:\nraw = %s\nencoded = %s", permissive_unencoded_msg,
+          encoded_msg);
+  gpr_free(permissive_unencoded_msg);
+  gpr_free(encoded_msg);
+
+  grpc_slice permissive_unencoded_slice = grpc_slice_from_copied_buffer(
+      permissive_unencoded, permissive_unencoded_length);
+  grpc_slice encoded_slice =
+      grpc_slice_from_copied_buffer(encoded, encoded_length);
+  grpc_slice encoded2raw_slice;
+  GPR_ASSERT(!grpc_strict_percent_decode_slice(encoded_slice, dict,
+                                               &encoded2raw_slice));
+  grpc_slice encoded2raw_permissive_slice =
+      grpc_permissive_percent_decode_slice(encoded_slice);
+
+  char* encoded2raw_permissive_msg = grpc_dump_slice(
+      encoded2raw_permissive_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+  gpr_log(GPR_DEBUG, "Result:\nencoded2raw_permissive = %s",
+          encoded2raw_permissive_msg);
+  gpr_free(encoded2raw_permissive_msg);
+
+  GPR_ASSERT(
+      grpc_slice_eq(permissive_unencoded_slice, encoded2raw_permissive_slice));
+
+  grpc_slice_unref(permissive_unencoded_slice);
+  grpc_slice_unref(encoded2raw_permissive_slice);
+  grpc_slice_unref(encoded_slice);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  TEST_VECTOR(
+      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~",
+      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~",
+      grpc_url_percent_encoding_unreserved_bytes);
+  TEST_VECTOR("\x00", "%00", grpc_url_percent_encoding_unreserved_bytes);
+  TEST_VECTOR("\x01", "%01", grpc_url_percent_encoding_unreserved_bytes);
+  TEST_VECTOR("a b", "a%20b", grpc_url_percent_encoding_unreserved_bytes);
+  TEST_VECTOR(" b", "%20b", grpc_url_percent_encoding_unreserved_bytes);
+  TEST_VECTOR("a b", "a b", grpc_compatible_percent_encoding_unreserved_bytes);
+  TEST_VECTOR(" b", " b", grpc_compatible_percent_encoding_unreserved_bytes);
+  TEST_VECTOR("\x0f", "%0F", grpc_url_percent_encoding_unreserved_bytes);
+  TEST_VECTOR("\xff", "%FF", grpc_url_percent_encoding_unreserved_bytes);
+  TEST_VECTOR("\xee", "%EE", grpc_url_percent_encoding_unreserved_bytes);
+  TEST_VECTOR("%2", "%252", grpc_url_percent_encoding_unreserved_bytes);
+  TEST_NONCONFORMANT_VECTOR("%", "%",
+                            grpc_url_percent_encoding_unreserved_bytes);
+  TEST_NONCONFORMANT_VECTOR("%A", "%A",
+                            grpc_url_percent_encoding_unreserved_bytes);
+  TEST_NONCONFORMANT_VECTOR("%AG", "%AG",
+                            grpc_url_percent_encoding_unreserved_bytes);
+  TEST_NONCONFORMANT_VECTOR("\0", "\0",
+                            grpc_url_percent_encoding_unreserved_bytes);
+  return 0;
+}
diff --git a/test/core/slice/slice_buffer_test.c b/test/core/slice/slice_buffer_test.c
deleted file mode 100644
index 2fba496..0000000
--- a/test/core/slice/slice_buffer_test.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/slice_buffer.h>
-#include <grpc/support/log.h>
-#include "test/core/util/test_config.h"
-
-void test_slice_buffer_add() {
-  grpc_slice_buffer buf;
-  grpc_slice aaa = grpc_slice_from_copied_string("aaa");
-  grpc_slice bb = grpc_slice_from_copied_string("bb");
-  size_t i;
-
-  grpc_slice_buffer_init(&buf);
-  for (i = 0; i < 10; i++) {
-    grpc_slice_ref(aaa);
-    grpc_slice_ref(bb);
-    grpc_slice_buffer_add(&buf, aaa);
-    grpc_slice_buffer_add(&buf, bb);
-  }
-  GPR_ASSERT(buf.count > 0);
-  GPR_ASSERT(buf.length == 50);
-  grpc_slice_buffer_reset_and_unref(&buf);
-  GPR_ASSERT(buf.count == 0);
-  GPR_ASSERT(buf.length == 0);
-  for (i = 0; i < 10; i++) {
-    grpc_slice_ref(aaa);
-    grpc_slice_ref(bb);
-    grpc_slice_buffer_add(&buf, aaa);
-    grpc_slice_buffer_add(&buf, bb);
-  }
-  GPR_ASSERT(buf.count > 0);
-  GPR_ASSERT(buf.length == 50);
-  for (i = 0; i < 10; i++) {
-    grpc_slice_buffer_pop(&buf);
-    grpc_slice_unref(aaa);
-    grpc_slice_unref(bb);
-  }
-  GPR_ASSERT(buf.count == 0);
-  GPR_ASSERT(buf.length == 0);
-  grpc_slice_buffer_destroy(&buf);
-}
-
-void test_slice_buffer_move_first() {
-  grpc_slice slices[3];
-  grpc_slice_buffer src;
-  grpc_slice_buffer dst;
-  int idx = 0;
-  size_t src_len = 0;
-  size_t dst_len = 0;
-
-  slices[0] = grpc_slice_from_copied_string("aaa");
-  slices[1] = grpc_slice_from_copied_string("bbbb");
-  slices[2] = grpc_slice_from_copied_string("ccc");
-
-  grpc_slice_buffer_init(&src);
-  grpc_slice_buffer_init(&dst);
-  for (idx = 0; idx < 3; idx++) {
-    grpc_slice_ref(slices[idx]);
-    /* For this test, it is important that we add each slice at a new
-       slice index */
-    grpc_slice_buffer_add_indexed(&src, slices[idx]);
-    grpc_slice_buffer_add_indexed(&dst, slices[idx]);
-  }
-
-  /* Case 1: Move more than the first slice's length from src to dst */
-  src_len = src.length;
-  dst_len = dst.length;
-  grpc_slice_buffer_move_first(&src, 4, &dst);
-  src_len -= 4;
-  dst_len += 4;
-  GPR_ASSERT(src.length == src_len);
-  GPR_ASSERT(dst.length == dst_len);
-
-  /* src now has two slices ["bbb"] and  ["ccc"] */
-  /* Case 2: Move the first slice from src to dst */
-  grpc_slice_buffer_move_first(&src, 3, &dst);
-  src_len -= 3;
-  dst_len += 3;
-  GPR_ASSERT(src.length == src_len);
-  GPR_ASSERT(dst.length == dst_len);
-
-  /* src now has one slice ["ccc"] */
-  /* Case 3: Move less than the first slice's length from src to dst*/
-  grpc_slice_buffer_move_first(&src, 2, &dst);
-  src_len -= 2;
-  dst_len += 2;
-  GPR_ASSERT(src.length == src_len);
-  GPR_ASSERT(dst.length == dst_len);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  test_slice_buffer_add();
-  test_slice_buffer_move_first();
-
-  return 0;
-}
diff --git a/test/core/slice/slice_buffer_test.cc b/test/core/slice/slice_buffer_test.cc
new file mode 100644
index 0000000..338e807
--- /dev/null
+++ b/test/core/slice/slice_buffer_test.cc
@@ -0,0 +1,114 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/slice_buffer.h>
+#include <grpc/support/log.h>
+#include "test/core/util/test_config.h"
+
+void test_slice_buffer_add() {
+  grpc_slice_buffer buf;
+  grpc_slice aaa = grpc_slice_from_copied_string("aaa");
+  grpc_slice bb = grpc_slice_from_copied_string("bb");
+  size_t i;
+
+  grpc_slice_buffer_init(&buf);
+  for (i = 0; i < 10; i++) {
+    grpc_slice_ref(aaa);
+    grpc_slice_ref(bb);
+    grpc_slice_buffer_add(&buf, aaa);
+    grpc_slice_buffer_add(&buf, bb);
+  }
+  GPR_ASSERT(buf.count > 0);
+  GPR_ASSERT(buf.length == 50);
+  grpc_slice_buffer_reset_and_unref(&buf);
+  GPR_ASSERT(buf.count == 0);
+  GPR_ASSERT(buf.length == 0);
+  for (i = 0; i < 10; i++) {
+    grpc_slice_ref(aaa);
+    grpc_slice_ref(bb);
+    grpc_slice_buffer_add(&buf, aaa);
+    grpc_slice_buffer_add(&buf, bb);
+  }
+  GPR_ASSERT(buf.count > 0);
+  GPR_ASSERT(buf.length == 50);
+  for (i = 0; i < 10; i++) {
+    grpc_slice_buffer_pop(&buf);
+    grpc_slice_unref(aaa);
+    grpc_slice_unref(bb);
+  }
+  GPR_ASSERT(buf.count == 0);
+  GPR_ASSERT(buf.length == 0);
+  grpc_slice_buffer_destroy(&buf);
+}
+
+void test_slice_buffer_move_first() {
+  grpc_slice slices[3];
+  grpc_slice_buffer src;
+  grpc_slice_buffer dst;
+  int idx = 0;
+  size_t src_len = 0;
+  size_t dst_len = 0;
+
+  slices[0] = grpc_slice_from_copied_string("aaa");
+  slices[1] = grpc_slice_from_copied_string("bbbb");
+  slices[2] = grpc_slice_from_copied_string("ccc");
+
+  grpc_slice_buffer_init(&src);
+  grpc_slice_buffer_init(&dst);
+  for (idx = 0; idx < 3; idx++) {
+    grpc_slice_ref(slices[idx]);
+    /* For this test, it is important that we add each slice at a new
+       slice index */
+    grpc_slice_buffer_add_indexed(&src, slices[idx]);
+    grpc_slice_buffer_add_indexed(&dst, slices[idx]);
+  }
+
+  /* Case 1: Move more than the first slice's length from src to dst */
+  src_len = src.length;
+  dst_len = dst.length;
+  grpc_slice_buffer_move_first(&src, 4, &dst);
+  src_len -= 4;
+  dst_len += 4;
+  GPR_ASSERT(src.length == src_len);
+  GPR_ASSERT(dst.length == dst_len);
+
+  /* src now has two slices ["bbb"] and  ["ccc"] */
+  /* Case 2: Move the first slice from src to dst */
+  grpc_slice_buffer_move_first(&src, 3, &dst);
+  src_len -= 3;
+  dst_len += 3;
+  GPR_ASSERT(src.length == src_len);
+  GPR_ASSERT(dst.length == dst_len);
+
+  /* src now has one slice ["ccc"] */
+  /* Case 3: Move less than the first slice's length from src to dst*/
+  grpc_slice_buffer_move_first(&src, 2, &dst);
+  src_len -= 2;
+  dst_len += 2;
+  GPR_ASSERT(src.length == src_len);
+  GPR_ASSERT(dst.length == dst_len);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  test_slice_buffer_add();
+  test_slice_buffer_move_first();
+
+  return 0;
+}
diff --git a/test/core/slice/slice_hash_table_test.c b/test/core/slice/slice_hash_table_test.c
deleted file mode 100644
index f3689aa..0000000
--- a/test/core/slice/slice_hash_table_test.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/slice/slice_hash_table.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-#include "test/core/util/test_config.h"
-
-typedef struct {
-  char* key;
-  char* value;
-} test_entry;
-
-static void populate_entries(const test_entry* input, size_t num_entries,
-                             grpc_slice_hash_table_entry* output) {
-  for (size_t i = 0; i < num_entries; ++i) {
-    output[i].key = grpc_slice_from_copied_string(input[i].key);
-    output[i].value = gpr_strdup(input[i].value);
-  }
-}
-
-static void check_values(const test_entry* input, size_t num_entries,
-                         grpc_slice_hash_table* table) {
-  for (size_t i = 0; i < num_entries; ++i) {
-    grpc_slice key = grpc_slice_from_static_string(input[i].key);
-    char* actual = grpc_slice_hash_table_get(table, key);
-    GPR_ASSERT(actual != NULL);
-    GPR_ASSERT(strcmp(actual, input[i].value) == 0);
-    grpc_slice_unref(key);
-  }
-}
-
-static void check_non_existent_value(const char* key_string,
-                                     grpc_slice_hash_table* table) {
-  grpc_slice key = grpc_slice_from_static_string(key_string);
-  GPR_ASSERT(grpc_slice_hash_table_get(table, key) == NULL);
-  grpc_slice_unref(key);
-}
-
-static void destroy_string(grpc_exec_ctx* exec_ctx, void* value) {
-  gpr_free(value);
-}
-
-static grpc_slice_hash_table* create_table_from_entries(
-    const test_entry* test_entries, size_t num_test_entries,
-    int (*value_cmp_fn)(void*, void*)) {
-  // Construct table.
-  grpc_slice_hash_table_entry* entries =
-      gpr_zalloc(sizeof(*entries) * num_test_entries);
-  populate_entries(test_entries, num_test_entries, entries);
-  grpc_slice_hash_table* table = grpc_slice_hash_table_create(
-      num_test_entries, entries, destroy_string, value_cmp_fn);
-  gpr_free(entries);
-  return table;
-}
-
-static void test_slice_hash_table() {
-  const test_entry test_entries[] = {
-      {"key_0", "value_0"},   {"key_1", "value_1"},   {"key_2", "value_2"},
-      {"key_3", "value_3"},   {"key_4", "value_4"},   {"key_5", "value_5"},
-      {"key_6", "value_6"},   {"key_7", "value_7"},   {"key_8", "value_8"},
-      {"key_9", "value_9"},   {"key_10", "value_10"}, {"key_11", "value_11"},
-      {"key_12", "value_12"}, {"key_13", "value_13"}, {"key_14", "value_14"},
-      {"key_15", "value_15"}, {"key_16", "value_16"}, {"key_17", "value_17"},
-      {"key_18", "value_18"}, {"key_19", "value_19"}, {"key_20", "value_20"},
-      {"key_21", "value_21"}, {"key_22", "value_22"}, {"key_23", "value_23"},
-      {"key_24", "value_24"}, {"key_25", "value_25"}, {"key_26", "value_26"},
-      {"key_27", "value_27"}, {"key_28", "value_28"}, {"key_29", "value_29"},
-      {"key_30", "value_30"}, {"key_31", "value_31"}, {"key_32", "value_32"},
-      {"key_33", "value_33"}, {"key_34", "value_34"}, {"key_35", "value_35"},
-      {"key_36", "value_36"}, {"key_37", "value_37"}, {"key_38", "value_38"},
-      {"key_39", "value_39"}, {"key_40", "value_40"}, {"key_41", "value_41"},
-      {"key_42", "value_42"}, {"key_43", "value_43"}, {"key_44", "value_44"},
-      {"key_45", "value_45"}, {"key_46", "value_46"}, {"key_47", "value_47"},
-      {"key_48", "value_48"}, {"key_49", "value_49"}, {"key_50", "value_50"},
-      {"key_51", "value_51"}, {"key_52", "value_52"}, {"key_53", "value_53"},
-      {"key_54", "value_54"}, {"key_55", "value_55"}, {"key_56", "value_56"},
-      {"key_57", "value_57"}, {"key_58", "value_58"}, {"key_59", "value_59"},
-      {"key_60", "value_60"}, {"key_61", "value_61"}, {"key_62", "value_62"},
-      {"key_63", "value_63"}, {"key_64", "value_64"}, {"key_65", "value_65"},
-      {"key_66", "value_66"}, {"key_67", "value_67"}, {"key_68", "value_68"},
-      {"key_69", "value_69"}, {"key_70", "value_70"}, {"key_71", "value_71"},
-      {"key_72", "value_72"}, {"key_73", "value_73"}, {"key_74", "value_74"},
-      {"key_75", "value_75"}, {"key_76", "value_76"}, {"key_77", "value_77"},
-      {"key_78", "value_78"}, {"key_79", "value_79"}, {"key_80", "value_80"},
-      {"key_81", "value_81"}, {"key_82", "value_82"}, {"key_83", "value_83"},
-      {"key_84", "value_84"}, {"key_85", "value_85"}, {"key_86", "value_86"},
-      {"key_87", "value_87"}, {"key_88", "value_88"}, {"key_89", "value_89"},
-      {"key_90", "value_90"}, {"key_91", "value_91"}, {"key_92", "value_92"},
-      {"key_93", "value_93"}, {"key_94", "value_94"}, {"key_95", "value_95"},
-      {"key_96", "value_96"}, {"key_97", "value_97"}, {"key_98", "value_98"},
-      {"key_99", "value_99"},
-  };
-  const size_t num_entries = GPR_ARRAY_SIZE(test_entries);
-  grpc_slice_hash_table* table =
-      create_table_from_entries(test_entries, num_entries, NULL);
-  // Check contents of table.
-  check_values(test_entries, num_entries, table);
-  check_non_existent_value("XX", table);
-  // Clean up.
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_slice_hash_table_unref(&exec_ctx, table);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static int value_cmp_fn(void* a, void* b) {
-  const char* a_str = a;
-  const char* b_str = b;
-  return strcmp(a_str, b_str);
-}
-
-static int pointer_cmp_fn(void* a, void* b) { return GPR_ICMP(a, b); }
-
-static void test_slice_hash_table_eq() {
-  const test_entry test_entries_a[] = {
-      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
-  const size_t num_entries_a = GPR_ARRAY_SIZE(test_entries_a);
-  grpc_slice_hash_table* table_a =
-      create_table_from_entries(test_entries_a, num_entries_a, value_cmp_fn);
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_a) == 0);
-
-  const test_entry test_entries_b[] = {
-      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
-  const size_t num_entries_b = GPR_ARRAY_SIZE(test_entries_b);
-  grpc_slice_hash_table* table_b =
-      create_table_from_entries(test_entries_b, num_entries_b, value_cmp_fn);
-
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_b) == 0);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_slice_hash_table_unref(&exec_ctx, table_a);
-  grpc_slice_hash_table_unref(&exec_ctx, table_b);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_slice_hash_table_not_eq() {
-  const test_entry test_entries_a[] = {
-      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
-  const size_t num_entries_a = GPR_ARRAY_SIZE(test_entries_a);
-  grpc_slice_hash_table* table_a =
-      create_table_from_entries(test_entries_a, num_entries_a, value_cmp_fn);
-
-  // Different sizes.
-  const test_entry test_entries_b_smaller[] = {{"key_0", "value_0"},
-                                               {"key_1", "value_1"}};
-  const size_t num_entries_b_smaller = GPR_ARRAY_SIZE(test_entries_b_smaller);
-  grpc_slice_hash_table* table_b_smaller = create_table_from_entries(
-      test_entries_b_smaller, num_entries_b_smaller, value_cmp_fn);
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_b_smaller) > 0);
-
-  const test_entry test_entries_b_larger[] = {{"key_0", "value_0"},
-                                              {"key_1", "value_1"},
-                                              {"key_2", "value_2"},
-                                              {"key_3", "value_3"}};
-  const size_t num_entries_b_larger = GPR_ARRAY_SIZE(test_entries_b_larger);
-  grpc_slice_hash_table* table_b_larger = create_table_from_entries(
-      test_entries_b_larger, num_entries_b_larger, value_cmp_fn);
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_b_larger) < 0);
-
-  // One key doesn't match and is lexicographically "smaller".
-  const test_entry test_entries_c[] = {
-      {"key_zz", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
-  const size_t num_entries_c = GPR_ARRAY_SIZE(test_entries_c);
-  grpc_slice_hash_table* table_c =
-      create_table_from_entries(test_entries_c, num_entries_c, value_cmp_fn);
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_c) > 0);
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_c, table_a) < 0);
-
-  // One value doesn't match.
-  const test_entry test_entries_d[] = {
-      {"key_0", "value_z"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
-  const size_t num_entries_d = GPR_ARRAY_SIZE(test_entries_d);
-  grpc_slice_hash_table* table_d =
-      create_table_from_entries(test_entries_d, num_entries_d, value_cmp_fn);
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_d) < 0);
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_d, table_a) > 0);
-
-  // Same values but different "equals" functions.
-  const test_entry test_entries_e[] = {
-      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
-  const size_t num_entries_e = GPR_ARRAY_SIZE(test_entries_e);
-  grpc_slice_hash_table* table_e =
-      create_table_from_entries(test_entries_e, num_entries_e, value_cmp_fn);
-  const test_entry test_entries_f[] = {
-      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
-  const size_t num_entries_f = GPR_ARRAY_SIZE(test_entries_f);
-  grpc_slice_hash_table* table_f =
-      create_table_from_entries(test_entries_f, num_entries_f, pointer_cmp_fn);
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_e, table_f) != 0);
-
-  // Same (empty) key, different values.
-  const test_entry test_entries_g[] = {{"", "value_0"}};
-  const size_t num_entries_g = GPR_ARRAY_SIZE(test_entries_g);
-  grpc_slice_hash_table* table_g =
-      create_table_from_entries(test_entries_g, num_entries_g, value_cmp_fn);
-  const test_entry test_entries_h[] = {{"", "value_1"}};
-  const size_t num_entries_h = GPR_ARRAY_SIZE(test_entries_h);
-  grpc_slice_hash_table* table_h =
-      create_table_from_entries(test_entries_h, num_entries_h, pointer_cmp_fn);
-  GPR_ASSERT(grpc_slice_hash_table_cmp(table_g, table_h) != 0);
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_slice_hash_table_unref(&exec_ctx, table_a);
-  grpc_slice_hash_table_unref(&exec_ctx, table_b_larger);
-  grpc_slice_hash_table_unref(&exec_ctx, table_b_smaller);
-  grpc_slice_hash_table_unref(&exec_ctx, table_c);
-  grpc_slice_hash_table_unref(&exec_ctx, table_d);
-  grpc_slice_hash_table_unref(&exec_ctx, table_e);
-  grpc_slice_hash_table_unref(&exec_ctx, table_f);
-  grpc_slice_hash_table_unref(&exec_ctx, table_g);
-  grpc_slice_hash_table_unref(&exec_ctx, table_h);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char** argv) {
-  grpc_test_init(argc, argv);
-  test_slice_hash_table();
-  test_slice_hash_table_eq();
-  test_slice_hash_table_not_eq();
-  return 0;
-}
diff --git a/test/core/slice/slice_hash_table_test.cc b/test/core/slice/slice_hash_table_test.cc
new file mode 100644
index 0000000..a2006b3
--- /dev/null
+++ b/test/core/slice/slice_hash_table_test.cc
@@ -0,0 +1,243 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/slice/slice_hash_table.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+#include "test/core/util/test_config.h"
+
+typedef struct {
+  const char* key;
+  const char* value;
+} test_entry;
+
+static void populate_entries(const test_entry* input, size_t num_entries,
+                             grpc_slice_hash_table_entry* output) {
+  for (size_t i = 0; i < num_entries; ++i) {
+    output[i].key = grpc_slice_from_copied_string(input[i].key);
+    output[i].value = gpr_strdup(input[i].value);
+  }
+}
+
+static void check_values(const test_entry* input, size_t num_entries,
+                         grpc_slice_hash_table* table) {
+  for (size_t i = 0; i < num_entries; ++i) {
+    grpc_slice key = grpc_slice_from_static_string(input[i].key);
+    const char* actual =
+        static_cast<const char*>(grpc_slice_hash_table_get(table, key));
+    GPR_ASSERT(actual != NULL);
+    GPR_ASSERT(strcmp(actual, input[i].value) == 0);
+    grpc_slice_unref(key);
+  }
+}
+
+static void check_non_existent_value(const char* key_string,
+                                     grpc_slice_hash_table* table) {
+  grpc_slice key = grpc_slice_from_static_string(key_string);
+  GPR_ASSERT(grpc_slice_hash_table_get(table, key) == NULL);
+  grpc_slice_unref(key);
+}
+
+static void destroy_string(grpc_exec_ctx* exec_ctx, void* value) {
+  gpr_free(value);
+}
+
+static grpc_slice_hash_table* create_table_from_entries(
+    const test_entry* test_entries, size_t num_test_entries,
+    int (*value_cmp_fn)(void*, void*)) {
+  // Construct table.
+  grpc_slice_hash_table_entry* entries =
+      static_cast<grpc_slice_hash_table_entry*>(
+          gpr_zalloc(sizeof(*entries) * num_test_entries));
+  populate_entries(test_entries, num_test_entries, entries);
+  grpc_slice_hash_table* table = grpc_slice_hash_table_create(
+      num_test_entries, entries, destroy_string, value_cmp_fn);
+  gpr_free(entries);
+  return table;
+}
+
+static void test_slice_hash_table() {
+  const test_entry test_entries[] = {
+      {"key_0", "value_0"},   {"key_1", "value_1"},   {"key_2", "value_2"},
+      {"key_3", "value_3"},   {"key_4", "value_4"},   {"key_5", "value_5"},
+      {"key_6", "value_6"},   {"key_7", "value_7"},   {"key_8", "value_8"},
+      {"key_9", "value_9"},   {"key_10", "value_10"}, {"key_11", "value_11"},
+      {"key_12", "value_12"}, {"key_13", "value_13"}, {"key_14", "value_14"},
+      {"key_15", "value_15"}, {"key_16", "value_16"}, {"key_17", "value_17"},
+      {"key_18", "value_18"}, {"key_19", "value_19"}, {"key_20", "value_20"},
+      {"key_21", "value_21"}, {"key_22", "value_22"}, {"key_23", "value_23"},
+      {"key_24", "value_24"}, {"key_25", "value_25"}, {"key_26", "value_26"},
+      {"key_27", "value_27"}, {"key_28", "value_28"}, {"key_29", "value_29"},
+      {"key_30", "value_30"}, {"key_31", "value_31"}, {"key_32", "value_32"},
+      {"key_33", "value_33"}, {"key_34", "value_34"}, {"key_35", "value_35"},
+      {"key_36", "value_36"}, {"key_37", "value_37"}, {"key_38", "value_38"},
+      {"key_39", "value_39"}, {"key_40", "value_40"}, {"key_41", "value_41"},
+      {"key_42", "value_42"}, {"key_43", "value_43"}, {"key_44", "value_44"},
+      {"key_45", "value_45"}, {"key_46", "value_46"}, {"key_47", "value_47"},
+      {"key_48", "value_48"}, {"key_49", "value_49"}, {"key_50", "value_50"},
+      {"key_51", "value_51"}, {"key_52", "value_52"}, {"key_53", "value_53"},
+      {"key_54", "value_54"}, {"key_55", "value_55"}, {"key_56", "value_56"},
+      {"key_57", "value_57"}, {"key_58", "value_58"}, {"key_59", "value_59"},
+      {"key_60", "value_60"}, {"key_61", "value_61"}, {"key_62", "value_62"},
+      {"key_63", "value_63"}, {"key_64", "value_64"}, {"key_65", "value_65"},
+      {"key_66", "value_66"}, {"key_67", "value_67"}, {"key_68", "value_68"},
+      {"key_69", "value_69"}, {"key_70", "value_70"}, {"key_71", "value_71"},
+      {"key_72", "value_72"}, {"key_73", "value_73"}, {"key_74", "value_74"},
+      {"key_75", "value_75"}, {"key_76", "value_76"}, {"key_77", "value_77"},
+      {"key_78", "value_78"}, {"key_79", "value_79"}, {"key_80", "value_80"},
+      {"key_81", "value_81"}, {"key_82", "value_82"}, {"key_83", "value_83"},
+      {"key_84", "value_84"}, {"key_85", "value_85"}, {"key_86", "value_86"},
+      {"key_87", "value_87"}, {"key_88", "value_88"}, {"key_89", "value_89"},
+      {"key_90", "value_90"}, {"key_91", "value_91"}, {"key_92", "value_92"},
+      {"key_93", "value_93"}, {"key_94", "value_94"}, {"key_95", "value_95"},
+      {"key_96", "value_96"}, {"key_97", "value_97"}, {"key_98", "value_98"},
+      {"key_99", "value_99"},
+  };
+  const size_t num_entries = GPR_ARRAY_SIZE(test_entries);
+  grpc_slice_hash_table* table =
+      create_table_from_entries(test_entries, num_entries, NULL);
+  // Check contents of table.
+  check_values(test_entries, num_entries, table);
+  check_non_existent_value("XX", table);
+  // Clean up.
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_slice_hash_table_unref(&exec_ctx, table);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static int value_cmp_fn(void* a, void* b) {
+  const char* a_str = static_cast<const char*>(a);
+  const char* b_str = static_cast<const char*>(b);
+  return strcmp(a_str, b_str);
+}
+
+static int pointer_cmp_fn(void* a, void* b) { return GPR_ICMP(a, b); }
+
+static void test_slice_hash_table_eq() {
+  const test_entry test_entries_a[] = {
+      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
+  const size_t num_entries_a = GPR_ARRAY_SIZE(test_entries_a);
+  grpc_slice_hash_table* table_a =
+      create_table_from_entries(test_entries_a, num_entries_a, value_cmp_fn);
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_a) == 0);
+
+  const test_entry test_entries_b[] = {
+      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
+  const size_t num_entries_b = GPR_ARRAY_SIZE(test_entries_b);
+  grpc_slice_hash_table* table_b =
+      create_table_from_entries(test_entries_b, num_entries_b, value_cmp_fn);
+
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_b) == 0);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_slice_hash_table_unref(&exec_ctx, table_a);
+  grpc_slice_hash_table_unref(&exec_ctx, table_b);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_slice_hash_table_not_eq() {
+  const test_entry test_entries_a[] = {
+      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
+  const size_t num_entries_a = GPR_ARRAY_SIZE(test_entries_a);
+  grpc_slice_hash_table* table_a =
+      create_table_from_entries(test_entries_a, num_entries_a, value_cmp_fn);
+
+  // Different sizes.
+  const test_entry test_entries_b_smaller[] = {{"key_0", "value_0"},
+                                               {"key_1", "value_1"}};
+  const size_t num_entries_b_smaller = GPR_ARRAY_SIZE(test_entries_b_smaller);
+  grpc_slice_hash_table* table_b_smaller = create_table_from_entries(
+      test_entries_b_smaller, num_entries_b_smaller, value_cmp_fn);
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_b_smaller) > 0);
+
+  const test_entry test_entries_b_larger[] = {{"key_0", "value_0"},
+                                              {"key_1", "value_1"},
+                                              {"key_2", "value_2"},
+                                              {"key_3", "value_3"}};
+  const size_t num_entries_b_larger = GPR_ARRAY_SIZE(test_entries_b_larger);
+  grpc_slice_hash_table* table_b_larger = create_table_from_entries(
+      test_entries_b_larger, num_entries_b_larger, value_cmp_fn);
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_b_larger) < 0);
+
+  // One key doesn't match and is lexicographically "smaller".
+  const test_entry test_entries_c[] = {
+      {"key_zz", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
+  const size_t num_entries_c = GPR_ARRAY_SIZE(test_entries_c);
+  grpc_slice_hash_table* table_c =
+      create_table_from_entries(test_entries_c, num_entries_c, value_cmp_fn);
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_c) > 0);
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_c, table_a) < 0);
+
+  // One value doesn't match.
+  const test_entry test_entries_d[] = {
+      {"key_0", "value_z"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
+  const size_t num_entries_d = GPR_ARRAY_SIZE(test_entries_d);
+  grpc_slice_hash_table* table_d =
+      create_table_from_entries(test_entries_d, num_entries_d, value_cmp_fn);
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_a, table_d) < 0);
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_d, table_a) > 0);
+
+  // Same values but different "equals" functions.
+  const test_entry test_entries_e[] = {
+      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
+  const size_t num_entries_e = GPR_ARRAY_SIZE(test_entries_e);
+  grpc_slice_hash_table* table_e =
+      create_table_from_entries(test_entries_e, num_entries_e, value_cmp_fn);
+  const test_entry test_entries_f[] = {
+      {"key_0", "value_0"}, {"key_1", "value_1"}, {"key_2", "value_2"}};
+  const size_t num_entries_f = GPR_ARRAY_SIZE(test_entries_f);
+  grpc_slice_hash_table* table_f =
+      create_table_from_entries(test_entries_f, num_entries_f, pointer_cmp_fn);
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_e, table_f) != 0);
+
+  // Same (empty) key, different values.
+  const test_entry test_entries_g[] = {{"", "value_0"}};
+  const size_t num_entries_g = GPR_ARRAY_SIZE(test_entries_g);
+  grpc_slice_hash_table* table_g =
+      create_table_from_entries(test_entries_g, num_entries_g, value_cmp_fn);
+  const test_entry test_entries_h[] = {{"", "value_1"}};
+  const size_t num_entries_h = GPR_ARRAY_SIZE(test_entries_h);
+  grpc_slice_hash_table* table_h =
+      create_table_from_entries(test_entries_h, num_entries_h, pointer_cmp_fn);
+  GPR_ASSERT(grpc_slice_hash_table_cmp(table_g, table_h) != 0);
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_slice_hash_table_unref(&exec_ctx, table_a);
+  grpc_slice_hash_table_unref(&exec_ctx, table_b_larger);
+  grpc_slice_hash_table_unref(&exec_ctx, table_b_smaller);
+  grpc_slice_hash_table_unref(&exec_ctx, table_c);
+  grpc_slice_hash_table_unref(&exec_ctx, table_d);
+  grpc_slice_hash_table_unref(&exec_ctx, table_e);
+  grpc_slice_hash_table_unref(&exec_ctx, table_f);
+  grpc_slice_hash_table_unref(&exec_ctx, table_g);
+  grpc_slice_hash_table_unref(&exec_ctx, table_h);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_slice_hash_table();
+  test_slice_hash_table_eq();
+  test_slice_hash_table_not_eq();
+  return 0;
+}
diff --git a/test/core/slice/slice_string_helpers_test.c b/test/core/slice/slice_string_helpers_test.c
deleted file mode 100644
index 504acf8..0000000
--- a/test/core/slice/slice_string_helpers_test.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/slice/slice_string_helpers.h"
-
-#include <limits.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/support/string.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x)
-
-static void expect_slice_dump(grpc_slice slice, uint32_t flags,
-                              const char *result) {
-  char *got = grpc_dump_slice(slice, flags);
-  GPR_ASSERT(0 == strcmp(got, result));
-  gpr_free(got);
-  grpc_slice_unref(slice);
-}
-
-static void test_dump_slice(void) {
-  static const char *text = "HELLO WORLD!";
-  static const char *long_text =
-      "It was a bright cold day in April, and the clocks were striking "
-      "thirteen. Winston Smith, his chin nuzzled into his breast in an effort "
-      "to escape the vile wind, slipped quickly through the glass doors of "
-      "Victory Mansions, though not quickly enough to prevent a swirl of "
-      "gritty dust from entering along with him.";
-
-  LOG_TEST_NAME("test_dump_slice");
-
-  expect_slice_dump(grpc_slice_from_copied_string(text), GPR_DUMP_ASCII, text);
-  expect_slice_dump(grpc_slice_from_copied_string(long_text), GPR_DUMP_ASCII,
-                    long_text);
-  expect_slice_dump(grpc_slice_from_copied_buffer("\x01", 1), GPR_DUMP_HEX,
-                    "01");
-  expect_slice_dump(grpc_slice_from_copied_buffer("\x01", 1),
-                    GPR_DUMP_HEX | GPR_DUMP_ASCII, "01 '.'");
-}
-
-static void test_strsplit(void) {
-  grpc_slice_buffer *parts;
-  grpc_slice str;
-
-  LOG_TEST_NAME("test_strsplit");
-
-  parts = gpr_malloc(sizeof(grpc_slice_buffer));
-  grpc_slice_buffer_init(parts);
-
-  str = grpc_slice_from_copied_string("one, two, three, four");
-  grpc_slice_split(str, ", ", parts);
-  GPR_ASSERT(4 == parts->count);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], "one"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], "two"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[2], "three"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[3], "four"));
-  grpc_slice_buffer_reset_and_unref(parts);
-  grpc_slice_unref(str);
-
-  /* separator not present in string */
-  str = grpc_slice_from_copied_string("one two three four");
-  grpc_slice_split(str, ", ", parts);
-  GPR_ASSERT(1 == parts->count);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], "one two three four"));
-  grpc_slice_buffer_reset_and_unref(parts);
-  grpc_slice_unref(str);
-
-  /* separator at the end */
-  str = grpc_slice_from_copied_string("foo,");
-  grpc_slice_split(str, ",", parts);
-  GPR_ASSERT(2 == parts->count);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], "foo"));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], ""));
-  grpc_slice_buffer_reset_and_unref(parts);
-  grpc_slice_unref(str);
-
-  /* separator at the beginning */
-  str = grpc_slice_from_copied_string(",foo");
-  grpc_slice_split(str, ",", parts);
-  GPR_ASSERT(2 == parts->count);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], ""));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], "foo"));
-  grpc_slice_buffer_reset_and_unref(parts);
-  grpc_slice_unref(str);
-
-  /* standalone separator */
-  str = grpc_slice_from_copied_string(",");
-  grpc_slice_split(str, ",", parts);
-  GPR_ASSERT(2 == parts->count);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], ""));
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], ""));
-  grpc_slice_buffer_reset_and_unref(parts);
-  grpc_slice_unref(str);
-
-  /* empty input */
-  str = grpc_slice_from_copied_string("");
-  grpc_slice_split(str, ", ", parts);
-  GPR_ASSERT(1 == parts->count);
-  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], ""));
-  grpc_slice_buffer_reset_and_unref(parts);
-  grpc_slice_unref(str);
-
-  grpc_slice_buffer_destroy(parts);
-  gpr_free(parts);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_dump_slice();
-  test_strsplit();
-  return 0;
-}
diff --git a/test/core/slice/slice_string_helpers_test.cc b/test/core/slice/slice_string_helpers_test.cc
new file mode 100644
index 0000000..260f8c8
--- /dev/null
+++ b/test/core/slice/slice_string_helpers_test.cc
@@ -0,0 +1,136 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/slice/slice_string_helpers.h"
+
+#include <limits.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/support/string.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x)
+
+static void expect_slice_dump(grpc_slice slice, uint32_t flags,
+                              const char* result) {
+  char* got = grpc_dump_slice(slice, flags);
+  GPR_ASSERT(0 == strcmp(got, result));
+  gpr_free(got);
+  grpc_slice_unref(slice);
+}
+
+static void test_dump_slice(void) {
+  static const char* text = "HELLO WORLD!";
+  static const char* long_text =
+      "It was a bright cold day in April, and the clocks were striking "
+      "thirteen. Winston Smith, his chin nuzzled into his breast in an effort "
+      "to escape the vile wind, slipped quickly through the glass doors of "
+      "Victory Mansions, though not quickly enough to prevent a swirl of "
+      "gritty dust from entering along with him.";
+
+  LOG_TEST_NAME("test_dump_slice");
+
+  expect_slice_dump(grpc_slice_from_copied_string(text), GPR_DUMP_ASCII, text);
+  expect_slice_dump(grpc_slice_from_copied_string(long_text), GPR_DUMP_ASCII,
+                    long_text);
+  expect_slice_dump(grpc_slice_from_copied_buffer("\x01", 1), GPR_DUMP_HEX,
+                    "01");
+  expect_slice_dump(grpc_slice_from_copied_buffer("\x01", 1),
+                    GPR_DUMP_HEX | GPR_DUMP_ASCII, "01 '.'");
+}
+
+static void test_strsplit(void) {
+  grpc_slice_buffer* parts;
+  grpc_slice str;
+
+  LOG_TEST_NAME("test_strsplit");
+
+  parts =
+      static_cast<grpc_slice_buffer*>(gpr_malloc(sizeof(grpc_slice_buffer)));
+  grpc_slice_buffer_init(parts);
+
+  str = grpc_slice_from_copied_string("one, two, three, four");
+  grpc_slice_split(str, ", ", parts);
+  GPR_ASSERT(4 == parts->count);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], "one"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], "two"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[2], "three"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[3], "four"));
+  grpc_slice_buffer_reset_and_unref(parts);
+  grpc_slice_unref(str);
+
+  /* separator not present in string */
+  str = grpc_slice_from_copied_string("one two three four");
+  grpc_slice_split(str, ", ", parts);
+  GPR_ASSERT(1 == parts->count);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], "one two three four"));
+  grpc_slice_buffer_reset_and_unref(parts);
+  grpc_slice_unref(str);
+
+  /* separator at the end */
+  str = grpc_slice_from_copied_string("foo,");
+  grpc_slice_split(str, ",", parts);
+  GPR_ASSERT(2 == parts->count);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], "foo"));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], ""));
+  grpc_slice_buffer_reset_and_unref(parts);
+  grpc_slice_unref(str);
+
+  /* separator at the beginning */
+  str = grpc_slice_from_copied_string(",foo");
+  grpc_slice_split(str, ",", parts);
+  GPR_ASSERT(2 == parts->count);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], ""));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], "foo"));
+  grpc_slice_buffer_reset_and_unref(parts);
+  grpc_slice_unref(str);
+
+  /* standalone separator */
+  str = grpc_slice_from_copied_string(",");
+  grpc_slice_split(str, ",", parts);
+  GPR_ASSERT(2 == parts->count);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], ""));
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[1], ""));
+  grpc_slice_buffer_reset_and_unref(parts);
+  grpc_slice_unref(str);
+
+  /* empty input */
+  str = grpc_slice_from_copied_string("");
+  grpc_slice_split(str, ", ", parts);
+  GPR_ASSERT(1 == parts->count);
+  GPR_ASSERT(0 == grpc_slice_str_cmp(parts->slices[0], ""));
+  grpc_slice_buffer_reset_and_unref(parts);
+  grpc_slice_unref(str);
+
+  grpc_slice_buffer_destroy(parts);
+  gpr_free(parts);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_dump_slice();
+  test_strsplit();
+  return 0;
+}
diff --git a/test/core/slice/slice_test.c b/test/core/slice/slice_test.c
deleted file mode 100644
index cda37fb..0000000
--- a/test/core/slice/slice_test.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/slice.h>
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/transport/static_metadata.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x);
-
-static void test_slice_malloc_returns_something_sensible(void) {
-  /* Calls grpc_slice_create for various lengths and verifies the internals for
-     consistency. */
-  size_t length;
-  size_t i;
-  grpc_slice slice;
-
-  LOG_TEST_NAME("test_slice_malloc_returns_something_sensible");
-
-  for (length = 0; length <= 1024; length++) {
-    slice = grpc_slice_malloc(length);
-    /* If there is a length, slice.data must be non-NULL. If length is zero
-       we don't care. */
-    if (length) {
-      GPR_ASSERT(GRPC_SLICE_START_PTR(slice));
-    }
-    /* Returned slice length must be what was requested. */
-    GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == length);
-    /* If the slice has a refcount, it must be destroyable. */
-    if (slice.refcount) {
-      GPR_ASSERT(slice.refcount->vtable != NULL);
-      GPR_ASSERT(slice.refcount->vtable->ref != NULL);
-      GPR_ASSERT(slice.refcount->vtable->unref != NULL);
-      GPR_ASSERT(slice.refcount->vtable->hash != NULL);
-    }
-    /* We must be able to write to every byte of the data */
-    for (i = 0; i < length; i++) {
-      GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
-    }
-    /* And finally we must succeed in destroying the slice */
-    grpc_slice_unref(slice);
-  }
-}
-
-static void do_nothing(void *ignored) {}
-
-static void test_slice_new_returns_something_sensible(void) {
-  uint8_t x;
-
-  grpc_slice slice = grpc_slice_new(&x, 1, do_nothing);
-  GPR_ASSERT(slice.refcount);
-  GPR_ASSERT(slice.data.refcounted.bytes == &x);
-  GPR_ASSERT(slice.data.refcounted.length == 1);
-  grpc_slice_unref(slice);
-}
-
-/* destroy function that sets a mark to indicate it was called. */
-static void set_mark(void *p) { *((int *)p) = 1; }
-
-static void test_slice_new_with_user_data(void) {
-  int marker = 0;
-  uint8_t buf[2];
-  grpc_slice slice;
-
-  buf[0] = 0;
-  buf[1] = 1;
-  slice = grpc_slice_new_with_user_data(buf, 2, set_mark, &marker);
-  GPR_ASSERT(marker == 0);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == 2);
-  GPR_ASSERT(GRPC_SLICE_START_PTR(slice)[0] == 0);
-  GPR_ASSERT(GRPC_SLICE_START_PTR(slice)[1] == 1);
-
-  /* unref should cause destroy function to run. */
-  grpc_slice_unref(slice);
-  GPR_ASSERT(marker == 1);
-}
-
-static int do_nothing_with_len_1_calls = 0;
-
-static void do_nothing_with_len_1(void *ignored, size_t len) {
-  GPR_ASSERT(len == 1);
-  do_nothing_with_len_1_calls++;
-}
-
-static void test_slice_new_with_len_returns_something_sensible(void) {
-  uint8_t x;
-  int num_refs = 5; /* To test adding/removing an arbitrary number of refs */
-  int i;
-
-  grpc_slice slice = grpc_slice_new_with_len(&x, 1, do_nothing_with_len_1);
-  GPR_ASSERT(slice.refcount); /* ref count is initialized to 1 at this point */
-  GPR_ASSERT(slice.data.refcounted.bytes == &x);
-  GPR_ASSERT(slice.data.refcounted.length == 1);
-  GPR_ASSERT(do_nothing_with_len_1_calls == 0);
-
-  /* Add an arbitrary number of refs to the slice and remoe the refs. This is to
-     make sure that that the destroy callback (i.e do_nothing_with_len_1()) is
-     not called until the last unref operation */
-  for (i = 0; i < num_refs; i++) {
-    grpc_slice_ref(slice);
-  }
-  for (i = 0; i < num_refs; i++) {
-    grpc_slice_unref(slice);
-  }
-  GPR_ASSERT(do_nothing_with_len_1_calls == 0); /* Shouldn't be called yet */
-
-  /* last unref */
-  grpc_slice_unref(slice);
-  GPR_ASSERT(do_nothing_with_len_1_calls == 1);
-}
-
-static void test_slice_sub_works(unsigned length) {
-  grpc_slice slice;
-  grpc_slice sub;
-  unsigned i, j, k;
-
-  LOG_TEST_NAME("test_slice_sub_works");
-  gpr_log(GPR_INFO, "length=%d", length);
-
-  /* Create a slice in which each byte is equal to the distance from it to the
-     beginning of the slice. */
-  slice = grpc_slice_malloc(length);
-  for (i = 0; i < length; i++) {
-    GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
-  }
-
-  /* Ensure that for all subsets length is correct and that we start on the
-     correct byte. Additionally check that no copies were made. */
-  for (i = 0; i < length; i++) {
-    for (j = i; j < length; j++) {
-      sub = grpc_slice_sub(slice, i, j);
-      GPR_ASSERT(GRPC_SLICE_LENGTH(sub) == j - i);
-      for (k = 0; k < j - i; k++) {
-        GPR_ASSERT(GRPC_SLICE_START_PTR(sub)[k] == (uint8_t)(i + k));
-      }
-      grpc_slice_unref(sub);
-    }
-  }
-  grpc_slice_unref(slice);
-}
-
-static void check_head_tail(grpc_slice slice, grpc_slice head,
-                            grpc_slice tail) {
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) ==
-             GRPC_SLICE_LENGTH(head) + GRPC_SLICE_LENGTH(tail));
-  GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice),
-                         GRPC_SLICE_START_PTR(head), GRPC_SLICE_LENGTH(head)));
-  GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(head),
-                         GRPC_SLICE_START_PTR(tail), GRPC_SLICE_LENGTH(tail)));
-}
-
-static void test_slice_split_head_works(size_t length) {
-  grpc_slice slice;
-  grpc_slice head, tail;
-  size_t i;
-
-  LOG_TEST_NAME("test_slice_split_head_works");
-  gpr_log(GPR_INFO, "length=%" PRIuPTR, length);
-
-  /* Create a slice in which each byte is equal to the distance from it to the
-     beginning of the slice. */
-  slice = grpc_slice_malloc(length);
-  for (i = 0; i < length; i++) {
-    GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
-  }
-
-  /* Ensure that for all subsets length is correct and that we start on the
-     correct byte. Additionally check that no copies were made. */
-  for (i = 0; i < length; i++) {
-    tail = grpc_slice_ref(slice);
-    head = grpc_slice_split_head(&tail, i);
-    check_head_tail(slice, head, tail);
-    grpc_slice_unref(tail);
-    grpc_slice_unref(head);
-  }
-
-  grpc_slice_unref(slice);
-}
-
-static void test_slice_split_tail_works(size_t length) {
-  grpc_slice slice;
-  grpc_slice head, tail;
-  size_t i;
-
-  LOG_TEST_NAME("test_slice_split_tail_works");
-  gpr_log(GPR_INFO, "length=%" PRIuPTR, length);
-
-  /* Create a slice in which each byte is equal to the distance from it to the
-     beginning of the slice. */
-  slice = grpc_slice_malloc(length);
-  for (i = 0; i < length; i++) {
-    GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
-  }
-
-  /* Ensure that for all subsets length is correct and that we start on the
-     correct byte. Additionally check that no copies were made. */
-  for (i = 0; i < length; i++) {
-    head = grpc_slice_ref(slice);
-    tail = grpc_slice_split_tail(&head, i);
-    check_head_tail(slice, head, tail);
-    grpc_slice_unref(tail);
-    grpc_slice_unref(head);
-  }
-
-  grpc_slice_unref(slice);
-}
-
-static void test_slice_from_copied_string_works(void) {
-  static const char *text = "HELLO WORLD!";
-  grpc_slice slice;
-
-  LOG_TEST_NAME("test_slice_from_copied_string_works");
-
-  slice = grpc_slice_from_copied_string(text);
-  GPR_ASSERT(strlen(text) == GRPC_SLICE_LENGTH(slice));
-  GPR_ASSERT(
-      0 == memcmp(text, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice)));
-  grpc_slice_unref(slice);
-}
-
-static void test_slice_interning(void) {
-  LOG_TEST_NAME("test_slice_interning");
-
-  grpc_init();
-  grpc_slice src1 = grpc_slice_from_copied_string("hello123456789123456789");
-  grpc_slice src2 = grpc_slice_from_copied_string("hello123456789123456789");
-  GPR_ASSERT(GRPC_SLICE_START_PTR(src1) != GRPC_SLICE_START_PTR(src2));
-  grpc_slice interned1 = grpc_slice_intern(src1);
-  grpc_slice interned2 = grpc_slice_intern(src2);
-  GPR_ASSERT(GRPC_SLICE_START_PTR(interned1) ==
-             GRPC_SLICE_START_PTR(interned2));
-  GPR_ASSERT(GRPC_SLICE_START_PTR(interned1) != GRPC_SLICE_START_PTR(src1));
-  GPR_ASSERT(GRPC_SLICE_START_PTR(interned2) != GRPC_SLICE_START_PTR(src2));
-  grpc_slice_unref(src1);
-  grpc_slice_unref(src2);
-  grpc_slice_unref(interned1);
-  grpc_slice_unref(interned2);
-  grpc_shutdown();
-}
-
-static void test_static_slice_interning(void) {
-  LOG_TEST_NAME("test_static_slice_interning");
-
-  // grpc_init/grpc_shutdown deliberately omitted: they should not be necessary
-  // to intern a static slice
-
-  for (size_t i = 0; i < GRPC_STATIC_MDSTR_COUNT; i++) {
-    GPR_ASSERT(grpc_slice_is_equivalent(
-        grpc_static_slice_table[i],
-        grpc_slice_intern(grpc_static_slice_table[i])));
-  }
-}
-
-static void test_static_slice_copy_interning(void) {
-  LOG_TEST_NAME("test_static_slice_copy_interning");
-
-  grpc_init();
-
-  for (size_t i = 0; i < GRPC_STATIC_MDSTR_COUNT; i++) {
-    grpc_slice copy = grpc_slice_dup(grpc_static_slice_table[i]);
-    GPR_ASSERT(grpc_static_slice_table[i].refcount != copy.refcount);
-    GPR_ASSERT(grpc_static_slice_table[i].refcount ==
-               grpc_slice_intern(copy).refcount);
-    grpc_slice_unref(copy);
-  }
-
-  grpc_shutdown();
-}
-
-int main(int argc, char **argv) {
-  unsigned length;
-  grpc_test_init(argc, argv);
-  test_slice_malloc_returns_something_sensible();
-  test_slice_new_returns_something_sensible();
-  test_slice_new_with_user_data();
-  test_slice_new_with_len_returns_something_sensible();
-  for (length = 0; length < 128; length++) {
-    test_slice_sub_works(length);
-    test_slice_split_head_works(length);
-    test_slice_split_tail_works(length);
-  }
-  test_slice_from_copied_string_works();
-  test_slice_interning();
-  test_static_slice_interning();
-  test_static_slice_copy_interning();
-  return 0;
-}
diff --git a/test/core/slice/slice_test.cc b/test/core/slice/slice_test.cc
new file mode 100644
index 0000000..aec5636
--- /dev/null
+++ b/test/core/slice/slice_test.cc
@@ -0,0 +1,309 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/slice.h>
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/static_metadata.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x);
+
+static void test_slice_malloc_returns_something_sensible(void) {
+  /* Calls grpc_slice_create for various lengths and verifies the internals for
+     consistency. */
+  size_t length;
+  size_t i;
+  grpc_slice slice;
+
+  LOG_TEST_NAME("test_slice_malloc_returns_something_sensible");
+
+  for (length = 0; length <= 1024; length++) {
+    slice = grpc_slice_malloc(length);
+    /* If there is a length, slice.data must be non-NULL. If length is zero
+       we don't care. */
+    if (length > GRPC_SLICE_INLINED_SIZE) {
+      GPR_ASSERT(slice.data.refcounted.bytes);
+    }
+    /* Returned slice length must be what was requested. */
+    GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == length);
+    /* If the slice has a refcount, it must be destroyable. */
+    if (slice.refcount) {
+      GPR_ASSERT(slice.refcount->vtable != NULL);
+      GPR_ASSERT(slice.refcount->vtable->ref != NULL);
+      GPR_ASSERT(slice.refcount->vtable->unref != NULL);
+      GPR_ASSERT(slice.refcount->vtable->hash != NULL);
+    }
+    /* We must be able to write to every byte of the data */
+    for (i = 0; i < length; i++) {
+      GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
+    }
+    /* And finally we must succeed in destroying the slice */
+    grpc_slice_unref(slice);
+  }
+}
+
+static void do_nothing(void* ignored) {}
+
+static void test_slice_new_returns_something_sensible(void) {
+  uint8_t x;
+
+  grpc_slice slice = grpc_slice_new(&x, 1, do_nothing);
+  GPR_ASSERT(slice.refcount);
+  GPR_ASSERT(slice.data.refcounted.bytes == &x);
+  GPR_ASSERT(slice.data.refcounted.length == 1);
+  grpc_slice_unref(slice);
+}
+
+/* destroy function that sets a mark to indicate it was called. */
+static void set_mark(void* p) { *((int*)p) = 1; }
+
+static void test_slice_new_with_user_data(void) {
+  int marker = 0;
+  uint8_t buf[2];
+  grpc_slice slice;
+
+  buf[0] = 0;
+  buf[1] = 1;
+  slice = grpc_slice_new_with_user_data(buf, 2, set_mark, &marker);
+  GPR_ASSERT(marker == 0);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == 2);
+  GPR_ASSERT(GRPC_SLICE_START_PTR(slice)[0] == 0);
+  GPR_ASSERT(GRPC_SLICE_START_PTR(slice)[1] == 1);
+
+  /* unref should cause destroy function to run. */
+  grpc_slice_unref(slice);
+  GPR_ASSERT(marker == 1);
+}
+
+static int do_nothing_with_len_1_calls = 0;
+
+static void do_nothing_with_len_1(void* ignored, size_t len) {
+  GPR_ASSERT(len == 1);
+  do_nothing_with_len_1_calls++;
+}
+
+static void test_slice_new_with_len_returns_something_sensible(void) {
+  uint8_t x;
+  int num_refs = 5; /* To test adding/removing an arbitrary number of refs */
+  int i;
+
+  grpc_slice slice = grpc_slice_new_with_len(&x, 1, do_nothing_with_len_1);
+  GPR_ASSERT(slice.refcount); /* ref count is initialized to 1 at this point */
+  GPR_ASSERT(slice.data.refcounted.bytes == &x);
+  GPR_ASSERT(slice.data.refcounted.length == 1);
+  GPR_ASSERT(do_nothing_with_len_1_calls == 0);
+
+  /* Add an arbitrary number of refs to the slice and remoe the refs. This is to
+     make sure that that the destroy callback (i.e do_nothing_with_len_1()) is
+     not called until the last unref operation */
+  for (i = 0; i < num_refs; i++) {
+    grpc_slice_ref(slice);
+  }
+  for (i = 0; i < num_refs; i++) {
+    grpc_slice_unref(slice);
+  }
+  GPR_ASSERT(do_nothing_with_len_1_calls == 0); /* Shouldn't be called yet */
+
+  /* last unref */
+  grpc_slice_unref(slice);
+  GPR_ASSERT(do_nothing_with_len_1_calls == 1);
+}
+
+static void test_slice_sub_works(unsigned length) {
+  grpc_slice slice;
+  grpc_slice sub;
+  unsigned i, j, k;
+
+  LOG_TEST_NAME("test_slice_sub_works");
+  gpr_log(GPR_INFO, "length=%d", length);
+
+  /* Create a slice in which each byte is equal to the distance from it to the
+     beginning of the slice. */
+  slice = grpc_slice_malloc(length);
+  for (i = 0; i < length; i++) {
+    GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
+  }
+
+  /* Ensure that for all subsets length is correct and that we start on the
+     correct byte. Additionally check that no copies were made. */
+  for (i = 0; i < length; i++) {
+    for (j = i; j < length; j++) {
+      sub = grpc_slice_sub(slice, i, j);
+      GPR_ASSERT(GRPC_SLICE_LENGTH(sub) == j - i);
+      for (k = 0; k < j - i; k++) {
+        GPR_ASSERT(GRPC_SLICE_START_PTR(sub)[k] == (uint8_t)(i + k));
+      }
+      grpc_slice_unref(sub);
+    }
+  }
+  grpc_slice_unref(slice);
+}
+
+static void check_head_tail(grpc_slice slice, grpc_slice head,
+                            grpc_slice tail) {
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) ==
+             GRPC_SLICE_LENGTH(head) + GRPC_SLICE_LENGTH(tail));
+  GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice),
+                         GRPC_SLICE_START_PTR(head), GRPC_SLICE_LENGTH(head)));
+  GPR_ASSERT(0 == memcmp(GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(head),
+                         GRPC_SLICE_START_PTR(tail), GRPC_SLICE_LENGTH(tail)));
+}
+
+static void test_slice_split_head_works(size_t length) {
+  grpc_slice slice;
+  grpc_slice head, tail;
+  size_t i;
+
+  LOG_TEST_NAME("test_slice_split_head_works");
+  gpr_log(GPR_INFO, "length=%" PRIuPTR, length);
+
+  /* Create a slice in which each byte is equal to the distance from it to the
+     beginning of the slice. */
+  slice = grpc_slice_malloc(length);
+  for (i = 0; i < length; i++) {
+    GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
+  }
+
+  /* Ensure that for all subsets length is correct and that we start on the
+     correct byte. Additionally check that no copies were made. */
+  for (i = 0; i < length; i++) {
+    tail = grpc_slice_ref(slice);
+    head = grpc_slice_split_head(&tail, i);
+    check_head_tail(slice, head, tail);
+    grpc_slice_unref(tail);
+    grpc_slice_unref(head);
+  }
+
+  grpc_slice_unref(slice);
+}
+
+static void test_slice_split_tail_works(size_t length) {
+  grpc_slice slice;
+  grpc_slice head, tail;
+  size_t i;
+
+  LOG_TEST_NAME("test_slice_split_tail_works");
+  gpr_log(GPR_INFO, "length=%" PRIuPTR, length);
+
+  /* Create a slice in which each byte is equal to the distance from it to the
+     beginning of the slice. */
+  slice = grpc_slice_malloc(length);
+  for (i = 0; i < length; i++) {
+    GRPC_SLICE_START_PTR(slice)[i] = (uint8_t)i;
+  }
+
+  /* Ensure that for all subsets length is correct and that we start on the
+     correct byte. Additionally check that no copies were made. */
+  for (i = 0; i < length; i++) {
+    head = grpc_slice_ref(slice);
+    tail = grpc_slice_split_tail(&head, i);
+    check_head_tail(slice, head, tail);
+    grpc_slice_unref(tail);
+    grpc_slice_unref(head);
+  }
+
+  grpc_slice_unref(slice);
+}
+
+static void test_slice_from_copied_string_works(void) {
+  static const char* text = "HELLO WORLD!";
+  grpc_slice slice;
+
+  LOG_TEST_NAME("test_slice_from_copied_string_works");
+
+  slice = grpc_slice_from_copied_string(text);
+  GPR_ASSERT(strlen(text) == GRPC_SLICE_LENGTH(slice));
+  GPR_ASSERT(
+      0 == memcmp(text, GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice)));
+  grpc_slice_unref(slice);
+}
+
+static void test_slice_interning(void) {
+  LOG_TEST_NAME("test_slice_interning");
+
+  grpc_init();
+  grpc_slice src1 = grpc_slice_from_copied_string("hello123456789123456789");
+  grpc_slice src2 = grpc_slice_from_copied_string("hello123456789123456789");
+  GPR_ASSERT(GRPC_SLICE_START_PTR(src1) != GRPC_SLICE_START_PTR(src2));
+  grpc_slice interned1 = grpc_slice_intern(src1);
+  grpc_slice interned2 = grpc_slice_intern(src2);
+  GPR_ASSERT(GRPC_SLICE_START_PTR(interned1) ==
+             GRPC_SLICE_START_PTR(interned2));
+  GPR_ASSERT(GRPC_SLICE_START_PTR(interned1) != GRPC_SLICE_START_PTR(src1));
+  GPR_ASSERT(GRPC_SLICE_START_PTR(interned2) != GRPC_SLICE_START_PTR(src2));
+  grpc_slice_unref(src1);
+  grpc_slice_unref(src2);
+  grpc_slice_unref(interned1);
+  grpc_slice_unref(interned2);
+  grpc_shutdown();
+}
+
+static void test_static_slice_interning(void) {
+  LOG_TEST_NAME("test_static_slice_interning");
+
+  // grpc_init/grpc_shutdown deliberately omitted: they should not be necessary
+  // to intern a static slice
+
+  for (size_t i = 0; i < GRPC_STATIC_MDSTR_COUNT; i++) {
+    GPR_ASSERT(grpc_slice_is_equivalent(
+        grpc_static_slice_table[i],
+        grpc_slice_intern(grpc_static_slice_table[i])));
+  }
+}
+
+static void test_static_slice_copy_interning(void) {
+  LOG_TEST_NAME("test_static_slice_copy_interning");
+
+  grpc_init();
+
+  for (size_t i = 0; i < GRPC_STATIC_MDSTR_COUNT; i++) {
+    grpc_slice copy = grpc_slice_dup(grpc_static_slice_table[i]);
+    GPR_ASSERT(grpc_static_slice_table[i].refcount != copy.refcount);
+    GPR_ASSERT(grpc_static_slice_table[i].refcount ==
+               grpc_slice_intern(copy).refcount);
+    grpc_slice_unref(copy);
+  }
+
+  grpc_shutdown();
+}
+
+int main(int argc, char** argv) {
+  unsigned length;
+  grpc_test_init(argc, argv);
+  test_slice_malloc_returns_something_sensible();
+  test_slice_new_returns_something_sensible();
+  test_slice_new_with_user_data();
+  test_slice_new_with_len_returns_something_sensible();
+  for (length = 0; length < 128; length++) {
+    test_slice_sub_works(length);
+    test_slice_split_head_works(length);
+    test_slice_split_tail_works(length);
+  }
+  test_slice_from_copied_string_works();
+  test_slice_interning();
+  test_static_slice_interning();
+  test_static_slice_copy_interning();
+  return 0;
+}
diff --git a/test/core/statistics/census_log_tests.c b/test/core/statistics/census_log_tests.c
deleted file mode 100644
index 229a5e5..0000000
--- a/test/core/statistics/census_log_tests.c
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/census_log.h"
-#include <grpc/support/cpu.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "test/core/util/test_config.h"
-
-/* Fills in 'record' of size 'size'. Each byte in record is filled in with the
-   same value. The value is extracted from 'record' pointer. */
-static void write_record(char *record, size_t size) {
-  char data = (uintptr_t)record % 255;
-  memset(record, data, size);
-}
-
-/* Reads fixed size records. Returns the number of records read in
-   'num_records'. */
-static void read_records(size_t record_size, const char *buffer,
-                         size_t buffer_size, int32_t *num_records) {
-  int32_t ix;
-  GPR_ASSERT(buffer_size >= record_size);
-  GPR_ASSERT(buffer_size % record_size == 0);
-  *num_records = buffer_size / record_size;
-  for (ix = 0; ix < *num_records; ++ix) {
-    size_t jx;
-    const char *record = buffer + (record_size * ix);
-    char data = (uintptr_t)record % 255;
-    for (jx = 0; jx < record_size; ++jx) {
-      GPR_ASSERT(data == record[jx]);
-    }
-  }
-}
-
-/* Tries to write the specified number of records. Stops when the log gets
-   full. Returns the number of records written. Spins for random
-   number of times, up to 'max_spin_count', between writes. */
-static size_t write_records_to_log(int writer_id, int32_t record_size,
-                                   int32_t num_records,
-                                   int32_t max_spin_count) {
-  int32_t ix;
-  int counter = 0;
-  for (ix = 0; ix < num_records; ++ix) {
-    int32_t jx;
-    int32_t spin_count = max_spin_count ? rand() % max_spin_count : 0;
-    char *record;
-    if (counter++ == num_records / 10) {
-      printf("   Writer %d: %d out of %d written\n", writer_id, ix,
-             num_records);
-      counter = 0;
-    }
-    record = (char *)(census_log_start_write(record_size));
-    if (record == NULL) {
-      return ix;
-    }
-    write_record(record, record_size);
-    census_log_end_write(record, record_size);
-    for (jx = 0; jx < spin_count; ++jx) {
-      GPR_ASSERT(jx >= 0);
-    }
-  }
-  return num_records;
-}
-
-/* Performs a single read iteration. Returns the number of records read. */
-static size_t perform_read_iteration(size_t record_size) {
-  const void *read_buffer = NULL;
-  size_t bytes_available;
-  size_t records_read = 0;
-  census_log_init_reader();
-  while ((read_buffer = census_log_read_next(&bytes_available))) {
-    int32_t num_records = 0;
-    read_records(record_size, (const char *)read_buffer, bytes_available,
-                 &num_records);
-    records_read += num_records;
-  }
-  return records_read;
-}
-
-/* Asserts that the log is empty. */
-static void assert_log_empty(void) {
-  size_t bytes_available;
-  census_log_init_reader();
-  GPR_ASSERT(census_log_read_next(&bytes_available) == NULL);
-}
-
-/* Given log size and record size, computes the minimum usable space. */
-static int32_t min_usable_space(size_t log_size, size_t record_size) {
-  int32_t usable_space;
-  int32_t num_blocks =
-      GPR_MAX(log_size / CENSUS_LOG_MAX_RECORD_SIZE, gpr_cpu_num_cores());
-  int32_t waste_per_block = CENSUS_LOG_MAX_RECORD_SIZE % record_size;
-  /* In the worst case, all except one core-local block is full. */
-  int32_t num_full_blocks = num_blocks - 1;
-  usable_space = (int32_t)log_size -
-                 (num_full_blocks * CENSUS_LOG_MAX_RECORD_SIZE) -
-                 ((num_blocks - num_full_blocks) * waste_per_block);
-  GPR_ASSERT(usable_space > 0);
-  return usable_space;
-}
-
-/* Fills the log and verifies data. If 'no fragmentation' is true, records
-   are sized such that CENSUS_LOG_2_MAX_RECORD_SIZE is a multiple of record
-   size. If not a circular log, verifies that the number of records written
-   match the number of records read. */
-static void fill_log(size_t log_size, int no_fragmentation, int circular_log) {
-  int size;
-  int32_t records_written;
-  int32_t usable_space;
-  int32_t records_read;
-  if (no_fragmentation) {
-    int log2size = rand() % (CENSUS_LOG_2_MAX_RECORD_SIZE + 1);
-    size = (1 << log2size);
-  } else {
-    while (1) {
-      size = 1 + (rand() % CENSUS_LOG_MAX_RECORD_SIZE);
-      if (CENSUS_LOG_MAX_RECORD_SIZE % size) {
-        break;
-      }
-    }
-  }
-  printf("   Fill record size: %d\n", size);
-  records_written = write_records_to_log(
-      0 /* writer id */, size, (log_size / size) * 2, 0 /* spin count */);
-  usable_space = min_usable_space(log_size, size);
-  GPR_ASSERT(records_written * size >= usable_space);
-  records_read = perform_read_iteration(size);
-  if (!circular_log) {
-    GPR_ASSERT(records_written == records_read);
-  }
-  assert_log_empty();
-}
-
-/* Structure to pass args to writer_thread */
-typedef struct writer_thread_args {
-  /* Index of this thread in the writers vector. */
-  int index;
-  /* Record size. */
-  size_t record_size;
-  /* Number of records to write. */
-  int32_t num_records;
-  /* Used to signal when writer is complete */
-  gpr_cv *done;
-  gpr_mu *mu;
-  int *count;
-} writer_thread_args;
-
-/* Writes the given number of records of random size (up to kMaxRecordSize) and
-   random data to the specified log. */
-static void writer_thread(void *arg) {
-  writer_thread_args *args = (writer_thread_args *)arg;
-  /* Maximum number of times to spin between writes. */
-  static const int32_t MAX_SPIN_COUNT = 50;
-  int records_written = 0;
-  printf("   Writer: %d\n", args->index);
-  while (records_written < args->num_records) {
-    records_written += write_records_to_log(args->index, args->record_size,
-                                            args->num_records - records_written,
-                                            MAX_SPIN_COUNT);
-    if (records_written < args->num_records) {
-      /* Ran out of log space. Sleep for a bit and let the reader catch up.
-         This should never happen for circular logs. */
-      printf("   Writer stalled due to out-of-space: %d out of %d written\n",
-             records_written, args->num_records);
-      gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(10));
-    }
-  }
-  /* Done. Decrement count and signal. */
-  gpr_mu_lock(args->mu);
-  (*args->count)--;
-  gpr_cv_broadcast(args->done);
-  printf("   Writer done: %d\n", args->index);
-  gpr_mu_unlock(args->mu);
-}
-
-/* struct to pass args to reader_thread */
-typedef struct reader_thread_args {
-  /* Record size. */
-  size_t record_size;
-  /* Interval between read iterations. */
-  int32_t read_iteration_interval_in_msec;
-  /* Total number of records. */
-  int32_t total_records;
-  /* Signalled when reader should stop. */
-  gpr_cv stop;
-  int stop_flag;
-  /* Used to signal when reader has finished */
-  gpr_cv *done;
-  gpr_mu *mu;
-  int running;
-} reader_thread_args;
-
-/* Reads and verifies the specified number of records. Reader can also be
-   stopped via gpr_cv_signal(&args->stop). Sleeps for 'read_interval_in_msec'
-   between read iterations. */
-static void reader_thread(void *arg) {
-  int32_t records_read = 0;
-  reader_thread_args *args = (reader_thread_args *)arg;
-  int32_t num_iterations = 0;
-  gpr_timespec interval;
-  int counter = 0;
-  printf("   Reader starting\n");
-  interval = gpr_time_from_micros(
-      (int64_t)args->read_iteration_interval_in_msec * 1000, GPR_TIMESPAN);
-  gpr_mu_lock(args->mu);
-  while (!args->stop_flag && records_read < args->total_records) {
-    gpr_cv_wait(&args->stop, args->mu, interval);
-    if (!args->stop_flag) {
-      records_read += perform_read_iteration(args->record_size);
-      GPR_ASSERT(records_read <= args->total_records);
-      if (counter++ == 100000) {
-        printf("   Reader: %d out of %d read\n", records_read,
-               args->total_records);
-        counter = 0;
-      }
-      ++num_iterations;
-    }
-  }
-  /* Done */
-  args->running = 0;
-  gpr_cv_broadcast(args->done);
-  printf("   Reader: records: %d, iterations: %d\n", records_read,
-         num_iterations);
-  gpr_mu_unlock(args->mu);
-}
-
-/* Creates NUM_WRITERS writers where each writer writes NUM_RECORDS_PER_WRITER
-   records. Also, starts a reader that iterates over and reads blocks every
-   READ_ITERATION_INTERVAL_IN_MSEC. */
-/* Number of writers. */
-#define NUM_WRITERS 5
-static void multiple_writers_single_reader(int circular_log) {
-  /* Sleep interval between read iterations. */
-  static const int32_t READ_ITERATION_INTERVAL_IN_MSEC = 10;
-  /* Number of records written by each writer. */
-  static const int32_t NUM_RECORDS_PER_WRITER = 10 * 1024 * 1024;
-  /* Maximum record size. */
-  static const size_t MAX_RECORD_SIZE = 10;
-  int ix;
-  gpr_thd_id id;
-  gpr_cv writers_done;
-  int writers_count = NUM_WRITERS;
-  gpr_mu writers_mu; /* protects writers_done and writers_count */
-  writer_thread_args writers[NUM_WRITERS];
-  gpr_cv reader_done;
-  gpr_mu reader_mu; /* protects reader_done and reader.running */
-  reader_thread_args reader;
-  int32_t record_size = 1 + rand() % MAX_RECORD_SIZE;
-  printf("   Record size: %d\n", record_size);
-  /* Create and start writers. */
-  gpr_cv_init(&writers_done);
-  gpr_mu_init(&writers_mu);
-  for (ix = 0; ix < NUM_WRITERS; ++ix) {
-    writers[ix].index = ix;
-    writers[ix].record_size = record_size;
-    writers[ix].num_records = NUM_RECORDS_PER_WRITER;
-    writers[ix].done = &writers_done;
-    writers[ix].count = &writers_count;
-    writers[ix].mu = &writers_mu;
-    gpr_thd_new(&id, &writer_thread, &writers[ix], NULL);
-  }
-  /* Start reader. */
-  reader.record_size = record_size;
-  reader.read_iteration_interval_in_msec = READ_ITERATION_INTERVAL_IN_MSEC;
-  reader.total_records = NUM_WRITERS * NUM_RECORDS_PER_WRITER;
-  reader.stop_flag = 0;
-  gpr_cv_init(&reader.stop);
-  gpr_cv_init(&reader_done);
-  reader.done = &reader_done;
-  gpr_mu_init(&reader_mu);
-  reader.mu = &reader_mu;
-  reader.running = 1;
-  gpr_thd_new(&id, &reader_thread, &reader, NULL);
-  /* Wait for writers to finish. */
-  gpr_mu_lock(&writers_mu);
-  while (writers_count != 0) {
-    gpr_cv_wait(&writers_done, &writers_mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  gpr_mu_unlock(&writers_mu);
-  gpr_mu_destroy(&writers_mu);
-  gpr_cv_destroy(&writers_done);
-  gpr_mu_lock(&reader_mu);
-  if (circular_log) {
-    /* Stop reader. */
-    reader.stop_flag = 1;
-    gpr_cv_signal(&reader.stop);
-  }
-  /* wait for reader to finish */
-  while (reader.running) {
-    gpr_cv_wait(&reader_done, &reader_mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  if (circular_log) {
-    /* Assert that there were no out-of-space errors. */
-    GPR_ASSERT(0 == census_log_out_of_space_count());
-  }
-  gpr_mu_unlock(&reader_mu);
-  gpr_mu_destroy(&reader_mu);
-  gpr_cv_destroy(&reader_done);
-  printf("   Reader: finished\n");
-}
-
-/* Log sizes to use for all tests. */
-#define LOG_SIZE_IN_MB 1
-#define LOG_SIZE_IN_BYTES (LOG_SIZE_IN_MB << 20)
-
-static void setup_test(int circular_log) {
-  census_log_initialize(LOG_SIZE_IN_MB, circular_log);
-  GPR_ASSERT(census_log_remaining_space() == LOG_SIZE_IN_BYTES);
-}
-
-/* Attempts to create a record of invalid size (size >
-   CENSUS_LOG_MAX_RECORD_SIZE). */
-void test_invalid_record_size(void) {
-  static const size_t INVALID_SIZE = CENSUS_LOG_MAX_RECORD_SIZE + 1;
-  static const size_t VALID_SIZE = 1;
-  void *record;
-  printf("Starting test: invalid record size\n");
-  setup_test(0);
-  record = census_log_start_write(INVALID_SIZE);
-  GPR_ASSERT(record == NULL);
-  /* Now try writing a valid record. */
-  record = census_log_start_write(VALID_SIZE);
-  GPR_ASSERT(record != NULL);
-  census_log_end_write(record, VALID_SIZE);
-  /* Verifies that available space went down by one block. In theory, this
-     check can fail if the thread is context switched to a new CPU during the
-     start_write execution (multiple blocks get allocated), but this has not
-     been observed in practice. */
-  GPR_ASSERT(LOG_SIZE_IN_BYTES - CENSUS_LOG_MAX_RECORD_SIZE ==
-             census_log_remaining_space());
-  census_log_shutdown();
-}
-
-/* Tests end_write() with a different size than what was specified in
-   start_write(). */
-void test_end_write_with_different_size(void) {
-  static const size_t START_WRITE_SIZE = 10;
-  static const size_t END_WRITE_SIZE = 7;
-  void *record_written;
-  const void *record_read;
-  size_t bytes_available;
-  printf("Starting test: end write with different size\n");
-  setup_test(0);
-  record_written = census_log_start_write(START_WRITE_SIZE);
-  GPR_ASSERT(record_written != NULL);
-  census_log_end_write(record_written, END_WRITE_SIZE);
-  census_log_init_reader();
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_written == record_read);
-  GPR_ASSERT(END_WRITE_SIZE == bytes_available);
-  assert_log_empty();
-  census_log_shutdown();
-}
-
-/* Verifies that pending records are not available via read_next(). */
-void test_read_pending_record(void) {
-  static const size_t PR_RECORD_SIZE = 1024;
-  size_t bytes_available;
-  const void *record_read;
-  void *record_written;
-  printf("Starting test: read pending record\n");
-  setup_test(0);
-  /* Start a write. */
-  record_written = census_log_start_write(PR_RECORD_SIZE);
-  GPR_ASSERT(record_written != NULL);
-  /* As write is pending, read should fail. */
-  census_log_init_reader();
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_read == NULL);
-  /* A read followed by end_write() should succeed. */
-  census_log_end_write(record_written, PR_RECORD_SIZE);
-  census_log_init_reader();
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_written == record_read);
-  GPR_ASSERT(PR_RECORD_SIZE == bytes_available);
-  assert_log_empty();
-  census_log_shutdown();
-}
-
-/* Tries reading beyond pending write. */
-void test_read_beyond_pending_record(void) {
-  /* Start a write. */
-  uint32_t incomplete_record_size = 10;
-  uint32_t complete_record_size = 20;
-  size_t bytes_available;
-  void *complete_record;
-  const void *record_read;
-  void *incomplete_record;
-  printf("Starting test: read beyond pending record\n");
-  setup_test(0);
-  incomplete_record = census_log_start_write(incomplete_record_size);
-  GPR_ASSERT(incomplete_record != NULL);
-  complete_record = census_log_start_write(complete_record_size);
-  GPR_ASSERT(complete_record != NULL);
-  GPR_ASSERT(complete_record != incomplete_record);
-  census_log_end_write(complete_record, complete_record_size);
-  /* Now iterate over blocks to read completed records. */
-  census_log_init_reader();
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(complete_record == record_read);
-  GPR_ASSERT(complete_record_size == bytes_available);
-  /* Complete first record. */
-  census_log_end_write(incomplete_record, incomplete_record_size);
-  /* Have read past the incomplete record, so read_next() should return NULL. */
-  /* NB: this test also assumes our thread did not get switched to a different
-     CPU between the two start_write calls */
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_read == NULL);
-  /* Reset reader to get the newly completed record. */
-  census_log_init_reader();
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(incomplete_record == record_read);
-  GPR_ASSERT(incomplete_record_size == bytes_available);
-  assert_log_empty();
-  census_log_shutdown();
-}
-
-/* Tests scenario where block being read is detached from a core and put on the
-   dirty list. */
-void test_detached_while_reading(void) {
-  static const size_t DWR_RECORD_SIZE = 10;
-  size_t bytes_available;
-  const void *record_read;
-  void *record_written;
-  uint32_t block_read = 0;
-  printf("Starting test: detached while reading\n");
-  setup_test(0);
-  /* Start a write. */
-  record_written = census_log_start_write(DWR_RECORD_SIZE);
-  GPR_ASSERT(record_written != NULL);
-  census_log_end_write(record_written, DWR_RECORD_SIZE);
-  /* Read this record. */
-  census_log_init_reader();
-  record_read = census_log_read_next(&bytes_available);
-  GPR_ASSERT(record_read != NULL);
-  GPR_ASSERT(DWR_RECORD_SIZE == bytes_available);
-  /* Now fill the log. This will move the block being read from core-local
-     array to the dirty list. */
-  while ((record_written = census_log_start_write(DWR_RECORD_SIZE))) {
-    census_log_end_write(record_written, DWR_RECORD_SIZE);
-  }
-
-  /* In this iteration, read_next() should only traverse blocks in the
-     core-local array. Therefore, we expect at most gpr_cpu_num_cores() more
-     blocks. As log is full, if read_next() is traversing the dirty list, we
-     will get more than gpr_cpu_num_cores() blocks. */
-  while ((record_read = census_log_read_next(&bytes_available))) {
-    ++block_read;
-    GPR_ASSERT(block_read <= gpr_cpu_num_cores());
-  }
-  census_log_shutdown();
-}
-
-/* Fills non-circular log with records sized such that size is a multiple of
-   CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). */
-void test_fill_log_no_fragmentation(void) {
-  const int circular = 0;
-  printf("Starting test: fill log no fragmentation\n");
-  setup_test(circular);
-  fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular);
-  census_log_shutdown();
-}
-
-/* Fills circular log with records sized such that size is a multiple of
-   CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). */
-void test_fill_circular_log_no_fragmentation(void) {
-  const int circular = 1;
-  printf("Starting test: fill circular log no fragmentation\n");
-  setup_test(circular);
-  fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular);
-  census_log_shutdown();
-}
-
-/* Fills non-circular log with records that may straddle end of a block. */
-void test_fill_log_with_straddling_records(void) {
-  const int circular = 0;
-  printf("Starting test: fill log with straddling records\n");
-  setup_test(circular);
-  fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular);
-  census_log_shutdown();
-}
-
-/* Fills circular log with records that may straddle end of a block. */
-void test_fill_circular_log_with_straddling_records(void) {
-  const int circular = 1;
-  printf("Starting test: fill circular log with straddling records\n");
-  setup_test(circular);
-  fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular);
-  census_log_shutdown();
-}
-
-/* Tests scenario where multiple writers and a single reader are using a log
-   that is configured to discard old records. */
-void test_multiple_writers_circular_log(void) {
-  const int circular = 1;
-  printf("Starting test: multiple writers circular log\n");
-  setup_test(circular);
-  multiple_writers_single_reader(circular);
-  census_log_shutdown();
-}
-
-/* Tests scenario where multiple writers and a single reader are using a log
-   that is configured to discard old records. */
-void test_multiple_writers(void) {
-  const int circular = 0;
-  printf("Starting test: multiple writers\n");
-  setup_test(circular);
-  multiple_writers_single_reader(circular);
-  census_log_shutdown();
-}
-
-/* Repeat the straddling records and multiple writers tests with a small log. */
-void test_small_log(void) {
-  size_t log_size;
-  const int circular = 0;
-  printf("Starting test: small log\n");
-  census_log_initialize(0, circular);
-  log_size = census_log_remaining_space();
-  GPR_ASSERT(log_size > 0);
-  fill_log(log_size, 0, circular);
-  census_log_shutdown();
-  census_log_initialize(0, circular);
-  multiple_writers_single_reader(circular);
-  census_log_shutdown();
-}
-
-void test_performance(void) {
-  int write_size = 1;
-  for (; write_size < CENSUS_LOG_MAX_RECORD_SIZE; write_size *= 2) {
-    gpr_timespec write_time;
-    gpr_timespec start_time;
-    double write_time_micro = 0.0;
-    int nrecords = 0;
-    setup_test(0);
-    start_time = gpr_now(GPR_CLOCK_REALTIME);
-    while (1) {
-      void *record = census_log_start_write(write_size);
-      if (record == NULL) {
-        break;
-      }
-      census_log_end_write(record, write_size);
-      nrecords++;
-    }
-    write_time = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start_time);
-    write_time_micro = write_time.tv_sec * 1000000 + write_time.tv_nsec / 1000;
-    census_log_shutdown();
-    printf(
-        "Wrote %d %d byte records in %.3g microseconds: %g records/us "
-        "(%g ns/record), %g gigabytes/s\n",
-        nrecords, write_size, write_time_micro, nrecords / write_time_micro,
-        1000 * write_time_micro / nrecords,
-        (write_size * nrecords) / write_time_micro / 1000);
-  }
-}
diff --git a/test/core/statistics/census_log_tests.cc b/test/core/statistics/census_log_tests.cc
new file mode 100644
index 0000000..e6eda54
--- /dev/null
+++ b/test/core/statistics/census_log_tests.cc
@@ -0,0 +1,576 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/cpu.h>
+#include <grpc/support/log.h>
+#include <grpc/support/port_platform.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "src/core/ext/census/census_log.h"
+#include "test/core/util/test_config.h"
+
+/* Fills in 'record' of size 'size'. Each byte in record is filled in with the
+   same value. The value is extracted from 'record' pointer. */
+static void write_record(char* record, size_t size) {
+  char data = (uintptr_t)record % 255;
+  memset(record, data, size);
+}
+
+/* Reads fixed size records. Returns the number of records read in
+   'num_records'. */
+static void read_records(size_t record_size, const char* buffer,
+                         size_t buffer_size, int32_t* num_records) {
+  int32_t ix;
+  GPR_ASSERT(buffer_size >= record_size);
+  GPR_ASSERT(buffer_size % record_size == 0);
+  *num_records = buffer_size / record_size;
+  for (ix = 0; ix < *num_records; ++ix) {
+    size_t jx;
+    const char* record = buffer + (record_size * ix);
+    char data = (uintptr_t)record % 255;
+    for (jx = 0; jx < record_size; ++jx) {
+      GPR_ASSERT(data == record[jx]);
+    }
+  }
+}
+
+/* Tries to write the specified number of records. Stops when the log gets
+   full. Returns the number of records written. Spins for random
+   number of times, up to 'max_spin_count', between writes. */
+static size_t write_records_to_log(int writer_id, int32_t record_size,
+                                   int32_t num_records,
+                                   int32_t max_spin_count) {
+  int32_t ix;
+  int counter = 0;
+  for (ix = 0; ix < num_records; ++ix) {
+    int32_t jx;
+    int32_t spin_count = max_spin_count ? rand() % max_spin_count : 0;
+    char* record;
+    if (counter++ == num_records / 10) {
+      printf("   Writer %d: %d out of %d written\n", writer_id, ix,
+             num_records);
+      counter = 0;
+    }
+    record = (char*)(census_log_start_write(record_size));
+    if (record == NULL) {
+      return ix;
+    }
+    write_record(record, record_size);
+    census_log_end_write(record, record_size);
+    for (jx = 0; jx < spin_count; ++jx) {
+      GPR_ASSERT(jx >= 0);
+    }
+  }
+  return num_records;
+}
+
+/* Performs a single read iteration. Returns the number of records read. */
+static size_t perform_read_iteration(size_t record_size) {
+  const void* read_buffer = NULL;
+  size_t bytes_available;
+  size_t records_read = 0;
+  census_log_init_reader();
+  while ((read_buffer = census_log_read_next(&bytes_available))) {
+    int32_t num_records = 0;
+    read_records(record_size, (const char*)read_buffer, bytes_available,
+                 &num_records);
+    records_read += num_records;
+  }
+  return records_read;
+}
+
+/* Asserts that the log is empty. */
+static void assert_log_empty(void) {
+  size_t bytes_available;
+  census_log_init_reader();
+  GPR_ASSERT(census_log_read_next(&bytes_available) == NULL);
+}
+
+/* Given log size and record size, computes the minimum usable space. */
+static int32_t min_usable_space(size_t log_size, size_t record_size) {
+  int32_t usable_space;
+  int32_t num_blocks =
+      GPR_MAX(log_size / CENSUS_LOG_MAX_RECORD_SIZE, gpr_cpu_num_cores());
+  int32_t waste_per_block = CENSUS_LOG_MAX_RECORD_SIZE % record_size;
+  /* In the worst case, all except one core-local block is full. */
+  int32_t num_full_blocks = num_blocks - 1;
+  usable_space = (int32_t)log_size -
+                 (num_full_blocks * CENSUS_LOG_MAX_RECORD_SIZE) -
+                 ((num_blocks - num_full_blocks) * waste_per_block);
+  GPR_ASSERT(usable_space > 0);
+  return usable_space;
+}
+
+/* Fills the log and verifies data. If 'no fragmentation' is true, records
+   are sized such that CENSUS_LOG_2_MAX_RECORD_SIZE is a multiple of record
+   size. If not a circular log, verifies that the number of records written
+   match the number of records read. */
+static void fill_log(size_t log_size, int no_fragmentation, int circular_log) {
+  int size;
+  int32_t records_written;
+  int32_t usable_space;
+  int32_t records_read;
+  if (no_fragmentation) {
+    int log2size = rand() % (CENSUS_LOG_2_MAX_RECORD_SIZE + 1);
+    size = (1 << log2size);
+  } else {
+    while (1) {
+      size = 1 + (rand() % CENSUS_LOG_MAX_RECORD_SIZE);
+      if (CENSUS_LOG_MAX_RECORD_SIZE % size) {
+        break;
+      }
+    }
+  }
+  printf("   Fill record size: %d\n", size);
+  records_written = write_records_to_log(
+      0 /* writer id */, size, (log_size / size) * 2, 0 /* spin count */);
+  usable_space = min_usable_space(log_size, size);
+  GPR_ASSERT(records_written * size >= usable_space);
+  records_read = perform_read_iteration(size);
+  if (!circular_log) {
+    GPR_ASSERT(records_written == records_read);
+  }
+  assert_log_empty();
+}
+
+/* Structure to pass args to writer_thread */
+typedef struct writer_thread_args {
+  /* Index of this thread in the writers vector. */
+  int index;
+  /* Record size. */
+  size_t record_size;
+  /* Number of records to write. */
+  int32_t num_records;
+  /* Used to signal when writer is complete */
+  gpr_cv* done;
+  gpr_mu* mu;
+  int* count;
+} writer_thread_args;
+
+/* Writes the given number of records of random size (up to kMaxRecordSize) and
+   random data to the specified log. */
+static void writer_thread(void* arg) {
+  writer_thread_args* args = (writer_thread_args*)arg;
+  /* Maximum number of times to spin between writes. */
+  static const int32_t MAX_SPIN_COUNT = 50;
+  int records_written = 0;
+  printf("   Writer: %d\n", args->index);
+  while (records_written < args->num_records) {
+    records_written += write_records_to_log(args->index, args->record_size,
+                                            args->num_records - records_written,
+                                            MAX_SPIN_COUNT);
+    if (records_written < args->num_records) {
+      /* Ran out of log space. Sleep for a bit and let the reader catch up.
+         This should never happen for circular logs. */
+      printf("   Writer stalled due to out-of-space: %d out of %d written\n",
+             records_written, args->num_records);
+      gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(10));
+    }
+  }
+  /* Done. Decrement count and signal. */
+  gpr_mu_lock(args->mu);
+  (*args->count)--;
+  gpr_cv_broadcast(args->done);
+  printf("   Writer done: %d\n", args->index);
+  gpr_mu_unlock(args->mu);
+}
+
+/* struct to pass args to reader_thread */
+typedef struct reader_thread_args {
+  /* Record size. */
+  size_t record_size;
+  /* Interval between read iterations. */
+  int32_t read_iteration_interval_in_msec;
+  /* Total number of records. */
+  int32_t total_records;
+  /* Signalled when reader should stop. */
+  gpr_cv stop;
+  int stop_flag;
+  /* Used to signal when reader has finished */
+  gpr_cv* done;
+  gpr_mu* mu;
+  int running;
+} reader_thread_args;
+
+/* Reads and verifies the specified number of records. Reader can also be
+   stopped via gpr_cv_signal(&args->stop). Sleeps for 'read_interval_in_msec'
+   between read iterations. */
+static void reader_thread(void* arg) {
+  int32_t records_read = 0;
+  reader_thread_args* args = (reader_thread_args*)arg;
+  int32_t num_iterations = 0;
+  gpr_timespec interval;
+  int counter = 0;
+  printf("   Reader starting\n");
+  interval = gpr_time_from_micros(
+      (int64_t)args->read_iteration_interval_in_msec * 1000, GPR_TIMESPAN);
+  gpr_mu_lock(args->mu);
+  while (!args->stop_flag && records_read < args->total_records) {
+    gpr_cv_wait(&args->stop, args->mu, interval);
+    if (!args->stop_flag) {
+      records_read += perform_read_iteration(args->record_size);
+      GPR_ASSERT(records_read <= args->total_records);
+      if (counter++ == 100000) {
+        printf("   Reader: %d out of %d read\n", records_read,
+               args->total_records);
+        counter = 0;
+      }
+      ++num_iterations;
+    }
+  }
+  /* Done */
+  args->running = 0;
+  gpr_cv_broadcast(args->done);
+  printf("   Reader: records: %d, iterations: %d\n", records_read,
+         num_iterations);
+  gpr_mu_unlock(args->mu);
+}
+
+/* Creates NUM_WRITERS writers where each writer writes NUM_RECORDS_PER_WRITER
+   records. Also, starts a reader that iterates over and reads blocks every
+   READ_ITERATION_INTERVAL_IN_MSEC. */
+/* Number of writers. */
+#define NUM_WRITERS 5
+static void multiple_writers_single_reader(int circular_log) {
+  /* Sleep interval between read iterations. */
+  static const int32_t READ_ITERATION_INTERVAL_IN_MSEC = 10;
+  /* Number of records written by each writer. */
+  static const int32_t NUM_RECORDS_PER_WRITER = 10 * 1024 * 1024;
+  /* Maximum record size. */
+  static const size_t MAX_RECORD_SIZE = 10;
+  int ix;
+  gpr_thd_id id;
+  gpr_cv writers_done;
+  int writers_count = NUM_WRITERS;
+  gpr_mu writers_mu; /* protects writers_done and writers_count */
+  writer_thread_args writers[NUM_WRITERS];
+  gpr_cv reader_done;
+  gpr_mu reader_mu; /* protects reader_done and reader.running */
+  reader_thread_args reader;
+  int32_t record_size = 1 + rand() % MAX_RECORD_SIZE;
+  printf("   Record size: %d\n", record_size);
+  /* Create and start writers. */
+  gpr_cv_init(&writers_done);
+  gpr_mu_init(&writers_mu);
+  for (ix = 0; ix < NUM_WRITERS; ++ix) {
+    writers[ix].index = ix;
+    writers[ix].record_size = record_size;
+    writers[ix].num_records = NUM_RECORDS_PER_WRITER;
+    writers[ix].done = &writers_done;
+    writers[ix].count = &writers_count;
+    writers[ix].mu = &writers_mu;
+    gpr_thd_new(&id, &writer_thread, &writers[ix], NULL);
+  }
+  /* Start reader. */
+  reader.record_size = record_size;
+  reader.read_iteration_interval_in_msec = READ_ITERATION_INTERVAL_IN_MSEC;
+  reader.total_records = NUM_WRITERS * NUM_RECORDS_PER_WRITER;
+  reader.stop_flag = 0;
+  gpr_cv_init(&reader.stop);
+  gpr_cv_init(&reader_done);
+  reader.done = &reader_done;
+  gpr_mu_init(&reader_mu);
+  reader.mu = &reader_mu;
+  reader.running = 1;
+  gpr_thd_new(&id, &reader_thread, &reader, NULL);
+  /* Wait for writers to finish. */
+  gpr_mu_lock(&writers_mu);
+  while (writers_count != 0) {
+    gpr_cv_wait(&writers_done, &writers_mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+  }
+  gpr_mu_unlock(&writers_mu);
+  gpr_mu_destroy(&writers_mu);
+  gpr_cv_destroy(&writers_done);
+  gpr_mu_lock(&reader_mu);
+  if (circular_log) {
+    /* Stop reader. */
+    reader.stop_flag = 1;
+    gpr_cv_signal(&reader.stop);
+  }
+  /* wait for reader to finish */
+  while (reader.running) {
+    gpr_cv_wait(&reader_done, &reader_mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+  }
+  if (circular_log) {
+    /* Assert that there were no out-of-space errors. */
+    GPR_ASSERT(0 == census_log_out_of_space_count());
+  }
+  gpr_mu_unlock(&reader_mu);
+  gpr_mu_destroy(&reader_mu);
+  gpr_cv_destroy(&reader_done);
+  printf("   Reader: finished\n");
+}
+
+/* Log sizes to use for all tests. */
+#define LOG_SIZE_IN_MB 1
+#define LOG_SIZE_IN_BYTES (LOG_SIZE_IN_MB << 20)
+
+static void setup_test(int circular_log) {
+  census_log_initialize(LOG_SIZE_IN_MB, circular_log);
+  GPR_ASSERT(census_log_remaining_space() == LOG_SIZE_IN_BYTES);
+}
+
+/* Attempts to create a record of invalid size (size >
+   CENSUS_LOG_MAX_RECORD_SIZE). */
+void test_invalid_record_size(void) {
+  static const size_t INVALID_SIZE = CENSUS_LOG_MAX_RECORD_SIZE + 1;
+  static const size_t VALID_SIZE = 1;
+  void* record;
+  printf("Starting test: invalid record size\n");
+  setup_test(0);
+  record = census_log_start_write(INVALID_SIZE);
+  GPR_ASSERT(record == NULL);
+  /* Now try writing a valid record. */
+  record = census_log_start_write(VALID_SIZE);
+  GPR_ASSERT(record != NULL);
+  census_log_end_write(record, VALID_SIZE);
+  /* Verifies that available space went down by one block. In theory, this
+     check can fail if the thread is context switched to a new CPU during the
+     start_write execution (multiple blocks get allocated), but this has not
+     been observed in practice. */
+  GPR_ASSERT(LOG_SIZE_IN_BYTES - CENSUS_LOG_MAX_RECORD_SIZE ==
+             census_log_remaining_space());
+  census_log_shutdown();
+}
+
+/* Tests end_write() with a different size than what was specified in
+   start_write(). */
+void test_end_write_with_different_size(void) {
+  static const size_t START_WRITE_SIZE = 10;
+  static const size_t END_WRITE_SIZE = 7;
+  void* record_written;
+  const void* record_read;
+  size_t bytes_available;
+  printf("Starting test: end write with different size\n");
+  setup_test(0);
+  record_written = census_log_start_write(START_WRITE_SIZE);
+  GPR_ASSERT(record_written != NULL);
+  census_log_end_write(record_written, END_WRITE_SIZE);
+  census_log_init_reader();
+  record_read = census_log_read_next(&bytes_available);
+  GPR_ASSERT(record_written == record_read);
+  GPR_ASSERT(END_WRITE_SIZE == bytes_available);
+  assert_log_empty();
+  census_log_shutdown();
+}
+
+/* Verifies that pending records are not available via read_next(). */
+void test_read_pending_record(void) {
+  static const size_t PR_RECORD_SIZE = 1024;
+  size_t bytes_available;
+  const void* record_read;
+  void* record_written;
+  printf("Starting test: read pending record\n");
+  setup_test(0);
+  /* Start a write. */
+  record_written = census_log_start_write(PR_RECORD_SIZE);
+  GPR_ASSERT(record_written != NULL);
+  /* As write is pending, read should fail. */
+  census_log_init_reader();
+  record_read = census_log_read_next(&bytes_available);
+  GPR_ASSERT(record_read == NULL);
+  /* A read followed by end_write() should succeed. */
+  census_log_end_write(record_written, PR_RECORD_SIZE);
+  census_log_init_reader();
+  record_read = census_log_read_next(&bytes_available);
+  GPR_ASSERT(record_written == record_read);
+  GPR_ASSERT(PR_RECORD_SIZE == bytes_available);
+  assert_log_empty();
+  census_log_shutdown();
+}
+
+/* Tries reading beyond pending write. */
+void test_read_beyond_pending_record(void) {
+  /* Start a write. */
+  uint32_t incomplete_record_size = 10;
+  uint32_t complete_record_size = 20;
+  size_t bytes_available;
+  void* complete_record;
+  const void* record_read;
+  void* incomplete_record;
+  printf("Starting test: read beyond pending record\n");
+  setup_test(0);
+  incomplete_record = census_log_start_write(incomplete_record_size);
+  GPR_ASSERT(incomplete_record != NULL);
+  complete_record = census_log_start_write(complete_record_size);
+  GPR_ASSERT(complete_record != NULL);
+  GPR_ASSERT(complete_record != incomplete_record);
+  census_log_end_write(complete_record, complete_record_size);
+  /* Now iterate over blocks to read completed records. */
+  census_log_init_reader();
+  record_read = census_log_read_next(&bytes_available);
+  GPR_ASSERT(complete_record == record_read);
+  GPR_ASSERT(complete_record_size == bytes_available);
+  /* Complete first record. */
+  census_log_end_write(incomplete_record, incomplete_record_size);
+  /* Have read past the incomplete record, so read_next() should return NULL. */
+  /* NB: this test also assumes our thread did not get switched to a different
+     CPU between the two start_write calls */
+  record_read = census_log_read_next(&bytes_available);
+  GPR_ASSERT(record_read == NULL);
+  /* Reset reader to get the newly completed record. */
+  census_log_init_reader();
+  record_read = census_log_read_next(&bytes_available);
+  GPR_ASSERT(incomplete_record == record_read);
+  GPR_ASSERT(incomplete_record_size == bytes_available);
+  assert_log_empty();
+  census_log_shutdown();
+}
+
+/* Tests scenario where block being read is detached from a core and put on the
+   dirty list. */
+void test_detached_while_reading(void) {
+  static const size_t DWR_RECORD_SIZE = 10;
+  size_t bytes_available;
+  const void* record_read;
+  void* record_written;
+  uint32_t block_read = 0;
+  printf("Starting test: detached while reading\n");
+  setup_test(0);
+  /* Start a write. */
+  record_written = census_log_start_write(DWR_RECORD_SIZE);
+  GPR_ASSERT(record_written != NULL);
+  census_log_end_write(record_written, DWR_RECORD_SIZE);
+  /* Read this record. */
+  census_log_init_reader();
+  record_read = census_log_read_next(&bytes_available);
+  GPR_ASSERT(record_read != NULL);
+  GPR_ASSERT(DWR_RECORD_SIZE == bytes_available);
+  /* Now fill the log. This will move the block being read from core-local
+     array to the dirty list. */
+  while ((record_written = census_log_start_write(DWR_RECORD_SIZE))) {
+    census_log_end_write(record_written, DWR_RECORD_SIZE);
+  }
+
+  /* In this iteration, read_next() should only traverse blocks in the
+     core-local array. Therefore, we expect at most gpr_cpu_num_cores() more
+     blocks. As log is full, if read_next() is traversing the dirty list, we
+     will get more than gpr_cpu_num_cores() blocks. */
+  while ((record_read = census_log_read_next(&bytes_available))) {
+    ++block_read;
+    GPR_ASSERT(block_read <= gpr_cpu_num_cores());
+  }
+  census_log_shutdown();
+}
+
+/* Fills non-circular log with records sized such that size is a multiple of
+   CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). */
+void test_fill_log_no_fragmentation(void) {
+  const int circular = 0;
+  printf("Starting test: fill log no fragmentation\n");
+  setup_test(circular);
+  fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular);
+  census_log_shutdown();
+}
+
+/* Fills circular log with records sized such that size is a multiple of
+   CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). */
+void test_fill_circular_log_no_fragmentation(void) {
+  const int circular = 1;
+  printf("Starting test: fill circular log no fragmentation\n");
+  setup_test(circular);
+  fill_log(LOG_SIZE_IN_BYTES, 1 /* no fragmentation */, circular);
+  census_log_shutdown();
+}
+
+/* Fills non-circular log with records that may straddle end of a block. */
+void test_fill_log_with_straddling_records(void) {
+  const int circular = 0;
+  printf("Starting test: fill log with straddling records\n");
+  setup_test(circular);
+  fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular);
+  census_log_shutdown();
+}
+
+/* Fills circular log with records that may straddle end of a block. */
+void test_fill_circular_log_with_straddling_records(void) {
+  const int circular = 1;
+  printf("Starting test: fill circular log with straddling records\n");
+  setup_test(circular);
+  fill_log(LOG_SIZE_IN_BYTES, 0 /* block straddling records */, circular);
+  census_log_shutdown();
+}
+
+/* Tests scenario where multiple writers and a single reader are using a log
+   that is configured to discard old records. */
+void test_multiple_writers_circular_log(void) {
+  const int circular = 1;
+  printf("Starting test: multiple writers circular log\n");
+  setup_test(circular);
+  multiple_writers_single_reader(circular);
+  census_log_shutdown();
+}
+
+/* Tests scenario where multiple writers and a single reader are using a log
+   that is configured to discard old records. */
+void test_multiple_writers(void) {
+  const int circular = 0;
+  printf("Starting test: multiple writers\n");
+  setup_test(circular);
+  multiple_writers_single_reader(circular);
+  census_log_shutdown();
+}
+
+/* Repeat the straddling records and multiple writers tests with a small log. */
+void test_small_log(void) {
+  size_t log_size;
+  const int circular = 0;
+  printf("Starting test: small log\n");
+  census_log_initialize(0, circular);
+  log_size = census_log_remaining_space();
+  GPR_ASSERT(log_size > 0);
+  fill_log(log_size, 0, circular);
+  census_log_shutdown();
+  census_log_initialize(0, circular);
+  multiple_writers_single_reader(circular);
+  census_log_shutdown();
+}
+
+void test_performance(void) {
+  int write_size = 1;
+  for (; write_size < CENSUS_LOG_MAX_RECORD_SIZE; write_size *= 2) {
+    gpr_timespec write_time;
+    gpr_timespec start_time;
+    double write_time_micro = 0.0;
+    int nrecords = 0;
+    setup_test(0);
+    start_time = gpr_now(GPR_CLOCK_REALTIME);
+    while (1) {
+      void* record = census_log_start_write(write_size);
+      if (record == NULL) {
+        break;
+      }
+      census_log_end_write(record, write_size);
+      nrecords++;
+    }
+    write_time = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start_time);
+    write_time_micro = write_time.tv_sec * 1000000 + write_time.tv_nsec / 1000;
+    census_log_shutdown();
+    printf(
+        "Wrote %d %d byte records in %.3g microseconds: %g records/us "
+        "(%g ns/record), %g gigabytes/s\n",
+        nrecords, write_size, write_time_micro, nrecords / write_time_micro,
+        1000 * write_time_micro / nrecords,
+        (write_size * nrecords) / write_time_micro / 1000);
+  }
+}
diff --git a/test/core/statistics/census_stub_test.c b/test/core/statistics/census_stub_test.c
deleted file mode 100644
index f38d571..0000000
--- a/test/core/statistics/census_stub_test.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/ext/census/census_interface.h"
-#include "src/core/ext/census/census_rpc_stats.h"
-#include "test/core/util/test_config.h"
-
-/* Tests census noop stubs in a simulated rpc flow */
-void test_census_stubs(void) {
-  census_op_id op_id;
-  census_rpc_stats *stats = census_rpc_stats_create_empty();
-  census_aggregated_rpc_stats data_map = {0, NULL};
-
-  /* Initializes census library at server start up time. */
-  census_init();
-  /* Starts tracing at the beginning of a rpc. */
-  op_id = census_tracing_start_op();
-  /* Appends custom annotations on a trace object. */
-  census_tracing_print(op_id, "annotation foo");
-  census_tracing_print(op_id, "annotation bar");
-  /* Appends method tag on the trace object. */
-  census_add_method_tag(op_id, "service_foo/method.bar");
-  /* Either record client side stats or server side stats associated with the
-     op_id. Here for testing purpose, we record both. */
-  census_record_rpc_client_stats(op_id, stats);
-  census_record_rpc_server_stats(op_id, stats);
-  /* Ends a tracing. */
-  census_tracing_end_op(op_id);
-  /* In process stats queries. */
-  census_get_server_stats(&data_map);
-  census_aggregated_rpc_stats_set_empty(&data_map);
-  census_get_client_stats(&data_map);
-  census_aggregated_rpc_stats_set_empty(&data_map);
-  gpr_free(stats);
-  census_shutdown();
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_census_stubs();
-  return 0;
-}
diff --git a/test/core/statistics/census_stub_test.cc b/test/core/statistics/census_stub_test.cc
new file mode 100644
index 0000000..507ae0a
--- /dev/null
+++ b/test/core/statistics/census_stub_test.cc
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include "src/core/ext/census/census_interface.h"
+#include "src/core/ext/census/census_rpc_stats.h"
+#include "test/core/util/test_config.h"
+
+/* Tests census noop stubs in a simulated rpc flow */
+void test_census_stubs(void) {
+  census_op_id op_id;
+  census_rpc_stats* stats = census_rpc_stats_create_empty();
+  census_aggregated_rpc_stats data_map = {0, NULL};
+
+  /* Initializes census library at server start up time. */
+  census_init();
+  /* Starts tracing at the beginning of a rpc. */
+  op_id = census_tracing_start_op();
+  /* Appends custom annotations on a trace object. */
+  census_tracing_print(op_id, "annotation foo");
+  census_tracing_print(op_id, "annotation bar");
+  /* Appends method tag on the trace object. */
+  census_add_method_tag(op_id, "service_foo/method.bar");
+  /* Either record client side stats or server side stats associated with the
+     op_id. Here for testing purpose, we record both. */
+  census_record_rpc_client_stats(op_id, stats);
+  census_record_rpc_server_stats(op_id, stats);
+  /* Ends a tracing. */
+  census_tracing_end_op(op_id);
+  /* In process stats queries. */
+  census_get_server_stats(&data_map);
+  census_aggregated_rpc_stats_set_empty(&data_map);
+  census_get_client_stats(&data_map);
+  census_aggregated_rpc_stats_set_empty(&data_map);
+  gpr_free(stats);
+  census_shutdown();
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_census_stubs();
+  return 0;
+}
diff --git a/test/core/statistics/hash_table_test.c b/test/core/statistics/hash_table_test.c
deleted file mode 100644
index d714e15..0000000
--- a/test/core/statistics/hash_table_test.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "src/core/ext/census/hash_table.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include "src/core/lib/support/murmur_hash.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/util/test_config.h"
-
-static uint64_t hash64(const void *k) {
-  size_t len = strlen(k);
-  uint64_t higher = gpr_murmur_hash3((const char *)k, len / 2, 0);
-  return higher << 32 |
-         gpr_murmur_hash3((const char *)(k) + len / 2, len - len / 2, 0);
-}
-
-static int cmp_str_keys(const void *k1, const void *k2) {
-  return strcmp((const char *)k1, (const char *)k2);
-}
-
-static uint64_t force_collision(const void *k) {
-  return (1997 + hash64(k) % 3);
-}
-
-static void free_data(void *data) { gpr_free(data); }
-
-/* Basic tests that empty hash table can be created and destroyed. */
-static void test_create_table(void) {
-  /* Create table with uint64 key type */
-  census_ht *ht = NULL;
-  census_ht_option ht_options = {
-      CENSUS_HT_UINT64, 1999, NULL, NULL, NULL, NULL};
-  ht = census_ht_create(&ht_options);
-  GPR_ASSERT(ht != NULL);
-  GPR_ASSERT(census_ht_get_size(ht) == 0);
-  census_ht_destroy(ht);
-  /* Create table with pointer key type */
-  ht = NULL;
-  ht_options.key_type = CENSUS_HT_POINTER;
-  ht_options.hash = &hash64;
-  ht_options.compare_keys = &cmp_str_keys;
-  ht = census_ht_create(&ht_options);
-  GPR_ASSERT(ht != NULL);
-  GPR_ASSERT(census_ht_get_size(ht) == 0);
-  census_ht_destroy(ht);
-}
-
-static void test_table_with_int_key(void) {
-  census_ht_option opt = {CENSUS_HT_UINT64, 7, NULL, NULL, NULL, NULL};
-  census_ht *ht = census_ht_create(&opt);
-  uint64_t i = 0;
-  uint64_t sum_of_keys = 0;
-  size_t num_elements;
-  census_ht_kv *elements = NULL;
-  GPR_ASSERT(ht != NULL);
-  GPR_ASSERT(census_ht_get_size(ht) == 0);
-  elements = census_ht_get_all_elements(ht, &num_elements);
-  GPR_ASSERT(num_elements == 0);
-  GPR_ASSERT(elements == NULL);
-  for (i = 0; i < 20; ++i) {
-    census_ht_key key;
-    key.val = i;
-    census_ht_insert(ht, key, (void *)(intptr_t)i);
-    GPR_ASSERT(census_ht_get_size(ht) == i + 1);
-  }
-  for (i = 0; i < 20; i++) {
-    uint64_t *val = NULL;
-    census_ht_key key;
-    key.val = i;
-    val = census_ht_find(ht, key);
-    GPR_ASSERT(val == (void *)(intptr_t)i);
-  }
-  elements = census_ht_get_all_elements(ht, &num_elements);
-  GPR_ASSERT(elements != NULL);
-  GPR_ASSERT(num_elements == 20);
-  for (i = 0; i < num_elements; i++) {
-    sum_of_keys += elements[i].k.val;
-  }
-  GPR_ASSERT(sum_of_keys == 190);
-  gpr_free(elements);
-  census_ht_destroy(ht);
-}
-
-/* Test that there is no memory leak when keys and values are owned by table. */
-static void test_value_and_key_deleter(void) {
-  census_ht_option opt = {CENSUS_HT_POINTER, 7,          &hash64,
-                          &cmp_str_keys,     &free_data, &free_data};
-  census_ht *ht = census_ht_create(&opt);
-  census_ht_key key;
-  char *val = NULL;
-  char *val2 = NULL;
-  key.ptr = gpr_malloc(100);
-  val = gpr_malloc(10);
-  strcpy(val, "value");
-  strcpy(key.ptr, "some string as a key");
-  GPR_ASSERT(ht != NULL);
-  GPR_ASSERT(census_ht_get_size(ht) == 0);
-  census_ht_insert(ht, key, val);
-  GPR_ASSERT(census_ht_get_size(ht) == 1);
-  val = census_ht_find(ht, key);
-  GPR_ASSERT(val != NULL);
-  GPR_ASSERT(strcmp(val, "value") == 0);
-  /* Insert same key different value, old value is overwritten. */
-  val2 = gpr_malloc(10);
-  strcpy(val2, "v2");
-  census_ht_insert(ht, key, val2);
-  GPR_ASSERT(census_ht_get_size(ht) == 1);
-  val2 = census_ht_find(ht, key);
-  GPR_ASSERT(val2 != NULL);
-  GPR_ASSERT(strcmp(val2, "v2") == 0);
-  census_ht_destroy(ht);
-}
-
-/* Test simple insert and erase operations. */
-static void test_simple_add_and_erase(void) {
-  census_ht_option opt = {CENSUS_HT_UINT64, 7, NULL, NULL, NULL, NULL};
-  census_ht *ht = census_ht_create(&opt);
-  GPR_ASSERT(ht != NULL);
-  GPR_ASSERT(census_ht_get_size(ht) == 0);
-  {
-    census_ht_key key;
-    int val = 3;
-    key.val = 2;
-    census_ht_insert(ht, key, (void *)&val);
-    GPR_ASSERT(census_ht_get_size(ht) == 1);
-    census_ht_erase(ht, key);
-    GPR_ASSERT(census_ht_get_size(ht) == 0);
-    /* Erasing a key from an empty table should be noop. */
-    census_ht_erase(ht, key);
-    GPR_ASSERT(census_ht_get_size(ht) == 0);
-    /* Erasing a non-existant key from a table should be noop. */
-    census_ht_insert(ht, key, (void *)&val);
-    key.val = 3;
-    census_ht_insert(ht, key, (void *)&val);
-    key.val = 9;
-    census_ht_insert(ht, key, (void *)&val);
-    GPR_ASSERT(census_ht_get_size(ht) == 3);
-    key.val = 1;
-    census_ht_erase(ht, key);
-    /* size unchanged after deleting non-existant key. */
-    GPR_ASSERT(census_ht_get_size(ht) == 3);
-    /* size decrease by 1 after deleting an existant key. */
-    key.val = 2;
-    census_ht_erase(ht, key);
-    GPR_ASSERT(census_ht_get_size(ht) == 2);
-  }
-  census_ht_destroy(ht);
-}
-
-static void test_insertion_and_deletion_with_high_collision_rate(void) {
-  census_ht_option opt = {CENSUS_HT_POINTER, 13,   &force_collision,
-                          &cmp_str_keys,     NULL, NULL};
-  census_ht *ht = census_ht_create(&opt);
-  char key_str[1000][GPR_LTOA_MIN_BUFSIZE];
-  uint64_t val = 0;
-  unsigned i = 0;
-  for (i = 0; i < 1000; i++) {
-    census_ht_key key;
-    key.ptr = key_str[i];
-    gpr_ltoa(i, key_str[i]);
-    census_ht_insert(ht, key, (void *)(&val));
-    gpr_log(GPR_INFO, "%d\n", i);
-    GPR_ASSERT(census_ht_get_size(ht) == (i + 1));
-  }
-  for (i = 0; i < 1000; i++) {
-    census_ht_key key;
-    key.ptr = key_str[i];
-    census_ht_erase(ht, key);
-    GPR_ASSERT(census_ht_get_size(ht) == (999 - i));
-  }
-  census_ht_destroy(ht);
-}
-
-static void test_table_with_string_key(void) {
-  census_ht_option opt = {CENSUS_HT_POINTER, 7,    &hash64,
-                          &cmp_str_keys,     NULL, NULL};
-  census_ht *ht = census_ht_create(&opt);
-  const char *keys[] = {
-      "k1", "a",   "000", "apple", "banana_a_long_long_long_banana",
-      "%$", "111", "foo", "b"};
-  const int vals[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
-  int i = 0;
-  GPR_ASSERT(ht != NULL);
-  GPR_ASSERT(census_ht_get_size(ht) == 0);
-  for (i = 0; i < 9; i++) {
-    census_ht_key key;
-    key.ptr = (void *)(keys[i]);
-    census_ht_insert(ht, key, (void *)(vals + i));
-  }
-  GPR_ASSERT(census_ht_get_size(ht) == 9);
-  for (i = 0; i < 9; i++) {
-    census_ht_key key;
-    int *val_ptr;
-    key.ptr = (void *)(keys[i]);
-    val_ptr = census_ht_find(ht, key);
-    GPR_ASSERT(*val_ptr == vals[i]);
-  }
-  {
-    /* inserts duplicate keys */
-    census_ht_key key;
-    int *val_ptr = NULL;
-    key.ptr = (void *)(keys[2]);
-    census_ht_insert(ht, key, (void *)(vals + 8));
-    /* expect value to be over written by new insertion */
-    GPR_ASSERT(census_ht_get_size(ht) == 9);
-    val_ptr = census_ht_find(ht, key);
-    GPR_ASSERT(*val_ptr == vals[8]);
-  }
-  for (i = 0; i < 9; i++) {
-    census_ht_key key;
-    int *val_ptr;
-    uint32_t expected_tbl_sz = 9 - i;
-    GPR_ASSERT(census_ht_get_size(ht) == expected_tbl_sz);
-    key.ptr = (void *)(keys[i]);
-    val_ptr = census_ht_find(ht, key);
-    GPR_ASSERT(val_ptr != NULL);
-    census_ht_erase(ht, key);
-    GPR_ASSERT(census_ht_get_size(ht) == expected_tbl_sz - 1);
-    val_ptr = census_ht_find(ht, key);
-    GPR_ASSERT(val_ptr == NULL);
-  }
-  census_ht_destroy(ht);
-}
-
-static void test_insertion_with_same_key(void) {
-  census_ht_option opt = {CENSUS_HT_UINT64, 11, NULL, NULL, NULL, NULL};
-  census_ht *ht = census_ht_create(&opt);
-  census_ht_key key;
-  const char vals[] = {'a', 'b', 'c'};
-  char *val_ptr;
-  key.val = 3;
-  census_ht_insert(ht, key, (void *)&(vals[0]));
-  GPR_ASSERT(census_ht_get_size(ht) == 1);
-  val_ptr = (char *)census_ht_find(ht, key);
-  GPR_ASSERT(val_ptr != NULL);
-  GPR_ASSERT(*val_ptr == 'a');
-  key.val = 4;
-  val_ptr = (char *)census_ht_find(ht, key);
-  GPR_ASSERT(val_ptr == NULL);
-  key.val = 3;
-  census_ht_insert(ht, key, (void *)&(vals[1]));
-  GPR_ASSERT(census_ht_get_size(ht) == 1);
-  val_ptr = (char *)census_ht_find(ht, key);
-  GPR_ASSERT(val_ptr != NULL);
-  GPR_ASSERT(*val_ptr == 'b');
-  census_ht_insert(ht, key, (void *)&(vals[2]));
-  GPR_ASSERT(census_ht_get_size(ht) == 1);
-  val_ptr = (char *)census_ht_find(ht, key);
-  GPR_ASSERT(val_ptr != NULL);
-  GPR_ASSERT(*val_ptr == 'c');
-  census_ht_destroy(ht);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_create_table();
-  test_simple_add_and_erase();
-  test_table_with_int_key();
-  test_table_with_string_key();
-  test_value_and_key_deleter();
-  test_insertion_with_same_key();
-  test_insertion_and_deletion_with_high_collision_rate();
-  return 0;
-}
diff --git a/test/core/statistics/hash_table_test.cc b/test/core/statistics/hash_table_test.cc
new file mode 100644
index 0000000..b660006
--- /dev/null
+++ b/test/core/statistics/hash_table_test.cc
@@ -0,0 +1,286 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "src/core/ext/census/hash_table.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include "src/core/lib/support/murmur_hash.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/util/test_config.h"
+
+static uint64_t hash64(const void* k) {
+  size_t len = strlen(k);
+  uint64_t higher = gpr_murmur_hash3((const char*)k, len / 2, 0);
+  return higher << 32 |
+         gpr_murmur_hash3((const char*)(k) + len / 2, len - len / 2, 0);
+}
+
+static int cmp_str_keys(const void* k1, const void* k2) {
+  return strcmp((const char*)k1, (const char*)k2);
+}
+
+static uint64_t force_collision(const void* k) {
+  return (1997 + hash64(k) % 3);
+}
+
+static void free_data(void* data) { gpr_free(data); }
+
+/* Basic tests that empty hash table can be created and destroyed. */
+static void test_create_table(void) {
+  /* Create table with uint64 key type */
+  census_ht* ht = NULL;
+  census_ht_option ht_options = {
+      CENSUS_HT_UINT64, 1999, NULL, NULL, NULL, NULL};
+  ht = census_ht_create(&ht_options);
+  GPR_ASSERT(ht != NULL);
+  GPR_ASSERT(census_ht_get_size(ht) == 0);
+  census_ht_destroy(ht);
+  /* Create table with pointer key type */
+  ht = NULL;
+  ht_options.key_type = CENSUS_HT_POINTER;
+  ht_options.hash = &hash64;
+  ht_options.compare_keys = &cmp_str_keys;
+  ht = census_ht_create(&ht_options);
+  GPR_ASSERT(ht != NULL);
+  GPR_ASSERT(census_ht_get_size(ht) == 0);
+  census_ht_destroy(ht);
+}
+
+static void test_table_with_int_key(void) {
+  census_ht_option opt = {CENSUS_HT_UINT64, 7, NULL, NULL, NULL, NULL};
+  census_ht* ht = census_ht_create(&opt);
+  uint64_t i = 0;
+  uint64_t sum_of_keys = 0;
+  size_t num_elements;
+  census_ht_kv* elements = NULL;
+  GPR_ASSERT(ht != NULL);
+  GPR_ASSERT(census_ht_get_size(ht) == 0);
+  elements = census_ht_get_all_elements(ht, &num_elements);
+  GPR_ASSERT(num_elements == 0);
+  GPR_ASSERT(elements == NULL);
+  for (i = 0; i < 20; ++i) {
+    census_ht_key key;
+    key.val = i;
+    census_ht_insert(ht, key, (void*)(intptr_t)i);
+    GPR_ASSERT(census_ht_get_size(ht) == i + 1);
+  }
+  for (i = 0; i < 20; i++) {
+    uint64_t* val = NULL;
+    census_ht_key key;
+    key.val = i;
+    val = static_cast<uint64_t*>(census_ht_find(ht, key));
+    GPR_ASSERT(val == (void*)(intptr_t)i);
+  }
+  elements = census_ht_get_all_elements(ht, &num_elements);
+  GPR_ASSERT(elements != NULL);
+  GPR_ASSERT(num_elements == 20);
+  for (i = 0; i < num_elements; i++) {
+    sum_of_keys += elements[i].k.val;
+  }
+  GPR_ASSERT(sum_of_keys == 190);
+  gpr_free(elements);
+  census_ht_destroy(ht);
+}
+
+/* Test that there is no memory leak when keys and values are owned by table. */
+static void test_value_and_key_deleter(void) {
+  census_ht_option opt = {CENSUS_HT_POINTER, 7,          &hash64,
+                          &cmp_str_keys,     &free_data, &free_data};
+  census_ht* ht = census_ht_create(&opt);
+  census_ht_key key;
+  char* val = NULL;
+  char* val2 = NULL;
+  key.ptr = gpr_malloc(100);
+  val = static_cast<char*>(gpr_malloc(10));
+  strcpy(val, "value");
+  strcpy(key.ptr, "some string as a key");
+  GPR_ASSERT(ht != NULL);
+  GPR_ASSERT(census_ht_get_size(ht) == 0);
+  census_ht_insert(ht, key, val);
+  GPR_ASSERT(census_ht_get_size(ht) == 1);
+  val = static_cast<char*>(census_ht_find(ht, key));
+  GPR_ASSERT(val != NULL);
+  GPR_ASSERT(strcmp(val, "value") == 0);
+  /* Insert same key different value, old value is overwritten. */
+  val2 = static_cast<char*>(gpr_malloc(10));
+  strcpy(val2, "v2");
+  census_ht_insert(ht, key, val2);
+  GPR_ASSERT(census_ht_get_size(ht) == 1);
+  val2 = static_cast<char*>(census_ht_find(ht, key));
+  GPR_ASSERT(val2 != NULL);
+  GPR_ASSERT(strcmp(val2, "v2") == 0);
+  census_ht_destroy(ht);
+}
+
+/* Test simple insert and erase operations. */
+static void test_simple_add_and_erase(void) {
+  census_ht_option opt = {CENSUS_HT_UINT64, 7, NULL, NULL, NULL, NULL};
+  census_ht* ht = census_ht_create(&opt);
+  GPR_ASSERT(ht != NULL);
+  GPR_ASSERT(census_ht_get_size(ht) == 0);
+  {
+    census_ht_key key;
+    int val = 3;
+    key.val = 2;
+    census_ht_insert(ht, key, (void*)&val);
+    GPR_ASSERT(census_ht_get_size(ht) == 1);
+    census_ht_erase(ht, key);
+    GPR_ASSERT(census_ht_get_size(ht) == 0);
+    /* Erasing a key from an empty table should be noop. */
+    census_ht_erase(ht, key);
+    GPR_ASSERT(census_ht_get_size(ht) == 0);
+    /* Erasing a non-existant key from a table should be noop. */
+    census_ht_insert(ht, key, (void*)&val);
+    key.val = 3;
+    census_ht_insert(ht, key, (void*)&val);
+    key.val = 9;
+    census_ht_insert(ht, key, (void*)&val);
+    GPR_ASSERT(census_ht_get_size(ht) == 3);
+    key.val = 1;
+    census_ht_erase(ht, key);
+    /* size unchanged after deleting non-existant key. */
+    GPR_ASSERT(census_ht_get_size(ht) == 3);
+    /* size decrease by 1 after deleting an existant key. */
+    key.val = 2;
+    census_ht_erase(ht, key);
+    GPR_ASSERT(census_ht_get_size(ht) == 2);
+  }
+  census_ht_destroy(ht);
+}
+
+static void test_insertion_and_deletion_with_high_collision_rate(void) {
+  census_ht_option opt = {CENSUS_HT_POINTER, 13,   &force_collision,
+                          &cmp_str_keys,     NULL, NULL};
+  census_ht* ht = census_ht_create(&opt);
+  char key_str[1000][GPR_LTOA_MIN_BUFSIZE];
+  uint64_t val = 0;
+  unsigned i = 0;
+  for (i = 0; i < 1000; i++) {
+    census_ht_key key;
+    key.ptr = key_str[i];
+    gpr_ltoa(i, key_str[i]);
+    census_ht_insert(ht, key, (void*)(&val));
+    gpr_log(GPR_INFO, "%d\n", i);
+    GPR_ASSERT(census_ht_get_size(ht) == (i + 1));
+  }
+  for (i = 0; i < 1000; i++) {
+    census_ht_key key;
+    key.ptr = key_str[i];
+    census_ht_erase(ht, key);
+    GPR_ASSERT(census_ht_get_size(ht) == (999 - i));
+  }
+  census_ht_destroy(ht);
+}
+
+static void test_table_with_string_key(void) {
+  census_ht_option opt = {CENSUS_HT_POINTER, 7,    &hash64,
+                          &cmp_str_keys,     NULL, NULL};
+  census_ht* ht = census_ht_create(&opt);
+  const char* keys[] = {
+      "k1", "a",   "000", "apple", "banana_a_long_long_long_banana",
+      "%$", "111", "foo", "b"};
+  const int vals[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
+  int i = 0;
+  GPR_ASSERT(ht != NULL);
+  GPR_ASSERT(census_ht_get_size(ht) == 0);
+  for (i = 0; i < 9; i++) {
+    census_ht_key key;
+    key.ptr = (void*)(keys[i]);
+    census_ht_insert(ht, key, (void*)(vals + i));
+  }
+  GPR_ASSERT(census_ht_get_size(ht) == 9);
+  for (i = 0; i < 9; i++) {
+    census_ht_key key;
+    int* val_ptr;
+    key.ptr = (void*)(keys[i]);
+    val_ptr = static_cast<int*>(census_ht_find(ht, key));
+    GPR_ASSERT(*val_ptr == vals[i]);
+  }
+  {
+    /* inserts duplicate keys */
+    census_ht_key key;
+    int* val_ptr = NULL;
+    key.ptr = (void*)(keys[2]);
+    census_ht_insert(ht, key, (void*)(vals + 8));
+    /* expect value to be over written by new insertion */
+    GPR_ASSERT(census_ht_get_size(ht) == 9);
+    val_ptr = static_cast<int*>(census_ht_find(ht, key));
+    GPR_ASSERT(*val_ptr == vals[8]);
+  }
+  for (i = 0; i < 9; i++) {
+    census_ht_key key;
+    int* val_ptr;
+    uint32_t expected_tbl_sz = 9 - i;
+    GPR_ASSERT(census_ht_get_size(ht) == expected_tbl_sz);
+    key.ptr = (void*)(keys[i]);
+    val_ptr = static_cast<int*>(census_ht_find(ht, key));
+    GPR_ASSERT(val_ptr != NULL);
+    census_ht_erase(ht, key);
+    GPR_ASSERT(census_ht_get_size(ht) == expected_tbl_sz - 1);
+    val_ptr = static_cast<int*>(census_ht_find(ht, key));
+    GPR_ASSERT(val_ptr == NULL);
+  }
+  census_ht_destroy(ht);
+}
+
+static void test_insertion_with_same_key(void) {
+  census_ht_option opt = {CENSUS_HT_UINT64, 11, NULL, NULL, NULL, NULL};
+  census_ht* ht = census_ht_create(&opt);
+  census_ht_key key;
+  const char vals[] = {'a', 'b', 'c'};
+  char* val_ptr;
+  key.val = 3;
+  census_ht_insert(ht, key, (void*)&(vals[0]));
+  GPR_ASSERT(census_ht_get_size(ht) == 1);
+  val_ptr = (char*)census_ht_find(ht, key);
+  GPR_ASSERT(val_ptr != NULL);
+  GPR_ASSERT(*val_ptr == 'a');
+  key.val = 4;
+  val_ptr = (char*)census_ht_find(ht, key);
+  GPR_ASSERT(val_ptr == NULL);
+  key.val = 3;
+  census_ht_insert(ht, key, (void*)&(vals[1]));
+  GPR_ASSERT(census_ht_get_size(ht) == 1);
+  val_ptr = (char*)census_ht_find(ht, key);
+  GPR_ASSERT(val_ptr != NULL);
+  GPR_ASSERT(*val_ptr == 'b');
+  census_ht_insert(ht, key, (void*)&(vals[2]));
+  GPR_ASSERT(census_ht_get_size(ht) == 1);
+  val_ptr = (char*)census_ht_find(ht, key);
+  GPR_ASSERT(val_ptr != NULL);
+  GPR_ASSERT(*val_ptr == 'c');
+  census_ht_destroy(ht);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_create_table();
+  test_simple_add_and_erase();
+  test_table_with_int_key();
+  test_table_with_string_key();
+  test_value_and_key_deleter();
+  test_insertion_with_same_key();
+  test_insertion_and_deletion_with_high_collision_rate();
+  return 0;
+}
diff --git a/test/core/statistics/multiple_writers_circular_buffer_test.c b/test/core/statistics/multiple_writers_circular_buffer_test.c
deleted file mode 100644
index 8abd76c..0000000
--- a/test/core/statistics/multiple_writers_circular_buffer_test.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/statistics/census_log_tests.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
-  test_multiple_writers_circular_log();
-  return 0;
-}
diff --git a/test/core/statistics/multiple_writers_circular_buffer_test.cc b/test/core/statistics/multiple_writers_circular_buffer_test.cc
new file mode 100644
index 0000000..6d34112
--- /dev/null
+++ b/test/core/statistics/multiple_writers_circular_buffer_test.cc
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/statistics/census_log_tests.h"
+
+#include <stdlib.h>
+
+#include <grpc/support/time.h>
+#include "test/core/util/test_config.h"
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
+  test_multiple_writers_circular_log();
+  return 0;
+}
diff --git a/test/core/statistics/multiple_writers_test.c b/test/core/statistics/multiple_writers_test.c
deleted file mode 100644
index de800e0..0000000
--- a/test/core/statistics/multiple_writers_test.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/statistics/census_log_tests.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
-  test_multiple_writers();
-  return 0;
-}
diff --git a/test/core/statistics/multiple_writers_test.cc b/test/core/statistics/multiple_writers_test.cc
new file mode 100644
index 0000000..47410ab
--- /dev/null
+++ b/test/core/statistics/multiple_writers_test.cc
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/statistics/census_log_tests.h"
+
+#include <stdlib.h>
+
+#include <grpc/support/time.h>
+#include "test/core/util/test_config.h"
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
+  test_multiple_writers();
+  return 0;
+}
diff --git a/test/core/statistics/performance_test.c b/test/core/statistics/performance_test.c
deleted file mode 100644
index 6104acb..0000000
--- a/test/core/statistics/performance_test.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/statistics/census_log_tests.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
-  test_performance();
-  return 0;
-}
diff --git a/test/core/statistics/performance_test.cc b/test/core/statistics/performance_test.cc
new file mode 100644
index 0000000..9d4fd6e
--- /dev/null
+++ b/test/core/statistics/performance_test.cc
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/statistics/census_log_tests.h"
+
+#include <stdlib.h>
+
+#include <grpc/support/time.h>
+#include "test/core/util/test_config.h"
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
+  test_performance();
+  return 0;
+}
diff --git a/test/core/statistics/quick_test.c b/test/core/statistics/quick_test.c
deleted file mode 100644
index 1e044b6..0000000
--- a/test/core/statistics/quick_test.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/statistics/census_log_tests.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
-  test_invalid_record_size();
-  test_end_write_with_different_size();
-  test_read_pending_record();
-  test_read_beyond_pending_record();
-  test_detached_while_reading();
-  test_fill_log_no_fragmentation();
-  test_fill_circular_log_no_fragmentation();
-  test_fill_log_with_straddling_records();
-  test_fill_circular_log_with_straddling_records();
-  return 0;
-}
diff --git a/test/core/statistics/quick_test.cc b/test/core/statistics/quick_test.cc
new file mode 100644
index 0000000..91ecdde
--- /dev/null
+++ b/test/core/statistics/quick_test.cc
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/statistics/census_log_tests.h"
+
+#include <stdlib.h>
+
+#include <grpc/support/time.h>
+#include "test/core/util/test_config.h"
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
+  test_invalid_record_size();
+  test_end_write_with_different_size();
+  test_read_pending_record();
+  test_read_beyond_pending_record();
+  test_detached_while_reading();
+  test_fill_log_no_fragmentation();
+  test_fill_circular_log_no_fragmentation();
+  test_fill_log_with_straddling_records();
+  test_fill_circular_log_with_straddling_records();
+  return 0;
+}
diff --git a/test/core/statistics/rpc_stats_test.c b/test/core/statistics/rpc_stats_test.c
deleted file mode 100644
index 01ac5a1..0000000
--- a/test/core/statistics/rpc_stats_test.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/string.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include "src/core/ext/census/census_interface.h"
-#include "src/core/ext/census/census_rpc_stats.h"
-#include "src/core/ext/census/census_tracing.h"
-#include "test/core/util/test_config.h"
-
-/* Ensure all possible state transitions are called without causing problem */
-static void test_init_shutdown(void) {
-  census_stats_store_init();
-  census_stats_store_init();
-  census_stats_store_shutdown();
-  census_stats_store_shutdown();
-  census_stats_store_init();
-}
-
-static void test_create_and_destroy(void) {
-  census_rpc_stats *stats = NULL;
-  census_aggregated_rpc_stats agg_stats = {0, NULL};
-
-  stats = census_rpc_stats_create_empty();
-  GPR_ASSERT(stats != NULL);
-  GPR_ASSERT(stats->cnt == 0 && stats->rpc_error_cnt == 0 &&
-             stats->app_error_cnt == 0 && stats->elapsed_time_ms == 0.0 &&
-             stats->api_request_bytes == 0 && stats->wire_request_bytes == 0 &&
-             stats->api_response_bytes == 0 && stats->wire_response_bytes == 0);
-  gpr_free(stats);
-
-  census_aggregated_rpc_stats_set_empty(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 0);
-  GPR_ASSERT(agg_stats.stats == NULL);
-  agg_stats.num_entries = 1;
-  agg_stats.stats = (census_per_method_rpc_stats *)gpr_malloc(
-      sizeof(census_per_method_rpc_stats));
-  agg_stats.stats[0].method = gpr_strdup("foo");
-  census_aggregated_rpc_stats_set_empty(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 0);
-  GPR_ASSERT(agg_stats.stats == NULL);
-}
-
-#define ASSERT_NEAR(a, b) \
-  GPR_ASSERT((a - b) * (a - b) < 1e-24 * (a + b) * (a + b))
-
-static void test_record_and_get_stats(void) {
-  census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
-  census_op_id id;
-  census_aggregated_rpc_stats agg_stats = {0, NULL};
-
-  /* Record client stats twice with the same op_id. */
-  census_init();
-  id = census_tracing_start_op();
-  census_add_method_tag(id, "m1");
-  census_record_rpc_client_stats(id, &stats);
-  census_record_rpc_client_stats(id, &stats);
-  census_tracing_end_op(id);
-  /* Server stats expect to be empty */
-  census_get_server_stats(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 0);
-  GPR_ASSERT(agg_stats.stats == NULL);
-  /* Client stats expect to have one entry */
-  census_get_client_stats(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 1);
-  GPR_ASSERT(agg_stats.stats != NULL);
-  GPR_ASSERT(strcmp(agg_stats.stats[0].method, "m1") == 0);
-  GPR_ASSERT(agg_stats.stats[0].minute_stats.cnt == 2 &&
-             agg_stats.stats[0].hour_stats.cnt == 2 &&
-             agg_stats.stats[0].total_stats.cnt == 2);
-  ASSERT_NEAR(agg_stats.stats[0].minute_stats.wire_response_bytes, 16.8);
-  ASSERT_NEAR(agg_stats.stats[0].hour_stats.wire_response_bytes, 16.8);
-  ASSERT_NEAR(agg_stats.stats[0].total_stats.wire_response_bytes, 16.8);
-  /* Get stats again, results should be the same. */
-  census_get_client_stats(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 1);
-  census_aggregated_rpc_stats_set_empty(&agg_stats);
-  census_shutdown();
-
-  /* Record both server (once) and client (twice) stats with different op_ids.
-   */
-  census_init();
-  id = census_tracing_start_op();
-  census_add_method_tag(id, "m2");
-  census_record_rpc_client_stats(id, &stats);
-  census_tracing_end_op(id);
-  id = census_tracing_start_op();
-  census_add_method_tag(id, "m3");
-  census_record_rpc_server_stats(id, &stats);
-  census_tracing_end_op(id);
-  id = census_tracing_start_op();
-  census_add_method_tag(id, "m4");
-  census_record_rpc_client_stats(id, &stats);
-  census_tracing_end_op(id);
-  /* Check server stats */
-  census_get_server_stats(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 1);
-  GPR_ASSERT(strcmp(agg_stats.stats[0].method, "m3") == 0);
-  GPR_ASSERT(agg_stats.stats[0].minute_stats.app_error_cnt == 3 &&
-             agg_stats.stats[0].hour_stats.app_error_cnt == 3 &&
-             agg_stats.stats[0].total_stats.app_error_cnt == 3);
-  census_aggregated_rpc_stats_set_empty(&agg_stats);
-  /* Check client stats */
-  census_get_client_stats(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 2);
-  GPR_ASSERT(agg_stats.stats != NULL);
-  GPR_ASSERT((strcmp(agg_stats.stats[0].method, "m2") == 0 &&
-              strcmp(agg_stats.stats[1].method, "m4") == 0) ||
-             (strcmp(agg_stats.stats[0].method, "m4") == 0 &&
-              strcmp(agg_stats.stats[1].method, "m2") == 0));
-  GPR_ASSERT(agg_stats.stats[0].minute_stats.cnt == 1 &&
-             agg_stats.stats[1].minute_stats.cnt == 1);
-  census_aggregated_rpc_stats_set_empty(&agg_stats);
-  census_shutdown();
-}
-
-static void test_record_stats_on_unknown_op_id(void) {
-  census_op_id unknown_id = {0xDEAD, 0xBEEF};
-  census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
-  census_aggregated_rpc_stats agg_stats = {0, NULL};
-
-  census_init();
-  /* Tests that recording stats against unknown id is noop. */
-  census_record_rpc_client_stats(unknown_id, &stats);
-  census_record_rpc_server_stats(unknown_id, &stats);
-  census_get_server_stats(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 0);
-  GPR_ASSERT(agg_stats.stats == NULL);
-  census_get_client_stats(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 0);
-  GPR_ASSERT(agg_stats.stats == NULL);
-  census_aggregated_rpc_stats_set_empty(&agg_stats);
-  census_shutdown();
-}
-
-/* Test that record stats is noop when trace store is uninitialized. */
-static void test_record_stats_with_trace_store_uninitialized(void) {
-  census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
-  census_op_id id = {0, 0};
-  census_aggregated_rpc_stats agg_stats = {0, NULL};
-
-  census_init();
-  id = census_tracing_start_op();
-  census_add_method_tag(id, "m");
-  census_tracing_end_op(id);
-  /* shuts down trace store only. */
-  census_tracing_shutdown();
-  census_record_rpc_client_stats(id, &stats);
-  census_get_client_stats(&agg_stats);
-  GPR_ASSERT(agg_stats.num_entries == 0);
-  census_stats_store_shutdown();
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_init_shutdown();
-  test_create_and_destroy();
-  test_record_and_get_stats();
-  test_record_stats_on_unknown_op_id();
-  test_record_stats_with_trace_store_uninitialized();
-  return 0;
-}
diff --git a/test/core/statistics/rpc_stats_test.cc b/test/core/statistics/rpc_stats_test.cc
new file mode 100644
index 0000000..aead5cf
--- /dev/null
+++ b/test/core/statistics/rpc_stats_test.cc
@@ -0,0 +1,183 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/port_platform.h>
+#include <grpc/support/string.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include "src/core/ext/census/census_interface.h"
+#include "src/core/ext/census/census_rpc_stats.h"
+#include "src/core/ext/census/census_tracing.h"
+#include "test/core/util/test_config.h"
+
+/* Ensure all possible state transitions are called without causing problem */
+static void test_init_shutdown(void) {
+  census_stats_store_init();
+  census_stats_store_init();
+  census_stats_store_shutdown();
+  census_stats_store_shutdown();
+  census_stats_store_init();
+}
+
+static void test_create_and_destroy(void) {
+  census_rpc_stats* stats = NULL;
+  census_aggregated_rpc_stats agg_stats = {0, NULL};
+
+  stats = census_rpc_stats_create_empty();
+  GPR_ASSERT(stats != NULL);
+  GPR_ASSERT(stats->cnt == 0 && stats->rpc_error_cnt == 0 &&
+             stats->app_error_cnt == 0 && stats->elapsed_time_ms == 0.0 &&
+             stats->api_request_bytes == 0 && stats->wire_request_bytes == 0 &&
+             stats->api_response_bytes == 0 && stats->wire_response_bytes == 0);
+  gpr_free(stats);
+
+  census_aggregated_rpc_stats_set_empty(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 0);
+  GPR_ASSERT(agg_stats.stats == NULL);
+  agg_stats.num_entries = 1;
+  agg_stats.stats = (census_per_method_rpc_stats*)gpr_malloc(
+      sizeof(census_per_method_rpc_stats));
+  agg_stats.stats[0].method = gpr_strdup("foo");
+  census_aggregated_rpc_stats_set_empty(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 0);
+  GPR_ASSERT(agg_stats.stats == NULL);
+}
+
+#define ASSERT_NEAR(a, b) \
+  GPR_ASSERT((a - b) * (a - b) < 1e-24 * (a + b) * (a + b))
+
+static void test_record_and_get_stats(void) {
+  census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
+  census_op_id id;
+  census_aggregated_rpc_stats agg_stats = {0, NULL};
+
+  /* Record client stats twice with the same op_id. */
+  census_init();
+  id = census_tracing_start_op();
+  census_add_method_tag(id, "m1");
+  census_record_rpc_client_stats(id, &stats);
+  census_record_rpc_client_stats(id, &stats);
+  census_tracing_end_op(id);
+  /* Server stats expect to be empty */
+  census_get_server_stats(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 0);
+  GPR_ASSERT(agg_stats.stats == NULL);
+  /* Client stats expect to have one entry */
+  census_get_client_stats(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 1);
+  GPR_ASSERT(agg_stats.stats != NULL);
+  GPR_ASSERT(strcmp(agg_stats.stats[0].method, "m1") == 0);
+  GPR_ASSERT(agg_stats.stats[0].minute_stats.cnt == 2 &&
+             agg_stats.stats[0].hour_stats.cnt == 2 &&
+             agg_stats.stats[0].total_stats.cnt == 2);
+  ASSERT_NEAR(agg_stats.stats[0].minute_stats.wire_response_bytes, 16.8);
+  ASSERT_NEAR(agg_stats.stats[0].hour_stats.wire_response_bytes, 16.8);
+  ASSERT_NEAR(agg_stats.stats[0].total_stats.wire_response_bytes, 16.8);
+  /* Get stats again, results should be the same. */
+  census_get_client_stats(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 1);
+  census_aggregated_rpc_stats_set_empty(&agg_stats);
+  census_shutdown();
+
+  /* Record both server (once) and client (twice) stats with different op_ids.
+   */
+  census_init();
+  id = census_tracing_start_op();
+  census_add_method_tag(id, "m2");
+  census_record_rpc_client_stats(id, &stats);
+  census_tracing_end_op(id);
+  id = census_tracing_start_op();
+  census_add_method_tag(id, "m3");
+  census_record_rpc_server_stats(id, &stats);
+  census_tracing_end_op(id);
+  id = census_tracing_start_op();
+  census_add_method_tag(id, "m4");
+  census_record_rpc_client_stats(id, &stats);
+  census_tracing_end_op(id);
+  /* Check server stats */
+  census_get_server_stats(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 1);
+  GPR_ASSERT(strcmp(agg_stats.stats[0].method, "m3") == 0);
+  GPR_ASSERT(agg_stats.stats[0].minute_stats.app_error_cnt == 3 &&
+             agg_stats.stats[0].hour_stats.app_error_cnt == 3 &&
+             agg_stats.stats[0].total_stats.app_error_cnt == 3);
+  census_aggregated_rpc_stats_set_empty(&agg_stats);
+  /* Check client stats */
+  census_get_client_stats(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 2);
+  GPR_ASSERT(agg_stats.stats != NULL);
+  GPR_ASSERT((strcmp(agg_stats.stats[0].method, "m2") == 0 &&
+              strcmp(agg_stats.stats[1].method, "m4") == 0) ||
+             (strcmp(agg_stats.stats[0].method, "m4") == 0 &&
+              strcmp(agg_stats.stats[1].method, "m2") == 0));
+  GPR_ASSERT(agg_stats.stats[0].minute_stats.cnt == 1 &&
+             agg_stats.stats[1].minute_stats.cnt == 1);
+  census_aggregated_rpc_stats_set_empty(&agg_stats);
+  census_shutdown();
+}
+
+static void test_record_stats_on_unknown_op_id(void) {
+  census_op_id unknown_id = {0xDEAD, 0xBEEF};
+  census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
+  census_aggregated_rpc_stats agg_stats = {0, NULL};
+
+  census_init();
+  /* Tests that recording stats against unknown id is noop. */
+  census_record_rpc_client_stats(unknown_id, &stats);
+  census_record_rpc_server_stats(unknown_id, &stats);
+  census_get_server_stats(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 0);
+  GPR_ASSERT(agg_stats.stats == NULL);
+  census_get_client_stats(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 0);
+  GPR_ASSERT(agg_stats.stats == NULL);
+  census_aggregated_rpc_stats_set_empty(&agg_stats);
+  census_shutdown();
+}
+
+/* Test that record stats is noop when trace store is uninitialized. */
+static void test_record_stats_with_trace_store_uninitialized(void) {
+  census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
+  census_op_id id = {0, 0};
+  census_aggregated_rpc_stats agg_stats = {0, NULL};
+
+  census_init();
+  id = census_tracing_start_op();
+  census_add_method_tag(id, "m");
+  census_tracing_end_op(id);
+  /* shuts down trace store only. */
+  census_tracing_shutdown();
+  census_record_rpc_client_stats(id, &stats);
+  census_get_client_stats(&agg_stats);
+  GPR_ASSERT(agg_stats.num_entries == 0);
+  census_stats_store_shutdown();
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_init_shutdown();
+  test_create_and_destroy();
+  test_record_and_get_stats();
+  test_record_stats_on_unknown_op_id();
+  test_record_stats_with_trace_store_uninitialized();
+  return 0;
+}
diff --git a/test/core/statistics/small_log_test.c b/test/core/statistics/small_log_test.c
deleted file mode 100644
index 4bcc35c..0000000
--- a/test/core/statistics/small_log_test.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/statistics/census_log_tests.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/time.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
-  test_small_log();
-  return 0;
-}
diff --git a/test/core/statistics/small_log_test.cc b/test/core/statistics/small_log_test.cc
new file mode 100644
index 0000000..fb8dfc9
--- /dev/null
+++ b/test/core/statistics/small_log_test.cc
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/statistics/census_log_tests.h"
+
+#include <stdlib.h>
+
+#include <grpc/support/time.h>
+#include "test/core/util/test_config.h"
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
+  test_small_log();
+  return 0;
+}
diff --git a/test/core/statistics/trace_test.c b/test/core/statistics/trace_test.c
deleted file mode 100644
index 63da9f7..0000000
--- a/test/core/statistics/trace_test.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/ext/census/census_interface.h"
-#include "src/core/ext/census/census_tracing.h"
-#include "src/core/ext/census/census_tracing.h"
-#include "test/core/util/test_config.h"
-
-/* Ensure all possible state transitions are called without causing problem */
-static void test_init_shutdown(void) {
-  census_tracing_init();
-  census_tracing_init();
-  census_tracing_shutdown();
-  census_tracing_shutdown();
-  census_tracing_init();
-}
-
-static void test_start_op_generates_locally_unique_ids(void) {
-/* Check that ids generated within window size of 1000 are unique.
-   TODO(hongyu): Replace O(n^2) duplicate detection algorithm with O(nlogn)
-   algorithm. Enhance the test to larger window size (>10^6) */
-#define WINDOW_SIZE 1000
-  census_op_id ids[WINDOW_SIZE];
-  int i;
-  census_init();
-  for (i = 0; i < WINDOW_SIZE; i++) {
-    ids[i] = census_tracing_start_op();
-    census_tracing_end_op(ids[i]);
-  }
-  for (i = 0; i < WINDOW_SIZE - 1; i++) {
-    int j;
-    for (j = i + 1; j < WINDOW_SIZE; j++) {
-      GPR_ASSERT(ids[i].upper != ids[j].upper || ids[i].lower != ids[j].lower);
-    }
-  }
-#undef WINDOW_SIZE
-  census_shutdown();
-}
-
-static void test_get_trace_method_name(void) {
-  census_op_id id;
-  const char write_name[] = "service/method";
-  census_tracing_init();
-  id = census_tracing_start_op();
-  census_add_method_tag(id, write_name);
-  census_internal_lock_trace_store();
-  {
-    const char *read_name =
-        census_get_trace_method_name(census_get_trace_obj_locked(id));
-    GPR_ASSERT(strcmp(read_name, write_name) == 0);
-  }
-  census_internal_unlock_trace_store();
-  census_tracing_shutdown();
-}
-
-typedef struct thd_arg {
-  int num_done;
-  gpr_cv done;
-  gpr_mu mu;
-} thd_arg;
-
-static void mimic_trace_op_sequences(void *arg) {
-  census_op_id id;
-  const char *method_name = "service_foo/method_bar";
-  int i = 0;
-  const int num_iter = 200;
-  thd_arg *args = (thd_arg *)arg;
-  GPR_ASSERT(args != NULL);
-  gpr_log(GPR_INFO, "Start trace op sequence thread.");
-  for (i = 0; i < num_iter; i++) {
-    id = census_tracing_start_op();
-    census_add_method_tag(id, method_name);
-    /* pretend doing 1us work. */
-    gpr_sleep_until(GRPC_TIMEOUT_MICROS_TO_DEADLINE(1));
-    census_tracing_end_op(id);
-  }
-  gpr_log(GPR_INFO, "End trace op sequence thread.");
-  gpr_mu_lock(&args->mu);
-  args->num_done += 1;
-  gpr_cv_broadcast(&args->done);
-  gpr_mu_unlock(&args->mu);
-}
-
-static void test_concurrency(void) {
-#define NUM_THREADS 1000
-  gpr_thd_id tid[NUM_THREADS];
-  int i = 0;
-  thd_arg arg;
-  arg.num_done = 0;
-  gpr_mu_init(&arg.mu);
-  gpr_cv_init(&arg.done);
-  census_tracing_init();
-  for (i = 0; i < NUM_THREADS; ++i) {
-    gpr_thd_new(tid + i, mimic_trace_op_sequences, &arg, NULL);
-  }
-  gpr_mu_lock(&arg.mu);
-  while (arg.num_done < NUM_THREADS) {
-    gpr_log(GPR_INFO, "num done %d", arg.num_done);
-    gpr_cv_wait(&arg.done, &arg.mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  gpr_mu_unlock(&arg.mu);
-  census_tracing_shutdown();
-#undef NUM_THREADS
-}
-
-static void test_add_method_tag_to_unknown_op_id(void) {
-  census_op_id unknown_id = {0xDEAD, 0xBEEF};
-  int ret = 0;
-  census_tracing_init();
-  ret = census_add_method_tag(unknown_id, "foo");
-  GPR_ASSERT(ret != 0);
-  census_tracing_shutdown();
-}
-
-static void test_trace_print(void) {
-  census_op_id id;
-  int i;
-  const char *annotation_txt[4] = {"abc", "", "$%^ *()_"};
-  char long_txt[CENSUS_MAX_ANNOTATION_LENGTH + 10];
-
-  memset(long_txt, 'a', GPR_ARRAY_SIZE(long_txt));
-  long_txt[CENSUS_MAX_ANNOTATION_LENGTH + 9] = '\0';
-  annotation_txt[3] = long_txt;
-
-  census_tracing_init();
-  id = census_tracing_start_op();
-  /* Adds large number of annotations to each trace */
-  for (i = 0; i < 1000; i++) {
-    census_tracing_print(id,
-                         annotation_txt[i % GPR_ARRAY_SIZE(annotation_txt)]);
-  }
-  census_tracing_end_op(id);
-
-  census_tracing_shutdown();
-}
-
-/* Returns 1 if two ids are equal, otherwise returns 0. */
-static int ids_equal(census_op_id id1, census_op_id id2) {
-  return (id1.upper == id2.upper) && (id1.lower == id2.lower);
-}
-
-static void test_get_active_ops(void) {
-  census_op_id id_1, id_2, id_3;
-  census_trace_obj **active_ops;
-  const char *annotation_txt[] = {"annotation 1", "a2"};
-  int i = 0;
-  int n = 0;
-
-  gpr_log(GPR_INFO, "test_get_active_ops");
-  census_tracing_init();
-  /* No active ops before calling start_op(). */
-  active_ops = census_get_active_ops(&n);
-  GPR_ASSERT(active_ops == NULL);
-  GPR_ASSERT(n == 0);
-
-  /* Starts one op */
-  id_1 = census_tracing_start_op();
-  census_add_method_tag(id_1, "foo_1");
-  active_ops = census_get_active_ops(&n);
-  GPR_ASSERT(active_ops != NULL);
-  GPR_ASSERT(n == 1);
-  GPR_ASSERT(ids_equal(active_ops[0]->id, id_1));
-  census_trace_obj_destroy(active_ops[0]);
-  gpr_free(active_ops);
-  active_ops = NULL;
-
-  /* Start the second and the third ops */
-  id_2 = census_tracing_start_op();
-  census_add_method_tag(id_2, "foo_2");
-  id_3 = census_tracing_start_op();
-  census_add_method_tag(id_3, "foo_3");
-
-  active_ops = census_get_active_ops(&n);
-  GPR_ASSERT(n == 3);
-  for (i = 0; i < 3; i++) {
-    census_trace_obj_destroy(active_ops[i]);
-  }
-  gpr_free(active_ops);
-  active_ops = NULL;
-
-  /* End the second op  and add annotations to the third ops */
-  census_tracing_end_op(id_2);
-  census_tracing_print(id_3, annotation_txt[0]);
-  census_tracing_print(id_3, annotation_txt[1]);
-
-  active_ops = census_get_active_ops(&n);
-  GPR_ASSERT(active_ops != NULL);
-  GPR_ASSERT(n == 2);
-  for (i = 0; i < 2; i++) {
-    census_trace_obj_destroy(active_ops[i]);
-  }
-  gpr_free(active_ops);
-  active_ops = NULL;
-
-  /* End all ops. */
-  census_tracing_end_op(id_1);
-  census_tracing_end_op(id_3);
-  active_ops = census_get_active_ops(&n);
-  GPR_ASSERT(active_ops == NULL);
-  GPR_ASSERT(n == 0);
-
-  census_tracing_shutdown();
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_init_shutdown();
-  test_start_op_generates_locally_unique_ids();
-  test_get_trace_method_name();
-  test_concurrency();
-  test_add_method_tag_to_unknown_op_id();
-  test_trace_print();
-  test_get_active_ops();
-  return 0;
-}
diff --git a/test/core/statistics/trace_test.cc b/test/core/statistics/trace_test.cc
new file mode 100644
index 0000000..ecbfed0
--- /dev/null
+++ b/test/core/statistics/trace_test.cc
@@ -0,0 +1,239 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/port_platform.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/ext/census/census_interface.h"
+#include "src/core/ext/census/census_tracing.h"
+#include "test/core/util/test_config.h"
+
+/* Ensure all possible state transitions are called without causing problem */
+static void test_init_shutdown(void) {
+  census_tracing_init();
+  census_tracing_init();
+  census_tracing_shutdown();
+  census_tracing_shutdown();
+  census_tracing_init();
+}
+
+static void test_start_op_generates_locally_unique_ids(void) {
+/* Check that ids generated within window size of 1000 are unique.
+   TODO(hongyu): Replace O(n^2) duplicate detection algorithm with O(nlogn)
+   algorithm. Enhance the test to larger window size (>10^6) */
+#define WINDOW_SIZE 1000
+  census_op_id ids[WINDOW_SIZE];
+  int i;
+  census_init();
+  for (i = 0; i < WINDOW_SIZE; i++) {
+    ids[i] = census_tracing_start_op();
+    census_tracing_end_op(ids[i]);
+  }
+  for (i = 0; i < WINDOW_SIZE - 1; i++) {
+    int j;
+    for (j = i + 1; j < WINDOW_SIZE; j++) {
+      GPR_ASSERT(ids[i].upper != ids[j].upper || ids[i].lower != ids[j].lower);
+    }
+  }
+#undef WINDOW_SIZE
+  census_shutdown();
+}
+
+static void test_get_trace_method_name(void) {
+  census_op_id id;
+  const char write_name[] = "service/method";
+  census_tracing_init();
+  id = census_tracing_start_op();
+  census_add_method_tag(id, write_name);
+  census_internal_lock_trace_store();
+  {
+    const char* read_name =
+        census_get_trace_method_name(census_get_trace_obj_locked(id));
+    GPR_ASSERT(strcmp(read_name, write_name) == 0);
+  }
+  census_internal_unlock_trace_store();
+  census_tracing_shutdown();
+}
+
+typedef struct thd_arg {
+  int num_done;
+  gpr_cv done;
+  gpr_mu mu;
+} thd_arg;
+
+static void mimic_trace_op_sequences(void* arg) {
+  census_op_id id;
+  const char* method_name = "service_foo/method_bar";
+  int i = 0;
+  const int num_iter = 200;
+  thd_arg* args = (thd_arg*)arg;
+  GPR_ASSERT(args != NULL);
+  gpr_log(GPR_INFO, "Start trace op sequence thread.");
+  for (i = 0; i < num_iter; i++) {
+    id = census_tracing_start_op();
+    census_add_method_tag(id, method_name);
+    /* pretend doing 1us work. */
+    gpr_sleep_until(GRPC_TIMEOUT_MICROS_TO_DEADLINE(1));
+    census_tracing_end_op(id);
+  }
+  gpr_log(GPR_INFO, "End trace op sequence thread.");
+  gpr_mu_lock(&args->mu);
+  args->num_done += 1;
+  gpr_cv_broadcast(&args->done);
+  gpr_mu_unlock(&args->mu);
+}
+
+static void test_concurrency(void) {
+#define NUM_THREADS 1000
+  gpr_thd_id tid[NUM_THREADS];
+  int i = 0;
+  thd_arg arg;
+  arg.num_done = 0;
+  gpr_mu_init(&arg.mu);
+  gpr_cv_init(&arg.done);
+  census_tracing_init();
+  for (i = 0; i < NUM_THREADS; ++i) {
+    gpr_thd_new(tid + i, mimic_trace_op_sequences, &arg, NULL);
+  }
+  gpr_mu_lock(&arg.mu);
+  while (arg.num_done < NUM_THREADS) {
+    gpr_log(GPR_INFO, "num done %d", arg.num_done);
+    gpr_cv_wait(&arg.done, &arg.mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+  }
+  gpr_mu_unlock(&arg.mu);
+  census_tracing_shutdown();
+#undef NUM_THREADS
+}
+
+static void test_add_method_tag_to_unknown_op_id(void) {
+  census_op_id unknown_id = {0xDEAD, 0xBEEF};
+  int ret = 0;
+  census_tracing_init();
+  ret = census_add_method_tag(unknown_id, "foo");
+  GPR_ASSERT(ret != 0);
+  census_tracing_shutdown();
+}
+
+static void test_trace_print(void) {
+  census_op_id id;
+  int i;
+  const char* annotation_txt[4] = {"abc", "", "$%^ *()_"};
+  char long_txt[CENSUS_MAX_ANNOTATION_LENGTH + 10];
+
+  memset(long_txt, 'a', GPR_ARRAY_SIZE(long_txt));
+  long_txt[CENSUS_MAX_ANNOTATION_LENGTH + 9] = '\0';
+  annotation_txt[3] = long_txt;
+
+  census_tracing_init();
+  id = census_tracing_start_op();
+  /* Adds large number of annotations to each trace */
+  for (i = 0; i < 1000; i++) {
+    census_tracing_print(id,
+                         annotation_txt[i % GPR_ARRAY_SIZE(annotation_txt)]);
+  }
+  census_tracing_end_op(id);
+
+  census_tracing_shutdown();
+}
+
+/* Returns 1 if two ids are equal, otherwise returns 0. */
+static int ids_equal(census_op_id id1, census_op_id id2) {
+  return (id1.upper == id2.upper) && (id1.lower == id2.lower);
+}
+
+static void test_get_active_ops(void) {
+  census_op_id id_1, id_2, id_3;
+  census_trace_obj** active_ops;
+  const char* annotation_txt[] = {"annotation 1", "a2"};
+  int i = 0;
+  int n = 0;
+
+  gpr_log(GPR_INFO, "test_get_active_ops");
+  census_tracing_init();
+  /* No active ops before calling start_op(). */
+  active_ops = census_get_active_ops(&n);
+  GPR_ASSERT(active_ops == NULL);
+  GPR_ASSERT(n == 0);
+
+  /* Starts one op */
+  id_1 = census_tracing_start_op();
+  census_add_method_tag(id_1, "foo_1");
+  active_ops = census_get_active_ops(&n);
+  GPR_ASSERT(active_ops != NULL);
+  GPR_ASSERT(n == 1);
+  GPR_ASSERT(ids_equal(active_ops[0]->id, id_1));
+  census_trace_obj_destroy(active_ops[0]);
+  gpr_free(active_ops);
+  active_ops = NULL;
+
+  /* Start the second and the third ops */
+  id_2 = census_tracing_start_op();
+  census_add_method_tag(id_2, "foo_2");
+  id_3 = census_tracing_start_op();
+  census_add_method_tag(id_3, "foo_3");
+
+  active_ops = census_get_active_ops(&n);
+  GPR_ASSERT(n == 3);
+  for (i = 0; i < 3; i++) {
+    census_trace_obj_destroy(active_ops[i]);
+  }
+  gpr_free(active_ops);
+  active_ops = NULL;
+
+  /* End the second op  and add annotations to the third ops */
+  census_tracing_end_op(id_2);
+  census_tracing_print(id_3, annotation_txt[0]);
+  census_tracing_print(id_3, annotation_txt[1]);
+
+  active_ops = census_get_active_ops(&n);
+  GPR_ASSERT(active_ops != NULL);
+  GPR_ASSERT(n == 2);
+  for (i = 0; i < 2; i++) {
+    census_trace_obj_destroy(active_ops[i]);
+  }
+  gpr_free(active_ops);
+  active_ops = NULL;
+
+  /* End all ops. */
+  census_tracing_end_op(id_1);
+  census_tracing_end_op(id_3);
+  active_ops = census_get_active_ops(&n);
+  GPR_ASSERT(active_ops == NULL);
+  GPR_ASSERT(n == 0);
+
+  census_tracing_shutdown();
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_init_shutdown();
+  test_start_op_generates_locally_unique_ids();
+  test_get_trace_method_name();
+  test_concurrency();
+  test_add_method_tag_to_unknown_op_id();
+  test_trace_print();
+  test_get_active_ops();
+  return 0;
+}
diff --git a/test/core/statistics/window_stats_test.c b/test/core/statistics/window_stats_test.c
deleted file mode 100644
index 254c14a..0000000
--- a/test/core/statistics/window_stats_test.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/census/window_stats.h"
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <stdlib.h>
-#include "test/core/util/test_config.h"
-
-typedef struct test_stat {
-  double value1;
-  int value2;
-} test_stat;
-
-void add_test_stat(void *base, const void *addme) {
-  test_stat *b = (test_stat *)base;
-  const test_stat *a = (const test_stat *)addme;
-  b->value1 += a->value1;
-  b->value2 += a->value2;
-}
-
-void add_proportion_test_stat(double p, void *base, const void *addme) {
-  test_stat *b = (test_stat *)base;
-  const test_stat *a = (const test_stat *)addme;
-  b->value1 += p * a->value1;
-  b->value2 += p * a->value2 + 0.5; /* +0.5 is poor mans (no c99) round() */
-}
-
-const struct census_window_stats_stat_info kMyStatInfo = {
-    sizeof(test_stat), NULL, add_test_stat, add_proportion_test_stat};
-
-const gpr_timespec kMilliSecInterval = {0, 1000000};
-const gpr_timespec kSecInterval = {1, 0};
-const gpr_timespec kMinInterval = {60, 0};
-const gpr_timespec kHourInterval = {3600, 0};
-const gpr_timespec kPrimeInterval = {0, 101};
-
-static int compare_double(double a, double b, double epsilon) {
-  if (a >= b) {
-    return (a > b + epsilon) ? 1 : 0;
-  } else {
-    return (b > a + epsilon) ? -1 : 0;
-  }
-}
-
-void empty_test(void) {
-  census_window_stats_sums result;
-  const gpr_timespec zero = {0, 0};
-  test_stat sum;
-  struct census_window_stats *stats =
-      census_window_stats_create(1, &kMinInterval, 5, &kMyStatInfo);
-  GPR_ASSERT(stats != NULL);
-  result.statistic = &sum;
-  census_window_stats_get_sums(stats, zero, &result);
-  GPR_ASSERT(result.count == 0 && sum.value1 == 0 && sum.value2 == 0);
-  census_window_stats_get_sums(stats, gpr_now(GPR_CLOCK_REALTIME), &result);
-  GPR_ASSERT(result.count == 0 && sum.value1 == 0 && sum.value2 == 0);
-  census_window_stats_destroy(stats);
-}
-
-void one_interval_test(void) {
-  const test_stat value = {0.1, 4};
-  const double epsilon = 1e10 - 11;
-  gpr_timespec when = {0, 0};
-  census_window_stats_sums result;
-  test_stat sum;
-  /* granularity == 5 so width of internal windows should be 12s */
-  struct census_window_stats *stats =
-      census_window_stats_create(1, &kMinInterval, 5, &kMyStatInfo);
-  GPR_ASSERT(stats != NULL);
-  /* phase 1: insert a single value at t=0s, and check that various measurement
-     times result in expected output values */
-  census_window_stats_add(stats, when, &value);
-  result.statistic = &sum;
-  /* when = 0s, values extracted should be everything */
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(compare_double(result.count, 1, epsilon) == 0 &&
-             compare_double(sum.value1, value.value1, epsilon) == 0 &&
-             sum.value2 == value.value2);
-  /* when = 6,30,60s, should be all of the data */
-  when.tv_sec = 6;
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(compare_double(result.count, 1.0, epsilon) == 0 &&
-             compare_double(sum.value1, value.value1, epsilon) == 0 &&
-             sum.value2 == value.value2);
-  /* when == 30s,60s, should be all of the data */
-  when.tv_sec = 30;
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(compare_double(result.count, 1.0, epsilon) == 0 &&
-             compare_double(sum.value1, value.value1, epsilon) == 0 &&
-             sum.value2 == value.value2);
-  when.tv_sec = 60;
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(compare_double(result.count, 1.0, epsilon) == 0 &&
-             compare_double(sum.value1, value.value1, epsilon) == 0 &&
-             sum.value2 == value.value2);
-  /* when = 66s, should be half (only take half of bottom bucket) */
-  when.tv_sec = 66;
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(compare_double(result.count, 0.5, epsilon) == 0 &&
-             compare_double(sum.value1, value.value1 / 2, epsilon) == 0 &&
-             sum.value2 == value.value2 / 2);
-  /* when = 72s, should be completely out of window */
-  when.tv_sec = 72;
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(compare_double(result.count, 0, epsilon) == 0 &&
-             compare_double(sum.value1, 0, epsilon) == 0 && sum.value2 == 0);
-
-  /* phase 2: tear down and do as before, but inserting two values */
-  census_window_stats_destroy(stats);
-  stats = census_window_stats_create(1, &kMinInterval, 5, &kMyStatInfo);
-  GPR_ASSERT(stats != NULL);
-  when.tv_sec = 0;
-  when.tv_nsec = 17;
-  census_window_stats_add(stats, when, &value);
-  when.tv_sec = 1;
-  census_window_stats_add(stats, when, &value);
-  when.tv_sec = 0;
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(compare_double(result.count, 0, epsilon) == 0 &&
-             compare_double(sum.value1, 0, epsilon) == 0 && sum.value2 == 0);
-  /* time = 3s, 30s, should get all data */
-  when.tv_sec = 3;
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(compare_double(result.count, 2, epsilon) == 0 &&
-             compare_double(sum.value1, 2 * value.value1, epsilon) == 0 &&
-             sum.value2 == 2 * value.value2);
-  when.tv_sec = 30;
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(compare_double(result.count, 2, epsilon) == 0 &&
-             compare_double(sum.value1, 2 * value.value1, epsilon) == 0 &&
-             sum.value2 == 2 * value.value2);
-
-  /* phase 3: insert into "middle" bucket, and force a shift, pushing out
-     the two values in bottom bucket */
-  when.tv_sec = 30;
-  census_window_stats_add(stats, when, &value);
-  when.tv_sec = 76;
-  census_window_stats_add(stats, when, &value);
-  when.tv_sec = 0;
-  census_window_stats_get_sums(stats, when, &result);
-  GPR_ASSERT(result.count == 0 && sum.value1 == 0 && sum.value2 == 0);
-  when.tv_sec = 30;
-  census_window_stats_get_sums(stats, when, &result);
-  /* half of the single value in the 30 second bucket */
-  GPR_ASSERT(compare_double(result.count, 0.5, epsilon) == 0 &&
-             compare_double(sum.value1, value.value1 / 2, epsilon) == 0 &&
-             sum.value2 == value.value2 / 2);
-  when.tv_sec = 74;
-  census_window_stats_get_sums(stats, when, &result);
-  /* half of the 76 second bucket, all of the 30 second bucket */
-  GPR_ASSERT(compare_double(result.count, 1.5, epsilon) == 0 &&
-             compare_double(sum.value1, value.value1 * 1.5, epsilon) == 0 &&
-             sum.value2 == value.value2 / 2 * 3);
-  when.tv_sec = 76;
-  census_window_stats_get_sums(stats, when, &result);
-  /* >=76s, get all of the 76 second bucket, all of the 30 second bucket */
-  GPR_ASSERT(compare_double(result.count, 2, epsilon) == 0 &&
-             compare_double(sum.value1, value.value1 * 2, epsilon) == 0 &&
-             sum.value2 == value.value2 * 2);
-  when.tv_sec = 78;
-  census_window_stats_get_sums(stats, when, &result);
-  /* half of the 76 second bucket, all of the 30 second bucket */
-  GPR_ASSERT(compare_double(result.count, 2, epsilon) == 0 &&
-             compare_double(sum.value1, value.value1 * 2, epsilon) == 0 &&
-             sum.value2 == value.value2 * 2);
-  census_window_stats_destroy(stats);
-}
-
-void many_interval_test(void) {
-  gpr_timespec intervals[4];
-  const test_stat value = {123.45, 8};
-  const double epsilon = 1e10 - 11;
-  gpr_timespec when = {3600, 0}; /* one hour */
-  census_window_stats_sums result[4];
-  test_stat sums[4];
-  int i;
-  struct census_window_stats *stats;
-  intervals[0] = kMilliSecInterval;
-  intervals[1] = kSecInterval;
-  intervals[2] = kMinInterval;
-  intervals[3] = kHourInterval;
-  for (i = 0; i < 4; i++) {
-    result[i].statistic = &sums[i];
-  }
-  stats = census_window_stats_create(4, intervals, 100, &kMyStatInfo);
-  GPR_ASSERT(stats != NULL);
-  /* add 10 stats within half of each time range */
-  for (i = 0; i < 10; i++) {
-    when.tv_sec += 180; /* covers 30 min of one hour range */
-    census_window_stats_add(stats, when, &value);
-  }
-  when.tv_sec += 120;
-  for (i = 0; i < 10; i++) {
-    when.tv_sec += 3; /* covers 30 sec of one minute range */
-    census_window_stats_add(stats, when, &value);
-  }
-  when.tv_sec += 2;
-  for (i = 0; i < 10; i++) {
-    when.tv_nsec += 50000000; /* covers 0.5s of 1s range */
-    census_window_stats_add(stats, when, &value);
-  }
-  when.tv_nsec += 2000000;
-  for (i = 0; i < 10; i++) {
-    when.tv_nsec += 50000; /* covers 0.5 ms of 1 ms range */
-    census_window_stats_add(stats, when, &value);
-  }
-  when.tv_nsec += 20000;
-  census_window_stats_get_sums(stats, when, result);
-  GPR_ASSERT(compare_double(result[0].count, 10, epsilon) == 0 &&
-             compare_double(sums[0].value1, value.value1 * 10, epsilon) == 0 &&
-             sums[0].value2 == value.value2 * 10);
-  when.tv_nsec += 20000000;
-  census_window_stats_get_sums(stats, when, result);
-  GPR_ASSERT(compare_double(result[1].count, 20, epsilon) == 0 &&
-             compare_double(sums[1].value1, value.value1 * 20, epsilon) == 0 &&
-             sums[1].value2 == value.value2 * 20);
-  when.tv_sec += 2;
-  census_window_stats_get_sums(stats, when, result);
-  GPR_ASSERT(compare_double(result[2].count, 30, epsilon) == 0 &&
-             compare_double(sums[2].value1, value.value1 * 30, epsilon) == 0 &&
-             sums[2].value2 == value.value2 * 30);
-  when.tv_sec += 72;
-  census_window_stats_get_sums(stats, when, result);
-  GPR_ASSERT(compare_double(result[3].count, 40, epsilon) == 0 &&
-             compare_double(sums[3].value1, value.value1 * 40, epsilon) == 0 &&
-             sums[3].value2 == value.value2 * 40);
-  census_window_stats_destroy(stats);
-}
-
-void rolling_time_test(void) {
-  const test_stat value = {0.1, 4};
-  gpr_timespec when = {0, 0};
-  census_window_stats_sums result;
-  test_stat sum;
-  int i;
-  gpr_timespec increment = {0, 0};
-  struct census_window_stats *stats =
-      census_window_stats_create(1, &kMinInterval, 7, &kMyStatInfo);
-  GPR_ASSERT(stats != NULL);
-  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
-  for (i = 0; i < 100000; i++) {
-    increment.tv_nsec = rand() % 100000000; /* up to 1/10th second */
-    when = gpr_time_add(when, increment);
-    census_window_stats_add(stats, when, &value);
-  }
-  result.statistic = &sum;
-  census_window_stats_get_sums(stats, when, &result);
-  /* With 1/20th second average between samples, we expect 20*60 = 1200
-     samples on average. Make sure we are within 100 of that. */
-  GPR_ASSERT(compare_double(result.count, 1200, 100) == 0);
-  census_window_stats_destroy(stats);
-}
-
-#include <stdio.h>
-void infinite_interval_test(void) {
-  const test_stat value = {0.1, 4};
-  gpr_timespec when = {0, 0};
-  census_window_stats_sums result;
-  test_stat sum;
-  int i;
-  const int count = 100000;
-  gpr_timespec increment = {0, 0};
-  struct census_window_stats *stats = census_window_stats_create(
-      1, &gpr_inf_future(GPR_CLOCK_REALTIME), 10, &kMyStatInfo);
-  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
-  for (i = 0; i < count; i++) {
-    increment.tv_sec = rand() % 21600; /* 6 hours */
-    when = gpr_time_add(when, increment);
-    census_window_stats_add(stats, when, &value);
-  }
-  result.statistic = &sum;
-  census_window_stats_get_sums(stats, when, &result);
-  /* The only thing it makes sense to compare for "infinite" periods is the
-     total counts */
-  GPR_ASSERT(result.count == count);
-  census_window_stats_destroy(stats);
-}
-
-int main(int argc, char *argv[]) {
-  grpc_test_init(argc, argv);
-  empty_test();
-  one_interval_test();
-  many_interval_test();
-  rolling_time_test();
-  infinite_interval_test();
-  return 0;
-}
diff --git a/test/core/statistics/window_stats_test.cc b/test/core/statistics/window_stats_test.cc
new file mode 100644
index 0000000..b17c61a
--- /dev/null
+++ b/test/core/statistics/window_stats_test.cc
@@ -0,0 +1,304 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/census/window_stats.h"
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <stdlib.h>
+#include "test/core/util/test_config.h"
+
+typedef struct test_stat {
+  double value1;
+  int value2;
+} test_stat;
+
+void add_test_stat(void* base, const void* addme) {
+  test_stat* b = (test_stat*)base;
+  const test_stat* a = (const test_stat*)addme;
+  b->value1 += a->value1;
+  b->value2 += a->value2;
+}
+
+void add_proportion_test_stat(double p, void* base, const void* addme) {
+  test_stat* b = (test_stat*)base;
+  const test_stat* a = (const test_stat*)addme;
+  b->value1 += p * a->value1;
+  b->value2 += p * a->value2 + 0.5; /* +0.5 is poor mans (no c99) round() */
+}
+
+const struct census_window_stats_stat_info kMyStatInfo = {
+    sizeof(test_stat), NULL, add_test_stat, add_proportion_test_stat};
+
+const gpr_timespec kMilliSecInterval = {0, 1000000, GPR_CLOCK_MONOTONIC};
+const gpr_timespec kSecInterval = {1, 0, GPR_CLOCK_MONOTONIC};
+const gpr_timespec kMinInterval = {60, 0 GPR_CLOCK_MONOTONIC};
+const gpr_timespec kHourInterval = {3600, 0, GPR_CLOCK_MONOTONIC};
+const gpr_timespec kPrimeInterval = {0, 101, GPR_CLOCK_MONOTONIC};
+
+static int compare_double(double a, double b, double epsilon) {
+  if (a >= b) {
+    return (a > b + epsilon) ? 1 : 0;
+  } else {
+    return (b > a + epsilon) ? -1 : 0;
+  }
+}
+
+void empty_test(void) {
+  census_window_stats_sums result;
+  const gpr_timespec zero = {0, 0, GPR_CLOCK_MONOTONIC};
+  test_stat sum;
+  struct census_window_stats* stats =
+      census_window_stats_create(1, &kMinInterval, 5, &kMyStatInfo);
+  GPR_ASSERT(stats != NULL);
+  result.statistic = &sum;
+  census_window_stats_get_sums(stats, zero, &result);
+  GPR_ASSERT(result.count == 0 && sum.value1 == 0 && sum.value2 == 0);
+  census_window_stats_get_sums(stats, gpr_now(GPR_CLOCK_REALTIME), &result);
+  GPR_ASSERT(result.count == 0 && sum.value1 == 0 && sum.value2 == 0);
+  census_window_stats_destroy(stats);
+}
+
+void one_interval_test(void) {
+  const test_stat value = {0.1, 4};
+  const double epsilon = 1e10 - 11;
+  gpr_timespec when = {0, 0, GPR_CLOCK_MONOTONIC};
+  census_window_stats_sums result;
+  test_stat sum;
+  /* granularity == 5 so width of internal windows should be 12s */
+  struct census_window_stats* stats =
+      census_window_stats_create(1, &kMinInterval, 5, &kMyStatInfo);
+  GPR_ASSERT(stats != NULL);
+  /* phase 1: insert a single value at t=0s, and check that various measurement
+     times result in expected output values */
+  census_window_stats_add(stats, when, &value);
+  result.statistic = &sum;
+  /* when = 0s, values extracted should be everything */
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(compare_double(result.count, 1, epsilon) == 0 &&
+             compare_double(sum.value1, value.value1, epsilon) == 0 &&
+             sum.value2 == value.value2);
+  /* when = 6,30,60s, should be all of the data */
+  when.tv_sec = 6;
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(compare_double(result.count, 1.0, epsilon) == 0 &&
+             compare_double(sum.value1, value.value1, epsilon) == 0 &&
+             sum.value2 == value.value2);
+  /* when == 30s,60s, should be all of the data */
+  when.tv_sec = 30;
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(compare_double(result.count, 1.0, epsilon) == 0 &&
+             compare_double(sum.value1, value.value1, epsilon) == 0 &&
+             sum.value2 == value.value2);
+  when.tv_sec = 60;
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(compare_double(result.count, 1.0, epsilon) == 0 &&
+             compare_double(sum.value1, value.value1, epsilon) == 0 &&
+             sum.value2 == value.value2);
+  /* when = 66s, should be half (only take half of bottom bucket) */
+  when.tv_sec = 66;
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(compare_double(result.count, 0.5, epsilon) == 0 &&
+             compare_double(sum.value1, value.value1 / 2, epsilon) == 0 &&
+             sum.value2 == value.value2 / 2);
+  /* when = 72s, should be completely out of window */
+  when.tv_sec = 72;
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(compare_double(result.count, 0, epsilon) == 0 &&
+             compare_double(sum.value1, 0, epsilon) == 0 && sum.value2 == 0);
+
+  /* phase 2: tear down and do as before, but inserting two values */
+  census_window_stats_destroy(stats);
+  stats = census_window_stats_create(1, &kMinInterval, 5, &kMyStatInfo);
+  GPR_ASSERT(stats != NULL);
+  when.tv_sec = 0;
+  when.tv_nsec = 17;
+  census_window_stats_add(stats, when, &value);
+  when.tv_sec = 1;
+  census_window_stats_add(stats, when, &value);
+  when.tv_sec = 0;
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(compare_double(result.count, 0, epsilon) == 0 &&
+             compare_double(sum.value1, 0, epsilon) == 0 && sum.value2 == 0);
+  /* time = 3s, 30s, should get all data */
+  when.tv_sec = 3;
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(compare_double(result.count, 2, epsilon) == 0 &&
+             compare_double(sum.value1, 2 * value.value1, epsilon) == 0 &&
+             sum.value2 == 2 * value.value2);
+  when.tv_sec = 30;
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(compare_double(result.count, 2, epsilon) == 0 &&
+             compare_double(sum.value1, 2 * value.value1, epsilon) == 0 &&
+             sum.value2 == 2 * value.value2);
+
+  /* phase 3: insert into "middle" bucket, and force a shift, pushing out
+     the two values in bottom bucket */
+  when.tv_sec = 30;
+  census_window_stats_add(stats, when, &value);
+  when.tv_sec = 76;
+  census_window_stats_add(stats, when, &value);
+  when.tv_sec = 0;
+  census_window_stats_get_sums(stats, when, &result);
+  GPR_ASSERT(result.count == 0 && sum.value1 == 0 && sum.value2 == 0);
+  when.tv_sec = 30;
+  census_window_stats_get_sums(stats, when, &result);
+  /* half of the single value in the 30 second bucket */
+  GPR_ASSERT(compare_double(result.count, 0.5, epsilon) == 0 &&
+             compare_double(sum.value1, value.value1 / 2, epsilon) == 0 &&
+             sum.value2 == value.value2 / 2);
+  when.tv_sec = 74;
+  census_window_stats_get_sums(stats, when, &result);
+  /* half of the 76 second bucket, all of the 30 second bucket */
+  GPR_ASSERT(compare_double(result.count, 1.5, epsilon) == 0 &&
+             compare_double(sum.value1, value.value1 * 1.5, epsilon) == 0 &&
+             sum.value2 == value.value2 / 2 * 3);
+  when.tv_sec = 76;
+  census_window_stats_get_sums(stats, when, &result);
+  /* >=76s, get all of the 76 second bucket, all of the 30 second bucket */
+  GPR_ASSERT(compare_double(result.count, 2, epsilon) == 0 &&
+             compare_double(sum.value1, value.value1 * 2, epsilon) == 0 &&
+             sum.value2 == value.value2 * 2);
+  when.tv_sec = 78;
+  census_window_stats_get_sums(stats, when, &result);
+  /* half of the 76 second bucket, all of the 30 second bucket */
+  GPR_ASSERT(compare_double(result.count, 2, epsilon) == 0 &&
+             compare_double(sum.value1, value.value1 * 2, epsilon) == 0 &&
+             sum.value2 == value.value2 * 2);
+  census_window_stats_destroy(stats);
+}
+
+void many_interval_test(void) {
+  gpr_timespec intervals[4];
+  const test_stat value = {123.45, 8};
+  const double epsilon = 1e10 - 11;
+  gpr_timespec when = {3600, 0, GPR_CLOCK_MONOTONIC}; /* one hour */
+  census_window_stats_sums result[4];
+  test_stat sums[4];
+  int i;
+  struct census_window_stats* stats;
+  intervals[0] = kMilliSecInterval;
+  intervals[1] = kSecInterval;
+  intervals[2] = kMinInterval;
+  intervals[3] = kHourInterval;
+  for (i = 0; i < 4; i++) {
+    result[i].statistic = &sums[i];
+  }
+  stats = census_window_stats_create(4, intervals, 100, &kMyStatInfo);
+  GPR_ASSERT(stats != NULL);
+  /* add 10 stats within half of each time range */
+  for (i = 0; i < 10; i++) {
+    when.tv_sec += 180; /* covers 30 min of one hour range */
+    census_window_stats_add(stats, when, &value);
+  }
+  when.tv_sec += 120;
+  for (i = 0; i < 10; i++) {
+    when.tv_sec += 3; /* covers 30 sec of one minute range */
+    census_window_stats_add(stats, when, &value);
+  }
+  when.tv_sec += 2;
+  for (i = 0; i < 10; i++) {
+    when.tv_nsec += 50000000; /* covers 0.5s of 1s range */
+    census_window_stats_add(stats, when, &value);
+  }
+  when.tv_nsec += 2000000;
+  for (i = 0; i < 10; i++) {
+    when.tv_nsec += 50000; /* covers 0.5 ms of 1 ms range */
+    census_window_stats_add(stats, when, &value);
+  }
+  when.tv_nsec += 20000;
+  census_window_stats_get_sums(stats, when, result);
+  GPR_ASSERT(compare_double(result[0].count, 10, epsilon) == 0 &&
+             compare_double(sums[0].value1, value.value1 * 10, epsilon) == 0 &&
+             sums[0].value2 == value.value2 * 10);
+  when.tv_nsec += 20000000;
+  census_window_stats_get_sums(stats, when, result);
+  GPR_ASSERT(compare_double(result[1].count, 20, epsilon) == 0 &&
+             compare_double(sums[1].value1, value.value1 * 20, epsilon) == 0 &&
+             sums[1].value2 == value.value2 * 20);
+  when.tv_sec += 2;
+  census_window_stats_get_sums(stats, when, result);
+  GPR_ASSERT(compare_double(result[2].count, 30, epsilon) == 0 &&
+             compare_double(sums[2].value1, value.value1 * 30, epsilon) == 0 &&
+             sums[2].value2 == value.value2 * 30);
+  when.tv_sec += 72;
+  census_window_stats_get_sums(stats, when, result);
+  GPR_ASSERT(compare_double(result[3].count, 40, epsilon) == 0 &&
+             compare_double(sums[3].value1, value.value1 * 40, epsilon) == 0 &&
+             sums[3].value2 == value.value2 * 40);
+  census_window_stats_destroy(stats);
+}
+
+void rolling_time_test(void) {
+  const test_stat value = {0.1, 4};
+  gpr_timespec when = {0, 0, GPR_CLOCK_MONOTONIC};
+  census_window_stats_sums result;
+  test_stat sum;
+  int i;
+  gpr_timespec increment = {0, 0, GPR_CLOCK_MONOTONIC};
+  struct census_window_stats* stats =
+      census_window_stats_create(1, &kMinInterval, 7, &kMyStatInfo);
+  GPR_ASSERT(stats != NULL);
+  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
+  for (i = 0; i < 100000; i++) {
+    increment.tv_nsec = rand() % 100000000; /* up to 1/10th second */
+    when = gpr_time_add(when, increment);
+    census_window_stats_add(stats, when, &value);
+  }
+  result.statistic = &sum;
+  census_window_stats_get_sums(stats, when, &result);
+  /* With 1/20th second average between samples, we expect 20*60 = 1200
+     samples on average. Make sure we are within 100 of that. */
+  GPR_ASSERT(compare_double(result.count, 1200, 100) == 0);
+  census_window_stats_destroy(stats);
+}
+
+#include <stdio.h>
+void infinite_interval_test(void) {
+  const test_stat value = {0.1, 4};
+  gpr_timespec when = {0, 0, GPR_CLOCK_MONOTONIC};
+  census_window_stats_sums result;
+  test_stat sum;
+  int i;
+  const int count = 100000;
+  gpr_timespec increment = {0, 0, GPR_CLOCK_MONOTONIC};
+  gpr_timespec temp = gpr_inf_future(GPR_CLOCK_REALTIME);
+  struct census_window_stats* stats = census_window_stats_create(
+      1, &gpr_inf_future(GPR_CLOCK_REALTIME), 10, &kMyStatInfo);
+  srand(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
+  for (i = 0; i < count; i++) {
+    increment.tv_sec = rand() % 21600; /* 6 hours */
+    when = gpr_time_add(when, increment);
+    census_window_stats_add(stats, when, &value);
+  }
+  result.statistic = &sum;
+  census_window_stats_get_sums(stats, when, &result);
+  /* The only thing it makes sense to compare for "infinite" periods is the
+     total counts */
+  GPR_ASSERT(result.count == count);
+  census_window_stats_destroy(stats);
+}
+
+int main(int argc, char* argv[]) {
+  grpc_test_init(argc, argv);
+  empty_test();
+  one_interval_test();
+  many_interval_test();
+  rolling_time_test();
+  infinite_interval_test();
+  return 0;
+}
diff --git a/test/core/support/BUILD b/test/core/support/BUILD
index 3bdc1c4..9d042fd 100644
--- a/test/core/support/BUILD
+++ b/test/core/support/BUILD
@@ -20,8 +20,8 @@
 
 grpc_cc_test(
     name = "alloc_test",
-    srcs = ["alloc_test.c"],
-    language = "C",
+    srcs = ["alloc_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -30,8 +30,8 @@
 
 grpc_cc_test(
     name = "avl_test",
-    srcs = ["avl_test.c"],
-    language = "C",
+    srcs = ["avl_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -40,8 +40,8 @@
 
 grpc_cc_test(
     name = "cmdline_test",
-    srcs = ["cmdline_test.c"],
-    language = "C",
+    srcs = ["cmdline_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -50,8 +50,8 @@
 
 grpc_cc_test(
     name = "cpu_test",
-    srcs = ["cpu_test.c"],
-    language = "C",
+    srcs = ["cpu_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -60,8 +60,8 @@
 
 grpc_cc_test(
     name = "env_test",
-    srcs = ["env_test.c"],
-    language = "C",
+    srcs = ["env_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -70,8 +70,8 @@
 
 grpc_cc_test(
     name = "histogram_test",
-    srcs = ["histogram_test.c"],
-    language = "C",
+    srcs = ["histogram_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -80,8 +80,8 @@
 
 grpc_cc_test(
     name = "host_port_test",
-    srcs = ["host_port_test.c"],
-    language = "C",
+    srcs = ["host_port_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -90,8 +90,8 @@
 
 grpc_cc_test(
     name = "log_test",
-    srcs = ["log_test.c"],
-    language = "C",
+    srcs = ["log_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -100,8 +100,8 @@
 
 grpc_cc_test(
     name = "mpscq_test",
-    srcs = ["mpscq_test.c"],
-    language = "C",
+    srcs = ["mpscq_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -110,8 +110,8 @@
 
 grpc_cc_test(
     name = "murmur_hash_test",
-    srcs = ["murmur_hash_test.c"],
-    language = "C",
+    srcs = ["murmur_hash_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -120,8 +120,8 @@
 
 grpc_cc_test(
     name = "stack_lockfree_test",
-    srcs = ["stack_lockfree_test.c"],
-    language = "C",
+    srcs = ["stack_lockfree_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -130,8 +130,8 @@
 
 grpc_cc_test(
     name = "string_test",
-    srcs = ["string_test.c"],
-    language = "C",
+    srcs = ["string_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -140,8 +140,8 @@
 
 grpc_cc_test(
     name = "spinlock_test",
-    srcs = ["spinlock_test.c"],
-    language = "C",
+    srcs = ["spinlock_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -150,8 +150,8 @@
 
 grpc_cc_test(
     name = "sync_test",
-    srcs = ["sync_test.c"],
-    language = "C",
+    srcs = ["sync_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -160,8 +160,8 @@
 
 grpc_cc_test(
     name = "thd_test",
-    srcs = ["thd_test.c"],
-    language = "C",
+    srcs = ["thd_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -170,8 +170,8 @@
 
 grpc_cc_test(
     name = "time_test",
-    srcs = ["time_test.c"],
-    language = "C",
+    srcs = ["time_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -180,8 +180,8 @@
 
 grpc_cc_test(
     name = "tls_test",
-    srcs = ["tls_test.c"],
-    language = "C",
+    srcs = ["tls_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
@@ -190,8 +190,8 @@
 
 grpc_cc_test(
     name = "useful_test",
-    srcs = ["useful_test.c"],
-    language = "C",
+    srcs = ["useful_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//test/core/util:gpr_test_util",
diff --git a/test/core/support/alloc_test.c b/test/core/support/alloc_test.c
deleted file mode 100644
index 088ae7d..0000000
--- a/test/core/support/alloc_test.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "test/core/util/test_config.h"
-
-static void *fake_malloc(size_t size) { return (void *)size; }
-
-static void *fake_realloc(void *addr, size_t size) { return (void *)size; }
-
-static void fake_free(void *addr) {
-  *((intptr_t *)addr) = (intptr_t)0xdeadd00d;
-}
-
-static void test_custom_allocs() {
-  const gpr_allocation_functions default_fns = gpr_get_allocation_functions();
-  intptr_t addr_to_free = 0;
-  char *i;
-  gpr_allocation_functions fns = {fake_malloc, NULL, fake_realloc, fake_free};
-
-  gpr_set_allocation_functions(fns);
-  GPR_ASSERT((void *)(size_t)0xdeadbeef == gpr_malloc(0xdeadbeef));
-  GPR_ASSERT((void *)(size_t)0xcafed00d == gpr_realloc(0, 0xcafed00d));
-
-  gpr_free(&addr_to_free);
-  GPR_ASSERT(addr_to_free == (intptr_t)0xdeadd00d);
-
-  /* Restore and check we don't get funky values and that we don't leak */
-  gpr_set_allocation_functions(default_fns);
-  GPR_ASSERT((void *)sizeof(*i) != (i = gpr_malloc(sizeof(*i))));
-  GPR_ASSERT((void *)2 != (i = gpr_realloc(i, 2)));
-  gpr_free(i);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_custom_allocs();
-  return 0;
-}
diff --git a/test/core/support/alloc_test.cc b/test/core/support/alloc_test.cc
new file mode 100644
index 0000000..ee59036
--- /dev/null
+++ b/test/core/support/alloc_test.cc
@@ -0,0 +1,54 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include "test/core/util/test_config.h"
+
+static void* fake_malloc(size_t size) { return (void*)size; }
+
+static void* fake_realloc(void* addr, size_t size) { return (void*)size; }
+
+static void fake_free(void* addr) { *((intptr_t*)addr) = (intptr_t)0xdeadd00d; }
+
+static void test_custom_allocs() {
+  const gpr_allocation_functions default_fns = gpr_get_allocation_functions();
+  intptr_t addr_to_free = 0;
+  char* i;
+  gpr_allocation_functions fns = {fake_malloc, NULL, fake_realloc, fake_free};
+
+  gpr_set_allocation_functions(fns);
+  GPR_ASSERT((void*)(size_t)0xdeadbeef == gpr_malloc(0xdeadbeef));
+  GPR_ASSERT((void*)(size_t)0xcafed00d == gpr_realloc(0, 0xcafed00d));
+
+  gpr_free(&addr_to_free);
+  GPR_ASSERT(addr_to_free == (intptr_t)0xdeadd00d);
+
+  /* Restore and check we don't get funky values and that we don't leak */
+  gpr_set_allocation_functions(default_fns);
+  GPR_ASSERT((void*)sizeof(*i) !=
+             (i = static_cast<char*>(gpr_malloc(sizeof(*i)))));
+  GPR_ASSERT((void*)2 != (i = static_cast<char*>(gpr_realloc(i, 2))));
+  gpr_free(i);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_custom_allocs();
+  return 0;
+}
diff --git a/test/core/support/arena_test.c b/test/core/support/arena_test.c
deleted file mode 100644
index afb3092..0000000
--- a/test/core/support/arena_test.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/support/arena.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include <inttypes.h>
-#include <string.h>
-
-#include "src/core/lib/support/string.h"
-#include "test/core/util/test_config.h"
-
-static void test_noop(void) { gpr_arena_destroy(gpr_arena_create(1)); }
-
-static void test(const char *name, size_t init_size, const size_t *allocs,
-                 size_t nallocs) {
-  gpr_strvec v;
-  char *s;
-  gpr_strvec_init(&v);
-  gpr_asprintf(&s, "test '%s': %" PRIdPTR " <- {", name, init_size);
-  gpr_strvec_add(&v, s);
-  for (size_t i = 0; i < nallocs; i++) {
-    gpr_asprintf(&s, "%" PRIdPTR ",", allocs[i]);
-    gpr_strvec_add(&v, s);
-  }
-  gpr_strvec_add(&v, gpr_strdup("}"));
-  s = gpr_strvec_flatten(&v, NULL);
-  gpr_strvec_destroy(&v);
-  gpr_log(GPR_INFO, "%s", s);
-  gpr_free(s);
-
-  gpr_arena *a = gpr_arena_create(init_size);
-  void **ps = gpr_zalloc(sizeof(*ps) * nallocs);
-  for (size_t i = 0; i < nallocs; i++) {
-    ps[i] = gpr_arena_alloc(a, allocs[i]);
-    // ensure no duplicate results
-    for (size_t j = 0; j < i; j++) {
-      GPR_ASSERT(ps[i] != ps[j]);
-    }
-    // ensure writable
-    memset(ps[i], 1, allocs[i]);
-  }
-  gpr_arena_destroy(a);
-  gpr_free(ps);
-}
-
-#define TEST(name, init_size, ...)                     \
-  static const size_t allocs_##name[] = {__VA_ARGS__}; \
-  test(#name, init_size, allocs_##name, GPR_ARRAY_SIZE(allocs_##name))
-
-#define CONCURRENT_TEST_THREADS 100
-
-size_t concurrent_test_iterations() {
-  if (sizeof(void *) < 8) return 1000;
-  return 100000;
-}
-
-typedef struct {
-  gpr_event ev_start;
-  gpr_arena *arena;
-} concurrent_test_args;
-
-static void concurrent_test_body(void *arg) {
-  concurrent_test_args *a = arg;
-  gpr_event_wait(&a->ev_start, gpr_inf_future(GPR_CLOCK_REALTIME));
-  for (size_t i = 0; i < concurrent_test_iterations(); i++) {
-    *(char *)gpr_arena_alloc(a->arena, 1) = (char)i;
-  }
-}
-
-static void concurrent_test(void) {
-  gpr_log(GPR_DEBUG, "concurrent_test");
-
-  concurrent_test_args args;
-  gpr_event_init(&args.ev_start);
-  args.arena = gpr_arena_create(1024);
-
-  gpr_thd_id thds[CONCURRENT_TEST_THREADS];
-
-  for (int i = 0; i < CONCURRENT_TEST_THREADS; i++) {
-    gpr_thd_options opt = gpr_thd_options_default();
-    gpr_thd_options_set_joinable(&opt);
-    gpr_thd_new(&thds[i], concurrent_test_body, &args, &opt);
-  }
-
-  gpr_event_set(&args.ev_start, (void *)1);
-
-  for (int i = 0; i < CONCURRENT_TEST_THREADS; i++) {
-    gpr_thd_join(thds[i]);
-  }
-
-  gpr_arena_destroy(args.arena);
-}
-
-int main(int argc, char *argv[]) {
-  grpc_test_init(argc, argv);
-
-  test_noop();
-  TEST(0_1, 0, 1);
-  TEST(1_1, 1, 1);
-  TEST(1_2, 1, 2);
-  TEST(1_3, 1, 3);
-  TEST(1_inc, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
-  TEST(6_123, 6, 1, 2, 3);
-  concurrent_test();
-
-  return 0;
-}
diff --git a/test/core/support/arena_test.cc b/test/core/support/arena_test.cc
new file mode 100644
index 0000000..6c666af
--- /dev/null
+++ b/test/core/support/arena_test.cc
@@ -0,0 +1,128 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/support/arena.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include <inttypes.h>
+#include <string.h>
+
+#include "src/core/lib/support/string.h"
+#include "test/core/util/test_config.h"
+
+static void test_noop(void) { gpr_arena_destroy(gpr_arena_create(1)); }
+
+static void test(const char* name, size_t init_size, const size_t* allocs,
+                 size_t nallocs) {
+  gpr_strvec v;
+  char* s;
+  gpr_strvec_init(&v);
+  gpr_asprintf(&s, "test '%s': %" PRIdPTR " <- {", name, init_size);
+  gpr_strvec_add(&v, s);
+  for (size_t i = 0; i < nallocs; i++) {
+    gpr_asprintf(&s, "%" PRIdPTR ",", allocs[i]);
+    gpr_strvec_add(&v, s);
+  }
+  gpr_strvec_add(&v, gpr_strdup("}"));
+  s = gpr_strvec_flatten(&v, NULL);
+  gpr_strvec_destroy(&v);
+  gpr_log(GPR_INFO, "%s", s);
+  gpr_free(s);
+
+  gpr_arena* a = gpr_arena_create(init_size);
+  void** ps = static_cast<void**>(gpr_zalloc(sizeof(*ps) * nallocs));
+  for (size_t i = 0; i < nallocs; i++) {
+    ps[i] = gpr_arena_alloc(a, allocs[i]);
+    // ensure no duplicate results
+    for (size_t j = 0; j < i; j++) {
+      GPR_ASSERT(ps[i] != ps[j]);
+    }
+    // ensure writable
+    memset(ps[i], 1, allocs[i]);
+  }
+  gpr_arena_destroy(a);
+  gpr_free(ps);
+}
+
+#define TEST(name, init_size, ...)                     \
+  static const size_t allocs_##name[] = {__VA_ARGS__}; \
+  test(#name, init_size, allocs_##name, GPR_ARRAY_SIZE(allocs_##name))
+
+#define CONCURRENT_TEST_THREADS 100
+
+size_t concurrent_test_iterations() {
+  if (sizeof(void*) < 8) return 1000;
+  return 100000;
+}
+
+typedef struct {
+  gpr_event ev_start;
+  gpr_arena* arena;
+} concurrent_test_args;
+
+static void concurrent_test_body(void* arg) {
+  concurrent_test_args* a = static_cast<concurrent_test_args*>(arg);
+  gpr_event_wait(&a->ev_start, gpr_inf_future(GPR_CLOCK_REALTIME));
+  for (size_t i = 0; i < concurrent_test_iterations(); i++) {
+    *(char*)gpr_arena_alloc(a->arena, 1) = (char)i;
+  }
+}
+
+static void concurrent_test(void) {
+  gpr_log(GPR_DEBUG, "concurrent_test");
+
+  concurrent_test_args args;
+  gpr_event_init(&args.ev_start);
+  args.arena = gpr_arena_create(1024);
+
+  gpr_thd_id thds[CONCURRENT_TEST_THREADS];
+
+  for (int i = 0; i < CONCURRENT_TEST_THREADS; i++) {
+    gpr_thd_options opt = gpr_thd_options_default();
+    gpr_thd_options_set_joinable(&opt);
+    gpr_thd_new(&thds[i], concurrent_test_body, &args, &opt);
+  }
+
+  gpr_event_set(&args.ev_start, (void*)1);
+
+  for (int i = 0; i < CONCURRENT_TEST_THREADS; i++) {
+    gpr_thd_join(thds[i]);
+  }
+
+  gpr_arena_destroy(args.arena);
+}
+
+int main(int argc, char* argv[]) {
+  grpc_test_init(argc, argv);
+
+  test_noop();
+  TEST(0_1, 0, 1);
+  TEST(1_1, 1, 1);
+  TEST(1_2, 1, 2);
+  TEST(1_3, 1, 3);
+  TEST(1_inc, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+  TEST(6_123, 6, 1, 2, 3);
+  concurrent_test();
+
+  return 0;
+}
diff --git a/test/core/support/avl_test.c b/test/core/support/avl_test.c
deleted file mode 100644
index 37424d6..0000000
--- a/test/core/support/avl_test.c
+++ /dev/null
@@ -1,3659 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/avl.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "test/core/util/test_config.h"
-
-static int *box(int x) {
-  int *b = gpr_malloc(sizeof(*b));
-  *b = x;
-  return b;
-}
-
-static long int_compare(void *int1, void *int2, void *unused) {
-  return (*(int *)int1) - (*(int *)int2);
-}
-static void *int_copy(void *p, void *unused) { return box(*(int *)p); }
-
-static void destroy(void *p, void *unused) { gpr_free(p); }
-
-static const gpr_avl_vtable int_int_vtable = {destroy, int_copy, int_compare,
-                                              destroy, int_copy};
-
-static void check_get(gpr_avl avl, int key, int value) {
-  int *k = box(key);
-  GPR_ASSERT(*(int *)gpr_avl_get(avl, k, NULL) == value);
-  gpr_free(k);
-}
-
-static void check_negget(gpr_avl avl, int key) {
-  int *k = box(key);
-  GPR_ASSERT(gpr_avl_get(avl, k, NULL) == NULL);
-  gpr_free(k);
-}
-
-static gpr_avl remove_int(gpr_avl avl, int key) {
-  int *k = box(key);
-  avl = gpr_avl_remove(avl, k, NULL);
-  gpr_free(k);
-  return avl;
-}
-
-static void test_get(void) {
-  gpr_avl avl;
-  gpr_log(GPR_DEBUG, "test_get");
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(1), box(11), NULL);
-  avl = gpr_avl_add(avl, box(2), box(22), NULL);
-  avl = gpr_avl_add(avl, box(3), box(33), NULL);
-  check_get(avl, 1, 11);
-  check_get(avl, 2, 22);
-  check_get(avl, 3, 33);
-  check_negget(avl, 4);
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_ll(void) {
-  gpr_avl avl;
-  gpr_log(GPR_DEBUG, "test_ll");
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(5), box(1), NULL);
-  avl = gpr_avl_add(avl, box(4), box(2), NULL);
-  avl = gpr_avl_add(avl, box(3), box(3), NULL);
-  GPR_ASSERT(*(int *)avl.root->key == 4);
-  GPR_ASSERT(*(int *)avl.root->left->key == 3);
-  GPR_ASSERT(*(int *)avl.root->right->key == 5);
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_lr(void) {
-  gpr_avl avl;
-  gpr_log(GPR_DEBUG, "test_lr");
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(5), box(1), NULL);
-  avl = gpr_avl_add(avl, box(3), box(2), NULL);
-  avl = gpr_avl_add(avl, box(4), box(3), NULL);
-  GPR_ASSERT(*(int *)avl.root->key == 4);
-  GPR_ASSERT(*(int *)avl.root->left->key == 3);
-  GPR_ASSERT(*(int *)avl.root->right->key == 5);
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_rr(void) {
-  gpr_avl avl;
-  gpr_log(GPR_DEBUG, "test_rr");
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(3), box(1), NULL);
-  avl = gpr_avl_add(avl, box(4), box(2), NULL);
-  avl = gpr_avl_add(avl, box(5), box(3), NULL);
-  GPR_ASSERT(*(int *)avl.root->key == 4);
-  GPR_ASSERT(*(int *)avl.root->left->key == 3);
-  GPR_ASSERT(*(int *)avl.root->right->key == 5);
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_rl(void) {
-  gpr_avl avl;
-  gpr_log(GPR_DEBUG, "test_rl");
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(3), box(1), NULL);
-  avl = gpr_avl_add(avl, box(5), box(2), NULL);
-  avl = gpr_avl_add(avl, box(4), box(3), NULL);
-  GPR_ASSERT(*(int *)avl.root->key == 4);
-  GPR_ASSERT(*(int *)avl.root->left->key == 3);
-  GPR_ASSERT(*(int *)avl.root->right->key == 5);
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_unbalanced(void) {
-  gpr_avl avl;
-  gpr_log(GPR_DEBUG, "test_unbalanced");
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(5), box(1), NULL);
-  avl = gpr_avl_add(avl, box(4), box(2), NULL);
-  avl = gpr_avl_add(avl, box(3), box(3), NULL);
-  avl = gpr_avl_add(avl, box(2), box(4), NULL);
-  avl = gpr_avl_add(avl, box(1), box(5), NULL);
-  GPR_ASSERT(*(int *)avl.root->key == 4);
-  GPR_ASSERT(*(int *)avl.root->left->key == 2);
-  GPR_ASSERT(*(int *)avl.root->left->left->key == 1);
-  GPR_ASSERT(*(int *)avl.root->left->right->key == 3);
-  GPR_ASSERT(*(int *)avl.root->right->key == 5);
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_replace(void) {
-  gpr_avl avl;
-  gpr_log(GPR_DEBUG, "test_replace");
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(1), box(1), NULL);
-  avl = gpr_avl_add(avl, box(1), box(2), NULL);
-  check_get(avl, 1, 2);
-  check_negget(avl, 2);
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_remove(void) {
-  gpr_avl avl;
-  gpr_avl avl3, avl4, avl5, avln;
-  gpr_log(GPR_DEBUG, "test_remove");
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(3), box(1), NULL);
-  avl = gpr_avl_add(avl, box(4), box(2), NULL);
-  avl = gpr_avl_add(avl, box(5), box(3), NULL);
-
-  avl3 = remove_int(gpr_avl_ref(avl, NULL), 3);
-  avl4 = remove_int(gpr_avl_ref(avl, NULL), 4);
-  avl5 = remove_int(gpr_avl_ref(avl, NULL), 5);
-  avln = remove_int(gpr_avl_ref(avl, NULL), 1);
-
-  gpr_avl_unref(avl, NULL);
-
-  check_negget(avl3, 3);
-  check_get(avl3, 4, 2);
-  check_get(avl3, 5, 3);
-  gpr_avl_unref(avl3, NULL);
-
-  check_get(avl4, 3, 1);
-  check_negget(avl4, 4);
-  check_get(avl4, 5, 3);
-  gpr_avl_unref(avl4, NULL);
-
-  check_get(avl5, 3, 1);
-  check_get(avl5, 4, 2);
-  check_negget(avl5, 5);
-  gpr_avl_unref(avl5, NULL);
-
-  check_get(avln, 3, 1);
-  check_get(avln, 4, 2);
-  check_get(avln, 5, 3);
-  gpr_avl_unref(avln, NULL);
-}
-
-static void test_badcase1(void) {
-  gpr_avl avl;
-
-  gpr_log(GPR_DEBUG, "test_badcase1");
-
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(88), box(1), NULL);
-  avl = remove_int(avl, 643);
-  avl = remove_int(avl, 983);
-  avl = gpr_avl_add(avl, box(985), box(4), NULL);
-  avl = gpr_avl_add(avl, box(640), box(5), NULL);
-  avl = gpr_avl_add(avl, box(41), box(6), NULL);
-  avl = gpr_avl_add(avl, box(112), box(7), NULL);
-  avl = gpr_avl_add(avl, box(342), box(8), NULL);
-  avl = remove_int(avl, 1013);
-  avl = gpr_avl_add(avl, box(434), box(10), NULL);
-  avl = gpr_avl_add(avl, box(520), box(11), NULL);
-  avl = gpr_avl_add(avl, box(231), box(12), NULL);
-  avl = gpr_avl_add(avl, box(852), box(13), NULL);
-  avl = remove_int(avl, 461);
-  avl = gpr_avl_add(avl, box(108), box(15), NULL);
-  avl = gpr_avl_add(avl, box(806), box(16), NULL);
-  avl = gpr_avl_add(avl, box(827), box(17), NULL);
-  avl = remove_int(avl, 796);
-  avl = gpr_avl_add(avl, box(340), box(19), NULL);
-  avl = gpr_avl_add(avl, box(498), box(20), NULL);
-  avl = gpr_avl_add(avl, box(203), box(21), NULL);
-  avl = gpr_avl_add(avl, box(751), box(22), NULL);
-  avl = gpr_avl_add(avl, box(150), box(23), NULL);
-  avl = remove_int(avl, 237);
-  avl = gpr_avl_add(avl, box(830), box(25), NULL);
-  avl = remove_int(avl, 1007);
-  avl = remove_int(avl, 394);
-  avl = gpr_avl_add(avl, box(65), box(28), NULL);
-  avl = remove_int(avl, 904);
-  avl = remove_int(avl, 123);
-  avl = gpr_avl_add(avl, box(238), box(31), NULL);
-  avl = gpr_avl_add(avl, box(184), box(32), NULL);
-  avl = remove_int(avl, 331);
-  avl = gpr_avl_add(avl, box(827), box(34), NULL);
-
-  check_get(avl, 830, 25);
-
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_badcase2(void) {
-  gpr_avl avl;
-
-  gpr_log(GPR_DEBUG, "test_badcase2");
-
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = gpr_avl_add(avl, box(288), box(1), NULL);
-  avl = remove_int(avl, 415);
-  avl = gpr_avl_add(avl, box(953), box(3), NULL);
-  avl = gpr_avl_add(avl, box(101), box(4), NULL);
-  avl = gpr_avl_add(avl, box(516), box(5), NULL);
-  avl = gpr_avl_add(avl, box(547), box(6), NULL);
-  avl = gpr_avl_add(avl, box(467), box(7), NULL);
-  avl = gpr_avl_add(avl, box(793), box(8), NULL);
-  avl = remove_int(avl, 190);
-  avl = gpr_avl_add(avl, box(687), box(10), NULL);
-  avl = gpr_avl_add(avl, box(242), box(11), NULL);
-  avl = gpr_avl_add(avl, box(142), box(12), NULL);
-  avl = remove_int(avl, 705);
-  avl = remove_int(avl, 578);
-  avl = remove_int(avl, 767);
-  avl = remove_int(avl, 183);
-  avl = gpr_avl_add(avl, box(950), box(17), NULL);
-  avl = gpr_avl_add(avl, box(622), box(18), NULL);
-  avl = remove_int(avl, 513);
-  avl = remove_int(avl, 429);
-  avl = gpr_avl_add(avl, box(205), box(21), NULL);
-  avl = remove_int(avl, 663);
-  avl = remove_int(avl, 953);
-  avl = remove_int(avl, 892);
-  avl = gpr_avl_add(avl, box(236), box(25), NULL);
-  avl = remove_int(avl, 982);
-  avl = remove_int(avl, 201);
-  avl = remove_int(avl, 684);
-  avl = gpr_avl_add(avl, box(572), box(29), NULL);
-  avl = remove_int(avl, 817);
-  avl = gpr_avl_add(avl, box(970), box(31), NULL);
-  avl = remove_int(avl, 347);
-  avl = remove_int(avl, 574);
-  avl = gpr_avl_add(avl, box(752), box(34), NULL);
-  avl = gpr_avl_add(avl, box(670), box(35), NULL);
-  avl = gpr_avl_add(avl, box(69), box(36), NULL);
-  avl = remove_int(avl, 111);
-  avl = remove_int(avl, 523);
-  avl = gpr_avl_add(avl, box(141), box(39), NULL);
-  avl = remove_int(avl, 159);
-  avl = gpr_avl_add(avl, box(947), box(41), NULL);
-  avl = gpr_avl_add(avl, box(855), box(42), NULL);
-  avl = remove_int(avl, 218);
-  avl = remove_int(avl, 6);
-  avl = gpr_avl_add(avl, box(753), box(45), NULL);
-  avl = remove_int(avl, 82);
-  avl = remove_int(avl, 799);
-  avl = gpr_avl_add(avl, box(572), box(48), NULL);
-  avl = remove_int(avl, 376);
-  avl = remove_int(avl, 413);
-  avl = gpr_avl_add(avl, box(458), box(51), NULL);
-  avl = remove_int(avl, 897);
-  avl = gpr_avl_add(avl, box(191), box(53), NULL);
-  avl = gpr_avl_add(avl, box(609), box(54), NULL);
-  avl = remove_int(avl, 787);
-  avl = remove_int(avl, 710);
-  avl = remove_int(avl, 886);
-  avl = remove_int(avl, 835);
-  avl = remove_int(avl, 33);
-  avl = gpr_avl_add(avl, box(871), box(60), NULL);
-  avl = remove_int(avl, 641);
-  avl = gpr_avl_add(avl, box(462), box(62), NULL);
-  avl = remove_int(avl, 359);
-  avl = remove_int(avl, 767);
-  avl = gpr_avl_add(avl, box(310), box(65), NULL);
-  avl = remove_int(avl, 757);
-  avl = remove_int(avl, 639);
-  avl = remove_int(avl, 314);
-  avl = gpr_avl_add(avl, box(2), box(69), NULL);
-  avl = remove_int(avl, 138);
-  avl = gpr_avl_add(avl, box(669), box(71), NULL);
-  avl = remove_int(avl, 477);
-  avl = gpr_avl_add(avl, box(366), box(73), NULL);
-  avl = gpr_avl_add(avl, box(612), box(74), NULL);
-  avl = gpr_avl_add(avl, box(106), box(75), NULL);
-  avl = remove_int(avl, 161);
-  avl = gpr_avl_add(avl, box(388), box(77), NULL);
-  avl = gpr_avl_add(avl, box(141), box(78), NULL);
-  avl = remove_int(avl, 633);
-  avl = remove_int(avl, 459);
-  avl = gpr_avl_add(avl, box(40), box(81), NULL);
-  avl = remove_int(avl, 689);
-  avl = gpr_avl_add(avl, box(823), box(83), NULL);
-  avl = remove_int(avl, 485);
-  avl = gpr_avl_add(avl, box(903), box(85), NULL);
-  avl = gpr_avl_add(avl, box(592), box(86), NULL);
-  avl = remove_int(avl, 448);
-  avl = gpr_avl_add(avl, box(56), box(88), NULL);
-  avl = remove_int(avl, 333);
-  avl = gpr_avl_add(avl, box(189), box(90), NULL);
-  avl = gpr_avl_add(avl, box(103), box(91), NULL);
-  avl = remove_int(avl, 164);
-  avl = remove_int(avl, 974);
-  avl = gpr_avl_add(avl, box(215), box(94), NULL);
-  avl = remove_int(avl, 189);
-  avl = remove_int(avl, 504);
-  avl = gpr_avl_add(avl, box(868), box(97), NULL);
-  avl = remove_int(avl, 909);
-  avl = remove_int(avl, 148);
-  avl = remove_int(avl, 469);
-  avl = gpr_avl_add(avl, box(994), box(101), NULL);
-  avl = gpr_avl_add(avl, box(576), box(102), NULL);
-  avl = remove_int(avl, 82);
-  avl = remove_int(avl, 209);
-  avl = gpr_avl_add(avl, box(276), box(105), NULL);
-  avl = remove_int(avl, 856);
-  avl = gpr_avl_add(avl, box(750), box(107), NULL);
-  avl = remove_int(avl, 871);
-  avl = gpr_avl_add(avl, box(301), box(109), NULL);
-  avl = remove_int(avl, 260);
-  avl = remove_int(avl, 737);
-  avl = remove_int(avl, 719);
-  avl = gpr_avl_add(avl, box(933), box(113), NULL);
-  avl = gpr_avl_add(avl, box(225), box(114), NULL);
-  avl = gpr_avl_add(avl, box(975), box(115), NULL);
-  avl = gpr_avl_add(avl, box(86), box(116), NULL);
-  avl = remove_int(avl, 732);
-  avl = gpr_avl_add(avl, box(340), box(118), NULL);
-  avl = gpr_avl_add(avl, box(271), box(119), NULL);
-  avl = remove_int(avl, 206);
-  avl = gpr_avl_add(avl, box(949), box(121), NULL);
-  avl = gpr_avl_add(avl, box(927), box(122), NULL);
-  avl = gpr_avl_add(avl, box(34), box(123), NULL);
-  avl = gpr_avl_add(avl, box(351), box(124), NULL);
-  avl = remove_int(avl, 836);
-  avl = gpr_avl_add(avl, box(825), box(126), NULL);
-  avl = gpr_avl_add(avl, box(352), box(127), NULL);
-  avl = remove_int(avl, 107);
-  avl = remove_int(avl, 101);
-  avl = gpr_avl_add(avl, box(320), box(130), NULL);
-  avl = gpr_avl_add(avl, box(3), box(131), NULL);
-  avl = remove_int(avl, 998);
-  avl = remove_int(avl, 44);
-  avl = gpr_avl_add(avl, box(525), box(134), NULL);
-  avl = gpr_avl_add(avl, box(864), box(135), NULL);
-  avl = gpr_avl_add(avl, box(863), box(136), NULL);
-  avl = remove_int(avl, 770);
-  avl = gpr_avl_add(avl, box(440), box(138), NULL);
-  avl = remove_int(avl, 516);
-  avl = gpr_avl_add(avl, box(116), box(140), NULL);
-  avl = remove_int(avl, 380);
-  avl = gpr_avl_add(avl, box(878), box(142), NULL);
-  avl = remove_int(avl, 439);
-  avl = gpr_avl_add(avl, box(994), box(144), NULL);
-  avl = remove_int(avl, 294);
-  avl = remove_int(avl, 593);
-  avl = gpr_avl_add(avl, box(696), box(147), NULL);
-  avl = remove_int(avl, 8);
-  avl = gpr_avl_add(avl, box(881), box(149), NULL);
-  avl = remove_int(avl, 32);
-  avl = remove_int(avl, 242);
-  avl = gpr_avl_add(avl, box(487), box(152), NULL);
-  avl = gpr_avl_add(avl, box(637), box(153), NULL);
-  avl = gpr_avl_add(avl, box(793), box(154), NULL);
-  avl = gpr_avl_add(avl, box(696), box(155), NULL);
-  avl = remove_int(avl, 458);
-  avl = gpr_avl_add(avl, box(828), box(157), NULL);
-  avl = remove_int(avl, 784);
-  avl = remove_int(avl, 274);
-  avl = gpr_avl_add(avl, box(783), box(160), NULL);
-  avl = remove_int(avl, 21);
-  avl = gpr_avl_add(avl, box(866), box(162), NULL);
-  avl = remove_int(avl, 919);
-  avl = gpr_avl_add(avl, box(435), box(164), NULL);
-  avl = remove_int(avl, 385);
-  avl = gpr_avl_add(avl, box(475), box(166), NULL);
-  avl = remove_int(avl, 339);
-  avl = gpr_avl_add(avl, box(615), box(168), NULL);
-  avl = remove_int(avl, 866);
-  avl = remove_int(avl, 82);
-  avl = remove_int(avl, 271);
-  avl = gpr_avl_add(avl, box(590), box(172), NULL);
-  avl = gpr_avl_add(avl, box(852), box(173), NULL);
-  avl = remove_int(avl, 318);
-  avl = remove_int(avl, 82);
-  avl = gpr_avl_add(avl, box(672), box(176), NULL);
-  avl = remove_int(avl, 430);
-  avl = gpr_avl_add(avl, box(821), box(178), NULL);
-  avl = gpr_avl_add(avl, box(365), box(179), NULL);
-  avl = remove_int(avl, 78);
-  avl = gpr_avl_add(avl, box(700), box(181), NULL);
-  avl = gpr_avl_add(avl, box(353), box(182), NULL);
-  avl = remove_int(avl, 492);
-  avl = gpr_avl_add(avl, box(991), box(184), NULL);
-  avl = remove_int(avl, 330);
-  avl = gpr_avl_add(avl, box(873), box(186), NULL);
-  avl = remove_int(avl, 589);
-  avl = gpr_avl_add(avl, box(676), box(188), NULL);
-  avl = gpr_avl_add(avl, box(790), box(189), NULL);
-  avl = remove_int(avl, 521);
-  avl = remove_int(avl, 47);
-  avl = gpr_avl_add(avl, box(976), box(192), NULL);
-  avl = gpr_avl_add(avl, box(683), box(193), NULL);
-  avl = remove_int(avl, 803);
-  avl = remove_int(avl, 1006);
-  avl = gpr_avl_add(avl, box(775), box(196), NULL);
-  avl = gpr_avl_add(avl, box(411), box(197), NULL);
-  avl = gpr_avl_add(avl, box(697), box(198), NULL);
-  avl = remove_int(avl, 50);
-  avl = gpr_avl_add(avl, box(213), box(200), NULL);
-  avl = remove_int(avl, 714);
-  avl = gpr_avl_add(avl, box(981), box(202), NULL);
-  avl = gpr_avl_add(avl, box(502), box(203), NULL);
-  avl = gpr_avl_add(avl, box(697), box(204), NULL);
-  avl = gpr_avl_add(avl, box(603), box(205), NULL);
-  avl = gpr_avl_add(avl, box(117), box(206), NULL);
-  avl = remove_int(avl, 363);
-  avl = gpr_avl_add(avl, box(104), box(208), NULL);
-  avl = remove_int(avl, 842);
-  avl = gpr_avl_add(avl, box(48), box(210), NULL);
-  avl = remove_int(avl, 764);
-  avl = gpr_avl_add(avl, box(482), box(212), NULL);
-  avl = gpr_avl_add(avl, box(928), box(213), NULL);
-  avl = gpr_avl_add(avl, box(30), box(214), NULL);
-  avl = gpr_avl_add(avl, box(820), box(215), NULL);
-  avl = gpr_avl_add(avl, box(334), box(216), NULL);
-  avl = remove_int(avl, 306);
-  avl = gpr_avl_add(avl, box(789), box(218), NULL);
-  avl = remove_int(avl, 924);
-  avl = gpr_avl_add(avl, box(53), box(220), NULL);
-  avl = remove_int(avl, 657);
-  avl = gpr_avl_add(avl, box(130), box(222), NULL);
-  avl = gpr_avl_add(avl, box(239), box(223), NULL);
-  avl = remove_int(avl, 20);
-  avl = gpr_avl_add(avl, box(117), box(225), NULL);
-  avl = remove_int(avl, 882);
-  avl = remove_int(avl, 891);
-  avl = gpr_avl_add(avl, box(9), box(228), NULL);
-  avl = gpr_avl_add(avl, box(496), box(229), NULL);
-  avl = gpr_avl_add(avl, box(750), box(230), NULL);
-  avl = gpr_avl_add(avl, box(283), box(231), NULL);
-  avl = gpr_avl_add(avl, box(802), box(232), NULL);
-  avl = remove_int(avl, 352);
-  avl = gpr_avl_add(avl, box(374), box(234), NULL);
-  avl = gpr_avl_add(avl, box(6), box(235), NULL);
-  avl = gpr_avl_add(avl, box(756), box(236), NULL);
-  avl = gpr_avl_add(avl, box(597), box(237), NULL);
-  avl = gpr_avl_add(avl, box(661), box(238), NULL);
-  avl = remove_int(avl, 96);
-  avl = gpr_avl_add(avl, box(894), box(240), NULL);
-  avl = remove_int(avl, 749);
-  avl = gpr_avl_add(avl, box(71), box(242), NULL);
-  avl = remove_int(avl, 68);
-  avl = gpr_avl_add(avl, box(388), box(244), NULL);
-  avl = remove_int(avl, 119);
-  avl = remove_int(avl, 856);
-  avl = gpr_avl_add(avl, box(176), box(247), NULL);
-  avl = gpr_avl_add(avl, box(993), box(248), NULL);
-  avl = remove_int(avl, 178);
-  avl = remove_int(avl, 781);
-  avl = remove_int(avl, 771);
-  avl = remove_int(avl, 848);
-  avl = remove_int(avl, 376);
-  avl = remove_int(avl, 157);
-  avl = remove_int(avl, 142);
-  avl = remove_int(avl, 686);
-  avl = gpr_avl_add(avl, box(779), box(257), NULL);
-  avl = gpr_avl_add(avl, box(484), box(258), NULL);
-  avl = remove_int(avl, 837);
-  avl = gpr_avl_add(avl, box(388), box(260), NULL);
-  avl = remove_int(avl, 987);
-  avl = gpr_avl_add(avl, box(336), box(262), NULL);
-  avl = remove_int(avl, 855);
-  avl = gpr_avl_add(avl, box(668), box(264), NULL);
-  avl = remove_int(avl, 648);
-  avl = gpr_avl_add(avl, box(193), box(266), NULL);
-  avl = remove_int(avl, 939);
-  avl = gpr_avl_add(avl, box(740), box(268), NULL);
-  avl = gpr_avl_add(avl, box(503), box(269), NULL);
-  avl = gpr_avl_add(avl, box(765), box(270), NULL);
-  avl = remove_int(avl, 924);
-  avl = remove_int(avl, 513);
-  avl = gpr_avl_add(avl, box(161), box(273), NULL);
-  avl = gpr_avl_add(avl, box(502), box(274), NULL);
-  avl = gpr_avl_add(avl, box(846), box(275), NULL);
-  avl = remove_int(avl, 931);
-  avl = gpr_avl_add(avl, box(87), box(277), NULL);
-  avl = gpr_avl_add(avl, box(949), box(278), NULL);
-  avl = gpr_avl_add(avl, box(548), box(279), NULL);
-  avl = gpr_avl_add(avl, box(951), box(280), NULL);
-  avl = remove_int(avl, 1018);
-  avl = remove_int(avl, 568);
-  avl = gpr_avl_add(avl, box(138), box(283), NULL);
-  avl = gpr_avl_add(avl, box(202), box(284), NULL);
-  avl = gpr_avl_add(avl, box(157), box(285), NULL);
-  avl = gpr_avl_add(avl, box(264), box(286), NULL);
-  avl = gpr_avl_add(avl, box(370), box(287), NULL);
-  avl = remove_int(avl, 736);
-  avl = remove_int(avl, 751);
-  avl = remove_int(avl, 506);
-  avl = remove_int(avl, 81);
-  avl = remove_int(avl, 358);
-  avl = remove_int(avl, 657);
-  avl = remove_int(avl, 86);
-  avl = gpr_avl_add(avl, box(876), box(295), NULL);
-  avl = remove_int(avl, 354);
-  avl = gpr_avl_add(avl, box(134), box(297), NULL);
-  avl = remove_int(avl, 781);
-  avl = remove_int(avl, 183);
-  avl = gpr_avl_add(avl, box(914), box(300), NULL);
-  avl = remove_int(avl, 926);
-  avl = remove_int(avl, 398);
-  avl = remove_int(avl, 932);
-  avl = remove_int(avl, 804);
-  avl = remove_int(avl, 326);
-  avl = gpr_avl_add(avl, box(208), box(306), NULL);
-  avl = gpr_avl_add(avl, box(699), box(307), NULL);
-  avl = remove_int(avl, 576);
-  avl = remove_int(avl, 850);
-  avl = remove_int(avl, 514);
-  avl = remove_int(avl, 676);
-  avl = remove_int(avl, 549);
-  avl = remove_int(avl, 767);
-  avl = gpr_avl_add(avl, box(58), box(314), NULL);
-  avl = gpr_avl_add(avl, box(265), box(315), NULL);
-  avl = gpr_avl_add(avl, box(268), box(316), NULL);
-  avl = gpr_avl_add(avl, box(103), box(317), NULL);
-  avl = gpr_avl_add(avl, box(440), box(318), NULL);
-  avl = remove_int(avl, 777);
-  avl = gpr_avl_add(avl, box(670), box(320), NULL);
-  avl = remove_int(avl, 506);
-  avl = remove_int(avl, 487);
-  avl = gpr_avl_add(avl, box(421), box(323), NULL);
-  avl = remove_int(avl, 514);
-  avl = gpr_avl_add(avl, box(701), box(325), NULL);
-  avl = remove_int(avl, 949);
-  avl = remove_int(avl, 872);
-  avl = remove_int(avl, 139);
-  avl = gpr_avl_add(avl, box(781), box(329), NULL);
-  avl = gpr_avl_add(avl, box(543), box(330), NULL);
-  avl = gpr_avl_add(avl, box(147), box(331), NULL);
-  avl = remove_int(avl, 190);
-  avl = gpr_avl_add(avl, box(453), box(333), NULL);
-  avl = remove_int(avl, 262);
-  avl = remove_int(avl, 850);
-  avl = remove_int(avl, 286);
-  avl = remove_int(avl, 787);
-  avl = gpr_avl_add(avl, box(514), box(338), NULL);
-  avl = remove_int(avl, 812);
-  avl = gpr_avl_add(avl, box(431), box(340), NULL);
-  avl = gpr_avl_add(avl, box(8), box(341), NULL);
-  avl = remove_int(avl, 843);
-  avl = gpr_avl_add(avl, box(831), box(343), NULL);
-  avl = remove_int(avl, 472);
-  avl = remove_int(avl, 157);
-  avl = gpr_avl_add(avl, box(612), box(346), NULL);
-  avl = gpr_avl_add(avl, box(802), box(347), NULL);
-  avl = remove_int(avl, 554);
-  avl = gpr_avl_add(avl, box(409), box(349), NULL);
-  avl = gpr_avl_add(avl, box(439), box(350), NULL);
-  avl = gpr_avl_add(avl, box(725), box(351), NULL);
-  avl = gpr_avl_add(avl, box(568), box(352), NULL);
-  avl = remove_int(avl, 475);
-  avl = remove_int(avl, 672);
-  avl = remove_int(avl, 62);
-  avl = remove_int(avl, 753);
-  avl = gpr_avl_add(avl, box(435), box(357), NULL);
-  avl = gpr_avl_add(avl, box(950), box(358), NULL);
-  avl = gpr_avl_add(avl, box(532), box(359), NULL);
-  avl = gpr_avl_add(avl, box(832), box(360), NULL);
-  avl = remove_int(avl, 390);
-  avl = gpr_avl_add(avl, box(993), box(362), NULL);
-  avl = remove_int(avl, 198);
-  avl = remove_int(avl, 401);
-  avl = gpr_avl_add(avl, box(316), box(365), NULL);
-  avl = remove_int(avl, 843);
-  avl = gpr_avl_add(avl, box(541), box(367), NULL);
-  avl = gpr_avl_add(avl, box(505), box(368), NULL);
-  avl = remove_int(avl, 445);
-  avl = remove_int(avl, 256);
-  avl = gpr_avl_add(avl, box(232), box(371), NULL);
-  avl = remove_int(avl, 577);
-  avl = remove_int(avl, 558);
-  avl = gpr_avl_add(avl, box(910), box(374), NULL);
-  avl = remove_int(avl, 902);
-  avl = remove_int(avl, 755);
-  avl = remove_int(avl, 114);
-  avl = remove_int(avl, 438);
-  avl = remove_int(avl, 224);
-  avl = gpr_avl_add(avl, box(920), box(380), NULL);
-  avl = gpr_avl_add(avl, box(655), box(381), NULL);
-  avl = remove_int(avl, 557);
-  avl = remove_int(avl, 102);
-  avl = remove_int(avl, 165);
-  avl = gpr_avl_add(avl, box(191), box(385), NULL);
-  avl = remove_int(avl, 30);
-  avl = gpr_avl_add(avl, box(406), box(387), NULL);
-  avl = gpr_avl_add(avl, box(66), box(388), NULL);
-  avl = gpr_avl_add(avl, box(87), box(389), NULL);
-  avl = remove_int(avl, 7);
-  avl = remove_int(avl, 671);
-  avl = gpr_avl_add(avl, box(234), box(392), NULL);
-  avl = remove_int(avl, 463);
-  avl = gpr_avl_add(avl, box(75), box(394), NULL);
-  avl = gpr_avl_add(avl, box(487), box(395), NULL);
-  avl = remove_int(avl, 203);
-  avl = gpr_avl_add(avl, box(711), box(397), NULL);
-  avl = remove_int(avl, 291);
-  avl = remove_int(avl, 798);
-  avl = remove_int(avl, 337);
-  avl = gpr_avl_add(avl, box(877), box(401), NULL);
-  avl = gpr_avl_add(avl, box(388), box(402), NULL);
-  avl = remove_int(avl, 975);
-  avl = gpr_avl_add(avl, box(200), box(404), NULL);
-  avl = gpr_avl_add(avl, box(408), box(405), NULL);
-  avl = gpr_avl_add(avl, box(3), box(406), NULL);
-  avl = gpr_avl_add(avl, box(971), box(407), NULL);
-  avl = remove_int(avl, 841);
-  avl = remove_int(avl, 910);
-  avl = remove_int(avl, 74);
-  avl = remove_int(avl, 888);
-  avl = gpr_avl_add(avl, box(492), box(412), NULL);
-  avl = remove_int(avl, 14);
-  avl = remove_int(avl, 364);
-  avl = gpr_avl_add(avl, box(215), box(415), NULL);
-  avl = remove_int(avl, 778);
-  avl = remove_int(avl, 45);
-  avl = gpr_avl_add(avl, box(328), box(418), NULL);
-  avl = gpr_avl_add(avl, box(597), box(419), NULL);
-  avl = remove_int(avl, 34);
-  avl = gpr_avl_add(avl, box(736), box(421), NULL);
-  avl = remove_int(avl, 37);
-  avl = gpr_avl_add(avl, box(275), box(423), NULL);
-  avl = gpr_avl_add(avl, box(70), box(424), NULL);
-  avl = gpr_avl_add(avl, box(771), box(425), NULL);
-  avl = remove_int(avl, 536);
-  avl = remove_int(avl, 421);
-  avl = gpr_avl_add(avl, box(186), box(428), NULL);
-  avl = gpr_avl_add(avl, box(788), box(429), NULL);
-  avl = gpr_avl_add(avl, box(224), box(430), NULL);
-  avl = remove_int(avl, 228);
-  avl = gpr_avl_add(avl, box(48), box(432), NULL);
-  avl = gpr_avl_add(avl, box(120), box(433), NULL);
-  avl = gpr_avl_add(avl, box(269), box(434), NULL);
-  avl = gpr_avl_add(avl, box(904), box(435), NULL);
-  avl = remove_int(avl, 699);
-  avl = gpr_avl_add(avl, box(340), box(437), NULL);
-  avl = remove_int(avl, 276);
-  avl = gpr_avl_add(avl, box(591), box(439), NULL);
-  avl = gpr_avl_add(avl, box(778), box(440), NULL);
-  avl = remove_int(avl, 490);
-  avl = remove_int(avl, 973);
-  avl = gpr_avl_add(avl, box(294), box(443), NULL);
-  avl = gpr_avl_add(avl, box(323), box(444), NULL);
-  avl = remove_int(avl, 685);
-  avl = gpr_avl_add(avl, box(38), box(446), NULL);
-  avl = gpr_avl_add(avl, box(525), box(447), NULL);
-  avl = remove_int(avl, 162);
-  avl = gpr_avl_add(avl, box(462), box(449), NULL);
-  avl = gpr_avl_add(avl, box(340), box(450), NULL);
-  avl = remove_int(avl, 734);
-  avl = remove_int(avl, 959);
-  avl = gpr_avl_add(avl, box(752), box(453), NULL);
-  avl = gpr_avl_add(avl, box(667), box(454), NULL);
-  avl = remove_int(avl, 558);
-  avl = remove_int(avl, 657);
-  avl = gpr_avl_add(avl, box(711), box(457), NULL);
-  avl = remove_int(avl, 937);
-  avl = gpr_avl_add(avl, box(741), box(459), NULL);
-  avl = gpr_avl_add(avl, box(40), box(460), NULL);
-  avl = remove_int(avl, 784);
-  avl = gpr_avl_add(avl, box(292), box(462), NULL);
-  avl = remove_int(avl, 164);
-  avl = remove_int(avl, 931);
-  avl = remove_int(avl, 886);
-  avl = gpr_avl_add(avl, box(968), box(466), NULL);
-  avl = remove_int(avl, 263);
-  avl = gpr_avl_add(avl, box(647), box(468), NULL);
-  avl = gpr_avl_add(avl, box(92), box(469), NULL);
-  avl = remove_int(avl, 310);
-  avl = gpr_avl_add(avl, box(711), box(471), NULL);
-  avl = gpr_avl_add(avl, box(675), box(472), NULL);
-  avl = remove_int(avl, 549);
-  avl = gpr_avl_add(avl, box(380), box(474), NULL);
-  avl = remove_int(avl, 825);
-  avl = gpr_avl_add(avl, box(668), box(476), NULL);
-  avl = remove_int(avl, 498);
-  avl = gpr_avl_add(avl, box(870), box(478), NULL);
-  avl = gpr_avl_add(avl, box(391), box(479), NULL);
-  avl = gpr_avl_add(avl, box(264), box(480), NULL);
-  avl = remove_int(avl, 1);
-  avl = remove_int(avl, 849);
-  avl = remove_int(avl, 88);
-  avl = remove_int(avl, 255);
-  avl = remove_int(avl, 763);
-  avl = remove_int(avl, 831);
-  avl = gpr_avl_add(avl, box(508), box(487), NULL);
-  avl = remove_int(avl, 849);
-  avl = remove_int(avl, 47);
-  avl = gpr_avl_add(avl, box(299), box(490), NULL);
-  avl = remove_int(avl, 625);
-  avl = remove_int(avl, 433);
-  avl = remove_int(avl, 904);
-  avl = remove_int(avl, 761);
-  avl = gpr_avl_add(avl, box(33), box(495), NULL);
-  avl = gpr_avl_add(avl, box(524), box(496), NULL);
-  avl = remove_int(avl, 210);
-  avl = remove_int(avl, 299);
-  avl = gpr_avl_add(avl, box(823), box(499), NULL);
-  avl = remove_int(avl, 479);
-  avl = remove_int(avl, 96);
-  avl = remove_int(avl, 1013);
-  avl = gpr_avl_add(avl, box(768), box(503), NULL);
-  avl = remove_int(avl, 638);
-  avl = remove_int(avl, 20);
-  avl = gpr_avl_add(avl, box(663), box(506), NULL);
-  avl = remove_int(avl, 882);
-  avl = gpr_avl_add(avl, box(745), box(508), NULL);
-  avl = remove_int(avl, 352);
-  avl = gpr_avl_add(avl, box(10), box(510), NULL);
-  avl = remove_int(avl, 484);
-  avl = gpr_avl_add(avl, box(420), box(512), NULL);
-  avl = gpr_avl_add(avl, box(884), box(513), NULL);
-  avl = gpr_avl_add(avl, box(993), box(514), NULL);
-  avl = gpr_avl_add(avl, box(251), box(515), NULL);
-  avl = remove_int(avl, 222);
-  avl = gpr_avl_add(avl, box(734), box(517), NULL);
-  avl = gpr_avl_add(avl, box(952), box(518), NULL);
-  avl = remove_int(avl, 26);
-  avl = remove_int(avl, 270);
-  avl = remove_int(avl, 481);
-  avl = remove_int(avl, 693);
-  avl = remove_int(avl, 1006);
-  avl = gpr_avl_add(avl, box(77), box(524), NULL);
-  avl = remove_int(avl, 897);
-  avl = gpr_avl_add(avl, box(719), box(526), NULL);
-  avl = gpr_avl_add(avl, box(622), box(527), NULL);
-  avl = remove_int(avl, 28);
-  avl = remove_int(avl, 836);
-  avl = remove_int(avl, 142);
-  avl = gpr_avl_add(avl, box(445), box(531), NULL);
-  avl = gpr_avl_add(avl, box(410), box(532), NULL);
-  avl = remove_int(avl, 575);
-  avl = gpr_avl_add(avl, box(634), box(534), NULL);
-  avl = gpr_avl_add(avl, box(906), box(535), NULL);
-  avl = remove_int(avl, 649);
-  avl = gpr_avl_add(avl, box(813), box(537), NULL);
-  avl = remove_int(avl, 702);
-  avl = remove_int(avl, 732);
-  avl = gpr_avl_add(avl, box(105), box(540), NULL);
-  avl = gpr_avl_add(avl, box(867), box(541), NULL);
-  avl = remove_int(avl, 964);
-  avl = remove_int(avl, 941);
-  avl = gpr_avl_add(avl, box(947), box(544), NULL);
-  avl = remove_int(avl, 990);
-  avl = gpr_avl_add(avl, box(816), box(546), NULL);
-  avl = remove_int(avl, 429);
-  avl = remove_int(avl, 567);
-  avl = remove_int(avl, 541);
-  avl = remove_int(avl, 583);
-  avl = gpr_avl_add(avl, box(57), box(551), NULL);
-  avl = gpr_avl_add(avl, box(786), box(552), NULL);
-  avl = gpr_avl_add(avl, box(526), box(553), NULL);
-  avl = remove_int(avl, 642);
-  avl = remove_int(avl, 220);
-  avl = remove_int(avl, 840);
-  avl = remove_int(avl, 548);
-  avl = gpr_avl_add(avl, box(528), box(558), NULL);
-  avl = gpr_avl_add(avl, box(749), box(559), NULL);
-  avl = gpr_avl_add(avl, box(194), box(560), NULL);
-  avl = remove_int(avl, 517);
-  avl = gpr_avl_add(avl, box(102), box(562), NULL);
-  avl = remove_int(avl, 189);
-  avl = gpr_avl_add(avl, box(927), box(564), NULL);
-  avl = remove_int(avl, 846);
-  avl = remove_int(avl, 130);
-  avl = gpr_avl_add(avl, box(694), box(567), NULL);
-  avl = remove_int(avl, 750);
-  avl = gpr_avl_add(avl, box(357), box(569), NULL);
-  avl = remove_int(avl, 431);
-  avl = remove_int(avl, 91);
-  avl = gpr_avl_add(avl, box(640), box(572), NULL);
-  avl = remove_int(avl, 4);
-  avl = gpr_avl_add(avl, box(81), box(574), NULL);
-  avl = gpr_avl_add(avl, box(595), box(575), NULL);
-  avl = remove_int(avl, 444);
-  avl = remove_int(avl, 262);
-  avl = remove_int(avl, 11);
-  avl = gpr_avl_add(avl, box(192), box(579), NULL);
-  avl = gpr_avl_add(avl, box(158), box(580), NULL);
-  avl = remove_int(avl, 401);
-  avl = remove_int(avl, 918);
-  avl = gpr_avl_add(avl, box(180), box(583), NULL);
-  avl = remove_int(avl, 268);
-  avl = gpr_avl_add(avl, box(1012), box(585), NULL);
-  avl = gpr_avl_add(avl, box(90), box(586), NULL);
-  avl = gpr_avl_add(avl, box(946), box(587), NULL);
-  avl = remove_int(avl, 719);
-  avl = gpr_avl_add(avl, box(874), box(589), NULL);
-  avl = gpr_avl_add(avl, box(679), box(590), NULL);
-  avl = remove_int(avl, 53);
-  avl = remove_int(avl, 534);
-  avl = gpr_avl_add(avl, box(646), box(593), NULL);
-  avl = gpr_avl_add(avl, box(767), box(594), NULL);
-  avl = gpr_avl_add(avl, box(460), box(595), NULL);
-  avl = gpr_avl_add(avl, box(852), box(596), NULL);
-  avl = gpr_avl_add(avl, box(189), box(597), NULL);
-  avl = remove_int(avl, 932);
-  avl = remove_int(avl, 366);
-  avl = remove_int(avl, 907);
-  avl = gpr_avl_add(avl, box(875), box(601), NULL);
-  avl = gpr_avl_add(avl, box(434), box(602), NULL);
-  avl = gpr_avl_add(avl, box(704), box(603), NULL);
-  avl = gpr_avl_add(avl, box(724), box(604), NULL);
-  avl = gpr_avl_add(avl, box(930), box(605), NULL);
-  avl = gpr_avl_add(avl, box(1000), box(606), NULL);
-  avl = remove_int(avl, 479);
-  avl = gpr_avl_add(avl, box(275), box(608), NULL);
-  avl = remove_int(avl, 32);
-  avl = gpr_avl_add(avl, box(939), box(610), NULL);
-  avl = remove_int(avl, 943);
-  avl = remove_int(avl, 329);
-  avl = gpr_avl_add(avl, box(490), box(613), NULL);
-  avl = remove_int(avl, 477);
-  avl = remove_int(avl, 414);
-  avl = remove_int(avl, 187);
-  avl = remove_int(avl, 334);
-  avl = gpr_avl_add(avl, box(40), box(618), NULL);
-  avl = remove_int(avl, 751);
-  avl = gpr_avl_add(avl, box(568), box(620), NULL);
-  avl = gpr_avl_add(avl, box(120), box(621), NULL);
-  avl = gpr_avl_add(avl, box(617), box(622), NULL);
-  avl = gpr_avl_add(avl, box(32), box(623), NULL);
-  avl = remove_int(avl, 701);
-  avl = gpr_avl_add(avl, box(910), box(625), NULL);
-  avl = remove_int(avl, 557);
-  avl = remove_int(avl, 361);
-  avl = remove_int(avl, 937);
-  avl = remove_int(avl, 100);
-  avl = remove_int(avl, 684);
-  avl = gpr_avl_add(avl, box(751), box(631), NULL);
-  avl = remove_int(avl, 781);
-  avl = remove_int(avl, 469);
-  avl = remove_int(avl, 75);
-  avl = remove_int(avl, 561);
-  avl = gpr_avl_add(avl, box(854), box(636), NULL);
-  avl = remove_int(avl, 164);
-  avl = remove_int(avl, 258);
-  avl = remove_int(avl, 315);
-  avl = remove_int(avl, 261);
-  avl = gpr_avl_add(avl, box(552), box(641), NULL);
-  avl = gpr_avl_add(avl, box(6), box(642), NULL);
-  avl = gpr_avl_add(avl, box(680), box(643), NULL);
-  avl = remove_int(avl, 741);
-  avl = remove_int(avl, 309);
-  avl = remove_int(avl, 272);
-  avl = gpr_avl_add(avl, box(249), box(647), NULL);
-  avl = remove_int(avl, 97);
-  avl = remove_int(avl, 850);
-  avl = gpr_avl_add(avl, box(915), box(650), NULL);
-  avl = gpr_avl_add(avl, box(816), box(651), NULL);
-  avl = gpr_avl_add(avl, box(45), box(652), NULL);
-  avl = gpr_avl_add(avl, box(168), box(653), NULL);
-  avl = remove_int(avl, 153);
-  avl = remove_int(avl, 239);
-  avl = gpr_avl_add(avl, box(684), box(656), NULL);
-  avl = gpr_avl_add(avl, box(208), box(657), NULL);
-  avl = gpr_avl_add(avl, box(681), box(658), NULL);
-  avl = gpr_avl_add(avl, box(609), box(659), NULL);
-  avl = gpr_avl_add(avl, box(645), box(660), NULL);
-  avl = remove_int(avl, 799);
-  avl = gpr_avl_add(avl, box(955), box(662), NULL);
-  avl = gpr_avl_add(avl, box(946), box(663), NULL);
-  avl = gpr_avl_add(avl, box(744), box(664), NULL);
-  avl = gpr_avl_add(avl, box(201), box(665), NULL);
-  avl = gpr_avl_add(avl, box(136), box(666), NULL);
-  avl = remove_int(avl, 357);
-  avl = gpr_avl_add(avl, box(974), box(668), NULL);
-  avl = remove_int(avl, 485);
-  avl = gpr_avl_add(avl, box(1009), box(670), NULL);
-  avl = gpr_avl_add(avl, box(517), box(671), NULL);
-  avl = remove_int(avl, 491);
-  avl = gpr_avl_add(avl, box(336), box(673), NULL);
-  avl = gpr_avl_add(avl, box(589), box(674), NULL);
-  avl = remove_int(avl, 546);
-  avl = remove_int(avl, 840);
-  avl = remove_int(avl, 104);
-  avl = remove_int(avl, 347);
-  avl = gpr_avl_add(avl, box(801), box(679), NULL);
-  avl = remove_int(avl, 799);
-  avl = remove_int(avl, 702);
-  avl = remove_int(avl, 996);
-  avl = remove_int(avl, 93);
-  avl = gpr_avl_add(avl, box(561), box(684), NULL);
-  avl = gpr_avl_add(avl, box(25), box(685), NULL);
-  avl = remove_int(avl, 278);
-  avl = gpr_avl_add(avl, box(191), box(687), NULL);
-  avl = remove_int(avl, 243);
-  avl = remove_int(avl, 918);
-  avl = remove_int(avl, 449);
-  avl = gpr_avl_add(avl, box(19), box(691), NULL);
-  avl = gpr_avl_add(avl, box(762), box(692), NULL);
-  avl = gpr_avl_add(avl, box(13), box(693), NULL);
-  avl = gpr_avl_add(avl, box(151), box(694), NULL);
-  avl = gpr_avl_add(avl, box(152), box(695), NULL);
-  avl = gpr_avl_add(avl, box(793), box(696), NULL);
-  avl = remove_int(avl, 862);
-  avl = remove_int(avl, 890);
-  avl = gpr_avl_add(avl, box(687), box(699), NULL);
-  avl = gpr_avl_add(avl, box(509), box(700), NULL);
-  avl = gpr_avl_add(avl, box(973), box(701), NULL);
-  avl = remove_int(avl, 230);
-  avl = gpr_avl_add(avl, box(532), box(703), NULL);
-  avl = remove_int(avl, 668);
-  avl = gpr_avl_add(avl, box(281), box(705), NULL);
-  avl = gpr_avl_add(avl, box(867), box(706), NULL);
-  avl = gpr_avl_add(avl, box(359), box(707), NULL);
-  avl = remove_int(avl, 425);
-  avl = gpr_avl_add(avl, box(691), box(709), NULL);
-  avl = gpr_avl_add(avl, box(163), box(710), NULL);
-  avl = gpr_avl_add(avl, box(502), box(711), NULL);
-  avl = remove_int(avl, 674);
-  avl = gpr_avl_add(avl, box(697), box(713), NULL);
-  avl = remove_int(avl, 271);
-  avl = gpr_avl_add(avl, box(968), box(715), NULL);
-  avl = gpr_avl_add(avl, box(48), box(716), NULL);
-  avl = remove_int(avl, 543);
-  avl = gpr_avl_add(avl, box(35), box(718), NULL);
-  avl = gpr_avl_add(avl, box(751), box(719), NULL);
-  avl = gpr_avl_add(avl, box(478), box(720), NULL);
-  avl = remove_int(avl, 797);
-  avl = remove_int(avl, 309);
-  avl = gpr_avl_add(avl, box(927), box(723), NULL);
-  avl = remove_int(avl, 504);
-  avl = gpr_avl_add(avl, box(286), box(725), NULL);
-  avl = gpr_avl_add(avl, box(413), box(726), NULL);
-  avl = gpr_avl_add(avl, box(599), box(727), NULL);
-  avl = remove_int(avl, 105);
-  avl = remove_int(avl, 605);
-  avl = gpr_avl_add(avl, box(632), box(730), NULL);
-  avl = gpr_avl_add(avl, box(133), box(731), NULL);
-  avl = remove_int(avl, 443);
-  avl = gpr_avl_add(avl, box(958), box(733), NULL);
-  avl = gpr_avl_add(avl, box(729), box(734), NULL);
-  avl = remove_int(avl, 158);
-  avl = gpr_avl_add(avl, box(694), box(736), NULL);
-  avl = gpr_avl_add(avl, box(505), box(737), NULL);
-  avl = remove_int(avl, 63);
-  avl = remove_int(avl, 714);
-  avl = gpr_avl_add(avl, box(1002), box(740), NULL);
-  avl = remove_int(avl, 211);
-  avl = gpr_avl_add(avl, box(765), box(742), NULL);
-  avl = gpr_avl_add(avl, box(455), box(743), NULL);
-  avl = remove_int(avl, 59);
-  avl = remove_int(avl, 224);
-  avl = gpr_avl_add(avl, box(586), box(746), NULL);
-  avl = gpr_avl_add(avl, box(348), box(747), NULL);
-  avl = remove_int(avl, 10);
-  avl = remove_int(avl, 484);
-  avl = gpr_avl_add(avl, box(968), box(750), NULL);
-  avl = gpr_avl_add(avl, box(923), box(751), NULL);
-  avl = remove_int(avl, 573);
-  avl = remove_int(avl, 617);
-  avl = gpr_avl_add(avl, box(812), box(754), NULL);
-  avl = gpr_avl_add(avl, box(179), box(755), NULL);
-  avl = remove_int(avl, 284);
-  avl = remove_int(avl, 157);
-  avl = remove_int(avl, 177);
-  avl = remove_int(avl, 896);
-  avl = gpr_avl_add(avl, box(649), box(760), NULL);
-  avl = gpr_avl_add(avl, box(927), box(761), NULL);
-  avl = gpr_avl_add(avl, box(454), box(762), NULL);
-  avl = gpr_avl_add(avl, box(217), box(763), NULL);
-  avl = remove_int(avl, 534);
-  avl = gpr_avl_add(avl, box(180), box(765), NULL);
-  avl = gpr_avl_add(avl, box(319), box(766), NULL);
-  avl = remove_int(avl, 92);
-  avl = gpr_avl_add(avl, box(483), box(768), NULL);
-  avl = remove_int(avl, 504);
-  avl = remove_int(avl, 1017);
-  avl = remove_int(avl, 37);
-  avl = remove_int(avl, 50);
-  avl = gpr_avl_add(avl, box(302), box(773), NULL);
-  avl = remove_int(avl, 807);
-  avl = gpr_avl_add(avl, box(463), box(775), NULL);
-  avl = gpr_avl_add(avl, box(271), box(776), NULL);
-  avl = gpr_avl_add(avl, box(644), box(777), NULL);
-  avl = remove_int(avl, 618);
-  avl = gpr_avl_add(avl, box(166), box(779), NULL);
-  avl = gpr_avl_add(avl, box(538), box(780), NULL);
-  avl = remove_int(avl, 606);
-  avl = gpr_avl_add(avl, box(425), box(782), NULL);
-  avl = remove_int(avl, 725);
-  avl = remove_int(avl, 383);
-  avl = gpr_avl_add(avl, box(155), box(785), NULL);
-  avl = remove_int(avl, 889);
-  avl = gpr_avl_add(avl, box(653), box(787), NULL);
-  avl = remove_int(avl, 386);
-  avl = gpr_avl_add(avl, box(142), box(789), NULL);
-  avl = remove_int(avl, 107);
-  avl = remove_int(avl, 603);
-  avl = remove_int(avl, 971);
-  avl = gpr_avl_add(avl, box(80), box(793), NULL);
-  avl = gpr_avl_add(avl, box(61), box(794), NULL);
-  avl = gpr_avl_add(avl, box(693), box(795), NULL);
-  avl = gpr_avl_add(avl, box(592), box(796), NULL);
-  avl = gpr_avl_add(avl, box(433), box(797), NULL);
-  avl = gpr_avl_add(avl, box(973), box(798), NULL);
-  avl = remove_int(avl, 901);
-  avl = remove_int(avl, 340);
-  avl = remove_int(avl, 709);
-  avl = gpr_avl_add(avl, box(224), box(802), NULL);
-  avl = remove_int(avl, 120);
-  avl = remove_int(avl, 271);
-  avl = gpr_avl_add(avl, box(780), box(805), NULL);
-  avl = gpr_avl_add(avl, box(867), box(806), NULL);
-  avl = gpr_avl_add(avl, box(756), box(807), NULL);
-  avl = gpr_avl_add(avl, box(583), box(808), NULL);
-  avl = gpr_avl_add(avl, box(356), box(809), NULL);
-  avl = gpr_avl_add(avl, box(58), box(810), NULL);
-  avl = remove_int(avl, 219);
-  avl = gpr_avl_add(avl, box(301), box(812), NULL);
-  avl = remove_int(avl, 643);
-  avl = remove_int(avl, 787);
-  avl = remove_int(avl, 583);
-  avl = remove_int(avl, 552);
-  avl = remove_int(avl, 308);
-  avl = remove_int(avl, 608);
-  avl = remove_int(avl, 363);
-  avl = remove_int(avl, 690);
-  avl = gpr_avl_add(avl, box(233), box(821), NULL);
-  avl = gpr_avl_add(avl, box(479), box(822), NULL);
-  avl = gpr_avl_add(avl, box(323), box(823), NULL);
-  avl = gpr_avl_add(avl, box(802), box(824), NULL);
-  avl = remove_int(avl, 682);
-  avl = remove_int(avl, 705);
-  avl = remove_int(avl, 487);
-  avl = gpr_avl_add(avl, box(530), box(828), NULL);
-  avl = gpr_avl_add(avl, box(232), box(829), NULL);
-  avl = remove_int(avl, 627);
-  avl = gpr_avl_add(avl, box(396), box(831), NULL);
-  avl = gpr_avl_add(avl, box(61), box(832), NULL);
-  avl = gpr_avl_add(avl, box(932), box(833), NULL);
-  avl = gpr_avl_add(avl, box(108), box(834), NULL);
-  avl = gpr_avl_add(avl, box(524), box(835), NULL);
-  avl = remove_int(avl, 390);
-  avl = remove_int(avl, 307);
-  avl = gpr_avl_add(avl, box(722), box(838), NULL);
-  avl = gpr_avl_add(avl, box(907), box(839), NULL);
-  avl = remove_int(avl, 286);
-  avl = remove_int(avl, 337);
-  avl = remove_int(avl, 443);
-  avl = gpr_avl_add(avl, box(973), box(843), NULL);
-  avl = remove_int(avl, 930);
-  avl = remove_int(avl, 242);
-  avl = gpr_avl_add(avl, box(997), box(846), NULL);
-  avl = gpr_avl_add(avl, box(689), box(847), NULL);
-  avl = remove_int(avl, 318);
-  avl = gpr_avl_add(avl, box(703), box(849), NULL);
-  avl = gpr_avl_add(avl, box(868), box(850), NULL);
-  avl = gpr_avl_add(avl, box(200), box(851), NULL);
-  avl = gpr_avl_add(avl, box(960), box(852), NULL);
-  avl = gpr_avl_add(avl, box(80), box(853), NULL);
-  avl = remove_int(avl, 113);
-  avl = gpr_avl_add(avl, box(135), box(855), NULL);
-  avl = remove_int(avl, 529);
-  avl = gpr_avl_add(avl, box(366), box(857), NULL);
-  avl = remove_int(avl, 272);
-  avl = gpr_avl_add(avl, box(921), box(859), NULL);
-  avl = remove_int(avl, 497);
-  avl = gpr_avl_add(avl, box(712), box(861), NULL);
-  avl = remove_int(avl, 777);
-  avl = remove_int(avl, 505);
-  avl = remove_int(avl, 974);
-  avl = remove_int(avl, 497);
-  avl = gpr_avl_add(avl, box(388), box(866), NULL);
-  avl = gpr_avl_add(avl, box(29), box(867), NULL);
-  avl = gpr_avl_add(avl, box(180), box(868), NULL);
-  avl = gpr_avl_add(avl, box(983), box(869), NULL);
-  avl = gpr_avl_add(avl, box(72), box(870), NULL);
-  avl = gpr_avl_add(avl, box(693), box(871), NULL);
-  avl = gpr_avl_add(avl, box(567), box(872), NULL);
-  avl = remove_int(avl, 549);
-  avl = remove_int(avl, 351);
-  avl = gpr_avl_add(avl, box(1019), box(875), NULL);
-  avl = remove_int(avl, 585);
-  avl = remove_int(avl, 294);
-  avl = remove_int(avl, 61);
-  avl = gpr_avl_add(avl, box(409), box(879), NULL);
-  avl = gpr_avl_add(avl, box(984), box(880), NULL);
-  avl = gpr_avl_add(avl, box(830), box(881), NULL);
-  avl = remove_int(avl, 579);
-  avl = gpr_avl_add(avl, box(672), box(883), NULL);
-  avl = remove_int(avl, 968);
-
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_badcase3(void) {
-  gpr_avl avl;
-
-  gpr_log(GPR_DEBUG, "test_badcase3");
-
-  avl = gpr_avl_create(&int_int_vtable);
-  avl = remove_int(avl, 624);
-  avl = gpr_avl_add(avl, box(59), box(2), NULL);
-  avl = gpr_avl_add(avl, box(494), box(3), NULL);
-  avl = gpr_avl_add(avl, box(226), box(4), NULL);
-  avl = remove_int(avl, 524);
-  avl = gpr_avl_add(avl, box(540), box(6), NULL);
-  avl = remove_int(avl, 1008);
-  avl = gpr_avl_add(avl, box(502), box(8), NULL);
-  avl = remove_int(avl, 267);
-  avl = remove_int(avl, 764);
-  avl = remove_int(avl, 443);
-  avl = gpr_avl_add(avl, box(8), box(12), NULL);
-  avl = remove_int(avl, 291);
-  avl = remove_int(avl, 796);
-  avl = remove_int(avl, 1002);
-  avl = gpr_avl_add(avl, box(778), box(16), NULL);
-  avl = remove_int(avl, 621);
-  avl = remove_int(avl, 891);
-  avl = remove_int(avl, 880);
-  avl = gpr_avl_add(avl, box(197), box(20), NULL);
-  avl = gpr_avl_add(avl, box(441), box(21), NULL);
-  avl = gpr_avl_add(avl, box(719), box(22), NULL);
-  avl = remove_int(avl, 109);
-  avl = gpr_avl_add(avl, box(458), box(24), NULL);
-  avl = remove_int(avl, 86);
-  avl = gpr_avl_add(avl, box(897), box(26), NULL);
-  avl = gpr_avl_add(avl, box(997), box(27), NULL);
-  avl = remove_int(avl, 235);
-  avl = remove_int(avl, 425);
-  avl = remove_int(avl, 186);
-  avl = gpr_avl_add(avl, box(887), box(31), NULL);
-  avl = gpr_avl_add(avl, box(1005), box(32), NULL);
-  avl = gpr_avl_add(avl, box(778), box(33), NULL);
-  avl = gpr_avl_add(avl, box(575), box(34), NULL);
-  avl = remove_int(avl, 966);
-  avl = remove_int(avl, 1015);
-  avl = gpr_avl_add(avl, box(486), box(37), NULL);
-  avl = gpr_avl_add(avl, box(809), box(38), NULL);
-  avl = gpr_avl_add(avl, box(907), box(39), NULL);
-  avl = gpr_avl_add(avl, box(971), box(40), NULL);
-  avl = remove_int(avl, 441);
-  avl = remove_int(avl, 498);
-  avl = gpr_avl_add(avl, box(727), box(43), NULL);
-  avl = remove_int(avl, 679);
-  avl = remove_int(avl, 740);
-  avl = remove_int(avl, 532);
-  avl = gpr_avl_add(avl, box(805), box(47), NULL);
-  avl = remove_int(avl, 64);
-  avl = gpr_avl_add(avl, box(362), box(49), NULL);
-  avl = gpr_avl_add(avl, box(170), box(50), NULL);
-  avl = gpr_avl_add(avl, box(389), box(51), NULL);
-  avl = gpr_avl_add(avl, box(689), box(52), NULL);
-  avl = remove_int(avl, 871);
-  avl = gpr_avl_add(avl, box(447), box(54), NULL);
-  avl = remove_int(avl, 718);
-  avl = gpr_avl_add(avl, box(724), box(56), NULL);
-  avl = remove_int(avl, 215);
-  avl = gpr_avl_add(avl, box(550), box(58), NULL);
-  avl = remove_int(avl, 932);
-  avl = gpr_avl_add(avl, box(47), box(60), NULL);
-  avl = remove_int(avl, 46);
-  avl = remove_int(avl, 229);
-  avl = gpr_avl_add(avl, box(68), box(63), NULL);
-  avl = gpr_avl_add(avl, box(387), box(64), NULL);
-  avl = remove_int(avl, 933);
-  avl = remove_int(avl, 736);
-  avl = remove_int(avl, 719);
-  avl = gpr_avl_add(avl, box(150), box(68), NULL);
-  avl = remove_int(avl, 875);
-  avl = remove_int(avl, 298);
-  avl = gpr_avl_add(avl, box(991), box(71), NULL);
-  avl = remove_int(avl, 705);
-  avl = gpr_avl_add(avl, box(197), box(73), NULL);
-  avl = gpr_avl_add(avl, box(101), box(74), NULL);
-  avl = remove_int(avl, 436);
-  avl = gpr_avl_add(avl, box(755), box(76), NULL);
-  avl = gpr_avl_add(avl, box(727), box(77), NULL);
-  avl = remove_int(avl, 309);
-  avl = remove_int(avl, 253);
-  avl = gpr_avl_add(avl, box(203), box(80), NULL);
-  avl = remove_int(avl, 231);
-  avl = gpr_avl_add(avl, box(461), box(82), NULL);
-  avl = remove_int(avl, 316);
-  avl = remove_int(avl, 493);
-  avl = gpr_avl_add(avl, box(184), box(85), NULL);
-  avl = remove_int(avl, 737);
-  avl = gpr_avl_add(avl, box(790), box(87), NULL);
-  avl = gpr_avl_add(avl, box(335), box(88), NULL);
-  avl = remove_int(avl, 649);
-  avl = gpr_avl_add(avl, box(69), box(90), NULL);
-  avl = remove_int(avl, 585);
-  avl = remove_int(avl, 543);
-  avl = gpr_avl_add(avl, box(784), box(93), NULL);
-  avl = gpr_avl_add(avl, box(60), box(94), NULL);
-  avl = gpr_avl_add(avl, box(525), box(95), NULL);
-  avl = gpr_avl_add(avl, box(177), box(96), NULL);
-  avl = gpr_avl_add(avl, box(178), box(97), NULL);
-  avl = gpr_avl_add(avl, box(683), box(98), NULL);
-  avl = gpr_avl_add(avl, box(226), box(99), NULL);
-  avl = gpr_avl_add(avl, box(662), box(100), NULL);
-  avl = remove_int(avl, 944);
-  avl = gpr_avl_add(avl, box(562), box(102), NULL);
-  avl = gpr_avl_add(avl, box(793), box(103), NULL);
-  avl = remove_int(avl, 673);
-  avl = gpr_avl_add(avl, box(310), box(105), NULL);
-  avl = remove_int(avl, 479);
-  avl = remove_int(avl, 543);
-  avl = remove_int(avl, 159);
-  avl = remove_int(avl, 850);
-  avl = gpr_avl_add(avl, box(318), box(110), NULL);
-  avl = gpr_avl_add(avl, box(483), box(111), NULL);
-  avl = gpr_avl_add(avl, box(84), box(112), NULL);
-  avl = remove_int(avl, 109);
-  avl = gpr_avl_add(avl, box(132), box(114), NULL);
-  avl = gpr_avl_add(avl, box(920), box(115), NULL);
-  avl = remove_int(avl, 746);
-  avl = gpr_avl_add(avl, box(145), box(117), NULL);
-  avl = gpr_avl_add(avl, box(526), box(118), NULL);
-  avl = remove_int(avl, 158);
-  avl = gpr_avl_add(avl, box(332), box(120), NULL);
-  avl = gpr_avl_add(avl, box(918), box(121), NULL);
-  avl = remove_int(avl, 339);
-  avl = gpr_avl_add(avl, box(809), box(123), NULL);
-  avl = gpr_avl_add(avl, box(742), box(124), NULL);
-  avl = gpr_avl_add(avl, box(718), box(125), NULL);
-  avl = remove_int(avl, 988);
-  avl = remove_int(avl, 531);
-  avl = remove_int(avl, 840);
-  avl = gpr_avl_add(avl, box(816), box(129), NULL);
-  avl = gpr_avl_add(avl, box(976), box(130), NULL);
-  avl = remove_int(avl, 743);
-  avl = remove_int(avl, 528);
-  avl = remove_int(avl, 982);
-  avl = gpr_avl_add(avl, box(803), box(134), NULL);
-  avl = gpr_avl_add(avl, box(205), box(135), NULL);
-  avl = gpr_avl_add(avl, box(584), box(136), NULL);
-  avl = remove_int(avl, 923);
-  avl = remove_int(avl, 538);
-  avl = remove_int(avl, 398);
-  avl = remove_int(avl, 320);
-  avl = remove_int(avl, 292);
-  avl = gpr_avl_add(avl, box(270), box(142), NULL);
-  avl = gpr_avl_add(avl, box(333), box(143), NULL);
-  avl = remove_int(avl, 439);
-  avl = gpr_avl_add(avl, box(35), box(145), NULL);
-  avl = gpr_avl_add(avl, box(837), box(146), NULL);
-  avl = remove_int(avl, 65);
-  avl = remove_int(avl, 642);
-  avl = remove_int(avl, 371);
-  avl = remove_int(avl, 140);
-  avl = remove_int(avl, 533);
-  avl = remove_int(avl, 676);
-  avl = gpr_avl_add(avl, box(624), box(153), NULL);
-  avl = gpr_avl_add(avl, box(116), box(154), NULL);
-  avl = gpr_avl_add(avl, box(446), box(155), NULL);
-  avl = remove_int(avl, 91);
-  avl = remove_int(avl, 721);
-  avl = remove_int(avl, 537);
-  avl = gpr_avl_add(avl, box(448), box(159), NULL);
-  avl = remove_int(avl, 155);
-  avl = remove_int(avl, 344);
-  avl = remove_int(avl, 237);
-  avl = gpr_avl_add(avl, box(309), box(163), NULL);
-  avl = gpr_avl_add(avl, box(434), box(164), NULL);
-  avl = gpr_avl_add(avl, box(277), box(165), NULL);
-  avl = remove_int(avl, 233);
-  avl = gpr_avl_add(avl, box(275), box(167), NULL);
-  avl = gpr_avl_add(avl, box(218), box(168), NULL);
-  avl = gpr_avl_add(avl, box(76), box(169), NULL);
-  avl = gpr_avl_add(avl, box(898), box(170), NULL);
-  avl = remove_int(avl, 771);
-  avl = gpr_avl_add(avl, box(237), box(172), NULL);
-  avl = remove_int(avl, 327);
-  avl = gpr_avl_add(avl, box(499), box(174), NULL);
-  avl = remove_int(avl, 727);
-  avl = remove_int(avl, 234);
-  avl = remove_int(avl, 623);
-  avl = remove_int(avl, 458);
-  avl = remove_int(avl, 326);
-  avl = remove_int(avl, 589);
-  avl = gpr_avl_add(avl, box(442), box(181), NULL);
-  avl = remove_int(avl, 389);
-  avl = gpr_avl_add(avl, box(708), box(183), NULL);
-  avl = gpr_avl_add(avl, box(594), box(184), NULL);
-  avl = gpr_avl_add(avl, box(942), box(185), NULL);
-  avl = gpr_avl_add(avl, box(282), box(186), NULL);
-  avl = remove_int(avl, 434);
-  avl = remove_int(avl, 134);
-  avl = remove_int(avl, 270);
-  avl = remove_int(avl, 512);
-  avl = remove_int(avl, 265);
-  avl = remove_int(avl, 21);
-  avl = remove_int(avl, 193);
-  avl = remove_int(avl, 797);
-  avl = remove_int(avl, 347);
-  avl = gpr_avl_add(avl, box(99), box(196), NULL);
-  avl = gpr_avl_add(avl, box(161), box(197), NULL);
-  avl = remove_int(avl, 484);
-  avl = gpr_avl_add(avl, box(72), box(199), NULL);
-  avl = remove_int(avl, 629);
-  avl = gpr_avl_add(avl, box(522), box(201), NULL);
-  avl = remove_int(avl, 679);
-  avl = gpr_avl_add(avl, box(407), box(203), NULL);
-  avl = remove_int(avl, 693);
-  avl = gpr_avl_add(avl, box(424), box(205), NULL);
-  avl = gpr_avl_add(avl, box(651), box(206), NULL);
-  avl = gpr_avl_add(avl, box(927), box(207), NULL);
-  avl = remove_int(avl, 553);
-  avl = gpr_avl_add(avl, box(128), box(209), NULL);
-  avl = gpr_avl_add(avl, box(616), box(210), NULL);
-  avl = gpr_avl_add(avl, box(690), box(211), NULL);
-  avl = remove_int(avl, 241);
-  avl = remove_int(avl, 179);
-  avl = gpr_avl_add(avl, box(697), box(214), NULL);
-  avl = remove_int(avl, 779);
-  avl = gpr_avl_add(avl, box(241), box(216), NULL);
-  avl = remove_int(avl, 190);
-  avl = remove_int(avl, 210);
-  avl = gpr_avl_add(avl, box(711), box(219), NULL);
-  avl = remove_int(avl, 251);
-  avl = remove_int(avl, 61);
-  avl = gpr_avl_add(avl, box(800), box(222), NULL);
-  avl = remove_int(avl, 551);
-  avl = gpr_avl_add(avl, box(61), box(224), NULL);
-  avl = gpr_avl_add(avl, box(656), box(225), NULL);
-  avl = remove_int(avl, 130);
-  avl = remove_int(avl, 368);
-  avl = remove_int(avl, 150);
-  avl = remove_int(avl, 73);
-  avl = gpr_avl_add(avl, box(799), box(230), NULL);
-  avl = gpr_avl_add(avl, box(125), box(231), NULL);
-  avl = remove_int(avl, 107);
-  avl = gpr_avl_add(avl, box(938), box(233), NULL);
-  avl = gpr_avl_add(avl, box(914), box(234), NULL);
-  avl = gpr_avl_add(avl, box(197), box(235), NULL);
-  avl = remove_int(avl, 736);
-  avl = gpr_avl_add(avl, box(20), box(237), NULL);
-  avl = remove_int(avl, 224);
-  avl = remove_int(avl, 841);
-  avl = gpr_avl_add(avl, box(226), box(240), NULL);
-  avl = remove_int(avl, 963);
-  avl = remove_int(avl, 796);
-  avl = remove_int(avl, 728);
-  avl = gpr_avl_add(avl, box(855), box(244), NULL);
-  avl = gpr_avl_add(avl, box(769), box(245), NULL);
-  avl = gpr_avl_add(avl, box(631), box(246), NULL);
-  avl = remove_int(avl, 648);
-  avl = gpr_avl_add(avl, box(187), box(248), NULL);
-  avl = gpr_avl_add(avl, box(31), box(249), NULL);
-  avl = remove_int(avl, 163);
-  avl = gpr_avl_add(avl, box(218), box(251), NULL);
-  avl = gpr_avl_add(avl, box(488), box(252), NULL);
-  avl = gpr_avl_add(avl, box(387), box(253), NULL);
-  avl = gpr_avl_add(avl, box(809), box(254), NULL);
-  avl = gpr_avl_add(avl, box(997), box(255), NULL);
-  avl = remove_int(avl, 678);
-  avl = gpr_avl_add(avl, box(368), box(257), NULL);
-  avl = gpr_avl_add(avl, box(220), box(258), NULL);
-  avl = gpr_avl_add(avl, box(373), box(259), NULL);
-  avl = remove_int(avl, 874);
-  avl = remove_int(avl, 682);
-  avl = remove_int(avl, 1014);
-  avl = remove_int(avl, 195);
-  avl = gpr_avl_add(avl, box(868), box(264), NULL);
-  avl = remove_int(avl, 254);
-  avl = remove_int(avl, 456);
-  avl = gpr_avl_add(avl, box(906), box(267), NULL);
-  avl = remove_int(avl, 711);
-  avl = gpr_avl_add(avl, box(632), box(269), NULL);
-  avl = remove_int(avl, 474);
-  avl = gpr_avl_add(avl, box(508), box(271), NULL);
-  avl = gpr_avl_add(avl, box(518), box(272), NULL);
-  avl = remove_int(avl, 579);
-  avl = remove_int(avl, 948);
-  avl = gpr_avl_add(avl, box(789), box(275), NULL);
-  avl = gpr_avl_add(avl, box(48), box(276), NULL);
-  avl = gpr_avl_add(avl, box(256), box(277), NULL);
-  avl = gpr_avl_add(avl, box(754), box(278), NULL);
-  avl = remove_int(avl, 215);
-  avl = gpr_avl_add(avl, box(679), box(280), NULL);
-  avl = gpr_avl_add(avl, box(606), box(281), NULL);
-  avl = remove_int(avl, 941);
-  avl = remove_int(avl, 31);
-  avl = gpr_avl_add(avl, box(758), box(284), NULL);
-  avl = remove_int(avl, 101);
-  avl = gpr_avl_add(avl, box(244), box(286), NULL);
-  avl = gpr_avl_add(avl, box(337), box(287), NULL);
-  avl = gpr_avl_add(avl, box(461), box(288), NULL);
-  avl = remove_int(avl, 476);
-  avl = gpr_avl_add(avl, box(845), box(290), NULL);
-  avl = remove_int(avl, 160);
-  avl = gpr_avl_add(avl, box(690), box(292), NULL);
-  avl = remove_int(avl, 931);
-  avl = gpr_avl_add(avl, box(869), box(294), NULL);
-  avl = gpr_avl_add(avl, box(1019), box(295), NULL);
-  avl = remove_int(avl, 591);
-  avl = remove_int(avl, 635);
-  avl = remove_int(avl, 67);
-  avl = gpr_avl_add(avl, box(113), box(299), NULL);
-  avl = remove_int(avl, 305);
-  avl = gpr_avl_add(avl, box(10), box(301), NULL);
-  avl = remove_int(avl, 823);
-  avl = remove_int(avl, 288);
-  avl = remove_int(avl, 239);
-  avl = gpr_avl_add(avl, box(646), box(305), NULL);
-  avl = gpr_avl_add(avl, box(1006), box(306), NULL);
-  avl = gpr_avl_add(avl, box(954), box(307), NULL);
-  avl = gpr_avl_add(avl, box(199), box(308), NULL);
-  avl = gpr_avl_add(avl, box(69), box(309), NULL);
-  avl = gpr_avl_add(avl, box(984), box(310), NULL);
-  avl = remove_int(avl, 568);
-  avl = remove_int(avl, 666);
-  avl = remove_int(avl, 37);
-  avl = gpr_avl_add(avl, box(845), box(314), NULL);
-  avl = remove_int(avl, 535);
-  avl = remove_int(avl, 365);
-  avl = remove_int(avl, 676);
-  avl = remove_int(avl, 892);
-  avl = remove_int(avl, 425);
-  avl = remove_int(avl, 704);
-  avl = remove_int(avl, 168);
-  avl = gpr_avl_add(avl, box(853), box(322), NULL);
-  avl = gpr_avl_add(avl, box(335), box(323), NULL);
-  avl = gpr_avl_add(avl, box(961), box(324), NULL);
-  avl = gpr_avl_add(avl, box(73), box(325), NULL);
-  avl = remove_int(avl, 469);
-  avl = gpr_avl_add(avl, box(449), box(327), NULL);
-  avl = remove_int(avl, 821);
-  avl = gpr_avl_add(avl, box(845), box(329), NULL);
-  avl = remove_int(avl, 637);
-  avl = gpr_avl_add(avl, box(769), box(331), NULL);
-  avl = gpr_avl_add(avl, box(901), box(332), NULL);
-  avl = remove_int(avl, 142);
-  avl = remove_int(avl, 361);
-  avl = remove_int(avl, 876);
-  avl = gpr_avl_add(avl, box(614), box(336), NULL);
-  avl = gpr_avl_add(avl, box(729), box(337), NULL);
-  avl = remove_int(avl, 120);
-  avl = remove_int(avl, 473);
-  avl = remove_int(avl, 445);
-  avl = gpr_avl_add(avl, box(978), box(341), NULL);
-  avl = gpr_avl_add(avl, box(164), box(342), NULL);
-  avl = gpr_avl_add(avl, box(1), box(343), NULL);
-  avl = remove_int(avl, 890);
-  avl = gpr_avl_add(avl, box(605), box(345), NULL);
-  avl = gpr_avl_add(avl, box(178), box(346), NULL);
-  avl = gpr_avl_add(avl, box(481), box(347), NULL);
-  avl = gpr_avl_add(avl, box(772), box(348), NULL);
-  avl = remove_int(avl, 824);
-  avl = remove_int(avl, 167);
-  avl = remove_int(avl, 151);
-  avl = gpr_avl_add(avl, box(698), box(352), NULL);
-  avl = gpr_avl_add(avl, box(202), box(353), NULL);
-  avl = gpr_avl_add(avl, box(921), box(354), NULL);
-  avl = gpr_avl_add(avl, box(875), box(355), NULL);
-  avl = remove_int(avl, 197);
-  avl = remove_int(avl, 232);
-  avl = gpr_avl_add(avl, box(209), box(358), NULL);
-  avl = remove_int(avl, 324);
-  avl = remove_int(avl, 56);
-  avl = remove_int(avl, 579);
-  avl = remove_int(avl, 255);
-  avl = remove_int(avl, 290);
-  avl = gpr_avl_add(avl, box(661), box(364), NULL);
-  avl = gpr_avl_add(avl, box(113), box(365), NULL);
-  avl = remove_int(avl, 767);
-  avl = gpr_avl_add(avl, box(586), box(367), NULL);
-  avl = gpr_avl_add(avl, box(121), box(368), NULL);
-  avl = remove_int(avl, 235);
-  avl = remove_int(avl, 439);
-  avl = remove_int(avl, 360);
-  avl = gpr_avl_add(avl, box(916), box(372), NULL);
-  avl = remove_int(avl, 999);
-  avl = gpr_avl_add(avl, box(825), box(374), NULL);
-  avl = gpr_avl_add(avl, box(177), box(375), NULL);
-  avl = remove_int(avl, 204);
-  avl = remove_int(avl, 92);
-  avl = gpr_avl_add(avl, box(794), box(378), NULL);
-  avl = gpr_avl_add(avl, box(463), box(379), NULL);
-  avl = gpr_avl_add(avl, box(472), box(380), NULL);
-  avl = remove_int(avl, 235);
-  avl = gpr_avl_add(avl, box(840), box(382), NULL);
-  avl = remove_int(avl, 657);
-  avl = gpr_avl_add(avl, box(586), box(384), NULL);
-  avl = gpr_avl_add(avl, box(979), box(385), NULL);
-  avl = remove_int(avl, 979);
-  avl = gpr_avl_add(avl, box(639), box(387), NULL);
-  avl = remove_int(avl, 907);
-  avl = remove_int(avl, 973);
-  avl = gpr_avl_add(avl, box(913), box(390), NULL);
-  avl = gpr_avl_add(avl, box(566), box(391), NULL);
-  avl = gpr_avl_add(avl, box(883), box(392), NULL);
-  avl = gpr_avl_add(avl, box(552), box(393), NULL);
-  avl = gpr_avl_add(avl, box(16), box(394), NULL);
-  avl = remove_int(avl, 60);
-  avl = gpr_avl_add(avl, box(567), box(396), NULL);
-  avl = gpr_avl_add(avl, box(705), box(397), NULL);
-  avl = gpr_avl_add(avl, box(94), box(398), NULL);
-  avl = remove_int(avl, 321);
-  avl = gpr_avl_add(avl, box(207), box(400), NULL);
-  avl = gpr_avl_add(avl, box(682), box(401), NULL);
-  avl = gpr_avl_add(avl, box(592), box(402), NULL);
-  avl = gpr_avl_add(avl, box(10), box(403), NULL);
-  avl = remove_int(avl, 911);
-  avl = remove_int(avl, 161);
-  avl = gpr_avl_add(avl, box(86), box(406), NULL);
-  avl = remove_int(avl, 893);
-  avl = remove_int(avl, 362);
-  avl = gpr_avl_add(avl, box(599), box(409), NULL);
-  avl = remove_int(avl, 413);
-  avl = gpr_avl_add(avl, box(867), box(411), NULL);
-  avl = remove_int(avl, 955);
-  avl = gpr_avl_add(avl, box(341), box(413), NULL);
-  avl = gpr_avl_add(avl, box(887), box(414), NULL);
-  avl = remove_int(avl, 706);
-  avl = gpr_avl_add(avl, box(939), box(416), NULL);
-  avl = remove_int(avl, 233);
-  avl = remove_int(avl, 662);
-  avl = remove_int(avl, 984);
-  avl = remove_int(avl, 203);
-  avl = gpr_avl_add(avl, box(326), box(421), NULL);
-  avl = remove_int(avl, 848);
-  avl = gpr_avl_add(avl, box(235), box(423), NULL);
-  avl = remove_int(avl, 617);
-  avl = gpr_avl_add(avl, box(565), box(425), NULL);
-  avl = remove_int(avl, 469);
-  avl = gpr_avl_add(avl, box(988), box(427), NULL);
-  avl = remove_int(avl, 957);
-  avl = gpr_avl_add(avl, box(426), box(429), NULL);
-  avl = remove_int(avl, 967);
-  avl = gpr_avl_add(avl, box(890), box(431), NULL);
-  avl = gpr_avl_add(avl, box(473), box(432), NULL);
-  avl = remove_int(avl, 367);
-  avl = remove_int(avl, 344);
-  avl = remove_int(avl, 660);
-  avl = remove_int(avl, 448);
-  avl = remove_int(avl, 837);
-  avl = remove_int(avl, 158);
-  avl = gpr_avl_add(avl, box(459), box(439), NULL);
-  avl = remove_int(avl, 882);
-  avl = remove_int(avl, 782);
-  avl = gpr_avl_add(avl, box(408), box(442), NULL);
-  avl = gpr_avl_add(avl, box(728), box(443), NULL);
-  avl = remove_int(avl, 27);
-  avl = gpr_avl_add(avl, box(137), box(445), NULL);
-  avl = gpr_avl_add(avl, box(239), box(446), NULL);
-  avl = remove_int(avl, 854);
-  avl = gpr_avl_add(avl, box(104), box(448), NULL);
-  avl = gpr_avl_add(avl, box(823), box(449), NULL);
-  avl = gpr_avl_add(avl, box(524), box(450), NULL);
-  avl = gpr_avl_add(avl, box(995), box(451), NULL);
-  avl = remove_int(avl, 422);
-  avl = remove_int(avl, 220);
-  avl = gpr_avl_add(avl, box(856), box(454), NULL);
-  avl = remove_int(avl, 332);
-  avl = gpr_avl_add(avl, box(679), box(456), NULL);
-  avl = remove_int(avl, 18);
-  avl = gpr_avl_add(avl, box(837), box(458), NULL);
-  avl = remove_int(avl, 405);
-  avl = remove_int(avl, 877);
-  avl = remove_int(avl, 835);
-  avl = gpr_avl_add(avl, box(547), box(462), NULL);
-  avl = remove_int(avl, 805);
-  avl = remove_int(avl, 862);
-  avl = gpr_avl_add(avl, box(75), box(465), NULL);
-  avl = remove_int(avl, 41);
-  avl = gpr_avl_add(avl, box(310), box(467), NULL);
-  avl = remove_int(avl, 855);
-  avl = gpr_avl_add(avl, box(20), box(469), NULL);
-  avl = remove_int(avl, 186);
-  avl = remove_int(avl, 378);
-  avl = remove_int(avl, 442);
-  avl = remove_int(avl, 930);
-  avl = gpr_avl_add(avl, box(118), box(474), NULL);
-  avl = gpr_avl_add(avl, box(96), box(475), NULL);
-  avl = remove_int(avl, 854);
-  avl = gpr_avl_add(avl, box(65), box(477), NULL);
-  avl = gpr_avl_add(avl, box(573), box(478), NULL);
-  avl = gpr_avl_add(avl, box(4), box(479), NULL);
-  avl = gpr_avl_add(avl, box(451), box(480), NULL);
-  avl = gpr_avl_add(avl, box(774), box(481), NULL);
-  avl = gpr_avl_add(avl, box(126), box(482), NULL);
-  avl = remove_int(avl, 956);
-  avl = remove_int(avl, 591);
-  avl = remove_int(avl, 644);
-  avl = gpr_avl_add(avl, box(304), box(486), NULL);
-  avl = remove_int(avl, 620);
-  avl = remove_int(avl, 394);
-  avl = gpr_avl_add(avl, box(1002), box(489), NULL);
-  avl = gpr_avl_add(avl, box(837), box(490), NULL);
-  avl = remove_int(avl, 485);
-  avl = gpr_avl_add(avl, box(1005), box(492), NULL);
-  avl = remove_int(avl, 21);
-  avl = gpr_avl_add(avl, box(396), box(494), NULL);
-  avl = remove_int(avl, 966);
-  avl = gpr_avl_add(avl, box(105), box(496), NULL);
-  avl = gpr_avl_add(avl, box(316), box(497), NULL);
-  avl = remove_int(avl, 776);
-  avl = gpr_avl_add(avl, box(188), box(499), NULL);
-  avl = remove_int(avl, 200);
-  avl = gpr_avl_add(avl, box(98), box(501), NULL);
-  avl = gpr_avl_add(avl, box(831), box(502), NULL);
-  avl = gpr_avl_add(avl, box(227), box(503), NULL);
-  avl = gpr_avl_add(avl, box(220), box(504), NULL);
-  avl = remove_int(avl, 715);
-  avl = remove_int(avl, 279);
-  avl = gpr_avl_add(avl, box(701), box(507), NULL);
-  avl = gpr_avl_add(avl, box(726), box(508), NULL);
-  avl = gpr_avl_add(avl, box(815), box(509), NULL);
-  avl = gpr_avl_add(avl, box(749), box(510), NULL);
-  avl = remove_int(avl, 946);
-  avl = remove_int(avl, 449);
-  avl = remove_int(avl, 62);
-  avl = remove_int(avl, 487);
-  avl = gpr_avl_add(avl, box(545), box(515), NULL);
-  avl = remove_int(avl, 59);
-  avl = gpr_avl_add(avl, box(168), box(517), NULL);
-  avl = remove_int(avl, 337);
-  avl = gpr_avl_add(avl, box(69), box(519), NULL);
-  avl = remove_int(avl, 600);
-  avl = gpr_avl_add(avl, box(591), box(521), NULL);
-  avl = gpr_avl_add(avl, box(960), box(522), NULL);
-  avl = gpr_avl_add(avl, box(116), box(523), NULL);
-  avl = remove_int(avl, 991);
-  avl = gpr_avl_add(avl, box(760), box(525), NULL);
-  avl = gpr_avl_add(avl, box(664), box(526), NULL);
-  avl = gpr_avl_add(avl, box(547), box(527), NULL);
-  avl = remove_int(avl, 922);
-  avl = gpr_avl_add(avl, box(290), box(529), NULL);
-  avl = gpr_avl_add(avl, box(859), box(530), NULL);
-  avl = gpr_avl_add(avl, box(49), box(531), NULL);
-  avl = remove_int(avl, 455);
-  avl = remove_int(avl, 786);
-  avl = gpr_avl_add(avl, box(613), box(534), NULL);
-  avl = gpr_avl_add(avl, box(326), box(535), NULL);
-  avl = remove_int(avl, 615);
-  avl = gpr_avl_add(avl, box(45), box(537), NULL);
-  avl = gpr_avl_add(avl, box(162), box(538), NULL);
-  avl = gpr_avl_add(avl, box(189), box(539), NULL);
-  avl = remove_int(avl, 68);
-  avl = remove_int(avl, 846);
-  avl = gpr_avl_add(avl, box(608), box(542), NULL);
-  avl = remove_int(avl, 821);
-  avl = gpr_avl_add(avl, box(978), box(544), NULL);
-  avl = gpr_avl_add(avl, box(892), box(545), NULL);
-  avl = remove_int(avl, 924);
-  avl = gpr_avl_add(avl, box(708), box(547), NULL);
-  avl = remove_int(avl, 135);
-  avl = remove_int(avl, 124);
-  avl = gpr_avl_add(avl, box(301), box(550), NULL);
-  avl = gpr_avl_add(avl, box(939), box(551), NULL);
-  avl = gpr_avl_add(avl, box(344), box(552), NULL);
-  avl = remove_int(avl, 443);
-  avl = remove_int(avl, 122);
-  avl = gpr_avl_add(avl, box(636), box(555), NULL);
-  avl = remove_int(avl, 558);
-  avl = gpr_avl_add(avl, box(923), box(557), NULL);
-  avl = remove_int(avl, 827);
-  avl = gpr_avl_add(avl, box(649), box(559), NULL);
-  avl = gpr_avl_add(avl, box(808), box(560), NULL);
-  avl = remove_int(avl, 570);
-  avl = remove_int(avl, 434);
-  avl = gpr_avl_add(avl, box(40), box(563), NULL);
-  avl = gpr_avl_add(avl, box(725), box(564), NULL);
-  avl = remove_int(avl, 295);
-  avl = remove_int(avl, 615);
-  avl = remove_int(avl, 919);
-  avl = remove_int(avl, 170);
-  avl = remove_int(avl, 442);
-  avl = remove_int(avl, 971);
-  avl = gpr_avl_add(avl, box(483), box(571), NULL);
-  avl = gpr_avl_add(avl, box(512), box(572), NULL);
-  avl = remove_int(avl, 648);
-  avl = remove_int(avl, 78);
-  avl = remove_int(avl, 72);
-  avl = remove_int(avl, 790);
-  avl = remove_int(avl, 571);
-  avl = gpr_avl_add(avl, box(898), box(578), NULL);
-  avl = remove_int(avl, 770);
-  avl = remove_int(avl, 776);
-  avl = gpr_avl_add(avl, box(602), box(581), NULL);
-  avl = remove_int(avl, 251);
-  avl = gpr_avl_add(avl, box(303), box(583), NULL);
-  avl = remove_int(avl, 837);
-  avl = gpr_avl_add(avl, box(714), box(585), NULL);
-  avl = remove_int(avl, 800);
-  avl = gpr_avl_add(avl, box(266), box(587), NULL);
-  avl = gpr_avl_add(avl, box(555), box(588), NULL);
-  avl = remove_int(avl, 604);
-  avl = remove_int(avl, 163);
-  avl = remove_int(avl, 497);
-  avl = gpr_avl_add(avl, box(296), box(592), NULL);
-  avl = remove_int(avl, 129);
-  avl = gpr_avl_add(avl, box(656), box(594), NULL);
-  avl = remove_int(avl, 769);
-  avl = remove_int(avl, 941);
-  avl = gpr_avl_add(avl, box(775), box(597), NULL);
-  avl = gpr_avl_add(avl, box(846), box(598), NULL);
-  avl = remove_int(avl, 591);
-  avl = remove_int(avl, 801);
-  avl = remove_int(avl, 419);
-  avl = remove_int(avl, 455);
-  avl = gpr_avl_add(avl, box(866), box(603), NULL);
-  avl = gpr_avl_add(avl, box(575), box(604), NULL);
-  avl = gpr_avl_add(avl, box(620), box(605), NULL);
-  avl = remove_int(avl, 100);
-  avl = remove_int(avl, 667);
-  avl = gpr_avl_add(avl, box(138), box(608), NULL);
-  avl = gpr_avl_add(avl, box(566), box(609), NULL);
-  avl = gpr_avl_add(avl, box(673), box(610), NULL);
-  avl = gpr_avl_add(avl, box(178), box(611), NULL);
-  avl = remove_int(avl, 659);
-  avl = gpr_avl_add(avl, box(759), box(613), NULL);
-  avl = gpr_avl_add(avl, box(1008), box(614), NULL);
-  avl = remove_int(avl, 116);
-  avl = gpr_avl_add(avl, box(608), box(616), NULL);
-  avl = gpr_avl_add(avl, box(339), box(617), NULL);
-  avl = gpr_avl_add(avl, box(197), box(618), NULL);
-  avl = remove_int(avl, 25);
-  avl = remove_int(avl, 628);
-  avl = gpr_avl_add(avl, box(487), box(621), NULL);
-  avl = remove_int(avl, 739);
-  avl = remove_int(avl, 100);
-  avl = remove_int(avl, 928);
-  avl = gpr_avl_add(avl, box(647), box(625), NULL);
-  avl = remove_int(avl, 978);
-  avl = remove_int(avl, 143);
-  avl = remove_int(avl, 755);
-  avl = gpr_avl_add(avl, box(71), box(629), NULL);
-  avl = remove_int(avl, 205);
-  avl = gpr_avl_add(avl, box(501), box(631), NULL);
-  avl = remove_int(avl, 723);
-  avl = remove_int(avl, 852);
-  avl = remove_int(avl, 1021);
-  avl = remove_int(avl, 670);
-  avl = remove_int(avl, 500);
-  avl = gpr_avl_add(avl, box(330), box(637), NULL);
-  avl = remove_int(avl, 264);
-  avl = gpr_avl_add(avl, box(69), box(639), NULL);
-  avl = remove_int(avl, 73);
-  avl = gpr_avl_add(avl, box(745), box(641), NULL);
-  avl = remove_int(avl, 518);
-  avl = remove_int(avl, 641);
-  avl = remove_int(avl, 768);
-  avl = gpr_avl_add(avl, box(988), box(645), NULL);
-  avl = gpr_avl_add(avl, box(899), box(646), NULL);
-  avl = remove_int(avl, 763);
-  avl = remove_int(avl, 281);
-  avl = remove_int(avl, 496);
-  avl = gpr_avl_add(avl, box(445), box(650), NULL);
-  avl = remove_int(avl, 905);
-  avl = gpr_avl_add(avl, box(275), box(652), NULL);
-  avl = gpr_avl_add(avl, box(137), box(653), NULL);
-  avl = remove_int(avl, 642);
-  avl = gpr_avl_add(avl, box(708), box(655), NULL);
-  avl = remove_int(avl, 922);
-  avl = gpr_avl_add(avl, box(743), box(657), NULL);
-  avl = remove_int(avl, 295);
-  avl = remove_int(avl, 665);
-  avl = remove_int(avl, 48);
-  avl = gpr_avl_add(avl, box(1012), box(661), NULL);
-  avl = remove_int(avl, 71);
-  avl = remove_int(avl, 523);
-  avl = gpr_avl_add(avl, box(319), box(664), NULL);
-  avl = remove_int(avl, 632);
-  avl = gpr_avl_add(avl, box(137), box(666), NULL);
-  avl = gpr_avl_add(avl, box(686), box(667), NULL);
-  avl = gpr_avl_add(avl, box(724), box(668), NULL);
-  avl = gpr_avl_add(avl, box(952), box(669), NULL);
-  avl = gpr_avl_add(avl, box(5), box(670), NULL);
-  avl = remove_int(avl, 35);
-  avl = gpr_avl_add(avl, box(43), box(672), NULL);
-  avl = gpr_avl_add(avl, box(320), box(673), NULL);
-  avl = gpr_avl_add(avl, box(115), box(674), NULL);
-  avl = remove_int(avl, 377);
-  avl = remove_int(avl, 591);
-  avl = remove_int(avl, 87);
-  avl = remove_int(avl, 93);
-  avl = gpr_avl_add(avl, box(1016), box(679), NULL);
-  avl = gpr_avl_add(avl, box(605), box(680), NULL);
-  avl = gpr_avl_add(avl, box(152), box(681), NULL);
-  avl = gpr_avl_add(avl, box(113), box(682), NULL);
-  avl = remove_int(avl, 131);
-  avl = remove_int(avl, 637);
-  avl = gpr_avl_add(avl, box(156), box(685), NULL);
-  avl = remove_int(avl, 696);
-  avl = gpr_avl_add(avl, box(546), box(687), NULL);
-  avl = remove_int(avl, 970);
-  avl = remove_int(avl, 53);
-  avl = remove_int(avl, 827);
-  avl = remove_int(avl, 224);
-  avl = remove_int(avl, 796);
-  avl = remove_int(avl, 34);
-  avl = remove_int(avl, 922);
-  avl = remove_int(avl, 277);
-  avl = remove_int(avl, 650);
-  avl = remove_int(avl, 222);
-  avl = remove_int(avl, 244);
-  avl = remove_int(avl, 576);
-  avl = remove_int(avl, 413);
-  avl = gpr_avl_add(avl, box(500), box(701), NULL);
-  avl = remove_int(avl, 924);
-  avl = gpr_avl_add(avl, box(825), box(703), NULL);
-  avl = remove_int(avl, 888);
-  avl = remove_int(avl, 931);
-  avl = gpr_avl_add(avl, box(285), box(706), NULL);
-  avl = remove_int(avl, 62);
-  avl = remove_int(avl, 444);
-  avl = remove_int(avl, 946);
-  avl = gpr_avl_add(avl, box(122), box(710), NULL);
-  avl = gpr_avl_add(avl, box(846), box(711), NULL);
-  avl = remove_int(avl, 628);
-  avl = gpr_avl_add(avl, box(511), box(713), NULL);
-  avl = gpr_avl_add(avl, box(398), box(714), NULL);
-  avl = remove_int(avl, 730);
-  avl = gpr_avl_add(avl, box(797), box(716), NULL);
-  avl = remove_int(avl, 897);
-  avl = remove_int(avl, 228);
-  avl = remove_int(avl, 544);
-  avl = remove_int(avl, 552);
-  avl = remove_int(avl, 783);
-  avl = remove_int(avl, 583);
-  avl = remove_int(avl, 894);
-  avl = remove_int(avl, 942);
-  avl = gpr_avl_add(avl, box(346), box(725), NULL);
-  avl = gpr_avl_add(avl, box(1015), box(726), NULL);
-  avl = remove_int(avl, 813);
-  avl = gpr_avl_add(avl, box(213), box(728), NULL);
-  avl = remove_int(avl, 468);
-  avl = remove_int(avl, 365);
-  avl = remove_int(avl, 399);
-  avl = gpr_avl_add(avl, box(380), box(732), NULL);
-  avl = remove_int(avl, 835);
-  avl = remove_int(avl, 970);
-  avl = gpr_avl_add(avl, box(700), box(735), NULL);
-  avl = gpr_avl_add(avl, box(807), box(736), NULL);
-  avl = remove_int(avl, 312);
-  avl = remove_int(avl, 282);
-  avl = remove_int(avl, 370);
-  avl = remove_int(avl, 999);
-  avl = remove_int(avl, 241);
-  avl = remove_int(avl, 884);
-  avl = gpr_avl_add(avl, box(587), box(743), NULL);
-  avl = gpr_avl_add(avl, box(332), box(744), NULL);
-  avl = remove_int(avl, 686);
-  avl = remove_int(avl, 206);
-  avl = remove_int(avl, 835);
-  avl = gpr_avl_add(avl, box(334), box(748), NULL);
-  avl = remove_int(avl, 171);
-  avl = gpr_avl_add(avl, box(1002), box(750), NULL);
-  avl = gpr_avl_add(avl, box(779), box(751), NULL);
-  avl = gpr_avl_add(avl, box(307), box(752), NULL);
-  avl = gpr_avl_add(avl, box(127), box(753), NULL);
-  avl = gpr_avl_add(avl, box(251), box(754), NULL);
-  avl = remove_int(avl, 790);
-  avl = remove_int(avl, 189);
-  avl = remove_int(avl, 193);
-  avl = remove_int(avl, 38);
-  avl = remove_int(avl, 124);
-  avl = gpr_avl_add(avl, box(812), box(760), NULL);
-  avl = remove_int(avl, 43);
-  avl = gpr_avl_add(avl, box(871), box(762), NULL);
-  avl = gpr_avl_add(avl, box(580), box(763), NULL);
-  avl = remove_int(avl, 501);
-  avl = remove_int(avl, 462);
-  avl = remove_int(avl, 599);
-  avl = gpr_avl_add(avl, box(240), box(767), NULL);
-  avl = gpr_avl_add(avl, box(285), box(768), NULL);
-  avl = gpr_avl_add(avl, box(472), box(769), NULL);
-  avl = remove_int(avl, 865);
-  avl = remove_int(avl, 763);
-  avl = remove_int(avl, 245);
-  avl = remove_int(avl, 80);
-  avl = remove_int(avl, 713);
-  avl = remove_int(avl, 654);
-  avl = remove_int(avl, 1014);
-  avl = gpr_avl_add(avl, box(495), box(777), NULL);
-  avl = gpr_avl_add(avl, box(552), box(778), NULL);
-  avl = remove_int(avl, 19);
-  avl = remove_int(avl, 803);
-  avl = gpr_avl_add(avl, box(508), box(781), NULL);
-  avl = remove_int(avl, 699);
-  avl = remove_int(avl, 260);
-  avl = remove_int(avl, 92);
-  avl = remove_int(avl, 497);
-  avl = gpr_avl_add(avl, box(970), box(786), NULL);
-  avl = remove_int(avl, 987);
-  avl = remove_int(avl, 168);
-  avl = remove_int(avl, 476);
-  avl = remove_int(avl, 248);
-  avl = gpr_avl_add(avl, box(358), box(791), NULL);
-  avl = remove_int(avl, 804);
-  avl = remove_int(avl, 77);
-  avl = remove_int(avl, 905);
-  avl = remove_int(avl, 362);
-  avl = gpr_avl_add(avl, box(578), box(796), NULL);
-  avl = remove_int(avl, 38);
-  avl = remove_int(avl, 595);
-  avl = gpr_avl_add(avl, box(213), box(799), NULL);
-  avl = remove_int(avl, 7);
-  avl = remove_int(avl, 620);
-  avl = gpr_avl_add(avl, box(946), box(802), NULL);
-  avl = remove_int(avl, 145);
-  avl = gpr_avl_add(avl, box(628), box(804), NULL);
-  avl = remove_int(avl, 972);
-  avl = gpr_avl_add(avl, box(728), box(806), NULL);
-  avl = remove_int(avl, 91);
-  avl = gpr_avl_add(avl, box(136), box(808), NULL);
-  avl = gpr_avl_add(avl, box(841), box(809), NULL);
-  avl = gpr_avl_add(avl, box(265), box(810), NULL);
-  avl = gpr_avl_add(avl, box(701), box(811), NULL);
-  avl = gpr_avl_add(avl, box(27), box(812), NULL);
-  avl = remove_int(avl, 72);
-  avl = remove_int(avl, 14);
-  avl = gpr_avl_add(avl, box(286), box(815), NULL);
-  avl = remove_int(avl, 996);
-  avl = remove_int(avl, 998);
-  avl = gpr_avl_add(avl, box(466), box(818), NULL);
-  avl = remove_int(avl, 1009);
-  avl = remove_int(avl, 741);
-  avl = remove_int(avl, 947);
-  avl = remove_int(avl, 241);
-  avl = remove_int(avl, 954);
-  avl = remove_int(avl, 183);
-  avl = remove_int(avl, 395);
-  avl = remove_int(avl, 951);
-  avl = gpr_avl_add(avl, box(267), box(827), NULL);
-  avl = remove_int(avl, 812);
-  avl = gpr_avl_add(avl, box(577), box(829), NULL);
-  avl = remove_int(avl, 624);
-  avl = remove_int(avl, 847);
-  avl = remove_int(avl, 745);
-  avl = gpr_avl_add(avl, box(491), box(833), NULL);
-  avl = gpr_avl_add(avl, box(941), box(834), NULL);
-  avl = remove_int(avl, 258);
-  avl = gpr_avl_add(avl, box(410), box(836), NULL);
-  avl = gpr_avl_add(avl, box(80), box(837), NULL);
-  avl = gpr_avl_add(avl, box(196), box(838), NULL);
-  avl = gpr_avl_add(avl, box(5), box(839), NULL);
-  avl = remove_int(avl, 782);
-  avl = gpr_avl_add(avl, box(827), box(841), NULL);
-  avl = remove_int(avl, 472);
-  avl = remove_int(avl, 664);
-  avl = gpr_avl_add(avl, box(409), box(844), NULL);
-  avl = gpr_avl_add(avl, box(62), box(845), NULL);
-  avl = remove_int(avl, 56);
-  avl = remove_int(avl, 606);
-  avl = remove_int(avl, 707);
-  avl = remove_int(avl, 989);
-  avl = remove_int(avl, 549);
-  avl = remove_int(avl, 259);
-  avl = gpr_avl_add(avl, box(405), box(852), NULL);
-  avl = remove_int(avl, 587);
-  avl = remove_int(avl, 350);
-  avl = gpr_avl_add(avl, box(980), box(855), NULL);
-  avl = gpr_avl_add(avl, box(992), box(856), NULL);
-  avl = gpr_avl_add(avl, box(818), box(857), NULL);
-  avl = remove_int(avl, 853);
-  avl = remove_int(avl, 701);
-  avl = gpr_avl_add(avl, box(675), box(860), NULL);
-  avl = remove_int(avl, 248);
-  avl = remove_int(avl, 649);
-  avl = gpr_avl_add(avl, box(508), box(863), NULL);
-  avl = remove_int(avl, 927);
-  avl = gpr_avl_add(avl, box(957), box(865), NULL);
-  avl = gpr_avl_add(avl, box(698), box(866), NULL);
-  avl = gpr_avl_add(avl, box(388), box(867), NULL);
-  avl = gpr_avl_add(avl, box(532), box(868), NULL);
-  avl = gpr_avl_add(avl, box(681), box(869), NULL);
-  avl = remove_int(avl, 544);
-  avl = remove_int(avl, 991);
-  avl = remove_int(avl, 397);
-  avl = gpr_avl_add(avl, box(954), box(873), NULL);
-  avl = gpr_avl_add(avl, box(219), box(874), NULL);
-  avl = gpr_avl_add(avl, box(465), box(875), NULL);
-  avl = remove_int(avl, 371);
-  avl = gpr_avl_add(avl, box(601), box(877), NULL);
-  avl = gpr_avl_add(avl, box(543), box(878), NULL);
-  avl = remove_int(avl, 329);
-  avl = gpr_avl_add(avl, box(560), box(880), NULL);
-  avl = remove_int(avl, 898);
-  avl = gpr_avl_add(avl, box(455), box(882), NULL);
-  avl = remove_int(avl, 313);
-  avl = gpr_avl_add(avl, box(215), box(884), NULL);
-  avl = remove_int(avl, 846);
-  avl = gpr_avl_add(avl, box(608), box(886), NULL);
-  avl = remove_int(avl, 248);
-  avl = gpr_avl_add(avl, box(575), box(888), NULL);
-  avl = remove_int(avl, 207);
-  avl = remove_int(avl, 810);
-  avl = remove_int(avl, 665);
-  avl = remove_int(avl, 361);
-  avl = gpr_avl_add(avl, box(154), box(893), NULL);
-  avl = gpr_avl_add(avl, box(329), box(894), NULL);
-  avl = gpr_avl_add(avl, box(326), box(895), NULL);
-  avl = remove_int(avl, 746);
-  avl = remove_int(avl, 99);
-  avl = gpr_avl_add(avl, box(464), box(898), NULL);
-  avl = gpr_avl_add(avl, box(141), box(899), NULL);
-  avl = remove_int(avl, 383);
-  avl = gpr_avl_add(avl, box(414), box(901), NULL);
-  avl = gpr_avl_add(avl, box(777), box(902), NULL);
-  avl = remove_int(avl, 972);
-  avl = remove_int(avl, 841);
-  avl = remove_int(avl, 100);
-  avl = gpr_avl_add(avl, box(828), box(906), NULL);
-  avl = remove_int(avl, 785);
-  avl = gpr_avl_add(avl, box(1008), box(908), NULL);
-  avl = gpr_avl_add(avl, box(46), box(909), NULL);
-  avl = remove_int(avl, 399);
-  avl = gpr_avl_add(avl, box(178), box(911), NULL);
-  avl = gpr_avl_add(avl, box(573), box(912), NULL);
-  avl = remove_int(avl, 299);
-  avl = gpr_avl_add(avl, box(690), box(914), NULL);
-  avl = gpr_avl_add(avl, box(692), box(915), NULL);
-  avl = remove_int(avl, 404);
-  avl = remove_int(avl, 16);
-  avl = remove_int(avl, 746);
-  avl = remove_int(avl, 486);
-  avl = remove_int(avl, 119);
-  avl = gpr_avl_add(avl, box(167), box(921), NULL);
-  avl = remove_int(avl, 328);
-  avl = gpr_avl_add(avl, box(89), box(923), NULL);
-  avl = remove_int(avl, 867);
-  avl = remove_int(avl, 626);
-  avl = remove_int(avl, 507);
-  avl = gpr_avl_add(avl, box(365), box(927), NULL);
-  avl = gpr_avl_add(avl, box(58), box(928), NULL);
-  avl = gpr_avl_add(avl, box(70), box(929), NULL);
-  avl = remove_int(avl, 81);
-  avl = remove_int(avl, 797);
-  avl = gpr_avl_add(avl, box(846), box(932), NULL);
-  avl = remove_int(avl, 642);
-  avl = gpr_avl_add(avl, box(777), box(934), NULL);
-  avl = remove_int(avl, 107);
-  avl = gpr_avl_add(avl, box(691), box(936), NULL);
-  avl = gpr_avl_add(avl, box(820), box(937), NULL);
-  avl = gpr_avl_add(avl, box(202), box(938), NULL);
-  avl = gpr_avl_add(avl, box(308), box(939), NULL);
-  avl = gpr_avl_add(avl, box(20), box(940), NULL);
-  avl = remove_int(avl, 289);
-  avl = gpr_avl_add(avl, box(714), box(942), NULL);
-  avl = gpr_avl_add(avl, box(584), box(943), NULL);
-  avl = remove_int(avl, 294);
-  avl = gpr_avl_add(avl, box(496), box(945), NULL);
-  avl = gpr_avl_add(avl, box(394), box(946), NULL);
-  avl = gpr_avl_add(avl, box(860), box(947), NULL);
-  avl = gpr_avl_add(avl, box(58), box(948), NULL);
-  avl = remove_int(avl, 784);
-  avl = remove_int(avl, 584);
-  avl = remove_int(avl, 708);
-  avl = gpr_avl_add(avl, box(142), box(952), NULL);
-  avl = gpr_avl_add(avl, box(247), box(953), NULL);
-  avl = gpr_avl_add(avl, box(389), box(954), NULL);
-  avl = remove_int(avl, 390);
-  avl = gpr_avl_add(avl, box(465), box(956), NULL);
-  avl = gpr_avl_add(avl, box(936), box(957), NULL);
-  avl = gpr_avl_add(avl, box(309), box(958), NULL);
-  avl = remove_int(avl, 928);
-  avl = remove_int(avl, 128);
-  avl = remove_int(avl, 979);
-  avl = remove_int(avl, 670);
-  avl = remove_int(avl, 738);
-  avl = remove_int(avl, 271);
-  avl = remove_int(avl, 540);
-  avl = gpr_avl_add(avl, box(365), box(966), NULL);
-  avl = remove_int(avl, 82);
-  avl = gpr_avl_add(avl, box(728), box(968), NULL);
-  avl = remove_int(avl, 852);
-  avl = gpr_avl_add(avl, box(884), box(970), NULL);
-  avl = gpr_avl_add(avl, box(502), box(971), NULL);
-  avl = remove_int(avl, 898);
-  avl = remove_int(avl, 481);
-  avl = gpr_avl_add(avl, box(911), box(974), NULL);
-  avl = remove_int(avl, 787);
-  avl = remove_int(avl, 785);
-  avl = remove_int(avl, 537);
-  avl = remove_int(avl, 535);
-  avl = remove_int(avl, 136);
-  avl = remove_int(avl, 749);
-  avl = remove_int(avl, 637);
-  avl = remove_int(avl, 900);
-  avl = gpr_avl_add(avl, box(598), box(983), NULL);
-  avl = remove_int(avl, 25);
-  avl = remove_int(avl, 697);
-  avl = gpr_avl_add(avl, box(645), box(986), NULL);
-  avl = gpr_avl_add(avl, box(211), box(987), NULL);
-  avl = gpr_avl_add(avl, box(589), box(988), NULL);
-  avl = remove_int(avl, 702);
-  avl = gpr_avl_add(avl, box(53), box(990), NULL);
-  avl = remove_int(avl, 492);
-  avl = remove_int(avl, 185);
-  avl = remove_int(avl, 246);
-  avl = remove_int(avl, 257);
-  avl = remove_int(avl, 502);
-  avl = remove_int(avl, 34);
-  avl = gpr_avl_add(avl, box(74), box(997), NULL);
-  avl = gpr_avl_add(avl, box(834), box(998), NULL);
-  avl = gpr_avl_add(avl, box(514), box(999), NULL);
-  avl = gpr_avl_add(avl, box(75), box(1000), NULL);
-  avl = remove_int(avl, 745);
-  avl = gpr_avl_add(avl, box(362), box(1002), NULL);
-  avl = remove_int(avl, 215);
-  avl = gpr_avl_add(avl, box(624), box(1004), NULL);
-  avl = remove_int(avl, 404);
-  avl = remove_int(avl, 359);
-  avl = remove_int(avl, 491);
-  avl = gpr_avl_add(avl, box(903), box(1008), NULL);
-  avl = gpr_avl_add(avl, box(240), box(1009), NULL);
-  avl = remove_int(avl, 95);
-  avl = gpr_avl_add(avl, box(119), box(1011), NULL);
-  avl = gpr_avl_add(avl, box(857), box(1012), NULL);
-  avl = remove_int(avl, 39);
-  avl = remove_int(avl, 866);
-  avl = gpr_avl_add(avl, box(503), box(1015), NULL);
-  avl = gpr_avl_add(avl, box(740), box(1016), NULL);
-  avl = remove_int(avl, 637);
-  avl = remove_int(avl, 156);
-  avl = remove_int(avl, 6);
-  avl = remove_int(avl, 745);
-  avl = remove_int(avl, 433);
-  avl = remove_int(avl, 283);
-  avl = gpr_avl_add(avl, box(625), box(1023), NULL);
-  avl = remove_int(avl, 638);
-  avl = gpr_avl_add(avl, box(299), box(1025), NULL);
-  avl = gpr_avl_add(avl, box(584), box(1026), NULL);
-  avl = remove_int(avl, 863);
-  avl = gpr_avl_add(avl, box(612), box(1028), NULL);
-  avl = gpr_avl_add(avl, box(62), box(1029), NULL);
-  avl = gpr_avl_add(avl, box(432), box(1030), NULL);
-  avl = remove_int(avl, 371);
-  avl = remove_int(avl, 790);
-  avl = remove_int(avl, 227);
-  avl = remove_int(avl, 836);
-  avl = gpr_avl_add(avl, box(703), box(1035), NULL);
-  avl = gpr_avl_add(avl, box(644), box(1036), NULL);
-  avl = remove_int(avl, 638);
-  avl = gpr_avl_add(avl, box(13), box(1038), NULL);
-  avl = remove_int(avl, 66);
-  avl = remove_int(avl, 82);
-  avl = gpr_avl_add(avl, box(362), box(1041), NULL);
-  avl = gpr_avl_add(avl, box(783), box(1042), NULL);
-  avl = remove_int(avl, 60);
-  avl = gpr_avl_add(avl, box(80), box(1044), NULL);
-  avl = gpr_avl_add(avl, box(825), box(1045), NULL);
-  avl = gpr_avl_add(avl, box(688), box(1046), NULL);
-  avl = gpr_avl_add(avl, box(662), box(1047), NULL);
-  avl = remove_int(avl, 156);
-  avl = remove_int(avl, 376);
-  avl = remove_int(avl, 99);
-  avl = gpr_avl_add(avl, box(526), box(1051), NULL);
-  avl = gpr_avl_add(avl, box(168), box(1052), NULL);
-  avl = remove_int(avl, 646);
-  avl = remove_int(avl, 380);
-  avl = remove_int(avl, 833);
-  avl = gpr_avl_add(avl, box(53), box(1056), NULL);
-  avl = remove_int(avl, 105);
-  avl = gpr_avl_add(avl, box(373), box(1058), NULL);
-  avl = gpr_avl_add(avl, box(184), box(1059), NULL);
-  avl = remove_int(avl, 288);
-  avl = gpr_avl_add(avl, box(966), box(1061), NULL);
-  avl = remove_int(avl, 158);
-  avl = gpr_avl_add(avl, box(406), box(1063), NULL);
-  avl = remove_int(avl, 470);
-  avl = gpr_avl_add(avl, box(283), box(1065), NULL);
-  avl = gpr_avl_add(avl, box(838), box(1066), NULL);
-  avl = gpr_avl_add(avl, box(288), box(1067), NULL);
-  avl = gpr_avl_add(avl, box(950), box(1068), NULL);
-  avl = gpr_avl_add(avl, box(163), box(1069), NULL);
-  avl = remove_int(avl, 623);
-  avl = remove_int(avl, 769);
-  avl = gpr_avl_add(avl, box(144), box(1072), NULL);
-  avl = gpr_avl_add(avl, box(489), box(1073), NULL);
-  avl = remove_int(avl, 15);
-  avl = gpr_avl_add(avl, box(971), box(1075), NULL);
-  avl = remove_int(avl, 660);
-  avl = gpr_avl_add(avl, box(255), box(1077), NULL);
-  avl = remove_int(avl, 494);
-  avl = gpr_avl_add(avl, box(109), box(1079), NULL);
-  avl = gpr_avl_add(avl, box(420), box(1080), NULL);
-  avl = gpr_avl_add(avl, box(509), box(1081), NULL);
-  avl = remove_int(avl, 178);
-  avl = gpr_avl_add(avl, box(216), box(1083), NULL);
-  avl = gpr_avl_add(avl, box(707), box(1084), NULL);
-  avl = gpr_avl_add(avl, box(411), box(1085), NULL);
-  avl = gpr_avl_add(avl, box(352), box(1086), NULL);
-  avl = remove_int(avl, 983);
-  avl = gpr_avl_add(avl, box(6), box(1088), NULL);
-  avl = gpr_avl_add(avl, box(1014), box(1089), NULL);
-  avl = remove_int(avl, 98);
-  avl = remove_int(avl, 325);
-  avl = gpr_avl_add(avl, box(851), box(1092), NULL);
-  avl = remove_int(avl, 553);
-  avl = gpr_avl_add(avl, box(218), box(1094), NULL);
-  avl = gpr_avl_add(avl, box(261), box(1095), NULL);
-  avl = remove_int(avl, 31);
-  avl = gpr_avl_add(avl, box(872), box(1097), NULL);
-  avl = remove_int(avl, 543);
-  avl = remove_int(avl, 314);
-  avl = remove_int(avl, 443);
-  avl = gpr_avl_add(avl, box(533), box(1101), NULL);
-  avl = remove_int(avl, 881);
-  avl = remove_int(avl, 269);
-  avl = remove_int(avl, 940);
-  avl = remove_int(avl, 909);
-  avl = remove_int(avl, 197);
-  avl = remove_int(avl, 773);
-  avl = remove_int(avl, 790);
-  avl = remove_int(avl, 345);
-  avl = gpr_avl_add(avl, box(965), box(1110), NULL);
-  avl = remove_int(avl, 622);
-  avl = gpr_avl_add(avl, box(352), box(1112), NULL);
-  avl = remove_int(avl, 182);
-  avl = gpr_avl_add(avl, box(534), box(1114), NULL);
-  avl = gpr_avl_add(avl, box(97), box(1115), NULL);
-  avl = gpr_avl_add(avl, box(198), box(1116), NULL);
-  avl = remove_int(avl, 750);
-  avl = gpr_avl_add(avl, box(98), box(1118), NULL);
-  avl = remove_int(avl, 943);
-  avl = gpr_avl_add(avl, box(254), box(1120), NULL);
-  avl = gpr_avl_add(avl, box(30), box(1121), NULL);
-  avl = remove_int(avl, 14);
-  avl = remove_int(avl, 475);
-  avl = remove_int(avl, 82);
-  avl = gpr_avl_add(avl, box(789), box(1125), NULL);
-  avl = gpr_avl_add(avl, box(402), box(1126), NULL);
-  avl = remove_int(avl, 1019);
-  avl = gpr_avl_add(avl, box(858), box(1128), NULL);
-  avl = gpr_avl_add(avl, box(625), box(1129), NULL);
-  avl = remove_int(avl, 675);
-  avl = remove_int(avl, 323);
-  avl = gpr_avl_add(avl, box(329), box(1132), NULL);
-  avl = remove_int(avl, 929);
-  avl = remove_int(avl, 44);
-  avl = gpr_avl_add(avl, box(443), box(1135), NULL);
-  avl = gpr_avl_add(avl, box(653), box(1136), NULL);
-  avl = gpr_avl_add(avl, box(750), box(1137), NULL);
-  avl = gpr_avl_add(avl, box(252), box(1138), NULL);
-  avl = gpr_avl_add(avl, box(449), box(1139), NULL);
-  avl = remove_int(avl, 1022);
-  avl = remove_int(avl, 357);
-  avl = remove_int(avl, 602);
-  avl = remove_int(avl, 131);
-  avl = gpr_avl_add(avl, box(531), box(1144), NULL);
-  avl = remove_int(avl, 806);
-  avl = gpr_avl_add(avl, box(455), box(1146), NULL);
-  avl = remove_int(avl, 31);
-  avl = gpr_avl_add(avl, box(154), box(1148), NULL);
-  avl = gpr_avl_add(avl, box(189), box(1149), NULL);
-  avl = remove_int(avl, 786);
-  avl = gpr_avl_add(avl, box(496), box(1151), NULL);
-  avl = gpr_avl_add(avl, box(81), box(1152), NULL);
-  avl = gpr_avl_add(avl, box(59), box(1153), NULL);
-  avl = remove_int(avl, 424);
-  avl = remove_int(avl, 668);
-  avl = gpr_avl_add(avl, box(723), box(1156), NULL);
-  avl = gpr_avl_add(avl, box(822), box(1157), NULL);
-  avl = gpr_avl_add(avl, box(354), box(1158), NULL);
-  avl = remove_int(avl, 738);
-  avl = gpr_avl_add(avl, box(686), box(1160), NULL);
-  avl = gpr_avl_add(avl, box(43), box(1161), NULL);
-  avl = gpr_avl_add(avl, box(625), box(1162), NULL);
-  avl = gpr_avl_add(avl, box(902), box(1163), NULL);
-  avl = gpr_avl_add(avl, box(12), box(1164), NULL);
-  avl = gpr_avl_add(avl, box(977), box(1165), NULL);
-  avl = gpr_avl_add(avl, box(699), box(1166), NULL);
-  avl = gpr_avl_add(avl, box(189), box(1167), NULL);
-  avl = remove_int(avl, 672);
-  avl = remove_int(avl, 90);
-  avl = remove_int(avl, 757);
-  avl = remove_int(avl, 494);
-  avl = gpr_avl_add(avl, box(759), box(1172), NULL);
-  avl = remove_int(avl, 758);
-  avl = remove_int(avl, 222);
-  avl = gpr_avl_add(avl, box(975), box(1175), NULL);
-  avl = remove_int(avl, 993);
-  avl = gpr_avl_add(avl, box(2), box(1177), NULL);
-  avl = gpr_avl_add(avl, box(70), box(1178), NULL);
-  avl = remove_int(avl, 350);
-  avl = remove_int(avl, 972);
-  avl = remove_int(avl, 880);
-  avl = gpr_avl_add(avl, box(753), box(1182), NULL);
-  avl = remove_int(avl, 404);
-  avl = gpr_avl_add(avl, box(294), box(1184), NULL);
-  avl = remove_int(avl, 474);
-  avl = gpr_avl_add(avl, box(228), box(1186), NULL);
-  avl = gpr_avl_add(avl, box(484), box(1187), NULL);
-  avl = remove_int(avl, 238);
-  avl = remove_int(avl, 53);
-  avl = remove_int(avl, 691);
-  avl = gpr_avl_add(avl, box(345), box(1191), NULL);
-  avl = remove_int(avl, 0);
-  avl = gpr_avl_add(avl, box(230), box(1193), NULL);
-  avl = remove_int(avl, 227);
-  avl = remove_int(avl, 152);
-  avl = gpr_avl_add(avl, box(884), box(1196), NULL);
-  avl = remove_int(avl, 823);
-  avl = remove_int(avl, 53);
-  avl = gpr_avl_add(avl, box(1015), box(1199), NULL);
-  avl = gpr_avl_add(avl, box(697), box(1200), NULL);
-  avl = gpr_avl_add(avl, box(376), box(1201), NULL);
-  avl = remove_int(avl, 411);
-  avl = gpr_avl_add(avl, box(888), box(1203), NULL);
-  avl = remove_int(avl, 55);
-  avl = gpr_avl_add(avl, box(85), box(1205), NULL);
-  avl = remove_int(avl, 947);
-  avl = remove_int(avl, 382);
-  avl = remove_int(avl, 777);
-  avl = gpr_avl_add(avl, box(1017), box(1209), NULL);
-  avl = gpr_avl_add(avl, box(169), box(1210), NULL);
-  avl = gpr_avl_add(avl, box(156), box(1211), NULL);
-  avl = remove_int(avl, 153);
-  avl = remove_int(avl, 642);
-  avl = remove_int(avl, 158);
-  avl = gpr_avl_add(avl, box(554), box(1215), NULL);
-  avl = gpr_avl_add(avl, box(76), box(1216), NULL);
-  avl = gpr_avl_add(avl, box(756), box(1217), NULL);
-  avl = remove_int(avl, 767);
-  avl = remove_int(avl, 112);
-  avl = remove_int(avl, 539);
-  avl = remove_int(avl, 544);
-  avl = remove_int(avl, 628);
-  avl = remove_int(avl, 385);
-  avl = remove_int(avl, 514);
-  avl = remove_int(avl, 362);
-  avl = gpr_avl_add(avl, box(523), box(1226), NULL);
-  avl = gpr_avl_add(avl, box(712), box(1227), NULL);
-  avl = gpr_avl_add(avl, box(474), box(1228), NULL);
-  avl = gpr_avl_add(avl, box(882), box(1229), NULL);
-  avl = gpr_avl_add(avl, box(965), box(1230), NULL);
-  avl = remove_int(avl, 464);
-  avl = gpr_avl_add(avl, box(319), box(1232), NULL);
-  avl = gpr_avl_add(avl, box(504), box(1233), NULL);
-  avl = remove_int(avl, 818);
-  avl = gpr_avl_add(avl, box(884), box(1235), NULL);
-  avl = gpr_avl_add(avl, box(813), box(1236), NULL);
-  avl = gpr_avl_add(avl, box(795), box(1237), NULL);
-  avl = remove_int(avl, 306);
-  avl = gpr_avl_add(avl, box(799), box(1239), NULL);
-  avl = remove_int(avl, 534);
-  avl = gpr_avl_add(avl, box(480), box(1241), NULL);
-  avl = gpr_avl_add(avl, box(656), box(1242), NULL);
-  avl = gpr_avl_add(avl, box(709), box(1243), NULL);
-  avl = gpr_avl_add(avl, box(500), box(1244), NULL);
-  avl = remove_int(avl, 740);
-  avl = gpr_avl_add(avl, box(980), box(1246), NULL);
-  avl = gpr_avl_add(avl, box(458), box(1247), NULL);
-  avl = remove_int(avl, 377);
-  avl = remove_int(avl, 338);
-  avl = gpr_avl_add(avl, box(554), box(1250), NULL);
-  avl = gpr_avl_add(avl, box(504), box(1251), NULL);
-  avl = gpr_avl_add(avl, box(603), box(1252), NULL);
-  avl = gpr_avl_add(avl, box(761), box(1253), NULL);
-  avl = remove_int(avl, 431);
-  avl = gpr_avl_add(avl, box(707), box(1255), NULL);
-  avl = gpr_avl_add(avl, box(673), box(1256), NULL);
-  avl = remove_int(avl, 998);
-  avl = remove_int(avl, 332);
-  avl = remove_int(avl, 413);
-  avl = remove_int(avl, 227);
-  avl = remove_int(avl, 249);
-  avl = remove_int(avl, 309);
-  avl = remove_int(avl, 459);
-  avl = gpr_avl_add(avl, box(645), box(1264), NULL);
-  avl = remove_int(avl, 858);
-  avl = remove_int(avl, 997);
-  avl = gpr_avl_add(avl, box(519), box(1267), NULL);
-  avl = remove_int(avl, 614);
-  avl = remove_int(avl, 462);
-  avl = remove_int(avl, 792);
-  avl = gpr_avl_add(avl, box(987), box(1271), NULL);
-  avl = gpr_avl_add(avl, box(309), box(1272), NULL);
-  avl = remove_int(avl, 747);
-  avl = gpr_avl_add(avl, box(621), box(1274), NULL);
-  avl = gpr_avl_add(avl, box(450), box(1275), NULL);
-  avl = remove_int(avl, 265);
-  avl = remove_int(avl, 8);
-  avl = remove_int(avl, 383);
-  avl = gpr_avl_add(avl, box(238), box(1279), NULL);
-  avl = remove_int(avl, 241);
-  avl = gpr_avl_add(avl, box(180), box(1281), NULL);
-  avl = gpr_avl_add(avl, box(411), box(1282), NULL);
-  avl = gpr_avl_add(avl, box(791), box(1283), NULL);
-  avl = gpr_avl_add(avl, box(955), box(1284), NULL);
-  avl = remove_int(avl, 24);
-  avl = remove_int(avl, 375);
-  avl = gpr_avl_add(avl, box(140), box(1287), NULL);
-  avl = remove_int(avl, 949);
-  avl = gpr_avl_add(avl, box(301), box(1289), NULL);
-  avl = gpr_avl_add(avl, box(0), box(1290), NULL);
-  avl = remove_int(avl, 371);
-  avl = remove_int(avl, 427);
-  avl = remove_int(avl, 841);
-  avl = remove_int(avl, 847);
-  avl = gpr_avl_add(avl, box(814), box(1295), NULL);
-  avl = gpr_avl_add(avl, box(127), box(1296), NULL);
-  avl = gpr_avl_add(avl, box(279), box(1297), NULL);
-  avl = remove_int(avl, 669);
-  avl = remove_int(avl, 541);
-  avl = remove_int(avl, 275);
-  avl = remove_int(avl, 299);
-  avl = remove_int(avl, 552);
-  avl = gpr_avl_add(avl, box(310), box(1303), NULL);
-  avl = gpr_avl_add(avl, box(304), box(1304), NULL);
-  avl = gpr_avl_add(avl, box(1), box(1305), NULL);
-  avl = gpr_avl_add(avl, box(339), box(1306), NULL);
-  avl = remove_int(avl, 570);
-  avl = remove_int(avl, 752);
-  avl = remove_int(avl, 552);
-  avl = remove_int(avl, 442);
-  avl = remove_int(avl, 639);
-  avl = gpr_avl_add(avl, box(313), box(1312), NULL);
-  avl = remove_int(avl, 85);
-  avl = gpr_avl_add(avl, box(964), box(1314), NULL);
-  avl = gpr_avl_add(avl, box(559), box(1315), NULL);
-  avl = remove_int(avl, 167);
-  avl = gpr_avl_add(avl, box(866), box(1317), NULL);
-  avl = remove_int(avl, 275);
-  avl = gpr_avl_add(avl, box(173), box(1319), NULL);
-  avl = gpr_avl_add(avl, box(765), box(1320), NULL);
-  avl = remove_int(avl, 883);
-  avl = gpr_avl_add(avl, box(547), box(1322), NULL);
-  avl = gpr_avl_add(avl, box(847), box(1323), NULL);
-  avl = remove_int(avl, 817);
-  avl = remove_int(avl, 850);
-  avl = remove_int(avl, 718);
-  avl = gpr_avl_add(avl, box(806), box(1327), NULL);
-  avl = gpr_avl_add(avl, box(360), box(1328), NULL);
-  avl = remove_int(avl, 991);
-  avl = gpr_avl_add(avl, box(493), box(1330), NULL);
-  avl = remove_int(avl, 516);
-  avl = gpr_avl_add(avl, box(361), box(1332), NULL);
-  avl = remove_int(avl, 355);
-  avl = gpr_avl_add(avl, box(512), box(1334), NULL);
-  avl = gpr_avl_add(avl, box(191), box(1335), NULL);
-  avl = remove_int(avl, 703);
-  avl = gpr_avl_add(avl, box(333), box(1337), NULL);
-  avl = remove_int(avl, 481);
-  avl = gpr_avl_add(avl, box(501), box(1339), NULL);
-  avl = remove_int(avl, 532);
-  avl = remove_int(avl, 510);
-  avl = gpr_avl_add(avl, box(793), box(1342), NULL);
-  avl = gpr_avl_add(avl, box(234), box(1343), NULL);
-  avl = remove_int(avl, 159);
-  avl = remove_int(avl, 429);
-  avl = remove_int(avl, 728);
-  avl = remove_int(avl, 288);
-  avl = gpr_avl_add(avl, box(281), box(1348), NULL);
-  avl = gpr_avl_add(avl, box(702), box(1349), NULL);
-  avl = gpr_avl_add(avl, box(149), box(1350), NULL);
-  avl = remove_int(avl, 22);
-  avl = remove_int(avl, 944);
-  avl = remove_int(avl, 55);
-  avl = remove_int(avl, 512);
-  avl = remove_int(avl, 676);
-  avl = remove_int(avl, 884);
-  avl = gpr_avl_add(avl, box(246), box(1357), NULL);
-  avl = gpr_avl_add(avl, box(455), box(1358), NULL);
-  avl = remove_int(avl, 782);
-  avl = remove_int(avl, 682);
-  avl = gpr_avl_add(avl, box(243), box(1361), NULL);
-  avl = gpr_avl_add(avl, box(109), box(1362), NULL);
-  avl = gpr_avl_add(avl, box(452), box(1363), NULL);
-  avl = remove_int(avl, 151);
-  avl = gpr_avl_add(avl, box(159), box(1365), NULL);
-  avl = remove_int(avl, 1023);
-  avl = gpr_avl_add(avl, box(129), box(1367), NULL);
-  avl = gpr_avl_add(avl, box(537), box(1368), NULL);
-  avl = remove_int(avl, 321);
-  avl = gpr_avl_add(avl, box(740), box(1370), NULL);
-  avl = remove_int(avl, 45);
-  avl = remove_int(avl, 136);
-  avl = gpr_avl_add(avl, box(229), box(1373), NULL);
-  avl = remove_int(avl, 772);
-  avl = gpr_avl_add(avl, box(181), box(1375), NULL);
-  avl = remove_int(avl, 175);
-  avl = gpr_avl_add(avl, box(817), box(1377), NULL);
-  avl = remove_int(avl, 956);
-  avl = gpr_avl_add(avl, box(675), box(1379), NULL);
-  avl = gpr_avl_add(avl, box(375), box(1380), NULL);
-  avl = remove_int(avl, 384);
-  avl = gpr_avl_add(avl, box(1016), box(1382), NULL);
-  avl = remove_int(avl, 295);
-  avl = remove_int(avl, 697);
-  avl = remove_int(avl, 554);
-  avl = remove_int(avl, 590);
-  avl = remove_int(avl, 1014);
-  avl = gpr_avl_add(avl, box(890), box(1388), NULL);
-  avl = gpr_avl_add(avl, box(293), box(1389), NULL);
-  avl = remove_int(avl, 207);
-  avl = remove_int(avl, 46);
-  avl = gpr_avl_add(avl, box(899), box(1392), NULL);
-  avl = gpr_avl_add(avl, box(666), box(1393), NULL);
-  avl = gpr_avl_add(avl, box(85), box(1394), NULL);
-  avl = gpr_avl_add(avl, box(914), box(1395), NULL);
-  avl = gpr_avl_add(avl, box(128), box(1396), NULL);
-  avl = gpr_avl_add(avl, box(835), box(1397), NULL);
-  avl = gpr_avl_add(avl, box(787), box(1398), NULL);
-  avl = gpr_avl_add(avl, box(649), box(1399), NULL);
-  avl = gpr_avl_add(avl, box(723), box(1400), NULL);
-  avl = remove_int(avl, 874);
-  avl = gpr_avl_add(avl, box(778), box(1402), NULL);
-  avl = gpr_avl_add(avl, box(1015), box(1403), NULL);
-  avl = gpr_avl_add(avl, box(59), box(1404), NULL);
-  avl = gpr_avl_add(avl, box(259), box(1405), NULL);
-  avl = gpr_avl_add(avl, box(758), box(1406), NULL);
-  avl = remove_int(avl, 648);
-  avl = gpr_avl_add(avl, box(145), box(1408), NULL);
-  avl = gpr_avl_add(avl, box(440), box(1409), NULL);
-  avl = remove_int(avl, 608);
-  avl = remove_int(avl, 690);
-  avl = gpr_avl_add(avl, box(605), box(1412), NULL);
-  avl = remove_int(avl, 856);
-  avl = remove_int(avl, 608);
-  avl = gpr_avl_add(avl, box(829), box(1415), NULL);
-  avl = gpr_avl_add(avl, box(660), box(1416), NULL);
-  avl = remove_int(avl, 596);
-  avl = gpr_avl_add(avl, box(519), box(1418), NULL);
-  avl = gpr_avl_add(avl, box(35), box(1419), NULL);
-  avl = gpr_avl_add(avl, box(871), box(1420), NULL);
-  avl = remove_int(avl, 845);
-  avl = gpr_avl_add(avl, box(600), box(1422), NULL);
-  avl = gpr_avl_add(avl, box(215), box(1423), NULL);
-  avl = remove_int(avl, 761);
-  avl = gpr_avl_add(avl, box(975), box(1425), NULL);
-  avl = remove_int(avl, 987);
-  avl = gpr_avl_add(avl, box(58), box(1427), NULL);
-  avl = remove_int(avl, 119);
-  avl = gpr_avl_add(avl, box(937), box(1429), NULL);
-  avl = gpr_avl_add(avl, box(372), box(1430), NULL);
-  avl = gpr_avl_add(avl, box(11), box(1431), NULL);
-  avl = gpr_avl_add(avl, box(398), box(1432), NULL);
-  avl = gpr_avl_add(avl, box(423), box(1433), NULL);
-  avl = remove_int(avl, 171);
-  avl = gpr_avl_add(avl, box(473), box(1435), NULL);
-  avl = remove_int(avl, 752);
-  avl = remove_int(avl, 625);
-  avl = remove_int(avl, 764);
-  avl = remove_int(avl, 49);
-  avl = gpr_avl_add(avl, box(472), box(1440), NULL);
-  avl = remove_int(avl, 847);
-  avl = remove_int(avl, 642);
-  avl = remove_int(avl, 1004);
-  avl = remove_int(avl, 795);
-  avl = remove_int(avl, 465);
-  avl = gpr_avl_add(avl, box(636), box(1446), NULL);
-  avl = remove_int(avl, 152);
-  avl = gpr_avl_add(avl, box(61), box(1448), NULL);
-  avl = remove_int(avl, 929);
-  avl = remove_int(avl, 9);
-  avl = gpr_avl_add(avl, box(251), box(1451), NULL);
-  avl = gpr_avl_add(avl, box(672), box(1452), NULL);
-  avl = gpr_avl_add(avl, box(66), box(1453), NULL);
-  avl = remove_int(avl, 693);
-  avl = remove_int(avl, 914);
-  avl = remove_int(avl, 116);
-  avl = remove_int(avl, 577);
-  avl = gpr_avl_add(avl, box(618), box(1458), NULL);
-  avl = gpr_avl_add(avl, box(495), box(1459), NULL);
-  avl = remove_int(avl, 450);
-  avl = gpr_avl_add(avl, box(533), box(1461), NULL);
-  avl = gpr_avl_add(avl, box(414), box(1462), NULL);
-  avl = remove_int(avl, 74);
-  avl = remove_int(avl, 236);
-  avl = gpr_avl_add(avl, box(707), box(1465), NULL);
-  avl = gpr_avl_add(avl, box(357), box(1466), NULL);
-  avl = gpr_avl_add(avl, box(1007), box(1467), NULL);
-  avl = gpr_avl_add(avl, box(811), box(1468), NULL);
-  avl = gpr_avl_add(avl, box(418), box(1469), NULL);
-  avl = gpr_avl_add(avl, box(164), box(1470), NULL);
-  avl = gpr_avl_add(avl, box(622), box(1471), NULL);
-  avl = remove_int(avl, 22);
-  avl = remove_int(avl, 14);
-  avl = remove_int(avl, 732);
-  avl = remove_int(avl, 7);
-  avl = remove_int(avl, 447);
-  avl = gpr_avl_add(avl, box(221), box(1477), NULL);
-  avl = gpr_avl_add(avl, box(202), box(1478), NULL);
-  avl = gpr_avl_add(avl, box(312), box(1479), NULL);
-  avl = remove_int(avl, 274);
-  avl = gpr_avl_add(avl, box(684), box(1481), NULL);
-  avl = gpr_avl_add(avl, box(954), box(1482), NULL);
-  avl = gpr_avl_add(avl, box(637), box(1483), NULL);
-  avl = remove_int(avl, 716);
-  avl = gpr_avl_add(avl, box(198), box(1485), NULL);
-  avl = remove_int(avl, 340);
-  avl = remove_int(avl, 137);
-  avl = remove_int(avl, 995);
-  avl = remove_int(avl, 1004);
-  avl = gpr_avl_add(avl, box(661), box(1490), NULL);
-  avl = gpr_avl_add(avl, box(862), box(1491), NULL);
-  avl = remove_int(avl, 527);
-  avl = gpr_avl_add(avl, box(945), box(1493), NULL);
-  avl = remove_int(avl, 355);
-  avl = remove_int(avl, 144);
-  avl = gpr_avl_add(avl, box(229), box(1496), NULL);
-  avl = gpr_avl_add(avl, box(237), box(1497), NULL);
-  avl = remove_int(avl, 471);
-  avl = remove_int(avl, 901);
-  avl = gpr_avl_add(avl, box(905), box(1500), NULL);
-  avl = remove_int(avl, 19);
-  avl = remove_int(avl, 896);
-  avl = remove_int(avl, 585);
-  avl = remove_int(avl, 308);
-  avl = gpr_avl_add(avl, box(547), box(1505), NULL);
-  avl = gpr_avl_add(avl, box(552), box(1506), NULL);
-  avl = gpr_avl_add(avl, box(30), box(1507), NULL);
-  avl = gpr_avl_add(avl, box(445), box(1508), NULL);
-  avl = remove_int(avl, 785);
-  avl = remove_int(avl, 185);
-  avl = gpr_avl_add(avl, box(405), box(1511), NULL);
-  avl = gpr_avl_add(avl, box(733), box(1512), NULL);
-  avl = gpr_avl_add(avl, box(573), box(1513), NULL);
-  avl = gpr_avl_add(avl, box(492), box(1514), NULL);
-  avl = gpr_avl_add(avl, box(343), box(1515), NULL);
-  avl = gpr_avl_add(avl, box(527), box(1516), NULL);
-  avl = gpr_avl_add(avl, box(596), box(1517), NULL);
-  avl = gpr_avl_add(avl, box(519), box(1518), NULL);
-  avl = remove_int(avl, 243);
-  avl = remove_int(avl, 722);
-  avl = gpr_avl_add(avl, box(772), box(1521), NULL);
-  avl = remove_int(avl, 152);
-  avl = remove_int(avl, 305);
-  avl = gpr_avl_add(avl, box(754), box(1524), NULL);
-  avl = gpr_avl_add(avl, box(373), box(1525), NULL);
-  avl = remove_int(avl, 995);
-  avl = gpr_avl_add(avl, box(329), box(1527), NULL);
-  avl = remove_int(avl, 397);
-  avl = gpr_avl_add(avl, box(884), box(1529), NULL);
-  avl = remove_int(avl, 329);
-  avl = remove_int(avl, 240);
-  avl = gpr_avl_add(avl, box(566), box(1532), NULL);
-  avl = gpr_avl_add(avl, box(232), box(1533), NULL);
-  avl = remove_int(avl, 993);
-  avl = gpr_avl_add(avl, box(888), box(1535), NULL);
-  avl = remove_int(avl, 242);
-  avl = gpr_avl_add(avl, box(941), box(1537), NULL);
-  avl = remove_int(avl, 415);
-  avl = gpr_avl_add(avl, box(992), box(1539), NULL);
-  avl = remove_int(avl, 289);
-  avl = gpr_avl_add(avl, box(60), box(1541), NULL);
-  avl = gpr_avl_add(avl, box(97), box(1542), NULL);
-  avl = remove_int(avl, 965);
-  avl = remove_int(avl, 267);
-  avl = remove_int(avl, 360);
-  avl = gpr_avl_add(avl, box(5), box(1546), NULL);
-  avl = remove_int(avl, 429);
-  avl = gpr_avl_add(avl, box(412), box(1548), NULL);
-  avl = remove_int(avl, 632);
-  avl = remove_int(avl, 113);
-  avl = gpr_avl_add(avl, box(48), box(1551), NULL);
-  avl = gpr_avl_add(avl, box(108), box(1552), NULL);
-  avl = gpr_avl_add(avl, box(750), box(1553), NULL);
-  avl = remove_int(avl, 188);
-  avl = gpr_avl_add(avl, box(668), box(1555), NULL);
-  avl = remove_int(avl, 37);
-  avl = remove_int(avl, 737);
-  avl = gpr_avl_add(avl, box(93), box(1558), NULL);
-  avl = gpr_avl_add(avl, box(628), box(1559), NULL);
-  avl = gpr_avl_add(avl, box(480), box(1560), NULL);
-  avl = remove_int(avl, 958);
-  avl = remove_int(avl, 565);
-  avl = remove_int(avl, 32);
-  avl = remove_int(avl, 1);
-  avl = remove_int(avl, 335);
-  avl = gpr_avl_add(avl, box(136), box(1566), NULL);
-  avl = gpr_avl_add(avl, box(469), box(1567), NULL);
-  avl = remove_int(avl, 349);
-  avl = gpr_avl_add(avl, box(768), box(1569), NULL);
-  avl = gpr_avl_add(avl, box(915), box(1570), NULL);
-  avl = remove_int(avl, 1014);
-  avl = gpr_avl_add(avl, box(117), box(1572), NULL);
-  avl = remove_int(avl, 62);
-  avl = gpr_avl_add(avl, box(382), box(1574), NULL);
-  avl = remove_int(avl, 571);
-  avl = gpr_avl_add(avl, box(655), box(1576), NULL);
-  avl = gpr_avl_add(avl, box(323), box(1577), NULL);
-  avl = remove_int(avl, 869);
-  avl = remove_int(avl, 151);
-  avl = gpr_avl_add(avl, box(1019), box(1580), NULL);
-  avl = gpr_avl_add(avl, box(984), box(1581), NULL);
-  avl = gpr_avl_add(avl, box(870), box(1582), NULL);
-  avl = gpr_avl_add(avl, box(376), box(1583), NULL);
-  avl = remove_int(avl, 625);
-  avl = gpr_avl_add(avl, box(733), box(1585), NULL);
-  avl = remove_int(avl, 532);
-  avl = remove_int(avl, 444);
-  avl = gpr_avl_add(avl, box(428), box(1588), NULL);
-  avl = gpr_avl_add(avl, box(860), box(1589), NULL);
-  avl = gpr_avl_add(avl, box(173), box(1590), NULL);
-  avl = remove_int(avl, 649);
-  avl = remove_int(avl, 913);
-  avl = remove_int(avl, 1);
-  avl = remove_int(avl, 304);
-  avl = gpr_avl_add(avl, box(604), box(1595), NULL);
-  avl = gpr_avl_add(avl, box(639), box(1596), NULL);
-  avl = remove_int(avl, 431);
-  avl = gpr_avl_add(avl, box(993), box(1598), NULL);
-  avl = remove_int(avl, 681);
-  avl = remove_int(avl, 927);
-  avl = gpr_avl_add(avl, box(87), box(1601), NULL);
-  avl = gpr_avl_add(avl, box(91), box(1602), NULL);
-  avl = remove_int(avl, 61);
-  avl = remove_int(avl, 14);
-  avl = remove_int(avl, 305);
-  avl = remove_int(avl, 304);
-  avl = remove_int(avl, 1016);
-  avl = gpr_avl_add(avl, box(903), box(1608), NULL);
-  avl = gpr_avl_add(avl, box(951), box(1609), NULL);
-  avl = gpr_avl_add(avl, box(146), box(1610), NULL);
-  avl = gpr_avl_add(avl, box(482), box(1611), NULL);
-  avl = gpr_avl_add(avl, box(71), box(1612), NULL);
-  avl = remove_int(avl, 246);
-  avl = remove_int(avl, 696);
-  avl = gpr_avl_add(avl, box(636), box(1615), NULL);
-  avl = gpr_avl_add(avl, box(295), box(1616), NULL);
-  avl = remove_int(avl, 11);
-  avl = remove_int(avl, 231);
-  avl = gpr_avl_add(avl, box(905), box(1619), NULL);
-  avl = gpr_avl_add(avl, box(993), box(1620), NULL);
-  avl = gpr_avl_add(avl, box(433), box(1621), NULL);
-  avl = gpr_avl_add(avl, box(117), box(1622), NULL);
-  avl = gpr_avl_add(avl, box(467), box(1623), NULL);
-  avl = remove_int(avl, 419);
-  avl = gpr_avl_add(avl, box(179), box(1625), NULL);
-  avl = remove_int(avl, 926);
-  avl = remove_int(avl, 326);
-  avl = gpr_avl_add(avl, box(551), box(1628), NULL);
-  avl = remove_int(avl, 14);
-  avl = remove_int(avl, 476);
-  avl = remove_int(avl, 823);
-  avl = gpr_avl_add(avl, box(350), box(1632), NULL);
-  avl = gpr_avl_add(avl, box(133), box(1633), NULL);
-  avl = remove_int(avl, 906);
-  avl = gpr_avl_add(avl, box(827), box(1635), NULL);
-  avl = gpr_avl_add(avl, box(201), box(1636), NULL);
-  avl = remove_int(avl, 124);
-  avl = remove_int(avl, 662);
-  avl = gpr_avl_add(avl, box(314), box(1639), NULL);
-  avl = gpr_avl_add(avl, box(986), box(1640), NULL);
-  avl = gpr_avl_add(avl, box(622), box(1641), NULL);
-  avl = remove_int(avl, 130);
-  avl = gpr_avl_add(avl, box(861), box(1643), NULL);
-  avl = remove_int(avl, 497);
-  avl = remove_int(avl, 905);
-  avl = gpr_avl_add(avl, box(502), box(1646), NULL);
-  avl = remove_int(avl, 721);
-  avl = gpr_avl_add(avl, box(514), box(1648), NULL);
-  avl = gpr_avl_add(avl, box(410), box(1649), NULL);
-  avl = remove_int(avl, 869);
-  avl = remove_int(avl, 247);
-  avl = gpr_avl_add(avl, box(450), box(1652), NULL);
-  avl = remove_int(avl, 364);
-  avl = gpr_avl_add(avl, box(963), box(1654), NULL);
-  avl = gpr_avl_add(avl, box(146), box(1655), NULL);
-  avl = remove_int(avl, 147);
-  avl = remove_int(avl, 789);
-  avl = gpr_avl_add(avl, box(693), box(1658), NULL);
-  avl = gpr_avl_add(avl, box(959), box(1659), NULL);
-  avl = remove_int(avl, 478);
-  avl = gpr_avl_add(avl, box(116), box(1661), NULL);
-  avl = gpr_avl_add(avl, box(520), box(1662), NULL);
-  avl = gpr_avl_add(avl, box(809), box(1663), NULL);
-  avl = gpr_avl_add(avl, box(667), box(1664), NULL);
-  avl = gpr_avl_add(avl, box(406), box(1665), NULL);
-  avl = remove_int(avl, 409);
-  avl = gpr_avl_add(avl, box(558), box(1667), NULL);
-  avl = gpr_avl_add(avl, box(0), box(1668), NULL);
-  avl = gpr_avl_add(avl, box(948), box(1669), NULL);
-  avl = gpr_avl_add(avl, box(576), box(1670), NULL);
-  avl = remove_int(avl, 864);
-  avl = remove_int(avl, 840);
-  avl = remove_int(avl, 1001);
-  avl = gpr_avl_add(avl, box(232), box(1674), NULL);
-  avl = remove_int(avl, 676);
-  avl = remove_int(avl, 752);
-  avl = remove_int(avl, 667);
-  avl = remove_int(avl, 605);
-  avl = gpr_avl_add(avl, box(258), box(1679), NULL);
-  avl = gpr_avl_add(avl, box(648), box(1680), NULL);
-  avl = gpr_avl_add(avl, box(761), box(1681), NULL);
-  avl = remove_int(avl, 293);
-  avl = remove_int(avl, 893);
-  avl = gpr_avl_add(avl, box(194), box(1684), NULL);
-  avl = remove_int(avl, 233);
-  avl = gpr_avl_add(avl, box(888), box(1686), NULL);
-  avl = remove_int(avl, 470);
-  avl = remove_int(avl, 703);
-  avl = remove_int(avl, 190);
-  avl = remove_int(avl, 359);
-  avl = gpr_avl_add(avl, box(621), box(1691), NULL);
-  avl = remove_int(avl, 634);
-  avl = remove_int(avl, 335);
-  avl = gpr_avl_add(avl, box(718), box(1694), NULL);
-  avl = gpr_avl_add(avl, box(463), box(1695), NULL);
-  avl = gpr_avl_add(avl, box(233), box(1696), NULL);
-  avl = remove_int(avl, 376);
-  avl = remove_int(avl, 496);
-  avl = remove_int(avl, 819);
-  avl = remove_int(avl, 38);
-  avl = remove_int(avl, 436);
-  avl = remove_int(avl, 102);
-  avl = gpr_avl_add(avl, box(607), box(1703), NULL);
-  avl = remove_int(avl, 329);
-  avl = gpr_avl_add(avl, box(716), box(1705), NULL);
-  avl = remove_int(avl, 639);
-  avl = remove_int(avl, 775);
-  avl = remove_int(avl, 578);
-  avl = remove_int(avl, 464);
-  avl = remove_int(avl, 679);
-  avl = remove_int(avl, 615);
-  avl = remove_int(avl, 104);
-  avl = gpr_avl_add(avl, box(414), box(1713), NULL);
-  avl = gpr_avl_add(avl, box(212), box(1714), NULL);
-  avl = gpr_avl_add(avl, box(266), box(1715), NULL);
-  avl = gpr_avl_add(avl, box(238), box(1716), NULL);
-  avl = remove_int(avl, 153);
-  avl = gpr_avl_add(avl, box(585), box(1718), NULL);
-  avl = remove_int(avl, 121);
-  avl = gpr_avl_add(avl, box(534), box(1720), NULL);
-  avl = remove_int(avl, 579);
-  avl = gpr_avl_add(avl, box(127), box(1722), NULL);
-  avl = gpr_avl_add(avl, box(399), box(1723), NULL);
-  avl = remove_int(avl, 417);
-  avl = gpr_avl_add(avl, box(978), box(1725), NULL);
-  avl = gpr_avl_add(avl, box(768), box(1726), NULL);
-  avl = remove_int(avl, 985);
-  avl = gpr_avl_add(avl, box(536), box(1728), NULL);
-  avl = gpr_avl_add(avl, box(449), box(1729), NULL);
-  avl = gpr_avl_add(avl, box(586), box(1730), NULL);
-  avl = remove_int(avl, 998);
-  avl = remove_int(avl, 394);
-  avl = remove_int(avl, 141);
-  avl = gpr_avl_add(avl, box(889), box(1734), NULL);
-  avl = gpr_avl_add(avl, box(871), box(1735), NULL);
-  avl = gpr_avl_add(avl, box(76), box(1736), NULL);
-  avl = gpr_avl_add(avl, box(549), box(1737), NULL);
-  avl = gpr_avl_add(avl, box(757), box(1738), NULL);
-  avl = remove_int(avl, 908);
-  avl = gpr_avl_add(avl, box(789), box(1740), NULL);
-  avl = remove_int(avl, 224);
-  avl = gpr_avl_add(avl, box(407), box(1742), NULL);
-  avl = gpr_avl_add(avl, box(381), box(1743), NULL);
-  avl = gpr_avl_add(avl, box(561), box(1744), NULL);
-  avl = gpr_avl_add(avl, box(667), box(1745), NULL);
-  avl = gpr_avl_add(avl, box(522), box(1746), NULL);
-  avl = gpr_avl_add(avl, box(948), box(1747), NULL);
-  avl = remove_int(avl, 770);
-  avl = gpr_avl_add(avl, box(872), box(1749), NULL);
-  avl = gpr_avl_add(avl, box(327), box(1750), NULL);
-  avl = remove_int(avl, 10);
-  avl = gpr_avl_add(avl, box(122), box(1752), NULL);
-  avl = remove_int(avl, 606);
-  avl = gpr_avl_add(avl, box(485), box(1754), NULL);
-  avl = remove_int(avl, 6);
-  avl = gpr_avl_add(avl, box(329), box(1756), NULL);
-  avl = gpr_avl_add(avl, box(783), box(1757), NULL);
-  avl = remove_int(avl, 416);
-  avl = gpr_avl_add(avl, box(656), box(1759), NULL);
-  avl = gpr_avl_add(avl, box(971), box(1760), NULL);
-  avl = gpr_avl_add(avl, box(77), box(1761), NULL);
-  avl = gpr_avl_add(avl, box(942), box(1762), NULL);
-  avl = remove_int(avl, 361);
-  avl = gpr_avl_add(avl, box(66), box(1764), NULL);
-  avl = gpr_avl_add(avl, box(299), box(1765), NULL);
-  avl = gpr_avl_add(avl, box(929), box(1766), NULL);
-  avl = gpr_avl_add(avl, box(797), box(1767), NULL);
-  avl = remove_int(avl, 869);
-  avl = remove_int(avl, 907);
-  avl = gpr_avl_add(avl, box(870), box(1770), NULL);
-  avl = remove_int(avl, 580);
-  avl = remove_int(avl, 120);
-  avl = gpr_avl_add(avl, box(913), box(1773), NULL);
-  avl = remove_int(avl, 480);
-  avl = gpr_avl_add(avl, box(489), box(1775), NULL);
-  avl = remove_int(avl, 845);
-  avl = gpr_avl_add(avl, box(896), box(1777), NULL);
-  avl = remove_int(avl, 567);
-  avl = remove_int(avl, 427);
-  avl = gpr_avl_add(avl, box(443), box(1780), NULL);
-  avl = gpr_avl_add(avl, box(3), box(1781), NULL);
-  avl = remove_int(avl, 12);
-  avl = gpr_avl_add(avl, box(376), box(1783), NULL);
-  avl = gpr_avl_add(avl, box(155), box(1784), NULL);
-  avl = gpr_avl_add(avl, box(188), box(1785), NULL);
-  avl = gpr_avl_add(avl, box(149), box(1786), NULL);
-  avl = gpr_avl_add(avl, box(178), box(1787), NULL);
-  avl = remove_int(avl, 84);
-  avl = gpr_avl_add(avl, box(805), box(1789), NULL);
-  avl = gpr_avl_add(avl, box(612), box(1790), NULL);
-  avl = remove_int(avl, 991);
-  avl = gpr_avl_add(avl, box(837), box(1792), NULL);
-  avl = remove_int(avl, 173);
-  avl = remove_int(avl, 72);
-  avl = gpr_avl_add(avl, box(1014), box(1795), NULL);
-  avl = remove_int(avl, 303);
-  avl = gpr_avl_add(avl, box(865), box(1797), NULL);
-  avl = gpr_avl_add(avl, box(793), box(1798), NULL);
-  avl = remove_int(avl, 173);
-  avl = remove_int(avl, 477);
-  avl = gpr_avl_add(avl, box(950), box(1801), NULL);
-  avl = gpr_avl_add(avl, box(105), box(1802), NULL);
-  avl = gpr_avl_add(avl, box(895), box(1803), NULL);
-  avl = gpr_avl_add(avl, box(171), box(1804), NULL);
-  avl = gpr_avl_add(avl, box(753), box(1805), NULL);
-  avl = gpr_avl_add(avl, box(946), box(1806), NULL);
-  avl = remove_int(avl, 194);
-  avl = remove_int(avl, 559);
-  avl = remove_int(avl, 116);
-  avl = gpr_avl_add(avl, box(968), box(1810), NULL);
-  avl = remove_int(avl, 124);
-  avl = remove_int(avl, 99);
-  avl = gpr_avl_add(avl, box(563), box(1813), NULL);
-  avl = remove_int(avl, 182);
-  avl = gpr_avl_add(avl, box(816), box(1815), NULL);
-  avl = remove_int(avl, 73);
-  avl = remove_int(avl, 261);
-  avl = gpr_avl_add(avl, box(847), box(1818), NULL);
-  avl = gpr_avl_add(avl, box(368), box(1819), NULL);
-  avl = gpr_avl_add(avl, box(808), box(1820), NULL);
-  avl = gpr_avl_add(avl, box(779), box(1821), NULL);
-  avl = remove_int(avl, 818);
-  avl = gpr_avl_add(avl, box(466), box(1823), NULL);
-  avl = remove_int(avl, 316);
-  avl = gpr_avl_add(avl, box(986), box(1825), NULL);
-  avl = gpr_avl_add(avl, box(688), box(1826), NULL);
-  avl = gpr_avl_add(avl, box(509), box(1827), NULL);
-  avl = gpr_avl_add(avl, box(51), box(1828), NULL);
-  avl = remove_int(avl, 655);
-  avl = remove_int(avl, 785);
-  avl = remove_int(avl, 893);
-  avl = gpr_avl_add(avl, box(167), box(1832), NULL);
-  avl = remove_int(avl, 13);
-  avl = remove_int(avl, 263);
-  avl = gpr_avl_add(avl, box(1009), box(1835), NULL);
-  avl = remove_int(avl, 480);
-  avl = remove_int(avl, 778);
-  avl = remove_int(avl, 713);
-  avl = remove_int(avl, 628);
-  avl = gpr_avl_add(avl, box(803), box(1840), NULL);
-  avl = remove_int(avl, 267);
-  avl = gpr_avl_add(avl, box(676), box(1842), NULL);
-  avl = gpr_avl_add(avl, box(231), box(1843), NULL);
-  avl = gpr_avl_add(avl, box(824), box(1844), NULL);
-  avl = remove_int(avl, 961);
-  avl = gpr_avl_add(avl, box(311), box(1846), NULL);
-  avl = gpr_avl_add(avl, box(420), box(1847), NULL);
-  avl = gpr_avl_add(avl, box(960), box(1848), NULL);
-  avl = gpr_avl_add(avl, box(468), box(1849), NULL);
-  avl = gpr_avl_add(avl, box(815), box(1850), NULL);
-  avl = remove_int(avl, 247);
-  avl = remove_int(avl, 194);
-  avl = gpr_avl_add(avl, box(546), box(1853), NULL);
-  avl = remove_int(avl, 222);
-  avl = remove_int(avl, 914);
-  avl = remove_int(avl, 741);
-  avl = gpr_avl_add(avl, box(470), box(1857), NULL);
-  avl = gpr_avl_add(avl, box(933), box(1858), NULL);
-  avl = gpr_avl_add(avl, box(97), box(1859), NULL);
-  avl = remove_int(avl, 564);
-  avl = remove_int(avl, 295);
-  avl = gpr_avl_add(avl, box(864), box(1862), NULL);
-  avl = remove_int(avl, 329);
-  avl = gpr_avl_add(avl, box(124), box(1864), NULL);
-  avl = gpr_avl_add(avl, box(1000), box(1865), NULL);
-  avl = gpr_avl_add(avl, box(228), box(1866), NULL);
-  avl = gpr_avl_add(avl, box(187), box(1867), NULL);
-  avl = remove_int(avl, 224);
-  avl = remove_int(avl, 306);
-  avl = remove_int(avl, 884);
-  avl = gpr_avl_add(avl, box(449), box(1871), NULL);
-  avl = gpr_avl_add(avl, box(353), box(1872), NULL);
-  avl = gpr_avl_add(avl, box(994), box(1873), NULL);
-  avl = gpr_avl_add(avl, box(596), box(1874), NULL);
-  avl = gpr_avl_add(avl, box(996), box(1875), NULL);
-  avl = gpr_avl_add(avl, box(101), box(1876), NULL);
-  avl = gpr_avl_add(avl, box(1012), box(1877), NULL);
-  avl = gpr_avl_add(avl, box(982), box(1878), NULL);
-  avl = gpr_avl_add(avl, box(742), box(1879), NULL);
-  avl = remove_int(avl, 92);
-  avl = remove_int(avl, 1022);
-  avl = gpr_avl_add(avl, box(941), box(1882), NULL);
-  avl = remove_int(avl, 742);
-  avl = remove_int(avl, 919);
-  avl = gpr_avl_add(avl, box(588), box(1885), NULL);
-  avl = remove_int(avl, 221);
-  avl = gpr_avl_add(avl, box(356), box(1887), NULL);
-  avl = gpr_avl_add(avl, box(932), box(1888), NULL);
-  avl = remove_int(avl, 837);
-  avl = gpr_avl_add(avl, box(394), box(1890), NULL);
-  avl = gpr_avl_add(avl, box(642), box(1891), NULL);
-  avl = gpr_avl_add(avl, box(52), box(1892), NULL);
-  avl = gpr_avl_add(avl, box(437), box(1893), NULL);
-  avl = gpr_avl_add(avl, box(948), box(1894), NULL);
-  avl = gpr_avl_add(avl, box(93), box(1895), NULL);
-  avl = remove_int(avl, 873);
-  avl = remove_int(avl, 336);
-  avl = remove_int(avl, 277);
-  avl = remove_int(avl, 932);
-  avl = gpr_avl_add(avl, box(80), box(1900), NULL);
-  avl = gpr_avl_add(avl, box(952), box(1901), NULL);
-  avl = gpr_avl_add(avl, box(510), box(1902), NULL);
-  avl = remove_int(avl, 876);
-  avl = remove_int(avl, 612);
-  avl = gpr_avl_add(avl, box(923), box(1905), NULL);
-  avl = gpr_avl_add(avl, box(475), box(1906), NULL);
-  avl = remove_int(avl, 478);
-  avl = remove_int(avl, 148);
-  avl = gpr_avl_add(avl, box(538), box(1909), NULL);
-  avl = remove_int(avl, 47);
-  avl = gpr_avl_add(avl, box(89), box(1911), NULL);
-  avl = remove_int(avl, 723);
-  avl = gpr_avl_add(avl, box(687), box(1913), NULL);
-  avl = gpr_avl_add(avl, box(480), box(1914), NULL);
-  avl = gpr_avl_add(avl, box(149), box(1915), NULL);
-  avl = remove_int(avl, 68);
-  avl = remove_int(avl, 862);
-  avl = remove_int(avl, 363);
-  avl = gpr_avl_add(avl, box(996), box(1919), NULL);
-  avl = remove_int(avl, 380);
-  avl = gpr_avl_add(avl, box(957), box(1921), NULL);
-  avl = remove_int(avl, 413);
-  avl = gpr_avl_add(avl, box(360), box(1923), NULL);
-  avl = gpr_avl_add(avl, box(304), box(1924), NULL);
-  avl = gpr_avl_add(avl, box(634), box(1925), NULL);
-  avl = gpr_avl_add(avl, box(506), box(1926), NULL);
-  avl = remove_int(avl, 248);
-  avl = gpr_avl_add(avl, box(124), box(1928), NULL);
-  avl = gpr_avl_add(avl, box(181), box(1929), NULL);
-  avl = remove_int(avl, 507);
-  avl = gpr_avl_add(avl, box(141), box(1931), NULL);
-  avl = remove_int(avl, 409);
-  avl = remove_int(avl, 129);
-  avl = remove_int(avl, 694);
-  avl = remove_int(avl, 723);
-  avl = gpr_avl_add(avl, box(998), box(1936), NULL);
-  avl = gpr_avl_add(avl, box(906), box(1937), NULL);
-  avl = gpr_avl_add(avl, box(44), box(1938), NULL);
-  avl = remove_int(avl, 949);
-  avl = remove_int(avl, 117);
-  avl = gpr_avl_add(avl, box(700), box(1941), NULL);
-  avl = gpr_avl_add(avl, box(258), box(1942), NULL);
-  avl = remove_int(avl, 828);
-  avl = gpr_avl_add(avl, box(860), box(1944), NULL);
-  avl = gpr_avl_add(avl, box(987), box(1945), NULL);
-  avl = gpr_avl_add(avl, box(316), box(1946), NULL);
-  avl = gpr_avl_add(avl, box(919), box(1947), NULL);
-  avl = remove_int(avl, 84);
-  avl = gpr_avl_add(avl, box(473), box(1949), NULL);
-  avl = remove_int(avl, 127);
-  avl = remove_int(avl, 829);
-  avl = remove_int(avl, 829);
-  avl = gpr_avl_add(avl, box(488), box(1953), NULL);
-  avl = gpr_avl_add(avl, box(954), box(1954), NULL);
-  avl = remove_int(avl, 198);
-  avl = remove_int(avl, 972);
-  avl = remove_int(avl, 670);
-  avl = gpr_avl_add(avl, box(822), box(1958), NULL);
-  avl = remove_int(avl, 589);
-  avl = remove_int(avl, 459);
-  avl = gpr_avl_add(avl, box(1003), box(1961), NULL);
-  avl = gpr_avl_add(avl, box(657), box(1962), NULL);
-  avl = gpr_avl_add(avl, box(477), box(1963), NULL);
-  avl = gpr_avl_add(avl, box(923), box(1964), NULL);
-  avl = remove_int(avl, 496);
-  avl = remove_int(avl, 99);
-  avl = gpr_avl_add(avl, box(127), box(1967), NULL);
-  avl = gpr_avl_add(avl, box(1013), box(1968), NULL);
-  avl = gpr_avl_add(avl, box(778), box(1969), NULL);
-  avl = remove_int(avl, 5);
-  avl = remove_int(avl, 990);
-  avl = remove_int(avl, 850);
-  avl = remove_int(avl, 160);
-  avl = remove_int(avl, 86);
-  avl = gpr_avl_add(avl, box(283), box(1975), NULL);
-  avl = remove_int(avl, 278);
-  avl = remove_int(avl, 297);
-  avl = remove_int(avl, 137);
-  avl = remove_int(avl, 653);
-  avl = gpr_avl_add(avl, box(702), box(1980), NULL);
-  avl = remove_int(avl, 63);
-  avl = remove_int(avl, 427);
-  avl = remove_int(avl, 706);
-  avl = remove_int(avl, 806);
-  avl = gpr_avl_add(avl, box(335), box(1985), NULL);
-  avl = gpr_avl_add(avl, box(412), box(1986), NULL);
-  avl = remove_int(avl, 766);
-  avl = remove_int(avl, 937);
-  avl = remove_int(avl, 886);
-  avl = remove_int(avl, 652);
-  avl = gpr_avl_add(avl, box(545), box(1991), NULL);
-  avl = gpr_avl_add(avl, box(408), box(1992), NULL);
-  avl = gpr_avl_add(avl, box(841), box(1993), NULL);
-  avl = remove_int(avl, 593);
-  avl = gpr_avl_add(avl, box(582), box(1995), NULL);
-  avl = gpr_avl_add(avl, box(597), box(1996), NULL);
-  avl = remove_int(avl, 49);
-  avl = remove_int(avl, 835);
-  avl = gpr_avl_add(avl, box(417), box(1999), NULL);
-  avl = gpr_avl_add(avl, box(191), box(2000), NULL);
-  avl = remove_int(avl, 406);
-  avl = gpr_avl_add(avl, box(30), box(2002), NULL);
-  avl = remove_int(avl, 841);
-  avl = remove_int(avl, 50);
-  avl = gpr_avl_add(avl, box(967), box(2005), NULL);
-  avl = gpr_avl_add(avl, box(849), box(2006), NULL);
-  avl = remove_int(avl, 608);
-  avl = gpr_avl_add(avl, box(306), box(2008), NULL);
-  avl = remove_int(avl, 779);
-  avl = gpr_avl_add(avl, box(897), box(2010), NULL);
-  avl = gpr_avl_add(avl, box(147), box(2011), NULL);
-  avl = remove_int(avl, 982);
-  avl = gpr_avl_add(avl, box(470), box(2013), NULL);
-  avl = remove_int(avl, 951);
-  avl = gpr_avl_add(avl, box(388), box(2015), NULL);
-  avl = remove_int(avl, 616);
-  avl = remove_int(avl, 721);
-  avl = remove_int(avl, 942);
-  avl = remove_int(avl, 589);
-  avl = gpr_avl_add(avl, box(218), box(2020), NULL);
-  avl = remove_int(avl, 671);
-  avl = gpr_avl_add(avl, box(1020), box(2022), NULL);
-  avl = remove_int(avl, 277);
-  avl = gpr_avl_add(avl, box(681), box(2024), NULL);
-  avl = gpr_avl_add(avl, box(179), box(2025), NULL);
-  avl = gpr_avl_add(avl, box(370), box(2026), NULL);
-  avl = gpr_avl_add(avl, box(0), box(2027), NULL);
-  avl = remove_int(avl, 523);
-  avl = gpr_avl_add(avl, box(99), box(2029), NULL);
-  avl = gpr_avl_add(avl, box(334), box(2030), NULL);
-  avl = gpr_avl_add(avl, box(569), box(2031), NULL);
-  avl = gpr_avl_add(avl, box(257), box(2032), NULL);
-  avl = remove_int(avl, 572);
-  avl = gpr_avl_add(avl, box(805), box(2034), NULL);
-  avl = gpr_avl_add(avl, box(143), box(2035), NULL);
-  avl = gpr_avl_add(avl, box(670), box(2036), NULL);
-  avl = remove_int(avl, 42);
-  avl = gpr_avl_add(avl, box(46), box(2038), NULL);
-  avl = remove_int(avl, 970);
-  avl = gpr_avl_add(avl, box(353), box(2040), NULL);
-  avl = remove_int(avl, 258);
-  avl = gpr_avl_add(avl, box(451), box(2042), NULL);
-  avl = gpr_avl_add(avl, box(28), box(2043), NULL);
-  avl = gpr_avl_add(avl, box(729), box(2044), NULL);
-  avl = gpr_avl_add(avl, box(401), box(2045), NULL);
-  avl = gpr_avl_add(avl, box(614), box(2046), NULL);
-  avl = remove_int(avl, 990);
-  avl = remove_int(avl, 212);
-  avl = remove_int(avl, 22);
-  avl = remove_int(avl, 677);
-  avl = gpr_avl_add(avl, box(1016), box(2051), NULL);
-  avl = gpr_avl_add(avl, box(980), box(2052), NULL);
-  avl = gpr_avl_add(avl, box(990), box(2053), NULL);
-  avl = gpr_avl_add(avl, box(355), box(2054), NULL);
-  avl = remove_int(avl, 730);
-  avl = remove_int(avl, 37);
-  avl = gpr_avl_add(avl, box(407), box(2057), NULL);
-  avl = gpr_avl_add(avl, box(222), box(2058), NULL);
-  avl = gpr_avl_add(avl, box(439), box(2059), NULL);
-  avl = gpr_avl_add(avl, box(563), box(2060), NULL);
-  avl = remove_int(avl, 992);
-  avl = remove_int(avl, 786);
-  avl = gpr_avl_add(avl, box(1), box(2063), NULL);
-  avl = gpr_avl_add(avl, box(473), box(2064), NULL);
-  avl = gpr_avl_add(avl, box(992), box(2065), NULL);
-  avl = remove_int(avl, 190);
-  avl = remove_int(avl, 450);
-  avl = remove_int(avl, 1020);
-  avl = remove_int(avl, 149);
-  avl = gpr_avl_add(avl, box(329), box(2070), NULL);
-  avl = gpr_avl_add(avl, box(35), box(2071), NULL);
-  avl = remove_int(avl, 843);
-  avl = gpr_avl_add(avl, box(855), box(2073), NULL);
-  avl = remove_int(avl, 878);
-  avl = gpr_avl_add(avl, box(993), box(2075), NULL);
-  avl = gpr_avl_add(avl, box(87), box(2076), NULL);
-  avl = gpr_avl_add(avl, box(572), box(2077), NULL);
-  avl = remove_int(avl, 896);
-  avl = gpr_avl_add(avl, box(849), box(2079), NULL);
-  avl = remove_int(avl, 597);
-  avl = gpr_avl_add(avl, box(472), box(2081), NULL);
-  avl = remove_int(avl, 778);
-  avl = remove_int(avl, 934);
-  avl = remove_int(avl, 314);
-  avl = gpr_avl_add(avl, box(101), box(2085), NULL);
-  avl = remove_int(avl, 938);
-  avl = remove_int(avl, 1010);
-  avl = gpr_avl_add(avl, box(579), box(2088), NULL);
-  avl = remove_int(avl, 798);
-  avl = remove_int(avl, 88);
-  avl = gpr_avl_add(avl, box(851), box(2091), NULL);
-  avl = remove_int(avl, 705);
-  avl = gpr_avl_add(avl, box(26), box(2093), NULL);
-  avl = remove_int(avl, 973);
-  avl = gpr_avl_add(avl, box(923), box(2095), NULL);
-  avl = remove_int(avl, 668);
-  avl = gpr_avl_add(avl, box(310), box(2097), NULL);
-  avl = gpr_avl_add(avl, box(269), box(2098), NULL);
-  avl = remove_int(avl, 173);
-  avl = gpr_avl_add(avl, box(279), box(2100), NULL);
-  avl = remove_int(avl, 203);
-  avl = gpr_avl_add(avl, box(411), box(2102), NULL);
-  avl = remove_int(avl, 950);
-  avl = gpr_avl_add(avl, box(6), box(2104), NULL);
-  avl = remove_int(avl, 400);
-  avl = remove_int(avl, 468);
-  avl = remove_int(avl, 271);
-  avl = gpr_avl_add(avl, box(627), box(2108), NULL);
-  avl = remove_int(avl, 727);
-  avl = remove_int(avl, 148);
-  avl = remove_int(avl, 98);
-  avl = remove_int(avl, 997);
-  avl = remove_int(avl, 215);
-  avl = remove_int(avl, 628);
-  avl = remove_int(avl, 826);
-  avl = remove_int(avl, 664);
-  avl = gpr_avl_add(avl, box(76), box(2117), NULL);
-  avl = remove_int(avl, 194);
-  avl = remove_int(avl, 18);
-  avl = gpr_avl_add(avl, box(727), box(2120), NULL);
-  avl = remove_int(avl, 295);
-  avl = gpr_avl_add(avl, box(645), box(2122), NULL);
-  avl = remove_int(avl, 321);
-  avl = remove_int(avl, 863);
-  avl = gpr_avl_add(avl, box(824), box(2125), NULL);
-  avl = gpr_avl_add(avl, box(651), box(2126), NULL);
-  avl = gpr_avl_add(avl, box(804), box(2127), NULL);
-  avl = remove_int(avl, 307);
-  avl = gpr_avl_add(avl, box(867), box(2129), NULL);
-  avl = remove_int(avl, 384);
-  avl = gpr_avl_add(avl, box(819), box(2131), NULL);
-  avl = remove_int(avl, 674);
-  avl = gpr_avl_add(avl, box(76), box(2133), NULL);
-  avl = remove_int(avl, 898);
-  avl = gpr_avl_add(avl, box(45), box(2135), NULL);
-  avl = gpr_avl_add(avl, box(512), box(2136), NULL);
-  avl = remove_int(avl, 773);
-  avl = remove_int(avl, 907);
-  avl = remove_int(avl, 382);
-  avl = remove_int(avl, 95);
-  avl = remove_int(avl, 734);
-  avl = remove_int(avl, 81);
-  avl = gpr_avl_add(avl, box(348), box(2143), NULL);
-  avl = remove_int(avl, 509);
-  avl = remove_int(avl, 301);
-  avl = gpr_avl_add(avl, box(861), box(2146), NULL);
-  avl = gpr_avl_add(avl, box(918), box(2147), NULL);
-  avl = remove_int(avl, 992);
-  avl = gpr_avl_add(avl, box(356), box(2149), NULL);
-  avl = remove_int(avl, 64);
-  avl = remove_int(avl, 444);
-  avl = remove_int(avl, 741);
-  avl = gpr_avl_add(avl, box(710), box(2153), NULL);
-  avl = gpr_avl_add(avl, box(264), box(2154), NULL);
-  avl = remove_int(avl, 347);
-  avl = remove_int(avl, 250);
-  avl = gpr_avl_add(avl, box(82), box(2157), NULL);
-  avl = gpr_avl_add(avl, box(571), box(2158), NULL);
-  avl = remove_int(avl, 721);
-  avl = remove_int(avl, 622);
-  avl = gpr_avl_add(avl, box(950), box(2161), NULL);
-  avl = gpr_avl_add(avl, box(94), box(2162), NULL);
-  avl = remove_int(avl, 970);
-  avl = gpr_avl_add(avl, box(815), box(2164), NULL);
-  avl = remove_int(avl, 930);
-  avl = remove_int(avl, 703);
-  avl = gpr_avl_add(avl, box(432), box(2167), NULL);
-  avl = remove_int(avl, 544);
-  avl = gpr_avl_add(avl, box(21), box(2169), NULL);
-  avl = gpr_avl_add(avl, box(186), box(2170), NULL);
-  avl = remove_int(avl, 143);
-  avl = gpr_avl_add(avl, box(425), box(2172), NULL);
-  avl = remove_int(avl, 769);
-  avl = gpr_avl_add(avl, box(656), box(2174), NULL);
-  avl = remove_int(avl, 29);
-  avl = gpr_avl_add(avl, box(464), box(2176), NULL);
-  avl = remove_int(avl, 713);
-  avl = gpr_avl_add(avl, box(800), box(2178), NULL);
-  avl = remove_int(avl, 621);
-  avl = gpr_avl_add(avl, box(962), box(2180), NULL);
-  avl = remove_int(avl, 448);
-  avl = gpr_avl_add(avl, box(878), box(2182), NULL);
-  avl = remove_int(avl, 39);
-  avl = remove_int(avl, 999);
-  avl = gpr_avl_add(avl, box(182), box(2185), NULL);
-  avl = gpr_avl_add(avl, box(429), box(2186), NULL);
-  avl = gpr_avl_add(avl, box(598), box(2187), NULL);
-  avl = remove_int(avl, 551);
-  avl = gpr_avl_add(avl, box(827), box(2189), NULL);
-  avl = gpr_avl_add(avl, box(809), box(2190), NULL);
-  avl = remove_int(avl, 438);
-  avl = remove_int(avl, 811);
-  avl = gpr_avl_add(avl, box(808), box(2193), NULL);
-  avl = gpr_avl_add(avl, box(788), box(2194), NULL);
-  avl = remove_int(avl, 156);
-  avl = gpr_avl_add(avl, box(933), box(2196), NULL);
-  avl = gpr_avl_add(avl, box(344), box(2197), NULL);
-  avl = remove_int(avl, 460);
-  avl = gpr_avl_add(avl, box(161), box(2199), NULL);
-  avl = gpr_avl_add(avl, box(444), box(2200), NULL);
-  avl = remove_int(avl, 597);
-  avl = remove_int(avl, 668);
-  avl = gpr_avl_add(avl, box(703), box(2203), NULL);
-  avl = remove_int(avl, 515);
-  avl = gpr_avl_add(avl, box(380), box(2205), NULL);
-  avl = gpr_avl_add(avl, box(338), box(2206), NULL);
-  avl = remove_int(avl, 550);
-  avl = remove_int(avl, 946);
-  avl = remove_int(avl, 714);
-  avl = remove_int(avl, 739);
-  avl = gpr_avl_add(avl, box(413), box(2211), NULL);
-  avl = remove_int(avl, 450);
-  avl = gpr_avl_add(avl, box(411), box(2213), NULL);
-  avl = gpr_avl_add(avl, box(117), box(2214), NULL);
-  avl = gpr_avl_add(avl, box(322), box(2215), NULL);
-  avl = gpr_avl_add(avl, box(915), box(2216), NULL);
-  avl = gpr_avl_add(avl, box(410), box(2217), NULL);
-  avl = gpr_avl_add(avl, box(66), box(2218), NULL);
-  avl = remove_int(avl, 756);
-  avl = remove_int(avl, 596);
-  avl = gpr_avl_add(avl, box(882), box(2221), NULL);
-  avl = gpr_avl_add(avl, box(930), box(2222), NULL);
-  avl = gpr_avl_add(avl, box(36), box(2223), NULL);
-  avl = remove_int(avl, 742);
-  avl = gpr_avl_add(avl, box(539), box(2225), NULL);
-  avl = gpr_avl_add(avl, box(596), box(2226), NULL);
-  avl = remove_int(avl, 82);
-  avl = remove_int(avl, 686);
-  avl = remove_int(avl, 933);
-  avl = remove_int(avl, 42);
-  avl = remove_int(avl, 340);
-  avl = gpr_avl_add(avl, box(126), box(2232), NULL);
-  avl = gpr_avl_add(avl, box(493), box(2233), NULL);
-  avl = gpr_avl_add(avl, box(839), box(2234), NULL);
-  avl = remove_int(avl, 774);
-  avl = gpr_avl_add(avl, box(337), box(2236), NULL);
-  avl = remove_int(avl, 322);
-  avl = gpr_avl_add(avl, box(16), box(2238), NULL);
-  avl = remove_int(avl, 73);
-  avl = remove_int(avl, 85);
-  avl = remove_int(avl, 191);
-  avl = remove_int(avl, 541);
-  avl = gpr_avl_add(avl, box(704), box(2243), NULL);
-  avl = remove_int(avl, 767);
-  avl = remove_int(avl, 1006);
-  avl = remove_int(avl, 844);
-  avl = remove_int(avl, 742);
-  avl = gpr_avl_add(avl, box(48), box(2248), NULL);
-  avl = gpr_avl_add(avl, box(138), box(2249), NULL);
-  avl = gpr_avl_add(avl, box(437), box(2250), NULL);
-  avl = gpr_avl_add(avl, box(275), box(2251), NULL);
-  avl = remove_int(avl, 520);
-  avl = gpr_avl_add(avl, box(1019), box(2253), NULL);
-  avl = remove_int(avl, 955);
-  avl = gpr_avl_add(avl, box(270), box(2255), NULL);
-  avl = remove_int(avl, 680);
-  avl = remove_int(avl, 698);
-  avl = gpr_avl_add(avl, box(735), box(2258), NULL);
-  avl = gpr_avl_add(avl, box(400), box(2259), NULL);
-  avl = remove_int(avl, 991);
-  avl = gpr_avl_add(avl, box(263), box(2261), NULL);
-  avl = remove_int(avl, 704);
-  avl = gpr_avl_add(avl, box(757), box(2263), NULL);
-  avl = remove_int(avl, 194);
-  avl = remove_int(avl, 616);
-  avl = remove_int(avl, 784);
-  avl = gpr_avl_add(avl, box(382), box(2267), NULL);
-  avl = gpr_avl_add(avl, box(464), box(2268), NULL);
-  avl = gpr_avl_add(avl, box(817), box(2269), NULL);
-  avl = remove_int(avl, 445);
-  avl = gpr_avl_add(avl, box(412), box(2271), NULL);
-  avl = remove_int(avl, 525);
-  avl = gpr_avl_add(avl, box(299), box(2273), NULL);
-  avl = gpr_avl_add(avl, box(464), box(2274), NULL);
-  avl = gpr_avl_add(avl, box(715), box(2275), NULL);
-  avl = remove_int(avl, 58);
-  avl = remove_int(avl, 218);
-  avl = gpr_avl_add(avl, box(961), box(2278), NULL);
-  avl = gpr_avl_add(avl, box(491), box(2279), NULL);
-  avl = remove_int(avl, 846);
-  avl = gpr_avl_add(avl, box(762), box(2281), NULL);
-  avl = remove_int(avl, 974);
-  avl = remove_int(avl, 887);
-  avl = gpr_avl_add(avl, box(498), box(2284), NULL);
-  avl = remove_int(avl, 810);
-  avl = remove_int(avl, 743);
-  avl = remove_int(avl, 22);
-  avl = remove_int(avl, 284);
-  avl = gpr_avl_add(avl, box(482), box(2289), NULL);
-  avl = gpr_avl_add(avl, box(1021), box(2290), NULL);
-  avl = remove_int(avl, 155);
-  avl = remove_int(avl, 128);
-  avl = gpr_avl_add(avl, box(819), box(2293), NULL);
-  avl = gpr_avl_add(avl, box(324), box(2294), NULL);
-  avl = remove_int(avl, 196);
-  avl = remove_int(avl, 370);
-  avl = remove_int(avl, 753);
-  avl = remove_int(avl, 56);
-  avl = remove_int(avl, 735);
-  avl = gpr_avl_add(avl, box(272), box(2300), NULL);
-  avl = gpr_avl_add(avl, box(474), box(2301), NULL);
-  avl = gpr_avl_add(avl, box(719), box(2302), NULL);
-  avl = gpr_avl_add(avl, box(236), box(2303), NULL);
-  avl = remove_int(avl, 818);
-  avl = gpr_avl_add(avl, box(727), box(2305), NULL);
-  avl = remove_int(avl, 892);
-  avl = remove_int(avl, 871);
-  avl = remove_int(avl, 231);
-  avl = gpr_avl_add(avl, box(62), box(2309), NULL);
-  avl = gpr_avl_add(avl, box(953), box(2310), NULL);
-  avl = remove_int(avl, 701);
-  avl = gpr_avl_add(avl, box(193), box(2312), NULL);
-  avl = remove_int(avl, 619);
-  avl = remove_int(avl, 22);
-  avl = remove_int(avl, 804);
-  avl = remove_int(avl, 851);
-  avl = gpr_avl_add(avl, box(286), box(2317), NULL);
-  avl = gpr_avl_add(avl, box(751), box(2318), NULL);
-  avl = remove_int(avl, 525);
-  avl = gpr_avl_add(avl, box(217), box(2320), NULL);
-  avl = remove_int(avl, 336);
-  avl = gpr_avl_add(avl, box(86), box(2322), NULL);
-  avl = gpr_avl_add(avl, box(81), box(2323), NULL);
-  avl = gpr_avl_add(avl, box(850), box(2324), NULL);
-  avl = remove_int(avl, 872);
-  avl = gpr_avl_add(avl, box(402), box(2326), NULL);
-  avl = gpr_avl_add(avl, box(54), box(2327), NULL);
-  avl = gpr_avl_add(avl, box(980), box(2328), NULL);
-  avl = gpr_avl_add(avl, box(845), box(2329), NULL);
-  avl = remove_int(avl, 1004);
-  avl = remove_int(avl, 273);
-  avl = remove_int(avl, 879);
-  avl = gpr_avl_add(avl, box(354), box(2333), NULL);
-  avl = gpr_avl_add(avl, box(58), box(2334), NULL);
-  avl = gpr_avl_add(avl, box(127), box(2335), NULL);
-  avl = remove_int(avl, 84);
-  avl = gpr_avl_add(avl, box(360), box(2337), NULL);
-  avl = remove_int(avl, 648);
-  avl = remove_int(avl, 488);
-  avl = remove_int(avl, 585);
-  avl = remove_int(avl, 230);
-  avl = gpr_avl_add(avl, box(887), box(2342), NULL);
-  avl = remove_int(avl, 558);
-  avl = remove_int(avl, 958);
-  avl = gpr_avl_add(avl, box(822), box(2345), NULL);
-  avl = remove_int(avl, 1004);
-  avl = remove_int(avl, 747);
-  avl = gpr_avl_add(avl, box(631), box(2348), NULL);
-  avl = gpr_avl_add(avl, box(442), box(2349), NULL);
-  avl = remove_int(avl, 957);
-  avl = remove_int(avl, 964);
-  avl = gpr_avl_add(avl, box(10), box(2352), NULL);
-  avl = remove_int(avl, 189);
-  avl = gpr_avl_add(avl, box(742), box(2354), NULL);
-  avl = remove_int(avl, 108);
-  avl = gpr_avl_add(avl, box(1014), box(2356), NULL);
-  avl = remove_int(avl, 266);
-  avl = remove_int(avl, 623);
-  avl = remove_int(avl, 697);
-  avl = gpr_avl_add(avl, box(180), box(2360), NULL);
-  avl = remove_int(avl, 472);
-  avl = gpr_avl_add(avl, box(567), box(2362), NULL);
-  avl = remove_int(avl, 1020);
-  avl = remove_int(avl, 273);
-  avl = gpr_avl_add(avl, box(864), box(2365), NULL);
-  avl = gpr_avl_add(avl, box(1009), box(2366), NULL);
-  avl = remove_int(avl, 224);
-  avl = remove_int(avl, 81);
-  avl = gpr_avl_add(avl, box(653), box(2369), NULL);
-  avl = remove_int(avl, 67);
-  avl = remove_int(avl, 102);
-  avl = remove_int(avl, 76);
-  avl = remove_int(avl, 935);
-  avl = remove_int(avl, 169);
-  avl = remove_int(avl, 232);
-  avl = remove_int(avl, 79);
-  avl = gpr_avl_add(avl, box(509), box(2377), NULL);
-  avl = remove_int(avl, 900);
-  avl = remove_int(avl, 822);
-  avl = remove_int(avl, 945);
-  avl = remove_int(avl, 356);
-  avl = gpr_avl_add(avl, box(443), box(2382), NULL);
-  avl = gpr_avl_add(avl, box(925), box(2383), NULL);
-  avl = remove_int(avl, 994);
-  avl = remove_int(avl, 324);
-  avl = gpr_avl_add(avl, box(291), box(2386), NULL);
-  avl = remove_int(avl, 94);
-  avl = remove_int(avl, 795);
-  avl = remove_int(avl, 42);
-  avl = gpr_avl_add(avl, box(613), box(2390), NULL);
-  avl = remove_int(avl, 289);
-  avl = gpr_avl_add(avl, box(980), box(2392), NULL);
-  avl = remove_int(avl, 316);
-  avl = gpr_avl_add(avl, box(281), box(2394), NULL);
-  avl = gpr_avl_add(avl, box(1006), box(2395), NULL);
-  avl = remove_int(avl, 776);
-  avl = gpr_avl_add(avl, box(108), box(2397), NULL);
-  avl = gpr_avl_add(avl, box(918), box(2398), NULL);
-  avl = remove_int(avl, 721);
-  avl = remove_int(avl, 563);
-  avl = gpr_avl_add(avl, box(925), box(2401), NULL);
-  avl = remove_int(avl, 448);
-  avl = remove_int(avl, 198);
-  avl = remove_int(avl, 1);
-  avl = gpr_avl_add(avl, box(160), box(2405), NULL);
-  avl = remove_int(avl, 515);
-  avl = gpr_avl_add(avl, box(284), box(2407), NULL);
-  avl = gpr_avl_add(avl, box(225), box(2408), NULL);
-  avl = remove_int(avl, 304);
-  avl = gpr_avl_add(avl, box(714), box(2410), NULL);
-  avl = gpr_avl_add(avl, box(708), box(2411), NULL);
-  avl = gpr_avl_add(avl, box(624), box(2412), NULL);
-  avl = remove_int(avl, 662);
-  avl = remove_int(avl, 825);
-  avl = remove_int(avl, 383);
-  avl = remove_int(avl, 381);
-  avl = gpr_avl_add(avl, box(194), box(2417), NULL);
-  avl = remove_int(avl, 280);
-  avl = remove_int(avl, 25);
-  avl = remove_int(avl, 633);
-  avl = gpr_avl_add(avl, box(897), box(2421), NULL);
-  avl = remove_int(avl, 636);
-  avl = remove_int(avl, 596);
-  avl = remove_int(avl, 757);
-  avl = remove_int(avl, 343);
-  avl = remove_int(avl, 162);
-  avl = remove_int(avl, 913);
-  avl = remove_int(avl, 843);
-  avl = remove_int(avl, 280);
-  avl = remove_int(avl, 911);
-  avl = gpr_avl_add(avl, box(1008), box(2431), NULL);
-  avl = remove_int(avl, 948);
-  avl = remove_int(avl, 74);
-  avl = remove_int(avl, 571);
-  avl = gpr_avl_add(avl, box(486), box(2435), NULL);
-  avl = gpr_avl_add(avl, box(285), box(2436), NULL);
-  avl = remove_int(avl, 304);
-  avl = remove_int(avl, 516);
-  avl = gpr_avl_add(avl, box(758), box(2439), NULL);
-  avl = gpr_avl_add(avl, box(776), box(2440), NULL);
-  avl = remove_int(avl, 696);
-  avl = gpr_avl_add(avl, box(104), box(2442), NULL);
-  avl = gpr_avl_add(avl, box(700), box(2443), NULL);
-  avl = gpr_avl_add(avl, box(114), box(2444), NULL);
-  avl = gpr_avl_add(avl, box(567), box(2445), NULL);
-  avl = remove_int(avl, 620);
-  avl = gpr_avl_add(avl, box(270), box(2447), NULL);
-  avl = remove_int(avl, 730);
-  avl = gpr_avl_add(avl, box(749), box(2449), NULL);
-  avl = gpr_avl_add(avl, box(443), box(2450), NULL);
-  avl = remove_int(avl, 457);
-  avl = gpr_avl_add(avl, box(571), box(2452), NULL);
-  avl = gpr_avl_add(avl, box(626), box(2453), NULL);
-  avl = remove_int(avl, 638);
-  avl = remove_int(avl, 313);
-
-  gpr_avl_unref(avl, NULL);
-}
-
-static void test_stress(int amount_of_stress) {
-  int added[1024];
-  int i, j;
-  int deletions = 0;
-  gpr_avl avl;
-
-  unsigned seed = (unsigned)time(NULL);
-
-  gpr_log(GPR_DEBUG, "test_stress amount=%d seed=%u", amount_of_stress, seed);
-
-  srand((unsigned)time(NULL));
-  avl = gpr_avl_create(&int_int_vtable);
-
-  memset(added, 0, sizeof(added));
-
-  for (i = 1; deletions < amount_of_stress; i++) {
-    int idx = rand() % (int)GPR_ARRAY_SIZE(added);
-    GPR_ASSERT(i);
-    if (rand() < RAND_MAX / 2) {
-      added[idx] = i;
-      printf("avl = gpr_avl_add(avl, box(%d), box(%d), NULL); /* d=%d */\n",
-             idx, i, deletions);
-      avl = gpr_avl_add(avl, box(idx), box(i), NULL);
-    } else {
-      deletions += (added[idx] != 0);
-      added[idx] = 0;
-      printf("avl = remove_int(avl, %d); /* d=%d */\n", idx, deletions);
-      avl = remove_int(avl, idx);
-    }
-    for (j = 0; j < (int)GPR_ARRAY_SIZE(added); j++) {
-      if (added[j] != 0) {
-        check_get(avl, j, added[j]);
-      } else {
-        check_negget(avl, j);
-      }
-    }
-  }
-
-  gpr_avl_unref(avl, NULL);
-}
-
-int main(int argc, char *argv[]) {
-  grpc_test_init(argc, argv);
-
-  test_get();
-  test_ll();
-  test_lr();
-  test_rr();
-  test_rl();
-  test_unbalanced();
-  test_replace();
-  test_remove();
-  test_badcase1();
-  test_badcase2();
-  test_badcase3();
-  test_stress(10);
-
-  return 0;
-}
diff --git a/test/core/support/avl_test.cc b/test/core/support/avl_test.cc
new file mode 100644
index 0000000..cd3a852
--- /dev/null
+++ b/test/core/support/avl_test.cc
@@ -0,0 +1,3659 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/avl.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "test/core/util/test_config.h"
+
+static int* box(int x) {
+  int* b = static_cast<int*>(gpr_malloc(sizeof(*b)));
+  *b = x;
+  return b;
+}
+
+static long int_compare(void* int1, void* int2, void* unused) {
+  return (*(int*)int1) - (*(int*)int2);
+}
+static void* int_copy(void* p, void* unused) { return box(*(int*)p); }
+
+static void destroy(void* p, void* unused) { gpr_free(p); }
+
+static const gpr_avl_vtable int_int_vtable = {destroy, int_copy, int_compare,
+                                              destroy, int_copy};
+
+static void check_get(gpr_avl avl, int key, int value) {
+  int* k = box(key);
+  GPR_ASSERT(*(int*)gpr_avl_get(avl, k, NULL) == value);
+  gpr_free(k);
+}
+
+static void check_negget(gpr_avl avl, int key) {
+  int* k = box(key);
+  GPR_ASSERT(gpr_avl_get(avl, k, NULL) == NULL);
+  gpr_free(k);
+}
+
+static gpr_avl remove_int(gpr_avl avl, int key) {
+  int* k = box(key);
+  avl = gpr_avl_remove(avl, k, NULL);
+  gpr_free(k);
+  return avl;
+}
+
+static void test_get(void) {
+  gpr_avl avl;
+  gpr_log(GPR_DEBUG, "test_get");
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(1), box(11), NULL);
+  avl = gpr_avl_add(avl, box(2), box(22), NULL);
+  avl = gpr_avl_add(avl, box(3), box(33), NULL);
+  check_get(avl, 1, 11);
+  check_get(avl, 2, 22);
+  check_get(avl, 3, 33);
+  check_negget(avl, 4);
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_ll(void) {
+  gpr_avl avl;
+  gpr_log(GPR_DEBUG, "test_ll");
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(5), box(1), NULL);
+  avl = gpr_avl_add(avl, box(4), box(2), NULL);
+  avl = gpr_avl_add(avl, box(3), box(3), NULL);
+  GPR_ASSERT(*(int*)avl.root->key == 4);
+  GPR_ASSERT(*(int*)avl.root->left->key == 3);
+  GPR_ASSERT(*(int*)avl.root->right->key == 5);
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_lr(void) {
+  gpr_avl avl;
+  gpr_log(GPR_DEBUG, "test_lr");
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(5), box(1), NULL);
+  avl = gpr_avl_add(avl, box(3), box(2), NULL);
+  avl = gpr_avl_add(avl, box(4), box(3), NULL);
+  GPR_ASSERT(*(int*)avl.root->key == 4);
+  GPR_ASSERT(*(int*)avl.root->left->key == 3);
+  GPR_ASSERT(*(int*)avl.root->right->key == 5);
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_rr(void) {
+  gpr_avl avl;
+  gpr_log(GPR_DEBUG, "test_rr");
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(3), box(1), NULL);
+  avl = gpr_avl_add(avl, box(4), box(2), NULL);
+  avl = gpr_avl_add(avl, box(5), box(3), NULL);
+  GPR_ASSERT(*(int*)avl.root->key == 4);
+  GPR_ASSERT(*(int*)avl.root->left->key == 3);
+  GPR_ASSERT(*(int*)avl.root->right->key == 5);
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_rl(void) {
+  gpr_avl avl;
+  gpr_log(GPR_DEBUG, "test_rl");
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(3), box(1), NULL);
+  avl = gpr_avl_add(avl, box(5), box(2), NULL);
+  avl = gpr_avl_add(avl, box(4), box(3), NULL);
+  GPR_ASSERT(*(int*)avl.root->key == 4);
+  GPR_ASSERT(*(int*)avl.root->left->key == 3);
+  GPR_ASSERT(*(int*)avl.root->right->key == 5);
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_unbalanced(void) {
+  gpr_avl avl;
+  gpr_log(GPR_DEBUG, "test_unbalanced");
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(5), box(1), NULL);
+  avl = gpr_avl_add(avl, box(4), box(2), NULL);
+  avl = gpr_avl_add(avl, box(3), box(3), NULL);
+  avl = gpr_avl_add(avl, box(2), box(4), NULL);
+  avl = gpr_avl_add(avl, box(1), box(5), NULL);
+  GPR_ASSERT(*(int*)avl.root->key == 4);
+  GPR_ASSERT(*(int*)avl.root->left->key == 2);
+  GPR_ASSERT(*(int*)avl.root->left->left->key == 1);
+  GPR_ASSERT(*(int*)avl.root->left->right->key == 3);
+  GPR_ASSERT(*(int*)avl.root->right->key == 5);
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_replace(void) {
+  gpr_avl avl;
+  gpr_log(GPR_DEBUG, "test_replace");
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(1), box(1), NULL);
+  avl = gpr_avl_add(avl, box(1), box(2), NULL);
+  check_get(avl, 1, 2);
+  check_negget(avl, 2);
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_remove(void) {
+  gpr_avl avl;
+  gpr_avl avl3, avl4, avl5, avln;
+  gpr_log(GPR_DEBUG, "test_remove");
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(3), box(1), NULL);
+  avl = gpr_avl_add(avl, box(4), box(2), NULL);
+  avl = gpr_avl_add(avl, box(5), box(3), NULL);
+
+  avl3 = remove_int(gpr_avl_ref(avl, NULL), 3);
+  avl4 = remove_int(gpr_avl_ref(avl, NULL), 4);
+  avl5 = remove_int(gpr_avl_ref(avl, NULL), 5);
+  avln = remove_int(gpr_avl_ref(avl, NULL), 1);
+
+  gpr_avl_unref(avl, NULL);
+
+  check_negget(avl3, 3);
+  check_get(avl3, 4, 2);
+  check_get(avl3, 5, 3);
+  gpr_avl_unref(avl3, NULL);
+
+  check_get(avl4, 3, 1);
+  check_negget(avl4, 4);
+  check_get(avl4, 5, 3);
+  gpr_avl_unref(avl4, NULL);
+
+  check_get(avl5, 3, 1);
+  check_get(avl5, 4, 2);
+  check_negget(avl5, 5);
+  gpr_avl_unref(avl5, NULL);
+
+  check_get(avln, 3, 1);
+  check_get(avln, 4, 2);
+  check_get(avln, 5, 3);
+  gpr_avl_unref(avln, NULL);
+}
+
+static void test_badcase1(void) {
+  gpr_avl avl;
+
+  gpr_log(GPR_DEBUG, "test_badcase1");
+
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(88), box(1), NULL);
+  avl = remove_int(avl, 643);
+  avl = remove_int(avl, 983);
+  avl = gpr_avl_add(avl, box(985), box(4), NULL);
+  avl = gpr_avl_add(avl, box(640), box(5), NULL);
+  avl = gpr_avl_add(avl, box(41), box(6), NULL);
+  avl = gpr_avl_add(avl, box(112), box(7), NULL);
+  avl = gpr_avl_add(avl, box(342), box(8), NULL);
+  avl = remove_int(avl, 1013);
+  avl = gpr_avl_add(avl, box(434), box(10), NULL);
+  avl = gpr_avl_add(avl, box(520), box(11), NULL);
+  avl = gpr_avl_add(avl, box(231), box(12), NULL);
+  avl = gpr_avl_add(avl, box(852), box(13), NULL);
+  avl = remove_int(avl, 461);
+  avl = gpr_avl_add(avl, box(108), box(15), NULL);
+  avl = gpr_avl_add(avl, box(806), box(16), NULL);
+  avl = gpr_avl_add(avl, box(827), box(17), NULL);
+  avl = remove_int(avl, 796);
+  avl = gpr_avl_add(avl, box(340), box(19), NULL);
+  avl = gpr_avl_add(avl, box(498), box(20), NULL);
+  avl = gpr_avl_add(avl, box(203), box(21), NULL);
+  avl = gpr_avl_add(avl, box(751), box(22), NULL);
+  avl = gpr_avl_add(avl, box(150), box(23), NULL);
+  avl = remove_int(avl, 237);
+  avl = gpr_avl_add(avl, box(830), box(25), NULL);
+  avl = remove_int(avl, 1007);
+  avl = remove_int(avl, 394);
+  avl = gpr_avl_add(avl, box(65), box(28), NULL);
+  avl = remove_int(avl, 904);
+  avl = remove_int(avl, 123);
+  avl = gpr_avl_add(avl, box(238), box(31), NULL);
+  avl = gpr_avl_add(avl, box(184), box(32), NULL);
+  avl = remove_int(avl, 331);
+  avl = gpr_avl_add(avl, box(827), box(34), NULL);
+
+  check_get(avl, 830, 25);
+
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_badcase2(void) {
+  gpr_avl avl;
+
+  gpr_log(GPR_DEBUG, "test_badcase2");
+
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = gpr_avl_add(avl, box(288), box(1), NULL);
+  avl = remove_int(avl, 415);
+  avl = gpr_avl_add(avl, box(953), box(3), NULL);
+  avl = gpr_avl_add(avl, box(101), box(4), NULL);
+  avl = gpr_avl_add(avl, box(516), box(5), NULL);
+  avl = gpr_avl_add(avl, box(547), box(6), NULL);
+  avl = gpr_avl_add(avl, box(467), box(7), NULL);
+  avl = gpr_avl_add(avl, box(793), box(8), NULL);
+  avl = remove_int(avl, 190);
+  avl = gpr_avl_add(avl, box(687), box(10), NULL);
+  avl = gpr_avl_add(avl, box(242), box(11), NULL);
+  avl = gpr_avl_add(avl, box(142), box(12), NULL);
+  avl = remove_int(avl, 705);
+  avl = remove_int(avl, 578);
+  avl = remove_int(avl, 767);
+  avl = remove_int(avl, 183);
+  avl = gpr_avl_add(avl, box(950), box(17), NULL);
+  avl = gpr_avl_add(avl, box(622), box(18), NULL);
+  avl = remove_int(avl, 513);
+  avl = remove_int(avl, 429);
+  avl = gpr_avl_add(avl, box(205), box(21), NULL);
+  avl = remove_int(avl, 663);
+  avl = remove_int(avl, 953);
+  avl = remove_int(avl, 892);
+  avl = gpr_avl_add(avl, box(236), box(25), NULL);
+  avl = remove_int(avl, 982);
+  avl = remove_int(avl, 201);
+  avl = remove_int(avl, 684);
+  avl = gpr_avl_add(avl, box(572), box(29), NULL);
+  avl = remove_int(avl, 817);
+  avl = gpr_avl_add(avl, box(970), box(31), NULL);
+  avl = remove_int(avl, 347);
+  avl = remove_int(avl, 574);
+  avl = gpr_avl_add(avl, box(752), box(34), NULL);
+  avl = gpr_avl_add(avl, box(670), box(35), NULL);
+  avl = gpr_avl_add(avl, box(69), box(36), NULL);
+  avl = remove_int(avl, 111);
+  avl = remove_int(avl, 523);
+  avl = gpr_avl_add(avl, box(141), box(39), NULL);
+  avl = remove_int(avl, 159);
+  avl = gpr_avl_add(avl, box(947), box(41), NULL);
+  avl = gpr_avl_add(avl, box(855), box(42), NULL);
+  avl = remove_int(avl, 218);
+  avl = remove_int(avl, 6);
+  avl = gpr_avl_add(avl, box(753), box(45), NULL);
+  avl = remove_int(avl, 82);
+  avl = remove_int(avl, 799);
+  avl = gpr_avl_add(avl, box(572), box(48), NULL);
+  avl = remove_int(avl, 376);
+  avl = remove_int(avl, 413);
+  avl = gpr_avl_add(avl, box(458), box(51), NULL);
+  avl = remove_int(avl, 897);
+  avl = gpr_avl_add(avl, box(191), box(53), NULL);
+  avl = gpr_avl_add(avl, box(609), box(54), NULL);
+  avl = remove_int(avl, 787);
+  avl = remove_int(avl, 710);
+  avl = remove_int(avl, 886);
+  avl = remove_int(avl, 835);
+  avl = remove_int(avl, 33);
+  avl = gpr_avl_add(avl, box(871), box(60), NULL);
+  avl = remove_int(avl, 641);
+  avl = gpr_avl_add(avl, box(462), box(62), NULL);
+  avl = remove_int(avl, 359);
+  avl = remove_int(avl, 767);
+  avl = gpr_avl_add(avl, box(310), box(65), NULL);
+  avl = remove_int(avl, 757);
+  avl = remove_int(avl, 639);
+  avl = remove_int(avl, 314);
+  avl = gpr_avl_add(avl, box(2), box(69), NULL);
+  avl = remove_int(avl, 138);
+  avl = gpr_avl_add(avl, box(669), box(71), NULL);
+  avl = remove_int(avl, 477);
+  avl = gpr_avl_add(avl, box(366), box(73), NULL);
+  avl = gpr_avl_add(avl, box(612), box(74), NULL);
+  avl = gpr_avl_add(avl, box(106), box(75), NULL);
+  avl = remove_int(avl, 161);
+  avl = gpr_avl_add(avl, box(388), box(77), NULL);
+  avl = gpr_avl_add(avl, box(141), box(78), NULL);
+  avl = remove_int(avl, 633);
+  avl = remove_int(avl, 459);
+  avl = gpr_avl_add(avl, box(40), box(81), NULL);
+  avl = remove_int(avl, 689);
+  avl = gpr_avl_add(avl, box(823), box(83), NULL);
+  avl = remove_int(avl, 485);
+  avl = gpr_avl_add(avl, box(903), box(85), NULL);
+  avl = gpr_avl_add(avl, box(592), box(86), NULL);
+  avl = remove_int(avl, 448);
+  avl = gpr_avl_add(avl, box(56), box(88), NULL);
+  avl = remove_int(avl, 333);
+  avl = gpr_avl_add(avl, box(189), box(90), NULL);
+  avl = gpr_avl_add(avl, box(103), box(91), NULL);
+  avl = remove_int(avl, 164);
+  avl = remove_int(avl, 974);
+  avl = gpr_avl_add(avl, box(215), box(94), NULL);
+  avl = remove_int(avl, 189);
+  avl = remove_int(avl, 504);
+  avl = gpr_avl_add(avl, box(868), box(97), NULL);
+  avl = remove_int(avl, 909);
+  avl = remove_int(avl, 148);
+  avl = remove_int(avl, 469);
+  avl = gpr_avl_add(avl, box(994), box(101), NULL);
+  avl = gpr_avl_add(avl, box(576), box(102), NULL);
+  avl = remove_int(avl, 82);
+  avl = remove_int(avl, 209);
+  avl = gpr_avl_add(avl, box(276), box(105), NULL);
+  avl = remove_int(avl, 856);
+  avl = gpr_avl_add(avl, box(750), box(107), NULL);
+  avl = remove_int(avl, 871);
+  avl = gpr_avl_add(avl, box(301), box(109), NULL);
+  avl = remove_int(avl, 260);
+  avl = remove_int(avl, 737);
+  avl = remove_int(avl, 719);
+  avl = gpr_avl_add(avl, box(933), box(113), NULL);
+  avl = gpr_avl_add(avl, box(225), box(114), NULL);
+  avl = gpr_avl_add(avl, box(975), box(115), NULL);
+  avl = gpr_avl_add(avl, box(86), box(116), NULL);
+  avl = remove_int(avl, 732);
+  avl = gpr_avl_add(avl, box(340), box(118), NULL);
+  avl = gpr_avl_add(avl, box(271), box(119), NULL);
+  avl = remove_int(avl, 206);
+  avl = gpr_avl_add(avl, box(949), box(121), NULL);
+  avl = gpr_avl_add(avl, box(927), box(122), NULL);
+  avl = gpr_avl_add(avl, box(34), box(123), NULL);
+  avl = gpr_avl_add(avl, box(351), box(124), NULL);
+  avl = remove_int(avl, 836);
+  avl = gpr_avl_add(avl, box(825), box(126), NULL);
+  avl = gpr_avl_add(avl, box(352), box(127), NULL);
+  avl = remove_int(avl, 107);
+  avl = remove_int(avl, 101);
+  avl = gpr_avl_add(avl, box(320), box(130), NULL);
+  avl = gpr_avl_add(avl, box(3), box(131), NULL);
+  avl = remove_int(avl, 998);
+  avl = remove_int(avl, 44);
+  avl = gpr_avl_add(avl, box(525), box(134), NULL);
+  avl = gpr_avl_add(avl, box(864), box(135), NULL);
+  avl = gpr_avl_add(avl, box(863), box(136), NULL);
+  avl = remove_int(avl, 770);
+  avl = gpr_avl_add(avl, box(440), box(138), NULL);
+  avl = remove_int(avl, 516);
+  avl = gpr_avl_add(avl, box(116), box(140), NULL);
+  avl = remove_int(avl, 380);
+  avl = gpr_avl_add(avl, box(878), box(142), NULL);
+  avl = remove_int(avl, 439);
+  avl = gpr_avl_add(avl, box(994), box(144), NULL);
+  avl = remove_int(avl, 294);
+  avl = remove_int(avl, 593);
+  avl = gpr_avl_add(avl, box(696), box(147), NULL);
+  avl = remove_int(avl, 8);
+  avl = gpr_avl_add(avl, box(881), box(149), NULL);
+  avl = remove_int(avl, 32);
+  avl = remove_int(avl, 242);
+  avl = gpr_avl_add(avl, box(487), box(152), NULL);
+  avl = gpr_avl_add(avl, box(637), box(153), NULL);
+  avl = gpr_avl_add(avl, box(793), box(154), NULL);
+  avl = gpr_avl_add(avl, box(696), box(155), NULL);
+  avl = remove_int(avl, 458);
+  avl = gpr_avl_add(avl, box(828), box(157), NULL);
+  avl = remove_int(avl, 784);
+  avl = remove_int(avl, 274);
+  avl = gpr_avl_add(avl, box(783), box(160), NULL);
+  avl = remove_int(avl, 21);
+  avl = gpr_avl_add(avl, box(866), box(162), NULL);
+  avl = remove_int(avl, 919);
+  avl = gpr_avl_add(avl, box(435), box(164), NULL);
+  avl = remove_int(avl, 385);
+  avl = gpr_avl_add(avl, box(475), box(166), NULL);
+  avl = remove_int(avl, 339);
+  avl = gpr_avl_add(avl, box(615), box(168), NULL);
+  avl = remove_int(avl, 866);
+  avl = remove_int(avl, 82);
+  avl = remove_int(avl, 271);
+  avl = gpr_avl_add(avl, box(590), box(172), NULL);
+  avl = gpr_avl_add(avl, box(852), box(173), NULL);
+  avl = remove_int(avl, 318);
+  avl = remove_int(avl, 82);
+  avl = gpr_avl_add(avl, box(672), box(176), NULL);
+  avl = remove_int(avl, 430);
+  avl = gpr_avl_add(avl, box(821), box(178), NULL);
+  avl = gpr_avl_add(avl, box(365), box(179), NULL);
+  avl = remove_int(avl, 78);
+  avl = gpr_avl_add(avl, box(700), box(181), NULL);
+  avl = gpr_avl_add(avl, box(353), box(182), NULL);
+  avl = remove_int(avl, 492);
+  avl = gpr_avl_add(avl, box(991), box(184), NULL);
+  avl = remove_int(avl, 330);
+  avl = gpr_avl_add(avl, box(873), box(186), NULL);
+  avl = remove_int(avl, 589);
+  avl = gpr_avl_add(avl, box(676), box(188), NULL);
+  avl = gpr_avl_add(avl, box(790), box(189), NULL);
+  avl = remove_int(avl, 521);
+  avl = remove_int(avl, 47);
+  avl = gpr_avl_add(avl, box(976), box(192), NULL);
+  avl = gpr_avl_add(avl, box(683), box(193), NULL);
+  avl = remove_int(avl, 803);
+  avl = remove_int(avl, 1006);
+  avl = gpr_avl_add(avl, box(775), box(196), NULL);
+  avl = gpr_avl_add(avl, box(411), box(197), NULL);
+  avl = gpr_avl_add(avl, box(697), box(198), NULL);
+  avl = remove_int(avl, 50);
+  avl = gpr_avl_add(avl, box(213), box(200), NULL);
+  avl = remove_int(avl, 714);
+  avl = gpr_avl_add(avl, box(981), box(202), NULL);
+  avl = gpr_avl_add(avl, box(502), box(203), NULL);
+  avl = gpr_avl_add(avl, box(697), box(204), NULL);
+  avl = gpr_avl_add(avl, box(603), box(205), NULL);
+  avl = gpr_avl_add(avl, box(117), box(206), NULL);
+  avl = remove_int(avl, 363);
+  avl = gpr_avl_add(avl, box(104), box(208), NULL);
+  avl = remove_int(avl, 842);
+  avl = gpr_avl_add(avl, box(48), box(210), NULL);
+  avl = remove_int(avl, 764);
+  avl = gpr_avl_add(avl, box(482), box(212), NULL);
+  avl = gpr_avl_add(avl, box(928), box(213), NULL);
+  avl = gpr_avl_add(avl, box(30), box(214), NULL);
+  avl = gpr_avl_add(avl, box(820), box(215), NULL);
+  avl = gpr_avl_add(avl, box(334), box(216), NULL);
+  avl = remove_int(avl, 306);
+  avl = gpr_avl_add(avl, box(789), box(218), NULL);
+  avl = remove_int(avl, 924);
+  avl = gpr_avl_add(avl, box(53), box(220), NULL);
+  avl = remove_int(avl, 657);
+  avl = gpr_avl_add(avl, box(130), box(222), NULL);
+  avl = gpr_avl_add(avl, box(239), box(223), NULL);
+  avl = remove_int(avl, 20);
+  avl = gpr_avl_add(avl, box(117), box(225), NULL);
+  avl = remove_int(avl, 882);
+  avl = remove_int(avl, 891);
+  avl = gpr_avl_add(avl, box(9), box(228), NULL);
+  avl = gpr_avl_add(avl, box(496), box(229), NULL);
+  avl = gpr_avl_add(avl, box(750), box(230), NULL);
+  avl = gpr_avl_add(avl, box(283), box(231), NULL);
+  avl = gpr_avl_add(avl, box(802), box(232), NULL);
+  avl = remove_int(avl, 352);
+  avl = gpr_avl_add(avl, box(374), box(234), NULL);
+  avl = gpr_avl_add(avl, box(6), box(235), NULL);
+  avl = gpr_avl_add(avl, box(756), box(236), NULL);
+  avl = gpr_avl_add(avl, box(597), box(237), NULL);
+  avl = gpr_avl_add(avl, box(661), box(238), NULL);
+  avl = remove_int(avl, 96);
+  avl = gpr_avl_add(avl, box(894), box(240), NULL);
+  avl = remove_int(avl, 749);
+  avl = gpr_avl_add(avl, box(71), box(242), NULL);
+  avl = remove_int(avl, 68);
+  avl = gpr_avl_add(avl, box(388), box(244), NULL);
+  avl = remove_int(avl, 119);
+  avl = remove_int(avl, 856);
+  avl = gpr_avl_add(avl, box(176), box(247), NULL);
+  avl = gpr_avl_add(avl, box(993), box(248), NULL);
+  avl = remove_int(avl, 178);
+  avl = remove_int(avl, 781);
+  avl = remove_int(avl, 771);
+  avl = remove_int(avl, 848);
+  avl = remove_int(avl, 376);
+  avl = remove_int(avl, 157);
+  avl = remove_int(avl, 142);
+  avl = remove_int(avl, 686);
+  avl = gpr_avl_add(avl, box(779), box(257), NULL);
+  avl = gpr_avl_add(avl, box(484), box(258), NULL);
+  avl = remove_int(avl, 837);
+  avl = gpr_avl_add(avl, box(388), box(260), NULL);
+  avl = remove_int(avl, 987);
+  avl = gpr_avl_add(avl, box(336), box(262), NULL);
+  avl = remove_int(avl, 855);
+  avl = gpr_avl_add(avl, box(668), box(264), NULL);
+  avl = remove_int(avl, 648);
+  avl = gpr_avl_add(avl, box(193), box(266), NULL);
+  avl = remove_int(avl, 939);
+  avl = gpr_avl_add(avl, box(740), box(268), NULL);
+  avl = gpr_avl_add(avl, box(503), box(269), NULL);
+  avl = gpr_avl_add(avl, box(765), box(270), NULL);
+  avl = remove_int(avl, 924);
+  avl = remove_int(avl, 513);
+  avl = gpr_avl_add(avl, box(161), box(273), NULL);
+  avl = gpr_avl_add(avl, box(502), box(274), NULL);
+  avl = gpr_avl_add(avl, box(846), box(275), NULL);
+  avl = remove_int(avl, 931);
+  avl = gpr_avl_add(avl, box(87), box(277), NULL);
+  avl = gpr_avl_add(avl, box(949), box(278), NULL);
+  avl = gpr_avl_add(avl, box(548), box(279), NULL);
+  avl = gpr_avl_add(avl, box(951), box(280), NULL);
+  avl = remove_int(avl, 1018);
+  avl = remove_int(avl, 568);
+  avl = gpr_avl_add(avl, box(138), box(283), NULL);
+  avl = gpr_avl_add(avl, box(202), box(284), NULL);
+  avl = gpr_avl_add(avl, box(157), box(285), NULL);
+  avl = gpr_avl_add(avl, box(264), box(286), NULL);
+  avl = gpr_avl_add(avl, box(370), box(287), NULL);
+  avl = remove_int(avl, 736);
+  avl = remove_int(avl, 751);
+  avl = remove_int(avl, 506);
+  avl = remove_int(avl, 81);
+  avl = remove_int(avl, 358);
+  avl = remove_int(avl, 657);
+  avl = remove_int(avl, 86);
+  avl = gpr_avl_add(avl, box(876), box(295), NULL);
+  avl = remove_int(avl, 354);
+  avl = gpr_avl_add(avl, box(134), box(297), NULL);
+  avl = remove_int(avl, 781);
+  avl = remove_int(avl, 183);
+  avl = gpr_avl_add(avl, box(914), box(300), NULL);
+  avl = remove_int(avl, 926);
+  avl = remove_int(avl, 398);
+  avl = remove_int(avl, 932);
+  avl = remove_int(avl, 804);
+  avl = remove_int(avl, 326);
+  avl = gpr_avl_add(avl, box(208), box(306), NULL);
+  avl = gpr_avl_add(avl, box(699), box(307), NULL);
+  avl = remove_int(avl, 576);
+  avl = remove_int(avl, 850);
+  avl = remove_int(avl, 514);
+  avl = remove_int(avl, 676);
+  avl = remove_int(avl, 549);
+  avl = remove_int(avl, 767);
+  avl = gpr_avl_add(avl, box(58), box(314), NULL);
+  avl = gpr_avl_add(avl, box(265), box(315), NULL);
+  avl = gpr_avl_add(avl, box(268), box(316), NULL);
+  avl = gpr_avl_add(avl, box(103), box(317), NULL);
+  avl = gpr_avl_add(avl, box(440), box(318), NULL);
+  avl = remove_int(avl, 777);
+  avl = gpr_avl_add(avl, box(670), box(320), NULL);
+  avl = remove_int(avl, 506);
+  avl = remove_int(avl, 487);
+  avl = gpr_avl_add(avl, box(421), box(323), NULL);
+  avl = remove_int(avl, 514);
+  avl = gpr_avl_add(avl, box(701), box(325), NULL);
+  avl = remove_int(avl, 949);
+  avl = remove_int(avl, 872);
+  avl = remove_int(avl, 139);
+  avl = gpr_avl_add(avl, box(781), box(329), NULL);
+  avl = gpr_avl_add(avl, box(543), box(330), NULL);
+  avl = gpr_avl_add(avl, box(147), box(331), NULL);
+  avl = remove_int(avl, 190);
+  avl = gpr_avl_add(avl, box(453), box(333), NULL);
+  avl = remove_int(avl, 262);
+  avl = remove_int(avl, 850);
+  avl = remove_int(avl, 286);
+  avl = remove_int(avl, 787);
+  avl = gpr_avl_add(avl, box(514), box(338), NULL);
+  avl = remove_int(avl, 812);
+  avl = gpr_avl_add(avl, box(431), box(340), NULL);
+  avl = gpr_avl_add(avl, box(8), box(341), NULL);
+  avl = remove_int(avl, 843);
+  avl = gpr_avl_add(avl, box(831), box(343), NULL);
+  avl = remove_int(avl, 472);
+  avl = remove_int(avl, 157);
+  avl = gpr_avl_add(avl, box(612), box(346), NULL);
+  avl = gpr_avl_add(avl, box(802), box(347), NULL);
+  avl = remove_int(avl, 554);
+  avl = gpr_avl_add(avl, box(409), box(349), NULL);
+  avl = gpr_avl_add(avl, box(439), box(350), NULL);
+  avl = gpr_avl_add(avl, box(725), box(351), NULL);
+  avl = gpr_avl_add(avl, box(568), box(352), NULL);
+  avl = remove_int(avl, 475);
+  avl = remove_int(avl, 672);
+  avl = remove_int(avl, 62);
+  avl = remove_int(avl, 753);
+  avl = gpr_avl_add(avl, box(435), box(357), NULL);
+  avl = gpr_avl_add(avl, box(950), box(358), NULL);
+  avl = gpr_avl_add(avl, box(532), box(359), NULL);
+  avl = gpr_avl_add(avl, box(832), box(360), NULL);
+  avl = remove_int(avl, 390);
+  avl = gpr_avl_add(avl, box(993), box(362), NULL);
+  avl = remove_int(avl, 198);
+  avl = remove_int(avl, 401);
+  avl = gpr_avl_add(avl, box(316), box(365), NULL);
+  avl = remove_int(avl, 843);
+  avl = gpr_avl_add(avl, box(541), box(367), NULL);
+  avl = gpr_avl_add(avl, box(505), box(368), NULL);
+  avl = remove_int(avl, 445);
+  avl = remove_int(avl, 256);
+  avl = gpr_avl_add(avl, box(232), box(371), NULL);
+  avl = remove_int(avl, 577);
+  avl = remove_int(avl, 558);
+  avl = gpr_avl_add(avl, box(910), box(374), NULL);
+  avl = remove_int(avl, 902);
+  avl = remove_int(avl, 755);
+  avl = remove_int(avl, 114);
+  avl = remove_int(avl, 438);
+  avl = remove_int(avl, 224);
+  avl = gpr_avl_add(avl, box(920), box(380), NULL);
+  avl = gpr_avl_add(avl, box(655), box(381), NULL);
+  avl = remove_int(avl, 557);
+  avl = remove_int(avl, 102);
+  avl = remove_int(avl, 165);
+  avl = gpr_avl_add(avl, box(191), box(385), NULL);
+  avl = remove_int(avl, 30);
+  avl = gpr_avl_add(avl, box(406), box(387), NULL);
+  avl = gpr_avl_add(avl, box(66), box(388), NULL);
+  avl = gpr_avl_add(avl, box(87), box(389), NULL);
+  avl = remove_int(avl, 7);
+  avl = remove_int(avl, 671);
+  avl = gpr_avl_add(avl, box(234), box(392), NULL);
+  avl = remove_int(avl, 463);
+  avl = gpr_avl_add(avl, box(75), box(394), NULL);
+  avl = gpr_avl_add(avl, box(487), box(395), NULL);
+  avl = remove_int(avl, 203);
+  avl = gpr_avl_add(avl, box(711), box(397), NULL);
+  avl = remove_int(avl, 291);
+  avl = remove_int(avl, 798);
+  avl = remove_int(avl, 337);
+  avl = gpr_avl_add(avl, box(877), box(401), NULL);
+  avl = gpr_avl_add(avl, box(388), box(402), NULL);
+  avl = remove_int(avl, 975);
+  avl = gpr_avl_add(avl, box(200), box(404), NULL);
+  avl = gpr_avl_add(avl, box(408), box(405), NULL);
+  avl = gpr_avl_add(avl, box(3), box(406), NULL);
+  avl = gpr_avl_add(avl, box(971), box(407), NULL);
+  avl = remove_int(avl, 841);
+  avl = remove_int(avl, 910);
+  avl = remove_int(avl, 74);
+  avl = remove_int(avl, 888);
+  avl = gpr_avl_add(avl, box(492), box(412), NULL);
+  avl = remove_int(avl, 14);
+  avl = remove_int(avl, 364);
+  avl = gpr_avl_add(avl, box(215), box(415), NULL);
+  avl = remove_int(avl, 778);
+  avl = remove_int(avl, 45);
+  avl = gpr_avl_add(avl, box(328), box(418), NULL);
+  avl = gpr_avl_add(avl, box(597), box(419), NULL);
+  avl = remove_int(avl, 34);
+  avl = gpr_avl_add(avl, box(736), box(421), NULL);
+  avl = remove_int(avl, 37);
+  avl = gpr_avl_add(avl, box(275), box(423), NULL);
+  avl = gpr_avl_add(avl, box(70), box(424), NULL);
+  avl = gpr_avl_add(avl, box(771), box(425), NULL);
+  avl = remove_int(avl, 536);
+  avl = remove_int(avl, 421);
+  avl = gpr_avl_add(avl, box(186), box(428), NULL);
+  avl = gpr_avl_add(avl, box(788), box(429), NULL);
+  avl = gpr_avl_add(avl, box(224), box(430), NULL);
+  avl = remove_int(avl, 228);
+  avl = gpr_avl_add(avl, box(48), box(432), NULL);
+  avl = gpr_avl_add(avl, box(120), box(433), NULL);
+  avl = gpr_avl_add(avl, box(269), box(434), NULL);
+  avl = gpr_avl_add(avl, box(904), box(435), NULL);
+  avl = remove_int(avl, 699);
+  avl = gpr_avl_add(avl, box(340), box(437), NULL);
+  avl = remove_int(avl, 276);
+  avl = gpr_avl_add(avl, box(591), box(439), NULL);
+  avl = gpr_avl_add(avl, box(778), box(440), NULL);
+  avl = remove_int(avl, 490);
+  avl = remove_int(avl, 973);
+  avl = gpr_avl_add(avl, box(294), box(443), NULL);
+  avl = gpr_avl_add(avl, box(323), box(444), NULL);
+  avl = remove_int(avl, 685);
+  avl = gpr_avl_add(avl, box(38), box(446), NULL);
+  avl = gpr_avl_add(avl, box(525), box(447), NULL);
+  avl = remove_int(avl, 162);
+  avl = gpr_avl_add(avl, box(462), box(449), NULL);
+  avl = gpr_avl_add(avl, box(340), box(450), NULL);
+  avl = remove_int(avl, 734);
+  avl = remove_int(avl, 959);
+  avl = gpr_avl_add(avl, box(752), box(453), NULL);
+  avl = gpr_avl_add(avl, box(667), box(454), NULL);
+  avl = remove_int(avl, 558);
+  avl = remove_int(avl, 657);
+  avl = gpr_avl_add(avl, box(711), box(457), NULL);
+  avl = remove_int(avl, 937);
+  avl = gpr_avl_add(avl, box(741), box(459), NULL);
+  avl = gpr_avl_add(avl, box(40), box(460), NULL);
+  avl = remove_int(avl, 784);
+  avl = gpr_avl_add(avl, box(292), box(462), NULL);
+  avl = remove_int(avl, 164);
+  avl = remove_int(avl, 931);
+  avl = remove_int(avl, 886);
+  avl = gpr_avl_add(avl, box(968), box(466), NULL);
+  avl = remove_int(avl, 263);
+  avl = gpr_avl_add(avl, box(647), box(468), NULL);
+  avl = gpr_avl_add(avl, box(92), box(469), NULL);
+  avl = remove_int(avl, 310);
+  avl = gpr_avl_add(avl, box(711), box(471), NULL);
+  avl = gpr_avl_add(avl, box(675), box(472), NULL);
+  avl = remove_int(avl, 549);
+  avl = gpr_avl_add(avl, box(380), box(474), NULL);
+  avl = remove_int(avl, 825);
+  avl = gpr_avl_add(avl, box(668), box(476), NULL);
+  avl = remove_int(avl, 498);
+  avl = gpr_avl_add(avl, box(870), box(478), NULL);
+  avl = gpr_avl_add(avl, box(391), box(479), NULL);
+  avl = gpr_avl_add(avl, box(264), box(480), NULL);
+  avl = remove_int(avl, 1);
+  avl = remove_int(avl, 849);
+  avl = remove_int(avl, 88);
+  avl = remove_int(avl, 255);
+  avl = remove_int(avl, 763);
+  avl = remove_int(avl, 831);
+  avl = gpr_avl_add(avl, box(508), box(487), NULL);
+  avl = remove_int(avl, 849);
+  avl = remove_int(avl, 47);
+  avl = gpr_avl_add(avl, box(299), box(490), NULL);
+  avl = remove_int(avl, 625);
+  avl = remove_int(avl, 433);
+  avl = remove_int(avl, 904);
+  avl = remove_int(avl, 761);
+  avl = gpr_avl_add(avl, box(33), box(495), NULL);
+  avl = gpr_avl_add(avl, box(524), box(496), NULL);
+  avl = remove_int(avl, 210);
+  avl = remove_int(avl, 299);
+  avl = gpr_avl_add(avl, box(823), box(499), NULL);
+  avl = remove_int(avl, 479);
+  avl = remove_int(avl, 96);
+  avl = remove_int(avl, 1013);
+  avl = gpr_avl_add(avl, box(768), box(503), NULL);
+  avl = remove_int(avl, 638);
+  avl = remove_int(avl, 20);
+  avl = gpr_avl_add(avl, box(663), box(506), NULL);
+  avl = remove_int(avl, 882);
+  avl = gpr_avl_add(avl, box(745), box(508), NULL);
+  avl = remove_int(avl, 352);
+  avl = gpr_avl_add(avl, box(10), box(510), NULL);
+  avl = remove_int(avl, 484);
+  avl = gpr_avl_add(avl, box(420), box(512), NULL);
+  avl = gpr_avl_add(avl, box(884), box(513), NULL);
+  avl = gpr_avl_add(avl, box(993), box(514), NULL);
+  avl = gpr_avl_add(avl, box(251), box(515), NULL);
+  avl = remove_int(avl, 222);
+  avl = gpr_avl_add(avl, box(734), box(517), NULL);
+  avl = gpr_avl_add(avl, box(952), box(518), NULL);
+  avl = remove_int(avl, 26);
+  avl = remove_int(avl, 270);
+  avl = remove_int(avl, 481);
+  avl = remove_int(avl, 693);
+  avl = remove_int(avl, 1006);
+  avl = gpr_avl_add(avl, box(77), box(524), NULL);
+  avl = remove_int(avl, 897);
+  avl = gpr_avl_add(avl, box(719), box(526), NULL);
+  avl = gpr_avl_add(avl, box(622), box(527), NULL);
+  avl = remove_int(avl, 28);
+  avl = remove_int(avl, 836);
+  avl = remove_int(avl, 142);
+  avl = gpr_avl_add(avl, box(445), box(531), NULL);
+  avl = gpr_avl_add(avl, box(410), box(532), NULL);
+  avl = remove_int(avl, 575);
+  avl = gpr_avl_add(avl, box(634), box(534), NULL);
+  avl = gpr_avl_add(avl, box(906), box(535), NULL);
+  avl = remove_int(avl, 649);
+  avl = gpr_avl_add(avl, box(813), box(537), NULL);
+  avl = remove_int(avl, 702);
+  avl = remove_int(avl, 732);
+  avl = gpr_avl_add(avl, box(105), box(540), NULL);
+  avl = gpr_avl_add(avl, box(867), box(541), NULL);
+  avl = remove_int(avl, 964);
+  avl = remove_int(avl, 941);
+  avl = gpr_avl_add(avl, box(947), box(544), NULL);
+  avl = remove_int(avl, 990);
+  avl = gpr_avl_add(avl, box(816), box(546), NULL);
+  avl = remove_int(avl, 429);
+  avl = remove_int(avl, 567);
+  avl = remove_int(avl, 541);
+  avl = remove_int(avl, 583);
+  avl = gpr_avl_add(avl, box(57), box(551), NULL);
+  avl = gpr_avl_add(avl, box(786), box(552), NULL);
+  avl = gpr_avl_add(avl, box(526), box(553), NULL);
+  avl = remove_int(avl, 642);
+  avl = remove_int(avl, 220);
+  avl = remove_int(avl, 840);
+  avl = remove_int(avl, 548);
+  avl = gpr_avl_add(avl, box(528), box(558), NULL);
+  avl = gpr_avl_add(avl, box(749), box(559), NULL);
+  avl = gpr_avl_add(avl, box(194), box(560), NULL);
+  avl = remove_int(avl, 517);
+  avl = gpr_avl_add(avl, box(102), box(562), NULL);
+  avl = remove_int(avl, 189);
+  avl = gpr_avl_add(avl, box(927), box(564), NULL);
+  avl = remove_int(avl, 846);
+  avl = remove_int(avl, 130);
+  avl = gpr_avl_add(avl, box(694), box(567), NULL);
+  avl = remove_int(avl, 750);
+  avl = gpr_avl_add(avl, box(357), box(569), NULL);
+  avl = remove_int(avl, 431);
+  avl = remove_int(avl, 91);
+  avl = gpr_avl_add(avl, box(640), box(572), NULL);
+  avl = remove_int(avl, 4);
+  avl = gpr_avl_add(avl, box(81), box(574), NULL);
+  avl = gpr_avl_add(avl, box(595), box(575), NULL);
+  avl = remove_int(avl, 444);
+  avl = remove_int(avl, 262);
+  avl = remove_int(avl, 11);
+  avl = gpr_avl_add(avl, box(192), box(579), NULL);
+  avl = gpr_avl_add(avl, box(158), box(580), NULL);
+  avl = remove_int(avl, 401);
+  avl = remove_int(avl, 918);
+  avl = gpr_avl_add(avl, box(180), box(583), NULL);
+  avl = remove_int(avl, 268);
+  avl = gpr_avl_add(avl, box(1012), box(585), NULL);
+  avl = gpr_avl_add(avl, box(90), box(586), NULL);
+  avl = gpr_avl_add(avl, box(946), box(587), NULL);
+  avl = remove_int(avl, 719);
+  avl = gpr_avl_add(avl, box(874), box(589), NULL);
+  avl = gpr_avl_add(avl, box(679), box(590), NULL);
+  avl = remove_int(avl, 53);
+  avl = remove_int(avl, 534);
+  avl = gpr_avl_add(avl, box(646), box(593), NULL);
+  avl = gpr_avl_add(avl, box(767), box(594), NULL);
+  avl = gpr_avl_add(avl, box(460), box(595), NULL);
+  avl = gpr_avl_add(avl, box(852), box(596), NULL);
+  avl = gpr_avl_add(avl, box(189), box(597), NULL);
+  avl = remove_int(avl, 932);
+  avl = remove_int(avl, 366);
+  avl = remove_int(avl, 907);
+  avl = gpr_avl_add(avl, box(875), box(601), NULL);
+  avl = gpr_avl_add(avl, box(434), box(602), NULL);
+  avl = gpr_avl_add(avl, box(704), box(603), NULL);
+  avl = gpr_avl_add(avl, box(724), box(604), NULL);
+  avl = gpr_avl_add(avl, box(930), box(605), NULL);
+  avl = gpr_avl_add(avl, box(1000), box(606), NULL);
+  avl = remove_int(avl, 479);
+  avl = gpr_avl_add(avl, box(275), box(608), NULL);
+  avl = remove_int(avl, 32);
+  avl = gpr_avl_add(avl, box(939), box(610), NULL);
+  avl = remove_int(avl, 943);
+  avl = remove_int(avl, 329);
+  avl = gpr_avl_add(avl, box(490), box(613), NULL);
+  avl = remove_int(avl, 477);
+  avl = remove_int(avl, 414);
+  avl = remove_int(avl, 187);
+  avl = remove_int(avl, 334);
+  avl = gpr_avl_add(avl, box(40), box(618), NULL);
+  avl = remove_int(avl, 751);
+  avl = gpr_avl_add(avl, box(568), box(620), NULL);
+  avl = gpr_avl_add(avl, box(120), box(621), NULL);
+  avl = gpr_avl_add(avl, box(617), box(622), NULL);
+  avl = gpr_avl_add(avl, box(32), box(623), NULL);
+  avl = remove_int(avl, 701);
+  avl = gpr_avl_add(avl, box(910), box(625), NULL);
+  avl = remove_int(avl, 557);
+  avl = remove_int(avl, 361);
+  avl = remove_int(avl, 937);
+  avl = remove_int(avl, 100);
+  avl = remove_int(avl, 684);
+  avl = gpr_avl_add(avl, box(751), box(631), NULL);
+  avl = remove_int(avl, 781);
+  avl = remove_int(avl, 469);
+  avl = remove_int(avl, 75);
+  avl = remove_int(avl, 561);
+  avl = gpr_avl_add(avl, box(854), box(636), NULL);
+  avl = remove_int(avl, 164);
+  avl = remove_int(avl, 258);
+  avl = remove_int(avl, 315);
+  avl = remove_int(avl, 261);
+  avl = gpr_avl_add(avl, box(552), box(641), NULL);
+  avl = gpr_avl_add(avl, box(6), box(642), NULL);
+  avl = gpr_avl_add(avl, box(680), box(643), NULL);
+  avl = remove_int(avl, 741);
+  avl = remove_int(avl, 309);
+  avl = remove_int(avl, 272);
+  avl = gpr_avl_add(avl, box(249), box(647), NULL);
+  avl = remove_int(avl, 97);
+  avl = remove_int(avl, 850);
+  avl = gpr_avl_add(avl, box(915), box(650), NULL);
+  avl = gpr_avl_add(avl, box(816), box(651), NULL);
+  avl = gpr_avl_add(avl, box(45), box(652), NULL);
+  avl = gpr_avl_add(avl, box(168), box(653), NULL);
+  avl = remove_int(avl, 153);
+  avl = remove_int(avl, 239);
+  avl = gpr_avl_add(avl, box(684), box(656), NULL);
+  avl = gpr_avl_add(avl, box(208), box(657), NULL);
+  avl = gpr_avl_add(avl, box(681), box(658), NULL);
+  avl = gpr_avl_add(avl, box(609), box(659), NULL);
+  avl = gpr_avl_add(avl, box(645), box(660), NULL);
+  avl = remove_int(avl, 799);
+  avl = gpr_avl_add(avl, box(955), box(662), NULL);
+  avl = gpr_avl_add(avl, box(946), box(663), NULL);
+  avl = gpr_avl_add(avl, box(744), box(664), NULL);
+  avl = gpr_avl_add(avl, box(201), box(665), NULL);
+  avl = gpr_avl_add(avl, box(136), box(666), NULL);
+  avl = remove_int(avl, 357);
+  avl = gpr_avl_add(avl, box(974), box(668), NULL);
+  avl = remove_int(avl, 485);
+  avl = gpr_avl_add(avl, box(1009), box(670), NULL);
+  avl = gpr_avl_add(avl, box(517), box(671), NULL);
+  avl = remove_int(avl, 491);
+  avl = gpr_avl_add(avl, box(336), box(673), NULL);
+  avl = gpr_avl_add(avl, box(589), box(674), NULL);
+  avl = remove_int(avl, 546);
+  avl = remove_int(avl, 840);
+  avl = remove_int(avl, 104);
+  avl = remove_int(avl, 347);
+  avl = gpr_avl_add(avl, box(801), box(679), NULL);
+  avl = remove_int(avl, 799);
+  avl = remove_int(avl, 702);
+  avl = remove_int(avl, 996);
+  avl = remove_int(avl, 93);
+  avl = gpr_avl_add(avl, box(561), box(684), NULL);
+  avl = gpr_avl_add(avl, box(25), box(685), NULL);
+  avl = remove_int(avl, 278);
+  avl = gpr_avl_add(avl, box(191), box(687), NULL);
+  avl = remove_int(avl, 243);
+  avl = remove_int(avl, 918);
+  avl = remove_int(avl, 449);
+  avl = gpr_avl_add(avl, box(19), box(691), NULL);
+  avl = gpr_avl_add(avl, box(762), box(692), NULL);
+  avl = gpr_avl_add(avl, box(13), box(693), NULL);
+  avl = gpr_avl_add(avl, box(151), box(694), NULL);
+  avl = gpr_avl_add(avl, box(152), box(695), NULL);
+  avl = gpr_avl_add(avl, box(793), box(696), NULL);
+  avl = remove_int(avl, 862);
+  avl = remove_int(avl, 890);
+  avl = gpr_avl_add(avl, box(687), box(699), NULL);
+  avl = gpr_avl_add(avl, box(509), box(700), NULL);
+  avl = gpr_avl_add(avl, box(973), box(701), NULL);
+  avl = remove_int(avl, 230);
+  avl = gpr_avl_add(avl, box(532), box(703), NULL);
+  avl = remove_int(avl, 668);
+  avl = gpr_avl_add(avl, box(281), box(705), NULL);
+  avl = gpr_avl_add(avl, box(867), box(706), NULL);
+  avl = gpr_avl_add(avl, box(359), box(707), NULL);
+  avl = remove_int(avl, 425);
+  avl = gpr_avl_add(avl, box(691), box(709), NULL);
+  avl = gpr_avl_add(avl, box(163), box(710), NULL);
+  avl = gpr_avl_add(avl, box(502), box(711), NULL);
+  avl = remove_int(avl, 674);
+  avl = gpr_avl_add(avl, box(697), box(713), NULL);
+  avl = remove_int(avl, 271);
+  avl = gpr_avl_add(avl, box(968), box(715), NULL);
+  avl = gpr_avl_add(avl, box(48), box(716), NULL);
+  avl = remove_int(avl, 543);
+  avl = gpr_avl_add(avl, box(35), box(718), NULL);
+  avl = gpr_avl_add(avl, box(751), box(719), NULL);
+  avl = gpr_avl_add(avl, box(478), box(720), NULL);
+  avl = remove_int(avl, 797);
+  avl = remove_int(avl, 309);
+  avl = gpr_avl_add(avl, box(927), box(723), NULL);
+  avl = remove_int(avl, 504);
+  avl = gpr_avl_add(avl, box(286), box(725), NULL);
+  avl = gpr_avl_add(avl, box(413), box(726), NULL);
+  avl = gpr_avl_add(avl, box(599), box(727), NULL);
+  avl = remove_int(avl, 105);
+  avl = remove_int(avl, 605);
+  avl = gpr_avl_add(avl, box(632), box(730), NULL);
+  avl = gpr_avl_add(avl, box(133), box(731), NULL);
+  avl = remove_int(avl, 443);
+  avl = gpr_avl_add(avl, box(958), box(733), NULL);
+  avl = gpr_avl_add(avl, box(729), box(734), NULL);
+  avl = remove_int(avl, 158);
+  avl = gpr_avl_add(avl, box(694), box(736), NULL);
+  avl = gpr_avl_add(avl, box(505), box(737), NULL);
+  avl = remove_int(avl, 63);
+  avl = remove_int(avl, 714);
+  avl = gpr_avl_add(avl, box(1002), box(740), NULL);
+  avl = remove_int(avl, 211);
+  avl = gpr_avl_add(avl, box(765), box(742), NULL);
+  avl = gpr_avl_add(avl, box(455), box(743), NULL);
+  avl = remove_int(avl, 59);
+  avl = remove_int(avl, 224);
+  avl = gpr_avl_add(avl, box(586), box(746), NULL);
+  avl = gpr_avl_add(avl, box(348), box(747), NULL);
+  avl = remove_int(avl, 10);
+  avl = remove_int(avl, 484);
+  avl = gpr_avl_add(avl, box(968), box(750), NULL);
+  avl = gpr_avl_add(avl, box(923), box(751), NULL);
+  avl = remove_int(avl, 573);
+  avl = remove_int(avl, 617);
+  avl = gpr_avl_add(avl, box(812), box(754), NULL);
+  avl = gpr_avl_add(avl, box(179), box(755), NULL);
+  avl = remove_int(avl, 284);
+  avl = remove_int(avl, 157);
+  avl = remove_int(avl, 177);
+  avl = remove_int(avl, 896);
+  avl = gpr_avl_add(avl, box(649), box(760), NULL);
+  avl = gpr_avl_add(avl, box(927), box(761), NULL);
+  avl = gpr_avl_add(avl, box(454), box(762), NULL);
+  avl = gpr_avl_add(avl, box(217), box(763), NULL);
+  avl = remove_int(avl, 534);
+  avl = gpr_avl_add(avl, box(180), box(765), NULL);
+  avl = gpr_avl_add(avl, box(319), box(766), NULL);
+  avl = remove_int(avl, 92);
+  avl = gpr_avl_add(avl, box(483), box(768), NULL);
+  avl = remove_int(avl, 504);
+  avl = remove_int(avl, 1017);
+  avl = remove_int(avl, 37);
+  avl = remove_int(avl, 50);
+  avl = gpr_avl_add(avl, box(302), box(773), NULL);
+  avl = remove_int(avl, 807);
+  avl = gpr_avl_add(avl, box(463), box(775), NULL);
+  avl = gpr_avl_add(avl, box(271), box(776), NULL);
+  avl = gpr_avl_add(avl, box(644), box(777), NULL);
+  avl = remove_int(avl, 618);
+  avl = gpr_avl_add(avl, box(166), box(779), NULL);
+  avl = gpr_avl_add(avl, box(538), box(780), NULL);
+  avl = remove_int(avl, 606);
+  avl = gpr_avl_add(avl, box(425), box(782), NULL);
+  avl = remove_int(avl, 725);
+  avl = remove_int(avl, 383);
+  avl = gpr_avl_add(avl, box(155), box(785), NULL);
+  avl = remove_int(avl, 889);
+  avl = gpr_avl_add(avl, box(653), box(787), NULL);
+  avl = remove_int(avl, 386);
+  avl = gpr_avl_add(avl, box(142), box(789), NULL);
+  avl = remove_int(avl, 107);
+  avl = remove_int(avl, 603);
+  avl = remove_int(avl, 971);
+  avl = gpr_avl_add(avl, box(80), box(793), NULL);
+  avl = gpr_avl_add(avl, box(61), box(794), NULL);
+  avl = gpr_avl_add(avl, box(693), box(795), NULL);
+  avl = gpr_avl_add(avl, box(592), box(796), NULL);
+  avl = gpr_avl_add(avl, box(433), box(797), NULL);
+  avl = gpr_avl_add(avl, box(973), box(798), NULL);
+  avl = remove_int(avl, 901);
+  avl = remove_int(avl, 340);
+  avl = remove_int(avl, 709);
+  avl = gpr_avl_add(avl, box(224), box(802), NULL);
+  avl = remove_int(avl, 120);
+  avl = remove_int(avl, 271);
+  avl = gpr_avl_add(avl, box(780), box(805), NULL);
+  avl = gpr_avl_add(avl, box(867), box(806), NULL);
+  avl = gpr_avl_add(avl, box(756), box(807), NULL);
+  avl = gpr_avl_add(avl, box(583), box(808), NULL);
+  avl = gpr_avl_add(avl, box(356), box(809), NULL);
+  avl = gpr_avl_add(avl, box(58), box(810), NULL);
+  avl = remove_int(avl, 219);
+  avl = gpr_avl_add(avl, box(301), box(812), NULL);
+  avl = remove_int(avl, 643);
+  avl = remove_int(avl, 787);
+  avl = remove_int(avl, 583);
+  avl = remove_int(avl, 552);
+  avl = remove_int(avl, 308);
+  avl = remove_int(avl, 608);
+  avl = remove_int(avl, 363);
+  avl = remove_int(avl, 690);
+  avl = gpr_avl_add(avl, box(233), box(821), NULL);
+  avl = gpr_avl_add(avl, box(479), box(822), NULL);
+  avl = gpr_avl_add(avl, box(323), box(823), NULL);
+  avl = gpr_avl_add(avl, box(802), box(824), NULL);
+  avl = remove_int(avl, 682);
+  avl = remove_int(avl, 705);
+  avl = remove_int(avl, 487);
+  avl = gpr_avl_add(avl, box(530), box(828), NULL);
+  avl = gpr_avl_add(avl, box(232), box(829), NULL);
+  avl = remove_int(avl, 627);
+  avl = gpr_avl_add(avl, box(396), box(831), NULL);
+  avl = gpr_avl_add(avl, box(61), box(832), NULL);
+  avl = gpr_avl_add(avl, box(932), box(833), NULL);
+  avl = gpr_avl_add(avl, box(108), box(834), NULL);
+  avl = gpr_avl_add(avl, box(524), box(835), NULL);
+  avl = remove_int(avl, 390);
+  avl = remove_int(avl, 307);
+  avl = gpr_avl_add(avl, box(722), box(838), NULL);
+  avl = gpr_avl_add(avl, box(907), box(839), NULL);
+  avl = remove_int(avl, 286);
+  avl = remove_int(avl, 337);
+  avl = remove_int(avl, 443);
+  avl = gpr_avl_add(avl, box(973), box(843), NULL);
+  avl = remove_int(avl, 930);
+  avl = remove_int(avl, 242);
+  avl = gpr_avl_add(avl, box(997), box(846), NULL);
+  avl = gpr_avl_add(avl, box(689), box(847), NULL);
+  avl = remove_int(avl, 318);
+  avl = gpr_avl_add(avl, box(703), box(849), NULL);
+  avl = gpr_avl_add(avl, box(868), box(850), NULL);
+  avl = gpr_avl_add(avl, box(200), box(851), NULL);
+  avl = gpr_avl_add(avl, box(960), box(852), NULL);
+  avl = gpr_avl_add(avl, box(80), box(853), NULL);
+  avl = remove_int(avl, 113);
+  avl = gpr_avl_add(avl, box(135), box(855), NULL);
+  avl = remove_int(avl, 529);
+  avl = gpr_avl_add(avl, box(366), box(857), NULL);
+  avl = remove_int(avl, 272);
+  avl = gpr_avl_add(avl, box(921), box(859), NULL);
+  avl = remove_int(avl, 497);
+  avl = gpr_avl_add(avl, box(712), box(861), NULL);
+  avl = remove_int(avl, 777);
+  avl = remove_int(avl, 505);
+  avl = remove_int(avl, 974);
+  avl = remove_int(avl, 497);
+  avl = gpr_avl_add(avl, box(388), box(866), NULL);
+  avl = gpr_avl_add(avl, box(29), box(867), NULL);
+  avl = gpr_avl_add(avl, box(180), box(868), NULL);
+  avl = gpr_avl_add(avl, box(983), box(869), NULL);
+  avl = gpr_avl_add(avl, box(72), box(870), NULL);
+  avl = gpr_avl_add(avl, box(693), box(871), NULL);
+  avl = gpr_avl_add(avl, box(567), box(872), NULL);
+  avl = remove_int(avl, 549);
+  avl = remove_int(avl, 351);
+  avl = gpr_avl_add(avl, box(1019), box(875), NULL);
+  avl = remove_int(avl, 585);
+  avl = remove_int(avl, 294);
+  avl = remove_int(avl, 61);
+  avl = gpr_avl_add(avl, box(409), box(879), NULL);
+  avl = gpr_avl_add(avl, box(984), box(880), NULL);
+  avl = gpr_avl_add(avl, box(830), box(881), NULL);
+  avl = remove_int(avl, 579);
+  avl = gpr_avl_add(avl, box(672), box(883), NULL);
+  avl = remove_int(avl, 968);
+
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_badcase3(void) {
+  gpr_avl avl;
+
+  gpr_log(GPR_DEBUG, "test_badcase3");
+
+  avl = gpr_avl_create(&int_int_vtable);
+  avl = remove_int(avl, 624);
+  avl = gpr_avl_add(avl, box(59), box(2), NULL);
+  avl = gpr_avl_add(avl, box(494), box(3), NULL);
+  avl = gpr_avl_add(avl, box(226), box(4), NULL);
+  avl = remove_int(avl, 524);
+  avl = gpr_avl_add(avl, box(540), box(6), NULL);
+  avl = remove_int(avl, 1008);
+  avl = gpr_avl_add(avl, box(502), box(8), NULL);
+  avl = remove_int(avl, 267);
+  avl = remove_int(avl, 764);
+  avl = remove_int(avl, 443);
+  avl = gpr_avl_add(avl, box(8), box(12), NULL);
+  avl = remove_int(avl, 291);
+  avl = remove_int(avl, 796);
+  avl = remove_int(avl, 1002);
+  avl = gpr_avl_add(avl, box(778), box(16), NULL);
+  avl = remove_int(avl, 621);
+  avl = remove_int(avl, 891);
+  avl = remove_int(avl, 880);
+  avl = gpr_avl_add(avl, box(197), box(20), NULL);
+  avl = gpr_avl_add(avl, box(441), box(21), NULL);
+  avl = gpr_avl_add(avl, box(719), box(22), NULL);
+  avl = remove_int(avl, 109);
+  avl = gpr_avl_add(avl, box(458), box(24), NULL);
+  avl = remove_int(avl, 86);
+  avl = gpr_avl_add(avl, box(897), box(26), NULL);
+  avl = gpr_avl_add(avl, box(997), box(27), NULL);
+  avl = remove_int(avl, 235);
+  avl = remove_int(avl, 425);
+  avl = remove_int(avl, 186);
+  avl = gpr_avl_add(avl, box(887), box(31), NULL);
+  avl = gpr_avl_add(avl, box(1005), box(32), NULL);
+  avl = gpr_avl_add(avl, box(778), box(33), NULL);
+  avl = gpr_avl_add(avl, box(575), box(34), NULL);
+  avl = remove_int(avl, 966);
+  avl = remove_int(avl, 1015);
+  avl = gpr_avl_add(avl, box(486), box(37), NULL);
+  avl = gpr_avl_add(avl, box(809), box(38), NULL);
+  avl = gpr_avl_add(avl, box(907), box(39), NULL);
+  avl = gpr_avl_add(avl, box(971), box(40), NULL);
+  avl = remove_int(avl, 441);
+  avl = remove_int(avl, 498);
+  avl = gpr_avl_add(avl, box(727), box(43), NULL);
+  avl = remove_int(avl, 679);
+  avl = remove_int(avl, 740);
+  avl = remove_int(avl, 532);
+  avl = gpr_avl_add(avl, box(805), box(47), NULL);
+  avl = remove_int(avl, 64);
+  avl = gpr_avl_add(avl, box(362), box(49), NULL);
+  avl = gpr_avl_add(avl, box(170), box(50), NULL);
+  avl = gpr_avl_add(avl, box(389), box(51), NULL);
+  avl = gpr_avl_add(avl, box(689), box(52), NULL);
+  avl = remove_int(avl, 871);
+  avl = gpr_avl_add(avl, box(447), box(54), NULL);
+  avl = remove_int(avl, 718);
+  avl = gpr_avl_add(avl, box(724), box(56), NULL);
+  avl = remove_int(avl, 215);
+  avl = gpr_avl_add(avl, box(550), box(58), NULL);
+  avl = remove_int(avl, 932);
+  avl = gpr_avl_add(avl, box(47), box(60), NULL);
+  avl = remove_int(avl, 46);
+  avl = remove_int(avl, 229);
+  avl = gpr_avl_add(avl, box(68), box(63), NULL);
+  avl = gpr_avl_add(avl, box(387), box(64), NULL);
+  avl = remove_int(avl, 933);
+  avl = remove_int(avl, 736);
+  avl = remove_int(avl, 719);
+  avl = gpr_avl_add(avl, box(150), box(68), NULL);
+  avl = remove_int(avl, 875);
+  avl = remove_int(avl, 298);
+  avl = gpr_avl_add(avl, box(991), box(71), NULL);
+  avl = remove_int(avl, 705);
+  avl = gpr_avl_add(avl, box(197), box(73), NULL);
+  avl = gpr_avl_add(avl, box(101), box(74), NULL);
+  avl = remove_int(avl, 436);
+  avl = gpr_avl_add(avl, box(755), box(76), NULL);
+  avl = gpr_avl_add(avl, box(727), box(77), NULL);
+  avl = remove_int(avl, 309);
+  avl = remove_int(avl, 253);
+  avl = gpr_avl_add(avl, box(203), box(80), NULL);
+  avl = remove_int(avl, 231);
+  avl = gpr_avl_add(avl, box(461), box(82), NULL);
+  avl = remove_int(avl, 316);
+  avl = remove_int(avl, 493);
+  avl = gpr_avl_add(avl, box(184), box(85), NULL);
+  avl = remove_int(avl, 737);
+  avl = gpr_avl_add(avl, box(790), box(87), NULL);
+  avl = gpr_avl_add(avl, box(335), box(88), NULL);
+  avl = remove_int(avl, 649);
+  avl = gpr_avl_add(avl, box(69), box(90), NULL);
+  avl = remove_int(avl, 585);
+  avl = remove_int(avl, 543);
+  avl = gpr_avl_add(avl, box(784), box(93), NULL);
+  avl = gpr_avl_add(avl, box(60), box(94), NULL);
+  avl = gpr_avl_add(avl, box(525), box(95), NULL);
+  avl = gpr_avl_add(avl, box(177), box(96), NULL);
+  avl = gpr_avl_add(avl, box(178), box(97), NULL);
+  avl = gpr_avl_add(avl, box(683), box(98), NULL);
+  avl = gpr_avl_add(avl, box(226), box(99), NULL);
+  avl = gpr_avl_add(avl, box(662), box(100), NULL);
+  avl = remove_int(avl, 944);
+  avl = gpr_avl_add(avl, box(562), box(102), NULL);
+  avl = gpr_avl_add(avl, box(793), box(103), NULL);
+  avl = remove_int(avl, 673);
+  avl = gpr_avl_add(avl, box(310), box(105), NULL);
+  avl = remove_int(avl, 479);
+  avl = remove_int(avl, 543);
+  avl = remove_int(avl, 159);
+  avl = remove_int(avl, 850);
+  avl = gpr_avl_add(avl, box(318), box(110), NULL);
+  avl = gpr_avl_add(avl, box(483), box(111), NULL);
+  avl = gpr_avl_add(avl, box(84), box(112), NULL);
+  avl = remove_int(avl, 109);
+  avl = gpr_avl_add(avl, box(132), box(114), NULL);
+  avl = gpr_avl_add(avl, box(920), box(115), NULL);
+  avl = remove_int(avl, 746);
+  avl = gpr_avl_add(avl, box(145), box(117), NULL);
+  avl = gpr_avl_add(avl, box(526), box(118), NULL);
+  avl = remove_int(avl, 158);
+  avl = gpr_avl_add(avl, box(332), box(120), NULL);
+  avl = gpr_avl_add(avl, box(918), box(121), NULL);
+  avl = remove_int(avl, 339);
+  avl = gpr_avl_add(avl, box(809), box(123), NULL);
+  avl = gpr_avl_add(avl, box(742), box(124), NULL);
+  avl = gpr_avl_add(avl, box(718), box(125), NULL);
+  avl = remove_int(avl, 988);
+  avl = remove_int(avl, 531);
+  avl = remove_int(avl, 840);
+  avl = gpr_avl_add(avl, box(816), box(129), NULL);
+  avl = gpr_avl_add(avl, box(976), box(130), NULL);
+  avl = remove_int(avl, 743);
+  avl = remove_int(avl, 528);
+  avl = remove_int(avl, 982);
+  avl = gpr_avl_add(avl, box(803), box(134), NULL);
+  avl = gpr_avl_add(avl, box(205), box(135), NULL);
+  avl = gpr_avl_add(avl, box(584), box(136), NULL);
+  avl = remove_int(avl, 923);
+  avl = remove_int(avl, 538);
+  avl = remove_int(avl, 398);
+  avl = remove_int(avl, 320);
+  avl = remove_int(avl, 292);
+  avl = gpr_avl_add(avl, box(270), box(142), NULL);
+  avl = gpr_avl_add(avl, box(333), box(143), NULL);
+  avl = remove_int(avl, 439);
+  avl = gpr_avl_add(avl, box(35), box(145), NULL);
+  avl = gpr_avl_add(avl, box(837), box(146), NULL);
+  avl = remove_int(avl, 65);
+  avl = remove_int(avl, 642);
+  avl = remove_int(avl, 371);
+  avl = remove_int(avl, 140);
+  avl = remove_int(avl, 533);
+  avl = remove_int(avl, 676);
+  avl = gpr_avl_add(avl, box(624), box(153), NULL);
+  avl = gpr_avl_add(avl, box(116), box(154), NULL);
+  avl = gpr_avl_add(avl, box(446), box(155), NULL);
+  avl = remove_int(avl, 91);
+  avl = remove_int(avl, 721);
+  avl = remove_int(avl, 537);
+  avl = gpr_avl_add(avl, box(448), box(159), NULL);
+  avl = remove_int(avl, 155);
+  avl = remove_int(avl, 344);
+  avl = remove_int(avl, 237);
+  avl = gpr_avl_add(avl, box(309), box(163), NULL);
+  avl = gpr_avl_add(avl, box(434), box(164), NULL);
+  avl = gpr_avl_add(avl, box(277), box(165), NULL);
+  avl = remove_int(avl, 233);
+  avl = gpr_avl_add(avl, box(275), box(167), NULL);
+  avl = gpr_avl_add(avl, box(218), box(168), NULL);
+  avl = gpr_avl_add(avl, box(76), box(169), NULL);
+  avl = gpr_avl_add(avl, box(898), box(170), NULL);
+  avl = remove_int(avl, 771);
+  avl = gpr_avl_add(avl, box(237), box(172), NULL);
+  avl = remove_int(avl, 327);
+  avl = gpr_avl_add(avl, box(499), box(174), NULL);
+  avl = remove_int(avl, 727);
+  avl = remove_int(avl, 234);
+  avl = remove_int(avl, 623);
+  avl = remove_int(avl, 458);
+  avl = remove_int(avl, 326);
+  avl = remove_int(avl, 589);
+  avl = gpr_avl_add(avl, box(442), box(181), NULL);
+  avl = remove_int(avl, 389);
+  avl = gpr_avl_add(avl, box(708), box(183), NULL);
+  avl = gpr_avl_add(avl, box(594), box(184), NULL);
+  avl = gpr_avl_add(avl, box(942), box(185), NULL);
+  avl = gpr_avl_add(avl, box(282), box(186), NULL);
+  avl = remove_int(avl, 434);
+  avl = remove_int(avl, 134);
+  avl = remove_int(avl, 270);
+  avl = remove_int(avl, 512);
+  avl = remove_int(avl, 265);
+  avl = remove_int(avl, 21);
+  avl = remove_int(avl, 193);
+  avl = remove_int(avl, 797);
+  avl = remove_int(avl, 347);
+  avl = gpr_avl_add(avl, box(99), box(196), NULL);
+  avl = gpr_avl_add(avl, box(161), box(197), NULL);
+  avl = remove_int(avl, 484);
+  avl = gpr_avl_add(avl, box(72), box(199), NULL);
+  avl = remove_int(avl, 629);
+  avl = gpr_avl_add(avl, box(522), box(201), NULL);
+  avl = remove_int(avl, 679);
+  avl = gpr_avl_add(avl, box(407), box(203), NULL);
+  avl = remove_int(avl, 693);
+  avl = gpr_avl_add(avl, box(424), box(205), NULL);
+  avl = gpr_avl_add(avl, box(651), box(206), NULL);
+  avl = gpr_avl_add(avl, box(927), box(207), NULL);
+  avl = remove_int(avl, 553);
+  avl = gpr_avl_add(avl, box(128), box(209), NULL);
+  avl = gpr_avl_add(avl, box(616), box(210), NULL);
+  avl = gpr_avl_add(avl, box(690), box(211), NULL);
+  avl = remove_int(avl, 241);
+  avl = remove_int(avl, 179);
+  avl = gpr_avl_add(avl, box(697), box(214), NULL);
+  avl = remove_int(avl, 779);
+  avl = gpr_avl_add(avl, box(241), box(216), NULL);
+  avl = remove_int(avl, 190);
+  avl = remove_int(avl, 210);
+  avl = gpr_avl_add(avl, box(711), box(219), NULL);
+  avl = remove_int(avl, 251);
+  avl = remove_int(avl, 61);
+  avl = gpr_avl_add(avl, box(800), box(222), NULL);
+  avl = remove_int(avl, 551);
+  avl = gpr_avl_add(avl, box(61), box(224), NULL);
+  avl = gpr_avl_add(avl, box(656), box(225), NULL);
+  avl = remove_int(avl, 130);
+  avl = remove_int(avl, 368);
+  avl = remove_int(avl, 150);
+  avl = remove_int(avl, 73);
+  avl = gpr_avl_add(avl, box(799), box(230), NULL);
+  avl = gpr_avl_add(avl, box(125), box(231), NULL);
+  avl = remove_int(avl, 107);
+  avl = gpr_avl_add(avl, box(938), box(233), NULL);
+  avl = gpr_avl_add(avl, box(914), box(234), NULL);
+  avl = gpr_avl_add(avl, box(197), box(235), NULL);
+  avl = remove_int(avl, 736);
+  avl = gpr_avl_add(avl, box(20), box(237), NULL);
+  avl = remove_int(avl, 224);
+  avl = remove_int(avl, 841);
+  avl = gpr_avl_add(avl, box(226), box(240), NULL);
+  avl = remove_int(avl, 963);
+  avl = remove_int(avl, 796);
+  avl = remove_int(avl, 728);
+  avl = gpr_avl_add(avl, box(855), box(244), NULL);
+  avl = gpr_avl_add(avl, box(769), box(245), NULL);
+  avl = gpr_avl_add(avl, box(631), box(246), NULL);
+  avl = remove_int(avl, 648);
+  avl = gpr_avl_add(avl, box(187), box(248), NULL);
+  avl = gpr_avl_add(avl, box(31), box(249), NULL);
+  avl = remove_int(avl, 163);
+  avl = gpr_avl_add(avl, box(218), box(251), NULL);
+  avl = gpr_avl_add(avl, box(488), box(252), NULL);
+  avl = gpr_avl_add(avl, box(387), box(253), NULL);
+  avl = gpr_avl_add(avl, box(809), box(254), NULL);
+  avl = gpr_avl_add(avl, box(997), box(255), NULL);
+  avl = remove_int(avl, 678);
+  avl = gpr_avl_add(avl, box(368), box(257), NULL);
+  avl = gpr_avl_add(avl, box(220), box(258), NULL);
+  avl = gpr_avl_add(avl, box(373), box(259), NULL);
+  avl = remove_int(avl, 874);
+  avl = remove_int(avl, 682);
+  avl = remove_int(avl, 1014);
+  avl = remove_int(avl, 195);
+  avl = gpr_avl_add(avl, box(868), box(264), NULL);
+  avl = remove_int(avl, 254);
+  avl = remove_int(avl, 456);
+  avl = gpr_avl_add(avl, box(906), box(267), NULL);
+  avl = remove_int(avl, 711);
+  avl = gpr_avl_add(avl, box(632), box(269), NULL);
+  avl = remove_int(avl, 474);
+  avl = gpr_avl_add(avl, box(508), box(271), NULL);
+  avl = gpr_avl_add(avl, box(518), box(272), NULL);
+  avl = remove_int(avl, 579);
+  avl = remove_int(avl, 948);
+  avl = gpr_avl_add(avl, box(789), box(275), NULL);
+  avl = gpr_avl_add(avl, box(48), box(276), NULL);
+  avl = gpr_avl_add(avl, box(256), box(277), NULL);
+  avl = gpr_avl_add(avl, box(754), box(278), NULL);
+  avl = remove_int(avl, 215);
+  avl = gpr_avl_add(avl, box(679), box(280), NULL);
+  avl = gpr_avl_add(avl, box(606), box(281), NULL);
+  avl = remove_int(avl, 941);
+  avl = remove_int(avl, 31);
+  avl = gpr_avl_add(avl, box(758), box(284), NULL);
+  avl = remove_int(avl, 101);
+  avl = gpr_avl_add(avl, box(244), box(286), NULL);
+  avl = gpr_avl_add(avl, box(337), box(287), NULL);
+  avl = gpr_avl_add(avl, box(461), box(288), NULL);
+  avl = remove_int(avl, 476);
+  avl = gpr_avl_add(avl, box(845), box(290), NULL);
+  avl = remove_int(avl, 160);
+  avl = gpr_avl_add(avl, box(690), box(292), NULL);
+  avl = remove_int(avl, 931);
+  avl = gpr_avl_add(avl, box(869), box(294), NULL);
+  avl = gpr_avl_add(avl, box(1019), box(295), NULL);
+  avl = remove_int(avl, 591);
+  avl = remove_int(avl, 635);
+  avl = remove_int(avl, 67);
+  avl = gpr_avl_add(avl, box(113), box(299), NULL);
+  avl = remove_int(avl, 305);
+  avl = gpr_avl_add(avl, box(10), box(301), NULL);
+  avl = remove_int(avl, 823);
+  avl = remove_int(avl, 288);
+  avl = remove_int(avl, 239);
+  avl = gpr_avl_add(avl, box(646), box(305), NULL);
+  avl = gpr_avl_add(avl, box(1006), box(306), NULL);
+  avl = gpr_avl_add(avl, box(954), box(307), NULL);
+  avl = gpr_avl_add(avl, box(199), box(308), NULL);
+  avl = gpr_avl_add(avl, box(69), box(309), NULL);
+  avl = gpr_avl_add(avl, box(984), box(310), NULL);
+  avl = remove_int(avl, 568);
+  avl = remove_int(avl, 666);
+  avl = remove_int(avl, 37);
+  avl = gpr_avl_add(avl, box(845), box(314), NULL);
+  avl = remove_int(avl, 535);
+  avl = remove_int(avl, 365);
+  avl = remove_int(avl, 676);
+  avl = remove_int(avl, 892);
+  avl = remove_int(avl, 425);
+  avl = remove_int(avl, 704);
+  avl = remove_int(avl, 168);
+  avl = gpr_avl_add(avl, box(853), box(322), NULL);
+  avl = gpr_avl_add(avl, box(335), box(323), NULL);
+  avl = gpr_avl_add(avl, box(961), box(324), NULL);
+  avl = gpr_avl_add(avl, box(73), box(325), NULL);
+  avl = remove_int(avl, 469);
+  avl = gpr_avl_add(avl, box(449), box(327), NULL);
+  avl = remove_int(avl, 821);
+  avl = gpr_avl_add(avl, box(845), box(329), NULL);
+  avl = remove_int(avl, 637);
+  avl = gpr_avl_add(avl, box(769), box(331), NULL);
+  avl = gpr_avl_add(avl, box(901), box(332), NULL);
+  avl = remove_int(avl, 142);
+  avl = remove_int(avl, 361);
+  avl = remove_int(avl, 876);
+  avl = gpr_avl_add(avl, box(614), box(336), NULL);
+  avl = gpr_avl_add(avl, box(729), box(337), NULL);
+  avl = remove_int(avl, 120);
+  avl = remove_int(avl, 473);
+  avl = remove_int(avl, 445);
+  avl = gpr_avl_add(avl, box(978), box(341), NULL);
+  avl = gpr_avl_add(avl, box(164), box(342), NULL);
+  avl = gpr_avl_add(avl, box(1), box(343), NULL);
+  avl = remove_int(avl, 890);
+  avl = gpr_avl_add(avl, box(605), box(345), NULL);
+  avl = gpr_avl_add(avl, box(178), box(346), NULL);
+  avl = gpr_avl_add(avl, box(481), box(347), NULL);
+  avl = gpr_avl_add(avl, box(772), box(348), NULL);
+  avl = remove_int(avl, 824);
+  avl = remove_int(avl, 167);
+  avl = remove_int(avl, 151);
+  avl = gpr_avl_add(avl, box(698), box(352), NULL);
+  avl = gpr_avl_add(avl, box(202), box(353), NULL);
+  avl = gpr_avl_add(avl, box(921), box(354), NULL);
+  avl = gpr_avl_add(avl, box(875), box(355), NULL);
+  avl = remove_int(avl, 197);
+  avl = remove_int(avl, 232);
+  avl = gpr_avl_add(avl, box(209), box(358), NULL);
+  avl = remove_int(avl, 324);
+  avl = remove_int(avl, 56);
+  avl = remove_int(avl, 579);
+  avl = remove_int(avl, 255);
+  avl = remove_int(avl, 290);
+  avl = gpr_avl_add(avl, box(661), box(364), NULL);
+  avl = gpr_avl_add(avl, box(113), box(365), NULL);
+  avl = remove_int(avl, 767);
+  avl = gpr_avl_add(avl, box(586), box(367), NULL);
+  avl = gpr_avl_add(avl, box(121), box(368), NULL);
+  avl = remove_int(avl, 235);
+  avl = remove_int(avl, 439);
+  avl = remove_int(avl, 360);
+  avl = gpr_avl_add(avl, box(916), box(372), NULL);
+  avl = remove_int(avl, 999);
+  avl = gpr_avl_add(avl, box(825), box(374), NULL);
+  avl = gpr_avl_add(avl, box(177), box(375), NULL);
+  avl = remove_int(avl, 204);
+  avl = remove_int(avl, 92);
+  avl = gpr_avl_add(avl, box(794), box(378), NULL);
+  avl = gpr_avl_add(avl, box(463), box(379), NULL);
+  avl = gpr_avl_add(avl, box(472), box(380), NULL);
+  avl = remove_int(avl, 235);
+  avl = gpr_avl_add(avl, box(840), box(382), NULL);
+  avl = remove_int(avl, 657);
+  avl = gpr_avl_add(avl, box(586), box(384), NULL);
+  avl = gpr_avl_add(avl, box(979), box(385), NULL);
+  avl = remove_int(avl, 979);
+  avl = gpr_avl_add(avl, box(639), box(387), NULL);
+  avl = remove_int(avl, 907);
+  avl = remove_int(avl, 973);
+  avl = gpr_avl_add(avl, box(913), box(390), NULL);
+  avl = gpr_avl_add(avl, box(566), box(391), NULL);
+  avl = gpr_avl_add(avl, box(883), box(392), NULL);
+  avl = gpr_avl_add(avl, box(552), box(393), NULL);
+  avl = gpr_avl_add(avl, box(16), box(394), NULL);
+  avl = remove_int(avl, 60);
+  avl = gpr_avl_add(avl, box(567), box(396), NULL);
+  avl = gpr_avl_add(avl, box(705), box(397), NULL);
+  avl = gpr_avl_add(avl, box(94), box(398), NULL);
+  avl = remove_int(avl, 321);
+  avl = gpr_avl_add(avl, box(207), box(400), NULL);
+  avl = gpr_avl_add(avl, box(682), box(401), NULL);
+  avl = gpr_avl_add(avl, box(592), box(402), NULL);
+  avl = gpr_avl_add(avl, box(10), box(403), NULL);
+  avl = remove_int(avl, 911);
+  avl = remove_int(avl, 161);
+  avl = gpr_avl_add(avl, box(86), box(406), NULL);
+  avl = remove_int(avl, 893);
+  avl = remove_int(avl, 362);
+  avl = gpr_avl_add(avl, box(599), box(409), NULL);
+  avl = remove_int(avl, 413);
+  avl = gpr_avl_add(avl, box(867), box(411), NULL);
+  avl = remove_int(avl, 955);
+  avl = gpr_avl_add(avl, box(341), box(413), NULL);
+  avl = gpr_avl_add(avl, box(887), box(414), NULL);
+  avl = remove_int(avl, 706);
+  avl = gpr_avl_add(avl, box(939), box(416), NULL);
+  avl = remove_int(avl, 233);
+  avl = remove_int(avl, 662);
+  avl = remove_int(avl, 984);
+  avl = remove_int(avl, 203);
+  avl = gpr_avl_add(avl, box(326), box(421), NULL);
+  avl = remove_int(avl, 848);
+  avl = gpr_avl_add(avl, box(235), box(423), NULL);
+  avl = remove_int(avl, 617);
+  avl = gpr_avl_add(avl, box(565), box(425), NULL);
+  avl = remove_int(avl, 469);
+  avl = gpr_avl_add(avl, box(988), box(427), NULL);
+  avl = remove_int(avl, 957);
+  avl = gpr_avl_add(avl, box(426), box(429), NULL);
+  avl = remove_int(avl, 967);
+  avl = gpr_avl_add(avl, box(890), box(431), NULL);
+  avl = gpr_avl_add(avl, box(473), box(432), NULL);
+  avl = remove_int(avl, 367);
+  avl = remove_int(avl, 344);
+  avl = remove_int(avl, 660);
+  avl = remove_int(avl, 448);
+  avl = remove_int(avl, 837);
+  avl = remove_int(avl, 158);
+  avl = gpr_avl_add(avl, box(459), box(439), NULL);
+  avl = remove_int(avl, 882);
+  avl = remove_int(avl, 782);
+  avl = gpr_avl_add(avl, box(408), box(442), NULL);
+  avl = gpr_avl_add(avl, box(728), box(443), NULL);
+  avl = remove_int(avl, 27);
+  avl = gpr_avl_add(avl, box(137), box(445), NULL);
+  avl = gpr_avl_add(avl, box(239), box(446), NULL);
+  avl = remove_int(avl, 854);
+  avl = gpr_avl_add(avl, box(104), box(448), NULL);
+  avl = gpr_avl_add(avl, box(823), box(449), NULL);
+  avl = gpr_avl_add(avl, box(524), box(450), NULL);
+  avl = gpr_avl_add(avl, box(995), box(451), NULL);
+  avl = remove_int(avl, 422);
+  avl = remove_int(avl, 220);
+  avl = gpr_avl_add(avl, box(856), box(454), NULL);
+  avl = remove_int(avl, 332);
+  avl = gpr_avl_add(avl, box(679), box(456), NULL);
+  avl = remove_int(avl, 18);
+  avl = gpr_avl_add(avl, box(837), box(458), NULL);
+  avl = remove_int(avl, 405);
+  avl = remove_int(avl, 877);
+  avl = remove_int(avl, 835);
+  avl = gpr_avl_add(avl, box(547), box(462), NULL);
+  avl = remove_int(avl, 805);
+  avl = remove_int(avl, 862);
+  avl = gpr_avl_add(avl, box(75), box(465), NULL);
+  avl = remove_int(avl, 41);
+  avl = gpr_avl_add(avl, box(310), box(467), NULL);
+  avl = remove_int(avl, 855);
+  avl = gpr_avl_add(avl, box(20), box(469), NULL);
+  avl = remove_int(avl, 186);
+  avl = remove_int(avl, 378);
+  avl = remove_int(avl, 442);
+  avl = remove_int(avl, 930);
+  avl = gpr_avl_add(avl, box(118), box(474), NULL);
+  avl = gpr_avl_add(avl, box(96), box(475), NULL);
+  avl = remove_int(avl, 854);
+  avl = gpr_avl_add(avl, box(65), box(477), NULL);
+  avl = gpr_avl_add(avl, box(573), box(478), NULL);
+  avl = gpr_avl_add(avl, box(4), box(479), NULL);
+  avl = gpr_avl_add(avl, box(451), box(480), NULL);
+  avl = gpr_avl_add(avl, box(774), box(481), NULL);
+  avl = gpr_avl_add(avl, box(126), box(482), NULL);
+  avl = remove_int(avl, 956);
+  avl = remove_int(avl, 591);
+  avl = remove_int(avl, 644);
+  avl = gpr_avl_add(avl, box(304), box(486), NULL);
+  avl = remove_int(avl, 620);
+  avl = remove_int(avl, 394);
+  avl = gpr_avl_add(avl, box(1002), box(489), NULL);
+  avl = gpr_avl_add(avl, box(837), box(490), NULL);
+  avl = remove_int(avl, 485);
+  avl = gpr_avl_add(avl, box(1005), box(492), NULL);
+  avl = remove_int(avl, 21);
+  avl = gpr_avl_add(avl, box(396), box(494), NULL);
+  avl = remove_int(avl, 966);
+  avl = gpr_avl_add(avl, box(105), box(496), NULL);
+  avl = gpr_avl_add(avl, box(316), box(497), NULL);
+  avl = remove_int(avl, 776);
+  avl = gpr_avl_add(avl, box(188), box(499), NULL);
+  avl = remove_int(avl, 200);
+  avl = gpr_avl_add(avl, box(98), box(501), NULL);
+  avl = gpr_avl_add(avl, box(831), box(502), NULL);
+  avl = gpr_avl_add(avl, box(227), box(503), NULL);
+  avl = gpr_avl_add(avl, box(220), box(504), NULL);
+  avl = remove_int(avl, 715);
+  avl = remove_int(avl, 279);
+  avl = gpr_avl_add(avl, box(701), box(507), NULL);
+  avl = gpr_avl_add(avl, box(726), box(508), NULL);
+  avl = gpr_avl_add(avl, box(815), box(509), NULL);
+  avl = gpr_avl_add(avl, box(749), box(510), NULL);
+  avl = remove_int(avl, 946);
+  avl = remove_int(avl, 449);
+  avl = remove_int(avl, 62);
+  avl = remove_int(avl, 487);
+  avl = gpr_avl_add(avl, box(545), box(515), NULL);
+  avl = remove_int(avl, 59);
+  avl = gpr_avl_add(avl, box(168), box(517), NULL);
+  avl = remove_int(avl, 337);
+  avl = gpr_avl_add(avl, box(69), box(519), NULL);
+  avl = remove_int(avl, 600);
+  avl = gpr_avl_add(avl, box(591), box(521), NULL);
+  avl = gpr_avl_add(avl, box(960), box(522), NULL);
+  avl = gpr_avl_add(avl, box(116), box(523), NULL);
+  avl = remove_int(avl, 991);
+  avl = gpr_avl_add(avl, box(760), box(525), NULL);
+  avl = gpr_avl_add(avl, box(664), box(526), NULL);
+  avl = gpr_avl_add(avl, box(547), box(527), NULL);
+  avl = remove_int(avl, 922);
+  avl = gpr_avl_add(avl, box(290), box(529), NULL);
+  avl = gpr_avl_add(avl, box(859), box(530), NULL);
+  avl = gpr_avl_add(avl, box(49), box(531), NULL);
+  avl = remove_int(avl, 455);
+  avl = remove_int(avl, 786);
+  avl = gpr_avl_add(avl, box(613), box(534), NULL);
+  avl = gpr_avl_add(avl, box(326), box(535), NULL);
+  avl = remove_int(avl, 615);
+  avl = gpr_avl_add(avl, box(45), box(537), NULL);
+  avl = gpr_avl_add(avl, box(162), box(538), NULL);
+  avl = gpr_avl_add(avl, box(189), box(539), NULL);
+  avl = remove_int(avl, 68);
+  avl = remove_int(avl, 846);
+  avl = gpr_avl_add(avl, box(608), box(542), NULL);
+  avl = remove_int(avl, 821);
+  avl = gpr_avl_add(avl, box(978), box(544), NULL);
+  avl = gpr_avl_add(avl, box(892), box(545), NULL);
+  avl = remove_int(avl, 924);
+  avl = gpr_avl_add(avl, box(708), box(547), NULL);
+  avl = remove_int(avl, 135);
+  avl = remove_int(avl, 124);
+  avl = gpr_avl_add(avl, box(301), box(550), NULL);
+  avl = gpr_avl_add(avl, box(939), box(551), NULL);
+  avl = gpr_avl_add(avl, box(344), box(552), NULL);
+  avl = remove_int(avl, 443);
+  avl = remove_int(avl, 122);
+  avl = gpr_avl_add(avl, box(636), box(555), NULL);
+  avl = remove_int(avl, 558);
+  avl = gpr_avl_add(avl, box(923), box(557), NULL);
+  avl = remove_int(avl, 827);
+  avl = gpr_avl_add(avl, box(649), box(559), NULL);
+  avl = gpr_avl_add(avl, box(808), box(560), NULL);
+  avl = remove_int(avl, 570);
+  avl = remove_int(avl, 434);
+  avl = gpr_avl_add(avl, box(40), box(563), NULL);
+  avl = gpr_avl_add(avl, box(725), box(564), NULL);
+  avl = remove_int(avl, 295);
+  avl = remove_int(avl, 615);
+  avl = remove_int(avl, 919);
+  avl = remove_int(avl, 170);
+  avl = remove_int(avl, 442);
+  avl = remove_int(avl, 971);
+  avl = gpr_avl_add(avl, box(483), box(571), NULL);
+  avl = gpr_avl_add(avl, box(512), box(572), NULL);
+  avl = remove_int(avl, 648);
+  avl = remove_int(avl, 78);
+  avl = remove_int(avl, 72);
+  avl = remove_int(avl, 790);
+  avl = remove_int(avl, 571);
+  avl = gpr_avl_add(avl, box(898), box(578), NULL);
+  avl = remove_int(avl, 770);
+  avl = remove_int(avl, 776);
+  avl = gpr_avl_add(avl, box(602), box(581), NULL);
+  avl = remove_int(avl, 251);
+  avl = gpr_avl_add(avl, box(303), box(583), NULL);
+  avl = remove_int(avl, 837);
+  avl = gpr_avl_add(avl, box(714), box(585), NULL);
+  avl = remove_int(avl, 800);
+  avl = gpr_avl_add(avl, box(266), box(587), NULL);
+  avl = gpr_avl_add(avl, box(555), box(588), NULL);
+  avl = remove_int(avl, 604);
+  avl = remove_int(avl, 163);
+  avl = remove_int(avl, 497);
+  avl = gpr_avl_add(avl, box(296), box(592), NULL);
+  avl = remove_int(avl, 129);
+  avl = gpr_avl_add(avl, box(656), box(594), NULL);
+  avl = remove_int(avl, 769);
+  avl = remove_int(avl, 941);
+  avl = gpr_avl_add(avl, box(775), box(597), NULL);
+  avl = gpr_avl_add(avl, box(846), box(598), NULL);
+  avl = remove_int(avl, 591);
+  avl = remove_int(avl, 801);
+  avl = remove_int(avl, 419);
+  avl = remove_int(avl, 455);
+  avl = gpr_avl_add(avl, box(866), box(603), NULL);
+  avl = gpr_avl_add(avl, box(575), box(604), NULL);
+  avl = gpr_avl_add(avl, box(620), box(605), NULL);
+  avl = remove_int(avl, 100);
+  avl = remove_int(avl, 667);
+  avl = gpr_avl_add(avl, box(138), box(608), NULL);
+  avl = gpr_avl_add(avl, box(566), box(609), NULL);
+  avl = gpr_avl_add(avl, box(673), box(610), NULL);
+  avl = gpr_avl_add(avl, box(178), box(611), NULL);
+  avl = remove_int(avl, 659);
+  avl = gpr_avl_add(avl, box(759), box(613), NULL);
+  avl = gpr_avl_add(avl, box(1008), box(614), NULL);
+  avl = remove_int(avl, 116);
+  avl = gpr_avl_add(avl, box(608), box(616), NULL);
+  avl = gpr_avl_add(avl, box(339), box(617), NULL);
+  avl = gpr_avl_add(avl, box(197), box(618), NULL);
+  avl = remove_int(avl, 25);
+  avl = remove_int(avl, 628);
+  avl = gpr_avl_add(avl, box(487), box(621), NULL);
+  avl = remove_int(avl, 739);
+  avl = remove_int(avl, 100);
+  avl = remove_int(avl, 928);
+  avl = gpr_avl_add(avl, box(647), box(625), NULL);
+  avl = remove_int(avl, 978);
+  avl = remove_int(avl, 143);
+  avl = remove_int(avl, 755);
+  avl = gpr_avl_add(avl, box(71), box(629), NULL);
+  avl = remove_int(avl, 205);
+  avl = gpr_avl_add(avl, box(501), box(631), NULL);
+  avl = remove_int(avl, 723);
+  avl = remove_int(avl, 852);
+  avl = remove_int(avl, 1021);
+  avl = remove_int(avl, 670);
+  avl = remove_int(avl, 500);
+  avl = gpr_avl_add(avl, box(330), box(637), NULL);
+  avl = remove_int(avl, 264);
+  avl = gpr_avl_add(avl, box(69), box(639), NULL);
+  avl = remove_int(avl, 73);
+  avl = gpr_avl_add(avl, box(745), box(641), NULL);
+  avl = remove_int(avl, 518);
+  avl = remove_int(avl, 641);
+  avl = remove_int(avl, 768);
+  avl = gpr_avl_add(avl, box(988), box(645), NULL);
+  avl = gpr_avl_add(avl, box(899), box(646), NULL);
+  avl = remove_int(avl, 763);
+  avl = remove_int(avl, 281);
+  avl = remove_int(avl, 496);
+  avl = gpr_avl_add(avl, box(445), box(650), NULL);
+  avl = remove_int(avl, 905);
+  avl = gpr_avl_add(avl, box(275), box(652), NULL);
+  avl = gpr_avl_add(avl, box(137), box(653), NULL);
+  avl = remove_int(avl, 642);
+  avl = gpr_avl_add(avl, box(708), box(655), NULL);
+  avl = remove_int(avl, 922);
+  avl = gpr_avl_add(avl, box(743), box(657), NULL);
+  avl = remove_int(avl, 295);
+  avl = remove_int(avl, 665);
+  avl = remove_int(avl, 48);
+  avl = gpr_avl_add(avl, box(1012), box(661), NULL);
+  avl = remove_int(avl, 71);
+  avl = remove_int(avl, 523);
+  avl = gpr_avl_add(avl, box(319), box(664), NULL);
+  avl = remove_int(avl, 632);
+  avl = gpr_avl_add(avl, box(137), box(666), NULL);
+  avl = gpr_avl_add(avl, box(686), box(667), NULL);
+  avl = gpr_avl_add(avl, box(724), box(668), NULL);
+  avl = gpr_avl_add(avl, box(952), box(669), NULL);
+  avl = gpr_avl_add(avl, box(5), box(670), NULL);
+  avl = remove_int(avl, 35);
+  avl = gpr_avl_add(avl, box(43), box(672), NULL);
+  avl = gpr_avl_add(avl, box(320), box(673), NULL);
+  avl = gpr_avl_add(avl, box(115), box(674), NULL);
+  avl = remove_int(avl, 377);
+  avl = remove_int(avl, 591);
+  avl = remove_int(avl, 87);
+  avl = remove_int(avl, 93);
+  avl = gpr_avl_add(avl, box(1016), box(679), NULL);
+  avl = gpr_avl_add(avl, box(605), box(680), NULL);
+  avl = gpr_avl_add(avl, box(152), box(681), NULL);
+  avl = gpr_avl_add(avl, box(113), box(682), NULL);
+  avl = remove_int(avl, 131);
+  avl = remove_int(avl, 637);
+  avl = gpr_avl_add(avl, box(156), box(685), NULL);
+  avl = remove_int(avl, 696);
+  avl = gpr_avl_add(avl, box(546), box(687), NULL);
+  avl = remove_int(avl, 970);
+  avl = remove_int(avl, 53);
+  avl = remove_int(avl, 827);
+  avl = remove_int(avl, 224);
+  avl = remove_int(avl, 796);
+  avl = remove_int(avl, 34);
+  avl = remove_int(avl, 922);
+  avl = remove_int(avl, 277);
+  avl = remove_int(avl, 650);
+  avl = remove_int(avl, 222);
+  avl = remove_int(avl, 244);
+  avl = remove_int(avl, 576);
+  avl = remove_int(avl, 413);
+  avl = gpr_avl_add(avl, box(500), box(701), NULL);
+  avl = remove_int(avl, 924);
+  avl = gpr_avl_add(avl, box(825), box(703), NULL);
+  avl = remove_int(avl, 888);
+  avl = remove_int(avl, 931);
+  avl = gpr_avl_add(avl, box(285), box(706), NULL);
+  avl = remove_int(avl, 62);
+  avl = remove_int(avl, 444);
+  avl = remove_int(avl, 946);
+  avl = gpr_avl_add(avl, box(122), box(710), NULL);
+  avl = gpr_avl_add(avl, box(846), box(711), NULL);
+  avl = remove_int(avl, 628);
+  avl = gpr_avl_add(avl, box(511), box(713), NULL);
+  avl = gpr_avl_add(avl, box(398), box(714), NULL);
+  avl = remove_int(avl, 730);
+  avl = gpr_avl_add(avl, box(797), box(716), NULL);
+  avl = remove_int(avl, 897);
+  avl = remove_int(avl, 228);
+  avl = remove_int(avl, 544);
+  avl = remove_int(avl, 552);
+  avl = remove_int(avl, 783);
+  avl = remove_int(avl, 583);
+  avl = remove_int(avl, 894);
+  avl = remove_int(avl, 942);
+  avl = gpr_avl_add(avl, box(346), box(725), NULL);
+  avl = gpr_avl_add(avl, box(1015), box(726), NULL);
+  avl = remove_int(avl, 813);
+  avl = gpr_avl_add(avl, box(213), box(728), NULL);
+  avl = remove_int(avl, 468);
+  avl = remove_int(avl, 365);
+  avl = remove_int(avl, 399);
+  avl = gpr_avl_add(avl, box(380), box(732), NULL);
+  avl = remove_int(avl, 835);
+  avl = remove_int(avl, 970);
+  avl = gpr_avl_add(avl, box(700), box(735), NULL);
+  avl = gpr_avl_add(avl, box(807), box(736), NULL);
+  avl = remove_int(avl, 312);
+  avl = remove_int(avl, 282);
+  avl = remove_int(avl, 370);
+  avl = remove_int(avl, 999);
+  avl = remove_int(avl, 241);
+  avl = remove_int(avl, 884);
+  avl = gpr_avl_add(avl, box(587), box(743), NULL);
+  avl = gpr_avl_add(avl, box(332), box(744), NULL);
+  avl = remove_int(avl, 686);
+  avl = remove_int(avl, 206);
+  avl = remove_int(avl, 835);
+  avl = gpr_avl_add(avl, box(334), box(748), NULL);
+  avl = remove_int(avl, 171);
+  avl = gpr_avl_add(avl, box(1002), box(750), NULL);
+  avl = gpr_avl_add(avl, box(779), box(751), NULL);
+  avl = gpr_avl_add(avl, box(307), box(752), NULL);
+  avl = gpr_avl_add(avl, box(127), box(753), NULL);
+  avl = gpr_avl_add(avl, box(251), box(754), NULL);
+  avl = remove_int(avl, 790);
+  avl = remove_int(avl, 189);
+  avl = remove_int(avl, 193);
+  avl = remove_int(avl, 38);
+  avl = remove_int(avl, 124);
+  avl = gpr_avl_add(avl, box(812), box(760), NULL);
+  avl = remove_int(avl, 43);
+  avl = gpr_avl_add(avl, box(871), box(762), NULL);
+  avl = gpr_avl_add(avl, box(580), box(763), NULL);
+  avl = remove_int(avl, 501);
+  avl = remove_int(avl, 462);
+  avl = remove_int(avl, 599);
+  avl = gpr_avl_add(avl, box(240), box(767), NULL);
+  avl = gpr_avl_add(avl, box(285), box(768), NULL);
+  avl = gpr_avl_add(avl, box(472), box(769), NULL);
+  avl = remove_int(avl, 865);
+  avl = remove_int(avl, 763);
+  avl = remove_int(avl, 245);
+  avl = remove_int(avl, 80);
+  avl = remove_int(avl, 713);
+  avl = remove_int(avl, 654);
+  avl = remove_int(avl, 1014);
+  avl = gpr_avl_add(avl, box(495), box(777), NULL);
+  avl = gpr_avl_add(avl, box(552), box(778), NULL);
+  avl = remove_int(avl, 19);
+  avl = remove_int(avl, 803);
+  avl = gpr_avl_add(avl, box(508), box(781), NULL);
+  avl = remove_int(avl, 699);
+  avl = remove_int(avl, 260);
+  avl = remove_int(avl, 92);
+  avl = remove_int(avl, 497);
+  avl = gpr_avl_add(avl, box(970), box(786), NULL);
+  avl = remove_int(avl, 987);
+  avl = remove_int(avl, 168);
+  avl = remove_int(avl, 476);
+  avl = remove_int(avl, 248);
+  avl = gpr_avl_add(avl, box(358), box(791), NULL);
+  avl = remove_int(avl, 804);
+  avl = remove_int(avl, 77);
+  avl = remove_int(avl, 905);
+  avl = remove_int(avl, 362);
+  avl = gpr_avl_add(avl, box(578), box(796), NULL);
+  avl = remove_int(avl, 38);
+  avl = remove_int(avl, 595);
+  avl = gpr_avl_add(avl, box(213), box(799), NULL);
+  avl = remove_int(avl, 7);
+  avl = remove_int(avl, 620);
+  avl = gpr_avl_add(avl, box(946), box(802), NULL);
+  avl = remove_int(avl, 145);
+  avl = gpr_avl_add(avl, box(628), box(804), NULL);
+  avl = remove_int(avl, 972);
+  avl = gpr_avl_add(avl, box(728), box(806), NULL);
+  avl = remove_int(avl, 91);
+  avl = gpr_avl_add(avl, box(136), box(808), NULL);
+  avl = gpr_avl_add(avl, box(841), box(809), NULL);
+  avl = gpr_avl_add(avl, box(265), box(810), NULL);
+  avl = gpr_avl_add(avl, box(701), box(811), NULL);
+  avl = gpr_avl_add(avl, box(27), box(812), NULL);
+  avl = remove_int(avl, 72);
+  avl = remove_int(avl, 14);
+  avl = gpr_avl_add(avl, box(286), box(815), NULL);
+  avl = remove_int(avl, 996);
+  avl = remove_int(avl, 998);
+  avl = gpr_avl_add(avl, box(466), box(818), NULL);
+  avl = remove_int(avl, 1009);
+  avl = remove_int(avl, 741);
+  avl = remove_int(avl, 947);
+  avl = remove_int(avl, 241);
+  avl = remove_int(avl, 954);
+  avl = remove_int(avl, 183);
+  avl = remove_int(avl, 395);
+  avl = remove_int(avl, 951);
+  avl = gpr_avl_add(avl, box(267), box(827), NULL);
+  avl = remove_int(avl, 812);
+  avl = gpr_avl_add(avl, box(577), box(829), NULL);
+  avl = remove_int(avl, 624);
+  avl = remove_int(avl, 847);
+  avl = remove_int(avl, 745);
+  avl = gpr_avl_add(avl, box(491), box(833), NULL);
+  avl = gpr_avl_add(avl, box(941), box(834), NULL);
+  avl = remove_int(avl, 258);
+  avl = gpr_avl_add(avl, box(410), box(836), NULL);
+  avl = gpr_avl_add(avl, box(80), box(837), NULL);
+  avl = gpr_avl_add(avl, box(196), box(838), NULL);
+  avl = gpr_avl_add(avl, box(5), box(839), NULL);
+  avl = remove_int(avl, 782);
+  avl = gpr_avl_add(avl, box(827), box(841), NULL);
+  avl = remove_int(avl, 472);
+  avl = remove_int(avl, 664);
+  avl = gpr_avl_add(avl, box(409), box(844), NULL);
+  avl = gpr_avl_add(avl, box(62), box(845), NULL);
+  avl = remove_int(avl, 56);
+  avl = remove_int(avl, 606);
+  avl = remove_int(avl, 707);
+  avl = remove_int(avl, 989);
+  avl = remove_int(avl, 549);
+  avl = remove_int(avl, 259);
+  avl = gpr_avl_add(avl, box(405), box(852), NULL);
+  avl = remove_int(avl, 587);
+  avl = remove_int(avl, 350);
+  avl = gpr_avl_add(avl, box(980), box(855), NULL);
+  avl = gpr_avl_add(avl, box(992), box(856), NULL);
+  avl = gpr_avl_add(avl, box(818), box(857), NULL);
+  avl = remove_int(avl, 853);
+  avl = remove_int(avl, 701);
+  avl = gpr_avl_add(avl, box(675), box(860), NULL);
+  avl = remove_int(avl, 248);
+  avl = remove_int(avl, 649);
+  avl = gpr_avl_add(avl, box(508), box(863), NULL);
+  avl = remove_int(avl, 927);
+  avl = gpr_avl_add(avl, box(957), box(865), NULL);
+  avl = gpr_avl_add(avl, box(698), box(866), NULL);
+  avl = gpr_avl_add(avl, box(388), box(867), NULL);
+  avl = gpr_avl_add(avl, box(532), box(868), NULL);
+  avl = gpr_avl_add(avl, box(681), box(869), NULL);
+  avl = remove_int(avl, 544);
+  avl = remove_int(avl, 991);
+  avl = remove_int(avl, 397);
+  avl = gpr_avl_add(avl, box(954), box(873), NULL);
+  avl = gpr_avl_add(avl, box(219), box(874), NULL);
+  avl = gpr_avl_add(avl, box(465), box(875), NULL);
+  avl = remove_int(avl, 371);
+  avl = gpr_avl_add(avl, box(601), box(877), NULL);
+  avl = gpr_avl_add(avl, box(543), box(878), NULL);
+  avl = remove_int(avl, 329);
+  avl = gpr_avl_add(avl, box(560), box(880), NULL);
+  avl = remove_int(avl, 898);
+  avl = gpr_avl_add(avl, box(455), box(882), NULL);
+  avl = remove_int(avl, 313);
+  avl = gpr_avl_add(avl, box(215), box(884), NULL);
+  avl = remove_int(avl, 846);
+  avl = gpr_avl_add(avl, box(608), box(886), NULL);
+  avl = remove_int(avl, 248);
+  avl = gpr_avl_add(avl, box(575), box(888), NULL);
+  avl = remove_int(avl, 207);
+  avl = remove_int(avl, 810);
+  avl = remove_int(avl, 665);
+  avl = remove_int(avl, 361);
+  avl = gpr_avl_add(avl, box(154), box(893), NULL);
+  avl = gpr_avl_add(avl, box(329), box(894), NULL);
+  avl = gpr_avl_add(avl, box(326), box(895), NULL);
+  avl = remove_int(avl, 746);
+  avl = remove_int(avl, 99);
+  avl = gpr_avl_add(avl, box(464), box(898), NULL);
+  avl = gpr_avl_add(avl, box(141), box(899), NULL);
+  avl = remove_int(avl, 383);
+  avl = gpr_avl_add(avl, box(414), box(901), NULL);
+  avl = gpr_avl_add(avl, box(777), box(902), NULL);
+  avl = remove_int(avl, 972);
+  avl = remove_int(avl, 841);
+  avl = remove_int(avl, 100);
+  avl = gpr_avl_add(avl, box(828), box(906), NULL);
+  avl = remove_int(avl, 785);
+  avl = gpr_avl_add(avl, box(1008), box(908), NULL);
+  avl = gpr_avl_add(avl, box(46), box(909), NULL);
+  avl = remove_int(avl, 399);
+  avl = gpr_avl_add(avl, box(178), box(911), NULL);
+  avl = gpr_avl_add(avl, box(573), box(912), NULL);
+  avl = remove_int(avl, 299);
+  avl = gpr_avl_add(avl, box(690), box(914), NULL);
+  avl = gpr_avl_add(avl, box(692), box(915), NULL);
+  avl = remove_int(avl, 404);
+  avl = remove_int(avl, 16);
+  avl = remove_int(avl, 746);
+  avl = remove_int(avl, 486);
+  avl = remove_int(avl, 119);
+  avl = gpr_avl_add(avl, box(167), box(921), NULL);
+  avl = remove_int(avl, 328);
+  avl = gpr_avl_add(avl, box(89), box(923), NULL);
+  avl = remove_int(avl, 867);
+  avl = remove_int(avl, 626);
+  avl = remove_int(avl, 507);
+  avl = gpr_avl_add(avl, box(365), box(927), NULL);
+  avl = gpr_avl_add(avl, box(58), box(928), NULL);
+  avl = gpr_avl_add(avl, box(70), box(929), NULL);
+  avl = remove_int(avl, 81);
+  avl = remove_int(avl, 797);
+  avl = gpr_avl_add(avl, box(846), box(932), NULL);
+  avl = remove_int(avl, 642);
+  avl = gpr_avl_add(avl, box(777), box(934), NULL);
+  avl = remove_int(avl, 107);
+  avl = gpr_avl_add(avl, box(691), box(936), NULL);
+  avl = gpr_avl_add(avl, box(820), box(937), NULL);
+  avl = gpr_avl_add(avl, box(202), box(938), NULL);
+  avl = gpr_avl_add(avl, box(308), box(939), NULL);
+  avl = gpr_avl_add(avl, box(20), box(940), NULL);
+  avl = remove_int(avl, 289);
+  avl = gpr_avl_add(avl, box(714), box(942), NULL);
+  avl = gpr_avl_add(avl, box(584), box(943), NULL);
+  avl = remove_int(avl, 294);
+  avl = gpr_avl_add(avl, box(496), box(945), NULL);
+  avl = gpr_avl_add(avl, box(394), box(946), NULL);
+  avl = gpr_avl_add(avl, box(860), box(947), NULL);
+  avl = gpr_avl_add(avl, box(58), box(948), NULL);
+  avl = remove_int(avl, 784);
+  avl = remove_int(avl, 584);
+  avl = remove_int(avl, 708);
+  avl = gpr_avl_add(avl, box(142), box(952), NULL);
+  avl = gpr_avl_add(avl, box(247), box(953), NULL);
+  avl = gpr_avl_add(avl, box(389), box(954), NULL);
+  avl = remove_int(avl, 390);
+  avl = gpr_avl_add(avl, box(465), box(956), NULL);
+  avl = gpr_avl_add(avl, box(936), box(957), NULL);
+  avl = gpr_avl_add(avl, box(309), box(958), NULL);
+  avl = remove_int(avl, 928);
+  avl = remove_int(avl, 128);
+  avl = remove_int(avl, 979);
+  avl = remove_int(avl, 670);
+  avl = remove_int(avl, 738);
+  avl = remove_int(avl, 271);
+  avl = remove_int(avl, 540);
+  avl = gpr_avl_add(avl, box(365), box(966), NULL);
+  avl = remove_int(avl, 82);
+  avl = gpr_avl_add(avl, box(728), box(968), NULL);
+  avl = remove_int(avl, 852);
+  avl = gpr_avl_add(avl, box(884), box(970), NULL);
+  avl = gpr_avl_add(avl, box(502), box(971), NULL);
+  avl = remove_int(avl, 898);
+  avl = remove_int(avl, 481);
+  avl = gpr_avl_add(avl, box(911), box(974), NULL);
+  avl = remove_int(avl, 787);
+  avl = remove_int(avl, 785);
+  avl = remove_int(avl, 537);
+  avl = remove_int(avl, 535);
+  avl = remove_int(avl, 136);
+  avl = remove_int(avl, 749);
+  avl = remove_int(avl, 637);
+  avl = remove_int(avl, 900);
+  avl = gpr_avl_add(avl, box(598), box(983), NULL);
+  avl = remove_int(avl, 25);
+  avl = remove_int(avl, 697);
+  avl = gpr_avl_add(avl, box(645), box(986), NULL);
+  avl = gpr_avl_add(avl, box(211), box(987), NULL);
+  avl = gpr_avl_add(avl, box(589), box(988), NULL);
+  avl = remove_int(avl, 702);
+  avl = gpr_avl_add(avl, box(53), box(990), NULL);
+  avl = remove_int(avl, 492);
+  avl = remove_int(avl, 185);
+  avl = remove_int(avl, 246);
+  avl = remove_int(avl, 257);
+  avl = remove_int(avl, 502);
+  avl = remove_int(avl, 34);
+  avl = gpr_avl_add(avl, box(74), box(997), NULL);
+  avl = gpr_avl_add(avl, box(834), box(998), NULL);
+  avl = gpr_avl_add(avl, box(514), box(999), NULL);
+  avl = gpr_avl_add(avl, box(75), box(1000), NULL);
+  avl = remove_int(avl, 745);
+  avl = gpr_avl_add(avl, box(362), box(1002), NULL);
+  avl = remove_int(avl, 215);
+  avl = gpr_avl_add(avl, box(624), box(1004), NULL);
+  avl = remove_int(avl, 404);
+  avl = remove_int(avl, 359);
+  avl = remove_int(avl, 491);
+  avl = gpr_avl_add(avl, box(903), box(1008), NULL);
+  avl = gpr_avl_add(avl, box(240), box(1009), NULL);
+  avl = remove_int(avl, 95);
+  avl = gpr_avl_add(avl, box(119), box(1011), NULL);
+  avl = gpr_avl_add(avl, box(857), box(1012), NULL);
+  avl = remove_int(avl, 39);
+  avl = remove_int(avl, 866);
+  avl = gpr_avl_add(avl, box(503), box(1015), NULL);
+  avl = gpr_avl_add(avl, box(740), box(1016), NULL);
+  avl = remove_int(avl, 637);
+  avl = remove_int(avl, 156);
+  avl = remove_int(avl, 6);
+  avl = remove_int(avl, 745);
+  avl = remove_int(avl, 433);
+  avl = remove_int(avl, 283);
+  avl = gpr_avl_add(avl, box(625), box(1023), NULL);
+  avl = remove_int(avl, 638);
+  avl = gpr_avl_add(avl, box(299), box(1025), NULL);
+  avl = gpr_avl_add(avl, box(584), box(1026), NULL);
+  avl = remove_int(avl, 863);
+  avl = gpr_avl_add(avl, box(612), box(1028), NULL);
+  avl = gpr_avl_add(avl, box(62), box(1029), NULL);
+  avl = gpr_avl_add(avl, box(432), box(1030), NULL);
+  avl = remove_int(avl, 371);
+  avl = remove_int(avl, 790);
+  avl = remove_int(avl, 227);
+  avl = remove_int(avl, 836);
+  avl = gpr_avl_add(avl, box(703), box(1035), NULL);
+  avl = gpr_avl_add(avl, box(644), box(1036), NULL);
+  avl = remove_int(avl, 638);
+  avl = gpr_avl_add(avl, box(13), box(1038), NULL);
+  avl = remove_int(avl, 66);
+  avl = remove_int(avl, 82);
+  avl = gpr_avl_add(avl, box(362), box(1041), NULL);
+  avl = gpr_avl_add(avl, box(783), box(1042), NULL);
+  avl = remove_int(avl, 60);
+  avl = gpr_avl_add(avl, box(80), box(1044), NULL);
+  avl = gpr_avl_add(avl, box(825), box(1045), NULL);
+  avl = gpr_avl_add(avl, box(688), box(1046), NULL);
+  avl = gpr_avl_add(avl, box(662), box(1047), NULL);
+  avl = remove_int(avl, 156);
+  avl = remove_int(avl, 376);
+  avl = remove_int(avl, 99);
+  avl = gpr_avl_add(avl, box(526), box(1051), NULL);
+  avl = gpr_avl_add(avl, box(168), box(1052), NULL);
+  avl = remove_int(avl, 646);
+  avl = remove_int(avl, 380);
+  avl = remove_int(avl, 833);
+  avl = gpr_avl_add(avl, box(53), box(1056), NULL);
+  avl = remove_int(avl, 105);
+  avl = gpr_avl_add(avl, box(373), box(1058), NULL);
+  avl = gpr_avl_add(avl, box(184), box(1059), NULL);
+  avl = remove_int(avl, 288);
+  avl = gpr_avl_add(avl, box(966), box(1061), NULL);
+  avl = remove_int(avl, 158);
+  avl = gpr_avl_add(avl, box(406), box(1063), NULL);
+  avl = remove_int(avl, 470);
+  avl = gpr_avl_add(avl, box(283), box(1065), NULL);
+  avl = gpr_avl_add(avl, box(838), box(1066), NULL);
+  avl = gpr_avl_add(avl, box(288), box(1067), NULL);
+  avl = gpr_avl_add(avl, box(950), box(1068), NULL);
+  avl = gpr_avl_add(avl, box(163), box(1069), NULL);
+  avl = remove_int(avl, 623);
+  avl = remove_int(avl, 769);
+  avl = gpr_avl_add(avl, box(144), box(1072), NULL);
+  avl = gpr_avl_add(avl, box(489), box(1073), NULL);
+  avl = remove_int(avl, 15);
+  avl = gpr_avl_add(avl, box(971), box(1075), NULL);
+  avl = remove_int(avl, 660);
+  avl = gpr_avl_add(avl, box(255), box(1077), NULL);
+  avl = remove_int(avl, 494);
+  avl = gpr_avl_add(avl, box(109), box(1079), NULL);
+  avl = gpr_avl_add(avl, box(420), box(1080), NULL);
+  avl = gpr_avl_add(avl, box(509), box(1081), NULL);
+  avl = remove_int(avl, 178);
+  avl = gpr_avl_add(avl, box(216), box(1083), NULL);
+  avl = gpr_avl_add(avl, box(707), box(1084), NULL);
+  avl = gpr_avl_add(avl, box(411), box(1085), NULL);
+  avl = gpr_avl_add(avl, box(352), box(1086), NULL);
+  avl = remove_int(avl, 983);
+  avl = gpr_avl_add(avl, box(6), box(1088), NULL);
+  avl = gpr_avl_add(avl, box(1014), box(1089), NULL);
+  avl = remove_int(avl, 98);
+  avl = remove_int(avl, 325);
+  avl = gpr_avl_add(avl, box(851), box(1092), NULL);
+  avl = remove_int(avl, 553);
+  avl = gpr_avl_add(avl, box(218), box(1094), NULL);
+  avl = gpr_avl_add(avl, box(261), box(1095), NULL);
+  avl = remove_int(avl, 31);
+  avl = gpr_avl_add(avl, box(872), box(1097), NULL);
+  avl = remove_int(avl, 543);
+  avl = remove_int(avl, 314);
+  avl = remove_int(avl, 443);
+  avl = gpr_avl_add(avl, box(533), box(1101), NULL);
+  avl = remove_int(avl, 881);
+  avl = remove_int(avl, 269);
+  avl = remove_int(avl, 940);
+  avl = remove_int(avl, 909);
+  avl = remove_int(avl, 197);
+  avl = remove_int(avl, 773);
+  avl = remove_int(avl, 790);
+  avl = remove_int(avl, 345);
+  avl = gpr_avl_add(avl, box(965), box(1110), NULL);
+  avl = remove_int(avl, 622);
+  avl = gpr_avl_add(avl, box(352), box(1112), NULL);
+  avl = remove_int(avl, 182);
+  avl = gpr_avl_add(avl, box(534), box(1114), NULL);
+  avl = gpr_avl_add(avl, box(97), box(1115), NULL);
+  avl = gpr_avl_add(avl, box(198), box(1116), NULL);
+  avl = remove_int(avl, 750);
+  avl = gpr_avl_add(avl, box(98), box(1118), NULL);
+  avl = remove_int(avl, 943);
+  avl = gpr_avl_add(avl, box(254), box(1120), NULL);
+  avl = gpr_avl_add(avl, box(30), box(1121), NULL);
+  avl = remove_int(avl, 14);
+  avl = remove_int(avl, 475);
+  avl = remove_int(avl, 82);
+  avl = gpr_avl_add(avl, box(789), box(1125), NULL);
+  avl = gpr_avl_add(avl, box(402), box(1126), NULL);
+  avl = remove_int(avl, 1019);
+  avl = gpr_avl_add(avl, box(858), box(1128), NULL);
+  avl = gpr_avl_add(avl, box(625), box(1129), NULL);
+  avl = remove_int(avl, 675);
+  avl = remove_int(avl, 323);
+  avl = gpr_avl_add(avl, box(329), box(1132), NULL);
+  avl = remove_int(avl, 929);
+  avl = remove_int(avl, 44);
+  avl = gpr_avl_add(avl, box(443), box(1135), NULL);
+  avl = gpr_avl_add(avl, box(653), box(1136), NULL);
+  avl = gpr_avl_add(avl, box(750), box(1137), NULL);
+  avl = gpr_avl_add(avl, box(252), box(1138), NULL);
+  avl = gpr_avl_add(avl, box(449), box(1139), NULL);
+  avl = remove_int(avl, 1022);
+  avl = remove_int(avl, 357);
+  avl = remove_int(avl, 602);
+  avl = remove_int(avl, 131);
+  avl = gpr_avl_add(avl, box(531), box(1144), NULL);
+  avl = remove_int(avl, 806);
+  avl = gpr_avl_add(avl, box(455), box(1146), NULL);
+  avl = remove_int(avl, 31);
+  avl = gpr_avl_add(avl, box(154), box(1148), NULL);
+  avl = gpr_avl_add(avl, box(189), box(1149), NULL);
+  avl = remove_int(avl, 786);
+  avl = gpr_avl_add(avl, box(496), box(1151), NULL);
+  avl = gpr_avl_add(avl, box(81), box(1152), NULL);
+  avl = gpr_avl_add(avl, box(59), box(1153), NULL);
+  avl = remove_int(avl, 424);
+  avl = remove_int(avl, 668);
+  avl = gpr_avl_add(avl, box(723), box(1156), NULL);
+  avl = gpr_avl_add(avl, box(822), box(1157), NULL);
+  avl = gpr_avl_add(avl, box(354), box(1158), NULL);
+  avl = remove_int(avl, 738);
+  avl = gpr_avl_add(avl, box(686), box(1160), NULL);
+  avl = gpr_avl_add(avl, box(43), box(1161), NULL);
+  avl = gpr_avl_add(avl, box(625), box(1162), NULL);
+  avl = gpr_avl_add(avl, box(902), box(1163), NULL);
+  avl = gpr_avl_add(avl, box(12), box(1164), NULL);
+  avl = gpr_avl_add(avl, box(977), box(1165), NULL);
+  avl = gpr_avl_add(avl, box(699), box(1166), NULL);
+  avl = gpr_avl_add(avl, box(189), box(1167), NULL);
+  avl = remove_int(avl, 672);
+  avl = remove_int(avl, 90);
+  avl = remove_int(avl, 757);
+  avl = remove_int(avl, 494);
+  avl = gpr_avl_add(avl, box(759), box(1172), NULL);
+  avl = remove_int(avl, 758);
+  avl = remove_int(avl, 222);
+  avl = gpr_avl_add(avl, box(975), box(1175), NULL);
+  avl = remove_int(avl, 993);
+  avl = gpr_avl_add(avl, box(2), box(1177), NULL);
+  avl = gpr_avl_add(avl, box(70), box(1178), NULL);
+  avl = remove_int(avl, 350);
+  avl = remove_int(avl, 972);
+  avl = remove_int(avl, 880);
+  avl = gpr_avl_add(avl, box(753), box(1182), NULL);
+  avl = remove_int(avl, 404);
+  avl = gpr_avl_add(avl, box(294), box(1184), NULL);
+  avl = remove_int(avl, 474);
+  avl = gpr_avl_add(avl, box(228), box(1186), NULL);
+  avl = gpr_avl_add(avl, box(484), box(1187), NULL);
+  avl = remove_int(avl, 238);
+  avl = remove_int(avl, 53);
+  avl = remove_int(avl, 691);
+  avl = gpr_avl_add(avl, box(345), box(1191), NULL);
+  avl = remove_int(avl, 0);
+  avl = gpr_avl_add(avl, box(230), box(1193), NULL);
+  avl = remove_int(avl, 227);
+  avl = remove_int(avl, 152);
+  avl = gpr_avl_add(avl, box(884), box(1196), NULL);
+  avl = remove_int(avl, 823);
+  avl = remove_int(avl, 53);
+  avl = gpr_avl_add(avl, box(1015), box(1199), NULL);
+  avl = gpr_avl_add(avl, box(697), box(1200), NULL);
+  avl = gpr_avl_add(avl, box(376), box(1201), NULL);
+  avl = remove_int(avl, 411);
+  avl = gpr_avl_add(avl, box(888), box(1203), NULL);
+  avl = remove_int(avl, 55);
+  avl = gpr_avl_add(avl, box(85), box(1205), NULL);
+  avl = remove_int(avl, 947);
+  avl = remove_int(avl, 382);
+  avl = remove_int(avl, 777);
+  avl = gpr_avl_add(avl, box(1017), box(1209), NULL);
+  avl = gpr_avl_add(avl, box(169), box(1210), NULL);
+  avl = gpr_avl_add(avl, box(156), box(1211), NULL);
+  avl = remove_int(avl, 153);
+  avl = remove_int(avl, 642);
+  avl = remove_int(avl, 158);
+  avl = gpr_avl_add(avl, box(554), box(1215), NULL);
+  avl = gpr_avl_add(avl, box(76), box(1216), NULL);
+  avl = gpr_avl_add(avl, box(756), box(1217), NULL);
+  avl = remove_int(avl, 767);
+  avl = remove_int(avl, 112);
+  avl = remove_int(avl, 539);
+  avl = remove_int(avl, 544);
+  avl = remove_int(avl, 628);
+  avl = remove_int(avl, 385);
+  avl = remove_int(avl, 514);
+  avl = remove_int(avl, 362);
+  avl = gpr_avl_add(avl, box(523), box(1226), NULL);
+  avl = gpr_avl_add(avl, box(712), box(1227), NULL);
+  avl = gpr_avl_add(avl, box(474), box(1228), NULL);
+  avl = gpr_avl_add(avl, box(882), box(1229), NULL);
+  avl = gpr_avl_add(avl, box(965), box(1230), NULL);
+  avl = remove_int(avl, 464);
+  avl = gpr_avl_add(avl, box(319), box(1232), NULL);
+  avl = gpr_avl_add(avl, box(504), box(1233), NULL);
+  avl = remove_int(avl, 818);
+  avl = gpr_avl_add(avl, box(884), box(1235), NULL);
+  avl = gpr_avl_add(avl, box(813), box(1236), NULL);
+  avl = gpr_avl_add(avl, box(795), box(1237), NULL);
+  avl = remove_int(avl, 306);
+  avl = gpr_avl_add(avl, box(799), box(1239), NULL);
+  avl = remove_int(avl, 534);
+  avl = gpr_avl_add(avl, box(480), box(1241), NULL);
+  avl = gpr_avl_add(avl, box(656), box(1242), NULL);
+  avl = gpr_avl_add(avl, box(709), box(1243), NULL);
+  avl = gpr_avl_add(avl, box(500), box(1244), NULL);
+  avl = remove_int(avl, 740);
+  avl = gpr_avl_add(avl, box(980), box(1246), NULL);
+  avl = gpr_avl_add(avl, box(458), box(1247), NULL);
+  avl = remove_int(avl, 377);
+  avl = remove_int(avl, 338);
+  avl = gpr_avl_add(avl, box(554), box(1250), NULL);
+  avl = gpr_avl_add(avl, box(504), box(1251), NULL);
+  avl = gpr_avl_add(avl, box(603), box(1252), NULL);
+  avl = gpr_avl_add(avl, box(761), box(1253), NULL);
+  avl = remove_int(avl, 431);
+  avl = gpr_avl_add(avl, box(707), box(1255), NULL);
+  avl = gpr_avl_add(avl, box(673), box(1256), NULL);
+  avl = remove_int(avl, 998);
+  avl = remove_int(avl, 332);
+  avl = remove_int(avl, 413);
+  avl = remove_int(avl, 227);
+  avl = remove_int(avl, 249);
+  avl = remove_int(avl, 309);
+  avl = remove_int(avl, 459);
+  avl = gpr_avl_add(avl, box(645), box(1264), NULL);
+  avl = remove_int(avl, 858);
+  avl = remove_int(avl, 997);
+  avl = gpr_avl_add(avl, box(519), box(1267), NULL);
+  avl = remove_int(avl, 614);
+  avl = remove_int(avl, 462);
+  avl = remove_int(avl, 792);
+  avl = gpr_avl_add(avl, box(987), box(1271), NULL);
+  avl = gpr_avl_add(avl, box(309), box(1272), NULL);
+  avl = remove_int(avl, 747);
+  avl = gpr_avl_add(avl, box(621), box(1274), NULL);
+  avl = gpr_avl_add(avl, box(450), box(1275), NULL);
+  avl = remove_int(avl, 265);
+  avl = remove_int(avl, 8);
+  avl = remove_int(avl, 383);
+  avl = gpr_avl_add(avl, box(238), box(1279), NULL);
+  avl = remove_int(avl, 241);
+  avl = gpr_avl_add(avl, box(180), box(1281), NULL);
+  avl = gpr_avl_add(avl, box(411), box(1282), NULL);
+  avl = gpr_avl_add(avl, box(791), box(1283), NULL);
+  avl = gpr_avl_add(avl, box(955), box(1284), NULL);
+  avl = remove_int(avl, 24);
+  avl = remove_int(avl, 375);
+  avl = gpr_avl_add(avl, box(140), box(1287), NULL);
+  avl = remove_int(avl, 949);
+  avl = gpr_avl_add(avl, box(301), box(1289), NULL);
+  avl = gpr_avl_add(avl, box(0), box(1290), NULL);
+  avl = remove_int(avl, 371);
+  avl = remove_int(avl, 427);
+  avl = remove_int(avl, 841);
+  avl = remove_int(avl, 847);
+  avl = gpr_avl_add(avl, box(814), box(1295), NULL);
+  avl = gpr_avl_add(avl, box(127), box(1296), NULL);
+  avl = gpr_avl_add(avl, box(279), box(1297), NULL);
+  avl = remove_int(avl, 669);
+  avl = remove_int(avl, 541);
+  avl = remove_int(avl, 275);
+  avl = remove_int(avl, 299);
+  avl = remove_int(avl, 552);
+  avl = gpr_avl_add(avl, box(310), box(1303), NULL);
+  avl = gpr_avl_add(avl, box(304), box(1304), NULL);
+  avl = gpr_avl_add(avl, box(1), box(1305), NULL);
+  avl = gpr_avl_add(avl, box(339), box(1306), NULL);
+  avl = remove_int(avl, 570);
+  avl = remove_int(avl, 752);
+  avl = remove_int(avl, 552);
+  avl = remove_int(avl, 442);
+  avl = remove_int(avl, 639);
+  avl = gpr_avl_add(avl, box(313), box(1312), NULL);
+  avl = remove_int(avl, 85);
+  avl = gpr_avl_add(avl, box(964), box(1314), NULL);
+  avl = gpr_avl_add(avl, box(559), box(1315), NULL);
+  avl = remove_int(avl, 167);
+  avl = gpr_avl_add(avl, box(866), box(1317), NULL);
+  avl = remove_int(avl, 275);
+  avl = gpr_avl_add(avl, box(173), box(1319), NULL);
+  avl = gpr_avl_add(avl, box(765), box(1320), NULL);
+  avl = remove_int(avl, 883);
+  avl = gpr_avl_add(avl, box(547), box(1322), NULL);
+  avl = gpr_avl_add(avl, box(847), box(1323), NULL);
+  avl = remove_int(avl, 817);
+  avl = remove_int(avl, 850);
+  avl = remove_int(avl, 718);
+  avl = gpr_avl_add(avl, box(806), box(1327), NULL);
+  avl = gpr_avl_add(avl, box(360), box(1328), NULL);
+  avl = remove_int(avl, 991);
+  avl = gpr_avl_add(avl, box(493), box(1330), NULL);
+  avl = remove_int(avl, 516);
+  avl = gpr_avl_add(avl, box(361), box(1332), NULL);
+  avl = remove_int(avl, 355);
+  avl = gpr_avl_add(avl, box(512), box(1334), NULL);
+  avl = gpr_avl_add(avl, box(191), box(1335), NULL);
+  avl = remove_int(avl, 703);
+  avl = gpr_avl_add(avl, box(333), box(1337), NULL);
+  avl = remove_int(avl, 481);
+  avl = gpr_avl_add(avl, box(501), box(1339), NULL);
+  avl = remove_int(avl, 532);
+  avl = remove_int(avl, 510);
+  avl = gpr_avl_add(avl, box(793), box(1342), NULL);
+  avl = gpr_avl_add(avl, box(234), box(1343), NULL);
+  avl = remove_int(avl, 159);
+  avl = remove_int(avl, 429);
+  avl = remove_int(avl, 728);
+  avl = remove_int(avl, 288);
+  avl = gpr_avl_add(avl, box(281), box(1348), NULL);
+  avl = gpr_avl_add(avl, box(702), box(1349), NULL);
+  avl = gpr_avl_add(avl, box(149), box(1350), NULL);
+  avl = remove_int(avl, 22);
+  avl = remove_int(avl, 944);
+  avl = remove_int(avl, 55);
+  avl = remove_int(avl, 512);
+  avl = remove_int(avl, 676);
+  avl = remove_int(avl, 884);
+  avl = gpr_avl_add(avl, box(246), box(1357), NULL);
+  avl = gpr_avl_add(avl, box(455), box(1358), NULL);
+  avl = remove_int(avl, 782);
+  avl = remove_int(avl, 682);
+  avl = gpr_avl_add(avl, box(243), box(1361), NULL);
+  avl = gpr_avl_add(avl, box(109), box(1362), NULL);
+  avl = gpr_avl_add(avl, box(452), box(1363), NULL);
+  avl = remove_int(avl, 151);
+  avl = gpr_avl_add(avl, box(159), box(1365), NULL);
+  avl = remove_int(avl, 1023);
+  avl = gpr_avl_add(avl, box(129), box(1367), NULL);
+  avl = gpr_avl_add(avl, box(537), box(1368), NULL);
+  avl = remove_int(avl, 321);
+  avl = gpr_avl_add(avl, box(740), box(1370), NULL);
+  avl = remove_int(avl, 45);
+  avl = remove_int(avl, 136);
+  avl = gpr_avl_add(avl, box(229), box(1373), NULL);
+  avl = remove_int(avl, 772);
+  avl = gpr_avl_add(avl, box(181), box(1375), NULL);
+  avl = remove_int(avl, 175);
+  avl = gpr_avl_add(avl, box(817), box(1377), NULL);
+  avl = remove_int(avl, 956);
+  avl = gpr_avl_add(avl, box(675), box(1379), NULL);
+  avl = gpr_avl_add(avl, box(375), box(1380), NULL);
+  avl = remove_int(avl, 384);
+  avl = gpr_avl_add(avl, box(1016), box(1382), NULL);
+  avl = remove_int(avl, 295);
+  avl = remove_int(avl, 697);
+  avl = remove_int(avl, 554);
+  avl = remove_int(avl, 590);
+  avl = remove_int(avl, 1014);
+  avl = gpr_avl_add(avl, box(890), box(1388), NULL);
+  avl = gpr_avl_add(avl, box(293), box(1389), NULL);
+  avl = remove_int(avl, 207);
+  avl = remove_int(avl, 46);
+  avl = gpr_avl_add(avl, box(899), box(1392), NULL);
+  avl = gpr_avl_add(avl, box(666), box(1393), NULL);
+  avl = gpr_avl_add(avl, box(85), box(1394), NULL);
+  avl = gpr_avl_add(avl, box(914), box(1395), NULL);
+  avl = gpr_avl_add(avl, box(128), box(1396), NULL);
+  avl = gpr_avl_add(avl, box(835), box(1397), NULL);
+  avl = gpr_avl_add(avl, box(787), box(1398), NULL);
+  avl = gpr_avl_add(avl, box(649), box(1399), NULL);
+  avl = gpr_avl_add(avl, box(723), box(1400), NULL);
+  avl = remove_int(avl, 874);
+  avl = gpr_avl_add(avl, box(778), box(1402), NULL);
+  avl = gpr_avl_add(avl, box(1015), box(1403), NULL);
+  avl = gpr_avl_add(avl, box(59), box(1404), NULL);
+  avl = gpr_avl_add(avl, box(259), box(1405), NULL);
+  avl = gpr_avl_add(avl, box(758), box(1406), NULL);
+  avl = remove_int(avl, 648);
+  avl = gpr_avl_add(avl, box(145), box(1408), NULL);
+  avl = gpr_avl_add(avl, box(440), box(1409), NULL);
+  avl = remove_int(avl, 608);
+  avl = remove_int(avl, 690);
+  avl = gpr_avl_add(avl, box(605), box(1412), NULL);
+  avl = remove_int(avl, 856);
+  avl = remove_int(avl, 608);
+  avl = gpr_avl_add(avl, box(829), box(1415), NULL);
+  avl = gpr_avl_add(avl, box(660), box(1416), NULL);
+  avl = remove_int(avl, 596);
+  avl = gpr_avl_add(avl, box(519), box(1418), NULL);
+  avl = gpr_avl_add(avl, box(35), box(1419), NULL);
+  avl = gpr_avl_add(avl, box(871), box(1420), NULL);
+  avl = remove_int(avl, 845);
+  avl = gpr_avl_add(avl, box(600), box(1422), NULL);
+  avl = gpr_avl_add(avl, box(215), box(1423), NULL);
+  avl = remove_int(avl, 761);
+  avl = gpr_avl_add(avl, box(975), box(1425), NULL);
+  avl = remove_int(avl, 987);
+  avl = gpr_avl_add(avl, box(58), box(1427), NULL);
+  avl = remove_int(avl, 119);
+  avl = gpr_avl_add(avl, box(937), box(1429), NULL);
+  avl = gpr_avl_add(avl, box(372), box(1430), NULL);
+  avl = gpr_avl_add(avl, box(11), box(1431), NULL);
+  avl = gpr_avl_add(avl, box(398), box(1432), NULL);
+  avl = gpr_avl_add(avl, box(423), box(1433), NULL);
+  avl = remove_int(avl, 171);
+  avl = gpr_avl_add(avl, box(473), box(1435), NULL);
+  avl = remove_int(avl, 752);
+  avl = remove_int(avl, 625);
+  avl = remove_int(avl, 764);
+  avl = remove_int(avl, 49);
+  avl = gpr_avl_add(avl, box(472), box(1440), NULL);
+  avl = remove_int(avl, 847);
+  avl = remove_int(avl, 642);
+  avl = remove_int(avl, 1004);
+  avl = remove_int(avl, 795);
+  avl = remove_int(avl, 465);
+  avl = gpr_avl_add(avl, box(636), box(1446), NULL);
+  avl = remove_int(avl, 152);
+  avl = gpr_avl_add(avl, box(61), box(1448), NULL);
+  avl = remove_int(avl, 929);
+  avl = remove_int(avl, 9);
+  avl = gpr_avl_add(avl, box(251), box(1451), NULL);
+  avl = gpr_avl_add(avl, box(672), box(1452), NULL);
+  avl = gpr_avl_add(avl, box(66), box(1453), NULL);
+  avl = remove_int(avl, 693);
+  avl = remove_int(avl, 914);
+  avl = remove_int(avl, 116);
+  avl = remove_int(avl, 577);
+  avl = gpr_avl_add(avl, box(618), box(1458), NULL);
+  avl = gpr_avl_add(avl, box(495), box(1459), NULL);
+  avl = remove_int(avl, 450);
+  avl = gpr_avl_add(avl, box(533), box(1461), NULL);
+  avl = gpr_avl_add(avl, box(414), box(1462), NULL);
+  avl = remove_int(avl, 74);
+  avl = remove_int(avl, 236);
+  avl = gpr_avl_add(avl, box(707), box(1465), NULL);
+  avl = gpr_avl_add(avl, box(357), box(1466), NULL);
+  avl = gpr_avl_add(avl, box(1007), box(1467), NULL);
+  avl = gpr_avl_add(avl, box(811), box(1468), NULL);
+  avl = gpr_avl_add(avl, box(418), box(1469), NULL);
+  avl = gpr_avl_add(avl, box(164), box(1470), NULL);
+  avl = gpr_avl_add(avl, box(622), box(1471), NULL);
+  avl = remove_int(avl, 22);
+  avl = remove_int(avl, 14);
+  avl = remove_int(avl, 732);
+  avl = remove_int(avl, 7);
+  avl = remove_int(avl, 447);
+  avl = gpr_avl_add(avl, box(221), box(1477), NULL);
+  avl = gpr_avl_add(avl, box(202), box(1478), NULL);
+  avl = gpr_avl_add(avl, box(312), box(1479), NULL);
+  avl = remove_int(avl, 274);
+  avl = gpr_avl_add(avl, box(684), box(1481), NULL);
+  avl = gpr_avl_add(avl, box(954), box(1482), NULL);
+  avl = gpr_avl_add(avl, box(637), box(1483), NULL);
+  avl = remove_int(avl, 716);
+  avl = gpr_avl_add(avl, box(198), box(1485), NULL);
+  avl = remove_int(avl, 340);
+  avl = remove_int(avl, 137);
+  avl = remove_int(avl, 995);
+  avl = remove_int(avl, 1004);
+  avl = gpr_avl_add(avl, box(661), box(1490), NULL);
+  avl = gpr_avl_add(avl, box(862), box(1491), NULL);
+  avl = remove_int(avl, 527);
+  avl = gpr_avl_add(avl, box(945), box(1493), NULL);
+  avl = remove_int(avl, 355);
+  avl = remove_int(avl, 144);
+  avl = gpr_avl_add(avl, box(229), box(1496), NULL);
+  avl = gpr_avl_add(avl, box(237), box(1497), NULL);
+  avl = remove_int(avl, 471);
+  avl = remove_int(avl, 901);
+  avl = gpr_avl_add(avl, box(905), box(1500), NULL);
+  avl = remove_int(avl, 19);
+  avl = remove_int(avl, 896);
+  avl = remove_int(avl, 585);
+  avl = remove_int(avl, 308);
+  avl = gpr_avl_add(avl, box(547), box(1505), NULL);
+  avl = gpr_avl_add(avl, box(552), box(1506), NULL);
+  avl = gpr_avl_add(avl, box(30), box(1507), NULL);
+  avl = gpr_avl_add(avl, box(445), box(1508), NULL);
+  avl = remove_int(avl, 785);
+  avl = remove_int(avl, 185);
+  avl = gpr_avl_add(avl, box(405), box(1511), NULL);
+  avl = gpr_avl_add(avl, box(733), box(1512), NULL);
+  avl = gpr_avl_add(avl, box(573), box(1513), NULL);
+  avl = gpr_avl_add(avl, box(492), box(1514), NULL);
+  avl = gpr_avl_add(avl, box(343), box(1515), NULL);
+  avl = gpr_avl_add(avl, box(527), box(1516), NULL);
+  avl = gpr_avl_add(avl, box(596), box(1517), NULL);
+  avl = gpr_avl_add(avl, box(519), box(1518), NULL);
+  avl = remove_int(avl, 243);
+  avl = remove_int(avl, 722);
+  avl = gpr_avl_add(avl, box(772), box(1521), NULL);
+  avl = remove_int(avl, 152);
+  avl = remove_int(avl, 305);
+  avl = gpr_avl_add(avl, box(754), box(1524), NULL);
+  avl = gpr_avl_add(avl, box(373), box(1525), NULL);
+  avl = remove_int(avl, 995);
+  avl = gpr_avl_add(avl, box(329), box(1527), NULL);
+  avl = remove_int(avl, 397);
+  avl = gpr_avl_add(avl, box(884), box(1529), NULL);
+  avl = remove_int(avl, 329);
+  avl = remove_int(avl, 240);
+  avl = gpr_avl_add(avl, box(566), box(1532), NULL);
+  avl = gpr_avl_add(avl, box(232), box(1533), NULL);
+  avl = remove_int(avl, 993);
+  avl = gpr_avl_add(avl, box(888), box(1535), NULL);
+  avl = remove_int(avl, 242);
+  avl = gpr_avl_add(avl, box(941), box(1537), NULL);
+  avl = remove_int(avl, 415);
+  avl = gpr_avl_add(avl, box(992), box(1539), NULL);
+  avl = remove_int(avl, 289);
+  avl = gpr_avl_add(avl, box(60), box(1541), NULL);
+  avl = gpr_avl_add(avl, box(97), box(1542), NULL);
+  avl = remove_int(avl, 965);
+  avl = remove_int(avl, 267);
+  avl = remove_int(avl, 360);
+  avl = gpr_avl_add(avl, box(5), box(1546), NULL);
+  avl = remove_int(avl, 429);
+  avl = gpr_avl_add(avl, box(412), box(1548), NULL);
+  avl = remove_int(avl, 632);
+  avl = remove_int(avl, 113);
+  avl = gpr_avl_add(avl, box(48), box(1551), NULL);
+  avl = gpr_avl_add(avl, box(108), box(1552), NULL);
+  avl = gpr_avl_add(avl, box(750), box(1553), NULL);
+  avl = remove_int(avl, 188);
+  avl = gpr_avl_add(avl, box(668), box(1555), NULL);
+  avl = remove_int(avl, 37);
+  avl = remove_int(avl, 737);
+  avl = gpr_avl_add(avl, box(93), box(1558), NULL);
+  avl = gpr_avl_add(avl, box(628), box(1559), NULL);
+  avl = gpr_avl_add(avl, box(480), box(1560), NULL);
+  avl = remove_int(avl, 958);
+  avl = remove_int(avl, 565);
+  avl = remove_int(avl, 32);
+  avl = remove_int(avl, 1);
+  avl = remove_int(avl, 335);
+  avl = gpr_avl_add(avl, box(136), box(1566), NULL);
+  avl = gpr_avl_add(avl, box(469), box(1567), NULL);
+  avl = remove_int(avl, 349);
+  avl = gpr_avl_add(avl, box(768), box(1569), NULL);
+  avl = gpr_avl_add(avl, box(915), box(1570), NULL);
+  avl = remove_int(avl, 1014);
+  avl = gpr_avl_add(avl, box(117), box(1572), NULL);
+  avl = remove_int(avl, 62);
+  avl = gpr_avl_add(avl, box(382), box(1574), NULL);
+  avl = remove_int(avl, 571);
+  avl = gpr_avl_add(avl, box(655), box(1576), NULL);
+  avl = gpr_avl_add(avl, box(323), box(1577), NULL);
+  avl = remove_int(avl, 869);
+  avl = remove_int(avl, 151);
+  avl = gpr_avl_add(avl, box(1019), box(1580), NULL);
+  avl = gpr_avl_add(avl, box(984), box(1581), NULL);
+  avl = gpr_avl_add(avl, box(870), box(1582), NULL);
+  avl = gpr_avl_add(avl, box(376), box(1583), NULL);
+  avl = remove_int(avl, 625);
+  avl = gpr_avl_add(avl, box(733), box(1585), NULL);
+  avl = remove_int(avl, 532);
+  avl = remove_int(avl, 444);
+  avl = gpr_avl_add(avl, box(428), box(1588), NULL);
+  avl = gpr_avl_add(avl, box(860), box(1589), NULL);
+  avl = gpr_avl_add(avl, box(173), box(1590), NULL);
+  avl = remove_int(avl, 649);
+  avl = remove_int(avl, 913);
+  avl = remove_int(avl, 1);
+  avl = remove_int(avl, 304);
+  avl = gpr_avl_add(avl, box(604), box(1595), NULL);
+  avl = gpr_avl_add(avl, box(639), box(1596), NULL);
+  avl = remove_int(avl, 431);
+  avl = gpr_avl_add(avl, box(993), box(1598), NULL);
+  avl = remove_int(avl, 681);
+  avl = remove_int(avl, 927);
+  avl = gpr_avl_add(avl, box(87), box(1601), NULL);
+  avl = gpr_avl_add(avl, box(91), box(1602), NULL);
+  avl = remove_int(avl, 61);
+  avl = remove_int(avl, 14);
+  avl = remove_int(avl, 305);
+  avl = remove_int(avl, 304);
+  avl = remove_int(avl, 1016);
+  avl = gpr_avl_add(avl, box(903), box(1608), NULL);
+  avl = gpr_avl_add(avl, box(951), box(1609), NULL);
+  avl = gpr_avl_add(avl, box(146), box(1610), NULL);
+  avl = gpr_avl_add(avl, box(482), box(1611), NULL);
+  avl = gpr_avl_add(avl, box(71), box(1612), NULL);
+  avl = remove_int(avl, 246);
+  avl = remove_int(avl, 696);
+  avl = gpr_avl_add(avl, box(636), box(1615), NULL);
+  avl = gpr_avl_add(avl, box(295), box(1616), NULL);
+  avl = remove_int(avl, 11);
+  avl = remove_int(avl, 231);
+  avl = gpr_avl_add(avl, box(905), box(1619), NULL);
+  avl = gpr_avl_add(avl, box(993), box(1620), NULL);
+  avl = gpr_avl_add(avl, box(433), box(1621), NULL);
+  avl = gpr_avl_add(avl, box(117), box(1622), NULL);
+  avl = gpr_avl_add(avl, box(467), box(1623), NULL);
+  avl = remove_int(avl, 419);
+  avl = gpr_avl_add(avl, box(179), box(1625), NULL);
+  avl = remove_int(avl, 926);
+  avl = remove_int(avl, 326);
+  avl = gpr_avl_add(avl, box(551), box(1628), NULL);
+  avl = remove_int(avl, 14);
+  avl = remove_int(avl, 476);
+  avl = remove_int(avl, 823);
+  avl = gpr_avl_add(avl, box(350), box(1632), NULL);
+  avl = gpr_avl_add(avl, box(133), box(1633), NULL);
+  avl = remove_int(avl, 906);
+  avl = gpr_avl_add(avl, box(827), box(1635), NULL);
+  avl = gpr_avl_add(avl, box(201), box(1636), NULL);
+  avl = remove_int(avl, 124);
+  avl = remove_int(avl, 662);
+  avl = gpr_avl_add(avl, box(314), box(1639), NULL);
+  avl = gpr_avl_add(avl, box(986), box(1640), NULL);
+  avl = gpr_avl_add(avl, box(622), box(1641), NULL);
+  avl = remove_int(avl, 130);
+  avl = gpr_avl_add(avl, box(861), box(1643), NULL);
+  avl = remove_int(avl, 497);
+  avl = remove_int(avl, 905);
+  avl = gpr_avl_add(avl, box(502), box(1646), NULL);
+  avl = remove_int(avl, 721);
+  avl = gpr_avl_add(avl, box(514), box(1648), NULL);
+  avl = gpr_avl_add(avl, box(410), box(1649), NULL);
+  avl = remove_int(avl, 869);
+  avl = remove_int(avl, 247);
+  avl = gpr_avl_add(avl, box(450), box(1652), NULL);
+  avl = remove_int(avl, 364);
+  avl = gpr_avl_add(avl, box(963), box(1654), NULL);
+  avl = gpr_avl_add(avl, box(146), box(1655), NULL);
+  avl = remove_int(avl, 147);
+  avl = remove_int(avl, 789);
+  avl = gpr_avl_add(avl, box(693), box(1658), NULL);
+  avl = gpr_avl_add(avl, box(959), box(1659), NULL);
+  avl = remove_int(avl, 478);
+  avl = gpr_avl_add(avl, box(116), box(1661), NULL);
+  avl = gpr_avl_add(avl, box(520), box(1662), NULL);
+  avl = gpr_avl_add(avl, box(809), box(1663), NULL);
+  avl = gpr_avl_add(avl, box(667), box(1664), NULL);
+  avl = gpr_avl_add(avl, box(406), box(1665), NULL);
+  avl = remove_int(avl, 409);
+  avl = gpr_avl_add(avl, box(558), box(1667), NULL);
+  avl = gpr_avl_add(avl, box(0), box(1668), NULL);
+  avl = gpr_avl_add(avl, box(948), box(1669), NULL);
+  avl = gpr_avl_add(avl, box(576), box(1670), NULL);
+  avl = remove_int(avl, 864);
+  avl = remove_int(avl, 840);
+  avl = remove_int(avl, 1001);
+  avl = gpr_avl_add(avl, box(232), box(1674), NULL);
+  avl = remove_int(avl, 676);
+  avl = remove_int(avl, 752);
+  avl = remove_int(avl, 667);
+  avl = remove_int(avl, 605);
+  avl = gpr_avl_add(avl, box(258), box(1679), NULL);
+  avl = gpr_avl_add(avl, box(648), box(1680), NULL);
+  avl = gpr_avl_add(avl, box(761), box(1681), NULL);
+  avl = remove_int(avl, 293);
+  avl = remove_int(avl, 893);
+  avl = gpr_avl_add(avl, box(194), box(1684), NULL);
+  avl = remove_int(avl, 233);
+  avl = gpr_avl_add(avl, box(888), box(1686), NULL);
+  avl = remove_int(avl, 470);
+  avl = remove_int(avl, 703);
+  avl = remove_int(avl, 190);
+  avl = remove_int(avl, 359);
+  avl = gpr_avl_add(avl, box(621), box(1691), NULL);
+  avl = remove_int(avl, 634);
+  avl = remove_int(avl, 335);
+  avl = gpr_avl_add(avl, box(718), box(1694), NULL);
+  avl = gpr_avl_add(avl, box(463), box(1695), NULL);
+  avl = gpr_avl_add(avl, box(233), box(1696), NULL);
+  avl = remove_int(avl, 376);
+  avl = remove_int(avl, 496);
+  avl = remove_int(avl, 819);
+  avl = remove_int(avl, 38);
+  avl = remove_int(avl, 436);
+  avl = remove_int(avl, 102);
+  avl = gpr_avl_add(avl, box(607), box(1703), NULL);
+  avl = remove_int(avl, 329);
+  avl = gpr_avl_add(avl, box(716), box(1705), NULL);
+  avl = remove_int(avl, 639);
+  avl = remove_int(avl, 775);
+  avl = remove_int(avl, 578);
+  avl = remove_int(avl, 464);
+  avl = remove_int(avl, 679);
+  avl = remove_int(avl, 615);
+  avl = remove_int(avl, 104);
+  avl = gpr_avl_add(avl, box(414), box(1713), NULL);
+  avl = gpr_avl_add(avl, box(212), box(1714), NULL);
+  avl = gpr_avl_add(avl, box(266), box(1715), NULL);
+  avl = gpr_avl_add(avl, box(238), box(1716), NULL);
+  avl = remove_int(avl, 153);
+  avl = gpr_avl_add(avl, box(585), box(1718), NULL);
+  avl = remove_int(avl, 121);
+  avl = gpr_avl_add(avl, box(534), box(1720), NULL);
+  avl = remove_int(avl, 579);
+  avl = gpr_avl_add(avl, box(127), box(1722), NULL);
+  avl = gpr_avl_add(avl, box(399), box(1723), NULL);
+  avl = remove_int(avl, 417);
+  avl = gpr_avl_add(avl, box(978), box(1725), NULL);
+  avl = gpr_avl_add(avl, box(768), box(1726), NULL);
+  avl = remove_int(avl, 985);
+  avl = gpr_avl_add(avl, box(536), box(1728), NULL);
+  avl = gpr_avl_add(avl, box(449), box(1729), NULL);
+  avl = gpr_avl_add(avl, box(586), box(1730), NULL);
+  avl = remove_int(avl, 998);
+  avl = remove_int(avl, 394);
+  avl = remove_int(avl, 141);
+  avl = gpr_avl_add(avl, box(889), box(1734), NULL);
+  avl = gpr_avl_add(avl, box(871), box(1735), NULL);
+  avl = gpr_avl_add(avl, box(76), box(1736), NULL);
+  avl = gpr_avl_add(avl, box(549), box(1737), NULL);
+  avl = gpr_avl_add(avl, box(757), box(1738), NULL);
+  avl = remove_int(avl, 908);
+  avl = gpr_avl_add(avl, box(789), box(1740), NULL);
+  avl = remove_int(avl, 224);
+  avl = gpr_avl_add(avl, box(407), box(1742), NULL);
+  avl = gpr_avl_add(avl, box(381), box(1743), NULL);
+  avl = gpr_avl_add(avl, box(561), box(1744), NULL);
+  avl = gpr_avl_add(avl, box(667), box(1745), NULL);
+  avl = gpr_avl_add(avl, box(522), box(1746), NULL);
+  avl = gpr_avl_add(avl, box(948), box(1747), NULL);
+  avl = remove_int(avl, 770);
+  avl = gpr_avl_add(avl, box(872), box(1749), NULL);
+  avl = gpr_avl_add(avl, box(327), box(1750), NULL);
+  avl = remove_int(avl, 10);
+  avl = gpr_avl_add(avl, box(122), box(1752), NULL);
+  avl = remove_int(avl, 606);
+  avl = gpr_avl_add(avl, box(485), box(1754), NULL);
+  avl = remove_int(avl, 6);
+  avl = gpr_avl_add(avl, box(329), box(1756), NULL);
+  avl = gpr_avl_add(avl, box(783), box(1757), NULL);
+  avl = remove_int(avl, 416);
+  avl = gpr_avl_add(avl, box(656), box(1759), NULL);
+  avl = gpr_avl_add(avl, box(971), box(1760), NULL);
+  avl = gpr_avl_add(avl, box(77), box(1761), NULL);
+  avl = gpr_avl_add(avl, box(942), box(1762), NULL);
+  avl = remove_int(avl, 361);
+  avl = gpr_avl_add(avl, box(66), box(1764), NULL);
+  avl = gpr_avl_add(avl, box(299), box(1765), NULL);
+  avl = gpr_avl_add(avl, box(929), box(1766), NULL);
+  avl = gpr_avl_add(avl, box(797), box(1767), NULL);
+  avl = remove_int(avl, 869);
+  avl = remove_int(avl, 907);
+  avl = gpr_avl_add(avl, box(870), box(1770), NULL);
+  avl = remove_int(avl, 580);
+  avl = remove_int(avl, 120);
+  avl = gpr_avl_add(avl, box(913), box(1773), NULL);
+  avl = remove_int(avl, 480);
+  avl = gpr_avl_add(avl, box(489), box(1775), NULL);
+  avl = remove_int(avl, 845);
+  avl = gpr_avl_add(avl, box(896), box(1777), NULL);
+  avl = remove_int(avl, 567);
+  avl = remove_int(avl, 427);
+  avl = gpr_avl_add(avl, box(443), box(1780), NULL);
+  avl = gpr_avl_add(avl, box(3), box(1781), NULL);
+  avl = remove_int(avl, 12);
+  avl = gpr_avl_add(avl, box(376), box(1783), NULL);
+  avl = gpr_avl_add(avl, box(155), box(1784), NULL);
+  avl = gpr_avl_add(avl, box(188), box(1785), NULL);
+  avl = gpr_avl_add(avl, box(149), box(1786), NULL);
+  avl = gpr_avl_add(avl, box(178), box(1787), NULL);
+  avl = remove_int(avl, 84);
+  avl = gpr_avl_add(avl, box(805), box(1789), NULL);
+  avl = gpr_avl_add(avl, box(612), box(1790), NULL);
+  avl = remove_int(avl, 991);
+  avl = gpr_avl_add(avl, box(837), box(1792), NULL);
+  avl = remove_int(avl, 173);
+  avl = remove_int(avl, 72);
+  avl = gpr_avl_add(avl, box(1014), box(1795), NULL);
+  avl = remove_int(avl, 303);
+  avl = gpr_avl_add(avl, box(865), box(1797), NULL);
+  avl = gpr_avl_add(avl, box(793), box(1798), NULL);
+  avl = remove_int(avl, 173);
+  avl = remove_int(avl, 477);
+  avl = gpr_avl_add(avl, box(950), box(1801), NULL);
+  avl = gpr_avl_add(avl, box(105), box(1802), NULL);
+  avl = gpr_avl_add(avl, box(895), box(1803), NULL);
+  avl = gpr_avl_add(avl, box(171), box(1804), NULL);
+  avl = gpr_avl_add(avl, box(753), box(1805), NULL);
+  avl = gpr_avl_add(avl, box(946), box(1806), NULL);
+  avl = remove_int(avl, 194);
+  avl = remove_int(avl, 559);
+  avl = remove_int(avl, 116);
+  avl = gpr_avl_add(avl, box(968), box(1810), NULL);
+  avl = remove_int(avl, 124);
+  avl = remove_int(avl, 99);
+  avl = gpr_avl_add(avl, box(563), box(1813), NULL);
+  avl = remove_int(avl, 182);
+  avl = gpr_avl_add(avl, box(816), box(1815), NULL);
+  avl = remove_int(avl, 73);
+  avl = remove_int(avl, 261);
+  avl = gpr_avl_add(avl, box(847), box(1818), NULL);
+  avl = gpr_avl_add(avl, box(368), box(1819), NULL);
+  avl = gpr_avl_add(avl, box(808), box(1820), NULL);
+  avl = gpr_avl_add(avl, box(779), box(1821), NULL);
+  avl = remove_int(avl, 818);
+  avl = gpr_avl_add(avl, box(466), box(1823), NULL);
+  avl = remove_int(avl, 316);
+  avl = gpr_avl_add(avl, box(986), box(1825), NULL);
+  avl = gpr_avl_add(avl, box(688), box(1826), NULL);
+  avl = gpr_avl_add(avl, box(509), box(1827), NULL);
+  avl = gpr_avl_add(avl, box(51), box(1828), NULL);
+  avl = remove_int(avl, 655);
+  avl = remove_int(avl, 785);
+  avl = remove_int(avl, 893);
+  avl = gpr_avl_add(avl, box(167), box(1832), NULL);
+  avl = remove_int(avl, 13);
+  avl = remove_int(avl, 263);
+  avl = gpr_avl_add(avl, box(1009), box(1835), NULL);
+  avl = remove_int(avl, 480);
+  avl = remove_int(avl, 778);
+  avl = remove_int(avl, 713);
+  avl = remove_int(avl, 628);
+  avl = gpr_avl_add(avl, box(803), box(1840), NULL);
+  avl = remove_int(avl, 267);
+  avl = gpr_avl_add(avl, box(676), box(1842), NULL);
+  avl = gpr_avl_add(avl, box(231), box(1843), NULL);
+  avl = gpr_avl_add(avl, box(824), box(1844), NULL);
+  avl = remove_int(avl, 961);
+  avl = gpr_avl_add(avl, box(311), box(1846), NULL);
+  avl = gpr_avl_add(avl, box(420), box(1847), NULL);
+  avl = gpr_avl_add(avl, box(960), box(1848), NULL);
+  avl = gpr_avl_add(avl, box(468), box(1849), NULL);
+  avl = gpr_avl_add(avl, box(815), box(1850), NULL);
+  avl = remove_int(avl, 247);
+  avl = remove_int(avl, 194);
+  avl = gpr_avl_add(avl, box(546), box(1853), NULL);
+  avl = remove_int(avl, 222);
+  avl = remove_int(avl, 914);
+  avl = remove_int(avl, 741);
+  avl = gpr_avl_add(avl, box(470), box(1857), NULL);
+  avl = gpr_avl_add(avl, box(933), box(1858), NULL);
+  avl = gpr_avl_add(avl, box(97), box(1859), NULL);
+  avl = remove_int(avl, 564);
+  avl = remove_int(avl, 295);
+  avl = gpr_avl_add(avl, box(864), box(1862), NULL);
+  avl = remove_int(avl, 329);
+  avl = gpr_avl_add(avl, box(124), box(1864), NULL);
+  avl = gpr_avl_add(avl, box(1000), box(1865), NULL);
+  avl = gpr_avl_add(avl, box(228), box(1866), NULL);
+  avl = gpr_avl_add(avl, box(187), box(1867), NULL);
+  avl = remove_int(avl, 224);
+  avl = remove_int(avl, 306);
+  avl = remove_int(avl, 884);
+  avl = gpr_avl_add(avl, box(449), box(1871), NULL);
+  avl = gpr_avl_add(avl, box(353), box(1872), NULL);
+  avl = gpr_avl_add(avl, box(994), box(1873), NULL);
+  avl = gpr_avl_add(avl, box(596), box(1874), NULL);
+  avl = gpr_avl_add(avl, box(996), box(1875), NULL);
+  avl = gpr_avl_add(avl, box(101), box(1876), NULL);
+  avl = gpr_avl_add(avl, box(1012), box(1877), NULL);
+  avl = gpr_avl_add(avl, box(982), box(1878), NULL);
+  avl = gpr_avl_add(avl, box(742), box(1879), NULL);
+  avl = remove_int(avl, 92);
+  avl = remove_int(avl, 1022);
+  avl = gpr_avl_add(avl, box(941), box(1882), NULL);
+  avl = remove_int(avl, 742);
+  avl = remove_int(avl, 919);
+  avl = gpr_avl_add(avl, box(588), box(1885), NULL);
+  avl = remove_int(avl, 221);
+  avl = gpr_avl_add(avl, box(356), box(1887), NULL);
+  avl = gpr_avl_add(avl, box(932), box(1888), NULL);
+  avl = remove_int(avl, 837);
+  avl = gpr_avl_add(avl, box(394), box(1890), NULL);
+  avl = gpr_avl_add(avl, box(642), box(1891), NULL);
+  avl = gpr_avl_add(avl, box(52), box(1892), NULL);
+  avl = gpr_avl_add(avl, box(437), box(1893), NULL);
+  avl = gpr_avl_add(avl, box(948), box(1894), NULL);
+  avl = gpr_avl_add(avl, box(93), box(1895), NULL);
+  avl = remove_int(avl, 873);
+  avl = remove_int(avl, 336);
+  avl = remove_int(avl, 277);
+  avl = remove_int(avl, 932);
+  avl = gpr_avl_add(avl, box(80), box(1900), NULL);
+  avl = gpr_avl_add(avl, box(952), box(1901), NULL);
+  avl = gpr_avl_add(avl, box(510), box(1902), NULL);
+  avl = remove_int(avl, 876);
+  avl = remove_int(avl, 612);
+  avl = gpr_avl_add(avl, box(923), box(1905), NULL);
+  avl = gpr_avl_add(avl, box(475), box(1906), NULL);
+  avl = remove_int(avl, 478);
+  avl = remove_int(avl, 148);
+  avl = gpr_avl_add(avl, box(538), box(1909), NULL);
+  avl = remove_int(avl, 47);
+  avl = gpr_avl_add(avl, box(89), box(1911), NULL);
+  avl = remove_int(avl, 723);
+  avl = gpr_avl_add(avl, box(687), box(1913), NULL);
+  avl = gpr_avl_add(avl, box(480), box(1914), NULL);
+  avl = gpr_avl_add(avl, box(149), box(1915), NULL);
+  avl = remove_int(avl, 68);
+  avl = remove_int(avl, 862);
+  avl = remove_int(avl, 363);
+  avl = gpr_avl_add(avl, box(996), box(1919), NULL);
+  avl = remove_int(avl, 380);
+  avl = gpr_avl_add(avl, box(957), box(1921), NULL);
+  avl = remove_int(avl, 413);
+  avl = gpr_avl_add(avl, box(360), box(1923), NULL);
+  avl = gpr_avl_add(avl, box(304), box(1924), NULL);
+  avl = gpr_avl_add(avl, box(634), box(1925), NULL);
+  avl = gpr_avl_add(avl, box(506), box(1926), NULL);
+  avl = remove_int(avl, 248);
+  avl = gpr_avl_add(avl, box(124), box(1928), NULL);
+  avl = gpr_avl_add(avl, box(181), box(1929), NULL);
+  avl = remove_int(avl, 507);
+  avl = gpr_avl_add(avl, box(141), box(1931), NULL);
+  avl = remove_int(avl, 409);
+  avl = remove_int(avl, 129);
+  avl = remove_int(avl, 694);
+  avl = remove_int(avl, 723);
+  avl = gpr_avl_add(avl, box(998), box(1936), NULL);
+  avl = gpr_avl_add(avl, box(906), box(1937), NULL);
+  avl = gpr_avl_add(avl, box(44), box(1938), NULL);
+  avl = remove_int(avl, 949);
+  avl = remove_int(avl, 117);
+  avl = gpr_avl_add(avl, box(700), box(1941), NULL);
+  avl = gpr_avl_add(avl, box(258), box(1942), NULL);
+  avl = remove_int(avl, 828);
+  avl = gpr_avl_add(avl, box(860), box(1944), NULL);
+  avl = gpr_avl_add(avl, box(987), box(1945), NULL);
+  avl = gpr_avl_add(avl, box(316), box(1946), NULL);
+  avl = gpr_avl_add(avl, box(919), box(1947), NULL);
+  avl = remove_int(avl, 84);
+  avl = gpr_avl_add(avl, box(473), box(1949), NULL);
+  avl = remove_int(avl, 127);
+  avl = remove_int(avl, 829);
+  avl = remove_int(avl, 829);
+  avl = gpr_avl_add(avl, box(488), box(1953), NULL);
+  avl = gpr_avl_add(avl, box(954), box(1954), NULL);
+  avl = remove_int(avl, 198);
+  avl = remove_int(avl, 972);
+  avl = remove_int(avl, 670);
+  avl = gpr_avl_add(avl, box(822), box(1958), NULL);
+  avl = remove_int(avl, 589);
+  avl = remove_int(avl, 459);
+  avl = gpr_avl_add(avl, box(1003), box(1961), NULL);
+  avl = gpr_avl_add(avl, box(657), box(1962), NULL);
+  avl = gpr_avl_add(avl, box(477), box(1963), NULL);
+  avl = gpr_avl_add(avl, box(923), box(1964), NULL);
+  avl = remove_int(avl, 496);
+  avl = remove_int(avl, 99);
+  avl = gpr_avl_add(avl, box(127), box(1967), NULL);
+  avl = gpr_avl_add(avl, box(1013), box(1968), NULL);
+  avl = gpr_avl_add(avl, box(778), box(1969), NULL);
+  avl = remove_int(avl, 5);
+  avl = remove_int(avl, 990);
+  avl = remove_int(avl, 850);
+  avl = remove_int(avl, 160);
+  avl = remove_int(avl, 86);
+  avl = gpr_avl_add(avl, box(283), box(1975), NULL);
+  avl = remove_int(avl, 278);
+  avl = remove_int(avl, 297);
+  avl = remove_int(avl, 137);
+  avl = remove_int(avl, 653);
+  avl = gpr_avl_add(avl, box(702), box(1980), NULL);
+  avl = remove_int(avl, 63);
+  avl = remove_int(avl, 427);
+  avl = remove_int(avl, 706);
+  avl = remove_int(avl, 806);
+  avl = gpr_avl_add(avl, box(335), box(1985), NULL);
+  avl = gpr_avl_add(avl, box(412), box(1986), NULL);
+  avl = remove_int(avl, 766);
+  avl = remove_int(avl, 937);
+  avl = remove_int(avl, 886);
+  avl = remove_int(avl, 652);
+  avl = gpr_avl_add(avl, box(545), box(1991), NULL);
+  avl = gpr_avl_add(avl, box(408), box(1992), NULL);
+  avl = gpr_avl_add(avl, box(841), box(1993), NULL);
+  avl = remove_int(avl, 593);
+  avl = gpr_avl_add(avl, box(582), box(1995), NULL);
+  avl = gpr_avl_add(avl, box(597), box(1996), NULL);
+  avl = remove_int(avl, 49);
+  avl = remove_int(avl, 835);
+  avl = gpr_avl_add(avl, box(417), box(1999), NULL);
+  avl = gpr_avl_add(avl, box(191), box(2000), NULL);
+  avl = remove_int(avl, 406);
+  avl = gpr_avl_add(avl, box(30), box(2002), NULL);
+  avl = remove_int(avl, 841);
+  avl = remove_int(avl, 50);
+  avl = gpr_avl_add(avl, box(967), box(2005), NULL);
+  avl = gpr_avl_add(avl, box(849), box(2006), NULL);
+  avl = remove_int(avl, 608);
+  avl = gpr_avl_add(avl, box(306), box(2008), NULL);
+  avl = remove_int(avl, 779);
+  avl = gpr_avl_add(avl, box(897), box(2010), NULL);
+  avl = gpr_avl_add(avl, box(147), box(2011), NULL);
+  avl = remove_int(avl, 982);
+  avl = gpr_avl_add(avl, box(470), box(2013), NULL);
+  avl = remove_int(avl, 951);
+  avl = gpr_avl_add(avl, box(388), box(2015), NULL);
+  avl = remove_int(avl, 616);
+  avl = remove_int(avl, 721);
+  avl = remove_int(avl, 942);
+  avl = remove_int(avl, 589);
+  avl = gpr_avl_add(avl, box(218), box(2020), NULL);
+  avl = remove_int(avl, 671);
+  avl = gpr_avl_add(avl, box(1020), box(2022), NULL);
+  avl = remove_int(avl, 277);
+  avl = gpr_avl_add(avl, box(681), box(2024), NULL);
+  avl = gpr_avl_add(avl, box(179), box(2025), NULL);
+  avl = gpr_avl_add(avl, box(370), box(2026), NULL);
+  avl = gpr_avl_add(avl, box(0), box(2027), NULL);
+  avl = remove_int(avl, 523);
+  avl = gpr_avl_add(avl, box(99), box(2029), NULL);
+  avl = gpr_avl_add(avl, box(334), box(2030), NULL);
+  avl = gpr_avl_add(avl, box(569), box(2031), NULL);
+  avl = gpr_avl_add(avl, box(257), box(2032), NULL);
+  avl = remove_int(avl, 572);
+  avl = gpr_avl_add(avl, box(805), box(2034), NULL);
+  avl = gpr_avl_add(avl, box(143), box(2035), NULL);
+  avl = gpr_avl_add(avl, box(670), box(2036), NULL);
+  avl = remove_int(avl, 42);
+  avl = gpr_avl_add(avl, box(46), box(2038), NULL);
+  avl = remove_int(avl, 970);
+  avl = gpr_avl_add(avl, box(353), box(2040), NULL);
+  avl = remove_int(avl, 258);
+  avl = gpr_avl_add(avl, box(451), box(2042), NULL);
+  avl = gpr_avl_add(avl, box(28), box(2043), NULL);
+  avl = gpr_avl_add(avl, box(729), box(2044), NULL);
+  avl = gpr_avl_add(avl, box(401), box(2045), NULL);
+  avl = gpr_avl_add(avl, box(614), box(2046), NULL);
+  avl = remove_int(avl, 990);
+  avl = remove_int(avl, 212);
+  avl = remove_int(avl, 22);
+  avl = remove_int(avl, 677);
+  avl = gpr_avl_add(avl, box(1016), box(2051), NULL);
+  avl = gpr_avl_add(avl, box(980), box(2052), NULL);
+  avl = gpr_avl_add(avl, box(990), box(2053), NULL);
+  avl = gpr_avl_add(avl, box(355), box(2054), NULL);
+  avl = remove_int(avl, 730);
+  avl = remove_int(avl, 37);
+  avl = gpr_avl_add(avl, box(407), box(2057), NULL);
+  avl = gpr_avl_add(avl, box(222), box(2058), NULL);
+  avl = gpr_avl_add(avl, box(439), box(2059), NULL);
+  avl = gpr_avl_add(avl, box(563), box(2060), NULL);
+  avl = remove_int(avl, 992);
+  avl = remove_int(avl, 786);
+  avl = gpr_avl_add(avl, box(1), box(2063), NULL);
+  avl = gpr_avl_add(avl, box(473), box(2064), NULL);
+  avl = gpr_avl_add(avl, box(992), box(2065), NULL);
+  avl = remove_int(avl, 190);
+  avl = remove_int(avl, 450);
+  avl = remove_int(avl, 1020);
+  avl = remove_int(avl, 149);
+  avl = gpr_avl_add(avl, box(329), box(2070), NULL);
+  avl = gpr_avl_add(avl, box(35), box(2071), NULL);
+  avl = remove_int(avl, 843);
+  avl = gpr_avl_add(avl, box(855), box(2073), NULL);
+  avl = remove_int(avl, 878);
+  avl = gpr_avl_add(avl, box(993), box(2075), NULL);
+  avl = gpr_avl_add(avl, box(87), box(2076), NULL);
+  avl = gpr_avl_add(avl, box(572), box(2077), NULL);
+  avl = remove_int(avl, 896);
+  avl = gpr_avl_add(avl, box(849), box(2079), NULL);
+  avl = remove_int(avl, 597);
+  avl = gpr_avl_add(avl, box(472), box(2081), NULL);
+  avl = remove_int(avl, 778);
+  avl = remove_int(avl, 934);
+  avl = remove_int(avl, 314);
+  avl = gpr_avl_add(avl, box(101), box(2085), NULL);
+  avl = remove_int(avl, 938);
+  avl = remove_int(avl, 1010);
+  avl = gpr_avl_add(avl, box(579), box(2088), NULL);
+  avl = remove_int(avl, 798);
+  avl = remove_int(avl, 88);
+  avl = gpr_avl_add(avl, box(851), box(2091), NULL);
+  avl = remove_int(avl, 705);
+  avl = gpr_avl_add(avl, box(26), box(2093), NULL);
+  avl = remove_int(avl, 973);
+  avl = gpr_avl_add(avl, box(923), box(2095), NULL);
+  avl = remove_int(avl, 668);
+  avl = gpr_avl_add(avl, box(310), box(2097), NULL);
+  avl = gpr_avl_add(avl, box(269), box(2098), NULL);
+  avl = remove_int(avl, 173);
+  avl = gpr_avl_add(avl, box(279), box(2100), NULL);
+  avl = remove_int(avl, 203);
+  avl = gpr_avl_add(avl, box(411), box(2102), NULL);
+  avl = remove_int(avl, 950);
+  avl = gpr_avl_add(avl, box(6), box(2104), NULL);
+  avl = remove_int(avl, 400);
+  avl = remove_int(avl, 468);
+  avl = remove_int(avl, 271);
+  avl = gpr_avl_add(avl, box(627), box(2108), NULL);
+  avl = remove_int(avl, 727);
+  avl = remove_int(avl, 148);
+  avl = remove_int(avl, 98);
+  avl = remove_int(avl, 997);
+  avl = remove_int(avl, 215);
+  avl = remove_int(avl, 628);
+  avl = remove_int(avl, 826);
+  avl = remove_int(avl, 664);
+  avl = gpr_avl_add(avl, box(76), box(2117), NULL);
+  avl = remove_int(avl, 194);
+  avl = remove_int(avl, 18);
+  avl = gpr_avl_add(avl, box(727), box(2120), NULL);
+  avl = remove_int(avl, 295);
+  avl = gpr_avl_add(avl, box(645), box(2122), NULL);
+  avl = remove_int(avl, 321);
+  avl = remove_int(avl, 863);
+  avl = gpr_avl_add(avl, box(824), box(2125), NULL);
+  avl = gpr_avl_add(avl, box(651), box(2126), NULL);
+  avl = gpr_avl_add(avl, box(804), box(2127), NULL);
+  avl = remove_int(avl, 307);
+  avl = gpr_avl_add(avl, box(867), box(2129), NULL);
+  avl = remove_int(avl, 384);
+  avl = gpr_avl_add(avl, box(819), box(2131), NULL);
+  avl = remove_int(avl, 674);
+  avl = gpr_avl_add(avl, box(76), box(2133), NULL);
+  avl = remove_int(avl, 898);
+  avl = gpr_avl_add(avl, box(45), box(2135), NULL);
+  avl = gpr_avl_add(avl, box(512), box(2136), NULL);
+  avl = remove_int(avl, 773);
+  avl = remove_int(avl, 907);
+  avl = remove_int(avl, 382);
+  avl = remove_int(avl, 95);
+  avl = remove_int(avl, 734);
+  avl = remove_int(avl, 81);
+  avl = gpr_avl_add(avl, box(348), box(2143), NULL);
+  avl = remove_int(avl, 509);
+  avl = remove_int(avl, 301);
+  avl = gpr_avl_add(avl, box(861), box(2146), NULL);
+  avl = gpr_avl_add(avl, box(918), box(2147), NULL);
+  avl = remove_int(avl, 992);
+  avl = gpr_avl_add(avl, box(356), box(2149), NULL);
+  avl = remove_int(avl, 64);
+  avl = remove_int(avl, 444);
+  avl = remove_int(avl, 741);
+  avl = gpr_avl_add(avl, box(710), box(2153), NULL);
+  avl = gpr_avl_add(avl, box(264), box(2154), NULL);
+  avl = remove_int(avl, 347);
+  avl = remove_int(avl, 250);
+  avl = gpr_avl_add(avl, box(82), box(2157), NULL);
+  avl = gpr_avl_add(avl, box(571), box(2158), NULL);
+  avl = remove_int(avl, 721);
+  avl = remove_int(avl, 622);
+  avl = gpr_avl_add(avl, box(950), box(2161), NULL);
+  avl = gpr_avl_add(avl, box(94), box(2162), NULL);
+  avl = remove_int(avl, 970);
+  avl = gpr_avl_add(avl, box(815), box(2164), NULL);
+  avl = remove_int(avl, 930);
+  avl = remove_int(avl, 703);
+  avl = gpr_avl_add(avl, box(432), box(2167), NULL);
+  avl = remove_int(avl, 544);
+  avl = gpr_avl_add(avl, box(21), box(2169), NULL);
+  avl = gpr_avl_add(avl, box(186), box(2170), NULL);
+  avl = remove_int(avl, 143);
+  avl = gpr_avl_add(avl, box(425), box(2172), NULL);
+  avl = remove_int(avl, 769);
+  avl = gpr_avl_add(avl, box(656), box(2174), NULL);
+  avl = remove_int(avl, 29);
+  avl = gpr_avl_add(avl, box(464), box(2176), NULL);
+  avl = remove_int(avl, 713);
+  avl = gpr_avl_add(avl, box(800), box(2178), NULL);
+  avl = remove_int(avl, 621);
+  avl = gpr_avl_add(avl, box(962), box(2180), NULL);
+  avl = remove_int(avl, 448);
+  avl = gpr_avl_add(avl, box(878), box(2182), NULL);
+  avl = remove_int(avl, 39);
+  avl = remove_int(avl, 999);
+  avl = gpr_avl_add(avl, box(182), box(2185), NULL);
+  avl = gpr_avl_add(avl, box(429), box(2186), NULL);
+  avl = gpr_avl_add(avl, box(598), box(2187), NULL);
+  avl = remove_int(avl, 551);
+  avl = gpr_avl_add(avl, box(827), box(2189), NULL);
+  avl = gpr_avl_add(avl, box(809), box(2190), NULL);
+  avl = remove_int(avl, 438);
+  avl = remove_int(avl, 811);
+  avl = gpr_avl_add(avl, box(808), box(2193), NULL);
+  avl = gpr_avl_add(avl, box(788), box(2194), NULL);
+  avl = remove_int(avl, 156);
+  avl = gpr_avl_add(avl, box(933), box(2196), NULL);
+  avl = gpr_avl_add(avl, box(344), box(2197), NULL);
+  avl = remove_int(avl, 460);
+  avl = gpr_avl_add(avl, box(161), box(2199), NULL);
+  avl = gpr_avl_add(avl, box(444), box(2200), NULL);
+  avl = remove_int(avl, 597);
+  avl = remove_int(avl, 668);
+  avl = gpr_avl_add(avl, box(703), box(2203), NULL);
+  avl = remove_int(avl, 515);
+  avl = gpr_avl_add(avl, box(380), box(2205), NULL);
+  avl = gpr_avl_add(avl, box(338), box(2206), NULL);
+  avl = remove_int(avl, 550);
+  avl = remove_int(avl, 946);
+  avl = remove_int(avl, 714);
+  avl = remove_int(avl, 739);
+  avl = gpr_avl_add(avl, box(413), box(2211), NULL);
+  avl = remove_int(avl, 450);
+  avl = gpr_avl_add(avl, box(411), box(2213), NULL);
+  avl = gpr_avl_add(avl, box(117), box(2214), NULL);
+  avl = gpr_avl_add(avl, box(322), box(2215), NULL);
+  avl = gpr_avl_add(avl, box(915), box(2216), NULL);
+  avl = gpr_avl_add(avl, box(410), box(2217), NULL);
+  avl = gpr_avl_add(avl, box(66), box(2218), NULL);
+  avl = remove_int(avl, 756);
+  avl = remove_int(avl, 596);
+  avl = gpr_avl_add(avl, box(882), box(2221), NULL);
+  avl = gpr_avl_add(avl, box(930), box(2222), NULL);
+  avl = gpr_avl_add(avl, box(36), box(2223), NULL);
+  avl = remove_int(avl, 742);
+  avl = gpr_avl_add(avl, box(539), box(2225), NULL);
+  avl = gpr_avl_add(avl, box(596), box(2226), NULL);
+  avl = remove_int(avl, 82);
+  avl = remove_int(avl, 686);
+  avl = remove_int(avl, 933);
+  avl = remove_int(avl, 42);
+  avl = remove_int(avl, 340);
+  avl = gpr_avl_add(avl, box(126), box(2232), NULL);
+  avl = gpr_avl_add(avl, box(493), box(2233), NULL);
+  avl = gpr_avl_add(avl, box(839), box(2234), NULL);
+  avl = remove_int(avl, 774);
+  avl = gpr_avl_add(avl, box(337), box(2236), NULL);
+  avl = remove_int(avl, 322);
+  avl = gpr_avl_add(avl, box(16), box(2238), NULL);
+  avl = remove_int(avl, 73);
+  avl = remove_int(avl, 85);
+  avl = remove_int(avl, 191);
+  avl = remove_int(avl, 541);
+  avl = gpr_avl_add(avl, box(704), box(2243), NULL);
+  avl = remove_int(avl, 767);
+  avl = remove_int(avl, 1006);
+  avl = remove_int(avl, 844);
+  avl = remove_int(avl, 742);
+  avl = gpr_avl_add(avl, box(48), box(2248), NULL);
+  avl = gpr_avl_add(avl, box(138), box(2249), NULL);
+  avl = gpr_avl_add(avl, box(437), box(2250), NULL);
+  avl = gpr_avl_add(avl, box(275), box(2251), NULL);
+  avl = remove_int(avl, 520);
+  avl = gpr_avl_add(avl, box(1019), box(2253), NULL);
+  avl = remove_int(avl, 955);
+  avl = gpr_avl_add(avl, box(270), box(2255), NULL);
+  avl = remove_int(avl, 680);
+  avl = remove_int(avl, 698);
+  avl = gpr_avl_add(avl, box(735), box(2258), NULL);
+  avl = gpr_avl_add(avl, box(400), box(2259), NULL);
+  avl = remove_int(avl, 991);
+  avl = gpr_avl_add(avl, box(263), box(2261), NULL);
+  avl = remove_int(avl, 704);
+  avl = gpr_avl_add(avl, box(757), box(2263), NULL);
+  avl = remove_int(avl, 194);
+  avl = remove_int(avl, 616);
+  avl = remove_int(avl, 784);
+  avl = gpr_avl_add(avl, box(382), box(2267), NULL);
+  avl = gpr_avl_add(avl, box(464), box(2268), NULL);
+  avl = gpr_avl_add(avl, box(817), box(2269), NULL);
+  avl = remove_int(avl, 445);
+  avl = gpr_avl_add(avl, box(412), box(2271), NULL);
+  avl = remove_int(avl, 525);
+  avl = gpr_avl_add(avl, box(299), box(2273), NULL);
+  avl = gpr_avl_add(avl, box(464), box(2274), NULL);
+  avl = gpr_avl_add(avl, box(715), box(2275), NULL);
+  avl = remove_int(avl, 58);
+  avl = remove_int(avl, 218);
+  avl = gpr_avl_add(avl, box(961), box(2278), NULL);
+  avl = gpr_avl_add(avl, box(491), box(2279), NULL);
+  avl = remove_int(avl, 846);
+  avl = gpr_avl_add(avl, box(762), box(2281), NULL);
+  avl = remove_int(avl, 974);
+  avl = remove_int(avl, 887);
+  avl = gpr_avl_add(avl, box(498), box(2284), NULL);
+  avl = remove_int(avl, 810);
+  avl = remove_int(avl, 743);
+  avl = remove_int(avl, 22);
+  avl = remove_int(avl, 284);
+  avl = gpr_avl_add(avl, box(482), box(2289), NULL);
+  avl = gpr_avl_add(avl, box(1021), box(2290), NULL);
+  avl = remove_int(avl, 155);
+  avl = remove_int(avl, 128);
+  avl = gpr_avl_add(avl, box(819), box(2293), NULL);
+  avl = gpr_avl_add(avl, box(324), box(2294), NULL);
+  avl = remove_int(avl, 196);
+  avl = remove_int(avl, 370);
+  avl = remove_int(avl, 753);
+  avl = remove_int(avl, 56);
+  avl = remove_int(avl, 735);
+  avl = gpr_avl_add(avl, box(272), box(2300), NULL);
+  avl = gpr_avl_add(avl, box(474), box(2301), NULL);
+  avl = gpr_avl_add(avl, box(719), box(2302), NULL);
+  avl = gpr_avl_add(avl, box(236), box(2303), NULL);
+  avl = remove_int(avl, 818);
+  avl = gpr_avl_add(avl, box(727), box(2305), NULL);
+  avl = remove_int(avl, 892);
+  avl = remove_int(avl, 871);
+  avl = remove_int(avl, 231);
+  avl = gpr_avl_add(avl, box(62), box(2309), NULL);
+  avl = gpr_avl_add(avl, box(953), box(2310), NULL);
+  avl = remove_int(avl, 701);
+  avl = gpr_avl_add(avl, box(193), box(2312), NULL);
+  avl = remove_int(avl, 619);
+  avl = remove_int(avl, 22);
+  avl = remove_int(avl, 804);
+  avl = remove_int(avl, 851);
+  avl = gpr_avl_add(avl, box(286), box(2317), NULL);
+  avl = gpr_avl_add(avl, box(751), box(2318), NULL);
+  avl = remove_int(avl, 525);
+  avl = gpr_avl_add(avl, box(217), box(2320), NULL);
+  avl = remove_int(avl, 336);
+  avl = gpr_avl_add(avl, box(86), box(2322), NULL);
+  avl = gpr_avl_add(avl, box(81), box(2323), NULL);
+  avl = gpr_avl_add(avl, box(850), box(2324), NULL);
+  avl = remove_int(avl, 872);
+  avl = gpr_avl_add(avl, box(402), box(2326), NULL);
+  avl = gpr_avl_add(avl, box(54), box(2327), NULL);
+  avl = gpr_avl_add(avl, box(980), box(2328), NULL);
+  avl = gpr_avl_add(avl, box(845), box(2329), NULL);
+  avl = remove_int(avl, 1004);
+  avl = remove_int(avl, 273);
+  avl = remove_int(avl, 879);
+  avl = gpr_avl_add(avl, box(354), box(2333), NULL);
+  avl = gpr_avl_add(avl, box(58), box(2334), NULL);
+  avl = gpr_avl_add(avl, box(127), box(2335), NULL);
+  avl = remove_int(avl, 84);
+  avl = gpr_avl_add(avl, box(360), box(2337), NULL);
+  avl = remove_int(avl, 648);
+  avl = remove_int(avl, 488);
+  avl = remove_int(avl, 585);
+  avl = remove_int(avl, 230);
+  avl = gpr_avl_add(avl, box(887), box(2342), NULL);
+  avl = remove_int(avl, 558);
+  avl = remove_int(avl, 958);
+  avl = gpr_avl_add(avl, box(822), box(2345), NULL);
+  avl = remove_int(avl, 1004);
+  avl = remove_int(avl, 747);
+  avl = gpr_avl_add(avl, box(631), box(2348), NULL);
+  avl = gpr_avl_add(avl, box(442), box(2349), NULL);
+  avl = remove_int(avl, 957);
+  avl = remove_int(avl, 964);
+  avl = gpr_avl_add(avl, box(10), box(2352), NULL);
+  avl = remove_int(avl, 189);
+  avl = gpr_avl_add(avl, box(742), box(2354), NULL);
+  avl = remove_int(avl, 108);
+  avl = gpr_avl_add(avl, box(1014), box(2356), NULL);
+  avl = remove_int(avl, 266);
+  avl = remove_int(avl, 623);
+  avl = remove_int(avl, 697);
+  avl = gpr_avl_add(avl, box(180), box(2360), NULL);
+  avl = remove_int(avl, 472);
+  avl = gpr_avl_add(avl, box(567), box(2362), NULL);
+  avl = remove_int(avl, 1020);
+  avl = remove_int(avl, 273);
+  avl = gpr_avl_add(avl, box(864), box(2365), NULL);
+  avl = gpr_avl_add(avl, box(1009), box(2366), NULL);
+  avl = remove_int(avl, 224);
+  avl = remove_int(avl, 81);
+  avl = gpr_avl_add(avl, box(653), box(2369), NULL);
+  avl = remove_int(avl, 67);
+  avl = remove_int(avl, 102);
+  avl = remove_int(avl, 76);
+  avl = remove_int(avl, 935);
+  avl = remove_int(avl, 169);
+  avl = remove_int(avl, 232);
+  avl = remove_int(avl, 79);
+  avl = gpr_avl_add(avl, box(509), box(2377), NULL);
+  avl = remove_int(avl, 900);
+  avl = remove_int(avl, 822);
+  avl = remove_int(avl, 945);
+  avl = remove_int(avl, 356);
+  avl = gpr_avl_add(avl, box(443), box(2382), NULL);
+  avl = gpr_avl_add(avl, box(925), box(2383), NULL);
+  avl = remove_int(avl, 994);
+  avl = remove_int(avl, 324);
+  avl = gpr_avl_add(avl, box(291), box(2386), NULL);
+  avl = remove_int(avl, 94);
+  avl = remove_int(avl, 795);
+  avl = remove_int(avl, 42);
+  avl = gpr_avl_add(avl, box(613), box(2390), NULL);
+  avl = remove_int(avl, 289);
+  avl = gpr_avl_add(avl, box(980), box(2392), NULL);
+  avl = remove_int(avl, 316);
+  avl = gpr_avl_add(avl, box(281), box(2394), NULL);
+  avl = gpr_avl_add(avl, box(1006), box(2395), NULL);
+  avl = remove_int(avl, 776);
+  avl = gpr_avl_add(avl, box(108), box(2397), NULL);
+  avl = gpr_avl_add(avl, box(918), box(2398), NULL);
+  avl = remove_int(avl, 721);
+  avl = remove_int(avl, 563);
+  avl = gpr_avl_add(avl, box(925), box(2401), NULL);
+  avl = remove_int(avl, 448);
+  avl = remove_int(avl, 198);
+  avl = remove_int(avl, 1);
+  avl = gpr_avl_add(avl, box(160), box(2405), NULL);
+  avl = remove_int(avl, 515);
+  avl = gpr_avl_add(avl, box(284), box(2407), NULL);
+  avl = gpr_avl_add(avl, box(225), box(2408), NULL);
+  avl = remove_int(avl, 304);
+  avl = gpr_avl_add(avl, box(714), box(2410), NULL);
+  avl = gpr_avl_add(avl, box(708), box(2411), NULL);
+  avl = gpr_avl_add(avl, box(624), box(2412), NULL);
+  avl = remove_int(avl, 662);
+  avl = remove_int(avl, 825);
+  avl = remove_int(avl, 383);
+  avl = remove_int(avl, 381);
+  avl = gpr_avl_add(avl, box(194), box(2417), NULL);
+  avl = remove_int(avl, 280);
+  avl = remove_int(avl, 25);
+  avl = remove_int(avl, 633);
+  avl = gpr_avl_add(avl, box(897), box(2421), NULL);
+  avl = remove_int(avl, 636);
+  avl = remove_int(avl, 596);
+  avl = remove_int(avl, 757);
+  avl = remove_int(avl, 343);
+  avl = remove_int(avl, 162);
+  avl = remove_int(avl, 913);
+  avl = remove_int(avl, 843);
+  avl = remove_int(avl, 280);
+  avl = remove_int(avl, 911);
+  avl = gpr_avl_add(avl, box(1008), box(2431), NULL);
+  avl = remove_int(avl, 948);
+  avl = remove_int(avl, 74);
+  avl = remove_int(avl, 571);
+  avl = gpr_avl_add(avl, box(486), box(2435), NULL);
+  avl = gpr_avl_add(avl, box(285), box(2436), NULL);
+  avl = remove_int(avl, 304);
+  avl = remove_int(avl, 516);
+  avl = gpr_avl_add(avl, box(758), box(2439), NULL);
+  avl = gpr_avl_add(avl, box(776), box(2440), NULL);
+  avl = remove_int(avl, 696);
+  avl = gpr_avl_add(avl, box(104), box(2442), NULL);
+  avl = gpr_avl_add(avl, box(700), box(2443), NULL);
+  avl = gpr_avl_add(avl, box(114), box(2444), NULL);
+  avl = gpr_avl_add(avl, box(567), box(2445), NULL);
+  avl = remove_int(avl, 620);
+  avl = gpr_avl_add(avl, box(270), box(2447), NULL);
+  avl = remove_int(avl, 730);
+  avl = gpr_avl_add(avl, box(749), box(2449), NULL);
+  avl = gpr_avl_add(avl, box(443), box(2450), NULL);
+  avl = remove_int(avl, 457);
+  avl = gpr_avl_add(avl, box(571), box(2452), NULL);
+  avl = gpr_avl_add(avl, box(626), box(2453), NULL);
+  avl = remove_int(avl, 638);
+  avl = remove_int(avl, 313);
+
+  gpr_avl_unref(avl, NULL);
+}
+
+static void test_stress(int amount_of_stress) {
+  int added[1024];
+  int i, j;
+  int deletions = 0;
+  gpr_avl avl;
+
+  unsigned seed = (unsigned)time(NULL);
+
+  gpr_log(GPR_DEBUG, "test_stress amount=%d seed=%u", amount_of_stress, seed);
+
+  srand((unsigned)time(NULL));
+  avl = gpr_avl_create(&int_int_vtable);
+
+  memset(added, 0, sizeof(added));
+
+  for (i = 1; deletions < amount_of_stress; i++) {
+    int idx = rand() % (int)GPR_ARRAY_SIZE(added);
+    GPR_ASSERT(i);
+    if (rand() < RAND_MAX / 2) {
+      added[idx] = i;
+      printf("avl = gpr_avl_add(avl, box(%d), box(%d), NULL); /* d=%d */\n",
+             idx, i, deletions);
+      avl = gpr_avl_add(avl, box(idx), box(i), NULL);
+    } else {
+      deletions += (added[idx] != 0);
+      added[idx] = 0;
+      printf("avl = remove_int(avl, %d); /* d=%d */\n", idx, deletions);
+      avl = remove_int(avl, idx);
+    }
+    for (j = 0; j < (int)GPR_ARRAY_SIZE(added); j++) {
+      if (added[j] != 0) {
+        check_get(avl, j, added[j]);
+      } else {
+        check_negget(avl, j);
+      }
+    }
+  }
+
+  gpr_avl_unref(avl, NULL);
+}
+
+int main(int argc, char* argv[]) {
+  grpc_test_init(argc, argv);
+
+  test_get();
+  test_ll();
+  test_lr();
+  test_rr();
+  test_rl();
+  test_unbalanced();
+  test_replace();
+  test_remove();
+  test_badcase1();
+  test_badcase2();
+  test_badcase3();
+  test_stress(10);
+
+  return 0;
+}
diff --git a/test/core/support/cmdline_test.c b/test/core/support/cmdline_test.c
deleted file mode 100644
index 72e7c7f..0000000
--- a/test/core/support/cmdline_test.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/cmdline.h>
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST() gpr_log(GPR_INFO, "test at %s:%d", __FILE__, __LINE__)
-
-static void test_simple_int(void) {
-  int x = 1;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "-foo", "3"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_int(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 1);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 3);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_eq_int(void) {
-  int x = 1;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "-foo=3"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_int(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 1);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 3);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_2dash_int(void) {
-  int x = 1;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--foo", "3"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_int(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 1);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 3);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_2dash_eq_int(void) {
-  int x = 1;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--foo=3"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_int(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 1);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 3);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_simple_string(void) {
-  char *x = NULL;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "-foo", "3"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_string(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == NULL);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(0 == strcmp(x, "3"));
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_eq_string(void) {
-  char *x = NULL;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "-foo=3"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_string(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == NULL);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(0 == strcmp(x, "3"));
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_2dash_string(void) {
-  char *x = NULL;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--foo", "3"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_string(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == NULL);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(0 == strcmp(x, "3"));
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_2dash_eq_string(void) {
-  char *x = NULL;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--foo=3"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_string(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == NULL);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(0 == strcmp(x, "3"));
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_flag_on(void) {
-  int x = 2;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--foo"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 2);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 1);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_flag_no(void) {
-  int x = 2;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--no-foo"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 2);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 0);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_flag_val_1(void) {
-  int x = 2;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--foo=1"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 2);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 1);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_flag_val_0(void) {
-  int x = 2;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--foo=0"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 2);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 0);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_flag_val_true(void) {
-  int x = 2;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--foo=true"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 2);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 1);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_flag_val_false(void) {
-  int x = 2;
-  gpr_cmdline *cl;
-  char *args[] = {(char *)__FILE__, "--foo=false"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
-  GPR_ASSERT(x == 2);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 0);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_many(void) {
-  char *str = NULL;
-  int x = 0;
-  int flag = 2;
-  gpr_cmdline *cl;
-
-  char *args[] = {(char *)__FILE__, "--str", "hello", "-x=4", "-no-flag"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_string(cl, "str", NULL, &str);
-  gpr_cmdline_add_int(cl, "x", NULL, &x);
-  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(x == 4);
-  GPR_ASSERT(0 == strcmp(str, "hello"));
-  GPR_ASSERT(flag == 0);
-  gpr_cmdline_destroy(cl);
-}
-
-static void extra_arg_cb(void *user_data, const char *arg) {
-  int *count = user_data;
-  GPR_ASSERT(arg != NULL);
-  GPR_ASSERT(strlen(arg) == 1);
-  GPR_ASSERT(arg[0] == 'a' + *count);
-  ++*count;
-}
-
-static void test_extra(void) {
-  gpr_cmdline *cl;
-  int count = 0;
-  char *args[] = {(char *)__FILE__, "a", "b", "c"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
-                           &count);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(count == 3);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_extra_dashdash(void) {
-  gpr_cmdline *cl;
-  int count = 0;
-  char *args[] = {(char *)__FILE__, "--", "a", "b", "c"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
-                           &count);
-  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
-  GPR_ASSERT(count == 3);
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_usage(void) {
-  gpr_cmdline *cl;
-  char *usage;
-
-  char *str = NULL;
-  int x = 0;
-  int flag = 2;
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_add_string(cl, "str", NULL, &str);
-  gpr_cmdline_add_int(cl, "x", NULL, &x);
-  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
-  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
-                           NULL);
-
-  usage = gpr_cmdline_usage_string(cl, "test");
-  GPR_ASSERT(0 == strcmp(usage,
-                         "Usage: test [--str=string] [--x=int] "
-                         "[--flag|--no-flag] [file...]\n"));
-  gpr_free(usage);
-
-  usage = gpr_cmdline_usage_string(cl, "/foo/test");
-  GPR_ASSERT(0 == strcmp(usage,
-                         "Usage: test [--str=string] [--x=int] "
-                         "[--flag|--no-flag] [file...]\n"));
-  gpr_free(usage);
-
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_help(void) {
-  gpr_cmdline *cl;
-
-  char *str = NULL;
-  int x = 0;
-  int flag = 2;
-
-  char *help[] = {(char *)__FILE__, "-h"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_set_survive_failure(cl);
-  gpr_cmdline_add_string(cl, "str", NULL, &str);
-  gpr_cmdline_add_int(cl, "x", NULL, &x);
-  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
-  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
-                           NULL);
-
-  GPR_ASSERT(0 == gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(help), help));
-
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_badargs1(void) {
-  gpr_cmdline *cl;
-
-  char *str = NULL;
-  int x = 0;
-  int flag = 2;
-
-  char *bad_arg_name[] = {(char *)__FILE__, "--y"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_set_survive_failure(cl);
-  gpr_cmdline_add_string(cl, "str", NULL, &str);
-  gpr_cmdline_add_int(cl, "x", NULL, &x);
-  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
-  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
-                           NULL);
-
-  GPR_ASSERT(0 ==
-             gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(bad_arg_name), bad_arg_name));
-
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_badargs2(void) {
-  gpr_cmdline *cl;
-
-  char *str = NULL;
-  int x = 0;
-  int flag = 2;
-
-  char *bad_int_value[] = {(char *)__FILE__, "--x", "henry"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_set_survive_failure(cl);
-  gpr_cmdline_add_string(cl, "str", NULL, &str);
-  gpr_cmdline_add_int(cl, "x", NULL, &x);
-  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
-  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
-                           NULL);
-
-  GPR_ASSERT(
-      0 == gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(bad_int_value), bad_int_value));
-
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_badargs3(void) {
-  gpr_cmdline *cl;
-
-  char *str = NULL;
-  int x = 0;
-  int flag = 2;
-
-  char *bad_bool_value[] = {(char *)__FILE__, "--flag=henry"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_set_survive_failure(cl);
-  gpr_cmdline_add_string(cl, "str", NULL, &str);
-  gpr_cmdline_add_int(cl, "x", NULL, &x);
-  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
-  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
-                           NULL);
-
-  GPR_ASSERT(0 == gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(bad_bool_value),
-                                    bad_bool_value));
-
-  gpr_cmdline_destroy(cl);
-}
-
-static void test_badargs4(void) {
-  gpr_cmdline *cl;
-
-  char *str = NULL;
-  int x = 0;
-  int flag = 2;
-
-  char *bad_bool_value[] = {(char *)__FILE__, "--no-str"};
-
-  LOG_TEST();
-
-  cl = gpr_cmdline_create(NULL);
-  gpr_cmdline_set_survive_failure(cl);
-  gpr_cmdline_add_string(cl, "str", NULL, &str);
-  gpr_cmdline_add_int(cl, "x", NULL, &x);
-  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
-  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
-                           NULL);
-
-  GPR_ASSERT(0 == gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(bad_bool_value),
-                                    bad_bool_value));
-
-  gpr_cmdline_destroy(cl);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_simple_int();
-  test_eq_int();
-  test_2dash_int();
-  test_2dash_eq_int();
-  test_simple_string();
-  test_eq_string();
-  test_2dash_string();
-  test_2dash_eq_string();
-  test_flag_on();
-  test_flag_no();
-  test_flag_val_1();
-  test_flag_val_0();
-  test_flag_val_true();
-  test_flag_val_false();
-  test_many();
-  test_extra();
-  test_extra_dashdash();
-  test_usage();
-  test_help();
-  test_badargs1();
-  test_badargs2();
-  test_badargs3();
-  test_badargs4();
-  return 0;
-}
diff --git a/test/core/support/cmdline_test.cc b/test/core/support/cmdline_test.cc
new file mode 100644
index 0000000..5afaa2a
--- /dev/null
+++ b/test/core/support/cmdline_test.cc
@@ -0,0 +1,491 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/cmdline.h>
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST() gpr_log(GPR_INFO, "test at %s:%d", __FILE__, __LINE__)
+
+static void test_simple_int(void) {
+  int x = 1;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("-foo"),
+                  const_cast<char*>("3")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_int(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 1);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 3);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_eq_int(void) {
+  int x = 1;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("-foo=3")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_int(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 1);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 3);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_2dash_int(void) {
+  int x = 1;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--foo"),
+                  const_cast<char*>("3")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_int(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 1);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 3);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_2dash_eq_int(void) {
+  int x = 1;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--foo=3")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_int(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 1);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 3);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_simple_string(void) {
+  const char* x = NULL;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("-foo"),
+                  const_cast<char*>("3")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_string(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == NULL);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(0 == strcmp(x, "3"));
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_eq_string(void) {
+  const char* x = NULL;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("-foo=3")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_string(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == NULL);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(0 == strcmp(x, "3"));
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_2dash_string(void) {
+  const char* x = NULL;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--foo"),
+                  const_cast<char*>("3")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_string(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == NULL);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(0 == strcmp(x, "3"));
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_2dash_eq_string(void) {
+  const char* x = NULL;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--foo=3")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_string(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == NULL);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(0 == strcmp(x, "3"));
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_flag_on(void) {
+  int x = 2;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--foo")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 2);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 1);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_flag_no(void) {
+  int x = 2;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--no-foo")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 2);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 0);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_flag_val_1(void) {
+  int x = 2;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--foo=1")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 2);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 1);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_flag_val_0(void) {
+  int x = 2;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--foo=0")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 2);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 0);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_flag_val_true(void) {
+  int x = 2;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--foo=true")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 2);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 1);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_flag_val_false(void) {
+  int x = 2;
+  gpr_cmdline* cl;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--foo=false")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_flag(cl, "foo", NULL, &x);
+  GPR_ASSERT(x == 2);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 0);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_many(void) {
+  const char* str = NULL;
+  int x = 0;
+  int flag = 2;
+  gpr_cmdline* cl;
+
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--str"),
+                  const_cast<char*>("hello"), const_cast<char*>("-x=4"),
+                  const_cast<char*>("-no-flag")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_string(cl, "str", NULL, &str);
+  gpr_cmdline_add_int(cl, "x", NULL, &x);
+  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(x == 4);
+  GPR_ASSERT(0 == strcmp(str, "hello"));
+  GPR_ASSERT(flag == 0);
+  gpr_cmdline_destroy(cl);
+}
+
+static void extra_arg_cb(void* user_data, const char* arg) {
+  int* count = static_cast<int*>(user_data);
+  GPR_ASSERT(arg != NULL);
+  GPR_ASSERT(strlen(arg) == 1);
+  GPR_ASSERT(arg[0] == 'a' + *count);
+  ++*count;
+}
+
+static void test_extra(void) {
+  gpr_cmdline* cl;
+  int count = 0;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("a"),
+                  const_cast<char*>("b"), const_cast<char*>("c")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
+                           &count);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(count == 3);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_extra_dashdash(void) {
+  gpr_cmdline* cl;
+  int count = 0;
+  char* args[] = {(char*)__FILE__, const_cast<char*>("--"),
+                  const_cast<char*>("a"), const_cast<char*>("b"),
+                  const_cast<char*>("c")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
+                           &count);
+  gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(args), args);
+  GPR_ASSERT(count == 3);
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_usage(void) {
+  gpr_cmdline* cl;
+  char* usage;
+
+  const char* str = NULL;
+  int x = 0;
+  int flag = 2;
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_add_string(cl, "str", NULL, &str);
+  gpr_cmdline_add_int(cl, "x", NULL, &x);
+  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
+  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
+                           NULL);
+
+  usage = gpr_cmdline_usage_string(cl, "test");
+  GPR_ASSERT(0 == strcmp(usage,
+                         "Usage: test [--str=string] [--x=int] "
+                         "[--flag|--no-flag] [file...]\n"));
+  gpr_free(usage);
+
+  usage = gpr_cmdline_usage_string(cl, "/foo/test");
+  GPR_ASSERT(0 == strcmp(usage,
+                         "Usage: test [--str=string] [--x=int] "
+                         "[--flag|--no-flag] [file...]\n"));
+  gpr_free(usage);
+
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_help(void) {
+  gpr_cmdline* cl;
+
+  const char* str = NULL;
+  int x = 0;
+  int flag = 2;
+
+  char* help[] = {(char*)__FILE__, const_cast<char*>("-h")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_set_survive_failure(cl);
+  gpr_cmdline_add_string(cl, "str", NULL, &str);
+  gpr_cmdline_add_int(cl, "x", NULL, &x);
+  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
+  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
+                           NULL);
+
+  GPR_ASSERT(0 == gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(help), help));
+
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_badargs1(void) {
+  gpr_cmdline* cl;
+
+  const char* str = NULL;
+  int x = 0;
+  int flag = 2;
+
+  char* bad_arg_name[] = {(char*)__FILE__, const_cast<char*>("--y")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_set_survive_failure(cl);
+  gpr_cmdline_add_string(cl, "str", NULL, &str);
+  gpr_cmdline_add_int(cl, "x", NULL, &x);
+  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
+  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
+                           NULL);
+
+  GPR_ASSERT(0 ==
+             gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(bad_arg_name), bad_arg_name));
+
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_badargs2(void) {
+  gpr_cmdline* cl;
+
+  const char* str = NULL;
+  int x = 0;
+  int flag = 2;
+
+  char* bad_int_value[] = {(char*)__FILE__, const_cast<char*>("--x"),
+                           const_cast<char*>("henry")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_set_survive_failure(cl);
+  gpr_cmdline_add_string(cl, "str", NULL, &str);
+  gpr_cmdline_add_int(cl, "x", NULL, &x);
+  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
+  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
+                           NULL);
+
+  GPR_ASSERT(
+      0 == gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(bad_int_value), bad_int_value));
+
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_badargs3(void) {
+  gpr_cmdline* cl;
+
+  const char* str = NULL;
+  int x = 0;
+  int flag = 2;
+
+  char* bad_bool_value[] = {(char*)__FILE__, const_cast<char*>("--flag=henry")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_set_survive_failure(cl);
+  gpr_cmdline_add_string(cl, "str", NULL, &str);
+  gpr_cmdline_add_int(cl, "x", NULL, &x);
+  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
+  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
+                           NULL);
+
+  GPR_ASSERT(0 == gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(bad_bool_value),
+                                    bad_bool_value));
+
+  gpr_cmdline_destroy(cl);
+}
+
+static void test_badargs4(void) {
+  gpr_cmdline* cl;
+
+  const char* str = NULL;
+  int x = 0;
+  int flag = 2;
+
+  char* bad_bool_value[] = {(char*)__FILE__, const_cast<char*>("--no-str")};
+
+  LOG_TEST();
+
+  cl = gpr_cmdline_create(NULL);
+  gpr_cmdline_set_survive_failure(cl);
+  gpr_cmdline_add_string(cl, "str", NULL, &str);
+  gpr_cmdline_add_int(cl, "x", NULL, &x);
+  gpr_cmdline_add_flag(cl, "flag", NULL, &flag);
+  gpr_cmdline_on_extra_arg(cl, "file", "filenames to process", extra_arg_cb,
+                           NULL);
+
+  GPR_ASSERT(0 == gpr_cmdline_parse(cl, GPR_ARRAY_SIZE(bad_bool_value),
+                                    bad_bool_value));
+
+  gpr_cmdline_destroy(cl);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_simple_int();
+  test_eq_int();
+  test_2dash_int();
+  test_2dash_eq_int();
+  test_simple_string();
+  test_eq_string();
+  test_2dash_string();
+  test_2dash_eq_string();
+  test_flag_on();
+  test_flag_no();
+  test_flag_val_1();
+  test_flag_val_0();
+  test_flag_val_true();
+  test_flag_val_false();
+  test_many();
+  test_extra();
+  test_extra_dashdash();
+  test_usage();
+  test_help();
+  test_badargs1();
+  test_badargs2();
+  test_badargs3();
+  test_badargs4();
+  return 0;
+}
diff --git a/test/core/support/cpu_test.c b/test/core/support/cpu_test.c
deleted file mode 100644
index 72db53f..0000000
--- a/test/core/support/cpu_test.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* Test gpr per-cpu support:
-   gpr_cpu_num_cores()
-   gpr_cpu_current_cpu()
-*/
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/cpu.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <stdio.h>
-#include <string.h>
-#include "test/core/util/test_config.h"
-
-/* Test structure is essentially:
-   1) Figure out how many cores are present on the test system
-   2) Create 3 times that many threads
-   3) Have each thread do some amount of work (basically want to
-      gaurantee that all threads are running at once, and enough of them
-      to run on all cores).
-   4) Each thread checks what core it is running on, and marks that core
-      as "used" in the test.
-   5) Count number of "used" cores.
-
-   The test will fail if:
-   1) gpr_cpu_num_cores() == 0
-   2) Any result from gpr_cpu_current_cpu() >= gpr_cpu_num_cores()
-   3) Ideally, we would fail if not all cores were seen as used. Unfortunately,
-      this is only probabilistically true, and depends on the OS, it's
-      scheduler, etc. So we just print out an indication of how many were seen;
-      hopefully developers can use this to sanity check their system.
-*/
-
-/* Status shared across threads */
-struct cpu_test {
-  gpr_mu mu;
-  int nthreads;
-  uint32_t ncores;
-  int is_done;
-  gpr_cv done_cv;
-  int *used;  /* is this core used? */
-  unsigned r; /* random number */
-};
-
-static void worker_thread(void *arg) {
-  struct cpu_test *ct = (struct cpu_test *)arg;
-  uint32_t cpu;
-  unsigned r = 12345678;
-  unsigned i, j;
-  /* Avoid repetitive division calculations */
-  int64_t max_i = 1000 / grpc_test_slowdown_factor();
-  int64_t max_j = 1000000 / grpc_test_slowdown_factor();
-  for (i = 0; i < max_i; i++) {
-    /* run for a bit - just calculate something random. */
-    for (j = 0; j < max_j; j++) {
-      r = (r * 17) & ((r - i) | (r * i));
-    }
-    cpu = gpr_cpu_current_cpu();
-    GPR_ASSERT(cpu < ct->ncores);
-    gpr_mu_lock(&ct->mu);
-    ct->used[cpu] = 1;
-    for (j = 0; j < ct->ncores; j++) {
-      if (!ct->used[j]) break;
-    }
-    gpr_mu_unlock(&ct->mu);
-    if (j == ct->ncores) {
-      break; /* all cpus have been used - no further use in running this test */
-    }
-  }
-  gpr_mu_lock(&ct->mu);
-  ct->r = r; /* make it look like we care about r's value... */
-  ct->nthreads--;
-  if (ct->nthreads == 0) {
-    ct->is_done = 1;
-    gpr_cv_signal(&ct->done_cv);
-  }
-  gpr_mu_unlock(&ct->mu);
-}
-
-static void cpu_test(void) {
-  uint32_t i;
-  int cores_seen = 0;
-  struct cpu_test ct;
-  gpr_thd_id thd;
-  ct.ncores = gpr_cpu_num_cores();
-  GPR_ASSERT(ct.ncores > 0);
-  ct.nthreads = (int)ct.ncores * 3;
-  ct.used = gpr_malloc(ct.ncores * sizeof(int));
-  memset(ct.used, 0, ct.ncores * sizeof(int));
-  gpr_mu_init(&ct.mu);
-  gpr_cv_init(&ct.done_cv);
-  ct.is_done = 0;
-  for (i = 0; i < ct.ncores * 3; i++) {
-    GPR_ASSERT(gpr_thd_new(&thd, &worker_thread, &ct, NULL));
-  }
-  gpr_mu_lock(&ct.mu);
-  while (!ct.is_done) {
-    gpr_cv_wait(&ct.done_cv, &ct.mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  gpr_mu_unlock(&ct.mu);
-  fprintf(stderr, "Saw cores [");
-  for (i = 0; i < ct.ncores; i++) {
-    if (ct.used[i]) {
-      fprintf(stderr, "%d,", i);
-      cores_seen++;
-    }
-  }
-  fprintf(stderr, "] (%d/%d)\n", cores_seen, ct.ncores);
-  gpr_free(ct.used);
-}
-
-int main(int argc, char *argv[]) {
-  grpc_test_init(argc, argv);
-  cpu_test();
-  return 0;
-}
diff --git a/test/core/support/cpu_test.cc b/test/core/support/cpu_test.cc
new file mode 100644
index 0000000..c69ce55
--- /dev/null
+++ b/test/core/support/cpu_test.cc
@@ -0,0 +1,135 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* Test gpr per-cpu support:
+   gpr_cpu_num_cores()
+   gpr_cpu_current_cpu()
+*/
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/cpu.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <stdio.h>
+#include <string.h>
+#include "test/core/util/test_config.h"
+
+/* Test structure is essentially:
+   1) Figure out how many cores are present on the test system
+   2) Create 3 times that many threads
+   3) Have each thread do some amount of work (basically want to
+      gaurantee that all threads are running at once, and enough of them
+      to run on all cores).
+   4) Each thread checks what core it is running on, and marks that core
+      as "used" in the test.
+   5) Count number of "used" cores.
+
+   The test will fail if:
+   1) gpr_cpu_num_cores() == 0
+   2) Any result from gpr_cpu_current_cpu() >= gpr_cpu_num_cores()
+   3) Ideally, we would fail if not all cores were seen as used. Unfortunately,
+      this is only probabilistically true, and depends on the OS, it's
+      scheduler, etc. So we just print out an indication of how many were seen;
+      hopefully developers can use this to sanity check their system.
+*/
+
+/* Status shared across threads */
+struct cpu_test {
+  gpr_mu mu;
+  int nthreads;
+  uint32_t ncores;
+  int is_done;
+  gpr_cv done_cv;
+  int* used;  /* is this core used? */
+  unsigned r; /* random number */
+};
+
+static void worker_thread(void* arg) {
+  struct cpu_test* ct = (struct cpu_test*)arg;
+  uint32_t cpu;
+  unsigned r = 12345678;
+  unsigned i, j;
+  /* Avoid repetitive division calculations */
+  int64_t max_i = 1000 / grpc_test_slowdown_factor();
+  int64_t max_j = 1000 / grpc_test_slowdown_factor();
+  for (i = 0; i < max_i; i++) {
+    /* run for a bit - just calculate something random. */
+    for (j = 0; j < max_j; j++) {
+      r = (r * 17) & ((r - i) | (r * i));
+    }
+    cpu = gpr_cpu_current_cpu();
+    GPR_ASSERT(cpu < ct->ncores);
+    gpr_mu_lock(&ct->mu);
+    ct->used[cpu] = 1;
+    for (j = 0; j < ct->ncores; j++) {
+      if (!ct->used[j]) break;
+    }
+    gpr_mu_unlock(&ct->mu);
+    if (j == ct->ncores) {
+      break; /* all cpus have been used - no further use in running this test */
+    }
+  }
+  gpr_mu_lock(&ct->mu);
+  ct->r = r; /* make it look like we care about r's value... */
+  ct->nthreads--;
+  if (ct->nthreads == 0) {
+    ct->is_done = 1;
+    gpr_cv_signal(&ct->done_cv);
+  }
+  gpr_mu_unlock(&ct->mu);
+}
+
+static void cpu_test(void) {
+  uint32_t i;
+  int cores_seen = 0;
+  struct cpu_test ct;
+  gpr_thd_id thd;
+  ct.ncores = gpr_cpu_num_cores();
+  GPR_ASSERT(ct.ncores > 0);
+  ct.nthreads = (int)ct.ncores * 3;
+  ct.used = static_cast<int*>(gpr_malloc(ct.ncores * sizeof(int)));
+  memset(ct.used, 0, ct.ncores * sizeof(int));
+  gpr_mu_init(&ct.mu);
+  gpr_cv_init(&ct.done_cv);
+  ct.is_done = 0;
+  for (i = 0; i < ct.ncores * 3; i++) {
+    GPR_ASSERT(gpr_thd_new(&thd, &worker_thread, &ct, NULL));
+  }
+  gpr_mu_lock(&ct.mu);
+  while (!ct.is_done) {
+    gpr_cv_wait(&ct.done_cv, &ct.mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+  }
+  gpr_mu_unlock(&ct.mu);
+  fprintf(stderr, "Saw cores [");
+  for (i = 0; i < ct.ncores; i++) {
+    if (ct.used[i]) {
+      fprintf(stderr, "%d,", i);
+      cores_seen++;
+    }
+  }
+  fprintf(stderr, "] (%d/%d)\n", cores_seen, ct.ncores);
+  gpr_free(ct.used);
+}
+
+int main(int argc, char* argv[]) {
+  grpc_test_init(argc, argv);
+  cpu_test();
+  return 0;
+}
diff --git a/test/core/support/env_test.c b/test/core/support/env_test.c
deleted file mode 100644
index 661a546..0000000
--- a/test/core/support/env_test.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x)
-
-static void test_setenv_getenv(void) {
-  const char *name = "FOO";
-  const char *value = "BAR";
-  char *retrieved_value;
-
-  LOG_TEST_NAME("test_setenv_getenv");
-
-  gpr_setenv(name, value);
-  retrieved_value = gpr_getenv(name);
-  GPR_ASSERT(retrieved_value != NULL);
-  GPR_ASSERT(strcmp(value, retrieved_value) == 0);
-  gpr_free(retrieved_value);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_setenv_getenv();
-  return 0;
-}
diff --git a/test/core/support/env_test.cc b/test/core/support/env_test.cc
new file mode 100644
index 0000000..5400953
--- /dev/null
+++ b/test/core/support/env_test.cc
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x)
+
+static void test_setenv_getenv(void) {
+  const char* name = "FOO";
+  const char* value = "BAR";
+  char* retrieved_value;
+
+  LOG_TEST_NAME("test_setenv_getenv");
+
+  gpr_setenv(name, value);
+  retrieved_value = gpr_getenv(name);
+  GPR_ASSERT(retrieved_value != NULL);
+  GPR_ASSERT(strcmp(value, retrieved_value) == 0);
+  gpr_free(retrieved_value);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_setenv_getenv();
+  return 0;
+}
diff --git a/test/core/support/histogram_test.c b/test/core/support/histogram_test.c
deleted file mode 100644
index 0ee5d5c..0000000
--- a/test/core/support/histogram_test.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/histogram.h>
-#include <grpc/support/log.h>
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x);
-
-static void test_no_op(void) {
-  gpr_histogram_destroy(gpr_histogram_create(0.01, 60e9));
-}
-
-static void expect_percentile(gpr_histogram *h, double percentile,
-                              double min_expect, double max_expect) {
-  double got = gpr_histogram_percentile(h, percentile);
-  gpr_log(GPR_INFO, "@%f%%, expect %f <= %f <= %f", percentile, min_expect, got,
-          max_expect);
-  GPR_ASSERT(min_expect <= got);
-  GPR_ASSERT(got <= max_expect);
-}
-
-static void test_simple(void) {
-  gpr_histogram *h;
-
-  LOG_TEST("test_simple");
-
-  h = gpr_histogram_create(0.01, 60e9);
-  gpr_histogram_add(h, 10000);
-  gpr_histogram_add(h, 10000);
-  gpr_histogram_add(h, 11000);
-  gpr_histogram_add(h, 11000);
-
-  expect_percentile(h, 50, 10001, 10999);
-  GPR_ASSERT(gpr_histogram_mean(h) == 10500);
-
-  gpr_histogram_destroy(h);
-}
-
-static void test_percentile(void) {
-  gpr_histogram *h;
-  double last;
-  double i;
-  double cur;
-
-  LOG_TEST("test_percentile");
-
-  h = gpr_histogram_create(0.05, 1e9);
-  gpr_histogram_add(h, 2.5);
-  gpr_histogram_add(h, 2.5);
-  gpr_histogram_add(h, 8);
-  gpr_histogram_add(h, 4);
-
-  GPR_ASSERT(gpr_histogram_count(h) == 4);
-  GPR_ASSERT(gpr_histogram_minimum(h) == 2.5);
-  GPR_ASSERT(gpr_histogram_maximum(h) == 8);
-  GPR_ASSERT(gpr_histogram_sum(h) == 17);
-  GPR_ASSERT(gpr_histogram_sum_of_squares(h) == 92.5);
-  GPR_ASSERT(gpr_histogram_mean(h) == 4.25);
-  GPR_ASSERT(gpr_histogram_variance(h) == 5.0625);
-  GPR_ASSERT(gpr_histogram_stddev(h) == 2.25);
-
-  expect_percentile(h, -10, 2.5, 2.5);
-  expect_percentile(h, 0, 2.5, 2.5);
-  expect_percentile(h, 12.5, 2.5, 2.5);
-  expect_percentile(h, 25, 2.5, 2.5);
-  expect_percentile(h, 37.5, 2.5, 2.8);
-  expect_percentile(h, 50, 3.0, 3.5);
-  expect_percentile(h, 62.5, 3.5, 4.5);
-  expect_percentile(h, 75, 5, 7.9);
-  expect_percentile(h, 100, 8, 8);
-  expect_percentile(h, 110, 8, 8);
-
-  /* test monotonicity */
-  last = 0.0;
-  for (i = 0; i < 100.0; i += 0.01) {
-    cur = gpr_histogram_percentile(h, i);
-    GPR_ASSERT(cur >= last);
-    last = cur;
-  }
-
-  gpr_histogram_destroy(h);
-}
-
-static void test_merge(void) {
-  gpr_histogram *h1, *h2;
-  double last;
-  double i;
-  double cur;
-
-  LOG_TEST("test_merge");
-
-  h1 = gpr_histogram_create(0.05, 1e9);
-  gpr_histogram_add(h1, 2.5);
-  gpr_histogram_add(h1, 2.5);
-  gpr_histogram_add(h1, 8);
-  gpr_histogram_add(h1, 4);
-
-  h2 = gpr_histogram_create(0.01, 1e9);
-  GPR_ASSERT(gpr_histogram_merge(h1, h2) == 0);
-  gpr_histogram_destroy(h2);
-
-  h2 = gpr_histogram_create(0.05, 1e10);
-  GPR_ASSERT(gpr_histogram_merge(h1, h2) == 0);
-  gpr_histogram_destroy(h2);
-
-  h2 = gpr_histogram_create(0.05, 1e9);
-  GPR_ASSERT(gpr_histogram_merge(h1, h2) == 1);
-  GPR_ASSERT(gpr_histogram_count(h1) == 4);
-  GPR_ASSERT(gpr_histogram_minimum(h1) == 2.5);
-  GPR_ASSERT(gpr_histogram_maximum(h1) == 8);
-  GPR_ASSERT(gpr_histogram_sum(h1) == 17);
-  GPR_ASSERT(gpr_histogram_sum_of_squares(h1) == 92.5);
-  GPR_ASSERT(gpr_histogram_mean(h1) == 4.25);
-  GPR_ASSERT(gpr_histogram_variance(h1) == 5.0625);
-  GPR_ASSERT(gpr_histogram_stddev(h1) == 2.25);
-  gpr_histogram_destroy(h2);
-
-  h2 = gpr_histogram_create(0.05, 1e9);
-  gpr_histogram_add(h2, 7.0);
-  gpr_histogram_add(h2, 17.0);
-  gpr_histogram_add(h2, 1.0);
-  GPR_ASSERT(gpr_histogram_merge(h1, h2) == 1);
-  GPR_ASSERT(gpr_histogram_count(h1) == 7);
-  GPR_ASSERT(gpr_histogram_minimum(h1) == 1.0);
-  GPR_ASSERT(gpr_histogram_maximum(h1) == 17.0);
-  GPR_ASSERT(gpr_histogram_sum(h1) == 42.0);
-  GPR_ASSERT(gpr_histogram_sum_of_squares(h1) == 431.5);
-  GPR_ASSERT(gpr_histogram_mean(h1) == 6.0);
-
-  /* test monotonicity */
-  last = 0.0;
-  for (i = 0; i < 100.0; i += 0.01) {
-    cur = gpr_histogram_percentile(h1, i);
-    GPR_ASSERT(cur >= last);
-    last = cur;
-  }
-
-  gpr_histogram_destroy(h1);
-  gpr_histogram_destroy(h2);
-}
-
-int main(void) {
-  test_no_op();
-  test_simple();
-  test_percentile();
-  test_merge();
-  return 0;
-}
diff --git a/test/core/support/histogram_test.cc b/test/core/support/histogram_test.cc
new file mode 100644
index 0000000..86b7d59
--- /dev/null
+++ b/test/core/support/histogram_test.cc
@@ -0,0 +1,163 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/histogram.h>
+#include <grpc/support/log.h>
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x);
+
+static void test_no_op(void) {
+  gpr_histogram_destroy(gpr_histogram_create(0.01, 60e9));
+}
+
+static void expect_percentile(gpr_histogram* h, double percentile,
+                              double min_expect, double max_expect) {
+  double got = gpr_histogram_percentile(h, percentile);
+  gpr_log(GPR_INFO, "@%f%%, expect %f <= %f <= %f", percentile, min_expect, got,
+          max_expect);
+  GPR_ASSERT(min_expect <= got);
+  GPR_ASSERT(got <= max_expect);
+}
+
+static void test_simple(void) {
+  gpr_histogram* h;
+
+  LOG_TEST("test_simple");
+
+  h = gpr_histogram_create(0.01, 60e9);
+  gpr_histogram_add(h, 10000);
+  gpr_histogram_add(h, 10000);
+  gpr_histogram_add(h, 11000);
+  gpr_histogram_add(h, 11000);
+
+  expect_percentile(h, 50, 10001, 10999);
+  GPR_ASSERT(gpr_histogram_mean(h) == 10500);
+
+  gpr_histogram_destroy(h);
+}
+
+static void test_percentile(void) {
+  gpr_histogram* h;
+  double last;
+  double i;
+  double cur;
+
+  LOG_TEST("test_percentile");
+
+  h = gpr_histogram_create(0.05, 1e9);
+  gpr_histogram_add(h, 2.5);
+  gpr_histogram_add(h, 2.5);
+  gpr_histogram_add(h, 8);
+  gpr_histogram_add(h, 4);
+
+  GPR_ASSERT(gpr_histogram_count(h) == 4);
+  GPR_ASSERT(gpr_histogram_minimum(h) == 2.5);
+  GPR_ASSERT(gpr_histogram_maximum(h) == 8);
+  GPR_ASSERT(gpr_histogram_sum(h) == 17);
+  GPR_ASSERT(gpr_histogram_sum_of_squares(h) == 92.5);
+  GPR_ASSERT(gpr_histogram_mean(h) == 4.25);
+  GPR_ASSERT(gpr_histogram_variance(h) == 5.0625);
+  GPR_ASSERT(gpr_histogram_stddev(h) == 2.25);
+
+  expect_percentile(h, -10, 2.5, 2.5);
+  expect_percentile(h, 0, 2.5, 2.5);
+  expect_percentile(h, 12.5, 2.5, 2.5);
+  expect_percentile(h, 25, 2.5, 2.5);
+  expect_percentile(h, 37.5, 2.5, 2.8);
+  expect_percentile(h, 50, 3.0, 3.5);
+  expect_percentile(h, 62.5, 3.5, 4.5);
+  expect_percentile(h, 75, 5, 7.9);
+  expect_percentile(h, 100, 8, 8);
+  expect_percentile(h, 110, 8, 8);
+
+  /* test monotonicity */
+  last = 0.0;
+  for (i = 0; i < 100.0; i += 0.01) {
+    cur = gpr_histogram_percentile(h, i);
+    GPR_ASSERT(cur >= last);
+    last = cur;
+  }
+
+  gpr_histogram_destroy(h);
+}
+
+static void test_merge(void) {
+  gpr_histogram *h1, *h2;
+  double last;
+  double i;
+  double cur;
+
+  LOG_TEST("test_merge");
+
+  h1 = gpr_histogram_create(0.05, 1e9);
+  gpr_histogram_add(h1, 2.5);
+  gpr_histogram_add(h1, 2.5);
+  gpr_histogram_add(h1, 8);
+  gpr_histogram_add(h1, 4);
+
+  h2 = gpr_histogram_create(0.01, 1e9);
+  GPR_ASSERT(gpr_histogram_merge(h1, h2) == 0);
+  gpr_histogram_destroy(h2);
+
+  h2 = gpr_histogram_create(0.05, 1e10);
+  GPR_ASSERT(gpr_histogram_merge(h1, h2) == 0);
+  gpr_histogram_destroy(h2);
+
+  h2 = gpr_histogram_create(0.05, 1e9);
+  GPR_ASSERT(gpr_histogram_merge(h1, h2) == 1);
+  GPR_ASSERT(gpr_histogram_count(h1) == 4);
+  GPR_ASSERT(gpr_histogram_minimum(h1) == 2.5);
+  GPR_ASSERT(gpr_histogram_maximum(h1) == 8);
+  GPR_ASSERT(gpr_histogram_sum(h1) == 17);
+  GPR_ASSERT(gpr_histogram_sum_of_squares(h1) == 92.5);
+  GPR_ASSERT(gpr_histogram_mean(h1) == 4.25);
+  GPR_ASSERT(gpr_histogram_variance(h1) == 5.0625);
+  GPR_ASSERT(gpr_histogram_stddev(h1) == 2.25);
+  gpr_histogram_destroy(h2);
+
+  h2 = gpr_histogram_create(0.05, 1e9);
+  gpr_histogram_add(h2, 7.0);
+  gpr_histogram_add(h2, 17.0);
+  gpr_histogram_add(h2, 1.0);
+  GPR_ASSERT(gpr_histogram_merge(h1, h2) == 1);
+  GPR_ASSERT(gpr_histogram_count(h1) == 7);
+  GPR_ASSERT(gpr_histogram_minimum(h1) == 1.0);
+  GPR_ASSERT(gpr_histogram_maximum(h1) == 17.0);
+  GPR_ASSERT(gpr_histogram_sum(h1) == 42.0);
+  GPR_ASSERT(gpr_histogram_sum_of_squares(h1) == 431.5);
+  GPR_ASSERT(gpr_histogram_mean(h1) == 6.0);
+
+  /* test monotonicity */
+  last = 0.0;
+  for (i = 0; i < 100.0; i += 0.01) {
+    cur = gpr_histogram_percentile(h1, i);
+    GPR_ASSERT(cur >= last);
+    last = cur;
+  }
+
+  gpr_histogram_destroy(h1);
+  gpr_histogram_destroy(h2);
+}
+
+int main(void) {
+  test_no_op();
+  test_simple();
+  test_percentile();
+  test_merge();
+  return 0;
+}
diff --git a/test/core/support/host_port_test.c b/test/core/support/host_port_test.c
deleted file mode 100644
index 2ff3bcf..0000000
--- a/test/core/support/host_port_test.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include "test/core/util/test_config.h"
-
-static void join_host_port_expect(const char *host, int port,
-                                  const char *expected) {
-  char *buf;
-  int len;
-  len = gpr_join_host_port(&buf, host, port);
-  GPR_ASSERT(len >= 0);
-  GPR_ASSERT(strlen(expected) == (size_t)len);
-  GPR_ASSERT(strcmp(expected, buf) == 0);
-  gpr_free(buf);
-}
-
-static void test_join_host_port(void) {
-  join_host_port_expect("foo", 101, "foo:101");
-  join_host_port_expect("", 102, ":102");
-  join_host_port_expect("1::2", 103, "[1::2]:103");
-  join_host_port_expect("[::1]", 104, "[::1]:104");
-}
-
-/* Garbage in, garbage out. */
-static void test_join_host_port_garbage(void) {
-  join_host_port_expect("[foo]", 105, "[foo]:105");
-  join_host_port_expect("[::", 106, "[:::106");
-  join_host_port_expect("::]", 107, "[::]]:107");
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  test_join_host_port();
-  test_join_host_port_garbage();
-
-  return 0;
-}
diff --git a/test/core/support/host_port_test.cc b/test/core/support/host_port_test.cc
new file mode 100644
index 0000000..42dd565
--- /dev/null
+++ b/test/core/support/host_port_test.cc
@@ -0,0 +1,58 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include "test/core/util/test_config.h"
+
+static void join_host_port_expect(const char* host, int port,
+                                  const char* expected) {
+  char* buf;
+  int len;
+  len = gpr_join_host_port(&buf, host, port);
+  GPR_ASSERT(len >= 0);
+  GPR_ASSERT(strlen(expected) == (size_t)len);
+  GPR_ASSERT(strcmp(expected, buf) == 0);
+  gpr_free(buf);
+}
+
+static void test_join_host_port(void) {
+  join_host_port_expect("foo", 101, "foo:101");
+  join_host_port_expect("", 102, ":102");
+  join_host_port_expect("1::2", 103, "[1::2]:103");
+  join_host_port_expect("[::1]", 104, "[::1]:104");
+}
+
+/* Garbage in, garbage out. */
+static void test_join_host_port_garbage(void) {
+  join_host_port_expect("[foo]", 105, "[foo]:105");
+  join_host_port_expect("[::", 106, "[:::106");
+  join_host_port_expect("::]", 107, "[::]]:107");
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  test_join_host_port();
+  test_join_host_port_garbage();
+
+  return 0;
+}
diff --git a/test/core/support/log_test.c b/test/core/support/log_test.c
deleted file mode 100644
index c221ff6..0000000
--- a/test/core/support/log_test.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/log.h>
-
-#include <stdbool.h>
-#include <string.h>
-
-#include "src/core/lib/support/env.h"
-#include "test/core/util/test_config.h"
-
-static bool log_func_reached = false;
-
-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"));
-}
-
-static void test_should_log(gpr_log_func_args *args) {
-  log_func_reached = true;
-}
-
-static void test_should_not_log(gpr_log_func_args *args) { GPR_ASSERT(false); }
-
-#define test_log_function_reached(SEVERITY)     \
-  gpr_set_log_function(test_should_log);        \
-  log_func_reached = false;                     \
-  gpr_log_message(SEVERITY, "hello 1 2 3");     \
-  GPR_ASSERT(log_func_reached);                 \
-  log_func_reached = false;                     \
-  gpr_log(SEVERITY, "hello %d %d %d", 1, 2, 3); \
-  GPR_ASSERT(log_func_reached);
-
-#define test_log_function_unreached(SEVERITY) \
-  gpr_set_log_function(test_should_not_log);  \
-  gpr_log_message(SEVERITY, "hello 1 2 3");   \
-  gpr_log(SEVERITY, "hello %d %d %d", 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);
-  gpr_set_log_function(NULL);
-
-  /* gpr_log_verbosity_init() will be effective only once, and only before
-   * gpr_set_log_verbosity() is called */
-  gpr_setenv("GRPC_VERBOSITY", "ERROR");
-  gpr_log_verbosity_init();
-
-  test_log_function_reached(GPR_ERROR);
-  test_log_function_unreached(GPR_INFO);
-  test_log_function_unreached(GPR_DEBUG);
-
-  /* gpr_log_verbosity_init() should not be effective */
-  gpr_setenv("GRPC_VERBOSITY", "DEBUG");
-  gpr_log_verbosity_init();
-  test_log_function_reached(GPR_ERROR);
-  test_log_function_unreached(GPR_INFO);
-  test_log_function_unreached(GPR_DEBUG);
-
-  gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
-  test_log_function_reached(GPR_ERROR);
-  test_log_function_reached(GPR_INFO);
-  test_log_function_reached(GPR_DEBUG);
-
-  gpr_set_log_verbosity(GPR_LOG_SEVERITY_INFO);
-  test_log_function_reached(GPR_ERROR);
-  test_log_function_reached(GPR_INFO);
-  test_log_function_unreached(GPR_DEBUG);
-
-  gpr_set_log_verbosity(GPR_LOG_SEVERITY_ERROR);
-  test_log_function_reached(GPR_ERROR);
-  test_log_function_unreached(GPR_INFO);
-  test_log_function_unreached(GPR_DEBUG);
-
-  /* gpr_log_verbosity_init() should not be effective */
-  gpr_setenv("GRPC_VERBOSITY", "DEBUG");
-  gpr_log_verbosity_init();
-  test_log_function_reached(GPR_ERROR);
-  test_log_function_unreached(GPR_INFO);
-  test_log_function_unreached(GPR_DEBUG);
-
-  /* TODO(ctiller): should we add a GPR_ASSERT failure test here */
-  return 0;
-}
diff --git a/test/core/support/log_test.cc b/test/core/support/log_test.cc
new file mode 100644
index 0000000..9602bbb
--- /dev/null
+++ b/test/core/support/log_test.cc
@@ -0,0 +1,108 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/log.h>
+
+#include <stdbool.h>
+#include <string.h>
+
+#include "src/core/lib/support/env.h"
+#include "test/core/util/test_config.h"
+
+static bool log_func_reached = false;
+
+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"));
+}
+
+static void test_should_log(gpr_log_func_args* args) {
+  log_func_reached = true;
+}
+
+static void test_should_not_log(gpr_log_func_args* args) { GPR_ASSERT(false); }
+
+#define test_log_function_reached(SEVERITY)     \
+  gpr_set_log_function(test_should_log);        \
+  log_func_reached = false;                     \
+  gpr_log_message(SEVERITY, "hello 1 2 3");     \
+  GPR_ASSERT(log_func_reached);                 \
+  log_func_reached = false;                     \
+  gpr_log(SEVERITY, "hello %d %d %d", 1, 2, 3); \
+  GPR_ASSERT(log_func_reached);
+
+#define test_log_function_unreached(SEVERITY) \
+  gpr_set_log_function(test_should_not_log);  \
+  gpr_log_message(SEVERITY, "hello 1 2 3");   \
+  gpr_log(SEVERITY, "hello %d %d %d", 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);
+  gpr_set_log_function(NULL);
+
+  /* gpr_log_verbosity_init() will be effective only once, and only before
+   * gpr_set_log_verbosity() is called */
+  gpr_setenv("GRPC_VERBOSITY", "ERROR");
+  gpr_log_verbosity_init();
+
+  test_log_function_reached(GPR_ERROR);
+  test_log_function_unreached(GPR_INFO);
+  test_log_function_unreached(GPR_DEBUG);
+
+  /* gpr_log_verbosity_init() should not be effective */
+  gpr_setenv("GRPC_VERBOSITY", "DEBUG");
+  gpr_log_verbosity_init();
+  test_log_function_reached(GPR_ERROR);
+  test_log_function_unreached(GPR_INFO);
+  test_log_function_unreached(GPR_DEBUG);
+
+  gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
+  test_log_function_reached(GPR_ERROR);
+  test_log_function_reached(GPR_INFO);
+  test_log_function_reached(GPR_DEBUG);
+
+  gpr_set_log_verbosity(GPR_LOG_SEVERITY_INFO);
+  test_log_function_reached(GPR_ERROR);
+  test_log_function_reached(GPR_INFO);
+  test_log_function_unreached(GPR_DEBUG);
+
+  gpr_set_log_verbosity(GPR_LOG_SEVERITY_ERROR);
+  test_log_function_reached(GPR_ERROR);
+  test_log_function_unreached(GPR_INFO);
+  test_log_function_unreached(GPR_DEBUG);
+
+  /* gpr_log_verbosity_init() should not be effective */
+  gpr_setenv("GRPC_VERBOSITY", "DEBUG");
+  gpr_log_verbosity_init();
+  test_log_function_reached(GPR_ERROR);
+  test_log_function_unreached(GPR_INFO);
+  test_log_function_unreached(GPR_DEBUG);
+
+  /* TODO(ctiller): should we add a GPR_ASSERT failure test here */
+  return 0;
+}
diff --git a/test/core/support/mpscq_test.c b/test/core/support/mpscq_test.c
deleted file mode 100644
index 5e7dc9f..0000000
--- a/test/core/support/mpscq_test.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/support/mpscq.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/useful.h>
-#include "test/core/util/test_config.h"
-
-typedef struct test_node {
-  gpr_mpscq_node node;
-  size_t i;
-  size_t *ctr;
-} test_node;
-
-static test_node *new_node(size_t i, size_t *ctr) {
-  test_node *n = gpr_malloc(sizeof(test_node));
-  n->i = i;
-  n->ctr = ctr;
-  return n;
-}
-
-static void test_serial(void) {
-  gpr_log(GPR_DEBUG, "test_serial");
-  gpr_mpscq q;
-  gpr_mpscq_init(&q);
-  for (size_t i = 0; i < 10000000; i++) {
-    gpr_mpscq_push(&q, &new_node(i, NULL)->node);
-  }
-  for (size_t i = 0; i < 10000000; i++) {
-    test_node *n = (test_node *)gpr_mpscq_pop(&q);
-    GPR_ASSERT(n);
-    GPR_ASSERT(n->i == i);
-    gpr_free(n);
-  }
-}
-
-typedef struct {
-  size_t ctr;
-  gpr_mpscq *q;
-  gpr_event *start;
-} thd_args;
-
-#define THREAD_ITERATIONS 10000
-
-static void test_thread(void *args) {
-  thd_args *a = args;
-  gpr_event_wait(a->start, gpr_inf_future(GPR_CLOCK_REALTIME));
-  for (size_t i = 1; i <= THREAD_ITERATIONS; i++) {
-    gpr_mpscq_push(a->q, &new_node(i, &a->ctr)->node);
-  }
-}
-
-static void test_mt(void) {
-  gpr_log(GPR_DEBUG, "test_mt");
-  gpr_event start;
-  gpr_event_init(&start);
-  gpr_thd_id thds[100];
-  thd_args ta[GPR_ARRAY_SIZE(thds)];
-  gpr_mpscq q;
-  gpr_mpscq_init(&q);
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
-    gpr_thd_options options = gpr_thd_options_default();
-    gpr_thd_options_set_joinable(&options);
-    ta[i].ctr = 0;
-    ta[i].q = &q;
-    ta[i].start = &start;
-    GPR_ASSERT(gpr_thd_new(&thds[i], test_thread, &ta[i], &options));
-  }
-  size_t num_done = 0;
-  size_t spins = 0;
-  gpr_event_set(&start, (void *)1);
-  while (num_done != GPR_ARRAY_SIZE(thds)) {
-    gpr_mpscq_node *n;
-    while ((n = gpr_mpscq_pop(&q)) == NULL) {
-      spins++;
-    }
-    test_node *tn = (test_node *)n;
-    GPR_ASSERT(*tn->ctr == tn->i - 1);
-    *tn->ctr = tn->i;
-    if (tn->i == THREAD_ITERATIONS) num_done++;
-    gpr_free(tn);
-  }
-  gpr_log(GPR_DEBUG, "spins: %" PRIdPTR, spins);
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
-    gpr_thd_join(thds[i]);
-  }
-  gpr_mpscq_destroy(&q);
-}
-
-typedef struct {
-  thd_args *ta;
-  size_t num_thds;
-  gpr_mu mu;
-  size_t num_done;
-  size_t spins;
-  gpr_mpscq *q;
-  gpr_event *start;
-} pull_args;
-
-static void pull_thread(void *arg) {
-  pull_args *pa = arg;
-  gpr_event_wait(pa->start, gpr_inf_future(GPR_CLOCK_REALTIME));
-
-  for (;;) {
-    gpr_mu_lock(&pa->mu);
-    if (pa->num_done == pa->num_thds) {
-      gpr_mu_unlock(&pa->mu);
-      return;
-    }
-    gpr_mpscq_node *n;
-    while ((n = gpr_mpscq_pop(pa->q)) == NULL) {
-      pa->spins++;
-    }
-    test_node *tn = (test_node *)n;
-    GPR_ASSERT(*tn->ctr == tn->i - 1);
-    *tn->ctr = tn->i;
-    if (tn->i == THREAD_ITERATIONS) pa->num_done++;
-    gpr_free(tn);
-    gpr_mu_unlock(&pa->mu);
-  }
-}
-
-static void test_mt_multipop(void) {
-  gpr_log(GPR_DEBUG, "test_mt_multipop");
-  gpr_event start;
-  gpr_event_init(&start);
-  gpr_thd_id thds[100];
-  gpr_thd_id pull_thds[100];
-  thd_args ta[GPR_ARRAY_SIZE(thds)];
-  gpr_mpscq q;
-  gpr_mpscq_init(&q);
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
-    gpr_thd_options options = gpr_thd_options_default();
-    gpr_thd_options_set_joinable(&options);
-    ta[i].ctr = 0;
-    ta[i].q = &q;
-    ta[i].start = &start;
-    GPR_ASSERT(gpr_thd_new(&thds[i], test_thread, &ta[i], &options));
-  }
-  pull_args pa;
-  pa.ta = ta;
-  pa.num_thds = GPR_ARRAY_SIZE(thds);
-  pa.spins = 0;
-  pa.num_done = 0;
-  pa.q = &q;
-  pa.start = &start;
-  gpr_mu_init(&pa.mu);
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(pull_thds); i++) {
-    gpr_thd_options options = gpr_thd_options_default();
-    gpr_thd_options_set_joinable(&options);
-    GPR_ASSERT(gpr_thd_new(&pull_thds[i], pull_thread, &pa, &options));
-  }
-  gpr_event_set(&start, (void *)1);
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(pull_thds); i++) {
-    gpr_thd_join(pull_thds[i]);
-  }
-  gpr_log(GPR_DEBUG, "spins: %" PRIdPTR, pa.spins);
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
-    gpr_thd_join(thds[i]);
-  }
-  gpr_mpscq_destroy(&q);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_serial();
-  test_mt();
-  test_mt_multipop();
-  return 0;
-}
diff --git a/test/core/support/mpscq_test.cc b/test/core/support/mpscq_test.cc
new file mode 100644
index 0000000..d5b7bf2
--- /dev/null
+++ b/test/core/support/mpscq_test.cc
@@ -0,0 +1,191 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/support/mpscq.h"
+
+#include <stdlib.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/test_config.h"
+
+typedef struct test_node {
+  gpr_mpscq_node node;
+  size_t i;
+  size_t* ctr;
+} test_node;
+
+static test_node* new_node(size_t i, size_t* ctr) {
+  test_node* n = static_cast<test_node*>(gpr_malloc(sizeof(test_node)));
+  n->i = i;
+  n->ctr = ctr;
+  return n;
+}
+
+static void test_serial(void) {
+  gpr_log(GPR_DEBUG, "test_serial");
+  gpr_mpscq q;
+  gpr_mpscq_init(&q);
+  for (size_t i = 0; i < 10000000; i++) {
+    gpr_mpscq_push(&q, &new_node(i, NULL)->node);
+  }
+  for (size_t i = 0; i < 10000000; i++) {
+    test_node* n = (test_node*)gpr_mpscq_pop(&q);
+    GPR_ASSERT(n);
+    GPR_ASSERT(n->i == i);
+    gpr_free(n);
+  }
+}
+
+typedef struct {
+  size_t ctr;
+  gpr_mpscq* q;
+  gpr_event* start;
+} thd_args;
+
+#define THREAD_ITERATIONS 10000
+
+static void test_thread(void* args) {
+  thd_args* a = static_cast<thd_args*>(args);
+  gpr_event_wait(a->start, gpr_inf_future(GPR_CLOCK_REALTIME));
+  for (size_t i = 1; i <= THREAD_ITERATIONS; i++) {
+    gpr_mpscq_push(a->q, &new_node(i, &a->ctr)->node);
+  }
+}
+
+static void test_mt(void) {
+  gpr_log(GPR_DEBUG, "test_mt");
+  gpr_event start;
+  gpr_event_init(&start);
+  gpr_thd_id thds[100];
+  thd_args ta[GPR_ARRAY_SIZE(thds)];
+  gpr_mpscq q;
+  gpr_mpscq_init(&q);
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
+    gpr_thd_options options = gpr_thd_options_default();
+    gpr_thd_options_set_joinable(&options);
+    ta[i].ctr = 0;
+    ta[i].q = &q;
+    ta[i].start = &start;
+    GPR_ASSERT(gpr_thd_new(&thds[i], test_thread, &ta[i], &options));
+  }
+  size_t num_done = 0;
+  size_t spins = 0;
+  gpr_event_set(&start, (void*)1);
+  while (num_done != GPR_ARRAY_SIZE(thds)) {
+    gpr_mpscq_node* n;
+    while ((n = gpr_mpscq_pop(&q)) == NULL) {
+      spins++;
+    }
+    test_node* tn = (test_node*)n;
+    GPR_ASSERT(*tn->ctr == tn->i - 1);
+    *tn->ctr = tn->i;
+    if (tn->i == THREAD_ITERATIONS) num_done++;
+    gpr_free(tn);
+  }
+  gpr_log(GPR_DEBUG, "spins: %" PRIdPTR, spins);
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
+    gpr_thd_join(thds[i]);
+  }
+  gpr_mpscq_destroy(&q);
+}
+
+typedef struct {
+  thd_args* ta;
+  size_t num_thds;
+  gpr_mu mu;
+  size_t num_done;
+  size_t spins;
+  gpr_mpscq* q;
+  gpr_event* start;
+} pull_args;
+
+static void pull_thread(void* arg) {
+  pull_args* pa = static_cast<pull_args*>(arg);
+  gpr_event_wait(pa->start, gpr_inf_future(GPR_CLOCK_REALTIME));
+
+  for (;;) {
+    gpr_mu_lock(&pa->mu);
+    if (pa->num_done == pa->num_thds) {
+      gpr_mu_unlock(&pa->mu);
+      return;
+    }
+    gpr_mpscq_node* n;
+    while ((n = gpr_mpscq_pop(pa->q)) == NULL) {
+      pa->spins++;
+    }
+    test_node* tn = (test_node*)n;
+    GPR_ASSERT(*tn->ctr == tn->i - 1);
+    *tn->ctr = tn->i;
+    if (tn->i == THREAD_ITERATIONS) pa->num_done++;
+    gpr_free(tn);
+    gpr_mu_unlock(&pa->mu);
+  }
+}
+
+static void test_mt_multipop(void) {
+  gpr_log(GPR_DEBUG, "test_mt_multipop");
+  gpr_event start;
+  gpr_event_init(&start);
+  gpr_thd_id thds[100];
+  gpr_thd_id pull_thds[100];
+  thd_args ta[GPR_ARRAY_SIZE(thds)];
+  gpr_mpscq q;
+  gpr_mpscq_init(&q);
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
+    gpr_thd_options options = gpr_thd_options_default();
+    gpr_thd_options_set_joinable(&options);
+    ta[i].ctr = 0;
+    ta[i].q = &q;
+    ta[i].start = &start;
+    GPR_ASSERT(gpr_thd_new(&thds[i], test_thread, &ta[i], &options));
+  }
+  pull_args pa;
+  pa.ta = ta;
+  pa.num_thds = GPR_ARRAY_SIZE(thds);
+  pa.spins = 0;
+  pa.num_done = 0;
+  pa.q = &q;
+  pa.start = &start;
+  gpr_mu_init(&pa.mu);
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(pull_thds); i++) {
+    gpr_thd_options options = gpr_thd_options_default();
+    gpr_thd_options_set_joinable(&options);
+    GPR_ASSERT(gpr_thd_new(&pull_thds[i], pull_thread, &pa, &options));
+  }
+  gpr_event_set(&start, (void*)1);
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(pull_thds); i++) {
+    gpr_thd_join(pull_thds[i]);
+  }
+  gpr_log(GPR_DEBUG, "spins: %" PRIdPTR, pa.spins);
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) {
+    gpr_thd_join(thds[i]);
+  }
+  gpr_mpscq_destroy(&q);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_serial();
+  test_mt();
+  test_mt_multipop();
+  return 0;
+}
diff --git a/test/core/support/murmur_hash_test.c b/test/core/support/murmur_hash_test.c
deleted file mode 100644
index 5677515..0000000
--- a/test/core/support/murmur_hash_test.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/support/murmur_hash.h"
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include "test/core/util/test_config.h"
-
-#include <string.h>
-
-typedef uint32_t (*hash_func)(const void *key, size_t len, uint32_t seed);
-
-/* From smhasher:
-   This should hopefully be a thorough and uambiguous test of whether a hash
-   is correctly implemented on a given platform */
-
-static void verification_test(hash_func hash, uint32_t expected) {
-  uint8_t key[256];
-  uint32_t hashes[256];
-  uint32_t final = 0;
-  size_t i;
-
-  memset(key, 0, sizeof(key));
-  memset(hashes, 0, sizeof(hashes));
-
-  /* Hash keys of the form {0}, {0,1}, {0,1,2}... up to N=255,using 256-N as
-     the seed */
-
-  for (i = 0; i < 256; i++) {
-    key[i] = (uint8_t)i;
-    hashes[i] = hash(key, i, (uint32_t)(256u - i));
-  }
-
-  /* Then hash the result array */
-
-  final = hash(hashes, sizeof(hashes), 0);
-
-  /* The first four bytes of that hash, interpreted as a little-endian integer,
-     is our
-     verification value */
-
-  if (expected != final) {
-    gpr_log(GPR_INFO, "Verification value 0x%08X : Failed! (Expected 0x%08x)",
-            final, expected);
-    abort();
-  } else {
-    gpr_log(GPR_INFO, "Verification value 0x%08X : Passed!", final);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  /* basic tests to verify that things don't crash */
-  gpr_murmur_hash3("", 0, 0);
-  gpr_murmur_hash3("xyz", 3, 0);
-  verification_test(gpr_murmur_hash3, 0xB0F57EE3);
-  return 0;
-}
diff --git a/test/core/support/murmur_hash_test.cc b/test/core/support/murmur_hash_test.cc
new file mode 100644
index 0000000..461c728
--- /dev/null
+++ b/test/core/support/murmur_hash_test.cc
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/support/murmur_hash.h"
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include "test/core/util/test_config.h"
+
+#include <string.h>
+
+typedef uint32_t (*hash_func)(const void* key, size_t len, uint32_t seed);
+
+/* From smhasher:
+   This should hopefully be a thorough and uambiguous test of whether a hash
+   is correctly implemented on a given platform */
+
+static void verification_test(hash_func hash, uint32_t expected) {
+  uint8_t key[256];
+  uint32_t hashes[256];
+  uint32_t final = 0;
+  size_t i;
+
+  memset(key, 0, sizeof(key));
+  memset(hashes, 0, sizeof(hashes));
+
+  /* Hash keys of the form {0}, {0,1}, {0,1,2}... up to N=255,using 256-N as
+     the seed */
+
+  for (i = 0; i < 256; i++) {
+    key[i] = (uint8_t)i;
+    hashes[i] = hash(key, i, (uint32_t)(256u - i));
+  }
+
+  /* Then hash the result array */
+
+  final = hash(hashes, sizeof(hashes), 0);
+
+  /* The first four bytes of that hash, interpreted as a little-endian integer,
+     is our
+     verification value */
+
+  if (expected != final) {
+    gpr_log(GPR_INFO, "Verification value 0x%08X : Failed! (Expected 0x%08x)",
+            final, expected);
+    abort();
+  } else {
+    gpr_log(GPR_INFO, "Verification value 0x%08X : Passed!", final);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  /* basic tests to verify that things don't crash */
+  gpr_murmur_hash3("", 0, 0);
+  gpr_murmur_hash3("xyz", 3, 0);
+  verification_test(gpr_murmur_hash3, 0xB0F57EE3);
+  return 0;
+}
diff --git a/test/core/support/spinlock_test.c b/test/core/support/spinlock_test.c
deleted file mode 100644
index b236a88..0000000
--- a/test/core/support/spinlock_test.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* Test of gpr synchronization support. */
-
-#include "src/core/lib/support/spinlock.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "test/core/util/test_config.h"
-
-/* ------------------------------------------------- */
-/* Tests for gpr_spinlock. */
-struct test {
-  int thread_count; /* number of threads */
-  gpr_thd_id *threads;
-
-  int64_t iterations; /* number of iterations per thread */
-  int64_t counter;
-  int incr_step; /* how much to increment/decrement refcount each time */
-
-  gpr_spinlock mu; /* protects iterations, counter */
-};
-
-/* Return pointer to a new struct test. */
-static struct test *test_new(int threads, int64_t iterations, int incr_step) {
-  struct test *m = gpr_malloc(sizeof(*m));
-  m->thread_count = threads;
-  m->threads = gpr_malloc(sizeof(*m->threads) * (size_t)threads);
-  m->iterations = iterations;
-  m->counter = 0;
-  m->thread_count = 0;
-  m->incr_step = incr_step;
-  m->mu = GPR_SPINLOCK_INITIALIZER;
-  return m;
-}
-
-/* Return pointer to a new struct test. */
-static void test_destroy(struct test *m) {
-  gpr_free(m->threads);
-  gpr_free(m);
-}
-
-/* Create m->threads threads, each running (*body)(m) */
-static void test_create_threads(struct test *m, void (*body)(void *arg)) {
-  int i;
-  for (i = 0; i != m->thread_count; i++) {
-    gpr_thd_options opt = gpr_thd_options_default();
-    gpr_thd_options_set_joinable(&opt);
-    GPR_ASSERT(gpr_thd_new(&m->threads[i], body, m, &opt));
-  }
-}
-
-/* Wait until all threads report done. */
-static void test_wait(struct test *m) {
-  int i;
-  for (i = 0; i != m->thread_count; i++) {
-    gpr_thd_join(m->threads[i]);
-  }
-}
-
-/* Test several threads running (*body)(struct test *m) for increasing settings
-   of m->iterations, until about timeout_s to 2*timeout_s seconds have elapsed.
-   If extra!=NULL, run (*extra)(m) in an additional thread.
-   incr_step controls by how much m->refcount should be incremented/decremented
-   (if at all) each time in the tests.
-   */
-static void test(const char *name, void (*body)(void *m), int timeout_s,
-                 int incr_step) {
-  int64_t iterations = 1024;
-  struct test *m;
-  gpr_timespec start = gpr_now(GPR_CLOCK_REALTIME);
-  gpr_timespec time_taken;
-  gpr_timespec deadline = gpr_time_add(
-      start, gpr_time_from_micros((int64_t)timeout_s * 1000000, GPR_TIMESPAN));
-  fprintf(stderr, "%s:", name);
-  while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0) {
-    if (iterations < INT64_MAX / 2) iterations <<= 1;
-    fprintf(stderr, " %ld", (long)iterations);
-    m = test_new(10, iterations, incr_step);
-    test_create_threads(m, body);
-    test_wait(m);
-    if (m->counter != m->thread_count * m->iterations * m->incr_step) {
-      fprintf(stderr, "counter %ld  threads %d  iterations %ld\n",
-              (long)m->counter, m->thread_count, (long)m->iterations);
-      GPR_ASSERT(0);
-    }
-    test_destroy(m);
-  }
-  time_taken = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start);
-  fprintf(stderr, " done %lld.%09d s\n", (long long)time_taken.tv_sec,
-          (int)time_taken.tv_nsec);
-}
-
-/* Increment m->counter on each iteration; then mark thread as done.  */
-static void inc(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  for (i = 0; i != m->iterations; i++) {
-    gpr_spinlock_lock(&m->mu);
-    m->counter++;
-    gpr_spinlock_unlock(&m->mu);
-  }
-}
-
-/* Increment m->counter under lock acquired with trylock, m->iterations times;
-   then mark thread as done.  */
-static void inctry(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  for (i = 0; i != m->iterations;) {
-    if (gpr_spinlock_trylock(&m->mu)) {
-      m->counter++;
-      gpr_spinlock_unlock(&m->mu);
-      i++;
-    }
-  }
-}
-
-/* ------------------------------------------------- */
-
-int main(int argc, char *argv[]) {
-  grpc_test_init(argc, argv);
-  test("spinlock", &inc, 1, 1);
-  test("spinlock try", &inctry, 1, 1);
-  return 0;
-}
diff --git a/test/core/support/spinlock_test.cc b/test/core/support/spinlock_test.cc
new file mode 100644
index 0000000..3639802
--- /dev/null
+++ b/test/core/support/spinlock_test.cc
@@ -0,0 +1,147 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* Test of gpr synchronization support. */
+
+#include "src/core/lib/support/spinlock.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "test/core/util/test_config.h"
+
+/* ------------------------------------------------- */
+/* Tests for gpr_spinlock. */
+struct test {
+  int thread_count; /* number of threads */
+  gpr_thd_id* threads;
+
+  int64_t iterations; /* number of iterations per thread */
+  int64_t counter;
+  int incr_step; /* how much to increment/decrement refcount each time */
+
+  gpr_spinlock mu; /* protects iterations, counter */
+};
+
+/* Return pointer to a new struct test. */
+static struct test* test_new(int threads, int64_t iterations, int incr_step) {
+  struct test* m = static_cast<struct test*>(gpr_malloc(sizeof(*m)));
+  m->thread_count = threads;
+  m->threads = static_cast<gpr_thd_id*>(
+      gpr_malloc(sizeof(*m->threads) * (size_t)threads));
+  m->iterations = iterations;
+  m->counter = 0;
+  m->thread_count = 0;
+  m->incr_step = incr_step;
+  m->mu = GPR_SPINLOCK_INITIALIZER;
+  return m;
+}
+
+/* Return pointer to a new struct test. */
+static void test_destroy(struct test* m) {
+  gpr_free(m->threads);
+  gpr_free(m);
+}
+
+/* Create m->threads threads, each running (*body)(m) */
+static void test_create_threads(struct test* m, void (*body)(void* arg)) {
+  int i;
+  for (i = 0; i != m->thread_count; i++) {
+    gpr_thd_options opt = gpr_thd_options_default();
+    gpr_thd_options_set_joinable(&opt);
+    GPR_ASSERT(gpr_thd_new(&m->threads[i], body, m, &opt));
+  }
+}
+
+/* Wait until all threads report done. */
+static void test_wait(struct test* m) {
+  int i;
+  for (i = 0; i != m->thread_count; i++) {
+    gpr_thd_join(m->threads[i]);
+  }
+}
+
+/* Test several threads running (*body)(struct test *m) for increasing settings
+   of m->iterations, until about timeout_s to 2*timeout_s seconds have elapsed.
+   If extra!=NULL, run (*extra)(m) in an additional thread.
+   incr_step controls by how much m->refcount should be incremented/decremented
+   (if at all) each time in the tests.
+   */
+static void test(const char* name, void (*body)(void* m), int timeout_s,
+                 int incr_step) {
+  int64_t iterations = 1024;
+  struct test* m;
+  gpr_timespec start = gpr_now(GPR_CLOCK_REALTIME);
+  gpr_timespec time_taken;
+  gpr_timespec deadline = gpr_time_add(
+      start, gpr_time_from_micros((int64_t)timeout_s * 1000000, GPR_TIMESPAN));
+  fprintf(stderr, "%s:", name);
+  while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0) {
+    if (iterations < INT64_MAX / 2) iterations <<= 1;
+    fprintf(stderr, " %ld", (long)iterations);
+    m = test_new(10, iterations, incr_step);
+    test_create_threads(m, body);
+    test_wait(m);
+    if (m->counter != m->thread_count * m->iterations * m->incr_step) {
+      fprintf(stderr, "counter %ld  threads %d  iterations %ld\n",
+              (long)m->counter, m->thread_count, (long)m->iterations);
+      GPR_ASSERT(0);
+    }
+    test_destroy(m);
+  }
+  time_taken = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start);
+  fprintf(stderr, " done %lld.%09d s\n", (long long)time_taken.tv_sec,
+          (int)time_taken.tv_nsec);
+}
+
+/* Increment m->counter on each iteration; then mark thread as done.  */
+static void inc(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  for (i = 0; i != m->iterations; i++) {
+    gpr_spinlock_lock(&m->mu);
+    m->counter++;
+    gpr_spinlock_unlock(&m->mu);
+  }
+}
+
+/* Increment m->counter under lock acquired with trylock, m->iterations times;
+   then mark thread as done.  */
+static void inctry(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  for (i = 0; i != m->iterations;) {
+    if (gpr_spinlock_trylock(&m->mu)) {
+      m->counter++;
+      gpr_spinlock_unlock(&m->mu);
+      i++;
+    }
+  }
+}
+
+/* ------------------------------------------------- */
+
+int main(int argc, char* argv[]) {
+  grpc_test_init(argc, argv);
+  test("spinlock", &inc, 1, 1);
+  test("spinlock try", &inctry, 1, 1);
+  return 0;
+}
diff --git a/test/core/support/stack_lockfree_test.c b/test/core/support/stack_lockfree_test.c
deleted file mode 100644
index 4b1f60c..0000000
--- a/test/core/support/stack_lockfree_test.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/support/stack_lockfree.h"
-
-#include <stdlib.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include "test/core/util/test_config.h"
-
-/* max stack size supported */
-#define MAX_STACK_SIZE 65534
-
-#define MAX_THREADS 32
-
-static void test_serial_sized(size_t size) {
-  gpr_stack_lockfree *stack = gpr_stack_lockfree_create(size);
-  size_t i;
-  size_t j;
-
-  /* First try popping empty */
-  GPR_ASSERT(gpr_stack_lockfree_pop(stack) == -1);
-
-  /* Now add one item and check it */
-  gpr_stack_lockfree_push(stack, 3);
-  GPR_ASSERT(gpr_stack_lockfree_pop(stack) == 3);
-  GPR_ASSERT(gpr_stack_lockfree_pop(stack) == -1);
-
-  /* Now add repeatedly more items and check them */
-  for (i = 1; i < size; i *= 2) {
-    for (j = 0; j <= i; j++) {
-      GPR_ASSERT(gpr_stack_lockfree_push(stack, (int)j) == (j == 0));
-    }
-    for (j = 0; j <= i; j++) {
-      GPR_ASSERT(gpr_stack_lockfree_pop(stack) == (int)(i - j));
-    }
-    GPR_ASSERT(gpr_stack_lockfree_pop(stack) == -1);
-  }
-
-  gpr_stack_lockfree_destroy(stack);
-}
-
-static void test_serial() {
-  size_t i;
-  for (i = 128; i < MAX_STACK_SIZE; i *= 2) {
-    test_serial_sized(i);
-  }
-  test_serial_sized(MAX_STACK_SIZE);
-}
-
-struct test_arg {
-  gpr_stack_lockfree *stack;
-  int stack_size;
-  int nthreads;
-  int rank;
-  int sum;
-};
-
-static void test_mt_body(void *v) {
-  struct test_arg *arg = (struct test_arg *)v;
-  int lo, hi;
-  int i;
-  int res;
-  lo = arg->rank * arg->stack_size / arg->nthreads;
-  hi = (arg->rank + 1) * arg->stack_size / arg->nthreads;
-  for (i = lo; i < hi; i++) {
-    gpr_stack_lockfree_push(arg->stack, i);
-    if ((res = gpr_stack_lockfree_pop(arg->stack)) != -1) {
-      arg->sum += res;
-    }
-  }
-  while ((res = gpr_stack_lockfree_pop(arg->stack)) != -1) {
-    arg->sum += res;
-  }
-}
-
-static void test_mt_sized(size_t size, int nth) {
-  gpr_stack_lockfree *stack;
-  struct test_arg args[MAX_THREADS];
-  gpr_thd_id thds[MAX_THREADS];
-  int sum;
-  int i;
-  gpr_thd_options options = gpr_thd_options_default();
-
-  stack = gpr_stack_lockfree_create(size);
-  for (i = 0; i < nth; i++) {
-    args[i].stack = stack;
-    args[i].stack_size = (int)size;
-    args[i].nthreads = nth;
-    args[i].rank = i;
-    args[i].sum = 0;
-  }
-  gpr_thd_options_set_joinable(&options);
-  for (i = 0; i < nth; i++) {
-    GPR_ASSERT(gpr_thd_new(&thds[i], test_mt_body, &args[i], &options));
-  }
-  sum = 0;
-  for (i = 0; i < nth; i++) {
-    gpr_thd_join(thds[i]);
-    sum = sum + args[i].sum;
-  }
-  GPR_ASSERT((unsigned)sum == ((unsigned)size * (size - 1)) / 2);
-  gpr_stack_lockfree_destroy(stack);
-}
-
-static void test_mt() {
-  size_t size;
-  int nth;
-  for (nth = 1; nth < MAX_THREADS; nth++) {
-    for (size = 128; size < MAX_STACK_SIZE; size *= 2) {
-      test_mt_sized(size, nth);
-    }
-    test_mt_sized(MAX_STACK_SIZE, nth);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_serial();
-  test_mt();
-  return 0;
-}
diff --git a/test/core/support/stack_lockfree_test.cc b/test/core/support/stack_lockfree_test.cc
new file mode 100644
index 0000000..e6d0c9b
--- /dev/null
+++ b/test/core/support/stack_lockfree_test.cc
@@ -0,0 +1,140 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/support/stack_lockfree.h"
+
+#include <stdlib.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include "test/core/util/test_config.h"
+
+/* max stack size supported */
+#define MAX_STACK_SIZE 65534
+
+#define MAX_THREADS 32
+
+static void test_serial_sized(size_t size) {
+  gpr_stack_lockfree* stack = gpr_stack_lockfree_create(size);
+  size_t i;
+  size_t j;
+
+  /* First try popping empty */
+  GPR_ASSERT(gpr_stack_lockfree_pop(stack) == -1);
+
+  /* Now add one item and check it */
+  gpr_stack_lockfree_push(stack, 3);
+  GPR_ASSERT(gpr_stack_lockfree_pop(stack) == 3);
+  GPR_ASSERT(gpr_stack_lockfree_pop(stack) == -1);
+
+  /* Now add repeatedly more items and check them */
+  for (i = 1; i < size; i *= 2) {
+    for (j = 0; j <= i; j++) {
+      GPR_ASSERT(gpr_stack_lockfree_push(stack, (int)j) == (j == 0));
+    }
+    for (j = 0; j <= i; j++) {
+      GPR_ASSERT(gpr_stack_lockfree_pop(stack) == (int)(i - j));
+    }
+    GPR_ASSERT(gpr_stack_lockfree_pop(stack) == -1);
+  }
+
+  gpr_stack_lockfree_destroy(stack);
+}
+
+static void test_serial() {
+  size_t i;
+  for (i = 128; i < MAX_STACK_SIZE; i *= 2) {
+    test_serial_sized(i);
+  }
+  test_serial_sized(MAX_STACK_SIZE);
+}
+
+struct test_arg {
+  gpr_stack_lockfree* stack;
+  int stack_size;
+  int nthreads;
+  int rank;
+  int sum;
+};
+
+static void test_mt_body(void* v) {
+  struct test_arg* arg = (struct test_arg*)v;
+  int lo, hi;
+  int i;
+  int res;
+  lo = arg->rank * arg->stack_size / arg->nthreads;
+  hi = (arg->rank + 1) * arg->stack_size / arg->nthreads;
+  for (i = lo; i < hi; i++) {
+    gpr_stack_lockfree_push(arg->stack, i);
+    if ((res = gpr_stack_lockfree_pop(arg->stack)) != -1) {
+      arg->sum += res;
+    }
+  }
+  while ((res = gpr_stack_lockfree_pop(arg->stack)) != -1) {
+    arg->sum += res;
+  }
+}
+
+static void test_mt_sized(size_t size, int nth) {
+  gpr_stack_lockfree* stack;
+  struct test_arg args[MAX_THREADS];
+  gpr_thd_id thds[MAX_THREADS];
+  int sum;
+  int i;
+  gpr_thd_options options = gpr_thd_options_default();
+
+  stack = gpr_stack_lockfree_create(size);
+  for (i = 0; i < nth; i++) {
+    args[i].stack = stack;
+    args[i].stack_size = (int)size;
+    args[i].nthreads = nth;
+    args[i].rank = i;
+    args[i].sum = 0;
+  }
+  gpr_thd_options_set_joinable(&options);
+  for (i = 0; i < nth; i++) {
+    GPR_ASSERT(gpr_thd_new(&thds[i], test_mt_body, &args[i], &options));
+  }
+  sum = 0;
+  for (i = 0; i < nth; i++) {
+    gpr_thd_join(thds[i]);
+    sum = sum + args[i].sum;
+  }
+  GPR_ASSERT((unsigned)sum == ((unsigned)size * (size - 1)) / 2);
+  gpr_stack_lockfree_destroy(stack);
+}
+
+static void test_mt() {
+  size_t size;
+  int nth;
+  for (nth = 1; nth < MAX_THREADS; nth++) {
+    for (size = 128; size < MAX_STACK_SIZE; size *= 2) {
+      test_mt_sized(size, nth);
+    }
+    test_mt_sized(MAX_STACK_SIZE, nth);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_serial();
+  test_mt();
+  return 0;
+}
diff --git a/test/core/support/string_test.c b/test/core/support/string_test.c
deleted file mode 100644
index bee2139..0000000
--- a/test/core/support/string_test.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/support/string.h"
-
-#include <limits.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/useful.h>
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x)
-
-static void test_strdup(void) {
-  static const char *src1 = "hello world";
-  char *dst1;
-
-  LOG_TEST_NAME("test_strdup");
-
-  dst1 = gpr_strdup(src1);
-  GPR_ASSERT(0 == strcmp(src1, dst1));
-  gpr_free(dst1);
-
-  GPR_ASSERT(NULL == gpr_strdup(NULL));
-}
-
-static void expect_dump(const char *buf, size_t len, uint32_t flags,
-                        const char *result) {
-  char *got = gpr_dump(buf, len, flags);
-  GPR_ASSERT(0 == strcmp(got, result));
-  gpr_free(got);
-}
-
-static void test_dump(void) {
-  LOG_TEST_NAME("test_dump");
-  expect_dump("\x01", 1, GPR_DUMP_HEX, "01");
-  expect_dump("\x01", 1, GPR_DUMP_HEX | GPR_DUMP_ASCII, "01 '.'");
-  expect_dump("\x01\x02", 2, GPR_DUMP_HEX, "01 02");
-  expect_dump("\x01\x23\x45\x67\x89\xab\xcd\xef", 8, GPR_DUMP_HEX,
-              "01 23 45 67 89 ab cd ef");
-  expect_dump("ab", 2, GPR_DUMP_HEX | GPR_DUMP_ASCII, "61 62 'ab'");
-}
-
-static void test_pu32_fail(const char *s) {
-  uint32_t out;
-  GPR_ASSERT(!gpr_parse_bytes_to_uint32(s, strlen(s), &out));
-}
-
-static void test_pu32_succeed(const char *s, uint32_t want) {
-  uint32_t out;
-  GPR_ASSERT(gpr_parse_bytes_to_uint32(s, strlen(s), &out));
-  GPR_ASSERT(out == want);
-}
-
-static void test_parse_uint32(void) {
-  LOG_TEST_NAME("test_parse_uint32");
-
-  test_pu32_fail("-1");
-  test_pu32_fail("a");
-  test_pu32_fail("");
-  test_pu32_succeed("0", 0);
-  test_pu32_succeed("1", 1);
-  test_pu32_succeed("2", 2);
-  test_pu32_succeed("3", 3);
-  test_pu32_succeed("4", 4);
-  test_pu32_succeed("5", 5);
-  test_pu32_succeed("6", 6);
-  test_pu32_succeed("7", 7);
-  test_pu32_succeed("8", 8);
-  test_pu32_succeed("9", 9);
-  test_pu32_succeed("10", 10);
-  test_pu32_succeed("11", 11);
-  test_pu32_succeed("12", 12);
-  test_pu32_succeed("13", 13);
-  test_pu32_succeed("14", 14);
-  test_pu32_succeed("15", 15);
-  test_pu32_succeed("16", 16);
-  test_pu32_succeed("17", 17);
-  test_pu32_succeed("18", 18);
-  test_pu32_succeed("19", 19);
-  test_pu32_succeed("1234567890", 1234567890);
-  test_pu32_succeed("4294967295", 4294967295u);
-  test_pu32_fail("4294967296");
-  test_pu32_fail("4294967297");
-  test_pu32_fail("4294967298");
-  test_pu32_fail("4294967299");
-}
-
-static void test_asprintf(void) {
-  char *buf;
-  int i, j;
-
-  LOG_TEST_NAME("test_asprintf");
-
-  /* Print an empty string. */
-  GPR_ASSERT(gpr_asprintf(&buf, "%s", "") == 0);
-  GPR_ASSERT(buf[0] == '\0');
-  gpr_free(buf);
-
-  /* Print strings of various lengths. */
-  for (i = 1; i < 100; i++) {
-    GPR_ASSERT(gpr_asprintf(&buf, "%0*d", i, 1) == i);
-
-    /* The buffer should resemble "000001\0". */
-    for (j = 0; j < i - 2; j++) {
-      GPR_ASSERT(buf[j] == '0');
-    }
-    GPR_ASSERT(buf[i - 1] == '1');
-    GPR_ASSERT(buf[i] == '\0');
-    gpr_free(buf);
-  }
-}
-
-static void test_strjoin(void) {
-  const char *parts[4] = {"one", "two", "three", "four"};
-  size_t joined_len;
-  char *joined;
-
-  LOG_TEST_NAME("test_strjoin");
-
-  joined = gpr_strjoin(parts, 4, &joined_len);
-  GPR_ASSERT(0 == strcmp("onetwothreefour", joined));
-  gpr_free(joined);
-
-  joined = gpr_strjoin(parts, 0, &joined_len);
-  GPR_ASSERT(0 == strcmp("", joined));
-  gpr_free(joined);
-
-  joined = gpr_strjoin(parts, 1, &joined_len);
-  GPR_ASSERT(0 == strcmp("one", joined));
-  gpr_free(joined);
-}
-
-static void test_strjoin_sep(void) {
-  const char *parts[4] = {"one", "two", "three", "four"};
-  size_t joined_len;
-  char *joined;
-
-  LOG_TEST_NAME("test_strjoin_sep");
-
-  joined = gpr_strjoin_sep(parts, 4, ", ", &joined_len);
-  GPR_ASSERT(0 == strcmp("one, two, three, four", joined));
-  gpr_free(joined);
-
-  /* empty separator */
-  joined = gpr_strjoin_sep(parts, 4, "", &joined_len);
-  GPR_ASSERT(0 == strcmp("onetwothreefour", joined));
-  gpr_free(joined);
-
-  /* degenerated case specifying zero input parts */
-  joined = gpr_strjoin_sep(parts, 0, ", ", &joined_len);
-  GPR_ASSERT(0 == strcmp("", joined));
-  gpr_free(joined);
-
-  /* single part should have no separator */
-  joined = gpr_strjoin_sep(parts, 1, ", ", &joined_len);
-  GPR_ASSERT(0 == strcmp("one", joined));
-  gpr_free(joined);
-}
-
-static void test_ltoa() {
-  char *str;
-  char buf[GPR_LTOA_MIN_BUFSIZE];
-
-  LOG_TEST_NAME("test_ltoa");
-
-  /* zero */
-  GPR_ASSERT(1 == gpr_ltoa(0, buf));
-  GPR_ASSERT(0 == strcmp("0", buf));
-
-  /* positive number */
-  GPR_ASSERT(3 == gpr_ltoa(123, buf));
-  GPR_ASSERT(0 == strcmp("123", buf));
-
-  /* negative number */
-  GPR_ASSERT(6 == gpr_ltoa(-12345, buf));
-  GPR_ASSERT(0 == strcmp("-12345", buf));
-
-  /* large negative - we don't know the size of long in advance */
-  GPR_ASSERT(gpr_asprintf(&str, "%lld", (long long)LONG_MIN));
-  GPR_ASSERT(strlen(str) == (size_t)gpr_ltoa(LONG_MIN, buf));
-  GPR_ASSERT(0 == strcmp(str, buf));
-  gpr_free(str);
-}
-
-static void test_int64toa() {
-  char buf[GPR_INT64TOA_MIN_BUFSIZE];
-
-  LOG_TEST_NAME("test_int64toa");
-
-  /* zero */
-  GPR_ASSERT(1 == int64_ttoa(0, buf));
-  GPR_ASSERT(0 == strcmp("0", buf));
-
-  /* positive */
-  GPR_ASSERT(3 == int64_ttoa(123, buf));
-  GPR_ASSERT(0 == strcmp("123", buf));
-
-  /* large positive */
-  GPR_ASSERT(19 == int64_ttoa(9223372036854775807LL, buf));
-  GPR_ASSERT(0 == strcmp("9223372036854775807", buf));
-
-  /* large negative */
-  GPR_ASSERT(20 == int64_ttoa(-9223372036854775807LL - 1, buf));
-  GPR_ASSERT(0 == strcmp("-9223372036854775808", buf));
-}
-
-static void test_leftpad() {
-  char *padded;
-
-  LOG_TEST_NAME("test_leftpad");
-
-  padded = gpr_leftpad("foo", ' ', 5);
-  GPR_ASSERT(0 == strcmp("  foo", padded));
-  gpr_free(padded);
-
-  padded = gpr_leftpad("foo", ' ', 4);
-  GPR_ASSERT(0 == strcmp(" foo", padded));
-  gpr_free(padded);
-
-  padded = gpr_leftpad("foo", ' ', 3);
-  GPR_ASSERT(0 == strcmp("foo", padded));
-  gpr_free(padded);
-
-  padded = gpr_leftpad("foo", ' ', 2);
-  GPR_ASSERT(0 == strcmp("foo", padded));
-  gpr_free(padded);
-
-  padded = gpr_leftpad("foo", ' ', 1);
-  GPR_ASSERT(0 == strcmp("foo", padded));
-  gpr_free(padded);
-
-  padded = gpr_leftpad("foo", ' ', 0);
-  GPR_ASSERT(0 == strcmp("foo", padded));
-  gpr_free(padded);
-
-  padded = gpr_leftpad("foo", '0', 5);
-  GPR_ASSERT(0 == strcmp("00foo", padded));
-  gpr_free(padded);
-}
-
-static void test_stricmp(void) {
-  LOG_TEST_NAME("test_stricmp");
-
-  GPR_ASSERT(0 == gpr_stricmp("hello", "hello"));
-  GPR_ASSERT(0 == gpr_stricmp("HELLO", "hello"));
-  GPR_ASSERT(gpr_stricmp("a", "b") < 0);
-  GPR_ASSERT(gpr_stricmp("b", "a") > 0);
-}
-
-static void test_memrchr(void) {
-  LOG_TEST_NAME("test_memrchr");
-
-  GPR_ASSERT(NULL == gpr_memrchr(NULL, 'a', 0));
-  GPR_ASSERT(NULL == gpr_memrchr("", 'a', 0));
-  GPR_ASSERT(NULL == gpr_memrchr("hello", 'b', 5));
-  GPR_ASSERT(0 == strcmp((const char *)gpr_memrchr("hello", 'h', 5), "hello"));
-  GPR_ASSERT(0 == strcmp((const char *)gpr_memrchr("hello", 'o', 5), "o"));
-  GPR_ASSERT(0 == strcmp((const char *)gpr_memrchr("hello", 'l', 5), "lo"));
-}
-
-static void test_is_true(void) {
-  LOG_TEST_NAME("test_is_true");
-
-  GPR_ASSERT(true == gpr_is_true("True"));
-  GPR_ASSERT(true == gpr_is_true("true"));
-  GPR_ASSERT(true == gpr_is_true("TRUE"));
-  GPR_ASSERT(true == gpr_is_true("Yes"));
-  GPR_ASSERT(true == gpr_is_true("yes"));
-  GPR_ASSERT(true == gpr_is_true("YES"));
-  GPR_ASSERT(true == gpr_is_true("1"));
-  GPR_ASSERT(false == gpr_is_true(NULL));
-  GPR_ASSERT(false == gpr_is_true(""));
-  GPR_ASSERT(false == gpr_is_true("0"));
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_strdup();
-  test_dump();
-  test_parse_uint32();
-  test_asprintf();
-  test_strjoin();
-  test_strjoin_sep();
-  test_ltoa();
-  test_int64toa();
-  test_leftpad();
-  test_stricmp();
-  test_memrchr();
-  test_is_true();
-  return 0;
-}
diff --git a/test/core/support/string_test.cc b/test/core/support/string_test.cc
new file mode 100644
index 0000000..4bae158
--- /dev/null
+++ b/test/core/support/string_test.cc
@@ -0,0 +1,312 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/support/string.h"
+
+#include <limits.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x)
+
+static void test_strdup(void) {
+  static const char* src1 = "hello world";
+  char* dst1;
+
+  LOG_TEST_NAME("test_strdup");
+
+  dst1 = gpr_strdup(src1);
+  GPR_ASSERT(0 == strcmp(src1, dst1));
+  gpr_free(dst1);
+
+  GPR_ASSERT(NULL == gpr_strdup(NULL));
+}
+
+static void expect_dump(const char* buf, size_t len, uint32_t flags,
+                        const char* result) {
+  char* got = gpr_dump(buf, len, flags);
+  GPR_ASSERT(0 == strcmp(got, result));
+  gpr_free(got);
+}
+
+static void test_dump(void) {
+  LOG_TEST_NAME("test_dump");
+  expect_dump("\x01", 1, GPR_DUMP_HEX, "01");
+  expect_dump("\x01", 1, GPR_DUMP_HEX | GPR_DUMP_ASCII, "01 '.'");
+  expect_dump("\x01\x02", 2, GPR_DUMP_HEX, "01 02");
+  expect_dump("\x01\x23\x45\x67\x89\xab\xcd\xef", 8, GPR_DUMP_HEX,
+              "01 23 45 67 89 ab cd ef");
+  expect_dump("ab", 2, GPR_DUMP_HEX | GPR_DUMP_ASCII, "61 62 'ab'");
+}
+
+static void test_pu32_fail(const char* s) {
+  uint32_t out;
+  GPR_ASSERT(!gpr_parse_bytes_to_uint32(s, strlen(s), &out));
+}
+
+static void test_pu32_succeed(const char* s, uint32_t want) {
+  uint32_t out;
+  GPR_ASSERT(gpr_parse_bytes_to_uint32(s, strlen(s), &out));
+  GPR_ASSERT(out == want);
+}
+
+static void test_parse_uint32(void) {
+  LOG_TEST_NAME("test_parse_uint32");
+
+  test_pu32_fail("-1");
+  test_pu32_fail("a");
+  test_pu32_fail("");
+  test_pu32_succeed("0", 0);
+  test_pu32_succeed("1", 1);
+  test_pu32_succeed("2", 2);
+  test_pu32_succeed("3", 3);
+  test_pu32_succeed("4", 4);
+  test_pu32_succeed("5", 5);
+  test_pu32_succeed("6", 6);
+  test_pu32_succeed("7", 7);
+  test_pu32_succeed("8", 8);
+  test_pu32_succeed("9", 9);
+  test_pu32_succeed("10", 10);
+  test_pu32_succeed("11", 11);
+  test_pu32_succeed("12", 12);
+  test_pu32_succeed("13", 13);
+  test_pu32_succeed("14", 14);
+  test_pu32_succeed("15", 15);
+  test_pu32_succeed("16", 16);
+  test_pu32_succeed("17", 17);
+  test_pu32_succeed("18", 18);
+  test_pu32_succeed("19", 19);
+  test_pu32_succeed("1234567890", 1234567890);
+  test_pu32_succeed("4294967295", 4294967295u);
+  test_pu32_fail("4294967296");
+  test_pu32_fail("4294967297");
+  test_pu32_fail("4294967298");
+  test_pu32_fail("4294967299");
+}
+
+static void test_asprintf(void) {
+  char* buf;
+  int i, j;
+
+  LOG_TEST_NAME("test_asprintf");
+
+  /* Print an empty string. */
+  GPR_ASSERT(gpr_asprintf(&buf, "%s", "") == 0);
+  GPR_ASSERT(buf[0] == '\0');
+  gpr_free(buf);
+
+  /* Print strings of various lengths. */
+  for (i = 1; i < 100; i++) {
+    GPR_ASSERT(gpr_asprintf(&buf, "%0*d", i, 1) == i);
+
+    /* The buffer should resemble "000001\0". */
+    for (j = 0; j < i - 2; j++) {
+      GPR_ASSERT(buf[j] == '0');
+    }
+    GPR_ASSERT(buf[i - 1] == '1');
+    GPR_ASSERT(buf[i] == '\0');
+    gpr_free(buf);
+  }
+}
+
+static void test_strjoin(void) {
+  const char* parts[4] = {"one", "two", "three", "four"};
+  size_t joined_len;
+  char* joined;
+
+  LOG_TEST_NAME("test_strjoin");
+
+  joined = gpr_strjoin(parts, 4, &joined_len);
+  GPR_ASSERT(0 == strcmp("onetwothreefour", joined));
+  gpr_free(joined);
+
+  joined = gpr_strjoin(parts, 0, &joined_len);
+  GPR_ASSERT(0 == strcmp("", joined));
+  gpr_free(joined);
+
+  joined = gpr_strjoin(parts, 1, &joined_len);
+  GPR_ASSERT(0 == strcmp("one", joined));
+  gpr_free(joined);
+}
+
+static void test_strjoin_sep(void) {
+  const char* parts[4] = {"one", "two", "three", "four"};
+  size_t joined_len;
+  char* joined;
+
+  LOG_TEST_NAME("test_strjoin_sep");
+
+  joined = gpr_strjoin_sep(parts, 4, ", ", &joined_len);
+  GPR_ASSERT(0 == strcmp("one, two, three, four", joined));
+  gpr_free(joined);
+
+  /* empty separator */
+  joined = gpr_strjoin_sep(parts, 4, "", &joined_len);
+  GPR_ASSERT(0 == strcmp("onetwothreefour", joined));
+  gpr_free(joined);
+
+  /* degenerated case specifying zero input parts */
+  joined = gpr_strjoin_sep(parts, 0, ", ", &joined_len);
+  GPR_ASSERT(0 == strcmp("", joined));
+  gpr_free(joined);
+
+  /* single part should have no separator */
+  joined = gpr_strjoin_sep(parts, 1, ", ", &joined_len);
+  GPR_ASSERT(0 == strcmp("one", joined));
+  gpr_free(joined);
+}
+
+static void test_ltoa() {
+  char* str;
+  char buf[GPR_LTOA_MIN_BUFSIZE];
+
+  LOG_TEST_NAME("test_ltoa");
+
+  /* zero */
+  GPR_ASSERT(1 == gpr_ltoa(0, buf));
+  GPR_ASSERT(0 == strcmp("0", buf));
+
+  /* positive number */
+  GPR_ASSERT(3 == gpr_ltoa(123, buf));
+  GPR_ASSERT(0 == strcmp("123", buf));
+
+  /* negative number */
+  GPR_ASSERT(6 == gpr_ltoa(-12345, buf));
+  GPR_ASSERT(0 == strcmp("-12345", buf));
+
+  /* large negative - we don't know the size of long in advance */
+  GPR_ASSERT(gpr_asprintf(&str, "%lld", (long long)LONG_MIN));
+  GPR_ASSERT(strlen(str) == (size_t)gpr_ltoa(LONG_MIN, buf));
+  GPR_ASSERT(0 == strcmp(str, buf));
+  gpr_free(str);
+}
+
+static void test_int64toa() {
+  char buf[GPR_INT64TOA_MIN_BUFSIZE];
+
+  LOG_TEST_NAME("test_int64toa");
+
+  /* zero */
+  GPR_ASSERT(1 == int64_ttoa(0, buf));
+  GPR_ASSERT(0 == strcmp("0", buf));
+
+  /* positive */
+  GPR_ASSERT(3 == int64_ttoa(123, buf));
+  GPR_ASSERT(0 == strcmp("123", buf));
+
+  /* large positive */
+  GPR_ASSERT(19 == int64_ttoa(9223372036854775807LL, buf));
+  GPR_ASSERT(0 == strcmp("9223372036854775807", buf));
+
+  /* large negative */
+  GPR_ASSERT(20 == int64_ttoa(-9223372036854775807LL - 1, buf));
+  GPR_ASSERT(0 == strcmp("-9223372036854775808", buf));
+}
+
+static void test_leftpad() {
+  char* padded;
+
+  LOG_TEST_NAME("test_leftpad");
+
+  padded = gpr_leftpad("foo", ' ', 5);
+  GPR_ASSERT(0 == strcmp("  foo", padded));
+  gpr_free(padded);
+
+  padded = gpr_leftpad("foo", ' ', 4);
+  GPR_ASSERT(0 == strcmp(" foo", padded));
+  gpr_free(padded);
+
+  padded = gpr_leftpad("foo", ' ', 3);
+  GPR_ASSERT(0 == strcmp("foo", padded));
+  gpr_free(padded);
+
+  padded = gpr_leftpad("foo", ' ', 2);
+  GPR_ASSERT(0 == strcmp("foo", padded));
+  gpr_free(padded);
+
+  padded = gpr_leftpad("foo", ' ', 1);
+  GPR_ASSERT(0 == strcmp("foo", padded));
+  gpr_free(padded);
+
+  padded = gpr_leftpad("foo", ' ', 0);
+  GPR_ASSERT(0 == strcmp("foo", padded));
+  gpr_free(padded);
+
+  padded = gpr_leftpad("foo", '0', 5);
+  GPR_ASSERT(0 == strcmp("00foo", padded));
+  gpr_free(padded);
+}
+
+static void test_stricmp(void) {
+  LOG_TEST_NAME("test_stricmp");
+
+  GPR_ASSERT(0 == gpr_stricmp("hello", "hello"));
+  GPR_ASSERT(0 == gpr_stricmp("HELLO", "hello"));
+  GPR_ASSERT(gpr_stricmp("a", "b") < 0);
+  GPR_ASSERT(gpr_stricmp("b", "a") > 0);
+}
+
+static void test_memrchr(void) {
+  LOG_TEST_NAME("test_memrchr");
+
+  GPR_ASSERT(NULL == gpr_memrchr(NULL, 'a', 0));
+  GPR_ASSERT(NULL == gpr_memrchr("", 'a', 0));
+  GPR_ASSERT(NULL == gpr_memrchr("hello", 'b', 5));
+  GPR_ASSERT(0 == strcmp((const char*)gpr_memrchr("hello", 'h', 5), "hello"));
+  GPR_ASSERT(0 == strcmp((const char*)gpr_memrchr("hello", 'o', 5), "o"));
+  GPR_ASSERT(0 == strcmp((const char*)gpr_memrchr("hello", 'l', 5), "lo"));
+}
+
+static void test_is_true(void) {
+  LOG_TEST_NAME("test_is_true");
+
+  GPR_ASSERT(true == gpr_is_true("True"));
+  GPR_ASSERT(true == gpr_is_true("true"));
+  GPR_ASSERT(true == gpr_is_true("TRUE"));
+  GPR_ASSERT(true == gpr_is_true("Yes"));
+  GPR_ASSERT(true == gpr_is_true("yes"));
+  GPR_ASSERT(true == gpr_is_true("YES"));
+  GPR_ASSERT(true == gpr_is_true("1"));
+  GPR_ASSERT(false == gpr_is_true(NULL));
+  GPR_ASSERT(false == gpr_is_true(""));
+  GPR_ASSERT(false == gpr_is_true("0"));
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_strdup();
+  test_dump();
+  test_parse_uint32();
+  test_asprintf();
+  test_strjoin();
+  test_strjoin_sep();
+  test_ltoa();
+  test_int64toa();
+  test_leftpad();
+  test_stricmp();
+  test_memrchr();
+  test_is_true();
+  return 0;
+}
diff --git a/test/core/support/sync_test.c b/test/core/support/sync_test.c
deleted file mode 100644
index 178d77e..0000000
--- a/test/core/support/sync_test.c
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* Test of gpr synchronization support. */
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "test/core/util/test_config.h"
-
-/* ==================Example use of interface===================
-
-   A producer-consumer queue of up to N integers,
-   illustrating the use of the calls in this interface.  */
-
-#define N 4
-
-typedef struct queue {
-  gpr_cv non_empty; /* Signalled when length becomes non-zero. */
-  gpr_cv non_full;  /* Signalled when length becomes non-N. */
-  gpr_mu mu;        /* Protects all fields below.
-                       (That is, except during initialization or
-                       destruction, the fields below should be accessed
-                       only by a thread that holds mu.) */
-  int head;         /* Index of head of queue 0..N-1. */
-  int length;       /* Number of valid elements in queue 0..N. */
-  int elem[N];      /* elem[head .. head+length-1] are queue elements. */
-} queue;
-
-/* Initialize *q. */
-void queue_init(queue *q) {
-  gpr_mu_init(&q->mu);
-  gpr_cv_init(&q->non_empty);
-  gpr_cv_init(&q->non_full);
-  q->head = 0;
-  q->length = 0;
-}
-
-/* Free storage associated with *q. */
-void queue_destroy(queue *q) {
-  gpr_mu_destroy(&q->mu);
-  gpr_cv_destroy(&q->non_empty);
-  gpr_cv_destroy(&q->non_full);
-}
-
-/* Wait until there is room in *q, then append x to *q. */
-void queue_append(queue *q, int x) {
-  gpr_mu_lock(&q->mu);
-  /* To wait for a predicate without a deadline, loop on the negation of the
-     predicate, and use gpr_cv_wait(..., gpr_inf_future(GPR_CLOCK_REALTIME))
-     inside the loop
-     to release the lock, wait, and reacquire on each iteration.  Code that
-     makes the condition true should use gpr_cv_broadcast() on the
-     corresponding condition variable.  The predicate must be on state
-     protected by the lock.  */
-  while (q->length == N) {
-    gpr_cv_wait(&q->non_full, &q->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  if (q->length == 0) { /* Wake threads blocked in queue_remove(). */
-    /* It's normal to use gpr_cv_broadcast() or gpr_signal() while
-       holding the lock. */
-    gpr_cv_broadcast(&q->non_empty);
-  }
-  q->elem[(q->head + q->length) % N] = x;
-  q->length++;
-  gpr_mu_unlock(&q->mu);
-}
-
-/* If it can be done without blocking, append x to *q and return non-zero.
-   Otherwise return 0. */
-int queue_try_append(queue *q, int x) {
-  int result = 0;
-  if (gpr_mu_trylock(&q->mu)) {
-    if (q->length != N) {
-      if (q->length == 0) { /* Wake threads blocked in queue_remove(). */
-        gpr_cv_broadcast(&q->non_empty);
-      }
-      q->elem[(q->head + q->length) % N] = x;
-      q->length++;
-      result = 1;
-    }
-    gpr_mu_unlock(&q->mu);
-  }
-  return result;
-}
-
-/* Wait until the *q is non-empty or deadline abs_deadline passes.  If the
-   queue is non-empty, remove its head entry, place it in *head, and return
-   non-zero.  Otherwise return 0.  */
-int queue_remove(queue *q, int *head, gpr_timespec abs_deadline) {
-  int result = 0;
-  gpr_mu_lock(&q->mu);
-  /* To wait for a predicate with a deadline, loop on the negation of the
-     predicate or until gpr_cv_wait() returns true.  Code that makes
-     the condition true should use gpr_cv_broadcast() on the corresponding
-     condition variable.  The predicate must be on state protected by the
-     lock. */
-  while (q->length == 0 && !gpr_cv_wait(&q->non_empty, &q->mu, abs_deadline)) {
-  }
-  if (q->length != 0) { /* Queue is non-empty. */
-    result = 1;
-    if (q->length == N) { /* Wake threads blocked in queue_append(). */
-      gpr_cv_broadcast(&q->non_full);
-    }
-    *head = q->elem[q->head];
-    q->head = (q->head + 1) % N;
-    q->length--;
-  } /* else deadline exceeded */
-  gpr_mu_unlock(&q->mu);
-  return result;
-}
-
-/* ------------------------------------------------- */
-/* Tests for gpr_mu and gpr_cv, and the queue example. */
-struct test {
-  int threads; /* number of threads */
-
-  int64_t iterations; /* number of iterations per thread */
-  int64_t counter;
-  int thread_count; /* used to allocate thread ids */
-  int done;         /* threads not yet completed */
-  int incr_step;    /* how much to increment/decrement refcount each time */
-
-  gpr_mu mu; /* protects iterations, counter, thread_count, done */
-
-  gpr_cv cv; /* signalling depends on test */
-
-  gpr_cv done_cv; /* signalled when done == 0 */
-
-  queue q;
-
-  gpr_stats_counter stats_counter;
-
-  gpr_refcount refcount;
-  gpr_refcount thread_refcount;
-  gpr_event event;
-};
-
-/* Return pointer to a new struct test. */
-static struct test *test_new(int threads, int64_t iterations, int incr_step) {
-  struct test *m = gpr_malloc(sizeof(*m));
-  m->threads = threads;
-  m->iterations = iterations;
-  m->counter = 0;
-  m->thread_count = 0;
-  m->done = threads;
-  m->incr_step = incr_step;
-  gpr_mu_init(&m->mu);
-  gpr_cv_init(&m->cv);
-  gpr_cv_init(&m->done_cv);
-  queue_init(&m->q);
-  gpr_stats_init(&m->stats_counter, 0);
-  gpr_ref_init(&m->refcount, 0);
-  gpr_ref_init(&m->thread_refcount, threads);
-  gpr_event_init(&m->event);
-  return m;
-}
-
-/* Return pointer to a new struct test. */
-static void test_destroy(struct test *m) {
-  gpr_mu_destroy(&m->mu);
-  gpr_cv_destroy(&m->cv);
-  gpr_cv_destroy(&m->done_cv);
-  queue_destroy(&m->q);
-  gpr_free(m);
-}
-
-/* Create m->threads threads, each running (*body)(m) */
-static void test_create_threads(struct test *m, void (*body)(void *arg)) {
-  gpr_thd_id id;
-  int i;
-  for (i = 0; i != m->threads; i++) {
-    GPR_ASSERT(gpr_thd_new(&id, body, m, NULL));
-  }
-}
-
-/* Wait until all threads report done. */
-static void test_wait(struct test *m) {
-  gpr_mu_lock(&m->mu);
-  while (m->done != 0) {
-    gpr_cv_wait(&m->done_cv, &m->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  gpr_mu_unlock(&m->mu);
-}
-
-/* Get an integer thread id in the raneg 0..threads-1 */
-static int thread_id(struct test *m) {
-  int id;
-  gpr_mu_lock(&m->mu);
-  id = m->thread_count++;
-  gpr_mu_unlock(&m->mu);
-  return id;
-}
-
-/* Indicate that a thread is done, by decrementing m->done
-   and signalling done_cv if m->done==0. */
-static void mark_thread_done(struct test *m) {
-  gpr_mu_lock(&m->mu);
-  GPR_ASSERT(m->done != 0);
-  m->done--;
-  if (m->done == 0) {
-    gpr_cv_signal(&m->done_cv);
-  }
-  gpr_mu_unlock(&m->mu);
-}
-
-/* Test several threads running (*body)(struct test *m) for increasing settings
-   of m->iterations, until about timeout_s to 2*timeout_s seconds have elapsed.
-   If extra!=NULL, run (*extra)(m) in an additional thread.
-   incr_step controls by how much m->refcount should be incremented/decremented
-   (if at all) each time in the tests.
-   */
-static void test(const char *name, void (*body)(void *m),
-                 void (*extra)(void *m), int timeout_s, int incr_step) {
-  int64_t iterations = 1024;
-  struct test *m;
-  gpr_timespec start = gpr_now(GPR_CLOCK_REALTIME);
-  gpr_timespec time_taken;
-  gpr_timespec deadline = gpr_time_add(
-      start, gpr_time_from_micros((int64_t)timeout_s * 1000000, GPR_TIMESPAN));
-  fprintf(stderr, "%s:", name);
-  while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0) {
-    iterations <<= 1;
-    fprintf(stderr, " %ld", (long)iterations);
-    m = test_new(10, iterations, incr_step);
-    if (extra != NULL) {
-      gpr_thd_id id;
-      GPR_ASSERT(gpr_thd_new(&id, extra, m, NULL));
-      m->done++; /* one more thread to wait for */
-    }
-    test_create_threads(m, body);
-    test_wait(m);
-    if (m->counter != m->threads * m->iterations * m->incr_step) {
-      fprintf(stderr, "counter %ld  threads %d  iterations %ld\n",
-              (long)m->counter, m->threads, (long)m->iterations);
-      GPR_ASSERT(0);
-    }
-    test_destroy(m);
-  }
-  time_taken = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start);
-  fprintf(stderr, " done %lld.%09d s\n", (long long)time_taken.tv_sec,
-          (int)time_taken.tv_nsec);
-}
-
-/* Increment m->counter on each iteration; then mark thread as done.  */
-static void inc(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  for (i = 0; i != m->iterations; i++) {
-    gpr_mu_lock(&m->mu);
-    m->counter++;
-    gpr_mu_unlock(&m->mu);
-  }
-  mark_thread_done(m);
-}
-
-/* Increment m->counter under lock acquired with trylock, m->iterations times;
-   then mark thread as done.  */
-static void inctry(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  for (i = 0; i != m->iterations;) {
-    if (gpr_mu_trylock(&m->mu)) {
-      m->counter++;
-      gpr_mu_unlock(&m->mu);
-      i++;
-    }
-  }
-  mark_thread_done(m);
-}
-
-/* Increment counter only when (m->counter%m->threads)==m->thread_id; then mark
-   thread as done.  */
-static void inc_by_turns(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  int id = thread_id(m);
-  for (i = 0; i != m->iterations; i++) {
-    gpr_mu_lock(&m->mu);
-    while ((m->counter % m->threads) != id) {
-      gpr_cv_wait(&m->cv, &m->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-    }
-    m->counter++;
-    gpr_cv_broadcast(&m->cv);
-    gpr_mu_unlock(&m->mu);
-  }
-  mark_thread_done(m);
-}
-
-/* Wait a millisecond and increment counter on each iteration;
-   then mark thread as done. */
-static void inc_with_1ms_delay(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  for (i = 0; i != m->iterations; i++) {
-    gpr_timespec deadline;
-    gpr_mu_lock(&m->mu);
-    deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                            gpr_time_from_micros(1000, GPR_TIMESPAN));
-    while (!gpr_cv_wait(&m->cv, &m->mu, deadline)) {
-    }
-    m->counter++;
-    gpr_mu_unlock(&m->mu);
-  }
-  mark_thread_done(m);
-}
-
-/* Wait a millisecond and increment counter on each iteration, using an event
-   for timing; then mark thread as done. */
-static void inc_with_1ms_delay_event(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  for (i = 0; i != m->iterations; i++) {
-    gpr_timespec deadline;
-    deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                            gpr_time_from_micros(1000, GPR_TIMESPAN));
-    GPR_ASSERT(gpr_event_wait(&m->event, deadline) == NULL);
-    gpr_mu_lock(&m->mu);
-    m->counter++;
-    gpr_mu_unlock(&m->mu);
-  }
-  mark_thread_done(m);
-}
-
-/* Produce m->iterations elements on queue m->q, then mark thread as done.
-   Even threads use queue_append(), and odd threads use queue_try_append()
-   until it succeeds. */
-static void many_producers(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  int x = thread_id(m);
-  if ((x & 1) == 0) {
-    for (i = 0; i != m->iterations; i++) {
-      queue_append(&m->q, 1);
-    }
-  } else {
-    for (i = 0; i != m->iterations; i++) {
-      while (!queue_try_append(&m->q, 1)) {
-      }
-    }
-  }
-  mark_thread_done(m);
-}
-
-/* Consume elements from m->q until m->threads*m->iterations are seen,
-   wait an extra second to confirm that no more elements are arriving,
-   then mark thread as done. */
-static void consumer(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t n = m->iterations * m->threads;
-  int64_t i;
-  int value;
-  for (i = 0; i != n; i++) {
-    queue_remove(&m->q, &value, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  gpr_mu_lock(&m->mu);
-  m->counter = n;
-  gpr_mu_unlock(&m->mu);
-  GPR_ASSERT(
-      !queue_remove(&m->q, &value,
-                    gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                                 gpr_time_from_micros(1000000, GPR_TIMESPAN))));
-  mark_thread_done(m);
-}
-
-/* Increment m->stats_counter m->iterations times, transfer counter value to
-   m->counter, then mark thread as done.  */
-static void statsinc(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  for (i = 0; i != m->iterations; i++) {
-    gpr_stats_inc(&m->stats_counter, 1);
-  }
-  gpr_mu_lock(&m->mu);
-  m->counter = gpr_stats_read(&m->stats_counter);
-  gpr_mu_unlock(&m->mu);
-  mark_thread_done(m);
-}
-
-/* Increment m->refcount by m->incr_step for m->iterations times. Decrement
-   m->thread_refcount once, and if it reaches zero, set m->event to (void*)1;
-   then mark thread as done.  */
-static void refinc(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t i;
-  for (i = 0; i != m->iterations; i++) {
-    if (m->incr_step == 1) {
-      gpr_ref(&m->refcount);
-    } else {
-      gpr_refn(&m->refcount, m->incr_step);
-    }
-  }
-  if (gpr_unref(&m->thread_refcount)) {
-    gpr_event_set(&m->event, (void *)1);
-  }
-  mark_thread_done(m);
-}
-
-/* Wait until m->event is set to (void *)1, then decrement m->refcount by 1
-   (m->threads * m->iterations * m->incr_step) times, and ensure that the last
-   decrement caused the counter to reach zero, then mark thread as done.  */
-static void refcheck(void *v /*=m*/) {
-  struct test *m = v;
-  int64_t n = m->iterations * m->threads * m->incr_step;
-  int64_t i;
-  GPR_ASSERT(gpr_event_wait(&m->event, gpr_inf_future(GPR_CLOCK_REALTIME)) ==
-             (void *)1);
-  GPR_ASSERT(gpr_event_get(&m->event) == (void *)1);
-  for (i = 1; i != n; i++) {
-    GPR_ASSERT(!gpr_unref(&m->refcount));
-    m->counter++;
-  }
-  GPR_ASSERT(gpr_unref(&m->refcount));
-  m->counter++;
-  mark_thread_done(m);
-}
-
-/* ------------------------------------------------- */
-
-int main(int argc, char *argv[]) {
-  grpc_test_init(argc, argv);
-  test("mutex", &inc, NULL, 1, 1);
-  test("mutex try", &inctry, NULL, 1, 1);
-  test("cv", &inc_by_turns, NULL, 1, 1);
-  test("timedcv", &inc_with_1ms_delay, NULL, 1, 1);
-  test("queue", &many_producers, &consumer, 10, 1);
-  test("stats_counter", &statsinc, NULL, 1, 1);
-  test("refcount by 1", &refinc, &refcheck, 1, 1);
-  test("refcount by 3", &refinc, &refcheck, 1, 3); /* incr_step of 3 is an
-                                                      arbitrary choice. Any
-                                                      number > 1 is okay here */
-  test("timedevent", &inc_with_1ms_delay_event, NULL, 1, 1);
-  return 0;
-}
diff --git a/test/core/support/sync_test.cc b/test/core/support/sync_test.cc
new file mode 100644
index 0000000..416e94d
--- /dev/null
+++ b/test/core/support/sync_test.cc
@@ -0,0 +1,453 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* Test of gpr synchronization support. */
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "test/core/util/test_config.h"
+
+/* ==================Example use of interface===================
+
+   A producer-consumer queue of up to N integers,
+   illustrating the use of the calls in this interface.  */
+
+#define N 4
+
+typedef struct queue {
+  gpr_cv non_empty; /* Signalled when length becomes non-zero. */
+  gpr_cv non_full;  /* Signalled when length becomes non-N. */
+  gpr_mu mu;        /* Protects all fields below.
+                       (That is, except during initialization or
+                       destruction, the fields below should be accessed
+                       only by a thread that holds mu.) */
+  int head;         /* Index of head of queue 0..N-1. */
+  int length;       /* Number of valid elements in queue 0..N. */
+  int elem[N];      /* elem[head .. head+length-1] are queue elements. */
+} queue;
+
+/* Initialize *q. */
+void queue_init(queue* q) {
+  gpr_mu_init(&q->mu);
+  gpr_cv_init(&q->non_empty);
+  gpr_cv_init(&q->non_full);
+  q->head = 0;
+  q->length = 0;
+}
+
+/* Free storage associated with *q. */
+void queue_destroy(queue* q) {
+  gpr_mu_destroy(&q->mu);
+  gpr_cv_destroy(&q->non_empty);
+  gpr_cv_destroy(&q->non_full);
+}
+
+/* Wait until there is room in *q, then append x to *q. */
+void queue_append(queue* q, int x) {
+  gpr_mu_lock(&q->mu);
+  /* To wait for a predicate without a deadline, loop on the negation of the
+     predicate, and use gpr_cv_wait(..., gpr_inf_future(GPR_CLOCK_REALTIME))
+     inside the loop
+     to release the lock, wait, and reacquire on each iteration.  Code that
+     makes the condition true should use gpr_cv_broadcast() on the
+     corresponding condition variable.  The predicate must be on state
+     protected by the lock.  */
+  while (q->length == N) {
+    gpr_cv_wait(&q->non_full, &q->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+  }
+  if (q->length == 0) { /* Wake threads blocked in queue_remove(). */
+    /* It's normal to use gpr_cv_broadcast() or gpr_signal() while
+       holding the lock. */
+    gpr_cv_broadcast(&q->non_empty);
+  }
+  q->elem[(q->head + q->length) % N] = x;
+  q->length++;
+  gpr_mu_unlock(&q->mu);
+}
+
+/* If it can be done without blocking, append x to *q and return non-zero.
+   Otherwise return 0. */
+int queue_try_append(queue* q, int x) {
+  int result = 0;
+  if (gpr_mu_trylock(&q->mu)) {
+    if (q->length != N) {
+      if (q->length == 0) { /* Wake threads blocked in queue_remove(). */
+        gpr_cv_broadcast(&q->non_empty);
+      }
+      q->elem[(q->head + q->length) % N] = x;
+      q->length++;
+      result = 1;
+    }
+    gpr_mu_unlock(&q->mu);
+  }
+  return result;
+}
+
+/* Wait until the *q is non-empty or deadline abs_deadline passes.  If the
+   queue is non-empty, remove its head entry, place it in *head, and return
+   non-zero.  Otherwise return 0.  */
+int queue_remove(queue* q, int* head, gpr_timespec abs_deadline) {
+  int result = 0;
+  gpr_mu_lock(&q->mu);
+  /* To wait for a predicate with a deadline, loop on the negation of the
+     predicate or until gpr_cv_wait() returns true.  Code that makes
+     the condition true should use gpr_cv_broadcast() on the corresponding
+     condition variable.  The predicate must be on state protected by the
+     lock. */
+  while (q->length == 0 && !gpr_cv_wait(&q->non_empty, &q->mu, abs_deadline)) {
+  }
+  if (q->length != 0) { /* Queue is non-empty. */
+    result = 1;
+    if (q->length == N) { /* Wake threads blocked in queue_append(). */
+      gpr_cv_broadcast(&q->non_full);
+    }
+    *head = q->elem[q->head];
+    q->head = (q->head + 1) % N;
+    q->length--;
+  } /* else deadline exceeded */
+  gpr_mu_unlock(&q->mu);
+  return result;
+}
+
+/* ------------------------------------------------- */
+/* Tests for gpr_mu and gpr_cv, and the queue example. */
+struct test {
+  int threads; /* number of threads */
+
+  int64_t iterations; /* number of iterations per thread */
+  int64_t counter;
+  int thread_count; /* used to allocate thread ids */
+  int done;         /* threads not yet completed */
+  int incr_step;    /* how much to increment/decrement refcount each time */
+
+  gpr_mu mu; /* protects iterations, counter, thread_count, done */
+
+  gpr_cv cv; /* signalling depends on test */
+
+  gpr_cv done_cv; /* signalled when done == 0 */
+
+  queue q;
+
+  gpr_stats_counter stats_counter;
+
+  gpr_refcount refcount;
+  gpr_refcount thread_refcount;
+  gpr_event event;
+};
+
+/* Return pointer to a new struct test. */
+static struct test* test_new(int threads, int64_t iterations, int incr_step) {
+  struct test* m = static_cast<struct test*>(gpr_malloc(sizeof(*m)));
+  m->threads = threads;
+  m->iterations = iterations;
+  m->counter = 0;
+  m->thread_count = 0;
+  m->done = threads;
+  m->incr_step = incr_step;
+  gpr_mu_init(&m->mu);
+  gpr_cv_init(&m->cv);
+  gpr_cv_init(&m->done_cv);
+  queue_init(&m->q);
+  gpr_stats_init(&m->stats_counter, 0);
+  gpr_ref_init(&m->refcount, 0);
+  gpr_ref_init(&m->thread_refcount, threads);
+  gpr_event_init(&m->event);
+  return m;
+}
+
+/* Return pointer to a new struct test. */
+static void test_destroy(struct test* m) {
+  gpr_mu_destroy(&m->mu);
+  gpr_cv_destroy(&m->cv);
+  gpr_cv_destroy(&m->done_cv);
+  queue_destroy(&m->q);
+  gpr_free(m);
+}
+
+/* Create m->threads threads, each running (*body)(m) */
+static void test_create_threads(struct test* m, void (*body)(void* arg)) {
+  gpr_thd_id id;
+  int i;
+  for (i = 0; i != m->threads; i++) {
+    GPR_ASSERT(gpr_thd_new(&id, body, m, NULL));
+  }
+}
+
+/* Wait until all threads report done. */
+static void test_wait(struct test* m) {
+  gpr_mu_lock(&m->mu);
+  while (m->done != 0) {
+    gpr_cv_wait(&m->done_cv, &m->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+  }
+  gpr_mu_unlock(&m->mu);
+}
+
+/* Get an integer thread id in the raneg 0..threads-1 */
+static int thread_id(struct test* m) {
+  int id;
+  gpr_mu_lock(&m->mu);
+  id = m->thread_count++;
+  gpr_mu_unlock(&m->mu);
+  return id;
+}
+
+/* Indicate that a thread is done, by decrementing m->done
+   and signalling done_cv if m->done==0. */
+static void mark_thread_done(struct test* m) {
+  gpr_mu_lock(&m->mu);
+  GPR_ASSERT(m->done != 0);
+  m->done--;
+  if (m->done == 0) {
+    gpr_cv_signal(&m->done_cv);
+  }
+  gpr_mu_unlock(&m->mu);
+}
+
+/* Test several threads running (*body)(struct test *m) for increasing settings
+   of m->iterations, until about timeout_s to 2*timeout_s seconds have elapsed.
+   If extra!=NULL, run (*extra)(m) in an additional thread.
+   incr_step controls by how much m->refcount should be incremented/decremented
+   (if at all) each time in the tests.
+   */
+static void test(const char* name, void (*body)(void* m),
+                 void (*extra)(void* m), int timeout_s, int incr_step) {
+  int64_t iterations = 1024;
+  struct test* m;
+  gpr_timespec start = gpr_now(GPR_CLOCK_REALTIME);
+  gpr_timespec time_taken;
+  gpr_timespec deadline = gpr_time_add(
+      start, gpr_time_from_micros((int64_t)timeout_s * 1000000, GPR_TIMESPAN));
+  fprintf(stderr, "%s:", name);
+  while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0) {
+    iterations <<= 1;
+    fprintf(stderr, " %ld", (long)iterations);
+    m = test_new(10, iterations, incr_step);
+    if (extra != NULL) {
+      gpr_thd_id id;
+      GPR_ASSERT(gpr_thd_new(&id, extra, m, NULL));
+      m->done++; /* one more thread to wait for */
+    }
+    test_create_threads(m, body);
+    test_wait(m);
+    if (m->counter != m->threads * m->iterations * m->incr_step) {
+      fprintf(stderr, "counter %ld  threads %d  iterations %ld\n",
+              (long)m->counter, m->threads, (long)m->iterations);
+      GPR_ASSERT(0);
+    }
+    test_destroy(m);
+  }
+  time_taken = gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), start);
+  fprintf(stderr, " done %lld.%09d s\n", (long long)time_taken.tv_sec,
+          (int)time_taken.tv_nsec);
+}
+
+/* Increment m->counter on each iteration; then mark thread as done.  */
+static void inc(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  for (i = 0; i != m->iterations; i++) {
+    gpr_mu_lock(&m->mu);
+    m->counter++;
+    gpr_mu_unlock(&m->mu);
+  }
+  mark_thread_done(m);
+}
+
+/* Increment m->counter under lock acquired with trylock, m->iterations times;
+   then mark thread as done.  */
+static void inctry(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  for (i = 0; i != m->iterations;) {
+    if (gpr_mu_trylock(&m->mu)) {
+      m->counter++;
+      gpr_mu_unlock(&m->mu);
+      i++;
+    }
+  }
+  mark_thread_done(m);
+}
+
+/* Increment counter only when (m->counter%m->threads)==m->thread_id; then mark
+   thread as done.  */
+static void inc_by_turns(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  int id = thread_id(m);
+  for (i = 0; i != m->iterations; i++) {
+    gpr_mu_lock(&m->mu);
+    while ((m->counter % m->threads) != id) {
+      gpr_cv_wait(&m->cv, &m->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+    }
+    m->counter++;
+    gpr_cv_broadcast(&m->cv);
+    gpr_mu_unlock(&m->mu);
+  }
+  mark_thread_done(m);
+}
+
+/* Wait a millisecond and increment counter on each iteration;
+   then mark thread as done. */
+static void inc_with_1ms_delay(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  for (i = 0; i != m->iterations; i++) {
+    gpr_timespec deadline;
+    gpr_mu_lock(&m->mu);
+    deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                            gpr_time_from_micros(1000, GPR_TIMESPAN));
+    while (!gpr_cv_wait(&m->cv, &m->mu, deadline)) {
+    }
+    m->counter++;
+    gpr_mu_unlock(&m->mu);
+  }
+  mark_thread_done(m);
+}
+
+/* Wait a millisecond and increment counter on each iteration, using an event
+   for timing; then mark thread as done. */
+static void inc_with_1ms_delay_event(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  for (i = 0; i != m->iterations; i++) {
+    gpr_timespec deadline;
+    deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                            gpr_time_from_micros(1000, GPR_TIMESPAN));
+    GPR_ASSERT(gpr_event_wait(&m->event, deadline) == NULL);
+    gpr_mu_lock(&m->mu);
+    m->counter++;
+    gpr_mu_unlock(&m->mu);
+  }
+  mark_thread_done(m);
+}
+
+/* Produce m->iterations elements on queue m->q, then mark thread as done.
+   Even threads use queue_append(), and odd threads use queue_try_append()
+   until it succeeds. */
+static void many_producers(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  int x = thread_id(m);
+  if ((x & 1) == 0) {
+    for (i = 0; i != m->iterations; i++) {
+      queue_append(&m->q, 1);
+    }
+  } else {
+    for (i = 0; i != m->iterations; i++) {
+      while (!queue_try_append(&m->q, 1)) {
+      }
+    }
+  }
+  mark_thread_done(m);
+}
+
+/* Consume elements from m->q until m->threads*m->iterations are seen,
+   wait an extra second to confirm that no more elements are arriving,
+   then mark thread as done. */
+static void consumer(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t n = m->iterations * m->threads;
+  int64_t i;
+  int value;
+  for (i = 0; i != n; i++) {
+    queue_remove(&m->q, &value, gpr_inf_future(GPR_CLOCK_REALTIME));
+  }
+  gpr_mu_lock(&m->mu);
+  m->counter = n;
+  gpr_mu_unlock(&m->mu);
+  GPR_ASSERT(
+      !queue_remove(&m->q, &value,
+                    gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                                 gpr_time_from_micros(1000000, GPR_TIMESPAN))));
+  mark_thread_done(m);
+}
+
+/* Increment m->stats_counter m->iterations times, transfer counter value to
+   m->counter, then mark thread as done.  */
+static void statsinc(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  for (i = 0; i != m->iterations; i++) {
+    gpr_stats_inc(&m->stats_counter, 1);
+  }
+  gpr_mu_lock(&m->mu);
+  m->counter = gpr_stats_read(&m->stats_counter);
+  gpr_mu_unlock(&m->mu);
+  mark_thread_done(m);
+}
+
+/* Increment m->refcount by m->incr_step for m->iterations times. Decrement
+   m->thread_refcount once, and if it reaches zero, set m->event to (void*)1;
+   then mark thread as done.  */
+static void refinc(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t i;
+  for (i = 0; i != m->iterations; i++) {
+    if (m->incr_step == 1) {
+      gpr_ref(&m->refcount);
+    } else {
+      gpr_refn(&m->refcount, m->incr_step);
+    }
+  }
+  if (gpr_unref(&m->thread_refcount)) {
+    gpr_event_set(&m->event, (void*)1);
+  }
+  mark_thread_done(m);
+}
+
+/* Wait until m->event is set to (void *)1, then decrement m->refcount by 1
+   (m->threads * m->iterations * m->incr_step) times, and ensure that the last
+   decrement caused the counter to reach zero, then mark thread as done.  */
+static void refcheck(void* v /*=m*/) {
+  struct test* m = static_cast<struct test*>(v);
+  int64_t n = m->iterations * m->threads * m->incr_step;
+  int64_t i;
+  GPR_ASSERT(gpr_event_wait(&m->event, gpr_inf_future(GPR_CLOCK_REALTIME)) ==
+             (void*)1);
+  GPR_ASSERT(gpr_event_get(&m->event) == (void*)1);
+  for (i = 1; i != n; i++) {
+    GPR_ASSERT(!gpr_unref(&m->refcount));
+    m->counter++;
+  }
+  GPR_ASSERT(gpr_unref(&m->refcount));
+  m->counter++;
+  mark_thread_done(m);
+}
+
+/* ------------------------------------------------- */
+
+int main(int argc, char* argv[]) {
+  grpc_test_init(argc, argv);
+  test("mutex", &inc, NULL, 1, 1);
+  test("mutex try", &inctry, NULL, 1, 1);
+  test("cv", &inc_by_turns, NULL, 1, 1);
+  test("timedcv", &inc_with_1ms_delay, NULL, 1, 1);
+  test("queue", &many_producers, &consumer, 10, 1);
+  test("stats_counter", &statsinc, NULL, 1, 1);
+  test("refcount by 1", &refinc, &refcheck, 1, 1);
+  test("refcount by 3", &refinc, &refcheck, 1, 3); /* incr_step of 3 is an
+                                                      arbitrary choice. Any
+                                                      number > 1 is okay here */
+  test("timedevent", &inc_with_1ms_delay_event, NULL, 1, 1);
+  return 0;
+}
diff --git a/test/core/support/thd_test.c b/test/core/support/thd_test.c
deleted file mode 100644
index 2c578a2..0000000
--- a/test/core/support/thd_test.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* Test of gpr thread support. */
-
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "test/core/util/test_config.h"
-
-#define NUM_THREADS 300
-
-struct test {
-  gpr_mu mu;
-  int n;
-  int is_done;
-  gpr_cv done_cv;
-};
-
-/* A Thread body.   Decrement t->n, and if is becomes zero, set t->done. */
-static void thd_body(void *v) {
-  struct test *t = v;
-  gpr_mu_lock(&t->mu);
-  t->n--;
-  if (t->n == 0) {
-    t->is_done = 1;
-    gpr_cv_signal(&t->done_cv);
-  }
-  gpr_mu_unlock(&t->mu);
-}
-
-static void thd_body_joinable(void *v) {}
-
-/* Test thread options work as expected */
-static void test_options(void) {
-  gpr_thd_options options = gpr_thd_options_default();
-  GPR_ASSERT(!gpr_thd_options_is_joinable(&options));
-  GPR_ASSERT(gpr_thd_options_is_detached(&options));
-  gpr_thd_options_set_joinable(&options);
-  GPR_ASSERT(gpr_thd_options_is_joinable(&options));
-  GPR_ASSERT(!gpr_thd_options_is_detached(&options));
-  gpr_thd_options_set_detached(&options);
-  GPR_ASSERT(!gpr_thd_options_is_joinable(&options));
-  GPR_ASSERT(gpr_thd_options_is_detached(&options));
-}
-
-/* Test that we can create a number of threads and wait for them. */
-static void test(void) {
-  int i;
-  gpr_thd_id thd;
-  gpr_thd_id thds[NUM_THREADS];
-  struct test t;
-  gpr_thd_options options = gpr_thd_options_default();
-  gpr_mu_init(&t.mu);
-  gpr_cv_init(&t.done_cv);
-  t.n = NUM_THREADS;
-  t.is_done = 0;
-  for (i = 0; i < NUM_THREADS; i++) {
-    GPR_ASSERT(gpr_thd_new(&thd, &thd_body, &t, NULL));
-  }
-  gpr_mu_lock(&t.mu);
-  while (!t.is_done) {
-    gpr_cv_wait(&t.done_cv, &t.mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  gpr_mu_unlock(&t.mu);
-  GPR_ASSERT(t.n == 0);
-  gpr_thd_options_set_joinable(&options);
-  for (i = 0; i < NUM_THREADS; i++) {
-    GPR_ASSERT(gpr_thd_new(&thds[i], &thd_body_joinable, NULL, &options));
-  }
-  for (i = 0; i < NUM_THREADS; i++) {
-    gpr_thd_join(thds[i]);
-  }
-}
-
-/* ------------------------------------------------- */
-
-int main(int argc, char *argv[]) {
-  grpc_test_init(argc, argv);
-  test_options();
-  test();
-  return 0;
-}
diff --git a/test/core/support/thd_test.cc b/test/core/support/thd_test.cc
new file mode 100644
index 0000000..f70a3b4
--- /dev/null
+++ b/test/core/support/thd_test.cc
@@ -0,0 +1,101 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* Test of gpr thread support. */
+
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "test/core/util/test_config.h"
+
+#define NUM_THREADS 300
+
+struct test {
+  gpr_mu mu;
+  int n;
+  int is_done;
+  gpr_cv done_cv;
+};
+
+/* A Thread body.   Decrement t->n, and if is becomes zero, set t->done. */
+static void thd_body(void* v) {
+  struct test* t = static_cast<struct test*>(v);
+  gpr_mu_lock(&t->mu);
+  t->n--;
+  if (t->n == 0) {
+    t->is_done = 1;
+    gpr_cv_signal(&t->done_cv);
+  }
+  gpr_mu_unlock(&t->mu);
+}
+
+static void thd_body_joinable(void* v) {}
+
+/* Test thread options work as expected */
+static void test_options(void) {
+  gpr_thd_options options = gpr_thd_options_default();
+  GPR_ASSERT(!gpr_thd_options_is_joinable(&options));
+  GPR_ASSERT(gpr_thd_options_is_detached(&options));
+  gpr_thd_options_set_joinable(&options);
+  GPR_ASSERT(gpr_thd_options_is_joinable(&options));
+  GPR_ASSERT(!gpr_thd_options_is_detached(&options));
+  gpr_thd_options_set_detached(&options);
+  GPR_ASSERT(!gpr_thd_options_is_joinable(&options));
+  GPR_ASSERT(gpr_thd_options_is_detached(&options));
+}
+
+/* Test that we can create a number of threads and wait for them. */
+static void test(void) {
+  int i;
+  gpr_thd_id thd;
+  gpr_thd_id thds[NUM_THREADS];
+  struct test t;
+  gpr_thd_options options = gpr_thd_options_default();
+  gpr_mu_init(&t.mu);
+  gpr_cv_init(&t.done_cv);
+  t.n = NUM_THREADS;
+  t.is_done = 0;
+  for (i = 0; i < NUM_THREADS; i++) {
+    GPR_ASSERT(gpr_thd_new(&thd, &thd_body, &t, NULL));
+  }
+  gpr_mu_lock(&t.mu);
+  while (!t.is_done) {
+    gpr_cv_wait(&t.done_cv, &t.mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+  }
+  gpr_mu_unlock(&t.mu);
+  GPR_ASSERT(t.n == 0);
+  gpr_thd_options_set_joinable(&options);
+  for (i = 0; i < NUM_THREADS; i++) {
+    GPR_ASSERT(gpr_thd_new(&thds[i], &thd_body_joinable, NULL, &options));
+  }
+  for (i = 0; i < NUM_THREADS; i++) {
+    gpr_thd_join(thds[i]);
+  }
+}
+
+/* ------------------------------------------------- */
+
+int main(int argc, char* argv[]) {
+  grpc_test_init(argc, argv);
+  test_options();
+  test();
+  return 0;
+}
diff --git a/test/core/support/time_test.c b/test/core/support/time_test.c
deleted file mode 100644
index 74b5ef6..0000000
--- a/test/core/support/time_test.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* Test of gpr time support. */
-
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "test/core/util/test_config.h"
-
-static void to_fp(void *arg, const char *buf, size_t len) {
-  fwrite(buf, 1, len, (FILE *)arg);
-}
-
-/* Convert gpr_intmax x to ascii base b (2..16), and write with
-   (*writer)(arg, ...), zero padding to "chars" digits).  */
-static void i_to_s(intmax_t x, int base, int chars,
-                   void (*writer)(void *arg, const char *buf, size_t len),
-                   void *arg) {
-  char buf[64];
-  char fmt[32];
-  GPR_ASSERT(base == 16 || base == 10);
-  sprintf(fmt, "%%0%d%s", chars, base == 16 ? PRIxMAX : PRIdMAX);
-  sprintf(buf, fmt, x);
-  (*writer)(arg, buf, strlen(buf));
-}
-
-/* Convert ts to ascii, and write with (*writer)(arg, ...).  */
-static void ts_to_s(gpr_timespec t,
-                    void (*writer)(void *arg, const char *buf, size_t len),
-                    void *arg) {
-  if (t.tv_sec < 0 && t.tv_nsec != 0) {
-    t.tv_sec++;
-    t.tv_nsec = GPR_NS_PER_SEC - t.tv_nsec;
-  }
-  i_to_s(t.tv_sec, 10, 0, writer, arg);
-  (*writer)(arg, ".", 1);
-  i_to_s(t.tv_nsec, 10, 9, writer, arg);
-}
-
-static void test_values(void) {
-  int i;
-
-  gpr_timespec x = gpr_time_0(GPR_CLOCK_REALTIME);
-  GPR_ASSERT(x.tv_sec == 0 && x.tv_nsec == 0);
-
-  x = gpr_inf_future(GPR_CLOCK_REALTIME);
-  fprintf(stderr, "far future ");
-  i_to_s(x.tv_sec, 16, 16, &to_fp, stderr);
-  fprintf(stderr, "\n");
-  GPR_ASSERT(x.tv_sec == INT64_MAX);
-  fprintf(stderr, "far future ");
-  ts_to_s(x, &to_fp, stderr);
-  fprintf(stderr, "\n");
-
-  x = gpr_inf_past(GPR_CLOCK_REALTIME);
-  fprintf(stderr, "far past   ");
-  i_to_s(x.tv_sec, 16, 16, &to_fp, stderr);
-  fprintf(stderr, "\n");
-  GPR_ASSERT(x.tv_sec == INT64_MIN);
-  fprintf(stderr, "far past   ");
-  ts_to_s(x, &to_fp, stderr);
-  fprintf(stderr, "\n");
-
-  for (i = 1; i != 1000 * 1000 * 1000; i *= 10) {
-    x = gpr_time_from_micros(i, GPR_TIMESPAN);
-    GPR_ASSERT(x.tv_sec == i / GPR_US_PER_SEC &&
-               x.tv_nsec == (i % GPR_US_PER_SEC) * GPR_NS_PER_US);
-    x = gpr_time_from_nanos(i, GPR_TIMESPAN);
-    GPR_ASSERT(x.tv_sec == i / GPR_NS_PER_SEC &&
-               x.tv_nsec == (i % GPR_NS_PER_SEC));
-    x = gpr_time_from_millis(i, GPR_TIMESPAN);
-    GPR_ASSERT(x.tv_sec == i / GPR_MS_PER_SEC &&
-               x.tv_nsec == (i % GPR_MS_PER_SEC) * GPR_NS_PER_MS);
-  }
-
-  /* Test possible overflow in conversion of -ve values. */
-  x = gpr_time_from_micros(-(INT64_MAX - 999997), GPR_TIMESPAN);
-  GPR_ASSERT(x.tv_sec < 0);
-  GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC);
-
-  x = gpr_time_from_nanos(-(INT64_MAX - 999999997), GPR_TIMESPAN);
-  GPR_ASSERT(x.tv_sec < 0);
-  GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC);
-
-  x = gpr_time_from_millis(-(INT64_MAX - 997), GPR_TIMESPAN);
-  GPR_ASSERT(x.tv_sec < 0);
-  GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC);
-
-  /* Test general -ve values. */
-  for (i = -1; i > -1000 * 1000 * 1000; i *= 7) {
-    x = gpr_time_from_micros(i, GPR_TIMESPAN);
-    GPR_ASSERT(x.tv_sec * GPR_US_PER_SEC + x.tv_nsec / GPR_NS_PER_US == i);
-    x = gpr_time_from_nanos(i, GPR_TIMESPAN);
-    GPR_ASSERT(x.tv_sec * GPR_NS_PER_SEC + x.tv_nsec == i);
-    x = gpr_time_from_millis(i, GPR_TIMESPAN);
-    GPR_ASSERT(x.tv_sec * GPR_MS_PER_SEC + x.tv_nsec / GPR_NS_PER_MS == i);
-  }
-}
-
-static void test_add_sub(void) {
-  int i;
-  int j;
-  int k;
-  /* Basic addition and subtraction. */
-  for (i = -100; i <= 100; i++) {
-    for (j = -100; j <= 100; j++) {
-      for (k = 1; k <= 10000000; k *= 10) {
-        int sum = i + j;
-        int diff = i - j;
-        gpr_timespec it = gpr_time_from_micros(i * k, GPR_TIMESPAN);
-        gpr_timespec jt = gpr_time_from_micros(j * k, GPR_TIMESPAN);
-        gpr_timespec sumt = gpr_time_add(it, jt);
-        gpr_timespec difft = gpr_time_sub(it, jt);
-        if (gpr_time_cmp(gpr_time_from_micros(sum * k, GPR_TIMESPAN), sumt) !=
-            0) {
-          fprintf(stderr, "i %d  j %d  sum %d    sumt ", i, j, sum);
-          ts_to_s(sumt, &to_fp, stderr);
-          fprintf(stderr, "\n");
-          GPR_ASSERT(0);
-        }
-        if (gpr_time_cmp(gpr_time_from_micros(diff * k, GPR_TIMESPAN), difft) !=
-            0) {
-          fprintf(stderr, "i %d  j %d  diff %d    diff ", i, j, diff);
-          ts_to_s(sumt, &to_fp, stderr);
-          fprintf(stderr, "\n");
-          GPR_ASSERT(0);
-        }
-      }
-    }
-  }
-}
-
-static void test_overflow(void) {
-  /* overflow */
-  gpr_timespec x = gpr_time_from_micros(1, GPR_TIMESPAN);
-  do {
-    x = gpr_time_add(x, x);
-  } while (gpr_time_cmp(x, gpr_inf_future(GPR_TIMESPAN)) < 0);
-  GPR_ASSERT(gpr_time_cmp(x, gpr_inf_future(GPR_TIMESPAN)) == 0);
-  x = gpr_time_from_micros(-1, GPR_TIMESPAN);
-  do {
-    x = gpr_time_add(x, x);
-  } while (gpr_time_cmp(x, gpr_inf_past(GPR_TIMESPAN)) > 0);
-  GPR_ASSERT(gpr_time_cmp(x, gpr_inf_past(GPR_TIMESPAN)) == 0);
-}
-
-static void test_sticky_infinities(void) {
-  int i;
-  int j;
-  int k;
-  gpr_timespec infinity[2];
-  gpr_timespec addend[3];
-  infinity[0] = gpr_inf_future(GPR_TIMESPAN);
-  infinity[1] = gpr_inf_past(GPR_TIMESPAN);
-  addend[0] = gpr_inf_future(GPR_TIMESPAN);
-  addend[1] = gpr_inf_past(GPR_TIMESPAN);
-  addend[2] = gpr_time_0(GPR_TIMESPAN);
-
-  /* Infinities are sticky */
-  for (i = 0; i != sizeof(infinity) / sizeof(infinity[0]); i++) {
-    for (j = 0; j != sizeof(addend) / sizeof(addend[0]); j++) {
-      gpr_timespec x = gpr_time_add(infinity[i], addend[j]);
-      GPR_ASSERT(gpr_time_cmp(x, infinity[i]) == 0);
-      x = gpr_time_sub(infinity[i], addend[j]);
-      GPR_ASSERT(gpr_time_cmp(x, infinity[i]) == 0);
-    }
-    for (k = -200; k <= 200; k++) {
-      gpr_timespec y = gpr_time_from_micros(k * 100000, GPR_TIMESPAN);
-      gpr_timespec x = gpr_time_add(infinity[i], y);
-      GPR_ASSERT(gpr_time_cmp(x, infinity[i]) == 0);
-      x = gpr_time_sub(infinity[i], y);
-      GPR_ASSERT(gpr_time_cmp(x, infinity[i]) == 0);
-    }
-  }
-}
-
-static void test_similar(void) {
-  GPR_ASSERT(1 == gpr_time_similar(gpr_inf_future(GPR_TIMESPAN),
-                                   gpr_inf_future(GPR_TIMESPAN),
-                                   gpr_time_0(GPR_TIMESPAN)));
-  GPR_ASSERT(1 == gpr_time_similar(gpr_inf_past(GPR_TIMESPAN),
-                                   gpr_inf_past(GPR_TIMESPAN),
-                                   gpr_time_0(GPR_TIMESPAN)));
-  GPR_ASSERT(0 == gpr_time_similar(gpr_inf_past(GPR_TIMESPAN),
-                                   gpr_inf_future(GPR_TIMESPAN),
-                                   gpr_time_0(GPR_TIMESPAN)));
-  GPR_ASSERT(0 == gpr_time_similar(gpr_inf_future(GPR_TIMESPAN),
-                                   gpr_inf_past(GPR_TIMESPAN),
-                                   gpr_time_0(GPR_TIMESPAN)));
-  GPR_ASSERT(1 == gpr_time_similar(gpr_time_from_micros(10, GPR_TIMESPAN),
-                                   gpr_time_from_micros(10, GPR_TIMESPAN),
-                                   gpr_time_0(GPR_TIMESPAN)));
-  GPR_ASSERT(1 == gpr_time_similar(gpr_time_from_micros(10, GPR_TIMESPAN),
-                                   gpr_time_from_micros(15, GPR_TIMESPAN),
-                                   gpr_time_from_micros(10, GPR_TIMESPAN)));
-  GPR_ASSERT(1 == gpr_time_similar(gpr_time_from_micros(15, GPR_TIMESPAN),
-                                   gpr_time_from_micros(10, GPR_TIMESPAN),
-                                   gpr_time_from_micros(10, GPR_TIMESPAN)));
-  GPR_ASSERT(0 == gpr_time_similar(gpr_time_from_micros(10, GPR_TIMESPAN),
-                                   gpr_time_from_micros(25, GPR_TIMESPAN),
-                                   gpr_time_from_micros(10, GPR_TIMESPAN)));
-  GPR_ASSERT(0 == gpr_time_similar(gpr_time_from_micros(25, GPR_TIMESPAN),
-                                   gpr_time_from_micros(10, GPR_TIMESPAN),
-                                   gpr_time_from_micros(10, GPR_TIMESPAN)));
-}
-
-static void test_convert_extreme(void) {
-  gpr_timespec realtime = {INT64_MAX, 1, GPR_CLOCK_REALTIME};
-  gpr_timespec monotime = gpr_convert_clock_type(realtime, GPR_CLOCK_MONOTONIC);
-  GPR_ASSERT(monotime.tv_sec == realtime.tv_sec);
-  GPR_ASSERT(monotime.clock_type == GPR_CLOCK_MONOTONIC);
-}
-
-static void test_cmp_extreme(void) {
-  gpr_timespec t1 = {INT64_MAX, 1, GPR_CLOCK_REALTIME};
-  gpr_timespec t2 = {INT64_MAX, 2, GPR_CLOCK_REALTIME};
-  GPR_ASSERT(gpr_time_cmp(t1, t2) == 0);
-  t1.tv_sec = INT64_MIN;
-  t2.tv_sec = INT64_MIN;
-  GPR_ASSERT(gpr_time_cmp(t1, t2) == 0);
-}
-
-int main(int argc, char *argv[]) {
-  grpc_test_init(argc, argv);
-
-  test_values();
-  test_add_sub();
-  test_overflow();
-  test_sticky_infinities();
-  test_similar();
-  test_convert_extreme();
-  test_cmp_extreme();
-  return 0;
-}
diff --git a/test/core/support/time_test.cc b/test/core/support/time_test.cc
new file mode 100644
index 0000000..6081692
--- /dev/null
+++ b/test/core/support/time_test.cc
@@ -0,0 +1,255 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* Test of gpr time support. */
+
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "test/core/util/test_config.h"
+
+static void to_fp(void* arg, const char* buf, size_t len) {
+  fwrite(buf, 1, len, (FILE*)arg);
+}
+
+/* Convert gpr_intmax x to ascii base b (2..16), and write with
+   (*writer)(arg, ...), zero padding to "chars" digits).  */
+static void i_to_s(intmax_t x, int base, int chars,
+                   void (*writer)(void* arg, const char* buf, size_t len),
+                   void* arg) {
+  char buf[64];
+  char fmt[32];
+  GPR_ASSERT(base == 16 || base == 10);
+  sprintf(fmt, "%%0%d%s", chars, base == 16 ? PRIxMAX : PRIdMAX);
+  sprintf(buf, fmt, x);
+  (*writer)(arg, buf, strlen(buf));
+}
+
+/* Convert ts to ascii, and write with (*writer)(arg, ...).  */
+static void ts_to_s(gpr_timespec t,
+                    void (*writer)(void* arg, const char* buf, size_t len),
+                    void* arg) {
+  if (t.tv_sec < 0 && t.tv_nsec != 0) {
+    t.tv_sec++;
+    t.tv_nsec = GPR_NS_PER_SEC - t.tv_nsec;
+  }
+  i_to_s(t.tv_sec, 10, 0, writer, arg);
+  (*writer)(arg, ".", 1);
+  i_to_s(t.tv_nsec, 10, 9, writer, arg);
+}
+
+static void test_values(void) {
+  int i;
+
+  gpr_timespec x = gpr_time_0(GPR_CLOCK_REALTIME);
+  GPR_ASSERT(x.tv_sec == 0 && x.tv_nsec == 0);
+
+  x = gpr_inf_future(GPR_CLOCK_REALTIME);
+  fprintf(stderr, "far future ");
+  i_to_s(x.tv_sec, 16, 16, &to_fp, stderr);
+  fprintf(stderr, "\n");
+  GPR_ASSERT(x.tv_sec == INT64_MAX);
+  fprintf(stderr, "far future ");
+  ts_to_s(x, &to_fp, stderr);
+  fprintf(stderr, "\n");
+
+  x = gpr_inf_past(GPR_CLOCK_REALTIME);
+  fprintf(stderr, "far past   ");
+  i_to_s(x.tv_sec, 16, 16, &to_fp, stderr);
+  fprintf(stderr, "\n");
+  GPR_ASSERT(x.tv_sec == INT64_MIN);
+  fprintf(stderr, "far past   ");
+  ts_to_s(x, &to_fp, stderr);
+  fprintf(stderr, "\n");
+
+  for (i = 1; i != 1000 * 1000 * 1000; i *= 10) {
+    x = gpr_time_from_micros(i, GPR_TIMESPAN);
+    GPR_ASSERT(x.tv_sec == i / GPR_US_PER_SEC &&
+               x.tv_nsec == (i % GPR_US_PER_SEC) * GPR_NS_PER_US);
+    x = gpr_time_from_nanos(i, GPR_TIMESPAN);
+    GPR_ASSERT(x.tv_sec == i / GPR_NS_PER_SEC &&
+               x.tv_nsec == (i % GPR_NS_PER_SEC));
+    x = gpr_time_from_millis(i, GPR_TIMESPAN);
+    GPR_ASSERT(x.tv_sec == i / GPR_MS_PER_SEC &&
+               x.tv_nsec == (i % GPR_MS_PER_SEC) * GPR_NS_PER_MS);
+  }
+
+  /* Test possible overflow in conversion of -ve values. */
+  x = gpr_time_from_micros(-(INT64_MAX - 999997), GPR_TIMESPAN);
+  GPR_ASSERT(x.tv_sec < 0);
+  GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC);
+
+  x = gpr_time_from_nanos(-(INT64_MAX - 999999997), GPR_TIMESPAN);
+  GPR_ASSERT(x.tv_sec < 0);
+  GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC);
+
+  x = gpr_time_from_millis(-(INT64_MAX - 997), GPR_TIMESPAN);
+  GPR_ASSERT(x.tv_sec < 0);
+  GPR_ASSERT(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC);
+
+  /* Test general -ve values. */
+  for (i = -1; i > -1000 * 1000 * 1000; i *= 7) {
+    x = gpr_time_from_micros(i, GPR_TIMESPAN);
+    GPR_ASSERT(x.tv_sec * GPR_US_PER_SEC + x.tv_nsec / GPR_NS_PER_US == i);
+    x = gpr_time_from_nanos(i, GPR_TIMESPAN);
+    GPR_ASSERT(x.tv_sec * GPR_NS_PER_SEC + x.tv_nsec == i);
+    x = gpr_time_from_millis(i, GPR_TIMESPAN);
+    GPR_ASSERT(x.tv_sec * GPR_MS_PER_SEC + x.tv_nsec / GPR_NS_PER_MS == i);
+  }
+}
+
+static void test_add_sub(void) {
+  int i;
+  int j;
+  int k;
+  /* Basic addition and subtraction. */
+  for (i = -100; i <= 100; i++) {
+    for (j = -100; j <= 100; j++) {
+      for (k = 1; k <= 10000000; k *= 10) {
+        int sum = i + j;
+        int diff = i - j;
+        gpr_timespec it = gpr_time_from_micros(i * k, GPR_TIMESPAN);
+        gpr_timespec jt = gpr_time_from_micros(j * k, GPR_TIMESPAN);
+        gpr_timespec sumt = gpr_time_add(it, jt);
+        gpr_timespec difft = gpr_time_sub(it, jt);
+        if (gpr_time_cmp(gpr_time_from_micros(sum * k, GPR_TIMESPAN), sumt) !=
+            0) {
+          fprintf(stderr, "i %d  j %d  sum %d    sumt ", i, j, sum);
+          ts_to_s(sumt, &to_fp, stderr);
+          fprintf(stderr, "\n");
+          GPR_ASSERT(0);
+        }
+        if (gpr_time_cmp(gpr_time_from_micros(diff * k, GPR_TIMESPAN), difft) !=
+            0) {
+          fprintf(stderr, "i %d  j %d  diff %d    diff ", i, j, diff);
+          ts_to_s(sumt, &to_fp, stderr);
+          fprintf(stderr, "\n");
+          GPR_ASSERT(0);
+        }
+      }
+    }
+  }
+}
+
+static void test_overflow(void) {
+  /* overflow */
+  gpr_timespec x = gpr_time_from_micros(1, GPR_TIMESPAN);
+  do {
+    x = gpr_time_add(x, x);
+  } while (gpr_time_cmp(x, gpr_inf_future(GPR_TIMESPAN)) < 0);
+  GPR_ASSERT(gpr_time_cmp(x, gpr_inf_future(GPR_TIMESPAN)) == 0);
+  x = gpr_time_from_micros(-1, GPR_TIMESPAN);
+  do {
+    x = gpr_time_add(x, x);
+  } while (gpr_time_cmp(x, gpr_inf_past(GPR_TIMESPAN)) > 0);
+  GPR_ASSERT(gpr_time_cmp(x, gpr_inf_past(GPR_TIMESPAN)) == 0);
+}
+
+static void test_sticky_infinities(void) {
+  int i;
+  int j;
+  int k;
+  gpr_timespec infinity[2];
+  gpr_timespec addend[3];
+  infinity[0] = gpr_inf_future(GPR_TIMESPAN);
+  infinity[1] = gpr_inf_past(GPR_TIMESPAN);
+  addend[0] = gpr_inf_future(GPR_TIMESPAN);
+  addend[1] = gpr_inf_past(GPR_TIMESPAN);
+  addend[2] = gpr_time_0(GPR_TIMESPAN);
+
+  /* Infinities are sticky */
+  for (i = 0; i != sizeof(infinity) / sizeof(infinity[0]); i++) {
+    for (j = 0; j != sizeof(addend) / sizeof(addend[0]); j++) {
+      gpr_timespec x = gpr_time_add(infinity[i], addend[j]);
+      GPR_ASSERT(gpr_time_cmp(x, infinity[i]) == 0);
+      x = gpr_time_sub(infinity[i], addend[j]);
+      GPR_ASSERT(gpr_time_cmp(x, infinity[i]) == 0);
+    }
+    for (k = -200; k <= 200; k++) {
+      gpr_timespec y = gpr_time_from_micros(k * 100000, GPR_TIMESPAN);
+      gpr_timespec x = gpr_time_add(infinity[i], y);
+      GPR_ASSERT(gpr_time_cmp(x, infinity[i]) == 0);
+      x = gpr_time_sub(infinity[i], y);
+      GPR_ASSERT(gpr_time_cmp(x, infinity[i]) == 0);
+    }
+  }
+}
+
+static void test_similar(void) {
+  GPR_ASSERT(1 == gpr_time_similar(gpr_inf_future(GPR_TIMESPAN),
+                                   gpr_inf_future(GPR_TIMESPAN),
+                                   gpr_time_0(GPR_TIMESPAN)));
+  GPR_ASSERT(1 == gpr_time_similar(gpr_inf_past(GPR_TIMESPAN),
+                                   gpr_inf_past(GPR_TIMESPAN),
+                                   gpr_time_0(GPR_TIMESPAN)));
+  GPR_ASSERT(0 == gpr_time_similar(gpr_inf_past(GPR_TIMESPAN),
+                                   gpr_inf_future(GPR_TIMESPAN),
+                                   gpr_time_0(GPR_TIMESPAN)));
+  GPR_ASSERT(0 == gpr_time_similar(gpr_inf_future(GPR_TIMESPAN),
+                                   gpr_inf_past(GPR_TIMESPAN),
+                                   gpr_time_0(GPR_TIMESPAN)));
+  GPR_ASSERT(1 == gpr_time_similar(gpr_time_from_micros(10, GPR_TIMESPAN),
+                                   gpr_time_from_micros(10, GPR_TIMESPAN),
+                                   gpr_time_0(GPR_TIMESPAN)));
+  GPR_ASSERT(1 == gpr_time_similar(gpr_time_from_micros(10, GPR_TIMESPAN),
+                                   gpr_time_from_micros(15, GPR_TIMESPAN),
+                                   gpr_time_from_micros(10, GPR_TIMESPAN)));
+  GPR_ASSERT(1 == gpr_time_similar(gpr_time_from_micros(15, GPR_TIMESPAN),
+                                   gpr_time_from_micros(10, GPR_TIMESPAN),
+                                   gpr_time_from_micros(10, GPR_TIMESPAN)));
+  GPR_ASSERT(0 == gpr_time_similar(gpr_time_from_micros(10, GPR_TIMESPAN),
+                                   gpr_time_from_micros(25, GPR_TIMESPAN),
+                                   gpr_time_from_micros(10, GPR_TIMESPAN)));
+  GPR_ASSERT(0 == gpr_time_similar(gpr_time_from_micros(25, GPR_TIMESPAN),
+                                   gpr_time_from_micros(10, GPR_TIMESPAN),
+                                   gpr_time_from_micros(10, GPR_TIMESPAN)));
+}
+
+static void test_convert_extreme(void) {
+  gpr_timespec realtime = {INT64_MAX, 1, GPR_CLOCK_REALTIME};
+  gpr_timespec monotime = gpr_convert_clock_type(realtime, GPR_CLOCK_MONOTONIC);
+  GPR_ASSERT(monotime.tv_sec == realtime.tv_sec);
+  GPR_ASSERT(monotime.clock_type == GPR_CLOCK_MONOTONIC);
+}
+
+static void test_cmp_extreme(void) {
+  gpr_timespec t1 = {INT64_MAX, 1, GPR_CLOCK_REALTIME};
+  gpr_timespec t2 = {INT64_MAX, 2, GPR_CLOCK_REALTIME};
+  GPR_ASSERT(gpr_time_cmp(t1, t2) == 0);
+  t1.tv_sec = INT64_MIN;
+  t2.tv_sec = INT64_MIN;
+  GPR_ASSERT(gpr_time_cmp(t1, t2) == 0);
+}
+
+int main(int argc, char* argv[]) {
+  grpc_test_init(argc, argv);
+
+  test_values();
+  test_add_sub();
+  test_overflow();
+  test_sticky_infinities();
+  test_similar();
+  test_convert_extreme();
+  test_cmp_extreme();
+  return 0;
+}
diff --git a/test/core/support/tls_test.c b/test/core/support/tls_test.c
deleted file mode 100644
index 5529d5c..0000000
--- a/test/core/support/tls_test.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* Test of gpr thread local storage support. */
-
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/tls.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "test/core/util/test_config.h"
-
-#define NUM_THREADS 100
-
-GPR_TLS_DECL(test_var);
-
-static void thd_body(void *arg) {
-  intptr_t i;
-
-  GPR_ASSERT(gpr_tls_get(&test_var) == 0);
-
-  for (i = 0; i < 100000; i++) {
-    gpr_tls_set(&test_var, i);
-    GPR_ASSERT(gpr_tls_get(&test_var) == i);
-  }
-  gpr_tls_set(&test_var, 0);
-}
-
-/* ------------------------------------------------- */
-
-int main(int argc, char *argv[]) {
-  gpr_thd_options opt = gpr_thd_options_default();
-  int i;
-  gpr_thd_id threads[NUM_THREADS];
-
-  grpc_test_init(argc, argv);
-
-  gpr_tls_init(&test_var);
-
-  gpr_thd_options_set_joinable(&opt);
-
-  for (i = 0; i < NUM_THREADS; i++) {
-    gpr_thd_new(&threads[i], thd_body, NULL, &opt);
-  }
-  for (i = 0; i < NUM_THREADS; i++) {
-    gpr_thd_join(threads[i]);
-  }
-
-  gpr_tls_destroy(&test_var);
-
-  return 0;
-}
diff --git a/test/core/support/tls_test.cc b/test/core/support/tls_test.cc
new file mode 100644
index 0000000..b1b4737
--- /dev/null
+++ b/test/core/support/tls_test.cc
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* Test of gpr thread local storage support. */
+
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/tls.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "test/core/util/test_config.h"
+
+#define NUM_THREADS 100
+
+GPR_TLS_DECL(test_var);
+
+static void thd_body(void* arg) {
+  intptr_t i;
+
+  GPR_ASSERT(gpr_tls_get(&test_var) == 0);
+
+  for (i = 0; i < 100000; i++) {
+    gpr_tls_set(&test_var, i);
+    GPR_ASSERT(gpr_tls_get(&test_var) == i);
+  }
+  gpr_tls_set(&test_var, 0);
+}
+
+/* ------------------------------------------------- */
+
+int main(int argc, char* argv[]) {
+  gpr_thd_options opt = gpr_thd_options_default();
+  int i;
+  gpr_thd_id threads[NUM_THREADS];
+
+  grpc_test_init(argc, argv);
+
+  gpr_tls_init(&test_var);
+
+  gpr_thd_options_set_joinable(&opt);
+
+  for (i = 0; i < NUM_THREADS; i++) {
+    gpr_thd_new(&threads[i], thd_body, NULL, &opt);
+  }
+  for (i = 0; i < NUM_THREADS; i++) {
+    gpr_thd_join(threads[i]);
+  }
+
+  gpr_tls_destroy(&test_var);
+
+  return 0;
+}
diff --git a/test/core/support/useful_test.c b/test/core/support/useful_test.c
deleted file mode 100644
index 2f84f48..0000000
--- a/test/core/support/useful_test.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/useful.h>
-#include "test/core/util/test_config.h"
-
-int main(int argc, char **argv) {
-  int four[4];
-  int five[5];
-  uint32_t bitset = 0;
-  grpc_test_init(argc, argv);
-
-  GPR_ASSERT(GPR_MIN(1, 2) == 1);
-  GPR_ASSERT(GPR_MAX(1, 2) == 2);
-  GPR_ASSERT(GPR_MIN(2, 1) == 1);
-  GPR_ASSERT(GPR_MAX(2, 1) == 2);
-  GPR_ASSERT(GPR_CLAMP(1, 0, 2) == 1);
-  GPR_ASSERT(GPR_CLAMP(0, 0, 2) == 0);
-  GPR_ASSERT(GPR_CLAMP(2, 0, 2) == 2);
-  GPR_ASSERT(GPR_CLAMP(-1, 0, 2) == 0);
-  GPR_ASSERT(GPR_CLAMP(3, 0, 2) == 2);
-  GPR_ASSERT(GPR_ROTL((uint32_t)0x80000001, 1) == 3);
-  GPR_ASSERT(GPR_ROTR((uint32_t)0x80000001, 1) == 0xc0000000);
-  GPR_ASSERT(GPR_ARRAY_SIZE(four) == 4);
-  GPR_ASSERT(GPR_ARRAY_SIZE(five) == 5);
-
-  GPR_ASSERT(GPR_BITCOUNT((1u << 31) - 1) == 31);
-  GPR_ASSERT(GPR_BITCOUNT(1u << 3) == 1);
-  GPR_ASSERT(GPR_BITCOUNT(0) == 0);
-
-  GPR_ASSERT(GPR_BITSET(&bitset, 3) == 8);
-  GPR_ASSERT(GPR_BITCOUNT(bitset) == 1);
-  GPR_ASSERT(GPR_BITGET(bitset, 3) == 1);
-  GPR_ASSERT(GPR_BITSET(&bitset, 1) == 10);
-  GPR_ASSERT(GPR_BITCOUNT(bitset) == 2);
-  GPR_ASSERT(GPR_BITCLEAR(&bitset, 3) == 2);
-  GPR_ASSERT(GPR_BITCOUNT(bitset) == 1);
-  GPR_ASSERT(GPR_BITGET(bitset, 3) == 0);
-
-  return 0;
-}
diff --git a/test/core/support/useful_test.cc b/test/core/support/useful_test.cc
new file mode 100644
index 0000000..2f86010
--- /dev/null
+++ b/test/core/support/useful_test.cc
@@ -0,0 +1,58 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/log.h>
+#include <grpc/support/port_platform.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/test_config.h"
+
+int main(int argc, char** argv) {
+  int four[4];
+  int five[5];
+  uint32_t bitset = 0;
+  grpc_test_init(argc, argv);
+
+  GPR_ASSERT(GPR_MIN(1, 2) == 1);
+  GPR_ASSERT(GPR_MAX(1, 2) == 2);
+  GPR_ASSERT(GPR_MIN(2, 1) == 1);
+  GPR_ASSERT(GPR_MAX(2, 1) == 2);
+  GPR_ASSERT(GPR_CLAMP(1, 0, 2) == 1);
+  GPR_ASSERT(GPR_CLAMP(0, 0, 2) == 0);
+  GPR_ASSERT(GPR_CLAMP(2, 0, 2) == 2);
+  GPR_ASSERT(GPR_CLAMP(-1, 0, 2) == 0);
+  GPR_ASSERT(GPR_CLAMP(3, 0, 2) == 2);
+  GPR_ASSERT(GPR_ROTL((uint32_t)0x80000001, 1) == 3);
+  GPR_ASSERT(GPR_ROTR((uint32_t)0x80000001, 1) == 0xc0000000);
+  GPR_ASSERT(GPR_ARRAY_SIZE(four) == 4);
+  GPR_ASSERT(GPR_ARRAY_SIZE(five) == 5);
+
+  GPR_ASSERT(GPR_BITCOUNT((1u << 31) - 1) == 31);
+  GPR_ASSERT(GPR_BITCOUNT(1u << 3) == 1);
+  GPR_ASSERT(GPR_BITCOUNT(0) == 0);
+
+  GPR_ASSERT(GPR_BITSET(&bitset, 3) == 8);
+  GPR_ASSERT(GPR_BITCOUNT(bitset) == 1);
+  GPR_ASSERT(GPR_BITGET(bitset, 3) == 1);
+  GPR_ASSERT(GPR_BITSET(&bitset, 1) == 10);
+  GPR_ASSERT(GPR_BITCOUNT(bitset) == 2);
+  GPR_ASSERT(GPR_BITCLEAR(&bitset, 3) == 2);
+  GPR_ASSERT(GPR_BITCOUNT(bitset) == 1);
+  GPR_ASSERT(GPR_BITGET(bitset, 3) == 0);
+
+  return 0;
+}
diff --git a/test/core/surface/BUILD b/test/core/surface/BUILD
index 17db773..6cec7fe 100644
--- a/test/core/surface/BUILD
+++ b/test/core/surface/BUILD
@@ -20,8 +20,8 @@
 
 grpc_cc_test(
     name = "alarm_test",
-    srcs = ["alarm_test.c"],
-    language = "C",
+    srcs = ["alarm_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -32,8 +32,8 @@
 
 grpc_cc_test(
     name = "grpc_byte_buffer_reader_test",
-    srcs = ["byte_buffer_reader_test.c"],
-    language = "C",
+    srcs = ["byte_buffer_reader_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -44,8 +44,8 @@
 
 grpc_cc_test(
     name = "channel_create_test",
-    srcs = ["channel_create_test.c"],
-    language = "C",
+    srcs = ["channel_create_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -56,8 +56,8 @@
 
 grpc_cc_test(
     name = "grpc_completion_queue_test",
-    srcs = ["completion_queue_test.c"],
-    language = "C",
+    srcs = ["completion_queue_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -68,8 +68,8 @@
 
 grpc_cc_test(
     name = "concurrent_connectivity_test",
-    srcs = ["concurrent_connectivity_test.c"],
-    language = "C",
+    srcs = ["concurrent_connectivity_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -80,8 +80,8 @@
 
 grpc_cc_test(
     name = "init_test",
-    srcs = ["init_test.c"],
-    language = "C",
+    srcs = ["init_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -92,8 +92,8 @@
 
 grpc_cc_test(
     name = "grpc_invalid_channel_args_test",
-    srcs = ["invalid_channel_args_test.c"],
-    language = "C",
+    srcs = ["invalid_channel_args_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -104,8 +104,8 @@
 
 grpc_cc_test(
     name = "lame_client_test",
-    srcs = ["lame_client_test.c"],
-    language = "C",
+    srcs = ["lame_client_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -129,8 +129,8 @@
 
 grpc_cc_test(
     name = "secure_channel_create_test",
-    srcs = ["secure_channel_create_test.c"],
-    language = "C",
+    srcs = ["secure_channel_create_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -141,8 +141,8 @@
 
 grpc_cc_test(
     name = "sequential_connectivity_test",
-    srcs = ["sequential_connectivity_test.c"],
-    language = "C",
+    srcs = ["sequential_connectivity_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -154,8 +154,8 @@
 
 grpc_cc_test(
     name = "server_chttp2_test",
-    srcs = ["server_chttp2_test.c"],
-    language = "C",
+    srcs = ["server_chttp2_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -166,8 +166,8 @@
 
 grpc_cc_test(
     name = "server_test",
-    srcs = ["server_test.c"],
-    language = "C",
+    srcs = ["server_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/surface/alarm_test.c b/test/core/surface/alarm_test.c
deleted file mode 100644
index 4fd7cb9..0000000
--- a/test/core/surface/alarm_test.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
-
-static void *create_test_tag(void) {
-  static intptr_t i = 0;
-  return (void *)(++i);
-}
-
-/* helper for tests to shutdown correctly and tersely */
-static void shutdown_and_destroy(grpc_completion_queue *cc) {
-  grpc_event ev;
-  grpc_completion_queue_shutdown(cc);
-  ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-  GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
-  grpc_completion_queue_destroy(cc);
-}
-
-static void test_alarm(void) {
-  grpc_completion_queue *cc;
-
-  LOG_TEST("test_alarm");
-  cc = grpc_completion_queue_create_for_next(NULL);
-  {
-    /* regular expiry */
-    grpc_event ev;
-    void *tag = create_test_tag();
-    grpc_alarm *alarm = grpc_alarm_create(NULL);
-    grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(1), tag, NULL);
-
-    ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(2),
-                                    NULL);
-    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-    GPR_ASSERT(ev.tag == tag);
-    GPR_ASSERT(ev.success);
-    grpc_alarm_destroy(alarm, NULL);
-  }
-  {
-    /* cancellation */
-    grpc_event ev;
-    void *tag = create_test_tag();
-    grpc_alarm *alarm = grpc_alarm_create(NULL);
-    grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, NULL);
-
-    grpc_alarm_cancel(alarm, NULL);
-    ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1),
-                                    NULL);
-    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-    GPR_ASSERT(ev.tag == tag);
-    GPR_ASSERT(ev.success == 0);
-    grpc_alarm_destroy(alarm, NULL);
-  }
-  {
-    /* alarm_destroy before cq_next */
-    grpc_event ev;
-    void *tag = create_test_tag();
-    grpc_alarm *alarm = grpc_alarm_create(NULL);
-    grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, NULL);
-
-    grpc_alarm_destroy(alarm, NULL);
-    ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1),
-                                    NULL);
-    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-    GPR_ASSERT(ev.tag == tag);
-    GPR_ASSERT(ev.success == 0);
-  }
-  {
-    /* alarm_destroy before set */
-    grpc_alarm *alarm = grpc_alarm_create(NULL);
-    grpc_alarm_destroy(alarm, NULL);
-  }
-
-  shutdown_and_destroy(cc);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_alarm();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/surface/alarm_test.cc b/test/core/surface/alarm_test.cc
new file mode 100644
index 0000000..88b0b31
--- /dev/null
+++ b/test/core/surface/alarm_test.cc
@@ -0,0 +1,105 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
+
+static void* create_test_tag(void) {
+  static intptr_t i = 0;
+  return (void*)(++i);
+}
+
+/* helper for tests to shutdown correctly and tersely */
+static void shutdown_and_destroy(grpc_completion_queue* cc) {
+  grpc_event ev;
+  grpc_completion_queue_shutdown(cc);
+  ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+  GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
+  grpc_completion_queue_destroy(cc);
+}
+
+static void test_alarm(void) {
+  grpc_completion_queue* cc;
+
+  LOG_TEST("test_alarm");
+  cc = grpc_completion_queue_create_for_next(NULL);
+  {
+    /* regular expiry */
+    grpc_event ev;
+    void* tag = create_test_tag();
+    grpc_alarm* alarm = grpc_alarm_create(NULL);
+    grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(1), tag, NULL);
+
+    ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(2),
+                                    NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+    GPR_ASSERT(ev.tag == tag);
+    GPR_ASSERT(ev.success);
+    grpc_alarm_destroy(alarm, NULL);
+  }
+  {
+    /* cancellation */
+    grpc_event ev;
+    void* tag = create_test_tag();
+    grpc_alarm* alarm = grpc_alarm_create(NULL);
+    grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, NULL);
+
+    grpc_alarm_cancel(alarm, NULL);
+    ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1),
+                                    NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+    GPR_ASSERT(ev.tag == tag);
+    GPR_ASSERT(ev.success == 0);
+    grpc_alarm_destroy(alarm, NULL);
+  }
+  {
+    /* alarm_destroy before cq_next */
+    grpc_event ev;
+    void* tag = create_test_tag();
+    grpc_alarm* alarm = grpc_alarm_create(NULL);
+    grpc_alarm_set(alarm, cc, grpc_timeout_seconds_to_deadline(2), tag, NULL);
+
+    grpc_alarm_destroy(alarm, NULL);
+    ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1),
+                                    NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+    GPR_ASSERT(ev.tag == tag);
+    GPR_ASSERT(ev.success == 0);
+  }
+  {
+    /* alarm_destroy before set */
+    grpc_alarm* alarm = grpc_alarm_create(NULL);
+    grpc_alarm_destroy(alarm, NULL);
+  }
+
+  shutdown_and_destroy(cc);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_alarm();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/surface/byte_buffer_reader_test.c b/test/core/surface/byte_buffer_reader_test.c
deleted file mode 100644
index a6b4c86..0000000
--- a/test/core/surface/byte_buffer_reader_test.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/byte_buffer.h>
-#include <grpc/byte_buffer_reader.h>
-#include <grpc/grpc.h>
-#include <grpc/slice.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/compression/message_compress.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "test/core/util/test_config.h"
-
-#include <string.h>
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
-
-static void test_read_one_slice(void) {
-  grpc_slice slice;
-  grpc_byte_buffer *buffer;
-  grpc_byte_buffer_reader reader;
-  grpc_slice first_slice, second_slice;
-  int first_code, second_code;
-
-  LOG_TEST("test_read_one_slice");
-  slice = grpc_slice_from_copied_string("test");
-  buffer = grpc_raw_byte_buffer_create(&slice, 1);
-  grpc_slice_unref(slice);
-  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
-             "Couldn't init byte buffer reader");
-  first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
-  GPR_ASSERT(first_code != 0);
-  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(first_slice), "test", 4) == 0);
-  grpc_slice_unref(first_slice);
-  second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
-  GPR_ASSERT(second_code == 0);
-  grpc_byte_buffer_destroy(buffer);
-}
-
-static void test_read_one_slice_malloc(void) {
-  grpc_slice slice;
-  grpc_byte_buffer *buffer;
-  grpc_byte_buffer_reader reader;
-  grpc_slice first_slice, second_slice;
-  int first_code, second_code;
-
-  LOG_TEST("test_read_one_slice_malloc");
-  slice = grpc_slice_malloc(4);
-  memcpy(GRPC_SLICE_START_PTR(slice), "test", 4);
-  buffer = grpc_raw_byte_buffer_create(&slice, 1);
-  grpc_slice_unref(slice);
-  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
-             "Couldn't init byte buffer reader");
-  first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
-  GPR_ASSERT(first_code != 0);
-  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(first_slice), "test", 4) == 0);
-  grpc_slice_unref(first_slice);
-  second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
-  GPR_ASSERT(second_code == 0);
-  grpc_byte_buffer_destroy(buffer);
-}
-
-static void test_read_none_compressed_slice(void) {
-  grpc_slice slice;
-  grpc_byte_buffer *buffer;
-  grpc_byte_buffer_reader reader;
-  grpc_slice first_slice, second_slice;
-  int first_code, second_code;
-
-  LOG_TEST("test_read_none_compressed_slice");
-  slice = grpc_slice_from_copied_string("test");
-  buffer = grpc_raw_byte_buffer_create(&slice, 1);
-  grpc_slice_unref(slice);
-  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
-             "Couldn't init byte buffer reader");
-  first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
-  GPR_ASSERT(first_code != 0);
-  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(first_slice), "test", 4) == 0);
-  grpc_slice_unref(first_slice);
-  second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
-  GPR_ASSERT(second_code == 0);
-  grpc_byte_buffer_destroy(buffer);
-}
-
-static void test_read_corrupted_slice(void) {
-  grpc_slice slice;
-  grpc_byte_buffer *buffer;
-  grpc_byte_buffer_reader reader;
-
-  LOG_TEST("test_read_corrupted_slice");
-  slice = grpc_slice_from_copied_string("test");
-  buffer = grpc_raw_byte_buffer_create(&slice, 1);
-  buffer->data.raw.compression = GRPC_COMPRESS_GZIP; /* lies! */
-  grpc_slice_unref(slice);
-  GPR_ASSERT(!grpc_byte_buffer_reader_init(&reader, buffer));
-  grpc_byte_buffer_destroy(buffer);
-}
-
-static void read_compressed_slice(grpc_compression_algorithm algorithm,
-                                  size_t input_size) {
-  grpc_slice input_slice;
-  grpc_slice_buffer sliceb_in;
-  grpc_slice_buffer sliceb_out;
-  grpc_byte_buffer *buffer;
-  grpc_byte_buffer_reader reader;
-  grpc_slice read_slice;
-  size_t read_count = 0;
-
-  grpc_slice_buffer_init(&sliceb_in);
-  grpc_slice_buffer_init(&sliceb_out);
-
-  input_slice = grpc_slice_malloc(input_size);
-  memset(GRPC_SLICE_START_PTR(input_slice), 'a', input_size);
-  grpc_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    GPR_ASSERT(
-        grpc_msg_compress(&exec_ctx, algorithm, &sliceb_in, &sliceb_out));
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  buffer = grpc_raw_compressed_byte_buffer_create(sliceb_out.slices,
-                                                  sliceb_out.count, algorithm);
-  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
-             "Couldn't init byte buffer reader");
-
-  while (grpc_byte_buffer_reader_next(&reader, &read_slice)) {
-    GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(read_slice),
-                      GRPC_SLICE_START_PTR(input_slice) + read_count,
-                      GRPC_SLICE_LENGTH(read_slice)) == 0);
-    read_count += GRPC_SLICE_LENGTH(read_slice);
-    grpc_slice_unref(read_slice);
-  }
-  GPR_ASSERT(read_count == input_size);
-  grpc_byte_buffer_reader_destroy(&reader);
-  grpc_byte_buffer_destroy(buffer);
-  grpc_slice_buffer_destroy(&sliceb_out);
-  grpc_slice_buffer_destroy(&sliceb_in);
-}
-
-static void test_read_gzip_compressed_slice(void) {
-  const size_t INPUT_SIZE = 2048;
-  LOG_TEST("test_read_gzip_compressed_slice");
-  read_compressed_slice(GRPC_COMPRESS_GZIP, INPUT_SIZE);
-}
-
-static void test_read_deflate_compressed_slice(void) {
-  const size_t INPUT_SIZE = 2048;
-  LOG_TEST("test_read_deflate_compressed_slice");
-  read_compressed_slice(GRPC_COMPRESS_DEFLATE, INPUT_SIZE);
-}
-
-static void test_byte_buffer_from_reader(void) {
-  grpc_slice slice;
-  grpc_byte_buffer *buffer, *buffer_from_reader;
-  grpc_byte_buffer_reader reader;
-
-  LOG_TEST("test_byte_buffer_from_reader");
-  slice = grpc_slice_malloc(4);
-  memcpy(GRPC_SLICE_START_PTR(slice), "test", 4);
-  buffer = grpc_raw_byte_buffer_create(&slice, 1);
-  grpc_slice_unref(slice);
-  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
-             "Couldn't init byte buffer reader");
-
-  buffer_from_reader = grpc_raw_byte_buffer_from_reader(&reader);
-  GPR_ASSERT(buffer->type == buffer_from_reader->type);
-  GPR_ASSERT(buffer_from_reader->data.raw.compression == GRPC_COMPRESS_NONE);
-  GPR_ASSERT(buffer_from_reader->data.raw.slice_buffer.count == 1);
-  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(
-                        buffer_from_reader->data.raw.slice_buffer.slices[0]),
-                    "test", 4) == 0);
-
-  grpc_byte_buffer_destroy(buffer);
-  grpc_byte_buffer_destroy(buffer_from_reader);
-}
-
-static void test_readall(void) {
-  char *lotsa_as[512];
-  char *lotsa_bs[1024];
-  grpc_slice slices[2];
-  grpc_byte_buffer *buffer;
-  grpc_byte_buffer_reader reader;
-  grpc_slice slice_out;
-
-  LOG_TEST("test_readall");
-
-  memset(lotsa_as, 'a', 512);
-  memset(lotsa_bs, 'b', 1024);
-  /* use slices large enough to overflow inlining */
-  slices[0] = grpc_slice_malloc(512);
-  memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512);
-  slices[1] = grpc_slice_malloc(1024);
-  memcpy(GRPC_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
-
-  buffer = grpc_raw_byte_buffer_create(slices, 2);
-  grpc_slice_unref(slices[0]);
-  grpc_slice_unref(slices[1]);
-
-  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
-             "Couldn't init byte buffer reader");
-  slice_out = grpc_byte_buffer_reader_readall(&reader);
-
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_out) == 512 + 1024);
-  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
-  GPR_ASSERT(memcmp(&(GRPC_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
-             0);
-  grpc_slice_unref(slice_out);
-  grpc_byte_buffer_destroy(buffer);
-}
-
-static void test_byte_buffer_copy(void) {
-  char *lotsa_as[512];
-  char *lotsa_bs[1024];
-  grpc_slice slices[2];
-  grpc_byte_buffer *buffer;
-  grpc_byte_buffer *copied_buffer;
-  grpc_byte_buffer_reader reader;
-  grpc_slice slice_out;
-
-  LOG_TEST("test_byte_buffer_copy");
-
-  memset(lotsa_as, 'a', 512);
-  memset(lotsa_bs, 'b', 1024);
-  /* use slices large enough to overflow inlining */
-  slices[0] = grpc_slice_malloc(512);
-  memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512);
-  slices[1] = grpc_slice_malloc(1024);
-  memcpy(GRPC_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
-
-  buffer = grpc_raw_byte_buffer_create(slices, 2);
-  grpc_slice_unref(slices[0]);
-  grpc_slice_unref(slices[1]);
-  copied_buffer = grpc_byte_buffer_copy(buffer);
-
-  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
-             "Couldn't init byte buffer reader");
-  slice_out = grpc_byte_buffer_reader_readall(&reader);
-
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_out) == 512 + 1024);
-  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
-  GPR_ASSERT(memcmp(&(GRPC_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
-             0);
-  grpc_slice_unref(slice_out);
-  grpc_byte_buffer_destroy(buffer);
-  grpc_byte_buffer_destroy(copied_buffer);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_read_one_slice();
-  test_read_one_slice_malloc();
-  test_read_none_compressed_slice();
-  test_read_gzip_compressed_slice();
-  test_read_deflate_compressed_slice();
-  test_read_corrupted_slice();
-  test_byte_buffer_from_reader();
-  test_byte_buffer_copy();
-  test_readall();
-  return 0;
-}
diff --git a/test/core/surface/byte_buffer_reader_test.cc b/test/core/surface/byte_buffer_reader_test.cc
new file mode 100644
index 0000000..e5d2d7c
--- /dev/null
+++ b/test/core/surface/byte_buffer_reader_test.cc
@@ -0,0 +1,280 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
+#include <grpc/grpc.h>
+#include <grpc/slice.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/compression/message_compress.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "test/core/util/test_config.h"
+
+#include <string.h>
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
+
+static void test_read_one_slice(void) {
+  grpc_slice slice;
+  grpc_byte_buffer* buffer;
+  grpc_byte_buffer_reader reader;
+  grpc_slice first_slice, second_slice;
+  int first_code, second_code;
+
+  LOG_TEST("test_read_one_slice");
+  slice = grpc_slice_from_copied_string("test");
+  buffer = grpc_raw_byte_buffer_create(&slice, 1);
+  grpc_slice_unref(slice);
+  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
+             "Couldn't init byte buffer reader");
+  first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
+  GPR_ASSERT(first_code != 0);
+  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(first_slice), "test", 4) == 0);
+  grpc_slice_unref(first_slice);
+  second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
+  GPR_ASSERT(second_code == 0);
+  grpc_byte_buffer_destroy(buffer);
+}
+
+static void test_read_one_slice_malloc(void) {
+  grpc_slice slice;
+  grpc_byte_buffer* buffer;
+  grpc_byte_buffer_reader reader;
+  grpc_slice first_slice, second_slice;
+  int first_code, second_code;
+
+  LOG_TEST("test_read_one_slice_malloc");
+  slice = grpc_slice_malloc(4);
+  memcpy(GRPC_SLICE_START_PTR(slice), "test", 4);
+  buffer = grpc_raw_byte_buffer_create(&slice, 1);
+  grpc_slice_unref(slice);
+  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
+             "Couldn't init byte buffer reader");
+  first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
+  GPR_ASSERT(first_code != 0);
+  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(first_slice), "test", 4) == 0);
+  grpc_slice_unref(first_slice);
+  second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
+  GPR_ASSERT(second_code == 0);
+  grpc_byte_buffer_destroy(buffer);
+}
+
+static void test_read_none_compressed_slice(void) {
+  grpc_slice slice;
+  grpc_byte_buffer* buffer;
+  grpc_byte_buffer_reader reader;
+  grpc_slice first_slice, second_slice;
+  int first_code, second_code;
+
+  LOG_TEST("test_read_none_compressed_slice");
+  slice = grpc_slice_from_copied_string("test");
+  buffer = grpc_raw_byte_buffer_create(&slice, 1);
+  grpc_slice_unref(slice);
+  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
+             "Couldn't init byte buffer reader");
+  first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
+  GPR_ASSERT(first_code != 0);
+  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(first_slice), "test", 4) == 0);
+  grpc_slice_unref(first_slice);
+  second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
+  GPR_ASSERT(second_code == 0);
+  grpc_byte_buffer_destroy(buffer);
+}
+
+static void test_read_corrupted_slice(void) {
+  grpc_slice slice;
+  grpc_byte_buffer* buffer;
+  grpc_byte_buffer_reader reader;
+
+  LOG_TEST("test_read_corrupted_slice");
+  slice = grpc_slice_from_copied_string("test");
+  buffer = grpc_raw_byte_buffer_create(&slice, 1);
+  buffer->data.raw.compression = GRPC_COMPRESS_GZIP; /* lies! */
+  grpc_slice_unref(slice);
+  GPR_ASSERT(!grpc_byte_buffer_reader_init(&reader, buffer));
+  grpc_byte_buffer_destroy(buffer);
+}
+
+static void read_compressed_slice(grpc_compression_algorithm algorithm,
+                                  size_t input_size) {
+  grpc_slice input_slice;
+  grpc_slice_buffer sliceb_in;
+  grpc_slice_buffer sliceb_out;
+  grpc_byte_buffer* buffer;
+  grpc_byte_buffer_reader reader;
+  grpc_slice read_slice;
+  size_t read_count = 0;
+
+  grpc_slice_buffer_init(&sliceb_in);
+  grpc_slice_buffer_init(&sliceb_out);
+
+  input_slice = grpc_slice_malloc(input_size);
+  memset(GRPC_SLICE_START_PTR(input_slice), 'a', input_size);
+  grpc_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    GPR_ASSERT(
+        grpc_msg_compress(&exec_ctx, algorithm, &sliceb_in, &sliceb_out));
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  buffer = grpc_raw_compressed_byte_buffer_create(sliceb_out.slices,
+                                                  sliceb_out.count, algorithm);
+  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
+             "Couldn't init byte buffer reader");
+
+  while (grpc_byte_buffer_reader_next(&reader, &read_slice)) {
+    GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(read_slice),
+                      GRPC_SLICE_START_PTR(input_slice) + read_count,
+                      GRPC_SLICE_LENGTH(read_slice)) == 0);
+    read_count += GRPC_SLICE_LENGTH(read_slice);
+    grpc_slice_unref(read_slice);
+  }
+  GPR_ASSERT(read_count == input_size);
+  grpc_byte_buffer_reader_destroy(&reader);
+  grpc_byte_buffer_destroy(buffer);
+  grpc_slice_buffer_destroy(&sliceb_out);
+  grpc_slice_buffer_destroy(&sliceb_in);
+}
+
+static void test_read_gzip_compressed_slice(void) {
+  const size_t INPUT_SIZE = 2048;
+  LOG_TEST("test_read_gzip_compressed_slice");
+  read_compressed_slice(GRPC_COMPRESS_GZIP, INPUT_SIZE);
+}
+
+static void test_read_deflate_compressed_slice(void) {
+  const size_t INPUT_SIZE = 2048;
+  LOG_TEST("test_read_deflate_compressed_slice");
+  read_compressed_slice(GRPC_COMPRESS_DEFLATE, INPUT_SIZE);
+}
+
+static void test_byte_buffer_from_reader(void) {
+  grpc_slice slice;
+  grpc_byte_buffer *buffer, *buffer_from_reader;
+  grpc_byte_buffer_reader reader;
+
+  LOG_TEST("test_byte_buffer_from_reader");
+  slice = grpc_slice_malloc(4);
+  memcpy(GRPC_SLICE_START_PTR(slice), "test", 4);
+  buffer = grpc_raw_byte_buffer_create(&slice, 1);
+  grpc_slice_unref(slice);
+  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
+             "Couldn't init byte buffer reader");
+
+  buffer_from_reader = grpc_raw_byte_buffer_from_reader(&reader);
+  GPR_ASSERT(buffer->type == buffer_from_reader->type);
+  GPR_ASSERT(buffer_from_reader->data.raw.compression == GRPC_COMPRESS_NONE);
+  GPR_ASSERT(buffer_from_reader->data.raw.slice_buffer.count == 1);
+  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(
+                        buffer_from_reader->data.raw.slice_buffer.slices[0]),
+                    "test", 4) == 0);
+
+  grpc_byte_buffer_destroy(buffer);
+  grpc_byte_buffer_destroy(buffer_from_reader);
+}
+
+static void test_readall(void) {
+  char* lotsa_as[512];
+  char* lotsa_bs[1024];
+  grpc_slice slices[2];
+  grpc_byte_buffer* buffer;
+  grpc_byte_buffer_reader reader;
+  grpc_slice slice_out;
+
+  LOG_TEST("test_readall");
+
+  memset(lotsa_as, 'a', 512);
+  memset(lotsa_bs, 'b', 1024);
+  /* use slices large enough to overflow inlining */
+  slices[0] = grpc_slice_malloc(512);
+  memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512);
+  slices[1] = grpc_slice_malloc(1024);
+  memcpy(GRPC_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
+
+  buffer = grpc_raw_byte_buffer_create(slices, 2);
+  grpc_slice_unref(slices[0]);
+  grpc_slice_unref(slices[1]);
+
+  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
+             "Couldn't init byte buffer reader");
+  slice_out = grpc_byte_buffer_reader_readall(&reader);
+
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_out) == 512 + 1024);
+  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
+  GPR_ASSERT(memcmp(&(GRPC_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
+             0);
+  grpc_slice_unref(slice_out);
+  grpc_byte_buffer_destroy(buffer);
+}
+
+static void test_byte_buffer_copy(void) {
+  char* lotsa_as[512];
+  char* lotsa_bs[1024];
+  grpc_slice slices[2];
+  grpc_byte_buffer* buffer;
+  grpc_byte_buffer* copied_buffer;
+  grpc_byte_buffer_reader reader;
+  grpc_slice slice_out;
+
+  LOG_TEST("test_byte_buffer_copy");
+
+  memset(lotsa_as, 'a', 512);
+  memset(lotsa_bs, 'b', 1024);
+  /* use slices large enough to overflow inlining */
+  slices[0] = grpc_slice_malloc(512);
+  memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512);
+  slices[1] = grpc_slice_malloc(1024);
+  memcpy(GRPC_SLICE_START_PTR(slices[1]), lotsa_bs, 1024);
+
+  buffer = grpc_raw_byte_buffer_create(slices, 2);
+  grpc_slice_unref(slices[0]);
+  grpc_slice_unref(slices[1]);
+  copied_buffer = grpc_byte_buffer_copy(buffer);
+
+  GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, buffer) &&
+             "Couldn't init byte buffer reader");
+  slice_out = grpc_byte_buffer_reader_readall(&reader);
+
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice_out) == 512 + 1024);
+  GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(slice_out), lotsa_as, 512) == 0);
+  GPR_ASSERT(memcmp(&(GRPC_SLICE_START_PTR(slice_out)[512]), lotsa_bs, 1024) ==
+             0);
+  grpc_slice_unref(slice_out);
+  grpc_byte_buffer_destroy(buffer);
+  grpc_byte_buffer_destroy(copied_buffer);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_read_one_slice();
+  test_read_one_slice_malloc();
+  test_read_none_compressed_slice();
+  test_read_gzip_compressed_slice();
+  test_read_deflate_compressed_slice();
+  test_read_corrupted_slice();
+  test_byte_buffer_from_reader();
+  test_byte_buffer_copy();
+  test_readall();
+  return 0;
+}
diff --git a/test/core/surface/channel_create_test.c b/test/core/surface/channel_create_test.c
deleted file mode 100644
index a688475..0000000
--- a/test/core/surface/channel_create_test.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/surface/channel.h"
-#include "test/core/util/test_config.h"
-
-void test_unknown_scheme_target(void) {
-  grpc_channel *chan;
-  /* avoid default prefix */
-  grpc_resolver_registry_shutdown();
-  grpc_resolver_registry_init();
-
-  chan = grpc_insecure_channel_create("blah://blah", NULL, NULL);
-  GPR_ASSERT(chan != NULL);
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_channel_element *elem =
-      grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0);
-  GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client"));
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  grpc_channel_destroy(chan);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_unknown_scheme_target();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/surface/channel_create_test.cc b/test/core/surface/channel_create_test.cc
new file mode 100644
index 0000000..4627c57
--- /dev/null
+++ b/test/core/surface/channel_create_test.cc
@@ -0,0 +1,53 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/surface/channel.h"
+#include "test/core/util/test_config.h"
+
+void test_unknown_scheme_target(void) {
+  grpc_channel* chan;
+  /* avoid default prefix */
+  grpc_resolver_registry_shutdown();
+  grpc_resolver_registry_init();
+
+  chan = grpc_insecure_channel_create("blah://blah", NULL, NULL);
+  GPR_ASSERT(chan != NULL);
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_channel_element* elem =
+      grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0);
+  GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client"));
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  grpc_channel_destroy(chan);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_unknown_scheme_target();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c
deleted file mode 100644
index e6372a3..0000000
--- a/test/core/surface/completion_queue_test.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/surface/completion_queue.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/iomgr/iomgr.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
-
-static void *create_test_tag(void) {
-  static intptr_t i = 0;
-  return (void *)(++i);
-}
-
-/* helper for tests to shutdown correctly and tersely */
-static void shutdown_and_destroy(grpc_completion_queue *cc) {
-  grpc_event ev;
-  grpc_completion_queue_shutdown(cc);
-
-  switch (grpc_get_cq_completion_type(cc)) {
-    case GRPC_CQ_NEXT: {
-      ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME),
-                                      NULL);
-      break;
-    }
-    case GRPC_CQ_PLUCK: {
-      ev = grpc_completion_queue_pluck(cc, create_test_tag(),
-                                       gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-      break;
-    }
-    default: {
-      gpr_log(GPR_ERROR, "Unknown completion type");
-      break;
-    }
-  }
-
-  GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
-  grpc_completion_queue_destroy(cc);
-}
-
-/* ensure we can create and destroy a completion channel */
-static void test_no_op(void) {
-  grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK};
-  grpc_cq_polling_type polling_types[] = {
-      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
-  grpc_completion_queue_attributes attr;
-  LOG_TEST("test_no_op");
-
-  attr.version = 1;
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) {
-    for (size_t j = 0; j < GPR_ARRAY_SIZE(polling_types); j++) {
-      attr.cq_completion_type = completion_types[i];
-      attr.cq_polling_type = polling_types[j];
-      shutdown_and_destroy(grpc_completion_queue_create(
-          grpc_completion_queue_factory_lookup(&attr), &attr, NULL));
-    }
-  }
-}
-
-static void test_pollset_conversion(void) {
-  grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK};
-  grpc_cq_polling_type polling_types[] = {GRPC_CQ_DEFAULT_POLLING,
-                                          GRPC_CQ_NON_LISTENING};
-  grpc_completion_queue *cq;
-  grpc_completion_queue_attributes attr;
-
-  LOG_TEST("test_pollset_conversion");
-
-  attr.version = 1;
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) {
-    for (size_t j = 0; j < GPR_ARRAY_SIZE(polling_types); j++) {
-      attr.cq_completion_type = completion_types[i];
-      attr.cq_polling_type = polling_types[j];
-      cq = grpc_completion_queue_create(
-          grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-      GPR_ASSERT(grpc_cq_pollset(cq) != NULL);
-      shutdown_and_destroy(cq);
-    }
-  }
-}
-
-static void test_wait_empty(void) {
-  grpc_cq_polling_type polling_types[] = {
-      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
-  grpc_completion_queue *cc;
-  grpc_completion_queue_attributes attr;
-  grpc_event event;
-
-  LOG_TEST("test_wait_empty");
-
-  attr.version = 1;
-  attr.cq_completion_type = GRPC_CQ_NEXT;
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
-    attr.cq_polling_type = polling_types[i];
-    cc = grpc_completion_queue_create(
-        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-    event = grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT);
-    shutdown_and_destroy(cc);
-  }
-}
-
-static void do_nothing_end_completion(grpc_exec_ctx *exec_ctx, void *arg,
-                                      grpc_cq_completion *c) {}
-
-static void test_cq_end_op(void) {
-  grpc_event ev;
-  grpc_completion_queue *cc;
-  grpc_cq_completion completion;
-  grpc_cq_polling_type polling_types[] = {
-      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
-  grpc_completion_queue_attributes attr;
-  grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_exec_ctx exec_ctx;
-  void *tag = create_test_tag();
-
-  LOG_TEST("test_cq_end_op");
-
-  attr.version = 1;
-  attr.cq_completion_type = GRPC_CQ_NEXT;
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
-    exec_ctx = init_exec_ctx;  // Reset exec_ctx
-    attr.cq_polling_type = polling_types[i];
-    cc = grpc_completion_queue_create(
-        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-
-    GPR_ASSERT(grpc_cq_begin_op(cc, tag));
-    grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE,
-                   do_nothing_end_completion, NULL, &completion);
-
-    ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-    GPR_ASSERT(ev.tag == tag);
-    GPR_ASSERT(ev.success);
-
-    shutdown_and_destroy(cc);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static void test_shutdown_then_next_polling(void) {
-  grpc_cq_polling_type polling_types[] = {
-      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
-  grpc_completion_queue *cc;
-  grpc_completion_queue_attributes attr;
-  grpc_event event;
-  LOG_TEST("test_shutdown_then_next_polling");
-
-  attr.version = 1;
-  attr.cq_completion_type = GRPC_CQ_NEXT;
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
-    attr.cq_polling_type = polling_types[i];
-    cc = grpc_completion_queue_create(
-        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-    grpc_completion_queue_shutdown(cc);
-    event =
-        grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN);
-    grpc_completion_queue_destroy(cc);
-  }
-}
-
-static void test_shutdown_then_next_with_timeout(void) {
-  grpc_cq_polling_type polling_types[] = {
-      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
-  grpc_completion_queue *cc;
-  grpc_completion_queue_attributes attr;
-  grpc_event event;
-  LOG_TEST("test_shutdown_then_next_with_timeout");
-
-  attr.version = 1;
-  attr.cq_completion_type = GRPC_CQ_NEXT;
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
-    attr.cq_polling_type = polling_types[i];
-    cc = grpc_completion_queue_create(
-        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-
-    grpc_completion_queue_shutdown(cc);
-    event = grpc_completion_queue_next(cc, gpr_inf_future(GPR_CLOCK_REALTIME),
-                                       NULL);
-    GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN);
-    grpc_completion_queue_destroy(cc);
-  }
-}
-
-static void test_pluck(void) {
-  grpc_event ev;
-  grpc_completion_queue *cc;
-  void *tags[128];
-  grpc_cq_completion completions[GPR_ARRAY_SIZE(tags)];
-  grpc_cq_polling_type polling_types[] = {
-      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
-  grpc_completion_queue_attributes attr;
-  grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_exec_ctx exec_ctx;
-  unsigned i, j;
-
-  LOG_TEST("test_pluck");
-
-  for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
-    tags[i] = create_test_tag();
-    for (j = 0; j < i; j++) {
-      GPR_ASSERT(tags[i] != tags[j]);
-    }
-  }
-
-  attr.version = 1;
-  attr.cq_completion_type = GRPC_CQ_PLUCK;
-  for (size_t pidx = 0; pidx < GPR_ARRAY_SIZE(polling_types); pidx++) {
-    exec_ctx = init_exec_ctx;  // reset exec_ctx
-    attr.cq_polling_type = polling_types[pidx];
-    cc = grpc_completion_queue_create(
-        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-
-    for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
-      GPR_ASSERT(grpc_cq_begin_op(cc, tags[i]));
-      grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE,
-                     do_nothing_end_completion, NULL, &completions[i]);
-    }
-
-    for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
-      ev = grpc_completion_queue_pluck(cc, tags[i],
-                                       gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-      GPR_ASSERT(ev.tag == tags[i]);
-    }
-
-    for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
-      GPR_ASSERT(grpc_cq_begin_op(cc, tags[i]));
-      grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE,
-                     do_nothing_end_completion, NULL, &completions[i]);
-    }
-
-    for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
-      ev = grpc_completion_queue_pluck(cc, tags[GPR_ARRAY_SIZE(tags) - i - 1],
-                                       gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-      GPR_ASSERT(ev.tag == tags[GPR_ARRAY_SIZE(tags) - i - 1]);
-    }
-
-    shutdown_and_destroy(cc);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-}
-
-static void test_pluck_after_shutdown(void) {
-  grpc_cq_polling_type polling_types[] = {
-      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
-  grpc_event ev;
-  grpc_completion_queue *cc;
-  grpc_completion_queue_attributes attr;
-
-  LOG_TEST("test_pluck_after_shutdown");
-
-  attr.version = 1;
-  attr.cq_completion_type = GRPC_CQ_PLUCK;
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
-    attr.cq_polling_type = polling_types[i];
-    cc = grpc_completion_queue_create(
-        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
-    grpc_completion_queue_shutdown(cc);
-    ev = grpc_completion_queue_pluck(cc, NULL,
-                                     gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-    GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
-    grpc_completion_queue_destroy(cc);
-  }
-}
-
-struct thread_state {
-  grpc_completion_queue *cc;
-  void *tag;
-};
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_no_op();
-  test_pollset_conversion();
-  test_wait_empty();
-  test_shutdown_then_next_polling();
-  test_shutdown_then_next_with_timeout();
-  test_cq_end_op();
-  test_pluck();
-  test_pluck_after_shutdown();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/surface/completion_queue_test.cc b/test/core/surface/completion_queue_test.cc
new file mode 100644
index 0000000..277ffde
--- /dev/null
+++ b/test/core/surface/completion_queue_test.cc
@@ -0,0 +1,381 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/surface/completion_queue.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
+
+static void* create_test_tag(void) {
+  static intptr_t i = 0;
+  return (void*)(++i);
+}
+
+/* helper for tests to shutdown correctly and tersely */
+static void shutdown_and_destroy(grpc_completion_queue* cc) {
+  grpc_event ev;
+  grpc_completion_queue_shutdown(cc);
+
+  switch (grpc_get_cq_completion_type(cc)) {
+    case GRPC_CQ_NEXT: {
+      ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME),
+                                      NULL);
+      break;
+    }
+    case GRPC_CQ_PLUCK: {
+      ev = grpc_completion_queue_pluck(cc, create_test_tag(),
+                                       gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+      break;
+    }
+    default: {
+      gpr_log(GPR_ERROR, "Unknown completion type");
+      break;
+    }
+  }
+
+  GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
+  grpc_completion_queue_destroy(cc);
+}
+
+/* ensure we can create and destroy a completion channel */
+static void test_no_op(void) {
+  grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK};
+  grpc_cq_polling_type polling_types[] = {
+      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
+  grpc_completion_queue_attributes attr;
+  LOG_TEST("test_no_op");
+
+  attr.version = 1;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) {
+    for (size_t j = 0; j < GPR_ARRAY_SIZE(polling_types); j++) {
+      attr.cq_completion_type = completion_types[i];
+      attr.cq_polling_type = polling_types[j];
+      shutdown_and_destroy(grpc_completion_queue_create(
+          grpc_completion_queue_factory_lookup(&attr), &attr, NULL));
+    }
+  }
+}
+
+static void test_pollset_conversion(void) {
+  grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK};
+  grpc_cq_polling_type polling_types[] = {GRPC_CQ_DEFAULT_POLLING,
+                                          GRPC_CQ_NON_LISTENING};
+  grpc_completion_queue* cq;
+  grpc_completion_queue_attributes attr;
+
+  LOG_TEST("test_pollset_conversion");
+
+  attr.version = 1;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) {
+    for (size_t j = 0; j < GPR_ARRAY_SIZE(polling_types); j++) {
+      attr.cq_completion_type = completion_types[i];
+      attr.cq_polling_type = polling_types[j];
+      cq = grpc_completion_queue_create(
+          grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+      GPR_ASSERT(grpc_cq_pollset(cq) != NULL);
+      shutdown_and_destroy(cq);
+    }
+  }
+}
+
+static void test_wait_empty(void) {
+  grpc_cq_polling_type polling_types[] = {
+      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
+  grpc_completion_queue* cc;
+  grpc_completion_queue_attributes attr;
+  grpc_event event;
+
+  LOG_TEST("test_wait_empty");
+
+  attr.version = 1;
+  attr.cq_completion_type = GRPC_CQ_NEXT;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
+    attr.cq_polling_type = polling_types[i];
+    cc = grpc_completion_queue_create(
+        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+    event = grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT);
+    shutdown_and_destroy(cc);
+  }
+}
+
+static void do_nothing_end_completion(grpc_exec_ctx* exec_ctx, void* arg,
+                                      grpc_cq_completion* c) {}
+
+static void test_cq_end_op(void) {
+  grpc_event ev;
+  grpc_completion_queue* cc;
+  grpc_cq_completion completion;
+  grpc_cq_polling_type polling_types[] = {
+      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
+  grpc_completion_queue_attributes attr;
+  grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_exec_ctx exec_ctx;
+  void* tag = create_test_tag();
+
+  LOG_TEST("test_cq_end_op");
+
+  attr.version = 1;
+  attr.cq_completion_type = GRPC_CQ_NEXT;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
+    exec_ctx = init_exec_ctx;  // Reset exec_ctx
+    attr.cq_polling_type = polling_types[i];
+    cc = grpc_completion_queue_create(
+        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+
+    GPR_ASSERT(grpc_cq_begin_op(cc, tag));
+    grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE,
+                   do_nothing_end_completion, NULL, &completion);
+
+    ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+    GPR_ASSERT(ev.tag == tag);
+    GPR_ASSERT(ev.success);
+
+    shutdown_and_destroy(cc);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_cq_tls_cache_full(void) {
+  grpc_event ev;
+  grpc_completion_queue* cc;
+  grpc_cq_completion completion;
+  grpc_cq_polling_type polling_types[] = {
+      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
+  grpc_completion_queue_attributes attr;
+  grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_exec_ctx exec_ctx;
+  void* tag = create_test_tag();
+  void* res_tag;
+  int ok;
+
+  LOG_TEST("test_cq_tls_cache_full");
+
+  attr.version = 1;
+  attr.cq_completion_type = GRPC_CQ_NEXT;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
+    exec_ctx = init_exec_ctx;  // Reset exec_ctx
+    attr.cq_polling_type = polling_types[i];
+    cc = grpc_completion_queue_create(
+        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+
+    grpc_completion_queue_thread_local_cache_init(cc);
+    GPR_ASSERT(grpc_cq_begin_op(cc, tag));
+    grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE,
+                   do_nothing_end_completion, NULL, &completion);
+
+    ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT);
+
+    GPR_ASSERT(
+        grpc_completion_queue_thread_local_cache_flush(cc, &res_tag, &ok) == 1);
+    GPR_ASSERT(res_tag == tag);
+    GPR_ASSERT(ok);
+
+    ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT);
+
+    shutdown_and_destroy(cc);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_cq_tls_cache_empty(void) {
+  grpc_completion_queue* cc;
+  grpc_cq_polling_type polling_types[] = {
+      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
+  grpc_completion_queue_attributes attr;
+  grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_exec_ctx exec_ctx;
+  void* res_tag;
+  int ok;
+
+  LOG_TEST("test_cq_tls_cache_empty");
+
+  attr.version = 1;
+  attr.cq_completion_type = GRPC_CQ_NEXT;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
+    exec_ctx = init_exec_ctx;  // Reset exec_ctx
+    attr.cq_polling_type = polling_types[i];
+    cc = grpc_completion_queue_create(
+        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+
+    GPR_ASSERT(
+        grpc_completion_queue_thread_local_cache_flush(cc, &res_tag, &ok) == 0);
+    grpc_completion_queue_thread_local_cache_init(cc);
+    GPR_ASSERT(
+        grpc_completion_queue_thread_local_cache_flush(cc, &res_tag, &ok) == 0);
+    shutdown_and_destroy(cc);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_shutdown_then_next_polling(void) {
+  grpc_cq_polling_type polling_types[] = {
+      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
+  grpc_completion_queue* cc;
+  grpc_completion_queue_attributes attr;
+  grpc_event event;
+  LOG_TEST("test_shutdown_then_next_polling");
+
+  attr.version = 1;
+  attr.cq_completion_type = GRPC_CQ_NEXT;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
+    attr.cq_polling_type = polling_types[i];
+    cc = grpc_completion_queue_create(
+        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+    grpc_completion_queue_shutdown(cc);
+    event =
+        grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN);
+    grpc_completion_queue_destroy(cc);
+  }
+}
+
+static void test_shutdown_then_next_with_timeout(void) {
+  grpc_cq_polling_type polling_types[] = {
+      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
+  grpc_completion_queue* cc;
+  grpc_completion_queue_attributes attr;
+  grpc_event event;
+  LOG_TEST("test_shutdown_then_next_with_timeout");
+
+  attr.version = 1;
+  attr.cq_completion_type = GRPC_CQ_NEXT;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
+    attr.cq_polling_type = polling_types[i];
+    cc = grpc_completion_queue_create(
+        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+
+    grpc_completion_queue_shutdown(cc);
+    event = grpc_completion_queue_next(cc, gpr_inf_future(GPR_CLOCK_REALTIME),
+                                       NULL);
+    GPR_ASSERT(event.type == GRPC_QUEUE_SHUTDOWN);
+    grpc_completion_queue_destroy(cc);
+  }
+}
+
+static void test_pluck(void) {
+  grpc_event ev;
+  grpc_completion_queue* cc;
+  void* tags[128];
+  grpc_cq_completion completions[GPR_ARRAY_SIZE(tags)];
+  grpc_cq_polling_type polling_types[] = {
+      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
+  grpc_completion_queue_attributes attr;
+  grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_exec_ctx exec_ctx;
+  unsigned i, j;
+
+  LOG_TEST("test_pluck");
+
+  for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
+    tags[i] = create_test_tag();
+    for (j = 0; j < i; j++) {
+      GPR_ASSERT(tags[i] != tags[j]);
+    }
+  }
+
+  attr.version = 1;
+  attr.cq_completion_type = GRPC_CQ_PLUCK;
+  for (size_t pidx = 0; pidx < GPR_ARRAY_SIZE(polling_types); pidx++) {
+    exec_ctx = init_exec_ctx;  // reset exec_ctx
+    attr.cq_polling_type = polling_types[pidx];
+    cc = grpc_completion_queue_create(
+        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+
+    for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
+      GPR_ASSERT(grpc_cq_begin_op(cc, tags[i]));
+      grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE,
+                     do_nothing_end_completion, NULL, &completions[i]);
+    }
+
+    for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
+      ev = grpc_completion_queue_pluck(cc, tags[i],
+                                       gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+      GPR_ASSERT(ev.tag == tags[i]);
+    }
+
+    for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
+      GPR_ASSERT(grpc_cq_begin_op(cc, tags[i]));
+      grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE,
+                     do_nothing_end_completion, NULL, &completions[i]);
+    }
+
+    for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
+      ev = grpc_completion_queue_pluck(cc, tags[GPR_ARRAY_SIZE(tags) - i - 1],
+                                       gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+      GPR_ASSERT(ev.tag == tags[GPR_ARRAY_SIZE(tags) - i - 1]);
+    }
+
+    shutdown_and_destroy(cc);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+}
+
+static void test_pluck_after_shutdown(void) {
+  grpc_cq_polling_type polling_types[] = {
+      GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
+  grpc_event ev;
+  grpc_completion_queue* cc;
+  grpc_completion_queue_attributes attr;
+
+  LOG_TEST("test_pluck_after_shutdown");
+
+  attr.version = 1;
+  attr.cq_completion_type = GRPC_CQ_PLUCK;
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) {
+    attr.cq_polling_type = polling_types[i];
+    cc = grpc_completion_queue_create(
+        grpc_completion_queue_factory_lookup(&attr), &attr, NULL);
+    grpc_completion_queue_shutdown(cc);
+    ev = grpc_completion_queue_pluck(cc, NULL,
+                                     gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+    GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
+    grpc_completion_queue_destroy(cc);
+  }
+}
+
+struct thread_state {
+  grpc_completion_queue* cc;
+  void* tag;
+};
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_no_op();
+  test_pollset_conversion();
+  test_wait_empty();
+  test_shutdown_then_next_polling();
+  test_shutdown_then_next_with_timeout();
+  test_cq_end_op();
+  test_pluck();
+  test_pluck_after_shutdown();
+  test_cq_tls_cache_full();
+  test_cq_tls_cache_empty();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/surface/completion_queue_threading_test.c b/test/core/surface/completion_queue_threading_test.c
deleted file mode 100644
index 9996b6b..0000000
--- a/test/core/surface/completion_queue_threading_test.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/surface/completion_queue.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-#include <grpc/support/time.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/iomgr/iomgr.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
-
-static void *create_test_tag(void) {
-  static intptr_t i = 0;
-  return (void *)(++i);
-}
-
-/* helper for tests to shutdown correctly and tersely */
-static void shutdown_and_destroy(grpc_completion_queue *cc) {
-  grpc_event ev;
-  grpc_completion_queue_shutdown(cc);
-
-  switch (grpc_get_cq_completion_type(cc)) {
-    case GRPC_CQ_NEXT: {
-      ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME),
-                                      NULL);
-      break;
-    }
-    case GRPC_CQ_PLUCK: {
-      ev = grpc_completion_queue_pluck(cc, create_test_tag(),
-                                       gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
-      break;
-    }
-    default: {
-      gpr_log(GPR_ERROR, "Unknown completion type");
-      break;
-    }
-  }
-
-  GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
-  grpc_completion_queue_destroy(cc);
-}
-
-static void do_nothing_end_completion(grpc_exec_ctx *exec_ctx, void *arg,
-                                      grpc_cq_completion *c) {}
-
-struct thread_state {
-  grpc_completion_queue *cc;
-  void *tag;
-};
-
-static void pluck_one(void *arg) {
-  struct thread_state *state = arg;
-  grpc_completion_queue_pluck(state->cc, state->tag,
-                              gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-}
-
-static void test_too_many_plucks(void) {
-  grpc_event ev;
-  grpc_completion_queue *cc;
-  void *tags[GRPC_MAX_COMPLETION_QUEUE_PLUCKERS];
-  grpc_cq_completion completions[GPR_ARRAY_SIZE(tags)];
-  gpr_thd_id thread_ids[GPR_ARRAY_SIZE(tags)];
-  struct thread_state thread_states[GPR_ARRAY_SIZE(tags)];
-  gpr_thd_options thread_options = gpr_thd_options_default();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  unsigned i, j;
-
-  LOG_TEST("test_too_many_plucks");
-
-  cc = grpc_completion_queue_create_for_pluck(NULL);
-  gpr_thd_options_set_joinable(&thread_options);
-
-  for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
-    tags[i] = create_test_tag();
-    for (j = 0; j < i; j++) {
-      GPR_ASSERT(tags[i] != tags[j]);
-    }
-    thread_states[i].cc = cc;
-    thread_states[i].tag = tags[i];
-    gpr_thd_new(thread_ids + i, pluck_one, thread_states + i, &thread_options);
-  }
-
-  /* wait until all other threads are plucking */
-  gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1000));
-
-  ev = grpc_completion_queue_pluck(cc, create_test_tag(),
-                                   gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT);
-
-  for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
-    GPR_ASSERT(grpc_cq_begin_op(cc, tags[i]));
-    grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE,
-                   do_nothing_end_completion, NULL, &completions[i]);
-  }
-
-  for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
-    gpr_thd_join(thread_ids[i]);
-  }
-
-  shutdown_and_destroy(cc);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-#define TEST_THREAD_EVENTS 10000
-
-typedef struct test_thread_options {
-  gpr_event on_started;
-  gpr_event *phase1;
-  gpr_event on_phase1_done;
-  gpr_event *phase2;
-  gpr_event on_finished;
-  size_t events_triggered;
-  int id;
-  grpc_completion_queue *cc;
-} test_thread_options;
-
-gpr_timespec ten_seconds_time(void) {
-  return grpc_timeout_seconds_to_deadline(10);
-}
-
-static void free_completion(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_cq_completion *completion) {
-  gpr_free(completion);
-}
-
-static void producer_thread(void *arg) {
-  test_thread_options *opt = arg;
-  int i;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  gpr_log(GPR_INFO, "producer %d started", opt->id);
-  gpr_event_set(&opt->on_started, (void *)(intptr_t)1);
-  GPR_ASSERT(gpr_event_wait(opt->phase1, ten_seconds_time()));
-
-  gpr_log(GPR_INFO, "producer %d phase 1", opt->id);
-  for (i = 0; i < TEST_THREAD_EVENTS; i++) {
-    GPR_ASSERT(grpc_cq_begin_op(opt->cc, (void *)(intptr_t)1));
-  }
-
-  gpr_log(GPR_INFO, "producer %d phase 1 done", opt->id);
-  gpr_event_set(&opt->on_phase1_done, (void *)(intptr_t)1);
-  GPR_ASSERT(gpr_event_wait(opt->phase2, ten_seconds_time()));
-
-  gpr_log(GPR_INFO, "producer %d phase 2", opt->id);
-  for (i = 0; i < TEST_THREAD_EVENTS; i++) {
-    grpc_cq_end_op(&exec_ctx, opt->cc, (void *)(intptr_t)1, GRPC_ERROR_NONE,
-                   free_completion, NULL,
-                   gpr_malloc(sizeof(grpc_cq_completion)));
-    opt->events_triggered++;
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  gpr_log(GPR_INFO, "producer %d phase 2 done", opt->id);
-  gpr_event_set(&opt->on_finished, (void *)(intptr_t)1);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void consumer_thread(void *arg) {
-  test_thread_options *opt = arg;
-  grpc_event ev;
-
-  gpr_log(GPR_INFO, "consumer %d started", opt->id);
-  gpr_event_set(&opt->on_started, (void *)(intptr_t)1);
-  GPR_ASSERT(gpr_event_wait(opt->phase1, ten_seconds_time()));
-
-  gpr_log(GPR_INFO, "consumer %d phase 1", opt->id);
-
-  gpr_log(GPR_INFO, "consumer %d phase 1 done", opt->id);
-  gpr_event_set(&opt->on_phase1_done, (void *)(intptr_t)1);
-  GPR_ASSERT(gpr_event_wait(opt->phase2, ten_seconds_time()));
-
-  gpr_log(GPR_INFO, "consumer %d phase 2", opt->id);
-  for (;;) {
-    ev = grpc_completion_queue_next(opt->cc,
-                                    gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
-    switch (ev.type) {
-      case GRPC_OP_COMPLETE:
-        GPR_ASSERT(ev.success);
-        opt->events_triggered++;
-        break;
-      case GRPC_QUEUE_SHUTDOWN:
-        gpr_log(GPR_INFO, "consumer %d phase 2 done", opt->id);
-        gpr_event_set(&opt->on_finished, (void *)(intptr_t)1);
-        return;
-      case GRPC_QUEUE_TIMEOUT:
-        gpr_log(GPR_ERROR, "Invalid timeout received");
-        abort();
-    }
-  }
-}
-
-static void test_threading(size_t producers, size_t consumers) {
-  test_thread_options *options =
-      gpr_malloc((producers + consumers) * sizeof(test_thread_options));
-  gpr_event phase1 = GPR_EVENT_INIT;
-  gpr_event phase2 = GPR_EVENT_INIT;
-  grpc_completion_queue *cc = grpc_completion_queue_create_for_next(NULL);
-  size_t i;
-  size_t total_consumed = 0;
-  static int optid = 101;
-
-  gpr_log(GPR_INFO, "%s: %" PRIuPTR " producers, %" PRIuPTR " consumers",
-          "test_threading", producers, consumers);
-
-  /* start all threads: they will wait for phase1 */
-  for (i = 0; i < producers + consumers; i++) {
-    gpr_thd_id id;
-    gpr_event_init(&options[i].on_started);
-    gpr_event_init(&options[i].on_phase1_done);
-    gpr_event_init(&options[i].on_finished);
-    options[i].phase1 = &phase1;
-    options[i].phase2 = &phase2;
-    options[i].events_triggered = 0;
-    options[i].cc = cc;
-    options[i].id = optid++;
-    GPR_ASSERT(gpr_thd_new(&id,
-                           i < producers ? producer_thread : consumer_thread,
-                           options + i, NULL));
-    gpr_event_wait(&options[i].on_started, ten_seconds_time());
-  }
-
-  /* start phase1: producers will pre-declare all operations they will
-     complete */
-  gpr_log(GPR_INFO, "start phase 1");
-  gpr_event_set(&phase1, (void *)(intptr_t)1);
-
-  gpr_log(GPR_INFO, "wait phase 1");
-  for (i = 0; i < producers + consumers; i++) {
-    GPR_ASSERT(gpr_event_wait(&options[i].on_phase1_done, ten_seconds_time()));
-  }
-  gpr_log(GPR_INFO, "done phase 1");
-
-  /* start phase2: operations will complete, and consumers will consume them */
-  gpr_log(GPR_INFO, "start phase 2");
-  gpr_event_set(&phase2, (void *)(intptr_t)1);
-
-  /* in parallel, we shutdown the completion channel - all events should still
-     be consumed */
-  grpc_completion_queue_shutdown(cc);
-
-  /* join all threads */
-  gpr_log(GPR_INFO, "wait phase 2");
-  for (i = 0; i < producers + consumers; i++) {
-    GPR_ASSERT(gpr_event_wait(&options[i].on_finished, ten_seconds_time()));
-  }
-  gpr_log(GPR_INFO, "done phase 2");
-
-  /* destroy the completion channel */
-  grpc_completion_queue_destroy(cc);
-
-  /* verify that everything was produced and consumed */
-  for (i = 0; i < producers + consumers; i++) {
-    if (i < producers) {
-      GPR_ASSERT(options[i].events_triggered == TEST_THREAD_EVENTS);
-    } else {
-      total_consumed += options[i].events_triggered;
-    }
-  }
-  GPR_ASSERT(total_consumed == producers * TEST_THREAD_EVENTS);
-
-  gpr_free(options);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_too_many_plucks();
-  test_threading(1, 1);
-  test_threading(1, 10);
-  test_threading(10, 1);
-  test_threading(10, 10);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/surface/completion_queue_threading_test.cc b/test/core/surface/completion_queue_threading_test.cc
new file mode 100644
index 0000000..043c5c1
--- /dev/null
+++ b/test/core/surface/completion_queue_threading_test.cc
@@ -0,0 +1,294 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/surface/completion_queue.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+#include <grpc/support/time.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/iomgr/iomgr.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
+
+static void* create_test_tag(void) {
+  static intptr_t i = 0;
+  return (void*)(++i);
+}
+
+/* helper for tests to shutdown correctly and tersely */
+static void shutdown_and_destroy(grpc_completion_queue* cc) {
+  grpc_event ev;
+  grpc_completion_queue_shutdown(cc);
+
+  switch (grpc_get_cq_completion_type(cc)) {
+    case GRPC_CQ_NEXT: {
+      ev = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME),
+                                      NULL);
+      break;
+    }
+    case GRPC_CQ_PLUCK: {
+      ev = grpc_completion_queue_pluck(cc, create_test_tag(),
+                                       gpr_inf_past(GPR_CLOCK_REALTIME), NULL);
+      break;
+    }
+    default: {
+      gpr_log(GPR_ERROR, "Unknown completion type");
+      break;
+    }
+  }
+
+  GPR_ASSERT(ev.type == GRPC_QUEUE_SHUTDOWN);
+  grpc_completion_queue_destroy(cc);
+}
+
+static void do_nothing_end_completion(grpc_exec_ctx* exec_ctx, void* arg,
+                                      grpc_cq_completion* c) {}
+
+struct thread_state {
+  grpc_completion_queue* cc;
+  void* tag;
+};
+
+static void pluck_one(void* arg) {
+  struct thread_state* state = static_cast<struct thread_state*>(arg);
+  grpc_completion_queue_pluck(state->cc, state->tag,
+                              gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+}
+
+static void test_too_many_plucks(void) {
+  grpc_event ev;
+  grpc_completion_queue* cc;
+  void* tags[GRPC_MAX_COMPLETION_QUEUE_PLUCKERS];
+  grpc_cq_completion completions[GPR_ARRAY_SIZE(tags)];
+  gpr_thd_id thread_ids[GPR_ARRAY_SIZE(tags)];
+  struct thread_state thread_states[GPR_ARRAY_SIZE(tags)];
+  gpr_thd_options thread_options = gpr_thd_options_default();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  unsigned i, j;
+
+  LOG_TEST("test_too_many_plucks");
+
+  cc = grpc_completion_queue_create_for_pluck(NULL);
+  gpr_thd_options_set_joinable(&thread_options);
+
+  for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
+    tags[i] = create_test_tag();
+    for (j = 0; j < i; j++) {
+      GPR_ASSERT(tags[i] != tags[j]);
+    }
+    thread_states[i].cc = cc;
+    thread_states[i].tag = tags[i];
+    gpr_thd_new(thread_ids + i, pluck_one, thread_states + i, &thread_options);
+  }
+
+  /* wait until all other threads are plucking */
+  gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1000));
+
+  ev = grpc_completion_queue_pluck(cc, create_test_tag(),
+                                   gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT);
+
+  for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
+    GPR_ASSERT(grpc_cq_begin_op(cc, tags[i]));
+    grpc_cq_end_op(&exec_ctx, cc, tags[i], GRPC_ERROR_NONE,
+                   do_nothing_end_completion, NULL, &completions[i]);
+  }
+
+  for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
+    gpr_thd_join(thread_ids[i]);
+  }
+
+  shutdown_and_destroy(cc);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+#define TEST_THREAD_EVENTS 10000
+
+typedef struct test_thread_options {
+  gpr_event on_started;
+  gpr_event* phase1;
+  gpr_event on_phase1_done;
+  gpr_event* phase2;
+  gpr_event on_finished;
+  size_t events_triggered;
+  int id;
+  grpc_completion_queue* cc;
+} test_thread_options;
+
+gpr_timespec ten_seconds_time(void) {
+  return grpc_timeout_seconds_to_deadline(10);
+}
+
+static void free_completion(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_cq_completion* completion) {
+  gpr_free(completion);
+}
+
+static void producer_thread(void* arg) {
+  test_thread_options* opt = static_cast<test_thread_options*>(arg);
+  int i;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  gpr_log(GPR_INFO, "producer %d started", opt->id);
+  gpr_event_set(&opt->on_started, (void*)(intptr_t)1);
+  GPR_ASSERT(gpr_event_wait(opt->phase1, ten_seconds_time()));
+
+  gpr_log(GPR_INFO, "producer %d phase 1", opt->id);
+  for (i = 0; i < TEST_THREAD_EVENTS; i++) {
+    GPR_ASSERT(grpc_cq_begin_op(opt->cc, (void*)(intptr_t)1));
+  }
+
+  gpr_log(GPR_INFO, "producer %d phase 1 done", opt->id);
+  gpr_event_set(&opt->on_phase1_done, (void*)(intptr_t)1);
+  GPR_ASSERT(gpr_event_wait(opt->phase2, ten_seconds_time()));
+
+  gpr_log(GPR_INFO, "producer %d phase 2", opt->id);
+  for (i = 0; i < TEST_THREAD_EVENTS; i++) {
+    grpc_cq_end_op(&exec_ctx, opt->cc, (void*)(intptr_t)1, GRPC_ERROR_NONE,
+                   free_completion, NULL,
+                   static_cast<grpc_cq_completion*>(
+                       gpr_malloc(sizeof(grpc_cq_completion))));
+    opt->events_triggered++;
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  gpr_log(GPR_INFO, "producer %d phase 2 done", opt->id);
+  gpr_event_set(&opt->on_finished, (void*)(intptr_t)1);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void consumer_thread(void* arg) {
+  test_thread_options* opt = static_cast<test_thread_options*>(arg);
+  grpc_event ev;
+
+  gpr_log(GPR_INFO, "consumer %d started", opt->id);
+  gpr_event_set(&opt->on_started, (void*)(intptr_t)1);
+  GPR_ASSERT(gpr_event_wait(opt->phase1, ten_seconds_time()));
+
+  gpr_log(GPR_INFO, "consumer %d phase 1", opt->id);
+
+  gpr_log(GPR_INFO, "consumer %d phase 1 done", opt->id);
+  gpr_event_set(&opt->on_phase1_done, (void*)(intptr_t)1);
+  GPR_ASSERT(gpr_event_wait(opt->phase2, ten_seconds_time()));
+
+  gpr_log(GPR_INFO, "consumer %d phase 2", opt->id);
+  for (;;) {
+    ev = grpc_completion_queue_next(opt->cc,
+                                    gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
+    switch (ev.type) {
+      case GRPC_OP_COMPLETE:
+        GPR_ASSERT(ev.success);
+        opt->events_triggered++;
+        break;
+      case GRPC_QUEUE_SHUTDOWN:
+        gpr_log(GPR_INFO, "consumer %d phase 2 done", opt->id);
+        gpr_event_set(&opt->on_finished, (void*)(intptr_t)1);
+        return;
+      case GRPC_QUEUE_TIMEOUT:
+        gpr_log(GPR_ERROR, "Invalid timeout received");
+        abort();
+    }
+  }
+}
+
+static void test_threading(size_t producers, size_t consumers) {
+  test_thread_options* options = static_cast<test_thread_options*>(
+      gpr_malloc((producers + consumers) * sizeof(test_thread_options)));
+  gpr_event phase1 = GPR_EVENT_INIT;
+  gpr_event phase2 = GPR_EVENT_INIT;
+  grpc_completion_queue* cc = grpc_completion_queue_create_for_next(NULL);
+  size_t i;
+  size_t total_consumed = 0;
+  static int optid = 101;
+
+  gpr_log(GPR_INFO, "%s: %" PRIuPTR " producers, %" PRIuPTR " consumers",
+          "test_threading", producers, consumers);
+
+  /* start all threads: they will wait for phase1 */
+  for (i = 0; i < producers + consumers; i++) {
+    gpr_thd_id id;
+    gpr_event_init(&options[i].on_started);
+    gpr_event_init(&options[i].on_phase1_done);
+    gpr_event_init(&options[i].on_finished);
+    options[i].phase1 = &phase1;
+    options[i].phase2 = &phase2;
+    options[i].events_triggered = 0;
+    options[i].cc = cc;
+    options[i].id = optid++;
+    GPR_ASSERT(gpr_thd_new(&id,
+                           i < producers ? producer_thread : consumer_thread,
+                           options + i, NULL));
+    gpr_event_wait(&options[i].on_started, ten_seconds_time());
+  }
+
+  /* start phase1: producers will pre-declare all operations they will
+     complete */
+  gpr_log(GPR_INFO, "start phase 1");
+  gpr_event_set(&phase1, (void*)(intptr_t)1);
+
+  gpr_log(GPR_INFO, "wait phase 1");
+  for (i = 0; i < producers + consumers; i++) {
+    GPR_ASSERT(gpr_event_wait(&options[i].on_phase1_done, ten_seconds_time()));
+  }
+  gpr_log(GPR_INFO, "done phase 1");
+
+  /* start phase2: operations will complete, and consumers will consume them */
+  gpr_log(GPR_INFO, "start phase 2");
+  gpr_event_set(&phase2, (void*)(intptr_t)1);
+
+  /* in parallel, we shutdown the completion channel - all events should still
+     be consumed */
+  grpc_completion_queue_shutdown(cc);
+
+  /* join all threads */
+  gpr_log(GPR_INFO, "wait phase 2");
+  for (i = 0; i < producers + consumers; i++) {
+    GPR_ASSERT(gpr_event_wait(&options[i].on_finished, ten_seconds_time()));
+  }
+  gpr_log(GPR_INFO, "done phase 2");
+
+  /* destroy the completion channel */
+  grpc_completion_queue_destroy(cc);
+
+  /* verify that everything was produced and consumed */
+  for (i = 0; i < producers + consumers; i++) {
+    if (i < producers) {
+      GPR_ASSERT(options[i].events_triggered == TEST_THREAD_EVENTS);
+    } else {
+      total_consumed += options[i].events_triggered;
+    }
+  }
+  GPR_ASSERT(total_consumed == producers * TEST_THREAD_EVENTS);
+
+  gpr_free(options);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_too_many_plucks();
+  test_threading(1, 1);
+  test_threading(1, 10);
+  test_threading(10, 1);
+  test_threading(10, 10);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c
deleted file mode 100644
index 3595885..0000000
--- a/test/core/surface/concurrent_connectivity_test.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
-   using that endpoint. Because of various transitive includes in uv.h,
-   including windows.h on Windows, uv.h must be included before other system
-   headers. Therefore, sockaddr.h must always be included first */
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include <memory.h>
-#include <stdio.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/thd.h>
-
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-#include "src/core/lib/iomgr/tcp_server.h"
-
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-#define NUM_THREADS 100
-#define NUM_OUTER_LOOPS 10
-#define NUM_INNER_LOOPS 10
-#define DELAY_MILLIS 10
-#define POLL_MILLIS 3000
-
-#define NUM_OUTER_LOOPS_SHORT_TIMEOUTS 10
-#define NUM_INNER_LOOPS_SHORT_TIMEOUTS 100
-#define DELAY_MILLIS_SHORT_TIMEOUTS 1
-// in a successful test run, POLL_MILLIS should never be reached beause all runs
-// should
-// end after the shorter delay_millis
-#define POLL_MILLIS_SHORT_TIMEOUTS 30000
-
-static void *tag(int n) { return (void *)(uintptr_t)n; }
-static int detag(void *p) { return (int)(uintptr_t)p; }
-
-void create_loop_destroy(void *addr) {
-  for (int i = 0; i < NUM_OUTER_LOOPS; ++i) {
-    grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-    grpc_channel *chan = grpc_insecure_channel_create((char *)addr, NULL, NULL);
-
-    for (int j = 0; j < NUM_INNER_LOOPS; ++j) {
-      gpr_timespec later_time =
-          grpc_timeout_milliseconds_to_deadline(DELAY_MILLIS);
-      grpc_connectivity_state state =
-          grpc_channel_check_connectivity_state(chan, 1);
-      grpc_channel_watch_connectivity_state(chan, state, later_time, cq, NULL);
-      gpr_timespec poll_time =
-          grpc_timeout_milliseconds_to_deadline(POLL_MILLIS);
-      GPR_ASSERT(grpc_completion_queue_next(cq, poll_time, NULL).type ==
-                 GRPC_OP_COMPLETE);
-      /* check that the watcher from "watch state" was free'd */
-      GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(chan) == 0);
-    }
-    grpc_channel_destroy(chan);
-    grpc_completion_queue_destroy(cq);
-  }
-}
-
-struct server_thread_args {
-  char *addr;
-  grpc_server *server;
-  grpc_completion_queue *cq;
-  grpc_pollset *pollset;
-  gpr_mu *mu;
-  gpr_event ready;
-  gpr_atm stop;
-};
-
-void server_thread(void *vargs) {
-  struct server_thread_args *args = (struct server_thread_args *)vargs;
-  grpc_event ev;
-  gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
-  ev = grpc_completion_queue_next(args->cq, deadline, NULL);
-  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  GPR_ASSERT(detag(ev.tag) == 0xd1e);
-}
-
-static void on_connect(grpc_exec_ctx *exec_ctx, void *vargs, grpc_endpoint *tcp,
-                       grpc_pollset *accepting_pollset,
-                       grpc_tcp_server_acceptor *acceptor) {
-  gpr_free(acceptor);
-  struct server_thread_args *args = (struct server_thread_args *)vargs;
-  grpc_endpoint_shutdown(exec_ctx, tcp,
-                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected"));
-  grpc_endpoint_destroy(exec_ctx, tcp);
-  gpr_mu_lock(args->mu);
-  GRPC_LOG_IF_ERROR("pollset_kick",
-                    grpc_pollset_kick(exec_ctx, args->pollset, NULL));
-  gpr_mu_unlock(args->mu);
-}
-
-void bad_server_thread(void *vargs) {
-  struct server_thread_args *args = (struct server_thread_args *)vargs;
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_storage *addr = (struct sockaddr_storage *)resolved_addr.addr;
-  int port;
-  grpc_tcp_server *s;
-  grpc_error *error = grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  memset(&resolved_addr, 0, sizeof(resolved_addr));
-  addr->ss_family = AF_INET;
-  error = grpc_tcp_server_add_port(s, &resolved_addr, &port);
-  GPR_ASSERT(GRPC_LOG_IF_ERROR("grpc_tcp_server_add_port", error));
-  GPR_ASSERT(port > 0);
-  gpr_asprintf(&args->addr, "localhost:%d", port);
-
-  grpc_tcp_server_start(&exec_ctx, s, &args->pollset, 1, on_connect, args);
-  gpr_event_set(&args->ready, (void *)1);
-
-  gpr_mu_lock(args->mu);
-  while (gpr_atm_acq_load(&args->stop) == 0) {
-    grpc_millis deadline = grpc_exec_ctx_now(&exec_ctx) + 100;
-
-    grpc_pollset_worker *worker = NULL;
-    if (!GRPC_LOG_IF_ERROR(
-            "pollset_work",
-            grpc_pollset_work(&exec_ctx, args->pollset, &worker, deadline))) {
-      gpr_atm_rel_store(&args->stop, 1);
-    }
-    gpr_mu_unlock(args->mu);
-    grpc_exec_ctx_finish(&exec_ctx);
-    gpr_mu_lock(args->mu);
-  }
-  gpr_mu_unlock(args->mu);
-
-  grpc_tcp_server_unref(&exec_ctx, s);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  gpr_free(args->addr);
-}
-
-static void done_pollset_shutdown(grpc_exec_ctx *exec_ctx, void *pollset,
-                                  grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, pollset);
-  gpr_free(pollset);
-}
-
-int run_concurrent_connectivity_test() {
-  struct server_thread_args args;
-  memset(&args, 0, sizeof(args));
-
-  grpc_init();
-
-  gpr_thd_id threads[NUM_THREADS];
-  gpr_thd_id server;
-
-  char *localhost = gpr_strdup("localhost:54321");
-  gpr_thd_options options = gpr_thd_options_default();
-  gpr_thd_options_set_joinable(&options);
-
-  /* First round, no server */
-  gpr_log(GPR_DEBUG, "Wave 1");
-  for (size_t i = 0; i < NUM_THREADS; ++i) {
-    gpr_thd_new(&threads[i], create_loop_destroy, localhost, &options);
-  }
-  for (size_t i = 0; i < NUM_THREADS; ++i) {
-    gpr_thd_join(threads[i]);
-  }
-  gpr_free(localhost);
-
-  /* Second round, actual grpc server */
-  gpr_log(GPR_DEBUG, "Wave 2");
-  int port = grpc_pick_unused_port_or_die();
-  gpr_asprintf(&args.addr, "localhost:%d", port);
-  args.server = grpc_server_create(NULL, NULL);
-  grpc_server_add_insecure_http2_port(args.server, args.addr);
-  args.cq = grpc_completion_queue_create_for_next(NULL);
-  grpc_server_register_completion_queue(args.server, args.cq, NULL);
-  grpc_server_start(args.server);
-  gpr_thd_new(&server, server_thread, &args, &options);
-
-  for (size_t i = 0; i < NUM_THREADS; ++i) {
-    gpr_thd_new(&threads[i], create_loop_destroy, args.addr, &options);
-  }
-  for (size_t i = 0; i < NUM_THREADS; ++i) {
-    gpr_thd_join(threads[i]);
-  }
-  grpc_server_shutdown_and_notify(args.server, args.cq, tag(0xd1e));
-
-  gpr_thd_join(server);
-  grpc_server_destroy(args.server);
-  grpc_completion_queue_destroy(args.cq);
-  gpr_free(args.addr);
-
-  /* Third round, bogus tcp server */
-  gpr_log(GPR_DEBUG, "Wave 3");
-  args.pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(args.pollset, &args.mu);
-  gpr_event_init(&args.ready);
-  gpr_thd_new(&server, bad_server_thread, &args, &options);
-  gpr_event_wait(&args.ready, gpr_inf_future(GPR_CLOCK_MONOTONIC));
-
-  for (size_t i = 0; i < NUM_THREADS; ++i) {
-    gpr_thd_new(&threads[i], create_loop_destroy, args.addr, &options);
-  }
-  for (size_t i = 0; i < NUM_THREADS; ++i) {
-    gpr_thd_join(threads[i]);
-  }
-
-  gpr_atm_rel_store(&args.stop, 1);
-  gpr_thd_join(server);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_pollset_shutdown(&exec_ctx, args.pollset,
-                        GRPC_CLOSURE_CREATE(done_pollset_shutdown, args.pollset,
-                                            grpc_schedule_on_exec_ctx));
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  grpc_shutdown();
-  return 0;
-}
-
-void watches_with_short_timeouts(void *addr) {
-  for (int i = 0; i < NUM_OUTER_LOOPS_SHORT_TIMEOUTS; ++i) {
-    grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-    grpc_channel *chan = grpc_insecure_channel_create((char *)addr, NULL, NULL);
-
-    for (int j = 0; j < NUM_INNER_LOOPS_SHORT_TIMEOUTS; ++j) {
-      gpr_timespec later_time =
-          grpc_timeout_milliseconds_to_deadline(DELAY_MILLIS_SHORT_TIMEOUTS);
-      grpc_connectivity_state state =
-          grpc_channel_check_connectivity_state(chan, 0);
-      GPR_ASSERT(state == GRPC_CHANNEL_IDLE);
-      grpc_channel_watch_connectivity_state(chan, state, later_time, cq, NULL);
-      gpr_timespec poll_time =
-          grpc_timeout_milliseconds_to_deadline(POLL_MILLIS_SHORT_TIMEOUTS);
-      grpc_event ev = grpc_completion_queue_next(cq, poll_time, NULL);
-      GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-      GPR_ASSERT(ev.success == false);
-      /* check that the watcher from "watch state" was free'd */
-      GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(chan) == 0);
-    }
-    grpc_channel_destroy(chan);
-    grpc_completion_queue_destroy(cq);
-  }
-}
-
-// This test tries to catch deadlock situations.
-// With short timeouts on "watches" and long timeouts on cq next calls,
-// so that a QUEUE_TIMEOUT likely means that something is stuck.
-int run_concurrent_watches_with_short_timeouts_test() {
-  grpc_init();
-
-  gpr_thd_id threads[NUM_THREADS];
-
-  char *localhost = gpr_strdup("localhost:54321");
-  gpr_thd_options options = gpr_thd_options_default();
-  gpr_thd_options_set_joinable(&options);
-
-  for (size_t i = 0; i < NUM_THREADS; ++i) {
-    gpr_thd_new(&threads[i], watches_with_short_timeouts, localhost, &options);
-  }
-  for (size_t i = 0; i < NUM_THREADS; ++i) {
-    gpr_thd_join(threads[i]);
-  }
-  gpr_free(localhost);
-
-  grpc_shutdown();
-  return 0;
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  run_concurrent_connectivity_test();
-  run_concurrent_watches_with_short_timeouts_test();
-}
diff --git a/test/core/surface/concurrent_connectivity_test.cc b/test/core/surface/concurrent_connectivity_test.cc
new file mode 100644
index 0000000..6f6a71e
--- /dev/null
+++ b/test/core/surface/concurrent_connectivity_test.cc
@@ -0,0 +1,293 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
+   using that endpoint. Because of various transitive includes in uv.h,
+   including windows.h on Windows, uv.h must be included before other system
+   headers. Therefore, sockaddr.h must always be included first */
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include <memory.h>
+#include <stdio.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/thd.h>
+
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/tcp_server.h"
+
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+#define NUM_THREADS 100
+#define NUM_OUTER_LOOPS 10
+#define NUM_INNER_LOOPS 10
+#define DELAY_MILLIS 10
+#define POLL_MILLIS 3000
+
+#define NUM_OUTER_LOOPS_SHORT_TIMEOUTS 10
+#define NUM_INNER_LOOPS_SHORT_TIMEOUTS 100
+#define DELAY_MILLIS_SHORT_TIMEOUTS 1
+// in a successful test run, POLL_MILLIS should never be reached beause all runs
+// should
+// end after the shorter delay_millis
+#define POLL_MILLIS_SHORT_TIMEOUTS 30000
+
+static void* tag(int n) { return (void*)(uintptr_t)n; }
+static int detag(void* p) { return (int)(uintptr_t)p; }
+
+void create_loop_destroy(void* addr) {
+  for (int i = 0; i < NUM_OUTER_LOOPS; ++i) {
+    grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+    grpc_channel* chan = grpc_insecure_channel_create((char*)addr, NULL, NULL);
+
+    for (int j = 0; j < NUM_INNER_LOOPS; ++j) {
+      gpr_timespec later_time =
+          grpc_timeout_milliseconds_to_deadline(DELAY_MILLIS);
+      grpc_connectivity_state state =
+          grpc_channel_check_connectivity_state(chan, 1);
+      grpc_channel_watch_connectivity_state(chan, state, later_time, cq, NULL);
+      gpr_timespec poll_time =
+          grpc_timeout_milliseconds_to_deadline(POLL_MILLIS);
+      GPR_ASSERT(grpc_completion_queue_next(cq, poll_time, NULL).type ==
+                 GRPC_OP_COMPLETE);
+      /* check that the watcher from "watch state" was free'd */
+      GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(chan) == 0);
+    }
+    grpc_channel_destroy(chan);
+    grpc_completion_queue_destroy(cq);
+  }
+}
+
+struct server_thread_args {
+  char* addr;
+  grpc_server* server;
+  grpc_completion_queue* cq;
+  grpc_pollset* pollset;
+  gpr_mu* mu;
+  gpr_event ready;
+  gpr_atm stop;
+};
+
+void server_thread(void* vargs) {
+  struct server_thread_args* args = (struct server_thread_args*)vargs;
+  grpc_event ev;
+  gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
+  ev = grpc_completion_queue_next(args->cq, deadline, NULL);
+  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  GPR_ASSERT(detag(ev.tag) == 0xd1e);
+}
+
+static void on_connect(grpc_exec_ctx* exec_ctx, void* vargs, grpc_endpoint* tcp,
+                       grpc_pollset* accepting_pollset,
+                       grpc_tcp_server_acceptor* acceptor) {
+  gpr_free(acceptor);
+  struct server_thread_args* args = (struct server_thread_args*)vargs;
+  grpc_endpoint_shutdown(exec_ctx, tcp,
+                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected"));
+  grpc_endpoint_destroy(exec_ctx, tcp);
+  gpr_mu_lock(args->mu);
+  GRPC_LOG_IF_ERROR("pollset_kick",
+                    grpc_pollset_kick(exec_ctx, args->pollset, NULL));
+  gpr_mu_unlock(args->mu);
+}
+
+void bad_server_thread(void* vargs) {
+  struct server_thread_args* args = (struct server_thread_args*)vargs;
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_storage* addr = (struct sockaddr_storage*)resolved_addr.addr;
+  int port;
+  grpc_tcp_server* s;
+  grpc_error* error = grpc_tcp_server_create(&exec_ctx, NULL, NULL, &s);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  memset(&resolved_addr, 0, sizeof(resolved_addr));
+  addr->ss_family = AF_INET;
+  error = grpc_tcp_server_add_port(s, &resolved_addr, &port);
+  GPR_ASSERT(GRPC_LOG_IF_ERROR("grpc_tcp_server_add_port", error));
+  GPR_ASSERT(port > 0);
+  gpr_asprintf(&args->addr, "localhost:%d", port);
+
+  grpc_tcp_server_start(&exec_ctx, s, &args->pollset, 1, on_connect, args);
+  gpr_event_set(&args->ready, (void*)1);
+
+  gpr_mu_lock(args->mu);
+  while (gpr_atm_acq_load(&args->stop) == 0) {
+    grpc_millis deadline = grpc_exec_ctx_now(&exec_ctx) + 100;
+
+    grpc_pollset_worker* worker = NULL;
+    if (!GRPC_LOG_IF_ERROR(
+            "pollset_work",
+            grpc_pollset_work(&exec_ctx, args->pollset, &worker, deadline))) {
+      gpr_atm_rel_store(&args->stop, 1);
+    }
+    gpr_mu_unlock(args->mu);
+    grpc_exec_ctx_finish(&exec_ctx);
+    gpr_mu_lock(args->mu);
+  }
+  gpr_mu_unlock(args->mu);
+
+  grpc_tcp_server_unref(&exec_ctx, s);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  gpr_free(args->addr);
+}
+
+static void done_pollset_shutdown(grpc_exec_ctx* exec_ctx, void* pollset,
+                                  grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(pollset));
+  gpr_free(pollset);
+}
+
+int run_concurrent_connectivity_test() {
+  struct server_thread_args args;
+  memset(&args, 0, sizeof(args));
+
+  grpc_init();
+
+  gpr_thd_id threads[NUM_THREADS];
+  gpr_thd_id server;
+
+  char* localhost = gpr_strdup("localhost:54321");
+  gpr_thd_options options = gpr_thd_options_default();
+  gpr_thd_options_set_joinable(&options);
+
+  /* First round, no server */
+  gpr_log(GPR_DEBUG, "Wave 1");
+  for (size_t i = 0; i < NUM_THREADS; ++i) {
+    gpr_thd_new(&threads[i], create_loop_destroy, localhost, &options);
+  }
+  for (size_t i = 0; i < NUM_THREADS; ++i) {
+    gpr_thd_join(threads[i]);
+  }
+  gpr_free(localhost);
+
+  /* Second round, actual grpc server */
+  gpr_log(GPR_DEBUG, "Wave 2");
+  int port = grpc_pick_unused_port_or_die();
+  gpr_asprintf(&args.addr, "localhost:%d", port);
+  args.server = grpc_server_create(NULL, NULL);
+  grpc_server_add_insecure_http2_port(args.server, args.addr);
+  args.cq = grpc_completion_queue_create_for_next(NULL);
+  grpc_server_register_completion_queue(args.server, args.cq, NULL);
+  grpc_server_start(args.server);
+  gpr_thd_new(&server, server_thread, &args, &options);
+
+  for (size_t i = 0; i < NUM_THREADS; ++i) {
+    gpr_thd_new(&threads[i], create_loop_destroy, args.addr, &options);
+  }
+  for (size_t i = 0; i < NUM_THREADS; ++i) {
+    gpr_thd_join(threads[i]);
+  }
+  grpc_server_shutdown_and_notify(args.server, args.cq, tag(0xd1e));
+
+  gpr_thd_join(server);
+  grpc_server_destroy(args.server);
+  grpc_completion_queue_destroy(args.cq);
+  gpr_free(args.addr);
+
+  /* Third round, bogus tcp server */
+  gpr_log(GPR_DEBUG, "Wave 3");
+  args.pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(args.pollset, &args.mu);
+  gpr_event_init(&args.ready);
+  gpr_thd_new(&server, bad_server_thread, &args, &options);
+  gpr_event_wait(&args.ready, gpr_inf_future(GPR_CLOCK_MONOTONIC));
+
+  for (size_t i = 0; i < NUM_THREADS; ++i) {
+    gpr_thd_new(&threads[i], create_loop_destroy, args.addr, &options);
+  }
+  for (size_t i = 0; i < NUM_THREADS; ++i) {
+    gpr_thd_join(threads[i]);
+  }
+
+  gpr_atm_rel_store(&args.stop, 1);
+  gpr_thd_join(server);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_pollset_shutdown(&exec_ctx, args.pollset,
+                        GRPC_CLOSURE_CREATE(done_pollset_shutdown, args.pollset,
+                                            grpc_schedule_on_exec_ctx));
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  grpc_shutdown();
+  return 0;
+}
+
+void watches_with_short_timeouts(void* addr) {
+  for (int i = 0; i < NUM_OUTER_LOOPS_SHORT_TIMEOUTS; ++i) {
+    grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+    grpc_channel* chan = grpc_insecure_channel_create((char*)addr, NULL, NULL);
+
+    for (int j = 0; j < NUM_INNER_LOOPS_SHORT_TIMEOUTS; ++j) {
+      gpr_timespec later_time =
+          grpc_timeout_milliseconds_to_deadline(DELAY_MILLIS_SHORT_TIMEOUTS);
+      grpc_connectivity_state state =
+          grpc_channel_check_connectivity_state(chan, 0);
+      GPR_ASSERT(state == GRPC_CHANNEL_IDLE);
+      grpc_channel_watch_connectivity_state(chan, state, later_time, cq, NULL);
+      gpr_timespec poll_time =
+          grpc_timeout_milliseconds_to_deadline(POLL_MILLIS_SHORT_TIMEOUTS);
+      grpc_event ev = grpc_completion_queue_next(cq, poll_time, NULL);
+      GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+      GPR_ASSERT(ev.success == false);
+      /* check that the watcher from "watch state" was free'd */
+      GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(chan) == 0);
+    }
+    grpc_channel_destroy(chan);
+    grpc_completion_queue_destroy(cq);
+  }
+}
+
+// This test tries to catch deadlock situations.
+// With short timeouts on "watches" and long timeouts on cq next calls,
+// so that a QUEUE_TIMEOUT likely means that something is stuck.
+int run_concurrent_watches_with_short_timeouts_test() {
+  grpc_init();
+
+  gpr_thd_id threads[NUM_THREADS];
+
+  char* localhost = gpr_strdup("localhost:54321");
+  gpr_thd_options options = gpr_thd_options_default();
+  gpr_thd_options_set_joinable(&options);
+
+  for (size_t i = 0; i < NUM_THREADS; ++i) {
+    gpr_thd_new(&threads[i], watches_with_short_timeouts, localhost, &options);
+  }
+  for (size_t i = 0; i < NUM_THREADS; ++i) {
+    gpr_thd_join(threads[i]);
+  }
+  gpr_free(localhost);
+
+  grpc_shutdown();
+  return 0;
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  run_concurrent_connectivity_test();
+  run_concurrent_watches_with_short_timeouts_test();
+}
diff --git a/test/core/surface/init_test.c b/test/core/surface/init_test.c
deleted file mode 100644
index b835a2a..0000000
--- a/test/core/surface/init_test.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <grpc/support/log.h>
-#include "test/core/util/test_config.h"
-
-static int g_flag;
-
-static void test(int rounds) {
-  int i;
-  for (i = 0; i < rounds; i++) {
-    grpc_init();
-  }
-  for (i = 0; i < rounds; i++) {
-    grpc_shutdown();
-  }
-}
-
-static void test_mixed(void) {
-  grpc_init();
-  grpc_init();
-  grpc_shutdown();
-  grpc_init();
-  grpc_shutdown();
-  grpc_shutdown();
-}
-
-static void plugin_init(void) { g_flag = 1; }
-static void plugin_destroy(void) { g_flag = 2; }
-
-static void test_plugin() {
-  grpc_register_plugin(plugin_init, plugin_destroy);
-  grpc_init();
-  GPR_ASSERT(g_flag == 1);
-  grpc_shutdown();
-  GPR_ASSERT(g_flag == 2);
-}
-
-static void test_repeatedly() {
-  for (int i = 0; i < 1000; i++) {
-    grpc_init();
-    grpc_shutdown();
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test(1);
-  test(2);
-  test(3);
-  test_mixed();
-  test_plugin();
-  test_repeatedly();
-  return 0;
-}
diff --git a/test/core/surface/init_test.cc b/test/core/surface/init_test.cc
new file mode 100644
index 0000000..5749bc8
--- /dev/null
+++ b/test/core/surface/init_test.cc
@@ -0,0 +1,71 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/support/log.h>
+#include "test/core/util/test_config.h"
+
+static int g_flag;
+
+static void test(int rounds) {
+  int i;
+  for (i = 0; i < rounds; i++) {
+    grpc_init();
+  }
+  for (i = 0; i < rounds; i++) {
+    grpc_shutdown();
+  }
+}
+
+static void test_mixed(void) {
+  grpc_init();
+  grpc_init();
+  grpc_shutdown();
+  grpc_init();
+  grpc_shutdown();
+  grpc_shutdown();
+}
+
+static void plugin_init(void) { g_flag = 1; }
+static void plugin_destroy(void) { g_flag = 2; }
+
+static void test_plugin() {
+  grpc_register_plugin(plugin_init, plugin_destroy);
+  grpc_init();
+  GPR_ASSERT(g_flag == 1);
+  grpc_shutdown();
+  GPR_ASSERT(g_flag == 2);
+}
+
+static void test_repeatedly() {
+  for (int i = 0; i < 1000; i++) {
+    grpc_init();
+    grpc_shutdown();
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test(1);
+  test(2);
+  test(3);
+  test_mixed();
+  test_plugin();
+  test_repeatedly();
+  return 0;
+}
diff --git a/test/core/surface/invalid_channel_args_test.c b/test/core/surface/invalid_channel_args_test.c
deleted file mode 100644
index 9c84c30..0000000
--- a/test/core/surface/invalid_channel_args_test.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include "test/core/util/test_config.h"
-
-static char *g_last_log_error_message = NULL;
-static const char *g_file_name = "channel.cc";
-
-static int ends_with(const char *src, const char *suffix) {
-  size_t src_len = strlen(src);
-  size_t suffix_len = strlen(suffix);
-  if (src_len < suffix_len) {
-    return 0;
-  }
-  return strcmp(src + src_len - suffix_len, suffix) == 0;
-}
-
-static void log_error_sink(gpr_log_func_args *args) {
-  if (args->severity == GPR_LOG_SEVERITY_ERROR &&
-      ends_with(args->file, g_file_name)) {
-    g_last_log_error_message = gpr_strdup(args->message);
-  }
-}
-
-static void verify_last_error(const char *message) {
-  if (message == NULL) {
-    GPR_ASSERT(g_last_log_error_message == NULL);
-    return;
-  }
-  GPR_ASSERT(strcmp(message, g_last_log_error_message) == 0);
-  gpr_free(g_last_log_error_message);
-  g_last_log_error_message = NULL;
-}
-
-static char *compose_error_string(const char *key, const char *message) {
-  char *ret;
-  gpr_asprintf(&ret, "%s%s", key, message);
-  return ret;
-}
-
-static void one_test(grpc_channel_args *args, char *expected_error_message) {
-  grpc_channel *chan =
-      grpc_insecure_channel_create("nonexistant:54321", args, NULL);
-  verify_last_error(expected_error_message);
-  gpr_free(expected_error_message);
-  grpc_channel_destroy(chan);
-}
-
-static void test_no_error_message(void) { one_test(NULL, NULL); }
-
-static void test_default_authority_type(void) {
-  grpc_arg client_arg;
-  grpc_channel_args client_args;
-  char *expected_error_message;
-
-  client_arg.type = GRPC_ARG_INTEGER;
-  client_arg.key = GRPC_ARG_DEFAULT_AUTHORITY;
-  client_arg.value.integer = 0;
-
-  client_args.num_args = 1;
-  client_args.args = &client_arg;
-  expected_error_message = compose_error_string(
-      GRPC_ARG_DEFAULT_AUTHORITY, " ignored: it must be a string");
-  one_test(&client_args, expected_error_message);
-}
-
-static void test_ssl_name_override_type(void) {
-  grpc_arg client_arg;
-  grpc_channel_args client_args;
-  char *expected_error_message;
-
-  client_arg.type = GRPC_ARG_INTEGER;
-  client_arg.key = GRPC_SSL_TARGET_NAME_OVERRIDE_ARG;
-  client_arg.value.integer = 0;
-
-  client_args.num_args = 1;
-  client_args.args = &client_arg;
-  expected_error_message = compose_error_string(
-      GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, " ignored: it must be a string");
-  one_test(&client_args, expected_error_message);
-}
-
-static void test_ssl_name_override_failed(void) {
-  grpc_arg client_arg[2];
-  grpc_channel_args client_args;
-  char *expected_error_message;
-
-  client_arg[0].type = GRPC_ARG_STRING;
-  client_arg[0].key = GRPC_ARG_DEFAULT_AUTHORITY;
-  client_arg[0].value.string = "default";
-  client_arg[1].type = GRPC_ARG_STRING;
-  client_arg[1].key = GRPC_SSL_TARGET_NAME_OVERRIDE_ARG;
-  client_arg[1].value.string = "ssl";
-
-  client_args.num_args = 2;
-  client_args.args = client_arg;
-  expected_error_message =
-      compose_error_string(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
-                           " ignored: default host already set some other way");
-  one_test(&client_args, expected_error_message);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  gpr_set_log_function(log_error_sink);
-
-  test_no_error_message();
-  test_default_authority_type();
-  test_ssl_name_override_type();
-  test_ssl_name_override_failed();
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/surface/invalid_channel_args_test.cc b/test/core/surface/invalid_channel_args_test.cc
new file mode 100644
index 0000000..6a58a32
--- /dev/null
+++ b/test/core/surface/invalid_channel_args_test.cc
@@ -0,0 +1,137 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include "test/core/util/test_config.h"
+
+static char* g_last_log_error_message = NULL;
+static const char* g_file_name = "channel.cc";
+
+static int ends_with(const char* src, const char* suffix) {
+  size_t src_len = strlen(src);
+  size_t suffix_len = strlen(suffix);
+  if (src_len < suffix_len) {
+    return 0;
+  }
+  return strcmp(src + src_len - suffix_len, suffix) == 0;
+}
+
+static void log_error_sink(gpr_log_func_args* args) {
+  if (args->severity == GPR_LOG_SEVERITY_ERROR &&
+      ends_with(args->file, g_file_name)) {
+    g_last_log_error_message = gpr_strdup(args->message);
+  }
+}
+
+static void verify_last_error(const char* message) {
+  if (message == NULL) {
+    GPR_ASSERT(g_last_log_error_message == NULL);
+    return;
+  }
+  GPR_ASSERT(strcmp(message, g_last_log_error_message) == 0);
+  gpr_free(g_last_log_error_message);
+  g_last_log_error_message = NULL;
+}
+
+static char* compose_error_string(const char* key, const char* message) {
+  char* ret;
+  gpr_asprintf(&ret, "%s%s", key, message);
+  return ret;
+}
+
+static void one_test(grpc_channel_args* args, char* expected_error_message) {
+  grpc_channel* chan =
+      grpc_insecure_channel_create("nonexistant:54321", args, NULL);
+  verify_last_error(expected_error_message);
+  gpr_free(expected_error_message);
+  grpc_channel_destroy(chan);
+}
+
+static void test_no_error_message(void) { one_test(NULL, NULL); }
+
+static void test_default_authority_type(void) {
+  grpc_arg client_arg;
+  grpc_channel_args client_args;
+  char* expected_error_message;
+
+  client_arg.type = GRPC_ARG_INTEGER;
+  client_arg.key = const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY);
+  client_arg.value.integer = 0;
+
+  client_args.num_args = 1;
+  client_args.args = &client_arg;
+  expected_error_message = compose_error_string(
+      GRPC_ARG_DEFAULT_AUTHORITY, " ignored: it must be a string");
+  one_test(&client_args, expected_error_message);
+}
+
+static void test_ssl_name_override_type(void) {
+  grpc_arg client_arg;
+  grpc_channel_args client_args;
+  char* expected_error_message;
+
+  client_arg.type = GRPC_ARG_INTEGER;
+  client_arg.key = const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG);
+  client_arg.value.integer = 0;
+
+  client_args.num_args = 1;
+  client_args.args = &client_arg;
+  expected_error_message = compose_error_string(
+      GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, " ignored: it must be a string");
+  one_test(&client_args, expected_error_message);
+}
+
+static void test_ssl_name_override_failed(void) {
+  grpc_arg client_arg[2];
+  grpc_channel_args client_args;
+  char* expected_error_message;
+
+  client_arg[0].type = GRPC_ARG_STRING;
+  client_arg[0].key = const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY);
+  client_arg[0].value.string = const_cast<char*>("default");
+  client_arg[1].type = GRPC_ARG_STRING;
+  client_arg[1].key = const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG);
+  client_arg[1].value.string = const_cast<char*>("ssl");
+
+  client_args.num_args = 2;
+  client_args.args = client_arg;
+  expected_error_message =
+      compose_error_string(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
+                           " ignored: default host already set some other way");
+  one_test(&client_args, expected_error_message);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  gpr_set_log_function(log_error_sink);
+
+  test_no_error_message();
+  test_default_authority_type();
+  test_ssl_name_override_type();
+  test_ssl_name_override_failed();
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c
deleted file mode 100644
index f623e1a..0000000
--- a/test/core/surface/lame_client_test.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/transport/transport.h"
-#include "test/core/end2end/cq_verifier.h"
-#include "test/core/util/test_config.h"
-
-grpc_closure transport_op_cb;
-
-static void *tag(intptr_t x) { return (void *)x; }
-
-void verify_connectivity(grpc_exec_ctx *exec_ctx, void *arg,
-                         grpc_error *error) {
-  grpc_connectivity_state *state = arg;
-  GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN == *state);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-}
-
-void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
-
-void test_transport_op(grpc_channel *channel) {
-  grpc_transport_op *op;
-  grpc_channel_element *elem;
-  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  GRPC_CLOSURE_INIT(&transport_op_cb, verify_connectivity, &state,
-                    grpc_schedule_on_exec_ctx);
-
-  op = grpc_make_transport_op(NULL);
-  op->on_connectivity_state_change = &transport_op_cb;
-  op->connectivity_state = &state;
-  elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0);
-  elem->filter->start_transport_op(&exec_ctx, elem, op);
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  GRPC_CLOSURE_INIT(&transport_op_cb, do_nothing, NULL,
-                    grpc_schedule_on_exec_ctx);
-  op = grpc_make_transport_op(&transport_op_cb);
-  elem->filter->start_transport_op(&exec_ctx, elem, op);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_channel *chan;
-  grpc_call *call;
-  grpc_completion_queue *cq;
-  cq_verifier *cqv;
-  grpc_op ops[6];
-  grpc_op *op;
-  grpc_metadata_array initial_metadata_recv;
-  grpc_metadata_array trailing_metadata_recv;
-  grpc_status_code status;
-  grpc_call_error error;
-  grpc_slice details;
-  char *peer;
-
-  grpc_test_init(argc, argv);
-  grpc_init();
-
-  grpc_metadata_array_init(&initial_metadata_recv);
-  grpc_metadata_array_init(&trailing_metadata_recv);
-
-  chan = grpc_lame_client_channel_create(
-      "lampoon:national", GRPC_STATUS_UNKNOWN, "Rpc sent on a lame channel.");
-  GPR_ASSERT(chan);
-
-  test_transport_op(chan);
-
-  GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN ==
-             grpc_channel_check_connectivity_state(chan, 0));
-
-  cq = grpc_completion_queue_create_for_next(NULL);
-
-  grpc_slice host = grpc_slice_from_static_string("anywhere");
-  call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
-                                  grpc_slice_from_static_string("/Foo"), &host,
-                                  grpc_timeout_seconds_to_deadline(100), NULL);
-  GPR_ASSERT(call);
-  cqv = cq_verifier_create(cq);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_SEND_INITIAL_METADATA;
-  op->data.send_initial_metadata.count = 0;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  op->op = GRPC_OP_RECV_INITIAL_METADATA;
-  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(call, ops, (size_t)(op - ops), tag(1), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  /* the call should immediately fail */
-  CQ_EXPECT_COMPLETION(cqv, tag(1), 0);
-  cq_verify(cqv);
-
-  memset(ops, 0, sizeof(ops));
-  op = ops;
-  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
-  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
-  op->data.recv_status_on_client.status = &status;
-  op->data.recv_status_on_client.status_details = &details;
-  op->flags = 0;
-  op->reserved = NULL;
-  op++;
-  error = grpc_call_start_batch(call, ops, (size_t)(op - ops), tag(2), NULL);
-  GPR_ASSERT(GRPC_CALL_OK == error);
-
-  /* the call should immediately fail */
-  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
-  cq_verify(cqv);
-
-  peer = grpc_call_get_peer(call);
-  GPR_ASSERT(strcmp(peer, "lampoon:national") == 0);
-  gpr_free(peer);
-
-  grpc_call_unref(call);
-  grpc_channel_destroy(chan);
-  cq_verifier_destroy(cqv);
-  grpc_completion_queue_destroy(cq);
-
-  grpc_metadata_array_destroy(&initial_metadata_recv);
-  grpc_metadata_array_destroy(&trailing_metadata_recv);
-  grpc_slice_unref(details);
-
-  grpc_shutdown();
-
-  return 0;
-}
diff --git a/test/core/surface/lame_client_test.cc b/test/core/surface/lame_client_test.cc
new file mode 100644
index 0000000..c374adc
--- /dev/null
+++ b/test/core/surface/lame_client_test.cc
@@ -0,0 +1,156 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/transport/transport.h"
+#include "test/core/end2end/cq_verifier.h"
+#include "test/core/util/test_config.h"
+
+grpc_closure transport_op_cb;
+
+static void* tag(intptr_t x) { return (void*)x; }
+
+void verify_connectivity(grpc_exec_ctx* exec_ctx, void* arg,
+                         grpc_error* error) {
+  grpc_connectivity_state* state = static_cast<grpc_connectivity_state*>(arg);
+  GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN == *state);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+}
+
+void do_nothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
+
+void test_transport_op(grpc_channel* channel) {
+  grpc_transport_op* op;
+  grpc_channel_element* elem;
+  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  GRPC_CLOSURE_INIT(&transport_op_cb, verify_connectivity, &state,
+                    grpc_schedule_on_exec_ctx);
+
+  op = grpc_make_transport_op(NULL);
+  op->on_connectivity_state_change = &transport_op_cb;
+  op->connectivity_state = &state;
+  elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0);
+  elem->filter->start_transport_op(&exec_ctx, elem, op);
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  GRPC_CLOSURE_INIT(&transport_op_cb, do_nothing, NULL,
+                    grpc_schedule_on_exec_ctx);
+  op = grpc_make_transport_op(&transport_op_cb);
+  elem->filter->start_transport_op(&exec_ctx, elem, op);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_channel* chan;
+  grpc_call* call;
+  grpc_completion_queue* cq;
+  cq_verifier* cqv;
+  grpc_op ops[6];
+  grpc_op* op;
+  grpc_metadata_array initial_metadata_recv;
+  grpc_metadata_array trailing_metadata_recv;
+  grpc_status_code status;
+  grpc_call_error error;
+  grpc_slice details;
+  char* peer;
+
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  grpc_metadata_array_init(&initial_metadata_recv);
+  grpc_metadata_array_init(&trailing_metadata_recv);
+
+  chan = grpc_lame_client_channel_create(
+      "lampoon:national", GRPC_STATUS_UNKNOWN, "Rpc sent on a lame channel.");
+  GPR_ASSERT(chan);
+
+  test_transport_op(chan);
+
+  GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN ==
+             grpc_channel_check_connectivity_state(chan, 0));
+
+  cq = grpc_completion_queue_create_for_next(NULL);
+
+  grpc_slice host = grpc_slice_from_static_string("anywhere");
+  call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
+                                  grpc_slice_from_static_string("/Foo"), &host,
+                                  grpc_timeout_seconds_to_deadline(100), NULL);
+  GPR_ASSERT(call);
+  cqv = cq_verifier_create(cq);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_SEND_INITIAL_METADATA;
+  op->data.send_initial_metadata.count = 0;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  op->op = GRPC_OP_RECV_INITIAL_METADATA;
+  op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(call, ops, (size_t)(op - ops), tag(1), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  /* the call should immediately fail */
+  CQ_EXPECT_COMPLETION(cqv, tag(1), 0);
+  cq_verify(cqv);
+
+  memset(ops, 0, sizeof(ops));
+  op = ops;
+  op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+  op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
+  op->data.recv_status_on_client.status = &status;
+  op->data.recv_status_on_client.status_details = &details;
+  op->flags = 0;
+  op->reserved = NULL;
+  op++;
+  error = grpc_call_start_batch(call, ops, (size_t)(op - ops), tag(2), NULL);
+  GPR_ASSERT(GRPC_CALL_OK == error);
+
+  /* the call should immediately fail */
+  CQ_EXPECT_COMPLETION(cqv, tag(2), 1);
+  cq_verify(cqv);
+
+  peer = grpc_call_get_peer(call);
+  GPR_ASSERT(strcmp(peer, "lampoon:national") == 0);
+  gpr_free(peer);
+
+  grpc_call_unref(call);
+  grpc_channel_destroy(chan);
+  cq_verifier_destroy(cqv);
+  grpc_completion_queue_destroy(cq);
+
+  grpc_metadata_array_destroy(&initial_metadata_recv);
+  grpc_metadata_array_destroy(&trailing_metadata_recv);
+  grpc_slice_unref(details);
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/surface/num_external_connectivity_watchers_test.c b/test/core/surface/num_external_connectivity_watchers_test.c
deleted file mode 100644
index 16401bb..0000000
--- a/test/core/surface/num_external_connectivity_watchers_test.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct test_fixture {
-  const char *name;
-  grpc_channel *(*create_channel)(const char *addr);
-} test_fixture;
-
-static size_t next_tag = 1;
-
-static void channel_idle_start_watch(grpc_channel *channel,
-                                     grpc_completion_queue *cq) {
-  gpr_timespec connect_deadline = grpc_timeout_milliseconds_to_deadline(1);
-  GPR_ASSERT(grpc_channel_check_connectivity_state(channel, 0) ==
-             GRPC_CHANNEL_IDLE);
-
-  grpc_channel_watch_connectivity_state(
-      channel, GRPC_CHANNEL_IDLE, connect_deadline, cq, (void *)(next_tag++));
-  gpr_log(GPR_DEBUG, "number of active connect watchers: %d",
-          grpc_channel_num_external_connectivity_watchers(channel));
-}
-
-static void channel_idle_poll_for_timeout(grpc_channel *channel,
-                                          grpc_completion_queue *cq) {
-  grpc_event ev =
-      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-
-  /* expect watch_connectivity_state to end with a timeout */
-  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  GPR_ASSERT(ev.success == false);
-  GPR_ASSERT(grpc_channel_check_connectivity_state(channel, 0) ==
-             GRPC_CHANNEL_IDLE);
-}
-
-/* Test and use the "num_external_watchers" call to make sure
- * that "connectivity watcher" structs are free'd just after, if
- * their corresponding timeouts occur. */
-static void run_timeouts_test(const test_fixture *fixture) {
-  gpr_log(GPR_INFO, "TEST: %s", fixture->name);
-
-  char *addr;
-
-  grpc_init();
-
-  gpr_join_host_port(&addr, "localhost", grpc_pick_unused_port_or_die());
-
-  grpc_channel *channel = fixture->create_channel(addr);
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-
-  /* start 1 watcher and then let it time out */
-  channel_idle_start_watch(channel, cq);
-  channel_idle_poll_for_timeout(channel, cq);
-  GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channel) == 0);
-
-  /* start 3 watchers and then let them all time out */
-  for (size_t i = 1; i <= 3; i++) {
-    channel_idle_start_watch(channel, cq);
-  }
-  for (size_t i = 1; i <= 3; i++) {
-    channel_idle_poll_for_timeout(channel, cq);
-  }
-  GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channel) == 0);
-
-  /* start 3 watchers, see one time out, start another 3, and then see them all
-   * time out */
-  for (size_t i = 1; i <= 3; i++) {
-    channel_idle_start_watch(channel, cq);
-  }
-  channel_idle_poll_for_timeout(channel, cq);
-  for (size_t i = 3; i <= 5; i++) {
-    channel_idle_start_watch(channel, cq);
-  }
-  for (size_t i = 1; i <= 5; i++) {
-    channel_idle_poll_for_timeout(channel, cq);
-  }
-  GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channel) == 0);
-
-  grpc_channel_destroy(channel);
-  grpc_completion_queue_shutdown(cq);
-  GPR_ASSERT(
-      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
-          .type == GRPC_QUEUE_SHUTDOWN);
-  grpc_completion_queue_destroy(cq);
-
-  grpc_shutdown();
-  gpr_free(addr);
-}
-
-/* An edge scenario; sets channel state to explicitly, and outside
- * of a polling call. */
-static void run_channel_shutdown_before_timeout_test(
-    const test_fixture *fixture) {
-  gpr_log(GPR_INFO, "TEST: %s", fixture->name);
-
-  char *addr;
-
-  grpc_init();
-
-  gpr_join_host_port(&addr, "localhost", grpc_pick_unused_port_or_die());
-
-  grpc_channel *channel = fixture->create_channel(addr);
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-
-  /* start 1 watcher and then shut down the channel before the timer goes off */
-  GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channel) == 0);
-
-  /* expecting a 30 second timeout to go off much later than the shutdown. */
-  gpr_timespec connect_deadline = grpc_timeout_seconds_to_deadline(30);
-  GPR_ASSERT(grpc_channel_check_connectivity_state(channel, 0) ==
-             GRPC_CHANNEL_IDLE);
-
-  grpc_channel_watch_connectivity_state(channel, GRPC_CHANNEL_IDLE,
-                                        connect_deadline, cq, (void *)1);
-  grpc_channel_destroy(channel);
-
-  grpc_event ev =
-      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  /* expect success with a state transition to CHANNEL_SHUTDOWN */
-  GPR_ASSERT(ev.success == true);
-
-  grpc_completion_queue_shutdown(cq);
-  GPR_ASSERT(
-      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
-          .type == GRPC_QUEUE_SHUTDOWN);
-  grpc_completion_queue_destroy(cq);
-
-  grpc_shutdown();
-  gpr_free(addr);
-}
-
-static grpc_channel *insecure_test_create_channel(const char *addr) {
-  return grpc_insecure_channel_create(addr, NULL, NULL);
-}
-
-static const test_fixture insecure_test = {
-    "insecure", insecure_test_create_channel,
-};
-
-static grpc_channel *secure_test_create_channel(const char *addr) {
-  grpc_channel_credentials *ssl_creds =
-      grpc_ssl_credentials_create(test_root_cert, NULL, NULL);
-  grpc_arg ssl_name_override = {GRPC_ARG_STRING,
-                                GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
-                                {"foo.test.google.fr"}};
-  grpc_channel_args *new_client_args =
-      grpc_channel_args_copy_and_add(NULL, &ssl_name_override, 1);
-  grpc_channel *channel =
-      grpc_secure_channel_create(ssl_creds, addr, new_client_args, NULL);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, new_client_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_channel_credentials_release(ssl_creds);
-  return channel;
-}
-
-static const test_fixture secure_test = {
-    "secure", secure_test_create_channel,
-};
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  run_timeouts_test(&insecure_test);
-  run_timeouts_test(&secure_test);
-
-  run_channel_shutdown_before_timeout_test(&insecure_test);
-  run_channel_shutdown_before_timeout_test(&secure_test);
-}
diff --git a/test/core/surface/num_external_connectivity_watchers_test.cc b/test/core/surface/num_external_connectivity_watchers_test.cc
new file mode 100644
index 0000000..89dc364
--- /dev/null
+++ b/test/core/surface/num_external_connectivity_watchers_test.cc
@@ -0,0 +1,202 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct test_fixture {
+  const char* name;
+  grpc_channel* (*create_channel)(const char* addr);
+} test_fixture;
+
+static size_t next_tag = 1;
+
+static void channel_idle_start_watch(grpc_channel* channel,
+                                     grpc_completion_queue* cq) {
+  gpr_timespec connect_deadline = grpc_timeout_milliseconds_to_deadline(1);
+  GPR_ASSERT(grpc_channel_check_connectivity_state(channel, 0) ==
+             GRPC_CHANNEL_IDLE);
+
+  grpc_channel_watch_connectivity_state(
+      channel, GRPC_CHANNEL_IDLE, connect_deadline, cq, (void*)(next_tag++));
+  gpr_log(GPR_DEBUG, "number of active connect watchers: %d",
+          grpc_channel_num_external_connectivity_watchers(channel));
+}
+
+static void channel_idle_poll_for_timeout(grpc_channel* channel,
+                                          grpc_completion_queue* cq) {
+  grpc_event ev =
+      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+
+  /* expect watch_connectivity_state to end with a timeout */
+  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  GPR_ASSERT(ev.success == false);
+  GPR_ASSERT(grpc_channel_check_connectivity_state(channel, 0) ==
+             GRPC_CHANNEL_IDLE);
+}
+
+/* Test and use the "num_external_watchers" call to make sure
+ * that "connectivity watcher" structs are free'd just after, if
+ * their corresponding timeouts occur. */
+static void run_timeouts_test(const test_fixture* fixture) {
+  gpr_log(GPR_INFO, "TEST: %s", fixture->name);
+
+  char* addr;
+
+  grpc_init();
+
+  gpr_join_host_port(&addr, "localhost", grpc_pick_unused_port_or_die());
+
+  grpc_channel* channel = fixture->create_channel(addr);
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+
+  /* start 1 watcher and then let it time out */
+  channel_idle_start_watch(channel, cq);
+  channel_idle_poll_for_timeout(channel, cq);
+  GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channel) == 0);
+
+  /* start 3 watchers and then let them all time out */
+  for (size_t i = 1; i <= 3; i++) {
+    channel_idle_start_watch(channel, cq);
+  }
+  for (size_t i = 1; i <= 3; i++) {
+    channel_idle_poll_for_timeout(channel, cq);
+  }
+  GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channel) == 0);
+
+  /* start 3 watchers, see one time out, start another 3, and then see them all
+   * time out */
+  for (size_t i = 1; i <= 3; i++) {
+    channel_idle_start_watch(channel, cq);
+  }
+  channel_idle_poll_for_timeout(channel, cq);
+  for (size_t i = 3; i <= 5; i++) {
+    channel_idle_start_watch(channel, cq);
+  }
+  for (size_t i = 1; i <= 5; i++) {
+    channel_idle_poll_for_timeout(channel, cq);
+  }
+  GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channel) == 0);
+
+  grpc_channel_destroy(channel);
+  grpc_completion_queue_shutdown(cq);
+  GPR_ASSERT(
+      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
+          .type == GRPC_QUEUE_SHUTDOWN);
+  grpc_completion_queue_destroy(cq);
+
+  grpc_shutdown();
+  gpr_free(addr);
+}
+
+/* An edge scenario; sets channel state to explicitly, and outside
+ * of a polling call. */
+static void run_channel_shutdown_before_timeout_test(
+    const test_fixture* fixture) {
+  gpr_log(GPR_INFO, "TEST: %s", fixture->name);
+
+  char* addr;
+
+  grpc_init();
+
+  gpr_join_host_port(&addr, "localhost", grpc_pick_unused_port_or_die());
+
+  grpc_channel* channel = fixture->create_channel(addr);
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+
+  /* start 1 watcher and then shut down the channel before the timer goes off */
+  GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channel) == 0);
+
+  /* expecting a 30 second timeout to go off much later than the shutdown. */
+  gpr_timespec connect_deadline = grpc_timeout_seconds_to_deadline(30);
+  GPR_ASSERT(grpc_channel_check_connectivity_state(channel, 0) ==
+             GRPC_CHANNEL_IDLE);
+
+  grpc_channel_watch_connectivity_state(channel, GRPC_CHANNEL_IDLE,
+                                        connect_deadline, cq, (void*)1);
+  grpc_channel_destroy(channel);
+
+  grpc_event ev =
+      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  /* expect success with a state transition to CHANNEL_SHUTDOWN */
+  GPR_ASSERT(ev.success == true);
+
+  grpc_completion_queue_shutdown(cq);
+  GPR_ASSERT(
+      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
+          .type == GRPC_QUEUE_SHUTDOWN);
+  grpc_completion_queue_destroy(cq);
+
+  grpc_shutdown();
+  gpr_free(addr);
+}
+
+static grpc_channel* insecure_test_create_channel(const char* addr) {
+  return grpc_insecure_channel_create(addr, NULL, NULL);
+}
+
+static const test_fixture insecure_test = {
+    "insecure",
+    insecure_test_create_channel,
+};
+
+static grpc_channel* secure_test_create_channel(const char* addr) {
+  grpc_channel_credentials* ssl_creds =
+      grpc_ssl_credentials_create(test_root_cert, NULL, NULL);
+  grpc_arg ssl_name_override = {
+      GRPC_ARG_STRING,
+      const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
+      {const_cast<char*>("foo.test.google.fr")}};
+  grpc_channel_args* new_client_args =
+      grpc_channel_args_copy_and_add(NULL, &ssl_name_override, 1);
+  grpc_channel* channel =
+      grpc_secure_channel_create(ssl_creds, addr, new_client_args, NULL);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, new_client_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_channel_credentials_release(ssl_creds);
+  return channel;
+}
+
+static const test_fixture secure_test = {
+    "secure",
+    secure_test_create_channel,
+};
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  run_timeouts_test(&insecure_test);
+  run_timeouts_test(&secure_test);
+
+  run_channel_shutdown_before_timeout_test(&insecure_test);
+  run_channel_shutdown_before_timeout_test(&secure_test);
+}
diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c
index d36d116..db9f902 100644
--- a/test/core/surface/public_headers_must_be_c89.c
+++ b/test/core/surface/public_headers_must_be_c89.c
@@ -63,4 +63,291 @@
 #include <grpc/support/useful.h>
 #include <grpc/support/workaround_list.h>
 
-int main(int argc, char **argv) { return 0; }
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+  if(argc == 12345678) {
+    printf("%lx", (unsigned long) grpc_compression_algorithm_parse);
+    printf("%lx", (unsigned long) grpc_compression_algorithm_name);
+    printf("%lx", (unsigned long) grpc_stream_compression_algorithm_name);
+    printf("%lx", (unsigned long) grpc_compression_algorithm_for_level);
+    printf("%lx", (unsigned long) grpc_stream_compression_algorithm_for_level);
+    printf("%lx", (unsigned long) grpc_compression_options_init);
+    printf("%lx", (unsigned long) grpc_compression_options_enable_algorithm);
+    printf("%lx", (unsigned long) grpc_compression_options_disable_algorithm);
+    printf("%lx", (unsigned long) grpc_compression_options_is_algorithm_enabled);
+    printf("%lx", (unsigned long) grpc_compression_options_is_stream_compression_algorithm_enabled);
+    printf("%lx", (unsigned long) grpc_metadata_array_init);
+    printf("%lx", (unsigned long) grpc_metadata_array_destroy);
+    printf("%lx", (unsigned long) grpc_call_details_init);
+    printf("%lx", (unsigned long) grpc_call_details_destroy);
+    printf("%lx", (unsigned long) grpc_register_plugin);
+    printf("%lx", (unsigned long) grpc_init);
+    printf("%lx", (unsigned long) grpc_shutdown);
+    printf("%lx", (unsigned long) grpc_version_string);
+    printf("%lx", (unsigned long) grpc_g_stands_for);
+    printf("%lx", (unsigned long) grpc_completion_queue_factory_lookup);
+    printf("%lx", (unsigned long) grpc_completion_queue_create_for_next);
+    printf("%lx", (unsigned long) grpc_completion_queue_create_for_pluck);
+    printf("%lx", (unsigned long) grpc_completion_queue_create);
+    printf("%lx", (unsigned long) grpc_completion_queue_next);
+    printf("%lx", (unsigned long) grpc_completion_queue_pluck);
+    printf("%lx", (unsigned long) grpc_completion_queue_shutdown);
+    printf("%lx", (unsigned long) grpc_completion_queue_destroy);
+    printf("%lx", (unsigned long) grpc_completion_queue_thread_local_cache_init);
+    printf("%lx", (unsigned long) grpc_completion_queue_thread_local_cache_flush);
+    printf("%lx", (unsigned long) grpc_alarm_create);
+    printf("%lx", (unsigned long) grpc_alarm_set);
+    printf("%lx", (unsigned long) grpc_alarm_cancel);
+    printf("%lx", (unsigned long) grpc_alarm_destroy);
+    printf("%lx", (unsigned long) grpc_channel_check_connectivity_state);
+    printf("%lx", (unsigned long) grpc_channel_num_external_connectivity_watchers);
+    printf("%lx", (unsigned long) grpc_channel_watch_connectivity_state);
+    printf("%lx", (unsigned long) grpc_channel_support_connectivity_watcher);
+    printf("%lx", (unsigned long) grpc_channel_create_call);
+    printf("%lx", (unsigned long) grpc_channel_ping);
+    printf("%lx", (unsigned long) grpc_channel_register_call);
+    printf("%lx", (unsigned long) grpc_channel_create_registered_call);
+    printf("%lx", (unsigned long) grpc_call_arena_alloc);
+    printf("%lx", (unsigned long) grpc_call_start_batch);
+    printf("%lx", (unsigned long) grpc_call_get_peer);
+    printf("%lx", (unsigned long) grpc_census_call_set_context);
+    printf("%lx", (unsigned long) grpc_census_call_get_context);
+    printf("%lx", (unsigned long) grpc_channel_get_target);
+    printf("%lx", (unsigned long) grpc_channel_get_info);
+    printf("%lx", (unsigned long) grpc_insecure_channel_create);
+    printf("%lx", (unsigned long) grpc_lame_client_channel_create);
+    printf("%lx", (unsigned long) grpc_channel_destroy);
+    printf("%lx", (unsigned long) grpc_call_cancel);
+    printf("%lx", (unsigned long) grpc_call_cancel_with_status);
+    printf("%lx", (unsigned long) grpc_call_ref);
+    printf("%lx", (unsigned long) grpc_call_unref);
+    printf("%lx", (unsigned long) grpc_server_request_call);
+    printf("%lx", (unsigned long) grpc_server_register_method);
+    printf("%lx", (unsigned long) grpc_server_request_registered_call);
+    printf("%lx", (unsigned long) grpc_server_create);
+    printf("%lx", (unsigned long) grpc_server_register_completion_queue);
+    printf("%lx", (unsigned long) grpc_server_add_insecure_http2_port);
+    printf("%lx", (unsigned long) grpc_server_start);
+    printf("%lx", (unsigned long) grpc_server_shutdown_and_notify);
+    printf("%lx", (unsigned long) grpc_server_cancel_all_calls);
+    printf("%lx", (unsigned long) grpc_server_destroy);
+    printf("%lx", (unsigned long) grpc_tracer_set_enabled);
+    printf("%lx", (unsigned long) grpc_header_key_is_legal);
+    printf("%lx", (unsigned long) grpc_header_nonbin_value_is_legal);
+    printf("%lx", (unsigned long) grpc_is_binary_header);
+    printf("%lx", (unsigned long) grpc_call_error_to_string);
+    printf("%lx", (unsigned long) grpc_resource_quota_create);
+    printf("%lx", (unsigned long) grpc_resource_quota_ref);
+    printf("%lx", (unsigned long) grpc_resource_quota_unref);
+    printf("%lx", (unsigned long) grpc_resource_quota_resize);
+    printf("%lx", (unsigned long) grpc_resource_quota_arg_vtable);
+    printf("%lx", (unsigned long) grpc_auth_property_iterator_next);
+    printf("%lx", (unsigned long) grpc_auth_context_property_iterator);
+    printf("%lx", (unsigned long) grpc_auth_context_peer_identity);
+    printf("%lx", (unsigned long) grpc_auth_context_find_properties_by_name);
+    printf("%lx", (unsigned long) grpc_auth_context_peer_identity_property_name);
+    printf("%lx", (unsigned long) grpc_auth_context_peer_is_authenticated);
+    printf("%lx", (unsigned long) grpc_call_auth_context);
+    printf("%lx", (unsigned long) grpc_auth_context_release);
+    printf("%lx", (unsigned long) grpc_auth_context_add_property);
+    printf("%lx", (unsigned long) grpc_auth_context_add_cstring_property);
+    printf("%lx", (unsigned long) grpc_auth_context_set_peer_identity_property_name);
+    printf("%lx", (unsigned long) grpc_channel_credentials_release);
+    printf("%lx", (unsigned long) grpc_google_default_credentials_create);
+    printf("%lx", (unsigned long) grpc_set_ssl_roots_override_callback);
+    printf("%lx", (unsigned long) grpc_ssl_credentials_create);
+    printf("%lx", (unsigned long) grpc_call_credentials_release);
+    printf("%lx", (unsigned long) grpc_composite_channel_credentials_create);
+    printf("%lx", (unsigned long) grpc_composite_call_credentials_create);
+    printf("%lx", (unsigned long) grpc_google_compute_engine_credentials_create);
+    printf("%lx", (unsigned long) grpc_max_auth_token_lifetime);
+    printf("%lx", (unsigned long) grpc_service_account_jwt_access_credentials_create);
+    printf("%lx", (unsigned long) grpc_google_refresh_token_credentials_create);
+    printf("%lx", (unsigned long) grpc_access_token_credentials_create);
+    printf("%lx", (unsigned long) grpc_google_iam_credentials_create);
+    printf("%lx", (unsigned long) grpc_metadata_credentials_create_from_plugin);
+    printf("%lx", (unsigned long) grpc_secure_channel_create);
+    printf("%lx", (unsigned long) grpc_server_credentials_release);
+    printf("%lx", (unsigned long) grpc_ssl_server_certificate_config_create);
+    printf("%lx", (unsigned long) grpc_ssl_server_certificate_config_destroy);
+    printf("%lx", (unsigned long) grpc_ssl_server_credentials_create);
+    printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_ex);
+    printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_options_using_config);
+    printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_options_using_config_fetcher);
+    printf("%lx", (unsigned long) grpc_ssl_server_credentials_options_destroy);
+    printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_with_options);
+    printf("%lx", (unsigned long) grpc_server_add_secure_http2_port);
+    printf("%lx", (unsigned long) grpc_call_set_credentials);
+    printf("%lx", (unsigned long) grpc_server_credentials_set_auth_metadata_processor);
+    printf("%lx", (unsigned long) grpc_raw_byte_buffer_create);
+    printf("%lx", (unsigned long) grpc_raw_compressed_byte_buffer_create);
+    printf("%lx", (unsigned long) grpc_byte_buffer_copy);
+    printf("%lx", (unsigned long) grpc_byte_buffer_length);
+    printf("%lx", (unsigned long) grpc_byte_buffer_destroy);
+    printf("%lx", (unsigned long) grpc_byte_buffer_reader_init);
+    printf("%lx", (unsigned long) grpc_byte_buffer_reader_destroy);
+    printf("%lx", (unsigned long) grpc_byte_buffer_reader_next);
+    printf("%lx", (unsigned long) grpc_byte_buffer_reader_readall);
+    printf("%lx", (unsigned long) grpc_raw_byte_buffer_from_reader);
+    printf("%lx", (unsigned long) grpc_slice_ref);
+    printf("%lx", (unsigned long) grpc_slice_unref);
+    printf("%lx", (unsigned long) grpc_slice_copy);
+    printf("%lx", (unsigned long) grpc_slice_new);
+    printf("%lx", (unsigned long) grpc_slice_new_with_user_data);
+    printf("%lx", (unsigned long) grpc_slice_new_with_len);
+    printf("%lx", (unsigned long) grpc_slice_malloc);
+    printf("%lx", (unsigned long) grpc_slice_malloc_large);
+    printf("%lx", (unsigned long) grpc_slice_intern);
+    printf("%lx", (unsigned long) grpc_slice_from_copied_string);
+    printf("%lx", (unsigned long) grpc_slice_from_copied_buffer);
+    printf("%lx", (unsigned long) grpc_slice_from_static_string);
+    printf("%lx", (unsigned long) grpc_slice_from_static_buffer);
+    printf("%lx", (unsigned long) grpc_slice_sub);
+    printf("%lx", (unsigned long) grpc_slice_sub_no_ref);
+    printf("%lx", (unsigned long) grpc_slice_split_tail);
+    printf("%lx", (unsigned long) grpc_slice_split_tail_maybe_ref);
+    printf("%lx", (unsigned long) grpc_slice_split_head);
+    printf("%lx", (unsigned long) grpc_empty_slice);
+    printf("%lx", (unsigned long) grpc_slice_default_hash_impl);
+    printf("%lx", (unsigned long) grpc_slice_default_eq_impl);
+    printf("%lx", (unsigned long) grpc_slice_eq);
+    printf("%lx", (unsigned long) grpc_slice_cmp);
+    printf("%lx", (unsigned long) grpc_slice_str_cmp);
+    printf("%lx", (unsigned long) grpc_slice_buf_start_eq);
+    printf("%lx", (unsigned long) grpc_slice_rchr);
+    printf("%lx", (unsigned long) grpc_slice_chr);
+    printf("%lx", (unsigned long) grpc_slice_slice);
+    printf("%lx", (unsigned long) grpc_slice_hash);
+    printf("%lx", (unsigned long) grpc_slice_is_equivalent);
+    printf("%lx", (unsigned long) grpc_slice_dup);
+    printf("%lx", (unsigned long) grpc_slice_to_c_string);
+    printf("%lx", (unsigned long) grpc_slice_buffer_init);
+    printf("%lx", (unsigned long) grpc_slice_buffer_destroy);
+    printf("%lx", (unsigned long) grpc_slice_buffer_add);
+    printf("%lx", (unsigned long) grpc_slice_buffer_add_indexed);
+    printf("%lx", (unsigned long) grpc_slice_buffer_addn);
+    printf("%lx", (unsigned long) grpc_slice_buffer_tiny_add);
+    printf("%lx", (unsigned long) grpc_slice_buffer_pop);
+    printf("%lx", (unsigned long) grpc_slice_buffer_reset_and_unref);
+    printf("%lx", (unsigned long) grpc_slice_buffer_swap);
+    printf("%lx", (unsigned long) grpc_slice_buffer_move_into);
+    printf("%lx", (unsigned long) grpc_slice_buffer_trim_end);
+    printf("%lx", (unsigned long) grpc_slice_buffer_move_first);
+    printf("%lx", (unsigned long) grpc_slice_buffer_move_first_no_ref);
+    printf("%lx", (unsigned long) grpc_slice_buffer_move_first_into_buffer);
+    printf("%lx", (unsigned long) grpc_slice_buffer_take_first);
+    printf("%lx", (unsigned long) grpc_slice_buffer_undo_take_first);
+    printf("%lx", (unsigned long) gpr_malloc);
+    printf("%lx", (unsigned long) gpr_zalloc);
+    printf("%lx", (unsigned long) gpr_free);
+    printf("%lx", (unsigned long) gpr_realloc);
+    printf("%lx", (unsigned long) gpr_malloc_aligned);
+    printf("%lx", (unsigned long) gpr_free_aligned);
+    printf("%lx", (unsigned long) gpr_set_allocation_functions);
+    printf("%lx", (unsigned long) gpr_get_allocation_functions);
+    printf("%lx", (unsigned long) gpr_avl_create);
+    printf("%lx", (unsigned long) gpr_avl_ref);
+    printf("%lx", (unsigned long) gpr_avl_unref);
+    printf("%lx", (unsigned long) gpr_avl_add);
+    printf("%lx", (unsigned long) gpr_avl_remove);
+    printf("%lx", (unsigned long) gpr_avl_get);
+    printf("%lx", (unsigned long) gpr_avl_maybe_get);
+    printf("%lx", (unsigned long) gpr_avl_is_empty);
+    printf("%lx", (unsigned long) gpr_cmdline_create);
+    printf("%lx", (unsigned long) gpr_cmdline_add_int);
+    printf("%lx", (unsigned long) gpr_cmdline_add_flag);
+    printf("%lx", (unsigned long) gpr_cmdline_add_string);
+    printf("%lx", (unsigned long) gpr_cmdline_on_extra_arg);
+    printf("%lx", (unsigned long) gpr_cmdline_set_survive_failure);
+    printf("%lx", (unsigned long) gpr_cmdline_parse);
+    printf("%lx", (unsigned long) gpr_cmdline_destroy);
+    printf("%lx", (unsigned long) gpr_cmdline_usage_string);
+    printf("%lx", (unsigned long) gpr_cpu_num_cores);
+    printf("%lx", (unsigned long) gpr_cpu_current_cpu);
+    printf("%lx", (unsigned long) gpr_histogram_create);
+    printf("%lx", (unsigned long) gpr_histogram_destroy);
+    printf("%lx", (unsigned long) gpr_histogram_add);
+    printf("%lx", (unsigned long) gpr_histogram_merge);
+    printf("%lx", (unsigned long) gpr_histogram_percentile);
+    printf("%lx", (unsigned long) gpr_histogram_mean);
+    printf("%lx", (unsigned long) gpr_histogram_stddev);
+    printf("%lx", (unsigned long) gpr_histogram_variance);
+    printf("%lx", (unsigned long) gpr_histogram_maximum);
+    printf("%lx", (unsigned long) gpr_histogram_minimum);
+    printf("%lx", (unsigned long) gpr_histogram_count);
+    printf("%lx", (unsigned long) gpr_histogram_sum);
+    printf("%lx", (unsigned long) gpr_histogram_sum_of_squares);
+    printf("%lx", (unsigned long) gpr_histogram_get_contents);
+    printf("%lx", (unsigned long) gpr_histogram_merge_contents);
+    printf("%lx", (unsigned long) gpr_join_host_port);
+    printf("%lx", (unsigned long) gpr_split_host_port);
+    printf("%lx", (unsigned long) gpr_log_severity_string);
+    printf("%lx", (unsigned long) gpr_log);
+    printf("%lx", (unsigned long) gpr_log_message);
+    printf("%lx", (unsigned long) gpr_set_log_verbosity);
+    printf("%lx", (unsigned long) gpr_log_verbosity_init);
+    printf("%lx", (unsigned long) gpr_set_log_function);
+    printf("%lx", (unsigned long) gpr_strdup);
+    printf("%lx", (unsigned long) gpr_asprintf);
+    printf("%lx", (unsigned long) gpr_subprocess_binary_extension);
+    printf("%lx", (unsigned long) gpr_subprocess_create);
+    printf("%lx", (unsigned long) gpr_subprocess_destroy);
+    printf("%lx", (unsigned long) gpr_subprocess_join);
+    printf("%lx", (unsigned long) gpr_subprocess_interrupt);
+    printf("%lx", (unsigned long) gpr_mu_init);
+    printf("%lx", (unsigned long) gpr_mu_destroy);
+    printf("%lx", (unsigned long) gpr_mu_lock);
+    printf("%lx", (unsigned long) gpr_mu_unlock);
+    printf("%lx", (unsigned long) gpr_mu_trylock);
+    printf("%lx", (unsigned long) gpr_cv_init);
+    printf("%lx", (unsigned long) gpr_cv_destroy);
+    printf("%lx", (unsigned long) gpr_cv_wait);
+    printf("%lx", (unsigned long) gpr_cv_signal);
+    printf("%lx", (unsigned long) gpr_cv_broadcast);
+    printf("%lx", (unsigned long) gpr_once_init);
+    printf("%lx", (unsigned long) gpr_event_init);
+    printf("%lx", (unsigned long) gpr_event_set);
+    printf("%lx", (unsigned long) gpr_event_get);
+    printf("%lx", (unsigned long) gpr_event_wait);
+    printf("%lx", (unsigned long) gpr_ref_init);
+    printf("%lx", (unsigned long) gpr_ref);
+    printf("%lx", (unsigned long) gpr_ref_non_zero);
+    printf("%lx", (unsigned long) gpr_refn);
+    printf("%lx", (unsigned long) gpr_unref);
+    printf("%lx", (unsigned long) gpr_ref_is_unique);
+    printf("%lx", (unsigned long) gpr_stats_init);
+    printf("%lx", (unsigned long) gpr_stats_inc);
+    printf("%lx", (unsigned long) gpr_stats_read);
+    printf("%lx", (unsigned long) gpr_thd_new);
+    printf("%lx", (unsigned long) gpr_thd_options_default);
+    printf("%lx", (unsigned long) gpr_thd_options_set_detached);
+    printf("%lx", (unsigned long) gpr_thd_options_set_joinable);
+    printf("%lx", (unsigned long) gpr_thd_options_is_detached);
+    printf("%lx", (unsigned long) gpr_thd_options_is_joinable);
+    printf("%lx", (unsigned long) gpr_thd_currentid);
+    printf("%lx", (unsigned long) gpr_thd_join);
+    printf("%lx", (unsigned long) gpr_time_0);
+    printf("%lx", (unsigned long) gpr_inf_future);
+    printf("%lx", (unsigned long) gpr_inf_past);
+    printf("%lx", (unsigned long) gpr_time_init);
+    printf("%lx", (unsigned long) gpr_now);
+    printf("%lx", (unsigned long) gpr_convert_clock_type);
+    printf("%lx", (unsigned long) gpr_time_cmp);
+    printf("%lx", (unsigned long) gpr_time_max);
+    printf("%lx", (unsigned long) gpr_time_min);
+    printf("%lx", (unsigned long) gpr_time_add);
+    printf("%lx", (unsigned long) gpr_time_sub);
+    printf("%lx", (unsigned long) gpr_time_from_micros);
+    printf("%lx", (unsigned long) gpr_time_from_nanos);
+    printf("%lx", (unsigned long) gpr_time_from_millis);
+    printf("%lx", (unsigned long) gpr_time_from_seconds);
+    printf("%lx", (unsigned long) gpr_time_from_minutes);
+    printf("%lx", (unsigned long) gpr_time_from_hours);
+    printf("%lx", (unsigned long) gpr_time_to_millis);
+    printf("%lx", (unsigned long) gpr_time_similar);
+    printf("%lx", (unsigned long) gpr_sleep_until);
+    printf("%lx", (unsigned long) gpr_timespec_to_micros);
+  }
+  return 0;
+}
diff --git a/test/core/surface/secure_channel_create_test.c b/test/core/surface/secure_channel_create_test.c
deleted file mode 100644
index 0c45135..0000000
--- a/test/core/surface/secure_channel_create_test.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/log.h>
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/lib/security/credentials/fake/fake_credentials.h"
-#include "src/core/lib/security/transport/security_connector.h"
-#include "src/core/lib/surface/channel.h"
-#include "test/core/util/test_config.h"
-
-void test_unknown_scheme_target(void) {
-  grpc_resolver_registry_shutdown();
-  grpc_resolver_registry_init();
-  grpc_channel_credentials *creds =
-      grpc_fake_transport_security_credentials_create();
-  grpc_channel *chan =
-      grpc_secure_channel_create(creds, "blah://blah", NULL, NULL);
-  grpc_channel_element *elem =
-      grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0);
-  GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client"));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test");
-  grpc_channel_credentials_unref(&exec_ctx, creds);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-void test_security_connector_already_in_arg(void) {
-  grpc_arg arg;
-  arg.type = GRPC_ARG_POINTER;
-  arg.value.pointer.p = NULL;
-  arg.key = GRPC_ARG_SECURITY_CONNECTOR;
-  grpc_channel_args args;
-  args.num_args = 1;
-  args.args = &arg;
-  grpc_channel *chan = grpc_secure_channel_create(NULL, NULL, &args, NULL);
-  grpc_channel_element *elem =
-      grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0);
-  GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client"));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test");
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-void test_null_creds(void) {
-  grpc_channel *chan = grpc_secure_channel_create(NULL, NULL, NULL, NULL);
-  grpc_channel_element *elem =
-      grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0);
-  GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client"));
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test");
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_security_connector_already_in_arg();
-  test_null_creds();
-  test_unknown_scheme_target();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/surface/secure_channel_create_test.cc b/test/core/surface/secure_channel_create_test.cc
new file mode 100644
index 0000000..f3163c1
--- /dev/null
+++ b/test/core/surface/secure_channel_create_test.cc
@@ -0,0 +1,81 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/log.h>
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/core/lib/security/transport/security_connector.h"
+#include "src/core/lib/surface/channel.h"
+#include "test/core/util/test_config.h"
+
+void test_unknown_scheme_target(void) {
+  grpc_resolver_registry_shutdown();
+  grpc_resolver_registry_init();
+  grpc_channel_credentials* creds =
+      grpc_fake_transport_security_credentials_create();
+  grpc_channel* chan =
+      grpc_secure_channel_create(creds, "blah://blah", NULL, NULL);
+  grpc_channel_element* elem =
+      grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0);
+  GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client"));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test");
+  grpc_channel_credentials_unref(&exec_ctx, creds);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+void test_security_connector_already_in_arg(void) {
+  grpc_arg arg;
+  arg.type = GRPC_ARG_POINTER;
+  arg.value.pointer.p = NULL;
+  arg.key = const_cast<char*>(GRPC_ARG_SECURITY_CONNECTOR);
+  grpc_channel_args args;
+  args.num_args = 1;
+  args.args = &arg;
+  grpc_channel* chan = grpc_secure_channel_create(NULL, NULL, &args, NULL);
+  grpc_channel_element* elem =
+      grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0);
+  GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client"));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test");
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+void test_null_creds(void) {
+  grpc_channel* chan = grpc_secure_channel_create(NULL, NULL, NULL, NULL);
+  grpc_channel_element* elem =
+      grpc_channel_stack_element(grpc_channel_get_channel_stack(chan), 0);
+  GPR_ASSERT(0 == strcmp(elem->filter->name, "lame-client"));
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  GRPC_CHANNEL_INTERNAL_UNREF(&exec_ctx, chan, "test");
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_security_connector_already_in_arg();
+  test_null_creds();
+  test_unknown_scheme_target();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/surface/sequential_connectivity_test.c b/test/core/surface/sequential_connectivity_test.c
deleted file mode 100644
index d5fd2db..0000000
--- a/test/core/surface/sequential_connectivity_test.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "test/core/end2end/data/ssl_test_data.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct test_fixture {
-  const char *name;
-  void (*add_server_port)(grpc_server *server, const char *addr);
-  grpc_channel *(*create_channel)(const char *addr);
-} test_fixture;
-
-#define NUM_CONNECTIONS 1000
-
-typedef struct {
-  grpc_server *server;
-  grpc_completion_queue *cq;
-} server_thread_args;
-
-static void server_thread_func(void *args) {
-  server_thread_args *a = args;
-  grpc_event ev = grpc_completion_queue_next(
-      a->cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-  GPR_ASSERT(ev.tag == NULL);
-  GPR_ASSERT(ev.success == true);
-}
-
-static void run_test(const test_fixture *fixture) {
-  gpr_log(GPR_INFO, "TEST: %s", fixture->name);
-
-  grpc_init();
-
-  char *addr;
-  gpr_join_host_port(&addr, "localhost", grpc_pick_unused_port_or_die());
-
-  grpc_server *server = grpc_server_create(NULL, NULL);
-  fixture->add_server_port(server, addr);
-  grpc_completion_queue *server_cq =
-      grpc_completion_queue_create_for_next(NULL);
-  grpc_server_register_completion_queue(server, server_cq, NULL);
-  grpc_server_start(server);
-
-  server_thread_args sta = {server, server_cq};
-  gpr_thd_id server_thread;
-  gpr_thd_options thdopt = gpr_thd_options_default();
-  gpr_thd_options_set_joinable(&thdopt);
-  gpr_thd_new(&server_thread, server_thread_func, &sta, &thdopt);
-
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-  grpc_channel *channels[NUM_CONNECTIONS];
-  for (size_t i = 0; i < NUM_CONNECTIONS; i++) {
-    channels[i] = fixture->create_channel(addr);
-
-    gpr_timespec connect_deadline = grpc_timeout_seconds_to_deadline(30);
-    grpc_connectivity_state state;
-    while ((state = grpc_channel_check_connectivity_state(channels[i], 1)) !=
-           GRPC_CHANNEL_READY) {
-      grpc_channel_watch_connectivity_state(channels[i], state,
-                                            connect_deadline, cq, NULL);
-      grpc_event ev = grpc_completion_queue_next(
-          cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
-      /* check that the watcher from "watch state" was free'd */
-      GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channels[i]) ==
-                 0);
-      GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
-      GPR_ASSERT(ev.tag == NULL);
-      GPR_ASSERT(ev.success == true);
-    }
-  }
-
-  grpc_server_shutdown_and_notify(server, server_cq, NULL);
-  gpr_thd_join(server_thread);
-
-  grpc_completion_queue_shutdown(server_cq);
-  grpc_completion_queue_shutdown(cq);
-
-  while (grpc_completion_queue_next(server_cq,
-                                    gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
-             .type != GRPC_QUEUE_SHUTDOWN)
-    ;
-  while (
-      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
-          .type != GRPC_QUEUE_SHUTDOWN)
-    ;
-
-  for (size_t i = 0; i < NUM_CONNECTIONS; i++) {
-    grpc_channel_destroy(channels[i]);
-  }
-
-  grpc_server_destroy(server);
-  grpc_completion_queue_destroy(server_cq);
-  grpc_completion_queue_destroy(cq);
-
-  grpc_shutdown();
-  gpr_free(addr);
-}
-
-static void insecure_test_add_port(grpc_server *server, const char *addr) {
-  grpc_server_add_insecure_http2_port(server, addr);
-}
-
-static grpc_channel *insecure_test_create_channel(const char *addr) {
-  return grpc_insecure_channel_create(addr, NULL, NULL);
-}
-
-static const test_fixture insecure_test = {
-    "insecure", insecure_test_add_port, insecure_test_create_channel,
-};
-
-static void secure_test_add_port(grpc_server *server, const char *addr) {
-  grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,
-                                                  test_server1_cert};
-  grpc_server_credentials *ssl_creds =
-      grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
-  grpc_server_add_secure_http2_port(server, addr, ssl_creds);
-  grpc_server_credentials_release(ssl_creds);
-}
-
-static grpc_channel *secure_test_create_channel(const char *addr) {
-  grpc_channel_credentials *ssl_creds =
-      grpc_ssl_credentials_create(test_root_cert, NULL, NULL);
-  grpc_arg ssl_name_override = {GRPC_ARG_STRING,
-                                GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
-                                {"foo.test.google.fr"}};
-  grpc_channel_args *new_client_args =
-      grpc_channel_args_copy_and_add(NULL, &ssl_name_override, 1);
-  grpc_channel *channel =
-      grpc_secure_channel_create(ssl_creds, addr, new_client_args, NULL);
-  {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    grpc_channel_args_destroy(&exec_ctx, new_client_args);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-  grpc_channel_credentials_release(ssl_creds);
-  return channel;
-}
-
-static const test_fixture secure_test = {
-    "secure", secure_test_add_port, secure_test_create_channel,
-};
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  run_test(&insecure_test);
-  run_test(&secure_test);
-}
diff --git a/test/core/surface/sequential_connectivity_test.cc b/test/core/surface/sequential_connectivity_test.cc
new file mode 100644
index 0000000..9ffbc82
--- /dev/null
+++ b/test/core/surface/sequential_connectivity_test.cc
@@ -0,0 +1,178 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "test/core/end2end/data/ssl_test_data.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+typedef struct test_fixture {
+  const char* name;
+  void (*add_server_port)(grpc_server* server, const char* addr);
+  grpc_channel* (*create_channel)(const char* addr);
+} test_fixture;
+
+#define NUM_CONNECTIONS 1000
+
+typedef struct {
+  grpc_server* server;
+  grpc_completion_queue* cq;
+} server_thread_args;
+
+static void server_thread_func(void* args) {
+  server_thread_args* a = static_cast<server_thread_args*>(args);
+  grpc_event ev = grpc_completion_queue_next(
+      a->cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+  GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+  GPR_ASSERT(ev.tag == NULL);
+  GPR_ASSERT(ev.success == true);
+}
+
+static void run_test(const test_fixture* fixture) {
+  gpr_log(GPR_INFO, "TEST: %s", fixture->name);
+
+  grpc_init();
+
+  char* addr;
+  gpr_join_host_port(&addr, "localhost", grpc_pick_unused_port_or_die());
+
+  grpc_server* server = grpc_server_create(NULL, NULL);
+  fixture->add_server_port(server, addr);
+  grpc_completion_queue* server_cq =
+      grpc_completion_queue_create_for_next(NULL);
+  grpc_server_register_completion_queue(server, server_cq, NULL);
+  grpc_server_start(server);
+
+  server_thread_args sta = {server, server_cq};
+  gpr_thd_id server_thread;
+  gpr_thd_options thdopt = gpr_thd_options_default();
+  gpr_thd_options_set_joinable(&thdopt);
+  gpr_thd_new(&server_thread, server_thread_func, &sta, &thdopt);
+
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+  grpc_channel* channels[NUM_CONNECTIONS];
+  for (size_t i = 0; i < NUM_CONNECTIONS; i++) {
+    channels[i] = fixture->create_channel(addr);
+
+    gpr_timespec connect_deadline = grpc_timeout_seconds_to_deadline(30);
+    grpc_connectivity_state state;
+    while ((state = grpc_channel_check_connectivity_state(channels[i], 1)) !=
+           GRPC_CHANNEL_READY) {
+      grpc_channel_watch_connectivity_state(channels[i], state,
+                                            connect_deadline, cq, NULL);
+      grpc_event ev = grpc_completion_queue_next(
+          cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
+      /* check that the watcher from "watch state" was free'd */
+      GPR_ASSERT(grpc_channel_num_external_connectivity_watchers(channels[i]) ==
+                 0);
+      GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+      GPR_ASSERT(ev.tag == NULL);
+      GPR_ASSERT(ev.success == true);
+    }
+  }
+
+  grpc_server_shutdown_and_notify(server, server_cq, NULL);
+  gpr_thd_join(server_thread);
+
+  grpc_completion_queue_shutdown(server_cq);
+  grpc_completion_queue_shutdown(cq);
+
+  while (grpc_completion_queue_next(server_cq,
+                                    gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
+             .type != GRPC_QUEUE_SHUTDOWN)
+    ;
+  while (
+      grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL)
+          .type != GRPC_QUEUE_SHUTDOWN)
+    ;
+
+  for (size_t i = 0; i < NUM_CONNECTIONS; i++) {
+    grpc_channel_destroy(channels[i]);
+  }
+
+  grpc_server_destroy(server);
+  grpc_completion_queue_destroy(server_cq);
+  grpc_completion_queue_destroy(cq);
+
+  grpc_shutdown();
+  gpr_free(addr);
+}
+
+static void insecure_test_add_port(grpc_server* server, const char* addr) {
+  grpc_server_add_insecure_http2_port(server, addr);
+}
+
+static grpc_channel* insecure_test_create_channel(const char* addr) {
+  return grpc_insecure_channel_create(addr, NULL, NULL);
+}
+
+static const test_fixture insecure_test = {
+    "insecure",
+    insecure_test_add_port,
+    insecure_test_create_channel,
+};
+
+static void secure_test_add_port(grpc_server* server, const char* addr) {
+  grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key,
+                                                  test_server1_cert};
+  grpc_server_credentials* ssl_creds =
+      grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL);
+  grpc_server_add_secure_http2_port(server, addr, ssl_creds);
+  grpc_server_credentials_release(ssl_creds);
+}
+
+static grpc_channel* secure_test_create_channel(const char* addr) {
+  grpc_channel_credentials* ssl_creds =
+      grpc_ssl_credentials_create(test_root_cert, NULL, NULL);
+  grpc_arg ssl_name_override = {
+      GRPC_ARG_STRING,
+      const_cast<char*>(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG),
+      {const_cast<char*>("foo.test.google.fr")}};
+  grpc_channel_args* new_client_args =
+      grpc_channel_args_copy_and_add(NULL, &ssl_name_override, 1);
+  grpc_channel* channel =
+      grpc_secure_channel_create(ssl_creds, addr, new_client_args, NULL);
+  {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    grpc_channel_args_destroy(&exec_ctx, new_client_args);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+  grpc_channel_credentials_release(ssl_creds);
+  return channel;
+}
+
+static const test_fixture secure_test = {
+    "secure",
+    secure_test_add_port,
+    secure_test_create_channel,
+};
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  run_test(&insecure_test);
+  run_test(&secure_test);
+}
diff --git a/test/core/surface/server_chttp2_test.c b/test/core/surface/server_chttp2_test.c
deleted file mode 100644
index cd8931e..0000000
--- a/test/core/surface/server_chttp2_test.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/security/credentials/fake/fake_credentials.h"
-#include "src/core/tsi/fake_transport_security.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-void test_unparsable_target(void) {
-  grpc_channel_args args = {0, NULL};
-  grpc_server *server = grpc_server_create(&args, NULL);
-  int port = grpc_server_add_insecure_http2_port(server, "[");
-  GPR_ASSERT(port == 0);
-  grpc_server_destroy(server);
-}
-
-void test_add_same_port_twice() {
-  grpc_arg a;
-  a.type = GRPC_ARG_INTEGER;
-  a.key = GRPC_ARG_ALLOW_REUSEPORT;
-  a.value.integer = 0;
-  grpc_channel_args args = {1, &a};
-
-  int port = grpc_pick_unused_port_or_die();
-  char *addr = NULL;
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_pluck(NULL);
-  grpc_server *server = grpc_server_create(&args, NULL);
-  grpc_server_credentials *fake_creds =
-      grpc_fake_transport_security_server_credentials_create();
-  gpr_join_host_port(&addr, "localhost", port);
-  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, fake_creds));
-  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, fake_creds) == 0);
-
-  grpc_server_credentials_release(fake_creds);
-  gpr_free(addr);
-  grpc_server_shutdown_and_notify(server, cq, NULL);
-  grpc_completion_queue_pluck(cq, NULL, gpr_inf_future(GPR_CLOCK_REALTIME),
-                              NULL);
-  grpc_server_destroy(server);
-  grpc_completion_queue_destroy(cq);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_unparsable_target();
-  test_add_same_port_twice();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/surface/server_chttp2_test.cc b/test/core/surface/server_chttp2_test.cc
new file mode 100644
index 0000000..b0ffb1d
--- /dev/null
+++ b/test/core/surface/server_chttp2_test.cc
@@ -0,0 +1,72 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/core/tsi/fake_transport_security.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+void test_unparsable_target(void) {
+  grpc_channel_args args = {0, NULL};
+  grpc_server* server = grpc_server_create(&args, NULL);
+  int port = grpc_server_add_insecure_http2_port(server, "[");
+  GPR_ASSERT(port == 0);
+  grpc_server_destroy(server);
+}
+
+void test_add_same_port_twice() {
+  grpc_arg a;
+  a.type = GRPC_ARG_INTEGER;
+  a.key = const_cast<char*>(GRPC_ARG_ALLOW_REUSEPORT);
+  a.value.integer = 0;
+  grpc_channel_args args = {1, &a};
+
+  int port = grpc_pick_unused_port_or_die();
+  char* addr = NULL;
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_pluck(NULL);
+  grpc_server* server = grpc_server_create(&args, NULL);
+  grpc_server_credentials* fake_creds =
+      grpc_fake_transport_security_server_credentials_create();
+  gpr_join_host_port(&addr, "localhost", port);
+  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, fake_creds));
+  GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, fake_creds) == 0);
+
+  grpc_server_credentials_release(fake_creds);
+  gpr_free(addr);
+  grpc_server_shutdown_and_notify(server, cq, NULL);
+  grpc_completion_queue_pluck(cq, NULL, gpr_inf_future(GPR_CLOCK_REALTIME),
+                              NULL);
+  grpc_server_destroy(server);
+  grpc_completion_queue_destroy(cq);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_unparsable_target();
+  test_add_same_port_twice();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/surface/server_test.c b/test/core/surface/server_test.c
deleted file mode 100644
index 4c185cd..0000000
--- a/test/core/surface/server_test.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/security/credentials/fake/fake_credentials.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-void test_register_method_fail(void) {
-  grpc_server *server = grpc_server_create(NULL, NULL);
-  void *method;
-  void *method_old;
-  method =
-      grpc_server_register_method(server, NULL, NULL, GRPC_SRM_PAYLOAD_NONE, 0);
-  GPR_ASSERT(method == NULL);
-  method_old =
-      grpc_server_register_method(server, "m", "h", GRPC_SRM_PAYLOAD_NONE, 0);
-  GPR_ASSERT(method_old != NULL);
-  method = grpc_server_register_method(
-      server, "m", "h", GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER, 0);
-  GPR_ASSERT(method == NULL);
-  method_old =
-      grpc_server_register_method(server, "m2", "h2", GRPC_SRM_PAYLOAD_NONE,
-                                  GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST);
-  GPR_ASSERT(method_old != NULL);
-  method =
-      grpc_server_register_method(server, "m2", "h2", GRPC_SRM_PAYLOAD_NONE, 0);
-  GPR_ASSERT(method == NULL);
-  method = grpc_server_register_method(
-      server, "m2", "h2", GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER,
-      GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST);
-  GPR_ASSERT(method == NULL);
-  grpc_server_destroy(server);
-}
-
-void test_request_call_on_no_server_cq(void) {
-  grpc_completion_queue *cc = grpc_completion_queue_create_for_next(NULL);
-  grpc_server *server = grpc_server_create(NULL, NULL);
-  GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE ==
-             grpc_server_request_call(server, NULL, NULL, NULL, cc, cc, NULL));
-  GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE ==
-             grpc_server_request_registered_call(server, NULL, NULL, NULL, NULL,
-                                                 NULL, cc, cc, NULL));
-  grpc_completion_queue_destroy(cc);
-  grpc_server_destroy(server);
-}
-
-void test_bind_server_twice(void) {
-  grpc_arg a;
-  a.type = GRPC_ARG_INTEGER;
-  a.key = GRPC_ARG_ALLOW_REUSEPORT;
-  a.value.integer = 0;
-  grpc_channel_args args = {1, &a};
-
-  char *addr;
-  grpc_server *server1 = grpc_server_create(&args, NULL);
-  grpc_server *server2 = grpc_server_create(&args, NULL);
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-  int port = grpc_pick_unused_port_or_die();
-  gpr_asprintf(&addr, "[::]:%d", port);
-  grpc_server_register_completion_queue(server1, cq, NULL);
-  grpc_server_register_completion_queue(server2, cq, NULL);
-  GPR_ASSERT(0 == grpc_server_add_secure_http2_port(server2, addr, NULL));
-  GPR_ASSERT(port == grpc_server_add_insecure_http2_port(server1, addr));
-  GPR_ASSERT(0 == grpc_server_add_insecure_http2_port(server2, addr));
-  grpc_server_credentials *fake_creds =
-      grpc_fake_transport_security_server_credentials_create();
-  GPR_ASSERT(0 == grpc_server_add_secure_http2_port(server2, addr, fake_creds));
-  grpc_server_credentials_release(fake_creds);
-  grpc_server_shutdown_and_notify(server1, cq, NULL);
-  grpc_server_shutdown_and_notify(server2, cq, NULL);
-  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
-  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
-  grpc_server_destroy(server1);
-  grpc_server_destroy(server2);
-  grpc_completion_queue_destroy(cq);
-  gpr_free(addr);
-}
-
-void test_bind_server_to_addr(const char *host, bool secure) {
-  int port = grpc_pick_unused_port_or_die();
-  char *addr;
-  gpr_join_host_port(&addr, host, port);
-  gpr_log(GPR_INFO, "Test bind to %s", addr);
-
-  grpc_server *server = grpc_server_create(NULL, NULL);
-  if (secure) {
-    grpc_server_credentials *fake_creds =
-        grpc_fake_transport_security_server_credentials_create();
-    GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, fake_creds));
-    grpc_server_credentials_release(fake_creds);
-  } else {
-    GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr));
-  }
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
-  grpc_server_register_completion_queue(server, cq, NULL);
-  grpc_server_start(server);
-  grpc_server_shutdown_and_notify(server, cq, NULL);
-  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
-  grpc_server_destroy(server);
-  grpc_completion_queue_destroy(cq);
-  gpr_free(addr);
-}
-
-static int external_dns_works(const char *host) {
-  grpc_resolved_addresses *res = NULL;
-  grpc_error *error = grpc_blocking_resolve_address(host, "80", &res);
-  GRPC_ERROR_UNREF(error);
-  if (res != NULL) {
-    grpc_resolved_addresses_destroy(res);
-    return 1;
-  }
-  return 0;
-}
-
-static void test_bind_server_to_addrs(const char **addrs, size_t n) {
-  for (size_t i = 0; i < n; i++) {
-    test_bind_server_to_addr(addrs[i], false);
-    test_bind_server_to_addr(addrs[i], true);
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_register_method_fail();
-  test_request_call_on_no_server_cq();
-  test_bind_server_twice();
-
-  static const char *addrs[] = {
-      "::1", "127.0.0.1", "::ffff:127.0.0.1", "localhost", "0.0.0.0", "::",
-  };
-  test_bind_server_to_addrs(addrs, GPR_ARRAY_SIZE(addrs));
-
-  if (external_dns_works("loopback46.unittest.grpc.io")) {
-    static const char *dns_addrs[] = {
-        "loopback46.unittest.grpc.io", "loopback4.unittest.grpc.io",
-    };
-    test_bind_server_to_addrs(dns_addrs, GPR_ARRAY_SIZE(dns_addrs));
-  }
-
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/surface/server_test.cc b/test/core/surface/server_test.cc
new file mode 100644
index 0000000..240969a
--- /dev/null
+++ b/test/core/surface/server_test.cc
@@ -0,0 +1,166 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+void test_register_method_fail(void) {
+  grpc_server* server = grpc_server_create(NULL, NULL);
+  void* method;
+  void* method_old;
+  method =
+      grpc_server_register_method(server, NULL, NULL, GRPC_SRM_PAYLOAD_NONE, 0);
+  GPR_ASSERT(method == NULL);
+  method_old =
+      grpc_server_register_method(server, "m", "h", GRPC_SRM_PAYLOAD_NONE, 0);
+  GPR_ASSERT(method_old != NULL);
+  method = grpc_server_register_method(
+      server, "m", "h", GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER, 0);
+  GPR_ASSERT(method == NULL);
+  method_old =
+      grpc_server_register_method(server, "m2", "h2", GRPC_SRM_PAYLOAD_NONE,
+                                  GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST);
+  GPR_ASSERT(method_old != NULL);
+  method =
+      grpc_server_register_method(server, "m2", "h2", GRPC_SRM_PAYLOAD_NONE, 0);
+  GPR_ASSERT(method == NULL);
+  method = grpc_server_register_method(
+      server, "m2", "h2", GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER,
+      GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST);
+  GPR_ASSERT(method == NULL);
+  grpc_server_destroy(server);
+}
+
+void test_request_call_on_no_server_cq(void) {
+  grpc_completion_queue* cc = grpc_completion_queue_create_for_next(NULL);
+  grpc_server* server = grpc_server_create(NULL, NULL);
+  GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE ==
+             grpc_server_request_call(server, NULL, NULL, NULL, cc, cc, NULL));
+  GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE ==
+             grpc_server_request_registered_call(server, NULL, NULL, NULL, NULL,
+                                                 NULL, cc, cc, NULL));
+  grpc_completion_queue_destroy(cc);
+  grpc_server_destroy(server);
+}
+
+void test_bind_server_twice(void) {
+  grpc_arg a;
+  a.type = GRPC_ARG_INTEGER;
+  a.key = const_cast<char*>(GRPC_ARG_ALLOW_REUSEPORT);
+  a.value.integer = 0;
+  grpc_channel_args args = {1, &a};
+
+  char* addr;
+  grpc_server* server1 = grpc_server_create(&args, NULL);
+  grpc_server* server2 = grpc_server_create(&args, NULL);
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+  int port = grpc_pick_unused_port_or_die();
+  gpr_asprintf(&addr, "[::]:%d", port);
+  grpc_server_register_completion_queue(server1, cq, NULL);
+  grpc_server_register_completion_queue(server2, cq, NULL);
+  GPR_ASSERT(0 == grpc_server_add_secure_http2_port(server2, addr, NULL));
+  GPR_ASSERT(port == grpc_server_add_insecure_http2_port(server1, addr));
+  GPR_ASSERT(0 == grpc_server_add_insecure_http2_port(server2, addr));
+  grpc_server_credentials* fake_creds =
+      grpc_fake_transport_security_server_credentials_create();
+  GPR_ASSERT(0 == grpc_server_add_secure_http2_port(server2, addr, fake_creds));
+  grpc_server_credentials_release(fake_creds);
+  grpc_server_shutdown_and_notify(server1, cq, NULL);
+  grpc_server_shutdown_and_notify(server2, cq, NULL);
+  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
+  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
+  grpc_server_destroy(server1);
+  grpc_server_destroy(server2);
+  grpc_completion_queue_destroy(cq);
+  gpr_free(addr);
+}
+
+void test_bind_server_to_addr(const char* host, bool secure) {
+  int port = grpc_pick_unused_port_or_die();
+  char* addr;
+  gpr_join_host_port(&addr, host, port);
+  gpr_log(GPR_INFO, "Test bind to %s", addr);
+
+  grpc_server* server = grpc_server_create(NULL, NULL);
+  if (secure) {
+    grpc_server_credentials* fake_creds =
+        grpc_fake_transport_security_server_credentials_create();
+    GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, fake_creds));
+    grpc_server_credentials_release(fake_creds);
+  } else {
+    GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr));
+  }
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
+  grpc_server_register_completion_queue(server, cq, NULL);
+  grpc_server_start(server);
+  grpc_server_shutdown_and_notify(server, cq, NULL);
+  grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_MONOTONIC), NULL);
+  grpc_server_destroy(server);
+  grpc_completion_queue_destroy(cq);
+  gpr_free(addr);
+}
+
+static int external_dns_works(const char* host) {
+  grpc_resolved_addresses* res = NULL;
+  grpc_error* error = grpc_blocking_resolve_address(host, "80", &res);
+  GRPC_ERROR_UNREF(error);
+  if (res != NULL) {
+    grpc_resolved_addresses_destroy(res);
+    return 1;
+  }
+  return 0;
+}
+
+static void test_bind_server_to_addrs(const char** addrs, size_t n) {
+  for (size_t i = 0; i < n; i++) {
+    test_bind_server_to_addr(addrs[i], false);
+    test_bind_server_to_addr(addrs[i], true);
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_register_method_fail();
+  test_request_call_on_no_server_cq();
+  test_bind_server_twice();
+
+  static const char* addrs[] = {
+      "::1", "127.0.0.1", "::ffff:127.0.0.1", "localhost", "0.0.0.0", "::",
+  };
+  test_bind_server_to_addrs(addrs, GPR_ARRAY_SIZE(addrs));
+
+  if (external_dns_works("loopback46.unittest.grpc.io")) {
+    static const char* dns_addrs[] = {
+        "loopback46.unittest.grpc.io",
+        "loopback4.unittest.grpc.io",
+    };
+    test_bind_server_to_addrs(dns_addrs, GPR_ARRAY_SIZE(dns_addrs));
+  }
+
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/transport/BUILD b/test/core/transport/BUILD
index edd27b8..b31d4ff 100644
--- a/test/core/transport/BUILD
+++ b/test/core/transport/BUILD
@@ -35,8 +35,8 @@
 
 grpc_cc_test(
     name = "byte_stream_test",
-    srcs = ["byte_stream_test.c"],
-    language = "C",
+    srcs = ["byte_stream_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -47,8 +47,8 @@
 
 grpc_cc_test(
     name = "connectivity_state_test",
-    srcs = ["connectivity_state_test.c"],
-    language = "C",
+    srcs = ["connectivity_state_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -59,8 +59,8 @@
 
 grpc_cc_test(
     name = "metadata_test",
-    srcs = ["metadata_test.c"],
-    language = "C",
+    srcs = ["metadata_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -86,8 +86,8 @@
 
 grpc_cc_test(
     name = "status_conversion_test",
-    srcs = ["status_conversion_test.c"],
-    language = "C",
+    srcs = ["status_conversion_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -98,8 +98,8 @@
 
 grpc_cc_test(
     name = "stream_owned_slice_test",
-    srcs = ["stream_owned_slice_test.c"],
-    language = "C",
+    srcs = ["stream_owned_slice_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -110,8 +110,8 @@
 
 grpc_cc_test(
     name = "timeout_encoding_test",
-    srcs = ["timeout_encoding_test.c"],
-    language = "C",
+    srcs = ["timeout_encoding_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/transport/bdp_estimator_test.cc b/test/core/transport/bdp_estimator_test.cc
index 2c4fc45..2a6fa95 100644
--- a/test/core/transport/bdp_estimator_test.cc
+++ b/test/core/transport/bdp_estimator_test.cc
@@ -55,7 +55,7 @@
 }
 
 namespace {
-void AddSamples(BdpEstimator *estimator, int64_t *samples, size_t n) {
+void AddSamples(BdpEstimator* estimator, int64_t* samples, size_t n) {
   estimator->AddIncomingBytes(1234567);
   inc_time();
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -71,7 +71,7 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-void AddSample(BdpEstimator *estimator, int64_t sample) {
+void AddSample(BdpEstimator* estimator, int64_t sample) {
   AddSamples(estimator, &sample, 1);
 }
 }  // namespace
@@ -137,7 +137,7 @@
 }  // namespace testing
 }  // namespace grpc_core
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
   grpc_test_init(argc, argv);
   gpr_now_impl = grpc_core::testing::fake_gpr_now;
   grpc_init();
diff --git a/test/core/transport/byte_stream_test.c b/test/core/transport/byte_stream_test.c
deleted file mode 100644
index a0c5f96..0000000
--- a/test/core/transport/byte_stream_test.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/transport/byte_stream.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/useful.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-
-#include "test/core/util/test_config.h"
-
-//
-// grpc_slice_buffer_stream tests
-//
-
-static void not_called_closure(grpc_exec_ctx *exec_ctx, void *arg,
-                               grpc_error *error) {
-  GPR_ASSERT(false);
-}
-
-static void test_slice_buffer_stream_basic(void) {
-  gpr_log(GPR_DEBUG, "test_slice_buffer_stream_basic");
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  // Create and populate slice buffer.
-  grpc_slice_buffer buffer;
-  grpc_slice_buffer_init(&buffer);
-  grpc_slice input[] = {
-      grpc_slice_from_static_string("foo"),
-      grpc_slice_from_static_string("bar"),
-  };
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
-    grpc_slice_buffer_add(&buffer, input[i]);
-  }
-  // Create byte stream.
-  grpc_slice_buffer_stream stream;
-  grpc_slice_buffer_stream_init(&stream, &buffer, 0);
-  GPR_ASSERT(stream.base.length == 6);
-  grpc_closure closure;
-  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
-                    grpc_schedule_on_exec_ctx);
-  // Read each slice.  Note that next() always returns synchronously.
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
-    GPR_ASSERT(
-        grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
-    grpc_slice output;
-    grpc_error *error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
-    GPR_ASSERT(error == GRPC_ERROR_NONE);
-    GPR_ASSERT(grpc_slice_eq(input[i], output));
-    grpc_slice_unref_internal(&exec_ctx, output);
-  }
-  // Clean up.
-  grpc_byte_stream_destroy(&exec_ctx, &stream.base);
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_slice_buffer_stream_shutdown(void) {
-  gpr_log(GPR_DEBUG, "test_slice_buffer_stream_shutdown");
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  // Create and populate slice buffer.
-  grpc_slice_buffer buffer;
-  grpc_slice_buffer_init(&buffer);
-  grpc_slice input[] = {
-      grpc_slice_from_static_string("foo"),
-      grpc_slice_from_static_string("bar"),
-  };
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
-    grpc_slice_buffer_add(&buffer, input[i]);
-  }
-  // Create byte stream.
-  grpc_slice_buffer_stream stream;
-  grpc_slice_buffer_stream_init(&stream, &buffer, 0);
-  GPR_ASSERT(stream.base.length == 6);
-  grpc_closure closure;
-  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
-                    grpc_schedule_on_exec_ctx);
-  // Read the first slice.
-  GPR_ASSERT(
-      grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
-  grpc_slice output;
-  grpc_error *error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(grpc_slice_eq(input[0], output));
-  grpc_slice_unref_internal(&exec_ctx, output);
-  // Now shutdown.
-  grpc_error *shutdown_error =
-      GRPC_ERROR_CREATE_FROM_STATIC_STRING("shutdown error");
-  grpc_byte_stream_shutdown(&exec_ctx, &stream.base,
-                            GRPC_ERROR_REF(shutdown_error));
-  // After shutdown, the next pull() should return the error.
-  GPR_ASSERT(
-      grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
-  error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
-  GPR_ASSERT(error == shutdown_error);
-  GRPC_ERROR_UNREF(error);
-  GRPC_ERROR_UNREF(shutdown_error);
-  // Clean up.
-  grpc_byte_stream_destroy(&exec_ctx, &stream.base);
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-//
-// grpc_caching_byte_stream tests
-//
-
-static void test_caching_byte_stream_basic(void) {
-  gpr_log(GPR_DEBUG, "test_caching_byte_stream_basic");
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  // Create and populate slice buffer byte stream.
-  grpc_slice_buffer buffer;
-  grpc_slice_buffer_init(&buffer);
-  grpc_slice input[] = {
-      grpc_slice_from_static_string("foo"),
-      grpc_slice_from_static_string("bar"),
-  };
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
-    grpc_slice_buffer_add(&buffer, input[i]);
-  }
-  grpc_slice_buffer_stream underlying_stream;
-  grpc_slice_buffer_stream_init(&underlying_stream, &buffer, 0);
-  // Create cache and caching stream.
-  grpc_byte_stream_cache cache;
-  grpc_byte_stream_cache_init(&cache, &underlying_stream.base);
-  grpc_caching_byte_stream stream;
-  grpc_caching_byte_stream_init(&stream, &cache);
-  grpc_closure closure;
-  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
-                    grpc_schedule_on_exec_ctx);
-  // Read each slice.  Note that next() always returns synchronously,
-  // because the underlying byte stream always does.
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
-    GPR_ASSERT(
-        grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
-    grpc_slice output;
-    grpc_error *error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
-    GPR_ASSERT(error == GRPC_ERROR_NONE);
-    GPR_ASSERT(grpc_slice_eq(input[i], output));
-    grpc_slice_unref_internal(&exec_ctx, output);
-  }
-  // Clean up.
-  grpc_byte_stream_destroy(&exec_ctx, &stream.base);
-  grpc_byte_stream_cache_destroy(&exec_ctx, &cache);
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_caching_byte_stream_reset(void) {
-  gpr_log(GPR_DEBUG, "test_caching_byte_stream_reset");
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  // Create and populate slice buffer byte stream.
-  grpc_slice_buffer buffer;
-  grpc_slice_buffer_init(&buffer);
-  grpc_slice input[] = {
-      grpc_slice_from_static_string("foo"),
-      grpc_slice_from_static_string("bar"),
-  };
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
-    grpc_slice_buffer_add(&buffer, input[i]);
-  }
-  grpc_slice_buffer_stream underlying_stream;
-  grpc_slice_buffer_stream_init(&underlying_stream, &buffer, 0);
-  // Create cache and caching stream.
-  grpc_byte_stream_cache cache;
-  grpc_byte_stream_cache_init(&cache, &underlying_stream.base);
-  grpc_caching_byte_stream stream;
-  grpc_caching_byte_stream_init(&stream, &cache);
-  grpc_closure closure;
-  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
-                    grpc_schedule_on_exec_ctx);
-  // Read one slice.
-  GPR_ASSERT(
-      grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
-  grpc_slice output;
-  grpc_error *error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(grpc_slice_eq(input[0], output));
-  grpc_slice_unref_internal(&exec_ctx, output);
-  // Reset the caching stream.  The reads should start over from the
-  // first slice.
-  grpc_caching_byte_stream_reset(&stream);
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
-    GPR_ASSERT(
-        grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
-    error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
-    GPR_ASSERT(error == GRPC_ERROR_NONE);
-    GPR_ASSERT(grpc_slice_eq(input[i], output));
-    grpc_slice_unref_internal(&exec_ctx, output);
-  }
-  // Clean up.
-  grpc_byte_stream_destroy(&exec_ctx, &stream.base);
-  grpc_byte_stream_cache_destroy(&exec_ctx, &cache);
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_caching_byte_stream_shared_cache(void) {
-  gpr_log(GPR_DEBUG, "test_caching_byte_stream_shared_cache");
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  // Create and populate slice buffer byte stream.
-  grpc_slice_buffer buffer;
-  grpc_slice_buffer_init(&buffer);
-  grpc_slice input[] = {
-      grpc_slice_from_static_string("foo"),
-      grpc_slice_from_static_string("bar"),
-  };
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
-    grpc_slice_buffer_add(&buffer, input[i]);
-  }
-  grpc_slice_buffer_stream underlying_stream;
-  grpc_slice_buffer_stream_init(&underlying_stream, &buffer, 0);
-  // Create cache and two caching streams.
-  grpc_byte_stream_cache cache;
-  grpc_byte_stream_cache_init(&cache, &underlying_stream.base);
-  grpc_caching_byte_stream stream1;
-  grpc_caching_byte_stream_init(&stream1, &cache);
-  grpc_caching_byte_stream stream2;
-  grpc_caching_byte_stream_init(&stream2, &cache);
-  grpc_closure closure;
-  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
-                    grpc_schedule_on_exec_ctx);
-  // Read one slice from stream1.
-  GPR_ASSERT(
-      grpc_byte_stream_next(&exec_ctx, &stream1.base, ~(size_t)0, &closure));
-  grpc_slice output;
-  grpc_error *error = grpc_byte_stream_pull(&exec_ctx, &stream1.base, &output);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(grpc_slice_eq(input[0], output));
-  grpc_slice_unref_internal(&exec_ctx, output);
-  // Read all slices from stream2.
-  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
-    GPR_ASSERT(
-        grpc_byte_stream_next(&exec_ctx, &stream2.base, ~(size_t)0, &closure));
-    error = grpc_byte_stream_pull(&exec_ctx, &stream2.base, &output);
-    GPR_ASSERT(error == GRPC_ERROR_NONE);
-    GPR_ASSERT(grpc_slice_eq(input[i], output));
-    grpc_slice_unref_internal(&exec_ctx, output);
-  }
-  // Now read the second slice from stream1.
-  GPR_ASSERT(
-      grpc_byte_stream_next(&exec_ctx, &stream1.base, ~(size_t)0, &closure));
-  error = grpc_byte_stream_pull(&exec_ctx, &stream1.base, &output);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(grpc_slice_eq(input[1], output));
-  grpc_slice_unref_internal(&exec_ctx, output);
-  // Clean up.
-  grpc_byte_stream_destroy(&exec_ctx, &stream1.base);
-  grpc_byte_stream_destroy(&exec_ctx, &stream2.base);
-  grpc_byte_stream_cache_destroy(&exec_ctx, &cache);
-  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_slice_buffer_stream_basic();
-  test_slice_buffer_stream_shutdown();
-  test_caching_byte_stream_basic();
-  test_caching_byte_stream_reset();
-  test_caching_byte_stream_shared_cache();
-  return 0;
-}
diff --git a/test/core/transport/byte_stream_test.cc b/test/core/transport/byte_stream_test.cc
new file mode 100644
index 0000000..e62a697
--- /dev/null
+++ b/test/core/transport/byte_stream_test.cc
@@ -0,0 +1,279 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/transport/byte_stream.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+
+#include "test/core/util/test_config.h"
+
+//
+// grpc_slice_buffer_stream tests
+//
+
+static void not_called_closure(grpc_exec_ctx* exec_ctx, void* arg,
+                               grpc_error* error) {
+  GPR_ASSERT(false);
+}
+
+static void test_slice_buffer_stream_basic(void) {
+  gpr_log(GPR_DEBUG, "test_slice_buffer_stream_basic");
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  // Create and populate slice buffer.
+  grpc_slice_buffer buffer;
+  grpc_slice_buffer_init(&buffer);
+  grpc_slice input[] = {
+      grpc_slice_from_static_string("foo"),
+      grpc_slice_from_static_string("bar"),
+  };
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
+    grpc_slice_buffer_add(&buffer, input[i]);
+  }
+  // Create byte stream.
+  grpc_slice_buffer_stream stream;
+  grpc_slice_buffer_stream_init(&stream, &buffer, 0);
+  GPR_ASSERT(stream.base.length == 6);
+  grpc_closure closure;
+  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
+                    grpc_schedule_on_exec_ctx);
+  // Read each slice.  Note that next() always returns synchronously.
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
+    GPR_ASSERT(
+        grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
+    grpc_slice output;
+    grpc_error* error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
+    GPR_ASSERT(error == GRPC_ERROR_NONE);
+    GPR_ASSERT(grpc_slice_eq(input[i], output));
+    grpc_slice_unref_internal(&exec_ctx, output);
+  }
+  // Clean up.
+  grpc_byte_stream_destroy(&exec_ctx, &stream.base);
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_slice_buffer_stream_shutdown(void) {
+  gpr_log(GPR_DEBUG, "test_slice_buffer_stream_shutdown");
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  // Create and populate slice buffer.
+  grpc_slice_buffer buffer;
+  grpc_slice_buffer_init(&buffer);
+  grpc_slice input[] = {
+      grpc_slice_from_static_string("foo"),
+      grpc_slice_from_static_string("bar"),
+  };
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
+    grpc_slice_buffer_add(&buffer, input[i]);
+  }
+  // Create byte stream.
+  grpc_slice_buffer_stream stream;
+  grpc_slice_buffer_stream_init(&stream, &buffer, 0);
+  GPR_ASSERT(stream.base.length == 6);
+  grpc_closure closure;
+  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
+                    grpc_schedule_on_exec_ctx);
+  // Read the first slice.
+  GPR_ASSERT(
+      grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
+  grpc_slice output;
+  grpc_error* error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(grpc_slice_eq(input[0], output));
+  grpc_slice_unref_internal(&exec_ctx, output);
+  // Now shutdown.
+  grpc_error* shutdown_error =
+      GRPC_ERROR_CREATE_FROM_STATIC_STRING("shutdown error");
+  grpc_byte_stream_shutdown(&exec_ctx, &stream.base,
+                            GRPC_ERROR_REF(shutdown_error));
+  // After shutdown, the next pull() should return the error.
+  GPR_ASSERT(
+      grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
+  error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
+  GPR_ASSERT(error == shutdown_error);
+  GRPC_ERROR_UNREF(error);
+  GRPC_ERROR_UNREF(shutdown_error);
+  // Clean up.
+  grpc_byte_stream_destroy(&exec_ctx, &stream.base);
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+//
+// grpc_caching_byte_stream tests
+//
+
+static void test_caching_byte_stream_basic(void) {
+  gpr_log(GPR_DEBUG, "test_caching_byte_stream_basic");
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  // Create and populate slice buffer byte stream.
+  grpc_slice_buffer buffer;
+  grpc_slice_buffer_init(&buffer);
+  grpc_slice input[] = {
+      grpc_slice_from_static_string("foo"),
+      grpc_slice_from_static_string("bar"),
+  };
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
+    grpc_slice_buffer_add(&buffer, input[i]);
+  }
+  grpc_slice_buffer_stream underlying_stream;
+  grpc_slice_buffer_stream_init(&underlying_stream, &buffer, 0);
+  // Create cache and caching stream.
+  grpc_byte_stream_cache cache;
+  grpc_byte_stream_cache_init(&cache, &underlying_stream.base);
+  grpc_caching_byte_stream stream;
+  grpc_caching_byte_stream_init(&stream, &cache);
+  grpc_closure closure;
+  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
+                    grpc_schedule_on_exec_ctx);
+  // Read each slice.  Note that next() always returns synchronously,
+  // because the underlying byte stream always does.
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
+    GPR_ASSERT(
+        grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
+    grpc_slice output;
+    grpc_error* error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
+    GPR_ASSERT(error == GRPC_ERROR_NONE);
+    GPR_ASSERT(grpc_slice_eq(input[i], output));
+    grpc_slice_unref_internal(&exec_ctx, output);
+  }
+  // Clean up.
+  grpc_byte_stream_destroy(&exec_ctx, &stream.base);
+  grpc_byte_stream_cache_destroy(&exec_ctx, &cache);
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_caching_byte_stream_reset(void) {
+  gpr_log(GPR_DEBUG, "test_caching_byte_stream_reset");
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  // Create and populate slice buffer byte stream.
+  grpc_slice_buffer buffer;
+  grpc_slice_buffer_init(&buffer);
+  grpc_slice input[] = {
+      grpc_slice_from_static_string("foo"),
+      grpc_slice_from_static_string("bar"),
+  };
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
+    grpc_slice_buffer_add(&buffer, input[i]);
+  }
+  grpc_slice_buffer_stream underlying_stream;
+  grpc_slice_buffer_stream_init(&underlying_stream, &buffer, 0);
+  // Create cache and caching stream.
+  grpc_byte_stream_cache cache;
+  grpc_byte_stream_cache_init(&cache, &underlying_stream.base);
+  grpc_caching_byte_stream stream;
+  grpc_caching_byte_stream_init(&stream, &cache);
+  grpc_closure closure;
+  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
+                    grpc_schedule_on_exec_ctx);
+  // Read one slice.
+  GPR_ASSERT(
+      grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
+  grpc_slice output;
+  grpc_error* error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(grpc_slice_eq(input[0], output));
+  grpc_slice_unref_internal(&exec_ctx, output);
+  // Reset the caching stream.  The reads should start over from the
+  // first slice.
+  grpc_caching_byte_stream_reset(&stream);
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
+    GPR_ASSERT(
+        grpc_byte_stream_next(&exec_ctx, &stream.base, ~(size_t)0, &closure));
+    error = grpc_byte_stream_pull(&exec_ctx, &stream.base, &output);
+    GPR_ASSERT(error == GRPC_ERROR_NONE);
+    GPR_ASSERT(grpc_slice_eq(input[i], output));
+    grpc_slice_unref_internal(&exec_ctx, output);
+  }
+  // Clean up.
+  grpc_byte_stream_destroy(&exec_ctx, &stream.base);
+  grpc_byte_stream_cache_destroy(&exec_ctx, &cache);
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_caching_byte_stream_shared_cache(void) {
+  gpr_log(GPR_DEBUG, "test_caching_byte_stream_shared_cache");
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  // Create and populate slice buffer byte stream.
+  grpc_slice_buffer buffer;
+  grpc_slice_buffer_init(&buffer);
+  grpc_slice input[] = {
+      grpc_slice_from_static_string("foo"),
+      grpc_slice_from_static_string("bar"),
+  };
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
+    grpc_slice_buffer_add(&buffer, input[i]);
+  }
+  grpc_slice_buffer_stream underlying_stream;
+  grpc_slice_buffer_stream_init(&underlying_stream, &buffer, 0);
+  // Create cache and two caching streams.
+  grpc_byte_stream_cache cache;
+  grpc_byte_stream_cache_init(&cache, &underlying_stream.base);
+  grpc_caching_byte_stream stream1;
+  grpc_caching_byte_stream_init(&stream1, &cache);
+  grpc_caching_byte_stream stream2;
+  grpc_caching_byte_stream_init(&stream2, &cache);
+  grpc_closure closure;
+  GRPC_CLOSURE_INIT(&closure, not_called_closure, NULL,
+                    grpc_schedule_on_exec_ctx);
+  // Read one slice from stream1.
+  GPR_ASSERT(
+      grpc_byte_stream_next(&exec_ctx, &stream1.base, ~(size_t)0, &closure));
+  grpc_slice output;
+  grpc_error* error = grpc_byte_stream_pull(&exec_ctx, &stream1.base, &output);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(grpc_slice_eq(input[0], output));
+  grpc_slice_unref_internal(&exec_ctx, output);
+  // Read all slices from stream2.
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(input); ++i) {
+    GPR_ASSERT(
+        grpc_byte_stream_next(&exec_ctx, &stream2.base, ~(size_t)0, &closure));
+    error = grpc_byte_stream_pull(&exec_ctx, &stream2.base, &output);
+    GPR_ASSERT(error == GRPC_ERROR_NONE);
+    GPR_ASSERT(grpc_slice_eq(input[i], output));
+    grpc_slice_unref_internal(&exec_ctx, output);
+  }
+  // Now read the second slice from stream1.
+  GPR_ASSERT(
+      grpc_byte_stream_next(&exec_ctx, &stream1.base, ~(size_t)0, &closure));
+  error = grpc_byte_stream_pull(&exec_ctx, &stream1.base, &output);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(grpc_slice_eq(input[1], output));
+  grpc_slice_unref_internal(&exec_ctx, output);
+  // Clean up.
+  grpc_byte_stream_destroy(&exec_ctx, &stream1.base);
+  grpc_byte_stream_destroy(&exec_ctx, &stream2.base);
+  grpc_byte_stream_cache_destroy(&exec_ctx, &cache);
+  grpc_slice_buffer_destroy_internal(&exec_ctx, &buffer);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_slice_buffer_stream_basic();
+  test_slice_buffer_stream_shutdown();
+  test_caching_byte_stream_basic();
+  test_caching_byte_stream_reset();
+  test_caching_byte_stream_shared_cache();
+  return 0;
+}
diff --git a/test/core/transport/chttp2/BUILD b/test/core/transport/chttp2/BUILD
index 6081940..1ea7d03 100644
--- a/test/core/transport/chttp2/BUILD
+++ b/test/core/transport/chttp2/BUILD
@@ -22,7 +22,7 @@
 
 grpc_fuzzer(
     name = "hpack_parser_fuzzer",
-    srcs = ["hpack_parser_fuzzer_test.c"],
+    srcs = ["hpack_parser_fuzzer_test.cc"],
     corpus = "hpack_parser_corpus",
     deps = [
         "//:grpc",
@@ -32,8 +32,8 @@
 
 grpc_cc_test(
     name = "alpn_test",
-    srcs = ["alpn_test.c"],
-    language = "C",
+    srcs = ["alpn_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -44,8 +44,8 @@
 
 grpc_cc_test(
     name = "bin_decoder_test",
-    srcs = ["bin_decoder_test.c"],
-    language = "C",
+    srcs = ["bin_decoder_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -56,8 +56,8 @@
 
 grpc_cc_test(
     name = "bin_encoder_test",
-    srcs = ["bin_encoder_test.c"],
-    language = "C",
+    srcs = ["bin_encoder_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -68,8 +68,8 @@
 
 grpc_cc_test(
     name = "hpack_encoder_test",
-    srcs = ["hpack_encoder_test.c"],
-    language = "C",
+    srcs = ["hpack_encoder_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -80,8 +80,8 @@
 
 grpc_cc_test(
     name = "hpack_parser_test",
-    srcs = ["hpack_parser_test.c"],
-    language = "C",
+    srcs = ["hpack_parser_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -92,8 +92,8 @@
 
 grpc_cc_test(
     name = "hpack_table_test",
-    srcs = ["hpack_table_test.c"],
-    language = "C",
+    srcs = ["hpack_table_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -104,8 +104,8 @@
 
 grpc_cc_test(
     name = "stream_map_test",
-    srcs = ["stream_map_test.c"],
-    language = "C",
+    srcs = ["stream_map_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
@@ -116,8 +116,8 @@
 
 grpc_cc_test(
     name = "varint_test",
-    srcs = ["varint_test.c"],
-    language = "C",
+    srcs = ["varint_test.cc"],
+    language = "C++",
     deps = [
         "//:gpr",
         "//:grpc",
diff --git a/test/core/transport/chttp2/alpn_test.c b/test/core/transport/chttp2/alpn_test.c
deleted file mode 100644
index 72c30c4..0000000
--- a/test/core/transport/chttp2/alpn_test.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/transport/chttp2/alpn/alpn.h"
-
-#include <grpc/support/log.h>
-#include "test/core/util/test_config.h"
-
-static void test_alpn_success(void) {
-  GPR_ASSERT(grpc_chttp2_is_alpn_version_supported("h2", 2));
-  GPR_ASSERT(grpc_chttp2_is_alpn_version_supported("grpc-exp", 8));
-}
-
-static void test_alpn_failure(void) {
-  GPR_ASSERT(!grpc_chttp2_is_alpn_version_supported("h2-155", 6));
-  GPR_ASSERT(!grpc_chttp2_is_alpn_version_supported("h1-15", 5));
-}
-
-// First index in ALPN supported version list of a given protocol. Returns a
-// value one beyond the last valid element index if not found.
-static size_t alpn_version_index(const char *version, size_t size) {
-  size_t i;
-  for (i = 0; i < grpc_chttp2_num_alpn_versions(); ++i) {
-    if (!strncmp(version, grpc_chttp2_get_alpn_version_index(i), size)) {
-      return i;
-    }
-  }
-  return i;
-}
-
-static void test_alpn_grpc_before_h2(void) {
-  // grpc-exp is preferred over h2.
-  GPR_ASSERT(alpn_version_index("grpc-exp", 8) < alpn_version_index("h2", 2));
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_alpn_success();
-  test_alpn_failure();
-  test_alpn_grpc_before_h2();
-  return 0;
-}
diff --git a/test/core/transport/chttp2/alpn_test.cc b/test/core/transport/chttp2/alpn_test.cc
new file mode 100644
index 0000000..a433773
--- /dev/null
+++ b/test/core/transport/chttp2/alpn_test.cc
@@ -0,0 +1,57 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/transport/chttp2/alpn/alpn.h"
+
+#include <grpc/support/log.h>
+#include "test/core/util/test_config.h"
+
+static void test_alpn_success(void) {
+  GPR_ASSERT(grpc_chttp2_is_alpn_version_supported("h2", 2));
+  GPR_ASSERT(grpc_chttp2_is_alpn_version_supported("grpc-exp", 8));
+}
+
+static void test_alpn_failure(void) {
+  GPR_ASSERT(!grpc_chttp2_is_alpn_version_supported("h2-155", 6));
+  GPR_ASSERT(!grpc_chttp2_is_alpn_version_supported("h1-15", 5));
+}
+
+// First index in ALPN supported version list of a given protocol. Returns a
+// value one beyond the last valid element index if not found.
+static size_t alpn_version_index(const char* version, size_t size) {
+  size_t i;
+  for (i = 0; i < grpc_chttp2_num_alpn_versions(); ++i) {
+    if (!strncmp(version, grpc_chttp2_get_alpn_version_index(i), size)) {
+      return i;
+    }
+  }
+  return i;
+}
+
+static void test_alpn_grpc_before_h2(void) {
+  // grpc-exp is preferred over h2.
+  GPR_ASSERT(alpn_version_index("grpc-exp", 8) < alpn_version_index("h2", 2));
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_alpn_success();
+  test_alpn_failure();
+  test_alpn_grpc_before_h2();
+  return 0;
+}
diff --git a/test/core/transport/chttp2/bin_decoder_test.c b/test/core/transport/chttp2/bin_decoder_test.c
deleted file mode 100644
index 775161e..0000000
--- a/test/core/transport/chttp2/bin_decoder_test.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/transport/chttp2/transport/bin_decoder.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/support/string.h"
-
-static int all_ok = 1;
-
-static void expect_slice_eq(grpc_exec_ctx *exec_ctx, grpc_slice expected,
-                            grpc_slice slice, char *debug, int line) {
-  if (!grpc_slice_eq(slice, expected)) {
-    char *hs = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    char *he = grpc_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    gpr_log(GPR_ERROR, "FAILED:%d: %s\ngot:  %s\nwant: %s", line, debug, hs,
-            he);
-    gpr_free(hs);
-    gpr_free(he);
-    all_ok = 0;
-  }
-  grpc_slice_unref_internal(exec_ctx, expected);
-  grpc_slice_unref_internal(exec_ctx, slice);
-}
-
-static grpc_slice base64_encode(grpc_exec_ctx *exec_ctx, const char *s) {
-  grpc_slice ss = grpc_slice_from_copied_string(s);
-  grpc_slice out = grpc_chttp2_base64_encode(ss);
-  grpc_slice_unref_internal(exec_ctx, ss);
-  return out;
-}
-
-static grpc_slice base64_decode(grpc_exec_ctx *exec_ctx, const char *s) {
-  grpc_slice ss = grpc_slice_from_copied_string(s);
-  grpc_slice out = grpc_chttp2_base64_decode(exec_ctx, ss);
-  grpc_slice_unref_internal(exec_ctx, ss);
-  return out;
-}
-
-static grpc_slice base64_decode_with_length(grpc_exec_ctx *exec_ctx,
-                                            const char *s,
-                                            size_t output_length) {
-  grpc_slice ss = grpc_slice_from_copied_string(s);
-  grpc_slice out =
-      grpc_chttp2_base64_decode_with_length(exec_ctx, ss, output_length);
-  grpc_slice_unref_internal(exec_ctx, ss);
-  return out;
-}
-
-#define EXPECT_SLICE_EQ(exec_ctx, expected, slice)                             \
-  expect_slice_eq(                                                             \
-      exec_ctx, grpc_slice_from_copied_buffer(expected, sizeof(expected) - 1), \
-      slice, #slice, __LINE__);
-
-#define ENCODE_AND_DECODE(exec_ctx, s)                   \
-  EXPECT_SLICE_EQ(exec_ctx, s,                           \
-                  grpc_chttp2_base64_decode_with_length( \
-                      exec_ctx, base64_encode(exec_ctx, s), strlen(s)));
-
-int main(int argc, char **argv) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  /* ENCODE_AND_DECODE tests grpc_chttp2_base64_decode_with_length(), which
-     takes encoded base64 strings without pad chars, but output length is
-     required. */
-  /* Base64 test vectors from RFC 4648 */
-  ENCODE_AND_DECODE(&exec_ctx, "");
-  ENCODE_AND_DECODE(&exec_ctx, "f");
-  ENCODE_AND_DECODE(&exec_ctx, "foo");
-  ENCODE_AND_DECODE(&exec_ctx, "fo");
-  ENCODE_AND_DECODE(&exec_ctx, "foob");
-  ENCODE_AND_DECODE(&exec_ctx, "fooba");
-  ENCODE_AND_DECODE(&exec_ctx, "foobar");
-
-  ENCODE_AND_DECODE(&exec_ctx, "\xc0\xc1\xc2\xc3\xc4\xc5");
-
-  /* Base64 test vectors from RFC 4648, with pad chars */
-  /* BASE64("") = "" */
-  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, ""));
-  /* BASE64("f") = "Zg==" */
-  EXPECT_SLICE_EQ(&exec_ctx, "f", base64_decode(&exec_ctx, "Zg=="));
-  /* BASE64("fo") = "Zm8=" */
-  EXPECT_SLICE_EQ(&exec_ctx, "fo", base64_decode(&exec_ctx, "Zm8="));
-  /* BASE64("foo") = "Zm9v" */
-  EXPECT_SLICE_EQ(&exec_ctx, "foo", base64_decode(&exec_ctx, "Zm9v"));
-  /* BASE64("foob") = "Zm9vYg==" */
-  EXPECT_SLICE_EQ(&exec_ctx, "foob", base64_decode(&exec_ctx, "Zm9vYg=="));
-  /* BASE64("fooba") = "Zm9vYmE=" */
-  EXPECT_SLICE_EQ(&exec_ctx, "fooba", base64_decode(&exec_ctx, "Zm9vYmE="));
-  /* BASE64("foobar") = "Zm9vYmFy" */
-  EXPECT_SLICE_EQ(&exec_ctx, "foobar", base64_decode(&exec_ctx, "Zm9vYmFy"));
-
-  EXPECT_SLICE_EQ(&exec_ctx, "\xc0\xc1\xc2\xc3\xc4\xc5",
-                  base64_decode(&exec_ctx, "wMHCw8TF"));
-
-  // Test illegal input length in grpc_chttp2_base64_decode
-  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "a"));
-  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "ab"));
-  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "abc"));
-
-  // Test illegal charactors in grpc_chttp2_base64_decode
-  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "Zm:v"));
-  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "Zm=v"));
-
-  // Test output_length longer than max possible output length in
-  // grpc_chttp2_base64_decode_with_length
-  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode_with_length(&exec_ctx, "Zg", 2));
-  EXPECT_SLICE_EQ(&exec_ctx, "",
-                  base64_decode_with_length(&exec_ctx, "Zm8", 3));
-  EXPECT_SLICE_EQ(&exec_ctx, "",
-                  base64_decode_with_length(&exec_ctx, "Zm9v", 4));
-
-  // Test illegal charactors in grpc_chttp2_base64_decode_with_length
-  EXPECT_SLICE_EQ(&exec_ctx, "",
-                  base64_decode_with_length(&exec_ctx, "Zm:v", 3));
-  EXPECT_SLICE_EQ(&exec_ctx, "",
-                  base64_decode_with_length(&exec_ctx, "Zm=v", 3));
-
-  grpc_exec_ctx_finish(&exec_ctx);
-
-  return all_ok ? 0 : 1;
-}
diff --git a/test/core/transport/chttp2/bin_decoder_test.cc b/test/core/transport/chttp2/bin_decoder_test.cc
new file mode 100644
index 0000000..a29ec8a
--- /dev/null
+++ b/test/core/transport/chttp2/bin_decoder_test.cc
@@ -0,0 +1,143 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/transport/chttp2/transport/bin_decoder.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/support/string.h"
+
+static int all_ok = 1;
+
+static void expect_slice_eq(grpc_exec_ctx* exec_ctx, grpc_slice expected,
+                            grpc_slice slice, const char* debug, int line) {
+  if (!grpc_slice_eq(slice, expected)) {
+    char* hs = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    char* he = grpc_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    gpr_log(GPR_ERROR, "FAILED:%d: %s\ngot:  %s\nwant: %s", line, debug, hs,
+            he);
+    gpr_free(hs);
+    gpr_free(he);
+    all_ok = 0;
+  }
+  grpc_slice_unref_internal(exec_ctx, expected);
+  grpc_slice_unref_internal(exec_ctx, slice);
+}
+
+static grpc_slice base64_encode(grpc_exec_ctx* exec_ctx, const char* s) {
+  grpc_slice ss = grpc_slice_from_copied_string(s);
+  grpc_slice out = grpc_chttp2_base64_encode(ss);
+  grpc_slice_unref_internal(exec_ctx, ss);
+  return out;
+}
+
+static grpc_slice base64_decode(grpc_exec_ctx* exec_ctx, const char* s) {
+  grpc_slice ss = grpc_slice_from_copied_string(s);
+  grpc_slice out = grpc_chttp2_base64_decode(exec_ctx, ss);
+  grpc_slice_unref_internal(exec_ctx, ss);
+  return out;
+}
+
+static grpc_slice base64_decode_with_length(grpc_exec_ctx* exec_ctx,
+                                            const char* s,
+                                            size_t output_length) {
+  grpc_slice ss = grpc_slice_from_copied_string(s);
+  grpc_slice out =
+      grpc_chttp2_base64_decode_with_length(exec_ctx, ss, output_length);
+  grpc_slice_unref_internal(exec_ctx, ss);
+  return out;
+}
+
+#define EXPECT_SLICE_EQ(exec_ctx, expected, slice)                             \
+  expect_slice_eq(                                                             \
+      exec_ctx, grpc_slice_from_copied_buffer(expected, sizeof(expected) - 1), \
+      slice, #slice, __LINE__);
+
+#define ENCODE_AND_DECODE(exec_ctx, s)                   \
+  EXPECT_SLICE_EQ(exec_ctx, s,                           \
+                  grpc_chttp2_base64_decode_with_length( \
+                      exec_ctx, base64_encode(exec_ctx, s), strlen(s)));
+
+int main(int argc, char** argv) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  /* ENCODE_AND_DECODE tests grpc_chttp2_base64_decode_with_length(), which
+     takes encoded base64 strings without pad chars, but output length is
+     required. */
+  /* Base64 test vectors from RFC 4648 */
+  ENCODE_AND_DECODE(&exec_ctx, "");
+  ENCODE_AND_DECODE(&exec_ctx, "f");
+  ENCODE_AND_DECODE(&exec_ctx, "foo");
+  ENCODE_AND_DECODE(&exec_ctx, "fo");
+  ENCODE_AND_DECODE(&exec_ctx, "foob");
+  ENCODE_AND_DECODE(&exec_ctx, "fooba");
+  ENCODE_AND_DECODE(&exec_ctx, "foobar");
+
+  ENCODE_AND_DECODE(&exec_ctx, "\xc0\xc1\xc2\xc3\xc4\xc5");
+
+  /* Base64 test vectors from RFC 4648, with pad chars */
+  /* BASE64("") = "" */
+  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, ""));
+  /* BASE64("f") = "Zg==" */
+  EXPECT_SLICE_EQ(&exec_ctx, "f", base64_decode(&exec_ctx, "Zg=="));
+  /* BASE64("fo") = "Zm8=" */
+  EXPECT_SLICE_EQ(&exec_ctx, "fo", base64_decode(&exec_ctx, "Zm8="));
+  /* BASE64("foo") = "Zm9v" */
+  EXPECT_SLICE_EQ(&exec_ctx, "foo", base64_decode(&exec_ctx, "Zm9v"));
+  /* BASE64("foob") = "Zm9vYg==" */
+  EXPECT_SLICE_EQ(&exec_ctx, "foob", base64_decode(&exec_ctx, "Zm9vYg=="));
+  /* BASE64("fooba") = "Zm9vYmE=" */
+  EXPECT_SLICE_EQ(&exec_ctx, "fooba", base64_decode(&exec_ctx, "Zm9vYmE="));
+  /* BASE64("foobar") = "Zm9vYmFy" */
+  EXPECT_SLICE_EQ(&exec_ctx, "foobar", base64_decode(&exec_ctx, "Zm9vYmFy"));
+
+  EXPECT_SLICE_EQ(&exec_ctx, "\xc0\xc1\xc2\xc3\xc4\xc5",
+                  base64_decode(&exec_ctx, "wMHCw8TF"));
+
+  // Test illegal input length in grpc_chttp2_base64_decode
+  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "a"));
+  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "ab"));
+  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "abc"));
+
+  // Test illegal charactors in grpc_chttp2_base64_decode
+  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "Zm:v"));
+  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode(&exec_ctx, "Zm=v"));
+
+  // Test output_length longer than max possible output length in
+  // grpc_chttp2_base64_decode_with_length
+  EXPECT_SLICE_EQ(&exec_ctx, "", base64_decode_with_length(&exec_ctx, "Zg", 2));
+  EXPECT_SLICE_EQ(&exec_ctx, "",
+                  base64_decode_with_length(&exec_ctx, "Zm8", 3));
+  EXPECT_SLICE_EQ(&exec_ctx, "",
+                  base64_decode_with_length(&exec_ctx, "Zm9v", 4));
+
+  // Test illegal charactors in grpc_chttp2_base64_decode_with_length
+  EXPECT_SLICE_EQ(&exec_ctx, "",
+                  base64_decode_with_length(&exec_ctx, "Zm:v", 3));
+  EXPECT_SLICE_EQ(&exec_ctx, "",
+                  base64_decode_with_length(&exec_ctx, "Zm=v", 3));
+
+  grpc_exec_ctx_finish(&exec_ctx);
+
+  return all_ok ? 0 : 1;
+}
diff --git a/test/core/transport/chttp2/bin_encoder_test.c b/test/core/transport/chttp2/bin_encoder_test.c
deleted file mode 100644
index acadcf6..0000000
--- a/test/core/transport/chttp2/bin_encoder_test.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
-
-#include <string.h>
-
-/* This is here for grpc_is_binary_header
- * TODO(murgatroid99): Remove this
- */
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/support/string.h"
-
-static int all_ok = 1;
-
-static void expect_slice_eq(grpc_slice expected, grpc_slice slice, char *debug,
-                            int line) {
-  if (!grpc_slice_eq(slice, expected)) {
-    char *hs = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    char *he = grpc_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    gpr_log(GPR_ERROR, "FAILED:%d: %s\ngot:  %s\nwant: %s", line, debug, hs,
-            he);
-    gpr_free(hs);
-    gpr_free(he);
-    all_ok = 0;
-  }
-  grpc_slice_unref(expected);
-  grpc_slice_unref(slice);
-}
-
-static grpc_slice B64(const char *s) {
-  grpc_slice ss = grpc_slice_from_copied_string(s);
-  grpc_slice out = grpc_chttp2_base64_encode(ss);
-  grpc_slice_unref(ss);
-  return out;
-}
-
-static grpc_slice HUFF(const char *s) {
-  grpc_slice ss = grpc_slice_from_copied_string(s);
-  grpc_slice out = grpc_chttp2_huffman_compress(ss);
-  grpc_slice_unref(ss);
-  return out;
-}
-
-#define EXPECT_SLICE_EQ(expected, slice)                                    \
-  expect_slice_eq(                                                          \
-      grpc_slice_from_copied_buffer(expected, sizeof(expected) - 1), slice, \
-      #slice, __LINE__);
-
-static void expect_combined_equiv(const char *s, size_t len, int line) {
-  grpc_slice input = grpc_slice_from_copied_buffer(s, len);
-  grpc_slice base64 = grpc_chttp2_base64_encode(input);
-  grpc_slice expect = grpc_chttp2_huffman_compress(base64);
-  grpc_slice got = grpc_chttp2_base64_encode_and_huffman_compress(input);
-  if (!grpc_slice_eq(expect, got)) {
-    char *t = grpc_dump_slice(input, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    char *e = grpc_dump_slice(expect, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    char *g = grpc_dump_slice(got, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    gpr_log(GPR_ERROR, "FAILED:%d:\ntest: %s\ngot:  %s\nwant: %s", line, t, g,
-            e);
-    gpr_free(t);
-    gpr_free(e);
-    gpr_free(g);
-    all_ok = 0;
-  }
-  grpc_slice_unref(input);
-  grpc_slice_unref(base64);
-  grpc_slice_unref(expect);
-  grpc_slice_unref(got);
-}
-
-#define EXPECT_COMBINED_EQUIV(x) \
-  expect_combined_equiv(x, sizeof(x) - 1, __LINE__)
-
-static void expect_binary_header(const char *hdr, int binary) {
-  if (grpc_is_binary_header(grpc_slice_from_static_string(hdr)) != binary) {
-    gpr_log(GPR_ERROR, "FAILED: expected header '%s' to be %s", hdr,
-            binary ? "binary" : "not binary");
-    all_ok = 0;
-  }
-}
-
-int main(int argc, char **argv) {
-  /* Base64 test vectors from RFC 4648, with padding removed */
-  /* BASE64("") = "" */
-  EXPECT_SLICE_EQ("", B64(""));
-  /* BASE64("f") = "Zg" */
-  EXPECT_SLICE_EQ("Zg", B64("f"));
-  /* BASE64("fo") = "Zm8" */
-  EXPECT_SLICE_EQ("Zm8", B64("fo"));
-  /* BASE64("foo") = "Zm9v" */
-  EXPECT_SLICE_EQ("Zm9v", B64("foo"));
-  /* BASE64("foob") = "Zm9vYg" */
-  EXPECT_SLICE_EQ("Zm9vYg", B64("foob"));
-  /* BASE64("fooba") = "Zm9vYmE" */
-  EXPECT_SLICE_EQ("Zm9vYmE", B64("fooba"));
-  /* BASE64("foobar") = "Zm9vYmFy" */
-  EXPECT_SLICE_EQ("Zm9vYmFy", B64("foobar"));
-
-  EXPECT_SLICE_EQ("wMHCw8TF", B64("\xc0\xc1\xc2\xc3\xc4\xc5"));
-
-  /* Huffman encoding tests */
-  EXPECT_SLICE_EQ("\xf1\xe3\xc2\xe5\xf2\x3a\x6b\xa0\xab\x90\xf4\xff",
-                  HUFF("www.example.com"));
-  EXPECT_SLICE_EQ("\xa8\xeb\x10\x64\x9c\xbf", HUFF("no-cache"));
-  EXPECT_SLICE_EQ("\x25\xa8\x49\xe9\x5b\xa9\x7d\x7f", HUFF("custom-key"));
-  EXPECT_SLICE_EQ("\x25\xa8\x49\xe9\x5b\xb8\xe8\xb4\xbf", HUFF("custom-value"));
-  EXPECT_SLICE_EQ("\xae\xc3\x77\x1a\x4b", HUFF("private"));
-  EXPECT_SLICE_EQ(
-      "\xd0\x7a\xbe\x94\x10\x54\xd4\x44\xa8\x20\x05\x95\x04\x0b\x81\x66\xe0\x82"
-      "\xa6\x2d\x1b\xff",
-      HUFF("Mon, 21 Oct 2013 20:13:21 GMT"));
-  EXPECT_SLICE_EQ(
-      "\x9d\x29\xad\x17\x18\x63\xc7\x8f\x0b\x97\xc8\xe9\xae\x82\xae\x43\xd3",
-      HUFF("https://www.example.com"));
-
-  /* Various test vectors for combined encoding */
-  EXPECT_COMBINED_EQUIV("");
-  EXPECT_COMBINED_EQUIV("f");
-  EXPECT_COMBINED_EQUIV("fo");
-  EXPECT_COMBINED_EQUIV("foo");
-  EXPECT_COMBINED_EQUIV("foob");
-  EXPECT_COMBINED_EQUIV("fooba");
-  EXPECT_COMBINED_EQUIV("foobar");
-  EXPECT_COMBINED_EQUIV("www.example.com");
-  EXPECT_COMBINED_EQUIV("no-cache");
-  EXPECT_COMBINED_EQUIV("custom-key");
-  EXPECT_COMBINED_EQUIV("custom-value");
-  EXPECT_COMBINED_EQUIV("private");
-  EXPECT_COMBINED_EQUIV("Mon, 21 Oct 2013 20:13:21 GMT");
-  EXPECT_COMBINED_EQUIV("https://www.example.com");
-  EXPECT_COMBINED_EQUIV(
-      "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-      "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
-      "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
-      "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
-      "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
-      "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
-      "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
-      "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
-      "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-      "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-      "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
-      "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
-      "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-      "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
-      "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-      "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff");
-
-  expect_binary_header("foo-bin", 1);
-  expect_binary_header("foo-bar", 0);
-  expect_binary_header("-bin", 0);
-
-  return all_ok ? 0 : 1;
-}
diff --git a/test/core/transport/chttp2/bin_encoder_test.cc b/test/core/transport/chttp2/bin_encoder_test.cc
new file mode 100644
index 0000000..78b8808
--- /dev/null
+++ b/test/core/transport/chttp2/bin_encoder_test.cc
@@ -0,0 +1,173 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
+
+#include <string.h>
+
+/* This is here for grpc_is_binary_header
+ * TODO(murgatroid99): Remove this
+ */
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/support/string.h"
+
+static int all_ok = 1;
+
+static void expect_slice_eq(grpc_slice expected, grpc_slice slice,
+                            const char* debug, int line) {
+  if (!grpc_slice_eq(slice, expected)) {
+    char* hs = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    char* he = grpc_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    gpr_log(GPR_ERROR, "FAILED:%d: %s\ngot:  %s\nwant: %s", line, debug, hs,
+            he);
+    gpr_free(hs);
+    gpr_free(he);
+    all_ok = 0;
+  }
+  grpc_slice_unref(expected);
+  grpc_slice_unref(slice);
+}
+
+static grpc_slice B64(const char* s) {
+  grpc_slice ss = grpc_slice_from_copied_string(s);
+  grpc_slice out = grpc_chttp2_base64_encode(ss);
+  grpc_slice_unref(ss);
+  return out;
+}
+
+static grpc_slice HUFF(const char* s) {
+  grpc_slice ss = grpc_slice_from_copied_string(s);
+  grpc_slice out = grpc_chttp2_huffman_compress(ss);
+  grpc_slice_unref(ss);
+  return out;
+}
+
+#define EXPECT_SLICE_EQ(expected, slice)                                    \
+  expect_slice_eq(                                                          \
+      grpc_slice_from_copied_buffer(expected, sizeof(expected) - 1), slice, \
+      #slice, __LINE__);
+
+static void expect_combined_equiv(const char* s, size_t len, int line) {
+  grpc_slice input = grpc_slice_from_copied_buffer(s, len);
+  grpc_slice base64 = grpc_chttp2_base64_encode(input);
+  grpc_slice expect = grpc_chttp2_huffman_compress(base64);
+  grpc_slice got = grpc_chttp2_base64_encode_and_huffman_compress(input);
+  if (!grpc_slice_eq(expect, got)) {
+    char* t = grpc_dump_slice(input, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    char* e = grpc_dump_slice(expect, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    char* g = grpc_dump_slice(got, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    gpr_log(GPR_ERROR, "FAILED:%d:\ntest: %s\ngot:  %s\nwant: %s", line, t, g,
+            e);
+    gpr_free(t);
+    gpr_free(e);
+    gpr_free(g);
+    all_ok = 0;
+  }
+  grpc_slice_unref(input);
+  grpc_slice_unref(base64);
+  grpc_slice_unref(expect);
+  grpc_slice_unref(got);
+}
+
+#define EXPECT_COMBINED_EQUIV(x) \
+  expect_combined_equiv(x, sizeof(x) - 1, __LINE__)
+
+static void expect_binary_header(const char* hdr, int binary) {
+  if (grpc_is_binary_header(grpc_slice_from_static_string(hdr)) != binary) {
+    gpr_log(GPR_ERROR, "FAILED: expected header '%s' to be %s", hdr,
+            binary ? "binary" : "not binary");
+    all_ok = 0;
+  }
+}
+
+int main(int argc, char** argv) {
+  /* Base64 test vectors from RFC 4648, with padding removed */
+  /* BASE64("") = "" */
+  EXPECT_SLICE_EQ("", B64(""));
+  /* BASE64("f") = "Zg" */
+  EXPECT_SLICE_EQ("Zg", B64("f"));
+  /* BASE64("fo") = "Zm8" */
+  EXPECT_SLICE_EQ("Zm8", B64("fo"));
+  /* BASE64("foo") = "Zm9v" */
+  EXPECT_SLICE_EQ("Zm9v", B64("foo"));
+  /* BASE64("foob") = "Zm9vYg" */
+  EXPECT_SLICE_EQ("Zm9vYg", B64("foob"));
+  /* BASE64("fooba") = "Zm9vYmE" */
+  EXPECT_SLICE_EQ("Zm9vYmE", B64("fooba"));
+  /* BASE64("foobar") = "Zm9vYmFy" */
+  EXPECT_SLICE_EQ("Zm9vYmFy", B64("foobar"));
+
+  EXPECT_SLICE_EQ("wMHCw8TF", B64("\xc0\xc1\xc2\xc3\xc4\xc5"));
+
+  /* Huffman encoding tests */
+  EXPECT_SLICE_EQ("\xf1\xe3\xc2\xe5\xf2\x3a\x6b\xa0\xab\x90\xf4\xff",
+                  HUFF("www.example.com"));
+  EXPECT_SLICE_EQ("\xa8\xeb\x10\x64\x9c\xbf", HUFF("no-cache"));
+  EXPECT_SLICE_EQ("\x25\xa8\x49\xe9\x5b\xa9\x7d\x7f", HUFF("custom-key"));
+  EXPECT_SLICE_EQ("\x25\xa8\x49\xe9\x5b\xb8\xe8\xb4\xbf", HUFF("custom-value"));
+  EXPECT_SLICE_EQ("\xae\xc3\x77\x1a\x4b", HUFF("private"));
+  EXPECT_SLICE_EQ(
+      "\xd0\x7a\xbe\x94\x10\x54\xd4\x44\xa8\x20\x05\x95\x04\x0b\x81\x66\xe0\x82"
+      "\xa6\x2d\x1b\xff",
+      HUFF("Mon, 21 Oct 2013 20:13:21 GMT"));
+  EXPECT_SLICE_EQ(
+      "\x9d\x29\xad\x17\x18\x63\xc7\x8f\x0b\x97\xc8\xe9\xae\x82\xae\x43\xd3",
+      HUFF("https://www.example.com"));
+
+  /* Various test vectors for combined encoding */
+  EXPECT_COMBINED_EQUIV("");
+  EXPECT_COMBINED_EQUIV("f");
+  EXPECT_COMBINED_EQUIV("fo");
+  EXPECT_COMBINED_EQUIV("foo");
+  EXPECT_COMBINED_EQUIV("foob");
+  EXPECT_COMBINED_EQUIV("fooba");
+  EXPECT_COMBINED_EQUIV("foobar");
+  EXPECT_COMBINED_EQUIV("www.example.com");
+  EXPECT_COMBINED_EQUIV("no-cache");
+  EXPECT_COMBINED_EQUIV("custom-key");
+  EXPECT_COMBINED_EQUIV("custom-value");
+  EXPECT_COMBINED_EQUIV("private");
+  EXPECT_COMBINED_EQUIV("Mon, 21 Oct 2013 20:13:21 GMT");
+  EXPECT_COMBINED_EQUIV("https://www.example.com");
+  EXPECT_COMBINED_EQUIV(
+      "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+      "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+      "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+      "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+      "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+      "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+      "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+      "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+      "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+      "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+      "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+      "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+      "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+      "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+      "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+      "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff");
+
+  expect_binary_header("foo-bin", 1);
+  expect_binary_header("foo-bar", 0);
+  expect_binary_header("-bin", 0);
+
+  return all_ok ? 0 : 1;
+}
diff --git a/test/core/transport/chttp2/hpack_encoder_test.c b/test/core/transport/chttp2/hpack_encoder_test.c
deleted file mode 100644
index a2af83b..0000000
--- a/test/core/transport/chttp2/hpack_encoder_test.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/transport/metadata.h"
-#include "test/core/util/parse_hexstring.h"
-#include "test/core/util/slice_splitter.h"
-#include "test/core/util/test_config.h"
-
-#define TEST(x) run_test(x, #x)
-
-grpc_chttp2_hpack_compressor g_compressor;
-int g_failure = 0;
-
-void **to_delete = NULL;
-size_t num_to_delete = 0;
-size_t cap_to_delete = 0;
-
-typedef struct {
-  bool eof;
-  bool use_true_binary_metadata;
-  bool only_intern_key;
-} verify_params;
-
-/* verify that the output generated by encoding the stream matches the
-   hexstring passed in */
-static void verify(grpc_exec_ctx *exec_ctx, const verify_params params,
-                   const char *expected, size_t nheaders, ...) {
-  grpc_slice_buffer output;
-  grpc_slice merged;
-  grpc_slice expect = parse_hexstring(expected);
-  size_t i;
-  va_list l;
-  grpc_linked_mdelem *e = gpr_malloc(sizeof(*e) * nheaders);
-  grpc_metadata_batch b;
-
-  grpc_metadata_batch_init(&b);
-
-  va_start(l, nheaders);
-  for (i = 0; i < nheaders; i++) {
-    char *key = va_arg(l, char *);
-    char *value = va_arg(l, char *);
-    if (i) {
-      e[i - 1].next = &e[i];
-      e[i].prev = &e[i - 1];
-    }
-    grpc_slice value_slice = grpc_slice_from_static_string(value);
-    if (!params.only_intern_key) {
-      value_slice = grpc_slice_intern(value_slice);
-    }
-    e[i].md = grpc_mdelem_from_slices(
-        exec_ctx, grpc_slice_intern(grpc_slice_from_static_string(key)),
-        value_slice);
-  }
-  e[0].prev = NULL;
-  e[nheaders - 1].next = NULL;
-  va_end(l);
-
-  b.list.head = &e[0];
-  b.list.tail = &e[nheaders - 1];
-  b.list.count = nheaders;
-
-  if (cap_to_delete == num_to_delete) {
-    cap_to_delete = GPR_MAX(2 * cap_to_delete, 1000);
-    to_delete = gpr_realloc(to_delete, sizeof(*to_delete) * cap_to_delete);
-  }
-  to_delete[num_to_delete++] = e;
-
-  grpc_slice_buffer_init(&output);
-
-  grpc_transport_one_way_stats stats;
-  memset(&stats, 0, sizeof(stats));
-  grpc_encode_header_options hopt = {
-      .stream_id = 0xdeadbeef,
-      .is_eof = params.eof,
-      .use_true_binary_metadata = params.use_true_binary_metadata,
-      .max_frame_size = 16384,
-      .stats = &stats,
-  };
-  grpc_chttp2_encode_header(exec_ctx, &g_compressor, NULL, 0, &b, &hopt,
-                            &output);
-  merged = grpc_slice_merge(output.slices, output.count);
-  grpc_slice_buffer_destroy_internal(exec_ctx, &output);
-  grpc_metadata_batch_destroy(exec_ctx, &b);
-
-  if (!grpc_slice_eq(merged, expect)) {
-    char *expect_str = grpc_dump_slice(expect, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    char *got_str = grpc_dump_slice(merged, GPR_DUMP_HEX | GPR_DUMP_ASCII);
-    gpr_log(GPR_ERROR, "mismatched output for %s", expected);
-    gpr_log(GPR_ERROR, "EXPECT: %s", expect_str);
-    gpr_log(GPR_ERROR, "GOT:    %s", got_str);
-    gpr_free(expect_str);
-    gpr_free(got_str);
-    g_failure = 1;
-  }
-
-  grpc_slice_unref_internal(exec_ctx, merged);
-  grpc_slice_unref_internal(exec_ctx, expect);
-}
-
-static void test_basic_headers(grpc_exec_ctx *exec_ctx) {
-  int i;
-
-  verify_params params = {
-      .eof = false, .use_true_binary_metadata = false, .only_intern_key = false,
-  };
-  verify(exec_ctx, params, "000005 0104 deadbeef 40 0161 0161", 1, "a", "a");
-  verify(exec_ctx, params, "000001 0104 deadbeef be", 1, "a", "a");
-  verify(exec_ctx, params, "000001 0104 deadbeef be", 1, "a", "a");
-  verify(exec_ctx, params, "000006 0104 deadbeef be 40 0162 0163", 2, "a", "a",
-         "b", "c");
-  verify(exec_ctx, params, "000002 0104 deadbeef bf be", 2, "a", "a", "b", "c");
-  verify(exec_ctx, params, "000004 0104 deadbeef 7f 00 0164", 1, "a", "d");
-
-  /* flush out what's there to make a few values look very popular */
-  for (i = 0; i < 350; i++) {
-    verify(exec_ctx, params, "000003 0104 deadbeef c0 bf be", 3, "a", "a", "b",
-           "c", "a", "d");
-  }
-
-  verify(exec_ctx, params, "000006 0104 deadbeef c0 00 016b 0176", 2, "a", "a",
-         "k", "v");
-  /* this could be 000004 0104 deadbeef 0f 30 0176 also */
-  verify(exec_ctx, params, "000004 0104 deadbeef 0f 2f 0176", 1, "a", "v");
-}
-
-static void encode_int_to_str(int i, char *p) {
-  p[0] = (char)('a' + i % 26);
-  i /= 26;
-  GPR_ASSERT(i < 26);
-  p[1] = (char)('a' + i);
-  p[2] = 0;
-}
-
-static void test_decode_table_overflow(grpc_exec_ctx *exec_ctx) {
-  int i;
-  char key[3], value[3];
-  char *expect;
-
-  verify_params params = {
-      .eof = false, .use_true_binary_metadata = false, .only_intern_key = false,
-  };
-
-  for (i = 0; i < 114; i++) {
-    encode_int_to_str(i, key);
-    encode_int_to_str(i + 1, value);
-
-    if (i + 61 >= 127) {
-      gpr_asprintf(&expect,
-                   "000009 0104 deadbeef ff%02x 40 02%02x%02x 02%02x%02x",
-                   i + 61 - 127, key[0], key[1], value[0], value[1]);
-    } else if (i > 0) {
-      gpr_asprintf(&expect,
-                   "000008 0104 deadbeef %02x 40 02%02x%02x 02%02x%02x",
-                   0x80 + 61 + i, key[0], key[1], value[0], value[1]);
-    } else {
-      gpr_asprintf(&expect, "000007 0104 deadbeef 40 02%02x%02x 02%02x%02x",
-                   key[0], key[1], value[0], value[1]);
-    }
-
-    if (i > 0) {
-      verify(exec_ctx, params, expect, 2, "aa", "ba", key, value);
-    } else {
-      verify(exec_ctx, params, expect, 1, key, value);
-    }
-    gpr_free(expect);
-  }
-
-  /* if the above passes, then we must have just knocked this pair out of the
-     decoder stack, and so we'll be forced to re-encode it */
-  verify(exec_ctx, params, "000007 0104 deadbeef 40 026161 026261", 1, "aa",
-         "ba");
-}
-
-static void verify_table_size_change_match_elem_size(grpc_exec_ctx *exec_ctx,
-                                                     const char *key,
-                                                     const char *value,
-                                                     bool use_true_binary) {
-  grpc_slice_buffer output;
-  grpc_mdelem elem = grpc_mdelem_from_slices(
-      exec_ctx, grpc_slice_intern(grpc_slice_from_static_string(key)),
-      grpc_slice_intern(grpc_slice_from_static_string(value)));
-  size_t elem_size = grpc_mdelem_get_size_in_hpack_table(elem, use_true_binary);
-  size_t initial_table_size = g_compressor.table_size;
-  grpc_linked_mdelem *e = gpr_malloc(sizeof(*e));
-  grpc_metadata_batch b;
-  grpc_metadata_batch_init(&b);
-  e[0].md = elem;
-  e[0].prev = NULL;
-  e[0].next = NULL;
-  b.list.head = &e[0];
-  b.list.tail = &e[0];
-  b.list.count = 1;
-  grpc_slice_buffer_init(&output);
-
-  grpc_transport_one_way_stats stats;
-  memset(&stats, 0, sizeof(stats));
-  grpc_encode_header_options hopt = {
-      .stream_id = 0xdeadbeef,
-      .is_eof = false,
-      .use_true_binary_metadata = use_true_binary,
-      .max_frame_size = 16384,
-      .stats = &stats};
-  grpc_chttp2_encode_header(exec_ctx, &g_compressor, NULL, 0, &b, &hopt,
-                            &output);
-  grpc_slice_buffer_destroy_internal(exec_ctx, &output);
-  grpc_metadata_batch_destroy(exec_ctx, &b);
-
-  GPR_ASSERT(g_compressor.table_size == elem_size + initial_table_size);
-  gpr_free(e);
-}
-
-static void test_encode_header_size(grpc_exec_ctx *exec_ctx) {
-  verify_table_size_change_match_elem_size(exec_ctx, "hello", "world", false);
-  verify_table_size_change_match_elem_size(exec_ctx, "hello-bin", "world",
-                                           false);
-  verify_table_size_change_match_elem_size(exec_ctx, "true-binary-bin",
-                                           "I_am_true_binary_value", true);
-}
-
-static void test_interned_key_indexed(grpc_exec_ctx *exec_ctx) {
-  int i;
-  verify_params params = {
-      .eof = false, .use_true_binary_metadata = false, .only_intern_key = true,
-  };
-  verify(exec_ctx, params, "000009 0104 deadbeef 40 0161 0162 0f2f 0163", 2,
-         "a", "b", "a", "c");
-  for (i = 0; i < 10; i++) {
-    verify(exec_ctx, params, "000008 0104 deadbeef 0f2f 0162 0f2f 0163", 2, "a",
-           "b", "a", "c");
-  }
-}
-
-static void run_test(void (*test)(grpc_exec_ctx *exec_ctx), const char *name) {
-  gpr_log(GPR_INFO, "RUN TEST: %s", name);
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_chttp2_hpack_compressor_init(&g_compressor);
-  test(&exec_ctx);
-  grpc_chttp2_hpack_compressor_destroy(&exec_ctx, &g_compressor);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  size_t i;
-  grpc_test_only_set_slice_hash_seed(0);
-  grpc_test_init(argc, argv);
-  grpc_init();
-  TEST(test_basic_headers);
-  TEST(test_decode_table_overflow);
-  TEST(test_encode_header_size);
-  TEST(test_interned_key_indexed);
-  grpc_shutdown();
-  for (i = 0; i < num_to_delete; i++) {
-    gpr_free(to_delete[i]);
-  }
-  return g_failure;
-}
diff --git a/test/core/transport/chttp2/hpack_encoder_test.cc b/test/core/transport/chttp2/hpack_encoder_test.cc
new file mode 100644
index 0000000..a7e44ab
--- /dev/null
+++ b/test/core/transport/chttp2/hpack_encoder_test.cc
@@ -0,0 +1,289 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/transport/metadata.h"
+#include "test/core/util/parse_hexstring.h"
+#include "test/core/util/slice_splitter.h"
+#include "test/core/util/test_config.h"
+
+#define TEST(x) run_test(x, #x)
+
+grpc_chttp2_hpack_compressor g_compressor;
+int g_failure = 0;
+
+void** to_delete = NULL;
+size_t num_to_delete = 0;
+size_t cap_to_delete = 0;
+
+typedef struct {
+  bool eof;
+  bool use_true_binary_metadata;
+  bool only_intern_key;
+} verify_params;
+
+/* verify that the output generated by encoding the stream matches the
+   hexstring passed in */
+static void verify(grpc_exec_ctx* exec_ctx, const verify_params params,
+                   const char* expected, size_t nheaders, ...) {
+  grpc_slice_buffer output;
+  grpc_slice merged;
+  grpc_slice expect = parse_hexstring(expected);
+  size_t i;
+  va_list l;
+  grpc_linked_mdelem* e =
+      static_cast<grpc_linked_mdelem*>(gpr_malloc(sizeof(*e) * nheaders));
+  grpc_metadata_batch b;
+
+  grpc_metadata_batch_init(&b);
+
+  va_start(l, nheaders);
+  for (i = 0; i < nheaders; i++) {
+    char* key = va_arg(l, char*);
+    char* value = va_arg(l, char*);
+    if (i) {
+      e[i - 1].next = &e[i];
+      e[i].prev = &e[i - 1];
+    }
+    grpc_slice value_slice = grpc_slice_from_static_string(value);
+    if (!params.only_intern_key) {
+      value_slice = grpc_slice_intern(value_slice);
+    }
+    e[i].md = grpc_mdelem_from_slices(
+        exec_ctx, grpc_slice_intern(grpc_slice_from_static_string(key)),
+        value_slice);
+  }
+  e[0].prev = NULL;
+  e[nheaders - 1].next = NULL;
+  va_end(l);
+
+  b.list.head = &e[0];
+  b.list.tail = &e[nheaders - 1];
+  b.list.count = nheaders;
+
+  if (cap_to_delete == num_to_delete) {
+    cap_to_delete = GPR_MAX(2 * cap_to_delete, 1000);
+    to_delete = static_cast<void**>(
+        gpr_realloc(to_delete, sizeof(*to_delete) * cap_to_delete));
+  }
+  to_delete[num_to_delete++] = e;
+
+  grpc_slice_buffer_init(&output);
+
+  grpc_transport_one_way_stats stats;
+  memset(&stats, 0, sizeof(stats));
+  grpc_encode_header_options hopt = {
+      0xdeadbeef,                      /* stream_id */
+      params.eof,                      /* is_eof */
+      params.use_true_binary_metadata, /* use_true_binary_metadata */
+      16384,                           /* max_frame_size */
+      &stats                           /* stats */
+  };
+  grpc_chttp2_encode_header(exec_ctx, &g_compressor, NULL, 0, &b, &hopt,
+                            &output);
+  merged = grpc_slice_merge(output.slices, output.count);
+  grpc_slice_buffer_destroy_internal(exec_ctx, &output);
+  grpc_metadata_batch_destroy(exec_ctx, &b);
+
+  if (!grpc_slice_eq(merged, expect)) {
+    char* expect_str = grpc_dump_slice(expect, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    char* got_str = grpc_dump_slice(merged, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+    gpr_log(GPR_ERROR, "mismatched output for %s", expected);
+    gpr_log(GPR_ERROR, "EXPECT: %s", expect_str);
+    gpr_log(GPR_ERROR, "GOT:    %s", got_str);
+    gpr_free(expect_str);
+    gpr_free(got_str);
+    g_failure = 1;
+  }
+
+  grpc_slice_unref_internal(exec_ctx, merged);
+  grpc_slice_unref_internal(exec_ctx, expect);
+}
+
+static void test_basic_headers(grpc_exec_ctx* exec_ctx) {
+  int i;
+
+  verify_params params = {
+      false,
+      false,
+      false,
+  };
+  verify(exec_ctx, params, "000005 0104 deadbeef 40 0161 0161", 1, "a", "a");
+  verify(exec_ctx, params, "000001 0104 deadbeef be", 1, "a", "a");
+  verify(exec_ctx, params, "000001 0104 deadbeef be", 1, "a", "a");
+  verify(exec_ctx, params, "000006 0104 deadbeef be 40 0162 0163", 2, "a", "a",
+         "b", "c");
+  verify(exec_ctx, params, "000002 0104 deadbeef bf be", 2, "a", "a", "b", "c");
+  verify(exec_ctx, params, "000004 0104 deadbeef 7f 00 0164", 1, "a", "d");
+
+  /* flush out what's there to make a few values look very popular */
+  for (i = 0; i < 350; i++) {
+    verify(exec_ctx, params, "000003 0104 deadbeef c0 bf be", 3, "a", "a", "b",
+           "c", "a", "d");
+  }
+
+  verify(exec_ctx, params, "000006 0104 deadbeef c0 00 016b 0176", 2, "a", "a",
+         "k", "v");
+  /* this could be 000004 0104 deadbeef 0f 30 0176 also */
+  verify(exec_ctx, params, "000004 0104 deadbeef 0f 2f 0176", 1, "a", "v");
+}
+
+static void encode_int_to_str(int i, char* p) {
+  p[0] = (char)('a' + i % 26);
+  i /= 26;
+  GPR_ASSERT(i < 26);
+  p[1] = (char)('a' + i);
+  p[2] = 0;
+}
+
+static void test_decode_table_overflow(grpc_exec_ctx* exec_ctx) {
+  int i;
+  char key[3], value[3];
+  char* expect;
+
+  verify_params params = {
+      false,
+      false,
+      false,
+  };
+
+  for (i = 0; i < 114; i++) {
+    encode_int_to_str(i, key);
+    encode_int_to_str(i + 1, value);
+
+    if (i + 61 >= 127) {
+      gpr_asprintf(&expect,
+                   "000009 0104 deadbeef ff%02x 40 02%02x%02x 02%02x%02x",
+                   i + 61 - 127, key[0], key[1], value[0], value[1]);
+    } else if (i > 0) {
+      gpr_asprintf(&expect,
+                   "000008 0104 deadbeef %02x 40 02%02x%02x 02%02x%02x",
+                   0x80 + 61 + i, key[0], key[1], value[0], value[1]);
+    } else {
+      gpr_asprintf(&expect, "000007 0104 deadbeef 40 02%02x%02x 02%02x%02x",
+                   key[0], key[1], value[0], value[1]);
+    }
+
+    if (i > 0) {
+      verify(exec_ctx, params, expect, 2, "aa", "ba", key, value);
+    } else {
+      verify(exec_ctx, params, expect, 1, key, value);
+    }
+    gpr_free(expect);
+  }
+
+  /* if the above passes, then we must have just knocked this pair out of the
+     decoder stack, and so we'll be forced to re-encode it */
+  verify(exec_ctx, params, "000007 0104 deadbeef 40 026161 026261", 1, "aa",
+         "ba");
+}
+
+static void verify_table_size_change_match_elem_size(grpc_exec_ctx* exec_ctx,
+                                                     const char* key,
+                                                     const char* value,
+                                                     bool use_true_binary) {
+  grpc_slice_buffer output;
+  grpc_mdelem elem = grpc_mdelem_from_slices(
+      exec_ctx, grpc_slice_intern(grpc_slice_from_static_string(key)),
+      grpc_slice_intern(grpc_slice_from_static_string(value)));
+  size_t elem_size = grpc_mdelem_get_size_in_hpack_table(elem, use_true_binary);
+  size_t initial_table_size = g_compressor.table_size;
+  grpc_linked_mdelem* e =
+      static_cast<grpc_linked_mdelem*>(gpr_malloc(sizeof(*e)));
+  grpc_metadata_batch b;
+  grpc_metadata_batch_init(&b);
+  e[0].md = elem;
+  e[0].prev = NULL;
+  e[0].next = NULL;
+  b.list.head = &e[0];
+  b.list.tail = &e[0];
+  b.list.count = 1;
+  grpc_slice_buffer_init(&output);
+
+  grpc_transport_one_way_stats stats;
+  memset(&stats, 0, sizeof(stats));
+  grpc_encode_header_options hopt = {
+      0xdeadbeef,      /* stream_id */
+      false,           /* is_eof */
+      use_true_binary, /* use_true_binary_metadata */
+      16384,           /* max_frame_size */
+      &stats /* stats */};
+  grpc_chttp2_encode_header(exec_ctx, &g_compressor, NULL, 0, &b, &hopt,
+                            &output);
+  grpc_slice_buffer_destroy_internal(exec_ctx, &output);
+  grpc_metadata_batch_destroy(exec_ctx, &b);
+
+  GPR_ASSERT(g_compressor.table_size == elem_size + initial_table_size);
+  gpr_free(e);
+}
+
+static void test_encode_header_size(grpc_exec_ctx* exec_ctx) {
+  verify_table_size_change_match_elem_size(exec_ctx, "hello", "world", false);
+  verify_table_size_change_match_elem_size(exec_ctx, "hello-bin", "world",
+                                           false);
+  verify_table_size_change_match_elem_size(exec_ctx, "true-binary-bin",
+                                           "I_am_true_binary_value", true);
+}
+
+static void test_interned_key_indexed(grpc_exec_ctx* exec_ctx) {
+  int i;
+  verify_params params = {false, false, true};
+  verify(exec_ctx, params, "000009 0104 deadbeef 40 0161 0162 0f2f 0163", 2,
+         "a", "b", "a", "c");
+  for (i = 0; i < 10; i++) {
+    verify(exec_ctx, params, "000008 0104 deadbeef 0f2f 0162 0f2f 0163", 2, "a",
+           "b", "a", "c");
+  }
+}
+
+static void run_test(void (*test)(grpc_exec_ctx* exec_ctx), const char* name) {
+  gpr_log(GPR_INFO, "RUN TEST: %s", name);
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_chttp2_hpack_compressor_init(&g_compressor);
+  test(&exec_ctx);
+  grpc_chttp2_hpack_compressor_destroy(&exec_ctx, &g_compressor);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  size_t i;
+  grpc_test_only_set_slice_hash_seed(0);
+  grpc_test_init(argc, argv);
+  grpc_init();
+  TEST(test_basic_headers);
+  TEST(test_decode_table_overflow);
+  TEST(test_encode_header_size);
+  TEST(test_interned_key_indexed);
+  grpc_shutdown();
+  for (i = 0; i < num_to_delete; i++) {
+    gpr_free(to_delete[i]);
+  }
+  return g_failure;
+}
diff --git a/test/core/transport/chttp2/hpack_parser_fuzzer_test.c b/test/core/transport/chttp2/hpack_parser_fuzzer_test.c
deleted file mode 100644
index 0383408..0000000
--- a/test/core/transport/chttp2/hpack_parser_fuzzer_test.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
-#include "src/core/lib/slice/slice_internal.h"
-
-bool squelch = true;
-bool leak_check = true;
-
-static void onhdr(grpc_exec_ctx *exec_ctx, void *ud, grpc_mdelem md) {
-  GRPC_MDELEM_UNREF(exec_ctx, md);
-}
-static void dont_log(gpr_log_func_args *args) {}
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
-  grpc_test_only_set_slice_hash_seed(0);
-  if (squelch) gpr_set_log_function(dont_log);
-  grpc_init();
-  grpc_chttp2_hpack_parser parser;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
-  parser.on_header = onhdr;
-  GRPC_ERROR_UNREF(grpc_chttp2_hpack_parser_parse(
-      &exec_ctx, &parser, grpc_slice_from_static_buffer(data, size)));
-  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
new file mode 100644
index 0000000..942f25e
--- /dev/null
+++ b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
@@ -0,0 +1,51 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
+#include "src/core/lib/slice/slice_internal.h"
+
+bool squelch = true;
+bool leak_check = true;
+
+static void onhdr(grpc_exec_ctx* exec_ctx, void* ud, grpc_mdelem md) {
+  GRPC_MDELEM_UNREF(exec_ctx, md);
+}
+static void dont_log(gpr_log_func_args* args) {}
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  grpc_test_only_set_slice_hash_seed(0);
+  if (squelch) gpr_set_log_function(dont_log);
+  grpc_init();
+  grpc_chttp2_hpack_parser parser;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
+  parser.on_header = onhdr;
+  GRPC_ERROR_UNREF(grpc_chttp2_hpack_parser_parse(
+      &exec_ctx, &parser, grpc_slice_from_static_buffer(data, size)));
+  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/transport/chttp2/hpack_parser_test.c b/test/core/transport/chttp2/hpack_parser_test.c
deleted file mode 100644
index 0946c05..0000000
--- a/test/core/transport/chttp2/hpack_parser_test.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
-
-#include <stdarg.h>
-
-#include <grpc/grpc.h>
-#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "test/core/util/parse_hexstring.h"
-#include "test/core/util/slice_splitter.h"
-#include "test/core/util/test_config.h"
-
-typedef struct { va_list args; } test_checker;
-
-static void onhdr(grpc_exec_ctx *exec_ctx, void *ud, grpc_mdelem md) {
-  const char *ekey, *evalue;
-  test_checker *chk = ud;
-  ekey = va_arg(chk->args, char *);
-  GPR_ASSERT(ekey);
-  evalue = va_arg(chk->args, char *);
-  GPR_ASSERT(evalue);
-  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDKEY(md), ekey) == 0);
-  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(md), evalue) == 0);
-  GRPC_MDELEM_UNREF(exec_ctx, md);
-}
-
-static void test_vector(grpc_chttp2_hpack_parser *parser,
-                        grpc_slice_split_mode mode, const char *hexstring,
-                        ... /* char *key, char *value */) {
-  grpc_slice input = parse_hexstring(hexstring);
-  grpc_slice *slices;
-  size_t nslices;
-  size_t i;
-  test_checker chk;
-
-  va_start(chk.args, hexstring);
-
-  parser->on_header = onhdr;
-  parser->on_header_user_data = &chk;
-
-  grpc_split_slices(mode, &input, 1, &slices, &nslices);
-  grpc_slice_unref(input);
-
-  for (i = 0; i < nslices; i++) {
-    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-    GPR_ASSERT(grpc_chttp2_hpack_parser_parse(&exec_ctx, parser, slices[i]) ==
-               GRPC_ERROR_NONE);
-    grpc_exec_ctx_finish(&exec_ctx);
-  }
-
-  for (i = 0; i < nslices; i++) {
-    grpc_slice_unref(slices[i]);
-  }
-  gpr_free(slices);
-
-  GPR_ASSERT(NULL == va_arg(chk.args, char *));
-
-  va_end(chk.args);
-}
-
-static void test_vectors(grpc_slice_split_mode mode) {
-  grpc_chttp2_hpack_parser parser;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
-  /* D.2.1 */
-  test_vector(&parser, mode,
-              "400a 6375 7374 6f6d 2d6b 6579 0d63 7573"
-              "746f 6d2d 6865 6164 6572",
-              "custom-key", "custom-header", NULL);
-  /* D.2.2 */
-  test_vector(&parser, mode, "040c 2f73 616d 706c 652f 7061 7468", ":path",
-              "/sample/path", NULL);
-  /* D.2.3 */
-  test_vector(&parser, mode,
-              "1008 7061 7373 776f 7264 0673 6563 7265"
-              "74",
-              "password", "secret", NULL);
-  /* D.2.4 */
-  test_vector(&parser, mode, "82", ":method", "GET", NULL);
-  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
-
-  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
-  /* D.3.1 */
-  test_vector(&parser, mode,
-              "8286 8441 0f77 7777 2e65 7861 6d70 6c65"
-              "2e63 6f6d",
-              ":method", "GET", ":scheme", "http", ":path", "/", ":authority",
-              "www.example.com", NULL);
-  /* D.3.2 */
-  test_vector(&parser, mode, "8286 84be 5808 6e6f 2d63 6163 6865", ":method",
-              "GET", ":scheme", "http", ":path", "/", ":authority",
-              "www.example.com", "cache-control", "no-cache", NULL);
-  /* D.3.3 */
-  test_vector(&parser, mode,
-              "8287 85bf 400a 6375 7374 6f6d 2d6b 6579"
-              "0c63 7573 746f 6d2d 7661 6c75 65",
-              ":method", "GET", ":scheme", "https", ":path", "/index.html",
-              ":authority", "www.example.com", "custom-key", "custom-value",
-              NULL);
-  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
-
-  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
-  /* D.4.1 */
-  test_vector(&parser, mode,
-              "8286 8441 8cf1 e3c2 e5f2 3a6b a0ab 90f4"
-              "ff",
-              ":method", "GET", ":scheme", "http", ":path", "/", ":authority",
-              "www.example.com", NULL);
-  /* D.4.2 */
-  test_vector(&parser, mode, "8286 84be 5886 a8eb 1064 9cbf", ":method", "GET",
-              ":scheme", "http", ":path", "/", ":authority", "www.example.com",
-              "cache-control", "no-cache", NULL);
-  /* D.4.3 */
-  test_vector(&parser, mode,
-              "8287 85bf 4088 25a8 49e9 5ba9 7d7f 8925"
-              "a849 e95b b8e8 b4bf",
-              ":method", "GET", ":scheme", "https", ":path", "/index.html",
-              ":authority", "www.example.com", "custom-key", "custom-value",
-              NULL);
-  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
-
-  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
-  grpc_chttp2_hptbl_set_max_bytes(&exec_ctx, &parser.table, 256);
-  grpc_chttp2_hptbl_set_current_table_size(&exec_ctx, &parser.table, 256);
-  /* D.5.1 */
-  test_vector(&parser, mode,
-              "4803 3330 3258 0770 7269 7661 7465 611d"
-              "4d6f 6e2c 2032 3120 4f63 7420 3230 3133"
-              "2032 303a 3133 3a32 3120 474d 546e 1768"
-              "7474 7073 3a2f 2f77 7777 2e65 7861 6d70"
-              "6c65 2e63 6f6d",
-              ":status", "302", "cache-control", "private", "date",
-              "Mon, 21 Oct 2013 20:13:21 GMT", "location",
-              "https://www.example.com", NULL);
-  /* D.5.2 */
-  test_vector(&parser, mode, "4803 3330 37c1 c0bf", ":status", "307",
-              "cache-control", "private", "date",
-              "Mon, 21 Oct 2013 20:13:21 GMT", "location",
-              "https://www.example.com", NULL);
-  /* D.5.3 */
-  test_vector(&parser, mode,
-              "88c1 611d 4d6f 6e2c 2032 3120 4f63 7420"
-              "3230 3133 2032 303a 3133 3a32 3220 474d"
-              "54c0 5a04 677a 6970 7738 666f 6f3d 4153"
-              "444a 4b48 514b 425a 584f 5157 454f 5049"
-              "5541 5851 5745 4f49 553b 206d 6178 2d61"
-              "6765 3d33 3630 303b 2076 6572 7369 6f6e"
-              "3d31",
-              ":status", "200", "cache-control", "private", "date",
-              "Mon, 21 Oct 2013 20:13:22 GMT", "location",
-              "https://www.example.com", "content-encoding", "gzip",
-              "set-cookie",
-              "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1", NULL);
-  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
-
-  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
-  grpc_chttp2_hptbl_set_max_bytes(&exec_ctx, &parser.table, 256);
-  grpc_chttp2_hptbl_set_current_table_size(&exec_ctx, &parser.table, 256);
-  /* D.6.1 */
-  test_vector(&parser, mode,
-              "4882 6402 5885 aec3 771a 4b61 96d0 7abe"
-              "9410 54d4 44a8 2005 9504 0b81 66e0 82a6"
-              "2d1b ff6e 919d 29ad 1718 63c7 8f0b 97c8"
-              "e9ae 82ae 43d3",
-              ":status", "302", "cache-control", "private", "date",
-              "Mon, 21 Oct 2013 20:13:21 GMT", "location",
-              "https://www.example.com", NULL);
-  /* D.6.2 */
-  test_vector(&parser, mode, "4883 640e ffc1 c0bf", ":status", "307",
-              "cache-control", "private", "date",
-              "Mon, 21 Oct 2013 20:13:21 GMT", "location",
-              "https://www.example.com", NULL);
-  /* D.6.3 */
-  test_vector(&parser, mode,
-              "88c1 6196 d07a be94 1054 d444 a820 0595"
-              "040b 8166 e084 a62d 1bff c05a 839b d9ab"
-              "77ad 94e7 821d d7f2 e6c7 b335 dfdf cd5b"
-              "3960 d5af 2708 7f36 72c1 ab27 0fb5 291f"
-              "9587 3160 65c0 03ed 4ee5 b106 3d50 07",
-              ":status", "200", "cache-control", "private", "date",
-              "Mon, 21 Oct 2013 20:13:22 GMT", "location",
-              "https://www.example.com", "content-encoding", "gzip",
-              "set-cookie",
-              "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1", NULL);
-  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_vectors(GRPC_SLICE_SPLIT_MERGE_ALL);
-  test_vectors(GRPC_SLICE_SPLIT_ONE_BYTE);
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/transport/chttp2/hpack_parser_test.cc b/test/core/transport/chttp2/hpack_parser_test.cc
new file mode 100644
index 0000000..434b46e
--- /dev/null
+++ b/test/core/transport/chttp2/hpack_parser_test.cc
@@ -0,0 +1,218 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
+
+#include <stdarg.h>
+
+#include <grpc/grpc.h>
+#include <grpc/slice.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include "test/core/util/parse_hexstring.h"
+#include "test/core/util/slice_splitter.h"
+#include "test/core/util/test_config.h"
+
+typedef struct {
+  va_list args;
+} test_checker;
+
+static void onhdr(grpc_exec_ctx* exec_ctx, void* ud, grpc_mdelem md) {
+  const char *ekey, *evalue;
+  test_checker* chk = static_cast<test_checker*>(ud);
+  ekey = va_arg(chk->args, char*);
+  GPR_ASSERT(ekey);
+  evalue = va_arg(chk->args, char*);
+  GPR_ASSERT(evalue);
+  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDKEY(md), ekey) == 0);
+  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(md), evalue) == 0);
+  GRPC_MDELEM_UNREF(exec_ctx, md);
+}
+
+static void test_vector(grpc_chttp2_hpack_parser* parser,
+                        grpc_slice_split_mode mode, const char* hexstring,
+                        ... /* char *key, char *value */) {
+  grpc_slice input = parse_hexstring(hexstring);
+  grpc_slice* slices;
+  size_t nslices;
+  size_t i;
+  test_checker chk;
+
+  va_start(chk.args, hexstring);
+
+  parser->on_header = onhdr;
+  parser->on_header_user_data = &chk;
+
+  grpc_split_slices(mode, &input, 1, &slices, &nslices);
+  grpc_slice_unref(input);
+
+  for (i = 0; i < nslices; i++) {
+    grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+    GPR_ASSERT(grpc_chttp2_hpack_parser_parse(&exec_ctx, parser, slices[i]) ==
+               GRPC_ERROR_NONE);
+    grpc_exec_ctx_finish(&exec_ctx);
+  }
+
+  for (i = 0; i < nslices; i++) {
+    grpc_slice_unref(slices[i]);
+  }
+  gpr_free(slices);
+
+  GPR_ASSERT(NULL == va_arg(chk.args, char*));
+
+  va_end(chk.args);
+}
+
+static void test_vectors(grpc_slice_split_mode mode) {
+  grpc_chttp2_hpack_parser parser;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
+  /* D.2.1 */
+  test_vector(&parser, mode,
+              "400a 6375 7374 6f6d 2d6b 6579 0d63 7573"
+              "746f 6d2d 6865 6164 6572",
+              "custom-key", "custom-header", NULL);
+  /* D.2.2 */
+  test_vector(&parser, mode, "040c 2f73 616d 706c 652f 7061 7468", ":path",
+              "/sample/path", NULL);
+  /* D.2.3 */
+  test_vector(&parser, mode,
+              "1008 7061 7373 776f 7264 0673 6563 7265"
+              "74",
+              "password", "secret", NULL);
+  /* D.2.4 */
+  test_vector(&parser, mode, "82", ":method", "GET", NULL);
+  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
+
+  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
+  /* D.3.1 */
+  test_vector(&parser, mode,
+              "8286 8441 0f77 7777 2e65 7861 6d70 6c65"
+              "2e63 6f6d",
+              ":method", "GET", ":scheme", "http", ":path", "/", ":authority",
+              "www.example.com", NULL);
+  /* D.3.2 */
+  test_vector(&parser, mode, "8286 84be 5808 6e6f 2d63 6163 6865", ":method",
+              "GET", ":scheme", "http", ":path", "/", ":authority",
+              "www.example.com", "cache-control", "no-cache", NULL);
+  /* D.3.3 */
+  test_vector(&parser, mode,
+              "8287 85bf 400a 6375 7374 6f6d 2d6b 6579"
+              "0c63 7573 746f 6d2d 7661 6c75 65",
+              ":method", "GET", ":scheme", "https", ":path", "/index.html",
+              ":authority", "www.example.com", "custom-key", "custom-value",
+              NULL);
+  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
+
+  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
+  /* D.4.1 */
+  test_vector(&parser, mode,
+              "8286 8441 8cf1 e3c2 e5f2 3a6b a0ab 90f4"
+              "ff",
+              ":method", "GET", ":scheme", "http", ":path", "/", ":authority",
+              "www.example.com", NULL);
+  /* D.4.2 */
+  test_vector(&parser, mode, "8286 84be 5886 a8eb 1064 9cbf", ":method", "GET",
+              ":scheme", "http", ":path", "/", ":authority", "www.example.com",
+              "cache-control", "no-cache", NULL);
+  /* D.4.3 */
+  test_vector(&parser, mode,
+              "8287 85bf 4088 25a8 49e9 5ba9 7d7f 8925"
+              "a849 e95b b8e8 b4bf",
+              ":method", "GET", ":scheme", "https", ":path", "/index.html",
+              ":authority", "www.example.com", "custom-key", "custom-value",
+              NULL);
+  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
+
+  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
+  grpc_chttp2_hptbl_set_max_bytes(&exec_ctx, &parser.table, 256);
+  grpc_chttp2_hptbl_set_current_table_size(&exec_ctx, &parser.table, 256);
+  /* D.5.1 */
+  test_vector(&parser, mode,
+              "4803 3330 3258 0770 7269 7661 7465 611d"
+              "4d6f 6e2c 2032 3120 4f63 7420 3230 3133"
+              "2032 303a 3133 3a32 3120 474d 546e 1768"
+              "7474 7073 3a2f 2f77 7777 2e65 7861 6d70"
+              "6c65 2e63 6f6d",
+              ":status", "302", "cache-control", "private", "date",
+              "Mon, 21 Oct 2013 20:13:21 GMT", "location",
+              "https://www.example.com", NULL);
+  /* D.5.2 */
+  test_vector(&parser, mode, "4803 3330 37c1 c0bf", ":status", "307",
+              "cache-control", "private", "date",
+              "Mon, 21 Oct 2013 20:13:21 GMT", "location",
+              "https://www.example.com", NULL);
+  /* D.5.3 */
+  test_vector(&parser, mode,
+              "88c1 611d 4d6f 6e2c 2032 3120 4f63 7420"
+              "3230 3133 2032 303a 3133 3a32 3220 474d"
+              "54c0 5a04 677a 6970 7738 666f 6f3d 4153"
+              "444a 4b48 514b 425a 584f 5157 454f 5049"
+              "5541 5851 5745 4f49 553b 206d 6178 2d61"
+              "6765 3d33 3630 303b 2076 6572 7369 6f6e"
+              "3d31",
+              ":status", "200", "cache-control", "private", "date",
+              "Mon, 21 Oct 2013 20:13:22 GMT", "location",
+              "https://www.example.com", "content-encoding", "gzip",
+              "set-cookie",
+              "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1", NULL);
+  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
+
+  grpc_chttp2_hpack_parser_init(&exec_ctx, &parser);
+  grpc_chttp2_hptbl_set_max_bytes(&exec_ctx, &parser.table, 256);
+  grpc_chttp2_hptbl_set_current_table_size(&exec_ctx, &parser.table, 256);
+  /* D.6.1 */
+  test_vector(&parser, mode,
+              "4882 6402 5885 aec3 771a 4b61 96d0 7abe"
+              "9410 54d4 44a8 2005 9504 0b81 66e0 82a6"
+              "2d1b ff6e 919d 29ad 1718 63c7 8f0b 97c8"
+              "e9ae 82ae 43d3",
+              ":status", "302", "cache-control", "private", "date",
+              "Mon, 21 Oct 2013 20:13:21 GMT", "location",
+              "https://www.example.com", NULL);
+  /* D.6.2 */
+  test_vector(&parser, mode, "4883 640e ffc1 c0bf", ":status", "307",
+              "cache-control", "private", "date",
+              "Mon, 21 Oct 2013 20:13:21 GMT", "location",
+              "https://www.example.com", NULL);
+  /* D.6.3 */
+  test_vector(&parser, mode,
+              "88c1 6196 d07a be94 1054 d444 a820 0595"
+              "040b 8166 e084 a62d 1bff c05a 839b d9ab"
+              "77ad 94e7 821d d7f2 e6c7 b335 dfdf cd5b"
+              "3960 d5af 2708 7f36 72c1 ab27 0fb5 291f"
+              "9587 3160 65c0 03ed 4ee5 b106 3d50 07",
+              ":status", "200", "cache-control", "private", "date",
+              "Mon, 21 Oct 2013 20:13:22 GMT", "location",
+              "https://www.example.com", "content-encoding", "gzip",
+              "set-cookie",
+              "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1", NULL);
+  grpc_chttp2_hpack_parser_destroy(&exec_ctx, &parser);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_vectors(GRPC_SLICE_SPLIT_MERGE_ALL);
+  test_vectors(GRPC_SLICE_SPLIT_ONE_BYTE);
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c
deleted file mode 100644
index 430ece3..0000000
--- a/test/core/transport/chttp2/hpack_table_test.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/transport/chttp2/transport/hpack_table.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/support/string.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
-
-static void assert_str(const grpc_chttp2_hptbl *tbl, grpc_slice mdstr,
-                       const char *str) {
-  GPR_ASSERT(grpc_slice_str_cmp(mdstr, str) == 0);
-}
-
-static void assert_index(const grpc_chttp2_hptbl *tbl, uint32_t idx,
-                         const char *key, const char *value) {
-  grpc_mdelem md = grpc_chttp2_hptbl_lookup(tbl, idx);
-  assert_str(tbl, GRPC_MDKEY(md), key);
-  assert_str(tbl, GRPC_MDVALUE(md), value);
-}
-
-static void test_static_lookup(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_chttp2_hptbl tbl;
-
-  grpc_chttp2_hptbl_init(&exec_ctx, &tbl);
-
-  LOG_TEST("test_static_lookup");
-  assert_index(&tbl, 1, ":authority", "");
-  assert_index(&tbl, 2, ":method", "GET");
-  assert_index(&tbl, 3, ":method", "POST");
-  assert_index(&tbl, 4, ":path", "/");
-  assert_index(&tbl, 5, ":path", "/index.html");
-  assert_index(&tbl, 6, ":scheme", "http");
-  assert_index(&tbl, 7, ":scheme", "https");
-  assert_index(&tbl, 8, ":status", "200");
-  assert_index(&tbl, 9, ":status", "204");
-  assert_index(&tbl, 10, ":status", "206");
-  assert_index(&tbl, 11, ":status", "304");
-  assert_index(&tbl, 12, ":status", "400");
-  assert_index(&tbl, 13, ":status", "404");
-  assert_index(&tbl, 14, ":status", "500");
-  assert_index(&tbl, 15, "accept-charset", "");
-  assert_index(&tbl, 16, "accept-encoding", "gzip, deflate");
-  assert_index(&tbl, 17, "accept-language", "");
-  assert_index(&tbl, 18, "accept-ranges", "");
-  assert_index(&tbl, 19, "accept", "");
-  assert_index(&tbl, 20, "access-control-allow-origin", "");
-  assert_index(&tbl, 21, "age", "");
-  assert_index(&tbl, 22, "allow", "");
-  assert_index(&tbl, 23, "authorization", "");
-  assert_index(&tbl, 24, "cache-control", "");
-  assert_index(&tbl, 25, "content-disposition", "");
-  assert_index(&tbl, 26, "content-encoding", "");
-  assert_index(&tbl, 27, "content-language", "");
-  assert_index(&tbl, 28, "content-length", "");
-  assert_index(&tbl, 29, "content-location", "");
-  assert_index(&tbl, 30, "content-range", "");
-  assert_index(&tbl, 31, "content-type", "");
-  assert_index(&tbl, 32, "cookie", "");
-  assert_index(&tbl, 33, "date", "");
-  assert_index(&tbl, 34, "etag", "");
-  assert_index(&tbl, 35, "expect", "");
-  assert_index(&tbl, 36, "expires", "");
-  assert_index(&tbl, 37, "from", "");
-  assert_index(&tbl, 38, "host", "");
-  assert_index(&tbl, 39, "if-match", "");
-  assert_index(&tbl, 40, "if-modified-since", "");
-  assert_index(&tbl, 41, "if-none-match", "");
-  assert_index(&tbl, 42, "if-range", "");
-  assert_index(&tbl, 43, "if-unmodified-since", "");
-  assert_index(&tbl, 44, "last-modified", "");
-  assert_index(&tbl, 45, "link", "");
-  assert_index(&tbl, 46, "location", "");
-  assert_index(&tbl, 47, "max-forwards", "");
-  assert_index(&tbl, 48, "proxy-authenticate", "");
-  assert_index(&tbl, 49, "proxy-authorization", "");
-  assert_index(&tbl, 50, "range", "");
-  assert_index(&tbl, 51, "referer", "");
-  assert_index(&tbl, 52, "refresh", "");
-  assert_index(&tbl, 53, "retry-after", "");
-  assert_index(&tbl, 54, "server", "");
-  assert_index(&tbl, 55, "set-cookie", "");
-  assert_index(&tbl, 56, "strict-transport-security", "");
-  assert_index(&tbl, 57, "transfer-encoding", "");
-  assert_index(&tbl, 58, "user-agent", "");
-  assert_index(&tbl, 59, "vary", "");
-  assert_index(&tbl, 60, "via", "");
-  assert_index(&tbl, 61, "www-authenticate", "");
-
-  grpc_chttp2_hptbl_destroy(&exec_ctx, &tbl);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_many_additions(void) {
-  grpc_chttp2_hptbl tbl;
-  int i;
-  char *key;
-  char *value;
-
-  LOG_TEST("test_many_additions");
-
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_chttp2_hptbl_init(&exec_ctx, &tbl);
-
-  for (i = 0; i < 100000; i++) {
-    grpc_mdelem elem;
-    gpr_asprintf(&key, "K:%d", i);
-    gpr_asprintf(&value, "VALUE:%d", i);
-    elem =
-        grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_copied_string(key),
-                                grpc_slice_from_copied_string(value));
-    GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
-    GRPC_MDELEM_UNREF(&exec_ctx, elem);
-    assert_index(&tbl, 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY, key, value);
-    gpr_free(key);
-    gpr_free(value);
-    if (i) {
-      gpr_asprintf(&key, "K:%d", i - 1);
-      gpr_asprintf(&value, "VALUE:%d", i - 1);
-      assert_index(&tbl, 2 + GRPC_CHTTP2_LAST_STATIC_ENTRY, key, value);
-      gpr_free(key);
-      gpr_free(value);
-    }
-  }
-
-  grpc_chttp2_hptbl_destroy(&exec_ctx, &tbl);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static grpc_chttp2_hptbl_find_result find_simple(grpc_chttp2_hptbl *tbl,
-                                                 const char *key,
-                                                 const char *value) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem md =
-      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_copied_string(key),
-                              grpc_slice_from_copied_string(value));
-  grpc_chttp2_hptbl_find_result r = grpc_chttp2_hptbl_find(tbl, md);
-  GRPC_MDELEM_UNREF(&exec_ctx, md);
-  grpc_exec_ctx_finish(&exec_ctx);
-  return r;
-}
-
-static void test_find(void) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_chttp2_hptbl tbl;
-  uint32_t i;
-  char buffer[32];
-  grpc_mdelem elem;
-  grpc_chttp2_hptbl_find_result r;
-
-  LOG_TEST("test_find");
-
-  grpc_chttp2_hptbl_init(&exec_ctx, &tbl);
-  elem =
-      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_static_string("abc"),
-                              grpc_slice_from_static_string("xyz"));
-  GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
-  GRPC_MDELEM_UNREF(&exec_ctx, elem);
-  elem =
-      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_static_string("abc"),
-                              grpc_slice_from_static_string("123"));
-  GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
-  GRPC_MDELEM_UNREF(&exec_ctx, elem);
-  elem = grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_static_string("x"),
-                                 grpc_slice_from_static_string("1"));
-  GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
-  GRPC_MDELEM_UNREF(&exec_ctx, elem);
-
-  r = find_simple(&tbl, "abc", "123");
-  GPR_ASSERT(r.index == 2 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
-  GPR_ASSERT(r.has_value == 1);
-
-  r = find_simple(&tbl, "abc", "xyz");
-  GPR_ASSERT(r.index == 3 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
-  GPR_ASSERT(r.has_value == 1);
-
-  r = find_simple(&tbl, "x", "1");
-  GPR_ASSERT(r.index == 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
-  GPR_ASSERT(r.has_value == 1);
-
-  r = find_simple(&tbl, "x", "2");
-  GPR_ASSERT(r.index == 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
-  GPR_ASSERT(r.has_value == 0);
-
-  r = find_simple(&tbl, "vary", "some-vary-arg");
-  GPR_ASSERT(r.index == 59);
-  GPR_ASSERT(r.has_value == 0);
-
-  r = find_simple(&tbl, "accept-encoding", "gzip, deflate");
-  GPR_ASSERT(r.index == 16);
-  GPR_ASSERT(r.has_value == 1);
-
-  r = find_simple(&tbl, "accept-encoding", "gzip");
-  GPR_ASSERT(r.index == 16);
-  GPR_ASSERT(r.has_value == 0);
-
-  r = find_simple(&tbl, ":method", "GET");
-  GPR_ASSERT(r.index == 2);
-  GPR_ASSERT(r.has_value == 1);
-
-  r = find_simple(&tbl, ":method", "POST");
-  GPR_ASSERT(r.index == 3);
-  GPR_ASSERT(r.has_value == 1);
-
-  r = find_simple(&tbl, ":method", "PUT");
-  GPR_ASSERT(r.index == 2 || r.index == 3);
-  GPR_ASSERT(r.has_value == 0);
-
-  r = find_simple(&tbl, "this-does-not-exist", "");
-  GPR_ASSERT(r.index == 0);
-  GPR_ASSERT(r.has_value == 0);
-
-  /* overflow the string buffer, check find still works */
-  for (i = 0; i < 10000; i++) {
-    int64_ttoa(i, buffer);
-    elem = grpc_mdelem_from_slices(&exec_ctx,
-                                   grpc_slice_from_static_string("test"),
-                                   grpc_slice_from_copied_string(buffer));
-    GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
-    GRPC_MDELEM_UNREF(&exec_ctx, elem);
-  }
-
-  r = find_simple(&tbl, "abc", "123");
-  GPR_ASSERT(r.index == 0);
-  GPR_ASSERT(r.has_value == 0);
-
-  r = find_simple(&tbl, "test", "9999");
-  GPR_ASSERT(r.index == 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
-  GPR_ASSERT(r.has_value == 1);
-
-  r = find_simple(&tbl, "test", "9998");
-  GPR_ASSERT(r.index == 2 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
-  GPR_ASSERT(r.has_value == 1);
-
-  for (i = 0; i < tbl.num_ents; i++) {
-    uint32_t expect = 9999 - i;
-    int64_ttoa(expect, buffer);
-
-    r = find_simple(&tbl, "test", buffer);
-    GPR_ASSERT(r.index == i + 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
-    GPR_ASSERT(r.has_value == 1);
-  }
-
-  r = find_simple(&tbl, "test", "10000");
-  GPR_ASSERT(r.index != 0);
-  GPR_ASSERT(r.has_value == 0);
-
-  grpc_chttp2_hptbl_destroy(&exec_ctx, &tbl);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  test_static_lookup();
-  test_many_additions();
-  test_find();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/transport/chttp2/hpack_table_test.cc b/test/core/transport/chttp2/hpack_table_test.cc
new file mode 100644
index 0000000..ff7c2de
--- /dev/null
+++ b/test/core/transport/chttp2/hpack_table_test.cc
@@ -0,0 +1,285 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/transport/chttp2/transport/hpack_table.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/support/string.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
+
+static void assert_str(const grpc_chttp2_hptbl* tbl, grpc_slice mdstr,
+                       const char* str) {
+  GPR_ASSERT(grpc_slice_str_cmp(mdstr, str) == 0);
+}
+
+static void assert_index(const grpc_chttp2_hptbl* tbl, uint32_t idx,
+                         const char* key, const char* value) {
+  grpc_mdelem md = grpc_chttp2_hptbl_lookup(tbl, idx);
+  assert_str(tbl, GRPC_MDKEY(md), key);
+  assert_str(tbl, GRPC_MDVALUE(md), value);
+}
+
+static void test_static_lookup(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_chttp2_hptbl tbl;
+
+  grpc_chttp2_hptbl_init(&exec_ctx, &tbl);
+
+  LOG_TEST("test_static_lookup");
+  assert_index(&tbl, 1, ":authority", "");
+  assert_index(&tbl, 2, ":method", "GET");
+  assert_index(&tbl, 3, ":method", "POST");
+  assert_index(&tbl, 4, ":path", "/");
+  assert_index(&tbl, 5, ":path", "/index.html");
+  assert_index(&tbl, 6, ":scheme", "http");
+  assert_index(&tbl, 7, ":scheme", "https");
+  assert_index(&tbl, 8, ":status", "200");
+  assert_index(&tbl, 9, ":status", "204");
+  assert_index(&tbl, 10, ":status", "206");
+  assert_index(&tbl, 11, ":status", "304");
+  assert_index(&tbl, 12, ":status", "400");
+  assert_index(&tbl, 13, ":status", "404");
+  assert_index(&tbl, 14, ":status", "500");
+  assert_index(&tbl, 15, "accept-charset", "");
+  assert_index(&tbl, 16, "accept-encoding", "gzip, deflate");
+  assert_index(&tbl, 17, "accept-language", "");
+  assert_index(&tbl, 18, "accept-ranges", "");
+  assert_index(&tbl, 19, "accept", "");
+  assert_index(&tbl, 20, "access-control-allow-origin", "");
+  assert_index(&tbl, 21, "age", "");
+  assert_index(&tbl, 22, "allow", "");
+  assert_index(&tbl, 23, "authorization", "");
+  assert_index(&tbl, 24, "cache-control", "");
+  assert_index(&tbl, 25, "content-disposition", "");
+  assert_index(&tbl, 26, "content-encoding", "");
+  assert_index(&tbl, 27, "content-language", "");
+  assert_index(&tbl, 28, "content-length", "");
+  assert_index(&tbl, 29, "content-location", "");
+  assert_index(&tbl, 30, "content-range", "");
+  assert_index(&tbl, 31, "content-type", "");
+  assert_index(&tbl, 32, "cookie", "");
+  assert_index(&tbl, 33, "date", "");
+  assert_index(&tbl, 34, "etag", "");
+  assert_index(&tbl, 35, "expect", "");
+  assert_index(&tbl, 36, "expires", "");
+  assert_index(&tbl, 37, "from", "");
+  assert_index(&tbl, 38, "host", "");
+  assert_index(&tbl, 39, "if-match", "");
+  assert_index(&tbl, 40, "if-modified-since", "");
+  assert_index(&tbl, 41, "if-none-match", "");
+  assert_index(&tbl, 42, "if-range", "");
+  assert_index(&tbl, 43, "if-unmodified-since", "");
+  assert_index(&tbl, 44, "last-modified", "");
+  assert_index(&tbl, 45, "link", "");
+  assert_index(&tbl, 46, "location", "");
+  assert_index(&tbl, 47, "max-forwards", "");
+  assert_index(&tbl, 48, "proxy-authenticate", "");
+  assert_index(&tbl, 49, "proxy-authorization", "");
+  assert_index(&tbl, 50, "range", "");
+  assert_index(&tbl, 51, "referer", "");
+  assert_index(&tbl, 52, "refresh", "");
+  assert_index(&tbl, 53, "retry-after", "");
+  assert_index(&tbl, 54, "server", "");
+  assert_index(&tbl, 55, "set-cookie", "");
+  assert_index(&tbl, 56, "strict-transport-security", "");
+  assert_index(&tbl, 57, "transfer-encoding", "");
+  assert_index(&tbl, 58, "user-agent", "");
+  assert_index(&tbl, 59, "vary", "");
+  assert_index(&tbl, 60, "via", "");
+  assert_index(&tbl, 61, "www-authenticate", "");
+
+  grpc_chttp2_hptbl_destroy(&exec_ctx, &tbl);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_many_additions(void) {
+  grpc_chttp2_hptbl tbl;
+  int i;
+  char* key;
+  char* value;
+
+  LOG_TEST("test_many_additions");
+
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_chttp2_hptbl_init(&exec_ctx, &tbl);
+
+  for (i = 0; i < 100000; i++) {
+    grpc_mdelem elem;
+    gpr_asprintf(&key, "K:%d", i);
+    gpr_asprintf(&value, "VALUE:%d", i);
+    elem =
+        grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_copied_string(key),
+                                grpc_slice_from_copied_string(value));
+    GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
+    GRPC_MDELEM_UNREF(&exec_ctx, elem);
+    assert_index(&tbl, 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY, key, value);
+    gpr_free(key);
+    gpr_free(value);
+    if (i) {
+      gpr_asprintf(&key, "K:%d", i - 1);
+      gpr_asprintf(&value, "VALUE:%d", i - 1);
+      assert_index(&tbl, 2 + GRPC_CHTTP2_LAST_STATIC_ENTRY, key, value);
+      gpr_free(key);
+      gpr_free(value);
+    }
+  }
+
+  grpc_chttp2_hptbl_destroy(&exec_ctx, &tbl);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static grpc_chttp2_hptbl_find_result find_simple(grpc_chttp2_hptbl* tbl,
+                                                 const char* key,
+                                                 const char* value) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem md =
+      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_copied_string(key),
+                              grpc_slice_from_copied_string(value));
+  grpc_chttp2_hptbl_find_result r = grpc_chttp2_hptbl_find(tbl, md);
+  GRPC_MDELEM_UNREF(&exec_ctx, md);
+  grpc_exec_ctx_finish(&exec_ctx);
+  return r;
+}
+
+static void test_find(void) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_chttp2_hptbl tbl;
+  uint32_t i;
+  char buffer[32];
+  grpc_mdelem elem;
+  grpc_chttp2_hptbl_find_result r;
+
+  LOG_TEST("test_find");
+
+  grpc_chttp2_hptbl_init(&exec_ctx, &tbl);
+  elem =
+      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_static_string("abc"),
+                              grpc_slice_from_static_string("xyz"));
+  GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
+  GRPC_MDELEM_UNREF(&exec_ctx, elem);
+  elem =
+      grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_static_string("abc"),
+                              grpc_slice_from_static_string("123"));
+  GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
+  GRPC_MDELEM_UNREF(&exec_ctx, elem);
+  elem = grpc_mdelem_from_slices(&exec_ctx, grpc_slice_from_static_string("x"),
+                                 grpc_slice_from_static_string("1"));
+  GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
+  GRPC_MDELEM_UNREF(&exec_ctx, elem);
+
+  r = find_simple(&tbl, "abc", "123");
+  GPR_ASSERT(r.index == 2 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
+  GPR_ASSERT(r.has_value == 1);
+
+  r = find_simple(&tbl, "abc", "xyz");
+  GPR_ASSERT(r.index == 3 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
+  GPR_ASSERT(r.has_value == 1);
+
+  r = find_simple(&tbl, "x", "1");
+  GPR_ASSERT(r.index == 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
+  GPR_ASSERT(r.has_value == 1);
+
+  r = find_simple(&tbl, "x", "2");
+  GPR_ASSERT(r.index == 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
+  GPR_ASSERT(r.has_value == 0);
+
+  r = find_simple(&tbl, "vary", "some-vary-arg");
+  GPR_ASSERT(r.index == 59);
+  GPR_ASSERT(r.has_value == 0);
+
+  r = find_simple(&tbl, "accept-encoding", "gzip, deflate");
+  GPR_ASSERT(r.index == 16);
+  GPR_ASSERT(r.has_value == 1);
+
+  r = find_simple(&tbl, "accept-encoding", "gzip");
+  GPR_ASSERT(r.index == 16);
+  GPR_ASSERT(r.has_value == 0);
+
+  r = find_simple(&tbl, ":method", "GET");
+  GPR_ASSERT(r.index == 2);
+  GPR_ASSERT(r.has_value == 1);
+
+  r = find_simple(&tbl, ":method", "POST");
+  GPR_ASSERT(r.index == 3);
+  GPR_ASSERT(r.has_value == 1);
+
+  r = find_simple(&tbl, ":method", "PUT");
+  GPR_ASSERT(r.index == 2 || r.index == 3);
+  GPR_ASSERT(r.has_value == 0);
+
+  r = find_simple(&tbl, "this-does-not-exist", "");
+  GPR_ASSERT(r.index == 0);
+  GPR_ASSERT(r.has_value == 0);
+
+  /* overflow the string buffer, check find still works */
+  for (i = 0; i < 10000; i++) {
+    int64_ttoa(i, buffer);
+    elem = grpc_mdelem_from_slices(&exec_ctx,
+                                   grpc_slice_from_static_string("test"),
+                                   grpc_slice_from_copied_string(buffer));
+    GPR_ASSERT(grpc_chttp2_hptbl_add(&exec_ctx, &tbl, elem) == GRPC_ERROR_NONE);
+    GRPC_MDELEM_UNREF(&exec_ctx, elem);
+  }
+
+  r = find_simple(&tbl, "abc", "123");
+  GPR_ASSERT(r.index == 0);
+  GPR_ASSERT(r.has_value == 0);
+
+  r = find_simple(&tbl, "test", "9999");
+  GPR_ASSERT(r.index == 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
+  GPR_ASSERT(r.has_value == 1);
+
+  r = find_simple(&tbl, "test", "9998");
+  GPR_ASSERT(r.index == 2 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
+  GPR_ASSERT(r.has_value == 1);
+
+  for (i = 0; i < tbl.num_ents; i++) {
+    uint32_t expect = 9999 - i;
+    int64_ttoa(expect, buffer);
+
+    r = find_simple(&tbl, "test", buffer);
+    GPR_ASSERT(r.index == i + 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY);
+    GPR_ASSERT(r.has_value == 1);
+  }
+
+  r = find_simple(&tbl, "test", "10000");
+  GPR_ASSERT(r.index != 0);
+  GPR_ASSERT(r.has_value == 0);
+
+  grpc_chttp2_hptbl_destroy(&exec_ctx, &tbl);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  test_static_lookup();
+  test_many_additions();
+  test_find();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/transport/chttp2/stream_map_test.c b/test/core/transport/chttp2/stream_map_test.c
deleted file mode 100644
index ae2583a..0000000
--- a/test/core/transport/chttp2/stream_map_test.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/transport/chttp2/transport/stream_map.h"
-#include <grpc/support/log.h>
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
-
-/* test creation & destruction */
-static void test_no_op(void) {
-  grpc_chttp2_stream_map map;
-
-  LOG_TEST("test_no_op");
-
-  grpc_chttp2_stream_map_init(&map, 8);
-  grpc_chttp2_stream_map_destroy(&map);
-}
-
-/* test lookup on an empty map */
-static void test_empty_find(void) {
-  grpc_chttp2_stream_map map;
-
-  LOG_TEST("test_empty_find");
-
-  grpc_chttp2_stream_map_init(&map, 8);
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 39128));
-  grpc_chttp2_stream_map_destroy(&map);
-}
-
-/* test it's safe to delete twice */
-static void test_double_deletion(void) {
-  grpc_chttp2_stream_map map;
-
-  LOG_TEST("test_double_deletion");
-
-  grpc_chttp2_stream_map_init(&map, 8);
-  GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map));
-  grpc_chttp2_stream_map_add(&map, 1, (void *)1);
-  GPR_ASSERT((void *)1 == grpc_chttp2_stream_map_find(&map, 1));
-  GPR_ASSERT(1 == grpc_chttp2_stream_map_size(&map));
-  GPR_ASSERT((void *)1 == grpc_chttp2_stream_map_delete(&map, 1));
-  GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_delete(&map, 1));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_delete(&map, 1));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_delete(&map, 1));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1));
-  grpc_chttp2_stream_map_destroy(&map);
-}
-
-/* test add & lookup */
-static void test_basic_add_find(uint32_t n) {
-  grpc_chttp2_stream_map map;
-  uint32_t i;
-  size_t got;
-
-  LOG_TEST("test_basic_add_find");
-  gpr_log(GPR_INFO, "n = %d", n);
-
-  grpc_chttp2_stream_map_init(&map, 8);
-  GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map));
-  for (i = 1; i <= n; i++) {
-    grpc_chttp2_stream_map_add(&map, i, (void *)(uintptr_t)i);
-  }
-  GPR_ASSERT(n == grpc_chttp2_stream_map_size(&map));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 0));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, n + 1));
-  for (i = 1; i <= n; i++) {
-    got = (uintptr_t)grpc_chttp2_stream_map_find(&map, i);
-    GPR_ASSERT(i == got);
-  }
-  grpc_chttp2_stream_map_destroy(&map);
-}
-
-/* verify that for_each gets the right values during test_delete_evens_XXX */
-static void verify_for_each(void *user_data, uint32_t stream_id, void *ptr) {
-  uint32_t *for_each_check = user_data;
-  GPR_ASSERT(ptr);
-  GPR_ASSERT(*for_each_check == stream_id);
-  *for_each_check += 2;
-}
-
-static void check_delete_evens(grpc_chttp2_stream_map *map, uint32_t n) {
-  uint32_t for_each_check = 1;
-  uint32_t i;
-  size_t got;
-
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, 0));
-  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, n + 1));
-  for (i = 1; i <= n; i++) {
-    if (i & 1) {
-      got = (uintptr_t)grpc_chttp2_stream_map_find(map, i);
-      GPR_ASSERT(i == got);
-    } else {
-      GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, i));
-    }
-  }
-
-  grpc_chttp2_stream_map_for_each(map, verify_for_each, &for_each_check);
-  if (n & 1) {
-    GPR_ASSERT(for_each_check == n + 2);
-  } else {
-    GPR_ASSERT(for_each_check == n + 1);
-  }
-}
-
-/* add a bunch of keys, delete the even ones, and make sure the map is
-   consistent */
-static void test_delete_evens_sweep(uint32_t n) {
-  grpc_chttp2_stream_map map;
-  uint32_t i;
-
-  LOG_TEST("test_delete_evens_sweep");
-  gpr_log(GPR_INFO, "n = %d", n);
-
-  grpc_chttp2_stream_map_init(&map, 8);
-  for (i = 1; i <= n; i++) {
-    grpc_chttp2_stream_map_add(&map, i, (void *)(uintptr_t)i);
-  }
-  for (i = 1; i <= n; i++) {
-    if ((i & 1) == 0) {
-      GPR_ASSERT((void *)(uintptr_t)i ==
-                 grpc_chttp2_stream_map_delete(&map, i));
-    }
-  }
-  check_delete_evens(&map, n);
-  grpc_chttp2_stream_map_destroy(&map);
-}
-
-/* add a bunch of keys, delete the even ones immediately, and make sure the map
-   is consistent */
-static void test_delete_evens_incremental(uint32_t n) {
-  grpc_chttp2_stream_map map;
-  uint32_t i;
-
-  LOG_TEST("test_delete_evens_incremental");
-  gpr_log(GPR_INFO, "n = %d", n);
-
-  grpc_chttp2_stream_map_init(&map, 8);
-  for (i = 1; i <= n; i++) {
-    grpc_chttp2_stream_map_add(&map, i, (void *)(uintptr_t)i);
-    if ((i & 1) == 0) {
-      grpc_chttp2_stream_map_delete(&map, i);
-    }
-  }
-  check_delete_evens(&map, n);
-  grpc_chttp2_stream_map_destroy(&map);
-}
-
-/* add a bunch of keys, delete old ones after some time, ensure the
-   backing array does not grow */
-static void test_periodic_compaction(uint32_t n) {
-  grpc_chttp2_stream_map map;
-  uint32_t i;
-  uint32_t del;
-
-  LOG_TEST("test_periodic_compaction");
-  gpr_log(GPR_INFO, "n = %d", n);
-
-  grpc_chttp2_stream_map_init(&map, 16);
-  GPR_ASSERT(map.capacity == 16);
-  for (i = 1; i <= n; i++) {
-    grpc_chttp2_stream_map_add(&map, i, (void *)(uintptr_t)i);
-    if (i > 8) {
-      del = i - 8;
-      GPR_ASSERT((void *)(uintptr_t)del ==
-                 grpc_chttp2_stream_map_delete(&map, del));
-    }
-  }
-  GPR_ASSERT(map.capacity == 16);
-  grpc_chttp2_stream_map_destroy(&map);
-}
-
-int main(int argc, char **argv) {
-  uint32_t n = 1;
-  uint32_t prev = 1;
-  uint32_t tmp;
-
-  grpc_test_init(argc, argv);
-
-  test_no_op();
-  test_empty_find();
-  test_double_deletion();
-
-  while (n < 100000) {
-    test_basic_add_find(n);
-    test_delete_evens_sweep(n);
-    test_delete_evens_incremental(n);
-    test_periodic_compaction(n);
-
-    tmp = n;
-    n += prev;
-    prev = tmp;
-  }
-
-  return 0;
-}
diff --git a/test/core/transport/chttp2/stream_map_test.cc b/test/core/transport/chttp2/stream_map_test.cc
new file mode 100644
index 0000000..23a7b3f
--- /dev/null
+++ b/test/core/transport/chttp2/stream_map_test.cc
@@ -0,0 +1,214 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/transport/chttp2/transport/stream_map.h"
+#include <grpc/support/log.h>
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
+
+/* test creation & destruction */
+static void test_no_op(void) {
+  grpc_chttp2_stream_map map;
+
+  LOG_TEST("test_no_op");
+
+  grpc_chttp2_stream_map_init(&map, 8);
+  grpc_chttp2_stream_map_destroy(&map);
+}
+
+/* test lookup on an empty map */
+static void test_empty_find(void) {
+  grpc_chttp2_stream_map map;
+
+  LOG_TEST("test_empty_find");
+
+  grpc_chttp2_stream_map_init(&map, 8);
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 39128));
+  grpc_chttp2_stream_map_destroy(&map);
+}
+
+/* test it's safe to delete twice */
+static void test_double_deletion(void) {
+  grpc_chttp2_stream_map map;
+
+  LOG_TEST("test_double_deletion");
+
+  grpc_chttp2_stream_map_init(&map, 8);
+  GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map));
+  grpc_chttp2_stream_map_add(&map, 1, (void*)1);
+  GPR_ASSERT((void*)1 == grpc_chttp2_stream_map_find(&map, 1));
+  GPR_ASSERT(1 == grpc_chttp2_stream_map_size(&map));
+  GPR_ASSERT((void*)1 == grpc_chttp2_stream_map_delete(&map, 1));
+  GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_delete(&map, 1));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_delete(&map, 1));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_delete(&map, 1));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 1));
+  grpc_chttp2_stream_map_destroy(&map);
+}
+
+/* test add & lookup */
+static void test_basic_add_find(uint32_t n) {
+  grpc_chttp2_stream_map map;
+  uint32_t i;
+  size_t got;
+
+  LOG_TEST("test_basic_add_find");
+  gpr_log(GPR_INFO, "n = %d", n);
+
+  grpc_chttp2_stream_map_init(&map, 8);
+  GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map));
+  for (i = 1; i <= n; i++) {
+    grpc_chttp2_stream_map_add(&map, i, (void*)(uintptr_t)i);
+  }
+  GPR_ASSERT(n == grpc_chttp2_stream_map_size(&map));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, 0));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(&map, n + 1));
+  for (i = 1; i <= n; i++) {
+    got = (uintptr_t)grpc_chttp2_stream_map_find(&map, i);
+    GPR_ASSERT(i == got);
+  }
+  grpc_chttp2_stream_map_destroy(&map);
+}
+
+/* verify that for_each gets the right values during test_delete_evens_XXX */
+static void verify_for_each(void* user_data, uint32_t stream_id, void* ptr) {
+  uint32_t* for_each_check = static_cast<uint32_t*>(user_data);
+  GPR_ASSERT(ptr);
+  GPR_ASSERT(*for_each_check == stream_id);
+  *for_each_check += 2;
+}
+
+static void check_delete_evens(grpc_chttp2_stream_map* map, uint32_t n) {
+  uint32_t for_each_check = 1;
+  uint32_t i;
+  size_t got;
+
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, 0));
+  GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, n + 1));
+  for (i = 1; i <= n; i++) {
+    if (i & 1) {
+      got = (uintptr_t)grpc_chttp2_stream_map_find(map, i);
+      GPR_ASSERT(i == got);
+    } else {
+      GPR_ASSERT(NULL == grpc_chttp2_stream_map_find(map, i));
+    }
+  }
+
+  grpc_chttp2_stream_map_for_each(map, verify_for_each, &for_each_check);
+  if (n & 1) {
+    GPR_ASSERT(for_each_check == n + 2);
+  } else {
+    GPR_ASSERT(for_each_check == n + 1);
+  }
+}
+
+/* add a bunch of keys, delete the even ones, and make sure the map is
+   consistent */
+static void test_delete_evens_sweep(uint32_t n) {
+  grpc_chttp2_stream_map map;
+  uint32_t i;
+
+  LOG_TEST("test_delete_evens_sweep");
+  gpr_log(GPR_INFO, "n = %d", n);
+
+  grpc_chttp2_stream_map_init(&map, 8);
+  for (i = 1; i <= n; i++) {
+    grpc_chttp2_stream_map_add(&map, i, (void*)(uintptr_t)i);
+  }
+  for (i = 1; i <= n; i++) {
+    if ((i & 1) == 0) {
+      GPR_ASSERT((void*)(uintptr_t)i == grpc_chttp2_stream_map_delete(&map, i));
+    }
+  }
+  check_delete_evens(&map, n);
+  grpc_chttp2_stream_map_destroy(&map);
+}
+
+/* add a bunch of keys, delete the even ones immediately, and make sure the map
+   is consistent */
+static void test_delete_evens_incremental(uint32_t n) {
+  grpc_chttp2_stream_map map;
+  uint32_t i;
+
+  LOG_TEST("test_delete_evens_incremental");
+  gpr_log(GPR_INFO, "n = %d", n);
+
+  grpc_chttp2_stream_map_init(&map, 8);
+  for (i = 1; i <= n; i++) {
+    grpc_chttp2_stream_map_add(&map, i, (void*)(uintptr_t)i);
+    if ((i & 1) == 0) {
+      grpc_chttp2_stream_map_delete(&map, i);
+    }
+  }
+  check_delete_evens(&map, n);
+  grpc_chttp2_stream_map_destroy(&map);
+}
+
+/* add a bunch of keys, delete old ones after some time, ensure the
+   backing array does not grow */
+static void test_periodic_compaction(uint32_t n) {
+  grpc_chttp2_stream_map map;
+  uint32_t i;
+  uint32_t del;
+
+  LOG_TEST("test_periodic_compaction");
+  gpr_log(GPR_INFO, "n = %d", n);
+
+  grpc_chttp2_stream_map_init(&map, 16);
+  GPR_ASSERT(map.capacity == 16);
+  for (i = 1; i <= n; i++) {
+    grpc_chttp2_stream_map_add(&map, i, (void*)(uintptr_t)i);
+    if (i > 8) {
+      del = i - 8;
+      GPR_ASSERT((void*)(uintptr_t)del ==
+                 grpc_chttp2_stream_map_delete(&map, del));
+    }
+  }
+  GPR_ASSERT(map.capacity == 16);
+  grpc_chttp2_stream_map_destroy(&map);
+}
+
+int main(int argc, char** argv) {
+  uint32_t n = 1;
+  uint32_t prev = 1;
+  uint32_t tmp;
+
+  grpc_test_init(argc, argv);
+
+  test_no_op();
+  test_empty_find();
+  test_double_deletion();
+
+  while (n < 100000) {
+    test_basic_add_find(n);
+    test_delete_evens_sweep(n);
+    test_delete_evens_incremental(n);
+    test_periodic_compaction(n);
+
+    tmp = n;
+    n += prev;
+    prev = tmp;
+  }
+
+  return 0;
+}
diff --git a/test/core/transport/chttp2/varint_test.c b/test/core/transport/chttp2/varint_test.c
deleted file mode 100644
index 0986a2c..0000000
--- a/test/core/transport/chttp2/varint_test.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/ext/transport/chttp2/transport/varint.h"
-
-#include <grpc/slice.h>
-#include <grpc/support/log.h>
-
-#include "test/core/util/test_config.h"
-
-static void test_varint(uint32_t value, uint32_t prefix_bits, uint8_t prefix_or,
-                        const char *expect_bytes, size_t expect_length) {
-  uint32_t nbytes = GRPC_CHTTP2_VARINT_LENGTH(value, prefix_bits);
-  grpc_slice expect =
-      grpc_slice_from_copied_buffer(expect_bytes, expect_length);
-  grpc_slice slice;
-  gpr_log(GPR_DEBUG, "Test: 0x%08x", value);
-  GPR_ASSERT(nbytes == expect_length);
-  slice = grpc_slice_malloc(nbytes);
-  GRPC_CHTTP2_WRITE_VARINT(value, prefix_bits, prefix_or,
-                           GRPC_SLICE_START_PTR(slice), nbytes);
-  GPR_ASSERT(grpc_slice_eq(expect, slice));
-  grpc_slice_unref(expect);
-  grpc_slice_unref(slice);
-}
-
-#define TEST_VARINT(value, prefix_bits, prefix_or, expect) \
-  test_varint(value, prefix_bits, prefix_or, expect, sizeof(expect) - 1)
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  TEST_VARINT(0, 1, 0, "\x00");
-  TEST_VARINT(128, 1, 0, "\x7f\x01");
-  TEST_VARINT(16384, 1, 0, "\x7f\x81\x7f");
-  TEST_VARINT(2097152, 1, 0, "\x7f\x81\xff\x7f");
-  TEST_VARINT(268435456, 1, 0, "\x7f\x81\xff\xff\x7f");
-  TEST_VARINT(0xffffffff, 1, 0, "\x7f\x80\xff\xff\xff\x0f");
-  return 0;
-}
diff --git a/test/core/transport/chttp2/varint_test.cc b/test/core/transport/chttp2/varint_test.cc
new file mode 100644
index 0000000..413b461
--- /dev/null
+++ b/test/core/transport/chttp2/varint_test.cc
@@ -0,0 +1,54 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/ext/transport/chttp2/transport/varint.h"
+
+#include <grpc/slice.h>
+#include <grpc/support/log.h>
+
+#include "test/core/util/test_config.h"
+
+static void test_varint(uint32_t value, uint32_t prefix_bits, uint8_t prefix_or,
+                        const char* expect_bytes, size_t expect_length) {
+  uint32_t nbytes = GRPC_CHTTP2_VARINT_LENGTH(value, prefix_bits);
+  grpc_slice expect =
+      grpc_slice_from_copied_buffer(expect_bytes, expect_length);
+  grpc_slice slice;
+  gpr_log(GPR_DEBUG, "Test: 0x%08x", value);
+  GPR_ASSERT(nbytes == expect_length);
+  slice = grpc_slice_malloc(nbytes);
+  GRPC_CHTTP2_WRITE_VARINT(value, prefix_bits, prefix_or,
+                           GRPC_SLICE_START_PTR(slice), nbytes);
+  GPR_ASSERT(grpc_slice_eq(expect, slice));
+  grpc_slice_unref(expect);
+  grpc_slice_unref(slice);
+}
+
+#define TEST_VARINT(value, prefix_bits, prefix_or, expect) \
+  test_varint(value, prefix_bits, prefix_or, expect, sizeof(expect) - 1)
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  TEST_VARINT(0, 1, 0, "\x00");
+  TEST_VARINT(128, 1, 0, "\x7f\x01");
+  TEST_VARINT(16384, 1, 0, "\x7f\x81\x7f");
+  TEST_VARINT(2097152, 1, 0, "\x7f\x81\xff\x7f");
+  TEST_VARINT(268435456, 1, 0, "\x7f\x81\xff\xff\x7f");
+  TEST_VARINT(0xffffffff, 1, 0, "\x7f\x80\xff\xff\xff\x0f");
+  return 0;
+}
diff --git a/test/core/transport/connectivity_state_test.c b/test/core/transport/connectivity_state_test.c
deleted file mode 100644
index 4ef8683..0000000
--- a/test/core/transport/connectivity_state_test.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/transport/connectivity_state.h"
-
-#include <string.h>
-
-#include <grpc/support/log.h>
-
-#include "test/core/util/test_config.h"
-
-#define THE_ARG ((void *)(size_t)0xcafebabe)
-
-int g_counter;
-
-static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg,
-                         grpc_error *error) {
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(arg == THE_ARG);
-  g_counter++;
-}
-
-static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-  GPR_ASSERT(error != GRPC_ERROR_NONE);
-  GPR_ASSERT(arg == THE_ARG);
-  g_counter++;
-}
-
-static void test_connectivity_state_name(void) {
-  gpr_log(GPR_DEBUG, "test_connectivity_state_name");
-  GPR_ASSERT(0 ==
-             strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_IDLE), "IDLE"));
-  GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_CONNECTING),
-                         "CONNECTING"));
-  GPR_ASSERT(0 ==
-             strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_READY), "READY"));
-  GPR_ASSERT(
-      0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_TRANSIENT_FAILURE),
-                  "TRANSIENT_FAILURE"));
-  GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_SHUTDOWN),
-                         "SHUTDOWN"));
-}
-
-static void test_check(void) {
-  grpc_connectivity_state_tracker tracker;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_error *error;
-  gpr_log(GPR_DEBUG, "test_check");
-  grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx");
-  GPR_ASSERT(grpc_connectivity_state_get(&tracker, &error) ==
-             GRPC_CHANNEL_IDLE);
-  GPR_ASSERT(grpc_connectivity_state_check(&tracker) == GRPC_CHANNEL_IDLE);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  grpc_connectivity_state_destroy(&exec_ctx, &tracker);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_subscribe_then_unsubscribe(void) {
-  grpc_connectivity_state_tracker tracker;
-  grpc_closure *closure =
-      GRPC_CLOSURE_CREATE(must_fail, THE_ARG, grpc_schedule_on_exec_ctx);
-  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  gpr_log(GPR_DEBUG, "test_subscribe_then_unsubscribe");
-  g_counter = 0;
-  grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx");
-  GPR_ASSERT(grpc_connectivity_state_notify_on_state_change(&exec_ctx, &tracker,
-                                                            &state, closure));
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(state == GRPC_CHANNEL_IDLE);
-  GPR_ASSERT(g_counter == 0);
-  grpc_connectivity_state_notify_on_state_change(&exec_ctx, &tracker, NULL,
-                                                 closure);
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(state == GRPC_CHANNEL_IDLE);
-  GPR_ASSERT(g_counter == 1);
-
-  grpc_connectivity_state_destroy(&exec_ctx, &tracker);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void test_subscribe_then_destroy(void) {
-  grpc_connectivity_state_tracker tracker;
-  grpc_closure *closure =
-      GRPC_CLOSURE_CREATE(must_succeed, THE_ARG, grpc_schedule_on_exec_ctx);
-  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  gpr_log(GPR_DEBUG, "test_subscribe_then_destroy");
-  g_counter = 0;
-  grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx");
-  GPR_ASSERT(grpc_connectivity_state_notify_on_state_change(&exec_ctx, &tracker,
-                                                            &state, closure));
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(state == GRPC_CHANNEL_IDLE);
-  GPR_ASSERT(g_counter == 0);
-  grpc_connectivity_state_destroy(&exec_ctx, &tracker);
-  grpc_exec_ctx_finish(&exec_ctx);
-  GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN);
-  GPR_ASSERT(g_counter == 1);
-}
-
-static void test_subscribe_with_failure_then_destroy(void) {
-  grpc_connectivity_state_tracker tracker;
-  grpc_closure *closure =
-      GRPC_CLOSURE_CREATE(must_fail, THE_ARG, grpc_schedule_on_exec_ctx);
-  grpc_connectivity_state state = GRPC_CHANNEL_SHUTDOWN;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  gpr_log(GPR_DEBUG, "test_subscribe_with_failure_then_destroy");
-  g_counter = 0;
-  grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_SHUTDOWN, "xxx");
-  GPR_ASSERT(0 == grpc_connectivity_state_notify_on_state_change(
-                      &exec_ctx, &tracker, &state, closure));
-  grpc_exec_ctx_flush(&exec_ctx);
-  GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN);
-  GPR_ASSERT(g_counter == 0);
-  grpc_connectivity_state_destroy(&exec_ctx, &tracker);
-  grpc_exec_ctx_finish(&exec_ctx);
-  GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN);
-  GPR_ASSERT(g_counter == 1);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_connectivity_state_trace.value = 1;
-  test_connectivity_state_name();
-  test_check();
-  test_subscribe_then_unsubscribe();
-  test_subscribe_then_destroy();
-  test_subscribe_with_failure_then_destroy();
-  return 0;
-}
diff --git a/test/core/transport/connectivity_state_test.cc b/test/core/transport/connectivity_state_test.cc
new file mode 100644
index 0000000..8cd7b30
--- /dev/null
+++ b/test/core/transport/connectivity_state_test.cc
@@ -0,0 +1,146 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/transport/connectivity_state.h"
+
+#include <string.h>
+
+#include <grpc/support/log.h>
+
+#include "test/core/util/test_config.h"
+
+#define THE_ARG ((void*)(size_t)0xcafebabe)
+
+int g_counter;
+
+static void must_succeed(grpc_exec_ctx* exec_ctx, void* arg,
+                         grpc_error* error) {
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(arg == THE_ARG);
+  g_counter++;
+}
+
+static void must_fail(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+  GPR_ASSERT(error != GRPC_ERROR_NONE);
+  GPR_ASSERT(arg == THE_ARG);
+  g_counter++;
+}
+
+static void test_connectivity_state_name(void) {
+  gpr_log(GPR_DEBUG, "test_connectivity_state_name");
+  GPR_ASSERT(0 ==
+             strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_IDLE), "IDLE"));
+  GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_CONNECTING),
+                         "CONNECTING"));
+  GPR_ASSERT(0 ==
+             strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_READY), "READY"));
+  GPR_ASSERT(
+      0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_TRANSIENT_FAILURE),
+                  "TRANSIENT_FAILURE"));
+  GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_SHUTDOWN),
+                         "SHUTDOWN"));
+}
+
+static void test_check(void) {
+  grpc_connectivity_state_tracker tracker;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_error* error;
+  gpr_log(GPR_DEBUG, "test_check");
+  grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx");
+  GPR_ASSERT(grpc_connectivity_state_get(&tracker, &error) ==
+             GRPC_CHANNEL_IDLE);
+  GPR_ASSERT(grpc_connectivity_state_check(&tracker) == GRPC_CHANNEL_IDLE);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  grpc_connectivity_state_destroy(&exec_ctx, &tracker);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_subscribe_then_unsubscribe(void) {
+  grpc_connectivity_state_tracker tracker;
+  grpc_closure* closure =
+      GRPC_CLOSURE_CREATE(must_fail, THE_ARG, grpc_schedule_on_exec_ctx);
+  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  gpr_log(GPR_DEBUG, "test_subscribe_then_unsubscribe");
+  g_counter = 0;
+  grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx");
+  GPR_ASSERT(grpc_connectivity_state_notify_on_state_change(&exec_ctx, &tracker,
+                                                            &state, closure));
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(state == GRPC_CHANNEL_IDLE);
+  GPR_ASSERT(g_counter == 0);
+  grpc_connectivity_state_notify_on_state_change(&exec_ctx, &tracker, NULL,
+                                                 closure);
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(state == GRPC_CHANNEL_IDLE);
+  GPR_ASSERT(g_counter == 1);
+
+  grpc_connectivity_state_destroy(&exec_ctx, &tracker);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void test_subscribe_then_destroy(void) {
+  grpc_connectivity_state_tracker tracker;
+  grpc_closure* closure =
+      GRPC_CLOSURE_CREATE(must_succeed, THE_ARG, grpc_schedule_on_exec_ctx);
+  grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  gpr_log(GPR_DEBUG, "test_subscribe_then_destroy");
+  g_counter = 0;
+  grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx");
+  GPR_ASSERT(grpc_connectivity_state_notify_on_state_change(&exec_ctx, &tracker,
+                                                            &state, closure));
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(state == GRPC_CHANNEL_IDLE);
+  GPR_ASSERT(g_counter == 0);
+  grpc_connectivity_state_destroy(&exec_ctx, &tracker);
+  grpc_exec_ctx_finish(&exec_ctx);
+  GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN);
+  GPR_ASSERT(g_counter == 1);
+}
+
+static void test_subscribe_with_failure_then_destroy(void) {
+  grpc_connectivity_state_tracker tracker;
+  grpc_closure* closure =
+      GRPC_CLOSURE_CREATE(must_fail, THE_ARG, grpc_schedule_on_exec_ctx);
+  grpc_connectivity_state state = GRPC_CHANNEL_SHUTDOWN;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  gpr_log(GPR_DEBUG, "test_subscribe_with_failure_then_destroy");
+  g_counter = 0;
+  grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_SHUTDOWN, "xxx");
+  GPR_ASSERT(0 == grpc_connectivity_state_notify_on_state_change(
+                      &exec_ctx, &tracker, &state, closure));
+  grpc_exec_ctx_flush(&exec_ctx);
+  GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN);
+  GPR_ASSERT(g_counter == 0);
+  grpc_connectivity_state_destroy(&exec_ctx, &tracker);
+  grpc_exec_ctx_finish(&exec_ctx);
+  GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN);
+  GPR_ASSERT(g_counter == 1);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_connectivity_state_trace.value = 1;
+  test_connectivity_state_name();
+  test_check();
+  test_subscribe_then_unsubscribe();
+  test_subscribe_then_destroy();
+  test_subscribe_with_failure_then_destroy();
+  return 0;
+}
diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c
deleted file mode 100644
index f7124d2..0000000
--- a/test/core/transport/metadata_test.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/transport/metadata.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/support/string.h"
-#include "src/core/lib/transport/static_metadata.h"
-#include "test/core/util/test_config.h"
-
-/* a large number */
-#define MANY 10000
-
-static void test_no_op(void) {
-  gpr_log(GPR_INFO, "test_no_op");
-  grpc_init();
-  grpc_shutdown();
-}
-
-static grpc_slice maybe_intern(grpc_slice in, bool intern) {
-  grpc_slice out = intern ? grpc_slice_intern(in) : grpc_slice_ref(in);
-  grpc_slice_unref(in);
-  return out;
-}
-
-static grpc_slice maybe_dup(grpc_slice in, bool dup) {
-  grpc_slice out = dup ? grpc_slice_dup(in) : grpc_slice_ref(in);
-  grpc_slice_unref(in);
-  return out;
-}
-
-static void test_create_metadata(bool intern_keys, bool intern_values) {
-  grpc_mdelem m1, m2, m3;
-
-  gpr_log(GPR_INFO, "test_create_metadata: intern_keys=%d intern_values=%d",
-          intern_keys, intern_values);
-
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  m1 = grpc_mdelem_from_slices(
-      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
-  m2 = grpc_mdelem_from_slices(
-      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
-  m3 = grpc_mdelem_from_slices(
-      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-      maybe_intern(grpc_slice_from_static_string("c"), intern_values));
-  GPR_ASSERT(grpc_mdelem_eq(m1, m2));
-  GPR_ASSERT(!grpc_mdelem_eq(m3, m1));
-  GPR_ASSERT(grpc_slice_eq(GRPC_MDKEY(m3), GRPC_MDKEY(m1)));
-  GPR_ASSERT(!grpc_slice_eq(GRPC_MDVALUE(m3), GRPC_MDVALUE(m1)));
-  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDKEY(m1), "a") == 0);
-  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(m1), "b") == 0);
-  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(m3), "c") == 0);
-  GRPC_MDELEM_UNREF(&exec_ctx, m1);
-  GRPC_MDELEM_UNREF(&exec_ctx, m2);
-  GRPC_MDELEM_UNREF(&exec_ctx, m3);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-}
-
-static void test_create_many_ephemeral_metadata(bool intern_keys,
-                                                bool intern_values) {
-  char buffer[GPR_LTOA_MIN_BUFSIZE];
-  long i;
-
-  gpr_log(
-      GPR_INFO,
-      "test_create_many_ephemeral_metadata: intern_keys=%d intern_values=%d",
-      intern_keys, intern_values);
-
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  /* add, and immediately delete a bunch of different elements */
-  for (i = 0; i < MANY; i++) {
-    gpr_ltoa(i, buffer);
-    GRPC_MDELEM_UNREF(
-        &exec_ctx,
-        grpc_mdelem_from_slices(
-            &exec_ctx,
-            maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-            maybe_intern(grpc_slice_from_copied_string(buffer),
-                         intern_values)));
-  }
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-}
-
-static void test_create_many_persistant_metadata(void) {
-  char buffer[GPR_LTOA_MIN_BUFSIZE];
-  long i;
-  grpc_mdelem *created = gpr_malloc(sizeof(grpc_mdelem) * MANY);
-  grpc_mdelem md;
-
-  gpr_log(GPR_INFO, "test_create_many_persistant_metadata");
-
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  /* add phase */
-  for (i = 0; i < MANY; i++) {
-    gpr_ltoa(i, buffer);
-    created[i] = grpc_mdelem_from_slices(
-        &exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("a")),
-        grpc_slice_intern(grpc_slice_from_static_string(buffer)));
-  }
-  /* verify phase */
-  for (i = 0; i < MANY; i++) {
-    gpr_ltoa(i, buffer);
-    md = grpc_mdelem_from_slices(
-        &exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("a")),
-        grpc_slice_intern(grpc_slice_from_static_string(buffer)));
-    GPR_ASSERT(grpc_mdelem_eq(md, created[i]));
-    GRPC_MDELEM_UNREF(&exec_ctx, md);
-  }
-  /* cleanup phase */
-  for (i = 0; i < MANY; i++) {
-    GRPC_MDELEM_UNREF(&exec_ctx, created[i]);
-  }
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-
-  gpr_free(created);
-}
-
-static void test_spin_creating_the_same_thing(bool intern_keys,
-                                              bool intern_values) {
-  gpr_log(GPR_INFO,
-          "test_spin_creating_the_same_thing: intern_keys=%d intern_values=%d",
-          intern_keys, intern_values);
-
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem a, b, c;
-  GRPC_MDELEM_UNREF(
-      &exec_ctx,
-      a = grpc_mdelem_from_slices(
-          &exec_ctx,
-          maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-          maybe_intern(grpc_slice_from_static_string("b"), intern_values)));
-  GRPC_MDELEM_UNREF(
-      &exec_ctx,
-      b = grpc_mdelem_from_slices(
-          &exec_ctx,
-          maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-          maybe_intern(grpc_slice_from_static_string("b"), intern_values)));
-  GRPC_MDELEM_UNREF(
-      &exec_ctx,
-      c = grpc_mdelem_from_slices(
-          &exec_ctx,
-          maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-          maybe_intern(grpc_slice_from_static_string("b"), intern_values)));
-  if (intern_keys && intern_values) {
-    GPR_ASSERT(a.payload == b.payload);
-    GPR_ASSERT(a.payload == c.payload);
-  }
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-}
-
-static void test_identity_laws(bool intern_keys, bool intern_values) {
-  gpr_log(GPR_INFO, "test_identity_laws: intern_keys=%d intern_values=%d",
-          intern_keys, intern_values);
-
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_mdelem a, b, c;
-  a = grpc_mdelem_from_slices(
-      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
-  b = grpc_mdelem_from_slices(
-      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
-  c = grpc_mdelem_from_slices(
-      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
-      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
-  GPR_ASSERT(grpc_mdelem_eq(a, a));
-  GPR_ASSERT(grpc_mdelem_eq(b, b));
-  GPR_ASSERT(grpc_mdelem_eq(c, c));
-  GPR_ASSERT(grpc_mdelem_eq(a, b));
-  GPR_ASSERT(grpc_mdelem_eq(b, c));
-  GPR_ASSERT(grpc_mdelem_eq(a, c));
-  GPR_ASSERT(grpc_mdelem_eq(b, a));
-  GPR_ASSERT(grpc_mdelem_eq(c, b));
-  GPR_ASSERT(grpc_mdelem_eq(c, a));
-  if (intern_keys && intern_values) {
-    GPR_ASSERT(a.payload == b.payload);
-    GPR_ASSERT(a.payload == c.payload);
-  } else {
-    GPR_ASSERT(a.payload != b.payload);
-    GPR_ASSERT(a.payload != c.payload);
-    GPR_ASSERT(b.payload != c.payload);
-  }
-  GRPC_MDELEM_UNREF(&exec_ctx, a);
-  GRPC_MDELEM_UNREF(&exec_ctx, b);
-  GRPC_MDELEM_UNREF(&exec_ctx, c);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-}
-
-static void test_things_stick_around(void) {
-  size_t i, j;
-  char *buffer;
-  size_t nstrs = 1000;
-  grpc_slice *strs = gpr_malloc(sizeof(grpc_slice) * nstrs);
-  size_t *shuf = gpr_malloc(sizeof(size_t) * nstrs);
-  grpc_slice test;
-
-  gpr_log(GPR_INFO, "test_things_stick_around");
-
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  for (i = 0; i < nstrs; i++) {
-    gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%" PRIuPTR "x", i);
-    strs[i] = grpc_slice_intern(grpc_slice_from_static_string(buffer));
-    shuf[i] = i;
-    gpr_free(buffer);
-  }
-
-  for (i = 0; i < nstrs; i++) {
-    grpc_slice_ref_internal(strs[i]);
-    grpc_slice_unref_internal(&exec_ctx, strs[i]);
-  }
-
-  for (i = 0; i < nstrs; i++) {
-    size_t p = (size_t)rand() % nstrs;
-    size_t q = (size_t)rand() % nstrs;
-    size_t temp = shuf[p];
-    shuf[p] = shuf[q];
-    shuf[q] = temp;
-  }
-
-  for (i = 0; i < nstrs; i++) {
-    grpc_slice_unref_internal(&exec_ctx, strs[shuf[i]]);
-    for (j = i + 1; j < nstrs; j++) {
-      gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%" PRIuPTR "x",
-                   shuf[j]);
-      test = grpc_slice_intern(grpc_slice_from_static_string(buffer));
-      GPR_ASSERT(grpc_slice_is_equivalent(test, strs[shuf[j]]));
-      grpc_slice_unref_internal(&exec_ctx, test);
-      gpr_free(buffer);
-    }
-  }
-
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-  gpr_free(strs);
-  gpr_free(shuf);
-}
-
-static void test_user_data_works(void) {
-  int *ud1;
-  int *ud2;
-  grpc_mdelem md;
-  gpr_log(GPR_INFO, "test_user_data_works");
-
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  ud1 = gpr_malloc(sizeof(int));
-  *ud1 = 1;
-  ud2 = gpr_malloc(sizeof(int));
-  *ud2 = 2;
-  md = grpc_mdelem_from_slices(
-      &exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc")),
-      grpc_slice_intern(grpc_slice_from_static_string("123")));
-  grpc_mdelem_set_user_data(md, gpr_free, ud1);
-  grpc_mdelem_set_user_data(md, gpr_free, ud2);
-  GPR_ASSERT(grpc_mdelem_get_user_data(md, gpr_free) == ud1);
-  GRPC_MDELEM_UNREF(&exec_ctx, md);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-}
-
-static void verify_ascii_header_size(grpc_exec_ctx *exec_ctx, const char *key,
-                                     const char *value, bool intern_key,
-                                     bool intern_value) {
-  grpc_mdelem elem = grpc_mdelem_from_slices(
-      exec_ctx, maybe_intern(grpc_slice_from_static_string(key), intern_key),
-      maybe_intern(grpc_slice_from_static_string(value), intern_value));
-  size_t elem_size = grpc_mdelem_get_size_in_hpack_table(elem, false);
-  size_t expected_size = 32 + strlen(key) + strlen(value);
-  GPR_ASSERT(expected_size == elem_size);
-  GRPC_MDELEM_UNREF(exec_ctx, elem);
-}
-
-static void verify_binary_header_size(grpc_exec_ctx *exec_ctx, const char *key,
-                                      const uint8_t *value, size_t value_len,
-                                      bool intern_key, bool intern_value) {
-  grpc_mdelem elem = grpc_mdelem_from_slices(
-      exec_ctx, maybe_intern(grpc_slice_from_static_string(key), intern_key),
-      maybe_intern(grpc_slice_from_static_buffer(value, value_len),
-                   intern_value));
-  GPR_ASSERT(grpc_is_binary_header(GRPC_MDKEY(elem)));
-  size_t elem_size = grpc_mdelem_get_size_in_hpack_table(elem, false);
-  grpc_slice value_slice =
-      grpc_slice_from_copied_buffer((const char *)value, value_len);
-  grpc_slice base64_encoded = grpc_chttp2_base64_encode(value_slice);
-  size_t expected_size = 32 + strlen(key) + GRPC_SLICE_LENGTH(base64_encoded);
-  GPR_ASSERT(expected_size == elem_size);
-  grpc_slice_unref_internal(exec_ctx, value_slice);
-  grpc_slice_unref_internal(exec_ctx, base64_encoded);
-  GRPC_MDELEM_UNREF(exec_ctx, elem);
-}
-
-#define BUFFER_SIZE 64
-static void test_mdelem_sizes_in_hpack(bool intern_key, bool intern_value) {
-  gpr_log(GPR_INFO, "test_mdelem_size: intern_key=%d intern_value=%d",
-          intern_key, intern_value);
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  uint8_t binary_value[BUFFER_SIZE] = {0};
-  for (uint8_t i = 0; i < BUFFER_SIZE; i++) {
-    binary_value[i] = i;
-  }
-
-  verify_ascii_header_size(&exec_ctx, "hello", "world", intern_key,
-                           intern_value);
-  verify_ascii_header_size(&exec_ctx, "hello",
-                           "worldxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", intern_key,
-                           intern_value);
-  verify_ascii_header_size(&exec_ctx, ":scheme", "http", intern_key,
-                           intern_value);
-
-  for (uint8_t i = 0; i < BUFFER_SIZE; i++) {
-    verify_binary_header_size(&exec_ctx, "hello-bin", binary_value, i,
-                              intern_key, intern_value);
-  }
-
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-}
-
-static void test_copied_static_metadata(bool dup_key, bool dup_value) {
-  gpr_log(GPR_INFO, "test_static_metadata: dup_key=%d dup_value=%d", dup_key,
-          dup_value);
-  grpc_init();
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  for (size_t i = 0; i < GRPC_STATIC_MDELEM_COUNT; i++) {
-    grpc_mdelem p = GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[i],
-                                     GRPC_MDELEM_STORAGE_STATIC);
-    grpc_mdelem q =
-        grpc_mdelem_from_slices(&exec_ctx, maybe_dup(GRPC_MDKEY(p), dup_key),
-                                maybe_dup(GRPC_MDVALUE(p), dup_value));
-    GPR_ASSERT(grpc_mdelem_eq(p, q));
-    if (dup_key || dup_value) {
-      GPR_ASSERT(p.payload != q.payload);
-    } else {
-      GPR_ASSERT(p.payload == q.payload);
-    }
-    GRPC_MDELEM_UNREF(&exec_ctx, p);
-    GRPC_MDELEM_UNREF(&exec_ctx, q);
-  }
-
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_no_op();
-  for (int k = 0; k <= 1; k++) {
-    for (int v = 0; v <= 1; v++) {
-      test_create_metadata(k, v);
-      test_create_many_ephemeral_metadata(k, v);
-      test_identity_laws(k, v);
-      test_spin_creating_the_same_thing(k, v);
-      test_mdelem_sizes_in_hpack(k, v);
-      test_copied_static_metadata(k, v);
-    }
-  }
-  test_create_many_persistant_metadata();
-  test_things_stick_around();
-  test_user_data_works();
-  return 0;
-}
diff --git a/test/core/transport/metadata_test.cc b/test/core/transport/metadata_test.cc
new file mode 100644
index 0000000..b60a961
--- /dev/null
+++ b/test/core/transport/metadata_test.cc
@@ -0,0 +1,404 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/transport/metadata.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/support/string.h"
+#include "src/core/lib/transport/static_metadata.h"
+#include "test/core/util/test_config.h"
+
+/* a large number */
+#define MANY 10000
+
+static void test_no_op(void) {
+  gpr_log(GPR_INFO, "test_no_op");
+  grpc_init();
+  grpc_shutdown();
+}
+
+static grpc_slice maybe_intern(grpc_slice in, bool intern) {
+  grpc_slice out = intern ? grpc_slice_intern(in) : grpc_slice_ref(in);
+  grpc_slice_unref(in);
+  return out;
+}
+
+static grpc_slice maybe_dup(grpc_slice in, bool dup) {
+  grpc_slice out = dup ? grpc_slice_dup(in) : grpc_slice_ref(in);
+  grpc_slice_unref(in);
+  return out;
+}
+
+static void test_create_metadata(bool intern_keys, bool intern_values) {
+  grpc_mdelem m1, m2, m3;
+
+  gpr_log(GPR_INFO, "test_create_metadata: intern_keys=%d intern_values=%d",
+          intern_keys, intern_values);
+
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  m1 = grpc_mdelem_from_slices(
+      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
+  m2 = grpc_mdelem_from_slices(
+      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
+  m3 = grpc_mdelem_from_slices(
+      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+      maybe_intern(grpc_slice_from_static_string("c"), intern_values));
+  GPR_ASSERT(grpc_mdelem_eq(m1, m2));
+  GPR_ASSERT(!grpc_mdelem_eq(m3, m1));
+  GPR_ASSERT(grpc_slice_eq(GRPC_MDKEY(m3), GRPC_MDKEY(m1)));
+  GPR_ASSERT(!grpc_slice_eq(GRPC_MDVALUE(m3), GRPC_MDVALUE(m1)));
+  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDKEY(m1), "a") == 0);
+  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(m1), "b") == 0);
+  GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(m3), "c") == 0);
+  GRPC_MDELEM_UNREF(&exec_ctx, m1);
+  GRPC_MDELEM_UNREF(&exec_ctx, m2);
+  GRPC_MDELEM_UNREF(&exec_ctx, m3);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+}
+
+static void test_create_many_ephemeral_metadata(bool intern_keys,
+                                                bool intern_values) {
+  char buffer[GPR_LTOA_MIN_BUFSIZE];
+  long i;
+
+  gpr_log(
+      GPR_INFO,
+      "test_create_many_ephemeral_metadata: intern_keys=%d intern_values=%d",
+      intern_keys, intern_values);
+
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  /* add, and immediately delete a bunch of different elements */
+  for (i = 0; i < MANY; i++) {
+    gpr_ltoa(i, buffer);
+    GRPC_MDELEM_UNREF(
+        &exec_ctx,
+        grpc_mdelem_from_slices(
+            &exec_ctx,
+            maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+            maybe_intern(grpc_slice_from_copied_string(buffer),
+                         intern_values)));
+  }
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+}
+
+static void test_create_many_persistant_metadata(void) {
+  char buffer[GPR_LTOA_MIN_BUFSIZE];
+  long i;
+  grpc_mdelem* created =
+      static_cast<grpc_mdelem*>(gpr_malloc(sizeof(grpc_mdelem) * MANY));
+  grpc_mdelem md;
+
+  gpr_log(GPR_INFO, "test_create_many_persistant_metadata");
+
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  /* add phase */
+  for (i = 0; i < MANY; i++) {
+    gpr_ltoa(i, buffer);
+    created[i] = grpc_mdelem_from_slices(
+        &exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("a")),
+        grpc_slice_intern(grpc_slice_from_static_string(buffer)));
+  }
+  /* verify phase */
+  for (i = 0; i < MANY; i++) {
+    gpr_ltoa(i, buffer);
+    md = grpc_mdelem_from_slices(
+        &exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("a")),
+        grpc_slice_intern(grpc_slice_from_static_string(buffer)));
+    GPR_ASSERT(grpc_mdelem_eq(md, created[i]));
+    GRPC_MDELEM_UNREF(&exec_ctx, md);
+  }
+  /* cleanup phase */
+  for (i = 0; i < MANY; i++) {
+    GRPC_MDELEM_UNREF(&exec_ctx, created[i]);
+  }
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+
+  gpr_free(created);
+}
+
+static void test_spin_creating_the_same_thing(bool intern_keys,
+                                              bool intern_values) {
+  gpr_log(GPR_INFO,
+          "test_spin_creating_the_same_thing: intern_keys=%d intern_values=%d",
+          intern_keys, intern_values);
+
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem a, b, c;
+  GRPC_MDELEM_UNREF(
+      &exec_ctx,
+      a = grpc_mdelem_from_slices(
+          &exec_ctx,
+          maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+          maybe_intern(grpc_slice_from_static_string("b"), intern_values)));
+  GRPC_MDELEM_UNREF(
+      &exec_ctx,
+      b = grpc_mdelem_from_slices(
+          &exec_ctx,
+          maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+          maybe_intern(grpc_slice_from_static_string("b"), intern_values)));
+  GRPC_MDELEM_UNREF(
+      &exec_ctx,
+      c = grpc_mdelem_from_slices(
+          &exec_ctx,
+          maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+          maybe_intern(grpc_slice_from_static_string("b"), intern_values)));
+  if (intern_keys && intern_values) {
+    GPR_ASSERT(a.payload == b.payload);
+    GPR_ASSERT(a.payload == c.payload);
+  }
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+}
+
+static void test_identity_laws(bool intern_keys, bool intern_values) {
+  gpr_log(GPR_INFO, "test_identity_laws: intern_keys=%d intern_values=%d",
+          intern_keys, intern_values);
+
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_mdelem a, b, c;
+  a = grpc_mdelem_from_slices(
+      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
+  b = grpc_mdelem_from_slices(
+      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
+  c = grpc_mdelem_from_slices(
+      &exec_ctx, maybe_intern(grpc_slice_from_static_string("a"), intern_keys),
+      maybe_intern(grpc_slice_from_static_string("b"), intern_values));
+  GPR_ASSERT(grpc_mdelem_eq(a, a));
+  GPR_ASSERT(grpc_mdelem_eq(b, b));
+  GPR_ASSERT(grpc_mdelem_eq(c, c));
+  GPR_ASSERT(grpc_mdelem_eq(a, b));
+  GPR_ASSERT(grpc_mdelem_eq(b, c));
+  GPR_ASSERT(grpc_mdelem_eq(a, c));
+  GPR_ASSERT(grpc_mdelem_eq(b, a));
+  GPR_ASSERT(grpc_mdelem_eq(c, b));
+  GPR_ASSERT(grpc_mdelem_eq(c, a));
+  if (intern_keys && intern_values) {
+    GPR_ASSERT(a.payload == b.payload);
+    GPR_ASSERT(a.payload == c.payload);
+  } else {
+    GPR_ASSERT(a.payload != b.payload);
+    GPR_ASSERT(a.payload != c.payload);
+    GPR_ASSERT(b.payload != c.payload);
+  }
+  GRPC_MDELEM_UNREF(&exec_ctx, a);
+  GRPC_MDELEM_UNREF(&exec_ctx, b);
+  GRPC_MDELEM_UNREF(&exec_ctx, c);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+}
+
+static void test_things_stick_around(void) {
+  size_t i, j;
+  char* buffer;
+  size_t nstrs = 1000;
+  grpc_slice* strs =
+      static_cast<grpc_slice*>(gpr_malloc(sizeof(grpc_slice) * nstrs));
+  size_t* shuf = static_cast<size_t*>(gpr_malloc(sizeof(size_t) * nstrs));
+  grpc_slice test;
+
+  gpr_log(GPR_INFO, "test_things_stick_around");
+
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  for (i = 0; i < nstrs; i++) {
+    gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%" PRIuPTR "x", i);
+    strs[i] = grpc_slice_intern(grpc_slice_from_static_string(buffer));
+    shuf[i] = i;
+    gpr_free(buffer);
+  }
+
+  for (i = 0; i < nstrs; i++) {
+    grpc_slice_ref_internal(strs[i]);
+    grpc_slice_unref_internal(&exec_ctx, strs[i]);
+  }
+
+  for (i = 0; i < nstrs; i++) {
+    size_t p = (size_t)rand() % nstrs;
+    size_t q = (size_t)rand() % nstrs;
+    size_t temp = shuf[p];
+    shuf[p] = shuf[q];
+    shuf[q] = temp;
+  }
+
+  for (i = 0; i < nstrs; i++) {
+    grpc_slice_unref_internal(&exec_ctx, strs[shuf[i]]);
+    for (j = i + 1; j < nstrs; j++) {
+      gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%" PRIuPTR "x",
+                   shuf[j]);
+      test = grpc_slice_intern(grpc_slice_from_static_string(buffer));
+      GPR_ASSERT(grpc_slice_is_equivalent(test, strs[shuf[j]]));
+      grpc_slice_unref_internal(&exec_ctx, test);
+      gpr_free(buffer);
+    }
+  }
+
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+  gpr_free(strs);
+  gpr_free(shuf);
+}
+
+static void test_user_data_works(void) {
+  int* ud1;
+  int* ud2;
+  grpc_mdelem md;
+  gpr_log(GPR_INFO, "test_user_data_works");
+
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  ud1 = static_cast<int*>(gpr_malloc(sizeof(int)));
+  *ud1 = 1;
+  ud2 = static_cast<int*>(gpr_malloc(sizeof(int)));
+  *ud2 = 2;
+  md = grpc_mdelem_from_slices(
+      &exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc")),
+      grpc_slice_intern(grpc_slice_from_static_string("123")));
+  grpc_mdelem_set_user_data(md, gpr_free, ud1);
+  grpc_mdelem_set_user_data(md, gpr_free, ud2);
+  GPR_ASSERT(grpc_mdelem_get_user_data(md, gpr_free) == ud1);
+  GRPC_MDELEM_UNREF(&exec_ctx, md);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+}
+
+static void verify_ascii_header_size(grpc_exec_ctx* exec_ctx, const char* key,
+                                     const char* value, bool intern_key,
+                                     bool intern_value) {
+  grpc_mdelem elem = grpc_mdelem_from_slices(
+      exec_ctx, maybe_intern(grpc_slice_from_static_string(key), intern_key),
+      maybe_intern(grpc_slice_from_static_string(value), intern_value));
+  size_t elem_size = grpc_mdelem_get_size_in_hpack_table(elem, false);
+  size_t expected_size = 32 + strlen(key) + strlen(value);
+  GPR_ASSERT(expected_size == elem_size);
+  GRPC_MDELEM_UNREF(exec_ctx, elem);
+}
+
+static void verify_binary_header_size(grpc_exec_ctx* exec_ctx, const char* key,
+                                      const uint8_t* value, size_t value_len,
+                                      bool intern_key, bool intern_value) {
+  grpc_mdelem elem = grpc_mdelem_from_slices(
+      exec_ctx, maybe_intern(grpc_slice_from_static_string(key), intern_key),
+      maybe_intern(grpc_slice_from_static_buffer(value, value_len),
+                   intern_value));
+  GPR_ASSERT(grpc_is_binary_header(GRPC_MDKEY(elem)));
+  size_t elem_size = grpc_mdelem_get_size_in_hpack_table(elem, false);
+  grpc_slice value_slice =
+      grpc_slice_from_copied_buffer((const char*)value, value_len);
+  grpc_slice base64_encoded = grpc_chttp2_base64_encode(value_slice);
+  size_t expected_size = 32 + strlen(key) + GRPC_SLICE_LENGTH(base64_encoded);
+  GPR_ASSERT(expected_size == elem_size);
+  grpc_slice_unref_internal(exec_ctx, value_slice);
+  grpc_slice_unref_internal(exec_ctx, base64_encoded);
+  GRPC_MDELEM_UNREF(exec_ctx, elem);
+}
+
+#define BUFFER_SIZE 64
+static void test_mdelem_sizes_in_hpack(bool intern_key, bool intern_value) {
+  gpr_log(GPR_INFO, "test_mdelem_size: intern_key=%d intern_value=%d",
+          intern_key, intern_value);
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  uint8_t binary_value[BUFFER_SIZE] = {0};
+  for (uint8_t i = 0; i < BUFFER_SIZE; i++) {
+    binary_value[i] = i;
+  }
+
+  verify_ascii_header_size(&exec_ctx, "hello", "world", intern_key,
+                           intern_value);
+  verify_ascii_header_size(&exec_ctx, "hello",
+                           "worldxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", intern_key,
+                           intern_value);
+  verify_ascii_header_size(&exec_ctx, ":scheme", "http", intern_key,
+                           intern_value);
+
+  for (uint8_t i = 0; i < BUFFER_SIZE; i++) {
+    verify_binary_header_size(&exec_ctx, "hello-bin", binary_value, i,
+                              intern_key, intern_value);
+  }
+
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+}
+
+static void test_copied_static_metadata(bool dup_key, bool dup_value) {
+  gpr_log(GPR_INFO, "test_static_metadata: dup_key=%d dup_value=%d", dup_key,
+          dup_value);
+  grpc_init();
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  for (size_t i = 0; i < GRPC_STATIC_MDELEM_COUNT; i++) {
+    grpc_mdelem p = GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[i],
+                                     GRPC_MDELEM_STORAGE_STATIC);
+    grpc_mdelem q =
+        grpc_mdelem_from_slices(&exec_ctx, maybe_dup(GRPC_MDKEY(p), dup_key),
+                                maybe_dup(GRPC_MDVALUE(p), dup_value));
+    GPR_ASSERT(grpc_mdelem_eq(p, q));
+    if (dup_key || dup_value) {
+      GPR_ASSERT(p.payload != q.payload);
+    } else {
+      GPR_ASSERT(p.payload == q.payload);
+    }
+    GRPC_MDELEM_UNREF(&exec_ctx, p);
+    GRPC_MDELEM_UNREF(&exec_ctx, q);
+  }
+
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_no_op();
+  for (int k = 0; k <= 1; k++) {
+    for (int v = 0; v <= 1; v++) {
+      test_create_metadata(k, v);
+      test_create_many_ephemeral_metadata(k, v);
+      test_identity_laws(k, v);
+      test_spin_creating_the_same_thing(k, v);
+      test_mdelem_sizes_in_hpack(k, v);
+      test_copied_static_metadata(k, v);
+    }
+  }
+  test_create_many_persistant_metadata();
+  test_things_stick_around();
+  test_user_data_works();
+  return 0;
+}
diff --git a/test/core/transport/status_conversion_test.c b/test/core/transport/status_conversion_test.c
deleted file mode 100644
index de8fa44..0000000
--- a/test/core/transport/status_conversion_test.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/transport/status_conversion.h"
-#include <grpc/support/log.h>
-#include "test/core/util/test_config.h"
-
-#define GRPC_STATUS_TO_HTTP2_ERROR(a, b) \
-  GPR_ASSERT(grpc_status_to_http2_error(a) == (b))
-#define HTTP2_ERROR_TO_GRPC_STATUS(a, deadline, b)                           \
-  do {                                                                       \
-    grpc_exec_ctx my_exec_ctx = GRPC_EXEC_CTX_INIT;                          \
-    GPR_ASSERT(grpc_http2_error_to_grpc_status(&my_exec_ctx, a, deadline) == \
-               (b));                                                         \
-    grpc_exec_ctx_finish(&my_exec_ctx);                                      \
-  } while (0)
-#define GRPC_STATUS_TO_HTTP2_STATUS(a, b) \
-  GPR_ASSERT(grpc_status_to_http2_status(a) == (b))
-#define HTTP2_STATUS_TO_GRPC_STATUS(a, b) \
-  GPR_ASSERT(grpc_http2_status_to_grpc_status(a) == (b))
-
-int main(int argc, char **argv) {
-  int i;
-
-  grpc_test_init(argc, argv);
-
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_OK, GRPC_HTTP2_NO_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_CANCELLED, GRPC_HTTP2_CANCEL);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNKNOWN, GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_INVALID_ARGUMENT,
-                             GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_DEADLINE_EXCEEDED, GRPC_HTTP2_CANCEL);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_NOT_FOUND, GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_ALREADY_EXISTS,
-                             GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_PERMISSION_DENIED,
-                             GRPC_HTTP2_INADEQUATE_SECURITY);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNAUTHENTICATED,
-                             GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_RESOURCE_EXHAUSTED,
-                             GRPC_HTTP2_ENHANCE_YOUR_CALM);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_FAILED_PRECONDITION,
-                             GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_ABORTED, GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_OUT_OF_RANGE,
-                             GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNIMPLEMENTED,
-                             GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_INTERNAL, GRPC_HTTP2_INTERNAL_ERROR);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNAVAILABLE,
-                             GRPC_HTTP2_REFUSED_STREAM);
-  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_DATA_LOSS, GRPC_HTTP2_INTERNAL_ERROR);
-
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_OK, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_CANCELLED, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNKNOWN, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_INVALID_ARGUMENT, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_DEADLINE_EXCEEDED, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_NOT_FOUND, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_ALREADY_EXISTS, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_PERMISSION_DENIED, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNAUTHENTICATED, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_RESOURCE_EXHAUSTED, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_FAILED_PRECONDITION, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_ABORTED, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_OUT_OF_RANGE, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNIMPLEMENTED, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_INTERNAL, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNAVAILABLE, 200);
-  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_DATA_LOSS, 200);
-
-  const grpc_millis before_deadline = GRPC_MILLIS_INF_FUTURE;
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_NO_ERROR, before_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_PROTOCOL_ERROR, before_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INTERNAL_ERROR, before_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_FLOW_CONTROL_ERROR, before_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_SETTINGS_TIMEOUT, before_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_STREAM_CLOSED, before_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_FRAME_SIZE_ERROR, before_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_REFUSED_STREAM, before_deadline,
-                             GRPC_STATUS_UNAVAILABLE);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_CANCEL, before_deadline,
-                             GRPC_STATUS_CANCELLED);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_COMPRESSION_ERROR, before_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_CONNECT_ERROR, before_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_ENHANCE_YOUR_CALM, before_deadline,
-                             GRPC_STATUS_RESOURCE_EXHAUSTED);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INADEQUATE_SECURITY, before_deadline,
-                             GRPC_STATUS_PERMISSION_DENIED);
-
-  const grpc_millis after_deadline = 0;
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_NO_ERROR, after_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_PROTOCOL_ERROR, after_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INTERNAL_ERROR, after_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_FLOW_CONTROL_ERROR, after_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_SETTINGS_TIMEOUT, after_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_STREAM_CLOSED, after_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_FRAME_SIZE_ERROR, after_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_REFUSED_STREAM, after_deadline,
-                             GRPC_STATUS_UNAVAILABLE);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_CANCEL, after_deadline,
-                             GRPC_STATUS_DEADLINE_EXCEEDED);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_COMPRESSION_ERROR, after_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_CONNECT_ERROR, after_deadline,
-                             GRPC_STATUS_INTERNAL);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_ENHANCE_YOUR_CALM, after_deadline,
-                             GRPC_STATUS_RESOURCE_EXHAUSTED);
-  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INADEQUATE_SECURITY, after_deadline,
-                             GRPC_STATUS_PERMISSION_DENIED);
-
-  HTTP2_STATUS_TO_GRPC_STATUS(200, GRPC_STATUS_OK);
-  HTTP2_STATUS_TO_GRPC_STATUS(400, GRPC_STATUS_INVALID_ARGUMENT);
-  HTTP2_STATUS_TO_GRPC_STATUS(401, GRPC_STATUS_UNAUTHENTICATED);
-  HTTP2_STATUS_TO_GRPC_STATUS(403, GRPC_STATUS_PERMISSION_DENIED);
-  HTTP2_STATUS_TO_GRPC_STATUS(404, GRPC_STATUS_NOT_FOUND);
-  HTTP2_STATUS_TO_GRPC_STATUS(409, GRPC_STATUS_ABORTED);
-  HTTP2_STATUS_TO_GRPC_STATUS(412, GRPC_STATUS_FAILED_PRECONDITION);
-  HTTP2_STATUS_TO_GRPC_STATUS(429, GRPC_STATUS_RESOURCE_EXHAUSTED);
-  HTTP2_STATUS_TO_GRPC_STATUS(499, GRPC_STATUS_CANCELLED);
-  HTTP2_STATUS_TO_GRPC_STATUS(500, GRPC_STATUS_UNKNOWN);
-  HTTP2_STATUS_TO_GRPC_STATUS(503, GRPC_STATUS_UNAVAILABLE);
-  HTTP2_STATUS_TO_GRPC_STATUS(504, GRPC_STATUS_DEADLINE_EXCEEDED);
-
-  /* check all status values can be converted */
-  for (i = 0; i <= 999; i++) {
-    grpc_http2_status_to_grpc_status(i);
-  }
-
-  return 0;
-}
diff --git a/test/core/transport/status_conversion_test.cc b/test/core/transport/status_conversion_test.cc
new file mode 100644
index 0000000..7af5d12
--- /dev/null
+++ b/test/core/transport/status_conversion_test.cc
@@ -0,0 +1,170 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/transport/status_conversion.h"
+#include <grpc/support/log.h>
+#include "test/core/util/test_config.h"
+
+#define GRPC_STATUS_TO_HTTP2_ERROR(a, b) \
+  GPR_ASSERT(grpc_status_to_http2_error(a) == (b))
+#define HTTP2_ERROR_TO_GRPC_STATUS(a, deadline, b)                           \
+  do {                                                                       \
+    grpc_exec_ctx my_exec_ctx = GRPC_EXEC_CTX_INIT;                          \
+    GPR_ASSERT(grpc_http2_error_to_grpc_status(&my_exec_ctx, a, deadline) == \
+               (b));                                                         \
+    grpc_exec_ctx_finish(&my_exec_ctx);                                      \
+  } while (0)
+#define GRPC_STATUS_TO_HTTP2_STATUS(a, b) \
+  GPR_ASSERT(grpc_status_to_http2_status(a) == (b))
+#define HTTP2_STATUS_TO_GRPC_STATUS(a, b) \
+  GPR_ASSERT(grpc_http2_status_to_grpc_status(a) == (b))
+
+int main(int argc, char** argv) {
+  int i;
+
+  grpc_test_init(argc, argv);
+  grpc_init();
+
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_OK, GRPC_HTTP2_NO_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_CANCELLED, GRPC_HTTP2_CANCEL);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNKNOWN, GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_INVALID_ARGUMENT,
+                             GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_DEADLINE_EXCEEDED, GRPC_HTTP2_CANCEL);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_NOT_FOUND, GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_ALREADY_EXISTS,
+                             GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_PERMISSION_DENIED,
+                             GRPC_HTTP2_INADEQUATE_SECURITY);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNAUTHENTICATED,
+                             GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_RESOURCE_EXHAUSTED,
+                             GRPC_HTTP2_ENHANCE_YOUR_CALM);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_FAILED_PRECONDITION,
+                             GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_ABORTED, GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_OUT_OF_RANGE,
+                             GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNIMPLEMENTED,
+                             GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_INTERNAL, GRPC_HTTP2_INTERNAL_ERROR);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_UNAVAILABLE,
+                             GRPC_HTTP2_REFUSED_STREAM);
+  GRPC_STATUS_TO_HTTP2_ERROR(GRPC_STATUS_DATA_LOSS, GRPC_HTTP2_INTERNAL_ERROR);
+
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_OK, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_CANCELLED, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNKNOWN, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_INVALID_ARGUMENT, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_DEADLINE_EXCEEDED, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_NOT_FOUND, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_ALREADY_EXISTS, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_PERMISSION_DENIED, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNAUTHENTICATED, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_RESOURCE_EXHAUSTED, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_FAILED_PRECONDITION, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_ABORTED, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_OUT_OF_RANGE, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNIMPLEMENTED, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_INTERNAL, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_UNAVAILABLE, 200);
+  GRPC_STATUS_TO_HTTP2_STATUS(GRPC_STATUS_DATA_LOSS, 200);
+
+  const grpc_millis before_deadline = GRPC_MILLIS_INF_FUTURE;
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_NO_ERROR, before_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_PROTOCOL_ERROR, before_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INTERNAL_ERROR, before_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_FLOW_CONTROL_ERROR, before_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_SETTINGS_TIMEOUT, before_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_STREAM_CLOSED, before_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_FRAME_SIZE_ERROR, before_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_REFUSED_STREAM, before_deadline,
+                             GRPC_STATUS_UNAVAILABLE);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_CANCEL, before_deadline,
+                             GRPC_STATUS_CANCELLED);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_COMPRESSION_ERROR, before_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_CONNECT_ERROR, before_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_ENHANCE_YOUR_CALM, before_deadline,
+                             GRPC_STATUS_RESOURCE_EXHAUSTED);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INADEQUATE_SECURITY, before_deadline,
+                             GRPC_STATUS_PERMISSION_DENIED);
+
+  const grpc_millis after_deadline = 0;
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_NO_ERROR, after_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_PROTOCOL_ERROR, after_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INTERNAL_ERROR, after_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_FLOW_CONTROL_ERROR, after_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_SETTINGS_TIMEOUT, after_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_STREAM_CLOSED, after_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_FRAME_SIZE_ERROR, after_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_REFUSED_STREAM, after_deadline,
+                             GRPC_STATUS_UNAVAILABLE);
+  // We only have millisecond granularity in our timing code. This sleeps for 5
+  // millis to ensure that the status conversion code will pick up the fact
+  // that the deadline has expired.
+  gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+                               gpr_time_from_millis(5, GPR_TIMESPAN)));
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_CANCEL, after_deadline,
+                             GRPC_STATUS_DEADLINE_EXCEEDED);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_COMPRESSION_ERROR, after_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_CONNECT_ERROR, after_deadline,
+                             GRPC_STATUS_INTERNAL);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_ENHANCE_YOUR_CALM, after_deadline,
+                             GRPC_STATUS_RESOURCE_EXHAUSTED);
+  HTTP2_ERROR_TO_GRPC_STATUS(GRPC_HTTP2_INADEQUATE_SECURITY, after_deadline,
+                             GRPC_STATUS_PERMISSION_DENIED);
+
+  HTTP2_STATUS_TO_GRPC_STATUS(200, GRPC_STATUS_OK);
+  HTTP2_STATUS_TO_GRPC_STATUS(400, GRPC_STATUS_INVALID_ARGUMENT);
+  HTTP2_STATUS_TO_GRPC_STATUS(401, GRPC_STATUS_UNAUTHENTICATED);
+  HTTP2_STATUS_TO_GRPC_STATUS(403, GRPC_STATUS_PERMISSION_DENIED);
+  HTTP2_STATUS_TO_GRPC_STATUS(404, GRPC_STATUS_NOT_FOUND);
+  HTTP2_STATUS_TO_GRPC_STATUS(409, GRPC_STATUS_ABORTED);
+  HTTP2_STATUS_TO_GRPC_STATUS(412, GRPC_STATUS_FAILED_PRECONDITION);
+  HTTP2_STATUS_TO_GRPC_STATUS(429, GRPC_STATUS_RESOURCE_EXHAUSTED);
+  HTTP2_STATUS_TO_GRPC_STATUS(499, GRPC_STATUS_CANCELLED);
+  HTTP2_STATUS_TO_GRPC_STATUS(500, GRPC_STATUS_UNKNOWN);
+  HTTP2_STATUS_TO_GRPC_STATUS(503, GRPC_STATUS_UNAVAILABLE);
+  HTTP2_STATUS_TO_GRPC_STATUS(504, GRPC_STATUS_DEADLINE_EXCEEDED);
+
+  /* check all status values can be converted */
+  for (i = 0; i <= 999; i++) {
+    grpc_http2_status_to_grpc_status(i);
+  }
+
+  grpc_shutdown();
+
+  return 0;
+}
diff --git a/test/core/transport/stream_owned_slice_test.c b/test/core/transport/stream_owned_slice_test.c
deleted file mode 100644
index 774ad4e..0000000
--- a/test/core/transport/stream_owned_slice_test.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/transport/transport.h"
-
-#include "test/core/util/test_config.h"
-
-#include <grpc/support/log.h>
-
-static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-
-  uint8_t buffer[] = "abc123";
-  grpc_stream_refcount r;
-  GRPC_STREAM_REF_INIT(&r, 1, do_nothing, NULL, "test");
-  GPR_ASSERT(r.refs.count == 1);
-  grpc_slice slice =
-      grpc_slice_from_stream_owned_buffer(&r, buffer, sizeof(buffer));
-  GPR_ASSERT(GRPC_SLICE_START_PTR(slice) == buffer);
-  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == sizeof(buffer));
-  GPR_ASSERT(r.refs.count == 2);
-  grpc_slice_unref(slice);
-  GPR_ASSERT(r.refs.count == 1);
-
-  return 0;
-}
diff --git a/test/core/transport/stream_owned_slice_test.cc b/test/core/transport/stream_owned_slice_test.cc
new file mode 100644
index 0000000..0b592a0
--- /dev/null
+++ b/test/core/transport/stream_owned_slice_test.cc
@@ -0,0 +1,43 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/transport/transport.h"
+
+#include "test/core/util/test_config.h"
+
+#include <grpc/support/log.h>
+
+static void do_nothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+
+  uint8_t buffer[] = "abc123";
+  grpc_stream_refcount r;
+  GRPC_STREAM_REF_INIT(&r, 1, do_nothing, NULL, "test");
+  GPR_ASSERT(r.refs.count == 1);
+  grpc_slice slice =
+      grpc_slice_from_stream_owned_buffer(&r, buffer, sizeof(buffer));
+  GPR_ASSERT(GRPC_SLICE_START_PTR(slice) == buffer);
+  GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == sizeof(buffer));
+  GPR_ASSERT(r.refs.count == 2);
+  grpc_slice_unref(slice);
+  GPR_ASSERT(r.refs.count == 1);
+
+  return 0;
+}
diff --git a/test/core/transport/timeout_encoding_test.c b/test/core/transport/timeout_encoding_test.c
deleted file mode 100644
index 30357fa..0000000
--- a/test/core/transport/timeout_encoding_test.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/transport/timeout_encoding.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/support/murmur_hash.h"
-#include "src/core/lib/support/string.h"
-#include "test/core/util/test_config.h"
-
-#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
-
-static void assert_encodes_as(grpc_millis ts, const char *s) {
-  char buffer[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE];
-  grpc_http2_encode_timeout(ts, buffer);
-  gpr_log(GPR_INFO, "check '%s' == '%s'", buffer, s);
-  GPR_ASSERT(0 == strcmp(buffer, s));
-}
-
-void test_encoding(void) {
-  LOG_TEST("test_encoding");
-  assert_encodes_as(-1, "1n");
-  assert_encodes_as(-10, "1n");
-  assert_encodes_as(1, "1m");
-  assert_encodes_as(10, "10m");
-  assert_encodes_as(100, "100m");
-  assert_encodes_as(890, "890m");
-  assert_encodes_as(900, "900m");
-  assert_encodes_as(901, "901m");
-  assert_encodes_as(1000, "1S");
-  assert_encodes_as(2000, "2S");
-  assert_encodes_as(2500, "2500m");
-  assert_encodes_as(59900, "59900m");
-  assert_encodes_as(50000, "50S");
-  assert_encodes_as(59000, "59S");
-  assert_encodes_as(60000, "1M");
-  assert_encodes_as(80000, "80S");
-  assert_encodes_as(90000, "90S");
-  assert_encodes_as(120000, "2M");
-  assert_encodes_as(20 * 60 * GPR_MS_PER_SEC, "20M");
-  assert_encodes_as(60 * 60 * GPR_MS_PER_SEC, "1H");
-  assert_encodes_as(10 * 60 * 60 * GPR_MS_PER_SEC, "10H");
-}
-
-static void assert_decodes_as(const char *buffer, grpc_millis expected) {
-  grpc_millis got;
-  uint32_t hash = gpr_murmur_hash3(buffer, strlen(buffer), 0);
-  gpr_log(GPR_INFO, "check decoding '%s' (hash=0x%x)", buffer, hash);
-  GPR_ASSERT(1 == grpc_http2_decode_timeout(
-                      grpc_slice_from_static_string(buffer), &got));
-  if (got != expected) {
-    gpr_log(GPR_ERROR, "got:'%" PRIdPTR "' != expected:'%" PRIdPTR "'", got,
-            expected);
-    abort();
-  }
-}
-
-void decode_suite(char ext, grpc_millis (*answer)(int64_t x)) {
-  long test_vals[] = {1,       12,       123,       1234,     12345,   123456,
-                      1234567, 12345678, 123456789, 98765432, 9876543, 987654,
-                      98765,   9876,     987,       98,       9};
-  unsigned i;
-  char *input;
-  for (i = 0; i < GPR_ARRAY_SIZE(test_vals); i++) {
-    gpr_asprintf(&input, "%ld%c", test_vals[i], ext);
-    assert_decodes_as(input, answer(test_vals[i]));
-    gpr_free(input);
-
-    gpr_asprintf(&input, "   %ld%c", test_vals[i], ext);
-    assert_decodes_as(input, answer(test_vals[i]));
-    gpr_free(input);
-
-    gpr_asprintf(&input, "%ld %c", test_vals[i], ext);
-    assert_decodes_as(input, answer(test_vals[i]));
-    gpr_free(input);
-
-    gpr_asprintf(&input, "%ld %c  ", test_vals[i], ext);
-    assert_decodes_as(input, answer(test_vals[i]));
-    gpr_free(input);
-  }
-}
-
-static grpc_millis millis_from_nanos(int64_t x) {
-  return (grpc_millis)(x / GPR_NS_PER_MS + (x % GPR_NS_PER_MS != 0));
-}
-static grpc_millis millis_from_micros(int64_t x) {
-  return (grpc_millis)(x / GPR_US_PER_MS + (x % GPR_US_PER_MS != 0));
-}
-static grpc_millis millis_from_millis(int64_t x) { return (grpc_millis)x; }
-static grpc_millis millis_from_seconds(int64_t x) {
-  return (grpc_millis)(x * GPR_MS_PER_SEC);
-}
-static grpc_millis millis_from_minutes(int64_t x) {
-  return (grpc_millis)(x * 60 * GPR_MS_PER_SEC);
-}
-static grpc_millis millis_from_hours(int64_t x) {
-  return (grpc_millis)(x * 3600 * GPR_MS_PER_SEC);
-}
-
-void test_decoding(void) {
-  LOG_TEST("test_decoding");
-  decode_suite('n', millis_from_nanos);
-  decode_suite('u', millis_from_micros);
-  decode_suite('m', millis_from_millis);
-  decode_suite('S', millis_from_seconds);
-  decode_suite('M', millis_from_minutes);
-  decode_suite('H', millis_from_hours);
-  assert_decodes_as("1000000000S", millis_from_seconds(1000 * 1000 * 1000));
-  assert_decodes_as("1000000000000000000000u", GRPC_MILLIS_INF_FUTURE);
-  assert_decodes_as("1000000001S", GRPC_MILLIS_INF_FUTURE);
-  assert_decodes_as("2000000001S", GRPC_MILLIS_INF_FUTURE);
-  assert_decodes_as("9999999999S", GRPC_MILLIS_INF_FUTURE);
-}
-
-static void assert_decoding_fails(const char *s) {
-  grpc_millis x;
-  GPR_ASSERT(0 ==
-             grpc_http2_decode_timeout(grpc_slice_from_static_string(s), &x));
-}
-
-void test_decoding_fails(void) {
-  LOG_TEST("test_decoding_fails");
-  assert_decoding_fails("");
-  assert_decoding_fails(" ");
-  assert_decoding_fails("x");
-  assert_decoding_fails("1");
-  assert_decoding_fails("1x");
-  assert_decoding_fails("1ux");
-  assert_decoding_fails("!");
-  assert_decoding_fails("n1");
-  assert_decoding_fails("-1u");
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_encoding();
-  test_decoding();
-  test_decoding_fails();
-  return 0;
-}
diff --git a/test/core/transport/timeout_encoding_test.cc b/test/core/transport/timeout_encoding_test.cc
new file mode 100644
index 0000000..0930bc8
--- /dev/null
+++ b/test/core/transport/timeout_encoding_test.cc
@@ -0,0 +1,161 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/transport/timeout_encoding.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/support/murmur_hash.h"
+#include "src/core/lib/support/string.h"
+#include "test/core/util/test_config.h"
+
+#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
+
+static void assert_encodes_as(grpc_millis ts, const char* s) {
+  char buffer[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE];
+  grpc_http2_encode_timeout(ts, buffer);
+  gpr_log(GPR_INFO, "check '%s' == '%s'", buffer, s);
+  GPR_ASSERT(0 == strcmp(buffer, s));
+}
+
+void test_encoding(void) {
+  LOG_TEST("test_encoding");
+  assert_encodes_as(-1, "1n");
+  assert_encodes_as(-10, "1n");
+  assert_encodes_as(1, "1m");
+  assert_encodes_as(10, "10m");
+  assert_encodes_as(100, "100m");
+  assert_encodes_as(890, "890m");
+  assert_encodes_as(900, "900m");
+  assert_encodes_as(901, "901m");
+  assert_encodes_as(1000, "1S");
+  assert_encodes_as(2000, "2S");
+  assert_encodes_as(2500, "2500m");
+  assert_encodes_as(59900, "59900m");
+  assert_encodes_as(50000, "50S");
+  assert_encodes_as(59000, "59S");
+  assert_encodes_as(60000, "1M");
+  assert_encodes_as(80000, "80S");
+  assert_encodes_as(90000, "90S");
+  assert_encodes_as(120000, "2M");
+  assert_encodes_as(20 * 60 * GPR_MS_PER_SEC, "20M");
+  assert_encodes_as(60 * 60 * GPR_MS_PER_SEC, "1H");
+  assert_encodes_as(10 * 60 * 60 * GPR_MS_PER_SEC, "10H");
+}
+
+static void assert_decodes_as(const char* buffer, grpc_millis expected) {
+  grpc_millis got;
+  uint32_t hash = gpr_murmur_hash3(buffer, strlen(buffer), 0);
+  gpr_log(GPR_INFO, "check decoding '%s' (hash=0x%x)", buffer, hash);
+  GPR_ASSERT(1 == grpc_http2_decode_timeout(
+                      grpc_slice_from_static_string(buffer), &got));
+  if (got != expected) {
+    gpr_log(GPR_ERROR, "got:'%" PRIdPTR "' != expected:'%" PRIdPTR "'", got,
+            expected);
+    abort();
+  }
+}
+
+void decode_suite(char ext, grpc_millis (*answer)(int64_t x)) {
+  long test_vals[] = {1,       12,       123,       1234,     12345,   123456,
+                      1234567, 12345678, 123456789, 98765432, 9876543, 987654,
+                      98765,   9876,     987,       98,       9};
+  unsigned i;
+  char* input;
+  for (i = 0; i < GPR_ARRAY_SIZE(test_vals); i++) {
+    gpr_asprintf(&input, "%ld%c", test_vals[i], ext);
+    assert_decodes_as(input, answer(test_vals[i]));
+    gpr_free(input);
+
+    gpr_asprintf(&input, "   %ld%c", test_vals[i], ext);
+    assert_decodes_as(input, answer(test_vals[i]));
+    gpr_free(input);
+
+    gpr_asprintf(&input, "%ld %c", test_vals[i], ext);
+    assert_decodes_as(input, answer(test_vals[i]));
+    gpr_free(input);
+
+    gpr_asprintf(&input, "%ld %c  ", test_vals[i], ext);
+    assert_decodes_as(input, answer(test_vals[i]));
+    gpr_free(input);
+  }
+}
+
+static grpc_millis millis_from_nanos(int64_t x) {
+  return (grpc_millis)(x / GPR_NS_PER_MS + (x % GPR_NS_PER_MS != 0));
+}
+static grpc_millis millis_from_micros(int64_t x) {
+  return (grpc_millis)(x / GPR_US_PER_MS + (x % GPR_US_PER_MS != 0));
+}
+static grpc_millis millis_from_millis(int64_t x) { return (grpc_millis)x; }
+static grpc_millis millis_from_seconds(int64_t x) {
+  return (grpc_millis)(x * GPR_MS_PER_SEC);
+}
+static grpc_millis millis_from_minutes(int64_t x) {
+  return (grpc_millis)(x * 60 * GPR_MS_PER_SEC);
+}
+static grpc_millis millis_from_hours(int64_t x) {
+  return (grpc_millis)(x * 3600 * GPR_MS_PER_SEC);
+}
+
+void test_decoding(void) {
+  LOG_TEST("test_decoding");
+  decode_suite('n', millis_from_nanos);
+  decode_suite('u', millis_from_micros);
+  decode_suite('m', millis_from_millis);
+  decode_suite('S', millis_from_seconds);
+  decode_suite('M', millis_from_minutes);
+  decode_suite('H', millis_from_hours);
+  assert_decodes_as("1000000000S", millis_from_seconds(1000 * 1000 * 1000));
+  assert_decodes_as("1000000000000000000000u", GRPC_MILLIS_INF_FUTURE);
+  assert_decodes_as("1000000001S", GRPC_MILLIS_INF_FUTURE);
+  assert_decodes_as("2000000001S", GRPC_MILLIS_INF_FUTURE);
+  assert_decodes_as("9999999999S", GRPC_MILLIS_INF_FUTURE);
+}
+
+static void assert_decoding_fails(const char* s) {
+  grpc_millis x;
+  GPR_ASSERT(0 ==
+             grpc_http2_decode_timeout(grpc_slice_from_static_string(s), &x));
+}
+
+void test_decoding_fails(void) {
+  LOG_TEST("test_decoding_fails");
+  assert_decoding_fails("");
+  assert_decoding_fails(" ");
+  assert_decoding_fails("x");
+  assert_decoding_fails("1");
+  assert_decoding_fails("1x");
+  assert_decoding_fails("1ux");
+  assert_decoding_fails("!");
+  assert_decoding_fails("n1");
+  assert_decoding_fails("-1u");
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_encoding();
+  test_decoding();
+  test_decoding_fails();
+  return 0;
+}
diff --git a/test/core/tsi/BUILD b/test/core/tsi/BUILD
index 0c5509d..e28c0b5 100644
--- a/test/core/tsi/BUILD
+++ b/test/core/tsi/BUILD
@@ -20,7 +20,7 @@
 
 grpc_cc_library(
     name = "transport_security_test_lib",
-    srcs = ["transport_security_test_lib.c"],
+    srcs = ["transport_security_test_lib.cc"],
     hdrs = ["transport_security_test_lib.h"],
     deps = [
         "//:grpc",
@@ -30,8 +30,8 @@
 
 grpc_cc_test(
     name = "fake_transport_security_test",
-    srcs = ["fake_transport_security_test.c"],
-    language = "C",
+    srcs = ["fake_transport_security_test.cc"],
+    language = "C++",
     deps = [
         ":transport_security_test_lib",
         "//:grpc",
@@ -44,7 +44,7 @@
 
 grpc_cc_test(
     name = "ssl_transport_security_test",
-    srcs = ["ssl_transport_security_test.c"],
+    srcs = ["ssl_transport_security_test.cc"],
     data = [
         "//src/core/tsi/test_creds:badclient.key",
         "//src/core/tsi/test_creds:badclient.pem",
@@ -58,7 +58,7 @@
         "//src/core/tsi/test_creds:server1.key",
         "//src/core/tsi/test_creds:server1.pem",
     ],
-    language = "C",
+    language = "C++",
     deps = [
         ":transport_security_test_lib",
         "//:grpc",
@@ -70,8 +70,8 @@
 
 grpc_cc_test(
     name = "transport_security_test",
-    srcs = ["transport_security_test.c"],
-    language = "C",
+    srcs = ["transport_security_test.cc"],
+    language = "C++",
     deps = [
         "//:grpc",
         "//:gpr",
diff --git a/test/core/tsi/fake_transport_security_test.c b/test/core/tsi/fake_transport_security_test.c
deleted file mode 100644
index 11be880..0000000
--- a/test/core/tsi/fake_transport_security_test.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "src/core/lib/security/transport/security_connector.h"
-#include "src/core/tsi/fake_transport_security.h"
-#include "test/core/tsi/transport_security_test_lib.h"
-#include "test/core/util/test_config.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-typedef struct fake_tsi_test_fixture {
-  tsi_test_fixture base;
-} fake_tsi_test_fixture;
-
-static void fake_test_setup_handshakers(tsi_test_fixture *fixture) {
-  fixture->client_handshaker =
-      tsi_create_fake_handshaker(true /* is_client. */);
-  fixture->server_handshaker =
-      tsi_create_fake_handshaker(false /* is_client. */);
-}
-
-static void validate_handshaker_peers(tsi_handshaker_result *result) {
-  GPR_ASSERT(result != NULL);
-  tsi_peer peer;
-  GPR_ASSERT(tsi_handshaker_result_extract_peer(result, &peer) == TSI_OK);
-  const tsi_peer_property *property =
-      tsi_peer_get_property_by_name(&peer, TSI_CERTIFICATE_TYPE_PEER_PROPERTY);
-  GPR_ASSERT(property != NULL);
-  GPR_ASSERT(memcmp(property->value.data, TSI_FAKE_CERTIFICATE_TYPE,
-                    property->value.length) == 0);
-  tsi_peer_destruct(&peer);
-}
-
-static void fake_test_check_handshaker_peers(tsi_test_fixture *fixture) {
-  validate_handshaker_peers(fixture->client_result);
-  validate_handshaker_peers(fixture->server_result);
-}
-
-static void fake_test_destruct(tsi_test_fixture *fixture) {}
-
-static const struct tsi_test_fixture_vtable vtable = {
-    fake_test_setup_handshakers, fake_test_check_handshaker_peers,
-    fake_test_destruct};
-
-static tsi_test_fixture *fake_tsi_test_fixture_create() {
-  fake_tsi_test_fixture *fake_fixture = gpr_zalloc(sizeof(*fake_fixture));
-  tsi_test_fixture_init(&fake_fixture->base);
-  fake_fixture->base.vtable = &vtable;
-  return &fake_fixture->base;
-}
-
-void fake_tsi_test_do_handshake_tiny_handshake_buffer() {
-  tsi_test_fixture *fixture = fake_tsi_test_fixture_create();
-  fixture->handshake_buffer_size = TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void fake_tsi_test_do_handshake_small_handshake_buffer() {
-  tsi_test_fixture *fixture = fake_tsi_test_fixture_create();
-  fixture->handshake_buffer_size = TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void fake_tsi_test_do_handshake() {
-  tsi_test_fixture *fixture = fake_tsi_test_fixture_create();
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void fake_tsi_test_do_round_trip_for_all_configs() {
-  unsigned int *bit_array =
-      gpr_zalloc(sizeof(unsigned int) * TSI_TEST_NUM_OF_ARGUMENTS);
-  const unsigned int mask = 1U << (TSI_TEST_NUM_OF_ARGUMENTS - 1);
-  for (unsigned int val = 0; val < TSI_TEST_NUM_OF_COMBINATIONS; val++) {
-    unsigned int v = val;
-    for (unsigned int ind = 0; ind < TSI_TEST_NUM_OF_ARGUMENTS; ind++) {
-      bit_array[ind] = (v & mask) ? 1 : 0;
-      v <<= 1;
-    }
-    tsi_test_fixture *fixture = fake_tsi_test_fixture_create();
-    fake_tsi_test_fixture *fake_fixture = (fake_tsi_test_fixture *)fixture;
-    tsi_test_frame_protector_config_destroy(fake_fixture->base.config);
-    fake_fixture->base.config = tsi_test_frame_protector_config_create(
-        bit_array[0], bit_array[1], bit_array[2], bit_array[3], bit_array[4],
-        bit_array[5], bit_array[6], bit_array[7]);
-    tsi_test_do_round_trip(&fake_fixture->base);
-    tsi_test_fixture_destroy(fixture);
-  }
-  gpr_free(bit_array);
-}
-
-void fake_tsi_test_do_round_trip_odd_buffer_size() {
-  const size_t odd_sizes[] = {1025, 2051, 4103, 8207, 16409};
-  const size_t size = sizeof(odd_sizes) / sizeof(size_t);
-  for (size_t ind1 = 0; ind1 < size; ind1++) {
-    for (size_t ind2 = 0; ind2 < size; ind2++) {
-      for (size_t ind3 = 0; ind3 < size; ind3++) {
-        for (size_t ind4 = 0; ind4 < size; ind4++) {
-          for (size_t ind5 = 0; ind5 < size; ind5++) {
-            tsi_test_fixture *fixture = fake_tsi_test_fixture_create();
-            fake_tsi_test_fixture *fake_fixture =
-                (fake_tsi_test_fixture *)fixture;
-            tsi_test_frame_protector_config_set_buffer_size(
-                fake_fixture->base.config, odd_sizes[ind1], odd_sizes[ind2],
-                odd_sizes[ind3], odd_sizes[ind4], odd_sizes[ind5]);
-            tsi_test_do_round_trip(&fake_fixture->base);
-            tsi_test_fixture_destroy(fixture);
-          }
-        }
-      }
-    }
-  }
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  fake_tsi_test_do_handshake_tiny_handshake_buffer();
-  fake_tsi_test_do_handshake_small_handshake_buffer();
-  fake_tsi_test_do_handshake();
-  fake_tsi_test_do_round_trip_for_all_configs();
-  fake_tsi_test_do_round_trip_odd_buffer_size();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/tsi/fake_transport_security_test.cc b/test/core/tsi/fake_transport_security_test.cc
new file mode 100644
index 0000000..32b0f89
--- /dev/null
+++ b/test/core/tsi/fake_transport_security_test.cc
@@ -0,0 +1,149 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "src/core/lib/security/transport/security_connector.h"
+#include "src/core/tsi/fake_transport_security.h"
+#include "test/core/tsi/transport_security_test_lib.h"
+#include "test/core/util/test_config.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+typedef struct fake_tsi_test_fixture {
+  tsi_test_fixture base;
+} fake_tsi_test_fixture;
+
+static void fake_test_setup_handshakers(tsi_test_fixture* fixture) {
+  fixture->client_handshaker =
+      tsi_create_fake_handshaker(true /* is_client. */);
+  fixture->server_handshaker =
+      tsi_create_fake_handshaker(false /* is_client. */);
+}
+
+static void validate_handshaker_peers(tsi_handshaker_result* result) {
+  GPR_ASSERT(result != NULL);
+  tsi_peer peer;
+  GPR_ASSERT(tsi_handshaker_result_extract_peer(result, &peer) == TSI_OK);
+  const tsi_peer_property* property =
+      tsi_peer_get_property_by_name(&peer, TSI_CERTIFICATE_TYPE_PEER_PROPERTY);
+  GPR_ASSERT(property != NULL);
+  GPR_ASSERT(memcmp(property->value.data, TSI_FAKE_CERTIFICATE_TYPE,
+                    property->value.length) == 0);
+  tsi_peer_destruct(&peer);
+}
+
+static void fake_test_check_handshaker_peers(tsi_test_fixture* fixture) {
+  validate_handshaker_peers(fixture->client_result);
+  validate_handshaker_peers(fixture->server_result);
+}
+
+static void fake_test_destruct(tsi_test_fixture* fixture) {}
+
+static const struct tsi_test_fixture_vtable vtable = {
+    fake_test_setup_handshakers, fake_test_check_handshaker_peers,
+    fake_test_destruct};
+
+static tsi_test_fixture* fake_tsi_test_fixture_create() {
+  fake_tsi_test_fixture* fake_fixture =
+      static_cast<fake_tsi_test_fixture*>(gpr_zalloc(sizeof(*fake_fixture)));
+  tsi_test_fixture_init(&fake_fixture->base);
+  fake_fixture->base.vtable = &vtable;
+  return &fake_fixture->base;
+}
+
+void fake_tsi_test_do_handshake_tiny_handshake_buffer() {
+  tsi_test_fixture* fixture = fake_tsi_test_fixture_create();
+  fixture->handshake_buffer_size = TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void fake_tsi_test_do_handshake_small_handshake_buffer() {
+  tsi_test_fixture* fixture = fake_tsi_test_fixture_create();
+  fixture->handshake_buffer_size = TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void fake_tsi_test_do_handshake() {
+  tsi_test_fixture* fixture = fake_tsi_test_fixture_create();
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void fake_tsi_test_do_round_trip_for_all_configs() {
+  unsigned int* bit_array = static_cast<unsigned int*>(
+      gpr_zalloc(sizeof(unsigned int) * TSI_TEST_NUM_OF_ARGUMENTS));
+  const unsigned int mask = 1U << (TSI_TEST_NUM_OF_ARGUMENTS - 1);
+  for (unsigned int val = 0; val < TSI_TEST_NUM_OF_COMBINATIONS; val++) {
+    unsigned int v = val;
+    for (unsigned int ind = 0; ind < TSI_TEST_NUM_OF_ARGUMENTS; ind++) {
+      bit_array[ind] = (v & mask) ? 1 : 0;
+      v <<= 1;
+    }
+    tsi_test_fixture* fixture = fake_tsi_test_fixture_create();
+    fake_tsi_test_fixture* fake_fixture = (fake_tsi_test_fixture*)fixture;
+    tsi_test_frame_protector_config_destroy(fake_fixture->base.config);
+    fake_fixture->base.config = tsi_test_frame_protector_config_create(
+        bit_array[0], bit_array[1], bit_array[2], bit_array[3], bit_array[4],
+        bit_array[5], bit_array[6], bit_array[7]);
+    tsi_test_do_round_trip(&fake_fixture->base);
+    tsi_test_fixture_destroy(fixture);
+  }
+  gpr_free(bit_array);
+}
+
+void fake_tsi_test_do_round_trip_odd_buffer_size() {
+  const size_t odd_sizes[] = {1025, 2051, 4103, 8207, 16409};
+  const size_t size = sizeof(odd_sizes) / sizeof(size_t);
+  for (size_t ind1 = 0; ind1 < size; ind1++) {
+    for (size_t ind2 = 0; ind2 < size; ind2++) {
+      for (size_t ind3 = 0; ind3 < size; ind3++) {
+        for (size_t ind4 = 0; ind4 < size; ind4++) {
+          for (size_t ind5 = 0; ind5 < size; ind5++) {
+            tsi_test_fixture* fixture = fake_tsi_test_fixture_create();
+            fake_tsi_test_fixture* fake_fixture =
+                (fake_tsi_test_fixture*)fixture;
+            tsi_test_frame_protector_config_set_buffer_size(
+                fake_fixture->base.config, odd_sizes[ind1], odd_sizes[ind2],
+                odd_sizes[ind3], odd_sizes[ind4], odd_sizes[ind5]);
+            tsi_test_do_round_trip(&fake_fixture->base);
+            tsi_test_fixture_destroy(fixture);
+          }
+        }
+      }
+    }
+  }
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  fake_tsi_test_do_handshake_tiny_handshake_buffer();
+  fake_tsi_test_do_handshake_small_handshake_buffer();
+  fake_tsi_test_do_handshake();
+  fake_tsi_test_do_round_trip_for_all_configs();
+  fake_tsi_test_do_round_trip_odd_buffer_size();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/tsi/ssl_transport_security_test.c b/test/core/tsi/ssl_transport_security_test.c
deleted file mode 100644
index 2399b05..0000000
--- a/test/core/tsi/ssl_transport_security_test.c
+++ /dev/null
@@ -1,673 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "src/core/lib/iomgr/load_file.h"
-#include "src/core/lib/security/transport/security_connector.h"
-#include "src/core/tsi/ssl_transport_security.h"
-#include "src/core/tsi/transport_security.h"
-#include "src/core/tsi/transport_security_adapter.h"
-#include "src/core/tsi/transport_security_interface.h"
-#include "test/core/tsi/transport_security_test_lib.h"
-#include "test/core/util/test_config.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#define SSL_TSI_TEST_ALPN1 "foo"
-#define SSL_TSI_TEST_ALPN2 "toto"
-#define SSL_TSI_TEST_ALPN3 "baz"
-#define SSL_TSI_TEST_ALPN_NUM 2
-#define SSL_TSI_TEST_SERVER_KEY_CERT_PAIRS_NUM 2
-#define SSL_TSI_TEST_BAD_SERVER_KEY_CERT_PAIRS_NUM 1
-#define SSL_TSI_TEST_CREDENTIALS_DIR "src/core/tsi/test_creds/"
-
-typedef enum AlpnMode {
-  NO_ALPN,
-  ALPN_CLIENT_NO_SERVER,
-  ALPN_SERVER_NO_CLIENT,
-  ALPN_CLIENT_SERVER_OK,
-  ALPN_CLIENT_SERVER_MISMATCH
-} AlpnMode;
-
-typedef struct ssl_alpn_lib {
-  AlpnMode alpn_mode;
-  char **server_alpn_protocols;
-  char **client_alpn_protocols;
-  uint16_t num_server_alpn_protocols;
-  uint16_t num_client_alpn_protocols;
-} ssl_alpn_lib;
-
-typedef struct ssl_key_cert_lib {
-  bool use_bad_server_cert;
-  bool use_bad_client_cert;
-  char *root_cert;
-  tsi_ssl_pem_key_cert_pair *server_pem_key_cert_pairs;
-  tsi_ssl_pem_key_cert_pair *bad_server_pem_key_cert_pairs;
-  tsi_ssl_pem_key_cert_pair client_pem_key_cert_pair;
-  tsi_ssl_pem_key_cert_pair bad_client_pem_key_cert_pair;
-  uint16_t server_num_key_cert_pairs;
-  uint16_t bad_server_num_key_cert_pairs;
-} ssl_key_cert_lib;
-
-typedef struct ssl_tsi_test_fixture {
-  tsi_test_fixture base;
-  ssl_key_cert_lib *key_cert_lib;
-  ssl_alpn_lib *alpn_lib;
-  bool force_client_auth;
-  char *server_name_indication;
-  tsi_ssl_server_handshaker_factory *server_handshaker_factory;
-  tsi_ssl_client_handshaker_factory *client_handshaker_factory;
-} ssl_tsi_test_fixture;
-
-static void ssl_test_setup_handshakers(tsi_test_fixture *fixture) {
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  GPR_ASSERT(ssl_fixture != NULL);
-  GPR_ASSERT(ssl_fixture->key_cert_lib != NULL);
-  GPR_ASSERT(ssl_fixture->alpn_lib != NULL);
-  ssl_key_cert_lib *key_cert_lib = ssl_fixture->key_cert_lib;
-  ssl_alpn_lib *alpn_lib = ssl_fixture->alpn_lib;
-  /* Create client handshaker factory. */
-  tsi_ssl_pem_key_cert_pair *client_key_cert_pair = NULL;
-  if (ssl_fixture->force_client_auth) {
-    client_key_cert_pair = key_cert_lib->use_bad_client_cert
-                               ? &key_cert_lib->bad_client_pem_key_cert_pair
-                               : &key_cert_lib->client_pem_key_cert_pair;
-  }
-  char **client_alpn_protocols = NULL;
-  uint16_t num_client_alpn_protocols = 0;
-  if (alpn_lib->alpn_mode == ALPN_CLIENT_NO_SERVER ||
-      alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK ||
-      alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_MISMATCH) {
-    client_alpn_protocols = alpn_lib->client_alpn_protocols;
-    num_client_alpn_protocols = alpn_lib->num_client_alpn_protocols;
-  }
-  GPR_ASSERT(tsi_create_ssl_client_handshaker_factory(
-                 client_key_cert_pair, key_cert_lib->root_cert, NULL,
-                 (const char **)client_alpn_protocols,
-                 num_client_alpn_protocols,
-                 &ssl_fixture->client_handshaker_factory) == TSI_OK);
-  /* Create server handshaker factory. */
-  char **server_alpn_protocols = NULL;
-  uint16_t num_server_alpn_protocols = 0;
-  if (alpn_lib->alpn_mode == ALPN_SERVER_NO_CLIENT ||
-      alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK ||
-      alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_MISMATCH) {
-    server_alpn_protocols = alpn_lib->server_alpn_protocols;
-    num_server_alpn_protocols = alpn_lib->num_server_alpn_protocols;
-    if (alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_MISMATCH) {
-      num_server_alpn_protocols--;
-    }
-  }
-  GPR_ASSERT(tsi_create_ssl_server_handshaker_factory(
-                 key_cert_lib->use_bad_server_cert
-                     ? key_cert_lib->bad_server_pem_key_cert_pairs
-                     : key_cert_lib->server_pem_key_cert_pairs,
-                 key_cert_lib->use_bad_server_cert
-                     ? key_cert_lib->bad_server_num_key_cert_pairs
-                     : key_cert_lib->server_num_key_cert_pairs,
-                 key_cert_lib->root_cert, ssl_fixture->force_client_auth, NULL,
-                 (const char **)server_alpn_protocols,
-                 num_server_alpn_protocols,
-                 &ssl_fixture->server_handshaker_factory) == TSI_OK);
-  /* Create server and client handshakers. */
-  tsi_handshaker *client_handshaker = NULL;
-  GPR_ASSERT(tsi_ssl_client_handshaker_factory_create_handshaker(
-                 ssl_fixture->client_handshaker_factory,
-                 ssl_fixture->server_name_indication,
-                 &client_handshaker) == TSI_OK);
-  ssl_fixture->base.client_handshaker =
-      tsi_create_adapter_handshaker(client_handshaker);
-  tsi_handshaker *server_handshaker = NULL;
-  GPR_ASSERT(tsi_ssl_server_handshaker_factory_create_handshaker(
-                 ssl_fixture->server_handshaker_factory, &server_handshaker) ==
-             TSI_OK);
-  ssl_fixture->base.server_handshaker =
-      tsi_create_adapter_handshaker(server_handshaker);
-}
-
-static void check_alpn(ssl_tsi_test_fixture *ssl_fixture,
-                       const tsi_peer *peer) {
-  GPR_ASSERT(ssl_fixture != NULL);
-  GPR_ASSERT(ssl_fixture->alpn_lib != NULL);
-  ssl_alpn_lib *alpn_lib = ssl_fixture->alpn_lib;
-  const tsi_peer_property *alpn_property =
-      tsi_peer_get_property_by_name(peer, TSI_SSL_ALPN_SELECTED_PROTOCOL);
-  if (alpn_lib->alpn_mode != ALPN_CLIENT_SERVER_OK) {
-    GPR_ASSERT(alpn_property == NULL);
-  } else {
-    GPR_ASSERT(alpn_property != NULL);
-    const char *expected_match = "baz";
-    GPR_ASSERT(memcmp(alpn_property->value.data, expected_match,
-                      alpn_property->value.length) == 0);
-  }
-}
-
-static const tsi_peer_property *
-check_basic_authenticated_peer_and_get_common_name(const tsi_peer *peer) {
-  const tsi_peer_property *cert_type_property =
-      tsi_peer_get_property_by_name(peer, TSI_CERTIFICATE_TYPE_PEER_PROPERTY);
-  GPR_ASSERT(cert_type_property != NULL);
-  GPR_ASSERT(memcmp(cert_type_property->value.data, TSI_X509_CERTIFICATE_TYPE,
-                    cert_type_property->value.length) == 0);
-  const tsi_peer_property *property = tsi_peer_get_property_by_name(
-      peer, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY);
-  GPR_ASSERT(property != NULL);
-  return property;
-}
-
-void check_server0_peer(tsi_peer *peer) {
-  const tsi_peer_property *property =
-      check_basic_authenticated_peer_and_get_common_name(peer);
-  const char *expected_match = "*.test.google.com.au";
-  GPR_ASSERT(memcmp(property->value.data, expected_match,
-                    property->value.length) == 0);
-  GPR_ASSERT(tsi_peer_get_property_by_name(
-                 peer, TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) ==
-             NULL);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.test.google.com.au") == 1);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.test.google.com.au") == 1);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.test.google.blah") == 0);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.bar.test.google.com.au") ==
-             0);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "test.google.com.au") == 0);
-  tsi_peer_destruct(peer);
-}
-
-static bool check_subject_alt_name(tsi_peer *peer, const char *name) {
-  for (size_t i = 0; i < peer->property_count; i++) {
-    const tsi_peer_property *prop = &peer->properties[i];
-    if (strcmp(prop->name, TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) ==
-        0) {
-      if (memcmp(prop->value.data, name, prop->value.length) == 0) {
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-void check_server1_peer(tsi_peer *peer) {
-  const tsi_peer_property *property =
-      check_basic_authenticated_peer_and_get_common_name(peer);
-  const char *expected_match = "*.test.google.com";
-  GPR_ASSERT(memcmp(property->value.data, expected_match,
-                    property->value.length) == 0);
-  GPR_ASSERT(check_subject_alt_name(peer, "*.test.google.fr") == 1);
-  GPR_ASSERT(check_subject_alt_name(peer, "waterzooi.test.google.be") == 1);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.test.google.fr") == 1);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.test.google.fr") == 1);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "waterzooi.test.google.be") == 1);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.test.youtube.com") == 1);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.foo.test.google.com") == 0);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "test.google.fr") == 0);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "tartines.test.google.be") == 0);
-  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "tartines.youtube.com") == 0);
-  tsi_peer_destruct(peer);
-}
-
-static void check_client_peer(ssl_tsi_test_fixture *ssl_fixture,
-                              tsi_peer *peer) {
-  GPR_ASSERT(ssl_fixture != NULL);
-  GPR_ASSERT(ssl_fixture->alpn_lib != NULL);
-  ssl_alpn_lib *alpn_lib = ssl_fixture->alpn_lib;
-  if (!ssl_fixture->force_client_auth) {
-    GPR_ASSERT(peer->property_count ==
-               (alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK ? 1 : 0));
-  } else {
-    const tsi_peer_property *property =
-        check_basic_authenticated_peer_and_get_common_name(peer);
-    const char *expected_match = "testclient";
-    GPR_ASSERT(memcmp(property->value.data, expected_match,
-                      property->value.length) == 0);
-  }
-  tsi_peer_destruct(peer);
-}
-
-static void ssl_test_check_handshaker_peers(tsi_test_fixture *fixture) {
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  GPR_ASSERT(ssl_fixture != NULL);
-  GPR_ASSERT(ssl_fixture->key_cert_lib != NULL);
-  ssl_key_cert_lib *key_cert_lib = ssl_fixture->key_cert_lib;
-  tsi_peer peer;
-  bool expect_success =
-      !(key_cert_lib->use_bad_server_cert ||
-        (key_cert_lib->use_bad_client_cert && ssl_fixture->force_client_auth));
-  if (expect_success) {
-    GPR_ASSERT(tsi_handshaker_result_extract_peer(
-                   ssl_fixture->base.client_result, &peer) == TSI_OK);
-    check_alpn(ssl_fixture, &peer);
-
-    if (ssl_fixture->server_name_indication != NULL) {
-      check_server1_peer(&peer);
-    } else {
-      check_server0_peer(&peer);
-    }
-  } else {
-    GPR_ASSERT(ssl_fixture->base.client_result == NULL);
-  }
-  if (expect_success) {
-    GPR_ASSERT(tsi_handshaker_result_extract_peer(
-                   ssl_fixture->base.server_result, &peer) == TSI_OK);
-    check_alpn(ssl_fixture, &peer);
-    check_client_peer(ssl_fixture, &peer);
-  } else {
-    GPR_ASSERT(ssl_fixture->base.server_result == NULL);
-  }
-}
-
-static void ssl_test_pem_key_cert_pair_destroy(tsi_ssl_pem_key_cert_pair kp) {
-  gpr_free((void *)kp.private_key);
-  gpr_free((void *)kp.cert_chain);
-}
-
-static void ssl_test_destruct(tsi_test_fixture *fixture) {
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  if (ssl_fixture == NULL) {
-    return;
-  }
-  /* Destroy ssl_alpn_lib. */
-  ssl_alpn_lib *alpn_lib = ssl_fixture->alpn_lib;
-  for (size_t i = 0; i < alpn_lib->num_server_alpn_protocols; i++) {
-    gpr_free(alpn_lib->server_alpn_protocols[i]);
-  }
-  gpr_free(alpn_lib->server_alpn_protocols);
-  for (size_t i = 0; i < alpn_lib->num_client_alpn_protocols; i++) {
-    gpr_free(alpn_lib->client_alpn_protocols[i]);
-  }
-  gpr_free(alpn_lib->client_alpn_protocols);
-  gpr_free(alpn_lib);
-  /* Destroy ssl_key_cert_lib. */
-  ssl_key_cert_lib *key_cert_lib = ssl_fixture->key_cert_lib;
-  for (size_t i = 0; i < key_cert_lib->server_num_key_cert_pairs; i++) {
-    ssl_test_pem_key_cert_pair_destroy(
-        key_cert_lib->server_pem_key_cert_pairs[i]);
-  }
-  gpr_free(key_cert_lib->server_pem_key_cert_pairs);
-  for (size_t i = 0; i < key_cert_lib->bad_server_num_key_cert_pairs; i++) {
-    ssl_test_pem_key_cert_pair_destroy(
-        key_cert_lib->bad_server_pem_key_cert_pairs[i]);
-  }
-  gpr_free(key_cert_lib->bad_server_pem_key_cert_pairs);
-  ssl_test_pem_key_cert_pair_destroy(key_cert_lib->client_pem_key_cert_pair);
-  ssl_test_pem_key_cert_pair_destroy(
-      key_cert_lib->bad_client_pem_key_cert_pair);
-  gpr_free(key_cert_lib->root_cert);
-  gpr_free(key_cert_lib);
-  /* Unreference others. */
-  tsi_ssl_server_handshaker_factory_unref(
-      ssl_fixture->server_handshaker_factory);
-  tsi_ssl_client_handshaker_factory_unref(
-      ssl_fixture->client_handshaker_factory);
-}
-
-static const struct tsi_test_fixture_vtable vtable = {
-    ssl_test_setup_handshakers, ssl_test_check_handshaker_peers,
-    ssl_test_destruct};
-
-static char *load_file(const char *dir_path, const char *file_name) {
-  char *file_path =
-      gpr_zalloc(sizeof(char) * (strlen(dir_path) + strlen(file_name) + 1));
-  memcpy(file_path, dir_path, strlen(dir_path));
-  memcpy(file_path + strlen(dir_path), file_name, strlen(file_name));
-  grpc_slice slice;
-  GPR_ASSERT(grpc_load_file(file_path, 1, &slice) == GRPC_ERROR_NONE);
-  char *data = grpc_slice_to_c_string(slice);
-  grpc_slice_unref(slice);
-  gpr_free(file_path);
-  return data;
-}
-
-static tsi_test_fixture *ssl_tsi_test_fixture_create() {
-  ssl_tsi_test_fixture *ssl_fixture = gpr_zalloc(sizeof(*ssl_fixture));
-  tsi_test_fixture_init(&ssl_fixture->base);
-  ssl_fixture->base.test_unused_bytes = false;
-  ssl_fixture->base.vtable = &vtable;
-  /* Create ssl_key_cert_lib. */
-  ssl_key_cert_lib *key_cert_lib = gpr_zalloc(sizeof(*key_cert_lib));
-  key_cert_lib->use_bad_server_cert = false;
-  key_cert_lib->use_bad_client_cert = false;
-  key_cert_lib->server_num_key_cert_pairs =
-      SSL_TSI_TEST_SERVER_KEY_CERT_PAIRS_NUM;
-  key_cert_lib->bad_server_num_key_cert_pairs =
-      SSL_TSI_TEST_BAD_SERVER_KEY_CERT_PAIRS_NUM;
-  key_cert_lib->server_pem_key_cert_pairs =
-      gpr_malloc(sizeof(tsi_ssl_pem_key_cert_pair) *
-                 key_cert_lib->server_num_key_cert_pairs);
-  key_cert_lib->bad_server_pem_key_cert_pairs =
-      gpr_malloc(sizeof(tsi_ssl_pem_key_cert_pair) *
-                 key_cert_lib->bad_server_num_key_cert_pairs);
-  key_cert_lib->server_pem_key_cert_pairs[0].private_key =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.key");
-  key_cert_lib->server_pem_key_cert_pairs[0].cert_chain =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.pem");
-  key_cert_lib->server_pem_key_cert_pairs[1].private_key =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server1.key");
-  key_cert_lib->server_pem_key_cert_pairs[1].cert_chain =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server1.pem");
-  key_cert_lib->bad_server_pem_key_cert_pairs[0].private_key =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badserver.key");
-  key_cert_lib->bad_server_pem_key_cert_pairs[0].cert_chain =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badserver.pem");
-  key_cert_lib->client_pem_key_cert_pair.private_key =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "client.key");
-  key_cert_lib->client_pem_key_cert_pair.cert_chain =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "client.pem");
-  key_cert_lib->bad_client_pem_key_cert_pair.private_key =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badclient.key");
-  key_cert_lib->bad_client_pem_key_cert_pair.cert_chain =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badclient.pem");
-  key_cert_lib->root_cert = load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "ca.pem");
-  ssl_fixture->key_cert_lib = key_cert_lib;
-  /* Create ssl_alpn_lib. */
-  ssl_alpn_lib *alpn_lib = gpr_zalloc(sizeof(*alpn_lib));
-  alpn_lib->server_alpn_protocols =
-      gpr_zalloc(sizeof(char *) * SSL_TSI_TEST_ALPN_NUM);
-  alpn_lib->client_alpn_protocols =
-      gpr_zalloc(sizeof(char *) * SSL_TSI_TEST_ALPN_NUM);
-  alpn_lib->server_alpn_protocols[0] = gpr_strdup(SSL_TSI_TEST_ALPN1);
-  alpn_lib->server_alpn_protocols[1] = gpr_strdup(SSL_TSI_TEST_ALPN3);
-  alpn_lib->client_alpn_protocols[0] = gpr_strdup(SSL_TSI_TEST_ALPN2);
-  alpn_lib->client_alpn_protocols[1] = gpr_strdup(SSL_TSI_TEST_ALPN3);
-  alpn_lib->num_server_alpn_protocols = SSL_TSI_TEST_ALPN_NUM;
-  alpn_lib->num_client_alpn_protocols = SSL_TSI_TEST_ALPN_NUM;
-  alpn_lib->alpn_mode = NO_ALPN;
-  ssl_fixture->alpn_lib = alpn_lib;
-  ssl_fixture->base.vtable = &vtable;
-  ssl_fixture->server_name_indication = NULL;
-  ssl_fixture->force_client_auth = false;
-  return &ssl_fixture->base;
-}
-
-void ssl_tsi_test_do_handshake_tiny_handshake_buffer() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  fixture->handshake_buffer_size = TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_small_handshake_buffer() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  fixture->handshake_buffer_size = TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_with_client_authentication() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  ssl_fixture->force_client_auth = true;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain() {
-  /* server1 cert contains "waterzooi.test.google.be" in SAN. */
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  ssl_fixture->server_name_indication = "waterzooi.test.google.be";
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain() {
-  /* server1 cert contains "*.test.google.fr" in SAN. */
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  ssl_fixture->server_name_indication = "juju.test.google.fr";
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_with_bad_server_cert() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  ssl_fixture->key_cert_lib->use_bad_server_cert = true;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_with_bad_client_cert() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  ssl_fixture->key_cert_lib->use_bad_client_cert = true;
-  ssl_fixture->force_client_auth = true;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_alpn_client_no_server() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  ssl_fixture->alpn_lib->alpn_mode = ALPN_CLIENT_NO_SERVER;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_alpn_server_no_client() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  ssl_fixture->alpn_lib->alpn_mode = ALPN_SERVER_NO_CLIENT;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_alpn_client_server_mismatch() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  ssl_fixture->alpn_lib->alpn_mode = ALPN_CLIENT_SERVER_MISMATCH;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_handshake_alpn_client_server_ok() {
-  tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-  ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-  ssl_fixture->alpn_lib->alpn_mode = ALPN_CLIENT_SERVER_OK;
-  tsi_test_do_handshake(fixture);
-  tsi_test_fixture_destroy(fixture);
-}
-
-void ssl_tsi_test_do_round_trip_for_all_configs() {
-  unsigned int *bit_array =
-      gpr_zalloc(sizeof(unsigned int) * TSI_TEST_NUM_OF_ARGUMENTS);
-  const unsigned int mask = 1U << (TSI_TEST_NUM_OF_ARGUMENTS - 1);
-  for (unsigned int val = 0; val < TSI_TEST_NUM_OF_COMBINATIONS; val++) {
-    unsigned int v = val;
-    for (unsigned int ind = 0; ind < TSI_TEST_NUM_OF_ARGUMENTS; ind++) {
-      bit_array[ind] = (v & mask) ? 1 : 0;
-      v <<= 1;
-    }
-    tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-    ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-    tsi_test_frame_protector_config_destroy(ssl_fixture->base.config);
-    ssl_fixture->base.config = tsi_test_frame_protector_config_create(
-        bit_array[0], bit_array[1], bit_array[2], bit_array[3], bit_array[4],
-        bit_array[5], bit_array[6], bit_array[7]);
-    tsi_test_do_round_trip(&ssl_fixture->base);
-    tsi_test_fixture_destroy(fixture);
-  }
-  gpr_free(bit_array);
-}
-
-void ssl_tsi_test_do_round_trip_odd_buffer_size() {
-  const size_t odd_sizes[] = {1025, 2051, 4103, 8207, 16409};
-  const size_t size = sizeof(odd_sizes) / sizeof(size_t);
-  for (size_t ind1 = 0; ind1 < size; ind1++) {
-    for (size_t ind2 = 0; ind2 < size; ind2++) {
-      for (size_t ind3 = 0; ind3 < size; ind3++) {
-        for (size_t ind4 = 0; ind4 < size; ind4++) {
-          for (size_t ind5 = 0; ind5 < size; ind5++) {
-            tsi_test_fixture *fixture = ssl_tsi_test_fixture_create();
-            ssl_tsi_test_fixture *ssl_fixture = (ssl_tsi_test_fixture *)fixture;
-            tsi_test_frame_protector_config_set_buffer_size(
-                ssl_fixture->base.config, odd_sizes[ind1], odd_sizes[ind2],
-                odd_sizes[ind3], odd_sizes[ind4], odd_sizes[ind5]);
-            tsi_test_do_round_trip(&ssl_fixture->base);
-            tsi_test_fixture_destroy(fixture);
-          }
-        }
-      }
-    }
-  }
-}
-
-static const tsi_ssl_handshaker_factory_vtable *original_vtable;
-static bool handshaker_factory_destructor_called;
-
-static void ssl_tsi_test_handshaker_factory_destructor(
-    tsi_ssl_handshaker_factory *factory) {
-  GPR_ASSERT(factory != NULL);
-  handshaker_factory_destructor_called = true;
-  if (original_vtable != NULL && original_vtable->destroy != NULL) {
-    original_vtable->destroy(factory);
-  }
-}
-
-static tsi_ssl_handshaker_factory_vtable test_handshaker_factory_vtable = {
-    ssl_tsi_test_handshaker_factory_destructor};
-
-void test_tsi_ssl_client_handshaker_factory_refcounting() {
-  int i;
-  const char *cert_chain =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "client.pem");
-
-  tsi_ssl_client_handshaker_factory *client_handshaker_factory;
-  GPR_ASSERT(tsi_create_ssl_client_handshaker_factory(
-                 NULL, cert_chain, NULL, NULL, 0, &client_handshaker_factory) ==
-             TSI_OK);
-
-  handshaker_factory_destructor_called = false;
-  original_vtable = tsi_ssl_handshaker_factory_swap_vtable(
-      (tsi_ssl_handshaker_factory *)client_handshaker_factory,
-      &test_handshaker_factory_vtable);
-
-  tsi_handshaker *handshaker[3];
-
-  for (i = 0; i < 3; ++i) {
-    GPR_ASSERT(tsi_ssl_client_handshaker_factory_create_handshaker(
-                   client_handshaker_factory, "google.com", &handshaker[i]) ==
-               TSI_OK);
-  }
-
-  tsi_handshaker_destroy(handshaker[1]);
-  GPR_ASSERT(!handshaker_factory_destructor_called);
-
-  tsi_handshaker_destroy(handshaker[0]);
-  GPR_ASSERT(!handshaker_factory_destructor_called);
-
-  tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory);
-  GPR_ASSERT(!handshaker_factory_destructor_called);
-
-  tsi_handshaker_destroy(handshaker[2]);
-  GPR_ASSERT(handshaker_factory_destructor_called);
-
-  gpr_free((void *)cert_chain);
-}
-
-void test_tsi_ssl_server_handshaker_factory_refcounting() {
-  int i;
-  tsi_ssl_server_handshaker_factory *server_handshaker_factory;
-  tsi_handshaker *handshaker[3];
-  const char *cert_chain =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.pem");
-  tsi_ssl_pem_key_cert_pair cert_pair;
-
-  cert_pair.cert_chain = cert_chain;
-  cert_pair.private_key =
-      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.key");
-
-  GPR_ASSERT(tsi_create_ssl_server_handshaker_factory(
-                 &cert_pair, 1, cert_chain, 0, NULL, NULL, 0,
-                 &server_handshaker_factory) == TSI_OK);
-
-  handshaker_factory_destructor_called = false;
-  original_vtable = tsi_ssl_handshaker_factory_swap_vtable(
-      (tsi_ssl_handshaker_factory *)server_handshaker_factory,
-      &test_handshaker_factory_vtable);
-
-  for (i = 0; i < 3; ++i) {
-    GPR_ASSERT(tsi_ssl_server_handshaker_factory_create_handshaker(
-                   server_handshaker_factory, &handshaker[i]) == TSI_OK);
-  }
-
-  tsi_handshaker_destroy(handshaker[1]);
-  GPR_ASSERT(!handshaker_factory_destructor_called);
-
-  tsi_handshaker_destroy(handshaker[0]);
-  GPR_ASSERT(!handshaker_factory_destructor_called);
-
-  tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory);
-  GPR_ASSERT(!handshaker_factory_destructor_called);
-
-  tsi_handshaker_destroy(handshaker[2]);
-  GPR_ASSERT(handshaker_factory_destructor_called);
-
-  ssl_test_pem_key_cert_pair_destroy(cert_pair);
-}
-
-/* Attempting to create a handshaker factory with invalid parameters should fail
- * but not crash. */
-void test_tsi_ssl_client_handshaker_factory_bad_params() {
-  const char *cert_chain = "This is not a valid PEM file.";
-
-  tsi_ssl_client_handshaker_factory *client_handshaker_factory;
-  GPR_ASSERT(tsi_create_ssl_client_handshaker_factory(
-                 NULL, cert_chain, NULL, NULL, 0, &client_handshaker_factory) ==
-             TSI_INVALID_ARGUMENT);
-  tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory);
-}
-
-void ssl_tsi_test_handshaker_factory_internals() {
-  test_tsi_ssl_client_handshaker_factory_refcounting();
-  test_tsi_ssl_server_handshaker_factory_refcounting();
-  test_tsi_ssl_client_handshaker_factory_bad_params();
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  grpc_init();
-  ssl_tsi_test_do_handshake_tiny_handshake_buffer();
-  ssl_tsi_test_do_handshake_small_handshake_buffer();
-  ssl_tsi_test_do_handshake();
-  ssl_tsi_test_do_handshake_with_client_authentication();
-  ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain();
-  ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain();
-  ssl_tsi_test_do_handshake_with_bad_server_cert();
-  ssl_tsi_test_do_handshake_with_bad_client_cert();
-  ssl_tsi_test_do_handshake_alpn_client_no_server();
-  ssl_tsi_test_do_handshake_alpn_server_no_client();
-  ssl_tsi_test_do_handshake_alpn_client_server_mismatch();
-  ssl_tsi_test_do_handshake_alpn_client_server_ok();
-  ssl_tsi_test_do_round_trip_for_all_configs();
-  ssl_tsi_test_do_round_trip_odd_buffer_size();
-  ssl_tsi_test_handshaker_factory_internals();
-  grpc_shutdown();
-  return 0;
-}
diff --git a/test/core/tsi/ssl_transport_security_test.cc b/test/core/tsi/ssl_transport_security_test.cc
new file mode 100644
index 0000000..0903ce8
--- /dev/null
+++ b/test/core/tsi/ssl_transport_security_test.cc
@@ -0,0 +1,678 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/transport/security_connector.h"
+#include "src/core/tsi/ssl_transport_security.h"
+#include "src/core/tsi/transport_security.h"
+#include "src/core/tsi/transport_security_adapter.h"
+#include "src/core/tsi/transport_security_interface.h"
+#include "test/core/tsi/transport_security_test_lib.h"
+#include "test/core/util/test_config.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#define SSL_TSI_TEST_ALPN1 "foo"
+#define SSL_TSI_TEST_ALPN2 "toto"
+#define SSL_TSI_TEST_ALPN3 "baz"
+#define SSL_TSI_TEST_ALPN_NUM 2
+#define SSL_TSI_TEST_SERVER_KEY_CERT_PAIRS_NUM 2
+#define SSL_TSI_TEST_BAD_SERVER_KEY_CERT_PAIRS_NUM 1
+#define SSL_TSI_TEST_CREDENTIALS_DIR "src/core/tsi/test_creds/"
+
+typedef enum AlpnMode {
+  NO_ALPN,
+  ALPN_CLIENT_NO_SERVER,
+  ALPN_SERVER_NO_CLIENT,
+  ALPN_CLIENT_SERVER_OK,
+  ALPN_CLIENT_SERVER_MISMATCH
+} AlpnMode;
+
+typedef struct ssl_alpn_lib {
+  AlpnMode alpn_mode;
+  char** server_alpn_protocols;
+  char** client_alpn_protocols;
+  uint16_t num_server_alpn_protocols;
+  uint16_t num_client_alpn_protocols;
+} ssl_alpn_lib;
+
+typedef struct ssl_key_cert_lib {
+  bool use_bad_server_cert;
+  bool use_bad_client_cert;
+  char* root_cert;
+  tsi_ssl_pem_key_cert_pair* server_pem_key_cert_pairs;
+  tsi_ssl_pem_key_cert_pair* bad_server_pem_key_cert_pairs;
+  tsi_ssl_pem_key_cert_pair client_pem_key_cert_pair;
+  tsi_ssl_pem_key_cert_pair bad_client_pem_key_cert_pair;
+  uint16_t server_num_key_cert_pairs;
+  uint16_t bad_server_num_key_cert_pairs;
+} ssl_key_cert_lib;
+
+typedef struct ssl_tsi_test_fixture {
+  tsi_test_fixture base;
+  ssl_key_cert_lib* key_cert_lib;
+  ssl_alpn_lib* alpn_lib;
+  bool force_client_auth;
+  char* server_name_indication;
+  tsi_ssl_server_handshaker_factory* server_handshaker_factory;
+  tsi_ssl_client_handshaker_factory* client_handshaker_factory;
+} ssl_tsi_test_fixture;
+
+static void ssl_test_setup_handshakers(tsi_test_fixture* fixture) {
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  GPR_ASSERT(ssl_fixture != NULL);
+  GPR_ASSERT(ssl_fixture->key_cert_lib != NULL);
+  GPR_ASSERT(ssl_fixture->alpn_lib != NULL);
+  ssl_key_cert_lib* key_cert_lib = ssl_fixture->key_cert_lib;
+  ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib;
+  /* Create client handshaker factory. */
+  tsi_ssl_pem_key_cert_pair* client_key_cert_pair = NULL;
+  if (ssl_fixture->force_client_auth) {
+    client_key_cert_pair = key_cert_lib->use_bad_client_cert
+                               ? &key_cert_lib->bad_client_pem_key_cert_pair
+                               : &key_cert_lib->client_pem_key_cert_pair;
+  }
+  char** client_alpn_protocols = NULL;
+  uint16_t num_client_alpn_protocols = 0;
+  if (alpn_lib->alpn_mode == ALPN_CLIENT_NO_SERVER ||
+      alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK ||
+      alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_MISMATCH) {
+    client_alpn_protocols = alpn_lib->client_alpn_protocols;
+    num_client_alpn_protocols = alpn_lib->num_client_alpn_protocols;
+  }
+  GPR_ASSERT(tsi_create_ssl_client_handshaker_factory(
+                 client_key_cert_pair, key_cert_lib->root_cert, NULL,
+                 (const char**)client_alpn_protocols, num_client_alpn_protocols,
+                 &ssl_fixture->client_handshaker_factory) == TSI_OK);
+  /* Create server handshaker factory. */
+  char** server_alpn_protocols = NULL;
+  uint16_t num_server_alpn_protocols = 0;
+  if (alpn_lib->alpn_mode == ALPN_SERVER_NO_CLIENT ||
+      alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK ||
+      alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_MISMATCH) {
+    server_alpn_protocols = alpn_lib->server_alpn_protocols;
+    num_server_alpn_protocols = alpn_lib->num_server_alpn_protocols;
+    if (alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_MISMATCH) {
+      num_server_alpn_protocols--;
+    }
+  }
+  GPR_ASSERT(tsi_create_ssl_server_handshaker_factory(
+                 key_cert_lib->use_bad_server_cert
+                     ? key_cert_lib->bad_server_pem_key_cert_pairs
+                     : key_cert_lib->server_pem_key_cert_pairs,
+                 key_cert_lib->use_bad_server_cert
+                     ? key_cert_lib->bad_server_num_key_cert_pairs
+                     : key_cert_lib->server_num_key_cert_pairs,
+                 key_cert_lib->root_cert, ssl_fixture->force_client_auth, NULL,
+                 (const char**)server_alpn_protocols, num_server_alpn_protocols,
+                 &ssl_fixture->server_handshaker_factory) == TSI_OK);
+  /* Create server and client handshakers. */
+  tsi_handshaker* client_handshaker = NULL;
+  GPR_ASSERT(tsi_ssl_client_handshaker_factory_create_handshaker(
+                 ssl_fixture->client_handshaker_factory,
+                 ssl_fixture->server_name_indication,
+                 &client_handshaker) == TSI_OK);
+  ssl_fixture->base.client_handshaker =
+      tsi_create_adapter_handshaker(client_handshaker);
+  tsi_handshaker* server_handshaker = NULL;
+  GPR_ASSERT(tsi_ssl_server_handshaker_factory_create_handshaker(
+                 ssl_fixture->server_handshaker_factory, &server_handshaker) ==
+             TSI_OK);
+  ssl_fixture->base.server_handshaker =
+      tsi_create_adapter_handshaker(server_handshaker);
+}
+
+static void check_alpn(ssl_tsi_test_fixture* ssl_fixture,
+                       const tsi_peer* peer) {
+  GPR_ASSERT(ssl_fixture != NULL);
+  GPR_ASSERT(ssl_fixture->alpn_lib != NULL);
+  ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib;
+  const tsi_peer_property* alpn_property =
+      tsi_peer_get_property_by_name(peer, TSI_SSL_ALPN_SELECTED_PROTOCOL);
+  if (alpn_lib->alpn_mode != ALPN_CLIENT_SERVER_OK) {
+    GPR_ASSERT(alpn_property == NULL);
+  } else {
+    GPR_ASSERT(alpn_property != NULL);
+    const char* expected_match = "baz";
+    GPR_ASSERT(memcmp(alpn_property->value.data, expected_match,
+                      alpn_property->value.length) == 0);
+  }
+}
+
+static const tsi_peer_property*
+check_basic_authenticated_peer_and_get_common_name(const tsi_peer* peer) {
+  const tsi_peer_property* cert_type_property =
+      tsi_peer_get_property_by_name(peer, TSI_CERTIFICATE_TYPE_PEER_PROPERTY);
+  GPR_ASSERT(cert_type_property != NULL);
+  GPR_ASSERT(memcmp(cert_type_property->value.data, TSI_X509_CERTIFICATE_TYPE,
+                    cert_type_property->value.length) == 0);
+  const tsi_peer_property* property = tsi_peer_get_property_by_name(
+      peer, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY);
+  GPR_ASSERT(property != NULL);
+  return property;
+}
+
+void check_server0_peer(tsi_peer* peer) {
+  const tsi_peer_property* property =
+      check_basic_authenticated_peer_and_get_common_name(peer);
+  const char* expected_match = "*.test.google.com.au";
+  GPR_ASSERT(memcmp(property->value.data, expected_match,
+                    property->value.length) == 0);
+  GPR_ASSERT(tsi_peer_get_property_by_name(
+                 peer, TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) ==
+             NULL);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.test.google.com.au") == 1);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.test.google.com.au") == 1);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.test.google.blah") == 0);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.bar.test.google.com.au") ==
+             0);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "test.google.com.au") == 0);
+  tsi_peer_destruct(peer);
+}
+
+static bool check_subject_alt_name(tsi_peer* peer, const char* name) {
+  for (size_t i = 0; i < peer->property_count; i++) {
+    const tsi_peer_property* prop = &peer->properties[i];
+    if (strcmp(prop->name, TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) ==
+        0) {
+      if (memcmp(prop->value.data, name, prop->value.length) == 0) {
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
+void check_server1_peer(tsi_peer* peer) {
+  const tsi_peer_property* property =
+      check_basic_authenticated_peer_and_get_common_name(peer);
+  const char* expected_match = "*.test.google.com";
+  GPR_ASSERT(memcmp(property->value.data, expected_match,
+                    property->value.length) == 0);
+  GPR_ASSERT(check_subject_alt_name(peer, "*.test.google.fr") == 1);
+  GPR_ASSERT(check_subject_alt_name(peer, "waterzooi.test.google.be") == 1);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.test.google.fr") == 1);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.test.google.fr") == 1);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "waterzooi.test.google.be") == 1);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.test.youtube.com") == 1);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.foo.test.google.com") == 0);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "test.google.fr") == 0);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "tartines.test.google.be") == 0);
+  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "tartines.youtube.com") == 0);
+  tsi_peer_destruct(peer);
+}
+
+static void check_client_peer(ssl_tsi_test_fixture* ssl_fixture,
+                              tsi_peer* peer) {
+  GPR_ASSERT(ssl_fixture != NULL);
+  GPR_ASSERT(ssl_fixture->alpn_lib != NULL);
+  ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib;
+  if (!ssl_fixture->force_client_auth) {
+    GPR_ASSERT(peer->property_count ==
+               (alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK ? 1 : 0));
+  } else {
+    const tsi_peer_property* property =
+        check_basic_authenticated_peer_and_get_common_name(peer);
+    const char* expected_match = "testclient";
+    GPR_ASSERT(memcmp(property->value.data, expected_match,
+                      property->value.length) == 0);
+  }
+  tsi_peer_destruct(peer);
+}
+
+static void ssl_test_check_handshaker_peers(tsi_test_fixture* fixture) {
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  GPR_ASSERT(ssl_fixture != NULL);
+  GPR_ASSERT(ssl_fixture->key_cert_lib != NULL);
+  ssl_key_cert_lib* key_cert_lib = ssl_fixture->key_cert_lib;
+  tsi_peer peer;
+  bool expect_success =
+      !(key_cert_lib->use_bad_server_cert ||
+        (key_cert_lib->use_bad_client_cert && ssl_fixture->force_client_auth));
+  if (expect_success) {
+    GPR_ASSERT(tsi_handshaker_result_extract_peer(
+                   ssl_fixture->base.client_result, &peer) == TSI_OK);
+    check_alpn(ssl_fixture, &peer);
+
+    if (ssl_fixture->server_name_indication != NULL) {
+      check_server1_peer(&peer);
+    } else {
+      check_server0_peer(&peer);
+    }
+  } else {
+    GPR_ASSERT(ssl_fixture->base.client_result == NULL);
+  }
+  if (expect_success) {
+    GPR_ASSERT(tsi_handshaker_result_extract_peer(
+                   ssl_fixture->base.server_result, &peer) == TSI_OK);
+    check_alpn(ssl_fixture, &peer);
+    check_client_peer(ssl_fixture, &peer);
+  } else {
+    GPR_ASSERT(ssl_fixture->base.server_result == NULL);
+  }
+}
+
+static void ssl_test_pem_key_cert_pair_destroy(tsi_ssl_pem_key_cert_pair kp) {
+  gpr_free((void*)kp.private_key);
+  gpr_free((void*)kp.cert_chain);
+}
+
+static void ssl_test_destruct(tsi_test_fixture* fixture) {
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  if (ssl_fixture == NULL) {
+    return;
+  }
+  /* Destroy ssl_alpn_lib. */
+  ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib;
+  for (size_t i = 0; i < alpn_lib->num_server_alpn_protocols; i++) {
+    gpr_free(alpn_lib->server_alpn_protocols[i]);
+  }
+  gpr_free(alpn_lib->server_alpn_protocols);
+  for (size_t i = 0; i < alpn_lib->num_client_alpn_protocols; i++) {
+    gpr_free(alpn_lib->client_alpn_protocols[i]);
+  }
+  gpr_free(alpn_lib->client_alpn_protocols);
+  gpr_free(alpn_lib);
+  /* Destroy ssl_key_cert_lib. */
+  ssl_key_cert_lib* key_cert_lib = ssl_fixture->key_cert_lib;
+  for (size_t i = 0; i < key_cert_lib->server_num_key_cert_pairs; i++) {
+    ssl_test_pem_key_cert_pair_destroy(
+        key_cert_lib->server_pem_key_cert_pairs[i]);
+  }
+  gpr_free(key_cert_lib->server_pem_key_cert_pairs);
+  for (size_t i = 0; i < key_cert_lib->bad_server_num_key_cert_pairs; i++) {
+    ssl_test_pem_key_cert_pair_destroy(
+        key_cert_lib->bad_server_pem_key_cert_pairs[i]);
+  }
+  gpr_free(key_cert_lib->bad_server_pem_key_cert_pairs);
+  ssl_test_pem_key_cert_pair_destroy(key_cert_lib->client_pem_key_cert_pair);
+  ssl_test_pem_key_cert_pair_destroy(
+      key_cert_lib->bad_client_pem_key_cert_pair);
+  gpr_free(key_cert_lib->root_cert);
+  gpr_free(key_cert_lib);
+  /* Unreference others. */
+  tsi_ssl_server_handshaker_factory_unref(
+      ssl_fixture->server_handshaker_factory);
+  tsi_ssl_client_handshaker_factory_unref(
+      ssl_fixture->client_handshaker_factory);
+}
+
+static const struct tsi_test_fixture_vtable vtable = {
+    ssl_test_setup_handshakers, ssl_test_check_handshaker_peers,
+    ssl_test_destruct};
+
+static char* load_file(const char* dir_path, const char* file_name) {
+  char* file_path = static_cast<char*>(
+      gpr_zalloc(sizeof(char) * (strlen(dir_path) + strlen(file_name) + 1)));
+  memcpy(file_path, dir_path, strlen(dir_path));
+  memcpy(file_path + strlen(dir_path), file_name, strlen(file_name));
+  grpc_slice slice;
+  GPR_ASSERT(grpc_load_file(file_path, 1, &slice) == GRPC_ERROR_NONE);
+  char* data = grpc_slice_to_c_string(slice);
+  grpc_slice_unref(slice);
+  gpr_free(file_path);
+  return data;
+}
+
+static tsi_test_fixture* ssl_tsi_test_fixture_create() {
+  ssl_tsi_test_fixture* ssl_fixture =
+      static_cast<ssl_tsi_test_fixture*>(gpr_zalloc(sizeof(*ssl_fixture)));
+  tsi_test_fixture_init(&ssl_fixture->base);
+  ssl_fixture->base.test_unused_bytes = false;
+  ssl_fixture->base.vtable = &vtable;
+  /* Create ssl_key_cert_lib. */
+  ssl_key_cert_lib* key_cert_lib =
+      static_cast<ssl_key_cert_lib*>(gpr_zalloc(sizeof(*key_cert_lib)));
+  key_cert_lib->use_bad_server_cert = false;
+  key_cert_lib->use_bad_client_cert = false;
+  key_cert_lib->server_num_key_cert_pairs =
+      SSL_TSI_TEST_SERVER_KEY_CERT_PAIRS_NUM;
+  key_cert_lib->bad_server_num_key_cert_pairs =
+      SSL_TSI_TEST_BAD_SERVER_KEY_CERT_PAIRS_NUM;
+  key_cert_lib->server_pem_key_cert_pairs =
+      static_cast<tsi_ssl_pem_key_cert_pair*>(
+          gpr_malloc(sizeof(tsi_ssl_pem_key_cert_pair) *
+                     key_cert_lib->server_num_key_cert_pairs));
+  key_cert_lib->bad_server_pem_key_cert_pairs =
+      static_cast<tsi_ssl_pem_key_cert_pair*>(
+          gpr_malloc(sizeof(tsi_ssl_pem_key_cert_pair) *
+                     key_cert_lib->bad_server_num_key_cert_pairs));
+  key_cert_lib->server_pem_key_cert_pairs[0].private_key =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.key");
+  key_cert_lib->server_pem_key_cert_pairs[0].cert_chain =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.pem");
+  key_cert_lib->server_pem_key_cert_pairs[1].private_key =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server1.key");
+  key_cert_lib->server_pem_key_cert_pairs[1].cert_chain =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server1.pem");
+  key_cert_lib->bad_server_pem_key_cert_pairs[0].private_key =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badserver.key");
+  key_cert_lib->bad_server_pem_key_cert_pairs[0].cert_chain =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badserver.pem");
+  key_cert_lib->client_pem_key_cert_pair.private_key =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "client.key");
+  key_cert_lib->client_pem_key_cert_pair.cert_chain =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "client.pem");
+  key_cert_lib->bad_client_pem_key_cert_pair.private_key =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badclient.key");
+  key_cert_lib->bad_client_pem_key_cert_pair.cert_chain =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badclient.pem");
+  key_cert_lib->root_cert = load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "ca.pem");
+  ssl_fixture->key_cert_lib = key_cert_lib;
+  /* Create ssl_alpn_lib. */
+  ssl_alpn_lib* alpn_lib =
+      static_cast<ssl_alpn_lib*>(gpr_zalloc(sizeof(*alpn_lib)));
+  alpn_lib->server_alpn_protocols =
+      static_cast<char**>(gpr_zalloc(sizeof(char*) * SSL_TSI_TEST_ALPN_NUM));
+  alpn_lib->client_alpn_protocols =
+      static_cast<char**>(gpr_zalloc(sizeof(char*) * SSL_TSI_TEST_ALPN_NUM));
+  alpn_lib->server_alpn_protocols[0] = gpr_strdup(SSL_TSI_TEST_ALPN1);
+  alpn_lib->server_alpn_protocols[1] = gpr_strdup(SSL_TSI_TEST_ALPN3);
+  alpn_lib->client_alpn_protocols[0] = gpr_strdup(SSL_TSI_TEST_ALPN2);
+  alpn_lib->client_alpn_protocols[1] = gpr_strdup(SSL_TSI_TEST_ALPN3);
+  alpn_lib->num_server_alpn_protocols = SSL_TSI_TEST_ALPN_NUM;
+  alpn_lib->num_client_alpn_protocols = SSL_TSI_TEST_ALPN_NUM;
+  alpn_lib->alpn_mode = NO_ALPN;
+  ssl_fixture->alpn_lib = alpn_lib;
+  ssl_fixture->base.vtable = &vtable;
+  ssl_fixture->server_name_indication = NULL;
+  ssl_fixture->force_client_auth = false;
+  return &ssl_fixture->base;
+}
+
+void ssl_tsi_test_do_handshake_tiny_handshake_buffer() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  fixture->handshake_buffer_size = TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_small_handshake_buffer() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  fixture->handshake_buffer_size = TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_with_client_authentication() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  ssl_fixture->force_client_auth = true;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain() {
+  /* server1 cert contains "waterzooi.test.google.be" in SAN. */
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  ssl_fixture->server_name_indication =
+      const_cast<char*>("waterzooi.test.google.be");
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain() {
+  /* server1 cert contains "*.test.google.fr" in SAN. */
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  ssl_fixture->server_name_indication =
+      const_cast<char*>("juju.test.google.fr");
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_with_bad_server_cert() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  ssl_fixture->key_cert_lib->use_bad_server_cert = true;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_with_bad_client_cert() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  ssl_fixture->key_cert_lib->use_bad_client_cert = true;
+  ssl_fixture->force_client_auth = true;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_alpn_client_no_server() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  ssl_fixture->alpn_lib->alpn_mode = ALPN_CLIENT_NO_SERVER;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_alpn_server_no_client() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  ssl_fixture->alpn_lib->alpn_mode = ALPN_SERVER_NO_CLIENT;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_alpn_client_server_mismatch() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  ssl_fixture->alpn_lib->alpn_mode = ALPN_CLIENT_SERVER_MISMATCH;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_handshake_alpn_client_server_ok() {
+  tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+  ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+  ssl_fixture->alpn_lib->alpn_mode = ALPN_CLIENT_SERVER_OK;
+  tsi_test_do_handshake(fixture);
+  tsi_test_fixture_destroy(fixture);
+}
+
+void ssl_tsi_test_do_round_trip_for_all_configs() {
+  unsigned int* bit_array = static_cast<unsigned int*>(
+      gpr_zalloc(sizeof(unsigned int) * TSI_TEST_NUM_OF_ARGUMENTS));
+  const unsigned int mask = 1U << (TSI_TEST_NUM_OF_ARGUMENTS - 1);
+  for (unsigned int val = 0; val < TSI_TEST_NUM_OF_COMBINATIONS; val++) {
+    unsigned int v = val;
+    for (unsigned int ind = 0; ind < TSI_TEST_NUM_OF_ARGUMENTS; ind++) {
+      bit_array[ind] = (v & mask) ? 1 : 0;
+      v <<= 1;
+    }
+    tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+    ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+    tsi_test_frame_protector_config_destroy(ssl_fixture->base.config);
+    ssl_fixture->base.config = tsi_test_frame_protector_config_create(
+        bit_array[0], bit_array[1], bit_array[2], bit_array[3], bit_array[4],
+        bit_array[5], bit_array[6], bit_array[7]);
+    tsi_test_do_round_trip(&ssl_fixture->base);
+    tsi_test_fixture_destroy(fixture);
+  }
+  gpr_free(bit_array);
+}
+
+void ssl_tsi_test_do_round_trip_odd_buffer_size() {
+  const size_t odd_sizes[] = {1025, 2051, 4103, 8207, 16409};
+  const size_t size = sizeof(odd_sizes) / sizeof(size_t);
+  for (size_t ind1 = 0; ind1 < size; ind1++) {
+    for (size_t ind2 = 0; ind2 < size; ind2++) {
+      for (size_t ind3 = 0; ind3 < size; ind3++) {
+        for (size_t ind4 = 0; ind4 < size; ind4++) {
+          for (size_t ind5 = 0; ind5 < size; ind5++) {
+            tsi_test_fixture* fixture = ssl_tsi_test_fixture_create();
+            ssl_tsi_test_fixture* ssl_fixture = (ssl_tsi_test_fixture*)fixture;
+            tsi_test_frame_protector_config_set_buffer_size(
+                ssl_fixture->base.config, odd_sizes[ind1], odd_sizes[ind2],
+                odd_sizes[ind3], odd_sizes[ind4], odd_sizes[ind5]);
+            tsi_test_do_round_trip(&ssl_fixture->base);
+            tsi_test_fixture_destroy(fixture);
+          }
+        }
+      }
+    }
+  }
+}
+
+static const tsi_ssl_handshaker_factory_vtable* original_vtable;
+static bool handshaker_factory_destructor_called;
+
+static void ssl_tsi_test_handshaker_factory_destructor(
+    tsi_ssl_handshaker_factory* factory) {
+  GPR_ASSERT(factory != NULL);
+  handshaker_factory_destructor_called = true;
+  if (original_vtable != NULL && original_vtable->destroy != NULL) {
+    original_vtable->destroy(factory);
+  }
+}
+
+static tsi_ssl_handshaker_factory_vtable test_handshaker_factory_vtable = {
+    ssl_tsi_test_handshaker_factory_destructor};
+
+void test_tsi_ssl_client_handshaker_factory_refcounting() {
+  int i;
+  const char* cert_chain =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "client.pem");
+
+  tsi_ssl_client_handshaker_factory* client_handshaker_factory;
+  GPR_ASSERT(tsi_create_ssl_client_handshaker_factory(
+                 NULL, cert_chain, NULL, NULL, 0, &client_handshaker_factory) ==
+             TSI_OK);
+
+  handshaker_factory_destructor_called = false;
+  original_vtable = tsi_ssl_handshaker_factory_swap_vtable(
+      (tsi_ssl_handshaker_factory*)client_handshaker_factory,
+      &test_handshaker_factory_vtable);
+
+  tsi_handshaker* handshaker[3];
+
+  for (i = 0; i < 3; ++i) {
+    GPR_ASSERT(tsi_ssl_client_handshaker_factory_create_handshaker(
+                   client_handshaker_factory, "google.com", &handshaker[i]) ==
+               TSI_OK);
+  }
+
+  tsi_handshaker_destroy(handshaker[1]);
+  GPR_ASSERT(!handshaker_factory_destructor_called);
+
+  tsi_handshaker_destroy(handshaker[0]);
+  GPR_ASSERT(!handshaker_factory_destructor_called);
+
+  tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory);
+  GPR_ASSERT(!handshaker_factory_destructor_called);
+
+  tsi_handshaker_destroy(handshaker[2]);
+  GPR_ASSERT(handshaker_factory_destructor_called);
+
+  gpr_free((void*)cert_chain);
+}
+
+void test_tsi_ssl_server_handshaker_factory_refcounting() {
+  int i;
+  tsi_ssl_server_handshaker_factory* server_handshaker_factory;
+  tsi_handshaker* handshaker[3];
+  const char* cert_chain =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.pem");
+  tsi_ssl_pem_key_cert_pair cert_pair;
+
+  cert_pair.cert_chain = cert_chain;
+  cert_pair.private_key =
+      load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.key");
+
+  GPR_ASSERT(tsi_create_ssl_server_handshaker_factory(
+                 &cert_pair, 1, cert_chain, 0, NULL, NULL, 0,
+                 &server_handshaker_factory) == TSI_OK);
+
+  handshaker_factory_destructor_called = false;
+  original_vtable = tsi_ssl_handshaker_factory_swap_vtable(
+      (tsi_ssl_handshaker_factory*)server_handshaker_factory,
+      &test_handshaker_factory_vtable);
+
+  for (i = 0; i < 3; ++i) {
+    GPR_ASSERT(tsi_ssl_server_handshaker_factory_create_handshaker(
+                   server_handshaker_factory, &handshaker[i]) == TSI_OK);
+  }
+
+  tsi_handshaker_destroy(handshaker[1]);
+  GPR_ASSERT(!handshaker_factory_destructor_called);
+
+  tsi_handshaker_destroy(handshaker[0]);
+  GPR_ASSERT(!handshaker_factory_destructor_called);
+
+  tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory);
+  GPR_ASSERT(!handshaker_factory_destructor_called);
+
+  tsi_handshaker_destroy(handshaker[2]);
+  GPR_ASSERT(handshaker_factory_destructor_called);
+
+  ssl_test_pem_key_cert_pair_destroy(cert_pair);
+}
+
+/* Attempting to create a handshaker factory with invalid parameters should fail
+ * but not crash. */
+void test_tsi_ssl_client_handshaker_factory_bad_params() {
+  const char* cert_chain = "This is not a valid PEM file.";
+
+  tsi_ssl_client_handshaker_factory* client_handshaker_factory;
+  GPR_ASSERT(tsi_create_ssl_client_handshaker_factory(
+                 NULL, cert_chain, NULL, NULL, 0, &client_handshaker_factory) ==
+             TSI_INVALID_ARGUMENT);
+  tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory);
+}
+
+void ssl_tsi_test_handshaker_factory_internals() {
+  test_tsi_ssl_client_handshaker_factory_refcounting();
+  test_tsi_ssl_server_handshaker_factory_refcounting();
+  test_tsi_ssl_client_handshaker_factory_bad_params();
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  grpc_init();
+  ssl_tsi_test_do_handshake_tiny_handshake_buffer();
+  ssl_tsi_test_do_handshake_small_handshake_buffer();
+  ssl_tsi_test_do_handshake();
+  ssl_tsi_test_do_handshake_with_client_authentication();
+  ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain();
+  ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain();
+  ssl_tsi_test_do_handshake_with_bad_server_cert();
+  ssl_tsi_test_do_handshake_with_bad_client_cert();
+  ssl_tsi_test_do_handshake_alpn_client_no_server();
+  ssl_tsi_test_do_handshake_alpn_server_no_client();
+  ssl_tsi_test_do_handshake_alpn_client_server_mismatch();
+  ssl_tsi_test_do_handshake_alpn_client_server_ok();
+  ssl_tsi_test_do_round_trip_for_all_configs();
+  ssl_tsi_test_do_round_trip_odd_buffer_size();
+  ssl_tsi_test_handshaker_factory_internals();
+  grpc_shutdown();
+  return 0;
+}
diff --git a/test/core/tsi/transport_security_test.c b/test/core/tsi/transport_security_test.c
deleted file mode 100644
index 27932a8..0000000
--- a/test/core/tsi/transport_security_test.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/tsi/transport_security.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/useful.h>
-
-#include <openssl/crypto.h>
-
-#include "src/core/lib/support/string.h"
-#include "src/core/tsi/fake_transport_security.h"
-#include "src/core/tsi/ssl_transport_security.h"
-#include "test/core/util/test_config.h"
-
-typedef struct {
-  /* 1 if success, 0 if failure. */
-  int expected;
-
-  /* Host name to match. */
-  const char *host_name;
-
-  /* Common name (CN). */
-  const char *common_name;
-
-  /* Comma separated list of certificate names to match against. Any occurrence
-     of '#' will be replaced with a null character before processing. */
-  const char *dns_names;
-
-  /* Comma separated list of IP SANs to match aggainst */
-  const char *ip_names;
-} cert_name_test_entry;
-
-/* Largely inspired from:
-   chromium/src/net/cert/x509_certificate_unittest.cc.
-   TODO(jboeuf) uncomment test cases as we fix tsi_ssl_peer_matches_name. */
-const cert_name_test_entry cert_name_test_entries[] = {
-    {1, "foo.com", "foo.com", NULL, NULL},
-    {1, "f", "f", NULL, NULL},
-    {0, "h", "i", NULL, NULL},
-    {1, "bar.foo.com", "*.foo.com", NULL, NULL},
-    {1, "www.test.fr", "common.name",
-     "*.test.com,*.test.co.uk,*.test.de,*.test.fr", NULL},
-    /*
-       {1, "wwW.tESt.fr", "common.name", ",*.*,*.test.de,*.test.FR,www"},
-     */
-    {0, "f.uk", ".uk", NULL, NULL},
-    {0, "w.bar.foo.com", "?.bar.foo.com", NULL, NULL},
-    {0, "www.foo.com", "(www|ftp).foo.com", NULL, NULL},
-    {0, "www.foo.com", "www.foo.com#", NULL, NULL}, /* # = null char. */
-    {0, "www.foo.com", "", "www.foo.com#*.foo.com,#,#", NULL},
-    {0, "www.house.example", "ww.house.example", NULL, NULL},
-    {0, "test.org", "", "www.test.org,*.test.org,*.org", NULL},
-    {0, "w.bar.foo.com", "w*.bar.foo.com", NULL, NULL},
-    {0, "www.bar.foo.com", "ww*ww.bar.foo.com", NULL, NULL},
-    {0, "wwww.bar.foo.com", "ww*ww.bar.foo.com", NULL, NULL},
-    {0, "wwww.bar.foo.com", "w*w.bar.foo.com", NULL, NULL},
-    {0, "wwww.bar.foo.com", "w*w.bar.foo.c0m", NULL, NULL},
-    {0, "WALLY.bar.foo.com", "wa*.bar.foo.com", NULL, NULL},
-    {0, "wally.bar.foo.com", "*Ly.bar.foo.com", NULL, NULL},
-    /*
-       {1, "ww%57.foo.com", "", "www.foo.com"},
-       {1, "www&.foo.com", "www%26.foo.com", NULL},
-     */
-
-    /* Common name must not be used if subject alternative name was provided. */
-    {0, "www.test.co.jp", "www.test.co.jp",
-     "*.test.de,*.jp,www.test.co.uk,www.*.co.jp", NULL},
-    {0, "www.bar.foo.com", "www.bar.foo.com",
-     "*.foo.com,*.*.foo.com,*.*.bar.foo.com,*..bar.foo.com,", NULL},
-
-    /* IDN tests */
-    {1, "xn--poema-9qae5a.com.br", "xn--poema-9qae5a.com.br", NULL, NULL},
-    {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", NULL, NULL},
-    {0, "xn--poema-9qae5a.com.br", "",
-     "*.xn--poema-9qae5a.com.br,"
-     "xn--poema-*.com.br,"
-     "xn--*-9qae5a.com.br,"
-     "*--poema-9qae5a.com.br",
-     NULL},
-
-    /* The following are adapted from the  examples quoted from
-       http://tools.ietf.org/html/rfc6125#section-6.4.3
-       (e.g., *.example.com would match foo.example.com but
-       not bar.foo.example.com or example.com). */
-    {1, "foo.example.com", "*.example.com", NULL, NULL},
-    {0, "bar.foo.example.com", "*.example.com", NULL, NULL},
-    {0, "example.com", "*.example.com", NULL, NULL},
-
-    /* Partial wildcards are disallowed, though RFC 2818 rules allow them.
-       That is, forms such as baz*.example.net, *baz.example.net, and
-       b*z.example.net should NOT match domains. Instead, the wildcard must
-       always be the left-most label, and only a single label. */
-    {0, "baz1.example.net", "baz*.example.net", NULL, NULL},
-    {0, "foobaz.example.net", "*baz.example.net", NULL, NULL},
-    {0, "buzz.example.net", "b*z.example.net", NULL, NULL},
-    {0, "www.test.example.net", "www.*.example.net", NULL, NULL},
-
-    /* Wildcards should not be valid for public registry controlled domains,
-       and unknown/unrecognized domains, at least three domain components must
-       be present. */
-    {1, "www.test.example", "*.test.example", NULL, NULL},
-    {1, "test.example.co.uk", "*.example.co.uk", NULL, NULL},
-    {0, "test.example", "*.example", NULL, NULL},
-    /*
-       {0, "example.co.uk", "*.co.uk", NULL},
-     */
-    {0, "foo.com", "*.com", NULL, NULL},
-    {0, "foo.us", "*.us", NULL, NULL},
-    {0, "foo", "*", NULL, NULL},
-
-    /* IDN variants of wildcards and registry controlled domains. */
-    {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", NULL, NULL},
-    {1, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h", NULL, NULL},
-    /*
-       {0, "xn--poema-9qae5a.com.br", "*.com.br", NULL},
-     */
-    {0, "example.xn--mgbaam7a8h", "*.xn--mgbaam7a8h", NULL, NULL},
-
-    /* Wildcards should be permissible for 'private' registry controlled
-       domains. */
-    {1, "www.appspot.com", "*.appspot.com", NULL, NULL},
-    {1, "foo.s3.amazonaws.com", "*.s3.amazonaws.com", NULL, NULL},
-
-    /* Multiple wildcards are not valid. */
-    {0, "foo.example.com", "*.*.com", NULL, NULL},
-    {0, "foo.bar.example.com", "*.bar.*.com", NULL, NULL},
-
-    /* Absolute vs relative DNS name tests. Although not explicitly specified
-       in RFC 6125, absolute reference names (those ending in a .) should
-       match either absolute or relative presented names. */
-    {1, "foo.com", "foo.com.", NULL, NULL},
-    {1, "foo.com.", "foo.com", NULL, NULL},
-    {1, "foo.com.", "foo.com.", NULL, NULL},
-    {1, "f", "f.", NULL, NULL},
-    {1, "f.", "f", NULL, NULL},
-    {1, "f.", "f.", NULL, NULL},
-    {1, "www-3.bar.foo.com", "*.bar.foo.com.", NULL, NULL},
-    {1, "www-3.bar.foo.com.", "*.bar.foo.com", NULL, NULL},
-    {1, "www-3.bar.foo.com.", "*.bar.foo.com.", NULL, NULL},
-    {0, ".", ".", NULL, NULL},
-    {0, "example.com", "*.com.", NULL, NULL},
-    {0, "example.com.", "*.com", NULL, NULL},
-    {0, "example.com.", "*.com.", NULL, NULL},
-    {0, "foo.", "*.", NULL, NULL},
-    {0, "foo", "*.", NULL, NULL},
-    /*
-       {0, "foo.co.uk", "*.co.uk.", NULL},
-       {0, "foo.co.uk.", "*.co.uk.", NULL},
-     */
-
-    /* An empty CN is OK. */
-    {1, "test.foo.com", "", "test.foo.com", NULL},
-
-    /* An IP should not be used for the CN. */
-    {0, "173.194.195.139", "173.194.195.139", NULL, NULL},
-    /* An IP can be used if the SAN IP is present */
-    {1, "173.194.195.139", "foo.example.com", NULL, "173.194.195.139"},
-    {0, "173.194.195.139", "foo.example.com", NULL, "8.8.8.8"},
-    {0, "173.194.195.139", "foo.example.com", NULL, "8.8.8.8,8.8.4.4"},
-    {1, "173.194.195.139", "foo.example.com", NULL, "8.8.8.8,173.194.195.139"},
-    {0, "173.194.195.139", "foo.example.com", NULL, "173.194.195.13"},
-    {0, "2001:db8:a0b:12f0::1", "foo.example.com", NULL, "173.194.195.13"},
-    {1, "2001:db8:a0b:12f0::1", "foo.example.com", NULL,
-     "2001:db8:a0b:12f0::1"},
-    {0, "2001:db8:a0b:12f0::1", "foo.example.com", NULL,
-     "2001:db8:a0b:12f0::2"},
-    {1, "2001:db8:a0b:12f0::1", "foo.example.com", NULL,
-     "2001:db8:a0b:12f0::2,2001:db8:a0b:12f0::1,8.8.8.8"},
-};
-
-typedef struct name_list {
-  const char *name;
-  struct name_list *next;
-} name_list;
-
-typedef struct {
-  size_t name_count;
-  char *buffer;
-  name_list *names;
-} parsed_names;
-
-name_list *name_list_add(const char *n) {
-  name_list *result = gpr_malloc(sizeof(name_list));
-  result->name = n;
-  result->next = NULL;
-  return result;
-}
-
-static parsed_names parse_names(const char *names_str) {
-  parsed_names result;
-  name_list *current_nl;
-  size_t i;
-  memset(&result, 0, sizeof(parsed_names));
-  if (names_str == 0) return result;
-  result.name_count = 1;
-  result.buffer = gpr_strdup(names_str);
-  result.names = name_list_add(result.buffer);
-  current_nl = result.names;
-  for (i = 0; i < strlen(names_str); i++) {
-    if (names_str[i] == ',') {
-      result.buffer[i] = '\0';
-      result.name_count++;
-      i++;
-      current_nl->next = name_list_add(result.buffer + i);
-      current_nl = current_nl->next;
-    }
-  }
-  return result;
-}
-
-static void destruct_parsed_names(parsed_names *pdn) {
-  name_list *nl = pdn->names;
-  if (pdn->buffer != NULL) gpr_free(pdn->buffer);
-  while (nl != NULL) {
-    name_list *to_be_free = nl;
-    nl = nl->next;
-    gpr_free(to_be_free);
-  }
-}
-
-static char *processed_name(const char *name) {
-  char *result = gpr_strdup(name);
-  size_t i;
-  for (i = 0; i < strlen(result); i++) {
-    if (result[i] == '#') {
-      result[i] = '\0';
-    }
-  }
-  return result;
-}
-
-static tsi_peer peer_from_cert_name_test_entry(
-    const cert_name_test_entry *entry) {
-  size_t i;
-  tsi_peer peer;
-  name_list *nl;
-  parsed_names dns_entries = parse_names(entry->dns_names);
-  parsed_names ip_entries = parse_names(entry->ip_names);
-  nl = dns_entries.names;
-  GPR_ASSERT(tsi_construct_peer(
-                 1 + dns_entries.name_count + ip_entries.name_count, &peer) ==
-             TSI_OK);
-  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
-                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, entry->common_name,
-                 &peer.properties[0]) == TSI_OK);
-  i = 1;
-  while (nl != NULL) {
-    char *processed = processed_name(nl->name);
-    GPR_ASSERT(tsi_construct_string_peer_property(
-                   TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, processed,
-                   strlen(nl->name), &peer.properties[i++]) == TSI_OK);
-    nl = nl->next;
-    gpr_free(processed);
-  }
-
-  nl = ip_entries.names;
-  while (nl != NULL) {
-    char *processed = processed_name(nl->name);
-    GPR_ASSERT(tsi_construct_string_peer_property(
-                   TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, processed,
-                   strlen(nl->name), &peer.properties[i++]) == TSI_OK);
-    nl = nl->next;
-    gpr_free(processed);
-  }
-  destruct_parsed_names(&dns_entries);
-  destruct_parsed_names(&ip_entries);
-  return peer;
-}
-
-char *cert_name_test_entry_to_string(const cert_name_test_entry *entry) {
-  char *s;
-  gpr_asprintf(&s,
-               "{ success = %s, host_name = %s, common_name = %s, dns_names = "
-               "%s, ip_names = %s}",
-               entry->expected ? "true" : "false", entry->host_name,
-               entry->common_name,
-               entry->dns_names != NULL ? entry->dns_names : "",
-               entry->ip_names != NULL ? entry->ip_names : "");
-  return s;
-}
-
-static void test_peer_matches_name(void) {
-  size_t i = 0;
-  for (i = 0; i < GPR_ARRAY_SIZE(cert_name_test_entries); i++) {
-    const cert_name_test_entry *entry = &cert_name_test_entries[i];
-    tsi_peer peer = peer_from_cert_name_test_entry(entry);
-    int result = tsi_ssl_peer_matches_name(&peer, entry->host_name);
-    if (result != entry->expected) {
-      char *entry_str = cert_name_test_entry_to_string(entry);
-      gpr_log(GPR_ERROR, "%s", entry_str);
-      gpr_free(entry_str);
-      GPR_ASSERT(0); /* Unexpected result. */
-    }
-    tsi_peer_destruct(&peer);
-  }
-}
-
-typedef struct {
-  tsi_result res;
-  const char *str;
-} tsi_result_string_pair;
-
-static void test_result_strings(void) {
-  const tsi_result_string_pair results[] = {
-      {TSI_OK, "TSI_OK"},
-      {TSI_UNKNOWN_ERROR, "TSI_UNKNOWN_ERROR"},
-      {TSI_INVALID_ARGUMENT, "TSI_INVALID_ARGUMENT"},
-      {TSI_PERMISSION_DENIED, "TSI_PERMISSION_DENIED"},
-      {TSI_INCOMPLETE_DATA, "TSI_INCOMPLETE_DATA"},
-      {TSI_FAILED_PRECONDITION, "TSI_FAILED_PRECONDITION"},
-      {TSI_UNIMPLEMENTED, "TSI_UNIMPLEMENTED"},
-      {TSI_INTERNAL_ERROR, "TSI_INTERNAL_ERROR"},
-      {TSI_DATA_CORRUPTED, "TSI_DATA_CORRUPTED"},
-      {TSI_NOT_FOUND, "TSI_NOT_FOUND"},
-      {TSI_PROTOCOL_FAILURE, "TSI_PROTOCOL_FAILURE"},
-      {TSI_HANDSHAKE_IN_PROGRESS, "TSI_HANDSHAKE_IN_PROGRESS"},
-      {TSI_OUT_OF_RESOURCES, "TSI_OUT_OF_RESOURCES"}};
-  size_t i;
-  for (i = 0; i < GPR_ARRAY_SIZE(results); i++) {
-    GPR_ASSERT(strcmp(results[i].str, tsi_result_to_string(results[i].res)) ==
-               0);
-  }
-  GPR_ASSERT(strcmp("UNKNOWN", tsi_result_to_string((tsi_result)42)) == 0);
-}
-
-static void test_protector_invalid_args(void) {
-  GPR_ASSERT(tsi_frame_protector_protect(NULL, NULL, NULL, NULL, NULL) ==
-             TSI_INVALID_ARGUMENT);
-  GPR_ASSERT(tsi_frame_protector_protect_flush(NULL, NULL, NULL, NULL) ==
-             TSI_INVALID_ARGUMENT);
-  GPR_ASSERT(tsi_frame_protector_unprotect(NULL, NULL, NULL, NULL, NULL) ==
-             TSI_INVALID_ARGUMENT);
-}
-
-static void test_handshaker_invalid_args(void) {
-  GPR_ASSERT(tsi_handshaker_get_result(NULL) == TSI_INVALID_ARGUMENT);
-  GPR_ASSERT(tsi_handshaker_extract_peer(NULL, NULL) == TSI_INVALID_ARGUMENT);
-  GPR_ASSERT(tsi_handshaker_create_frame_protector(NULL, NULL, NULL) ==
-             TSI_INVALID_ARGUMENT);
-  GPR_ASSERT(tsi_handshaker_process_bytes_from_peer(NULL, NULL, NULL) ==
-             TSI_INVALID_ARGUMENT);
-  GPR_ASSERT(tsi_handshaker_get_bytes_to_send_to_peer(NULL, NULL, NULL) ==
-             TSI_INVALID_ARGUMENT);
-  GPR_ASSERT(tsi_handshaker_next(NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL) ==
-             TSI_INVALID_ARGUMENT);
-}
-
-static void test_handshaker_invalid_state(void) {
-  tsi_handshaker *h = tsi_create_fake_handshaker(0);
-  tsi_peer peer;
-  tsi_frame_protector *p;
-  GPR_ASSERT(tsi_handshaker_extract_peer(h, &peer) == TSI_FAILED_PRECONDITION);
-  GPR_ASSERT(tsi_handshaker_create_frame_protector(h, NULL, &p) ==
-             TSI_FAILED_PRECONDITION);
-  tsi_handshaker_destroy(h);
-}
-
-int main(int argc, char **argv) {
-  grpc_test_init(argc, argv);
-  test_peer_matches_name();
-  test_result_strings();
-  test_protector_invalid_args();
-  test_handshaker_invalid_args();
-  test_handshaker_invalid_state();
-  return 0;
-}
diff --git a/test/core/tsi/transport_security_test.cc b/test/core/tsi/transport_security_test.cc
new file mode 100644
index 0000000..39adf2f
--- /dev/null
+++ b/test/core/tsi/transport_security_test.cc
@@ -0,0 +1,386 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/tsi/transport_security.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/useful.h>
+
+#include <openssl/crypto.h>
+
+#include "src/core/lib/support/string.h"
+#include "src/core/tsi/fake_transport_security.h"
+#include "src/core/tsi/ssl_transport_security.h"
+#include "test/core/util/test_config.h"
+
+typedef struct {
+  /* 1 if success, 0 if failure. */
+  int expected;
+
+  /* Host name to match. */
+  const char* host_name;
+
+  /* Common name (CN). */
+  const char* common_name;
+
+  /* Comma separated list of certificate names to match against. Any occurrence
+     of '#' will be replaced with a null character before processing. */
+  const char* dns_names;
+
+  /* Comma separated list of IP SANs to match aggainst */
+  const char* ip_names;
+} cert_name_test_entry;
+
+/* Largely inspired from:
+   chromium/src/net/cert/x509_certificate_unittest.cc.
+   TODO(jboeuf) uncomment test cases as we fix tsi_ssl_peer_matches_name. */
+const cert_name_test_entry cert_name_test_entries[] = {
+    {1, "foo.com", "foo.com", NULL, NULL},
+    {1, "f", "f", NULL, NULL},
+    {0, "h", "i", NULL, NULL},
+    {1, "bar.foo.com", "*.foo.com", NULL, NULL},
+    {1, "www.test.fr", "common.name",
+     "*.test.com,*.test.co.uk,*.test.de,*.test.fr", NULL},
+    /*
+       {1, "wwW.tESt.fr", "common.name", ",*.*,*.test.de,*.test.FR,www"},
+     */
+    {0, "f.uk", ".uk", NULL, NULL},
+    {0, "w.bar.foo.com", "?.bar.foo.com", NULL, NULL},
+    {0, "www.foo.com", "(www|ftp).foo.com", NULL, NULL},
+    {0, "www.foo.com", "www.foo.com#", NULL, NULL}, /* # = null char. */
+    {0, "www.foo.com", "", "www.foo.com#*.foo.com,#,#", NULL},
+    {0, "www.house.example", "ww.house.example", NULL, NULL},
+    {0, "test.org", "", "www.test.org,*.test.org,*.org", NULL},
+    {0, "w.bar.foo.com", "w*.bar.foo.com", NULL, NULL},
+    {0, "www.bar.foo.com", "ww*ww.bar.foo.com", NULL, NULL},
+    {0, "wwww.bar.foo.com", "ww*ww.bar.foo.com", NULL, NULL},
+    {0, "wwww.bar.foo.com", "w*w.bar.foo.com", NULL, NULL},
+    {0, "wwww.bar.foo.com", "w*w.bar.foo.c0m", NULL, NULL},
+    {0, "WALLY.bar.foo.com", "wa*.bar.foo.com", NULL, NULL},
+    {0, "wally.bar.foo.com", "*Ly.bar.foo.com", NULL, NULL},
+    /*
+       {1, "ww%57.foo.com", "", "www.foo.com"},
+       {1, "www&.foo.com", "www%26.foo.com", NULL},
+     */
+
+    /* Common name must not be used if subject alternative name was provided. */
+    {0, "www.test.co.jp", "www.test.co.jp",
+     "*.test.de,*.jp,www.test.co.uk,www.*.co.jp", NULL},
+    {0, "www.bar.foo.com", "www.bar.foo.com",
+     "*.foo.com,*.*.foo.com,*.*.bar.foo.com,*..bar.foo.com,", NULL},
+
+    /* IDN tests */
+    {1, "xn--poema-9qae5a.com.br", "xn--poema-9qae5a.com.br", NULL, NULL},
+    {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", NULL, NULL},
+    {0, "xn--poema-9qae5a.com.br", "",
+     "*.xn--poema-9qae5a.com.br,"
+     "xn--poema-*.com.br,"
+     "xn--*-9qae5a.com.br,"
+     "*--poema-9qae5a.com.br",
+     NULL},
+
+    /* The following are adapted from the  examples quoted from
+       http://tools.ietf.org/html/rfc6125#section-6.4.3
+       (e.g., *.example.com would match foo.example.com but
+       not bar.foo.example.com or example.com). */
+    {1, "foo.example.com", "*.example.com", NULL, NULL},
+    {0, "bar.foo.example.com", "*.example.com", NULL, NULL},
+    {0, "example.com", "*.example.com", NULL, NULL},
+
+    /* Partial wildcards are disallowed, though RFC 2818 rules allow them.
+       That is, forms such as baz*.example.net, *baz.example.net, and
+       b*z.example.net should NOT match domains. Instead, the wildcard must
+       always be the left-most label, and only a single label. */
+    {0, "baz1.example.net", "baz*.example.net", NULL, NULL},
+    {0, "foobaz.example.net", "*baz.example.net", NULL, NULL},
+    {0, "buzz.example.net", "b*z.example.net", NULL, NULL},
+    {0, "www.test.example.net", "www.*.example.net", NULL, NULL},
+
+    /* Wildcards should not be valid for public registry controlled domains,
+       and unknown/unrecognized domains, at least three domain components must
+       be present. */
+    {1, "www.test.example", "*.test.example", NULL, NULL},
+    {1, "test.example.co.uk", "*.example.co.uk", NULL, NULL},
+    {0, "test.example", "*.example", NULL, NULL},
+    /*
+       {0, "example.co.uk", "*.co.uk", NULL},
+     */
+    {0, "foo.com", "*.com", NULL, NULL},
+    {0, "foo.us", "*.us", NULL, NULL},
+    {0, "foo", "*", NULL, NULL},
+
+    /* IDN variants of wildcards and registry controlled domains. */
+    {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", NULL, NULL},
+    {1, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h", NULL, NULL},
+    /*
+       {0, "xn--poema-9qae5a.com.br", "*.com.br", NULL},
+     */
+    {0, "example.xn--mgbaam7a8h", "*.xn--mgbaam7a8h", NULL, NULL},
+
+    /* Wildcards should be permissible for 'private' registry controlled
+       domains. */
+    {1, "www.appspot.com", "*.appspot.com", NULL, NULL},
+    {1, "foo.s3.amazonaws.com", "*.s3.amazonaws.com", NULL, NULL},
+
+    /* Multiple wildcards are not valid. */
+    {0, "foo.example.com", "*.*.com", NULL, NULL},
+    {0, "foo.bar.example.com", "*.bar.*.com", NULL, NULL},
+
+    /* Absolute vs relative DNS name tests. Although not explicitly specified
+       in RFC 6125, absolute reference names (those ending in a .) should
+       match either absolute or relative presented names. */
+    {1, "foo.com", "foo.com.", NULL, NULL},
+    {1, "foo.com.", "foo.com", NULL, NULL},
+    {1, "foo.com.", "foo.com.", NULL, NULL},
+    {1, "f", "f.", NULL, NULL},
+    {1, "f.", "f", NULL, NULL},
+    {1, "f.", "f.", NULL, NULL},
+    {1, "www-3.bar.foo.com", "*.bar.foo.com.", NULL, NULL},
+    {1, "www-3.bar.foo.com.", "*.bar.foo.com", NULL, NULL},
+    {1, "www-3.bar.foo.com.", "*.bar.foo.com.", NULL, NULL},
+    {0, ".", ".", NULL, NULL},
+    {0, "example.com", "*.com.", NULL, NULL},
+    {0, "example.com.", "*.com", NULL, NULL},
+    {0, "example.com.", "*.com.", NULL, NULL},
+    {0, "foo.", "*.", NULL, NULL},
+    {0, "foo", "*.", NULL, NULL},
+    /*
+       {0, "foo.co.uk", "*.co.uk.", NULL},
+       {0, "foo.co.uk.", "*.co.uk.", NULL},
+     */
+
+    /* An empty CN is OK. */
+    {1, "test.foo.com", "", "test.foo.com", NULL},
+
+    /* An IP should not be used for the CN. */
+    {0, "173.194.195.139", "173.194.195.139", NULL, NULL},
+    /* An IP can be used if the SAN IP is present */
+    {1, "173.194.195.139", "foo.example.com", NULL, "173.194.195.139"},
+    {0, "173.194.195.139", "foo.example.com", NULL, "8.8.8.8"},
+    {0, "173.194.195.139", "foo.example.com", NULL, "8.8.8.8,8.8.4.4"},
+    {1, "173.194.195.139", "foo.example.com", NULL, "8.8.8.8,173.194.195.139"},
+    {0, "173.194.195.139", "foo.example.com", NULL, "173.194.195.13"},
+    {0, "2001:db8:a0b:12f0::1", "foo.example.com", NULL, "173.194.195.13"},
+    {1, "2001:db8:a0b:12f0::1", "foo.example.com", NULL,
+     "2001:db8:a0b:12f0::1"},
+    {0, "2001:db8:a0b:12f0::1", "foo.example.com", NULL,
+     "2001:db8:a0b:12f0::2"},
+    {1, "2001:db8:a0b:12f0::1", "foo.example.com", NULL,
+     "2001:db8:a0b:12f0::2,2001:db8:a0b:12f0::1,8.8.8.8"},
+};
+
+typedef struct name_list {
+  const char* name;
+  struct name_list* next;
+} name_list;
+
+typedef struct {
+  size_t name_count;
+  char* buffer;
+  name_list* names;
+} parsed_names;
+
+name_list* name_list_add(const char* n) {
+  name_list* result = static_cast<name_list*>(gpr_malloc(sizeof(name_list)));
+  result->name = n;
+  result->next = NULL;
+  return result;
+}
+
+static parsed_names parse_names(const char* names_str) {
+  parsed_names result;
+  name_list* current_nl;
+  size_t i;
+  memset(&result, 0, sizeof(parsed_names));
+  if (names_str == 0) return result;
+  result.name_count = 1;
+  result.buffer = gpr_strdup(names_str);
+  result.names = name_list_add(result.buffer);
+  current_nl = result.names;
+  for (i = 0; i < strlen(names_str); i++) {
+    if (names_str[i] == ',') {
+      result.buffer[i] = '\0';
+      result.name_count++;
+      i++;
+      current_nl->next = name_list_add(result.buffer + i);
+      current_nl = current_nl->next;
+    }
+  }
+  return result;
+}
+
+static void destruct_parsed_names(parsed_names* pdn) {
+  name_list* nl = pdn->names;
+  if (pdn->buffer != NULL) gpr_free(pdn->buffer);
+  while (nl != NULL) {
+    name_list* to_be_free = nl;
+    nl = nl->next;
+    gpr_free(to_be_free);
+  }
+}
+
+static char* processed_name(const char* name) {
+  char* result = gpr_strdup(name);
+  size_t i;
+  for (i = 0; i < strlen(result); i++) {
+    if (result[i] == '#') {
+      result[i] = '\0';
+    }
+  }
+  return result;
+}
+
+static tsi_peer peer_from_cert_name_test_entry(
+    const cert_name_test_entry* entry) {
+  size_t i;
+  tsi_peer peer;
+  name_list* nl;
+  parsed_names dns_entries = parse_names(entry->dns_names);
+  parsed_names ip_entries = parse_names(entry->ip_names);
+  nl = dns_entries.names;
+  GPR_ASSERT(tsi_construct_peer(
+                 1 + dns_entries.name_count + ip_entries.name_count, &peer) ==
+             TSI_OK);
+  GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+                 TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, entry->common_name,
+                 &peer.properties[0]) == TSI_OK);
+  i = 1;
+  while (nl != NULL) {
+    char* processed = processed_name(nl->name);
+    GPR_ASSERT(tsi_construct_string_peer_property(
+                   TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, processed,
+                   strlen(nl->name), &peer.properties[i++]) == TSI_OK);
+    nl = nl->next;
+    gpr_free(processed);
+  }
+
+  nl = ip_entries.names;
+  while (nl != NULL) {
+    char* processed = processed_name(nl->name);
+    GPR_ASSERT(tsi_construct_string_peer_property(
+                   TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, processed,
+                   strlen(nl->name), &peer.properties[i++]) == TSI_OK);
+    nl = nl->next;
+    gpr_free(processed);
+  }
+  destruct_parsed_names(&dns_entries);
+  destruct_parsed_names(&ip_entries);
+  return peer;
+}
+
+char* cert_name_test_entry_to_string(const cert_name_test_entry* entry) {
+  char* s;
+  gpr_asprintf(&s,
+               "{ success = %s, host_name = %s, common_name = %s, dns_names = "
+               "%s, ip_names = %s}",
+               entry->expected ? "true" : "false", entry->host_name,
+               entry->common_name,
+               entry->dns_names != NULL ? entry->dns_names : "",
+               entry->ip_names != NULL ? entry->ip_names : "");
+  return s;
+}
+
+static void test_peer_matches_name(void) {
+  size_t i = 0;
+  for (i = 0; i < GPR_ARRAY_SIZE(cert_name_test_entries); i++) {
+    const cert_name_test_entry* entry = &cert_name_test_entries[i];
+    tsi_peer peer = peer_from_cert_name_test_entry(entry);
+    int result = tsi_ssl_peer_matches_name(&peer, entry->host_name);
+    if (result != entry->expected) {
+      char* entry_str = cert_name_test_entry_to_string(entry);
+      gpr_log(GPR_ERROR, "%s", entry_str);
+      gpr_free(entry_str);
+      GPR_ASSERT(0); /* Unexpected result. */
+    }
+    tsi_peer_destruct(&peer);
+  }
+}
+
+typedef struct {
+  tsi_result res;
+  const char* str;
+} tsi_result_string_pair;
+
+static void test_result_strings(void) {
+  const tsi_result_string_pair results[] = {
+      {TSI_OK, "TSI_OK"},
+      {TSI_UNKNOWN_ERROR, "TSI_UNKNOWN_ERROR"},
+      {TSI_INVALID_ARGUMENT, "TSI_INVALID_ARGUMENT"},
+      {TSI_PERMISSION_DENIED, "TSI_PERMISSION_DENIED"},
+      {TSI_INCOMPLETE_DATA, "TSI_INCOMPLETE_DATA"},
+      {TSI_FAILED_PRECONDITION, "TSI_FAILED_PRECONDITION"},
+      {TSI_UNIMPLEMENTED, "TSI_UNIMPLEMENTED"},
+      {TSI_INTERNAL_ERROR, "TSI_INTERNAL_ERROR"},
+      {TSI_DATA_CORRUPTED, "TSI_DATA_CORRUPTED"},
+      {TSI_NOT_FOUND, "TSI_NOT_FOUND"},
+      {TSI_PROTOCOL_FAILURE, "TSI_PROTOCOL_FAILURE"},
+      {TSI_HANDSHAKE_IN_PROGRESS, "TSI_HANDSHAKE_IN_PROGRESS"},
+      {TSI_OUT_OF_RESOURCES, "TSI_OUT_OF_RESOURCES"}};
+  size_t i;
+  for (i = 0; i < GPR_ARRAY_SIZE(results); i++) {
+    GPR_ASSERT(strcmp(results[i].str, tsi_result_to_string(results[i].res)) ==
+               0);
+  }
+  GPR_ASSERT(strcmp("UNKNOWN", tsi_result_to_string((tsi_result)42)) == 0);
+}
+
+static void test_protector_invalid_args(void) {
+  GPR_ASSERT(tsi_frame_protector_protect(NULL, NULL, NULL, NULL, NULL) ==
+             TSI_INVALID_ARGUMENT);
+  GPR_ASSERT(tsi_frame_protector_protect_flush(NULL, NULL, NULL, NULL) ==
+             TSI_INVALID_ARGUMENT);
+  GPR_ASSERT(tsi_frame_protector_unprotect(NULL, NULL, NULL, NULL, NULL) ==
+             TSI_INVALID_ARGUMENT);
+}
+
+static void test_handshaker_invalid_args(void) {
+  GPR_ASSERT(tsi_handshaker_get_result(NULL) == TSI_INVALID_ARGUMENT);
+  GPR_ASSERT(tsi_handshaker_extract_peer(NULL, NULL) == TSI_INVALID_ARGUMENT);
+  GPR_ASSERT(tsi_handshaker_create_frame_protector(NULL, NULL, NULL) ==
+             TSI_INVALID_ARGUMENT);
+  GPR_ASSERT(tsi_handshaker_process_bytes_from_peer(NULL, NULL, NULL) ==
+             TSI_INVALID_ARGUMENT);
+  GPR_ASSERT(tsi_handshaker_get_bytes_to_send_to_peer(NULL, NULL, NULL) ==
+             TSI_INVALID_ARGUMENT);
+  GPR_ASSERT(tsi_handshaker_next(NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL) ==
+             TSI_INVALID_ARGUMENT);
+}
+
+static void test_handshaker_invalid_state(void) {
+  tsi_handshaker* h = tsi_create_fake_handshaker(0);
+  tsi_peer peer;
+  tsi_frame_protector* p;
+  GPR_ASSERT(tsi_handshaker_extract_peer(h, &peer) == TSI_FAILED_PRECONDITION);
+  GPR_ASSERT(tsi_handshaker_create_frame_protector(h, NULL, &p) ==
+             TSI_FAILED_PRECONDITION);
+  tsi_handshaker_destroy(h);
+}
+
+int main(int argc, char** argv) {
+  grpc_test_init(argc, argv);
+  test_peer_matches_name();
+  test_result_strings();
+  test_protector_invalid_args();
+  test_handshaker_invalid_args();
+  test_handshaker_invalid_state();
+  return 0;
+}
diff --git a/test/core/tsi/transport_security_test_lib.c b/test/core/tsi/transport_security_test_lib.c
deleted file mode 100644
index 329b237..0000000
--- a/test/core/tsi/transport_security_test_lib.c
+++ /dev/null
@@ -1,579 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
-#include "src/core/lib/security/transport/tsi_error.h"
-#include "test/core/tsi/transport_security_test_lib.h"
-
-static void notification_signal(tsi_test_fixture *fixture) {
-  gpr_mu_lock(&fixture->mu);
-  fixture->notified = true;
-  gpr_cv_signal(&fixture->cv);
-  gpr_mu_unlock(&fixture->mu);
-}
-
-static void notification_wait(tsi_test_fixture *fixture) {
-  gpr_mu_lock(&fixture->mu);
-  while (!fixture->notified) {
-    gpr_cv_wait(&fixture->cv, &fixture->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
-  }
-  fixture->notified = false;
-  gpr_mu_unlock(&fixture->mu);
-}
-
-typedef struct handshaker_args {
-  tsi_test_fixture *fixture;
-  unsigned char *handshake_buffer;
-  size_t handshake_buffer_size;
-  bool is_client;
-  bool transferred_data;
-  bool appended_unused_bytes;
-  grpc_error *error;
-} handshaker_args;
-
-static handshaker_args *handshaker_args_create(tsi_test_fixture *fixture,
-                                               bool is_client) {
-  GPR_ASSERT(fixture != NULL);
-  GPR_ASSERT(fixture->config != NULL);
-  handshaker_args *args = gpr_zalloc(sizeof(*args));
-  args->fixture = fixture;
-  args->handshake_buffer_size = fixture->handshake_buffer_size;
-  args->handshake_buffer = gpr_zalloc(args->handshake_buffer_size);
-  args->is_client = is_client;
-  args->error = GRPC_ERROR_NONE;
-  return args;
-}
-
-static void handshaker_args_destroy(handshaker_args *args) {
-  gpr_free(args->handshake_buffer);
-  GRPC_ERROR_UNREF(args->error);
-  gpr_free(args);
-}
-
-static void do_handshaker_next(handshaker_args *args);
-
-static void setup_handshakers(tsi_test_fixture *fixture) {
-  GPR_ASSERT(fixture != NULL);
-  GPR_ASSERT(fixture->vtable != NULL);
-  GPR_ASSERT(fixture->vtable->setup_handshakers != NULL);
-  fixture->vtable->setup_handshakers(fixture);
-}
-
-static void check_unused_bytes(tsi_test_fixture *fixture) {
-  tsi_handshaker_result *result_with_unused_bytes =
-      fixture->has_client_finished_first ? fixture->server_result
-                                         : fixture->client_result;
-  tsi_handshaker_result *result_without_unused_bytes =
-      fixture->has_client_finished_first ? fixture->client_result
-                                         : fixture->server_result;
-  const unsigned char *bytes = NULL;
-  size_t bytes_size = 0;
-  GPR_ASSERT(tsi_handshaker_result_get_unused_bytes(
-                 result_with_unused_bytes, &bytes, &bytes_size) == TSI_OK);
-  GPR_ASSERT(bytes_size == strlen(TSI_TEST_UNUSED_BYTES));
-  GPR_ASSERT(memcmp(bytes, TSI_TEST_UNUSED_BYTES, bytes_size) == 0);
-  GPR_ASSERT(tsi_handshaker_result_get_unused_bytes(
-                 result_without_unused_bytes, &bytes, &bytes_size) == TSI_OK);
-  GPR_ASSERT(bytes_size == 0);
-  GPR_ASSERT(bytes == NULL);
-}
-
-static void check_handshake_results(tsi_test_fixture *fixture) {
-  GPR_ASSERT(fixture != NULL);
-  GPR_ASSERT(fixture->vtable != NULL);
-  GPR_ASSERT(fixture->vtable->check_handshaker_peers != NULL);
-  /* Check handshaker peers. */
-  fixture->vtable->check_handshaker_peers(fixture);
-  /* Check unused bytes. */
-  if (fixture->test_unused_bytes) {
-    if (fixture->server_result != NULL && fixture->client_result != NULL) {
-      check_unused_bytes(fixture);
-    }
-    fixture->bytes_written_to_server_channel = 0;
-    fixture->bytes_written_to_client_channel = 0;
-    fixture->bytes_read_from_client_channel = 0;
-    fixture->bytes_read_from_server_channel = 0;
-  }
-}
-
-static void send_bytes_to_peer(tsi_test_fixture *fixture,
-                               const unsigned char *buf, size_t buf_size,
-                               bool is_client) {
-  GPR_ASSERT(fixture != NULL);
-  GPR_ASSERT(buf != NULL);
-  uint8_t *channel =
-      is_client ? fixture->server_channel : fixture->client_channel;
-  GPR_ASSERT(channel != NULL);
-  size_t *bytes_written = is_client ? &fixture->bytes_written_to_server_channel
-                                    : &fixture->bytes_written_to_client_channel;
-  GPR_ASSERT(bytes_written != NULL);
-  GPR_ASSERT(*bytes_written + buf_size <= TSI_TEST_DEFAULT_CHANNEL_SIZE);
-  /* Write data to channel. */
-  memcpy(channel + *bytes_written, buf, buf_size);
-  *bytes_written += buf_size;
-}
-
-static void maybe_append_unused_bytes(handshaker_args *args) {
-  GPR_ASSERT(args != NULL);
-  GPR_ASSERT(args->fixture != NULL);
-  tsi_test_fixture *fixture = args->fixture;
-  if (fixture->test_unused_bytes && !args->appended_unused_bytes) {
-    args->appended_unused_bytes = true;
-    send_bytes_to_peer(fixture, (const unsigned char *)TSI_TEST_UNUSED_BYTES,
-                       strlen(TSI_TEST_UNUSED_BYTES), args->is_client);
-    if (fixture->client_result != NULL && fixture->server_result == NULL) {
-      fixture->has_client_finished_first = true;
-    }
-  }
-}
-
-static void receive_bytes_from_peer(tsi_test_fixture *fixture,
-                                    unsigned char **buf, size_t *buf_size,
-                                    bool is_client) {
-  GPR_ASSERT(fixture != NULL);
-  GPR_ASSERT(*buf != NULL);
-  GPR_ASSERT(buf_size != NULL);
-  uint8_t *channel =
-      is_client ? fixture->client_channel : fixture->server_channel;
-  GPR_ASSERT(channel != NULL);
-  size_t *bytes_read = is_client ? &fixture->bytes_read_from_client_channel
-                                 : &fixture->bytes_read_from_server_channel;
-  size_t *bytes_written = is_client ? &fixture->bytes_written_to_client_channel
-                                    : &fixture->bytes_written_to_server_channel;
-  GPR_ASSERT(bytes_read != NULL);
-  GPR_ASSERT(bytes_written != NULL);
-  size_t to_read = *buf_size < *bytes_written - *bytes_read
-                       ? *buf_size
-                       : *bytes_written - *bytes_read;
-  /* Read data from channel. */
-  memcpy(*buf, channel + *bytes_read, to_read);
-  *buf_size = to_read;
-  *bytes_read += to_read;
-}
-
-static void send_message_to_peer(tsi_test_fixture *fixture,
-                                 tsi_frame_protector *protector,
-                                 bool is_client) {
-  /* Initialization. */
-  GPR_ASSERT(fixture != NULL);
-  GPR_ASSERT(fixture->config != NULL);
-  GPR_ASSERT(protector != NULL);
-  tsi_test_frame_protector_config *config = fixture->config;
-  unsigned char *protected_buffer = gpr_zalloc(config->protected_buffer_size);
-  size_t message_size =
-      is_client ? config->client_message_size : config->server_message_size;
-  uint8_t *message =
-      is_client ? config->client_message : config->server_message;
-  GPR_ASSERT(message != NULL);
-  const unsigned char *message_bytes = (const unsigned char *)message;
-  tsi_result result = TSI_OK;
-  /* Do protect and send protected data to peer. */
-  while (message_size > 0 && result == TSI_OK) {
-    size_t protected_buffer_size_to_send = config->protected_buffer_size;
-    size_t processed_message_size = message_size;
-    /* Do protect. */
-    result = tsi_frame_protector_protect(
-        protector, message_bytes, &processed_message_size, protected_buffer,
-        &protected_buffer_size_to_send);
-    GPR_ASSERT(result == TSI_OK);
-    /* Send protected data to peer. */
-    send_bytes_to_peer(fixture, protected_buffer, protected_buffer_size_to_send,
-                       is_client);
-    message_bytes += processed_message_size;
-    message_size -= processed_message_size;
-    /* Flush if we're done. */
-    if (message_size == 0) {
-      size_t still_pending_size;
-      do {
-        protected_buffer_size_to_send = config->protected_buffer_size;
-        result = tsi_frame_protector_protect_flush(
-            protector, protected_buffer, &protected_buffer_size_to_send,
-            &still_pending_size);
-        GPR_ASSERT(result == TSI_OK);
-        send_bytes_to_peer(fixture, protected_buffer,
-                           protected_buffer_size_to_send, is_client);
-      } while (still_pending_size > 0 && result == TSI_OK);
-      GPR_ASSERT(result == TSI_OK);
-    }
-  }
-  GPR_ASSERT(result == TSI_OK);
-  gpr_free(protected_buffer);
-}
-
-static void receive_message_from_peer(tsi_test_fixture *fixture,
-                                      tsi_frame_protector *protector,
-                                      unsigned char *message,
-                                      size_t *bytes_received, bool is_client) {
-  /* Initialization. */
-  GPR_ASSERT(fixture != NULL);
-  GPR_ASSERT(protector != NULL);
-  GPR_ASSERT(message != NULL);
-  GPR_ASSERT(bytes_received != NULL);
-  GPR_ASSERT(fixture->config != NULL);
-  tsi_test_frame_protector_config *config = fixture->config;
-  size_t read_offset = 0;
-  size_t message_offset = 0;
-  size_t read_from_peer_size = 0;
-  tsi_result result = TSI_OK;
-  bool done = false;
-  unsigned char *read_buffer = gpr_zalloc(config->read_buffer_allocated_size);
-  unsigned char *message_buffer =
-      gpr_zalloc(config->message_buffer_allocated_size);
-  /* Do unprotect on data received from peer. */
-  while (!done && result == TSI_OK) {
-    /* Receive data from peer. */
-    if (read_from_peer_size == 0) {
-      read_from_peer_size = config->read_buffer_allocated_size;
-      receive_bytes_from_peer(fixture, &read_buffer, &read_from_peer_size,
-                              is_client);
-      read_offset = 0;
-    }
-    if (read_from_peer_size == 0) {
-      done = true;
-    }
-    /* Do unprotect. */
-    size_t message_buffer_size;
-    do {
-      message_buffer_size = config->message_buffer_allocated_size;
-      size_t processed_size = read_from_peer_size;
-      result = tsi_frame_protector_unprotect(
-          protector, read_buffer + read_offset, &processed_size, message_buffer,
-          &message_buffer_size);
-      GPR_ASSERT(result == TSI_OK);
-      if (message_buffer_size > 0) {
-        memcpy(message + message_offset, message_buffer, message_buffer_size);
-        message_offset += message_buffer_size;
-      }
-      read_offset += processed_size;
-      read_from_peer_size -= processed_size;
-    } while ((read_from_peer_size > 0 || message_buffer_size > 0) &&
-             result == TSI_OK);
-    GPR_ASSERT(result == TSI_OK);
-  }
-  GPR_ASSERT(result == TSI_OK);
-  *bytes_received = message_offset;
-  gpr_free(read_buffer);
-  gpr_free(message_buffer);
-}
-
-grpc_error *on_handshake_next_done(tsi_result result, void *user_data,
-                                   const unsigned char *bytes_to_send,
-                                   size_t bytes_to_send_size,
-                                   tsi_handshaker_result *handshaker_result) {
-  handshaker_args *args = (handshaker_args *)user_data;
-  GPR_ASSERT(args != NULL);
-  GPR_ASSERT(args->fixture != NULL);
-  tsi_test_fixture *fixture = args->fixture;
-  grpc_error *error = GRPC_ERROR_NONE;
-  /* Read more data if we need to. */
-  if (result == TSI_INCOMPLETE_DATA) {
-    GPR_ASSERT(bytes_to_send_size == 0);
-    notification_signal(fixture);
-    return error;
-  }
-  if (result != TSI_OK) {
-    notification_signal(fixture);
-    return grpc_set_tsi_error_result(
-        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Handshake failed"), result);
-  }
-  /* Update handshaker result. */
-  if (handshaker_result != NULL) {
-    tsi_handshaker_result **result_to_write =
-        args->is_client ? &fixture->client_result : &fixture->server_result;
-    GPR_ASSERT(*result_to_write == NULL);
-    *result_to_write = handshaker_result;
-  }
-  /* Send data to peer, if needed. */
-  if (bytes_to_send_size > 0) {
-    send_bytes_to_peer(args->fixture, bytes_to_send, bytes_to_send_size,
-                       args->is_client);
-    args->transferred_data = true;
-  }
-  if (handshaker_result != NULL) {
-    maybe_append_unused_bytes(args);
-  }
-  notification_signal(fixture);
-  return error;
-}
-
-static void on_handshake_next_done_wrapper(
-    tsi_result result, void *user_data, const unsigned char *bytes_to_send,
-    size_t bytes_to_send_size, tsi_handshaker_result *handshaker_result) {
-  handshaker_args *args = (handshaker_args *)user_data;
-  args->error = on_handshake_next_done(result, user_data, bytes_to_send,
-                                       bytes_to_send_size, handshaker_result);
-}
-
-static bool is_handshake_finished_properly(handshaker_args *args) {
-  GPR_ASSERT(args != NULL);
-  GPR_ASSERT(args->fixture != NULL);
-  tsi_test_fixture *fixture = args->fixture;
-  if ((args->is_client && fixture->client_result != NULL) ||
-      (!args->is_client && fixture->server_result != NULL)) {
-    return true;
-  }
-  return false;
-}
-
-static void do_handshaker_next(handshaker_args *args) {
-  /* Initialization. */
-  GPR_ASSERT(args != NULL);
-  GPR_ASSERT(args->fixture != NULL);
-  tsi_test_fixture *fixture = args->fixture;
-  tsi_handshaker *handshaker =
-      args->is_client ? fixture->client_handshaker : fixture->server_handshaker;
-  if (is_handshake_finished_properly(args)) {
-    return;
-  }
-  tsi_handshaker_result *handshaker_result = NULL;
-  unsigned char *bytes_to_send = NULL;
-  size_t bytes_to_send_size = 0;
-  /* Receive data from peer, if available. */
-  size_t buf_size = args->handshake_buffer_size;
-  receive_bytes_from_peer(args->fixture, &args->handshake_buffer, &buf_size,
-                          args->is_client);
-  if (buf_size > 0) {
-    args->transferred_data = true;
-  }
-  /* Peform handshaker next. */
-  tsi_result result = tsi_handshaker_next(
-      handshaker, args->handshake_buffer, buf_size,
-      (const unsigned char **)&bytes_to_send, &bytes_to_send_size,
-      &handshaker_result, &on_handshake_next_done_wrapper, args);
-  if (result != TSI_ASYNC) {
-    args->error = on_handshake_next_done(result, args, bytes_to_send,
-                                         bytes_to_send_size, handshaker_result);
-    if (args->error != GRPC_ERROR_NONE) {
-      return;
-    }
-  }
-  notification_wait(fixture);
-}
-
-void tsi_test_do_handshake(tsi_test_fixture *fixture) {
-  /* Initializaiton. */
-  setup_handshakers(fixture);
-  handshaker_args *client_args =
-      handshaker_args_create(fixture, true /* is_client */);
-  handshaker_args *server_args =
-      handshaker_args_create(fixture, false /* is_client */);
-  /* Do handshake. */
-  do {
-    client_args->transferred_data = false;
-    server_args->transferred_data = false;
-    do_handshaker_next(client_args);
-    if (client_args->error != GRPC_ERROR_NONE) {
-      break;
-    }
-    do_handshaker_next(server_args);
-    if (server_args->error != GRPC_ERROR_NONE) {
-      break;
-    }
-    GPR_ASSERT(client_args->transferred_data || server_args->transferred_data);
-  } while (fixture->client_result == NULL || fixture->server_result == NULL);
-  /* Verify handshake results. */
-  check_handshake_results(fixture);
-  /* Cleanup. */
-  handshaker_args_destroy(client_args);
-  handshaker_args_destroy(server_args);
-}
-
-void tsi_test_do_round_trip(tsi_test_fixture *fixture) {
-  /* Initialization. */
-  GPR_ASSERT(fixture != NULL);
-  GPR_ASSERT(fixture->config != NULL);
-  tsi_test_frame_protector_config *config = fixture->config;
-  tsi_frame_protector *client_frame_protector = NULL;
-  tsi_frame_protector *server_frame_protector = NULL;
-  /* Perform handshake. */
-  tsi_test_do_handshake(fixture);
-  /* Create frame protectors.*/
-  size_t client_max_output_protected_frame_size =
-      config->client_max_output_protected_frame_size;
-  GPR_ASSERT(tsi_handshaker_result_create_frame_protector(
-                 fixture->client_result,
-                 client_max_output_protected_frame_size == 0
-                     ? NULL
-                     : &client_max_output_protected_frame_size,
-                 &client_frame_protector) == TSI_OK);
-  size_t server_max_output_protected_frame_size =
-      config->server_max_output_protected_frame_size;
-  GPR_ASSERT(tsi_handshaker_result_create_frame_protector(
-                 fixture->server_result,
-                 server_max_output_protected_frame_size == 0
-                     ? NULL
-                     : &server_max_output_protected_frame_size,
-                 &server_frame_protector) == TSI_OK);
-  /* Client sends a message to server. */
-  send_message_to_peer(fixture, client_frame_protector, true /* is_client */);
-  unsigned char *server_received_message =
-      gpr_zalloc(TSI_TEST_DEFAULT_CHANNEL_SIZE);
-  size_t server_received_message_size = 0;
-  receive_message_from_peer(
-      fixture, server_frame_protector, server_received_message,
-      &server_received_message_size, false /* is_client */);
-  GPR_ASSERT(config->client_message_size == server_received_message_size);
-  GPR_ASSERT(memcmp(config->client_message, server_received_message,
-                    server_received_message_size) == 0);
-  /* Server sends a message to client. */
-  send_message_to_peer(fixture, server_frame_protector, false /* is_client */);
-  unsigned char *client_received_message =
-      gpr_zalloc(TSI_TEST_DEFAULT_CHANNEL_SIZE);
-  size_t client_received_message_size = 0;
-  receive_message_from_peer(
-      fixture, client_frame_protector, client_received_message,
-      &client_received_message_size, true /* is_client */);
-  GPR_ASSERT(config->server_message_size == client_received_message_size);
-  GPR_ASSERT(memcmp(config->server_message, client_received_message,
-                    client_received_message_size) == 0);
-  /* Destroy server and client frame protectors. */
-  tsi_frame_protector_destroy(client_frame_protector);
-  tsi_frame_protector_destroy(server_frame_protector);
-  gpr_free(server_received_message);
-  gpr_free(client_received_message);
-}
-
-static unsigned char *generate_random_message(size_t size) {
-  size_t i;
-  unsigned char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
-  unsigned char *output = gpr_zalloc(sizeof(unsigned char) * size);
-  for (i = 0; i < size - 1; ++i) {
-    output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
-  }
-  return output;
-}
-
-tsi_test_frame_protector_config *tsi_test_frame_protector_config_create(
-    bool use_default_read_buffer_allocated_size,
-    bool use_default_message_buffer_allocated_size,
-    bool use_default_protected_buffer_size, bool use_default_client_message,
-    bool use_default_server_message,
-    bool use_default_client_max_output_protected_frame_size,
-    bool use_default_server_max_output_protected_frame_size,
-    bool use_default_handshake_buffer_size) {
-  tsi_test_frame_protector_config *config = gpr_zalloc(sizeof(*config));
-  /* Set the value for read_buffer_allocated_size. */
-  config->read_buffer_allocated_size =
-      use_default_read_buffer_allocated_size
-          ? TSI_TEST_DEFAULT_BUFFER_SIZE
-          : TSI_TEST_SMALL_READ_BUFFER_ALLOCATED_SIZE;
-  /* Set the value for message_buffer_allocated_size. */
-  config->message_buffer_allocated_size =
-      use_default_message_buffer_allocated_size
-          ? TSI_TEST_DEFAULT_BUFFER_SIZE
-          : TSI_TEST_SMALL_MESSAGE_BUFFER_ALLOCATED_SIZE;
-  /* Set the value for protected_buffer_size. */
-  config->protected_buffer_size = use_default_protected_buffer_size
-                                      ? TSI_TEST_DEFAULT_PROTECTED_BUFFER_SIZE
-                                      : TSI_TEST_SMALL_PROTECTED_BUFFER_SIZE;
-  /* Set the value for client message. */
-  config->client_message_size = use_default_client_message
-                                    ? TSI_TEST_BIG_MESSAGE_SIZE
-                                    : TSI_TEST_SMALL_MESSAGE_SIZE;
-  config->client_message =
-      use_default_client_message
-          ? generate_random_message(TSI_TEST_BIG_MESSAGE_SIZE)
-          : generate_random_message(TSI_TEST_SMALL_MESSAGE_SIZE);
-  /* Set the value for server message. */
-  config->server_message_size = use_default_server_message
-                                    ? TSI_TEST_BIG_MESSAGE_SIZE
-                                    : TSI_TEST_SMALL_MESSAGE_SIZE;
-  config->server_message =
-      use_default_server_message
-          ? generate_random_message(TSI_TEST_BIG_MESSAGE_SIZE)
-          : generate_random_message(TSI_TEST_SMALL_MESSAGE_SIZE);
-  /* Set the value for client max_output_protected_frame_size.
-     If it is 0, we pass NULL to tsi_handshaker_result_create_frame_protector(),
-     which then uses default protected frame size for it. */
-  config->client_max_output_protected_frame_size =
-      use_default_client_max_output_protected_frame_size
-          ? 0
-          : TSI_TEST_SMALL_CLIENT_MAX_OUTPUT_PROTECTED_FRAME_SIZE;
-  /* Set the value for server max_output_protected_frame_size.
-     If it is 0, we pass NULL to tsi_handshaker_result_create_frame_protector(),
-     which then uses default protected frame size for it. */
-  config->server_max_output_protected_frame_size =
-      use_default_server_max_output_protected_frame_size
-          ? 0
-          : TSI_TEST_SMALL_SERVER_MAX_OUTPUT_PROTECTED_FRAME_SIZE;
-  return config;
-}
-
-void tsi_test_frame_protector_config_set_buffer_size(
-    tsi_test_frame_protector_config *config, size_t read_buffer_allocated_size,
-    size_t message_buffer_allocated_size, size_t protected_buffer_size,
-    size_t client_max_output_protected_frame_size,
-    size_t server_max_output_protected_frame_size) {
-  GPR_ASSERT(config != NULL);
-  config->read_buffer_allocated_size = read_buffer_allocated_size;
-  config->message_buffer_allocated_size = message_buffer_allocated_size;
-  config->protected_buffer_size = protected_buffer_size;
-  config->client_max_output_protected_frame_size =
-      client_max_output_protected_frame_size;
-  config->server_max_output_protected_frame_size =
-      server_max_output_protected_frame_size;
-}
-
-void tsi_test_frame_protector_config_destroy(
-    tsi_test_frame_protector_config *config) {
-  GPR_ASSERT(config != NULL);
-  gpr_free(config->client_message);
-  gpr_free(config->server_message);
-  gpr_free(config);
-}
-
-void tsi_test_fixture_init(tsi_test_fixture *fixture) {
-  fixture->config = tsi_test_frame_protector_config_create(
-      true, true, true, true, true, true, true, true);
-  fixture->handshake_buffer_size = TSI_TEST_DEFAULT_BUFFER_SIZE;
-  fixture->client_channel = gpr_zalloc(TSI_TEST_DEFAULT_CHANNEL_SIZE);
-  fixture->server_channel = gpr_zalloc(TSI_TEST_DEFAULT_CHANNEL_SIZE);
-  fixture->bytes_written_to_client_channel = 0;
-  fixture->bytes_written_to_server_channel = 0;
-  fixture->bytes_read_from_client_channel = 0;
-  fixture->bytes_read_from_server_channel = 0;
-  fixture->test_unused_bytes = true;
-  fixture->has_client_finished_first = false;
-  gpr_mu_init(&fixture->mu);
-  gpr_cv_init(&fixture->cv);
-  fixture->notified = false;
-}
-
-void tsi_test_fixture_destroy(tsi_test_fixture *fixture) {
-  GPR_ASSERT(fixture != NULL);
-  tsi_test_frame_protector_config_destroy(fixture->config);
-  tsi_handshaker_destroy(fixture->client_handshaker);
-  tsi_handshaker_destroy(fixture->server_handshaker);
-  tsi_handshaker_result_destroy(fixture->client_result);
-  tsi_handshaker_result_destroy(fixture->server_result);
-  gpr_free(fixture->client_channel);
-  gpr_free(fixture->server_channel);
-  GPR_ASSERT(fixture->vtable != NULL);
-  GPR_ASSERT(fixture->vtable->destruct != NULL);
-  fixture->vtable->destruct(fixture);
-  gpr_mu_destroy(&fixture->mu);
-  gpr_cv_destroy(&fixture->cv);
-  gpr_free(fixture);
-}
diff --git a/test/core/tsi/transport_security_test_lib.cc b/test/core/tsi/transport_security_test_lib.cc
new file mode 100644
index 0000000..af83168
--- /dev/null
+++ b/test/core/tsi/transport_security_test_lib.cc
@@ -0,0 +1,591 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/thd.h>
+#include "src/core/lib/security/transport/tsi_error.h"
+#include "test/core/tsi/transport_security_test_lib.h"
+
+static void notification_signal(tsi_test_fixture* fixture) {
+  gpr_mu_lock(&fixture->mu);
+  fixture->notified = true;
+  gpr_cv_signal(&fixture->cv);
+  gpr_mu_unlock(&fixture->mu);
+}
+
+static void notification_wait(tsi_test_fixture* fixture) {
+  gpr_mu_lock(&fixture->mu);
+  while (!fixture->notified) {
+    gpr_cv_wait(&fixture->cv, &fixture->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
+  }
+  fixture->notified = false;
+  gpr_mu_unlock(&fixture->mu);
+}
+
+typedef struct handshaker_args {
+  tsi_test_fixture* fixture;
+  unsigned char* handshake_buffer;
+  size_t handshake_buffer_size;
+  bool is_client;
+  bool transferred_data;
+  bool appended_unused_bytes;
+  grpc_error* error;
+} handshaker_args;
+
+static handshaker_args* handshaker_args_create(tsi_test_fixture* fixture,
+                                               bool is_client) {
+  GPR_ASSERT(fixture != NULL);
+  GPR_ASSERT(fixture->config != NULL);
+  handshaker_args* args =
+      static_cast<handshaker_args*>(gpr_zalloc(sizeof(*args)));
+  args->fixture = fixture;
+  args->handshake_buffer_size = fixture->handshake_buffer_size;
+  args->handshake_buffer =
+      static_cast<unsigned char*>(gpr_zalloc(args->handshake_buffer_size));
+  args->is_client = is_client;
+  args->error = GRPC_ERROR_NONE;
+  return args;
+}
+
+static void handshaker_args_destroy(handshaker_args* args) {
+  gpr_free(args->handshake_buffer);
+  GRPC_ERROR_UNREF(args->error);
+  gpr_free(args);
+}
+
+static void do_handshaker_next(handshaker_args* args);
+
+static void setup_handshakers(tsi_test_fixture* fixture) {
+  GPR_ASSERT(fixture != NULL);
+  GPR_ASSERT(fixture->vtable != NULL);
+  GPR_ASSERT(fixture->vtable->setup_handshakers != NULL);
+  fixture->vtable->setup_handshakers(fixture);
+}
+
+static void check_unused_bytes(tsi_test_fixture* fixture) {
+  tsi_handshaker_result* result_with_unused_bytes =
+      fixture->has_client_finished_first ? fixture->server_result
+                                         : fixture->client_result;
+  tsi_handshaker_result* result_without_unused_bytes =
+      fixture->has_client_finished_first ? fixture->client_result
+                                         : fixture->server_result;
+  const unsigned char* bytes = NULL;
+  size_t bytes_size = 0;
+  GPR_ASSERT(tsi_handshaker_result_get_unused_bytes(
+                 result_with_unused_bytes, &bytes, &bytes_size) == TSI_OK);
+  GPR_ASSERT(bytes_size == strlen(TSI_TEST_UNUSED_BYTES));
+  GPR_ASSERT(memcmp(bytes, TSI_TEST_UNUSED_BYTES, bytes_size) == 0);
+  GPR_ASSERT(tsi_handshaker_result_get_unused_bytes(
+                 result_without_unused_bytes, &bytes, &bytes_size) == TSI_OK);
+  GPR_ASSERT(bytes_size == 0);
+  GPR_ASSERT(bytes == NULL);
+}
+
+static void check_handshake_results(tsi_test_fixture* fixture) {
+  GPR_ASSERT(fixture != NULL);
+  GPR_ASSERT(fixture->vtable != NULL);
+  GPR_ASSERT(fixture->vtable->check_handshaker_peers != NULL);
+  /* Check handshaker peers. */
+  fixture->vtable->check_handshaker_peers(fixture);
+  /* Check unused bytes. */
+  if (fixture->test_unused_bytes) {
+    if (fixture->server_result != NULL && fixture->client_result != NULL) {
+      check_unused_bytes(fixture);
+    }
+    fixture->bytes_written_to_server_channel = 0;
+    fixture->bytes_written_to_client_channel = 0;
+    fixture->bytes_read_from_client_channel = 0;
+    fixture->bytes_read_from_server_channel = 0;
+  }
+}
+
+static void send_bytes_to_peer(tsi_test_fixture* fixture,
+                               const unsigned char* buf, size_t buf_size,
+                               bool is_client) {
+  GPR_ASSERT(fixture != NULL);
+  GPR_ASSERT(buf != NULL);
+  uint8_t* channel =
+      is_client ? fixture->server_channel : fixture->client_channel;
+  GPR_ASSERT(channel != NULL);
+  size_t* bytes_written = is_client ? &fixture->bytes_written_to_server_channel
+                                    : &fixture->bytes_written_to_client_channel;
+  GPR_ASSERT(bytes_written != NULL);
+  GPR_ASSERT(*bytes_written + buf_size <= TSI_TEST_DEFAULT_CHANNEL_SIZE);
+  /* Write data to channel. */
+  memcpy(channel + *bytes_written, buf, buf_size);
+  *bytes_written += buf_size;
+}
+
+static void maybe_append_unused_bytes(handshaker_args* args) {
+  GPR_ASSERT(args != NULL);
+  GPR_ASSERT(args->fixture != NULL);
+  tsi_test_fixture* fixture = args->fixture;
+  if (fixture->test_unused_bytes && !args->appended_unused_bytes) {
+    args->appended_unused_bytes = true;
+    send_bytes_to_peer(fixture, (const unsigned char*)TSI_TEST_UNUSED_BYTES,
+                       strlen(TSI_TEST_UNUSED_BYTES), args->is_client);
+    if (fixture->client_result != NULL && fixture->server_result == NULL) {
+      fixture->has_client_finished_first = true;
+    }
+  }
+}
+
+static void receive_bytes_from_peer(tsi_test_fixture* fixture,
+                                    unsigned char** buf, size_t* buf_size,
+                                    bool is_client) {
+  GPR_ASSERT(fixture != NULL);
+  GPR_ASSERT(*buf != NULL);
+  GPR_ASSERT(buf_size != NULL);
+  uint8_t* channel =
+      is_client ? fixture->client_channel : fixture->server_channel;
+  GPR_ASSERT(channel != NULL);
+  size_t* bytes_read = is_client ? &fixture->bytes_read_from_client_channel
+                                 : &fixture->bytes_read_from_server_channel;
+  size_t* bytes_written = is_client ? &fixture->bytes_written_to_client_channel
+                                    : &fixture->bytes_written_to_server_channel;
+  GPR_ASSERT(bytes_read != NULL);
+  GPR_ASSERT(bytes_written != NULL);
+  size_t to_read = *buf_size < *bytes_written - *bytes_read
+                       ? *buf_size
+                       : *bytes_written - *bytes_read;
+  /* Read data from channel. */
+  memcpy(*buf, channel + *bytes_read, to_read);
+  *buf_size = to_read;
+  *bytes_read += to_read;
+}
+
+static void send_message_to_peer(tsi_test_fixture* fixture,
+                                 tsi_frame_protector* protector,
+                                 bool is_client) {
+  /* Initialization. */
+  GPR_ASSERT(fixture != NULL);
+  GPR_ASSERT(fixture->config != NULL);
+  GPR_ASSERT(protector != NULL);
+  tsi_test_frame_protector_config* config = fixture->config;
+  unsigned char* protected_buffer =
+      static_cast<unsigned char*>(gpr_zalloc(config->protected_buffer_size));
+  size_t message_size =
+      is_client ? config->client_message_size : config->server_message_size;
+  uint8_t* message =
+      is_client ? config->client_message : config->server_message;
+  GPR_ASSERT(message != NULL);
+  const unsigned char* message_bytes = (const unsigned char*)message;
+  tsi_result result = TSI_OK;
+  /* Do protect and send protected data to peer. */
+  while (message_size > 0 && result == TSI_OK) {
+    size_t protected_buffer_size_to_send = config->protected_buffer_size;
+    size_t processed_message_size = message_size;
+    /* Do protect. */
+    result = tsi_frame_protector_protect(
+        protector, message_bytes, &processed_message_size, protected_buffer,
+        &protected_buffer_size_to_send);
+    GPR_ASSERT(result == TSI_OK);
+    /* Send protected data to peer. */
+    send_bytes_to_peer(fixture, protected_buffer, protected_buffer_size_to_send,
+                       is_client);
+    message_bytes += processed_message_size;
+    message_size -= processed_message_size;
+    /* Flush if we're done. */
+    if (message_size == 0) {
+      size_t still_pending_size;
+      do {
+        protected_buffer_size_to_send = config->protected_buffer_size;
+        result = tsi_frame_protector_protect_flush(
+            protector, protected_buffer, &protected_buffer_size_to_send,
+            &still_pending_size);
+        GPR_ASSERT(result == TSI_OK);
+        send_bytes_to_peer(fixture, protected_buffer,
+                           protected_buffer_size_to_send, is_client);
+      } while (still_pending_size > 0 && result == TSI_OK);
+      GPR_ASSERT(result == TSI_OK);
+    }
+  }
+  GPR_ASSERT(result == TSI_OK);
+  gpr_free(protected_buffer);
+}
+
+static void receive_message_from_peer(tsi_test_fixture* fixture,
+                                      tsi_frame_protector* protector,
+                                      unsigned char* message,
+                                      size_t* bytes_received, bool is_client) {
+  /* Initialization. */
+  GPR_ASSERT(fixture != NULL);
+  GPR_ASSERT(protector != NULL);
+  GPR_ASSERT(message != NULL);
+  GPR_ASSERT(bytes_received != NULL);
+  GPR_ASSERT(fixture->config != NULL);
+  tsi_test_frame_protector_config* config = fixture->config;
+  size_t read_offset = 0;
+  size_t message_offset = 0;
+  size_t read_from_peer_size = 0;
+  tsi_result result = TSI_OK;
+  bool done = false;
+  unsigned char* read_buffer = static_cast<unsigned char*>(
+      gpr_zalloc(config->read_buffer_allocated_size));
+  unsigned char* message_buffer = static_cast<unsigned char*>(
+      gpr_zalloc(config->message_buffer_allocated_size));
+  /* Do unprotect on data received from peer. */
+  while (!done && result == TSI_OK) {
+    /* Receive data from peer. */
+    if (read_from_peer_size == 0) {
+      read_from_peer_size = config->read_buffer_allocated_size;
+      receive_bytes_from_peer(fixture, &read_buffer, &read_from_peer_size,
+                              is_client);
+      read_offset = 0;
+    }
+    if (read_from_peer_size == 0) {
+      done = true;
+    }
+    /* Do unprotect. */
+    size_t message_buffer_size;
+    do {
+      message_buffer_size = config->message_buffer_allocated_size;
+      size_t processed_size = read_from_peer_size;
+      result = tsi_frame_protector_unprotect(
+          protector, read_buffer + read_offset, &processed_size, message_buffer,
+          &message_buffer_size);
+      GPR_ASSERT(result == TSI_OK);
+      if (message_buffer_size > 0) {
+        memcpy(message + message_offset, message_buffer, message_buffer_size);
+        message_offset += message_buffer_size;
+      }
+      read_offset += processed_size;
+      read_from_peer_size -= processed_size;
+    } while ((read_from_peer_size > 0 || message_buffer_size > 0) &&
+             result == TSI_OK);
+    GPR_ASSERT(result == TSI_OK);
+  }
+  GPR_ASSERT(result == TSI_OK);
+  *bytes_received = message_offset;
+  gpr_free(read_buffer);
+  gpr_free(message_buffer);
+}
+
+grpc_error* on_handshake_next_done(tsi_result result, void* user_data,
+                                   const unsigned char* bytes_to_send,
+                                   size_t bytes_to_send_size,
+                                   tsi_handshaker_result* handshaker_result) {
+  handshaker_args* args = (handshaker_args*)user_data;
+  GPR_ASSERT(args != NULL);
+  GPR_ASSERT(args->fixture != NULL);
+  tsi_test_fixture* fixture = args->fixture;
+  grpc_error* error = GRPC_ERROR_NONE;
+  /* Read more data if we need to. */
+  if (result == TSI_INCOMPLETE_DATA) {
+    GPR_ASSERT(bytes_to_send_size == 0);
+    notification_signal(fixture);
+    return error;
+  }
+  if (result != TSI_OK) {
+    notification_signal(fixture);
+    return grpc_set_tsi_error_result(
+        GRPC_ERROR_CREATE_FROM_STATIC_STRING("Handshake failed"), result);
+  }
+  /* Update handshaker result. */
+  if (handshaker_result != NULL) {
+    tsi_handshaker_result** result_to_write =
+        args->is_client ? &fixture->client_result : &fixture->server_result;
+    GPR_ASSERT(*result_to_write == NULL);
+    *result_to_write = handshaker_result;
+  }
+  /* Send data to peer, if needed. */
+  if (bytes_to_send_size > 0) {
+    send_bytes_to_peer(args->fixture, bytes_to_send, bytes_to_send_size,
+                       args->is_client);
+    args->transferred_data = true;
+  }
+  if (handshaker_result != NULL) {
+    maybe_append_unused_bytes(args);
+  }
+  notification_signal(fixture);
+  return error;
+}
+
+static void on_handshake_next_done_wrapper(
+    tsi_result result, void* user_data, const unsigned char* bytes_to_send,
+    size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result) {
+  handshaker_args* args = (handshaker_args*)user_data;
+  args->error = on_handshake_next_done(result, user_data, bytes_to_send,
+                                       bytes_to_send_size, handshaker_result);
+}
+
+static bool is_handshake_finished_properly(handshaker_args* args) {
+  GPR_ASSERT(args != NULL);
+  GPR_ASSERT(args->fixture != NULL);
+  tsi_test_fixture* fixture = args->fixture;
+  if ((args->is_client && fixture->client_result != NULL) ||
+      (!args->is_client && fixture->server_result != NULL)) {
+    return true;
+  }
+  return false;
+}
+
+static void do_handshaker_next(handshaker_args* args) {
+  /* Initialization. */
+  GPR_ASSERT(args != NULL);
+  GPR_ASSERT(args->fixture != NULL);
+  tsi_test_fixture* fixture = args->fixture;
+  tsi_handshaker* handshaker =
+      args->is_client ? fixture->client_handshaker : fixture->server_handshaker;
+  if (is_handshake_finished_properly(args)) {
+    return;
+  }
+  tsi_handshaker_result* handshaker_result = NULL;
+  unsigned char* bytes_to_send = NULL;
+  size_t bytes_to_send_size = 0;
+  tsi_result result = TSI_OK;
+  /* Receive data from peer, if available. */
+  do {
+    size_t buf_size = args->handshake_buffer_size;
+    receive_bytes_from_peer(args->fixture, &args->handshake_buffer, &buf_size,
+                            args->is_client);
+    if (buf_size > 0) {
+      args->transferred_data = true;
+    }
+    /* Peform handshaker next. */
+    result = tsi_handshaker_next(handshaker, args->handshake_buffer, buf_size,
+                                 (const unsigned char**)&bytes_to_send,
+                                 &bytes_to_send_size, &handshaker_result,
+                                 &on_handshake_next_done_wrapper, args);
+    if (result != TSI_ASYNC) {
+      args->error = on_handshake_next_done(
+          result, args, bytes_to_send, bytes_to_send_size, handshaker_result);
+      if (args->error != GRPC_ERROR_NONE) {
+        return;
+      }
+    }
+  } while (result == TSI_INCOMPLETE_DATA);
+  notification_wait(fixture);
+}
+
+void tsi_test_do_handshake(tsi_test_fixture* fixture) {
+  /* Initializaiton. */
+  setup_handshakers(fixture);
+  handshaker_args* client_args =
+      handshaker_args_create(fixture, true /* is_client */);
+  handshaker_args* server_args =
+      handshaker_args_create(fixture, false /* is_client */);
+  /* Do handshake. */
+  do {
+    client_args->transferred_data = false;
+    server_args->transferred_data = false;
+    do_handshaker_next(client_args);
+    if (client_args->error != GRPC_ERROR_NONE) {
+      break;
+    }
+    do_handshaker_next(server_args);
+    if (server_args->error != GRPC_ERROR_NONE) {
+      break;
+    }
+    GPR_ASSERT(client_args->transferred_data || server_args->transferred_data);
+  } while (fixture->client_result == NULL || fixture->server_result == NULL);
+  /* Verify handshake results. */
+  check_handshake_results(fixture);
+  /* Cleanup. */
+  handshaker_args_destroy(client_args);
+  handshaker_args_destroy(server_args);
+}
+
+void tsi_test_do_round_trip(tsi_test_fixture* fixture) {
+  /* Initialization. */
+  GPR_ASSERT(fixture != NULL);
+  GPR_ASSERT(fixture->config != NULL);
+  tsi_test_frame_protector_config* config = fixture->config;
+  tsi_frame_protector* client_frame_protector = NULL;
+  tsi_frame_protector* server_frame_protector = NULL;
+  /* Perform handshake. */
+  tsi_test_do_handshake(fixture);
+  /* Create frame protectors.*/
+  size_t client_max_output_protected_frame_size =
+      config->client_max_output_protected_frame_size;
+  GPR_ASSERT(tsi_handshaker_result_create_frame_protector(
+                 fixture->client_result,
+                 client_max_output_protected_frame_size == 0
+                     ? NULL
+                     : &client_max_output_protected_frame_size,
+                 &client_frame_protector) == TSI_OK);
+  size_t server_max_output_protected_frame_size =
+      config->server_max_output_protected_frame_size;
+  GPR_ASSERT(tsi_handshaker_result_create_frame_protector(
+                 fixture->server_result,
+                 server_max_output_protected_frame_size == 0
+                     ? NULL
+                     : &server_max_output_protected_frame_size,
+                 &server_frame_protector) == TSI_OK);
+  /* Client sends a message to server. */
+  send_message_to_peer(fixture, client_frame_protector, true /* is_client */);
+  unsigned char* server_received_message =
+      static_cast<unsigned char*>(gpr_zalloc(TSI_TEST_DEFAULT_CHANNEL_SIZE));
+  size_t server_received_message_size = 0;
+  receive_message_from_peer(
+      fixture, server_frame_protector, server_received_message,
+      &server_received_message_size, false /* is_client */);
+  GPR_ASSERT(config->client_message_size == server_received_message_size);
+  GPR_ASSERT(memcmp(config->client_message, server_received_message,
+                    server_received_message_size) == 0);
+  /* Server sends a message to client. */
+  send_message_to_peer(fixture, server_frame_protector, false /* is_client */);
+  unsigned char* client_received_message =
+      static_cast<unsigned char*>(gpr_zalloc(TSI_TEST_DEFAULT_CHANNEL_SIZE));
+  size_t client_received_message_size = 0;
+  receive_message_from_peer(
+      fixture, client_frame_protector, client_received_message,
+      &client_received_message_size, true /* is_client */);
+  GPR_ASSERT(config->server_message_size == client_received_message_size);
+  GPR_ASSERT(memcmp(config->server_message, client_received_message,
+                    client_received_message_size) == 0);
+  /* Destroy server and client frame protectors. */
+  tsi_frame_protector_destroy(client_frame_protector);
+  tsi_frame_protector_destroy(server_frame_protector);
+  gpr_free(server_received_message);
+  gpr_free(client_received_message);
+}
+
+static unsigned char* generate_random_message(size_t size) {
+  size_t i;
+  unsigned char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890";
+  unsigned char* output =
+      static_cast<unsigned char*>(gpr_zalloc(sizeof(unsigned char) * size));
+  for (i = 0; i < size - 1; ++i) {
+    output[i] = chars[rand() % (int)(sizeof(chars) - 1)];
+  }
+  return output;
+}
+
+tsi_test_frame_protector_config* tsi_test_frame_protector_config_create(
+    bool use_default_read_buffer_allocated_size,
+    bool use_default_message_buffer_allocated_size,
+    bool use_default_protected_buffer_size, bool use_default_client_message,
+    bool use_default_server_message,
+    bool use_default_client_max_output_protected_frame_size,
+    bool use_default_server_max_output_protected_frame_size,
+    bool use_default_handshake_buffer_size) {
+  tsi_test_frame_protector_config* config =
+      static_cast<tsi_test_frame_protector_config*>(
+          gpr_zalloc(sizeof(*config)));
+  /* Set the value for read_buffer_allocated_size. */
+  config->read_buffer_allocated_size =
+      use_default_read_buffer_allocated_size
+          ? TSI_TEST_DEFAULT_BUFFER_SIZE
+          : TSI_TEST_SMALL_READ_BUFFER_ALLOCATED_SIZE;
+  /* Set the value for message_buffer_allocated_size. */
+  config->message_buffer_allocated_size =
+      use_default_message_buffer_allocated_size
+          ? TSI_TEST_DEFAULT_BUFFER_SIZE
+          : TSI_TEST_SMALL_MESSAGE_BUFFER_ALLOCATED_SIZE;
+  /* Set the value for protected_buffer_size. */
+  config->protected_buffer_size = use_default_protected_buffer_size
+                                      ? TSI_TEST_DEFAULT_PROTECTED_BUFFER_SIZE
+                                      : TSI_TEST_SMALL_PROTECTED_BUFFER_SIZE;
+  /* Set the value for client message. */
+  config->client_message_size = use_default_client_message
+                                    ? TSI_TEST_BIG_MESSAGE_SIZE
+                                    : TSI_TEST_SMALL_MESSAGE_SIZE;
+  config->client_message =
+      use_default_client_message
+          ? generate_random_message(TSI_TEST_BIG_MESSAGE_SIZE)
+          : generate_random_message(TSI_TEST_SMALL_MESSAGE_SIZE);
+  /* Set the value for server message. */
+  config->server_message_size = use_default_server_message
+                                    ? TSI_TEST_BIG_MESSAGE_SIZE
+                                    : TSI_TEST_SMALL_MESSAGE_SIZE;
+  config->server_message =
+      use_default_server_message
+          ? generate_random_message(TSI_TEST_BIG_MESSAGE_SIZE)
+          : generate_random_message(TSI_TEST_SMALL_MESSAGE_SIZE);
+  /* Set the value for client max_output_protected_frame_size.
+     If it is 0, we pass NULL to tsi_handshaker_result_create_frame_protector(),
+     which then uses default protected frame size for it. */
+  config->client_max_output_protected_frame_size =
+      use_default_client_max_output_protected_frame_size
+          ? 0
+          : TSI_TEST_SMALL_CLIENT_MAX_OUTPUT_PROTECTED_FRAME_SIZE;
+  /* Set the value for server max_output_protected_frame_size.
+     If it is 0, we pass NULL to tsi_handshaker_result_create_frame_protector(),
+     which then uses default protected frame size for it. */
+  config->server_max_output_protected_frame_size =
+      use_default_server_max_output_protected_frame_size
+          ? 0
+          : TSI_TEST_SMALL_SERVER_MAX_OUTPUT_PROTECTED_FRAME_SIZE;
+  return config;
+}
+
+void tsi_test_frame_protector_config_set_buffer_size(
+    tsi_test_frame_protector_config* config, size_t read_buffer_allocated_size,
+    size_t message_buffer_allocated_size, size_t protected_buffer_size,
+    size_t client_max_output_protected_frame_size,
+    size_t server_max_output_protected_frame_size) {
+  GPR_ASSERT(config != NULL);
+  config->read_buffer_allocated_size = read_buffer_allocated_size;
+  config->message_buffer_allocated_size = message_buffer_allocated_size;
+  config->protected_buffer_size = protected_buffer_size;
+  config->client_max_output_protected_frame_size =
+      client_max_output_protected_frame_size;
+  config->server_max_output_protected_frame_size =
+      server_max_output_protected_frame_size;
+}
+
+void tsi_test_frame_protector_config_destroy(
+    tsi_test_frame_protector_config* config) {
+  GPR_ASSERT(config != NULL);
+  gpr_free(config->client_message);
+  gpr_free(config->server_message);
+  gpr_free(config);
+}
+
+void tsi_test_fixture_init(tsi_test_fixture* fixture) {
+  fixture->config = tsi_test_frame_protector_config_create(
+      true, true, true, true, true, true, true, true);
+  fixture->handshake_buffer_size = TSI_TEST_DEFAULT_BUFFER_SIZE;
+  fixture->client_channel =
+      static_cast<uint8_t*>(gpr_zalloc(TSI_TEST_DEFAULT_CHANNEL_SIZE));
+  fixture->server_channel =
+      static_cast<uint8_t*>(gpr_zalloc(TSI_TEST_DEFAULT_CHANNEL_SIZE));
+  fixture->bytes_written_to_client_channel = 0;
+  fixture->bytes_written_to_server_channel = 0;
+  fixture->bytes_read_from_client_channel = 0;
+  fixture->bytes_read_from_server_channel = 0;
+  fixture->test_unused_bytes = true;
+  fixture->has_client_finished_first = false;
+  gpr_mu_init(&fixture->mu);
+  gpr_cv_init(&fixture->cv);
+  fixture->notified = false;
+}
+
+void tsi_test_fixture_destroy(tsi_test_fixture* fixture) {
+  GPR_ASSERT(fixture != NULL);
+  tsi_test_frame_protector_config_destroy(fixture->config);
+  tsi_handshaker_destroy(fixture->client_handshaker);
+  tsi_handshaker_destroy(fixture->server_handshaker);
+  tsi_handshaker_result_destroy(fixture->client_result);
+  tsi_handshaker_result_destroy(fixture->server_result);
+  gpr_free(fixture->client_channel);
+  gpr_free(fixture->server_channel);
+  GPR_ASSERT(fixture->vtable != NULL);
+  GPR_ASSERT(fixture->vtable->destruct != NULL);
+  fixture->vtable->destruct(fixture);
+  gpr_mu_destroy(&fixture->mu);
+  gpr_cv_destroy(&fixture->cv);
+  gpr_free(fixture);
+}
diff --git a/test/core/tsi/transport_security_test_lib.h b/test/core/tsi/transport_security_test_lib.h
index ed8ff85..9b07448 100644
--- a/test/core/tsi/transport_security_test_lib.h
+++ b/test/core/tsi/transport_security_test_lib.h
@@ -21,9 +21,7 @@
 
 #include "src/core/tsi/transport_security_interface.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <grpc/support/sync.h>
 
 #define TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE 32
 #define TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE 128
@@ -57,29 +55,29 @@
 /* V-table for tsi_test_fixture operations that are implemented differently in
    different TSI implementations. */
 typedef struct tsi_test_fixture_vtable {
-  void (*setup_handshakers)(tsi_test_fixture *fixture);
-  void (*check_handshaker_peers)(tsi_test_fixture *fixture);
-  void (*destruct)(tsi_test_fixture *fixture);
+  void (*setup_handshakers)(tsi_test_fixture* fixture);
+  void (*check_handshaker_peers)(tsi_test_fixture* fixture);
+  void (*destruct)(tsi_test_fixture* fixture);
 } tsi_test_fixture_vtable;
 
 struct tsi_test_fixture {
-  const tsi_test_fixture_vtable *vtable;
+  const tsi_test_fixture_vtable* vtable;
   /* client/server TSI handshaker used to perform TSI handshakes, and will get
      instantiated during the call to setup_handshakers. */
-  tsi_handshaker *client_handshaker;
-  tsi_handshaker *server_handshaker;
+  tsi_handshaker* client_handshaker;
+  tsi_handshaker* server_handshaker;
   /* client/server TSI handshaker results used to store the result of TSI
      handshake. If the handshake fails, the result will store NULL upon
      finishing the handshake. */
-  tsi_handshaker_result *client_result;
-  tsi_handshaker_result *server_result;
+  tsi_handshaker_result* client_result;
+  tsi_handshaker_result* server_result;
   /* size of buffer used to store data received from the peer. */
   size_t handshake_buffer_size;
   /* simulated channels between client and server. If the server (client)
      wants to send data to the client (server), he will write data to
      client_channel (server_channel), which will be read by client (server). */
-  uint8_t *client_channel;
-  uint8_t *server_channel;
+  uint8_t* client_channel;
+  uint8_t* server_channel;
   /* size of data written to the client/server channel. */
   size_t bytes_written_to_client_channel;
   size_t bytes_written_to_server_channel;
@@ -87,7 +85,7 @@
   size_t bytes_read_from_client_channel;
   size_t bytes_read_from_server_channel;
   /* tsi_test_frame_protector_config instance */
-  tsi_test_frame_protector_config *config;
+  tsi_test_frame_protector_config* config;
   /* a flag indicating if client has finished TSI handshake first (i.e., before
      server).
      The flag should be referred if and only if TSI handshake finishes
@@ -119,8 +117,8 @@
   size_t client_max_output_protected_frame_size;
   size_t server_max_output_protected_frame_size;
   /* pointer that points to client/server message to be protected. */
-  uint8_t *client_message;
-  uint8_t *server_message;
+  uint8_t* client_message;
+  uint8_t* server_message;
   /* size of client/server message. */
   size_t client_message_size;
   size_t server_message_size;
@@ -131,7 +129,7 @@
    corresponding parameter with a default value or not. If it's false, it will
    be set with a specific value which is usually much smaller than the default.
    Both values are defined with #define directive. */
-tsi_test_frame_protector_config *tsi_test_frame_protector_config_create(
+tsi_test_frame_protector_config* tsi_test_frame_protector_config_create(
     bool use_default_read_buffer_allocated_size,
     bool use_default_message_buffer_allocated_size,
     bool use_default_protected_buffer_size, bool use_default_client_message,
@@ -143,38 +141,34 @@
 /* This method sets different buffer and frame sizes of a
    tsi_test_frame_protector_config instance with user provided values. */
 void tsi_test_frame_protector_config_set_buffer_size(
-    tsi_test_frame_protector_config *config, size_t read_buffer_allocated_size,
+    tsi_test_frame_protector_config* config, size_t read_buffer_allocated_size,
     size_t message_buffer_allocated_size, size_t protected_buffer_size,
     size_t client_max_output_protected_frame_size,
     size_t server_max_output_protected_frame_size);
 
 /* This method destroys a tsi_test_frame_protector_config instance. */
 void tsi_test_frame_protector_config_destroy(
-    tsi_test_frame_protector_config *config);
+    tsi_test_frame_protector_config* config);
 
 /* This method initializes members of tsi_test_fixture instance.
    Note that the struct instance should be allocated before making
    this call. */
-void tsi_test_fixture_init(tsi_test_fixture *fixture);
+void tsi_test_fixture_init(tsi_test_fixture* fixture);
 
 /* This method destroys a tsi_test_fixture instance. Note that the
    fixture intance must be dynamically allocated and will be freed by
    this function. */
-void tsi_test_fixture_destroy(tsi_test_fixture *fixture);
+void tsi_test_fixture_destroy(tsi_test_fixture* fixture);
 
 /* This method performs a full TSI handshake between a client and a server.
    Note that the test library will implement the new TSI handshaker API to
    perform handshakes. */
-void tsi_test_do_handshake(tsi_test_fixture *fixture);
+void tsi_test_do_handshake(tsi_test_fixture* fixture);
 
 /* This method performs a round trip test between the client and the server.
    That is, the client sends a protected message to a server who receives the
    message, and unprotects it. The same operation is triggered again with
    the client and server switching its role. */
-void tsi_test_do_round_trip(tsi_test_fixture *fixture);
-
-#ifdef __cplusplus
-}
-#endif
+void tsi_test_do_round_trip(tsi_test_fixture* fixture);
 
 #endif  // GRPC_TEST_CORE_TSI_TRANSPORT_SECURITY_TEST_LIB_H_
diff --git a/test/core/util/BUILD b/test/core/util/BUILD
index 5844a17..bc6fe9d 100644
--- a/test/core/util/BUILD
+++ b/test/core/util/BUILD
@@ -21,8 +21,8 @@
 grpc_cc_library(
     name = "gpr_test_util",
     srcs = [
-        "memory_counters.c",
-        "test_config.c",
+        "memory_counters.cc",
+        "test_config.cc",
     ],
     hdrs = [
         "memory_counters.h",
@@ -48,16 +48,16 @@
 grpc_cc_library(
     name = "grpc_test_util_base",
     srcs = [
-        "grpc_profiler.c",
-        "mock_endpoint.c",
-        "parse_hexstring.c",
-        "passthru_endpoint.c",
-        "port.c",
-        "port_server_client.c",
-        "reconnect_server.c",
-        "slice_splitter.c",
-        "test_tcp_server.c",
-        "trickle_endpoint.c",
+        "grpc_profiler.cc",
+        "mock_endpoint.cc",
+        "parse_hexstring.cc",
+        "passthru_endpoint.cc",
+        "port.cc",
+        "port_server_client.cc",
+        "reconnect_server.cc",
+        "slice_splitter.cc",
+        "test_tcp_server.cc",
+        "trickle_endpoint.cc",
     ],
     hdrs = [
         "grpc_profiler.h",
@@ -71,7 +71,7 @@
         "test_tcp_server.h",
         "trickle_endpoint.h",
     ],
-    language = "C",
+    language = "C++",
     deps = [
         ":gpr_test_util",
         "//:grpc_common",
@@ -83,7 +83,7 @@
     name = "grpc_test_util",
     srcs = [],
     hdrs = [],
-    language = "C",
+    language = "C++",
     deps = [
         ":grpc_test_util_base",
         "//:grpc",
@@ -94,7 +94,7 @@
     name = "grpc_test_util_unsecure",
     srcs = [],
     hdrs = [],
-    language = "C",
+    language = "C++",
     deps = [
         ":grpc_test_util_base",
         "//:grpc_unsecure",
diff --git a/test/core/util/debugger_macros.cc b/test/core/util/debugger_macros.cc
index 72384f2..d344c3f 100644
--- a/test/core/util/debugger_macros.cc
+++ b/test/core/util/debugger_macros.cc
@@ -29,14 +29,14 @@
 #include "src/core/lib/channel/connected_channel.h"
 #include "src/core/lib/surface/call.h"
 
-extern "C" void grpc_summon_debugger_macros() {}
+void grpc_summon_debugger_macros() {}
 
-grpc_stream *grpc_transport_stream_from_call(grpc_call *call) {
-  grpc_call_stack *cs = grpc_call_get_call_stack(call);
+grpc_stream* grpc_transport_stream_from_call(grpc_call* call) {
+  grpc_call_stack* cs = grpc_call_get_call_stack(call);
   for (;;) {
-    grpc_call_element *el = grpc_call_stack_element(cs, cs->count - 1);
+    grpc_call_element* el = grpc_call_stack_element(cs, cs->count - 1);
     if (el->filter == &grpc_client_channel_filter) {
-      grpc_subchannel_call *scc = grpc_client_channel_get_subchannel_call(el);
+      grpc_subchannel_call* scc = grpc_client_channel_get_subchannel_call(el);
       if (scc == NULL) {
         fprintf(stderr, "No subchannel-call");
         return NULL;
@@ -51,6 +51,6 @@
   }
 }
 
-grpc_chttp2_stream *grpc_chttp2_stream_from_call(grpc_call *call) {
-  return (grpc_chttp2_stream *)grpc_transport_stream_from_call(call);
+grpc_chttp2_stream* grpc_chttp2_stream_from_call(grpc_call* call) {
+  return (grpc_chttp2_stream*)grpc_transport_stream_from_call(call);
 }
diff --git a/test/core/util/debugger_macros.h b/test/core/util/debugger_macros.h
index 24718d9..c6b3720 100644
--- a/test/core/util/debugger_macros.h
+++ b/test/core/util/debugger_macros.h
@@ -19,14 +19,6 @@
 #ifndef GRPC_TEST_CORE_UTIL_DEBUGGER_MACROS_H
 #define GRPC_TEST_CORE_UTIL_DEBUGGER_MACROS_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif /*  __cplusplus */
-
 void grpc_summon_debugger_macros();
 
-#ifdef __cplusplus
-}
-#endif /*  __cplusplus */
-
 #endif /* GRPC_TEST_CORE_UTIL_DEBUGGER_MACROS_H */
diff --git a/test/core/util/grpc_profiler.c b/test/core/util/grpc_profiler.c
deleted file mode 100644
index 47b0270..0000000
--- a/test/core/util/grpc_profiler.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/util/grpc_profiler.h"
-
-#if GRPC_HAVE_PERFTOOLS
-#include <gperftools/profiler.h>
-
-void grpc_profiler_start(const char *filename) { ProfilerStart(filename); }
-
-void grpc_profiler_stop() { ProfilerStop(); }
-#else
-#include <grpc/support/log.h>
-
-void grpc_profiler_start(const char *filename) {
-  static int printed_warning = 0;
-  if (!printed_warning) {
-    gpr_log(GPR_DEBUG,
-            "You do not have google-perftools installed, profiling is disabled "
-            "[for %s]",
-            filename);
-    gpr_log(GPR_DEBUG,
-            "To install on ubuntu: sudo apt-get install google-perftools "
-            "libgoogle-perftools-dev");
-    printed_warning = 1;
-  }
-}
-
-void grpc_profiler_stop(void) {}
-#endif
diff --git a/test/core/util/grpc_profiler.cc b/test/core/util/grpc_profiler.cc
new file mode 100644
index 0000000..88f2335
--- /dev/null
+++ b/test/core/util/grpc_profiler.cc
@@ -0,0 +1,45 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/util/grpc_profiler.h"
+
+#if GRPC_HAVE_PERFTOOLS
+#include <gperftools/profiler.h>
+
+void grpc_profiler_start(const char* filename) { ProfilerStart(filename); }
+
+void grpc_profiler_stop() { ProfilerStop(); }
+#else
+#include <grpc/support/log.h>
+
+void grpc_profiler_start(const char* filename) {
+  static int printed_warning = 0;
+  if (!printed_warning) {
+    gpr_log(GPR_DEBUG,
+            "You do not have google-perftools installed, profiling is disabled "
+            "[for %s]",
+            filename);
+    gpr_log(GPR_DEBUG,
+            "To install on ubuntu: sudo apt-get install google-perftools "
+            "libgoogle-perftools-dev");
+    printed_warning = 1;
+  }
+}
+
+void grpc_profiler_stop(void) {}
+#endif
diff --git a/test/core/util/grpc_profiler.h b/test/core/util/grpc_profiler.h
index 8809f55..f9ddd22 100644
--- a/test/core/util/grpc_profiler.h
+++ b/test/core/util/grpc_profiler.h
@@ -19,15 +19,7 @@
 #ifndef GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H
 #define GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif /*  __cplusplus */
-
-void grpc_profiler_start(const char *filename);
+void grpc_profiler_start(const char* filename);
 void grpc_profiler_stop();
 
-#ifdef __cplusplus
-}
-#endif /*  __cplusplus */
-
 #endif /* GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H */
diff --git a/test/core/util/memory_counters.c b/test/core/util/memory_counters.c
deleted file mode 100644
index 9fb3ffe..0000000
--- a/test/core/util/memory_counters.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdint.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/sync.h>
-
-#include "test/core/util/memory_counters.h"
-
-static struct grpc_memory_counters g_memory_counters;
-static gpr_allocation_functions g_old_allocs;
-
-static void *guard_malloc(size_t size);
-static void *guard_realloc(void *vptr, size_t size);
-static void guard_free(void *vptr);
-
-#ifdef GPR_LOW_LEVEL_COUNTERS
-/* hide these from the microbenchmark atomic stats */
-#define NO_BARRIER_FETCH_ADD(x, sz) \
-  __atomic_fetch_add((x), (sz), __ATOMIC_RELAXED)
-#define NO_BARRIER_LOAD(x) __atomic_load_n((x), __ATOMIC_RELAXED)
-#else
-#define NO_BARRIER_FETCH_ADD(x, sz) gpr_atm_no_barrier_fetch_add(x, sz)
-#define NO_BARRIER_LOAD(x) gpr_atm_no_barrier_load(x)
-#endif
-
-static void *guard_malloc(size_t size) {
-  size_t *ptr;
-  if (!size) return NULL;
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_absolute, (gpr_atm)size);
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, (gpr_atm)size);
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_absolute, (gpr_atm)1);
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_relative, (gpr_atm)1);
-  ptr = (size_t *)g_old_allocs.malloc_fn(size + sizeof(size));
-  *ptr++ = size;
-  return ptr;
-}
-
-static void *guard_realloc(void *vptr, size_t size) {
-  size_t *ptr = (size_t *)vptr;
-  if (vptr == NULL) {
-    return guard_malloc(size);
-  }
-  if (size == 0) {
-    guard_free(vptr);
-    return NULL;
-  }
-  --ptr;
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_absolute, (gpr_atm)size);
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, -(gpr_atm)*ptr);
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, (gpr_atm)size);
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_absolute, (gpr_atm)1);
-  ptr = (size_t *)g_old_allocs.realloc_fn(ptr, size + sizeof(size));
-  *ptr++ = size;
-  return ptr;
-}
-
-static void guard_free(void *vptr) {
-  size_t *ptr = (size_t *)vptr;
-  if (!vptr) return;
-  --ptr;
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, -(gpr_atm)*ptr);
-  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_relative, -(gpr_atm)1);
-  g_old_allocs.free_fn(ptr);
-}
-
-struct gpr_allocation_functions g_guard_allocs = {guard_malloc, NULL,
-                                                  guard_realloc, guard_free};
-
-void grpc_memory_counters_init() {
-  memset(&g_memory_counters, 0, sizeof(g_memory_counters));
-  g_old_allocs = gpr_get_allocation_functions();
-  gpr_set_allocation_functions(g_guard_allocs);
-}
-
-void grpc_memory_counters_destroy() {
-  gpr_set_allocation_functions(g_old_allocs);
-}
-
-struct grpc_memory_counters grpc_memory_counters_snapshot() {
-  struct grpc_memory_counters counters;
-  counters.total_size_relative =
-      NO_BARRIER_LOAD(&g_memory_counters.total_size_relative);
-  counters.total_size_absolute =
-      NO_BARRIER_LOAD(&g_memory_counters.total_size_absolute);
-  counters.total_allocs_relative =
-      NO_BARRIER_LOAD(&g_memory_counters.total_allocs_relative);
-  counters.total_allocs_absolute =
-      NO_BARRIER_LOAD(&g_memory_counters.total_allocs_absolute);
-  return counters;
-}
diff --git a/test/core/util/memory_counters.cc b/test/core/util/memory_counters.cc
new file mode 100644
index 0000000..ff85a63
--- /dev/null
+++ b/test/core/util/memory_counters.cc
@@ -0,0 +1,108 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdint.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/sync.h>
+
+#include "test/core/util/memory_counters.h"
+
+static struct grpc_memory_counters g_memory_counters;
+static gpr_allocation_functions g_old_allocs;
+
+static void* guard_malloc(size_t size);
+static void* guard_realloc(void* vptr, size_t size);
+static void guard_free(void* vptr);
+
+#ifdef GPR_LOW_LEVEL_COUNTERS
+/* hide these from the microbenchmark atomic stats */
+#define NO_BARRIER_FETCH_ADD(x, sz) \
+  __atomic_fetch_add((x), (sz), __ATOMIC_RELAXED)
+#define NO_BARRIER_LOAD(x) __atomic_load_n((x), __ATOMIC_RELAXED)
+#else
+#define NO_BARRIER_FETCH_ADD(x, sz) gpr_atm_no_barrier_fetch_add(x, sz)
+#define NO_BARRIER_LOAD(x) gpr_atm_no_barrier_load(x)
+#endif
+
+static void* guard_malloc(size_t size) {
+  size_t* ptr;
+  if (!size) return NULL;
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_absolute, (gpr_atm)size);
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, (gpr_atm)size);
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_absolute, (gpr_atm)1);
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_relative, (gpr_atm)1);
+  ptr = (size_t*)g_old_allocs.malloc_fn(size + sizeof(size));
+  *ptr++ = size;
+  return ptr;
+}
+
+static void* guard_realloc(void* vptr, size_t size) {
+  size_t* ptr = (size_t*)vptr;
+  if (vptr == NULL) {
+    return guard_malloc(size);
+  }
+  if (size == 0) {
+    guard_free(vptr);
+    return NULL;
+  }
+  --ptr;
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_absolute, (gpr_atm)size);
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, -(gpr_atm)*ptr);
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, (gpr_atm)size);
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_absolute, (gpr_atm)1);
+  ptr = (size_t*)g_old_allocs.realloc_fn(ptr, size + sizeof(size));
+  *ptr++ = size;
+  return ptr;
+}
+
+static void guard_free(void* vptr) {
+  size_t* ptr = (size_t*)vptr;
+  if (!vptr) return;
+  --ptr;
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, -(gpr_atm)*ptr);
+  NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_relative, -(gpr_atm)1);
+  g_old_allocs.free_fn(ptr);
+}
+
+struct gpr_allocation_functions g_guard_allocs = {guard_malloc, NULL,
+                                                  guard_realloc, guard_free};
+
+void grpc_memory_counters_init() {
+  memset(&g_memory_counters, 0, sizeof(g_memory_counters));
+  g_old_allocs = gpr_get_allocation_functions();
+  gpr_set_allocation_functions(g_guard_allocs);
+}
+
+void grpc_memory_counters_destroy() {
+  gpr_set_allocation_functions(g_old_allocs);
+}
+
+struct grpc_memory_counters grpc_memory_counters_snapshot() {
+  struct grpc_memory_counters counters;
+  counters.total_size_relative =
+      NO_BARRIER_LOAD(&g_memory_counters.total_size_relative);
+  counters.total_size_absolute =
+      NO_BARRIER_LOAD(&g_memory_counters.total_size_absolute);
+  counters.total_allocs_relative =
+      NO_BARRIER_LOAD(&g_memory_counters.total_allocs_relative);
+  counters.total_allocs_absolute =
+      NO_BARRIER_LOAD(&g_memory_counters.total_allocs_absolute);
+  return counters;
+}
diff --git a/test/core/util/mock_endpoint.c b/test/core/util/mock_endpoint.c
deleted file mode 100644
index bd386b2..0000000
--- a/test/core/util/mock_endpoint.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
-   using that endpoint. Because of various transitive includes in uv.h,
-   including windows.h on Windows, uv.h must be included before other system
-   headers. Therefore, sockaddr.h must always be included first */
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "test/core/util/mock_endpoint.h"
-
-#include <inttypes.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-#include "src/core/lib/iomgr/sockaddr.h"
-
-typedef struct grpc_mock_endpoint {
-  grpc_endpoint base;
-  gpr_mu mu;
-  void (*on_write)(grpc_slice slice);
-  grpc_slice_buffer read_buffer;
-  grpc_slice_buffer *on_read_out;
-  grpc_closure *on_read;
-  grpc_resource_user *resource_user;
-} grpc_mock_endpoint;
-
-static void me_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                    grpc_slice_buffer *slices, grpc_closure *cb) {
-  grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
-  gpr_mu_lock(&m->mu);
-  if (m->read_buffer.count > 0) {
-    grpc_slice_buffer_swap(&m->read_buffer, slices);
-    GRPC_CLOSURE_SCHED(exec_ctx, cb, GRPC_ERROR_NONE);
-  } else {
-    m->on_read = cb;
-    m->on_read_out = slices;
-  }
-  gpr_mu_unlock(&m->mu);
-}
-
-static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                     grpc_slice_buffer *slices, grpc_closure *cb) {
-  grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
-  for (size_t i = 0; i < slices->count; i++) {
-    m->on_write(slices->slices[i]);
-  }
-  GRPC_CLOSURE_SCHED(exec_ctx, cb, GRPC_ERROR_NONE);
-}
-
-static void me_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                              grpc_pollset *pollset) {}
-
-static void me_add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                  grpc_pollset_set *pollset) {}
-
-static void me_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                        grpc_error *why) {
-  grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
-  gpr_mu_lock(&m->mu);
-  if (m->on_read) {
-    GRPC_CLOSURE_SCHED(exec_ctx, m->on_read,
-                       GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
-                           "Endpoint Shutdown", &why, 1));
-    m->on_read = NULL;
-  }
-  gpr_mu_unlock(&m->mu);
-  grpc_resource_user_shutdown(exec_ctx, m->resource_user);
-  GRPC_ERROR_UNREF(why);
-}
-
-static void me_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
-  grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
-  grpc_slice_buffer_destroy(&m->read_buffer);
-  grpc_resource_user_unref(exec_ctx, m->resource_user);
-  gpr_free(m);
-}
-
-static char *me_get_peer(grpc_endpoint *ep) {
-  return gpr_strdup("fake:mock_endpoint");
-}
-
-static grpc_resource_user *me_get_resource_user(grpc_endpoint *ep) {
-  grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
-  return m->resource_user;
-}
-
-static int me_get_fd(grpc_endpoint *ep) { return -1; }
-
-static const grpc_endpoint_vtable vtable = {
-    me_read,     me_write,   me_add_to_pollset,    me_add_to_pollset_set,
-    me_shutdown, me_destroy, me_get_resource_user, me_get_peer,
-    me_get_fd,
-};
-
-grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice),
-                                         grpc_resource_quota *resource_quota) {
-  grpc_mock_endpoint *m = (grpc_mock_endpoint *)gpr_malloc(sizeof(*m));
-  m->base.vtable = &vtable;
-  char *name;
-  gpr_asprintf(&name, "mock_endpoint_%" PRIxPTR, (intptr_t)m);
-  m->resource_user = grpc_resource_user_create(resource_quota, name);
-  gpr_free(name);
-  grpc_slice_buffer_init(&m->read_buffer);
-  gpr_mu_init(&m->mu);
-  m->on_write = on_write;
-  m->on_read = NULL;
-  return &m->base;
-}
-
-void grpc_mock_endpoint_put_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                 grpc_slice slice) {
-  grpc_mock_endpoint *m = (grpc_mock_endpoint *)ep;
-  gpr_mu_lock(&m->mu);
-  if (m->on_read != NULL) {
-    grpc_slice_buffer_add(m->on_read_out, slice);
-    GRPC_CLOSURE_SCHED(exec_ctx, m->on_read, GRPC_ERROR_NONE);
-    m->on_read = NULL;
-  } else {
-    grpc_slice_buffer_add(&m->read_buffer, slice);
-  }
-  gpr_mu_unlock(&m->mu);
-}
diff --git a/test/core/util/mock_endpoint.cc b/test/core/util/mock_endpoint.cc
new file mode 100644
index 0000000..a467dcd
--- /dev/null
+++ b/test/core/util/mock_endpoint.cc
@@ -0,0 +1,149 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
+   using that endpoint. Because of various transitive includes in uv.h,
+   including windows.h on Windows, uv.h must be included before other system
+   headers. Therefore, sockaddr.h must always be included first */
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include "test/core/util/mock_endpoint.h"
+
+#include <inttypes.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+#include "src/core/lib/iomgr/sockaddr.h"
+
+typedef struct grpc_mock_endpoint {
+  grpc_endpoint base;
+  gpr_mu mu;
+  void (*on_write)(grpc_slice slice);
+  grpc_slice_buffer read_buffer;
+  grpc_slice_buffer* on_read_out;
+  grpc_closure* on_read;
+  grpc_resource_user* resource_user;
+} grpc_mock_endpoint;
+
+static void me_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                    grpc_slice_buffer* slices, grpc_closure* cb) {
+  grpc_mock_endpoint* m = (grpc_mock_endpoint*)ep;
+  gpr_mu_lock(&m->mu);
+  if (m->read_buffer.count > 0) {
+    grpc_slice_buffer_swap(&m->read_buffer, slices);
+    GRPC_CLOSURE_SCHED(exec_ctx, cb, GRPC_ERROR_NONE);
+  } else {
+    m->on_read = cb;
+    m->on_read_out = slices;
+  }
+  gpr_mu_unlock(&m->mu);
+}
+
+static void me_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                     grpc_slice_buffer* slices, grpc_closure* cb) {
+  grpc_mock_endpoint* m = (grpc_mock_endpoint*)ep;
+  for (size_t i = 0; i < slices->count; i++) {
+    m->on_write(slices->slices[i]);
+  }
+  GRPC_CLOSURE_SCHED(exec_ctx, cb, GRPC_ERROR_NONE);
+}
+
+static void me_add_to_pollset(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                              grpc_pollset* pollset) {}
+
+static void me_add_to_pollset_set(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                  grpc_pollset_set* pollset) {}
+
+static void me_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                       grpc_endpoint* ep,
+                                       grpc_pollset_set* pollset) {}
+
+static void me_shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                        grpc_error* why) {
+  grpc_mock_endpoint* m = (grpc_mock_endpoint*)ep;
+  gpr_mu_lock(&m->mu);
+  if (m->on_read) {
+    GRPC_CLOSURE_SCHED(exec_ctx, m->on_read,
+                       GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+                           "Endpoint Shutdown", &why, 1));
+    m->on_read = NULL;
+  }
+  gpr_mu_unlock(&m->mu);
+  grpc_resource_user_shutdown(exec_ctx, m->resource_user);
+  GRPC_ERROR_UNREF(why);
+}
+
+static void me_destroy(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep) {
+  grpc_mock_endpoint* m = (grpc_mock_endpoint*)ep;
+  grpc_slice_buffer_destroy(&m->read_buffer);
+  grpc_resource_user_unref(exec_ctx, m->resource_user);
+  gpr_free(m);
+}
+
+static char* me_get_peer(grpc_endpoint* ep) {
+  return gpr_strdup("fake:mock_endpoint");
+}
+
+static grpc_resource_user* me_get_resource_user(grpc_endpoint* ep) {
+  grpc_mock_endpoint* m = (grpc_mock_endpoint*)ep;
+  return m->resource_user;
+}
+
+static int me_get_fd(grpc_endpoint* ep) { return -1; }
+
+static const grpc_endpoint_vtable vtable = {
+    me_read,
+    me_write,
+    me_add_to_pollset,
+    me_add_to_pollset_set,
+    me_delete_from_pollset_set,
+    me_shutdown,
+    me_destroy,
+    me_get_resource_user,
+    me_get_peer,
+    me_get_fd,
+};
+
+grpc_endpoint* grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice),
+                                         grpc_resource_quota* resource_quota) {
+  grpc_mock_endpoint* m = (grpc_mock_endpoint*)gpr_malloc(sizeof(*m));
+  m->base.vtable = &vtable;
+  char* name;
+  gpr_asprintf(&name, "mock_endpoint_%" PRIxPTR, (intptr_t)m);
+  m->resource_user = grpc_resource_user_create(resource_quota, name);
+  gpr_free(name);
+  grpc_slice_buffer_init(&m->read_buffer);
+  gpr_mu_init(&m->mu);
+  m->on_write = on_write;
+  m->on_read = NULL;
+  return &m->base;
+}
+
+void grpc_mock_endpoint_put_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                 grpc_slice slice) {
+  grpc_mock_endpoint* m = (grpc_mock_endpoint*)ep;
+  gpr_mu_lock(&m->mu);
+  if (m->on_read != NULL) {
+    grpc_slice_buffer_add(m->on_read_out, slice);
+    GRPC_CLOSURE_SCHED(exec_ctx, m->on_read, GRPC_ERROR_NONE);
+    m->on_read = NULL;
+  } else {
+    grpc_slice_buffer_add(&m->read_buffer, slice);
+  }
+  gpr_mu_unlock(&m->mu);
+}
diff --git a/test/core/util/mock_endpoint.h b/test/core/util/mock_endpoint.h
index 73b08dc..ccabaf7 100644
--- a/test/core/util/mock_endpoint.h
+++ b/test/core/util/mock_endpoint.h
@@ -21,10 +21,10 @@
 
 #include "src/core/lib/iomgr/endpoint.h"
 
-grpc_endpoint *grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice),
-                                         grpc_resource_quota *resource_quota);
-void grpc_mock_endpoint_put_read(grpc_exec_ctx *exec_ctx,
-                                 grpc_endpoint *mock_endpoint,
+grpc_endpoint* grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice),
+                                         grpc_resource_quota* resource_quota);
+void grpc_mock_endpoint_put_read(grpc_exec_ctx* exec_ctx,
+                                 grpc_endpoint* mock_endpoint,
                                  grpc_slice slice);
 
 #endif
diff --git a/test/core/util/one_corpus_entry_fuzzer.c b/test/core/util/one_corpus_entry_fuzzer.c
deleted file mode 100644
index 4246739..0000000
--- a/test/core/util/one_corpus_entry_fuzzer.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdbool.h>
-
-#include <grpc/support/log.h>
-#include "src/core/lib/iomgr/load_file.h"
-
-extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-extern bool squelch;
-extern bool leak_check;
-
-int main(int argc, char **argv) {
-  grpc_slice buffer;
-  squelch = false;
-  leak_check = false;
-  GPR_ASSERT(
-      GRPC_LOG_IF_ERROR("load_file", grpc_load_file(argv[1], 0, &buffer)));
-  LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer),
-                         GRPC_SLICE_LENGTH(buffer));
-  grpc_slice_unref(buffer);
-  return 0;
-}
diff --git a/test/core/util/one_corpus_entry_fuzzer.cc b/test/core/util/one_corpus_entry_fuzzer.cc
new file mode 100644
index 0000000..c0b67da
--- /dev/null
+++ b/test/core/util/one_corpus_entry_fuzzer.cc
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdbool.h>
+
+#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/load_file.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
+
+extern bool squelch;
+extern bool leak_check;
+
+int main(int argc, char** argv) {
+  grpc_slice buffer;
+  squelch = false;
+  leak_check = false;
+  GPR_ASSERT(
+      GRPC_LOG_IF_ERROR("load_file", grpc_load_file(argv[1], 0, &buffer)));
+  LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer),
+                         GRPC_SLICE_LENGTH(buffer));
+  grpc_slice_unref(buffer);
+  return 0;
+}
diff --git a/test/core/util/parse_hexstring.c b/test/core/util/parse_hexstring.c
deleted file mode 100644
index 346b871..0000000
--- a/test/core/util/parse_hexstring.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/util/parse_hexstring.h"
-#include <grpc/support/log.h>
-
-grpc_slice parse_hexstring(const char *hexstring) {
-  size_t nibbles = 0;
-  const char *p = 0;
-  uint8_t *out;
-  uint8_t temp;
-  grpc_slice slice;
-
-  for (p = hexstring; *p; p++) {
-    nibbles += (*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f');
-  }
-
-  GPR_ASSERT((nibbles & 1) == 0);
-
-  slice = grpc_slice_malloc(nibbles / 2);
-  out = GRPC_SLICE_START_PTR(slice);
-
-  nibbles = 0;
-  temp = 0;
-  for (p = hexstring; *p; p++) {
-    if (*p >= '0' && *p <= '9') {
-      temp = (uint8_t)(temp << 4) | (uint8_t)(*p - '0');
-      nibbles++;
-    } else if (*p >= 'a' && *p <= 'f') {
-      temp = (uint8_t)(temp << 4) | (uint8_t)(*p - 'a' + 10);
-      nibbles++;
-    }
-    if (nibbles == 2) {
-      *out++ = temp;
-      nibbles = 0;
-    }
-  }
-
-  return slice;
-}
diff --git a/test/core/util/parse_hexstring.cc b/test/core/util/parse_hexstring.cc
new file mode 100644
index 0000000..6dee0f1
--- /dev/null
+++ b/test/core/util/parse_hexstring.cc
@@ -0,0 +1,55 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/util/parse_hexstring.h"
+#include <grpc/support/log.h>
+
+grpc_slice parse_hexstring(const char* hexstring) {
+  size_t nibbles = 0;
+  const char* p = 0;
+  uint8_t* out;
+  uint8_t temp;
+  grpc_slice slice;
+
+  for (p = hexstring; *p; p++) {
+    nibbles += (*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f');
+  }
+
+  GPR_ASSERT((nibbles & 1) == 0);
+
+  slice = grpc_slice_malloc(nibbles / 2);
+  out = GRPC_SLICE_START_PTR(slice);
+
+  nibbles = 0;
+  temp = 0;
+  for (p = hexstring; *p; p++) {
+    if (*p >= '0' && *p <= '9') {
+      temp = (uint8_t)(temp << 4) | (uint8_t)(*p - '0');
+      nibbles++;
+    } else if (*p >= 'a' && *p <= 'f') {
+      temp = (uint8_t)(temp << 4) | (uint8_t)(*p - 'a' + 10);
+      nibbles++;
+    }
+    if (nibbles == 2) {
+      *out++ = temp;
+      nibbles = 0;
+    }
+  }
+
+  return slice;
+}
diff --git a/test/core/util/parse_hexstring.h b/test/core/util/parse_hexstring.h
index deab747..b7d54c1 100644
--- a/test/core/util/parse_hexstring.h
+++ b/test/core/util/parse_hexstring.h
@@ -21,6 +21,6 @@
 
 #include <grpc/slice.h>
 
-grpc_slice parse_hexstring(const char *hexstring);
+grpc_slice parse_hexstring(const char* hexstring);
 
 #endif /* GRPC_TEST_CORE_UTIL_PARSE_HEXSTRING_H */
diff --git a/test/core/util/passthru_endpoint.c b/test/core/util/passthru_endpoint.c
deleted file mode 100644
index 38a4758..0000000
--- a/test/core/util/passthru_endpoint.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
-   using that endpoint. Because of various transitive includes in uv.h,
-   including windows.h on Windows, uv.h must be included before other system
-   headers. Therefore, sockaddr.h must always be included first */
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "test/core/util/passthru_endpoint.h"
-
-#include <inttypes.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "src/core/lib/slice/slice_internal.h"
-
-typedef struct passthru_endpoint passthru_endpoint;
-
-typedef struct {
-  grpc_endpoint base;
-  passthru_endpoint *parent;
-  grpc_slice_buffer read_buffer;
-  grpc_slice_buffer *on_read_out;
-  grpc_closure *on_read;
-  grpc_resource_user *resource_user;
-} half;
-
-struct passthru_endpoint {
-  gpr_mu mu;
-  int halves;
-  grpc_passthru_endpoint_stats *stats;
-  grpc_passthru_endpoint_stats
-      dummy_stats;  // used if constructor stats == NULL
-  bool shutdown;
-  half client;
-  half server;
-};
-
-static void me_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                    grpc_slice_buffer *slices, grpc_closure *cb) {
-  half *m = (half *)ep;
-  gpr_mu_lock(&m->parent->mu);
-  if (m->parent->shutdown) {
-    GRPC_CLOSURE_SCHED(
-        exec_ctx, cb, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already shutdown"));
-  } else if (m->read_buffer.count > 0) {
-    grpc_slice_buffer_swap(&m->read_buffer, slices);
-    GRPC_CLOSURE_SCHED(exec_ctx, cb, GRPC_ERROR_NONE);
-  } else {
-    m->on_read = cb;
-    m->on_read_out = slices;
-  }
-  gpr_mu_unlock(&m->parent->mu);
-}
-
-static half *other_half(half *h) {
-  if (h == &h->parent->client) return &h->parent->server;
-  return &h->parent->client;
-}
-
-static void me_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                     grpc_slice_buffer *slices, grpc_closure *cb) {
-  half *m = other_half((half *)ep);
-  gpr_mu_lock(&m->parent->mu);
-  grpc_error *error = GRPC_ERROR_NONE;
-  m->parent->stats->num_writes++;
-  if (m->parent->shutdown) {
-    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Endpoint already shutdown");
-  } else if (m->on_read != NULL) {
-    for (size_t i = 0; i < slices->count; i++) {
-      grpc_slice_buffer_add(m->on_read_out, grpc_slice_copy(slices->slices[i]));
-    }
-    GRPC_CLOSURE_SCHED(exec_ctx, m->on_read, GRPC_ERROR_NONE);
-    m->on_read = NULL;
-  } else {
-    for (size_t i = 0; i < slices->count; i++) {
-      grpc_slice_buffer_add(&m->read_buffer,
-                            grpc_slice_copy(slices->slices[i]));
-    }
-  }
-  gpr_mu_unlock(&m->parent->mu);
-  GRPC_CLOSURE_SCHED(exec_ctx, cb, error);
-}
-
-static void me_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                              grpc_pollset *pollset) {}
-
-static void me_add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                  grpc_pollset_set *pollset) {}
-
-static void me_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                        grpc_error *why) {
-  half *m = (half *)ep;
-  gpr_mu_lock(&m->parent->mu);
-  m->parent->shutdown = true;
-  if (m->on_read) {
-    GRPC_CLOSURE_SCHED(
-        exec_ctx, m->on_read,
-        GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING("Shutdown", &why, 1));
-    m->on_read = NULL;
-  }
-  m = other_half(m);
-  if (m->on_read) {
-    GRPC_CLOSURE_SCHED(
-        exec_ctx, m->on_read,
-        GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING("Shutdown", &why, 1));
-    m->on_read = NULL;
-  }
-  gpr_mu_unlock(&m->parent->mu);
-  grpc_resource_user_shutdown(exec_ctx, m->resource_user);
-  GRPC_ERROR_UNREF(why);
-}
-
-static void me_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
-  passthru_endpoint *p = ((half *)ep)->parent;
-  gpr_mu_lock(&p->mu);
-  if (0 == --p->halves) {
-    gpr_mu_unlock(&p->mu);
-    gpr_mu_destroy(&p->mu);
-    grpc_slice_buffer_destroy_internal(exec_ctx, &p->client.read_buffer);
-    grpc_slice_buffer_destroy_internal(exec_ctx, &p->server.read_buffer);
-    grpc_resource_user_unref(exec_ctx, p->client.resource_user);
-    grpc_resource_user_unref(exec_ctx, p->server.resource_user);
-    gpr_free(p);
-  } else {
-    gpr_mu_unlock(&p->mu);
-  }
-}
-
-static char *me_get_peer(grpc_endpoint *ep) {
-  passthru_endpoint *p = ((half *)ep)->parent;
-  return ((half *)ep) == &p->client ? gpr_strdup("fake:mock_client_endpoint")
-                                    : gpr_strdup("fake:mock_server_endpoint");
-}
-
-static int me_get_fd(grpc_endpoint *ep) { return -1; }
-
-static grpc_resource_user *me_get_resource_user(grpc_endpoint *ep) {
-  half *m = (half *)ep;
-  return m->resource_user;
-}
-
-static const grpc_endpoint_vtable vtable = {
-    me_read,     me_write,   me_add_to_pollset,    me_add_to_pollset_set,
-    me_shutdown, me_destroy, me_get_resource_user, me_get_peer,
-    me_get_fd,
-};
-
-static void half_init(half *m, passthru_endpoint *parent,
-                      grpc_resource_quota *resource_quota,
-                      const char *half_name) {
-  m->base.vtable = &vtable;
-  m->parent = parent;
-  grpc_slice_buffer_init(&m->read_buffer);
-  m->on_read = NULL;
-  char *name;
-  gpr_asprintf(&name, "passthru_endpoint_%s_%" PRIxPTR, half_name,
-               (intptr_t)parent);
-  m->resource_user = grpc_resource_user_create(resource_quota, name);
-  gpr_free(name);
-}
-
-void grpc_passthru_endpoint_create(grpc_endpoint **client,
-                                   grpc_endpoint **server,
-                                   grpc_resource_quota *resource_quota,
-                                   grpc_passthru_endpoint_stats *stats) {
-  passthru_endpoint *m = (passthru_endpoint *)gpr_malloc(sizeof(*m));
-  m->halves = 2;
-  m->shutdown = 0;
-  m->stats = stats == NULL ? &m->dummy_stats : stats;
-  memset(m->stats, 0, sizeof(*m->stats));
-  half_init(&m->client, m, resource_quota, "client");
-  half_init(&m->server, m, resource_quota, "server");
-  gpr_mu_init(&m->mu);
-  *client = &m->client.base;
-  *server = &m->server.base;
-}
diff --git a/test/core/util/passthru_endpoint.cc b/test/core/util/passthru_endpoint.cc
new file mode 100644
index 0000000..acce902
--- /dev/null
+++ b/test/core/util/passthru_endpoint.cc
@@ -0,0 +1,207 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
+   using that endpoint. Because of various transitive includes in uv.h,
+   including windows.h on Windows, uv.h must be included before other system
+   headers. Therefore, sockaddr.h must always be included first */
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include "test/core/util/passthru_endpoint.h"
+
+#include <inttypes.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include "src/core/lib/slice/slice_internal.h"
+
+typedef struct passthru_endpoint passthru_endpoint;
+
+typedef struct {
+  grpc_endpoint base;
+  passthru_endpoint* parent;
+  grpc_slice_buffer read_buffer;
+  grpc_slice_buffer* on_read_out;
+  grpc_closure* on_read;
+  grpc_resource_user* resource_user;
+} half;
+
+struct passthru_endpoint {
+  gpr_mu mu;
+  int halves;
+  grpc_passthru_endpoint_stats* stats;
+  grpc_passthru_endpoint_stats
+      dummy_stats;  // used if constructor stats == NULL
+  bool shutdown;
+  half client;
+  half server;
+};
+
+static void me_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                    grpc_slice_buffer* slices, grpc_closure* cb) {
+  half* m = (half*)ep;
+  gpr_mu_lock(&m->parent->mu);
+  if (m->parent->shutdown) {
+    GRPC_CLOSURE_SCHED(
+        exec_ctx, cb, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already shutdown"));
+  } else if (m->read_buffer.count > 0) {
+    grpc_slice_buffer_swap(&m->read_buffer, slices);
+    GRPC_CLOSURE_SCHED(exec_ctx, cb, GRPC_ERROR_NONE);
+  } else {
+    m->on_read = cb;
+    m->on_read_out = slices;
+  }
+  gpr_mu_unlock(&m->parent->mu);
+}
+
+static half* other_half(half* h) {
+  if (h == &h->parent->client) return &h->parent->server;
+  return &h->parent->client;
+}
+
+static void me_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                     grpc_slice_buffer* slices, grpc_closure* cb) {
+  half* m = other_half((half*)ep);
+  gpr_mu_lock(&m->parent->mu);
+  grpc_error* error = GRPC_ERROR_NONE;
+  gpr_atm_no_barrier_fetch_add(&m->parent->stats->num_writes, (gpr_atm)1);
+  if (m->parent->shutdown) {
+    error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Endpoint already shutdown");
+  } else if (m->on_read != NULL) {
+    for (size_t i = 0; i < slices->count; i++) {
+      grpc_slice_buffer_add(m->on_read_out, grpc_slice_copy(slices->slices[i]));
+    }
+    GRPC_CLOSURE_SCHED(exec_ctx, m->on_read, GRPC_ERROR_NONE);
+    m->on_read = NULL;
+  } else {
+    for (size_t i = 0; i < slices->count; i++) {
+      grpc_slice_buffer_add(&m->read_buffer,
+                            grpc_slice_copy(slices->slices[i]));
+    }
+  }
+  gpr_mu_unlock(&m->parent->mu);
+  GRPC_CLOSURE_SCHED(exec_ctx, cb, error);
+}
+
+static void me_add_to_pollset(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                              grpc_pollset* pollset) {}
+
+static void me_add_to_pollset_set(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                  grpc_pollset_set* pollset) {}
+
+static void me_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                       grpc_endpoint* ep,
+                                       grpc_pollset_set* pollset) {}
+
+static void me_shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                        grpc_error* why) {
+  half* m = (half*)ep;
+  gpr_mu_lock(&m->parent->mu);
+  m->parent->shutdown = true;
+  if (m->on_read) {
+    GRPC_CLOSURE_SCHED(
+        exec_ctx, m->on_read,
+        GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING("Shutdown", &why, 1));
+    m->on_read = NULL;
+  }
+  m = other_half(m);
+  if (m->on_read) {
+    GRPC_CLOSURE_SCHED(
+        exec_ctx, m->on_read,
+        GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING("Shutdown", &why, 1));
+    m->on_read = NULL;
+  }
+  gpr_mu_unlock(&m->parent->mu);
+  grpc_resource_user_shutdown(exec_ctx, m->resource_user);
+  GRPC_ERROR_UNREF(why);
+}
+
+static void me_destroy(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep) {
+  passthru_endpoint* p = ((half*)ep)->parent;
+  gpr_mu_lock(&p->mu);
+  if (0 == --p->halves) {
+    gpr_mu_unlock(&p->mu);
+    gpr_mu_destroy(&p->mu);
+    grpc_slice_buffer_destroy_internal(exec_ctx, &p->client.read_buffer);
+    grpc_slice_buffer_destroy_internal(exec_ctx, &p->server.read_buffer);
+    grpc_resource_user_unref(exec_ctx, p->client.resource_user);
+    grpc_resource_user_unref(exec_ctx, p->server.resource_user);
+    gpr_free(p);
+  } else {
+    gpr_mu_unlock(&p->mu);
+  }
+}
+
+static char* me_get_peer(grpc_endpoint* ep) {
+  passthru_endpoint* p = ((half*)ep)->parent;
+  return ((half*)ep) == &p->client ? gpr_strdup("fake:mock_client_endpoint")
+                                   : gpr_strdup("fake:mock_server_endpoint");
+}
+
+static int me_get_fd(grpc_endpoint* ep) { return -1; }
+
+static grpc_resource_user* me_get_resource_user(grpc_endpoint* ep) {
+  half* m = (half*)ep;
+  return m->resource_user;
+}
+
+static const grpc_endpoint_vtable vtable = {
+    me_read,
+    me_write,
+    me_add_to_pollset,
+    me_add_to_pollset_set,
+    me_delete_from_pollset_set,
+    me_shutdown,
+    me_destroy,
+    me_get_resource_user,
+    me_get_peer,
+    me_get_fd,
+};
+
+static void half_init(half* m, passthru_endpoint* parent,
+                      grpc_resource_quota* resource_quota,
+                      const char* half_name) {
+  m->base.vtable = &vtable;
+  m->parent = parent;
+  grpc_slice_buffer_init(&m->read_buffer);
+  m->on_read = NULL;
+  char* name;
+  gpr_asprintf(&name, "passthru_endpoint_%s_%" PRIxPTR, half_name,
+               (intptr_t)parent);
+  m->resource_user = grpc_resource_user_create(resource_quota, name);
+  gpr_free(name);
+}
+
+void grpc_passthru_endpoint_create(grpc_endpoint** client,
+                                   grpc_endpoint** server,
+                                   grpc_resource_quota* resource_quota,
+                                   grpc_passthru_endpoint_stats* stats) {
+  passthru_endpoint* m = (passthru_endpoint*)gpr_malloc(sizeof(*m));
+  m->halves = 2;
+  m->shutdown = 0;
+  m->stats = stats == NULL ? &m->dummy_stats : stats;
+  memset(m->stats, 0, sizeof(*m->stats));
+  half_init(&m->client, m, resource_quota, "client");
+  half_init(&m->server, m, resource_quota, "server");
+  gpr_mu_init(&m->mu);
+  *client = &m->client.base;
+  *server = &m->server.base;
+}
diff --git a/test/core/util/passthru_endpoint.h b/test/core/util/passthru_endpoint.h
index da76902..bddd8ea 100644
--- a/test/core/util/passthru_endpoint.h
+++ b/test/core/util/passthru_endpoint.h
@@ -19,13 +19,17 @@
 #ifndef MOCK_ENDPOINT_H
 #define MOCK_ENDPOINT_H
 
+#include <grpc/support/atm.h>
+
 #include "src/core/lib/iomgr/endpoint.h"
 
-typedef struct { int num_writes; } grpc_passthru_endpoint_stats;
+typedef struct {
+  gpr_atm num_writes;
+} grpc_passthru_endpoint_stats;
 
-void grpc_passthru_endpoint_create(grpc_endpoint **client,
-                                   grpc_endpoint **server,
-                                   grpc_resource_quota *resource_quota,
-                                   grpc_passthru_endpoint_stats *stats);
+void grpc_passthru_endpoint_create(grpc_endpoint** client,
+                                   grpc_endpoint** server,
+                                   grpc_resource_quota* resource_quota,
+                                   grpc_passthru_endpoint_stats* stats);
 
 #endif
diff --git a/test/core/util/port.c b/test/core/util/port.c
deleted file mode 100644
index 61f2e50..0000000
--- a/test/core/util/port.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/port.h"
-#include "test/core/util/test_config.h"
-#if defined(GRPC_TEST_PICK_PORT)
-
-#include "test/core/util/port.h"
-
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/http/httpcli.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-#include "test/core/util/port_server_client.h"
-
-static int *chosen_ports = NULL;
-static size_t num_chosen_ports = 0;
-
-static int free_chosen_port(int port) {
-  size_t i;
-  int found = 0;
-  size_t found_at = 0;
-  /* Find the port and erase it from the list, then tell the server it can be
-     freed. */
-  for (i = 0; i < num_chosen_ports; i++) {
-    if (chosen_ports[i] == port) {
-      GPR_ASSERT(found == 0);
-      found = 1;
-      found_at = i;
-    }
-  }
-  if (found) {
-    chosen_ports[found_at] = chosen_ports[num_chosen_ports - 1];
-    num_chosen_ports--;
-    grpc_free_port_using_server(port);
-  }
-  return found;
-}
-
-static void free_chosen_ports(void) {
-  size_t i;
-  grpc_init();
-  for (i = 0; i < num_chosen_ports; i++) {
-    grpc_free_port_using_server(chosen_ports[i]);
-  }
-  grpc_shutdown();
-  gpr_free(chosen_ports);
-}
-
-static void chose_port(int port) {
-  if (chosen_ports == NULL) {
-    atexit(free_chosen_ports);
-  }
-  num_chosen_ports++;
-  chosen_ports =
-      (int *)gpr_realloc(chosen_ports, sizeof(int) * num_chosen_ports);
-  chosen_ports[num_chosen_ports - 1] = port;
-}
-
-static int grpc_pick_unused_port_impl(void) {
-  int port = grpc_pick_port_using_server();
-  if (port != 0) {
-    chose_port(port);
-  }
-
-  return port;
-}
-
-static int grpc_pick_unused_port_or_die_impl(void) {
-  int port = grpc_pick_unused_port();
-  if (port == 0) {
-    fprintf(stderr,
-            "gRPC tests require a helper port server to allocate ports used \n"
-            "during the test.\n\n"
-            "This server is not currently running.\n\n"
-            "To start it, run tools/run_tests/start_port_server.py\n\n");
-    exit(1);
-  }
-  return port;
-}
-
-static void grpc_recycle_unused_port_impl(int port) {
-  GPR_ASSERT(free_chosen_port(port));
-}
-
-static grpc_pick_port_functions g_pick_port_functions = {
-    grpc_pick_unused_port_impl, grpc_pick_unused_port_or_die_impl,
-    grpc_recycle_unused_port_impl};
-
-int grpc_pick_unused_port(void) {
-  return g_pick_port_functions.pick_unused_port_fn();
-}
-
-int grpc_pick_unused_port_or_die(void) {
-  return g_pick_port_functions.pick_unused_port_or_die_fn();
-}
-
-void grpc_recycle_unused_port(int port) {
-  g_pick_port_functions.recycle_unused_port_fn(port);
-}
-
-void grpc_set_pick_port_functions(grpc_pick_port_functions functions) {
-  GPR_ASSERT(functions.pick_unused_port_fn != NULL);
-  GPR_ASSERT(functions.pick_unused_port_or_die_fn != NULL);
-  GPR_ASSERT(functions.recycle_unused_port_fn != NULL);
-  g_pick_port_functions = functions;
-}
-
-#endif /* GRPC_TEST_PICK_PORT */
diff --git a/test/core/util/port.cc b/test/core/util/port.cc
new file mode 100644
index 0000000..c5bebe0
--- /dev/null
+++ b/test/core/util/port.cc
@@ -0,0 +1,132 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/port.h"
+#include "test/core/util/test_config.h"
+#if defined(GRPC_TEST_PICK_PORT)
+
+#include "test/core/util/port.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/http/httpcli.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "test/core/util/port_server_client.h"
+
+static int* chosen_ports = NULL;
+static size_t num_chosen_ports = 0;
+
+static int free_chosen_port(int port) {
+  size_t i;
+  int found = 0;
+  size_t found_at = 0;
+  /* Find the port and erase it from the list, then tell the server it can be
+     freed. */
+  for (i = 0; i < num_chosen_ports; i++) {
+    if (chosen_ports[i] == port) {
+      GPR_ASSERT(found == 0);
+      found = 1;
+      found_at = i;
+    }
+  }
+  if (found) {
+    chosen_ports[found_at] = chosen_ports[num_chosen_ports - 1];
+    num_chosen_ports--;
+    grpc_free_port_using_server(port);
+  }
+  return found;
+}
+
+static void free_chosen_ports(void) {
+  size_t i;
+  grpc_init();
+  for (i = 0; i < num_chosen_ports; i++) {
+    grpc_free_port_using_server(chosen_ports[i]);
+  }
+  grpc_shutdown();
+  gpr_free(chosen_ports);
+}
+
+static void chose_port(int port) {
+  if (chosen_ports == NULL) {
+    atexit(free_chosen_ports);
+  }
+  num_chosen_ports++;
+  chosen_ports =
+      (int*)gpr_realloc(chosen_ports, sizeof(int) * num_chosen_ports);
+  chosen_ports[num_chosen_ports - 1] = port;
+}
+
+static int grpc_pick_unused_port_impl(void) {
+  int port = grpc_pick_port_using_server();
+  if (port != 0) {
+    chose_port(port);
+  }
+
+  return port;
+}
+
+static int grpc_pick_unused_port_or_die_impl(void) {
+  int port = grpc_pick_unused_port();
+  if (port == 0) {
+    fprintf(stderr,
+            "gRPC tests require a helper port server to allocate ports used \n"
+            "during the test.\n\n"
+            "This server is not currently running.\n\n"
+            "To start it, run tools/run_tests/start_port_server.py\n\n");
+    exit(1);
+  }
+  return port;
+}
+
+static void grpc_recycle_unused_port_impl(int port) {
+  GPR_ASSERT(free_chosen_port(port));
+}
+
+static grpc_pick_port_functions g_pick_port_functions = {
+    grpc_pick_unused_port_impl, grpc_pick_unused_port_or_die_impl,
+    grpc_recycle_unused_port_impl};
+
+int grpc_pick_unused_port(void) {
+  return g_pick_port_functions.pick_unused_port_fn();
+}
+
+int grpc_pick_unused_port_or_die(void) {
+  return g_pick_port_functions.pick_unused_port_or_die_fn();
+}
+
+void grpc_recycle_unused_port(int port) {
+  g_pick_port_functions.recycle_unused_port_fn(port);
+}
+
+void grpc_set_pick_port_functions(grpc_pick_port_functions functions) {
+  GPR_ASSERT(functions.pick_unused_port_fn != NULL);
+  GPR_ASSERT(functions.pick_unused_port_or_die_fn != NULL);
+  GPR_ASSERT(functions.recycle_unused_port_fn != NULL);
+  g_pick_port_functions = functions;
+}
+
+#endif /* GRPC_TEST_PICK_PORT */
diff --git a/test/core/util/port_server_client.c b/test/core/util/port_server_client.c
deleted file mode 100644
index 7b94ac4..0000000
--- a/test/core/util/port_server_client.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-#include "test/core/util/test_config.h"
-
-#ifdef GRPC_TEST_PICK_PORT
-#include "test/core/util/port_server_client.h"
-
-#include <math.h>
-#include <string.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/http/httpcli.h"
-
-typedef struct freereq {
-  gpr_mu *mu;
-  grpc_polling_entity pops;
-  int done;
-} freereq;
-
-static void destroy_pops_and_shutdown(grpc_exec_ctx *exec_ctx, void *p,
-                                      grpc_error *error) {
-  grpc_pollset *pollset = grpc_polling_entity_pollset((grpc_polling_entity *)p);
-  grpc_pollset_destroy(exec_ctx, pollset);
-  gpr_free(pollset);
-}
-
-static void freed_port_from_server(grpc_exec_ctx *exec_ctx, void *arg,
-                                   grpc_error *error) {
-  freereq *pr = (freereq *)arg;
-  gpr_mu_lock(pr->mu);
-  pr->done = 1;
-  GRPC_LOG_IF_ERROR(
-      "pollset_kick",
-      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&pr->pops),
-                        NULL));
-  gpr_mu_unlock(pr->mu);
-}
-
-void grpc_free_port_using_server(int port) {
-  grpc_httpcli_context context;
-  grpc_httpcli_request req;
-  grpc_httpcli_response rsp;
-  freereq pr;
-  char *path;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_closure *shutdown_closure;
-
-  grpc_init();
-
-  memset(&pr, 0, sizeof(pr));
-  memset(&req, 0, sizeof(req));
-  memset(&rsp, 0, sizeof(rsp));
-
-  grpc_pollset *pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(pollset, &pr.mu);
-  pr.pops = grpc_polling_entity_create_from_pollset(pollset);
-  shutdown_closure = GRPC_CLOSURE_CREATE(destroy_pops_and_shutdown, &pr.pops,
-                                         grpc_schedule_on_exec_ctx);
-
-  req.host = GRPC_PORT_SERVER_ADDRESS;
-  gpr_asprintf(&path, "/drop/%d", port);
-  req.http.path = path;
-
-  grpc_httpcli_context_init(&context);
-  grpc_resource_quota *resource_quota =
-      grpc_resource_quota_create("port_server_client/free");
-  grpc_httpcli_get(&exec_ctx, &context, &pr.pops, resource_quota, &req,
-                   grpc_exec_ctx_now(&exec_ctx) + 30 * GPR_MS_PER_SEC,
-                   GRPC_CLOSURE_CREATE(freed_port_from_server, &pr,
-                                       grpc_schedule_on_exec_ctx),
-                   &rsp);
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-  grpc_exec_ctx_flush(&exec_ctx);
-  gpr_mu_lock(pr.mu);
-  while (!pr.done) {
-    grpc_pollset_worker *worker = NULL;
-    if (!GRPC_LOG_IF_ERROR(
-            "pollset_work",
-            grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
-                              &worker,
-                              grpc_exec_ctx_now(&exec_ctx) + GPR_MS_PER_SEC))) {
-      pr.done = 1;
-    }
-  }
-  gpr_mu_unlock(pr.mu);
-
-  grpc_httpcli_context_destroy(&exec_ctx, &context);
-  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
-                        shutdown_closure);
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(path);
-  grpc_http_response_destroy(&rsp);
-
-  grpc_shutdown();
-}
-
-typedef struct portreq {
-  gpr_mu *mu;
-  grpc_polling_entity pops;
-  int port;
-  int retries;
-  char *server;
-  grpc_httpcli_context *ctx;
-  grpc_httpcli_response response;
-} portreq;
-
-static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg,
-                                 grpc_error *error) {
-  size_t i;
-  int port = 0;
-  portreq *pr = (portreq *)arg;
-  int failed = 0;
-  grpc_httpcli_response *response = &pr->response;
-
-  if (error != GRPC_ERROR_NONE) {
-    failed = 1;
-    const char *msg = grpc_error_string(error);
-    gpr_log(GPR_DEBUG, "failed port pick from server: retrying [%s]", msg);
-
-  } else if (response->status != 200) {
-    failed = 1;
-    gpr_log(GPR_DEBUG, "failed port pick from server: status=%d",
-            response->status);
-  }
-
-  if (failed) {
-    grpc_httpcli_request req;
-    memset(&req, 0, sizeof(req));
-    if (pr->retries >= 5) {
-      gpr_mu_lock(pr->mu);
-      pr->port = 0;
-      GRPC_LOG_IF_ERROR(
-          "pollset_kick",
-          grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&pr->pops),
-                            NULL));
-      gpr_mu_unlock(pr->mu);
-      return;
-    }
-    GPR_ASSERT(pr->retries < 10);
-    gpr_sleep_until(gpr_time_add(
-        gpr_now(GPR_CLOCK_REALTIME),
-        gpr_time_from_millis(
-            (int64_t)(1000.0 * (1 + pow(1.3, pr->retries) * rand() / RAND_MAX)),
-            GPR_TIMESPAN)));
-    pr->retries++;
-    req.host = pr->server;
-    req.http.path = "/get";
-    grpc_http_response_destroy(&pr->response);
-    memset(&pr->response, 0, sizeof(pr->response));
-    grpc_resource_quota *resource_quota =
-        grpc_resource_quota_create("port_server_client/pick_retry");
-    grpc_httpcli_get(exec_ctx, pr->ctx, &pr->pops, resource_quota, &req,
-                     grpc_exec_ctx_now(exec_ctx) + 30 * GPR_MS_PER_SEC,
-                     GRPC_CLOSURE_CREATE(got_port_from_server, pr,
-                                         grpc_schedule_on_exec_ctx),
-                     &pr->response);
-    grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
-    return;
-  }
-  GPR_ASSERT(response);
-  GPR_ASSERT(response->status == 200);
-  for (i = 0; i < response->body_length; i++) {
-    GPR_ASSERT(response->body[i] >= '0' && response->body[i] <= '9');
-    port = port * 10 + response->body[i] - '0';
-  }
-  GPR_ASSERT(port > 1024);
-  gpr_mu_lock(pr->mu);
-  pr->port = port;
-  GRPC_LOG_IF_ERROR(
-      "pollset_kick",
-      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&pr->pops),
-                        NULL));
-  gpr_mu_unlock(pr->mu);
-}
-
-int grpc_pick_port_using_server(void) {
-  grpc_httpcli_context context;
-  grpc_httpcli_request req;
-  portreq pr;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_closure *shutdown_closure;
-
-  grpc_init();
-
-  memset(&pr, 0, sizeof(pr));
-  memset(&req, 0, sizeof(req));
-  grpc_pollset *pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(pollset, &pr.mu);
-  pr.pops = grpc_polling_entity_create_from_pollset(pollset);
-  shutdown_closure = GRPC_CLOSURE_CREATE(destroy_pops_and_shutdown, &pr.pops,
-                                         grpc_schedule_on_exec_ctx);
-  pr.port = -1;
-  pr.server = GRPC_PORT_SERVER_ADDRESS;
-  pr.ctx = &context;
-
-  req.host = GRPC_PORT_SERVER_ADDRESS;
-  req.http.path = "/get";
-
-  grpc_httpcli_context_init(&context);
-  grpc_resource_quota *resource_quota =
-      grpc_resource_quota_create("port_server_client/pick");
-  grpc_httpcli_get(
-      &exec_ctx, &context, &pr.pops, resource_quota, &req,
-      grpc_exec_ctx_now(&exec_ctx) + 30 * GPR_MS_PER_SEC,
-      GRPC_CLOSURE_CREATE(got_port_from_server, &pr, grpc_schedule_on_exec_ctx),
-      &pr.response);
-  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
-  grpc_exec_ctx_flush(&exec_ctx);
-  gpr_mu_lock(pr.mu);
-  while (pr.port == -1) {
-    grpc_pollset_worker *worker = NULL;
-    if (!GRPC_LOG_IF_ERROR(
-            "pollset_work",
-            grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
-                              &worker,
-                              grpc_exec_ctx_now(&exec_ctx) + GPR_MS_PER_SEC))) {
-      pr.port = 0;
-    }
-  }
-  gpr_mu_unlock(pr.mu);
-
-  grpc_http_response_destroy(&pr.response);
-  grpc_httpcli_context_destroy(&exec_ctx, &context);
-  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
-                        shutdown_closure);
-  grpc_exec_ctx_finish(&exec_ctx);
-  grpc_shutdown();
-
-  return pr.port;
-}
-
-#endif  // GRPC_TEST_PICK_PORT
diff --git a/test/core/util/port_server_client.cc b/test/core/util/port_server_client.cc
new file mode 100644
index 0000000..927bc91
--- /dev/null
+++ b/test/core/util/port_server_client.cc
@@ -0,0 +1,255 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+#include "test/core/util/test_config.h"
+
+#ifdef GRPC_TEST_PICK_PORT
+#include "test/core/util/port_server_client.h"
+
+#include <math.h>
+#include <string.h>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/http/httpcli.h"
+
+typedef struct freereq {
+  gpr_mu* mu;
+  grpc_polling_entity pops;
+  int done;
+} freereq;
+
+static void destroy_pops_and_shutdown(grpc_exec_ctx* exec_ctx, void* p,
+                                      grpc_error* error) {
+  grpc_pollset* pollset = grpc_polling_entity_pollset((grpc_polling_entity*)p);
+  grpc_pollset_destroy(exec_ctx, pollset);
+  gpr_free(pollset);
+}
+
+static void freed_port_from_server(grpc_exec_ctx* exec_ctx, void* arg,
+                                   grpc_error* error) {
+  freereq* pr = (freereq*)arg;
+  gpr_mu_lock(pr->mu);
+  pr->done = 1;
+  GRPC_LOG_IF_ERROR(
+      "pollset_kick",
+      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&pr->pops),
+                        NULL));
+  gpr_mu_unlock(pr->mu);
+}
+
+void grpc_free_port_using_server(int port) {
+  grpc_httpcli_context context;
+  grpc_httpcli_request req;
+  grpc_httpcli_response rsp;
+  freereq pr;
+  char* path;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_closure* shutdown_closure;
+
+  grpc_init();
+
+  memset(&pr, 0, sizeof(pr));
+  memset(&req, 0, sizeof(req));
+  memset(&rsp, 0, sizeof(rsp));
+
+  grpc_pollset* pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+  grpc_pollset_init(pollset, &pr.mu);
+  pr.pops = grpc_polling_entity_create_from_pollset(pollset);
+  shutdown_closure = GRPC_CLOSURE_CREATE(destroy_pops_and_shutdown, &pr.pops,
+                                         grpc_schedule_on_exec_ctx);
+
+  req.host = const_cast<char*>(GRPC_PORT_SERVER_ADDRESS);
+  gpr_asprintf(&path, "/drop/%d", port);
+  req.http.path = path;
+
+  grpc_httpcli_context_init(&context);
+  grpc_resource_quota* resource_quota =
+      grpc_resource_quota_create("port_server_client/free");
+  grpc_httpcli_get(&exec_ctx, &context, &pr.pops, resource_quota, &req,
+                   grpc_exec_ctx_now(&exec_ctx) + 30 * GPR_MS_PER_SEC,
+                   GRPC_CLOSURE_CREATE(freed_port_from_server, &pr,
+                                       grpc_schedule_on_exec_ctx),
+                   &rsp);
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+  grpc_exec_ctx_flush(&exec_ctx);
+  gpr_mu_lock(pr.mu);
+  while (!pr.done) {
+    grpc_pollset_worker* worker = NULL;
+    if (!GRPC_LOG_IF_ERROR(
+            "pollset_work",
+            grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
+                              &worker,
+                              grpc_exec_ctx_now(&exec_ctx) + GPR_MS_PER_SEC))) {
+      pr.done = 1;
+    }
+  }
+  gpr_mu_unlock(pr.mu);
+
+  grpc_httpcli_context_destroy(&exec_ctx, &context);
+  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
+                        shutdown_closure);
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(path);
+  grpc_http_response_destroy(&rsp);
+
+  grpc_shutdown();
+}
+
+typedef struct portreq {
+  gpr_mu* mu;
+  grpc_polling_entity pops;
+  int port;
+  int retries;
+  char* server;
+  grpc_httpcli_context* ctx;
+  grpc_httpcli_response response;
+} portreq;
+
+static void got_port_from_server(grpc_exec_ctx* exec_ctx, void* arg,
+                                 grpc_error* error) {
+  size_t i;
+  int port = 0;
+  portreq* pr = (portreq*)arg;
+  int failed = 0;
+  grpc_httpcli_response* response = &pr->response;
+
+  if (error != GRPC_ERROR_NONE) {
+    failed = 1;
+    const char* msg = grpc_error_string(error);
+    gpr_log(GPR_DEBUG, "failed port pick from server: retrying [%s]", msg);
+
+  } else if (response->status != 200) {
+    failed = 1;
+    gpr_log(GPR_DEBUG, "failed port pick from server: status=%d",
+            response->status);
+  }
+
+  if (failed) {
+    grpc_httpcli_request req;
+    memset(&req, 0, sizeof(req));
+    if (pr->retries >= 5) {
+      gpr_mu_lock(pr->mu);
+      pr->port = 0;
+      GRPC_LOG_IF_ERROR(
+          "pollset_kick",
+          grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&pr->pops),
+                            NULL));
+      gpr_mu_unlock(pr->mu);
+      return;
+    }
+    GPR_ASSERT(pr->retries < 10);
+    gpr_sleep_until(gpr_time_add(
+        gpr_now(GPR_CLOCK_REALTIME),
+        gpr_time_from_millis(
+            (int64_t)(1000.0 * (1 + pow(1.3, pr->retries) * rand() / RAND_MAX)),
+            GPR_TIMESPAN)));
+    pr->retries++;
+    req.host = pr->server;
+    req.http.path = const_cast<char*>("/get");
+    grpc_http_response_destroy(&pr->response);
+    memset(&pr->response, 0, sizeof(pr->response));
+    grpc_resource_quota* resource_quota =
+        grpc_resource_quota_create("port_server_client/pick_retry");
+    grpc_httpcli_get(exec_ctx, pr->ctx, &pr->pops, resource_quota, &req,
+                     grpc_exec_ctx_now(exec_ctx) + 30 * GPR_MS_PER_SEC,
+                     GRPC_CLOSURE_CREATE(got_port_from_server, pr,
+                                         grpc_schedule_on_exec_ctx),
+                     &pr->response);
+    grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
+    return;
+  }
+  GPR_ASSERT(response);
+  GPR_ASSERT(response->status == 200);
+  for (i = 0; i < response->body_length; i++) {
+    GPR_ASSERT(response->body[i] >= '0' && response->body[i] <= '9');
+    port = port * 10 + response->body[i] - '0';
+  }
+  GPR_ASSERT(port > 1024);
+  gpr_mu_lock(pr->mu);
+  pr->port = port;
+  GRPC_LOG_IF_ERROR(
+      "pollset_kick",
+      grpc_pollset_kick(exec_ctx, grpc_polling_entity_pollset(&pr->pops),
+                        NULL));
+  gpr_mu_unlock(pr->mu);
+}
+
+int grpc_pick_port_using_server(void) {
+  grpc_httpcli_context context;
+  grpc_httpcli_request req;
+  portreq pr;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_closure* shutdown_closure;
+
+  grpc_init();
+
+  memset(&pr, 0, sizeof(pr));
+  memset(&req, 0, sizeof(req));
+  grpc_pollset* pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+  grpc_pollset_init(pollset, &pr.mu);
+  pr.pops = grpc_polling_entity_create_from_pollset(pollset);
+  shutdown_closure = GRPC_CLOSURE_CREATE(destroy_pops_and_shutdown, &pr.pops,
+                                         grpc_schedule_on_exec_ctx);
+  pr.port = -1;
+  pr.server = const_cast<char*>(GRPC_PORT_SERVER_ADDRESS);
+  pr.ctx = &context;
+
+  req.host = const_cast<char*>(GRPC_PORT_SERVER_ADDRESS);
+  req.http.path = const_cast<char*>("/get");
+
+  grpc_httpcli_context_init(&context);
+  grpc_resource_quota* resource_quota =
+      grpc_resource_quota_create("port_server_client/pick");
+  grpc_httpcli_get(
+      &exec_ctx, &context, &pr.pops, resource_quota, &req,
+      grpc_exec_ctx_now(&exec_ctx) + 30 * GPR_MS_PER_SEC,
+      GRPC_CLOSURE_CREATE(got_port_from_server, &pr, grpc_schedule_on_exec_ctx),
+      &pr.response);
+  grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
+  grpc_exec_ctx_flush(&exec_ctx);
+  gpr_mu_lock(pr.mu);
+  while (pr.port == -1) {
+    grpc_pollset_worker* worker = NULL;
+    if (!GRPC_LOG_IF_ERROR(
+            "pollset_work",
+            grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
+                              &worker,
+                              grpc_exec_ctx_now(&exec_ctx) + GPR_MS_PER_SEC))) {
+      pr.port = 0;
+    }
+  }
+  gpr_mu_unlock(pr.mu);
+
+  grpc_http_response_destroy(&pr.response);
+  grpc_httpcli_context_destroy(&exec_ctx, &context);
+  grpc_pollset_shutdown(&exec_ctx, grpc_polling_entity_pollset(&pr.pops),
+                        shutdown_closure);
+  grpc_exec_ctx_finish(&exec_ctx);
+  grpc_shutdown();
+
+  return pr.port;
+}
+
+#endif  // GRPC_TEST_PICK_PORT
diff --git a/test/core/util/reconnect_server.c b/test/core/util/reconnect_server.c
deleted file mode 100644
index 9c56e02..0000000
--- a/test/core/util/reconnect_server.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/util/reconnect_server.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-#include <string.h>
-#include "src/core/lib/iomgr/endpoint.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/tcp_server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_tcp_server.h"
-
-static void pretty_print_backoffs(reconnect_server *server) {
-  gpr_timespec diff;
-  int i = 1;
-  double expected_backoff = 1000.0, backoff;
-  timestamp_list *head = server->head;
-  gpr_log(GPR_INFO, "reconnect server: new connection");
-  for (head = server->head; head && head->next; head = head->next, i++) {
-    diff = gpr_time_sub(head->next->timestamp, head->timestamp);
-    backoff = gpr_time_to_millis(diff);
-    gpr_log(GPR_INFO,
-            "retry %2d:backoff %6.2fs,expected backoff %6.2fs, jitter %4.2f%%",
-            i, backoff / 1000.0, expected_backoff / 1000.0,
-            (backoff - expected_backoff) * 100.0 / expected_backoff);
-    expected_backoff *= 1.6;
-    int max_reconnect_backoff_ms = 120 * 1000;
-    if (server->max_reconnect_backoff_ms > 0) {
-      max_reconnect_backoff_ms = server->max_reconnect_backoff_ms;
-    }
-    if (expected_backoff > max_reconnect_backoff_ms) {
-      expected_backoff = max_reconnect_backoff_ms;
-    }
-  }
-}
-
-static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp,
-                       grpc_pollset *accepting_pollset,
-                       grpc_tcp_server_acceptor *acceptor) {
-  gpr_free(acceptor);
-  char *peer;
-  char *last_colon;
-  reconnect_server *server = (reconnect_server *)arg;
-  gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
-  timestamp_list *new_tail;
-  peer = grpc_endpoint_get_peer(tcp);
-  grpc_endpoint_shutdown(exec_ctx, tcp,
-                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected"));
-  grpc_endpoint_destroy(exec_ctx, tcp);
-  if (peer) {
-    last_colon = strrchr(peer, ':');
-    if (server->peer == NULL) {
-      server->peer = peer;
-    } else {
-      if (last_colon == NULL) {
-        gpr_log(GPR_ERROR, "peer does not contain a ':'");
-      } else if (strncmp(server->peer, peer, (size_t)(last_colon - peer)) !=
-                 0) {
-        gpr_log(GPR_ERROR, "mismatched peer! %s vs %s", server->peer, peer);
-      }
-      gpr_free(peer);
-    }
-  }
-  new_tail = gpr_malloc(sizeof(timestamp_list));
-  new_tail->timestamp = now;
-  new_tail->next = NULL;
-  if (server->tail == NULL) {
-    server->head = new_tail;
-    server->tail = new_tail;
-  } else {
-    server->tail->next = new_tail;
-    server->tail = new_tail;
-  }
-  pretty_print_backoffs(server);
-}
-
-void reconnect_server_init(reconnect_server *server) {
-  test_tcp_server_init(&server->tcp_server, on_connect, server);
-  server->head = NULL;
-  server->tail = NULL;
-  server->peer = NULL;
-  server->max_reconnect_backoff_ms = 0;
-}
-
-void reconnect_server_start(reconnect_server *server, int port) {
-  test_tcp_server_start(&server->tcp_server, port);
-}
-
-void reconnect_server_poll(reconnect_server *server, int seconds) {
-  test_tcp_server_poll(&server->tcp_server, seconds);
-}
-
-void reconnect_server_clear_timestamps(reconnect_server *server) {
-  timestamp_list *new_head = server->head;
-  while (server->head) {
-    new_head = server->head->next;
-    gpr_free(server->head);
-    server->head = new_head;
-  }
-  server->tail = NULL;
-  gpr_free(server->peer);
-  server->peer = NULL;
-}
-
-void reconnect_server_destroy(reconnect_server *server) {
-  reconnect_server_clear_timestamps(server);
-  test_tcp_server_destroy(&server->tcp_server);
-}
diff --git a/test/core/util/reconnect_server.cc b/test/core/util/reconnect_server.cc
new file mode 100644
index 0000000..c7c0595
--- /dev/null
+++ b/test/core/util/reconnect_server.cc
@@ -0,0 +1,129 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/util/reconnect_server.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+#include <string.h>
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/tcp_server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_tcp_server.h"
+
+static void pretty_print_backoffs(reconnect_server* server) {
+  gpr_timespec diff;
+  int i = 1;
+  double expected_backoff = 1000.0, backoff;
+  timestamp_list* head = server->head;
+  gpr_log(GPR_INFO, "reconnect server: new connection");
+  for (head = server->head; head && head->next; head = head->next, i++) {
+    diff = gpr_time_sub(head->next->timestamp, head->timestamp);
+    backoff = gpr_time_to_millis(diff);
+    gpr_log(GPR_INFO,
+            "retry %2d:backoff %6.2fs,expected backoff %6.2fs, jitter %4.2f%%",
+            i, backoff / 1000.0, expected_backoff / 1000.0,
+            (backoff - expected_backoff) * 100.0 / expected_backoff);
+    expected_backoff *= 1.6;
+    int max_reconnect_backoff_ms = 120 * 1000;
+    if (server->max_reconnect_backoff_ms > 0) {
+      max_reconnect_backoff_ms = server->max_reconnect_backoff_ms;
+    }
+    if (expected_backoff > max_reconnect_backoff_ms) {
+      expected_backoff = max_reconnect_backoff_ms;
+    }
+  }
+}
+
+static void on_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* tcp,
+                       grpc_pollset* accepting_pollset,
+                       grpc_tcp_server_acceptor* acceptor) {
+  gpr_free(acceptor);
+  char* peer;
+  char* last_colon;
+  reconnect_server* server = (reconnect_server*)arg;
+  gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
+  timestamp_list* new_tail;
+  peer = grpc_endpoint_get_peer(tcp);
+  grpc_endpoint_shutdown(exec_ctx, tcp,
+                         GRPC_ERROR_CREATE_FROM_STATIC_STRING("Connected"));
+  grpc_endpoint_destroy(exec_ctx, tcp);
+  if (peer) {
+    last_colon = strrchr(peer, ':');
+    if (server->peer == NULL) {
+      server->peer = peer;
+    } else {
+      if (last_colon == NULL) {
+        gpr_log(GPR_ERROR, "peer does not contain a ':'");
+      } else if (strncmp(server->peer, peer, (size_t)(last_colon - peer)) !=
+                 0) {
+        gpr_log(GPR_ERROR, "mismatched peer! %s vs %s", server->peer, peer);
+      }
+      gpr_free(peer);
+    }
+  }
+  new_tail = static_cast<timestamp_list*>(gpr_malloc(sizeof(timestamp_list)));
+  new_tail->timestamp = now;
+  new_tail->next = NULL;
+  if (server->tail == NULL) {
+    server->head = new_tail;
+    server->tail = new_tail;
+  } else {
+    server->tail->next = new_tail;
+    server->tail = new_tail;
+  }
+  pretty_print_backoffs(server);
+}
+
+void reconnect_server_init(reconnect_server* server) {
+  test_tcp_server_init(&server->tcp_server, on_connect, server);
+  server->head = NULL;
+  server->tail = NULL;
+  server->peer = NULL;
+  server->max_reconnect_backoff_ms = 0;
+}
+
+void reconnect_server_start(reconnect_server* server, int port) {
+  test_tcp_server_start(&server->tcp_server, port);
+}
+
+void reconnect_server_poll(reconnect_server* server, int seconds) {
+  test_tcp_server_poll(&server->tcp_server, seconds);
+}
+
+void reconnect_server_clear_timestamps(reconnect_server* server) {
+  timestamp_list* new_head = server->head;
+  while (server->head) {
+    new_head = server->head->next;
+    gpr_free(server->head);
+    server->head = new_head;
+  }
+  server->tail = NULL;
+  gpr_free(server->peer);
+  server->peer = NULL;
+}
+
+void reconnect_server_destroy(reconnect_server* server) {
+  reconnect_server_clear_timestamps(server);
+  test_tcp_server_destroy(&server->tcp_server);
+}
diff --git a/test/core/util/reconnect_server.h b/test/core/util/reconnect_server.h
index 38db729..d15abe5 100644
--- a/test/core/util/reconnect_server.h
+++ b/test/core/util/reconnect_server.h
@@ -23,31 +23,23 @@
 #include <grpc/support/time.h>
 #include "test/core/util/test_tcp_server.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct timestamp_list {
   gpr_timespec timestamp;
-  struct timestamp_list *next;
+  struct timestamp_list* next;
 } timestamp_list;
 
 typedef struct reconnect_server {
   test_tcp_server tcp_server;
-  timestamp_list *head;
-  timestamp_list *tail;
-  char *peer;
+  timestamp_list* head;
+  timestamp_list* tail;
+  char* peer;
   int max_reconnect_backoff_ms;
 } reconnect_server;
 
-void reconnect_server_init(reconnect_server *server);
-void reconnect_server_start(reconnect_server *server, int port);
-void reconnect_server_poll(reconnect_server *server, int seconds);
-void reconnect_server_destroy(reconnect_server *server);
-void reconnect_server_clear_timestamps(reconnect_server *server);
-
-#ifdef __cplusplus
-}
-#endif
+void reconnect_server_init(reconnect_server* server);
+void reconnect_server_start(reconnect_server* server, int port);
+void reconnect_server_poll(reconnect_server* server, int seconds);
+void reconnect_server_destroy(reconnect_server* server);
+void reconnect_server_clear_timestamps(reconnect_server* server);
 
 #endif /* GRPC_TEST_CORE_UTIL_RECONNECT_SERVER_H */
diff --git a/test/core/util/slice_splitter.c b/test/core/util/slice_splitter.c
deleted file mode 100644
index 6fcef9a..0000000
--- a/test/core/util/slice_splitter.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/util/slice_splitter.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/useful.h>
-
-const char *grpc_slice_split_mode_name(grpc_slice_split_mode mode) {
-  switch (mode) {
-    case GRPC_SLICE_SPLIT_IDENTITY:
-      return "identity";
-    case GRPC_SLICE_SPLIT_MERGE_ALL:
-      return "merge_all";
-    case GRPC_SLICE_SPLIT_ONE_BYTE:
-      return "one_byte";
-  }
-  return "error";
-}
-
-void grpc_split_slices(grpc_slice_split_mode mode, grpc_slice *src_slices,
-                       size_t src_slice_count, grpc_slice **dst_slices,
-                       size_t *dst_slice_count) {
-  size_t i, j;
-  size_t length;
-
-  switch (mode) {
-    case GRPC_SLICE_SPLIT_IDENTITY:
-      *dst_slice_count = src_slice_count;
-      *dst_slices =
-          (grpc_slice *)gpr_malloc(sizeof(grpc_slice) * src_slice_count);
-      for (i = 0; i < src_slice_count; i++) {
-        (*dst_slices)[i] = src_slices[i];
-        grpc_slice_ref((*dst_slices)[i]);
-      }
-      break;
-    case GRPC_SLICE_SPLIT_MERGE_ALL:
-      *dst_slice_count = 1;
-      length = 0;
-      for (i = 0; i < src_slice_count; i++) {
-        length += GRPC_SLICE_LENGTH(src_slices[i]);
-      }
-      *dst_slices = (grpc_slice *)gpr_malloc(sizeof(grpc_slice));
-      **dst_slices = grpc_slice_malloc(length);
-      length = 0;
-      for (i = 0; i < src_slice_count; i++) {
-        memcpy(GRPC_SLICE_START_PTR(**dst_slices) + length,
-               GRPC_SLICE_START_PTR(src_slices[i]),
-               GRPC_SLICE_LENGTH(src_slices[i]));
-        length += GRPC_SLICE_LENGTH(src_slices[i]);
-      }
-      break;
-    case GRPC_SLICE_SPLIT_ONE_BYTE:
-      length = 0;
-      for (i = 0; i < src_slice_count; i++) {
-        length += GRPC_SLICE_LENGTH(src_slices[i]);
-      }
-      *dst_slice_count = length;
-      *dst_slices = (grpc_slice *)gpr_malloc(sizeof(grpc_slice) * length);
-      length = 0;
-      for (i = 0; i < src_slice_count; i++) {
-        for (j = 0; j < GRPC_SLICE_LENGTH(src_slices[i]); j++) {
-          (*dst_slices)[length] = grpc_slice_sub(src_slices[i], j, j + 1);
-          length++;
-        }
-      }
-      break;
-  }
-}
-
-void grpc_split_slices_to_buffer(grpc_slice_split_mode mode,
-                                 grpc_slice *src_slices, size_t src_slice_count,
-                                 grpc_slice_buffer *dst) {
-  grpc_slice *slices;
-  size_t nslices;
-  size_t i;
-  grpc_split_slices(mode, src_slices, src_slice_count, &slices, &nslices);
-  for (i = 0; i < nslices; i++) {
-    /* add indexed to avoid re-merging split slices */
-    grpc_slice_buffer_add_indexed(dst, slices[i]);
-  }
-  gpr_free(slices);
-}
-
-void grpc_split_slice_buffer(grpc_slice_split_mode mode, grpc_slice_buffer *src,
-                             grpc_slice_buffer *dst) {
-  grpc_split_slices_to_buffer(mode, src->slices, src->count, dst);
-}
-
-grpc_slice grpc_slice_merge(grpc_slice *slices, size_t nslices) {
-  uint8_t *out = NULL;
-  size_t length = 0;
-  size_t capacity = 0;
-  size_t i;
-
-  for (i = 0; i < nslices; i++) {
-    if (GRPC_SLICE_LENGTH(slices[i]) + length > capacity) {
-      capacity = GPR_MAX(capacity * 2, GRPC_SLICE_LENGTH(slices[i]) + length);
-      out = (uint8_t *)gpr_realloc(out, capacity);
-    }
-    memcpy(out + length, GRPC_SLICE_START_PTR(slices[i]),
-           GRPC_SLICE_LENGTH(slices[i]));
-    length += GRPC_SLICE_LENGTH(slices[i]);
-  }
-
-  return grpc_slice_new(out, length, gpr_free);
-}
diff --git a/test/core/util/slice_splitter.cc b/test/core/util/slice_splitter.cc
new file mode 100644
index 0000000..e25e1d8
--- /dev/null
+++ b/test/core/util/slice_splitter.cc
@@ -0,0 +1,124 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/util/slice_splitter.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/useful.h>
+
+const char* grpc_slice_split_mode_name(grpc_slice_split_mode mode) {
+  switch (mode) {
+    case GRPC_SLICE_SPLIT_IDENTITY:
+      return "identity";
+    case GRPC_SLICE_SPLIT_MERGE_ALL:
+      return "merge_all";
+    case GRPC_SLICE_SPLIT_ONE_BYTE:
+      return "one_byte";
+  }
+  return "error";
+}
+
+void grpc_split_slices(grpc_slice_split_mode mode, grpc_slice* src_slices,
+                       size_t src_slice_count, grpc_slice** dst_slices,
+                       size_t* dst_slice_count) {
+  size_t i, j;
+  size_t length;
+
+  switch (mode) {
+    case GRPC_SLICE_SPLIT_IDENTITY:
+      *dst_slice_count = src_slice_count;
+      *dst_slices =
+          (grpc_slice*)gpr_malloc(sizeof(grpc_slice) * src_slice_count);
+      for (i = 0; i < src_slice_count; i++) {
+        (*dst_slices)[i] = src_slices[i];
+        grpc_slice_ref((*dst_slices)[i]);
+      }
+      break;
+    case GRPC_SLICE_SPLIT_MERGE_ALL:
+      *dst_slice_count = 1;
+      length = 0;
+      for (i = 0; i < src_slice_count; i++) {
+        length += GRPC_SLICE_LENGTH(src_slices[i]);
+      }
+      *dst_slices = (grpc_slice*)gpr_malloc(sizeof(grpc_slice));
+      **dst_slices = grpc_slice_malloc(length);
+      length = 0;
+      for (i = 0; i < src_slice_count; i++) {
+        memcpy(GRPC_SLICE_START_PTR(**dst_slices) + length,
+               GRPC_SLICE_START_PTR(src_slices[i]),
+               GRPC_SLICE_LENGTH(src_slices[i]));
+        length += GRPC_SLICE_LENGTH(src_slices[i]);
+      }
+      break;
+    case GRPC_SLICE_SPLIT_ONE_BYTE:
+      length = 0;
+      for (i = 0; i < src_slice_count; i++) {
+        length += GRPC_SLICE_LENGTH(src_slices[i]);
+      }
+      *dst_slice_count = length;
+      *dst_slices = (grpc_slice*)gpr_malloc(sizeof(grpc_slice) * length);
+      length = 0;
+      for (i = 0; i < src_slice_count; i++) {
+        for (j = 0; j < GRPC_SLICE_LENGTH(src_slices[i]); j++) {
+          (*dst_slices)[length] = grpc_slice_sub(src_slices[i], j, j + 1);
+          length++;
+        }
+      }
+      break;
+  }
+}
+
+void grpc_split_slices_to_buffer(grpc_slice_split_mode mode,
+                                 grpc_slice* src_slices, size_t src_slice_count,
+                                 grpc_slice_buffer* dst) {
+  grpc_slice* slices;
+  size_t nslices;
+  size_t i;
+  grpc_split_slices(mode, src_slices, src_slice_count, &slices, &nslices);
+  for (i = 0; i < nslices; i++) {
+    /* add indexed to avoid re-merging split slices */
+    grpc_slice_buffer_add_indexed(dst, slices[i]);
+  }
+  gpr_free(slices);
+}
+
+void grpc_split_slice_buffer(grpc_slice_split_mode mode, grpc_slice_buffer* src,
+                             grpc_slice_buffer* dst) {
+  grpc_split_slices_to_buffer(mode, src->slices, src->count, dst);
+}
+
+grpc_slice grpc_slice_merge(grpc_slice* slices, size_t nslices) {
+  uint8_t* out = NULL;
+  size_t length = 0;
+  size_t capacity = 0;
+  size_t i;
+
+  for (i = 0; i < nslices; i++) {
+    if (GRPC_SLICE_LENGTH(slices[i]) + length > capacity) {
+      capacity = GPR_MAX(capacity * 2, GRPC_SLICE_LENGTH(slices[i]) + length);
+      out = (uint8_t*)gpr_realloc(out, capacity);
+    }
+    memcpy(out + length, GRPC_SLICE_START_PTR(slices[i]),
+           GRPC_SLICE_LENGTH(slices[i]));
+    length += GRPC_SLICE_LENGTH(slices[i]);
+  }
+
+  return grpc_slice_new(out, length, gpr_free);
+}
diff --git a/test/core/util/slice_splitter.h b/test/core/util/slice_splitter.h
index 713eca9..65b9f6f 100644
--- a/test/core/util/slice_splitter.h
+++ b/test/core/util/slice_splitter.h
@@ -36,18 +36,18 @@
 
 /* allocates *dst_slices; caller must unref all slices in dst_slices then free
    it */
-void grpc_split_slices(grpc_slice_split_mode mode, grpc_slice *src_slices,
-                       size_t src_slice_count, grpc_slice **dst_slices,
-                       size_t *dst_slice_count);
+void grpc_split_slices(grpc_slice_split_mode mode, grpc_slice* src_slices,
+                       size_t src_slice_count, grpc_slice** dst_slices,
+                       size_t* dst_slice_count);
 
 void grpc_split_slices_to_buffer(grpc_slice_split_mode mode,
-                                 grpc_slice *src_slices, size_t src_slice_count,
-                                 grpc_slice_buffer *dst);
-void grpc_split_slice_buffer(grpc_slice_split_mode mode, grpc_slice_buffer *src,
-                             grpc_slice_buffer *dst);
+                                 grpc_slice* src_slices, size_t src_slice_count,
+                                 grpc_slice_buffer* dst);
+void grpc_split_slice_buffer(grpc_slice_split_mode mode, grpc_slice_buffer* src,
+                             grpc_slice_buffer* dst);
 
-grpc_slice grpc_slice_merge(grpc_slice *slices, size_t nslices);
+grpc_slice grpc_slice_merge(grpc_slice* slices, size_t nslices);
 
-const char *grpc_slice_split_mode_name(grpc_slice_split_mode mode);
+const char* grpc_slice_split_mode_name(grpc_slice_split_mode mode);
 
 #endif /* GRPC_TEST_CORE_UTIL_SLICE_SPLITTER_H */
diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c
deleted file mode 100644
index 536045e..0000000
--- a/test/core/util/test_config.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/util/test_config.h"
-
-#include <signal.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/support/env.h"
-#include "src/core/lib/support/string.h"
-
-int64_t g_fixture_slowdown_factor = 1;
-int64_t g_poller_slowdown_factor = 1;
-
-#if GPR_GETPID_IN_UNISTD_H
-#include <unistd.h>
-static unsigned seed(void) { return (unsigned)getpid(); }
-#endif
-
-#if GPR_GETPID_IN_PROCESS_H
-#include <process.h>
-static unsigned seed(void) { return (unsigned)_getpid(); }
-#endif
-
-#if GPR_WINDOWS_CRASH_HANDLER
-#include <windows.h>
-
-#include <tchar.h>
-
-// disable warning 4091 - dbghelp.h is broken for msvc2015
-#pragma warning(disable : 4091)
-#define DBGHELP_TRANSLATE_TCHAR
-#include <dbghelp.h>
-
-#ifdef _MSC_VER
-#pragma comment(lib, "dbghelp.lib")
-#endif
-
-static void print_current_stack() {
-  typedef USHORT(WINAPI * CaptureStackBackTraceType)(
-      __in ULONG, __in ULONG, __out PVOID *, __out_opt PULONG);
-  CaptureStackBackTraceType func = (CaptureStackBackTraceType)(GetProcAddress(
-      LoadLibrary(_T("kernel32.dll")), "RtlCaptureStackBackTrace"));
-
-  if (func == NULL) return;  // WOE 29.SEP.2010
-
-// Quote from Microsoft Documentation:
-// ## Windows Server 2003 and Windows XP:
-// ## The sum of the FramesToSkip and FramesToCapture parameters must be less
-// than 63.
-#define MAX_CALLERS 62
-
-  void *callers_stack[MAX_CALLERS];
-  unsigned short frames;
-  SYMBOL_INFOW *symbol;
-  HANDLE process;
-  process = GetCurrentProcess();
-  SymInitialize(process, NULL, TRUE);
-  frames = (func)(0, MAX_CALLERS, callers_stack, NULL);
-  symbol =
-      (SYMBOL_INFOW *)calloc(sizeof(SYMBOL_INFOW) + 256 * sizeof(wchar_t), 1);
-  symbol->MaxNameLen = 255;
-  symbol->SizeOfStruct = sizeof(SYMBOL_INFOW);
-
-  const unsigned short MAX_CALLERS_SHOWN = 32;
-  frames = frames < MAX_CALLERS_SHOWN ? frames : MAX_CALLERS_SHOWN;
-  for (unsigned int i = 0; i < frames; i++) {
-    SymFromAddrW(process, (DWORD64)(callers_stack[i]), 0, symbol);
-    fwprintf(stderr, L"*** %d: %016I64X %ls - %016I64X\n", i,
-             (DWORD64)callers_stack[i], symbol->Name, (DWORD64)symbol->Address);
-    fflush(stderr);
-  }
-
-  free(symbol);
-}
-
-static void print_stack_from_context(CONTEXT c) {
-  STACKFRAME s;  // in/out stackframe
-  memset(&s, 0, sizeof(s));
-  DWORD imageType;
-#ifdef _M_IX86
-  // normally, call ImageNtHeader() and use machine info from PE header
-  imageType = IMAGE_FILE_MACHINE_I386;
-  s.AddrPC.Offset = c.Eip;
-  s.AddrPC.Mode = AddrModeFlat;
-  s.AddrFrame.Offset = c.Ebp;
-  s.AddrFrame.Mode = AddrModeFlat;
-  s.AddrStack.Offset = c.Esp;
-  s.AddrStack.Mode = AddrModeFlat;
-#elif _M_X64
-  imageType = IMAGE_FILE_MACHINE_AMD64;
-  s.AddrPC.Offset = c.Rip;
-  s.AddrPC.Mode = AddrModeFlat;
-  s.AddrFrame.Offset = c.Rsp;
-  s.AddrFrame.Mode = AddrModeFlat;
-  s.AddrStack.Offset = c.Rsp;
-  s.AddrStack.Mode = AddrModeFlat;
-#elif _M_IA64
-  imageType = IMAGE_FILE_MACHINE_IA64;
-  s.AddrPC.Offset = c.StIIP;
-  s.AddrPC.Mode = AddrModeFlat;
-  s.AddrFrame.Offset = c.IntSp;
-  s.AddrFrame.Mode = AddrModeFlat;
-  s.AddrBStore.Offset = c.RsBSP;
-  s.AddrBStore.Mode = AddrModeFlat;
-  s.AddrStack.Offset = c.IntSp;
-  s.AddrStack.Mode = AddrModeFlat;
-#else
-#error "Platform not supported!"
-#endif
-
-  HANDLE process = GetCurrentProcess();
-  HANDLE thread = GetCurrentThread();
-
-  SYMBOL_INFOW *symbol =
-      (SYMBOL_INFOW *)calloc(sizeof(SYMBOL_INFOW) + 256 * sizeof(wchar_t), 1);
-  symbol->MaxNameLen = 255;
-  symbol->SizeOfStruct = sizeof(SYMBOL_INFOW);
-
-  while (StackWalk(imageType, process, thread, &s, &c, 0,
-                   SymFunctionTableAccess, SymGetModuleBase, 0)) {
-    BOOL has_symbol =
-        SymFromAddrW(process, (DWORD64)(s.AddrPC.Offset), 0, symbol);
-    fwprintf(
-        stderr, L"*** %016I64X %ls - %016I64X\n", (DWORD64)(s.AddrPC.Offset),
-        has_symbol ? symbol->Name : L"<<no symbol>>", (DWORD64)symbol->Address);
-    fflush(stderr);
-  }
-
-  free(symbol);
-}
-
-static LONG crash_handler(struct _EXCEPTION_POINTERS *ex_info) {
-  fprintf(stderr, "Exception handler called, dumping information\n");
-  bool try_to_print_stack = true;
-  PEXCEPTION_RECORD exrec = ex_info->ExceptionRecord;
-  while (exrec) {
-    DWORD code = exrec->ExceptionCode;
-    DWORD flgs = exrec->ExceptionFlags;
-    PVOID addr = exrec->ExceptionAddress;
-    if (code == EXCEPTION_STACK_OVERFLOW) try_to_print_stack = false;
-    fprintf(stderr, "code: %x - flags: %d - address: %p\n", code, flgs, addr);
-    exrec = exrec->ExceptionRecord;
-  }
-  if (try_to_print_stack) {
-    print_stack_from_context(*ex_info->ContextRecord);
-  }
-  if (IsDebuggerPresent()) {
-    __debugbreak();
-  } else {
-    _exit(1);
-  }
-  return EXCEPTION_EXECUTE_HANDLER;
-}
-
-static void abort_handler(int sig) {
-  fprintf(stderr, "Abort handler called.\n");
-  print_current_stack(NULL);
-  if (IsDebuggerPresent()) {
-    __debugbreak();
-  } else {
-    _exit(1);
-  }
-}
-
-static void install_crash_handler() {
-  if (!SymInitialize(GetCurrentProcess(), NULL, TRUE)) {
-    fprintf(stderr, "SymInitialize failed: %d\n", GetLastError());
-  }
-  SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)crash_handler);
-  _set_abort_behavior(0, _WRITE_ABORT_MSG);
-  _set_abort_behavior(0, _CALL_REPORTFAULT);
-  signal(SIGABRT, abort_handler);
-}
-#elif GPR_POSIX_CRASH_HANDLER
-#include <errno.h>
-#include <execinfo.h>
-#include <grpc/support/useful.h>
-#include <stdio.h>
-#include <string.h>
-
-#define SIGNAL_NAMES_LENGTH 32
-
-static const char *const signal_names[] = {
-    NULL,      "SIGHUP",  "SIGINT",    "SIGQUIT", "SIGILL",    "SIGTRAP",
-    "SIGABRT", "SIGBUS",  "SIGFPE",    "SIGKILL", "SIGUSR1",   "SIGSEGV",
-    "SIGUSR2", "SIGPIPE", "SIGALRM",   "SIGTERM", "SIGSTKFLT", "SIGCHLD",
-    "SIGCONT", "SIGSTOP", "SIGTSTP",   "SIGTTIN", "SIGTTOU",   "SIGURG",
-    "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH",  "SIGIO",
-    "SIGPWR",  "SIGSYS"};
-
-static char g_alt_stack[GPR_MAX(MINSIGSTKSZ, 65536)];
-
-#define MAX_FRAMES 32
-
-/* signal safe output */
-static void output_string(const char *string) {
-  size_t len = strlen(string);
-  ssize_t r;
-
-  do {
-    r = write(STDERR_FILENO, string, len);
-  } while (r == -1 && errno == EINTR);
-}
-
-static void output_num(long num) {
-  char buf[GPR_LTOA_MIN_BUFSIZE];
-  gpr_ltoa(num, buf);
-  output_string(buf);
-}
-
-static void crash_handler(int signum, siginfo_t *info, void *data) {
-  void *addrlist[MAX_FRAMES + 1];
-  int addrlen;
-
-  output_string("\n\n\n*******************************\nCaught signal ");
-  if (signum > 0 && signum < SIGNAL_NAMES_LENGTH) {
-    output_string(signal_names[signum]);
-  } else {
-    output_num(signum);
-  }
-  output_string("\n");
-
-  addrlen = backtrace(addrlist, GPR_ARRAY_SIZE(addrlist));
-
-  if (addrlen == 0) {
-    output_string("  no backtrace\n");
-  } else {
-    backtrace_symbols_fd(addrlist, addrlen, STDERR_FILENO);
-  }
-
-  /* try to get a core dump for SIGTERM */
-  if (signum == SIGTERM) signum = SIGQUIT;
-  raise(signum);
-}
-
-static void install_crash_handler() {
-  stack_t ss;
-  struct sigaction sa;
-
-  memset(&ss, 0, sizeof(ss));
-  memset(&sa, 0, sizeof(sa));
-  ss.ss_size = sizeof(g_alt_stack);
-  ss.ss_sp = g_alt_stack;
-  GPR_ASSERT(sigaltstack(&ss, NULL) == 0);
-  sa.sa_flags = (int)(SA_SIGINFO | SA_ONSTACK | SA_RESETHAND);
-  sa.sa_sigaction = crash_handler;
-  GPR_ASSERT(sigaction(SIGILL, &sa, NULL) == 0);
-  GPR_ASSERT(sigaction(SIGABRT, &sa, NULL) == 0);
-  GPR_ASSERT(sigaction(SIGBUS, &sa, NULL) == 0);
-  GPR_ASSERT(sigaction(SIGSEGV, &sa, NULL) == 0);
-  GPR_ASSERT(sigaction(SIGTERM, &sa, NULL) == 0);
-  GPR_ASSERT(sigaction(SIGQUIT, &sa, NULL) == 0);
-}
-#else
-static void install_crash_handler() {}
-#endif
-
-bool BuiltUnderValgrind() {
-#ifdef RUNNING_ON_VALGRIND
-  return true;
-#else
-  return false;
-#endif
-}
-
-bool BuiltUnderTsan() {
-#if defined(__has_feature)
-#if __has_feature(thread_sanitizer)
-  return true;
-#else
-  return false;
-#endif
-#else
-#ifdef THREAD_SANITIZER
-  return true;
-#else
-  return false;
-#endif
-#endif
-}
-
-bool BuiltUnderAsan() {
-#if defined(__has_feature)
-#if __has_feature(address_sanitizer)
-  return true;
-#else
-  return false;
-#endif
-#else
-#ifdef ADDRESS_SANITIZER
-  return true;
-#else
-  return false;
-#endif
-#endif
-}
-
-bool BuiltUnderMsan() {
-#if defined(__has_feature)
-#if __has_feature(memory_sanitizer)
-  return true;
-#else
-  return false;
-#endif
-#else
-#ifdef MEMORY_SANITIZER
-  return true;
-#else
-  return false;
-#endif
-#endif
-}
-
-bool BuiltUnderUbsan() {
-#ifdef GRPC_UBSAN
-  return true;
-#else
-  return false;
-#endif
-}
-
-int64_t grpc_test_sanitizer_slowdown_factor() {
-  int64_t sanitizer_multiplier = 1;
-  if (BuiltUnderValgrind()) {
-    sanitizer_multiplier = 20;
-  } else if (BuiltUnderTsan()) {
-    sanitizer_multiplier = 5;
-  } else if (BuiltUnderAsan()) {
-    sanitizer_multiplier = 3;
-  } else if (BuiltUnderMsan()) {
-    sanitizer_multiplier = 4;
-  } else if (BuiltUnderUbsan()) {
-    sanitizer_multiplier = 5;
-  }
-  return sanitizer_multiplier;
-}
-
-int64_t grpc_test_slowdown_factor() {
-  return grpc_test_sanitizer_slowdown_factor() * g_fixture_slowdown_factor *
-         g_poller_slowdown_factor;
-}
-
-gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s) {
-  return gpr_time_add(
-      gpr_now(GPR_CLOCK_MONOTONIC),
-      gpr_time_from_millis(grpc_test_slowdown_factor() * (int64_t)1e3 * time_s,
-                           GPR_TIMESPAN));
-}
-
-gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms) {
-  return gpr_time_add(
-      gpr_now(GPR_CLOCK_MONOTONIC),
-      gpr_time_from_micros(grpc_test_slowdown_factor() * (int64_t)1e3 * time_ms,
-                           GPR_TIMESPAN));
-}
-
-void grpc_test_init(int argc, char **argv) {
-  install_crash_handler();
-  { /* poll-cv poll strategy runs much more slowly than anything else */
-    char *s = gpr_getenv("GRPC_POLL_STRATEGY");
-    if (s != NULL && 0 == strcmp(s, "poll-cv")) {
-      g_poller_slowdown_factor = 5;
-    }
-    gpr_free(s);
-  }
-  gpr_log(GPR_DEBUG,
-          "test slowdown factor: sanitizer=%" PRId64 ", fixture=%" PRId64
-          ", poller=%" PRId64 ", total=%" PRId64,
-          grpc_test_sanitizer_slowdown_factor(), g_fixture_slowdown_factor,
-          g_poller_slowdown_factor, grpc_test_slowdown_factor());
-  /* seed rng with pid, so we don't end up with the same random numbers as a
-     concurrently running test binary */
-  srand(seed());
-}
diff --git a/test/core/util/test_config.cc b/test/core/util/test_config.cc
new file mode 100644
index 0000000..3106fb0
--- /dev/null
+++ b/test/core/util/test_config.cc
@@ -0,0 +1,396 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test/core/util/test_config.h"
+
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/support/env.h"
+#include "src/core/lib/support/string.h"
+
+int64_t g_fixture_slowdown_factor = 1;
+int64_t g_poller_slowdown_factor = 1;
+
+#if GPR_GETPID_IN_UNISTD_H
+#include <unistd.h>
+static unsigned seed(void) { return (unsigned)getpid(); }
+#endif
+
+#if GPR_GETPID_IN_PROCESS_H
+#include <process.h>
+static unsigned seed(void) { return (unsigned)_getpid(); }
+#endif
+
+#if GPR_WINDOWS_CRASH_HANDLER
+#include <windows.h>
+
+#include <tchar.h>
+
+// disable warning 4091 - dbghelp.h is broken for msvc2015
+#pragma warning(disable : 4091)
+#define DBGHELP_TRANSLATE_TCHAR
+#include <dbghelp.h>
+
+#ifdef _MSC_VER
+#pragma comment(lib, "dbghelp.lib")
+#endif
+
+static void print_current_stack() {
+  typedef USHORT(WINAPI * CaptureStackBackTraceType)(
+      __in ULONG, __in ULONG, __out PVOID*, __out_opt PULONG);
+  CaptureStackBackTraceType func = (CaptureStackBackTraceType)(GetProcAddress(
+      LoadLibrary(_T("kernel32.dll")), "RtlCaptureStackBackTrace"));
+
+  if (func == NULL) return;  // WOE 29.SEP.2010
+
+// Quote from Microsoft Documentation:
+// ## Windows Server 2003 and Windows XP:
+// ## The sum of the FramesToSkip and FramesToCapture parameters must be less
+// than 63.
+#define MAX_CALLERS 62
+
+  void* callers_stack[MAX_CALLERS];
+  unsigned short frames;
+  SYMBOL_INFOW* symbol;
+  HANDLE process;
+  process = GetCurrentProcess();
+  SymInitialize(process, NULL, TRUE);
+  frames = (func)(0, MAX_CALLERS, callers_stack, NULL);
+  symbol =
+      (SYMBOL_INFOW*)calloc(sizeof(SYMBOL_INFOW) + 256 * sizeof(wchar_t), 1);
+  symbol->MaxNameLen = 255;
+  symbol->SizeOfStruct = sizeof(SYMBOL_INFOW);
+
+  const unsigned short MAX_CALLERS_SHOWN = 32;
+  frames = frames < MAX_CALLERS_SHOWN ? frames : MAX_CALLERS_SHOWN;
+  for (unsigned int i = 0; i < frames; i++) {
+    SymFromAddrW(process, (DWORD64)(callers_stack[i]), 0, symbol);
+    fwprintf(stderr, L"*** %d: %016I64X %ls - %016I64X\n", i,
+             (DWORD64)callers_stack[i], symbol->Name, (DWORD64)symbol->Address);
+    fflush(stderr);
+  }
+
+  free(symbol);
+}
+
+static void print_stack_from_context(CONTEXT c) {
+  STACKFRAME s;  // in/out stackframe
+  memset(&s, 0, sizeof(s));
+  DWORD imageType;
+#ifdef _M_IX86
+  // normally, call ImageNtHeader() and use machine info from PE header
+  imageType = IMAGE_FILE_MACHINE_I386;
+  s.AddrPC.Offset = c.Eip;
+  s.AddrPC.Mode = AddrModeFlat;
+  s.AddrFrame.Offset = c.Ebp;
+  s.AddrFrame.Mode = AddrModeFlat;
+  s.AddrStack.Offset = c.Esp;
+  s.AddrStack.Mode = AddrModeFlat;
+#elif _M_X64
+  imageType = IMAGE_FILE_MACHINE_AMD64;
+  s.AddrPC.Offset = c.Rip;
+  s.AddrPC.Mode = AddrModeFlat;
+  s.AddrFrame.Offset = c.Rsp;
+  s.AddrFrame.Mode = AddrModeFlat;
+  s.AddrStack.Offset = c.Rsp;
+  s.AddrStack.Mode = AddrModeFlat;
+#elif _M_IA64
+  imageType = IMAGE_FILE_MACHINE_IA64;
+  s.AddrPC.Offset = c.StIIP;
+  s.AddrPC.Mode = AddrModeFlat;
+  s.AddrFrame.Offset = c.IntSp;
+  s.AddrFrame.Mode = AddrModeFlat;
+  s.AddrBStore.Offset = c.RsBSP;
+  s.AddrBStore.Mode = AddrModeFlat;
+  s.AddrStack.Offset = c.IntSp;
+  s.AddrStack.Mode = AddrModeFlat;
+#else
+#error "Platform not supported!"
+#endif
+
+  HANDLE process = GetCurrentProcess();
+  HANDLE thread = GetCurrentThread();
+
+  SYMBOL_INFOW* symbol =
+      (SYMBOL_INFOW*)calloc(sizeof(SYMBOL_INFOW) + 256 * sizeof(wchar_t), 1);
+  symbol->MaxNameLen = 255;
+  symbol->SizeOfStruct = sizeof(SYMBOL_INFOW);
+
+  while (StackWalk(imageType, process, thread, &s, &c, 0,
+                   SymFunctionTableAccess, SymGetModuleBase, 0)) {
+    BOOL has_symbol =
+        SymFromAddrW(process, (DWORD64)(s.AddrPC.Offset), 0, symbol);
+    fwprintf(
+        stderr, L"*** %016I64X %ls - %016I64X\n", (DWORD64)(s.AddrPC.Offset),
+        has_symbol ? symbol->Name : L"<<no symbol>>", (DWORD64)symbol->Address);
+    fflush(stderr);
+  }
+
+  free(symbol);
+}
+
+static LONG crash_handler(struct _EXCEPTION_POINTERS* ex_info) {
+  fprintf(stderr, "Exception handler called, dumping information\n");
+  bool try_to_print_stack = true;
+  PEXCEPTION_RECORD exrec = ex_info->ExceptionRecord;
+  while (exrec) {
+    DWORD code = exrec->ExceptionCode;
+    DWORD flgs = exrec->ExceptionFlags;
+    PVOID addr = exrec->ExceptionAddress;
+    if (code == EXCEPTION_STACK_OVERFLOW) try_to_print_stack = false;
+    fprintf(stderr, "code: %x - flags: %d - address: %p\n", code, flgs, addr);
+    exrec = exrec->ExceptionRecord;
+  }
+  if (try_to_print_stack) {
+    print_stack_from_context(*ex_info->ContextRecord);
+  }
+  if (IsDebuggerPresent()) {
+    __debugbreak();
+  } else {
+    _exit(1);
+  }
+  return EXCEPTION_EXECUTE_HANDLER;
+}
+
+static void abort_handler(int sig) {
+  fprintf(stderr, "Abort handler called.\n");
+  print_current_stack();
+  if (IsDebuggerPresent()) {
+    __debugbreak();
+  } else {
+    _exit(1);
+  }
+}
+
+static void install_crash_handler() {
+  if (!SymInitialize(GetCurrentProcess(), NULL, TRUE)) {
+    fprintf(stderr, "SymInitialize failed: %d\n", GetLastError());
+  }
+  SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)crash_handler);
+  _set_abort_behavior(0, _WRITE_ABORT_MSG);
+  _set_abort_behavior(0, _CALL_REPORTFAULT);
+  signal(SIGABRT, abort_handler);
+}
+#elif GPR_POSIX_CRASH_HANDLER
+#include <errno.h>
+#include <execinfo.h>
+#include <grpc/support/useful.h>
+#include <stdio.h>
+#include <string.h>
+
+#define SIGNAL_NAMES_LENGTH 32
+
+static const char* const signal_names[] = {
+    NULL,      "SIGHUP",  "SIGINT",    "SIGQUIT", "SIGILL",    "SIGTRAP",
+    "SIGABRT", "SIGBUS",  "SIGFPE",    "SIGKILL", "SIGUSR1",   "SIGSEGV",
+    "SIGUSR2", "SIGPIPE", "SIGALRM",   "SIGTERM", "SIGSTKFLT", "SIGCHLD",
+    "SIGCONT", "SIGSTOP", "SIGTSTP",   "SIGTTIN", "SIGTTOU",   "SIGURG",
+    "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH",  "SIGIO",
+    "SIGPWR",  "SIGSYS"};
+
+static char g_alt_stack[GPR_MAX(MINSIGSTKSZ, 65536)];
+
+#define MAX_FRAMES 32
+
+/* signal safe output */
+static void output_string(const char* string) {
+  size_t len = strlen(string);
+  ssize_t r;
+
+  do {
+    r = write(STDERR_FILENO, string, len);
+  } while (r == -1 && errno == EINTR);
+}
+
+static void output_num(long num) {
+  char buf[GPR_LTOA_MIN_BUFSIZE];
+  gpr_ltoa(num, buf);
+  output_string(buf);
+}
+
+static void crash_handler(int signum, siginfo_t* info, void* data) {
+  void* addrlist[MAX_FRAMES + 1];
+  int addrlen;
+
+  output_string("\n\n\n*******************************\nCaught signal ");
+  if (signum > 0 && signum < SIGNAL_NAMES_LENGTH) {
+    output_string(signal_names[signum]);
+  } else {
+    output_num(signum);
+  }
+  output_string("\n");
+
+  addrlen = backtrace(addrlist, GPR_ARRAY_SIZE(addrlist));
+
+  if (addrlen == 0) {
+    output_string("  no backtrace\n");
+  } else {
+    backtrace_symbols_fd(addrlist, addrlen, STDERR_FILENO);
+  }
+
+  /* try to get a core dump for SIGTERM */
+  if (signum == SIGTERM) signum = SIGQUIT;
+  raise(signum);
+}
+
+static void install_crash_handler() {
+  stack_t ss;
+  struct sigaction sa;
+
+  memset(&ss, 0, sizeof(ss));
+  memset(&sa, 0, sizeof(sa));
+  ss.ss_size = sizeof(g_alt_stack);
+  ss.ss_sp = g_alt_stack;
+  GPR_ASSERT(sigaltstack(&ss, NULL) == 0);
+  sa.sa_flags = (int)(SA_SIGINFO | SA_ONSTACK | SA_RESETHAND);
+  sa.sa_sigaction = crash_handler;
+  GPR_ASSERT(sigaction(SIGILL, &sa, NULL) == 0);
+  GPR_ASSERT(sigaction(SIGABRT, &sa, NULL) == 0);
+  GPR_ASSERT(sigaction(SIGBUS, &sa, NULL) == 0);
+  GPR_ASSERT(sigaction(SIGSEGV, &sa, NULL) == 0);
+  GPR_ASSERT(sigaction(SIGTERM, &sa, NULL) == 0);
+  GPR_ASSERT(sigaction(SIGQUIT, &sa, NULL) == 0);
+}
+#else
+static void install_crash_handler() {}
+#endif
+
+bool BuiltUnderValgrind() {
+#ifdef RUNNING_ON_VALGRIND
+  return true;
+#else
+  return false;
+#endif
+}
+
+bool BuiltUnderTsan() {
+#if defined(__has_feature)
+#if __has_feature(thread_sanitizer)
+  return true;
+#else
+  return false;
+#endif
+#else
+#ifdef THREAD_SANITIZER
+  return true;
+#else
+  return false;
+#endif
+#endif
+}
+
+bool BuiltUnderAsan() {
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+  return true;
+#else
+  return false;
+#endif
+#else
+#ifdef ADDRESS_SANITIZER
+  return true;
+#else
+  return false;
+#endif
+#endif
+}
+
+bool BuiltUnderMsan() {
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+  return true;
+#else
+  return false;
+#endif
+#else
+#ifdef MEMORY_SANITIZER
+  return true;
+#else
+  return false;
+#endif
+#endif
+}
+
+bool BuiltUnderUbsan() {
+#ifdef GRPC_UBSAN
+  return true;
+#else
+  return false;
+#endif
+}
+
+int64_t grpc_test_sanitizer_slowdown_factor() {
+  int64_t sanitizer_multiplier = 1;
+  if (BuiltUnderValgrind()) {
+    sanitizer_multiplier = 20;
+  } else if (BuiltUnderTsan()) {
+    sanitizer_multiplier = 5;
+  } else if (BuiltUnderAsan()) {
+    sanitizer_multiplier = 3;
+  } else if (BuiltUnderMsan()) {
+    sanitizer_multiplier = 4;
+  } else if (BuiltUnderUbsan()) {
+    sanitizer_multiplier = 5;
+  }
+  return sanitizer_multiplier;
+}
+
+int64_t grpc_test_slowdown_factor() {
+  return grpc_test_sanitizer_slowdown_factor() * g_fixture_slowdown_factor *
+         g_poller_slowdown_factor;
+}
+
+gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s) {
+  return gpr_time_add(
+      gpr_now(GPR_CLOCK_MONOTONIC),
+      gpr_time_from_millis(grpc_test_slowdown_factor() * (int64_t)1e3 * time_s,
+                           GPR_TIMESPAN));
+}
+
+gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms) {
+  return gpr_time_add(
+      gpr_now(GPR_CLOCK_MONOTONIC),
+      gpr_time_from_micros(grpc_test_slowdown_factor() * (int64_t)1e3 * time_ms,
+                           GPR_TIMESPAN));
+}
+
+void grpc_test_init(int argc, char** argv) {
+  install_crash_handler();
+  { /* poll-cv poll strategy runs much more slowly than anything else */
+    char* s = gpr_getenv("GRPC_POLL_STRATEGY");
+    if (s != NULL && 0 == strcmp(s, "poll-cv")) {
+      g_poller_slowdown_factor = 5;
+    }
+    gpr_free(s);
+  }
+  gpr_log(GPR_DEBUG,
+          "test slowdown factor: sanitizer=%" PRId64 ", fixture=%" PRId64
+          ", poller=%" PRId64 ", total=%" PRId64,
+          grpc_test_sanitizer_slowdown_factor(), g_fixture_slowdown_factor,
+          g_poller_slowdown_factor, grpc_test_slowdown_factor());
+  /* seed rng with pid, so we don't end up with the same random numbers as a
+     concurrently running test binary */
+  srand(seed());
+}
diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h
index 051d7e9..4383fbf 100644
--- a/test/core/util/test_config.h
+++ b/test/core/util/test_config.h
@@ -23,7 +23,7 @@
 
 #ifdef __cplusplus
 extern "C" {
-#endif /*  __cplusplus */
+#endif
 
 extern int64_t g_fixture_slowdown_factor;
 extern int64_t g_poller_slowdown_factor;
@@ -41,10 +41,10 @@
 #define GRPC_TEST_PICK_PORT
 #endif
 
-void grpc_test_init(int argc, char **argv);
+void grpc_test_init(int argc, char** argv);
 
 #ifdef __cplusplus
 }
-#endif /*  __cplusplus */
+#endif
 
 #endif /* GRPC_TEST_CORE_UTIL_TEST_CONFIG_H */
diff --git a/test/core/util/test_tcp_server.c b/test/core/util/test_tcp_server.c
deleted file mode 100644
index 611ecb3..0000000
--- a/test/core/util/test_tcp_server.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "test/core/util/test_tcp_server.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-#include <string.h>
-#include "src/core/lib/iomgr/endpoint.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/tcp_server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-static void on_server_destroyed(grpc_exec_ctx *exec_ctx, void *data,
-                                grpc_error *error) {
-  test_tcp_server *server = data;
-  server->shutdown = 1;
-}
-
-void test_tcp_server_init(test_tcp_server *server,
-                          grpc_tcp_server_cb on_connect, void *user_data) {
-  grpc_init();
-  server->tcp_server = NULL;
-  GRPC_CLOSURE_INIT(&server->shutdown_complete, on_server_destroyed, server,
-                    grpc_schedule_on_exec_ctx);
-  server->shutdown = 0;
-  server->pollset = gpr_zalloc(grpc_pollset_size());
-  grpc_pollset_init(server->pollset, &server->mu);
-  server->on_connect = on_connect;
-  server->cb_data = user_data;
-}
-
-void test_tcp_server_start(test_tcp_server *server, int port) {
-  grpc_resolved_address resolved_addr;
-  struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr;
-  int port_added;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
-  addr->sin_family = AF_INET;
-  addr->sin_port = htons((uint16_t)port);
-  memset(&addr->sin_addr, 0, sizeof(addr->sin_addr));
-
-  grpc_error *error = grpc_tcp_server_create(
-      &exec_ctx, &server->shutdown_complete, NULL, &server->tcp_server);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  error =
-      grpc_tcp_server_add_port(server->tcp_server, &resolved_addr, &port_added);
-  GPR_ASSERT(error == GRPC_ERROR_NONE);
-  GPR_ASSERT(port_added == port);
-
-  grpc_tcp_server_start(&exec_ctx, server->tcp_server, &server->pollset, 1,
-                        server->on_connect, server->cb_data);
-  gpr_log(GPR_INFO, "test tcp server listening on 0.0.0.0:%d", port);
-
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-void test_tcp_server_poll(test_tcp_server *server, int seconds) {
-  grpc_pollset_worker *worker = NULL;
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  grpc_millis deadline = grpc_timespec_to_millis_round_up(
-      grpc_timeout_seconds_to_deadline(seconds));
-  gpr_mu_lock(server->mu);
-  GRPC_LOG_IF_ERROR(
-      "pollset_work",
-      grpc_pollset_work(&exec_ctx, server->pollset, &worker, deadline));
-  gpr_mu_unlock(server->mu);
-  grpc_exec_ctx_finish(&exec_ctx);
-}
-
-static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
-static void finish_pollset(grpc_exec_ctx *exec_ctx, void *arg,
-                           grpc_error *error) {
-  grpc_pollset_destroy(exec_ctx, arg);
-}
-
-void test_tcp_server_destroy(test_tcp_server *server) {
-  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-  gpr_timespec shutdown_deadline;
-  grpc_closure do_nothing_cb;
-  grpc_tcp_server_unref(&exec_ctx, server->tcp_server);
-  GRPC_CLOSURE_INIT(&do_nothing_cb, do_nothing, NULL,
-                    grpc_schedule_on_exec_ctx);
-  shutdown_deadline = gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
-                                   gpr_time_from_seconds(5, GPR_TIMESPAN));
-  while (!server->shutdown &&
-         gpr_time_cmp(gpr_now(GPR_CLOCK_MONOTONIC), shutdown_deadline) < 0) {
-    test_tcp_server_poll(server, 1);
-  }
-  grpc_pollset_shutdown(&exec_ctx, server->pollset,
-                        GRPC_CLOSURE_CREATE(finish_pollset, server->pollset,
-                                            grpc_schedule_on_exec_ctx));
-  grpc_exec_ctx_finish(&exec_ctx);
-  gpr_free(server->pollset);
-  grpc_shutdown();
-}
diff --git a/test/core/util/test_tcp_server.cc b/test/core/util/test_tcp_server.cc
new file mode 100644
index 0000000..925209d
--- /dev/null
+++ b/test/core/util/test_tcp_server.cc
@@ -0,0 +1,118 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include "test/core/util/test_tcp_server.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+#include <string.h>
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/tcp_server.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+static void on_server_destroyed(grpc_exec_ctx* exec_ctx, void* data,
+                                grpc_error* error) {
+  test_tcp_server* server = static_cast<test_tcp_server*>(data);
+  server->shutdown = 1;
+}
+
+void test_tcp_server_init(test_tcp_server* server,
+                          grpc_tcp_server_cb on_connect, void* user_data) {
+  grpc_init();
+  server->tcp_server = NULL;
+  GRPC_CLOSURE_INIT(&server->shutdown_complete, on_server_destroyed, server,
+                    grpc_schedule_on_exec_ctx);
+  server->shutdown = 0;
+  server->pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+  grpc_pollset_init(server->pollset, &server->mu);
+  server->on_connect = on_connect;
+  server->cb_data = user_data;
+}
+
+void test_tcp_server_start(test_tcp_server* server, int port) {
+  grpc_resolved_address resolved_addr;
+  struct sockaddr_in* addr = (struct sockaddr_in*)resolved_addr.addr;
+  int port_added;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+  addr->sin_family = AF_INET;
+  addr->sin_port = htons((uint16_t)port);
+  memset(&addr->sin_addr, 0, sizeof(addr->sin_addr));
+
+  grpc_error* error = grpc_tcp_server_create(
+      &exec_ctx, &server->shutdown_complete, NULL, &server->tcp_server);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  error =
+      grpc_tcp_server_add_port(server->tcp_server, &resolved_addr, &port_added);
+  GPR_ASSERT(error == GRPC_ERROR_NONE);
+  GPR_ASSERT(port_added == port);
+
+  grpc_tcp_server_start(&exec_ctx, server->tcp_server, &server->pollset, 1,
+                        server->on_connect, server->cb_data);
+  gpr_log(GPR_INFO, "test tcp server listening on 0.0.0.0:%d", port);
+
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+void test_tcp_server_poll(test_tcp_server* server, int seconds) {
+  grpc_pollset_worker* worker = NULL;
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  grpc_millis deadline = grpc_timespec_to_millis_round_up(
+      grpc_timeout_seconds_to_deadline(seconds));
+  gpr_mu_lock(server->mu);
+  GRPC_LOG_IF_ERROR(
+      "pollset_work",
+      grpc_pollset_work(&exec_ctx, server->pollset, &worker, deadline));
+  gpr_mu_unlock(server->mu);
+  grpc_exec_ctx_finish(&exec_ctx);
+}
+
+static void do_nothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
+static void finish_pollset(grpc_exec_ctx* exec_ctx, void* arg,
+                           grpc_error* error) {
+  grpc_pollset_destroy(exec_ctx, static_cast<grpc_pollset*>(arg));
+}
+
+void test_tcp_server_destroy(test_tcp_server* server) {
+  grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+  gpr_timespec shutdown_deadline;
+  grpc_closure do_nothing_cb;
+  grpc_tcp_server_unref(&exec_ctx, server->tcp_server);
+  GRPC_CLOSURE_INIT(&do_nothing_cb, do_nothing, NULL,
+                    grpc_schedule_on_exec_ctx);
+  shutdown_deadline = gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+                                   gpr_time_from_seconds(5, GPR_TIMESPAN));
+  while (!server->shutdown &&
+         gpr_time_cmp(gpr_now(GPR_CLOCK_MONOTONIC), shutdown_deadline) < 0) {
+    test_tcp_server_poll(server, 1);
+  }
+  grpc_pollset_shutdown(&exec_ctx, server->pollset,
+                        GRPC_CLOSURE_CREATE(finish_pollset, server->pollset,
+                                            grpc_schedule_on_exec_ctx));
+  grpc_exec_ctx_finish(&exec_ctx);
+  gpr_free(server->pollset);
+  grpc_shutdown();
+}
diff --git a/test/core/util/test_tcp_server.h b/test/core/util/test_tcp_server.h
index bd62992..5814038 100644
--- a/test/core/util/test_tcp_server.h
+++ b/test/core/util/test_tcp_server.h
@@ -23,19 +23,19 @@
 #include "src/core/lib/iomgr/tcp_server.h"
 
 typedef struct test_tcp_server {
-  grpc_tcp_server *tcp_server;
+  grpc_tcp_server* tcp_server;
   grpc_closure shutdown_complete;
   int shutdown;
-  gpr_mu *mu;
-  grpc_pollset *pollset;
+  gpr_mu* mu;
+  grpc_pollset* pollset;
   grpc_tcp_server_cb on_connect;
-  void *cb_data;
+  void* cb_data;
 } test_tcp_server;
 
-void test_tcp_server_init(test_tcp_server *server,
-                          grpc_tcp_server_cb on_connect, void *user_data);
-void test_tcp_server_start(test_tcp_server *server, int port);
-void test_tcp_server_poll(test_tcp_server *server, int seconds);
-void test_tcp_server_destroy(test_tcp_server *server);
+void test_tcp_server_init(test_tcp_server* server,
+                          grpc_tcp_server_cb on_connect, void* user_data);
+void test_tcp_server_start(test_tcp_server* server, int port);
+void test_tcp_server_poll(test_tcp_server* server, int seconds);
+void test_tcp_server_destroy(test_tcp_server* server);
 
 #endif /* GRPC_TEST_CORE_UTIL_TEST_TCP_SERVER_H */
diff --git a/test/core/util/trickle_endpoint.c b/test/core/util/trickle_endpoint.c
deleted file mode 100644
index fc066f9..0000000
--- a/test/core/util/trickle_endpoint.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "test/core/util/passthru_endpoint.h"
-
-#include <inttypes.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/useful.h>
-#include "src/core/lib/slice/slice_internal.h"
-
-#define WRITE_BUFFER_SIZE (2 * 1024 * 1024)
-
-typedef struct {
-  grpc_endpoint base;
-  double bytes_per_second;
-  grpc_endpoint *wrapped;
-  gpr_timespec last_write;
-
-  gpr_mu mu;
-  grpc_slice_buffer write_buffer;
-  grpc_slice_buffer writing_buffer;
-  grpc_error *error;
-  bool writing;
-  grpc_closure *write_cb;
-} trickle_endpoint;
-
-static void te_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                    grpc_slice_buffer *slices, grpc_closure *cb) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  grpc_endpoint_read(exec_ctx, te->wrapped, slices, cb);
-}
-
-static void maybe_call_write_cb_locked(grpc_exec_ctx *exec_ctx,
-                                       trickle_endpoint *te) {
-  if (te->write_cb != NULL && (te->error != GRPC_ERROR_NONE ||
-                               te->write_buffer.length <= WRITE_BUFFER_SIZE)) {
-    GRPC_CLOSURE_SCHED(exec_ctx, te->write_cb, GRPC_ERROR_REF(te->error));
-    te->write_cb = NULL;
-  }
-}
-
-static void te_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                     grpc_slice_buffer *slices, grpc_closure *cb) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  gpr_mu_lock(&te->mu);
-  GPR_ASSERT(te->write_cb == NULL);
-  if (te->write_buffer.length == 0) {
-    te->last_write = gpr_now(GPR_CLOCK_MONOTONIC);
-  }
-  for (size_t i = 0; i < slices->count; i++) {
-    grpc_slice_buffer_add(&te->write_buffer,
-                          grpc_slice_copy(slices->slices[i]));
-  }
-  te->write_cb = cb;
-  maybe_call_write_cb_locked(exec_ctx, te);
-  gpr_mu_unlock(&te->mu);
-}
-
-static void te_add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                              grpc_pollset *pollset) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  grpc_endpoint_add_to_pollset(exec_ctx, te->wrapped, pollset);
-}
-
-static void te_add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                  grpc_pollset_set *pollset_set) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  grpc_endpoint_add_to_pollset_set(exec_ctx, te->wrapped, pollset_set);
-}
-
-static void te_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                        grpc_error *why) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  gpr_mu_lock(&te->mu);
-  if (te->error == GRPC_ERROR_NONE) {
-    te->error = GRPC_ERROR_REF(why);
-  }
-  maybe_call_write_cb_locked(exec_ctx, te);
-  gpr_mu_unlock(&te->mu);
-  grpc_endpoint_shutdown(exec_ctx, te->wrapped, why);
-}
-
-static void te_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  grpc_endpoint_destroy(exec_ctx, te->wrapped);
-  gpr_mu_destroy(&te->mu);
-  grpc_slice_buffer_destroy_internal(exec_ctx, &te->write_buffer);
-  grpc_slice_buffer_destroy_internal(exec_ctx, &te->writing_buffer);
-  GRPC_ERROR_UNREF(te->error);
-  gpr_free(te);
-}
-
-static grpc_resource_user *te_get_resource_user(grpc_endpoint *ep) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  return grpc_endpoint_get_resource_user(te->wrapped);
-}
-
-static char *te_get_peer(grpc_endpoint *ep) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  return grpc_endpoint_get_peer(te->wrapped);
-}
-
-static int te_get_fd(grpc_endpoint *ep) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  return grpc_endpoint_get_fd(te->wrapped);
-}
-
-static void te_finish_write(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_error *error) {
-  trickle_endpoint *te = (trickle_endpoint *)arg;
-  gpr_mu_lock(&te->mu);
-  te->writing = false;
-  grpc_slice_buffer_reset_and_unref(&te->writing_buffer);
-  gpr_mu_unlock(&te->mu);
-}
-
-static const grpc_endpoint_vtable vtable = {
-    te_read,     te_write,   te_add_to_pollset,    te_add_to_pollset_set,
-    te_shutdown, te_destroy, te_get_resource_user, te_get_peer,
-    te_get_fd};
-
-grpc_endpoint *grpc_trickle_endpoint_create(grpc_endpoint *wrap,
-                                            double bytes_per_second) {
-  trickle_endpoint *te = (trickle_endpoint *)gpr_malloc(sizeof(*te));
-  te->base.vtable = &vtable;
-  te->wrapped = wrap;
-  te->bytes_per_second = bytes_per_second;
-  te->write_cb = NULL;
-  gpr_mu_init(&te->mu);
-  grpc_slice_buffer_init(&te->write_buffer);
-  grpc_slice_buffer_init(&te->writing_buffer);
-  te->error = GRPC_ERROR_NONE;
-  te->writing = false;
-  return &te->base;
-}
-
-static double ts2dbl(gpr_timespec s) {
-  return (double)s.tv_sec + 1e-9 * (double)s.tv_nsec;
-}
-
-size_t grpc_trickle_endpoint_trickle(grpc_exec_ctx *exec_ctx,
-                                     grpc_endpoint *ep) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  gpr_mu_lock(&te->mu);
-  if (!te->writing && te->write_buffer.length > 0) {
-    gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
-    double elapsed = ts2dbl(gpr_time_sub(now, te->last_write));
-    size_t bytes = (size_t)(te->bytes_per_second * elapsed);
-    // gpr_log(GPR_DEBUG, "%lf elapsed --> %" PRIdPTR " bytes", elapsed, bytes);
-    if (bytes > 0) {
-      grpc_slice_buffer_move_first(&te->write_buffer,
-                                   GPR_MIN(bytes, te->write_buffer.length),
-                                   &te->writing_buffer);
-      te->writing = true;
-      te->last_write = now;
-      grpc_endpoint_write(
-          exec_ctx, te->wrapped, &te->writing_buffer,
-          GRPC_CLOSURE_CREATE(te_finish_write, te, grpc_schedule_on_exec_ctx));
-      maybe_call_write_cb_locked(exec_ctx, te);
-    }
-  }
-  size_t backlog = te->write_buffer.length;
-  gpr_mu_unlock(&te->mu);
-  return backlog;
-}
-
-size_t grpc_trickle_get_backlog(grpc_endpoint *ep) {
-  trickle_endpoint *te = (trickle_endpoint *)ep;
-  gpr_mu_lock(&te->mu);
-  size_t backlog = te->write_buffer.length;
-  gpr_mu_unlock(&te->mu);
-  return backlog;
-}
diff --git a/test/core/util/trickle_endpoint.cc b/test/core/util/trickle_endpoint.cc
new file mode 100644
index 0000000..c8b54b4
--- /dev/null
+++ b/test/core/util/trickle_endpoint.cc
@@ -0,0 +1,207 @@
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "src/core/lib/iomgr/sockaddr.h"
+
+#include "test/core/util/passthru_endpoint.h"
+
+#include <inttypes.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/useful.h>
+#include "src/core/lib/slice/slice_internal.h"
+
+#define WRITE_BUFFER_SIZE (2 * 1024 * 1024)
+
+typedef struct {
+  grpc_endpoint base;
+  double bytes_per_second;
+  grpc_endpoint* wrapped;
+  gpr_timespec last_write;
+
+  gpr_mu mu;
+  grpc_slice_buffer write_buffer;
+  grpc_slice_buffer writing_buffer;
+  grpc_error* error;
+  bool writing;
+  grpc_closure* write_cb;
+} trickle_endpoint;
+
+static void te_read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                    grpc_slice_buffer* slices, grpc_closure* cb) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  grpc_endpoint_read(exec_ctx, te->wrapped, slices, cb);
+}
+
+static void maybe_call_write_cb_locked(grpc_exec_ctx* exec_ctx,
+                                       trickle_endpoint* te) {
+  if (te->write_cb != NULL && (te->error != GRPC_ERROR_NONE ||
+                               te->write_buffer.length <= WRITE_BUFFER_SIZE)) {
+    GRPC_CLOSURE_SCHED(exec_ctx, te->write_cb, GRPC_ERROR_REF(te->error));
+    te->write_cb = NULL;
+  }
+}
+
+static void te_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                     grpc_slice_buffer* slices, grpc_closure* cb) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  gpr_mu_lock(&te->mu);
+  GPR_ASSERT(te->write_cb == NULL);
+  if (te->write_buffer.length == 0) {
+    te->last_write = gpr_now(GPR_CLOCK_MONOTONIC);
+  }
+  for (size_t i = 0; i < slices->count; i++) {
+    grpc_slice_buffer_add(&te->write_buffer,
+                          grpc_slice_copy(slices->slices[i]));
+  }
+  te->write_cb = cb;
+  maybe_call_write_cb_locked(exec_ctx, te);
+  gpr_mu_unlock(&te->mu);
+}
+
+static void te_add_to_pollset(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                              grpc_pollset* pollset) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  grpc_endpoint_add_to_pollset(exec_ctx, te->wrapped, pollset);
+}
+
+static void te_add_to_pollset_set(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                  grpc_pollset_set* pollset_set) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  grpc_endpoint_add_to_pollset_set(exec_ctx, te->wrapped, pollset_set);
+}
+
+static void te_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                       grpc_endpoint* ep,
+                                       grpc_pollset_set* pollset_set) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  grpc_endpoint_delete_from_pollset_set(exec_ctx, te->wrapped, pollset_set);
+}
+
+static void te_shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                        grpc_error* why) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  gpr_mu_lock(&te->mu);
+  if (te->error == GRPC_ERROR_NONE) {
+    te->error = GRPC_ERROR_REF(why);
+  }
+  maybe_call_write_cb_locked(exec_ctx, te);
+  gpr_mu_unlock(&te->mu);
+  grpc_endpoint_shutdown(exec_ctx, te->wrapped, why);
+}
+
+static void te_destroy(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  grpc_endpoint_destroy(exec_ctx, te->wrapped);
+  gpr_mu_destroy(&te->mu);
+  grpc_slice_buffer_destroy_internal(exec_ctx, &te->write_buffer);
+  grpc_slice_buffer_destroy_internal(exec_ctx, &te->writing_buffer);
+  GRPC_ERROR_UNREF(te->error);
+  gpr_free(te);
+}
+
+static grpc_resource_user* te_get_resource_user(grpc_endpoint* ep) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  return grpc_endpoint_get_resource_user(te->wrapped);
+}
+
+static char* te_get_peer(grpc_endpoint* ep) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  return grpc_endpoint_get_peer(te->wrapped);
+}
+
+static int te_get_fd(grpc_endpoint* ep) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  return grpc_endpoint_get_fd(te->wrapped);
+}
+
+static void te_finish_write(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_error* error) {
+  trickle_endpoint* te = (trickle_endpoint*)arg;
+  gpr_mu_lock(&te->mu);
+  te->writing = false;
+  grpc_slice_buffer_reset_and_unref(&te->writing_buffer);
+  gpr_mu_unlock(&te->mu);
+}
+
+static const grpc_endpoint_vtable vtable = {te_read,
+                                            te_write,
+                                            te_add_to_pollset,
+                                            te_add_to_pollset_set,
+                                            te_delete_from_pollset_set,
+                                            te_shutdown,
+                                            te_destroy,
+                                            te_get_resource_user,
+                                            te_get_peer,
+                                            te_get_fd};
+
+grpc_endpoint* grpc_trickle_endpoint_create(grpc_endpoint* wrap,
+                                            double bytes_per_second) {
+  trickle_endpoint* te = (trickle_endpoint*)gpr_malloc(sizeof(*te));
+  te->base.vtable = &vtable;
+  te->wrapped = wrap;
+  te->bytes_per_second = bytes_per_second;
+  te->write_cb = NULL;
+  gpr_mu_init(&te->mu);
+  grpc_slice_buffer_init(&te->write_buffer);
+  grpc_slice_buffer_init(&te->writing_buffer);
+  te->error = GRPC_ERROR_NONE;
+  te->writing = false;
+  return &te->base;
+}
+
+static double ts2dbl(gpr_timespec s) {
+  return (double)s.tv_sec + 1e-9 * (double)s.tv_nsec;
+}
+
+size_t grpc_trickle_endpoint_trickle(grpc_exec_ctx* exec_ctx,
+                                     grpc_endpoint* ep) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  gpr_mu_lock(&te->mu);
+  if (!te->writing && te->write_buffer.length > 0) {
+    gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
+    double elapsed = ts2dbl(gpr_time_sub(now, te->last_write));
+    size_t bytes = (size_t)(te->bytes_per_second * elapsed);
+    // gpr_log(GPR_DEBUG, "%lf elapsed --> %" PRIdPTR " bytes", elapsed, bytes);
+    if (bytes > 0) {
+      grpc_slice_buffer_move_first(&te->write_buffer,
+                                   GPR_MIN(bytes, te->write_buffer.length),
+                                   &te->writing_buffer);
+      te->writing = true;
+      te->last_write = now;
+      grpc_endpoint_write(
+          exec_ctx, te->wrapped, &te->writing_buffer,
+          GRPC_CLOSURE_CREATE(te_finish_write, te, grpc_schedule_on_exec_ctx));
+      maybe_call_write_cb_locked(exec_ctx, te);
+    }
+  }
+  size_t backlog = te->write_buffer.length;
+  gpr_mu_unlock(&te->mu);
+  return backlog;
+}
+
+size_t grpc_trickle_get_backlog(grpc_endpoint* ep) {
+  trickle_endpoint* te = (trickle_endpoint*)ep;
+  gpr_mu_lock(&te->mu);
+  size_t backlog = te->write_buffer.length;
+  gpr_mu_unlock(&te->mu);
+  return backlog;
+}
diff --git a/test/core/util/trickle_endpoint.h b/test/core/util/trickle_endpoint.h
index ca39638..11c113b 100644
--- a/test/core/util/trickle_endpoint.h
+++ b/test/core/util/trickle_endpoint.h
@@ -21,21 +21,13 @@
 
 #include "src/core/lib/iomgr/endpoint.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif  // __cplusplus
-
-grpc_endpoint *grpc_trickle_endpoint_create(grpc_endpoint *wrap,
+grpc_endpoint* grpc_trickle_endpoint_create(grpc_endpoint* wrap,
                                             double bytes_per_second);
 
 /* Allow up to \a bytes through the endpoint. Returns the new backlog. */
-size_t grpc_trickle_endpoint_trickle(grpc_exec_ctx *exec_ctx,
-                                     grpc_endpoint *endpoint);
+size_t grpc_trickle_endpoint_trickle(grpc_exec_ctx* exec_ctx,
+                                     grpc_endpoint* endpoint);
 
-size_t grpc_trickle_get_backlog(grpc_endpoint *endpoint);
-
-#ifdef __cplusplus
-}
-#endif  // __cplusplus
+size_t grpc_trickle_get_backlog(grpc_endpoint* endpoint);
 
 #endif
diff --git a/test/cpp/codegen/BUILD b/test/cpp/codegen/BUILD
index 8de46be..6cc81e3 100644
--- a/test/cpp/codegen/BUILD
+++ b/test/cpp/codegen/BUILD
@@ -51,6 +51,7 @@
     ],
     external_deps = [
         "gtest",
+        "protobuf",
     ],
 )
 
diff --git a/test/cpp/codegen/compiler_test_golden b/test/cpp/codegen/compiler_test_golden
index 3d664e8..026a941 100644
--- a/test/cpp/codegen/compiler_test_golden
+++ b/test/cpp/codegen/compiler_test_golden
@@ -39,7 +39,6 @@
 namespace grpc {
 class CompletionQueue;
 class Channel;
-class RpcService;
 class ServerCompletionQueue;
 class ServerContext;
 }  // namespace grpc
@@ -169,10 +168,10 @@
     ::grpc::ClientReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4Raw(::grpc::ClientContext* context) override;
     ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>* AsyncMethodA4Raw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override;
     ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>* PrepareAsyncMethodA4Raw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override;
-    const ::grpc::RpcMethod rpcmethod_MethodA1_;
-    const ::grpc::RpcMethod rpcmethod_MethodA2_;
-    const ::grpc::RpcMethod rpcmethod_MethodA3_;
-    const ::grpc::RpcMethod rpcmethod_MethodA4_;
+    const ::grpc::internal::RpcMethod rpcmethod_MethodA1_;
+    const ::grpc::internal::RpcMethod rpcmethod_MethodA2_;
+    const ::grpc::internal::RpcMethod rpcmethod_MethodA3_;
+    const ::grpc::internal::RpcMethod rpcmethod_MethodA4_;
   };
   static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
 
@@ -352,7 +351,7 @@
    public:
     WithStreamedUnaryMethod_MethodA1() {
       ::grpc::Service::MarkMethodStreamed(0,
-        new ::grpc::StreamedUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>(std::bind(&WithStreamedUnaryMethod_MethodA1<BaseClass>::StreamedMethodA1, this, std::placeholders::_1, std::placeholders::_2)));
+        new ::grpc::internal::StreamedUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>(std::bind(&WithStreamedUnaryMethod_MethodA1<BaseClass>::StreamedMethodA1, this, std::placeholders::_1, std::placeholders::_2)));
     }
     ~WithStreamedUnaryMethod_MethodA1() override {
       BaseClassMustBeDerivedFromService(this);
@@ -373,7 +372,7 @@
    public:
     WithSplitStreamingMethod_MethodA3() {
       ::grpc::Service::MarkMethodStreamed(2,
-        new ::grpc::SplitServerStreamingHandler< ::grpc::testing::Request, ::grpc::testing::Response>(std::bind(&WithSplitStreamingMethod_MethodA3<BaseClass>::StreamedMethodA3, this, std::placeholders::_1, std::placeholders::_2)));
+        new ::grpc::internal::SplitServerStreamingHandler< ::grpc::testing::Request, ::grpc::testing::Response>(std::bind(&WithSplitStreamingMethod_MethodA3<BaseClass>::StreamedMethodA3, this, std::placeholders::_1, std::placeholders::_2)));
     }
     ~WithSplitStreamingMethod_MethodA3() override {
       BaseClassMustBeDerivedFromService(this);
@@ -427,7 +426,7 @@
     std::shared_ptr< ::grpc::ChannelInterface> channel_;
     ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* AsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override;
     ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* PrepareAsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override;
-    const ::grpc::RpcMethod rpcmethod_MethodB1_;
+    const ::grpc::internal::RpcMethod rpcmethod_MethodB1_;
   };
   static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
 
@@ -484,7 +483,7 @@
    public:
     WithStreamedUnaryMethod_MethodB1() {
       ::grpc::Service::MarkMethodStreamed(0,
-        new ::grpc::StreamedUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>(std::bind(&WithStreamedUnaryMethod_MethodB1<BaseClass>::StreamedMethodB1, this, std::placeholders::_1, std::placeholders::_2)));
+        new ::grpc::internal::StreamedUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>(std::bind(&WithStreamedUnaryMethod_MethodB1<BaseClass>::StreamedMethodB1, this, std::placeholders::_1, std::placeholders::_2)));
     }
     ~WithStreamedUnaryMethod_MethodB1() override {
       BaseClassMustBeDerivedFromService(this);
diff --git a/test/cpp/codegen/golden_file_test.cc b/test/cpp/codegen/golden_file_test.cc
index 5df1b8a..1488098 100644
--- a/test/cpp/codegen/golden_file_test.cc
+++ b/test/cpp/codegen/golden_file_test.cc
@@ -58,7 +58,7 @@
            kMockGoldenFilePath);
 }
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
   ::testing::InitGoogleTest(&argc, argv);
   ::google::ParseCommandLineFlags(&argc, &argv, true);
   if (FLAGS_generated_file_path.empty()) {
diff --git a/test/cpp/common/auth_property_iterator_test.cc b/test/cpp/common/auth_property_iterator_test.cc
index e25d2a7..4a097e8 100644
--- a/test/cpp/common/auth_property_iterator_test.cc
+++ b/test/cpp/common/auth_property_iterator_test.cc
@@ -22,9 +22,7 @@
 #include "src/cpp/common/secure_auth_context.h"
 #include "test/cpp/util/string_ref_helper.h"
 
-extern "C" {
 #include "src/core/lib/security/context/security_context.h"
-}
 
 using ::grpc::testing::ToString;
 
diff --git a/test/cpp/common/channel_arguments_test.cc b/test/cpp/common/channel_arguments_test.cc
index cfe64f1..d6ed2e5 100644
--- a/test/cpp/common/channel_arguments_test.cc
+++ b/test/cpp/common/channel_arguments_test.cc
@@ -23,10 +23,8 @@
 #include <grpc/support/useful.h>
 #include <gtest/gtest.h>
 
-extern "C" {
 #include "src/core/lib/iomgr/exec_ctx.h"
 #include "src/core/lib/iomgr/socket_mutator.h"
-}
 
 namespace grpc {
 namespace testing {
@@ -72,7 +70,7 @@
 TestSocketMutator::TestSocketMutator() {
   grpc_socket_mutator_init(this, &test_mutator_vtable);
 }
-}
+}  // namespace
 
 class ChannelArgumentsTest : public ::testing::Test {
  protected:
diff --git a/test/cpp/common/secure_auth_context_test.cc b/test/cpp/common/secure_auth_context_test.cc
index 91c7a3b..0cc32c1 100644
--- a/test/cpp/common/secure_auth_context_test.cc
+++ b/test/cpp/common/secure_auth_context_test.cc
@@ -22,9 +22,7 @@
 #include <gtest/gtest.h>
 #include "test/cpp/util/string_ref_helper.h"
 
-extern "C" {
 #include "src/core/lib/security/context/security_context.h"
-}
 
 using grpc::testing::ToString;
 
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 2a33e8a..5b6e9aa 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -28,12 +28,14 @@
 #include <grpc++/server_builder.h>
 #include <grpc++/server_context.h>
 #include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
 #include <grpc/support/log.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/time.h>
 #include <grpc/support/tls.h>
 
 #include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/support/env.h"
 #include "src/proto/grpc/health/v1/health.grpc.pb.h"
 #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
 #include "src/proto/grpc/testing/echo.grpc.pb.h"
@@ -99,7 +101,7 @@
 
 class Verifier {
  public:
-  explicit Verifier(bool spin) : spin_(spin) {}
+  explicit Verifier(bool spin) : spin_(spin), lambda_run_(false) {}
   // Expect sets the expected ok value for a specific tag
   Verifier& Expect(int i, bool expect_ok) {
     return ExpectUnless(i, expect_ok, false);
@@ -142,6 +144,18 @@
     return detag(got_tag);
   }
 
+  template <typename T>
+  CompletionQueue::NextStatus DoOnceThenAsyncNext(
+      CompletionQueue* cq, void** got_tag, bool* ok, T deadline,
+      std::function<void(void)> lambda) {
+    if (lambda_run_) {
+      return cq->AsyncNext(got_tag, ok, deadline);
+    } else {
+      lambda_run_ = true;
+      return cq->DoThenAsyncNext(lambda, got_tag, ok, deadline);
+    }
+  }
+
   // Verify keeps calling Next until all currently set
   // expected tags are complete
   void Verify(CompletionQueue* cq) { Verify(cq, false); }
@@ -154,6 +168,7 @@
       Next(cq, ignore_ok);
     }
   }
+
   // This version of Verify stops after a certain deadline
   void Verify(CompletionQueue* cq,
               std::chrono::system_clock::time_point deadline) {
@@ -193,6 +208,47 @@
     }
   }
 
+  // This version of Verify stops after a certain deadline, and uses the
+  // DoThenAsyncNext API
+  // to call the lambda
+  void Verify(CompletionQueue* cq,
+              std::chrono::system_clock::time_point deadline,
+              std::function<void(void)> lambda) {
+    if (expectations_.empty()) {
+      bool ok;
+      void* got_tag;
+      if (spin_) {
+        while (std::chrono::system_clock::now() < deadline) {
+          EXPECT_EQ(DoOnceThenAsyncNext(cq, &got_tag, &ok, deadline, lambda),
+                    CompletionQueue::TIMEOUT);
+        }
+      } else {
+        EXPECT_EQ(DoOnceThenAsyncNext(cq, &got_tag, &ok, deadline, lambda),
+                  CompletionQueue::TIMEOUT);
+      }
+    } else {
+      while (!expectations_.empty()) {
+        bool ok;
+        void* got_tag;
+        if (spin_) {
+          for (;;) {
+            GPR_ASSERT(std::chrono::system_clock::now() < deadline);
+            auto r = DoOnceThenAsyncNext(
+                cq, &got_tag, &ok, gpr_time_0(GPR_CLOCK_REALTIME), lambda);
+            if (r == CompletionQueue::TIMEOUT) continue;
+            if (r == CompletionQueue::GOT_EVENT) break;
+            gpr_log(GPR_ERROR, "unexpected result from AsyncNext");
+            abort();
+          }
+        } else {
+          EXPECT_EQ(DoOnceThenAsyncNext(cq, &got_tag, &ok, deadline, lambda),
+                    CompletionQueue::GOT_EVENT);
+        }
+        GotTag(got_tag, ok, false);
+      }
+    }
+  }
+
  private:
   void GotTag(void* got_tag, bool ok, bool ignore_ok) {
     auto it = expectations_.find(got_tag);
@@ -226,6 +282,7 @@
   std::map<void*, bool> expectations_;
   std::map<void*, MaybeExpect> maybe_expectations_;
   bool spin_;
+  bool lambda_run_;
 };
 
 bool plugin_has_sync_methods(std::unique_ptr<ServerBuilderPlugin>& plugin) {
@@ -401,9 +458,18 @@
 }
 
 TEST_P(AsyncEnd2endTest, ReconnectChannel) {
+  // GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS is set to 100ms in main()
   if (GetParam().inproc) {
     return;
   }
+  int poller_slowdown_factor = 1;
+  // It needs 2 pollset_works to reconnect the channel with polling engine
+  // "poll"
+  char* s = gpr_getenv("GRPC_POLL_STRATEGY");
+  if (s != NULL && 0 == strcmp(s, "poll")) {
+    poller_slowdown_factor = 2;
+  }
+  gpr_free(s);
   ResetStub();
   SendRpc(1);
   server_->Shutdown();
@@ -413,10 +479,13 @@
   while (cq_->Next(&ignored_tag, &ignored_ok))
     ;
   BuildAndStartServer();
-  // It needs more than kConnectivityCheckIntervalMsec time to reconnect the
-  // channel.
-  gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                               gpr_time_from_millis(1600, GPR_TIMESPAN)));
+  // It needs more than GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS time to
+  // reconnect the channel.
+  gpr_sleep_until(gpr_time_add(
+      gpr_now(GPR_CLOCK_REALTIME),
+      gpr_time_from_millis(
+          300 * poller_slowdown_factor * grpc_test_slowdown_factor(),
+          GPR_TIMESPAN)));
   SendRpc(1);
 }
 
@@ -490,6 +559,60 @@
   EXPECT_TRUE(recv_status.ok());
 }
 
+// Test a simple RPC using the async version of Next
+TEST_P(AsyncEnd2endTest, DoThenAsyncNextRpc) {
+  ResetStub();
+
+  EchoRequest send_request;
+  EchoRequest recv_request;
+  EchoResponse send_response;
+  EchoResponse recv_response;
+  Status recv_status;
+
+  ClientContext cli_ctx;
+  ServerContext srv_ctx;
+  grpc::ServerAsyncResponseWriter<EchoResponse> response_writer(&srv_ctx);
+
+  send_request.set_message(GetParam().message_content);
+  std::unique_ptr<ClientAsyncResponseReader<EchoResponse>> response_reader(
+      stub_->AsyncEcho(&cli_ctx, send_request, cq_.get()));
+
+  std::chrono::system_clock::time_point time_now(
+      std::chrono::system_clock::now());
+  std::chrono::system_clock::time_point time_limit(
+      std::chrono::system_clock::now() + std::chrono::seconds(10));
+  Verifier(GetParam().disable_blocking).Verify(cq_.get(), time_now);
+  Verifier(GetParam().disable_blocking).Verify(cq_.get(), time_now);
+
+  auto resp_writer_ptr = &response_writer;
+  auto lambda_2 = [&, this, resp_writer_ptr]() {
+    gpr_log(GPR_ERROR, "CALLED");
+    service_->RequestEcho(&srv_ctx, &recv_request, resp_writer_ptr, cq_.get(),
+                          cq_.get(), tag(2));
+  };
+
+  Verifier(GetParam().disable_blocking)
+      .Expect(2, true)
+      .Verify(cq_.get(), time_limit, lambda_2);
+  EXPECT_EQ(send_request.message(), recv_request.message());
+
+  auto recv_resp_ptr = &recv_response;
+  auto status_ptr = &recv_status;
+  send_response.set_message(recv_request.message());
+  auto lambda_3 = [&, this, resp_writer_ptr, send_response]() {
+    resp_writer_ptr->Finish(send_response, Status::OK, tag(3));
+  };
+  response_reader->Finish(recv_resp_ptr, status_ptr, tag(4));
+  Verifier(GetParam().disable_blocking)
+      .Expect(3, true)
+      .Expect(4, true)
+      .Verify(cq_.get(), std::chrono::system_clock::time_point::max(),
+              lambda_3);
+
+  EXPECT_EQ(send_response.message(), recv_response.message());
+  EXPECT_TRUE(recv_status.ok());
+}
+
 // Two pings and a final pong.
 TEST_P(AsyncEnd2endTest, SimpleClientStreaming) {
   ResetStub();
@@ -1890,6 +2013,9 @@
 }  // namespace grpc
 
 int main(int argc, char** argv) {
+  // Change the backup poll interval from 5s to 100ms to speed up the
+  // ReconnectChannel test
+  gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "100");
   grpc_test_init(argc, argv);
   gpr_tls_init(&g_is_async_end2end_test);
   ::testing::InitGoogleTest(&argc, argv);
diff --git a/test/cpp/end2end/client_crash_test.cc b/test/cpp/end2end/client_crash_test.cc
index 4d2304f..f34b275 100644
--- a/test/cpp/end2end/client_crash_test.cc
+++ b/test/cpp/end2end/client_crash_test.cc
@@ -56,7 +56,8 @@
     addr_stream << "localhost:" << port;
     auto addr = addr_stream.str();
     server_.reset(new SubProcess({
-        g_root + "/client_crash_test_server", "--address=" + addr,
+        g_root + "/client_crash_test_server",
+        "--address=" + addr,
     }));
     GPR_ASSERT(server_);
     return grpc::testing::EchoTestService::NewStub(
diff --git a/test/cpp/end2end/client_crash_test_server.cc b/test/cpp/end2end/client_crash_test_server.cc
index 01dcd40..887504d 100644
--- a/test/cpp/end2end/client_crash_test_server.cc
+++ b/test/cpp/end2end/client_crash_test_server.cc
@@ -68,8 +68,8 @@
   std::cout << "Server listening on " << FLAGS_address << std::endl;
   server->Wait();
 }
-}
-}
+}  // namespace testing
+}  // namespace grpc
 
 int main(int argc, char** argv) {
   ParseCommandLineFlags(&argc, &argv, true);
diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc
index c236f76..95630a7 100644
--- a/test/cpp/end2end/client_lb_end2end_test.cc
+++ b/test/cpp/end2end/client_lb_end2end_test.cc
@@ -33,10 +33,9 @@
 #include <grpc/support/thd.h>
 #include <grpc/support/time.h>
 
-extern "C" {
 #include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
 #include "src/core/ext/filters/client_channel/subchannel_index.h"
-}
+#include "src/core/lib/support/env.h"
 
 #include "src/proto/grpc/testing/echo.grpc.pb.h"
 #include "test/core/util/port.h"
@@ -86,7 +85,11 @@
 class ClientLbEnd2endTest : public ::testing::Test {
  protected:
   ClientLbEnd2endTest()
-      : server_host_("localhost"), kRequestMessage_("Live long and prosper.") {}
+      : server_host_("localhost"), kRequestMessage_("Live long and prosper.") {
+    // Make the backup poller poll very frequently in order to pick up
+    // updates from all the subchannels's FDs.
+    gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "1");
+  }
 
   void SetUp() override {
     response_generator_ = grpc_fake_resolver_response_generator_create();
@@ -305,7 +308,7 @@
   ports.clear();
   SetNextResolution(ports);
   gpr_log(GPR_INFO, "****** SET none *******");
-  grpc_connectivity_state channel_state = GRPC_CHANNEL_INIT;
+  grpc_connectivity_state channel_state;
   do {
     channel_state = channel_->GetState(true /* try to connect */);
   } while (channel_state == GRPC_CHANNEL_READY);
@@ -481,7 +484,7 @@
   // An empty update will result in the channel going into TRANSIENT_FAILURE.
   ports.clear();
   SetNextResolution(ports);
-  grpc_connectivity_state channel_state = GRPC_CHANNEL_INIT;
+  grpc_connectivity_state channel_state;
   do {
     channel_state = channel_->GetState(true /* try to connect */);
   } while (channel_state == GRPC_CHANNEL_READY);
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 1aa547d..82ca394 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -30,11 +30,13 @@
 #include <grpc++/server_builder.h>
 #include <grpc++/server_context.h>
 #include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
 #include <grpc/support/log.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/time.h>
 
 #include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/support/env.h"
 #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
 #include "src/proto/grpc/testing/echo.grpc.pb.h"
 #include "test/core/util/port.h"
@@ -704,13 +706,25 @@
   if (GetParam().inproc) {
     return;
   }
+  gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "200");
+  int poller_slowdown_factor = 1;
+  // It needs 2 pollset_works to reconnect the channel with polling engine
+  // "poll"
+  char* s = gpr_getenv("GRPC_POLL_STRATEGY");
+  if (s != NULL && 0 == strcmp(s, "poll")) {
+    poller_slowdown_factor = 2;
+  }
+  gpr_free(s);
   ResetStub();
   SendRpc(stub_.get(), 1, false);
   RestartServer(std::shared_ptr<AuthMetadataProcessor>());
-  // It needs more than kConnectivityCheckIntervalMsec time to reconnect the
-  // channel.
-  gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                               gpr_time_from_millis(1600, GPR_TIMESPAN)));
+  // It needs more than GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS time to
+  // reconnect the channel.
+  gpr_sleep_until(gpr_time_add(
+      gpr_now(GPR_CLOCK_REALTIME),
+      gpr_time_from_millis(
+          300 * poller_slowdown_factor * grpc_test_slowdown_factor(),
+          GPR_TIMESPAN)));
   SendRpc(stub_.get(), 1, false);
 }
 
diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc
index 9450182..40949e8 100644
--- a/test/cpp/end2end/generic_end2end_test.cc
+++ b/test/cpp/end2end/generic_end2end_test.cc
@@ -216,9 +216,10 @@
 
     std::unique_ptr<ByteBuffer> cli_send_buffer =
         SerializeToByteBuffer(&send_request);
+    // Use the same cq as server so that events can be polled in time.
     std::unique_ptr<GenericClientAsyncResponseReader> call =
         generic_stub_->PrepareUnaryCall(&cli_ctx, kMethodName,
-                                        *cli_send_buffer.get(), &cli_cq_);
+                                        *cli_send_buffer.get(), srv_cq_.get());
     call->StartCall();
     ByteBuffer cli_recv_buffer;
     call->Finish(&cli_recv_buffer, &recv_status, tag(1));
@@ -226,7 +227,7 @@
     generic_service_.RequestCall(&srv_ctx, &stream, srv_cq_.get(),
                                  srv_cq_.get(), tag(4));
 
-    verify_ok(srv_cq_.get(), 4, true);
+    server_ok(4);
     EXPECT_EQ(server_host_, srv_ctx.host().substr(0, server_host_.length()));
     EXPECT_EQ(kMethodName, srv_ctx.method());
 
@@ -245,7 +246,7 @@
     stream.Finish(Status::OK, tag(7));
     server_ok(7);
 
-    client_ok(1);
+    verify_ok(srv_cq_.get(), 1, true);
     EXPECT_TRUE(ParseFromByteBuffer(&cli_recv_buffer, &recv_response));
     EXPECT_EQ(send_response.message(), recv_response.message());
     EXPECT_TRUE(recv_status.ok());
@@ -321,8 +322,9 @@
 
 TEST_F(GenericEnd2endTest, Deadline) {
   ResetStub();
-  SendRpc(1, true, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
-                                gpr_time_from_seconds(10, GPR_TIMESPAN)));
+  SendRpc(1, true,
+          gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+                       gpr_time_from_seconds(10, GPR_TIMESPAN)));
 }
 
 }  // namespace
diff --git a/test/cpp/end2end/grpclb_end2end_test.cc b/test/cpp/end2end/grpclb_end2end_test.cc
index f73a9c1..c15ab88 100644
--- a/test/cpp/end2end/grpclb_end2end_test.cc
+++ b/test/cpp/end2end/grpclb_end2end_test.cc
@@ -33,10 +33,9 @@
 #include <grpc/support/thd.h>
 #include <grpc/support/time.h>
 
-extern "C" {
 #include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
 #include "src/core/lib/iomgr/sockaddr.h"
-}
+#include "src/core/lib/support/env.h"
 
 #include "test/core/util/port.h"
 #include "test/core/util/test_config.h"
@@ -332,8 +331,11 @@
         num_backends_(num_backends),
         num_balancers_(num_balancers),
         client_load_reporting_interval_seconds_(
-            client_load_reporting_interval_seconds),
-        kRequestMessage_("Live long and prosper.") {}
+            client_load_reporting_interval_seconds) {
+    // Make the backup poller poll very frequently in order to pick up
+    // updates from all the subchannels's FDs.
+    gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "1");
+  }
 
   void SetUp() override {
     response_generator_ = grpc_fake_resolver_response_generator_create();
@@ -559,7 +561,6 @@
     std::unique_ptr<std::thread> thread_;
   };
 
-  const grpc::string kMessage_ = "Live long and prosper.";
   const grpc::string server_host_;
   const size_t num_backends_;
   const size_t num_balancers_;
@@ -571,7 +572,7 @@
   std::vector<ServerThread<BackendService>> backend_servers_;
   std::vector<ServerThread<BalancerService>> balancer_servers_;
   grpc_fake_resolver_response_generator* response_generator_;
-  const grpc::string kRequestMessage_;
+  const grpc::string kRequestMessage_ = "Live long and prosper.";
 };
 
 class SingleBalancerTest : public GrpclbEnd2endTest {
@@ -658,8 +659,9 @@
 
   // Send non-empty serverlist only after kServerlistDelayMs.
   ScheduleResponseForBalancer(
-      0, BalancerServiceImpl::BuildResponseForBackends(
-             GetBackendPorts(kNumBackendInResolution /* start_index */), {}),
+      0,
+      BalancerServiceImpl::BuildResponseForBackends(
+          GetBackendPorts(kNumBackendInResolution /* start_index */), {}),
       kServerlistDelayMs);
 
   // Wait until all the fallback backends are reachable.
@@ -724,10 +726,11 @@
 
   // Send non-empty serverlist only after kServerlistDelayMs.
   ScheduleResponseForBalancer(
-      0, BalancerServiceImpl::BuildResponseForBackends(
-             GetBackendPorts(kNumBackendInResolution +
-                             kNumBackendInResolutionUpdate /* start_index */),
-             {}),
+      0,
+      BalancerServiceImpl::BuildResponseForBackends(
+          GetBackendPorts(kNumBackendInResolution +
+                          kNumBackendInResolutionUpdate /* start_index */),
+          {}),
       kServerlistDelayMs);
 
   // Wait until all the fallback backends are reachable.
@@ -1068,10 +1071,11 @@
                                     num_of_drop_by_load_balancing_addresses;
   const int num_total_addresses = num_backends_ + num_of_drop_addresses;
   ScheduleResponseForBalancer(
-      0, BalancerServiceImpl::BuildResponseForBackends(
-             GetBackendPorts(),
-             {{"rate_limiting", num_of_drop_by_rate_limiting_addresses},
-              {"load_balancing", num_of_drop_by_load_balancing_addresses}}),
+      0,
+      BalancerServiceImpl::BuildResponseForBackends(
+          GetBackendPorts(),
+          {{"rate_limiting", num_of_drop_by_rate_limiting_addresses},
+           {"load_balancing", num_of_drop_by_load_balancing_addresses}}),
       0);
   // Wait until all backends are ready.
   WaitForAllBackends();
@@ -1086,7 +1090,7 @@
     } else {
       EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
                                << " message=" << status.error_message();
-      EXPECT_EQ(response.message(), kMessage_);
+      EXPECT_EQ(response.message(), kRequestMessage_);
     }
   }
   EXPECT_EQ(kNumRpcsPerAddress * num_of_drop_addresses, num_drops);
@@ -1107,9 +1111,10 @@
   const int num_of_drop_by_rate_limiting_addresses = 1;
   const int num_of_drop_by_load_balancing_addresses = 1;
   ScheduleResponseForBalancer(
-      0, BalancerServiceImpl::BuildResponseForBackends(
-             {}, {{"rate_limiting", num_of_drop_by_rate_limiting_addresses},
-                  {"load_balancing", num_of_drop_by_load_balancing_addresses}}),
+      0,
+      BalancerServiceImpl::BuildResponseForBackends(
+          {}, {{"rate_limiting", num_of_drop_by_rate_limiting_addresses},
+               {"load_balancing", num_of_drop_by_load_balancing_addresses}}),
       0);
   const Status status = SendRpc();
   EXPECT_FALSE(status.ok());
@@ -1123,9 +1128,10 @@
   const int num_of_drop_by_rate_limiting_addresses = 1;
   const int num_of_drop_by_load_balancing_addresses = 1;
   ScheduleResponseForBalancer(
-      0, BalancerServiceImpl::BuildResponseForBackends(
-             {}, {{"rate_limiting", num_of_drop_by_rate_limiting_addresses},
-                  {"load_balancing", num_of_drop_by_load_balancing_addresses}}),
+      0,
+      BalancerServiceImpl::BuildResponseForBackends(
+          {}, {{"rate_limiting", num_of_drop_by_rate_limiting_addresses},
+               {"load_balancing", num_of_drop_by_load_balancing_addresses}}),
       1000);
 
   // First call succeeds.
@@ -1187,10 +1193,11 @@
                                     num_of_drop_by_load_balancing_addresses;
   const int num_total_addresses = num_backends_ + num_of_drop_addresses;
   ScheduleResponseForBalancer(
-      0, BalancerServiceImpl::BuildResponseForBackends(
-             GetBackendPorts(),
-             {{"rate_limiting", num_of_drop_by_rate_limiting_addresses},
-              {"load_balancing", num_of_drop_by_load_balancing_addresses}}),
+      0,
+      BalancerServiceImpl::BuildResponseForBackends(
+          GetBackendPorts(),
+          {{"rate_limiting", num_of_drop_by_rate_limiting_addresses},
+           {"load_balancing", num_of_drop_by_load_balancing_addresses}}),
       0);
   // Wait until all backends are ready.
   int num_warmup_ok = 0;
@@ -1210,7 +1217,7 @@
     } else {
       EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
                                << " message=" << status.error_message();
-      EXPECT_EQ(response.message(), kMessage_);
+      EXPECT_EQ(response.message(), kRequestMessage_);
     }
   }
   EXPECT_EQ(kNumRpcsPerAddress * num_of_drop_addresses, num_drops);
diff --git a/test/cpp/end2end/mock_test.cc b/test/cpp/end2end/mock_test.cc
index 0b63c25..61f4111 100644
--- a/test/cpp/end2end/mock_test.cc
+++ b/test/cpp/end2end/mock_test.cc
@@ -44,19 +44,19 @@
 #include <iostream>
 
 using namespace std;
+using ::testing::AtLeast;
+using ::testing::DoAll;
+using ::testing::Invoke;
+using ::testing::Return;
+using ::testing::SaveArg;
+using ::testing::SetArgPointee;
+using ::testing::WithArg;
+using ::testing::_;
 using grpc::testing::EchoRequest;
 using grpc::testing::EchoResponse;
 using grpc::testing::EchoTestService;
 using grpc::testing::MockClientReaderWriter;
 using std::chrono::system_clock;
-using ::testing::AtLeast;
-using ::testing::SetArgPointee;
-using ::testing::SaveArg;
-using ::testing::_;
-using ::testing::Return;
-using ::testing::Invoke;
-using ::testing::WithArg;
-using ::testing::DoAll;
 
 namespace grpc {
 namespace testing {
diff --git a/test/cpp/end2end/thread_stress_test.cc b/test/cpp/end2end/thread_stress_test.cc
index f990a7e..90b2edd 100644
--- a/test/cpp/end2end/thread_stress_test.cc
+++ b/test/cpp/end2end/thread_stress_test.cc
@@ -50,23 +50,6 @@
 namespace grpc {
 namespace testing {
 
-namespace {
-
-// When echo_deadline is requested, deadline seen in the ServerContext is set in
-// the response in seconds.
-void MaybeEchoDeadline(ServerContext* context, const EchoRequest* request,
-                       EchoResponse* response) {
-  if (request->has_param() && request->param().echo_deadline()) {
-    gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_REALTIME);
-    if (context->deadline() != system_clock::time_point::max()) {
-      Timepoint2Timespec(context->deadline(), &deadline);
-    }
-    response->mutable_param()->set_request_deadline(deadline.tv_sec);
-  }
-}
-
-}  // namespace
-
 class TestServiceImpl : public ::grpc::testing::EchoTestService::Service {
  public:
   TestServiceImpl() : signal_client_(false) {}
@@ -74,29 +57,6 @@
   Status Echo(ServerContext* context, const EchoRequest* request,
               EchoResponse* response) override {
     response->set_message(request->message());
-    MaybeEchoDeadline(context, request, response);
-    if (request->has_param() && request->param().client_cancel_after_us()) {
-      {
-        std::unique_lock<std::mutex> lock(mu_);
-        signal_client_ = true;
-      }
-      while (!context->IsCancelled()) {
-        gpr_sleep_until(gpr_time_add(
-            gpr_now(GPR_CLOCK_REALTIME),
-            gpr_time_from_micros(request->param().client_cancel_after_us(),
-                                 GPR_TIMESPAN)));
-      }
-      return Status::CANCELLED;
-    } else if (request->has_param() &&
-               request->param().server_cancel_after_us()) {
-      gpr_sleep_until(gpr_time_add(
-          gpr_now(GPR_CLOCK_REALTIME),
-          gpr_time_from_micros(request->param().server_cancel_after_us(),
-                               GPR_TIMESPAN)));
-      return Status::CANCELLED;
-    } else {
-      EXPECT_FALSE(context->IsCancelled());
-    }
     return Status::OK;
   }
 
diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc
index e740ea5..a764734 100644
--- a/test/cpp/grpclb/grpclb_test.cc
+++ b/test/cpp/grpclb/grpclb_test.cc
@@ -35,13 +35,14 @@
 #include <grpc/support/time.h>
 
 #include <grpc++/impl/codegen/config.h>
-extern "C" {
+
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/channel/channel_stack.h"
 #include "src/core/lib/iomgr/sockaddr.h"
 #include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/core/lib/support/env.h"
 #include "src/core/lib/support/string.h"
 #include "src/core/lib/support/tmpfile.h"
 #include "src/core/lib/surface/channel.h"
@@ -49,7 +50,6 @@
 #include "test/core/end2end/cq_verifier.h"
 #include "test/core/util/port.h"
 #include "test/core/util/test_config.h"
-}
 
 #include "src/proto/grpc/lb/v1/load_balancer.pb.h"
 
@@ -87,19 +87,19 @@
 namespace {
 
 typedef struct client_fixture {
-  grpc_channel *client;
-  char *server_uri;
-  grpc_completion_queue *cq;
+  grpc_channel* client;
+  char* server_uri;
+  grpc_completion_queue* cq;
 } client_fixture;
 
 typedef struct server_fixture {
-  grpc_server *server;
-  grpc_call *server_call;
-  grpc_completion_queue *cq;
-  char *servers_hostport;
-  const char *balancer_name;
+  grpc_server* server;
+  grpc_call* server_call;
+  grpc_completion_queue* cq;
+  char* servers_hostport;
+  const char* balancer_name;
   int port;
-  const char *lb_token_prefix;
+  const char* lb_token_prefix;
   gpr_thd_id tid;
   int num_calls_serviced;
 } server_fixture;
@@ -111,12 +111,12 @@
   int lb_server_update_delay_ms;
 } test_fixture;
 
-static void *tag(intptr_t t) { return (void *)t; }
+static void* tag(intptr_t t) { return (void*)t; }
 
 static grpc_slice build_response_payload_slice(
-    const char *host, int *ports, size_t nports,
+    const char* host, int* ports, size_t nports,
     int64_t expiration_interval_secs, int32_t expiration_interval_nanos,
-    const char *token_prefix) {
+    const char* token_prefix) {
   // server_list {
   //   servers {
   //     ip_address: <in_addr/6 bytes of an IP>
@@ -126,10 +126,10 @@
   //   ...
   // }
   grpc::lb::v1::LoadBalanceResponse response;
-  auto *serverlist = response.mutable_server_list();
+  auto* serverlist = response.mutable_server_list();
 
   if (expiration_interval_secs > 0 || expiration_interval_nanos > 0) {
-    auto *expiration_interval = serverlist->mutable_expiration_interval();
+    auto* expiration_interval = serverlist->mutable_expiration_interval();
     if (expiration_interval_secs > 0) {
       expiration_interval->set_seconds(expiration_interval_secs);
     }
@@ -138,12 +138,12 @@
     }
   }
   for (size_t i = 0; i < nports; i++) {
-    auto *server = serverlist->add_servers();
+    auto* server = serverlist->add_servers();
     // TODO(dgq): test ipv6
     struct in_addr ip4;
     GPR_ASSERT(inet_pton(AF_INET, host, &ip4) == 1);
     server->set_ip_address(
-        string(reinterpret_cast<const char *>(&ip4), sizeof(ip4)));
+        string(reinterpret_cast<const char*>(&ip4), sizeof(ip4)));
     server->set_port(ports[i]);
     // Missing tokens are acceptable. Test that path.
     if (strlen(token_prefix) > 0) {
@@ -151,11 +151,11 @@
       server->set_load_balance_token(token_data);
     }
   }
-  const string &enc_resp = response.SerializeAsString();
+  const string& enc_resp = response.SerializeAsString();
   return grpc_slice_from_copied_buffer(enc_resp.data(), enc_resp.size());
 }
 
-static void drain_cq(grpc_completion_queue *cq) {
+static void drain_cq(grpc_completion_queue* cq) {
   grpc_event ev;
   do {
     ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5),
@@ -168,18 +168,18 @@
                                gpr_time_from_millis(delay_ms, GPR_TIMESPAN)));
 }
 
-static void start_lb_server(server_fixture *sf, int *ports, size_t nports,
+static void start_lb_server(server_fixture* sf, int* ports, size_t nports,
                             int update_delay_ms) {
-  grpc_call *s;
-  cq_verifier *cqv = cq_verifier_create(sf->cq);
+  grpc_call* s;
+  cq_verifier* cqv = cq_verifier_create(sf->cq);
   grpc_op ops[6];
-  grpc_op *op;
+  grpc_op* op;
   grpc_metadata_array request_metadata_recv;
   grpc_call_details call_details;
   grpc_call_error error;
   int was_cancelled = 2;
-  grpc_byte_buffer *request_payload_recv;
-  grpc_byte_buffer *response_payload;
+  grpc_byte_buffer* request_payload_recv;
+  grpc_byte_buffer* response_payload;
 
   memset(ops, 0, sizeof(ops));
   grpc_metadata_array_init(&request_metadata_recv);
@@ -303,17 +303,17 @@
   grpc_call_details_destroy(&call_details);
 }
 
-static void start_backend_server(server_fixture *sf) {
-  grpc_call *s;
-  cq_verifier *cqv;
+static void start_backend_server(server_fixture* sf) {
+  grpc_call* s;
+  cq_verifier* cqv;
   grpc_op ops[6];
-  grpc_op *op;
+  grpc_op* op;
   grpc_metadata_array request_metadata_recv;
   grpc_call_details call_details;
   grpc_call_error error;
   int was_cancelled;
-  grpc_byte_buffer *request_payload_recv;
-  grpc_byte_buffer *response_payload;
+  grpc_byte_buffer* request_payload_recv;
+  grpc_byte_buffer* response_payload;
   grpc_event ev;
 
   while (true) {
@@ -339,8 +339,9 @@
     }
     GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
     const string expected_token =
-        strlen(sf->lb_token_prefix) == 0 ? "" : sf->lb_token_prefix +
-                                                    std::to_string(sf->port);
+        strlen(sf->lb_token_prefix) == 0
+            ? ""
+            : sf->lb_token_prefix + std::to_string(sf->port);
     GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token",
                                  expected_token.c_str()));
 
@@ -449,18 +450,18 @@
   }
 }
 
-static void perform_request(client_fixture *cf) {
-  grpc_call *c;
-  cq_verifier *cqv = cq_verifier_create(cf->cq);
+static void perform_request(client_fixture* cf) {
+  grpc_call* c;
+  cq_verifier* cqv = cq_verifier_create(cf->cq);
   grpc_op ops[6];
-  grpc_op *op;
+  grpc_op* op;
   grpc_metadata_array initial_metadata_recv;
   grpc_metadata_array trailing_metadata_recv;
   grpc_status_code status;
   grpc_call_error error;
   grpc_slice details;
-  grpc_byte_buffer *request_payload;
-  grpc_byte_buffer *response_payload_recv;
+  grpc_byte_buffer* request_payload;
+  grpc_byte_buffer* response_payload_recv;
   int i;
 
   memset(ops, 0, sizeof(ops));
@@ -474,7 +475,7 @@
                                NULL);
   gpr_log(GPR_INFO, "Call 0x%" PRIxPTR " created", (intptr_t)c);
   GPR_ASSERT(c);
-  char *peer;
+  char* peer;
 
   grpc_metadata_array_init(&initial_metadata_recv);
   grpc_metadata_array_init(&trailing_metadata_recv);
@@ -555,21 +556,21 @@
 }
 
 #define BALANCERS_NAME "lb.name"
-static void setup_client(const server_fixture *lb_server,
-                         const server_fixture *backends, client_fixture *cf) {
+static void setup_client(const server_fixture* lb_server,
+                         const server_fixture* backends, client_fixture* cf) {
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
 
-  char *expected_target_names = NULL;
-  const char *backends_name = lb_server->servers_hostport;
+  char* expected_target_names = NULL;
+  const char* backends_name = lb_server->servers_hostport;
   gpr_asprintf(&expected_target_names, "%s;%s", backends_name, BALANCERS_NAME);
 
-  grpc_fake_resolver_response_generator *response_generator =
+  grpc_fake_resolver_response_generator* response_generator =
       grpc_fake_resolver_response_generator_create();
 
-  grpc_lb_addresses *addresses = grpc_lb_addresses_create(1, NULL);
-  char *lb_uri_str;
+  grpc_lb_addresses* addresses = grpc_lb_addresses_create(1, NULL);
+  char* lb_uri_str;
   gpr_asprintf(&lb_uri_str, "ipv4:%s", lb_server->servers_hostport);
-  grpc_uri *lb_uri = grpc_uri_parse(&exec_ctx, lb_uri_str, true);
+  grpc_uri* lb_uri = grpc_uri_parse(&exec_ctx, lb_uri_str, true);
   GPR_ASSERT(lb_uri != NULL);
   grpc_lb_addresses_set_address_from_uri(addresses, 0, lb_uri, true,
                                          lb_server->balancer_name, NULL);
@@ -579,7 +580,7 @@
   gpr_asprintf(&cf->server_uri, "fake:///%s", lb_server->servers_hostport);
   const grpc_arg fake_addresses =
       grpc_lb_addresses_create_channel_arg(addresses);
-  grpc_channel_args *fake_result =
+  grpc_channel_args* fake_result =
       grpc_channel_args_copy_and_add(NULL, &fake_addresses, 1);
   grpc_lb_addresses_destroy(&exec_ctx, addresses);
 
@@ -587,12 +588,12 @@
       grpc_fake_transport_expected_targets_arg(expected_target_names),
       grpc_fake_resolver_response_generator_arg(response_generator)};
 
-  grpc_channel_args *args =
+  grpc_channel_args* args =
       grpc_channel_args_copy_and_add(NULL, new_args, GPR_ARRAY_SIZE(new_args));
   gpr_free(expected_target_names);
 
   cf->cq = grpc_completion_queue_create_for_next(NULL);
-  grpc_channel_credentials *fake_creds =
+  grpc_channel_credentials* fake_creds =
       grpc_fake_transport_security_credentials_create();
   cf->client =
       grpc_secure_channel_create(fake_creds, cf->server_uri, args, NULL);
@@ -605,7 +606,7 @@
   grpc_exec_ctx_finish(&exec_ctx);
 }
 
-static void teardown_client(client_fixture *cf) {
+static void teardown_client(client_fixture* cf) {
   grpc_completion_queue_shutdown(cf->cq);
   drain_cq(cf->cq);
   grpc_completion_queue_destroy(cf->cq);
@@ -615,13 +616,13 @@
   gpr_free(cf->server_uri);
 }
 
-static void setup_server(const char *host, server_fixture *sf) {
+static void setup_server(const char* host, server_fixture* sf) {
   int assigned_port;
 
   sf->cq = grpc_completion_queue_create_for_next(NULL);
-  const char *colon_idx = strchr(host, ':');
+  const char* colon_idx = strchr(host, ':');
   if (colon_idx) {
-    const char *port_str = colon_idx + 1;
+    const char* port_str = colon_idx + 1;
     sf->port = atoi(port_str);
     sf->servers_hostport = gpr_strdup(host);
   } else {
@@ -629,7 +630,7 @@
     gpr_join_host_port(&sf->servers_hostport, host, sf->port);
   }
 
-  grpc_server_credentials *server_creds =
+  grpc_server_credentials* server_creds =
       grpc_fake_transport_security_server_credentials_create();
 
   sf->server = grpc_server_create(NULL, NULL);
@@ -641,12 +642,12 @@
   grpc_server_start(sf->server);
 }
 
-static void teardown_server(server_fixture *sf) {
+static void teardown_server(server_fixture* sf) {
   if (!sf->server) return;
 
   gpr_log(GPR_INFO, "Server[%s] shutting down", sf->servers_hostport);
 
-  grpc_completion_queue *shutdown_cq =
+  grpc_completion_queue* shutdown_cq =
       grpc_completion_queue_create_for_pluck(NULL);
   grpc_server_shutdown_and_notify(sf->server, shutdown_cq, tag(1000));
   GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000),
@@ -666,13 +667,13 @@
   gpr_free(sf->servers_hostport);
 }
 
-static void fork_backend_server(void *arg) {
-  server_fixture *sf = static_cast<server_fixture *>(arg);
+static void fork_backend_server(void* arg) {
+  server_fixture* sf = static_cast<server_fixture*>(arg);
   start_backend_server(sf);
 }
 
-static void fork_lb_server(void *arg) {
-  test_fixture *tf = static_cast<test_fixture *>(arg);
+static void fork_lb_server(void* arg) {
+  test_fixture* tf = static_cast<test_fixture*>(arg);
   int ports[NUM_BACKENDS];
   for (int i = 0; i < NUM_BACKENDS; i++) {
     ports[i] = tf->lb_backends[i].port;
@@ -710,7 +711,7 @@
   return tf;
 }
 
-static void teardown_test_fixture(test_fixture *tf) {
+static void teardown_test_fixture(test_fixture* tf) {
   teardown_client(&tf->client);
   for (int i = 0; i < NUM_BACKENDS; ++i) {
     teardown_server(&tf->lb_backends[i]);
@@ -787,9 +788,12 @@
 }  // namespace
 }  // namespace grpc
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
   ::testing::InitGoogleTest(&argc, argv);
   grpc_test_init(argc, argv);
+  // Make the backup poller poll very frequently in order to pick up
+  // updates from all the subchannels's FDs.
+  gpr_setenv("GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS", "1");
   grpc_init();
   const auto result = RUN_ALL_TESTS();
   grpc_shutdown();
diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc
index 4149724..a24cdc7 100644
--- a/test/cpp/interop/interop_server.cc
+++ b/test/cpp/interop/interop_server.cc
@@ -51,8 +51,9 @@
 using grpc::ServerReader;
 using grpc::ServerReaderWriter;
 using grpc::ServerWriter;
-using grpc::WriteOptions;
 using grpc::SslServerCredentialsOptions;
+using grpc::Status;
+using grpc::WriteOptions;
 using grpc::testing::InteropServerContextInspector;
 using grpc::testing::Payload;
 using grpc::testing::SimpleRequest;
@@ -62,7 +63,6 @@
 using grpc::testing::StreamingOutputCallRequest;
 using grpc::testing::StreamingOutputCallResponse;
 using grpc::testing::TestService;
-using grpc::Status;
 
 const char kEchoInitialMetadataKey[] = "x-grpc-test-echo-initial";
 const char kEchoTrailingBinMetadataKey[] = "x-grpc-test-echo-trailing-bin";
diff --git a/test/cpp/interop/interop_test.cc b/test/cpp/interop/interop_test.cc
index c18fe1e..1bf0d8d 100644
--- a/test/cpp/interop/interop_test.cc
+++ b/test/cpp/interop/interop_test.cc
@@ -37,10 +37,8 @@
 #include "test/core/util/port.h"
 #include "test/cpp/util/test_config.h"
 
-extern "C" {
 #include "src/core/lib/iomgr/socket_utils_posix.h"
 #include "src/core/lib/support/string.h"
-}
 
 DEFINE_string(extra_server_flags, "", "Extra flags to pass to server.");
 
diff --git a/test/cpp/interop/reconnect_interop_server.cc b/test/cpp/interop/reconnect_interop_server.cc
index 50af8fc..5e257e1 100644
--- a/test/cpp/interop/reconnect_interop_server.cc
+++ b/test/cpp/interop/reconnect_interop_server.cc
@@ -53,9 +53,9 @@
 using grpc::SslServerCredentialsOptions;
 using grpc::Status;
 using grpc::testing::Empty;
-using grpc::testing::ReconnectService;
 using grpc::testing::ReconnectInfo;
 using grpc::testing::ReconnectParams;
+using grpc::testing::ReconnectService;
 
 static bool got_sigint = false;
 
diff --git a/test/cpp/interop/stress_test.cc b/test/cpp/interop/stress_test.cc
index c6d3600..991fc88 100644
--- a/test/cpp/interop/stress_test.cc
+++ b/test/cpp/interop/stress_test.cc
@@ -106,13 +106,13 @@
 DEFINE_string(server_host_override, "foo.test.google.fr",
               "Override the server host which is sent in HTTP header");
 
-using grpc::testing::kTestCaseList;
 using grpc::testing::MetricsService;
 using grpc::testing::MetricsServiceImpl;
 using grpc::testing::StressTestInteropClient;
 using grpc::testing::TestCaseType;
 using grpc::testing::UNKNOWN_TEST;
 using grpc::testing::WeightedRandomTestSelector;
+using grpc::testing::kTestCaseList;
 
 static int log_level = GPR_LOG_SEVERITY_DEBUG;
 
diff --git a/test/cpp/microbenchmarks/bm_arena.cc b/test/cpp/microbenchmarks/bm_arena.cc
index 165b746..5b7c611 100644
--- a/test/cpp/microbenchmarks/bm_arena.cc
+++ b/test/cpp/microbenchmarks/bm_arena.cc
@@ -18,9 +18,7 @@
 
 /* Benchmark arenas */
 
-extern "C" {
 #include "src/core/lib/support/arena.h"
-}
 #include "test/cpp/microbenchmarks/helpers.h"
 #include "third_party/benchmark/include/benchmark/benchmark.h"
 
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc
index cf9a42e..ec5c127 100644
--- a/test/cpp/microbenchmarks/bm_call_create.cc
+++ b/test/cpp/microbenchmarks/bm_call_create.cc
@@ -29,7 +29,6 @@
 #include <grpc/support/alloc.h>
 #include <grpc/support/string_util.h>
 
-extern "C" {
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/deadline/deadline_filter.h"
 #include "src/core/ext/filters/http/client/http_client_filter.h"
@@ -43,15 +42,14 @@
 #include "src/core/lib/profiling/timers.h"
 #include "src/core/lib/surface/channel.h"
 #include "src/core/lib/transport/transport_impl.h"
-}
 
 #include "src/cpp/client/create_channel_internal.h"
 #include "src/proto/grpc/testing/echo.grpc.pb.h"
 #include "test/cpp/microbenchmarks/helpers.h"
 
-auto &force_library_initialization = Library::get();
+auto& force_library_initialization = Library::get();
 
-void BM_Zalloc(benchmark::State &state) {
+void BM_Zalloc(benchmark::State& state) {
   // speed of light for call creation is zalloc, so benchmark a few interesting
   // sizes
   TrackCounters track_counters;
@@ -80,13 +78,13 @@
 
 class BaseChannelFixture {
  public:
-  BaseChannelFixture(grpc_channel *channel) : channel_(channel) {}
+  BaseChannelFixture(grpc_channel* channel) : channel_(channel) {}
   ~BaseChannelFixture() { grpc_channel_destroy(channel_); }
 
-  grpc_channel *channel() const { return channel_; }
+  grpc_channel* channel() const { return channel_; }
 
  private:
-  grpc_channel *const channel_;
+  grpc_channel* const channel_;
 };
 
 class InsecureChannel : public BaseChannelFixture {
@@ -104,12 +102,12 @@
 };
 
 template <class Fixture>
-static void BM_CallCreateDestroy(benchmark::State &state) {
+static void BM_CallCreateDestroy(benchmark::State& state) {
   TrackCounters track_counters;
   Fixture fixture;
-  grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
+  grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL);
   gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
-  void *method_hdl =
+  void* method_hdl =
       grpc_channel_register_call(fixture.channel(), "/foo/bar", NULL, NULL);
   while (state.KeepRunning()) {
     grpc_call_unref(grpc_channel_create_registered_call(
@@ -126,11 +124,11 @@
 ////////////////////////////////////////////////////////////////////////////////
 // Benchmarks isolating individual filters
 
-static void *tag(int i) {
-  return reinterpret_cast<void *>(static_cast<intptr_t>(i));
+static void* tag(int i) {
+  return reinterpret_cast<void*>(static_cast<intptr_t>(i));
 }
 
-static void BM_LameChannelCallCreateCpp(benchmark::State &state) {
+static void BM_LameChannelCallCreateCpp(benchmark::State& state) {
   TrackCounters track_counters;
   auto stub =
       grpc::testing::EchoTestService::NewStub(grpc::CreateChannelInternal(
@@ -145,7 +143,7 @@
     grpc::ClientContext cli_ctx;
     auto reader = stub->AsyncEcho(&cli_ctx, send_request, &cq);
     reader->Finish(&recv_response, &recv_status, tag(0));
-    void *t;
+    void* t;
     bool ok;
     GPR_ASSERT(cq.Next(&t, &ok));
     GPR_ASSERT(ok);
@@ -154,16 +152,16 @@
 }
 BENCHMARK(BM_LameChannelCallCreateCpp);
 
-static void do_nothing(void *ignored) {}
+static void do_nothing(void* ignored) {}
 
-static void BM_LameChannelCallCreateCore(benchmark::State &state) {
+static void BM_LameChannelCallCreateCore(benchmark::State& state) {
   TrackCounters track_counters;
 
-  grpc_channel *channel;
-  grpc_completion_queue *cq;
+  grpc_channel* channel;
+  grpc_completion_queue* cq;
   grpc_metadata_array initial_metadata_recv;
   grpc_metadata_array trailing_metadata_recv;
-  grpc_byte_buffer *response_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
   grpc_status_code status;
   grpc_slice details;
   grpc::testing::EchoRequest send_request;
@@ -173,22 +171,22 @@
   channel = grpc_lame_client_channel_create(
       "localhost:1234", GRPC_STATUS_UNAUTHENTICATED, "blah");
   cq = grpc_completion_queue_create_for_next(NULL);
-  void *rc = grpc_channel_register_call(
+  void* rc = grpc_channel_register_call(
       channel, "/grpc.testing.EchoTestService/Echo", NULL, NULL);
   while (state.KeepRunning()) {
     GPR_TIMER_SCOPE("BenchmarkCycle", 0);
-    grpc_call *call = grpc_channel_create_registered_call(
+    grpc_call* call = grpc_channel_create_registered_call(
         channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq, rc,
         gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
     grpc_metadata_array_init(&initial_metadata_recv);
     grpc_metadata_array_init(&trailing_metadata_recv);
-    grpc_byte_buffer *request_payload_send =
+    grpc_byte_buffer* request_payload_send =
         grpc_raw_byte_buffer_create(&send_request_slice, 1);
 
     // Fill in call ops
     grpc_op ops[6];
     memset(ops, 0, sizeof(ops));
-    grpc_op *op = ops;
+    grpc_op* op = ops;
     op->op = GRPC_OP_SEND_INITIAL_METADATA;
     op->data.send_initial_metadata.count = 0;
     op++;
@@ -212,7 +210,7 @@
 
     GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops,
                                                      (size_t)(op - ops),
-                                                     (void *)1, NULL));
+                                                     (void*)1, NULL));
     grpc_event ev = grpc_completion_queue_next(
         cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
     GPR_ASSERT(ev.type != GRPC_QUEUE_SHUTDOWN);
@@ -230,14 +228,14 @@
 }
 BENCHMARK(BM_LameChannelCallCreateCore);
 
-static void BM_LameChannelCallCreateCoreSeparateBatch(benchmark::State &state) {
+static void BM_LameChannelCallCreateCoreSeparateBatch(benchmark::State& state) {
   TrackCounters track_counters;
 
-  grpc_channel *channel;
-  grpc_completion_queue *cq;
+  grpc_channel* channel;
+  grpc_completion_queue* cq;
   grpc_metadata_array initial_metadata_recv;
   grpc_metadata_array trailing_metadata_recv;
-  grpc_byte_buffer *response_payload_recv = NULL;
+  grpc_byte_buffer* response_payload_recv = NULL;
   grpc_status_code status;
   grpc_slice details;
   grpc::testing::EchoRequest send_request;
@@ -247,22 +245,22 @@
   channel = grpc_lame_client_channel_create(
       "localhost:1234", GRPC_STATUS_UNAUTHENTICATED, "blah");
   cq = grpc_completion_queue_create_for_next(NULL);
-  void *rc = grpc_channel_register_call(
+  void* rc = grpc_channel_register_call(
       channel, "/grpc.testing.EchoTestService/Echo", NULL, NULL);
   while (state.KeepRunning()) {
     GPR_TIMER_SCOPE("BenchmarkCycle", 0);
-    grpc_call *call = grpc_channel_create_registered_call(
+    grpc_call* call = grpc_channel_create_registered_call(
         channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq, rc,
         gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
     grpc_metadata_array_init(&initial_metadata_recv);
     grpc_metadata_array_init(&trailing_metadata_recv);
-    grpc_byte_buffer *request_payload_send =
+    grpc_byte_buffer* request_payload_send =
         grpc_raw_byte_buffer_create(&send_request_slice, 1);
 
     // Fill in call ops
     grpc_op ops[3];
     memset(ops, 0, sizeof(ops));
-    grpc_op *op = ops;
+    grpc_op* op = ops;
     op->op = GRPC_OP_SEND_INITIAL_METADATA;
     op->data.send_initial_metadata.count = 0;
     op++;
@@ -273,7 +271,7 @@
     op++;
     GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops,
                                                      (size_t)(op - ops),
-                                                     (void *)0, NULL));
+                                                     (void*)0, NULL));
     memset(ops, 0, sizeof(ops));
     op = ops;
     op->op = GRPC_OP_RECV_INITIAL_METADATA;
@@ -291,7 +289,7 @@
 
     GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops,
                                                      (size_t)(op - ops),
-                                                     (void *)1, NULL));
+                                                     (void*)1, NULL));
     grpc_event ev = grpc_completion_queue_next(
         cq, gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
     GPR_ASSERT(ev.type != GRPC_QUEUE_SHUTDOWN);
@@ -313,31 +311,31 @@
 }
 BENCHMARK(BM_LameChannelCallCreateCoreSeparateBatch);
 
-static void FilterDestroy(grpc_exec_ctx *exec_ctx, void *arg,
-                          grpc_error *error) {
+static void FilterDestroy(grpc_exec_ctx* exec_ctx, void* arg,
+                          grpc_error* error) {
   gpr_free(arg);
 }
 
-static void DoNothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
+static void DoNothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
 
 class FakeClientChannelFactory : public grpc_client_channel_factory {
  public:
   FakeClientChannelFactory() { vtable = &vtable_; }
 
  private:
-  static void NoRef(grpc_client_channel_factory *factory) {}
-  static void NoUnref(grpc_exec_ctx *exec_ctx,
-                      grpc_client_channel_factory *factory) {}
-  static grpc_subchannel *CreateSubchannel(grpc_exec_ctx *exec_ctx,
-                                           grpc_client_channel_factory *factory,
-                                           const grpc_subchannel_args *args) {
+  static void NoRef(grpc_client_channel_factory* factory) {}
+  static void NoUnref(grpc_exec_ctx* exec_ctx,
+                      grpc_client_channel_factory* factory) {}
+  static grpc_subchannel* CreateSubchannel(grpc_exec_ctx* exec_ctx,
+                                           grpc_client_channel_factory* factory,
+                                           const grpc_subchannel_args* args) {
     return nullptr;
   }
-  static grpc_channel *CreateClientChannel(grpc_exec_ctx *exec_ctx,
-                                           grpc_client_channel_factory *factory,
-                                           const char *target,
+  static grpc_channel* CreateClientChannel(grpc_exec_ctx* exec_ctx,
+                                           grpc_client_channel_factory* factory,
+                                           const char* target,
                                            grpc_client_channel_type type,
-                                           const grpc_channel_args *args) {
+                                           const grpc_channel_args* args) {
     return nullptr;
   }
 
@@ -347,11 +345,11 @@
 const grpc_client_channel_factory_vtable FakeClientChannelFactory::vtable_ = {
     NoRef, NoUnref, CreateSubchannel, CreateClientChannel};
 
-static grpc_arg StringArg(const char *key, const char *value) {
+static grpc_arg StringArg(const char* key, const char* value) {
   grpc_arg a;
   a.type = GRPC_ARG_STRING;
-  a.key = const_cast<char *>(key);
-  a.value.string = const_cast<char *>(value);
+  a.key = const_cast<char*>(key);
+  a.value.string = const_cast<char*>(value);
   return a;
 }
 
@@ -360,45 +358,45 @@
   REQUIRES_TRANSPORT = 2,
 };
 
-template <const grpc_channel_filter *kFilter, uint32_t kFlags>
+template <const grpc_channel_filter* kFilter, uint32_t kFlags>
 struct Fixture {
-  const grpc_channel_filter *filter = kFilter;
+  const grpc_channel_filter* filter = kFilter;
   const uint32_t flags = kFlags;
 };
 
 namespace dummy_filter {
 
-static void StartTransportStreamOp(grpc_exec_ctx *exec_ctx,
-                                   grpc_call_element *elem,
-                                   grpc_transport_stream_op_batch *op) {}
+static void StartTransportStreamOp(grpc_exec_ctx* exec_ctx,
+                                   grpc_call_element* elem,
+                                   grpc_transport_stream_op_batch* op) {}
 
-static void StartTransportOp(grpc_exec_ctx *exec_ctx,
-                             grpc_channel_element *elem,
-                             grpc_transport_op *op) {}
+static void StartTransportOp(grpc_exec_ctx* exec_ctx,
+                             grpc_channel_element* elem,
+                             grpc_transport_op* op) {}
 
-static grpc_error *InitCallElem(grpc_exec_ctx *exec_ctx,
-                                grpc_call_element *elem,
-                                const grpc_call_element_args *args) {
+static grpc_error* InitCallElem(grpc_exec_ctx* exec_ctx,
+                                grpc_call_element* elem,
+                                const grpc_call_element_args* args) {
   return GRPC_ERROR_NONE;
 }
 
-static void SetPollsetOrPollsetSet(grpc_exec_ctx *exec_ctx,
-                                   grpc_call_element *elem,
-                                   grpc_polling_entity *pollent) {}
+static void SetPollsetOrPollsetSet(grpc_exec_ctx* exec_ctx,
+                                   grpc_call_element* elem,
+                                   grpc_polling_entity* pollent) {}
 
-static void DestroyCallElem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                            const grpc_call_final_info *final_info,
-                            grpc_closure *then_sched_closure) {}
+static void DestroyCallElem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                            const grpc_call_final_info* final_info,
+                            grpc_closure* then_sched_closure) {}
 
-grpc_error *InitChannelElem(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                            grpc_channel_element_args *args) {
+grpc_error* InitChannelElem(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                            grpc_channel_element_args* args) {
   return GRPC_ERROR_NONE;
 }
 
-void DestroyChannelElem(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) {}
+void DestroyChannelElem(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem) {}
 
-void GetChannelInfo(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                    const grpc_channel_info *channel_info) {}
+void GetChannelInfo(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                    const grpc_channel_info* channel_info) {}
 
 static const grpc_channel_filter dummy_filter = {StartTransportStreamOp,
                                                  StartTransportOp,
@@ -421,42 +419,42 @@
 size_t sizeof_stream; /* = sizeof(transport stream) */
 
 /* name of this transport implementation */
-const char *name;
+const char* name;
 
 /* implementation of grpc_transport_init_stream */
-int InitStream(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-               grpc_stream *stream, grpc_stream_refcount *refcount,
-               const void *server_data, gpr_arena *arena) {
+int InitStream(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+               grpc_stream* stream, grpc_stream_refcount* refcount,
+               const void* server_data, gpr_arena* arena) {
   return 0;
 }
 
 /* implementation of grpc_transport_set_pollset */
-void SetPollset(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                grpc_stream *stream, grpc_pollset *pollset) {}
+void SetPollset(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                grpc_stream* stream, grpc_pollset* pollset) {}
 
 /* implementation of grpc_transport_set_pollset */
-void SetPollsetSet(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                   grpc_stream *stream, grpc_pollset_set *pollset_set) {}
+void SetPollsetSet(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                   grpc_stream* stream, grpc_pollset_set* pollset_set) {}
 
 /* implementation of grpc_transport_perform_stream_op */
-void PerformStreamOp(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                     grpc_stream *stream, grpc_transport_stream_op_batch *op) {
+void PerformStreamOp(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                     grpc_stream* stream, grpc_transport_stream_op_batch* op) {
   GRPC_CLOSURE_SCHED(exec_ctx, op->on_complete, GRPC_ERROR_NONE);
 }
 
 /* implementation of grpc_transport_perform_op */
-void PerformOp(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-               grpc_transport_op *op) {}
+void PerformOp(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+               grpc_transport_op* op) {}
 
 /* implementation of grpc_transport_destroy_stream */
-void DestroyStream(grpc_exec_ctx *exec_ctx, grpc_transport *self,
-                   grpc_stream *stream, grpc_closure *then_sched_closure) {}
+void DestroyStream(grpc_exec_ctx* exec_ctx, grpc_transport* self,
+                   grpc_stream* stream, grpc_closure* then_sched_closure) {}
 
 /* implementation of grpc_transport_destroy */
-void Destroy(grpc_exec_ctx *exec_ctx, grpc_transport *self) {}
+void Destroy(grpc_exec_ctx* exec_ctx, grpc_transport* self) {}
 
 /* implementation of grpc_transport_get_endpoint */
-grpc_endpoint *GetEndpoint(grpc_exec_ctx *exec_ctx, grpc_transport *self) {
+grpc_endpoint* GetEndpoint(grpc_exec_ctx* exec_ctx, grpc_transport* self) {
   return nullptr;
 }
 
@@ -474,8 +472,8 @@
  public:
   class Op {
    public:
-    Op(grpc_exec_ctx *exec_ctx, NoOp *p, grpc_call_stack *s) {}
-    void Finish(grpc_exec_ctx *exec_ctx) {}
+    Op(grpc_exec_ctx* exec_ctx, NoOp* p, grpc_call_stack* s) {}
+    void Finish(grpc_exec_ctx* exec_ctx) {}
   };
 };
 
@@ -491,11 +489,11 @@
 
   class Op {
    public:
-    Op(grpc_exec_ctx *exec_ctx, SendEmptyMetadata *p, grpc_call_stack *s) {
+    Op(grpc_exec_ctx* exec_ctx, SendEmptyMetadata* p, grpc_call_stack* s) {
       grpc_metadata_batch_init(&batch_);
       p->op_payload_.send_initial_metadata.send_initial_metadata = &batch_;
     }
-    void Finish(grpc_exec_ctx *exec_ctx) {
+    void Finish(grpc_exec_ctx* exec_ctx) {
       grpc_metadata_batch_destroy(exec_ctx, &batch_);
     }
 
@@ -516,7 +514,7 @@
 // Fixture<> template to specify this), and TestOp defines some unit of work to
 // perform on said filter.
 template <class Fixture, class TestOp>
-static void BM_IsolatedFilter(benchmark::State &state) {
+static void BM_IsolatedFilter(benchmark::State& state) {
   TrackCounters track_counters;
   Fixture fixture;
   std::ostringstream label;
@@ -529,7 +527,7 @@
 
   grpc_channel_args channel_args = {args.size(), &args[0]};
 
-  std::vector<const grpc_channel_filter *> filters;
+  std::vector<const grpc_channel_filter*> filters;
   if (fixture.filter != nullptr) {
     filters.push_back(fixture.filter);
   }
@@ -541,8 +539,8 @@
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   size_t channel_size = grpc_channel_stack_size(
       filters.size() == 0 ? NULL : &filters[0], filters.size());
-  grpc_channel_stack *channel_stack =
-      static_cast<grpc_channel_stack *>(gpr_zalloc(channel_size));
+  grpc_channel_stack* channel_stack =
+      static_cast<grpc_channel_stack*>(gpr_zalloc(channel_size));
   GPR_ASSERT(GRPC_LOG_IF_ERROR(
       "channel_stack_init",
       grpc_channel_stack_init(&exec_ctx, 1, FilterDestroy, channel_stack,
@@ -552,8 +550,8 @@
                                   : nullptr,
                               "CHANNEL", channel_stack)));
   grpc_exec_ctx_flush(&exec_ctx);
-  grpc_call_stack *call_stack = static_cast<grpc_call_stack *>(
-      gpr_zalloc(channel_stack->call_stack_size));
+  grpc_call_stack* call_stack =
+      static_cast<grpc_call_stack*>(gpr_zalloc(channel_stack->call_stack_size));
   grpc_millis deadline = GRPC_MILLIS_INF_FUTURE;
   gpr_timespec start_time = gpr_now(GPR_CLOCK_MONOTONIC);
   grpc_slice method = grpc_slice_from_static_string("/foo/bar");
@@ -630,12 +628,14 @@
 
 namespace isolated_call_filter {
 
-typedef struct { grpc_call_combiner *call_combiner; } call_data;
+typedef struct {
+  grpc_call_combiner* call_combiner;
+} call_data;
 
-static void StartTransportStreamOp(grpc_exec_ctx *exec_ctx,
-                                   grpc_call_element *elem,
-                                   grpc_transport_stream_op_batch *op) {
-  call_data *calld = static_cast<call_data *>(elem->call_data);
+static void StartTransportStreamOp(grpc_exec_ctx* exec_ctx,
+                                   grpc_call_element* elem,
+                                   grpc_transport_stream_op_batch* op) {
+  call_data* calld = static_cast<call_data*>(elem->call_data);
   if (op->recv_initial_metadata) {
     GRPC_CALL_COMBINER_START(
         exec_ctx, calld->call_combiner,
@@ -650,42 +650,42 @@
   GRPC_CLOSURE_SCHED(exec_ctx, op->on_complete, GRPC_ERROR_NONE);
 }
 
-static void StartTransportOp(grpc_exec_ctx *exec_ctx,
-                             grpc_channel_element *elem,
-                             grpc_transport_op *op) {
+static void StartTransportOp(grpc_exec_ctx* exec_ctx,
+                             grpc_channel_element* elem,
+                             grpc_transport_op* op) {
   if (op->disconnect_with_error != GRPC_ERROR_NONE) {
     GRPC_ERROR_UNREF(op->disconnect_with_error);
   }
   GRPC_CLOSURE_SCHED(exec_ctx, op->on_consumed, GRPC_ERROR_NONE);
 }
 
-static grpc_error *InitCallElem(grpc_exec_ctx *exec_ctx,
-                                grpc_call_element *elem,
-                                const grpc_call_element_args *args) {
-  call_data *calld = static_cast<call_data *>(elem->call_data);
+static grpc_error* InitCallElem(grpc_exec_ctx* exec_ctx,
+                                grpc_call_element* elem,
+                                const grpc_call_element_args* args) {
+  call_data* calld = static_cast<call_data*>(elem->call_data);
   calld->call_combiner = args->call_combiner;
   return GRPC_ERROR_NONE;
 }
 
-static void SetPollsetOrPollsetSet(grpc_exec_ctx *exec_ctx,
-                                   grpc_call_element *elem,
-                                   grpc_polling_entity *pollent) {}
+static void SetPollsetOrPollsetSet(grpc_exec_ctx* exec_ctx,
+                                   grpc_call_element* elem,
+                                   grpc_polling_entity* pollent) {}
 
-static void DestroyCallElem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
-                            const grpc_call_final_info *final_info,
-                            grpc_closure *then_sched_closure) {
+static void DestroyCallElem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
+                            const grpc_call_final_info* final_info,
+                            grpc_closure* then_sched_closure) {
   GRPC_CLOSURE_SCHED(exec_ctx, then_sched_closure, GRPC_ERROR_NONE);
 }
 
-grpc_error *InitChannelElem(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                            grpc_channel_element_args *args) {
+grpc_error* InitChannelElem(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                            grpc_channel_element_args* args) {
   return GRPC_ERROR_NONE;
 }
 
-void DestroyChannelElem(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) {}
+void DestroyChannelElem(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem) {}
 
-void GetChannelInfo(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem,
-                    const grpc_channel_info *channel_info) {}
+void GetChannelInfo(grpc_exec_ctx* exec_ctx, grpc_channel_element* elem,
+                    const grpc_channel_info* channel_info) {}
 
 static const grpc_channel_filter isolated_call_filter = {
     StartTransportStreamOp,
@@ -704,7 +704,7 @@
 class IsolatedCallFixture : public TrackCounters {
  public:
   IsolatedCallFixture() {
-    grpc_channel_stack_builder *builder = grpc_channel_stack_builder_create();
+    grpc_channel_stack_builder* builder = grpc_channel_stack_builder_create();
     grpc_channel_stack_builder_set_name(builder, "dummy");
     grpc_channel_stack_builder_set_target(builder, "dummy_target");
     GPR_ASSERT(grpc_channel_stack_builder_append_filter(
@@ -718,24 +718,24 @@
     cq_ = grpc_completion_queue_create_for_next(NULL);
   }
 
-  void Finish(benchmark::State &state) {
+  void Finish(benchmark::State& state) {
     grpc_completion_queue_destroy(cq_);
     grpc_channel_destroy(channel_);
     TrackCounters::Finish(state);
   }
 
-  grpc_channel *channel() const { return channel_; }
-  grpc_completion_queue *cq() const { return cq_; }
+  grpc_channel* channel() const { return channel_; }
+  grpc_completion_queue* cq() const { return cq_; }
 
  private:
-  grpc_completion_queue *cq_;
-  grpc_channel *channel_;
+  grpc_completion_queue* cq_;
+  grpc_channel* channel_;
 };
 
-static void BM_IsolatedCall_NoOp(benchmark::State &state) {
+static void BM_IsolatedCall_NoOp(benchmark::State& state) {
   IsolatedCallFixture fixture;
   gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
-  void *method_hdl =
+  void* method_hdl =
       grpc_channel_register_call(fixture.channel(), "/foo/bar", NULL, NULL);
   while (state.KeepRunning()) {
     GPR_TIMER_SCOPE("BenchmarkCycle", 0);
@@ -747,14 +747,14 @@
 }
 BENCHMARK(BM_IsolatedCall_NoOp);
 
-static void BM_IsolatedCall_Unary(benchmark::State &state) {
+static void BM_IsolatedCall_Unary(benchmark::State& state) {
   IsolatedCallFixture fixture;
   gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
-  void *method_hdl =
+  void* method_hdl =
       grpc_channel_register_call(fixture.channel(), "/foo/bar", NULL, NULL);
   grpc_slice slice = grpc_slice_from_static_string("hello world");
-  grpc_byte_buffer *send_message = grpc_raw_byte_buffer_create(&slice, 1);
-  grpc_byte_buffer *recv_message = NULL;
+  grpc_byte_buffer* send_message = grpc_raw_byte_buffer_create(&slice, 1);
+  grpc_byte_buffer* recv_message = NULL;
   grpc_status_code status_code;
   grpc_slice status_details = grpc_empty_slice();
   grpc_metadata_array recv_initial_metadata;
@@ -778,7 +778,7 @@
   ops[5].data.recv_status_on_client.trailing_metadata = &recv_trailing_metadata;
   while (state.KeepRunning()) {
     GPR_TIMER_SCOPE("BenchmarkCycle", 0);
-    grpc_call *call = grpc_channel_create_registered_call(
+    grpc_call* call = grpc_channel_create_registered_call(
         fixture.channel(), nullptr, GRPC_PROPAGATE_DEFAULTS, fixture.cq(),
         method_hdl, deadline, NULL);
     grpc_call_start_batch(call, ops, 6, tag(1), NULL);
@@ -793,13 +793,13 @@
 }
 BENCHMARK(BM_IsolatedCall_Unary);
 
-static void BM_IsolatedCall_StreamingSend(benchmark::State &state) {
+static void BM_IsolatedCall_StreamingSend(benchmark::State& state) {
   IsolatedCallFixture fixture;
   gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
-  void *method_hdl =
+  void* method_hdl =
       grpc_channel_register_call(fixture.channel(), "/foo/bar", NULL, NULL);
   grpc_slice slice = grpc_slice_from_static_string("hello world");
-  grpc_byte_buffer *send_message = grpc_raw_byte_buffer_create(&slice, 1);
+  grpc_byte_buffer* send_message = grpc_raw_byte_buffer_create(&slice, 1);
   grpc_metadata_array recv_initial_metadata;
   grpc_metadata_array_init(&recv_initial_metadata);
   grpc_metadata_array recv_trailing_metadata;
@@ -810,7 +810,7 @@
   ops[1].op = GRPC_OP_RECV_INITIAL_METADATA;
   ops[1].data.recv_initial_metadata.recv_initial_metadata =
       &recv_initial_metadata;
-  grpc_call *call = grpc_channel_create_registered_call(
+  grpc_call* call = grpc_channel_create_registered_call(
       fixture.channel(), nullptr, GRPC_PROPAGATE_DEFAULTS, fixture.cq(),
       method_hdl, deadline, NULL);
   grpc_call_start_batch(call, ops, 2, tag(1), NULL);
diff --git a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
index f813bb7..45f5382 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
@@ -22,22 +22,22 @@
 #include <grpc/support/log.h>
 #include <string.h>
 #include <sstream>
-extern "C" {
+
 #include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
 #include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
 #include "src/core/lib/slice/slice_internal.h"
 #include "src/core/lib/slice/slice_string_helpers.h"
 #include "src/core/lib/transport/static_metadata.h"
 #include "src/core/lib/transport/timeout_encoding.h"
-}
+
 #include "test/cpp/microbenchmarks/helpers.h"
 #include "third_party/benchmark/include/benchmark/benchmark.h"
 
-auto &force_library_initialization = Library::get();
+auto& force_library_initialization = Library::get();
 
 static grpc_slice MakeSlice(std::vector<uint8_t> bytes) {
   grpc_slice s = grpc_slice_malloc(bytes.size());
-  uint8_t *p = GRPC_SLICE_START_PTR(s);
+  uint8_t* p = GRPC_SLICE_START_PTR(s);
   for (auto b : bytes) {
     *p++ = b;
   }
@@ -48,7 +48,7 @@
 // HPACK encoder
 //
 
-static void BM_HpackEncoderInitDestroy(benchmark::State &state) {
+static void BM_HpackEncoderInitDestroy(benchmark::State& state) {
   TrackCounters track_counters;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_chttp2_hpack_compressor c;
@@ -62,7 +62,7 @@
 }
 BENCHMARK(BM_HpackEncoderInitDestroy);
 
-static void BM_HpackEncoderEncodeDeadline(benchmark::State &state) {
+static void BM_HpackEncoderEncodeDeadline(benchmark::State& state) {
   TrackCounters track_counters;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_millis saved_now = grpc_exec_ctx_now(&exec_ctx);
@@ -95,17 +95,19 @@
   grpc_exec_ctx_finish(&exec_ctx);
 
   std::ostringstream label;
-  label << "framing_bytes/iter:" << (static_cast<double>(stats.framing_bytes) /
-                                     static_cast<double>(state.iterations()))
-        << " header_bytes/iter:" << (static_cast<double>(stats.header_bytes) /
-                                     static_cast<double>(state.iterations()));
+  label << "framing_bytes/iter:"
+        << (static_cast<double>(stats.framing_bytes) /
+            static_cast<double>(state.iterations()))
+        << " header_bytes/iter:"
+        << (static_cast<double>(stats.header_bytes) /
+            static_cast<double>(state.iterations()));
   track_counters.AddLabel(label.str());
   track_counters.Finish(state);
 }
 BENCHMARK(BM_HpackEncoderEncodeDeadline);
 
 template <class Fixture>
-static void BM_HpackEncoderEncodeHeader(benchmark::State &state) {
+static void BM_HpackEncoderEncodeHeader(benchmark::State& state) {
   TrackCounters track_counters;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   static bool logged_representative_output = false;
@@ -138,7 +140,7 @@
     if (!logged_representative_output && state.iterations() > 3) {
       logged_representative_output = true;
       for (size_t i = 0; i < outbuf.count; i++) {
-        char *s = grpc_dump_slice(outbuf.slices[i], GPR_DUMP_HEX);
+        char* s = grpc_dump_slice(outbuf.slices[i], GPR_DUMP_HEX);
         gpr_log(GPR_DEBUG, "%" PRIdPTR ": %s", i, s);
         gpr_free(s);
       }
@@ -152,10 +154,12 @@
   grpc_exec_ctx_finish(&exec_ctx);
 
   std::ostringstream label;
-  label << "framing_bytes/iter:" << (static_cast<double>(stats.framing_bytes) /
-                                     static_cast<double>(state.iterations()))
-        << " header_bytes/iter:" << (static_cast<double>(stats.header_bytes) /
-                                     static_cast<double>(state.iterations()));
+  label << "framing_bytes/iter:"
+        << (static_cast<double>(stats.framing_bytes) /
+            static_cast<double>(state.iterations()))
+        << " header_bytes/iter:"
+        << (static_cast<double>(stats.header_bytes) /
+            static_cast<double>(state.iterations()));
   track_counters.AddLabel(label.str());
   track_counters.Finish(state);
 }
@@ -165,7 +169,7 @@
 class EmptyBatch {
  public:
   static constexpr bool kEnableTrueBinary = false;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {};
   }
 };
@@ -173,7 +177,7 @@
 class SingleStaticElem {
  public:
   static constexpr bool kEnableTrueBinary = false;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE};
   }
 };
@@ -181,7 +185,7 @@
 class SingleInternedElem {
  public:
   static constexpr bool kEnableTrueBinary = false;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {grpc_mdelem_from_slices(
         exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc")),
         grpc_slice_intern(grpc_slice_from_static_string("def")))};
@@ -192,7 +196,7 @@
 class SingleInternedBinaryElem {
  public:
   static constexpr bool kEnableTrueBinary = kTrueBinary;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     grpc_slice bytes = MakeBytes();
     std::vector<grpc_mdelem> out = {grpc_mdelem_from_slices(
         exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc-bin")),
@@ -214,7 +218,7 @@
 class SingleInternedKeyElem {
  public:
   static constexpr bool kEnableTrueBinary = false;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {grpc_mdelem_from_slices(
         exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc")),
         grpc_slice_from_static_string("def"))};
@@ -224,7 +228,7 @@
 class SingleNonInternedElem {
  public:
   static constexpr bool kEnableTrueBinary = false;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {grpc_mdelem_from_slices(exec_ctx,
                                     grpc_slice_from_static_string("abc"),
                                     grpc_slice_from_static_string("def"))};
@@ -235,7 +239,7 @@
 class SingleNonInternedBinaryElem {
  public:
   static constexpr bool kEnableTrueBinary = kTrueBinary;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {grpc_mdelem_from_slices(
         exec_ctx, grpc_slice_from_static_string("abc-bin"), MakeBytes())};
   }
@@ -253,9 +257,10 @@
 class RepresentativeClientInitialMetadata {
  public:
   static constexpr bool kEnableTrueBinary = true;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {
-        GRPC_MDELEM_SCHEME_HTTP, GRPC_MDELEM_METHOD_POST,
+        GRPC_MDELEM_SCHEME_HTTP,
+        GRPC_MDELEM_METHOD_POST,
         grpc_mdelem_from_slices(
             exec_ctx, GRPC_MDSTR_PATH,
             grpc_slice_intern(grpc_slice_from_static_string("/foo/bar"))),
@@ -278,9 +283,10 @@
 class MoreRepresentativeClientInitialMetadata {
  public:
   static constexpr bool kEnableTrueBinary = true;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {
-        GRPC_MDELEM_SCHEME_HTTP, GRPC_MDELEM_METHOD_POST,
+        GRPC_MDELEM_SCHEME_HTTP,
+        GRPC_MDELEM_METHOD_POST,
         grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_PATH,
                                 grpc_slice_intern(grpc_slice_from_static_string(
                                     "/grpc.test.FooService/BarMethod"))),
@@ -314,7 +320,7 @@
 class RepresentativeServerInitialMetadata {
  public:
   static constexpr bool kEnableTrueBinary = true;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {GRPC_MDELEM_STATUS_200,
             GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC,
             GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP};
@@ -324,7 +330,7 @@
 class RepresentativeServerTrailingMetadata {
  public:
   static constexpr bool kEnableTrueBinary = true;
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {GRPC_MDELEM_GRPC_STATUS_0};
   }
 };
@@ -423,7 +429,7 @@
 // HPACK parser
 //
 
-static void BM_HpackParserInitDestroy(benchmark::State &state) {
+static void BM_HpackParserInitDestroy(benchmark::State& state) {
   TrackCounters track_counters;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_chttp2_hpack_parser p;
@@ -437,14 +443,13 @@
 }
 BENCHMARK(BM_HpackParserInitDestroy);
 
-static void UnrefHeader(grpc_exec_ctx *exec_ctx, void *user_data,
+static void UnrefHeader(grpc_exec_ctx* exec_ctx, void* user_data,
                         grpc_mdelem md) {
   GRPC_MDELEM_UNREF(exec_ctx, md);
 }
 
-template <class Fixture,
-          void (*OnHeader)(grpc_exec_ctx *, void *, grpc_mdelem) = UnrefHeader>
-static void BM_HpackParserParseHeader(benchmark::State &state) {
+template <class Fixture, void (*OnHeader)(grpc_exec_ctx*, void*, grpc_mdelem)>
+static void BM_HpackParserParseHeader(benchmark::State& state) {
   TrackCounters track_counters;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   std::vector<grpc_slice> init_slices = Fixture::GetInitSlices();
@@ -761,20 +766,20 @@
   }
 };
 
-static void free_timeout(void *p) { gpr_free(p); }
+static void free_timeout(void* p) { gpr_free(p); }
 
 // New implementation.
-static void OnHeaderNew(grpc_exec_ctx *exec_ctx, void *user_data,
+static void OnHeaderNew(grpc_exec_ctx* exec_ctx, void* user_data,
                         grpc_mdelem md) {
   if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_GRPC_TIMEOUT)) {
-    grpc_millis *cached_timeout =
-        static_cast<grpc_millis *>(grpc_mdelem_get_user_data(md, free_timeout));
+    grpc_millis* cached_timeout =
+        static_cast<grpc_millis*>(grpc_mdelem_get_user_data(md, free_timeout));
     grpc_millis timeout;
     if (cached_timeout != NULL) {
       timeout = *cached_timeout;
     } else {
       if (!grpc_http2_decode_timeout(GRPC_MDVALUE(md), &timeout)) {
-        char *val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+        char* val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
         gpr_log(GPR_ERROR, "Ignoring bad timeout value '%s'", val);
         gpr_free(val);
         timeout = GRPC_MILLIS_INF_FUTURE;
@@ -782,7 +787,7 @@
       if (GRPC_MDELEM_IS_INTERNED(md)) {
         /* not already parsed: parse it now, and store the
          * result away */
-        cached_timeout = (grpc_millis *)gpr_malloc(sizeof(grpc_millis));
+        cached_timeout = (grpc_millis*)gpr_malloc(sizeof(grpc_millis));
         *cached_timeout = timeout;
         grpc_mdelem_set_user_data(md, free_timeout, cached_timeout);
       }
@@ -794,34 +799,6 @@
   }
 }
 
-// Current implementation.
-static void OnHeaderOld(grpc_exec_ctx *exec_ctx, void *user_data,
-                        grpc_mdelem md) {
-  if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_GRPC_TIMEOUT)) {
-    grpc_millis *cached_timeout =
-        static_cast<grpc_millis *>(grpc_mdelem_get_user_data(md, free_timeout));
-    grpc_millis timeout;
-    if (cached_timeout == NULL) {
-      /* not already parsed: parse it now, and store the result away */
-      cached_timeout = (grpc_millis *)gpr_malloc(sizeof(grpc_millis));
-      if (!grpc_http2_decode_timeout(GRPC_MDVALUE(md), cached_timeout)) {
-        char *val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
-        gpr_log(GPR_ERROR, "Ignoring bad timeout value '%s'", val);
-        gpr_free(val);
-        *cached_timeout = GRPC_MILLIS_INF_FUTURE;
-      }
-      timeout = *cached_timeout;
-      grpc_mdelem_set_user_data(md, free_timeout, cached_timeout);
-    } else {
-      timeout = *cached_timeout;
-    }
-    benchmark::DoNotOptimize(timeout);
-    GRPC_MDELEM_UNREF(exec_ctx, md);
-  } else {
-    GPR_ASSERT(0);
-  }
-}
-
 // Send the same deadline repeatedly
 class SameDeadline {
  public:
@@ -836,34 +813,49 @@
   }
 };
 
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, EmptyBatch);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, IndexedSingleStaticElem);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, AddIndexedSingleStaticElem);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, KeyIndexedSingleStaticElem);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, IndexedSingleInternedElem);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, AddIndexedSingleInternedElem);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, KeyIndexedSingleInternedElem);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedElem);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<1, false>);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<3, false>);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<10, false>);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<31, false>);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<100, false>);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<1, true>);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<3, true>);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<10, true>);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<31, true>);
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<100, true>);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, EmptyBatch, UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, IndexedSingleStaticElem,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, AddIndexedSingleStaticElem,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, KeyIndexedSingleStaticElem,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, IndexedSingleInternedElem,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, AddIndexedSingleInternedElem,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, KeyIndexedSingleInternedElem,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedElem, UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<1, false>,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<3, false>,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<10, false>,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<31, false>,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<100, false>,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<1, true>,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<3, true>,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<10, true>,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<31, true>,
+                   UnrefHeader);
+BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<100, true>,
+                   UnrefHeader);
 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader,
-                   RepresentativeClientInitialMetadata);
+                   RepresentativeClientInitialMetadata, UnrefHeader);
 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader,
-                   MoreRepresentativeClientInitialMetadata);
+                   MoreRepresentativeClientInitialMetadata, UnrefHeader);
 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader,
-                   RepresentativeServerInitialMetadata);
+                   RepresentativeServerInitialMetadata, UnrefHeader);
 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader,
-                   RepresentativeServerTrailingMetadata);
+                   RepresentativeServerTrailingMetadata, UnrefHeader);
 
-BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, SameDeadline, OnHeaderOld);
 BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, SameDeadline, OnHeaderNew);
 
 }  // namespace hpack_parser_fixtures
diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
index 3a484bb..154cc91 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
@@ -35,7 +35,7 @@
 #include "test/cpp/microbenchmarks/helpers.h"
 #include "third_party/benchmark/include/benchmark/benchmark.h"
 
-auto &force_library_initialization = Library::get();
+auto& force_library_initialization = Library::get();
 
 ////////////////////////////////////////////////////////////////////////////////
 // Helper classes
@@ -44,15 +44,21 @@
 class DummyEndpoint : public grpc_endpoint {
  public:
   DummyEndpoint() {
-    static const grpc_endpoint_vtable my_vtable = {
-        read,     write,   add_to_pollset,    add_to_pollset_set,
-        shutdown, destroy, get_resource_user, get_peer,
-        get_fd};
+    static const grpc_endpoint_vtable my_vtable = {read,
+                                                   write,
+                                                   add_to_pollset,
+                                                   add_to_pollset_set,
+                                                   delete_from_pollset_set,
+                                                   shutdown,
+                                                   destroy,
+                                                   get_resource_user,
+                                                   get_peer,
+                                                   get_fd};
     grpc_endpoint::vtable = &my_vtable;
     ru_ = grpc_resource_user_create(Library::get().rq(), "dummy_endpoint");
   }
 
-  void PushInput(grpc_exec_ctx *exec_ctx, grpc_slice slice) {
+  void PushInput(grpc_exec_ctx* exec_ctx, grpc_slice slice) {
     if (read_cb_ == nullptr) {
       GPR_ASSERT(!have_slice_);
       buffered_slice_ = slice;
@@ -65,14 +71,14 @@
   }
 
  private:
-  grpc_resource_user *ru_;
-  grpc_closure *read_cb_ = nullptr;
-  grpc_slice_buffer *slices_ = nullptr;
+  grpc_resource_user* ru_;
+  grpc_closure* read_cb_ = nullptr;
+  grpc_slice_buffer* slices_ = nullptr;
   bool have_slice_ = false;
   grpc_slice buffered_slice_;
 
-  void QueueRead(grpc_exec_ctx *exec_ctx, grpc_slice_buffer *slices,
-                 grpc_closure *cb) {
+  void QueueRead(grpc_exec_ctx* exec_ctx, grpc_slice_buffer* slices,
+                 grpc_closure* cb) {
     GPR_ASSERT(read_cb_ == nullptr);
     if (have_slice_) {
       have_slice_ = false;
@@ -84,47 +90,50 @@
     slices_ = slices;
   }
 
-  static void read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                   grpc_slice_buffer *slices, grpc_closure *cb) {
-    static_cast<DummyEndpoint *>(ep)->QueueRead(exec_ctx, slices, cb);
+  static void read(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                   grpc_slice_buffer* slices, grpc_closure* cb) {
+    static_cast<DummyEndpoint*>(ep)->QueueRead(exec_ctx, slices, cb);
   }
 
-  static void write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                    grpc_slice_buffer *slices, grpc_closure *cb) {
+  static void write(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                    grpc_slice_buffer* slices, grpc_closure* cb) {
     GRPC_CLOSURE_SCHED(exec_ctx, cb, GRPC_ERROR_NONE);
   }
 
-  static grpc_workqueue *get_workqueue(grpc_endpoint *ep) { return NULL; }
+  static grpc_workqueue* get_workqueue(grpc_endpoint* ep) { return NULL; }
 
-  static void add_to_pollset(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                             grpc_pollset *pollset) {}
+  static void add_to_pollset(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                             grpc_pollset* pollset) {}
 
-  static void add_to_pollset_set(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                                 grpc_pollset_set *pollset) {}
+  static void add_to_pollset_set(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                                 grpc_pollset_set* pollset) {}
 
-  static void shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
-                       grpc_error *why) {
-    grpc_resource_user_shutdown(exec_ctx,
-                                static_cast<DummyEndpoint *>(ep)->ru_);
-    GRPC_CLOSURE_SCHED(exec_ctx, static_cast<DummyEndpoint *>(ep)->read_cb_,
+  static void delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
+                                      grpc_endpoint* ep,
+                                      grpc_pollset_set* pollset) {}
+
+  static void shutdown(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep,
+                       grpc_error* why) {
+    grpc_resource_user_shutdown(exec_ctx, static_cast<DummyEndpoint*>(ep)->ru_);
+    GRPC_CLOSURE_SCHED(exec_ctx, static_cast<DummyEndpoint*>(ep)->read_cb_,
                        why);
   }
 
-  static void destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep) {
-    grpc_resource_user_unref(exec_ctx, static_cast<DummyEndpoint *>(ep)->ru_);
-    delete static_cast<DummyEndpoint *>(ep);
+  static void destroy(grpc_exec_ctx* exec_ctx, grpc_endpoint* ep) {
+    grpc_resource_user_unref(exec_ctx, static_cast<DummyEndpoint*>(ep)->ru_);
+    delete static_cast<DummyEndpoint*>(ep);
   }
 
-  static grpc_resource_user *get_resource_user(grpc_endpoint *ep) {
-    return static_cast<DummyEndpoint *>(ep)->ru_;
+  static grpc_resource_user* get_resource_user(grpc_endpoint* ep) {
+    return static_cast<DummyEndpoint*>(ep)->ru_;
   }
-  static char *get_peer(grpc_endpoint *ep) { return gpr_strdup("test"); }
-  static int get_fd(grpc_endpoint *ep) { return 0; }
+  static char* get_peer(grpc_endpoint* ep) { return gpr_strdup("test"); }
+  static int get_fd(grpc_endpoint* ep) { return 0; }
 };
 
 class Fixture {
  public:
-  Fixture(const grpc::ChannelArguments &args, bool client) {
+  Fixture(const grpc::ChannelArguments& args, bool client) {
     grpc_channel_args c_args = args.c_channel_args();
     ep_ = new DummyEndpoint;
     t_ = grpc_create_chttp2_transport(exec_ctx(), &c_args, ep_, client);
@@ -139,18 +148,18 @@
     grpc_exec_ctx_finish(&exec_ctx_);
   }
 
-  grpc_chttp2_transport *chttp2_transport() {
-    return reinterpret_cast<grpc_chttp2_transport *>(t_);
+  grpc_chttp2_transport* chttp2_transport() {
+    return reinterpret_cast<grpc_chttp2_transport*>(t_);
   }
-  grpc_transport *transport() { return t_; }
-  grpc_exec_ctx *exec_ctx() { return &exec_ctx_; }
+  grpc_transport* transport() { return t_; }
+  grpc_exec_ctx* exec_ctx() { return &exec_ctx_; }
 
   void PushInput(grpc_slice slice) { ep_->PushInput(exec_ctx(), slice); }
 
  private:
-  DummyEndpoint *ep_;
+  DummyEndpoint* ep_;
   grpc_exec_ctx exec_ctx_ = GRPC_EXEC_CTX_INIT;
-  grpc_transport *t_;
+  grpc_transport* t_;
 };
 
 class Closure : public grpc_closure {
@@ -160,37 +169,37 @@
 
 template <class F>
 std::unique_ptr<Closure> MakeClosure(
-    F f, grpc_closure_scheduler *sched = grpc_schedule_on_exec_ctx) {
+    F f, grpc_closure_scheduler* sched = grpc_schedule_on_exec_ctx) {
   struct C : public Closure {
-    C(const F &f, grpc_closure_scheduler *sched) : f_(f) {
+    C(const F& f, grpc_closure_scheduler* sched) : f_(f) {
       GRPC_CLOSURE_INIT(this, Execute, this, sched);
     }
     F f_;
-    static void Execute(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-      static_cast<C *>(arg)->f_(exec_ctx, error);
+    static void Execute(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+      static_cast<C*>(arg)->f_(exec_ctx, error);
     }
   };
   return std::unique_ptr<Closure>(new C(f, sched));
 }
 
 template <class F>
-grpc_closure *MakeOnceClosure(
-    F f, grpc_closure_scheduler *sched = grpc_schedule_on_exec_ctx) {
+grpc_closure* MakeOnceClosure(
+    F f, grpc_closure_scheduler* sched = grpc_schedule_on_exec_ctx) {
   struct C : public grpc_closure {
-    C(const F &f) : f_(f) {}
+    C(const F& f) : f_(f) {}
     F f_;
-    static void Execute(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
-      static_cast<C *>(arg)->f_(exec_ctx, error);
-      delete static_cast<C *>(arg);
+    static void Execute(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+      static_cast<C*>(arg)->f_(exec_ctx, error);
+      delete static_cast<C*>(arg);
     }
   };
-  auto *c = new C{f};
+  auto* c = new C{f};
   return GRPC_CLOSURE_INIT(c, C::Execute, c, sched);
 }
 
 class Stream {
  public:
-  Stream(Fixture *f) : f_(f) {
+  Stream(Fixture* f) : f_(f) {
     stream_size_ = grpc_transport_stream_size(f->transport());
     stream_ = gpr_malloc(stream_size_);
     arena_ = gpr_arena_create(4096);
@@ -202,7 +211,7 @@
     gpr_arena_destroy(arena_);
   }
 
-  void Init(benchmark::State &state) {
+  void Init(benchmark::State& state) {
     GRPC_STREAM_REF_INIT(&refcount_, 1, &Stream::FinishDestroy, this,
                          "test_stream");
     gpr_event_init(&done_);
@@ -212,11 +221,11 @@
       arena_ = gpr_arena_create(4096);
     }
     grpc_transport_init_stream(f_->exec_ctx(), f_->transport(),
-                               static_cast<grpc_stream *>(stream_), &refcount_,
+                               static_cast<grpc_stream*>(stream_), &refcount_,
                                NULL, arena_);
   }
 
-  void DestroyThen(grpc_exec_ctx *exec_ctx, grpc_closure *closure) {
+  void DestroyThen(grpc_exec_ctx* exec_ctx, grpc_closure* closure) {
     destroy_closure_ = closure;
 #ifndef NDEBUG
     grpc_stream_unref(exec_ctx, &refcount_, "DestroyThen");
@@ -225,31 +234,31 @@
 #endif
   }
 
-  void Op(grpc_exec_ctx *exec_ctx, grpc_transport_stream_op_batch *op) {
+  void Op(grpc_exec_ctx* exec_ctx, grpc_transport_stream_op_batch* op) {
     grpc_transport_perform_stream_op(exec_ctx, f_->transport(),
-                                     static_cast<grpc_stream *>(stream_), op);
+                                     static_cast<grpc_stream*>(stream_), op);
   }
 
-  grpc_chttp2_stream *chttp2_stream() {
-    return static_cast<grpc_chttp2_stream *>(stream_);
+  grpc_chttp2_stream* chttp2_stream() {
+    return static_cast<grpc_chttp2_stream*>(stream_);
   }
 
  private:
-  static void FinishDestroy(grpc_exec_ctx *exec_ctx, void *arg,
-                            grpc_error *error) {
-    auto stream = static_cast<Stream *>(arg);
+  static void FinishDestroy(grpc_exec_ctx* exec_ctx, void* arg,
+                            grpc_error* error) {
+    auto stream = static_cast<Stream*>(arg);
     grpc_transport_destroy_stream(exec_ctx, stream->f_->transport(),
-                                  static_cast<grpc_stream *>(stream->stream_),
+                                  static_cast<grpc_stream*>(stream->stream_),
                                   stream->destroy_closure_);
-    gpr_event_set(&stream->done_, (void *)1);
+    gpr_event_set(&stream->done_, (void*)1);
   }
 
-  Fixture *f_;
+  Fixture* f_;
   grpc_stream_refcount refcount_;
-  gpr_arena *arena_;
+  gpr_arena* arena_;
   size_t stream_size_;
-  void *stream_;
-  grpc_closure *destroy_closure_ = nullptr;
+  void* stream_;
+  grpc_closure* destroy_closure_ = nullptr;
   gpr_event done_;
 };
 
@@ -257,7 +266,7 @@
 // Benchmarks
 //
 
-static void BM_StreamCreateDestroy(benchmark::State &state) {
+static void BM_StreamCreateDestroy(benchmark::State& state) {
   TrackCounters track_counters;
   Fixture f(grpc::ChannelArguments(), true);
   Stream s(&f);
@@ -268,7 +277,7 @@
   op.payload = &op_payload;
   op_payload.cancel_stream.cancel_error = GRPC_ERROR_CANCELLED;
   std::unique_ptr<Closure> next =
-      MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+      MakeClosure([&](grpc_exec_ctx* exec_ctx, grpc_error* error) {
         if (!state.KeepRunning()) return;
         s.Init(state);
         s.Op(exec_ctx, &op);
@@ -282,9 +291,10 @@
 
 class RepresentativeClientInitialMetadata {
  public:
-  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
+  static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx* exec_ctx) {
     return {
-        GRPC_MDELEM_SCHEME_HTTP, GRPC_MDELEM_METHOD_POST,
+        GRPC_MDELEM_SCHEME_HTTP,
+        GRPC_MDELEM_METHOD_POST,
         grpc_mdelem_from_slices(
             exec_ctx, GRPC_MDSTR_PATH,
             grpc_slice_intern(grpc_slice_from_static_string("/foo/bar"))),
@@ -302,7 +312,7 @@
 };
 
 template <class Metadata>
-static void BM_StreamCreateSendInitialMetadataDestroy(benchmark::State &state) {
+static void BM_StreamCreateSendInitialMetadataDestroy(benchmark::State& state) {
   TrackCounters track_counters;
   Fixture f(grpc::ChannelArguments(), true);
   Stream s(&f);
@@ -329,7 +339,7 @@
   }
 
   f.FlushExecCtx();
-  start = MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+  start = MakeClosure([&](grpc_exec_ctx* exec_ctx, grpc_error* error) {
     if (!state.KeepRunning()) return;
     s.Init(state);
     reset_op();
@@ -338,7 +348,7 @@
     op.payload->send_initial_metadata.send_initial_metadata = &b;
     s.Op(exec_ctx, &op);
   });
-  done = MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+  done = MakeClosure([&](grpc_exec_ctx* exec_ctx, grpc_error* error) {
     reset_op();
     op.cancel_stream = true;
     op.payload->cancel_stream.cancel_error = GRPC_ERROR_CANCELLED;
@@ -353,7 +363,7 @@
 BENCHMARK_TEMPLATE(BM_StreamCreateSendInitialMetadataDestroy,
                    RepresentativeClientInitialMetadata);
 
-static void BM_TransportEmptyOp(benchmark::State &state) {
+static void BM_TransportEmptyOp(benchmark::State& state) {
   TrackCounters track_counters;
   Fixture f(grpc::ChannelArguments(), true);
   Stream s(&f);
@@ -366,7 +376,7 @@
     op.payload = &op_payload;
   };
   std::unique_ptr<Closure> c =
-      MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+      MakeClosure([&](grpc_exec_ctx* exec_ctx, grpc_error* error) {
         if (!state.KeepRunning()) return;
         reset_op();
         op.on_complete = c.get();
@@ -378,8 +388,8 @@
   op.cancel_stream = true;
   op_payload.cancel_stream.cancel_error = GRPC_ERROR_CANCELLED;
   s.Op(f.exec_ctx(), &op);
-  s.DestroyThen(f.exec_ctx(), MakeOnceClosure([](grpc_exec_ctx *exec_ctx,
-                                                 grpc_error *error) {}));
+  s.DestroyThen(f.exec_ctx(), MakeOnceClosure([](grpc_exec_ctx* exec_ctx,
+                                                 grpc_error* error) {}));
   f.FlushExecCtx();
   track_counters.Finish(state);
 }
@@ -387,7 +397,7 @@
 
 std::vector<std::unique_ptr<gpr_event>> done_events;
 
-static void BM_TransportStreamSend(benchmark::State &state) {
+static void BM_TransportStreamSend(benchmark::State& state) {
   TrackCounters track_counters;
   Fixture f(grpc::ChannelArguments(), true);
   auto s = std::unique_ptr<Stream>(new Stream(&f));
@@ -418,13 +428,13 @@
         grpc_metadata_batch_add_tail(f.exec_ctx(), &b, &storage[i], elems[i])));
   }
 
-  gpr_event *bm_done = new gpr_event;
+  gpr_event* bm_done = new gpr_event;
   gpr_event_init(bm_done);
 
   std::unique_ptr<Closure> c =
-      MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+      MakeClosure([&](grpc_exec_ctx* exec_ctx, grpc_error* error) {
         if (!state.KeepRunning()) {
-          gpr_event_set(bm_done, (void *)1);
+          gpr_event_set(bm_done, (void*)1);
           return;
         }
         // force outgoing window to be yuge
@@ -452,8 +462,8 @@
   op.cancel_stream = true;
   op.payload->cancel_stream.cancel_error = GRPC_ERROR_CANCELLED;
   s->Op(f.exec_ctx(), &op);
-  s->DestroyThen(f.exec_ctx(), MakeOnceClosure([](grpc_exec_ctx *exec_ctx,
-                                                  grpc_error *error) {}));
+  s->DestroyThen(f.exec_ctx(), MakeOnceClosure([](grpc_exec_ctx* exec_ctx,
+                                                  grpc_error* error) {}));
   f.FlushExecCtx();
   s.reset();
   track_counters.Finish(state);
@@ -519,7 +529,7 @@
   return grpc_slice_from_copied_buffer(framed.data(), framed.size());
 }
 
-static void BM_TransportStreamRecv(benchmark::State &state) {
+static void BM_TransportStreamRecv(benchmark::State& state) {
   TrackCounters track_counters;
   Fixture f(grpc::ChannelArguments(), true);
   Stream s(&f);
@@ -527,7 +537,7 @@
   grpc_transport_stream_op_batch_payload op_payload;
   memset(&op_payload, 0, sizeof(op_payload));
   grpc_transport_stream_op_batch op;
-  grpc_byte_stream *recv_stream;
+  grpc_byte_stream* recv_stream;
   grpc_slice incoming_data = CreateIncomingDataSlice(state.range(0), 16384);
 
   auto reset_op = [&]() {
@@ -550,7 +560,7 @@
   }
 
   std::unique_ptr<Closure> do_nothing =
-      MakeClosure([](grpc_exec_ctx *exec_ctx, grpc_error *error) {});
+      MakeClosure([](grpc_exec_ctx* exec_ctx, grpc_error* error) {});
 
   uint32_t received;
 
@@ -560,7 +570,7 @@
   grpc_slice recv_slice;
 
   std::unique_ptr<Closure> c =
-      MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+      MakeClosure([&](grpc_exec_ctx* exec_ctx, grpc_error* error) {
         if (!state.KeepRunning()) return;
         // force outgoing window to be yuge
         s.chttp2_stream()->flow_control->TestOnlyForceHugeWindow();
@@ -575,7 +585,7 @@
         f.PushInput(grpc_slice_ref(incoming_data));
       });
 
-  drain_start = MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+  drain_start = MakeClosure([&](grpc_exec_ctx* exec_ctx, grpc_error* error) {
     if (recv_stream == NULL) {
       GPR_ASSERT(!state.KeepRunning());
       return;
@@ -583,7 +593,7 @@
     GRPC_CLOSURE_RUN(exec_ctx, drain.get(), GRPC_ERROR_NONE);
   });
 
-  drain = MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+  drain = MakeClosure([&](grpc_exec_ctx* exec_ctx, grpc_error* error) {
     do {
       if (received == recv_stream->length) {
         grpc_byte_stream_destroy(exec_ctx, recv_stream);
@@ -599,7 +609,7 @@
               grpc_slice_unref_internal(exec_ctx, recv_slice), true));
   });
 
-  drain_continue = MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+  drain_continue = MakeClosure([&](grpc_exec_ctx* exec_ctx, grpc_error* error) {
     grpc_byte_stream_pull(exec_ctx, recv_stream, &recv_slice);
     received += GRPC_SLICE_LENGTH(recv_slice);
     grpc_slice_unref_internal(exec_ctx, recv_slice);
@@ -633,8 +643,8 @@
   op.cancel_stream = true;
   op.payload->cancel_stream.cancel_error = GRPC_ERROR_CANCELLED;
   s.Op(f.exec_ctx(), &op);
-  s.DestroyThen(f.exec_ctx(), MakeOnceClosure([](grpc_exec_ctx *exec_ctx,
-                                                 grpc_error *error) {}));
+  s.DestroyThen(f.exec_ctx(), MakeOnceClosure([](grpc_exec_ctx* exec_ctx,
+                                                 grpc_error* error) {}));
   f.FlushExecCtx();
   track_counters.Finish(state);
   grpc_metadata_batch_destroy(f.exec_ctx(), &b);
diff --git a/test/cpp/microbenchmarks/bm_closure.cc b/test/cpp/microbenchmarks/bm_closure.cc
index 41649b8..458a2ce 100644
--- a/test/cpp/microbenchmarks/bm_closure.cc
+++ b/test/cpp/microbenchmarks/bm_closure.cc
@@ -22,12 +22,10 @@
 #include <grpc/grpc.h>
 #include <sstream>
 
-extern "C" {
 #include "src/core/lib/iomgr/closure.h"
 #include "src/core/lib/iomgr/combiner.h"
 #include "src/core/lib/iomgr/exec_ctx.h"
 #include "src/core/lib/support/spinlock.h"
-}
 
 #include "test/cpp/microbenchmarks/helpers.h"
 
@@ -100,9 +98,10 @@
   TrackCounters track_counters;
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   while (state.KeepRunning()) {
-    GRPC_CLOSURE_RUN(&exec_ctx, GRPC_CLOSURE_CREATE(DoNothing, NULL,
-                                                    grpc_schedule_on_exec_ctx),
-                     GRPC_ERROR_NONE);
+    GRPC_CLOSURE_RUN(
+        &exec_ctx,
+        GRPC_CLOSURE_CREATE(DoNothing, NULL, grpc_schedule_on_exec_ctx),
+        GRPC_ERROR_NONE);
   }
   grpc_exec_ctx_finish(&exec_ctx);
   track_counters.Finish(state);
@@ -114,9 +113,10 @@
   grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
   grpc_closure c;
   while (state.KeepRunning()) {
-    GRPC_CLOSURE_RUN(&exec_ctx, GRPC_CLOSURE_INIT(&c, DoNothing, NULL,
-                                                  grpc_schedule_on_exec_ctx),
-                     GRPC_ERROR_NONE);
+    GRPC_CLOSURE_RUN(
+        &exec_ctx,
+        GRPC_CLOSURE_INIT(&c, DoNothing, NULL, grpc_schedule_on_exec_ctx),
+        GRPC_ERROR_NONE);
   }
   grpc_exec_ctx_finish(&exec_ctx);
   track_counters.Finish(state);
diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc
index a0c0414..dac702b 100644
--- a/test/cpp/microbenchmarks/bm_cq.cc
+++ b/test/cpp/microbenchmarks/bm_cq.cc
@@ -26,9 +26,7 @@
 #include <grpc/support/log.h>
 #include "test/cpp/microbenchmarks/helpers.h"
 
-extern "C" {
 #include "src/core/lib/surface/completion_queue.h"
-}
 
 namespace grpc {
 namespace testing {
@@ -70,7 +68,7 @@
 static void DoneWithCompletionOnStack(grpc_exec_ctx* exec_ctx, void* arg,
                                       grpc_cq_completion* completion) {}
 
-class DummyTag final : public CompletionQueueTag {
+class DummyTag final : public internal::CompletionQueueTag {
  public:
   bool FinalizeResult(void** tag, bool* status) override { return true; }
 };
diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
index 57a69ac..8d4349a 100644
--- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
+++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
@@ -25,11 +25,9 @@
 #include <grpc/support/log.h>
 #include "test/cpp/microbenchmarks/helpers.h"
 
-extern "C" {
 #include "src/core/lib/iomgr/ev_posix.h"
 #include "src/core/lib/iomgr/port.h"
 #include "src/core/lib/surface/completion_queue.h"
-}
 
 struct grpc_pollset {
   gpr_mu mu;
diff --git a/test/cpp/microbenchmarks/bm_error.cc b/test/cpp/microbenchmarks/bm_error.cc
index 56b80df..aa78226 100644
--- a/test/cpp/microbenchmarks/bm_error.cc
+++ b/test/cpp/microbenchmarks/bm_error.cc
@@ -21,10 +21,8 @@
 #include <benchmark/benchmark.h>
 #include <memory>
 
-extern "C" {
 #include "src/core/lib/iomgr/error.h"
 #include "src/core/lib/transport/error_utils.h"
-}
 
 #include "test/cpp/microbenchmarks/helpers.h"
 
diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
index 389b8c9..f75c3e4 100644
--- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
+++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
@@ -21,6 +21,7 @@
 #include <benchmark/benchmark.h>
 #include <gflags/gflags.h>
 #include <fstream>
+
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/ext/transport/chttp2/transport/internal.h"
 #include "src/core/lib/iomgr/timer_manager.h"
@@ -134,25 +135,26 @@
             ? static_cast<grpc_chttp2_stream*>(server->stream_map.values[0])
             : nullptr;
     write_csv(
-        log_.get(), static_cast<double>(now.tv_sec) +
-                        1e-9 * static_cast<double>(now.tv_nsec),
+        log_.get(),
+        static_cast<double>(now.tv_sec) +
+            1e-9 * static_cast<double>(now.tv_nsec),
         iteration, grpc_trickle_get_backlog(endpoint_pair_.client),
         grpc_trickle_get_backlog(endpoint_pair_.server),
         client->lists[GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT].head != nullptr,
         client->lists[GRPC_CHTTP2_LIST_STALLED_BY_STREAM].head != nullptr,
         server->lists[GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT].head != nullptr,
         server->lists[GRPC_CHTTP2_LIST_STALLED_BY_STREAM].head != nullptr,
-        client->flow_control->remote_window(),
-        server->flow_control->remote_window(),
-        client->flow_control->announced_window(),
-        server->flow_control->announced_window(),
-        client_stream ? client_stream->flow_control->remote_window_delta() : -1,
-        server_stream ? server_stream->flow_control->remote_window_delta() : -1,
-        client_stream ? client_stream->flow_control->local_window_delta() : -1,
-        server_stream ? server_stream->flow_control->local_window_delta() : -1,
-        client_stream ? client_stream->flow_control->announced_window_delta()
+        client->flow_control->remote_window_,
+        server->flow_control->remote_window_,
+        client->flow_control->announced_window_,
+        server->flow_control->announced_window_,
+        client_stream ? client_stream->flow_control->remote_window_delta_ : -1,
+        server_stream ? server_stream->flow_control->remote_window_delta_ : -1,
+        client_stream ? client_stream->flow_control->local_window_delta_ : -1,
+        server_stream ? server_stream->flow_control->local_window_delta_ : -1,
+        client_stream ? client_stream->flow_control->announced_window_delta_
                       : -1,
-        server_stream ? server_stream->flow_control->announced_window_delta()
+        server_stream ? server_stream->flow_control->announced_window_delta_
                       : -1,
         client->settings[GRPC_PEER_SETTINGS]
                         [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],
@@ -440,8 +442,8 @@
   }
 }
 BENCHMARK(BM_PumpUnbalancedUnary_Trickle)->Apply(UnaryTrickleArgs);
-}
-}
+}  // namespace testing
+}  // namespace grpc
 
 extern "C" gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type);
 
diff --git a/test/cpp/microbenchmarks/bm_metadata.cc b/test/cpp/microbenchmarks/bm_metadata.cc
index 360bbab..1ed05f7 100644
--- a/test/cpp/microbenchmarks/bm_metadata.cc
+++ b/test/cpp/microbenchmarks/bm_metadata.cc
@@ -21,10 +21,8 @@
 #include <benchmark/benchmark.h>
 #include <grpc/grpc.h>
 
-extern "C" {
 #include "src/core/lib/transport/metadata.h"
 #include "src/core/lib/transport/static_metadata.h"
-}
 
 #include "test/cpp/microbenchmarks/helpers.h"
 
diff --git a/test/cpp/microbenchmarks/bm_pollset.cc b/test/cpp/microbenchmarks/bm_pollset.cc
index eab1e89..92d76f3 100644
--- a/test/cpp/microbenchmarks/bm_pollset.cc
+++ b/test/cpp/microbenchmarks/bm_pollset.cc
@@ -23,12 +23,10 @@
 #include <grpc/support/log.h>
 #include <grpc/support/useful.h>
 
-extern "C" {
 #include "src/core/lib/iomgr/ev_posix.h"
 #include "src/core/lib/iomgr/pollset.h"
 #include "src/core/lib/iomgr/port.h"
 #include "src/core/lib/iomgr/wakeup_fd_posix.h"
-}
 
 #include "test/cpp/microbenchmarks/helpers.h"
 #include "third_party/benchmark/include/benchmark/benchmark.h"
diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h
index a7f8504..71bbb39 100644
--- a/test/cpp/microbenchmarks/fullstack_fixtures.h
+++ b/test/cpp/microbenchmarks/fullstack_fixtures.h
@@ -25,9 +25,9 @@
 #include <grpc++/security/server_credentials.h>
 #include <grpc++/server.h>
 #include <grpc++/server_builder.h>
+#include <grpc/support/atm.h>
 #include <grpc/support/log.h>
 
-extern "C" {
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/iomgr/endpoint.h"
@@ -39,7 +39,6 @@
 #include "src/core/lib/surface/server.h"
 #include "test/core/util/passthru_endpoint.h"
 #include "test/core/util/port.h"
-}
 
 #include "src/cpp/client/create_channel_internal.h"
 #include "test/cpp/microbenchmarks/helpers.h"
@@ -259,7 +258,8 @@
   void AddToLabel(std::ostream& out, benchmark::State& state) {
     EndpointPairFixture::AddToLabel(out, state);
     out << " writes/iter:"
-        << (double)stats_.num_writes / (double)state.iterations();
+        << static_cast<double>(gpr_atm_no_barrier_load(&stats_.num_writes)) /
+               static_cast<double>(state.iterations());
   }
 
  private:
diff --git a/test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h b/test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h
index 6df044f..0763d07 100644
--- a/test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h
+++ b/test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h
@@ -278,7 +278,7 @@
 
       void* t;
       bool ok;
-      int need_tags;
+      int expect_tags = 0;
 
       // Send 'max_ping_pongs' number of ping pong messages
       int ping_pong_cnt = 0;
@@ -289,7 +289,7 @@
           request_rw->Write(send_request, tag(2));  // Start client send
         }
 
-        need_tags = (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5);
+        int await_tags = (1 << 2);
 
         if (ping_pong_cnt == 0) {
           // wait for the server call structure (call_hook, etc.) to be
@@ -301,8 +301,8 @@
             // In some cases tag:2 comes before tag:0 (write tag comes out
             // first), this while loop is to make sure get tag:0.
             int i = (int)(intptr_t)t;
-            GPR_ASSERT(need_tags & (1 << i));
-            need_tags &= ~(1 << i);
+            GPR_ASSERT(await_tags & (1 << i));
+            await_tags &= ~(1 << i);
             GPR_ASSERT(fixture->cq()->Next(&t, &ok));
           }
         }
@@ -310,7 +310,11 @@
         response_rw.Read(&recv_request, tag(3));   // Start server recv
         request_rw->Read(&recv_response, tag(4));  // Start client recv
 
-        while (need_tags) {
+        await_tags |= (1 << 3) | (1 << 4);
+        expect_tags = await_tags;
+        await_tags |= (1 << 5);
+
+        while (await_tags != 0) {
           GPR_ASSERT(fixture->cq()->Next(&t, &ok));
           GPR_ASSERT(ok);
           int i = (int)(intptr_t)t;
@@ -321,34 +325,39 @@
               if (write_and_finish == 1) {
                 response_rw.WriteAndFinish(send_response, WriteOptions(),
                                            Status::OK, tag(5));
+                expect_tags |= (1 << 5);
               } else {
                 response_rw.WriteLast(send_response, WriteOptions(), tag(5));
-                // WriteLast buffers the write, so neither server write op nor
-                // client read op will finish inside the while loop.
-                need_tags &= ~(1 << 4);
-                need_tags &= ~(1 << 5);
+                // WriteLast buffers the write, so it's possible neither server
+                // write op nor client read op will finish inside the while
+                // loop.
+                await_tags &= ~(1 << 4);
+                await_tags &= ~(1 << 5);
+                expect_tags |= (1 << 5);
               }
             } else {
               response_rw.Write(send_response, tag(5));
+              expect_tags |= (1 << 5);
             }
           }
 
-          GPR_ASSERT(need_tags & (1 << i));
-          need_tags &= ~(1 << i);
+          GPR_ASSERT(expect_tags & (1 << i));
+          expect_tags &= ~(1 << i);
+          await_tags &= ~(1 << i);
         }
 
         ping_pong_cnt++;
       }
 
       if (max_ping_pongs == 0) {
-        need_tags = (1 << 6) | (1 << 7) | (1 << 8);
+        expect_tags |= (1 << 6) | (1 << 7) | (1 << 8);
       } else {
         if (write_and_finish == 1) {
-          need_tags = (1 << 8);
+          expect_tags |= (1 << 8);
         } else {
           // server's buffered write and the client's read of the buffered write
           // tags should come up.
-          need_tags = (1 << 4) | (1 << 5) | (1 << 7) | (1 << 8);
+          expect_tags |= (1 << 7) | (1 << 8);
         }
       }
 
@@ -360,8 +369,8 @@
         GPR_ASSERT(fixture->cq()->Next(&t, &ok));
         while ((int)(intptr_t)t != 0) {
           int i = (int)(intptr_t)t;
-          GPR_ASSERT(need_tags & (1 << i));
-          need_tags &= ~(1 << i);
+          GPR_ASSERT(expect_tags & (1 << i));
+          expect_tags &= ~(1 << i);
           GPR_ASSERT(fixture->cq()->Next(&t, &ok));
         }
         response_rw.Finish(Status::OK, tag(7));
@@ -374,11 +383,11 @@
       Status recv_status;
       request_rw->Finish(&recv_status, tag(8));
 
-      while (need_tags) {
+      while (expect_tags) {
         GPR_ASSERT(fixture->cq()->Next(&t, &ok));
         int i = (int)(intptr_t)t;
-        GPR_ASSERT(need_tags & (1 << i));
-        need_tags &= ~(1 << i);
+        GPR_ASSERT(expect_tags & (1 << i));
+        expect_tags &= ~(1 << i);
       }
 
       GPR_ASSERT(recv_status.ok());
diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc
index 6802a0a..a4c0a3a 100644
--- a/test/cpp/microbenchmarks/helpers.cc
+++ b/test/cpp/microbenchmarks/helpers.cc
@@ -16,11 +16,13 @@
  *
  */
 
+#include <string.h>
+
 #include "test/cpp/microbenchmarks/helpers.h"
 
-void TrackCounters::Finish(benchmark::State &state) {
+void TrackCounters::Finish(benchmark::State& state) {
   std::ostringstream out;
-  for (const auto &l : labels_) {
+  for (const auto& l : labels_) {
     out << l << ' ';
   }
   AddToLabel(out, state);
@@ -31,11 +33,11 @@
   state.SetLabel(label.c_str());
 }
 
-void TrackCounters::AddLabel(const grpc::string &label) {
+void TrackCounters::AddLabel(const grpc::string& label) {
   labels_.push_back(label);
 }
 
-void TrackCounters::AddToLabel(std::ostream &out, benchmark::State &state) {
+void TrackCounters::AddToLabel(std::ostream& out, benchmark::State& state) {
   grpc_stats_data stats_end;
   grpc_stats_collect(&stats_end);
   grpc_stats_data stats;
@@ -45,16 +47,21 @@
         << "/iter:" << ((double)stats.counters[i] / (double)state.iterations());
   }
   for (int i = 0; i < GRPC_STATS_HISTOGRAM_COUNT; i++) {
-    out << " " << grpc_stats_histogram_name[i] << "-median:"
-        << grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 50.0)
-        << " " << grpc_stats_histogram_name[i] << "-99p:"
-        << grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 99.0);
+    std::ostringstream median_ss;
+    median_ss << grpc_stats_histogram_name[i] << "-median";
+    state.counters[median_ss.str()] = benchmark::Counter(
+        grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 50.0));
+    std::ostringstream tail_ss;
+    tail_ss << grpc_stats_histogram_name[i] << "-99p";
+    state.counters[tail_ss.str()] = benchmark::Counter(
+        grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 99.0));
   }
 #ifdef GPR_LOW_LEVEL_COUNTERS
   grpc_memory_counters counters_at_end = grpc_memory_counters_snapshot();
-  out << " locks/iter:" << ((double)(gpr_atm_no_barrier_load(&gpr_mu_locks) -
-                                     mu_locks_at_start_) /
-                            (double)state.iterations())
+  out << " locks/iter:"
+      << ((double)(gpr_atm_no_barrier_load(&gpr_mu_locks) -
+                   mu_locks_at_start_) /
+          (double)state.iterations())
       << " atm_cas/iter:"
       << ((double)(gpr_atm_no_barrier_load(&gpr_counter_atm_cas) -
                    atm_cas_at_start_) /
diff --git a/test/cpp/microbenchmarks/helpers.h b/test/cpp/microbenchmarks/helpers.h
index b6cea7c..07be589 100644
--- a/test/cpp/microbenchmarks/helpers.h
+++ b/test/cpp/microbenchmarks/helpers.h
@@ -22,11 +22,9 @@
 #include <sstream>
 #include <vector>
 
-extern "C" {
 #include <grpc/support/port_platform.h>
 #include "src/core/lib/debug/stats.h"
 #include "test/core/util/memory_counters.h"
-}
 
 #include <benchmark/benchmark.h>
 #include <grpc++/impl/grpc_library.h>
diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc
index 7d0371b..94adbcb 100644
--- a/test/cpp/naming/resolver_component_test.cc
+++ b/test/cpp/naming/resolver_component_test.cc
@@ -32,7 +32,6 @@
 #include "test/cpp/util/subprocess.h"
 #include "test/cpp/util/test_config.h"
 
-extern "C" {
 #include "src/core/ext/filters/client_channel/client_channel.h"
 #include "src/core/ext/filters/client_channel/resolver.h"
 #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
@@ -47,10 +46,9 @@
 #include "src/core/lib/support/string.h"
 #include "test/core/util/port.h"
 #include "test/core/util/test_config.h"
-}
 
-using std::vector;
 using grpc::SubProcess;
+using std::vector;
 using testing::UnorderedElementsAreArray;
 
 // Hack copied from "test/cpp/end2end/server_crash_test_client.cc"!
@@ -85,12 +83,12 @@
   GrpcLBAddress(std::string address, bool is_balancer)
       : is_balancer(is_balancer), address(address) {}
 
-  bool operator==(const GrpcLBAddress &other) const {
+  bool operator==(const GrpcLBAddress& other) const {
     return this->is_balancer == other.is_balancer &&
            this->address == other.address;
   }
 
-  bool operator!=(const GrpcLBAddress &other) const {
+  bool operator!=(const GrpcLBAddress& other) const {
     return !(*this == other);
   }
 
@@ -141,19 +139,19 @@
 struct ArgsStruct {
   gpr_event ev;
   gpr_atm done_atm;
-  gpr_mu *mu;
-  grpc_pollset *pollset;
-  grpc_pollset_set *pollset_set;
-  grpc_combiner *lock;
-  grpc_channel_args *channel_args;
+  gpr_mu* mu;
+  grpc_pollset* pollset;
+  grpc_pollset_set* pollset_set;
+  grpc_combiner* lock;
+  grpc_channel_args* channel_args;
   vector<GrpcLBAddress> expected_addrs;
   std::string expected_service_config_string;
   std::string expected_lb_policy;
 };
 
-void ArgsInit(grpc_exec_ctx *exec_ctx, ArgsStruct *args) {
+void ArgsInit(grpc_exec_ctx* exec_ctx, ArgsStruct* args) {
   gpr_event_init(&args->ev);
-  args->pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size());
+  args->pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
   grpc_pollset_init(args->pollset, &args->mu);
   args->pollset_set = grpc_pollset_set_create();
   grpc_pollset_set_add_pollset(exec_ctx, args->pollset_set, args->pollset);
@@ -162,9 +160,9 @@
   args->channel_args = NULL;
 }
 
-void DoNothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {}
+void DoNothing(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {}
 
-void ArgsFinish(grpc_exec_ctx *exec_ctx, ArgsStruct *args) {
+void ArgsFinish(grpc_exec_ctx* exec_ctx, ArgsStruct* args) {
   GPR_ASSERT(gpr_event_wait(&args->ev, TestDeadline()));
   grpc_pollset_set_del_pollset(exec_ctx, args->pollset_set, args->pollset);
   grpc_pollset_set_destroy(exec_ctx, args->pollset_set);
@@ -184,7 +182,7 @@
                       gpr_time_from_seconds(seconds, GPR_TIMESPAN));
 }
 
-void PollPollsetUntilRequestDone(ArgsStruct *args) {
+void PollPollsetUntilRequestDone(ArgsStruct* args) {
   gpr_timespec deadline = NSecondDeadline(10);
   while (true) {
     bool done = gpr_atm_acq_load(&args->done_atm) != 0;
@@ -196,7 +194,7 @@
     gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRId64 ".%09d", done,
             time_left.tv_sec, time_left.tv_nsec);
     GPR_ASSERT(gpr_time_cmp(time_left, gpr_time_0(GPR_TIMESPAN)) >= 0);
-    grpc_pollset_worker *worker = NULL;
+    grpc_pollset_worker* worker = NULL;
     grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
     gpr_mu_lock(args->mu);
     GRPC_LOG_IF_ERROR("pollset_work",
@@ -206,12 +204,12 @@
     gpr_mu_unlock(args->mu);
     grpc_exec_ctx_finish(&exec_ctx);
   }
-  gpr_event_set(&args->ev, (void *)1);
+  gpr_event_set(&args->ev, (void*)1);
 }
 
-void CheckServiceConfigResultLocked(grpc_channel_args *channel_args,
-                                    ArgsStruct *args) {
-  const grpc_arg *service_config_arg =
+void CheckServiceConfigResultLocked(grpc_channel_args* channel_args,
+                                    ArgsStruct* args) {
+  const grpc_arg* service_config_arg =
       grpc_channel_args_find(channel_args, GRPC_ARG_SERVICE_CONFIG);
   if (args->expected_service_config_string != "") {
     GPR_ASSERT(service_config_arg != NULL);
@@ -223,9 +221,9 @@
   }
 }
 
-void CheckLBPolicyResultLocked(grpc_channel_args *channel_args,
-                               ArgsStruct *args) {
-  const grpc_arg *lb_policy_arg =
+void CheckLBPolicyResultLocked(grpc_channel_args* channel_args,
+                               ArgsStruct* args) {
+  const grpc_arg* lb_policy_arg =
       grpc_channel_args_find(channel_args, GRPC_ARG_LB_POLICY_NAME);
   if (args->expected_lb_policy != "") {
     GPR_ASSERT(lb_policy_arg != NULL);
@@ -236,23 +234,23 @@
   }
 }
 
-void CheckResolverResultLocked(grpc_exec_ctx *exec_ctx, void *argsp,
-                               grpc_error *err) {
-  ArgsStruct *args = (ArgsStruct *)argsp;
-  grpc_channel_args *channel_args = args->channel_args;
-  const grpc_arg *channel_arg =
+void CheckResolverResultLocked(grpc_exec_ctx* exec_ctx, void* argsp,
+                               grpc_error* err) {
+  ArgsStruct* args = (ArgsStruct*)argsp;
+  grpc_channel_args* channel_args = args->channel_args;
+  const grpc_arg* channel_arg =
       grpc_channel_args_find(channel_args, GRPC_ARG_LB_ADDRESSES);
   GPR_ASSERT(channel_arg != NULL);
   GPR_ASSERT(channel_arg->type == GRPC_ARG_POINTER);
-  grpc_lb_addresses *addresses =
-      (grpc_lb_addresses *)channel_arg->value.pointer.p;
+  grpc_lb_addresses* addresses =
+      (grpc_lb_addresses*)channel_arg->value.pointer.p;
   gpr_log(GPR_INFO, "num addrs found: %" PRIdPTR ". expected %" PRIdPTR,
           addresses->num_addresses, args->expected_addrs.size());
   GPR_ASSERT(addresses->num_addresses == args->expected_addrs.size());
   std::vector<GrpcLBAddress> found_lb_addrs;
   for (size_t i = 0; i < addresses->num_addresses; i++) {
     grpc_lb_address addr = addresses->addresses[i];
-    char *str;
+    char* str;
     grpc_sockaddr_to_string(&str, &addr.address, 1 /* normalize */);
     gpr_log(GPR_INFO, "%s", str);
     found_lb_addrs.emplace_back(
@@ -260,8 +258,9 @@
     gpr_free(str);
   }
   if (args->expected_addrs.size() != found_lb_addrs.size()) {
-    gpr_log(GPR_DEBUG, "found lb addrs size is: %" PRIdPTR
-                       ". expected addrs size is %" PRIdPTR,
+    gpr_log(GPR_DEBUG,
+            "found lb addrs size is: %" PRIdPTR
+            ". expected addrs size is %" PRIdPTR,
             found_lb_addrs.size(), args->expected_addrs.size());
     abort();
   }
@@ -285,17 +284,17 @@
   args.expected_service_config_string = FLAGS_expected_chosen_service_config;
   args.expected_lb_policy = FLAGS_expected_lb_policy;
   // maybe build the address with an authority
-  char *whole_uri = NULL;
+  char* whole_uri = NULL;
   GPR_ASSERT(asprintf(&whole_uri, "dns://%s/%s",
                       FLAGS_local_dns_server_address.c_str(),
                       FLAGS_target_name.c_str()));
   // create resolver and resolve
-  grpc_resolver *resolver = grpc_resolver_create(&exec_ctx, whole_uri, NULL,
+  grpc_resolver* resolver = grpc_resolver_create(&exec_ctx, whole_uri, NULL,
                                                  args.pollset_set, args.lock);
   gpr_free(whole_uri);
   grpc_closure on_resolver_result_changed;
   GRPC_CLOSURE_INIT(&on_resolver_result_changed, CheckResolverResultLocked,
-                    (void *)&args, grpc_combiner_scheduler(args.lock));
+                    (void*)&args, grpc_combiner_scheduler(args.lock));
   grpc_resolver_next_locked(&exec_ctx, resolver, &args.channel_args,
                             &on_resolver_result_changed);
   grpc_exec_ctx_flush(&exec_ctx);
@@ -307,7 +306,7 @@
 
 }  // namespace
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
   grpc_init();
   grpc_test_init(argc, argv);
   ::testing::InitGoogleTest(&argc, argv);
diff --git a/test/cpp/naming/resolver_component_tests_runner_invoker.cc b/test/cpp/naming/resolver_component_tests_runner_invoker.cc
index b143912..7ea005c 100644
--- a/test/cpp/naming/resolver_component_tests_runner_invoker.cc
+++ b/test/cpp/naming/resolver_component_tests_runner_invoker.cc
@@ -32,10 +32,8 @@
 #include "test/cpp/util/subprocess.h"
 #include "test/cpp/util/test_config.h"
 
-extern "C" {
 #include "src/core/lib/support/env.h"
 #include "test/core/util/port.h"
-}
 
 DEFINE_bool(
     running_under_bazel, false,
@@ -70,8 +68,8 @@
 
 const int kTestTimeoutSeconds = 60 * 2;
 
-void RunSigHandlingThread(SubProcess *test_driver, gpr_mu *test_driver_mu,
-                          gpr_cv *test_driver_cv, int *test_driver_done) {
+void RunSigHandlingThread(SubProcess* test_driver, gpr_mu* test_driver_mu,
+                          gpr_cv* test_driver_cv, int* test_driver_done) {
   gpr_timespec overall_deadline =
       gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
                    gpr_time_from_seconds(kTestTimeoutSeconds, GPR_TIMESPAN));
@@ -94,7 +92,7 @@
   test_driver->Interrupt();
   return;
 }
-}
+}  // namespace
 
 namespace grpc {
 
@@ -106,7 +104,7 @@
                                         std::string records_config_path) {
   int test_dns_server_port = grpc_pick_unused_port_or_die();
 
-  SubProcess *test_driver = new SubProcess(
+  SubProcess* test_driver = new SubProcess(
       {test_runner_bin_path, "--test_bin_path=" + test_bin_path,
        "--dns_server_bin_path=" + dns_server_bin_path,
        "--records_config_path=" + records_config_path,
@@ -153,7 +151,7 @@
 
 }  // namespace grpc
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
   grpc::testing::InitTest(&argc, &argv, true);
   grpc_init();
   GPR_ASSERT(FLAGS_test_bin_name != "");
diff --git a/test/cpp/performance/writes_per_rpc_test.cc b/test/cpp/performance/writes_per_rpc_test.cc
index f4f794c..6c23245 100644
--- a/test/cpp/performance/writes_per_rpc_test.cc
+++ b/test/cpp/performance/writes_per_rpc_test.cc
@@ -26,7 +26,6 @@
 #include <grpc/support/log.h>
 #include <gtest/gtest.h>
 
-extern "C" {
 #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
 #include "src/core/lib/channel/channel_args.h"
 #include "src/core/lib/iomgr/endpoint.h"
@@ -38,7 +37,7 @@
 #include "src/core/lib/surface/server.h"
 #include "test/core/util/passthru_endpoint.h"
 #include "test/core/util/port.h"
-}
+
 #include "src/cpp/client/create_channel_internal.h"
 #include "src/proto/grpc/testing/echo.grpc.pb.h"
 #include "test/core/util/test_config.h"
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index 48c8995..82c6361 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -230,8 +230,6 @@
   }
 
   virtual void DestroyMultithreading() = 0;
-  virtual void InitThreadFunc(size_t thread_idx) = 0;
-  virtual bool ThreadFunc(HistogramEntry* histogram, size_t thread_idx) = 0;
 
   void SetupLoadTest(const ClientConfig& config, size_t num_threads) {
     // Set up the load distribution based on the number of threads
@@ -279,7 +277,6 @@
                         : std::bind(&Client::NextIssueTime, this, thread_idx);
   }
 
- private:
   class Thread {
    public:
     Thread(Client* client, size_t idx)
@@ -299,6 +296,16 @@
       MergeStatusHistogram(statuses_, s);
     }
 
+    void UpdateHistogram(HistogramEntry* entry) {
+      std::lock_guard<std::mutex> g(mu_);
+      if (entry->value_used()) {
+        histogram_.Add(entry->value());
+      }
+      if (entry->status_used()) {
+        statuses_[entry->status()]++;
+      }
+    }
+
    private:
     Thread(const Thread&);
     Thread& operator=(const Thread&);
@@ -314,29 +321,8 @@
         wait_loop++;
       }
 
-      client_->InitThreadFunc(idx_);
-
-      for (;;) {
-        // run the loop body
-        HistogramEntry entry;
-        const bool thread_still_ok = client_->ThreadFunc(&entry, idx_);
-        // lock, update histogram if needed and see if we're done
-        std::lock_guard<std::mutex> g(mu_);
-        if (entry.value_used()) {
-          histogram_.Add(entry.value());
-        }
-        if (entry.status_used()) {
-          statuses_[entry.status()]++;
-        }
-        if (!thread_still_ok) {
-          gpr_log(GPR_ERROR, "Finishing client thread due to RPC error");
-        }
-        if (!thread_still_ok ||
-            static_cast<bool>(gpr_atm_acq_load(&client_->thread_pool_done_))) {
-          client_->CompleteThread();
-          return;
-        }
-      }
+      client_->ThreadFunc(idx_, this);
+      client_->CompleteThread();
     }
 
     std::mutex mu_;
@@ -347,6 +333,12 @@
     std::thread impl_;
   };
 
+  bool ThreadCompleted() {
+    return static_cast<bool>(gpr_atm_acq_load(&thread_pool_done_));
+  }
+
+  virtual void ThreadFunc(size_t thread_idx, Client::Thread* t) = 0;
+
   std::vector<std::unique_ptr<Thread>> threads_;
   std::unique_ptr<UsageTimer> timer_;
 
@@ -433,9 +425,6 @@
             !config.security_params().use_test_ca(),
             std::shared_ptr<CallCredentials>(), args);
         gpr_log(GPR_INFO, "Connecting to %s", target.c_str());
-        GPR_ASSERT(channel_->WaitForConnected(
-            gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                         gpr_time_from_seconds(300, GPR_TIMESPAN))));
         is_inproc_ = false;
       } else {
         grpc::string tgt = target;
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index 9ed4e0b..f7cdfc2 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -149,9 +149,9 @@
   // Specify which protected members we are using since there is no
   // member name resolution until the template types are fully resolved
  public:
+  using Client::NextIssuer;
   using Client::SetupLoadTest;
   using Client::closed_loop_;
-  using Client::NextIssuer;
   using ClientImpl<StubType, RequestType>::cores_;
   using ClientImpl<StubType, RequestType>::channels_;
   using ClientImpl<StubType, RequestType>::request_;
@@ -236,32 +236,46 @@
     this->EndThreads();  // this needed for resolution
   }
 
-  void InitThreadFunc(size_t thread_idx) override final {}
-  bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) override final {
+  void ThreadFunc(size_t thread_idx, Client::Thread* t) override final {
     void* got_tag;
     bool ok;
 
-    if (cli_cqs_[cq_[thread_idx]]->Next(&got_tag, &ok)) {
+    HistogramEntry entry;
+    HistogramEntry* entry_ptr = &entry;
+    if (!cli_cqs_[cq_[thread_idx]]->Next(&got_tag, &ok)) {
+      return;
+    }
+    ClientRpcContext* ctx = ClientRpcContext::detag(got_tag);
+    std::mutex* shutdown_mu = &shutdown_state_[thread_idx]->mutex;
+    shutdown_mu->lock();
+    while (cli_cqs_[cq_[thread_idx]]->DoThenAsyncNext(
+        [&, ctx, ok, entry_ptr, shutdown_mu]() {
+          if (!ctx->RunNextState(ok, entry_ptr)) {
+            // The RPC and callback are done, so clone the ctx
+            // and kickstart the new one
+            ctx->StartNewClone(cli_cqs_[cq_[thread_idx]].get());
+            delete ctx;
+          }
+          shutdown_mu->unlock();
+        },
+        &got_tag, &ok, gpr_inf_future(GPR_CLOCK_REALTIME))) {
+      t->UpdateHistogram(entry_ptr);
       // Got a regular event, so process it
-      ClientRpcContext* ctx = ClientRpcContext::detag(got_tag);
+      ctx = ClientRpcContext::detag(got_tag);
       // Proceed while holding a lock to make sure that
       // this thread isn't supposed to shut down
-      std::lock_guard<std::mutex> l(shutdown_state_[thread_idx]->mutex);
+      shutdown_mu->lock();
       if (shutdown_state_[thread_idx]->shutdown) {
         ctx->TryCancel();
         delete ctx;
-        return true;
+        while (cli_cqs_[cq_[thread_idx]]->Next(&got_tag, &ok)) {
+          ctx = ClientRpcContext::detag(got_tag);
+          ctx->TryCancel();
+          delete ctx;
+        }
+        shutdown_mu->unlock();
+        return;
       }
-      if (!ctx->RunNextState(ok, entry)) {
-        // The RPC and callback are done, so clone the ctx
-        // and kickstart the new one
-        ctx->StartNewClone(cli_cqs_[cq_[thread_idx]].get());
-        delete ctx;
-      }
-      return true;
-    } else {
-      // queue is shutting down, so we must be  done
-      return true;
     }
   }
 
diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc
index 94554a4..9f20b14 100644
--- a/test/cpp/qps/client_sync.cc
+++ b/test/cpp/qps/client_sync.cc
@@ -62,6 +62,25 @@
 
   virtual ~SynchronousClient(){};
 
+  virtual void InitThreadFuncImpl(size_t thread_idx) = 0;
+  virtual bool ThreadFuncImpl(HistogramEntry* entry, size_t thread_idx) = 0;
+
+  void ThreadFunc(size_t thread_idx, Thread* t) override {
+    InitThreadFuncImpl(thread_idx);
+    for (;;) {
+      // run the loop body
+      HistogramEntry entry;
+      const bool thread_still_ok = ThreadFuncImpl(&entry, thread_idx);
+      t->UpdateHistogram(&entry);
+      if (!thread_still_ok) {
+        gpr_log(GPR_ERROR, "Finishing client thread due to RPC error");
+      }
+      if (!thread_still_ok || ThreadCompleted()) {
+        return;
+      }
+    }
+  }
+
  protected:
   // WaitToIssue returns false if we realize that we need to break out
   bool WaitToIssue(int thread_idx) {
@@ -103,9 +122,9 @@
   }
   ~SynchronousUnaryClient() {}
 
-  void InitThreadFunc(size_t thread_idx) override {}
+  void InitThreadFuncImpl(size_t thread_idx) override {}
 
-  bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) override {
+  bool ThreadFuncImpl(HistogramEntry* entry, size_t thread_idx) override {
     if (!WaitToIssue(thread_idx)) {
       return true;
     }
@@ -192,13 +211,13 @@
     }
   }
 
-  void InitThreadFunc(size_t thread_idx) override {
+  void InitThreadFuncImpl(size_t thread_idx) override {
     auto* stub = channels_[thread_idx % channels_.size()].get_stub();
     stream_[thread_idx] = stub->StreamingCall(&context_[thread_idx]);
     messages_issued_[thread_idx] = 0;
   }
 
-  bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) override {
+  bool ThreadFuncImpl(HistogramEntry* entry, size_t thread_idx) override {
     if (!WaitToIssue(thread_idx)) {
       return true;
     }
@@ -246,14 +265,14 @@
     }
   }
 
-  void InitThreadFunc(size_t thread_idx) override {
+  void InitThreadFuncImpl(size_t thread_idx) override {
     auto* stub = channels_[thread_idx % channels_.size()].get_stub();
     stream_[thread_idx] = stub->StreamingFromClient(&context_[thread_idx],
                                                     &responses_[thread_idx]);
     last_issue_[thread_idx] = UsageTimer::Now();
   }
 
-  bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) override {
+  bool ThreadFuncImpl(HistogramEntry* entry, size_t thread_idx) override {
     // Figure out how to make histogram sensible if this is rate-paced
     if (!WaitToIssue(thread_idx)) {
       return true;
@@ -282,13 +301,13 @@
  public:
   SynchronousStreamingFromServerClient(const ClientConfig& config)
       : SynchronousStreamingClient(config), last_recv_(num_threads_) {}
-  void InitThreadFunc(size_t thread_idx) override {
+  void InitThreadFuncImpl(size_t thread_idx) override {
     auto* stub = channels_[thread_idx % channels_.size()].get_stub();
     stream_[thread_idx] =
         stub->StreamingFromServer(&context_[thread_idx], request_);
     last_recv_[thread_idx] = UsageTimer::Now();
   }
-  bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) override {
+  bool ThreadFuncImpl(HistogramEntry* entry, size_t thread_idx) override {
     GPR_TIMER_SCOPE("SynchronousStreamingFromServerClient::ThreadFunc", 0);
     if (stream_[thread_idx]->Read(&responses_[thread_idx])) {
       double now = UsageTimer::Now();
@@ -328,11 +347,11 @@
     }
   }
 
-  void InitThreadFunc(size_t thread_idx) override {
+  void InitThreadFuncImpl(size_t thread_idx) override {
     auto* stub = channels_[thread_idx % channels_.size()].get_stub();
     stream_[thread_idx] = stub->StreamingBothWays(&context_[thread_idx]);
   }
-  bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) override {
+  bool ThreadFuncImpl(HistogramEntry* entry, size_t thread_idx) override {
     // TODO (vjpai): Do this
     return true;
   }
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc
index 5504c0b..22d039d 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -43,10 +43,10 @@
 #include "test/cpp/qps/stats.h"
 #include "test/cpp/util/test_credentials_provider.h"
 
+using std::deque;
 using std::list;
 using std::thread;
 using std::unique_ptr;
-using std::deque;
 using std::vector;
 
 namespace grpc {
@@ -147,9 +147,8 @@
     result->mutable_summary()->set_server_cpu_usage(0);
   } else {
     auto server_cpu_usage =
-        100 -
-        100 * average(result->server_stats(), ServerIdleCpuTime) /
-            average(result->server_stats(), ServerTotalCpuTime);
+        100 - 100 * average(result->server_stats(), ServerIdleCpuTime) /
+                  average(result->server_stats(), ServerTotalCpuTime);
     result->mutable_summary()->set_server_cpu_usage(server_cpu_usage);
   }
 
diff --git a/test/cpp/qps/histogram.h b/test/cpp/qps/histogram.h
index 3d04ee5..e31d5d7 100644
--- a/test/cpp/qps/histogram.h
+++ b/test/cpp/qps/histogram.h
@@ -70,7 +70,7 @@
 
   gpr_histogram* impl_;
 };
-}
-}
+}  // namespace testing
+}  // namespace grpc
 
 #endif /* TEST_QPS_HISTOGRAM_H */
diff --git a/test/cpp/qps/interarrival.h b/test/cpp/qps/interarrival.h
index 1fa310c..9c48066 100644
--- a/test/cpp/qps/interarrival.h
+++ b/test/cpp/qps/interarrival.h
@@ -102,7 +102,7 @@
   std::vector<time_table::const_iterator> thread_posns_;
   time_table random_table_;
 };
-}
-}
+}  // namespace testing
+}  // namespace grpc
 
 #endif
diff --git a/test/cpp/qps/parse_json.cc b/test/cpp/qps/parse_json.cc
index 343e073..a98ae39 100644
--- a/test/cpp/qps/parse_json.cc
+++ b/test/cpp/qps/parse_json.cc
@@ -61,5 +61,5 @@
   return json_string;
 }
 
-}  // testing
-}  // grpc
+}  // namespace testing
+}  // namespace grpc
diff --git a/test/cpp/qps/parse_json.h b/test/cpp/qps/parse_json.h
index b320d26..f2fffb5 100644
--- a/test/cpp/qps/parse_json.h
+++ b/test/cpp/qps/parse_json.h
@@ -31,7 +31,7 @@
 grpc::string SerializeJson(const GRPC_CUSTOM_MESSAGE& msg,
                            const grpc::string& type);
 
-}  // testing
-}  // grpc
+}  // namespace testing
+}  // namespace grpc
 
 #endif  // TEST_QPS_PARSE_JSON_H
diff --git a/test/cpp/qps/qps_interarrival_test.cc b/test/cpp/qps/qps_interarrival_test.cc
index 87f09e8..461bf62 100644
--- a/test/cpp/qps/qps_interarrival_test.cc
+++ b/test/cpp/qps/qps_interarrival_test.cc
@@ -25,13 +25,13 @@
 #include "test/cpp/qps/interarrival.h"
 #include "test/cpp/util/test_config.h"
 
-using grpc::testing::RandomDistInterface;
 using grpc::testing::InterarrivalTimer;
+using grpc::testing::RandomDistInterface;
 
-static void RunTest(RandomDistInterface &&r, int threads, std::string title) {
+static void RunTest(RandomDistInterface&& r, int threads, std::string title) {
   InterarrivalTimer timer;
   timer.init(r, threads);
-  gpr_histogram *h(gpr_histogram_create(0.01, 60e9));
+  gpr_histogram* h(gpr_histogram_create(0.01, 60e9));
 
   for (int i = 0; i < 10000000; i++) {
     for (int j = 0; j < threads; j++) {
@@ -50,7 +50,7 @@
 
 using grpc::testing::ExpDist;
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
   grpc::testing::InitTest(&argc, &argv, true);
 
   RunTest(ExpDist(10.0), 5, std::string("Exponential(10)"));
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index 776371a..23c7e85 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -48,30 +48,30 @@
 class AsyncQpsServerTest final : public grpc::testing::Server {
  public:
   AsyncQpsServerTest(
-      const ServerConfig &config,
-      std::function<void(ServerBuilder *, ServiceType *)> register_service,
-      std::function<void(ServiceType *, ServerContextType *, RequestType *,
-                         ServerAsyncResponseWriter<ResponseType> *,
-                         CompletionQueue *, ServerCompletionQueue *, void *)>
+      const ServerConfig& config,
+      std::function<void(ServerBuilder*, ServiceType*)> register_service,
+      std::function<void(ServiceType*, ServerContextType*, RequestType*,
+                         ServerAsyncResponseWriter<ResponseType>*,
+                         CompletionQueue*, ServerCompletionQueue*, void*)>
           request_unary_function,
-      std::function<void(ServiceType *, ServerContextType *,
-                         ServerAsyncReaderWriter<ResponseType, RequestType> *,
-                         CompletionQueue *, ServerCompletionQueue *, void *)>
+      std::function<void(ServiceType*, ServerContextType*,
+                         ServerAsyncReaderWriter<ResponseType, RequestType>*,
+                         CompletionQueue*, ServerCompletionQueue*, void*)>
           request_streaming_function,
-      std::function<void(ServiceType *, ServerContextType *,
-                         ServerAsyncReader<ResponseType, RequestType> *,
-                         CompletionQueue *, ServerCompletionQueue *, void *)>
+      std::function<void(ServiceType*, ServerContextType*,
+                         ServerAsyncReader<ResponseType, RequestType>*,
+                         CompletionQueue*, ServerCompletionQueue*, void*)>
           request_streaming_from_client_function,
-      std::function<void(ServiceType *, ServerContextType *, RequestType *,
-                         ServerAsyncWriter<ResponseType> *, CompletionQueue *,
-                         ServerCompletionQueue *, void *)>
+      std::function<void(ServiceType*, ServerContextType*, RequestType*,
+                         ServerAsyncWriter<ResponseType>*, CompletionQueue*,
+                         ServerCompletionQueue*, void*)>
           request_streaming_from_server_function,
-      std::function<void(ServiceType *, ServerContextType *,
-                         ServerAsyncReaderWriter<ResponseType, RequestType> *,
-                         CompletionQueue *, ServerCompletionQueue *, void *)>
+      std::function<void(ServiceType*, ServerContextType*,
+                         ServerAsyncReaderWriter<ResponseType, RequestType>*,
+                         CompletionQueue*, ServerCompletionQueue*, void*)>
           request_streaming_both_ways_function,
-      std::function<grpc::Status(const PayloadConfig &, const RequestType *,
-                                 ResponseType *)>
+      std::function<grpc::Status(const PayloadConfig&, RequestType*,
+                                 ResponseType*)>
           process_rpc)
       : Server(config) {
     ServerBuilder builder;
@@ -79,7 +79,7 @@
     auto port_num = port();
     // Negative port number means inproc server, so no listen port needed
     if (port_num >= 0) {
-      char *server_address = NULL;
+      char* server_address = NULL;
       gpr_join_host_port(&server_address, "::", port_num);
       builder.AddListeningPort(server_address,
                                Server::CreateServerCredentials(config));
@@ -171,7 +171,7 @@
     }
     for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); ++cq) {
       bool ok;
-      void *got_tag;
+      void* got_tag;
       while ((*cq)->Next(&got_tag, &ok))
         ;
     }
@@ -187,7 +187,7 @@
   }
 
   std::shared_ptr<Channel> InProcessChannel(
-      const ChannelArguments &args) override {
+      const ChannelArguments& args) override {
     return server_->InProcessChannel(args);
   }
 
@@ -201,24 +201,32 @@
   void ThreadFunc(int thread_idx) {
     // Wait until work is available or we are shutting down
     bool ok;
-    void *got_tag;
-    while (srv_cqs_[cq_[thread_idx]]->Next(&got_tag, &ok)) {
-      ServerRpcContext *ctx = detag(got_tag);
+    void* got_tag;
+    if (!srv_cqs_[cq_[thread_idx]]->Next(&got_tag, &ok)) {
+      return;
+    }
+    ServerRpcContext* ctx;
+    std::mutex* mu_ptr = &shutdown_state_[thread_idx]->mutex;
+    do {
+      ctx = detag(got_tag);
       // The tag is a pointer to an RPC context to invoke
       // Proceed while holding a lock to make sure that
       // this thread isn't supposed to shut down
-      std::lock_guard<std::mutex> l(shutdown_state_[thread_idx]->mutex);
+      mu_ptr->lock();
       if (shutdown_state_[thread_idx]->shutdown) {
+        mu_ptr->unlock();
         return;
       }
-      std::lock_guard<ServerRpcContext> l2(*ctx);
-      const bool still_going = ctx->RunNextState(ok);
-      // if this RPC context is done, refresh it
-      if (!still_going) {
-        ctx->Reset();
-      }
-    }
-    return;
+    } while (srv_cqs_[cq_[thread_idx]]->DoThenAsyncNext(
+        [&, ctx, ok, mu_ptr]() {
+          ctx->lock();
+          if (!ctx->RunNextState(ok)) {
+            ctx->Reset();
+          }
+          ctx->unlock();
+          mu_ptr->unlock();
+        },
+        &got_tag, &ok, gpr_inf_future(GPR_CLOCK_REALTIME)));
   }
 
   class ServerRpcContext {
@@ -232,22 +240,21 @@
    private:
     std::mutex mu_;
   };
-  static void *tag(ServerRpcContext *func) {
-    return reinterpret_cast<void *>(func);
+  static void* tag(ServerRpcContext* func) {
+    return reinterpret_cast<void*>(func);
   }
-  static ServerRpcContext *detag(void *tag) {
-    return reinterpret_cast<ServerRpcContext *>(tag);
+  static ServerRpcContext* detag(void* tag) {
+    return reinterpret_cast<ServerRpcContext*>(tag);
   }
 
   class ServerRpcContextUnaryImpl final : public ServerRpcContext {
    public:
     ServerRpcContextUnaryImpl(
-        std::function<void(ServerContextType *, RequestType *,
-                           grpc::ServerAsyncResponseWriter<ResponseType> *,
-                           void *)>
+        std::function<void(ServerContextType*, RequestType*,
+                           grpc::ServerAsyncResponseWriter<ResponseType>*,
+                           void*)>
             request_method,
-        std::function<grpc::Status(const RequestType *, ResponseType *)>
-            invoke_method)
+        std::function<grpc::Status(RequestType*, ResponseType*)> invoke_method)
         : srv_ctx_(new ServerContextType),
           next_state_(&ServerRpcContextUnaryImpl::invoker),
           request_method_(request_method),
@@ -289,11 +296,10 @@
     RequestType req_;
     ResponseType response_;
     bool (ServerRpcContextUnaryImpl::*next_state_)(bool);
-    std::function<void(ServerContextType *, RequestType *,
-                       grpc::ServerAsyncResponseWriter<ResponseType> *, void *)>
+    std::function<void(ServerContextType*, RequestType*,
+                       grpc::ServerAsyncResponseWriter<ResponseType>*, void*)>
         request_method_;
-    std::function<grpc::Status(const RequestType *, ResponseType *)>
-        invoke_method_;
+    std::function<grpc::Status(RequestType*, ResponseType*)> invoke_method_;
     grpc::ServerAsyncResponseWriter<ResponseType> response_writer_;
   };
 
@@ -301,11 +307,10 @@
    public:
     ServerRpcContextStreamingImpl(
         std::function<void(
-            ServerContextType *,
-            grpc::ServerAsyncReaderWriter<ResponseType, RequestType> *, void *)>
+            ServerContextType*,
+            grpc::ServerAsyncReaderWriter<ResponseType, RequestType>*, void*)>
             request_method,
-        std::function<grpc::Status(const RequestType *, ResponseType *)>
-            invoke_method)
+        std::function<grpc::Status(RequestType*, ResponseType*)> invoke_method)
         : srv_ctx_(new ServerContextType),
           next_state_(&ServerRpcContextStreamingImpl::request_done),
           request_method_(request_method),
@@ -369,11 +374,10 @@
     ResponseType response_;
     bool (ServerRpcContextStreamingImpl::*next_state_)(bool);
     std::function<void(
-        ServerContextType *,
-        grpc::ServerAsyncReaderWriter<ResponseType, RequestType> *, void *)>
+        ServerContextType*,
+        grpc::ServerAsyncReaderWriter<ResponseType, RequestType>*, void*)>
         request_method_;
-    std::function<grpc::Status(const RequestType *, ResponseType *)>
-        invoke_method_;
+    std::function<grpc::Status(RequestType*, ResponseType*)> invoke_method_;
     grpc::ServerAsyncReaderWriter<ResponseType, RequestType> stream_;
   };
 
@@ -381,12 +385,11 @@
       : public ServerRpcContext {
    public:
     ServerRpcContextStreamingFromClientImpl(
-        std::function<void(ServerContextType *,
-                           grpc::ServerAsyncReader<ResponseType, RequestType> *,
-                           void *)>
+        std::function<void(ServerContextType*,
+                           grpc::ServerAsyncReader<ResponseType, RequestType>*,
+                           void*)>
             request_method,
-        std::function<grpc::Status(const RequestType *, ResponseType *)>
-            invoke_method)
+        std::function<grpc::Status(RequestType*, ResponseType*)> invoke_method)
         : srv_ctx_(new ServerContextType),
           next_state_(&ServerRpcContextStreamingFromClientImpl::request_done),
           request_method_(request_method),
@@ -439,12 +442,11 @@
     RequestType req_;
     ResponseType response_;
     bool (ServerRpcContextStreamingFromClientImpl::*next_state_)(bool);
-    std::function<void(ServerContextType *,
-                       grpc::ServerAsyncReader<ResponseType, RequestType> *,
-                       void *)>
+    std::function<void(ServerContextType*,
+                       grpc::ServerAsyncReader<ResponseType, RequestType>*,
+                       void*)>
         request_method_;
-    std::function<grpc::Status(const RequestType *, ResponseType *)>
-        invoke_method_;
+    std::function<grpc::Status(RequestType*, ResponseType*)> invoke_method_;
     grpc::ServerAsyncReader<ResponseType, RequestType> stream_;
   };
 
@@ -452,11 +454,10 @@
       : public ServerRpcContext {
    public:
     ServerRpcContextStreamingFromServerImpl(
-        std::function<void(ServerContextType *, RequestType *,
-                           grpc::ServerAsyncWriter<ResponseType> *, void *)>
+        std::function<void(ServerContextType*, RequestType*,
+                           grpc::ServerAsyncWriter<ResponseType>*, void*)>
             request_method,
-        std::function<grpc::Status(const RequestType *, ResponseType *)>
-            invoke_method)
+        std::function<grpc::Status(RequestType*, ResponseType*)> invoke_method)
         : srv_ctx_(new ServerContextType),
           next_state_(&ServerRpcContextStreamingFromServerImpl::request_done),
           request_method_(request_method),
@@ -509,11 +510,10 @@
     RequestType req_;
     ResponseType response_;
     bool (ServerRpcContextStreamingFromServerImpl::*next_state_)(bool);
-    std::function<void(ServerContextType *, RequestType *,
-                       grpc::ServerAsyncWriter<ResponseType> *, void *)>
+    std::function<void(ServerContextType*, RequestType*,
+                       grpc::ServerAsyncWriter<ResponseType>*, void*)>
         request_method_;
-    std::function<grpc::Status(const RequestType *, ResponseType *)>
-        invoke_method_;
+    std::function<grpc::Status(RequestType*, ResponseType*)> invoke_method_;
     grpc::ServerAsyncWriter<ResponseType> stream_;
   };
 
@@ -533,30 +533,34 @@
   std::vector<std::unique_ptr<PerThreadShutdownState>> shutdown_state_;
 };
 
-static void RegisterBenchmarkService(ServerBuilder *builder,
-                                     BenchmarkService::AsyncService *service) {
+static void RegisterBenchmarkService(ServerBuilder* builder,
+                                     BenchmarkService::AsyncService* service) {
   builder->RegisterService(service);
 }
-static void RegisterGenericService(ServerBuilder *builder,
-                                   grpc::AsyncGenericService *service) {
+static void RegisterGenericService(ServerBuilder* builder,
+                                   grpc::AsyncGenericService* service) {
   builder->RegisterAsyncGenericService(service);
 }
 
-static Status ProcessSimpleRPC(const PayloadConfig &,
-                               const SimpleRequest *request,
-                               SimpleResponse *response) {
+static Status ProcessSimpleRPC(const PayloadConfig&, SimpleRequest* request,
+                               SimpleResponse* response) {
   if (request->response_size() > 0) {
     if (!Server::SetPayload(request->response_type(), request->response_size(),
                             response->mutable_payload())) {
       return Status(grpc::StatusCode::INTERNAL, "Error creating payload.");
     }
   }
+  // We are done using the request. Clear it to reduce working memory.
+  // This proves to reduce cache misses in large message size cases.
+  request->Clear();
   return Status::OK;
 }
 
-static Status ProcessGenericRPC(const PayloadConfig &payload_config,
-                                const ByteBuffer *request,
-                                ByteBuffer *response) {
+static Status ProcessGenericRPC(const PayloadConfig& payload_config,
+                                ByteBuffer* request, ByteBuffer* response) {
+  // We are done using the request. Clear it to reduce working memory.
+  // This proves to reduce cache misses in large message size cases.
+  request->Clear();
   int resp_size = payload_config.bytebuf_params().resp_size();
   std::unique_ptr<char[]> buf(new char[resp_size]);
   Slice slice(buf.get(), resp_size);
@@ -564,7 +568,7 @@
   return Status::OK;
 }
 
-std::unique_ptr<Server> CreateAsyncServer(const ServerConfig &config) {
+std::unique_ptr<Server> CreateAsyncServer(const ServerConfig& config) {
   return std::unique_ptr<Server>(
       new AsyncQpsServerTest<SimpleRequest, SimpleResponse,
                              BenchmarkService::AsyncService,
@@ -577,7 +581,7 @@
           &BenchmarkService::AsyncService::RequestStreamingBothWays,
           ProcessSimpleRPC));
 }
-std::unique_ptr<Server> CreateAsyncGenericServer(const ServerConfig &config) {
+std::unique_ptr<Server> CreateAsyncGenericServer(const ServerConfig& config) {
   return std::unique_ptr<Server>(
       new AsyncQpsServerTest<ByteBuffer, ByteBuffer, grpc::AsyncGenericService,
                              grpc::GenericServerContext>(
diff --git a/test/cpp/test/server_context_test_spouse_test.cc b/test/cpp/test/server_context_test_spouse_test.cc
index c1ddb00..d1dc9d7 100644
--- a/test/cpp/test/server_context_test_spouse_test.cc
+++ b/test/cpp/test/server_context_test_spouse_test.cc
@@ -87,7 +87,7 @@
   ASSERT_EQ(metadata, spouse.GetTrailingMetadata());
 }
 
-}  // namespace
+}  // namespace testing
 }  // namespace grpc
 
 int main(int argc, char** argv) {
diff --git a/test/cpp/thread_manager/thread_manager_test.cc b/test/cpp/thread_manager/thread_manager_test.cc
index 85e58f4..af90d44 100644
--- a/test/cpp/thread_manager/thread_manager_test.cc
+++ b/test/cpp/thread_manager/thread_manager_test.cc
@@ -37,8 +37,8 @@
         num_poll_for_work_(0),
         num_work_found_(0) {}
 
-  grpc::ThreadManager::WorkStatus PollForWork(void **tag, bool *ok) override;
-  void DoWork(void *tag, bool ok) override;
+  grpc::ThreadManager::WorkStatus PollForWork(void** tag, bool* ok) override;
+  void DoWork(void* tag, bool ok) override;
   void PerformTest();
 
  private:
@@ -65,8 +65,8 @@
   gpr_sleep_until(sleep_time);
 }
 
-grpc::ThreadManager::WorkStatus ThreadManagerTest::PollForWork(void **tag,
-                                                               bool *ok) {
+grpc::ThreadManager::WorkStatus ThreadManagerTest::PollForWork(void** tag,
+                                                               bool* ok) {
   int call_num = gpr_atm_no_barrier_fetch_add(&num_poll_for_work_, 1);
 
   if (call_num >= kMaxNumPollForWork) {
@@ -89,7 +89,7 @@
   }
 }
 
-void ThreadManagerTest::DoWork(void *tag, bool ok) {
+void ThreadManagerTest::DoWork(void* tag, bool ok) {
   gpr_atm_no_barrier_fetch_add(&num_do_work_, 1);
   SleepForMs(kDoWorkDurationMsec);  // Simulate doing work by sleeping
 }
@@ -110,7 +110,7 @@
 }
 }  // namespace grpc
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
   std::srand(std::time(NULL));
 
   grpc::testing::InitTest(&argc, &argv, true);
diff --git a/test/cpp/util/error_details_test.cc b/test/cpp/util/error_details_test.cc
index 69a6876..16a00fb 100644
--- a/test/cpp/util/error_details_test.cc
+++ b/test/cpp/util/error_details_test.cc
@@ -82,7 +82,7 @@
 
 TEST(SetTest, OutOfScopeErrorCode) {
   google::rpc::Status expected;
-  expected.set_code(20);  // Out of scope (DATA_LOSS is 15).
+  expected.set_code(17);  // Out of scope (UNAUTHENTICATED is 16).
   expected.set_message("I am an error message");
   testing::EchoRequest expected_details;
   expected_details.set_message(grpc::string(100, '\0'));
@@ -96,6 +96,24 @@
   EXPECT_EQ(expected.SerializeAsString(), to.error_details());
 }
 
+TEST(SetTest, ValidScopeErrorCode) {
+  for (int c = StatusCode::OK; c <= StatusCode::UNAUTHENTICATED; c++) {
+    google::rpc::Status expected;
+    expected.set_code(c);
+    expected.set_message("I am an error message");
+    testing::EchoRequest expected_details;
+    expected_details.set_message(grpc::string(100, '\0'));
+    expected.add_details()->PackFrom(expected_details);
+
+    Status to;
+    Status s = SetErrorDetails(expected, &to);
+    EXPECT_TRUE(s.ok());
+    EXPECT_EQ(c, to.error_code());
+    EXPECT_EQ(expected.message(), to.error_message());
+    EXPECT_EQ(expected.SerializeAsString(), to.error_details());
+  }
+}
+
 }  // namespace
 }  // namespace grpc
 
diff --git a/test/cpp/util/grpc_tool.h b/test/cpp/util/grpc_tool.h
index 076ce53..a10422f 100644
--- a/test/cpp/util/grpc_tool.h
+++ b/test/cpp/util/grpc_tool.h
@@ -28,9 +28,9 @@
 namespace grpc {
 namespace testing {
 
-typedef std::function<bool(const grpc::string &)> GrpcToolOutputCallback;
+typedef std::function<bool(const grpc::string&)> GrpcToolOutputCallback;
 
-int GrpcToolMainLib(int argc, const char **argv, const CliCredentials &cred,
+int GrpcToolMainLib(int argc, const char** argv, const CliCredentials& cred,
                     GrpcToolOutputCallback callback);
 
 }  // namespace testing
diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc
index 184828c..0f77934 100644
--- a/test/cpp/util/proto_reflection_descriptor_database.cc
+++ b/test/cpp/util/proto_reflection_descriptor_database.cc
@@ -22,11 +22,11 @@
 
 #include <grpc/support/log.h>
 
+using grpc::reflection::v1alpha::ErrorResponse;
+using grpc::reflection::v1alpha::ListServiceResponse;
 using grpc::reflection::v1alpha::ServerReflection;
 using grpc::reflection::v1alpha::ServerReflectionRequest;
 using grpc::reflection::v1alpha::ServerReflectionResponse;
-using grpc::reflection::v1alpha::ListServiceResponse;
-using grpc::reflection::v1alpha::ErrorResponse;
 
 namespace grpc {
 
diff --git a/test/cpp/util/service_describer.h b/test/cpp/util/service_describer.h
index b7a8c92..b7ab757 100644
--- a/test/cpp/util/service_describer.h
+++ b/test/cpp/util/service_describer.h
@@ -36,7 +36,7 @@
 
 grpc::string SummarizeMethod(const grpc::protobuf::MethodDescriptor* method);
 
-}  // namespase testing
+}  // namespace testing
 }  // namespace grpc
 
 #endif  // GRPC_TEST_CPP_UTIL_SERVICE_DESCRIBER_H
diff --git a/test/cpp/util/test_config_cc.cc b/test/cpp/util/test_config_cc.cc
index f7e0342..e4b6886 100644
--- a/test/cpp/util/test_config_cc.cc
+++ b/test/cpp/util/test_config_cc.cc
@@ -16,8 +16,8 @@
  *
  */
 
-#include "test/cpp/util/test_config.h"
 #include <gflags/gflags.h>
+#include "test/cpp/util/test_config.h"
 
 // In some distros, gflags is in the namespace google, and in some others,
 // in gflags. This hack is enabling us to find both.
diff --git a/test/distrib/node/distrib_test.js b/test/distrib/node/distrib_test.js
deleted file mode 100755
index 62191f0..0000000
--- a/test/distrib/node/distrib_test.js
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env node
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-var grpc = require('grpc');
-
-function identity(x) {
-  return x;
-}
-
-var Client = grpc.makeGenericClientConstructor({
-  'echo' : {
-    path: '/buffer/echo',
-    requestStream: false,
-    responseStream: false,
-    requestSerialize: identity,
-    requestDeserialize: identity,
-    responseSerialize: identity,
-    responseDeserialize: identity
-  }
-});
-
-var client = new Client("localhost:1000", grpc.credentials.createInsecure());
-
-client.$channel.close();
-
-console.log("Success!");
diff --git a/test/distrib/node/package.json b/test/distrib/node/package.json
deleted file mode 100644
index b02a796..0000000
--- a/test/distrib/node/package.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "name": "grpc-distrib-test",
-  "version": "0.0.1",
-  "dependencies": {
-    "grpc": "*"
-  }
-}
diff --git a/test/distrib/node/run_distrib_test.sh b/test/distrib/node/run_distrib_test.sh
deleted file mode 100755
index a806f84..0000000
--- a/test/distrib/node/run_distrib_test.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-function finish() {
-  rv=$?
-  kill $STATIC_PID || true
-  curl "localhost:32767/drop/$STATIC_PORT" || true
-  exit $rv
-}
-
-trap finish EXIT
-
-NODE_VERSION=$1
-source ~/.nvm/nvm.sh
-
-cd $(dirname $0)
-
-nvm install $NODE_VERSION
-set -ex
-
-npm install -g node-static
-
-STATIC_SERVER=127.0.0.1
-# If port_server is running, get port from that. Otherwise, assume we're in
-# docker and use 12345
-STATIC_PORT=$(curl 'localhost:32767/get' || echo '12345')
-
-# Serves the input_artifacts directory statically at localhost:
-static "$EXTERNAL_GIT_ROOT/input_artifacts" -a $STATIC_SERVER -p $STATIC_PORT &
-STATIC_PID=$!
-
-STATIC_URL="http://$STATIC_SERVER:$STATIC_PORT/"
-
-npm install --unsafe-perm $STATIC_URL/grpc.tgz --grpc_node_binary_host_mirror=$STATIC_URL
-
-./distrib_test.js
diff --git a/third_party/benchmark b/third_party/benchmark
index 44c25c8..5b7683f 160000
--- a/third_party/benchmark
+++ b/third_party/benchmark
@@ -1 +1 @@
-Subproject commit 44c25c892a6229b20db7cd9dc05584ea865896de
+Subproject commit 5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8
diff --git a/third_party/cares/cares.BUILD b/third_party/cares/cares.BUILD
index 978e9b1..8cc01b6 100644
--- a/third_party/cares/cares.BUILD
+++ b/third_party/cares/cares.BUILD
@@ -3,6 +3,34 @@
     values = {"cpu": "darwin"},
 )
 
+# Android is not officially supported through C++.
+# This just helps with the build for now.
+config_setting(
+    name = "android",
+    values = {
+      "crosstool_top": "//external:android/crosstool",
+    },
+)
+
+# iOS is not officially supported through C++.
+# This just helps with the build for now.
+config_setting(
+    name = "ios_x86_64",
+    values = {"cpu": "ios_x86_64"},
+)
+config_setting(
+    name = "ios_armv7",
+    values = {"cpu": "ios_armv7"},
+)
+config_setting(
+    name = "ios_armv7s",
+    values = {"cpu": "ios_armv7s"},
+)
+config_setting(
+    name = "ios_arm64",
+    values = {"cpu": "ios_arm64"},
+)
+
 cc_library(
     name = "ares",
     srcs = [
@@ -81,14 +109,24 @@
         "cares/nameser.h",
         "cares/setup_once.h",
     ] + select({
+        ":ios_x86_64": ["config_darwin/ares_config.h"],
+        ":ios_armv7": ["config_darwin/ares_config.h"],
+        ":ios_armv7s": ["config_darwin/ares_config.h"],
+        ":ios_arm64": ["config_darwin/ares_config.h"],
         ":darwin": ["config_darwin/ares_config.h"],
+        ":android": ["config_android/ares_config.h"],
         "//conditions:default": ["config_linux/ares_config.h"],
     }),
     includes = [
         ".",
         "cares"
     ] + select({
+        ":ios_x86_64": ["config_darwin"],
+        ":ios_armv7": ["config_darwin"],
+        ":ios_armv7s": ["config_darwin"],
+        ":ios_arm64": ["config_darwin"],
         ":darwin": ["config_darwin"],
+        ":android": ["config_android"],
         "//conditions:default": ["config_linux"],
     }),
     linkstatic = 1,
diff --git a/third_party/cares/config_android/ares_config.h b/third_party/cares/config_android/ares_config.h
new file mode 100644
index 0000000..2caf1b3
--- /dev/null
+++ b/third_party/cares/config_android/ares_config.h
@@ -0,0 +1,458 @@
+/* Generated from ares_config.h.cmake*/
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* define this if ares is built for a big endian system */
+#undef ARES_BIG_ENDIAN
+
+/* when building as static part of libcurl */
+#undef BUILDING_LIBCURL
+
+/* Defined for build that exposes internal static functions for testing. */
+#undef CARES_EXPOSE_STATICS
+
+/* Defined for build with symbol hiding. */
+#undef CARES_SYMBOL_HIDING
+
+/* Definition to make a library symbol externally visible. */
+#undef CARES_SYMBOL_SCOPE_EXTERN
+
+/* Use resolver library to configure cares */
+/* #undef CARES_USE_LIBRESOLV */
+
+/* if a /etc/inet dir is being used */
+#undef ETC_INET
+
+/* Define to the type of arg 2 for gethostname. */
+#define GETHOSTNAME_TYPE_ARG2 size_t
+
+/* Define to the type qualifier of arg 1 for getnameinfo. */
+#define GETNAMEINFO_QUAL_ARG1 
+
+/* Define to the type of arg 1 for getnameinfo. */
+#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
+
+/* Define to the type of arg 2 for getnameinfo. */
+#define GETNAMEINFO_TYPE_ARG2 socklen_t
+
+/* Define to the type of args 4 and 6 for getnameinfo. */
+#define GETNAMEINFO_TYPE_ARG46 socklen_t
+
+/* Define to the type of arg 7 for getnameinfo. */
+#define GETNAMEINFO_TYPE_ARG7 int
+
+/* Specifies the number of arguments to getservbyport_r */
+#define GETSERVBYPORT_R_ARGS
+
+/* Define to 1 if you have AF_INET6. */
+#define HAVE_AF_INET6
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
+#define HAVE_ARPA_NAMESER_COMPAT_H
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+#define HAVE_ARPA_NAMESER_H
+
+/* Define to 1 if you have the <assert.h> header file. */
+#define HAVE_ASSERT_H
+
+/* Define to 1 if you have the `bitncmp' function. */
+/* #undef HAVE_BITNCMP */
+
+/* Define to 1 if bool is an available type. */
+#define HAVE_BOOL_T
+
+/* Define HAVE_CLOCK_GETTIME_MONOTONIC if you have the clock_gettime
+ * function and monotonic timer.
+ *
+ * IMPORTANT: gRPC MANUAL EDIT HERE!
+ * Note: setting HAVE_CLOCK_GETTIME_MONOTONIC causes use of the clock_gettime
+ * function from glibc, don't set it to support glibc < 2.17 */
+#ifndef GPR_BACKWARDS_COMPATIBILITY_MODE
+  #define HAVE_CLOCK_GETTIME_MONOTONIC
+#endif
+
+/* Define to 1 if you have the closesocket function. */
+/* #undef HAVE_CLOSESOCKET */
+
+/* Define to 1 if you have the CloseSocket camel case function. */
+/* #undef HAVE_CLOSESOCKET_CAMEL */
+
+/* Define to 1 if you have the connect function. */
+#define HAVE_CONNECT
+
+/* define if the compiler supports basic C++11 syntax */
+/* #undef HAVE_CXX11 */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H
+
+/* Define to 1 if you have the fcntl function. */
+#define HAVE_FCNTL
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H
+
+/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
+#define HAVE_FCNTL_O_NONBLOCK
+
+/* Define to 1 if you have the freeaddrinfo function. */
+#define HAVE_FREEADDRINFO
+
+/* Define to 1 if you have a working getaddrinfo function. */
+#define HAVE_GETADDRINFO
+
+/* Define to 1 if the getaddrinfo function is threadsafe. */
+/* #undef HAVE_GETADDRINFO_THREADSAFE */
+
+/* Define to 1 if you have the getenv function. */
+#define HAVE_GETENV
+
+/* Define to 1 if you have the gethostbyaddr function. */
+#define HAVE_GETHOSTBYADDR
+
+/* Define to 1 if you have the gethostbyname function. */
+#define HAVE_GETHOSTBYNAME
+
+/* Define to 1 if you have the gethostname function. */
+#define HAVE_GETHOSTNAME
+
+/* Define to 1 if you have the getnameinfo function. */
+#define HAVE_GETNAMEINFO
+
+/* Define to 1 if you have the getservbyport_r function. */
+/* #undef HAVE_GETSERVBYPORT_R */
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `if_indextoname' function. */
+#define HAVE_IF_INDEXTONAME
+
+/* Define to 1 if you have a IPv6 capable working inet_net_pton function. */
+/* #undef HAVE_INET_NET_PTON */
+
+/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
+#define HAVE_INET_NTOP
+
+/* Define to 1 if you have a IPv6 capable working inet_pton function. */
+#define HAVE_INET_PTON
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H
+
+/* Define to 1 if you have the ioctl function. */
+#define HAVE_IOCTL
+
+/* Define to 1 if you have the ioctlsocket function. */
+/* #undef HAVE_IOCTLSOCKET */
+
+/* Define to 1 if you have the IoctlSocket camel case function. */
+/* #undef HAVE_IOCTLSOCKET_CAMEL */
+
+/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
+   */
+/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */
+
+/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
+/* #undef HAVE_IOCTLSOCKET_FIONBIO */
+
+/* Define to 1 if you have a working ioctl FIONBIO function. */
+#define HAVE_IOCTL_FIONBIO
+
+/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
+#define HAVE_IOCTL_SIOCGIFADDR
+
+/* Define to 1 if you have the `resolve' library (-lresolve). */
+/* #undef HAVE_LIBRESOLV */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H
+
+/* if your compiler supports LL */
+#define HAVE_LL
+
+/* Define to 1 if the compiler supports the 'long long' data type. */
+#define HAVE_LONGLONG
+
+/* Define to 1 if you have the malloc.h header file. */
+#define HAVE_MALLOC_H
+
+/* Define to 1 if you have the memory.h header file. */
+#define HAVE_MEMORY_H
+
+/* Define to 1 if you have the MSG_NOSIGNAL flag. */
+#define HAVE_MSG_NOSIGNAL
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#define HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#define HAVE_NETINET_TCP_H
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#define HAVE_NET_IF_H
+
+/* Define to 1 if you have PF_INET6. */
+#define HAVE_PF_INET6
+
+/* Define to 1 if you have the recv function. */
+#define HAVE_RECV
+
+/* Define to 1 if you have the recvfrom function. */
+#define HAVE_RECVFROM
+
+/* Define to 1 if you have the send function. */
+#define HAVE_SEND
+
+/* Define to 1 if you have the setsockopt function. */
+#define HAVE_SETSOCKOPT
+
+/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
+/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H
+
+/* Define to 1 if sig_atomic_t is an available typedef. */
+#define HAVE_SIG_ATOMIC_T
+
+/* Define to 1 if sig_atomic_t is already defined as volatile. */
+/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
+
+/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */
+#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
+
+/* Define to 1 if you have the socket function. */
+#define HAVE_SOCKET
+
+/* Define to 1 if you have the <socket.h> header file. */
+/* #undef HAVE_SOCKET_H */
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#define HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H
+
+/* Define to 1 if you have the strcasecmp function. */
+#define HAVE_STRCASECMP
+
+/* Define to 1 if you have the strcmpi function. */
+/* #undef HAVE_STRCMPI */
+
+/* Define to 1 if you have the strdup function. */
+#define HAVE_STRDUP
+
+/* Define to 1 if you have the stricmp function. */
+/* #undef HAVE_STRICMP */
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H
+
+/* Define to 1 if you have the strncasecmp function. */
+#define HAVE_STRNCASECMP
+
+/* Define to 1 if you have the strncmpi function. */
+/* #undef HAVE_STRNCMPI */
+
+/* Define to 1 if you have the strnicmp function. */
+/* #undef HAVE_STRNICMP */
+
+/* Define to 1 if you have the <stropts.h> header file. */
+#define HAVE_STROPTS_H
+
+/* Define to 1 if you have struct addrinfo. */
+#define HAVE_STRUCT_ADDRINFO
+
+/* Define to 1 if you have struct in6_addr. */
+#define HAVE_STRUCT_IN6_ADDR
+
+/* Define to 1 if you have struct sockaddr_in6. */
+#define HAVE_STRUCT_SOCKADDR_IN6
+
+/* if struct sockaddr_storage is defined */
+#define HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* Define to 1 if you have the timeval struct. */
+#define HAVE_STRUCT_TIMEVAL
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H
+
+/* Define to 1 if you have the windows.h header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* Define to 1 if you have the winsock2.h header file. */
+/* #undef HAVE_WINSOCK2_H */
+
+/* Define to 1 if you have the winsock.h header file. */
+/* #undef HAVE_WINSOCK_H */
+
+/* Define to 1 if you have the writev function. */
+#define HAVE_WRITEV
+
+/* Define to 1 if you have the ws2tcpip.h header file. */
+/* #undef HAVE_WS2TCPIP_H */
+
+/* Define to 1 if you need the malloc.h header file even with stdlib.h */
+/* #undef NEED_MALLOC_H */
+
+/* Define to 1 if you need the memory.h header file even with stdlib.h */
+/* #undef NEED_MEMORY_H */
+
+/* a suitable file/device to read random data from */
+/* #undef RANDOM_FILE */
+
+/* Define to the type qualifier pointed by arg 5 for recvfrom. */
+#define RECVFROM_QUAL_ARG5 
+
+/* Define to the type of arg 1 for recvfrom. */
+#define RECVFROM_TYPE_ARG1 int
+
+/* Define to the type pointed by arg 2 for recvfrom. */
+#define RECVFROM_TYPE_ARG2 void *
+
+/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
+#define RECVFROM_TYPE_ARG2_IS_VOID 0
+
+/* Define to the type of arg 3 for recvfrom. */
+#define RECVFROM_TYPE_ARG3 size_t
+
+/* Define to the type of arg 4 for recvfrom. */
+#define RECVFROM_TYPE_ARG4 int
+
+/* Define to the type pointed by arg 5 for recvfrom. */
+#define RECVFROM_TYPE_ARG5 struct sockaddr *
+
+/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
+#define RECVFROM_TYPE_ARG5_IS_VOID 0
+
+/* Define to the type pointed by arg 6 for recvfrom. */
+#define RECVFROM_TYPE_ARG6 socklen_t *
+
+/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
+#define RECVFROM_TYPE_ARG6_IS_VOID 0
+
+/* Define to the function return type for recvfrom. */
+#define RECVFROM_TYPE_RETV ssize_t
+
+/* Define to the type of arg 1 for recv. */
+#define RECV_TYPE_ARG1 int
+
+/* Define to the type of arg 2 for recv. */
+#define RECV_TYPE_ARG2 void *
+
+/* Define to the type of arg 3 for recv. */
+#define RECV_TYPE_ARG3 size_t
+
+/* Define to the type of arg 4 for recv. */
+#define RECV_TYPE_ARG4 int
+
+/* Define to the function return type for recv. */
+#define RECV_TYPE_RETV ssize_t
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE 
+
+/* Define to the type qualifier of arg 2 for send. */
+#define SEND_QUAL_ARG2 
+
+/* Define to the type of arg 1 for send. */
+#define SEND_TYPE_ARG1 int
+
+/* Define to the type of arg 2 for send. */
+#define SEND_TYPE_ARG2 void *
+
+/* Define to the type of arg 3 for send. */
+#define SEND_TYPE_ARG3 size_t
+
+/* Define to the type of arg 4 for send. */
+#define SEND_TYPE_ARG4 int
+
+/* Define to the function return type for send. */
+#define SEND_TYPE_RETV ssize_t
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME
+
+/* Define to disable non-blocking sockets. */
+#undef USE_BLOCKING_SOCKETS
+
+/* Define to avoid automatic inclusion of winsock.h */
+#undef WIN32_LEAN_AND_MEAN
+
+/* Type to use in place of in_addr_t when system does not provide it. */
+#undef in_addr_t
+
+#ifdef GPR_BACKWARDS_COMPATIBILITY_MODE
+  /* IMPORTANT: gRPC MANUAL EDIT HERE!
+   * Redefine the fd_set macros for GLIBC < 2.15 support.
+   * This is a backwards compatibility hack. At version 2.15, GLIBC introduces
+   * the __fdelt_chk function, and starts using it within its fd_set macros
+   * (which c-ares uses). For compatibility with GLIBC < 2.15, we need to redefine
+   * the fd_set macros to not use __fdelt_chk. */
+  #include <sys/select.h>
+  #undef FD_SET
+  #undef FD_CLR
+  #undef FD_ISSET
+  /* 'FD_ZERO' doesn't use __fdelt_chk, no need to redefine. */
+
+  #ifdef __FDS_BITS
+    #define GRPC_CARES_FDS_BITS(set) __FDS_BITS(set)
+  #else
+    #define GRPC_CARES_FDS_BITS(set) ((set)->fds_bits)
+  #endif
+
+  #define GRPC_CARES_FD_MASK(d) ((long int)(1UL << (d) % NFDBITS))
+
+  #define FD_SET(d, set) \
+      ((void) (GRPC_CARES_FDS_BITS (set)[ (d) / NFDBITS ] |= GRPC_CARES_FD_MASK(d)))
+  #define FD_CLR(d, set) \
+      ((void) (GRPC_CARES_FDS_BITS (set)[ (d) / NFDBITS ] &= ~GRPC_CARES_FD_MASK(d)))
+  #define FD_ISSET(d, set) \
+      ((GRPC_CARES_FDS_BITS (set)[ (d) / NFDBITS ] & GRPC_CARES_FD_MASK(d)) != 0)
+#endif /* GPR_BACKWARDS_COMPATIBILITY_MODE */
diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py
index d602e34..d8a3600 100755
--- a/tools/buildgen/plugins/expand_version.py
+++ b/tools/buildgen/plugins/expand_version.py
@@ -23,14 +23,13 @@
 import re
 
 LANGUAGES = [
-  'core', 
-  'cpp', 
-  'csharp', 
-  'node', 
-  'objc', 
+  'core',
+  'cpp',
+  'csharp',
+  'objc',
   'php',
-  'python', 
-  'ruby', 
+  'python',
+  'ruby',
   ]
 
 class Version:
@@ -84,7 +83,7 @@
   def php_composer(self):
     """Version string for PHP Composer package"""
     return '%d.%d.%d' % (self.major, self.minor, self.patch)
-    
+
 def mako_plugin(dictionary):
   """Expand version numbers:
      - for each language, ensure there's a language_version tag in
diff --git a/tools/buildgen/plugins/make_fuzzer_tests.py b/tools/buildgen/plugins/make_fuzzer_tests.py
index 6d318fe..56dad2d 100644
--- a/tools/buildgen/plugins/make_fuzzer_tests.py
+++ b/tools/buildgen/plugins/make_fuzzer_tests.py
@@ -26,8 +26,8 @@
       new_target['build'] = 'test'
       new_target['name'] += '_one_entry'
       new_target['run'] = False
-      new_target['src'].append('test/core/util/one_corpus_entry_fuzzer.c')
-      new_target['own_src'].append('test/core/util/one_corpus_entry_fuzzer.c')
+      new_target['src'].append('test/core/util/one_corpus_entry_fuzzer.cc')
+      new_target['own_src'].append('test/core/util/one_corpus_entry_fuzzer.cc')
       targets.append(new_target)
       for corpus in new_target['corpus_dirs']:
         for fn in sorted(glob.glob('%s/*' % corpus)):
diff --git a/tools/buildgen/plugins/transitive_dependencies.py b/tools/buildgen/plugins/transitive_dependencies.py
index 5f37ed1..bf5263e 100644
--- a/tools/buildgen/plugins/transitive_dependencies.py
+++ b/tools/buildgen/plugins/transitive_dependencies.py
@@ -38,17 +38,16 @@
 def mako_plugin(dictionary):
   """The exported plugin code for transitive_dependencies.
 
-  Each item in libs, node_modules, and targets can have a deps list.
-  We add a transitive_deps property to each with the transitive closure
-  of those dependency lists.
+  Iterate over each list and check each item for a deps list. We add a
+  transitive_deps property to each with the transitive closure of those
+  dependency lists.
   """
   libs = dictionary.get('libs')
-  node_modules = dictionary.get('node_modules')
-  targets = dictionary.get('targets')
 
-  for target_list in (libs, targets, node_modules):
+  for target_name, target_list in dictionary.items():
     for target in target_list:
-      target['transitive_deps'] = transitive_deps(target, libs)
+      if isinstance(target, dict) and 'deps' in target:
+        target['transitive_deps'] = transitive_deps(target, libs)
 
   python_dependencies = dictionary.get('python_dependencies')
   python_dependencies['transitive_deps'] = (
diff --git a/tools/dockerfile/grpc_clang_format/Dockerfile b/tools/dockerfile/grpc_clang_format/Dockerfile
index dff07fe..b3abaef 100644
--- a/tools/dockerfile/grpc_clang_format/Dockerfile
+++ b/tools/dockerfile/grpc_clang_format/Dockerfile
@@ -14,11 +14,11 @@
 
 FROM debian:jessie
 
-RUN apt-get update && apt-get -y install wget
-RUN echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN echo "deb-src http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
-RUN apt-get update && apt-get -y install clang-format-3.8
+RUN apt-get update && apt-get -y install wget xz-utils
+RUN wget http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN tar xf clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-format /usr/local/bin/clang-format
+ENV CLANG_FORMAT=clang-format
 
 ADD clang_format_all_the_things.sh /
 CMD ["echo 'Run with tools/distrib/clang_format_code.sh'"]
diff --git a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
index c471344..7247199 100755
--- a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
+++ b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
@@ -16,20 +16,20 @@
 set -e
 
 # directories to run against
-DIRS="src/core/lib src/core/tsi src/core/ext src/cpp test/core test/cpp include src/compiler src/node src/csharp src/ruby"
+DIRS="src/core/lib src/core/tsi src/core/ext src/cpp test/core test/cpp include src/compiler src/csharp src/ruby"
 
 # file matching patterns to check
 GLOB="*.h *.c *.cc"
 
 # clang format command
-CLANG_FORMAT=clang-format-3.8
+CLANG_FORMAT=${CLANG_FORMAT:-clang-format-5.0}
 
 files=
 for dir in $DIRS
 do
   for glob in $GLOB
   do
-    files="$files `find ${CLANG_FORMAT_ROOT}/$dir -name $glob -and -not -name *.generated.* -and -not -name *.pb.h -and -not -name *.pb.c -and -not -name *.pb.cc -and -not -name end2end_tests.c -and -not -name end2end_nosec_tests.c`"
+    files="$files `find ${CLANG_FORMAT_ROOT}/$dir -name $glob -and -not -name '*.generated.*' -and -not -name '*.pb.h' -and -not -name '*.pb.c' -and -not -name '*.pb.cc' -and -not -name end2end_tests.cc -and -not -name end2end_nosec_tests.cc -and -not -name public_headers_must_be_c89.c`"
   done
 done
 
diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile
index 56b8be8..ea82476 100644
--- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile
+++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile
@@ -22,6 +22,7 @@
   bzip2 \
   ccache \
   curl \
+  dnsutils \
   gcc \
   gcc-multilib \
   git \
@@ -61,7 +62,7 @@
 # Install Python packages from PyPI
 RUN pip install --upgrade pip==9.0.1
 RUN pip install virtualenv
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0
+RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0
 
 #================
 # C# dependencies
diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh
old mode 100755
new mode 100644
index bd01eac..1c25ab3
--- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh
+++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh
@@ -29,4 +29,4 @@
 cd /var/local/git/grpc
 
 # build C# interop client & server
-tools/run_tests/run_tests.py -l csharp -c dbg --compiler coreclr --build_only
+tools/run_tests/run_tests.py -l csharp -c dbg --build_only
diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile
index 487ce15..da663d5 100644
--- a/tools/dockerfile/test/sanity/Dockerfile
+++ b/tools/dockerfile/test/sanity/Dockerfile
@@ -100,11 +100,11 @@
 RUN chmod +x ./bazel-0.4.4-installer-linux-x86_64.sh
 RUN ./bazel-0.4.4-installer-linux-x86_64.sh
 
-RUN apt-get update && apt-get -y install wget
-RUN echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN echo "deb-src http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main" >> /etc/apt/sources.list
-RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
-RUN apt-get update && apt-get -y install clang-format-3.8
+RUN apt-get update && apt-get -y install wget xz-utils
+RUN wget http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN tar xf clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz
+RUN ln -s /clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin/clang-format /usr/local/bin/clang-format
+ENV CLANG_FORMAT=clang-format
 
 # Prepare ccache
 RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index e053642..b9844f8 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -871,42 +871,10 @@
 include/grpc/support/workaround_list.h \
 src/core/README.md \
 src/core/ext/README.md \
-src/core/ext/census/README.md \
-src/core/ext/census/aggregation.h \
-src/core/ext/census/base_resources.cc \
-src/core/ext/census/base_resources.h \
-src/core/ext/census/census_interface.h \
-src/core/ext/census/census_rpc_stats.h \
-src/core/ext/census/context.cc \
-src/core/ext/census/gen/README.md \
-src/core/ext/census/gen/census.pb.c \
-src/core/ext/census/gen/census.pb.h \
-src/core/ext/census/gen/trace_context.pb.c \
-src/core/ext/census/gen/trace_context.pb.h \
 src/core/ext/census/grpc_context.cc \
-src/core/ext/census/grpc_filter.cc \
-src/core/ext/census/grpc_filter.h \
-src/core/ext/census/grpc_plugin.cc \
-src/core/ext/census/initialize.cc \
-src/core/ext/census/intrusive_hash_map.cc \
-src/core/ext/census/intrusive_hash_map.h \
-src/core/ext/census/intrusive_hash_map_internal.h \
-src/core/ext/census/mlog.cc \
-src/core/ext/census/mlog.h \
-src/core/ext/census/operation.cc \
-src/core/ext/census/placeholders.cc \
-src/core/ext/census/resource.cc \
-src/core/ext/census/resource.h \
-src/core/ext/census/rpc_metric_id.h \
-src/core/ext/census/trace_context.cc \
-src/core/ext/census/trace_context.h \
-src/core/ext/census/trace_label.h \
-src/core/ext/census/trace_propagation.h \
-src/core/ext/census/trace_status.h \
-src/core/ext/census/trace_string.h \
-src/core/ext/census/tracing.cc \
-src/core/ext/census/tracing.h \
 src/core/ext/filters/client_channel/README.md \
+src/core/ext/filters/client_channel/backup_poller.cc \
+src/core/ext/filters/client_channel/backup_poller.h \
 src/core/ext/filters/client_channel/channel_connectivity.cc \
 src/core/ext/filters/client_channel/client_channel.cc \
 src/core/ext/filters/client_channel/client_channel.h \
@@ -935,6 +903,8 @@
 src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h \
 src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \
 src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
+src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc \
+src/core/ext/filters/client_channel/lb_policy/subchannel_list.h \
 src/core/ext/filters/client_channel/lb_policy_factory.cc \
 src/core/ext/filters/client_channel/lb_policy_factory.h \
 src/core/ext/filters/client_channel/lb_policy_registry.cc \
diff --git a/tools/gce/create_windows_debug_worker.sh b/tools/gce/create_windows_debug_worker.sh
new file mode 100755
index 0000000..da8050b
--- /dev/null
+++ b/tools/gce/create_windows_debug_worker.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Creates a worker for debugging/experiments.
+# The worker will have all the prerequisites that are installed on kokoro
+# windows workers.
+
+set -ex
+
+cd $(dirname $0)
+
+CLOUD_PROJECT=grpc-testing
+ZONE=us-central1-b
+
+if [ "$1" != "" ]
+then
+  INSTANCE_NAME="$1"
+else
+  INSTANCE_NAME="${USER}-windows-kokoro-debug1"
+fi
+
+MACHINE_TYPE=n1-standard-8
+TMP_DISK_NAME="$INSTANCE_NAME-temp-disk"
+
+gcloud compute disks create $TMP_DISK_NAME \
+    --project="$CLOUD_PROJECT" \
+    --zone "$ZONE" \
+    --image-project google.com:kokoro \
+    --image empty-100g-image \
+    --type pd-ssd
+
+echo 'Created scratch disk, waiting for it to become available.'
+sleep 15
+
+gcloud compute instances create $INSTANCE_NAME \
+    --project="$CLOUD_PROJECT" \
+    --zone "$ZONE" \
+    --machine-type $MACHINE_TYPE \
+    --image-project google.com:kokoro \
+    --image kokoro-win7build-v9-prod-debug \
+    --boot-disk-size 500 \
+    --boot-disk-type pd-ssd \
+    --tags=allow-ssh \
+    --disk auto-delete=yes,boot=no,name=$TMP_DISK_NAME
diff --git a/tools/internal_ci/helper_scripts/prepare_build_linux_rc b/tools/internal_ci/helper_scripts/prepare_build_linux_rc
index ea2a17f..8715d6c 100644
--- a/tools/internal_ci/helper_scripts/prepare_build_linux_rc
+++ b/tools/internal_ci/helper_scripts/prepare_build_linux_rc
@@ -22,6 +22,9 @@
 
 # Move docker's storage location to scratch disk so we don't run out of space.
 echo 'DOCKER_OPTS="${DOCKER_OPTS} --graph=/tmpfs/docker"' | sudo tee --append /etc/default/docker
+# Use container registry mirror for pulling docker images (should make downloads faster)
+# See https://cloud.google.com/container-registry/docs/using-dockerhub-mirroring
+echo 'DOCKER_OPTS="${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io"' | sudo tee --append /etc/default/docker
 sudo service docker restart
 
 # Populate xdg-cache-home to workaround https://github.com/grpc/grpc/issues/11968
diff --git a/tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc b/tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc
index bb046de..6ecf51d 100644
--- a/tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc
+++ b/tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc
@@ -25,6 +25,7 @@
 cd /Users/kbuilder/workspace/grpc
 
 # Needed for identifying Docker image sha1
+brew update
 brew install md5sha1sum
 
 # Set up gRPC-Go and gRPC-Java to test
diff --git a/tools/internal_ci/linux/grpc_build_submodule_at_head.sh b/tools/internal_ci/linux/grpc_build_submodule_at_head.sh
index b67b030..e203a62 100755
--- a/tools/internal_ci/linux/grpc_build_submodule_at_head.sh
+++ b/tools/internal_ci/linux/grpc_build_submodule_at_head.sh
@@ -27,5 +27,5 @@
 tools/buildgen/generate_projects.sh
 git -c user.name='foo' -c user.email='foo@google.com' commit -a -m 'Update submodule'
 
-tools/run_tests/run_tests_matrix.py -f linux --internal_ci --build_only
+tools/run_tests/run_tests_matrix.py -f linux --inner_jobs 4 -j 4 --internal_ci --build_only
 
diff --git a/tools/internal_ci/linux/grpc_coverage.sh b/tools/internal_ci/linux/grpc_coverage.sh
index 31623d2..12181f0 100755
--- a/tools/internal_ci/linux/grpc_coverage.sh
+++ b/tools/internal_ci/linux/grpc_coverage.sh
@@ -27,4 +27,4 @@
   -c gcov                           \
   -x report.xml                     \
   -j 16
-  
\ No newline at end of file
+  
diff --git a/tools/internal_ci/linux/grpc_portability_build_only.cfg b/tools/internal_ci/linux/grpc_portability_build_only.cfg
index 501223c..4acd935 100644
--- a/tools/internal_ci/linux/grpc_portability_build_only.cfg
+++ b/tools/internal_ci/linux/grpc_portability_build_only.cfg
@@ -26,5 +26,5 @@
 
 env_vars {
   key: "RUN_TESTS_FLAGS"
-  value: "-f portability linux --internal_ci --build_only"
+  value: "-f portability linux --inner_jobs 4 -j 4 --internal_ci --build_only"
 }
diff --git a/tools/internal_ci/linux/grpc_sanity.cfg b/tools/internal_ci/linux/grpc_sanity.cfg
index 24e7984..e06a2f4 100644
--- a/tools/internal_ci/linux/grpc_sanity.cfg
+++ b/tools/internal_ci/linux/grpc_sanity.cfg
@@ -16,7 +16,7 @@
 
 # Location of the continuous shell script in repository.
 build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
-timeout_mins: 20
+timeout_mins: 40
 action {
   define_artifacts {
     regex: "**/*sponge_log.xml"
diff --git a/tools/internal_ci/windows/grpc_basictests_dbg.cfg b/tools/internal_ci/windows/grpc_basictests_dbg.cfg
new file mode 100644
index 0000000..28d53cd
--- /dev/null
+++ b/tools/internal_ci/windows/grpc_basictests_dbg.cfg
@@ -0,0 +1,30 @@
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
+timeout_mins: 240
+action {
+  define_artifacts {
+    regex: "**/*sponge_log.xml"
+    regex: "github/grpc/reports/**"
+  }
+}
+
+env_vars {
+  key: "RUN_TESTS_FLAGS"
+  value: "-f basictests windows dbg -j 1 --inner_jobs 8 --internal_ci --bq_result_table aggregate_results"
+}
diff --git a/tools/internal_ci/windows/grpc_basictests_opt.cfg b/tools/internal_ci/windows/grpc_basictests_opt.cfg
new file mode 100644
index 0000000..4b7a965
--- /dev/null
+++ b/tools/internal_ci/windows/grpc_basictests_opt.cfg
@@ -0,0 +1,30 @@
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
+timeout_mins: 240
+action {
+  define_artifacts {
+    regex: "**/*sponge_log.xml"
+    regex: "github/grpc/reports/**"
+  }
+}
+
+env_vars {
+  key: "RUN_TESTS_FLAGS"
+  value: "-f basictests windows opt -j 1 --inner_jobs 8 --internal_ci --bq_result_table aggregate_results"
+}
diff --git a/tools/interop_matrix/README.md b/tools/interop_matrix/README.md
index a3717a5..588afe4 100644
--- a/tools/interop_matrix/README.md
+++ b/tools/interop_matrix/README.md
@@ -24,7 +24,7 @@
 - Create new `Dockerfile.template`, `build_interop.sh.template` for the language/runtime under `template/tools/dockerfile/`.
 - Run `tools/buildgen/generate_projects.sh` to create corresponding files under `tools/dockerfile/`.
 - Add language/runtimes to `client_matrix.py` following existing language/runtimes examples.
-- Run `tools/interop_matrix/create_matrix_images.py` which will build and upload images to GCR.  Unless you are also building images for a gRPC release, make sure not to set `--gcr_tag` (the default tag 'master' is used for testing).
+- Run `tools/interop_matrix/create_matrix_images.py` which will build and upload images to GCR.  Unless you are also building images for a gRPC release, make sure not to set `--release` (the default release 'master' is used for testing).
 
 *: Please delete your docker images at https://pantheon.corp.google.com/gcr/images/grpc-testing?project=grpc-testing afterwards.  Permissions to access GrpcTesting project is required for this step.
 
diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py
index 23c5ae0..6bd7ff6 100644
--- a/tools/interop_matrix/client_matrix.py
+++ b/tools/interop_matrix/client_matrix.py
@@ -27,6 +27,11 @@
     'cxx': ['cxx'],             # This is actually debian8.
     'go': ['go1.7', 'go1.8'],
     'java': ['java_oracle8'],
+    #'python': ['python'],  # All python versions fail the tests due to timeout.
+    'node': ['node'],
+    'ruby': ['ruby'],
+    'php': ['php', 'php7'],
+    'csharp': ['csharp', 'csharpcoreclr'],
 }
 
 # Dictionary of releases per language.  For each language, we need to provide
@@ -59,4 +64,44 @@
         'v1.6.1',
         'v1.7.0',
     ],
+    #'python': [
+        #'v1.0.x',  #Fail to run the test. #13230.
+    #    'v1.1.4',
+    #    'v1.2.5',
+    #    'v1.3.9',
+    #    'v1.4.2',
+    #    'v1.6.6',
+    #],
+    'node': [
+        'v1.0.1',
+        'v1.1.4',
+        'v1.2.5',
+        'v1.3.9',
+        'v1.4.2',
+        'v1.6.6',
+    ],
+    'ruby': [
+        # Ruby v1.0.x doesn't have the fix #8914, therefore not supported.
+        'v1.1.4',
+        'v1.2.5',
+        'v1.3.9',
+        'v1.4.2',
+        'v1.6.6',
+    ],
+    'php': [
+        'v1.0.1',
+        'v1.1.4',
+        'v1.2.5',
+        'v1.3.9',
+        'v1.4.2',
+        'v1.6.6',
+    ],
+   'csharp': [
+        #'v1.0.1',
+        #'v1.1.4',  Fail to build.
+        #'v1.2.5',  Fail to run test with csharp image.
+        'v1.3.9',
+        'v1.4.2',
+        'v1.6.6',
+    ],
 }
diff --git a/tools/interop_matrix/create_matrix_images.py b/tools/interop_matrix/create_matrix_images.py
index 67355e7..21040ea 100755
--- a/tools/interop_matrix/create_matrix_images.py
+++ b/tools/interop_matrix/create_matrix_images.py
@@ -116,12 +116,13 @@
   subprocess.check_output(build_cmd)
   dockerjob.remove_image(orig_tag, skip_nonexistent=True)
 
-def build_image_jobspec(runtime, env, gcr_tag):
+def build_image_jobspec(runtime, env, gcr_tag, stack_base):
   """Build interop docker image for a language with runtime.
 
   runtime: a <lang><version> string, for example go1.8.
   env:     dictionary of env to passed to the build script.
   gcr_tag: the tag for the docker image (i.e. v1.3.0).
+  stack_base: the local gRPC repo path.
   """
   basename = 'grpc_interop_%s' % runtime
   tag = '%s/%s:%s' % (args.gcr_path, basename, gcr_tag)
@@ -132,7 +133,7 @@
   }
   build_env.update(env)
   build_job = jobset.JobSpec(
-          cmdline=[_IMAGE_BUILDER],
+          cmdline=[os.path.join(stack_base, _IMAGE_BUILDER)],
           environ=build_env,
           shortname='build_docker_%s' % runtime,
           timeout_seconds=30*60)
@@ -172,13 +173,14 @@
 
   env = {}
   # If we not using current tree or the sibling for grpc stack, do checkout.
+  stack_base = ''
   if args.git_checkout:
     stack_base = checkout_grpc_stack(lang, release)
     var ={'go': 'GRPC_GO_ROOT', 'java': 'GRPC_JAVA_ROOT', 'node': 'GRPC_NODE_ROOT'}.get(lang, 'GRPC_ROOT')
     env[var] = stack_base
 
   for runtime in client_matrix.LANG_RUNTIME_MATRIX[lang]:
-    job = build_image_jobspec(runtime, env, release)
+    job = build_image_jobspec(runtime, env, release, stack_base)
     docker_images.append(job.tag)
     build_jobs.append(job)
 
@@ -225,7 +227,6 @@
   repo_dir = os.path.splitext(os.path.basename(repo))[0]
   stack_base = os.path.join(args.git_checkout_root, repo_dir)
 
-  # Assume the directory is reusable for git checkout.
   if not os.path.exists(stack_base):
     subprocess.check_call(['git', 'clone', '--recursive', repo],
                           cwd=os.path.dirname(stack_base))
@@ -238,7 +239,9 @@
   output = subprocess.check_output(
       ['git', 'checkout', release], cwd=stack_base, stderr=subprocess.STDOUT)
   commit_log = subprocess.check_output(['git', 'log', '-1'], cwd=stack_base)
-  jobset.message('SUCCESS', 'git checkout', output + commit_log, do_newline=True)
+  jobset.message('SUCCESS', 'git checkout', 
+                 '%s: %s' % (str(output), commit_log), 
+                 do_newline=True)
 
   # Write git log to commit_log so it can be packaged with the docker image.
   with open(os.path.join(stack_base, 'commit_log'), 'w') as f:
diff --git a/tools/interop_matrix/create_testcases.sh b/tools/interop_matrix/create_testcases.sh
index 3d34b2e..fa33fa4 100755
--- a/tools/interop_matrix/create_testcases.sh
+++ b/tools/interop_matrix/create_testcases.sh
@@ -31,13 +31,6 @@
 
 echo "Create '$LANG' test cases for gRPC release '${RELEASE:=master}'"
 
-echo $client_lang
-# Invoke run_interop_test in manual mode.
-# TODO(adelez): Add cloud_gateways when we figure out how to skip them if not 
-# running in GCE.
-${GRPC_ROOT}/tools/run_tests/run_interop_tests.py -l $LANG --use_docker \
-  --cloud_to_prod --prod_servers default gateway_v4 --manual_run
-
 # Clean up
 function cleanup {
   [ -z "$testcase" ] && testcase=$CMDS_SH
@@ -54,19 +47,28 @@
   fi
   [ -e "$CMDS_SH" ] && rm $CMDS_SH
 }
+
+function createtests {
+# Invoke run_interop_test in manual mode.
+# TODO(adelez): Add cloud_gateways when we figure out how to skip them if not 
+# running in GCE.
+if [ $1 == "cxx" ]; then
+client_lang="c++"
+else
+client_lang=$1
+fi
+echo $client_lang
+
+${GRPC_ROOT}/tools/run_tests/run_interop_tests.py -l $client_lang --use_docker \
+  --cloud_to_prod --prod_servers default gateway_v4 --manual_run
+
 trap cleanup EXIT
 # TODO(adelez): add test auth tests but do not run if not testing on GCE.
 # Running the testcases as sanity unless we are asked to skip.
 [ -z "$SKIP_TEST" ] && (echo "Running test cases: $CMDS_SH"; sh $CMDS_SH)
 
-# Convert c++ to cxx. 
-if [$LANG == "c++" ]; then
-client_lang="cxx"
-else
-client_lang=$LANG
-fi
 mkdir -p $TESTCASES_DIR
-testcase=$TESTCASES_DIR/${client_lang}__$RELEASE
+testcase=$TESTCASES_DIR/$1__$RELEASE
 if [ -e $testcase ]; then
   echo "Updating: $testcase"
   diff $testcase $CMDS_SH || true
@@ -74,3 +76,11 @@
 mv $CMDS_SH $testcase
 chmod a+x $testcase
 echo "Test cases created: $testcase"
+}
+
+if [ $LANG == "csharp" ]; then
+createtests "csharp"
+createtests "csharpcoreclr"
+else
+createtests $LANG
+fi 
diff --git a/tools/interop_matrix/run_interop_matrix_tests.py b/tools/interop_matrix/run_interop_matrix_tests.py
index d037e13..dce1033 100755
--- a/tools/interop_matrix/run_interop_matrix_tests.py
+++ b/tools/interop_matrix/run_interop_matrix_tests.py
@@ -83,6 +83,8 @@
 
 args = argp.parse_args()
 
+print(str(args))
+
 
 def find_all_images_for_lang(lang):
   """Find docker images for a language across releases and runtimes.
@@ -122,15 +124,16 @@
   return images
 
 # caches test cases (list of JobSpec) loaded from file.  Keyed by lang and runtime.
-_loaded_testcases = {}
-def find_test_cases(lang, release, suite_name):
+def find_test_cases(lang, runtime, release, suite_name):
   """Returns the list of test cases from testcase files per lang/release."""
   file_tmpl = os.path.join(os.path.dirname(__file__), 'testcases/%s__%s')
-  if not os.path.exists(file_tmpl % (lang, release)):
-    release = 'master'
-  testcases = file_tmpl % (lang, release)
-  if lang in _loaded_testcases.keys() and release in _loaded_testcases[lang].keys():
-    return _loaded_testcases[lang][release]
+  testcase_release = release
+  filename_prefix = lang
+  if lang == 'csharp':
+    filename_prefix = runtime
+  if not os.path.exists(file_tmpl % (filename_prefix, release)):
+    testcase_release = 'master'
+  testcases = file_tmpl % (filename_prefix, testcase_release)
 
   job_spec_list=[]
   try:
@@ -155,9 +158,6 @@
                      do_newline=True)
   except IOError as err:
     jobset.message('FAILED', err, do_newline=True)
-  if lang not in _loaded_testcases.keys():
-    _loaded_testcases[lang] = {}
-  _loaded_testcases[lang][release]=job_spec_list
   return job_spec_list
 
 _xml_report_tree = report_utils.new_junit_xml_tree()
@@ -172,9 +172,13 @@
     jobset.message('START', 'Testing %s' % image, do_newline=True)
     # Download the docker image before running each test case.
     subprocess.check_call(['gcloud', 'docker', '--', 'pull', image])
-    _docker_images_cleanup.append(image)
     suite_name = '%s__%s_%s' % (lang, runtime, release)
-    job_spec_list = find_test_cases(lang, release, suite_name)
+    job_spec_list = find_test_cases(lang, runtime, release, suite_name)
+    
+    if not job_spec_list:  
+      jobset.message('FAILED', 'No test cases were found.', do_newline=True)
+      return 1
+
     num_failures, resultset = jobset.run(job_spec_list,
                                          newline_on_success=True,
                                          add_env={'docker_image':image},
@@ -194,17 +198,17 @@
         'grpc_interop_matrix',
         suite_name,
         str(uuid.uuid4()))
+
+    if not args.keep:
+      cleanup(image)
   
   return total_num_failures
 
 
-_docker_images_cleanup = []
-def cleanup():
-  if not args.keep:
-    for image in _docker_images_cleanup:
-      dockerjob.remove_image(image, skip_nonexistent=True)
+def cleanup(image):
+  jobset.message('START', 'Cleanup docker image %s' % image, do_newline=True)
+  dockerjob.remove_image(image, skip_nonexistent=True)
 
-atexit.register(cleanup)
 
 languages = args.language if args.language != ['all'] else _LANGUAGES
 total_num_failures = 0
diff --git a/tools/interop_matrix/testcases/csharp__master b/tools/interop_matrix/testcases/csharp__master
new file mode 100644
index 0000000..32f6b38
--- /dev/null
+++ b/tools/interop_matrix/testcases/csharp__master
@@ -0,0 +1,20 @@
+#!/bin/bash
+echo "Testing ${docker_image:=grpc_interop_csharp:a95229ca-d387-4127-ad48-69a7464e23b8}"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
diff --git a/tools/interop_matrix/testcases/csharpcoreclr__master b/tools/interop_matrix/testcases/csharpcoreclr__master
new file mode 100644
index 0000000..37e4598
--- /dev/null
+++ b/tools/interop_matrix/testcases/csharpcoreclr__master
@@ -0,0 +1,20 @@
+#!/bin/bash
+echo "Testing ${docker_image:=grpc_interop_csharpcoreclr:c7fbed09-e4c1-4aab-8dd9-1285b2c9598e}"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp1.0 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
diff --git a/tools/interop_matrix/testcases/node__master b/tools/interop_matrix/testcases/node__master
new file mode 100755
index 0000000..99ea2f0
--- /dev/null
+++ b/tools/interop_matrix/testcases/node__master
@@ -0,0 +1,20 @@
+#!/bin/bash
+echo "Testing ${docker_image:=grpc_interop_node:1415ecbf-5d0f-423e-8c2c-e0cb6d154e73}"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_nvm.sh node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
diff --git a/tools/interop_matrix/testcases/node__v1.0.1 b/tools/interop_matrix/testcases/node__v1.0.1
new file mode 100644
index 0000000..fca9821
--- /dev/null
+++ b/tools/interop_matrix/testcases/node__v1.0.1
@@ -0,0 +1,21 @@
+#!/bin/bash
+echo "Testing ${docker_image:=grpc_interop_node:a53aa5e3-b548-4566-b5a8-6d15c1315b32}"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_00c688f2-57da-4023-89f3-46b1f7b5869f $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_d86705d8-14ea-4024-90b6-de74d6e8d19c $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_ebaafacd-1d82-4a75-bea1-a5c64e01fcaf $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_5125241a-fbf6-4c1c-895b-026a5a41f02f $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_3d5e5b82-7205-4eba-b775-8122f05a4760 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_16fa0b49-2083-4932-8f26-79cfdffec940 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_23cee670-2d8d-4f5c-8893-c3c43da8b03a $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_7b6a9454-e3b6-4993-b542-468e268930aa $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_5a7109ed-c065-4b62-98f4-b3ed8f385762 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_1e0ba8dd-4dc1-431b-b202-529e7ace5d1d $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_649de56a-e722-4a59-b265-e9c0e871f068 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_8be512a2-5e1c-4858-8cfc-82f99b678b76 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_d19b6333-e528-48b5-8421-2ae3f7ce9dab $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_4749c80a-21c5-4d81-9df5-3c46ba6480cd $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_b7bee545-4857-4269-a1f2-9553dfc7e4b8 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_4e96db87-6f48-426d-a7f0-97f3a5b6b3f4 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_31a1d58c-f8bf-460a-af60-28969ecaaf80 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_ce64b147-bcfa-44b2-a2f7-4a485380ce30 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
+
diff --git a/tools/interop_matrix/testcases/php__master b/tools/interop_matrix/testcases/php__master
new file mode 100755
index 0000000..bce1d30
--- /dev/null
+++ b/tools/interop_matrix/testcases/php__master
@@ -0,0 +1,20 @@
+#!/bin/bash
+echo "Testing ${docker_image:=grpc_interop_php:b290f404-9940-4968-8fc2-19f5291c8eb7}"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "src/php/bin/interop_client.sh --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
diff --git a/tools/interop_matrix/testcases/ruby__master b/tools/interop_matrix/testcases/ruby__master
new file mode 100755
index 0000000..07bfd05
--- /dev/null
+++ b/tools/interop_matrix/testcases/ruby__master
@@ -0,0 +1,20 @@
+#!/bin/bash
+echo "Testing ${docker_image:=grpc_interop_ruby:6bd1f0eb-51a4-4ad8-861c-1cbd7a929f33}"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response"
+docker run -i --rm=true -w /var/local/git/grpc --net=host $docker_image bash -c "tools/run_tests/interop/with_rvm.sh ruby src/ruby/pb/test/client.rb --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server"
diff --git a/tools/jenkins/run_full_performance.sh b/tools/jenkins/run_full_performance.sh
index 195cc68..8657cc9 100755
--- a/tools/jenkins/run_full_performance.sh
+++ b/tools/jenkins/run_full_performance.sh
@@ -21,7 +21,7 @@
 
 # run 8core client vs 8core server
 tools/run_tests/run_performance_tests.py \
-    -l c++ csharp node ruby java python go node_express php7 php7_protobuf_c \
+    -l c++ csharp ruby java python go php7 php7_protobuf_c \
     --netperf \
     --category scalable \
     --bq_result_table performance_test.performance_experiment \
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_constants.py b/tools/profiling/microbenchmarks/bm_diff/bm_constants.py
index f8989b1..0ec17fa 100644
--- a/tools/profiling/microbenchmarks/bm_diff/bm_constants.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_constants.py
@@ -23,7 +23,7 @@
   'bm_metadata', 'bm_fullstack_trickle'
 ]
 
-_INTERESTING = ('cpu_time', 'real_time', 'locks_per_iteration',
+_INTERESTING = ('cpu_time', 'real_time', 'call_initial_size-median', 'locks_per_iteration',
         'allocs_per_iteration', 'writes_per_iteration',
         'atm_cas_per_iteration', 'atm_add_per_iteration',
         'nows_per_iteration', 'cli_transport_stalls_per_iteration', 
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_main.py b/tools/profiling/microbenchmarks/bm_diff/bm_main.py
index 516d110..74b7174 100755
--- a/tools/profiling/microbenchmarks/bm_diff/bm_main.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_main.py
@@ -78,7 +78,7 @@
     '-l',
     '--loops',
     type=int,
-    default=20,
+    default=10,
     help='Number of times to loops the benchmarks. More loops cuts down on noise'
   )
   argp.add_argument(
diff --git a/tools/profiling/microbenchmarks/bm_json.py b/tools/profiling/microbenchmarks/bm_json.py
index f6082fe..eb450ee 100644
--- a/tools/profiling/microbenchmarks/bm_json.py
+++ b/tools/profiling/microbenchmarks/bm_json.py
@@ -76,7 +76,7 @@
     'dyn': ['end_of_stream', 'request_size'],
   },
   'BM_HpackParserParseHeader': {
-    'tpl': ['fixture'],
+    'tpl': ['fixture', 'on_header'],
     'dyn': [],
   },
   'BM_CallCreateDestroy': {
@@ -157,6 +157,9 @@
     rest = s[0]
     dyn_args = s[1:]
   name = rest
+  print (name)
+  print (dyn_args, _BM_SPECS[name]['dyn'])
+  print (tpl_args, _BM_SPECS[name]['tpl'])
   assert name in _BM_SPECS, '_BM_SPECS needs to be expanded for %s' % name
   assert len(dyn_args) == len(_BM_SPECS[name]['dyn'])
   assert len(tpl_args) == len(_BM_SPECS[name]['tpl'])
diff --git a/tools/run_tests/artifacts/artifact_targets.py b/tools/run_tests/artifacts/artifact_targets.py
index 2cc0dfc..ea202ed 100644
--- a/tools/run_tests/artifacts/artifact_targets.py
+++ b/tools/run_tests/artifacts/artifact_targets.py
@@ -230,50 +230,6 @@
   def __str__(self):
     return self.name
 
-
-node_gyp_arch_map = {
-  'x86': 'ia32',
-  'x64': 'x64'
-}
-
-class NodeExtArtifact:
-  """Builds Node native extension"""
-
-  def __init__(self, platform, arch):
-    self.name = 'node_ext_{0}_{1}'.format(platform, arch)
-    self.platform = platform
-    self.arch = arch
-    self.gyp_arch = node_gyp_arch_map[arch]
-    self.labels = ['artifact', 'node', platform, arch]
-
-  def pre_build_jobspecs(self):
-    return []
-
-  def build_jobspec(self):
-    if self.platform == 'windows':
-      # Simultaneous builds of node on the same windows machine are flaky.
-      # Set x86 build as exclusive to make sure there is only one node build
-      # at a time. See https://github.com/grpc/grpc/issues/8293
-      cpu_cost = 1e6 if self.arch != 'x64' else 1.0
-      return create_jobspec(self.name,
-                            ['tools\\run_tests\\artifacts\\build_artifact_node.bat',
-                             self.gyp_arch],
-                            use_workspace=True,
-                            timeout_seconds=45*60,
-                            cpu_cost=cpu_cost)
-    else:
-      if self.platform == 'linux':
-        return create_docker_jobspec(
-            self.name,
-            'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch),
-            'tools/run_tests/artifacts/build_artifact_node.sh {} {}'.format(
-                self.gyp_arch, self.platform))
-      else:
-        return create_jobspec(self.name,
-                              ['tools/run_tests/artifacts/build_artifact_node.sh',
-                               self.gyp_arch, self.platform],
-                               use_workspace=True)
-
 class PHPArtifact:
   """Builds PHP PECL package"""
 
@@ -344,7 +300,7 @@
 def targets():
   """Gets list of supported targets"""
   return ([Cls(platform, arch)
-           for Cls in (CSharpExtArtifact, NodeExtArtifact, ProtocArtifact)
+           for Cls in (CSharpExtArtifact, ProtocArtifact)
            for platform in ('linux', 'macos', 'windows')
            for arch in ('x86', 'x64')] +
           [PythonArtifact('linux', 'x86', 'cp27-cp27m'),
diff --git a/tools/run_tests/artifacts/build_artifact_node.bat b/tools/run_tests/artifacts/build_artifact_node.bat
deleted file mode 100644
index 7f1d1aa..0000000
--- a/tools/run_tests/artifacts/build_artifact_node.bat
+++ /dev/null
@@ -1,48 +0,0 @@
-@rem Copyright 2016 gRPC authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem     http://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-
-set node_versions=4.0.0 5.0.0 6.0.0 7.0.0 8.0.0
-
-set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0
-
-set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
-
-del /f /q BUILD || rmdir build /s /q
-
-call npm update || goto :error
-
-mkdir -p %ARTIFACTS_OUT%
-
-for %%v in (%node_versions%) do (
-  call .\node_modules\.bin\node-pre-gyp.cmd configure build --target=%%v --target_arch=%1
-
-@rem Try again after removing openssl headers
-  rmdir "%USERPROFILE%\.node-gyp\%%v\include\node\openssl" /S /Q
-  rmdir "%USERPROFILE%\.node-gyp\iojs-%%v\include\node\openssl" /S /Q
-  call .\node_modules\.bin\node-pre-gyp.cmd build package --target=%%v --target_arch=%1 || goto :error
-
-  xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error
-)
-
-for %%v in (%electron_versions%) do (
-  cmd /V /C "set "HOME=%USERPROFILE%\electron-gyp" && call .\node_modules\.bin\node-pre-gyp.cmd configure rebuild package --runtime=electron --target=%%v --target_arch=%1 --disturl=https://atom.io/download/electron" || goto :error
-
-  xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error
-)
-if %errorlevel% neq 0 exit /b %errorlevel%
-
-goto :EOF
-
-:error
-exit /b 1
diff --git a/tools/run_tests/artifacts/build_artifact_node.sh b/tools/run_tests/artifacts/build_artifact_node.sh
deleted file mode 100755
index 628d880..0000000
--- a/tools/run_tests/artifacts/build_artifact_node.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-NODE_TARGET_ARCH=$1
-NODE_TARGET_OS=$2
-source ~/.nvm/nvm.sh
-
-nvm use 8
-set -ex
-
-cd $(dirname $0)/../../..
-
-rm -rf build || true
-
-mkdir -p "${ARTIFACTS_OUT}"
-
-npm update
-
-node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 )
-
-electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 )
-
-for version in ${node_versions[@]}
-do
-  ./node_modules/.bin/node-pre-gyp configure rebuild package --target=$version --target_arch=$NODE_TARGET_ARCH --grpc_alpine=true
-  cp -r build/stage/* "${ARTIFACTS_OUT}"/
-  if [ "$NODE_TARGET_ARCH" == 'x64' ] && [ "$NODE_TARGET_OS" == 'linux' ]
-  then
-    # Cross compile for ARM on x64
-    CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ LD=arm-linux-gnueabihf-g++ ./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=arm
-    cp -r build/stage/* "${ARTIFACTS_OUT}"/
-  fi
-done
-
-for version in ${electron_versions[@]}
-do
-  HOME=~/.electron-gyp ./node_modules/.bin/node-pre-gyp configure rebuild package --runtime=electron --target=$version --target_arch=$NODE_TARGET_ARCH --disturl=https://atom.io/download/electron
-  cp -r build/stage/* "${ARTIFACTS_OUT}"/
-done
diff --git a/tools/run_tests/artifacts/build_package_node.sh b/tools/run_tests/artifacts/build_package_node.sh
deleted file mode 100755
index 2860f68..0000000
--- a/tools/run_tests/artifacts/build_package_node.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/bash
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-source ~/.nvm/nvm.sh
-
-nvm use 8
-set -ex
-
-cd $(dirname $0)/../../..
-
-base=$(pwd)
-
-artifacts=$base/artifacts
-
-mkdir -p $artifacts
-cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/node_ext_*/* $artifacts/ || true
-
-npm update
-npm pack
-
-cp grpc-*.tgz $artifacts/grpc.tgz
-
-mkdir -p bin
-
-cd $base/src/node/health_check
-npm pack
-cp grpc-health-check-*.tgz $artifacts/
-
-cd $base/src/node/tools
-npm update
-npm pack
-cp grpc-tools-*.tgz $artifacts/
-tools_version=$(npm list | grep -oP '(?<=grpc-tools@)\S+')
-
-output_dir=$artifacts/grpc-precompiled-binaries/node/grpc-tools/v$tools_version
-mkdir -p $output_dir
-
-well_known_protos=( any api compiler/plugin descriptor duration empty field_mask source_context struct timestamp type wrappers )
-
-for arch in {x86,x64}; do
-  case $arch in
-    x86)
-      node_arch=ia32
-      ;;
-    *)
-      node_arch=$arch
-      ;;
-  esac
-  for plat in {windows,linux,macos}; do
-    case $plat in
-      windows)
-        node_plat=win32
-        ;;
-      macos)
-        node_plat=darwin
-        ;;
-      *)
-        node_plat=$plat
-        ;;
-    esac
-    rm -r bin/*
-    input_dir="$EXTERNAL_GIT_ROOT/platform=${plat}/artifacts/protoc_${plat}_${arch}"
-    cp $input_dir/protoc* bin/
-    cp $input_dir/grpc_node_plugin* bin/
-    mkdir -p bin/google/protobuf
-    mkdir -p bin/google/protobuf/compiler  # needed for plugin.proto
-    for proto in "${well_known_protos[@]}"; do
-      cp $base/third_party/protobuf/src/google/protobuf/$proto.proto bin/google/protobuf/$proto.proto
-    done
-    tar -czf $output_dir/$node_plat-$node_arch.tar.gz bin/
-  done
-done
diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py
index 797ed51..9959651 100644
--- a/tools/run_tests/artifacts/distribtest_targets.py
+++ b/tools/run_tests/artifacts/distribtest_targets.py
@@ -121,50 +121,6 @@
   def __str__(self):
     return self.name
 
-class NodeDistribTest(object):
-  """Tests Node package"""
-
-  def __init__(self, platform, arch, docker_suffix, node_version):
-    self.name = 'node_npm_%s_%s_%s' % (platform, arch, node_version)
-    self.platform = platform
-    self.arch = arch
-    self.node_version = node_version
-    self.labels = ['distribtest', 'node', platform, arch,
-                   'node-%s' % node_version]
-    if docker_suffix is not None:
-      self.name += '_%s' % docker_suffix
-      self.docker_suffix = docker_suffix
-      self.labels.append(docker_suffix)
-
-  def pre_build_jobspecs(self):
-    return []
-
-  def build_jobspec(self):
-    if self.platform == 'linux':
-      linux32 = ''
-      if self.arch == 'x86':
-        linux32 = 'linux32'
-      return create_docker_jobspec(self.name,
-                                   'tools/dockerfile/distribtest/node_%s_%s' % (
-                                       self.docker_suffix,
-                                       self.arch),
-                                   '%s test/distrib/node/run_distrib_test.sh %s' % (
-                                       linux32,
-                                       self.node_version),
-                                   copy_rel_path='test/distrib')
-    elif self.platform == 'macos':
-      return create_jobspec(self.name,
-                            ['test/distrib/node/run_distrib_test.sh',
-                             str(self.node_version)],
-                            environ={'EXTERNAL_GIT_ROOT': '../../../..'},
-                            use_workspace=True)
-    else:
-      raise Exception("Not supported yet.")
-
-    def __str__(self):
-      return self.name
-
-
 class PythonDistribTest(object):
   """Tests Python package"""
 
@@ -329,14 +285,6 @@
           RubyDistribTest('linux', 'x64', 'ubuntu1504'),
           RubyDistribTest('linux', 'x64', 'ubuntu1510'),
           RubyDistribTest('linux', 'x64', 'ubuntu1604'),
-          NodeDistribTest('macos', 'x64', None, '4'),
-          NodeDistribTest('macos', 'x64', None, '5'),
-          NodeDistribTest('linux', 'x86', 'jessie', '4'),
           PHPDistribTest('linux', 'x64', 'jessie'),
           PHPDistribTest('macos', 'x64'),
-          ] + [
-            NodeDistribTest('linux', 'x64', os, version)
-            for os in ('wheezy', 'jessie', 'ubuntu1204', 'ubuntu1404',
-                       'ubuntu1504', 'ubuntu1510', 'ubuntu1604')
-            for version in ('4', '5')
           ]
diff --git a/tools/run_tests/artifacts/package_targets.py b/tools/run_tests/artifacts/package_targets.py
index 671d0f7..ff93bb3 100644
--- a/tools/run_tests/artifacts/package_targets.py
+++ b/tools/run_tests/artifacts/package_targets.py
@@ -89,24 +89,6 @@
   def __str__(self):
     return self.name
 
-
-class NodePackage:
-  """Builds Node NPM package and collects precompiled binaries"""
-
-  def __init__(self):
-    self.name = 'node_package'
-    self.labels = ['package', 'node', 'linux']
-
-  def pre_build_jobspecs(self):
-    return []
-
-  def build_jobspec(self):
-    return create_docker_jobspec(
-        self.name,
-        'tools/dockerfile/grpc_artifact_linux_x64',
-        'tools/run_tests/artifacts/build_package_node.sh')
-
-
 class RubyPackage:
   """Collects ruby gems created in the artifact phase"""
 
@@ -162,7 +144,6 @@
   """Gets list of supported targets"""
   return [CSharpPackage(),
           CSharpPackage(linux=True),
-          NodePackage(),
           RubyPackage(),
           PythonPackage(),
           PHPPackage()]
diff --git a/tools/run_tests/dockerize/build_and_run_docker.sh b/tools/run_tests/dockerize/build_and_run_docker.sh
index 80aec82..323c2f7 100755
--- a/tools/run_tests/dockerize/build_and_run_docker.sh
+++ b/tools/run_tests/dockerize/build_and_run_docker.sh
@@ -36,13 +36,13 @@
 # Pull the base image to force an update
 if [ "$DOCKER_BASE_IMAGE" != "" ]
 then
-  docker pull $DOCKER_BASE_IMAGE
+  time docker pull $DOCKER_BASE_IMAGE
 fi
 
 if [ "$DOCKERHUB_ORGANIZATION" != "" ]
 then
   DOCKER_IMAGE_NAME=$DOCKERHUB_ORGANIZATION/$DOCKER_IMAGE_NAME
-  docker pull $DOCKER_IMAGE_NAME
+  time docker pull $DOCKER_IMAGE_NAME
 else
   # Make sure docker image has been built. Should be instantaneous if so.
   docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR
diff --git a/tools/run_tests/dockerize/build_docker_and_run_tests.sh b/tools/run_tests/dockerize/build_docker_and_run_tests.sh
index eea00da..06a5dae 100755
--- a/tools/run_tests/dockerize/build_docker_and_run_tests.sh
+++ b/tools/run_tests/dockerize/build_docker_and_run_tests.sh
@@ -40,7 +40,7 @@
 if [ "$DOCKERHUB_ORGANIZATION" != "" ]
 then
   DOCKER_IMAGE_NAME=$DOCKERHUB_ORGANIZATION/$DOCKER_IMAGE_NAME
-  docker pull $DOCKER_IMAGE_NAME
+  time docker pull $DOCKER_IMAGE_NAME
 else
   # Make sure docker image has been built. Should be instantaneous if so.
   docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR
diff --git a/tools/run_tests/dockerize/build_interop_image.sh b/tools/run_tests/dockerize/build_interop_image.sh
index 09e0629..dbc6bde 100755
--- a/tools/run_tests/dockerize/build_interop_image.sh
+++ b/tools/run_tests/dockerize/build_interop_image.sh
@@ -78,7 +78,7 @@
 if [ "$DOCKERHUB_ORGANIZATION" != "" ]
 then
   BASE_IMAGE=$DOCKERHUB_ORGANIZATION/$BASE_IMAGE
-  docker pull $BASE_IMAGE
+  time docker pull $BASE_IMAGE
 else
   # Make sure docker image has been built. Should be instantaneous if so.
   docker build -t $BASE_IMAGE --force-rm=true tools/dockerfile/interoptest/$BASE_NAME || exit $?
diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json
index 7fa3d28..6cd9a04 100644
--- a/tools/run_tests/generated/sources_and_headers.json
+++ b/tools/run_tests/generated/sources_and_headers.json
@@ -13,7 +13,7 @@
     "language": "c", 
     "name": "alarm_test", 
     "src": [
-      "test/core/surface/alarm_test.c"
+      "test/core/surface/alarm_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -30,7 +30,7 @@
     "language": "c", 
     "name": "algorithm_test", 
     "src": [
-      "test/core/compression/algorithm_test.c"
+      "test/core/compression/algorithm_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -45,7 +45,7 @@
     "language": "c", 
     "name": "alloc_test", 
     "src": [
-      "test/core/support/alloc_test.c"
+      "test/core/support/alloc_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -62,7 +62,7 @@
     "language": "c", 
     "name": "alpn_test", 
     "src": [
-      "test/core/transport/chttp2/alpn_test.c"
+      "test/core/transport/chttp2/alpn_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -79,7 +79,7 @@
     "language": "c", 
     "name": "api_fuzzer", 
     "src": [
-      "test/core/end2end/fuzzers/api_fuzzer.c"
+      "test/core/end2end/fuzzers/api_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -94,7 +94,7 @@
     "language": "c", 
     "name": "arena_test", 
     "src": [
-      "test/core/support/arena_test.c"
+      "test/core/support/arena_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -111,7 +111,7 @@
     "language": "c", 
     "name": "backoff_test", 
     "src": [
-      "test/core/backoff/backoff_test.c"
+      "test/core/backoff/backoff_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -129,7 +129,7 @@
     "language": "c", 
     "name": "bad_server_response_test", 
     "src": [
-      "test/core/end2end/bad_server_response_test.c"
+      "test/core/end2end/bad_server_response_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -144,7 +144,7 @@
     "language": "c", 
     "name": "bin_decoder_test", 
     "src": [
-      "test/core/transport/chttp2/bin_decoder_test.c"
+      "test/core/transport/chttp2/bin_decoder_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -159,7 +159,7 @@
     "language": "c", 
     "name": "bin_encoder_test", 
     "src": [
-      "test/core/transport/chttp2/bin_encoder_test.c"
+      "test/core/transport/chttp2/bin_encoder_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -176,75 +176,7 @@
     "language": "c", 
     "name": "byte_stream_test", 
     "src": [
-      "test/core/transport/byte_stream_test.c"
-    ], 
-    "third_party": false, 
-    "type": "target"
-  }, 
-  {
-    "deps": [
-      "gpr", 
-      "gpr_test_util", 
-      "grpc", 
-      "grpc_test_util"
-    ], 
-    "headers": [], 
-    "is_filegroup": false, 
-    "language": "c", 
-    "name": "census_context_test", 
-    "src": [
-      "test/core/census/context_test.c"
-    ], 
-    "third_party": false, 
-    "type": "target"
-  }, 
-  {
-    "deps": [
-      "gpr", 
-      "gpr_test_util", 
-      "grpc", 
-      "grpc_test_util"
-    ], 
-    "headers": [], 
-    "is_filegroup": false, 
-    "language": "c", 
-    "name": "census_intrusive_hash_map_test", 
-    "src": [
-      "test/core/census/intrusive_hash_map_test.c"
-    ], 
-    "third_party": false, 
-    "type": "target"
-  }, 
-  {
-    "deps": [
-      "gpr", 
-      "gpr_test_util", 
-      "grpc", 
-      "grpc_test_util"
-    ], 
-    "headers": [], 
-    "is_filegroup": false, 
-    "language": "c", 
-    "name": "census_resource_test", 
-    "src": [
-      "test/core/census/resource_test.c"
-    ], 
-    "third_party": false, 
-    "type": "target"
-  }, 
-  {
-    "deps": [
-      "gpr", 
-      "gpr_test_util", 
-      "grpc", 
-      "grpc_test_util"
-    ], 
-    "headers": [], 
-    "is_filegroup": false, 
-    "language": "c", 
-    "name": "census_trace_context_test", 
-    "src": [
-      "test/core/census/trace_context_test.c"
+      "test/core/transport/byte_stream_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -261,7 +193,7 @@
     "language": "c", 
     "name": "channel_create_test", 
     "src": [
-      "test/core/surface/channel_create_test.c"
+      "test/core/surface/channel_create_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -293,7 +225,7 @@
     "language": "c", 
     "name": "chttp2_hpack_encoder_test", 
     "src": [
-      "test/core/transport/chttp2/hpack_encoder_test.c"
+      "test/core/transport/chttp2/hpack_encoder_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -310,7 +242,7 @@
     "language": "c", 
     "name": "chttp2_stream_map_test", 
     "src": [
-      "test/core/transport/chttp2/stream_map_test.c"
+      "test/core/transport/chttp2/stream_map_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -327,7 +259,7 @@
     "language": "c", 
     "name": "chttp2_varint_test", 
     "src": [
-      "test/core/transport/chttp2/varint_test.c"
+      "test/core/transport/chttp2/varint_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -344,7 +276,7 @@
     "language": "c", 
     "name": "client_fuzzer", 
     "src": [
-      "test/core/end2end/fuzzers/client_fuzzer.c"
+      "test/core/end2end/fuzzers/client_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -361,7 +293,7 @@
     "language": "c", 
     "name": "combiner_test", 
     "src": [
-      "test/core/iomgr/combiner_test.c"
+      "test/core/iomgr/combiner_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -378,7 +310,7 @@
     "language": "c", 
     "name": "compression_test", 
     "src": [
-      "test/core/compression/compression_test.c"
+      "test/core/compression/compression_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -395,7 +327,7 @@
     "language": "c", 
     "name": "concurrent_connectivity_test", 
     "src": [
-      "test/core/surface/concurrent_connectivity_test.c"
+      "test/core/surface/concurrent_connectivity_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -412,7 +344,7 @@
     "language": "c", 
     "name": "connection_refused_test", 
     "src": [
-      "test/core/end2end/connection_refused_test.c"
+      "test/core/end2end/connection_refused_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -429,7 +361,7 @@
     "language": "c", 
     "name": "dns_resolver_connectivity_test", 
     "src": [
-      "test/core/client_channel/resolvers/dns_resolver_connectivity_test.c"
+      "test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -446,7 +378,7 @@
     "language": "c", 
     "name": "dns_resolver_test", 
     "src": [
-      "test/core/client_channel/resolvers/dns_resolver_test.c"
+      "test/core/client_channel/resolvers/dns_resolver_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -463,7 +395,7 @@
     "language": "c", 
     "name": "dualstack_socket_test", 
     "src": [
-      "test/core/end2end/dualstack_socket_test.c"
+      "test/core/end2end/dualstack_socket_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -480,7 +412,7 @@
     "language": "c", 
     "name": "endpoint_pair_test", 
     "src": [
-      "test/core/iomgr/endpoint_pair_test.c"
+      "test/core/iomgr/endpoint_pair_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -497,7 +429,7 @@
     "language": "c", 
     "name": "error_test", 
     "src": [
-      "test/core/iomgr/error_test.c"
+      "test/core/iomgr/error_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -514,7 +446,7 @@
     "language": "c", 
     "name": "ev_epollsig_linux_test", 
     "src": [
-      "test/core/iomgr/ev_epollsig_linux_test.c"
+      "test/core/iomgr/ev_epollsig_linux_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -531,7 +463,7 @@
     "language": "c", 
     "name": "fake_resolver_test", 
     "src": [
-      "test/core/client_channel/resolvers/fake_resolver_test.c"
+      "test/core/client_channel/resolvers/fake_resolver_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -548,7 +480,7 @@
     "language": "c", 
     "name": "fake_transport_security_test", 
     "src": [
-      "test/core/tsi/fake_transport_security_test.c"
+      "test/core/tsi/fake_transport_security_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -565,7 +497,7 @@
     "language": "c", 
     "name": "fd_conservation_posix_test", 
     "src": [
-      "test/core/iomgr/fd_conservation_posix_test.c"
+      "test/core/iomgr/fd_conservation_posix_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -582,7 +514,7 @@
     "language": "c", 
     "name": "fd_posix_test", 
     "src": [
-      "test/core/iomgr/fd_posix_test.c"
+      "test/core/iomgr/fd_posix_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -599,7 +531,7 @@
     "language": "c", 
     "name": "fling_client", 
     "src": [
-      "test/core/fling/client.c"
+      "test/core/fling/client.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -616,7 +548,7 @@
     "language": "c", 
     "name": "fling_server", 
     "src": [
-      "test/core/fling/server.c"
+      "test/core/fling/server.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -633,7 +565,7 @@
     "language": "c", 
     "name": "fling_stream_test", 
     "src": [
-      "test/core/fling/fling_stream_test.c"
+      "test/core/fling/fling_stream_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -650,7 +582,7 @@
     "language": "c", 
     "name": "fling_test", 
     "src": [
-      "test/core/fling/fling_test.c"
+      "test/core/fling/fling_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -706,7 +638,7 @@
     "language": "c", 
     "name": "goaway_server_test", 
     "src": [
-      "test/core/end2end/goaway_server_test.c"
+      "test/core/end2end/goaway_server_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -721,7 +653,7 @@
     "language": "c", 
     "name": "gpr_avl_test", 
     "src": [
-      "test/core/support/avl_test.c"
+      "test/core/support/avl_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -736,7 +668,7 @@
     "language": "c", 
     "name": "gpr_cmdline_test", 
     "src": [
-      "test/core/support/cmdline_test.c"
+      "test/core/support/cmdline_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -751,7 +683,7 @@
     "language": "c", 
     "name": "gpr_cpu_test", 
     "src": [
-      "test/core/support/cpu_test.c"
+      "test/core/support/cpu_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -766,7 +698,7 @@
     "language": "c", 
     "name": "gpr_env_test", 
     "src": [
-      "test/core/support/env_test.c"
+      "test/core/support/env_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -781,7 +713,7 @@
     "language": "c", 
     "name": "gpr_histogram_test", 
     "src": [
-      "test/core/support/histogram_test.c"
+      "test/core/support/histogram_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -796,7 +728,7 @@
     "language": "c", 
     "name": "gpr_host_port_test", 
     "src": [
-      "test/core/support/host_port_test.c"
+      "test/core/support/host_port_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -811,7 +743,7 @@
     "language": "c", 
     "name": "gpr_log_test", 
     "src": [
-      "test/core/support/log_test.c"
+      "test/core/support/log_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -826,7 +758,7 @@
     "language": "c", 
     "name": "gpr_mpscq_test", 
     "src": [
-      "test/core/support/mpscq_test.c"
+      "test/core/support/mpscq_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -841,7 +773,7 @@
     "language": "c", 
     "name": "gpr_spinlock_test", 
     "src": [
-      "test/core/support/spinlock_test.c"
+      "test/core/support/spinlock_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -856,7 +788,7 @@
     "language": "c", 
     "name": "gpr_stack_lockfree_test", 
     "src": [
-      "test/core/support/stack_lockfree_test.c"
+      "test/core/support/stack_lockfree_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -871,7 +803,7 @@
     "language": "c", 
     "name": "gpr_string_test", 
     "src": [
-      "test/core/support/string_test.c"
+      "test/core/support/string_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -886,7 +818,7 @@
     "language": "c", 
     "name": "gpr_sync_test", 
     "src": [
-      "test/core/support/sync_test.c"
+      "test/core/support/sync_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -901,7 +833,7 @@
     "language": "c", 
     "name": "gpr_thd_test", 
     "src": [
-      "test/core/support/thd_test.c"
+      "test/core/support/thd_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -916,7 +848,7 @@
     "language": "c", 
     "name": "gpr_time_test", 
     "src": [
-      "test/core/support/time_test.c"
+      "test/core/support/time_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -931,7 +863,7 @@
     "language": "c", 
     "name": "gpr_tls_test", 
     "src": [
-      "test/core/support/tls_test.c"
+      "test/core/support/tls_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -946,7 +878,7 @@
     "language": "c", 
     "name": "gpr_useful_test", 
     "src": [
-      "test/core/support/useful_test.c"
+      "test/core/support/useful_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -963,7 +895,7 @@
     "language": "c", 
     "name": "grpc_auth_context_test", 
     "src": [
-      "test/core/security/auth_context_test.c"
+      "test/core/security/auth_context_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -980,7 +912,7 @@
     "language": "c", 
     "name": "grpc_b64_test", 
     "src": [
-      "test/core/slice/b64_test.c"
+      "test/core/slice/b64_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -997,7 +929,7 @@
     "language": "c", 
     "name": "grpc_byte_buffer_reader_test", 
     "src": [
-      "test/core/surface/byte_buffer_reader_test.c"
+      "test/core/surface/byte_buffer_reader_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1014,7 +946,7 @@
     "language": "c", 
     "name": "grpc_channel_args_test", 
     "src": [
-      "test/core/channel/channel_args_test.c"
+      "test/core/channel/channel_args_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1031,7 +963,7 @@
     "language": "c", 
     "name": "grpc_channel_stack_builder_test", 
     "src": [
-      "test/core/channel/channel_stack_builder_test.c"
+      "test/core/channel/channel_stack_builder_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1048,7 +980,7 @@
     "language": "c", 
     "name": "grpc_channel_stack_test", 
     "src": [
-      "test/core/channel/channel_stack_test.c"
+      "test/core/channel/channel_stack_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1065,7 +997,7 @@
     "language": "c", 
     "name": "grpc_completion_queue_test", 
     "src": [
-      "test/core/surface/completion_queue_test.c"
+      "test/core/surface/completion_queue_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1082,7 +1014,7 @@
     "language": "c", 
     "name": "grpc_completion_queue_threading_test", 
     "src": [
-      "test/core/surface/completion_queue_threading_test.c"
+      "test/core/surface/completion_queue_threading_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1097,7 +1029,7 @@
     "language": "c", 
     "name": "grpc_create_jwt", 
     "src": [
-      "test/core/security/create_jwt.c"
+      "test/core/security/create_jwt.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1114,7 +1046,7 @@
     "language": "c", 
     "name": "grpc_credentials_test", 
     "src": [
-      "test/core/security/credentials_test.c"
+      "test/core/security/credentials_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1131,7 +1063,7 @@
     "language": "c", 
     "name": "grpc_fetch_oauth2", 
     "src": [
-      "test/core/security/fetch_oauth2.c"
+      "test/core/security/fetch_oauth2.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1148,7 +1080,7 @@
     "language": "c", 
     "name": "grpc_invalid_channel_args_test", 
     "src": [
-      "test/core/surface/invalid_channel_args_test.c"
+      "test/core/surface/invalid_channel_args_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1165,7 +1097,7 @@
     "language": "c", 
     "name": "grpc_json_token_test", 
     "src": [
-      "test/core/security/json_token_test.c"
+      "test/core/security/json_token_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1182,7 +1114,7 @@
     "language": "c", 
     "name": "grpc_jwt_verifier_test", 
     "src": [
-      "test/core/security/jwt_verifier_test.c"
+      "test/core/security/jwt_verifier_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1197,7 +1129,7 @@
     "language": "c", 
     "name": "grpc_print_google_default_creds_token", 
     "src": [
-      "test/core/security/print_google_default_creds_token.c"
+      "test/core/security/print_google_default_creds_token.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1214,7 +1146,24 @@
     "language": "c", 
     "name": "grpc_security_connector_test", 
     "src": [
-      "test/core/security/security_connector_test.c"
+      "test/core/security/security_connector_test.cc"
+    ], 
+    "third_party": false, 
+    "type": "target"
+  }, 
+  {
+    "deps": [
+      "gpr", 
+      "gpr_test_util", 
+      "grpc", 
+      "grpc_test_util"
+    ], 
+    "headers": [], 
+    "is_filegroup": false, 
+    "language": "c", 
+    "name": "grpc_ssl_credentials_test", 
+    "src": [
+      "test/core/security/ssl_credentials_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1229,7 +1178,7 @@
     "language": "c", 
     "name": "grpc_verify_jwt", 
     "src": [
-      "test/core/security/verify_jwt.c"
+      "test/core/security/verify_jwt.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1246,7 +1195,7 @@
     "language": "c", 
     "name": "handshake_client", 
     "src": [
-      "test/core/handshake/client_ssl.c"
+      "test/core/handshake/client_ssl.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1263,7 +1212,7 @@
     "language": "c", 
     "name": "handshake_server", 
     "src": [
-      "test/core/handshake/server_ssl.c"
+      "test/core/handshake/server_ssl.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1280,7 +1229,7 @@
     "language": "c", 
     "name": "hpack_parser_fuzzer_test", 
     "src": [
-      "test/core/transport/chttp2/hpack_parser_fuzzer_test.c"
+      "test/core/transport/chttp2/hpack_parser_fuzzer_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1297,7 +1246,7 @@
     "language": "c", 
     "name": "hpack_parser_test", 
     "src": [
-      "test/core/transport/chttp2/hpack_parser_test.c"
+      "test/core/transport/chttp2/hpack_parser_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1314,7 +1263,7 @@
     "language": "c", 
     "name": "hpack_table_test", 
     "src": [
-      "test/core/transport/chttp2/hpack_table_test.c"
+      "test/core/transport/chttp2/hpack_table_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1331,7 +1280,7 @@
     "language": "c", 
     "name": "http_parser_test", 
     "src": [
-      "test/core/http/parser_test.c"
+      "test/core/http/parser_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1348,7 +1297,7 @@
     "language": "c", 
     "name": "http_request_fuzzer_test", 
     "src": [
-      "test/core/http/request_fuzzer.c"
+      "test/core/http/request_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1365,7 +1314,7 @@
     "language": "c", 
     "name": "http_response_fuzzer_test", 
     "src": [
-      "test/core/http/response_fuzzer.c"
+      "test/core/http/response_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1382,7 +1331,7 @@
     "language": "c", 
     "name": "httpcli_format_request_test", 
     "src": [
-      "test/core/http/format_request_test.c"
+      "test/core/http/format_request_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1399,7 +1348,7 @@
     "language": "c", 
     "name": "httpcli_test", 
     "src": [
-      "test/core/http/httpcli_test.c"
+      "test/core/http/httpcli_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1416,7 +1365,7 @@
     "language": "c", 
     "name": "httpscli_test", 
     "src": [
-      "test/core/http/httpscli_test.c"
+      "test/core/http/httpscli_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1433,7 +1382,7 @@
     "language": "c", 
     "name": "init_test", 
     "src": [
-      "test/core/surface/init_test.c"
+      "test/core/surface/init_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1450,7 +1399,7 @@
     "language": "c", 
     "name": "invalid_call_argument_test", 
     "src": [
-      "test/core/end2end/invalid_call_argument_test.c"
+      "test/core/end2end/invalid_call_argument_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1467,7 +1416,7 @@
     "language": "c", 
     "name": "json_fuzzer_test", 
     "src": [
-      "test/core/json/fuzzer.c"
+      "test/core/json/fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1482,7 +1431,7 @@
     "language": "c", 
     "name": "json_rewrite", 
     "src": [
-      "test/core/json/json_rewrite.c"
+      "test/core/json/json_rewrite.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1499,7 +1448,7 @@
     "language": "c", 
     "name": "json_rewrite_test", 
     "src": [
-      "test/core/json/json_rewrite_test.c"
+      "test/core/json/json_rewrite_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1516,7 +1465,7 @@
     "language": "c", 
     "name": "json_stream_error_test", 
     "src": [
-      "test/core/json/json_stream_error_test.c"
+      "test/core/json/json_stream_error_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1533,7 +1482,7 @@
     "language": "c", 
     "name": "json_test", 
     "src": [
-      "test/core/json/json_test.c"
+      "test/core/json/json_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1550,7 +1499,7 @@
     "language": "c", 
     "name": "lame_client_test", 
     "src": [
-      "test/core/surface/lame_client_test.c"
+      "test/core/surface/lame_client_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1567,7 +1516,7 @@
     "language": "c", 
     "name": "lb_policies_test", 
     "src": [
-      "test/core/client_channel/lb_policies_test.c"
+      "test/core/client_channel/lb_policies_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1584,7 +1533,7 @@
     "language": "c", 
     "name": "load_file_test", 
     "src": [
-      "test/core/iomgr/load_file_test.c"
+      "test/core/iomgr/load_file_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1601,7 +1550,7 @@
     "language": "c", 
     "name": "low_level_ping_pong_benchmark", 
     "src": [
-      "test/core/network_benchmarks/low_level_ping_pong.c"
+      "test/core/network_benchmarks/low_level_ping_pong.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1618,7 +1567,7 @@
     "language": "c", 
     "name": "memory_profile_client", 
     "src": [
-      "test/core/memory_usage/client.c"
+      "test/core/memory_usage/client.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1635,7 +1584,7 @@
     "language": "c", 
     "name": "memory_profile_server", 
     "src": [
-      "test/core/memory_usage/server.c"
+      "test/core/memory_usage/server.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1652,7 +1601,7 @@
     "language": "c", 
     "name": "memory_profile_test", 
     "src": [
-      "test/core/memory_usage/memory_usage_test.c"
+      "test/core/memory_usage/memory_usage_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1669,7 +1618,7 @@
     "language": "c", 
     "name": "message_compress_test", 
     "src": [
-      "test/core/compression/message_compress_test.c"
+      "test/core/compression/message_compress_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1686,24 +1635,7 @@
     "language": "c", 
     "name": "minimal_stack_is_minimal_test", 
     "src": [
-      "test/core/channel/minimal_stack_is_minimal_test.c"
-    ], 
-    "third_party": false, 
-    "type": "target"
-  }, 
-  {
-    "deps": [
-      "gpr", 
-      "gpr_test_util", 
-      "grpc", 
-      "grpc_test_util"
-    ], 
-    "headers": [], 
-    "is_filegroup": false, 
-    "language": "c", 
-    "name": "mlog_test", 
-    "src": [
-      "test/core/census/mlog_test.c"
+      "test/core/channel/minimal_stack_is_minimal_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1720,7 +1652,7 @@
     "language": "c", 
     "name": "multiple_server_queues_test", 
     "src": [
-      "test/core/end2end/multiple_server_queues_test.c"
+      "test/core/end2end/multiple_server_queues_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1735,7 +1667,7 @@
     "language": "c", 
     "name": "murmur_hash_test", 
     "src": [
-      "test/core/support/murmur_hash_test.c"
+      "test/core/support/murmur_hash_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1752,7 +1684,7 @@
     "language": "c", 
     "name": "nanopb_fuzzer_response_test", 
     "src": [
-      "test/core/nanopb/fuzzer_response.c"
+      "test/core/nanopb/fuzzer_response.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1769,7 +1701,7 @@
     "language": "c", 
     "name": "nanopb_fuzzer_serverlist_test", 
     "src": [
-      "test/core/nanopb/fuzzer_serverlist.c"
+      "test/core/nanopb/fuzzer_serverlist.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1786,7 +1718,7 @@
     "language": "c", 
     "name": "no_server_test", 
     "src": [
-      "test/core/end2end/no_server_test.c"
+      "test/core/end2end/no_server_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1803,7 +1735,7 @@
     "language": "c", 
     "name": "num_external_connectivity_watchers_test", 
     "src": [
-      "test/core/surface/num_external_connectivity_watchers_test.c"
+      "test/core/surface/num_external_connectivity_watchers_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1820,7 +1752,7 @@
     "language": "c", 
     "name": "parse_address_test", 
     "src": [
-      "test/core/client_channel/parse_address_test.c"
+      "test/core/client_channel/parse_address_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1837,7 +1769,7 @@
     "language": "c", 
     "name": "percent_decode_fuzzer", 
     "src": [
-      "test/core/slice/percent_decode_fuzzer.c"
+      "test/core/slice/percent_decode_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1854,7 +1786,7 @@
     "language": "c", 
     "name": "percent_encode_fuzzer", 
     "src": [
-      "test/core/slice/percent_encode_fuzzer.c"
+      "test/core/slice/percent_encode_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1871,7 +1803,7 @@
     "language": "c", 
     "name": "percent_encoding_test", 
     "src": [
-      "test/core/slice/percent_encoding_test.c"
+      "test/core/slice/percent_encoding_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1888,7 +1820,7 @@
     "language": "c", 
     "name": "pollset_set_test", 
     "src": [
-      "test/core/iomgr/pollset_set_test.c"
+      "test/core/iomgr/pollset_set_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1905,7 +1837,7 @@
     "language": "c", 
     "name": "resolve_address_posix_test", 
     "src": [
-      "test/core/iomgr/resolve_address_posix_test.c"
+      "test/core/iomgr/resolve_address_posix_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1922,7 +1854,7 @@
     "language": "c", 
     "name": "resolve_address_test", 
     "src": [
-      "test/core/iomgr/resolve_address_test.c"
+      "test/core/iomgr/resolve_address_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1939,7 +1871,7 @@
     "language": "c", 
     "name": "resource_quota_test", 
     "src": [
-      "test/core/iomgr/resource_quota_test.c"
+      "test/core/iomgr/resource_quota_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1956,7 +1888,7 @@
     "language": "c", 
     "name": "secure_channel_create_test", 
     "src": [
-      "test/core/surface/secure_channel_create_test.c"
+      "test/core/surface/secure_channel_create_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1973,7 +1905,7 @@
     "language": "c", 
     "name": "secure_endpoint_test", 
     "src": [
-      "test/core/security/secure_endpoint_test.c"
+      "test/core/security/secure_endpoint_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -1990,7 +1922,7 @@
     "language": "c", 
     "name": "sequential_connectivity_test", 
     "src": [
-      "test/core/surface/sequential_connectivity_test.c"
+      "test/core/surface/sequential_connectivity_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2007,7 +1939,7 @@
     "language": "c", 
     "name": "server_chttp2_test", 
     "src": [
-      "test/core/surface/server_chttp2_test.c"
+      "test/core/surface/server_chttp2_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2024,7 +1956,7 @@
     "language": "c", 
     "name": "server_fuzzer", 
     "src": [
-      "test/core/end2end/fuzzers/server_fuzzer.c"
+      "test/core/end2end/fuzzers/server_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2041,7 +1973,7 @@
     "language": "c", 
     "name": "server_test", 
     "src": [
-      "test/core/surface/server_test.c"
+      "test/core/surface/server_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2058,7 +1990,7 @@
     "language": "c", 
     "name": "slice_buffer_test", 
     "src": [
-      "test/core/slice/slice_buffer_test.c"
+      "test/core/slice/slice_buffer_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2075,7 +2007,7 @@
     "language": "c", 
     "name": "slice_hash_table_test", 
     "src": [
-      "test/core/slice/slice_hash_table_test.c"
+      "test/core/slice/slice_hash_table_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2092,7 +2024,7 @@
     "language": "c", 
     "name": "slice_string_helpers_test", 
     "src": [
-      "test/core/slice/slice_string_helpers_test.c"
+      "test/core/slice/slice_string_helpers_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2109,7 +2041,7 @@
     "language": "c", 
     "name": "slice_test", 
     "src": [
-      "test/core/slice/slice_test.c"
+      "test/core/slice/slice_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2126,7 +2058,7 @@
     "language": "c", 
     "name": "sockaddr_resolver_test", 
     "src": [
-      "test/core/client_channel/resolvers/sockaddr_resolver_test.c"
+      "test/core/client_channel/resolvers/sockaddr_resolver_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2143,7 +2075,7 @@
     "language": "c", 
     "name": "sockaddr_utils_test", 
     "src": [
-      "test/core/iomgr/sockaddr_utils_test.c"
+      "test/core/iomgr/sockaddr_utils_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2160,7 +2092,7 @@
     "language": "c", 
     "name": "socket_utils_test", 
     "src": [
-      "test/core/iomgr/socket_utils_test.c"
+      "test/core/iomgr/socket_utils_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2177,7 +2109,7 @@
     "language": "c", 
     "name": "ssl_server_fuzzer", 
     "src": [
-      "test/core/security/ssl_server_fuzzer.c"
+      "test/core/security/ssl_server_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2194,7 +2126,7 @@
     "language": "c", 
     "name": "ssl_transport_security_test", 
     "src": [
-      "test/core/tsi/ssl_transport_security_test.c"
+      "test/core/tsi/ssl_transport_security_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2211,7 +2143,7 @@
     "language": "c", 
     "name": "status_conversion_test", 
     "src": [
-      "test/core/transport/status_conversion_test.c"
+      "test/core/transport/status_conversion_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2228,7 +2160,7 @@
     "language": "c", 
     "name": "stream_compression_test", 
     "src": [
-      "test/core/compression/stream_compression_test.c"
+      "test/core/compression/stream_compression_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2245,7 +2177,7 @@
     "language": "c", 
     "name": "stream_owned_slice_test", 
     "src": [
-      "test/core/transport/stream_owned_slice_test.c"
+      "test/core/transport/stream_owned_slice_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2262,7 +2194,7 @@
     "language": "c", 
     "name": "tcp_client_posix_test", 
     "src": [
-      "test/core/iomgr/tcp_client_posix_test.c"
+      "test/core/iomgr/tcp_client_posix_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2279,7 +2211,7 @@
     "language": "c", 
     "name": "tcp_client_uv_test", 
     "src": [
-      "test/core/iomgr/tcp_client_uv_test.c"
+      "test/core/iomgr/tcp_client_uv_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2296,7 +2228,7 @@
     "language": "c", 
     "name": "tcp_posix_test", 
     "src": [
-      "test/core/iomgr/tcp_posix_test.c"
+      "test/core/iomgr/tcp_posix_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2313,7 +2245,7 @@
     "language": "c", 
     "name": "tcp_server_posix_test", 
     "src": [
-      "test/core/iomgr/tcp_server_posix_test.c"
+      "test/core/iomgr/tcp_server_posix_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2330,7 +2262,7 @@
     "language": "c", 
     "name": "tcp_server_uv_test", 
     "src": [
-      "test/core/iomgr/tcp_server_uv_test.c"
+      "test/core/iomgr/tcp_server_uv_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2347,7 +2279,7 @@
     "language": "c", 
     "name": "time_averaged_stats_test", 
     "src": [
-      "test/core/iomgr/time_averaged_stats_test.c"
+      "test/core/iomgr/time_averaged_stats_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2364,7 +2296,7 @@
     "language": "c", 
     "name": "timeout_encoding_test", 
     "src": [
-      "test/core/transport/timeout_encoding_test.c"
+      "test/core/transport/timeout_encoding_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2381,7 +2313,7 @@
     "language": "c", 
     "name": "timer_heap_test", 
     "src": [
-      "test/core/iomgr/timer_heap_test.c"
+      "test/core/iomgr/timer_heap_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2398,7 +2330,7 @@
     "language": "c", 
     "name": "timer_list_test", 
     "src": [
-      "test/core/iomgr/timer_list_test.c"
+      "test/core/iomgr/timer_list_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2415,7 +2347,7 @@
     "language": "c", 
     "name": "transport_connectivity_state_test", 
     "src": [
-      "test/core/transport/connectivity_state_test.c"
+      "test/core/transport/connectivity_state_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2432,7 +2364,7 @@
     "language": "c", 
     "name": "transport_metadata_test", 
     "src": [
-      "test/core/transport/metadata_test.c"
+      "test/core/transport/metadata_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2449,7 +2381,7 @@
     "language": "c", 
     "name": "transport_security_test", 
     "src": [
-      "test/core/tsi/transport_security_test.c"
+      "test/core/tsi/transport_security_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2466,7 +2398,7 @@
     "language": "c", 
     "name": "udp_server_test", 
     "src": [
-      "test/core/iomgr/udp_server_test.c"
+      "test/core/iomgr/udp_server_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2483,7 +2415,7 @@
     "language": "c", 
     "name": "uri_fuzzer_test", 
     "src": [
-      "test/core/client_channel/uri_fuzzer_test.c"
+      "test/core/client_channel/uri_fuzzer_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2500,7 +2432,7 @@
     "language": "c", 
     "name": "uri_parser_test", 
     "src": [
-      "test/core/client_channel/uri_parser_test.c"
+      "test/core/client_channel/uri_parser_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -2517,7 +2449,7 @@
     "language": "c", 
     "name": "wakeup_fd_cv_test", 
     "src": [
-      "test/core/iomgr/wakeup_fd_cv_test.c"
+      "test/core/iomgr/wakeup_fd_cv_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -4864,7 +4796,7 @@
     "language": "c", 
     "name": "badreq_bad_client_test", 
     "src": [
-      "test/core/bad_client/tests/badreq.c"
+      "test/core/bad_client/tests/badreq.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -4882,7 +4814,7 @@
     "language": "c", 
     "name": "connection_prefix_bad_client_test", 
     "src": [
-      "test/core/bad_client/tests/connection_prefix.c"
+      "test/core/bad_client/tests/connection_prefix.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -4900,7 +4832,7 @@
     "language": "c", 
     "name": "head_of_line_blocking_bad_client_test", 
     "src": [
-      "test/core/bad_client/tests/head_of_line_blocking.c"
+      "test/core/bad_client/tests/head_of_line_blocking.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -4918,7 +4850,7 @@
     "language": "c", 
     "name": "headers_bad_client_test", 
     "src": [
-      "test/core/bad_client/tests/headers.c"
+      "test/core/bad_client/tests/headers.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -4936,7 +4868,7 @@
     "language": "c", 
     "name": "initial_settings_frame_bad_client_test", 
     "src": [
-      "test/core/bad_client/tests/initial_settings_frame.c"
+      "test/core/bad_client/tests/initial_settings_frame.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -4954,7 +4886,7 @@
     "language": "c", 
     "name": "server_registered_method_bad_client_test", 
     "src": [
-      "test/core/bad_client/tests/server_registered_method.c"
+      "test/core/bad_client/tests/server_registered_method.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -4972,7 +4904,7 @@
     "language": "c", 
     "name": "simple_request_bad_client_test", 
     "src": [
-      "test/core/bad_client/tests/simple_request.c"
+      "test/core/bad_client/tests/simple_request.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -4990,7 +4922,7 @@
     "language": "c", 
     "name": "unknown_frame_bad_client_test", 
     "src": [
-      "test/core/bad_client/tests/unknown_frame.c"
+      "test/core/bad_client/tests/unknown_frame.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5008,7 +4940,7 @@
     "language": "c", 
     "name": "window_overflow_bad_client_test", 
     "src": [
-      "test/core/bad_client/tests/window_overflow.c"
+      "test/core/bad_client/tests/window_overflow.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5026,7 +4958,7 @@
     "language": "c", 
     "name": "bad_ssl_cert_server", 
     "src": [
-      "test/core/bad_ssl/servers/cert.c"
+      "test/core/bad_ssl/servers/cert.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5043,7 +4975,7 @@
     "language": "c", 
     "name": "bad_ssl_cert_test", 
     "src": [
-      "test/core/bad_ssl/bad_ssl_test.c"
+      "test/core/bad_ssl/bad_ssl_test.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5061,7 +4993,7 @@
     "language": "c", 
     "name": "h2_census_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_census.c"
+      "test/core/end2end/fixtures/h2_census.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5079,7 +5011,7 @@
     "language": "c", 
     "name": "h2_compress_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_compress.c"
+      "test/core/end2end/fixtures/h2_compress.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5097,7 +5029,7 @@
     "language": "c", 
     "name": "h2_fakesec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_fakesec.c"
+      "test/core/end2end/fixtures/h2_fakesec.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5115,7 +5047,7 @@
     "language": "c", 
     "name": "h2_fd_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_fd.c"
+      "test/core/end2end/fixtures/h2_fd.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5133,7 +5065,7 @@
     "language": "c", 
     "name": "h2_full_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_full.c"
+      "test/core/end2end/fixtures/h2_full.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5151,7 +5083,7 @@
     "language": "c", 
     "name": "h2_full+pipe_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_full+pipe.c"
+      "test/core/end2end/fixtures/h2_full+pipe.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5169,7 +5101,7 @@
     "language": "c", 
     "name": "h2_full+trace_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_full+trace.c"
+      "test/core/end2end/fixtures/h2_full+trace.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5187,7 +5119,7 @@
     "language": "c", 
     "name": "h2_full+workarounds_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_full+workarounds.c"
+      "test/core/end2end/fixtures/h2_full+workarounds.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5205,7 +5137,7 @@
     "language": "c", 
     "name": "h2_http_proxy_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_http_proxy.c"
+      "test/core/end2end/fixtures/h2_http_proxy.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5223,7 +5155,7 @@
     "language": "c", 
     "name": "h2_load_reporting_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_load_reporting.c"
+      "test/core/end2end/fixtures/h2_load_reporting.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5241,7 +5173,7 @@
     "language": "c", 
     "name": "h2_oauth2_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_oauth2.c"
+      "test/core/end2end/fixtures/h2_oauth2.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5259,7 +5191,7 @@
     "language": "c", 
     "name": "h2_proxy_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_proxy.c"
+      "test/core/end2end/fixtures/h2_proxy.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5277,7 +5209,7 @@
     "language": "c", 
     "name": "h2_sockpair_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_sockpair.c"
+      "test/core/end2end/fixtures/h2_sockpair.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5295,7 +5227,7 @@
     "language": "c", 
     "name": "h2_sockpair+trace_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_sockpair+trace.c"
+      "test/core/end2end/fixtures/h2_sockpair+trace.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5313,7 +5245,7 @@
     "language": "c", 
     "name": "h2_sockpair_1byte_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_sockpair_1byte.c"
+      "test/core/end2end/fixtures/h2_sockpair_1byte.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5331,7 +5263,7 @@
     "language": "c", 
     "name": "h2_ssl_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_ssl.c"
+      "test/core/end2end/fixtures/h2_ssl.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5349,7 +5281,7 @@
     "language": "c", 
     "name": "h2_ssl_proxy_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_ssl_proxy.c"
+      "test/core/end2end/fixtures/h2_ssl_proxy.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5367,7 +5299,7 @@
     "language": "c", 
     "name": "h2_uds_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_uds.c"
+      "test/core/end2end/fixtures/h2_uds.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5385,7 +5317,7 @@
     "language": "c", 
     "name": "inproc_test", 
     "src": [
-      "test/core/end2end/fixtures/inproc.c"
+      "test/core/end2end/fixtures/inproc.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5403,7 +5335,7 @@
     "language": "c", 
     "name": "h2_census_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_census.c"
+      "test/core/end2end/fixtures/h2_census.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5421,7 +5353,7 @@
     "language": "c", 
     "name": "h2_compress_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_compress.c"
+      "test/core/end2end/fixtures/h2_compress.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5439,7 +5371,7 @@
     "language": "c", 
     "name": "h2_fd_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_fd.c"
+      "test/core/end2end/fixtures/h2_fd.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5457,7 +5389,7 @@
     "language": "c", 
     "name": "h2_full_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_full.c"
+      "test/core/end2end/fixtures/h2_full.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5475,7 +5407,7 @@
     "language": "c", 
     "name": "h2_full+pipe_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_full+pipe.c"
+      "test/core/end2end/fixtures/h2_full+pipe.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5493,7 +5425,7 @@
     "language": "c", 
     "name": "h2_full+trace_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_full+trace.c"
+      "test/core/end2end/fixtures/h2_full+trace.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5511,7 +5443,7 @@
     "language": "c", 
     "name": "h2_full+workarounds_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_full+workarounds.c"
+      "test/core/end2end/fixtures/h2_full+workarounds.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5529,7 +5461,7 @@
     "language": "c", 
     "name": "h2_http_proxy_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_http_proxy.c"
+      "test/core/end2end/fixtures/h2_http_proxy.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5547,7 +5479,7 @@
     "language": "c", 
     "name": "h2_load_reporting_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_load_reporting.c"
+      "test/core/end2end/fixtures/h2_load_reporting.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5565,7 +5497,7 @@
     "language": "c", 
     "name": "h2_proxy_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_proxy.c"
+      "test/core/end2end/fixtures/h2_proxy.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5583,7 +5515,7 @@
     "language": "c", 
     "name": "h2_sockpair_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_sockpair.c"
+      "test/core/end2end/fixtures/h2_sockpair.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5601,7 +5533,7 @@
     "language": "c", 
     "name": "h2_sockpair+trace_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_sockpair+trace.c"
+      "test/core/end2end/fixtures/h2_sockpair+trace.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5619,7 +5551,7 @@
     "language": "c", 
     "name": "h2_sockpair_1byte_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_sockpair_1byte.c"
+      "test/core/end2end/fixtures/h2_sockpair_1byte.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5637,7 +5569,7 @@
     "language": "c", 
     "name": "h2_uds_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/h2_uds.c"
+      "test/core/end2end/fixtures/h2_uds.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5655,7 +5587,7 @@
     "language": "c", 
     "name": "inproc_nosec_test", 
     "src": [
-      "test/core/end2end/fixtures/inproc.c"
+      "test/core/end2end/fixtures/inproc.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5752,8 +5684,8 @@
     "language": "c", 
     "name": "api_fuzzer_one_entry", 
     "src": [
-      "test/core/end2end/fuzzers/api_fuzzer.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/end2end/fuzzers/api_fuzzer.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5770,8 +5702,8 @@
     "language": "c", 
     "name": "client_fuzzer_one_entry", 
     "src": [
-      "test/core/end2end/fuzzers/client_fuzzer.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/end2end/fuzzers/client_fuzzer.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5788,8 +5720,8 @@
     "language": "c", 
     "name": "hpack_parser_fuzzer_test_one_entry", 
     "src": [
-      "test/core/transport/chttp2/hpack_parser_fuzzer_test.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/transport/chttp2/hpack_parser_fuzzer_test.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5806,8 +5738,8 @@
     "language": "c", 
     "name": "http_request_fuzzer_test_one_entry", 
     "src": [
-      "test/core/http/request_fuzzer.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/http/request_fuzzer.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5824,8 +5756,8 @@
     "language": "c", 
     "name": "http_response_fuzzer_test_one_entry", 
     "src": [
-      "test/core/http/response_fuzzer.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/http/response_fuzzer.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5842,8 +5774,8 @@
     "language": "c", 
     "name": "json_fuzzer_test_one_entry", 
     "src": [
-      "test/core/json/fuzzer.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/json/fuzzer.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5860,8 +5792,8 @@
     "language": "c", 
     "name": "nanopb_fuzzer_response_test_one_entry", 
     "src": [
-      "test/core/nanopb/fuzzer_response.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/nanopb/fuzzer_response.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5878,8 +5810,8 @@
     "language": "c", 
     "name": "nanopb_fuzzer_serverlist_test_one_entry", 
     "src": [
-      "test/core/nanopb/fuzzer_serverlist.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/nanopb/fuzzer_serverlist.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5896,8 +5828,8 @@
     "language": "c", 
     "name": "percent_decode_fuzzer_one_entry", 
     "src": [
-      "test/core/slice/percent_decode_fuzzer.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/slice/percent_decode_fuzzer.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5914,8 +5846,8 @@
     "language": "c", 
     "name": "percent_encode_fuzzer_one_entry", 
     "src": [
-      "test/core/slice/percent_encode_fuzzer.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/slice/percent_encode_fuzzer.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5932,8 +5864,8 @@
     "language": "c", 
     "name": "server_fuzzer_one_entry", 
     "src": [
-      "test/core/end2end/fuzzers/server_fuzzer.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/end2end/fuzzers/server_fuzzer.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5950,8 +5882,8 @@
     "language": "c", 
     "name": "ssl_server_fuzzer_one_entry", 
     "src": [
-      "test/core/security/ssl_server_fuzzer.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/security/ssl_server_fuzzer.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5968,8 +5900,8 @@
     "language": "c", 
     "name": "uri_fuzzer_test_one_entry", 
     "src": [
-      "test/core/client_channel/uri_fuzzer_test.c", 
-      "test/core/util/one_corpus_entry_fuzzer.c"
+      "test/core/client_channel/uri_fuzzer_test.cc", 
+      "test/core/util/one_corpus_entry_fuzzer.cc"
     ], 
     "third_party": false, 
     "type": "target"
@@ -5997,7 +5929,7 @@
     "language": "c", 
     "name": "gpr_test_util", 
     "src": [
-      "test/core/util/test_config.c", 
+      "test/core/util/test_config.cc", 
       "test/core/util/test_config.h"
     ], 
     "third_party": false, 
@@ -6084,12 +6016,12 @@
     "language": "c", 
     "name": "grpc_test_util", 
     "src": [
-      "test/core/end2end/data/client_certs.c", 
-      "test/core/end2end/data/server1_cert.c", 
-      "test/core/end2end/data/server1_key.c", 
+      "test/core/end2end/data/client_certs.cc", 
+      "test/core/end2end/data/server1_cert.cc", 
+      "test/core/end2end/data/server1_key.cc", 
       "test/core/end2end/data/ssl_test_data.h", 
-      "test/core/end2end/data/test_root_cert.c", 
-      "test/core/security/oauth2_utils.c", 
+      "test/core/end2end/data/test_root_cert.cc", 
+      "test/core/security/oauth2_utils.cc", 
       "test/core/security/oauth2_utils.h"
     ], 
     "third_party": false, 
@@ -6158,7 +6090,7 @@
     "language": "c", 
     "name": "reconnect_server", 
     "src": [
-      "test/core/util/reconnect_server.c", 
+      "test/core/util/reconnect_server.cc", 
       "test/core/util/reconnect_server.h"
     ], 
     "third_party": false, 
@@ -6178,7 +6110,7 @@
     "language": "c", 
     "name": "test_tcp_server", 
     "src": [
-      "test/core/util/test_tcp_server.c", 
+      "test/core/util/test_tcp_server.cc", 
       "test/core/util/test_tcp_server.h"
     ], 
     "third_party": false, 
@@ -7436,7 +7368,6 @@
     "headers": [
       "third_party/benchmark/include/benchmark/benchmark.h", 
       "third_party/benchmark/include/benchmark/benchmark_api.h", 
-      "third_party/benchmark/include/benchmark/macros.h", 
       "third_party/benchmark/include/benchmark/reporter.h", 
       "third_party/benchmark/src/arraysize.h", 
       "third_party/benchmark/src/benchmark_api_internal.h", 
@@ -7444,6 +7375,7 @@
       "third_party/benchmark/src/colorprint.h", 
       "third_party/benchmark/src/commandlineflags.h", 
       "third_party/benchmark/src/complexity.h", 
+      "third_party/benchmark/src/counter.h", 
       "third_party/benchmark/src/cycleclock.h", 
       "third_party/benchmark/src/internal_macros.h", 
       "third_party/benchmark/src/log.h", 
@@ -7535,7 +7467,7 @@
     "language": "c", 
     "name": "bad_client_test", 
     "src": [
-      "test/core/bad_client/bad_client.c", 
+      "test/core/bad_client/bad_client.cc", 
       "test/core/bad_client/bad_client.h"
     ], 
     "third_party": false, 
@@ -7555,7 +7487,7 @@
     "language": "c", 
     "name": "bad_ssl_test_server", 
     "src": [
-      "test/core/bad_ssl/server_common.c", 
+      "test/core/bad_ssl/server_common.cc", 
       "test/core/bad_ssl/server_common.h"
     ], 
     "third_party": false, 
@@ -7576,69 +7508,69 @@
     "language": "c", 
     "name": "end2end_tests", 
     "src": [
-      "test/core/end2end/end2end_test_utils.c", 
-      "test/core/end2end/end2end_tests.c", 
+      "test/core/end2end/end2end_test_utils.cc", 
+      "test/core/end2end/end2end_tests.cc", 
       "test/core/end2end/end2end_tests.h", 
-      "test/core/end2end/tests/authority_not_supported.c", 
-      "test/core/end2end/tests/bad_hostname.c", 
-      "test/core/end2end/tests/bad_ping.c", 
-      "test/core/end2end/tests/binary_metadata.c", 
-      "test/core/end2end/tests/call_creds.c", 
-      "test/core/end2end/tests/cancel_after_accept.c", 
-      "test/core/end2end/tests/cancel_after_client_done.c", 
-      "test/core/end2end/tests/cancel_after_invoke.c", 
-      "test/core/end2end/tests/cancel_after_round_trip.c", 
-      "test/core/end2end/tests/cancel_before_invoke.c", 
-      "test/core/end2end/tests/cancel_in_a_vacuum.c", 
+      "test/core/end2end/tests/authority_not_supported.cc", 
+      "test/core/end2end/tests/bad_hostname.cc", 
+      "test/core/end2end/tests/bad_ping.cc", 
+      "test/core/end2end/tests/binary_metadata.cc", 
+      "test/core/end2end/tests/call_creds.cc", 
+      "test/core/end2end/tests/cancel_after_accept.cc", 
+      "test/core/end2end/tests/cancel_after_client_done.cc", 
+      "test/core/end2end/tests/cancel_after_invoke.cc", 
+      "test/core/end2end/tests/cancel_after_round_trip.cc", 
+      "test/core/end2end/tests/cancel_before_invoke.cc", 
+      "test/core/end2end/tests/cancel_in_a_vacuum.cc", 
       "test/core/end2end/tests/cancel_test_helpers.h", 
-      "test/core/end2end/tests/cancel_with_status.c", 
-      "test/core/end2end/tests/compressed_payload.c", 
-      "test/core/end2end/tests/connectivity.c", 
-      "test/core/end2end/tests/default_host.c", 
-      "test/core/end2end/tests/disappearing_server.c", 
-      "test/core/end2end/tests/empty_batch.c", 
-      "test/core/end2end/tests/filter_call_init_fails.c", 
-      "test/core/end2end/tests/filter_causes_close.c", 
-      "test/core/end2end/tests/filter_latency.c", 
-      "test/core/end2end/tests/graceful_server_shutdown.c", 
-      "test/core/end2end/tests/high_initial_seqno.c", 
-      "test/core/end2end/tests/hpack_size.c", 
-      "test/core/end2end/tests/idempotent_request.c", 
-      "test/core/end2end/tests/invoke_large_request.c", 
-      "test/core/end2end/tests/keepalive_timeout.c", 
-      "test/core/end2end/tests/large_metadata.c", 
-      "test/core/end2end/tests/load_reporting_hook.c", 
-      "test/core/end2end/tests/max_concurrent_streams.c", 
-      "test/core/end2end/tests/max_connection_age.c", 
-      "test/core/end2end/tests/max_connection_idle.c", 
-      "test/core/end2end/tests/max_message_length.c", 
-      "test/core/end2end/tests/negative_deadline.c", 
-      "test/core/end2end/tests/network_status_change.c", 
-      "test/core/end2end/tests/no_logging.c", 
-      "test/core/end2end/tests/no_op.c", 
-      "test/core/end2end/tests/payload.c", 
-      "test/core/end2end/tests/ping.c", 
-      "test/core/end2end/tests/ping_pong_streaming.c", 
-      "test/core/end2end/tests/proxy_auth.c", 
-      "test/core/end2end/tests/registered_call.c", 
-      "test/core/end2end/tests/request_with_flags.c", 
-      "test/core/end2end/tests/request_with_payload.c", 
-      "test/core/end2end/tests/resource_quota_server.c", 
-      "test/core/end2end/tests/server_finishes_request.c", 
-      "test/core/end2end/tests/shutdown_finishes_calls.c", 
-      "test/core/end2end/tests/shutdown_finishes_tags.c", 
-      "test/core/end2end/tests/simple_cacheable_request.c", 
-      "test/core/end2end/tests/simple_delayed_request.c", 
-      "test/core/end2end/tests/simple_metadata.c", 
-      "test/core/end2end/tests/simple_request.c", 
-      "test/core/end2end/tests/stream_compression_compressed_payload.c", 
-      "test/core/end2end/tests/stream_compression_payload.c", 
-      "test/core/end2end/tests/stream_compression_ping_pong_streaming.c", 
-      "test/core/end2end/tests/streaming_error_response.c", 
-      "test/core/end2end/tests/trailing_metadata.c", 
-      "test/core/end2end/tests/workaround_cronet_compression.c", 
-      "test/core/end2end/tests/write_buffering.c", 
-      "test/core/end2end/tests/write_buffering_at_end.c"
+      "test/core/end2end/tests/cancel_with_status.cc", 
+      "test/core/end2end/tests/compressed_payload.cc", 
+      "test/core/end2end/tests/connectivity.cc", 
+      "test/core/end2end/tests/default_host.cc", 
+      "test/core/end2end/tests/disappearing_server.cc", 
+      "test/core/end2end/tests/empty_batch.cc", 
+      "test/core/end2end/tests/filter_call_init_fails.cc", 
+      "test/core/end2end/tests/filter_causes_close.cc", 
+      "test/core/end2end/tests/filter_latency.cc", 
+      "test/core/end2end/tests/graceful_server_shutdown.cc", 
+      "test/core/end2end/tests/high_initial_seqno.cc", 
+      "test/core/end2end/tests/hpack_size.cc", 
+      "test/core/end2end/tests/idempotent_request.cc", 
+      "test/core/end2end/tests/invoke_large_request.cc", 
+      "test/core/end2end/tests/keepalive_timeout.cc", 
+      "test/core/end2end/tests/large_metadata.cc", 
+      "test/core/end2end/tests/load_reporting_hook.cc", 
+      "test/core/end2end/tests/max_concurrent_streams.cc", 
+      "test/core/end2end/tests/max_connection_age.cc", 
+      "test/core/end2end/tests/max_connection_idle.cc", 
+      "test/core/end2end/tests/max_message_length.cc", 
+      "test/core/end2end/tests/negative_deadline.cc", 
+      "test/core/end2end/tests/network_status_change.cc", 
+      "test/core/end2end/tests/no_logging.cc", 
+      "test/core/end2end/tests/no_op.cc", 
+      "test/core/end2end/tests/payload.cc", 
+      "test/core/end2end/tests/ping.cc", 
+      "test/core/end2end/tests/ping_pong_streaming.cc", 
+      "test/core/end2end/tests/proxy_auth.cc", 
+      "test/core/end2end/tests/registered_call.cc", 
+      "test/core/end2end/tests/request_with_flags.cc", 
+      "test/core/end2end/tests/request_with_payload.cc", 
+      "test/core/end2end/tests/resource_quota_server.cc", 
+      "test/core/end2end/tests/server_finishes_request.cc", 
+      "test/core/end2end/tests/shutdown_finishes_calls.cc", 
+      "test/core/end2end/tests/shutdown_finishes_tags.cc", 
+      "test/core/end2end/tests/simple_cacheable_request.cc", 
+      "test/core/end2end/tests/simple_delayed_request.cc", 
+      "test/core/end2end/tests/simple_metadata.cc", 
+      "test/core/end2end/tests/simple_request.cc", 
+      "test/core/end2end/tests/stream_compression_compressed_payload.cc", 
+      "test/core/end2end/tests/stream_compression_payload.cc", 
+      "test/core/end2end/tests/stream_compression_ping_pong_streaming.cc", 
+      "test/core/end2end/tests/streaming_error_response.cc", 
+      "test/core/end2end/tests/trailing_metadata.cc", 
+      "test/core/end2end/tests/workaround_cronet_compression.cc", 
+      "test/core/end2end/tests/write_buffering.cc", 
+      "test/core/end2end/tests/write_buffering_at_end.cc"
     ], 
     "third_party": false, 
     "type": "lib"
@@ -7658,68 +7590,68 @@
     "language": "c", 
     "name": "end2end_nosec_tests", 
     "src": [
-      "test/core/end2end/end2end_nosec_tests.c", 
-      "test/core/end2end/end2end_test_utils.c", 
+      "test/core/end2end/end2end_nosec_tests.cc", 
+      "test/core/end2end/end2end_test_utils.cc", 
       "test/core/end2end/end2end_tests.h", 
-      "test/core/end2end/tests/authority_not_supported.c", 
-      "test/core/end2end/tests/bad_hostname.c", 
-      "test/core/end2end/tests/bad_ping.c", 
-      "test/core/end2end/tests/binary_metadata.c", 
-      "test/core/end2end/tests/cancel_after_accept.c", 
-      "test/core/end2end/tests/cancel_after_client_done.c", 
-      "test/core/end2end/tests/cancel_after_invoke.c", 
-      "test/core/end2end/tests/cancel_after_round_trip.c", 
-      "test/core/end2end/tests/cancel_before_invoke.c", 
-      "test/core/end2end/tests/cancel_in_a_vacuum.c", 
+      "test/core/end2end/tests/authority_not_supported.cc", 
+      "test/core/end2end/tests/bad_hostname.cc", 
+      "test/core/end2end/tests/bad_ping.cc", 
+      "test/core/end2end/tests/binary_metadata.cc", 
+      "test/core/end2end/tests/cancel_after_accept.cc", 
+      "test/core/end2end/tests/cancel_after_client_done.cc", 
+      "test/core/end2end/tests/cancel_after_invoke.cc", 
+      "test/core/end2end/tests/cancel_after_round_trip.cc", 
+      "test/core/end2end/tests/cancel_before_invoke.cc", 
+      "test/core/end2end/tests/cancel_in_a_vacuum.cc", 
       "test/core/end2end/tests/cancel_test_helpers.h", 
-      "test/core/end2end/tests/cancel_with_status.c", 
-      "test/core/end2end/tests/compressed_payload.c", 
-      "test/core/end2end/tests/connectivity.c", 
-      "test/core/end2end/tests/default_host.c", 
-      "test/core/end2end/tests/disappearing_server.c", 
-      "test/core/end2end/tests/empty_batch.c", 
-      "test/core/end2end/tests/filter_call_init_fails.c", 
-      "test/core/end2end/tests/filter_causes_close.c", 
-      "test/core/end2end/tests/filter_latency.c", 
-      "test/core/end2end/tests/graceful_server_shutdown.c", 
-      "test/core/end2end/tests/high_initial_seqno.c", 
-      "test/core/end2end/tests/hpack_size.c", 
-      "test/core/end2end/tests/idempotent_request.c", 
-      "test/core/end2end/tests/invoke_large_request.c", 
-      "test/core/end2end/tests/keepalive_timeout.c", 
-      "test/core/end2end/tests/large_metadata.c", 
-      "test/core/end2end/tests/load_reporting_hook.c", 
-      "test/core/end2end/tests/max_concurrent_streams.c", 
-      "test/core/end2end/tests/max_connection_age.c", 
-      "test/core/end2end/tests/max_connection_idle.c", 
-      "test/core/end2end/tests/max_message_length.c", 
-      "test/core/end2end/tests/negative_deadline.c", 
-      "test/core/end2end/tests/network_status_change.c", 
-      "test/core/end2end/tests/no_logging.c", 
-      "test/core/end2end/tests/no_op.c", 
-      "test/core/end2end/tests/payload.c", 
-      "test/core/end2end/tests/ping.c", 
-      "test/core/end2end/tests/ping_pong_streaming.c", 
-      "test/core/end2end/tests/proxy_auth.c", 
-      "test/core/end2end/tests/registered_call.c", 
-      "test/core/end2end/tests/request_with_flags.c", 
-      "test/core/end2end/tests/request_with_payload.c", 
-      "test/core/end2end/tests/resource_quota_server.c", 
-      "test/core/end2end/tests/server_finishes_request.c", 
-      "test/core/end2end/tests/shutdown_finishes_calls.c", 
-      "test/core/end2end/tests/shutdown_finishes_tags.c", 
-      "test/core/end2end/tests/simple_cacheable_request.c", 
-      "test/core/end2end/tests/simple_delayed_request.c", 
-      "test/core/end2end/tests/simple_metadata.c", 
-      "test/core/end2end/tests/simple_request.c", 
-      "test/core/end2end/tests/stream_compression_compressed_payload.c", 
-      "test/core/end2end/tests/stream_compression_payload.c", 
-      "test/core/end2end/tests/stream_compression_ping_pong_streaming.c", 
-      "test/core/end2end/tests/streaming_error_response.c", 
-      "test/core/end2end/tests/trailing_metadata.c", 
-      "test/core/end2end/tests/workaround_cronet_compression.c", 
-      "test/core/end2end/tests/write_buffering.c", 
-      "test/core/end2end/tests/write_buffering_at_end.c"
+      "test/core/end2end/tests/cancel_with_status.cc", 
+      "test/core/end2end/tests/compressed_payload.cc", 
+      "test/core/end2end/tests/connectivity.cc", 
+      "test/core/end2end/tests/default_host.cc", 
+      "test/core/end2end/tests/disappearing_server.cc", 
+      "test/core/end2end/tests/empty_batch.cc", 
+      "test/core/end2end/tests/filter_call_init_fails.cc", 
+      "test/core/end2end/tests/filter_causes_close.cc", 
+      "test/core/end2end/tests/filter_latency.cc", 
+      "test/core/end2end/tests/graceful_server_shutdown.cc", 
+      "test/core/end2end/tests/high_initial_seqno.cc", 
+      "test/core/end2end/tests/hpack_size.cc", 
+      "test/core/end2end/tests/idempotent_request.cc", 
+      "test/core/end2end/tests/invoke_large_request.cc", 
+      "test/core/end2end/tests/keepalive_timeout.cc", 
+      "test/core/end2end/tests/large_metadata.cc", 
+      "test/core/end2end/tests/load_reporting_hook.cc", 
+      "test/core/end2end/tests/max_concurrent_streams.cc", 
+      "test/core/end2end/tests/max_connection_age.cc", 
+      "test/core/end2end/tests/max_connection_idle.cc", 
+      "test/core/end2end/tests/max_message_length.cc", 
+      "test/core/end2end/tests/negative_deadline.cc", 
+      "test/core/end2end/tests/network_status_change.cc", 
+      "test/core/end2end/tests/no_logging.cc", 
+      "test/core/end2end/tests/no_op.cc", 
+      "test/core/end2end/tests/payload.cc", 
+      "test/core/end2end/tests/ping.cc", 
+      "test/core/end2end/tests/ping_pong_streaming.cc", 
+      "test/core/end2end/tests/proxy_auth.cc", 
+      "test/core/end2end/tests/registered_call.cc", 
+      "test/core/end2end/tests/request_with_flags.cc", 
+      "test/core/end2end/tests/request_with_payload.cc", 
+      "test/core/end2end/tests/resource_quota_server.cc", 
+      "test/core/end2end/tests/server_finishes_request.cc", 
+      "test/core/end2end/tests/shutdown_finishes_calls.cc", 
+      "test/core/end2end/tests/shutdown_finishes_tags.cc", 
+      "test/core/end2end/tests/simple_cacheable_request.cc", 
+      "test/core/end2end/tests/simple_delayed_request.cc", 
+      "test/core/end2end/tests/simple_metadata.cc", 
+      "test/core/end2end/tests/simple_request.cc", 
+      "test/core/end2end/tests/stream_compression_compressed_payload.cc", 
+      "test/core/end2end/tests/stream_compression_payload.cc", 
+      "test/core/end2end/tests/stream_compression_ping_pong_streaming.cc", 
+      "test/core/end2end/tests/streaming_error_response.cc", 
+      "test/core/end2end/tests/trailing_metadata.cc", 
+      "test/core/end2end/tests/workaround_cronet_compression.cc", 
+      "test/core/end2end/tests/write_buffering.cc", 
+      "test/core/end2end/tests/write_buffering_at_end.cc"
     ], 
     "third_party": false, 
     "type": "lib"
@@ -7731,64 +7663,14 @@
       "nanopb"
     ], 
     "headers": [
-      "include/grpc/census.h", 
-      "src/core/ext/census/aggregation.h", 
-      "src/core/ext/census/base_resources.h", 
-      "src/core/ext/census/census_interface.h", 
-      "src/core/ext/census/census_rpc_stats.h", 
-      "src/core/ext/census/gen/census.pb.h", 
-      "src/core/ext/census/gen/trace_context.pb.h", 
-      "src/core/ext/census/grpc_filter.h", 
-      "src/core/ext/census/intrusive_hash_map.h", 
-      "src/core/ext/census/intrusive_hash_map_internal.h", 
-      "src/core/ext/census/mlog.h", 
-      "src/core/ext/census/resource.h", 
-      "src/core/ext/census/rpc_metric_id.h", 
-      "src/core/ext/census/trace_context.h", 
-      "src/core/ext/census/trace_label.h", 
-      "src/core/ext/census/trace_propagation.h", 
-      "src/core/ext/census/trace_status.h", 
-      "src/core/ext/census/trace_string.h", 
-      "src/core/ext/census/tracing.h"
+      "include/grpc/census.h"
     ], 
     "is_filegroup": true, 
     "language": "c", 
     "name": "census", 
     "src": [
       "include/grpc/census.h", 
-      "src/core/ext/census/aggregation.h", 
-      "src/core/ext/census/base_resources.cc", 
-      "src/core/ext/census/base_resources.h", 
-      "src/core/ext/census/census_interface.h", 
-      "src/core/ext/census/census_rpc_stats.h", 
-      "src/core/ext/census/context.cc", 
-      "src/core/ext/census/gen/census.pb.c", 
-      "src/core/ext/census/gen/census.pb.h", 
-      "src/core/ext/census/gen/trace_context.pb.c", 
-      "src/core/ext/census/gen/trace_context.pb.h", 
-      "src/core/ext/census/grpc_context.cc", 
-      "src/core/ext/census/grpc_filter.cc", 
-      "src/core/ext/census/grpc_filter.h", 
-      "src/core/ext/census/grpc_plugin.cc", 
-      "src/core/ext/census/initialize.cc", 
-      "src/core/ext/census/intrusive_hash_map.cc", 
-      "src/core/ext/census/intrusive_hash_map.h", 
-      "src/core/ext/census/intrusive_hash_map_internal.h", 
-      "src/core/ext/census/mlog.cc", 
-      "src/core/ext/census/mlog.h", 
-      "src/core/ext/census/operation.cc", 
-      "src/core/ext/census/placeholders.cc", 
-      "src/core/ext/census/resource.cc", 
-      "src/core/ext/census/resource.h", 
-      "src/core/ext/census/rpc_metric_id.h", 
-      "src/core/ext/census/trace_context.cc", 
-      "src/core/ext/census/trace_context.h", 
-      "src/core/ext/census/trace_label.h", 
-      "src/core/ext/census/trace_propagation.h", 
-      "src/core/ext/census/trace_status.h", 
-      "src/core/ext/census/trace_string.h", 
-      "src/core/ext/census/tracing.cc", 
-      "src/core/ext/census/tracing.h"
+      "src/core/ext/census/grpc_context.cc"
     ], 
     "third_party": false, 
     "type": "filegroup"
@@ -8450,6 +8332,7 @@
       "grpc_deadline_filter"
     ], 
     "headers": [
+      "src/core/ext/filters/client_channel/backup_poller.h", 
       "src/core/ext/filters/client_channel/client_channel.h", 
       "src/core/ext/filters/client_channel/client_channel_factory.h", 
       "src/core/ext/filters/client_channel/connector.h", 
@@ -8473,6 +8356,8 @@
     "language": "c", 
     "name": "grpc_client_channel", 
     "src": [
+      "src/core/ext/filters/client_channel/backup_poller.cc", 
+      "src/core/ext/filters/client_channel/backup_poller.h", 
       "src/core/ext/filters/client_channel/channel_connectivity.cc", 
       "src/core/ext/filters/client_channel/client_channel.cc", 
       "src/core/ext/filters/client_channel/client_channel.h", 
@@ -8667,7 +8552,8 @@
     "deps": [
       "gpr", 
       "grpc_base", 
-      "grpc_client_channel"
+      "grpc_client_channel", 
+      "grpc_lb_subchannel_list"
     ], 
     "headers": [], 
     "is_filegroup": true, 
@@ -8683,7 +8569,8 @@
     "deps": [
       "gpr", 
       "grpc_base", 
-      "grpc_client_channel"
+      "grpc_client_channel", 
+      "grpc_lb_subchannel_list"
     ], 
     "headers": [], 
     "is_filegroup": true, 
@@ -8698,6 +8585,25 @@
   {
     "deps": [
       "gpr", 
+      "grpc_base", 
+      "grpc_client_channel"
+    ], 
+    "headers": [
+      "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
+    ], 
+    "is_filegroup": true, 
+    "language": "c", 
+    "name": "grpc_lb_subchannel_list", 
+    "src": [
+      "src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc", 
+      "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
+    ], 
+    "third_party": false, 
+    "type": "filegroup"
+  }, 
+  {
+    "deps": [
+      "gpr", 
       "grpc_base"
     ], 
     "headers": [
@@ -8957,33 +8863,33 @@
     "src": [
       "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc", 
       "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h", 
-      "test/core/end2end/cq_verifier.c", 
+      "test/core/end2end/cq_verifier.cc", 
       "test/core/end2end/cq_verifier.h", 
-      "test/core/end2end/fixtures/http_proxy_fixture.c", 
+      "test/core/end2end/fixtures/http_proxy_fixture.cc", 
       "test/core/end2end/fixtures/http_proxy_fixture.h", 
-      "test/core/end2end/fixtures/proxy.c", 
+      "test/core/end2end/fixtures/proxy.cc", 
       "test/core/end2end/fixtures/proxy.h", 
-      "test/core/iomgr/endpoint_tests.c", 
+      "test/core/iomgr/endpoint_tests.cc", 
       "test/core/iomgr/endpoint_tests.h", 
       "test/core/util/debugger_macros.cc", 
       "test/core/util/debugger_macros.h", 
-      "test/core/util/grpc_profiler.c", 
+      "test/core/util/grpc_profiler.cc", 
       "test/core/util/grpc_profiler.h", 
-      "test/core/util/memory_counters.c", 
+      "test/core/util/memory_counters.cc", 
       "test/core/util/memory_counters.h", 
-      "test/core/util/mock_endpoint.c", 
+      "test/core/util/mock_endpoint.cc", 
       "test/core/util/mock_endpoint.h", 
-      "test/core/util/parse_hexstring.c", 
+      "test/core/util/parse_hexstring.cc", 
       "test/core/util/parse_hexstring.h", 
-      "test/core/util/passthru_endpoint.c", 
+      "test/core/util/passthru_endpoint.cc", 
       "test/core/util/passthru_endpoint.h", 
-      "test/core/util/port.c", 
+      "test/core/util/port.cc", 
       "test/core/util/port.h", 
-      "test/core/util/port_server_client.c", 
+      "test/core/util/port_server_client.cc", 
       "test/core/util/port_server_client.h", 
-      "test/core/util/slice_splitter.c", 
+      "test/core/util/slice_splitter.cc", 
       "test/core/util/slice_splitter.h", 
-      "test/core/util/trickle_endpoint.c", 
+      "test/core/util/trickle_endpoint.cc", 
       "test/core/util/trickle_endpoint.h"
     ], 
     "third_party": false, 
@@ -9349,7 +9255,7 @@
     "language": "c", 
     "name": "transport_security_test_lib", 
     "src": [
-      "test/core/tsi/transport_security_test_lib.c", 
+      "test/core/tsi/transport_security_test_lib.cc", 
       "test/core/tsi/transport_security_test_lib.h"
     ], 
     "third_party": false, 
diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json
index da76372..5df5a74 100644
--- a/tools/run_tests/generated/tests.json
+++ b/tools/run_tests/generated/tests.json
@@ -258,102 +258,6 @@
     "flaky": false, 
     "gtest": false, 
     "language": "c", 
-    "name": "census_context_test", 
-    "platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "uses_polling": false
-  }, 
-  {
-    "args": [], 
-    "benchmark": false, 
-    "ci_platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "cpu_cost": 1.0, 
-    "exclude_configs": [], 
-    "exclude_iomgrs": [], 
-    "flaky": false, 
-    "gtest": false, 
-    "language": "c", 
-    "name": "census_intrusive_hash_map_test", 
-    "platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "uses_polling": false
-  }, 
-  {
-    "args": [], 
-    "benchmark": false, 
-    "ci_platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "cpu_cost": 1.0, 
-    "exclude_configs": [], 
-    "exclude_iomgrs": [], 
-    "flaky": false, 
-    "gtest": false, 
-    "language": "c", 
-    "name": "census_resource_test", 
-    "platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "uses_polling": false
-  }, 
-  {
-    "args": [], 
-    "benchmark": false, 
-    "ci_platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "cpu_cost": 1.0, 
-    "exclude_configs": [], 
-    "exclude_iomgrs": [], 
-    "flaky": false, 
-    "gtest": false, 
-    "language": "c", 
-    "name": "census_trace_context_test", 
-    "platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "uses_polling": false
-  }, 
-  {
-    "args": [], 
-    "benchmark": false, 
-    "ci_platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "cpu_cost": 1.0, 
-    "exclude_configs": [], 
-    "exclude_iomgrs": [], 
-    "flaky": false, 
-    "gtest": false, 
-    "language": "c", 
     "name": "channel_create_test", 
     "platforms": [
       "linux", 
@@ -1539,6 +1443,30 @@
     "args": [], 
     "benchmark": false, 
     "ci_platforms": [
+      "linux", 
+      "mac", 
+      "posix", 
+      "windows"
+    ], 
+    "cpu_cost": 1.0, 
+    "exclude_configs": [], 
+    "exclude_iomgrs": [], 
+    "flaky": false, 
+    "gtest": false, 
+    "language": "c", 
+    "name": "grpc_ssl_credentials_test", 
+    "platforms": [
+      "linux", 
+      "mac", 
+      "posix", 
+      "windows"
+    ], 
+    "uses_polling": true
+  }, 
+  {
+    "args": [], 
+    "benchmark": false, 
+    "ci_platforms": [
       "linux"
     ], 
     "cpu_cost": 1.0, 
@@ -1961,30 +1889,6 @@
     "cpu_cost": 1.0, 
     "exclude_configs": [], 
     "exclude_iomgrs": [], 
-    "flaky": true, 
-    "gtest": false, 
-    "language": "c", 
-    "name": "mlog_test", 
-    "platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "uses_polling": false
-  }, 
-  {
-    "args": [], 
-    "benchmark": false, 
-    "ci_platforms": [
-      "linux", 
-      "mac", 
-      "posix", 
-      "windows"
-    ], 
-    "cpu_cost": 1.0, 
-    "exclude_configs": [], 
-    "exclude_iomgrs": [], 
     "flaky": false, 
     "gtest": false, 
     "language": "c", 
@@ -3060,9 +2964,7 @@
     "uses_polling": false
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3084,9 +2986,7 @@
     "uses_polling": false
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3108,9 +3008,7 @@
     "uses_polling": false
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3132,9 +3030,7 @@
     "uses_polling": false
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3156,9 +3052,7 @@
     "uses_polling": true
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3180,9 +3074,7 @@
     "uses_polling": true
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3204,9 +3096,7 @@
     "uses_polling": true
   }, 
   {
-    "args": [
-      "--benchmark_min_time=4"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3228,9 +3118,7 @@
     "uses_polling": true
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3252,9 +3140,7 @@
     "uses_polling": false
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3281,9 +3167,7 @@
     "uses_polling": true
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3310,9 +3194,7 @@
     "uses_polling": true
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3320,7 +3202,9 @@
       "posix"
     ], 
     "cpu_cost": 1.0, 
-    "exclude_configs": [], 
+    "exclude_configs": [
+      "tsan"
+    ], 
     "exclude_iomgrs": [], 
     "excluded_poll_engines": [
       "poll", 
@@ -3339,9 +3223,7 @@
     "uses_polling": true
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3368,9 +3250,7 @@
     "uses_polling": true
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3392,9 +3272,7 @@
     "uses_polling": false
   }, 
   {
-    "args": [
-      "--benchmark_min_time=0"
-    ], 
+    "args": [], 
     "benchmark": true, 
     "ci_platforms": [
       "linux", 
@@ -3521,10 +3399,6 @@
     "cpu_cost": 1.0, 
     "exclude_configs": [], 
     "exclude_iomgrs": [], 
-    "excluded_poll_engines": [
-      "poll", 
-      "poll-cv"
-    ], 
     "flaky": false, 
     "gtest": true, 
     "language": "c++", 
@@ -3887,10 +3761,6 @@
     "cpu_cost": 1.0, 
     "exclude_configs": [], 
     "exclude_iomgrs": [], 
-    "excluded_poll_engines": [
-      "poll", 
-      "poll-cv"
-    ], 
     "flaky": false, 
     "gtest": true, 
     "language": "c++", 
@@ -3915,10 +3785,6 @@
     "cpu_cost": 1.0, 
     "exclude_configs": [], 
     "exclude_iomgrs": [], 
-    "excluded_poll_engines": [
-      "poll", 
-      "poll-cv"
-    ], 
     "flaky": false, 
     "gtest": false, 
     "language": "c++", 
@@ -4496,7 +4362,6 @@
       "posix", 
       "windows"
     ], 
-    "timeout_seconds": 1200, 
     "uses_polling": true
   }, 
   {
diff --git a/tools/run_tests/helper_scripts/build_node.bat b/tools/run_tests/helper_scripts/build_node.bat
deleted file mode 100644
index 8986239..0000000
--- a/tools/run_tests/helper_scripts/build_node.bat
+++ /dev/null
@@ -1,29 +0,0 @@
-@rem Copyright 2016 gRPC authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem     http://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-
-set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
-
-del /f /q BUILD || rmdir build /s /q
-
-call npm install --build-from-source
-
-@rem delete the redundant openssl headers
-for /f "delims=v" %%v in ('node --version') do (
-  rmdir "%USERPROFILE%\.node-gyp\%%v\include\node\openssl" /S /Q
-)
-
-
-
-@rem rebuild, because it probably failed the first time
-call npm install --build-from-source %*
diff --git a/tools/run_tests/helper_scripts/build_node.sh b/tools/run_tests/helper_scripts/build_node.sh
deleted file mode 100755
index adae4a1..0000000
--- a/tools/run_tests/helper_scripts/build_node.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-NODE_VERSION=$1
-source ~/.nvm/nvm.sh
-
-nvm use $NODE_VERSION
-set -ex
-
-CONFIG=${CONFIG:-opt}
-
-# change to grpc repo root
-cd $(dirname $0)/../../..
-
-case "$CONFIG" in
-  'dbg') config_flags='--debug' ;;
-  'gcov') config_flags="--debug --grpc_gcov=true" ;;
-  *) config_flag='--release' ;;
-esac
-
-npm install --unsafe-perm --build-from-source $config_flag
diff --git a/tools/run_tests/helper_scripts/build_node_electron.sh b/tools/run_tests/helper_scripts/build_node_electron.sh
deleted file mode 100755
index 424da2c..0000000
--- a/tools/run_tests/helper_scripts/build_node_electron.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-ELECTRON_VERSION=$1
-source ~/.nvm/nvm.sh
-
-nvm use 8
-set -ex
-
-# change to grpc repo root
-cd $(dirname $0)/../..
-
-export npm_config_target=$ELECTRON_VERSION
-export npm_config_disturl=https://atom.io/download/atom-shell
-export npm_config_runtime=electron
-export npm_config_build_from_source=true
-mkdir -p ~/.electron-gyp
-HOME=~/.electron-gyp npm update --prefer-online
-HOME=~/.electron-gyp npm install --unsafe-perm
diff --git a/tools/run_tests/helper_scripts/pre_build_node.bat b/tools/run_tests/helper_scripts/pre_build_node.bat
deleted file mode 100644
index ececc57..0000000
--- a/tools/run_tests/helper_scripts/pre_build_node.bat
+++ /dev/null
@@ -1,20 +0,0 @@
-@rem Copyright 2016 gRPC authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem     http://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-
-set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
-
-@rem Update npm to at least version 5
-call npm update -g npm
-
-call npm update --prefer-online
diff --git a/tools/run_tests/helper_scripts/pre_build_node.sh b/tools/run_tests/helper_scripts/pre_build_node.sh
deleted file mode 100755
index d4702b8..0000000
--- a/tools/run_tests/helper_scripts/pre_build_node.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-NODE_VERSION=$1
-source ~/.nvm/nvm.sh
-
-nvm install $NODE_VERSION
-set -ex
-
-export GRPC_CONFIG=${CONFIG:-opt}
-
-npm update --prefer-online
-
-npm install node-gyp-install
-./node_modules/.bin/node-gyp-install
diff --git a/tools/run_tests/helper_scripts/pre_build_node_electron.sh b/tools/run_tests/helper_scripts/pre_build_node_electron.sh
deleted file mode 100755
index 29394d2..0000000
--- a/tools/run_tests/helper_scripts/pre_build_node_electron.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-ELECTRON_VERSION=$1
-
-nvm install 8
-set -ex
-
-npm install xvfb-maybe
-
-npm install electron@$ELECTRON_VERSION
diff --git a/tools/run_tests/helper_scripts/run_node.bat b/tools/run_tests/helper_scripts/run_node.bat
deleted file mode 100644
index 26f0628..0000000
--- a/tools/run_tests/helper_scripts/run_node.bat
+++ /dev/null
@@ -1,18 +0,0 @@
-@rem Copyright 2016 gRPC authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem     http://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-
-set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
-set JUNIT_REPORT_PATH=src\node\report.xml
-set JUNIT_REPORT_STACK=1
-.\node_modules\.bin\mocha.cmd --reporter mocha-jenkins-reporter --timeout 8000 src\node\test
\ No newline at end of file
diff --git a/tools/run_tests/helper_scripts/run_node.sh b/tools/run_tests/helper_scripts/run_node.sh
deleted file mode 100755
index 3564004..0000000
--- a/tools/run_tests/helper_scripts/run_node.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-NODE_VERSION=$1
-source ~/.nvm/nvm.sh
-
-nvm use $NODE_VERSION
-set -ex
-
-CONFIG=${CONFIG:-opt}
-
-# change to grpc repo root
-cd $(dirname $0)/../../..
-
-root=`pwd`
-
-test_directory='src/node/test'
-timeout=8000
-
-if [ "$CONFIG" = "gcov" ]
-then
-  ./node_modules/.bin/istanbul cover --dir reports/node_coverage \
-    -x **/interop/* ./node_modules/.bin/_mocha -- --timeout $timeout $test_directory
-  cp -r reports/node_coverage/lcov-report/* reports/node_coverage/
-  cd build
-  gcov Release/obj.target/grpc/ext/*.o
-  lcov --base-directory . --directory . -c -o coverage.info
-  lcov -e coverage.info '**/src/node/ext/*' -o coverage.info
-  genhtml -o ../reports/node_ext_coverage --num-spaces 2 \
-    -t 'Node gRPC test coverage' coverage.info --rc genhtml_hi_limit=95 \
-    --rc genhtml_med_limit=80 --no-prefix
-else
-  JUNIT_REPORT_PATH=src/node/report.xml JUNIT_REPORT_STACK=1 \
-    ./node_modules/.bin/mocha --timeout $timeout \
-    --reporter mocha-jenkins-reporter $test_directory
-fi
diff --git a/tools/run_tests/helper_scripts/run_node_electron.sh b/tools/run_tests/helper_scripts/run_node_electron.sh
deleted file mode 100755
index 7d436b0..0000000
--- a/tools/run_tests/helper_scripts/run_node_electron.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-source ~/.nvm/nvm.sh
-
-nvm use 8
-set -ex
-
-# change to grpc repo root
-cd $(dirname $0)/../../..
-
-test_directory='src/node/test'
-timeout=8000
-
-JUNIT_REPORT_PATH=src/node/report.xml JUNIT_REPORT_STACK=1 \
-  ./node_modules/.bin/xvfb-maybe \
-  ./node_modules/.bin/electron-mocha --timeout $timeout \
-  --reporter mocha-jenkins-reporter $test_directory
diff --git a/tools/run_tests/performance/kill_workers.sh b/tools/run_tests/performance/kill_workers.sh
index dd17eea..efe7282 100755
--- a/tools/run_tests/performance/kill_workers.sh
+++ b/tools/run_tests/performance/kill_workers.sh
@@ -30,9 +30,6 @@
 # Ruby
 ps -C ruby -o pid=,cmd= | grep 'qps/worker.rb' | awk '{print $1}' | xargs kill -9 || true
 
-# Node
-ps -C node -o pid=,cmd= | grep 'performance/worker.js' | awk '{print $1}' | xargs kill -9 || true
-
 # Python
 ps -C python -o pid=,cmd= | grep 'qps_worker.py' | awk '{print $1}' | xargs kill -9 || true
 
diff --git a/tools/run_tests/performance/run_worker_node.sh b/tools/run_tests/performance/run_worker_node.sh
deleted file mode 100755
index 1286c83..0000000
--- a/tools/run_tests/performance/run_worker_node.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-# Copyright 2015 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-source ~/.nvm/nvm.sh
-nvm use 8
-
-set -ex
-
-cd $(dirname $0)/../../..
-
-node src/node/performance/worker.js $@
diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py
index ddaffa4..cafac3d 100644
--- a/tools/run_tests/performance/scenario_config.py
+++ b/tools/run_tests/performance/scenario_config.py
@@ -628,86 +628,6 @@
   def __str__(self):
     return 'csharp'
 
-
-class NodeLanguage:
-
-  def __init__(self):
-    pass
-    self.safename = str(self)
-
-  def worker_cmdline(self):
-    return ['tools/run_tests/performance/run_worker_node.sh',
-            '--benchmark_impl=grpc']
-
-  def worker_port_offset(self):
-    return 200
-
-  def scenarios(self):
-    # TODO(jtattermusch): make this scenario work
-    yield _ping_pong_scenario(
-        'node_generic_streaming_ping_pong', rpc_type='STREAMING',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_GENERIC_SERVER',
-        use_generic_payload=True)
-
-    yield _ping_pong_scenario(
-        'node_protobuf_streaming_ping_pong', rpc_type='STREAMING',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER')
-
-    yield _ping_pong_scenario(
-        'node_protobuf_unary_ping_pong', rpc_type='UNARY',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-        categories=[SCALABLE, SMOKETEST])
-
-    yield _ping_pong_scenario(
-        'cpp_to_node_unary_ping_pong', rpc_type='UNARY',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-        client_language='c++')
-
-    yield _ping_pong_scenario(
-        'node_protobuf_unary_ping_pong_1MB', rpc_type='UNARY',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-        req_size=1024*1024, resp_size=1024*1024,
-        categories=[SCALABLE])
-
-    sizes = [('1B', 1), ('1KB', 1024), ('10KB', 10 * 1024),
-             ('1MB', 1024 * 1024), ('10MB', 10 * 1024 * 1024),
-             ('100MB', 100 * 1024 * 1024)]
-
-    for size_name, size in sizes:
-      for secure in (True, False):
-        yield _ping_pong_scenario(
-            'node_protobuf_unary_ping_pong_%s_resp_%s' %
-            (size_name, 'secure' if secure else 'insecure'),
-            rpc_type='UNARY',
-            client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-            req_size=0, resp_size=size,
-            secure=secure,
-            categories=[SCALABLE])
-
-    yield _ping_pong_scenario(
-        'node_protobuf_unary_qps_unconstrained', rpc_type='UNARY',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-        unconstrained_client='async',
-        categories=[SCALABLE, SMOKETEST])
-
-    yield _ping_pong_scenario(
-        'node_protobuf_streaming_qps_unconstrained', rpc_type='STREAMING',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-        unconstrained_client='async')
-
-    yield _ping_pong_scenario(
-        'node_to_cpp_protobuf_async_unary_ping_pong', rpc_type='UNARY',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-        server_language='c++', async_server_threads=1)
-
-    yield _ping_pong_scenario(
-        'node_to_cpp_protobuf_async_streaming_ping_pong', rpc_type='STREAMING',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-        server_language='c++', async_server_threads=1)
-
-  def __str__(self):
-    return 'node'
-
 class PythonLanguage:
 
   def __init__(self):
@@ -1018,55 +938,10 @@
   def __str__(self):
     return 'go'
 
-class NodeExpressLanguage:
-
-  def __init__(self):
-    pass
-    self.safename = str(self)
-
-  def worker_cmdline(self):
-    return ['tools/run_tests/performance/run_worker_node.sh',
-            '--benchmark_impl=express']
-
-  def worker_port_offset(self):
-    return 700
-
-  def scenarios(self):
-    yield _ping_pong_scenario(
-        'node_express_json_unary_ping_pong', rpc_type='UNARY',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-        categories=[SCALABLE, SMOKETEST])
-
-    yield _ping_pong_scenario(
-        'node_express_json_async_unary_qps_unconstrained', rpc_type='UNARY',
-        client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-        unconstrained_client='async',
-        categories=[SCALABLE, SMOKETEST])
-
-    sizes = [('1B', 1), ('1KB', 1024), ('10KB', 10 * 1024),
-             ('1MB', 1024 * 1024), ('10MB', 10 * 1024 * 1024),
-             ('100MB', 100 * 1024 * 1024)]
-
-    for size_name, size in sizes:
-      for secure in (True, False):
-        yield _ping_pong_scenario(
-            'node_express_json_unary_ping_pong_%s_resp_%s' %
-            (size_name, 'secure' if secure else 'insecure'),
-            rpc_type='UNARY',
-            client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
-            req_size=0, resp_size=size,
-            secure=secure,
-            categories=[SCALABLE])
-
-  def __str__(self):
-    return 'node_express'
-
 
 LANGUAGES = {
     'c++' : CXXLanguage(),
     'csharp' : CSharpLanguage(),
-    'node' : NodeLanguage(),
-    'node_express': NodeExpressLanguage(),
     'ruby' : RubyLanguage(),
     'php7' : Php7Language(),
     'php7_protobuf_c' : Php7Language(php7_protobuf_c=True),
diff --git a/tools/run_tests/python_utils/filter_pull_request_tests.py b/tools/run_tests/python_utils/filter_pull_request_tests.py
index 56d6e4e..e880734 100644
--- a/tools/run_tests/python_utils/filter_pull_request_tests.py
+++ b/tools/run_tests/python_utils/filter_pull_request_tests.py
@@ -47,7 +47,7 @@
 _CORE_TEST_SUITE = TestSuite(['c'])
 _CPP_TEST_SUITE = TestSuite(['c++'])
 _CSHARP_TEST_SUITE = TestSuite(['csharp'])
-_NODE_TEST_SUITE = TestSuite(['node', 'grpc-node'])
+_NODE_TEST_SUITE = TestSuite(['grpc-node'])
 _OBJC_TEST_SUITE = TestSuite(['objc'])
 _PHP_TEST_SUITE = TestSuite(['php', 'php7'])
 _PYTHON_TEST_SUITE = TestSuite(['python'])
@@ -72,7 +72,6 @@
   '^summerofcode/': [],
   '^src/cpp/': [_CPP_TEST_SUITE],
   '^src/csharp/': [_CSHARP_TEST_SUITE],
-  '^src/node/': [_NODE_TEST_SUITE],
   '^src/objective\-c/': [_OBJC_TEST_SUITE],
   '^src/php/': [_PHP_TEST_SUITE],
   '^src/python/': [_PYTHON_TEST_SUITE],
@@ -82,12 +81,10 @@
   '^test/cpp/': [_CPP_TEST_SUITE],
   '^test/distrib/cpp/': [_CPP_TEST_SUITE],
   '^test/distrib/csharp/': [_CSHARP_TEST_SUITE],
-  '^test/distrib/node/': [_NODE_TEST_SUITE],
   '^test/distrib/php/': [_PHP_TEST_SUITE],
   '^test/distrib/python/': [_PYTHON_TEST_SUITE],
   '^test/distrib/ruby/': [_RUBY_TEST_SUITE],
   '^vsprojects/': [_WINDOWS_TEST_SUITE],
-  'binding\.gyp$': [_NODE_TEST_SUITE],
   'composer\.json$': [_PHP_TEST_SUITE],
   'config\.m4$': [_PHP_TEST_SUITE],
   'CONTRIBUTING\.md$': [],
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index c3d070a..766c1c0 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -296,23 +296,30 @@
         if resolver:
           env['GRPC_DNS_RESOLVER'] = resolver
         shortname_ext = '' if polling_strategy=='all' else ' GRPC_POLL_STRATEGY=%s' % polling_strategy
-        timeout_scaling = 1
-
-        if auto_timeout_scaling and polling_strategy == 'poll-cv':
-          timeout_scaling *= 5
-
         if polling_strategy in target.get('excluded_poll_engines', []):
           continue
 
-        # Scale overall test timeout if running under various sanitizers.
-        config = self.args.config
-        if auto_timeout_scaling and ('asan' in config
-                                     or config == 'msan'
-                                     or config == 'tsan'
-                                     or config == 'ubsan'
-                                     or config == 'helgrind'
-                                     or config == 'memcheck'):
-          timeout_scaling *= 20
+        timeout_scaling = 1
+        if auto_timeout_scaling:
+          config = self.args.config
+          if ('asan' in config
+              or config == 'msan'
+              or config == 'tsan'
+              or config == 'ubsan'
+              or config == 'helgrind'
+              or config == 'memcheck'):
+            # Scale overall test timeout if running under various sanitizers.
+            # scaling value is based on historical data analysis
+            timeout_scaling *= 3
+          elif polling_strategy == 'poll-cv':
+            # scale test timeout if running with poll-cv
+            # sanitizer and poll-cv scaling is not cumulative to ensure
+            # reasonable timeout values.
+            # TODO(jtattermusch): based on historical data and 5min default
+            # test timeout poll-cv scaling is currently not useful.
+            # Leaving here so it can be reintroduced if the default test timeout
+            # is decreased in the future.
+            timeout_scaling *= 1
 
         if self.config.build_config in target['exclude_configs']:
           continue
@@ -529,90 +536,6 @@
     return 'grpc-node'
 
 
-class NodeLanguage(object):
-
-  def __init__(self):
-    self.platform = platform_string()
-
-  def configure(self, config, args):
-    self.config = config
-    self.args = args
-    # Note: electron ABI only depends on major and minor version, so that's all
-    # we should specify in the compiler argument
-    _check_compiler(self.args.compiler, ['default', 'node0.12',
-                                         'node4', 'node5', 'node6',
-                                         'node7', 'node8',
-                                         'electron1.3', 'electron1.6'])
-    if self.args.compiler == 'default':
-      self.runtime = 'node'
-      self.node_version = '8'
-    else:
-      if self.args.compiler.startswith('electron'):
-        self.runtime = 'electron'
-        self.node_version = self.args.compiler[8:]
-      else:
-        self.runtime = 'node'
-        # Take off the word "node"
-        self.node_version = self.args.compiler[4:]
-
-  def test_specs(self):
-    if self.platform == 'windows':
-      return [self.config.job_spec(['tools\\run_tests\\helper_scripts\\run_node.bat'])]
-    else:
-      run_script = 'run_node'
-      if self.runtime == 'electron':
-        run_script += '_electron'
-      return [self.config.job_spec(['tools/run_tests/helper_scripts/{}.sh'.format(run_script),
-                                    self.node_version],
-                                   None,
-                                   environ=_FORCE_ENVIRON_FOR_WRAPPERS)]
-
-  def pre_build_steps(self):
-    if self.platform == 'windows':
-      return [['tools\\run_tests\\helper_scripts\\pre_build_node.bat']]
-    else:
-      build_script = 'pre_build_node'
-      if self.runtime == 'electron':
-        build_script += '_electron'
-      return [['tools/run_tests/helper_scripts/{}.sh'.format(build_script),
-               self.node_version]]
-
-  def make_targets(self):
-    return []
-
-  def make_options(self):
-    return []
-
-  def build_steps(self):
-    if self.platform == 'windows':
-      if self.config == 'dbg':
-        config_flag = '--debug'
-      else:
-        config_flag = '--release'
-      return [['tools\\run_tests\\helper_scripts\\build_node.bat',
-               config_flag]]
-    else:
-      build_script = 'build_node'
-      if self.runtime == 'electron':
-        build_script += '_electron'
-        # building for electron requires a patch version
-        self.node_version += '.0'
-      return [['tools/run_tests/helper_scripts/{}.sh'.format(build_script),
-               self.node_version]]
-
-  def post_tests_steps(self):
-    return []
-
-  def makefile_name(self):
-    return 'Makefile'
-
-  def dockerfile_dir(self):
-    return 'tools/dockerfile/test/node_jessie_%s' % _docker_arch_suffix(self.args.arch)
-
-  def __str__(self):
-    return 'node'
-
-
 class PhpLanguage(object):
 
   def configure(self, config, args):
@@ -1096,54 +1019,6 @@
   def __str__(self):
     return 'sanity'
 
-class NodeExpressLanguage(object):
-  """Dummy Node express test target to enable running express performance
-  benchmarks"""
-
-  def __init__(self):
-    self.platform = platform_string()
-
-  def configure(self, config, args):
-    self.config = config
-    self.args = args
-    _check_compiler(self.args.compiler, ['default', 'node0.12',
-                                         'node4', 'node5', 'node6'])
-    if self.args.compiler == 'default':
-      self.node_version = '4'
-    else:
-      # Take off the word "node"
-      self.node_version = self.args.compiler[4:]
-
-  def test_specs(self):
-    return []
-
-  def pre_build_steps(self):
-    if self.platform == 'windows':
-      return [['tools\\run_tests\\helper_scripts\\pre_build_node.bat']]
-    else:
-      return [['tools/run_tests/helper_scripts/pre_build_node.sh', self.node_version]]
-
-  def make_targets(self):
-    return []
-
-  def make_options(self):
-    return []
-
-  def build_steps(self):
-    return []
-
-  def post_tests_steps(self):
-    return []
-
-  def makefile_name(self):
-    return 'Makefile'
-
-  def dockerfile_dir(self):
-    return 'tools/dockerfile/test/node_jessie_%s' % _docker_arch_suffix(self.args.arch)
-
-  def __str__(self):
-    return 'node_express'
-
 # different configurations we can run under
 with open('tools/run_tests/generated/configs.json') as f:
   _CONFIGS = dict((cfg['config'], Config(**cfg)) for cfg in ast.literal_eval(f.read()))
@@ -1153,8 +1028,6 @@
     'c++': CLanguage('cxx', 'c++'),
     'c': CLanguage('c', 'c'),
     'grpc-node': RemoteNodeLanguage(),
-    'node': NodeLanguage(),
-    'node_express': NodeExpressLanguage(),
     'php': PhpLanguage(),
     'php7': Php7Language(),
     'python': PythonLanguage(),
@@ -1304,7 +1177,6 @@
                            'gcc4.4', 'gcc4.6', 'gcc4.8', 'gcc4.9', 'gcc5.3', 'gcc_musl',
                            'clang3.4', 'clang3.5', 'clang3.6', 'clang3.7',
                            'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'python_alpine', 'all_the_cpythons',
-                           'node0.12', 'node4', 'node5', 'node6', 'node7', 'node8',
                            'electron1.3', 'electron1.6',
                            'coreclr',
                            'cmake', 'cmake_vs2015', 'cmake_vs2017'],
diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py
index 34d839e..7c58d8e 100755
--- a/tools/run_tests/run_tests_matrix.py
+++ b/tools/run_tests/run_tests_matrix.py
@@ -152,8 +152,8 @@
                              extra_args=extra_args,
                              inner_jobs=inner_jobs,
                              timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
-  
-  test_jobs += _generate_jobs(languages=['csharp', 'node', 'python'],
+
+  test_jobs += _generate_jobs(languages=['csharp', 'python'],
                              configs=['dbg', 'opt'],
                              platforms=['linux', 'macos', 'windows'],
                              labels=['basictests', 'multilang'],
@@ -168,7 +168,7 @@
                               extra_args=extra_args,
                               inner_jobs=inner_jobs,
                               timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
-  
+
   test_jobs += _generate_jobs(languages=['grpc-node', 'ruby', 'php'],
                               configs=['dbg', 'opt'],
                               platforms=['linux', 'macos'],
@@ -322,42 +322,6 @@
                               inner_jobs=inner_jobs,
                               timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
 
-  test_jobs += _generate_jobs(languages=['node'],
-                              configs=['dbg'],
-                              platforms=['linux'],
-                              arch='default',
-                              compiler='electron1.6',
-                              labels=['portability', 'multilang'],
-                              extra_args=extra_args,
-                              inner_jobs=inner_jobs)
-
-  test_jobs += _generate_jobs(languages=['node'],
-                              configs=['dbg'],
-                              platforms=['linux'],
-                              arch='default',
-                              compiler='node4',
-                              labels=['portability', 'multilang'],
-                              extra_args=extra_args,
-                              inner_jobs=inner_jobs)
-
-  test_jobs += _generate_jobs(languages=['node'],
-                              configs=['dbg'],
-                              platforms=['linux'],
-                              arch='default',
-                              compiler='node6',
-                              labels=['portability', 'multilang'],
-                              extra_args=extra_args,
-                              inner_jobs=inner_jobs)
-
-  test_jobs += _generate_jobs(languages=['node'],
-                              configs=['dbg'],
-                              platforms=['linux'],
-                              arch='default',
-                              compiler='node7',
-                              labels=['portability', 'multilang'],
-                              extra_args=extra_args,
-                              inner_jobs=inner_jobs)
-
   return test_jobs
 
 
diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh
index 2aee000..1f7b078 100755
--- a/tools/run_tests/sanity/check_submodules.sh
+++ b/tools/run_tests/sanity/check_submodules.sh
@@ -26,7 +26,7 @@
 
 git submodule | awk '{ print $1 }' | sort > $submodules
 cat << EOF | awk '{ print $1 }' | sort > $want_submodules
- 44c25c892a6229b20db7cd9dc05584ea865896de third_party/benchmark (v0.1.0-343-g44c25c8)
+ 5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8 third_party/benchmark (v1.2.0)
  be2ee342d3781ddb954f91f8a7e660c6f59e87e5 third_party/boringssl (heads/chromium-stable)
  886e7d75368e3f4fab3f4d0d3584e4abfc557755 third_party/boringssl-with-bazel (version_for_cocoapods_7.0-857-g886e7d7)
  30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e third_party/gflags (v2.2.0)
diff --git a/tools/run_tests/sanity/check_test_filtering.py b/tools/run_tests/sanity/check_test_filtering.py
index a523f08..ff4ecba 100755
--- a/tools/run_tests/sanity/check_test_filtering.py
+++ b/tools/run_tests/sanity/check_test_filtering.py
@@ -25,7 +25,7 @@
 from run_tests_matrix import _create_test_jobs, _create_portability_test_jobs
 import python_utils.filter_pull_request_tests as filter_pull_request_tests
 
-_LIST_OF_LANGUAGE_LABELS = ['c', 'c++', 'csharp', 'grpc-node', 'node', 'objc', 'php', 'php7', 'python', 'ruby']
+_LIST_OF_LANGUAGE_LABELS = ['c', 'c++', 'csharp', 'grpc-node', 'objc', 'php', 'php7', 'python', 'ruby']
 _LIST_OF_PLATFORM_LABELS = ['linux', 'macos', 'windows']
 
 class TestFilteringTest(unittest.TestCase):
@@ -87,8 +87,6 @@
                                               filter_pull_request_tests._CPP_TEST_SUITE.labels])
     self.test_filtering(['src/csharp/foo.bar'], [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
                                                  filter_pull_request_tests._CSHARP_TEST_SUITE.labels])
-    self.test_filtering(['src/node/foo.bar'], [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
-                                               filter_pull_request_tests._NODE_TEST_SUITE.labels])
     self.test_filtering(['src/objective-c/foo.bar'], [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
                                                       filter_pull_request_tests._OBJC_TEST_SUITE.labels])
     self.test_filtering(['src/php/foo.bar'], [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
@@ -103,9 +101,8 @@
                         [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
                          filter_pull_request_tests._CPP_TEST_SUITE.labels and label not in
                          filter_pull_request_tests._CORE_TEST_SUITE.labels])
-    self.test_filtering(['src/node/foo.bar', 'src/cpp/foo.bar', "src/csharp/foo.bar"],
+    self.test_filtering(['src/cpp/foo.bar', "src/csharp/foo.bar"],
                         [label for label in _LIST_OF_LANGUAGE_LABELS if label not in
-                         filter_pull_request_tests._NODE_TEST_SUITE.labels and label not in
                          filter_pull_request_tests._CPP_TEST_SUITE.labels and label not in
                          filter_pull_request_tests._CSHARP_TEST_SUITE.labels])
     self.test_filtering(['src/objective-c/foo.bar', 'src/php/foo.bar', "src/python/foo.bar", "src/ruby/foo.bar"],